'use strict';

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

const index = require('./index-ee190ee0.js');
const store = require('./store-27073b3b.js');
require('./index-4901314f.js');
require('./getHandlebarsHelpers-8ef28401.js');
require('./_commonjsHelpers-a5111d61.js');
require('./index-ba857994.js');
require('./localforage-af1b8c0e.js');

const modalFlowRiderCss = "";

const ModalFlowRider = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.floodteamCloseModal = index.createEvent(this, "floodteamCloseModal", 7);
    this.formData = undefined;
    this.successIcon = "checkmark-circle";
    this.headerTitle = "flow";
    this.flowId = undefined;
    this.renderId = undefined;
    this.fetch = undefined;
    this.stepInput = {};
    this.endpoint = undefined;
    this.isLoading = true;
    this.locationId = undefined;
    this.materialId = undefined;
    this.successMessage = undefined;
    this.beforeSubmit = undefined;
    this.successTemplate = undefined;
    this.errorTemplate = undefined;
    this.showProgress = true;
    this.currentPath = undefined;
    this.currentStep = undefined;
    this.showCard = false;
  }
  toggleCard() {
    this.showCard = !this.showCard;
  }
  render() {
    var _a;
    const materialId = ((_a = this.formData) === null || _a === void 0 ? void 0 : _a.materialId) || null;
    return [
      index.h("ion-header", null, index.h("ion-toolbar", null, index.h("ion-title", null, this.headerTitle), index.h("ion-buttons", { slot: "end" }, index.h("ion-button", { title: "toggle the background", onClick: () => this.toggleCard() }, index.h("ion-icon", { slot: "icon-only", name: "browsers" })), index.h("ion-button", { onClick: () => this.floodteamCloseModal.emit() }, index.h("ion-icon", { slot: "icon-only", name: "close-circle-outline" }))))),
      index.h("ion-content", null, this.showCard ? (index.h("ion-card", null, index.h("floodteam-flow-rider", { formData: this.formData, renderId: this.renderId, fetch: this.fetch, stepInput: {
          dotConfirm: {
            materialId,
            material: store.state.materials ||
              [].find((material) => material.id === materialId),
          },
        }, endpoint: this.endpoint, isLoading: this.isLoading, successMessage: this.successMessage, beforeSubmit: this.beforeSubmit, successTemplate: this.successTemplate, errorTemplate: this.errorTemplate, showProgress: this.showProgress, currentPath: this.currentPath, currentStep: this.currentStep, flowId: this.flowId, templates: store.state === null || store.state === void 0 ? void 0 : store.state.templates, successIcon: this.successIcon, materialId: this.materialId }))) : (index.h("floodteam-flow-rider", { formData: this.formData, renderId: this.renderId, fetch: this.fetch, stepInput: {
          dotConfirm: {
            materialId,
            material: store.state.materials ||
              [].find((material) => material.id === materialId),
          },
        }, endpoint: this.endpoint, isLoading: this.isLoading, successMessage: this.successMessage, beforeSubmit: this.beforeSubmit, successTemplate: this.successTemplate, errorTemplate: this.errorTemplate, showProgress: this.showProgress, currentPath: this.currentPath, currentStep: this.currentStep, flowId: this.flowId, templates: store.state === null || store.state === void 0 ? void 0 : store.state.templates, successIcon: this.successIcon, materialId: this.materialId }))),
    ];
  }
};
ModalFlowRider.style = modalFlowRiderCss;

exports.modal_flow_rider = ModalFlowRider;
