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, h, Element, Host, Prop, State } from '@stencil/core';
import { sanitizeVegaComponent } from '../../../utils/component';
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer, slotPlaceholder, } from 'vega-slimmer/core';
import { VegaCalendarEventRenderer } from './slimmers/renderers/vega-calendar-event-renderer';
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../../helpers/slimmers/component-usage-runtime-metrics';
import { VegaCalendarEventSubStateController } from './slimmers/controllers/vega-calendar-sub-state-controller';
import { VegaCalendarTitleMaxHeightController } from './slimmers/controllers/vega-calendar-event-title-max-height-controller';
import { PageResizeObserverSlimmer } from '../../../helpers/slimmers/page-resize-observer-slimmer';
import { VegaCalendarEventSlotController } from './slimmers/controllers/vega-calendar-event-slot-controller';
/**
 * @vegaVersion 2.14.0
 */
export class VegaCalendarEvent {
  constructor() {
    this.globalSlimmer = {};
    this.pageResizeObserverSlimmer = new PageResizeObserverSlimmer({
      target: () => this.host,
      callback: 
      /**
       * The below method is e2e-test covered in
       * @see{module:vega-calendar-event-title-max-height-e2e}
       */
      /* istanbul ignore next */
      () => this.titleMaxHeightController.setVerticalTitleMaxHeight(),
    });
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer();
    this.renderer = new VegaCalendarEventRenderer();
    this.slotController = new VegaCalendarEventSlotController();
    this.subStateController = new VegaCalendarEventSubStateController();
    this.titleMaxHeightController = new VegaCalendarTitleMaxHeightController();
    this.timeFormat = '24-hour';
    this.slotMode = false;
    this.showColorBar = true;
  }
  render() {
    slotPlaceholder(h("slot", null));
    return sanitizeVegaComponent(h(Host, { role: this.calendarEvent ? 'button' : undefined, tabindex: this.calendarEvent ? 0 : undefined }, this.calendarEvent ? this.renderer.render() : null), this.host);
  }
  static get is() { return "vega-calendar-event"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["vega-calendar-event.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["vega-calendar-event.css"]
  }; }
  static get properties() { return {
    "calendarEvent": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "CalendarEvent",
        "resolved": "CalendarEvent",
        "references": {
          "CalendarEvent": {
            "location": "import",
            "path": "../../../helpers/calendar/calendar-event"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.14.0"
          }],
        "text": "Specifies the calendar event."
      }
    }
  }; }
  static get states() { return {
    "timeFormat": {},
    "slotMode": {},
    "showColorBar": {}
  }; }
  static get elementRef() { return "host"; }
}
__decorate([
  InjectVegaGlobalSlimmer()
], VegaCalendarEvent.prototype, "globalSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaCalendarEvent.prototype, "pageResizeObserverSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaCalendarEvent.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaCalendarEvent.prototype, "renderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaCalendarEvent.prototype, "slotController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaCalendarEvent.prototype, "subStateController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaCalendarEvent.prototype, "titleMaxHeightController", void 0);
