export const __rspack_esm_id=23765;export const __rspack_esm_ids=[23765];export const __webpack_modules__={14800(t,i,e){e.d(i,{},{e:t=>t.attributes.access_token?`/api/image_proxy/${t.entity_id}?token=${t.attributes.access_token}&state=${t.state}`:void 0})},30081(t,i,e){const s="__MANUAL_ENTRY__";e.d(i,{},{A1:(t,i)=>t.callWS({type:"media_source/resolve_media",media_content_id:i}),CY:t=>t.startsWith(s),Fn:(t,i)=>t.callWS({type:"media_source/browse_media",media_content_id:i}),Jz:t=>t.startsWith("media-source://media_source"),St:t=>t.startsWith("media-source://"),VA:async(t,i,e)=>{const s=new FormData;s.append("media_content_id",i),s.append("file",e);const a=await t.fetchWithAuth("/api/media_source/local_source/upload",{method:"POST",body:s});if(413===a.status)throw new Error(t.localize("ui.common.upload_file_too_large",{name:e.name}));if(200!==a.status)throw new Error(t.localize("ui.common.unknown_error"));return a.json()},WI:async(t,i)=>t.callWS({type:"media_source/local_source/remove",media_content_id:i}),iY:t=>t.startsWith("media-source://image_upload"),xw:s})},26228(t,i,e){e.a(t,async function(t,s){try{e.r(i);var a=e(15697),o=e(57527),n=e(79224),c=e(97901),r=e(5455),h=e(25113),_=e(45602),g=(e(75041),e(14800)),d=e(14936),m=e(42239),u=e(49511),l=e(72441),f=e(58178),p=e(30081),y=t([f]);f=(y.then?(await y)():y)[0];class w extends o.WF{static async getConfigElement(){return await e.e(56652).then(e.bind(e,70663)),document.createElement("hui-picture-card-editor")}static getStubConfig(){return{type:"picture",image:"https://demo.home-assistant.io/stub_config/t-shirt-promo.png"}}getCardSize(){return 5}setConfig(t){if(!t||!t.image&&!t.image_entity)throw new Error("Image required");t.image_entity?this._config={tap_action:{action:"more-info"},...t}:this._config={tap_action:{action:"none"},...t}}shouldUpdate(t){if(!this._config||(0,l.xP)(this,t)||t.has("_resolvedImage"))return!0;if(this._config.image_entity&&t.has("hass")){const i=t.get("hass");if(!i||i.states[this._config.image_entity]!==this.hass.states[this._config.image_entity])return!0}return!1}willUpdate(t){if(super.willUpdate(t),!this._config||!this.hass)return;const i=t.has("hass")&&void 0===t.get("hass"),e=t.has("_config")&&t.get("_config")?.image!==this._config?.image,s="object"==typeof this._config?.image&&this._config.image.media_content_id||this._config.image;(i||e)&&"string"==typeof s&&(0,p.St)(s)?(this._resolvedImage=void 0,(0,p.A1)(this.hass,s).then(t=>{this._resolvedImage=t.url})):e&&(this._resolvedImage=s)}updated(t){if(super.updated(t),!this._config||!this.hass)return;const i=t.get("hass"),e=t.get("_config");i&&e&&i.themes===this.hass.themes&&e.theme===this._config.theme||(0,h.Q)(this,this.hass.themes,this._config.theme)}render(){if(!this._config||!this.hass)return o.s6;let t;if(this._config.image_entity&&(t=this.hass.states[this._config.image_entity],!t))return o.qy`<hui-warning .hass=${this.hass}> ${(0,f.j)(this.hass,this._config.image_entity)} </hui-warning>`;let i=this._resolvedImage;if(this._config.image_entity){switch((0,_.m)(this._config.image_entity)){case"image":i=(0,g.e)(t);break;case"person":t.attributes.entity_picture&&(i=t.attributes.entity_picture)}}if(void 0===i)return o.s6;const e=Boolean(this._config.image_entity&&!this._config.tap_action||(0,u.A)(this._config));return o.qy` <ha-card @action=${this._handleAction} .actionHandler=${(0,d.T)({hasHold:(0,u.h)(this._config.hold_action),hasDoubleClick:(0,u.h)(this._config.double_tap_action)})} tabindex=${(0,r.J)((0,u.h)(this._config.tap_action)||this._config.image_entity?"0":void 0)} class=${(0,c.H)({clickable:e})}> <img alt=${(0,r.J)(this._config.alt_text||t?.attributes.friendly_name)} src=${this.hass.hassUrl(i)} /> </ha-card> `}_handleAction(t){(0,m.$)(this,this.hass,this._config,t.detail.action)}}w.styles=o.AH`ha-card{height:100%;overflow:hidden}ha-card.clickable{cursor:pointer}img{width:100%;display:block}`,(0,a.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_config",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_resolvedImage",void 0),w=(0,a.Cg)([(0,n.EM)("hui-picture-card")],w),e.d(i,{HuiPictureCard:()=>w}),s()}catch(t){s(t)}})}};
//# sourceMappingURL=23765.75f3c033ff516023.js.map