* `aria-activedescendant` are also considered.
* import { hasFocusWithin } from "reakit-utils";
* hasFocusWithin(document.getElementById("id"));
function hasFocusWithin(element) {
var activeElement = Object(_getActiveElement_js__WEBPACK_IMPORTED_MODULE_0__[/* getActiveElement */ "a"])(element);
if (!activeElement) return false;
if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* contains */ "a"])(element, activeElement)) return true;
var activeDescendant = activeElement.getAttribute("aria-activedescendant");
if (!activeDescendant) return false;
if (activeDescendant === element.id) return true;
return !!element.querySelector("#" + activeDescendant);
/***/ (function(module, exports) {
// This works in non-strict mode
// This works if eval is allowed (see CSP)
g = g || new Function("return this")();
// This works if the window reference is available
if (typeof window === "object") g = window;
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
/***/ (function(module, exports, __webpack_require__) {
var implementation = __webpack_require__("FufO");
var lacksProperEnumerationOrder = function () {
* v8, specifically in node 4.x, has a bug with incorrect property enumeration order
* note: this does not detect the bug unless there's 20 characters
var str = 'abcdefghijklmnopqrst';
var letters = str.split('');
for (var i = 0; i < letters.length; ++i) {
map[letters[i]] = letters[i];
var obj = Object.assign({}, map);
var assignHasPendingExceptions = function () {
if (!Object.assign || !Object.preventExtensions) {
* Firefox 37 still has "pending exception" logic in its Object.assign implementation,
* which is 72% slower than our shim, and Firefox 40's native implementation.
var thrower = Object.preventExtensions({ 1: 2 });
Object.assign(thrower, 'xy');
return thrower[1] === 'y';
module.exports = function getPolyfill() {
if (lacksProperEnumerationOrder()) {
if (assignHasPendingExceptions()) {
/***/ (function(module, exports, __webpack_require__) {
var ArraySpeciesCreate = __webpack_require__("7Ji+");
var FlattenIntoArray = __webpack_require__("iz0l");
var Get = __webpack_require__("3aeR");
var ToInteger = __webpack_require__("ddK1");
var ToLength = __webpack_require__("w3Ut");
var ToObject = __webpack_require__("sA9S");
module.exports = function flat() {
var sourceLen = ToLength(Get(O, 'length'));
if (arguments.length > 0 && typeof arguments[0] !== 'undefined') {
depthNum = ToInteger(arguments[0]);
var A = ArraySpeciesCreate(O, 0);
FlattenIntoArray(A, O, sourceLen, 0, depthNum);
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
exports['default'] = getPhrasePropTypes;
var _object = __webpack_require__("Koq/");
var _object2 = _interopRequireDefault(_object);
var _propTypes = __webpack_require__("17x9");
var _propTypes2 = _interopRequireDefault(_propTypes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function getPhrasePropTypes(defaultPhrases) {
return Object.keys(defaultPhrases).reduce(function (phrases, key) {
return (0, _object2['default'])({}, phrases, _defineProperty({}, key, _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func, _propTypes2['default'].node])));
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* unused harmony export unstable_Id */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return unstable_useId; });
/* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BZp5");
/* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("dQ10");
/* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("1k9I");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cDcd");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _IdProvider_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("KCH1");
// Automatically generated
var ID_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId"];
var ID_KEYS = [].concat(ID_STATE_KEYS, ["id"]);
var unstable_useId = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({
useOptions: function useOptions(options, htmlProps) {
var generateId = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_IdProvider_js__WEBPACK_IMPORTED_MODULE_4__[/* unstable_IdContext */ "a"]);
var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(function () {
// This comes from useIdState
if (options.unstable_idCountRef) {
options.unstable_idCountRef.current += 1;
return "-" + options.unstable_idCountRef.current;
} // If there's no useIdState, we check if `baseId` was passed (as a prop,
return "-" + generateId("");
suffix = _React$useState[0]; // `baseId` will be the prop passed directly as a prop or via useIdState.
// If there's neither, then it'll fallback to Context's generateId.
// This generateId can result in a sequential ID (if there's a Provider)
// or a random string (without Provider).
var baseId = Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () {
return options.baseId || generateId();
}, [options.baseId, generateId]);
var id = htmlProps.id || options.id || "" + baseId + suffix;
return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, options), {}, {
useProps: function useProps(options, htmlProps) {
return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({
var unstable_Id = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({
/***/ (function(module, exports, __webpack_require__) {
var GetIntrinsic = __webpack_require__("AM7I");
var $match = GetIntrinsic('%Symbol.match%', true);
var hasRegExpMatcher = __webpack_require__("2Nju");
var ToBoolean = __webpack_require__("kvlw");
// https://ecma-international.org/ecma-262/6.0/#sec-isregexp
module.exports = function IsRegExp(argument) {
if (!argument || typeof argument !== 'object') {
var isRegExp = argument[$match];
if (typeof isRegExp !== 'undefined') {
return ToBoolean(isRegExp);
return hasRegExpMatcher(argument);
/***/ (function(module, exports, __webpack_require__) {
var GetIntrinsic = __webpack_require__("AM7I");
var $Math = GetIntrinsic('%Math%');
var $Number = GetIntrinsic('%Number%');
module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1;
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getActiveElement; });
/* harmony import */ var _getDocument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Ccil");
* Returns `element.ownerDocument.activeElement`.
function getActiveElement(element) {
var _getDocument = Object(_getDocument_js__WEBPACK_IMPORTED_MODULE_0__[/* getDocument */ "a"])(element),
activeElement = _getDocument.activeElement;
if (!(activeElement !== null && activeElement !== void 0 && activeElement.nodeName)) {
// In IE11, activeElement might be an empty object if we're interacting
// with elements inside of an iframe.
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__("oNNP");
var assertRecord = __webpack_require__("10Kj");
var Type = __webpack_require__("V1cy");
// https://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor
module.exports = function IsAccessorDescriptor(Desc) {
if (typeof Desc === 'undefined') {
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return StyleSheet; });
Based off glamor's StyleSheet, thanks Sunil ❤️
high performance StyleSheet for css-in-js systems
- uses multiple style tags behind the scenes for millions of rules
- uses `insertRule` for appending in production for *much* faster performance
import { StyleSheet } from '@emotion/sheet'
let styleSheet = new StyleSheet({ key: '', container: document.head })
styleSheet.insert('#box { border: 1px solid red; }')
- appends a css rule into the stylesheet
- empties the stylesheet of all its contents
function sheetForTag(tag) {
} // this weirdness brought to you by firefox
/* istanbul ignore next */
for (var i = 0; i < document.styleSheets.length; i++) {
if (document.styleSheets[i].ownerNode === tag) {
return document.styleSheets[i];
function createStyleElement(options) {
var tag = document.createElement('style');
tag.setAttribute('data-emotion', options.key);
if (options.nonce !== undefined) {
tag.setAttribute('nonce', options.nonce);
tag.appendChild(document.createTextNode(''));
function StyleSheet(options) {
this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy;
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
this.container = options.container;
var _proto = StyleSheet.prototype;
_proto.insert = function insert(rule) {
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
// it's 1 in dev because we insert source maps that map a single rule to a location
// and you can only have one source map per style tag
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
var _tag = createStyleElement(this);
if (this.tags.length === 0) {
before = this.tags[this.tags.length - 1].nextSibling;
this.container.insertBefore(_tag, before);
var tag = this.tags[this.tags.length - 1];
var sheet = sheetForTag(tag);
// this is a really hot path
// we check the second character first because having "i"
// as the second character will happen less often than
// having "@" as the first character
var isImportRule = rule.charCodeAt(1) === 105 && rule.charCodeAt(0) === 64; // this is the ultrafast version, works across browsers
// the big drawback is that the css won't be editable in devtools
sheet.insertRule(rule, // we need to insert @import rules before anything else
// otherwise there will be an error
// technically this means that the @import rules will
// _usually_(not always since there could be multiple style tags)
// be the first ones in prod and generally later in dev
// this shouldn't really matter in the real world though
// @import is generally only used for font faces from google fonts and etc.
// so while this could be technically correct then it would be slower and larger
// for a tiny bit of correctness that won't matter in the real world
isImportRule ? 0 : sheet.cssRules.length);
tag.appendChild(document.createTextNode(rule));
_proto.flush = function flush() {
this.tags.forEach(function (tag) {
return tag.parentNode.removeChild(tag);
/***/ (function(module, __webpack_exports__, __webpack_require__) {