return items.find(function (item) {
function getCurrentId(options, passedId) {
var _findFirstEnabledItem;
if (passedId || passedId === null) {
if (options.currentId || options.currentId === null) {
return options.currentId;
return (_findFirstEnabledItem = findFirstEnabledItem(options.items || [])) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id;
/***/ (function(module, exports, __webpack_require__) {
var getPolyfill = __webpack_require__("xoj2");
var define = __webpack_require__("82c2");
module.exports = function shimValues() {
var polyfill = getPolyfill();
define(Object, { values: polyfill }, {
values: function testValues() {
return Object.values !== polyfill;
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectWithoutPropertiesLoose; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _createForOfIteratorHelperLoose; });
function _defineProperty(obj, key, value) {
Object.defineProperty(obj, key, {
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
if (enumerableOnly) symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
keys.push.apply(keys, symbols);
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
ownKeys(Object(source), true).forEach(function (key) {
_defineProperty(target, key, source[key]);
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var sourceKeys = Object.keys(source);
for (i = 0; i < sourceKeys.length; i++) {
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
function _unsupportedIterableToArray(o, minLen) {
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
if (i >= o.length) return {
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
it = o[Symbol.iterator]();
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
exports['default'] = calculateDimension;
function calculateDimension(el, axis) {
var borderBox = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var withMargin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
var axisStart = axis === 'width' ? 'Left' : 'Top';
var axisEnd = axis === 'width' ? 'Right' : 'Bottom';
// Only read styles if we need to
var style = !borderBox || withMargin ? window.getComputedStyle(el) : null;
// Offset includes border and padding
var offsetWidth = el.offsetWidth,
offsetHeight = el.offsetHeight;
var size = axis === 'width' ? offsetWidth : offsetHeight;
size -= parseFloat(style['padding' + axisStart]) + parseFloat(style['padding' + axisEnd]) + parseFloat(style['border' + axisStart + 'Width']) + parseFloat(style['border' + axisEnd + 'Width']);
size += parseFloat(style['margin' + axisStart]) + parseFloat(style['margin' + axisEnd]);
/***/ (function(module, exports, __webpack_require__) {
var GetIntrinsic = __webpack_require__("AM7I");
var $TypeError = GetIntrinsic('%TypeError%');
var MAX_SAFE_INTEGER = __webpack_require__("yyeE");
var Call = __webpack_require__("fW1L");
var CreateDataPropertyOrThrow = __webpack_require__("WvKp");
var Get = __webpack_require__("3aeR");
var HasProperty = __webpack_require__("aenO");
var IsArray = __webpack_require__("9cOx");
var LengthOfArrayLike = __webpack_require__("y9oe");
var ToString = __webpack_require__("Hx/O");
// https://ecma-international.org/ecma-262/11.0/#sec-flattenintoarray
// eslint-disable-next-line max-params
module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) {
if (arguments.length > 5) {
mapperFunction = arguments[5];
while (sourceIndex < sourceLen) {
var P = ToString(sourceIndex);
var exists = HasProperty(source, P);
var element = Get(source, P);
if (typeof mapperFunction !== 'undefined') {
if (arguments.length <= 6) {
throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided');
element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]);
var shouldFlatten = false;
shouldFlatten = IsArray(element);
var elementLen = LengthOfArrayLike(element);
targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1);
if (targetIndex >= MAX_SAFE_INTEGER) {
throw new $TypeError('index too large');
CreateDataPropertyOrThrow(target, ToString(targetIndex), element);
/***/ (function(module, exports, __webpack_require__) {
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
function getClientPosition(elem) {
var doc = elem.ownerDocument;
var docElem = doc && doc.documentElement;
// 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式
box = elem.getBoundingClientRect();
// 注:jQuery 还考虑减去 docElem.clientLeft/clientTop
// 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确
// 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin
// In IE, most of the time, 2 extra pixels are added to the top and left
// due to the implicit 2-pixel inset border. In IE6/7 quirks mode and
// IE6 standards mode, this border can be overridden by setting the
// document element's border to zero -- thus, we cannot rely on the
// offset always being 2 pixels.
// In quirks mode, the offset can be determined by querying the body's
// clientLeft/clientTop, but in standards mode, it is found by querying
// the document element's clientLeft/clientTop. Since we already called
// getClientBoundingRect we have already forced a reflow, so it is not
// too expensive just to query them all.
// ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的
// 窗口边框标准是设 documentElement ,quirks 时设置 body
// 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去
// 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置
// 标准 ie 下 docElem.clientTop 就是 border-top
// ie7 html 即窗口边框改变不了。永远为 2
// 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0
x -= docElem.clientLeft || body.clientLeft || 0;
y -= docElem.clientTop || body.clientTop || 0;
function getScroll(w, top) {
var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
var method = 'scroll' + (top ? 'Top' : 'Left');
if (typeof ret !== 'number') {
ret = d.documentElement[method];
if (typeof ret !== 'number') {
function getScrollLeft(w) {
function getScrollTop(w) {
return getScroll(w, true);
var pos = getClientPosition(el);
var doc = el.ownerDocument;
var w = doc.defaultView || doc.parentWindow;
pos.left += getScrollLeft(w);
pos.top += getScrollTop(w);
function _getComputedStyle(elem, name, computedStyle_) {
var d = elem.ownerDocument;
var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);
// https://github.com/kissyteam/kissy/issues/61
val = computedStyle.getPropertyValue(name) || computedStyle[name];
var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');
var RE_POS = /^(top|right|bottom|left)$/;
var CURRENT_STYLE = 'currentStyle';
var RUNTIME_STYLE = 'runtimeStyle';
function _getComputedStyleIE(elem, name) {
// currentStyle maybe null
// http://msdn.microsoft.com/en-us/library/ms535231.aspx
var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
// 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值
// 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19
// 在 ie 下不对,需要直接用 offset 方式
// borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
// exclude left right for relativity
if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
// Remember the original values
var rsLeft = elem[RUNTIME_STYLE][LEFT];
// prevent flashing of content
elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
// Put in the new values to get a computed value out
style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
ret = style.pixelLeft + PX;
// Revert the changed values
elem[RUNTIME_STYLE][LEFT] = rsLeft;
return ret === '' ? 'auto' : ret;
var getComputedStyleX = undefined;
if (typeof window !== 'undefined') {
getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
for (var i = 0; i < arr.length; i++) {
function isBorderBoxFn(elem) {
return getComputedStyleX(elem, 'boxSizing') === 'border-box';
var BOX_MODELS = ['margin', 'border', 'padding'];
function swap(elem, options, callback) {
// Remember the old values, and insert the new ones
if (options.hasOwnProperty(name)) {
style[name] = options[name];
if (options.hasOwnProperty(name)) {
function getPBMWidth(elem, props, which) {
for (j = 0; j < props.length; j++) {
for (i = 0; i < which.length; i++) {
cssProp = prop + which[i] + 'Width';
cssProp = prop + which[i];
value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
* A crude way of determining if an object is a window
return obj != null && obj == obj.window;