@{account.get('acct')} }} />,\n confirm: intl.formatMessage(messages.unfollowConfirm),\n onConfirm: () => dispatch(unfollowAccount(account.get('id'))),\n }));\n } else {\n dispatch(unfollowAccount(account.get('id')));\n }\n } else {\n dispatch(followAccount(account.get('id')));\n }\n },\n\n onBlock (account) {\n if (account.getIn(['relationship', 'blocking'])) {\n dispatch(unblockAccount(account.get('id')));\n } else {\n dispatch(blockAccount(account.get('id')));\n }\n },\n\n onMute (account) {\n if (account.getIn(['relationship', 'muting'])) {\n dispatch(unmuteAccount(account.get('id')));\n } else {\n dispatch(initMuteModal(account));\n }\n },\n\n\n onMuteNotifications (account, notifications) {\n dispatch(muteAccount(account.get('id'), notifications));\n },\n});\n\nexport default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Account));\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nexport default class ColumnHeader extends React.PureComponent {\n\n static propTypes = {\n icon: PropTypes.string,\n type: PropTypes.string,\n active: PropTypes.bool,\n onClick: PropTypes.func,\n columnHeaderId: PropTypes.string,\n };\n\n handleClick = () => {\n this.props.onClick();\n }\n\n render () {\n const { icon, type, active, columnHeaderId } = this.props;\n let iconElement = '';\n\n if (icon) {\n iconElement = ;\n }\n\n return (\n \n \n {iconElement}\n {type}\n \n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Icon from 'mastodon/components/icon';\n\nexport default class ColumnHeader extends React.PureComponent {\n\n static propTypes = {\n icon: PropTypes.string,\n type: PropTypes.string,\n active: PropTypes.bool,\n onClick: PropTypes.func,\n columnHeaderId: PropTypes.string,\n };\n\n handleClick = () => {\n this.props.onClick();\n }\n\n render () {\n const { icon, type, active, columnHeaderId } = this.props;\n let iconElement = '';\n\n if (icon) {\n iconElement = ;\n }\n\n return (\n \n \n {iconElement}\n {type}\n \n \n );\n }\n\n}\n","/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = function warning() {};\n\nif (process.env.NODE_ENV !== 'production') {\n warning = function warning(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.length < 10 || /^[s\\W]*$/.test(format)) {\n throw new Error('The warning format should be able to uniquely identify this ' + 'warning. Please, use a more descriptive format than: ' + format);\n }\n\n if (!condition) {\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n\n try {\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n };\n}\n\nmodule.exports = warning;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _inDOM = _interopRequireDefault(require(\"./inDOM\"));\n\nvar vendors = ['', 'webkit', 'moz', 'o', 'ms'];\nvar cancel = 'clearTimeout';\nvar raf = fallback;\nvar compatRaf;\n\nvar getKey = function getKey(vendor, k) {\n return vendor + (!vendor ? k : k[0].toUpperCase() + k.substr(1)) + 'AnimationFrame';\n};\n\nif (_inDOM.default) {\n vendors.some(function (vendor) {\n var rafKey = getKey(vendor, 'request');\n\n if (rafKey in window) {\n cancel = getKey(vendor, 'cancel');\n return raf = function raf(cb) {\n return window[rafKey](cb);\n };\n }\n });\n}\n/* https://github.com/component/raf */\n\n\nvar prev = new Date().getTime();\n\nfunction fallback(fn) {\n var curr = new Date().getTime(),\n ms = Math.max(0, 16 - (curr - prev)),\n req = setTimeout(fn, ms);\n prev = curr;\n return req;\n}\n\ncompatRaf = function compatRaf(cb) {\n return raf(cb);\n};\n\ncompatRaf.cancel = function (id) {\n window[cancel] && typeof window[cancel] === 'function' && window[cancel](id);\n};\n\nvar _default = compatRaf;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.isMobileSafari = isMobileSafari;\n\nfunction isMobileSafari() {\n return /iPad|iPhone|iPod/.test(window.navigator.platform) && /^((?!CriOS).)*Safari/.test(window.navigator.userAgent);\n}","module.exports = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};","/**\n * ISC License\n *\n * Copyright (c) 2018, Aleck Greenham\n *\n * Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\nimport PropTypes from \"prop-types\";\nimport React, { Component, PureComponent } from \"react\";\nimport isEqual from \"lodash.isequal\";\nimport ReactDOM from \"react-dom\";\nimport isBool from \"lodash.isboolean\";\nimport isObject from \"lodash.isobject\";\n\nvar classCallCheck = function classCallCheck(e, t) {\n if (!(e instanceof t)) throw new TypeError(\"Cannot call a class as a function\");\n},\n createClass = function () {\n function e(e, t) {\n for (var o = 0; o < t.length; o++) {\n var n = t[o];\n n.enumerable = n.enumerable || !1, n.configurable = !0, \"value\" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);\n }\n }\n\n return function (t, o, n) {\n return o && e(t.prototype, o), n && e(t, n), t;\n };\n}(),\n _extends = Object.assign || function (e) {\n for (var t = 1; t < arguments.length; t++) {\n var o = arguments[t];\n\n for (var n in o) {\n Object.prototype.hasOwnProperty.call(o, n) && (e[n] = o[n]);\n }\n }\n\n return e;\n},\n inherits = function inherits(e, t) {\n if (\"function\" != typeof t && null !== t) throw new TypeError(\"Super expression must either be null or a function, not \" + typeof t);\n e.prototype = Object.create(t && t.prototype, {\n constructor: {\n value: e,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);\n},\n objectWithoutProperties = function objectWithoutProperties(e, t) {\n var o = {};\n\n for (var n in e) {\n t.indexOf(n) >= 0 || Object.prototype.hasOwnProperty.call(e, n) && (o[n] = e[n]);\n }\n\n return o;\n},\n possibleConstructorReturn = function possibleConstructorReturn(e, t) {\n if (!e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return !t || \"object\" != typeof t && \"function\" != typeof t ? e : t;\n},\n FocusTrap = function (e) {\n function t() {\n return classCallCheck(this, t), possibleConstructorReturn(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments));\n }\n\n return inherits(t, Component), createClass(t, [{\n key: \"render\",\n value: function value() {\n var e = this.props,\n t = e.component,\n o = e.children,\n n = objectWithoutProperties(e, [\"component\", \"children\"]);\n return React.createElement(t, _extends({\n tabIndex: \"-1\"\n }, n), o);\n }\n }]), t;\n}();\n\nfunction sequencesFromKeyMap(e, t) {\n var o = e[t];\n return o ? Array.isArray(o) ? o : [o] : [t];\n}\n\nfunction hasChanged(e, t) {\n return !isEqual(e, t);\n}\n\nFocusTrap.defaultProps = {\n component: \"div\"\n};\n\nvar HotKeys = function (e) {\n function t(e, o) {\n classCallCheck(this, t);\n var n = possibleConstructorReturn(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, o));\n return n.onFocus = n.onFocus.bind(n), n.onBlur = n.onBlur.bind(n), n;\n }\n\n return inherits(t, Component), createClass(t, [{\n key: \"getChildContext\",\n value: function value() {\n return {\n hotKeyParent: this,\n hotKeyMap: this.__hotKeyMap__\n };\n }\n }, {\n key: \"componentWillMount\",\n value: function value() {\n this.updateMap();\n }\n }, {\n key: \"updateMap\",\n value: function value() {\n var e = this.buildMap();\n return !isEqual(e, this.__hotKeyMap__) && (this.__hotKeyMap__ = e, !0);\n }\n }, {\n key: \"buildMap\",\n value: function value() {\n var e = this.context.hotKeyMap || {},\n t = this.props.keyMap || {};\n return _extends({}, e, t);\n }\n }, {\n key: \"getMap\",\n value: function value() {\n return this.__hotKeyMap__;\n }\n }, {\n key: \"componentDidMount\",\n value: function value() {\n var e = require(\"mousetrap\");\n\n this.__mousetrap__ = new e(this.props.attach || ReactDOM.findDOMNode(this)), this.updateHotKeys(!0);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function value(e) {\n this.updateHotKeys(!1, e);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function value() {\n this.context.hotKeyParent && this.context.hotKeyParent.childHandledSequence(null), this.__mousetrap__ && this.__mousetrap__.reset();\n }\n }, {\n key: \"updateHotKeys\",\n value: function value() {\n var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0],\n t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},\n o = this.props.handlers,\n n = void 0 === o ? {} : o,\n r = t.handlers,\n s = void 0 === r ? n : r,\n a = this.updateMap();\n (e || a || hasChanged(n, s)) && (this.context.hotKeyParent && this.context.hotKeyParent.childHandledSequence(null), this.syncHandlersToMousetrap());\n }\n }, {\n key: \"syncHandlersToMousetrap\",\n value: function value() {\n var e = this,\n t = this.props.handlers,\n o = void 0 === t ? {} : t,\n n = this.getMap(),\n r = [],\n s = this.__mousetrap__;\n Object.keys(o).forEach(function (t) {\n var s = o[t];\n sequencesFromKeyMap(n, t).forEach(function (t) {\n var o = void 0;\n isObject(t) && (o = t.action, t = t.sequence), r.push({\n callback: function callback(t, o) {\n if ((isBool(e.props.focused) ? e.props.focused : e.__isFocused__) && o !== e.__lastChildSequence__) return e.context.hotKeyParent && e.context.hotKeyParent.childHandledSequence(o), s(t, o);\n },\n action: o,\n sequence: t\n });\n });\n }), s.reset(), r.forEach(function (e) {\n var t = e.sequence,\n o = e.callback,\n n = e.action;\n return s.bind(t, o, n);\n });\n }\n }, {\n key: \"childHandledSequence\",\n value: function value() {\n var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null;\n this.__lastChildSequence__ = e, this.context.hotKeyParent && this.context.hotKeyParent.childHandledSequence(e);\n }\n }, {\n key: \"render\",\n value: function value() {\n var e = this.props,\n t = (e.keyMap, e.handlers, e.focused, e.attach, e.children),\n o = objectWithoutProperties(e, [\"keyMap\", \"handlers\", \"focused\", \"attach\", \"children\"]);\n return React.createElement(FocusTrap, _extends({}, o, {\n onFocus: this.onFocus,\n onBlur: this.onBlur\n }), t);\n }\n }, {\n key: \"onFocus\",\n value: function value() {\n var e;\n (this.__isFocused__ = !0, this.props.onFocus) && (e = this.props).onFocus.apply(e, arguments);\n }\n }, {\n key: \"onBlur\",\n value: function value() {\n var e;\n (this.__isFocused__ = !1, this.props.onBlur) && (e = this.props).onBlur.apply(e, arguments);\n this.context.hotKeyParent && this.context.hotKeyParent.childHandledSequence(null);\n }\n }]), t;\n}();\n\nHotKeys.childContextTypes = {\n hotKeyParent: PropTypes.any,\n hotKeyMap: PropTypes.object\n}, HotKeys.contextTypes = {\n hotKeyParent: PropTypes.any,\n hotKeyMap: PropTypes.object\n};\n\nvar withHotKeys = function withHotKeys(e) {\n return function (t) {\n return function (o) {\n function n(e) {\n classCallCheck(this, n);\n var t = possibleConstructorReturn(this, (n.__proto__ || Object.getPrototypeOf(n)).call(this, e));\n return t._setRef = t._setRef.bind(t), t.state = {\n handlers: {}\n }, t;\n }\n\n return inherits(n, PureComponent), createClass(n, [{\n key: \"componentDidMount\",\n value: function value() {\n this.setState({\n handlers: this._ref.hotKeyHandlers\n });\n }\n }, {\n key: \"_setRef\",\n value: function value(e) {\n this._ref = e;\n }\n }, {\n key: \"render\",\n value: function value() {\n var o = this.state.handlers;\n return React.createElement(HotKeys, {\n component: \"document-fragment\",\n keyMap: e,\n handlers: o\n }, React.createElement(t, _extends({\n ref: this._setRef\n }, this.props)));\n }\n }]), n;\n }();\n };\n};\n\nfunction HotKeyMapMixin() {\n var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};\n return {\n contextTypes: {\n hotKeyMap: PropTypes.object\n },\n childContextTypes: {\n hotKeyMap: PropTypes.object\n },\n getChildContext: function getChildContext() {\n return {\n hotKeyMap: this.__hotKeyMap__\n };\n },\n componentWillMount: function componentWillMount() {\n this.updateMap();\n },\n updateMap: function updateMap() {\n var e = this.buildMap();\n return !isEqual(e, this.__hotKeyMap__) && (this.__hotKeyMap__ = e, !0);\n },\n buildMap: function buildMap() {\n var t = this.context.hotKeyMap || {},\n o = this.props.keyMap || {};\n return _extends({}, t, e, o);\n },\n getMap: function getMap() {\n return this.__hotKeyMap__;\n }\n };\n}\n\nexport { HotKeys, withHotKeys, FocusTrap, HotKeyMapMixin };","/*global define:false */\n\n/**\n * Copyright 2012-2017 Craig Campbell\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Mousetrap is a simple keyboard shortcut library for Javascript with\n * no external dependencies\n *\n * @version 1.6.2\n * @url craig.is/killing/mice\n */\n(function (window, document, undefined) {\n // Check if mousetrap is used inside browser, if not, return\n if (!window) {\n return;\n }\n /**\n * mapping of special keycodes to their corresponding keys\n *\n * everything in this dictionary cannot use keypress events\n * so it has to be here to map to the correct keycodes for\n * keyup/keydown events\n *\n * @type {Object}\n */\n\n\n var _MAP = {\n 8: 'backspace',\n 9: 'tab',\n 13: 'enter',\n 16: 'shift',\n 17: 'ctrl',\n 18: 'alt',\n 20: 'capslock',\n 27: 'esc',\n 32: 'space',\n 33: 'pageup',\n 34: 'pagedown',\n 35: 'end',\n 36: 'home',\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down',\n 45: 'ins',\n 46: 'del',\n 91: 'meta',\n 93: 'meta',\n 224: 'meta'\n };\n /**\n * mapping for special characters so they can support\n *\n * this dictionary is only used incase you want to bind a\n * keyup or keydown event to one of these keys\n *\n * @type {Object}\n */\n\n var _KEYCODE_MAP = {\n 106: '*',\n 107: '+',\n 109: '-',\n 110: '.',\n 111: '/',\n 186: ';',\n 187: '=',\n 188: ',',\n 189: '-',\n 190: '.',\n 191: '/',\n 192: '`',\n 219: '[',\n 220: '\\\\',\n 221: ']',\n 222: '\\''\n };\n /**\n * this is a mapping of keys that require shift on a US keypad\n * back to the non shift equivelents\n *\n * this is so you can use keyup events with these keys\n *\n * note that this will only work reliably on US keyboards\n *\n * @type {Object}\n */\n\n var _SHIFT_MAP = {\n '~': '`',\n '!': '1',\n '@': '2',\n '#': '3',\n '$': '4',\n '%': '5',\n '^': '6',\n '&': '7',\n '*': '8',\n '(': '9',\n ')': '0',\n '_': '-',\n '+': '=',\n ':': ';',\n '\\\"': '\\'',\n '<': ',',\n '>': '.',\n '?': '/',\n '|': '\\\\'\n };\n /**\n * this is a list of special strings you can use to map\n * to modifier keys when you specify your keyboard shortcuts\n *\n * @type {Object}\n */\n\n var _SPECIAL_ALIASES = {\n 'option': 'alt',\n 'command': 'meta',\n 'return': 'enter',\n 'escape': 'esc',\n 'plus': '+',\n 'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'\n };\n /**\n * variable to store the flipped version of _MAP from above\n * needed to check if we should use keypress or not when no action\n * is specified\n *\n * @type {Object|undefined}\n */\n\n var _REVERSE_MAP;\n /**\n * loop through the f keys, f1 to f19 and add them to the map\n * programatically\n */\n\n\n for (var i = 1; i < 20; ++i) {\n _MAP[111 + i] = 'f' + i;\n }\n /**\n * loop through to map numbers on the numeric keypad\n */\n\n\n for (i = 0; i <= 9; ++i) {\n // This needs to use a string cause otherwise since 0 is falsey\n // mousetrap will never fire for numpad 0 pressed as part of a keydown\n // event.\n //\n // @see https://github.com/ccampbell/mousetrap/pull/258\n _MAP[i + 96] = i.toString();\n }\n /**\n * cross browser add event method\n *\n * @param {Element|HTMLDocument} object\n * @param {string} type\n * @param {Function} callback\n * @returns void\n */\n\n\n function _addEvent(object, type, callback) {\n if (object.addEventListener) {\n object.addEventListener(type, callback, false);\n return;\n }\n\n object.attachEvent('on' + type, callback);\n }\n /**\n * takes the event and returns the key character\n *\n * @param {Event} e\n * @return {string}\n */\n\n\n function _characterFromEvent(e) {\n // for keypress events we should return the character as is\n if (e.type == 'keypress') {\n var character = String.fromCharCode(e.which); // if the shift key is not pressed then it is safe to assume\n // that we want the character to be lowercase. this means if\n // you accidentally have caps lock on then your key bindings\n // will continue to work\n //\n // the only side effect that might not be desired is if you\n // bind something like 'A' cause you want to trigger an\n // event when capital A is pressed caps lock will no longer\n // trigger the event. shift+a will though.\n\n if (!e.shiftKey) {\n character = character.toLowerCase();\n }\n\n return character;\n } // for non keypress events the special maps are needed\n\n\n if (_MAP[e.which]) {\n return _MAP[e.which];\n }\n\n if (_KEYCODE_MAP[e.which]) {\n return _KEYCODE_MAP[e.which];\n } // if it is not in the special map\n // with keydown and keyup events the character seems to always\n // come in as an uppercase character whether you are pressing shift\n // or not. we should make sure it is always lowercase for comparisons\n\n\n return String.fromCharCode(e.which).toLowerCase();\n }\n /**\n * checks if two arrays are equal\n *\n * @param {Array} modifiers1\n * @param {Array} modifiers2\n * @returns {boolean}\n */\n\n\n function _modifiersMatch(modifiers1, modifiers2) {\n return modifiers1.sort().join(',') === modifiers2.sort().join(',');\n }\n /**\n * takes a key event and figures out what the modifiers are\n *\n * @param {Event} e\n * @returns {Array}\n */\n\n\n function _eventModifiers(e) {\n var modifiers = [];\n\n if (e.shiftKey) {\n modifiers.push('shift');\n }\n\n if (e.altKey) {\n modifiers.push('alt');\n }\n\n if (e.ctrlKey) {\n modifiers.push('ctrl');\n }\n\n if (e.metaKey) {\n modifiers.push('meta');\n }\n\n return modifiers;\n }\n /**\n * prevents default for this event\n *\n * @param {Event} e\n * @returns void\n */\n\n\n function _preventDefault(e) {\n if (e.preventDefault) {\n e.preventDefault();\n return;\n }\n\n e.returnValue = false;\n }\n /**\n * stops propogation for this event\n *\n * @param {Event} e\n * @returns void\n */\n\n\n function _stopPropagation(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n return;\n }\n\n e.cancelBubble = true;\n }\n /**\n * determines if the keycode specified is a modifier key or not\n *\n * @param {string} key\n * @returns {boolean}\n */\n\n\n function _isModifier(key) {\n return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';\n }\n /**\n * reverses the map lookup so that we can look for specific keys\n * to see what can and can't use keypress\n *\n * @return {Object}\n */\n\n\n function _getReverseMap() {\n if (!_REVERSE_MAP) {\n _REVERSE_MAP = {};\n\n for (var key in _MAP) {\n // pull out the numeric keypad from here cause keypress should\n // be able to detect the keys from the character\n if (key > 95 && key < 112) {\n continue;\n }\n\n if (_MAP.hasOwnProperty(key)) {\n _REVERSE_MAP[_MAP[key]] = key;\n }\n }\n }\n\n return _REVERSE_MAP;\n }\n /**\n * picks the best action based on the key combination\n *\n * @param {string} key - character for key\n * @param {Array} modifiers\n * @param {string=} action passed in\n */\n\n\n function _pickBestAction(key, modifiers, action) {\n // if no action was picked in we should try to pick the one\n // that we think would work best for this key\n if (!action) {\n action = _getReverseMap()[key] ? 'keydown' : 'keypress';\n } // modifier keys don't work as expected with keypress,\n // switch to keydown\n\n\n if (action == 'keypress' && modifiers.length) {\n action = 'keydown';\n }\n\n return action;\n }\n /**\n * Converts from a string key combination to an array\n *\n * @param {string} combination like \"command+shift+l\"\n * @return {Array}\n */\n\n\n function _keysFromString(combination) {\n if (combination === '+') {\n return ['+'];\n }\n\n combination = combination.replace(/\\+{2}/g, '+plus');\n return combination.split('+');\n }\n /**\n * Gets info for a specific key combination\n *\n * @param {string} combination key combination (\"command+s\" or \"a\" or \"*\")\n * @param {string=} action\n * @returns {Object}\n */\n\n\n function _getKeyInfo(combination, action) {\n var keys;\n var key;\n var i;\n var modifiers = []; // take the keys from this pattern and figure out what the actual\n // pattern is all about\n\n keys = _keysFromString(combination);\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i]; // normalize key names\n\n if (_SPECIAL_ALIASES[key]) {\n key = _SPECIAL_ALIASES[key];\n } // if this is not a keypress event then we should\n // be smart about using shift keys\n // this will only work for US keyboards however\n\n\n if (action && action != 'keypress' && _SHIFT_MAP[key]) {\n key = _SHIFT_MAP[key];\n modifiers.push('shift');\n } // if this key is a modifier then add it to the list of modifiers\n\n\n if (_isModifier(key)) {\n modifiers.push(key);\n }\n } // depending on what the key combination is\n // we will try to pick the best event for it\n\n\n action = _pickBestAction(key, modifiers, action);\n return {\n key: key,\n modifiers: modifiers,\n action: action\n };\n }\n\n function _belongsTo(element, ancestor) {\n if (element === null || element === document) {\n return false;\n }\n\n if (element === ancestor) {\n return true;\n }\n\n return _belongsTo(element.parentNode, ancestor);\n }\n\n function Mousetrap(targetElement) {\n var self = this;\n targetElement = targetElement || document;\n\n if (!(self instanceof Mousetrap)) {\n return new Mousetrap(targetElement);\n }\n /**\n * element to attach key events to\n *\n * @type {Element}\n */\n\n\n self.target = targetElement;\n /**\n * a list of all the callbacks setup via Mousetrap.bind()\n *\n * @type {Object}\n */\n\n self._callbacks = {};\n /**\n * direct map of string combinations to callbacks used for trigger()\n *\n * @type {Object}\n */\n\n self._directMap = {};\n /**\n * keeps track of what level each sequence is at since multiple\n * sequences can start out with the same sequence\n *\n * @type {Object}\n */\n\n var _sequenceLevels = {};\n /**\n * variable to store the setTimeout call\n *\n * @type {null|number}\n */\n\n var _resetTimer;\n /**\n * temporary state where we will ignore the next keyup\n *\n * @type {boolean|string}\n */\n\n\n var _ignoreNextKeyup = false;\n /**\n * temporary state where we will ignore the next keypress\n *\n * @type {boolean}\n */\n\n var _ignoreNextKeypress = false;\n /**\n * are we currently inside of a sequence?\n * type of action (\"keyup\" or \"keydown\" or \"keypress\") or false\n *\n * @type {boolean|string}\n */\n\n var _nextExpectedAction = false;\n /**\n * resets all sequence counters except for the ones passed in\n *\n * @param {Object} doNotReset\n * @returns void\n */\n\n function _resetSequences(doNotReset) {\n doNotReset = doNotReset || {};\n var activeSequences = false,\n key;\n\n for (key in _sequenceLevels) {\n if (doNotReset[key]) {\n activeSequences = true;\n continue;\n }\n\n _sequenceLevels[key] = 0;\n }\n\n if (!activeSequences) {\n _nextExpectedAction = false;\n }\n }\n /**\n * finds all callbacks that match based on the keycode, modifiers,\n * and action\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event|Object} e\n * @param {string=} sequenceName - name of the sequence we are looking for\n * @param {string=} combination\n * @param {number=} level\n * @returns {Array}\n */\n\n\n function _getMatches(character, modifiers, e, sequenceName, combination, level) {\n var i;\n var callback;\n var matches = [];\n var action = e.type; // if there are no events related to this keycode\n\n if (!self._callbacks[character]) {\n return [];\n } // if a modifier key is coming up on its own we should allow it\n\n\n if (action == 'keyup' && _isModifier(character)) {\n modifiers = [character];\n } // loop through all callbacks for the key that was pressed\n // and see if any of them match\n\n\n for (i = 0; i < self._callbacks[character].length; ++i) {\n callback = self._callbacks[character][i]; // if a sequence name is not specified, but this is a sequence at\n // the wrong level then move onto the next match\n\n if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {\n continue;\n } // if the action we are looking for doesn't match the action we got\n // then we should keep going\n\n\n if (action != callback.action) {\n continue;\n } // if this is a keypress event and the meta key and control key\n // are not pressed that means that we need to only look at the\n // character, otherwise check the modifiers as well\n //\n // chrome will not fire a keypress if meta or control is down\n // safari will fire a keypress if meta or meta+shift is down\n // firefox will fire a keypress if meta or control is down\n\n\n if (action == 'keypress' && !e.metaKey && !e.ctrlKey || _modifiersMatch(modifiers, callback.modifiers)) {\n // when you bind a combination or sequence a second time it\n // should overwrite the first one. if a sequenceName or\n // combination is specified in this call it does just that\n //\n // @todo make deleting its own method?\n var deleteCombo = !sequenceName && callback.combo == combination;\n var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;\n\n if (deleteCombo || deleteSequence) {\n self._callbacks[character].splice(i, 1);\n }\n\n matches.push(callback);\n }\n }\n\n return matches;\n }\n /**\n * actually calls the callback function\n *\n * if your callback function returns false this will use the jquery\n * convention - prevent default and stop propogation on the event\n *\n * @param {Function} callback\n * @param {Event} e\n * @returns void\n */\n\n\n function _fireCallback(callback, e, combo, sequence) {\n // if this event should not happen stop here\n if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {\n return;\n }\n\n if (callback(e, combo) === false) {\n _preventDefault(e);\n\n _stopPropagation(e);\n }\n }\n /**\n * handles a character key event\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event} e\n * @returns void\n */\n\n\n self._handleKey = function (character, modifiers, e) {\n var callbacks = _getMatches(character, modifiers, e);\n\n var i;\n var doNotReset = {};\n var maxLevel = 0;\n var processedSequenceCallback = false; // Calculate the maxLevel for sequences so we can only execute the longest callback sequence\n\n for (i = 0; i < callbacks.length; ++i) {\n if (callbacks[i].seq) {\n maxLevel = Math.max(maxLevel, callbacks[i].level);\n }\n } // loop through matching callbacks for this key event\n\n\n for (i = 0; i < callbacks.length; ++i) {\n // fire for all sequence callbacks\n // this is because if for example you have multiple sequences\n // bound such as \"g i\" and \"g t\" they both need to fire the\n // callback for matching g cause otherwise you can only ever\n // match the first one\n if (callbacks[i].seq) {\n // only fire callbacks for the maxLevel to prevent\n // subsequences from also firing\n //\n // for example 'a option b' should not cause 'option b' to fire\n // even though 'option b' is part of the other sequence\n //\n // any sequences that do not match here will be discarded\n // below by the _resetSequences call\n if (callbacks[i].level != maxLevel) {\n continue;\n }\n\n processedSequenceCallback = true; // keep a list of which sequences were matches for later\n\n doNotReset[callbacks[i].seq] = 1;\n\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);\n\n continue;\n } // if there were no sequence matches but we are still here\n // that means this is a regular match so we should fire that\n\n\n if (!processedSequenceCallback) {\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo);\n }\n } // if the key you pressed matches the type of sequence without\n // being a modifier (ie \"keyup\" or \"keypress\") then we should\n // reset all sequences that were not matched by this event\n //\n // this is so, for example, if you have the sequence \"h a t\" and you\n // type \"h e a r t\" it does not match. in this case the \"e\" will\n // cause the sequence to reset\n //\n // modifier keys are ignored because you can have a sequence\n // that contains modifiers such as \"enter ctrl+space\" and in most\n // cases the modifier key will be pressed before the next key\n //\n // also if you have a sequence such as \"ctrl+b a\" then pressing the\n // \"b\" key will trigger a \"keypress\" and a \"keydown\"\n //\n // the \"keydown\" is expected when there is a modifier, but the\n // \"keypress\" ends up matching the _nextExpectedAction since it occurs\n // after and that causes the sequence to reset\n //\n // we ignore keypresses in a sequence that directly follow a keydown\n // for the same character\n\n\n var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;\n\n if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {\n _resetSequences(doNotReset);\n }\n\n _ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';\n };\n /**\n * handles a keydown event\n *\n * @param {Event} e\n * @returns void\n */\n\n\n function _handleKeyEvent(e) {\n // normalize e.which for key events\n // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion\n if (typeof e.which !== 'number') {\n e.which = e.keyCode;\n }\n\n var character = _characterFromEvent(e); // no character found then stop\n\n\n if (!character) {\n return;\n } // need to use === for the character check because the character can be 0\n\n\n if (e.type == 'keyup' && _ignoreNextKeyup === character) {\n _ignoreNextKeyup = false;\n return;\n }\n\n self.handleKey(character, _eventModifiers(e), e);\n }\n /**\n * called to set a 1 second timeout on the specified sequence\n *\n * this is so after each key press in the sequence you have 1 second\n * to press the next key before you have to start over\n *\n * @returns void\n */\n\n\n function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }\n /**\n * binds a key sequence to an event\n *\n * @param {string} combo - combo specified in bind call\n * @param {Array} keys\n * @param {Function} callback\n * @param {string=} action\n * @returns void\n */\n\n\n function _bindSequence(combo, keys, callback, action) {\n // start off by adding a sequence level record for this combination\n // and setting the level to 0\n _sequenceLevels[combo] = 0;\n /**\n * callback to increase the sequence level for this sequence and reset\n * all other sequences that were active\n *\n * @param {string} nextAction\n * @returns {Function}\n */\n\n function _increaseSequence(nextAction) {\n return function () {\n _nextExpectedAction = nextAction;\n ++_sequenceLevels[combo];\n\n _resetSequenceTimer();\n };\n }\n /**\n * wraps the specified callback inside of another function in order\n * to reset all sequence counters as soon as this sequence is done\n *\n * @param {Event} e\n * @returns void\n */\n\n\n function _callbackAndReset(e) {\n _fireCallback(callback, e, combo); // we should ignore the next key up if the action is key down\n // or keypress. this is so if you finish a sequence and\n // release the key the final key will not trigger a keyup\n\n\n if (action !== 'keyup') {\n _ignoreNextKeyup = _characterFromEvent(e);\n } // weird race condition if a sequence ends with the key\n // another sequence begins with\n\n\n setTimeout(_resetSequences, 10);\n } // loop through keys one at a time and bind the appropriate callback\n // function. for any key leading up to the final one it should\n // increase the sequence. after the final, it should reset all sequences\n //\n // if an action is specified in the original bind call then that will\n // be used throughout. otherwise we will pass the action that the\n // next key in the sequence should match. this allows a sequence\n // to mix and match keypress and keydown events depending on which\n // ones are better suited to the key provided\n\n\n for (var i = 0; i < keys.length; ++i) {\n var isFinal = i + 1 === keys.length;\n var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);\n\n _bindSingle(keys[i], wrappedCallback, action, combo, i);\n }\n }\n /**\n * binds a single keyboard combination\n *\n * @param {string} combination\n * @param {Function} callback\n * @param {string=} action\n * @param {string=} sequenceName - name of sequence if part of sequence\n * @param {number=} level - what part of the sequence the command is\n * @returns void\n */\n\n\n function _bindSingle(combination, callback, action, sequenceName, level) {\n // store a direct mapped reference for use with Mousetrap.trigger\n self._directMap[combination + ':' + action] = callback; // make sure multiple spaces in a row become a single space\n\n combination = combination.replace(/\\s+/g, ' ');\n var sequence = combination.split(' ');\n var info; // if this pattern is a sequence of keys then run through this method\n // to reprocess each pattern one key at a time\n\n if (sequence.length > 1) {\n _bindSequence(combination, sequence, callback, action);\n\n return;\n }\n\n info = _getKeyInfo(combination, action); // make sure to initialize array if this is the first time\n // a callback is added for this key\n\n self._callbacks[info.key] = self._callbacks[info.key] || []; // remove an existing match if there is one\n\n _getMatches(info.key, info.modifiers, {\n type: info.action\n }, sequenceName, combination, level); // add this call back to the array\n // if it is a sequence put it at the beginning\n // if not put it at the end\n //\n // this is important because the way these are processed expects\n // the sequence ones to come first\n\n\n self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({\n callback: callback,\n modifiers: info.modifiers,\n action: info.action,\n seq: sequenceName,\n level: level,\n combo: combination\n });\n }\n /**\n * binds multiple combinations to the same callback\n *\n * @param {Array} combinations\n * @param {Function} callback\n * @param {string|undefined} action\n * @returns void\n */\n\n\n self._bindMultiple = function (combinations, callback, action) {\n for (var i = 0; i < combinations.length; ++i) {\n _bindSingle(combinations[i], callback, action);\n }\n }; // start!\n\n\n _addEvent(targetElement, 'keypress', _handleKeyEvent);\n\n _addEvent(targetElement, 'keydown', _handleKeyEvent);\n\n _addEvent(targetElement, 'keyup', _handleKeyEvent);\n }\n /**\n * binds an event to mousetrap\n *\n * can be a single key, a combination of keys separated with +,\n * an array of keys, or a sequence of keys separated by spaces\n *\n * be sure to list the modifier keys first to make sure that the\n * correct key ends up getting bound (the last key in the pattern)\n *\n * @param {string|Array} keys\n * @param {Function} callback\n * @param {string=} action - 'keypress', 'keydown', or 'keyup'\n * @returns void\n */\n\n\n Mousetrap.prototype.bind = function (keys, callback, action) {\n var self = this;\n keys = keys instanceof Array ? keys : [keys];\n\n self._bindMultiple.call(self, keys, callback, action);\n\n return self;\n };\n /**\n * unbinds an event to mousetrap\n *\n * the unbinding sets the callback function of the specified key combo\n * to an empty function and deletes the corresponding key in the\n * _directMap dict.\n *\n * TODO: actually remove this from the _callbacks dictionary instead\n * of binding an empty function\n *\n * the keycombo+action has to be exactly the same as\n * it was defined in the bind method\n *\n * @param {string|Array} keys\n * @param {string} action\n * @returns void\n */\n\n\n Mousetrap.prototype.unbind = function (keys, action) {\n var self = this;\n return self.bind.call(self, keys, function () {}, action);\n };\n /**\n * triggers an event that has already been bound\n *\n * @param {string} keys\n * @param {string=} action\n * @returns void\n */\n\n\n Mousetrap.prototype.trigger = function (keys, action) {\n var self = this;\n\n if (self._directMap[keys + ':' + action]) {\n self._directMap[keys + ':' + action]({}, keys);\n }\n\n return self;\n };\n /**\n * resets the library back to its initial state. this is useful\n * if you want to clear out the current keyboard shortcuts and bind\n * new ones - for example if you switch to another page\n *\n * @returns void\n */\n\n\n Mousetrap.prototype.reset = function () {\n var self = this;\n self._callbacks = {};\n self._directMap = {};\n return self;\n };\n /**\n * should we stop this event before firing off callbacks\n *\n * @param {Event} e\n * @param {Element} element\n * @return {boolean}\n */\n\n\n Mousetrap.prototype.stopCallback = function (e, element) {\n var self = this; // if the element has the class \"mousetrap\" then no need to stop\n\n if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {\n return false;\n }\n\n if (_belongsTo(element, self.target)) {\n return false;\n } // stop for input, select, and textarea\n\n\n return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;\n };\n /**\n * exposes _handleKey publicly so it can be overwritten by extensions\n */\n\n\n Mousetrap.prototype.handleKey = function () {\n var self = this;\n return self._handleKey.apply(self, arguments);\n };\n /**\n * allow custom key mappings\n */\n\n\n Mousetrap.addKeycodes = function (object) {\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n _MAP[key] = object[key];\n }\n }\n\n _REVERSE_MAP = null;\n };\n /**\n * Init the global mousetrap functions\n *\n * This method is needed to allow the global mousetrap functions to work\n * now that mousetrap is a constructor function.\n */\n\n\n Mousetrap.init = function () {\n var documentMousetrap = Mousetrap(document);\n\n for (var method in documentMousetrap) {\n if (method.charAt(0) !== '_') {\n Mousetrap[method] = function (method) {\n return function () {\n return documentMousetrap[method].apply(documentMousetrap, arguments);\n };\n }(method);\n }\n }\n };\n\n Mousetrap.init(); // expose mousetrap to the global object\n\n window.Mousetrap = Mousetrap; // expose as a common js module\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Mousetrap;\n } // expose mousetrap as an AMD module\n\n\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return Mousetrap;\n });\n }\n})(typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);","// Copyright (c) 2012 Mathieu Turcotte\n// Licensed under the MIT license.\nvar Backoff = require('./lib/backoff');\n\nvar ExponentialBackoffStrategy = require('./lib/strategy/exponential');\n\nvar FibonacciBackoffStrategy = require('./lib/strategy/fibonacci');\n\nvar FunctionCall = require('./lib/function_call.js');\n\nmodule.exports.Backoff = Backoff;\nmodule.exports.FunctionCall = FunctionCall;\nmodule.exports.FibonacciStrategy = FibonacciBackoffStrategy;\nmodule.exports.ExponentialStrategy = ExponentialBackoffStrategy; // Constructs a Fibonacci backoff.\n\nmodule.exports.fibonacci = function (options) {\n return new Backoff(new FibonacciBackoffStrategy(options));\n}; // Constructs an exponential backoff.\n\n\nmodule.exports.exponential = function (options) {\n return new Backoff(new ExponentialBackoffStrategy(options));\n}; // Constructs a FunctionCall for the given function and arguments.\n\n\nmodule.exports.call = function (fn, vargs, callback) {\n var args = Array.prototype.slice.call(arguments);\n fn = args[0];\n vargs = args.slice(1, args.length - 1);\n callback = args[args.length - 1];\n return new FunctionCall(fn, vargs, callback);\n};","/*\n * Copyright (c) 2012 Mathieu Turcotte\n * Licensed under the MIT license.\n */\nvar util = require('util');\n\nvar errors = module.exports = require('./errors');\n\nfunction failCheck(ExceptionConstructor, callee, messageFormat, formatArgs) {\n messageFormat = messageFormat || '';\n var message = util.format.apply(this, [messageFormat].concat(formatArgs));\n var error = new ExceptionConstructor(message);\n Error.captureStackTrace(error, callee);\n throw error;\n}\n\nfunction failArgumentCheck(callee, message, formatArgs) {\n failCheck(errors.IllegalArgumentError, callee, message, formatArgs);\n}\n\nfunction failStateCheck(callee, message, formatArgs) {\n failCheck(errors.IllegalStateError, callee, message, formatArgs);\n}\n\nmodule.exports.checkArgument = function (value, message) {\n if (!value) {\n failArgumentCheck(arguments.callee, message, Array.prototype.slice.call(arguments, 2));\n }\n};\n\nmodule.exports.checkState = function (value, message) {\n if (!value) {\n failStateCheck(arguments.callee, message, Array.prototype.slice.call(arguments, 2));\n }\n};\n\nmodule.exports.checkIsDef = function (value, message) {\n if (value !== undefined) {\n return value;\n }\n\n failArgumentCheck(arguments.callee, message || 'Expected value to be defined but was undefined.', Array.prototype.slice.call(arguments, 2));\n};\n\nmodule.exports.checkIsDefAndNotNull = function (value, message) {\n // Note that undefined == null.\n if (value != null) {\n return value;\n }\n\n failArgumentCheck(arguments.callee, message || 'Expected value to be defined and not null but got \"' + typeOf(value) + '\".', Array.prototype.slice.call(arguments, 2));\n}; // Fixed version of the typeOf operator which returns 'null' for null values\n// and 'array' for arrays.\n\n\nfunction typeOf(value) {\n var s = typeof value;\n\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n\n return s;\n}\n\nfunction typeCheck(expect) {\n return function (value, message) {\n var type = typeOf(value);\n\n if (type == expect) {\n return value;\n }\n\n failArgumentCheck(arguments.callee, message || 'Expected \"' + expect + '\" but got \"' + type + '\".', Array.prototype.slice.call(arguments, 2));\n };\n}\n\nmodule.exports.checkIsString = typeCheck('string');\nmodule.exports.checkIsArray = typeCheck('array');\nmodule.exports.checkIsNumber = typeCheck('number');\nmodule.exports.checkIsBoolean = typeCheck('boolean');\nmodule.exports.checkIsFunction = typeCheck('function');\nmodule.exports.checkIsObject = typeCheck('object');","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function';\n};","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n\n var TempCtor = function TempCtor() {};\n\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n };\n}","/*\n * Copyright (c) 2012 Mathieu Turcotte\n * Licensed under the MIT license.\n */\nvar util = require('util');\n\nfunction IllegalArgumentError(message) {\n Error.call(this, message);\n this.message = message;\n}\n\nutil.inherits(IllegalArgumentError, Error);\nIllegalArgumentError.prototype.name = 'IllegalArgumentError';\n\nfunction IllegalStateError(message) {\n Error.call(this, message);\n this.message = message;\n}\n\nutil.inherits(IllegalStateError, Error);\nIllegalStateError.prototype.name = 'IllegalStateError';\nmodule.exports.IllegalStateError = IllegalStateError;\nmodule.exports.IllegalArgumentError = IllegalArgumentError;","// Copyright (c) 2012 Mathieu Turcotte\n// Licensed under the MIT license.\nvar util = require('util');\n\nvar precond = require('precond');\n\nvar BackoffStrategy = require('./strategy'); // Exponential backoff strategy.\n\n\nfunction ExponentialBackoffStrategy(options) {\n BackoffStrategy.call(this, options);\n this.backoffDelay_ = 0;\n this.nextBackoffDelay_ = this.getInitialDelay();\n this.factor_ = ExponentialBackoffStrategy.DEFAULT_FACTOR;\n\n if (options && options.factor !== undefined) {\n precond.checkArgument(options.factor > 1, 'Exponential factor should be greater than 1 but got %s.', options.factor);\n this.factor_ = options.factor;\n }\n}\n\nutil.inherits(ExponentialBackoffStrategy, BackoffStrategy); // Default multiplication factor used to compute the next backoff delay from\n// the current one. The value can be overridden by passing a custom factor as\n// part of the options.\n\nExponentialBackoffStrategy.DEFAULT_FACTOR = 2;\n\nExponentialBackoffStrategy.prototype.next_ = function () {\n this.backoffDelay_ = Math.min(this.nextBackoffDelay_, this.getMaxDelay());\n this.nextBackoffDelay_ = this.backoffDelay_ * this.factor_;\n return this.backoffDelay_;\n};\n\nExponentialBackoffStrategy.prototype.reset_ = function () {\n this.backoffDelay_ = 0;\n this.nextBackoffDelay_ = this.getInitialDelay();\n};\n\nmodule.exports = ExponentialBackoffStrategy;","// Copyright (c) 2012 Mathieu Turcotte\n// Licensed under the MIT license.\nvar events = require('events');\n\nvar precond = require('precond');\n\nvar util = require('util');\n\nvar Backoff = require('./backoff');\n\nvar FibonacciBackoffStrategy = require('./strategy/fibonacci'); // Wraps a function to be called in a backoff loop.\n\n\nfunction FunctionCall(fn, args, callback) {\n events.EventEmitter.call(this);\n precond.checkIsFunction(fn, 'Expected fn to be a function.');\n precond.checkIsArray(args, 'Expected args to be an array.');\n precond.checkIsFunction(callback, 'Expected callback to be a function.');\n this.function_ = fn;\n this.arguments_ = args;\n this.callback_ = callback;\n this.lastResult_ = [];\n this.numRetries_ = 0;\n this.backoff_ = null;\n this.strategy_ = null;\n this.failAfter_ = -1;\n this.retryPredicate_ = FunctionCall.DEFAULT_RETRY_PREDICATE_;\n this.state_ = FunctionCall.State_.PENDING;\n}\n\nutil.inherits(FunctionCall, events.EventEmitter); // States in which the call can be.\n\nFunctionCall.State_ = {\n // Call isn't started yet.\n PENDING: 0,\n // Call is in progress.\n RUNNING: 1,\n // Call completed successfully which means that either the wrapped function\n // returned successfully or the maximal number of backoffs was reached.\n COMPLETED: 2,\n // The call was aborted.\n ABORTED: 3\n}; // The default retry predicate which considers any error as retriable.\n\nFunctionCall.DEFAULT_RETRY_PREDICATE_ = function (err) {\n return true;\n}; // Checks whether the call is pending.\n\n\nFunctionCall.prototype.isPending = function () {\n return this.state_ == FunctionCall.State_.PENDING;\n}; // Checks whether the call is in progress.\n\n\nFunctionCall.prototype.isRunning = function () {\n return this.state_ == FunctionCall.State_.RUNNING;\n}; // Checks whether the call is completed.\n\n\nFunctionCall.prototype.isCompleted = function () {\n return this.state_ == FunctionCall.State_.COMPLETED;\n}; // Checks whether the call is aborted.\n\n\nFunctionCall.prototype.isAborted = function () {\n return this.state_ == FunctionCall.State_.ABORTED;\n}; // Sets the backoff strategy to use. Can only be called before the call is\n// started otherwise an exception will be thrown.\n\n\nFunctionCall.prototype.setStrategy = function (strategy) {\n precond.checkState(this.isPending(), 'FunctionCall in progress.');\n this.strategy_ = strategy;\n return this; // Return this for chaining.\n}; // Sets the predicate which will be used to determine whether the errors\n// returned from the wrapped function should be retried or not, e.g. a\n// network error would be retriable while a type error would stop the\n// function call.\n\n\nFunctionCall.prototype.retryIf = function (retryPredicate) {\n precond.checkState(this.isPending(), 'FunctionCall in progress.');\n this.retryPredicate_ = retryPredicate;\n return this;\n}; // Returns all intermediary results returned by the wrapped function since\n// the initial call.\n\n\nFunctionCall.prototype.getLastResult = function () {\n return this.lastResult_.concat();\n}; // Returns the number of times the wrapped function call was retried.\n\n\nFunctionCall.prototype.getNumRetries = function () {\n return this.numRetries_;\n}; // Sets the backoff limit.\n\n\nFunctionCall.prototype.failAfter = function (maxNumberOfRetry) {\n precond.checkState(this.isPending(), 'FunctionCall in progress.');\n this.failAfter_ = maxNumberOfRetry;\n return this; // Return this for chaining.\n}; // Aborts the call.\n\n\nFunctionCall.prototype.abort = function () {\n if (this.isCompleted() || this.isAborted()) {\n return;\n }\n\n if (this.isRunning()) {\n this.backoff_.reset();\n }\n\n this.state_ = FunctionCall.State_.ABORTED;\n this.lastResult_ = [new Error('Backoff aborted.')];\n this.emit('abort');\n this.doCallback_();\n}; // Initiates the call to the wrapped function. Accepts an optional factory\n// function used to create the backoff instance; used when testing.\n\n\nFunctionCall.prototype.start = function (backoffFactory) {\n precond.checkState(!this.isAborted(), 'FunctionCall is aborted.');\n precond.checkState(this.isPending(), 'FunctionCall already started.');\n var strategy = this.strategy_ || new FibonacciBackoffStrategy();\n this.backoff_ = backoffFactory ? backoffFactory(strategy) : new Backoff(strategy);\n this.backoff_.on('ready', this.doCall_.bind(this, true\n /* isRetry */\n ));\n this.backoff_.on('fail', this.doCallback_.bind(this));\n this.backoff_.on('backoff', this.handleBackoff_.bind(this));\n\n if (this.failAfter_ > 0) {\n this.backoff_.failAfter(this.failAfter_);\n }\n\n this.state_ = FunctionCall.State_.RUNNING;\n this.doCall_(false\n /* isRetry */\n );\n}; // Calls the wrapped function.\n\n\nFunctionCall.prototype.doCall_ = function (isRetry) {\n if (isRetry) {\n this.numRetries_++;\n }\n\n var eventArgs = ['call'].concat(this.arguments_);\n events.EventEmitter.prototype.emit.apply(this, eventArgs);\n var callback = this.handleFunctionCallback_.bind(this);\n this.function_.apply(null, this.arguments_.concat(callback));\n}; // Calls the wrapped function's callback with the last result returned by the\n// wrapped function.\n\n\nFunctionCall.prototype.doCallback_ = function () {\n this.callback_.apply(null, this.lastResult_);\n}; // Handles wrapped function's completion. This method acts as a replacement\n// for the original callback function.\n\n\nFunctionCall.prototype.handleFunctionCallback_ = function () {\n if (this.isAborted()) {\n return;\n }\n\n var args = Array.prototype.slice.call(arguments);\n this.lastResult_ = args; // Save last callback arguments.\n\n events.EventEmitter.prototype.emit.apply(this, ['callback'].concat(args));\n var err = args[0];\n\n if (err && this.retryPredicate_(err)) {\n this.backoff_.backoff(err);\n } else {\n this.state_ = FunctionCall.State_.COMPLETED;\n this.doCallback_();\n }\n}; // Handles the backoff event by reemitting it.\n\n\nFunctionCall.prototype.handleBackoff_ = function (number, delay, err) {\n this.emit('backoff', number, delay, err);\n};\n\nmodule.exports = FunctionCall;","// Package imports.\nimport detectPassiveEvents from 'detect-passive-events';\n\n// This will either be a passive lister options object (if passive\n// events are supported), or `false`.\nexport const withPassive = detectPassiveEvents.hasSupport ? { passive: true } : false;\n\n// Focuses the root element.\nexport function focusRoot () {\n let e;\n if (document && (e = document.querySelector('.ui')) && (e = e.parentElement)) {\n e.focus();\n }\n}\n","var _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport hoistStatics from \"hoist-non-react-statics\";\nimport Route from \"./Route\";\n/**\n * A public higher-order component to access the imperative API\n */\n\nvar withRouter = function withRouter(Component) {\n var C = function C(props) {\n var wrappedComponentRef = props.wrappedComponentRef,\n remainingProps = _objectWithoutProperties(props, [\"wrappedComponentRef\"]);\n\n return React.createElement(Route, {\n children: function children(routeComponentProps) {\n return React.createElement(Component, _extends({}, remainingProps, routeComponentProps, {\n ref: wrappedComponentRef\n }));\n }\n });\n };\n\n C.displayName = \"withRouter(\" + (Component.displayName || Component.name) + \")\";\n C.WrappedComponent = Component;\n return hoistStatics(C, Component);\n};\n\nexport default withRouter;","// Written in this round about way for babel-transform-imports\nimport withRouter from \"react-router/es/withRouter\";\nexport default withRouter;","import React from 'react';\nimport ColumnHeader from './column_header';\nimport PropTypes from 'prop-types';\nimport { debounce } from 'lodash';\nimport { scrollTop } from 'flavours/glitch/util/scroll';\nimport { isMobile } from 'flavours/glitch/util/is_mobile';\n\nexport default class Column extends React.PureComponent {\n\n static propTypes = {\n heading: PropTypes.string,\n icon: PropTypes.string,\n children: PropTypes.node,\n active: PropTypes.bool,\n hideHeadingOnMobile: PropTypes.bool,\n name: PropTypes.string,\n };\n\n handleHeaderClick = () => {\n const scrollable = this.node.querySelector('.scrollable');\n\n if (!scrollable) {\n return;\n }\n\n this._interruptScrollAnimation = scrollTop(scrollable);\n }\n\n scrollTop () {\n const scrollable = this.node.querySelector('.scrollable');\n\n if (!scrollable) {\n return;\n }\n\n this._interruptScrollAnimation = scrollTop(scrollable);\n }\n\n\n handleScroll = debounce(() => {\n if (typeof this._interruptScrollAnimation !== 'undefined') {\n this._interruptScrollAnimation();\n }\n }, 200)\n\n setRef = (c) => {\n this.node = c;\n }\n\n render () {\n const { heading, icon, children, active, hideHeadingOnMobile, name } = this.props;\n\n const showHeading = heading && (!hideHeadingOnMobile || (hideHeadingOnMobile && !isMobile(window.innerWidth)));\n\n const columnHeaderId = showHeading && heading.replace(/ /g, '-');\n const header = showHeading && (\n \n );\n return (\n \n {header}\n {children}\n
\n );\n }\n\n}\n","import React from 'react';\nimport ColumnHeader from './column_header';\nimport PropTypes from 'prop-types';\nimport { debounce } from 'lodash';\nimport { scrollTop } from '../../../scroll';\nimport { isMobile } from '../../../is_mobile';\n\nexport default class Column extends React.PureComponent {\n\n static propTypes = {\n heading: PropTypes.string,\n icon: PropTypes.string,\n children: PropTypes.node,\n active: PropTypes.bool,\n hideHeadingOnMobile: PropTypes.bool,\n };\n\n handleHeaderClick = () => {\n const scrollable = this.node.querySelector('.scrollable');\n\n if (!scrollable) {\n return;\n }\n\n this._interruptScrollAnimation = scrollTop(scrollable);\n }\n\n scrollTop () {\n const scrollable = this.node.querySelector('.scrollable');\n\n if (!scrollable) {\n return;\n }\n\n this._interruptScrollAnimation = scrollTop(scrollable);\n }\n\n\n handleScroll = debounce(() => {\n if (typeof this._interruptScrollAnimation !== 'undefined') {\n this._interruptScrollAnimation();\n }\n }, 200)\n\n setRef = (c) => {\n this.node = c;\n }\n\n render () {\n const { heading, icon, children, active, hideHeadingOnMobile } = this.props;\n\n const showHeading = heading && (!hideHeadingOnMobile || (hideHeadingOnMobile && !isMobile(window.innerWidth)));\n\n const columnHeaderId = showHeading && heading.replace(/ /g, '-');\n const header = showHeading && (\n \n );\n return (\n \n {header}\n {children}\n
\n );\n }\n\n}\n","/**\n * Buttons widget for controlling the notification clearing mode.\n * In idle state, the cleaning mode button is shown. When the mode is active,\n * a Confirm and Abort buttons are shown in its place.\n */\n\n\n// Package imports //\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\n\nconst messages = defineMessages({\n btnAll : { id: 'notification_purge.btn_all', defaultMessage: 'Select\\nall' },\n btnNone : { id: 'notification_purge.btn_none', defaultMessage: 'Select\\nnone' },\n btnInvert : { id: 'notification_purge.btn_invert', defaultMessage: 'Invert\\nselection' },\n btnApply : { id: 'notification_purge.btn_apply', defaultMessage: 'Clear\\nselected' },\n});\n\n@injectIntl\nexport default class NotificationPurgeButtons extends ImmutablePureComponent {\n\n static propTypes = {\n onDeleteMarked : PropTypes.func.isRequired,\n onMarkAll : PropTypes.func.isRequired,\n onMarkNone : PropTypes.func.isRequired,\n onInvert : PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n markNewForDelete: PropTypes.bool,\n };\n\n render () {\n const { intl, markNewForDelete } = this.props;\n\n //className='active'\n return (\n \n \n ∀ {intl.formatMessage(messages.btnAll)}\n \n\n \n ∅ {intl.formatMessage(messages.btnNone)}\n \n\n \n ¬ {intl.formatMessage(messages.btnInvert)}\n \n\n \n {intl.formatMessage(messages.btnApply)}\n \n
\n );\n }\n\n}\n","// Package imports.\nimport { connect } from 'react-redux';\nimport { defineMessages, injectIntl } from 'react-intl';\n\n// Our imports.\nimport NotificationPurgeButtons from 'flavours/glitch/components/notification_purge_buttons';\nimport {\n deleteMarkedNotifications,\n enterNotificationClearingMode,\n markAllNotifications,\n} from 'flavours/glitch/actions/notifications';\nimport { openModal } from 'flavours/glitch/actions/modal';\n\nconst messages = defineMessages({\n clearMessage: { id: 'notifications.marked_clear_confirmation', defaultMessage: 'Are you sure you want to permanently clear all selected notifications?' },\n clearConfirm: { id: 'notifications.marked_clear', defaultMessage: 'Clear selected notifications' },\n});\n\nconst mapDispatchToProps = (dispatch, { intl }) => ({\n onEnterCleaningMode(yes) {\n dispatch(enterNotificationClearingMode(yes));\n },\n\n onDeleteMarked() {\n dispatch(openModal('CONFIRM', {\n message: intl.formatMessage(messages.clearMessage),\n confirm: intl.formatMessage(messages.clearConfirm),\n onConfirm: () => dispatch(deleteMarkedNotifications()),\n }));\n },\n\n onMarkAll() {\n dispatch(markAllNotifications(true));\n },\n\n onMarkNone() {\n dispatch(markAllNotifications(false));\n },\n\n onInvert() {\n dispatch(markAllNotifications(null));\n },\n});\n\nconst mapStateToProps = state => ({\n markNewForDelete: state.getIn(['notifications', 'markNewForDelete']),\n});\n\nexport default injectIntl(connect(mapStateToProps, mapDispatchToProps)(NotificationPurgeButtons));\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { defineMessages, FormattedMessage, injectIntl } from 'react-intl';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\n\nimport NotificationPurgeButtonsContainer from 'flavours/glitch/containers/notification_purge_buttons_container';\n\nconst messages = defineMessages({\n show: { id: 'column_header.show_settings', defaultMessage: 'Show settings' },\n hide: { id: 'column_header.hide_settings', defaultMessage: 'Hide settings' },\n moveLeft: { id: 'column_header.moveLeft_settings', defaultMessage: 'Move column to the left' },\n moveRight: { id: 'column_header.moveRight_settings', defaultMessage: 'Move column to the right' },\n enterNotifCleaning : { id: 'notification_purge.start', defaultMessage: 'Enter notification cleaning mode' },\n});\n\n@injectIntl\nexport default class ColumnHeader extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n intl: PropTypes.object.isRequired,\n title: PropTypes.node,\n icon: PropTypes.string,\n active: PropTypes.bool,\n localSettings : ImmutablePropTypes.map,\n multiColumn: PropTypes.bool,\n extraButton: PropTypes.node,\n showBackButton: PropTypes.bool,\n notifCleaning: PropTypes.bool, // true only for the notification column\n notifCleaningActive: PropTypes.bool,\n onEnterCleaningMode: PropTypes.func,\n children: PropTypes.node,\n pinned: PropTypes.bool,\n onPin: PropTypes.func,\n onMove: PropTypes.func,\n onClick: PropTypes.func,\n intl: PropTypes.object.isRequired,\n };\n\n state = {\n collapsed: true,\n animating: false,\n animatingNCD: false,\n };\n\n historyBack = () => {\n // if history is exhausted, or we would leave mastodon, just go to root.\n if (window.history.state) {\n this.context.router.history.goBack();\n } else {\n this.context.router.history.push('/');\n }\n }\n\n handleToggleClick = (e) => {\n e.stopPropagation();\n this.setState({ collapsed: !this.state.collapsed, animating: true });\n }\n\n handleTitleClick = () => {\n this.props.onClick();\n }\n\n handleMoveLeft = () => {\n this.props.onMove(-1);\n }\n\n handleMoveRight = () => {\n this.props.onMove(1);\n }\n\n handleBackClick = () => {\n this.historyBack();\n }\n\n handleTransitionEnd = () => {\n this.setState({ animating: false });\n }\n\n handleTransitionEndNCD = () => {\n this.setState({ animatingNCD: false });\n }\n\n handlePin = () => {\n if (!this.props.pinned) {\n this.historyBack();\n }\n this.props.onPin();\n }\n\n onEnterCleaningMode = () => {\n this.setState({ animatingNCD: true });\n this.props.onEnterCleaningMode(!this.props.notifCleaningActive);\n }\n\n render () {\n const { intl, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, notifCleaning, notifCleaningActive } = this.props;\n const { collapsed, animating, animatingNCD } = this.state;\n\n let title = this.props.title;\n\n const wrapperClassName = classNames('column-header__wrapper', {\n 'active': active,\n });\n\n const buttonClassName = classNames('column-header', {\n 'active': active,\n });\n\n const collapsibleClassName = classNames('column-header__collapsible', {\n 'collapsed': collapsed,\n 'animating': animating,\n });\n\n const collapsibleButtonClassName = classNames('column-header__button', {\n 'active': !collapsed,\n });\n\n const notifCleaningButtonClassName = classNames('column-header__button', {\n 'active': notifCleaningActive,\n });\n\n const notifCleaningDrawerClassName = classNames('ncd column-header__collapsible', {\n 'collapsed': !notifCleaningActive,\n 'animating': animatingNCD,\n });\n\n let extraContent, pinButton, moveButtons, backButton, collapseButton;\n\n //*glitch\n const msgEnterNotifCleaning = intl.formatMessage(messages.enterNotifCleaning);\n\n if (children) {\n extraContent = (\n \n {children}\n
\n );\n }\n\n if (multiColumn && pinned) {\n pinButton = ;\n\n moveButtons = (\n \n \n \n
\n );\n } else if (multiColumn) {\n pinButton = ;\n }\n\n if (!pinned && (multiColumn || showBackButton)) {\n backButton = (\n \n \n \n \n );\n }\n\n const collapsedContent = [\n extraContent,\n ];\n\n if (multiColumn) {\n collapsedContent.push(moveButtons);\n collapsedContent.push(pinButton);\n }\n\n if (children || multiColumn) {\n collapseButton = ;\n }\n\n const hasTitle = icon && title;\n\n return (\n \n
\n {hasTitle && (\n \n \n {title}\n \n )}\n\n {!hasTitle && backButton}\n\n \n {hasTitle && backButton}\n {extraButton}\n { notifCleaning ? (\n \n \n \n ) : null}\n {collapseButton}\n
\n \n\n { notifCleaning ? (\n
\n
\n {(notifCleaningActive || animatingNCD) ? ( ) : null }\n
\n
\n ) : null}\n\n
\n
\n {(!collapsed || animating) && collapsedContent}\n
\n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { FormattedMessage, injectIntl, defineMessages } from 'react-intl';\nimport Icon from 'mastodon/components/icon';\n\nconst messages = defineMessages({\n show: { id: 'column_header.show_settings', defaultMessage: 'Show settings' },\n hide: { id: 'column_header.hide_settings', defaultMessage: 'Hide settings' },\n moveLeft: { id: 'column_header.moveLeft_settings', defaultMessage: 'Move column to the left' },\n moveRight: { id: 'column_header.moveRight_settings', defaultMessage: 'Move column to the right' },\n});\n\nexport default @injectIntl\nclass ColumnHeader extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n intl: PropTypes.object.isRequired,\n title: PropTypes.node,\n icon: PropTypes.string,\n active: PropTypes.bool,\n multiColumn: PropTypes.bool,\n extraButton: PropTypes.node,\n showBackButton: PropTypes.bool,\n children: PropTypes.node,\n pinned: PropTypes.bool,\n onPin: PropTypes.func,\n onMove: PropTypes.func,\n onClick: PropTypes.func,\n };\n\n state = {\n collapsed: true,\n animating: false,\n };\n\n historyBack = () => {\n if (window.history && window.history.length === 1) {\n this.context.router.history.push('/');\n } else {\n this.context.router.history.goBack();\n }\n }\n\n handleToggleClick = (e) => {\n e.stopPropagation();\n this.setState({ collapsed: !this.state.collapsed, animating: true });\n }\n\n handleTitleClick = () => {\n this.props.onClick();\n }\n\n handleMoveLeft = () => {\n this.props.onMove(-1);\n }\n\n handleMoveRight = () => {\n this.props.onMove(1);\n }\n\n handleBackClick = () => {\n this.historyBack();\n }\n\n handleTransitionEnd = () => {\n this.setState({ animating: false });\n }\n\n handlePin = () => {\n if (!this.props.pinned) {\n this.historyBack();\n }\n this.props.onPin();\n }\n\n render () {\n const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage } } = this.props;\n const { collapsed, animating } = this.state;\n\n const wrapperClassName = classNames('column-header__wrapper', {\n 'active': active,\n });\n\n const buttonClassName = classNames('column-header', {\n 'active': active,\n });\n\n const collapsibleClassName = classNames('column-header__collapsible', {\n 'collapsed': collapsed,\n 'animating': animating,\n });\n\n const collapsibleButtonClassName = classNames('column-header__button', {\n 'active': !collapsed,\n });\n\n let extraContent, pinButton, moveButtons, backButton, collapseButton;\n\n if (children) {\n extraContent = (\n \n {children}\n
\n );\n }\n\n if (multiColumn && pinned) {\n pinButton = ;\n\n moveButtons = (\n \n \n \n
\n );\n } else if (multiColumn) {\n pinButton = ;\n }\n\n if (!pinned && (multiColumn || showBackButton)) {\n backButton = (\n \n \n \n \n );\n }\n\n const collapsedContent = [\n extraContent,\n ];\n\n if (multiColumn) {\n collapsedContent.push(moveButtons);\n collapsedContent.push(pinButton);\n }\n\n if (children || multiColumn) {\n collapseButton = ;\n }\n\n const hasTitle = icon && title;\n\n return (\n \n
\n {hasTitle && (\n \n \n {title}\n \n )}\n\n {!hasTitle && backButton}\n\n \n {hasTitle && backButton}\n {extraButton}\n {collapseButton}\n
\n \n\n
\n
\n {(!collapsed || animating) && collapsedContent}\n
\n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport PropTypes from 'prop-types';\nimport Icon from 'mastodon/components/icon';\n\nexport default class ColumnBackButton extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n handleClick = () => {\n if (window.history && window.history.length === 1) {\n this.context.router.history.push('/');\n } else {\n this.context.router.history.goBack();\n }\n }\n\n render () {\n return (\n \n \n \n \n );\n }\n\n}\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport PropTypes from 'prop-types';\n\nexport default class ColumnBackButtonSlim extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n handleClick = () => {\n // if history is exhausted, or we would leave mastodon, just go to root.\n if (window.history.state) {\n this.context.router.history.goBack();\n } else {\n this.context.router.history.push('/');\n }\n }\n\n render () {\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport detectPassiveEvents from 'detect-passive-events';\nimport { scrollTop } from 'flavours/glitch/util/scroll';\n\nexport default class Column extends React.PureComponent {\n\n static propTypes = {\n children: PropTypes.node,\n extraClasses: PropTypes.string,\n name: PropTypes.string,\n label: PropTypes.string,\n };\n\n scrollTop () {\n const scrollable = this.node.querySelector('.scrollable');\n\n if (!scrollable) {\n return;\n }\n\n this._interruptScrollAnimation = scrollTop(scrollable);\n }\n\n handleWheel = () => {\n if (typeof this._interruptScrollAnimation !== 'function') {\n return;\n }\n\n this._interruptScrollAnimation();\n }\n\n setRef = c => {\n this.node = c;\n }\n\n componentDidMount () {\n this.node.addEventListener('wheel', this.handleWheel, detectPassiveEvents.hasSupport ? { passive: true } : false);\n }\n\n componentWillUnmount () {\n this.node.removeEventListener('wheel', this.handleWheel);\n }\n\n render () {\n const { children, extraClasses, name, label } = this.props;\n\n return (\n \n {children}\n
\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport detectPassiveEvents from 'detect-passive-events';\nimport { scrollTop } from '../scroll';\n\nexport default class Column extends React.PureComponent {\n\n static propTypes = {\n children: PropTypes.node,\n label: PropTypes.string,\n };\n\n scrollTop () {\n const scrollable = this.node.querySelector('.scrollable');\n\n if (!scrollable) {\n return;\n }\n\n this._interruptScrollAnimation = scrollTop(scrollable);\n }\n\n handleWheel = () => {\n if (typeof this._interruptScrollAnimation !== 'function') {\n return;\n }\n\n this._interruptScrollAnimation();\n }\n\n setRef = c => {\n this.node = c;\n }\n\n componentDidMount () {\n this.node.addEventListener('wheel', this.handleWheel, detectPassiveEvents.hasSupport ? { passive: true } : false);\n }\n\n componentWillUnmount () {\n this.node.removeEventListener('wheel', this.handleWheel);\n }\n\n render () {\n const { label, children } = this.props;\n\n return (\n \n {children}\n
\n );\n }\n\n}\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport ColumnBackButton from './column_back_button';\nimport Icon from 'mastodon/components/icon';\n\nexport default class ColumnBackButtonSlim extends ColumnBackButton {\n\n render () {\n return (\n \n );\n }\n\n}\n","import WebSocketClient from 'websocket.js';\n\nconst randomIntUpTo = max => Math.floor(Math.random() * Math.floor(max));\n\nexport function connectStream(path, pollingRefresh = null, callbacks = () => ({ onConnect() {}, onDisconnect() {}, onReceive() {} })) {\n return (dispatch, getState) => {\n const streamingAPIBaseURL = getState().getIn(['meta', 'streaming_api_base_url']);\n const accessToken = getState().getIn(['meta', 'access_token']);\n const { onConnect, onDisconnect, onReceive } = callbacks(dispatch, getState);\n\n let polling = null;\n\n const setupPolling = () => {\n pollingRefresh(dispatch, () => {\n polling = setTimeout(() => setupPolling(), 20000 + randomIntUpTo(20000));\n });\n };\n\n const clearPolling = () => {\n if (polling) {\n clearTimeout(polling);\n polling = null;\n }\n };\n\n const subscription = getStream(streamingAPIBaseURL, accessToken, path, {\n connected () {\n if (pollingRefresh) {\n clearPolling();\n }\n\n onConnect();\n },\n\n disconnected () {\n if (pollingRefresh) {\n polling = setTimeout(() => setupPolling(), randomIntUpTo(40000));\n }\n\n onDisconnect();\n },\n\n received (data) {\n onReceive(data);\n },\n\n reconnected () {\n if (pollingRefresh) {\n clearPolling();\n pollingRefresh(dispatch);\n }\n\n onConnect();\n },\n\n });\n\n const disconnect = () => {\n if (subscription) {\n subscription.close();\n }\n\n clearPolling();\n };\n\n return disconnect;\n };\n}\n\n\nexport default function getStream(streamingAPIBaseURL, accessToken, stream, { connected, received, disconnected, reconnected }) {\n const params = [ `stream=${stream}` ];\n\n if (accessToken !== null) {\n params.push(`access_token=${accessToken}`);\n }\n\n const ws = new WebSocketClient(`${streamingAPIBaseURL}/api/v1/streaming/?${params.join('&')}`);\n\n ws.onopen = connected;\n ws.onmessage = e => {\n if (e.data !== '')\n received(JSON.parse(e.data));\n };\n ws.onclose = disconnected;\n ws.onreconnect = reconnected;\n\n return ws;\n};\n","import { connectStream } from '../stream';\nimport {\n updateTimeline,\n deleteFromTimelines,\n expandHomeTimeline,\n connectTimeline,\n disconnectTimeline,\n} from './timelines';\nimport { updateNotifications, expandNotifications } from './notifications';\nimport { updateConversations } from './conversations';\nimport { fetchFilters } from './filters';\nimport { getLocale } from '../locales';\n\nconst { messages } = getLocale();\n\nexport function connectTimelineStream (timelineId, path, pollingRefresh = null, accept = null) {\n\n return connectStream (path, pollingRefresh, (dispatch, getState) => {\n const locale = getState().getIn(['meta', 'locale']);\n\n return {\n onConnect() {\n dispatch(connectTimeline(timelineId));\n },\n\n onDisconnect() {\n dispatch(disconnectTimeline(timelineId));\n },\n\n onReceive (data) {\n switch(data.event) {\n case 'update':\n dispatch(updateTimeline(timelineId, JSON.parse(data.payload), accept));\n break;\n case 'delete':\n dispatch(deleteFromTimelines(data.payload));\n break;\n case 'notification':\n dispatch(updateNotifications(JSON.parse(data.payload), messages, locale));\n break;\n case 'conversation':\n dispatch(updateConversations(JSON.parse(data.payload)));\n break;\n case 'filters_changed':\n dispatch(fetchFilters());\n break;\n }\n },\n };\n });\n}\n\nconst refreshHomeTimelineAndNotification = (dispatch, done) => {\n dispatch(expandHomeTimeline({}, () => dispatch(expandNotifications({}, done))));\n};\n\nexport const connectUserStream = () => connectTimelineStream('home', 'user', refreshHomeTimelineAndNotification);\nexport const connectCommunityStream = ({ onlyMedia } = {}) => connectTimelineStream(`community${onlyMedia ? ':media' : ''}`, `public:local${onlyMedia ? ':media' : ''}`);\nexport const connectPublicStream = ({ onlyMedia } = {}) => connectTimelineStream(`public${onlyMedia ? ':media' : ''}`, `public${onlyMedia ? ':media' : ''}`);\nexport const connectHashtagStream = (id, tag, accept) => connectTimelineStream(`hashtag:${id}`, `hashtag&tag=${tag}`, null, accept);\nexport const connectDirectStream = () => connectTimelineStream('direct', 'direct');\nexport const connectListStream = id => connectTimelineStream(`list:${id}`, `list&list=${id}`);\n","import WebSocketClient from 'websocket.js';\n\nconst randomIntUpTo = max => Math.floor(Math.random() * Math.floor(max));\n\nexport function connectStream(path, pollingRefresh = null, callbacks = () => ({ onConnect() {}, onDisconnect() {}, onReceive() {} })) {\n return (dispatch, getState) => {\n const streamingAPIBaseURL = getState().getIn(['meta', 'streaming_api_base_url']);\n const accessToken = getState().getIn(['meta', 'access_token']);\n const { onConnect, onDisconnect, onReceive } = callbacks(dispatch, getState);\n\n let polling = null;\n\n const setupPolling = () => {\n pollingRefresh(dispatch, () => {\n polling = setTimeout(() => setupPolling(), 20000 + randomIntUpTo(20000));\n });\n };\n\n const clearPolling = () => {\n if (polling) {\n clearTimeout(polling);\n polling = null;\n }\n };\n\n const subscription = getStream(streamingAPIBaseURL, accessToken, path, {\n connected () {\n if (pollingRefresh) {\n clearPolling();\n }\n\n onConnect();\n },\n\n disconnected () {\n if (pollingRefresh) {\n polling = setTimeout(() => setupPolling(), randomIntUpTo(40000));\n }\n\n onDisconnect();\n },\n\n received (data) {\n onReceive(data);\n },\n\n reconnected () {\n if (pollingRefresh) {\n clearPolling();\n pollingRefresh(dispatch);\n }\n\n onConnect();\n },\n\n });\n\n const disconnect = () => {\n if (subscription) {\n subscription.close();\n }\n\n clearPolling();\n };\n\n return disconnect;\n };\n}\n\n\nexport default function getStream(streamingAPIBaseURL, accessToken, stream, { connected, received, disconnected, reconnected }) {\n const params = [ `stream=${stream}` ];\n\n if (accessToken !== null) {\n params.push(`access_token=${accessToken}`);\n }\n\n const ws = new WebSocketClient(`${streamingAPIBaseURL}/api/v1/streaming/?${params.join('&')}`);\n\n ws.onopen = connected;\n ws.onmessage = e => {\n if (e.data !== '')\n received(JSON.parse(e.data));\n };\n ws.onclose = disconnected;\n ws.onreconnect = reconnected;\n\n return ws;\n};\n","import { connectStream } from 'flavours/glitch/util/stream';\nimport {\n updateTimeline,\n deleteFromTimelines,\n expandHomeTimeline,\n connectTimeline,\n disconnectTimeline,\n} from './timelines';\nimport { updateNotifications, expandNotifications } from './notifications';\nimport { fetchFilters } from './filters';\nimport { getLocale } from 'mastodon/locales';\n\nconst { messages } = getLocale();\n\nexport function connectTimelineStream (timelineId, path, pollingRefresh = null, accept = null) {\n\n return connectStream (path, pollingRefresh, (dispatch, getState) => {\n const locale = getState().getIn(['meta', 'locale']);\n\n return {\n onConnect() {\n dispatch(connectTimeline(timelineId));\n },\n\n onDisconnect() {\n dispatch(disconnectTimeline(timelineId));\n },\n\n onReceive (data) {\n switch(data.event) {\n case 'update':\n dispatch(updateTimeline(timelineId, JSON.parse(data.payload), accept));\n break;\n case 'delete':\n dispatch(deleteFromTimelines(data.payload));\n break;\n case 'notification':\n dispatch(updateNotifications(JSON.parse(data.payload), messages, locale));\n break;\n case 'filters_changed':\n dispatch(fetchFilters());\n break;\n }\n },\n };\n });\n}\n\nconst refreshHomeTimelineAndNotification = (dispatch, done) => {\n dispatch(expandHomeTimeline({}, () => dispatch(expandNotifications({}, done))));\n};\n\nexport const connectUserStream = () => connectTimelineStream('home', 'user', refreshHomeTimelineAndNotification);\nexport const connectCommunityStream = ({ onlyMedia } = {}) => connectTimelineStream(`community${onlyMedia ? ':media' : ''}`, `public:local${onlyMedia ? ':media' : ''}`);\nexport const connectPublicStream = ({ onlyMedia } = {}) => connectTimelineStream(`public${onlyMedia ? ':media' : ''}`, `public${onlyMedia ? ':media' : ''}`);\nexport const connectHashtagStream = (id, tag, accept) => connectTimelineStream(`hashtag:${id}`, `hashtag&tag=${tag}`, null, accept);\nexport const connectDirectStream = () => connectTimelineStream('direct', 'direct');\nexport const connectListStream = id => connectTimelineStream(`list:${id}`, `list&list=${id}`);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport IconButton from './icon_button';\nimport Overlay from 'react-overlays/lib/Overlay';\nimport Motion from 'flavours/glitch/util/optional_motion';\nimport spring from 'react-motion/lib/spring';\nimport detectPassiveEvents from 'detect-passive-events';\n\nconst listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;\nlet id = 0;\n\nclass DropdownMenu extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n items: PropTypes.array.isRequired,\n onClose: PropTypes.func.isRequired,\n style: PropTypes.object,\n placement: PropTypes.string,\n arrowOffsetLeft: PropTypes.string,\n arrowOffsetTop: PropTypes.string,\n openedViaKeyboard: PropTypes.bool,\n };\n\n static defaultProps = {\n style: {},\n placement: 'bottom',\n };\n\n state = {\n mounted: false,\n };\n\n handleDocumentClick = e => {\n if (this.node && !this.node.contains(e.target)) {\n this.props.onClose();\n }\n }\n\n componentDidMount () {\n document.addEventListener('click', this.handleDocumentClick, false);\n document.addEventListener('keydown', this.handleKeyDown, false);\n document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);\n if (this.focusedItem && this.props.openedViaKeyboard) this.focusedItem.focus();\n this.setState({ mounted: true });\n }\n\n componentWillUnmount () {\n document.removeEventListener('click', this.handleDocumentClick, false);\n document.removeEventListener('keydown', this.handleKeyDown, false);\n document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions);\n }\n\n setRef = c => {\n this.node = c;\n }\n\n setFocusRef = c => {\n this.focusedItem = c;\n }\n\n handleKeyDown = e => {\n const items = Array.from(this.node.getElementsByTagName('a'));\n const index = items.indexOf(document.activeElement);\n let element;\n\n switch(e.key) {\n case 'ArrowDown':\n element = items[index+1];\n if (element) {\n element.focus();\n }\n break;\n case 'ArrowUp':\n element = items[index-1];\n if (element) {\n element.focus();\n }\n break;\n case 'Home':\n element = items[0];\n if (element) {\n element.focus();\n }\n break;\n case 'End':\n element = items[items.length-1];\n if (element) {\n element.focus();\n }\n break;\n }\n }\n\n handleItemKeyDown = e => {\n if (e.key === 'Enter') {\n this.handleClick(e);\n }\n }\n\n handleClick = e => {\n const i = Number(e.currentTarget.getAttribute('data-index'));\n const { action, to } = this.props.items[i];\n\n this.props.onClose();\n\n if (typeof action === 'function') {\n e.preventDefault();\n action();\n } else if (to) {\n e.preventDefault();\n this.context.router.history.push(to);\n }\n }\n\n renderItem (option, i) {\n if (option === null) {\n return ;\n }\n\n const { text, href = '#' } = option;\n\n return (\n \n \n {text}\n \n \n );\n }\n\n render () {\n const { items, style, placement, arrowOffsetLeft, arrowOffsetTop } = this.props;\n const { mounted } = this.state;\n\n return (\n \n {({ opacity, scaleX, scaleY }) => (\n // It should not be transformed when mounting because the resulting\n // size will be used to determine the coordinate of the menu by\n // react-overlays\n \n
\n\n
\n {items.map((option, i) => this.renderItem(option, i))}\n \n
\n )}\n \n );\n }\n\n}\n\nexport default class Dropdown extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n icon: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired,\n size: PropTypes.number.isRequired,\n ariaLabel: PropTypes.string,\n disabled: PropTypes.bool,\n status: ImmutablePropTypes.map,\n isUserTouching: PropTypes.func,\n isModalOpen: PropTypes.bool.isRequired,\n onOpen: PropTypes.func.isRequired,\n onClose: PropTypes.func.isRequired,\n dropdownPlacement: PropTypes.string,\n openDropdownId: PropTypes.number,\n openedViaKeyboard: PropTypes.bool,\n };\n\n static defaultProps = {\n ariaLabel: 'Menu',\n };\n\n state = {\n id: id++,\n };\n\n handleClick = ({ target, type }) => {\n if (this.state.id === this.props.openDropdownId) {\n this.handleClose();\n } else {\n const { top } = target.getBoundingClientRect();\n const placement = top * 2 < innerHeight ? 'bottom' : 'top';\n\n this.props.onOpen(this.state.id, this.handleItemClick, placement, type !== 'click');\n }\n }\n\n handleClose = () => {\n this.props.onClose(this.state.id);\n }\n\n handleKeyDown = e => {\n switch(e.key) {\n case ' ':\n case 'Enter':\n this.handleClick(e);\n e.preventDefault();\n break;\n case 'Escape':\n this.handleClose();\n break;\n }\n }\n\n handleItemClick = (i, e) => {\n const { action, to } = this.props.items[i];\n\n this.handleClose();\n\n if (typeof action === 'function') {\n e.preventDefault();\n action();\n } else if (to) {\n e.preventDefault();\n this.context.router.history.push(to);\n }\n }\n\n setTargetRef = c => {\n this.target = c;\n }\n\n findTarget = () => {\n return this.target;\n }\n\n componentWillUnmount = () => {\n if (this.state.id === this.props.openDropdownId) {\n this.handleClose();\n }\n }\n\n render () {\n const { icon, items, size, ariaLabel, disabled, dropdownPlacement, openDropdownId, openedViaKeyboard } = this.props;\n const open = this.state.id === openDropdownId;\n\n return (\n \n \n\n \n \n \n
\n );\n }\n\n}\n","import { openDropdownMenu, closeDropdownMenu } from 'flavours/glitch/actions/dropdown_menu';\nimport { openModal, closeModal } from 'flavours/glitch/actions/modal';\nimport { connect } from 'react-redux';\nimport DropdownMenu from 'flavours/glitch/components/dropdown_menu';\nimport { isUserTouching } from 'flavours/glitch/util/is_mobile';\n\nconst mapStateToProps = state => ({\n isModalOpen: state.get('modal').modalType === 'ACTIONS',\n dropdownPlacement: state.getIn(['dropdown_menu', 'placement']),\n openDropdownId: state.getIn(['dropdown_menu', 'openId']),\n openedViaKeyboard: state.getIn(['dropdown_menu', 'keyboard']),\n});\n\nconst mapDispatchToProps = (dispatch, { status, items }) => ({\n onOpen(id, onItemClick, dropdownPlacement, keyboard) {\n dispatch(isUserTouching() ? openModal('ACTIONS', {\n status,\n actions: items.map(\n (item, i) => item ? {\n ...item,\n name: `${item.text}-${i}`,\n onClick: item.action ? ((e) => { return onItemClick(i, e) }) : null,\n } : null\n ),\n }) : openDropdownMenu(id, dropdownPlacement, keyboard));\n },\n onClose(id) {\n dispatch(closeModal());\n dispatch(closeDropdownMenu(id));\n },\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(DropdownMenu);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport IconButton from './icon_button';\nimport Overlay from 'react-overlays/lib/Overlay';\nimport Motion from '../features/ui/util/optional_motion';\nimport spring from 'react-motion/lib/spring';\nimport detectPassiveEvents from 'detect-passive-events';\n\nconst listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;\nlet id = 0;\n\nclass DropdownMenu extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n items: PropTypes.array.isRequired,\n onClose: PropTypes.func.isRequired,\n style: PropTypes.object,\n placement: PropTypes.string,\n arrowOffsetLeft: PropTypes.string,\n arrowOffsetTop: PropTypes.string,\n openedViaKeyboard: PropTypes.bool,\n };\n\n static defaultProps = {\n style: {},\n placement: 'bottom',\n };\n\n state = {\n mounted: false,\n };\n\n handleDocumentClick = e => {\n if (this.node && !this.node.contains(e.target)) {\n this.props.onClose();\n }\n }\n\n componentDidMount () {\n document.addEventListener('click', this.handleDocumentClick, false);\n document.addEventListener('keydown', this.handleKeyDown, false);\n document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);\n if (this.focusedItem && this.props.openedViaKeyboard) this.focusedItem.focus();\n this.setState({ mounted: true });\n }\n\n componentWillUnmount () {\n document.removeEventListener('click', this.handleDocumentClick, false);\n document.removeEventListener('keydown', this.handleKeyDown, false);\n document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions);\n }\n\n setRef = c => {\n this.node = c;\n }\n\n setFocusRef = c => {\n this.focusedItem = c;\n }\n\n handleKeyDown = e => {\n const items = Array.from(this.node.getElementsByTagName('a'));\n const index = items.indexOf(document.activeElement);\n let element;\n\n switch(e.key) {\n case 'ArrowDown':\n element = items[index+1];\n if (element) {\n element.focus();\n }\n break;\n case 'ArrowUp':\n element = items[index-1];\n if (element) {\n element.focus();\n }\n break;\n case 'Home':\n element = items[0];\n if (element) {\n element.focus();\n }\n break;\n case 'End':\n element = items[items.length-1];\n if (element) {\n element.focus();\n }\n break;\n }\n }\n\n handleItemKeyDown = e => {\n if (e.key === 'Enter') {\n this.handleClick(e);\n }\n }\n\n handleClick = e => {\n const i = Number(e.currentTarget.getAttribute('data-index'));\n const { action, to } = this.props.items[i];\n\n this.props.onClose();\n\n if (typeof action === 'function') {\n e.preventDefault();\n action(e);\n } else if (to) {\n e.preventDefault();\n this.context.router.history.push(to);\n }\n }\n\n renderItem (option, i) {\n if (option === null) {\n return ;\n }\n\n const { text, href = '#' } = option;\n\n return (\n \n \n {text}\n \n \n );\n }\n\n render () {\n const { items, style, placement, arrowOffsetLeft, arrowOffsetTop } = this.props;\n const { mounted } = this.state;\n\n return (\n \n {({ opacity, scaleX, scaleY }) => (\n // It should not be transformed when mounting because the resulting\n // size will be used to determine the coordinate of the menu by\n // react-overlays\n \n
\n\n
\n {items.map((option, i) => this.renderItem(option, i))}\n \n
\n )}\n \n );\n }\n\n}\n\nexport default class Dropdown extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n icon: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired,\n size: PropTypes.number.isRequired,\n title: PropTypes.string,\n disabled: PropTypes.bool,\n status: ImmutablePropTypes.map,\n isUserTouching: PropTypes.func,\n isModalOpen: PropTypes.bool.isRequired,\n onOpen: PropTypes.func.isRequired,\n onClose: PropTypes.func.isRequired,\n dropdownPlacement: PropTypes.string,\n openDropdownId: PropTypes.number,\n openedViaKeyboard: PropTypes.bool,\n };\n\n static defaultProps = {\n title: 'Menu',\n };\n\n state = {\n id: id++,\n };\n\n handleClick = ({ target, type }) => {\n if (this.state.id === this.props.openDropdownId) {\n this.handleClose();\n } else {\n const { top } = target.getBoundingClientRect();\n const placement = top * 2 < innerHeight ? 'bottom' : 'top';\n\n this.props.onOpen(this.state.id, this.handleItemClick, placement, type !== 'click');\n }\n }\n\n handleClose = () => {\n this.props.onClose(this.state.id);\n }\n\n handleKeyDown = e => {\n switch(e.key) {\n case ' ':\n case 'Enter':\n this.handleClick(e);\n e.preventDefault();\n break;\n case 'Escape':\n this.handleClose();\n break;\n }\n }\n\n handleItemClick = e => {\n const i = Number(e.currentTarget.getAttribute('data-index'));\n const { action, to } = this.props.items[i];\n\n this.handleClose();\n\n if (typeof action === 'function') {\n e.preventDefault();\n action();\n } else if (to) {\n e.preventDefault();\n this.context.router.history.push(to);\n }\n }\n\n setTargetRef = c => {\n this.target = c;\n }\n\n findTarget = () => {\n return this.target;\n }\n\n componentWillUnmount = () => {\n if (this.state.id === this.props.openDropdownId) {\n this.handleClose();\n }\n }\n\n render () {\n const { icon, items, size, title, disabled, dropdownPlacement, openDropdownId, openedViaKeyboard } = this.props;\n const open = this.state.id === openDropdownId;\n\n return (\n \n \n\n \n \n \n
\n );\n }\n\n}\n","import { openDropdownMenu, closeDropdownMenu } from '../actions/dropdown_menu';\nimport { openModal, closeModal } from '../actions/modal';\nimport { connect } from 'react-redux';\nimport DropdownMenu from '../components/dropdown_menu';\nimport { isUserTouching } from '../is_mobile';\n\nconst mapStateToProps = state => ({\n isModalOpen: state.get('modal').modalType === 'ACTIONS',\n dropdownPlacement: state.getIn(['dropdown_menu', 'placement']),\n openDropdownId: state.getIn(['dropdown_menu', 'openId']),\n openedViaKeyboard: state.getIn(['dropdown_menu', 'keyboard']),\n});\n\nconst mapDispatchToProps = (dispatch, { status, items }) => ({\n onOpen(id, onItemClick, dropdownPlacement, keyboard) {\n dispatch(isUserTouching() ? openModal('ACTIONS', {\n status,\n actions: items,\n onClick: onItemClick,\n }) : openDropdownMenu(id, dropdownPlacement, keyboard));\n },\n onClose(id) {\n dispatch(closeModal());\n dispatch(closeDropdownMenu(id));\n },\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(DropdownMenu);\n","// Wrapper to call requestIdleCallback() to schedule low-priority work.\n// See https://developer.mozilla.org/en-US/docs/Web/API/Background_Tasks_API\n// for a good breakdown of the concepts behind this.\n\nimport Queue from 'tiny-queue';\n\nconst taskQueue = new Queue();\nlet runningRequestIdleCallback = false;\n\nfunction runTasks(deadline) {\n while (taskQueue.length && deadline.timeRemaining() > 0) {\n taskQueue.shift()();\n }\n if (taskQueue.length) {\n requestIdleCallback(runTasks);\n } else {\n runningRequestIdleCallback = false;\n }\n}\n\nfunction scheduleIdleTask(task) {\n taskQueue.push(task);\n if (!runningRequestIdleCallback) {\n runningRequestIdleCallback = true;\n requestIdleCallback(runTasks);\n }\n}\n\nexport default scheduleIdleTask;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { autoPlayGif } from 'flavours/glitch/util/initial_state';\n\nexport default class AvatarOverlay extends React.PureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n friend: ImmutablePropTypes.map.isRequired,\n animate: PropTypes.bool,\n };\n\n static defaultProps = {\n animate: autoPlayGif,\n };\n\n render() {\n const { account, friend, animate } = this.props;\n\n const baseStyle = {\n backgroundImage: `url(${account.get(animate ? 'avatar' : 'avatar_static')})`,\n };\n\n const overlayStyle = {\n backgroundImage: `url(${friend.get(animate ? 'avatar' : 'avatar_static')})`,\n };\n\n return (\n \n );\n }\n\n}\n","export function autoUnfoldCW (settings, status) {\n if (!settings.getIn(['content_warnings', 'auto_unfold'])) {\n return false;\n }\n\n const rawRegex = settings.getIn(['content_warnings', 'filter']);\n\n if (!rawRegex) {\n return true;\n }\n\n let regex = null;\n\n try {\n regex = rawRegex && new RegExp(rawRegex.trim(), 'i');\n } catch (e) {\n // Bad regex, don't affect filters\n }\n\n if (!(status && regex)) {\n return undefined;\n }\n return !regex.test(status.get('spoiler_text'));\n}\n","import { injectIntl } from 'react-intl';\nimport { connect } from 'react-redux';\n\n// Connects a component.\nexport function wrap (Component, mapStateToProps, mapDispatchToProps, options) {\n const withIntl = typeof options === 'object' ? options.withIntl : !!options;\n return (withIntl ? injectIntl : i => i)(connect(mapStateToProps, mapDispatchToProps)(Component));\n}\n","// Wrapper to call requestIdleCallback() to schedule low-priority work.\n// See https://developer.mozilla.org/en-US/docs/Web/API/Background_Tasks_API\n// for a good breakdown of the concepts behind this.\n\nimport Queue from 'tiny-queue';\n\nconst taskQueue = new Queue();\nlet runningRequestIdleCallback = false;\n\nfunction runTasks(deadline) {\n while (taskQueue.length && deadline.timeRemaining() > 0) {\n taskQueue.shift()();\n }\n if (taskQueue.length) {\n requestIdleCallback(runTasks);\n } else {\n runningRequestIdleCallback = false;\n }\n}\n\nfunction scheduleIdleTask(task) {\n taskQueue.push(task);\n if (!runningRequestIdleCallback) {\n runningRequestIdleCallback = true;\n requestIdleCallback(runTasks);\n }\n}\n\nexport default scheduleIdleTask;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { autoPlayGif } from '../initial_state';\n\nexport default class AvatarOverlay extends React.PureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n friend: ImmutablePropTypes.map.isRequired,\n animate: PropTypes.bool,\n };\n\n static defaultProps = {\n animate: autoPlayGif,\n };\n\n render() {\n const { account, friend, animate } = this.props;\n\n const baseStyle = {\n backgroundImage: `url(${account.get(animate ? 'avatar' : 'avatar_static')})`,\n };\n\n const overlayStyle = {\n backgroundImage: `url(${friend.get(animate ? 'avatar' : 'avatar_static')})`,\n };\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class TextIconButton extends React.PureComponent {\n\n static propTypes = {\n label: PropTypes.string.isRequired,\n title: PropTypes.string,\n active: PropTypes.bool,\n onClick: PropTypes.func.isRequired,\n ariaControls: PropTypes.string,\n };\n\n handleClick = (e) => {\n e.preventDefault();\n this.props.onClick();\n }\n\n render () {\n const { label, title, active, ariaControls } = this.props;\n\n return (\n \n {label}\n \n );\n }\n\n}\n","// Package imports.\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport Toggle from 'react-toggle';\n\n// Components.\nimport Icon from 'flavours/glitch/components/icon';\n\n// Utils.\nimport { assignHandlers } from 'flavours/glitch/util/react_helpers';\n\n// Handlers.\nconst handlers = {\n\n // This function activates the dropdown item.\n handleActivate (e) {\n const {\n name,\n onChange,\n onClose,\n options: { on },\n } = this.props;\n\n // If the escape key was pressed, we close the dropdown.\n if (e.key === 'Escape' && onClose) {\n onClose();\n\n // Otherwise, we both close the dropdown and change the value.\n } else if (onChange && (!e.key || e.key === 'Enter')) {\n e.preventDefault(); // Prevents change in focus on click\n if ((on === null || typeof on === 'undefined') && onClose) {\n onClose();\n }\n onChange(name);\n }\n },\n};\n\n// The component.\nexport default class ComposerOptionsDropdownContentItem extends React.PureComponent {\n\n // Constructor.\n constructor (props) {\n super(props);\n assignHandlers(this, handlers);\n }\n\n // Rendering.\n render () {\n const { handleActivate } = this.handlers;\n const {\n active,\n options: {\n icon,\n meta,\n on,\n text,\n },\n } = this.props;\n const computedClass = classNames('composer--options--dropdown--content--item', {\n active,\n lengthy: meta,\n 'toggled-off': !on && on !== null && typeof on !== 'undefined',\n 'toggled-on': on,\n 'with-icon': icon,\n });\n\n // The result.\n return (\n \n {function () {\n\n // We render a `
` if we were provided an `on`\n // property, and otherwise show an `` if available.\n switch (true) {\n case on !== null && typeof on !== 'undefined':\n return (\n \n );\n case !!icon:\n return (\n \n );\n default:\n return null;\n }\n }()}\n {meta ? (\n \n {text} \n {meta}\n
\n ) :\n \n {text} \n
}\n \n );\n }\n\n};\n\n// Props.\nComposerOptionsDropdownContentItem.propTypes = {\n active: PropTypes.bool,\n name: PropTypes.string,\n onChange: PropTypes.func,\n onClose: PropTypes.func,\n options: PropTypes.shape({\n icon: PropTypes.string,\n meta: PropTypes.node,\n on: PropTypes.bool,\n text: PropTypes.node,\n }),\n};\n","// Package imports.\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport spring from 'react-motion/lib/spring';\n\n// Components.\nimport ComposerOptionsDropdownContentItem from './item';\n\n// Utils.\nimport { withPassive } from 'flavours/glitch/util/dom_helpers';\nimport Motion from 'flavours/glitch/util/optional_motion';\nimport { assignHandlers } from 'flavours/glitch/util/react_helpers';\n\n// Handlers.\nconst handlers = {\n // When the document is clicked elsewhere, we close the dropdown.\n handleDocumentClick ({ target }) {\n const { node } = this;\n const { onClose } = this.props;\n if (onClose && node && !node.contains(target)) {\n onClose();\n }\n },\n\n // Stores our node in `this.node`.\n handleRef (node) {\n this.node = node;\n },\n};\n\n// The spring to use with our motion.\nconst springMotion = spring(1, {\n damping: 35,\n stiffness: 400,\n});\n\n// The component.\nexport default class ComposerOptionsDropdownContent extends React.PureComponent {\n\n // Constructor.\n constructor (props) {\n super(props);\n assignHandlers(this, handlers);\n\n // Instance variables.\n this.node = null;\n\n this.state = {\n mounted: false,\n };\n }\n\n // On mounting, we add our listeners.\n componentDidMount () {\n const { handleDocumentClick } = this.handlers;\n document.addEventListener('click', handleDocumentClick, false);\n document.addEventListener('touchend', handleDocumentClick, withPassive);\n this.setState({ mounted: true });\n }\n\n // On unmounting, we remove our listeners.\n componentWillUnmount () {\n const { handleDocumentClick } = this.handlers;\n document.removeEventListener('click', handleDocumentClick, false);\n document.removeEventListener('touchend', handleDocumentClick, withPassive);\n }\n\n // Rendering.\n render () {\n const { mounted } = this.state;\n const { handleRef } = this.handlers;\n const {\n items,\n onChange,\n onClose,\n style,\n value,\n } = this.props;\n\n // The result.\n return (\n \n {({ opacity, scaleX, scaleY }) => (\n // It should not be transformed when mounting because the resulting\n // size will be used to determine the coordinate of the menu by\n // react-overlays\n \n {items ? items.map(\n ({\n name,\n ...rest\n }) => (\n \n )\n ) : null}\n
\n )}\n \n );\n }\n\n}\n\n// Props.\nComposerOptionsDropdownContent.propTypes = {\n items: PropTypes.arrayOf(PropTypes.shape({\n icon: PropTypes.string,\n meta: PropTypes.node,\n name: PropTypes.string.isRequired,\n on: PropTypes.bool,\n text: PropTypes.node,\n })),\n onChange: PropTypes.func,\n onClose: PropTypes.func,\n style: PropTypes.object,\n value: PropTypes.string,\n};\n\n// Default props.\nComposerOptionsDropdownContent.defaultProps = { style: {} };\n","// Package imports.\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport Overlay from 'react-overlays/lib/Overlay';\n\n// Components.\nimport IconButton from 'flavours/glitch/components/icon_button';\nimport ComposerOptionsDropdownContent from './content';\n\n// Utils.\nimport { isUserTouching } from 'flavours/glitch/util/is_mobile';\nimport { assignHandlers } from 'flavours/glitch/util/react_helpers';\n\n// Handlers.\nconst handlers = {\n\n // Closes the dropdown.\n handleClose () {\n this.setState({ open: false });\n },\n\n // The enter key toggles the dropdown's open state, and the escape\n // key closes it.\n handleKeyDown ({ key }) {\n const {\n handleClose,\n handleToggle,\n } = this.handlers;\n switch (key) {\n case 'Enter':\n handleToggle(key);\n break;\n case 'Escape':\n handleClose();\n break;\n }\n },\n\n // Creates an action modal object.\n handleMakeModal () {\n const component = this;\n const {\n items,\n onChange,\n onModalOpen,\n onModalClose,\n value,\n } = this.props;\n\n // Required props.\n if (!(onChange && onModalOpen && onModalClose && items)) {\n return null;\n }\n\n // The object.\n return {\n actions: items.map(\n ({\n name,\n ...rest\n }) => ({\n ...rest,\n active: value && name === value,\n name,\n onClick (e) {\n e.preventDefault(); // Prevents focus from changing\n onModalClose();\n onChange(name);\n },\n onPassiveClick (e) {\n e.preventDefault(); // Prevents focus from changing\n onChange(name);\n component.setState({ needsModalUpdate: true });\n },\n })\n ),\n };\n },\n\n // Toggles opening and closing the dropdown.\n handleToggle ({ target }) {\n const { handleMakeModal } = this.handlers;\n const { onModalOpen } = this.props;\n const { open } = this.state;\n\n // If this is a touch device, we open a modal instead of the\n // dropdown.\n if (isUserTouching()) {\n\n // This gets the modal to open.\n const modal = handleMakeModal();\n\n // If we can, we then open the modal.\n if (modal && onModalOpen) {\n onModalOpen(modal);\n return;\n }\n }\n\n const { top } = target.getBoundingClientRect();\n this.setState({ placement: top * 2 < innerHeight ? 'bottom' : 'top' });\n // Otherwise, we just set our state to open.\n this.setState({ open: !open });\n },\n\n // If our modal is open and our props update, we need to also update\n // the modal.\n handleUpdate () {\n const { handleMakeModal } = this.handlers;\n const { onModalOpen } = this.props;\n const { needsModalUpdate } = this.state;\n\n // Gets our modal object.\n const modal = handleMakeModal();\n\n // Reopens the modal with the new object.\n if (needsModalUpdate && modal && onModalOpen) {\n onModalOpen(modal);\n }\n },\n};\n\n// The component.\nexport default class ComposerOptionsDropdown extends React.PureComponent {\n\n // Constructor.\n constructor (props) {\n super(props);\n assignHandlers(this, handlers);\n this.state = {\n needsModalUpdate: false,\n open: false,\n placement: 'bottom',\n };\n }\n\n // Updates our modal as necessary.\n componentDidUpdate (prevProps) {\n const { handleUpdate } = this.handlers;\n const { items } = this.props;\n const { needsModalUpdate } = this.state;\n if (needsModalUpdate && items.find(\n (item, i) => item.on !== prevProps.items[i].on\n )) {\n handleUpdate();\n this.setState({ needsModalUpdate: false });\n }\n }\n\n // Rendering.\n render () {\n const {\n handleClose,\n handleKeyDown,\n handleToggle,\n } = this.handlers;\n const {\n active,\n disabled,\n title,\n icon,\n items,\n onChange,\n value,\n } = this.props;\n const { open, placement } = this.state;\n const computedClass = classNames('composer--options--dropdown', {\n active,\n open,\n top: placement === 'top',\n });\n\n // The result.\n return (\n \n \n \n \n \n
\n );\n }\n\n}\n\n// Props.\nComposerOptionsDropdown.propTypes = {\n active: PropTypes.bool,\n disabled: PropTypes.bool,\n icon: PropTypes.string,\n items: PropTypes.arrayOf(PropTypes.shape({\n icon: PropTypes.string,\n meta: PropTypes.node,\n name: PropTypes.string.isRequired,\n on: PropTypes.bool,\n text: PropTypes.node,\n })).isRequired,\n onChange: PropTypes.func,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func,\n title: PropTypes.string,\n value: PropTypes.string,\n};\n","// Package imports.\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport {\n FormattedMessage,\n defineMessages,\n} from 'react-intl';\nimport spring from 'react-motion/lib/spring';\n\n// Components.\nimport IconButton from 'flavours/glitch/components/icon_button';\nimport TextIconButton from 'flavours/glitch/components/text_icon_button';\nimport Dropdown from './dropdown';\n\n// Utils.\nimport Motion from 'flavours/glitch/util/optional_motion';\nimport {\n assignHandlers,\n hiddenComponent,\n} from 'flavours/glitch/util/react_helpers';\nimport { pollLimits } from 'flavours/glitch/util/initial_state';\n\n// Messages.\nconst messages = defineMessages({\n advanced_options_icon_title: {\n defaultMessage: 'Advanced options',\n id: 'advanced_options.icon_title',\n },\n attach: {\n defaultMessage: 'Attach...',\n id: 'compose.attach',\n },\n change_privacy: {\n defaultMessage: 'Adjust status privacy',\n id: 'privacy.change',\n },\n content_type: {\n defaultMessage: 'Content type',\n id: 'content-type.change',\n },\n direct_long: {\n defaultMessage: 'Post to mentioned users only',\n id: 'privacy.direct.long',\n },\n direct_short: {\n defaultMessage: 'Direct',\n id: 'privacy.direct.short',\n },\n doodle: {\n defaultMessage: 'Draw something',\n id: 'compose.attach.doodle',\n },\n html: {\n defaultMessage: 'HTML',\n id: 'compose.content-type.html',\n },\n local_only_long: {\n defaultMessage: 'Do not post to other instances',\n id: 'advanced_options.local-only.long',\n },\n local_only_short: {\n defaultMessage: 'Local-only',\n id: 'advanced_options.local-only.short',\n },\n markdown: {\n defaultMessage: 'Markdown',\n id: 'compose.content-type.markdown',\n },\n plain: {\n defaultMessage: 'Plain text',\n id: 'compose.content-type.plain',\n },\n private_long: {\n defaultMessage: 'Post to followers only',\n id: 'privacy.private.long',\n },\n private_short: {\n defaultMessage: 'Followers-only',\n id: 'privacy.private.short',\n },\n public_long: {\n defaultMessage: 'Post to public timelines',\n id: 'privacy.public.long',\n },\n public_short: {\n defaultMessage: 'Public',\n id: 'privacy.public.short',\n },\n sensitive: {\n defaultMessage: 'Mark media as sensitive',\n id: 'compose_form.sensitive',\n },\n spoiler: {\n defaultMessage: 'Hide text behind warning',\n id: 'compose_form.spoiler',\n },\n threaded_mode_long: {\n defaultMessage: 'Automatically opens a reply on posting',\n id: 'advanced_options.threaded_mode.long',\n },\n threaded_mode_short: {\n defaultMessage: 'Threaded mode',\n id: 'advanced_options.threaded_mode.short',\n },\n unlisted_long: {\n defaultMessage: 'Do not show in public timelines',\n id: 'privacy.unlisted.long',\n },\n unlisted_short: {\n defaultMessage: 'Unlisted',\n id: 'privacy.unlisted.short',\n },\n upload: {\n defaultMessage: 'Upload a file',\n id: 'compose.attach.upload',\n },\n add_poll: {\n defaultMessage: 'Add a poll',\n id: 'poll_button.add_poll',\n },\n remove_poll: {\n defaultMessage: 'Remove poll',\n id: 'poll_button.remove_poll',\n },\n});\n\n// Handlers.\nconst handlers = {\n\n // Handles file selection.\n handleChangeFiles ({ target: { files } }) {\n const { onUpload } = this.props;\n if (files.length && onUpload) {\n onUpload(files);\n }\n },\n\n // Handles attachment clicks.\n handleClickAttach (name) {\n const { fileElement } = this;\n const { onDoodleOpen } = this.props;\n\n // We switch over the name of the option.\n switch (name) {\n case 'upload':\n if (fileElement) {\n fileElement.click();\n }\n return;\n case 'doodle':\n if (onDoodleOpen) {\n onDoodleOpen();\n }\n return;\n }\n },\n\n // Handles a ref to the file input.\n handleRefFileElement (fileElement) {\n this.fileElement = fileElement;\n },\n};\n\n// The component.\nexport default class ComposerOptions extends React.PureComponent {\n\n // Constructor.\n constructor (props) {\n super(props);\n assignHandlers(this, handlers);\n\n // Instance variables.\n this.fileElement = null;\n }\n\n // Rendering.\n render () {\n const {\n handleChangeFiles,\n handleClickAttach,\n handleRefFileElement,\n } = this.handlers;\n const {\n acceptContentTypes,\n advancedOptions,\n contentType,\n disabled,\n allowMedia,\n hasMedia,\n allowPoll,\n hasPoll,\n intl,\n onChangeAdvancedOption,\n onChangeSensitivity,\n onChangeVisibility,\n onTogglePoll,\n onChangeContentType,\n onModalClose,\n onModalOpen,\n onToggleSpoiler,\n privacy,\n resetFileKey,\n sensitive,\n spoiler,\n } = this.props;\n\n // We predefine our privacy items so that we can easily pick the\n // dropdown icon later.\n const privacyItems = {\n direct: {\n icon: 'envelope',\n meta: ,\n name: 'direct',\n text: ,\n },\n private: {\n icon: 'lock',\n meta: ,\n name: 'private',\n text: ,\n },\n public: {\n icon: 'globe',\n meta: ,\n name: 'public',\n text: ,\n },\n unlisted: {\n icon: 'unlock',\n meta: ,\n name: 'unlisted',\n text: ,\n },\n };\n\n const contentTypeItems = {\n plain: {\n icon: 'align-left',\n name: 'text/plain',\n text: ,\n },\n html: {\n icon: 'code',\n name: 'text/html',\n text: ,\n },\n markdown: {\n icon: 'arrow-circle-down',\n name: 'text/markdown',\n text: ,\n },\n };\n\n // The result.\n return (\n \n
\n
,\n },\n {\n icon: 'paint-brush',\n name: 'doodle',\n text:
,\n },\n ]}\n onChange={handleClickAttach}\n onModalClose={onModalClose}\n onModalOpen={onModalOpen}\n title={intl.formatMessage(messages.attach)}\n />\n {!!pollLimits && (\n
\n )}\n
\n {({ scale }) => (\n \n \n
\n )}\n \n
\n
\n
\n {onToggleSpoiler && (\n
\n )}\n
!!value)}\n disabled={disabled}\n icon='ellipsis-h'\n items={advancedOptions ? [\n {\n meta: ,\n name: 'threaded_mode',\n on: advancedOptions.get('threaded_mode'),\n text: ,\n },\n ] : null}\n onChange={onChangeAdvancedOption}\n onModalClose={onModalClose}\n onModalOpen={onModalOpen}\n title={intl.formatMessage(messages.advanced_options_icon_title)}\n />\n \n );\n }\n\n}\n\n// Props.\nComposerOptions.propTypes = {\n acceptContentTypes: PropTypes.string,\n advancedOptions: ImmutablePropTypes.map,\n contentType: PropTypes.string,\n disabled: PropTypes.bool,\n allowMedia: PropTypes.bool,\n hasMedia: PropTypes.bool,\n allowPoll: PropTypes.bool,\n hasPoll: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n onChangeAdvancedOption: PropTypes.func,\n onChangeSensitivity: PropTypes.func,\n onChangeVisibility: PropTypes.func,\n onTogglePoll: PropTypes.func,\n onChangeContentType: PropTypes.func,\n onDoodleOpen: PropTypes.func,\n onModalClose: PropTypes.func,\n onModalOpen: PropTypes.func,\n onToggleSpoiler: PropTypes.func,\n onUpload: PropTypes.func,\n privacy: PropTypes.string,\n resetFileKey: PropTypes.number,\n sensitive: PropTypes.bool,\n spoiler: PropTypes.bool,\n};\n","// Package imports.\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport {\n defineMessages,\n FormattedMessage,\n} from 'react-intl';\nimport { length } from 'stringz';\n\n// Components.\nimport Button from 'flavours/glitch/components/button';\nimport Icon from 'flavours/glitch/components/icon';\n\n// Utils.\nimport { maxChars } from 'flavours/glitch/util/initial_state';\n\n// Messages.\nconst messages = defineMessages({\n publish: {\n defaultMessage: 'Toot',\n id: 'compose_form.publish',\n },\n publishLoud: {\n defaultMessage: '{publish}!',\n id: 'compose_form.publish_loud',\n },\n});\n\n// The component.\nexport default function ComposerPublisher ({\n countText,\n disabled,\n intl,\n onSecondarySubmit,\n onSubmit,\n privacy,\n sideArm,\n}) {\n const diff = maxChars - length(countText || '');\n const computedClass = classNames('composer--publisher', {\n disabled: disabled || diff < 0,\n over: diff < 0,\n });\n\n // The result.\n return (\n \n {diff} \n {sideArm && sideArm !== 'none' ? (\n \n \n \n }\n title={`${intl.formatMessage(messages.publish)}: ${intl.formatMessage({ id: `privacy.${sideArm}.short` })}`}\n />\n ) : null}\n \n \n {' '}\n \n \n );\n case privacy === 'public':\n return (\n \n }}\n />\n \n );\n default:\n return ;\n }\n }()}\n title={`${intl.formatMessage(messages.publish)}: ${intl.formatMessage({ id: `privacy.${privacy}.short` })}`}\n onClick={onSubmit}\n disabled={disabled || diff < 0}\n />\n
\n );\n}\n\n// Props.\nComposerPublisher.propTypes = {\n countText: PropTypes.string,\n disabled: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n onSecondarySubmit: PropTypes.func,\n onSubmit: PropTypes.func,\n privacy: PropTypes.oneOf(['direct', 'private', 'unlisted', 'public']),\n sideArm: PropTypes.oneOf(['none', 'direct', 'private', 'unlisted', 'public']),\n};\n","// Package imports.\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { defineMessages } from 'react-intl';\n\n// Components.\nimport AccountContainer from 'flavours/glitch/containers/account_container';\nimport IconButton from 'flavours/glitch/components/icon_button';\nimport AttachmentList from 'flavours/glitch/components/attachment_list';\n\n// Utils.\nimport { assignHandlers } from 'flavours/glitch/util/react_helpers';\nimport { isRtl } from 'flavours/glitch/util/rtl';\n\n// Messages.\nconst messages = defineMessages({\n cancel: {\n defaultMessage: 'Cancel',\n id: 'reply_indicator.cancel',\n },\n});\n\n// Handlers.\nconst handlers = {\n\n // Handles a click on the \"close\" button.\n handleClick () {\n const { onCancel } = this.props;\n if (onCancel) {\n onCancel();\n }\n },\n};\n\n// The component.\nexport default class ComposerReply extends React.PureComponent {\n\n // Constructor.\n constructor (props) {\n super(props);\n assignHandlers(this, handlers);\n }\n\n // Rendering.\n render () {\n const { handleClick } = this.handlers;\n const {\n status,\n intl,\n } = this.props;\n\n const account = status.get('account');\n const content = status.get('content');\n const attachments = status.get('media_attachments');\n\n // The result.\n return (\n \n \n \n {account && (\n \n )}\n \n
\n {attachments.size > 0 && (\n \n )}\n \n );\n }\n\n}\n\nComposerReply.propTypes = {\n status: ImmutablePropTypes.map.isRequired,\n intl: PropTypes.object.isRequired,\n onCancel: PropTypes.func,\n};\n","// Package imports.\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { defineMessages, FormattedMessage } from 'react-intl';\n\n// Utils.\nimport {\n assignHandlers,\n hiddenComponent,\n} from 'flavours/glitch/util/react_helpers';\n\n// Messages.\nconst messages = defineMessages({\n placeholder: {\n defaultMessage: 'Write your warning here',\n id: 'compose_form.spoiler_placeholder',\n },\n});\n\n// Handlers.\nconst handlers = {\n\n // Handles a keypress.\n handleKeyDown ({\n ctrlKey,\n keyCode,\n metaKey,\n altKey,\n }) {\n const { onSubmit, onSecondarySubmit } = this.props;\n\n // We submit the status on control/meta + enter.\n if (onSubmit && keyCode === 13 && (ctrlKey || metaKey)) {\n onSubmit();\n }\n\n // Submit the status with secondary visibility on alt + enter.\n if (onSecondarySubmit && keyCode === 13 && altKey) {\n onSecondarySubmit();\n }\n },\n\n handleRefSpoilerText (spoilerText) {\n this.spoilerText = spoilerText;\n },\n\n // When the escape key is released, we focus the UI.\n handleKeyUp ({ key }) {\n if (key === 'Escape') {\n document.querySelector('.ui').parentElement.focus();\n }\n },\n};\n\n// The component.\nexport default class ComposerSpoiler extends React.PureComponent {\n\n // Constructor.\n constructor (props) {\n super(props);\n assignHandlers(this, handlers);\n }\n\n // Rendering.\n render () {\n const { handleKeyDown, handleKeyUp, handleRefSpoilerText } = this.handlers;\n const {\n hidden,\n intl,\n onChange,\n text,\n } = this.props;\n\n // The result.\n return (\n \n \n \n \n \n \n \n
\n );\n }\n\n}\n\n// Props.\nComposerSpoiler.propTypes = {\n hidden: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n onChange: PropTypes.func,\n onSubmit: PropTypes.func,\n onSecondarySubmit: PropTypes.func,\n text: PropTypes.string,\n};\n","// Package imports.\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { defineMessages } from 'react-intl';\n\n// Components.\nimport Icon from 'flavours/glitch/components/icon';\n\n// Messages.\nconst messages = defineMessages({\n localOnly: {\n defaultMessage: 'This post is local-only',\n id: 'advanced_options.local-only.tooltip',\n },\n threadedMode: {\n defaultMessage: 'Threaded mode enabled',\n id: 'advanced_options.threaded_mode.tooltip',\n },\n});\n\n// We use an array of tuples here instead of an object because it\n// preserves order.\nconst iconMap = [\n ['do_not_federate', 'home', messages.localOnly],\n ['threaded_mode', 'comments', messages.threadedMode],\n];\n\n// The component.\nexport default function ComposerTextareaIcons ({\n advancedOptions,\n intl,\n}) {\n\n // The result. We just map every active option to its icon.\n return (\n \n {advancedOptions ? iconMap.map(\n ([key, icon, message]) => advancedOptions.get(key) ? (\n \n \n \n ) : null\n ) : null}\n
\n );\n}\n\n// Props.\nComposerTextareaIcons.propTypes = {\n advancedOptions: ImmutablePropTypes.map,\n intl: PropTypes.object.isRequired,\n};\n","// Package imports.\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\n\n// Components.\nimport ComposerTextareaSuggestionsItem from './item';\n\n// The component.\nexport default function ComposerTextareaSuggestions ({\n hidden,\n onSuggestionClick,\n suggestions,\n value,\n}) {\n\n // The result.\n return (\n \n {!hidden && suggestions ? suggestions.map(\n (suggestion, index) => (\n \n )\n ) : null}\n
\n );\n}\n\nComposerTextareaSuggestions.propTypes = {\n hidden: PropTypes.bool,\n onSuggestionClick: PropTypes.func,\n suggestions: ImmutablePropTypes.list,\n value: PropTypes.number,\n};\n","// Package imports.\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport {\n defineMessages,\n FormattedMessage,\n} from 'react-intl';\nimport Textarea from 'react-textarea-autosize';\n\n// Components.\nimport EmojiPicker from 'flavours/glitch/features/emoji_picker';\nimport ComposerTextareaIcons from './icons';\nimport ComposerTextareaSuggestions from './suggestions';\n\n// Utils.\nimport { isRtl } from 'flavours/glitch/util/rtl';\nimport {\n assignHandlers,\n hiddenComponent,\n} from 'flavours/glitch/util/react_helpers';\n\n// Messages.\nconst messages = defineMessages({\n placeholder: {\n defaultMessage: 'What is on your mind?',\n id: 'compose_form.placeholder',\n },\n});\n\n// Handlers.\nconst handlers = {\n\n // When blurring the textarea, suggestions are hidden.\n handleBlur () {\n this.setState({ suggestionsHidden: true });\n },\n\n // When the contents of the textarea change, we have to pull up new\n // autosuggest suggestions if applicable, and also change the value\n // of the textarea in our store.\n handleChange ({\n target: {\n selectionStart,\n value,\n },\n }) {\n const {\n onChange,\n onSuggestionsFetchRequested,\n onSuggestionsClearRequested,\n } = this.props;\n const { lastToken } = this.state;\n\n // This gets the token at the caret location, if it begins with an\n // `@` (mentions) or `:` (shortcodes).\n const left = value.slice(0, selectionStart).search(/[^\\s\\u200B]+$/);\n const right = value.slice(selectionStart).search(/[\\s\\u200B]/);\n const token = function () {\n switch (true) {\n case left < 0 || !/[@:#]/.test(value[left]):\n return null;\n case right < 0:\n return value.slice(left);\n default:\n return value.slice(left, right + selectionStart).trim().toLowerCase();\n }\n }();\n\n // We only request suggestions for tokens which are at least 3\n // characters long.\n if (onSuggestionsFetchRequested && token && token.length >= 3) {\n if (lastToken !== token) {\n this.setState({\n lastToken: token,\n selectedSuggestion: 0,\n tokenStart: left,\n });\n onSuggestionsFetchRequested(token);\n }\n } else {\n this.setState({ lastToken: null });\n if (onSuggestionsClearRequested) {\n onSuggestionsClearRequested();\n }\n }\n\n // Updates the value of the textarea.\n if (onChange) {\n onChange(value);\n }\n },\n\n // Handles a click on an autosuggestion.\n handleClickSuggestion (index) {\n const { textarea } = this;\n const {\n onSuggestionSelected,\n suggestions,\n } = this.props;\n const {\n lastToken,\n tokenStart,\n } = this.state;\n onSuggestionSelected(tokenStart, lastToken, suggestions.get(index));\n textarea.focus();\n },\n\n // Handles a keypress. If the autosuggestions are visible, we need\n // to allow keypresses to navigate and sleect them.\n handleKeyDown (e) {\n const {\n disabled,\n onSubmit,\n onSecondarySubmit,\n onSuggestionSelected,\n suggestions,\n } = this.props;\n const {\n lastToken,\n suggestionsHidden,\n selectedSuggestion,\n tokenStart,\n } = this.state;\n\n // Keypresses do nothing if the composer is disabled.\n if (disabled) {\n e.preventDefault();\n return;\n }\n\n // We submit the status on control/meta + enter.\n if (onSubmit && e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {\n onSubmit();\n }\n\n // Submit the status with secondary visibility on alt + enter.\n if (onSecondarySubmit && e.keyCode === 13 && e.altKey) {\n onSecondarySubmit();\n }\n\n // Switches over the pressed key.\n switch(e.key) {\n\n // On arrow down, we pick the next suggestion.\n case 'ArrowDown':\n if (suggestions && suggestions.size > 0 && !suggestionsHidden) {\n e.preventDefault();\n this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) });\n }\n return;\n\n // On arrow up, we pick the previous suggestion.\n case 'ArrowUp':\n if (suggestions && suggestions.size > 0 && !suggestionsHidden) {\n e.preventDefault();\n this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) });\n }\n return;\n\n // On enter or tab, we select the suggestion.\n case 'Enter':\n case 'Tab':\n if (onSuggestionSelected && lastToken !== null && suggestions && suggestions.size > 0 && !suggestionsHidden) {\n e.preventDefault();\n e.stopPropagation();\n onSuggestionSelected(tokenStart, lastToken, suggestions.get(selectedSuggestion));\n }\n return;\n }\n },\n\n // When the escape key is released, we either close the suggestions\n // window or focus the UI.\n handleKeyUp ({ key }) {\n const { suggestionsHidden } = this.state;\n if (key === 'Escape') {\n if (!suggestionsHidden) {\n this.setState({ suggestionsHidden: true });\n } else {\n document.querySelector('.ui').parentElement.focus();\n }\n }\n },\n\n // Handles the pasting of images into the composer.\n handlePaste (e) {\n const { onPaste } = this.props;\n let d;\n if (onPaste && (d = e.clipboardData) && (d = d.files).length === 1) {\n onPaste(d);\n e.preventDefault();\n }\n },\n\n // Saves a reference to the textarea.\n handleRefTextarea (textarea) {\n this.textarea = textarea;\n },\n};\n\n// The component.\nexport default class ComposerTextarea extends React.Component {\n\n // Constructor.\n constructor (props) {\n super(props);\n assignHandlers(this, handlers);\n this.state = {\n suggestionsHidden: false,\n selectedSuggestion: 0,\n lastToken: null,\n tokenStart: 0,\n };\n\n // Instance variables.\n this.textarea = null;\n }\n\n // When we receive new suggestions, we unhide the suggestions window\n // if we didn't have any suggestions before.\n componentWillReceiveProps (nextProps) {\n const { suggestions } = this.props;\n const { suggestionsHidden } = this.state;\n if (nextProps.suggestions && nextProps.suggestions !== suggestions && nextProps.suggestions.size > 0 && suggestionsHidden) {\n this.setState({ suggestionsHidden: false });\n }\n }\n\n // Rendering.\n render () {\n const {\n handleBlur,\n handleChange,\n handleClickSuggestion,\n handleKeyDown,\n handleKeyUp,\n handlePaste,\n handleRefTextarea,\n } = this.handlers;\n const {\n advancedOptions,\n autoFocus,\n disabled,\n intl,\n onPickEmoji,\n suggestions,\n value,\n } = this.props;\n const {\n selectedSuggestion,\n suggestionsHidden,\n } = this.state;\n\n // The result.\n return (\n \n \n \n \n \n \n \n \n
\n );\n }\n\n}\n\n// Props.\nComposerTextarea.propTypes = {\n advancedOptions: ImmutablePropTypes.map,\n autoFocus: PropTypes.bool,\n disabled: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n onChange: PropTypes.func,\n onPaste: PropTypes.func,\n onPickEmoji: PropTypes.func,\n onSubmit: PropTypes.func,\n onSecondarySubmit: PropTypes.func,\n onSuggestionsClearRequested: PropTypes.func,\n onSuggestionsFetchRequested: PropTypes.func,\n onSuggestionSelected: PropTypes.func,\n suggestions: ImmutablePropTypes.list,\n value: PropTypes.string,\n};\n\n// Default props.\nComposerTextarea.defaultProps = { autoFocus: true };\n","// Package imports.\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport {\n FormattedMessage,\n defineMessages,\n} from 'react-intl';\nimport spring from 'react-motion/lib/spring';\n\n// Components.\nimport IconButton from 'flavours/glitch/components/icon_button';\n\n// Utils.\nimport Motion from 'flavours/glitch/util/optional_motion';\nimport { assignHandlers } from 'flavours/glitch/util/react_helpers';\nimport { isUserTouching } from 'flavours/glitch/util/is_mobile';\n\n// Messages.\nconst messages = defineMessages({\n undo: {\n defaultMessage: 'Undo',\n id: 'upload_form.undo',\n },\n description: {\n defaultMessage: 'Describe for the visually impaired',\n id: 'upload_form.description',\n },\n crop: {\n defaultMessage: 'Crop',\n id: 'upload_form.focus',\n },\n});\n\n// Handlers.\nconst handlers = {\n\n // On blur, we save the description for the media item.\n handleBlur () {\n const {\n id,\n onChangeDescription,\n } = this.props;\n const { dirtyDescription } = this.state;\n\n this.setState({ dirtyDescription: null, focused: false });\n\n if (id && onChangeDescription && dirtyDescription !== null) {\n onChangeDescription(id, dirtyDescription);\n }\n },\n\n // When the value of our description changes, we store it in the\n // temp value `dirtyDescription` in our state.\n handleChange ({ target: { value } }) {\n this.setState({ dirtyDescription: value });\n },\n\n // Records focus on the media item.\n handleFocus () {\n this.setState({ focused: true });\n },\n\n // Records the start of a hover over the media item.\n handleMouseEnter () {\n this.setState({ hovered: true });\n },\n\n // Records the end of a hover over the media item.\n handleMouseLeave () {\n this.setState({ hovered: false });\n },\n\n // Removes the media item.\n handleRemove () {\n const {\n id,\n onRemove,\n } = this.props;\n if (id && onRemove) {\n onRemove(id);\n }\n },\n\n // Opens the focal point modal.\n handleFocalPointClick () {\n const {\n id,\n onOpenFocalPointModal,\n } = this.props;\n if (id && onOpenFocalPointModal) {\n onOpenFocalPointModal(id);\n }\n },\n};\n\n// The component.\nexport default class ComposerUploadFormItem extends React.PureComponent {\n\n // Constructor.\n constructor (props) {\n super(props);\n assignHandlers(this, handlers);\n this.state = {\n hovered: false,\n focused: false,\n dirtyDescription: null,\n };\n }\n\n // Rendering.\n render () {\n const {\n handleBlur,\n handleChange,\n handleFocus,\n handleMouseEnter,\n handleMouseLeave,\n handleRemove,\n handleFocalPointClick,\n } = this.handlers;\n const {\n intl,\n preview,\n focusX,\n focusY,\n mediaType,\n } = this.props;\n const {\n focused,\n hovered,\n dirtyDescription,\n } = this.state;\n const active = hovered || focused || isUserTouching();\n const computedClass = classNames('composer--upload_form--item', { active });\n const x = ((focusX / 2) + .5) * 100;\n const y = ((focusY / -2) + .5) * 100;\n const description = dirtyDescription || (dirtyDescription !== '' && this.props.description) || '';\n\n // The result.\n return (\n \n
\n {({ scale }) => (\n \n
\n \n \n \n {mediaType === 'image' && }\n
\n
\n \n \n \n
\n )}\n \n
\n );\n }\n\n}\n\n// Props.\nComposerUploadFormItem.propTypes = {\n description: PropTypes.string,\n id: PropTypes.string,\n intl: PropTypes.object.isRequired,\n onChangeDescription: PropTypes.func.isRequired,\n onOpenFocalPointModal: PropTypes.func.isRequired,\n onRemove: PropTypes.func.isRequired,\n focusX: PropTypes.number,\n focusY: PropTypes.number,\n mediaType: PropTypes.string,\n preview: PropTypes.string,\n};\n","// Package imports.\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport {\n defineMessages,\n FormattedMessage,\n} from 'react-intl';\nimport spring from 'react-motion/lib/spring';\n\n// Components.\nimport Icon from 'flavours/glitch/components/icon';\n\n// Utils.\nimport Motion from 'flavours/glitch/util/optional_motion';\n\n// Messages.\nconst messages = defineMessages({\n upload: {\n defaultMessage: 'Uploading...',\n id: 'upload_progress.label',\n },\n});\n\n// The component.\nexport default function ComposerUploadFormProgress ({ progress }) {\n\n // The result.\n return (\n \n
\n
\n
\n
\n
\n {({ width }) =>\n (
)\n }\n \n
\n
\n
\n );\n}\n\n// Props.\nComposerUploadFormProgress.propTypes = { progress: PropTypes.number };\n","// Package imports.\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\n\n// Components.\nimport ComposerUploadFormItem from './item';\nimport ComposerUploadFormProgress from './progress';\n\n// The component.\nexport default function ComposerUploadForm ({\n intl,\n media,\n onChangeDescription,\n onOpenFocalPointModal,\n onRemove,\n progress,\n uploading,\n handleRef,\n}) {\n const computedClass = classNames('composer--upload_form', { uploading });\n\n // The result.\n return (\n \n {uploading ?
: null}\n {media ? (\n
\n {media.map(item => (\n \n ))}\n
\n ) : null}\n
\n );\n}\n\n// Props.\nComposerUploadForm.propTypes = {\n intl: PropTypes.object.isRequired,\n media: ImmutablePropTypes.list,\n onChangeDescription: PropTypes.func.isRequired,\n onRemove: PropTypes.func.isRequired,\n progress: PropTypes.number,\n uploading: PropTypes.bool,\n handleRef: PropTypes.func,\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport IconButton from 'flavours/glitch/components/icon_button';\nimport Icon from 'flavours/glitch/components/icon';\nimport classNames from 'classnames';\nimport { pollLimits } from 'flavours/glitch/util/initial_state';\n\nconst messages = defineMessages({\n option_placeholder: { id: 'compose_form.poll.option_placeholder', defaultMessage: 'Choice {number}' },\n add_option: { id: 'compose_form.poll.add_option', defaultMessage: 'Add a choice' },\n remove_option: { id: 'compose_form.poll.remove_option', defaultMessage: 'Remove this choice' },\n poll_duration: { id: 'compose_form.poll.duration', defaultMessage: 'Poll duration' },\n single_choice: { id: 'compose_form.poll.single_choice', defaultMessage: 'Allow one choice' },\n multiple_choices: { id: 'compose_form.poll.multiple_choices', defaultMessage: 'Allow multiple choices' },\n minutes: { id: 'intervals.full.minutes', defaultMessage: '{number, plural, one {# minute} other {# minutes}}' },\n hours: { id: 'intervals.full.hours', defaultMessage: '{number, plural, one {# hour} other {# hours}}' },\n days: { id: 'intervals.full.days', defaultMessage: '{number, plural, one {# day} other {# days}}' },\n});\n\n@injectIntl\nclass Option extends React.PureComponent {\n\n static propTypes = {\n title: PropTypes.string.isRequired,\n index: PropTypes.number.isRequired,\n isPollMultiple: PropTypes.bool,\n onChange: PropTypes.func.isRequired,\n onRemove: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n handleOptionTitleChange = e => {\n this.props.onChange(this.props.index, e.target.value);\n };\n\n handleOptionRemove = () => {\n this.props.onRemove(this.props.index);\n };\n\n render () {\n const { isPollMultiple, title, index, intl } = this.props;\n\n return (\n \n \n \n\n \n \n\n \n \n
\n \n );\n }\n\n}\n\nexport default\n@injectIntl\nclass PollForm extends ImmutablePureComponent {\n\n static propTypes = {\n options: ImmutablePropTypes.list,\n expiresIn: PropTypes.number,\n isMultiple: PropTypes.bool,\n onChangeOption: PropTypes.func.isRequired,\n onAddOption: PropTypes.func.isRequired,\n onRemoveOption: PropTypes.func.isRequired,\n onChangeSettings: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n handleAddOption = () => {\n this.props.onAddOption('');\n };\n\n handleSelectDuration = e => {\n this.props.onChangeSettings(e.target.value, this.props.isMultiple);\n };\n\n handleSelectMultiple = e => {\n this.props.onChangeSettings(this.props.expiresIn, e.target.value === 'true');\n };\n\n render () {\n const { options, expiresIn, isMultiple, onChangeOption, onRemoveOption, intl } = this.props;\n\n if (!options) {\n return null;\n }\n\n return (\n \n
\n {options.map((title, i) => )}\n {options.size < pollLimits.max_options && (\n \n \n \n \n )}\n \n\n
\n \n {intl.formatMessage(messages.single_choice)} \n {intl.formatMessage(messages.multiple_choices)} \n \n\n \n {intl.formatMessage(messages.minutes, { number: 5 })} \n {intl.formatMessage(messages.minutes, { number: 30 })} \n {intl.formatMessage(messages.hours, { number: 1 })} \n {intl.formatMessage(messages.hours, { number: 6 })} \n {intl.formatMessage(messages.days, { number: 1 })} \n {intl.formatMessage(messages.days, { number: 3 })} \n {intl.formatMessage(messages.days, { number: 7 })} \n \n
\n
\n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport PollForm from './components/poll_form';\nimport { addPollOption, removePollOption, changePollOption, changePollSettings } from '../../../actions/compose';\n\nconst mapStateToProps = state => ({\n options: state.getIn(['compose', 'poll', 'options']),\n expiresIn: state.getIn(['compose', 'poll', 'expires_in']),\n isMultiple: state.getIn(['compose', 'poll', 'multiple']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onAddOption(title) {\n dispatch(addPollOption(title));\n },\n\n onRemoveOption(index) {\n dispatch(removePollOption(index));\n },\n\n onChangeOption(index, title) {\n dispatch(changePollOption(index, title));\n },\n\n onChangeSettings(expiresIn, isMultiple) {\n dispatch(changePollSettings(expiresIn, isMultiple));\n },\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(PollForm);\n","import React from 'react';\nimport Motion from 'flavours/glitch/util/optional_motion';\nimport spring from 'react-motion/lib/spring';\nimport { defineMessages, FormattedMessage } from 'react-intl';\nimport { profileLink } from 'flavours/glitch/util/backend_links';\n\n// This is the spring used with our motion.\nconst motionSpring = spring(1, { damping: 35, stiffness: 400 });\n\n// Messages.\nconst messages = defineMessages({\n disclaimer: {\n defaultMessage: 'Your account is not {locked}. Anyone can follow you to view your follower-only posts.',\n id: 'compose_form.lock_disclaimer',\n },\n locked: {\n defaultMessage: 'locked',\n id: 'compose_form.lock_disclaimer.lock',\n },\n});\n\n// The component.\nexport default function ComposerWarning () {\n let lockedLink = ;\n if (profileLink !== undefined) {\n lockedLink = {lockedLink} ;\n }\n return (\n \n {({ opacity, scaleX, scaleY }) => (\n \n \n
\n )}\n \n );\n}\n\nComposerWarning.propTypes = {};\n","import React from 'react';\nimport Motion from 'flavours/glitch/util/optional_motion';\nimport spring from 'react-motion/lib/spring';\nimport { defineMessages, FormattedMessage } from 'react-intl';\n\n// This is the spring used with our motion.\nconst motionSpring = spring(1, { damping: 35, stiffness: 400 });\n\n// Messages.\nconst messages = defineMessages({\n disclaimer: {\n defaultMessage: 'This toot won\\'t be listed under any hashtag as it is unlisted. Only public toots can be searched by hashtag.',\n id: 'compose_form.hashtag_warning',\n },\n});\n\n// The component.\nexport default function ComposerHashtagWarning () {\n return (\n \n {({ opacity, scaleX, scaleY }) => (\n \n \n
\n )}\n \n );\n}\n\nComposerHashtagWarning.propTypes = {};\n","import React from 'react';\nimport Motion from 'flavours/glitch/util/optional_motion';\nimport spring from 'react-motion/lib/spring';\nimport { defineMessages, FormattedMessage } from 'react-intl';\nimport { termsLink} from 'flavours/glitch/util/backend_links';\n\n// This is the spring used with our motion.\nconst motionSpring = spring(1, { damping: 35, stiffness: 400 });\n\n// Messages.\nconst messages = defineMessages({\n disclaimer: {\n defaultMessage: 'This toot will only be sent to all the mentioned users.',\n id: 'compose_form.direct_message_warning',\n },\n learn_more: {\n defaultMessage: 'Learn more',\n id: 'compose_form.direct_message_warning_learn_more'\n }\n});\n\n// The component.\nexport default function ComposerDirectWarning () {\n return (\n \n {({ opacity, scaleX, scaleY }) => (\n \n
\n \n { termsLink !== undefined && }\n \n
\n )}\n \n );\n}\n\nComposerDirectWarning.propTypes = {};\n","// Package imports.\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { defineMessages } from 'react-intl';\n\nconst APPROX_HASHTAG_RE = /(?:^|[^\\/\\)\\w])#(\\S+)/i;\n\n// Actions.\nimport {\n cancelReplyCompose,\n changeCompose,\n changeComposeAdvancedOption,\n changeComposeSensitivity,\n changeComposeSpoilerText,\n changeComposeSpoilerness,\n changeComposeVisibility,\n changeComposeContentType,\n changeUploadCompose,\n clearComposeSuggestions,\n fetchComposeSuggestions,\n insertEmojiCompose,\n mountCompose,\n selectComposeSuggestion,\n submitCompose,\n undoUploadCompose,\n unmountCompose,\n uploadCompose,\n} from 'flavours/glitch/actions/compose';\nimport {\n closeModal,\n openModal,\n} from 'flavours/glitch/actions/modal';\nimport { changeLocalSetting } from 'flavours/glitch/actions/local_settings';\nimport { addPoll, removePoll } from 'flavours/glitch/actions/compose';\n\n// Components.\nimport ComposerOptions from './options';\nimport ComposerPublisher from './publisher';\nimport ComposerReply from './reply';\nimport ComposerSpoiler from './spoiler';\nimport ComposerTextarea from './textarea';\nimport ComposerUploadForm from './upload_form';\nimport ComposerPollForm from './poll_form';\nimport ComposerWarning from './warning';\nimport ComposerHashtagWarning from './hashtag_warning';\nimport ComposerDirectWarning from './direct_warning';\n\n// Utils.\nimport { me } from 'flavours/glitch/util/initial_state';\nimport { isMobile } from 'flavours/glitch/util/is_mobile';\nimport { assignHandlers } from 'flavours/glitch/util/react_helpers';\nimport { wrap } from 'flavours/glitch/util/redux_helpers';\nimport { privacyPreference } from 'flavours/glitch/util/privacy_preference';\n\nconst messages = defineMessages({\n missingDescriptionMessage: { id: 'confirmations.missing_media_description.message',\n defaultMessage: 'At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.' },\n missingDescriptionConfirm: { id: 'confirmations.missing_media_description.confirm',\n defaultMessage: 'Send anyway' },\n});\n\n// State mapping.\nfunction mapStateToProps (state) {\n const spoilersAlwaysOn = state.getIn(['local_settings', 'always_show_spoilers_field']);\n const inReplyTo = state.getIn(['compose', 'in_reply_to']);\n const replyPrivacy = inReplyTo ? state.getIn(['statuses', inReplyTo, 'visibility']) : null;\n const sideArmBasePrivacy = state.getIn(['local_settings', 'side_arm']);\n const sideArmRestrictedPrivacy = replyPrivacy ? privacyPreference(replyPrivacy, sideArmBasePrivacy) : null;\n let sideArmPrivacy = null;\n switch (state.getIn(['local_settings', 'side_arm_reply_mode'])) {\n case 'copy':\n sideArmPrivacy = replyPrivacy;\n break;\n case 'restrict':\n sideArmPrivacy = sideArmRestrictedPrivacy;\n break;\n }\n sideArmPrivacy = sideArmPrivacy || sideArmBasePrivacy;\n return {\n acceptContentTypes: state.getIn(['media_attachments', 'accept_content_types']).toArray().join(','),\n advancedOptions: state.getIn(['compose', 'advanced_options']),\n amUnlocked: !state.getIn(['accounts', me, 'locked']),\n focusDate: state.getIn(['compose', 'focusDate']),\n caretPosition: state.getIn(['compose', 'caretPosition']),\n isSubmitting: state.getIn(['compose', 'is_submitting']),\n isChangingUpload: state.getIn(['compose', 'is_changing_upload']),\n isUploading: state.getIn(['compose', 'is_uploading']),\n layout: state.getIn(['local_settings', 'layout']),\n media: state.getIn(['compose', 'media_attachments']),\n preselectDate: state.getIn(['compose', 'preselectDate']),\n privacy: state.getIn(['compose', 'privacy']),\n contentType: state.getIn(['compose', 'content_type']),\n progress: state.getIn(['compose', 'progress']),\n inReplyTo: inReplyTo ? state.getIn(['statuses', inReplyTo]) : null,\n replyAccount: inReplyTo ? state.getIn(['statuses', inReplyTo, 'account']) : null,\n replyContent: inReplyTo ? state.getIn(['statuses', inReplyTo, 'contentHtml']) : null,\n resetFileKey: state.getIn(['compose', 'resetFileKey']),\n sideArm: sideArmPrivacy,\n sensitive: state.getIn(['compose', 'sensitive']),\n showSearch: state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']),\n spoiler: spoilersAlwaysOn || state.getIn(['compose', 'spoiler']),\n spoilerText: state.getIn(['compose', 'spoiler_text']),\n suggestionToken: state.getIn(['compose', 'suggestion_token']),\n suggestions: state.getIn(['compose', 'suggestions']),\n text: state.getIn(['compose', 'text']),\n anyMedia: state.getIn(['compose', 'media_attachments']).size > 0,\n poll: state.getIn(['compose', 'poll']),\n spoilersAlwaysOn: spoilersAlwaysOn,\n mediaDescriptionConfirmation: state.getIn(['local_settings', 'confirm_missing_media_description']),\n preselectOnReply: state.getIn(['local_settings', 'preselect_on_reply']),\n };\n};\n\n// Dispatch mapping.\nconst mapDispatchToProps = (dispatch, { intl }) => ({\n onCancelReply() {\n dispatch(cancelReplyCompose());\n },\n onChangeAdvancedOption(option, value) {\n dispatch(changeComposeAdvancedOption(option, value));\n },\n onChangeContentType(value) {\n dispatch(changeComposeContentType(value));\n },\n onChangeDescription(id, description) {\n dispatch(changeUploadCompose(id, { description }));\n },\n onChangeSensitivity() {\n dispatch(changeComposeSensitivity());\n },\n onChangeSpoilerText(text) {\n dispatch(changeComposeSpoilerText(text));\n },\n onChangeSpoilerness() {\n dispatch(changeComposeSpoilerness());\n },\n onChangeText(text) {\n dispatch(changeCompose(text));\n },\n onChangeVisibility(value) {\n dispatch(changeComposeVisibility(value));\n },\n onTogglePoll() {\n dispatch((_, getState) => {\n if (getState().getIn(['compose', 'poll'])) {\n dispatch(removePoll());\n } else {\n dispatch(addPoll());\n }\n });\n },\n onClearSuggestions() {\n dispatch(clearComposeSuggestions());\n },\n onCloseModal() {\n dispatch(closeModal());\n },\n onFetchSuggestions(token) {\n dispatch(fetchComposeSuggestions(token));\n },\n onInsertEmoji(position, emoji) {\n dispatch(insertEmojiCompose(position, emoji));\n },\n onMount() {\n dispatch(mountCompose());\n },\n onOpenActionsModal(props) {\n dispatch(openModal('ACTIONS', props));\n },\n onOpenDoodleModal() {\n dispatch(openModal('DOODLE', { noEsc: true }));\n },\n onOpenFocalPointModal(id) {\n dispatch(openModal('FOCAL_POINT', { id }));\n },\n onSelectSuggestion(position, token, suggestion) {\n dispatch(selectComposeSuggestion(position, token, suggestion));\n },\n onMediaDescriptionConfirm(routerHistory) {\n dispatch(openModal('CONFIRM', {\n message: intl.formatMessage(messages.missingDescriptionMessage),\n confirm: intl.formatMessage(messages.missingDescriptionConfirm),\n onConfirm: () => dispatch(submitCompose(routerHistory)),\n onDoNotAsk: () => dispatch(changeLocalSetting(['confirm_missing_media_description'], false)),\n }));\n },\n onSubmit(routerHistory) {\n dispatch(submitCompose(routerHistory));\n },\n onUndoUpload(id) {\n dispatch(undoUploadCompose(id));\n },\n onUnmount() {\n dispatch(unmountCompose());\n },\n onUpload(files) {\n dispatch(uploadCompose(files));\n },\n});\n\n// Handlers.\nconst handlers = {\n\n // Changes the text value of the spoiler.\n handleChangeSpoiler ({ target: { value } }) {\n const { onChangeSpoilerText } = this.props;\n if (onChangeSpoilerText) {\n onChangeSpoilerText(value);\n }\n },\n\n // Inserts an emoji at the caret.\n handleEmoji (data) {\n const { textarea: { selectionStart } } = this;\n const { onInsertEmoji } = this.props;\n if (onInsertEmoji) {\n onInsertEmoji(selectionStart, data);\n }\n },\n\n // Handles the secondary submit button.\n handleSecondarySubmit () {\n const { handleSubmit } = this.handlers;\n const {\n onChangeVisibility,\n sideArm,\n } = this.props;\n if (sideArm !== 'none' && onChangeVisibility) {\n onChangeVisibility(sideArm);\n }\n handleSubmit();\n },\n\n // Selects a suggestion from the autofill.\n handleSelect (tokenStart, token, value) {\n const { onSelectSuggestion } = this.props;\n if (onSelectSuggestion) {\n onSelectSuggestion(tokenStart, token, value);\n }\n },\n\n // Submits the status.\n handleSubmit () {\n const { textarea: { value }, uploadForm } = this;\n const {\n onChangeText,\n onSubmit,\n isSubmitting,\n isChangingUpload,\n isUploading,\n media,\n anyMedia,\n text,\n mediaDescriptionConfirmation,\n onMediaDescriptionConfirm,\n } = this.props;\n\n // If something changes inside the textarea, then we update the\n // state before submitting.\n if (onChangeText && text !== value) {\n onChangeText(value);\n }\n\n // Submit disabled:\n if (isSubmitting || isUploading || isChangingUpload || (!text.trim().length && !anyMedia)) {\n return;\n }\n\n // Submit unless there are media with missing descriptions\n if (mediaDescriptionConfirmation && onMediaDescriptionConfirm && media && media.some(item => !item.get('description'))) {\n const firstWithoutDescription = media.findIndex(item => !item.get('description'));\n if (uploadForm) {\n const inputs = uploadForm.querySelectorAll('.composer--upload_form--item input');\n if (inputs.length == media.size && firstWithoutDescription !== -1) {\n inputs[firstWithoutDescription].focus();\n }\n }\n onMediaDescriptionConfirm(this.context.router ? this.context.router.history : null);\n } else if (onSubmit) {\n onSubmit(this.context.router ? this.context.router.history : null);\n }\n },\n\n // Sets a reference to the upload form.\n handleRefUploadForm (uploadFormComponent) {\n this.uploadForm = uploadFormComponent;\n },\n\n // Sets a reference to the textarea.\n handleRefTextarea (textareaComponent) {\n if (textareaComponent) {\n this.textarea = textareaComponent.textarea;\n }\n },\n\n // Sets a reference to the CW field.\n handleRefSpoilerText (spoilerComponent) {\n if (spoilerComponent) {\n this.spoilerText = spoilerComponent.spoilerText;\n }\n }\n};\n\n// The component.\nclass Composer extends React.Component {\n\n // Constructor.\n constructor (props) {\n super(props);\n assignHandlers(this, handlers);\n\n // Instance variables.\n this.textarea = null;\n this.spoilerText = null;\n }\n\n // Tells our state the composer has been mounted.\n componentDidMount () {\n const { onMount } = this.props;\n if (onMount) {\n onMount();\n }\n }\n\n // Tells our state the composer has been unmounted.\n componentWillUnmount () {\n const { onUnmount } = this.props;\n if (onUnmount) {\n onUnmount();\n }\n }\n\n // This statement does several things:\n // - If we're beginning a reply, and,\n // - Replying to zero or one users, places the cursor at the end\n // of the textbox.\n // - Replying to more than one user, selects any usernames past\n // the first; this provides a convenient shortcut to drop\n // everyone else from the conversation.\n componentDidUpdate (prevProps) {\n const {\n textarea,\n spoilerText,\n } = this;\n const {\n focusDate,\n caretPosition,\n isSubmitting,\n preselectDate,\n text,\n preselectOnReply,\n } = this.props;\n let selectionEnd, selectionStart;\n\n // Caret/selection handling.\n if (focusDate !== prevProps.focusDate) {\n switch (true) {\n case preselectDate !== prevProps.preselectDate && preselectOnReply:\n selectionStart = text.search(/\\s/) + 1;\n selectionEnd = text.length;\n break;\n case !isNaN(caretPosition) && caretPosition !== null:\n selectionStart = selectionEnd = caretPosition;\n break;\n default:\n selectionStart = selectionEnd = text.length;\n }\n if (textarea) {\n textarea.setSelectionRange(selectionStart, selectionEnd);\n textarea.focus();\n textarea.scrollIntoView();\n }\n\n // Refocuses the textarea after submitting.\n } else if (textarea && prevProps.isSubmitting && !isSubmitting) {\n textarea.focus();\n } else if (this.props.spoiler !== prevProps.spoiler) {\n if (this.props.spoiler) {\n if (spoilerText) {\n spoilerText.focus();\n }\n } else {\n if (textarea) {\n textarea.focus();\n }\n }\n }\n }\n\n render () {\n const {\n handleChangeSpoiler,\n handleEmoji,\n handleSecondarySubmit,\n handleSelect,\n handleSubmit,\n handleRefUploadForm,\n handleRefTextarea,\n handleRefSpoilerText,\n } = this.handlers;\n const {\n acceptContentTypes,\n advancedOptions,\n amUnlocked,\n anyMedia,\n contentType,\n intl,\n isSubmitting,\n isChangingUpload,\n isUploading,\n layout,\n media,\n poll,\n onCancelReply,\n onChangeAdvancedOption,\n onChangeContentType,\n onChangeDescription,\n onChangeSensitivity,\n onChangeSpoilerness,\n onChangeText,\n onChangeVisibility,\n onTogglePoll,\n onClearSuggestions,\n onCloseModal,\n onFetchSuggestions,\n onOpenActionsModal,\n onOpenDoodleModal,\n onOpenFocalPointModal,\n onUndoUpload,\n onUpload,\n privacy,\n progress,\n inReplyTo,\n resetFileKey,\n sensitive,\n showSearch,\n sideArm,\n spoiler,\n spoilerText,\n suggestions,\n text,\n spoilersAlwaysOn,\n } = this.props;\n\n let disabledButton = isSubmitting || isUploading || isChangingUpload || (!text.trim().length && !anyMedia);\n\n return (\n \n {privacy === 'direct' ?
: null}\n {privacy === 'private' && amUnlocked ?
: null}\n {privacy !== 'public' && APPROX_HASHTAG_RE.test(text) ?
: null}\n {inReplyTo && (\n
\n )}\n
\n
\n
\n {isUploading || media && media.size ? (\n \n ) : null}\n {!!poll && (\n \n )}\n
\n
item.get('type') === 'video'\n ) : true)}\n hasMedia={media && !!media.size}\n allowPoll={!(media && !!media.size)}\n hasPoll={!!poll}\n intl={intl}\n onChangeAdvancedOption={onChangeAdvancedOption}\n onChangeContentType={onChangeContentType}\n onChangeSensitivity={onChangeSensitivity}\n onChangeVisibility={onChangeVisibility}\n onTogglePoll={onTogglePoll}\n onDoodleOpen={onOpenDoodleModal}\n onModalClose={onCloseModal}\n onModalOpen={onOpenActionsModal}\n onToggleSpoiler={spoilersAlwaysOn ? null : onChangeSpoilerness}\n onUpload={onUpload}\n privacy={privacy}\n resetFileKey={resetFileKey}\n sensitive={sensitive || (spoilersAlwaysOn && spoilerText && spoilerText.length > 0)}\n spoiler={spoilersAlwaysOn ? (spoilerText && spoilerText.length > 0) : spoiler}\n />\n \n \n );\n }\n\n}\n\n// Props.\nComposer.propTypes = {\n intl: PropTypes.object.isRequired,\n\n // State props.\n acceptContentTypes: PropTypes.string,\n advancedOptions: ImmutablePropTypes.map,\n amUnlocked: PropTypes.bool,\n focusDate: PropTypes.instanceOf(Date),\n caretPosition: PropTypes.number,\n isSubmitting: PropTypes.bool,\n isChangingUpload: PropTypes.bool,\n isUploading: PropTypes.bool,\n layout: PropTypes.string,\n media: ImmutablePropTypes.list,\n preselectDate: PropTypes.instanceOf(Date),\n privacy: PropTypes.string,\n contentType: PropTypes.string,\n progress: PropTypes.number,\n inReplyTo: ImmutablePropTypes.map,\n resetFileKey: PropTypes.number,\n sideArm: PropTypes.string,\n sensitive: PropTypes.bool,\n showSearch: PropTypes.bool,\n spoiler: PropTypes.bool,\n spoilerText: PropTypes.string,\n suggestionToken: PropTypes.string,\n suggestions: ImmutablePropTypes.list,\n text: PropTypes.string,\n anyMedia: PropTypes.bool,\n spoilersAlwaysOn: PropTypes.bool,\n mediaDescriptionConfirmation: PropTypes.bool,\n preselectOnReply: PropTypes.bool,\n\n // Dispatch props.\n onCancelReply: PropTypes.func,\n onChangeAdvancedOption: PropTypes.func,\n onChangeContentType: PropTypes.func,\n onChangeDescription: PropTypes.func,\n onChangeSensitivity: PropTypes.func,\n onChangeSpoilerText: PropTypes.func,\n onChangeSpoilerness: PropTypes.func,\n onChangeText: PropTypes.func,\n onChangeVisibility: PropTypes.func,\n onClearSuggestions: PropTypes.func,\n onCloseModal: PropTypes.func,\n onFetchSuggestions: PropTypes.func,\n onInsertEmoji: PropTypes.func,\n onMount: PropTypes.func,\n onOpenActionsModal: PropTypes.func,\n onOpenDoodleModal: PropTypes.func,\n onSelectSuggestion: PropTypes.func,\n onSubmit: PropTypes.func,\n onUndoUpload: PropTypes.func,\n onUnmount: PropTypes.func,\n onUpload: PropTypes.func,\n onMediaDescriptionConfirm: PropTypes.func,\n};\n\nComposer.contextTypes = {\n router: PropTypes.object,\n};\n\n// Connecting and export.\nexport { Composer as WrappedComponent };\nexport default wrap(Composer, mapStateToProps, mapDispatchToProps, true);\n","/**\n * Notification overlay\n */\n\n\n// Package imports.\nimport React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { defineMessages, injectIntl } from 'react-intl';\n\nconst messages = defineMessages({\n markForDeletion: { id: 'notification.markForDeletion', defaultMessage: 'Mark for deletion' },\n});\n\n@injectIntl\nexport default class NotificationOverlay extends ImmutablePureComponent {\n\n static propTypes = {\n notification : ImmutablePropTypes.map.isRequired,\n onMarkForDelete : PropTypes.func.isRequired,\n show : PropTypes.bool.isRequired,\n intl : PropTypes.object.isRequired,\n };\n\n onToggleMark = () => {\n const mark = !this.props.notification.get('markedForDelete');\n const id = this.props.notification.get('id');\n this.props.onMarkForDelete(id, mark);\n }\n\n render () {\n const { notification, show, intl } = this.props;\n\n const active = notification.get('markedForDelete');\n const label = intl.formatMessage(messages.markForDeletion);\n\n return show ? (\n \n
\n
\n {active ? ( ) : ''}\n
\n
\n
\n ) : null;\n }\n\n}\n","// Package imports.\nimport { connect } from 'react-redux';\n\n// Our imports.\nimport NotificationOverlay from '../components/overlay';\nimport { markNotificationForDelete } from 'flavours/glitch/actions/notifications';\n\nconst mapDispatchToProps = dispatch => ({\n onMarkForDelete(id, yes) {\n dispatch(markNotificationForDelete(id, yes));\n },\n});\n\nconst mapStateToProps = state => ({\n show: state.getIn(['notifications', 'cleaningMode']),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(NotificationOverlay);\n","import { connect } from 'react-redux';\nimport { changeSetting } from 'flavours/glitch/actions/settings';\nimport { createSelector } from 'reselect';\nimport { Map as ImmutableMap } from 'immutable';\nimport { useEmoji } from 'flavours/glitch/actions/emojis';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport { EmojiPicker as EmojiPickerAsync } from 'flavours/glitch/util/async-components';\nimport Overlay from 'react-overlays/lib/Overlay';\nimport classNames from 'classnames';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport detectPassiveEvents from 'detect-passive-events';\nimport { buildCustomEmojis } from 'flavours/glitch/util/emoji';\n\nconst messages = defineMessages({\n emoji: { id: 'emoji_button.label', defaultMessage: 'Insert emoji' },\n emoji_search: { id: 'emoji_button.search', defaultMessage: 'Search...' },\n emoji_not_found: { id: 'emoji_button.not_found', defaultMessage: 'No emojos!! (╯°□°)╯︵ ┻━┻' },\n custom: { id: 'emoji_button.custom', defaultMessage: 'Custom' },\n recent: { id: 'emoji_button.recent', defaultMessage: 'Frequently used' },\n search_results: { id: 'emoji_button.search_results', defaultMessage: 'Search results' },\n people: { id: 'emoji_button.people', defaultMessage: 'People' },\n nature: { id: 'emoji_button.nature', defaultMessage: 'Nature' },\n food: { id: 'emoji_button.food', defaultMessage: 'Food & Drink' },\n activity: { id: 'emoji_button.activity', defaultMessage: 'Activity' },\n travel: { id: 'emoji_button.travel', defaultMessage: 'Travel & Places' },\n objects: { id: 'emoji_button.objects', defaultMessage: 'Objects' },\n symbols: { id: 'emoji_button.symbols', defaultMessage: 'Symbols' },\n flags: { id: 'emoji_button.flags', defaultMessage: 'Flags' },\n});\n\nconst perLine = 8;\nconst lines = 2;\n\nconst DEFAULTS = [\n '+1',\n 'grinning',\n 'kissing_heart',\n 'heart_eyes',\n 'laughing',\n 'stuck_out_tongue_winking_eye',\n 'sweat_smile',\n 'joy',\n 'yum',\n 'disappointed',\n 'thinking_face',\n 'weary',\n 'sob',\n 'sunglasses',\n 'heart',\n 'ok_hand',\n];\n\nconst getFrequentlyUsedEmojis = createSelector([\n state => state.getIn(['settings', 'frequentlyUsedEmojis'], ImmutableMap()),\n], emojiCounters => {\n let emojis = emojiCounters\n .keySeq()\n .sort((a, b) => emojiCounters.get(a) - emojiCounters.get(b))\n .reverse()\n .slice(0, perLine * lines)\n .toArray();\n\n if (emojis.length < DEFAULTS.length) {\n emojis = emojis.concat(DEFAULTS.slice(0, DEFAULTS.length - emojis.length));\n }\n\n return emojis;\n});\n\nconst getCustomEmojis = createSelector([\n state => state.get('custom_emojis'),\n], emojis => emojis.filter(e => e.get('visible_in_picker')).sort((a, b) => {\n const aShort = a.get('shortcode').toLowerCase();\n const bShort = b.get('shortcode').toLowerCase();\n\n if (aShort < bShort) {\n return -1;\n } else if (aShort > bShort ) {\n return 1;\n } else {\n return 0;\n }\n}));\n\nconst mapStateToProps = state => ({\n custom_emojis: getCustomEmojis(state),\n skinTone: state.getIn(['settings', 'skinTone']),\n frequentlyUsedEmojis: getFrequentlyUsedEmojis(state),\n});\n\nconst mapDispatchToProps = (dispatch, { onPickEmoji }) => ({\n onSkinTone: skinTone => {\n dispatch(changeSetting(['skinTone'], skinTone));\n },\n\n onPickEmoji: emoji => {\n dispatch(useEmoji(emoji));\n\n if (onPickEmoji) {\n onPickEmoji(emoji);\n }\n },\n});\n\nconst assetHost = process.env.CDN_HOST || '';\nlet EmojiPicker, Emoji; // load asynchronously\n\nconst backgroundImageFn = () => `${assetHost}/emoji/sheet_10.png`;\nconst listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;\n\nconst categoriesSort = [\n 'recent',\n 'custom',\n 'people',\n 'nature',\n 'foods',\n 'activity',\n 'places',\n 'objects',\n 'symbols',\n 'flags',\n];\n\nclass ModifierPickerMenu extends React.PureComponent {\n\n static propTypes = {\n active: PropTypes.bool,\n onSelect: PropTypes.func.isRequired,\n onClose: PropTypes.func.isRequired,\n };\n\n handleClick = e => {\n this.props.onSelect(e.currentTarget.getAttribute('data-index') * 1);\n }\n\n componentWillReceiveProps (nextProps) {\n if (nextProps.active) {\n this.attachListeners();\n } else {\n this.removeListeners();\n }\n }\n\n componentWillUnmount () {\n this.removeListeners();\n }\n\n handleDocumentClick = e => {\n if (this.node && !this.node.contains(e.target)) {\n this.props.onClose();\n }\n }\n\n attachListeners () {\n document.addEventListener('click', this.handleDocumentClick, false);\n document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);\n }\n\n removeListeners () {\n document.removeEventListener('click', this.handleDocumentClick, false);\n document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions);\n }\n\n setRef = c => {\n this.node = c;\n }\n\n render () {\n const { active } = this.props;\n\n return (\n \n \n \n \n \n \n \n
\n );\n }\n\n}\n\nclass ModifierPicker extends React.PureComponent {\n\n static propTypes = {\n active: PropTypes.bool,\n modifier: PropTypes.number,\n onChange: PropTypes.func,\n onClose: PropTypes.func,\n onOpen: PropTypes.func,\n };\n\n handleClick = () => {\n if (this.props.active) {\n this.props.onClose();\n } else {\n this.props.onOpen();\n }\n }\n\n handleSelect = modifier => {\n this.props.onChange(modifier);\n this.props.onClose();\n }\n\n render () {\n const { active, modifier } = this.props;\n\n return (\n \n \n \n
\n );\n }\n\n}\n\n@injectIntl\nclass EmojiPickerMenu extends React.PureComponent {\n\n static propTypes = {\n custom_emojis: ImmutablePropTypes.list,\n frequentlyUsedEmojis: PropTypes.arrayOf(PropTypes.string),\n loading: PropTypes.bool,\n onClose: PropTypes.func.isRequired,\n onPick: PropTypes.func.isRequired,\n style: PropTypes.object,\n placement: PropTypes.string,\n arrowOffsetLeft: PropTypes.string,\n arrowOffsetTop: PropTypes.string,\n intl: PropTypes.object.isRequired,\n skinTone: PropTypes.number.isRequired,\n onSkinTone: PropTypes.func.isRequired,\n };\n\n static defaultProps = {\n style: {},\n loading: true,\n frequentlyUsedEmojis: [],\n };\n\n state = {\n modifierOpen: false,\n placement: null,\n };\n\n handleDocumentClick = e => {\n if (this.node && !this.node.contains(e.target)) {\n this.props.onClose();\n }\n }\n\n componentDidMount () {\n document.addEventListener('click', this.handleDocumentClick, false);\n document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);\n }\n\n componentWillUnmount () {\n document.removeEventListener('click', this.handleDocumentClick, false);\n document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions);\n }\n\n setRef = c => {\n this.node = c;\n }\n\n getI18n = () => {\n const { intl } = this.props;\n\n return {\n search: intl.formatMessage(messages.emoji_search),\n notfound: intl.formatMessage(messages.emoji_not_found),\n categories: {\n search: intl.formatMessage(messages.search_results),\n recent: intl.formatMessage(messages.recent),\n people: intl.formatMessage(messages.people),\n nature: intl.formatMessage(messages.nature),\n foods: intl.formatMessage(messages.food),\n activity: intl.formatMessage(messages.activity),\n places: intl.formatMessage(messages.travel),\n objects: intl.formatMessage(messages.objects),\n symbols: intl.formatMessage(messages.symbols),\n flags: intl.formatMessage(messages.flags),\n custom: intl.formatMessage(messages.custom),\n },\n };\n }\n\n handleClick = emoji => {\n if (!emoji.native) {\n emoji.native = emoji.colons;\n }\n\n this.props.onClose();\n this.props.onPick(emoji);\n }\n\n handleModifierOpen = () => {\n this.setState({ modifierOpen: true });\n }\n\n handleModifierClose = () => {\n this.setState({ modifierOpen: false });\n }\n\n handleModifierChange = modifier => {\n this.props.onSkinTone(modifier);\n }\n\n render () {\n const { loading, style, intl, custom_emojis, skinTone, frequentlyUsedEmojis } = this.props;\n\n if (loading) {\n return
;\n }\n\n const title = intl.formatMessage(messages.emoji);\n const { modifierOpen } = this.state;\n\n return (\n \n \n\n \n
\n );\n }\n\n}\n\n@connect(mapStateToProps, mapDispatchToProps)\n@injectIntl\nexport default class EmojiPickerDropdown extends React.PureComponent {\n\n static propTypes = {\n custom_emojis: ImmutablePropTypes.list,\n frequentlyUsedEmojis: PropTypes.arrayOf(PropTypes.string),\n intl: PropTypes.object.isRequired,\n onPickEmoji: PropTypes.func.isRequired,\n onSkinTone: PropTypes.func.isRequired,\n skinTone: PropTypes.number.isRequired,\n };\n\n state = {\n active: false,\n loading: false,\n };\n\n setRef = (c) => {\n this.dropdown = c;\n }\n\n onShowDropdown = ({ target }) => {\n this.setState({ active: true });\n\n if (!EmojiPicker) {\n this.setState({ loading: true });\n\n EmojiPickerAsync().then(EmojiMart => {\n EmojiPicker = EmojiMart.Picker;\n Emoji = EmojiMart.Emoji;\n\n this.setState({ loading: false });\n }).catch(() => {\n this.setState({ loading: false });\n });\n }\n\n const { top } = target.getBoundingClientRect();\n this.setState({ placement: top * 2 < innerHeight ? 'bottom' : 'top' });\n }\n\n onHideDropdown = () => {\n this.setState({ active: false });\n }\n\n onToggle = (e) => {\n if (!this.state.loading && (!e.key || e.key === 'Enter')) {\n if (this.state.active) {\n this.onHideDropdown();\n } else {\n this.onShowDropdown(e);\n }\n }\n }\n\n handleKeyDown = e => {\n if (e.key === 'Escape') {\n this.onHideDropdown();\n }\n }\n\n setTargetRef = c => {\n this.target = c;\n }\n\n findTarget = () => {\n return this.target;\n }\n\n render () {\n const { intl, onPickEmoji, onSkinTone, skinTone, frequentlyUsedEmojis } = this.props;\n const title = intl.formatMessage(messages.emoji);\n const { active, loading, placement } = this.state;\n\n return (\n \n
\n
\n
\n\n
\n \n \n
\n );\n }\n\n}\n","// Package imports.\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\n// Components.\nimport AccountContainer from 'flavours/glitch/containers/account_container';\n\n// Utils.\nimport { unicodeMapping } from 'flavours/glitch/util/emoji';\nimport { assignHandlers } from 'flavours/glitch/util/react_helpers';\n\n// Gets our asset host from the environment, if available.\nconst assetHost = process.env.CDN_HOST || '';\n\n// Handlers.\nconst handlers = {\n\n // Handles a click on a suggestion.\n handleClick (e) {\n const {\n index,\n onClick,\n } = this.props;\n if (onClick) {\n e.preventDefault();\n e.stopPropagation(); // Prevents following account links\n onClick(index);\n }\n },\n\n // This prevents the focus from changing, which would mess with\n // our suggestion code.\n handleMouseDown (e) {\n e.preventDefault();\n },\n};\n\n// The component.\nexport default class ComposerTextareaSuggestionsItem extends React.Component {\n\n // Constructor.\n constructor (props) {\n super(props);\n assignHandlers(this, handlers);\n }\n\n // Rendering.\n render () {\n const {\n handleMouseDown,\n handleClick,\n } = this.handlers;\n const {\n selected,\n suggestion,\n } = this.props;\n const computedClass = classNames('composer--textarea--suggestions--item', { selected });\n\n // If the suggestion is an object, then we render an emoji.\n // Otherwise, we render a hashtag if it starts with #, or an account.\n let inner;\n if (typeof suggestion === 'object') {\n let url;\n if (suggestion.custom) {\n url = suggestion.imageUrl;\n } else {\n const mapping = unicodeMapping[suggestion.native] || unicodeMapping[suggestion.native.replace(/\\uFE0F$/, '')];\n if (mapping) {\n url = `${assetHost}/emoji/${mapping.filename}.svg`;\n }\n }\n if (url) {\n inner = (\n \n
\n {suggestion.colons}\n
\n );\n }\n } else if (suggestion[0] === '#') {\n inner = suggestion;\n } else {\n inner = (\n \n );\n }\n\n // The result.\n return (\n \n { inner }\n
\n );\n }\n\n}\n\n// Props.\nComposerTextareaSuggestionsItem.propTypes = {\n index: PropTypes.number,\n onClick: PropTypes.func,\n selected: PropTypes.bool,\n suggestion: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n};\n","// Package imports //\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { FormattedMessage } from 'react-intl';\n\nexport default class StatusPrepend extends React.PureComponent {\n\n static propTypes = {\n type: PropTypes.string.isRequired,\n account: ImmutablePropTypes.map.isRequired,\n parseClick: PropTypes.func.isRequired,\n notificationId: PropTypes.number,\n };\n\n handleClick = (e) => {\n const { account, parseClick } = this.props;\n parseClick(e, `/accounts/${account.get('id')}`);\n }\n\n Message = () => {\n const { type, account } = this.props;\n let link = (\n \n \n \n );\n switch (type) {\n case 'featured':\n return (\n \n );\n case 'reblogged_by':\n return (\n \n );\n case 'favourite':\n return (\n \n );\n case 'reblog':\n return (\n \n );\n case 'poll':\n return (\n \n );\n }\n return null;\n }\n\n render () {\n const { Message } = this;\n const { type } = this.props;\n\n return !type ? null : (\n \n );\n }\n\n}\n","// Package imports.\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\n\n// Mastodon imports.\nimport Avatar from './avatar';\nimport AvatarOverlay from './avatar_overlay';\nimport DisplayName from './display_name';\n\nexport default class StatusHeader extends React.PureComponent {\n\n static propTypes = {\n status: ImmutablePropTypes.map.isRequired,\n friend: ImmutablePropTypes.map,\n parseClick: PropTypes.func.isRequired,\n };\n\n // Handles clicks on account name/image\n handleAccountClick = (e) => {\n const { status, parseClick } = this.props;\n parseClick(e, `/accounts/${status.getIn(['account', 'id'])}`);\n }\n\n // Rendering.\n render () {\n const {\n status,\n friend,\n } = this.props;\n\n const account = status.get('account');\n\n return (\n \n );\n }\n\n}\n","// Package imports.\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { defineMessages, injectIntl } from 'react-intl';\n\n// Mastodon imports.\nimport IconButton from './icon_button';\nimport VisibilityIcon from './status_visibility_icon';\n\n// Messages for use with internationalization stuff.\nconst messages = defineMessages({\n collapse: { id: 'status.collapse', defaultMessage: 'Collapse' },\n uncollapse: { id: 'status.uncollapse', defaultMessage: 'Uncollapse' },\n});\n\n@injectIntl\nexport default class StatusIcons extends React.PureComponent {\n\n static propTypes = {\n status: ImmutablePropTypes.map.isRequired,\n mediaIcon: PropTypes.string,\n collapsible: PropTypes.bool,\n collapsed: PropTypes.bool,\n setCollapsed: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n // Handles clicks on collapsed button\n handleCollapsedClick = (e) => {\n const { collapsed, setCollapsed } = this.props;\n if (e.button === 0) {\n setCollapsed(!collapsed);\n e.preventDefault();\n }\n }\n\n // Rendering.\n render () {\n const {\n status,\n mediaIcon,\n collapsible,\n collapsed,\n intl,\n } = this.props;\n\n return (\n \n {status.get('in_reply_to_id', null) !== null ? (\n \n ) : null}\n {mediaIcon ? (\n \n ) : null}\n {(\n \n )}\n {collapsible ? (\n \n ) : null}\n
\n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport IconButton from './icon_button';\nimport DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { me, isStaff, deleteOthersNotice } from 'flavours/glitch/util/initial_state';\nimport RelativeTimestamp from './relative_timestamp';\nimport { accountAdminLink, statusAdminLink } from 'flavours/glitch/util/backend_links';\n\nconst messages = defineMessages({\n delete: { id: 'status.delete', defaultMessage: 'Delete' },\n redraft: { id: 'status.redraft', defaultMessage: 'Delete & re-draft' },\n direct: { id: 'status.direct', defaultMessage: 'Direct message @{name}' },\n mention: { id: 'status.mention', defaultMessage: 'Mention @{name}' },\n mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' },\n block: { id: 'account.block', defaultMessage: 'Block @{name}' },\n reply: { id: 'status.reply', defaultMessage: 'Reply' },\n share: { id: 'status.share', defaultMessage: 'Share' },\n more: { id: 'status.more', defaultMessage: 'More' },\n replyAll: { id: 'status.replyAll', defaultMessage: 'Reply to thread' },\n reblog: { id: 'status.reblog', defaultMessage: 'Boost' },\n reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost to original audience' },\n cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },\n favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },\n bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' },\n open: { id: 'status.open', defaultMessage: 'Expand this status' },\n report: { id: 'status.report', defaultMessage: 'Report @{name}' },\n muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' },\n unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' },\n pin: { id: 'status.pin', defaultMessage: 'Pin on profile' },\n unpin: { id: 'status.unpin', defaultMessage: 'Unpin from profile' },\n embed: { id: 'status.embed', defaultMessage: 'Embed' },\n admin_account: { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' },\n admin_status: { id: 'status.admin_status', defaultMessage: 'Open this status in the moderation interface' },\n copy: { id: 'status.copy', defaultMessage: 'Copy link to status' },\n});\n\nconst obfuscatedCount = count => {\n if (count < 0) {\n return 0;\n } else if (count <= 1) {\n return count;\n } else {\n return '1+';\n }\n};\n\n@injectIntl\nexport default class StatusActionBar extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n status: ImmutablePropTypes.map.isRequired,\n onReply: PropTypes.func,\n onFavourite: PropTypes.func,\n onReblog: PropTypes.func,\n onDelete: PropTypes.func,\n onDirect: PropTypes.func,\n onMention: PropTypes.func,\n onMute: PropTypes.func,\n onBlock: PropTypes.func,\n onReport: PropTypes.func,\n onEmbed: PropTypes.func,\n onMuteConversation: PropTypes.func,\n onPin: PropTypes.func,\n onBookmark: PropTypes.func,\n withDismiss: PropTypes.bool,\n showReplyCount: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n };\n\n // Avoid checking props that are functions (and whose equality will always\n // evaluate to false. See react-immutable-pure-component for usage.\n updateOnProps = [\n 'status',\n 'showReplyCount',\n 'withDismiss',\n ]\n\n handleReplyClick = () => {\n if (me) {\n this.props.onReply(this.props.status, this.context.router.history);\n } else {\n this._openInteractionDialog('reply');\n }\n }\n\n handleShareClick = () => {\n navigator.share({\n text: this.props.status.get('search_index'),\n url: this.props.status.get('url'),\n });\n }\n\n handleFavouriteClick = (e) => {\n if (me) {\n this.props.onFavourite(this.props.status, e);\n } else {\n this._openInteractionDialog('favourite');\n }\n }\n\n handleBookmarkClick = (e) => {\n this.props.onBookmark(this.props.status, e);\n }\n\n handleReblogClick = e => {\n if (me) {\n this.props.onReblog(this.props.status, e);\n } else {\n this._openInteractionDialog('reblog');\n }\n }\n\n _openInteractionDialog = type => {\n window.open(`/interact/${this.props.status.get('id')}?type=${type}`, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes');\n }\n\n handleDeleteClick = () => {\n this.props.onDelete(this.props.status, this.context.router.history);\n }\n\n handleRedraftClick = () => {\n this.props.onDelete(this.props.status, this.context.router.history, true);\n }\n\n handlePinClick = () => {\n this.props.onPin(this.props.status);\n }\n\n handleMentionClick = () => {\n this.props.onMention(this.props.status.get('account'), this.context.router.history);\n }\n\n handleDirectClick = () => {\n this.props.onDirect(this.props.status.get('account'), this.context.router.history);\n }\n\n handleMuteClick = () => {\n this.props.onMute(this.props.status.get('account'));\n }\n\n handleBlockClick = () => {\n this.props.onBlock(this.props.status);\n }\n\n handleOpen = () => {\n this.context.router.history.push(`/statuses/${this.props.status.get('id')}`);\n }\n\n handleEmbed = () => {\n this.props.onEmbed(this.props.status);\n }\n\n handleReport = () => {\n this.props.onReport(this.props.status);\n }\n\n handleConversationMuteClick = () => {\n this.props.onMuteConversation(this.props.status);\n }\n\n handleCopy = () => {\n const url = this.props.status.get('url');\n const textarea = document.createElement('textarea');\n\n textarea.textContent = url;\n textarea.style.position = 'fixed';\n\n document.body.appendChild(textarea);\n\n try {\n textarea.select();\n document.execCommand('copy');\n } catch (e) {\n\n } finally {\n document.body.removeChild(textarea);\n }\n }\n\n render () {\n const { status, intl, withDismiss, showReplyCount } = this.props;\n\n const mutingConversation = status.get('muted');\n const anonymousAccess = !me;\n const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));\n const reblogDisabled = status.get('visibility') === 'direct' || (status.get('visibility') === 'private' && me !== status.getIn(['account', 'id']));\n const reblogMessage = status.get('visibility') === 'private' ? messages.reblog_private : messages.reblog;\n\n let menu = [];\n let reblogIcon = 'retweet';\n let replyIcon;\n let replyTitle;\n\n menu.push({ text: intl.formatMessage(messages.open), action: this.handleOpen });\n\n if (publicStatus) {\n menu.push({ text: intl.formatMessage(messages.copy), action: this.handleCopy });\n menu.push({ text: intl.formatMessage(messages.embed), action: this.handleEmbed });\n }\n\n menu.push(null);\n\n if (status.getIn(['account', 'id']) === me || withDismiss) {\n menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });\n menu.push(null);\n }\n\n if (status.getIn(['account', 'id']) === me) {\n if (publicStatus) {\n menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });\n }\n\n menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });\n } else {\n menu.push({ text: intl.formatMessage(messages.mention, { name: status.getIn(['account', 'username']) }), action: this.handleMentionClick });\n menu.push({ text: intl.formatMessage(messages.direct, { name: status.getIn(['account', 'username']) }), action: this.handleDirectClick });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.mute, { name: status.getIn(['account', 'username']) }), action: this.handleMuteClick });\n menu.push({ text: intl.formatMessage(messages.block, { name: status.getIn(['account', 'username']) }), action: this.handleBlockClick });\n menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport });\n\n if (isStaff && (accountAdminLink || statusAdminLink)) {\n menu.push(null);\n if (accountAdminLink !== undefined) {\n menu.push({\n text: intl.formatMessage(messages.admin_account, { name: status.getIn(['account', 'username']) }),\n href: accountAdminLink(status.getIn(['account', 'id'])),\n });\n }\n if (statusAdminLink !== undefined) {\n menu.push({\n text: intl.formatMessage(messages.admin_status),\n href: statusAdminLink(status.getIn(['account', 'id']), status.get('id')),\n });\n }\n }\n if ( deleteOthersNotice ) {\n menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });\n }\n }\n\n if (status.get('in_reply_to_id', null) === null) {\n replyIcon = 'reply';\n replyTitle = intl.formatMessage(messages.reply);\n } else {\n replyIcon = 'reply-all';\n replyTitle = intl.formatMessage(messages.replyAll);\n }\n\n const shareButton = ('share' in navigator) && status.get('visibility') === 'public' && (\n \n );\n\n let replyButton = (\n \n );\n if (showReplyCount) {\n replyButton = (\n \n {replyButton}\n {obfuscatedCount(status.get('replies_count'))} \n
\n );\n }\n\n return (\n \n {replyButton}\n
\n
\n {shareButton}\n
\n\n
\n \n
\n\n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport StatusPrepend from './status_prepend';\nimport StatusHeader from './status_header';\nimport StatusIcons from './status_icons';\nimport StatusContent from './status_content';\nimport StatusActionBar from './status_action_bar';\nimport AttachmentList from './attachment_list';\nimport Card from '../features/status/components/card';\nimport { injectIntl, FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { MediaGallery, Video } from 'flavours/glitch/util/async-components';\nimport { HotKeys } from 'react-hotkeys';\nimport NotificationOverlayContainer from 'flavours/glitch/features/notifications/containers/overlay_container';\nimport classNames from 'classnames';\nimport { autoUnfoldCW } from 'flavours/glitch/util/content_warning';\nimport PollContainer from 'flavours/glitch/containers/poll_container';\n\n// We use the component (and not the container) since we do not want\n// to use the progress bar to show download progress\nimport Bundle from '../features/ui/components/bundle';\n\nexport const textForScreenReader = (intl, status, rebloggedByText = false, expanded = false) => {\n const displayName = status.getIn(['account', 'display_name']);\n\n const values = [\n displayName.length === 0 ? status.getIn(['account', 'acct']).split('@')[0] : displayName,\n status.get('spoiler_text') && !expanded ? status.get('spoiler_text') : status.get('search_index').slice(status.get('spoiler_text').length),\n intl.formatDate(status.get('created_at'), { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' }),\n status.getIn(['account', 'acct']),\n ];\n\n if (rebloggedByText) {\n values.push(rebloggedByText);\n }\n\n return values.join(', ');\n};\n\n@injectIntl\nexport default class Status extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n containerId: PropTypes.string,\n id: PropTypes.string,\n status: ImmutablePropTypes.map,\n account: ImmutablePropTypes.map,\n onReply: PropTypes.func,\n onFavourite: PropTypes.func,\n onReblog: PropTypes.func,\n onDelete: PropTypes.func,\n onDirect: PropTypes.func,\n onMention: PropTypes.func,\n onPin: PropTypes.func,\n onOpenMedia: PropTypes.func,\n onOpenVideo: PropTypes.func,\n onBlock: PropTypes.func,\n onEmbed: PropTypes.func,\n onHeightChange: PropTypes.func,\n muted: PropTypes.bool,\n collapse: PropTypes.bool,\n hidden: PropTypes.bool,\n prepend: PropTypes.string,\n withDismiss: PropTypes.bool,\n onMoveUp: PropTypes.func,\n onMoveDown: PropTypes.func,\n getScrollPosition: PropTypes.func,\n updateScrollBottom: PropTypes.func,\n expanded: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n cacheMediaWidth: PropTypes.func,\n cachedMediaWidth: PropTypes.number,\n };\n\n state = {\n isCollapsed: false,\n autoCollapsed: false,\n isExpanded: undefined,\n }\n\n // Avoid checking props that are functions (and whose equality will always\n // evaluate to false. See react-immutable-pure-component for usage.\n updateOnProps = [\n 'status',\n 'account',\n 'settings',\n 'prepend',\n 'boostModal',\n 'favouriteModal',\n 'muted',\n 'collapse',\n 'notification',\n 'hidden',\n 'expanded',\n ]\n\n updateOnStates = [\n 'isExpanded',\n 'isCollapsed',\n ]\n\n // If our settings have changed to disable collapsed statuses, then we\n // need to make sure that we uncollapse every one. We do that by watching\n // for changes to `settings.collapsed.enabled` in\n // `getderivedStateFromProps()`.\n\n // We also need to watch for changes on the `collapse` prop---if this\n // changes to anything other than `undefined`, then we need to collapse or\n // uncollapse our status accordingly.\n static getDerivedStateFromProps(nextProps, prevState) {\n let update = {};\n let updated = false;\n\n // Make sure the state mirrors props we track…\n if (nextProps.collapse !== prevState.collapseProp) {\n update.collapseProp = nextProps.collapse;\n updated = true;\n }\n if (nextProps.expanded !== prevState.expandedProp) {\n update.expandedProp = nextProps.expanded;\n updated = true;\n }\n\n // Update state based on new props\n if (!nextProps.settings.getIn(['collapsed', 'enabled'])) {\n if (prevState.isCollapsed) {\n update.isCollapsed = false;\n updated = true;\n }\n } else if (\n nextProps.collapse !== prevState.collapseProp &&\n nextProps.collapse !== undefined\n ) {\n update.isCollapsed = nextProps.collapse;\n if (nextProps.collapse) update.isExpanded = false;\n updated = true;\n }\n if (nextProps.expanded !== prevState.expandedProp &&\n nextProps.expanded !== undefined\n ) {\n update.isExpanded = nextProps.expanded;\n if (nextProps.expanded) update.isCollapsed = false;\n updated = true;\n }\n\n if (nextProps.expanded === undefined &&\n prevState.isExpanded === undefined &&\n update.isExpanded === undefined\n ) {\n const isExpanded = autoUnfoldCW(nextProps.settings, nextProps.status);\n if (isExpanded !== undefined) {\n update.isExpanded = isExpanded;\n updated = true;\n }\n }\n\n return updated ? update : null;\n }\n\n // When mounting, we just check to see if our status should be collapsed,\n // and collapse it if so. We don't need to worry about whether collapsing\n // is enabled here, because `setCollapsed()` already takes that into\n // account.\n\n // The cases where a status should be collapsed are:\n //\n // - The `collapse` prop has been set to `true`\n // - The user has decided in local settings to collapse all statuses.\n // - The user has decided to collapse all notifications ('muted'\n // statuses).\n // - The user has decided to collapse long statuses and the status is\n // over 400px (without media, or 650px with).\n // - The status is a reply and the user has decided to collapse all\n // replies.\n // - The status contains media and the user has decided to collapse all\n // statuses with media.\n // - The status is a reblog the user has decided to collapse all\n // statuses which are reblogs.\n componentDidMount () {\n const { node } = this;\n const {\n status,\n settings,\n collapse,\n muted,\n prepend,\n } = this.props;\n\n // Prevent a crash when node is undefined. Not completely sure why this\n // happens, might be because status === null.\n if (node === undefined) return;\n\n const autoCollapseSettings = settings.getIn(['collapsed', 'auto']);\n\n if (function () {\n switch (true) {\n case !!collapse:\n case !!autoCollapseSettings.get('all'):\n case autoCollapseSettings.get('notifications') && !!muted:\n case autoCollapseSettings.get('lengthy') && node.clientHeight > (\n status.get('media_attachments').size && !muted ? 650 : 400\n ):\n case autoCollapseSettings.get('reblogs') && prepend === 'reblogged_by':\n case autoCollapseSettings.get('replies') && status.get('in_reply_to_id', null) !== null:\n case autoCollapseSettings.get('media') && !(status.get('spoiler_text').length) && !!status.get('media_attachments').size:\n return true;\n default:\n return false;\n }\n }()) {\n this.setCollapsed(true);\n // Hack to fix timeline jumps on second rendering when auto-collapsing\n this.setState({ autoCollapsed: true });\n }\n\n this.didShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card') && this.props.settings.get('inline_preview_cards');\n }\n\n getSnapshotBeforeUpdate (prevProps, prevState) {\n if (this.props.getScrollPosition) {\n return this.props.getScrollPosition();\n } else {\n return null;\n }\n }\n\n // Hack to fix timeline jumps on second rendering when auto-collapsing\n componentDidUpdate (prevProps, prevState, snapshot) {\n const doShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card') && this.props.settings.get('inline_preview_cards');\n if (this.state.autoCollapsed || (doShowCard && !this.didShowCard)) {\n if (doShowCard) this.didShowCard = true;\n if (this.state.autoCollapsed) this.setState({ autoCollapsed: false });\n if (snapshot !== null && this.props.updateScrollBottom) {\n if (this.node.offsetTop < snapshot.top) {\n this.props.updateScrollBottom(snapshot.height - snapshot.top);\n }\n }\n }\n }\n\n componentWillUnmount() {\n if (this.node && this.props.getScrollPosition) {\n const position = this.props.getScrollPosition();\n if (position !== null && this.node.offsetTop < position.top) {\n requestAnimationFrame(() => { this.props.updateScrollBottom(position.height - position.top); });\n }\n }\n }\n\n // `setCollapsed()` sets the value of `isCollapsed` in our state, that is,\n // whether the toot is collapsed or not.\n\n // `setCollapsed()` automatically checks for us whether toot collapsing\n // is enabled, so we don't have to.\n setCollapsed = (value) => {\n if (this.props.settings.getIn(['collapsed', 'enabled'])) {\n this.setState({ isCollapsed: value });\n if (value) {\n this.setExpansion(false);\n }\n } else {\n this.setState({ isCollapsed: false });\n }\n }\n\n setExpansion = (value) => {\n this.setState({ isExpanded: value });\n if (value) {\n this.setCollapsed(false);\n }\n }\n\n // `parseClick()` takes a click event and responds appropriately.\n // If our status is collapsed, then clicking on it should uncollapse it.\n // If `Shift` is held, then clicking on it should collapse it.\n // Otherwise, we open the url handed to us in `destination`, if\n // applicable.\n parseClick = (e, destination) => {\n const { router } = this.context;\n const { status } = this.props;\n const { isCollapsed } = this.state;\n if (!router) return;\n if (destination === undefined) {\n destination = `/statuses/${\n status.getIn(['reblog', 'id'], status.get('id'))\n }`;\n }\n if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey)) {\n if (isCollapsed) this.setCollapsed(false);\n else if (e.shiftKey) {\n this.setCollapsed(true);\n document.getSelection().removeAllRanges();\n } else router.history.push(destination);\n e.preventDefault();\n }\n }\n\n handleAccountClick = (e) => {\n if (this.context.router && e.button === 0) {\n const id = e.currentTarget.getAttribute('data-id');\n e.preventDefault();\n this.context.router.history.push(`/accounts/${id}`);\n }\n }\n\n handleExpandedToggle = () => {\n if (this.props.status.get('spoiler_text')) {\n this.setExpansion(!this.state.isExpanded);\n }\n };\n\n handleOpenVideo = (media, startTime) => {\n this.props.onOpenVideo(media, startTime);\n }\n\n handleHotkeyReply = e => {\n e.preventDefault();\n this.props.onReply(this.props.status, this.context.router.history);\n }\n\n handleHotkeyFavourite = (e) => {\n this.props.onFavourite(this.props.status, e);\n }\n\n handleHotkeyBoost = e => {\n this.props.onReblog(this.props.status, e);\n }\n\n handleHotkeyMention = e => {\n e.preventDefault();\n this.props.onMention(this.props.status.get('account'), this.context.router.history);\n }\n\n handleHotkeyOpen = () => {\n this.context.router.history.push(`/statuses/${this.props.status.get('id')}`);\n }\n\n handleHotkeyOpenProfile = () => {\n this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`);\n }\n\n handleHotkeyMoveUp = e => {\n this.props.onMoveUp(this.props.containerId || this.props.id, e.target.getAttribute('data-featured'));\n }\n\n handleHotkeyMoveDown = e => {\n this.props.onMoveDown(this.props.containerId || this.props.id, e.target.getAttribute('data-featured'));\n }\n\n handleRef = c => {\n this.node = c;\n }\n\n renderLoadingMediaGallery () {\n return
;\n }\n\n renderLoadingVideoPlayer () {\n return
;\n }\n\n render () {\n const {\n handleRef,\n parseClick,\n setExpansion,\n setCollapsed,\n } = this;\n const { router } = this.context;\n const {\n intl,\n status,\n account,\n settings,\n collapsed,\n muted,\n prepend,\n intersectionObserverWrapper,\n onOpenVideo,\n onOpenMedia,\n notification,\n hidden,\n featured,\n ...other\n } = this.props;\n const { isExpanded, isCollapsed } = this.state;\n let background = null;\n let attachments = null;\n let media = null;\n let mediaIcon = null;\n\n if (status === null) {\n return null;\n }\n\n if (hidden) {\n return (\n \n {status.getIn(['account', 'display_name']) || status.getIn(['account', 'username'])}\n {' '}\n {status.get('content')}\n
\n );\n }\n\n if (status.get('filtered') || status.getIn(['reblog', 'filtered'])) {\n const minHandlers = this.props.muted ? {} : {\n moveUp: this.handleHotkeyMoveUp,\n moveDown: this.handleHotkeyMoveDown,\n };\n\n return (\n \n \n \n
\n \n );\n }\n\n // If user backgrounds for collapsed statuses are enabled, then we\n // initialize our background accordingly. This will only be rendered if\n // the status is collapsed.\n if (settings.getIn(['collapsed', 'backgrounds', 'user_backgrounds'])) {\n background = status.getIn(['account', 'header']);\n }\n\n // This handles our media attachments.\n // If a media file is of unknwon type or if the status is muted\n // (notification), we show a list of links instead of embedded media.\n\n // After we have generated our appropriate media element and stored it in\n // `media`, we snatch the thumbnail to use as our `background` if media\n // backgrounds for collapsed statuses are enabled.\n attachments = status.get('media_attachments');\n if (status.get('poll')) {\n media = ;\n mediaIcon = 'tasks';\n } else if (attachments.size > 0) {\n if (muted || attachments.some(item => item.get('type') === 'unknown')) {\n media = (\n \n );\n } else if (attachments.getIn([0, 'type']) === 'video') { // Media type is 'video'\n const video = status.getIn(['media_attachments', 0]);\n\n media = (\n \n {Component => ( )}\n \n );\n mediaIcon = 'video-camera';\n } else { // Media type is 'image' or 'gifv'\n media = (\n \n {Component => (\n \n )}\n \n );\n mediaIcon = 'picture-o';\n }\n\n if (!status.get('sensitive') && !(status.get('spoiler_text').length > 0) && settings.getIn(['collapsed', 'backgrounds', 'preview_images'])) {\n background = attachments.getIn([0, 'preview_url']);\n }\n } else if (status.get('card') && settings.get('inline_preview_cards')) {\n media = (\n \n );\n mediaIcon = 'link';\n }\n\n // Here we prepare extra data-* attributes for CSS selectors.\n // Users can use those for theming, hiding avatars etc via UserStyle\n const selectorAttribs = {\n 'data-status-by': `@${status.getIn(['account', 'acct'])}`,\n };\n\n if (prepend && account) {\n const notifKind = {\n favourite: 'favourited',\n reblog: 'boosted',\n reblogged_by: 'boosted',\n }[prepend];\n\n selectorAttribs[`data-${notifKind}-by`] = `@${account.get('acct')}`;\n }\n\n let rebloggedByText;\n\n if (prepend === 'reblog') {\n rebloggedByText = intl.formatMessage({ id: 'status.reblogged_by', defaultMessage: '{name} boosted' }, { name: account.get('acct') });\n }\n\n const handlers = {\n reply: this.handleHotkeyReply,\n favourite: this.handleHotkeyFavourite,\n boost: this.handleHotkeyBoost,\n mention: this.handleHotkeyMention,\n open: this.handleHotkeyOpen,\n openProfile: this.handleHotkeyOpenProfile,\n moveUp: this.handleHotkeyMoveUp,\n moveDown: this.handleHotkeyMoveDown,\n toggleSpoiler: this.handleExpandedToggle,\n };\n\n const computedClass = classNames('status', `status-${status.get('visibility')}`, {\n collapsed: isCollapsed,\n 'has-background': isCollapsed && background,\n 'status__wrapper-reply': !!status.get('in_reply_to_id'),\n muted,\n }, 'focusable');\n\n return (\n \n \n \n \n {prepend && account ? (\n \n ) : null}\n {!muted || !isCollapsed ? (\n \n ) : null}\n \n \n \n \n {!isCollapsed || !(muted || !settings.getIn(['collapsed', 'show_action_bar'])) ? (\n \n ) : null}\n {notification ? (\n \n ) : null}\n
\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { autoPlayGif } from '../initial_state';\n\nexport default class AvatarComposite extends React.PureComponent {\n\n static propTypes = {\n accounts: ImmutablePropTypes.list.isRequired,\n animate: PropTypes.bool,\n size: PropTypes.number.isRequired,\n };\n\n static defaultProps = {\n animate: autoPlayGif,\n };\n\n renderItem (account, size, index) {\n const { animate } = this.props;\n\n let width = 50;\n let height = 100;\n let top = 'auto';\n let left = 'auto';\n let bottom = 'auto';\n let right = 'auto';\n\n if (size === 1) {\n width = 100;\n }\n\n if (size === 4 || (size === 3 && index > 0)) {\n height = 50;\n }\n\n if (size === 2) {\n if (index === 0) {\n right = '2px';\n } else {\n left = '2px';\n }\n } else if (size === 3) {\n if (index === 0) {\n right = '2px';\n } else if (index > 0) {\n left = '2px';\n }\n\n if (index === 1) {\n bottom = '2px';\n } else if (index > 1) {\n top = '2px';\n }\n } else if (size === 4) {\n if (index === 0 || index === 2) {\n right = '2px';\n }\n\n if (index === 1 || index === 3) {\n left = '2px';\n }\n\n if (index < 2) {\n bottom = '2px';\n } else {\n top = '2px';\n }\n }\n\n const style = {\n left: left,\n top: top,\n right: right,\n bottom: bottom,\n width: `${width}%`,\n height: `${height}%`,\n backgroundSize: 'cover',\n backgroundImage: `url(${account.get(animate ? 'avatar' : 'avatar_static')})`,\n };\n\n return (\n
\n );\n }\n\n render() {\n const { accounts, size } = this.props;\n\n return (\n \n {accounts.take(4).map((account, i) => this.renderItem(account, accounts.size, i))}\n
\n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport IconButton from './icon_button';\nimport DropdownMenuContainer from '../containers/dropdown_menu_container';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { me, deleteOthersNotice, isStaff } from '../initial_state';\n\nconst messages = defineMessages({\n delete: { id: 'status.delete', defaultMessage: 'Delete' },\n redraft: { id: 'status.redraft', defaultMessage: 'Delete & re-draft' },\n direct: { id: 'status.direct', defaultMessage: 'Direct message @{name}' },\n mention: { id: 'status.mention', defaultMessage: 'Mention @{name}' },\n mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' },\n block: { id: 'account.block', defaultMessage: 'Block @{name}' },\n reply: { id: 'status.reply', defaultMessage: 'Reply' },\n share: { id: 'status.share', defaultMessage: 'Share' },\n more: { id: 'status.more', defaultMessage: 'More' },\n replyAll: { id: 'status.replyAll', defaultMessage: 'Reply to thread' },\n reblog: { id: 'status.reblog', defaultMessage: 'Boost' },\n reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost to original audience' },\n cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },\n cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },\n favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },\n open: { id: 'status.open', defaultMessage: 'Expand this status' },\n report: { id: 'status.report', defaultMessage: 'Report @{name}' },\n muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' },\n unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' },\n pin: { id: 'status.pin', defaultMessage: 'Pin on profile' },\n unpin: { id: 'status.unpin', defaultMessage: 'Unpin from profile' },\n embed: { id: 'status.embed', defaultMessage: 'Embed' },\n admin_account: { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' },\n admin_status: { id: 'status.admin_status', defaultMessage: 'Open this status in the moderation interface' },\n copy: { id: 'status.copy', defaultMessage: 'Copy link to status' },\n});\n\nconst obfuscatedCount = count => {\n if (count < 0) {\n return 0;\n } else if (count <= 1) {\n return count;\n } else {\n return '1+';\n }\n};\n\nexport default @injectIntl\nclass StatusActionBar extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n status: ImmutablePropTypes.map.isRequired,\n onReply: PropTypes.func,\n onFavourite: PropTypes.func,\n onReblog: PropTypes.func,\n onDelete: PropTypes.func,\n onDirect: PropTypes.func,\n onMention: PropTypes.func,\n onMute: PropTypes.func,\n onBlock: PropTypes.func,\n onReport: PropTypes.func,\n onEmbed: PropTypes.func,\n onMuteConversation: PropTypes.func,\n onPin: PropTypes.func,\n withDismiss: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n };\n\n // Avoid checking props that are functions (and whose equality will always\n // evaluate to false. See react-immutable-pure-component for usage.\n updateOnProps = [\n 'status',\n 'withDismiss',\n ]\n\n handleReplyClick = () => {\n if (me) {\n this.props.onReply(this.props.status, this.context.router.history);\n } else {\n this._openInteractionDialog('reply');\n }\n }\n\n handleShareClick = () => {\n navigator.share({\n text: this.props.status.get('search_index'),\n url: this.props.status.get('url'),\n }).catch((e) => {\n if (e.name !== 'AbortError') console.error(e);\n });\n }\n\n handleFavouriteClick = () => {\n if (me) {\n this.props.onFavourite(this.props.status);\n } else {\n this._openInteractionDialog('favourite');\n }\n }\n\n handleReblogClick = e => {\n if (me) {\n this.props.onReblog(this.props.status, e);\n } else {\n this._openInteractionDialog('reblog');\n }\n }\n\n _openInteractionDialog = type => {\n window.open(`/interact/${this.props.status.get('id')}?type=${type}`, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes');\n }\n\n handleDeleteClick = () => {\n this.props.onDelete(this.props.status, this.context.router.history);\n }\n\n handleRedraftClick = () => {\n this.props.onDelete(this.props.status, this.context.router.history, true);\n }\n\n handlePinClick = () => {\n this.props.onPin(this.props.status);\n }\n\n handleMentionClick = () => {\n this.props.onMention(this.props.status.get('account'), this.context.router.history);\n }\n\n handleDirectClick = () => {\n this.props.onDirect(this.props.status.get('account'), this.context.router.history);\n }\n\n handleMuteClick = () => {\n this.props.onMute(this.props.status.get('account'));\n }\n\n handleBlockClick = () => {\n this.props.onBlock(this.props.status);\n }\n\n handleOpen = () => {\n this.context.router.history.push(`/statuses/${this.props.status.get('id')}`);\n }\n\n handleEmbed = () => {\n this.props.onEmbed(this.props.status);\n }\n\n handleReport = () => {\n this.props.onReport(this.props.status);\n }\n\n handleConversationMuteClick = () => {\n this.props.onMuteConversation(this.props.status);\n }\n\n handleCopy = () => {\n const url = this.props.status.get('url');\n const textarea = document.createElement('textarea');\n\n textarea.textContent = url;\n textarea.style.position = 'fixed';\n\n document.body.appendChild(textarea);\n\n try {\n textarea.select();\n document.execCommand('copy');\n } catch (e) {\n\n } finally {\n document.body.removeChild(textarea);\n }\n }\n\n render () {\n const { status, intl, withDismiss } = this.props;\n\n const mutingConversation = status.get('muted');\n const anonymousAccess = !me;\n const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));\n\n let menu = [];\n let reblogIcon = 'retweet';\n let replyIcon;\n let replyTitle;\n\n menu.push({ text: intl.formatMessage(messages.open), action: this.handleOpen });\n\n if (publicStatus) {\n menu.push({ text: intl.formatMessage(messages.copy), action: this.handleCopy });\n menu.push({ text: intl.formatMessage(messages.embed), action: this.handleEmbed });\n }\n\n menu.push(null);\n\n if (status.getIn(['account', 'id']) === me || withDismiss) {\n menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });\n menu.push(null);\n }\n\n if (status.getIn(['account', 'id']) === me) {\n if (publicStatus) {\n menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });\n } else {\n if (status.get('visibility') === 'private') {\n menu.push({ text: intl.formatMessage(status.get('reblogged') ? messages.cancel_reblog_private : messages.reblog_private), action: this.handleReblogClick });\n }\n }\n\n menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });\n } else {\n menu.push({ text: intl.formatMessage(messages.mention, { name: status.getIn(['account', 'username']) }), action: this.handleMentionClick });\n menu.push({ text: intl.formatMessage(messages.direct, { name: status.getIn(['account', 'username']) }), action: this.handleDirectClick });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.mute, { name: status.getIn(['account', 'username']) }), action: this.handleMuteClick });\n menu.push({ text: intl.formatMessage(messages.block, { name: status.getIn(['account', 'username']) }), action: this.handleBlockClick });\n menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport });\n\n if (isStaff) {\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.admin_account, { name: status.getIn(['account', 'username']) }), href: `/admin/accounts/${status.getIn(['account', 'id'])}` });\n menu.push({ text: intl.formatMessage(messages.admin_status), href: `/admin/accounts/${status.getIn(['account', 'id'])}/statuses/${status.get('id')}` });\n }\n if ( deleteOthersNotice ) {\n menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });\n }\n }\n\n if (status.get('visibility') === 'direct') {\n reblogIcon = 'envelope';\n } else if (status.get('visibility') === 'private') {\n reblogIcon = 'lock';\n }\n\n if (status.get('in_reply_to_id', null) === null) {\n replyIcon = 'reply';\n replyTitle = intl.formatMessage(messages.reply);\n } else {\n replyIcon = 'reply-all';\n replyTitle = intl.formatMessage(messages.replyAll);\n }\n\n const shareButton = ('share' in navigator) && status.get('visibility') === 'public' && (\n \n );\n\n return (\n \n
{obfuscatedCount(status.get('replies_count'))}
\n
\n
\n {shareButton}\n\n
\n \n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport Avatar from './avatar';\nimport AvatarOverlay from './avatar_overlay';\nimport AvatarComposite from './avatar_composite';\nimport RelativeTimestamp from './relative_timestamp';\nimport DisplayName from './display_name';\nimport StatusContent from './status_content';\nimport StatusActionBar from './status_action_bar';\nimport AttachmentList from './attachment_list';\nimport Card from '../features/status/components/card';\nimport { injectIntl, FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { MediaGallery, Video } from '../features/ui/util/async-components';\nimport { HotKeys } from 'react-hotkeys';\nimport classNames from 'classnames';\nimport Icon from 'mastodon/components/icon';\nimport PollContainer from 'mastodon/containers/poll_container';\n\n// We use the component (and not the container) since we do not want\n// to use the progress bar to show download progress\nimport Bundle from '../features/ui/components/bundle';\n\nexport const textForScreenReader = (intl, status, rebloggedByText = false) => {\n const displayName = status.getIn(['account', 'display_name']);\n\n const values = [\n displayName.length === 0 ? status.getIn(['account', 'acct']).split('@')[0] : displayName,\n status.get('spoiler_text') && status.get('hidden') ? status.get('spoiler_text') : status.get('search_index').slice(status.get('spoiler_text').length),\n intl.formatDate(status.get('created_at'), { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' }),\n status.getIn(['account', 'acct']),\n ];\n\n if (rebloggedByText) {\n values.push(rebloggedByText);\n }\n\n return values.join(', ');\n};\n\nexport default @injectIntl\nclass Status extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n status: ImmutablePropTypes.map,\n account: ImmutablePropTypes.map,\n otherAccounts: ImmutablePropTypes.list,\n onClick: PropTypes.func,\n onReply: PropTypes.func,\n onFavourite: PropTypes.func,\n onReblog: PropTypes.func,\n onDelete: PropTypes.func,\n onDirect: PropTypes.func,\n onMention: PropTypes.func,\n onPin: PropTypes.func,\n onOpenMedia: PropTypes.func,\n onOpenVideo: PropTypes.func,\n onBlock: PropTypes.func,\n onEmbed: PropTypes.func,\n onHeightChange: PropTypes.func,\n onToggleHidden: PropTypes.func,\n muted: PropTypes.bool,\n hidden: PropTypes.bool,\n unread: PropTypes.bool,\n onMoveUp: PropTypes.func,\n onMoveDown: PropTypes.func,\n showThread: PropTypes.bool,\n getScrollPosition: PropTypes.func,\n updateScrollBottom: PropTypes.func,\n cacheMediaWidth: PropTypes.func,\n cachedMediaWidth: PropTypes.number,\n };\n\n // Avoid checking props that are functions (and whose equality will always\n // evaluate to false. See react-immutable-pure-component for usage.\n updateOnProps = [\n 'status',\n 'account',\n 'muted',\n 'hidden',\n ];\n\n // Track height changes we know about to compensate scrolling\n componentDidMount () {\n this.didShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card');\n }\n\n getSnapshotBeforeUpdate () {\n if (this.props.getScrollPosition) {\n return this.props.getScrollPosition();\n } else {\n return null;\n }\n }\n\n // Compensate height changes\n componentDidUpdate (prevProps, prevState, snapshot) {\n const doShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card');\n if (doShowCard && !this.didShowCard) {\n this.didShowCard = true;\n if (snapshot !== null && this.props.updateScrollBottom) {\n if (this.node && this.node.offsetTop < snapshot.top) {\n this.props.updateScrollBottom(snapshot.height - snapshot.top);\n }\n }\n }\n }\n\n componentWillUnmount() {\n if (this.node && this.props.getScrollPosition) {\n const position = this.props.getScrollPosition();\n if (position !== null && this.node.offsetTop < position.top) {\n requestAnimationFrame(() => {\n this.props.updateScrollBottom(position.height - position.top);\n });\n }\n }\n }\n\n handleClick = () => {\n if (this.props.onClick) {\n this.props.onClick();\n return;\n }\n\n if (!this.context.router) {\n return;\n }\n\n const { status } = this.props;\n this.context.router.history.push(`/statuses/${status.getIn(['reblog', 'id'], status.get('id'))}`);\n }\n\n handleAccountClick = (e) => {\n if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {\n const id = e.currentTarget.getAttribute('data-id');\n e.preventDefault();\n this.context.router.history.push(`/accounts/${id}`);\n }\n }\n\n handleExpandedToggle = () => {\n this.props.onToggleHidden(this._properStatus());\n };\n\n renderLoadingMediaGallery () {\n return
;\n }\n\n renderLoadingVideoPlayer () {\n return
;\n }\n\n handleOpenVideo = (media, startTime) => {\n this.props.onOpenVideo(media, startTime);\n }\n\n handleHotkeyReply = e => {\n e.preventDefault();\n this.props.onReply(this._properStatus(), this.context.router.history);\n }\n\n handleHotkeyFavourite = () => {\n this.props.onFavourite(this._properStatus());\n }\n\n handleHotkeyBoost = e => {\n this.props.onReblog(this._properStatus(), e);\n }\n\n handleHotkeyMention = e => {\n e.preventDefault();\n this.props.onMention(this._properStatus().get('account'), this.context.router.history);\n }\n\n handleHotkeyOpen = () => {\n this.context.router.history.push(`/statuses/${this._properStatus().get('id')}`);\n }\n\n handleHotkeyOpenProfile = () => {\n this.context.router.history.push(`/accounts/${this._properStatus().getIn(['account', 'id'])}`);\n }\n\n handleHotkeyMoveUp = e => {\n this.props.onMoveUp(this.props.status.get('id'), e.target.getAttribute('data-featured'));\n }\n\n handleHotkeyMoveDown = e => {\n this.props.onMoveDown(this.props.status.get('id'), e.target.getAttribute('data-featured'));\n }\n\n handleHotkeyToggleHidden = () => {\n this.props.onToggleHidden(this._properStatus());\n }\n\n _properStatus () {\n const { status } = this.props;\n\n if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {\n return status.get('reblog');\n } else {\n return status;\n }\n }\n\n handleRef = c => {\n this.node = c;\n }\n\n render () {\n let media = null;\n let statusAvatar, prepend, rebloggedByText;\n\n const { intl, hidden, featured, otherAccounts, unread, showThread } = this.props;\n\n let { status, account, ...other } = this.props;\n\n if (status === null) {\n return null;\n }\n\n if (hidden) {\n return (\n \n {status.getIn(['account', 'display_name']) || status.getIn(['account', 'username'])}\n {status.get('content')}\n
\n );\n }\n\n if (status.get('filtered') || status.getIn(['reblog', 'filtered'])) {\n const minHandlers = this.props.muted ? {} : {\n moveUp: this.handleHotkeyMoveUp,\n moveDown: this.handleHotkeyMoveDown,\n };\n\n return (\n \n \n \n
\n \n );\n }\n\n if (featured) {\n prepend = (\n \n );\n } else if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {\n const display_name_html = { __html: status.getIn(['account', 'display_name_html']) };\n\n prepend = (\n \n );\n\n rebloggedByText = intl.formatMessage({ id: 'status.reblogged_by', defaultMessage: '{name} boosted' }, { name: status.getIn(['account', 'acct']) });\n\n account = status.get('account');\n status = status.get('reblog');\n }\n\n if (status.get('poll')) {\n media = ;\n } else if (status.get('media_attachments').size > 0) {\n if (this.props.muted || status.get('media_attachments').some(item => item.get('type') === 'unknown')) {\n media = (\n \n );\n } else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {\n const video = status.getIn(['media_attachments', 0]);\n\n media = (\n \n {Component => (\n \n )}\n \n );\n } else {\n media = (\n \n {Component => (\n \n )}\n \n );\n }\n } else if (status.get('spoiler_text').length === 0 && status.get('card')) {\n media = (\n \n );\n }\n\n if (otherAccounts && otherAccounts.size > 0) {\n statusAvatar = ;\n } else if (account === undefined || account === null) {\n statusAvatar = ;\n } else {\n statusAvatar = ;\n }\n\n const handlers = this.props.muted ? {} : {\n reply: this.handleHotkeyReply,\n favourite: this.handleHotkeyFavourite,\n boost: this.handleHotkeyBoost,\n mention: this.handleHotkeyMention,\n open: this.handleHotkeyOpen,\n openProfile: this.handleHotkeyOpenProfile,\n moveUp: this.handleHotkeyMoveUp,\n moveDown: this.handleHotkeyMoveDown,\n toggleHidden: this.handleHotkeyToggleHidden,\n };\n\n return (\n \n \n {prepend}\n\n
\n
\n\n
\n\n {media}\n\n {showThread && status.get('in_reply_to_id') && status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) && (\n
\n \n \n )}\n\n
\n
\n
\n \n );\n }\n\n}\n","var _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport Route from \"./Route\";\nimport Link from \"./Link\";\n/**\n * A wrapper that knows if it's \"active\" or not.\n */\n\nvar NavLink = function NavLink(_ref) {\n var to = _ref.to,\n exact = _ref.exact,\n strict = _ref.strict,\n location = _ref.location,\n activeClassName = _ref.activeClassName,\n className = _ref.className,\n activeStyle = _ref.activeStyle,\n style = _ref.style,\n getIsActive = _ref.isActive,\n ariaCurrent = _ref[\"aria-current\"],\n rest = _objectWithoutProperties(_ref, [\"to\", \"exact\", \"strict\", \"location\", \"activeClassName\", \"className\", \"activeStyle\", \"style\", \"isActive\", \"aria-current\"]);\n\n var path = (typeof to === \"undefined\" ? \"undefined\" : _typeof(to)) === \"object\" ? to.pathname : to; // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202\n\n var escapedPath = path && path.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n return React.createElement(Route, {\n path: escapedPath,\n exact: exact,\n strict: strict,\n location: location,\n children: function children(_ref2) {\n var location = _ref2.location,\n match = _ref2.match;\n var isActive = !!(getIsActive ? getIsActive(match, location) : match);\n return React.createElement(Link, _extends({\n to: to,\n className: isActive ? [className, activeClassName].filter(function (i) {\n return i;\n }).join(\" \") : className,\n style: isActive ? _extends({}, style, activeStyle) : style,\n \"aria-current\": isActive && ariaCurrent || null\n }, rest));\n }\n });\n};\n\nNavLink.defaultProps = {\n activeClassName: \"active\",\n \"aria-current\": \"page\"\n};\nexport default NavLink;","\n// Get the bounding client rect from an IntersectionObserver entry.\n// This is to work around a bug in Chrome: https://crbug.com/737228\n\nlet hasBoundingRectBug;\n\nfunction getRectFromEntry(entry) {\n if (typeof hasBoundingRectBug !== 'boolean') {\n const boundingRect = entry.target.getBoundingClientRect();\n const observerRect = entry.boundingClientRect;\n hasBoundingRectBug = boundingRect.height !== observerRect.height ||\n boundingRect.top !== observerRect.top ||\n boundingRect.width !== observerRect.width ||\n boundingRect.bottom !== observerRect.bottom ||\n boundingRect.left !== observerRect.left ||\n boundingRect.right !== observerRect.right;\n }\n return hasBoundingRectBug ? entry.target.getBoundingClientRect() : entry.boundingClientRect;\n}\n\nexport default getRectFromEntry;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport scheduleIdleTask from '../features/ui/util/schedule_idle_task';\nimport getRectFromEntry from '../features/ui/util/get_rect_from_entry';\nimport { is } from 'immutable';\n\n// Diff these props in the \"rendered\" state\nconst updateOnPropsForRendered = ['id', 'index', 'listLength'];\n// Diff these props in the \"unrendered\" state\nconst updateOnPropsForUnrendered = ['id', 'index', 'listLength', 'cachedHeight'];\n\nexport default class IntersectionObserverArticle extends React.Component {\n\n static propTypes = {\n intersectionObserverWrapper: PropTypes.object.isRequired,\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n index: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n listLength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n saveHeightKey: PropTypes.string,\n cachedHeight: PropTypes.number,\n onHeightChange: PropTypes.func,\n children: PropTypes.node,\n };\n\n state = {\n isHidden: false, // set to true in requestIdleCallback to trigger un-render\n }\n\n shouldComponentUpdate (nextProps, nextState) {\n const isUnrendered = !this.state.isIntersecting && (this.state.isHidden || this.props.cachedHeight);\n const willBeUnrendered = !nextState.isIntersecting && (nextState.isHidden || nextProps.cachedHeight);\n if (!!isUnrendered !== !!willBeUnrendered) {\n // If we're going from rendered to unrendered (or vice versa) then update\n return true;\n }\n // Otherwise, diff based on props\n const propsToDiff = isUnrendered ? updateOnPropsForUnrendered : updateOnPropsForRendered;\n return !propsToDiff.every(prop => is(nextProps[prop], this.props[prop]));\n }\n\n componentDidMount () {\n const { intersectionObserverWrapper, id } = this.props;\n\n intersectionObserverWrapper.observe(\n id,\n this.node,\n this.handleIntersection\n );\n\n this.componentMounted = true;\n }\n\n componentWillUnmount () {\n const { intersectionObserverWrapper, id } = this.props;\n intersectionObserverWrapper.unobserve(id, this.node);\n\n this.componentMounted = false;\n }\n\n handleIntersection = (entry) => {\n this.entry = entry;\n\n scheduleIdleTask(this.calculateHeight);\n this.setState(this.updateStateAfterIntersection);\n }\n\n updateStateAfterIntersection = (prevState) => {\n if (prevState.isIntersecting !== false && !this.entry.isIntersecting) {\n scheduleIdleTask(this.hideIfNotIntersecting);\n }\n return {\n isIntersecting: this.entry.isIntersecting,\n isHidden: false,\n };\n }\n\n calculateHeight = () => {\n const { onHeightChange, saveHeightKey, id } = this.props;\n // save the height of the fully-rendered element (this is expensive\n // on Chrome, where we need to fall back to getBoundingClientRect)\n this.height = getRectFromEntry(this.entry).height;\n\n if (onHeightChange && saveHeightKey) {\n onHeightChange(saveHeightKey, id, this.height);\n }\n }\n\n hideIfNotIntersecting = () => {\n if (!this.componentMounted) {\n return;\n }\n\n // When the browser gets a chance, test if we're still not intersecting,\n // and if so, set our isHidden to true to trigger an unrender. The point of\n // this is to save DOM nodes and avoid using up too much memory.\n // See: https://github.com/tootsuite/mastodon/issues/2900\n this.setState((prevState) => ({ isHidden: !prevState.isIntersecting }));\n }\n\n handleRef = (node) => {\n this.node = node;\n }\n\n render () {\n const { children, id, index, listLength, cachedHeight } = this.props;\n const { isIntersecting, isHidden } = this.state;\n\n if (!isIntersecting && (isHidden || cachedHeight)) {\n return (\n \n {children && React.cloneElement(children, { hidden: true })}\n \n );\n }\n\n return (\n \n {children && React.cloneElement(children, { hidden: false })}\n \n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport IntersectionObserverArticle from '../components/intersection_observer_article';\nimport { setHeight } from '../actions/height_cache';\n\nconst makeMapStateToProps = (state, props) => ({\n cachedHeight: state.getIn(['height_cache', props.saveHeightKey, props.id]),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n\n onHeightChange (key, id, height) {\n dispatch(setHeight(key, id, height));\n },\n\n});\n\nexport default connect(makeMapStateToProps, mapDispatchToProps)(IntersectionObserverArticle);\n","// Wrapper for IntersectionObserver in order to make working with it\n// a bit easier. We also follow this performance advice:\n// \"If you need to observe multiple elements, it is both possible and\n// advised to observe multiple elements using the same IntersectionObserver\n// instance by calling observe() multiple times.\"\n// https://developers.google.com/web/updates/2016/04/intersectionobserver\n\nclass IntersectionObserverWrapper {\n\n callbacks = {};\n observerBacklog = [];\n observer = null;\n\n connect (options) {\n const onIntersection = (entries) => {\n entries.forEach(entry => {\n const id = entry.target.getAttribute('data-id');\n if (this.callbacks[id]) {\n this.callbacks[id](entry);\n }\n });\n };\n\n this.observer = new IntersectionObserver(onIntersection, options);\n this.observerBacklog.forEach(([ id, node, callback ]) => {\n this.observe(id, node, callback);\n });\n this.observerBacklog = null;\n }\n\n observe (id, node, callback) {\n if (!this.observer) {\n this.observerBacklog.push([ id, node, callback ]);\n } else {\n this.callbacks[id] = callback;\n this.observer.observe(node);\n }\n }\n\n unobserve (id, node) {\n if (this.observer) {\n delete this.callbacks[id];\n this.observer.unobserve(node);\n }\n }\n\n disconnect () {\n if (this.observer) {\n this.callbacks = {};\n this.observer.disconnect();\n this.observer = null;\n }\n }\n\n}\n\nexport default IntersectionObserverWrapper;\n","import React, { PureComponent } from 'react';\nimport { ScrollContainer } from 'react-router-scroll-4';\nimport PropTypes from 'prop-types';\nimport IntersectionObserverArticleContainer from '../containers/intersection_observer_article_container';\nimport LoadMore from './load_more';\nimport IntersectionObserverWrapper from '../features/ui/util/intersection_observer_wrapper';\nimport { throttle } from 'lodash';\nimport { List as ImmutableList } from 'immutable';\nimport classNames from 'classnames';\nimport { attachFullscreenListener, detachFullscreenListener, isFullscreen } from '../features/ui/util/fullscreen';\nimport LoadingIndicator from './loading_indicator';\n\nconst MOUSE_IDLE_DELAY = 300;\n\nexport default class ScrollableList extends PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n scrollKey: PropTypes.string.isRequired,\n onLoadMore: PropTypes.func,\n onScrollToTop: PropTypes.func,\n onScroll: PropTypes.func,\n trackScroll: PropTypes.bool,\n shouldUpdateScroll: PropTypes.func,\n isLoading: PropTypes.bool,\n showLoading: PropTypes.bool,\n hasMore: PropTypes.bool,\n prepend: PropTypes.node,\n alwaysPrepend: PropTypes.bool,\n emptyMessage: PropTypes.node,\n children: PropTypes.node,\n };\n\n static defaultProps = {\n trackScroll: true,\n };\n\n state = {\n fullscreen: null,\n cachedMediaWidth: 250, // Default media/card width using default Mastodon theme\n };\n\n intersectionObserverWrapper = new IntersectionObserverWrapper();\n\n handleScroll = throttle(() => {\n if (this.node) {\n const { scrollTop, scrollHeight, clientHeight } = this.node;\n const offset = scrollHeight - scrollTop - clientHeight;\n\n if (400 > offset && this.props.onLoadMore && this.props.hasMore && !this.props.isLoading) {\n this.props.onLoadMore();\n }\n\n if (scrollTop < 100 && this.props.onScrollToTop) {\n this.props.onScrollToTop();\n } else if (this.props.onScroll) {\n this.props.onScroll();\n }\n\n if (!this.lastScrollWasSynthetic) {\n // If the last scroll wasn't caused by setScrollTop(), assume it was\n // intentional and cancel any pending scroll reset on mouse idle\n this.scrollToTopOnMouseIdle = false;\n }\n this.lastScrollWasSynthetic = false;\n }\n }, 150, {\n trailing: true,\n });\n\n mouseIdleTimer = null;\n mouseMovedRecently = false;\n lastScrollWasSynthetic = false;\n scrollToTopOnMouseIdle = false;\n\n setScrollTop = newScrollTop => {\n if (this.node.scrollTop !== newScrollTop) {\n this.lastScrollWasSynthetic = true;\n this.node.scrollTop = newScrollTop;\n }\n };\n\n clearMouseIdleTimer = () => {\n if (this.mouseIdleTimer === null) {\n return;\n }\n\n clearTimeout(this.mouseIdleTimer);\n this.mouseIdleTimer = null;\n };\n\n handleMouseMove = throttle(() => {\n // As long as the mouse keeps moving, clear and restart the idle timer.\n this.clearMouseIdleTimer();\n this.mouseIdleTimer = setTimeout(this.handleMouseIdle, MOUSE_IDLE_DELAY);\n\n if (!this.mouseMovedRecently && this.node.scrollTop === 0) {\n // Only set if we just started moving and are scrolled to the top.\n this.scrollToTopOnMouseIdle = true;\n }\n\n // Save setting this flag for last, so we can do the comparison above.\n this.mouseMovedRecently = true;\n }, MOUSE_IDLE_DELAY / 2);\n\n handleWheel = throttle(() => {\n this.scrollToTopOnMouseIdle = false;\n }, 150, {\n trailing: true,\n });\n\n handleMouseIdle = () => {\n if (this.scrollToTopOnMouseIdle) {\n this.setScrollTop(0);\n }\n\n this.mouseMovedRecently = false;\n this.scrollToTopOnMouseIdle = false;\n }\n\n componentDidMount () {\n this.attachScrollListener();\n this.attachIntersectionObserver();\n\n attachFullscreenListener(this.onFullScreenChange);\n\n // Handle initial scroll posiiton\n this.handleScroll();\n }\n\n getScrollPosition = () => {\n if (this.node && (this.node.scrollTop > 0 || this.mouseMovedRecently)) {\n return { height: this.node.scrollHeight, top: this.node.scrollTop };\n } else {\n return null;\n }\n }\n\n updateScrollBottom = (snapshot) => {\n const newScrollTop = this.node.scrollHeight - snapshot;\n\n this.setScrollTop(newScrollTop);\n }\n\n getSnapshotBeforeUpdate (prevProps) {\n const someItemInserted = React.Children.count(prevProps.children) > 0 &&\n React.Children.count(prevProps.children) < React.Children.count(this.props.children) &&\n this.getFirstChildKey(prevProps) !== this.getFirstChildKey(this.props);\n\n if (someItemInserted && (this.node.scrollTop > 0 || this.mouseMovedRecently)) {\n return this.node.scrollHeight - this.node.scrollTop;\n } else {\n return null;\n }\n }\n\n componentDidUpdate (prevProps, prevState, snapshot) {\n // Reset the scroll position when a new child comes in in order not to\n // jerk the scrollbar around if you're already scrolled down the page.\n if (snapshot !== null) {\n this.setScrollTop(this.node.scrollHeight - snapshot);\n }\n }\n\n cacheMediaWidth = (width) => {\n if (width && this.state.cachedMediaWidth !== width) {\n this.setState({ cachedMediaWidth: width });\n }\n }\n\n componentWillUnmount () {\n this.clearMouseIdleTimer();\n this.detachScrollListener();\n this.detachIntersectionObserver();\n detachFullscreenListener(this.onFullScreenChange);\n }\n\n onFullScreenChange = () => {\n this.setState({ fullscreen: isFullscreen() });\n }\n\n attachIntersectionObserver () {\n this.intersectionObserverWrapper.connect({\n root: this.node,\n rootMargin: '300% 0px',\n });\n }\n\n detachIntersectionObserver () {\n this.intersectionObserverWrapper.disconnect();\n }\n\n attachScrollListener () {\n this.node.addEventListener('scroll', this.handleScroll);\n this.node.addEventListener('wheel', this.handleWheel);\n }\n\n detachScrollListener () {\n this.node.removeEventListener('scroll', this.handleScroll);\n this.node.removeEventListener('wheel', this.handleWheel);\n }\n\n getFirstChildKey (props) {\n const { children } = props;\n let firstChild = children;\n\n if (children instanceof ImmutableList) {\n firstChild = children.get(0);\n } else if (Array.isArray(children)) {\n firstChild = children[0];\n }\n\n return firstChild && firstChild.key;\n }\n\n setRef = (c) => {\n this.node = c;\n }\n\n handleLoadMore = e => {\n e.preventDefault();\n this.props.onLoadMore();\n }\n\n render () {\n const { children, scrollKey, trackScroll, shouldUpdateScroll, showLoading, isLoading, hasMore, prepend, alwaysPrepend, emptyMessage, onLoadMore } = this.props;\n const { fullscreen } = this.state;\n const childrenCount = React.Children.count(children);\n\n const loadMore = (hasMore && onLoadMore) ? : null;\n let scrollableArea = null;\n\n if (showLoading) {\n scrollableArea = (\n \n
\n {prepend}\n
\n\n
\n \n
\n
\n );\n } else if (isLoading || childrenCount > 0 || hasMore || !emptyMessage) {\n scrollableArea = (\n \n
\n {prepend}\n\n {React.Children.map(this.props.children, (child, index) => (\n \n {React.cloneElement(child, {\n getScrollPosition: this.getScrollPosition,\n updateScrollBottom: this.updateScrollBottom,\n cachedMediaWidth: this.state.cachedMediaWidth,\n cacheMediaWidth: this.cacheMediaWidth,\n })}\n \n ))}\n\n {loadMore}\n
\n
\n );\n } else {\n scrollableArea = (\n \n {alwaysPrepend && prepend}\n\n
\n {emptyMessage}\n
\n
\n );\n }\n\n if (trackScroll) {\n return (\n \n {scrollableArea}\n \n );\n } else {\n return scrollableArea;\n }\n }\n\n}\n","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};","import React, { Fragment } from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport Avatar from './avatar';\nimport DisplayName from './display_name';\nimport Permalink from './permalink';\nimport IconButton from './icon_button';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { me } from '../initial_state';\n\nconst messages = defineMessages({\n follow: { id: 'account.follow', defaultMessage: 'Follow' },\n unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },\n requested: { id: 'account.requested', defaultMessage: 'Awaiting approval' },\n unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },\n unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' },\n mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' },\n unmute_notifications: { id: 'account.unmute_notifications', defaultMessage: 'Unmute notifications from @{name}' },\n});\n\nexport default @injectIntl\nclass Account extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n onFollow: PropTypes.func.isRequired,\n onBlock: PropTypes.func.isRequired,\n onMute: PropTypes.func.isRequired,\n onMuteNotifications: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n hidden: PropTypes.bool,\n actionIcon: PropTypes.string,\n actionTitle: PropTypes.string,\n onActionClick: PropTypes.func,\n };\n\n handleFollow = () => {\n this.props.onFollow(this.props.account);\n }\n\n handleBlock = () => {\n this.props.onBlock(this.props.account);\n }\n\n handleMute = () => {\n this.props.onMute(this.props.account);\n }\n\n handleMuteNotifications = () => {\n this.props.onMuteNotifications(this.props.account, true);\n }\n\n handleUnmuteNotifications = () => {\n this.props.onMuteNotifications(this.props.account, false);\n }\n\n handleAction = () => {\n this.props.onActionClick(this.props.account);\n }\n\n render () {\n const { account, intl, hidden, onActionClick, actionIcon, actionTitle } = this.props;\n\n if (!account) {\n return
;\n }\n\n if (hidden) {\n return (\n \n {account.get('display_name')}\n {account.get('username')}\n \n );\n }\n\n let buttons;\n\n if (onActionClick && actionIcon) {\n buttons = ;\n } else if (account.get('id') !== me && account.get('relationship', null) !== null) {\n const following = account.getIn(['relationship', 'following']);\n const requested = account.getIn(['relationship', 'requested']);\n const blocking = account.getIn(['relationship', 'blocking']);\n const muting = account.getIn(['relationship', 'muting']);\n\n if (requested) {\n buttons = ;\n } else if (blocking) {\n buttons = ;\n } else if (muting) {\n let hidingNotificationsButton;\n if (account.getIn(['relationship', 'muting_notifications'])) {\n hidingNotificationsButton = ;\n } else {\n hidingNotificationsButton = ;\n }\n buttons = (\n \n \n {hidingNotificationsButton}\n \n );\n } else if (!account.get('moved') || following) {\n buttons = ;\n }\n }\n\n return (\n \n
\n
\n \n \n \n\n
\n {buttons}\n
\n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport { makeGetAccount } from '../selectors';\nimport Account from '../components/account';\nimport {\n followAccount,\n unfollowAccount,\n blockAccount,\n unblockAccount,\n muteAccount,\n unmuteAccount,\n} from '../actions/accounts';\nimport { openModal } from '../actions/modal';\nimport { initMuteModal } from '../actions/mutes';\nimport { unfollowModal } from '../initial_state';\n\nconst messages = defineMessages({\n unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },\n});\n\nconst makeMapStateToProps = () => {\n const getAccount = makeGetAccount();\n\n const mapStateToProps = (state, props) => ({\n account: getAccount(state, props.id),\n });\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { intl }) => ({\n\n onFollow (account) {\n if (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) {\n if (unfollowModal) {\n dispatch(openModal('CONFIRM', {\n message: @{account.get('acct')} }} />,\n confirm: intl.formatMessage(messages.unfollowConfirm),\n onConfirm: () => dispatch(unfollowAccount(account.get('id'))),\n }));\n } else {\n dispatch(unfollowAccount(account.get('id')));\n }\n } else {\n dispatch(followAccount(account.get('id')));\n }\n },\n\n onBlock (account) {\n if (account.getIn(['relationship', 'blocking'])) {\n dispatch(unblockAccount(account.get('id')));\n } else {\n dispatch(blockAccount(account.get('id')));\n }\n },\n\n onMute (account) {\n if (account.getIn(['relationship', 'muting'])) {\n dispatch(unmuteAccount(account.get('id')));\n } else {\n dispatch(initMuteModal(account));\n }\n },\n\n\n onMuteNotifications (account, notifications) {\n dispatch(muteAccount(account.get('id'), notifications));\n },\n});\n\nexport default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Account));\n","import _extends from '../../polyfills/extends';\nimport React from 'react';\nimport data from '../../../data/all.json';\nimport NimbleEmoji from './nimble-emoji';\nimport { EmojiPropTypes, EmojiDefaultProps } from '../../utils/shared-props';\n\nvar Emoji = function Emoji(props) {\n for (var k in Emoji.defaultProps) {\n if (props[k] == undefined && Emoji.defaultProps[k] != undefined) {\n props[k] = Emoji.defaultProps[k];\n }\n }\n\n return NimbleEmoji(_extends({}, props));\n};\n\nEmoji.propTypes = EmojiPropTypes;\nEmoji.defaultProps = _extends({}, EmojiDefaultProps, {\n data: data\n});\nexport default Emoji;","import { connect } from 'react-redux';\nimport StatusList from 'flavours/glitch/components/status_list';\nimport { scrollTopTimeline } from 'flavours/glitch/actions/timelines';\nimport { Map as ImmutableMap, List as ImmutableList } from 'immutable';\nimport { createSelector } from 'reselect';\nimport { debounce } from 'lodash';\nimport { me } from 'flavours/glitch/util/initial_state';\n\nconst makeGetStatusIds = () => createSelector([\n (state, { type }) => state.getIn(['settings', type], ImmutableMap()),\n (state, { type }) => state.getIn(['timelines', type, 'items'], ImmutableList()),\n (state) => state.get('statuses'),\n], (columnSettings, statusIds, statuses) => {\n const rawRegex = columnSettings.getIn(['regex', 'body'], '').trim();\n let regex = null;\n\n try {\n regex = rawRegex && new RegExp(rawRegex, 'i');\n } catch (e) {\n // Bad regex, don't affect filters\n }\n\n return statusIds.filter(id => {\n if (id === null) return true;\n\n const statusForId = statuses.get(id);\n let showStatus = true;\n\n if (columnSettings.getIn(['shows', 'reblog']) === false) {\n showStatus = showStatus && statusForId.get('reblog') === null;\n }\n\n if (columnSettings.getIn(['shows', 'reply']) === false) {\n showStatus = showStatus && (statusForId.get('in_reply_to_id') === null || statusForId.get('in_reply_to_account_id') === me);\n }\n\n if (columnSettings.getIn(['shows', 'direct']) === false) {\n showStatus = showStatus && statusForId.get('visibility') !== 'direct';\n }\n\n if (showStatus && regex && statusForId.get('account') !== me) {\n const searchIndex = statusForId.get('reblog') ? statuses.getIn([statusForId.get('reblog'), 'search_index']) : statusForId.get('search_index');\n showStatus = !regex.test(searchIndex);\n }\n\n return showStatus;\n });\n});\n\nconst makeMapStateToProps = () => {\n const getStatusIds = makeGetStatusIds();\n\n const mapStateToProps = (state, { timelineId }) => ({\n statusIds: getStatusIds(state, { type: timelineId }),\n isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),\n isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),\n hasMore: state.getIn(['timelines', timelineId, 'hasMore']),\n });\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { timelineId }) => ({\n\n onScrollToTop: debounce(() => {\n dispatch(scrollTopTimeline(timelineId, true));\n }, 100),\n\n onScroll: debounce(() => {\n dispatch(scrollTopTimeline(timelineId, false));\n }, 100),\n\n});\n\nexport default connect(makeMapStateToProps, mapDispatchToProps)(StatusList);\n","var _Object = Object;\nexport default _Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};","import { debounce } from 'lodash';\nimport React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport StatusContainer from 'flavours/glitch/containers/status_container';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport LoadGap from './load_gap';\nimport ScrollableList from './scrollable_list';\nimport { FormattedMessage } from 'react-intl';\n\nexport default class StatusList extends ImmutablePureComponent {\n\n static propTypes = {\n scrollKey: PropTypes.string.isRequired,\n statusIds: ImmutablePropTypes.list.isRequired,\n featuredStatusIds: ImmutablePropTypes.list,\n onLoadMore: PropTypes.func,\n onScrollToTop: PropTypes.func,\n onScroll: PropTypes.func,\n trackScroll: PropTypes.bool,\n shouldUpdateScroll: PropTypes.func,\n isLoading: PropTypes.bool,\n isPartial: PropTypes.bool,\n hasMore: PropTypes.bool,\n prepend: PropTypes.node,\n alwaysPrepend: PropTypes.bool,\n emptyMessage: PropTypes.node,\n timelineId: PropTypes.string.isRequired,\n };\n\n static defaultProps = {\n trackScroll: true,\n };\n\n getFeaturedStatusCount = () => {\n return this.props.featuredStatusIds ? this.props.featuredStatusIds.size : 0;\n }\n\n getCurrentStatusIndex = (id, featured) => {\n if (featured) {\n return this.props.featuredStatusIds.indexOf(id);\n } else {\n return this.props.statusIds.indexOf(id) + this.getFeaturedStatusCount();\n }\n }\n\n handleMoveUp = (id, featured) => {\n const elementIndex = this.getCurrentStatusIndex(id, featured) - 1;\n this._selectChild(elementIndex);\n }\n\n handleMoveDown = (id, featured) => {\n const elementIndex = this.getCurrentStatusIndex(id, featured) + 1;\n this._selectChild(elementIndex);\n }\n\n handleLoadOlder = debounce(() => {\n this.props.onLoadMore(this.props.statusIds.size > 0 ? this.props.statusIds.last() : undefined);\n }, 300, { leading: true })\n\n _selectChild (index) {\n const element = this.node.node.querySelector(`article:nth-of-type(${index + 1}) .focusable`);\n\n if (element) {\n element.focus();\n }\n }\n\n setRef = c => {\n this.node = c;\n }\n\n render () {\n const { statusIds, featuredStatusIds, onLoadMore, timelineId, ...other } = this.props;\n const { isLoading, isPartial } = other;\n\n if (isPartial) {\n return (\n \n );\n }\n\n let scrollableContent = (isLoading || statusIds.size > 0) ? (\n statusIds.map((statusId, index) => statusId === null ? (\n 0 ? statusIds.get(index - 1) : null}\n onClick={onLoadMore}\n />\n ) : (\n \n ))\n ) : null;\n\n if (scrollableContent && featuredStatusIds) {\n scrollableContent = featuredStatusIds.map(statusId => (\n \n )).concat(scrollableContent);\n }\n\n return (\n \n {scrollableContent}\n \n );\n }\n\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport Status from '../components/status';\nimport { makeGetStatus } from '../selectors';\nimport {\n replyCompose,\n mentionCompose,\n directCompose,\n} from '../actions/compose';\nimport {\n reblog,\n favourite,\n unreblog,\n unfavourite,\n pin,\n unpin,\n} from '../actions/interactions';\nimport { blockAccount } from '../actions/accounts';\nimport {\n muteStatus,\n unmuteStatus,\n deleteStatus,\n hideStatus,\n revealStatus,\n} from '../actions/statuses';\nimport { initMuteModal } from '../actions/mutes';\nimport { initReport } from '../actions/reports';\nimport { openModal } from '../actions/modal';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport { boostModal, deleteModal } from '../initial_state';\nimport { showAlertForError } from '../actions/alerts';\n\nconst messages = defineMessages({\n deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },\n deleteMessage: { id: 'confirmations.delete.message', defaultMessage: 'Are you sure you want to delete this status?' },\n redraftConfirm: { id: 'confirmations.redraft.confirm', defaultMessage: 'Delete & redraft' },\n redraftMessage: { id: 'confirmations.redraft.message', defaultMessage: 'Are you sure you want to delete this status and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned.' },\n blockConfirm: { id: 'confirmations.block.confirm', defaultMessage: 'Block' },\n replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },\n replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },\n blockAndReport: { id: 'confirmations.block.block_and_report', defaultMessage: 'Block & Report' },\n});\n\nconst makeMapStateToProps = () => {\n const getStatus = makeGetStatus();\n\n const mapStateToProps = (state, props) => ({\n status: getStatus(state, props),\n });\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { intl }) => ({\n\n onReply (status, router) {\n dispatch((_, getState) => {\n let state = getState();\n if (state.getIn(['compose', 'text']).trim().length !== 0) {\n dispatch(openModal('CONFIRM', {\n message: intl.formatMessage(messages.replyMessage),\n confirm: intl.formatMessage(messages.replyConfirm),\n onConfirm: () => dispatch(replyCompose(status, router)),\n }));\n } else {\n dispatch(replyCompose(status, router));\n }\n });\n },\n\n onModalReblog (status) {\n dispatch(reblog(status));\n },\n\n onReblog (status, e) {\n if (status.get('reblogged')) {\n dispatch(unreblog(status));\n } else {\n if (e.shiftKey || !boostModal) {\n this.onModalReblog(status);\n } else {\n dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog }));\n }\n }\n },\n\n onFavourite (status) {\n if (status.get('favourited')) {\n dispatch(unfavourite(status));\n } else {\n dispatch(favourite(status));\n }\n },\n\n onPin (status) {\n if (status.get('pinned')) {\n dispatch(unpin(status));\n } else {\n dispatch(pin(status));\n }\n },\n\n onEmbed (status) {\n dispatch(openModal('EMBED', {\n url: status.get('url'),\n onError: error => dispatch(showAlertForError(error)),\n }));\n },\n\n onDelete (status, history, withRedraft = false) {\n if (!deleteModal) {\n dispatch(deleteStatus(status.get('id'), history, withRedraft));\n } else {\n dispatch(openModal('CONFIRM', {\n message: intl.formatMessage(withRedraft ? messages.redraftMessage : messages.deleteMessage),\n confirm: intl.formatMessage(withRedraft ? messages.redraftConfirm : messages.deleteConfirm),\n onConfirm: () => dispatch(deleteStatus(status.get('id'), history, withRedraft)),\n }));\n }\n },\n\n onDirect (account, router) {\n dispatch(directCompose(account, router));\n },\n\n onMention (account, router) {\n dispatch(mentionCompose(account, router));\n },\n\n onOpenMedia (media, index) {\n dispatch(openModal('MEDIA', { media, index }));\n },\n\n onOpenVideo (media, time) {\n dispatch(openModal('VIDEO', { media, time }));\n },\n\n onBlock (status) {\n const account = status.get('account');\n dispatch(openModal('CONFIRM', {\n message: @{account.get('acct')} }} />,\n confirm: intl.formatMessage(messages.blockConfirm),\n onConfirm: () => dispatch(blockAccount(account.get('id'))),\n secondary: intl.formatMessage(messages.blockAndReport),\n onSecondary: () => {\n dispatch(blockAccount(account.get('id')));\n dispatch(initReport(account, status));\n },\n }));\n },\n\n onReport (status) {\n dispatch(initReport(status.get('account'), status));\n },\n\n onMute (account) {\n dispatch(initMuteModal(account));\n },\n\n onMuteConversation (status) {\n if (status.get('muted')) {\n dispatch(unmuteStatus(status.get('id')));\n } else {\n dispatch(muteStatus(status.get('id')));\n }\n },\n\n onToggleHidden (status) {\n if (status.get('hidden')) {\n dispatch(revealStatus(status.get('id')));\n } else {\n dispatch(hideStatus(status.get('id')));\n }\n },\n\n});\n\nexport default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status));\n","import { connect } from 'react-redux';\nimport StatusList from '../../../components/status_list';\nimport { scrollTopTimeline } from '../../../actions/timelines';\nimport { Map as ImmutableMap, List as ImmutableList } from 'immutable';\nimport { createSelector } from 'reselect';\nimport { debounce } from 'lodash';\nimport { me } from '../../../initial_state';\n\nconst makeGetStatusIds = () => createSelector([\n (state, { type }) => state.getIn(['settings', type], ImmutableMap()),\n (state, { type }) => state.getIn(['timelines', type, 'items'], ImmutableList()),\n (state) => state.get('statuses'),\n], (columnSettings, statusIds, statuses) => {\n return statusIds.filter(id => {\n if (id === null) return true;\n\n const statusForId = statuses.get(id);\n let showStatus = true;\n\n if (columnSettings.getIn(['shows', 'reblog']) === false) {\n showStatus = showStatus && statusForId.get('reblog') === null;\n }\n\n if (columnSettings.getIn(['shows', 'reply']) === false) {\n showStatus = showStatus && (statusForId.get('in_reply_to_id') === null || statusForId.get('in_reply_to_account_id') === me);\n }\n\n return showStatus;\n });\n});\n\nconst makeMapStateToProps = () => {\n const getStatusIds = makeGetStatusIds();\n\n const mapStateToProps = (state, { timelineId }) => ({\n statusIds: getStatusIds(state, { type: timelineId }),\n isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),\n isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),\n hasMore: state.getIn(['timelines', timelineId, 'hasMore']),\n });\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { timelineId }) => ({\n\n onScrollToTop: debounce(() => {\n dispatch(scrollTopTimeline(timelineId, true));\n }, 100),\n\n onScroll: debounce(() => {\n dispatch(scrollTopTimeline(timelineId, false));\n }, 100),\n\n});\n\nexport default connect(makeMapStateToProps, mapDispatchToProps)(StatusList);\n","var _String = String;\nexport default _String.fromCodePoint || function stringFromCodePoint() {\n var MAX_SIZE = 0x4000;\n var codeUnits = [];\n var highSurrogate;\n var lowSurrogate;\n var index = -1;\n var length = arguments.length;\n\n if (!length) {\n return '';\n }\n\n var result = '';\n\n while (++index < length) {\n var codePoint = Number(arguments[index]);\n\n if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10ffff || // not a valid Unicode code point\n Math.floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n\n if (codePoint <= 0xffff) {\n // BMP code point\n codeUnits.push(codePoint);\n } else {\n // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n highSurrogate = (codePoint >> 10) + 0xd800;\n lowSurrogate = codePoint % 0x400 + 0xdc00;\n codeUnits.push(highSurrogate, lowSurrogate);\n }\n\n if (index + 1 === length || codeUnits.length > MAX_SIZE) {\n result += String.fromCharCode.apply(null, codeUnits);\n codeUnits.length = 0;\n }\n }\n\n return result;\n};","import _Object$keys from 'babel-runtime/core-js/object/keys';\nimport { buildSearch } from './data';\nimport stringFromCodePoint from '../polyfills/stringFromCodePoint';\nvar _JSON = JSON;\nvar COLONS_REGEX = /^(?:\\:([^\\:]+)\\:)(?:\\:skin-tone-(\\d)\\:)?$/;\nvar SKINS = ['1F3FA', '1F3FB', '1F3FC', '1F3FD', '1F3FE', '1F3FF'];\n\nfunction unifiedToNative(unified) {\n var unicodes = unified.split('-'),\n codePoints = unicodes.map(function (u) {\n return '0x' + u;\n });\n return stringFromCodePoint.apply(null, codePoints);\n}\n\nfunction sanitize(emoji) {\n var name = emoji.name;\n var short_names = emoji.short_names;\n var skin_tone = emoji.skin_tone;\n var skin_variations = emoji.skin_variations;\n var emoticons = emoji.emoticons;\n var unified = emoji.unified;\n var custom = emoji.custom;\n var imageUrl = emoji.imageUrl;\n var id = emoji.id || short_names[0];\n var colons = ':' + id + ':';\n\n if (custom) {\n return {\n id: id,\n name: name,\n colons: colons,\n emoticons: emoticons,\n custom: custom,\n imageUrl: imageUrl\n };\n }\n\n if (skin_tone) {\n colons += ':skin-tone-' + skin_tone + ':';\n }\n\n return {\n id: id,\n name: name,\n colons: colons,\n emoticons: emoticons,\n unified: unified.toLowerCase(),\n skin: skin_tone || (skin_variations ? 1 : null),\n native: unifiedToNative(unified)\n };\n}\n\nfunction getSanitizedData() {\n return sanitize(getData.apply(undefined, arguments));\n}\n\nfunction getData(emoji, skin, set, data) {\n var emojiData = {};\n\n if (typeof emoji == 'string') {\n var matches = emoji.match(COLONS_REGEX);\n\n if (matches) {\n emoji = matches[1];\n\n if (matches[2]) {\n skin = parseInt(matches[2], 10);\n }\n }\n\n if (data.aliases.hasOwnProperty(emoji)) {\n emoji = data.aliases[emoji];\n }\n\n if (data.emojis.hasOwnProperty(emoji)) {\n emojiData = data.emojis[emoji];\n } else {\n return null;\n }\n } else if (emoji.id) {\n if (data.aliases.hasOwnProperty(emoji.id)) {\n emoji.id = data.aliases[emoji.id];\n }\n\n if (data.emojis.hasOwnProperty(emoji.id)) {\n emojiData = data.emojis[emoji.id];\n skin || (skin = emoji.skin);\n }\n }\n\n if (!_Object$keys(emojiData).length) {\n emojiData = emoji;\n emojiData.custom = true;\n\n if (!emojiData.search) {\n emojiData.search = buildSearch(emoji);\n }\n }\n\n emojiData.emoticons || (emojiData.emoticons = []);\n emojiData.variations || (emojiData.variations = []);\n\n if (emojiData.skin_variations && skin > 1 && set) {\n emojiData = JSON.parse(_JSON.stringify(emojiData));\n var skinKey = SKINS[skin - 1],\n variationData = emojiData.skin_variations[skinKey];\n\n if (!variationData.variations && emojiData.variations) {\n delete emojiData.variations;\n }\n\n if (variationData['has_img_' + set] == undefined || variationData['has_img_' + set]) {\n emojiData.skin_tone = skin;\n\n for (var k in variationData) {\n var v = variationData[k];\n emojiData[k] = v;\n }\n }\n }\n\n if (emojiData.variations && emojiData.variations.length) {\n emojiData = JSON.parse(_JSON.stringify(emojiData));\n emojiData.unified = emojiData.variations.shift();\n }\n\n return emojiData;\n}\n\nfunction uniq(arr) {\n return arr.reduce(function (acc, item) {\n if (acc.indexOf(item) === -1) {\n acc.push(item);\n }\n\n return acc;\n }, []);\n}\n\nfunction intersect(a, b) {\n var uniqA = uniq(a);\n var uniqB = uniq(b);\n return uniqA.filter(function (item) {\n return uniqB.indexOf(item) >= 0;\n });\n}\n\nfunction deepMerge(a, b) {\n var o = {};\n\n for (var key in a) {\n var originalValue = a[key],\n value = originalValue;\n\n if (b.hasOwnProperty(key)) {\n value = b[key];\n }\n\n if (typeof value === 'object') {\n value = deepMerge(originalValue, value);\n }\n\n o[key] = value;\n }\n\n return o;\n} // https://github.com/sonicdoe/measure-scrollbar\n\n\nfunction measureScrollbar() {\n if (typeof document == 'undefined') return 0;\n var div = document.createElement('div');\n div.style.width = '100px';\n div.style.height = '100px';\n div.style.overflow = 'scroll';\n div.style.position = 'absolute';\n div.style.top = '-9999px';\n document.body.appendChild(div);\n var scrollbarWidth = div.offsetWidth - div.clientWidth;\n document.body.removeChild(div);\n return scrollbarWidth;\n}\n\nexport { getData, getSanitizedData, uniq, intersect, deepMerge, unifiedToNative, measureScrollbar };","var core = module.exports = {\n version: '2.6.1'\n};\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef","var mapping = {\n name: 'a',\n unified: 'b',\n non_qualified: 'c',\n has_img_apple: 'd',\n has_img_google: 'e',\n has_img_twitter: 'f',\n has_img_emojione: 'g',\n has_img_facebook: 'h',\n has_img_messenger: 'i',\n keywords: 'j',\n sheet: 'k',\n emoticons: 'l',\n text: 'm',\n short_names: 'n',\n added_in: 'o'\n};\n\nvar buildSearch = function buildSearch(emoji) {\n var search = [];\n\n var addToSearch = function addToSearch(strings, split) {\n if (!strings) {\n return;\n }\n\n ;\n (Array.isArray(strings) ? strings : [strings]).forEach(function (string) {\n ;\n (split ? string.split(/[-|_|\\s]+/) : [string]).forEach(function (s) {\n s = s.toLowerCase();\n\n if (search.indexOf(s) == -1) {\n search.push(s);\n }\n });\n });\n };\n\n addToSearch(emoji.short_names, true);\n addToSearch(emoji.name, true);\n addToSearch(emoji.keywords, false);\n addToSearch(emoji.emoticons, false);\n return search.join(',');\n};\n\nvar compress = function compress(emoji) {\n emoji.short_names = emoji.short_names.filter(function (short_name) {\n return short_name !== emoji.short_name;\n });\n delete emoji.short_name;\n emoji.sheet = [emoji.sheet_x, emoji.sheet_y];\n delete emoji.sheet_x;\n delete emoji.sheet_y;\n emoji.added_in = parseInt(emoji.added_in);\n\n if (emoji.added_in === 6) {\n delete emoji.added_in;\n }\n\n for (var key in mapping) {\n emoji[mapping[key]] = emoji[key];\n delete emoji[key];\n }\n\n for (var _key in emoji) {\n var value = emoji[_key];\n\n if (Array.isArray(value) && !value.length) {\n delete emoji[_key];\n } else if (typeof value === 'string' && !value.length) {\n delete emoji[_key];\n } else if (value === null) {\n delete emoji[_key];\n }\n }\n};\n\nvar uncompress = function uncompress(data) {\n data.compressed = false;\n\n for (var id in data.emojis) {\n var emoji = data.emojis[id];\n\n for (var key in mapping) {\n emoji[key] = emoji[mapping[key]];\n delete emoji[mapping[key]];\n }\n\n if (!emoji.short_names) emoji.short_names = [];\n emoji.short_names.unshift(id);\n emoji.sheet_x = emoji.sheet[0];\n emoji.sheet_y = emoji.sheet[1];\n delete emoji.sheet;\n if (!emoji.text) emoji.text = '';\n if (!emoji.added_in) emoji.added_in = 6;\n emoji.added_in = emoji.added_in.toFixed(1);\n emoji.search = buildSearch(emoji);\n }\n};\n\nmodule.exports = {\n buildSearch: buildSearch,\n compress: compress,\n uncompress: uncompress\n};","import PropTypes from 'prop-types';\nvar EmojiPropTypes = {\n data: PropTypes.object.isRequired,\n onOver: PropTypes.func,\n onLeave: PropTypes.func,\n onClick: PropTypes.func,\n fallback: PropTypes.func,\n backgroundImageFn: PropTypes.func,\n native: PropTypes.bool,\n forceSize: PropTypes.bool,\n tooltip: PropTypes.bool,\n skin: PropTypes.oneOf([1, 2, 3, 4, 5, 6]),\n sheetSize: PropTypes.oneOf([16, 20, 32, 64]),\n set: PropTypes.oneOf(['apple', 'google', 'twitter', 'emojione', 'messenger', 'facebook']),\n size: PropTypes.number.isRequired,\n emoji: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired\n};\nvar EmojiDefaultProps = {\n skin: 1,\n set: 'apple',\n sheetSize: 64,\n native: false,\n forceSize: false,\n tooltip: false,\n backgroundImageFn: function backgroundImageFn(set, sheetSize) {\n return 'https://unpkg.com/emoji-datasource-' + set + '@' + '4.0.4' + '/img/' + set + '/sheets-256/' + sheetSize + '.png';\n },\n onOver: function onOver() {},\n onLeave: function onLeave() {},\n onClick: function onClick() {}\n};\nvar PickerPropTypes = {\n onClick: PropTypes.func,\n onSelect: PropTypes.func,\n onSkinChange: PropTypes.func,\n perLine: PropTypes.number,\n emojiSize: PropTypes.number,\n i18n: PropTypes.object,\n style: PropTypes.object,\n title: PropTypes.string,\n emoji: PropTypes.string,\n color: PropTypes.string,\n set: EmojiPropTypes.set,\n skin: EmojiPropTypes.skin,\n native: PropTypes.bool,\n backgroundImageFn: EmojiPropTypes.backgroundImageFn,\n sheetSize: EmojiPropTypes.sheetSize,\n emojisToShowFilter: PropTypes.func,\n showPreview: PropTypes.bool,\n showSkinTones: PropTypes.bool,\n emojiTooltip: EmojiPropTypes.tooltip,\n include: PropTypes.arrayOf(PropTypes.string),\n exclude: PropTypes.arrayOf(PropTypes.string),\n recent: PropTypes.arrayOf(PropTypes.string),\n autoFocus: PropTypes.bool,\n custom: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n short_names: PropTypes.arrayOf(PropTypes.string).isRequired,\n emoticons: PropTypes.arrayOf(PropTypes.string),\n keywords: PropTypes.arrayOf(PropTypes.string),\n imageUrl: PropTypes.string.isRequired\n }))\n};\nvar PickerDefaultProps = {\n onClick: function onClick() {},\n onSelect: function onSelect() {},\n onSkinChange: function onSkinChange() {},\n emojiSize: 24,\n perLine: 9,\n i18n: {},\n style: {},\n title: 'Emoji Mart™',\n emoji: 'department_store',\n color: '#ae65c5',\n set: EmojiDefaultProps.set,\n skin: null,\n defaultSkin: EmojiDefaultProps.skin,\n native: EmojiDefaultProps.native,\n sheetSize: EmojiDefaultProps.sheetSize,\n backgroundImageFn: EmojiDefaultProps.backgroundImageFn,\n emojisToShowFilter: null,\n showPreview: true,\n showSkinTones: true,\n emojiTooltip: EmojiDefaultProps.tooltip,\n autoFocus: false,\n custom: []\n};\nexport { EmojiPropTypes, EmojiDefaultProps, PickerPropTypes, PickerDefaultProps };","import React from 'react';\nimport { connect } from 'react-redux';\nimport Status from 'flavours/glitch/components/status';\nimport { makeGetStatus } from 'flavours/glitch/selectors';\nimport {\n replyCompose,\n mentionCompose,\n directCompose,\n} from 'flavours/glitch/actions/compose';\nimport {\n reblog,\n favourite,\n bookmark,\n unreblog,\n unfavourite,\n unbookmark,\n pin,\n unpin,\n} from 'flavours/glitch/actions/interactions';\nimport { blockAccount } from 'flavours/glitch/actions/accounts';\nimport { muteStatus, unmuteStatus, deleteStatus } from 'flavours/glitch/actions/statuses';\nimport { initMuteModal } from 'flavours/glitch/actions/mutes';\nimport { initReport } from 'flavours/glitch/actions/reports';\nimport { openModal } from 'flavours/glitch/actions/modal';\nimport { changeLocalSetting } from 'flavours/glitch/actions/local_settings';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport { boostModal, favouriteModal, deleteModal } from 'flavours/glitch/util/initial_state';\nimport { showAlertForError } from '../actions/alerts';\n\nconst messages = defineMessages({\n deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },\n deleteMessage: { id: 'confirmations.delete.message', defaultMessage: 'Are you sure you want to delete this status?' },\n redraftConfirm: { id: 'confirmations.redraft.confirm', defaultMessage: 'Delete & redraft' },\n redraftMessage: { id: 'confirmations.redraft.message', defaultMessage: 'Are you sure you want to delete this status and re-draft it? You will lose all replies, boosts and favourites to it.' },\n blockConfirm: { id: 'confirmations.block.confirm', defaultMessage: 'Block' },\n replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },\n replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },\n blockAndReport: { id: 'confirmations.block.block_and_report', defaultMessage: 'Block & Report' },\n});\n\nconst makeMapStateToProps = () => {\n const getStatus = makeGetStatus();\n\n const mapStateToProps = (state, props) => {\n\n let status = getStatus(state, props);\n let reblogStatus = status ? status.get('reblog', null) : null;\n let account = undefined;\n let prepend = undefined;\n\n if (props.featured) {\n account = status.get('account');\n prepend = 'featured';\n } else if (reblogStatus !== null && typeof reblogStatus === 'object') {\n account = status.get('account');\n status = reblogStatus;\n prepend = 'reblogged_by';\n }\n\n return {\n containerId : props.containerId || props.id, // Should match reblogStatus's id for reblogs\n status : status,\n account : account || props.account,\n settings : state.get('local_settings'),\n prepend : prepend || props.prepend,\n };\n };\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { intl }) => ({\n\n onReply (status, router) {\n dispatch((_, getState) => {\n let state = getState();\n if (state.getIn(['local_settings', 'confirm_before_clearing_draft']) && state.getIn(['compose', 'text']).trim().length !== 0) {\n dispatch(openModal('CONFIRM', {\n message: intl.formatMessage(messages.replyMessage),\n confirm: intl.formatMessage(messages.replyConfirm),\n onDoNotAsk: () => dispatch(changeLocalSetting(['confirm_before_clearing_draft'], false)),\n onConfirm: () => dispatch(replyCompose(status, router)),\n }));\n } else {\n dispatch(replyCompose(status, router));\n }\n });\n },\n\n onModalReblog (status) {\n dispatch(reblog(status));\n },\n\n onReblog (status, e) {\n if (status.get('reblogged')) {\n dispatch(unreblog(status));\n } else {\n if (e.shiftKey || !boostModal) {\n this.onModalReblog(status);\n } else {\n dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog }));\n }\n }\n },\n\n onBookmark (status) {\n if (status.get('bookmarked')) {\n dispatch(unbookmark(status));\n } else {\n dispatch(bookmark(status));\n }\n },\n\n onModalFavourite (status) {\n dispatch(favourite(status));\n },\n\n onFavourite (status, e) {\n if (status.get('favourited')) {\n dispatch(unfavourite(status));\n } else {\n if (e.shiftKey || !favouriteModal) {\n this.onModalFavourite(status);\n } else {\n dispatch(openModal('FAVOURITE', { status, onFavourite: this.onModalFavourite }));\n }\n }\n },\n\n onPin (status) {\n if (status.get('pinned')) {\n dispatch(unpin(status));\n } else {\n dispatch(pin(status));\n }\n },\n\n onEmbed (status) {\n dispatch(openModal('EMBED', {\n url: status.get('url'),\n onError: error => dispatch(showAlertForError(error)),\n }));\n },\n\n onDelete (status, history, withRedraft = false) {\n if (!deleteModal) {\n dispatch(deleteStatus(status.get('id'), history, withRedraft));\n } else {\n dispatch(openModal('CONFIRM', {\n message: intl.formatMessage(withRedraft ? messages.redraftMessage : messages.deleteMessage),\n confirm: intl.formatMessage(withRedraft ? messages.redraftConfirm : messages.deleteConfirm),\n onConfirm: () => dispatch(deleteStatus(status.get('id'), history, withRedraft)),\n }));\n }\n },\n\n onDirect (account, router) {\n dispatch(directCompose(account, router));\n },\n\n onMention (account, router) {\n dispatch(mentionCompose(account, router));\n },\n\n onOpenMedia (media, index) {\n dispatch(openModal('MEDIA', { media, index }));\n },\n\n onOpenVideo (media, time) {\n dispatch(openModal('VIDEO', { media, time }));\n },\n\n onBlock (status) {\n const account = status.get('account');\n dispatch(openModal('CONFIRM', {\n message: @{account.get('acct')} }} />,\n confirm: intl.formatMessage(messages.blockConfirm),\n onConfirm: () => dispatch(blockAccount(account.get('id'))),\n secondary: intl.formatMessage(messages.blockAndReport),\n onSecondary: () => {\n dispatch(blockAccount(account.get('id')));\n dispatch(initReport(account, status));\n },\n }));\n },\n\n onReport (status) {\n dispatch(initReport(status.get('account'), status));\n },\n\n onMute (account) {\n dispatch(initMuteModal(account));\n },\n\n onMuteConversation (status) {\n if (status.get('muted')) {\n dispatch(unmuteStatus(status.get('id')));\n } else {\n dispatch(muteStatus(status.get('id')));\n }\n },\n\n});\n\nexport default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status));\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport PropTypes from 'prop-types';\n\nexport default class LoadMore extends React.PureComponent {\n\n static propTypes = {\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n visible: PropTypes.bool,\n }\n\n static defaultProps = {\n visible: true,\n }\n\n render() {\n const { disabled, visible } = this.props;\n\n return (\n \n \n \n );\n }\n\n}\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\n\nconst MissingIndicator = () => (\n \n);\n\nexport default MissingIndicator;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ColumnHeader from '../../../components/column_header';\nimport { injectIntl, defineMessages } from 'react-intl';\n\nconst messages = defineMessages({\n profile: { id: 'column_header.profile', defaultMessage: 'Profile' },\n});\n\nexport default @injectIntl\nclass ProfileColumnHeader extends React.PureComponent {\n\n static propTypes = {\n onClick: PropTypes.func,\n intl: PropTypes.object.isRequired,\n };\n\n render() {\n const { onClick, intl } = this.props;\n\n return (\n \n );\n }\n\n}\n","import { debounce } from 'lodash';\nimport React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport StatusContainer from '../containers/status_container';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport LoadGap from './load_gap';\nimport ScrollableList from './scrollable_list';\n\nexport default class StatusList extends ImmutablePureComponent {\n\n static propTypes = {\n scrollKey: PropTypes.string.isRequired,\n statusIds: ImmutablePropTypes.list.isRequired,\n featuredStatusIds: ImmutablePropTypes.list,\n onLoadMore: PropTypes.func,\n onScrollToTop: PropTypes.func,\n onScroll: PropTypes.func,\n trackScroll: PropTypes.bool,\n shouldUpdateScroll: PropTypes.func,\n isLoading: PropTypes.bool,\n isPartial: PropTypes.bool,\n hasMore: PropTypes.bool,\n prepend: PropTypes.node,\n emptyMessage: PropTypes.node,\n alwaysPrepend: PropTypes.bool,\n timelineId: PropTypes.string,\n };\n\n static defaultProps = {\n trackScroll: true,\n };\n\n getFeaturedStatusCount = () => {\n return this.props.featuredStatusIds ? this.props.featuredStatusIds.size : 0;\n }\n\n getCurrentStatusIndex = (id, featured) => {\n if (featured) {\n return this.props.featuredStatusIds.indexOf(id);\n } else {\n return this.props.statusIds.indexOf(id) + this.getFeaturedStatusCount();\n }\n }\n\n handleMoveUp = (id, featured) => {\n const elementIndex = this.getCurrentStatusIndex(id, featured) - 1;\n this._selectChild(elementIndex);\n }\n\n handleMoveDown = (id, featured) => {\n const elementIndex = this.getCurrentStatusIndex(id, featured) + 1;\n this._selectChild(elementIndex);\n }\n\n handleLoadOlder = debounce(() => {\n this.props.onLoadMore(this.props.statusIds.size > 0 ? this.props.statusIds.last() : undefined);\n }, 300, { leading: true })\n\n _selectChild (index) {\n const element = this.node.node.querySelector(`article:nth-of-type(${index + 1}) .focusable`);\n\n if (element) {\n element.focus();\n }\n }\n\n setRef = c => {\n this.node = c;\n }\n\n render () {\n const { statusIds, featuredStatusIds, shouldUpdateScroll, onLoadMore, timelineId, ...other } = this.props;\n const { isLoading, isPartial } = other;\n\n if (isPartial) {\n return (\n \n );\n }\n\n let scrollableContent = (isLoading || statusIds.size > 0) ? (\n statusIds.map((statusId, index) => statusId === null ? (\n 0 ? statusIds.get(index - 1) : null}\n onClick={onLoadMore}\n />\n ) : (\n \n ))\n ) : null;\n\n if (scrollableContent && featuredStatusIds) {\n scrollableContent = featuredStatusIds.map(statusId => (\n \n )).concat(scrollableContent);\n }\n\n return (\n \n {scrollableContent}\n \n );\n }\n\n}\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\n\nconst MissingIndicator = () => (\n \n);\n\nexport default MissingIndicator;\n","var _Object = Object;\nexport default _Object.getPrototypeOf || function (O) {\n O = Object(O);\n\n if (typeof O.constructor === 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n }\n\n return O instanceof Object ? Object.prototype : null;\n};","var _Object = Object;\nexport default (function createClass() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n\n _Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n})();","export default function possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === 'object' || typeof call === 'function') ? call : self;\n}","var _Object = Object;\nexport default function inherits(subClass, superClass) {\n if (typeof superClass !== 'function' && superClass !== null) {\n throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);\n }\n\n subClass.prototype = _Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n\n if (superClass) {\n _Object.setPrototypeOf ? _Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n }\n}","var NAMESPACE = 'emoji-mart';\nvar _JSON = JSON;\nvar isLocalStorageSupported = typeof window !== 'undefined' && 'localStorage' in window;\nvar getter = void 0;\nvar setter = void 0;\n\nfunction setHandlers(handlers) {\n handlers || (handlers = {});\n getter = handlers.getter;\n setter = handlers.setter;\n}\n\nfunction setNamespace(namespace) {\n NAMESPACE = namespace;\n}\n\nfunction update(state) {\n for (var key in state) {\n var value = state[key];\n set(key, value);\n }\n}\n\nfunction set(key, value) {\n if (setter) {\n setter(key, value);\n } else {\n if (!isLocalStorageSupported) return;\n\n try {\n window.localStorage[NAMESPACE + '.' + key] = _JSON.stringify(value);\n } catch (e) {}\n }\n}\n\nfunction get(key) {\n if (getter) {\n return getter(key);\n } else {\n if (!isLocalStorageSupported) return;\n\n try {\n var value = window.localStorage[NAMESPACE + '.' + key];\n } catch (e) {\n return;\n }\n\n if (value) {\n return JSON.parse(value);\n }\n }\n}\n\nexport default {\n update: update,\n set: set,\n get: get,\n setNamespace: setNamespace,\n setHandlers: setHandlers\n};","import store from './store';\nvar DEFAULTS = ['+1', 'grinning', 'kissing_heart', 'heart_eyes', 'laughing', 'stuck_out_tongue_winking_eye', 'sweat_smile', 'joy', 'scream', 'disappointed', 'unamused', 'weary', 'sob', 'sunglasses', 'heart', 'poop'];\nvar frequently = void 0,\n initialized = void 0;\nvar defaults = {};\n\nfunction init() {\n initialized = true;\n frequently = store.get('frequently');\n}\n\nfunction add(emoji) {\n if (!initialized) init();\n var id = emoji.id;\n frequently || (frequently = defaults);\n frequently[id] || (frequently[id] = 0);\n frequently[id] += 1;\n store.set('last', id);\n store.set('frequently', frequently);\n}\n\nfunction get(perLine) {\n if (!initialized) init();\n\n if (!frequently) {\n defaults = {};\n var result = [];\n\n for (var i = 0; i < perLine; i++) {\n defaults[DEFAULTS[i]] = perLine - i;\n result.push(DEFAULTS[i]);\n }\n\n return result;\n }\n\n var quantity = perLine * 4;\n var frequentlyKeys = [];\n\n for (var key in frequently) {\n if (frequently.hasOwnProperty(key)) {\n frequentlyKeys.push(key);\n }\n }\n\n var sorted = frequentlyKeys.sort(function (a, b) {\n return frequently[a] - frequently[b];\n }).reverse();\n var sliced = sorted.slice(0, quantity);\n var last = store.get('last');\n\n if (last && sliced.indexOf(last) == -1) {\n sliced.pop();\n sliced.push(last);\n }\n\n return sliced;\n}\n\nexport default {\n add: add,\n get: get\n};","var SVGs = {\n activity: \" \",\n custom: \" \",\n flags: \" \",\n foods: \" \",\n nature: \" \",\n objects: \" \",\n people: \" \",\n places: \" \",\n recent: \" \",\n symbols: \" \"\n};\nexport default SVGs;","import _Object$getPrototypeOf from '../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../polyfills/createClass';\nimport _possibleConstructorReturn from '../polyfills/possibleConstructorReturn';\nimport _inherits from '../polyfills/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport SVGs from '../svgs';\n\nvar Anchors = function (_React$PureComponent) {\n _inherits(Anchors, _React$PureComponent);\n\n function Anchors(props) {\n _classCallCheck(this, Anchors);\n\n var _this = _possibleConstructorReturn(this, (Anchors.__proto__ || _Object$getPrototypeOf(Anchors)).call(this, props));\n\n var defaultCategory = props.categories.filter(function (category) {\n return category.first;\n })[0];\n _this.state = {\n selected: defaultCategory.name\n };\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(Anchors, [{\n key: 'getSVG',\n value: function getSVG(id) {\n this.SVGs || (this.SVGs = {});\n\n if (this.SVGs[id]) {\n return this.SVGs[id];\n } else {\n var svg = '\\n ' + SVGs[id] + '\\n ';\n this.SVGs[id] = svg;\n return svg;\n }\n }\n }, {\n key: 'handleClick',\n value: function handleClick(e) {\n var index = e.currentTarget.getAttribute('data-index');\n var _props = this.props;\n var categories = _props.categories;\n var onAnchorClick = _props.onAnchorClick;\n onAnchorClick(categories[index], index);\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props2 = this.props;\n var categories = _props2.categories;\n var onAnchorClick = _props2.onAnchorClick;\n var color = _props2.color;\n var i18n = _props2.i18n;\n var selected = this.state.selected;\n return React.createElement('div', {\n className: 'emoji-mart-anchors'\n }, categories.map(function (category, i) {\n var id = category.id;\n var name = category.name;\n var anchor = category.anchor;\n var isSelected = name == selected;\n\n if (anchor === false) {\n return null;\n }\n\n return React.createElement('span', {\n key: id,\n title: i18n.categories[id],\n 'data-index': i,\n onClick: _this2.handleClick,\n className: 'emoji-mart-anchor ' + (isSelected ? 'emoji-mart-anchor-selected' : ''),\n style: {\n color: isSelected ? color : null\n }\n }, React.createElement('div', {\n dangerouslySetInnerHTML: {\n __html: _this2.getSVG(id)\n }\n }), React.createElement('span', {\n className: 'emoji-mart-anchor-bar',\n style: {\n backgroundColor: color\n }\n }));\n }));\n }\n }]);\n\n return Anchors;\n}(React.PureComponent);\n\nexport default Anchors;\nAnchors.defaultProps = {\n categories: [],\n onAnchorClick: function onAnchorClick() {}\n};","import _extends from '../polyfills/extends';\nimport _Object$getPrototypeOf from '../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../polyfills/createClass';\nimport _possibleConstructorReturn from '../polyfills/possibleConstructorReturn';\nimport _inherits from '../polyfills/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport frequently from '../utils/frequently';\nimport { getData } from '../utils';\nimport { NimbleEmoji } from '.';\n\nvar Category = function (_React$Component) {\n _inherits(Category, _React$Component);\n\n function Category(props) {\n _classCallCheck(this, Category);\n\n var _this = _possibleConstructorReturn(this, (Category.__proto__ || _Object$getPrototypeOf(Category)).call(this, props));\n\n _this.data = props.data;\n _this.setContainerRef = _this.setContainerRef.bind(_this);\n _this.setLabelRef = _this.setLabelRef.bind(_this);\n return _this;\n }\n\n _createClass(Category, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.parent = this.container.parentNode;\n this.margin = 0;\n this.minMargin = 0;\n this.memoizeSize();\n }\n }, {\n key: 'shouldComponentUpdate',\n value: function shouldComponentUpdate(nextProps, nextState) {\n var _props = this.props;\n var name = _props.name;\n var perLine = _props.perLine;\n var native = _props.native;\n var hasStickyPosition = _props.hasStickyPosition;\n var emojis = _props.emojis;\n var emojiProps = _props.emojiProps;\n var skin = emojiProps.skin;\n var size = emojiProps.size;\n var set = emojiProps.set;\n var nextPerLine = nextProps.perLine;\n var nextNative = nextProps.native;\n var nextHasStickyPosition = nextProps.hasStickyPosition;\n var nextEmojis = nextProps.emojis;\n var nextEmojiProps = nextProps.emojiProps;\n var nextSkin = nextEmojiProps.skin;\n var nextSize = nextEmojiProps.size;\n var nextSet = nextEmojiProps.set;\n var shouldUpdate = false;\n\n if (name == 'Recent' && perLine != nextPerLine) {\n shouldUpdate = true;\n }\n\n if (name == 'Search') {\n shouldUpdate = !(emojis == nextEmojis);\n }\n\n if (skin != nextSkin || size != nextSize || native != nextNative || set != nextSet || hasStickyPosition != nextHasStickyPosition) {\n shouldUpdate = true;\n }\n\n return shouldUpdate;\n }\n }, {\n key: 'memoizeSize',\n value: function memoizeSize() {\n var _container$getBoundin = this.container.getBoundingClientRect();\n\n var top = _container$getBoundin.top;\n var height = _container$getBoundin.height;\n\n var _parent$getBoundingCl = this.parent.getBoundingClientRect();\n\n var parentTop = _parent$getBoundingCl.top;\n\n var _label$getBoundingCli = this.label.getBoundingClientRect();\n\n var labelHeight = _label$getBoundingCli.height;\n this.top = top - parentTop + this.parent.scrollTop;\n\n if (height == 0) {\n this.maxMargin = 0;\n } else {\n this.maxMargin = height - labelHeight;\n }\n }\n }, {\n key: 'handleScroll',\n value: function handleScroll(scrollTop) {\n var margin = scrollTop - this.top;\n margin = margin < this.minMargin ? this.minMargin : margin;\n margin = margin > this.maxMargin ? this.maxMargin : margin;\n if (margin == this.margin) return;\n\n if (!this.props.hasStickyPosition) {\n this.label.style.top = margin + 'px';\n }\n\n this.margin = margin;\n return true;\n }\n }, {\n key: 'getEmojis',\n value: function getEmojis() {\n var _this2 = this;\n\n var _props2 = this.props;\n var name = _props2.name;\n var emojis = _props2.emojis;\n var recent = _props2.recent;\n var perLine = _props2.perLine;\n\n if (name == 'Recent') {\n var custom = this.props.custom;\n var frequentlyUsed = recent || frequently.get(perLine);\n\n if (frequentlyUsed.length) {\n emojis = frequentlyUsed.map(function (id) {\n var emoji = custom.filter(function (e) {\n return e.id === id;\n })[0];\n\n if (emoji) {\n return emoji;\n }\n\n return id;\n }).filter(function (id) {\n return !!getData(id, null, null, _this2.data);\n });\n }\n\n if (emojis.length === 0 && frequentlyUsed.length > 0) {\n return null;\n }\n }\n\n if (emojis) {\n emojis = emojis.slice(0);\n }\n\n return emojis;\n }\n }, {\n key: 'updateDisplay',\n value: function updateDisplay(display) {\n var emojis = this.getEmojis();\n\n if (!emojis) {\n return;\n }\n\n this.container.style.display = display;\n }\n }, {\n key: 'setContainerRef',\n value: function setContainerRef(c) {\n this.container = c;\n }\n }, {\n key: 'setLabelRef',\n value: function setLabelRef(c) {\n this.label = c;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this3 = this;\n\n var _props3 = this.props;\n var id = _props3.id;\n var name = _props3.name;\n var hasStickyPosition = _props3.hasStickyPosition;\n var emojiProps = _props3.emojiProps;\n var i18n = _props3.i18n;\n var emojis = this.getEmojis();\n var labelStyles = {};\n var labelSpanStyles = {};\n var containerStyles = {};\n\n if (!emojis) {\n containerStyles = {\n display: 'none'\n };\n }\n\n if (!hasStickyPosition) {\n labelStyles = {\n height: 28\n };\n labelSpanStyles = {\n position: 'absolute'\n };\n }\n\n return React.createElement('div', {\n ref: this.setContainerRef,\n className: 'emoji-mart-category ' + (emojis && !emojis.length ? 'emoji-mart-no-results' : ''),\n style: containerStyles\n }, React.createElement('div', {\n style: labelStyles,\n 'data-name': name,\n className: 'emoji-mart-category-label'\n }, React.createElement('span', {\n style: labelSpanStyles,\n ref: this.setLabelRef\n }, i18n.categories[id])), emojis && emojis.map(function (emoji) {\n return NimbleEmoji(_extends({\n emoji: emoji,\n data: _this3.data\n }, emojiProps));\n }), emojis && !emojis.length && React.createElement('div', null, React.createElement('div', null, NimbleEmoji(_extends({\n data: this.data\n }, emojiProps, {\n size: 38,\n emoji: 'sleuth_or_spy',\n onOver: null,\n onLeave: null,\n onClick: null\n }))), React.createElement('div', {\n className: 'emoji-mart-no-results-label'\n }, i18n.notfound)));\n }\n }]);\n\n return Category;\n}(React.Component);\n\nexport default Category;\nCategory.defaultProps = {\n emojis: [],\n hasStickyPosition: true\n};","import _extends from '../polyfills/extends';\nimport _Object$getPrototypeOf from '../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../polyfills/createClass';\nimport _possibleConstructorReturn from '../polyfills/possibleConstructorReturn';\nimport _inherits from '../polyfills/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { getData } from '../utils';\nimport { NimbleEmoji, Skins } from '.';\n\nvar Preview = function (_React$PureComponent) {\n _inherits(Preview, _React$PureComponent);\n\n function Preview(props) {\n _classCallCheck(this, Preview);\n\n var _this = _possibleConstructorReturn(this, (Preview.__proto__ || _Object$getPrototypeOf(Preview)).call(this, props));\n\n _this.data = props.data;\n _this.state = {\n emoji: null\n };\n return _this;\n }\n\n _createClass(Preview, [{\n key: 'render',\n value: function render() {\n var emoji = this.state.emoji;\n var _props = this.props;\n var emojiProps = _props.emojiProps;\n var skinsProps = _props.skinsProps;\n var showSkinTones = _props.showSkinTones;\n var title = _props.title;\n var idleEmoji = _props.emoji;\n\n if (emoji) {\n var emojiData = getData(emoji, null, null, this.data);\n var _emojiData$emoticons = emojiData.emoticons;\n var emoticons = _emojiData$emoticons === undefined ? [] : _emojiData$emoticons;\n var knownEmoticons = [];\n var listedEmoticons = [];\n emoticons.forEach(function (emoticon) {\n if (knownEmoticons.indexOf(emoticon.toLowerCase()) >= 0) {\n return;\n }\n\n knownEmoticons.push(emoticon.toLowerCase());\n listedEmoticons.push(emoticon);\n });\n return React.createElement('div', {\n className: 'emoji-mart-preview'\n }, React.createElement('div', {\n className: 'emoji-mart-preview-emoji'\n }, NimbleEmoji(_extends({\n key: emoji.id,\n emoji: emoji,\n data: this.data\n }, emojiProps))), React.createElement('div', {\n className: 'emoji-mart-preview-data'\n }, React.createElement('div', {\n className: 'emoji-mart-preview-name'\n }, emoji.name), React.createElement('div', {\n className: 'emoji-mart-preview-shortnames'\n }, emojiData.short_names.map(function (short_name) {\n return React.createElement('span', {\n key: short_name,\n className: 'emoji-mart-preview-shortname'\n }, ':', short_name, ':');\n })), React.createElement('div', {\n className: 'emoji-mart-preview-emoticons'\n }, listedEmoticons.map(function (emoticon) {\n return React.createElement('span', {\n key: emoticon,\n className: 'emoji-mart-preview-emoticon'\n }, emoticon);\n }))));\n } else {\n return React.createElement('div', {\n className: 'emoji-mart-preview'\n }, React.createElement('div', {\n className: 'emoji-mart-preview-emoji'\n }, idleEmoji && idleEmoji.length && NimbleEmoji(_extends({\n emoji: idleEmoji,\n data: this.data\n }, emojiProps))), React.createElement('div', {\n className: 'emoji-mart-preview-data'\n }, React.createElement('span', {\n className: 'emoji-mart-title-label'\n }, title)), showSkinTones && React.createElement('div', {\n className: 'emoji-mart-preview-skins'\n }, React.createElement(Skins, skinsProps)));\n }\n }\n }]);\n\n return Preview;\n}(React.PureComponent);\n\nexport default Preview;\nPreview.defaultProps = {\n showSkinTones: true,\n onChange: function onChange() {}\n};","import _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../../polyfills/createClass';\nimport { getData, getSanitizedData, intersect } from '..';\nimport { uncompress } from '../data';\n\nvar NimbleEmojiIndex = function () {\n function NimbleEmojiIndex(data) {\n _classCallCheck(this, NimbleEmojiIndex);\n\n if (data.compressed) {\n uncompress(data);\n }\n\n this.data = data || {};\n this.originalPool = {};\n this.index = {};\n this.emojis = {};\n this.emoticons = {};\n this.customEmojisList = [];\n this.buildIndex();\n }\n\n _createClass(NimbleEmojiIndex, [{\n key: 'buildIndex',\n value: function buildIndex() {\n var _this = this;\n\n var _loop = function _loop(emoji) {\n var emojiData = _this.data.emojis[emoji];\n var short_names = emojiData.short_names;\n var emoticons = emojiData.emoticons;\n var id = short_names[0];\n\n if (emoticons) {\n emoticons.forEach(function (emoticon) {\n if (_this.emoticons[emoticon]) {\n return;\n }\n\n _this.emoticons[emoticon] = id;\n });\n }\n\n _this.emojis[id] = getSanitizedData(id, null, null, _this.data);\n _this.originalPool[id] = emojiData;\n };\n\n for (var emoji in this.data.emojis) {\n _loop(emoji);\n }\n }\n }, {\n key: 'clearCustomEmojis',\n value: function clearCustomEmojis(pool) {\n var _this2 = this;\n\n this.customEmojisList.forEach(function (emoji) {\n var emojiId = emoji.id || emoji.short_names[0];\n delete pool[emojiId];\n delete _this2.emojis[emojiId];\n });\n }\n }, {\n key: 'addCustomToPool',\n value: function addCustomToPool(custom, pool) {\n var _this3 = this;\n\n if (this.customEmojisList.length) this.clearCustomEmojis(pool);\n custom.forEach(function (emoji) {\n var emojiId = emoji.id || emoji.short_names[0];\n\n if (emojiId && !pool[emojiId]) {\n pool[emojiId] = getData(emoji, null, null, _this3.data);\n _this3.emojis[emojiId] = getSanitizedData(emoji, null, null, _this3.data);\n }\n });\n this.customEmojisList = custom;\n this.index = {};\n }\n }, {\n key: 'search',\n value: function search(value) {\n var _this4 = this;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var emojisToShowFilter = _ref.emojisToShowFilter;\n var maxResults = _ref.maxResults;\n var include = _ref.include;\n var exclude = _ref.exclude;\n var _ref$custom = _ref.custom;\n var custom = _ref$custom === undefined ? [] : _ref$custom;\n if (this.customEmojisList != custom) this.addCustomToPool(custom, this.originalPool);\n maxResults || (maxResults = 75);\n include || (include = []);\n exclude || (exclude = []);\n var results = null,\n pool = this.originalPool;\n\n if (value.length) {\n if (value == '-' || value == '-1') {\n return [this.emojis['-1']];\n }\n\n var values = value.toLowerCase().split(/[\\s|,|\\-|_]+/),\n allResults = [];\n\n if (values.length > 2) {\n values = [values[0], values[1]];\n }\n\n if (include.length || exclude.length) {\n pool = {};\n this.data.categories.forEach(function (category) {\n var isIncluded = include && include.length ? include.indexOf(category.id) > -1 : true;\n var isExcluded = exclude && exclude.length ? exclude.indexOf(category.id) > -1 : false;\n\n if (!isIncluded || isExcluded) {\n return;\n }\n\n category.emojis.forEach(function (emojiId) {\n return pool[emojiId] = _this4.data.emojis[emojiId];\n });\n });\n\n if (custom.length) {\n var customIsIncluded = include && include.length ? include.indexOf('custom') > -1 : true;\n var customIsExcluded = exclude && exclude.length ? exclude.indexOf('custom') > -1 : false;\n\n if (customIsIncluded && !customIsExcluded) {\n this.addCustomToPool(custom, pool);\n }\n }\n }\n\n allResults = values.map(function (value) {\n var aPool = pool,\n aIndex = _this4.index,\n length = 0;\n\n for (var charIndex = 0; charIndex < value.length; charIndex++) {\n var char = value[charIndex];\n length++;\n aIndex[char] || (aIndex[char] = {});\n aIndex = aIndex[char];\n\n if (!aIndex.results) {\n (function () {\n var scores = {};\n aIndex.results = [];\n aIndex.pool = {};\n\n for (var _id in aPool) {\n var emoji = aPool[_id];\n var search = emoji.search;\n var sub = value.substr(0, length);\n var subIndex = search.indexOf(sub);\n\n if (subIndex != -1) {\n var score = subIndex + 1;\n if (sub == _id) score = 0;\n aIndex.results.push(_this4.emojis[_id]);\n aIndex.pool[_id] = emoji;\n scores[_id] = score;\n }\n }\n\n aIndex.results.sort(function (a, b) {\n var aScore = scores[a.id],\n bScore = scores[b.id];\n return aScore - bScore;\n });\n })();\n }\n\n aPool = aIndex.pool;\n }\n\n return aIndex.results;\n }).filter(function (a) {\n return a;\n });\n\n if (allResults.length > 1) {\n results = intersect.apply(null, allResults);\n } else if (allResults.length) {\n results = allResults[0];\n } else {\n results = [];\n }\n }\n\n if (results) {\n if (emojisToShowFilter) {\n results = results.filter(function (result) {\n return emojisToShowFilter(pool[result.id]);\n });\n }\n\n if (results && results.length > maxResults) {\n results = results.slice(0, maxResults);\n }\n }\n\n return results;\n }\n }]);\n\n return NimbleEmojiIndex;\n}();\n\nexport default NimbleEmojiIndex;","import _Object$getPrototypeOf from '../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../polyfills/createClass';\nimport _possibleConstructorReturn from '../polyfills/possibleConstructorReturn';\nimport _inherits from '../polyfills/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport NimbleEmojiIndex from '../utils/emoji-index/nimble-emoji-index';\n\nvar Search = function (_React$PureComponent) {\n _inherits(Search, _React$PureComponent);\n\n function Search(props) {\n _classCallCheck(this, Search);\n\n var _this = _possibleConstructorReturn(this, (Search.__proto__ || _Object$getPrototypeOf(Search)).call(this, props));\n\n _this.data = props.data;\n _this.emojiIndex = new NimbleEmojiIndex(_this.data);\n _this.setRef = _this.setRef.bind(_this);\n _this.handleChange = _this.handleChange.bind(_this);\n return _this;\n }\n\n _createClass(Search, [{\n key: 'handleChange',\n value: function handleChange() {\n var value = this.input.value;\n this.props.onSearch(this.emojiIndex.search(value, {\n emojisToShowFilter: this.props.emojisToShowFilter,\n maxResults: this.props.maxResults,\n include: this.props.include,\n exclude: this.props.exclude,\n custom: this.props.custom\n }));\n }\n }, {\n key: 'setRef',\n value: function setRef(c) {\n this.input = c;\n }\n }, {\n key: 'clear',\n value: function clear() {\n this.input.value = '';\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props;\n var i18n = _props.i18n;\n var autoFocus = _props.autoFocus;\n return React.createElement('div', {\n className: 'emoji-mart-search'\n }, React.createElement('input', {\n ref: this.setRef,\n type: 'text',\n onChange: this.handleChange,\n placeholder: i18n.search,\n autoFocus: autoFocus\n }));\n }\n }]);\n\n return Search;\n}(React.PureComponent);\n\nexport default Search;\nSearch.defaultProps = {\n onSearch: function onSearch() {},\n maxResults: 75,\n emojisToShowFilter: null,\n autoFocus: false\n};","import _Object$getPrototypeOf from '../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../polyfills/createClass';\nimport _possibleConstructorReturn from '../polyfills/possibleConstructorReturn';\nimport _inherits from '../polyfills/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nvar Skins = function (_React$PureComponent) {\n _inherits(Skins, _React$PureComponent);\n\n function Skins(props) {\n _classCallCheck(this, Skins);\n\n var _this = _possibleConstructorReturn(this, (Skins.__proto__ || _Object$getPrototypeOf(Skins)).call(this, props));\n\n _this.state = {\n opened: false\n };\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(Skins, [{\n key: 'handleClick',\n value: function handleClick(e) {\n var skin = parseInt(e.currentTarget.getAttribute('data-skin'));\n var onChange = this.props.onChange;\n\n if (!this.state.opened) {\n this.setState({\n opened: true\n });\n } else {\n this.setState({\n opened: false\n });\n\n if (skin != this.props.skin) {\n onChange(skin);\n }\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var skin = this.props.skin;\n var opened = this.state.opened;\n var skinToneNodes = [];\n\n for (var i = 0; i < 6; i++) {\n var skinTone = i + 1;\n var selected = skinTone == skin;\n skinToneNodes.push(React.createElement('span', {\n key: 'skin-tone-' + skinTone,\n className: 'emoji-mart-skin-swatch ' + (selected ? 'emoji-mart-skin-swatch-selected' : '')\n }, React.createElement('span', {\n onClick: this.handleClick,\n 'data-skin': skinTone,\n className: 'emoji-mart-skin emoji-mart-skin-tone-' + skinTone\n })));\n }\n\n return React.createElement('div', null, React.createElement('div', {\n className: 'emoji-mart-skin-swatches ' + (opened ? 'emoji-mart-skin-swatches-opened' : '')\n }, skinToneNodes));\n }\n }]);\n\n return Skins;\n}(React.PureComponent);\n\nexport default Skins;\nSkins.defaultProps = {\n onChange: function onChange() {}\n};","import _extends from '../../polyfills/extends';\nimport _Object$getPrototypeOf from '../../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../../polyfills/createClass';\nimport _possibleConstructorReturn from '../../polyfills/possibleConstructorReturn';\nimport _inherits from '../../polyfills/inherits';\nimport '../../vendor/raf-polyfill';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport store from '../../utils/store';\nimport frequently from '../../utils/frequently';\nimport { deepMerge, measureScrollbar } from '../../utils';\nimport { uncompress } from '../../utils/data';\nimport { PickerPropTypes, PickerDefaultProps } from '../../utils/shared-props';\nimport { Anchors, Category, Preview, Search } from '..';\nvar I18N = {\n search: 'Search',\n notfound: 'No Emoji Found',\n categories: {\n search: 'Search Results',\n recent: 'Frequently Used',\n people: 'Smileys & People',\n nature: 'Animals & Nature',\n foods: 'Food & Drink',\n activity: 'Activity',\n places: 'Travel & Places',\n objects: 'Objects',\n symbols: 'Symbols',\n flags: 'Flags',\n custom: 'Custom'\n }\n};\n\nvar NimblePicker = function (_React$PureComponent) {\n _inherits(NimblePicker, _React$PureComponent);\n\n function NimblePicker(props) {\n _classCallCheck(this, NimblePicker);\n\n var _this = _possibleConstructorReturn(this, (NimblePicker.__proto__ || _Object$getPrototypeOf(NimblePicker)).call(this, props));\n\n _this.RECENT_CATEGORY = {\n id: 'recent',\n name: 'Recent',\n emojis: null\n };\n _this.CUSTOM_CATEGORY = {\n id: 'custom',\n name: 'Custom',\n emojis: []\n };\n _this.SEARCH_CATEGORY = {\n id: 'search',\n name: 'Search',\n emojis: null,\n anchor: false\n };\n\n if (props.data.compressed) {\n uncompress(props.data);\n }\n\n _this.data = props.data;\n _this.i18n = deepMerge(I18N, props.i18n);\n _this.state = {\n skin: props.skin || store.get('skin') || props.defaultSkin,\n firstRender: true\n };\n _this.categories = [];\n var allCategories = [].concat(_this.data.categories);\n\n if (props.custom.length > 0) {\n _this.CUSTOM_CATEGORY.emojis = props.custom.map(function (emoji) {\n return _extends({}, emoji, {\n // ` ` expects emoji to have an `id`.\n id: emoji.short_names[0],\n custom: true\n });\n });\n allCategories.push(_this.CUSTOM_CATEGORY);\n }\n\n _this.hideRecent = true;\n\n if (props.include != undefined) {\n allCategories.sort(function (a, b) {\n if (props.include.indexOf(a.id) > props.include.indexOf(b.id)) {\n return 1;\n }\n\n return -1;\n });\n }\n\n for (var categoryIndex = 0; categoryIndex < allCategories.length; categoryIndex++) {\n var category = allCategories[categoryIndex];\n var isIncluded = props.include && props.include.length ? props.include.indexOf(category.id) > -1 : true;\n var isExcluded = props.exclude && props.exclude.length ? props.exclude.indexOf(category.id) > -1 : false;\n\n if (!isIncluded || isExcluded) {\n continue;\n }\n\n if (props.emojisToShowFilter) {\n var newEmojis = [];\n var emojis = category.emojis;\n\n for (var emojiIndex = 0; emojiIndex < emojis.length; emojiIndex++) {\n var emoji = emojis[emojiIndex];\n\n if (props.emojisToShowFilter(_this.data.emojis[emoji] || emoji)) {\n newEmojis.push(emoji);\n }\n }\n\n if (newEmojis.length) {\n var newCategory = {\n emojis: newEmojis,\n name: category.name,\n id: category.id\n };\n\n _this.categories.push(newCategory);\n }\n } else {\n _this.categories.push(category);\n }\n }\n\n var includeRecent = props.include && props.include.length ? props.include.indexOf(_this.RECENT_CATEGORY.id) > -1 : true;\n var excludeRecent = props.exclude && props.exclude.length ? props.exclude.indexOf(_this.RECENT_CATEGORY.id) > -1 : false;\n\n if (includeRecent && !excludeRecent) {\n _this.hideRecent = false;\n\n _this.categories.unshift(_this.RECENT_CATEGORY);\n }\n\n if (_this.categories[0]) {\n _this.categories[0].first = true;\n }\n\n _this.categories.unshift(_this.SEARCH_CATEGORY);\n\n _this.setAnchorsRef = _this.setAnchorsRef.bind(_this);\n _this.handleAnchorClick = _this.handleAnchorClick.bind(_this);\n _this.setSearchRef = _this.setSearchRef.bind(_this);\n _this.handleSearch = _this.handleSearch.bind(_this);\n _this.setScrollRef = _this.setScrollRef.bind(_this);\n _this.handleScroll = _this.handleScroll.bind(_this);\n _this.handleScrollPaint = _this.handleScrollPaint.bind(_this);\n _this.handleEmojiOver = _this.handleEmojiOver.bind(_this);\n _this.handleEmojiLeave = _this.handleEmojiLeave.bind(_this);\n _this.handleEmojiClick = _this.handleEmojiClick.bind(_this);\n _this.handleEmojiSelect = _this.handleEmojiSelect.bind(_this);\n _this.setPreviewRef = _this.setPreviewRef.bind(_this);\n _this.handleSkinChange = _this.handleSkinChange.bind(_this);\n _this.handleKeyDown = _this.handleKeyDown.bind(_this);\n return _this;\n }\n\n _createClass(NimblePicker, [{\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(props) {\n if (props.skin) {\n this.setState({\n skin: props.skin\n });\n } else if (props.defaultSkin && !store.get('skin')) {\n this.setState({\n skin: props.defaultSkin\n });\n }\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n if (this.state.firstRender) {\n this.testStickyPosition();\n this.firstRenderTimeout = setTimeout(function () {\n _this2.setState({\n firstRender: false\n });\n }, 60);\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n this.updateCategoriesSize();\n this.handleScroll();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.SEARCH_CATEGORY.emojis = null;\n clearTimeout(this.leaveTimeout);\n clearTimeout(this.firstRenderTimeout);\n }\n }, {\n key: 'testStickyPosition',\n value: function testStickyPosition() {\n var stickyTestElement = document.createElement('div');\n var prefixes = ['', '-webkit-', '-ms-', '-moz-', '-o-'];\n prefixes.forEach(function (prefix) {\n return stickyTestElement.style.position = prefix + 'sticky';\n });\n this.hasStickyPosition = !!stickyTestElement.style.position.length;\n }\n }, {\n key: 'handleEmojiOver',\n value: function handleEmojiOver(emoji) {\n var preview = this.preview;\n\n if (!preview) {\n return;\n } // Use Array.prototype.find() when it is more widely supported.\n\n\n var emojiData = this.CUSTOM_CATEGORY.emojis.filter(function (customEmoji) {\n return customEmoji.id === emoji.id;\n })[0];\n\n for (var key in emojiData) {\n if (emojiData.hasOwnProperty(key)) {\n emoji[key] = emojiData[key];\n }\n }\n\n preview.setState({\n emoji: emoji\n });\n clearTimeout(this.leaveTimeout);\n }\n }, {\n key: 'handleEmojiLeave',\n value: function handleEmojiLeave(emoji) {\n var preview = this.preview;\n\n if (!preview) {\n return;\n }\n\n this.leaveTimeout = setTimeout(function () {\n preview.setState({\n emoji: null\n });\n }, 16);\n }\n }, {\n key: 'handleEmojiClick',\n value: function handleEmojiClick(emoji, e) {\n this.props.onClick(emoji, e);\n this.handleEmojiSelect(emoji);\n }\n }, {\n key: 'handleEmojiSelect',\n value: function handleEmojiSelect(emoji) {\n var _this3 = this;\n\n this.props.onSelect(emoji);\n if (!this.hideRecent && !this.props.recent) frequently.add(emoji);\n var component = this.categoryRefs['category-1'];\n\n if (component) {\n var maxMargin = component.maxMargin;\n component.forceUpdate();\n window.requestAnimationFrame(function () {\n if (!_this3.scroll) return;\n component.memoizeSize();\n if (maxMargin == component.maxMargin) return;\n\n _this3.updateCategoriesSize();\n\n _this3.handleScrollPaint();\n\n if (_this3.SEARCH_CATEGORY.emojis) {\n component.updateDisplay('none');\n }\n });\n }\n }\n }, {\n key: 'handleScroll',\n value: function handleScroll() {\n if (!this.waitingForPaint) {\n this.waitingForPaint = true;\n window.requestAnimationFrame(this.handleScrollPaint);\n }\n }\n }, {\n key: 'handleScrollPaint',\n value: function handleScrollPaint() {\n this.waitingForPaint = false;\n\n if (!this.scroll) {\n return;\n }\n\n var activeCategory = null;\n\n if (this.SEARCH_CATEGORY.emojis) {\n activeCategory = this.SEARCH_CATEGORY;\n } else {\n var target = this.scroll,\n scrollTop = target.scrollTop,\n scrollingDown = scrollTop > (this.scrollTop || 0),\n minTop = 0;\n\n for (var i = 0, l = this.categories.length; i < l; i++) {\n var ii = scrollingDown ? this.categories.length - 1 - i : i,\n category = this.categories[ii],\n component = this.categoryRefs['category-' + ii];\n\n if (component) {\n var active = component.handleScroll(scrollTop);\n\n if (!minTop || component.top < minTop) {\n if (component.top > 0) {\n minTop = component.top;\n }\n }\n\n if (active && !activeCategory) {\n activeCategory = category;\n }\n }\n }\n\n if (scrollTop < minTop) {\n activeCategory = this.categories.filter(function (category) {\n return !(category.anchor === false);\n })[0];\n } else if (scrollTop + this.clientHeight >= this.scrollHeight) {\n activeCategory = this.categories[this.categories.length - 1];\n }\n }\n\n if (activeCategory) {\n var anchors = this.anchors;\n var _activeCategory = activeCategory;\n var categoryName = _activeCategory.name;\n\n if (anchors.state.selected != categoryName) {\n anchors.setState({\n selected: categoryName\n });\n }\n }\n\n this.scrollTop = scrollTop;\n }\n }, {\n key: 'handleSearch',\n value: function handleSearch(emojis) {\n this.SEARCH_CATEGORY.emojis = emojis;\n\n for (var i = 0, l = this.categories.length; i < l; i++) {\n var component = this.categoryRefs['category-' + i];\n\n if (component && component.props.name != 'Search') {\n var display = emojis ? 'none' : 'inherit';\n component.updateDisplay(display);\n }\n }\n\n this.forceUpdate();\n this.scroll.scrollTop = 0;\n this.handleScroll();\n }\n }, {\n key: 'handleAnchorClick',\n value: function handleAnchorClick(category, i) {\n var component = this.categoryRefs['category-' + i];\n var scroll = this.scroll;\n var anchors = this.anchors;\n var scrollToComponent = null;\n\n scrollToComponent = function scrollToComponent() {\n if (component) {\n var top = component.top;\n\n if (category.first) {\n top = 0;\n } else {\n top += 1;\n }\n\n scroll.scrollTop = top;\n }\n };\n\n if (this.SEARCH_CATEGORY.emojis) {\n this.handleSearch(null);\n this.search.clear();\n window.requestAnimationFrame(scrollToComponent);\n } else {\n scrollToComponent();\n }\n }\n }, {\n key: 'handleSkinChange',\n value: function handleSkinChange(skin) {\n var newState = {\n skin: skin\n };\n var onSkinChange = this.props.onSkinChange;\n this.setState(newState);\n store.update(newState);\n onSkinChange(skin);\n }\n }, {\n key: 'handleKeyDown',\n value: function handleKeyDown(e) {\n var handled = false;\n\n switch (e.keyCode) {\n case 13:\n var emoji = void 0;\n\n if (this.SEARCH_CATEGORY.emojis && (emoji = this.SEARCH_CATEGORY.emojis[0])) {\n this.handleEmojiSelect(emoji);\n }\n\n handled = true;\n break;\n }\n\n if (handled) {\n e.preventDefault();\n }\n }\n }, {\n key: 'updateCategoriesSize',\n value: function updateCategoriesSize() {\n for (var i = 0, l = this.categories.length; i < l; i++) {\n var component = this.categoryRefs['category-' + i];\n if (component) component.memoizeSize();\n }\n\n if (this.scroll) {\n var target = this.scroll;\n this.scrollHeight = target.scrollHeight;\n this.clientHeight = target.clientHeight;\n }\n }\n }, {\n key: 'getCategories',\n value: function getCategories() {\n return this.state.firstRender ? this.categories.slice(0, 3) : this.categories;\n }\n }, {\n key: 'setAnchorsRef',\n value: function setAnchorsRef(c) {\n this.anchors = c;\n }\n }, {\n key: 'setSearchRef',\n value: function setSearchRef(c) {\n this.search = c;\n }\n }, {\n key: 'setPreviewRef',\n value: function setPreviewRef(c) {\n this.preview = c;\n }\n }, {\n key: 'setScrollRef',\n value: function setScrollRef(c) {\n this.scroll = c;\n }\n }, {\n key: 'setCategoryRef',\n value: function setCategoryRef(name, c) {\n if (!this.categoryRefs) {\n this.categoryRefs = {};\n }\n\n this.categoryRefs[name] = c;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this4 = this;\n\n var _props = this.props;\n var perLine = _props.perLine;\n var emojiSize = _props.emojiSize;\n var set = _props.set;\n var sheetSize = _props.sheetSize;\n var style = _props.style;\n var title = _props.title;\n var emoji = _props.emoji;\n var color = _props.color;\n var native = _props.native;\n var backgroundImageFn = _props.backgroundImageFn;\n var emojisToShowFilter = _props.emojisToShowFilter;\n var showPreview = _props.showPreview;\n var showSkinTones = _props.showSkinTones;\n var emojiTooltip = _props.emojiTooltip;\n var include = _props.include;\n var exclude = _props.exclude;\n var recent = _props.recent;\n var autoFocus = _props.autoFocus;\n var skin = this.state.skin;\n var width = perLine * (emojiSize + 12) + 12 + 2 + measureScrollbar();\n return React.createElement('div', {\n style: _extends({\n width: width\n }, style),\n className: 'emoji-mart',\n onKeyDown: this.handleKeyDown\n }, React.createElement('div', {\n className: 'emoji-mart-bar'\n }, React.createElement(Anchors, {\n ref: this.setAnchorsRef,\n data: this.data,\n i18n: this.i18n,\n color: color,\n categories: this.categories,\n onAnchorClick: this.handleAnchorClick\n })), React.createElement(Search, {\n ref: this.setSearchRef,\n onSearch: this.handleSearch,\n data: this.data,\n i18n: this.i18n,\n emojisToShowFilter: emojisToShowFilter,\n include: include,\n exclude: exclude,\n custom: this.CUSTOM_CATEGORY.emojis,\n autoFocus: autoFocus\n }), React.createElement('div', {\n ref: this.setScrollRef,\n className: 'emoji-mart-scroll',\n onScroll: this.handleScroll\n }, this.getCategories().map(function (category, i) {\n return React.createElement(Category, {\n ref: _this4.setCategoryRef.bind(_this4, 'category-' + i),\n key: category.name,\n id: category.id,\n name: category.name,\n emojis: category.emojis,\n perLine: perLine,\n native: native,\n hasStickyPosition: _this4.hasStickyPosition,\n data: _this4.data,\n i18n: _this4.i18n,\n recent: category.id == _this4.RECENT_CATEGORY.id ? recent : undefined,\n custom: category.id == _this4.RECENT_CATEGORY.id ? _this4.CUSTOM_CATEGORY.emojis : undefined,\n emojiProps: {\n native: native,\n skin: skin,\n size: emojiSize,\n set: set,\n sheetSize: sheetSize,\n forceSize: native,\n tooltip: emojiTooltip,\n backgroundImageFn: backgroundImageFn,\n onOver: _this4.handleEmojiOver,\n onLeave: _this4.handleEmojiLeave,\n onClick: _this4.handleEmojiClick\n }\n });\n })), showPreview && React.createElement('div', {\n className: 'emoji-mart-bar'\n }, React.createElement(Preview, {\n ref: this.setPreviewRef,\n data: this.data,\n title: title,\n emoji: emoji,\n showSkinTones: showSkinTones,\n emojiProps: {\n native: native,\n size: 38,\n skin: skin,\n set: set,\n sheetSize: sheetSize,\n backgroundImageFn: backgroundImageFn\n },\n skinsProps: {\n skin: skin,\n onChange: this.handleSkinChange\n }\n })));\n }\n }]);\n\n return NimblePicker;\n}(React.PureComponent);\n\nexport default NimblePicker;\nNimblePicker.defaultProps = _extends({}, PickerDefaultProps);","import _extends from '../../polyfills/extends';\nimport _Object$getPrototypeOf from '../../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../../polyfills/createClass';\nimport _possibleConstructorReturn from '../../polyfills/possibleConstructorReturn';\nimport _inherits from '../../polyfills/inherits';\nimport React from 'react';\nimport data from '../../../data/all.json';\nimport NimblePicker from './nimble-picker';\nimport { PickerPropTypes, PickerDefaultProps } from '../../utils/shared-props';\n\nvar Picker = function (_React$PureComponent) {\n _inherits(Picker, _React$PureComponent);\n\n function Picker() {\n _classCallCheck(this, Picker);\n\n return _possibleConstructorReturn(this, (Picker.__proto__ || _Object$getPrototypeOf(Picker)).apply(this, arguments));\n }\n\n _createClass(Picker, [{\n key: 'render',\n value: function render() {\n return React.createElement(NimblePicker, _extends({}, this.props, this.state));\n }\n }]);\n\n return Picker;\n}(React.PureComponent);\n\nexport default Picker;\nPicker.defaultProps = _extends({}, PickerDefaultProps, {\n data: data\n});","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { autoPlayGif, me, isStaff } from 'flavours/glitch/util/initial_state';\nimport classNames from 'classnames';\nimport Icon from 'flavours/glitch/components/icon';\nimport Avatar from 'flavours/glitch/components/avatar';\nimport Button from 'flavours/glitch/components/button';\nimport { shortNumberFormat } from 'flavours/glitch/util/numbers';\nimport { NavLink } from 'react-router-dom';\nimport DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container';\n\nconst messages = defineMessages({\n unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },\n follow: { id: 'account.follow', defaultMessage: 'Follow' },\n requested: { id: 'account.requested', defaultMessage: 'Awaiting approval. Click to cancel follow request' },\n unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },\n edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },\n linkVerifiedOn: { id: 'account.link_verified_on', defaultMessage: 'Ownership of this link was checked on {date}' },\n account_locked: { id: 'account.locked_info', defaultMessage: 'This account privacy status is set to locked. The owner manually reviews who can follow them.' },\n mention: { id: 'account.mention', defaultMessage: 'Mention @{name}' },\n direct: { id: 'account.direct', defaultMessage: 'Direct message @{name}' },\n edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },\n unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },\n unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' },\n block: { id: 'account.block', defaultMessage: 'Block @{name}' },\n mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' },\n report: { id: 'account.report', defaultMessage: 'Report @{name}' },\n share: { id: 'account.share', defaultMessage: 'Share @{name}\\'s profile' },\n media: { id: 'account.media', defaultMessage: 'Media' },\n blockDomain: { id: 'account.block_domain', defaultMessage: 'Hide everything from {domain}' },\n unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unhide {domain}' },\n hideReblogs: { id: 'account.hide_reblogs', defaultMessage: 'Hide boosts from @{name}' },\n showReblogs: { id: 'account.show_reblogs', defaultMessage: 'Show boosts from @{name}' },\n pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned toots' },\n preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },\n follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },\n favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' },\n lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' },\n blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },\n domain_blocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Hidden domains' },\n mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },\n endorse: { id: 'account.endorse', defaultMessage: 'Feature on profile' },\n unendorse: { id: 'account.unendorse', defaultMessage: 'Don\\'t feature on profile' },\n add_or_remove_from_list: { id: 'account.add_or_remove_from_list', defaultMessage: 'Add or Remove from lists' },\n admin_account: { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' },\n});\n\nconst dateFormatOptions = {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour12: false,\n hour: '2-digit',\n minute: '2-digit',\n};\n\nexport default @injectIntl\nclass Header extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map,\n identity_props: ImmutablePropTypes.list,\n onFollow: PropTypes.func.isRequired,\n onBlock: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n domain: PropTypes.string.isRequired,\n };\n\n openEditProfile = () => {\n window.open('/settings/profile', '_blank');\n }\n\n render () {\n const { account, intl, domain, identity_proofs } = this.props;\n\n if (!account) {\n return null;\n }\n\n let info = [];\n let actionBtn = '';\n let lockedIcon = '';\n let menu = [];\n\n if (me !== account.get('id') && account.getIn(['relationship', 'followed_by'])) {\n info.push( );\n }\n else if (me !== account.get('id') && account.getIn(['relationship', 'blocking'])) {\n info.push( );\n }\n\n if (me !== account.get('id') && account.getIn(['relationship', 'muting'])) {\n info.push( );\n } else if (me !== account.get('id') && account.getIn(['relationship', 'domain_blocking'])) {\n info.push( );\n }\n\n if (me !== account.get('id')) {\n if (!account.get('relationship')) { // Wait until the relationship is loaded\n actionBtn = '';\n } else if (account.getIn(['relationship', 'requested'])) {\n actionBtn = ;\n } else if (!account.getIn(['relationship', 'blocking'])) {\n actionBtn = ;\n } else if (account.getIn(['relationship', 'blocking'])) {\n actionBtn = ;\n }\n } else {\n actionBtn = ;\n }\n\n if (account.get('moved') && !account.getIn(['relationship', 'following'])) {\n actionBtn = '';\n }\n\n if (account.get('locked')) {\n lockedIcon = ;\n }\n\n if (account.get('id') !== me) {\n menu.push({ text: intl.formatMessage(messages.mention, { name: account.get('username') }), action: this.props.onMention });\n menu.push({ text: intl.formatMessage(messages.direct, { name: account.get('username') }), action: this.props.onDirect });\n menu.push(null);\n }\n\n if ('share' in navigator) {\n menu.push({ text: intl.formatMessage(messages.share, { name: account.get('username') }), action: this.handleShare });\n menu.push(null);\n }\n\n if (account.get('id') === me) {\n menu.push({ text: intl.formatMessage(messages.edit_profile), href: '/settings/profile' });\n menu.push({ text: intl.formatMessage(messages.preferences), href: '/settings/preferences' });\n menu.push({ text: intl.formatMessage(messages.pins), to: '/pinned' });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.follow_requests), to: '/follow_requests' });\n menu.push({ text: intl.formatMessage(messages.favourites), to: '/favourites' });\n menu.push({ text: intl.formatMessage(messages.lists), to: '/lists' });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.mutes), to: '/mutes' });\n menu.push({ text: intl.formatMessage(messages.blocks), to: '/blocks' });\n menu.push({ text: intl.formatMessage(messages.domain_blocks), to: '/domain_blocks' });\n } else {\n if (account.getIn(['relationship', 'following'])) {\n if (account.getIn(['relationship', 'showing_reblogs'])) {\n menu.push({ text: intl.formatMessage(messages.hideReblogs, { name: account.get('username') }), action: this.props.onReblogToggle });\n } else {\n menu.push({ text: intl.formatMessage(messages.showReblogs, { name: account.get('username') }), action: this.props.onReblogToggle });\n }\n\n menu.push({ text: intl.formatMessage(account.getIn(['relationship', 'endorsed']) ? messages.unendorse : messages.endorse), action: this.props.onEndorseToggle });\n menu.push({ text: intl.formatMessage(messages.add_or_remove_from_list), action: this.props.onAddToList });\n menu.push(null);\n }\n\n if (account.getIn(['relationship', 'muting'])) {\n menu.push({ text: intl.formatMessage(messages.unmute, { name: account.get('username') }), action: this.props.onMute });\n } else {\n menu.push({ text: intl.formatMessage(messages.mute, { name: account.get('username') }), action: this.props.onMute });\n }\n\n if (account.getIn(['relationship', 'blocking'])) {\n menu.push({ text: intl.formatMessage(messages.unblock, { name: account.get('username') }), action: this.props.onBlock });\n } else {\n menu.push({ text: intl.formatMessage(messages.block, { name: account.get('username') }), action: this.props.onBlock });\n }\n\n menu.push({ text: intl.formatMessage(messages.report, { name: account.get('username') }), action: this.props.onReport });\n }\n\n if (account.get('acct') !== account.get('username')) {\n const domain = account.get('acct').split('@')[1];\n\n menu.push(null);\n\n if (account.getIn(['relationship', 'domain_blocking'])) {\n menu.push({ text: intl.formatMessage(messages.unblockDomain, { domain }), action: this.props.onUnblockDomain });\n } else {\n menu.push({ text: intl.formatMessage(messages.blockDomain, { domain }), action: this.props.onBlockDomain });\n }\n }\n\n if (account.get('id') !== me && isStaff) {\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.admin_account, { name: account.get('username') }), href: `/admin/accounts/${account.get('id')}` });\n }\n\n const content = { __html: account.get('note_emojified') };\n const displayNameHtml = { __html: account.get('display_name_html') };\n const fields = account.get('fields');\n const badge = account.get('bot') ? (
) : null;\n const acct = account.get('acct').indexOf('@') === -1 && domain ? `${account.get('acct')}@${domain}` : account.get('acct');\n\n return (\n \n
\n
\n {info}\n
\n\n
\n
\n\n
\n
\n
\n \n \n\n
\n\n
\n {actionBtn}\n\n \n
\n
\n\n
\n
\n {badge}\n @{acct} {lockedIcon} \n \n \n\n
\n
\n { (fields.size > 0 || identity_proofs.size > 0) && (\n
\n {identity_proofs.map((proof, i) => (\n
\n \n\n \n \n \n \n \n \n \n ))}\n {fields.map((pair, i) => (\n
\n \n \n \n {pair.get('verified_at') && } \n \n \n ))}\n
\n )}\n\n {account.get('note').length > 0 && account.get('note') !== '
' &&
}\n
\n
\n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container';\nimport { NavLink } from 'react-router-dom';\nimport { injectIntl, FormattedMessage, FormattedNumber } from 'react-intl';\nimport { me, isStaff } from 'flavours/glitch/util/initial_state';\nimport { profileLink, accountAdminLink } from 'flavours/glitch/util/backend_links';\nimport Icon from 'flavours/glitch/components/icon';\n\n@injectIntl\nexport default class ActionBar extends React.PureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n isStatusesPageActive = (match, location) => {\n if (!match) {\n return false;\n }\n return !location.pathname.match(/\\/(followers|following)\\/?$/);\n }\n\n render () {\n const { account, intl } = this.props;\n\n let extraInfo = '';\n\n if (account.get('acct') !== account.get('username')) {\n extraInfo = (\n \n );\n }\n\n return (\n \n {extraInfo}\n\n
\n
\n \n \n \n \n\n \n \n \n \n\n \n \n { account.get('followers_count') < 0 ? '-' : } \n \n
\n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport AvatarOverlay from '../../../components/avatar_overlay';\nimport DisplayName from '../../../components/display_name';\n\nexport default class MovedNote extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n from: ImmutablePropTypes.map.isRequired,\n to: ImmutablePropTypes.map.isRequired,\n };\n\n handleAccountClick = e => {\n if (e.button === 0) {\n e.preventDefault();\n this.context.router.history.push(`/accounts/${this.props.to.get('id')}`);\n }\n\n e.stopPropagation();\n }\n\n render () {\n const { from, to } = this.props;\n const displayNameHtml = { __html: from.get('display_name_html') };\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport InnerHeader from 'flavours/glitch/features/account/components/header';\nimport ActionBar from 'flavours/glitch/features/account/components/action_bar';\nimport MissingIndicator from 'flavours/glitch/components/missing_indicator';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { FormattedMessage } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport MovedNote from './moved_note';\n\nexport default class Header extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map,\n identity_proofs: ImmutablePropTypes.list,\n onFollow: PropTypes.func.isRequired,\n onBlock: PropTypes.func.isRequired,\n onMention: PropTypes.func.isRequired,\n onDirect: PropTypes.func.isRequired,\n onReblogToggle: PropTypes.func.isRequired,\n onReport: PropTypes.func.isRequired,\n onMute: PropTypes.func.isRequired,\n onBlockDomain: PropTypes.func.isRequired,\n onUnblockDomain: PropTypes.func.isRequired,\n onEndorseToggle: PropTypes.func.isRequired,\n onAddToList: PropTypes.func.isRequired,\n hideTabs: PropTypes.bool,\n domain: PropTypes.string.isRequired,\n };\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n handleFollow = () => {\n this.props.onFollow(this.props.account);\n }\n\n handleBlock = () => {\n this.props.onBlock(this.props.account);\n }\n\n handleMention = () => {\n this.props.onMention(this.props.account, this.context.router.history);\n }\n\n handleDirect = () => {\n this.props.onDirect(this.props.account, this.context.router.history);\n }\n\n handleReport = () => {\n this.props.onReport(this.props.account);\n }\n\n handleReblogToggle = () => {\n this.props.onReblogToggle(this.props.account);\n }\n\n handleMute = () => {\n this.props.onMute(this.props.account);\n }\n\n handleBlockDomain = () => {\n const domain = this.props.account.get('acct').split('@')[1];\n\n if (!domain) return;\n\n this.props.onBlockDomain(domain);\n }\n\n handleUnblockDomain = () => {\n const domain = this.props.account.get('acct').split('@')[1];\n\n if (!domain) return;\n\n this.props.onUnblockDomain(domain);\n }\n\n handleEndorseToggle = () => {\n this.props.onEndorseToggle(this.props.account);\n }\n\n handleAddToList = () => {\n this.props.onAddToList(this.props.account);\n }\n\n render () {\n const { account, hideTabs, identity_proofs } = this.props;\n\n if (account === null) {\n return ;\n }\n\n return (\n \n {account.get('moved') &&
}\n\n
\n\n
\n\n {!hideTabs && (\n
\n \n \n \n
\n )}\n
\n );\n }\n\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { makeGetAccount } from 'flavours/glitch/selectors';\nimport Header from '../components/header';\nimport {\n followAccount,\n unfollowAccount,\n blockAccount,\n unblockAccount,\n unmuteAccount,\n pinAccount,\n unpinAccount,\n} from 'flavours/glitch/actions/accounts';\nimport {\n mentionCompose,\n directCompose\n} from 'flavours/glitch/actions/compose';\nimport { initMuteModal } from 'flavours/glitch/actions/mutes';\nimport { initReport } from 'flavours/glitch/actions/reports';\nimport { openModal } from 'flavours/glitch/actions/modal';\nimport { blockDomain, unblockDomain } from 'flavours/glitch/actions/domain_blocks';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport { unfollowModal } from 'flavours/glitch/util/initial_state';\nimport { List as ImmutableList } from 'immutable';\n\nconst messages = defineMessages({\n unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },\n blockConfirm: { id: 'confirmations.block.confirm', defaultMessage: 'Block' },\n blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },\n blockAndReport: { id: 'confirmations.block.block_and_report', defaultMessage: 'Block & Report' },\n});\n\nconst makeMapStateToProps = () => {\n const getAccount = makeGetAccount();\n\n const mapStateToProps = (state, { accountId }) => ({\n account: getAccount(state, accountId),\n domain: state.getIn(['meta', 'domain']),\n identity_proofs: state.getIn(['identity_proofs', accountId], ImmutableList()),\n });\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { intl }) => ({\n\n onFollow (account) {\n if (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) {\n if (unfollowModal) {\n dispatch(openModal('CONFIRM', {\n message: @{account.get('acct')} }} />,\n confirm: intl.formatMessage(messages.unfollowConfirm),\n onConfirm: () => dispatch(unfollowAccount(account.get('id'))),\n }));\n } else {\n dispatch(unfollowAccount(account.get('id')));\n }\n } else {\n dispatch(followAccount(account.get('id')));\n }\n },\n\n onBlock (account) {\n if (account.getIn(['relationship', 'blocking'])) {\n dispatch(unblockAccount(account.get('id')));\n } else {\n dispatch(openModal('CONFIRM', {\n message: @{account.get('acct')} }} />,\n confirm: intl.formatMessage(messages.blockConfirm),\n onConfirm: () => dispatch(blockAccount(account.get('id'))),\n secondary: intl.formatMessage(messages.blockAndReport),\n onSecondary: () => {\n dispatch(blockAccount(account.get('id')));\n dispatch(initReport(account));\n },\n }));\n }\n },\n\n onMention (account, router) {\n dispatch(mentionCompose(account, router));\n },\n\n onDirect (account, router) {\n dispatch(directCompose(account, router));\n },\n\n onDirect (account, router) {\n dispatch(directCompose(account, router));\n },\n\n onReblogToggle (account) {\n if (account.getIn(['relationship', 'showing_reblogs'])) {\n dispatch(followAccount(account.get('id'), false));\n } else {\n dispatch(followAccount(account.get('id'), true));\n }\n },\n\n onEndorseToggle (account) {\n if (account.getIn(['relationship', 'endorsed'])) {\n dispatch(unpinAccount(account.get('id')));\n } else {\n dispatch(pinAccount(account.get('id')));\n }\n },\n\n onReport (account) {\n dispatch(initReport(account));\n },\n\n onMute (account) {\n if (account.getIn(['relationship', 'muting'])) {\n dispatch(unmuteAccount(account.get('id')));\n } else {\n dispatch(initMuteModal(account));\n }\n },\n\n onBlockDomain (domain) {\n dispatch(openModal('CONFIRM', {\n message: {domain} }} />,\n confirm: intl.formatMessage(messages.blockDomainConfirm),\n onConfirm: () => dispatch(blockDomain(domain)),\n }));\n },\n\n onUnblockDomain (domain) {\n dispatch(unblockDomain(domain));\n },\n\n onAddToList(account){\n dispatch(openModal('LIST_ADDER', {\n accountId: account.get('id'),\n }));\n },\n\n});\n\nexport default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Header));\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport Button from 'mastodon/components/button';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { autoPlayGif, me, isStaff } from 'mastodon/initial_state';\nimport classNames from 'classnames';\nimport Icon from 'mastodon/components/icon';\nimport Avatar from 'mastodon/components/avatar';\nimport { shortNumberFormat } from 'mastodon/utils/numbers';\nimport { NavLink } from 'react-router-dom';\nimport DropdownMenuContainer from 'mastodon/containers/dropdown_menu_container';\n\nconst messages = defineMessages({\n unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },\n follow: { id: 'account.follow', defaultMessage: 'Follow' },\n requested: { id: 'account.requested', defaultMessage: 'Awaiting approval. Click to cancel follow request' },\n unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },\n edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },\n linkVerifiedOn: { id: 'account.link_verified_on', defaultMessage: 'Ownership of this link was checked on {date}' },\n account_locked: { id: 'account.locked_info', defaultMessage: 'This account privacy status is set to locked. The owner manually reviews who can follow them.' },\n mention: { id: 'account.mention', defaultMessage: 'Mention @{name}' },\n direct: { id: 'account.direct', defaultMessage: 'Direct message @{name}' },\n edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },\n unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },\n unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' },\n block: { id: 'account.block', defaultMessage: 'Block @{name}' },\n mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' },\n report: { id: 'account.report', defaultMessage: 'Report @{name}' },\n share: { id: 'account.share', defaultMessage: 'Share @{name}\\'s profile' },\n media: { id: 'account.media', defaultMessage: 'Media' },\n blockDomain: { id: 'account.block_domain', defaultMessage: 'Hide everything from {domain}' },\n unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unhide {domain}' },\n hideReblogs: { id: 'account.hide_reblogs', defaultMessage: 'Hide boosts from @{name}' },\n showReblogs: { id: 'account.show_reblogs', defaultMessage: 'Show boosts from @{name}' },\n pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned toots' },\n preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },\n follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },\n favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' },\n lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' },\n blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },\n domain_blocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Hidden domains' },\n mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },\n endorse: { id: 'account.endorse', defaultMessage: 'Feature on profile' },\n unendorse: { id: 'account.unendorse', defaultMessage: 'Don\\'t feature on profile' },\n add_or_remove_from_list: { id: 'account.add_or_remove_from_list', defaultMessage: 'Add or Remove from lists' },\n admin_account: { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' },\n});\n\nconst dateFormatOptions = {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour12: false,\n hour: '2-digit',\n minute: '2-digit',\n};\n\nexport default @injectIntl\nclass Header extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map,\n identity_props: ImmutablePropTypes.list,\n onFollow: PropTypes.func.isRequired,\n onBlock: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n domain: PropTypes.string.isRequired,\n };\n\n openEditProfile = () => {\n window.open('/settings/profile', '_blank');\n }\n\n isStatusesPageActive = (match, location) => {\n if (!match) {\n return false;\n }\n\n return !location.pathname.match(/\\/(followers|following)\\/?$/);\n }\n\n render () {\n const { account, intl, domain, identity_proofs } = this.props;\n\n if (!account) {\n return null;\n }\n\n let info = [];\n let actionBtn = '';\n let lockedIcon = '';\n let menu = [];\n\n if (me !== account.get('id') && account.getIn(['relationship', 'followed_by'])) {\n info.push( );\n } else if (me !== account.get('id') && account.getIn(['relationship', 'blocking'])) {\n info.push( );\n }\n\n if (me !== account.get('id') && account.getIn(['relationship', 'muting'])) {\n info.push( );\n } else if (me !== account.get('id') && account.getIn(['relationship', 'domain_blocking'])) {\n info.push( );\n }\n\n if (me !== account.get('id')) {\n if (!account.get('relationship')) { // Wait until the relationship is loaded\n actionBtn = '';\n } else if (account.getIn(['relationship', 'requested'])) {\n actionBtn = ;\n } else if (!account.getIn(['relationship', 'blocking'])) {\n actionBtn = ;\n } else if (account.getIn(['relationship', 'blocking'])) {\n actionBtn = ;\n }\n } else {\n actionBtn = ;\n }\n\n if (account.get('moved') && !account.getIn(['relationship', 'following'])) {\n actionBtn = '';\n }\n\n if (account.get('locked')) {\n lockedIcon = ;\n }\n\n if (account.get('id') !== me) {\n menu.push({ text: intl.formatMessage(messages.mention, { name: account.get('username') }), action: this.props.onMention });\n menu.push({ text: intl.formatMessage(messages.direct, { name: account.get('username') }), action: this.props.onDirect });\n menu.push(null);\n }\n\n if ('share' in navigator) {\n menu.push({ text: intl.formatMessage(messages.share, { name: account.get('username') }), action: this.handleShare });\n menu.push(null);\n }\n\n if (account.get('id') === me) {\n menu.push({ text: intl.formatMessage(messages.edit_profile), href: '/settings/profile' });\n menu.push({ text: intl.formatMessage(messages.preferences), href: '/settings/preferences' });\n menu.push({ text: intl.formatMessage(messages.pins), to: '/pinned' });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.follow_requests), to: '/follow_requests' });\n menu.push({ text: intl.formatMessage(messages.favourites), to: '/favourites' });\n menu.push({ text: intl.formatMessage(messages.lists), to: '/lists' });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.mutes), to: '/mutes' });\n menu.push({ text: intl.formatMessage(messages.blocks), to: '/blocks' });\n menu.push({ text: intl.formatMessage(messages.domain_blocks), to: '/domain_blocks' });\n } else {\n if (account.getIn(['relationship', 'following'])) {\n if (account.getIn(['relationship', 'showing_reblogs'])) {\n menu.push({ text: intl.formatMessage(messages.hideReblogs, { name: account.get('username') }), action: this.props.onReblogToggle });\n } else {\n menu.push({ text: intl.formatMessage(messages.showReblogs, { name: account.get('username') }), action: this.props.onReblogToggle });\n }\n\n menu.push({ text: intl.formatMessage(account.getIn(['relationship', 'endorsed']) ? messages.unendorse : messages.endorse), action: this.props.onEndorseToggle });\n menu.push({ text: intl.formatMessage(messages.add_or_remove_from_list), action: this.props.onAddToList });\n menu.push(null);\n }\n\n if (account.getIn(['relationship', 'muting'])) {\n menu.push({ text: intl.formatMessage(messages.unmute, { name: account.get('username') }), action: this.props.onMute });\n } else {\n menu.push({ text: intl.formatMessage(messages.mute, { name: account.get('username') }), action: this.props.onMute });\n }\n\n if (account.getIn(['relationship', 'blocking'])) {\n menu.push({ text: intl.formatMessage(messages.unblock, { name: account.get('username') }), action: this.props.onBlock });\n } else {\n menu.push({ text: intl.formatMessage(messages.block, { name: account.get('username') }), action: this.props.onBlock });\n }\n\n menu.push({ text: intl.formatMessage(messages.report, { name: account.get('username') }), action: this.props.onReport });\n }\n\n if (account.get('acct') !== account.get('username')) {\n const domain = account.get('acct').split('@')[1];\n\n menu.push(null);\n\n if (account.getIn(['relationship', 'domain_blocking'])) {\n menu.push({ text: intl.formatMessage(messages.unblockDomain, { domain }), action: this.props.onUnblockDomain });\n } else {\n menu.push({ text: intl.formatMessage(messages.blockDomain, { domain }), action: this.props.onBlockDomain });\n }\n }\n\n if (account.get('id') !== me && isStaff) {\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.admin_account, { name: account.get('username') }), href: `/admin/accounts/${account.get('id')}` });\n }\n\n const content = { __html: account.get('note_emojified') };\n const displayNameHtml = { __html: account.get('display_name_html') };\n const fields = account.get('fields');\n const badge = account.get('bot') ? (
) : null;\n const acct = account.get('acct').indexOf('@') === -1 && domain ? `${account.get('acct')}@${domain}` : account.get('acct');\n\n return (\n \n
\n
\n {info}\n
\n\n
\n
\n\n
\n
\n
\n \n \n\n
\n\n
\n {actionBtn}\n\n \n
\n
\n\n
\n
\n {badge}\n @{acct} {lockedIcon} \n \n \n\n
\n
\n { (fields.size > 0 || identity_proofs.size > 0) && (\n
\n {identity_proofs.map((proof, i) => (\n
\n \n\n \n \n \n \n \n \n \n ))}\n {fields.map((pair, i) => (\n
\n \n\n \n {pair.get('verified_at') && } \n \n \n ))}\n
\n )}\n\n {account.get('note').length > 0 && account.get('note') !== '
' &&
}\n
\n\n
\n \n {shortNumberFormat(account.get('statuses_count'))} \n \n\n \n {shortNumberFormat(account.get('following_count'))} \n \n\n \n {shortNumberFormat(account.get('followers_count'))} \n \n
\n
\n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport AvatarOverlay from '../../../components/avatar_overlay';\nimport DisplayName from '../../../components/display_name';\nimport Icon from 'mastodon/components/icon';\n\nexport default class MovedNote extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n from: ImmutablePropTypes.map.isRequired,\n to: ImmutablePropTypes.map.isRequired,\n };\n\n handleAccountClick = e => {\n if (e.button === 0) {\n e.preventDefault();\n this.context.router.history.push(`/accounts/${this.props.to.get('id')}`);\n }\n\n e.stopPropagation();\n }\n\n render () {\n const { from, to } = this.props;\n const displayNameHtml = { __html: from.get('display_name_html') };\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport InnerHeader from '../../account/components/header';\nimport MissingIndicator from '../../../components/missing_indicator';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport MovedNote from './moved_note';\nimport { FormattedMessage } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\n\nexport default class Header extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map,\n identity_proofs: ImmutablePropTypes.list,\n onFollow: PropTypes.func.isRequired,\n onBlock: PropTypes.func.isRequired,\n onMention: PropTypes.func.isRequired,\n onDirect: PropTypes.func.isRequired,\n onReblogToggle: PropTypes.func.isRequired,\n onReport: PropTypes.func.isRequired,\n onMute: PropTypes.func.isRequired,\n onBlockDomain: PropTypes.func.isRequired,\n onUnblockDomain: PropTypes.func.isRequired,\n onEndorseToggle: PropTypes.func.isRequired,\n onAddToList: PropTypes.func.isRequired,\n hideTabs: PropTypes.bool,\n domain: PropTypes.string.isRequired,\n };\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n handleFollow = () => {\n this.props.onFollow(this.props.account);\n }\n\n handleBlock = () => {\n this.props.onBlock(this.props.account);\n }\n\n handleMention = () => {\n this.props.onMention(this.props.account, this.context.router.history);\n }\n\n handleDirect = () => {\n this.props.onDirect(this.props.account, this.context.router.history);\n }\n\n handleReport = () => {\n this.props.onReport(this.props.account);\n }\n\n handleReblogToggle = () => {\n this.props.onReblogToggle(this.props.account);\n }\n\n handleMute = () => {\n this.props.onMute(this.props.account);\n }\n\n handleBlockDomain = () => {\n const domain = this.props.account.get('acct').split('@')[1];\n\n if (!domain) return;\n\n this.props.onBlockDomain(domain);\n }\n\n handleUnblockDomain = () => {\n const domain = this.props.account.get('acct').split('@')[1];\n\n if (!domain) return;\n\n this.props.onUnblockDomain(domain);\n }\n\n handleEndorseToggle = () => {\n this.props.onEndorseToggle(this.props.account);\n }\n\n handleAddToList = () => {\n this.props.onAddToList(this.props.account);\n }\n\n render () {\n const { account, hideTabs, identity_proofs } = this.props;\n\n if (account === null) {\n return ;\n }\n\n return (\n \n {account.get('moved') &&
}\n\n
\n\n {!hideTabs && (\n
\n \n \n \n
\n )}\n
\n );\n }\n\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { makeGetAccount } from '../../../selectors';\nimport Header from '../components/header';\nimport {\n followAccount,\n unfollowAccount,\n blockAccount,\n unblockAccount,\n unmuteAccount,\n pinAccount,\n unpinAccount,\n} from '../../../actions/accounts';\nimport {\n mentionCompose,\n directCompose,\n} from '../../../actions/compose';\nimport { initMuteModal } from '../../../actions/mutes';\nimport { initReport } from '../../../actions/reports';\nimport { openModal } from '../../../actions/modal';\nimport { blockDomain, unblockDomain } from '../../../actions/domain_blocks';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport { unfollowModal } from '../../../initial_state';\nimport { List as ImmutableList } from 'immutable';\n\nconst messages = defineMessages({\n unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },\n blockConfirm: { id: 'confirmations.block.confirm', defaultMessage: 'Block' },\n blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },\n blockAndReport: { id: 'confirmations.block.block_and_report', defaultMessage: 'Block & Report' },\n});\n\nconst makeMapStateToProps = () => {\n const getAccount = makeGetAccount();\n\n const mapStateToProps = (state, { accountId }) => ({\n account: getAccount(state, accountId),\n domain: state.getIn(['meta', 'domain']),\n identity_proofs: state.getIn(['identity_proofs', accountId], ImmutableList()),\n });\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { intl }) => ({\n\n onFollow (account) {\n if (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) {\n if (unfollowModal) {\n dispatch(openModal('CONFIRM', {\n message: @{account.get('acct')} }} />,\n confirm: intl.formatMessage(messages.unfollowConfirm),\n onConfirm: () => dispatch(unfollowAccount(account.get('id'))),\n }));\n } else {\n dispatch(unfollowAccount(account.get('id')));\n }\n } else {\n dispatch(followAccount(account.get('id')));\n }\n },\n\n onBlock (account) {\n if (account.getIn(['relationship', 'blocking'])) {\n dispatch(unblockAccount(account.get('id')));\n } else {\n dispatch(openModal('CONFIRM', {\n message: @{account.get('acct')} }} />,\n confirm: intl.formatMessage(messages.blockConfirm),\n onConfirm: () => dispatch(blockAccount(account.get('id'))),\n secondary: intl.formatMessage(messages.blockAndReport),\n onSecondary: () => {\n dispatch(blockAccount(account.get('id')));\n dispatch(initReport(account));\n },\n }));\n }\n },\n\n onMention (account, router) {\n dispatch(mentionCompose(account, router));\n },\n\n onDirect (account, router) {\n dispatch(directCompose(account, router));\n },\n\n onReblogToggle (account) {\n if (account.getIn(['relationship', 'showing_reblogs'])) {\n dispatch(followAccount(account.get('id'), false));\n } else {\n dispatch(followAccount(account.get('id'), true));\n }\n },\n\n onEndorseToggle (account) {\n if (account.getIn(['relationship', 'endorsed'])) {\n dispatch(unpinAccount(account.get('id')));\n } else {\n dispatch(pinAccount(account.get('id')));\n }\n },\n\n onReport (account) {\n dispatch(initReport(account));\n },\n\n onMute (account) {\n if (account.getIn(['relationship', 'muting'])) {\n dispatch(unmuteAccount(account.get('id')));\n } else {\n dispatch(initMuteModal(account));\n }\n },\n\n onBlockDomain (domain) {\n dispatch(openModal('CONFIRM', {\n message: {domain} }} />,\n confirm: intl.formatMessage(messages.blockDomainConfirm),\n onConfirm: () => dispatch(blockDomain(domain)),\n }));\n },\n\n onUnblockDomain (domain) {\n dispatch(unblockDomain(domain));\n },\n\n onAddToList(account){\n dispatch(openModal('LIST_ADDER', {\n accountId: account.get('id'),\n }));\n },\n\n});\n\nexport default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Header));\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func\n: Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', {\n get: function get() {\n return 7;\n }\n }).a != 7;\n});","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { getData, getSanitizedData, unifiedToNative } from '../../utils';\nimport { uncompress } from '../../utils/data';\nimport { EmojiPropTypes, EmojiDefaultProps } from '../../utils/shared-props';\nvar SHEET_COLUMNS = 52;\n\nvar _getData = function _getData(props) {\n var emoji = props.emoji;\n var skin = props.skin;\n var set = props.set;\n var data = props.data;\n return getData(emoji, skin, set, data);\n};\n\nvar _getPosition = function _getPosition(props) {\n var _getData2 = _getData(props);\n\n var sheet_x = _getData2.sheet_x;\n var sheet_y = _getData2.sheet_y;\n var multiply = 100 / (SHEET_COLUMNS - 1);\n return multiply * sheet_x + '% ' + multiply * sheet_y + '%';\n};\n\nvar _getSanitizedData = function _getSanitizedData(props) {\n var emoji = props.emoji;\n var skin = props.skin;\n var set = props.set;\n var data = props.data;\n return getSanitizedData(emoji, skin, set, data);\n};\n\nvar _handleClick = function _handleClick(e, props) {\n if (!props.onClick) {\n return;\n }\n\n var onClick = props.onClick;\n\n var emoji = _getSanitizedData(props);\n\n onClick(emoji, e);\n};\n\nvar _handleOver = function _handleOver(e, props) {\n if (!props.onOver) {\n return;\n }\n\n var onOver = props.onOver;\n\n var emoji = _getSanitizedData(props);\n\n onOver(emoji, e);\n};\n\nvar _handleLeave = function _handleLeave(e, props) {\n if (!props.onLeave) {\n return;\n }\n\n var onLeave = props.onLeave;\n\n var emoji = _getSanitizedData(props);\n\n onLeave(emoji, e);\n};\n\nvar _isNumeric = function _isNumeric(value) {\n return !isNaN(value - parseFloat(value));\n};\n\nvar _convertStyleToCSS = function _convertStyleToCSS(style) {\n var div = document.createElement('div');\n\n for (var key in style) {\n var value = style[key];\n\n if (_isNumeric(value)) {\n value += 'px';\n }\n\n div.style[key] = value;\n }\n\n return div.getAttribute('style');\n};\n\nvar NimbleEmoji = function NimbleEmoji(props) {\n if (props.data.compressed) {\n uncompress(props.data);\n }\n\n for (var k in NimbleEmoji.defaultProps) {\n if (props[k] == undefined && NimbleEmoji.defaultProps[k] != undefined) {\n props[k] = NimbleEmoji.defaultProps[k];\n }\n }\n\n var data = _getData(props);\n\n if (!data) {\n return null;\n }\n\n var unified = data.unified;\n var custom = data.custom;\n var short_names = data.short_names;\n var colons = data.colons;\n var imageUrl = data.imageUrl;\n var style = {};\n var children = props.children;\n var className = 'emoji-mart-emoji';\n var title = null;\n\n if (!unified && !custom) {\n return null;\n }\n\n if (props.tooltip) {\n title = short_names ? ':' + short_names[0] + ':' : colons;\n }\n\n if (props.native && unified) {\n className += ' emoji-mart-emoji-native';\n style = {\n fontSize: props.size\n };\n children = unifiedToNative(unified);\n\n if (props.forceSize) {\n style.display = 'inline-block';\n style.width = props.size;\n style.height = props.size;\n }\n } else if (custom) {\n className += ' emoji-mart-emoji-custom';\n style = {\n width: props.size,\n height: props.size,\n display: 'inline-block',\n backgroundImage: 'url(' + imageUrl + ')',\n backgroundSize: 'contain'\n };\n } else {\n var setHasEmoji = data['has_img_' + props.set] == undefined || data['has_img_' + props.set];\n\n if (!setHasEmoji) {\n if (props.fallback) {\n return props.fallback(data);\n } else {\n return null;\n }\n } else {\n style = {\n width: props.size,\n height: props.size,\n display: 'inline-block',\n backgroundImage: 'url(' + props.backgroundImageFn(props.set, props.sheetSize) + ')',\n backgroundSize: 100 * SHEET_COLUMNS + '%',\n backgroundPosition: _getPosition(props)\n };\n }\n }\n\n if (props.html) {\n style = _convertStyleToCSS(style);\n return '' + (children || '') + ' ';\n } else {\n return React.createElement('span', {\n key: props.emoji.id || props.emoji,\n onClick: function onClick(e) {\n return _handleClick(e, props);\n },\n onMouseEnter: function onMouseEnter(e) {\n return _handleOver(e, props);\n },\n onMouseLeave: function onMouseLeave(e) {\n return _handleLeave(e, props);\n },\n title: title,\n className: className\n }, React.createElement('span', {\n style: style\n }, children));\n }\n};\n\nNimbleEmoji.defaultProps = EmojiDefaultProps;\nexport default NimbleEmoji;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Toggle from 'react-toggle';\n\nexport default class SettingToggle extends React.PureComponent {\n\n static propTypes = {\n prefix: PropTypes.string,\n settings: ImmutablePropTypes.map.isRequired,\n settingPath: PropTypes.array.isRequired,\n label: PropTypes.node.isRequired,\n meta: PropTypes.node,\n onChange: PropTypes.func.isRequired,\n }\n\n onChange = ({ target }) => {\n this.props.onChange(this.props.settingPath, target.checked);\n }\n\n render () {\n const { prefix, settings, settingPath, label, meta } = this.props;\n const id = ['setting-toggle', prefix, ...settingPath].filter(Boolean).join('-');\n\n return (\n \n \n {label} \n {meta && {meta} }\n
\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\n\nexport default class SettingText extends React.PureComponent {\n\n static propTypes = {\n settings: ImmutablePropTypes.map.isRequired,\n settingPath: PropTypes.array.isRequired,\n label: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n };\n\n handleChange = (e) => {\n this.props.onChange(this.props.settingPath, e.target.value);\n }\n\n render () {\n const { settings, settingPath, label } = this.props;\n\n return (\n \n {label} \n \n \n );\n }\n\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.MenuPortal = exports.menuPortalCSS = exports.LoadingMessage = exports.NoOptionsMessage = exports.loadingMessageCSS = exports.noOptionsMessageCSS = exports.MenuList = exports.menuListCSS = exports.MenuPlacer = exports.menuCSS = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nexports.getMenuPlacement = getMenuPlacement;\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require('react-dom');\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _utils = require('../utils');\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n} // ==============================\n// Menu\n// ==============================\n// Get Menu Placement\n// ------------------------------\n\n\nfunction getMenuPlacement(_ref) {\n var maxHeight = _ref.maxHeight,\n menuEl = _ref.menuEl,\n minHeight = _ref.minHeight,\n placement = _ref.placement,\n shouldScroll = _ref.shouldScroll,\n isFixedPosition = _ref.isFixedPosition,\n theme = _ref.theme;\n var spacing = theme.spacing;\n var scrollParent = (0, _utils.getScrollParent)(menuEl);\n var defaultState = {\n placement: 'bottom',\n maxHeight: maxHeight\n }; // something went wrong, return default state\n\n if (!menuEl || !menuEl.offsetParent) return defaultState; // we can't trust `scrollParent.scrollHeight` --> it may increase when\n // the menu is rendered\n\n var _scrollParent$getBoun = scrollParent.getBoundingClientRect(),\n scrollHeight = _scrollParent$getBoun.height;\n\n var _menuEl$getBoundingCl = menuEl.getBoundingClientRect(),\n menuBottom = _menuEl$getBoundingCl.bottom,\n menuHeight = _menuEl$getBoundingCl.height,\n menuTop = _menuEl$getBoundingCl.top; // $FlowFixMe function returns above if there's no offsetParent\n\n\n var _menuEl$offsetParent$ = menuEl.offsetParent.getBoundingClientRect(),\n containerTop = _menuEl$offsetParent$.top;\n\n var viewHeight = window.innerHeight;\n var scrollTop = (0, _utils.getScrollTop)(scrollParent);\n var marginBottom = parseInt(getComputedStyle(menuEl).marginBottom, 10);\n var marginTop = parseInt(getComputedStyle(menuEl).marginTop, 10);\n var viewSpaceAbove = containerTop - marginTop;\n var viewSpaceBelow = viewHeight - menuTop;\n var scrollSpaceAbove = viewSpaceAbove + scrollTop;\n var scrollSpaceBelow = scrollHeight - scrollTop - menuTop;\n var scrollDown = menuBottom - viewHeight + scrollTop + marginBottom;\n var scrollUp = scrollTop + menuTop - marginTop;\n var scrollDuration = 160;\n\n switch (placement) {\n case 'auto':\n case 'bottom':\n // 1: the menu will fit, do nothing\n if (viewSpaceBelow >= menuHeight) {\n return {\n placement: 'bottom',\n maxHeight: maxHeight\n };\n } // 2: the menu will fit, if scrolled\n\n\n if (scrollSpaceBelow >= menuHeight && !isFixedPosition) {\n if (shouldScroll) {\n (0, _utils.animatedScrollTo)(scrollParent, scrollDown, scrollDuration);\n }\n\n return {\n placement: 'bottom',\n maxHeight: maxHeight\n };\n } // 3: the menu will fit, if constrained\n\n\n if (!isFixedPosition && scrollSpaceBelow >= minHeight || isFixedPosition && viewSpaceBelow >= minHeight) {\n if (shouldScroll) {\n (0, _utils.animatedScrollTo)(scrollParent, scrollDown, scrollDuration);\n } // we want to provide as much of the menu as possible to the user,\n // so give them whatever is available below rather than the minHeight.\n\n\n var constrainedHeight = isFixedPosition ? viewSpaceBelow - marginBottom : scrollSpaceBelow - marginBottom;\n return {\n placement: 'bottom',\n maxHeight: constrainedHeight\n };\n } // 4. Forked beviour when there isn't enough space below\n // AUTO: flip the menu, render above\n\n\n if (placement === 'auto' || isFixedPosition) {\n // may need to be constrained after flipping\n var _constrainedHeight = maxHeight;\n\n if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) {\n _constrainedHeight = isFixedPosition ? viewSpaceAbove - marginBottom - spacing.controlHeight : scrollSpaceAbove - marginBottom - spacing.controlHeight;\n }\n\n return {\n placement: 'top',\n maxHeight: _constrainedHeight\n };\n } // BOTTOM: allow browser to increase scrollable area and immediately set scroll\n\n\n if (placement === 'bottom') {\n (0, _utils.scrollTo)(scrollParent, scrollDown);\n return {\n placement: 'bottom',\n maxHeight: maxHeight\n };\n }\n\n break;\n\n case 'top':\n // 1: the menu will fit, do nothing\n if (viewSpaceAbove >= menuHeight) {\n return {\n placement: 'top',\n maxHeight: maxHeight\n };\n } // 2: the menu will fit, if scrolled\n\n\n if (scrollSpaceAbove >= menuHeight && !isFixedPosition) {\n if (shouldScroll) {\n (0, _utils.animatedScrollTo)(scrollParent, scrollUp, scrollDuration);\n }\n\n return {\n placement: 'top',\n maxHeight: maxHeight\n };\n } // 3: the menu will fit, if constrained\n\n\n if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) {\n var _constrainedHeight2 = maxHeight; // we want to provide as much of the menu as possible to the user,\n // so give them whatever is available below rather than the minHeight.\n\n if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) {\n _constrainedHeight2 = isFixedPosition ? viewSpaceAbove - marginTop : scrollSpaceAbove - marginTop;\n }\n\n if (shouldScroll) {\n (0, _utils.animatedScrollTo)(scrollParent, scrollUp, scrollDuration);\n }\n\n return {\n placement: 'top',\n maxHeight: _constrainedHeight2\n };\n } // 4. not enough space, the browser WILL NOT increase scrollable area when\n // absolutely positioned element rendered above the viewport (only below).\n // Flip the menu, render below\n\n\n return {\n placement: 'bottom',\n maxHeight: maxHeight\n };\n\n default:\n throw new Error('Invalid placement provided \"' + placement + '\".');\n } // fulfil contract with flow: implicit return value of undefined\n\n\n return defaultState;\n} // Menu Component\n// ------------------------------\n\n\nfunction alignToControl(placement) {\n var placementToCSSProp = {\n bottom: 'top',\n top: 'bottom'\n };\n return placement ? placementToCSSProp[placement] : 'bottom';\n}\n\nvar coercePlacement = function coercePlacement(p) {\n return p === 'auto' ? 'bottom' : p;\n};\n\nvar menuCSS = exports.menuCSS = function menuCSS(_ref2) {\n var _ref3;\n\n var placement = _ref2.placement,\n _ref2$theme = _ref2.theme,\n borderRadius = _ref2$theme.borderRadius,\n spacing = _ref2$theme.spacing,\n colors = _ref2$theme.colors;\n return _ref3 = {}, _defineProperty(_ref3, alignToControl(placement), '100%'), _defineProperty(_ref3, 'backgroundColor', colors.neutral0), _defineProperty(_ref3, 'borderRadius', borderRadius), _defineProperty(_ref3, 'boxShadow', '0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)'), _defineProperty(_ref3, 'marginBottom', spacing.menuGutter), _defineProperty(_ref3, 'marginTop', spacing.menuGutter), _defineProperty(_ref3, 'position', 'absolute'), _defineProperty(_ref3, 'width', '100%'), _defineProperty(_ref3, 'zIndex', 1), _ref3;\n}; // NOTE: internal only\n\n\nvar MenuPlacer = exports.MenuPlacer = function (_Component) {\n _inherits(MenuPlacer, _Component);\n\n function MenuPlacer() {\n var _ref4;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, MenuPlacer);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref4 = MenuPlacer.__proto__ || Object.getPrototypeOf(MenuPlacer)).call.apply(_ref4, [this].concat(args))), _this), _this.state = {\n maxHeight: _this.props.maxMenuHeight,\n placement: null\n }, _this.getPlacement = function (ref) {\n var _this$props = _this.props,\n minMenuHeight = _this$props.minMenuHeight,\n maxMenuHeight = _this$props.maxMenuHeight,\n menuPlacement = _this$props.menuPlacement,\n menuPosition = _this$props.menuPosition,\n menuShouldScrollIntoView = _this$props.menuShouldScrollIntoView,\n theme = _this$props.theme;\n var getPortalPlacement = _this.context.getPortalPlacement;\n if (!ref) return; // DO NOT scroll if position is fixed\n\n var isFixedPosition = menuPosition === 'fixed';\n var shouldScroll = menuShouldScrollIntoView && !isFixedPosition;\n var state = getMenuPlacement({\n maxHeight: maxMenuHeight,\n menuEl: ref,\n minHeight: minMenuHeight,\n placement: menuPlacement,\n shouldScroll: shouldScroll,\n isFixedPosition: isFixedPosition,\n theme: theme\n });\n if (getPortalPlacement) getPortalPlacement(state);\n\n _this.setState(state);\n }, _this.getUpdatedProps = function () {\n var menuPlacement = _this.props.menuPlacement;\n var placement = _this.state.placement || coercePlacement(menuPlacement);\n return _extends({}, _this.props, {\n placement: placement,\n maxHeight: _this.state.maxHeight\n });\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(MenuPlacer, [{\n key: 'render',\n value: function render() {\n var children = this.props.children;\n return children({\n ref: this.getPlacement,\n placerProps: this.getUpdatedProps()\n });\n }\n }]);\n\n return MenuPlacer;\n}(_react.Component);\n\nMenuPlacer.contextTypes = {\n getPortalPlacement: _propTypes2.default.func\n};\n\nvar Menu = function Menu(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerRef = props.innerRef,\n innerProps = props.innerProps,\n emotion = props.emotion;\n var cn = cx(emotion.css(getStyles('menu', props)), {\n menu: true\n }, className);\n return _react2.default.createElement('div', _extends({\n className: cn\n }, innerProps, {\n ref: innerRef\n }), children);\n};\n\nexports.default = Menu; // ==============================\n// Menu List\n// ==============================\n\nvar menuListCSS = exports.menuListCSS = function menuListCSS(_ref5) {\n var maxHeight = _ref5.maxHeight,\n baseUnit = _ref5.theme.spacing.baseUnit;\n return {\n maxHeight: maxHeight,\n overflowY: 'auto',\n paddingBottom: baseUnit,\n paddingTop: baseUnit,\n position: 'relative',\n // required for offset[Height, Top] > keyboard scroll\n WebkitOverflowScrolling: 'touch'\n };\n};\n\nvar MenuList = exports.MenuList = function MenuList(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n isMulti = props.isMulti,\n innerRef = props.innerRef,\n emotion = props.emotion;\n return _react2.default.createElement('div', {\n className: cx(emotion.css(getStyles('menuList', props)), {\n 'menu-list': true,\n 'menu-list--is-multi': isMulti\n }, className),\n ref: innerRef\n }, children);\n}; // ==============================\n// Menu Notices\n// ==============================\n\n\nvar noticeCSS = function noticeCSS(_ref6) {\n var _ref6$theme = _ref6.theme,\n baseUnit = _ref6$theme.spacing.baseUnit,\n colors = _ref6$theme.colors;\n return {\n color: colors.neutral40,\n padding: baseUnit * 2 + 'px ' + baseUnit * 3 + 'px',\n textAlign: 'center'\n };\n};\n\nvar noOptionsMessageCSS = exports.noOptionsMessageCSS = noticeCSS;\nvar loadingMessageCSS = exports.loadingMessageCSS = noticeCSS;\n\nvar NoOptionsMessage = exports.NoOptionsMessage = function NoOptionsMessage(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps,\n emotion = props.emotion;\n return _react2.default.createElement('div', _extends({\n className: cx(emotion.css(getStyles('noOptionsMessage', props)), {\n 'menu-notice': true,\n 'menu-notice--no-options': true\n }, className)\n }, innerProps), children);\n};\n\nNoOptionsMessage.defaultProps = {\n children: 'No options'\n};\n\nvar LoadingMessage = exports.LoadingMessage = function LoadingMessage(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps,\n emotion = props.emotion;\n return _react2.default.createElement('div', _extends({\n className: cx(emotion.css(getStyles('loadingMessage', props)), {\n 'menu-notice': true,\n 'menu-notice--loading': true\n }, className)\n }, innerProps), children);\n};\n\nLoadingMessage.defaultProps = {\n children: 'Loading...'\n}; // ==============================\n// Menu Portal\n// ==============================\n\nvar menuPortalCSS = exports.menuPortalCSS = function menuPortalCSS(_ref7) {\n var rect = _ref7.rect,\n offset = _ref7.offset,\n position = _ref7.position;\n return {\n left: rect.left,\n position: position,\n top: offset,\n width: rect.width,\n zIndex: 1\n };\n};\n\nvar MenuPortal = exports.MenuPortal = function (_Component2) {\n _inherits(MenuPortal, _Component2);\n\n function MenuPortal() {\n var _ref8;\n\n var _temp2, _this2, _ret2;\n\n _classCallCheck(this, MenuPortal);\n\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _ret2 = (_temp2 = (_this2 = _possibleConstructorReturn(this, (_ref8 = MenuPortal.__proto__ || Object.getPrototypeOf(MenuPortal)).call.apply(_ref8, [this].concat(args))), _this2), _this2.state = {\n placement: null\n }, _this2.getPortalPlacement = function (_ref9) {\n var placement = _ref9.placement;\n var initialPlacement = coercePlacement(_this2.props.menuPlacement); // avoid re-renders if the placement has not changed\n\n if (placement !== initialPlacement) {\n _this2.setState({\n placement: placement\n });\n }\n }, _temp2), _possibleConstructorReturn(_this2, _ret2);\n }\n\n _createClass(MenuPortal, [{\n key: 'getChildContext',\n value: function getChildContext() {\n return {\n getPortalPlacement: this.getPortalPlacement\n };\n } // callback for occassions where the menu must \"flip\"\n\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n appendTo = _props.appendTo,\n children = _props.children,\n controlElement = _props.controlElement,\n menuPlacement = _props.menuPlacement,\n position = _props.menuPosition,\n getStyles = _props.getStyles,\n emotion = _props.emotion;\n var isFixed = position === 'fixed'; // bail early if required elements aren't present\n\n if (!appendTo && !isFixed || !controlElement) {\n return null;\n }\n\n var placement = this.state.placement || coercePlacement(menuPlacement);\n var rect = (0, _utils.getBoundingClientObj)(controlElement);\n var scrollDistance = isFixed ? 0 : window.pageYOffset;\n var offset = rect[placement] + scrollDistance;\n var state = {\n offset: offset,\n position: position,\n rect: rect\n }; // same wrapper element whether fixed or portalled\n\n var menuWrapper = _react2.default.createElement('div', {\n className: emotion.css(getStyles('menuPortal', state))\n }, children);\n\n return appendTo ? (0, _reactDom.createPortal)(menuWrapper, appendTo) : menuWrapper;\n }\n }]);\n\n return MenuPortal;\n}(_react.Component);\n\nMenuPortal.childContextTypes = {\n getPortalPlacement: _propTypes2.default.func\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.cleanValue = exports.emptyString = exports.noop = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nexports.classNames = classNames;\nexports.handleInputChange = handleInputChange;\nexports.isDocumentElement = isDocumentElement;\nexports.normalizedHeight = normalizedHeight;\nexports.getScrollTop = getScrollTop;\nexports.scrollTo = scrollTo;\nexports.getScrollParent = getScrollParent;\nexports.animatedScrollTo = animatedScrollTo;\nexports.scrollIntoView = scrollIntoView;\nexports.getBoundingClientObj = getBoundingClientObj;\nexports.toKey = toKey;\nexports.isTouchCapable = isTouchCapable;\nexports.isMobileDevice = isMobileDevice;\n\nvar _raf = require('raf');\n\nvar _raf2 = _interopRequireDefault(_raf);\n\nrequire('react');\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n} // ==============================\n// NO OP\n// ==============================\n\n\nvar noop = exports.noop = function noop() {};\n\nvar emptyString = exports.emptyString = function emptyString() {\n return '';\n}; // ==============================\n// Class Name Prefixer\n// ==============================\n\n/**\n String representation of component state for styling with class names.\n\n Expects an array of strings OR a string/object pair:\n - className(['comp', 'comp-arg', 'comp-arg-2'])\n @returns 'react-select__comp react-select__comp-arg react-select__comp-arg-2'\n - className('comp', { some: true, state: false })\n @returns 'react-select__comp react-select__comp--some'\n*/\n\n\nfunction applyPrefixToName(prefix, name) {\n if (!name) {\n return prefix;\n } else if (name[0] === '-') {\n return prefix + name;\n } else {\n return prefix + '__' + name;\n }\n}\n\nfunction classNames(prefix, cssKey, state, className) {\n var arr = [cssKey, className];\n\n if (state && prefix) {\n for (var key in state) {\n if (state.hasOwnProperty(key) && state[key]) {\n arr.push('' + applyPrefixToName(prefix, key));\n }\n }\n }\n\n return arr.filter(function (i) {\n return i;\n }).map(function (i) {\n return String(i).trim();\n }).join(' ');\n} // ==============================\n// Clean Value\n// ==============================\n\n\nvar cleanValue = exports.cleanValue = function cleanValue(value) {\n if (Array.isArray(value)) return value.filter(Boolean);\n if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value !== null) return [value];\n return [];\n}; // ==============================\n// Handle Input Change\n// ==============================\n\n\nfunction handleInputChange(inputValue, actionMeta, onInputChange) {\n if (onInputChange) {\n var newValue = onInputChange(inputValue, actionMeta);\n if (typeof newValue === 'string') return newValue;\n }\n\n return inputValue;\n} // ==============================\n// Scroll Helpers\n// ==============================\n\n\nfunction isDocumentElement(el) {\n return [document.documentElement, document.body, window].indexOf(el) > -1;\n} // Normalized Scroll Top\n// ------------------------------\n\n\nfunction normalizedHeight(el) {\n if (isDocumentElement(el)) {\n return window.innerHeight;\n }\n\n return el.clientHeight;\n} // Normalized scrollTo & scrollTop\n// ------------------------------\n\n\nfunction getScrollTop(el) {\n if (isDocumentElement(el)) {\n return window.pageYOffset;\n }\n\n return el.scrollTop;\n}\n\nfunction scrollTo(el, top) {\n // with a scroll distance, we perform scroll on the element\n if (isDocumentElement(el)) {\n window.scrollTo(0, top);\n return;\n }\n\n el.scrollTop = top;\n} // Get Scroll Parent\n// ------------------------------\n\n\nfunction getScrollParent(element) {\n var style = getComputedStyle(element);\n var excludeStaticParent = style.position === 'absolute';\n var overflowRx = /(auto|scroll)/;\n var docEl = document.documentElement; // suck it, flow...\n\n if (style.position === 'fixed') return docEl;\n\n for (var parent = element; parent = parent.parentElement;) {\n style = getComputedStyle(parent);\n\n if (excludeStaticParent && style.position === 'static') {\n continue;\n }\n\n if (overflowRx.test(style.overflow + style.overflowY + style.overflowX)) {\n return parent;\n }\n }\n\n return docEl;\n} // Animated Scroll To\n// ------------------------------\n\n/**\n @param t: time (elapsed)\n @param b: initial value\n @param c: amount of change\n @param d: duration\n*/\n\n\nfunction easeOutCubic(t, b, c, d) {\n return c * ((t = t / d - 1) * t * t + 1) + b;\n}\n\nfunction animatedScrollTo(element, to) {\n var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 200;\n var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : noop;\n var start = getScrollTop(element);\n var change = to - start;\n var increment = 10;\n var currentTime = 0;\n\n function animateScroll() {\n currentTime += increment;\n var val = easeOutCubic(currentTime, start, change, duration);\n scrollTo(element, val);\n\n if (currentTime < duration) {\n (0, _raf2.default)(animateScroll);\n } else {\n callback(element);\n }\n }\n\n animateScroll();\n} // Scroll Into View\n// ------------------------------\n\n\nfunction scrollIntoView(menuEl, focusedEl) {\n var menuRect = menuEl.getBoundingClientRect();\n var focusedRect = focusedEl.getBoundingClientRect();\n var overScroll = focusedEl.offsetHeight / 3;\n\n if (focusedRect.bottom + overScroll > menuRect.bottom) {\n scrollTo(menuEl, Math.min(focusedEl.offsetTop + focusedEl.clientHeight - menuEl.offsetHeight + overScroll, menuEl.scrollHeight));\n } else if (focusedRect.top - overScroll < menuRect.top) {\n scrollTo(menuEl, Math.max(focusedEl.offsetTop - overScroll, 0));\n }\n} // ==============================\n// Get bounding client object\n// ==============================\n// cannot get keys using array notation with DOMRect\n\n\nfunction getBoundingClientObj(element) {\n var rect = element.getBoundingClientRect();\n return {\n bottom: rect.bottom,\n height: rect.height,\n left: rect.left,\n right: rect.right,\n top: rect.top,\n width: rect.width\n };\n} // ==============================\n// String to Key (kebabify)\n// ==============================\n\n\nfunction toKey(str) {\n return str.replace(/\\W/g, '-');\n} // ==============================\n// Touch Capability Detector\n// ==============================\n\n\nfunction isTouchCapable() {\n try {\n document.createEvent('TouchEvent');\n return true;\n } catch (e) {\n return false;\n }\n} // ==============================\n// Mobile Device Detector\n// ==============================\n\n\nfunction isMobileDevice() {\n try {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n } catch (e) {\n return false;\n }\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _reactDom = require('react-dom');\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar NodeResolver = function (_Component) {\n _inherits(NodeResolver, _Component);\n\n function NodeResolver() {\n _classCallCheck(this, NodeResolver);\n\n return _possibleConstructorReturn(this, (NodeResolver.__proto__ || Object.getPrototypeOf(NodeResolver)).apply(this, arguments));\n }\n\n _createClass(NodeResolver, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.props.innerRef((0, _reactDom.findDOMNode)(this));\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.props.innerRef(null);\n }\n }, {\n key: 'render',\n value: function render() {\n return this.props.children;\n }\n }]);\n\n return NodeResolver;\n}(_react.Component);\n\nexports.default = NodeResolver;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.LoadingIndicator = exports.loadingIndicatorCSS = exports.IndicatorSeparator = exports.indicatorSeparatorCSS = exports.ClearIndicator = exports.clearIndicatorCSS = exports.DropdownIndicator = exports.dropdownIndicatorCSS = exports.DownChevron = exports.CrossIcon = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _templateObject = _taggedTemplateLiteral(['@keyframes ', ' {\\n 0%, 80%, 100% { opacity: 0; }\\n 40% { opacity: 1; }\\n };'], ['@keyframes ', ' {\\n 0%, 80%, 100% { opacity: 0; }\\n 40% { opacity: 1; }\\n };']);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nrequire('create-emotion');\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _taggedTemplateLiteral(strings, raw) {\n return Object.freeze(Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw)\n }\n }));\n}\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n} // ==============================\n// Dropdown & Clear Icons\n// ==============================\n\n\nvar Svg = function Svg(_ref) {\n var size = _ref.size,\n emotion = _ref.emotion,\n props = _objectWithoutProperties(_ref, ['size', 'emotion']);\n\n return _react2.default.createElement('svg', _extends({\n height: size,\n width: size,\n viewBox: '0 0 20 20',\n 'aria-hidden': 'true',\n focusable: 'false',\n className: emotion.css({\n display: 'inline-block',\n fill: 'currentColor',\n lineHeight: 1,\n stroke: 'currentColor',\n strokeWidth: 0\n })\n }, props));\n};\n\nvar CrossIcon = exports.CrossIcon = function CrossIcon(props) {\n return _react2.default.createElement(Svg, _extends({\n size: 20\n }, props), _react2.default.createElement('path', {\n 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'\n }));\n};\n\nvar DownChevron = exports.DownChevron = function DownChevron(props) {\n return _react2.default.createElement(Svg, _extends({\n size: 20\n }, props), _react2.default.createElement('path', {\n 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'\n }));\n}; // ==============================\n// Dropdown & Clear Buttons\n// ==============================\n\n\nvar baseCSS = function baseCSS(_ref2) {\n var isFocused = _ref2.isFocused,\n _ref2$theme = _ref2.theme,\n baseUnit = _ref2$theme.spacing.baseUnit,\n colors = _ref2$theme.colors;\n return {\n color: isFocused ? colors.neutral60 : colors.neutral20,\n display: 'flex',\n padding: baseUnit * 2,\n transition: 'color 150ms',\n ':hover': {\n color: isFocused ? colors.neutral80 : colors.neutral40\n }\n };\n};\n\nvar dropdownIndicatorCSS = exports.dropdownIndicatorCSS = baseCSS;\n\nvar DropdownIndicator = exports.DropdownIndicator = function DropdownIndicator(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps,\n emotion = props.emotion;\n return _react2.default.createElement('div', _extends({}, innerProps, {\n className: cx(emotion.css(getStyles('dropdownIndicator', props)), {\n 'indicator': true,\n 'dropdown-indicator': true\n }, className)\n }), children || _react2.default.createElement(DownChevron, {\n emotion: emotion\n }));\n};\n\nvar clearIndicatorCSS = exports.clearIndicatorCSS = baseCSS;\n\nvar ClearIndicator = exports.ClearIndicator = function ClearIndicator(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps,\n emotion = props.emotion;\n return _react2.default.createElement('div', _extends({}, innerProps, {\n className: cx(emotion.css(getStyles('clearIndicator', props)), {\n 'indicator': true,\n 'clear-indicator': true\n }, className)\n }), children || _react2.default.createElement(CrossIcon, {\n emotion: emotion\n }));\n}; // ==============================\n// Separator\n// ==============================\n\n\nvar indicatorSeparatorCSS = exports.indicatorSeparatorCSS = function indicatorSeparatorCSS(_ref3) {\n var isDisabled = _ref3.isDisabled,\n _ref3$theme = _ref3.theme,\n baseUnit = _ref3$theme.spacing.baseUnit,\n colors = _ref3$theme.colors;\n return {\n alignSelf: 'stretch',\n backgroundColor: isDisabled ? colors.neutral10 : colors.neutral20,\n marginBottom: baseUnit * 2,\n marginTop: baseUnit * 2,\n width: 1\n };\n};\n\nvar IndicatorSeparator = exports.IndicatorSeparator = function IndicatorSeparator(props) {\n var className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps,\n emotion = props.emotion;\n return _react2.default.createElement('span', _extends({}, innerProps, {\n className: cx(emotion.css(getStyles('indicatorSeparator', props)), {\n 'indicator-separator': true\n }, className)\n }));\n}; // ==============================\n// Loading\n// ==============================\n\n\nvar keyframesName = 'react-select-loading-indicator';\nvar keyframesInjected = false;\n\nvar loadingIndicatorCSS = exports.loadingIndicatorCSS = function loadingIndicatorCSS(_ref4) {\n var isFocused = _ref4.isFocused,\n size = _ref4.size,\n _ref4$theme = _ref4.theme,\n colors = _ref4$theme.colors,\n baseUnit = _ref4$theme.spacing.baseUnit;\n return {\n color: isFocused ? colors.neutral60 : colors.neutral20,\n display: 'flex',\n padding: baseUnit * 2,\n transition: 'color 150ms',\n alignSelf: 'center',\n fontSize: size,\n lineHeight: 1,\n marginRight: size,\n textAlign: 'center',\n verticalAlign: 'middle'\n };\n};\n\nvar LoadingDot = function LoadingDot(_ref5) {\n var color = _ref5.color,\n delay = _ref5.delay,\n offset = _ref5.offset,\n emotion = _ref5.emotion;\n return _react2.default.createElement('span', {\n className: emotion.css({\n animationDuration: '1s',\n animationDelay: delay + 'ms',\n animationIterationCount: 'infinite',\n animationName: keyframesName,\n animationTimingFunction: 'ease-in-out',\n backgroundColor: color,\n borderRadius: '1em',\n display: 'inline-block',\n marginLeft: offset ? '1em' : null,\n height: '1em',\n verticalAlign: 'top',\n width: '1em'\n })\n });\n};\n\nvar LoadingIndicator = exports.LoadingIndicator = function LoadingIndicator(props) {\n var className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps,\n isFocused = props.isFocused,\n isRtl = props.isRtl,\n emotion = props.emotion,\n colors = props.theme.colors;\n var color = isFocused ? colors.neutral80 : colors.neutral20;\n\n if (!keyframesInjected) {\n // eslint-disable-next-line no-unused-expressions\n emotion.injectGlobal(_templateObject, keyframesName);\n keyframesInjected = true;\n }\n\n return _react2.default.createElement('div', _extends({}, innerProps, {\n className: cx(emotion.css(getStyles('loadingIndicator', props)), {\n 'indicator': true,\n 'loading-indicator': true\n }, className)\n }), _react2.default.createElement(LoadingDot, {\n emotion: emotion,\n color: color,\n delay: 0,\n offset: isRtl\n }), _react2.default.createElement(LoadingDot, {\n emotion: emotion,\n color: color,\n delay: 160,\n offset: true\n }), _react2.default.createElement(LoadingDot, {\n emotion: emotion,\n color: color,\n delay: 320,\n offset: !isRtl\n }));\n};\n\nLoadingIndicator.defaultProps = {\n size: 4\n};","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\n\nconst ColumnLink = ({ icon, text, to, onClick, href, method, badge }) => {\n const badgeElement = typeof badge !== 'undefined' ? {badge} : null;\n\n if (href) {\n return (\n \n \n {text}\n {badgeElement}\n \n );\n } else if (to) {\n return (\n \n \n {text}\n {badgeElement}\n \n );\n } else {\n const handleOnClick = (e) => {\n e.preventDefault();\n e.stopPropagation();\n return onClick(e);\n }\n return (\n \n \n {text}\n {badgeElement}\n \n );\n }\n};\n\nColumnLink.propTypes = {\n icon: PropTypes.string.isRequired,\n text: PropTypes.string.isRequired,\n to: PropTypes.string,\n onClick: PropTypes.func,\n href: PropTypes.string,\n method: PropTypes.string,\n badge: PropTypes.node,\n};\n\nexport default ColumnLink;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst ColumnSubheading = ({ text }) => {\n return (\n \n {text}\n
\n );\n};\n\nColumnSubheading.propTypes = {\n text: PropTypes.string.isRequired,\n};\n\nexport default ColumnSubheading;\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport PropTypes from 'prop-types';\n\nexport default class ColumnBackButton extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n handleClick = () => {\n // if history is exhausted, or we would leave mastodon, just go to root.\n if (window.history.state) {\n this.context.router.history.goBack();\n } else {\n this.context.router.history.push('/');\n }\n }\n\n render () {\n return (\n \n \n \n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Toggle from 'react-toggle';\n\nexport default class SettingToggle extends React.PureComponent {\n\n static propTypes = {\n prefix: PropTypes.string,\n settings: ImmutablePropTypes.map.isRequired,\n settingPath: PropTypes.array.isRequired,\n label: PropTypes.node.isRequired,\n onChange: PropTypes.func.isRequired,\n }\n\n onChange = ({ target }) => {\n this.props.onChange(this.props.settingPath, target.checked);\n }\n\n render () {\n const { prefix, settings, settingPath, label } = this.props;\n const id = ['setting-toggle', prefix, ...settingPath].filter(Boolean).join('-');\n\n return (\n \n \n {label} \n
\n );\n }\n\n}\n","\n// Get the bounding client rect from an IntersectionObserver entry.\n// This is to work around a bug in Chrome: https://crbug.com/737228\n\nlet hasBoundingRectBug;\n\nfunction getRectFromEntry(entry) {\n if (typeof hasBoundingRectBug !== 'boolean') {\n const boundingRect = entry.target.getBoundingClientRect();\n const observerRect = entry.boundingClientRect;\n hasBoundingRectBug = boundingRect.height !== observerRect.height ||\n boundingRect.top !== observerRect.top ||\n boundingRect.width !== observerRect.width ||\n boundingRect.bottom !== observerRect.bottom ||\n boundingRect.left !== observerRect.left ||\n boundingRect.right !== observerRect.right;\n }\n return hasBoundingRectBug ? entry.target.getBoundingClientRect() : entry.boundingClientRect;\n}\n\nexport default getRectFromEntry;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport scheduleIdleTask from 'flavours/glitch/util/schedule_idle_task';\nimport getRectFromEntry from 'flavours/glitch/util/get_rect_from_entry';\n\nexport default class IntersectionObserverArticle extends ImmutablePureComponent {\n\n static propTypes = {\n intersectionObserverWrapper: PropTypes.object.isRequired,\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n index: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n listLength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n saveHeightKey: PropTypes.string,\n cachedHeight: PropTypes.number,\n onHeightChange: PropTypes.func,\n children: PropTypes.node,\n };\n\n state = {\n isHidden: false, // set to true in requestIdleCallback to trigger un-render\n }\n\n shouldComponentUpdate (nextProps, nextState) {\n if (!nextState.isIntersecting && nextState.isHidden) {\n // It's only if we're not intersecting (i.e. offscreen) and isHidden is true\n // that either \"isIntersecting\" or \"isHidden\" matter, and then they're\n // the only things that matter (and updated ARIA attributes).\n return this.state.isIntersecting || !this.state.isHidden || nextProps.listLength !== this.props.listLength;\n } else if (nextState.isIntersecting && !this.state.isIntersecting) {\n // If we're going from a non-intersecting state to an intersecting state,\n // (i.e. offscreen to onscreen), then we definitely need to re-render\n return true;\n }\n // Otherwise, diff based on \"updateOnProps\" and \"updateOnStates\"\n return super.shouldComponentUpdate(nextProps, nextState);\n }\n\n componentDidMount () {\n const { intersectionObserverWrapper, id } = this.props;\n\n intersectionObserverWrapper.observe(\n id,\n this.node,\n this.handleIntersection\n );\n\n this.componentMounted = true;\n }\n\n componentWillUnmount () {\n const { intersectionObserverWrapper, id } = this.props;\n intersectionObserverWrapper.unobserve(id, this.node);\n\n this.componentMounted = false;\n }\n\n handleIntersection = (entry) => {\n this.entry = entry;\n\n scheduleIdleTask(this.calculateHeight);\n this.setState(this.updateStateAfterIntersection);\n }\n\n updateStateAfterIntersection = (prevState) => {\n if (prevState.isIntersecting !== false && !this.entry.isIntersecting) {\n scheduleIdleTask(this.hideIfNotIntersecting);\n }\n return {\n isIntersecting: this.entry.isIntersecting,\n isHidden: false,\n };\n }\n\n calculateHeight = () => {\n const { onHeightChange, saveHeightKey, id } = this.props;\n // save the height of the fully-rendered element (this is expensive\n // on Chrome, where we need to fall back to getBoundingClientRect)\n this.height = getRectFromEntry(this.entry).height;\n\n if (onHeightChange && saveHeightKey) {\n onHeightChange(saveHeightKey, id, this.height);\n }\n }\n\n hideIfNotIntersecting = () => {\n if (!this.componentMounted) {\n return;\n }\n\n // When the browser gets a chance, test if we're still not intersecting,\n // and if so, set our isHidden to true to trigger an unrender. The point of\n // this is to save DOM nodes and avoid using up too much memory.\n // See: https://github.com/tootsuite/mastodon/issues/2900\n this.setState((prevState) => ({ isHidden: !prevState.isIntersecting }));\n }\n\n handleRef = (node) => {\n this.node = node;\n }\n\n render () {\n const { children, id, index, listLength, cachedHeight } = this.props;\n const { isIntersecting, isHidden } = this.state;\n\n const style = {};\n\n if (!isIntersecting && (isHidden || cachedHeight)) {\n style.height = `${this.height || cachedHeight || 150}px`;\n style.opacity = 0;\n style.overflow = 'hidden';\n }\n\n return (\n \n {children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || cachedHeight) })}\n \n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport IntersectionObserverArticle from 'flavours/glitch/components/intersection_observer_article';\nimport { setHeight } from 'flavours/glitch/actions/height_cache';\n\nconst makeMapStateToProps = (state, props) => ({\n cachedHeight: state.getIn(['height_cache', props.saveHeightKey, props.id]),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n\n onHeightChange (key, id, height) {\n dispatch(setHeight(key, id, height));\n },\n\n});\n\nexport default connect(makeMapStateToProps, mapDispatchToProps)(IntersectionObserverArticle);\n","// Wrapper for IntersectionObserver in order to make working with it\n// a bit easier. We also follow this performance advice:\n// \"If you need to observe multiple elements, it is both possible and\n// advised to observe multiple elements using the same IntersectionObserver\n// instance by calling observe() multiple times.\"\n// https://developers.google.com/web/updates/2016/04/intersectionobserver\n\nclass IntersectionObserverWrapper {\n\n callbacks = {};\n observerBacklog = [];\n observer = null;\n\n connect (options) {\n const onIntersection = (entries) => {\n entries.forEach(entry => {\n const id = entry.target.getAttribute('data-id');\n if (this.callbacks[id]) {\n this.callbacks[id](entry);\n }\n });\n };\n\n this.observer = new IntersectionObserver(onIntersection, options);\n this.observerBacklog.forEach(([ id, node, callback ]) => {\n this.observe(id, node, callback);\n });\n this.observerBacklog = null;\n }\n\n observe (id, node, callback) {\n if (!this.observer) {\n this.observerBacklog.push([ id, node, callback ]);\n } else {\n this.callbacks[id] = callback;\n this.observer.observe(node);\n }\n }\n\n unobserve (id, node) {\n if (this.observer) {\n delete this.callbacks[id];\n this.observer.unobserve(node);\n }\n }\n\n disconnect () {\n if (this.observer) {\n this.callbacks = {};\n this.observer.disconnect();\n this.observer = null;\n }\n }\n\n}\n\nexport default IntersectionObserverWrapper;\n","import React, { PureComponent } from 'react';\nimport { ScrollContainer } from 'react-router-scroll-4';\nimport PropTypes from 'prop-types';\nimport IntersectionObserverArticleContainer from 'flavours/glitch/containers/intersection_observer_article_container';\nimport LoadMore from './load_more';\nimport IntersectionObserverWrapper from 'flavours/glitch/util/intersection_observer_wrapper';\nimport { throttle } from 'lodash';\nimport { List as ImmutableList } from 'immutable';\nimport classNames from 'classnames';\nimport { attachFullscreenListener, detachFullscreenListener, isFullscreen } from 'flavours/glitch/util/fullscreen';\nimport LoadingIndicator from './loading_indicator';\n\nconst MOUSE_IDLE_DELAY = 300;\n\nexport default class ScrollableList extends PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n scrollKey: PropTypes.string.isRequired,\n onLoadMore: PropTypes.func,\n onScrollToTop: PropTypes.func,\n onScroll: PropTypes.func,\n trackScroll: PropTypes.bool,\n shouldUpdateScroll: PropTypes.func,\n isLoading: PropTypes.bool,\n showLoading: PropTypes.bool,\n hasMore: PropTypes.bool,\n prepend: PropTypes.node,\n alwaysPrepend: PropTypes.bool,\n emptyMessage: PropTypes.node,\n children: PropTypes.node,\n };\n\n static defaultProps = {\n trackScroll: true,\n };\n\n state = {\n fullscreen: null,\n cachedMediaWidth: 300,\n };\n\n intersectionObserverWrapper = new IntersectionObserverWrapper();\n\n handleScroll = throttle(() => {\n if (this.node) {\n const { scrollTop, scrollHeight, clientHeight } = this.node;\n const offset = scrollHeight - scrollTop - clientHeight;\n\n if (400 > offset && this.props.onLoadMore && this.props.hasMore && !this.props.isLoading) {\n this.props.onLoadMore();\n }\n\n if (scrollTop < 100 && this.props.onScrollToTop) {\n this.props.onScrollToTop();\n } else if (this.props.onScroll) {\n this.props.onScroll();\n }\n\n if (!this.lastScrollWasSynthetic) {\n // If the last scroll wasn't caused by setScrollTop(), assume it was\n // intentional and cancel any pending scroll reset on mouse idle\n this.scrollToTopOnMouseIdle = false;\n }\n this.lastScrollWasSynthetic = false;\n }\n }, 150, {\n trailing: true,\n });\n\n mouseIdleTimer = null;\n mouseMovedRecently = false;\n lastScrollWasSynthetic = false;\n scrollToTopOnMouseIdle = false;\n\n setScrollTop = newScrollTop => {\n if (this.node.scrollTop !== newScrollTop) {\n this.lastScrollWasSynthetic = true;\n this.node.scrollTop = newScrollTop;\n }\n };\n\n clearMouseIdleTimer = () => {\n if (this.mouseIdleTimer === null) {\n return;\n }\n clearTimeout(this.mouseIdleTimer);\n this.mouseIdleTimer = null;\n };\n\n handleMouseMove = throttle(() => {\n // As long as the mouse keeps moving, clear and restart the idle timer.\n this.clearMouseIdleTimer();\n this.mouseIdleTimer =\n setTimeout(this.handleMouseIdle, MOUSE_IDLE_DELAY);\n\n if (!this.mouseMovedRecently && this.node.scrollTop === 0) {\n // Only set if we just started moving and are scrolled to the top.\n this.scrollToTopOnMouseIdle = true;\n }\n // Save setting this flag for last, so we can do the comparison above.\n this.mouseMovedRecently = true;\n }, MOUSE_IDLE_DELAY / 2);\n\n handleWheel = throttle(() => {\n this.scrollToTopOnMouseIdle = false;\n }, 150, {\n trailing: true,\n });\n\n handleMouseIdle = () => {\n if (this.scrollToTopOnMouseIdle) {\n this.setScrollTop(0);\n }\n this.mouseMovedRecently = false;\n this.scrollToTopOnMouseIdle = false;\n }\n\n componentDidMount () {\n this.attachScrollListener();\n this.attachIntersectionObserver();\n attachFullscreenListener(this.onFullScreenChange);\n\n // Handle initial scroll posiiton\n this.handleScroll();\n }\n\n getScrollPosition = () => {\n if (this.node && (this.node.scrollTop > 0 || this.mouseMovedRecently)) {\n return {height: this.node.scrollHeight, top: this.node.scrollTop};\n } else {\n return null;\n }\n }\n\n updateScrollBottom = (snapshot) => {\n const newScrollTop = this.node.scrollHeight - snapshot;\n\n this.setScrollTop(newScrollTop);\n }\n\n cacheMediaWidth = (width) => {\n if (width && this.state.cachedMediaWidth != width) this.setState({ cachedMediaWidth: width });\n }\n\n getSnapshotBeforeUpdate (prevProps, prevState) {\n const someItemInserted = React.Children.count(prevProps.children) > 0 &&\n React.Children.count(prevProps.children) < React.Children.count(this.props.children) &&\n this.getFirstChildKey(prevProps) !== this.getFirstChildKey(this.props);\n if (someItemInserted && (this.node.scrollTop > 0 || this.mouseMovedRecently)) {\n return this.node.scrollHeight - this.node.scrollTop;\n } else {\n return null;\n }\n }\n\n componentDidUpdate (prevProps, prevState, snapshot) {\n // Reset the scroll position when a new child comes in in order not to\n // jerk the scrollbar around if you're already scrolled down the page.\n if (snapshot !== null) this.updateScrollBottom(snapshot);\n }\n\n componentWillUnmount () {\n this.clearMouseIdleTimer();\n this.detachScrollListener();\n this.detachIntersectionObserver();\n detachFullscreenListener(this.onFullScreenChange);\n }\n\n onFullScreenChange = () => {\n this.setState({ fullscreen: isFullscreen() });\n }\n\n attachIntersectionObserver () {\n this.intersectionObserverWrapper.connect({\n root: this.node,\n rootMargin: '300% 0px',\n });\n }\n\n detachIntersectionObserver () {\n this.intersectionObserverWrapper.disconnect();\n }\n\n attachScrollListener () {\n this.node.addEventListener('scroll', this.handleScroll);\n this.node.addEventListener('wheel', this.handleWheel);\n }\n\n detachScrollListener () {\n this.node.removeEventListener('scroll', this.handleScroll);\n this.node.removeEventListener('wheel', this.handleWheel);\n }\n\n getFirstChildKey (props) {\n const { children } = props;\n let firstChild = children;\n\n if (children instanceof ImmutableList) {\n firstChild = children.get(0);\n } else if (Array.isArray(children)) {\n firstChild = children[0];\n }\n\n return firstChild && firstChild.key;\n }\n\n setRef = (c) => {\n this.node = c;\n }\n\n handleLoadMore = e => {\n e.preventDefault();\n this.props.onLoadMore();\n }\n\n defaultShouldUpdateScroll = (prevRouterProps, { location }) => {\n if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;\n return !(location.state && location.state.mastodonModalOpen);\n }\n\n render () {\n const { children, scrollKey, trackScroll, shouldUpdateScroll, showLoading, isLoading, hasMore, prepend, alwaysPrepend, emptyMessage, onLoadMore } = this.props;\n const { fullscreen } = this.state;\n const childrenCount = React.Children.count(children);\n\n const loadMore = (hasMore && onLoadMore) ? : null;\n let scrollableArea = null;\n\n if (showLoading) {\n scrollableArea = (\n \n
\n {prepend}\n
\n\n
\n \n
\n
\n );\n } else if (isLoading || childrenCount > 0 || hasMore || !emptyMessage) {\n scrollableArea = (\n \n
\n {prepend}\n\n {React.Children.map(this.props.children, (child, index) => (\n \n {React.cloneElement(child, {\n getScrollPosition: this.getScrollPosition,\n updateScrollBottom: this.updateScrollBottom,\n cachedMediaWidth: this.state.cachedMediaWidth,\n cacheMediaWidth: this.cacheMediaWidth,\n })}\n \n ))}\n\n {loadMore}\n
\n
\n );\n } else {\n scrollableArea = (\n \n {alwaysPrepend && prepend}\n\n
\n {emptyMessage}\n
\n
\n );\n }\n\n if (trackScroll) {\n return (\n \n {scrollableArea}\n \n );\n } else {\n return scrollableArea;\n }\n }\n\n}\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};","var hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\n\nvar defined = require('./_defined');\n\nmodule.exports = function (it) {\n return IObject(defined(it));\n};","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\n\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};","// Package imports.\nimport React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport {\n FormattedMessage,\n defineMessages,\n} from 'react-intl';\n\n// Components.\nimport Avatar from 'flavours/glitch/components/avatar';\nimport Permalink from 'flavours/glitch/components/permalink';\n\n// Utils.\nimport { hiddenComponent } from 'flavours/glitch/util/react_helpers';\nimport { profileLink } from 'flavours/glitch/util/backend_links';\n\n// Messages.\nconst messages = defineMessages({\n edit: {\n defaultMessage: 'Edit profile',\n id: 'navigation_bar.edit_profile',\n },\n});\n\n// The component.\nexport default function DrawerAccount ({ account }) {\n\n // We need an account to render.\n if (!account) {\n return (\n \n { profileLink !== undefined && (\n
\n \n \n )}\n
\n );\n }\n\n // The result.\n return (\n \n
\n {account.get('acct')} \n \n \n
\n @{account.get('acct')} \n \n { profileLink !== undefined && (\n
\n )}\n
\n );\n}\n\n// Props.\nDrawerAccount.propTypes = { account: ImmutablePropTypes.map };\n","(function webpackUniversalModuleDefinition(root, factory) {\n if (typeof exports === 'object' && typeof module === 'object') module.exports = factory(require(\"react\"));else if (typeof define === 'function' && define.amd) define([\"react\"], factory);else if (typeof exports === 'object') exports[\"ReactSparklines\"] = factory(require(\"react\"));else root[\"ReactSparklines\"] = factory(root[\"React\"]);\n})(this, function (__WEBPACK_EXTERNAL_MODULE_1__) {\n return (\n /******/\n function (modules) {\n // webpackBootstrap\n\n /******/\n // The module cache\n\n /******/\n var installedModules = {};\n /******/\n\n /******/\n // The require function\n\n /******/\n\n function __webpack_require__(moduleId) {\n /******/\n\n /******/\n // Check if module is in cache\n\n /******/\n if (installedModules[moduleId]) {\n /******/\n return installedModules[moduleId].exports;\n /******/\n }\n /******/\n // Create a new module (and put it into the cache)\n\n /******/\n\n\n var module = installedModules[moduleId] = {\n /******/\n i: moduleId,\n\n /******/\n l: false,\n\n /******/\n exports: {}\n /******/\n\n };\n /******/\n\n /******/\n // Execute the module function\n\n /******/\n\n modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n /******/\n\n /******/\n // Flag the module as loaded\n\n /******/\n\n module.l = true;\n /******/\n\n /******/\n // Return the exports of the module\n\n /******/\n\n return module.exports;\n /******/\n }\n /******/\n\n /******/\n\n /******/\n // expose the modules object (__webpack_modules__)\n\n /******/\n\n\n __webpack_require__.m = modules;\n /******/\n\n /******/\n // expose the module cache\n\n /******/\n\n __webpack_require__.c = installedModules;\n /******/\n\n /******/\n // define getter function for harmony exports\n\n /******/\n\n __webpack_require__.d = function (exports, name, getter) {\n /******/\n if (!__webpack_require__.o(exports, name)) {\n /******/\n Object.defineProperty(exports, name, {\n /******/\n configurable: false,\n\n /******/\n enumerable: true,\n\n /******/\n get: getter\n /******/\n\n });\n /******/\n }\n /******/\n\n };\n /******/\n\n /******/\n // getDefaultExport function for compatibility with non-harmony modules\n\n /******/\n\n\n __webpack_require__.n = function (module) {\n /******/\n var getter = module && module.__esModule ?\n /******/\n function getDefault() {\n return module['default'];\n } :\n /******/\n function getModuleExports() {\n return module;\n };\n /******/\n\n __webpack_require__.d(getter, 'a', getter);\n /******/\n\n\n return getter;\n /******/\n };\n /******/\n\n /******/\n // Object.prototype.hasOwnProperty.call\n\n /******/\n\n\n __webpack_require__.o = function (object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n };\n /******/\n\n /******/\n // __webpack_public_path__\n\n /******/\n\n\n __webpack_require__.p = \"/\";\n /******/\n\n /******/\n // Load entry module and return exports\n\n /******/\n\n return __webpack_require__(__webpack_require__.s = 11);\n /******/\n }(\n /************************************************************************/\n\n /******/\n [\n /* 0 */\n\n /***/\n function (module, exports, __webpack_require__) {\n /* WEBPACK VAR INJECTION */\n (function (process) {\n /**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n if (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element') || 0xeac7;\n\n var isValidElement = function isValidElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }; // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n\n\n var throwOnDirectAccess = true;\n module.exports = __webpack_require__(14)(isValidElement, throwOnDirectAccess);\n } else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = __webpack_require__(16)();\n }\n /* WEBPACK VAR INJECTION */\n\n }).call(exports, __webpack_require__(2));\n /***/\n },\n /* 1 */\n\n /***/\n function (module, exports) {\n module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n /***/\n },\n /* 2 */\n\n /***/\n function (module, exports) {\n // shim for using process in browser\n var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it\n // don't break things. But we need to wrap it in a try catch in case it is\n // wrapped in strict mode code which doesn't define any globals. It's inside a\n // function because try/catches deoptimize in certain engines.\n\n var cachedSetTimeout;\n var cachedClearTimeout;\n\n function defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n }\n\n function defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n }\n\n (function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n })();\n\n function runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n } // if setTimeout wasn't available but was latter defined\n\n\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n }\n\n function runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n } // if clearTimeout wasn't available but was latter defined\n\n\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n }\n\n var queue = [];\n var draining = false;\n var currentQueue;\n var queueIndex = -1;\n\n function cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n\n draining = false;\n\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n\n if (queue.length) {\n drainQueue();\n }\n }\n\n function drainQueue() {\n if (draining) {\n return;\n }\n\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n var len = queue.length;\n\n while (len) {\n currentQueue = queue;\n queue = [];\n\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n\n queueIndex = -1;\n len = queue.length;\n }\n\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n }\n\n process.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n\n queue.push(new Item(fun, args));\n\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n }; // v8 likes predictible objects\n\n\n function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }\n\n Item.prototype.run = function () {\n this.fun.apply(null, this.array);\n };\n\n process.title = 'browser';\n process.browser = true;\n process.env = {};\n process.argv = [];\n process.version = ''; // empty string to avoid regexp issues\n\n process.versions = {};\n\n function noop() {}\n\n process.on = noop;\n process.addListener = noop;\n process.once = noop;\n process.off = noop;\n process.removeListener = noop;\n process.removeAllListeners = noop;\n process.emit = noop;\n process.prependListener = noop;\n process.prependOnceListener = noop;\n\n process.listeners = function (name) {\n return [];\n };\n\n process.binding = function (name) {\n throw new Error('process.binding is not supported');\n };\n\n process.cwd = function () {\n return '/';\n };\n\n process.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n };\n\n process.umask = function () {\n return 0;\n };\n /***/\n\n },\n /* 3 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n exports.default = function (data) {\n return data.reduce(function (a, b) {\n return a + b;\n }) / data.length;\n };\n /***/\n\n },\n /* 4 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n /**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * \n */\n\n function makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n }\n /**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\n\n\n var emptyFunction = function emptyFunction() {};\n\n emptyFunction.thatReturns = makeEmptyFunction;\n emptyFunction.thatReturnsFalse = makeEmptyFunction(false);\n emptyFunction.thatReturnsTrue = makeEmptyFunction(true);\n emptyFunction.thatReturnsNull = makeEmptyFunction(null);\n\n emptyFunction.thatReturnsThis = function () {\n return this;\n };\n\n emptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n };\n\n module.exports = emptyFunction;\n /***/\n },\n /* 5 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n /* WEBPACK VAR INJECTION */\n\n (function (process) {\n /**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n /**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n var validateFormat = function validateFormat(format) {};\n\n if (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n }\n\n function invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n\n throw error;\n }\n }\n\n module.exports = invariant;\n /* WEBPACK VAR INJECTION */\n }).call(exports, __webpack_require__(2));\n /***/\n },\n /* 6 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n /**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n module.exports = ReactPropTypesSecret;\n /***/\n },\n /* 7 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n exports.default = function (data) {\n return Math.min.apply(Math, data);\n };\n /***/\n\n },\n /* 8 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n /* WEBPACK VAR INJECTION */\n\n (function (process) {\n /**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n var emptyFunction = __webpack_require__(4);\n /**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\n\n var warning = emptyFunction;\n\n if (process.env.NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n }\n\n module.exports = warning;\n /* WEBPACK VAR INJECTION */\n }).call(exports, __webpack_require__(2));\n /***/\n },\n /* 9 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n exports.default = function (data) {\n return Math.max.apply(Math, data);\n };\n /***/\n\n },\n /* 10 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _mean = __webpack_require__(3);\n\n var _mean2 = _interopRequireDefault(_mean);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n exports.default = function (data) {\n var dataMean = (0, _mean2.default)(data);\n var sqDiff = data.map(function (n) {\n return Math.pow(n - dataMean, 2);\n });\n var avgSqDiff = (0, _mean2.default)(sqDiff);\n return Math.sqrt(avgSqDiff);\n };\n /***/\n\n },\n /* 11 */\n\n /***/\n function (module, exports, __webpack_require__) {\n module.exports = __webpack_require__(12);\n /***/\n },\n /* 12 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n module.exports = __webpack_require__(13);\n /***/\n },\n /* 13 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.SparklinesText = exports.SparklinesNormalBand = exports.SparklinesReferenceLine = exports.SparklinesSpots = exports.SparklinesBars = exports.SparklinesCurve = exports.SparklinesLine = exports.Sparklines = undefined;\n\n var _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var _propTypes = __webpack_require__(0);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n var _react = __webpack_require__(1);\n\n var _react2 = _interopRequireDefault(_react);\n\n var _SparklinesText = __webpack_require__(17);\n\n var _SparklinesText2 = _interopRequireDefault(_SparklinesText);\n\n var _SparklinesLine = __webpack_require__(18);\n\n var _SparklinesLine2 = _interopRequireDefault(_SparklinesLine);\n\n var _SparklinesCurve = __webpack_require__(19);\n\n var _SparklinesCurve2 = _interopRequireDefault(_SparklinesCurve);\n\n var _SparklinesBars = __webpack_require__(20);\n\n var _SparklinesBars2 = _interopRequireDefault(_SparklinesBars);\n\n var _SparklinesSpots = __webpack_require__(21);\n\n var _SparklinesSpots2 = _interopRequireDefault(_SparklinesSpots);\n\n var _SparklinesReferenceLine = __webpack_require__(22);\n\n var _SparklinesReferenceLine2 = _interopRequireDefault(_SparklinesReferenceLine);\n\n var _SparklinesNormalBand = __webpack_require__(27);\n\n var _SparklinesNormalBand2 = _interopRequireDefault(_SparklinesNormalBand);\n\n var _dataToPoints = __webpack_require__(28);\n\n var _dataToPoints2 = _interopRequireDefault(_dataToPoints);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n }\n\n var Sparklines = function (_PureComponent) {\n _inherits(Sparklines, _PureComponent);\n\n function Sparklines(props) {\n _classCallCheck(this, Sparklines);\n\n return _possibleConstructorReturn(this, (Sparklines.__proto__ || Object.getPrototypeOf(Sparklines)).call(this, props));\n }\n\n _createClass(Sparklines, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n data = _props.data,\n limit = _props.limit,\n width = _props.width,\n height = _props.height,\n svgWidth = _props.svgWidth,\n svgHeight = _props.svgHeight,\n preserveAspectRatio = _props.preserveAspectRatio,\n margin = _props.margin,\n style = _props.style,\n max = _props.max,\n min = _props.min;\n if (data.length === 0) return null;\n var points = (0, _dataToPoints2.default)({\n data: data,\n limit: limit,\n width: width,\n height: height,\n margin: margin,\n max: max,\n min: min\n });\n var svgOpts = {\n style: style,\n viewBox: '0 0 ' + width + ' ' + height,\n preserveAspectRatio: preserveAspectRatio\n };\n if (svgWidth > 0) svgOpts.width = svgWidth;\n if (svgHeight > 0) svgOpts.height = svgHeight;\n return _react2.default.createElement('svg', svgOpts, _react2.default.Children.map(this.props.children, function (child) {\n return _react2.default.cloneElement(child, {\n data: data,\n points: points,\n width: width,\n height: height,\n margin: margin\n });\n }));\n }\n }]);\n\n return Sparklines;\n }(_react.PureComponent);\n\n Sparklines.propTypes = {\n data: _propTypes2.default.array,\n limit: _propTypes2.default.number,\n width: _propTypes2.default.number,\n height: _propTypes2.default.number,\n svgWidth: _propTypes2.default.number,\n svgHeight: _propTypes2.default.number,\n preserveAspectRatio: _propTypes2.default.string,\n margin: _propTypes2.default.number,\n style: _propTypes2.default.object,\n min: _propTypes2.default.number,\n max: _propTypes2.default.number,\n onMouseMove: _propTypes2.default.func\n };\n Sparklines.defaultProps = {\n data: [],\n width: 240,\n height: 60,\n //Scale the graphic content of the given element non-uniformly if necessary such that the element's bounding box exactly matches the viewport rectangle.\n preserveAspectRatio: 'none',\n //https://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute\n margin: 2\n };\n exports.Sparklines = Sparklines;\n exports.SparklinesLine = _SparklinesLine2.default;\n exports.SparklinesCurve = _SparklinesCurve2.default;\n exports.SparklinesBars = _SparklinesBars2.default;\n exports.SparklinesSpots = _SparklinesSpots2.default;\n exports.SparklinesReferenceLine = _SparklinesReferenceLine2.default;\n exports.SparklinesNormalBand = _SparklinesNormalBand2.default;\n exports.SparklinesText = _SparklinesText2.default;\n /***/\n },\n /* 14 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n /* WEBPACK VAR INJECTION */\n\n (function (process) {\n /**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n var emptyFunction = __webpack_require__(4);\n\n var invariant = __webpack_require__(5);\n\n var warning = __webpack_require__(8);\n\n var ReactPropTypesSecret = __webpack_require__(6);\n\n var checkPropTypes = __webpack_require__(15);\n\n module.exports = function (isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n\n var ANONYMOUS = '<>'; // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker\n };\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n\n /*eslint-disable no-self-compare*/\n\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n\n\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n } // Make `instanceof Error` still work for returned errors.\n\n\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n invariant(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n\n if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3) {\n warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName);\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n\n var propValue = props[propName];\n\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n\n if (error instanceof Error) {\n return error;\n }\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n\n var propValue = props[propName];\n var propType = getPropType(propValue);\n\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n\n if (error instanceof Error) {\n return error;\n }\n }\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n\n if (typeof checker !== 'function') {\n warning(false, 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' + 'received %s at index %s.', getPostfixForTypeWarning(checker), i);\n return emptyFunction.thatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n\n if (!checker) {\n continue;\n }\n\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n\n if (error) {\n return error;\n }\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n\n case 'boolean':\n return !propValue;\n\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n } // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n\n\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n } // Fallback for non-spec compliant Symbols which are polyfilled.\n\n\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n } // Equivalent of `typeof` but with special handling for array and regexp.\n\n\n function getPropType(propValue) {\n var propType = typeof propValue;\n\n if (Array.isArray(propValue)) {\n return 'array';\n }\n\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n\n return propType;\n } // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n\n\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n\n var propType = getPropType(propValue);\n\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n\n return propType;\n } // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n\n\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n\n default:\n return type;\n }\n } // Returns class name of the object, if any.\n\n\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n return ReactPropTypes;\n };\n /* WEBPACK VAR INJECTION */\n\n }).call(exports, __webpack_require__(2));\n /***/\n },\n /* 15 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n /* WEBPACK VAR INJECTION */\n\n (function (process) {\n /**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n if (process.env.NODE_ENV !== 'production') {\n var invariant = __webpack_require__(5);\n\n var warning = __webpack_require__(8);\n\n var ReactPropTypesSecret = __webpack_require__(6);\n\n var loggedTypeFailures = {};\n }\n /**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\n\n\n function checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n\n warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n var stack = getStack ? getStack() : '';\n warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n }\n }\n }\n }\n }\n\n module.exports = checkPropTypes;\n /* WEBPACK VAR INJECTION */\n }).call(exports, __webpack_require__(2));\n /***/\n },\n /* 16 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n /**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n var emptyFunction = __webpack_require__(4);\n\n var invariant = __webpack_require__(5);\n\n var ReactPropTypesSecret = __webpack_require__(6);\n\n module.exports = function () {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n\n invariant(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n }\n\n ;\n shim.isRequired = shim;\n\n function getShim() {\n return shim;\n }\n\n ; // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim\n };\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n return ReactPropTypes;\n };\n /***/\n\n },\n /* 17 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var _propTypes = __webpack_require__(0);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n var _react = __webpack_require__(1);\n\n var _react2 = _interopRequireDefault(_react);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n }\n\n var SparklinesText = function (_React$Component) {\n _inherits(SparklinesText, _React$Component);\n\n function SparklinesText() {\n _classCallCheck(this, SparklinesText);\n\n return _possibleConstructorReturn(this, (SparklinesText.__proto__ || Object.getPrototypeOf(SparklinesText)).apply(this, arguments));\n }\n\n _createClass(SparklinesText, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n point = _props.point,\n text = _props.text,\n fontSize = _props.fontSize,\n fontFamily = _props.fontFamily;\n var x = point.x,\n y = point.y;\n return _react2.default.createElement('g', null, _react2.default.createElement('text', {\n x: x,\n y: y,\n fontFamily: fontFamily || \"Verdana\",\n fontSize: fontSize || 10\n }, text));\n }\n }]);\n\n return SparklinesText;\n }(_react2.default.Component);\n\n SparklinesText.propTypes = {\n text: _propTypes2.default.string,\n point: _propTypes2.default.object,\n fontSize: _propTypes2.default.number,\n fontFamily: _propTypes2.default.string\n };\n SparklinesText.defaultProps = {\n text: '',\n point: {\n x: 0,\n y: 0\n }\n };\n exports.default = SparklinesText;\n /***/\n },\n /* 18 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var _propTypes = __webpack_require__(0);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n var _react = __webpack_require__(1);\n\n var _react2 = _interopRequireDefault(_react);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n }\n\n var SparklinesLine = function (_React$Component) {\n _inherits(SparklinesLine, _React$Component);\n\n function SparklinesLine() {\n _classCallCheck(this, SparklinesLine);\n\n return _possibleConstructorReturn(this, (SparklinesLine.__proto__ || Object.getPrototypeOf(SparklinesLine)).apply(this, arguments));\n }\n\n _createClass(SparklinesLine, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n data = _props.data,\n points = _props.points,\n width = _props.width,\n height = _props.height,\n margin = _props.margin,\n color = _props.color,\n style = _props.style,\n onMouseMove = _props.onMouseMove;\n var linePoints = points.map(function (p) {\n return [p.x, p.y];\n }).reduce(function (a, b) {\n return a.concat(b);\n });\n var closePolyPoints = [points[points.length - 1].x, height - margin, margin, height - margin, margin, points[0].y];\n var fillPoints = linePoints.concat(closePolyPoints);\n var lineStyle = {\n stroke: color || style.stroke || 'slategray',\n strokeWidth: style.strokeWidth || '1',\n strokeLinejoin: style.strokeLinejoin || 'round',\n strokeLinecap: style.strokeLinecap || 'round',\n fill: 'none'\n };\n var fillStyle = {\n stroke: style.stroke || 'none',\n strokeWidth: '0',\n fillOpacity: style.fillOpacity || '.1',\n fill: style.fill || color || 'slategray',\n pointerEvents: 'auto'\n };\n var tooltips = points.map(function (p, i) {\n return _react2.default.createElement('circle', {\n key: i,\n cx: p.x,\n cy: p.y,\n r: 2,\n style: fillStyle,\n onMouseEnter: function onMouseEnter(e) {\n return onMouseMove('enter', data[i], p);\n },\n onClick: function onClick(e) {\n return onMouseMove('click', data[i], p);\n }\n });\n });\n return _react2.default.createElement('g', null, tooltips, _react2.default.createElement('polyline', {\n points: fillPoints.join(' '),\n style: fillStyle\n }), _react2.default.createElement('polyline', {\n points: linePoints.join(' '),\n style: lineStyle\n }));\n }\n }]);\n\n return SparklinesLine;\n }(_react2.default.Component);\n\n SparklinesLine.propTypes = {\n color: _propTypes2.default.string,\n style: _propTypes2.default.object\n };\n SparklinesLine.defaultProps = {\n style: {},\n onMouseMove: function onMouseMove() {}\n };\n exports.default = SparklinesLine;\n /***/\n },\n /* 19 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var _propTypes = __webpack_require__(0);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n var _react = __webpack_require__(1);\n\n var _react2 = _interopRequireDefault(_react);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n }\n\n var SparklinesCurve = function (_React$Component) {\n _inherits(SparklinesCurve, _React$Component);\n\n function SparklinesCurve() {\n _classCallCheck(this, SparklinesCurve);\n\n return _possibleConstructorReturn(this, (SparklinesCurve.__proto__ || Object.getPrototypeOf(SparklinesCurve)).apply(this, arguments));\n }\n\n _createClass(SparklinesCurve, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n points = _props.points,\n width = _props.width,\n height = _props.height,\n margin = _props.margin,\n color = _props.color,\n style = _props.style,\n _props$divisor = _props.divisor,\n divisor = _props$divisor === undefined ? 0.25 : _props$divisor;\n var prev = void 0;\n\n var curve = function curve(p) {\n var res = void 0;\n\n if (!prev) {\n res = [p.x, p.y];\n } else {\n var len = (p.x - prev.x) * divisor;\n res = [\"C\", //x1\n prev.x + len, //y1\n prev.y, //x2,\n p.x - len, //y2,\n p.y, //x,\n p.x, //y\n p.y];\n }\n\n prev = p;\n return res;\n };\n\n var linePoints = points.map(function (p) {\n return curve(p);\n }).reduce(function (a, b) {\n return a.concat(b);\n });\n var closePolyPoints = [\"L\" + points[points.length - 1].x, height - margin, margin, height - margin, margin, points[0].y];\n var fillPoints = linePoints.concat(closePolyPoints);\n var lineStyle = {\n stroke: color || style.stroke || 'slategray',\n strokeWidth: style.strokeWidth || '1',\n strokeLinejoin: style.strokeLinejoin || 'round',\n strokeLinecap: style.strokeLinecap || 'round',\n fill: 'none'\n };\n var fillStyle = {\n stroke: style.stroke || 'none',\n strokeWidth: '0',\n fillOpacity: style.fillOpacity || '.1',\n fill: style.fill || color || 'slategray'\n };\n return _react2.default.createElement('g', null, _react2.default.createElement('path', {\n d: \"M\" + fillPoints.join(' '),\n style: fillStyle\n }), _react2.default.createElement('path', {\n d: \"M\" + linePoints.join(' '),\n style: lineStyle\n }));\n }\n }]);\n\n return SparklinesCurve;\n }(_react2.default.Component);\n\n SparklinesCurve.propTypes = {\n color: _propTypes2.default.string,\n style: _propTypes2.default.object\n };\n SparklinesCurve.defaultProps = {\n style: {}\n };\n exports.default = SparklinesCurve;\n /***/\n },\n /* 20 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var _propTypes = __webpack_require__(0);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n var _react = __webpack_require__(1);\n\n var _react2 = _interopRequireDefault(_react);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n }\n\n var SparklinesBars = function (_React$Component) {\n _inherits(SparklinesBars, _React$Component);\n\n function SparklinesBars() {\n _classCallCheck(this, SparklinesBars);\n\n return _possibleConstructorReturn(this, (SparklinesBars.__proto__ || Object.getPrototypeOf(SparklinesBars)).apply(this, arguments));\n }\n\n _createClass(SparklinesBars, [{\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n points = _props.points,\n height = _props.height,\n style = _props.style,\n barWidth = _props.barWidth,\n margin = _props.margin,\n onMouseMove = _props.onMouseMove;\n var strokeWidth = 1 * (style && style.strokeWidth || 0);\n var marginWidth = margin ? 2 * margin : 0;\n var width = barWidth || (points && points.length >= 2 ? Math.max(0, points[1].x - points[0].x - strokeWidth - marginWidth) : 0);\n return _react2.default.createElement('g', {\n transform: 'scale(1,-1)'\n }, points.map(function (p, i) {\n return _react2.default.createElement('rect', {\n key: i,\n x: p.x - (width + strokeWidth) / 2,\n y: -height,\n width: width,\n height: Math.max(0, height - p.y),\n style: style,\n onMouseMove: onMouseMove && onMouseMove.bind(_this2, p)\n });\n }));\n }\n }]);\n\n return SparklinesBars;\n }(_react2.default.Component);\n\n SparklinesBars.propTypes = {\n points: _propTypes2.default.arrayOf(_propTypes2.default.object),\n height: _propTypes2.default.number,\n style: _propTypes2.default.object,\n barWidth: _propTypes2.default.number,\n margin: _propTypes2.default.number,\n onMouseMove: _propTypes2.default.func\n };\n SparklinesBars.defaultProps = {\n style: {\n fill: 'slategray'\n }\n };\n exports.default = SparklinesBars;\n /***/\n },\n /* 21 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var _propTypes = __webpack_require__(0);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n var _react = __webpack_require__(1);\n\n var _react2 = _interopRequireDefault(_react);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n }\n\n var SparklinesSpots = function (_React$Component) {\n _inherits(SparklinesSpots, _React$Component);\n\n function SparklinesSpots() {\n _classCallCheck(this, SparklinesSpots);\n\n return _possibleConstructorReturn(this, (SparklinesSpots.__proto__ || Object.getPrototypeOf(SparklinesSpots)).apply(this, arguments));\n }\n\n _createClass(SparklinesSpots, [{\n key: 'lastDirection',\n value: function lastDirection(points) {\n Math.sign = Math.sign || function (x) {\n return x > 0 ? 1 : -1;\n };\n\n return points.length < 2 ? 0 : Math.sign(points[points.length - 2].y - points[points.length - 1].y);\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n points = _props.points,\n width = _props.width,\n height = _props.height,\n size = _props.size,\n style = _props.style,\n spotColors = _props.spotColors;\n\n var startSpot = _react2.default.createElement('circle', {\n cx: points[0].x,\n cy: points[0].y,\n r: size,\n style: style\n });\n\n var endSpot = _react2.default.createElement('circle', {\n cx: points[points.length - 1].x,\n cy: points[points.length - 1].y,\n r: size,\n style: style || {\n fill: spotColors[this.lastDirection(points)]\n }\n });\n\n return _react2.default.createElement('g', null, style && startSpot, endSpot);\n }\n }]);\n\n return SparklinesSpots;\n }(_react2.default.Component);\n\n SparklinesSpots.propTypes = {\n size: _propTypes2.default.number,\n style: _propTypes2.default.object,\n spotColors: _propTypes2.default.object\n };\n SparklinesSpots.defaultProps = {\n size: 2,\n spotColors: {\n '-1': 'red',\n '0': 'black',\n '1': 'green'\n }\n };\n exports.default = SparklinesSpots;\n /***/\n },\n /* 22 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var _propTypes = __webpack_require__(0);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n var _react = __webpack_require__(1);\n\n var _react2 = _interopRequireDefault(_react);\n\n var _dataProcessing = __webpack_require__(23);\n\n var dataProcessing = _interopRequireWildcard(_dataProcessing);\n\n function _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n }\n }\n\n newObj.default = obj;\n return newObj;\n }\n }\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n }\n\n var SparklinesReferenceLine = function (_React$Component) {\n _inherits(SparklinesReferenceLine, _React$Component);\n\n function SparklinesReferenceLine() {\n _classCallCheck(this, SparklinesReferenceLine);\n\n return _possibleConstructorReturn(this, (SparklinesReferenceLine.__proto__ || Object.getPrototypeOf(SparklinesReferenceLine)).apply(this, arguments));\n }\n\n _createClass(SparklinesReferenceLine, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n points = _props.points,\n margin = _props.margin,\n type = _props.type,\n style = _props.style,\n value = _props.value;\n var ypoints = points.map(function (p) {\n return p.y;\n });\n var y = type == 'custom' ? value : dataProcessing[type](ypoints);\n return _react2.default.createElement('line', {\n x1: points[0].x,\n y1: y + margin,\n x2: points[points.length - 1].x,\n y2: y + margin,\n style: style\n });\n }\n }]);\n\n return SparklinesReferenceLine;\n }(_react2.default.Component);\n\n SparklinesReferenceLine.propTypes = {\n type: _propTypes2.default.oneOf(['max', 'min', 'mean', 'avg', 'median', 'custom']),\n value: _propTypes2.default.number,\n style: _propTypes2.default.object\n };\n SparklinesReferenceLine.defaultProps = {\n type: 'mean',\n style: {\n stroke: 'red',\n strokeOpacity: .75,\n strokeDasharray: '2, 2'\n }\n };\n exports.default = SparklinesReferenceLine;\n /***/\n },\n /* 23 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.variance = exports.stdev = exports.median = exports.midRange = exports.avg = exports.mean = exports.max = exports.min = undefined;\n\n var _min2 = __webpack_require__(7);\n\n var _min3 = _interopRequireDefault(_min2);\n\n var _mean2 = __webpack_require__(3);\n\n var _mean3 = _interopRequireDefault(_mean2);\n\n var _midRange2 = __webpack_require__(24);\n\n var _midRange3 = _interopRequireDefault(_midRange2);\n\n var _median2 = __webpack_require__(25);\n\n var _median3 = _interopRequireDefault(_median2);\n\n var _stdev2 = __webpack_require__(10);\n\n var _stdev3 = _interopRequireDefault(_stdev2);\n\n var _variance2 = __webpack_require__(26);\n\n var _variance3 = _interopRequireDefault(_variance2);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n exports.min = _min3.default;\n exports.max = _min3.default;\n exports.mean = _mean3.default;\n exports.avg = _mean3.default;\n exports.midRange = _midRange3.default;\n exports.median = _median3.default;\n exports.stdev = _stdev3.default;\n exports.variance = _variance3.default;\n /***/\n },\n /* 24 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _min = __webpack_require__(7);\n\n var _min2 = _interopRequireDefault(_min);\n\n var _max = __webpack_require__(9);\n\n var _max2 = _interopRequireDefault(_max);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n exports.default = function (data) {\n return (0, _max2.default)(data) - (0, _min2.default)(data) / 2;\n };\n /***/\n\n },\n /* 25 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n exports.default = function (data) {\n return data.sort(function (a, b) {\n return a - b;\n })[Math.floor(data.length / 2)];\n };\n /***/\n\n },\n /* 26 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _mean = __webpack_require__(3);\n\n var _mean2 = _interopRequireDefault(_mean);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n exports.default = function (data) {\n var dataMean = (0, _mean2.default)(data);\n var sq = data.map(function (n) {\n return Math.pow(n - dataMean, 2);\n });\n return (0, _mean2.default)(sq);\n };\n /***/\n\n },\n /* 27 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n }();\n\n var _propTypes = __webpack_require__(0);\n\n var _propTypes2 = _interopRequireDefault(_propTypes);\n\n var _react = __webpack_require__(1);\n\n var _react2 = _interopRequireDefault(_react);\n\n var _mean = __webpack_require__(3);\n\n var _mean2 = _interopRequireDefault(_mean);\n\n var _stdev = __webpack_require__(10);\n\n var _stdev2 = _interopRequireDefault(_stdev);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n }\n\n var SparklinesNormalBand = function (_React$Component) {\n _inherits(SparklinesNormalBand, _React$Component);\n\n function SparklinesNormalBand() {\n _classCallCheck(this, SparklinesNormalBand);\n\n return _possibleConstructorReturn(this, (SparklinesNormalBand.__proto__ || Object.getPrototypeOf(SparklinesNormalBand)).apply(this, arguments));\n }\n\n _createClass(SparklinesNormalBand, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n points = _props.points,\n margin = _props.margin,\n style = _props.style;\n var ypoints = points.map(function (p) {\n return p.y;\n });\n var dataMean = (0, _mean2.default)(ypoints);\n var dataStdev = (0, _stdev2.default)(ypoints);\n return _react2.default.createElement('rect', {\n x: points[0].x,\n y: dataMean - dataStdev + margin,\n width: points[points.length - 1].x - points[0].x,\n height: _stdev2.default * 2,\n style: style\n });\n }\n }]);\n\n return SparklinesNormalBand;\n }(_react2.default.Component);\n\n SparklinesNormalBand.propTypes = {\n style: _propTypes2.default.object\n };\n SparklinesNormalBand.defaultProps = {\n style: {\n fill: 'red',\n fillOpacity: .1\n }\n };\n exports.default = SparklinesNormalBand;\n /***/\n },\n /* 28 */\n\n /***/\n function (module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var _min = __webpack_require__(7);\n\n var _min2 = _interopRequireDefault(_min);\n\n var _max = __webpack_require__(9);\n\n var _max2 = _interopRequireDefault(_max);\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n exports.default = function (_ref) {\n var data = _ref.data,\n limit = _ref.limit,\n _ref$width = _ref.width,\n width = _ref$width === undefined ? 1 : _ref$width,\n _ref$height = _ref.height,\n height = _ref$height === undefined ? 1 : _ref$height,\n _ref$margin = _ref.margin,\n margin = _ref$margin === undefined ? 0 : _ref$margin,\n _ref$max = _ref.max,\n max = _ref$max === undefined ? (0, _max2.default)(data) : _ref$max,\n _ref$min = _ref.min,\n min = _ref$min === undefined ? (0, _min2.default)(data) : _ref$min;\n var len = data.length;\n\n if (limit && limit < len) {\n data = data.slice(len - limit);\n }\n\n var vfactor = (height - margin * 2) / (max - min || 2);\n var hfactor = (width - margin * 2) / ((limit || len) - (len > 1 ? 1 : 0));\n return data.map(function (d, i) {\n return {\n x: i * hfactor + margin,\n y: (max === min ? 1 : max - d) * vfactor + margin\n };\n });\n };\n /***/\n\n }])\n );\n});","import React, { Fragment } from 'react';\nimport { FormattedNumber } from 'react-intl';\n\nexport const shortNumberFormat = number => {\n if (number < 1000) {\n return ;\n } else {\n return K ;\n }\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { injectIntl, defineMessages } from 'react-intl';\n\nconst messages = defineMessages({\n load_more: { id: 'status.load_more', defaultMessage: 'Load more' },\n});\n\n@injectIntl\nexport default class LoadGap extends React.PureComponent {\n\n static propTypes = {\n disabled: PropTypes.bool,\n maxId: PropTypes.string,\n onClick: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n handleClick = () => {\n this.props.onClick(this.props.maxId);\n }\n\n render () {\n const { disabled, intl } = this.props;\n\n return (\n \n \n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport SettingText from 'flavours/glitch/components/setting_text';\nimport SettingToggle from 'flavours/glitch/features/notifications/components/setting_toggle';\n\nconst messages = defineMessages({\n filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' },\n settings: { id: 'home.settings', defaultMessage: 'Column settings' },\n});\n\n@injectIntl\nexport default class ColumnSettings extends React.PureComponent {\n\n static propTypes = {\n settings: ImmutablePropTypes.map.isRequired,\n onChange: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n columnId: PropTypes.string,\n };\n\n render () {\n const { settings, onChange, intl } = this.props;\n\n return (\n \n
\n } />\n
\n\n
\n\n
\n \n
\n
\n );\n }\n\n}\n","var baseIsEqual = require('./_baseIsEqual');\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n\n\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.makeAsyncSelect = exports.defaultProps = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _Select = require('./Select');\n\nvar _Select2 = _interopRequireDefault(_Select);\n\nvar _utils = require('./utils');\n\nvar _stateManager = require('./stateManager');\n\nvar _stateManager2 = _interopRequireDefault(_stateManager);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar defaultProps = exports.defaultProps = {\n cacheOptions: false,\n defaultOptions: false\n};\n\nvar makeAsyncSelect = function makeAsyncSelect(SelectComponent) {\n var _class, _temp;\n\n return _temp = _class = function (_Component) {\n _inherits(Async, _Component);\n\n function Async(props) {\n _classCallCheck(this, Async);\n\n var _this = _possibleConstructorReturn(this, (Async.__proto__ || Object.getPrototypeOf(Async)).call(this));\n\n _this.mounted = false;\n _this.optionsCache = {};\n\n _this.handleInputChange = function (newValue, actionMeta) {\n var _this$props = _this.props,\n cacheOptions = _this$props.cacheOptions,\n onInputChange = _this$props.onInputChange; // TODO\n\n var inputValue = (0, _utils.handleInputChange)(newValue, actionMeta, onInputChange);\n\n if (!inputValue) {\n delete _this.lastRequest;\n\n _this.setState({\n inputValue: '',\n loadedInputValue: '',\n loadedOptions: [],\n isLoading: false,\n passEmptyOptions: false\n });\n\n return;\n }\n\n if (cacheOptions && _this.optionsCache[inputValue]) {\n _this.setState({\n inputValue: inputValue,\n loadedInputValue: inputValue,\n loadedOptions: _this.optionsCache[inputValue],\n isLoading: false,\n passEmptyOptions: false\n });\n } else {\n var request = _this.lastRequest = {};\n\n _this.setState({\n inputValue: inputValue,\n isLoading: true,\n passEmptyOptions: !_this.state.loadedInputValue\n }, function () {\n _this.loadOptions(inputValue, function (options) {\n if (!_this.mounted) return;\n\n if (options) {\n _this.optionsCache[inputValue] = options;\n }\n\n if (request !== _this.lastRequest) return;\n delete _this.lastRequest;\n\n _this.setState({\n isLoading: false,\n loadedInputValue: inputValue,\n loadedOptions: options || [],\n passEmptyOptions: false\n });\n });\n });\n }\n\n return inputValue;\n };\n\n _this.state = {\n defaultOptions: Array.isArray(props.defaultOptions) ? props.defaultOptions : undefined,\n inputValue: props.inputValue,\n isLoading: props.defaultOptions === true ? true : false,\n loadedOptions: [],\n passEmptyOptions: false\n };\n return _this;\n }\n\n _createClass(Async, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this.mounted = true;\n var defaultOptions = this.props.defaultOptions;\n var inputValue = this.state.inputValue;\n\n if (defaultOptions === true) {\n this.loadOptions(inputValue, function (options) {\n if (!_this2.mounted) return;\n var isLoading = !!_this2.lastRequest;\n\n _this2.setState({\n defaultOptions: options || [],\n isLoading: isLoading\n });\n });\n }\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n // if the cacheOptions prop changes, clear the cache\n if (nextProps.cacheOptions !== this.props.cacheOptions) {\n this.optionsCache = {};\n }\n\n if (nextProps.defaultOptions !== this.props.defaultOptions) {\n this.setState({\n defaultOptions: Array.isArray(nextProps.defaultOptions) ? nextProps.defaultOptions : undefined\n });\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.mounted = false;\n }\n }, {\n key: 'focus',\n value: function focus() {\n this.select.focus();\n }\n }, {\n key: 'blur',\n value: function blur() {\n this.select.blur();\n }\n }, {\n key: 'loadOptions',\n value: function loadOptions(inputValue, callback) {\n var loadOptions = this.props.loadOptions;\n if (!loadOptions) return callback();\n var loader = loadOptions(inputValue, callback);\n\n if (loader && typeof loader.then === 'function') {\n loader.then(callback, function () {\n return callback();\n });\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this3 = this;\n\n var _props = this.props,\n loadOptions = _props.loadOptions,\n props = _objectWithoutProperties(_props, ['loadOptions']);\n\n var _state = this.state,\n defaultOptions = _state.defaultOptions,\n inputValue = _state.inputValue,\n isLoading = _state.isLoading,\n loadedInputValue = _state.loadedInputValue,\n loadedOptions = _state.loadedOptions,\n passEmptyOptions = _state.passEmptyOptions;\n var options = passEmptyOptions ? [] : inputValue && loadedInputValue ? loadedOptions : defaultOptions || [];\n return (// $FlowFixMe\n _react2.default.createElement(SelectComponent, _extends({}, props, {\n filterOption: this.props.filterOption || null,\n ref: function ref(_ref) {\n _this3.select = _ref;\n },\n options: options,\n isLoading: isLoading,\n onInputChange: this.handleInputChange\n }))\n );\n }\n }]);\n\n return Async;\n }(_react.Component), _class.defaultProps = defaultProps, _temp;\n};\n\nexports.makeAsyncSelect = makeAsyncSelect;\nexports.default = makeAsyncSelect((0, _stateManager2.default)(_Select2.default));","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.IndicatorsContainer = exports.indicatorsContainerCSS = exports.ValueContainer = exports.valueContainerCSS = exports.SelectContainer = exports.containerCSS = undefined;\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n} // ==============================\n// Root Container\n// ==============================\n\n\nvar containerCSS = exports.containerCSS = function containerCSS(_ref) {\n var isDisabled = _ref.isDisabled,\n isRtl = _ref.isRtl;\n return {\n direction: isRtl ? 'rtl' : null,\n pointerEvents: isDisabled ? 'none' : null,\n // cancel mouse events when disabled\n position: 'relative'\n };\n};\n\nvar SelectContainer = exports.SelectContainer = function SelectContainer(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps,\n isDisabled = props.isDisabled,\n isRtl = props.isRtl,\n emotion = props.emotion;\n return _react2.default.createElement('div', _extends({\n className: cx(emotion.css(getStyles('container', props)), {\n '--is-disabled': isDisabled,\n '--is-rtl': isRtl\n }, className)\n }, innerProps), children);\n}; // ==============================\n// Value Container\n// ==============================\n\n\nvar valueContainerCSS = exports.valueContainerCSS = function valueContainerCSS(_ref2) {\n var spacing = _ref2.theme.spacing;\n return {\n alignItems: 'center',\n display: 'flex',\n flex: 1,\n flexWrap: 'wrap',\n padding: spacing.baseUnit / 2 + 'px ' + spacing.baseUnit * 2 + 'px',\n WebkitOverflowScrolling: 'touch',\n position: 'relative',\n overflow: 'hidden'\n };\n};\n\nvar ValueContainer = exports.ValueContainer = function (_Component) {\n _inherits(ValueContainer, _Component);\n\n function ValueContainer() {\n _classCallCheck(this, ValueContainer);\n\n return _possibleConstructorReturn(this, (ValueContainer.__proto__ || Object.getPrototypeOf(ValueContainer)).apply(this, arguments));\n }\n\n _createClass(ValueContainer, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n children = _props.children,\n className = _props.className,\n cx = _props.cx,\n isMulti = _props.isMulti,\n getStyles = _props.getStyles,\n hasValue = _props.hasValue,\n emotion = _props.emotion;\n return _react2.default.createElement('div', {\n className: cx(emotion.css(getStyles('valueContainer', this.props)), {\n 'value-container': true,\n 'value-container--is-multi': isMulti,\n 'value-container--has-value': hasValue\n }, className)\n }, children);\n }\n }]);\n\n return ValueContainer;\n}(_react.Component); // ==============================\n// Indicator Container\n// ==============================\n\n\nvar indicatorsContainerCSS = exports.indicatorsContainerCSS = function indicatorsContainerCSS() {\n return {\n alignItems: 'center',\n alignSelf: 'stretch',\n display: 'flex',\n flexShrink: 0\n };\n};\n\nvar IndicatorsContainer = exports.IndicatorsContainer = function IndicatorsContainer(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n emotion = props.emotion;\n return _react2.default.createElement('div', {\n className: cx(emotion.css(getStyles('indicatorsContainer', props)), {\n 'indicators': true\n }, className)\n }, children);\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.css = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nvar css = exports.css = function css(_ref) {\n var isDisabled = _ref.isDisabled,\n isFocused = _ref.isFocused,\n _ref$theme = _ref.theme,\n colors = _ref$theme.colors,\n borderRadius = _ref$theme.borderRadius,\n spacing = _ref$theme.spacing;\n return {\n alignItems: 'center',\n backgroundColor: isDisabled ? colors.neutral5 : colors.neutral0,\n borderColor: isDisabled ? colors.neutral10 : isFocused ? colors.primary : colors.neutral20,\n borderRadius: borderRadius,\n borderStyle: 'solid',\n borderWidth: 1,\n boxShadow: isFocused ? '0 0 0 1px ' + colors.primary : null,\n cursor: 'default',\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'space-between',\n minHeight: spacing.controlHeight,\n outline: '0 !important',\n position: 'relative',\n transition: 'all 100ms',\n '&:hover': {\n borderColor: isFocused ? colors.primary : colors.neutral30\n }\n };\n};\n\nvar Control = function Control(props) {\n var children = props.children,\n cx = props.cx,\n getStyles = props.getStyles,\n className = props.className,\n isDisabled = props.isDisabled,\n isFocused = props.isFocused,\n innerRef = props.innerRef,\n innerProps = props.innerProps,\n emotion = props.emotion;\n return _react2.default.createElement('div', _extends({\n ref: innerRef,\n className: cx(emotion.css(getStyles('control', props)), {\n 'control': true,\n 'control--is-disabled': isDisabled,\n 'control--is-focused': isFocused\n }, className)\n }, innerProps), children);\n};\n\nexports.default = Control;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.GroupHeading = exports.groupHeadingCSS = exports.groupCSS = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nvar groupCSS = exports.groupCSS = function groupCSS(_ref) {\n var spacing = _ref.theme.spacing;\n return {\n paddingBottom: spacing.baseUnit * 2,\n paddingTop: spacing.baseUnit * 2\n };\n};\n\nvar Group = function Group(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n Heading = props.Heading,\n headingProps = props.headingProps,\n label = props.label,\n theme = props.theme,\n emotion = props.emotion,\n selectProps = props.selectProps;\n return _react2.default.createElement('div', {\n className: cx(emotion.css(getStyles('group', props)), {\n 'group': true\n }, className)\n }, _react2.default.createElement(Heading, _extends({}, headingProps, {\n selectProps: selectProps,\n emotion: emotion,\n theme: theme,\n getStyles: getStyles,\n cx: cx\n }), label), _react2.default.createElement('div', null, children));\n};\n\nvar groupHeadingCSS = exports.groupHeadingCSS = function groupHeadingCSS(_ref2) {\n var spacing = _ref2.theme.spacing;\n return {\n color: '#999',\n cursor: 'default',\n display: 'block',\n fontSize: '75%',\n fontWeight: '500',\n marginBottom: '0.25em',\n paddingLeft: spacing.baseUnit * 3,\n paddingRight: spacing.baseUnit * 3,\n textTransform: 'uppercase'\n };\n};\n\nvar GroupHeading = function GroupHeading(props) {\n var className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n theme = props.theme,\n emotion = props.emotion,\n selectProps = props.selectProps,\n cleanProps = _objectWithoutProperties(props, ['className', 'cx', 'getStyles', 'theme', 'emotion', 'selectProps']);\n\n return _react2.default.createElement('div', _extends({\n className: cx(emotion.css(getStyles('groupHeading', _extends({\n theme: theme\n }, cleanProps))), {\n 'group-heading': true\n }, className)\n }, cleanProps));\n};\n\nexports.GroupHeading = GroupHeading;\nexports.default = Group;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.inputCSS = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactInputAutosize = require('react-input-autosize');\n\nvar _reactInputAutosize2 = _interopRequireDefault(_reactInputAutosize);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nvar inputCSS = exports.inputCSS = function inputCSS(_ref) {\n var isDisabled = _ref.isDisabled,\n _ref$theme = _ref.theme,\n spacing = _ref$theme.spacing,\n colors = _ref$theme.colors;\n return {\n margin: spacing.baseUnit / 2,\n paddingBottom: spacing.baseUnit / 2,\n paddingTop: spacing.baseUnit / 2,\n visibility: isDisabled ? 'hidden' : 'visible',\n color: colors.neutral80\n };\n};\n\nvar inputStyle = function inputStyle(isHidden) {\n return {\n background: 0,\n border: 0,\n fontSize: 'inherit',\n opacity: isHidden ? 0 : 1,\n outline: 0,\n padding: 0,\n color: 'inherit'\n };\n};\n\nvar Input = function Input(_ref2) {\n var className = _ref2.className,\n cx = _ref2.cx,\n getStyles = _ref2.getStyles,\n innerRef = _ref2.innerRef,\n isHidden = _ref2.isHidden,\n isDisabled = _ref2.isDisabled,\n theme = _ref2.theme,\n emotion = _ref2.emotion,\n selectProps = _ref2.selectProps,\n props = _objectWithoutProperties(_ref2, ['className', 'cx', 'getStyles', 'innerRef', 'isHidden', 'isDisabled', 'theme', 'emotion', 'selectProps']);\n\n return _react2.default.createElement('div', {\n className: emotion.css(getStyles('input', _extends({\n theme: theme\n }, props)))\n }, _react2.default.createElement(_reactInputAutosize2.default, _extends({\n className: cx(null, {\n 'input': true\n }, className),\n inputRef: innerRef,\n inputStyle: inputStyle(isHidden),\n disabled: isDisabled\n }, props)));\n};\n\nexports.default = Input;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.MultiValueRemove = exports.MultiValueLabel = exports.MultiValueContainer = exports.MultiValueGeneric = exports.multiValueRemoveCSS = exports.multiValueLabelCSS = exports.multiValueCSS = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _indicators = require('./indicators');\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar multiValueCSS = exports.multiValueCSS = function multiValueCSS(_ref) {\n var _ref$theme = _ref.theme,\n spacing = _ref$theme.spacing,\n borderRadius = _ref$theme.borderRadius,\n colors = _ref$theme.colors;\n return {\n backgroundColor: colors.neutral10,\n borderRadius: borderRadius / 2,\n display: 'flex',\n margin: spacing.baseUnit / 2,\n minWidth: 0 // resolves flex/text-overflow bug\n\n };\n};\n\nvar multiValueLabelCSS = exports.multiValueLabelCSS = function multiValueLabelCSS(_ref2) {\n var _ref2$theme = _ref2.theme,\n borderRadius = _ref2$theme.borderRadius,\n colors = _ref2$theme.colors,\n cropWithEllipsis = _ref2.cropWithEllipsis;\n return {\n borderRadius: borderRadius / 2,\n color: colors.neutral80,\n fontSize: '85%',\n overflow: 'hidden',\n padding: 3,\n paddingLeft: 6,\n textOverflow: cropWithEllipsis ? 'ellipsis' : null,\n whiteSpace: 'nowrap'\n };\n};\n\nvar multiValueRemoveCSS = exports.multiValueRemoveCSS = function multiValueRemoveCSS(_ref3) {\n var _ref3$theme = _ref3.theme,\n spacing = _ref3$theme.spacing,\n borderRadius = _ref3$theme.borderRadius,\n colors = _ref3$theme.colors,\n isFocused = _ref3.isFocused;\n return {\n alignItems: 'center',\n borderRadius: borderRadius / 2,\n backgroundColor: isFocused && colors.dangerLight,\n display: 'flex',\n paddingLeft: spacing.baseUnit,\n paddingRight: spacing.baseUnit,\n ':hover': {\n backgroundColor: colors.dangerLight,\n color: colors.danger\n }\n };\n};\n\nvar MultiValueGeneric = exports.MultiValueGeneric = function MultiValueGeneric(_ref4) {\n var children = _ref4.children,\n innerProps = _ref4.innerProps;\n return _react2.default.createElement('div', innerProps, children);\n};\n\nvar MultiValueContainer = exports.MultiValueContainer = MultiValueGeneric;\nvar MultiValueLabel = exports.MultiValueLabel = MultiValueGeneric;\n\nvar MultiValueRemove = exports.MultiValueRemove = function (_Component) {\n _inherits(MultiValueRemove, _Component);\n\n function MultiValueRemove() {\n _classCallCheck(this, MultiValueRemove);\n\n return _possibleConstructorReturn(this, (MultiValueRemove.__proto__ || Object.getPrototypeOf(MultiValueRemove)).apply(this, arguments));\n }\n\n _createClass(MultiValueRemove, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n children = _props.children,\n innerProps = _props.innerProps,\n emotion = _props.emotion;\n return _react2.default.createElement('div', innerProps, children || _react2.default.createElement(_indicators.CrossIcon, {\n size: 14,\n emotion: emotion\n }));\n }\n }]);\n\n return MultiValueRemove;\n}(_react.Component);\n\nvar MultiValue = function (_Component2) {\n _inherits(MultiValue, _Component2);\n\n function MultiValue() {\n _classCallCheck(this, MultiValue);\n\n return _possibleConstructorReturn(this, (MultiValue.__proto__ || Object.getPrototypeOf(MultiValue)).apply(this, arguments));\n }\n\n _createClass(MultiValue, [{\n key: 'render',\n value: function render() {\n var _props2 = this.props,\n children = _props2.children,\n className = _props2.className,\n components = _props2.components,\n cx = _props2.cx,\n data = _props2.data,\n getStyles = _props2.getStyles,\n innerProps = _props2.innerProps,\n isDisabled = _props2.isDisabled,\n removeProps = _props2.removeProps,\n selectProps = _props2.selectProps,\n emotion = _props2.emotion;\n var Container = components.Container,\n Label = components.Label,\n Remove = components.Remove;\n\n var containerInnerProps = _extends({\n className: cx(emotion.css(getStyles('multiValue', this.props)), {\n 'multi-value': true,\n 'multi-value--is-disabled': isDisabled\n }, className)\n }, innerProps);\n\n var labelInnerProps = {\n className: cx(emotion.css(getStyles('multiValueLabel', this.props)), {\n 'multi-value__label': true\n }, className)\n };\n\n var removeInnerProps = _extends({\n className: cx(emotion.css(getStyles('multiValueRemove', this.props)), {\n 'multi-value__remove': true\n }, className)\n }, removeProps);\n\n return _react2.default.createElement(Container, {\n data: data,\n innerProps: containerInnerProps,\n selectProps: selectProps\n }, _react2.default.createElement(Label, {\n data: data,\n innerProps: labelInnerProps,\n selectProps: selectProps\n }, children), _react2.default.createElement(Remove, {\n data: data,\n innerProps: removeInnerProps,\n selectProps: selectProps,\n emotion: emotion\n }));\n }\n }]);\n\n return MultiValue;\n}(_react.Component);\n\nMultiValue.defaultProps = {\n cropWithEllipsis: true\n};\nexports.default = MultiValue;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.optionCSS = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nvar optionCSS = exports.optionCSS = function optionCSS(_ref) {\n var isDisabled = _ref.isDisabled,\n isFocused = _ref.isFocused,\n isSelected = _ref.isSelected,\n _ref$theme = _ref.theme,\n spacing = _ref$theme.spacing,\n colors = _ref$theme.colors;\n return {\n backgroundColor: isSelected ? colors.primary : isFocused ? colors.primary25 : 'transparent',\n color: isDisabled ? colors.neutral20 : isSelected ? colors.neutral0 : 'inherit',\n cursor: 'default',\n display: 'block',\n fontSize: 'inherit',\n padding: spacing.baseUnit * 2 + 'px ' + spacing.baseUnit * 3 + 'px',\n width: '100%',\n userSelect: 'none',\n WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)',\n // provide some affordance on touch devices\n ':active': {\n backgroundColor: isSelected ? colors.primary : colors.primary50\n }\n };\n};\n\nvar Option = function Option(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n isDisabled = props.isDisabled,\n isFocused = props.isFocused,\n isSelected = props.isSelected,\n innerRef = props.innerRef,\n innerProps = props.innerProps,\n emotion = props.emotion;\n return _react2.default.createElement('div', _extends({\n ref: innerRef,\n className: cx(emotion.css(getStyles('option', props)), {\n 'option': true,\n 'option--is-disabled': isDisabled,\n 'option--is-focused': isFocused,\n 'option--is-selected': isSelected\n }, className)\n }, innerProps), children);\n};\n\nexports.default = Option;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.placeholderCSS = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nvar placeholderCSS = exports.placeholderCSS = function placeholderCSS(_ref) {\n var _ref$theme = _ref.theme,\n spacing = _ref$theme.spacing,\n colors = _ref$theme.colors;\n return {\n color: colors.neutral50,\n marginLeft: spacing.baseUnit / 2,\n marginRight: spacing.baseUnit / 2,\n position: 'absolute',\n top: '50%',\n transform: 'translateY(-50%)'\n };\n};\n\nvar Placeholder = function Placeholder(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps,\n emotion = props.emotion;\n return _react2.default.createElement('div', _extends({\n className: cx(emotion.css(getStyles('placeholder', props)), {\n 'placeholder': true\n }, className)\n }, innerProps), children);\n};\n\nexports.default = Placeholder;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.css = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nvar css = exports.css = function css(_ref) {\n var isDisabled = _ref.isDisabled,\n _ref$theme = _ref.theme,\n spacing = _ref$theme.spacing,\n colors = _ref$theme.colors;\n return {\n color: isDisabled ? colors.neutral40 : colors.neutral80,\n marginLeft: spacing.baseUnit / 2,\n marginRight: spacing.baseUnit / 2,\n maxWidth: 'calc(100% - ' + spacing.baseUnit * 2 + 'px)',\n overflow: 'hidden',\n position: 'absolute',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n top: '50%',\n transform: 'translateY(-50%)'\n };\n};\n\nvar SingleValue = function SingleValue(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n isDisabled = props.isDisabled,\n innerProps = props.innerProps,\n emotion = props.emotion;\n return _react2.default.createElement('div', _extends({\n className: cx(emotion.css(getStyles('singleValue', props)), {\n 'single-value': true,\n 'single-value--is-disabled': isDisabled\n }, className)\n }, innerProps), children);\n};\n\nexports.default = SingleValue;","import React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { changeListEditorTitle, submitListEditor } from 'flavours/glitch/actions/lists';\nimport IconButton from 'flavours/glitch/components/icon_button';\nimport { defineMessages, injectIntl } from 'react-intl';\n\nconst messages = defineMessages({\n label: { id: 'lists.new.title_placeholder', defaultMessage: 'New list title' },\n title: { id: 'lists.new.create', defaultMessage: 'Add list' },\n});\n\nconst mapStateToProps = state => ({\n value: state.getIn(['listEditor', 'title']),\n disabled: state.getIn(['listEditor', 'isSubmitting']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onChange: value => dispatch(changeListEditorTitle(value)),\n onSubmit: () => dispatch(submitListEditor(true)),\n});\n\n@connect(mapStateToProps, mapDispatchToProps)\n@injectIntl\nexport default class NewListForm extends React.PureComponent {\n\n static propTypes = {\n value: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n };\n\n handleChange = e => {\n this.props.onChange(e.target.value);\n }\n\n handleSubmit = e => {\n e.preventDefault();\n this.props.onSubmit();\n }\n\n handleClick = () => {\n this.props.onSubmit();\n }\n\n render () {\n const { value, disabled, intl } = this.props;\n\n const label = intl.formatMessage(messages.label);\n const title = intl.formatMessage(messages.title);\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Avatar from 'flavours/glitch/components/avatar';\nimport DisplayName from 'flavours/glitch/components/display_name';\nimport IconButton from 'flavours/glitch/components/icon_button';\nimport { defineMessages } from 'react-intl';\n\nconst messages = defineMessages({\n remove: { id: 'lists.account.remove', defaultMessage: 'Remove from list' },\n add: { id: 'lists.account.add', defaultMessage: 'Add to list' },\n});\n\nexport default class Account extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n intl: PropTypes.object.isRequired,\n onRemove: PropTypes.func.isRequired,\n onAdd: PropTypes.func.isRequired,\n added: PropTypes.bool,\n };\n\n static defaultProps = {\n added: false,\n };\n\n render () {\n const { account, intl, onRemove, onAdd, added } = this.props;\n\n let button;\n\n if (added) {\n button = ;\n } else {\n button = ;\n }\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { defineMessages } from 'react-intl';\nimport classNames from 'classnames';\n\nconst messages = defineMessages({\n search: { id: 'lists.search', defaultMessage: 'Search among people you follow' },\n});\n\nexport default class Search extends React.PureComponent {\n\n static propTypes = {\n intl: PropTypes.object.isRequired,\n value: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n onClear: PropTypes.func.isRequired,\n };\n\n handleChange = e => {\n this.props.onChange(e.target.value);\n }\n\n handleKeyUp = e => {\n if (e.keyCode === 13) {\n this.props.onSubmit(this.props.value);\n }\n }\n\n handleClear = () => {\n this.props.onClear();\n }\n\n render () {\n const { value, intl } = this.props;\n const hasValue = value.length > 0;\n\n return (\n \n
\n {intl.formatMessage(messages.search)} \n\n \n \n\n
\n \n \n
\n
\n );\n }\n\n}\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {// No operation performed.\n}\n\nmodule.exports = noop;","import React, { Fragment } from 'react';\nimport { FormattedNumber } from 'react-intl';\n\nexport const shortNumberFormat = number => {\n if (number < 1000) {\n return ;\n } else {\n return K ;\n }\n};\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport PropTypes from 'prop-types';\n\nexport default class LoadMore extends React.PureComponent {\n\n static propTypes = {\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n visible: PropTypes.bool,\n }\n\n static defaultProps = {\n visible: true,\n }\n\n render() {\n const { disabled, visible } = this.props;\n\n return (\n \n \n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { injectIntl, defineMessages } from 'react-intl';\nimport Icon from 'mastodon/components/icon';\n\nconst messages = defineMessages({\n load_more: { id: 'status.load_more', defaultMessage: 'Load more' },\n});\n\nexport default @injectIntl\nclass LoadGap extends React.PureComponent {\n\n static propTypes = {\n disabled: PropTypes.bool,\n maxId: PropTypes.string,\n onClick: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n handleClick = () => {\n this.props.onClick(this.props.maxId);\n }\n\n render () {\n const { disabled, intl } = this.props;\n\n return (\n \n \n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { injectIntl, FormattedMessage } from 'react-intl';\nimport SettingToggle from '../../notifications/components/setting_toggle';\n\nexport default @injectIntl\nclass ColumnSettings extends React.PureComponent {\n\n static propTypes = {\n settings: ImmutablePropTypes.map.isRequired,\n onChange: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n columnId: PropTypes.string,\n };\n\n render () {\n const { settings, onChange } = this.props;\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\nimport Icon from 'mastodon/components/icon';\n\nconst ColumnLink = ({ icon, text, to, href, method, badge }) => {\n const badgeElement = typeof badge !== 'undefined' ? {badge} : null;\n\n if (href) {\n return (\n \n \n {text}\n {badgeElement}\n \n );\n } else {\n return (\n \n \n {text}\n {badgeElement}\n \n );\n }\n};\n\nColumnLink.propTypes = {\n icon: PropTypes.string.isRequired,\n text: PropTypes.string.isRequired,\n to: PropTypes.string,\n href: PropTypes.string,\n method: PropTypes.string,\n badge: PropTypes.node,\n};\n\nexport default ColumnLink;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst ColumnSubheading = ({ text }) => {\n return (\n \n {text}\n
\n );\n};\n\nColumnSubheading.propTypes = {\n text: PropTypes.string.isRequired,\n};\n\nexport default ColumnSubheading;\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { changeListEditorTitle, submitListEditor } from '../../../actions/lists';\nimport IconButton from '../../../components/icon_button';\nimport { defineMessages, injectIntl } from 'react-intl';\n\nconst messages = defineMessages({\n label: { id: 'lists.new.title_placeholder', defaultMessage: 'New list title' },\n title: { id: 'lists.new.create', defaultMessage: 'Add list' },\n});\n\nconst mapStateToProps = state => ({\n value: state.getIn(['listEditor', 'title']),\n disabled: state.getIn(['listEditor', 'isSubmitting']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onChange: value => dispatch(changeListEditorTitle(value)),\n onSubmit: () => dispatch(submitListEditor(true)),\n});\n\nexport default @connect(mapStateToProps, mapDispatchToProps)\n@injectIntl\nclass NewListForm extends React.PureComponent {\n\n static propTypes = {\n value: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n };\n\n handleChange = e => {\n this.props.onChange(e.target.value);\n }\n\n handleSubmit = e => {\n e.preventDefault();\n this.props.onSubmit();\n }\n\n handleClick = () => {\n this.props.onSubmit();\n }\n\n render () {\n const { value, disabled, intl } = this.props;\n\n const label = intl.formatMessage(messages.label);\n const title = intl.formatMessage(messages.title);\n\n return (\n \n );\n }\n\n}\n","/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n// $FlowFixMe\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n // $FlowFixMe\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n // $FlowFixMe\n return document.styleSheets[i];\n }\n }\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n return tag;\n}\n\nvar StyleSheet =\n/*#__PURE__*/\nfunction () {\n function StyleSheet(options) {\n this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n var _tag = createStyleElement(this);\n\n var before;\n\n if (this.tags.length === 0) {\n before = this.before;\n } else {\n before = this.tags[this.tags.length - 1].nextSibling;\n }\n\n this.container.insertBefore(_tag, before);\n this.tags.push(_tag);\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is a really hot path\n // we check the second character first because having \"i\"\n // as the second character will happen less often than\n // having \"@\" as the first character\n var isImportRule = rule.charCodeAt(1) === 105 && rule.charCodeAt(0) === 64; // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n\n sheet.insertRule(rule, // we need to insert @import rules before anything else\n // otherwise there will be an error\n // technically this means that the @import rules will\n // _usually_(not always since there could be multiple style tags)\n // be the first ones in prod and generally later in dev\n // this shouldn't really matter in the real world though\n // @import is generally only used for font faces from google fonts and etc.\n // so while this could be technically correct then it would be slower and larger\n // for a tiny bit of correctness that won't matter in the real world\n isImportRule ? 0 : sheet.cssRules.length);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"There was a problem inserting the following rule: \\\"\" + rule + \"\\\"\", e);\n }\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n // $FlowFixMe\n this.tags.forEach(function (tag) {\n return tag.parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };","function stylis_min(W) {\n function M(d, c, e, h, a) {\n for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {\n g = e.charCodeAt(l);\n l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);\n\n if (0 === b + n + v + m) {\n if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {\n switch (g) {\n case 32:\n case 9:\n case 59:\n case 13:\n case 10:\n break;\n\n default:\n f += e.charAt(l);\n }\n\n g = 59;\n }\n\n switch (g) {\n case 123:\n f = f.trim();\n q = f.charCodeAt(0);\n k = 1;\n\n for (t = ++l; l < B;) {\n switch (g = e.charCodeAt(l)) {\n case 123:\n k++;\n break;\n\n case 125:\n k--;\n break;\n\n case 47:\n switch (g = e.charCodeAt(l + 1)) {\n case 42:\n case 47:\n a: {\n for (u = l + 1; u < J; ++u) {\n switch (e.charCodeAt(u)) {\n case 47:\n if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {\n l = u + 1;\n break a;\n }\n\n break;\n\n case 10:\n if (47 === g) {\n l = u + 1;\n break a;\n }\n\n }\n }\n\n l = u;\n }\n\n }\n\n break;\n\n case 91:\n g++;\n\n case 40:\n g++;\n\n case 34:\n case 39:\n for (; l++ < J && e.charCodeAt(l) !== g;) {}\n\n }\n\n if (0 === k) break;\n l++;\n }\n\n k = e.substring(t, l);\n 0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));\n\n switch (q) {\n case 64:\n 0 < r && (f = f.replace(N, ''));\n g = f.charCodeAt(1);\n\n switch (g) {\n case 100:\n case 109:\n case 115:\n case 45:\n r = c;\n break;\n\n default:\n r = O;\n }\n\n k = M(c, r, k, g, a + 1);\n t = k.length;\n 0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));\n if (0 < t) switch (g) {\n case 115:\n f = f.replace(da, ea);\n\n case 100:\n case 109:\n case 45:\n k = f + '{' + k + '}';\n break;\n\n case 107:\n f = f.replace(fa, '$1 $2');\n k = f + '{' + k + '}';\n k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;\n break;\n\n default:\n k = f + k, 112 === h && (k = (p += k, ''));\n } else k = '';\n break;\n\n default:\n k = M(c, X(c, f, I), k, h, a + 1);\n }\n\n F += k;\n k = I = r = u = q = 0;\n f = '';\n g = e.charCodeAt(++l);\n break;\n\n case 125:\n case 59:\n f = (0 < r ? f.replace(N, '') : f).trim();\n if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\\x00\\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {\n case 0:\n break;\n\n case 64:\n if (105 === g || 99 === g) {\n G += f + e.charAt(l);\n break;\n }\n\n default:\n 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));\n }\n I = r = u = q = 0;\n f = '';\n g = e.charCodeAt(++l);\n }\n }\n\n switch (g) {\n case 13:\n case 10:\n 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\\x00');\n 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);\n z = 1;\n D++;\n break;\n\n case 59:\n case 125:\n if (0 === b + n + v + m) {\n z++;\n break;\n }\n\n default:\n z++;\n y = e.charAt(l);\n\n switch (g) {\n case 9:\n case 32:\n if (0 === n + m + b) switch (x) {\n case 44:\n case 58:\n case 9:\n case 32:\n y = '';\n break;\n\n default:\n 32 !== g && (y = ' ');\n }\n break;\n\n case 0:\n y = '\\\\0';\n break;\n\n case 12:\n y = '\\\\f';\n break;\n\n case 11:\n y = '\\\\v';\n break;\n\n case 38:\n 0 === n + b + m && (r = I = 1, y = '\\f' + y);\n break;\n\n case 108:\n if (0 === n + b + m + E && 0 < u) switch (l - u) {\n case 2:\n 112 === x && 58 === e.charCodeAt(l - 3) && (E = x);\n\n case 8:\n 111 === K && (E = K);\n }\n break;\n\n case 58:\n 0 === n + b + m && (u = l);\n break;\n\n case 44:\n 0 === b + v + n + m && (r = 1, y += '\\r');\n break;\n\n case 34:\n case 39:\n 0 === b && (n = n === g ? 0 : 0 === n ? g : n);\n break;\n\n case 91:\n 0 === n + b + v && m++;\n break;\n\n case 93:\n 0 === n + b + v && m--;\n break;\n\n case 41:\n 0 === n + b + m && v--;\n break;\n\n case 40:\n if (0 === n + b + m) {\n if (0 === q) switch (2 * x + 3 * K) {\n case 533:\n break;\n\n default:\n q = 1;\n }\n v++;\n }\n\n break;\n\n case 64:\n 0 === b + v + n + m + u + k && (k = 1);\n break;\n\n case 42:\n case 47:\n if (!(0 < n + m + v)) switch (b) {\n case 0:\n switch (2 * g + 3 * e.charCodeAt(l + 1)) {\n case 235:\n b = 47;\n break;\n\n case 220:\n t = l, b = 42;\n }\n\n break;\n\n case 42:\n 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);\n }\n }\n\n 0 === b && (f += y);\n }\n\n K = x;\n x = g;\n l++;\n }\n\n t = p.length;\n\n if (0 < t) {\n r = c;\n if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;\n p = r.join(',') + '{' + p + '}';\n\n if (0 !== w * E) {\n 2 !== w || L(p, 2) || (E = 0);\n\n switch (E) {\n case 111:\n p = p.replace(ha, ':-moz-$1') + p;\n break;\n\n case 112:\n p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;\n }\n\n E = 0;\n }\n }\n\n return G + p + F;\n }\n\n function X(d, c, e) {\n var h = c.trim().split(ia);\n c = h;\n var a = h.length,\n m = d.length;\n\n switch (m) {\n case 0:\n case 1:\n var b = 0;\n\n for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {\n c[b] = Z(d, c[b], e, m).trim();\n }\n\n break;\n\n default:\n var v = b = 0;\n\n for (c = []; b < a; ++b) {\n for (var n = 0; n < m; ++n) {\n c[v++] = Z(d[n] + ' ', h[b], e, m).trim();\n }\n }\n\n }\n\n return c;\n }\n\n function Z(d, c, e) {\n var h = c.charCodeAt(0);\n 33 > h && (h = (c = c.trim()).charCodeAt(0));\n\n switch (h) {\n case 38:\n return c.replace(F, '$1' + d.trim());\n\n case 58:\n return d.trim() + c.replace(F, '$1' + d.trim());\n\n default:\n if (0 < 1 * e && 0 < c.indexOf('\\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());\n }\n\n return d + c;\n }\n\n function P(d, c, e, h) {\n var a = d + ';',\n m = 2 * c + 3 * e + 4 * h;\n\n if (944 === m) {\n d = a.indexOf(':', 9) + 1;\n var b = a.substring(d, a.length - 1).trim();\n b = a.substring(0, d).trim() + b + ';';\n return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;\n }\n\n if (0 === w || 2 === w && !L(a, 1)) return a;\n\n switch (m) {\n case 1015:\n return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;\n\n case 951:\n return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;\n\n case 963:\n return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;\n\n case 1009:\n if (100 !== a.charCodeAt(4)) break;\n\n case 969:\n case 942:\n return '-webkit-' + a + a;\n\n case 978:\n return '-webkit-' + a + '-moz-' + a + a;\n\n case 1019:\n case 983:\n return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;\n\n case 883:\n if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;\n if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;\n break;\n\n case 932:\n if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {\n case 103:\n return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;\n\n case 115:\n return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;\n\n case 98:\n return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;\n }\n return '-webkit-' + a + '-ms-' + a + a;\n\n case 964:\n return '-webkit-' + a + '-ms-flex-' + a + a;\n\n case 1023:\n if (99 !== a.charCodeAt(8)) break;\n b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');\n return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;\n\n case 1005:\n return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;\n\n case 1e3:\n b = a.substring(13).trim();\n c = b.indexOf('-') + 1;\n\n switch (b.charCodeAt(0) + b.charCodeAt(c)) {\n case 226:\n b = a.replace(G, 'tb');\n break;\n\n case 232:\n b = a.replace(G, 'tb-rl');\n break;\n\n case 220:\n b = a.replace(G, 'lr');\n break;\n\n default:\n return a;\n }\n\n return '-webkit-' + a + '-ms-' + b + a;\n\n case 1017:\n if (-1 === a.indexOf('sticky', 9)) break;\n\n case 975:\n c = (a = d).length - 10;\n b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();\n\n switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {\n case 203:\n if (111 > b.charCodeAt(8)) break;\n\n case 115:\n a = a.replace(b, '-webkit-' + b) + ';' + a;\n break;\n\n case 207:\n case 102:\n a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;\n }\n\n return a + ';';\n\n case 938:\n if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {\n case 105:\n return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;\n\n case 115:\n return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;\n\n default:\n return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;\n }\n break;\n\n case 973:\n case 989:\n if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;\n\n case 931:\n case 953:\n if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;\n break;\n\n case 962:\n if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;\n }\n\n return a;\n }\n\n function L(d, c) {\n var e = d.indexOf(1 === c ? ':' : '{'),\n h = d.substring(0, 3 !== c ? e : 10);\n e = d.substring(e + 1, d.length - 1);\n return R(2 !== c ? h : h.replace(na, '$1'), e, c);\n }\n\n function ea(d, c) {\n var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));\n return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';\n }\n\n function H(d, c, e, h, a, m, b, v, n, q) {\n for (var g = 0, x = c, w; g < A; ++g) {\n switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {\n case void 0:\n case !1:\n case !0:\n case null:\n break;\n\n default:\n x = w;\n }\n }\n\n if (x !== c) return x;\n }\n\n function T(d) {\n switch (d) {\n case void 0:\n case null:\n A = S.length = 0;\n break;\n\n default:\n if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {\n T(d[c]);\n } else Y = !!d | 0;\n }\n\n return T;\n }\n\n function U(d) {\n d = d.prefix;\n void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);\n return U;\n }\n\n function B(d, c) {\n var e = d;\n 33 > e.charCodeAt(0) && (e = e.trim());\n V = e;\n e = [V];\n\n if (0 < A) {\n var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);\n void 0 !== h && 'string' === typeof h && (c = h);\n }\n\n var a = M(O, e, c, 0, 0);\n 0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));\n V = '';\n E = 0;\n z = D = 1;\n return a;\n }\n\n var ca = /^\\0+/g,\n N = /[\\0\\r\\f]/g,\n aa = /: */g,\n ka = /zoo|gra/,\n ma = /([,: ])(transform)/g,\n ia = /,\\r+?/g,\n F = /([\\t\\r\\n ])*\\f?&/g,\n fa = /@(k\\w+)\\s*(\\S*)\\s*/,\n Q = /::(place)/g,\n ha = /:(read-only)/g,\n G = /[svh]\\w+-[tblr]{2}/,\n da = /\\(\\s*(.*)\\s*\\)/g,\n oa = /([\\s\\S]*?);/g,\n ba = /-self|flex-/g,\n na = /[^]*?(:[rp][el]a[\\w-]+)[^]*/,\n la = /stretch|:\\s*\\w+\\-(?:conte|avail)/,\n ja = /([^-])(image-set\\()/,\n z = 1,\n D = 1,\n E = 0,\n w = 1,\n O = [],\n S = [],\n A = 0,\n R = null,\n Y = 0,\n V = '';\n B.use = T;\n B.set = U;\n void 0 !== W && U(W);\n return B;\n}\n\nexport default stylis_min;","import { StyleSheet } from '@emotion/sheet';\nimport Stylis from '@emotion/stylis';\nimport '@emotion/weak-memoize'; // https://github.com/thysultan/stylis.js/tree/master/plugins/rule-sheet\n// inlined to avoid umd wrapper and peerDep warnings/installing stylis\n// since we use stylis after closure compiler\n\nvar delimiter = '/*|*/';\nvar needle = delimiter + '}';\n\nfunction toSheet(block) {\n if (block) {\n Sheet.current.insert(block + '}');\n }\n}\n\nvar Sheet = {\n current: null\n};\n\nvar ruleSheet = function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) {\n switch (context) {\n // property\n case 1:\n {\n switch (content.charCodeAt(0)) {\n case 64:\n {\n // @import\n Sheet.current.insert(content + ';');\n return '';\n }\n // charcode for l\n\n case 108:\n {\n // charcode for b\n // this ignores label\n if (content.charCodeAt(2) === 98) {\n return '';\n }\n }\n }\n\n break;\n }\n // selector\n\n case 2:\n {\n if (ns === 0) return content + delimiter;\n break;\n }\n // at-rule\n\n case 3:\n {\n switch (ns) {\n // @font-face, @page\n case 102:\n case 112:\n {\n Sheet.current.insert(selectors[0] + content);\n return '';\n }\n\n default:\n {\n return content + (at === 0 ? delimiter : '');\n }\n }\n }\n\n case -2:\n {\n content.split(needle).forEach(toSheet);\n }\n }\n};\n\nvar createCache = function createCache(options) {\n if (options === undefined) options = {};\n var key = options.key || 'css';\n var stylisOptions;\n\n if (options.prefix !== undefined) {\n stylisOptions = {\n prefix: options.prefix\n };\n }\n\n var stylis = new Stylis(stylisOptions);\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe\n if (/[^a-z-]/.test(key)) {\n throw new Error(\"Emotion key must only contain lower case alphabetical characters and - but \\\"\" + key + \"\\\" was passed\");\n }\n }\n\n var inserted = {}; // $FlowFixMe\n\n var container;\n {\n container = options.container || document.head;\n var nodes = document.querySelectorAll(\"style[data-emotion-\" + key + \"]\");\n Array.prototype.forEach.call(nodes, function (node) {\n var attrib = node.getAttribute(\"data-emotion-\" + key); // $FlowFixMe\n\n attrib.split(' ').forEach(function (id) {\n inserted[id] = true;\n });\n\n if (node.parentNode !== container) {\n container.appendChild(node);\n }\n });\n }\n\n var _insert;\n\n {\n stylis.use(options.stylisPlugins)(ruleSheet);\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n var name = serialized.name;\n Sheet.current = sheet;\n\n if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {\n var map = serialized.map;\n Sheet.current = {\n insert: function insert(rule) {\n sheet.insert(rule + map);\n }\n };\n }\n\n stylis(selector, serialized.styles);\n\n if (shouldCache) {\n cache.inserted[name] = true;\n }\n };\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // https://esbench.com/bench/5bf7371a4cd7e6009ef61d0a\n var commentStart = /\\/\\*/g;\n var commentEnd = /\\*\\//g;\n stylis.use(function (context, content) {\n switch (context) {\n case -1:\n {\n while (commentStart.test(content)) {\n commentEnd.lastIndex = commentStart.lastIndex;\n\n if (commentEnd.test(content)) {\n commentStart.lastIndex = commentEnd.lastIndex;\n continue;\n }\n\n throw new Error('Your styles have an unterminated comment (\"/*\" without corresponding \"*/\").');\n }\n\n commentStart.lastIndex = 0;\n break;\n }\n }\n });\n stylis.use(function (context, content, selectors) {\n switch (context) {\n case 2:\n {\n for (var i = 0, len = selectors.length; len > i; i++) {\n // :last-child isn't included here since it's safe\n // because a style element will never be the last element\n var match = selectors[i].match(/:(first|nth|nth-last)-child/);\n\n if (match !== null) {\n console.error(\"The pseudo class \\\"\" + match[0] + \"\\\" is potentially unsafe when doing server-side rendering. Try changing it to \\\"\" + match[1] + \"-of-type\\\"\");\n }\n }\n\n break;\n }\n }\n });\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n return cache;\n};\n\nexport default createCache;","/* eslint-disable */\n// murmurhash2 via https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js\nfunction murmurhash2_32_gc(str) {\n var l = str.length,\n h = l ^ l,\n i = 0,\n k;\n\n while (l >= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);\n k ^= k >>> 24;\n k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);\n h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16) ^ k;\n l -= 4;\n ++i;\n }\n\n switch (l) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);\n }\n\n h ^= h >>> 13;\n h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);\n h ^= h >>> 15;\n return (h >>> 0).toString(36);\n}\n\nexport default murmurhash2_32_gc;","var unitlessKeys = {\n animationIterationCount: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\nexport default unitlessKeys;","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\nvar processStyleName = memoize(function (styleName) {\n return styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n if (value == null || typeof value === 'boolean') {\n return '';\n }\n\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n value = value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && key.charCodeAt(1) !== 45 && // custom properties\n typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(attr|calc|counters?|url)\\(/;\n var contentValues = ['normal', 'none', 'counter', 'open-quote', 'close-quote', 'no-open-quote', 'no-close-quote', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g;\n var hyphenatedCache = {};\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n console.error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n if (key.charCodeAt(1) !== 45 && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {\n hyphenatedCache[key] = true;\n console.error(\"Using kebab-case for css properties in objects is not supported. Did you mean \" + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, char) {\n return char.toUpperCase();\n }) + \"?\");\n }\n\n return oldProcessStyleValue(key, value);\n };\n}\n\nvar shouldWarnAboutInterpolatingClassNameFromCss = true;\n\nfunction handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) {\n if (interpolation == null) {\n return '';\n }\n\n if (interpolation.__emotion_styles !== undefined) {\n if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {\n throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');\n }\n\n return interpolation;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n if (interpolation.anim === 1) {\n cursor = {\n name: interpolation.name,\n styles: interpolation.styles,\n next: cursor\n };\n return interpolation.name;\n }\n\n if (interpolation.styles !== undefined) {\n var next = interpolation.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = interpolation.styles;\n\n if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {\n styles += interpolation.map;\n }\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result, couldBeSelectorInterpolation);\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Functions that are interpolated in css calls will be stringified.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n }\n // eslint-disable-next-line no-fallthrough\n\n default:\n {\n if (registered == null) {\n return interpolation;\n }\n\n var cached = registered[interpolation];\n\n if (process.env.NODE_ENV !== 'production' && couldBeSelectorInterpolation && shouldWarnAboutInterpolatingClassNameFromCss && cached !== undefined) {\n console.error('Interpolating a className from css`` is not recommended and will cause problems with composition.\\n' + 'Interpolating a className from css`` will be completely unsupported in a future major version of Emotion');\n shouldWarnAboutInterpolatingClassNameFromCss = false;\n }\n\n return cached !== undefined && !couldBeSelectorInterpolation ? cached : interpolation;\n }\n }\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i], false);\n }\n } else {\n for (var _key in obj) {\n var value = obj[_key];\n\n if (typeof value !== 'object') {\n if (registered != null && registered[value] !== undefined) {\n string += _key + \"{\" + registered[value] + \"}\";\n } else {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value) + \";\";\n }\n } else {\n if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value[_i]) + \";\";\n }\n } else {\n string += _key + \"{\" + handleInterpolation(mergedProps, registered, value, false) + \"}\";\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*;/g;\nvar sourceMapPattern;\n\nif (process.env.NODE_ENV !== 'production') {\n sourceMapPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//;\n} // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\n\nvar serializeStyles = function serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings, false);\n } else {\n styles += strings[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46);\n\n if (stringMode) {\n styles += strings[i];\n }\n }\n\n var sourceMap;\n\n if (process.env.NODE_ENV !== 'production') {\n styles = styles.replace(sourceMapPattern, function (match) {\n sourceMap = match;\n return '';\n });\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + // $FlowFixMe we know it's not null\n match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n if (process.env.NODE_ENV !== 'production') {\n return {\n name: name,\n styles: styles,\n map: sourceMap,\n next: cursor\n };\n }\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n};\n\nexport { serializeStyles };","var isBrowser = \"object\" !== 'undefined';\n\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className]);\n } else {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\n\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n var maybeStyles = cache.insert(\".\" + className, current, cache.sheet, true);\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles };","import createCache from '@emotion/cache';\nimport { serializeStyles } from '@emotion/serialize';\nimport { insertStyles, getRegisteredStyles } from '@emotion/utils';\n\nfunction insertWithoutScoping(cache, serialized) {\n if (cache.inserted[serialized.name] === undefined) {\n return cache.insert('', serialized, cache.sheet, true);\n }\n}\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar createEmotion = function createEmotion(options) {\n var cache = createCache(options); // $FlowFixMe\n\n cache.sheet.speedy = function (value) {\n if (process.env.NODE_ENV !== 'production' && this.ctr !== 0) {\n throw new Error('speedy must be changed before any rules are inserted');\n }\n\n this.isSpeedy = value;\n };\n\n cache.compat = true;\n\n var css = function css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered, this !== undefined ? this.mergedProps : undefined);\n insertStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var keyframes = function keyframes() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n var animation = \"animation-\" + serialized.name;\n insertWithoutScoping(cache, {\n name: serialized.name,\n styles: \"@keyframes \" + animation + \"{\" + serialized.styles + \"}\"\n });\n return animation;\n };\n\n var injectGlobal = function injectGlobal() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n insertWithoutScoping(cache, serialized);\n };\n\n var cx = function cx() {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n return {\n css: css,\n cx: cx,\n injectGlobal: injectGlobal,\n keyframes: keyframes,\n hydrate: function hydrate(ids) {\n ids.forEach(function (key) {\n cache.inserted[key] = true;\n });\n },\n flush: function flush() {\n cache.registered = {};\n cache.inserted = {};\n cache.sheet.flush();\n },\n // $FlowFixMe\n sheet: cache.sheet,\n cache: cache,\n getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),\n merge: merge.bind(null, cache.registered, css)\n };\n};\n\nvar classnames = function classnames(args) {\n var cls = '';\n\n for (var i = 0; i < args.length; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nexport default createEmotion;","// Package imports.\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport {\n FormattedMessage,\n defineMessages,\n} from 'react-intl';\nimport spring from 'react-motion/lib/spring';\n\n// Utils.\nimport Motion from 'flavours/glitch/util/optional_motion';\nimport { searchEnabled } from 'flavours/glitch/util/initial_state';\n\n// Messages.\nconst messages = defineMessages({\n format: {\n defaultMessage: 'Advanced search format',\n id: 'search_popout.search_format',\n },\n hashtag: {\n defaultMessage: 'hashtag',\n id: 'search_popout.tips.hashtag',\n },\n status: {\n defaultMessage: 'status',\n id: 'search_popout.tips.status',\n },\n text: {\n defaultMessage: 'Simple text returns matching display names, usernames and hashtags',\n id: 'search_popout.tips.text',\n },\n full_text: {\n defaultMessage: 'Simple text returns statuses you have written, favourited, boosted, or have been mentioned in, as well as matching usernames, display names, and hashtags.',\n id: 'search_popout.tips.full_text',\n },\n user: {\n defaultMessage: 'user',\n id: 'search_popout.tips.user',\n },\n});\n\n// The spring used by our motion.\nconst motionSpring = spring(1, { damping: 35, stiffness: 400 });\n\n// The component.\nexport default function DrawerSearchPopout ({ style }) {\n\n // The result.\n return (\n \n
\n {({ opacity, scaleX, scaleY }) => (\n \n
\n
\n \n #example \n {' '}\n \n \n \n @username@domain \n {' '}\n \n \n \n URL \n {' '}\n \n \n \n URL \n {' '}\n \n \n \n { searchEnabled ?
:
}\n
\n )}\n \n
\n );\n}\n\n// Props.\nDrawerSearchPopout.propTypes = { style: PropTypes.object };\n","// Package imports.\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport {\n FormattedMessage,\n defineMessages,\n} from 'react-intl';\nimport Overlay from 'react-overlays/lib/Overlay';\n\n// Components.\nimport Icon from 'flavours/glitch/components/icon';\nimport DrawerSearchPopout from './popout';\n\n// Utils.\nimport { focusRoot } from 'flavours/glitch/util/dom_helpers';\nimport {\n assignHandlers,\n hiddenComponent,\n} from 'flavours/glitch/util/react_helpers';\n\n// Messages.\nconst messages = defineMessages({\n placeholder: {\n defaultMessage: 'Search',\n id: 'search.placeholder',\n },\n});\n\n// Handlers.\nconst handlers = {\n\n handleBlur () {\n this.setState({ expanded: false });\n },\n\n handleChange ({ target: { value } }) {\n const { onChange } = this.props;\n if (onChange) {\n onChange(value);\n }\n },\n\n handleClear (e) {\n const {\n onClear,\n submitted,\n value,\n } = this.props;\n e.preventDefault(); // Prevents focus change ??\n if (onClear && (submitted || value && value.length)) {\n onClear();\n }\n },\n\n handleFocus () {\n const { onShow } = this.props;\n this.setState({ expanded: true });\n if (onShow) {\n onShow();\n }\n },\n\n handleKeyUp (e) {\n const { onSubmit } = this.props;\n switch (e.key) {\n case 'Enter':\n if (onSubmit) {\n onSubmit();\n }\n break;\n case 'Escape':\n focusRoot();\n }\n },\n};\n\n// The component.\nexport default class DrawerSearch extends React.PureComponent {\n\n // Constructor.\n constructor (props) {\n super(props);\n assignHandlers(this, handlers);\n this.state = { expanded: false };\n }\n\n // Rendering.\n render () {\n const {\n handleBlur,\n handleChange,\n handleClear,\n handleFocus,\n handleKeyUp,\n } = this.handlers;\n const {\n intl,\n submitted,\n value,\n } = this.props;\n const { expanded } = this.state;\n const active = value && value.length || submitted;\n const computedClass = classNames('drawer--search', { active });\n\n return (\n \n
\n \n \n \n \n \n
\n \n \n
\n
\n
\n );\n }\n\n}\n\n// Props.\nDrawerSearch.propTypes = {\n value: PropTypes.string,\n submitted: PropTypes.bool,\n onChange: PropTypes.func,\n onSubmit: PropTypes.func,\n onClear: PropTypes.func,\n onShow: PropTypes.func,\n intl: PropTypes.object,\n};\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport DropdownMenuContainer from '../../../containers/dropdown_menu_container';\nimport { defineMessages, injectIntl } from 'react-intl';\n\nconst messages = defineMessages({\n edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },\n pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned toots' },\n preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },\n follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },\n favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' },\n lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' },\n blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },\n domain_blocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Hidden domains' },\n mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },\n filters: { id: 'navigation_bar.filters', defaultMessage: 'Muted words' },\n});\n\nexport default @injectIntl\nclass ActionBar extends React.PureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n render () {\n const { intl } = this.props;\n\n let menu = [];\n\n menu.push({ text: intl.formatMessage(messages.preferences), href: '/user-settings' });\n menu.push({ text: intl.formatMessage(messages.pins), to: '/pinned' });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.follow_requests), to: '/follow_requests' });\n menu.push({ text: intl.formatMessage(messages.favourites), to: '/favourites' });\n menu.push({ text: intl.formatMessage(messages.lists), to: '/lists' });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.mutes), to: '/mutes' });\n menu.push({ text: intl.formatMessage(messages.blocks), to: '/blocks' });\n menu.push({ text: intl.formatMessage(messages.domain_blocks), to: '/domain_blocks' });\n menu.push({ text: intl.formatMessage(messages.filters), href: '/filters' });\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ActionBar from './action_bar';\nimport Avatar from '../../../components/avatar';\nimport Permalink from '../../../components/permalink';\nimport IconButton from '../../../components/icon_button';\nimport { FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\n\nexport default class NavigationBar extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n onClose: PropTypes.func,\n };\n\n render () {\n return (\n \n
\n {this.props.account.get('acct')} \n \n \n\n
\n
\n @{this.props.account.get('acct')} \n \n
\n\n
\n
\n );\n }\n\n}\n","// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating\n// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel\n// MIT license\nvar isWindowAvailable = typeof window !== 'undefined';\nisWindowAvailable && function () {\n var lastTime = 0;\n var vendors = ['ms', 'moz', 'webkit', 'o'];\n\n for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {\n window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];\n window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];\n }\n\n if (!window.requestAnimationFrame) window.requestAnimationFrame = function (callback, element) {\n var currTime = new Date().getTime();\n var timeToCall = Math.max(0, 16 - (currTime - lastTime));\n var id = window.setTimeout(function () {\n callback(currTime + timeToCall);\n }, timeToCall);\n lastTime = currTime + timeToCall;\n return id;\n };\n if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function (id) {\n clearTimeout(id);\n };\n}();","module.exports = {\n \"default\": require(\"core-js/library/fn/object/keys\"),\n __esModule: true\n};","require('../../modules/es6.object.keys');\n\nmodule.exports = require('../../modules/_core').Object.keys;","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\n\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\n\nmodule.exports = function (it) {\n return Object(defined(it));\n};","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\n\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};","var has = require('./_has');\n\nvar toIObject = require('./_to-iobject');\n\nvar arrayIndexOf = require('./_array-includes')(false);\n\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n\n for (key in O) {\n if (key != IE_PROTO) has(O, key) && result.push(key);\n } // Don't enum bug & hidden keys\n\n\n while (names.length > i) {\n if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n }\n\n return result;\n};","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof'); // eslint-disable-next-line no-prototype-builtins\n\n\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\n\nvar toLength = require('./_to-length');\n\nvar toAbsoluteIndex = require('./_to-absolute-index');\n\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value; // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++]; // eslint-disable-next-line no-self-compare\n\n if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not\n } else for (; length > index; index++) {\n if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n }\n }\n return !IS_INCLUDES && -1;\n };\n};","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\n\nvar min = Math.min;\n\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};","var toInteger = require('./_to-integer');\n\nvar max = Math.max;\nvar min = Math.min;\n\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};","var shared = require('./_shared')('keys');\n\nvar uid = require('./_uid');\n\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};","var core = require('./_core');\n\nvar global = require('./_global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});","module.exports = true;","var id = 0;\nvar px = Math.random();\n\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};","// IE 8- don't enum bug keys\nmodule.exports = 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'.split(',');","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\n\nvar core = require('./_core');\n\nvar fails = require('./_fails');\n\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () {\n fn(1);\n }), 'Object', exp);\n};","var global = require('./_global');\n\nvar core = require('./_core');\n\nvar ctx = require('./_ctx');\n\nvar hide = require('./_hide');\n\nvar has = require('./_has');\n\nvar PROTOTYPE = 'prototype';\n\nvar $export = function $export(type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue; // export native or passed\n\n out = own ? target[key] : source[key]; // prevent global pollution for namespaces\n\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global) // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? function (C) {\n var F = function F(a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0:\n return new C();\n\n case 1:\n return new C(a);\n\n case 2:\n return new C(a, b);\n }\n\n return new C(a, b, c);\n }\n\n return C.apply(this, arguments);\n };\n\n F[PROTOTYPE] = C[PROTOTYPE];\n return F; // make static versions for prototype methods\n }(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out; // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n}; // type bitmap\n\n\n$export.F = 1; // forced\n\n$export.G = 2; // global\n\n$export.S = 4; // static\n\n$export.P = 8; // proto\n\n$export.B = 16; // bind\n\n$export.W = 32; // wrap\n\n$export.U = 64; // safe\n\n$export.R = 128; // real proto method for `library`\n\nmodule.exports = $export;","// optional / simple context binding\nvar aFunction = require('./_a-function');\n\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n\n switch (length) {\n case 1:\n return function (a) {\n return fn.call(that, a);\n };\n\n case 2:\n return function (a, b) {\n return fn.call(that, a, b);\n };\n\n case 3:\n return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n\n return function ()\n /* ...args */\n {\n return fn.apply(that, arguments);\n };\n};","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};","var dP = require('./_object-dp');\n\nvar createDesc = require('./_property-desc');\n\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};","var anObject = require('./_an-object');\n\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\n\nvar toPrimitive = require('./_to-primitive');\n\nvar dP = Object.defineProperty;\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) {\n /* empty */\n }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};","var isObject = require('./_is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {\n get: function get() {\n return 7;\n }\n }).a != 7;\n});","var isObject = require('./_is-object');\n\nvar document = require('./_global').document; // typeof document.createElement is 'object' in old IE\n\n\nvar is = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object'); // instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\n\n\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.defaultProps = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _memoizeOne = require('memoize-one');\n\nvar _memoizeOne2 = _interopRequireDefault(_memoizeOne);\n\nvar _createEmotion = require('create-emotion');\n\nvar _createEmotion2 = _interopRequireDefault(_createEmotion);\n\nvar _Menu = require('./components/Menu');\n\nvar _reactFastCompare = require('./internal/react-fast-compare');\n\nvar _reactFastCompare2 = _interopRequireDefault(_reactFastCompare);\n\nvar _filters = require('./filters');\n\nvar _index = require('./internal/index');\n\nvar _index2 = require('./accessibility/index');\n\nvar _utils = require('./utils');\n\nvar _builtins = require('./builtins');\n\nvar _index3 = require('./components/index');\n\nvar _styles = require('./styles');\n\nvar _theme = require('./theme');\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _toConsumableArray(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n } else {\n return Array.from(arr);\n }\n}\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar defaultProps = exports.defaultProps = {\n backspaceRemovesValue: true,\n blurInputOnSelect: (0, _utils.isTouchCapable)(),\n captureMenuScroll: !(0, _utils.isTouchCapable)(),\n closeMenuOnSelect: true,\n closeMenuOnScroll: false,\n components: {},\n controlShouldRenderValue: true,\n escapeClearsValue: false,\n filterOption: (0, _filters.createFilter)(),\n formatGroupLabel: _builtins.formatGroupLabel,\n getOptionLabel: _builtins.getOptionLabel,\n getOptionValue: _builtins.getOptionValue,\n isDisabled: false,\n isLoading: false,\n isMulti: false,\n isRtl: false,\n isSearchable: true,\n isOptionDisabled: _builtins.isOptionDisabled,\n loadingMessage: function loadingMessage() {\n return 'Loading...';\n },\n maxMenuHeight: 300,\n minMenuHeight: 140,\n menuIsOpen: false,\n menuPlacement: 'bottom',\n menuPosition: 'absolute',\n menuShouldBlockScroll: false,\n menuShouldScrollIntoView: !(0, _utils.isMobileDevice)(),\n noOptionsMessage: function noOptionsMessage() {\n return 'No options';\n },\n openMenuOnFocus: false,\n openMenuOnClick: true,\n options: [],\n pageSize: 5,\n placeholder: 'Select...',\n screenReaderStatus: function screenReaderStatus(_ref) {\n var count = _ref.count;\n return count + ' result' + (count !== 1 ? 's' : '') + ' available';\n },\n styles: {},\n tabIndex: '0',\n tabSelectsValue: true\n};\nvar instanceId = 1;\nvar getEmotion = (0, _memoizeOne2.default)(function (nonce) {\n return (0, _createEmotion2.default)(nonce ? {\n nonce: nonce\n } : {});\n});\n\nvar Select = function (_Component) {\n _inherits(Select, _Component); // Lifecycle\n // ------------------------------\n // Refs\n // ------------------------------\n // TODO\n\n\n function Select(props) {\n _classCallCheck(this, Select);\n\n var _this = _possibleConstructorReturn(this, (Select.__proto__ || Object.getPrototypeOf(Select)).call(this, props));\n\n _initialiseProps.call(_this);\n\n var value = props.value;\n _this.cacheComponents = (0, _memoizeOne2.default)(_this.cacheComponents, _reactFastCompare2.default).bind(_this);\n\n _this.cacheComponents(props.components);\n\n _this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);\n var selectValue = (0, _utils.cleanValue)(value);\n\n var menuOptions = _this.buildMenuOptions(props, selectValue);\n\n _this.emotion = getEmotion(props.nonce);\n _this.state.menuOptions = menuOptions;\n _this.state.selectValue = selectValue;\n return _this;\n } // Misc. Instance Properties\n // ------------------------------\n\n\n _createClass(Select, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.startListeningComposition();\n this.startListeningToTouch();\n\n if (this.props.closeMenuOnScroll && document && document.addEventListener) {\n // Listen to all scroll events, and filter them out inside of 'onScroll'\n document.addEventListener('scroll', this.onScroll, true);\n }\n\n if (this.props.autoFocus) {\n this.focusInput();\n }\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n var _props = this.props,\n options = _props.options,\n value = _props.value,\n inputValue = _props.inputValue; // re-cache custom components\n\n this.cacheComponents(nextProps.components); // rebuild the menu options\n\n if (nextProps.value !== value || nextProps.options !== options || nextProps.inputValue !== inputValue) {\n var _selectValue = (0, _utils.cleanValue)(nextProps.value);\n\n var _menuOptions = this.buildMenuOptions(nextProps, _selectValue);\n\n var _focusedValue = this.getNextFocusedValue(_selectValue);\n\n var _focusedOption = this.getNextFocusedOption(_menuOptions.focusable);\n\n this.setState({\n menuOptions: _menuOptions,\n selectValue: _selectValue,\n focusedOption: _focusedOption,\n focusedValue: _focusedValue\n });\n } // some updates should toggle the state of the input visibility\n\n\n if (this.inputIsHiddenAfterUpdate != null) {\n this.setState({\n inputIsHidden: this.inputIsHiddenAfterUpdate\n });\n delete this.inputIsHiddenAfterUpdate;\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n var _props2 = this.props,\n isDisabled = _props2.isDisabled,\n menuIsOpen = _props2.menuIsOpen;\n var isFocused = this.state.isFocused;\n\n if ( // ensure focus is restored correctly when the control becomes enabled\n isFocused && !isDisabled && prevProps.isDisabled || // ensure focus is on the Input when the menu opens\n isFocused && menuIsOpen && !prevProps.menuIsOpen) {\n this.focusInput();\n } // scroll the focused option into view if necessary\n\n\n if (this.menuListRef && this.focusedOptionRef && this.scrollToFocusedOptionOnUpdate) {\n (0, _utils.scrollIntoView)(this.menuListRef, this.focusedOptionRef);\n }\n\n this.scrollToFocusedOptionOnUpdate = false;\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.stopListeningComposition();\n this.stopListeningToTouch();\n document.removeEventListener('scroll', this.onScroll, true);\n }\n }, {\n key: 'onMenuOpen',\n // ==============================\n // Consumer Handlers\n // ==============================\n value: function onMenuOpen() {\n this.props.onMenuOpen();\n }\n }, {\n key: 'onMenuClose',\n value: function onMenuClose() {\n var _props3 = this.props,\n isSearchable = _props3.isSearchable,\n isMulti = _props3.isMulti;\n this.announceAriaLiveContext({\n event: 'input',\n context: {\n isSearchable: isSearchable,\n isMulti: isMulti\n }\n });\n this.onInputChange('', {\n action: 'menu-close'\n });\n this.props.onMenuClose();\n }\n }, {\n key: 'onInputChange',\n value: function onInputChange(newValue, actionMeta) {\n this.props.onInputChange(newValue, actionMeta);\n } // ==============================\n // Methods\n // ==============================\n\n }, {\n key: 'focusInput',\n value: function focusInput() {\n if (!this.inputRef) return;\n this.inputRef.focus();\n }\n }, {\n key: 'blurInput',\n value: function blurInput() {\n if (!this.inputRef) return;\n this.inputRef.blur();\n } // aliased for consumers\n\n }, {\n key: 'openMenu',\n value: function openMenu(focusOption) {\n var _state = this.state,\n menuOptions = _state.menuOptions,\n selectValue = _state.selectValue;\n var isMulti = this.props.isMulti;\n var openAtIndex = focusOption === 'first' ? 0 : menuOptions.focusable.length - 1;\n\n if (!isMulti) {\n var selectedIndex = menuOptions.focusable.indexOf(selectValue[0]);\n\n if (selectedIndex > -1) {\n openAtIndex = selectedIndex;\n }\n }\n\n this.scrollToFocusedOptionOnUpdate = true;\n this.inputIsHiddenAfterUpdate = false;\n this.onMenuOpen();\n this.setState({\n focusedValue: null,\n focusedOption: menuOptions.focusable[openAtIndex]\n });\n this.announceAriaLiveContext({\n event: 'menu'\n });\n }\n }, {\n key: 'focusValue',\n value: function focusValue(direction) {\n var _props4 = this.props,\n isMulti = _props4.isMulti,\n isSearchable = _props4.isSearchable;\n var _state2 = this.state,\n selectValue = _state2.selectValue,\n focusedValue = _state2.focusedValue; // Only multiselects support value focusing\n\n if (!isMulti) return;\n this.setState({\n focusedOption: null\n });\n var focusedIndex = selectValue.indexOf(focusedValue);\n\n if (!focusedValue) {\n focusedIndex = -1;\n this.announceAriaLiveContext({\n event: 'value'\n });\n }\n\n var lastIndex = selectValue.length - 1;\n var nextFocus = -1;\n if (!selectValue.length) return;\n\n switch (direction) {\n case 'previous':\n if (focusedIndex === 0) {\n // don't cycle from the start to the end\n nextFocus = 0;\n } else if (focusedIndex === -1) {\n // if nothing is focused, focus the last value first\n nextFocus = lastIndex;\n } else {\n nextFocus = focusedIndex - 1;\n }\n\n break;\n\n case 'next':\n if (focusedIndex > -1 && focusedIndex < lastIndex) {\n nextFocus = focusedIndex + 1;\n }\n\n break;\n }\n\n if (nextFocus === -1) {\n this.announceAriaLiveContext({\n event: 'input',\n context: {\n isSearchable: isSearchable,\n isMulti: isMulti\n }\n });\n }\n\n this.setState({\n inputIsHidden: nextFocus === -1 ? false : true,\n focusedValue: selectValue[nextFocus]\n });\n }\n }, {\n key: 'focusOption',\n value: function focusOption() {\n var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'first';\n var pageSize = this.props.pageSize;\n var _state3 = this.state,\n focusedOption = _state3.focusedOption,\n menuOptions = _state3.menuOptions;\n var options = menuOptions.focusable;\n if (!options.length) return;\n var nextFocus = 0; // handles 'first'\n\n var focusedIndex = options.indexOf(focusedOption);\n\n if (!focusedOption) {\n focusedIndex = -1;\n this.announceAriaLiveContext({\n event: 'menu'\n });\n }\n\n if (direction === 'up') {\n nextFocus = focusedIndex > 0 ? focusedIndex - 1 : options.length - 1;\n } else if (direction === 'down') {\n nextFocus = (focusedIndex + 1) % options.length;\n } else if (direction === 'pageup') {\n nextFocus = focusedIndex - pageSize;\n if (nextFocus < 0) nextFocus = 0;\n } else if (direction === 'pagedown') {\n nextFocus = focusedIndex + pageSize;\n if (nextFocus > options.length - 1) nextFocus = options.length - 1;\n } else if (direction === 'last') {\n nextFocus = options.length - 1;\n }\n\n this.scrollToFocusedOptionOnUpdate = true;\n this.setState({\n focusedOption: options[nextFocus],\n focusedValue: null\n });\n }\n }, {\n key: 'getTheme',\n // ==============================\n // Getters\n // ==============================\n value: function getTheme() {\n // Use the default theme if there are no customizations.\n if (!this.props.theme) {\n return _theme.defaultTheme;\n } // If the theme prop is a function, assume the function\n // knows how to merge the passed-in default theme with\n // its own modifications.\n\n\n if (typeof this.props.theme === 'function') {\n return this.props.theme(_theme.defaultTheme);\n } // Otherwise, if a plain theme object was passed in,\n // overlay it with the default theme.\n\n\n return _extends({}, _theme.defaultTheme, this.props.theme);\n }\n }, {\n key: 'getCommonProps',\n value: function getCommonProps() {\n var clearValue = this.clearValue,\n getStyles = this.getStyles,\n setValue = this.setValue,\n selectOption = this.selectOption,\n props = this.props;\n var classNamePrefix = props.classNamePrefix,\n isMulti = props.isMulti,\n isRtl = props.isRtl,\n options = props.options;\n var selectValue = this.state.selectValue;\n var hasValue = this.hasValue();\n\n var getValue = function getValue() {\n return selectValue;\n };\n\n var cxPrefix = classNamePrefix;\n\n var cx = _utils.classNames.bind(null, cxPrefix);\n\n return {\n cx: cx,\n clearValue: clearValue,\n getStyles: getStyles,\n getValue: getValue,\n hasValue: hasValue,\n isMulti: isMulti,\n isRtl: isRtl,\n options: options,\n selectOption: selectOption,\n setValue: setValue,\n selectProps: props,\n theme: this.getTheme(),\n emotion: this.emotion\n };\n }\n }, {\n key: 'getNextFocusedValue',\n value: function getNextFocusedValue(nextSelectValue) {\n if (this.clearFocusValueOnUpdate) {\n this.clearFocusValueOnUpdate = false;\n return null;\n }\n\n var _state4 = this.state,\n focusedValue = _state4.focusedValue,\n lastSelectValue = _state4.selectValue;\n var lastFocusedIndex = lastSelectValue.indexOf(focusedValue);\n\n if (lastFocusedIndex > -1) {\n var nextFocusedIndex = nextSelectValue.indexOf(focusedValue);\n\n if (nextFocusedIndex > -1) {\n // the focused value is still in the selectValue, return it\n return focusedValue;\n } else if (lastFocusedIndex < nextSelectValue.length) {\n // the focusedValue is not present in the next selectValue array by\n // reference, so return the new value at the same index\n return nextSelectValue[lastFocusedIndex];\n }\n }\n\n return null;\n }\n }, {\n key: 'getNextFocusedOption',\n value: function getNextFocusedOption(options) {\n var lastFocusedOption = this.state.focusedOption;\n return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];\n } // ==============================\n // Helpers\n // ==============================\n\n }, {\n key: 'hasValue',\n value: function hasValue() {\n var selectValue = this.state.selectValue;\n return selectValue.length > 0;\n }\n }, {\n key: 'hasOptions',\n value: function hasOptions() {\n return !!this.state.menuOptions.render.length;\n }\n }, {\n key: 'countOptions',\n value: function countOptions() {\n return this.state.menuOptions.focusable.length;\n }\n }, {\n key: 'isClearable',\n value: function isClearable() {\n var _props5 = this.props,\n isClearable = _props5.isClearable,\n isMulti = _props5.isMulti; // single select, by default, IS NOT clearable\n // multi select, by default, IS clearable\n\n if (isClearable === undefined) return isMulti;\n return isClearable;\n }\n }, {\n key: 'isOptionDisabled',\n value: function isOptionDisabled(option, selectValue) {\n return typeof this.props.isOptionDisabled === 'function' ? this.props.isOptionDisabled(option, selectValue) : false;\n }\n }, {\n key: 'isOptionSelected',\n value: function isOptionSelected(option, selectValue) {\n var _this2 = this;\n\n if (selectValue.indexOf(option) > -1) return true;\n\n if (typeof this.props.isOptionSelected === 'function') {\n return this.props.isOptionSelected(option, selectValue);\n }\n\n var candidate = this.getOptionValue(option);\n return selectValue.some(function (i) {\n return _this2.getOptionValue(i) === candidate;\n });\n }\n }, {\n key: 'filterOption',\n value: function filterOption(option, inputValue) {\n return this.props.filterOption ? this.props.filterOption(option, inputValue) : true;\n }\n }, {\n key: 'formatOptionLabel',\n value: function formatOptionLabel(data, context) {\n if (typeof this.props.formatOptionLabel === 'function') {\n var _inputValue = this.props.inputValue;\n var _selectValue2 = this.state.selectValue;\n return this.props.formatOptionLabel(data, {\n context: context,\n inputValue: _inputValue,\n selectValue: _selectValue2\n });\n } else {\n return this.getOptionLabel(data);\n }\n }\n }, {\n key: 'formatGroupLabel',\n value: function formatGroupLabel(data) {\n return this.props.formatGroupLabel(data);\n } // ==============================\n // Mouse Handlers\n // ==============================\n\n }, {\n key: 'startListeningComposition',\n // ==============================\n // Composition Handlers\n // ==============================\n value: function startListeningComposition() {\n if (document && document.addEventListener) {\n document.addEventListener('compositionstart', this.onCompositionStart, false);\n document.addEventListener('compositionend', this.onCompositionEnd, false);\n }\n }\n }, {\n key: 'stopListeningComposition',\n value: function stopListeningComposition() {\n if (document && document.removeEventListener) {\n document.removeEventListener('compositionstart', this.onCompositionStart);\n document.removeEventListener('compositionend', this.onCompositionEnd);\n }\n }\n }, {\n key: 'startListeningToTouch',\n // ==============================\n // Touch Handlers\n // ==============================\n value: function startListeningToTouch() {\n if (document && document.addEventListener) {\n document.addEventListener('touchstart', this.onTouchStart, false);\n document.addEventListener('touchmove', this.onTouchMove, false);\n document.addEventListener('touchend', this.onTouchEnd, false);\n }\n }\n }, {\n key: 'stopListeningToTouch',\n value: function stopListeningToTouch() {\n if (document && document.removeEventListener) {\n document.removeEventListener('touchstart', this.onTouchStart);\n document.removeEventListener('touchmove', this.onTouchMove);\n document.removeEventListener('touchend', this.onTouchEnd);\n }\n } // ==============================\n // Focus Handlers\n // ==============================\n // ==============================\n // Keyboard Handlers\n // ==============================\n\n }, {\n key: 'buildMenuOptions',\n // ==============================\n // Menu Options\n // ==============================\n value: function buildMenuOptions(props, selectValue) {\n var _this3 = this;\n\n var _props$inputValue = props.inputValue,\n inputValue = _props$inputValue === undefined ? '' : _props$inputValue,\n options = props.options;\n\n var toOption = function toOption(option, id) {\n var isDisabled = _this3.isOptionDisabled(option, selectValue);\n\n var isSelected = _this3.isOptionSelected(option, selectValue);\n\n var label = _this3.getOptionLabel(option);\n\n var value = _this3.getOptionValue(option);\n\n if (_this3.shouldHideSelectedOptions() && isSelected || !_this3.filterOption({\n label: label,\n value: value,\n data: option\n }, inputValue)) {\n return;\n }\n\n var onHover = isDisabled ? undefined : function () {\n return _this3.onOptionHover(option);\n };\n var onSelect = isDisabled ? undefined : function () {\n return _this3.selectOption(option);\n };\n var optionId = _this3.getElementId('option') + '-' + id;\n return {\n innerProps: {\n id: optionId,\n onClick: onSelect,\n onMouseMove: onHover,\n onMouseOver: onHover,\n role: 'option',\n tabIndex: -1\n },\n data: option,\n isDisabled: isDisabled,\n isSelected: isSelected,\n key: optionId,\n label: label,\n type: 'option',\n value: value\n };\n };\n\n return options.reduce(function (acc, item, itemIndex) {\n if (item.options) {\n // TODO needs a tidier implementation\n if (!_this3.hasGroups) _this3.hasGroups = true;\n var items = item.options;\n var children = items.map(function (child, i) {\n var option = toOption(child, itemIndex + '-' + i);\n if (option && !option.isDisabled) acc.focusable.push(child);\n return option;\n }).filter(Boolean);\n\n if (children.length) {\n var groupId = _this3.getElementId('group') + '-' + itemIndex;\n acc.render.push({\n type: 'group',\n key: groupId,\n data: item,\n options: children\n });\n }\n } else {\n var option = toOption(item, '' + itemIndex);\n\n if (option) {\n acc.render.push(option);\n if (!option.isDisabled) acc.focusable.push(item);\n }\n }\n\n return acc;\n }, {\n render: [],\n focusable: []\n });\n } // ==============================\n // Renderers\n // ==============================\n\n }, {\n key: 'constructAriaLiveMessage',\n value: function constructAriaLiveMessage() {\n var _state5 = this.state,\n ariaLiveContext = _state5.ariaLiveContext,\n selectValue = _state5.selectValue,\n focusedValue = _state5.focusedValue,\n focusedOption = _state5.focusedOption;\n var _props6 = this.props,\n options = _props6.options,\n menuIsOpen = _props6.menuIsOpen,\n inputValue = _props6.inputValue,\n screenReaderStatus = _props6.screenReaderStatus; // An aria live message representing the currently focused value in the select.\n\n var focusedValueMsg = focusedValue ? (0, _index2.valueFocusAriaMessage)({\n focusedValue: focusedValue,\n getOptionLabel: this.getOptionLabel,\n selectValue: selectValue\n }) : ''; // An aria live message representing the currently focused option in the select.\n\n var focusedOptionMsg = focusedOption && menuIsOpen ? (0, _index2.optionFocusAriaMessage)({\n focusedOption: focusedOption,\n getOptionLabel: this.getOptionLabel,\n options: options\n }) : ''; // An aria live message representing the set of focusable results and current searchterm/inputvalue.\n\n var resultsMsg = (0, _index2.resultsAriaMessage)({\n inputValue: inputValue,\n screenReaderMessage: screenReaderStatus({\n count: this.countOptions()\n })\n });\n return focusedValueMsg + ' ' + focusedOptionMsg + ' ' + resultsMsg + ' ' + ariaLiveContext;\n }\n }, {\n key: 'renderInput',\n value: function renderInput() {\n var _props7 = this.props,\n isDisabled = _props7.isDisabled,\n isSearchable = _props7.isSearchable,\n inputId = _props7.inputId,\n inputValue = _props7.inputValue,\n tabIndex = _props7.tabIndex;\n var Input = this.components.Input;\n var inputIsHidden = this.state.inputIsHidden;\n var id = inputId || this.getElementId('input');\n\n if (!isSearchable) {\n // use a dummy input to maintain focus/blur functionality\n return _react2.default.createElement(_index.DummyInput, {\n id: id,\n innerRef: this.getInputRef,\n onBlur: this.onInputBlur,\n onChange: _utils.noop,\n onFocus: this.onInputFocus,\n readOnly: true,\n disabled: isDisabled,\n tabIndex: tabIndex,\n value: '',\n emotion: this.emotion\n });\n } // aria attributes makes the JSX \"noisy\", separated for clarity\n\n\n var ariaAttributes = {\n 'aria-autocomplete': 'list',\n 'aria-label': this.props['aria-label'],\n 'aria-labelledby': this.props['aria-labelledby']\n };\n var _commonProps = this.commonProps,\n cx = _commonProps.cx,\n theme = _commonProps.theme,\n selectProps = _commonProps.selectProps;\n return _react2.default.createElement(Input, _extends({\n autoCapitalize: 'none',\n autoComplete: 'off',\n autoCorrect: 'off',\n cx: cx,\n getStyles: this.getStyles,\n id: id,\n innerRef: this.getInputRef,\n isDisabled: isDisabled,\n isHidden: inputIsHidden,\n onBlur: this.onInputBlur,\n onChange: this.handleInputChange,\n onFocus: this.onInputFocus,\n selectProps: selectProps,\n spellCheck: 'false',\n tabIndex: tabIndex,\n theme: theme,\n type: 'text',\n value: inputValue,\n emotion: this.emotion\n }, ariaAttributes));\n }\n }, {\n key: 'renderPlaceholderOrValue',\n value: function renderPlaceholderOrValue() {\n var _this4 = this;\n\n var _components = this.components,\n MultiValue = _components.MultiValue,\n MultiValueContainer = _components.MultiValueContainer,\n MultiValueLabel = _components.MultiValueLabel,\n MultiValueRemove = _components.MultiValueRemove,\n SingleValue = _components.SingleValue,\n Placeholder = _components.Placeholder;\n var commonProps = this.commonProps;\n var _props8 = this.props,\n controlShouldRenderValue = _props8.controlShouldRenderValue,\n isDisabled = _props8.isDisabled,\n isMulti = _props8.isMulti,\n inputValue = _props8.inputValue,\n placeholder = _props8.placeholder;\n var _state6 = this.state,\n selectValue = _state6.selectValue,\n focusedValue = _state6.focusedValue,\n isFocused = _state6.isFocused;\n\n if (!this.hasValue() || !controlShouldRenderValue) {\n return inputValue ? null : _react2.default.createElement(Placeholder, _extends({}, commonProps, {\n key: 'placeholder',\n isDisabled: isDisabled,\n isFocused: isFocused\n }), placeholder);\n }\n\n if (isMulti) {\n var selectValues = selectValue.map(function (opt) {\n var isFocused = opt === focusedValue;\n return _react2.default.createElement(MultiValue, _extends({}, commonProps, {\n components: {\n Container: MultiValueContainer,\n Label: MultiValueLabel,\n Remove: MultiValueRemove\n },\n isFocused: isFocused,\n isDisabled: isDisabled,\n key: _this4.getOptionValue(opt),\n removeProps: {\n onClick: function onClick() {\n return _this4.removeValue(opt);\n },\n onTouchEnd: function onTouchEnd() {\n return _this4.removeValue(opt);\n },\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n },\n data: opt\n }), _this4.formatOptionLabel(opt, 'value'));\n });\n return selectValues;\n }\n\n if (inputValue) {\n return null;\n }\n\n var singleValue = selectValue[0];\n return _react2.default.createElement(SingleValue, _extends({}, commonProps, {\n data: singleValue,\n isDisabled: isDisabled\n }), this.formatOptionLabel(singleValue, 'value'));\n }\n }, {\n key: 'renderClearIndicator',\n value: function renderClearIndicator() {\n var ClearIndicator = this.components.ClearIndicator;\n var commonProps = this.commonProps;\n var _props9 = this.props,\n isDisabled = _props9.isDisabled,\n isLoading = _props9.isLoading;\n var isFocused = this.state.isFocused;\n\n if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) {\n return null;\n }\n\n var innerProps = {\n onMouseDown: this.onClearIndicatorMouseDown,\n onTouchEnd: this.onClearIndicatorTouchEnd,\n 'aria-hidden': 'true'\n };\n return _react2.default.createElement(ClearIndicator, _extends({}, commonProps, {\n innerProps: innerProps,\n isFocused: isFocused\n }));\n }\n }, {\n key: 'renderLoadingIndicator',\n value: function renderLoadingIndicator() {\n var LoadingIndicator = this.components.LoadingIndicator;\n var commonProps = this.commonProps;\n var _props10 = this.props,\n isDisabled = _props10.isDisabled,\n isLoading = _props10.isLoading;\n var isFocused = this.state.isFocused;\n if (!LoadingIndicator || !isLoading) return null;\n var innerProps = {\n 'aria-hidden': 'true'\n };\n return _react2.default.createElement(LoadingIndicator, _extends({}, commonProps, {\n innerProps: innerProps,\n isDisabled: isDisabled,\n isFocused: isFocused\n }));\n }\n }, {\n key: 'renderIndicatorSeparator',\n value: function renderIndicatorSeparator() {\n var _components2 = this.components,\n DropdownIndicator = _components2.DropdownIndicator,\n IndicatorSeparator = _components2.IndicatorSeparator; // separator doesn't make sense without the dropdown indicator\n\n if (!DropdownIndicator || !IndicatorSeparator) return null;\n var commonProps = this.commonProps;\n var isDisabled = this.props.isDisabled;\n var isFocused = this.state.isFocused;\n return _react2.default.createElement(IndicatorSeparator, _extends({}, commonProps, {\n isDisabled: isDisabled,\n isFocused: isFocused\n }));\n }\n }, {\n key: 'renderDropdownIndicator',\n value: function renderDropdownIndicator() {\n var DropdownIndicator = this.components.DropdownIndicator;\n if (!DropdownIndicator) return null;\n var commonProps = this.commonProps;\n var isDisabled = this.props.isDisabled;\n var isFocused = this.state.isFocused;\n var innerProps = {\n onMouseDown: this.onDropdownIndicatorMouseDown,\n onTouchEnd: this.onDropdownIndicatorTouchEnd,\n 'aria-hidden': 'true'\n };\n return _react2.default.createElement(DropdownIndicator, _extends({}, commonProps, {\n innerProps: innerProps,\n isDisabled: isDisabled,\n isFocused: isFocused\n }));\n }\n }, {\n key: 'renderMenu',\n value: function renderMenu() {\n var _this5 = this;\n\n var _components3 = this.components,\n Group = _components3.Group,\n GroupHeading = _components3.GroupHeading,\n Menu = _components3.Menu,\n MenuList = _components3.MenuList,\n MenuPortal = _components3.MenuPortal,\n LoadingMessage = _components3.LoadingMessage,\n NoOptionsMessage = _components3.NoOptionsMessage,\n Option = _components3.Option;\n var commonProps = this.commonProps;\n var _state7 = this.state,\n focusedOption = _state7.focusedOption,\n menuOptions = _state7.menuOptions;\n var _props11 = this.props,\n captureMenuScroll = _props11.captureMenuScroll,\n inputValue = _props11.inputValue,\n isLoading = _props11.isLoading,\n loadingMessage = _props11.loadingMessage,\n minMenuHeight = _props11.minMenuHeight,\n maxMenuHeight = _props11.maxMenuHeight,\n menuIsOpen = _props11.menuIsOpen,\n menuPlacement = _props11.menuPlacement,\n menuPosition = _props11.menuPosition,\n menuPortalTarget = _props11.menuPortalTarget,\n menuShouldBlockScroll = _props11.menuShouldBlockScroll,\n menuShouldScrollIntoView = _props11.menuShouldScrollIntoView,\n noOptionsMessage = _props11.noOptionsMessage,\n onMenuScrollToTop = _props11.onMenuScrollToTop,\n onMenuScrollToBottom = _props11.onMenuScrollToBottom;\n if (!menuIsOpen) return null; // TODO: Internal Option Type here\n\n var render = function render(props) {\n // for performance, the menu options in state aren't changed when the\n // focused option changes so we calculate additional props based on that\n var isFocused = focusedOption === props.data;\n props.innerRef = isFocused ? _this5.getFocusedOptionRef : undefined;\n return _react2.default.createElement(Option, _extends({}, commonProps, props, {\n isFocused: isFocused\n }), _this5.formatOptionLabel(props.data, 'menu'));\n };\n\n var menuUI = void 0;\n\n if (this.hasOptions()) {\n menuUI = menuOptions.render.map(function (item) {\n if (item.type === 'group') {\n var type = item.type,\n group = _objectWithoutProperties(item, ['type']);\n\n var headingId = item.key + '-heading';\n return _react2.default.createElement(Group, _extends({}, commonProps, group, {\n Heading: GroupHeading,\n headingProps: {\n id: headingId\n },\n label: _this5.formatGroupLabel(item.data)\n }), item.options.map(function (option) {\n return render(option);\n }));\n } else if (item.type === 'option') {\n return render(item);\n }\n });\n } else if (isLoading) {\n var message = loadingMessage({\n inputValue: inputValue\n });\n if (message === null) return null;\n menuUI = _react2.default.createElement(LoadingMessage, commonProps, message);\n } else {\n var _message = noOptionsMessage({\n inputValue: inputValue\n });\n\n if (_message === null) return null;\n menuUI = _react2.default.createElement(NoOptionsMessage, commonProps, _message);\n }\n\n var menuPlacementProps = {\n minMenuHeight: minMenuHeight,\n maxMenuHeight: maxMenuHeight,\n menuPlacement: menuPlacement,\n menuPosition: menuPosition,\n menuShouldScrollIntoView: menuShouldScrollIntoView\n };\n\n var menuElement = _react2.default.createElement(_Menu.MenuPlacer, _extends({}, commonProps, menuPlacementProps), function (_ref2) {\n var ref = _ref2.ref,\n _ref2$placerProps = _ref2.placerProps,\n placement = _ref2$placerProps.placement,\n maxHeight = _ref2$placerProps.maxHeight;\n return _react2.default.createElement(Menu, _extends({}, commonProps, menuPlacementProps, {\n innerRef: ref,\n innerProps: {\n onMouseDown: _this5.onMenuMouseDown,\n onMouseMove: _this5.onMenuMouseMove\n },\n isLoading: isLoading,\n placement: placement\n }), _react2.default.createElement(_index.ScrollCaptor, {\n isEnabled: captureMenuScroll,\n onTopArrive: onMenuScrollToTop,\n onBottomArrive: onMenuScrollToBottom\n }, _react2.default.createElement(_index.ScrollBlock, {\n emotion: _this5.emotion,\n isEnabled: menuShouldBlockScroll\n }, _react2.default.createElement(MenuList, _extends({}, commonProps, {\n innerRef: _this5.getMenuListRef,\n isLoading: isLoading,\n maxHeight: maxHeight\n }), menuUI))));\n }); // positioning behaviour is almost identical for portalled and fixed,\n // so we use the same component. the actual portalling logic is forked\n // within the component based on `menuPosition`\n\n\n return menuPortalTarget || menuPosition === 'fixed' ? _react2.default.createElement(MenuPortal, _extends({}, commonProps, {\n appendTo: menuPortalTarget,\n controlElement: this.controlRef,\n menuPlacement: menuPlacement,\n menuPosition: menuPosition\n }), menuElement) : menuElement;\n }\n }, {\n key: 'renderFormField',\n value: function renderFormField() {\n var _this6 = this;\n\n var _props12 = this.props,\n delimiter = _props12.delimiter,\n isDisabled = _props12.isDisabled,\n isMulti = _props12.isMulti,\n name = _props12.name;\n var selectValue = this.state.selectValue;\n if (!name || isDisabled) return;\n\n if (isMulti) {\n if (delimiter) {\n var _value = selectValue.map(function (opt) {\n return _this6.getOptionValue(opt);\n }).join(delimiter);\n\n return _react2.default.createElement('input', {\n name: name,\n type: 'hidden',\n value: _value\n });\n } else {\n var input = selectValue.length > 0 ? selectValue.map(function (opt, i) {\n return _react2.default.createElement('input', {\n key: 'i-' + i,\n name: name,\n type: 'hidden',\n value: _this6.getOptionValue(opt)\n });\n }) : _react2.default.createElement('input', {\n name: name,\n type: 'hidden'\n });\n return _react2.default.createElement('div', null, input);\n }\n } else {\n var _value2 = selectValue[0] ? this.getOptionValue(selectValue[0]) : '';\n\n return _react2.default.createElement('input', {\n name: name,\n type: 'hidden',\n value: _value2\n });\n }\n }\n }, {\n key: 'renderLiveRegion',\n value: function renderLiveRegion() {\n if (!this.state.isFocused) return null;\n return _react2.default.createElement(_index.A11yText, {\n emotion: this.emotion,\n 'aria-live': 'assertive'\n }, _react2.default.createElement('p', {\n id: 'aria-selection-event'\n }, '\\xA0', this.state.ariaLiveSelection), _react2.default.createElement('p', {\n id: 'aria-context'\n }, '\\xA0', this.constructAriaLiveMessage()));\n }\n }, {\n key: 'render',\n value: function render() {\n var _components4 = this.components,\n Control = _components4.Control,\n IndicatorsContainer = _components4.IndicatorsContainer,\n SelectContainer = _components4.SelectContainer,\n ValueContainer = _components4.ValueContainer;\n var _props13 = this.props,\n className = _props13.className,\n id = _props13.id,\n isDisabled = _props13.isDisabled;\n var isFocused = this.state.isFocused;\n var commonProps = this.commonProps = this.getCommonProps();\n return _react2.default.createElement(SelectContainer, _extends({}, commonProps, {\n className: className,\n innerProps: {\n id: id,\n onKeyDown: this.onKeyDown\n },\n isDisabled: isDisabled,\n isFocused: isFocused\n }), this.renderLiveRegion(), _react2.default.createElement(Control, _extends({}, commonProps, {\n innerRef: this.getControlRef,\n innerProps: {\n onMouseDown: this.onControlMouseDown,\n onTouchEnd: this.onControlTouchEnd\n },\n isDisabled: isDisabled,\n isFocused: isFocused\n }), _react2.default.createElement(ValueContainer, _extends({}, commonProps, {\n isDisabled: isDisabled\n }), this.renderPlaceholderOrValue(), this.renderInput()), _react2.default.createElement(IndicatorsContainer, _extends({}, commonProps, {\n isDisabled: isDisabled\n }), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());\n }\n }]);\n\n return Select;\n}(_react.Component);\n\nSelect.defaultProps = defaultProps;\n\nvar _initialiseProps = function _initialiseProps() {\n var _this7 = this;\n\n this.state = {\n ariaLiveSelection: '',\n ariaLiveContext: '',\n focusedOption: null,\n focusedValue: null,\n inputIsHidden: false,\n isFocused: false,\n isComposing: false,\n menuOptions: {\n render: [],\n focusable: []\n },\n selectValue: []\n };\n this.blockOptionHover = false;\n this.clearFocusValueOnUpdate = false;\n this.hasGroups = false;\n this.initialTouchX = 0;\n this.initialTouchY = 0;\n this.instancePrefix = '';\n this.openAfterFocus = false;\n this.scrollToFocusedOptionOnUpdate = false;\n this.controlRef = null;\n\n this.getControlRef = function (ref) {\n _this7.controlRef = ref;\n };\n\n this.focusedOptionRef = null;\n\n this.getFocusedOptionRef = function (ref) {\n _this7.focusedOptionRef = ref;\n };\n\n this.menuListRef = null;\n\n this.getMenuListRef = function (ref) {\n _this7.menuListRef = ref;\n };\n\n this.inputRef = null;\n\n this.getInputRef = function (ref) {\n _this7.inputRef = ref;\n };\n\n this.cacheComponents = function (components) {\n _this7.components = (0, _index3.defaultComponents)({\n components: components\n });\n };\n\n this.focus = this.focusInput;\n this.blur = this.blurInput;\n\n this.onChange = function (newValue, actionMeta) {\n var _props14 = _this7.props,\n onChange = _props14.onChange,\n name = _props14.name;\n onChange(newValue, _extends({}, actionMeta, {\n name: name\n }));\n };\n\n this.setValue = function (newValue) {\n var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'set-value';\n var option = arguments[2];\n var _props15 = _this7.props,\n closeMenuOnSelect = _props15.closeMenuOnSelect,\n isMulti = _props15.isMulti;\n\n _this7.onInputChange('', {\n action: 'set-value'\n });\n\n if (closeMenuOnSelect) {\n _this7.inputIsHiddenAfterUpdate = !isMulti;\n\n _this7.onMenuClose();\n } // when the select value should change, we should reset focusedValue\n\n\n _this7.clearFocusValueOnUpdate = true;\n\n _this7.onChange(newValue, {\n action: action,\n option: option\n });\n };\n\n this.selectOption = function (newValue) {\n var _props16 = _this7.props,\n blurInputOnSelect = _props16.blurInputOnSelect,\n isMulti = _props16.isMulti;\n\n if (isMulti) {\n var _selectValue3 = _this7.state.selectValue;\n\n if (_this7.isOptionSelected(newValue, _selectValue3)) {\n var candidate = _this7.getOptionValue(newValue);\n\n _this7.setValue(_selectValue3.filter(function (i) {\n return _this7.getOptionValue(i) !== candidate;\n }), 'deselect-option', newValue);\n\n _this7.announceAriaLiveSelection({\n event: 'deselect-option',\n context: {\n value: _this7.getOptionLabel(newValue)\n }\n });\n } else {\n _this7.setValue([].concat(_toConsumableArray(_selectValue3), [newValue]), 'select-option', newValue);\n\n _this7.announceAriaLiveSelection({\n event: 'select-option',\n context: {\n value: _this7.getOptionLabel(newValue)\n }\n });\n }\n } else {\n _this7.setValue(newValue, 'select-option');\n\n _this7.announceAriaLiveSelection({\n event: 'select-option',\n context: {\n value: _this7.getOptionLabel(newValue)\n }\n });\n }\n\n if (blurInputOnSelect) {\n _this7.blurInput();\n }\n };\n\n this.removeValue = function (removedValue) {\n var selectValue = _this7.state.selectValue;\n\n var candidate = _this7.getOptionValue(removedValue);\n\n _this7.onChange(selectValue.filter(function (i) {\n return _this7.getOptionValue(i) !== candidate;\n }), {\n action: 'remove-value',\n removedValue: removedValue\n });\n\n _this7.announceAriaLiveSelection({\n event: 'remove-value',\n context: {\n value: removedValue ? _this7.getOptionLabel(removedValue) : undefined\n }\n });\n\n _this7.focusInput();\n };\n\n this.clearValue = function () {\n var isMulti = _this7.props.isMulti;\n\n _this7.onChange(isMulti ? [] : null, {\n action: 'clear'\n });\n };\n\n this.popValue = function () {\n var selectValue = _this7.state.selectValue;\n var lastSelectedValue = selectValue[selectValue.length - 1];\n\n _this7.announceAriaLiveSelection({\n event: 'pop-value',\n context: {\n value: lastSelectedValue ? _this7.getOptionLabel(lastSelectedValue) : undefined\n }\n });\n\n _this7.onChange(selectValue.slice(0, selectValue.length - 1), {\n action: 'pop-value',\n removedValue: lastSelectedValue\n });\n };\n\n this.getOptionLabel = function (data) {\n return _this7.props.getOptionLabel(data);\n };\n\n this.getOptionValue = function (data) {\n return _this7.props.getOptionValue(data);\n };\n\n this.getStyles = function (key, props) {\n var base = _styles.defaultStyles[key](props);\n\n base.boxSizing = 'border-box';\n var custom = _this7.props.styles[key];\n return custom ? custom(base, props) : base;\n };\n\n this.getElementId = function (element) {\n return _this7.instancePrefix + '-' + element;\n };\n\n this.getActiveDescendentId = function () {\n var menuIsOpen = _this7.props.menuIsOpen;\n var _state8 = _this7.state,\n menuOptions = _state8.menuOptions,\n focusedOption = _state8.focusedOption;\n if (!focusedOption || !menuIsOpen) return undefined;\n var index = menuOptions.focusable.indexOf(focusedOption);\n var option = menuOptions.render[index];\n return option && option.key;\n };\n\n this.announceAriaLiveSelection = function (_ref3) {\n var event = _ref3.event,\n context = _ref3.context;\n\n _this7.setState({\n ariaLiveSelection: (0, _index2.valueEventAriaMessage)(event, context)\n });\n };\n\n this.announceAriaLiveContext = function (_ref4) {\n var event = _ref4.event,\n context = _ref4.context;\n\n _this7.setState({\n ariaLiveContext: (0, _index2.instructionsAriaMessage)(event, _extends({}, context, {\n label: _this7.props['aria-label']\n }))\n });\n };\n\n this.onMenuMouseDown = function (event) {\n if (event.button !== 0) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n\n _this7.focusInput();\n };\n\n this.onMenuMouseMove = function (event) {\n _this7.blockOptionHover = false;\n };\n\n this.onControlMouseDown = function (event) {\n var openMenuOnClick = _this7.props.openMenuOnClick;\n\n if (!_this7.state.isFocused) {\n if (openMenuOnClick) {\n _this7.openAfterFocus = true;\n }\n\n _this7.focusInput();\n } else if (!_this7.props.menuIsOpen) {\n _this7.openMenu('first');\n } else {\n // $FlowFixMe HTMLElement type does not have tagName property\n if (event.target.tagName !== 'INPUT') {\n _this7.onMenuClose();\n }\n } // $FlowFixMe HTMLElement type does not have tagName property\n\n\n if (event.target.tagName !== 'INPUT') {\n event.preventDefault();\n }\n };\n\n this.onDropdownIndicatorMouseDown = function (event) {\n // ignore mouse events that weren't triggered by the primary button\n if (event && event.type === 'mousedown' && event.button !== 0) {\n return;\n }\n\n if (_this7.props.isDisabled) return;\n var _props17 = _this7.props,\n isMulti = _props17.isMulti,\n menuIsOpen = _props17.menuIsOpen;\n\n _this7.focusInput();\n\n if (menuIsOpen) {\n _this7.inputIsHiddenAfterUpdate = !isMulti;\n\n _this7.onMenuClose();\n } else {\n _this7.openMenu('first');\n }\n\n event.preventDefault();\n event.stopPropagation();\n };\n\n this.onClearIndicatorMouseDown = function (event) {\n // ignore mouse events that weren't triggered by the primary button\n if (event && event.type === 'mousedown' && event.button !== 0) {\n return;\n }\n\n _this7.clearValue();\n\n event.stopPropagation();\n _this7.openAfterFocus = false;\n setTimeout(function () {\n return _this7.focusInput();\n });\n };\n\n this.onScroll = function (event) {\n if (typeof _this7.props.closeMenuOnScroll === 'boolean') {\n if (event.target instanceof HTMLElement && (0, _utils.isDocumentElement)(event.target)) {\n _this7.props.onMenuClose();\n }\n } else if (typeof _this7.props.closeMenuOnScroll === 'function') {\n if (_this7.props.closeMenuOnScroll(event)) {\n _this7.props.onMenuClose();\n }\n }\n };\n\n this.onCompositionStart = function () {\n _this7.setState({\n isComposing: true\n });\n };\n\n this.onCompositionEnd = function () {\n _this7.setState({\n isComposing: false\n });\n };\n\n this.onTouchStart = function (_ref5) {\n var touches = _ref5.touches;\n var touch = touches.item(0);\n\n if (!touch) {\n return;\n }\n\n _this7.initialTouchX = touch.clientX;\n _this7.initialTouchY = touch.clientY;\n _this7.userIsDragging = false;\n };\n\n this.onTouchMove = function (_ref6) {\n var touches = _ref6.touches;\n var touch = touches.item(0);\n\n if (!touch) {\n return;\n }\n\n var deltaX = Math.abs(touch.clientX - _this7.initialTouchX);\n var deltaY = Math.abs(touch.clientY - _this7.initialTouchY);\n var moveThreshold = 5;\n _this7.userIsDragging = deltaX > moveThreshold || deltaY > moveThreshold;\n };\n\n this.onTouchEnd = function (event) {\n if (_this7.userIsDragging) return; // type cast the EventTarget\n\n var target = event.target; // close the menu if the user taps outside\n\n if (_this7.controlRef && !_this7.controlRef.contains(target) && _this7.menuListRef && !_this7.menuListRef.contains(target)) {\n _this7.blurInput();\n } // reset move vars\n\n\n _this7.initialTouchX = 0;\n _this7.initialTouchY = 0;\n };\n\n this.onControlTouchEnd = function (event) {\n if (_this7.userIsDragging) return;\n\n _this7.onControlMouseDown(event);\n };\n\n this.onClearIndicatorTouchEnd = function (event) {\n if (_this7.userIsDragging) return;\n\n _this7.onClearIndicatorMouseDown(event);\n };\n\n this.onDropdownIndicatorTouchEnd = function (event) {\n if (_this7.userIsDragging) return;\n\n _this7.onDropdownIndicatorMouseDown(event);\n };\n\n this.handleInputChange = function (event) {\n var inputValue = event.currentTarget.value;\n _this7.inputIsHiddenAfterUpdate = false;\n\n _this7.onInputChange(inputValue, {\n action: 'input-change'\n });\n\n _this7.onMenuOpen();\n };\n\n this.onInputFocus = function (event) {\n var _props18 = _this7.props,\n isSearchable = _props18.isSearchable,\n isMulti = _props18.isMulti;\n\n if (_this7.props.onFocus) {\n _this7.props.onFocus(event);\n }\n\n _this7.inputIsHiddenAfterUpdate = false;\n\n _this7.announceAriaLiveContext({\n event: 'input',\n context: {\n isSearchable: isSearchable,\n isMulti: isMulti\n }\n });\n\n _this7.setState({\n isFocused: true\n });\n\n if (_this7.openAfterFocus || _this7.props.openMenuOnFocus) {\n _this7.openMenu('first');\n }\n\n _this7.openAfterFocus = false;\n };\n\n this.onInputBlur = function (event) {\n if (_this7.menuListRef && _this7.menuListRef.contains(document.activeElement)) {\n _this7.inputRef.focus();\n\n return;\n }\n\n if (_this7.props.onBlur) {\n _this7.props.onBlur(event);\n }\n\n _this7.onInputChange('', {\n action: 'input-blur'\n });\n\n _this7.onMenuClose();\n\n _this7.setState({\n focusedValue: null,\n isFocused: false\n });\n };\n\n this.onOptionHover = function (focusedOption) {\n if (_this7.blockOptionHover || _this7.state.focusedOption === focusedOption) {\n return;\n }\n\n _this7.setState({\n focusedOption: focusedOption\n });\n };\n\n this.shouldHideSelectedOptions = function () {\n var _props19 = _this7.props,\n hideSelectedOptions = _props19.hideSelectedOptions,\n isMulti = _props19.isMulti;\n if (hideSelectedOptions === undefined) return isMulti;\n return hideSelectedOptions;\n };\n\n this.onKeyDown = function (event) {\n var _props20 = _this7.props,\n isMulti = _props20.isMulti,\n backspaceRemovesValue = _props20.backspaceRemovesValue,\n escapeClearsValue = _props20.escapeClearsValue,\n inputValue = _props20.inputValue,\n isClearable = _props20.isClearable,\n isDisabled = _props20.isDisabled,\n menuIsOpen = _props20.menuIsOpen,\n onKeyDown = _props20.onKeyDown,\n tabSelectsValue = _props20.tabSelectsValue,\n openMenuOnFocus = _props20.openMenuOnFocus;\n var _state9 = _this7.state,\n isComposing = _state9.isComposing,\n focusedOption = _state9.focusedOption,\n focusedValue = _state9.focusedValue,\n selectValue = _state9.selectValue;\n if (isDisabled) return;\n\n if (typeof onKeyDown === 'function') {\n onKeyDown(event);\n\n if (event.defaultPrevented) {\n return;\n }\n } // Block option hover events when the user has just pressed a key\n\n\n _this7.blockOptionHover = true;\n\n switch (event.key) {\n case 'ArrowLeft':\n if (!isMulti || inputValue) return;\n\n _this7.focusValue('previous');\n\n break;\n\n case 'ArrowRight':\n if (!isMulti || inputValue) return;\n\n _this7.focusValue('next');\n\n break;\n\n case 'Delete':\n case 'Backspace':\n if (inputValue) return;\n\n if (focusedValue) {\n _this7.removeValue(focusedValue);\n } else {\n if (!backspaceRemovesValue) return;\n\n if (isMulti) {\n _this7.popValue();\n } else if (isClearable) {\n _this7.clearValue();\n }\n }\n\n break;\n\n case 'Tab':\n if (isComposing) return;\n\n if (event.shiftKey || !menuIsOpen || !tabSelectsValue || !focusedOption || // don't capture the event if the menu opens on focus and the focused\n // option is already selected; it breaks the flow of navigation\n openMenuOnFocus && _this7.isOptionSelected(focusedOption, selectValue)) {\n return;\n }\n\n _this7.selectOption(focusedOption);\n\n break;\n\n case 'Enter':\n if (menuIsOpen) {\n if (!focusedOption) return;\n if (isComposing) return;\n\n _this7.selectOption(focusedOption);\n } else {\n _this7.focusOption('first');\n }\n\n break;\n\n case 'Escape':\n if (menuIsOpen) {\n _this7.inputIsHiddenAfterUpdate = false;\n\n _this7.onInputChange('', {\n action: 'menu-close'\n });\n\n _this7.onMenuClose();\n } else if (isClearable && escapeClearsValue) {\n _this7.clearValue();\n }\n\n break;\n\n case ' ':\n // space\n if (inputValue) {\n return;\n }\n\n if (!menuIsOpen) {\n _this7.openMenu('first');\n\n break;\n }\n\n if (!focusedOption) return;\n\n _this7.selectOption(focusedOption);\n\n break;\n\n case 'ArrowUp':\n if (menuIsOpen) {\n _this7.focusOption('up');\n } else {\n _this7.openMenu('last');\n }\n\n break;\n\n case 'ArrowDown':\n if (menuIsOpen) {\n _this7.focusOption('down');\n } else {\n _this7.openMenu('first');\n }\n\n break;\n\n case 'PageUp':\n if (!menuIsOpen) return;\n\n _this7.focusOption('pageup');\n\n break;\n\n case 'PageDown':\n if (!menuIsOpen) return;\n\n _this7.focusOption('pagedown');\n\n break;\n\n case 'Home':\n if (!menuIsOpen) return;\n\n _this7.focusOption('first');\n\n break;\n\n case 'End':\n if (!menuIsOpen) return;\n\n _this7.focusOption('last');\n\n break;\n\n default:\n return;\n }\n\n event.preventDefault();\n };\n};\n\nexports.default = Select;","var simpleIsEqual = function simpleIsEqual(a, b) {\n return a === b;\n};\n\nfunction index(resultFn, isEqual) {\n if (isEqual === void 0) {\n isEqual = simpleIsEqual;\n }\n\n var lastThis;\n var lastArgs = [];\n var lastResult;\n var calledOnce = false;\n\n var isNewArgEqualToLast = function isNewArgEqualToLast(newArg, index) {\n return isEqual(newArg, lastArgs[index], index);\n };\n\n var result = function result() {\n for (var _len = arguments.length, newArgs = new Array(_len), _key = 0; _key < _len; _key++) {\n newArgs[_key] = arguments[_key];\n }\n\n if (calledOnce && lastThis === this && newArgs.length === lastArgs.length && newArgs.every(isNewArgEqualToLast)) {\n return lastResult;\n }\n\n lastResult = resultFn.apply(this, newArgs);\n calledOnce = true;\n lastThis = this;\n lastArgs = newArgs;\n return lastResult;\n };\n\n return result;\n}\n\nexport default index;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nexports.default = exportedEqual;\nvar isArray = Array.isArray;\nvar keyList = Object.keys;\nvar hasProp = Object.prototype.hasOwnProperty;\n\nfunction equal(a, b) {\n // fast-deep-equal index.js 2.0.1\n if (a === b) return true;\n\n if (a && b && (typeof a === 'undefined' ? 'undefined' : _typeof(a)) == 'object' && (typeof b === 'undefined' ? 'undefined' : _typeof(b)) == 'object') {\n var arrA = isArray(a),\n arrB = isArray(b),\n i,\n length,\n key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!equal(a[i], b[i])) return false;\n }\n\n return true;\n }\n\n if (arrA != arrB) return false;\n var dateA = a instanceof Date,\n dateB = b instanceof Date;\n if (dateA != dateB) return false;\n if (dateA && dateB) return a.getTime() == b.getTime();\n var regexpA = a instanceof RegExp,\n regexpB = b instanceof RegExp;\n if (regexpA != regexpB) return false;\n if (regexpA && regexpB) return a.toString() == b.toString();\n var keys = keyList(a);\n length = keys.length;\n\n if (length !== keyList(b).length) {\n return false;\n }\n\n for (i = length; i-- !== 0;) {\n if (!hasProp.call(b, keys[i])) return false;\n } // end fast-deep-equal\n // Custom handling for React\n\n\n for (i = length; i-- !== 0;) {\n key = keys[i];\n\n if (key === '_owner' && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner.\n // _owner contains circular references\n // and is not needed when comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of a react element\n continue;\n } else {\n // all other properties should be traversed as usual\n if (!equal(a[key], b[key])) return false;\n }\n } // fast-deep-equal index.js 2.0.1\n\n\n return true;\n }\n\n return a !== a && b !== b;\n} // end fast-deep-equal\n\n\nfunction exportedEqual(a, b) {\n try {\n return equal(a, b);\n } catch (error) {\n if (error.message && error.message.match(/stack|recursion/i)) {\n // warn on circular references, don't crash\n // browsers give this different errors name and messages:\n // chrome/safari: \"RangeError\", \"Maximum call stack size exceeded\"\n // firefox: \"InternalError\", too much recursion\"\n // edge: \"Error\", \"Out of stack space\"\n console.warn('Warning: react-fast-compare does not handle circular references.', error.name, error.message);\n return false;\n } // some other error. we should definitely know about these\n\n\n throw error;\n }\n}\n\n;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createFilter = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _diacritics = require('./diacritics');\n\nvar trimString = function trimString(str) {\n return str.replace(/^\\s+|\\s+$/g, '');\n};\n\nvar defaultStringify = function defaultStringify(option) {\n return option.label + ' ' + option.value;\n};\n\nvar createFilter = exports.createFilter = function createFilter(config) {\n return function (option, rawInput) {\n var _ignoreCase$ignoreAcc = _extends({\n ignoreCase: true,\n ignoreAccents: true,\n stringify: defaultStringify,\n trim: true,\n matchFrom: 'any'\n }, config),\n ignoreCase = _ignoreCase$ignoreAcc.ignoreCase,\n ignoreAccents = _ignoreCase$ignoreAcc.ignoreAccents,\n stringify = _ignoreCase$ignoreAcc.stringify,\n trim = _ignoreCase$ignoreAcc.trim,\n matchFrom = _ignoreCase$ignoreAcc.matchFrom;\n\n var input = trim ? trimString(rawInput) : rawInput;\n var candidate = trim ? trimString(stringify(option)) : stringify(option);\n\n if (ignoreCase) {\n input = input.toLowerCase();\n candidate = candidate.toLowerCase();\n }\n\n if (ignoreAccents) {\n input = (0, _diacritics.stripDiacritics)(input);\n candidate = (0, _diacritics.stripDiacritics)(candidate);\n }\n\n return matchFrom === 'start' ? candidate.substr(0, input.length) === input : candidate.indexOf(input) > -1;\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar diacritics = [{\n base: 'A',\n 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\n}, {\n base: 'AA',\n letters: /[\\uA732]/g\n}, {\n base: 'AE',\n letters: /[\\u00C6\\u01FC\\u01E2]/g\n}, {\n base: 'AO',\n letters: /[\\uA734]/g\n}, {\n base: 'AU',\n letters: /[\\uA736]/g\n}, {\n base: 'AV',\n letters: /[\\uA738\\uA73A]/g\n}, {\n base: 'AY',\n letters: /[\\uA73C]/g\n}, {\n base: 'B',\n letters: /[\\u0042\\u24B7\\uFF22\\u1E02\\u1E04\\u1E06\\u0243\\u0182\\u0181]/g\n}, {\n base: 'C',\n letters: /[\\u0043\\u24B8\\uFF23\\u0106\\u0108\\u010A\\u010C\\u00C7\\u1E08\\u0187\\u023B\\uA73E]/g\n}, {\n base: 'D',\n letters: /[\\u0044\\u24B9\\uFF24\\u1E0A\\u010E\\u1E0C\\u1E10\\u1E12\\u1E0E\\u0110\\u018B\\u018A\\u0189\\uA779]/g\n}, {\n base: 'DZ',\n letters: /[\\u01F1\\u01C4]/g\n}, {\n base: 'Dz',\n letters: /[\\u01F2\\u01C5]/g\n}, {\n base: 'E',\n 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\n}, {\n base: 'F',\n letters: /[\\u0046\\u24BB\\uFF26\\u1E1E\\u0191\\uA77B]/g\n}, {\n base: 'G',\n letters: /[\\u0047\\u24BC\\uFF27\\u01F4\\u011C\\u1E20\\u011E\\u0120\\u01E6\\u0122\\u01E4\\u0193\\uA7A0\\uA77D\\uA77E]/g\n}, {\n base: 'H',\n letters: /[\\u0048\\u24BD\\uFF28\\u0124\\u1E22\\u1E26\\u021E\\u1E24\\u1E28\\u1E2A\\u0126\\u2C67\\u2C75\\uA78D]/g\n}, {\n base: 'I',\n letters: /[\\u0049\\u24BE\\uFF29\\u00CC\\u00CD\\u00CE\\u0128\\u012A\\u012C\\u0130\\u00CF\\u1E2E\\u1EC8\\u01CF\\u0208\\u020A\\u1ECA\\u012E\\u1E2C\\u0197]/g\n}, {\n base: 'J',\n letters: /[\\u004A\\u24BF\\uFF2A\\u0134\\u0248]/g\n}, {\n base: 'K',\n letters: /[\\u004B\\u24C0\\uFF2B\\u1E30\\u01E8\\u1E32\\u0136\\u1E34\\u0198\\u2C69\\uA740\\uA742\\uA744\\uA7A2]/g\n}, {\n base: 'L',\n letters: /[\\u004C\\u24C1\\uFF2C\\u013F\\u0139\\u013D\\u1E36\\u1E38\\u013B\\u1E3C\\u1E3A\\u0141\\u023D\\u2C62\\u2C60\\uA748\\uA746\\uA780]/g\n}, {\n base: 'LJ',\n letters: /[\\u01C7]/g\n}, {\n base: 'Lj',\n letters: /[\\u01C8]/g\n}, {\n base: 'M',\n letters: /[\\u004D\\u24C2\\uFF2D\\u1E3E\\u1E40\\u1E42\\u2C6E\\u019C]/g\n}, {\n base: 'N',\n letters: /[\\u004E\\u24C3\\uFF2E\\u01F8\\u0143\\u00D1\\u1E44\\u0147\\u1E46\\u0145\\u1E4A\\u1E48\\u0220\\u019D\\uA790\\uA7A4]/g\n}, {\n base: 'NJ',\n letters: /[\\u01CA]/g\n}, {\n base: 'Nj',\n letters: /[\\u01CB]/g\n}, {\n base: 'O',\n 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\n}, {\n base: 'OI',\n letters: /[\\u01A2]/g\n}, {\n base: 'OO',\n letters: /[\\uA74E]/g\n}, {\n base: 'OU',\n letters: /[\\u0222]/g\n}, {\n base: 'P',\n letters: /[\\u0050\\u24C5\\uFF30\\u1E54\\u1E56\\u01A4\\u2C63\\uA750\\uA752\\uA754]/g\n}, {\n base: 'Q',\n letters: /[\\u0051\\u24C6\\uFF31\\uA756\\uA758\\u024A]/g\n}, {\n base: 'R',\n letters: /[\\u0052\\u24C7\\uFF32\\u0154\\u1E58\\u0158\\u0210\\u0212\\u1E5A\\u1E5C\\u0156\\u1E5E\\u024C\\u2C64\\uA75A\\uA7A6\\uA782]/g\n}, {\n base: 'S',\n letters: /[\\u0053\\u24C8\\uFF33\\u1E9E\\u015A\\u1E64\\u015C\\u1E60\\u0160\\u1E66\\u1E62\\u1E68\\u0218\\u015E\\u2C7E\\uA7A8\\uA784]/g\n}, {\n base: 'T',\n letters: /[\\u0054\\u24C9\\uFF34\\u1E6A\\u0164\\u1E6C\\u021A\\u0162\\u1E70\\u1E6E\\u0166\\u01AC\\u01AE\\u023E\\uA786]/g\n}, {\n base: 'TZ',\n letters: /[\\uA728]/g\n}, {\n base: 'U',\n 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\n}, {\n base: 'V',\n letters: /[\\u0056\\u24CB\\uFF36\\u1E7C\\u1E7E\\u01B2\\uA75E\\u0245]/g\n}, {\n base: 'VY',\n letters: /[\\uA760]/g\n}, {\n base: 'W',\n letters: /[\\u0057\\u24CC\\uFF37\\u1E80\\u1E82\\u0174\\u1E86\\u1E84\\u1E88\\u2C72]/g\n}, {\n base: 'X',\n letters: /[\\u0058\\u24CD\\uFF38\\u1E8A\\u1E8C]/g\n}, {\n base: 'Y',\n letters: /[\\u0059\\u24CE\\uFF39\\u1EF2\\u00DD\\u0176\\u1EF8\\u0232\\u1E8E\\u0178\\u1EF6\\u1EF4\\u01B3\\u024E\\u1EFE]/g\n}, {\n base: 'Z',\n letters: /[\\u005A\\u24CF\\uFF3A\\u0179\\u1E90\\u017B\\u017D\\u1E92\\u1E94\\u01B5\\u0224\\u2C7F\\u2C6B\\uA762]/g\n}, {\n base: 'a',\n 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\n}, {\n base: 'aa',\n letters: /[\\uA733]/g\n}, {\n base: 'ae',\n letters: /[\\u00E6\\u01FD\\u01E3]/g\n}, {\n base: 'ao',\n letters: /[\\uA735]/g\n}, {\n base: 'au',\n letters: /[\\uA737]/g\n}, {\n base: 'av',\n letters: /[\\uA739\\uA73B]/g\n}, {\n base: 'ay',\n letters: /[\\uA73D]/g\n}, {\n base: 'b',\n letters: /[\\u0062\\u24D1\\uFF42\\u1E03\\u1E05\\u1E07\\u0180\\u0183\\u0253]/g\n}, {\n base: 'c',\n letters: /[\\u0063\\u24D2\\uFF43\\u0107\\u0109\\u010B\\u010D\\u00E7\\u1E09\\u0188\\u023C\\uA73F\\u2184]/g\n}, {\n base: 'd',\n letters: /[\\u0064\\u24D3\\uFF44\\u1E0B\\u010F\\u1E0D\\u1E11\\u1E13\\u1E0F\\u0111\\u018C\\u0256\\u0257\\uA77A]/g\n}, {\n base: 'dz',\n letters: /[\\u01F3\\u01C6]/g\n}, {\n base: 'e',\n 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\n}, {\n base: 'f',\n letters: /[\\u0066\\u24D5\\uFF46\\u1E1F\\u0192\\uA77C]/g\n}, {\n base: 'g',\n letters: /[\\u0067\\u24D6\\uFF47\\u01F5\\u011D\\u1E21\\u011F\\u0121\\u01E7\\u0123\\u01E5\\u0260\\uA7A1\\u1D79\\uA77F]/g\n}, {\n base: 'h',\n letters: /[\\u0068\\u24D7\\uFF48\\u0125\\u1E23\\u1E27\\u021F\\u1E25\\u1E29\\u1E2B\\u1E96\\u0127\\u2C68\\u2C76\\u0265]/g\n}, {\n base: 'hv',\n letters: /[\\u0195]/g\n}, {\n base: 'i',\n letters: /[\\u0069\\u24D8\\uFF49\\u00EC\\u00ED\\u00EE\\u0129\\u012B\\u012D\\u00EF\\u1E2F\\u1EC9\\u01D0\\u0209\\u020B\\u1ECB\\u012F\\u1E2D\\u0268\\u0131]/g\n}, {\n base: 'j',\n letters: /[\\u006A\\u24D9\\uFF4A\\u0135\\u01F0\\u0249]/g\n}, {\n base: 'k',\n letters: /[\\u006B\\u24DA\\uFF4B\\u1E31\\u01E9\\u1E33\\u0137\\u1E35\\u0199\\u2C6A\\uA741\\uA743\\uA745\\uA7A3]/g\n}, {\n base: 'l',\n letters: /[\\u006C\\u24DB\\uFF4C\\u0140\\u013A\\u013E\\u1E37\\u1E39\\u013C\\u1E3D\\u1E3B\\u017F\\u0142\\u019A\\u026B\\u2C61\\uA749\\uA781\\uA747]/g\n}, {\n base: 'lj',\n letters: /[\\u01C9]/g\n}, {\n base: 'm',\n letters: /[\\u006D\\u24DC\\uFF4D\\u1E3F\\u1E41\\u1E43\\u0271\\u026F]/g\n}, {\n base: 'n',\n letters: /[\\u006E\\u24DD\\uFF4E\\u01F9\\u0144\\u00F1\\u1E45\\u0148\\u1E47\\u0146\\u1E4B\\u1E49\\u019E\\u0272\\u0149\\uA791\\uA7A5]/g\n}, {\n base: 'nj',\n letters: /[\\u01CC]/g\n}, {\n base: 'o',\n 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\n}, {\n base: 'oi',\n letters: /[\\u01A3]/g\n}, {\n base: 'ou',\n letters: /[\\u0223]/g\n}, {\n base: 'oo',\n letters: /[\\uA74F]/g\n}, {\n base: 'p',\n letters: /[\\u0070\\u24DF\\uFF50\\u1E55\\u1E57\\u01A5\\u1D7D\\uA751\\uA753\\uA755]/g\n}, {\n base: 'q',\n letters: /[\\u0071\\u24E0\\uFF51\\u024B\\uA757\\uA759]/g\n}, {\n base: 'r',\n letters: /[\\u0072\\u24E1\\uFF52\\u0155\\u1E59\\u0159\\u0211\\u0213\\u1E5B\\u1E5D\\u0157\\u1E5F\\u024D\\u027D\\uA75B\\uA7A7\\uA783]/g\n}, {\n base: 's',\n letters: /[\\u0073\\u24E2\\uFF53\\u00DF\\u015B\\u1E65\\u015D\\u1E61\\u0161\\u1E67\\u1E63\\u1E69\\u0219\\u015F\\u023F\\uA7A9\\uA785\\u1E9B]/g\n}, {\n base: 't',\n letters: /[\\u0074\\u24E3\\uFF54\\u1E6B\\u1E97\\u0165\\u1E6D\\u021B\\u0163\\u1E71\\u1E6F\\u0167\\u01AD\\u0288\\u2C66\\uA787]/g\n}, {\n base: 'tz',\n letters: /[\\uA729]/g\n}, {\n base: 'u',\n 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\n}, {\n base: 'v',\n letters: /[\\u0076\\u24E5\\uFF56\\u1E7D\\u1E7F\\u028B\\uA75F\\u028C]/g\n}, {\n base: 'vy',\n letters: /[\\uA761]/g\n}, {\n base: 'w',\n letters: /[\\u0077\\u24E6\\uFF57\\u1E81\\u1E83\\u0175\\u1E87\\u1E85\\u1E98\\u1E89\\u2C73]/g\n}, {\n base: 'x',\n letters: /[\\u0078\\u24E7\\uFF58\\u1E8B\\u1E8D]/g\n}, {\n base: 'y',\n letters: /[\\u0079\\u24E8\\uFF59\\u1EF3\\u00FD\\u0177\\u1EF9\\u0233\\u1E8F\\u00FF\\u1EF7\\u1E99\\u1EF5\\u01B4\\u024F\\u1EFF]/g\n}, {\n base: 'z',\n letters: /[\\u007A\\u24E9\\uFF5A\\u017A\\u1E91\\u017C\\u017E\\u1E93\\u1E95\\u01B6\\u0225\\u0240\\u2C6C\\uA763]/g\n}];\n\nvar stripDiacritics = exports.stripDiacritics = function stripDiacritics(str) {\n for (var i = 0; i < diacritics.length; i++) {\n str = str.replace(diacritics[i].letters, diacritics[i].base);\n }\n\n return str;\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _A11yText = require('./A11yText');\n\nObject.defineProperty(exports, 'A11yText', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_A11yText).default;\n }\n});\n\nvar _DummyInput = require('./DummyInput');\n\nObject.defineProperty(exports, 'DummyInput', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_DummyInput).default;\n }\n});\n\nvar _NodeResolver = require('./NodeResolver');\n\nObject.defineProperty(exports, 'NodeResolver', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_NodeResolver).default;\n }\n});\n\nvar _ScrollBlock = require('./ScrollBlock');\n\nObject.defineProperty(exports, 'ScrollBlock', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ScrollBlock).default;\n }\n});\n\nvar _ScrollCaptor = require('./ScrollCaptor');\n\nObject.defineProperty(exports, 'ScrollCaptor', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ScrollCaptor).default;\n }\n});\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n} // Assistive text to describe visual elements. Hidden for sighted users.\n\n\nvar A11yText = function A11yText(props) {\n return _react2.default.createElement('span', _extends({\n className: props.emotion.css({\n zIndex: 9999,\n border: 0,\n clip: 'rect(1px, 1px, 1px, 1px)',\n height: 1,\n width: 1,\n position: 'absolute',\n overflow: 'hidden',\n padding: 0,\n whiteSpace: 'nowrap',\n backgroundColor: 'red',\n color: 'blue'\n })\n }, props));\n};\n\nexports.default = A11yText;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar DummyInput = function (_Component) {\n _inherits(DummyInput, _Component);\n\n function DummyInput() {\n _classCallCheck(this, DummyInput);\n\n return _possibleConstructorReturn(this, (DummyInput.__proto__ || Object.getPrototypeOf(DummyInput)).apply(this, arguments));\n }\n\n _createClass(DummyInput, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n inProp = _props.in,\n out = _props.out,\n onExited = _props.onExited,\n appear = _props.appear,\n enter = _props.enter,\n exit = _props.exit,\n innerRef = _props.innerRef,\n emotion = _props.emotion,\n props = _objectWithoutProperties(_props, ['in', 'out', 'onExited', 'appear', 'enter', 'exit', 'innerRef', 'emotion']);\n\n return _react2.default.createElement('input', _extends({\n ref: innerRef\n }, props, {\n className: emotion.css({\n // get rid of any default styles\n background: 0,\n border: 0,\n fontSize: 'inherit',\n outline: 0,\n padding: 0,\n // important! without `width` browsers won't allow focus\n width: 1,\n // remove cursor on desktop\n color: 'transparent',\n // remove cursor on mobile whilst maintaining \"scroll into view\" behaviour\n left: -100,\n opacity: 0,\n position: 'relative',\n transform: 'scale(0)'\n })\n }));\n }\n }]);\n\n return DummyInput;\n}(_react.Component);\n\nexports.default = DummyInput;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _NodeResolver = require('./NodeResolver');\n\nvar _NodeResolver2 = _interopRequireDefault(_NodeResolver);\n\nvar _index = require('./ScrollLock/index');\n\nvar _index2 = _interopRequireDefault(_index);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n} // NOTE:\n// We shouldn't need this after updating to React v16.3.0, which introduces:\n// - createRef() https://reactjs.org/docs/react-api.html#reactcreateref\n// - forwardRef() https://reactjs.org/docs/react-api.html#reactforwardref\n\n\nvar ScrollBlock = function (_PureComponent) {\n _inherits(ScrollBlock, _PureComponent);\n\n function ScrollBlock() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, ScrollBlock);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ScrollBlock.__proto__ || Object.getPrototypeOf(ScrollBlock)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n touchScrollTarget: null\n }, _this.getScrollTarget = function (ref) {\n if (ref === _this.state.touchScrollTarget) return;\n\n _this.setState({\n touchScrollTarget: ref\n });\n }, _this.blurSelectInput = function () {\n if (document.activeElement) {\n document.activeElement.blur();\n }\n }, _temp), _possibleConstructorReturn(_this, _ret);\n } // must be in state to trigger a re-render, only runs once per instance\n // this will close the menu when a user clicks outside\n\n\n _createClass(ScrollBlock, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n children = _props.children,\n isEnabled = _props.isEnabled,\n emotion = _props.emotion;\n var touchScrollTarget = this.state.touchScrollTarget; // bail early if not enabled\n\n if (!isEnabled) return children;\n /*\n * Div\n * ------------------------------\n * blocks scrolling on non-body elements behind the menu\n * NodeResolver\n * ------------------------------\n * we need a reference to the scrollable element to \"unlock\" scroll on\n * mobile devices\n * ScrollLock\n * ------------------------------\n * actually does the scroll locking\n */\n\n return _react2.default.createElement('div', null, _react2.default.createElement('div', {\n onClick: this.blurSelectInput,\n className: emotion.css({\n position: 'fixed',\n left: 0,\n bottom: 0,\n right: 0,\n top: 0\n })\n }), _react2.default.createElement(_NodeResolver2.default, {\n innerRef: this.getScrollTarget\n }, children), touchScrollTarget ? _react2.default.createElement(_index2.default, {\n touchScrollTarget: touchScrollTarget\n }) : null);\n }\n }]);\n\n return ScrollBlock;\n}(_react.PureComponent);\n\nexports.default = ScrollBlock;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _constants = require('./constants');\n\nvar _utils = require('./utils');\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\nvar activeScrollLocks = 0;\n\nvar ScrollLock = function (_Component) {\n _inherits(ScrollLock, _Component);\n\n function ScrollLock() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, ScrollLock);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ScrollLock.__proto__ || Object.getPrototypeOf(ScrollLock)).call.apply(_ref, [this].concat(args))), _this), _this.originalStyles = {}, _this.listenerOptions = {\n capture: false,\n passive: false\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(ScrollLock, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n if (!canUseDOM) return;\n var _props = this.props,\n accountForScrollbars = _props.accountForScrollbars,\n touchScrollTarget = _props.touchScrollTarget;\n var target = document.body;\n var targetStyle = target && target.style;\n\n if (accountForScrollbars) {\n // store any styles already applied to the body\n _constants.STYLE_KEYS.forEach(function (key) {\n var val = targetStyle && targetStyle[key];\n _this2.originalStyles[key] = val;\n });\n } // apply the lock styles and padding if this is the first scroll lock\n\n\n if (accountForScrollbars && activeScrollLocks < 1) {\n var currentPadding = parseInt(this.originalStyles.paddingRight, 10) || 0;\n var clientWidth = document.body ? document.body.clientWidth : 0;\n var adjustedPadding = window.innerWidth - clientWidth + currentPadding || 0;\n Object.keys(_constants.LOCK_STYLES).forEach(function (key) {\n var val = _constants.LOCK_STYLES[key];\n\n if (targetStyle) {\n targetStyle[key] = val;\n }\n });\n\n if (targetStyle) {\n targetStyle.paddingRight = adjustedPadding + 'px';\n }\n } // account for touch devices\n\n\n if (target && (0, _utils.isTouchDevice)()) {\n // Mobile Safari ignores { overflow: hidden } declaration on the body.\n target.addEventListener('touchmove', _utils.preventTouchMove, this.listenerOptions); // Allow scroll on provided target\n\n if (touchScrollTarget) {\n touchScrollTarget.addEventListener('touchstart', _utils.preventInertiaScroll, this.listenerOptions);\n touchScrollTarget.addEventListener('touchmove', _utils.allowTouchMove, this.listenerOptions);\n }\n } // increment active scroll locks\n\n\n activeScrollLocks += 1;\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n var _this3 = this;\n\n if (!canUseDOM) return;\n var _props2 = this.props,\n accountForScrollbars = _props2.accountForScrollbars,\n touchScrollTarget = _props2.touchScrollTarget;\n var target = document.body;\n var targetStyle = target && target.style; // safely decrement active scroll locks\n\n activeScrollLocks = Math.max(activeScrollLocks - 1, 0); // reapply original body styles, if any\n\n if (accountForScrollbars && activeScrollLocks < 1) {\n _constants.STYLE_KEYS.forEach(function (key) {\n var val = _this3.originalStyles[key];\n\n if (targetStyle) {\n targetStyle[key] = val;\n }\n });\n } // remove touch listeners\n\n\n if (target && (0, _utils.isTouchDevice)()) {\n target.removeEventListener('touchmove', _utils.preventTouchMove, this.listenerOptions);\n\n if (touchScrollTarget) {\n touchScrollTarget.removeEventListener('touchstart', _utils.preventInertiaScroll, this.listenerOptions);\n touchScrollTarget.removeEventListener('touchmove', _utils.allowTouchMove, this.listenerOptions);\n }\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return null;\n }\n }]);\n\n return ScrollLock;\n}(_react.Component);\n\nScrollLock.defaultProps = {\n accountForScrollbars: true\n};\nexports.default = ScrollLock;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar STYLE_KEYS = exports.STYLE_KEYS = ['boxSizing', 'height', 'overflow', 'paddingRight', 'position'];\nvar LOCK_STYLES = exports.LOCK_STYLES = {\n boxSizing: 'border-box',\n // account for possible declaration `width: 100%;` on body\n overflow: 'hidden',\n position: 'relative',\n height: '100%'\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.preventTouchMove = preventTouchMove;\nexports.allowTouchMove = allowTouchMove;\nexports.preventInertiaScroll = preventInertiaScroll;\nexports.isTouchDevice = isTouchDevice;\n\nfunction preventTouchMove(e) {\n e.preventDefault();\n}\n\nfunction allowTouchMove(e) {\n e.stopPropagation();\n}\n\nfunction preventInertiaScroll() {\n var top = this.scrollTop;\n var totalScroll = this.scrollHeight;\n var currentScroll = top + this.offsetHeight;\n\n if (top === 0) {\n this.scrollTop = 1;\n } else if (currentScroll === totalScroll) {\n this.scrollTop = top - 1;\n }\n} // `ontouchstart` check works on most browsers\n// `maxTouchPoints` works on IE10/11 and Surface\n\n\nfunction isTouchDevice() {\n return 'ontouchstart' in window || navigator.maxTouchPoints;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _NodeResolver = require('./NodeResolver');\n\nvar _NodeResolver2 = _interopRequireDefault(_NodeResolver);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar ScrollCaptor = function (_Component) {\n _inherits(ScrollCaptor, _Component);\n\n function ScrollCaptor() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, ScrollCaptor);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ScrollCaptor.__proto__ || Object.getPrototypeOf(ScrollCaptor)).call.apply(_ref, [this].concat(args))), _this), _this.isBottom = false, _this.isTop = false, _this.cancelScroll = function (event) {\n event.preventDefault();\n event.stopPropagation();\n }, _this.handleEventDelta = function (event, delta) {\n var _this$props = _this.props,\n onBottomArrive = _this$props.onBottomArrive,\n onBottomLeave = _this$props.onBottomLeave,\n onTopArrive = _this$props.onTopArrive,\n onTopLeave = _this$props.onTopLeave;\n var _this$scrollTarget = _this.scrollTarget,\n scrollTop = _this$scrollTarget.scrollTop,\n scrollHeight = _this$scrollTarget.scrollHeight,\n clientHeight = _this$scrollTarget.clientHeight;\n var target = _this.scrollTarget;\n var isDeltaPositive = delta > 0;\n var availableScroll = scrollHeight - clientHeight - scrollTop;\n var shouldCancelScroll = false; // reset bottom/top flags\n\n if (availableScroll > delta && _this.isBottom) {\n if (onBottomLeave) onBottomLeave(event);\n _this.isBottom = false;\n }\n\n if (isDeltaPositive && _this.isTop) {\n if (onTopLeave) onTopLeave(event);\n _this.isTop = false;\n } // bottom limit\n\n\n if (isDeltaPositive && delta > availableScroll) {\n if (onBottomArrive && !_this.isBottom) {\n onBottomArrive(event);\n }\n\n target.scrollTop = scrollHeight;\n shouldCancelScroll = true;\n _this.isBottom = true; // top limit\n } else if (!isDeltaPositive && -delta > scrollTop) {\n if (onTopArrive && !_this.isTop) {\n onTopArrive(event);\n }\n\n target.scrollTop = 0;\n shouldCancelScroll = true;\n _this.isTop = true;\n } // cancel scroll\n\n\n if (shouldCancelScroll) {\n _this.cancelScroll(event);\n }\n }, _this.onWheel = function (event) {\n _this.handleEventDelta(event, event.deltaY);\n }, _this.onTouchStart = function (event) {\n // set touch start so we can calculate touchmove delta\n _this.touchStart = event.changedTouches[0].clientY;\n }, _this.onTouchMove = function (event) {\n var deltaY = _this.touchStart - event.changedTouches[0].clientY;\n\n _this.handleEventDelta(event, deltaY);\n }, _this.getScrollTarget = function (ref) {\n _this.scrollTarget = ref;\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(ScrollCaptor, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.startListening(this.scrollTarget);\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.stopListening(this.scrollTarget);\n }\n }, {\n key: 'startListening',\n value: function startListening(el) {\n // bail early if no scroll available\n if (el.scrollHeight <= el.clientHeight) return; // all the if statements are to appease Flow 😢\n\n if (typeof el.addEventListener === 'function') {\n el.addEventListener('wheel', this.onWheel, false);\n }\n\n if (typeof el.addEventListener === 'function') {\n el.addEventListener('touchstart', this.onTouchStart, false);\n }\n\n if (typeof el.addEventListener === 'function') {\n el.addEventListener('touchmove', this.onTouchMove, false);\n }\n }\n }, {\n key: 'stopListening',\n value: function stopListening(el) {\n // bail early if no scroll available\n if (el.scrollHeight <= el.clientHeight) return; // all the if statements are to appease Flow 😢\n\n if (typeof el.removeEventListener === 'function') {\n el.removeEventListener('wheel', this.onWheel, false);\n }\n\n if (typeof el.removeEventListener === 'function') {\n el.removeEventListener('touchstart', this.onTouchStart, false);\n }\n\n if (typeof el.removeEventListener === 'function') {\n el.removeEventListener('touchmove', this.onTouchMove, false);\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(_NodeResolver2.default, {\n innerRef: this.getScrollTarget\n }, this.props.children);\n }\n }]);\n\n return ScrollCaptor;\n}(_react.Component);\n\nvar ScrollCaptorSwitch = function (_Component2) {\n _inherits(ScrollCaptorSwitch, _Component2);\n\n function ScrollCaptorSwitch() {\n _classCallCheck(this, ScrollCaptorSwitch);\n\n return _possibleConstructorReturn(this, (ScrollCaptorSwitch.__proto__ || Object.getPrototypeOf(ScrollCaptorSwitch)).apply(this, arguments));\n }\n\n _createClass(ScrollCaptorSwitch, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n isEnabled = _props.isEnabled,\n props = _objectWithoutProperties(_props, ['isEnabled']);\n\n return isEnabled ? _react2.default.createElement(ScrollCaptor, props) : this.props.children;\n }\n }]);\n\n return ScrollCaptorSwitch;\n}(_react.Component);\n\nScrollCaptorSwitch.defaultProps = {\n isEnabled: true\n};\nexports.default = ScrollCaptorSwitch;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar instructionsAriaMessage = exports.instructionsAriaMessage = function instructionsAriaMessage(event) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var isSearchable = context.isSearchable,\n isMulti = context.isMulti,\n label = context.label;\n\n switch (event) {\n case 'menu':\n return 'Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu, press Tab to select the option and exit the menu.';\n\n case 'input':\n return (label ? label : 'Select') + ' is focused ' + (isSearchable ? ',type to refine list' : '') + ', press Down to open the menu, ' + (isMulti ? ' press left to focus selected values' : '');\n\n case 'value':\n return 'Use left and right to toggle between focused values, press Enter to remove the currently focused value';\n }\n};\n\nvar valueEventAriaMessage = exports.valueEventAriaMessage = function valueEventAriaMessage(event, context) {\n var value = context.value;\n if (!value) return;\n\n switch (event) {\n case 'deselect-option':\n case 'pop-value':\n case 'remove-value':\n return 'option ' + value + ', deselected.';\n\n case 'select-option':\n return 'option ' + value + ', selected.';\n }\n};\n\nvar valueFocusAriaMessage = exports.valueFocusAriaMessage = function valueFocusAriaMessage(_ref) {\n var focusedValue = _ref.focusedValue,\n getOptionLabel = _ref.getOptionLabel,\n selectValue = _ref.selectValue;\n return 'value ' + getOptionLabel(focusedValue) + ' focused, ' + (selectValue.indexOf(focusedValue) + 1) + ' of ' + selectValue.length + '.';\n};\n\nvar optionFocusAriaMessage = exports.optionFocusAriaMessage = function optionFocusAriaMessage(_ref2) {\n var focusedOption = _ref2.focusedOption,\n getOptionLabel = _ref2.getOptionLabel,\n options = _ref2.options;\n return 'option ' + getOptionLabel(focusedOption) + ' focused, ' + (options.indexOf(focusedOption) + 1) + ' of ' + options.length + '.';\n};\n\nvar resultsAriaMessage = exports.resultsAriaMessage = function resultsAriaMessage(_ref3) {\n var inputValue = _ref3.inputValue,\n screenReaderMessage = _ref3.screenReaderMessage;\n return '' + screenReaderMessage + (inputValue ? ' for search term ' + inputValue : '') + '.';\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar formatGroupLabel = exports.formatGroupLabel = function formatGroupLabel(group) {\n return group.label;\n};\n\nvar getOptionLabel = exports.getOptionLabel = function getOptionLabel(option) {\n return option.label;\n};\n\nvar getOptionValue = exports.getOptionValue = function getOptionValue(option) {\n return option.value;\n};\n\nvar isOptionDisabled = exports.isOptionDisabled = function isOptionDisabled(option) {\n return !!option.isDisabled;\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.defaultComponents = exports.components = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nrequire('react');\n\nvar _containers = require('./containers');\n\nvar _indicators = require('./indicators');\n\nvar _Control = require('./Control');\n\nvar _Control2 = _interopRequireDefault(_Control);\n\nvar _Group = require('./Group');\n\nvar _Group2 = _interopRequireDefault(_Group);\n\nvar _Input = require('./Input');\n\nvar _Input2 = _interopRequireDefault(_Input);\n\nvar _Menu = require('./Menu');\n\nvar _Menu2 = _interopRequireDefault(_Menu);\n\nvar _MultiValue = require('./MultiValue');\n\nvar _MultiValue2 = _interopRequireDefault(_MultiValue);\n\nvar _Option = require('./Option');\n\nvar _Option2 = _interopRequireDefault(_Option);\n\nvar _Placeholder = require('./Placeholder');\n\nvar _Placeholder2 = _interopRequireDefault(_Placeholder);\n\nvar _SingleValue = require('./SingleValue');\n\nvar _SingleValue2 = _interopRequireDefault(_SingleValue);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nvar components = exports.components = {\n ClearIndicator: _indicators.ClearIndicator,\n Control: _Control2.default,\n DropdownIndicator: _indicators.DropdownIndicator,\n DownChevron: _indicators.DownChevron,\n CrossIcon: _indicators.CrossIcon,\n Group: _Group2.default,\n GroupHeading: _Group.GroupHeading,\n IndicatorsContainer: _containers.IndicatorsContainer,\n IndicatorSeparator: _indicators.IndicatorSeparator,\n Input: _Input2.default,\n LoadingIndicator: _indicators.LoadingIndicator,\n Menu: _Menu2.default,\n MenuList: _Menu.MenuList,\n MenuPortal: _Menu.MenuPortal,\n LoadingMessage: _Menu.LoadingMessage,\n NoOptionsMessage: _Menu.NoOptionsMessage,\n MultiValue: _MultiValue2.default,\n MultiValueContainer: _MultiValue.MultiValueContainer,\n MultiValueLabel: _MultiValue.MultiValueLabel,\n MultiValueRemove: _MultiValue.MultiValueRemove,\n Option: _Option2.default,\n Placeholder: _Placeholder2.default,\n SelectContainer: _containers.SelectContainer,\n SingleValue: _SingleValue2.default,\n ValueContainer: _containers.ValueContainer\n};\n\nvar defaultComponents = exports.defaultComponents = function defaultComponents(props) {\n return _extends({}, components, props.components);\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar sizerStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n visibility: 'hidden',\n height: 0,\n overflow: 'scroll',\n whiteSpace: 'pre'\n};\nvar INPUT_PROPS_BLACKLIST = ['extraWidth', 'injectStyles', 'inputClassName', 'inputRef', 'inputStyle', 'minWidth', 'onAutosize', 'placeholderIsMinWidth'];\n\nvar cleanInputProps = function cleanInputProps(inputProps) {\n INPUT_PROPS_BLACKLIST.forEach(function (field) {\n return delete inputProps[field];\n });\n return inputProps;\n};\n\nvar copyStyles = function copyStyles(styles, node) {\n node.style.fontSize = styles.fontSize;\n node.style.fontFamily = styles.fontFamily;\n node.style.fontWeight = styles.fontWeight;\n node.style.fontStyle = styles.fontStyle;\n node.style.letterSpacing = styles.letterSpacing;\n node.style.textTransform = styles.textTransform;\n};\n\nvar isIE = typeof window !== 'undefined' && window.navigator ? /MSIE |Trident\\/|Edge\\//.test(window.navigator.userAgent) : false;\n\nvar generateId = function generateId() {\n // we only need an auto-generated ID for stylesheet injection, which is only\n // used for IE. so if the browser is not IE, this should return undefined.\n return isIE ? '_' + Math.random().toString(36).substr(2, 12) : undefined;\n};\n\nvar AutosizeInput = function (_Component) {\n _inherits(AutosizeInput, _Component);\n\n function AutosizeInput(props) {\n _classCallCheck(this, AutosizeInput);\n\n var _this = _possibleConstructorReturn(this, (AutosizeInput.__proto__ || Object.getPrototypeOf(AutosizeInput)).call(this, props));\n\n _this.inputRef = function (el) {\n _this.input = el;\n\n if (typeof _this.props.inputRef === 'function') {\n _this.props.inputRef(el);\n }\n };\n\n _this.placeHolderSizerRef = function (el) {\n _this.placeHolderSizer = el;\n };\n\n _this.sizerRef = function (el) {\n _this.sizer = el;\n };\n\n _this.state = {\n inputWidth: props.minWidth,\n inputId: props.id || generateId()\n };\n return _this;\n }\n\n _createClass(AutosizeInput, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.mounted = true;\n this.copyInputStyles();\n this.updateInputWidth();\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n var id = nextProps.id;\n\n if (id !== this.props.id) {\n this.setState({\n inputId: id || generateId()\n });\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps, prevState) {\n if (prevState.inputWidth !== this.state.inputWidth) {\n if (typeof this.props.onAutosize === 'function') {\n this.props.onAutosize(this.state.inputWidth);\n }\n }\n\n this.updateInputWidth();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.mounted = false;\n }\n }, {\n key: 'copyInputStyles',\n value: function copyInputStyles() {\n if (!this.mounted || !window.getComputedStyle) {\n return;\n }\n\n var inputStyles = this.input && window.getComputedStyle(this.input);\n\n if (!inputStyles) {\n return;\n }\n\n copyStyles(inputStyles, this.sizer);\n\n if (this.placeHolderSizer) {\n copyStyles(inputStyles, this.placeHolderSizer);\n }\n }\n }, {\n key: 'updateInputWidth',\n value: function updateInputWidth() {\n if (!this.mounted || !this.sizer || typeof this.sizer.scrollWidth === 'undefined') {\n return;\n }\n\n var newInputWidth = void 0;\n\n if (this.props.placeholder && (!this.props.value || this.props.value && this.props.placeholderIsMinWidth)) {\n newInputWidth = Math.max(this.sizer.scrollWidth, this.placeHolderSizer.scrollWidth) + 2;\n } else {\n newInputWidth = this.sizer.scrollWidth + 2;\n } // add extraWidth to the detected width. for number types, this defaults to 16 to allow for the stepper UI\n\n\n var extraWidth = this.props.type === 'number' && this.props.extraWidth === undefined ? 16 : parseInt(this.props.extraWidth) || 0;\n newInputWidth += extraWidth;\n\n if (newInputWidth < this.props.minWidth) {\n newInputWidth = this.props.minWidth;\n }\n\n if (newInputWidth !== this.state.inputWidth) {\n this.setState({\n inputWidth: newInputWidth\n });\n }\n }\n }, {\n key: 'getInput',\n value: function getInput() {\n return this.input;\n }\n }, {\n key: 'focus',\n value: function focus() {\n this.input.focus();\n }\n }, {\n key: 'blur',\n value: function blur() {\n this.input.blur();\n }\n }, {\n key: 'select',\n value: function select() {\n this.input.select();\n }\n }, {\n key: 'renderStyles',\n value: function renderStyles() {\n // this method injects styles to hide IE's clear indicator, which messes\n // with input size detection. the stylesheet is only injected when the\n // browser is IE, and can also be disabled by the `injectStyles` prop.\n var injectStyles = this.props.injectStyles;\n return isIE && injectStyles ? _react2.default.createElement('style', {\n dangerouslySetInnerHTML: {\n __html: 'input#' + this.state.inputId + '::-ms-clear {display: none;}'\n }\n }) : null;\n }\n }, {\n key: 'render',\n value: function render() {\n var sizerValue = [this.props.defaultValue, this.props.value, ''].reduce(function (previousValue, currentValue) {\n if (previousValue !== null && previousValue !== undefined) {\n return previousValue;\n }\n\n return currentValue;\n });\n\n var wrapperStyle = _extends({}, this.props.style);\n\n if (!wrapperStyle.display) wrapperStyle.display = 'inline-block';\n\n var inputStyle = _extends({\n boxSizing: 'content-box',\n width: this.state.inputWidth + 'px'\n }, this.props.inputStyle);\n\n var inputProps = _objectWithoutProperties(this.props, []);\n\n cleanInputProps(inputProps);\n inputProps.className = this.props.inputClassName;\n inputProps.id = this.state.inputId;\n inputProps.style = inputStyle;\n return _react2.default.createElement('div', {\n className: this.props.className,\n style: wrapperStyle\n }, this.renderStyles(), _react2.default.createElement('input', _extends({}, inputProps, {\n ref: this.inputRef\n })), _react2.default.createElement('div', {\n ref: this.sizerRef,\n style: sizerStyle\n }, sizerValue), this.props.placeholder ? _react2.default.createElement('div', {\n ref: this.placeHolderSizerRef,\n style: sizerStyle\n }, this.props.placeholder) : null);\n }\n }]);\n\n return AutosizeInput;\n}(_react.Component);\n\nAutosizeInput.propTypes = {\n className: _propTypes2.default.string,\n // className for the outer element\n defaultValue: _propTypes2.default.any,\n // default field value\n extraWidth: _propTypes2.default.oneOfType([// additional width for input element\n _propTypes2.default.number, _propTypes2.default.string]),\n id: _propTypes2.default.string,\n // id to use for the input, can be set for consistent snapshots\n injectStyles: _propTypes2.default.bool,\n // inject the custom stylesheet to hide clear UI, defaults to true\n inputClassName: _propTypes2.default.string,\n // className for the input element\n inputRef: _propTypes2.default.func,\n // ref callback for the input element\n inputStyle: _propTypes2.default.object,\n // css styles for the input element\n minWidth: _propTypes2.default.oneOfType([// minimum width for input element\n _propTypes2.default.number, _propTypes2.default.string]),\n onAutosize: _propTypes2.default.func,\n // onAutosize handler: function(newWidth) {}\n onChange: _propTypes2.default.func,\n // onChange handler: function(event) {}\n placeholder: _propTypes2.default.string,\n // placeholder text\n placeholderIsMinWidth: _propTypes2.default.bool,\n // don't collapse size to less than the placeholder\n style: _propTypes2.default.object,\n // css styles for the outer element\n value: _propTypes2.default.any // field value\n\n};\nAutosizeInput.defaultProps = {\n minWidth: 1,\n injectStyles: true\n};\nexports.default = AutosizeInput;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.defaultStyles = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nexports.mergeStyles = mergeStyles;\n\nvar _containers = require('./components/containers');\n\nvar _Control = require('./components/Control');\n\nvar _Group = require('./components/Group');\n\nvar _indicators = require('./components/indicators');\n\nvar _Input = require('./components/Input');\n\nvar _Placeholder = require('./components/Placeholder');\n\nvar _Option = require('./components/Option');\n\nvar _Menu = require('./components/Menu');\n\nvar _SingleValue = require('./components/SingleValue');\n\nvar _MultiValue = require('./components/MultiValue');\n\nvar defaultStyles = exports.defaultStyles = {\n clearIndicator: _indicators.clearIndicatorCSS,\n container: _containers.containerCSS,\n control: _Control.css,\n dropdownIndicator: _indicators.dropdownIndicatorCSS,\n group: _Group.groupCSS,\n groupHeading: _Group.groupHeadingCSS,\n indicatorsContainer: _containers.indicatorsContainerCSS,\n indicatorSeparator: _indicators.indicatorSeparatorCSS,\n input: _Input.inputCSS,\n loadingIndicator: _indicators.loadingIndicatorCSS,\n loadingMessage: _Menu.loadingMessageCSS,\n menu: _Menu.menuCSS,\n menuList: _Menu.menuListCSS,\n menuPortal: _Menu.menuPortalCSS,\n multiValue: _MultiValue.multiValueCSS,\n multiValueLabel: _MultiValue.multiValueLabelCSS,\n multiValueRemove: _MultiValue.multiValueRemoveCSS,\n noOptionsMessage: _Menu.noOptionsMessageCSS,\n option: _Option.optionCSS,\n placeholder: _Placeholder.placeholderCSS,\n singleValue: _SingleValue.css,\n valueContainer: _containers.valueContainerCSS\n}; // Merge Utility\n// Allows consumers to extend a base Select with additional styles\n\nfunction mergeStyles(source) {\n var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; // initialize with source styles\n\n var styles = _extends({}, source); // massage in target styles\n\n\n Object.keys(target).forEach(function (key) {\n if (source[key]) {\n styles[key] = function (rsCss, props) {\n return target[key](source[key](rsCss, props), props);\n };\n } else {\n styles[key] = target[key];\n }\n });\n return styles;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar colors = exports.colors = {\n primary: '#2684FF',\n primary75: '#4C9AFF',\n primary50: '#B2D4FF',\n primary25: '#DEEBFF',\n danger: '#DE350B',\n dangerLight: '#FFBDAD',\n neutral0: 'hsl(0, 0%, 100%)',\n neutral5: 'hsl(0, 0%, 95%)',\n neutral10: 'hsl(0, 0%, 90%)',\n neutral20: 'hsl(0, 0%, 80%)',\n neutral30: 'hsl(0, 0%, 70%)',\n neutral40: 'hsl(0, 0%, 60%)',\n neutral50: 'hsl(0, 0%, 50%)',\n neutral60: 'hsl(0, 0%, 40%)',\n neutral70: 'hsl(0, 0%, 30%)',\n neutral80: 'hsl(0, 0%, 20%)',\n neutral90: 'hsl(0, 0%, 10%)'\n};\nvar borderRadius = 4;\nvar baseUnit = 4;\n/* Used to calculate consistent margin/padding on elements */\n\nvar controlHeight = 38;\n/* The minimum height of the control */\n\nvar menuGutter = baseUnit * 2;\n/* The amount of space between the control and menu */\n\nvar spacing = exports.spacing = {\n baseUnit: baseUnit,\n controlHeight: controlHeight,\n menuGutter: menuGutter\n};\nvar defaultTheme = exports.defaultTheme = {\n borderRadius: borderRadius,\n colors: colors,\n spacing: spacing\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _toConsumableArray(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n } else {\n return Array.from(arr);\n }\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar manageState = function manageState(SelectComponent) {\n var _class, _temp2;\n\n return _temp2 = _class = function (_Component) {\n _inherits(StateManager, _Component);\n\n function StateManager() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, StateManager);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = StateManager.__proto__ || Object.getPrototypeOf(StateManager)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n inputValue: _this.props.inputValue !== undefined ? _this.props.inputValue : _this.props.defaultInputValue,\n menuIsOpen: _this.props.menuIsOpen !== undefined ? _this.props.menuIsOpen : _this.props.defaultMenuIsOpen,\n value: _this.props.value !== undefined ? _this.props.value : _this.props.defaultValue\n }, _this.onChange = function (value, actionMeta) {\n _this.callProp('onChange', value, actionMeta);\n\n _this.setState({\n value: value\n });\n }, _this.onInputChange = function (value, actionMeta) {\n // TODO: for backwards compatibility, we allow the prop to return a new\n // value, but now inputValue is a controllable prop we probably shouldn't\n var newValue = _this.callProp('onInputChange', value, actionMeta);\n\n _this.setState({\n inputValue: newValue !== undefined ? newValue : value\n });\n }, _this.onMenuOpen = function () {\n _this.callProp('onMenuOpen');\n\n _this.setState({\n menuIsOpen: true\n });\n }, _this.onMenuClose = function () {\n _this.callProp('onMenuClose');\n\n _this.setState({\n menuIsOpen: false\n });\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(StateManager, [{\n key: 'focus',\n value: function focus() {\n this.select.focus();\n }\n }, {\n key: 'blur',\n value: function blur() {\n this.select.blur();\n }\n }, {\n key: 'getProp',\n value: function getProp(key) {\n return this.props[key] !== undefined ? this.props[key] : this.state[key];\n }\n }, {\n key: 'callProp',\n value: function callProp(name) {\n if (typeof this.props[name] === 'function') {\n var _props;\n\n for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return (_props = this.props)[name].apply(_props, _toConsumableArray(args));\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n return _react2.default.createElement(SelectComponent, _extends({}, this.props, {\n ref: function ref(_ref2) {\n _this2.select = _ref2;\n },\n inputValue: this.getProp('inputValue'),\n menuIsOpen: this.getProp('menuIsOpen'),\n onChange: this.onChange,\n onInputChange: this.onInputChange,\n onMenuClose: this.onMenuClose,\n onMenuOpen: this.onMenuOpen,\n value: this.getProp('value')\n }));\n }\n }]);\n\n return StateManager;\n }(_react.Component), _class.defaultProps = {\n defaultInputValue: '',\n defaultMenuIsOpen: false,\n defaultValue: null\n }, _temp2;\n};\n\nexports.default = manageState;"],"sourceRoot":""}