import { r as registerInstance, h, H as Host, d as createEvent, e as getElement } from './index-26447f8a.js';
import { m as modalController } from './overlays-a3190093.js';
import { s as state } from './store-838a3050.js';
import { u as menuOutline, v as menuSharp } from './index-9b9ea3f7.js';
import { g as getIonMode, c as config } from './ionic-global-b53b5faa.js';
import { i as inheritAriaAttributes } from './helpers-06537f39.js';
import { m as menuController } from './index-06c3870e.js';
import { c as createColorClasses, h as hostContext } from './theme-7ef00c83.js';
import { u as updateVisibility } from './menu-toggle-util-17a25784.js';
import './index-b0d3ac50.js';
import './getHandlebarsHelpers-0376b57c.js';
import './_commonjsHelpers-7c4ea794.js';
import './index-e6b3332e.js';
import './localforage-c63d55c8.js';
import './animation-093320a4.js';
import './index-5aa6aa3e.js';

const chipBarCss = "fireenjin-chip-bar{display:block;padding:3px;height:46px;width:100%;overflow:hidden;overflow-x:auto !important;white-space:nowrap}ion-chip ion-icon.ft-icon-style{height:14px !important;width:14px !important;padding:4px !important}fireenjin-chip-bar ion-router-link:hover ion-icon{color:var(--ion-color-secondary)}fireenjin-chip-bar::-webkit-scrollbar{width:0;height:5px}fireenjin-chip-bar::-webkit-scrollbar-thumb{background:rgba(var(--ion-text-color-rgb), 0.6);border-radius:2px}";

const ChipBar = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  render() {
    return (h(Host, null, h("slot", null)));
  }
};
ChipBar.style = chipBarCss;

const navigationFooterCss = "floodteam-navigation-footer fireenjin-chip-bar{padding-right:80px}floodteam-navigation-footer floodteam-title-bar{display:block;width:100%}floodteam-navigation-footer floodteam-title-bar ion-breadcrumb:first-of-type::part(native){padding-left:0}floodteam-navigation-footer floodteam-title-bar ion-breadcrumb ion-icon{color:var(--ion-text-color)}floodteam-navigation-footer floodteam-title-bar h1.ion-margin-vertical{margin:0}floodteam-navigation-footer .showing-pins fireenjin-chip-bar{padding-right:50px}floodteam-navigation-footer .menu-buttons{background:-moz-linear-gradient(\n    left,\n    rgba(var(--ion-nav-color-rgb), 0) 0%,\n    rgba(var(--ion-nav-color-rgb), 1) 30%\n  );background:-webkit-linear-gradient(\n    left,\n    rgba(var(--ion-nav-color-rgb), 0) 0%,\n    rgba(var(--ion-nav-color-rgb), 1) 30%\n  );background:linear-gradient(\n    to right,\n    rgba(var(--ion-nav-color-rgb), 0) 0%,\n    rgba(var(--ion-nav-color-rgb), 1) 30%\n  );filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#007db9e8', endColorstr='#1e5799',GradientType=1 );position:absolute;top:0;bottom:0;right:0;width:80px;index:9}floodteam-navigation-footer .showing-pins .menu-buttons{width:55px}floodteam-navigation-footer ion-menu-button{display:block;width:55px;position:absolute;right:0;bottom:6px}";

const NavigationFooter = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  render() {
    return (h("ion-header", { class: "showing-pins" }, h("ion-toolbar", null, h("div", { class: "header-content", style: {
        display: "flex",
        "flex-wrap": "wrap",
        padding: "0 0 .4rem 0",
      } }, h("slot", null), h("floodteam-pin-bar", { style: {
        display: "flex",
        "justify-content": "flex-end",
        height: "2.8rem",
      } })), h("div", { class: "menu-buttons" }, h("ion-menu-button", { autoHide: false }, h("ion-icon", { src: "/assets/icon/icon.svg", "aria-hidden": "true", style: {
        height: "55px",
        width: "60px",
        margin: "auto",
        textDecoration: "none",
        color: "var(--ion-text-color)",
      } }))))));
  }
};
NavigationFooter.style = navigationFooterCss;

