'use client'
import {
  m2mAuthTokenApi
} from "./chunk-5FHEMJGG.mjs";
import {
  MenuBaseElement
} from "./chunk-UM6FAKR4.mjs";
import {
  getDomains
} from "./chunk-B7STDXYN.mjs";
import {
  __decorateClass
} from "./chunk-JUBOAWNR.mjs";

// src/m2m-user-menu.ts
import { customElement } from "lit/decorators.js";
import { html } from "lit";
import { ref } from "lit/directives/ref.js";
var M2MUserMenu = class extends MenuBaseElement {
  constructor() {
    super(...arguments);
    this.handleLogout = () => {
      void m2mAuthTokenApi.clear();
      window.location.reload();
    };
  }
  render() {
    var _a;
    const domains = getDomains();
    const additionalItems = (_a = this.additinalItems) == null ? void 0 : _a.map((item) => {
      return html`
        <li>
          <a href="${item.href}">${item.label}</a>
        </li>
      `;
    });
    return html`<nav>
      <button
        type="button"
        class="navigation-drawer-controll-button navigation-drawer-controll-button--icon"
        aria-controls="m2m-user-menu__navigation-drawer"
        aria-expanded=${this.expanded}
        @click=${this.handleToggleDrawer}
      >
        <svg viewBox="0 0 24 24" width="38px" height="38px" fill="#000000">
          <path d="M0 0h24v24H0z" fill="none" />
          <path
            d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"
          />
        </svg>
      </button>
      <ul
        ${ref(this.listRef)}
        id="m2m-user-menu__navigation-drawer"
        aria-hidden=${!this.expanded}
        class="navigation-drawer"
      >
        <li><a href="${domains.users}">アカウント情報</a></li>
        <li @click=${this.handleLogout}>
          <button type="button">ログアウト</button>
        </li>
        ${additionalItems}
      </ul>
    </nav>`;
  }
};
M2MUserMenu = __decorateClass([
  customElement("m2m-user-menu")
], M2MUserMenu);

export {
  M2MUserMenu
};
//# sourceMappingURL=chunk-BFPL6AIR.mjs.map