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, Prop, Element, Method, Watch, Event, Host, State } from '@stencil/core';
import { VegaCurrentStepUpdate } from '../../helpers/event-manager/event-id/vega-event-id';
import { sanitizeVegaComponent } from '../../utils/component';
import { InjectVegaGlobalSlimmer, InjectVegaSlimmer, methodPlaceholder, } from 'vega-slimmer/core';
import { createEventEmitSlimmer, } from '../../helpers/event-manager/slimmers/event-emit-slimmer';
import { createDeprecatedPropertySlimmer, } from '../../helpers/slimmers/deprecated-property-slimmer';
import { VegaComponentUsageRuntimeMetricsSlimmer } from '../../helpers/slimmers/component-usage-runtime-metrics';
import { VegaProgressTrackerRuntimeMetricsPayloadDefinition } from '../../constants/runtime-metrics-payload-definition/vega-progress-tracker/runtime-metrics-payload-definition';
import { VegaProgressTrackerRenderer } from './slimmers/renderers/vega-progress-tracker-renderer';
import { VegaProgressTrackerCurrentStepController } from './slimmers/controllers/vega-progress-tracker-current-step-controller';
import { createSubStateNotifySlimmer } from '../../helpers/slimmers/sub-state/sub-state-notify-slimmer';
import { VegaProgressTrackerCurrentStepsController } from './slimmers/controllers/vega-progress-tracker-current-steps-controller';
import { VegaProgressTrackerRenderModeController } from './slimmers/controllers/vega-progress-tracker-render-mode-controller';
import { VegaProgressTrackerCurrentDirectionController } from './slimmers/controllers/vega-progress-tracker-current-direction-controller';
/**
 * @vegaVersion 1.0.7
 */
