import {
  __decorateClass
} from "../../../chunks/chunk.QU3DSPNU.js";
import { property } from "lit/decorators.js";
import { when } from "lit/directives/when.js";
import { gdsCustomElement, html } from "../../../scoping.js";
import { GdsBlur } from "../../blur/blur.component.js";
import { numberFormats } from "../../formatted-text/index.js";
import { GdsFormattedNumber } from "../../formatted-text/number/formatted-number.component.js";
let GdsSensitiveNumber = class extends GdsFormattedNumber {
  constructor() {
    super(...arguments);
    this.hide = false;
  }
  get formattedValue() {
    if (this.hide) {
      return numberFormats[this.format](
        0,
        this.locale,
        this.currency,
        this.decimals
      );
    }
    return super.formattedValue;
  }
  render() {
    return when(
      this.hide,
      () => html`<gds-blur>${super.render()}</gds-blur>`,
      () => super.render()
    );
  }
  updated(changedProperties) {
    super.updated(changedProperties);
    if (this.element) {
      this.element.ariaLabel = super.formattedValue;
    }
  }
};
__decorateClass([
  property({ type: Boolean })
], GdsSensitiveNumber.prototype, "hide", 2);
GdsSensitiveNumber = __decorateClass([
  gdsCustomElement("gds-sensitive-number", { dependsOn: [GdsBlur] })
], GdsSensitiveNumber);
export {
  GdsSensitiveNumber
};
