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 { Fragment, h } from '@stencil/core';
import { MapToComponentField, VegaSlimmer } from 'vega-slimmer/core';
export class VegaInputPhoneNumberRenderer extends VegaSlimmer {
  getInputPhoneNumberContainerRef() {
    return this.inputPhoneNumberContainerRef;
  }
  render() {
    return (h(Fragment, null,
      this.renderLabel(),
      h("vega-flex", { class: "vega-input-phone-number-container", gap: "size-12", ref: (dom) => (this.inputPhoneNumberContainerRef = dom) },
        this.countrySelectRenderer.render(),
        this.phoneNumberInputRenderer.render()),
      this.renderHint()));
  }
  /**
   * The `renderLabel` function returns a JSX element for a Vega field label with specific props.
   *
   * @returns {HTMLVegaFieldLabelElement} An HTMLVegaFieldLabelElement is being returned.
   */
  renderLabel() {
    return (h("vega-field-label", { onClick: this.countrySelectRenderer.openSelectDropdown, isFieldRequired: this.required, disabled: this.disabled, label: this.label }));
  }
  /**
   * The function `renderHint` returns a label element with a hint text if the `hint` property is provided.
   *
   * @returns {Nullable<HTMLElement>} A `label` element with the class `vega-input-phone-number-hint` containing a `vega-font` element
   * with the variant `font-footnote1-short` and color `text-secondary`, displaying the hint text stored
   * in the `this.hint` property.
   */
  renderHint() {
    if (this.hint) {
      return (h("label", { class: "vega-input-phone-number-hint" },
        h("vega-font", { variant: "font-footnote1-short", color: "text-secondary" }, this.hint)));
    }
  }
}
__decorate([
  MapToComponentField()
], VegaInputPhoneNumberRenderer.prototype, "required", void 0);
__decorate([
  MapToComponentField()
], VegaInputPhoneNumberRenderer.prototype, "label", void 0);
__decorate([
  MapToComponentField()
], VegaInputPhoneNumberRenderer.prototype, "disabled", void 0);
__decorate([
  MapToComponentField()
], VegaInputPhoneNumberRenderer.prototype, "hint", void 0);
__decorate([
  MapToComponentField()
], VegaInputPhoneNumberRenderer.prototype, "countrySelectRenderer", void 0);
__decorate([
  MapToComponentField()
], VegaInputPhoneNumberRenderer.prototype, "phoneNumberInputRenderer", void 0);