export class VegaProgressTracker {
  constructor() {
    this.globalSlimmers = {};
    this.renderModeController = new VegaProgressTrackerRenderModeController();
    this.currentStepsController = new VegaProgressTrackerCurrentStepsController();
    this.currentStepController = new VegaProgressTrackerCurrentStepController();
    this.currentDirectionController = new VegaProgressTrackerCurrentDirectionController();
    this.renderer = new VegaProgressTrackerRenderer();
    this.currentStepUpdateEventEmitter = createEventEmitSlimmer(VegaProgressTracker, VegaCurrentStepUpdate);
    this.currentStepsSubStateSlimmer = createSubStateNotifySlimmer(VegaProgressTracker, 'currentSteps', 'watchCurrentSteps');
    this.deprecatedPropertySlimmer = createDeprecatedPropertySlimmer(VegaProgressTracker, 'completedSteps', 'completedStepArray', []);
    this.vegaComponentUsageRuntimeMetricsSlimmer = new VegaComponentUsageRuntimeMetricsSlimmer(VegaProgressTrackerRuntimeMetricsPayloadDefinition);
    this.currentSteps = [];
    /**
     * Indicates the current step or stage in a
     *    sequential process or workflow,
     *    starting from 0.
     *
     * @vegaVersion 1.0.7
     */
    /* eslint-disable-next-line @stencil/strict-mutable */
    this.current = 0;
    /**
     * Specifies the direction of the Progress Tracker component.
     *
     * It can be set to either horizontal or vertical.
     *    In the horizontal direction, the tracker is divided into
     *    panes with navigable arrows. In the vertical direction,
     *    it is displayed as a single pane.
     * It also can be set as ResponsiveType for responsive direction.
     *
     * @vegaVersion 1.0.7
     */
    this.direction = 'vertical';
    /**
     * Specifies an array of step subtitles for
     *    the Progress Tracker component.
     *
     * Each subtitle corresponds to a step in the
     *    progression of the workflow or process.
     *
     * @vegaVersion 1.3.0
     */
    this.steps = [];
    /**
     * Specifies an array of completed step titles for
     *    the Progress Tracker component.
     *
     * Each completed step title represents a step that
     *    has been successfully completed in the
     *    workflow or process.
     * @deprecated This property will be removed soon and replaced by prop completedSteps
     *
     * @vegaVersion 1.5.0
     */
    this.completedStepArray = [];
    /**
     * Specifies an array of titles representing completed steps in the progress tracker,
     *    indicating successful completion within the workflow or process.
     *
     * @vegaVersion 2.2.0
     */
    this.completedSteps = [];
    /**
     * Enables the ability to click on the steps in
     *    the Progress Tracker component.
     *
     * @vegaVersion 1.5.0
     */
    this.canClickStep = true;
    /**
     * When enabled, `current = -1` becomes a valid state that indicates
     *    no highlighted/current step (e.g. all steps are pending or the
     *    workflow has not started).
     *
     * Two ways to enter this state:
     * - Set the `current` prop to `-1`.
     * - Call the `setCurrent(-1)` method.
     *
     * @VegaHint `prevStep()` still clamps at `0` and will not take `current`
     *    into `-1`.
     *
     * @vegaVersion 2.82.0
     */
    this.allowNoCurrentStep = false;
  }
  watchCurrentSteps() {
    methodPlaceholder();
  }
  /**
   * The below method is e2e-test covered in
   * @see{module:vega-progress-tracker-e2e-change-current-mobile}
   */
  /* istanbul ignore next */
  async watchCurrentChange() {
    methodPlaceholder();
  }
  async watchDirection() {
    methodPlaceholder();
  }
  watchSteps() {
    methodPlaceholder();
  }
  watchCompletedStepArray() {
    methodPlaceholder();
  }
  watchCompletedSteps() {
    methodPlaceholder();
  }
  /**
   * Invoke this method to change the tracker's current step
   *    to the next step, if available.
   *
   * @vegaVersion 1.5.0
   */
  async nextStep() {
    methodPlaceholder();
  }
  /**
   * Invoke this method to change the tracker's current step
   *    to the previous step, if available.
   *
   * @vegaVersion 1.5.0
   */
  async prevStep() {
    methodPlaceholder();
  }
  /**
   * Invoke this method to set the current step of the tracker.
   *
   * @vegaVersion 1.0.7
   */
  async setCurrent(step) {
    methodPlaceholder(step);
  }
  /**
   * Invoke this method to retrieve the tracker's current step.
   *
   * @vegaVersion 1.3.0
   */
  async getCurrent() {
    return this.current;
  }
  render() {
    return sanitizeVegaComponent(h(Host, { class: {
        'vega-progress-tracker': true,
        [this.currentDirection]: true,
        'click-step-disabled': !this.canClickStep,
      } }, this.renderer.render()), this.host);
  }
  static get is() { return "vega-progress-tracker"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["vega-progress-tracker.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["vega-progress-tracker.css"]
  }; }
  static get properties() { return {
    "current": {
      "type": "number",
      "mutable": true,
      "complexType": {
        "original": "number",
        "resolved": "number",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.0.7"
          }],
        "text": "Indicates the current step or stage in a\n   sequential process or workflow,\n   starting from 0."
      },
      "attribute": "current",
      "reflect": false,
      "defaultValue": "0"
    },
    "direction": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "ResponsiveType<VegaProgressTrackerDirectionType>",
        "resolved": "\"horizontal\" | \"horizontal-compact\" | \"vertical\" | { S?: VegaProgressTrackerDirectionType; M?: VegaProgressTrackerDirectionType; L?: VegaProgressTrackerDirectionType; XL?: VegaProgressTrackerDirectionType; default?: VegaProgressTrackerDirectionType; }",
        "references": {
          "ResponsiveType": {
            "location": "import",
            "path": "../../types/ui.type"
          },
          "VegaProgressTrackerDirectionType": {
            "location": "import",
            "path": "./type"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.0.7"
          }],
        "text": "Specifies the direction of the Progress Tracker component.\n\nIt can be set to either horizontal or vertical.\n   In the horizontal direction, the tracker is divided into\n   panes with navigable arrows. In the vertical direction,\n   it is displayed as a single pane.\nIt also can be set as ResponsiveType for responsive direction."
      },
      "attribute": "direction",
      "reflect": false,
      "defaultValue": "'vertical'"
    },
    "steps": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "string[] | VegaProgressTrackerStepItem[]",
        "resolved": "VegaProgressTrackerStepItem[] | string[]",
        "references": {
          "VegaProgressTrackerStepItem": {
            "location": "import",
            "path": "./type"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.3.0"
          }],
        "text": "Specifies an array of step subtitles for\n   the Progress Tracker component.\n\nEach subtitle corresponds to a step in the\n   progression of the workflow or process."
      },
      "defaultValue": "[]"
    },
    "completedStepArray": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "string[]",
        "resolved": "string[]",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "deprecated",
            "text": "This property will be removed soon and replaced by prop completedSteps"
          }, {
            "name": "vegaVersion",
            "text": "1.5.0"
          }],
        "text": "Specifies an array of completed step titles for\n   the Progress Tracker component.\n\nEach completed step title represents a step that\n   has been successfully completed in the\n   workflow or process."
      },
      "defaultValue": "[]"
    },
    "completedSteps": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "string[]",
        "resolved": "string[]",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "2.2.0"
          }],
        "text": "Specifies an array of titles representing completed steps in the progress tracker,\n   indicating successful completion within the workflow or process."
      },
      "defaultValue": "[]"
    },
    "canClickStep": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.5.0"
          }],
        "text": "Enables the ability to click on the steps in\n   the Progress Tracker component."
      },
      "attribute": "can-click-step",
      "reflect": false,
      "defaultValue": "true"
    },
    "allowNoCurrentStep": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "name": "VegaHint",
            "text": "`prevStep()` still clamps at `0` and will not take `current`\ninto `-1`."
          }, {
            "name": "vegaVersion",
            "text": "2.82.0"
          }],
        "text": "When enabled, `current = -1` becomes a valid state that indicates\n   no highlighted/current step (e.g. all steps are pending or the\n   workflow has not started).\n\nTwo ways to enter this state:\n- Set the `current` prop to `-1`.\n- Call the `setCurrent(-1)` method."
      },
      "attribute": "allow-no-current-step",
      "reflect": false,
      "defaultValue": "false"
    }
  }; }
  static get states() { return {
    "currentSteps": {},
    "currentDirection": {}
  }; }
  static get events() { return [{
      "method": "vegaCurrentStepUpdate",
      "name": "vegaCurrentStepUpdate",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "vegaVersion",
            "text": "1.5.0"
          }],
        "text": "An event emitter notifying that the current step has changed."
      },
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      }
    }, {
      "method": "currentStepUpdate",
      "name": "currentStepUpdate",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [{
            "name": "eventSemantics",
            "text": "namespace:native"
          }, {
            "name": "vegaVersion",
            "text": "2.0.0"
          }],
        "text": "An event emitter notifying that the current step has changed."
      },
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      }
    }]; }
  static get methods() { return {
    "nextStep": {
      "complexType": {
        "signature": "() => Promise<void>",
        "parameters": [],
        "references": {
          "Promise": {
            "location": "global"
          }
        },
        "return": "Promise<void>"
      },
      "docs": {
        "text": "Invoke this method to change the tracker's current step\n   to the next step, if available.",
        "tags": [{
            "name": "vegaVersion",
            "text": "1.5.0"
          }]
      }
    },
    "prevStep": {
      "complexType": {
        "signature": "() => Promise<void>",
        "parameters": [],
        "references": {
          "Promise": {
            "location": "global"
          }
        },
        "return": "Promise<void>"
      },
      "docs": {
        "text": "Invoke this method to change the tracker's current step\n   to the previous step, if available.",
        "tags": [{
            "name": "vegaVersion",
            "text": "1.5.0"
          }]
      }
    },
    "setCurrent": {
      "complexType": {
        "signature": "(step: number) => Promise<void>",
        "parameters": [{
            "tags": [],
            "text": ""
          }],
        "references": {
          "Promise": {
            "location": "global"
          }
        },
        "return": "Promise<void>"
      },
      "docs": {
        "text": "Invoke this method to set the current step of the tracker.",
        "tags": [{
            "name": "vegaVersion",
            "text": "1.0.7"
          }]
      }
    },
    "getCurrent": {
      "complexType": {
        "signature": "() => Promise<number>",
        "parameters": [],
        "references": {
          "Promise": {
            "location": "global"
          }
        },
        "return": "Promise<number>"
      },
      "docs": {
        "text": "Invoke this method to retrieve the tracker's current step.",
        "tags": [{
            "name": "vegaVersion",
            "text": "1.3.0"
          }]
      }
    }
  }; }
  static get elementRef() { return "host"; }
  static get watchers() { return [{
      "propName": "currentSteps",
      "methodName": "watchCurrentSteps"
    }, {
      "propName": "current",
      "methodName": "watchCurrentChange"
    }, {
      "propName": "direction",
      "methodName": "watchDirection"
    }, {
      "propName": "steps",
      "methodName": "watchSteps"
    }, {
      "propName": "completedStepArray",
      "methodName": "watchCompletedStepArray"
    }, {
      "propName": "completedSteps",
      "methodName": "watchCompletedSteps"
    }]; }
}
__decorate([
  InjectVegaGlobalSlimmer()
], VegaProgressTracker.prototype, "globalSlimmers", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaProgressTracker.prototype, "renderModeController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaProgressTracker.prototype, "currentStepsController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaProgressTracker.prototype, "currentStepController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaProgressTracker.prototype, "currentDirectionController", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaProgressTracker.prototype, "renderer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaProgressTracker.prototype, "currentStepUpdateEventEmitter", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaProgressTracker.prototype, "currentStepsSubStateSlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaProgressTracker.prototype, "deprecatedPropertySlimmer", void 0);
__decorate([
  InjectVegaSlimmer()
], VegaProgressTracker.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
