import { r as registerInstance, h, H as Host } from './index-e0adbd54.js';
import { s as state } from './store-75674961.js';
import { g as getIonMode } from './ionic-global-3272af31.js';
import { c as createColorClasses } from './theme-7ef00c83.js';
import './index-96e8c812.js';
import './getHandlebarsHelpers-c1e27d99.js';
import './_commonjsHelpers-44457d8d.js';
import './index-e6b3332e.js';
import './localforage-394b59fa.js';

const selectTemplateCss = "";

const SelectTemplate = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.name = "template";
    this.value = undefined;
    this.jobId = undefined;
    this.disabled = false;
    this.templates = undefined;
    this.placeholder = "Select a Template";
    this.label = "Template";
    this.labelPosition = "stacked";
    this.interface = "popover";
    this.interfaceOptions = undefined;
    this.disablePosition = true;
    this.disableFrame = false;
    this.allowFullscreen = false;
    this.resize = false;
    this.zoom = 1;
    this.preview = false;
  }
  render() {
    const templateOptions = (this.templates || state.templates || []).map(({ subject: label, id: value }) => ({ label, value }));
    return (h(Host, null, templateOptions.length ? (h("fireenjin-select", { ref: (el) => (this.templateSelectEl = el), onIonChange: (event) => (this.value = event.target.value), interface: this.interface, interfaceOptions: this.interfaceOptions, name: this.name, label: this.label, labelPosition: this.labelPosition, placeholder: this.placeholder, value: this.value, options: templateOptions }, h("ion-button", { slot: "start", fill: "clear", onClick: () => (this.preview = !this.preview) }, h("ion-icon", { slot: "icon-only", name: this.preview ? "eye-off" : "eye" })), h("ion-button", { slot: "end", fill: "clear", onClick: () => (this.templateSelectEl.value = null) }, h("ion-icon", { slot: "icon-only", name: "close-circle" })))) : null, this.preview && this.value && (h("floodteam-template", { templateId: this.value, disablePosition: this.disablePosition, disableFrame: this.disableFrame, allowFullscreen: this.allowFullscreen, zoom: this.zoom || 1, resize: this.resize, style: {
        overflowY: "auto",
        height: "30vh",
        display: "block",
        width: "100%",
      } }))));
  }
};
SelectTemplate.style = selectTemplateCss;

const cardTitleIosCss = ":host{display:block;position:relative;color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-text-color, #000);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:28px;font-weight:700;line-height:1.2}";

const cardTitleMdCss = ":host{display:block;position:relative;color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-850, #262626);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:20px;font-weight:500;line-height:1.2}";

const CardTitle = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  render() {
    const mode = getIonMode(this);
    return (h(Host, { role: "heading", "aria-level": "2", class: createColorClasses(this.color, {
        'ion-inherit-color': true,
        [mode]: true,
      }) }, h("slot", null)));
  }
};
CardTitle.style = {
  ios: cardTitleIosCss,
  md: cardTitleMdCss
};

export { SelectTemplate as floodteam_select_template, CardTitle as ion_card_title };
