'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-58ea899e.js');
const vegaEventId = require('./vega-event-id-c08ce3d3.js');
const component = require('./component-1e352960.js');
const globalSlimmerRegistry = require('./global-slimmer-registry-b3bce7e0.js');
const componentUsageRuntimeMetrics = require('./component-usage-runtime-metrics-4572c5b7.js');
const eventEmitSlimmer = require('./event-emit-slimmer-bcb458b2.js');
const deprecatedPropertySlimmer = require('./deprecated-property-slimmer-300a3929.js');
const domNodeSubjectObserverFactory = require('./dom-node-subject-observer-factory-9110cb94.js');
const accessibility = require('./accessibility-bfa227f6.js');
const changeManager = require('./change-manager-a297e4d2.js');
const vegaInternalEventId = require('./vega-internal-event-id-87014e4f.js');
const number = require('./number-4816603d.js');
const observer = require('./observer-f49483e8.js');
const synchronizeTaskQueue = require('./synchronize-task-queue-1ee80e94.js');
const subStateNotifySlimmer = require('./sub-state-notify-slimmer-b33171b0.js');
const mutationObserverSlimmer = require('./mutation-observer-slimmer-749d5020.js');
const pageResizeObserverSlimmer = require('./page-resize-observer-slimmer-273d62ef.js');
const responsiveFormatFacade = require('./responsive-format-facade-2cab7344.js');
const typeGuard = require('./type-guard-3ec852d7.js');
const breakpoints = require('./breakpoints-1cc2c4c6.js');
const autoRunWhenReRenderTaskQueueSlimmer_abstract = require('./auto-run-when-re-render-task-queue-slimmer.abstract-5734634d.js');
const subStateObserverSlimmer = require('./sub-state-observer-slimmer-b8f6f27b.js');
require('./dynamic-slimmer-f31fdfd7.js');
require('./internal-vega-event-manager-fef893bf.js');
require('./try-get-document-c0ebd39a.js');
require('./object-b53e9416.js');
require('./ui-ae4ee13d.js');
require('./ui-32120990.js');
require('./pixel-98f2a10c.js');
require('./breakpoints-ebde4837.js');
require('./array-249289f2.js');
require('./feature-flag-controller-9129ef52.js');
require('./index-f054eb5d.js');
require('./typography-4560e7f1.js');
require('./internal-translation-controller-fb1532f4.js');
require('./static-subject-title-5829a298.js');

const VegaProgressTrackerRuntimeMetricsPayloadDefinition = [
  {
    payloadKey: 'COMPLETED_STEP_ARRAY_IS_EMPTY',
    payloadDescription: '@deprecated Specifies an array of completed step titles for the Progress Tracker component.',
    /**
     * The function checks if the length of `completedStepArray` property of the `host` element is equal to '0'.
     * If it is, the function will return `true`.
     *
     * @param {HTMLElement} host - The element to check
     * @returns {boolean} A boolean value
     */
    payloadValue: (host) => host.completedStepArray.length === 0,
  },
  {
    payloadKey: 'COMPLETED_STEP_ARRAY_IS_NOT_EMPTY',
    payloadDescription: '@deprecated Specifies an array of completed step titles for the Progress Tracker component.',
    /**
     * The function checks if the length of `completedStepArray` property of the `host` element is not equal to '0'.
     * If it is, the function will return `true`.
     *
     * @param {HTMLElement} host - The element to check
     * @returns {boolean} A boolean value
     */
    payloadValue: (host) => host.completedStepArray.length > 0,
  },
];

