import { r as registerInstance, h } from './index-e9c7ceaa.js';
import { ApplicationContext } from '@sankhyalabs/core';

const SnkActionsForm = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.APLICAR = 'OK';
    this.CANCELAR = 'CANCEL';
    this.FECHAR = 'CLOSE';
    this.titleMessage = undefined;
    this.message = undefined;
    this.accept = undefined;
    this.cancel = undefined;
  }
  /**
   * Responsável por abrir a popup.
   */
  async openPopup() {
    this._ezPopup.opened = true;
  }
  ;
  exitPopup() {
    this._ezPopup.opened = false;
  }
  handleModalAction(evt) {
    switch (evt) {
      case this.APLICAR:
        this.exitPopup();
        this.accept();
        break;
      case this.CANCELAR:
        this.exitPopup();
        this.cancel();
        break;
      case this.FECHAR:
        this.exitPopup();
        break;
    }
  }
  componentWillLoad() {
    this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
  }
  render() {
    return (h("ez-popup", { size: "small", heightMode: "auto", useHeader: false, ref: (ref) => this._ezPopup = ref }, h("ez-modal-container", { modalTitle: this.titleMessage, okButtonLabel: this._application.messagesBuilder.getMessage("snkActionsButton.buttons.yes", undefined), cancelButtonLabel: this._application.messagesBuilder.getMessage("snkActionsButton.buttons.no", undefined), onEzModalAction: (evt) => this.handleModalAction(evt.detail) }, h("div", { class: "ez-margin-bottom--large ez-flex ez-flex--column" }, h("label", { class: "ez-text ez-text--large ez-text--primary", innerHTML: this.message }), h("label", { class: "ez-text ez-text--large ez-text--primary" }, h("br", null), this._application.messagesBuilder.getMessage("snkActionsButton.clientEvent.cancelMessage", undefined))))));
  }
};

export { SnkActionsForm as snk_client_confirm };
