/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 5755: /***/ ((module, exports) => { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { 'use strict'; var hasOwn = {}.hasOwnProperty; var nativeCodeString = '[native code]'; function classNames() { var classes = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if (argType === 'string' || argType === 'number') { classes.push(arg); } else if (Array.isArray(arg)) { if (arg.length) { var inner = classNames.apply(null, arg); if (inner) { classes.push(inner); } } } else if (argType === 'object') { if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { classes.push(arg.toString()); continue; } for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes.push(key); } } } } return classes.join(' '); } if ( true && module.exports) { classNames.default = classNames; module.exports = classNames; } else if (true) { // register as 'classnames', consistent with npm package name !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return classNames; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }()); /***/ }), /***/ 66: /***/ ((module) => { "use strict"; var isMergeableObject = function isMergeableObject(value) { return isNonNullObject(value) && !isSpecial(value) }; function isNonNullObject(value) { return !!value && typeof value === 'object' } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isReactElement(value) } // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25 var canUseSymbol = typeof Symbol === 'function' && Symbol.for; var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE } function emptyTarget(val) { return Array.isArray(val) ? [] : {} } function cloneUnlessOtherwiseSpecified(value, options) { return (options.clone !== false && options.isMergeableObject(value)) ? deepmerge(emptyTarget(value), value, options) : value } function defaultArrayMerge(target, source, options) { return target.concat(source).map(function(element) { return cloneUnlessOtherwiseSpecified(element, options) }) } function getMergeFunction(key, options) { if (!options.customMerge) { return deepmerge } var customMerge = options.customMerge(key); return typeof customMerge === 'function' ? customMerge : deepmerge } function getEnumerableOwnPropertySymbols(target) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { return Object.propertyIsEnumerable.call(target, symbol) }) : [] } function getKeys(target) { return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)) } function propertyIsOnObject(object, property) { try { return property in object } catch(_) { return false } } // Protects from prototype poisoning and unexpected merging up the prototype chain. function propertyIsUnsafe(target, key) { return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet, && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain, && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable. } function mergeObject(target, source, options) { var destination = {}; if (options.isMergeableObject(target)) { getKeys(target).forEach(function(key) { destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); }); } getKeys(source).forEach(function(key) { if (propertyIsUnsafe(target, key)) { return } if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { destination[key] = getMergeFunction(key, options)(target[key], source[key], options); } else { destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); } }); return destination } function deepmerge(target, source, options) { options = options || {}; options.arrayMerge = options.arrayMerge || defaultArrayMerge; options.isMergeableObject = options.isMergeableObject || isMergeableObject; // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge() // implementations can use it. The caller may not replace it. options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; var sourceIsArray = Array.isArray(source); var targetIsArray = Array.isArray(target); var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; if (!sourceAndTargetTypesMatch) { return cloneUnlessOtherwiseSpecified(source, options) } else if (sourceIsArray) { return options.arrayMerge(target, source, options) } else { return mergeObject(target, source, options) } } deepmerge.all = function deepmergeAll(array, options) { if (!Array.isArray(array)) { throw new Error('first argument should be an array') } return array.reduce(function(prev, next) { return deepmerge(prev, next, options) }, {}) }; var deepmerge_1 = deepmerge; module.exports = deepmerge_1; /***/ }), /***/ 1637: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var util = __webpack_require__(3062); function scrollIntoView(elem, container, config) { config = config || {}; // document 归一化到 window if (container.nodeType === 9) { container = util.getWindow(container); } var allowHorizontalScroll = config.allowHorizontalScroll; var onlyScrollIfNeeded = config.onlyScrollIfNeeded; var alignWithTop = config.alignWithTop; var alignWithLeft = config.alignWithLeft; var offsetTop = config.offsetTop || 0; var offsetLeft = config.offsetLeft || 0; var offsetBottom = config.offsetBottom || 0; var offsetRight = config.offsetRight || 0; allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll; var isWin = util.isWindow(container); var elemOffset = util.offset(elem); var eh = util.outerHeight(elem); var ew = util.outerWidth(elem); var containerOffset = undefined; var ch = undefined; var cw = undefined; var containerScroll = undefined; var diffTop = undefined; var diffBottom = undefined; var win = undefined; var winScroll = undefined; var ww = undefined; var wh = undefined; if (isWin) { win = container; wh = util.height(win); ww = util.width(win); winScroll = { left: util.scrollLeft(win), top: util.scrollTop(win) }; // elem 相对 container 可视视窗的距离 diffTop = { left: elemOffset.left - winScroll.left - offsetLeft, top: elemOffset.top - winScroll.top - offsetTop }; diffBottom = { left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight, top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom }; containerScroll = winScroll; } else { containerOffset = util.offset(container); ch = container.clientHeight; cw = container.clientWidth; containerScroll = { left: container.scrollLeft, top: container.scrollTop }; // elem 相对 container 可视视窗的距离 // 注意边框, offset 是边框到根节点 diffTop = { left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft, top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop }; diffBottom = { left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight, top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom }; } if (diffTop.top < 0 || diffBottom.top > 0) { // 强制向上 if (alignWithTop === true) { util.scrollTop(container, containerScroll.top + diffTop.top); } else if (alignWithTop === false) { util.scrollTop(container, containerScroll.top + diffBottom.top); } else { // 自动调整 if (diffTop.top < 0) { util.scrollTop(container, containerScroll.top + diffTop.top); } else { util.scrollTop(container, containerScroll.top + diffBottom.top); } } } else { if (!onlyScrollIfNeeded) { alignWithTop = alignWithTop === undefined ? true : !!alignWithTop; if (alignWithTop) { util.scrollTop(container, containerScroll.top + diffTop.top); } else { util.scrollTop(container, containerScroll.top + diffBottom.top); } } } if (allowHorizontalScroll) { if (diffTop.left < 0 || diffBottom.left > 0) { // 强制向上 if (alignWithLeft === true) { util.scrollLeft(container, containerScroll.left + diffTop.left); } else if (alignWithLeft === false) { util.scrollLeft(container, containerScroll.left + diffBottom.left); } else { // 自动调整 if (diffTop.left < 0) { util.scrollLeft(container, containerScroll.left + diffTop.left); } else { util.scrollLeft(container, containerScroll.left + diffBottom.left); } } } else { if (!onlyScrollIfNeeded) { alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft; if (alignWithLeft) { util.scrollLeft(container, containerScroll.left + diffTop.left); } else { util.scrollLeft(container, containerScroll.left + diffBottom.left); } } } } } module.exports = scrollIntoView; /***/ }), /***/ 5428: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = __webpack_require__(1637); /***/ }), /***/ 3062: /***/ ((module) => { "use strict"; 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 box = undefined; var x = undefined; var y = undefined; var doc = elem.ownerDocument; var body = doc.body; var docElem = doc && doc.documentElement; // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式 box = elem.getBoundingClientRect(); // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确 // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin x = box.left; y = box.top; // 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; return { left: x, top: y }; } function getScroll(w, top) { var ret = w['page' + (top ? 'Y' : 'X') + 'Offset']; var method = 'scroll' + (top ? 'Top' : 'Left'); if (typeof ret !== 'number') { var d = w.document; // ie6,7,8 standard mode ret = d.documentElement[method]; if (typeof ret !== 'number') { // quirks mode ret = d.body[method]; } } return ret; } function getScrollLeft(w) { return getScroll(w); } function getScrollTop(w) { return getScroll(w, true); } function getOffset(el) { var pos = getClientPosition(el); var doc = el.ownerDocument; var w = doc.defaultView || doc.parentWindow; pos.left += getScrollLeft(w); pos.top += getScrollTop(w); return pos; } function _getComputedStyle(elem, name, computedStyle_) { var val = ''; var d = elem.ownerDocument; var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null); // https://github.com/kissyteam/kissy/issues/61 if (computedStyle) { val = computedStyle.getPropertyValue(name) || computedStyle[name]; } return val; } 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'; var LEFT = 'left'; var PX = 'px'; 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 style = elem.style; var left = style[LEFT]; 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 style[LEFT] = left; elem[RUNTIME_STYLE][LEFT] = rsLeft; } return ret === '' ? 'auto' : ret; } var getComputedStyleX = undefined; if (typeof window !== 'undefined') { getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE; } function each(arr, fn) { for (var i = 0; i < arr.length; i++) { fn(arr[i]); } } function isBorderBoxFn(elem) { return getComputedStyleX(elem, 'boxSizing') === 'border-box'; } var BOX_MODELS = ['margin', 'border', 'padding']; var CONTENT_INDEX = -1; var PADDING_INDEX = 2; var BORDER_INDEX = 1; var MARGIN_INDEX = 0; function swap(elem, options, callback) { var old = {}; var style = elem.style; var name = undefined; // Remember the old values, and insert the new ones for (name in options) { if (options.hasOwnProperty(name)) { old[name] = style[name]; style[name] = options[name]; } } callback.call(elem); // Revert the old values for (name in options) { if (options.hasOwnProperty(name)) { style[name] = old[name]; } } } function getPBMWidth(elem, props, which) { var value = 0; var prop = undefined; var j = undefined; var i = undefined; for (j = 0; j < props.length; j++) { prop = props[j]; if (prop) { for (i = 0; i < which.length; i++) { var cssProp = undefined; if (prop === 'border') { cssProp = prop + which[i] + 'Width'; } else { cssProp = prop + which[i]; } value += parseFloat(getComputedStyleX(elem, cssProp)) || 0; } } } return value; } /** * A crude way of determining if an object is a window * @member util */ function isWindow(obj) { // must use == for ie8 /* eslint eqeqeq:0 */ return obj != null && obj == obj.window; } var domUtils = {}; each(['Width', 'Height'], function (name) { domUtils['doc' + name] = function (refWin) { var d = refWin.document; return Math.max( // firefox chrome documentElement.scrollHeight< body.scrollHeight // ie standard mode : documentElement.scrollHeight> body.scrollHeight d.documentElement['scroll' + name], // quirks : documentElement.scrollHeight 最大等于可视窗口多一点? d.body['scroll' + name], domUtils['viewport' + name](d)); }; domUtils['viewport' + name] = function (win) { // pc browser includes scrollbar in window.innerWidth var prop = 'client' + name; var doc = win.document; var body = doc.body; var documentElement = doc.documentElement; var documentElementProp = documentElement[prop]; // 标准模式取 documentElement // backcompat 取 body return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp; }; }); /* 得到元素的大小信息 @param elem @param name @param {String} [extra] 'padding' : (css width) + padding 'border' : (css width) + padding + border 'margin' : (css width) + padding + border + margin */ function getWH(elem, name, extra) { if (isWindow(elem)) { return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem); } else if (elem.nodeType === 9) { return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem); } var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight; var computedStyle = getComputedStyleX(elem); var isBorderBox = isBorderBoxFn(elem, computedStyle); var cssBoxValue = 0; if (borderBoxValue == null || borderBoxValue <= 0) { borderBoxValue = undefined; // Fall back to computed then un computed css if necessary cssBoxValue = getComputedStyleX(elem, name); if (cssBoxValue == null || Number(cssBoxValue) < 0) { cssBoxValue = elem.style[name] || 0; } // Normalize '', auto, and prepare for extra cssBoxValue = parseFloat(cssBoxValue) || 0; } if (extra === undefined) { extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX; } var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox; var val = borderBoxValue || cssBoxValue; if (extra === CONTENT_INDEX) { if (borderBoxValueOrIsBorderBox) { return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle); } return cssBoxValue; } if (borderBoxValueOrIsBorderBox) { var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle); return val + (extra === BORDER_INDEX ? 0 : padding); } return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle); } var cssShow = { position: 'absolute', visibility: 'hidden', display: 'block' }; // fix #119 : https://github.com/kissyteam/kissy/issues/119 function getWHIgnoreDisplay(elem) { var val = undefined; var args = arguments; // in case elem is window // elem.offsetWidth === undefined if (elem.offsetWidth !== 0) { val = getWH.apply(undefined, args); } else { swap(elem, cssShow, function () { val = getWH.apply(undefined, args); }); } return val; } function css(el, name, v) { var value = v; if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { for (var i in name) { if (name.hasOwnProperty(i)) { css(el, i, name[i]); } } return undefined; } if (typeof value !== 'undefined') { if (typeof value === 'number') { value += 'px'; } el.style[name] = value; return undefined; } return getComputedStyleX(el, name); } each(['width', 'height'], function (name) { var first = name.charAt(0).toUpperCase() + name.slice(1); domUtils['outer' + first] = function (el, includeMargin) { return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX); }; var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; domUtils[name] = function (elem, val) { if (val !== undefined) { if (elem) { var computedStyle = getComputedStyleX(elem); var isBorderBox = isBorderBoxFn(elem); if (isBorderBox) { val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle); } return css(elem, name, val); } return undefined; } return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX); }; }); // 设置 elem 相对 elem.ownerDocument 的坐标 function setOffset(elem, offset) { // set position first, in-case top/left are set even on static elem if (css(elem, 'position') === 'static') { elem.style.position = 'relative'; } var old = getOffset(elem); var ret = {}; var current = undefined; var key = undefined; for (key in offset) { if (offset.hasOwnProperty(key)) { current = parseFloat(css(elem, key)) || 0; ret[key] = current + offset[key] - old[key]; } } css(elem, ret); } module.exports = _extends({ getWindow: function getWindow(node) { var doc = node.ownerDocument || node; return doc.defaultView || doc.parentWindow; }, offset: function offset(el, value) { if (typeof value !== 'undefined') { setOffset(el, value); } else { return getOffset(el); } }, isWindow: isWindow, each: each, css: css, clone: function clone(obj) { var ret = {}; for (var i in obj) { if (obj.hasOwnProperty(i)) { ret[i] = obj[i]; } } var overflow = obj.overflow; if (overflow) { for (var i in obj) { if (obj.hasOwnProperty(i)) { ret.overflow[i] = obj.overflow[i]; } } } return ret; }, scrollLeft: function scrollLeft(w, v) { if (isWindow(w)) { if (v === undefined) { return getScrollLeft(w); } window.scrollTo(v, getScrollTop(w)); } else { if (v === undefined) { return w.scrollLeft; } w.scrollLeft = v; } }, scrollTop: function scrollTop(w, v) { if (isWindow(w)) { if (v === undefined) { return getScrollTop(w); } window.scrollTo(getScrollLeft(w), v); } else { if (v === undefined) { return w.scrollTop; } w.scrollTop = v; } }, viewportWidth: 0, viewportHeight: 0 }, domUtils); /***/ }), /***/ 2287: /***/ ((__unused_webpack_module, exports) => { "use strict"; var __webpack_unused_export__; /** @license React v17.0.2 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var b=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131; if("function"===typeof Symbol&&Symbol.for){var x=Symbol.for;b=x("react.element");c=x("react.portal");d=x("react.fragment");e=x("react.strict_mode");f=x("react.profiler");g=x("react.provider");h=x("react.context");k=x("react.forward_ref");l=x("react.suspense");m=x("react.suspense_list");n=x("react.memo");p=x("react.lazy");q=x("react.block");r=x("react.server.block");u=x("react.fundamental");v=x("react.debug_trace_mode");w=x("react.legacy_hidden")} function y(a){if("object"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type,a){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof,a){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}var z=g,A=b,B=k,C=d,D=p,E=n,F=c,G=f,H=e,I=l;__webpack_unused_export__=h;__webpack_unused_export__=z;__webpack_unused_export__=A;__webpack_unused_export__=B;__webpack_unused_export__=C;__webpack_unused_export__=D;__webpack_unused_export__=E;__webpack_unused_export__=F;__webpack_unused_export__=G;__webpack_unused_export__=H; __webpack_unused_export__=I;__webpack_unused_export__=function(){return!1};__webpack_unused_export__=function(){return!1};__webpack_unused_export__=function(a){return y(a)===h};__webpack_unused_export__=function(a){return y(a)===g};__webpack_unused_export__=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b};__webpack_unused_export__=function(a){return y(a)===k};__webpack_unused_export__=function(a){return y(a)===d};__webpack_unused_export__=function(a){return y(a)===p};__webpack_unused_export__=function(a){return y(a)===n}; __webpack_unused_export__=function(a){return y(a)===c};__webpack_unused_export__=function(a){return y(a)===f};__webpack_unused_export__=function(a){return y(a)===e};__webpack_unused_export__=function(a){return y(a)===l};__webpack_unused_export__=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===v||a===e||a===l||a===m||a===w||"object"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===n||a.$$typeof===g||a.$$typeof===h||a.$$typeof===k||a.$$typeof===u||a.$$typeof===q||a[0]===r)?!0:!1}; __webpack_unused_export__=y; /***/ }), /***/ 1915: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (true) { /* unused reexport */ __webpack_require__(2287); } else {} /***/ }), /***/ 7734: /***/ ((module) => { "use strict"; // do not edit .js files directly - edit src/index.jst var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; module.exports = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } if ((a instanceof Map) && (b instanceof Map)) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; for (i of a.entries()) if (!equal(i[1], b.get(i[0]))) return false; return true; } if ((a instanceof Set) && (b instanceof Set)) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; return true; } if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = length; i-- !== 0;) { var key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } // true if both NaN, false otherwise return a!==a && b!==b; }; /***/ }), /***/ 8924: /***/ ((__unused_webpack_module, exports) => { // Copyright (c) 2014 Rafael Caricio. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. var GradientParser = {}; GradientParser.parse = (function() { var tokens = { linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i, repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i, radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i, repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i, sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i, extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/, positionKeywords: /^(left|center|right|top|bottom)/i, pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/, percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/, emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/, angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/, startCall: /^\(/, endCall: /^\)/, comma: /^,/, hexColor: /^\#([0-9a-fA-F]+)/, literalColor: /^([a-zA-Z]+)/, rgbColor: /^rgb/i, rgbaColor: /^rgba/i, number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/ }; var input = ''; function error(msg) { var err = new Error(input + ': ' + msg); err.source = input; throw err; } function getAST() { var ast = matchListDefinitions(); if (input.length > 0) { error('Invalid input not EOF'); } return ast; } function matchListDefinitions() { return matchListing(matchDefinition); } function matchDefinition() { return matchGradient( 'linear-gradient', tokens.linearGradient, matchLinearOrientation) || matchGradient( 'repeating-linear-gradient', tokens.repeatingLinearGradient, matchLinearOrientation) || matchGradient( 'radial-gradient', tokens.radialGradient, matchListRadialOrientations) || matchGradient( 'repeating-radial-gradient', tokens.repeatingRadialGradient, matchListRadialOrientations); } function matchGradient(gradientType, pattern, orientationMatcher) { return matchCall(pattern, function(captures) { var orientation = orientationMatcher(); if (orientation) { if (!scan(tokens.comma)) { error('Missing comma before color stops'); } } return { type: gradientType, orientation: orientation, colorStops: matchListing(matchColorStop) }; }); } function matchCall(pattern, callback) { var captures = scan(pattern); if (captures) { if (!scan(tokens.startCall)) { error('Missing ('); } result = callback(captures); if (!scan(tokens.endCall)) { error('Missing )'); } return result; } } function matchLinearOrientation() { return matchSideOrCorner() || matchAngle(); } function matchSideOrCorner() { return match('directional', tokens.sideOrCorner, 1); } function matchAngle() { return match('angular', tokens.angleValue, 1); } function matchListRadialOrientations() { var radialOrientations, radialOrientation = matchRadialOrientation(), lookaheadCache; if (radialOrientation) { radialOrientations = []; radialOrientations.push(radialOrientation); lookaheadCache = input; if (scan(tokens.comma)) { radialOrientation = matchRadialOrientation(); if (radialOrientation) { radialOrientations.push(radialOrientation); } else { input = lookaheadCache; } } } return radialOrientations; } function matchRadialOrientation() { var radialType = matchCircle() || matchEllipse(); if (radialType) { radialType.at = matchAtPosition(); } else { var defaultPosition = matchPositioning(); if (defaultPosition) { radialType = { type: 'default-radial', at: defaultPosition }; } } return radialType; } function matchCircle() { var circle = match('shape', /^(circle)/i, 0); if (circle) { circle.style = matchLength() || matchExtentKeyword(); } return circle; } function matchEllipse() { var ellipse = match('shape', /^(ellipse)/i, 0); if (ellipse) { ellipse.style = matchDistance() || matchExtentKeyword(); } return ellipse; } function matchExtentKeyword() { return match('extent-keyword', tokens.extentKeywords, 1); } function matchAtPosition() { if (match('position', /^at/, 0)) { var positioning = matchPositioning(); if (!positioning) { error('Missing positioning value'); } return positioning; } } function matchPositioning() { var location = matchCoordinates(); if (location.x || location.y) { return { type: 'position', value: location }; } } function matchCoordinates() { return { x: matchDistance(), y: matchDistance() }; } function matchListing(matcher) { var captures = matcher(), result = []; if (captures) { result.push(captures); while (scan(tokens.comma)) { captures = matcher(); if (captures) { result.push(captures); } else { error('One extra comma'); } } } return result; } function matchColorStop() { var color = matchColor(); if (!color) { error('Expected color definition'); } color.length = matchDistance(); return color; } function matchColor() { return matchHexColor() || matchRGBAColor() || matchRGBColor() || matchLiteralColor(); } function matchLiteralColor() { return match('literal', tokens.literalColor, 0); } function matchHexColor() { return match('hex', tokens.hexColor, 1); } function matchRGBColor() { return matchCall(tokens.rgbColor, function() { return { type: 'rgb', value: matchListing(matchNumber) }; }); } function matchRGBAColor() { return matchCall(tokens.rgbaColor, function() { return { type: 'rgba', value: matchListing(matchNumber) }; }); } function matchNumber() { return scan(tokens.number)[1]; } function matchDistance() { return match('%', tokens.percentageValue, 1) || matchPositionKeyword() || matchLength(); } function matchPositionKeyword() { return match('position-keyword', tokens.positionKeywords, 1); } function matchLength() { return match('px', tokens.pixelValue, 1) || match('em', tokens.emValue, 1); } function match(type, pattern, captureIndex) { var captures = scan(pattern); if (captures) { return { type: type, value: captures[captureIndex] }; } } function scan(regexp) { var captures, blankCaptures; blankCaptures = /^[\n\r\t\s]+/.exec(input); if (blankCaptures) { consume(blankCaptures[0].length); } captures = regexp.exec(input); if (captures) { consume(captures[0].length); } return captures; } function consume(size) { input = input.substr(size); } return function(code) { input = code.toString(); return getAST(); }; })(); exports.parse = (GradientParser || {}).parse; /***/ }), /***/ 9664: /***/ ((module) => { module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __nested_webpack_require_187__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_187__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __nested_webpack_require_187__.m = modules; /******/ /******/ // expose the module cache /******/ __nested_webpack_require_187__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __nested_webpack_require_187__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __nested_webpack_require_187__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __nested_webpack_require_1468__) { module.exports = __nested_webpack_require_1468__(1); /***/ }), /* 1 */ /***/ (function(module, exports, __nested_webpack_require_1587__) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _utils = __nested_webpack_require_1587__(2); Object.defineProperty(exports, 'combineChunks', { enumerable: true, get: function get() { return _utils.combineChunks; } }); Object.defineProperty(exports, 'fillInChunks', { enumerable: true, get: function get() { return _utils.fillInChunks; } }); Object.defineProperty(exports, 'findAll', { enumerable: true, get: function get() { return _utils.findAll; } }); Object.defineProperty(exports, 'findChunks', { enumerable: true, get: function get() { return _utils.findChunks; } }); /***/ }), /* 2 */ /***/ (function(module, exports) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); /** * Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word. * @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean }) */ var findAll = exports.findAll = function findAll(_ref) { var autoEscape = _ref.autoEscape, _ref$caseSensitive = _ref.caseSensitive, caseSensitive = _ref$caseSensitive === undefined ? false : _ref$caseSensitive, _ref$findChunks = _ref.findChunks, findChunks = _ref$findChunks === undefined ? defaultFindChunks : _ref$findChunks, sanitize = _ref.sanitize, searchWords = _ref.searchWords, textToHighlight = _ref.textToHighlight; return fillInChunks({ chunksToHighlight: combineChunks({ chunks: findChunks({ autoEscape: autoEscape, caseSensitive: caseSensitive, sanitize: sanitize, searchWords: searchWords, textToHighlight: textToHighlight }) }), totalLength: textToHighlight ? textToHighlight.length : 0 }); }; /** * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks. * @return {start:number, end:number}[] */ var combineChunks = exports.combineChunks = function combineChunks(_ref2) { var chunks = _ref2.chunks; chunks = chunks.sort(function (first, second) { return first.start - second.start; }).reduce(function (processedChunks, nextChunk) { // First chunk just goes straight in the array... if (processedChunks.length === 0) { return [nextChunk]; } else { // ... subsequent chunks get checked to see if they overlap... var prevChunk = processedChunks.pop(); if (nextChunk.start <= prevChunk.end) { // It may be the case that prevChunk completely surrounds nextChunk, so take the // largest of the end indeces. var endIndex = Math.max(prevChunk.end, nextChunk.end); processedChunks.push({ highlight: false, start: prevChunk.start, end: endIndex }); } else { processedChunks.push(prevChunk, nextChunk); } return processedChunks; } }, []); return chunks; }; /** * Examine text for any matches. * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}). * @return {start:number, end:number}[] */ var defaultFindChunks = function defaultFindChunks(_ref3) { var autoEscape = _ref3.autoEscape, caseSensitive = _ref3.caseSensitive, _ref3$sanitize = _ref3.sanitize, sanitize = _ref3$sanitize === undefined ? defaultSanitize : _ref3$sanitize, searchWords = _ref3.searchWords, textToHighlight = _ref3.textToHighlight; textToHighlight = sanitize(textToHighlight); return searchWords.filter(function (searchWord) { return searchWord; }) // Remove empty words .reduce(function (chunks, searchWord) { searchWord = sanitize(searchWord); if (autoEscape) { searchWord = escapeRegExpFn(searchWord); } var regex = new RegExp(searchWord, caseSensitive ? 'g' : 'gi'); var match = void 0; while (match = regex.exec(textToHighlight)) { var _start = match.index; var _end = regex.lastIndex; // We do not return zero-length matches if (_end > _start) { chunks.push({ highlight: false, start: _start, end: _end }); } // Prevent browsers like Firefox from getting stuck in an infinite loop // See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/ if (match.index === regex.lastIndex) { regex.lastIndex++; } } return chunks; }, []); }; // Allow the findChunks to be overridden in findAll, // but for backwards compatibility we export as the old name exports.findChunks = defaultFindChunks; /** * Given a set of chunks to highlight, create an additional set of chunks * to represent the bits of text between the highlighted text. * @param chunksToHighlight {start:number, end:number}[] * @param totalLength number * @return {start:number, end:number, highlight:boolean}[] */ var fillInChunks = exports.fillInChunks = function fillInChunks(_ref4) { var chunksToHighlight = _ref4.chunksToHighlight, totalLength = _ref4.totalLength; var allChunks = []; var append = function append(start, end, highlight) { if (end - start > 0) { allChunks.push({ start: start, end: end, highlight: highlight }); } }; if (chunksToHighlight.length === 0) { append(0, totalLength, false); } else { var lastIndex = 0; chunksToHighlight.forEach(function (chunk) { append(lastIndex, chunk.start, false); append(chunk.start, chunk.end, true); lastIndex = chunk.end; }); append(lastIndex, totalLength, false); } return allChunks; }; function defaultSanitize(string) { return string; } function escapeRegExpFn(string) { return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); } /***/ }) /******/ ]); /***/ }), /***/ 1880: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var reactIs = __webpack_require__(1178); /** * Copyright 2015, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ var REACT_STATICS = { childContextTypes: true, contextType: true, contextTypes: true, defaultProps: true, displayName: true, getDefaultProps: true, getDerivedStateFromError: true, getDerivedStateFromProps: true, mixins: true, propTypes: true, type: true }; var KNOWN_STATICS = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }; var FORWARD_REF_STATICS = { '$$typeof': true, render: true, defaultProps: true, displayName: true, propTypes: true }; var MEMO_STATICS = { '$$typeof': true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }; var TYPE_STATICS = {}; TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; function getStatics(component) { // React v16.11 and below if (reactIs.isMemo(component)) { return MEMO_STATICS; } // React v16.12 and above return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; } var defineProperty = Object.defineProperty; var getOwnPropertyNames = Object.getOwnPropertyNames; var getOwnPropertySymbols = Object.getOwnPropertySymbols; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var getPrototypeOf = Object.getPrototypeOf; var objectPrototype = Object.prototype; function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components if (objectPrototype) { var inheritedComponent = getPrototypeOf(sourceComponent); if (inheritedComponent && inheritedComponent !== objectPrototype) { hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); } } var keys = getOwnPropertyNames(sourceComponent); if (getOwnPropertySymbols) { keys = keys.concat(getOwnPropertySymbols(sourceComponent)); } var targetStatics = getStatics(targetComponent); var sourceStatics = getStatics(sourceComponent); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { var descriptor = getOwnPropertyDescriptor(sourceComponent, key); try { // Avoid failures from read-only properties defineProperty(targetComponent, key, descriptor); } catch (e) {} } } } return targetComponent; } module.exports = hoistNonReactStatics; /***/ }), /***/ 2950: /***/ ((__unused_webpack_module, exports) => { "use strict"; /** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b? Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119; function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d; exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t}; exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p}; exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z; /***/ }), /***/ 1178: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (true) { module.exports = __webpack_require__(2950); } else {} /***/ }), /***/ 628: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = __webpack_require__(4067); function emptyFunction() {} function emptyFunctionWithReset() {} emptyFunctionWithReset.resetWarningCache = emptyFunction; module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret) { // It is still safe when called from React. return; } var err = new Error( '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' ); err.name = 'Invariant Violation'; throw err; }; shim.isRequired = shim; function getShim() { return shim; }; // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bigint: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, elementType: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim, checkPropTypes: emptyFunctionWithReset, resetWarningCache: emptyFunction }; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /***/ }), /***/ 5826: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (false) { var throwOnDirectAccess, ReactIs; } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod module.exports = __webpack_require__(628)(); } /***/ }), /***/ 4067: /***/ ((module) => { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; /***/ }), /***/ 3394: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var f=__webpack_require__(1609),k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0}; function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q; /***/ }), /***/ 4922: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (true) { module.exports = __webpack_require__(3394); } else {} /***/ }), /***/ 9681: /***/ ((module) => { var characterMap = { "À": "A", "Á": "A", "Â": "A", "Ã": "A", "Ä": "A", "Å": "A", "Ấ": "A", "Ắ": "A", "Ẳ": "A", "Ẵ": "A", "Ặ": "A", "Æ": "AE", "Ầ": "A", "Ằ": "A", "Ȃ": "A", "Ả": "A", "Ạ": "A", "Ẩ": "A", "Ẫ": "A", "Ậ": "A", "Ç": "C", "Ḉ": "C", "È": "E", "É": "E", "Ê": "E", "Ë": "E", "Ế": "E", "Ḗ": "E", "Ề": "E", "Ḕ": "E", "Ḝ": "E", "Ȇ": "E", "Ẻ": "E", "Ẽ": "E", "Ẹ": "E", "Ể": "E", "Ễ": "E", "Ệ": "E", "Ì": "I", "Í": "I", "Î": "I", "Ï": "I", "Ḯ": "I", "Ȋ": "I", "Ỉ": "I", "Ị": "I", "Ð": "D", "Ñ": "N", "Ò": "O", "Ó": "O", "Ô": "O", "Õ": "O", "Ö": "O", "Ø": "O", "Ố": "O", "Ṍ": "O", "Ṓ": "O", "Ȏ": "O", "Ỏ": "O", "Ọ": "O", "Ổ": "O", "Ỗ": "O", "Ộ": "O", "Ờ": "O", "Ở": "O", "Ỡ": "O", "Ớ": "O", "Ợ": "O", "Ù": "U", "Ú": "U", "Û": "U", "Ü": "U", "Ủ": "U", "Ụ": "U", "Ử": "U", "Ữ": "U", "Ự": "U", "Ý": "Y", "à": "a", "á": "a", "â": "a", "ã": "a", "ä": "a", "å": "a", "ấ": "a", "ắ": "a", "ẳ": "a", "ẵ": "a", "ặ": "a", "æ": "ae", "ầ": "a", "ằ": "a", "ȃ": "a", "ả": "a", "ạ": "a", "ẩ": "a", "ẫ": "a", "ậ": "a", "ç": "c", "ḉ": "c", "è": "e", "é": "e", "ê": "e", "ë": "e", "ế": "e", "ḗ": "e", "ề": "e", "ḕ": "e", "ḝ": "e", "ȇ": "e", "ẻ": "e", "ẽ": "e", "ẹ": "e", "ể": "e", "ễ": "e", "ệ": "e", "ì": "i", "í": "i", "î": "i", "ï": "i", "ḯ": "i", "ȋ": "i", "ỉ": "i", "ị": "i", "ð": "d", "ñ": "n", "ò": "o", "ó": "o", "ô": "o", "õ": "o", "ö": "o", "ø": "o", "ố": "o", "ṍ": "o", "ṓ": "o", "ȏ": "o", "ỏ": "o", "ọ": "o", "ổ": "o", "ỗ": "o", "ộ": "o", "ờ": "o", "ở": "o", "ỡ": "o", "ớ": "o", "ợ": "o", "ù": "u", "ú": "u", "û": "u", "ü": "u", "ủ": "u", "ụ": "u", "ử": "u", "ữ": "u", "ự": "u", "ý": "y", "ÿ": "y", "Ā": "A", "ā": "a", "Ă": "A", "ă": "a", "Ą": "A", "ą": "a", "Ć": "C", "ć": "c", "Ĉ": "C", "ĉ": "c", "Ċ": "C", "ċ": "c", "Č": "C", "č": "c", "C̆": "C", "c̆": "c", "Ď": "D", "ď": "d", "Đ": "D", "đ": "d", "Ē": "E", "ē": "e", "Ĕ": "E", "ĕ": "e", "Ė": "E", "ė": "e", "Ę": "E", "ę": "e", "Ě": "E", "ě": "e", "Ĝ": "G", "Ǵ": "G", "ĝ": "g", "ǵ": "g", "Ğ": "G", "ğ": "g", "Ġ": "G", "ġ": "g", "Ģ": "G", "ģ": "g", "Ĥ": "H", "ĥ": "h", "Ħ": "H", "ħ": "h", "Ḫ": "H", "ḫ": "h", "Ĩ": "I", "ĩ": "i", "Ī": "I", "ī": "i", "Ĭ": "I", "ĭ": "i", "Į": "I", "į": "i", "İ": "I", "ı": "i", "IJ": "IJ", "ij": "ij", "Ĵ": "J", "ĵ": "j", "Ķ": "K", "ķ": "k", "Ḱ": "K", "ḱ": "k", "K̆": "K", "k̆": "k", "Ĺ": "L", "ĺ": "l", "Ļ": "L", "ļ": "l", "Ľ": "L", "ľ": "l", "Ŀ": "L", "ŀ": "l", "Ł": "l", "ł": "l", "Ḿ": "M", "ḿ": "m", "M̆": "M", "m̆": "m", "Ń": "N", "ń": "n", "Ņ": "N", "ņ": "n", "Ň": "N", "ň": "n", "ʼn": "n", "N̆": "N", "n̆": "n", "Ō": "O", "ō": "o", "Ŏ": "O", "ŏ": "o", "Ő": "O", "ő": "o", "Œ": "OE", "œ": "oe", "P̆": "P", "p̆": "p", "Ŕ": "R", "ŕ": "r", "Ŗ": "R", "ŗ": "r", "Ř": "R", "ř": "r", "R̆": "R", "r̆": "r", "Ȓ": "R", "ȓ": "r", "Ś": "S", "ś": "s", "Ŝ": "S", "ŝ": "s", "Ş": "S", "Ș": "S", "ș": "s", "ş": "s", "Š": "S", "š": "s", "Ţ": "T", "ţ": "t", "ț": "t", "Ț": "T", "Ť": "T", "ť": "t", "Ŧ": "T", "ŧ": "t", "T̆": "T", "t̆": "t", "Ũ": "U", "ũ": "u", "Ū": "U", "ū": "u", "Ŭ": "U", "ŭ": "u", "Ů": "U", "ů": "u", "Ű": "U", "ű": "u", "Ų": "U", "ų": "u", "Ȗ": "U", "ȗ": "u", "V̆": "V", "v̆": "v", "Ŵ": "W", "ŵ": "w", "Ẃ": "W", "ẃ": "w", "X̆": "X", "x̆": "x", "Ŷ": "Y", "ŷ": "y", "Ÿ": "Y", "Y̆": "Y", "y̆": "y", "Ź": "Z", "ź": "z", "Ż": "Z", "ż": "z", "Ž": "Z", "ž": "z", "ſ": "s", "ƒ": "f", "Ơ": "O", "ơ": "o", "Ư": "U", "ư": "u", "Ǎ": "A", "ǎ": "a", "Ǐ": "I", "ǐ": "i", "Ǒ": "O", "ǒ": "o", "Ǔ": "U", "ǔ": "u", "Ǖ": "U", "ǖ": "u", "Ǘ": "U", "ǘ": "u", "Ǚ": "U", "ǚ": "u", "Ǜ": "U", "ǜ": "u", "Ứ": "U", "ứ": "u", "Ṹ": "U", "ṹ": "u", "Ǻ": "A", "ǻ": "a", "Ǽ": "AE", "ǽ": "ae", "Ǿ": "O", "ǿ": "o", "Þ": "TH", "þ": "th", "Ṕ": "P", "ṕ": "p", "Ṥ": "S", "ṥ": "s", "X́": "X", "x́": "x", "Ѓ": "Г", "ѓ": "г", "Ќ": "К", "ќ": "к", "A̋": "A", "a̋": "a", "E̋": "E", "e̋": "e", "I̋": "I", "i̋": "i", "Ǹ": "N", "ǹ": "n", "Ồ": "O", "ồ": "o", "Ṑ": "O", "ṑ": "o", "Ừ": "U", "ừ": "u", "Ẁ": "W", "ẁ": "w", "Ỳ": "Y", "ỳ": "y", "Ȁ": "A", "ȁ": "a", "Ȅ": "E", "ȅ": "e", "Ȉ": "I", "ȉ": "i", "Ȍ": "O", "ȍ": "o", "Ȑ": "R", "ȑ": "r", "Ȕ": "U", "ȕ": "u", "B̌": "B", "b̌": "b", "Č̣": "C", "č̣": "c", "Ê̌": "E", "ê̌": "e", "F̌": "F", "f̌": "f", "Ǧ": "G", "ǧ": "g", "Ȟ": "H", "ȟ": "h", "J̌": "J", "ǰ": "j", "Ǩ": "K", "ǩ": "k", "M̌": "M", "m̌": "m", "P̌": "P", "p̌": "p", "Q̌": "Q", "q̌": "q", "Ř̩": "R", "ř̩": "r", "Ṧ": "S", "ṧ": "s", "V̌": "V", "v̌": "v", "W̌": "W", "w̌": "w", "X̌": "X", "x̌": "x", "Y̌": "Y", "y̌": "y", "A̧": "A", "a̧": "a", "B̧": "B", "b̧": "b", "Ḑ": "D", "ḑ": "d", "Ȩ": "E", "ȩ": "e", "Ɛ̧": "E", "ɛ̧": "e", "Ḩ": "H", "ḩ": "h", "I̧": "I", "i̧": "i", "Ɨ̧": "I", "ɨ̧": "i", "M̧": "M", "m̧": "m", "O̧": "O", "o̧": "o", "Q̧": "Q", "q̧": "q", "U̧": "U", "u̧": "u", "X̧": "X", "x̧": "x", "Z̧": "Z", "z̧": "z", "й":"и", "Й":"И", "ё":"е", "Ё":"Е", }; var chars = Object.keys(characterMap).join('|'); var allAccents = new RegExp(chars, 'g'); var firstAccent = new RegExp(chars, ''); function matcher(match) { return characterMap[match]; } var removeAccents = function(string) { return string.replace(allAccents, matcher); }; var hasAccents = function(string) { return !!string.match(firstAccent); }; module.exports = removeAccents; module.exports.has = hasAccents; module.exports.remove = removeAccents; /***/ }), /***/ 8477: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var e=__webpack_require__(1609);function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d} function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u; /***/ }), /***/ 422: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (true) { module.exports = __webpack_require__(8477); } else {} /***/ }), /***/ 1609: /***/ ((module) => { "use strict"; module.exports = window["React"]; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/create fake namespace object */ /******/ (() => { /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); /******/ var leafPrototypes; /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 16: return value when it's Promise-like /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = this(value); /******/ if(mode & 8) return value; /******/ if(typeof value === 'object' && value) { /******/ if((mode & 4) && value.__esModule) return value; /******/ if((mode & 16) && typeof value.then === 'function') return value; /******/ } /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ var def = {}; /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); /******/ } /******/ def['default'] = () => (value); /******/ __webpack_require__.d(ns, def); /******/ return ns; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/nonce */ /******/ (() => { /******/ __webpack_require__.nc = undefined; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be in strict mode. (() => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { AnglePickerControl: () => (/* reexport */ angle_picker_control), Animate: () => (/* reexport */ animate), Autocomplete: () => (/* reexport */ Autocomplete), BaseControl: () => (/* reexport */ base_control), BlockQuotation: () => (/* reexport */ external_wp_primitives_namespaceObject.BlockQuotation), Button: () => (/* reexport */ build_module_button), ButtonGroup: () => (/* reexport */ button_group), Card: () => (/* reexport */ card_component), CardBody: () => (/* reexport */ card_body_component), CardDivider: () => (/* reexport */ card_divider_component), CardFooter: () => (/* reexport */ card_footer_component), CardHeader: () => (/* reexport */ card_header_component), CardMedia: () => (/* reexport */ card_media_component), CheckboxControl: () => (/* reexport */ checkbox_control), Circle: () => (/* reexport */ external_wp_primitives_namespaceObject.Circle), ClipboardButton: () => (/* reexport */ ClipboardButton), ColorIndicator: () => (/* reexport */ color_indicator), ColorPalette: () => (/* reexport */ color_palette), ColorPicker: () => (/* reexport */ LegacyAdapter), ComboboxControl: () => (/* reexport */ combobox_control), CustomGradientPicker: () => (/* reexport */ custom_gradient_picker), CustomSelectControl: () => (/* reexport */ StableCustomSelectControl), Dashicon: () => (/* reexport */ dashicon), DatePicker: () => (/* reexport */ date), DateTimePicker: () => (/* reexport */ build_module_date_time), Disabled: () => (/* reexport */ disabled), Draggable: () => (/* reexport */ draggable), DropZone: () => (/* reexport */ drop_zone), DropZoneProvider: () => (/* reexport */ DropZoneProvider), Dropdown: () => (/* reexport */ dropdown), DropdownMenu: () => (/* reexport */ dropdown_menu), DuotonePicker: () => (/* reexport */ duotone_picker), DuotoneSwatch: () => (/* reexport */ duotone_swatch), ExternalLink: () => (/* reexport */ external_link), Fill: () => (/* reexport */ slot_fill_Fill), Flex: () => (/* reexport */ flex_component), FlexBlock: () => (/* reexport */ flex_block_component), FlexItem: () => (/* reexport */ flex_item_component), FocalPointPicker: () => (/* reexport */ focal_point_picker), FocusReturnProvider: () => (/* reexport */ with_focus_return_Provider), FocusableIframe: () => (/* reexport */ FocusableIframe), FontSizePicker: () => (/* reexport */ font_size_picker), FormFileUpload: () => (/* reexport */ form_file_upload), FormToggle: () => (/* reexport */ form_toggle), FormTokenField: () => (/* reexport */ form_token_field), G: () => (/* reexport */ external_wp_primitives_namespaceObject.G), GradientPicker: () => (/* reexport */ gradient_picker), Guide: () => (/* reexport */ guide), GuidePage: () => (/* reexport */ GuidePage), HorizontalRule: () => (/* reexport */ external_wp_primitives_namespaceObject.HorizontalRule), Icon: () => (/* reexport */ build_module_icon), IconButton: () => (/* reexport */ deprecated), IsolatedEventContainer: () => (/* reexport */ isolated_event_container), KeyboardShortcuts: () => (/* reexport */ keyboard_shortcuts), Line: () => (/* reexport */ external_wp_primitives_namespaceObject.Line), MenuGroup: () => (/* reexport */ menu_group), MenuItem: () => (/* reexport */ menu_item), MenuItemsChoice: () => (/* reexport */ menu_items_choice), Modal: () => (/* reexport */ modal), NavigableMenu: () => (/* reexport */ navigable_container_menu), Notice: () => (/* reexport */ build_module_notice), NoticeList: () => (/* reexport */ list), Panel: () => (/* reexport */ panel), PanelBody: () => (/* reexport */ body), PanelHeader: () => (/* reexport */ panel_header), PanelRow: () => (/* reexport */ row), Path: () => (/* reexport */ external_wp_primitives_namespaceObject.Path), Placeholder: () => (/* reexport */ placeholder), Polygon: () => (/* reexport */ external_wp_primitives_namespaceObject.Polygon), Popover: () => (/* reexport */ popover), QueryControls: () => (/* reexport */ query_controls), RadioControl: () => (/* reexport */ radio_control), RangeControl: () => (/* reexport */ range_control), Rect: () => (/* reexport */ external_wp_primitives_namespaceObject.Rect), ResizableBox: () => (/* reexport */ resizable_box), ResponsiveWrapper: () => (/* reexport */ responsive_wrapper), SVG: () => (/* reexport */ external_wp_primitives_namespaceObject.SVG), SandBox: () => (/* reexport */ sandbox), ScrollLock: () => (/* reexport */ scroll_lock), SearchControl: () => (/* reexport */ search_control), SelectControl: () => (/* reexport */ select_control), Slot: () => (/* reexport */ slot_fill_Slot), SlotFillProvider: () => (/* reexport */ Provider), Snackbar: () => (/* reexport */ snackbar), SnackbarList: () => (/* reexport */ snackbar_list), Spinner: () => (/* reexport */ spinner), TabPanel: () => (/* reexport */ tab_panel), TabbableContainer: () => (/* reexport */ tabbable), TextControl: () => (/* reexport */ text_control), TextHighlight: () => (/* reexport */ text_highlight), TextareaControl: () => (/* reexport */ textarea_control), TimePicker: () => (/* reexport */ time), Tip: () => (/* reexport */ build_module_tip), ToggleControl: () => (/* reexport */ toggle_control), Toolbar: () => (/* reexport */ toolbar), ToolbarButton: () => (/* reexport */ toolbar_button), ToolbarDropdownMenu: () => (/* reexport */ toolbar_dropdown_menu), ToolbarGroup: () => (/* reexport */ toolbar_group), ToolbarItem: () => (/* reexport */ toolbar_item), Tooltip: () => (/* reexport */ tooltip), TreeSelect: () => (/* reexport */ tree_select), VisuallyHidden: () => (/* reexport */ visually_hidden_component), __experimentalAlignmentMatrixControl: () => (/* reexport */ alignment_matrix_control), __experimentalApplyValueToSides: () => (/* reexport */ applyValueToSides), __experimentalBorderBoxControl: () => (/* reexport */ border_box_control_component), __experimentalBorderControl: () => (/* reexport */ border_control_component), __experimentalBoxControl: () => (/* reexport */ box_control), __experimentalConfirmDialog: () => (/* reexport */ confirm_dialog_component), __experimentalDimensionControl: () => (/* reexport */ dimension_control), __experimentalDivider: () => (/* reexport */ divider_component), __experimentalDropdownContentWrapper: () => (/* reexport */ dropdown_content_wrapper), __experimentalElevation: () => (/* reexport */ elevation_component), __experimentalGrid: () => (/* reexport */ grid_component), __experimentalHStack: () => (/* reexport */ h_stack_component), __experimentalHasSplitBorders: () => (/* reexport */ hasSplitBorders), __experimentalHeading: () => (/* reexport */ heading_component), __experimentalInputControl: () => (/* reexport */ input_control), __experimentalInputControlPrefixWrapper: () => (/* reexport */ input_prefix_wrapper), __experimentalInputControlSuffixWrapper: () => (/* reexport */ input_suffix_wrapper), __experimentalIsDefinedBorder: () => (/* reexport */ isDefinedBorder), __experimentalIsEmptyBorder: () => (/* reexport */ isEmptyBorder), __experimentalItem: () => (/* reexport */ item_component), __experimentalItemGroup: () => (/* reexport */ item_group_component), __experimentalNavigation: () => (/* reexport */ navigation), __experimentalNavigationBackButton: () => (/* reexport */ back_button), __experimentalNavigationGroup: () => (/* reexport */ group), __experimentalNavigationItem: () => (/* reexport */ navigation_item), __experimentalNavigationMenu: () => (/* reexport */ navigation_menu), __experimentalNavigatorBackButton: () => (/* reexport */ navigator_back_button_component), __experimentalNavigatorButton: () => (/* reexport */ navigator_button_component), __experimentalNavigatorProvider: () => (/* reexport */ navigator_provider_component), __experimentalNavigatorScreen: () => (/* reexport */ navigator_screen_component), __experimentalNavigatorToParentButton: () => (/* reexport */ navigator_to_parent_button_component), __experimentalNumberControl: () => (/* reexport */ number_control), __experimentalPaletteEdit: () => (/* reexport */ palette_edit), __experimentalParseQuantityAndUnitFromRawValue: () => (/* reexport */ parseQuantityAndUnitFromRawValue), __experimentalRadio: () => (/* reexport */ radio_group_radio), __experimentalRadioGroup: () => (/* reexport */ radio_group), __experimentalScrollable: () => (/* reexport */ scrollable_component), __experimentalSpacer: () => (/* reexport */ spacer_component), __experimentalStyleProvider: () => (/* reexport */ style_provider), __experimentalSurface: () => (/* reexport */ surface_component), __experimentalText: () => (/* reexport */ text_component), __experimentalToggleGroupControl: () => (/* reexport */ toggle_group_control_component), __experimentalToggleGroupControlOption: () => (/* reexport */ toggle_group_control_option_component), __experimentalToggleGroupControlOptionIcon: () => (/* reexport */ toggle_group_control_option_icon_component), __experimentalToolbarContext: () => (/* reexport */ toolbar_context), __experimentalToolsPanel: () => (/* reexport */ tools_panel_component), __experimentalToolsPanelContext: () => (/* reexport */ ToolsPanelContext), __experimentalToolsPanelItem: () => (/* reexport */ tools_panel_item_component), __experimentalTreeGrid: () => (/* reexport */ tree_grid), __experimentalTreeGridCell: () => (/* reexport */ cell), __experimentalTreeGridItem: () => (/* reexport */ tree_grid_item), __experimentalTreeGridRow: () => (/* reexport */ tree_grid_row), __experimentalTruncate: () => (/* reexport */ truncate_component), __experimentalUnitControl: () => (/* reexport */ unit_control), __experimentalUseCustomUnits: () => (/* reexport */ useCustomUnits), __experimentalUseNavigator: () => (/* reexport */ use_navigator), __experimentalUseSlot: () => (/* reexport */ useSlot), __experimentalUseSlotFills: () => (/* reexport */ useSlotFills), __experimentalVStack: () => (/* reexport */ v_stack_component), __experimentalView: () => (/* reexport */ component), __experimentalZStack: () => (/* reexport */ z_stack_component), __unstableAnimatePresence: () => (/* reexport */ AnimatePresence), __unstableComposite: () => (/* reexport */ legacy_Composite), __unstableCompositeGroup: () => (/* reexport */ legacy_CompositeGroup), __unstableCompositeItem: () => (/* reexport */ legacy_CompositeItem), __unstableDisclosureContent: () => (/* reexport */ disclosure_DisclosureContent), __unstableGetAnimateClassName: () => (/* reexport */ getAnimateClassName), __unstableMotion: () => (/* reexport */ motion), __unstableMotionContext: () => (/* reexport */ MotionContext), __unstableUseAutocompleteProps: () => (/* reexport */ useAutocompleteProps), __unstableUseCompositeState: () => (/* reexport */ useCompositeState), __unstableUseNavigateRegions: () => (/* reexport */ useNavigateRegions), createSlotFill: () => (/* reexport */ createSlotFill), navigateRegions: () => (/* reexport */ navigate_regions), privateApis: () => (/* reexport */ privateApis), useBaseControlProps: () => (/* reexport */ useBaseControlProps), withConstrainedTabbing: () => (/* reexport */ with_constrained_tabbing), withFallbackStyles: () => (/* reexport */ with_fallback_styles), withFilters: () => (/* reexport */ withFilters), withFocusOutside: () => (/* reexport */ with_focus_outside), withFocusReturn: () => (/* reexport */ with_focus_return), withNotices: () => (/* reexport */ with_notices), withSpokenMessages: () => (/* reexport */ with_spoken_messages) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/text/styles.js var text_styles_namespaceObject = {}; __webpack_require__.r(text_styles_namespaceObject); __webpack_require__.d(text_styles_namespaceObject, { Text: () => (Text), block: () => (styles_block), destructive: () => (destructive), highlighterText: () => (highlighterText), muted: () => (muted), positive: () => (positive), upperCase: () => (upperCase) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option-base/styles.js var toggle_group_control_option_base_styles_namespaceObject = {}; __webpack_require__.r(toggle_group_control_option_base_styles_namespaceObject); __webpack_require__.d(toggle_group_control_option_base_styles_namespaceObject, { ButtonContentView: () => (ButtonContentView), LabelView: () => (LabelView), ou: () => (backdropView), uG: () => (buttonView), eh: () => (labelBlock) }); ;// CONCATENATED MODULE: external ["wp","primitives"] const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; // EXTERNAL MODULE: external "React" var external_React_ = __webpack_require__(1609); var external_React_namespaceObject = /*#__PURE__*/__webpack_require__.t(external_React_, 2); var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_); // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__(5755); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); ;// CONCATENATED MODULE: external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// CONCATENATED MODULE: external ["wp","compose"] const external_wp_compose_namespaceObject = window["wp"]["compose"]; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/SHA3WOPI.js "use client"; // src/focusable/focusable-context.ts var FocusableContext = (0,external_React_.createContext)(true); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/4R3V3JGP.js "use client"; var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var _4R3V3JGP_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var _4R3V3JGP_spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __objRest = (source, exclude) => { var target = {}; for (var prop in source) if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && __getOwnPropSymbols) for (var prop of __getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/4R3V3JGP.js "use client"; var _4R3V3JGP_defProp = Object.defineProperty; var _4R3V3JGP_defProps = Object.defineProperties; var _4R3V3JGP_getOwnPropDescs = Object.getOwnPropertyDescriptors; var _4R3V3JGP_getOwnPropSymbols = Object.getOwnPropertySymbols; var _4R3V3JGP_hasOwnProp = Object.prototype.hasOwnProperty; var _4R3V3JGP_propIsEnum = Object.prototype.propertyIsEnumerable; var _4R3V3JGP_defNormalProp = (obj, key, value) => key in obj ? _4R3V3JGP_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var _chunks_4R3V3JGP_spreadValues = (a, b) => { for (var prop in b || (b = {})) if (_4R3V3JGP_hasOwnProp.call(b, prop)) _4R3V3JGP_defNormalProp(a, prop, b[prop]); if (_4R3V3JGP_getOwnPropSymbols) for (var prop of _4R3V3JGP_getOwnPropSymbols(b)) { if (_4R3V3JGP_propIsEnum.call(b, prop)) _4R3V3JGP_defNormalProp(a, prop, b[prop]); } return a; }; var _chunks_4R3V3JGP_spreadProps = (a, b) => _4R3V3JGP_defProps(a, _4R3V3JGP_getOwnPropDescs(b)); var _4R3V3JGP_objRest = (source, exclude) => { var target = {}; for (var prop in source) if (_4R3V3JGP_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && _4R3V3JGP_getOwnPropSymbols) for (var prop of _4R3V3JGP_getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && _4R3V3JGP_propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/Y3OOHFCN.js "use client"; // src/utils/misc.ts function noop(..._) { } function shallowEqual(a, b) { if (a === b) return true; if (!a) return false; if (!b) return false; if (typeof a !== "object") return false; if (typeof b !== "object") return false; const aKeys = Object.keys(a); const bKeys = Object.keys(b); const { length } = aKeys; if (bKeys.length !== length) return false; for (const key of aKeys) { if (a[key] !== b[key]) { return false; } } return true; } function Y3OOHFCN_applyState(argument, currentValue) { if (isUpdater(argument)) { const value = isLazyValue(currentValue) ? currentValue() : currentValue; return argument(value); } return argument; } function isUpdater(argument) { return typeof argument === "function"; } function isLazyValue(value) { return typeof value === "function"; } function isObject(arg) { return typeof arg === "object" && arg != null; } function isEmpty(arg) { if (Array.isArray(arg)) return !arg.length; if (isObject(arg)) return !Object.keys(arg).length; if (arg == null) return true; if (arg === "") return true; return false; } function isInteger(arg) { if (typeof arg === "number") { return Math.floor(arg) === arg; } return String(Math.floor(Number(arg))) === arg; } function Y3OOHFCN_hasOwnProperty(object, prop) { if (typeof Object.hasOwn === "function") { return Object.hasOwn(object, prop); } return Object.prototype.hasOwnProperty.call(object, prop); } function chain(...fns) { return (...args) => { for (const fn of fns) { if (typeof fn === "function") { fn(...args); } } }; } function cx(...args) { return args.filter(Boolean).join(" ") || void 0; } function normalizeString(str) { return str.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); } function omit(object, keys) { const result = _chunks_4R3V3JGP_spreadValues({}, object); for (const key of keys) { if (Y3OOHFCN_hasOwnProperty(result, key)) { delete result[key]; } } return result; } function pick(object, paths) { const result = {}; for (const key of paths) { if (Y3OOHFCN_hasOwnProperty(object, key)) { result[key] = object[key]; } } return result; } function identity(value) { return value; } function beforePaint(cb = noop) { const raf = requestAnimationFrame(cb); return () => cancelAnimationFrame(raf); } function afterPaint(cb = noop) { let raf = requestAnimationFrame(() => { raf = requestAnimationFrame(cb); }); return () => cancelAnimationFrame(raf); } function invariant(condition, message) { if (condition) return; if (typeof message !== "string") throw new Error("Invariant failed"); throw new Error(message); } function getKeys(obj) { return Object.keys(obj); } function isFalsyBooleanCallback(booleanOrCallback, ...args) { const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback; if (result == null) return false; return !result; } function disabledFromProps(props) { return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true"; } function defaultValue(...values) { for (const value of values) { if (value !== void 0) return value; } return void 0; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XM66DUTO.js "use client"; // src/utils/misc.ts function setRef(ref, value) { if (typeof ref === "function") { ref(value); } else if (ref) { ref.current = value; } } function isValidElementWithRef(element) { if (!element) return false; if (!(0,external_React_.isValidElement)(element)) return false; if (!("ref" in element)) return false; return true; } function getRefProperty(element) { if (!isValidElementWithRef(element)) return null; return element.ref; } function mergeProps(base, overrides) { const props = _4R3V3JGP_spreadValues({}, base); for (const key in overrides) { if (!Y3OOHFCN_hasOwnProperty(overrides, key)) continue; if (key === "className") { const prop = "className"; props[prop] = base[prop] ? `${base[prop]} ${overrides[prop]}` : overrides[prop]; continue; } if (key === "style") { const prop = "style"; props[prop] = base[prop] ? _4R3V3JGP_spreadValues(_4R3V3JGP_spreadValues({}, base[prop]), overrides[prop]) : overrides[prop]; continue; } const overrideValue = overrides[key]; if (typeof overrideValue === "function" && key.startsWith("on")) { const baseValue = base[key]; if (typeof baseValue === "function") { props[key] = (...args) => { overrideValue(...args); baseValue(...args); }; continue; } } props[key] = overrideValue; } return props; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/DLOEKDPY.js "use client"; // src/utils/dom.ts var canUseDOM = checkIsBrowser(); function checkIsBrowser() { var _a; return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement); } function DLOEKDPY_getDocument(node) { return node ? node.ownerDocument || node : document; } function getWindow(node) { return DLOEKDPY_getDocument(node).defaultView || window; } function getActiveElement(node, activeDescendant = false) { const { activeElement } = DLOEKDPY_getDocument(node); if (!(activeElement == null ? void 0 : activeElement.nodeName)) { return null; } if (isFrame(activeElement) && activeElement.contentDocument) { return getActiveElement( activeElement.contentDocument.body, activeDescendant ); } if (activeDescendant) { const id = activeElement.getAttribute("aria-activedescendant"); if (id) { const element = DLOEKDPY_getDocument(activeElement).getElementById(id); if (element) { return element; } } } return activeElement; } function contains(parent, child) { return parent === child || parent.contains(child); } function isFrame(element) { return element.tagName === "IFRAME"; } function isButton(element) { const tagName = element.tagName.toLowerCase(); if (tagName === "button") return true; if (tagName === "input" && element.type) { return buttonInputTypes.indexOf(element.type) !== -1; } return false; } var buttonInputTypes = [ "button", "color", "file", "image", "reset", "submit" ]; function matches(element, selectors) { if ("matches" in element) { return element.matches(selectors); } if ("msMatchesSelector" in element) { return element.msMatchesSelector(selectors); } return element.webkitMatchesSelector(selectors); } function isVisible(element) { const htmlElement = element; return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0; } function DLOEKDPY_closest(element, selectors) { if ("closest" in element) return element.closest(selectors); do { if (matches(element, selectors)) return element; element = element.parentElement || element.parentNode; } while (element !== null && element.nodeType === 1); return null; } function DLOEKDPY_isTextField(element) { try { const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null; const isTextArea = element.tagName === "TEXTAREA"; return isTextInput || isTextArea || false; } catch (error) { return false; } } function getPopupRole(element, fallback) { const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"]; const role = element == null ? void 0 : element.getAttribute("role"); if (role && allowedPopupRoles.indexOf(role) !== -1) { return role; } return fallback; } function getPopupItemRole(element, fallback) { var _a; const itemRoleByPopupRole = { menu: "menuitem", listbox: "option", tree: "treeitem", grid: "gridcell" }; const popupRole = getPopupRole(element); if (!popupRole) return fallback; const key = popupRole; return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback; } function getTextboxSelection(element) { let start = 0; let end = 0; if (DLOEKDPY_isTextField(element)) { start = element.selectionStart || 0; end = element.selectionEnd || 0; } else if (element.isContentEditable) { const selection = DLOEKDPY_getDocument(element).getSelection(); if ((selection == null ? void 0 : selection.rangeCount) && selection.anchorNode && contains(element, selection.anchorNode) && selection.focusNode && contains(element, selection.focusNode)) { const range = selection.getRangeAt(0); const nextRange = range.cloneRange(); nextRange.selectNodeContents(element); nextRange.setEnd(range.startContainer, range.startOffset); start = nextRange.toString().length; nextRange.setEnd(range.endContainer, range.endOffset); end = nextRange.toString().length; } } return { start, end }; } function scrollIntoViewIfNeeded(element, arg) { if (isPartiallyHidden(element) && "scrollIntoView" in element) { element.scrollIntoView(arg); } } function getScrollingElement(element) { if (!element) return null; if (element.clientHeight && element.scrollHeight > element.clientHeight) { const { overflowY } = getComputedStyle(element); const isScrollable = overflowY !== "visible" && overflowY !== "hidden"; if (isScrollable) return element; } else if (element.clientWidth && element.scrollWidth > element.clientWidth) { const { overflowX } = getComputedStyle(element); const isScrollable = overflowX !== "visible" && overflowX !== "hidden"; if (isScrollable) return element; } return getScrollingElement(element.parentElement) || document.scrollingElement || document.body; } function isPartiallyHidden(element) { const elementRect = element.getBoundingClientRect(); const scroller = getScrollingElement(element); if (!scroller) return false; const scrollerRect = scroller.getBoundingClientRect(); const isHTML = scroller.tagName === "HTML"; const scrollerTop = isHTML ? scrollerRect.top + scroller.scrollTop : scrollerRect.top; const scrollerBottom = isHTML ? scroller.clientHeight : scrollerRect.bottom; const scrollerLeft = isHTML ? scrollerRect.left + scroller.scrollLeft : scrollerRect.left; const scrollerRight = isHTML ? scroller.clientWidth : scrollerRect.right; const top = elementRect.top < scrollerTop; const left = elementRect.left < scrollerLeft; const bottom = elementRect.bottom > scrollerBottom; const right = elementRect.right > scrollerRight; return top || left || bottom || right; } function setSelectionRange(element, ...args) { if (/text|search|password|tel|url/i.test(element.type)) { element.setSelectionRange(...args); } } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/MHPO2BXA.js "use client"; // src/utils/platform.ts function isTouchDevice() { return canUseDOM && !!navigator.maxTouchPoints; } function isApple() { if (!canUseDOM) return false; return /mac|iphone|ipad|ipod/i.test(navigator.platform); } function isSafari() { return canUseDOM && isApple() && /apple/i.test(navigator.vendor); } function isFirefox() { return canUseDOM && /firefox\//i.test(navigator.userAgent); } function isMac() { return canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice(); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/utils/events.js "use client"; // src/utils/events.ts function isPortalEvent(event) { return Boolean( event.currentTarget && !contains(event.currentTarget, event.target) ); } function isSelfTarget(event) { return event.target === event.currentTarget; } function isOpeningInNewTab(event) { const element = event.currentTarget; if (!element) return false; const isAppleDevice = isApple(); if (isAppleDevice && !event.metaKey) return false; if (!isAppleDevice && !event.ctrlKey) return false; const tagName = element.tagName.toLowerCase(); if (tagName === "a") return true; if (tagName === "button" && element.type === "submit") return true; if (tagName === "input" && element.type === "submit") return true; return false; } function isDownloading(event) { const element = event.currentTarget; if (!element) return false; const tagName = element.tagName.toLowerCase(); if (!event.altKey) return false; if (tagName === "a") return true; if (tagName === "button" && element.type === "submit") return true; if (tagName === "input" && element.type === "submit") return true; return false; } function fireEvent(element, type, eventInit) { const event = new Event(type, eventInit); return element.dispatchEvent(event); } function fireBlurEvent(element, eventInit) { const event = new FocusEvent("blur", eventInit); const defaultAllowed = element.dispatchEvent(event); const bubbleInit = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, eventInit), { bubbles: true }); element.dispatchEvent(new FocusEvent("focusout", bubbleInit)); return defaultAllowed; } function fireFocusEvent(element, eventInit) { const event = new FocusEvent("focus", eventInit); const defaultAllowed = element.dispatchEvent(event); const bubbleInit = __spreadProps(__spreadValues({}, eventInit), { bubbles: true }); element.dispatchEvent(new FocusEvent("focusin", bubbleInit)); return defaultAllowed; } function fireKeyboardEvent(element, type, eventInit) { const event = new KeyboardEvent(type, eventInit); return element.dispatchEvent(event); } function fireClickEvent(element, eventInit) { const event = new MouseEvent("click", eventInit); return element.dispatchEvent(event); } function isFocusEventOutside(event, container) { const containerElement = container || event.currentTarget; const relatedTarget = event.relatedTarget; return !relatedTarget || !contains(containerElement, relatedTarget); } function queueBeforeEvent(element, type, callback) { const raf = requestAnimationFrame(() => { element.removeEventListener(type, callImmediately, true); callback(); }); const callImmediately = () => { cancelAnimationFrame(raf); callback(); }; element.addEventListener(type, callImmediately, { once: true, capture: true }); return raf; } function addGlobalEventListener(type, listener, options, scope = window) { const children = []; try { scope.document.addEventListener(type, listener, options); for (const frame of Array.from(scope.frames)) { children.push(addGlobalEventListener(type, listener, options, frame)); } } catch (e) { } const removeEventListener = () => { try { scope.document.removeEventListener(type, listener, options); } catch (e) { } children.forEach((remove) => remove()); }; return removeEventListener; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6O5OEQGF.js "use client"; // src/utils/hooks.ts var _React = _4R3V3JGP_spreadValues({}, external_React_namespaceObject); var useReactId = _React.useId; var useReactDeferredValue = _React.useDeferredValue; var useReactInsertionEffect = _React.useInsertionEffect; var useSafeLayoutEffect = canUseDOM ? external_React_.useLayoutEffect : external_React_.useEffect; function useInitialValue(value) { const [initialValue] = (0,external_React_.useState)(value); return initialValue; } function useLazyValue(init) { const ref = useRef(); if (ref.current === void 0) { ref.current = init(); } return ref.current; } function useLiveRef(value) { const ref = (0,external_React_.useRef)(value); useSafeLayoutEffect(() => { ref.current = value; }); return ref; } function usePreviousValue(value) { const [previousValue, setPreviousValue] = useState(value); if (value !== previousValue) { setPreviousValue(value); } return previousValue; } function useEvent(callback) { const ref = (0,external_React_.useRef)(() => { throw new Error("Cannot call an event handler while rendering."); }); if (useReactInsertionEffect) { useReactInsertionEffect(() => { ref.current = callback; }); } else { ref.current = callback; } return (0,external_React_.useCallback)((...args) => { var _a; return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args); }, []); } function useMergeRefs(...refs) { return (0,external_React_.useMemo)(() => { if (!refs.some(Boolean)) return; return (value) => { refs.forEach((ref) => setRef(ref, value)); }; }, refs); } function useRefId(ref, deps) { const [id, setId] = useState(void 0); useSafeLayoutEffect(() => { var _a; setId((_a = ref == null ? void 0 : ref.current) == null ? void 0 : _a.id); }, deps); return id; } function useId(defaultId) { if (useReactId) { const reactId = useReactId(); if (defaultId) return defaultId; return reactId; } const [id, setId] = (0,external_React_.useState)(defaultId); useSafeLayoutEffect(() => { if (defaultId || id) return; const random = Math.random().toString(36).substr(2, 6); setId(`id-${random}`); }, [defaultId, id]); return defaultId || id; } function useDeferredValue(value) { if (useReactDeferredValue) { return useReactDeferredValue(value); } const [deferredValue, setDeferredValue] = useState(value); useEffect(() => { const raf = requestAnimationFrame(() => setDeferredValue(value)); return () => cancelAnimationFrame(raf); }, [value]); return deferredValue; } function useTagName(refOrElement, type) { const stringOrUndefined = (type2) => { if (typeof type2 !== "string") return; return type2; }; const [tagName, setTagName] = (0,external_React_.useState)(() => stringOrUndefined(type)); useSafeLayoutEffect(() => { const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement; setTagName((element == null ? void 0 : element.tagName.toLowerCase()) || stringOrUndefined(type)); }, [refOrElement, type]); return tagName; } function useAttribute(refOrElement, attributeName, defaultValue) { const [attribute, setAttribute] = useState(defaultValue); useSafeLayoutEffect(() => { const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement; const value = element == null ? void 0 : element.getAttribute(attributeName); if (value == null) return; setAttribute(value); }, [refOrElement, attributeName]); return attribute; } function useUpdateEffect(effect, deps) { const mounted = (0,external_React_.useRef)(false); (0,external_React_.useEffect)(() => { if (mounted.current) { return effect(); } mounted.current = true; }, deps); (0,external_React_.useEffect)( () => () => { mounted.current = false; }, [] ); } function useUpdateLayoutEffect(effect, deps) { const mounted = useRef(false); useSafeLayoutEffect(() => { if (mounted.current) { return effect(); } mounted.current = true; }, deps); useSafeLayoutEffect( () => () => { mounted.current = false; }, [] ); } function useControlledState(defaultState, state, setState) { const [localState, setLocalState] = useState(defaultState); const nextState = state !== void 0 ? state : localState; const stateRef = useLiveRef(state); const setStateRef = useLiveRef(setState); const nextStateRef = useLiveRef(nextState); const setNextState = useCallback((prevValue) => { const setStateProp = setStateRef.current; if (setStateProp) { if (isSetNextState(setStateProp)) { setStateProp(prevValue); } else { const nextValue = applyState(prevValue, nextStateRef.current); nextStateRef.current = nextValue; setStateProp(nextValue); } } if (stateRef.current === void 0) { setLocalState(prevValue); } }, []); defineSetNextState(setNextState); return [nextState, setNextState]; } var SET_NEXT_STATE = Symbol("setNextState"); function isSetNextState(arg) { return arg[SET_NEXT_STATE] === true; } function defineSetNextState(arg) { if (!isSetNextState(arg)) { Object.defineProperty(arg, SET_NEXT_STATE, { value: true }); } } function useForceUpdate() { return (0,external_React_.useReducer)(() => [], []); } function useBooleanEvent(booleanOrCallback) { return useEvent( typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback ); } function useWrapElement(props, callback, deps = []) { const wrapElement = (0,external_React_.useCallback)( (element) => { if (props.wrapElement) { element = props.wrapElement(element); } return callback(element); }, [...deps, props.wrapElement] ); return _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { wrapElement }); } function usePortalRef(portalProp = false, portalRefProp) { const [portalNode, setPortalNode] = (0,external_React_.useState)(null); const portalRef = useMergeRefs(setPortalNode, portalRefProp); const domReady = !portalProp || portalNode; return { portalRef, portalNode, domReady }; } function useMetadataProps(props, key, value) { const parent = props.onLoadedMetadataCapture; const onLoadedMetadataCapture = (0,external_React_.useMemo)(() => { return Object.assign(() => { }, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, parent), { [key]: value })); }, [parent, key, value]); return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }]; } function useIsMouseMoving() { (0,external_React_.useEffect)(() => { addGlobalEventListener("mousemove", setMouseMoving, true); addGlobalEventListener("mousedown", resetMouseMoving, true); addGlobalEventListener("mouseup", resetMouseMoving, true); addGlobalEventListener("keydown", resetMouseMoving, true); addGlobalEventListener("scroll", resetMouseMoving, true); }, []); const isMouseMoving = useEvent(() => mouseMoving); return isMouseMoving; } var mouseMoving = false; var previousScreenX = 0; var previousScreenY = 0; function hasMouseMovement(event) { const movementX = event.movementX || event.screenX - previousScreenX; const movementY = event.movementY || event.screenY - previousScreenY; previousScreenX = event.screenX; previousScreenY = event.screenY; return movementX || movementY || "production" === "test"; } function setMouseMoving(event) { if (!hasMouseMovement(event)) return; mouseMoving = true; } function resetMouseMoving() { mouseMoving = false; } // EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4922); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/3ORBWXWF.js "use client"; // src/utils/system.tsx function isRenderProp(children) { return typeof children === "function"; } function forwardRef2(render) { const Role = React.forwardRef((props, ref) => render(__spreadProps(__spreadValues({}, props), { ref }))); Role.displayName = render.displayName || render.name; return Role; } function memo2(Component, propsAreEqual) { const Role = React.memo(Component, propsAreEqual); Role.displayName = Component.displayName || Component.name; return Role; } function createComponent(render) { const Role = (props, ref) => render(_4R3V3JGP_spreadValues({ ref }, props)); return external_React_.forwardRef(Role); } function createMemoComponent(render) { const Role = createComponent(render); return external_React_.memo(Role); } function _3ORBWXWF_createElement(Type, props) { const _a = props, { as: As, wrapElement, render } = _a, rest = __objRest(_a, ["as", "wrapElement", "render"]); let element; const mergedRef = useMergeRefs(props.ref, getRefProperty(render)); if (false) {} if (As && typeof As !== "string") { element = /* @__PURE__ */ (0,jsx_runtime.jsx)(As, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, rest), { render })); } else if (external_React_.isValidElement(render)) { const renderProps = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, render.props), { ref: mergedRef }); element = external_React_.cloneElement(render, mergeProps(rest, renderProps)); } else if (render) { element = render(rest); } else if (isRenderProp(props.children)) { if (false) {} const _b = rest, { children } = _b, otherProps = __objRest(_b, ["children"]); element = props.children(otherProps); } else if (As) { element = /* @__PURE__ */ (0,jsx_runtime.jsx)(As, _4R3V3JGP_spreadValues({}, rest)); } else { element = /* @__PURE__ */ (0,jsx_runtime.jsx)(Type, _4R3V3JGP_spreadValues({}, rest)); } if (wrapElement) { return wrapElement(element); } return element; } function createHook(useProps) { const useRole = (props = {}) => { const htmlProps = useProps(props); const copy = {}; for (const prop in htmlProps) { if (Y3OOHFCN_hasOwnProperty(htmlProps, prop) && htmlProps[prop] !== void 0) { copy[prop] = htmlProps[prop]; } } return copy; }; return useRole; } function createStoreContext(providers = [], scopedProviders = []) { const context = external_React_.createContext(void 0); const scopedContext = external_React_.createContext(void 0); const useContext2 = () => external_React_.useContext(context); const useScopedContext = (onlyScoped = false) => { const scoped = external_React_.useContext(scopedContext); const store = useContext2(); if (onlyScoped) return scoped; return scoped || store; }; const useProviderContext = () => { const scoped = external_React_.useContext(scopedContext); const store = useContext2(); if (scoped && scoped === store) return; return store; }; const ContextProvider = (props) => { return providers.reduceRight( (children, Provider) => /* @__PURE__ */ (0,jsx_runtime.jsx)(Provider, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { children })), /* @__PURE__ */ (0,jsx_runtime.jsx)(context.Provider, _4R3V3JGP_spreadValues({}, props)) ); }; const ScopedContextProvider = (props) => { return /* @__PURE__ */ (0,jsx_runtime.jsx)(ContextProvider, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { children: scopedProviders.reduceRight( (children, Provider) => /* @__PURE__ */ (0,jsx_runtime.jsx)(Provider, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { children })), /* @__PURE__ */ (0,jsx_runtime.jsx)(scopedContext.Provider, _4R3V3JGP_spreadValues({}, props)) ) })); }; return { context, scopedContext, useContext: useContext2, useScopedContext, useProviderContext, ContextProvider, ScopedContextProvider }; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/utils/focus.js "use client"; // src/utils/focus.ts var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])"; function hasNegativeTabIndex(element) { const tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10); return tabIndex < 0; } function isFocusable(element) { if (!matches(element, selector)) return false; if (!isVisible(element)) return false; if (DLOEKDPY_closest(element, "[inert]")) return false; return true; } function isTabbable(element) { if (!isFocusable(element)) return false; if (hasNegativeTabIndex(element)) return false; if (!("form" in element)) return true; if (!element.form) return true; if (element.checked) return true; if (element.type !== "radio") return true; const radioGroup = element.form.elements.namedItem(element.name); if (!radioGroup) return true; if (!("length" in radioGroup)) return true; const activeElement = getActiveElement(element); if (!activeElement) return true; if (activeElement === element) return true; if (!("form" in activeElement)) return true; if (activeElement.form !== element.form) return true; if (activeElement.name !== element.name) return true; return false; } function getAllFocusableIn(container, includeContainer) { const elements = Array.from( container.querySelectorAll(selector) ); if (includeContainer) { elements.unshift(container); } const focusableElements = elements.filter(isFocusable); focusableElements.forEach((element, i) => { if (isFrame(element) && element.contentDocument) { const frameBody = element.contentDocument.body; focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody)); } }); return focusableElements; } function getAllFocusable(includeBody) { return getAllFocusableIn(document.body, includeBody); } function getFirstFocusableIn(container, includeContainer) { const [first] = getAllFocusableIn(container, includeContainer); return first || null; } function getFirstFocusable(includeBody) { return getFirstFocusableIn(document.body, includeBody); } function getAllTabbableIn(container, includeContainer, fallbackToFocusable) { const elements = Array.from( container.querySelectorAll(selector) ); const tabbableElements = elements.filter(isTabbable); if (includeContainer && isTabbable(container)) { tabbableElements.unshift(container); } tabbableElements.forEach((element, i) => { if (isFrame(element) && element.contentDocument) { const frameBody = element.contentDocument.body; const allFrameTabbable = getAllTabbableIn( frameBody, false, fallbackToFocusable ); tabbableElements.splice(i, 1, ...allFrameTabbable); } }); if (!tabbableElements.length && fallbackToFocusable) { return elements; } return tabbableElements; } function getAllTabbable(fallbackToFocusable) { return getAllTabbableIn(document.body, false, fallbackToFocusable); } function getFirstTabbableIn(container, includeContainer, fallbackToFocusable) { const [first] = getAllTabbableIn( container, includeContainer, fallbackToFocusable ); return first || null; } function getFirstTabbable(fallbackToFocusable) { return getFirstTabbableIn(document.body, false, fallbackToFocusable); } function getLastTabbableIn(container, includeContainer, fallbackToFocusable) { const allTabbable = getAllTabbableIn( container, includeContainer, fallbackToFocusable ); return allTabbable[allTabbable.length - 1] || null; } function getLastTabbable(fallbackToFocusable) { return getLastTabbableIn(document.body, false, fallbackToFocusable); } function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) { const activeElement = getActiveElement(container); const allFocusable = getAllFocusableIn(container, includeContainer); const activeIndex = allFocusable.indexOf(activeElement); const nextFocusableElements = allFocusable.slice(activeIndex + 1); return nextFocusableElements.find(isTabbable) || (fallbackToFirst ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? nextFocusableElements[0] : null) || null; } function getNextTabbable(fallbackToFirst, fallbackToFocusable) { return getNextTabbableIn( document.body, false, fallbackToFirst, fallbackToFocusable ); } function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) { const activeElement = getActiveElement(container); const allFocusable = getAllFocusableIn(container, includeContainer).reverse(); const activeIndex = allFocusable.indexOf(activeElement); const previousFocusableElements = allFocusable.slice(activeIndex + 1); return previousFocusableElements.find(isTabbable) || (fallbackToLast ? allFocusable.find(isTabbable) : null) || (fallbackToFocusable ? previousFocusableElements[0] : null) || null; } function getPreviousTabbable(fallbackToFirst, fallbackToFocusable) { return getPreviousTabbableIn( document.body, false, fallbackToFirst, fallbackToFocusable ); } function getClosestFocusable(element) { while (element && !isFocusable(element)) { element = closest(element, selector); } return element || null; } function hasFocus(element) { const activeElement = getActiveElement(element); if (!activeElement) return false; if (activeElement === element) return true; const activeDescendant = activeElement.getAttribute("aria-activedescendant"); if (!activeDescendant) return false; return activeDescendant === element.id; } function hasFocusWithin(element) { const activeElement = getActiveElement(element); if (!activeElement) return false; if (contains(element, activeElement)) return true; const activeDescendant = activeElement.getAttribute("aria-activedescendant"); if (!activeDescendant) return false; if (!("id" in element)) return false; if (activeDescendant === element.id) return true; return !!element.querySelector(`#${CSS.escape(activeDescendant)}`); } function focusIfNeeded(element) { if (!hasFocusWithin(element) && isFocusable(element)) { element.focus(); } } function disableFocus(element) { var _a; const currentTabindex = (_a = element.getAttribute("tabindex")) != null ? _a : ""; element.setAttribute("data-tabindex", currentTabindex); element.setAttribute("tabindex", "-1"); } function disableFocusIn(container, includeContainer) { const tabbableElements = getAllTabbableIn(container, includeContainer); tabbableElements.forEach(disableFocus); } function restoreFocusIn(container) { const elements = container.querySelectorAll("[data-tabindex]"); const restoreTabIndex = (element) => { const tabindex = element.getAttribute("data-tabindex"); element.removeAttribute("data-tabindex"); if (tabindex) { element.setAttribute("tabindex", tabindex); } else { element.removeAttribute("tabindex"); } }; if (container.hasAttribute("data-tabindex")) { restoreTabIndex(container); } elements.forEach(restoreTabIndex); } function focusIntoView(element, options) { if (!("scrollIntoView" in element)) { element.focus(); } else { element.focus({ preventScroll: true }); element.scrollIntoView(_chunks_4R3V3JGP_spreadValues({ block: "nearest", inline: "nearest" }, options)); } } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/KK7H3W2B.js "use client"; // src/focusable/focusable.ts var isSafariBrowser = isSafari(); var alwaysFocusVisibleInputTypes = [ "text", "search", "url", "tel", "email", "password", "number", "date", "month", "week", "time", "datetime", "datetime-local" ]; function isAlwaysFocusVisible(element) { const { tagName, readOnly, type } = element; if (tagName === "TEXTAREA" && !readOnly) return true; if (tagName === "SELECT" && !readOnly) return true; if (tagName === "INPUT" && !readOnly) { return alwaysFocusVisibleInputTypes.includes(type); } if (element.isContentEditable) return true; return false; } function isAlwaysFocusVisibleDelayed(element) { const role = element.getAttribute("role"); if (role !== "combobox") return false; return !!element.dataset.name; } function getLabels(element) { if ("labels" in element) { return element.labels; } return null; } function isNativeCheckboxOrRadio(element) { const tagName = element.tagName.toLowerCase(); if (tagName === "input" && element.type) { return element.type === "radio" || element.type === "checkbox"; } return false; } function isNativeTabbable(tagName) { if (!tagName) return true; return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a"; } function supportsDisabledAttribute(tagName) { if (!tagName) return true; return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea"; } function getTabIndex(focusable, trulyDisabled, nativeTabbable, supportsDisabled, tabIndexProp) { if (!focusable) { return tabIndexProp; } if (trulyDisabled) { if (nativeTabbable && !supportsDisabled) { return -1; } return; } if (nativeTabbable) { return tabIndexProp; } return tabIndexProp || 0; } function useDisableEvent(onEvent, disabled) { return useEvent((event) => { onEvent == null ? void 0 : onEvent(event); if (event.defaultPrevented) return; if (disabled) { event.stopPropagation(); event.preventDefault(); } }); } var isKeyboardModality = true; function onGlobalMouseDown(event) { const target = event.target; if (target && "hasAttribute" in target) { if (!target.hasAttribute("data-focus-visible")) { isKeyboardModality = false; } } } function onGlobalKeyDown(event) { if (event.metaKey) return; if (event.ctrlKey) return; if (event.altKey) return; isKeyboardModality = true; } var useFocusable = createHook( (_a) => { var _b = _a, { focusable = true, accessibleWhenDisabled, autoFocus, onFocusVisible } = _b, props = __objRest(_b, [ "focusable", "accessibleWhenDisabled", "autoFocus", "onFocusVisible" ]); const ref = (0,external_React_.useRef)(null); (0,external_React_.useEffect)(() => { if (!focusable) return; addGlobalEventListener("mousedown", onGlobalMouseDown, true); addGlobalEventListener("keydown", onGlobalKeyDown, true); }, [focusable]); if (isSafariBrowser) { (0,external_React_.useEffect)(() => { if (!focusable) return; const element = ref.current; if (!element) return; if (!isNativeCheckboxOrRadio(element)) return; const labels = getLabels(element); if (!labels) return; const onMouseUp = () => queueMicrotask(() => element.focus()); labels.forEach((label) => label.addEventListener("mouseup", onMouseUp)); return () => { labels.forEach( (label) => label.removeEventListener("mouseup", onMouseUp) ); }; }, [focusable]); } const disabled = focusable && disabledFromProps(props); const trulyDisabled = !!disabled && !accessibleWhenDisabled; const [focusVisible, setFocusVisible] = (0,external_React_.useState)(false); (0,external_React_.useEffect)(() => { if (!focusable) return; if (trulyDisabled && focusVisible) { setFocusVisible(false); } }, [focusable, trulyDisabled, focusVisible]); (0,external_React_.useEffect)(() => { if (!focusable) return; if (!focusVisible) return; const element = ref.current; if (!element) return; if (typeof IntersectionObserver === "undefined") return; const observer = new IntersectionObserver(() => { if (!isFocusable(element)) { setFocusVisible(false); } }); observer.observe(element); return () => observer.disconnect(); }, [focusable, focusVisible]); const onKeyPressCapture = useDisableEvent( props.onKeyPressCapture, disabled ); const onMouseDownCapture = useDisableEvent( props.onMouseDownCapture, disabled ); const onClickCapture = useDisableEvent(props.onClickCapture, disabled); const onMouseDownProp = props.onMouseDown; const onMouseDown = useEvent((event) => { onMouseDownProp == null ? void 0 : onMouseDownProp(event); if (event.defaultPrevented) return; if (!focusable) return; const element = event.currentTarget; if (!isSafariBrowser) return; if (isPortalEvent(event)) return; if (!isButton(element) && !isNativeCheckboxOrRadio(element)) return; let receivedFocus = false; const onFocus = () => { receivedFocus = true; }; const options = { capture: true, once: true }; element.addEventListener("focusin", onFocus, options); queueBeforeEvent(element, "mouseup", () => { element.removeEventListener("focusin", onFocus, true); if (receivedFocus) return; focusIfNeeded(element); }); }); const handleFocusVisible = (event, currentTarget) => { if (currentTarget) { event.currentTarget = currentTarget; } if (!focusable) return; const element = event.currentTarget; if (!element) return; if (!hasFocus(element)) return; onFocusVisible == null ? void 0 : onFocusVisible(event); if (event.defaultPrevented) return; setFocusVisible(true); }; const onKeyDownCaptureProp = props.onKeyDownCapture; const onKeyDownCapture = useEvent( (event) => { onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event); if (event.defaultPrevented) return; if (!focusable) return; if (focusVisible) return; if (event.metaKey) return; if (event.altKey) return; if (event.ctrlKey) return; if (!isSelfTarget(event)) return; const element = event.currentTarget; queueMicrotask(() => handleFocusVisible(event, element)); } ); const onFocusCaptureProp = props.onFocusCapture; const onFocusCapture = useEvent((event) => { onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event); if (event.defaultPrevented) return; if (!focusable) return; if (!isSelfTarget(event)) { setFocusVisible(false); return; } const element = event.currentTarget; const applyFocusVisible = () => handleFocusVisible(event, element); if (isKeyboardModality || isAlwaysFocusVisible(event.target)) { queueMicrotask(applyFocusVisible); } else if (isAlwaysFocusVisibleDelayed(event.target)) { queueBeforeEvent(event.target, "focusout", applyFocusVisible); } else { setFocusVisible(false); } }); const onBlurProp = props.onBlur; const onBlur = useEvent((event) => { onBlurProp == null ? void 0 : onBlurProp(event); if (!focusable) return; if (!isFocusEventOutside(event)) return; setFocusVisible(false); }); const autoFocusOnShow = (0,external_React_.useContext)(FocusableContext); const autoFocusRef = useEvent((element) => { if (!focusable) return; if (!autoFocus) return; if (!element) return; if (!autoFocusOnShow) return; queueMicrotask(() => { if (hasFocus(element)) return; if (!isFocusable(element)) return; element.focus(); }); }); const tagName = useTagName(ref, props.as); const nativeTabbable = focusable && isNativeTabbable(tagName); const supportsDisabled = focusable && supportsDisabledAttribute(tagName); const style = trulyDisabled ? _4R3V3JGP_spreadValues({ pointerEvents: "none" }, props.style) : props.style; props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ "data-focus-visible": focusable && focusVisible ? "" : void 0, "data-autofocus": autoFocus ? true : void 0, "aria-disabled": disabled ? true : void 0 }, props), { ref: useMergeRefs(ref, autoFocusRef, props.ref), style, tabIndex: getTabIndex( focusable, trulyDisabled, nativeTabbable, supportsDisabled, props.tabIndex ), disabled: supportsDisabled && trulyDisabled ? true : void 0, // TODO: Test Focusable contentEditable. contentEditable: disabled ? void 0 : props.contentEditable, onKeyPressCapture, onClickCapture, onMouseDownCapture, onMouseDown, onKeyDownCapture, onFocusCapture, onBlur }); return props; } ); var Focusable = createComponent((props) => { props = useFocusable(props); return _3ORBWXWF_createElement("div", props); }); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/NWCBQ4CV.js "use client"; // src/command/command.ts function isNativeClick(event) { if (!event.isTrusted) return false; const element = event.currentTarget; if (event.key === "Enter") { return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A"; } if (event.key === " ") { return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT"; } return false; } var symbol = Symbol("command"); var useCommand = createHook( (_a) => { var _b = _a, { clickOnEnter = true, clickOnSpace = true } = _b, props = __objRest(_b, ["clickOnEnter", "clickOnSpace"]); const ref = (0,external_React_.useRef)(null); const tagName = useTagName(ref, props.as); const type = props.type; const [isNativeButton, setIsNativeButton] = (0,external_React_.useState)( () => !!tagName && isButton({ tagName, type }) ); (0,external_React_.useEffect)(() => { if (!ref.current) return; setIsNativeButton(isButton(ref.current)); }, []); const [active, setActive] = (0,external_React_.useState)(false); const activeRef = (0,external_React_.useRef)(false); const disabled = disabledFromProps(props); const [isDuplicate, metadataProps] = useMetadataProps(props, symbol, true); const onKeyDownProp = props.onKeyDown; const onKeyDown = useEvent((event) => { onKeyDownProp == null ? void 0 : onKeyDownProp(event); const element = event.currentTarget; if (event.defaultPrevented) return; if (isDuplicate) return; if (disabled) return; if (!isSelfTarget(event)) return; if (DLOEKDPY_isTextField(element)) return; if (element.isContentEditable) return; const isEnter = clickOnEnter && event.key === "Enter"; const isSpace = clickOnSpace && event.key === " "; const shouldPreventEnter = event.key === "Enter" && !clickOnEnter; const shouldPreventSpace = event.key === " " && !clickOnSpace; if (shouldPreventEnter || shouldPreventSpace) { event.preventDefault(); return; } if (isEnter || isSpace) { const nativeClick = isNativeClick(event); if (isEnter) { if (!nativeClick) { event.preventDefault(); const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]); const click = () => fireClickEvent(element, eventInit); if (isFirefox()) { queueBeforeEvent(element, "keyup", click); } else { queueMicrotask(click); } } } else if (isSpace) { activeRef.current = true; if (!nativeClick) { event.preventDefault(); setActive(true); } } } }); const onKeyUpProp = props.onKeyUp; const onKeyUp = useEvent((event) => { onKeyUpProp == null ? void 0 : onKeyUpProp(event); if (event.defaultPrevented) return; if (isDuplicate) return; if (disabled) return; if (event.metaKey) return; const isSpace = clickOnSpace && event.key === " "; if (activeRef.current && isSpace) { activeRef.current = false; if (!isNativeClick(event)) { event.preventDefault(); setActive(false); const element = event.currentTarget; const _a2 = event, { view } = _a2, eventInit = __objRest(_a2, ["view"]); queueMicrotask(() => fireClickEvent(element, eventInit)); } } }); props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues(_4R3V3JGP_spreadValues({ "data-active": active ? "" : void 0, type: isNativeButton ? "button" : void 0 }, metadataProps), props), { ref: useMergeRefs(ref, props.ref), onKeyDown, onKeyUp }); props = useFocusable(props); return props; } ); var Command = createComponent((props) => { props = useCommand(props); return _3ORBWXWF_createElement("button", props); }); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/4UUKJZ4V.js "use client"; // src/collection/collection-context.tsx var ctx = createStoreContext(); var useCollectionContext = ctx.useContext; var useCollectionScopedContext = ctx.useScopedContext; var useCollectionProviderContext = ctx.useProviderContext; var CollectionContextProvider = ctx.ContextProvider; var CollectionScopedContextProvider = ctx.ScopedContextProvider; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/UH3I23HL.js "use client"; // src/collection/collection-item.ts var useCollectionItem = createHook( (_a) => { var _b = _a, { store, shouldRegisterItem = true, getItem = identity, element: element } = _b, props = __objRest(_b, [ "store", "shouldRegisterItem", "getItem", // @ts-expect-error This prop may come from a collection renderer. "element" ]); const context = useCollectionContext(); store = store || context; const id = useId(props.id); const ref = (0,external_React_.useRef)(element); (0,external_React_.useEffect)(() => { const element2 = ref.current; if (!id) return; if (!element2) return; if (!shouldRegisterItem) return; const item = getItem({ id, element: element2 }); return store == null ? void 0 : store.renderItem(item); }, [id, shouldRegisterItem, getItem, store]); props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { ref: useMergeRefs(ref, props.ref) }); return props; } ); var CollectionItem = createComponent( (props) => { const htmlProps = useCollectionItem(props); return _3ORBWXWF_createElement("div", htmlProps); } ); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/3IEDWLST.js "use client"; // src/composite/utils.ts var NULL_ITEM = { id: null }; function flipItems(items, activeId, shouldInsertNullItem = false) { const index = items.findIndex((item) => item.id === activeId); return [ ...items.slice(index + 1), ...shouldInsertNullItem ? [NULL_ITEM] : [], ...items.slice(0, index) ]; } function findFirstEnabledItem(items, excludeId) { return items.find((item) => { if (excludeId) { return !item.disabled && item.id !== excludeId; } return !item.disabled; }); } function getEnabledItem(store, id) { if (!id) return null; return store.item(id) || null; } function groupItemsByRows(items) { const rows = []; for (const item of items) { const row = rows.find((currentRow) => { var _a; return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId; }); if (row) { row.push(item); } else { rows.push([item]); } } return rows; } function selectTextField(element, collapseToEnd = false) { if (isTextField(element)) { element.setSelectionRange( collapseToEnd ? element.value.length : 0, element.value.length ); } else if (element.isContentEditable) { const selection = getDocument(element).getSelection(); selection == null ? void 0 : selection.selectAllChildren(element); if (collapseToEnd) { selection == null ? void 0 : selection.collapseToEnd(); } } } var FOCUS_SILENTLY = Symbol("FOCUS_SILENTLY"); function focusSilently(element) { element[FOCUS_SILENTLY] = true; element.focus({ preventScroll: true }); } function silentlyFocused(element) { const isSilentlyFocused = element[FOCUS_SILENTLY]; delete element[FOCUS_SILENTLY]; return isSilentlyFocused; } function isItem(store, element, exclude) { if (!element) return false; if (element === exclude) return false; const item = store.item(element.id); if (!item) return false; if (exclude && item.element === exclude) return false; return true; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/IB7YUKH5.js "use client"; // src/composite/composite-context.tsx var IB7YUKH5_ctx = createStoreContext( [CollectionContextProvider], [CollectionScopedContextProvider] ); var useCompositeContext = IB7YUKH5_ctx.useContext; var useCompositeScopedContext = IB7YUKH5_ctx.useScopedContext; var useCompositeProviderContext = IB7YUKH5_ctx.useProviderContext; var CompositeContextProvider = IB7YUKH5_ctx.ContextProvider; var CompositeScopedContextProvider = IB7YUKH5_ctx.ScopedContextProvider; var CompositeItemContext = (0,external_React_.createContext)( void 0 ); var CompositeRowContext = (0,external_React_.createContext)( void 0 ); ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/EAHJFCU4.js "use client"; // src/utils/store.ts function getInternal(store, key) { const internals = store.__unstableInternals; invariant(internals, "Invalid store"); return internals[key]; } function createStore(initialState, ...stores) { let state = initialState; let prevStateBatch = state; let lastUpdate = Symbol(); let destroy = noop; const instances = /* @__PURE__ */ new Set(); const updatedKeys = /* @__PURE__ */ new Set(); const setups = /* @__PURE__ */ new Set(); const listeners = /* @__PURE__ */ new Set(); const batchListeners = /* @__PURE__ */ new Set(); const disposables = /* @__PURE__ */ new WeakMap(); const listenerKeys = /* @__PURE__ */ new WeakMap(); const storeSetup = (callback) => { setups.add(callback); return () => setups.delete(callback); }; const storeInit = () => { const initialized = instances.size; const instance = Symbol(); instances.add(instance); const maybeDestroy = () => { instances.delete(instance); if (instances.size) return; destroy(); }; if (initialized) return maybeDestroy; const desyncs = getKeys(state).map( (key) => chain( ...stores.map((store) => { var _a; const storeState = (_a = store == null ? void 0 : store.getState) == null ? void 0 : _a.call(store); if (!storeState) return; if (!Y3OOHFCN_hasOwnProperty(storeState, key)) return; return sync(store, [key], (state2) => { setState( key, state2[key], // @ts-expect-error - Not public API. This is just to prevent // infinite loops. true ); }); }) ) ); const teardowns = []; setups.forEach((setup2) => teardowns.push(setup2())); const cleanups = stores.map(init); destroy = chain(...desyncs, ...teardowns, ...cleanups); return maybeDestroy; }; const sub = (keys, listener, set = listeners) => { set.add(listener); listenerKeys.set(listener, keys); return () => { var _a; (_a = disposables.get(listener)) == null ? void 0 : _a(); disposables.delete(listener); listenerKeys.delete(listener); set.delete(listener); }; }; const storeSubscribe = (keys, listener) => sub(keys, listener); const storeSync = (keys, listener) => { disposables.set(listener, listener(state, state)); return sub(keys, listener); }; const storeBatch = (keys, listener) => { disposables.set(listener, listener(state, prevStateBatch)); return sub(keys, listener, batchListeners); }; const storePick = (keys) => createStore(pick(state, keys), finalStore); const storeOmit = (keys) => createStore(omit(state, keys), finalStore); const getState = () => state; const setState = (key, value, fromStores = false) => { if (!Y3OOHFCN_hasOwnProperty(state, key)) return; const nextValue = Y3OOHFCN_applyState(value, state[key]); if (nextValue === state[key]) return; if (!fromStores) { stores.forEach((store) => { var _a; (_a = store == null ? void 0 : store.setState) == null ? void 0 : _a.call(store, key, nextValue); }); } const prevState = state; state = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, state), { [key]: nextValue }); const thisUpdate = Symbol(); lastUpdate = thisUpdate; updatedKeys.add(key); const run = (listener, prev, uKeys) => { var _a; const keys = listenerKeys.get(listener); const updated = (k) => uKeys ? uKeys.has(k) : k === key; if (!keys || keys.some(updated)) { (_a = disposables.get(listener)) == null ? void 0 : _a(); disposables.set(listener, listener(state, prev)); } }; listeners.forEach((listener) => { run(listener, prevState); }); queueMicrotask(() => { if (lastUpdate !== thisUpdate) return; const snapshot = state; batchListeners.forEach((listener) => { run(listener, prevStateBatch, updatedKeys); }); prevStateBatch = snapshot; updatedKeys.clear(); }); }; const finalStore = { getState, setState, __unstableInternals: { setup: storeSetup, init: storeInit, subscribe: storeSubscribe, sync: storeSync, batch: storeBatch, pick: storePick, omit: storeOmit } }; return finalStore; } function setup(store, ...args) { if (!store) return; return getInternal(store, "setup")(...args); } function init(store, ...args) { if (!store) return; return getInternal(store, "init")(...args); } function EAHJFCU4_subscribe(store, ...args) { if (!store) return; return getInternal(store, "subscribe")(...args); } function sync(store, ...args) { if (!store) return; return getInternal(store, "sync")(...args); } function batch(store, ...args) { if (!store) return; return getInternal(store, "batch")(...args); } function omit2(store, ...args) { if (!store) return; return getInternal(store, "omit")(...args); } function pick2(store, ...args) { if (!store) return; return getInternal(store, "pick")(...args); } function mergeStore(...stores) { const initialState = stores.reduce((state, store2) => { var _a; const nextState = (_a = store2 == null ? void 0 : store2.getState) == null ? void 0 : _a.call(store2); if (!nextState) return state; return _chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, state), nextState); }, {}); const store = createStore(initialState, ...stores); return store; } function throwOnConflictingProps(props, store) { if (true) return; if (!store) return; const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => { var _a; const stateKey = key.replace("default", ""); return `${((_a = stateKey[0]) == null ? void 0 : _a.toLowerCase()) || ""}${stateKey.slice(1)}`; }); if (!defaultKeys.length) return; const storeState = store.getState(); const conflictingProps = defaultKeys.filter( (key) => Y3OOHFCN_hasOwnProperty(storeState, key) ); if (!conflictingProps.length) return; throw new Error( `Passing a store prop in conjunction with a default state is not supported. const store = useSelectStore(); ^ ^ Instead, pass the default state to the topmost store: const store = useSelectStore({ defaultValue: "Apple" }); See https://github.com/ariakit/ariakit/pull/2745 for more details. If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit ` ); } // EXTERNAL MODULE: ./node_modules/use-sync-external-store/shim/index.js var shim = __webpack_require__(422); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/EKQEJRUF.js "use client"; // src/utils/store.tsx var { useSyncExternalStore } = shim; var noopSubscribe = () => () => { }; function useStoreState(store, keyOrSelector = identity) { const storeSubscribe = external_React_.useCallback( (callback) => { if (!store) return noopSubscribe(); return EAHJFCU4_subscribe(store, null, callback); }, [store] ); const getSnapshot = () => { const key = typeof keyOrSelector === "string" ? keyOrSelector : null; const selector = typeof keyOrSelector === "function" ? keyOrSelector : null; const state = store == null ? void 0 : store.getState(); if (selector) return selector(state); if (!state) return; if (!key) return; if (!Y3OOHFCN_hasOwnProperty(state, key)) return; return state[key]; }; return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot); } function useStoreProps(store, props, key, setKey) { const value = Y3OOHFCN_hasOwnProperty(props, key) ? props[key] : void 0; const setValue = setKey ? props[setKey] : void 0; const propsRef = useLiveRef({ value, setValue }); useSafeLayoutEffect(() => { return sync(store, [key], (state, prev) => { const { value: value2, setValue: setValue2 } = propsRef.current; if (!setValue2) return; if (state[key] === prev[key]) return; if (state[key] === value2) return; setValue2(state[key]); }); }, [store, key]); useSafeLayoutEffect(() => { if (value === void 0) return; store.setState(key, value); return batch(store, [key], () => { if (value === void 0) return; store.setState(key, value); }); }); } function EKQEJRUF_useStore(createStore, props) { const [store, setStore] = external_React_.useState(() => createStore(props)); useSafeLayoutEffect(() => init(store), [store]); const useState2 = external_React_.useCallback( (keyOrSelector) => useStoreState(store, keyOrSelector), [store] ); const memoizedStore = external_React_.useMemo( () => _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, store), { useState: useState2 }), [store, useState2] ); const updateStore = useEvent(() => { setStore((store2) => createStore(_4R3V3JGP_spreadValues(_4R3V3JGP_spreadValues({}, props), store2.getState()))); }); return [memoizedStore, updateStore]; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/QZLXIDNP.js "use client"; // src/composite/composite-item.tsx function isEditableElement(element) { if (element.isContentEditable) return true; if (DLOEKDPY_isTextField(element)) return true; return element.tagName === "INPUT" && !isButton(element); } function getNextPageOffset(scrollingElement, pageUp = false) { const height = scrollingElement.clientHeight; const { top } = scrollingElement.getBoundingClientRect(); const pageSize = Math.max(height * 0.875, height - 40) * 1.5; const pageOffset = pageUp ? height - pageSize + top : pageSize + top; if (scrollingElement.tagName === "HTML") { return pageOffset + scrollingElement.scrollTop; } return pageOffset; } function getItemOffset(itemElement, pageUp = false) { const { top } = itemElement.getBoundingClientRect(); if (pageUp) { return top + itemElement.clientHeight; } return top; } function findNextPageItemId(element, store, next, pageUp = false) { var _a; if (!store) return; if (!next) return; const { renderedItems } = store.getState(); const scrollingElement = getScrollingElement(element); if (!scrollingElement) return; const nextPageOffset = getNextPageOffset(scrollingElement, pageUp); let id; let prevDifference; for (let i = 0; i < renderedItems.length; i += 1) { const previousId = id; id = next(i); if (!id) break; if (id === previousId) continue; const itemElement = (_a = getEnabledItem(store, id)) == null ? void 0 : _a.element; if (!itemElement) continue; const itemOffset = getItemOffset(itemElement, pageUp); const difference = itemOffset - nextPageOffset; const absDifference = Math.abs(difference); if (pageUp && difference <= 0 || !pageUp && difference >= 0) { if (prevDifference !== void 0 && prevDifference < absDifference) { id = previousId; } break; } prevDifference = absDifference; } return id; } function targetIsAnotherItem(event, store) { if (isSelfTarget(event)) return false; return isItem(store, event.target); } function useRole(ref, props) { const roleProp = props.role; const [role, setRole] = (0,external_React_.useState)(roleProp); useSafeLayoutEffect(() => { const element = ref.current; if (!element) return; setRole(element.getAttribute("role") || roleProp); }, [roleProp]); return role; } function requiresAriaSelected(role) { return role === "option" || role === "treeitem"; } function supportsAriaSelected(role) { if (role === "option") return true; if (role === "tab") return true; if (role === "treeitem") return true; if (role === "gridcell") return true; if (role === "row") return true; if (role === "columnheader") return true; if (role === "rowheader") return true; return false; } var useCompositeItem = createHook( (_a) => { var _b = _a, { store, rowId: rowIdProp, preventScrollOnKeyDown = false, moveOnKeyPress = true, tabbable = false, getItem: getItemProp, "aria-setsize": ariaSetSizeProp, "aria-posinset": ariaPosInSetProp } = _b, props = __objRest(_b, [ "store", "rowId", "preventScrollOnKeyDown", "moveOnKeyPress", "tabbable", "getItem", "aria-setsize", "aria-posinset" ]); const context = useCompositeContext(); store = store || context; const id = useId(props.id); const ref = (0,external_React_.useRef)(null); const row = (0,external_React_.useContext)(CompositeRowContext); const rowId = useStoreState(store, (state) => { if (rowIdProp) return rowIdProp; if (!state) return; if (!(row == null ? void 0 : row.baseElement)) return; if (row.baseElement !== state.baseElement) return; return row.id; }); const disabled = disabledFromProps(props); const trulyDisabled = disabled && !props.accessibleWhenDisabled; const getItem = (0,external_React_.useCallback)( (item) => { const nextItem = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, item), { id: id || item.id, rowId, disabled: !!trulyDisabled }); if (getItemProp) { return getItemProp(nextItem); } return nextItem; }, [id, rowId, trulyDisabled, getItemProp] ); const onFocusProp = props.onFocus; const hasFocusedComposite = (0,external_React_.useRef)(false); const onFocus = useEvent((event) => { onFocusProp == null ? void 0 : onFocusProp(event); if (event.defaultPrevented) return; if (isPortalEvent(event)) return; if (!id) return; if (!store) return; const { activeId, virtualFocus: virtualFocus2, baseElement: baseElement2 } = store.getState(); if (targetIsAnotherItem(event, store)) return; if (activeId !== id) { store.setActiveId(id); } if (!virtualFocus2) return; if (!isSelfTarget(event)) return; if (isEditableElement(event.currentTarget)) return; if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) return; hasFocusedComposite.current = true; const fromComposite = event.relatedTarget === baseElement2 || isItem(store, event.relatedTarget); if (fromComposite) { focusSilently(baseElement2); } else { baseElement2.focus(); } }); const onBlurCaptureProp = props.onBlurCapture; const onBlurCapture = useEvent((event) => { onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event); if (event.defaultPrevented) return; const state = store == null ? void 0 : store.getState(); if ((state == null ? void 0 : state.virtualFocus) && hasFocusedComposite.current) { hasFocusedComposite.current = false; event.preventDefault(); event.stopPropagation(); } }); const onKeyDownProp = props.onKeyDown; const preventScrollOnKeyDownProp = useBooleanEvent(preventScrollOnKeyDown); const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress); const onKeyDown = useEvent((event) => { onKeyDownProp == null ? void 0 : onKeyDownProp(event); if (event.defaultPrevented) return; if (!isSelfTarget(event)) return; if (!store) return; const { currentTarget } = event; const state = store.getState(); const item = store.item(id); const isGrid = !!(item == null ? void 0 : item.rowId); const isVertical = state.orientation !== "horizontal"; const isHorizontal = state.orientation !== "vertical"; const canHomeEnd = () => { if (isGrid) return true; if (isHorizontal) return true; if (!state.baseElement) return true; if (!DLOEKDPY_isTextField(state.baseElement)) return true; return false; }; const keyMap = { ArrowUp: (isGrid || isVertical) && store.up, ArrowRight: (isGrid || isHorizontal) && store.next, ArrowDown: (isGrid || isVertical) && store.down, ArrowLeft: (isGrid || isHorizontal) && store.previous, Home: () => { if (!canHomeEnd()) return; if (!isGrid || event.ctrlKey) { return store == null ? void 0 : store.first(); } return store == null ? void 0 : store.previous(-1); }, End: () => { if (!canHomeEnd()) return; if (!isGrid || event.ctrlKey) { return store == null ? void 0 : store.last(); } return store == null ? void 0 : store.next(-1); }, PageUp: () => { return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.up, true); }, PageDown: () => { return findNextPageItemId(currentTarget, store, store == null ? void 0 : store.down); } }; const action = keyMap[event.key]; if (action) { const nextId = action(); if (preventScrollOnKeyDownProp(event) || nextId !== void 0) { if (!moveOnKeyPressProp(event)) return; event.preventDefault(); store.move(nextId); } } }); const baseElement = useStoreState( store, (state) => (state == null ? void 0 : state.baseElement) || void 0 ); const providerValue = (0,external_React_.useMemo)( () => ({ id, baseElement }), [id, baseElement] ); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(CompositeItemContext.Provider, { value: providerValue, children: element }), [providerValue] ); const isActiveItem = useStoreState( store, (state) => !!state && state.activeId === id ); const virtualFocus = useStoreState(store, "virtualFocus"); const role = useRole(ref, props); let ariaSelected; if (isActiveItem) { if (requiresAriaSelected(role)) { ariaSelected = true; } else if (virtualFocus && supportsAriaSelected(role)) { ariaSelected = true; } } const ariaSetSize = useStoreState(store, (state) => { if (ariaSetSizeProp != null) return ariaSetSizeProp; if (!state) return; if (!(row == null ? void 0 : row.ariaSetSize)) return; if (row.baseElement !== state.baseElement) return; return row.ariaSetSize; }); const ariaPosInSet = useStoreState(store, (state) => { if (ariaPosInSetProp != null) return ariaPosInSetProp; if (!state) return; if (!(row == null ? void 0 : row.ariaPosInSet)) return; if (row.baseElement !== state.baseElement) return; const itemsInRow = state.renderedItems.filter( (item) => item.rowId === rowId ); return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id); }); const isTabbable = useStoreState(store, (state) => { if (!(state == null ? void 0 : state.renderedItems.length)) return true; if (state.virtualFocus) return false; if (tabbable) return true; return state.activeId === id; }); props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ id, "aria-selected": ariaSelected, "data-active-item": isActiveItem ? "" : void 0 }, props), { ref: useMergeRefs(ref, props.ref), tabIndex: isTabbable ? props.tabIndex : -1, onFocus, onBlurCapture, onKeyDown }); props = useCommand(props); props = useCollectionItem(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ store }, props), { getItem, shouldRegisterItem: !!id ? props.shouldRegisterItem : false })); return _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { "aria-setsize": ariaSetSize, "aria-posinset": ariaPosInSet }); } ); var CompositeItem = createMemoComponent( (props) => { const htmlProps = useCompositeItem(props); return _3ORBWXWF_createElement("button", htmlProps); } ); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/Z5IGYIPT.js "use client"; // src/disclosure/disclosure-store.ts function createDisclosureStore(props = {}) { const store = mergeStore( props.store, omit2(props.disclosure, ["contentElement", "disclosureElement"]) ); throwOnConflictingProps(props, store); const syncState = store == null ? void 0 : store.getState(); const open = defaultValue( props.open, syncState == null ? void 0 : syncState.open, props.defaultOpen, false ); const animated = defaultValue(props.animated, syncState == null ? void 0 : syncState.animated, false); const initialState = { open, animated, animating: !!animated && open, mounted: open, contentElement: defaultValue(syncState == null ? void 0 : syncState.contentElement, null), disclosureElement: defaultValue(syncState == null ? void 0 : syncState.disclosureElement, null) }; const disclosure = createStore(initialState, store); setup( disclosure, () => sync(disclosure, ["animated", "animating"], (state) => { if (state.animated) return; disclosure.setState("animating", false); }) ); setup( disclosure, () => EAHJFCU4_subscribe(disclosure, ["open"], () => { if (!disclosure.getState().animated) return; disclosure.setState("animating", true); }) ); setup( disclosure, () => sync(disclosure, ["open", "animating"], (state) => { disclosure.setState("mounted", state.open || state.animating); }) ); return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, disclosure), { setOpen: (value) => disclosure.setState("open", value), show: () => disclosure.setState("open", true), hide: () => disclosure.setState("open", false), toggle: () => disclosure.setState("open", (open2) => !open2), stopAnimation: () => disclosure.setState("animating", false), setContentElement: (value) => disclosure.setState("contentElement", value), setDisclosureElement: (value) => disclosure.setState("disclosureElement", value) }); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/SFCBA2JZ.js "use client"; // src/disclosure/disclosure-store.ts function useDisclosureStoreProps(store, update, props) { useUpdateEffect(update, [props.store, props.disclosure]); useStoreProps(store, props, "open", "setOpen"); useStoreProps(store, props, "mounted", "setMounted"); useStoreProps(store, props, "animated"); return store; } function useDisclosureStore(props = {}) { const [store, update] = EKQEJRUF_useStore(createDisclosureStore, props); return useDisclosureStoreProps(store, update, props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/SX2XFD6A.js "use client"; // src/dialog/dialog-store.ts function createDialogStore(props = {}) { return createDisclosureStore(props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/ZSELSBRM.js "use client"; // src/dialog/dialog-store.ts function useDialogStoreProps(store, update, props) { return useDisclosureStoreProps(store, update, props); } function useDialogStore(props = {}) { const [store, update] = EKQEJRUF_useStore(createDialogStore, props); return useDialogStoreProps(store, update, props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/MG4P3223.js "use client"; // src/popover/popover-store.ts function usePopoverStoreProps(store, update, props) { useUpdateEffect(update, [props.popover]); store = useDialogStoreProps(store, update, props); useStoreProps(store, props, "placement"); return store; } function usePopoverStore(props = {}) { const [store, update] = useStore(Core.createPopoverStore, props); return usePopoverStoreProps(store, update, props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/ZU7LQC5V.js "use client"; // src/hovercard/hovercard-store.ts function useHovercardStoreProps(store, update, props) { store = usePopoverStoreProps(store, update, props); useStoreProps(store, props, "timeout"); useStoreProps(store, props, "showTimeout"); useStoreProps(store, props, "hideTimeout"); return store; } function useHovercardStore(props = {}) { const [store, update] = useStore(Core.createHovercardStore, props); return useHovercardStoreProps(store, update, props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/AF6IUUFN.js "use client"; // src/popover/popover-store.ts function createPopoverStore(_a = {}) { var _b = _a, { popover: otherPopover } = _b, props = _4R3V3JGP_objRest(_b, [ "popover" ]); const store = mergeStore( props.store, omit2(otherPopover, [ "arrowElement", "anchorElement", "contentElement", "popoverElement", "disclosureElement" ]) ); throwOnConflictingProps(props, store); const syncState = store == null ? void 0 : store.getState(); const dialog = createDialogStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { store })); const placement = defaultValue( props.placement, syncState == null ? void 0 : syncState.placement, "bottom" ); const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, dialog.getState()), { placement, currentPlacement: placement, anchorElement: defaultValue(syncState == null ? void 0 : syncState.anchorElement, null), popoverElement: defaultValue(syncState == null ? void 0 : syncState.popoverElement, null), arrowElement: defaultValue(syncState == null ? void 0 : syncState.arrowElement, null), rendered: Symbol("rendered") }); const popover = createStore(initialState, dialog, store); return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, dialog), popover), { setAnchorElement: (element) => popover.setState("anchorElement", element), setPopoverElement: (element) => popover.setState("popoverElement", element), setArrowElement: (element) => popover.setState("arrowElement", element), render: () => popover.setState("rendered", Symbol("rendered")) }); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/__chunks/SOLWE6E5.js "use client"; // src/hovercard/hovercard-store.ts function createHovercardStore(props = {}) { var _a; const syncState = (_a = props.store) == null ? void 0 : _a.getState(); const popover = createPopoverStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { placement: defaultValue( props.placement, syncState == null ? void 0 : syncState.placement, "bottom" ) })); const timeout = defaultValue(props.timeout, syncState == null ? void 0 : syncState.timeout, 500); const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, popover.getState()), { timeout, showTimeout: defaultValue(props.showTimeout, syncState == null ? void 0 : syncState.showTimeout), hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout), autoFocusOnShow: defaultValue(syncState == null ? void 0 : syncState.autoFocusOnShow, false) }); const hovercard = createStore(initialState, popover, props.store); return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, popover), hovercard), { setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value) }); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/core/esm/tooltip/tooltip-store.js "use client"; // src/tooltip/tooltip-store.ts function createTooltipStore(props = {}) { var _a; const syncState = (_a = props.store) == null ? void 0 : _a.getState(); const hovercard = createHovercardStore(_chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, props), { placement: defaultValue( props.placement, syncState == null ? void 0 : syncState.placement, "top" ), hideTimeout: defaultValue(props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0) })); const initialState = _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues({}, hovercard.getState()), { type: defaultValue(props.type, syncState == null ? void 0 : syncState.type, "description"), skipTimeout: defaultValue(props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300) }); const tooltip = createStore(initialState, hovercard, props.store); return _chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, hovercard), tooltip); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/2QMN5E6B.js "use client"; // src/tooltip/tooltip-store.ts function useTooltipStoreProps(store, update, props) { store = useHovercardStoreProps(store, update, props); useStoreProps(store, props, "type"); useStoreProps(store, props, "skipTimeout"); return store; } function useTooltipStore(props = {}) { const [store, update] = EKQEJRUF_useStore(createTooltipStore, props); return useTooltipStoreProps(store, update, props); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/FSFPRQFR.js "use client"; // src/role/role.ts var FSFPRQFR_elements = [ "a", "button", "details", "dialog", "div", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "img", "input", "label", "li", "nav", "ol", "p", "section", "select", "span", "textarea", "ul", "svg" ]; var FSFPRQFR_useRole = createHook((props) => { return props; }); var Role = createComponent((props) => { return _3ORBWXWF_createElement("div", props); }); if (false) {} Object.assign( Role, FSFPRQFR_elements.reduce((acc, element) => { acc[element] = createComponent((props) => { return _3ORBWXWF_createElement(element, props); }); return acc; }, {}) ); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/OAYFXAQ2.js "use client"; // src/disclosure/disclosure-context.tsx var OAYFXAQ2_ctx = createStoreContext(); var useDisclosureContext = OAYFXAQ2_ctx.useContext; var useDisclosureScopedContext = OAYFXAQ2_ctx.useScopedContext; var useDisclosureProviderContext = OAYFXAQ2_ctx.useProviderContext; var DisclosureContextProvider = OAYFXAQ2_ctx.ContextProvider; var DisclosureScopedContextProvider = OAYFXAQ2_ctx.ScopedContextProvider; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/G6BJYYBK.js "use client"; // src/dialog/dialog-context.tsx var G6BJYYBK_ctx = createStoreContext( [DisclosureContextProvider], [DisclosureScopedContextProvider] ); var useDialogContext = G6BJYYBK_ctx.useContext; var useDialogScopedContext = G6BJYYBK_ctx.useScopedContext; var useDialogProviderContext = G6BJYYBK_ctx.useProviderContext; var DialogContextProvider = G6BJYYBK_ctx.ContextProvider; var DialogScopedContextProvider = G6BJYYBK_ctx.ScopedContextProvider; var DialogHeadingContext = (0,external_React_.createContext)(void 0); var DialogDescriptionContext = (0,external_React_.createContext)(void 0); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7H5KSHHF.js "use client"; // src/popover/popover-context.tsx var _7H5KSHHF_ctx = createStoreContext( [DialogContextProvider], [DialogScopedContextProvider] ); var usePopoverContext = _7H5KSHHF_ctx.useContext; var usePopoverScopedContext = _7H5KSHHF_ctx.useScopedContext; var usePopoverProviderContext = _7H5KSHHF_ctx.useProviderContext; var PopoverContextProvider = _7H5KSHHF_ctx.ContextProvider; var PopoverScopedContextProvider = _7H5KSHHF_ctx.ScopedContextProvider; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/TI7CMBHW.js "use client"; // src/hovercard/hovercard-context.tsx var TI7CMBHW_ctx = createStoreContext( [PopoverContextProvider], [PopoverScopedContextProvider] ); var useHovercardContext = TI7CMBHW_ctx.useContext; var useHovercardScopedContext = TI7CMBHW_ctx.useScopedContext; var useHovercardProviderContext = TI7CMBHW_ctx.useProviderContext; var HovercardContextProvider = TI7CMBHW_ctx.ContextProvider; var HovercardScopedContextProvider = TI7CMBHW_ctx.ScopedContextProvider; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7X4DYKYU.js "use client"; // src/hovercard/hovercard-anchor.ts var useHovercardAnchor = createHook( (_a) => { var _b = _a, { store, showOnHover = true } = _b, props = __objRest(_b, ["store", "showOnHover"]); const context = useHovercardProviderContext(); store = store || context; invariant( store, false && 0 ); const disabled = disabledFromProps(props); const showTimeoutRef = (0,external_React_.useRef)(0); (0,external_React_.useEffect)(() => () => window.clearTimeout(showTimeoutRef.current), []); (0,external_React_.useEffect)(() => { const onMouseLeave = (event) => { if (!store) return; const { anchorElement } = store.getState(); if (!anchorElement) return; if (event.target !== anchorElement) return; window.clearTimeout(showTimeoutRef.current); showTimeoutRef.current = 0; }; return addGlobalEventListener("mouseleave", onMouseLeave, true); }, [store]); const onMouseMoveProp = props.onMouseMove; const showOnHoverProp = useBooleanEvent(showOnHover); const isMouseMoving = useIsMouseMoving(); const onMouseMove = useEvent( (event) => { onMouseMoveProp == null ? void 0 : onMouseMoveProp(event); if (disabled) return; if (!store) return; if (event.defaultPrevented) return; if (showTimeoutRef.current) return; if (!isMouseMoving()) return; if (!showOnHoverProp(event)) return; const element = event.currentTarget; store.setAnchorElement(element); store.setDisclosureElement(element); const { showTimeout, timeout } = store.getState(); const showHovercard = () => { showTimeoutRef.current = 0; if (!isMouseMoving()) return; store == null ? void 0 : store.setAnchorElement(element); store == null ? void 0 : store.show(); queueMicrotask(() => { store == null ? void 0 : store.setDisclosureElement(element); }); }; const timeoutMs = showTimeout != null ? showTimeout : timeout; if (timeoutMs === 0) { showHovercard(); } else { showTimeoutRef.current = window.setTimeout(showHovercard, timeoutMs); } } ); const ref = (0,external_React_.useCallback)( (element) => { if (!store) return; const { anchorElement } = store.getState(); if (anchorElement == null ? void 0 : anchorElement.isConnected) return; store.setAnchorElement(element); }, [store] ); props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { ref: useMergeRefs(ref, props.ref), onMouseMove }); props = useFocusable(props); return props; } ); var HovercardAnchor = createComponent( (props) => { const htmlProps = useHovercardAnchor(props); return _3ORBWXWF_createElement("a", htmlProps); } ); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/MNFF5YOJ.js "use client"; // src/tooltip/tooltip-context.tsx var MNFF5YOJ_ctx = createStoreContext( [HovercardContextProvider], [HovercardScopedContextProvider] ); var useTooltipContext = MNFF5YOJ_ctx.useContext; var useTooltipScopedContext = MNFF5YOJ_ctx.useScopedContext; var useTooltipProviderContext = MNFF5YOJ_ctx.useProviderContext; var TooltipContextProvider = MNFF5YOJ_ctx.ContextProvider; var TooltipScopedContextProvider = MNFF5YOJ_ctx.ScopedContextProvider; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/tooltip/tooltip-anchor.js "use client"; // src/tooltip/tooltip-anchor.ts var globalStore = createStore({ activeStore: null }); var useTooltipAnchor = createHook( (_a) => { var _b = _a, { store, showOnHover = true } = _b, props = __objRest(_b, ["store", "showOnHover"]); const context = useTooltipProviderContext(); store = store || context; invariant( store, false && 0 ); const canShowOnHoverRef = (0,external_React_.useRef)(false); (0,external_React_.useEffect)(() => { return sync(store, ["mounted"], (state) => { if (state.mounted) return; canShowOnHoverRef.current = false; }); }, [store]); (0,external_React_.useEffect)(() => { return sync(store, ["mounted", "skipTimeout"], (state) => { if (!store) return; if (state.mounted) { const { activeStore } = globalStore.getState(); if (activeStore !== store) { activeStore == null ? void 0 : activeStore.hide(); } return globalStore.setState("activeStore", store); } const id = setTimeout(() => { const { activeStore } = globalStore.getState(); if (activeStore !== store) return; globalStore.setState("activeStore", null); }, state.skipTimeout); return () => clearTimeout(id); }); }, [store]); const onMouseEnterProp = props.onMouseEnter; const onMouseEnter = useEvent((event) => { onMouseEnterProp == null ? void 0 : onMouseEnterProp(event); canShowOnHoverRef.current = true; }); const onFocusVisibleProp = props.onFocusVisible; const onFocusVisible = useEvent((event) => { onFocusVisibleProp == null ? void 0 : onFocusVisibleProp(event); if (event.defaultPrevented) return; store == null ? void 0 : store.setAnchorElement(event.currentTarget); store == null ? void 0 : store.show(); }); const onBlurProp = props.onBlur; const onBlur = useEvent((event) => { onBlurProp == null ? void 0 : onBlurProp(event); if (event.defaultPrevented) return; const { activeStore } = globalStore.getState(); if (activeStore === store) { globalStore.setState("activeStore", null); } }); const type = store.useState("type"); const contentId = store.useState((state) => { var _a2; return (_a2 = state.contentElement) == null ? void 0 : _a2.id; }); props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ "aria-labelledby": type === "label" ? contentId : void 0, "aria-describedby": type === "description" ? contentId : void 0 }, props), { onMouseEnter, onFocusVisible, onBlur }); props = useHovercardAnchor(_4R3V3JGP_spreadValues({ store, showOnHover: (event) => { if (!canShowOnHoverRef.current) return false; if (isFalsyBooleanCallback(showOnHover, event)) return false; const { activeStore } = globalStore.getState(); if (!activeStore) return true; store == null ? void 0 : store.show(); return false; } }, props)); return props; } ); var TooltipAnchor = createComponent((props) => { const htmlProps = useTooltipAnchor(props); return _3ORBWXWF_createElement("div", htmlProps); }); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/YMV43K4F.js "use client"; // src/hovercard/utils/polygon.ts function getEventPoint(event) { return [event.clientX, event.clientY]; } function isPointInPolygon(point, polygon) { const [x, y] = point; let inside = false; const length = polygon.length; for (let l = length, i = 0, j = l - 1; i < l; j = i++) { const [xi, yi] = polygon[i]; const [xj, yj] = polygon[j]; const [, vy] = polygon[j === 0 ? l - 1 : j - 1] || [0, 0]; const where = (yi - yj) * (x - xi) - (xi - xj) * (y - yi); if (yj < yi) { if (y >= yj && y < yi) { if (where === 0) return true; if (where > 0) { if (y === yj) { if (y > vy) { inside = !inside; } } else { inside = !inside; } } } } else if (yi < yj) { if (y > yi && y <= yj) { if (where === 0) return true; if (where < 0) { if (y === yj) { if (y < vy) { inside = !inside; } } else { inside = !inside; } } } } else if (y == yi && (x >= xj && x <= xi || x >= xi && x <= xj)) { return true; } } return inside; } function getEnterPointPlacement(enterPoint, rect) { const { top, right, bottom, left } = rect; const [x, y] = enterPoint; const placementX = x < left ? "left" : x > right ? "right" : null; const placementY = y < top ? "top" : y > bottom ? "bottom" : null; return [placementX, placementY]; } function getElementPolygon(element, enterPoint) { const rect = element.getBoundingClientRect(); const { top, right, bottom, left } = rect; const [x, y] = getEnterPointPlacement(enterPoint, rect); const polygon = [enterPoint]; if (x) { if (y !== "top") { polygon.push([x === "left" ? left : right, top]); } polygon.push([x === "left" ? right : left, top]); polygon.push([x === "left" ? right : left, bottom]); if (y !== "bottom") { polygon.push([x === "left" ? left : right, bottom]); } } else if (y === "top") { polygon.push([left, top]); polygon.push([left, bottom]); polygon.push([right, bottom]); polygon.push([right, top]); } else { polygon.push([left, bottom]); polygon.push([left, top]); polygon.push([right, top]); polygon.push([right, bottom]); } return polygon; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/MKDDWKFK.js "use client"; // src/dialog/utils/is-backdrop.ts function MKDDWKFK_isBackdrop(element, ...ids) { if (!element) return false; const backdrop = element.getAttribute("data-backdrop"); if (backdrop == null) return false; if (backdrop === "") return true; if (backdrop === "true") return true; if (!ids.length) return true; return ids.some((id) => backdrop === id); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/X6WIMZJE.js "use client"; // src/dialog/utils/orchestrate.ts var cleanups = /* @__PURE__ */ new WeakMap(); function orchestrate(element, key, setup) { if (!cleanups.has(element)) { cleanups.set(element, /* @__PURE__ */ new Map()); } const elementCleanups = cleanups.get(element); const prevCleanup = elementCleanups.get(key); if (!prevCleanup) { elementCleanups.set(key, setup()); return () => { var _a; (_a = elementCleanups.get(key)) == null ? void 0 : _a(); elementCleanups.delete(key); }; } const cleanup = setup(); const nextCleanup = () => { cleanup(); prevCleanup(); elementCleanups.delete(key); }; elementCleanups.set(key, nextCleanup); return () => { const isCurrent = elementCleanups.get(key) === nextCleanup; if (!isCurrent) return; cleanup(); elementCleanups.set(key, prevCleanup); }; } function setAttribute(element, attr, value) { const setup = () => { const previousValue = element.getAttribute(attr); element.setAttribute(attr, value); return () => { if (previousValue == null) { element.removeAttribute(attr); } else { element.setAttribute(attr, previousValue); } }; }; return orchestrate(element, attr, setup); } function setProperty(element, property, value) { const setup = () => { const exists = property in element; const previousValue = element[property]; element[property] = value; return () => { if (!exists) { delete element[property]; } else { element[property] = previousValue; } }; }; return orchestrate(element, property, setup); } function assignStyle(element, style) { if (!element) return () => { }; const setup = () => { const prevStyle = element.style.cssText; Object.assign(element.style, style); return () => { element.style.cssText = prevStyle; }; }; return orchestrate(element, "style", setup); } function setCSSProperty(element, property, value) { if (!element) return () => { }; const setup = () => { const previousValue = element.style.getPropertyValue(property); element.style.setProperty(property, value); return () => { if (previousValue) { element.style.setProperty(property, previousValue); } else { element.style.removeProperty(property); } }; }; return orchestrate(element, property, setup); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/72E5EPFF.js "use client"; // src/dialog/utils/walk-tree-outside.ts var ignoreTags = ["SCRIPT", "STYLE"]; function getSnapshotPropertyName(id) { return `__ariakit-dialog-snapshot-${id}`; } function inSnapshot(id, element) { const doc = DLOEKDPY_getDocument(element); const propertyName = getSnapshotPropertyName(id); if (!doc.body[propertyName]) return true; do { if (element === doc.body) return false; if (!!element[propertyName]) return true; if (!element.parentElement) return false; element = element.parentElement; } while (true); } function isValidElement(id, element, ignoredElements) { if (ignoreTags.includes(element.tagName)) return false; if (!inSnapshot(id, element)) return false; return !ignoredElements.some( (enabledElement) => enabledElement && contains(element, enabledElement) ); } function _72E5EPFF_walkTreeOutside(id, elements, callback, ancestorCallback) { for (let element of elements) { if (!(element == null ? void 0 : element.isConnected)) continue; const hasAncestorAlready = elements.some((maybeAncestor) => { if (!maybeAncestor) return false; if (maybeAncestor === element) return false; return maybeAncestor.contains(element); }); const doc = DLOEKDPY_getDocument(element); const originalElement = element; while (element.parentElement && element !== doc.body) { ancestorCallback == null ? void 0 : ancestorCallback(element.parentElement, originalElement); if (!hasAncestorAlready) { for (const child of element.parentElement.children) { if (isValidElement(id, child, elements)) { callback(child, originalElement); } } } element = element.parentElement; } } } function createWalkTreeSnapshot(id, elements) { const { body } = DLOEKDPY_getDocument(elements[0]); const cleanups = []; const markElement = (element) => { cleanups.push(setProperty(element, getSnapshotPropertyName(id), true)); }; _72E5EPFF_walkTreeOutside(id, elements, markElement); return chain( setProperty(body, getSnapshotPropertyName(id), true), () => cleanups.forEach((fn) => fn()) ); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/TL67WVI6.js "use client"; // src/dialog/utils/mark-tree-outside.ts function getPropertyName(id = "", ancestor = false) { return `__ariakit-dialog-${ancestor ? "ancestor" : "outside"}${id ? `-${id}` : ""}`; } function markElement(element, id = "") { return chain( setProperty(element, getPropertyName(), true), setProperty(element, getPropertyName(id), true) ); } function markAncestor(element, id = "") { return chain( setProperty(element, getPropertyName("", true), true), setProperty(element, getPropertyName(id, true), true) ); } function isElementMarked(element, id) { const ancestorProperty = getPropertyName(id, true); if (element[ancestorProperty]) return true; const elementProperty = getPropertyName(id); do { if (element[elementProperty]) return true; if (!element.parentElement) return false; element = element.parentElement; } while (true); } function markTreeOutside(id, elements) { const cleanups = []; const ids = elements.map((el) => el == null ? void 0 : el.id); _72E5EPFF_walkTreeOutside( id, elements, (element) => { if (MKDDWKFK_isBackdrop(element, ...ids)) return; cleanups.unshift(markElement(element, id)); }, (ancestor, element) => { const isAnotherDialogAncestor = element.hasAttribute("data-dialog") && element.id !== id; if (isAnotherDialogAncestor) return; cleanups.unshift(markAncestor(ancestor, id)); } ); const restoreAccessibilityTree = () => { cleanups.forEach((fn) => fn()); }; return restoreAccessibilityTree; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CLE7NTOY.js "use client"; // src/disclosure/disclosure-content.tsx function afterTimeout(timeoutMs, cb) { const timeoutId = setTimeout(cb, timeoutMs); return () => clearTimeout(timeoutId); } function CLE7NTOY_afterPaint(cb) { let raf = requestAnimationFrame(() => { raf = requestAnimationFrame(cb); }); return () => cancelAnimationFrame(raf); } function parseCSSTime(...times) { return times.join(", ").split(", ").reduce((longestTime, currentTimeString) => { const currentTime = parseFloat(currentTimeString || "0s") * 1e3; if (currentTime > longestTime) return currentTime; return longestTime; }, 0); } function isHidden(mounted, hidden, alwaysVisible) { return !alwaysVisible && hidden !== false && (!mounted || !!hidden); } var useDisclosureContent = createHook( (_a) => { var _b = _a, { store, alwaysVisible } = _b, props = __objRest(_b, ["store", "alwaysVisible"]); const context = useDisclosureProviderContext(); store = store || context; invariant( store, false && 0 ); const id = useId(props.id); const [transition, setTransition] = (0,external_React_.useState)(null); const open = store.useState("open"); const mounted = store.useState("mounted"); const animated = store.useState("animated"); const contentElement = store.useState("contentElement"); useSafeLayoutEffect(() => { if (!animated) return; if (!(contentElement == null ? void 0 : contentElement.isConnected)) { setTransition(null); return; } return CLE7NTOY_afterPaint(() => { setTransition(open ? "enter" : "leave"); }); }, [animated, contentElement, open]); useSafeLayoutEffect(() => { if (!store) return; if (!animated) return; if (!contentElement) return; if (!transition) return; if (transition === "enter" && !open) return; if (transition === "leave" && open) return; if (typeof animated === "number") { const timeoutMs2 = animated; return afterTimeout(timeoutMs2, store.stopAnimation); } const { transitionDuration, animationDuration, transitionDelay, animationDelay } = getComputedStyle(contentElement); const delay = parseCSSTime(transitionDelay, animationDelay); const duration = parseCSSTime(transitionDuration, animationDuration); const timeoutMs = delay + duration; if (!timeoutMs) return; return afterTimeout(timeoutMs, store.stopAnimation); }, [store, animated, contentElement, open, transition]); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(DialogScopedContextProvider, { value: store, children: element }), [store] ); const hidden = isHidden(mounted, props.hidden, alwaysVisible); const style = hidden ? _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props.style), { display: "none" }) : props.style; props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ id, "data-enter": transition === "enter" ? "" : void 0, "data-leave": transition === "leave" ? "" : void 0, hidden }, props), { ref: useMergeRefs(id ? store.setContentElement : null, props.ref), style }); return props; } ); var DisclosureContentImpl = createComponent( (props) => { const htmlProps = useDisclosureContent(props); return _3ORBWXWF_createElement("div", htmlProps); } ); var DisclosureContent = createComponent( (_a) => { var _b = _a, { unmountOnHide } = _b, props = __objRest(_b, ["unmountOnHide"]); const context = useDisclosureProviderContext(); const store = props.store || context; const mounted = useStoreState( store, (state) => !unmountOnHide || (state == null ? void 0 : state.mounted) ); if (mounted === false) return null; return /* @__PURE__ */ (0,jsx_runtime.jsx)(DisclosureContentImpl, _4R3V3JGP_spreadValues({}, props)); } ); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/LWHPHW7Q.js "use client"; // src/dialog/dialog-backdrop.tsx function DialogBackdrop({ store, backdrop, backdropProps, alwaysVisible, hidden }) { const ref = (0,external_React_.useRef)(null); const disclosure = useDisclosureStore({ disclosure: store }); const contentElement = store.useState("contentElement"); useSafeLayoutEffect(() => { const backdrop2 = ref.current; const dialog = contentElement; if (!backdrop2) return; if (!dialog) return; backdrop2.style.zIndex = getComputedStyle(dialog).zIndex; }, [contentElement]); useSafeLayoutEffect(() => { const id = contentElement == null ? void 0 : contentElement.id; if (!id) return; const backdrop2 = ref.current; if (!backdrop2) return; return markAncestor(backdrop2, id); }, [contentElement]); if (hidden != null) { backdropProps = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, backdropProps), { hidden }); } const props = useDisclosureContent(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ store: disclosure, role: "presentation", "data-backdrop": (contentElement == null ? void 0 : contentElement.id) || "", alwaysVisible }, backdropProps), { ref: useMergeRefs(backdropProps == null ? void 0 : backdropProps.ref, ref), style: _4R3V3JGP_spreadValues({ position: "fixed", top: 0, right: 0, bottom: 0, left: 0 }, backdropProps == null ? void 0 : backdropProps.style) })); if (!backdrop) return null; if ((0,external_React_.isValidElement)(backdrop)) { return /* @__PURE__ */ (0,jsx_runtime.jsx)(Role, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { render: backdrop })); } const Component = typeof backdrop !== "boolean" ? backdrop : "div"; return /* @__PURE__ */ (0,jsx_runtime.jsx)(Role, _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { render: /* @__PURE__ */ (0,jsx_runtime.jsx)(Component, {}) })); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BULCTPRV.js "use client"; // src/dialog/utils/disable-accessibility-tree-outside.ts function hideElementFromAccessibilityTree(element) { return setAttribute(element, "aria-hidden", "true"); } function disableAccessibilityTreeOutside(id, elements) { const cleanups = []; const ids = elements.map((el) => el == null ? void 0 : el.id); walkTreeOutside(id, elements, (element) => { if (isBackdrop(element, ...ids)) return; cleanups.unshift(hideElementFromAccessibilityTree(element)); }); const restoreAccessibilityTree = () => { cleanups.forEach((fn) => fn()); }; return restoreAccessibilityTree; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/677M2CI3.js "use client"; // src/dialog/utils/supports-inert.ts function supportsInert() { return "inert" in HTMLElement.prototype; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/TQYOGOE2.js "use client"; // src/dialog/utils/disable-tree.ts function disableTree(element, ignoredElements) { if (!("style" in element)) return noop; if (supportsInert()) { return setProperty(element, "inert", true); } const tabbableElements = getAllTabbableIn(element, true); const enableElements = tabbableElements.map((element2) => { if (ignoredElements == null ? void 0 : ignoredElements.some((el) => el && contains(el, element2))) return noop; return setAttribute(element2, "tabindex", "-1"); }); return chain( ...enableElements, hideElementFromAccessibilityTree(element), assignStyle(element, { pointerEvents: "none", userSelect: "none", cursor: "default" }) ); } function disableTreeOutside(id, elements) { const cleanups = []; const ids = elements.map((el) => el == null ? void 0 : el.id); _72E5EPFF_walkTreeOutside(id, elements, (element) => { if (MKDDWKFK_isBackdrop(element, ...ids)) return; cleanups.unshift(disableTree(element, elements)); }); const restoreTreeOutside = () => { cleanups.forEach((fn) => fn()); }; return restoreTreeOutside; } ;// CONCATENATED MODULE: external "ReactDOM" const external_ReactDOM_namespaceObject = window["ReactDOM"]; ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CS347UVZ.js "use client"; // src/dialog/utils/use-root-dialog.ts function useRootDialog({ attribute, contentId, contentElement, enabled }) { const [updated, retry] = useForceUpdate(); const isRootDialog = (0,external_React_.useCallback)(() => { if (!enabled) return false; if (!contentElement) return false; const { body } = DLOEKDPY_getDocument(contentElement); const id = body.getAttribute(attribute); return !id || id === contentId; }, [updated, enabled, contentElement, attribute, contentId]); (0,external_React_.useEffect)(() => { if (!enabled) return; if (!contentId) return; if (!contentElement) return; const { body } = DLOEKDPY_getDocument(contentElement); if (isRootDialog()) { body.setAttribute(attribute, contentId); return () => body.removeAttribute(attribute); } const observer = new MutationObserver(() => (0,external_ReactDOM_namespaceObject.flushSync)(retry)); observer.observe(body, { attributeFilter: [attribute] }); return () => observer.disconnect(); }, [updated, enabled, contentId, contentElement, isRootDialog, attribute]); return isRootDialog; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6BJGLK2C.js "use client"; // src/dialog/utils/use-prevent-body-scroll.ts function getPaddingProperty(documentElement) { const documentLeft = documentElement.getBoundingClientRect().left; const scrollbarX = Math.round(documentLeft) + documentElement.scrollLeft; return scrollbarX ? "paddingLeft" : "paddingRight"; } function usePreventBodyScroll(contentElement, contentId, enabled) { const isRootDialog = useRootDialog({ attribute: "data-dialog-prevent-body-scroll", contentElement, contentId, enabled }); (0,external_React_.useEffect)(() => { if (!isRootDialog()) return; if (!contentElement) return; const doc = DLOEKDPY_getDocument(contentElement); const win = getWindow(contentElement); const { documentElement, body } = doc; const cssScrollbarWidth = documentElement.style.getPropertyValue("--scrollbar-width"); const scrollbarWidth = cssScrollbarWidth ? parseInt(cssScrollbarWidth) : win.innerWidth - documentElement.clientWidth; const setScrollbarWidthProperty = () => setCSSProperty( documentElement, "--scrollbar-width", `${scrollbarWidth}px` ); const paddingProperty = getPaddingProperty(documentElement); const setStyle = () => assignStyle(body, { overflow: "hidden", [paddingProperty]: `${scrollbarWidth}px` }); const setIOSStyle = () => { var _a, _b; const { scrollX, scrollY, visualViewport } = win; const offsetLeft = (_a = visualViewport == null ? void 0 : visualViewport.offsetLeft) != null ? _a : 0; const offsetTop = (_b = visualViewport == null ? void 0 : visualViewport.offsetTop) != null ? _b : 0; const restoreStyle = assignStyle(body, { position: "fixed", overflow: "hidden", top: `${-(scrollY - Math.floor(offsetTop))}px`, left: `${-(scrollX - Math.floor(offsetLeft))}px`, right: "0", [paddingProperty]: `${scrollbarWidth}px` }); return () => { restoreStyle(); if (true) { win.scrollTo(scrollX, scrollY); } }; }; const isIOS = isApple() && !isMac(); return chain( setScrollbarWidthProperty(), isIOS ? setIOSStyle() : setStyle() ); }, [isRootDialog, contentElement]); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/IUB2BTEK.js "use client"; // src/dialog/utils/use-nested-dialogs.tsx var NestedDialogsContext = (0,external_React_.createContext)({}); function useNestedDialogs(store) { const context = (0,external_React_.useContext)(NestedDialogsContext); const [dialogs, setDialogs] = (0,external_React_.useState)([]); const add = (0,external_React_.useCallback)( (dialog) => { var _a; setDialogs((dialogs2) => [...dialogs2, dialog]); return chain((_a = context.add) == null ? void 0 : _a.call(context, dialog), () => { setDialogs((dialogs2) => dialogs2.filter((d) => d !== dialog)); }); }, [context] ); useSafeLayoutEffect(() => { return sync(store, ["open", "contentElement"], (state) => { var _a; if (!state.open) return; if (!state.contentElement) return; return (_a = context.add) == null ? void 0 : _a.call(context, store); }); }, [store, context]); const providerValue = (0,external_React_.useMemo)(() => ({ store, add }), [store, add]); const wrapElement = (0,external_React_.useCallback)( (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(NestedDialogsContext.Provider, { value: providerValue, children: element }), [providerValue] ); return { wrapElement, nestedDialogs: dialogs }; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/OOBDFMJL.js "use client"; // src/dialog/utils/use-previous-mouse-down-ref.ts function usePreviousMouseDownRef(enabled) { const previousMouseDownRef = (0,external_React_.useRef)(); (0,external_React_.useEffect)(() => { if (!enabled) { previousMouseDownRef.current = null; return; } const onMouseDown = (event) => { previousMouseDownRef.current = event.target; }; return addGlobalEventListener("mousedown", onMouseDown, true); }, [enabled]); return previousMouseDownRef; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XHJGS6Z5.js "use client"; // src/dialog/utils/use-hide-on-interact-outside.ts function isInDocument(target) { if (target.tagName === "HTML") return true; return contains(DLOEKDPY_getDocument(target).body, target); } function isDisclosure(disclosure, target) { if (!disclosure) return false; if (contains(disclosure, target)) return true; const activeId = target.getAttribute("aria-activedescendant"); if (activeId) { const activeElement = DLOEKDPY_getDocument(disclosure).getElementById(activeId); if (activeElement) { return contains(disclosure, activeElement); } } return false; } function isMouseEventOnDialog(event, dialog) { if (!("clientY" in event)) return false; const rect = dialog.getBoundingClientRect(); if (rect.width === 0 || rect.height === 0) return false; return rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width; } function useEventOutside({ store, type, listener, capture, domReady }) { const callListener = useEvent(listener); const open = store.useState("open"); const focusedRef = (0,external_React_.useRef)(false); useSafeLayoutEffect(() => { if (!open) return; if (!domReady) return; const { contentElement } = store.getState(); if (!contentElement) return; const onFocus = () => { focusedRef.current = true; }; contentElement.addEventListener("focusin", onFocus, true); return () => contentElement.removeEventListener("focusin", onFocus, true); }, [store, open, domReady]); (0,external_React_.useEffect)(() => { if (!open) return; const onEvent = (event) => { const { contentElement, disclosureElement } = store.getState(); const target = event.target; if (!contentElement) return; if (!target) return; if (!isInDocument(target)) return; if (contains(contentElement, target)) return; if (isDisclosure(disclosureElement, target)) return; if (target.hasAttribute("data-focus-trap")) return; if (isMouseEventOnDialog(event, contentElement)) return; const focused = focusedRef.current; if (focused && !isElementMarked(target, contentElement.id)) return; callListener(event); }; return addGlobalEventListener(type, onEvent, capture); }, [open, capture]); } function shouldHideOnInteractOutside(hideOnInteractOutside, event) { if (typeof hideOnInteractOutside === "function") { return hideOnInteractOutside(event); } return !!hideOnInteractOutside; } function useHideOnInteractOutside(store, hideOnInteractOutside, domReady) { const open = store.useState("open"); const previousMouseDownRef = usePreviousMouseDownRef(open); const props = { store, domReady, capture: true }; useEventOutside(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { type: "click", listener: (event) => { const { contentElement } = store.getState(); const previousMouseDown = previousMouseDownRef.current; if (!previousMouseDown) return; if (!isVisible(previousMouseDown)) return; if (!isElementMarked(previousMouseDown, contentElement == null ? void 0 : contentElement.id)) return; if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) return; store.hide(); } })); useEventOutside(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { type: "focusin", listener: (event) => { const { contentElement } = store.getState(); if (!contentElement) return; if (event.target === DLOEKDPY_getDocument(contentElement)) return; if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) return; store.hide(); } })); useEventOutside(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { type: "contextmenu", listener: (event) => { if (!shouldHideOnInteractOutside(hideOnInteractOutside, event)) return; store.hide(); } })); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6GXEOXGT.js "use client"; // src/dialog/utils/prepend-hidden-dismiss.ts function prependHiddenDismiss(container, onClick) { const document = DLOEKDPY_getDocument(container); const button = document.createElement("button"); button.type = "button"; button.tabIndex = -1; button.textContent = "Dismiss popup"; Object.assign(button.style, { border: "0px", clip: "rect(0 0 0 0)", height: "1px", margin: "-1px", overflow: "hidden", padding: "0px", position: "absolute", whiteSpace: "nowrap", width: "1px" }); button.addEventListener("click", onClick); container.prepend(button); const removeHiddenDismiss = () => { button.removeEventListener("click", onClick); button.remove(); }; return removeHiddenDismiss; } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/HPP6CWMY.js "use client"; // src/focusable/focusable-container.tsx var useFocusableContainer = createHook( (_a) => { var _b = _a, { autoFocusOnShow = true } = _b, props = __objRest(_b, ["autoFocusOnShow"]); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(FocusableContext.Provider, { value: autoFocusOnShow, children: element }), [autoFocusOnShow] ); return props; } ); var FocusableContainer = createComponent( (props) => { const htmlProps = useFocusableContainer(props); return _3ORBWXWF_createElement("div", htmlProps); } ); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XPF5GU3Q.js "use client"; // src/heading/heading-context.ts var HeadingContext = (0,external_React_.createContext)(0); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/UYRJLDVS.js "use client"; // src/heading/heading-level.tsx function HeadingLevel({ level, children }) { const contextLevel = (0,external_React_.useContext)(HeadingContext); const nextLevel = Math.max( Math.min(level || contextLevel + 1, 6), 1 ); return /* @__PURE__ */ (0,jsx_runtime.jsx)(HeadingContext.Provider, { value: nextLevel, children }); } ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BG6HZDS7.js "use client"; // src/visually-hidden/visually-hidden.ts var useVisuallyHidden = createHook((props) => { props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { style: _4R3V3JGP_spreadValues({ border: 0, clip: "rect(0 0 0 0)", height: "1px", margin: "-1px", overflow: "hidden", padding: 0, position: "absolute", whiteSpace: "nowrap", width: "1px" }, props.style) }); return props; }); var VisuallyHidden = createComponent( (props) => { const htmlProps = useVisuallyHidden(props); return _3ORBWXWF_createElement("span", htmlProps); } ); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CHKJ74UC.js "use client"; // src/focus-trap/focus-trap.ts var useFocusTrap = createHook((props) => { props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ "data-focus-trap": "", tabIndex: 0, "aria-hidden": true }, props), { style: _4R3V3JGP_spreadValues({ // Prevents unintended scroll jumps. position: "fixed", top: 0, left: 0 }, props.style) }); props = useVisuallyHidden(props); return props; }); var FocusTrap = createComponent((props) => { const htmlProps = useFocusTrap(props); return _3ORBWXWF_createElement("span", htmlProps); }); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7452U3HH.js "use client"; // src/portal/portal-context.ts var PortalContext = (0,external_React_.createContext)(null); ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/JPXNJYSO.js "use client"; // src/portal/portal.tsx function getRootElement(element) { return DLOEKDPY_getDocument(element).body; } function getPortalElement(element, portalElement) { if (!portalElement) { return DLOEKDPY_getDocument(element).createElement("div"); } if (typeof portalElement === "function") { return portalElement(element); } return portalElement; } function getRandomId(prefix = "id") { return `${prefix ? `${prefix}-` : ""}${Math.random().toString(36).substr(2, 6)}`; } function queueFocus(element) { queueMicrotask(() => { element == null ? void 0 : element.focus(); }); } var usePortal = createHook( (_a) => { var _b = _a, { preserveTabOrder, preserveTabOrderAnchor, portalElement, portalRef, portal = true } = _b, props = __objRest(_b, [ "preserveTabOrder", "preserveTabOrderAnchor", "portalElement", "portalRef", "portal" ]); const ref = (0,external_React_.useRef)(null); const refProp = useMergeRefs(ref, props.ref); const context = (0,external_React_.useContext)(PortalContext); const [portalNode, setPortalNode] = (0,external_React_.useState)(null); const [anchorPortalNode, setAnchorPortalNode] = (0,external_React_.useState)(null); const outerBeforeRef = (0,external_React_.useRef)(null); const innerBeforeRef = (0,external_React_.useRef)(null); const innerAfterRef = (0,external_React_.useRef)(null); const outerAfterRef = (0,external_React_.useRef)(null); useSafeLayoutEffect(() => { const element = ref.current; if (!element || !portal) { setPortalNode(null); return; } const portalEl = getPortalElement(element, portalElement); if (!portalEl) { setPortalNode(null); return; } const isPortalInDocument = portalEl.isConnected; if (!isPortalInDocument) { const rootElement = context || getRootElement(element); rootElement.appendChild(portalEl); } if (!portalEl.id) { portalEl.id = element.id ? `portal/${element.id}` : getRandomId(); } setPortalNode(portalEl); setRef(portalRef, portalEl); if (isPortalInDocument) return; return () => { portalEl.remove(); setRef(portalRef, null); }; }, [portal, portalElement, context, portalRef]); useSafeLayoutEffect(() => { if (!preserveTabOrder) return; if (!preserveTabOrderAnchor) return; const doc = DLOEKDPY_getDocument(preserveTabOrderAnchor); const element = doc.createElement("span"); element.style.position = "fixed"; preserveTabOrderAnchor.insertAdjacentElement("afterend", element); setAnchorPortalNode(element); return () => { element.remove(); setAnchorPortalNode(null); }; }, [preserveTabOrder, preserveTabOrderAnchor]); (0,external_React_.useEffect)(() => { if (!portalNode) return; if (!preserveTabOrder) return; let raf = 0; const onFocus = (event) => { if (!isFocusEventOutside(event)) return; const focusing = event.type === "focusin"; cancelAnimationFrame(raf); if (focusing) { return restoreFocusIn(portalNode); } raf = requestAnimationFrame(() => { disableFocusIn(portalNode, true); }); }; portalNode.addEventListener("focusin", onFocus, true); portalNode.addEventListener("focusout", onFocus, true); return () => { cancelAnimationFrame(raf); portalNode.removeEventListener("focusin", onFocus, true); portalNode.removeEventListener("focusout", onFocus, true); }; }, [portalNode, preserveTabOrder]); props = useWrapElement( props, (element) => { element = // While the portal node is not in the DOM, we need to pass the // current context to the portal context, otherwise it's going to // reset to the body element on nested portals. /* @__PURE__ */ (0,jsx_runtime.jsx)(PortalContext.Provider, { value: portalNode || context, children: element }); if (!portal) return element; if (!portalNode) { return /* @__PURE__ */ (0,jsx_runtime.jsx)( "span", { ref: refProp, id: props.id, style: { position: "fixed" }, hidden: true } ); } element = /* @__PURE__ */ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ preserveTabOrder && portalNode && /* @__PURE__ */ (0,jsx_runtime.jsx)( FocusTrap, { ref: innerBeforeRef, className: "__focus-trap-inner-before", onFocus: (event) => { if (isFocusEventOutside(event, portalNode)) { queueFocus(getNextTabbable()); } else { queueFocus(outerBeforeRef.current); } } } ), element, preserveTabOrder && portalNode && /* @__PURE__ */ (0,jsx_runtime.jsx)( FocusTrap, { ref: innerAfterRef, className: "__focus-trap-inner-after", onFocus: (event) => { if (isFocusEventOutside(event, portalNode)) { queueFocus(getPreviousTabbable()); } else { queueFocus(outerAfterRef.current); } } } ) ] }); if (portalNode) { element = (0,external_ReactDOM_namespaceObject.createPortal)(element, portalNode); } let preserveTabOrderElement = /* @__PURE__ */ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ preserveTabOrder && portalNode && /* @__PURE__ */ (0,jsx_runtime.jsx)( FocusTrap, { ref: outerBeforeRef, className: "__focus-trap-outer-before", onFocus: (event) => { const fromOuter = event.relatedTarget === outerAfterRef.current; if (!fromOuter && isFocusEventOutside(event, portalNode)) { queueFocus(innerBeforeRef.current); } else { queueFocus(getPreviousTabbable()); } } } ), preserveTabOrder && // We're using position: fixed here so that the browser doesn't // add margin to the element when setting gap on a parent element. /* @__PURE__ */ (0,jsx_runtime.jsx)("span", { "aria-owns": portalNode == null ? void 0 : portalNode.id, style: { position: "fixed" } }), preserveTabOrder && portalNode && /* @__PURE__ */ (0,jsx_runtime.jsx)( FocusTrap, { ref: outerAfterRef, className: "__focus-trap-outer-after", onFocus: (event) => { if (isFocusEventOutside(event, portalNode)) { queueFocus(innerAfterRef.current); } else { const nextTabbable = getNextTabbable(); if (nextTabbable === innerBeforeRef.current) { requestAnimationFrame(() => { var _a2; return (_a2 = getNextTabbable()) == null ? void 0 : _a2.focus(); }); return; } queueFocus(nextTabbable); } } } ) ] }); if (anchorPortalNode && preserveTabOrder) { preserveTabOrderElement = (0,external_ReactDOM_namespaceObject.createPortal)( preserveTabOrderElement, anchorPortalNode ); } return /* @__PURE__ */ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ preserveTabOrderElement, element ] }); }, [ portalNode, context, portal, props.id, preserveTabOrder, anchorPortalNode ] ); props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { ref: refProp }); return props; } ); var Portal = createComponent((props) => { const htmlProps = usePortal(props); return _3ORBWXWF_createElement("div", htmlProps); }); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/NERBASET.js "use client"; // src/dialog/dialog.tsx var NERBASET_isSafariBrowser = isSafari(); function isAlreadyFocusingAnotherElement(dialog) { const activeElement = getActiveElement(); if (!activeElement) return false; if (dialog && contains(dialog, activeElement)) return false; if (isFocusable(activeElement)) return true; return false; } function getElementFromProp(prop, focusable = false) { if (!prop) return null; const element = "current" in prop ? prop.current : prop; if (!element) return null; if (focusable) return isFocusable(element) ? element : null; return element; } var useDialog = createHook( (_a) => { var _b = _a, { store: storeProp, open: openProp, onClose, focusable = true, modal = true, portal = !!modal, backdrop = !!modal, backdropProps, hideOnEscape = true, hideOnInteractOutside = true, getPersistentElements, preventBodyScroll = !!modal, autoFocusOnShow = true, autoFocusOnHide = true, initialFocus, finalFocus, unmountOnHide } = _b, props = __objRest(_b, [ "store", "open", "onClose", "focusable", "modal", "portal", "backdrop", "backdropProps", "hideOnEscape", "hideOnInteractOutside", "getPersistentElements", "preventBodyScroll", "autoFocusOnShow", "autoFocusOnHide", "initialFocus", "finalFocus", "unmountOnHide" ]); const context = useDialogProviderContext(); const ref = (0,external_React_.useRef)(null); const store = useDialogStore({ store: storeProp || context, open: openProp, setOpen(open2) { if (open2) return; const dialog = ref.current; if (!dialog) return; const event = new Event("close", { bubbles: false, cancelable: true }); if (onClose) { dialog.addEventListener("close", onClose, { once: true }); } dialog.dispatchEvent(event); if (!event.defaultPrevented) return; store.setOpen(true); } }); const { portalRef, domReady } = usePortalRef(portal, props.portalRef); const preserveTabOrderProp = props.preserveTabOrder; const preserveTabOrder = store.useState( (state) => preserveTabOrderProp && !modal && state.mounted ); const id = useId(props.id); const open = store.useState("open"); const mounted = store.useState("mounted"); const contentElement = store.useState("contentElement"); const hidden = isHidden(mounted, props.hidden, props.alwaysVisible); usePreventBodyScroll(contentElement, id, preventBodyScroll && !hidden); useHideOnInteractOutside(store, hideOnInteractOutside, domReady); const { wrapElement, nestedDialogs } = useNestedDialogs(store); props = useWrapElement(props, wrapElement, [wrapElement]); if (false) {} useSafeLayoutEffect(() => { if (!open) return; const dialog = ref.current; const activeElement = getActiveElement(dialog, true); if (!activeElement) return; if (activeElement.tagName === "BODY") return; if (dialog && contains(dialog, activeElement)) return; store.setDisclosureElement(activeElement); }, [store, open]); if (NERBASET_isSafariBrowser) { (0,external_React_.useEffect)(() => { if (!mounted) return; const { disclosureElement } = store.getState(); if (!disclosureElement) return; if (!isButton(disclosureElement)) return; const onMouseDown = () => { let receivedFocus = false; const onFocus = () => { receivedFocus = true; }; const options = { capture: true, once: true }; disclosureElement.addEventListener("focusin", onFocus, options); queueBeforeEvent(disclosureElement, "mouseup", () => { disclosureElement.removeEventListener("focusin", onFocus, true); if (receivedFocus) return; focusIfNeeded(disclosureElement); }); }; disclosureElement.addEventListener("mousedown", onMouseDown); return () => { disclosureElement.removeEventListener("mousedown", onMouseDown); }; }, [store, mounted]); } (0,external_React_.useEffect)(() => { if (!modal) return; if (!mounted) return; if (!domReady) return; const dialog = ref.current; if (!dialog) return; const existingDismiss = dialog.querySelector("[data-dialog-dismiss]"); if (existingDismiss) return; return prependHiddenDismiss(dialog, store.hide); }, [store, modal, mounted, domReady]); useSafeLayoutEffect(() => { if (open) return; if (!mounted) return; if (!domReady) return; const dialog = ref.current; if (!dialog) return; return disableTree(dialog); }, [open, mounted, domReady]); const canTakeTreeSnapshot = open && domReady; useSafeLayoutEffect(() => { if (!id) return; if (!canTakeTreeSnapshot) return; const dialog = ref.current; return createWalkTreeSnapshot(id, [dialog]); }, [id, canTakeTreeSnapshot]); const getPersistentElementsProp = useEvent(getPersistentElements); useSafeLayoutEffect(() => { if (!id) return; if (!canTakeTreeSnapshot) return; const { disclosureElement } = store.getState(); const dialog = ref.current; const persistentElements = getPersistentElementsProp() || []; const allElements = [ dialog, ...persistentElements, ...nestedDialogs.map((dialog2) => dialog2.getState().contentElement) ]; if (modal) { return chain( markTreeOutside(id, allElements), disableTreeOutside(id, allElements) ); } return markTreeOutside(id, [disclosureElement, ...allElements]); }, [ id, store, canTakeTreeSnapshot, getPersistentElementsProp, nestedDialogs, modal ]); const mayAutoFocusOnShow = !!autoFocusOnShow; const autoFocusOnShowProp = useBooleanEvent(autoFocusOnShow); const [autoFocusEnabled, setAutoFocusEnabled] = (0,external_React_.useState)(false); (0,external_React_.useEffect)(() => { if (!open) return; if (!mayAutoFocusOnShow) return; if (!domReady) return; if (!(contentElement == null ? void 0 : contentElement.isConnected)) return; const element = getElementFromProp(initialFocus, true) || // If no initial focus is specified, we try to focus the first element // with the autofocus attribute. If it's an Ariakit component, the // Focusable component will consume the autoFocus prop and add the // data-autofocus attribute to the element instead. contentElement.querySelector( "[data-autofocus=true],[autofocus]" ) || // We have to fallback to the first focusable element otherwise portaled // dialogs with preserveTabOrder set to true will not receive focus // properly because the elements aren't tabbable until the dialog // receives focus. getFirstTabbableIn(contentElement, true, portal && preserveTabOrder) || // Finally, we fallback to the dialog element itself. contentElement; const isElementFocusable = isFocusable(element); if (!autoFocusOnShowProp(isElementFocusable ? element : null)) return; setAutoFocusEnabled(true); queueMicrotask(() => { element.focus(); if (!NERBASET_isSafariBrowser) return; element.scrollIntoView({ block: "nearest", inline: "nearest" }); }); }, [ open, mayAutoFocusOnShow, domReady, contentElement, initialFocus, portal, preserveTabOrder, autoFocusOnShowProp ]); const mayAutoFocusOnHide = !!autoFocusOnHide; const autoFocusOnHideProp = useBooleanEvent(autoFocusOnHide); const [hasOpened, setHasOpened] = (0,external_React_.useState)(false); (0,external_React_.useEffect)(() => { if (!open) return; setHasOpened(true); return () => setHasOpened(false); }, [open]); const focusOnHide = (0,external_React_.useCallback)( (dialog, retry = true) => { const { disclosureElement } = store.getState(); if (isAlreadyFocusingAnotherElement(dialog)) return; let element = getElementFromProp(finalFocus) || disclosureElement; if (element == null ? void 0 : element.id) { const doc = DLOEKDPY_getDocument(element); const selector = `[aria-activedescendant="${element.id}"]`; const composite = doc.querySelector(selector); if (composite) { element = composite; } } if (element && !isFocusable(element)) { const maybeParentDialog = DLOEKDPY_closest(element, "[data-dialog]"); if (maybeParentDialog && maybeParentDialog.id) { const doc = DLOEKDPY_getDocument(maybeParentDialog); const selector = `[aria-controls~="${maybeParentDialog.id}"]`; const control = doc.querySelector(selector); if (control) { element = control; } } } const isElementFocusable = element && isFocusable(element); if (!isElementFocusable && retry) { requestAnimationFrame(() => focusOnHide(dialog, false)); return; } if (!autoFocusOnHideProp(isElementFocusable ? element : null)) return; if (!isElementFocusable) return; element == null ? void 0 : element.focus(); }, [store, finalFocus, autoFocusOnHideProp] ); useSafeLayoutEffect(() => { if (open) return; if (!hasOpened) return; if (!mayAutoFocusOnHide) return; const dialog = ref.current; focusOnHide(dialog); }, [open, hasOpened, domReady, mayAutoFocusOnHide, focusOnHide]); (0,external_React_.useEffect)(() => { if (!hasOpened) return; if (!mayAutoFocusOnHide) return; const dialog = ref.current; return () => focusOnHide(dialog); }, [hasOpened, mayAutoFocusOnHide, focusOnHide]); const hideOnEscapeProp = useBooleanEvent(hideOnEscape); (0,external_React_.useEffect)(() => { if (!domReady) return; if (!mounted) return; const onKeyDown = (event) => { if (event.key !== "Escape") return; if (event.defaultPrevented) return; const dialog = ref.current; if (!dialog) return; if (isElementMarked(dialog)) return; const target = event.target; if (!target) return; const { disclosureElement } = store.getState(); const isValidTarget = () => { if (target.tagName === "BODY") return true; if (contains(dialog, target)) return true; if (!disclosureElement) return true; if (contains(disclosureElement, target)) return true; return false; }; if (!isValidTarget()) return; if (!hideOnEscapeProp(event)) return; store.hide(); }; return addGlobalEventListener("keydown", onKeyDown, true); }, [store, domReady, mounted, hideOnEscapeProp]); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(HeadingLevel, { level: modal ? 1 : void 0, children: element }), [modal] ); const hiddenProp = props.hidden; const alwaysVisible = props.alwaysVisible; props = useWrapElement( props, (element) => { if (!backdrop) return element; return /* @__PURE__ */ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /* @__PURE__ */ (0,jsx_runtime.jsx)( DialogBackdrop, { store, backdrop, backdropProps, hidden: hiddenProp, alwaysVisible } ), element ] }); }, [store, backdrop, backdropProps, hiddenProp, alwaysVisible] ); const [headingId, setHeadingId] = (0,external_React_.useState)(); const [descriptionId, setDescriptionId] = (0,external_React_.useState)(); props = useWrapElement( props, (element) => /* @__PURE__ */ (0,jsx_runtime.jsx)(DialogScopedContextProvider, { value: store, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(DialogHeadingContext.Provider, { value: setHeadingId, children: /* @__PURE__ */ (0,jsx_runtime.jsx)(DialogDescriptionContext.Provider, { value: setDescriptionId, children: element }) }) }), [store] ); props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ id, "data-dialog": "", role: "dialog", tabIndex: focusable ? -1 : void 0, "aria-labelledby": headingId, "aria-describedby": descriptionId }, props), { ref: useMergeRefs(ref, props.ref) }); props = useFocusableContainer(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { autoFocusOnShow: autoFocusEnabled })); props = useDisclosureContent(_4R3V3JGP_spreadValues({ store }, props)); props = useFocusable(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), { focusable })); props = usePortal(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({ portal }, props), { portalRef, preserveTabOrder })); return props; } ); function createDialogComponent(Component, useProviderContext = useDialogProviderContext) { return createComponent((props) => { const context = useProviderContext(); const store = props.store || context; const mounted = useStoreState( store, (state) => !props.unmountOnHide || (state == null ? void 0 : state.mounted) || !!props.open ); if (!mounted) return null; return /* @__PURE__ */ (0,jsx_runtime.jsx)(Component, _4R3V3JGP_spreadValues({}, props)); }); } var Dialog = createDialogComponent( createComponent((props) => { const htmlProps = useDialog(props); return _3ORBWXWF_createElement("div", htmlProps); }), useDialogProviderContext ); if (false) {} ;// CONCATENATED MODULE: ./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs const floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left'])); const alignments = (/* unused pure expression or super */ null && (['start', 'end'])); const floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []))); const floating_ui_utils_min = Math.min; const floating_ui_utils_max = Math.max; const round = Math.round; const floor = Math.floor; const createCoords = v => ({ x: v, y: v }); const oppositeSideMap = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; const oppositeAlignmentMap = { start: 'end', end: 'start' }; function clamp(start, value, end) { return floating_ui_utils_max(start, floating_ui_utils_min(value, end)); } function floating_ui_utils_evaluate(value, param) { return typeof value === 'function' ? value(param) : value; } function floating_ui_utils_getSide(placement) { return placement.split('-')[0]; } function floating_ui_utils_getAlignment(placement) { return placement.split('-')[1]; } function getOppositeAxis(axis) { return axis === 'x' ? 'y' : 'x'; } function getAxisLength(axis) { return axis === 'y' ? 'height' : 'width'; } function floating_ui_utils_getSideAxis(placement) { return ['top', 'bottom'].includes(floating_ui_utils_getSide(placement)) ? 'y' : 'x'; } function getAlignmentAxis(placement) { return getOppositeAxis(floating_ui_utils_getSideAxis(placement)); } function floating_ui_utils_getAlignmentSides(placement, rects, rtl) { if (rtl === void 0) { rtl = false; } const alignment = floating_ui_utils_getAlignment(placement); const alignmentAxis = getAlignmentAxis(placement); const length = getAxisLength(alignmentAxis); let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; if (rects.reference[length] > rects.floating[length]) { mainAlignmentSide = getOppositePlacement(mainAlignmentSide); } return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; } function getExpandedPlacements(placement) { const oppositePlacement = getOppositePlacement(placement); return [floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)]; } function floating_ui_utils_getOppositeAlignmentPlacement(placement) { return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]); } function getSideList(side, isStart, rtl) { const lr = ['left', 'right']; const rl = ['right', 'left']; const tb = ['top', 'bottom']; const bt = ['bottom', 'top']; switch (side) { case 'top': case 'bottom': if (rtl) return isStart ? rl : lr; return isStart ? lr : rl; case 'left': case 'right': return isStart ? tb : bt; default: return []; } } function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { const alignment = floating_ui_utils_getAlignment(placement); let list = getSideList(floating_ui_utils_getSide(placement), direction === 'start', rtl); if (alignment) { list = list.map(side => side + "-" + alignment); if (flipAlignment) { list = list.concat(list.map(floating_ui_utils_getOppositeAlignmentPlacement)); } } return list; } function getOppositePlacement(placement) { return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]); } function expandPaddingObject(padding) { return { top: 0, right: 0, bottom: 0, left: 0, ...padding }; } function floating_ui_utils_getPaddingObject(padding) { return typeof padding !== 'number' ? expandPaddingObject(padding) : { top: padding, right: padding, bottom: padding, left: padding }; } function floating_ui_utils_rectToClientRect(rect) { return { ...rect, top: rect.y, left: rect.x, right: rect.x + rect.width, bottom: rect.y + rect.height }; } ;// CONCATENATED MODULE: ./node_modules/@floating-ui/core/dist/floating-ui.core.mjs function computeCoordsFromPlacement(_ref, placement, rtl) { let { reference, floating } = _ref; const sideAxis = floating_ui_utils_getSideAxis(placement); const alignmentAxis = getAlignmentAxis(placement); const alignLength = getAxisLength(alignmentAxis); const side = floating_ui_utils_getSide(placement); const isVertical = sideAxis === 'y'; const commonX = reference.x + reference.width / 2 - floating.width / 2; const commonY = reference.y + reference.height / 2 - floating.height / 2; const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; let coords; switch (side) { case 'top': coords = { x: commonX, y: reference.y - floating.height }; break; case 'bottom': coords = { x: commonX, y: reference.y + reference.height }; break; case 'right': coords = { x: reference.x + reference.width, y: commonY }; break; case 'left': coords = { x: reference.x - floating.width, y: commonY }; break; default: coords = { x: reference.x, y: reference.y }; } switch (floating_ui_utils_getAlignment(placement)) { case 'start': coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); break; case 'end': coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); break; } return coords; } /** * Computes the `x` and `y` coordinates that will place the floating element * next to a reference element when it is given a certain positioning strategy. * * This export does not have any `platform` interface logic. You will need to * write one for the platform you are using Floating UI with. */ const computePosition = async (reference, floating, config) => { const { placement = 'bottom', strategy = 'absolute', middleware = [], platform } = config; const validMiddleware = middleware.filter(Boolean); const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); let rects = await platform.getElementRects({ reference, floating, strategy }); let { x, y } = computeCoordsFromPlacement(rects, placement, rtl); let statefulPlacement = placement; let middlewareData = {}; let resetCount = 0; for (let i = 0; i < validMiddleware.length; i++) { const { name, fn } = validMiddleware[i]; const { x: nextX, y: nextY, data, reset } = await fn({ x, y, initialPlacement: placement, placement: statefulPlacement, strategy, middlewareData, rects, platform, elements: { reference, floating } }); x = nextX != null ? nextX : x; y = nextY != null ? nextY : y; middlewareData = { ...middlewareData, [name]: { ...middlewareData[name], ...data } }; if (reset && resetCount <= 50) { resetCount++; if (typeof reset === 'object') { if (reset.placement) { statefulPlacement = reset.placement; } if (reset.rects) { rects = reset.rects === true ? await platform.getElementRects({ reference, floating, strategy }) : reset.rects; } ({ x, y } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); } i = -1; continue; } } return { x, y, placement: statefulPlacement, strategy, middlewareData }; }; /** * Resolves with an object of overflow side offsets that determine how much the * element is overflowing a given clipping boundary on each side. * - positive = overflowing the boundary by that number of pixels * - negative = how many pixels left before it will overflow * - 0 = lies flush with the boundary * @see https://floating-ui.com/docs/detectOverflow */ async function detectOverflow(state, options) { var _await$platform$isEle; if (options === void 0) { options = {}; } const { x, y, platform, rects, elements, strategy } = state; const { boundary = 'clippingAncestors', rootBoundary = 'viewport', elementContext = 'floating', altBoundary = false, padding = 0 } = floating_ui_utils_evaluate(options, state); const paddingObject = floating_ui_utils_getPaddingObject(padding); const altContext = elementContext === 'floating' ? 'reference' : 'floating'; const element = elements[altBoundary ? altContext : elementContext]; const clippingClientRect = floating_ui_utils_rectToClientRect(await platform.getClippingRect({ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), boundary, rootBoundary, strategy })); const rect = elementContext === 'floating' ? { ...rects.floating, x, y } : rects.reference; const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { x: 1, y: 1 } : { x: 1, y: 1 }; const elementClientRect = floating_ui_utils_rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ rect, offsetParent, strategy }) : rect); return { top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x }; } /** * Provides data to position an inner element of the floating element so that it * appears centered to the reference element. * @see https://floating-ui.com/docs/arrow */ const arrow = options => ({ name: 'arrow', options, async fn(state) { const { x, y, placement, rects, platform, elements, middlewareData } = state; // Since `element` is required, we don't Partial<> the type. const { element, padding = 0 } = floating_ui_utils_evaluate(options, state) || {}; if (element == null) { return {}; } const paddingObject = floating_ui_utils_getPaddingObject(padding); const coords = { x, y }; const axis = getAlignmentAxis(placement); const length = getAxisLength(axis); const arrowDimensions = await platform.getDimensions(element); const isYAxis = axis === 'y'; const minProp = isYAxis ? 'top' : 'left'; const maxProp = isYAxis ? 'bottom' : 'right'; const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; const startDiff = coords[axis] - rects.reference[axis]; const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; // DOM platform can return `window` as the `offsetParent`. if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { clientSize = elements.floating[clientProp] || rects.floating[length]; } const centerToReference = endDiff / 2 - startDiff / 2; // If the padding is large enough that it causes the arrow to no longer be // centered, modify the padding so that it is centered. const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; const minPadding = floating_ui_utils_min(paddingObject[minProp], largestPossiblePadding); const maxPadding = floating_ui_utils_min(paddingObject[maxProp], largestPossiblePadding); // Make sure the arrow doesn't overflow the floating element if the center // point is outside the floating element's bounds. const min$1 = minPadding; const max = clientSize - arrowDimensions[length] - maxPadding; const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; const offset = clamp(min$1, center, max); // If the reference is small enough that the arrow's padding causes it to // to point to nothing for an aligned placement, adjust the offset of the // floating element itself. To ensure `shift()` continues to take action, // a single reset is performed when this is true. const shouldAddOffset = !middlewareData.arrow && floating_ui_utils_getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; return { [axis]: coords[axis] + alignmentOffset, data: { [axis]: offset, centerOffset: center - offset - alignmentOffset, ...(shouldAddOffset && { alignmentOffset }) }, reset: shouldAddOffset }; } }); function getPlacementList(alignment, autoAlignment, allowedPlacements) { const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement); return allowedPlacementsSortedByAlignment.filter(placement => { if (alignment) { return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false); } return true; }); } /** * Optimizes the visibility of the floating element by choosing the placement * that has the most space available automatically, without needing to specify a * preferred placement. Alternative to `flip`. * @see https://floating-ui.com/docs/autoPlacement */ const autoPlacement = function (options) { if (options === void 0) { options = {}; } return { name: 'autoPlacement', options, async fn(state) { var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; const { rects, middlewareData, placement, platform, elements } = state; const { crossAxis = false, alignment, allowedPlacements = placements, autoAlignment = true, ...detectOverflowOptions } = evaluate(options, state); const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; const overflow = await detectOverflow(state, detectOverflowOptions); const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; const currentPlacement = placements$1[currentIndex]; if (currentPlacement == null) { return {}; } const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); // Make `computeCoords` start from the right place. if (placement !== currentPlacement) { return { reset: { placement: placements$1[0] } }; } const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]]; const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { placement: currentPlacement, overflows: currentOverflows }]; const nextPlacement = placements$1[currentIndex + 1]; // There are more placements to check. if (nextPlacement) { return { data: { index: currentIndex + 1, overflows: allOverflows }, reset: { placement: nextPlacement } }; } const placementsSortedByMostSpace = allOverflows.map(d => { const alignment = getAlignment(d.placement); return [d.placement, alignment && crossAxis ? // Check along the mainAxis and main crossAxis side. d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : // Check only the mainAxis. d.overflows[0], d.overflows]; }).sort((a, b) => a[1] - b[1]); const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, // Aligned placements should not check their opposite crossAxis // side. getAlignment(d[0]) ? 2 : 3).every(v => v <= 0)); const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; if (resetPlacement !== placement) { return { data: { index: currentIndex + 1, overflows: allOverflows }, reset: { placement: resetPlacement } }; } return {}; } }; }; /** * Optimizes the visibility of the floating element by flipping the `placement` * in order to keep it in view when the preferred placement(s) will overflow the * clipping boundary. Alternative to `autoPlacement`. * @see https://floating-ui.com/docs/flip */ const flip = function (options) { if (options === void 0) { options = {}; } return { name: 'flip', options, async fn(state) { var _middlewareData$arrow, _middlewareData$flip; const { placement, middlewareData, rects, initialPlacement, platform, elements } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = 'bestFit', fallbackAxisSideDirection = 'none', flipAlignment = true, ...detectOverflowOptions } = floating_ui_utils_evaluate(options, state); // If a reset by the arrow was caused due to an alignment offset being // added, we should skip any logic now since `flip()` has already done its // work. // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { return {}; } const side = floating_ui_utils_getSide(placement); const isBasePlacement = floating_ui_utils_getSide(initialPlacement) === initialPlacement; const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') { fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); } const placements = [initialPlacement, ...fallbackPlacements]; const overflow = await detectOverflow(state, detectOverflowOptions); const overflows = []; let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; if (checkMainAxis) { overflows.push(overflow[side]); } if (checkCrossAxis) { const sides = floating_ui_utils_getAlignmentSides(placement, rects, rtl); overflows.push(overflow[sides[0]], overflow[sides[1]]); } overflowsData = [...overflowsData, { placement, overflows }]; // One or more sides is overflowing. if (!overflows.every(side => side <= 0)) { var _middlewareData$flip2, _overflowsData$filter; const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; const nextPlacement = placements[nextIndex]; if (nextPlacement) { // Try next placement and re-run the lifecycle. return { data: { index: nextIndex, overflows: overflowsData }, reset: { placement: nextPlacement } }; } // First, find the candidates that fit on the mainAxis side of overflow, // then find the placement that fits the best on the main crossAxis side. let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; // Otherwise fallback. if (!resetPlacement) { switch (fallbackStrategy) { case 'bestFit': { var _overflowsData$map$so; const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0]; if (placement) { resetPlacement = placement; } break; } case 'initialPlacement': resetPlacement = initialPlacement; break; } } if (placement !== resetPlacement) { return { reset: { placement: resetPlacement } }; } } return {}; } }; }; function getSideOffsets(overflow, rect) { return { top: overflow.top - rect.height, right: overflow.right - rect.width, bottom: overflow.bottom - rect.height, left: overflow.left - rect.width }; } function isAnySideFullyClipped(overflow) { return sides.some(side => overflow[side] >= 0); } /** * Provides data to hide the floating element in applicable situations, such as * when it is not in the same clipping context as the reference element. * @see https://floating-ui.com/docs/hide */ const hide = function (options) { if (options === void 0) { options = {}; } return { name: 'hide', options, async fn(state) { const { rects } = state; const { strategy = 'referenceHidden', ...detectOverflowOptions } = evaluate(options, state); switch (strategy) { case 'referenceHidden': { const overflow = await detectOverflow(state, { ...detectOverflowOptions, elementContext: 'reference' }); const offsets = getSideOffsets(overflow, rects.reference); return { data: { referenceHiddenOffsets: offsets, referenceHidden: isAnySideFullyClipped(offsets) } }; } case 'escaped': { const overflow = await detectOverflow(state, { ...detectOverflowOptions, altBoundary: true }); const offsets = getSideOffsets(overflow, rects.floating); return { data: { escapedOffsets: offsets, escaped: isAnySideFullyClipped(offsets) } }; } default: { return {}; } } } }; }; function getBoundingRect(rects) { const minX = min(...rects.map(rect => rect.left)); const minY = min(...rects.map(rect => rect.top)); const maxX = max(...rects.map(rect => rect.right)); const maxY = max(...rects.map(rect => rect.bottom)); return { x: minX, y: minY, width: maxX - minX, height: maxY - minY }; } function getRectsByLine(rects) { const sortedRects = rects.slice().sort((a, b) => a.y - b.y); const groups = []; let prevRect = null; for (let i = 0; i < sortedRects.length; i++) { const rect = sortedRects[i]; if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { groups.push([rect]); } else { groups[groups.length - 1].push(rect); } prevRect = rect; } return groups.map(rect => rectToClientRect(getBoundingRect(rect))); } /** * Provides improved positioning for inline reference elements that can span * over multiple lines, such as hyperlinks or range selections. * @see https://floating-ui.com/docs/inline */ const inline = function (options) { if (options === void 0) { options = {}; } return { name: 'inline', options, async fn(state) { const { placement, elements, rects, platform, strategy } = state; // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a // ClientRect's bounds, despite the event listener being triggered. A // padding of 2 seems to handle this issue. const { padding = 2, x, y } = evaluate(options, state); const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); const clientRects = getRectsByLine(nativeClientRects); const fallback = rectToClientRect(getBoundingRect(nativeClientRects)); const paddingObject = getPaddingObject(padding); function getBoundingClientRect() { // There are two rects and they are disjoined. if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { // Find the first rect in which the point is fully inside. return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback; } // There are 2 or more connected rects. if (clientRects.length >= 2) { if (getSideAxis(placement) === 'y') { const firstRect = clientRects[0]; const lastRect = clientRects[clientRects.length - 1]; const isTop = getSide(placement) === 'top'; const top = firstRect.top; const bottom = lastRect.bottom; const left = isTop ? firstRect.left : lastRect.left; const right = isTop ? firstRect.right : lastRect.right; const width = right - left; const height = bottom - top; return { top, bottom, left, right, width, height, x: left, y: top }; } const isLeftSide = getSide(placement) === 'left'; const maxRight = max(...clientRects.map(rect => rect.right)); const minLeft = min(...clientRects.map(rect => rect.left)); const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); const top = measureRects[0].top; const bottom = measureRects[measureRects.length - 1].bottom; const left = minLeft; const right = maxRight; const width = right - left; const height = bottom - top; return { top, bottom, left, right, width, height, x: left, y: top }; } return fallback; } const resetRects = await platform.getElementRects({ reference: { getBoundingClientRect }, floating: elements.floating, strategy }); if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) { return { reset: { rects: resetRects } }; } return {}; } }; }; // For type backwards-compatibility, the `OffsetOptions` type was also // Derivable. async function convertValueToCoords(state, options) { const { placement, platform, elements } = state; const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); const side = floating_ui_utils_getSide(placement); const alignment = floating_ui_utils_getAlignment(placement); const isVertical = floating_ui_utils_getSideAxis(placement) === 'y'; const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1; const crossAxisMulti = rtl && isVertical ? -1 : 1; const rawValue = floating_ui_utils_evaluate(options, state); // eslint-disable-next-line prefer-const let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === 'number' ? { mainAxis: rawValue, crossAxis: 0, alignmentAxis: null } : { mainAxis: 0, crossAxis: 0, alignmentAxis: null, ...rawValue }; if (alignment && typeof alignmentAxis === 'number') { crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; } return isVertical ? { x: crossAxis * crossAxisMulti, y: mainAxis * mainAxisMulti } : { x: mainAxis * mainAxisMulti, y: crossAxis * crossAxisMulti }; } /** * Modifies the placement by translating the floating element along the * specified axes. * A number (shorthand for `mainAxis` or distance), or an axes configuration * object may be passed. * @see https://floating-ui.com/docs/offset */ const offset = function (options) { if (options === void 0) { options = 0; } return { name: 'offset', options, async fn(state) { const { x, y } = state; const diffCoords = await convertValueToCoords(state, options); return { x: x + diffCoords.x, y: y + diffCoords.y, data: diffCoords }; } }; }; /** * Optimizes the visibility of the floating element by shifting it in order to * keep it in view when it will overflow the clipping boundary. * @see https://floating-ui.com/docs/shift */ const shift = function (options) { if (options === void 0) { options = {}; } return { name: 'shift', options, async fn(state) { const { x, y, placement } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = { fn: _ref => { let { x, y } = _ref; return { x, y }; } }, ...detectOverflowOptions } = floating_ui_utils_evaluate(options, state); const coords = { x, y }; const overflow = await detectOverflow(state, detectOverflowOptions); const crossAxis = floating_ui_utils_getSideAxis(floating_ui_utils_getSide(placement)); const mainAxis = getOppositeAxis(crossAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; if (checkMainAxis) { const minSide = mainAxis === 'y' ? 'top' : 'left'; const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; const min = mainAxisCoord + overflow[minSide]; const max = mainAxisCoord - overflow[maxSide]; mainAxisCoord = clamp(min, mainAxisCoord, max); } if (checkCrossAxis) { const minSide = crossAxis === 'y' ? 'top' : 'left'; const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; const min = crossAxisCoord + overflow[minSide]; const max = crossAxisCoord - overflow[maxSide]; crossAxisCoord = clamp(min, crossAxisCoord, max); } const limitedCoords = limiter.fn({ ...state, [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }); return { ...limitedCoords, data: { x: limitedCoords.x - x, y: limitedCoords.y - y } }; } }; }; /** * Built-in `limiter` that will stop `shift()` at a certain point. */ const limitShift = function (options) { if (options === void 0) { options = {}; } return { options, fn(state) { const { x, y, placement, rects, middlewareData } = state; const { offset = 0, mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true } = floating_ui_utils_evaluate(options, state); const coords = { x, y }; const crossAxis = floating_ui_utils_getSideAxis(placement); const mainAxis = getOppositeAxis(crossAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; const rawOffset = floating_ui_utils_evaluate(offset, state); const computedOffset = typeof rawOffset === 'number' ? { mainAxis: rawOffset, crossAxis: 0 } : { mainAxis: 0, crossAxis: 0, ...rawOffset }; if (checkMainAxis) { const len = mainAxis === 'y' ? 'height' : 'width'; const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; if (mainAxisCoord < limitMin) { mainAxisCoord = limitMin; } else if (mainAxisCoord > limitMax) { mainAxisCoord = limitMax; } } if (checkCrossAxis) { var _middlewareData$offse, _middlewareData$offse2; const len = mainAxis === 'y' ? 'width' : 'height'; const isOriginSide = ['top', 'left'].includes(floating_ui_utils_getSide(placement)); const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); if (crossAxisCoord < limitMin) { crossAxisCoord = limitMin; } else if (crossAxisCoord > limitMax) { crossAxisCoord = limitMax; } } return { [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }; } }; }; /** * Provides data that allows you to change the size of the floating element — * for instance, prevent it from overflowing the clipping boundary or match the * width of the reference element. * @see https://floating-ui.com/docs/size */ const size = function (options) { if (options === void 0) { options = {}; } return { name: 'size', options, async fn(state) { const { placement, rects, platform, elements } = state; const { apply = () => {}, ...detectOverflowOptions } = floating_ui_utils_evaluate(options, state); const overflow = await detectOverflow(state, detectOverflowOptions); const side = floating_ui_utils_getSide(placement); const alignment = floating_ui_utils_getAlignment(placement); const isYAxis = floating_ui_utils_getSideAxis(placement) === 'y'; const { width, height } = rects.floating; let heightSide; let widthSide; if (side === 'top' || side === 'bottom') { heightSide = side; widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; } else { widthSide = side; heightSide = alignment === 'end' ? 'top' : 'bottom'; } const overflowAvailableHeight = height - overflow[heightSide]; const overflowAvailableWidth = width - overflow[widthSide]; const noShift = !state.middlewareData.shift; let availableHeight = overflowAvailableHeight; let availableWidth = overflowAvailableWidth; if (isYAxis) { const maximumClippingWidth = width - overflow.left - overflow.right; availableWidth = alignment || noShift ? floating_ui_utils_min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth; } else { const maximumClippingHeight = height - overflow.top - overflow.bottom; availableHeight = alignment || noShift ? floating_ui_utils_min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight; } if (noShift && !alignment) { const xMin = floating_ui_utils_max(overflow.left, 0); const xMax = floating_ui_utils_max(overflow.right, 0); const yMin = floating_ui_utils_max(overflow.top, 0); const yMax = floating_ui_utils_max(overflow.bottom, 0); if (isYAxis) { availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : floating_ui_utils_max(overflow.left, overflow.right)); } else { availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : floating_ui_utils_max(overflow.top, overflow.bottom)); } } await apply({ ...state, availableWidth, availableHeight }); const nextDimensions = await platform.getDimensions(elements.floating); if (width !== nextDimensions.width || height !== nextDimensions.height) { return { reset: { rects: true } }; } return {}; } }; }; ;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs /** * Custom positioning reference element. * @see https://floating-ui.com/docs/virtual-elements */ const dist_floating_ui_utils_sides = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left'])); const floating_ui_utils_alignments = (/* unused pure expression or super */ null && (['start', 'end'])); const dist_floating_ui_utils_placements = /*#__PURE__*/(/* unused pure expression or super */ null && (dist_floating_ui_utils_sides.reduce((acc, side) => acc.concat(side, side + "-" + floating_ui_utils_alignments[0], side + "-" + floating_ui_utils_alignments[1]), []))); const dist_floating_ui_utils_min = Math.min; const dist_floating_ui_utils_max = Math.max; const floating_ui_utils_round = Math.round; const floating_ui_utils_floor = Math.floor; const floating_ui_utils_createCoords = v => ({ x: v, y: v }); const floating_ui_utils_oppositeSideMap = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; const floating_ui_utils_oppositeAlignmentMap = { start: 'end', end: 'start' }; function floating_ui_utils_clamp(start, value, end) { return dist_floating_ui_utils_max(start, dist_floating_ui_utils_min(value, end)); } function dist_floating_ui_utils_evaluate(value, param) { return typeof value === 'function' ? value(param) : value; } function dist_floating_ui_utils_getSide(placement) { return placement.split('-')[0]; } function dist_floating_ui_utils_getAlignment(placement) { return placement.split('-')[1]; } function floating_ui_utils_getOppositeAxis(axis) { return axis === 'x' ? 'y' : 'x'; } function floating_ui_utils_getAxisLength(axis) { return axis === 'y' ? 'height' : 'width'; } function dist_floating_ui_utils_getSideAxis(placement) { return ['top', 'bottom'].includes(dist_floating_ui_utils_getSide(placement)) ? 'y' : 'x'; } function floating_ui_utils_getAlignmentAxis(placement) { return floating_ui_utils_getOppositeAxis(dist_floating_ui_utils_getSideAxis(placement)); } function dist_floating_ui_utils_getAlignmentSides(placement, rects, rtl) { if (rtl === void 0) { rtl = false; } const alignment = dist_floating_ui_utils_getAlignment(placement); const alignmentAxis = floating_ui_utils_getAlignmentAxis(placement); const length = floating_ui_utils_getAxisLength(alignmentAxis); let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; if (rects.reference[length] > rects.floating[length]) { mainAlignmentSide = floating_ui_utils_getOppositePlacement(mainAlignmentSide); } return [mainAlignmentSide, floating_ui_utils_getOppositePlacement(mainAlignmentSide)]; } function floating_ui_utils_getExpandedPlacements(placement) { const oppositePlacement = floating_ui_utils_getOppositePlacement(placement); return [dist_floating_ui_utils_getOppositeAlignmentPlacement(placement), oppositePlacement, dist_floating_ui_utils_getOppositeAlignmentPlacement(oppositePlacement)]; } function dist_floating_ui_utils_getOppositeAlignmentPlacement(placement) { return placement.replace(/start|end/g, alignment => floating_ui_utils_oppositeAlignmentMap[alignment]); } function floating_ui_utils_getSideList(side, isStart, rtl) { const lr = ['left', 'right']; const rl = ['right', 'left']; const tb = ['top', 'bottom']; const bt = ['bottom', 'top']; switch (side) { case 'top': case 'bottom': if (rtl) return isStart ? rl : lr; return isStart ? lr : rl; case 'left': case 'right': return isStart ? tb : bt; default: return []; } } function floating_ui_utils_getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { const alignment = dist_floating_ui_utils_getAlignment(placement); let list = floating_ui_utils_getSideList(dist_floating_ui_utils_getSide(placement), direction === 'start', rtl); if (alignment) { list = list.map(side => side + "-" + alignment); if (flipAlignment) { list = list.concat(list.map(dist_floating_ui_utils_getOppositeAlignmentPlacement)); } } return list; } function floating_ui_utils_getOppositePlacement(placement) { return placement.replace(/left|right|bottom|top/g, side => floating_ui_utils_oppositeSideMap[side]); } function floating_ui_utils_expandPaddingObject(padding) { return { top: 0, right: 0, bottom: 0, left: 0, ...padding }; } function dist_floating_ui_utils_getPaddingObject(padding) { return typeof padding !== 'number' ? floating_ui_utils_expandPaddingObject(padding) : { top: padding, right: padding, bottom: padding, left: padding }; } function dist_floating_ui_utils_rectToClientRect(rect) { return { ...rect, top: rect.y, left: rect.x, right: rect.x + rect.width, bottom: rect.y + rect.height }; } ;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs function getNodeName(node) { if (isNode(node)) { return (node.nodeName || '').toLowerCase(); } // Mocked nodes in testing environments may not be instances of Node. By // returning `#document` an infinite loop won't occur. // https://github.com/floating-ui/floating-ui/issues/2317 return '#document'; } function floating_ui_utils_dom_getWindow(node) { var _node$ownerDocument; return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; } function getDocumentElement(node) { var _ref; return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; } function isNode(value) { return value instanceof Node || value instanceof floating_ui_utils_dom_getWindow(value).Node; } function isElement(value) { return value instanceof Element || value instanceof floating_ui_utils_dom_getWindow(value).Element; } function isHTMLElement(value) { return value instanceof HTMLElement || value instanceof floating_ui_utils_dom_getWindow(value).HTMLElement; } function isShadowRoot(value) { // Browsers without `ShadowRoot` support. if (typeof ShadowRoot === 'undefined') { return false; } return value instanceof ShadowRoot || value instanceof floating_ui_utils_dom_getWindow(value).ShadowRoot; } function isOverflowElement(element) { const { overflow, overflowX, overflowY, display } = floating_ui_utils_dom_getComputedStyle(element); return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display); } function isTableElement(element) { return ['table', 'td', 'th'].includes(getNodeName(element)); } function isContainingBlock(element) { const webkit = isWebKit(); const css = floating_ui_utils_dom_getComputedStyle(element); // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value)); } function getContainingBlock(element) { let currentNode = getParentNode(element); while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { if (isContainingBlock(currentNode)) { return currentNode; } else { currentNode = getParentNode(currentNode); } } return null; } function isWebKit() { if (typeof CSS === 'undefined' || !CSS.supports) return false; return CSS.supports('-webkit-backdrop-filter', 'none'); } function isLastTraversableNode(node) { return ['html', 'body', '#document'].includes(getNodeName(node)); } function floating_ui_utils_dom_getComputedStyle(element) { return floating_ui_utils_dom_getWindow(element).getComputedStyle(element); } function getNodeScroll(element) { if (isElement(element)) { return { scrollLeft: element.scrollLeft, scrollTop: element.scrollTop }; } return { scrollLeft: element.pageXOffset, scrollTop: element.pageYOffset }; } function getParentNode(node) { if (getNodeName(node) === 'html') { return node; } const result = // Step into the shadow DOM of the parent of a slotted node. node.assignedSlot || // DOM Element detected. node.parentNode || // ShadowRoot detected. isShadowRoot(node) && node.host || // Fallback. getDocumentElement(node); return isShadowRoot(result) ? result.host : result; } function getNearestOverflowAncestor(node) { const parentNode = getParentNode(node); if (isLastTraversableNode(parentNode)) { return node.ownerDocument ? node.ownerDocument.body : node.body; } if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { return parentNode; } return getNearestOverflowAncestor(parentNode); } function getOverflowAncestors(node, list, traverseIframes) { var _node$ownerDocument2; if (list === void 0) { list = []; } if (traverseIframes === void 0) { traverseIframes = true; } const scrollableAncestor = getNearestOverflowAncestor(node); const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); const win = floating_ui_utils_dom_getWindow(scrollableAncestor); if (isBody) { return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []); } return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); } ;// CONCATENATED MODULE: ./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs function getCssDimensions(element) { const css = floating_ui_utils_dom_getComputedStyle(element); // In testing environments, the `width` and `height` properties are empty // strings for SVG elements, returning NaN. Fallback to `0` in this case. let width = parseFloat(css.width) || 0; let height = parseFloat(css.height) || 0; const hasOffset = isHTMLElement(element); const offsetWidth = hasOffset ? element.offsetWidth : width; const offsetHeight = hasOffset ? element.offsetHeight : height; const shouldFallback = floating_ui_utils_round(width) !== offsetWidth || floating_ui_utils_round(height) !== offsetHeight; if (shouldFallback) { width = offsetWidth; height = offsetHeight; } return { width, height, $: shouldFallback }; } function unwrapElement(element) { return !isElement(element) ? element.contextElement : element; } function getScale(element) { const domElement = unwrapElement(element); if (!isHTMLElement(domElement)) { return floating_ui_utils_createCoords(1); } const rect = domElement.getBoundingClientRect(); const { width, height, $ } = getCssDimensions(domElement); let x = ($ ? floating_ui_utils_round(rect.width) : rect.width) / width; let y = ($ ? floating_ui_utils_round(rect.height) : rect.height) / height; // 0, NaN, or Infinity should always fallback to 1. if (!x || !Number.isFinite(x)) { x = 1; } if (!y || !Number.isFinite(y)) { y = 1; } return { x, y }; } const noOffsets = /*#__PURE__*/floating_ui_utils_createCoords(0); function getVisualOffsets(element) { const win = floating_ui_utils_dom_getWindow(element); if (!isWebKit() || !win.visualViewport) { return noOffsets; } return { x: win.visualViewport.offsetLeft, y: win.visualViewport.offsetTop }; } function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { if (isFixed === void 0) { isFixed = false; } if (!floatingOffsetParent || isFixed && floatingOffsetParent !== floating_ui_utils_dom_getWindow(element)) { return false; } return isFixed; } function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { if (includeScale === void 0) { includeScale = false; } if (isFixedStrategy === void 0) { isFixedStrategy = false; } const clientRect = element.getBoundingClientRect(); const domElement = unwrapElement(element); let scale = floating_ui_utils_createCoords(1); if (includeScale) { if (offsetParent) { if (isElement(offsetParent)) { scale = getScale(offsetParent); } } else { scale = getScale(element); } } const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : floating_ui_utils_createCoords(0); let x = (clientRect.left + visualOffsets.x) / scale.x; let y = (clientRect.top + visualOffsets.y) / scale.y; let width = clientRect.width / scale.x; let height = clientRect.height / scale.y; if (domElement) { const win = floating_ui_utils_dom_getWindow(domElement); const offsetWin = offsetParent && isElement(offsetParent) ? floating_ui_utils_dom_getWindow(offsetParent) : offsetParent; let currentWin = win; let currentIFrame = currentWin.frameElement; while (currentIFrame && offsetParent && offsetWin !== currentWin) { const iframeScale = getScale(currentIFrame); const iframeRect = currentIFrame.getBoundingClientRect(); const css = floating_ui_utils_dom_getComputedStyle(currentIFrame); const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; x *= iframeScale.x; y *= iframeScale.y; width *= iframeScale.x; height *= iframeScale.y; x += left; y += top; currentWin = floating_ui_utils_dom_getWindow(currentIFrame); currentIFrame = currentWin.frameElement; } } return floating_ui_utils_rectToClientRect({ width, height, x, y }); } const topLayerSelectors = [':popover-open', ':modal']; function isTopLayer(floating) { return topLayerSelectors.some(selector => { try { return floating.matches(selector); } catch (e) { return false; } }); } function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { let { elements, rect, offsetParent, strategy } = _ref; const isFixed = strategy === 'fixed'; const documentElement = getDocumentElement(offsetParent); const topLayer = elements ? isTopLayer(elements.floating) : false; if (offsetParent === documentElement || topLayer && isFixed) { return rect; } let scroll = { scrollLeft: 0, scrollTop: 0 }; let scale = floating_ui_utils_createCoords(1); const offsets = floating_ui_utils_createCoords(0); const isOffsetParentAnElement = isHTMLElement(offsetParent); if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isHTMLElement(offsetParent)) { const offsetRect = getBoundingClientRect(offsetParent); scale = getScale(offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } } return { width: rect.width * scale.x, height: rect.height * scale.y, x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x, y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y }; } function getClientRects(element) { return Array.from(element.getClientRects()); } function getWindowScrollBarX(element) { // If has a CSS width greater than the viewport, then this will be // incorrect for RTL. return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft; } // Gets the entire size of the scrollable document area, even extending outside // of the `` and `` rect bounds if horizontally scrollable. function getDocumentRect(element) { const html = getDocumentElement(element); const scroll = getNodeScroll(element); const body = element.ownerDocument.body; const width = dist_floating_ui_utils_max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); const height = dist_floating_ui_utils_max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); let x = -scroll.scrollLeft + getWindowScrollBarX(element); const y = -scroll.scrollTop; if (floating_ui_utils_dom_getComputedStyle(body).direction === 'rtl') { x += dist_floating_ui_utils_max(html.clientWidth, body.clientWidth) - width; } return { width, height, x, y }; } function getViewportRect(element, strategy) { const win = floating_ui_utils_dom_getWindow(element); const html = getDocumentElement(element); const visualViewport = win.visualViewport; let width = html.clientWidth; let height = html.clientHeight; let x = 0; let y = 0; if (visualViewport) { width = visualViewport.width; height = visualViewport.height; const visualViewportBased = isWebKit(); if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { x = visualViewport.offsetLeft; y = visualViewport.offsetTop; } } return { width, height, x, y }; } // Returns the inner client rect, subtracting scrollbars if present. function getInnerBoundingClientRect(element, strategy) { const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); const top = clientRect.top + element.clientTop; const left = clientRect.left + element.clientLeft; const scale = isHTMLElement(element) ? getScale(element) : floating_ui_utils_createCoords(1); const width = element.clientWidth * scale.x; const height = element.clientHeight * scale.y; const x = left * scale.x; const y = top * scale.y; return { width, height, x, y }; } function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { let rect; if (clippingAncestor === 'viewport') { rect = getViewportRect(element, strategy); } else if (clippingAncestor === 'document') { rect = getDocumentRect(getDocumentElement(element)); } else if (isElement(clippingAncestor)) { rect = getInnerBoundingClientRect(clippingAncestor, strategy); } else { const visualOffsets = getVisualOffsets(element); rect = { ...clippingAncestor, x: clippingAncestor.x - visualOffsets.x, y: clippingAncestor.y - visualOffsets.y }; } return floating_ui_utils_rectToClientRect(rect); } function hasFixedPositionAncestor(element, stopNode) { const parentNode = getParentNode(element); if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { return false; } return floating_ui_utils_dom_getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); } // A "clipping ancestor" is an `overflow` element with the characteristic of // clipping (or hiding) child elements. This returns all clipping ancestors // of the given element up the tree. function getClippingElementAncestors(element, cache) { const cachedResult = cache.get(element); if (cachedResult) { return cachedResult; } let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); let currentContainingBlockComputedStyle = null; const elementIsFixed = floating_ui_utils_dom_getComputedStyle(element).position === 'fixed'; let currentNode = elementIsFixed ? getParentNode(element) : element; // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { const computedStyle = floating_ui_utils_dom_getComputedStyle(currentNode); const currentNodeIsContaining = isContainingBlock(currentNode); if (!currentNodeIsContaining && computedStyle.position === 'fixed') { currentContainingBlockComputedStyle = null; } const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); if (shouldDropCurrentNode) { // Drop non-containing blocks. result = result.filter(ancestor => ancestor !== currentNode); } else { // Record last containing block for next iteration. currentContainingBlockComputedStyle = computedStyle; } currentNode = getParentNode(currentNode); } cache.set(element, result); return result; } // Gets the maximum area that the element is visible in due to any number of // clipping ancestors. function getClippingRect(_ref) { let { element, boundary, rootBoundary, strategy } = _ref; const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary); const clippingAncestors = [...elementClippingAncestors, rootBoundary]; const firstClippingAncestor = clippingAncestors[0]; const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); accRect.top = dist_floating_ui_utils_max(rect.top, accRect.top); accRect.right = dist_floating_ui_utils_min(rect.right, accRect.right); accRect.bottom = dist_floating_ui_utils_min(rect.bottom, accRect.bottom); accRect.left = dist_floating_ui_utils_max(rect.left, accRect.left); return accRect; }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); return { width: clippingRect.right - clippingRect.left, height: clippingRect.bottom - clippingRect.top, x: clippingRect.left, y: clippingRect.top }; } function getDimensions(element) { const { width, height } = getCssDimensions(element); return { width, height }; } function getRectRelativeToOffsetParent(element, offsetParent, strategy) { const isOffsetParentAnElement = isHTMLElement(offsetParent); const documentElement = getDocumentElement(offsetParent); const isFixed = strategy === 'fixed'; const rect = getBoundingClientRect(element, true, isFixed, offsetParent); let scroll = { scrollLeft: 0, scrollTop: 0 }; const offsets = floating_ui_utils_createCoords(0); if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isOffsetParentAnElement) { const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } else if (documentElement) { offsets.x = getWindowScrollBarX(documentElement); } } const x = rect.left + scroll.scrollLeft - offsets.x; const y = rect.top + scroll.scrollTop - offsets.y; return { x, y, width: rect.width, height: rect.height }; } function getTrueOffsetParent(element, polyfill) { if (!isHTMLElement(element) || floating_ui_utils_dom_getComputedStyle(element).position === 'fixed') { return null; } if (polyfill) { return polyfill(element); } return element.offsetParent; } // Gets the closest ancestor positioned element. Handles some edge cases, // such as table ancestors and cross browser bugs. function getOffsetParent(element, polyfill) { const window = floating_ui_utils_dom_getWindow(element); if (!isHTMLElement(element) || isTopLayer(element)) { return window; } let offsetParent = getTrueOffsetParent(element, polyfill); while (offsetParent && isTableElement(offsetParent) && floating_ui_utils_dom_getComputedStyle(offsetParent).position === 'static') { offsetParent = getTrueOffsetParent(offsetParent, polyfill); } if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && floating_ui_utils_dom_getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) { return window; } return offsetParent || getContainingBlock(element) || window; } const getElementRects = async function (data) { const getOffsetParentFn = this.getOffsetParent || getOffsetParent; const getDimensionsFn = this.getDimensions; return { reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), floating: { x: 0, y: 0, ...(await getDimensionsFn(data.floating)) } }; }; function isRTL(element) { return floating_ui_utils_dom_getComputedStyle(element).direction === 'rtl'; } const platform = { convertOffsetParentRelativeRectToViewportRelativeRect, getDocumentElement: getDocumentElement, getClippingRect, getOffsetParent, getElementRects, getClientRects, getDimensions, getScale, isElement: isElement, isRTL }; // https://samthor.au/2021/observing-dom/ function observeMove(element, onMove) { let io = null; let timeoutId; const root = getDocumentElement(element); function cleanup() { var _io; clearTimeout(timeoutId); (_io = io) == null || _io.disconnect(); io = null; } function refresh(skip, threshold) { if (skip === void 0) { skip = false; } if (threshold === void 0) { threshold = 1; } cleanup(); const { left, top, width, height } = element.getBoundingClientRect(); if (!skip) { onMove(); } if (!width || !height) { return; } const insetTop = floating_ui_utils_floor(top); const insetRight = floating_ui_utils_floor(root.clientWidth - (left + width)); const insetBottom = floating_ui_utils_floor(root.clientHeight - (top + height)); const insetLeft = floating_ui_utils_floor(left); const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; const options = { rootMargin, threshold: dist_floating_ui_utils_max(0, dist_floating_ui_utils_min(1, threshold)) || 1 }; let isFirstUpdate = true; function handleObserve(entries) { const ratio = entries[0].intersectionRatio; if (ratio !== threshold) { if (!isFirstUpdate) { return refresh(); } if (!ratio) { timeoutId = setTimeout(() => { refresh(false, 1e-7); }, 100); } else { refresh(false, ratio); } } isFirstUpdate = false; } // Older browsers don't support a `document` as the root and will throw an // error. try { io = new IntersectionObserver(handleObserve, { ...options, // Handle