import{a as e,h as t,e as o,$ as r,aM as i,r as a,n as s,o as n,aL as d,d as c}from"./main-ad130be7.js";import"./c.2d5ed670.js";import"./c.9b92f489.js";import"./c.82eccc94.js";import"./c.4feb0cb8.js";import"./c.0ca5587f.js";import"./c.5d3ce9d6.js";e([s("ha-icon-overflow-menu")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[o({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[o({type:Array})],key:"items",value:()=>[]},{kind:"field",decorators:[o({type:Boolean})],key:"narrow",value:()=>!1},{kind:"method",key:"render",value:function(){return r` ${this.narrow?r` ${this.items.map((e=>r`
${e.label}
`))}
`:r` ${this.items.map((e=>e.narrowOnly?"":r`
${e.tooltip?r` ${e.tooltip} `:""}
`))} `} `}},{kind:"method",key:"_handleIconOverflowMenuOpened",value:function(){const e=this.closest(".mdc-data-table__row");e&&(e.style.zIndex="1")}},{kind:"method",key:"_handleIconOverflowMenuClosed",value:function(){const e=this.closest(".mdc-data-table__row");e&&(e.style.zIndex="")}},{kind:"get",static:!0,key:"styles",value:function(){return a` :host { display: flex; justify-content: flex-end; } `}}]}}),t);const l=e=>t=>({kind:"method",placement:"prototype",key:t.key,descriptor:{set(e){this[`__${String(t.key)}`]=e},get(){return this[`__${String(t.key)}`]},enumerable:!0,configurable:!0},finisher(o){const r=o.prototype.connectedCallback;o.prototype.connectedCallback=function(){if(r.call(this),this[t.key]){const o=this.renderRoot.querySelector(e);if(!o)return;o.scrollTop=this[t.key]}}}});e([s("hacs-repository-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[o({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[o({attribute:!1})],key:"hacs",value:void 0},{kind:"field",decorators:[o({attribute:!1})],key:"repository",value:void 0},{kind:"field",decorators:[o({type:Boolean})],key:"narrow",value:void 0},{kind:"get",key:"_borderClass",value:function(){const e={};return this.hacs.addedToLovelace(this.hacs,this.repository)&&"pending-restart"!==this.repository.status?this.repository.pending_upgrade?e["status-update"]=!0:this.repository.new&&!this.repository.installed&&(e["status-new"]=!0):e["status-issue"]=!0,0!==Object.keys(e).length&&(e["status-border"]=!0),e}},{kind:"get",key:"_headerClass",value:function(){const e={};return this.hacs.addedToLovelace(this.hacs,this.repository)&&"pending-restart"!==this.repository.status?this.repository.pending_upgrade?e["update-header"]=!0:this.repository.new&&!this.repository.installed?e["new-header"]=!0:e["default-header"]=!0:e["issue-header"]=!0,e}},{kind:"get",key:"_headerTitle",value:function(){return this.hacs.addedToLovelace(this.hacs,this.repository)?"pending-restart"===this.repository.status?this.hacs.localize("repository_card.pending_restart"):this.repository.pending_upgrade?this.hacs.localize("repository_card.pending_update"):this.repository.new&&!this.repository.installed?this.hacs.localize("repository_card.new_repository"):"":this.hacs.localize("repository_card.not_loaded")}},{kind:"method",key:"render",value:function(){return r`
${this._headerTitle}

${this.repository.name}

${"integration"!==this.repository.category?r` ${this.hacs.localize(`common.${this.repository.category}`)} `:""}
${this.repository.description}
${this.repository.new&&!this.repository.installed?r`
${this.hacs.localize("repository_card.dismiss")}
`:this.repository.pending_upgrade&&this.hacs.addedToLovelace(this.hacs,this.repository)?r`
${this.hacs.localize("common.update")}
`:""}
`}},{kind:"method",key:"_updateRepository",value:function(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("hacs-dialog",{detail:{type:"update",repository:this.repository.id},bubbles:!0,composed:!0}))}},{kind:"method",key:"_setNotNew",value:async function(e){e.preventDefault(),await d(this.hass,{repository:String(this.repository.id)})}},{kind:"get",static:!0,key:"styles",value:function(){return[c,a` ha-card { display: flex; flex-direction: column; height: 195px; width: 480px; } .title { display: flex; justify-content: space-between; } .card-content { padding: 0 0 3px 0; height: 100%; } .card-actions { border-top: none; bottom: 0; display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; padding: 5px; } .group-header { height: auto; align-content: center; } .group-header h1 { margin: 0; padding: 8px 16px; font-size: 22px; } h1 { margin-top: 0; min-height: 24px; } a { all: unset; cursor: pointer; } .description { opacity: var(--dark-primary-opacity); font-size: 14px; padding: 8px 16px; max-height: 52px; overflow: hidden; } .status-new { border-color: var(--hcv-color-new); --mdc-theme-primary: var(--hcv-color-new); } .status-update { border-color: var(--hcv-color-update); } .status-issue { border-color: var(--hcv-color-error); } .new-header { background-color: var(--hcv-color-new); color: var(--hcv-text-color-on-background); } .issue-header { background-color: var(--hcv-color-error); color: var(--hcv-text-color-on-background); } .update-header { background-color: var(--hcv-color-update); color: var(--hcv-text-color-on-background); } .default-header { padding: 2px 0 !important; } mwc-button.update-header { --mdc-theme-primary: var(--hcv-color-update); --mdc-theme-on-primary: var(--hcv-text-color-on-background); } .status-border { border-style: solid; border-width: min(var(--ha-card-border-width, 1px), 10px); } .status-header { top: 0; padding: 6px 1px; margin: -1px; width: 100%; font-weight: 500; text-align: center; left: 0; border-top-left-radius: var(--ha-card-border-radius, 4px); border-top-right-radius: var(--ha-card-border-radius, 4px); } ha-card[narrow] { width: calc(100% - 24px); margin: 11px; } ha-chip { padding: 4px; margin-top: 3px; } `]}}]}}),t);export{l as r};