@descope/web-components-ui 1.34.0 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +3796 -3778
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +695 -678
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/1519.js +1 -1
- package/dist/umd/1519.js.map +1 -1
- package/dist/umd/2672.js +1 -1
- package/dist/umd/2672.js.map +1 -1
- package/dist/umd/6424.js +1 -1
- package/dist/umd/6424.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-multi-selection-group-index-js.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-index-js.js.map +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js +1 -1
- package/dist/umd/button-selection-group-fields-descope-button-selection-group-item-index-js.js.map +1 -1
- package/dist/umd/{descope-button-index-js.js → descope-button.js} +3 -3
- package/dist/umd/descope-button.js.map +1 -0
- package/dist/umd/descope-date-field-descope-calendar-index-js.js +1 -1
- package/dist/umd/descope-date-field-descope-calendar-index-js.js.map +1 -1
- package/dist/umd/descope-icon.js +2 -0
- package/dist/umd/descope-icon.js.map +1 -0
- package/dist/umd/descope-third-party-app-logo-index-js.js +1 -1
- package/dist/umd/descope-third-party-app-logo-index-js.js.map +1 -1
- package/dist/umd/descope-upload-file-index-js.js +1 -1
- package/dist/umd/descope-upload-file-index-js.js.map +1 -1
- package/dist/umd/descope-user-attribute-index-js.js +1 -1
- package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
- package/dist/umd/descope-user-auth-method-index-js.js +1 -1
- package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
- package/package.json +3 -3
- package/src/components/button-selection-group-fields/descope-button-selection-group-item/ButtonSelectionGroupItemClass.js +1 -1
- package/src/components/button-selection-group-fields/descope-button-selection-group-item/index.js +1 -1
- package/src/components/descope-date-field/descope-calendar/CalendarClass.js +1 -1
- package/src/components/descope-date-field/descope-calendar/index.js +1 -1
- package/src/components/descope-third-party-app-logo/ThirdPartyAppLogoClass.js +1 -1
- package/src/components/descope-third-party-app-logo/index.js +1 -1
- package/src/components/descope-upload-file/UploadFileClass.js +1 -1
- package/src/components/descope-upload-file/index.js +1 -1
- package/src/components/descope-user-attribute/UserAttributeClass.js +1 -1
- package/src/components/descope-user-attribute/index.js +1 -1
- package/src/components/descope-user-auth-method/UserAuthMethodClass.js +2 -2
- package/src/components/descope-user-auth-method/index.js +1 -1
- package/src/components/mapping-fields/descope-mappings-field/index.js +1 -1
- package/src/index.cjs.js +0 -1
- package/src/index.js +0 -2
- package/src/theme/components/index.js +2 -2
- package/dist/umd/descope-button-index-js.js.map +0 -1
- package/dist/umd/descope-icon-index-js.js +0 -2
- package/dist/umd/descope-icon-index-js.js.map +0 -1
- package/src/components/descope-button/ButtonClass.js +0 -163
- package/src/components/descope-button/clickableMixin.js +0 -10
- package/src/components/descope-button/index.js +0 -6
- package/src/components/descope-icon/IconClass.js +0 -98
- package/src/components/descope-icon/helpers.js +0 -51
- package/src/components/descope-icon/index.js +0 -5
- package/src/theme/components/button.js +0 -133
- package/src/theme/components/icon.js +0 -7
- /package/dist/umd/{descope-button-index-js.js.LICENSE.txt → descope-button.js.LICENSE.txt} +0 -0
package/dist/umd/1519.js.map
CHANGED
@@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6BAuE3D,MAAM4f,UAAkBd,GAAe,SAAc,OAAa,SACvE,aAAWzpB,GACT,MAAO,mBACT,CAEA,mBAAW8L,GACT,OAAO,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoCb,CAEA,qBAAW7R,GACT,MAAO,CAILyvB,UAAW,CACTvvB,KAAM2E,QAMR6qB,UAAW,CACTxvB,KAAM2E,QAGZ,CAGA,KAAAgI,GACErM,MAAMqM,QAENnM,KAAK6vB,mBAAqB,IAAI,IAAkB7vB,MAChDA,KAAK6vB,mBAAmBC,YAAY,OACpC9vB,KAAK6vB,mBAAmBE,cAAc/vB,KAAK0vB,cAC3C1vB,KAAKyX,cAAczX,KAAK6vB,mBAC1B,GAGF,OAAoBD,6CCrJpB,eAAe,oBAAqB,IAAkB,CACpD5f,SAAU","sources":["webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-field-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/a11y-base/src/focus-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/define.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/dir-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@open-wc/dedupe-mixin/src/dedupeMixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/polylit-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/path-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/overlay/src/vaadin-overlay-styles.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/browser-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/a11y-base/src/aria-hidden.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/a11y-base/src/aria-modal-controller.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/a11y-base/src/focus-restoration-controller.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/a11y-base/src/focus-trap-controller.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/controller-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/overlay/src/vaadin-overlay-focus-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/overlay/src/vaadin-overlay-stack-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/overlay/src/vaadin-overlay-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/overlay/src/vaadin-overlay-position-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/dom-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/overlay/src/vaadin-overlay-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/src/vaadin-popover-overlay-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/src/vaadin-popover-overlay.js","webpack://@descope/web-components-ui/../../../node_modules/lit-html/directives/if-defined.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/async.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/debounce.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/element-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/overlay-class-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/unique-id-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/src/vaadin-popover-position-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/src/vaadin-popover-target-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/src/vaadin-popover.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-field/src/vaadin-text-field-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-field/src/vaadin-text-field.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-field/theme/lumo/vaadin-text-field-styles.js"],"sourcesContent":["/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { InputControlMixin } from './input-control-mixin.js';\n\n/**\n * A mixin to provide logic for vaadin-text-field and related components.\n *\n * @polymerMixin\n * @mixes InputControlMixin\n */\nexport const InputFieldMixin = (superclass) =>\n class InputFieldMixinClass extends InputControlMixin(superclass) {\n static get properties() {\n return {\n /**\n * Whether the value of the control can be automatically completed by the browser.\n * List of available options at:\n * https://developer.mozilla.org/en/docs/Web/HTML/Element/input#attr-autocomplete\n */\n autocomplete: {\n type: String,\n },\n\n /**\n * This is a property supported by Safari that is used to control whether\n * autocorrection should be enabled when the user is entering/editing the text.\n * Possible values are:\n * on: Enable autocorrection.\n * off: Disable autocorrection.\n */\n autocorrect: {\n type: String,\n },\n\n /**\n * This is a property supported by Safari and Chrome that is used to control whether\n * autocapitalization should be enabled when the user is entering/editing the text.\n * Possible values are:\n * characters: Characters capitalization.\n * words: Words capitalization.\n * sentences: Sentences capitalization.\n * none: No capitalization.\n */\n autocapitalize: {\n type: String,\n reflectToAttribute: true,\n },\n };\n }\n\n static get delegateAttrs() {\n return [...super.delegateAttrs, 'autocapitalize', 'autocomplete', 'autocorrect'];\n }\n\n // Workaround for https://github.com/Polymer/polymer/issues/5259\n get __data() {\n return this.__dataValue || {};\n }\n\n set __data(value) {\n this.__dataValue = value;\n }\n\n /**\n * @param {HTMLElement} input\n * @protected\n * @override\n */\n _inputElementChanged(input) {\n super._inputElementChanged(input);\n\n if (input) {\n // Discard value set on the custom slotted input.\n if (input.value && input.value !== this.value) {\n console.warn(`Please define value on the <${this.localName}> component!`);\n input.value = '';\n }\n\n if (this.value) {\n input.value = this.value;\n }\n }\n }\n\n /**\n * Override an event listener from `FocusMixin`.\n * @param {boolean} focused\n * @protected\n * @override\n */\n _setFocused(focused) {\n super._setFocused(focused);\n\n // Do not validate when focusout is caused by document\n // losing focus, which happens on browser tab switch.\n if (!focused && document.hasFocus()) {\n this.validate();\n }\n }\n\n /**\n * Override an event listener from `InputMixin`\n * to mark as valid after user started typing.\n * @param {Event} event\n * @protected\n * @override\n */\n _onInput(event) {\n super._onInput(event);\n\n if (this.invalid) {\n this.validate();\n }\n }\n\n /**\n * Override an observer from `InputMixin` to validate the field\n * when a new value is set programmatically.\n *\n * @param {string | undefined} newValue\n * @param {string | undefined} oldValue\n * @protected\n * @override\n */\n _valueChanged(newValue, oldValue) {\n super._valueChanged(newValue, oldValue);\n\n if (oldValue === undefined) {\n return;\n }\n\n if (this.invalid) {\n this.validate();\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n// We consider the keyboard to be active if the window has received a keydown\n// event since the last mousedown event.\nlet keyboardActive = false;\n\n// Listen for top-level keydown and mousedown events.\n// Use capture phase so we detect events even if they're handled.\nwindow.addEventListener(\n 'keydown',\n () => {\n keyboardActive = true;\n },\n { capture: true },\n);\n\nwindow.addEventListener(\n 'mousedown',\n () => {\n keyboardActive = false;\n },\n { capture: true },\n);\n\n/**\n * Returns the actually focused element by traversing shadow\n * trees recursively to ensure it's the leaf element.\n *\n * @return {Element}\n */\nexport function getDeepActiveElement() {\n let host = document.activeElement || document.body;\n while (host.shadowRoot && host.shadowRoot.activeElement) {\n host = host.shadowRoot.activeElement;\n }\n return host;\n}\n\n/**\n * Returns true if the window has received a keydown\n * event since the last mousedown event.\n *\n * @return {boolean}\n */\nexport function isKeyboardActive() {\n return keyboardActive;\n}\n\n/**\n * Returns true if the element is hidden directly with `display: none` or `visibility: hidden`,\n * false otherwise.\n *\n * The method doesn't traverse the element's ancestors, it only checks for the CSS properties\n * set directly to or inherited by the element.\n *\n * @param {HTMLElement} element\n * @return {boolean}\n */\nfunction isElementHiddenDirectly(element) {\n // Check inline style first to save a re-flow.\n const style = element.style;\n if (style.visibility === 'hidden' || style.display === 'none') {\n return true;\n }\n\n const computedStyle = window.getComputedStyle(element);\n if (computedStyle.visibility === 'hidden' || computedStyle.display === 'none') {\n return true;\n }\n\n return false;\n}\n\n/**\n * Returns if element `a` has lower tab order compared to element `b`\n * (both elements are assumed to be focusable and tabbable).\n * Elements with tabindex = 0 have lower tab order compared to elements\n * with tabindex > 0.\n * If both have same tabindex, it returns false.\n *\n * @param {HTMLElement} a\n * @param {HTMLElement} b\n * @return {boolean}\n */\nfunction hasLowerTabOrder(a, b) {\n // Normalize tabIndexes\n // e.g. in Firefox `<div contenteditable>` has `tabIndex = -1`\n const ati = Math.max(a.tabIndex, 0);\n const bti = Math.max(b.tabIndex, 0);\n return ati === 0 || bti === 0 ? bti > ati : ati > bti;\n}\n\n/**\n * Merge sort iterator, merges the two arrays into one, sorted by tabindex.\n *\n * @param {HTMLElement[]} left\n * @param {HTMLElement[]} right\n * @return {HTMLElement[]}\n */\nfunction mergeSortByTabIndex(left, right) {\n const result = [];\n while (left.length > 0 && right.length > 0) {\n if (hasLowerTabOrder(left[0], right[0])) {\n result.push(right.shift());\n } else {\n result.push(left.shift());\n }\n }\n\n return result.concat(left, right);\n}\n\n/**\n * Sorts an array of elements by tabindex. Returns a new array.\n *\n * @param {HTMLElement[]} elements\n * @return {HTMLElement[]}\n */\nfunction sortElementsByTabIndex(elements) {\n // Implement a merge sort as Array.prototype.sort does a non-stable sort\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n const len = elements.length;\n if (len < 2) {\n return elements;\n }\n const pivot = Math.ceil(len / 2);\n const left = sortElementsByTabIndex(elements.slice(0, pivot));\n const right = sortElementsByTabIndex(elements.slice(pivot));\n\n return mergeSortByTabIndex(left, right);\n}\n\n/**\n * Returns true if the element is hidden, false otherwise.\n *\n * An element is treated as hidden when any of the following conditions are met:\n * - the element itself or one of its ancestors has `display: none`.\n * - the element has or inherits `visibility: hidden`.\n *\n * @param {HTMLElement} element\n * @return {boolean}\n */\nexport function isElementHidden(element) {\n // `offsetParent` is `null` when the element itself\n // or one of its ancestors is hidden with `display: none`.\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent\n // However `offsetParent` is also null when the element is using fixed\n // positioning, so additionally check if the element takes up layout space.\n if (element.offsetParent === null && element.clientWidth === 0 && element.clientHeight === 0) {\n return true;\n }\n\n return isElementHiddenDirectly(element);\n}\n\n/**\n * Returns true if the element is focusable, otherwise false.\n *\n * The list of focusable elements is taken from http://stackoverflow.com/a/1600194/4228703.\n * However, there isn't a definite list, it's up to the browser.\n * The only standard we have is DOM Level 2 HTML https://www.w3.org/TR/DOM-Level-2-HTML/html.html,\n * according to which the only elements that have a `focus()` method are:\n * - HTMLInputElement\n * - HTMLSelectElement\n * - HTMLTextAreaElement\n * - HTMLAnchorElement\n *\n * This notably omits HTMLButtonElement and HTMLAreaElement.\n * Referring to these tests with tabbables in different browsers\n * http://allyjs.io/data-tables/focusable.html\n *\n * @param {HTMLElement} element\n * @return {boolean}\n */\nexport function isElementFocusable(element) {\n // The element cannot be focused if its `tabindex` attribute is set to `-1`.\n if (element.matches('[tabindex=\"-1\"]')) {\n return false;\n }\n\n // Elements that cannot be focused if they have a `disabled` attribute.\n if (element.matches('input, select, textarea, button, object')) {\n return element.matches(':not([disabled])');\n }\n\n // Elements that can be focused even if they have a `disabled` attribute.\n return element.matches('a[href], area[href], iframe, [tabindex], [contentEditable]');\n}\n\n/**\n * Returns true if the element is focused, false otherwise.\n *\n * @param {HTMLElement} element\n * @return {boolean}\n */\nexport function isElementFocused(element) {\n return element.getRootNode().activeElement === element;\n}\n\n/**\n * Returns the normalized element tabindex. If not focusable, returns -1.\n * It checks for the attribute \"tabindex\" instead of the element property\n * `tabIndex` since browsers assign different values to it.\n * e.g. in Firefox `<div contenteditable>` has `tabIndex = -1`\n *\n * @param {HTMLElement} element\n * @return {number}\n */\nfunction normalizeTabIndex(element) {\n if (!isElementFocusable(element)) {\n return -1;\n }\n\n const tabIndex = element.getAttribute('tabindex') || 0;\n return Number(tabIndex);\n}\n\n/**\n * Searches for nodes that are tabbable and adds them to the `result` array.\n * Returns if the `result` array needs to be sorted by tabindex.\n *\n * @param {Node} node The starting point for the search; added to `result` if tabbable.\n * @param {HTMLElement[]} result\n * @return {boolean}\n * @private\n */\nfunction collectFocusableNodes(node, result) {\n if (node.nodeType !== Node.ELEMENT_NODE || isElementHiddenDirectly(node)) {\n // Don't traverse children if the node is not an HTML element or not visible.\n return false;\n }\n\n const element = /** @type {HTMLElement} */ (node);\n const tabIndex = normalizeTabIndex(element);\n let needsSort = tabIndex > 0;\n if (tabIndex >= 0) {\n result.push(element);\n }\n\n let children = [];\n if (element.localName === 'slot') {\n children = element.assignedNodes({ flatten: true });\n } else {\n // Use shadow root if possible, will check for distributed nodes.\n children = (element.shadowRoot || element).children;\n }\n [...children].forEach((child) => {\n // Ensure method is always invoked to collect focusable children.\n needsSort = collectFocusableNodes(child, result) || needsSort;\n });\n return needsSort;\n}\n\n/**\n * Returns a tab-ordered array of focusable elements for a root element.\n * The resulting array will include the root element if it is focusable.\n *\n * The method traverses nodes in shadow DOM trees too if any.\n *\n * @param {HTMLElement} element\n * @return {HTMLElement[]}\n */\nexport function getFocusableElements(element) {\n const focusableElements = [];\n const needsSortByTabIndex = collectFocusableNodes(element, focusableElements);\n // If there is at least one element with tabindex > 0,\n // we need to sort the final array by tabindex.\n if (needsSortByTabIndex) {\n return sortElementsByTabIndex(focusableElements);\n }\n return focusableElements;\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\nexport function defineCustomElement(CustomElement, version = '24.5.9') {\n Object.defineProperty(CustomElement, 'version', {\n get() {\n return version;\n },\n });\n\n const defined = customElements.get(CustomElement.is);\n if (!defined) {\n customElements.define(CustomElement.is, CustomElement);\n } else {\n const definedVersion = defined.version;\n if (definedVersion && CustomElement.version && definedVersion === CustomElement.version) {\n // Just loading the same thing again\n console.warn(`The component ${CustomElement.is} has been loaded twice`);\n } else {\n console.error(\n `Tried to define ${CustomElement.is} version ${CustomElement.version} when version ${defined.version} is already in use. Something will probably break.`,\n );\n }\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Array of Vaadin custom element classes that have been subscribed to the dir changes.\n */\nconst directionSubscribers = [];\n\nfunction alignDirs(element, documentDir, elementDir = element.getAttribute('dir')) {\n if (documentDir) {\n element.setAttribute('dir', documentDir);\n } else if (elementDir != null) {\n element.removeAttribute('dir');\n }\n}\n\nfunction getDocumentDir() {\n return document.documentElement.getAttribute('dir');\n}\n\nfunction directionUpdater() {\n const documentDir = getDocumentDir();\n directionSubscribers.forEach((element) => {\n alignDirs(element, documentDir);\n });\n}\n\nconst directionObserver = new MutationObserver(directionUpdater);\ndirectionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['dir'] });\n\n/**\n * A mixin to handle `dir` attribute based on the one set on the `<html>` element.\n *\n * @polymerMixin\n */\nexport const DirMixin = (superClass) =>\n class VaadinDirMixin extends superClass {\n static get properties() {\n return {\n /**\n * @protected\n */\n dir: {\n type: String,\n value: '',\n reflectToAttribute: true,\n converter: {\n fromAttribute: (attr) => {\n return !attr ? '' : attr;\n },\n toAttribute: (prop) => {\n return prop === '' ? null : prop;\n },\n },\n },\n };\n }\n\n /**\n * @return {boolean}\n * @protected\n */\n get __isRTL() {\n return this.getAttribute('dir') === 'rtl';\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n\n if (!this.hasAttribute('dir') || this.__restoreSubscription) {\n this.__subscribe();\n alignDirs(this, getDocumentDir(), null);\n }\n }\n\n /** @protected */\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n if (name !== 'dir') {\n return;\n }\n\n const documentDir = getDocumentDir();\n\n // New value equals to the document direction and the element is not subscribed to the changes\n const newValueEqlDocDir = newValue === documentDir && directionSubscribers.indexOf(this) === -1;\n // Value was emptied and the element is not subscribed to the changes\n const newValueEmptied = !newValue && oldValue && directionSubscribers.indexOf(this) === -1;\n // New value is different and the old equals to document direction and the element is not subscribed to the changes\n const newDiffValue = newValue !== documentDir && oldValue === documentDir;\n\n if (newValueEqlDocDir || newValueEmptied) {\n this.__subscribe();\n alignDirs(this, documentDir, newValue);\n } else if (newDiffValue) {\n this.__unsubscribe();\n }\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.__restoreSubscription = directionSubscribers.includes(this);\n this.__unsubscribe();\n }\n\n /** @protected */\n _valueToNodeAttribute(node, value, attribute) {\n // Override default Polymer attribute reflection to match native behavior of HTMLElement.dir property\n // If the property contains an empty string then it should not create an empty attribute\n if (attribute === 'dir' && value === '' && !node.hasAttribute('dir')) {\n return;\n }\n super._valueToNodeAttribute(node, value, attribute);\n }\n\n /** @protected */\n _attributeToProperty(attribute, value, type) {\n // Override default Polymer attribute reflection to match native behavior of HTMLElement.dir property\n // If the attribute is removed, then the dir property should contain an empty string instead of null\n if (attribute === 'dir' && !value) {\n this.dir = '';\n } else {\n super._attributeToProperty(attribute, value, type);\n }\n }\n\n /** @private */\n __subscribe() {\n if (!directionSubscribers.includes(this)) {\n directionSubscribers.push(this);\n }\n }\n\n /** @private */\n __unsubscribe() {\n if (directionSubscribers.includes(this)) {\n directionSubscribers.splice(directionSubscribers.indexOf(this), 1);\n }\n }\n };\n","const appliedClassMixins = new WeakMap();\n\n/** Vefify if the Mixin was previously applyed\n * @private\n * @param {function} mixin Mixin being applyed\n * @param {object} superClass Class receiving the new mixin\n * @returns {boolean}\n */\nfunction wasMixinPreviouslyApplied(mixin, superClass) {\n let klass = superClass;\n while (klass) {\n if (appliedClassMixins.get(klass) === mixin) {\n return true;\n }\n klass = Object.getPrototypeOf(klass);\n }\n return false;\n}\n\n/** Apply each mixin in the chain to make sure they are not applied more than once to the final class.\n * @export\n * @param {function} mixin Mixin to be applyed\n * @returns {object} Mixed class with mixin applied\n */\nexport function dedupeMixin(mixin) {\n return superClass => {\n if (wasMixinPreviouslyApplied(mixin, superClass)) {\n return superClass;\n }\n const mixedClass = mixin(superClass);\n appliedClassMixins.set(mixedClass, mixin);\n return mixedClass;\n };\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { dedupeMixin } from '@open-wc/dedupe-mixin';\nimport { get, set } from './path-utils.js';\n\nconst caseMap = {};\n\nconst CAMEL_TO_DASH = /([A-Z])/gu;\n\nfunction camelToDash(camel) {\n if (!caseMap[camel]) {\n caseMap[camel] = camel.replace(CAMEL_TO_DASH, '-$1').toLowerCase();\n }\n return caseMap[camel];\n}\n\nfunction upper(name) {\n return name[0].toUpperCase() + name.substring(1);\n}\n\nfunction parseObserver(observerString) {\n const [method, rest] = observerString.split('(');\n const observerProps = rest\n .replace(')', '')\n .split(',')\n .map((prop) => prop.trim());\n\n return {\n method,\n observerProps,\n };\n}\n\nfunction getOrCreateMap(obj, name) {\n if (!Object.prototype.hasOwnProperty.call(obj, name)) {\n // Clone any existing entries (superclasses)\n obj[name] = new Map(obj[name]);\n }\n return obj[name];\n}\n\nconst PolylitMixinImplementation = (superclass) => {\n class PolylitMixinClass extends superclass {\n static createProperty(name, options) {\n if ([String, Boolean, Number, Array].includes(options)) {\n options = {\n type: options,\n };\n }\n\n if (options.reflectToAttribute) {\n options.reflect = true;\n }\n\n super.createProperty(name, options);\n }\n\n static getOrCreateMap(name) {\n return getOrCreateMap(this, name);\n }\n\n /**\n * @protected\n * @override\n */\n static finalize() {\n super.finalize();\n\n if (Array.isArray(this.observers)) {\n const complexObservers = this.getOrCreateMap('__complexObservers');\n\n this.observers.forEach((observer) => {\n const { method, observerProps } = parseObserver(observer);\n complexObservers.set(method, observerProps);\n });\n }\n }\n\n static addCheckedInitializer(initializer) {\n super.addInitializer((instance) => {\n // Prevent initializer from affecting superclass\n if (instance instanceof this) {\n initializer(instance);\n }\n });\n }\n\n static getPropertyDescriptor(name, key, options) {\n const defaultDescriptor = super.getPropertyDescriptor(name, key, options);\n\n let result = defaultDescriptor;\n\n // Set the key for this property\n this.getOrCreateMap('__propKeys').set(name, key);\n\n if (options.sync) {\n result = {\n get: defaultDescriptor.get,\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this.requestUpdate(name, oldValue, options);\n\n // Enforce synchronous update\n if (this.hasUpdated) {\n this.performUpdate();\n }\n },\n configurable: true,\n enumerable: true,\n };\n }\n\n if (options.readOnly) {\n const setter = defaultDescriptor.set;\n\n this.addCheckedInitializer((instance) => {\n // This is run during construction of the element\n instance[`_set${upper(name)}`] = function (value) {\n setter.call(instance, value);\n\n if (options.sync) {\n this.performUpdate();\n }\n };\n });\n\n result = {\n get: defaultDescriptor.get,\n set() {\n // Do nothing, property is read-only.\n },\n configurable: true,\n enumerable: true,\n };\n }\n\n if ('value' in options) {\n // Set the default value\n this.addCheckedInitializer((instance) => {\n const value = typeof options.value === 'function' ? options.value.call(instance) : options.value;\n\n if (options.readOnly) {\n instance[`_set${upper(name)}`](value);\n } else {\n instance[name] = value;\n }\n });\n }\n\n if (options.observer) {\n const method = options.observer;\n\n // Set this method\n this.getOrCreateMap('__observers').set(name, method);\n\n this.addCheckedInitializer((instance) => {\n if (!instance[method]) {\n console.warn(`observer method ${method} not defined`);\n }\n });\n }\n\n if (options.notify) {\n if (!this.__notifyProps) {\n this.__notifyProps = new Set();\n // eslint-disable-next-line no-prototype-builtins\n } else if (!this.hasOwnProperty('__notifyProps')) {\n // Clone any existing observers (superclasses)\n const notifyProps = this.__notifyProps;\n this.__notifyProps = new Set(notifyProps);\n }\n\n // Set this method\n this.__notifyProps.add(name);\n }\n\n if (options.computed) {\n const assignComputedMethod = `__assignComputed${name}`;\n const observer = parseObserver(options.computed);\n this.prototype[assignComputedMethod] = function (...props) {\n this[name] = this[observer.method](...props);\n };\n\n this.getOrCreateMap('__complexObservers').set(assignComputedMethod, observer.observerProps);\n }\n\n if (!options.attribute) {\n options.attribute = camelToDash(name);\n }\n\n return result;\n }\n\n /** @protected */\n firstUpdated() {\n super.firstUpdated();\n\n if (!this.$) {\n this.$ = {};\n }\n\n this.renderRoot.querySelectorAll('[id]').forEach((node) => {\n this.$[node.id] = node;\n });\n }\n\n /** @protected */\n ready() {}\n\n /** @protected */\n updated(props) {\n if (this.constructor.__observers) {\n this.__runObservers(props, this.constructor.__observers);\n }\n\n if (this.constructor.__complexObservers) {\n this.__runComplexObservers(props, this.constructor.__complexObservers);\n }\n\n if (this.__dynamicObservers) {\n this.__runComplexObservers(props, this.__dynamicObservers);\n }\n\n if (this.constructor.__notifyProps) {\n this.__runNotifyProps(props, this.constructor.__notifyProps);\n }\n\n if (!this.__isReadyInvoked) {\n this.__isReadyInvoked = true;\n this.ready();\n }\n }\n\n /**\n * Set several properties at once and perform synchronous update.\n * @protected\n */\n setProperties(props) {\n Object.entries(props).forEach(([name, value]) => {\n // Use private key and not setter to not trigger\n // update for properties marked as `sync: true`.\n const key = this.constructor.__propKeys.get(name);\n const oldValue = this[key];\n this[key] = value;\n this.requestUpdate(name, oldValue);\n });\n\n // Perform sync update\n if (this.hasUpdated) {\n this.performUpdate();\n }\n }\n\n /** @protected */\n _createMethodObserver(observer) {\n const dynamicObservers = getOrCreateMap(this, '__dynamicObservers');\n const { method, observerProps } = parseObserver(observer);\n dynamicObservers.set(method, observerProps);\n }\n\n /** @private */\n __runComplexObservers(props, observers) {\n observers.forEach((observerProps, method) => {\n if (observerProps.some((prop) => props.has(prop))) {\n if (!this[method]) {\n console.warn(`observer method ${method} not defined`);\n } else {\n this[method](...observerProps.map((prop) => this[prop]));\n }\n }\n });\n }\n\n /** @private */\n __runObservers(props, observers) {\n props.forEach((v, k) => {\n const observer = observers.get(k);\n if (observer !== undefined && this[observer]) {\n this[observer](this[k], v);\n }\n });\n }\n\n /** @private */\n __runNotifyProps(props, notifyProps) {\n props.forEach((_, k) => {\n if (notifyProps.has(k)) {\n this.dispatchEvent(\n new CustomEvent(`${camelToDash(k)}-changed`, {\n detail: {\n value: this[k],\n },\n }),\n );\n }\n });\n }\n\n /** @protected */\n _get(path, object) {\n return get(path, object);\n }\n\n /** @protected */\n _set(path, value, object) {\n set(path, value, object);\n }\n }\n\n return PolylitMixinClass;\n};\n\nexport const PolylitMixin = dedupeMixin(PolylitMixinImplementation);\n","/**\n * @license\n * Copyright (c) 2023 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Convenience method for reading a value from a path.\n *\n * @param {string} path\n * @param {object} object\n */\nexport function get(path, object) {\n return path.split('.').reduce((obj, property) => (obj ? obj[property] : undefined), object);\n}\n\n/**\n * Convenience method for setting a value to a path.\n *\n * @param {string} path\n * @param {unknown} value\n * @param {object} object\n */\nexport function set(path, value, object) {\n const pathParts = path.split('.');\n const lastPart = pathParts.pop();\n const target = pathParts.reduce((target, part) => target[part], object);\n target[lastPart] = value;\n}\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { css } from 'lit';\n\nexport const overlayStyles = css`\n :host {\n z-index: 200;\n position: fixed;\n\n /* Despite of what the names say, <vaadin-overlay> is just a container\n for position/sizing/alignment. The actual overlay is the overlay part. */\n\n /* Default position constraints: the entire viewport. Note: themes can\n override this to introduce gaps between the overlay and the viewport. */\n inset: 0;\n bottom: var(--vaadin-overlay-viewport-bottom);\n\n /* Use flexbox alignment for the overlay part. */\n display: flex;\n flex-direction: column; /* makes dropdowns sizing easier */\n /* Align to center by default. */\n align-items: center;\n justify-content: center;\n\n /* Allow centering when max-width/max-height applies. */\n margin: auto;\n\n /* The host is not clickable, only the overlay part is. */\n pointer-events: none;\n\n /* Remove tap highlight on touch devices. */\n -webkit-tap-highlight-color: transparent;\n\n /* CSS API for host */\n --vaadin-overlay-viewport-bottom: 0;\n }\n\n :host([hidden]),\n :host(:not([opened]):not([closing])),\n :host(:not([opened]):not([closing])) [part='overlay'] {\n display: none !important;\n }\n\n [part='overlay'] {\n -webkit-overflow-scrolling: touch;\n overflow: auto;\n pointer-events: auto;\n\n /* Prevent overflowing the host */\n max-width: 100%;\n box-sizing: border-box;\n\n -webkit-tap-highlight-color: initial; /* reenable tap highlight inside */\n }\n\n [part='backdrop'] {\n z-index: -1;\n content: '';\n background: rgba(0, 0, 0, 0.5);\n position: fixed;\n inset: 0;\n pointer-events: auto;\n }\n`;\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n/**\n * @polymerMixin\n */\nexport const ThemePropertyMixin = (superClass) =>\n class VaadinThemePropertyMixin extends superClass {\n static get properties() {\n return {\n /**\n * Helper property with theme attribute value facilitating propagation\n * in shadow DOM.\n *\n * Enables the component implementation to propagate the `theme`\n * attribute value to the sub-components in Shadow DOM by binding\n * the sub-component's \"theme\" attribute to the `theme` property of\n * the host.\n *\n * **NOTE:** Extending the mixin only provides the property for binding,\n * and does not make the propagation alone.\n *\n * See [Styling Components: Sub-components](https://vaadin.com/docs/latest/styling/styling-components/#sub-components).\n * page for more information.\n *\n * @protected\n */\n _theme: {\n type: String,\n readOnly: true,\n },\n };\n }\n\n static get observedAttributes() {\n return [...super.observedAttributes, 'theme'];\n }\n\n /** @protected */\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n\n if (name === 'theme') {\n this._set_theme(newValue);\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { adoptStyles, css, CSSResult, LitElement, unsafeCSS } from 'lit';\nimport { ThemePropertyMixin } from './vaadin-theme-property-mixin.js';\n\nexport { css, unsafeCSS };\n\n/**\n * @typedef {Object} Theme\n * @property {string} themeFor\n * @property {CSSResult[]} styles\n * @property {string | string[]} [include]\n * @property {string} [moduleId]\n *\n * @typedef {CSSResult[] | CSSResult} CSSResultGroup\n */\n\n/**\n * @type {Theme[]}\n */\nconst themeRegistry = [];\n\n/**\n * @type {WeakRef<HTMLElement>[]}\n */\nconst themableInstances = new Set();\n\n/**\n * @type {string[]}\n */\nconst themableTagNames = new Set();\n\n/**\n * Check if the custom element type has themes applied.\n * @param {Function} elementClass\n * @returns {boolean}\n */\nfunction classHasThemes(elementClass) {\n return elementClass && Object.prototype.hasOwnProperty.call(elementClass, '__themes');\n}\n\n/**\n * Check if the custom element type has themes applied.\n * @param {string} tagName\n * @returns {boolean}\n */\nfunction hasThemes(tagName) {\n return classHasThemes(customElements.get(tagName));\n}\n\n/**\n * Flattens the styles into a single array of styles.\n * @param {CSSResultGroup} styles\n * @param {CSSResult[]} result\n * @returns {CSSResult[]}\n */\nfunction flattenStyles(styles = []) {\n return [styles].flat(Infinity).filter((style) => {\n if (style instanceof CSSResult) {\n return true;\n }\n console.warn('An item in styles is not of type CSSResult. Use `unsafeCSS` or `css`.');\n return false;\n });\n}\n\n/**\n * Returns true if the themeFor string matches the tag name\n * @param {string} themeFor\n * @param {string} tagName\n * @returns {boolean}\n */\nfunction matchesThemeFor(themeFor, tagName) {\n return (themeFor || '').split(' ').some((themeForToken) => {\n return new RegExp(`^${themeForToken.split('*').join('.*')}$`, 'u').test(tagName);\n });\n}\n\n/**\n * Returns the CSS text content from an array of CSSResults\n * @param {CSSResult[]} styles\n * @returns {string}\n */\nfunction getCssText(styles) {\n return styles.map((style) => style.cssText).join('\\n');\n}\n\nconst STYLE_ID = 'vaadin-themable-mixin-style';\n\n/**\n * Includes the styles to the template.\n * @param {CSSResult[]} styles\n * @param {HTMLTemplateElement} template\n */\nfunction addStylesToTemplate(styles, template) {\n const styleEl = document.createElement('style');\n styleEl.id = STYLE_ID;\n styleEl.textContent = getCssText(styles);\n template.content.appendChild(styleEl);\n}\n\n/**\n * Dynamically updates the styles of the given component instance.\n * @param {HTMLElement} instance\n */\nfunction updateInstanceStyles(instance) {\n if (!instance.shadowRoot) {\n return;\n }\n\n const componentClass = instance.constructor;\n\n if (instance instanceof LitElement) {\n // LitElement\n\n // The adoptStyles function may fall back to appending style elements to shadow root.\n // Remove them first to avoid duplicates.\n [...instance.shadowRoot.querySelectorAll('style')].forEach((style) => style.remove());\n\n // Adopt the updated styles\n adoptStyles(instance.shadowRoot, componentClass.elementStyles);\n } else {\n // PolymerElement\n\n // Update style element content in the shadow root\n const style = instance.shadowRoot.getElementById(STYLE_ID);\n const template = componentClass.prototype._template;\n style.textContent = template.content.getElementById(STYLE_ID).textContent;\n }\n}\n\n/**\n * Dynamically updates the styles of the instances matching the given component type.\n * @param {Function} componentClass\n */\nfunction updateInstanceStylesOfType(componentClass) {\n // Iterate over component instances and update their styles if needed\n themableInstances.forEach((ref) => {\n const instance = ref.deref();\n if (instance instanceof componentClass) {\n updateInstanceStyles(instance);\n } else if (!instance) {\n // Clean up the weak reference to a GC'd instance\n themableInstances.delete(ref);\n }\n });\n}\n\n/**\n * Dynamically updates the styles of the given component type.\n * @param {Function} componentClass\n */\nfunction updateComponentStyles(componentClass) {\n if (componentClass.prototype instanceof LitElement) {\n // Update LitElement-based component's elementStyles\n componentClass.elementStyles = componentClass.finalizeStyles(componentClass.styles);\n } else {\n // Update Polymer-based component's template\n const template = componentClass.prototype._template;\n template.content.getElementById(STYLE_ID).textContent = getCssText(componentClass.getStylesForThis());\n }\n\n // Update the styles of inheriting types\n themableTagNames.forEach((inheritingTagName) => {\n const inheritingClass = customElements.get(inheritingTagName);\n if (inheritingClass !== componentClass && inheritingClass.prototype instanceof componentClass) {\n updateComponentStyles(inheritingClass);\n }\n });\n}\n\n/**\n * Check if the component type already has a style matching the given styles.\n *\n * @param {Function} componentClass\n * @param {CSSResultGroup} styles\n * @returns {boolean}\n */\nfunction hasMatchingStyle(componentClass, styles) {\n const themes = componentClass.__themes;\n if (!themes || !styles) {\n return false;\n }\n\n return themes.some((theme) =>\n theme.styles.some((themeStyle) => styles.some((style) => style.cssText === themeStyle.cssText)),\n );\n}\n\n/**\n * Registers CSS styles for a component type. Make sure to register the styles before\n * the first instance of a component of the type is attached to DOM.\n *\n * @param {string} themeFor The local/tag name of the component type to register the styles for\n * @param {CSSResultGroup} styles The CSS style rules to be registered for the component type\n * matching themeFor and included in the local scope of each component instance\n * @param {{moduleId?: string, include?: string | string[]}} options Additional options\n * @return {void}\n */\nexport function registerStyles(themeFor, styles, options = {}) {\n styles = flattenStyles(styles);\n\n if (window.Vaadin && window.Vaadin.styleModules) {\n window.Vaadin.styleModules.registerStyles(themeFor, styles, options);\n } else {\n themeRegistry.push({\n themeFor,\n styles,\n include: options.include,\n moduleId: options.moduleId,\n });\n }\n\n if (themeFor) {\n // Update styles of the component types that match themeFor and have already been finalized\n themableTagNames.forEach((tagName) => {\n if (matchesThemeFor(themeFor, tagName) && hasThemes(tagName)) {\n const componentClass = customElements.get(tagName);\n\n if (hasMatchingStyle(componentClass, styles)) {\n // Show a warning if the component type already has some of the given styles\n console.warn(`Registering styles that already exist for ${tagName}`);\n } else if (!window.Vaadin || !window.Vaadin.suppressPostFinalizeStylesWarning) {\n // Show a warning if the component type has already been finalized\n console.warn(\n `The custom element definition for \"${tagName}\" ` +\n `was finalized before a style module was registered. ` +\n `Ideally, import component specific style modules before ` +\n `importing the corresponding custom element. ` +\n `This warning can be suppressed by setting \"window.Vaadin.suppressPostFinalizeStylesWarning = true\".`,\n );\n }\n\n // Update the styles of the component type\n updateComponentStyles(componentClass);\n // Update the styles of the component instances matching the component type\n updateInstanceStylesOfType(componentClass);\n }\n });\n }\n}\n\n/**\n * Returns all registered themes. By default the themeRegistry is returned as is.\n * In case the style-modules adapter is imported, the themes are obtained from there instead\n * @returns {Theme[]}\n */\nfunction getAllThemes() {\n if (window.Vaadin && window.Vaadin.styleModules) {\n return window.Vaadin.styleModules.getAllThemes();\n }\n return themeRegistry;\n}\n\n/**\n * Maps the moduleName to an include priority number which is used for\n * determining the order in which styles are applied.\n * @param {string} moduleName\n * @returns {number}\n */\nfunction getIncludePriority(moduleName = '') {\n let includePriority = 0;\n if (moduleName.startsWith('lumo-') || moduleName.startsWith('material-')) {\n includePriority = 1;\n } else if (moduleName.startsWith('vaadin-')) {\n includePriority = 2;\n }\n return includePriority;\n}\n\n/**\n * Gets an array of CSSResults matching the include property of the theme.\n * @param {Theme} theme\n * @returns {CSSResult[]}\n */\nfunction getIncludedStyles(theme) {\n const includedStyles = [];\n if (theme.include) {\n [].concat(theme.include).forEach((includeModuleId) => {\n const includedTheme = getAllThemes().find((s) => s.moduleId === includeModuleId);\n if (includedTheme) {\n includedStyles.push(...getIncludedStyles(includedTheme), ...includedTheme.styles);\n } else {\n console.warn(`Included moduleId ${includeModuleId} not found in style registry`);\n }\n }, theme.styles);\n }\n return includedStyles;\n}\n\n/**\n * Returns an array of themes that should be used for styling a component matching\n * the tag name. The array is sorted by the include order.\n * @param {string} tagName\n * @returns {Theme[]}\n */\nfunction getThemes(tagName) {\n const defaultModuleName = `${tagName}-default-theme`;\n\n const themes = getAllThemes()\n // Filter by matching themeFor properties\n .filter((theme) => theme.moduleId !== defaultModuleName && matchesThemeFor(theme.themeFor, tagName))\n .map((theme) => ({\n ...theme,\n // Prepend styles from included themes\n styles: [...getIncludedStyles(theme), ...theme.styles],\n // Map moduleId to includePriority\n includePriority: getIncludePriority(theme.moduleId),\n }))\n // Sort by includePriority\n .sort((themeA, themeB) => themeB.includePriority - themeA.includePriority);\n\n if (themes.length > 0) {\n return themes;\n }\n // No theme modules found, return the default module if it exists\n return getAllThemes().filter((theme) => theme.moduleId === defaultModuleName);\n}\n\n/**\n * @polymerMixin\n * @mixes ThemePropertyMixin\n */\nexport const ThemableMixin = (superClass) =>\n class VaadinThemableMixin extends ThemePropertyMixin(superClass) {\n constructor() {\n super();\n // Store a weak reference to the instance\n themableInstances.add(new WeakRef(this));\n }\n\n /**\n * Covers PolymerElement based component styling\n * @protected\n */\n static finalize() {\n super.finalize();\n\n if (this.is) {\n themableTagNames.add(this.is);\n }\n\n // Make sure not to run the logic intended for PolymerElement when LitElement is used.\n if (this.elementStyles) {\n return;\n }\n\n const template = this.prototype._template;\n if (!template || classHasThemes(this)) {\n return;\n }\n\n addStylesToTemplate(this.getStylesForThis(), template);\n }\n\n /**\n * Covers LitElement based component styling\n *\n * @protected\n */\n static finalizeStyles(styles) {\n // The \"styles\" object originates from the \"static get styles()\" function of\n // a LitElement based component. The theme styles are added after it\n // so that they can override the component styles.\n const themeStyles = this.getStylesForThis();\n return styles ? [...[styles].flat(Infinity), ...themeStyles] : themeStyles;\n }\n\n /**\n * Get styles for the component type\n *\n * @private\n */\n static getStylesForThis() {\n const superClassThemes = superClass.__themes || [];\n const parent = Object.getPrototypeOf(this.prototype);\n const inheritedThemes = (parent ? parent.constructor.__themes : []) || [];\n this.__themes = [...superClassThemes, ...inheritedThemes, ...getThemes(this.is)];\n const themeStyles = this.__themes.flatMap((theme) => theme.styles);\n // Remove duplicates\n return themeStyles.filter((style, index) => index === themeStyles.lastIndexOf(style));\n }\n };\n\nexport { themeRegistry as __themeRegistry };\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\nconst testUserAgent = (regexp) => regexp.test(navigator.userAgent);\n\nconst testPlatform = (regexp) => regexp.test(navigator.platform);\n\nconst testVendor = (regexp) => regexp.test(navigator.vendor);\n\nexport const isAndroid = testUserAgent(/Android/u);\n\nexport const isChrome = testUserAgent(/Chrome/u) && testVendor(/Google Inc/u);\n\nexport const isFirefox = testUserAgent(/Firefox/u);\n\n// IPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\nexport const isIPad = testPlatform(/^iPad/u) || (testPlatform(/^Mac/u) && navigator.maxTouchPoints > 1);\n\nexport const isIPhone = testPlatform(/^iPhone/u);\n\nexport const isIOS = isIPhone || isIPad;\n\nexport const isSafari = testUserAgent(/^((?!chrome|android).)*safari/iu);\n\nexport const isTouch = (() => {\n try {\n document.createEvent('TouchEvent');\n return true;\n } catch (_) {\n return false;\n }\n})();\n","/**\n * @license\n * Copyright (c) 2017 Anton Korzunov\n * SPDX-License-Identifier: MIT\n */\n\n/**\n * @fileoverview\n *\n * This module includes JS code copied from the `aria-hidden` package:\n * https://github.com/theKashey/aria-hidden/blob/master/src/index.ts\n */\n\n/** @type {WeakMap<Element, number>} */\nlet counterMap = new WeakMap();\n\n/** @type {WeakMap<Element, boolean>} */\nlet uncontrolledNodes = new WeakMap();\n\n/** @type {Record<string, WeakMap<Element, number>>} */\nlet markerMap = {};\n\n/** @type {number} */\nlet lockCount = 0;\n\n/**\n * @param {?Node} node\n * @return {boolean}\n */\nconst isElement = (node) => node && node.nodeType === Node.ELEMENT_NODE;\n\n/**\n * @param {...unknown} args\n */\nconst logError = (...args) => {\n console.error(`Error: ${args.join(' ')}. Skip setting aria-hidden.`);\n};\n\n/**\n * @param {HTMLElement} parent\n * @param {Element[]} targets\n * @return {Element[]}\n */\nconst correctTargets = (parent, targets) => {\n if (!isElement(parent)) {\n logError(parent, 'is not a valid element');\n return [];\n }\n\n return targets\n .map((target) => {\n if (!isElement(target)) {\n logError(target, 'is not a valid element');\n return null;\n }\n\n let node = target;\n while (node && node !== parent) {\n if (parent.contains(node)) {\n return target;\n }\n node = node.getRootNode().host;\n }\n\n logError(target, 'is not contained inside', parent);\n return null;\n })\n .filter((x) => Boolean(x));\n};\n\n/**\n * Marks everything except given node(or nodes) as aria-hidden\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param {HTMLElement} [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @param {String} [controlAttribute] - html Attribute to control\n * @return {Function}\n */\nconst applyAttributeToOthers = (originalTarget, parentNode, markerName, controlAttribute) => {\n const targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);\n\n if (!markerMap[markerName]) {\n markerMap[markerName] = new WeakMap();\n }\n\n const markerCounter = markerMap[markerName];\n\n /** @type {Element[]} */\n const hiddenNodes = [];\n\n /** @type {Set<Node>} */\n const elementsToKeep = new Set();\n\n /** @type {Set<Node>} */\n const elementsToStop = new Set(targets);\n\n /**\n * @param {?Node} el\n */\n const keep = (el) => {\n if (!el || elementsToKeep.has(el)) {\n return;\n }\n\n elementsToKeep.add(el);\n\n const slot = el.assignedSlot;\n if (slot) {\n keep(slot);\n }\n\n keep(el.parentNode || el.host);\n };\n\n targets.forEach(keep);\n\n /**\n * @param {?Node} el\n */\n const deep = (parent) => {\n if (!parent || elementsToStop.has(parent)) {\n return;\n }\n\n const root = parent.shadowRoot;\n const children = root ? [...parent.children, ...root.children] : [...parent.children];\n children.forEach((node) => {\n // Skip elements that don't need to be hidden\n if (['template', 'script', 'style'].includes(node.localName)) {\n return;\n }\n\n if (elementsToKeep.has(node)) {\n deep(node);\n } else {\n const attr = node.getAttribute(controlAttribute);\n const alreadyHidden = attr !== null && attr !== 'false';\n const counterValue = (counterMap.get(node) || 0) + 1;\n const markerValue = (markerCounter.get(node) || 0) + 1;\n\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n hiddenNodes.push(node);\n\n if (counterValue === 1 && alreadyHidden) {\n uncontrolledNodes.set(node, true);\n }\n\n if (markerValue === 1) {\n node.setAttribute(markerName, 'true');\n }\n\n if (!alreadyHidden) {\n node.setAttribute(controlAttribute, 'true');\n }\n }\n });\n };\n\n deep(parentNode);\n\n elementsToKeep.clear();\n\n lockCount += 1;\n\n return () => {\n hiddenNodes.forEach((node) => {\n const counterValue = counterMap.get(node) - 1;\n const markerValue = markerCounter.get(node) - 1;\n\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n\n if (!counterValue) {\n if (uncontrolledNodes.has(node)) {\n uncontrolledNodes.delete(node);\n } else {\n node.removeAttribute(controlAttribute);\n }\n }\n\n if (!markerValue) {\n node.removeAttribute(markerName);\n }\n });\n\n lockCount -= 1;\n\n if (!lockCount) {\n // clear\n counterMap = new WeakMap();\n counterMap = new WeakMap();\n uncontrolledNodes = new WeakMap();\n markerMap = {};\n }\n };\n};\n\n/**\n * Marks everything except given node(or nodes) as aria-hidden\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param {HTMLElement} [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Function} undo command\n */\nexport const hideOthers = (originalTarget, parentNode = document.body, markerName = 'data-aria-hidden') => {\n const targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);\n\n if (parentNode) {\n // We should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10\n targets.push(...Array.from(parentNode.querySelectorAll('[aria-live]')));\n }\n\n return applyAttributeToOthers(targets, parentNode, markerName, 'aria-hidden');\n};\n\n/**\n * Marks everything except given node(or nodes) as inert\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param {HTMLElement} [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Function} undo command\n */\nexport const inertOthers = (originalTarget, parentNode = document.body, markerName = 'data-inert-ed') => {\n return applyAttributeToOthers(originalTarget, parentNode, markerName, 'inert');\n};\n\n/**\n * @return if current browser supports inert\n */\nexport const supportsInert = 'inert' in HTMLElement.prototype;\n\n/**\n * Automatic function to \"suppress\" DOM elements - _hide_ or _inert_ in the best possible way\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param {HTMLElement} [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Function} undo command\n */\nexport const suppressOthers = (originalTarget, parentNode, markerName) =>\n (supportsInert ? inertOthers : hideOthers)(originalTarget, parentNode, markerName);\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { hideOthers } from './aria-hidden.js';\n\n/**\n * A controller for handling modal state on the elements with `dialog` and `alertdialog` role.\n * See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-modal\n *\n * Note, the actual `role` and `aria-modal` attributes are supposed to be handled by the\n * consumer web component. This is done in to ensure the controller only does one thing.\n */\nexport class AriaModalController {\n /**\n * @param {HTMLElement} host\n */\n constructor(host, callback) {\n /**\n * The controller host element.\n *\n * @type {HTMLElement}\n */\n this.host = host;\n\n /**\n * The callback used to detect which element\n * to use as a target. Defaults to the host.\n *\n * @type {Function}\n */\n this.callback = typeof callback === 'function' ? callback : () => host;\n }\n\n /**\n * Make the controller host modal by hiding other elements from screen readers\n * using `aria-hidden` attribute (can be replaced with `inert` in the future).\n *\n * The method name is chosen to align with the one provided by native `<dialog>`:\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal\n */\n showModal() {\n const targets = this.callback();\n this.__showOthers = hideOthers(targets);\n }\n\n /**\n * Remove `aria-hidden` from other elements unless there are any other\n * controller hosts on the page activated by using `showModal()` call.\n */\n close() {\n if (this.__showOthers) {\n this.__showOthers();\n this.__showOthers = null;\n }\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { getDeepActiveElement } from './focus-utils.js';\n\n/**\n * A controller for saving a focused node and restoring focus to it later.\n */\nexport class FocusRestorationController {\n /**\n * Saves the given node as a target for restoring focus to\n * when `restoreFocus()` is called. If no node is provided,\n * the currently focused node in the DOM is saved as a target.\n *\n * @param {Node | null | undefined} focusNode\n */\n saveFocus(focusNode) {\n this.focusNode = focusNode || getDeepActiveElement();\n }\n\n /**\n * Restores focus to the target node that was saved previously with `saveFocus()`.\n */\n restoreFocus(options) {\n const focusNode = this.focusNode;\n if (!focusNode) {\n return;\n }\n\n const preventScroll = options ? options.preventScroll : false;\n\n if (getDeepActiveElement() === document.body) {\n // In Firefox and Safari, focusing the node synchronously\n // doesn't work as expected when the overlay is closing on outside click.\n // These browsers force focus to move to the body element and retain it\n // there until the next event loop iteration.\n setTimeout(() => focusNode.focus({ preventScroll }));\n } else {\n focusNode.focus({ preventScroll });\n }\n\n this.focusNode = null;\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { getFocusableElements, isElementFocused } from './focus-utils.js';\n\nconst instances = [];\n\n/**\n * A controller for trapping focus within a DOM node.\n */\nexport class FocusTrapController {\n /**\n * @param {HTMLElement} host\n */\n constructor(host) {\n /**\n * The controller host element.\n *\n * @type {HTMLElement}\n */\n this.host = host;\n\n /**\n * A node for trapping focus in.\n *\n * @type {HTMLElement | null}\n * @private\n */\n this.__trapNode = null;\n\n this.__onKeyDown = this.__onKeyDown.bind(this);\n }\n\n /**\n * An array of tab-ordered focusable elements inside the trap node.\n *\n * @return {HTMLElement[]}\n * @private\n */\n get __focusableElements() {\n return getFocusableElements(this.__trapNode);\n }\n\n /**\n * The index of the element inside the trap node that currently has focus.\n *\n * @return {HTMLElement | undefined}\n * @private\n */\n get __focusedElementIndex() {\n const focusableElements = this.__focusableElements;\n return focusableElements.indexOf(focusableElements.filter(isElementFocused).pop());\n }\n\n hostConnected() {\n document.addEventListener('keydown', this.__onKeyDown);\n }\n\n hostDisconnected() {\n document.removeEventListener('keydown', this.__onKeyDown);\n }\n\n /**\n * Activates a focus trap for a DOM node that will prevent focus from escaping the node.\n * The trap can be deactivated with the `.releaseFocus()` method.\n *\n * If focus is initially outside the trap, the method will move focus inside,\n * on the first focusable element of the trap in the tab order.\n * The first focusable element can be the trap node itself if it is focusable\n * and comes first in the tab order.\n *\n * If there are no focusable elements, the method will throw an exception\n * and the trap will not be set.\n *\n * @param {HTMLElement} trapNode\n */\n trapFocus(trapNode) {\n this.__trapNode = trapNode;\n\n if (this.__focusableElements.length === 0) {\n this.__trapNode = null;\n throw new Error('The trap node should have at least one focusable descendant or be focusable itself.');\n }\n\n instances.push(this);\n\n if (this.__focusedElementIndex === -1) {\n this.__focusableElements[0].focus();\n }\n }\n\n /**\n * Deactivates the focus trap set with the `.trapFocus()` method\n * so that it becomes possible to tab outside the trap node.\n */\n releaseFocus() {\n this.__trapNode = null;\n\n instances.pop();\n }\n\n /**\n * A `keydown` event handler that manages tabbing navigation when the trap is enabled.\n *\n * - Moves focus to the next focusable element of the trap on `Tab` press.\n * When no next element to focus, the method moves focus to the first focusable element.\n * - Moves focus to the prev focusable element of the trap on `Shift+Tab` press.\n * When no prev element to focus, the method moves focus to the last focusable element.\n *\n * @param {KeyboardEvent} event\n * @private\n */\n __onKeyDown(event) {\n if (!this.__trapNode) {\n return;\n }\n\n // Only handle events for the last instance\n if (this !== Array.from(instances).pop()) {\n return;\n }\n\n if (event.key === 'Tab') {\n event.preventDefault();\n\n const backward = event.shiftKey;\n this.__focusNextElement(backward);\n }\n }\n\n /**\n * - Moves focus to the next focusable element if `backward === false`.\n * When no next element to focus, the method moves focus to the first focusable element.\n * - Moves focus to the prev focusable element if `backward === true`.\n * When no prev element to focus the method moves focus to the last focusable element.\n *\n * If no focusable elements, the method returns immediately.\n *\n * @param {boolean} backward\n * @private\n */\n __focusNextElement(backward = false) {\n const focusableElements = this.__focusableElements;\n const step = backward ? -1 : 1;\n const currentIndex = this.__focusedElementIndex;\n const nextIndex = (focusableElements.length + currentIndex + step) % focusableElements.length;\n const element = focusableElements[nextIndex];\n element.focus();\n if (element.localName === 'input') {\n element.select();\n }\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';\n\n/**\n * @typedef ReactiveController\n * @type {import('lit').ReactiveController}\n */\n\n/**\n * A mixin for connecting controllers to the element.\n *\n * @polymerMixin\n */\nexport const ControllerMixin = dedupingMixin((superClass) => {\n // If the superclass extends from LitElement,\n // use its own controllers implementation.\n if (typeof superClass.prototype.addController === 'function') {\n return superClass;\n }\n\n return class ControllerMixinClass extends superClass {\n constructor() {\n super();\n\n /**\n * @type {Set<ReactiveController>}\n */\n this.__controllers = new Set();\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n\n this.__controllers.forEach((c) => {\n if (c.hostConnected) {\n c.hostConnected();\n }\n });\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.__controllers.forEach((c) => {\n if (c.hostDisconnected) {\n c.hostDisconnected();\n }\n });\n }\n\n /**\n * Registers a controller to participate in the element update cycle.\n *\n * @param {ReactiveController} controller\n * @protected\n */\n addController(controller) {\n this.__controllers.add(controller);\n // Call hostConnected if a controller is added after the element is attached.\n if (this.$ !== undefined && this.isConnected && controller.hostConnected) {\n controller.hostConnected();\n }\n }\n\n /**\n * Removes a controller from the element.\n *\n * @param {ReactiveController} controller\n * @protected\n */\n removeController(controller) {\n this.__controllers.delete(controller);\n }\n };\n});\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { AriaModalController } from '@vaadin/a11y-base/src/aria-modal-controller.js';\nimport { FocusRestorationController } from '@vaadin/a11y-base/src/focus-restoration-controller.js';\nimport { FocusTrapController } from '@vaadin/a11y-base/src/focus-trap-controller.js';\nimport { getDeepActiveElement, isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';\nimport { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';\n\n/**\n * @polymerMixin\n * @mixes ControllerMixin\n */\nexport const OverlayFocusMixin = (superClass) =>\n class OverlayFocusMixin extends ControllerMixin(superClass) {\n static get properties() {\n return {\n /**\n * When true, opening the overlay moves focus to the first focusable child,\n * or to the overlay part with tabindex if there are no focusable children.\n * @attr {boolean} focus-trap\n */\n focusTrap: {\n type: Boolean,\n value: false,\n },\n\n /**\n * Set to true to enable restoring of focus when overlay is closed.\n * @attr {boolean} restore-focus-on-close\n */\n restoreFocusOnClose: {\n type: Boolean,\n value: false,\n },\n\n /**\n * Set to specify the element which should be focused on overlay close,\n * if `restoreFocusOnClose` is set to true.\n * @type {HTMLElement}\n */\n restoreFocusNode: {\n type: HTMLElement,\n },\n };\n }\n\n constructor() {\n super();\n\n this.__ariaModalController = new AriaModalController(this);\n this.__focusTrapController = new FocusTrapController(this);\n this.__focusRestorationController = new FocusRestorationController();\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this.addController(this.__ariaModalController);\n this.addController(this.__focusTrapController);\n this.addController(this.__focusRestorationController);\n }\n\n /**\n * Release focus and restore focus after the overlay is closed.\n *\n * @protected\n */\n _resetFocus() {\n if (this.focusTrap) {\n this.__ariaModalController.close();\n this.__focusTrapController.releaseFocus();\n }\n\n if (this.restoreFocusOnClose && this._shouldRestoreFocus()) {\n const preventScroll = !isKeyboardActive();\n this.__focusRestorationController.restoreFocus({ preventScroll });\n }\n }\n\n /**\n * Save the previously focused node when the overlay starts to open.\n *\n * @protected\n */\n _saveFocus() {\n if (this.restoreFocusOnClose) {\n this.__focusRestorationController.saveFocus(this.restoreFocusNode);\n }\n }\n\n /**\n * Trap focus within the overlay after opening has completed.\n *\n * @protected\n */\n _trapFocus() {\n if (this.focusTrap) {\n this.__ariaModalController.showModal();\n this.__focusTrapController.trapFocus(this.$.overlay);\n }\n }\n\n /**\n * Returns true if focus is still inside the overlay or on the body element,\n * otherwise false.\n *\n * Focus shouldn't be restored if it's been moved elsewhere by another\n * component or as a result of a user interaction e.g. the user clicked\n * on a button outside the overlay while the overlay was open.\n *\n * @protected\n * @return {boolean}\n */\n _shouldRestoreFocus() {\n const activeElement = getDeepActiveElement();\n return activeElement === document.body || this._deepContains(activeElement);\n }\n\n /**\n * Returns true if the overlay contains the given node,\n * including those within shadow DOM trees.\n *\n * @param {Node} node\n * @return {boolean}\n * @protected\n */\n _deepContains(node) {\n if (this.contains(node)) {\n return true;\n }\n let n = node;\n const doc = node.ownerDocument;\n // Walk from node to `this` or `document`\n while (n && n !== doc && n !== this) {\n n = n.parentNode || n.host;\n }\n return n === this;\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Returns all attached overlays in visual stacking order.\n * @private\n */\nconst getAttachedInstances = () =>\n Array.from(document.body.children)\n .filter((el) => el instanceof HTMLElement && el._hasOverlayStackMixin && !el.hasAttribute('closing'))\n .sort((a, b) => a.__zIndex - b.__zIndex || 0);\n\n/**\n * Returns all attached overlay instances excluding notification container,\n * which only needs to be in the stack for zIndex but not pointer-events.\n * @private\n */\nconst getOverlayInstances = () => getAttachedInstances().filter((el) => el.$.overlay);\n\n/**\n * Returns true if the overlay is the last one in the opened overlays stack.\n * @param {HTMLElement} overlay\n * @return {boolean}\n * @protected\n */\nexport const isLastOverlay = (overlay) => overlay === getOverlayInstances().pop();\n\n/**\n * @polymerMixin\n */\nexport const OverlayStackMixin = (superClass) =>\n class OverlayStackMixin extends superClass {\n constructor() {\n super();\n\n this._hasOverlayStackMixin = true;\n }\n\n /**\n * Returns true if this is the last one in the opened overlays stack.\n *\n * @return {boolean}\n * @protected\n */\n get _last() {\n return isLastOverlay(this);\n }\n\n /**\n * Brings the overlay as visually the frontmost one.\n */\n bringToFront() {\n let zIndex = '';\n const frontmost = getAttachedInstances()\n .filter((o) => o !== this)\n .pop();\n if (frontmost) {\n const frontmostZIndex = frontmost.__zIndex;\n zIndex = frontmostZIndex + 1;\n }\n this.style.zIndex = zIndex;\n this.__zIndex = zIndex || parseFloat(getComputedStyle(this).zIndex);\n }\n\n /** @protected */\n _enterModalState() {\n if (document.body.style.pointerEvents !== 'none') {\n // Set body pointer-events to 'none' to disable mouse interactions with\n // other document nodes.\n this._previousDocumentPointerEvents = document.body.style.pointerEvents;\n document.body.style.pointerEvents = 'none';\n }\n\n // Disable pointer events in other attached overlays\n getOverlayInstances().forEach((el) => {\n if (el !== this) {\n el.$.overlay.style.pointerEvents = 'none';\n }\n });\n }\n\n /** @protected */\n _exitModalState() {\n if (this._previousDocumentPointerEvents !== undefined) {\n // Restore body pointer-events\n document.body.style.pointerEvents = this._previousDocumentPointerEvents;\n delete this._previousDocumentPointerEvents;\n }\n\n // Restore pointer events in the previous overlay(s)\n const instances = getOverlayInstances();\n\n let el;\n // Use instances.pop() to ensure the reverse order\n while ((el = instances.pop())) {\n if (el === this) {\n // Skip the current instance\n continue;\n }\n el.$.overlay.style.removeProperty('pointer-events');\n if (!el.modeless) {\n // Stop after the last modal\n break;\n }\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';\nimport { isIOS } from '@vaadin/component-base/src/browser-utils.js';\nimport { OverlayFocusMixin } from './vaadin-overlay-focus-mixin.js';\nimport { OverlayStackMixin } from './vaadin-overlay-stack-mixin.js';\n\n/**\n * @polymerMixin\n * @mixes OverlayFocusMixin\n * @mixes OverlayStackMixin\n */\nexport const OverlayMixin = (superClass) =>\n class OverlayMixin extends OverlayFocusMixin(OverlayStackMixin(superClass)) {\n static get properties() {\n return {\n /**\n * When true, the overlay is visible and attached to body.\n */\n opened: {\n type: Boolean,\n notify: true,\n observer: '_openedChanged',\n reflectToAttribute: true,\n },\n\n /**\n * Owner element passed with renderer function\n * @type {HTMLElement}\n */\n owner: {\n type: Object,\n },\n\n /**\n * Object with properties that is passed to `renderer` function\n */\n model: {\n type: Object,\n },\n\n /**\n * Custom function for rendering the content of the overlay.\n * Receives three arguments:\n *\n * - `root` The root container DOM element. Append your content to it.\n * - `owner` The host element of the renderer function.\n * - `model` The object with the properties related with rendering.\n * @type {OverlayRenderer | null | undefined}\n */\n renderer: {\n type: Object,\n },\n\n /**\n * When true the overlay won't disable the main content, showing\n * it doesn't change the functionality of the user interface.\n * @type {boolean}\n */\n modeless: {\n type: Boolean,\n value: false,\n reflectToAttribute: true,\n observer: '_modelessChanged',\n },\n\n /**\n * When set to true, the overlay is hidden. This also closes the overlay\n * immediately in case there is a closing animation in progress.\n * @type {boolean}\n */\n hidden: {\n type: Boolean,\n reflectToAttribute: true,\n observer: '_hiddenChanged',\n },\n\n /**\n * When true the overlay has backdrop on top of content when opened.\n * @type {boolean}\n */\n withBackdrop: {\n type: Boolean,\n value: false,\n reflectToAttribute: true,\n },\n };\n }\n\n static get observers() {\n return ['_rendererOrDataChanged(renderer, owner, model, opened)'];\n }\n\n constructor() {\n super();\n\n this._boundMouseDownListener = this._mouseDownListener.bind(this);\n this._boundMouseUpListener = this._mouseUpListener.bind(this);\n this._boundOutsideClickListener = this._outsideClickListener.bind(this);\n this._boundKeydownListener = this._keydownListener.bind(this);\n\n /* c8 ignore next 3 */\n if (isIOS) {\n this._boundIosResizeListener = () => this._detectIosNavbar();\n }\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n // Need to add dummy click listeners to this and the backdrop or else\n // the document click event listener (_outsideClickListener) may never\n // get invoked on iOS Safari (reproducible in <vaadin-dialog>\n // and <vaadin-context-menu>).\n this.addEventListener('click', () => {});\n this.$.backdrop.addEventListener('click', () => {});\n\n this.addEventListener('mouseup', () => {\n // In Chrome, focus moves to body on overlay content mousedown\n // See https://github.com/vaadin/flow-components/issues/5507\n if (document.activeElement === document.body && this.$.overlay.getAttribute('tabindex') === '0') {\n this.$.overlay.focus();\n }\n });\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n\n /* c8 ignore next 3 */\n if (this._boundIosResizeListener) {\n this._detectIosNavbar();\n window.addEventListener('resize', this._boundIosResizeListener);\n }\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n\n /* c8 ignore next 3 */\n if (this._boundIosResizeListener) {\n window.removeEventListener('resize', this._boundIosResizeListener);\n }\n }\n\n /**\n * Requests an update for the content of the overlay.\n * While performing the update, it invokes the renderer passed in the `renderer` property.\n *\n * It is not guaranteed that the update happens immediately (synchronously) after it is requested.\n */\n requestContentUpdate() {\n if (this.renderer) {\n this.renderer.call(this.owner, this, this.owner, this.model);\n }\n }\n\n /**\n * @param {Event=} sourceEvent\n */\n close(sourceEvent) {\n const evt = new CustomEvent('vaadin-overlay-close', {\n bubbles: true,\n cancelable: true,\n detail: { sourceEvent },\n });\n this.dispatchEvent(evt);\n if (!evt.defaultPrevented) {\n this.opened = false;\n }\n }\n\n /** @private */\n _detectIosNavbar() {\n /* c8 ignore next 15 */\n if (!this.opened) {\n return;\n }\n\n const innerHeight = window.innerHeight;\n const innerWidth = window.innerWidth;\n\n const landscape = innerWidth > innerHeight;\n\n const clientHeight = document.documentElement.clientHeight;\n\n if (landscape && clientHeight > innerHeight) {\n this.style.setProperty('--vaadin-overlay-viewport-bottom', `${clientHeight - innerHeight}px`);\n } else {\n this.style.setProperty('--vaadin-overlay-viewport-bottom', '0');\n }\n }\n\n /** @private */\n _addGlobalListeners() {\n document.addEventListener('mousedown', this._boundMouseDownListener);\n document.addEventListener('mouseup', this._boundMouseUpListener);\n // Firefox leaks click to document on contextmenu even if prevented\n // https://bugzilla.mozilla.org/show_bug.cgi?id=990614\n document.documentElement.addEventListener('click', this._boundOutsideClickListener, true);\n }\n\n /** @private */\n _removeGlobalListeners() {\n document.removeEventListener('mousedown', this._boundMouseDownListener);\n document.removeEventListener('mouseup', this._boundMouseUpListener);\n document.documentElement.removeEventListener('click', this._boundOutsideClickListener, true);\n }\n\n /** @private */\n _rendererOrDataChanged(renderer, owner, model, opened) {\n const ownerOrModelChanged = this._oldOwner !== owner || this._oldModel !== model;\n this._oldModel = model;\n this._oldOwner = owner;\n\n const rendererChanged = this._oldRenderer !== renderer;\n const hasOldRenderer = this._oldRenderer !== undefined;\n this._oldRenderer = renderer;\n\n const openedChanged = this._oldOpened !== opened;\n this._oldOpened = opened;\n\n if (rendererChanged && hasOldRenderer) {\n this.innerHTML = '';\n // Whenever a Lit-based renderer is used, it assigns a Lit part to the node it was rendered into.\n // When clearing the rendered content, this part needs to be manually disposed of.\n // Otherwise, using a Lit-based renderer on the same node will throw an exception or render nothing afterward.\n delete this._$litPart$;\n }\n\n if (opened && renderer && (rendererChanged || openedChanged || ownerOrModelChanged)) {\n this.requestContentUpdate();\n }\n }\n\n /** @private */\n _modelessChanged(modeless) {\n if (!modeless) {\n if (this.opened) {\n this._addGlobalListeners();\n this._enterModalState();\n }\n } else {\n this._removeGlobalListeners();\n this._exitModalState();\n }\n }\n\n /** @private */\n _openedChanged(opened, wasOpened) {\n if (opened) {\n this._saveFocus();\n\n this._animatedOpening();\n\n afterNextRender(this, () => {\n this._trapFocus();\n\n const evt = new CustomEvent('vaadin-overlay-open', { bubbles: true });\n this.dispatchEvent(evt);\n });\n\n document.addEventListener('keydown', this._boundKeydownListener);\n\n if (!this.modeless) {\n this._addGlobalListeners();\n }\n } else if (wasOpened) {\n this._resetFocus();\n\n this._animatedClosing();\n\n document.removeEventListener('keydown', this._boundKeydownListener);\n\n if (!this.modeless) {\n this._removeGlobalListeners();\n }\n }\n }\n\n /** @private */\n _hiddenChanged(hidden) {\n if (hidden && this.hasAttribute('closing')) {\n this._flushAnimation('closing');\n }\n }\n\n /**\n * @return {boolean}\n * @private\n */\n _shouldAnimate() {\n const style = getComputedStyle(this);\n const name = style.getPropertyValue('animation-name');\n const hidden = style.getPropertyValue('display') === 'none';\n return !hidden && name && name !== 'none';\n }\n\n /**\n * @param {string} type\n * @param {Function} callback\n * @private\n */\n _enqueueAnimation(type, callback) {\n const handler = `__${type}Handler`;\n const listener = (event) => {\n if (event && event.target !== this) {\n return;\n }\n callback();\n this.removeEventListener('animationend', listener);\n delete this[handler];\n };\n this[handler] = listener;\n this.addEventListener('animationend', listener);\n }\n\n /**\n * @param {string} type\n * @protected\n */\n _flushAnimation(type) {\n const handler = `__${type}Handler`;\n if (typeof this[handler] === 'function') {\n this[handler]();\n }\n }\n\n /** @private */\n _animatedOpening() {\n if (this.parentNode === document.body && this.hasAttribute('closing')) {\n this._flushAnimation('closing');\n }\n this._attachOverlay();\n if (!this.modeless) {\n this._enterModalState();\n }\n this.setAttribute('opening', '');\n\n if (this._shouldAnimate()) {\n this._enqueueAnimation('opening', () => {\n this._finishOpening();\n });\n } else {\n this._finishOpening();\n }\n }\n\n /** @private */\n _attachOverlay() {\n this._placeholder = document.createComment('vaadin-overlay-placeholder');\n this.parentNode.insertBefore(this._placeholder, this);\n document.body.appendChild(this);\n this.bringToFront();\n }\n\n /** @private */\n _finishOpening() {\n this.removeAttribute('opening');\n }\n\n /** @private */\n _finishClosing() {\n this._detachOverlay();\n this.$.overlay.style.removeProperty('pointer-events');\n this.removeAttribute('closing');\n this.dispatchEvent(new CustomEvent('vaadin-overlay-closed'));\n }\n\n /** @private */\n _animatedClosing() {\n if (this.hasAttribute('opening')) {\n this._flushAnimation('opening');\n }\n if (this._placeholder) {\n this._exitModalState();\n this.setAttribute('closing', '');\n this.dispatchEvent(new CustomEvent('vaadin-overlay-closing'));\n\n if (this._shouldAnimate()) {\n this._enqueueAnimation('closing', () => {\n this._finishClosing();\n });\n } else {\n this._finishClosing();\n }\n }\n }\n\n /** @private */\n _detachOverlay() {\n this._placeholder.parentNode.insertBefore(this, this._placeholder);\n this._placeholder.parentNode.removeChild(this._placeholder);\n }\n\n /** @private */\n _mouseDownListener(event) {\n this._mouseDownInside = event.composedPath().indexOf(this.$.overlay) >= 0;\n }\n\n /** @private */\n _mouseUpListener(event) {\n this._mouseUpInside = event.composedPath().indexOf(this.$.overlay) >= 0;\n }\n\n /**\n * Whether to close the overlay on outside click or not.\n * Override this method to customize the closing logic.\n *\n * @param {Event} _event\n * @return {boolean}\n * @protected\n */\n _shouldCloseOnOutsideClick(_event) {\n return this._last;\n }\n\n /**\n * Outside click listener used in capture phase to close the overlay before\n * propagating the event to the listener on the element that triggered it.\n * Otherwise, calling `open()` would result in closing and re-opening.\n *\n * @private\n */\n _outsideClickListener(event) {\n if (event.composedPath().includes(this.$.overlay) || this._mouseDownInside || this._mouseUpInside) {\n this._mouseDownInside = false;\n this._mouseUpInside = false;\n return;\n }\n\n if (!this._shouldCloseOnOutsideClick(event)) {\n return;\n }\n\n const evt = new CustomEvent('vaadin-overlay-outside-click', {\n bubbles: true,\n cancelable: true,\n detail: { sourceEvent: event },\n });\n this.dispatchEvent(evt);\n\n if (this.opened && !evt.defaultPrevented) {\n this.close(event);\n }\n }\n\n /**\n * Listener used to close whe overlay on Escape press, if it is the last one.\n * @private\n */\n _keydownListener(event) {\n if (!this._last) {\n return;\n }\n\n // Only close modeless overlay on Esc press when it contains focus\n if (this.modeless && !event.composedPath().includes(this.$.overlay)) {\n return;\n }\n\n if (event.key === 'Escape') {\n const evt = new CustomEvent('vaadin-overlay-escape-press', {\n bubbles: true,\n cancelable: true,\n detail: { sourceEvent: event },\n });\n this.dispatchEvent(evt);\n\n if (this.opened && !evt.defaultPrevented) {\n this.close(event);\n }\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { getAncestorRootNodes } from '@vaadin/component-base/src/dom-utils.js';\nimport { observeMove } from './vaadin-overlay-utils.js';\n\nconst PROP_NAMES_VERTICAL = {\n start: 'top',\n end: 'bottom',\n};\n\nconst PROP_NAMES_HORIZONTAL = {\n start: 'left',\n end: 'right',\n};\n\nconst targetResizeObserver = new ResizeObserver((entries) => {\n setTimeout(() => {\n entries.forEach((entry) => {\n if (entry.target.__overlay) {\n entry.target.__overlay._updatePosition();\n }\n });\n });\n});\n\n/**\n * @polymerMixin\n */\nexport const PositionMixin = (superClass) =>\n class PositionMixin extends superClass {\n static get properties() {\n return {\n /**\n * The element next to which this overlay should be aligned.\n * The position of the overlay relative to the positionTarget can be adjusted\n * with properties `horizontalAlign`, `verticalAlign`, `noHorizontalOverlap`\n * and `noVerticalOverlap`.\n */\n positionTarget: {\n type: Object,\n value: null,\n sync: true,\n },\n\n /**\n * When `positionTarget` is set, this property defines whether to align the overlay's\n * left or right side to the target element by default.\n * Possible values are `start` and `end`.\n * RTL is taken into account when interpreting the value.\n * The overlay is automatically flipped to the opposite side when it doesn't fit into\n * the default side defined by this property.\n *\n * @attr {start|end} horizontal-align\n */\n horizontalAlign: {\n type: String,\n value: 'start',\n sync: true,\n },\n\n /**\n * When `positionTarget` is set, this property defines whether to align the overlay's\n * top or bottom side to the target element by default.\n * Possible values are `top` and `bottom`.\n * The overlay is automatically flipped to the opposite side when it doesn't fit into\n * the default side defined by this property.\n *\n * @attr {top|bottom} vertical-align\n */\n verticalAlign: {\n type: String,\n value: 'top',\n sync: true,\n },\n\n /**\n * When `positionTarget` is set, this property defines whether the overlay should overlap\n * the target element in the x-axis, or be positioned right next to it.\n *\n * @attr {boolean} no-horizontal-overlap\n */\n noHorizontalOverlap: {\n type: Boolean,\n value: false,\n sync: true,\n },\n\n /**\n * When `positionTarget` is set, this property defines whether the overlay should overlap\n * the target element in the y-axis, or be positioned right above/below it.\n *\n * @attr {boolean} no-vertical-overlap\n */\n noVerticalOverlap: {\n type: Boolean,\n value: false,\n sync: true,\n },\n\n /**\n * If the overlay content has no intrinsic height, this property can be used to set\n * the minimum vertical space (in pixels) required by the overlay. Setting a value to\n * the property effectively disables the content measurement in favor of using this\n * fixed value for determining the open direction.\n *\n * @attr {number} required-vertical-space\n */\n requiredVerticalSpace: {\n type: Number,\n value: 0,\n sync: true,\n },\n };\n }\n\n static get observers() {\n return [\n '__positionSettingsChanged(horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap, requiredVerticalSpace)',\n '__overlayOpenedChanged(opened, positionTarget)',\n ];\n }\n\n constructor() {\n super();\n\n this.__onScroll = this.__onScroll.bind(this);\n this._updatePosition = this._updatePosition.bind(this);\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n\n if (this.opened) {\n this.__addUpdatePositionEventListeners();\n }\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.__removeUpdatePositionEventListeners();\n }\n\n /** @private */\n __addUpdatePositionEventListeners() {\n window.visualViewport.addEventListener('resize', this._updatePosition);\n window.visualViewport.addEventListener('scroll', this.__onScroll, true);\n\n this.__positionTargetAncestorRootNodes = getAncestorRootNodes(this.positionTarget);\n this.__positionTargetAncestorRootNodes.forEach((node) => {\n node.addEventListener('scroll', this.__onScroll, true);\n });\n\n if (this.positionTarget) {\n this.__observePositionTargetMove = observeMove(this.positionTarget, () => {\n this._updatePosition();\n });\n }\n }\n\n /** @private */\n __removeUpdatePositionEventListeners() {\n window.visualViewport.removeEventListener('resize', this._updatePosition);\n window.visualViewport.removeEventListener('scroll', this.__onScroll, true);\n\n if (this.__positionTargetAncestorRootNodes) {\n this.__positionTargetAncestorRootNodes.forEach((node) => {\n node.removeEventListener('scroll', this.__onScroll, true);\n });\n this.__positionTargetAncestorRootNodes = null;\n }\n\n if (this.__observePositionTargetMove) {\n this.__observePositionTargetMove();\n this.__observePositionTargetMove = null;\n }\n }\n\n /** @private */\n __overlayOpenedChanged(opened, positionTarget) {\n this.__removeUpdatePositionEventListeners();\n\n if (positionTarget) {\n positionTarget.__overlay = null;\n targetResizeObserver.unobserve(positionTarget);\n\n if (opened) {\n this.__addUpdatePositionEventListeners();\n positionTarget.__overlay = this;\n targetResizeObserver.observe(positionTarget);\n }\n }\n\n if (opened) {\n const computedStyle = getComputedStyle(this);\n if (!this.__margins) {\n this.__margins = {};\n ['top', 'bottom', 'left', 'right'].forEach((propName) => {\n this.__margins[propName] = parseInt(computedStyle[propName], 10);\n });\n }\n\n this._updatePosition();\n // Schedule another position update (to cover virtual keyboard opening for example)\n requestAnimationFrame(() => this._updatePosition());\n }\n }\n\n __positionSettingsChanged() {\n this._updatePosition();\n }\n\n /** @private */\n __onScroll(e) {\n // If the scroll event occurred inside the overlay, ignore it.\n if (e.target instanceof Node && this.contains(e.target)) {\n return;\n }\n\n this._updatePosition();\n }\n\n _updatePosition() {\n if (!this.positionTarget || !this.opened || !this.__margins) {\n return;\n }\n\n const targetRect = this.positionTarget.getBoundingClientRect();\n\n if (targetRect.width === 0 && targetRect.height === 0 && this.opened) {\n this.opened = false;\n return;\n }\n\n // Detect the desired alignment and update the layout accordingly\n const shouldAlignStartVertically = this.__shouldAlignStartVertically(targetRect);\n this.style.justifyContent = shouldAlignStartVertically ? 'flex-start' : 'flex-end';\n\n const isRTL = this.__isRTL;\n const shouldAlignStartHorizontally = this.__shouldAlignStartHorizontally(targetRect, isRTL);\n const flexStart = (!isRTL && shouldAlignStartHorizontally) || (isRTL && !shouldAlignStartHorizontally);\n this.style.alignItems = flexStart ? 'flex-start' : 'flex-end';\n\n // Get the overlay rect after possible overlay alignment changes\n const overlayRect = this.getBoundingClientRect();\n\n // Obtain vertical positioning properties\n const verticalProps = this.__calculatePositionInOneDimension(\n targetRect,\n overlayRect,\n this.noVerticalOverlap,\n PROP_NAMES_VERTICAL,\n this,\n shouldAlignStartVertically,\n );\n\n // Obtain horizontal positioning properties\n const horizontalProps = this.__calculatePositionInOneDimension(\n targetRect,\n overlayRect,\n this.noHorizontalOverlap,\n PROP_NAMES_HORIZONTAL,\n this,\n shouldAlignStartHorizontally,\n );\n\n // Apply the positioning properties to the overlay\n Object.assign(this.style, verticalProps, horizontalProps);\n\n this.toggleAttribute('bottom-aligned', !shouldAlignStartVertically);\n this.toggleAttribute('top-aligned', shouldAlignStartVertically);\n\n this.toggleAttribute('end-aligned', !flexStart);\n this.toggleAttribute('start-aligned', flexStart);\n }\n\n __shouldAlignStartHorizontally(targetRect, rtl) {\n // Using previous size to fix a case where window resize may cause the overlay to be squeezed\n // smaller than its current space before the fit-calculations.\n const contentWidth = Math.max(this.__oldContentWidth || 0, this.$.overlay.offsetWidth);\n this.__oldContentWidth = this.$.overlay.offsetWidth;\n\n const viewportWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);\n const defaultAlignLeft = (!rtl && this.horizontalAlign === 'start') || (rtl && this.horizontalAlign === 'end');\n\n return this.__shouldAlignStart(\n targetRect,\n contentWidth,\n viewportWidth,\n this.__margins,\n defaultAlignLeft,\n this.noHorizontalOverlap,\n PROP_NAMES_HORIZONTAL,\n );\n }\n\n __shouldAlignStartVertically(targetRect) {\n // Using previous size to fix a case where window resize may cause the overlay to be squeezed\n // smaller than its current space before the fit-calculations.\n const contentHeight =\n this.requiredVerticalSpace || Math.max(this.__oldContentHeight || 0, this.$.overlay.offsetHeight);\n this.__oldContentHeight = this.$.overlay.offsetHeight;\n\n const viewportHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);\n const defaultAlignTop = this.verticalAlign === 'top';\n\n return this.__shouldAlignStart(\n targetRect,\n contentHeight,\n viewportHeight,\n this.__margins,\n defaultAlignTop,\n this.noVerticalOverlap,\n PROP_NAMES_VERTICAL,\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/max-params\n __shouldAlignStart(targetRect, contentSize, viewportSize, margins, defaultAlignStart, noOverlap, propNames) {\n const spaceForStartAlignment =\n viewportSize - targetRect[noOverlap ? propNames.end : propNames.start] - margins[propNames.end];\n const spaceForEndAlignment = targetRect[noOverlap ? propNames.start : propNames.end] - margins[propNames.start];\n\n const spaceForDefaultAlignment = defaultAlignStart ? spaceForStartAlignment : spaceForEndAlignment;\n const spaceForOtherAlignment = defaultAlignStart ? spaceForEndAlignment : spaceForStartAlignment;\n\n const shouldGoToDefaultSide =\n spaceForDefaultAlignment > spaceForOtherAlignment || spaceForDefaultAlignment > contentSize;\n\n return defaultAlignStart === shouldGoToDefaultSide;\n }\n\n /**\n * Returns an adjusted value after resizing the browser window,\n * to avoid wrong calculations when e.g. previously set `bottom`\n * CSS property value is larger than the updated viewport height.\n * See https://github.com/vaadin/web-components/issues/4604\n */\n __adjustBottomProperty(cssPropNameToSet, propNames, currentValue) {\n let adjustedProp;\n\n if (cssPropNameToSet === propNames.end) {\n // Adjust horizontally\n if (propNames.end === PROP_NAMES_VERTICAL.end) {\n const viewportHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);\n\n if (currentValue > viewportHeight && this.__oldViewportHeight) {\n const heightDiff = this.__oldViewportHeight - viewportHeight;\n adjustedProp = currentValue - heightDiff;\n }\n\n this.__oldViewportHeight = viewportHeight;\n }\n\n // Adjust vertically\n if (propNames.end === PROP_NAMES_HORIZONTAL.end) {\n const viewportWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);\n\n if (currentValue > viewportWidth && this.__oldViewportWidth) {\n const widthDiff = this.__oldViewportWidth - viewportWidth;\n adjustedProp = currentValue - widthDiff;\n }\n\n this.__oldViewportWidth = viewportWidth;\n }\n }\n\n return adjustedProp;\n }\n\n /**\n * Returns an object with CSS position properties to set,\n * e.g. { top: \"100px\" }\n */\n // eslint-disable-next-line @typescript-eslint/max-params\n __calculatePositionInOneDimension(targetRect, overlayRect, noOverlap, propNames, overlay, shouldAlignStart) {\n const cssPropNameToSet = shouldAlignStart ? propNames.start : propNames.end;\n const cssPropNameToClear = shouldAlignStart ? propNames.end : propNames.start;\n\n const currentValue = parseFloat(overlay.style[cssPropNameToSet] || getComputedStyle(overlay)[cssPropNameToSet]);\n const adjustedValue = this.__adjustBottomProperty(cssPropNameToSet, propNames, currentValue);\n\n const diff =\n overlayRect[shouldAlignStart ? propNames.start : propNames.end] -\n targetRect[noOverlap === shouldAlignStart ? propNames.end : propNames.start];\n\n const valueToSet = adjustedValue\n ? `${adjustedValue}px`\n : `${currentValue + diff * (shouldAlignStart ? -1 : 1)}px`;\n\n return {\n [cssPropNameToSet]: valueToSet,\n [cssPropNameToClear]: '',\n };\n }\n };\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Returns an array of ancestor root nodes for the given node.\n *\n * A root node is either a document node or a document fragment node (Shadow Root).\n * The array is collected by a bottom-up DOM traversing that starts with the given node\n * and involves both the light DOM and ancestor shadow DOM trees.\n *\n * @param {Node} node\n * @return {Node[]}\n */\nexport function getAncestorRootNodes(node) {\n const result = [];\n\n while (node) {\n if (node.nodeType === Node.DOCUMENT_NODE) {\n result.push(node);\n break;\n }\n\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n result.push(node);\n node = node.host;\n continue;\n }\n\n if (node.assignedSlot) {\n node = node.assignedSlot;\n continue;\n }\n\n node = node.parentNode;\n }\n\n return result;\n}\n\n/**\n * Returns the list of flattened elements for the given `node`.\n * This list consists of a node's children and, for any children that are\n * `<slot>` elements, the expanded flattened list of `assignedElements`.\n *\n * @param {Node} node\n * @return {Element[]}\n */\nexport function getFlattenedElements(node) {\n const result = [];\n let elements;\n if (node.localName === 'slot') {\n elements = node.assignedElements();\n } else {\n result.push(node);\n elements = [...node.children];\n }\n elements.forEach((elem) => result.push(...getFlattenedElements(elem)));\n return result;\n}\n\n/**\n * Traverses the given node and its parents, including those that are across\n * the shadow root boundaries, until it finds a node that matches the selector.\n *\n * @param {string} selector The CSS selector to match against\n * @param {Node} node The starting node for the traversal\n * @return {Node | null} The closest matching element, or null if no match is found\n */\nexport function getClosestElement(selector, node) {\n if (!node) {\n return null;\n }\n\n return node.closest(selector) || getClosestElement(selector, node.getRootNode().host);\n}\n\n/**\n * Takes a string with values separated by space and returns a set the values\n *\n * @param {string} value\n * @return {Set<string>}\n */\nexport function deserializeAttributeValue(value) {\n if (!value) {\n return new Set();\n }\n\n return new Set(value.split(' '));\n}\n\n/**\n * Takes a set of string values and returns a string with values separated by space\n *\n * @param {Set<string>} values\n * @return {string}\n */\nexport function serializeAttributeValue(values) {\n return values ? [...values].join(' ') : '';\n}\n\n/**\n * Adds a value to an attribute containing space-delimited values.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function addValueToAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.add(value);\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Removes a value from an attribute containing space-delimited values.\n * If the value is the last one, the whole attribute is removed.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function removeValueFromAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.delete(value);\n if (values.size === 0) {\n element.removeAttribute(attr);\n return;\n }\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Returns true if the given node is an empty text node, false otherwise.\n *\n * @param {Node} node\n * @return {boolean}\n */\nexport function isEmptyTextNode(node) {\n return node.nodeType === Node.TEXT_NODE && node.textContent.trim() === '';\n}\n","/**\n * @license\n * Copyright (c) 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Observe moving an element around on a page.\n *\n * Based on the idea from https://samthor.au/2021/observing-dom/ as implemented in Floating UI\n * https://github.com/floating-ui/floating-ui/blob/58ed169/packages/dom/src/autoUpdate.ts#L45\n *\n * @param {HTMLElement} element\n * @param {Function} callback\n * @return {Function}\n */\nexport function observeMove(element, callback) {\n let io = null;\n\n const root = document.documentElement;\n\n function cleanup() {\n io && io.disconnect();\n io = null;\n }\n\n function refresh(skip = false, threshold = 1) {\n cleanup();\n\n const { left, top, width, height } = element.getBoundingClientRect();\n\n if (!skip) {\n callback();\n }\n\n if (!width || !height) {\n return;\n }\n\n const insetTop = Math.floor(top);\n const insetRight = Math.floor(root.clientWidth - (left + width));\n const insetBottom = Math.floor(root.clientHeight - (top + height));\n const insetLeft = Math.floor(left);\n\n const rootMargin = `${-insetTop}px ${-insetRight}px ${-insetBottom}px ${-insetLeft}px`;\n\n const options = {\n rootMargin,\n threshold: Math.max(0, Math.min(1, threshold)) || 1,\n };\n\n let isFirstUpdate = true;\n\n function handleObserve(entries) {\n let ratio = entries[0].intersectionRatio;\n\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n\n // It's possible for the watched element to not be at perfect 1.0 visibility when we create\n // the IntersectionObserver. This has a couple of causes:\n // - elements being on partial pixels\n // - elements being hidden offscreen (e.g., <html> has `overflow: hidden`)\n // - delays: if your DOM change occurs due to e.g., page resize, you can see elements\n // behind their actual position\n //\n // In all of these cases, refresh but with this lower ratio of threshold. When the element\n // moves beneath _that_ new value, the user will get notified.\n if (ratio === 0.0) {\n ratio = 0.0000001; // Just needs to be non-zero\n }\n\n refresh(false, ratio);\n }\n\n isFirstUpdate = false;\n }\n\n io = new IntersectionObserver(handleObserve, options);\n\n io.observe(element);\n }\n\n refresh(true);\n\n return cleanup;\n}\n","/**\n * @license\n * Copyright (c) 2022 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';\nimport { PositionMixin } from '@vaadin/overlay/src/vaadin-overlay-position-mixin.js';\n\n/**\n * A mixin providing common popover overlay functionality.\n *\n * @polymerMixin\n * @mixes PositionMixin\n * @mixes OverlayMixin\n */\nexport const PopoverOverlayMixin = (superClass) =>\n class PopoverOverlayMixinClass extends PositionMixin(OverlayMixin(superClass)) {\n static get properties() {\n return {\n position: {\n type: String,\n reflectToAttribute: true,\n },\n };\n }\n\n /**\n * Tag name prefix used by custom properties.\n * @protected\n * @return {string}\n */\n get _tagNamePrefix() {\n return 'vaadin-popover';\n }\n\n requestContentUpdate() {\n super.requestContentUpdate();\n\n // Copy custom properties from the owner\n if (this.positionTarget && this.owner) {\n const style = getComputedStyle(this.owner);\n ['top', 'bottom', 'start', 'end'].forEach((prop) => {\n this.style.setProperty(\n `--${this._tagNamePrefix}-offset-${prop}`,\n style.getPropertyValue(`--${this._tagNamePrefix}-offset-${prop}`),\n );\n });\n }\n }\n\n /**\n * @protected\n * @override\n */\n _updatePosition() {\n super._updatePosition();\n\n if (!this.positionTarget || !this.opened) {\n return;\n }\n\n this.removeAttribute('arrow-centered');\n\n // Center the overlay horizontally\n if (this.position === 'bottom' || this.position === 'top') {\n const targetRect = this.positionTarget.getBoundingClientRect();\n const overlayRect = this.$.overlay.getBoundingClientRect();\n\n const offset = targetRect.width / 2 - overlayRect.width / 2;\n\n if (this.style.left) {\n const left = overlayRect.left + offset;\n if (left > 0) {\n this.style.left = `${left}px`;\n // Center the pointer arrow horizontally\n this.setAttribute('arrow-centered', '');\n }\n }\n\n if (this.style.right) {\n const right = parseFloat(this.style.right) + offset;\n if (right > 0) {\n this.style.right = `${right}px`;\n // Center the pointer arrow horizontally\n this.setAttribute('arrow-centered', '');\n }\n }\n }\n\n // Center the overlay vertically\n if (this.position === 'start' || this.position === 'end') {\n const targetRect = this.positionTarget.getBoundingClientRect();\n const overlayRect = this.$.overlay.getBoundingClientRect();\n\n const offset = targetRect.height / 2 - overlayRect.height / 2;\n this.style.top = `${overlayRect.top + offset}px`;\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { css, html, LitElement } from 'lit';\nimport { isElementFocused } from '@vaadin/a11y-base/src/focus-utils.js';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';\nimport { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';\nimport { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';\nimport { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { PopoverOverlayMixin } from './vaadin-popover-overlay-mixin.js';\n\n/**\n * An element used internally by `<vaadin-popover>`. Not intended to be used separately.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes DirMixin\n * @mixes PopoverOverlayMixin\n * @mixes ThemableMixin\n * @private\n */\nclass PopoverOverlay extends PopoverOverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {\n static get is() {\n return 'vaadin-popover-overlay';\n }\n\n static get styles() {\n return [\n overlayStyles,\n css`\n :host {\n --_vaadin-popover-content-width: auto;\n --_vaadin-popover-content-height: auto;\n }\n\n :host([modeless][with-backdrop]) [part='backdrop'] {\n pointer-events: none;\n }\n\n :host([position^='top'][top-aligned]) [part='overlay'],\n :host([position^='bottom'][top-aligned]) [part='overlay'] {\n margin-top: var(--vaadin-popover-offset-top, 0);\n }\n\n [part='overlay'] {\n position: relative;\n overflow: visible;\n max-height: 100%;\n }\n\n [part='content'] {\n overflow: auto;\n box-sizing: border-box;\n max-height: 100%;\n width: var(--_vaadin-popover-content-width);\n height: var(--_vaadin-popover-content-height);\n }\n\n /* Increase the area of the popover so the pointer can go from the target directly to it. */\n [part='overlay']::before {\n position: absolute;\n content: '';\n inset-block: calc(var(--vaadin-popover-offset-top, 0) * -1) calc(var(--vaadin-popover-offset-bottom, 0) * -1);\n inset-inline: calc(var(--vaadin-popover-offset-start, 0) * -1) calc(var(--vaadin-popover-offset-end, 0) * -1);\n z-index: -1;\n pointer-events: auto;\n }\n\n :host([position^='top'][bottom-aligned]) [part='overlay'],\n :host([position^='bottom'][bottom-aligned]) [part='overlay'] {\n margin-bottom: var(--vaadin-popover-offset-bottom, 0);\n }\n\n :host([position^='start'][start-aligned]) [part='overlay'],\n :host([position^='end'][start-aligned]) [part='overlay'] {\n margin-inline-start: var(--vaadin-popover-offset-start, 0);\n }\n\n :host([position^='start'][end-aligned]) [part='overlay'],\n :host([position^='end'][end-aligned]) [part='overlay'] {\n margin-inline-end: var(--vaadin-popover-offset-end, 0);\n }\n\n [part='arrow'] {\n display: none;\n position: absolute;\n height: 0;\n width: 0;\n }\n\n :host([theme~='arrow']) [part='arrow'] {\n display: block;\n }\n `,\n ];\n }\n\n /** @protected */\n render() {\n return html`\n <div id=\"backdrop\" part=\"backdrop\" hidden ?hidden=\"${!this.withBackdrop}\"></div>\n <div part=\"overlay\" id=\"overlay\" tabindex=\"0\">\n <div part=\"arrow\"></div>\n <div part=\"content\" id=\"content\"><slot></slot></div>\n </div>\n `;\n }\n\n /**\n * Override method inherited from `OverlayMixin` to not close\n * modal popover on outside click when opening on focus.\n *\n * @param {Event} event\n * @return {boolean}\n * @protected\n */\n _shouldCloseOnOutsideClick(event) {\n // When opening a modal popover on mouse focusin, the focus moves to the overlay\n // and then outside click listener is fired. Detect this case and prevent closing.\n if (this.owner.__hasTrigger('focus') && isElementFocused(this)) {\n return false;\n }\n\n return super._shouldCloseOnOutsideClick(event);\n }\n}\n\ndefineCustomElement(PopoverOverlay);\n","import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * @fileoverview\n *\n * This module provides a number of strategies for enqueuing asynchronous\n * tasks. Each sub-module provides a standard `run(fn)` interface that returns a\n * handle, and a `cancel(handle)` interface for canceling async tasks before\n * they run.\n *\n * @summary Module that provides a number of strategies for enqueuing\n * asynchronous tasks.\n */\n\nlet microtaskCurrHandle = 0;\nlet microtaskLastHandle = 0;\nconst microtaskCallbacks = [];\nlet microtaskScheduled = false;\n\nfunction microtaskFlush() {\n microtaskScheduled = false;\n const len = microtaskCallbacks.length;\n for (let i = 0; i < len; i++) {\n const cb = microtaskCallbacks[i];\n if (cb) {\n try {\n cb();\n } catch (e) {\n setTimeout(() => {\n throw e;\n });\n }\n }\n }\n microtaskCallbacks.splice(0, len);\n microtaskLastHandle += len;\n}\n\n/**\n * Async interface wrapper around `setTimeout`.\n *\n * @namespace\n * @summary Async interface wrapper around `setTimeout`.\n */\nconst timeOut = {\n /**\n * Returns a sub-module with the async interface providing the provided\n * delay.\n *\n * @memberof timeOut\n * @param {number=} delay Time to wait before calling callbacks in ms\n * @return {!AsyncInterface} An async timeout interface\n */\n after(delay) {\n return {\n run(fn) {\n return window.setTimeout(fn, delay);\n },\n cancel(handle) {\n window.clearTimeout(handle);\n },\n };\n },\n /**\n * Enqueues a function called in the next task.\n *\n * @memberof timeOut\n * @param {!Function} fn Callback to run\n * @param {number=} delay Delay in milliseconds\n * @return {number} Handle used for canceling task\n */\n run(fn, delay) {\n return window.setTimeout(fn, delay);\n },\n /**\n * Cancels a previously enqueued `timeOut` callback.\n *\n * @memberof timeOut\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n window.clearTimeout(handle);\n },\n};\nexport { timeOut };\n\n/**\n * Async interface wrapper around `requestAnimationFrame`.\n *\n * @namespace\n * @summary Async interface wrapper around `requestAnimationFrame`.\n */\nconst animationFrame = {\n /**\n * Enqueues a function called at `requestAnimationFrame` timing.\n *\n * @memberof animationFrame\n * @param {function(number):void} fn Callback to run\n * @return {number} Handle used for canceling task\n */\n run(fn) {\n return window.requestAnimationFrame(fn);\n },\n /**\n * Cancels a previously enqueued `animationFrame` callback.\n *\n * @memberof animationFrame\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n window.cancelAnimationFrame(handle);\n },\n};\nexport { animationFrame };\n\n/**\n * Async interface wrapper around `requestIdleCallback`. Falls back to\n * `setTimeout` on browsers that do not support `requestIdleCallback`.\n *\n * @namespace\n * @summary Async interface wrapper around `requestIdleCallback`.\n */\nconst idlePeriod = {\n /**\n * Enqueues a function called at `requestIdleCallback` timing.\n *\n * @memberof idlePeriod\n * @param {function(!IdleDeadline):void} fn Callback to run\n * @return {number} Handle used for canceling task\n */\n run(fn) {\n return window.requestIdleCallback ? window.requestIdleCallback(fn) : window.setTimeout(fn, 16);\n },\n /**\n * Cancels a previously enqueued `idlePeriod` callback.\n *\n * @memberof idlePeriod\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n if (window.cancelIdleCallback) {\n window.cancelIdleCallback(handle);\n } else {\n window.clearTimeout(handle);\n }\n },\n};\nexport { idlePeriod };\n\n/**\n * Async interface for enqueuing callbacks that run at microtask timing.\n *\n * @namespace\n * @summary Async interface for enqueuing callbacks that run at microtask\n * timing.\n */\nconst microTask = {\n /**\n * Enqueues a function called at microtask timing.\n *\n * @memberof microTask\n * @param {!Function=} callback Callback to run\n * @return {number} Handle used for canceling task\n */\n run(callback) {\n if (!microtaskScheduled) {\n microtaskScheduled = true;\n queueMicrotask(() => microtaskFlush());\n }\n microtaskCallbacks.push(callback);\n const result = microtaskCurrHandle;\n microtaskCurrHandle += 1;\n return result;\n },\n\n /**\n * Cancels a previously enqueued `microTask` callback.\n *\n * @memberof microTask\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n const idx = handle - microtaskLastHandle;\n if (idx >= 0) {\n if (!microtaskCallbacks[idx]) {\n throw new Error(`invalid async handle: ${handle}`);\n }\n microtaskCallbacks[idx] = null;\n }\n },\n};\nexport { microTask };\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nconst debouncerQueue = new Set();\n\n/**\n * @summary Collapse multiple callbacks into one invocation after a timer.\n */\nexport class Debouncer {\n /**\n * Creates a debouncer if no debouncer is passed as a parameter\n * or it cancels an active debouncer otherwise. The following\n * example shows how a debouncer can be called multiple times within a\n * microtask and \"debounced\" such that the provided callback function is\n * called once. Add this method to a custom element:\n *\n * ```js\n * import {microTask} from '@vaadin/component-base/src/async.js';\n * import {Debouncer} from '@vaadin/component-base/src/debounce.js';\n * // ...\n *\n * _debounceWork() {\n * this._debounceJob = Debouncer.debounce(this._debounceJob,\n * microTask, () => this._doWork());\n * }\n * ```\n *\n * If the `_debounceWork` method is called multiple times within the same\n * microtask, the `_doWork` function will be called only once at the next\n * microtask checkpoint.\n *\n * Note: In testing it is often convenient to avoid asynchrony. To accomplish\n * this with a debouncer, you can use `enqueueDebouncer` and\n * `flush`. For example, extend the above example by adding\n * `enqueueDebouncer(this._debounceJob)` at the end of the\n * `_debounceWork` method. Then in a test, call `flush` to ensure\n * the debouncer has completed.\n *\n * @param {Debouncer?} debouncer Debouncer object.\n * @param {!AsyncInterface} asyncModule Object with Async interface\n * @param {function()} callback Callback to run.\n * @return {!Debouncer} Returns a debouncer object.\n */\n static debounce(debouncer, asyncModule, callback) {\n if (debouncer instanceof Debouncer) {\n // Cancel the async callback, but leave in debouncerQueue if it was\n // enqueued, to maintain 1.x flush order\n debouncer._cancelAsync();\n } else {\n debouncer = new Debouncer();\n }\n debouncer.setConfig(asyncModule, callback);\n return debouncer;\n }\n\n constructor() {\n this._asyncModule = null;\n this._callback = null;\n this._timer = null;\n }\n\n /**\n * Sets the scheduler; that is, a module with the Async interface,\n * a callback and optional arguments to be passed to the run function\n * from the async module.\n *\n * @param {!AsyncInterface} asyncModule Object with Async interface.\n * @param {function()} callback Callback to run.\n * @return {void}\n */\n setConfig(asyncModule, callback) {\n this._asyncModule = asyncModule;\n this._callback = callback;\n this._timer = this._asyncModule.run(() => {\n this._timer = null;\n debouncerQueue.delete(this);\n this._callback();\n });\n }\n\n /**\n * Cancels an active debouncer and returns a reference to itself.\n *\n * @return {void}\n */\n cancel() {\n if (this.isActive()) {\n this._cancelAsync();\n // Canceling a debouncer removes its spot from the flush queue,\n // so if a debouncer is manually canceled and re-debounced, it\n // will reset its flush order (this is a very minor difference from 1.x)\n // Re-debouncing via the `debounce` API retains the 1.x FIFO flush order\n debouncerQueue.delete(this);\n }\n }\n\n /**\n * Cancels a debouncer's async callback.\n *\n * @return {void}\n */\n _cancelAsync() {\n if (this.isActive()) {\n this._asyncModule.cancel(/** @type {number} */ (this._timer));\n this._timer = null;\n }\n }\n\n /**\n * Flushes an active debouncer and returns a reference to itself.\n *\n * @return {void}\n */\n flush() {\n if (this.isActive()) {\n this.cancel();\n this._callback();\n }\n }\n\n /**\n * Returns true if the debouncer is active.\n *\n * @return {boolean} True if active.\n */\n isActive() {\n return this._timer != null;\n }\n}\n\n/**\n * Adds a `Debouncer` to a list of globally flushable tasks.\n *\n * @param {!Debouncer} debouncer Debouncer to enqueue\n * @return {void}\n */\nexport function enqueueDebouncer(debouncer) {\n debouncerQueue.add(debouncer);\n}\n\n/**\n * Flushes any enqueued debouncers\n *\n * @return {boolean} Returns whether any debouncers were flushed\n */\nexport function flushDebouncers() {\n const didFlush = Boolean(debouncerQueue.size);\n // If new debouncers are added while flushing, Set.forEach will ensure\n // newly added ones are also flushed\n debouncerQueue.forEach((debouncer) => {\n try {\n debouncer.flush();\n } catch (e) {\n setTimeout(() => {\n throw e;\n });\n }\n });\n return didFlush;\n}\n\nexport const flush = () => {\n let debouncers;\n do {\n debouncers = flushDebouncers();\n } while (debouncers);\n};\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { setCancelSyntheticClickEvents } from '@polymer/polymer/lib/utils/settings.js';\nimport { usageStatistics } from '@vaadin/vaadin-usage-statistics/vaadin-usage-statistics.js';\nimport { idlePeriod } from './async.js';\nimport { Debouncer, enqueueDebouncer } from './debounce.js';\nimport { DirMixin } from './dir-mixin.js';\n\n// This setting affects the legacy Polymer gestures which get activated\n// once you import any iron component e.g iron-icon.\n// It has to be explicitly disabled to prevent click issues in iOS + VoiceOver\n// for buttons that are based on `[role=button]` e.g vaadin-button.\nsetCancelSyntheticClickEvents(false);\n\nif (!window.Vaadin) {\n window.Vaadin = {};\n}\n\n/**\n * Array of Vaadin custom element classes that have been finalized.\n */\nif (!window.Vaadin.registrations) {\n window.Vaadin.registrations = [];\n}\n\nif (!window.Vaadin.developmentModeCallback) {\n window.Vaadin.developmentModeCallback = {};\n}\n\nwindow.Vaadin.developmentModeCallback['vaadin-usage-statistics'] = function () {\n usageStatistics();\n};\n\nlet statsJob;\n\nconst registered = new Set();\n\n/**\n * @polymerMixin\n * @mixes DirMixin\n */\nexport const ElementMixin = (superClass) =>\n class VaadinElementMixin extends DirMixin(superClass) {\n /** @protected */\n static finalize() {\n super.finalize();\n\n const { is } = this;\n\n // Registers a class prototype for telemetry purposes.\n if (is && !registered.has(is)) {\n window.Vaadin.registrations.push(this);\n registered.add(is);\n\n if (window.Vaadin.developmentModeCallback) {\n statsJob = Debouncer.debounce(statsJob, idlePeriod, () => {\n window.Vaadin.developmentModeCallback['vaadin-usage-statistics']();\n });\n enqueueDebouncer(statsJob);\n }\n }\n }\n\n constructor() {\n super();\n\n if (document.doctype === null) {\n console.warn(\n 'Vaadin components require the \"standards mode\" declaration. Please add <!DOCTYPE html> to the HTML document.',\n );\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2023 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * A mixin that forwards CSS class names to the internal overlay element\n * by setting the `overlayClass` property or `overlay-class` attribute.\n *\n * @polymerMixin\n */\nexport const OverlayClassMixin = (superclass) =>\n class OverlayClassMixinClass extends superclass {\n static get properties() {\n return {\n /**\n * A space-delimited list of CSS class names to set on the overlay element.\n * This property does not affect other CSS class names set manually via JS.\n *\n * Note, if the CSS class name was set with this property, clearing it will\n * remove it from the overlay, even if the same class name was also added\n * manually, e.g. by using `classList.add()` in the `renderer` function.\n *\n * @attr {string} overlay-class\n */\n overlayClass: {\n type: String,\n },\n\n /**\n * An overlay element on which CSS class names are set.\n *\n * @protected\n */\n _overlayElement: {\n type: Object,\n },\n };\n }\n\n static get observers() {\n return ['__updateOverlayClassNames(overlayClass, _overlayElement)'];\n }\n\n /** @private */\n __updateOverlayClassNames(overlayClass, overlayElement) {\n if (!overlayElement) {\n return;\n }\n\n // Overlay is set but overlayClass is not set\n if (overlayClass === undefined) {\n return;\n }\n\n const { classList } = overlayElement;\n\n if (!this.__initialClasses) {\n this.__initialClasses = new Set(classList);\n }\n\n if (Array.isArray(this.__previousClasses)) {\n // Remove old classes that no longer apply\n const classesToRemove = this.__previousClasses.filter((name) => !this.__initialClasses.has(name));\n if (classesToRemove.length > 0) {\n classList.remove(...classesToRemove);\n }\n }\n\n // Add new classes based on the overlayClass\n const classesToAdd = typeof overlayClass === 'string' ? overlayClass.split(' ').filter(Boolean) : [];\n if (classesToAdd.length > 0) {\n classList.add(...classesToAdd);\n }\n\n this.__previousClasses = classesToAdd;\n }\n };\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\nlet uniqueId = 0;\n\n/**\n * Resets the unique id counter.\n *\n * @return {void}\n */\nexport function resetUniqueId() {\n uniqueId = 0;\n}\n\n/**\n * Returns a unique integer id.\n *\n * @return {number}\n */\nexport function generateUniqueId() {\n // eslint-disable-next-line no-plusplus\n return uniqueId++;\n}\n","/**\n * @license\n * Copyright (c) 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * A mixin providing popover position functionality.\n *\n * @polymerMixin\n */\nexport const PopoverPositionMixin = (superClass) =>\n class PopoverPositionMixinClass extends superClass {\n static get properties() {\n return {\n /**\n * Position of the overlay with respect to the target.\n * Supported values: `top-start`, `top`, `top-end`,\n * `bottom-start`, `bottom`, `bottom-end`, `start-top`,\n * `start`, `start-bottom`, `end-top`, `end`, `end-bottom`.\n */\n position: {\n type: String,\n },\n\n /**\n * Default value used when `position` property is not set.\n * @protected\n */\n _position: {\n type: String,\n value: 'bottom',\n },\n\n /** @private */\n __effectivePosition: {\n type: String,\n computed: '__computePosition(position, _position)',\n },\n };\n }\n\n /** @protected */\n __computeHorizontalAlign(position) {\n return ['top-end', 'bottom-end', 'start-top', 'start', 'start-bottom'].includes(position) ? 'end' : 'start';\n }\n\n /** @protected */\n __computeNoHorizontalOverlap(position) {\n return ['start-top', 'start', 'start-bottom', 'end-top', 'end', 'end-bottom'].includes(position);\n }\n\n /** @protected */\n __computeNoVerticalOverlap(position) {\n return ['top-start', 'top-end', 'top', 'bottom-start', 'bottom', 'bottom-end'].includes(position);\n }\n\n /** @protected */\n __computeVerticalAlign(position) {\n return ['top-start', 'top-end', 'top', 'start-bottom', 'end-bottom'].includes(position) ? 'bottom' : 'top';\n }\n\n /** @private */\n __computePosition(position, defaultPosition) {\n return position || defaultPosition;\n }\n };\n","/**\n * @license\n * Copyright (c) 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { microTask } from '@vaadin/component-base/src/async.js';\nimport { Debouncer } from '@vaadin/component-base/src/debounce.js';\n\n/**\n * A mixin providing popover target functionality.\n *\n * @polymerMixin\n */\nexport const PopoverTargetMixin = (superClass) =>\n class PopoverTargetMixinClass extends superClass {\n static get properties() {\n return {\n /**\n * The id of the element to be used as `target` value.\n * The element should be in the DOM by the time when\n * the attribute is set, otherwise a warning is shown.\n */\n for: {\n type: String,\n observer: '__forChanged',\n },\n\n /**\n * Reference to the DOM element used both to trigger the overlay\n * by user interaction and to visually position it on the screen.\n *\n * Defaults to an element referenced with `for` attribute, in\n * which case it must be located in the same shadow scope.\n */\n target: {\n type: Object,\n observer: '__targetChanged',\n },\n };\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n\n if (this.target) {\n this._addTargetListeners(this.target);\n }\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n\n if (this.target) {\n this._removeTargetListeners(this.target);\n }\n }\n\n /** @private */\n __forChanged(forId) {\n if (forId) {\n this.__setTargetByIdDebouncer = Debouncer.debounce(this.__setTargetByIdDebouncer, microTask, () =>\n this.__setTargetById(forId),\n );\n }\n }\n\n /** @private */\n __setTargetById(targetId) {\n if (!this.isConnected) {\n return;\n }\n\n const target = this.getRootNode().getElementById(targetId);\n\n if (target) {\n this.target = target;\n } else {\n console.warn(`No element with id=\"${targetId}\" set via \"for\" property found on the page.`);\n }\n }\n\n /** @private */\n __targetChanged(target, oldTarget) {\n if (oldTarget) {\n this._removeTargetListeners(oldTarget);\n }\n\n if (target) {\n this._addTargetListeners(target);\n }\n }\n\n /**\n * @param {HTMLElement} _target\n * @protected\n */\n _addTargetListeners(_target) {\n // To be implemented.\n }\n\n /**\n * @param {HTMLElement} _target\n * @protected\n */\n _removeTargetListeners(_target) {\n // To be implemented.\n }\n };\n","/**\n * @license\n * Copyright (c) 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport './vaadin-popover-overlay.js';\nimport { css, html, LitElement } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport {\n getDeepActiveElement,\n getFocusableElements,\n isElementFocused,\n isKeyboardActive,\n} from '@vaadin/a11y-base/src/focus-utils.js';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';\nimport { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';\nimport { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';\nimport { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';\nimport { isLastOverlay } from '@vaadin/overlay/src/vaadin-overlay-stack-mixin.js';\nimport { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';\nimport { PopoverPositionMixin } from './vaadin-popover-position-mixin.js';\nimport { PopoverTargetMixin } from './vaadin-popover-target-mixin.js';\n\nconst DEFAULT_DELAY = 500;\n\nlet defaultFocusDelay = DEFAULT_DELAY;\nlet defaultHoverDelay = DEFAULT_DELAY;\nlet defaultHideDelay = DEFAULT_DELAY;\n\n/**\n * Controller for handling popover opened state.\n */\nclass PopoverOpenedStateController {\n constructor(host) {\n this.host = host;\n }\n\n /**\n * Whether closing is currently in progress.\n * @return {boolean}\n */\n get isClosing() {\n return this.__closeTimeout != null;\n }\n\n /** @private */\n get __focusDelay() {\n const popover = this.host;\n return popover.focusDelay != null && popover.focusDelay >= 0 ? popover.focusDelay : defaultFocusDelay;\n }\n\n /** @private */\n get __hoverDelay() {\n const popover = this.host;\n return popover.hoverDelay != null && popover.hoverDelay >= 0 ? popover.hoverDelay : defaultHoverDelay;\n }\n\n /** @private */\n get __hideDelay() {\n const popover = this.host;\n return popover.hideDelay != null && popover.hideDelay >= 0 ? popover.hideDelay : defaultHideDelay;\n }\n\n /**\n * Schedule opening the popover.\n * @param {Object} options\n */\n open(options = { immediate: false }) {\n const { immediate, trigger } = options;\n const shouldDelayHover = trigger === 'hover' && this.__hoverDelay > 0;\n const shouldDelayFocus = trigger === 'focus' && this.__focusDelay > 0;\n\n if (!immediate && (shouldDelayHover || shouldDelayFocus) && !this.__closeTimeout) {\n this.__scheduleOpen(trigger);\n } else {\n this.__showPopover();\n }\n }\n\n /**\n * Schedule closing the popover.\n * @param {boolean} immediate\n */\n close(immediate) {\n if (!immediate && this.__hideDelay > 0) {\n this.__scheduleClose();\n } else {\n this.__abortClose();\n this.__setOpened(false);\n }\n\n this.__abortOpen();\n }\n\n /** @private */\n __setOpened(opened) {\n this.host.opened = opened;\n }\n\n /** @private */\n __showPopover() {\n this.__abortClose();\n this.__setOpened(true);\n }\n\n /** @private */\n __abortClose() {\n if (this.__closeTimeout) {\n clearTimeout(this.__closeTimeout);\n this.__closeTimeout = null;\n }\n }\n\n /** @private */\n __abortOpen() {\n if (this.__openTimeout) {\n clearTimeout(this.__openTimeout);\n this.__openTimeout = null;\n }\n }\n\n /** @private */\n __scheduleClose() {\n this.__closeTimeout = setTimeout(() => {\n this.__closeTimeout = null;\n this.__setOpened(false);\n }, this.__hideDelay);\n }\n\n /** @private */\n __scheduleOpen(trigger) {\n this.__abortOpen();\n\n const delay = trigger === 'focus' ? this.__focusDelay : this.__hoverDelay;\n this.__openTimeout = setTimeout(() => {\n this.__openTimeout = null;\n this.__showPopover();\n }, delay);\n }\n}\n\n/**\n * `<vaadin-popover>` is a Web Component for creating overlays\n * that are positioned next to specified DOM element (target).\n *\n * Unlike `<vaadin-tooltip>`, the popover supports rich content\n * that can be provided by using `renderer` function.\n *\n * ### Styling\n *\n * `<vaadin-popover>` uses `<vaadin-popover-overlay>` internal\n * themable component as the actual visible overlay.\n *\n * See [`<vaadin-overlay>`](#/elements/vaadin-overlay) documentation\n * for `<vaadin-popover-overlay>` parts.\n *\n * In addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n *\n * Part name | Description\n * -----------------|-------------------------------------------\n * `arrow` | Optional arrow pointing to the target when using `theme=\"arrow\"`\n *\n * The following state attributes are available for styling:\n *\n * Attribute | Description\n * -----------------|----------------------------------------\n * `position` | Reflects the `position` property value.\n *\n * Note: the `theme` attribute value set on `<vaadin-popover>` is\n * propagated to the internal `<vaadin-popover-overlay>` component.\n *\n * ### Custom CSS Properties\n *\n * The following custom CSS properties are available on the `<vaadin-popover>` element:\n *\n * Custom CSS property | Description\n * ---------------------------------|-------------\n * `--vaadin-popover-offset-top` | Used as an offset when the popover is aligned vertically below the target\n * `--vaadin-popover-offset-bottom` | Used as an offset when the popover is aligned vertically above the target\n * `--vaadin-popover-offset-start` | Used as an offset when the popover is aligned horizontally after the target\n * `--vaadin-popover-offset-end` | Used as an offset when the popover is aligned horizontally before the target\n *\n * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n *\n * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.\n * @fires {CustomEvent} closed - Fired when the popover is closed.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ElementMixin\n * @mixes OverlayClassMixin\n * @mixes PopoverPositionMixin\n * @mixes PopoverTargetMixin\n * @mixes ThemePropertyMixin\n */\nclass Popover extends PopoverPositionMixin(\n PopoverTargetMixin(OverlayClassMixin(ThemePropertyMixin(ElementMixin(PolylitMixin(LitElement))))),\n) {\n static get is() {\n return 'vaadin-popover';\n }\n\n static get styles() {\n return css`\n :host {\n display: none !important;\n }\n `;\n }\n\n static get properties() {\n return {\n /**\n * String used to label the overlay to screen reader users.\n *\n * @attr {string} accessible-name\n */\n accessibleName: {\n type: String,\n },\n\n /**\n * Id of the element used as label of the overlay to screen reader users.\n *\n * @attr {string} accessible-name-ref\n */\n accessibleNameRef: {\n type: String,\n },\n\n /**\n * When true, the popover content automatically receives focus after\n * it is opened. Modal popovers use this behavior by default.\n */\n autofocus: {\n type: Boolean,\n },\n\n /**\n * Height to be set on the overlay content.\n *\n * @attr {string} content-height\n */\n contentHeight: {\n type: String,\n },\n\n /**\n * Width to be set on the overlay content.\n *\n * @attr {string} content-width\n */\n contentWidth: {\n type: String,\n },\n\n /**\n * The delay in milliseconds before the popover is opened\n * on focus when the corresponding trigger is used.\n *\n * When not specified, the global default (500ms) is used.\n *\n * @attr {number} focus-delay\n */\n focusDelay: {\n type: Number,\n },\n\n /**\n * The delay in milliseconds before the popover is closed\n * on losing hover, when the corresponding trigger is used.\n * On blur, the popover is closed immediately.\n *\n * When not specified, the global default (500ms) is used.\n *\n * @attr {number} hide-delay\n */\n hideDelay: {\n type: Number,\n },\n\n /**\n * The delay in milliseconds before the popover is opened\n * on hover when the corresponding trigger is used.\n *\n * When not specified, the global default (500ms) is used.\n *\n * @attr {number} hover-delay\n */\n hoverDelay: {\n type: Number,\n },\n\n /**\n * True if the popover overlay is opened, false otherwise.\n */\n opened: {\n type: Boolean,\n value: false,\n notify: true,\n observer: '__openedChanged',\n },\n\n /**\n * The `role` attribute value to be set on the overlay.\n *\n * @attr {string} overlay-role\n */\n overlayRole: {\n type: String,\n value: 'dialog',\n },\n\n /**\n * Custom function for rendering the content of the overlay.\n * Receives two arguments:\n *\n * - `root` The root container DOM element. Append your content to it.\n * - `popover` The reference to the `vaadin-popover` element (overlay host).\n */\n renderer: {\n type: Object,\n },\n\n /**\n * When true, the popover prevents interacting with background elements\n * by setting `pointer-events` style on the document body to `none`.\n * This also enables trapping focus inside the overlay.\n */\n modal: {\n type: Boolean,\n value: false,\n },\n\n /**\n * Set to true to disable closing popover overlay on outside click.\n *\n * @attr {boolean} no-close-on-outside-click\n */\n noCloseOnOutsideClick: {\n type: Boolean,\n value: false,\n },\n\n /**\n * Set to true to disable closing popover overlay on Escape press.\n * When the popover is modal, pressing Escape anywhere in the\n * document closes the overlay. Otherwise, only Escape press\n * from the popover itself or its target closes the overlay.\n *\n * @attr {boolean} no-close-on-esc\n */\n noCloseOnEsc: {\n type: Boolean,\n value: false,\n },\n\n /**\n * Popover trigger mode, used to configure how the overlay is opened or closed.\n * Could be set to multiple by providing an array, e.g. `trigger = ['hover', 'focus']`.\n *\n * Supported values:\n * - `click` (default) - opens and closes on target click.\n * - `hover` - opens on target mouseenter, closes on target mouseleave. Moving mouse\n * to the popover overlay content keeps the overlay opened.\n * - `focus` - opens on target focus, closes on target blur. Moving focus to the\n * popover overlay content keeps the overlay opened.\n *\n * In addition to the behavior specified by `trigger`, the popover can be closed by:\n * - pressing Escape key (unless `noCloseOnEsc` property is true)\n * - outside click (unless `noCloseOnOutsideClick` property is true)\n *\n * When setting `trigger` property to `null`, `undefined` or empty array, the popover\n * can be only opened or closed programmatically by changing `opened` property.\n */\n trigger: {\n type: Array,\n value: () => ['click'],\n },\n\n /**\n * When true, the overlay has a backdrop (modality curtain) on top of the\n * underlying page content, covering the whole viewport.\n *\n * @attr {boolean} with-backdrop\n */\n withBackdrop: {\n type: Boolean,\n value: false,\n },\n\n /** @private */\n __shouldRestoreFocus: {\n type: Boolean,\n value: false,\n sync: true,\n },\n\n /** @private */\n __overlayId: {\n type: String,\n },\n };\n }\n\n static get observers() {\n return [\n '__updateContentHeight(contentHeight, _overlayElement)',\n '__updateContentWidth(contentWidth, _overlayElement)',\n '__openedOrTargetChanged(opened, target)',\n '__overlayRoleOrTargetChanged(overlayRole, target)',\n ];\n }\n\n /**\n * Sets the default focus delay to be used by all popover instances,\n * except for those that have focus delay configured using property.\n *\n * @param {number} focusDelay\n */\n static setDefaultFocusDelay(focusDelay) {\n defaultFocusDelay = focusDelay != null && focusDelay >= 0 ? focusDelay : DEFAULT_DELAY;\n }\n\n /**\n * Sets the default hide delay to be used by all popover instances,\n * except for those that have hide delay configured using property.\n *\n * @param {number} hideDelay\n */\n static setDefaultHideDelay(hideDelay) {\n defaultHideDelay = hideDelay != null && hideDelay >= 0 ? hideDelay : DEFAULT_DELAY;\n }\n\n /**\n * Sets the default hover delay to be used by all popover instances,\n * except for those that have hover delay configured using property.\n *\n * @param {number} hoverDelay\n */\n static setDefaultHoverDelay(hoverDelay) {\n defaultHoverDelay = hoverDelay != null && hoverDelay >= 0 ? hoverDelay : DEFAULT_DELAY;\n }\n\n constructor() {\n super();\n\n this.__overlayId = `vaadin-popover-${generateUniqueId()}`;\n\n this.__onGlobalClick = this.__onGlobalClick.bind(this);\n this.__onGlobalKeyDown = this.__onGlobalKeyDown.bind(this);\n this.__onTargetClick = this.__onTargetClick.bind(this);\n this.__onTargetFocusIn = this.__onTargetFocusIn.bind(this);\n this.__onTargetFocusOut = this.__onTargetFocusOut.bind(this);\n this.__onTargetMouseEnter = this.__onTargetMouseEnter.bind(this);\n this.__onTargetMouseLeave = this.__onTargetMouseLeave.bind(this);\n\n this._openedStateController = new PopoverOpenedStateController(this);\n }\n\n /** @protected */\n render() {\n const effectivePosition = this.__effectivePosition;\n\n return html`\n <vaadin-popover-overlay\n id=\"${this.__overlayId}\"\n role=\"${this.overlayRole}\"\n aria-label=\"${ifDefined(this.accessibleName)}\"\n aria-labelledby=\"${ifDefined(this.accessibleNameRef)}\"\n .renderer=\"${this.renderer}\"\n .owner=\"${this}\"\n theme=\"${ifDefined(this._theme)}\"\n .positionTarget=\"${this.target}\"\n .position=\"${effectivePosition}\"\n .opened=\"${this.opened}\"\n .modeless=\"${!this.modal}\"\n .focusTrap=\"${this.modal}\"\n .withBackdrop=\"${this.withBackdrop}\"\n ?no-horizontal-overlap=\"${this.__computeNoHorizontalOverlap(effectivePosition)}\"\n ?no-vertical-overlap=\"${this.__computeNoVerticalOverlap(effectivePosition)}\"\n .horizontalAlign=\"${this.__computeHorizontalAlign(effectivePosition)}\"\n .verticalAlign=\"${this.__computeVerticalAlign(effectivePosition)}\"\n @mousedown=\"${this.__onOverlayMouseDown}\"\n @mouseenter=\"${this.__onOverlayMouseEnter}\"\n @mouseleave=\"${this.__onOverlayMouseLeave}\"\n @focusin=\"${this.__onOverlayFocusIn}\"\n @focusout=\"${this.__onOverlayFocusOut}\"\n @opened-changed=\"${this.__onOpenedChanged}\"\n .restoreFocusOnClose=\"${this.__shouldRestoreFocus}\"\n .restoreFocusNode=\"${this.target}\"\n @vaadin-overlay-escape-press=\"${this.__onEscapePress}\"\n @vaadin-overlay-outside-click=\"${this.__onOutsideClick}\"\n @vaadin-overlay-open=\"${this.__onOverlayOpened}\"\n @vaadin-overlay-closed=\"${this.__onOverlayClosed}\"\n ></vaadin-popover-overlay>\n `;\n }\n\n /**\n * Requests an update for the content of the popover.\n * While performing the update, it invokes the renderer passed in the `renderer` property.\n *\n * It is not guaranteed that the update happens immediately (synchronously) after it is requested.\n */\n requestContentUpdate() {\n if (!this.renderer || !this._overlayElement) {\n return;\n }\n\n this._overlayElement.requestContentUpdate();\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this._overlayElement = this.shadowRoot.querySelector('vaadin-popover-overlay');\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n\n document.documentElement.addEventListener('click', this.__onGlobalClick, true);\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n\n document.documentElement.removeEventListener('click', this.__onGlobalClick, true);\n\n this._openedStateController.close(true);\n }\n\n /**\n * @param {HTMLElement} target\n * @protected\n * @override\n */\n _addTargetListeners(target) {\n target.addEventListener('click', this.__onTargetClick);\n target.addEventListener('mouseenter', this.__onTargetMouseEnter);\n target.addEventListener('mouseleave', this.__onTargetMouseLeave);\n target.addEventListener('focusin', this.__onTargetFocusIn);\n target.addEventListener('focusout', this.__onTargetFocusOut);\n }\n\n /**\n * @param {HTMLElement} target\n * @protected\n * @override\n */\n _removeTargetListeners(target) {\n target.removeEventListener('click', this.__onTargetClick);\n target.removeEventListener('mouseenter', this.__onTargetMouseEnter);\n target.removeEventListener('mouseleave', this.__onTargetMouseLeave);\n target.removeEventListener('focusin', this.__onTargetFocusIn);\n target.removeEventListener('focusout', this.__onTargetFocusOut);\n }\n\n /** @private */\n __openedChanged(opened, oldOpened) {\n if (opened) {\n document.addEventListener('keydown', this.__onGlobalKeyDown, true);\n } else if (oldOpened) {\n document.removeEventListener('keydown', this.__onGlobalKeyDown, true);\n }\n }\n\n /** @private */\n __openedOrTargetChanged(opened, target) {\n if (target) {\n target.setAttribute('aria-expanded', opened ? 'true' : 'false');\n\n if (opened) {\n target.setAttribute('aria-controls', this.__overlayId);\n } else {\n target.removeAttribute('aria-controls');\n }\n }\n }\n\n /** @private */\n __overlayRoleOrTargetChanged(overlayRole, target) {\n if (this.__oldTarget) {\n this.__oldTarget.removeAttribute('aria-haspopup');\n }\n\n if (target) {\n const isDialog = overlayRole === 'dialog' || overlayRole === 'alertdialog';\n target.setAttribute('aria-haspopup', isDialog ? 'dialog' : 'true');\n\n this.__oldTarget = target;\n }\n }\n\n /**\n * Overlay's global outside click listener doesn't work when\n * the overlay is modeless, so we use a separate listener.\n * @private\n */\n __onGlobalClick(event) {\n if (\n this.opened &&\n !this.__isManual &&\n !this.modal &&\n !event.composedPath().some((el) => el === this._overlayElement || el === this.target) &&\n !this.noCloseOnOutsideClick &&\n isLastOverlay(this._overlayElement)\n ) {\n this._openedStateController.close(true);\n }\n }\n\n /** @private */\n __onTargetClick() {\n if (this.__hasTrigger('click')) {\n if (!this.opened) {\n this.__shouldRestoreFocus = true;\n }\n if (this.opened) {\n this._openedStateController.close(true);\n } else {\n this._openedStateController.open({ immediate: true });\n }\n }\n }\n\n /**\n * Overlay's global Escape press listener doesn't work when\n * the overlay is modeless, so we use a separate listener.\n * @private\n */\n __onGlobalKeyDown(event) {\n // Modal popover uses overlay logic for Esc key and focus trap.\n if (this.modal) {\n return;\n }\n\n if (\n event.key === 'Escape' &&\n !this.noCloseOnEsc &&\n this.opened &&\n !this.__isManual &&\n isLastOverlay(this._overlayElement)\n ) {\n // Prevent closing parent overlay (e.g. dialog)\n event.stopPropagation();\n this._openedStateController.close(true);\n }\n\n // Include popover content in the Tab order after the target.\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n this.__onGlobalShiftTab(event);\n } else {\n this.__onGlobalTab(event);\n }\n }\n }\n\n /** @private */\n __onGlobalTab(event) {\n const overlayPart = this._overlayElement.$.overlay;\n\n // Move focus to the popover content on target element Tab\n if (this.target && isElementFocused(this.target)) {\n event.preventDefault();\n overlayPart.focus();\n return;\n }\n\n // Move focus to the next element after target on content Tab\n const lastFocusable = this.__getLastFocusable(overlayPart);\n if (lastFocusable && isElementFocused(lastFocusable)) {\n const focusable = this.__getNextBodyFocusable(this.target);\n if (focusable && focusable !== overlayPart) {\n event.preventDefault();\n focusable.focus();\n return;\n }\n }\n\n // Prevent focusing the popover content on previous element Tab\n const activeElement = getDeepActiveElement();\n const nextFocusable = this.__getNextBodyFocusable(activeElement);\n if (nextFocusable === overlayPart && lastFocusable) {\n // Move focus to the last overlay focusable and do NOT prevent keydown\n // to move focus outside the popover content (e.g. to the URL bar).\n lastFocusable.focus();\n }\n }\n\n /** @private */\n __onGlobalShiftTab(event) {\n const overlayPart = this._overlayElement.$.overlay;\n\n // Prevent restoring focus after target blur on Shift + Tab\n if (this.target && isElementFocused(this.target) && this.__shouldRestoreFocus) {\n this.__shouldRestoreFocus = false;\n return;\n }\n\n // Move focus back to the target on overlay content Shift + Tab\n if (this.target && isElementFocused(overlayPart)) {\n event.preventDefault();\n this.target.focus();\n return;\n }\n\n // Move focus back to the popover on next element Shift + Tab\n const nextFocusable = this.__getNextBodyFocusable(this.target);\n if (nextFocusable && isElementFocused(nextFocusable)) {\n const lastFocusable = this.__getLastFocusable(overlayPart);\n if (lastFocusable) {\n event.preventDefault();\n lastFocusable.focus();\n }\n }\n }\n\n /** @private */\n __getNextBodyFocusable(target) {\n const focusables = getFocusableElements(document.body);\n const idx = focusables.findIndex((el) => el === target);\n return focusables[idx + 1];\n }\n\n /** @private */\n __getLastFocusable(container) {\n const focusables = getFocusableElements(container);\n return focusables.pop();\n }\n\n /** @private */\n __onTargetFocusIn() {\n this.__focusInside = true;\n\n if (this.__hasTrigger('focus')) {\n // When trigger is set to both focus and click, only open on\n // keyboard focus, to prevent issue when immediately closing\n // on click which occurs after the focus caused by mousedown.\n if (this.__hasTrigger('click') && !isKeyboardActive()) {\n return;\n }\n\n // Prevent overlay re-opening when restoring focus on close.\n if (!this.__shouldRestoreFocus) {\n this.__shouldRestoreFocus = true;\n this._openedStateController.open({ trigger: 'focus' });\n }\n }\n }\n\n /** @private */\n __onTargetFocusOut(event) {\n // Do not close the popover on overlay focusout if it's not the last one.\n // This covers the case when focus moves to the nested popover opened\n // without focusing parent popover overlay (e.g. using hover trigger).\n if (!isLastOverlay(this._overlayElement)) {\n return;\n }\n\n if ((this.__hasTrigger('focus') && this.__mouseDownInside) || this._overlayElement.contains(event.relatedTarget)) {\n return;\n }\n\n this.__handleFocusout();\n }\n\n /** @private */\n __onTargetMouseEnter() {\n this.__hoverInside = true;\n\n if (this.__hasTrigger('hover') && !this.opened) {\n // Prevent closing due to `pointer-events: none` set on body.\n if (this.modal) {\n this.target.style.pointerEvents = 'auto';\n }\n this._openedStateController.open({ trigger: 'hover' });\n }\n }\n\n /** @private */\n __onTargetMouseLeave(event) {\n // Do not close the popover on target focusout if the overlay is not the last one.\n // This happens e.g. when opening the nested popover that uses non-modal overlay.\n if (this._overlayElement.opened && !isLastOverlay(this._overlayElement)) {\n return;\n }\n\n if (this._overlayElement.contains(event.relatedTarget)) {\n return;\n }\n\n this.__handleMouseLeave();\n }\n\n /** @private */\n __onOverlayFocusIn() {\n this.__focusInside = true;\n\n // When using Tab to move focus, restoring focus is reset. However, if pressing Tab\n // causes focus to be moved inside the overlay, we should restore focus on close.\n if (this.__hasTrigger('focus') || this.__hasTrigger('click')) {\n this.__shouldRestoreFocus = true;\n }\n }\n\n /** @private */\n __onOverlayFocusOut(event) {\n // Do not close the popover on overlay focusout if it's not the last one.\n // This covers the following cases of nested overlay based components:\n // 1. Moving focus to the nested overlay (e.g. vaadin-select, vaadin-menu-bar)\n // 2. Closing not focused nested overlay on outside (e.g. vaadin-combo-box)\n if (!isLastOverlay(this._overlayElement)) {\n return;\n }\n\n if (\n (this.__hasTrigger('focus') && this.__mouseDownInside) ||\n event.relatedTarget === this.target ||\n this._overlayElement.contains(event.relatedTarget)\n ) {\n return;\n }\n\n this.__handleFocusout();\n }\n\n /** @private */\n __onOverlayMouseDown() {\n if (this.__hasTrigger('focus')) {\n this.__mouseDownInside = true;\n\n document.addEventListener(\n 'mouseup',\n () => {\n this.__mouseDownInside = false;\n },\n { once: true },\n );\n }\n }\n\n /** @private */\n __onOverlayMouseEnter() {\n this.__hoverInside = true;\n\n // Prevent closing if cursor moves to the overlay during hide delay.\n if (this.__hasTrigger('hover') && this._openedStateController.isClosing) {\n this._openedStateController.open({ immediate: true });\n }\n }\n\n /** @private */\n __onOverlayMouseLeave(event) {\n // Do not close the popover on overlay focusout if it's not the last one.\n // This happens when opening the nested component that uses \"modal\" overlay\n // setting `pointer-events: none` on the body (combo-box, date-picker etc).\n if (!isLastOverlay(this._overlayElement)) {\n return;\n }\n\n if (event.relatedTarget === this.target) {\n return;\n }\n\n this.__handleMouseLeave();\n }\n\n /** @private */\n __handleFocusout() {\n this.__focusInside = false;\n\n if (this.__hasTrigger('hover') && this.__hoverInside) {\n return;\n }\n\n if (this.__hasTrigger('focus')) {\n this._openedStateController.close(true);\n }\n }\n\n /** @private */\n __handleMouseLeave() {\n this.__hoverInside = false;\n\n if (this.__hasTrigger('focus') && this.__focusInside) {\n return;\n }\n\n if (this.__hasTrigger('hover')) {\n this._openedStateController.close();\n }\n }\n\n /** @private */\n __onOpenedChanged(event) {\n this.opened = event.detail.value;\n }\n\n /** @private */\n __onOverlayOpened() {\n if (this.autofocus && !this.modal) {\n this._overlayElement.$.overlay.focus();\n }\n }\n\n /** @private */\n __onOverlayClosed() {\n // Reset restoring focus state after a timeout to make sure focus was restored\n // and then allow re-opening overlay on re-focusing target with focus trigger.\n if (this.__shouldRestoreFocus) {\n setTimeout(() => {\n this.__shouldRestoreFocus = false;\n });\n }\n\n // Restore pointer-events set when opening on hover.\n if (this.modal && this.target.style.pointerEvents) {\n this.target.style.pointerEvents = '';\n }\n\n this.dispatchEvent(new CustomEvent('closed'));\n }\n\n /**\n * Close the popover if `noCloseOnEsc` isn't set to true.\n * @private\n */\n __onEscapePress(e) {\n if (this.noCloseOnEsc || this.__isManual) {\n e.preventDefault();\n }\n }\n\n /**\n * Close the popover if `noCloseOnOutsideClick` isn't set to true.\n * @private\n */\n __onOutsideClick(e) {\n if (this.noCloseOnOutsideClick || this.__isManual) {\n e.preventDefault();\n }\n }\n\n /** @private */\n __hasTrigger(trigger) {\n return Array.isArray(this.trigger) && this.trigger.includes(trigger);\n }\n\n /** @private */\n get __isManual() {\n return this.trigger == null || (Array.isArray(this.trigger) && this.trigger.length === 0);\n }\n\n /** @private */\n __updateDimension(overlay, dimension, value) {\n const prop = `--_vaadin-popover-content-${dimension}`;\n\n if (value) {\n overlay.style.setProperty(prop, value);\n } else {\n overlay.style.removeProperty(prop);\n }\n }\n\n /** @private */\n __updateContentHeight(height, overlay) {\n if (overlay) {\n this.__updateDimension(overlay, 'height', height);\n }\n }\n\n /** @private */\n __updateContentWidth(width, overlay) {\n if (overlay) {\n this.__updateDimension(overlay, 'width', width);\n }\n }\n\n /**\n * Fired when the popover is closed.\n *\n * @event closed\n */\n}\n\ndefineCustomElement(Popover);\n\nexport { Popover };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { InputController } from '@vaadin/field-base/src/input-controller.js';\nimport { InputFieldMixin } from '@vaadin/field-base/src/input-field-mixin.js';\nimport { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';\n\n/**\n * A mixin providing common text field functionality.\n *\n * @polymerMixin\n * @mixes InputFieldMixin\n */\nexport const TextFieldMixin = (superClass) =>\n class TextFieldMixinClass extends InputFieldMixin(superClass) {\n static get properties() {\n return {\n /**\n * Maximum number of characters (in Unicode code points) that the user can enter.\n */\n maxlength: {\n type: Number,\n },\n\n /**\n * Minimum number of characters (in Unicode code points) that the user can enter.\n */\n minlength: {\n type: Number,\n },\n\n /**\n * A regular expression that the value is checked against.\n * The pattern must match the entire value, not just some subset.\n */\n pattern: {\n type: String,\n },\n };\n }\n\n static get delegateAttrs() {\n return [...super.delegateAttrs, 'maxlength', 'minlength', 'pattern'];\n }\n\n static get constraints() {\n return [...super.constraints, 'maxlength', 'minlength', 'pattern'];\n }\n\n constructor() {\n super();\n this._setType('text');\n }\n\n /** @protected */\n get clearElement() {\n return this.$.clearButton;\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this.addController(\n new InputController(this, (input) => {\n this._setInputElement(input);\n this._setFocusElement(input);\n this.stateTarget = input;\n this.ariaTarget = input;\n }),\n );\n this.addController(new LabelledInputController(this.inputElement, this._labelController));\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport '@vaadin/input-container/src/vaadin-input-container.js';\nimport { html, PolymerElement } from '@polymer/polymer';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';\nimport { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';\nimport { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';\nimport { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { TextFieldMixin } from './vaadin-text-field-mixin.js';\n\nregisterStyles('vaadin-text-field', inputFieldShared, { moduleId: 'vaadin-text-field-styles' });\n\n/**\n * `<vaadin-text-field>` is a web component that allows the user to input and edit text.\n *\n * ```html\n * <vaadin-text-field label=\"First Name\"></vaadin-text-field>\n * ```\n *\n * ### Prefixes and suffixes\n *\n * These are child elements of a `<vaadin-text-field>` that are displayed\n * inline with the input, before or after.\n * In order for an element to be considered as a prefix, it must have the slot\n * attribute set to `prefix` (and similarly for `suffix`).\n *\n * ```html\n * <vaadin-text-field label=\"Email address\">\n * <div slot=\"prefix\">Sent to:</div>\n * <div slot=\"suffix\">@vaadin.com</div>\n * </vaadin-text-field>\n * ```\n *\n * ### Styling\n *\n * The following custom properties are available for styling:\n *\n * Custom property | Description | Default\n * -------------------------------|----------------------------|---------\n * `--vaadin-field-default-width` | Default width of the field | `12em`\n *\n * The following shadow DOM parts are available for styling:\n *\n * Part name | Description\n * ---------------------|----------------\n * `label` | The label element\n * `input-field` | The element that wraps prefix, value and suffix\n * `clear-button` | The clear button\n * `error-message` | The error message element\n * `helper-text` | The helper text element wrapper\n * `required-indicator` | The `required` state indicator element\n *\n * The following state attributes are available for styling:\n *\n * Attribute | Description | Part name\n * --------------------|-------------|------------\n * `disabled` | Set to a disabled text field | :host\n * `has-value` | Set when the element has a value | :host\n * `has-label` | Set when the element has a label | :host\n * `has-helper` | Set when the element has helper text or slot | :host\n * `has-error-message` | Set when the element has an error message | :host\n * `invalid` | Set when the element is invalid | :host\n * `input-prevented` | Temporarily set when invalid input is prevented | :host\n * `focused` | Set when the element is focused | :host\n * `focus-ring` | Set when the element is keyboard focused | :host\n * `readonly` | Set to a readonly text field | :host\n *\n * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n *\n * @fires {Event} input - Fired when the value is changed by the user: on every typing keystroke, and the value is cleared using the clear button.\n * @fires {Event} change - Fired when the user commits a value change.\n * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.\n * @fires {CustomEvent} value-changed - Fired when the `value` property changes.\n * @fires {CustomEvent} validated - Fired whenever the field is validated.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ElementMixin\n * @mixes ThemableMixin\n * @mixes TextFieldMixin\n */\nexport class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(PolymerElement))) {\n static get is() {\n return 'vaadin-text-field';\n }\n\n static get template() {\n return html`\n <style>\n [part='input-field'] {\n flex-grow: 0;\n }\n </style>\n\n <div class=\"vaadin-field-container\">\n <div part=\"label\">\n <slot name=\"label\"></slot>\n <span part=\"required-indicator\" aria-hidden=\"true\" on-click=\"focus\"></span>\n </div>\n\n <vaadin-input-container\n part=\"input-field\"\n readonly=\"[[readonly]]\"\n disabled=\"[[disabled]]\"\n invalid=\"[[invalid]]\"\n theme$=\"[[_theme]]\"\n >\n <slot name=\"prefix\" slot=\"prefix\"></slot>\n <slot name=\"input\"></slot>\n <slot name=\"suffix\" slot=\"suffix\"></slot>\n <div id=\"clearButton\" part=\"clear-button\" slot=\"suffix\" aria-hidden=\"true\"></div>\n </vaadin-input-container>\n\n <div part=\"helper-text\">\n <slot name=\"helper\"></slot>\n </div>\n\n <div part=\"error-message\">\n <slot name=\"error-message\"></slot>\n </div>\n </div>\n <slot name=\"tooltip\"></slot>\n `;\n }\n\n static get properties() {\n return {\n /**\n * Maximum number of characters (in Unicode code points) that the user can enter.\n */\n maxlength: {\n type: Number,\n },\n\n /**\n * Minimum number of characters (in Unicode code points) that the user can enter.\n */\n minlength: {\n type: Number,\n },\n };\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this._tooltipController = new TooltipController(this);\n this._tooltipController.setPosition('top');\n this._tooltipController.setAriaTarget(this.inputElement);\n this.addController(this._tooltipController);\n }\n}\n\ndefineCustomElement(TextField);\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';\nimport { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';\nimport { registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\n\nregisterStyles('vaadin-text-field', inputFieldShared, {\n moduleId: 'lumo-text-field-styles',\n});\n"],"names":["InputFieldMixin","superclass","properties","autocomplete","type","String","autocorrect","autocapitalize","reflectToAttribute","delegateAttrs","super","__data","this","__dataValue","value","_inputElementChanged","input","console","warn","localName","_setFocused","focused","document","hasFocus","validate","_onInput","event","invalid","_valueChanged","newValue","oldValue","undefined","keyboardActive","getDeepActiveElement","host","activeElement","body","shadowRoot","isKeyboardActive","hasLowerTabOrder","a","b","ati","Math","max","tabIndex","bti","sortElementsByTabIndex","elements","len","length","pivot","ceil","left","right","result","push","shift","concat","mergeSortByTabIndex","slice","isElementFocused","element","getRootNode","collectFocusableNodes","node","nodeType","Node","ELEMENT_NODE","style","visibility","display","computedStyle","window","getComputedStyle","isElementHiddenDirectly","matches","isElementFocusable","getAttribute","Number","normalizeTabIndex","needsSort","children","assignedNodes","flatten","forEach","child","getFocusableElements","focusableElements","defineCustomElement","CustomElement","version","Object","defineProperty","get","defined","customElements","is","definedVersion","error","define","addEventListener","capture","directionSubscribers","alignDirs","documentDir","elementDir","setAttribute","removeAttribute","getDocumentDir","documentElement","MutationObserver","observe","attributes","attributeFilter","DirMixin","superClass","dir","converter","fromAttribute","attr","toAttribute","prop","__isRTL","connectedCallback","hasAttribute","__restoreSubscription","__subscribe","attributeChangedCallback","name","newValueEqlDocDir","indexOf","newValueEmptied","newDiffValue","__unsubscribe","disconnectedCallback","includes","_valueToNodeAttribute","attribute","_attributeToProperty","splice","appliedClassMixins","WeakMap","caseMap","CAMEL_TO_DASH","camelToDash","camel","replace","toLowerCase","upper","toUpperCase","substring","parseObserver","observerString","method","rest","split","observerProps","map","trim","getOrCreateMap","obj","prototype","hasOwnProperty","call","Map","PolylitMixin","mixin","createProperty","options","Boolean","Array","reflect","finalize","isArray","observers","complexObservers","observer","set","addCheckedInitializer","initializer","addInitializer","instance","getPropertyDescriptor","key","defaultDescriptor","sync","requestUpdate","hasUpdated","performUpdate","configurable","enumerable","readOnly","setter","notify","__notifyProps","notifyProps","Set","add","computed","assignComputedMethod","props","firstUpdated","$","renderRoot","querySelectorAll","id","ready","updated","constructor","__observers","__runObservers","__complexObservers","__runComplexObservers","__dynamicObservers","__runNotifyProps","__isReadyInvoked","setProperties","entries","__propKeys","_createMethodObserver","dynamicObservers","some","has","v","k","_","dispatchEvent","CustomEvent","detail","_get","path","object","reduce","property","_set","pathParts","lastPart","pop","target","part","klass","getPrototypeOf","wasMixinPreviouslyApplied","mixedClass","overlayStyles","ThemePropertyMixin","_theme","observedAttributes","_set_theme","themeRegistry","themableInstances","themableTagNames","getAllThemes","Vaadin","styleModules","getIncludePriority","moduleName","includePriority","startsWith","getIncludedStyles","theme","includedStyles","include","includeModuleId","includedTheme","find","s","moduleId","styles","getThemes","tagName","defaultModuleName","themes","filter","themeFor","themeForToken","RegExp","join","test","matchesThemeFor","sort","themeA","themeB","ThemableMixin","WeakRef","elementStyles","template","_template","elementClass","styleEl","createElement","textContent","cssText","getCssText","content","appendChild","addStylesToTemplate","getStylesForThis","finalizeStyles","themeStyles","flat","Infinity","superClassThemes","__themes","parent","inheritedThemes","flatMap","index","lastIndexOf","testUserAgent","regexp","navigator","userAgent","testPlatform","platform","vendor","isIPad","maxTouchPoints","isIOS","createEvent","counterMap","uncontrolledNodes","markerMap","lockCount","isElement","logError","args","hideOthers","originalTarget","parentNode","markerName","targets","from","controlAttribute","contains","x","correctTargets","markerCounter","hiddenNodes","elementsToKeep","elementsToStop","keep","el","slot","assignedSlot","deep","root","alreadyHidden","counterValue","markerValue","clear","delete","applyAttributeToOthers","HTMLElement","AriaModalController","callback","showModal","__showOthers","close","FocusRestorationController","saveFocus","focusNode","restoreFocus","preventScroll","setTimeout","focus","instances","FocusTrapController","__trapNode","__onKeyDown","bind","__focusableElements","__focusedElementIndex","hostConnected","hostDisconnected","removeEventListener","trapFocus","trapNode","Error","releaseFocus","preventDefault","backward","shiftKey","__focusNextElement","step","currentIndex","select","ControllerMixin","addController","__controllers","c","controller","isConnected","removeController","OverlayFocusMixin","focusTrap","restoreFocusOnClose","restoreFocusNode","__ariaModalController","__focusTrapController","__focusRestorationController","_resetFocus","_shouldRestoreFocus","_saveFocus","_trapFocus","overlay","_deepContains","n","doc","ownerDocument","getAttachedInstances","_hasOverlayStackMixin","__zIndex","getOverlayInstances","isLastOverlay","OverlayStackMixin","_last","bringToFront","zIndex","frontmost","o","parseFloat","_enterModalState","pointerEvents","_previousDocumentPointerEvents","_exitModalState","removeProperty","modeless","OverlayMixin","opened","owner","model","renderer","hidden","withBackdrop","_boundMouseDownListener","_mouseDownListener","_boundMouseUpListener","_mouseUpListener","_boundOutsideClickListener","_outsideClickListener","_boundKeydownListener","_keydownListener","_boundIosResizeListener","_detectIosNavbar","backdrop","requestContentUpdate","sourceEvent","evt","bubbles","cancelable","defaultPrevented","innerHeight","landscape","innerWidth","clientHeight","setProperty","_addGlobalListeners","_removeGlobalListeners","_rendererOrDataChanged","ownerOrModelChanged","_oldOwner","_oldModel","rendererChanged","_oldRenderer","hasOldRenderer","openedChanged","_oldOpened","innerHTML","_$litPart$","_modelessChanged","_openedChanged","wasOpened","_animatedOpening","_animatedClosing","_hiddenChanged","_flushAnimation","_shouldAnimate","getPropertyValue","_enqueueAnimation","handler","listener","_attachOverlay","_finishOpening","_placeholder","createComment","insertBefore","_finishClosing","_detachOverlay","removeChild","_mouseDownInside","composedPath","_mouseUpInside","_shouldCloseOnOutsideClick","_event","PROP_NAMES_VERTICAL","start","end","PROP_NAMES_HORIZONTAL","targetResizeObserver","ResizeObserver","entry","__overlay","_updatePosition","PositionMixin","positionTarget","horizontalAlign","verticalAlign","noHorizontalOverlap","noVerticalOverlap","requiredVerticalSpace","__onScroll","__addUpdatePositionEventListeners","__removeUpdatePositionEventListeners","visualViewport","__positionTargetAncestorRootNodes","DOCUMENT_NODE","DOCUMENT_FRAGMENT_NODE","getAncestorRootNodes","__observePositionTargetMove","io","cleanup","disconnect","refresh","skip","threshold","top","width","height","getBoundingClientRect","rootMargin","floor","clientWidth","min","isFirstUpdate","IntersectionObserver","ratio","intersectionRatio","observeMove","__overlayOpenedChanged","unobserve","__margins","propName","parseInt","requestAnimationFrame","__positionSettingsChanged","e","targetRect","shouldAlignStartVertically","__shouldAlignStartVertically","justifyContent","isRTL","shouldAlignStartHorizontally","__shouldAlignStartHorizontally","flexStart","alignItems","overlayRect","verticalProps","__calculatePositionInOneDimension","horizontalProps","assign","toggleAttribute","rtl","contentWidth","__oldContentWidth","offsetWidth","viewportWidth","defaultAlignLeft","__shouldAlignStart","contentHeight","__oldContentHeight","offsetHeight","viewportHeight","defaultAlignTop","contentSize","viewportSize","margins","defaultAlignStart","noOverlap","propNames","spaceForStartAlignment","spaceForEndAlignment","spaceForDefaultAlignment","__adjustBottomProperty","cssPropNameToSet","currentValue","adjustedProp","__oldViewportHeight","__oldViewportWidth","shouldAlignStart","cssPropNameToClear","adjustedValue","diff","valueToSet","PopoverOverlayMixin","position","_tagNamePrefix","offset","PopoverOverlay","render","__hasTrigger","microtaskCurrHandle","microtaskLastHandle","microtaskCallbacks","microtaskScheduled","idlePeriod","run","fn","requestIdleCallback","cancel","handle","cancelIdleCallback","clearTimeout","microTask","queueMicrotask","i","cb","microtaskFlush","idx","debouncerQueue","Debouncer","debounce","debouncer","asyncModule","_cancelAsync","setConfig","_asyncModule","_callback","_timer","isActive","flush","statsJob","registrations","developmentModeCallback","registered","ElementMixin","doctype","OverlayClassMixin","overlayClass","_overlayElement","__updateOverlayClassNames","overlayElement","classList","__initialClasses","__previousClasses","classesToRemove","remove","classesToAdd","uniqueId","PopoverTargetMixin","for","_addTargetListeners","_removeTargetListeners","__forChanged","forId","__setTargetByIdDebouncer","__setTargetById","targetId","getElementById","__targetChanged","oldTarget","_target","DEFAULT_DELAY","defaultFocusDelay","defaultHoverDelay","defaultHideDelay","PopoverOpenedStateController","isClosing","__closeTimeout","__focusDelay","popover","focusDelay","__hoverDelay","hoverDelay","__hideDelay","hideDelay","open","immediate","trigger","shouldDelayHover","shouldDelayFocus","__showPopover","__scheduleOpen","__scheduleClose","__abortClose","__setOpened","__abortOpen","__openTimeout","delay","Popover","_position","__effectivePosition","__computeHorizontalAlign","__computeNoHorizontalOverlap","__computeNoVerticalOverlap","__computeVerticalAlign","__computePosition","defaultPosition","PopoverPositionMixin","accessibleName","accessibleNameRef","autofocus","overlayRole","modal","noCloseOnOutsideClick","noCloseOnEsc","__shouldRestoreFocus","__overlayId","setDefaultFocusDelay","setDefaultHideDelay","setDefaultHoverDelay","__onGlobalClick","__onGlobalKeyDown","__onTargetClick","__onTargetFocusIn","__onTargetFocusOut","__onTargetMouseEnter","__onTargetMouseLeave","_openedStateController","effectivePosition","__onOverlayMouseDown","__onOverlayMouseEnter","__onOverlayMouseLeave","__onOverlayFocusIn","__onOverlayFocusOut","__onOpenedChanged","__onEscapePress","__onOutsideClick","__onOverlayOpened","__onOverlayClosed","querySelector","__openedChanged","oldOpened","__openedOrTargetChanged","__overlayRoleOrTargetChanged","__oldTarget","isDialog","__isManual","stopPropagation","__onGlobalShiftTab","__onGlobalTab","overlayPart","lastFocusable","__getLastFocusable","focusable","__getNextBodyFocusable","nextFocusable","focusables","findIndex","container","__focusInside","__mouseDownInside","relatedTarget","__handleFocusout","__hoverInside","__handleMouseLeave","once","__updateDimension","dimension","__updateContentHeight","__updateContentWidth","TextFieldMixin","maxlength","minlength","pattern","constraints","_setType","clearElement","clearButton","_setInputElement","_setFocusElement","stateTarget","ariaTarget","inputElement","_labelController","TextField","_tooltipController","setPosition","setAriaTarget"],"sourceRoot":""}
|
1
|
+
{"version":3,"file":"1519.js","mappings":";yKAaO,MAAMA,EAAmBC,GAC9B,eAAmC,OAAkBA,IACnD,qBAAWC,GACT,MAAO,CAMLC,aAAc,CACZC,KAAMC,QAURC,YAAa,CACXF,KAAMC,QAYRE,eAAgB,CACdH,KAAMC,OACNG,oBAAoB,GAG1B,CAEA,wBAAWC,GACT,MAAO,IAAIC,MAAMD,cAAe,iBAAkB,eAAgB,cACpE,CAGA,UAAIE,GACF,OAAOC,KAAKC,aAAe,CAAC,CAC9B,CAEA,UAAIF,CAAOG,GACTF,KAAKC,YAAcC,CACrB,CAOA,oBAAAC,CAAqBC,GACnBN,MAAMK,qBAAqBC,GAEvBA,IAEEA,EAAMF,OAASE,EAAMF,QAAUF,KAAKE,QACtCG,QAAQC,KAAK,+BAA+BN,KAAKO,yBACjDH,EAAMF,MAAQ,IAGZF,KAAKE,QACPE,EAAMF,MAAQF,KAAKE,OAGzB,CAQA,WAAAM,CAAYC,GACVX,MAAMU,YAAYC,IAIbA,GAAWC,SAASC,YACvBX,KAAKY,UAET,CASA,QAAAC,CAASC,GACPhB,MAAMe,SAASC,GAEXd,KAAKe,SACPf,KAAKY,UAET,CAWA,aAAAI,CAAcC,EAAUC,GACtBpB,MAAMkB,cAAcC,EAAUC,QAEbC,IAAbD,GAIAlB,KAAKe,SACPf,KAAKY,UAET,mCCjIJ,IAAIQ,GAAiB,EA0Bd,SAASC,IACd,IAAIC,EAAOZ,SAASa,eAAiBb,SAASc,KAC9C,KAAOF,EAAKG,YAAcH,EAAKG,WAAWF,eACxCD,EAAOA,EAAKG,WAAWF,cAEzB,OAAOD,CACT,CAQO,SAASI,IACd,OAAON,CACT,CAsCA,SAASO,EAAiBC,EAAGC,GAG3B,MAAMC,EAAM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AarvB,CAAK,KAG3BJ,KAAKyX,cAAc,IAAI,IAAwBzX,KAAK0vB,aAAc1vB,KAAK2vB,kBACzE,IC5DJ,QAAe,oBAAqB,IAAkB,CAAE3f,SAAU,6BAuE3D,MAAM4f,UAAkBd,GAAe,SAAc,OAAa,SACvE,aAAWzpB,GACT,MAAO,mBACT,CAEA,mBAAW8L,GACT,OAAO,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoCb,CAEA,qBAAW7R,GACT,MAAO,CAILyvB,UAAW,CACTvvB,KAAM2E,QAMR6qB,UAAW,CACTxvB,KAAM2E,QAGZ,CAGA,KAAAgI,GACErM,MAAMqM,QAENnM,KAAK6vB,mBAAqB,IAAI,IAAkB7vB,MAChDA,KAAK6vB,mBAAmBC,YAAY,OACpC9vB,KAAK6vB,mBAAmBE,cAAc/vB,KAAK0vB,cAC3C1vB,KAAKyX,cAAczX,KAAK6vB,mBAC1B,GAGF,OAAoBD,6CCrJpB,eAAe,oBAAqB,IAAkB,CACpD5f,SAAU","sources":["webpack://@descope/web-components-ui/../../../node_modules/@vaadin/field-base/src/input-field-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/a11y-base/src/focus-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/define.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/dir-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@open-wc/dedupe-mixin/src/dedupeMixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/polylit-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/path-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/overlay/src/vaadin-overlay-styles.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/browser-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/a11y-base/src/aria-hidden.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/a11y-base/src/aria-modal-controller.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/a11y-base/src/focus-restoration-controller.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/a11y-base/src/focus-trap-controller.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/controller-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/overlay/src/vaadin-overlay-focus-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/overlay/src/vaadin-overlay-stack-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/overlay/src/vaadin-overlay-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/overlay/src/vaadin-overlay-position-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/dom-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/overlay/src/vaadin-overlay-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/src/vaadin-popover-overlay-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/src/vaadin-popover-overlay.js","webpack://@descope/web-components-ui/../../../node_modules/lit-html/directives/if-defined.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/async.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/debounce.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/element-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/overlay-class-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/node_modules/@vaadin/component-base/src/unique-id-utils.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/src/vaadin-popover-position-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/src/vaadin-popover-target-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/popover/src/vaadin-popover.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-field/src/vaadin-text-field-mixin.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-field/src/vaadin-text-field.js","webpack://@descope/web-components-ui/../../../node_modules/@vaadin/text-field/theme/lumo/vaadin-text-field-styles.js"],"sourcesContent":["/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { InputControlMixin } from './input-control-mixin.js';\n\n/**\n * A mixin to provide logic for vaadin-text-field and related components.\n *\n * @polymerMixin\n * @mixes InputControlMixin\n */\nexport const InputFieldMixin = (superclass) =>\n class InputFieldMixinClass extends InputControlMixin(superclass) {\n static get properties() {\n return {\n /**\n * Whether the value of the control can be automatically completed by the browser.\n * List of available options at:\n * https://developer.mozilla.org/en/docs/Web/HTML/Element/input#attr-autocomplete\n */\n autocomplete: {\n type: String,\n },\n\n /**\n * This is a property supported by Safari that is used to control whether\n * autocorrection should be enabled when the user is entering/editing the text.\n * Possible values are:\n * on: Enable autocorrection.\n * off: Disable autocorrection.\n */\n autocorrect: {\n type: String,\n },\n\n /**\n * This is a property supported by Safari and Chrome that is used to control whether\n * autocapitalization should be enabled when the user is entering/editing the text.\n * Possible values are:\n * characters: Characters capitalization.\n * words: Words capitalization.\n * sentences: Sentences capitalization.\n * none: No capitalization.\n */\n autocapitalize: {\n type: String,\n reflectToAttribute: true,\n },\n };\n }\n\n static get delegateAttrs() {\n return [...super.delegateAttrs, 'autocapitalize', 'autocomplete', 'autocorrect'];\n }\n\n // Workaround for https://github.com/Polymer/polymer/issues/5259\n get __data() {\n return this.__dataValue || {};\n }\n\n set __data(value) {\n this.__dataValue = value;\n }\n\n /**\n * @param {HTMLElement} input\n * @protected\n * @override\n */\n _inputElementChanged(input) {\n super._inputElementChanged(input);\n\n if (input) {\n // Discard value set on the custom slotted input.\n if (input.value && input.value !== this.value) {\n console.warn(`Please define value on the <${this.localName}> component!`);\n input.value = '';\n }\n\n if (this.value) {\n input.value = this.value;\n }\n }\n }\n\n /**\n * Override an event listener from `FocusMixin`.\n * @param {boolean} focused\n * @protected\n * @override\n */\n _setFocused(focused) {\n super._setFocused(focused);\n\n // Do not validate when focusout is caused by document\n // losing focus, which happens on browser tab switch.\n if (!focused && document.hasFocus()) {\n this.validate();\n }\n }\n\n /**\n * Override an event listener from `InputMixin`\n * to mark as valid after user started typing.\n * @param {Event} event\n * @protected\n * @override\n */\n _onInput(event) {\n super._onInput(event);\n\n if (this.invalid) {\n this.validate();\n }\n }\n\n /**\n * Override an observer from `InputMixin` to validate the field\n * when a new value is set programmatically.\n *\n * @param {string | undefined} newValue\n * @param {string | undefined} oldValue\n * @protected\n * @override\n */\n _valueChanged(newValue, oldValue) {\n super._valueChanged(newValue, oldValue);\n\n if (oldValue === undefined) {\n return;\n }\n\n if (this.invalid) {\n this.validate();\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n// We consider the keyboard to be active if the window has received a keydown\n// event since the last mousedown event.\nlet keyboardActive = false;\n\n// Listen for top-level keydown and mousedown events.\n// Use capture phase so we detect events even if they're handled.\nwindow.addEventListener(\n 'keydown',\n () => {\n keyboardActive = true;\n },\n { capture: true },\n);\n\nwindow.addEventListener(\n 'mousedown',\n () => {\n keyboardActive = false;\n },\n { capture: true },\n);\n\n/**\n * Returns the actually focused element by traversing shadow\n * trees recursively to ensure it's the leaf element.\n *\n * @return {Element}\n */\nexport function getDeepActiveElement() {\n let host = document.activeElement || document.body;\n while (host.shadowRoot && host.shadowRoot.activeElement) {\n host = host.shadowRoot.activeElement;\n }\n return host;\n}\n\n/**\n * Returns true if the window has received a keydown\n * event since the last mousedown event.\n *\n * @return {boolean}\n */\nexport function isKeyboardActive() {\n return keyboardActive;\n}\n\n/**\n * Returns true if the element is hidden directly with `display: none` or `visibility: hidden`,\n * false otherwise.\n *\n * The method doesn't traverse the element's ancestors, it only checks for the CSS properties\n * set directly to or inherited by the element.\n *\n * @param {HTMLElement} element\n * @return {boolean}\n */\nfunction isElementHiddenDirectly(element) {\n // Check inline style first to save a re-flow.\n const style = element.style;\n if (style.visibility === 'hidden' || style.display === 'none') {\n return true;\n }\n\n const computedStyle = window.getComputedStyle(element);\n if (computedStyle.visibility === 'hidden' || computedStyle.display === 'none') {\n return true;\n }\n\n return false;\n}\n\n/**\n * Returns if element `a` has lower tab order compared to element `b`\n * (both elements are assumed to be focusable and tabbable).\n * Elements with tabindex = 0 have lower tab order compared to elements\n * with tabindex > 0.\n * If both have same tabindex, it returns false.\n *\n * @param {HTMLElement} a\n * @param {HTMLElement} b\n * @return {boolean}\n */\nfunction hasLowerTabOrder(a, b) {\n // Normalize tabIndexes\n // e.g. in Firefox `<div contenteditable>` has `tabIndex = -1`\n const ati = Math.max(a.tabIndex, 0);\n const bti = Math.max(b.tabIndex, 0);\n return ati === 0 || bti === 0 ? bti > ati : ati > bti;\n}\n\n/**\n * Merge sort iterator, merges the two arrays into one, sorted by tabindex.\n *\n * @param {HTMLElement[]} left\n * @param {HTMLElement[]} right\n * @return {HTMLElement[]}\n */\nfunction mergeSortByTabIndex(left, right) {\n const result = [];\n while (left.length > 0 && right.length > 0) {\n if (hasLowerTabOrder(left[0], right[0])) {\n result.push(right.shift());\n } else {\n result.push(left.shift());\n }\n }\n\n return result.concat(left, right);\n}\n\n/**\n * Sorts an array of elements by tabindex. Returns a new array.\n *\n * @param {HTMLElement[]} elements\n * @return {HTMLElement[]}\n */\nfunction sortElementsByTabIndex(elements) {\n // Implement a merge sort as Array.prototype.sort does a non-stable sort\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n const len = elements.length;\n if (len < 2) {\n return elements;\n }\n const pivot = Math.ceil(len / 2);\n const left = sortElementsByTabIndex(elements.slice(0, pivot));\n const right = sortElementsByTabIndex(elements.slice(pivot));\n\n return mergeSortByTabIndex(left, right);\n}\n\n/**\n * Returns true if the element is hidden, false otherwise.\n *\n * An element is treated as hidden when any of the following conditions are met:\n * - the element itself or one of its ancestors has `display: none`.\n * - the element has or inherits `visibility: hidden`.\n *\n * @param {HTMLElement} element\n * @return {boolean}\n */\nexport function isElementHidden(element) {\n // `offsetParent` is `null` when the element itself\n // or one of its ancestors is hidden with `display: none`.\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent\n // However `offsetParent` is also null when the element is using fixed\n // positioning, so additionally check if the element takes up layout space.\n if (element.offsetParent === null && element.clientWidth === 0 && element.clientHeight === 0) {\n return true;\n }\n\n return isElementHiddenDirectly(element);\n}\n\n/**\n * Returns true if the element is focusable, otherwise false.\n *\n * The list of focusable elements is taken from http://stackoverflow.com/a/1600194/4228703.\n * However, there isn't a definite list, it's up to the browser.\n * The only standard we have is DOM Level 2 HTML https://www.w3.org/TR/DOM-Level-2-HTML/html.html,\n * according to which the only elements that have a `focus()` method are:\n * - HTMLInputElement\n * - HTMLSelectElement\n * - HTMLTextAreaElement\n * - HTMLAnchorElement\n *\n * This notably omits HTMLButtonElement and HTMLAreaElement.\n * Referring to these tests with tabbables in different browsers\n * http://allyjs.io/data-tables/focusable.html\n *\n * @param {HTMLElement} element\n * @return {boolean}\n */\nexport function isElementFocusable(element) {\n // The element cannot be focused if its `tabindex` attribute is set to `-1`.\n if (element.matches('[tabindex=\"-1\"]')) {\n return false;\n }\n\n // Elements that cannot be focused if they have a `disabled` attribute.\n if (element.matches('input, select, textarea, button, object')) {\n return element.matches(':not([disabled])');\n }\n\n // Elements that can be focused even if they have a `disabled` attribute.\n return element.matches('a[href], area[href], iframe, [tabindex], [contentEditable]');\n}\n\n/**\n * Returns true if the element is focused, false otherwise.\n *\n * @param {HTMLElement} element\n * @return {boolean}\n */\nexport function isElementFocused(element) {\n return element.getRootNode().activeElement === element;\n}\n\n/**\n * Returns the normalized element tabindex. If not focusable, returns -1.\n * It checks for the attribute \"tabindex\" instead of the element property\n * `tabIndex` since browsers assign different values to it.\n * e.g. in Firefox `<div contenteditable>` has `tabIndex = -1`\n *\n * @param {HTMLElement} element\n * @return {number}\n */\nfunction normalizeTabIndex(element) {\n if (!isElementFocusable(element)) {\n return -1;\n }\n\n const tabIndex = element.getAttribute('tabindex') || 0;\n return Number(tabIndex);\n}\n\n/**\n * Searches for nodes that are tabbable and adds them to the `result` array.\n * Returns if the `result` array needs to be sorted by tabindex.\n *\n * @param {Node} node The starting point for the search; added to `result` if tabbable.\n * @param {HTMLElement[]} result\n * @return {boolean}\n * @private\n */\nfunction collectFocusableNodes(node, result) {\n if (node.nodeType !== Node.ELEMENT_NODE || isElementHiddenDirectly(node)) {\n // Don't traverse children if the node is not an HTML element or not visible.\n return false;\n }\n\n const element = /** @type {HTMLElement} */ (node);\n const tabIndex = normalizeTabIndex(element);\n let needsSort = tabIndex > 0;\n if (tabIndex >= 0) {\n result.push(element);\n }\n\n let children = [];\n if (element.localName === 'slot') {\n children = element.assignedNodes({ flatten: true });\n } else {\n // Use shadow root if possible, will check for distributed nodes.\n children = (element.shadowRoot || element).children;\n }\n [...children].forEach((child) => {\n // Ensure method is always invoked to collect focusable children.\n needsSort = collectFocusableNodes(child, result) || needsSort;\n });\n return needsSort;\n}\n\n/**\n * Returns a tab-ordered array of focusable elements for a root element.\n * The resulting array will include the root element if it is focusable.\n *\n * The method traverses nodes in shadow DOM trees too if any.\n *\n * @param {HTMLElement} element\n * @return {HTMLElement[]}\n */\nexport function getFocusableElements(element) {\n const focusableElements = [];\n const needsSortByTabIndex = collectFocusableNodes(element, focusableElements);\n // If there is at least one element with tabindex > 0,\n // we need to sort the final array by tabindex.\n if (needsSortByTabIndex) {\n return sortElementsByTabIndex(focusableElements);\n }\n return focusableElements;\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\nexport function defineCustomElement(CustomElement, version = '24.5.7') {\n Object.defineProperty(CustomElement, 'version', {\n get() {\n return version;\n },\n });\n\n const defined = customElements.get(CustomElement.is);\n if (!defined) {\n customElements.define(CustomElement.is, CustomElement);\n } else {\n const definedVersion = defined.version;\n if (definedVersion && CustomElement.version && definedVersion === CustomElement.version) {\n // Just loading the same thing again\n console.warn(`The component ${CustomElement.is} has been loaded twice`);\n } else {\n console.error(\n `Tried to define ${CustomElement.is} version ${CustomElement.version} when version ${defined.version} is already in use. Something will probably break.`,\n );\n }\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Array of Vaadin custom element classes that have been subscribed to the dir changes.\n */\nconst directionSubscribers = [];\n\nfunction alignDirs(element, documentDir, elementDir = element.getAttribute('dir')) {\n if (documentDir) {\n element.setAttribute('dir', documentDir);\n } else if (elementDir != null) {\n element.removeAttribute('dir');\n }\n}\n\nfunction getDocumentDir() {\n return document.documentElement.getAttribute('dir');\n}\n\nfunction directionUpdater() {\n const documentDir = getDocumentDir();\n directionSubscribers.forEach((element) => {\n alignDirs(element, documentDir);\n });\n}\n\nconst directionObserver = new MutationObserver(directionUpdater);\ndirectionObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['dir'] });\n\n/**\n * A mixin to handle `dir` attribute based on the one set on the `<html>` element.\n *\n * @polymerMixin\n */\nexport const DirMixin = (superClass) =>\n class VaadinDirMixin extends superClass {\n static get properties() {\n return {\n /**\n * @protected\n */\n dir: {\n type: String,\n value: '',\n reflectToAttribute: true,\n converter: {\n fromAttribute: (attr) => {\n return !attr ? '' : attr;\n },\n toAttribute: (prop) => {\n return prop === '' ? null : prop;\n },\n },\n },\n };\n }\n\n /**\n * @return {boolean}\n * @protected\n */\n get __isRTL() {\n return this.getAttribute('dir') === 'rtl';\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n\n if (!this.hasAttribute('dir') || this.__restoreSubscription) {\n this.__subscribe();\n alignDirs(this, getDocumentDir(), null);\n }\n }\n\n /** @protected */\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n if (name !== 'dir') {\n return;\n }\n\n const documentDir = getDocumentDir();\n\n // New value equals to the document direction and the element is not subscribed to the changes\n const newValueEqlDocDir = newValue === documentDir && directionSubscribers.indexOf(this) === -1;\n // Value was emptied and the element is not subscribed to the changes\n const newValueEmptied = !newValue && oldValue && directionSubscribers.indexOf(this) === -1;\n // New value is different and the old equals to document direction and the element is not subscribed to the changes\n const newDiffValue = newValue !== documentDir && oldValue === documentDir;\n\n if (newValueEqlDocDir || newValueEmptied) {\n this.__subscribe();\n alignDirs(this, documentDir, newValue);\n } else if (newDiffValue) {\n this.__unsubscribe();\n }\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.__restoreSubscription = directionSubscribers.includes(this);\n this.__unsubscribe();\n }\n\n /** @protected */\n _valueToNodeAttribute(node, value, attribute) {\n // Override default Polymer attribute reflection to match native behavior of HTMLElement.dir property\n // If the property contains an empty string then it should not create an empty attribute\n if (attribute === 'dir' && value === '' && !node.hasAttribute('dir')) {\n return;\n }\n super._valueToNodeAttribute(node, value, attribute);\n }\n\n /** @protected */\n _attributeToProperty(attribute, value, type) {\n // Override default Polymer attribute reflection to match native behavior of HTMLElement.dir property\n // If the attribute is removed, then the dir property should contain an empty string instead of null\n if (attribute === 'dir' && !value) {\n this.dir = '';\n } else {\n super._attributeToProperty(attribute, value, type);\n }\n }\n\n /** @private */\n __subscribe() {\n if (!directionSubscribers.includes(this)) {\n directionSubscribers.push(this);\n }\n }\n\n /** @private */\n __unsubscribe() {\n if (directionSubscribers.includes(this)) {\n directionSubscribers.splice(directionSubscribers.indexOf(this), 1);\n }\n }\n };\n","const appliedClassMixins = new WeakMap();\n\n/** Vefify if the Mixin was previously applyed\n * @private\n * @param {function} mixin Mixin being applyed\n * @param {object} superClass Class receiving the new mixin\n * @returns {boolean}\n */\nfunction wasMixinPreviouslyApplied(mixin, superClass) {\n let klass = superClass;\n while (klass) {\n if (appliedClassMixins.get(klass) === mixin) {\n return true;\n }\n klass = Object.getPrototypeOf(klass);\n }\n return false;\n}\n\n/** Apply each mixin in the chain to make sure they are not applied more than once to the final class.\n * @export\n * @param {function} mixin Mixin to be applyed\n * @returns {object} Mixed class with mixin applied\n */\nexport function dedupeMixin(mixin) {\n return superClass => {\n if (wasMixinPreviouslyApplied(mixin, superClass)) {\n return superClass;\n }\n const mixedClass = mixin(superClass);\n appliedClassMixins.set(mixedClass, mixin);\n return mixedClass;\n };\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { dedupeMixin } from '@open-wc/dedupe-mixin';\nimport { get, set } from './path-utils.js';\n\nconst caseMap = {};\n\nconst CAMEL_TO_DASH = /([A-Z])/gu;\n\nfunction camelToDash(camel) {\n if (!caseMap[camel]) {\n caseMap[camel] = camel.replace(CAMEL_TO_DASH, '-$1').toLowerCase();\n }\n return caseMap[camel];\n}\n\nfunction upper(name) {\n return name[0].toUpperCase() + name.substring(1);\n}\n\nfunction parseObserver(observerString) {\n const [method, rest] = observerString.split('(');\n const observerProps = rest\n .replace(')', '')\n .split(',')\n .map((prop) => prop.trim());\n\n return {\n method,\n observerProps,\n };\n}\n\nfunction getOrCreateMap(obj, name) {\n if (!Object.prototype.hasOwnProperty.call(obj, name)) {\n // Clone any existing entries (superclasses)\n obj[name] = new Map(obj[name]);\n }\n return obj[name];\n}\n\nconst PolylitMixinImplementation = (superclass) => {\n class PolylitMixinClass extends superclass {\n static createProperty(name, options) {\n if ([String, Boolean, Number, Array].includes(options)) {\n options = {\n type: options,\n };\n }\n\n if (options.reflectToAttribute) {\n options.reflect = true;\n }\n\n super.createProperty(name, options);\n }\n\n static getOrCreateMap(name) {\n return getOrCreateMap(this, name);\n }\n\n /**\n * @protected\n * @override\n */\n static finalize() {\n super.finalize();\n\n if (Array.isArray(this.observers)) {\n const complexObservers = this.getOrCreateMap('__complexObservers');\n\n this.observers.forEach((observer) => {\n const { method, observerProps } = parseObserver(observer);\n complexObservers.set(method, observerProps);\n });\n }\n }\n\n static addCheckedInitializer(initializer) {\n super.addInitializer((instance) => {\n // Prevent initializer from affecting superclass\n if (instance instanceof this) {\n initializer(instance);\n }\n });\n }\n\n static getPropertyDescriptor(name, key, options) {\n const defaultDescriptor = super.getPropertyDescriptor(name, key, options);\n\n let result = defaultDescriptor;\n\n // Set the key for this property\n this.getOrCreateMap('__propKeys').set(name, key);\n\n if (options.sync) {\n result = {\n get: defaultDescriptor.get,\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this.requestUpdate(name, oldValue, options);\n\n // Enforce synchronous update\n if (this.hasUpdated) {\n this.performUpdate();\n }\n },\n configurable: true,\n enumerable: true,\n };\n }\n\n if (options.readOnly) {\n const setter = defaultDescriptor.set;\n\n this.addCheckedInitializer((instance) => {\n // This is run during construction of the element\n instance[`_set${upper(name)}`] = function (value) {\n setter.call(instance, value);\n\n if (options.sync) {\n this.performUpdate();\n }\n };\n });\n\n result = {\n get: defaultDescriptor.get,\n set() {\n // Do nothing, property is read-only.\n },\n configurable: true,\n enumerable: true,\n };\n }\n\n if ('value' in options) {\n // Set the default value\n this.addCheckedInitializer((instance) => {\n const value = typeof options.value === 'function' ? options.value.call(instance) : options.value;\n\n if (options.readOnly) {\n instance[`_set${upper(name)}`](value);\n } else {\n instance[name] = value;\n }\n });\n }\n\n if (options.observer) {\n const method = options.observer;\n\n // Set this method\n this.getOrCreateMap('__observers').set(name, method);\n\n this.addCheckedInitializer((instance) => {\n if (!instance[method]) {\n console.warn(`observer method ${method} not defined`);\n }\n });\n }\n\n if (options.notify) {\n if (!this.__notifyProps) {\n this.__notifyProps = new Set();\n // eslint-disable-next-line no-prototype-builtins\n } else if (!this.hasOwnProperty('__notifyProps')) {\n // Clone any existing observers (superclasses)\n const notifyProps = this.__notifyProps;\n this.__notifyProps = new Set(notifyProps);\n }\n\n // Set this method\n this.__notifyProps.add(name);\n }\n\n if (options.computed) {\n const assignComputedMethod = `__assignComputed${name}`;\n const observer = parseObserver(options.computed);\n this.prototype[assignComputedMethod] = function (...props) {\n this[name] = this[observer.method](...props);\n };\n\n this.getOrCreateMap('__complexObservers').set(assignComputedMethod, observer.observerProps);\n }\n\n if (!options.attribute) {\n options.attribute = camelToDash(name);\n }\n\n return result;\n }\n\n /** @protected */\n firstUpdated() {\n super.firstUpdated();\n\n if (!this.$) {\n this.$ = {};\n }\n\n this.renderRoot.querySelectorAll('[id]').forEach((node) => {\n this.$[node.id] = node;\n });\n }\n\n /** @protected */\n ready() {}\n\n /** @protected */\n updated(props) {\n if (this.constructor.__observers) {\n this.__runObservers(props, this.constructor.__observers);\n }\n\n if (this.constructor.__complexObservers) {\n this.__runComplexObservers(props, this.constructor.__complexObservers);\n }\n\n if (this.__dynamicObservers) {\n this.__runComplexObservers(props, this.__dynamicObservers);\n }\n\n if (this.constructor.__notifyProps) {\n this.__runNotifyProps(props, this.constructor.__notifyProps);\n }\n\n if (!this.__isReadyInvoked) {\n this.__isReadyInvoked = true;\n this.ready();\n }\n }\n\n /**\n * Set several properties at once and perform synchronous update.\n * @protected\n */\n setProperties(props) {\n Object.entries(props).forEach(([name, value]) => {\n // Use private key and not setter to not trigger\n // update for properties marked as `sync: true`.\n const key = this.constructor.__propKeys.get(name);\n const oldValue = this[key];\n this[key] = value;\n this.requestUpdate(name, oldValue);\n });\n\n // Perform sync update\n if (this.hasUpdated) {\n this.performUpdate();\n }\n }\n\n /** @protected */\n _createMethodObserver(observer) {\n const dynamicObservers = getOrCreateMap(this, '__dynamicObservers');\n const { method, observerProps } = parseObserver(observer);\n dynamicObservers.set(method, observerProps);\n }\n\n /** @private */\n __runComplexObservers(props, observers) {\n observers.forEach((observerProps, method) => {\n if (observerProps.some((prop) => props.has(prop))) {\n if (!this[method]) {\n console.warn(`observer method ${method} not defined`);\n } else {\n this[method](...observerProps.map((prop) => this[prop]));\n }\n }\n });\n }\n\n /** @private */\n __runObservers(props, observers) {\n props.forEach((v, k) => {\n const observer = observers.get(k);\n if (observer !== undefined && this[observer]) {\n this[observer](this[k], v);\n }\n });\n }\n\n /** @private */\n __runNotifyProps(props, notifyProps) {\n props.forEach((_, k) => {\n if (notifyProps.has(k)) {\n this.dispatchEvent(\n new CustomEvent(`${camelToDash(k)}-changed`, {\n detail: {\n value: this[k],\n },\n }),\n );\n }\n });\n }\n\n /** @protected */\n _get(path, object) {\n return get(path, object);\n }\n\n /** @protected */\n _set(path, value, object) {\n set(path, value, object);\n }\n }\n\n return PolylitMixinClass;\n};\n\nexport const PolylitMixin = dedupeMixin(PolylitMixinImplementation);\n","/**\n * @license\n * Copyright (c) 2023 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Convenience method for reading a value from a path.\n *\n * @param {string} path\n * @param {object} object\n */\nexport function get(path, object) {\n return path.split('.').reduce((obj, property) => (obj ? obj[property] : undefined), object);\n}\n\n/**\n * Convenience method for setting a value to a path.\n *\n * @param {string} path\n * @param {unknown} value\n * @param {object} object\n */\nexport function set(path, value, object) {\n const pathParts = path.split('.');\n const lastPart = pathParts.pop();\n const target = pathParts.reduce((target, part) => target[part], object);\n target[lastPart] = value;\n}\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { css } from 'lit';\n\nexport const overlayStyles = css`\n :host {\n z-index: 200;\n position: fixed;\n\n /* Despite of what the names say, <vaadin-overlay> is just a container\n for position/sizing/alignment. The actual overlay is the overlay part. */\n\n /* Default position constraints: the entire viewport. Note: themes can\n override this to introduce gaps between the overlay and the viewport. */\n inset: 0;\n bottom: var(--vaadin-overlay-viewport-bottom);\n\n /* Use flexbox alignment for the overlay part. */\n display: flex;\n flex-direction: column; /* makes dropdowns sizing easier */\n /* Align to center by default. */\n align-items: center;\n justify-content: center;\n\n /* Allow centering when max-width/max-height applies. */\n margin: auto;\n\n /* The host is not clickable, only the overlay part is. */\n pointer-events: none;\n\n /* Remove tap highlight on touch devices. */\n -webkit-tap-highlight-color: transparent;\n\n /* CSS API for host */\n --vaadin-overlay-viewport-bottom: 0;\n }\n\n :host([hidden]),\n :host(:not([opened]):not([closing])),\n :host(:not([opened]):not([closing])) [part='overlay'] {\n display: none !important;\n }\n\n [part='overlay'] {\n -webkit-overflow-scrolling: touch;\n overflow: auto;\n pointer-events: auto;\n\n /* Prevent overflowing the host */\n max-width: 100%;\n box-sizing: border-box;\n\n -webkit-tap-highlight-color: initial; /* reenable tap highlight inside */\n }\n\n [part='backdrop'] {\n z-index: -1;\n content: '';\n background: rgba(0, 0, 0, 0.5);\n position: fixed;\n inset: 0;\n pointer-events: auto;\n }\n`;\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n/**\n * @polymerMixin\n */\nexport const ThemePropertyMixin = (superClass) =>\n class VaadinThemePropertyMixin extends superClass {\n static get properties() {\n return {\n /**\n * Helper property with theme attribute value facilitating propagation\n * in shadow DOM.\n *\n * Enables the component implementation to propagate the `theme`\n * attribute value to the sub-components in Shadow DOM by binding\n * the sub-component's \"theme\" attribute to the `theme` property of\n * the host.\n *\n * **NOTE:** Extending the mixin only provides the property for binding,\n * and does not make the propagation alone.\n *\n * See [Styling Components: Sub-components](https://vaadin.com/docs/latest/styling/styling-components/#sub-components).\n * page for more information.\n *\n * @protected\n */\n _theme: {\n type: String,\n readOnly: true,\n },\n };\n }\n\n static get observedAttributes() {\n return [...super.observedAttributes, 'theme'];\n }\n\n /** @protected */\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback(name, oldValue, newValue);\n\n if (name === 'theme') {\n this._set_theme(newValue);\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { adoptStyles, css, CSSResult, LitElement, unsafeCSS } from 'lit';\nimport { ThemePropertyMixin } from './vaadin-theme-property-mixin.js';\n\nexport { css, unsafeCSS };\n\n/**\n * @typedef {Object} Theme\n * @property {string} themeFor\n * @property {CSSResult[]} styles\n * @property {string | string[]} [include]\n * @property {string} [moduleId]\n *\n * @typedef {CSSResult[] | CSSResult} CSSResultGroup\n */\n\n/**\n * @type {Theme[]}\n */\nconst themeRegistry = [];\n\n/**\n * @type {WeakRef<HTMLElement>[]}\n */\nconst themableInstances = new Set();\n\n/**\n * @type {string[]}\n */\nconst themableTagNames = new Set();\n\n/**\n * Check if the custom element type has themes applied.\n * @param {Function} elementClass\n * @returns {boolean}\n */\nfunction classHasThemes(elementClass) {\n return elementClass && Object.prototype.hasOwnProperty.call(elementClass, '__themes');\n}\n\n/**\n * Check if the custom element type has themes applied.\n * @param {string} tagName\n * @returns {boolean}\n */\nfunction hasThemes(tagName) {\n return classHasThemes(customElements.get(tagName));\n}\n\n/**\n * Flattens the styles into a single array of styles.\n * @param {CSSResultGroup} styles\n * @param {CSSResult[]} result\n * @returns {CSSResult[]}\n */\nfunction flattenStyles(styles = []) {\n return [styles].flat(Infinity).filter((style) => {\n if (style instanceof CSSResult) {\n return true;\n }\n console.warn('An item in styles is not of type CSSResult. Use `unsafeCSS` or `css`.');\n return false;\n });\n}\n\n/**\n * Returns true if the themeFor string matches the tag name\n * @param {string} themeFor\n * @param {string} tagName\n * @returns {boolean}\n */\nfunction matchesThemeFor(themeFor, tagName) {\n return (themeFor || '').split(' ').some((themeForToken) => {\n return new RegExp(`^${themeForToken.split('*').join('.*')}$`, 'u').test(tagName);\n });\n}\n\n/**\n * Returns the CSS text content from an array of CSSResults\n * @param {CSSResult[]} styles\n * @returns {string}\n */\nfunction getCssText(styles) {\n return styles.map((style) => style.cssText).join('\\n');\n}\n\nconst STYLE_ID = 'vaadin-themable-mixin-style';\n\n/**\n * Includes the styles to the template.\n * @param {CSSResult[]} styles\n * @param {HTMLTemplateElement} template\n */\nfunction addStylesToTemplate(styles, template) {\n const styleEl = document.createElement('style');\n styleEl.id = STYLE_ID;\n styleEl.textContent = getCssText(styles);\n template.content.appendChild(styleEl);\n}\n\n/**\n * Dynamically updates the styles of the given component instance.\n * @param {HTMLElement} instance\n */\nfunction updateInstanceStyles(instance) {\n if (!instance.shadowRoot) {\n return;\n }\n\n const componentClass = instance.constructor;\n\n if (instance instanceof LitElement) {\n // LitElement\n\n // The adoptStyles function may fall back to appending style elements to shadow root.\n // Remove them first to avoid duplicates.\n [...instance.shadowRoot.querySelectorAll('style')].forEach((style) => style.remove());\n\n // Adopt the updated styles\n adoptStyles(instance.shadowRoot, componentClass.elementStyles);\n } else {\n // PolymerElement\n\n // Update style element content in the shadow root\n const style = instance.shadowRoot.getElementById(STYLE_ID);\n const template = componentClass.prototype._template;\n style.textContent = template.content.getElementById(STYLE_ID).textContent;\n }\n}\n\n/**\n * Dynamically updates the styles of the instances matching the given component type.\n * @param {Function} componentClass\n */\nfunction updateInstanceStylesOfType(componentClass) {\n // Iterate over component instances and update their styles if needed\n themableInstances.forEach((ref) => {\n const instance = ref.deref();\n if (instance instanceof componentClass) {\n updateInstanceStyles(instance);\n } else if (!instance) {\n // Clean up the weak reference to a GC'd instance\n themableInstances.delete(ref);\n }\n });\n}\n\n/**\n * Dynamically updates the styles of the given component type.\n * @param {Function} componentClass\n */\nfunction updateComponentStyles(componentClass) {\n if (componentClass.prototype instanceof LitElement) {\n // Update LitElement-based component's elementStyles\n componentClass.elementStyles = componentClass.finalizeStyles(componentClass.styles);\n } else {\n // Update Polymer-based component's template\n const template = componentClass.prototype._template;\n template.content.getElementById(STYLE_ID).textContent = getCssText(componentClass.getStylesForThis());\n }\n\n // Update the styles of inheriting types\n themableTagNames.forEach((inheritingTagName) => {\n const inheritingClass = customElements.get(inheritingTagName);\n if (inheritingClass !== componentClass && inheritingClass.prototype instanceof componentClass) {\n updateComponentStyles(inheritingClass);\n }\n });\n}\n\n/**\n * Check if the component type already has a style matching the given styles.\n *\n * @param {Function} componentClass\n * @param {CSSResultGroup} styles\n * @returns {boolean}\n */\nfunction hasMatchingStyle(componentClass, styles) {\n const themes = componentClass.__themes;\n if (!themes || !styles) {\n return false;\n }\n\n return themes.some((theme) =>\n theme.styles.some((themeStyle) => styles.some((style) => style.cssText === themeStyle.cssText)),\n );\n}\n\n/**\n * Registers CSS styles for a component type. Make sure to register the styles before\n * the first instance of a component of the type is attached to DOM.\n *\n * @param {string} themeFor The local/tag name of the component type to register the styles for\n * @param {CSSResultGroup} styles The CSS style rules to be registered for the component type\n * matching themeFor and included in the local scope of each component instance\n * @param {{moduleId?: string, include?: string | string[]}} options Additional options\n * @return {void}\n */\nexport function registerStyles(themeFor, styles, options = {}) {\n styles = flattenStyles(styles);\n\n if (window.Vaadin && window.Vaadin.styleModules) {\n window.Vaadin.styleModules.registerStyles(themeFor, styles, options);\n } else {\n themeRegistry.push({\n themeFor,\n styles,\n include: options.include,\n moduleId: options.moduleId,\n });\n }\n\n if (themeFor) {\n // Update styles of the component types that match themeFor and have already been finalized\n themableTagNames.forEach((tagName) => {\n if (matchesThemeFor(themeFor, tagName) && hasThemes(tagName)) {\n const componentClass = customElements.get(tagName);\n\n if (hasMatchingStyle(componentClass, styles)) {\n // Show a warning if the component type already has some of the given styles\n console.warn(`Registering styles that already exist for ${tagName}`);\n } else if (!window.Vaadin || !window.Vaadin.suppressPostFinalizeStylesWarning) {\n // Show a warning if the component type has already been finalized\n console.warn(\n `The custom element definition for \"${tagName}\" ` +\n `was finalized before a style module was registered. ` +\n `Ideally, import component specific style modules before ` +\n `importing the corresponding custom element. ` +\n `This warning can be suppressed by setting \"window.Vaadin.suppressPostFinalizeStylesWarning = true\".`,\n );\n }\n\n // Update the styles of the component type\n updateComponentStyles(componentClass);\n // Update the styles of the component instances matching the component type\n updateInstanceStylesOfType(componentClass);\n }\n });\n }\n}\n\n/**\n * Returns all registered themes. By default the themeRegistry is returned as is.\n * In case the style-modules adapter is imported, the themes are obtained from there instead\n * @returns {Theme[]}\n */\nfunction getAllThemes() {\n if (window.Vaadin && window.Vaadin.styleModules) {\n return window.Vaadin.styleModules.getAllThemes();\n }\n return themeRegistry;\n}\n\n/**\n * Maps the moduleName to an include priority number which is used for\n * determining the order in which styles are applied.\n * @param {string} moduleName\n * @returns {number}\n */\nfunction getIncludePriority(moduleName = '') {\n let includePriority = 0;\n if (moduleName.startsWith('lumo-') || moduleName.startsWith('material-')) {\n includePriority = 1;\n } else if (moduleName.startsWith('vaadin-')) {\n includePriority = 2;\n }\n return includePriority;\n}\n\n/**\n * Gets an array of CSSResults matching the include property of the theme.\n * @param {Theme} theme\n * @returns {CSSResult[]}\n */\nfunction getIncludedStyles(theme) {\n const includedStyles = [];\n if (theme.include) {\n [].concat(theme.include).forEach((includeModuleId) => {\n const includedTheme = getAllThemes().find((s) => s.moduleId === includeModuleId);\n if (includedTheme) {\n includedStyles.push(...getIncludedStyles(includedTheme), ...includedTheme.styles);\n } else {\n console.warn(`Included moduleId ${includeModuleId} not found in style registry`);\n }\n }, theme.styles);\n }\n return includedStyles;\n}\n\n/**\n * Returns an array of themes that should be used for styling a component matching\n * the tag name. The array is sorted by the include order.\n * @param {string} tagName\n * @returns {Theme[]}\n */\nfunction getThemes(tagName) {\n const defaultModuleName = `${tagName}-default-theme`;\n\n const themes = getAllThemes()\n // Filter by matching themeFor properties\n .filter((theme) => theme.moduleId !== defaultModuleName && matchesThemeFor(theme.themeFor, tagName))\n .map((theme) => ({\n ...theme,\n // Prepend styles from included themes\n styles: [...getIncludedStyles(theme), ...theme.styles],\n // Map moduleId to includePriority\n includePriority: getIncludePriority(theme.moduleId),\n }))\n // Sort by includePriority\n .sort((themeA, themeB) => themeB.includePriority - themeA.includePriority);\n\n if (themes.length > 0) {\n return themes;\n }\n // No theme modules found, return the default module if it exists\n return getAllThemes().filter((theme) => theme.moduleId === defaultModuleName);\n}\n\n/**\n * @polymerMixin\n * @mixes ThemePropertyMixin\n */\nexport const ThemableMixin = (superClass) =>\n class VaadinThemableMixin extends ThemePropertyMixin(superClass) {\n constructor() {\n super();\n // Store a weak reference to the instance\n themableInstances.add(new WeakRef(this));\n }\n\n /**\n * Covers PolymerElement based component styling\n * @protected\n */\n static finalize() {\n super.finalize();\n\n if (this.is) {\n themableTagNames.add(this.is);\n }\n\n // Make sure not to run the logic intended for PolymerElement when LitElement is used.\n if (this.elementStyles) {\n return;\n }\n\n const template = this.prototype._template;\n if (!template || classHasThemes(this)) {\n return;\n }\n\n addStylesToTemplate(this.getStylesForThis(), template);\n }\n\n /**\n * Covers LitElement based component styling\n *\n * @protected\n */\n static finalizeStyles(styles) {\n // The \"styles\" object originates from the \"static get styles()\" function of\n // a LitElement based component. The theme styles are added after it\n // so that they can override the component styles.\n const themeStyles = this.getStylesForThis();\n return styles ? [...[styles].flat(Infinity), ...themeStyles] : themeStyles;\n }\n\n /**\n * Get styles for the component type\n *\n * @private\n */\n static getStylesForThis() {\n const superClassThemes = superClass.__themes || [];\n const parent = Object.getPrototypeOf(this.prototype);\n const inheritedThemes = (parent ? parent.constructor.__themes : []) || [];\n this.__themes = [...superClassThemes, ...inheritedThemes, ...getThemes(this.is)];\n const themeStyles = this.__themes.flatMap((theme) => theme.styles);\n // Remove duplicates\n return themeStyles.filter((style, index) => index === themeStyles.lastIndexOf(style));\n }\n };\n\nexport { themeRegistry as __themeRegistry };\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\nconst testUserAgent = (regexp) => regexp.test(navigator.userAgent);\n\nconst testPlatform = (regexp) => regexp.test(navigator.platform);\n\nconst testVendor = (regexp) => regexp.test(navigator.vendor);\n\nexport const isAndroid = testUserAgent(/Android/u);\n\nexport const isChrome = testUserAgent(/Chrome/u) && testVendor(/Google Inc/u);\n\nexport const isFirefox = testUserAgent(/Firefox/u);\n\n// IPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.\nexport const isIPad = testPlatform(/^iPad/u) || (testPlatform(/^Mac/u) && navigator.maxTouchPoints > 1);\n\nexport const isIPhone = testPlatform(/^iPhone/u);\n\nexport const isIOS = isIPhone || isIPad;\n\nexport const isSafari = testUserAgent(/^((?!chrome|android).)*safari/iu);\n\nexport const isTouch = (() => {\n try {\n document.createEvent('TouchEvent');\n return true;\n } catch (_) {\n return false;\n }\n})();\n","/**\n * @license\n * Copyright (c) 2017 Anton Korzunov\n * SPDX-License-Identifier: MIT\n */\n\n/**\n * @fileoverview\n *\n * This module includes JS code copied from the `aria-hidden` package:\n * https://github.com/theKashey/aria-hidden/blob/master/src/index.ts\n */\n\n/** @type {WeakMap<Element, number>} */\nlet counterMap = new WeakMap();\n\n/** @type {WeakMap<Element, boolean>} */\nlet uncontrolledNodes = new WeakMap();\n\n/** @type {Record<string, WeakMap<Element, number>>} */\nlet markerMap = {};\n\n/** @type {number} */\nlet lockCount = 0;\n\n/**\n * @param {?Node} node\n * @return {boolean}\n */\nconst isElement = (node) => node && node.nodeType === Node.ELEMENT_NODE;\n\n/**\n * @param {...unknown} args\n */\nconst logError = (...args) => {\n console.error(`Error: ${args.join(' ')}. Skip setting aria-hidden.`);\n};\n\n/**\n * @param {HTMLElement} parent\n * @param {Element[]} targets\n * @return {Element[]}\n */\nconst correctTargets = (parent, targets) => {\n if (!isElement(parent)) {\n logError(parent, 'is not a valid element');\n return [];\n }\n\n return targets\n .map((target) => {\n if (!isElement(target)) {\n logError(target, 'is not a valid element');\n return null;\n }\n\n let node = target;\n while (node && node !== parent) {\n if (parent.contains(node)) {\n return target;\n }\n node = node.getRootNode().host;\n }\n\n logError(target, 'is not contained inside', parent);\n return null;\n })\n .filter((x) => Boolean(x));\n};\n\n/**\n * Marks everything except given node(or nodes) as aria-hidden\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param {HTMLElement} [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @param {String} [controlAttribute] - html Attribute to control\n * @return {Function}\n */\nconst applyAttributeToOthers = (originalTarget, parentNode, markerName, controlAttribute) => {\n const targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);\n\n if (!markerMap[markerName]) {\n markerMap[markerName] = new WeakMap();\n }\n\n const markerCounter = markerMap[markerName];\n\n /** @type {Element[]} */\n const hiddenNodes = [];\n\n /** @type {Set<Node>} */\n const elementsToKeep = new Set();\n\n /** @type {Set<Node>} */\n const elementsToStop = new Set(targets);\n\n /**\n * @param {?Node} el\n */\n const keep = (el) => {\n if (!el || elementsToKeep.has(el)) {\n return;\n }\n\n elementsToKeep.add(el);\n\n const slot = el.assignedSlot;\n if (slot) {\n keep(slot);\n }\n\n keep(el.parentNode || el.host);\n };\n\n targets.forEach(keep);\n\n /**\n * @param {?Node} el\n */\n const deep = (parent) => {\n if (!parent || elementsToStop.has(parent)) {\n return;\n }\n\n const root = parent.shadowRoot;\n const children = root ? [...parent.children, ...root.children] : [...parent.children];\n children.forEach((node) => {\n // Skip elements that don't need to be hidden\n if (['template', 'script', 'style'].includes(node.localName)) {\n return;\n }\n\n if (elementsToKeep.has(node)) {\n deep(node);\n } else {\n const attr = node.getAttribute(controlAttribute);\n const alreadyHidden = attr !== null && attr !== 'false';\n const counterValue = (counterMap.get(node) || 0) + 1;\n const markerValue = (markerCounter.get(node) || 0) + 1;\n\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n hiddenNodes.push(node);\n\n if (counterValue === 1 && alreadyHidden) {\n uncontrolledNodes.set(node, true);\n }\n\n if (markerValue === 1) {\n node.setAttribute(markerName, 'true');\n }\n\n if (!alreadyHidden) {\n node.setAttribute(controlAttribute, 'true');\n }\n }\n });\n };\n\n deep(parentNode);\n\n elementsToKeep.clear();\n\n lockCount += 1;\n\n return () => {\n hiddenNodes.forEach((node) => {\n const counterValue = counterMap.get(node) - 1;\n const markerValue = markerCounter.get(node) - 1;\n\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n\n if (!counterValue) {\n if (uncontrolledNodes.has(node)) {\n uncontrolledNodes.delete(node);\n } else {\n node.removeAttribute(controlAttribute);\n }\n }\n\n if (!markerValue) {\n node.removeAttribute(markerName);\n }\n });\n\n lockCount -= 1;\n\n if (!lockCount) {\n // clear\n counterMap = new WeakMap();\n counterMap = new WeakMap();\n uncontrolledNodes = new WeakMap();\n markerMap = {};\n }\n };\n};\n\n/**\n * Marks everything except given node(or nodes) as aria-hidden\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param {HTMLElement} [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Function} undo command\n */\nexport const hideOthers = (originalTarget, parentNode = document.body, markerName = 'data-aria-hidden') => {\n const targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);\n\n if (parentNode) {\n // We should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10\n targets.push(...Array.from(parentNode.querySelectorAll('[aria-live]')));\n }\n\n return applyAttributeToOthers(targets, parentNode, markerName, 'aria-hidden');\n};\n\n/**\n * Marks everything except given node(or nodes) as inert\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param {HTMLElement} [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Function} undo command\n */\nexport const inertOthers = (originalTarget, parentNode = document.body, markerName = 'data-inert-ed') => {\n return applyAttributeToOthers(originalTarget, parentNode, markerName, 'inert');\n};\n\n/**\n * @return if current browser supports inert\n */\nexport const supportsInert = 'inert' in HTMLElement.prototype;\n\n/**\n * Automatic function to \"suppress\" DOM elements - _hide_ or _inert_ in the best possible way\n * @param {Element | Element[]} originalTarget - elements to keep on the page\n * @param {HTMLElement} [parentNode] - top element, defaults to document.body\n * @param {String} [markerName] - a special attribute to mark every node\n * @return {Function} undo command\n */\nexport const suppressOthers = (originalTarget, parentNode, markerName) =>\n (supportsInert ? inertOthers : hideOthers)(originalTarget, parentNode, markerName);\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { hideOthers } from './aria-hidden.js';\n\n/**\n * A controller for handling modal state on the elements with `dialog` and `alertdialog` role.\n * See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-modal\n *\n * Note, the actual `role` and `aria-modal` attributes are supposed to be handled by the\n * consumer web component. This is done in to ensure the controller only does one thing.\n */\nexport class AriaModalController {\n /**\n * @param {HTMLElement} host\n */\n constructor(host, callback) {\n /**\n * The controller host element.\n *\n * @type {HTMLElement}\n */\n this.host = host;\n\n /**\n * The callback used to detect which element\n * to use as a target. Defaults to the host.\n *\n * @type {Function}\n */\n this.callback = typeof callback === 'function' ? callback : () => host;\n }\n\n /**\n * Make the controller host modal by hiding other elements from screen readers\n * using `aria-hidden` attribute (can be replaced with `inert` in the future).\n *\n * The method name is chosen to align with the one provided by native `<dialog>`:\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal\n */\n showModal() {\n const targets = this.callback();\n this.__showOthers = hideOthers(targets);\n }\n\n /**\n * Remove `aria-hidden` from other elements unless there are any other\n * controller hosts on the page activated by using `showModal()` call.\n */\n close() {\n if (this.__showOthers) {\n this.__showOthers();\n this.__showOthers = null;\n }\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { getDeepActiveElement } from './focus-utils.js';\n\n/**\n * A controller for saving a focused node and restoring focus to it later.\n */\nexport class FocusRestorationController {\n /**\n * Saves the given node as a target for restoring focus to\n * when `restoreFocus()` is called. If no node is provided,\n * the currently focused node in the DOM is saved as a target.\n *\n * @param {Node | null | undefined} focusNode\n */\n saveFocus(focusNode) {\n this.focusNode = focusNode || getDeepActiveElement();\n }\n\n /**\n * Restores focus to the target node that was saved previously with `saveFocus()`.\n */\n restoreFocus(options) {\n const focusNode = this.focusNode;\n if (!focusNode) {\n return;\n }\n\n const preventScroll = options ? options.preventScroll : false;\n\n if (getDeepActiveElement() === document.body) {\n // In Firefox and Safari, focusing the node synchronously\n // doesn't work as expected when the overlay is closing on outside click.\n // These browsers force focus to move to the body element and retain it\n // there until the next event loop iteration.\n setTimeout(() => focusNode.focus({ preventScroll }));\n } else {\n focusNode.focus({ preventScroll });\n }\n\n this.focusNode = null;\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { getFocusableElements, isElementFocused } from './focus-utils.js';\n\nconst instances = [];\n\n/**\n * A controller for trapping focus within a DOM node.\n */\nexport class FocusTrapController {\n /**\n * @param {HTMLElement} host\n */\n constructor(host) {\n /**\n * The controller host element.\n *\n * @type {HTMLElement}\n */\n this.host = host;\n\n /**\n * A node for trapping focus in.\n *\n * @type {HTMLElement | null}\n * @private\n */\n this.__trapNode = null;\n\n this.__onKeyDown = this.__onKeyDown.bind(this);\n }\n\n /**\n * An array of tab-ordered focusable elements inside the trap node.\n *\n * @return {HTMLElement[]}\n * @private\n */\n get __focusableElements() {\n return getFocusableElements(this.__trapNode);\n }\n\n /**\n * The index of the element inside the trap node that currently has focus.\n *\n * @return {HTMLElement | undefined}\n * @private\n */\n get __focusedElementIndex() {\n const focusableElements = this.__focusableElements;\n return focusableElements.indexOf(focusableElements.filter(isElementFocused).pop());\n }\n\n hostConnected() {\n document.addEventListener('keydown', this.__onKeyDown);\n }\n\n hostDisconnected() {\n document.removeEventListener('keydown', this.__onKeyDown);\n }\n\n /**\n * Activates a focus trap for a DOM node that will prevent focus from escaping the node.\n * The trap can be deactivated with the `.releaseFocus()` method.\n *\n * If focus is initially outside the trap, the method will move focus inside,\n * on the first focusable element of the trap in the tab order.\n * The first focusable element can be the trap node itself if it is focusable\n * and comes first in the tab order.\n *\n * If there are no focusable elements, the method will throw an exception\n * and the trap will not be set.\n *\n * @param {HTMLElement} trapNode\n */\n trapFocus(trapNode) {\n this.__trapNode = trapNode;\n\n if (this.__focusableElements.length === 0) {\n this.__trapNode = null;\n throw new Error('The trap node should have at least one focusable descendant or be focusable itself.');\n }\n\n instances.push(this);\n\n if (this.__focusedElementIndex === -1) {\n this.__focusableElements[0].focus();\n }\n }\n\n /**\n * Deactivates the focus trap set with the `.trapFocus()` method\n * so that it becomes possible to tab outside the trap node.\n */\n releaseFocus() {\n this.__trapNode = null;\n\n instances.pop();\n }\n\n /**\n * A `keydown` event handler that manages tabbing navigation when the trap is enabled.\n *\n * - Moves focus to the next focusable element of the trap on `Tab` press.\n * When no next element to focus, the method moves focus to the first focusable element.\n * - Moves focus to the prev focusable element of the trap on `Shift+Tab` press.\n * When no prev element to focus, the method moves focus to the last focusable element.\n *\n * @param {KeyboardEvent} event\n * @private\n */\n __onKeyDown(event) {\n if (!this.__trapNode) {\n return;\n }\n\n // Only handle events for the last instance\n if (this !== Array.from(instances).pop()) {\n return;\n }\n\n if (event.key === 'Tab') {\n event.preventDefault();\n\n const backward = event.shiftKey;\n this.__focusNextElement(backward);\n }\n }\n\n /**\n * - Moves focus to the next focusable element if `backward === false`.\n * When no next element to focus, the method moves focus to the first focusable element.\n * - Moves focus to the prev focusable element if `backward === true`.\n * When no prev element to focus the method moves focus to the last focusable element.\n *\n * If no focusable elements, the method returns immediately.\n *\n * @param {boolean} backward\n * @private\n */\n __focusNextElement(backward = false) {\n const focusableElements = this.__focusableElements;\n const step = backward ? -1 : 1;\n const currentIndex = this.__focusedElementIndex;\n const nextIndex = (focusableElements.length + currentIndex + step) % focusableElements.length;\n const element = focusableElements[nextIndex];\n element.focus();\n if (element.localName === 'input') {\n element.select();\n }\n }\n}\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';\n\n/**\n * @typedef ReactiveController\n * @type {import('lit').ReactiveController}\n */\n\n/**\n * A mixin for connecting controllers to the element.\n *\n * @polymerMixin\n */\nexport const ControllerMixin = dedupingMixin((superClass) => {\n // If the superclass extends from LitElement,\n // use its own controllers implementation.\n if (typeof superClass.prototype.addController === 'function') {\n return superClass;\n }\n\n return class ControllerMixinClass extends superClass {\n constructor() {\n super();\n\n /**\n * @type {Set<ReactiveController>}\n */\n this.__controllers = new Set();\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n\n this.__controllers.forEach((c) => {\n if (c.hostConnected) {\n c.hostConnected();\n }\n });\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.__controllers.forEach((c) => {\n if (c.hostDisconnected) {\n c.hostDisconnected();\n }\n });\n }\n\n /**\n * Registers a controller to participate in the element update cycle.\n *\n * @param {ReactiveController} controller\n * @protected\n */\n addController(controller) {\n this.__controllers.add(controller);\n // Call hostConnected if a controller is added after the element is attached.\n if (this.$ !== undefined && this.isConnected && controller.hostConnected) {\n controller.hostConnected();\n }\n }\n\n /**\n * Removes a controller from the element.\n *\n * @param {ReactiveController} controller\n * @protected\n */\n removeController(controller) {\n this.__controllers.delete(controller);\n }\n };\n});\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { AriaModalController } from '@vaadin/a11y-base/src/aria-modal-controller.js';\nimport { FocusRestorationController } from '@vaadin/a11y-base/src/focus-restoration-controller.js';\nimport { FocusTrapController } from '@vaadin/a11y-base/src/focus-trap-controller.js';\nimport { getDeepActiveElement, isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';\nimport { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';\n\n/**\n * @polymerMixin\n * @mixes ControllerMixin\n */\nexport const OverlayFocusMixin = (superClass) =>\n class OverlayFocusMixin extends ControllerMixin(superClass) {\n static get properties() {\n return {\n /**\n * When true, opening the overlay moves focus to the first focusable child,\n * or to the overlay part with tabindex if there are no focusable children.\n * @attr {boolean} focus-trap\n */\n focusTrap: {\n type: Boolean,\n value: false,\n },\n\n /**\n * Set to true to enable restoring of focus when overlay is closed.\n * @attr {boolean} restore-focus-on-close\n */\n restoreFocusOnClose: {\n type: Boolean,\n value: false,\n },\n\n /**\n * Set to specify the element which should be focused on overlay close,\n * if `restoreFocusOnClose` is set to true.\n * @type {HTMLElement}\n */\n restoreFocusNode: {\n type: HTMLElement,\n },\n };\n }\n\n constructor() {\n super();\n\n this.__ariaModalController = new AriaModalController(this);\n this.__focusTrapController = new FocusTrapController(this);\n this.__focusRestorationController = new FocusRestorationController();\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this.addController(this.__ariaModalController);\n this.addController(this.__focusTrapController);\n this.addController(this.__focusRestorationController);\n }\n\n /**\n * Release focus and restore focus after the overlay is closed.\n *\n * @protected\n */\n _resetFocus() {\n if (this.focusTrap) {\n this.__ariaModalController.close();\n this.__focusTrapController.releaseFocus();\n }\n\n if (this.restoreFocusOnClose && this._shouldRestoreFocus()) {\n const preventScroll = !isKeyboardActive();\n this.__focusRestorationController.restoreFocus({ preventScroll });\n }\n }\n\n /**\n * Save the previously focused node when the overlay starts to open.\n *\n * @protected\n */\n _saveFocus() {\n if (this.restoreFocusOnClose) {\n this.__focusRestorationController.saveFocus(this.restoreFocusNode);\n }\n }\n\n /**\n * Trap focus within the overlay after opening has completed.\n *\n * @protected\n */\n _trapFocus() {\n if (this.focusTrap) {\n this.__ariaModalController.showModal();\n this.__focusTrapController.trapFocus(this.$.overlay);\n }\n }\n\n /**\n * Returns true if focus is still inside the overlay or on the body element,\n * otherwise false.\n *\n * Focus shouldn't be restored if it's been moved elsewhere by another\n * component or as a result of a user interaction e.g. the user clicked\n * on a button outside the overlay while the overlay was open.\n *\n * @protected\n * @return {boolean}\n */\n _shouldRestoreFocus() {\n const activeElement = getDeepActiveElement();\n return activeElement === document.body || this._deepContains(activeElement);\n }\n\n /**\n * Returns true if the overlay contains the given node,\n * including those within shadow DOM trees.\n *\n * @param {Node} node\n * @return {boolean}\n * @protected\n */\n _deepContains(node) {\n if (this.contains(node)) {\n return true;\n }\n let n = node;\n const doc = node.ownerDocument;\n // Walk from node to `this` or `document`\n while (n && n !== doc && n !== this) {\n n = n.parentNode || n.host;\n }\n return n === this;\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Returns all attached overlays in visual stacking order.\n * @private\n */\nconst getAttachedInstances = () =>\n Array.from(document.body.children)\n .filter((el) => el instanceof HTMLElement && el._hasOverlayStackMixin && !el.hasAttribute('closing'))\n .sort((a, b) => a.__zIndex - b.__zIndex || 0);\n\n/**\n * Returns all attached overlay instances excluding notification container,\n * which only needs to be in the stack for zIndex but not pointer-events.\n * @private\n */\nconst getOverlayInstances = () => getAttachedInstances().filter((el) => el.$.overlay);\n\n/**\n * Returns true if the overlay is the last one in the opened overlays stack.\n * @param {HTMLElement} overlay\n * @return {boolean}\n * @protected\n */\nexport const isLastOverlay = (overlay) => overlay === getOverlayInstances().pop();\n\n/**\n * @polymerMixin\n */\nexport const OverlayStackMixin = (superClass) =>\n class OverlayStackMixin extends superClass {\n constructor() {\n super();\n\n this._hasOverlayStackMixin = true;\n }\n\n /**\n * Returns true if this is the last one in the opened overlays stack.\n *\n * @return {boolean}\n * @protected\n */\n get _last() {\n return isLastOverlay(this);\n }\n\n /**\n * Brings the overlay as visually the frontmost one.\n */\n bringToFront() {\n let zIndex = '';\n const frontmost = getAttachedInstances()\n .filter((o) => o !== this)\n .pop();\n if (frontmost) {\n const frontmostZIndex = frontmost.__zIndex;\n zIndex = frontmostZIndex + 1;\n }\n this.style.zIndex = zIndex;\n this.__zIndex = zIndex || parseFloat(getComputedStyle(this).zIndex);\n }\n\n /** @protected */\n _enterModalState() {\n if (document.body.style.pointerEvents !== 'none') {\n // Set body pointer-events to 'none' to disable mouse interactions with\n // other document nodes.\n this._previousDocumentPointerEvents = document.body.style.pointerEvents;\n document.body.style.pointerEvents = 'none';\n }\n\n // Disable pointer events in other attached overlays\n getOverlayInstances().forEach((el) => {\n if (el !== this) {\n el.$.overlay.style.pointerEvents = 'none';\n }\n });\n }\n\n /** @protected */\n _exitModalState() {\n if (this._previousDocumentPointerEvents !== undefined) {\n // Restore body pointer-events\n document.body.style.pointerEvents = this._previousDocumentPointerEvents;\n delete this._previousDocumentPointerEvents;\n }\n\n // Restore pointer events in the previous overlay(s)\n const instances = getOverlayInstances();\n\n let el;\n // Use instances.pop() to ensure the reverse order\n while ((el = instances.pop())) {\n if (el === this) {\n // Skip the current instance\n continue;\n }\n el.$.overlay.style.removeProperty('pointer-events');\n if (!el.modeless) {\n // Stop after the last modal\n break;\n }\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';\nimport { isIOS } from '@vaadin/component-base/src/browser-utils.js';\nimport { OverlayFocusMixin } from './vaadin-overlay-focus-mixin.js';\nimport { OverlayStackMixin } from './vaadin-overlay-stack-mixin.js';\n\n/**\n * @polymerMixin\n * @mixes OverlayFocusMixin\n * @mixes OverlayStackMixin\n */\nexport const OverlayMixin = (superClass) =>\n class OverlayMixin extends OverlayFocusMixin(OverlayStackMixin(superClass)) {\n static get properties() {\n return {\n /**\n * When true, the overlay is visible and attached to body.\n */\n opened: {\n type: Boolean,\n notify: true,\n observer: '_openedChanged',\n reflectToAttribute: true,\n },\n\n /**\n * Owner element passed with renderer function\n * @type {HTMLElement}\n */\n owner: {\n type: Object,\n },\n\n /**\n * Object with properties that is passed to `renderer` function\n */\n model: {\n type: Object,\n },\n\n /**\n * Custom function for rendering the content of the overlay.\n * Receives three arguments:\n *\n * - `root` The root container DOM element. Append your content to it.\n * - `owner` The host element of the renderer function.\n * - `model` The object with the properties related with rendering.\n * @type {OverlayRenderer | null | undefined}\n */\n renderer: {\n type: Object,\n },\n\n /**\n * When true the overlay won't disable the main content, showing\n * it doesn't change the functionality of the user interface.\n * @type {boolean}\n */\n modeless: {\n type: Boolean,\n value: false,\n reflectToAttribute: true,\n observer: '_modelessChanged',\n },\n\n /**\n * When set to true, the overlay is hidden. This also closes the overlay\n * immediately in case there is a closing animation in progress.\n * @type {boolean}\n */\n hidden: {\n type: Boolean,\n reflectToAttribute: true,\n observer: '_hiddenChanged',\n },\n\n /**\n * When true the overlay has backdrop on top of content when opened.\n * @type {boolean}\n */\n withBackdrop: {\n type: Boolean,\n value: false,\n reflectToAttribute: true,\n },\n };\n }\n\n static get observers() {\n return ['_rendererOrDataChanged(renderer, owner, model, opened)'];\n }\n\n constructor() {\n super();\n\n this._boundMouseDownListener = this._mouseDownListener.bind(this);\n this._boundMouseUpListener = this._mouseUpListener.bind(this);\n this._boundOutsideClickListener = this._outsideClickListener.bind(this);\n this._boundKeydownListener = this._keydownListener.bind(this);\n\n /* c8 ignore next 3 */\n if (isIOS) {\n this._boundIosResizeListener = () => this._detectIosNavbar();\n }\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n // Need to add dummy click listeners to this and the backdrop or else\n // the document click event listener (_outsideClickListener) may never\n // get invoked on iOS Safari (reproducible in <vaadin-dialog>\n // and <vaadin-context-menu>).\n this.addEventListener('click', () => {});\n this.$.backdrop.addEventListener('click', () => {});\n\n this.addEventListener('mouseup', () => {\n // In Chrome, focus moves to body on overlay content mousedown\n // See https://github.com/vaadin/flow-components/issues/5507\n if (document.activeElement === document.body && this.$.overlay.getAttribute('tabindex') === '0') {\n this.$.overlay.focus();\n }\n });\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n\n /* c8 ignore next 3 */\n if (this._boundIosResizeListener) {\n this._detectIosNavbar();\n window.addEventListener('resize', this._boundIosResizeListener);\n }\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n\n /* c8 ignore next 3 */\n if (this._boundIosResizeListener) {\n window.removeEventListener('resize', this._boundIosResizeListener);\n }\n }\n\n /**\n * Requests an update for the content of the overlay.\n * While performing the update, it invokes the renderer passed in the `renderer` property.\n *\n * It is not guaranteed that the update happens immediately (synchronously) after it is requested.\n */\n requestContentUpdate() {\n if (this.renderer) {\n this.renderer.call(this.owner, this, this.owner, this.model);\n }\n }\n\n /**\n * @param {Event=} sourceEvent\n */\n close(sourceEvent) {\n const evt = new CustomEvent('vaadin-overlay-close', {\n bubbles: true,\n cancelable: true,\n detail: { sourceEvent },\n });\n this.dispatchEvent(evt);\n if (!evt.defaultPrevented) {\n this.opened = false;\n }\n }\n\n /** @private */\n _detectIosNavbar() {\n /* c8 ignore next 15 */\n if (!this.opened) {\n return;\n }\n\n const innerHeight = window.innerHeight;\n const innerWidth = window.innerWidth;\n\n const landscape = innerWidth > innerHeight;\n\n const clientHeight = document.documentElement.clientHeight;\n\n if (landscape && clientHeight > innerHeight) {\n this.style.setProperty('--vaadin-overlay-viewport-bottom', `${clientHeight - innerHeight}px`);\n } else {\n this.style.setProperty('--vaadin-overlay-viewport-bottom', '0');\n }\n }\n\n /** @private */\n _addGlobalListeners() {\n document.addEventListener('mousedown', this._boundMouseDownListener);\n document.addEventListener('mouseup', this._boundMouseUpListener);\n // Firefox leaks click to document on contextmenu even if prevented\n // https://bugzilla.mozilla.org/show_bug.cgi?id=990614\n document.documentElement.addEventListener('click', this._boundOutsideClickListener, true);\n }\n\n /** @private */\n _removeGlobalListeners() {\n document.removeEventListener('mousedown', this._boundMouseDownListener);\n document.removeEventListener('mouseup', this._boundMouseUpListener);\n document.documentElement.removeEventListener('click', this._boundOutsideClickListener, true);\n }\n\n /** @private */\n _rendererOrDataChanged(renderer, owner, model, opened) {\n const ownerOrModelChanged = this._oldOwner !== owner || this._oldModel !== model;\n this._oldModel = model;\n this._oldOwner = owner;\n\n const rendererChanged = this._oldRenderer !== renderer;\n const hasOldRenderer = this._oldRenderer !== undefined;\n this._oldRenderer = renderer;\n\n const openedChanged = this._oldOpened !== opened;\n this._oldOpened = opened;\n\n if (rendererChanged && hasOldRenderer) {\n this.innerHTML = '';\n // Whenever a Lit-based renderer is used, it assigns a Lit part to the node it was rendered into.\n // When clearing the rendered content, this part needs to be manually disposed of.\n // Otherwise, using a Lit-based renderer on the same node will throw an exception or render nothing afterward.\n delete this._$litPart$;\n }\n\n if (opened && renderer && (rendererChanged || openedChanged || ownerOrModelChanged)) {\n this.requestContentUpdate();\n }\n }\n\n /** @private */\n _modelessChanged(modeless) {\n if (!modeless) {\n if (this.opened) {\n this._addGlobalListeners();\n this._enterModalState();\n }\n } else {\n this._removeGlobalListeners();\n this._exitModalState();\n }\n }\n\n /** @private */\n _openedChanged(opened, wasOpened) {\n if (opened) {\n this._saveFocus();\n\n this._animatedOpening();\n\n afterNextRender(this, () => {\n this._trapFocus();\n\n const evt = new CustomEvent('vaadin-overlay-open', { bubbles: true });\n this.dispatchEvent(evt);\n });\n\n document.addEventListener('keydown', this._boundKeydownListener);\n\n if (!this.modeless) {\n this._addGlobalListeners();\n }\n } else if (wasOpened) {\n this._resetFocus();\n\n this._animatedClosing();\n\n document.removeEventListener('keydown', this._boundKeydownListener);\n\n if (!this.modeless) {\n this._removeGlobalListeners();\n }\n }\n }\n\n /** @private */\n _hiddenChanged(hidden) {\n if (hidden && this.hasAttribute('closing')) {\n this._flushAnimation('closing');\n }\n }\n\n /**\n * @return {boolean}\n * @private\n */\n _shouldAnimate() {\n const style = getComputedStyle(this);\n const name = style.getPropertyValue('animation-name');\n const hidden = style.getPropertyValue('display') === 'none';\n return !hidden && name && name !== 'none';\n }\n\n /**\n * @param {string} type\n * @param {Function} callback\n * @private\n */\n _enqueueAnimation(type, callback) {\n const handler = `__${type}Handler`;\n const listener = (event) => {\n if (event && event.target !== this) {\n return;\n }\n callback();\n this.removeEventListener('animationend', listener);\n delete this[handler];\n };\n this[handler] = listener;\n this.addEventListener('animationend', listener);\n }\n\n /**\n * @param {string} type\n * @protected\n */\n _flushAnimation(type) {\n const handler = `__${type}Handler`;\n if (typeof this[handler] === 'function') {\n this[handler]();\n }\n }\n\n /** @private */\n _animatedOpening() {\n if (this.parentNode === document.body && this.hasAttribute('closing')) {\n this._flushAnimation('closing');\n }\n this._attachOverlay();\n if (!this.modeless) {\n this._enterModalState();\n }\n this.setAttribute('opening', '');\n\n if (this._shouldAnimate()) {\n this._enqueueAnimation('opening', () => {\n this._finishOpening();\n });\n } else {\n this._finishOpening();\n }\n }\n\n /** @private */\n _attachOverlay() {\n this._placeholder = document.createComment('vaadin-overlay-placeholder');\n this.parentNode.insertBefore(this._placeholder, this);\n document.body.appendChild(this);\n this.bringToFront();\n }\n\n /** @private */\n _finishOpening() {\n this.removeAttribute('opening');\n }\n\n /** @private */\n _finishClosing() {\n this._detachOverlay();\n this.$.overlay.style.removeProperty('pointer-events');\n this.removeAttribute('closing');\n this.dispatchEvent(new CustomEvent('vaadin-overlay-closed'));\n }\n\n /** @private */\n _animatedClosing() {\n if (this.hasAttribute('opening')) {\n this._flushAnimation('opening');\n }\n if (this._placeholder) {\n this._exitModalState();\n this.setAttribute('closing', '');\n this.dispatchEvent(new CustomEvent('vaadin-overlay-closing'));\n\n if (this._shouldAnimate()) {\n this._enqueueAnimation('closing', () => {\n this._finishClosing();\n });\n } else {\n this._finishClosing();\n }\n }\n }\n\n /** @private */\n _detachOverlay() {\n this._placeholder.parentNode.insertBefore(this, this._placeholder);\n this._placeholder.parentNode.removeChild(this._placeholder);\n }\n\n /** @private */\n _mouseDownListener(event) {\n this._mouseDownInside = event.composedPath().indexOf(this.$.overlay) >= 0;\n }\n\n /** @private */\n _mouseUpListener(event) {\n this._mouseUpInside = event.composedPath().indexOf(this.$.overlay) >= 0;\n }\n\n /**\n * Whether to close the overlay on outside click or not.\n * Override this method to customize the closing logic.\n *\n * @param {Event} _event\n * @return {boolean}\n * @protected\n */\n _shouldCloseOnOutsideClick(_event) {\n return this._last;\n }\n\n /**\n * Outside click listener used in capture phase to close the overlay before\n * propagating the event to the listener on the element that triggered it.\n * Otherwise, calling `open()` would result in closing and re-opening.\n *\n * @private\n */\n _outsideClickListener(event) {\n if (event.composedPath().includes(this.$.overlay) || this._mouseDownInside || this._mouseUpInside) {\n this._mouseDownInside = false;\n this._mouseUpInside = false;\n return;\n }\n\n if (!this._shouldCloseOnOutsideClick(event)) {\n return;\n }\n\n const evt = new CustomEvent('vaadin-overlay-outside-click', {\n bubbles: true,\n cancelable: true,\n detail: { sourceEvent: event },\n });\n this.dispatchEvent(evt);\n\n if (this.opened && !evt.defaultPrevented) {\n this.close(event);\n }\n }\n\n /**\n * Listener used to close whe overlay on Escape press, if it is the last one.\n * @private\n */\n _keydownListener(event) {\n if (!this._last) {\n return;\n }\n\n // Only close modeless overlay on Esc press when it contains focus\n if (this.modeless && !event.composedPath().includes(this.$.overlay)) {\n return;\n }\n\n if (event.key === 'Escape') {\n const evt = new CustomEvent('vaadin-overlay-escape-press', {\n bubbles: true,\n cancelable: true,\n detail: { sourceEvent: event },\n });\n this.dispatchEvent(evt);\n\n if (this.opened && !evt.defaultPrevented) {\n this.close(event);\n }\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { getAncestorRootNodes } from '@vaadin/component-base/src/dom-utils.js';\nimport { observeMove } from './vaadin-overlay-utils.js';\n\nconst PROP_NAMES_VERTICAL = {\n start: 'top',\n end: 'bottom',\n};\n\nconst PROP_NAMES_HORIZONTAL = {\n start: 'left',\n end: 'right',\n};\n\nconst targetResizeObserver = new ResizeObserver((entries) => {\n setTimeout(() => {\n entries.forEach((entry) => {\n if (entry.target.__overlay) {\n entry.target.__overlay._updatePosition();\n }\n });\n });\n});\n\n/**\n * @polymerMixin\n */\nexport const PositionMixin = (superClass) =>\n class PositionMixin extends superClass {\n static get properties() {\n return {\n /**\n * The element next to which this overlay should be aligned.\n * The position of the overlay relative to the positionTarget can be adjusted\n * with properties `horizontalAlign`, `verticalAlign`, `noHorizontalOverlap`\n * and `noVerticalOverlap`.\n */\n positionTarget: {\n type: Object,\n value: null,\n sync: true,\n },\n\n /**\n * When `positionTarget` is set, this property defines whether to align the overlay's\n * left or right side to the target element by default.\n * Possible values are `start` and `end`.\n * RTL is taken into account when interpreting the value.\n * The overlay is automatically flipped to the opposite side when it doesn't fit into\n * the default side defined by this property.\n *\n * @attr {start|end} horizontal-align\n */\n horizontalAlign: {\n type: String,\n value: 'start',\n sync: true,\n },\n\n /**\n * When `positionTarget` is set, this property defines whether to align the overlay's\n * top or bottom side to the target element by default.\n * Possible values are `top` and `bottom`.\n * The overlay is automatically flipped to the opposite side when it doesn't fit into\n * the default side defined by this property.\n *\n * @attr {top|bottom} vertical-align\n */\n verticalAlign: {\n type: String,\n value: 'top',\n sync: true,\n },\n\n /**\n * When `positionTarget` is set, this property defines whether the overlay should overlap\n * the target element in the x-axis, or be positioned right next to it.\n *\n * @attr {boolean} no-horizontal-overlap\n */\n noHorizontalOverlap: {\n type: Boolean,\n value: false,\n sync: true,\n },\n\n /**\n * When `positionTarget` is set, this property defines whether the overlay should overlap\n * the target element in the y-axis, or be positioned right above/below it.\n *\n * @attr {boolean} no-vertical-overlap\n */\n noVerticalOverlap: {\n type: Boolean,\n value: false,\n sync: true,\n },\n\n /**\n * If the overlay content has no intrinsic height, this property can be used to set\n * the minimum vertical space (in pixels) required by the overlay. Setting a value to\n * the property effectively disables the content measurement in favor of using this\n * fixed value for determining the open direction.\n *\n * @attr {number} required-vertical-space\n */\n requiredVerticalSpace: {\n type: Number,\n value: 0,\n sync: true,\n },\n };\n }\n\n static get observers() {\n return [\n '__positionSettingsChanged(horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap, requiredVerticalSpace)',\n '__overlayOpenedChanged(opened, positionTarget)',\n ];\n }\n\n constructor() {\n super();\n\n this.__onScroll = this.__onScroll.bind(this);\n this._updatePosition = this._updatePosition.bind(this);\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n\n if (this.opened) {\n this.__addUpdatePositionEventListeners();\n }\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n this.__removeUpdatePositionEventListeners();\n }\n\n /** @private */\n __addUpdatePositionEventListeners() {\n window.visualViewport.addEventListener('resize', this._updatePosition);\n window.visualViewport.addEventListener('scroll', this.__onScroll, true);\n\n this.__positionTargetAncestorRootNodes = getAncestorRootNodes(this.positionTarget);\n this.__positionTargetAncestorRootNodes.forEach((node) => {\n node.addEventListener('scroll', this.__onScroll, true);\n });\n\n if (this.positionTarget) {\n this.__observePositionTargetMove = observeMove(this.positionTarget, () => {\n this._updatePosition();\n });\n }\n }\n\n /** @private */\n __removeUpdatePositionEventListeners() {\n window.visualViewport.removeEventListener('resize', this._updatePosition);\n window.visualViewport.removeEventListener('scroll', this.__onScroll, true);\n\n if (this.__positionTargetAncestorRootNodes) {\n this.__positionTargetAncestorRootNodes.forEach((node) => {\n node.removeEventListener('scroll', this.__onScroll, true);\n });\n this.__positionTargetAncestorRootNodes = null;\n }\n\n if (this.__observePositionTargetMove) {\n this.__observePositionTargetMove();\n this.__observePositionTargetMove = null;\n }\n }\n\n /** @private */\n __overlayOpenedChanged(opened, positionTarget) {\n this.__removeUpdatePositionEventListeners();\n\n if (positionTarget) {\n positionTarget.__overlay = null;\n targetResizeObserver.unobserve(positionTarget);\n\n if (opened) {\n this.__addUpdatePositionEventListeners();\n positionTarget.__overlay = this;\n targetResizeObserver.observe(positionTarget);\n }\n }\n\n if (opened) {\n const computedStyle = getComputedStyle(this);\n if (!this.__margins) {\n this.__margins = {};\n ['top', 'bottom', 'left', 'right'].forEach((propName) => {\n this.__margins[propName] = parseInt(computedStyle[propName], 10);\n });\n }\n\n this._updatePosition();\n // Schedule another position update (to cover virtual keyboard opening for example)\n requestAnimationFrame(() => this._updatePosition());\n }\n }\n\n __positionSettingsChanged() {\n this._updatePosition();\n }\n\n /** @private */\n __onScroll(e) {\n // If the scroll event occurred inside the overlay, ignore it.\n if (e.target instanceof Node && this.contains(e.target)) {\n return;\n }\n\n this._updatePosition();\n }\n\n _updatePosition() {\n if (!this.positionTarget || !this.opened || !this.__margins) {\n return;\n }\n\n const targetRect = this.positionTarget.getBoundingClientRect();\n\n if (targetRect.width === 0 && targetRect.height === 0 && this.opened) {\n this.opened = false;\n return;\n }\n\n // Detect the desired alignment and update the layout accordingly\n const shouldAlignStartVertically = this.__shouldAlignStartVertically(targetRect);\n this.style.justifyContent = shouldAlignStartVertically ? 'flex-start' : 'flex-end';\n\n const isRTL = this.__isRTL;\n const shouldAlignStartHorizontally = this.__shouldAlignStartHorizontally(targetRect, isRTL);\n const flexStart = (!isRTL && shouldAlignStartHorizontally) || (isRTL && !shouldAlignStartHorizontally);\n this.style.alignItems = flexStart ? 'flex-start' : 'flex-end';\n\n // Get the overlay rect after possible overlay alignment changes\n const overlayRect = this.getBoundingClientRect();\n\n // Obtain vertical positioning properties\n const verticalProps = this.__calculatePositionInOneDimension(\n targetRect,\n overlayRect,\n this.noVerticalOverlap,\n PROP_NAMES_VERTICAL,\n this,\n shouldAlignStartVertically,\n );\n\n // Obtain horizontal positioning properties\n const horizontalProps = this.__calculatePositionInOneDimension(\n targetRect,\n overlayRect,\n this.noHorizontalOverlap,\n PROP_NAMES_HORIZONTAL,\n this,\n shouldAlignStartHorizontally,\n );\n\n // Apply the positioning properties to the overlay\n Object.assign(this.style, verticalProps, horizontalProps);\n\n this.toggleAttribute('bottom-aligned', !shouldAlignStartVertically);\n this.toggleAttribute('top-aligned', shouldAlignStartVertically);\n\n this.toggleAttribute('end-aligned', !flexStart);\n this.toggleAttribute('start-aligned', flexStart);\n }\n\n __shouldAlignStartHorizontally(targetRect, rtl) {\n // Using previous size to fix a case where window resize may cause the overlay to be squeezed\n // smaller than its current space before the fit-calculations.\n const contentWidth = Math.max(this.__oldContentWidth || 0, this.$.overlay.offsetWidth);\n this.__oldContentWidth = this.$.overlay.offsetWidth;\n\n const viewportWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);\n const defaultAlignLeft = (!rtl && this.horizontalAlign === 'start') || (rtl && this.horizontalAlign === 'end');\n\n return this.__shouldAlignStart(\n targetRect,\n contentWidth,\n viewportWidth,\n this.__margins,\n defaultAlignLeft,\n this.noHorizontalOverlap,\n PROP_NAMES_HORIZONTAL,\n );\n }\n\n __shouldAlignStartVertically(targetRect) {\n // Using previous size to fix a case where window resize may cause the overlay to be squeezed\n // smaller than its current space before the fit-calculations.\n const contentHeight =\n this.requiredVerticalSpace || Math.max(this.__oldContentHeight || 0, this.$.overlay.offsetHeight);\n this.__oldContentHeight = this.$.overlay.offsetHeight;\n\n const viewportHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);\n const defaultAlignTop = this.verticalAlign === 'top';\n\n return this.__shouldAlignStart(\n targetRect,\n contentHeight,\n viewportHeight,\n this.__margins,\n defaultAlignTop,\n this.noVerticalOverlap,\n PROP_NAMES_VERTICAL,\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/max-params\n __shouldAlignStart(targetRect, contentSize, viewportSize, margins, defaultAlignStart, noOverlap, propNames) {\n const spaceForStartAlignment =\n viewportSize - targetRect[noOverlap ? propNames.end : propNames.start] - margins[propNames.end];\n const spaceForEndAlignment = targetRect[noOverlap ? propNames.start : propNames.end] - margins[propNames.start];\n\n const spaceForDefaultAlignment = defaultAlignStart ? spaceForStartAlignment : spaceForEndAlignment;\n const spaceForOtherAlignment = defaultAlignStart ? spaceForEndAlignment : spaceForStartAlignment;\n\n const shouldGoToDefaultSide =\n spaceForDefaultAlignment > spaceForOtherAlignment || spaceForDefaultAlignment > contentSize;\n\n return defaultAlignStart === shouldGoToDefaultSide;\n }\n\n /**\n * Returns an adjusted value after resizing the browser window,\n * to avoid wrong calculations when e.g. previously set `bottom`\n * CSS property value is larger than the updated viewport height.\n * See https://github.com/vaadin/web-components/issues/4604\n */\n __adjustBottomProperty(cssPropNameToSet, propNames, currentValue) {\n let adjustedProp;\n\n if (cssPropNameToSet === propNames.end) {\n // Adjust horizontally\n if (propNames.end === PROP_NAMES_VERTICAL.end) {\n const viewportHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);\n\n if (currentValue > viewportHeight && this.__oldViewportHeight) {\n const heightDiff = this.__oldViewportHeight - viewportHeight;\n adjustedProp = currentValue - heightDiff;\n }\n\n this.__oldViewportHeight = viewportHeight;\n }\n\n // Adjust vertically\n if (propNames.end === PROP_NAMES_HORIZONTAL.end) {\n const viewportWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);\n\n if (currentValue > viewportWidth && this.__oldViewportWidth) {\n const widthDiff = this.__oldViewportWidth - viewportWidth;\n adjustedProp = currentValue - widthDiff;\n }\n\n this.__oldViewportWidth = viewportWidth;\n }\n }\n\n return adjustedProp;\n }\n\n /**\n * Returns an object with CSS position properties to set,\n * e.g. { top: \"100px\" }\n */\n // eslint-disable-next-line @typescript-eslint/max-params\n __calculatePositionInOneDimension(targetRect, overlayRect, noOverlap, propNames, overlay, shouldAlignStart) {\n const cssPropNameToSet = shouldAlignStart ? propNames.start : propNames.end;\n const cssPropNameToClear = shouldAlignStart ? propNames.end : propNames.start;\n\n const currentValue = parseFloat(overlay.style[cssPropNameToSet] || getComputedStyle(overlay)[cssPropNameToSet]);\n const adjustedValue = this.__adjustBottomProperty(cssPropNameToSet, propNames, currentValue);\n\n const diff =\n overlayRect[shouldAlignStart ? propNames.start : propNames.end] -\n targetRect[noOverlap === shouldAlignStart ? propNames.end : propNames.start];\n\n const valueToSet = adjustedValue\n ? `${adjustedValue}px`\n : `${currentValue + diff * (shouldAlignStart ? -1 : 1)}px`;\n\n return {\n [cssPropNameToSet]: valueToSet,\n [cssPropNameToClear]: '',\n };\n }\n };\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Returns an array of ancestor root nodes for the given node.\n *\n * A root node is either a document node or a document fragment node (Shadow Root).\n * The array is collected by a bottom-up DOM traversing that starts with the given node\n * and involves both the light DOM and ancestor shadow DOM trees.\n *\n * @param {Node} node\n * @return {Node[]}\n */\nexport function getAncestorRootNodes(node) {\n const result = [];\n\n while (node) {\n if (node.nodeType === Node.DOCUMENT_NODE) {\n result.push(node);\n break;\n }\n\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n result.push(node);\n node = node.host;\n continue;\n }\n\n if (node.assignedSlot) {\n node = node.assignedSlot;\n continue;\n }\n\n node = node.parentNode;\n }\n\n return result;\n}\n\n/**\n * Returns the list of flattened elements for the given `node`.\n * This list consists of a node's children and, for any children that are\n * `<slot>` elements, the expanded flattened list of `assignedElements`.\n *\n * @param {Node} node\n * @return {Element[]}\n */\nexport function getFlattenedElements(node) {\n const result = [];\n let elements;\n if (node.localName === 'slot') {\n elements = node.assignedElements();\n } else {\n result.push(node);\n elements = [...node.children];\n }\n elements.forEach((elem) => result.push(...getFlattenedElements(elem)));\n return result;\n}\n\n/**\n * Traverses the given node and its parents, including those that are across\n * the shadow root boundaries, until it finds a node that matches the selector.\n *\n * @param {string} selector The CSS selector to match against\n * @param {Node} node The starting node for the traversal\n * @return {Node | null} The closest matching element, or null if no match is found\n */\nexport function getClosestElement(selector, node) {\n if (!node) {\n return null;\n }\n\n return node.closest(selector) || getClosestElement(selector, node.getRootNode().host);\n}\n\n/**\n * Takes a string with values separated by space and returns a set the values\n *\n * @param {string} value\n * @return {Set<string>}\n */\nexport function deserializeAttributeValue(value) {\n if (!value) {\n return new Set();\n }\n\n return new Set(value.split(' '));\n}\n\n/**\n * Takes a set of string values and returns a string with values separated by space\n *\n * @param {Set<string>} values\n * @return {string}\n */\nexport function serializeAttributeValue(values) {\n return values ? [...values].join(' ') : '';\n}\n\n/**\n * Adds a value to an attribute containing space-delimited values.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function addValueToAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.add(value);\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Removes a value from an attribute containing space-delimited values.\n * If the value is the last one, the whole attribute is removed.\n *\n * @param {HTMLElement} element\n * @param {string} attr\n * @param {string} value\n */\nexport function removeValueFromAttribute(element, attr, value) {\n const values = deserializeAttributeValue(element.getAttribute(attr));\n values.delete(value);\n if (values.size === 0) {\n element.removeAttribute(attr);\n return;\n }\n element.setAttribute(attr, serializeAttributeValue(values));\n}\n\n/**\n * Returns true if the given node is an empty text node, false otherwise.\n *\n * @param {Node} node\n * @return {boolean}\n */\nexport function isEmptyTextNode(node) {\n return node.nodeType === Node.TEXT_NODE && node.textContent.trim() === '';\n}\n","/**\n * @license\n * Copyright (c) 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * Observe moving an element around on a page.\n *\n * Based on the idea from https://samthor.au/2021/observing-dom/ as implemented in Floating UI\n * https://github.com/floating-ui/floating-ui/blob/58ed169/packages/dom/src/autoUpdate.ts#L45\n *\n * @param {HTMLElement} element\n * @param {Function} callback\n * @return {Function}\n */\nexport function observeMove(element, callback) {\n let io = null;\n\n const root = document.documentElement;\n\n function cleanup() {\n io && io.disconnect();\n io = null;\n }\n\n function refresh(skip = false, threshold = 1) {\n cleanup();\n\n const { left, top, width, height } = element.getBoundingClientRect();\n\n if (!skip) {\n callback();\n }\n\n if (!width || !height) {\n return;\n }\n\n const insetTop = Math.floor(top);\n const insetRight = Math.floor(root.clientWidth - (left + width));\n const insetBottom = Math.floor(root.clientHeight - (top + height));\n const insetLeft = Math.floor(left);\n\n const rootMargin = `${-insetTop}px ${-insetRight}px ${-insetBottom}px ${-insetLeft}px`;\n\n const options = {\n rootMargin,\n threshold: Math.max(0, Math.min(1, threshold)) || 1,\n };\n\n let isFirstUpdate = true;\n\n function handleObserve(entries) {\n let ratio = entries[0].intersectionRatio;\n\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n\n // It's possible for the watched element to not be at perfect 1.0 visibility when we create\n // the IntersectionObserver. This has a couple of causes:\n // - elements being on partial pixels\n // - elements being hidden offscreen (e.g., <html> has `overflow: hidden`)\n // - delays: if your DOM change occurs due to e.g., page resize, you can see elements\n // behind their actual position\n //\n // In all of these cases, refresh but with this lower ratio of threshold. When the element\n // moves beneath _that_ new value, the user will get notified.\n if (ratio === 0.0) {\n ratio = 0.0000001; // Just needs to be non-zero\n }\n\n refresh(false, ratio);\n }\n\n isFirstUpdate = false;\n }\n\n io = new IntersectionObserver(handleObserve, options);\n\n io.observe(element);\n }\n\n refresh(true);\n\n return cleanup;\n}\n","/**\n * @license\n * Copyright (c) 2022 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';\nimport { PositionMixin } from '@vaadin/overlay/src/vaadin-overlay-position-mixin.js';\n\n/**\n * A mixin providing common popover overlay functionality.\n *\n * @polymerMixin\n * @mixes PositionMixin\n * @mixes OverlayMixin\n */\nexport const PopoverOverlayMixin = (superClass) =>\n class PopoverOverlayMixinClass extends PositionMixin(OverlayMixin(superClass)) {\n static get properties() {\n return {\n position: {\n type: String,\n reflectToAttribute: true,\n },\n };\n }\n\n /**\n * Tag name prefix used by custom properties.\n * @protected\n * @return {string}\n */\n get _tagNamePrefix() {\n return 'vaadin-popover';\n }\n\n requestContentUpdate() {\n super.requestContentUpdate();\n\n // Copy custom properties from the owner\n if (this.positionTarget && this.owner) {\n const style = getComputedStyle(this.owner);\n ['top', 'bottom', 'start', 'end'].forEach((prop) => {\n this.style.setProperty(\n `--${this._tagNamePrefix}-offset-${prop}`,\n style.getPropertyValue(`--${this._tagNamePrefix}-offset-${prop}`),\n );\n });\n }\n }\n\n /**\n * @protected\n * @override\n */\n _updatePosition() {\n super._updatePosition();\n\n if (!this.positionTarget || !this.opened) {\n return;\n }\n\n this.removeAttribute('arrow-centered');\n\n // Center the overlay horizontally\n if (this.position === 'bottom' || this.position === 'top') {\n const targetRect = this.positionTarget.getBoundingClientRect();\n const overlayRect = this.$.overlay.getBoundingClientRect();\n\n const offset = targetRect.width / 2 - overlayRect.width / 2;\n\n if (this.style.left) {\n const left = overlayRect.left + offset;\n if (left > 0) {\n this.style.left = `${left}px`;\n // Center the pointer arrow horizontally\n this.setAttribute('arrow-centered', '');\n }\n }\n\n if (this.style.right) {\n const right = parseFloat(this.style.right) + offset;\n if (right > 0) {\n this.style.right = `${right}px`;\n // Center the pointer arrow horizontally\n this.setAttribute('arrow-centered', '');\n }\n }\n }\n\n // Center the overlay vertically\n if (this.position === 'start' || this.position === 'end') {\n const targetRect = this.positionTarget.getBoundingClientRect();\n const overlayRect = this.$.overlay.getBoundingClientRect();\n\n const offset = targetRect.height / 2 - overlayRect.height / 2;\n this.style.top = `${overlayRect.top + offset}px`;\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { css, html, LitElement } from 'lit';\nimport { isElementFocused } from '@vaadin/a11y-base/src/focus-utils.js';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';\nimport { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';\nimport { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';\nimport { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { PopoverOverlayMixin } from './vaadin-popover-overlay-mixin.js';\n\n/**\n * An element used internally by `<vaadin-popover>`. Not intended to be used separately.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes DirMixin\n * @mixes PopoverOverlayMixin\n * @mixes ThemableMixin\n * @private\n */\nclass PopoverOverlay extends PopoverOverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement)))) {\n static get is() {\n return 'vaadin-popover-overlay';\n }\n\n static get styles() {\n return [\n overlayStyles,\n css`\n :host {\n --_vaadin-popover-content-width: auto;\n --_vaadin-popover-content-height: auto;\n }\n\n :host([modeless][with-backdrop]) [part='backdrop'] {\n pointer-events: none;\n }\n\n :host([position^='top'][top-aligned]) [part='overlay'],\n :host([position^='bottom'][top-aligned]) [part='overlay'] {\n margin-top: var(--vaadin-popover-offset-top, 0);\n }\n\n [part='overlay'] {\n position: relative;\n overflow: visible;\n max-height: 100%;\n }\n\n [part='content'] {\n overflow: auto;\n box-sizing: border-box;\n max-height: 100%;\n width: var(--_vaadin-popover-content-width);\n height: var(--_vaadin-popover-content-height);\n }\n\n /* Increase the area of the popover so the pointer can go from the target directly to it. */\n [part='overlay']::before {\n position: absolute;\n content: '';\n inset-block: calc(var(--vaadin-popover-offset-top, 0) * -1) calc(var(--vaadin-popover-offset-bottom, 0) * -1);\n inset-inline: calc(var(--vaadin-popover-offset-start, 0) * -1) calc(var(--vaadin-popover-offset-end, 0) * -1);\n z-index: -1;\n pointer-events: auto;\n }\n\n :host([position^='top'][bottom-aligned]) [part='overlay'],\n :host([position^='bottom'][bottom-aligned]) [part='overlay'] {\n margin-bottom: var(--vaadin-popover-offset-bottom, 0);\n }\n\n :host([position^='start'][start-aligned]) [part='overlay'],\n :host([position^='end'][start-aligned]) [part='overlay'] {\n margin-inline-start: var(--vaadin-popover-offset-start, 0);\n }\n\n :host([position^='start'][end-aligned]) [part='overlay'],\n :host([position^='end'][end-aligned]) [part='overlay'] {\n margin-inline-end: var(--vaadin-popover-offset-end, 0);\n }\n\n [part='arrow'] {\n display: none;\n position: absolute;\n height: 0;\n width: 0;\n }\n\n :host([theme~='arrow']) [part='arrow'] {\n display: block;\n }\n `,\n ];\n }\n\n /** @protected */\n render() {\n return html`\n <div id=\"backdrop\" part=\"backdrop\" hidden ?hidden=\"${!this.withBackdrop}\"></div>\n <div part=\"overlay\" id=\"overlay\" tabindex=\"0\">\n <div part=\"arrow\"></div>\n <div part=\"content\" id=\"content\"><slot></slot></div>\n </div>\n `;\n }\n\n /**\n * Override method inherited from `OverlayMixin` to not close\n * modal popover on outside click when opening on focus.\n *\n * @param {Event} event\n * @return {boolean}\n * @protected\n */\n _shouldCloseOnOutsideClick(event) {\n // When opening a modal popover on mouse focusin, the focus moves to the overlay\n // and then outside click listener is fired. Detect this case and prevent closing.\n if (this.owner.__hasTrigger('focus') && isElementFocused(this)) {\n return false;\n }\n\n return super._shouldCloseOnOutsideClick(event);\n }\n}\n\ndefineCustomElement(PopoverOverlay);\n","import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * @fileoverview\n *\n * This module provides a number of strategies for enqueuing asynchronous\n * tasks. Each sub-module provides a standard `run(fn)` interface that returns a\n * handle, and a `cancel(handle)` interface for canceling async tasks before\n * they run.\n *\n * @summary Module that provides a number of strategies for enqueuing\n * asynchronous tasks.\n */\n\nlet microtaskCurrHandle = 0;\nlet microtaskLastHandle = 0;\nconst microtaskCallbacks = [];\nlet microtaskScheduled = false;\n\nfunction microtaskFlush() {\n microtaskScheduled = false;\n const len = microtaskCallbacks.length;\n for (let i = 0; i < len; i++) {\n const cb = microtaskCallbacks[i];\n if (cb) {\n try {\n cb();\n } catch (e) {\n setTimeout(() => {\n throw e;\n });\n }\n }\n }\n microtaskCallbacks.splice(0, len);\n microtaskLastHandle += len;\n}\n\n/**\n * Async interface wrapper around `setTimeout`.\n *\n * @namespace\n * @summary Async interface wrapper around `setTimeout`.\n */\nconst timeOut = {\n /**\n * Returns a sub-module with the async interface providing the provided\n * delay.\n *\n * @memberof timeOut\n * @param {number=} delay Time to wait before calling callbacks in ms\n * @return {!AsyncInterface} An async timeout interface\n */\n after(delay) {\n return {\n run(fn) {\n return window.setTimeout(fn, delay);\n },\n cancel(handle) {\n window.clearTimeout(handle);\n },\n };\n },\n /**\n * Enqueues a function called in the next task.\n *\n * @memberof timeOut\n * @param {!Function} fn Callback to run\n * @param {number=} delay Delay in milliseconds\n * @return {number} Handle used for canceling task\n */\n run(fn, delay) {\n return window.setTimeout(fn, delay);\n },\n /**\n * Cancels a previously enqueued `timeOut` callback.\n *\n * @memberof timeOut\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n window.clearTimeout(handle);\n },\n};\nexport { timeOut };\n\n/**\n * Async interface wrapper around `requestAnimationFrame`.\n *\n * @namespace\n * @summary Async interface wrapper around `requestAnimationFrame`.\n */\nconst animationFrame = {\n /**\n * Enqueues a function called at `requestAnimationFrame` timing.\n *\n * @memberof animationFrame\n * @param {function(number):void} fn Callback to run\n * @return {number} Handle used for canceling task\n */\n run(fn) {\n return window.requestAnimationFrame(fn);\n },\n /**\n * Cancels a previously enqueued `animationFrame` callback.\n *\n * @memberof animationFrame\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n window.cancelAnimationFrame(handle);\n },\n};\nexport { animationFrame };\n\n/**\n * Async interface wrapper around `requestIdleCallback`. Falls back to\n * `setTimeout` on browsers that do not support `requestIdleCallback`.\n *\n * @namespace\n * @summary Async interface wrapper around `requestIdleCallback`.\n */\nconst idlePeriod = {\n /**\n * Enqueues a function called at `requestIdleCallback` timing.\n *\n * @memberof idlePeriod\n * @param {function(!IdleDeadline):void} fn Callback to run\n * @return {number} Handle used for canceling task\n */\n run(fn) {\n return window.requestIdleCallback ? window.requestIdleCallback(fn) : window.setTimeout(fn, 16);\n },\n /**\n * Cancels a previously enqueued `idlePeriod` callback.\n *\n * @memberof idlePeriod\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n if (window.cancelIdleCallback) {\n window.cancelIdleCallback(handle);\n } else {\n window.clearTimeout(handle);\n }\n },\n};\nexport { idlePeriod };\n\n/**\n * Async interface for enqueuing callbacks that run at microtask timing.\n *\n * @namespace\n * @summary Async interface for enqueuing callbacks that run at microtask\n * timing.\n */\nconst microTask = {\n /**\n * Enqueues a function called at microtask timing.\n *\n * @memberof microTask\n * @param {!Function=} callback Callback to run\n * @return {number} Handle used for canceling task\n */\n run(callback) {\n if (!microtaskScheduled) {\n microtaskScheduled = true;\n queueMicrotask(() => microtaskFlush());\n }\n microtaskCallbacks.push(callback);\n const result = microtaskCurrHandle;\n microtaskCurrHandle += 1;\n return result;\n },\n\n /**\n * Cancels a previously enqueued `microTask` callback.\n *\n * @memberof microTask\n * @param {number} handle Handle returned from `run` of callback to cancel\n * @return {void}\n */\n cancel(handle) {\n const idx = handle - microtaskLastHandle;\n if (idx >= 0) {\n if (!microtaskCallbacks[idx]) {\n throw new Error(`invalid async handle: ${handle}`);\n }\n microtaskCallbacks[idx] = null;\n }\n },\n};\nexport { microTask };\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nconst debouncerQueue = new Set();\n\n/**\n * @summary Collapse multiple callbacks into one invocation after a timer.\n */\nexport class Debouncer {\n /**\n * Creates a debouncer if no debouncer is passed as a parameter\n * or it cancels an active debouncer otherwise. The following\n * example shows how a debouncer can be called multiple times within a\n * microtask and \"debounced\" such that the provided callback function is\n * called once. Add this method to a custom element:\n *\n * ```js\n * import {microTask} from '@vaadin/component-base/src/async.js';\n * import {Debouncer} from '@vaadin/component-base/src/debounce.js';\n * // ...\n *\n * _debounceWork() {\n * this._debounceJob = Debouncer.debounce(this._debounceJob,\n * microTask, () => this._doWork());\n * }\n * ```\n *\n * If the `_debounceWork` method is called multiple times within the same\n * microtask, the `_doWork` function will be called only once at the next\n * microtask checkpoint.\n *\n * Note: In testing it is often convenient to avoid asynchrony. To accomplish\n * this with a debouncer, you can use `enqueueDebouncer` and\n * `flush`. For example, extend the above example by adding\n * `enqueueDebouncer(this._debounceJob)` at the end of the\n * `_debounceWork` method. Then in a test, call `flush` to ensure\n * the debouncer has completed.\n *\n * @param {Debouncer?} debouncer Debouncer object.\n * @param {!AsyncInterface} asyncModule Object with Async interface\n * @param {function()} callback Callback to run.\n * @return {!Debouncer} Returns a debouncer object.\n */\n static debounce(debouncer, asyncModule, callback) {\n if (debouncer instanceof Debouncer) {\n // Cancel the async callback, but leave in debouncerQueue if it was\n // enqueued, to maintain 1.x flush order\n debouncer._cancelAsync();\n } else {\n debouncer = new Debouncer();\n }\n debouncer.setConfig(asyncModule, callback);\n return debouncer;\n }\n\n constructor() {\n this._asyncModule = null;\n this._callback = null;\n this._timer = null;\n }\n\n /**\n * Sets the scheduler; that is, a module with the Async interface,\n * a callback and optional arguments to be passed to the run function\n * from the async module.\n *\n * @param {!AsyncInterface} asyncModule Object with Async interface.\n * @param {function()} callback Callback to run.\n * @return {void}\n */\n setConfig(asyncModule, callback) {\n this._asyncModule = asyncModule;\n this._callback = callback;\n this._timer = this._asyncModule.run(() => {\n this._timer = null;\n debouncerQueue.delete(this);\n this._callback();\n });\n }\n\n /**\n * Cancels an active debouncer and returns a reference to itself.\n *\n * @return {void}\n */\n cancel() {\n if (this.isActive()) {\n this._cancelAsync();\n // Canceling a debouncer removes its spot from the flush queue,\n // so if a debouncer is manually canceled and re-debounced, it\n // will reset its flush order (this is a very minor difference from 1.x)\n // Re-debouncing via the `debounce` API retains the 1.x FIFO flush order\n debouncerQueue.delete(this);\n }\n }\n\n /**\n * Cancels a debouncer's async callback.\n *\n * @return {void}\n */\n _cancelAsync() {\n if (this.isActive()) {\n this._asyncModule.cancel(/** @type {number} */ (this._timer));\n this._timer = null;\n }\n }\n\n /**\n * Flushes an active debouncer and returns a reference to itself.\n *\n * @return {void}\n */\n flush() {\n if (this.isActive()) {\n this.cancel();\n this._callback();\n }\n }\n\n /**\n * Returns true if the debouncer is active.\n *\n * @return {boolean} True if active.\n */\n isActive() {\n return this._timer != null;\n }\n}\n\n/**\n * Adds a `Debouncer` to a list of globally flushable tasks.\n *\n * @param {!Debouncer} debouncer Debouncer to enqueue\n * @return {void}\n */\nexport function enqueueDebouncer(debouncer) {\n debouncerQueue.add(debouncer);\n}\n\n/**\n * Flushes any enqueued debouncers\n *\n * @return {boolean} Returns whether any debouncers were flushed\n */\nexport function flushDebouncers() {\n const didFlush = Boolean(debouncerQueue.size);\n // If new debouncers are added while flushing, Set.forEach will ensure\n // newly added ones are also flushed\n debouncerQueue.forEach((debouncer) => {\n try {\n debouncer.flush();\n } catch (e) {\n setTimeout(() => {\n throw e;\n });\n }\n });\n return didFlush;\n}\n\nexport const flush = () => {\n let debouncers;\n do {\n debouncers = flushDebouncers();\n } while (debouncers);\n};\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { setCancelSyntheticClickEvents } from '@polymer/polymer/lib/utils/settings.js';\nimport { usageStatistics } from '@vaadin/vaadin-usage-statistics/vaadin-usage-statistics.js';\nimport { idlePeriod } from './async.js';\nimport { Debouncer, enqueueDebouncer } from './debounce.js';\nimport { DirMixin } from './dir-mixin.js';\n\n// This setting affects the legacy Polymer gestures which get activated\n// once you import any iron component e.g iron-icon.\n// It has to be explicitly disabled to prevent click issues in iOS + VoiceOver\n// for buttons that are based on `[role=button]` e.g vaadin-button.\nsetCancelSyntheticClickEvents(false);\n\nif (!window.Vaadin) {\n window.Vaadin = {};\n}\n\n/**\n * Array of Vaadin custom element classes that have been finalized.\n */\nif (!window.Vaadin.registrations) {\n window.Vaadin.registrations = [];\n}\n\nif (!window.Vaadin.developmentModeCallback) {\n window.Vaadin.developmentModeCallback = {};\n}\n\nwindow.Vaadin.developmentModeCallback['vaadin-usage-statistics'] = function () {\n usageStatistics();\n};\n\nlet statsJob;\n\nconst registered = new Set();\n\n/**\n * @polymerMixin\n * @mixes DirMixin\n */\nexport const ElementMixin = (superClass) =>\n class VaadinElementMixin extends DirMixin(superClass) {\n /** @protected */\n static finalize() {\n super.finalize();\n\n const { is } = this;\n\n // Registers a class prototype for telemetry purposes.\n if (is && !registered.has(is)) {\n window.Vaadin.registrations.push(this);\n registered.add(is);\n\n if (window.Vaadin.developmentModeCallback) {\n statsJob = Debouncer.debounce(statsJob, idlePeriod, () => {\n window.Vaadin.developmentModeCallback['vaadin-usage-statistics']();\n });\n enqueueDebouncer(statsJob);\n }\n }\n }\n\n constructor() {\n super();\n\n if (document.doctype === null) {\n console.warn(\n 'Vaadin components require the \"standards mode\" declaration. Please add <!DOCTYPE html> to the HTML document.',\n );\n }\n }\n };\n","/**\n * @license\n * Copyright (c) 2023 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * A mixin that forwards CSS class names to the internal overlay element\n * by setting the `overlayClass` property or `overlay-class` attribute.\n *\n * @polymerMixin\n */\nexport const OverlayClassMixin = (superclass) =>\n class OverlayClassMixinClass extends superclass {\n static get properties() {\n return {\n /**\n * A space-delimited list of CSS class names to set on the overlay element.\n * This property does not affect other CSS class names set manually via JS.\n *\n * Note, if the CSS class name was set with this property, clearing it will\n * remove it from the overlay, even if the same class name was also added\n * manually, e.g. by using `classList.add()` in the `renderer` function.\n *\n * @attr {string} overlay-class\n */\n overlayClass: {\n type: String,\n },\n\n /**\n * An overlay element on which CSS class names are set.\n *\n * @protected\n */\n _overlayElement: {\n type: Object,\n },\n };\n }\n\n static get observers() {\n return ['__updateOverlayClassNames(overlayClass, _overlayElement)'];\n }\n\n /** @private */\n __updateOverlayClassNames(overlayClass, overlayElement) {\n if (!overlayElement) {\n return;\n }\n\n // Overlay is set but overlayClass is not set\n if (overlayClass === undefined) {\n return;\n }\n\n const { classList } = overlayElement;\n\n if (!this.__initialClasses) {\n this.__initialClasses = new Set(classList);\n }\n\n if (Array.isArray(this.__previousClasses)) {\n // Remove old classes that no longer apply\n const classesToRemove = this.__previousClasses.filter((name) => !this.__initialClasses.has(name));\n if (classesToRemove.length > 0) {\n classList.remove(...classesToRemove);\n }\n }\n\n // Add new classes based on the overlayClass\n const classesToAdd = typeof overlayClass === 'string' ? overlayClass.split(' ').filter(Boolean) : [];\n if (classesToAdd.length > 0) {\n classList.add(...classesToAdd);\n }\n\n this.__previousClasses = classesToAdd;\n }\n };\n","/**\n * @license\n * Copyright (c) 2021 - 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\nlet uniqueId = 0;\n\n/**\n * Resets the unique id counter.\n *\n * @return {void}\n */\nexport function resetUniqueId() {\n uniqueId = 0;\n}\n\n/**\n * Returns a unique integer id.\n *\n * @return {number}\n */\nexport function generateUniqueId() {\n // eslint-disable-next-line no-plusplus\n return uniqueId++;\n}\n","/**\n * @license\n * Copyright (c) 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\n\n/**\n * A mixin providing popover position functionality.\n *\n * @polymerMixin\n */\nexport const PopoverPositionMixin = (superClass) =>\n class PopoverPositionMixinClass extends superClass {\n static get properties() {\n return {\n /**\n * Position of the overlay with respect to the target.\n * Supported values: `top-start`, `top`, `top-end`,\n * `bottom-start`, `bottom`, `bottom-end`, `start-top`,\n * `start`, `start-bottom`, `end-top`, `end`, `end-bottom`.\n */\n position: {\n type: String,\n },\n\n /**\n * Default value used when `position` property is not set.\n * @protected\n */\n _position: {\n type: String,\n value: 'bottom',\n },\n\n /** @private */\n __effectivePosition: {\n type: String,\n computed: '__computePosition(position, _position)',\n },\n };\n }\n\n /** @protected */\n __computeHorizontalAlign(position) {\n return ['top-end', 'bottom-end', 'start-top', 'start', 'start-bottom'].includes(position) ? 'end' : 'start';\n }\n\n /** @protected */\n __computeNoHorizontalOverlap(position) {\n return ['start-top', 'start', 'start-bottom', 'end-top', 'end', 'end-bottom'].includes(position);\n }\n\n /** @protected */\n __computeNoVerticalOverlap(position) {\n return ['top-start', 'top-end', 'top', 'bottom-start', 'bottom', 'bottom-end'].includes(position);\n }\n\n /** @protected */\n __computeVerticalAlign(position) {\n return ['top-start', 'top-end', 'top', 'start-bottom', 'end-bottom'].includes(position) ? 'bottom' : 'top';\n }\n\n /** @private */\n __computePosition(position, defaultPosition) {\n return position || defaultPosition;\n }\n };\n","/**\n * @license\n * Copyright (c) 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { microTask } from '@vaadin/component-base/src/async.js';\nimport { Debouncer } from '@vaadin/component-base/src/debounce.js';\n\n/**\n * A mixin providing popover target functionality.\n *\n * @polymerMixin\n */\nexport const PopoverTargetMixin = (superClass) =>\n class PopoverTargetMixinClass extends superClass {\n static get properties() {\n return {\n /**\n * The id of the element to be used as `target` value.\n * The element should be in the DOM by the time when\n * the attribute is set, otherwise a warning is shown.\n */\n for: {\n type: String,\n observer: '__forChanged',\n },\n\n /**\n * Reference to the DOM element used both to trigger the overlay\n * by user interaction and to visually position it on the screen.\n *\n * Defaults to an element referenced with `for` attribute, in\n * which case it must be located in the same shadow scope.\n */\n target: {\n type: Object,\n observer: '__targetChanged',\n },\n };\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n\n if (this.target) {\n this._addTargetListeners(this.target);\n }\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n\n if (this.target) {\n this._removeTargetListeners(this.target);\n }\n }\n\n /** @private */\n __forChanged(forId) {\n if (forId) {\n this.__setTargetByIdDebouncer = Debouncer.debounce(this.__setTargetByIdDebouncer, microTask, () =>\n this.__setTargetById(forId),\n );\n }\n }\n\n /** @private */\n __setTargetById(targetId) {\n if (!this.isConnected) {\n return;\n }\n\n const target = this.getRootNode().getElementById(targetId);\n\n if (target) {\n this.target = target;\n } else {\n console.warn(`No element with id=\"${targetId}\" set via \"for\" property found on the page.`);\n }\n }\n\n /** @private */\n __targetChanged(target, oldTarget) {\n if (oldTarget) {\n this._removeTargetListeners(oldTarget);\n }\n\n if (target) {\n this._addTargetListeners(target);\n }\n }\n\n /**\n * @param {HTMLElement} _target\n * @protected\n */\n _addTargetListeners(_target) {\n // To be implemented.\n }\n\n /**\n * @param {HTMLElement} _target\n * @protected\n */\n _removeTargetListeners(_target) {\n // To be implemented.\n }\n };\n","/**\n * @license\n * Copyright (c) 2024 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport './vaadin-popover-overlay.js';\nimport { css, html, LitElement } from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport {\n getDeepActiveElement,\n getFocusableElements,\n isElementFocused,\n isKeyboardActive,\n} from '@vaadin/a11y-base/src/focus-utils.js';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';\nimport { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';\nimport { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';\nimport { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';\nimport { isLastOverlay } from '@vaadin/overlay/src/vaadin-overlay-stack-mixin.js';\nimport { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';\nimport { PopoverPositionMixin } from './vaadin-popover-position-mixin.js';\nimport { PopoverTargetMixin } from './vaadin-popover-target-mixin.js';\n\nconst DEFAULT_DELAY = 500;\n\nlet defaultFocusDelay = DEFAULT_DELAY;\nlet defaultHoverDelay = DEFAULT_DELAY;\nlet defaultHideDelay = DEFAULT_DELAY;\n\n/**\n * Controller for handling popover opened state.\n */\nclass PopoverOpenedStateController {\n constructor(host) {\n this.host = host;\n }\n\n /**\n * Whether closing is currently in progress.\n * @return {boolean}\n */\n get isClosing() {\n return this.__closeTimeout != null;\n }\n\n /** @private */\n get __focusDelay() {\n const popover = this.host;\n return popover.focusDelay != null && popover.focusDelay >= 0 ? popover.focusDelay : defaultFocusDelay;\n }\n\n /** @private */\n get __hoverDelay() {\n const popover = this.host;\n return popover.hoverDelay != null && popover.hoverDelay >= 0 ? popover.hoverDelay : defaultHoverDelay;\n }\n\n /** @private */\n get __hideDelay() {\n const popover = this.host;\n return popover.hideDelay != null && popover.hideDelay >= 0 ? popover.hideDelay : defaultHideDelay;\n }\n\n /**\n * Schedule opening the popover.\n * @param {Object} options\n */\n open(options = { immediate: false }) {\n const { immediate, trigger } = options;\n const shouldDelayHover = trigger === 'hover' && this.__hoverDelay > 0;\n const shouldDelayFocus = trigger === 'focus' && this.__focusDelay > 0;\n\n if (!immediate && (shouldDelayHover || shouldDelayFocus) && !this.__closeTimeout) {\n this.__scheduleOpen(trigger);\n } else {\n this.__showPopover();\n }\n }\n\n /**\n * Schedule closing the popover.\n * @param {boolean} immediate\n */\n close(immediate) {\n if (!immediate && this.__hideDelay > 0) {\n this.__scheduleClose();\n } else {\n this.__abortClose();\n this.__setOpened(false);\n }\n\n this.__abortOpen();\n }\n\n /** @private */\n __setOpened(opened) {\n this.host.opened = opened;\n }\n\n /** @private */\n __showPopover() {\n this.__abortClose();\n this.__setOpened(true);\n }\n\n /** @private */\n __abortClose() {\n if (this.__closeTimeout) {\n clearTimeout(this.__closeTimeout);\n this.__closeTimeout = null;\n }\n }\n\n /** @private */\n __abortOpen() {\n if (this.__openTimeout) {\n clearTimeout(this.__openTimeout);\n this.__openTimeout = null;\n }\n }\n\n /** @private */\n __scheduleClose() {\n this.__closeTimeout = setTimeout(() => {\n this.__closeTimeout = null;\n this.__setOpened(false);\n }, this.__hideDelay);\n }\n\n /** @private */\n __scheduleOpen(trigger) {\n this.__abortOpen();\n\n const delay = trigger === 'focus' ? this.__focusDelay : this.__hoverDelay;\n this.__openTimeout = setTimeout(() => {\n this.__openTimeout = null;\n this.__showPopover();\n }, delay);\n }\n}\n\n/**\n * `<vaadin-popover>` is a Web Component for creating overlays\n * that are positioned next to specified DOM element (target).\n *\n * Unlike `<vaadin-tooltip>`, the popover supports rich content\n * that can be provided by using `renderer` function.\n *\n * ### Styling\n *\n * `<vaadin-popover>` uses `<vaadin-popover-overlay>` internal\n * themable component as the actual visible overlay.\n *\n * See [`<vaadin-overlay>`](#/elements/vaadin-overlay) documentation\n * for `<vaadin-popover-overlay>` parts.\n *\n * In addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n *\n * Part name | Description\n * -----------------|-------------------------------------------\n * `arrow` | Optional arrow pointing to the target when using `theme=\"arrow\"`\n *\n * The following state attributes are available for styling:\n *\n * Attribute | Description\n * -----------------|----------------------------------------\n * `position` | Reflects the `position` property value.\n *\n * Note: the `theme` attribute value set on `<vaadin-popover>` is\n * propagated to the internal `<vaadin-popover-overlay>` component.\n *\n * ### Custom CSS Properties\n *\n * The following custom CSS properties are available on the `<vaadin-popover>` element:\n *\n * Custom CSS property | Description\n * ---------------------------------|-------------\n * `--vaadin-popover-offset-top` | Used as an offset when the popover is aligned vertically below the target\n * `--vaadin-popover-offset-bottom` | Used as an offset when the popover is aligned vertically above the target\n * `--vaadin-popover-offset-start` | Used as an offset when the popover is aligned horizontally after the target\n * `--vaadin-popover-offset-end` | Used as an offset when the popover is aligned horizontally before the target\n *\n * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n *\n * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.\n * @fires {CustomEvent} closed - Fired when the popover is closed.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ElementMixin\n * @mixes OverlayClassMixin\n * @mixes PopoverPositionMixin\n * @mixes PopoverTargetMixin\n * @mixes ThemePropertyMixin\n */\nclass Popover extends PopoverPositionMixin(\n PopoverTargetMixin(OverlayClassMixin(ThemePropertyMixin(ElementMixin(PolylitMixin(LitElement))))),\n) {\n static get is() {\n return 'vaadin-popover';\n }\n\n static get styles() {\n return css`\n :host {\n display: none !important;\n }\n `;\n }\n\n static get properties() {\n return {\n /**\n * String used to label the overlay to screen reader users.\n *\n * @attr {string} accessible-name\n */\n accessibleName: {\n type: String,\n },\n\n /**\n * Id of the element used as label of the overlay to screen reader users.\n *\n * @attr {string} accessible-name-ref\n */\n accessibleNameRef: {\n type: String,\n },\n\n /**\n * When true, the popover content automatically receives focus after\n * it is opened. Modal popovers use this behavior by default.\n */\n autofocus: {\n type: Boolean,\n },\n\n /**\n * Height to be set on the overlay content.\n *\n * @attr {string} content-height\n */\n contentHeight: {\n type: String,\n },\n\n /**\n * Width to be set on the overlay content.\n *\n * @attr {string} content-width\n */\n contentWidth: {\n type: String,\n },\n\n /**\n * The delay in milliseconds before the popover is opened\n * on focus when the corresponding trigger is used.\n *\n * When not specified, the global default (500ms) is used.\n *\n * @attr {number} focus-delay\n */\n focusDelay: {\n type: Number,\n },\n\n /**\n * The delay in milliseconds before the popover is closed\n * on losing hover, when the corresponding trigger is used.\n * On blur, the popover is closed immediately.\n *\n * When not specified, the global default (500ms) is used.\n *\n * @attr {number} hide-delay\n */\n hideDelay: {\n type: Number,\n },\n\n /**\n * The delay in milliseconds before the popover is opened\n * on hover when the corresponding trigger is used.\n *\n * When not specified, the global default (500ms) is used.\n *\n * @attr {number} hover-delay\n */\n hoverDelay: {\n type: Number,\n },\n\n /**\n * True if the popover overlay is opened, false otherwise.\n */\n opened: {\n type: Boolean,\n value: false,\n notify: true,\n observer: '__openedChanged',\n },\n\n /**\n * The `role` attribute value to be set on the overlay.\n *\n * @attr {string} overlay-role\n */\n overlayRole: {\n type: String,\n value: 'dialog',\n },\n\n /**\n * Custom function for rendering the content of the overlay.\n * Receives two arguments:\n *\n * - `root` The root container DOM element. Append your content to it.\n * - `popover` The reference to the `vaadin-popover` element (overlay host).\n */\n renderer: {\n type: Object,\n },\n\n /**\n * When true, the popover prevents interacting with background elements\n * by setting `pointer-events` style on the document body to `none`.\n * This also enables trapping focus inside the overlay.\n */\n modal: {\n type: Boolean,\n value: false,\n },\n\n /**\n * Set to true to disable closing popover overlay on outside click.\n *\n * @attr {boolean} no-close-on-outside-click\n */\n noCloseOnOutsideClick: {\n type: Boolean,\n value: false,\n },\n\n /**\n * Set to true to disable closing popover overlay on Escape press.\n * When the popover is modal, pressing Escape anywhere in the\n * document closes the overlay. Otherwise, only Escape press\n * from the popover itself or its target closes the overlay.\n *\n * @attr {boolean} no-close-on-esc\n */\n noCloseOnEsc: {\n type: Boolean,\n value: false,\n },\n\n /**\n * Popover trigger mode, used to configure how the overlay is opened or closed.\n * Could be set to multiple by providing an array, e.g. `trigger = ['hover', 'focus']`.\n *\n * Supported values:\n * - `click` (default) - opens and closes on target click.\n * - `hover` - opens on target mouseenter, closes on target mouseleave. Moving mouse\n * to the popover overlay content keeps the overlay opened.\n * - `focus` - opens on target focus, closes on target blur. Moving focus to the\n * popover overlay content keeps the overlay opened.\n *\n * In addition to the behavior specified by `trigger`, the popover can be closed by:\n * - pressing Escape key (unless `noCloseOnEsc` property is true)\n * - outside click (unless `noCloseOnOutsideClick` property is true)\n *\n * When setting `trigger` property to `null`, `undefined` or empty array, the popover\n * can be only opened or closed programmatically by changing `opened` property.\n */\n trigger: {\n type: Array,\n value: () => ['click'],\n },\n\n /**\n * When true, the overlay has a backdrop (modality curtain) on top of the\n * underlying page content, covering the whole viewport.\n *\n * @attr {boolean} with-backdrop\n */\n withBackdrop: {\n type: Boolean,\n value: false,\n },\n\n /** @private */\n __shouldRestoreFocus: {\n type: Boolean,\n value: false,\n sync: true,\n },\n\n /** @private */\n __overlayId: {\n type: String,\n },\n };\n }\n\n static get observers() {\n return [\n '__updateContentHeight(contentHeight, _overlayElement)',\n '__updateContentWidth(contentWidth, _overlayElement)',\n '__openedOrTargetChanged(opened, target)',\n '__overlayRoleOrTargetChanged(overlayRole, target)',\n ];\n }\n\n /**\n * Sets the default focus delay to be used by all popover instances,\n * except for those that have focus delay configured using property.\n *\n * @param {number} focusDelay\n */\n static setDefaultFocusDelay(focusDelay) {\n defaultFocusDelay = focusDelay != null && focusDelay >= 0 ? focusDelay : DEFAULT_DELAY;\n }\n\n /**\n * Sets the default hide delay to be used by all popover instances,\n * except for those that have hide delay configured using property.\n *\n * @param {number} hideDelay\n */\n static setDefaultHideDelay(hideDelay) {\n defaultHideDelay = hideDelay != null && hideDelay >= 0 ? hideDelay : DEFAULT_DELAY;\n }\n\n /**\n * Sets the default hover delay to be used by all popover instances,\n * except for those that have hover delay configured using property.\n *\n * @param {number} hoverDelay\n */\n static setDefaultHoverDelay(hoverDelay) {\n defaultHoverDelay = hoverDelay != null && hoverDelay >= 0 ? hoverDelay : DEFAULT_DELAY;\n }\n\n constructor() {\n super();\n\n this.__overlayId = `vaadin-popover-${generateUniqueId()}`;\n\n this.__onGlobalClick = this.__onGlobalClick.bind(this);\n this.__onGlobalKeyDown = this.__onGlobalKeyDown.bind(this);\n this.__onTargetClick = this.__onTargetClick.bind(this);\n this.__onTargetFocusIn = this.__onTargetFocusIn.bind(this);\n this.__onTargetFocusOut = this.__onTargetFocusOut.bind(this);\n this.__onTargetMouseEnter = this.__onTargetMouseEnter.bind(this);\n this.__onTargetMouseLeave = this.__onTargetMouseLeave.bind(this);\n\n this._openedStateController = new PopoverOpenedStateController(this);\n }\n\n /** @protected */\n render() {\n const effectivePosition = this.__effectivePosition;\n\n return html`\n <vaadin-popover-overlay\n id=\"${this.__overlayId}\"\n role=\"${this.overlayRole}\"\n aria-label=\"${ifDefined(this.accessibleName)}\"\n aria-labelledby=\"${ifDefined(this.accessibleNameRef)}\"\n .renderer=\"${this.renderer}\"\n .owner=\"${this}\"\n theme=\"${ifDefined(this._theme)}\"\n .positionTarget=\"${this.target}\"\n .position=\"${effectivePosition}\"\n .opened=\"${this.opened}\"\n .modeless=\"${!this.modal}\"\n .focusTrap=\"${this.modal}\"\n .withBackdrop=\"${this.withBackdrop}\"\n ?no-horizontal-overlap=\"${this.__computeNoHorizontalOverlap(effectivePosition)}\"\n ?no-vertical-overlap=\"${this.__computeNoVerticalOverlap(effectivePosition)}\"\n .horizontalAlign=\"${this.__computeHorizontalAlign(effectivePosition)}\"\n .verticalAlign=\"${this.__computeVerticalAlign(effectivePosition)}\"\n @mousedown=\"${this.__onOverlayMouseDown}\"\n @mouseenter=\"${this.__onOverlayMouseEnter}\"\n @mouseleave=\"${this.__onOverlayMouseLeave}\"\n @focusin=\"${this.__onOverlayFocusIn}\"\n @focusout=\"${this.__onOverlayFocusOut}\"\n @opened-changed=\"${this.__onOpenedChanged}\"\n .restoreFocusOnClose=\"${this.__shouldRestoreFocus}\"\n .restoreFocusNode=\"${this.target}\"\n @vaadin-overlay-escape-press=\"${this.__onEscapePress}\"\n @vaadin-overlay-outside-click=\"${this.__onOutsideClick}\"\n @vaadin-overlay-open=\"${this.__onOverlayOpened}\"\n @vaadin-overlay-closed=\"${this.__onOverlayClosed}\"\n ></vaadin-popover-overlay>\n `;\n }\n\n /**\n * Requests an update for the content of the popover.\n * While performing the update, it invokes the renderer passed in the `renderer` property.\n *\n * It is not guaranteed that the update happens immediately (synchronously) after it is requested.\n */\n requestContentUpdate() {\n if (!this.renderer || !this._overlayElement) {\n return;\n }\n\n this._overlayElement.requestContentUpdate();\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this._overlayElement = this.shadowRoot.querySelector('vaadin-popover-overlay');\n }\n\n /** @protected */\n connectedCallback() {\n super.connectedCallback();\n\n document.documentElement.addEventListener('click', this.__onGlobalClick, true);\n }\n\n /** @protected */\n disconnectedCallback() {\n super.disconnectedCallback();\n\n document.documentElement.removeEventListener('click', this.__onGlobalClick, true);\n\n this._openedStateController.close(true);\n }\n\n /**\n * @param {HTMLElement} target\n * @protected\n * @override\n */\n _addTargetListeners(target) {\n target.addEventListener('click', this.__onTargetClick);\n target.addEventListener('mouseenter', this.__onTargetMouseEnter);\n target.addEventListener('mouseleave', this.__onTargetMouseLeave);\n target.addEventListener('focusin', this.__onTargetFocusIn);\n target.addEventListener('focusout', this.__onTargetFocusOut);\n }\n\n /**\n * @param {HTMLElement} target\n * @protected\n * @override\n */\n _removeTargetListeners(target) {\n target.removeEventListener('click', this.__onTargetClick);\n target.removeEventListener('mouseenter', this.__onTargetMouseEnter);\n target.removeEventListener('mouseleave', this.__onTargetMouseLeave);\n target.removeEventListener('focusin', this.__onTargetFocusIn);\n target.removeEventListener('focusout', this.__onTargetFocusOut);\n }\n\n /** @private */\n __openedChanged(opened, oldOpened) {\n if (opened) {\n document.addEventListener('keydown', this.__onGlobalKeyDown, true);\n } else if (oldOpened) {\n document.removeEventListener('keydown', this.__onGlobalKeyDown, true);\n }\n }\n\n /** @private */\n __openedOrTargetChanged(opened, target) {\n if (target) {\n target.setAttribute('aria-expanded', opened ? 'true' : 'false');\n\n if (opened) {\n target.setAttribute('aria-controls', this.__overlayId);\n } else {\n target.removeAttribute('aria-controls');\n }\n }\n }\n\n /** @private */\n __overlayRoleOrTargetChanged(overlayRole, target) {\n if (this.__oldTarget) {\n this.__oldTarget.removeAttribute('aria-haspopup');\n }\n\n if (target) {\n const isDialog = overlayRole === 'dialog' || overlayRole === 'alertdialog';\n target.setAttribute('aria-haspopup', isDialog ? 'dialog' : 'true');\n\n this.__oldTarget = target;\n }\n }\n\n /**\n * Overlay's global outside click listener doesn't work when\n * the overlay is modeless, so we use a separate listener.\n * @private\n */\n __onGlobalClick(event) {\n if (\n this.opened &&\n !this.__isManual &&\n !this.modal &&\n !event.composedPath().some((el) => el === this._overlayElement || el === this.target) &&\n !this.noCloseOnOutsideClick &&\n isLastOverlay(this._overlayElement)\n ) {\n this._openedStateController.close(true);\n }\n }\n\n /** @private */\n __onTargetClick() {\n if (this.__hasTrigger('click')) {\n if (!this.opened) {\n this.__shouldRestoreFocus = true;\n }\n if (this.opened) {\n this._openedStateController.close(true);\n } else {\n this._openedStateController.open({ immediate: true });\n }\n }\n }\n\n /**\n * Overlay's global Escape press listener doesn't work when\n * the overlay is modeless, so we use a separate listener.\n * @private\n */\n __onGlobalKeyDown(event) {\n // Modal popover uses overlay logic for Esc key and focus trap.\n if (this.modal) {\n return;\n }\n\n if (\n event.key === 'Escape' &&\n !this.noCloseOnEsc &&\n this.opened &&\n !this.__isManual &&\n isLastOverlay(this._overlayElement)\n ) {\n // Prevent closing parent overlay (e.g. dialog)\n event.stopPropagation();\n this._openedStateController.close(true);\n }\n\n // Include popover content in the Tab order after the target.\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n this.__onGlobalShiftTab(event);\n } else {\n this.__onGlobalTab(event);\n }\n }\n }\n\n /** @private */\n __onGlobalTab(event) {\n const overlayPart = this._overlayElement.$.overlay;\n\n // Move focus to the popover content on target element Tab\n if (this.target && isElementFocused(this.target)) {\n event.preventDefault();\n overlayPart.focus();\n return;\n }\n\n // Move focus to the next element after target on content Tab\n const lastFocusable = this.__getLastFocusable(overlayPart);\n if (lastFocusable && isElementFocused(lastFocusable)) {\n const focusable = this.__getNextBodyFocusable(this.target);\n if (focusable && focusable !== overlayPart) {\n event.preventDefault();\n focusable.focus();\n return;\n }\n }\n\n // Prevent focusing the popover content on previous element Tab\n const activeElement = getDeepActiveElement();\n const nextFocusable = this.__getNextBodyFocusable(activeElement);\n if (nextFocusable === overlayPart && lastFocusable) {\n // Move focus to the last overlay focusable and do NOT prevent keydown\n // to move focus outside the popover content (e.g. to the URL bar).\n lastFocusable.focus();\n }\n }\n\n /** @private */\n __onGlobalShiftTab(event) {\n const overlayPart = this._overlayElement.$.overlay;\n\n // Prevent restoring focus after target blur on Shift + Tab\n if (this.target && isElementFocused(this.target) && this.__shouldRestoreFocus) {\n this.__shouldRestoreFocus = false;\n return;\n }\n\n // Move focus back to the target on overlay content Shift + Tab\n if (this.target && isElementFocused(overlayPart)) {\n event.preventDefault();\n this.target.focus();\n return;\n }\n\n // Move focus back to the popover on next element Shift + Tab\n const nextFocusable = this.__getNextBodyFocusable(this.target);\n if (nextFocusable && isElementFocused(nextFocusable)) {\n const lastFocusable = this.__getLastFocusable(overlayPart);\n if (lastFocusable) {\n event.preventDefault();\n lastFocusable.focus();\n }\n }\n }\n\n /** @private */\n __getNextBodyFocusable(target) {\n const focusables = getFocusableElements(document.body);\n const idx = focusables.findIndex((el) => el === target);\n return focusables[idx + 1];\n }\n\n /** @private */\n __getLastFocusable(container) {\n const focusables = getFocusableElements(container);\n return focusables.pop();\n }\n\n /** @private */\n __onTargetFocusIn() {\n this.__focusInside = true;\n\n if (this.__hasTrigger('focus')) {\n // When trigger is set to both focus and click, only open on\n // keyboard focus, to prevent issue when immediately closing\n // on click which occurs after the focus caused by mousedown.\n if (this.__hasTrigger('click') && !isKeyboardActive()) {\n return;\n }\n\n // Prevent overlay re-opening when restoring focus on close.\n if (!this.__shouldRestoreFocus) {\n this.__shouldRestoreFocus = true;\n this._openedStateController.open({ trigger: 'focus' });\n }\n }\n }\n\n /** @private */\n __onTargetFocusOut(event) {\n // Do not close the popover on overlay focusout if it's not the last one.\n // This covers the case when focus moves to the nested popover opened\n // without focusing parent popover overlay (e.g. using hover trigger).\n if (!isLastOverlay(this._overlayElement)) {\n return;\n }\n\n if ((this.__hasTrigger('focus') && this.__mouseDownInside) || this._overlayElement.contains(event.relatedTarget)) {\n return;\n }\n\n this.__handleFocusout();\n }\n\n /** @private */\n __onTargetMouseEnter() {\n this.__hoverInside = true;\n\n if (this.__hasTrigger('hover') && !this.opened) {\n // Prevent closing due to `pointer-events: none` set on body.\n if (this.modal) {\n this.target.style.pointerEvents = 'auto';\n }\n this._openedStateController.open({ trigger: 'hover' });\n }\n }\n\n /** @private */\n __onTargetMouseLeave(event) {\n // Do not close the popover on target focusout if the overlay is not the last one.\n // This happens e.g. when opening the nested popover that uses non-modal overlay.\n if (this._overlayElement.opened && !isLastOverlay(this._overlayElement)) {\n return;\n }\n\n if (this._overlayElement.contains(event.relatedTarget)) {\n return;\n }\n\n this.__handleMouseLeave();\n }\n\n /** @private */\n __onOverlayFocusIn() {\n this.__focusInside = true;\n\n // When using Tab to move focus, restoring focus is reset. However, if pressing Tab\n // causes focus to be moved inside the overlay, we should restore focus on close.\n if (this.__hasTrigger('focus') || this.__hasTrigger('click')) {\n this.__shouldRestoreFocus = true;\n }\n }\n\n /** @private */\n __onOverlayFocusOut(event) {\n // Do not close the popover on overlay focusout if it's not the last one.\n // This covers the following cases of nested overlay based components:\n // 1. Moving focus to the nested overlay (e.g. vaadin-select, vaadin-menu-bar)\n // 2. Closing not focused nested overlay on outside (e.g. vaadin-combo-box)\n if (!isLastOverlay(this._overlayElement)) {\n return;\n }\n\n if (\n (this.__hasTrigger('focus') && this.__mouseDownInside) ||\n event.relatedTarget === this.target ||\n this._overlayElement.contains(event.relatedTarget)\n ) {\n return;\n }\n\n this.__handleFocusout();\n }\n\n /** @private */\n __onOverlayMouseDown() {\n if (this.__hasTrigger('focus')) {\n this.__mouseDownInside = true;\n\n document.addEventListener(\n 'mouseup',\n () => {\n this.__mouseDownInside = false;\n },\n { once: true },\n );\n }\n }\n\n /** @private */\n __onOverlayMouseEnter() {\n this.__hoverInside = true;\n\n // Prevent closing if cursor moves to the overlay during hide delay.\n if (this.__hasTrigger('hover') && this._openedStateController.isClosing) {\n this._openedStateController.open({ immediate: true });\n }\n }\n\n /** @private */\n __onOverlayMouseLeave(event) {\n // Do not close the popover on overlay focusout if it's not the last one.\n // This happens when opening the nested component that uses \"modal\" overlay\n // setting `pointer-events: none` on the body (combo-box, date-picker etc).\n if (!isLastOverlay(this._overlayElement)) {\n return;\n }\n\n if (event.relatedTarget === this.target) {\n return;\n }\n\n this.__handleMouseLeave();\n }\n\n /** @private */\n __handleFocusout() {\n this.__focusInside = false;\n\n if (this.__hasTrigger('hover') && this.__hoverInside) {\n return;\n }\n\n if (this.__hasTrigger('focus')) {\n this._openedStateController.close(true);\n }\n }\n\n /** @private */\n __handleMouseLeave() {\n this.__hoverInside = false;\n\n if (this.__hasTrigger('focus') && this.__focusInside) {\n return;\n }\n\n if (this.__hasTrigger('hover')) {\n this._openedStateController.close();\n }\n }\n\n /** @private */\n __onOpenedChanged(event) {\n this.opened = event.detail.value;\n }\n\n /** @private */\n __onOverlayOpened() {\n if (this.autofocus && !this.modal) {\n this._overlayElement.$.overlay.focus();\n }\n }\n\n /** @private */\n __onOverlayClosed() {\n // Reset restoring focus state after a timeout to make sure focus was restored\n // and then allow re-opening overlay on re-focusing target with focus trigger.\n if (this.__shouldRestoreFocus) {\n setTimeout(() => {\n this.__shouldRestoreFocus = false;\n });\n }\n\n // Restore pointer-events set when opening on hover.\n if (this.modal && this.target.style.pointerEvents) {\n this.target.style.pointerEvents = '';\n }\n\n this.dispatchEvent(new CustomEvent('closed'));\n }\n\n /**\n * Close the popover if `noCloseOnEsc` isn't set to true.\n * @private\n */\n __onEscapePress(e) {\n if (this.noCloseOnEsc || this.__isManual) {\n e.preventDefault();\n }\n }\n\n /**\n * Close the popover if `noCloseOnOutsideClick` isn't set to true.\n * @private\n */\n __onOutsideClick(e) {\n if (this.noCloseOnOutsideClick || this.__isManual) {\n e.preventDefault();\n }\n }\n\n /** @private */\n __hasTrigger(trigger) {\n return Array.isArray(this.trigger) && this.trigger.includes(trigger);\n }\n\n /** @private */\n get __isManual() {\n return this.trigger == null || (Array.isArray(this.trigger) && this.trigger.length === 0);\n }\n\n /** @private */\n __updateDimension(overlay, dimension, value) {\n const prop = `--_vaadin-popover-content-${dimension}`;\n\n if (value) {\n overlay.style.setProperty(prop, value);\n } else {\n overlay.style.removeProperty(prop);\n }\n }\n\n /** @private */\n __updateContentHeight(height, overlay) {\n if (overlay) {\n this.__updateDimension(overlay, 'height', height);\n }\n }\n\n /** @private */\n __updateContentWidth(width, overlay) {\n if (overlay) {\n this.__updateDimension(overlay, 'width', width);\n }\n }\n\n /**\n * Fired when the popover is closed.\n *\n * @event closed\n */\n}\n\ndefineCustomElement(Popover);\n\nexport { Popover };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { InputController } from '@vaadin/field-base/src/input-controller.js';\nimport { InputFieldMixin } from '@vaadin/field-base/src/input-field-mixin.js';\nimport { LabelledInputController } from '@vaadin/field-base/src/labelled-input-controller.js';\n\n/**\n * A mixin providing common text field functionality.\n *\n * @polymerMixin\n * @mixes InputFieldMixin\n */\nexport const TextFieldMixin = (superClass) =>\n class TextFieldMixinClass extends InputFieldMixin(superClass) {\n static get properties() {\n return {\n /**\n * Maximum number of characters (in Unicode code points) that the user can enter.\n */\n maxlength: {\n type: Number,\n },\n\n /**\n * Minimum number of characters (in Unicode code points) that the user can enter.\n */\n minlength: {\n type: Number,\n },\n\n /**\n * A regular expression that the value is checked against.\n * The pattern must match the entire value, not just some subset.\n */\n pattern: {\n type: String,\n },\n };\n }\n\n static get delegateAttrs() {\n return [...super.delegateAttrs, 'maxlength', 'minlength', 'pattern'];\n }\n\n static get constraints() {\n return [...super.constraints, 'maxlength', 'minlength', 'pattern'];\n }\n\n constructor() {\n super();\n this._setType('text');\n }\n\n /** @protected */\n get clearElement() {\n return this.$.clearButton;\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this.addController(\n new InputController(this, (input) => {\n this._setInputElement(input);\n this._setFocusElement(input);\n this.stateTarget = input;\n this.ariaTarget = input;\n }),\n );\n this.addController(new LabelledInputController(this.inputElement, this._labelController));\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport '@vaadin/input-container/src/vaadin-input-container.js';\nimport { html, PolymerElement } from '@polymer/polymer';\nimport { defineCustomElement } from '@vaadin/component-base/src/define.js';\nimport { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';\nimport { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';\nimport { inputFieldShared } from '@vaadin/field-base/src/styles/input-field-shared-styles.js';\nimport { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\nimport { TextFieldMixin } from './vaadin-text-field-mixin.js';\n\nregisterStyles('vaadin-text-field', inputFieldShared, { moduleId: 'vaadin-text-field-styles' });\n\n/**\n * `<vaadin-text-field>` is a web component that allows the user to input and edit text.\n *\n * ```html\n * <vaadin-text-field label=\"First Name\"></vaadin-text-field>\n * ```\n *\n * ### Prefixes and suffixes\n *\n * These are child elements of a `<vaadin-text-field>` that are displayed\n * inline with the input, before or after.\n * In order for an element to be considered as a prefix, it must have the slot\n * attribute set to `prefix` (and similarly for `suffix`).\n *\n * ```html\n * <vaadin-text-field label=\"Email address\">\n * <div slot=\"prefix\">Sent to:</div>\n * <div slot=\"suffix\">@vaadin.com</div>\n * </vaadin-text-field>\n * ```\n *\n * ### Styling\n *\n * The following custom properties are available for styling:\n *\n * Custom property | Description | Default\n * -------------------------------|----------------------------|---------\n * `--vaadin-field-default-width` | Default width of the field | `12em`\n *\n * The following shadow DOM parts are available for styling:\n *\n * Part name | Description\n * ---------------------|----------------\n * `label` | The label element\n * `input-field` | The element that wraps prefix, value and suffix\n * `clear-button` | The clear button\n * `error-message` | The error message element\n * `helper-text` | The helper text element wrapper\n * `required-indicator` | The `required` state indicator element\n *\n * The following state attributes are available for styling:\n *\n * Attribute | Description | Part name\n * --------------------|-------------|------------\n * `disabled` | Set to a disabled text field | :host\n * `has-value` | Set when the element has a value | :host\n * `has-label` | Set when the element has a label | :host\n * `has-helper` | Set when the element has helper text or slot | :host\n * `has-error-message` | Set when the element has an error message | :host\n * `invalid` | Set when the element is invalid | :host\n * `input-prevented` | Temporarily set when invalid input is prevented | :host\n * `focused` | Set when the element is focused | :host\n * `focus-ring` | Set when the element is keyboard focused | :host\n * `readonly` | Set to a readonly text field | :host\n *\n * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n *\n * @fires {Event} input - Fired when the value is changed by the user: on every typing keystroke, and the value is cleared using the clear button.\n * @fires {Event} change - Fired when the user commits a value change.\n * @fires {CustomEvent} invalid-changed - Fired when the `invalid` property changes.\n * @fires {CustomEvent} value-changed - Fired when the `value` property changes.\n * @fires {CustomEvent} validated - Fired whenever the field is validated.\n *\n * @customElement\n * @extends HTMLElement\n * @mixes ElementMixin\n * @mixes ThemableMixin\n * @mixes TextFieldMixin\n */\nexport class TextField extends TextFieldMixin(ThemableMixin(ElementMixin(PolymerElement))) {\n static get is() {\n return 'vaadin-text-field';\n }\n\n static get template() {\n return html`\n <style>\n [part='input-field'] {\n flex-grow: 0;\n }\n </style>\n\n <div class=\"vaadin-field-container\">\n <div part=\"label\">\n <slot name=\"label\"></slot>\n <span part=\"required-indicator\" aria-hidden=\"true\" on-click=\"focus\"></span>\n </div>\n\n <vaadin-input-container\n part=\"input-field\"\n readonly=\"[[readonly]]\"\n disabled=\"[[disabled]]\"\n invalid=\"[[invalid]]\"\n theme$=\"[[_theme]]\"\n >\n <slot name=\"prefix\" slot=\"prefix\"></slot>\n <slot name=\"input\"></slot>\n <slot name=\"suffix\" slot=\"suffix\"></slot>\n <div id=\"clearButton\" part=\"clear-button\" slot=\"suffix\" aria-hidden=\"true\"></div>\n </vaadin-input-container>\n\n <div part=\"helper-text\">\n <slot name=\"helper\"></slot>\n </div>\n\n <div part=\"error-message\">\n <slot name=\"error-message\"></slot>\n </div>\n </div>\n <slot name=\"tooltip\"></slot>\n `;\n }\n\n static get properties() {\n return {\n /**\n * Maximum number of characters (in Unicode code points) that the user can enter.\n */\n maxlength: {\n type: Number,\n },\n\n /**\n * Minimum number of characters (in Unicode code points) that the user can enter.\n */\n minlength: {\n type: Number,\n },\n };\n }\n\n /** @protected */\n ready() {\n super.ready();\n\n this._tooltipController = new TooltipController(this);\n this._tooltipController.setPosition('top');\n this._tooltipController.setAriaTarget(this.inputElement);\n this.addController(this._tooltipController);\n }\n}\n\ndefineCustomElement(TextField);\n","/**\n * @license\n * Copyright (c) 2017 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport '@vaadin/input-container/theme/lumo/vaadin-input-container-styles.js';\nimport { inputFieldShared } from '@vaadin/vaadin-lumo-styles/mixins/input-field-shared.js';\nimport { registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';\n\nregisterStyles('vaadin-text-field', inputFieldShared, {\n moduleId: 'lumo-text-field-styles',\n});\n"],"names":["InputFieldMixin","superclass","properties","autocomplete","type","String","autocorrect","autocapitalize","reflectToAttribute","delegateAttrs","super","__data","this","__dataValue","value","_inputElementChanged","input","console","warn","localName","_setFocused","focused","document","hasFocus","validate","_onInput","event","invalid","_valueChanged","newValue","oldValue","undefined","keyboardActive","getDeepActiveElement","host","activeElement","body","shadowRoot","isKeyboardActive","hasLowerTabOrder","a","b","ati","Math","max","tabIndex","bti","sortElementsByTabIndex","elements","len","length","pivot","ceil","left","right","result","push","shift","concat","mergeSortByTabIndex","slice","isElementFocused","element","getRootNode","collectFocusableNodes","node","nodeType","Node","ELEMENT_NODE","style","visibility","display","computedStyle","window","getComputedStyle","isElementHiddenDirectly","matches","isElementFocusable","getAttribute","Number","normalizeTabIndex","needsSort","children","assignedNodes","flatten","forEach","child","getFocusableElements","focusableElements","defineCustomElement","CustomElement","version","Object","defineProperty","get","defined","customElements","is","definedVersion","error","define","addEventListener","capture","directionSubscribers","alignDirs","documentDir","elementDir","setAttribute","removeAttribute","getDocumentDir","documentElement","MutationObserver","observe","attributes","attributeFilter","DirMixin","superClass","dir","converter","fromAttribute","attr","toAttribute","prop","__isRTL","connectedCallback","hasAttribute","__restoreSubscription","__subscribe","attributeChangedCallback","name","newValueEqlDocDir","indexOf","newValueEmptied","newDiffValue","__unsubscribe","disconnectedCallback","includes","_valueToNodeAttribute","attribute","_attributeToProperty","splice","appliedClassMixins","WeakMap","caseMap","CAMEL_TO_DASH","camelToDash","camel","replace","toLowerCase","upper","toUpperCase","substring","parseObserver","observerString","method","rest","split","observerProps","map","trim","getOrCreateMap","obj","prototype","hasOwnProperty","call","Map","PolylitMixin","mixin","createProperty","options","Boolean","Array","reflect","finalize","isArray","observers","complexObservers","observer","set","addCheckedInitializer","initializer","addInitializer","instance","getPropertyDescriptor","key","defaultDescriptor","sync","requestUpdate","hasUpdated","performUpdate","configurable","enumerable","readOnly","setter","notify","__notifyProps","notifyProps","Set","add","computed","assignComputedMethod","props","firstUpdated","$","renderRoot","querySelectorAll","id","ready","updated","constructor","__observers","__runObservers","__complexObservers","__runComplexObservers","__dynamicObservers","__runNotifyProps","__isReadyInvoked","setProperties","entries","__propKeys","_createMethodObserver","dynamicObservers","some","has","v","k","_","dispatchEvent","CustomEvent","detail","_get","path","object","reduce","property","_set","pathParts","lastPart","pop","target","part","klass","getPrototypeOf","wasMixinPreviouslyApplied","mixedClass","overlayStyles","ThemePropertyMixin","_theme","observedAttributes","_set_theme","themeRegistry","themableInstances","themableTagNames","getAllThemes","Vaadin","styleModules","getIncludePriority","moduleName","includePriority","startsWith","getIncludedStyles","theme","includedStyles","include","includeModuleId","includedTheme","find","s","moduleId","styles","getThemes","tagName","defaultModuleName","themes","filter","themeFor","themeForToken","RegExp","join","test","matchesThemeFor","sort","themeA","themeB","ThemableMixin","WeakRef","elementStyles","template","_template","elementClass","styleEl","createElement","textContent","cssText","getCssText","content","appendChild","addStylesToTemplate","getStylesForThis","finalizeStyles","themeStyles","flat","Infinity","superClassThemes","__themes","parent","inheritedThemes","flatMap","index","lastIndexOf","testUserAgent","regexp","navigator","userAgent","testPlatform","platform","vendor","isIPad","maxTouchPoints","isIOS","createEvent","counterMap","uncontrolledNodes","markerMap","lockCount","isElement","logError","args","hideOthers","originalTarget","parentNode","markerName","targets","from","controlAttribute","contains","x","correctTargets","markerCounter","hiddenNodes","elementsToKeep","elementsToStop","keep","el","slot","assignedSlot","deep","root","alreadyHidden","counterValue","markerValue","clear","delete","applyAttributeToOthers","HTMLElement","AriaModalController","callback","showModal","__showOthers","close","FocusRestorationController","saveFocus","focusNode","restoreFocus","preventScroll","setTimeout","focus","instances","FocusTrapController","__trapNode","__onKeyDown","bind","__focusableElements","__focusedElementIndex","hostConnected","hostDisconnected","removeEventListener","trapFocus","trapNode","Error","releaseFocus","preventDefault","backward","shiftKey","__focusNextElement","step","currentIndex","select","ControllerMixin","addController","__controllers","c","controller","isConnected","removeController","OverlayFocusMixin","focusTrap","restoreFocusOnClose","restoreFocusNode","__ariaModalController","__focusTrapController","__focusRestorationController","_resetFocus","_shouldRestoreFocus","_saveFocus","_trapFocus","overlay","_deepContains","n","doc","ownerDocument","getAttachedInstances","_hasOverlayStackMixin","__zIndex","getOverlayInstances","isLastOverlay","OverlayStackMixin","_last","bringToFront","zIndex","frontmost","o","parseFloat","_enterModalState","pointerEvents","_previousDocumentPointerEvents","_exitModalState","removeProperty","modeless","OverlayMixin","opened","owner","model","renderer","hidden","withBackdrop","_boundMouseDownListener","_mouseDownListener","_boundMouseUpListener","_mouseUpListener","_boundOutsideClickListener","_outsideClickListener","_boundKeydownListener","_keydownListener","_boundIosResizeListener","_detectIosNavbar","backdrop","requestContentUpdate","sourceEvent","evt","bubbles","cancelable","defaultPrevented","innerHeight","landscape","innerWidth","clientHeight","setProperty","_addGlobalListeners","_removeGlobalListeners","_rendererOrDataChanged","ownerOrModelChanged","_oldOwner","_oldModel","rendererChanged","_oldRenderer","hasOldRenderer","openedChanged","_oldOpened","innerHTML","_$litPart$","_modelessChanged","_openedChanged","wasOpened","_animatedOpening","_animatedClosing","_hiddenChanged","_flushAnimation","_shouldAnimate","getPropertyValue","_enqueueAnimation","handler","listener","_attachOverlay","_finishOpening","_placeholder","createComment","insertBefore","_finishClosing","_detachOverlay","removeChild","_mouseDownInside","composedPath","_mouseUpInside","_shouldCloseOnOutsideClick","_event","PROP_NAMES_VERTICAL","start","end","PROP_NAMES_HORIZONTAL","targetResizeObserver","ResizeObserver","entry","__overlay","_updatePosition","PositionMixin","positionTarget","horizontalAlign","verticalAlign","noHorizontalOverlap","noVerticalOverlap","requiredVerticalSpace","__onScroll","__addUpdatePositionEventListeners","__removeUpdatePositionEventListeners","visualViewport","__positionTargetAncestorRootNodes","DOCUMENT_NODE","DOCUMENT_FRAGMENT_NODE","getAncestorRootNodes","__observePositionTargetMove","io","cleanup","disconnect","refresh","skip","threshold","top","width","height","getBoundingClientRect","rootMargin","floor","clientWidth","min","isFirstUpdate","IntersectionObserver","ratio","intersectionRatio","observeMove","__overlayOpenedChanged","unobserve","__margins","propName","parseInt","requestAnimationFrame","__positionSettingsChanged","e","targetRect","shouldAlignStartVertically","__shouldAlignStartVertically","justifyContent","isRTL","shouldAlignStartHorizontally","__shouldAlignStartHorizontally","flexStart","alignItems","overlayRect","verticalProps","__calculatePositionInOneDimension","horizontalProps","assign","toggleAttribute","rtl","contentWidth","__oldContentWidth","offsetWidth","viewportWidth","defaultAlignLeft","__shouldAlignStart","contentHeight","__oldContentHeight","offsetHeight","viewportHeight","defaultAlignTop","contentSize","viewportSize","margins","defaultAlignStart","noOverlap","propNames","spaceForStartAlignment","spaceForEndAlignment","spaceForDefaultAlignment","__adjustBottomProperty","cssPropNameToSet","currentValue","adjustedProp","__oldViewportHeight","__oldViewportWidth","shouldAlignStart","cssPropNameToClear","adjustedValue","diff","valueToSet","PopoverOverlayMixin","position","_tagNamePrefix","offset","PopoverOverlay","render","__hasTrigger","microtaskCurrHandle","microtaskLastHandle","microtaskCallbacks","microtaskScheduled","idlePeriod","run","fn","requestIdleCallback","cancel","handle","cancelIdleCallback","clearTimeout","microTask","queueMicrotask","i","cb","microtaskFlush","idx","debouncerQueue","Debouncer","debounce","debouncer","asyncModule","_cancelAsync","setConfig","_asyncModule","_callback","_timer","isActive","flush","statsJob","registrations","developmentModeCallback","registered","ElementMixin","doctype","OverlayClassMixin","overlayClass","_overlayElement","__updateOverlayClassNames","overlayElement","classList","__initialClasses","__previousClasses","classesToRemove","remove","classesToAdd","uniqueId","PopoverTargetMixin","for","_addTargetListeners","_removeTargetListeners","__forChanged","forId","__setTargetByIdDebouncer","__setTargetById","targetId","getElementById","__targetChanged","oldTarget","_target","DEFAULT_DELAY","defaultFocusDelay","defaultHoverDelay","defaultHideDelay","PopoverOpenedStateController","isClosing","__closeTimeout","__focusDelay","popover","focusDelay","__hoverDelay","hoverDelay","__hideDelay","hideDelay","open","immediate","trigger","shouldDelayHover","shouldDelayFocus","__showPopover","__scheduleOpen","__scheduleClose","__abortClose","__setOpened","__abortOpen","__openTimeout","delay","Popover","_position","__effectivePosition","__computeHorizontalAlign","__computeNoHorizontalOverlap","__computeNoVerticalOverlap","__computeVerticalAlign","__computePosition","defaultPosition","PopoverPositionMixin","accessibleName","accessibleNameRef","autofocus","overlayRole","modal","noCloseOnOutsideClick","noCloseOnEsc","__shouldRestoreFocus","__overlayId","setDefaultFocusDelay","setDefaultHideDelay","setDefaultHoverDelay","__onGlobalClick","__onGlobalKeyDown","__onTargetClick","__onTargetFocusIn","__onTargetFocusOut","__onTargetMouseEnter","__onTargetMouseLeave","_openedStateController","effectivePosition","__onOverlayMouseDown","__onOverlayMouseEnter","__onOverlayMouseLeave","__onOverlayFocusIn","__onOverlayFocusOut","__onOpenedChanged","__onEscapePress","__onOutsideClick","__onOverlayOpened","__onOverlayClosed","querySelector","__openedChanged","oldOpened","__openedOrTargetChanged","__overlayRoleOrTargetChanged","__oldTarget","isDialog","__isManual","stopPropagation","__onGlobalShiftTab","__onGlobalTab","overlayPart","lastFocusable","__getLastFocusable","focusable","__getNextBodyFocusable","nextFocusable","focusables","findIndex","container","__focusInside","__mouseDownInside","relatedTarget","__handleFocusout","__hoverInside","__handleMouseLeave","once","__updateDimension","dimension","__updateContentHeight","__updateContentWidth","TextFieldMixin","maxlength","minlength","pattern","constraints","_setType","clearElement","clearButton","_setInputElement","_setFocusElement","stateTarget","ariaTarget","inputElement","_labelController","TextField","_tooltipController","setPosition","setAriaTarget"],"sourceRoot":""}
|