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AAkB","file":"/npm/wc-menu-button@6.0.0/wc-menu-button.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/wc-menu-button@6.0.0/wc-menu-button.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// @ts-check\n\nconst style = `\n:host {\n  width: 37px;\n}\n\nbutton {\n  all: unset;\n\n  margin: 0;\n  width: inherit;\n  position: relative;\n  display: inline-block;\n  transform: rotate(0deg);\n  transition: 0.5s ease-in-out;\n  cursor: var(--wc-menu-button-cursor, default);\n  transition: all 0.2s ease-in-out;\n  -webkit-tap-highlight-color: transparent;\n}\n\n/* this trick makes the height 75% of the width (4:3 ratio) */\nbutton:after {\n  padding-top: 75%;\n  display: block;\n  content: \"\";\n}\n\n@media (hover: hover) {\n  :host(:hover) {\n    opacity: 0.75;\n  }\n}\n\n:focus {\n    outline: 2px solid color-mix(in srgb, var(--wc-menu-button-color, #000000) 50%, transparent);\n    outline-offset: 5px;\n    border-radius: 5px;\n}\n\nbutton span {\n  display: block;\n  position: absolute;\n  height: 20%;\n  width: 100%;\n  background: var(--wc-menu-button-color, #000000);\n  border-radius: 10%;\n  opacity: 1;\n  left: 0;\n  transform: rotate(0deg);\n  transition: 0.25s ease-in-out;\n}\n\nbutton span:nth-child(1) {\n  top: 0%;\n}\n\nbutton span:nth-child(2),\nbutton span:nth-child(3) {\n  top: 40%;\n}\n\nbutton span:nth-child(4) {\n  top: 80%;\n}\n\n:host([open]) button span:nth-child(1) {\n  top: 40%;\n  width: 0%;\n  left: 50%;\n}\n\n:host([open]) button span:nth-child(2) {\n  transform: rotate(45deg);\n}\n\n:host([open]) button span:nth-child(3) {\n  transform: rotate(-45deg);\n}\n\n:host([open]) button span:nth-child(4) {\n  top: 40%;\n  width: 0%;\n  left: 50%;\n}\n`;\n\nconst template = `\n<button type=\"button\" aria-label=\"menu button\">\n  <span></span>\n  <span></span>\n  <span></span>\n  <span></span>\n</button>\n`;\n\n// using a template so it only needs to be parsed once, whereas setting\n// innerHTML directly in the custom element ctor means the HTML would get parsed\n// for every custom element on the page\nconst tmpl = document.createElement(\"template\");\ntmpl.innerHTML = `<style>${style}</style>${template}`;\n\n/**\n * A simple, animating menu button custom element\n */\nexport class WcMenuButton extends HTMLElement {\n  constructor() {\n    super();\n\n    const shadowRoot = this.attachShadow({ mode: \"open\" });\n    shadowRoot.appendChild(tmpl.content.cloneNode(true));\n\n    /**\n     * @internal\n     * @type {HTMLElement | null}\n     */\n    this._menuButton = shadowRoot.querySelector(\"button\");\n  }\n\n  connectedCallback() {\n    if (this._menuButton !== null) {\n      this._menuButton.addEventListener(\"click\", this.handleMenuButtonClick);\n    }\n\n    this.upgradeProperty(\"open\");\n  }\n\n  // from https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n  /**\n   * @param {string} prop\n   *\n   * @internal\n   * @memberOf WcMenuButton\n   */\n  upgradeProperty(prop) {\n    if (this.hasOwnProperty(prop)) {\n      let value = this[prop];\n      delete this[prop];\n      this[prop] = value;\n    }\n  }\n\n  get open() {\n    return this.hasAttribute(\"open\");\n  }\n\n  set open(isOpen) {\n    if (isOpen) {\n      if (!this.hasAttribute(\"open\")) {\n        this.setAttribute(\"open\", \"\");\n      }\n    } else {\n      if (this.hasAttribute(\"open\")) {\n        this.removeAttribute(\"open\");\n      }\n    }\n  }\n\n  static get observedAttributes() {\n    return [\"open\", \"aria-label\", \"type\"];\n  }\n\n  /**\n   * @param {string} name\n   * @param {unknown} _oldValue\n   * @param {unknown} _newValue\n   * @memberof WcMenuButton\n   */\n  attributeChangedCallback(name, _oldValue, _newValue) {\n    if (name === \"open\") {\n      if (!this.open) {\n        this.dispatchEvent(\n          new CustomEvent(\"closed\", {\n            bubbles: true,\n          }),\n        );\n      } else {\n        this.dispatchEvent(\n          new CustomEvent(\"opened\", {\n            bubbles: true,\n          }),\n        );\n      }\n    } else if (name === \"aria-label\") {\n      if (this._menuButton !== null) {\n        if (this.hasAttribute(\"aria-label\")) {\n          this._menuButton.setAttribute(\n            \"aria-label\",\n            this.getAttribute(\"aria-label\"),\n          );\n        } else {\n          this._menuButton.removeAttribute(\"aria-label\");\n        }\n      }\n    } else if (name === \"type\") {\n      if (this._menuButton !== null) {\n        if (this.hasAttribute(\"type\")) {\n          this._menuButton.setAttribute(\"type\", this.getAttribute(\"type\"));\n        } else {\n          this._menuButton.removeAttribute(\"type\");\n        }\n      }\n    }\n  }\n\n  /**\n   * @internal\n   */\n  handleMenuButtonClick = () => {\n    this.open = !this.open;\n  };\n}\n\ncustomElements.define(\"wc-menu-button\", WcMenuButton);\n"]}