var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { LitElement, css, html } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import './play-icon.js';
/** @slot - Contents. */
let PlayButton = class PlayButton extends LitElement {
    constructor() {
        super(...arguments);
        this.appearance = 'plain';
        this.size = 'medium';
        this.label = '';
        this.badge = 0;
    }
    render() {
        const iconOnly = this.icon && !this.label && !this.endIcon;
        return html `<button
      ?disabled=${this.disabled}
      class=${iconOnly ? 'icon-button' : ''}
    >
      ${this.icon &&
            html `<play-icon
        size=${this.size === 'small' ? '16px' : '20px'}
        icon=${this.icon}
      ></play-icon>`}
      <slot></slot>
      ${this.label && html `<span>${this.label}</span>`}
      ${this.badge > 0 ? html `<span class="badge">${this.badge}</span>` : ''}
      ${this.endIcon &&
            html `<play-icon
        size=${this.size === 'small' ? '16px' : '20px'}
        icon=${this.endIcon}
      ></play-icon>`}
    </button>`;
    }
};
PlayButton.styles = css `
    :host {
      width: fit-content;
      display: inline-block;
    }

    /* Default button styles. Medium size. */
    button {
      display: flex;
      flex-direction: row;
      column-gap: 8px;
      align-items: center;
      height: min-content;
      cursor: pointer;
      font-family: inherit;
      user-select: none;
      white-space: nowrap;
      border: none;
      border-radius: 9001px;
    }

    /* Size: "Small" */
    :host([size='small']) button {
      padding-top: 8px;
      padding-right: 12px;
      padding-bottom: 8px;
      padding-left: 12px;
      font-size: 12px;
      font-style: normal;
      font-weight: 600;
      line-height: 16px;
      letter-spacing: -0.1px;
    }
    :host([size='small']) button.icon-button {
      padding-right: 8px;
      padding-left: 8px;
    }

    /* Size: "Medium" */
    :host([size='medium']) button {
      padding-top: 10px;
      padding-right: 16px;
      padding-bottom: 10px;
      padding-left: 16px;
      font-size: 14px;
      font-style: normal;
      font-weight: 600;
      line-height: 20px;
      letter-spacing: -0.3px;
    }
    :host([size='medium']) button.icon-button {
      padding-right: 10px;
      padding-left: 10px;
    }

    /* Appearance: "bordered" */
    :host([appearance='bordered']) button {
      color: var(--color-secondary-plain);
      background-color: transparent;
      box-shadow: inset 0px 0px 0px var(--border-width)
        var(--color-secondary-border);
    }
    :host([appearance='bordered']:hover) button {
      color: var(--color-secondary-foreground);
      background-color: var(--color-secondary-background-hovered);
    }
    :host([appearance='bordered']:active) button {
      color: var(--color-secondary-foreground);
      background-color: var(--color-secondary-background-active);
    }
    :host([appearance='bordered']) button:disabled {
      color: var(--color-interactive-content-disabled);
      background-color: transparent;
      cursor: unset;
    }

    /* Appearance: "orangered" */
    :host([appearance='orangered']) button {
      color: var(--color-brand-foreground);
      background-color: var(--color-brand-background);
    }
    :host([appearance='orangered']:hover) button {
      background-color: var(--color-brand-background-hovered);
    }
    :host([appearance='orangered']:active) button {
      background-color: var(--color-brand-background-pressed);
    }
    :host([appearance='orangered']) button:disabled {
      color: var(--color-interactive-content-disabled);
      background-color: var(--color-interactive-background-disabled);
      cursor: unset;
    }

    /* Appearance: "plain"  */
    :host([appearance='plain']) button {
      color: var(--color-secondary-foreground);
      background-color: transparent;
    }
    :host([appearance='plain']:hover) button {
      background-color: var(--color-secondary-background-hovered);
    }
    :host([appearance='plain']:active) button {
      background-color: var(--color-secondary-background-active);
    }
    :host([appearance='plain']) button:disabled {
      color: var(--color-interactive-content-disabled);
      background-color: var(--color-interactive-background-disabled);
      cursor: unset;
    }

    /* Appearance: "inverted"  */
    :host([appearance='inverted']) button {
      color: var(--color-neutral-foreground);
      background-color: var(--color-neutral-content-weak);
    }
    :host([appearance='inverted']:hover) button {
      background-color: var(--color-neutral-content);
    }
    :host([appearance='inverted']:active) button {
      background-color: var(--color-neutral-content-strong);
    }
    :host([appearance='inverted']) button:disabled {
      color: var(--color-neutral-disabled);
      background-color: var(--color-neutral-background-disabled);
      cursor: unset;
    }

    button:focus {
      outline-color: var(--color-brand-background);
    }

    .badge {
      color: var(--color-notification-foreground);
      border-radius: 9001px;
      background-color: var(--color-notification-background);
      padding-top: 0px;
      padding-right: 4px;
      padding-bottom: 0px;
      padding-left: 4px;
      font-size: 12px;
      font-style: normal;
      font-weight: 600;
      line-height: 16px;
      outline-width: 2px;
      outline-style: solid;
      outline-color: var(--color-notification-background);
    }
  `;
__decorate([
    property()
], PlayButton.prototype, "appearance", void 0);
__decorate([
    property({ type: Boolean })
], PlayButton.prototype, "disabled", void 0);
__decorate([
    property()
], PlayButton.prototype, "endIcon", void 0);
__decorate([
    property()
], PlayButton.prototype, "icon", void 0);
__decorate([
    property()
], PlayButton.prototype, "size", void 0);
__decorate([
    property({ type: String })
], PlayButton.prototype, "label", void 0);
__decorate([
    property({ type: Number })
], PlayButton.prototype, "badge", void 0);
PlayButton = __decorate([
    customElement('play-button')
], PlayButton);
export { PlayButton };
//# sourceMappingURL=play-button.js.map