const pinBarCss = "floodteam-pin-bar{padding:3px;height:46px;width:100%;overflow:hidden;overflow-x:auto !important;white-space:nowrap}floodteam-pin-bar ion-router-link:hover ion-icon{color:var(--ion-color-secondary)}floodteam-pin-bar::-webkit-scrollbar{width:0;height:5px}floodteam-pin-bar::-webkit-scrollbar-thumb{background:rgba(var(--ion-text-color-rgb), 0.6);border-radius:2px}";

const AppHeader = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.fireenjinTrigger = createEvent(this, "fireenjinTrigger", 7);
    this.reorder = false;
    this.isDragging = false;
  }
  dragOver(event) {
    event.preventDefault();
    // const cardEl: HTMLElement = event.target.closest("ion-card");
    // cardEl.style.opacity = "1";
  }
  dragLeave(event) {
    event.preventDefault();
    // const cardEl: HTMLElement = event.target.closest("ion-card");
    // cardEl.style.opacity = "0.6";
  }
  drag(event) {
    console.log(event);
    this.isDragging = true;
  }
  async drop(event) {
    event.preventDefault();
    // var data = ev.dataTransfer.getData('text');
    // ev.target.closest('ion-list').appendChild(document.getElementById(data));
    this.isDragging = false;
  }
  async openSupportModal(event) {
    this.modal = await modalController.create({
      cssClass: "modal-support",
      component: "modal-support",
      componentProps: {
        user: (state === null || state === void 0 ? void 0 : state.profile) || null,
      },
      backdropDismiss: false,
    });
    this.modal.present();
    return event;
  }
  render() {
    var _a, _b;
    return (h(Host, null, h("fireenjin-chip-bar", { ref: (el) => (this.chipBarEl = el), onDrop: (event) => this.drop(event), onDragOver: (event) => this.dragOver(event), onDragLeave: (event) => this.dragLeave(event) }, h("ion-router-link", { title: "Home", href: "/dashboard" }, h("ion-chip", { title: "Home" }, h("ion-icon", { "aria-hidden": "true", name: "home", class: {
        "ft-icon-style": true,
      } }), h("ion-label", null, "Home"))), (_b = (_a = ((state === null || state === void 0 ? void 0 : state.pins) || [])).map) === null || _b === void 0 ? void 0 :
      _b.call(_a, (pin) => (h("ion-router-link", { title: pin === null || pin === void 0 ? void 0 : pin.name, href: (pin === null || pin === void 0 ? void 0 : pin.href) || "#", onClick: (event) => (pin === null || pin === void 0 ? void 0 : pin.trigger)
          ? this.fireenjinTrigger.emit({
            event,
            payload: (pin === null || pin === void 0 ? void 0 : pin.payload) || null,
            name: pin.trigger,
          })
          : null }, h("ion-chip", { title: pin.name, draggable: this.reorder, onDragStart: (event) => this.drag(event) }, h("ion-icon", { "aria-hidden": "true", name: pin.icon, class: {
          "ft-icon-style": true,
        } }), (pin === null || pin === void 0 ? void 0 : pin.name) && h("ion-label", null, pin.name))))), h("ion-router-link", { title: "Get Help", href: "#support", onClick: (event) => this.openSupportModal(event) }, h("ion-chip", { color: "warning" }, h("ion-icon", { "aria-hidden": "true", color: "warning", name: "help-circle", style: {
        "--ft-icon-primary": "var(--ion-color-warning)",
      }, class: {
        "ft-icon-style": true,
      } }), h("ion-label", null, "Get Help"))))));
  }
};
AppHeader.style = pinBarCss;

