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 { Component, Prop, Element, Method, Event } from '@stencil/core';
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer } from 'vega-slimmer/core';
import { sanitizeVegaComponent } from '../../utils/component';
import { VegaBannerRenderer } from './slimmers/renderers/vega-banner-renderer';
import { VegaBannerIconController } from './slimmers/controllers/vega-banner-icon-controller';
import { VegaBannerActionButtonRenderer } from './slimmers/renderers/vega-banner-action-button-renderer';
import { createEventEmitSlimmer, } from '../../helpers/event-manager/slimmers/event-emit-slimmer';
import { VegaActionButtonClick, VegaClose } from '../../helpers/event-manager/event-id/vega-event-id';
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../helpers/slimmers/component-usage-runtime-metrics';
/**
 * @vegaVersion 1.9.1
 */
export class VegaBanner {
  constructor() {
    this.globalSlimmers = {};
    this.closeEventEmitter = createEventEmitSlimmer(VegaBanner, VegaClose);
    this.renderer = new VegaBannerRenderer();
    this.actionButtonRenderer = new VegaBannerActionButtonRenderer();
    this.iconController = new VegaBannerIconController();
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
    this.actionButtonClickEventEmitter = createEventEmitSlimmer(VegaBanner, VegaActionButtonClick);
    /**
     * Specifies the type of the banner.
     *
     * @vegaVersion 2.8.0
     */
    this.type = 'info';
    /**
     * Specifies the label or title for the banner.
     *
     * @vegaVersion 2.8.0
     */
    this.bannerTitle = '';
    /**
     * Specifies the content displayed within the banner.
     * Also supports slot-based content: place a child element with `slot="content"` inside
     * the banner to render rich HTML content. The slot takes precedence over this property.
     *
     * @vegaVersion 2.8.0
     */
    this.content = '';
    /**
     * Specifies the action buttons available within the banner.
     *    These buttons enable users to perform specific actions,
     *    enhancing user interaction within the banner.
     *
     * @vegaVersion 2.8.0
     */
    this.actionButtons = null;
    /**
     * Determines whether the close icon is displayed.
     *
     * @vegaVersion 1.13.0
     */
    this.showCloseButton = true;
    /**
     * Determines whether the banner is displayed.
     *
     * @vegaVersion 2.13.0
     */
    this.isOpen = true;
  }
  /**
   * Invoke this method to close the banner.
   *
   * @vegaVersion 2.8.0
   */
  async doClose() {
    this.host.remove();
    this.closeEventEmitter.emit();
  }
  render() {
    return sanitizeVegaComponent(this.renderer.render(), this.host);
  }
  static get is() { return "vega-banner"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["vega-banner.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["vega-banner.css"]
  }; }
  static get properties() { return {
    "type": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "VegaBannerPropType",
        "resolved": "\"error\" | \"info\" | \"success\" | \"warning\"",
        "references": {
          "VegaBannerPropType": {
            "location": "import",
            "path": "./types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.8.0"
          }],
        "text": "Specifies the type of the banner."
      },
      "attribute": "type",
      "reflect": false,
      "defaultValue": "'info'"
    },
    "bannerTitle": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.8.0"
          }],
        "text": "Specifies the label or title for the banner."
      },
      "attribute": "banner-title",
      "reflect": false,
      "defaultValue": "''"
    },
    "content": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.8.0"
          }],
        "text": "Specifies the content displayed within the banner.\nAlso supports slot-based content: place a child element with `slot=\"content\"` inside\nthe banner to render rich HTML content. The slot takes precedence over this property."
      },
      "attribute": "content",
      "reflect": false,
      "defaultValue": "''"
    },
    "actionButtons": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "VegaBannerActionButtonType[]",
        "resolved": "VegaBannerActionButtonType[]",
        "references": {
          "VegaBannerActionButtonType": {
            "location": "import",
            "path": "./types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.8.0"
          }],
        "text": "Specifies the action buttons available within the banner.\n   These buttons enable users to perform specific actions,\n   enhancing user interaction within the banner."
      },
      "defaultValue": "null"
    },
    "showCloseButton": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.13.0"
          }],
        "text": "Determines whether the close icon is displayed."
      },
      "attribute": "show-close-button",
      "reflect": false,
      "defaultValue": "true"
    },
    "isOpen": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.13.0"
          }],
        "text": "Determines whether the banner is displayed."
      },
      "attribute": "is-open",
      "reflect": false,
      "defaultValue": "true"
    }
  }; }
  static get events() { return [{
      "method": "vegaClose",
      "name": "vegaClose",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.13.0"
          }],
        "text": "An event emitter notifying the banner close event."
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }, {
      "method": "close",
      "name": "close",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "eventSemantics",
            "text": "namespace:native"
          }, {
            "name": "vegaVersion",
            "text": "2.8.0"
          }],
        "text": "An event emitter notifying the banner close event."
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }, {
      "method": "vegaActionButtonClick",
      "name": "vegaActionButtonClick",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.18.0"
          }],
        "text": "An event emitter notifying the banner action button has been clicked."
      },
      "complexType": {
        "original": "VegaBannerActionButtonType",
        "resolved": "{ label: string; vegaClick?: (item: VegaBannerActionButtonType) => void; key?: string; }",
        "references": {
          "VegaBannerActionButtonType": {
            "location": "import",
            "path": "./types"
          }
        }
      }
    }, {
      "method": "actionButtonClick",
      "name": "actionButtonClick",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "eventSemantics",
            "text": "namespace:native"
          }, {
            "name": "vegaVersion",
            "text": "2.18.0"
          }],
        "text": "An event emitter notifying the banner action button has been clicked."
      },
      "complexType": {
        "original": "VegaBannerActionButtonType",
        "resolved": "{ label: string; vegaClick?: (item: VegaBannerActionButtonType) => void; key?: string; }",
        "references": {
          "VegaBannerActionButtonType": {
            "location": "import",
            "path": "./types"
          }
        }
      }
    }]; }
  static get methods() { return {
    "doClose": {
      "complexType": {
        "signature": "() => Promise<void>",
        "parameters": [],
        "references": {
          "Promise": {
            "location": "global"
          }
        },
        "return": "Promise<void>"
      },
      "docs": {
        "text": "Invoke this method to close the banner.",
        "tags": [{
            "name": "vegaVersion",
            "text": "2.8.0"
          }]
      }
    }
  }; }
  static get elementRef() { return "host"; }
}
__decorate([
  InjectVegaGlobalSlimmer()
], VegaBanner.prototype, "globalSlimmers", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaBanner.prototype, "closeEventEmitter", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaBanner.prototype, "renderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaBanner.prototype, "actionButtonRenderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaBanner.prototype, "iconController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaBanner.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaBanner.prototype, "actionButtonClickEventEmitter", void 0);
