import { r as t, c as i, h as e, H as r, a as n } from "./p-9b9ccd0c.js";

import { c as a } from "./p-c5196b3b.js";

import { L as s } from "./p-311eedf3.js";

const o = ":host{display:grid;block-size:100%}.opacity-0{opacity:0}.gxi-hidden{display:none !important}.align-center{display:flex;align-items:center}.align-end{display:flex;align-items:end}.overflow-auto{overflow:auto}:host(.gx-ide-component){height:100% !important;display:flex !important;flex-direction:column !important}.gx-ide-main-wrapper{color:var(--gx-ide-component-text-color);font-weight:var(--font-style-regular);font-size:var(--font-size-body-m);font-family:var(--font-family-body);height:100%;display:flex;flex-direction:column;flex-grow:1;box-sizing:border-box}.buttons-container{display:flex;gap:var(--spacing-gap-m)}.giu-static-pill-icon-and-text,.giu-static-pill{background-color:var(--elevation-background-color, var(--color-accent-surface-elevation-1));padding-inline:var(--spacing-padding-m);color:var(--color-text-neutral-default);font-size:var(--font-size-body-s);line-height:var(--line-height-relaxed);font-weight:var(--font-style-regular);border-radius:4px;min-block-size:25px;display:inline-grid;align-items:center;pointer-events:none;inline-size:max-content}.giu-static-pill-icon-and-text{display:inline-grid;grid-auto-flow:column;grid-auto-columns:max-content;gap:var(--spacing-gap-m)}.tab-full-width-buttons::part(tab-list block-start),.tab-full-width-buttons::part(tab-list block-end){grid-auto-columns:1fr}.tab-full-width-buttons::part(tab block-start){justify-content:center}.tree-view::part(item__header){--icon__system_warning_warning--disabled:var(\n    --icon__system_warning_warning--enabled\n  )}.tabular-grid{--focus-outline-width:1px}.control-wrapper{display:flex;gap:var(--spacing-gap-m);align-items:center}.control-wrapper--vertical{flex-direction:column;align-items:start}.controls-wrapper{display:flex;gap:var(--spacing-gap-m)}.controls-wrapper--vertical{flex-direction:column;align-items:start}.input-text{box-sizing:border-box;background-color:transparent;border:1px solid var(--color-border-neutral-default);border-radius:4px;height:26px;color:var(--color-text-neutral-default);font-size:var(--font-size-body-xs)}.input-text--full-width{align-self:stretch}:host{display:block}";

const l = class {
  constructor(e) {
    t(this, e);
    this.componentDidRenderFirstTime = i(this, "componentDidRenderFirstTime", 7);
    this.renderedFirstTime = false;
    // 7.LISTENERS //
    // 8.PUBLIC METHODS API //
    // 9.LOCAL METHODS //
        this.confirmCallbackHandler = async () => {
      if (this.confirmCallback) {
        const t = {
          years: parseInt(this.yearsEl.value),
          months: parseInt(this.monthsEl.value),
          days: parseInt(this.daysEl.value),
          hours: parseInt(this.hoursEl.value),
          minutes: parseInt(this.minutesEl.value),
          seconds: parseInt(this.secondsEl.value)
        };
        await this.confirmCallback(t);
      }
    };
    this.displayTitle = false;
    this.duration = undefined;
    this.confirmCallback = undefined;
    this.cancelCallback = undefined;
  }
  // 6.COMPONENT LIFECYCLE METHODS //
  async componentWillLoad() {
    this._componentLocale = await s.getComponentStrings(this.el);
  }
  componentDidRender() {
    if (!this.renderedFirstTime) {
      this.componentDidRenderFirstTime.emit(this._componentLocale.componentName);
      this.renderedFirstTime = true;
    }
  }
  // 10.RENDER() FUNCTION //
  render() {
    var t, i, n, s, o, l;
    return e(r, {
      class: "gx-ide-component"
    }, e("div", {
      class: "gx-ide-main-wrapper"
    }, e("gx-ide-container", {
      slimmerFooter: a.gxIdeContainer.slimmerFooter
    }, e("div", {
      class: "control-wrapper control-wrapper--vertical"
    }, e("label", {
      htmlFor: "years"
    }, this._componentLocale.controls.years), e("input", {
      type: "number",
      id: "years",
      class: "input-text input-text--full-width",
      value: (t = this.duration) === null || t === void 0 ? void 0 : t.years.toString(),
      ref: t => this.yearsEl = t
    })), e("div", {
      class: "control-wrapper control-wrapper--vertical"
    }, e("label", {
      htmlFor: "months"
    }, this._componentLocale.controls.months), e("input", {
      type: "number",
      id: "months",
      class: "input-text input-text--full-width",
      value: (i = this.duration) === null || i === void 0 ? void 0 : i.months.toString(),
      ref: t => this.monthsEl = t
    })), e("div", {
      class: "control-wrapper control-wrapper--vertical"
    }, e("label", {
      htmlFor: "days"
    }, this._componentLocale.controls.days), e("input", {
      type: "number",
      id: "days",
      class: "input-text input-text--full-width",
      value: (n = this.duration) === null || n === void 0 ? void 0 : n.days.toString(),
      ref: t => this.daysEl = t
    })), e("div", {
      class: "control-wrapper control-wrapper--vertical"
    }, e("label", {
      htmlFor: "hours"
    }, this._componentLocale.controls.hours), e("input", {
      type: "number",
      id: "hours",
      class: "input-text input-text--full-width",
      value: (s = this.duration) === null || s === void 0 ? void 0 : s.hours.toString(),
      ref: t => this.hoursEl = t
    })), e("div", {
      class: "control-wrapper control-wrapper--vertical"
    }, e("label", {
      htmlFor: "minutes"
    }, this._componentLocale.controls.minutes), e("input", {
      type: "number",
      id: "minutes",
      class: "input-text input-text--full-width",
      value: (o = this.duration) === null || o === void 0 ? void 0 : o.minutes.toString(),
      ref: t => this.minutesEl = t
    })), e("div", {
      class: "control-wrapper control-wrapper--vertical"
    }, e("label", {
      htmlFor: "seconds"
    }, this._componentLocale.controls.seconds), e("input", {
      type: "number",
      id: "seconds",
      class: "input-text input-text--full-width",
      value: (l = this.duration) === null || l === void 0 ? void 0 : l.seconds.toString(),
      ref: t => this.secondsEl = t
    })), e("div", {
      class: "controls-wrapper"
    }, e("button", {
      onClick: this.confirmCallbackHandler
    }, this._componentLocale.controls.ok), e("button", {
      onClick: this.cancelCallback
    }, this._componentLocale.controls.cancel)))));
  }
  static get assetsDirs() {
    return [ "gx-ide-assets/bpm-timer-duration" ];
  }
  get el() {
    return n(this);
  }
};

l.style = o;

export { l as gx_ide_bpm_timer_duration };
//# sourceMappingURL=p-4431f46f.entry.js.map