var __decorate$7 = (undefined && undefined.__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;
};
/** Renders the progress tracker component. */
class VegaProgressTrackerRenderer extends globalSlimmerRegistry.VegaSlimmer {
  constructor() {
    super(...arguments);
    this.renderStepIcon = (step, stepIndex) => {
      return (index.h("div", { class: "vega-progress-step-icon-container" },
        index.h("div", { class: "vega-progress-step__icon" }, step.isCompleted() ? (index.h("vega-icon", { icon: "checkmark-rounded", size: "size-16" })) : (index.h("span", null, stepIndex + 1)))));
    };
    this.renderStep = (step, stepIndex) => {
      var _a;
      return (index.h("div", { role: !step.clickable ? null : 'button', class: [
          'vega-progress-step',
          step.progressStatus,
          step.isCurrent ? 'current' : '',
          !step.clickable ? 'disabled' : '',
        ]
          .filter(Boolean)
          .join(' '), "data-index": stepIndex, tabIndex: !step.clickable ? null : 0, onClick: !step.clickable ? null : this.onStepIconClick, onKeyDown: !step.clickable ? null : accessibility.createEnterKeyHandlerToTriggerClick(), "aria-label": step.title },
        index.h("div", { class: "vega-progress-step-icon-divider" },
          index.h("div", { class: `vega-progress-step__divider left ${((_a = this.currentSteps[stepIndex - 1]) === null || _a === void 0 ? void 0 : _a.isCompleted()) ? 'background' : ''}` }),
          this.renderStepIcon(step, stepIndex),
          index.h("div", { class: `vega-progress-step__divider right ${step.isCompleted() ? 'complete' : 'default'}` })),
        index.h("div", { class: "vega-progress-step__title" }, this.renderStepTitle(step, stepIndex, 'top'))));
    };
    this.onStepIconClick = (e) => {
      const index = Number(e.currentTarget.getAttribute('data-index'));
      changeManager.ChangeManager.notify(domNodeSubjectObserverFactory.domNodeSubjectFactory.getSubject(this.host, vegaInternalEventId.VegaInternalProgressTrackerStepClick), index);
    };
  }
  async gotoCarouselPage(current) {
    const targetCurrent = current !== null && current !== void 0 ? current : this.current;
    if (targetCurrent >= 0 && this.carouselContainerRef.getBoundingClientRect().width > 0) {
      await this.carouselRef.goToPage(targetCurrent + 1);
    }
  }
  render() {
    return (index.h(index.Fragment, null,
      index.h("div", { class: "vega-progress-tracker__container" },
        index.h("div", { class: "vega-progress-tracker__slot" }, this.currentSteps.map((step, stepIndex) => this.renderStep(step, stepIndex)))),
      index.h("div", { class: "vega-progress-tracker__box", ref: (ref) => (this.carouselContainerRef = ref) },
        index.h("vega-carousel", { showSlider: false, itemsPerPage: 1, canSwipe: this.canClickStep, ref: (el) => {
            /**
             * The below method is e2e-test covered in
             * @see{module:vega-progress-tracker-with-touch-event-mobile}
             */
            /* istanbul ignore next */
            domNodeSubjectObserverFactory.DomNodeSubjectObserverFactory.addUniqueObserverToNode(el, vegaEventId.VegaPageUpdate, async (input) => {
              await this.host.setCurrent(input.detail - 1);
            });
            return (this.carouselRef = el);
          } }, this.currentSteps.map((step, index) => this.renderStepTitle(step, index, 'carousel'))))));
  }
  renderStepTitle(step, stepIndex, position) {
    const isCompact = this.currentDirection === 'horizontal-compact';
    if ((isCompact && position === 'carousel') || (!isCompact && position === 'top')) {
      if (this.renderModeController.isSourceRenderMode()) {
        return (index.h("vega-progress-tracker-step", { key: step.stepKey, stepKey: step.stepKey }, step.title));
      }
      else {
        return index.h("slot", { name: `step-${stepIndex}` });
      }
    }
  }
}
__decorate$7([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerRenderer.prototype, "host", void 0);
__decorate$7([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerRenderer.prototype, "currentSteps", void 0);
__decorate$7([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerRenderer.prototype, "canClickStep", void 0);
__decorate$7([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerRenderer.prototype, "current", void 0);
__decorate$7([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerRenderer.prototype, "deprecatedPropertySlimmer", void 0);
__decorate$7([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerRenderer.prototype, "currentStepController", void 0);
__decorate$7([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerRenderer.prototype, "currentDirection", void 0);
__decorate$7([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerRenderer.prototype, "renderModeController", void 0);

var __decorate$6 = (undefined && undefined.__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;
};
/**
 * Controls the current step of the progress tracker component.
 */
class VegaProgressTrackerCurrentStepController extends globalSlimmerRegistry.VegaSlimmer {
  constructor() {
    super(...arguments);
    this.goToPageTaskQueue = new synchronizeTaskQueue.SynchronizeTaskQueue();
    /**
     * Update current step with range limit
     *
     * @param {number} current - current step index
     */
    this.updateCurrent = (current) => {
      const maxIndex = Math.max(0, this.currentSteps.length - 1);
      const minIndex = this.allowNoCurrentStep ? -1 : 0;
      this.current = number.normalizeNumberByRanger(current, minIndex, maxIndex);
    };
  }
  /** connectedCallback */
  connectedCallback() {
    this.initStepClickObserver();
  }
  /** disconnectedCallback */
  disconnectedCallback() {
    this.removeStepClickObserver();
  }
  /** componentDidLoad */
  componentDidLoad() {
    this.updateCurrent(this.current);
  }
  /** componentDidRender */
  async componentDidRender() {
    await this.goToPageTaskQueue.runTask();
  }
  /**
   * watch current change
   */
  async watchCurrentChange() {
    var _a;
    this.updateCurrent(this.current);
    this.currentStepUpdateEventEmitter.emit((_a = this.currentSteps[this.current]) === null || _a === void 0 ? void 0 : _a.stepKey);
    await this.renderer.gotoCarouselPage();
  }
  /** watch steps change */
  watchSteps() {
    this.updateCurrent(this.current);
  }
  /** watch nextStep method call*/
  nextStep() {
    this.updateCurrent(++this.current);
  }
  /** watch prevStep method call*/
  prevStep() {
    // In no-current-step mode, prevStep should keep -1 as the lower bound.
    const minIndex = this.allowNoCurrentStep && this.current <= -1 ? -1 : 0;
    const maxIndex = Math.max(0, this.currentSteps.length - 1);
    this.current = number.normalizeNumberByRanger(--this.current, minIndex, maxIndex);
  }
  /**
   * watch setCurrent method call
   *
   * @param {number} step - step index to set current
   */
  setCurrent(step) {
    this.updateCurrent(step);
  }
  /**
   * While direction changed from others direction to 'horizontal-compact',
   *   we need to goto the current step page in carousel.
   */
  async watchDirection() {
    await this.goToPageTaskQueue.enqueue({
      /* eslint-disable jsdoc/require-jsdoc */
      run: async () => {
        return await this.renderer.gotoCarouselPage();
      },
    }, false);
  }
  /**
   * Initialize step click observer
   */
  initStepClickObserver() {
    this.stepClickObserver = new observer.Observer(this.canAcceptStepClickEvent.bind(this), this.updateCurrent.bind(this));
    changeManager.ChangeManager.register(domNodeSubjectObserverFactory.domNodeSubjectFactory.getSubject(this.host, vegaInternalEventId.VegaInternalProgressTrackerStepClick), this.stepClickObserver);
  }
  /**
   * Remove step click observer
   */
  removeStepClickObserver() {
    changeManager.ChangeManager.unregister(domNodeSubjectObserverFactory.domNodeSubjectFactory.getSubject(this.host, vegaInternalEventId.VegaInternalProgressTrackerStepClick), this.stepClickObserver);
  }
  /**
   * Check if can accept step click event
   *
   * @returns {boolean} - true if can accept, false otherwise.
   */
  canAcceptStepClickEvent() {
    return true;
  }
}
__decorate$6([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerCurrentStepController.prototype, "currentSteps", void 0);
__decorate$6([
  globalSlimmerRegistry.MapToComponentField({ writable: true })
], VegaProgressTrackerCurrentStepController.prototype, "current", void 0);
__decorate$6([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerCurrentStepController.prototype, "allowNoCurrentStep", void 0);
__decorate$6([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerCurrentStepController.prototype, "currentStepUpdateEventEmitter", void 0);
__decorate$6([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerCurrentStepController.prototype, "renderer", void 0);
__decorate$6([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerCurrentStepController.prototype, "host", void 0);
__decorate$6([
  globalSlimmerRegistry.MapToComponentMethod('connectedCallback')
], VegaProgressTrackerCurrentStepController.prototype, "connectedCallback", null);
__decorate$6([
  globalSlimmerRegistry.MapToComponentMethod('disconnectedCallback')
], VegaProgressTrackerCurrentStepController.prototype, "disconnectedCallback", null);
__decorate$6([
  globalSlimmerRegistry.MapToComponentMethod('componentDidLoad')
], VegaProgressTrackerCurrentStepController.prototype, "componentDidLoad", null);
__decorate$6([
  globalSlimmerRegistry.MapToComponentMethod('componentDidRender')
], VegaProgressTrackerCurrentStepController.prototype, "componentDidRender", null);
__decorate$6([
  globalSlimmerRegistry.MapToComponentMethod('watchCurrentChange')
], VegaProgressTrackerCurrentStepController.prototype, "watchCurrentChange", null);
__decorate$6([
  globalSlimmerRegistry.MapToComponentMethod('watchSteps')
], VegaProgressTrackerCurrentStepController.prototype, "watchSteps", null);
__decorate$6([
  globalSlimmerRegistry.MapToComponentMethod('nextStep')
], VegaProgressTrackerCurrentStepController.prototype, "nextStep", null);
__decorate$6([
  globalSlimmerRegistry.MapToComponentMethod('prevStep')
], VegaProgressTrackerCurrentStepController.prototype, "prevStep", null);
__decorate$6([
  globalSlimmerRegistry.MapToComponentMethod('setCurrent')
], VegaProgressTrackerCurrentStepController.prototype, "setCurrent", null);
__decorate$6([
  globalSlimmerRegistry.MapToComponentMethod('watchDirection')
], VegaProgressTrackerCurrentStepController.prototype, "watchDirection", null);

var ProgressStepStatus;
(function (ProgressStepStatus) {
  ProgressStepStatus["DEFAULT"] = "default";
  ProgressStepStatus["IN_PROGRESS"] = "inProgress";
  ProgressStepStatus["COMPLETE"] = "complete";
})(ProgressStepStatus || (ProgressStepStatus = {}));
/**
 * Data Transfer Object representing an internal step in the progress tracker.
 */
class InternalProgressTrackerStep {
  /**
   * @param {string} stepKey - The unique key for the step.
   * @param {string} title - The title of the step.
   * @param {ProgressStepStatus} progressStatus - The progress status of the step.
   * @param {boolean} isCurrent - Indicates if this step is the current step.
   * @param {boolean} clickable - Indicates if this step is clickable.
   */
  constructor(stepKey, title, progressStatus, isCurrent, clickable) {
    this.stepKey = stepKey;
    this.title = title;
    this.progressStatus = progressStatus;
    this.isCurrent = isCurrent;
    this.clickable = clickable;
  }
  /**
   * Create InternalProgressTrackerStep array from steps property
   *
   * @param {HTMLElement} host - The host element.
   * @param {string[] | VegaProgressTrackerStepItem[]} steps - An array of step keys.
   * @param {number} current - The current step index.
   * @param {string[]} completedSteps - An array of completed step keys.
   * @returns {InternalProgressTrackerStep[]} An array of InternalProgressTrackerStep instances.
   */
  static fromSteps(host, steps, current, completedSteps) {
    return steps.map((step, index) => {
      const stepKey = typeof step === 'string' ? step : step.title;
      return new InternalProgressTrackerStep(stepKey, stepKey, this.getStepStatus(stepKey, index, current, completedSteps), index === current, this.getIsStepClickable(host, step));
    });
  }
  /**
   * Create InternalProgressTrackerStep array from host slot elements
   *
   * @param {HTMLElement} host - The host element containing the slot elements.
   * @param {number} current - The current step index.
   * @param {string[]} completedSteps - An array of completed step keys.
   * @returns {InternalProgressTrackerStep[]} An array of InternalProgressTrackerStep instances.
   */
  static fromHostSlot(host, current, completedSteps) {
    return Array.from(host.querySelectorAll('vega-progress-tracker-step')).map((step, index) => {
      const stepKey = step.stepKey;
      return new InternalProgressTrackerStep(stepKey, '', this.getStepStatus(stepKey, index, current, completedSteps), index === current, this.getIsStepClickable(host, step));
    });
  }
  /**
   * Gets the clickable mode of the step.
   *
   * @param {HTMLElement} host - The host element.
   * @param {string | VegaProgressTrackerStepItem} step - The step element.
   * @returns { boolean } The clickable mode of the step.
   */
  static getIsStepClickable(host, step) {
    //For the legacy string type steps, the clickable mode is determined by the canClickStep property on the host
    if (typeof step === 'string')
      return host.canClickStep;
    //If host has disabled click step, return false regardless of individual step setting
    if (!host.canClickStep)
      return false;
    //Return default VegaProgressTrackerStepItem clickable value
    return typeof step.clickable === 'boolean' ? step.clickable : host.canClickStep;
  }
  /**
   * Checks if the step is completed.
   *
   * @returns { boolean } A boolean value indicating whether the step is completed.
   */
  isCompleted() {
    return this.progressStatus === ProgressStepStatus.COMPLETE;
  }
}
/**
 * Determines the progress status of a step based on its index, the current step, and completed steps.
 *
 * @param {string} stepKey - The unique key for the step.
 * @param {number} stepIndex - The index of the step.
 * @param {number} current - The current step index.
 * @param {string[]} completedSteps - An array of completed step keys. TODO: In the future, this will be derived from the step's own status rather than relying on an external array.
 * @returns {ProgressStepStatus} The progress status of the step.
 */
InternalProgressTrackerStep.getStepStatus = (stepKey, stepIndex, current, completedSteps) => {
  if (completedSteps.includes(stepKey)) {
    return ProgressStepStatus.COMPLETE;
  }
  else if (stepIndex === current) {
    return ProgressStepStatus.IN_PROGRESS;
  }
  else {
    return ProgressStepStatus.DEFAULT;
  }
};

var __decorate$5 = (undefined && undefined.__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;
};
/**
 * Controls the current steps of the progress tracker component.
 */
class VegaProgressTrackerCurrentStepsController extends globalSlimmerRegistry.VegaSlimmer {
  constructor() {
    super(...arguments);
    this.mutationObserver = new mutationObserverSlimmer.MutationObserverSlimmer({
      // eslint-disable-next-line jsdoc/require-jsdoc
      target: () => this.host,
      options: {
        childList: true,
        subtree: true,
      },
      // eslint-disable-next-line jsdoc/require-jsdoc
      callback: /* istanbul ignore next */ () => {
        this.appendSlotAttribute();
        this.syncUpCurrentSteps();
      },
    });
  }
  /** connectedCallback */
  connectedCallback() {
    this.appendSlotAttribute();
  }
  /** disconnectedCallback */
  disconnectedCallback() {
  }
  /** componentWillLoad */
  componentWillLoad() {
    this.syncUpCurrentSteps();
  }
  /** componentDidLoad */
  componentDidLoad() {
  }
  /** while steps changed, we need sync up current steps */
  watchSteps() {
    this.syncUpCurrentSteps();
  }
  /** while current state changed, we need sync up current steps */
  watchCurrentChange() {
    this.syncUpCurrentSteps();
  }
  /** while completedStepArray changed, we need sync up current steps */
  watchCompletedStepArray() {
    this.syncUpCurrentSteps();
  }
  /** while completedSteps changed, we need sync up current steps */
  watchCompletedSteps() {
    this.syncUpCurrentSteps();
  }
  /**
   * Sync up current steps
   */
  syncUpCurrentSteps() {
    this.currentSteps = this.renderModeController.isSourceRenderMode()
      ? InternalProgressTrackerStep.fromSteps(this.host, this.steps, this.current, this.deprecatedPropertySlimmer.getValue())
      : InternalProgressTrackerStep.fromHostSlot(this.host, this.current, this.deprecatedPropertySlimmer.getValue());
  }
  /**
   * If template mode, append slot attribute to each step element in host.
   */
  appendSlotAttribute() {
    if (!this.renderModeController.isSourceRenderMode()) {
      Array.from(this.host.querySelectorAll('vega-progress-tracker-step')).map((step, index) => {
        step.setAttribute('slot', `step-${index}`);
      });
    }
  }
}
__decorate$5([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerCurrentStepsController.prototype, "host", void 0);
__decorate$5([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerCurrentStepsController.prototype, "steps", void 0);
__decorate$5([
  globalSlimmerRegistry.MapToComponentField({ writable: true })
], VegaProgressTrackerCurrentStepsController.prototype, "currentSteps", void 0);
__decorate$5([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerCurrentStepsController.prototype, "renderModeController", void 0);
__decorate$5([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerCurrentStepsController.prototype, "current", void 0);
__decorate$5([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerCurrentStepsController.prototype, "deprecatedPropertySlimmer", void 0);
__decorate$5([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaProgressTrackerCurrentStepsController.prototype, "mutationObserver", void 0);
__decorate$5([
  globalSlimmerRegistry.MapToComponentMethod('connectedCallback')
], VegaProgressTrackerCurrentStepsController.prototype, "connectedCallback", null);
__decorate$5([
  globalSlimmerRegistry.MapToComponentMethod('disconnectedCallback')
], VegaProgressTrackerCurrentStepsController.prototype, "disconnectedCallback", null);
__decorate$5([
  globalSlimmerRegistry.MapToComponentMethod('componentWillLoad')
], VegaProgressTrackerCurrentStepsController.prototype, "componentWillLoad", null);
__decorate$5([
  globalSlimmerRegistry.MapToComponentMethod('componentDidLoad')
], VegaProgressTrackerCurrentStepsController.prototype, "componentDidLoad", null);
__decorate$5([
  globalSlimmerRegistry.MapToComponentMethod('watchSteps')
], VegaProgressTrackerCurrentStepsController.prototype, "watchSteps", null);
__decorate$5([
  globalSlimmerRegistry.MapToComponentMethod('watchCurrentChange')
], VegaProgressTrackerCurrentStepsController.prototype, "watchCurrentChange", null);
__decorate$5([
  globalSlimmerRegistry.MapToComponentMethod('watchCompletedStepArray')
], VegaProgressTrackerCurrentStepsController.prototype, "watchCompletedStepArray", null);
__decorate$5([
  globalSlimmerRegistry.MapToComponentMethod('watchCompletedSteps')
], VegaProgressTrackerCurrentStepsController.prototype, "watchCompletedSteps", null);

var __decorate$4 = (undefined && undefined.__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;
};
/**
 * Controls the render mode of the progress tracker component.
 */
class VegaProgressTrackerRenderModeController extends globalSlimmerRegistry.VegaSlimmer {
  constructor() {
    super(...arguments);
    this.renderMode = 'SOURCE';
  }
  /** connectedCallback */
  connectedCallback() {
    this.setRenderMode();
  }
  /**
   * Checks if the render mode is set to 'SOURCE'.
   *
   * @returns { boolean }A boolean value indicating whether the render mode is set to 'SOURCE'.
   */
  isSourceRenderMode() {
    return this.renderMode === 'SOURCE';
  }
  /**
   * The function sets the render mode based on the presence of a specific element in the host component.
   */
  setRenderMode() {
    this.renderMode = this.host.querySelector('vega-progress-tracker-step') ? 'SLOT' : 'SOURCE';
  }
}
__decorate$4([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerRenderModeController.prototype, "host", void 0);
__decorate$4([
  globalSlimmerRegistry.MapToComponentMethod('connectedCallback')
], VegaProgressTrackerRenderModeController.prototype, "connectedCallback", null);

var __decorate$3 = (undefined && undefined.__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;
};
/**
 * Controls the current direction of the progress tracker component.
 */
class VegaProgressTrackerCurrentDirectionController extends autoRunWhenReRenderTaskQueueSlimmer_abstract.AutoRunWhenReRenderTaskQueueSlimmer {
  constructor() {
    super(...arguments);
    this.pageResizeObserverSlimmer = new pageResizeObserverSlimmer.PageResizeObserverSlimmer({
      /*
       * The below method is e2e-test covered in
       * @see{module:vega-progress-tracker-resize-e2e}
       */
      // eslint-disable-next-line jsdoc/require-jsdoc
      callback: /* istanbul ignore next */ async () => {
        const currentAtResize = this.current;
        const directionBeforeResize = this.currentDirection;
        this.setCurrentDirection();
        if (directionBeforeResize === this.currentDirection) {
          await this.renderer.gotoCarouselPage(currentAtResize);
          return;
        }
        // Sync carousel page after component re-render when direction changes.
        this.enqueueSyncCarouselPage(currentAtResize);
      },
    });
  }
  /** connectedCallback */
  connectedCallback() {
  }
  /** disconnectedCallback */
  disconnectedCallback() {
  }
  /** componentWillLoad */
  componentWillLoad() {
    this.setCurrentDirection();
  }
  /** componentDidLoad */
  componentDidLoad() {
  }
  /** watchDirection */
  watchDirection() {
    this.setCurrentDirection();
  }
  /**
   * No-op: carousel sync is handled via closure-captured value in enqueueSyncCarouselPage().
   */
  async doTask() {
  }
  /**
   * Enqueue a carousel page sync with the value captured in a closure,
   * avoiding shared mutable state between enqueue and execution.
   *
   * @param {number} page - The carousel page index to sync to
   */
  enqueueSyncCarouselPage(page) {
    void this.autoRunTaskQueue.enqueue({
      /** Sync carousel to the captured page after re-render */
      run: async () => {
        await this.renderer.gotoCarouselPage(page);
      },
    }, false);
  }
  /**
   * The function sets the current direction of a progress tracker
   * based on the component's direction and the current breakpoint.
   */
  setCurrentDirection() {
    let direction = responsiveFormatFacade.ResponsiveFormatFacade.formatCustom(this.direction) || 'vertical';
    if (['default', 'S'].includes(breakpoints.getCurrentBreakpoint()) && !typeGuard.isResponsiveType(this.direction)) {
      direction = 'horizontal-compact';
    }
    this.currentDirection = direction;
  }
}
__decorate$3([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerCurrentDirectionController.prototype, "direction", void 0);
__decorate$3([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerCurrentDirectionController.prototype, "current", void 0);
__decorate$3([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerCurrentDirectionController.prototype, "renderer", void 0);
__decorate$3([
  globalSlimmerRegistry.MapToComponentField({ writable: true })
], VegaProgressTrackerCurrentDirectionController.prototype, "currentDirection", void 0);
__decorate$3([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaProgressTrackerCurrentDirectionController.prototype, "pageResizeObserverSlimmer", void 0);
__decorate$3([
  globalSlimmerRegistry.MapToComponentMethod('connectedCallback')
], VegaProgressTrackerCurrentDirectionController.prototype, "connectedCallback", null);
__decorate$3([
  globalSlimmerRegistry.MapToComponentMethod('disconnectedCallback')
], VegaProgressTrackerCurrentDirectionController.prototype, "disconnectedCallback", null);
__decorate$3([
  globalSlimmerRegistry.MapToComponentMethod('componentWillLoad')
], VegaProgressTrackerCurrentDirectionController.prototype, "componentWillLoad", null);
__decorate$3([
  globalSlimmerRegistry.MapToComponentMethod('componentDidLoad')
], VegaProgressTrackerCurrentDirectionController.prototype, "componentDidLoad", null);
__decorate$3([
  globalSlimmerRegistry.MapToComponentMethod('watchDirection')
], VegaProgressTrackerCurrentDirectionController.prototype, "watchDirection", null);

const vegaProgressTrackerCss = ":host .vega-progress-tracker__container{display:flex;align-items:center;padding-top:0px;padding-bottom:0px}:host .vega-progress-tracker__slot{width:100%;display:block}:host .vega-progress-step{display:flex;gap:16px}:host(:not(.click-step-disabled)) .vega-progress-step{cursor:pointer}:host(:not(.click-step-disabled)) .vega-progress-step.default:hover .vega-progress-step__icon{background-color:rgba(var(--v-bg-action-quaternary-hover, 239, 239, 239, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.default .vega-progress-step__icon:hover{background-color:rgba(var(--v-bg-action-quaternary-hover, 239, 239, 239, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.default:active .vega-progress-step__icon{background-color:rgba(var(--v-bg-action-quaternary-active, 205, 209, 211, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.inProgress .vega-progress-step__icon:hover,:host(:not(.click-step-disabled)) .vega-progress-step.current .vega-progress-step__icon:hover{background-color:rgba(var(--v-bg-action-hover, 4, 112, 236, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.inProgress:hover .vega-progress-step__icon,:host(:not(.click-step-disabled)) .vega-progress-step.current:hover .vega-progress-step__icon{background-color:rgba(var(--v-bg-action-hover, 4, 112, 236, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.inProgress:active .vega-progress-step__icon,:host(:not(.click-step-disabled)) .vega-progress-step.current:active .vega-progress-step__icon{background-color:rgba(var(--v-bg-action-active, 29, 65, 195, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.complete:hover .vega-progress-step__icon{border-color:rgba(var(--v-border-color-action-hover, 4, 112, 236, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.complete:hover .vega-progress-step__icon vega-icon{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.complete:active .vega-progress-step__icon{border-color:rgba(var(--v-border-color-action-active, 29, 65, 195, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.complete:active .vega-progress-step__icon vega-icon{color:rgba(var(--v-text-link-active, 29, 65, 195, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.complete.current:hover .vega-progress-step__icon vega-icon{color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.disabled{cursor:initial}:host(:not(.click-step-disabled)) .vega-progress-step.disabled.default:hover .vega-progress-step__icon{background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.disabled.default:active .vega-progress-step__icon{background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1))}:host(:not(.click-step-disabled)) .vega-progress-step.disabled.inProgress:hover .vega-progress-step__icon,:host(:not(.click-step-disabled)) .vega-progress-step.disabled.current:hover .vega-progress-step__icon{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}:host .vega-progress-step:focus-visible{outline-width:0px}:host .vega-progress-step:focus-visible .vega-progress-step-icon-container{border-radius:8px;outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .vega-progress-step .vega-progress-step-icon-divider{display:flex;flex-direction:column;align-items:center;gap:0px}:host .vega-progress-step .vega-progress-step-icon-container{padding:8px}:host .vega-progress-step .vega-progress-step__icon{display:block;font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:9999px;box-sizing:content-box;height:32px;width:32px;min-width:32px;line-height:32px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-progress-step .vega-progress-step__icon{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-progress-step .vega-progress-step__icon{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-progress-step .vega-progress-step__icon{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-progress-step .vega-progress-step__icon span{display:block}:host .vega-progress-step .vega-progress-step__icon:not(.disable-responsive){line-height:32px}:host .vega-progress-step .vega-progress-step__divider{width:1px;flex-grow:1;height:100%;background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1));display:block}:host .vega-progress-step .vega-progress-step__divider.right.complete{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}:host .vega-progress-step .vega-progress-step__divider.left{display:none}:host .vega-progress-step:last-child .vega-progress-step__divider.right{display:none}:host .vega-progress-step.default .vega-progress-step__icon{color:rgba(var(--v-text-primary, 32, 54, 69, 1));background-color:rgba(var(--v-bg-action-quaternary, 222, 225, 227, 1))}:host .vega-progress-step.complete .vega-progress-step__icon{display:flex;justify-content:center;align-items:center;background-color:rgba(var(--v-bg-action-tertiary, 0, 0, 0, 0));box-sizing:border-box;border-width:1px;border-style:solid;border-color:rgba(var(--v-border-color-action, 19, 98, 226, 1))}:host .vega-progress-step.complete .vega-progress-step__icon vega-icon{color:rgba(var(--v-text-link, 19, 98, 226, 1))}:host .vega-progress-step.complete.current .vega-progress-step__icon vega-icon{color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1))}:host .vega-progress-step.inProgress .vega-progress-step__icon,:host .vega-progress-step.current .vega-progress-step__icon{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1));color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));box-shadow:0 0 0 4px rgba(var(--v-ring-input-focus, 19, 98, 226, 0.25))}:host(.horizontal-compact){flex:1 1 100%;padding-top:0px}:host(.horizontal-compact) .vega-progress-tracker__container{padding-top:16px;padding-bottom:16px}:host(.horizontal-compact) .vega-progress-tracker__slot{display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:0px}:host(.horizontal-compact) .vega-progress-step{display:flex;flex-grow:1;flex-basis:0}:host(.horizontal-compact) .vega-progress-step .vega-progress-step-icon-divider{display:flex;flex-direction:row;gap:4px;width:100%}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__icon{height:16px;width:16px;min-width:16px}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__icon{line-height:16px}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__icon vega-icon{height:8px;width:8px}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__icon span{display:none}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__divider{height:1px;flex-grow:1}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__divider.left{display:block}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__divider.left.background{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__divider.right{display:block}:host(.horizontal-compact) .vega-progress-step .vega-progress-step__title{display:none}:host(.horizontal-compact) .vega-progress-step:first-child .vega-progress-step__divider.left{opacity:0}:host(.horizontal-compact) .vega-progress-step:last-child .vega-progress-step__divider.right{display:block;opacity:0}:host(:not(.horizontal-compact)) .vega-progress-tracker__box{display:none}:host(.vertical) .vega-progress-step__title{padding-top:12px;padding-bottom:36px}:host(.horizontal){display:block;overflow-x:auto;padding-top:4px}:host(.horizontal) .vega-progress-tracker__slot{display:flex}:host(.horizontal) .vega-progress-step{flex-direction:column;align-items:center;gap:4px;flex-grow:1;flex-basis:0}:host(.horizontal) .vega-progress-step .vega-progress-step-icon-divider{flex-direction:row;align-items:center;gap:4px;width:100%}:host(.horizontal) .vega-progress-step .vega-progress-step__divider{height:1px;display:block}:host(.horizontal) .vega-progress-step .vega-progress-step__divider.left{display:block}:host(.horizontal) .vega-progress-step .vega-progress-step__divider.right.complete{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}:host(.horizontal) .vega-progress-step .vega-progress-step__divider.left.background{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}:host(.horizontal) .vega-progress-step .vega-progress-step__title{padding-top:0px;padding-bottom:0px;text-align:center;padding-left:4px;padding-right:4px}:host(.horizontal) .vega-progress-step:first-child .vega-progress-step__divider.left{opacity:0}:host(.horizontal) .vega-progress-step:last-child .vega-progress-step__divider.right{display:block;opacity:0}:host vega-carousel .subTitle{font-family:\"Inter\", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host vega-carousel .subTitle{font-family:\"Inter\", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host vega-carousel .subTitle{font-family:\"Inter\", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host vega-carousel .subTitle{font-family:\"Inter\", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}:host .vega-progress-tracker__box{display:flex;align-items:center}:host .vega-progress-tracker__box vega-carousel{width:100%;text-align:center}";

var __decorate$2 = (undefined && undefined.__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;
};
const VegaProgressTracker = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.vegaCurrentStepUpdate = index.createEvent(this, "vegaCurrentStepUpdate", 7);
    this.currentStepUpdate = index.createEvent(this, "currentStepUpdate", 7);
    this.globalSlimmers = {};
    this.renderModeController = new VegaProgressTrackerRenderModeController();
    this.currentStepsController = new VegaProgressTrackerCurrentStepsController();
    this.currentStepController = new VegaProgressTrackerCurrentStepController();
    this.currentDirectionController = new VegaProgressTrackerCurrentDirectionController();
    this.renderer = new VegaProgressTrackerRenderer();
    this.currentStepUpdateEventEmitter = eventEmitSlimmer.createEventEmitSlimmer(VegaProgressTracker, vegaEventId.VegaCurrentStepUpdate);
    this.currentStepsSubStateSlimmer = subStateNotifySlimmer.createSubStateNotifySlimmer(VegaProgressTracker, 'currentSteps', 'watchCurrentSteps');
    this.deprecatedPropertySlimmer = deprecatedPropertySlimmer.createDeprecatedPropertySlimmer(VegaProgressTracker, 'completedSteps', 'completedStepArray', []);
    this.vegaComponentUsageRuntimeMetricsSlimmer = new componentUsageRuntimeMetrics.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() {
  }
  /**
   * The below method is e2e-test covered in
   * @see{module:vega-progress-tracker-e2e-change-current-mobile}
   */
  /* istanbul ignore next */
  async watchCurrentChange() {
  }
  async watchDirection() {
  }
  watchSteps() {
  }
  watchCompletedStepArray() {
  }
  watchCompletedSteps() {
  }
  /**
   * Invoke this method to change the tracker's current step
   *    to the next step, if available.
   *
   * @vegaVersion 1.5.0
   */
  async nextStep() {
  }
  /**
   * Invoke this method to change the tracker's current step
   *    to the previous step, if available.
   *
   * @vegaVersion 1.5.0
   */
  async prevStep() {
  }
  /**
   * Invoke this method to set the current step of the tracker.
   *
   * @vegaVersion 1.0.7
   */
  async setCurrent(step) {
  }
  /**
   * Invoke this method to retrieve the tracker's current step.
   *
   * @vegaVersion 1.3.0
   */
  async getCurrent() {
    return this.current;
  }
  render() {
    return component.sanitizeVegaComponent(index.h(index.Host, { class: {
        'vega-progress-tracker': true,
        [this.currentDirection]: true,
        'click-step-disabled': !this.canClickStep,
      } }, this.renderer.render()), this.host);
  }
  get host() { return index.getElement(this); }
  static get watchers() { return {
    "currentSteps": ["watchCurrentSteps"],
    "current": ["watchCurrentChange"],
    "direction": ["watchDirection"],
    "steps": ["watchSteps"],
    "completedStepArray": ["watchCompletedStepArray"],
    "completedSteps": ["watchCompletedSteps"]
  }; }
};
__decorate$2([
  componentUsageRuntimeMetrics.InjectVegaGlobalSlimmer()
], VegaProgressTracker.prototype, "globalSlimmers", void 0);
__decorate$2([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaProgressTracker.prototype, "renderModeController", void 0);
__decorate$2([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaProgressTracker.prototype, "currentStepsController", void 0);
__decorate$2([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaProgressTracker.prototype, "currentStepController", void 0);
__decorate$2([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaProgressTracker.prototype, "currentDirectionController", void 0);
__decorate$2([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaProgressTracker.prototype, "renderer", void 0);
__decorate$2([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaProgressTracker.prototype, "currentStepUpdateEventEmitter", void 0);
__decorate$2([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaProgressTracker.prototype, "currentStepsSubStateSlimmer", void 0);
__decorate$2([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaProgressTracker.prototype, "deprecatedPropertySlimmer", void 0);
__decorate$2([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaProgressTracker.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
VegaProgressTracker.style = vegaProgressTrackerCss;

var __decorate$1 = (undefined && undefined.__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;
};
/**
 * Controls the state of a progress tracker step component.
 */
class VegaProgressTrackerStepStateController extends subStateObserverSlimmer.SubStateObserverSlimmer {
  // eslint-disable-next-line jsdoc/require-jsdoc
  constructor() {
    super({
      parent: 'vega-progress-tracker',
      subStates: [
        {
          subStateName: 'status',
          parentStateName: 'currentSteps',
          // eslint-disable-next-line jsdoc/require-jsdoc
          callback: (steps) => {
            const step = steps.find((step) => step.stepKey === this.stepKey);
            this.progressStatus = step.progressStatus;
            this.isCurrent = step.isCurrent;
          },
        },
      ],
    });
  }
}
__decorate$1([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerStepStateController.prototype, "host", void 0);
__decorate$1([
  globalSlimmerRegistry.MapToComponentField({ writable: true })
], VegaProgressTrackerStepStateController.prototype, "progressStatus", void 0);
__decorate$1([
  globalSlimmerRegistry.MapToComponentField({ writable: true })
], VegaProgressTrackerStepStateController.prototype, "isCurrent", void 0);
__decorate$1([
  globalSlimmerRegistry.MapToComponentField()
], VegaProgressTrackerStepStateController.prototype, "stepKey", void 0);

const vegaProgressTrackerStepCss = ":host .title-container{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));display:block}@media screen and (min-width: 768px) and (max-width: 1023px){:host .title-container{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .title-container{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .title-container{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .title-container.inProgress,:host .title-container.current{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .title-container.inProgress,:host .title-container.current{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .title-container.inProgress,:host .title-container.current{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .title-container.inProgress,:host .title-container.current{font-family:\"Inter\", sans-serif;font-size:16px;font-weight:700;line-height:22px;letter-spacing:0px}}:host .title-container.complete{color:rgba(var(--v-text-primary, 32, 54, 69, 1))}";

var __decorate = (undefined && undefined.__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;
};
const VegaProgressTrackerStep = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.globalSlimmers = {};
    this.stateController = new VegaProgressTrackerStepStateController();
    this.vegaComponentUsageRuntimeMetricsSlimmer = new componentUsageRuntimeMetrics.VegaComponentUsageRuntimeMetricsSlimmer();
    this.progressStatus = ProgressStepStatus.DEFAULT;
    this.isCurrent = false;
    /**
     * The unique key for the step.
     *
     * @vegaVersion 2.73.0
     */
    this.stepKey = '';
    /**
     * If step is clickable.
     *
     * @vegaVersion 2.76.0
     */
    this.clickable = true;
  }
  render() {
    return component.sanitizeVegaComponent(index.h(index.Host, null, index.h("div", { class: {
        'title-container': true,
        [this.progressStatus]: true,
        'current': this.isCurrent,
      } }, index.h("slot", null))), this.host);
  }
  get host() { return index.getElement(this); }
};
__decorate([
  componentUsageRuntimeMetrics.InjectVegaGlobalSlimmer()
], VegaProgressTrackerStep.prototype, "globalSlimmers", void 0);
__decorate([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaProgressTrackerStep.prototype, "stateController", void 0);
__decorate([
  globalSlimmerRegistry.InjectVegaSlimmer()
], VegaProgressTrackerStep.prototype, "vegaComponentUsageRuntimeMetricsSlimmer", void 0);
VegaProgressTrackerStep.style = vegaProgressTrackerStepCss;

exports.vega_progress_tracker = VegaProgressTracker;
exports.vega_progress_tracker_step = VegaProgressTrackerStep;
