// EXTERNAL MODULE: ./node_modules/reakit/es/_rollupPluginBabelHelpers-1f0bf8c2.js
var _rollupPluginBabelHelpers_1f0bf8c2 = __webpack_require__("BZp5");
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/useIsomorphicEffect.js
var useIsomorphicEffect = __webpack_require__("KohD");
// CONCATENATED MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/useSealedState.js
* React custom hook that returns the very first value passed to `initialState`,
* even if it changes between re-renders.
function useSealedState(initialState) {
var _React$useState = Object(external_React_["useState"])(initialState),
sealed = _React$useState[0];
// EXTERNAL MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/getDocument.js
var getDocument = __webpack_require__("Ccil");
// CONCATENATED MODULE: ./node_modules/reakit/es/reverse-30eaa122.js
function groupItems(items) {
var _loop = function _loop() {
var group = groups.find(function (g) {
return !g[0] || g[0].groupId === item.groupId;
for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(items), _step; !(_step = _iterator()).done;) {
for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(grid), _step; !(_step = _iterator()).done;) {
flattened.push.apply(flattened, row);
function reverse(array) {
return array.slice().reverse();
// EXTERNAL MODULE: ./node_modules/reakit/es/getCurrentId-5aa9849e.js
var getCurrentId_5aa9849e = __webpack_require__("iYXd");
// CONCATENATED MODULE: ./node_modules/reakit/es/findEnabledItemById-8ddca752.js
function findEnabledItemById(items, id) {
if (!id) return undefined;
return items === null || items === void 0 ? void 0 : items.find(function (item) {
return item.id === id && !item.disabled;
// CONCATENATED MODULE: ./node_modules/reakit/node_modules/reakit-utils/es/applyState.js
function isUpdater(argument) {
return typeof argument === "function";
* Receives a `setState` argument and calls it with `currentValue` if it's a
* function. Otherwise return the argument as the new value.
* import { applyState } from "reakit-utils";
* applyState((value) => value + 1, 1); // 2
function applyState(argument, currentValue) {
if (isUpdater(argument)) {
return argument(currentValue);
// EXTERNAL MODULE: ./node_modules/reakit/es/Id/IdProvider.js
var IdProvider = __webpack_require__("KCH1");
// CONCATENATED MODULE: ./node_modules/reakit/es/Id/IdState.js
function unstable_useIdState(initialState) {
if (initialState === void 0) {
var _useSealedState = useSealedState(initialState),
initialBaseId = _useSealedState.baseId;
var generateId = Object(external_React_["useContext"])(IdProvider["a" /* unstable_IdContext */]);
var idCountRef = Object(external_React_["useRef"])(0);
var _React$useState = Object(external_React_["useState"])(function () {
return initialBaseId || generateId();
baseId = _React$useState[0],
setBaseId = _React$useState[1];
unstable_idCountRef: idCountRef
// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeState.js
function isElementPreceding(element1, element2) {
return Boolean(element2.compareDocumentPosition(element1) & Node.DOCUMENT_POSITION_PRECEDING);
function findDOMIndex(items, item) {
return items.findIndex(function (currentItem) {
if (!currentItem.ref.current || !item.ref.current) {
return isElementPreceding(item.ref.current, currentItem.ref.current);
function getMaxLength(rows) {
for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(rows), _step; !(_step = _iterator()).done;) {
var length = _step.value.length;
if (length > maxLength) {
* Turns [row1, row1, row2, row2] into [row1, row2, row1, row2]
function verticalizeItems(items) {
var groups = groupItems(items);
var maxLength = getMaxLength(groups);
for (var i = 0; i < maxLength; i += 1) {
for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(groups), _step; !(_step = _iterator()).done;) {
verticalized.push(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, group[i]), {}, {
// If there's no groupId, it means that it's not a grid composite,
// but a single row instead. So, instead of verticalizing it, that
// is, assigning a different groupId based on the column index, we
// keep it undefined so they will be part of the same group.
// It's useful when using up/down on one-dimensional composites.
groupId: group[i].groupId ? "" + i : undefined
function createEmptyItem(groupId) {
* Turns [[row1, row1], [row2]] into [[row1, row1], [row2, row2]]
function fillGroups(groups, currentId, shift) {
var maxLength = getMaxLength(groups);
for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(groups), _step; !(_step = _iterator()).done;) {
for (var i = 0; i < maxLength; i += 1) {
if (!item || shift && item.disabled) {
var previousItem = isFrist && shift ? Object(getCurrentId_5aa9849e["a" /* f */])(group) : group[i - 1];
group[i] = previousItem && currentId !== (previousItem === null || previousItem === void 0 ? void 0 : previousItem.id) && shift ? previousItem : createEmptyItem(previousItem === null || previousItem === void 0 ? void 0 : previousItem.groupId);
function placeItemsAfter(items, id, shouldInsertNullItem) {
var index = items.findIndex(function (item) {
return [].concat(items.slice(index + 1), shouldInsertNullItem ? [nullItem] : [], items.slice(0, index));
function getItemsInGroup(items, groupId) {
return items.filter(function (item) {
return item.groupId === groupId;
function getOppositeOrientation(orientation) {
return orientation && map[orientation];
function addItemAtIndex(array, item, index) {
return [].concat(array, [item]);
return [].concat(array.slice(0, index), [item], array.slice(index));
function sortBasedOnDOMPosition(items) {
var pairs = items.map(function (item, index) {
var isOrderDifferent = false;
pairs.sort(function (_ref, _ref2) {
var elementA = a.ref.current;
var elementB = b.ref.current;
if (!elementA || !elementB) return 0; // a before b
if (isElementPreceding(elementA, elementB)) {
return pairs.map(function (_ref3) {
function setItemsBasedOnDOMPosition(items, setItems) {
var sortedItems = sortBasedOnDOMPosition(items);
if (items !== sortedItems) {
function getCommonParent(items) {
var _firstItem$ref$curren;
var firstItem = items[0],
nextItems = items.slice(1);
var parentElement = firstItem === null || firstItem === void 0 ? void 0 : (_firstItem$ref$curren = firstItem.ref.current) === null || _firstItem$ref$curren === void 0 ? void 0 : _firstItem$ref$curren.parentElement;
var _loop = function _loop() {
var parent = parentElement;
if (nextItems.every(function (item) {
return parent.contains(item.ref.current);
parentElement = parentElement.parentElement;
if (typeof _ret === "object") return _ret.v;
return Object(getDocument["a" /* getDocument */])(parentElement).body;
} // istanbul ignore next: JSDOM doesn't support IntersectionObverser
// See https://github.com/jsdom/jsdom/issues/2032
function useIntersectionObserver(items, setItems) {
var previousItems = Object(external_React_["useRef"])([]);
Object(external_React_["useEffect"])(function () {
var callback = function callback() {
var hasPreviousItems = !!previousItems.current.length; // We don't want to sort items if items have been just registered.
setItemsBasedOnDOMPosition(items, setItems);
previousItems.current = items;
var root = getCommonParent(items);
var observer = new IntersectionObserver(callback, {
for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(items), _step; !(_step = _iterator()).done;) {
observer.observe(item.ref.current);
function useTimeoutObserver(items, setItems) {
Object(external_React_["useEffect"])(function () {
var callback = function callback() {
return setItemsBasedOnDOMPosition(items, setItems);
var timeout = setTimeout(callback, 250);
return clearTimeout(timeout);
function useSortBasedOnDOMPosition(items, setItems) {
if (typeof IntersectionObserver === "function") {
useIntersectionObserver(items, setItems);
useTimeoutObserver(items, setItems);
function CompositeState_reducer(state, action) {
var virtual = state.unstable_virtual,
orientation = state.orientation,
currentId = state.currentId,
moves = state.unstable_moves,
includesBaseElement = state.unstable_includesBaseElement,
initialVirtual = state.initialVirtual,
initialRTL = state.initialRTL,
initialOrientation = state.initialOrientation,
initialCurrentId = state.initialCurrentId,
initialLoop = state.initialLoop,
initialWrap = state.initialWrap,
initialShift = state.initialShift,
hasSetCurrentId = state.hasSetCurrentId;
var _group = action.group; // If there are no groups yet, just add it as the first one
if (groups.length === 0) {
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
} // Finds the group index based on DOM position
var index = findDOMIndex(groups, _group);
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
groups: addItemAtIndex(groups, _group, index)
var nextGroups = groups.filter(function (group) {
}); // The group isn't registered, so do nothing
if (nextGroups.length === groups.length) {
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
var _item = action.item; // Finds the item group based on the DOM hierarchy
var _group2 = groups.find(function (r) {
return (_r$ref$current = r.ref.current) === null || _r$ref$current === void 0 ? void 0 : _r$ref$current.contains(_item.ref.current);
}); // Group will be null if it's a one-dimensional composite
var nextItem = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
groupId: _group2 === null || _group2 === void 0 ? void 0 : _group2.id
var _index = findDOMIndex(items, nextItem);
var nextState = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
items: addItemAtIndex(items, nextItem, _index)
if (!hasSetCurrentId && !moves && initialCurrentId === undefined) {
var _findFirstEnabledItem;
// Sets currentId to the first enabled item. This runs whenever an item
// is registered because the first enabled item may be registered
return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, nextState), {}, {
currentId: (_findFirstEnabledItem = Object(getCurrentId_5aa9849e["a" /* f */])(nextState.items)) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id