import { r as registerInstance, d as createEvent, h, H as Host } from './index-31949dc5.js';
import { s as state } from './store-cca1abc6.js';
import './index-afdf7f54.js';
import './getHandlebarsHelpers-ae9bfed4.js';
import './_commonjsHelpers-44457d8d.js';
import './index-e6b3332e.js';
import './localforage-394b59fa.js';

const itemSiteCss = "floodteam-item-site h3,floodteam-item-site ion-text{display:block;text-indent:10px}floodteam-item-site ion-label{margin-top:5px;margin-bottom:0px;text-transform:capitalize}floodteam-item-site ion-grid ion-chip{padding:0px 15px;--background:transparent;--color:var(--ion-text-color);opacity:0.5}floodteam-item-site ion-chip ion-icon{height:15px;width:15px;color:var(--ion-text-color)}floodteam-item-site ion-grid,floodteam-item-site ion-grid ion-row,floodteam-item-site ion-grid ion-row ion-col{padding:0;margin:0}";

const ItemSite = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.floodteamOpenSiteEditModal = createEvent(this, "floodteamOpenSiteEditModal", 7);
    this.href = undefined;
    this.detail = true;
    this.disabled = false;
    this.site = undefined;
  }
  openTab(event, selectedTab) {
    event.stopPropagation();
    event.preventDefault();
    state.site = this.site;
    this.floodteamOpenSiteEditModal.emit({
      selectedTab,
      site: this.site,
    });
  }
  render() {
    var _a, _b, _c, _d, _e, _f, _g, _h, _j;
    return (h(Host, null, h("ion-item", { detail: this.detail, href: this.href, disabled: this.disabled }, h("ion-label", null, h("h3", null, ((_a = this.site) === null || _a === void 0 ? void 0 : _a.name) ? this.site.name : "Common"), h("ion-grid", null, h("ion-row", null, h("ion-col", { size: "3" }, h("ion-chip", { onClick: (event) => this.openTab(event, "photos") }, h("ion-icon", { name: "images" }), h("ion-label", null, ((_c = (_b = this.site) === null || _b === void 0 ? void 0 : _b.photos) === null || _c === void 0 ? void 0 : _c.length) ? this.site.photos.length : 0))), h("ion-col", { size: "3" }, h("ion-chip", { onClick: (event) => this.openTab(event, "info") }, h("ion-icon", { name: "construct" }), h("ion-label", null, ((_e = (_d = this.site) === null || _d === void 0 ? void 0 : _d.equipment) === null || _e === void 0 ? void 0 : _e.length)
      ? this.site.equipment.length
      : 0))), h("ion-col", { size: "3" }, h("ion-chip", { onClick: (event) => this.openTab(event, "info") }, h("ion-icon", { name: "reader" }), h("ion-label", null, ((_g = (_f = this.site) === null || _f === void 0 ? void 0 : _f.services) === null || _g === void 0 ? void 0 : _g.length)
      ? this.site.services.length
      : 0))), h("ion-col", { size: "3" }, h("ion-chip", { onClick: (event) => this.openTab(event, "dots") }, h("ion-icon", { name: "ellipse" }), h("ion-label", null, ((_j = (_h = this.site) === null || _h === void 0 ? void 0 : _h.dots) === null || _j === void 0 ? void 0 : _j.length) ? this.site.dots.length : 0)))))))));
  }
};
ItemSite.style = itemSiteCss;

export { ItemSite as floodteam_item_site };
