import { r as registerInstance, d as createEvent, h } from './index-33e43734.js';

const modalCropperCss = "floodteam-modal-cropper ion-title{text-transform:capitalize !important}floodteam-modal-cropper floodteam-photo-cropper>div{max-height:300px}";

let ModalCropper = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.floodteamCropSave = createEvent(this, "floodteamCropSave", 7);
    this.floodteamCropDismiss = createEvent(this, "floodteamCropDismiss", 7);
  }
  async closeModal() {
    const modal = document.querySelector("ion-modal");
    if (modal) {
      modal.dismiss();
    }
    this.floodteamCropDismiss.emit({});
  }
  async save() {
    const modal = document.querySelector("ion-modal");
    if (modal) {
      modal.dismiss();
    }
    this.floodteamCropSave.emit({
      encodedContent: await this.photoCropperEl.getImageData(),
    });
  }
  render() {
    return [
      h("ion-header", null, h("ion-toolbar", { color: "dark" }, h("ion-buttons", { slot: "start" }, h("ion-button", { fill: "clear", color: "light" }, h("ion-icon", { slot: "icon-only", name: "create" }))), h("ion-title", null, "Crop Image"), h("ion-buttons", { slot: "end" }, h("ion-button", { onClick: () => this.closeModal(), fill: "clear", color: "primary" }, "Cancel")))),
      h("ion-content", null, h("floodteam-photo-cropper", { ref: (el) => (this.photoCropperEl = el), src: this.src }), h("ion-button", { class: "ion-float-right ion-margin-end", color: "success", onClick: () => this.save() }, "Save")),
    ];
  }
};
ModalCropper.style = modalCropperCss;

export { ModalCropper as floodteam_modal_cropper };

//# sourceMappingURL=floodteam-modal-cropper.entry.js.map