const menuButtonIosCss = ":host{--background:transparent;--color-focused:currentColor;--border-radius:initial;--padding-top:0;--padding-bottom:0;color:var(--color);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;font-kerning:none}.button-native{border-radius:var(--border-radius);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;overflow:hidden;user-select:none;z-index:0;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}ion-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;pointer-events:none}:host(.menu-button-hidden){display:none}:host(.menu-button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity, 0)}}:host(.ion-color) .button-native{color:var(--ion-color-base)}:host(.in-toolbar:not(.in-toolbar-color)){color:var(--ion-toolbar-color, var(--color))}:host{--background-focused:currentColor;--background-focused-opacity:.1;--border-radius:4px;--color:var(--ion-color-primary, #3880ff);--padding-start:5px;--padding-end:5px;height:32px;font-size:31px}:host(.ion-activated){opacity:0.4}@media (any-hover: hover){:host(:hover){opacity:0.6}}";

const menuButtonMdCss = ":host{--background:transparent;--color-focused:currentColor;--border-radius:initial;--padding-top:0;--padding-bottom:0;color:var(--color);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;font-kerning:none}.button-native{border-radius:var(--border-radius);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;overflow:hidden;user-select:none;z-index:0;appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}ion-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;pointer-events:none}:host(.menu-button-hidden){display:none}:host(.menu-button-disabled){cursor:default;opacity:0.5;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity, 0)}}:host(.ion-color) .button-native{color:var(--ion-color-base)}:host(.in-toolbar:not(.in-toolbar-color)){color:var(--ion-toolbar-color, var(--color))}:host{--background-focused:currentColor;--background-focused-opacity:.12;--background-hover:currentColor;--background-hover-opacity:.04;--border-radius:50%;--color:initial;--padding-start:8px;--padding-end:8px;width:48px;height:48px;font-size:24px}:host(.ion-color.ion-focused)::after{background:var(--ion-color-base)}@media (any-hover: hover){:host(.ion-color:hover) .button-native::after{background:var(--ion-color-base)}}";

const MenuButton = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.inheritedAttributes = {};
    this.visible = false;
    /**
     * If `true`, the user cannot interact with the menu button.
     */
    this.disabled = false;
    /**
     * Automatically hides the menu button when the corresponding menu is not active
     */
    this.autoHide = true;
    /**
     * The type of the button.
     */
    this.type = 'button';
    this.onClick = async () => {
      return menuController.toggle(this.menu);
    };
  }
  componentWillLoad() {
    this.inheritedAttributes = inheritAriaAttributes(this.el);
  }
  componentDidLoad() {
    this.visibilityChanged();
  }
  async visibilityChanged() {
    this.visible = await updateVisibility(this.menu);
  }
  render() {
    const { color, disabled, inheritedAttributes } = this;
    const mode = getIonMode(this);
    const menuIcon = config.get('menuIcon', mode === 'ios' ? menuOutline : menuSharp);
    const hidden = this.autoHide && !this.visible;
    const attrs = {
      type: this.type,
    };
    const ariaLabel = inheritedAttributes['aria-label'] || 'menu';
    return (h(Host, { onClick: this.onClick, "aria-disabled": disabled ? 'true' : null, "aria-hidden": hidden ? 'true' : null, class: createColorClasses(color, {
        [mode]: true,
        button: true,
        'menu-button-hidden': hidden,
        'menu-button-disabled': disabled,
        'in-toolbar': hostContext('ion-toolbar', this.el),
        'in-toolbar-color': hostContext('ion-toolbar[color]', this.el),
        'ion-activatable': true,
        'ion-focusable': true,
      }) }, h("button", Object.assign({}, attrs, { disabled: disabled, class: "button-native", part: "native", "aria-label": ariaLabel }), h("span", { class: "button-inner" }, h("slot", null, h("ion-icon", { part: "icon", icon: menuIcon, mode: mode, lazy: false, "aria-hidden": "true" }))), mode === 'md' && h("ion-ripple-effect", { type: "unbounded" }))));
  }
  get el() { return getElement(this); }
};
MenuButton.style = {
  ios: menuButtonIosCss,
  md: menuButtonMdCss
};

export { ChipBar as fireenjin_chip_bar, NavigationFooter as floodteam_navigation_footer, AppHeader as floodteam_pin_bar, MenuButton as ion_menu_button };
