import { _ as o, a as U, b as B, c as X } from "./tslib.es6-pPsSiLLK.mjs";
import { e as j, x as F, i as V } from "./query-assigned-elements-D930kELM.mjs";
import { s as Q, L as Y } from "./mwc-list.css-CnoVmMrq.mjs";
import { B as W } from "./base-element-DUJkJh_y.mjs";
import { o as y } from "./observer-DQ8OfVDQ.mjs";
import { a as J, d as Z, b as tt } from "./utils-Dr5MegQq.mjs";
import { n as a } from "./property-DJzm_oB9.mjs";
import { t as b } from "./state-B_tK3mBm.mjs";
import { i as N } from "./query-CDOd1Kwm.mjs";
import { o as H } from "./class-map-DPUylGZM.mjs";
import { o as et } from "./style-map-D2TR7M-D.mjs";
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
let k = class extends Y {
};
k.styles = [Q];
k = o([
  j("mwc-list")
], k);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var it = {
  ANCHOR: "mdc-menu-surface--anchor",
  ANIMATING_CLOSED: "mdc-menu-surface--animating-closed",
  ANIMATING_OPEN: "mdc-menu-surface--animating-open",
  FIXED: "mdc-menu-surface--fixed",
  IS_OPEN_BELOW: "mdc-menu-surface--is-open-below",
  OPEN: "mdc-menu-surface--open",
  ROOT: "mdc-menu-surface"
}, nt = {
  CLOSED_EVENT: "MDCMenuSurface:closed",
  CLOSING_EVENT: "MDCMenuSurface:closing",
  OPENED_EVENT: "MDCMenuSurface:opened",
  OPENING_EVENT: "MDCMenuSurface:opening",
  FOCUSABLE_ELEMENTS: [
    "button:not(:disabled)",
    '[href]:not([aria-disabled="true"])',
    "input:not(:disabled)",
    "select:not(:disabled)",
    "textarea:not(:disabled)",
    '[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'
  ].join(", ")
}, R = {
  /** Total duration of menu-surface open animation. */
  TRANSITION_OPEN_DURATION: 120,
  /** Total duration of menu-surface close animation. */
  TRANSITION_CLOSE_DURATION: 75,
  /**
   * Margin left to the edge of the viewport when menu-surface is at maximum
   * possible height. Also used as a viewport margin.
   */
  MARGIN_TO_EDGE: 32,
  /**
   * Ratio of anchor width to menu-surface width for switching from corner
   * positioning to center positioning.
   */
  ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67,
  /**
   * Amount of time to wait before restoring focus when closing the menu
   * surface. This is important because if a touch event triggered the menu
   * close, and the subsequent mouse event occurs after focus is restored, then
   * the restored focus would be lost.
   */
  TOUCH_EVENT_WAIT_MS: 30
}, c;
(function(n) {
  n[n.BOTTOM = 1] = "BOTTOM", n[n.CENTER = 2] = "CENTER", n[n.RIGHT = 4] = "RIGHT", n[n.FLIP_RTL = 8] = "FLIP_RTL";
})(c || (c = {}));
var m;
(function(n) {
  n[n.TOP_LEFT = 0] = "TOP_LEFT", n[n.TOP_RIGHT = 4] = "TOP_RIGHT", n[n.BOTTOM_LEFT = 1] = "BOTTOM_LEFT", n[n.BOTTOM_RIGHT = 5] = "BOTTOM_RIGHT", n[n.TOP_START = 8] = "TOP_START", n[n.TOP_END = 12] = "TOP_END", n[n.BOTTOM_START = 9] = "BOTTOM_START", n[n.BOTTOM_END = 13] = "BOTTOM_END";
})(m || (m = {}));
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var K = (
  /** @class */
  function() {
    function n(e) {
      e === void 0 && (e = {}), this.adapter = e;
    }
    return Object.defineProperty(n, "cssClasses", {
      get: function() {
        return {};
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(n, "strings", {
      get: function() {
        return {};
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(n, "numbers", {
      get: function() {
        return {};
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(n, "defaultAdapter", {
      get: function() {
        return {};
      },
      enumerable: !1,
      configurable: !0
    }), n.prototype.init = function() {
    }, n.prototype.destroy = function() {
    }, n;
  }()
);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var q = (
  /** @class */
  function(n) {
    U(e, n);
    function e(t) {
      var i = n.call(this, B(B({}, e.defaultAdapter), t)) || this;
      return i.isSurfaceOpen = !1, i.isQuickOpen = !1, i.isHoistedElement = !1, i.isFixedPosition = !1, i.isHorizontallyCenteredOnViewport = !1, i.maxHeight = 0, i.openBottomBias = 0, i.openAnimationEndTimerId = 0, i.closeAnimationEndTimerId = 0, i.animationRequestId = 0, i.anchorCorner = m.TOP_START, i.originCorner = m.TOP_START, i.anchorMargin = { top: 0, right: 0, bottom: 0, left: 0 }, i.position = { x: 0, y: 0 }, i;
    }
    return Object.defineProperty(e, "cssClasses", {
      get: function() {
        return it;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e, "strings", {
      get: function() {
        return nt;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e, "numbers", {
      get: function() {
        return R;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e, "Corner", {
      get: function() {
        return m;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e, "defaultAdapter", {
      /**
       * @see {@link MDCMenuSurfaceAdapter} for typing information on parameters and return types.
       */
      get: function() {
        return {
          addClass: function() {
          },
          removeClass: function() {
          },
          hasClass: function() {
            return !1;
          },
          hasAnchor: function() {
            return !1;
          },
          isElementInContainer: function() {
            return !1;
          },
          isFocused: function() {
            return !1;
          },
          isRtl: function() {
            return !1;
          },
          getInnerDimensions: function() {
            return { height: 0, width: 0 };
          },
          getAnchorDimensions: function() {
            return null;
          },
          getWindowDimensions: function() {
            return { height: 0, width: 0 };
          },
          getBodyDimensions: function() {
            return { height: 0, width: 0 };
          },
          getWindowScroll: function() {
            return { x: 0, y: 0 };
          },
          setPosition: function() {
          },
          setMaxHeight: function() {
          },
          setTransformOrigin: function() {
          },
          saveFocus: function() {
          },
          restoreFocus: function() {
          },
          notifyClose: function() {
          },
          notifyClosing: function() {
          },
          notifyOpen: function() {
          },
          notifyOpening: function() {
          }
        };
      },
      enumerable: !1,
      configurable: !0
    }), e.prototype.init = function() {
      var t = e.cssClasses, i = t.ROOT, s = t.OPEN;
      if (!this.adapter.hasClass(i))
        throw new Error(i + " class required in root element.");
      this.adapter.hasClass(s) && (this.isSurfaceOpen = !0);
    }, e.prototype.destroy = function() {
      clearTimeout(this.openAnimationEndTimerId), clearTimeout(this.closeAnimationEndTimerId), cancelAnimationFrame(this.animationRequestId);
    }, e.prototype.setAnchorCorner = function(t) {
      this.anchorCorner = t;
    }, e.prototype.flipCornerHorizontally = function() {
      this.originCorner = this.originCorner ^ c.RIGHT;
    }, e.prototype.setAnchorMargin = function(t) {
      this.anchorMargin.top = t.top || 0, this.anchorMargin.right = t.right || 0, this.anchorMargin.bottom = t.bottom || 0, this.anchorMargin.left = t.left || 0;
    }, e.prototype.setIsHoisted = function(t) {
      this.isHoistedElement = t;
    }, e.prototype.setFixedPosition = function(t) {
      this.isFixedPosition = t;
    }, e.prototype.isFixed = function() {
      return this.isFixedPosition;
    }, e.prototype.setAbsolutePosition = function(t, i) {
      this.position.x = this.isFinite(t) ? t : 0, this.position.y = this.isFinite(i) ? i : 0;
    }, e.prototype.setIsHorizontallyCenteredOnViewport = function(t) {
      this.isHorizontallyCenteredOnViewport = t;
    }, e.prototype.setQuickOpen = function(t) {
      this.isQuickOpen = t;
    }, e.prototype.setMaxHeight = function(t) {
      this.maxHeight = t;
    }, e.prototype.setOpenBottomBias = function(t) {
      this.openBottomBias = t;
    }, e.prototype.isOpen = function() {
      return this.isSurfaceOpen;
    }, e.prototype.open = function() {
      var t = this;
      this.isSurfaceOpen || (this.adapter.notifyOpening(), this.adapter.saveFocus(), this.isQuickOpen ? (this.isSurfaceOpen = !0, this.adapter.addClass(e.cssClasses.OPEN), this.dimensions = this.adapter.getInnerDimensions(), this.autoposition(), this.adapter.notifyOpen()) : (this.adapter.addClass(e.cssClasses.ANIMATING_OPEN), this.animationRequestId = requestAnimationFrame(function() {
        t.dimensions = t.adapter.getInnerDimensions(), t.autoposition(), t.adapter.addClass(e.cssClasses.OPEN), t.openAnimationEndTimerId = setTimeout(function() {
          t.openAnimationEndTimerId = 0, t.adapter.removeClass(e.cssClasses.ANIMATING_OPEN), t.adapter.notifyOpen();
        }, R.TRANSITION_OPEN_DURATION);
      }), this.isSurfaceOpen = !0));
    }, e.prototype.close = function(t) {
      var i = this;
      if (t === void 0 && (t = !1), !!this.isSurfaceOpen) {
        if (this.adapter.notifyClosing(), this.isQuickOpen) {
          this.isSurfaceOpen = !1, t || this.maybeRestoreFocus(), this.adapter.removeClass(e.cssClasses.OPEN), this.adapter.removeClass(e.cssClasses.IS_OPEN_BELOW), this.adapter.notifyClose();
          return;
        }
        this.adapter.addClass(e.cssClasses.ANIMATING_CLOSED), requestAnimationFrame(function() {
          i.adapter.removeClass(e.cssClasses.OPEN), i.adapter.removeClass(e.cssClasses.IS_OPEN_BELOW), i.closeAnimationEndTimerId = setTimeout(function() {
            i.closeAnimationEndTimerId = 0, i.adapter.removeClass(e.cssClasses.ANIMATING_CLOSED), i.adapter.notifyClose();
          }, R.TRANSITION_CLOSE_DURATION);
        }), this.isSurfaceOpen = !1, t || this.maybeRestoreFocus();
      }
    }, e.prototype.handleBodyClick = function(t) {
      var i = t.target;
      this.adapter.isElementInContainer(i) || this.close();
    }, e.prototype.handleKeydown = function(t) {
      var i = t.keyCode, s = t.key, r = s === "Escape" || i === 27;
      r && this.close();
    }, e.prototype.autoposition = function() {
      var t;
      this.measurements = this.getAutoLayoutmeasurements();
      var i = this.getoriginCorner(), s = this.getMenuSurfaceMaxHeight(i), r = this.hasBit(i, c.BOTTOM) ? "bottom" : "top", l = this.hasBit(i, c.RIGHT) ? "right" : "left", p = this.getHorizontalOriginOffset(i), x = this.getVerticalOriginOffset(i), I = this.measurements, S = I.anchorSize, O = I.surfaceSize, f = (t = {}, t[l] = p, t[r] = x, t);
      S.width / O.width > R.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO && (l = "center"), (this.isHoistedElement || this.isFixedPosition) && this.adjustPositionForHoistedElement(f), this.adapter.setTransformOrigin(l + " " + r), this.adapter.setPosition(f), this.adapter.setMaxHeight(s ? s + "px" : ""), this.hasBit(i, c.BOTTOM) || this.adapter.addClass(e.cssClasses.IS_OPEN_BELOW);
    }, e.prototype.getAutoLayoutmeasurements = function() {
      var t = this.adapter.getAnchorDimensions(), i = this.adapter.getBodyDimensions(), s = this.adapter.getWindowDimensions(), r = this.adapter.getWindowScroll();
      return t || (t = {
        top: this.position.y,
        right: this.position.x,
        bottom: this.position.y,
        left: this.position.x,
        width: 0,
        height: 0
      }), {
        anchorSize: t,
        bodySize: i,
        surfaceSize: this.dimensions,
        viewportDistance: {
          // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together
          top: t.top,
          right: s.width - t.right,
          bottom: s.height - t.bottom,
          left: t.left
          // tslint:enable:object-literal-sort-keys
        },
        viewportSize: s,
        windowScroll: r
      };
    }, e.prototype.getoriginCorner = function() {
      var t = this.originCorner, i = this.measurements, s = i.viewportDistance, r = i.anchorSize, l = i.surfaceSize, p = e.numbers.MARGIN_TO_EDGE, x = this.hasBit(this.anchorCorner, c.BOTTOM), I, S;
      x ? (I = s.top - p + this.anchorMargin.bottom, S = s.bottom - p - this.anchorMargin.bottom) : (I = s.top - p + this.anchorMargin.top, S = s.bottom - p + r.height - this.anchorMargin.top);
      var O = S - l.height > 0;
      !O && I > S + this.openBottomBias && (t = this.setBit(t, c.BOTTOM));
      var f = this.adapter.isRtl(), T = this.hasBit(this.anchorCorner, c.FLIP_RTL), E = this.hasBit(this.anchorCorner, c.RIGHT) || this.hasBit(t, c.RIGHT), A = !1;
      f && T ? A = !E : A = E;
      var L, w;
      A ? (L = s.left + r.width + this.anchorMargin.right, w = s.right - this.anchorMargin.right) : (L = s.left + this.anchorMargin.left, w = s.right + r.width - this.anchorMargin.left);
      var D = L - l.width > 0, G = w - l.width > 0, $ = this.hasBit(t, c.FLIP_RTL) && this.hasBit(t, c.RIGHT);
      return G && $ && f || !D && $ ? t = this.unsetBit(t, c.RIGHT) : (D && A && f || D && !A && E || !G && L >= w) && (t = this.setBit(t, c.RIGHT)), t;
    }, e.prototype.getMenuSurfaceMaxHeight = function(t) {
      if (this.maxHeight > 0)
        return this.maxHeight;
      var i = this.measurements.viewportDistance, s = 0, r = this.hasBit(t, c.BOTTOM), l = this.hasBit(this.anchorCorner, c.BOTTOM), p = e.numbers.MARGIN_TO_EDGE;
      return r ? (s = i.top + this.anchorMargin.top - p, l || (s += this.measurements.anchorSize.height)) : (s = i.bottom - this.anchorMargin.bottom + this.measurements.anchorSize.height - p, l && (s -= this.measurements.anchorSize.height)), s;
    }, e.prototype.getHorizontalOriginOffset = function(t) {
      var i = this.measurements.anchorSize, s = this.hasBit(t, c.RIGHT), r = this.hasBit(this.anchorCorner, c.RIGHT);
      if (s) {
        var l = r ? i.width - this.anchorMargin.left : this.anchorMargin.right;
        return this.isHoistedElement || this.isFixedPosition ? l - (this.measurements.viewportSize.width - this.measurements.bodySize.width) : l;
      }
      return r ? i.width - this.anchorMargin.right : this.anchorMargin.left;
    }, e.prototype.getVerticalOriginOffset = function(t) {
      var i = this.measurements.anchorSize, s = this.hasBit(t, c.BOTTOM), r = this.hasBit(this.anchorCorner, c.BOTTOM), l = 0;
      return s ? l = r ? i.height - this.anchorMargin.top : -this.anchorMargin.bottom : l = r ? i.height + this.anchorMargin.bottom : this.anchorMargin.top, l;
    }, e.prototype.adjustPositionForHoistedElement = function(t) {
      var i, s, r = this.measurements, l = r.windowScroll, p = r.viewportDistance, x = r.surfaceSize, I = r.viewportSize, S = Object.keys(t);
      try {
        for (var O = X(S), f = O.next(); !f.done; f = O.next()) {
          var T = f.value, E = t[T] || 0;
          if (this.isHorizontallyCenteredOnViewport && (T === "left" || T === "right")) {
            t[T] = (I.width - x.width) / 2;
            continue;
          }
          E += p[T], this.isFixedPosition || (T === "top" ? E += l.y : T === "bottom" ? E -= l.y : T === "left" ? E += l.x : E -= l.x), t[T] = E;
        }
      } catch (A) {
        i = { error: A };
      } finally {
        try {
          f && !f.done && (s = O.return) && s.call(O);
        } finally {
          if (i) throw i.error;
        }
      }
    }, e.prototype.maybeRestoreFocus = function() {
      var t = this, i = this.adapter.isFocused(), s = this.adapter.getOwnerDocument ? this.adapter.getOwnerDocument() : document, r = s.activeElement && this.adapter.isElementInContainer(s.activeElement);
      (i || r) && setTimeout(function() {
        t.adapter.restoreFocus();
      }, R.TOUCH_EVENT_WAIT_MS);
    }, e.prototype.hasBit = function(t, i) {
      return !!(t & i);
    }, e.prototype.setBit = function(t, i) {
      return t | i;
    }, e.prototype.unsetBit = function(t, i) {
      return t ^ i;
    }, e.prototype.isFinite = function(t) {
      return typeof t == "number" && isFinite(t);
    }, e;
  }(K)
);
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
const st = {
  TOP_LEFT: m.TOP_LEFT,
  TOP_RIGHT: m.TOP_RIGHT,
  BOTTOM_LEFT: m.BOTTOM_LEFT,
  BOTTOM_RIGHT: m.BOTTOM_RIGHT,
  TOP_START: m.TOP_START,
  TOP_END: m.TOP_END,
  BOTTOM_START: m.BOTTOM_START,
  BOTTOM_END: m.BOTTOM_END
};
class u extends W {
  constructor() {
    super(...arguments), this.mdcFoundationClass = q, this.absolute = !1, this.fullwidth = !1, this.fixed = !1, this.x = null, this.y = null, this.quick = !1, this.open = !1, this.stayOpenOnBodyClick = !1, this.bitwiseCorner = m.TOP_START, this.previousMenuCorner = null, this.menuCorner = "START", this.corner = "TOP_START", this.styleTop = "", this.styleLeft = "", this.styleRight = "", this.styleBottom = "", this.styleMaxHeight = "", this.styleTransformOrigin = "", this.anchor = null, this.previouslyFocused = null, this.previousAnchor = null, this.onBodyClickBound = () => {
    };
  }
  render() {
    return this.renderSurface();
  }
  renderSurface() {
    const e = this.getRootClasses(), t = this.getRootStyles();
    return F`
      <div
          class=${H(e)}
          style="${et(t)}"
          @keydown=${this.onKeydown}
          @opened=${this.registerBodyClick}
          @closed=${this.deregisterBodyClick}>
        ${this.renderContent()}
      </div>`;
  }
  getRootClasses() {
    return {
      "mdc-menu-surface": !0,
      "mdc-menu-surface--fixed": this.fixed,
      "mdc-menu-surface--fullwidth": this.fullwidth
    };
  }
  getRootStyles() {
    return {
      top: this.styleTop,
      left: this.styleLeft,
      right: this.styleRight,
      bottom: this.styleBottom,
      "max-height": this.styleMaxHeight,
      "transform-origin": this.styleTransformOrigin
    };
  }
  renderContent() {
    return F`<slot></slot>`;
  }
  createAdapter() {
    return Object.assign(Object.assign({}, J(this.mdcRoot)), { hasAnchor: () => !!this.anchor, notifyClose: () => {
      const e = { bubbles: !0, composed: !0 }, t = new CustomEvent("closed", e);
      this.open = !1, this.mdcRoot.dispatchEvent(t);
    }, notifyClosing: () => {
      const e = { bubbles: !0, composed: !0 }, t = new CustomEvent("closing", e);
      this.mdcRoot.dispatchEvent(t);
    }, notifyOpen: () => {
      const e = { bubbles: !0, composed: !0 }, t = new CustomEvent("opened", e);
      this.open = !0, this.mdcRoot.dispatchEvent(t);
    }, notifyOpening: () => {
      const e = { bubbles: !0, composed: !0 }, t = new CustomEvent("opening", e);
      this.mdcRoot.dispatchEvent(t);
    }, isElementInContainer: () => !1, isRtl: () => this.mdcRoot ? getComputedStyle(this.mdcRoot).direction === "rtl" : !1, setTransformOrigin: (e) => {
      this.mdcRoot && (this.styleTransformOrigin = e);
    }, isFocused: () => tt(this), saveFocus: () => {
      const e = Z(), t = e.length;
      t || (this.previouslyFocused = null), this.previouslyFocused = e[t - 1];
    }, restoreFocus: () => {
      this.previouslyFocused && "focus" in this.previouslyFocused && this.previouslyFocused.focus();
    }, getInnerDimensions: () => {
      const e = this.mdcRoot;
      return e ? { width: e.offsetWidth, height: e.offsetHeight } : { width: 0, height: 0 };
    }, getAnchorDimensions: () => {
      const e = this.anchor;
      return e ? e.getBoundingClientRect() : null;
    }, getBodyDimensions: () => ({
      width: document.body.clientWidth,
      height: document.body.clientHeight
    }), getWindowDimensions: () => ({
      width: window.innerWidth,
      height: window.innerHeight
    }), getWindowScroll: () => ({
      x: window.pageXOffset,
      y: window.pageYOffset
    }), setPosition: (e) => {
      this.mdcRoot && (this.styleLeft = "left" in e ? `${e.left}px` : "", this.styleRight = "right" in e ? `${e.right}px` : "", this.styleTop = "top" in e ? `${e.top}px` : "", this.styleBottom = "bottom" in e ? `${e.bottom}px` : "");
    }, setMaxHeight: async (e) => {
      this.mdcRoot && (this.styleMaxHeight = e, await this.updateComplete, this.styleMaxHeight = `var(--mdc-menu-max-height, ${e})`);
    } });
  }
  onKeydown(e) {
    this.mdcFoundation && this.mdcFoundation.handleKeydown(e);
  }
  onBodyClick(e) {
    if (this.stayOpenOnBodyClick)
      return;
    e.composedPath().indexOf(this) === -1 && this.close();
  }
  registerBodyClick() {
    this.onBodyClickBound = this.onBodyClick.bind(this), document.body.addEventListener("click", this.onBodyClickBound, { passive: !0, capture: !0 });
  }
  deregisterBodyClick() {
    document.body.removeEventListener("click", this.onBodyClickBound, { capture: !0 });
  }
  onOpenChanged(e, t) {
    this.mdcFoundation && (e ? this.mdcFoundation.open() : t !== void 0 && this.mdcFoundation.close());
  }
  close() {
    this.open = !1;
  }
  show() {
    this.open = !0;
  }
}
o([
  N(".mdc-menu-surface")
], u.prototype, "mdcRoot", void 0);
o([
  N("slot")
], u.prototype, "slotElement", void 0);
o([
  a({ type: Boolean }),
  y(function(n) {
    this.mdcFoundation && !this.fixed && this.mdcFoundation.setIsHoisted(n);
  })
], u.prototype, "absolute", void 0);
o([
  a({ type: Boolean })
], u.prototype, "fullwidth", void 0);
o([
  a({ type: Boolean }),
  y(function(n) {
    this.mdcFoundation && !this.absolute && this.mdcFoundation.setFixedPosition(n);
  })
], u.prototype, "fixed", void 0);
o([
  a({ type: Number }),
  y(function(n) {
    this.mdcFoundation && this.y !== null && n !== null && (this.mdcFoundation.setAbsolutePosition(n, this.y), this.mdcFoundation.setAnchorMargin({ left: n, top: this.y, right: -n, bottom: this.y }));
  })
], u.prototype, "x", void 0);
o([
  a({ type: Number }),
  y(function(n) {
    this.mdcFoundation && this.x !== null && n !== null && (this.mdcFoundation.setAbsolutePosition(this.x, n), this.mdcFoundation.setAnchorMargin({ left: this.x, top: n, right: -this.x, bottom: n }));
  })
], u.prototype, "y", void 0);
o([
  a({ type: Boolean }),
  y(function(n) {
    this.mdcFoundation && this.mdcFoundation.setQuickOpen(n);
  })
], u.prototype, "quick", void 0);
o([
  a({ type: Boolean, reflect: !0 }),
  y(function(n, e) {
    this.onOpenChanged(n, e);
  })
], u.prototype, "open", void 0);
o([
  a({ type: Boolean })
], u.prototype, "stayOpenOnBodyClick", void 0);
o([
  b(),
  y(function(n) {
    this.mdcFoundation && (n ? this.mdcFoundation.setAnchorCorner(n) : this.mdcFoundation.setAnchorCorner(n));
  })
], u.prototype, "bitwiseCorner", void 0);
o([
  a({ type: String }),
  y(function(n) {
    if (this.mdcFoundation) {
      const e = n === "START" || n === "END", t = this.previousMenuCorner === null, i = !t && n !== this.previousMenuCorner;
      e && (i || t && n === "END") && (this.bitwiseCorner = this.bitwiseCorner ^ c.RIGHT, this.mdcFoundation.flipCornerHorizontally(), this.previousMenuCorner = n);
    }
  })
], u.prototype, "menuCorner", void 0);
o([
  a({ type: String }),
  y(function(n) {
    if (this.mdcFoundation && n) {
      let e = st[n];
      this.menuCorner === "END" && (e = e ^ c.RIGHT), this.bitwiseCorner = e;
    }
  })
], u.prototype, "corner", void 0);
o([
  b()
], u.prototype, "styleTop", void 0);
o([
  b()
], u.prototype, "styleLeft", void 0);
o([
  b()
], u.prototype, "styleRight", void 0);
o([
  b()
], u.prototype, "styleBottom", void 0);
o([
  b()
], u.prototype, "styleMaxHeight", void 0);
o([
  b()
], u.prototype, "styleTransformOrigin", void 0);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const ot = V`.mdc-menu-surface{display:none;position:absolute;box-sizing:border-box;max-width:calc(100vw - 32px);max-width:var(--mdc-menu-max-width, calc(100vw - 32px));max-height:calc(100vh - 32px);max-height:var(--mdc-menu-max-height, calc(100vh - 32px));margin:0;padding:0;transform:scale(1);transform-origin:top left;opacity:0;overflow:auto;will-change:transform,opacity;z-index:8;transition:opacity .03s linear,transform .12s cubic-bezier(0, 0, 0.2, 1),height 250ms cubic-bezier(0, 0, 0.2, 1);box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2),0px 8px 10px 1px rgba(0, 0, 0, 0.14),0px 3px 14px 2px rgba(0,0,0,.12);background-color:#fff;background-color:var(--mdc-theme-surface, #fff);color:#000;color:var(--mdc-theme-on-surface, #000);border-radius:4px;border-radius:var(--mdc-shape-medium, 4px);transform-origin-left:top left;transform-origin-right:top right}.mdc-menu-surface:focus{outline:none}.mdc-menu-surface--animating-open{display:inline-block;transform:scale(0.8);opacity:0}.mdc-menu-surface--open{display:inline-block;transform:scale(1);opacity:1}.mdc-menu-surface--animating-closed{display:inline-block;opacity:0;transition:opacity .075s linear}[dir=rtl] .mdc-menu-surface,.mdc-menu-surface[dir=rtl]{transform-origin-left:top right;transform-origin-right:top left}.mdc-menu-surface--anchor{position:relative;overflow:visible}.mdc-menu-surface--fixed{position:fixed}.mdc-menu-surface--fullwidth{width:100%}:host(:not([open])){display:none}.mdc-menu-surface{z-index:8;z-index:var(--mdc-menu-z-index, 8);min-width:112px;min-width:var(--mdc-menu-min-width, 112px)}`;
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
let z = class extends u {
};
z.styles = [ot];
z = o([
  j("mwc-menu-surface")
], z);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var P = {
  MENU_SELECTED_LIST_ITEM: "mdc-menu-item--selected",
  MENU_SELECTION_GROUP: "mdc-menu__selection-group",
  ROOT: "mdc-menu"
}, v = {
  ARIA_CHECKED_ATTR: "aria-checked",
  ARIA_DISABLED_ATTR: "aria-disabled",
  CHECKBOX_SELECTOR: 'input[type="checkbox"]',
  LIST_SELECTOR: ".mdc-list,.mdc-deprecated-list",
  SELECTED_EVENT: "MDCMenu:selected",
  SKIP_RESTORE_FOCUS: "data-menu-item-skip-restore-focus"
}, rt = {
  FOCUS_ROOT_INDEX: -1
}, C;
(function(n) {
  n[n.NONE = 0] = "NONE", n[n.LIST_ROOT = 1] = "LIST_ROOT", n[n.FIRST_ITEM = 2] = "FIRST_ITEM", n[n.LAST_ITEM = 3] = "LAST_ITEM";
})(C || (C = {}));
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var _, g, d = {
  LIST_ITEM_ACTIVATED_CLASS: "mdc-list-item--activated",
  LIST_ITEM_CLASS: "mdc-list-item",
  LIST_ITEM_DISABLED_CLASS: "mdc-list-item--disabled",
  LIST_ITEM_SELECTED_CLASS: "mdc-list-item--selected",
  LIST_ITEM_TEXT_CLASS: "mdc-list-item__text",
  LIST_ITEM_PRIMARY_TEXT_CLASS: "mdc-list-item__primary-text",
  ROOT: "mdc-list"
};
_ = {}, _["" + d.LIST_ITEM_ACTIVATED_CLASS] = "mdc-list-item--activated", _["" + d.LIST_ITEM_CLASS] = "mdc-list-item", _["" + d.LIST_ITEM_DISABLED_CLASS] = "mdc-list-item--disabled", _["" + d.LIST_ITEM_SELECTED_CLASS] = "mdc-list-item--selected", _["" + d.LIST_ITEM_PRIMARY_TEXT_CLASS] = "mdc-list-item__primary-text", _["" + d.ROOT] = "mdc-list";
var M = (g = {}, g["" + d.LIST_ITEM_ACTIVATED_CLASS] = "mdc-deprecated-list-item--activated", g["" + d.LIST_ITEM_CLASS] = "mdc-deprecated-list-item", g["" + d.LIST_ITEM_DISABLED_CLASS] = "mdc-deprecated-list-item--disabled", g["" + d.LIST_ITEM_SELECTED_CLASS] = "mdc-deprecated-list-item--selected", g["" + d.LIST_ITEM_TEXT_CLASS] = "mdc-deprecated-list-item__text", g["" + d.LIST_ITEM_PRIMARY_TEXT_CLASS] = "mdc-deprecated-list-item__primary-text", g["" + d.ROOT] = "mdc-deprecated-list", g);
"" + d.LIST_ITEM_CLASS + d.LIST_ITEM_CLASS + M[d.LIST_ITEM_CLASS] + M[d.LIST_ITEM_CLASS], "" + d.LIST_ITEM_CLASS + d.LIST_ITEM_CLASS + d.LIST_ITEM_CLASS + d.LIST_ITEM_CLASS + M[d.LIST_ITEM_CLASS] + M[d.LIST_ITEM_CLASS] + M[d.LIST_ITEM_CLASS] + M[d.LIST_ITEM_CLASS];
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var at = (
  /** @class */
  function(n) {
    U(e, n);
    function e(t) {
      var i = n.call(this, B(B({}, e.defaultAdapter), t)) || this;
      return i.closeAnimationEndTimerId = 0, i.defaultFocusState = C.LIST_ROOT, i.selectedIndex = -1, i;
    }
    return Object.defineProperty(e, "cssClasses", {
      get: function() {
        return P;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e, "strings", {
      get: function() {
        return v;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e, "numbers", {
      get: function() {
        return rt;
      },
      enumerable: !1,
      configurable: !0
    }), Object.defineProperty(e, "defaultAdapter", {
      /**
       * @see {@link MDCMenuAdapter} for typing information on parameters and return types.
       */
      get: function() {
        return {
          addClassToElementAtIndex: function() {
          },
          removeClassFromElementAtIndex: function() {
          },
          addAttributeToElementAtIndex: function() {
          },
          removeAttributeFromElementAtIndex: function() {
          },
          getAttributeFromElementAtIndex: function() {
            return null;
          },
          elementContainsClass: function() {
            return !1;
          },
          closeSurface: function() {
          },
          getElementIndex: function() {
            return -1;
          },
          notifySelected: function() {
          },
          getMenuItemCount: function() {
            return 0;
          },
          focusItemAtIndex: function() {
          },
          focusListRoot: function() {
          },
          getSelectedSiblingOfItemAtIndex: function() {
            return -1;
          },
          isSelectableItemAtIndex: function() {
            return !1;
          }
        };
      },
      enumerable: !1,
      configurable: !0
    }), e.prototype.destroy = function() {
      this.closeAnimationEndTimerId && clearTimeout(this.closeAnimationEndTimerId), this.adapter.closeSurface();
    }, e.prototype.handleKeydown = function(t) {
      var i = t.key, s = t.keyCode, r = i === "Tab" || s === 9;
      r && this.adapter.closeSurface(
        /** skipRestoreFocus */
        !0
      );
    }, e.prototype.handleItemAction = function(t) {
      var i = this, s = this.adapter.getElementIndex(t);
      if (!(s < 0)) {
        this.adapter.notifySelected({ index: s });
        var r = this.adapter.getAttributeFromElementAtIndex(s, v.SKIP_RESTORE_FOCUS) === "true";
        this.adapter.closeSurface(r), this.closeAnimationEndTimerId = setTimeout(function() {
          var l = i.adapter.getElementIndex(t);
          l >= 0 && i.adapter.isSelectableItemAtIndex(l) && i.setSelectedIndex(l);
        }, q.numbers.TRANSITION_CLOSE_DURATION);
      }
    }, e.prototype.handleMenuSurfaceOpened = function() {
      switch (this.defaultFocusState) {
        case C.FIRST_ITEM:
          this.adapter.focusItemAtIndex(0);
          break;
        case C.LAST_ITEM:
          this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount() - 1);
          break;
        case C.NONE:
          break;
        default:
          this.adapter.focusListRoot();
          break;
      }
    }, e.prototype.setDefaultFocusState = function(t) {
      this.defaultFocusState = t;
    }, e.prototype.getSelectedIndex = function() {
      return this.selectedIndex;
    }, e.prototype.setSelectedIndex = function(t) {
      if (this.validatedIndex(t), !this.adapter.isSelectableItemAtIndex(t))
        throw new Error("MDCMenuFoundation: No selection group at specified index.");
      var i = this.adapter.getSelectedSiblingOfItemAtIndex(t);
      i >= 0 && (this.adapter.removeAttributeFromElementAtIndex(i, v.ARIA_CHECKED_ATTR), this.adapter.removeClassFromElementAtIndex(i, P.MENU_SELECTED_LIST_ITEM)), this.adapter.addClassToElementAtIndex(t, P.MENU_SELECTED_LIST_ITEM), this.adapter.addAttributeToElementAtIndex(t, v.ARIA_CHECKED_ATTR, "true"), this.selectedIndex = t;
    }, e.prototype.setEnabled = function(t, i) {
      this.validatedIndex(t), i ? (this.adapter.removeClassFromElementAtIndex(t, d.LIST_ITEM_DISABLED_CLASS), this.adapter.addAttributeToElementAtIndex(t, v.ARIA_DISABLED_ATTR, "false")) : (this.adapter.addClassToElementAtIndex(t, d.LIST_ITEM_DISABLED_CLASS), this.adapter.addAttributeToElementAtIndex(t, v.ARIA_DISABLED_ATTR, "true"));
    }, e.prototype.validatedIndex = function(t) {
      var i = this.adapter.getMenuItemCount(), s = t >= 0 && t < i;
      if (!s)
        throw new Error("MDCMenuFoundation: No list item at specified index.");
    }, e;
  }(K)
);
/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class h extends W {
  constructor() {
    super(...arguments), this.mdcFoundationClass = at, this.listElement_ = null, this.anchor = null, this.open = !1, this.quick = !1, this.wrapFocus = !1, this.innerRole = "menu", this.innerAriaLabel = null, this.corner = "TOP_START", this.x = null, this.y = null, this.absolute = !1, this.multi = !1, this.activatable = !1, this.fixed = !1, this.forceGroupSelection = !1, this.fullwidth = !1, this.menuCorner = "START", this.stayOpenOnBodyClick = !1, this.defaultFocus = "LIST_ROOT", this._listUpdateComplete = null;
  }
  get listElement() {
    return this.listElement_ ? this.listElement_ : (this.listElement_ = this.renderRoot.querySelector("mwc-list"), this.listElement_);
  }
  get items() {
    const e = this.listElement;
    return e ? e.items : [];
  }
  get index() {
    const e = this.listElement;
    return e ? e.index : -1;
  }
  get selected() {
    const e = this.listElement;
    return e ? e.selected : null;
  }
  render() {
    return this.renderSurface();
  }
  renderSurface() {
    const e = this.getSurfaceClasses();
    return F`
      <mwc-menu-surface
        ?hidden=${!this.open}
        .anchor=${this.anchor}
        .open=${this.open}
        .quick=${this.quick}
        .corner=${this.corner}
        .x=${this.x}
        .y=${this.y}
        .absolute=${this.absolute}
        .fixed=${this.fixed}
        .fullwidth=${this.fullwidth}
        .menuCorner=${this.menuCorner}
        ?stayOpenOnBodyClick=${this.stayOpenOnBodyClick}
        class=${H(e)}
        @closed=${this.onClosed}
        @opened=${this.onOpened}
        @keydown=${this.onKeydown}>
      ${this.renderList()}
    </mwc-menu-surface>`;
  }
  getSurfaceClasses() {
    return {
      "mdc-menu": !0,
      "mdc-menu-surface": !0
    };
  }
  renderList() {
    const e = this.innerRole === "menu" ? "menuitem" : "option", t = this.renderListClasses();
    return F`
      <mwc-list
          rootTabbable
          .innerAriaLabel=${this.innerAriaLabel}
          .innerRole=${this.innerRole}
          .multi=${this.multi}
          class=${H(t)}
          .itemRoles=${e}
          .wrapFocus=${this.wrapFocus}
          .activatable=${this.activatable}
          @action=${this.onAction}>
        <slot></slot>
      </mwc-list>`;
  }
  renderListClasses() {
    return {
      "mdc-deprecated-list": !0
    };
  }
  createAdapter() {
    return {
      addClassToElementAtIndex: (e, t) => {
        const i = this.listElement;
        if (!i)
          return;
        const s = i.items[e];
        s && (t === "mdc-menu-item--selected" ? this.forceGroupSelection && !s.selected && i.toggle(e, !0) : s.classList.add(t));
      },
      removeClassFromElementAtIndex: (e, t) => {
        const i = this.listElement;
        if (!i)
          return;
        const s = i.items[e];
        s && (t === "mdc-menu-item--selected" ? s.selected && i.toggle(e, !1) : s.classList.remove(t));
      },
      addAttributeToElementAtIndex: (e, t, i) => {
        const s = this.listElement;
        if (!s)
          return;
        const r = s.items[e];
        r && r.setAttribute(t, i);
      },
      removeAttributeFromElementAtIndex: (e, t) => {
        const i = this.listElement;
        if (!i)
          return;
        const s = i.items[e];
        s && s.removeAttribute(t);
      },
      getAttributeFromElementAtIndex: (e, t) => {
        const i = this.listElement;
        if (!i)
          return null;
        const s = i.items[e];
        return s ? s.getAttribute(t) : null;
      },
      elementContainsClass: (e, t) => e.classList.contains(t),
      closeSurface: () => {
        this.open = !1;
      },
      getElementIndex: (e) => {
        const t = this.listElement;
        return t ? t.items.indexOf(e) : -1;
      },
      notifySelected: () => {
      },
      getMenuItemCount: () => {
        const e = this.listElement;
        return e ? e.items.length : 0;
      },
      focusItemAtIndex: (e) => {
        const t = this.listElement;
        if (!t)
          return;
        const i = t.items[e];
        i && i.focus();
      },
      focusListRoot: () => {
        this.listElement && this.listElement.focus();
      },
      getSelectedSiblingOfItemAtIndex: (e) => {
        const t = this.listElement;
        if (!t)
          return -1;
        const i = t.items[e];
        if (!i || !i.group)
          return -1;
        for (let s = 0; s < t.items.length; s++) {
          if (s === e)
            continue;
          const r = t.items[s];
          if (r.selected && r.group === i.group)
            return s;
        }
        return -1;
      },
      isSelectableItemAtIndex: (e) => {
        const t = this.listElement;
        if (!t)
          return !1;
        const i = t.items[e];
        return i ? i.hasAttribute("group") : !1;
      }
    };
  }
  onKeydown(e) {
    this.mdcFoundation && this.mdcFoundation.handleKeydown(e);
  }
  onAction(e) {
    const t = this.listElement;
    if (this.mdcFoundation && t) {
      const i = e.detail.index, s = t.items[i];
      s && this.mdcFoundation.handleItemAction(s);
    }
  }
  onOpened() {
    this.open = !0, this.mdcFoundation && this.mdcFoundation.handleMenuSurfaceOpened();
  }
  onClosed() {
    this.open = !1;
  }
  // tslint:disable:ban-ts-ignore
  async getUpdateComplete() {
    return await this._listUpdateComplete, await super.getUpdateComplete();
  }
  // tslint:enable:ban-ts-ignore
  async firstUpdated() {
    super.firstUpdated();
    const e = this.listElement;
    e && (this._listUpdateComplete = e.updateComplete, await this._listUpdateComplete);
  }
  select(e) {
    const t = this.listElement;
    t && t.select(e);
  }
  close() {
    this.open = !1;
  }
  show() {
    this.open = !0;
  }
  getFocusedItemIndex() {
    const e = this.listElement;
    return e ? e.getFocusedItemIndex() : -1;
  }
  focusItemAtIndex(e) {
    const t = this.listElement;
    t && t.focusItemAtIndex(e);
  }
  layout(e = !0) {
    const t = this.listElement;
    t && t.layout(e);
  }
}
o([
  N(".mdc-menu")
], h.prototype, "mdcRoot", void 0);
o([
  N("slot")
], h.prototype, "slotElement", void 0);
o([
  a({ type: Object })
], h.prototype, "anchor", void 0);
o([
  a({ type: Boolean, reflect: !0 })
], h.prototype, "open", void 0);
o([
  a({ type: Boolean })
], h.prototype, "quick", void 0);
o([
  a({ type: Boolean })
], h.prototype, "wrapFocus", void 0);
o([
  a({ type: String })
], h.prototype, "innerRole", void 0);
o([
  a({ type: String })
], h.prototype, "innerAriaLabel", void 0);
o([
  a({ type: String })
], h.prototype, "corner", void 0);
o([
  a({ type: Number })
], h.prototype, "x", void 0);
o([
  a({ type: Number })
], h.prototype, "y", void 0);
o([
  a({ type: Boolean })
], h.prototype, "absolute", void 0);
o([
  a({ type: Boolean })
], h.prototype, "multi", void 0);
o([
  a({ type: Boolean })
], h.prototype, "activatable", void 0);
o([
  a({ type: Boolean })
], h.prototype, "fixed", void 0);
o([
  a({ type: Boolean })
], h.prototype, "forceGroupSelection", void 0);
o([
  a({ type: Boolean })
], h.prototype, "fullwidth", void 0);
o([
  a({ type: String })
], h.prototype, "menuCorner", void 0);
o([
  a({ type: Boolean })
], h.prototype, "stayOpenOnBodyClick", void 0);
o([
  a({ type: String }),
  y(function(n) {
    this.mdcFoundation && this.mdcFoundation.setDefaultFocusState(C[n]);
  })
], h.prototype, "defaultFocus", void 0);
/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const St = V`mwc-list ::slotted([mwc-list-item]:not([twoline])),mwc-list ::slotted([noninteractive]:not([twoline])){height:var(--mdc-menu-item-height, 48px)}`;
export {
  h as M,
  St as s
};
