import { jsx as k } from "react/jsx-runtime";
import w from "react";
import { o as S } from "./create-component-CVXl33PD.mjs";
import { B as A, x as a, r as b, _ as l, n as r, c as z, E as f, a as T, b as E } from "./class-map-CwiboTfb.mjs";
import { m as F, o as D } from "./outlined-field-CsypDRr3.mjs";
import { u as M, i as I } from "./static-DdXEOlS4.mjs";
import { D as U, F as p, T as q, i as V, e as B, M as L, s as N } from "./menuItemController-CeB921ip.mjs";
import { r as h, a as _ } from "./animation-DjClVFum.mjs";
import { o as $ } from "./query-assigned-elements-DUhez03i.mjs";
import { o as K } from "./style-map-CdUj7GnE.mjs";
import { m as O } from "./delegate-BXi1gVeU.mjs";
import { r as P } from "./redispatch-event-taWUbWUt.mjs";
import { V as W, m as H, c as j, g as Y } from "./validator-DZt1_yHv.mjs";
import { m as G } from "./element-internals-3IY9gE4L.mjs";
import { m as J, g as Q } from "./form-associated-CyYeHPMb.mjs";
import { b as X } from "./item-CpL4zUlE.mjs";
import "./ripple-pQcEjR05.mjs";
import { n as Z } from "./query-assigned-nodes-MKI2zKDb.mjs";
/**
 * @license
 * Copyright 2022 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const ee = !1;
/**
 * @license
 * Copyright 2023 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
class te extends W {
  computeValidity(e) {
    return this.selectControl || (this.selectControl = document.createElement("select")), A(a`
        ${this.renderField()} ${this.renderMenu()}
       
    `;
  }
  async firstUpdated(e) {
    var t;
    await ((t = this.menu) == null ? void 0 : t.updateComplete), this.lastSelectedOptionRecords.length || this.initUserSelection(), !this.lastSelectedOptionRecords.length && !ee && !this.options.length && setTimeout(() => {
      this.updateValueAndDisplayText();
    }), super.firstUpdated(e);
  }
  getRenderClasses() {
    return {
      disabled: this.disabled,
      error: this.error,
      open: this.open
    };
  }
  renderField() {
    return M`
      <${this.fieldTag}
          aria-haspopup="listbox"
          role="combobox"
          part="field"
          id="field"
          tabindex=${this.disabled ? "-1" : "0"}
          aria-label=${this.ariaLabel || f}
          aria-describedby="description"
          aria-expanded=${this.open ? "true" : "false"}
          aria-controls="listbox"
          class="field"
          label=${this.label}
          ?no-asterisk=${this.noAsterisk}
          .focused=${this.focused || this.open}
          .populated=${!!this.displayText}
          .disabled=${this.disabled}
          .required=${this.required}
          .error=${this.hasError}
          ?has-start=${this.hasLeadingIcon}
          has-end
          supporting-text=${this.supportingText}
          error-text=${this.getErrorText()}
          @keydown=${this.handleKeydown}
          @click=${this.handleClick}>
         ${this.renderFieldContent()}
         
      ${this.fieldTag}>`;
  }
  renderFieldContent() {
    return [
      this.renderLeadingIcon(),
      this.renderLabel(),
      this.renderTrailingIcon()
    ];
  }
  renderLeadingIcon() {
    return a`
      
         
    `;
  }
  renderTrailingIcon() {
    return a`
      
        
          
             
         
       
    `;
  }
  renderLabel() {
    return a`${this.displayText || a` `}
`;
  }
  renderMenu() {
    const e = this.label || this.ariaLabel;
    return a``;
  }
  renderMenuContent() {
    return a`
        
          ${this.renderRipple()} ${this.renderFocusRing()}
        
         
    `);
  }
  /**
   * Renders the root list item.
   *
   * @param content the child content of the list item.
   */
  renderListItem(e) {
    return a`
      ${e} 
    `;
  }
  /**
   * Handles rendering of the ripple element.
   */
  renderRipple() {
    return a`