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 { h, Component, Element, Host, Prop, State, Watch, Event } from '@stencil/core';
import { sanitizeVegaComponent } from '../../utils/component';
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer, methodPlaceholder, } from 'vega-slimmer/core';
import { createSubStateNotifySlimmer } from '../../helpers/slimmers/sub-state/sub-state-notify-slimmer';
import { createEventEmitSlimmer, } from '../../helpers/event-manager/slimmers/event-emit-slimmer';
import { VegaClick } from '../../helpers/event-manager/event-id/vega-event-id';
import { ChildNodesEventPreventSlimmer } from '../../helpers/event-manager/slimmers/child-nodes-event-prevent-slimmer';
import { VegaButtonGroupClickController } from './slimmers/controllers/vega-button-group-click-controller';
import { VegaButtonGroupAllItemsDisabledController } from './slimmers/controllers/vega-button-group-all-items-disabled-controller';
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../helpers/slimmers/component-usage-runtime-metrics';
import { VegaButtonGroupRuntimeMetricsPayloadDefinition } from '../../constants/runtime-metrics-payload-definition/vega-button-group/runtime-metrics-payload-definition';
/**
 * @vegaVersion 2.5.0
 */
export class VegaButtonGroup {
  constructor() {
    this.globalSlimmers = {};
    this.clickEventEmitter = createEventEmitSlimmer(VegaButtonGroup, VegaClick);
    this.clickEventPrevent = new ChildNodesEventPreventSlimmer([VegaClick], () => this.flexContainer);
    this.buttonGroupClickController = new VegaButtonGroupClickController();
    this.variantNotifySlimmer = createSubStateNotifySlimmer(VegaButtonGroup, 'variant', 'watchVariant');
    this.sizeNotifySlimmer = createSubStateNotifySlimmer(VegaButtonGroup, 'size', 'watchSize');
    this.iconAlignNotifySlimmer = createSubStateNotifySlimmer(VegaButtonGroup, 'iconAlign', 'watchIconAlign');
    this.disabledNotifySlimmer = createSubStateNotifySlimmer(VegaButtonGroup, 'disabled', 'watchDisabled');
    this.allItemsDisabledNotifySlimmer = createSubStateNotifySlimmer(VegaButtonGroup, 'allItemsDisabled', 'watchAllItemsDisabled');
    this.allItemsDisabledController = new VegaButtonGroupAllItemsDisabledController();
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer(VegaButtonGroupRuntimeMetricsPayloadDefinition);
    this.allItemsDisabled = false;
    /**
     * Specifies the visual style and prominence of the button group.
     *
     * It determines how the button group will be presented to the user.
     *
     * @vegaVersion 2.5.0
     */
    this.variant = 'primary';
    /**
     * Specifies the size of the button group.
     *
     * @vegaVersion 2.5.0
     */
    this.size = 'default';
    /**
     * Specifies the placement of the icon in relation to the button's label.
     *
     * @vegaVersion 2.5.0
     */
    this.iconAlign = 'left';
    /**
     * Specifies whether the button elements are disabled.
     *
     * @vegaVersion 2.72.0
     */
    this.disabled = false;
  }
  watchAllItemsDisabled() {
    methodPlaceholder();
  }
  watchVariant() {
    methodPlaceholder();
  }
  watchSize() {
    methodPlaceholder();
  }
  watchIconAlign() {
    methodPlaceholder();
  }
  watchDisabled() {
    methodPlaceholder();
  }
  render() {
    const containerClasses = `vega-button-group-container vega-button-group-${this.variant}`;
    return sanitizeVegaComponent(h(Host, null,
      h("vega-flex", { class: containerClasses, direction: "row", alignItems: this.variant === 'tertiary' ? 'center' : 'stretch', gap: this.variant !== 'tertiary' ? 'size-2' : '0', ref: (node) => (this.flexContainer = node) },
        h("slot", null))), this.host);
  }
  static get is() { return "vega-button-group"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["vega-button-group.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["vega-button-group.css"]
  }; }
  static get properties() { return {
    "variant": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "VegaButtonGroupVariant",
        "resolved": "\"primary\" | \"secondary\" | \"tertiary\"",
        "references": {
          "VegaButtonGroupVariant": {
            "location": "import",
            "path": "./types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.5.0"
          }],
        "text": "Specifies the visual style and prominence of the button group.\n\nIt determines how the button group will be presented to the user."
      },
      "attribute": "variant",
      "reflect": false,
      "defaultValue": "'primary'"
    },
    "size": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "VegaButtonGroupSize",
        "resolved": "\"default\" | \"large\" | \"small\"",
        "references": {
          "VegaButtonGroupSize": {
            "location": "import",
            "path": "./types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.5.0"
          }],
        "text": "Specifies the size of the button group."
      },
      "attribute": "size",
      "reflect": false,
      "defaultValue": "'default'"
    },
    "iconAlign": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "VegaButtonGroupIconAlign",
        "resolved": "\"left\" | \"right\"",
        "references": {
          "VegaButtonGroupIconAlign": {
            "location": "import",
            "path": "./types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.5.0"
          }],
        "text": "Specifies the placement of the icon in relation to the button's label."
      },
      "attribute": "icon-align",
      "reflect": false,
      "defaultValue": "'left'"
    },
    "disabled": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.72.0"
          }],
        "text": "Specifies whether the button elements are disabled."
      },
      "attribute": "disabled",
      "reflect": false,
      "defaultValue": "false"
    }
  }; }
  static get states() { return {
    "allItemsDisabled": {}
  }; }
  static get events() { return [{
      "method": "vegaClick",
      "name": "vegaClick",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.5.0"
          }],
        "text": "An event emitter notifying the click event of the button group."
      },
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      }
    }, {
      "method": "click",
      "name": "click",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "eventSemantics",
            "text": "namespace:native"
          }, {
            "name": "vegaVersion",
            "text": "2.5.0"
          }],
        "text": "An event emitter notifying the click event of the button."
      },
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      }
    }]; }
  static get elementRef() { return "host"; }
  static get watchers() { return [{
      "propName": "allItemsDisabled",
      "methodName": "watchAllItemsDisabled"
    }, {
      "propName": "variant",
      "methodName": "watchVariant"
    }, {
      "propName": "size",
      "methodName": "watchSize"
    }, {
      "propName": "iconAlign",
      "methodName": "watchIconAlign"
    }, {
      "propName": "disabled",
      "methodName": "watchDisabled"
    }]; }
}
__decorate([
  InjectVegaGlobalSlimmer()
], VegaButtonGroup.prototype, "globalSlimmers", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "clickEventEmitter", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "clickEventPrevent", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "buttonGroupClickController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "variantNotifySlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "sizeNotifySlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "iconAlignNotifySlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "disabledNotifySlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "allItemsDisabledNotifySlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "allItemsDisabledController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaButtonGroup.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
