/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/lit-service-status-component@0.0.3/lit-service-status-component.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var __decorate=this&&this.__decorate||function(t,e,o,r){var s,l=arguments.length,n=l<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(n=(l<3?s(n):l>3?s(e,o,n):s(e,o))||n);return l>3&&n&&Object.defineProperty(e,o,n),n};import{LitElement,html,css}from"lit";import{customElement,property}from"lit/decorators.js";let StatusElement=class extends LitElement{constructor(){super(...arguments),this.statusText="Status",this.onlineText="Online",this.offlineText="Offline",this.onlineColor="green",this.offlineColor="red"}async getServiceStatus(){try{fetch(this.apiToCheck,{headers:{Accept:"application/json",apiKey:""}}).then((t=>this.status=t.statusText))}catch(t){console.error(t)}}connectedCallback(){super.connectedCallback(),this.getServiceStatus()}render(){return html`
      <div class="label ${"OK"===this.status?"":"offline"}">
        ${"OK"===this.status?this.onlineText:this.offlineText}
      </div>
    `}};StatusElement.styles=css`
    :host {
      display: block;
    }

    .label {
      font-weight: bold;
      border-radius: 1em;
      padding: 0.5em;
      color: white;
      width: 100px;
      text-align: center;
      font-family: 'Fira Sans', sans-serif;
    }

    .label {
      background-color: green;
    }

    .label.offline {
      background-color: red;
    }
  `,__decorate([property()],StatusElement.prototype,"apiToCheck",void 0),__decorate([property()],StatusElement.prototype,"status",void 0),__decorate([property()],StatusElement.prototype,"statusText",void 0),__decorate([property()],StatusElement.prototype,"onlineText",void 0),__decorate([property()],StatusElement.prototype,"offlineText",void 0),__decorate([property()],StatusElement.prototype,"onlineColor",void 0),__decorate([property()],StatusElement.prototype,"offlineColor",void 0),StatusElement=__decorate([customElement("lit-service-status-component")],StatusElement);export{StatusElement};
//# sourceMappingURL=/sm/37adac88040f88f23631c77dbf8fc5b8e26f318841c01b51054fcccb68757cc7.map