export const __rspack_esm_id=38759;export const __rspack_esm_ids=[38759];export const __webpack_modules__={89645(t,o,i){const e=t=>{const o=parseFloat(t);if(isNaN(o))throw new Error(`${t} is not a number`);return o};function r(t){if(!t)return null;try{if(t.endsWith("%"))return{w:100,h:e(t.slice(0,-1))};const o=t.replace(":","x").split("x");return 0===o.length?null:1===o.length?{w:e(o[0]),h:1}:{w:e(o[0]),h:e(o[1])}}catch(t){}return null}i.d(o,{A:()=>r})},80442(t,o,i){i.a(t,async function(t,e){try{i.r(o);i(14603),i(47566),i(98721);var r=i(15697),a=i(57527),n=i(79224),s=i(97901),l=i(5455),c=i(83113),h=i(89645),d=i(88457),u=(i(75041),i(15977)),p=t([d]);d=(p.then?(await p)():p)[0];class f extends a.WF{static async getConfigElement(){return await i.e(15816).then(i.bind(i,69019)),document.createElement("hui-iframe-card-editor")}static getStubConfig(){return{type:"iframe",url:"https://www.home-assistant.io",aspect_ratio:"50%"}}getCardSize(){if(!this._config)return 5;return 1+(this._config.aspect_ratio?Number(this._config.aspect_ratio.replace("%","")):50)/25}setConfig(t){if(!t.url)throw new Error("URL required");this._config=t}render(){if(!this._config||!this.hass)return a.s6;let t="";if(!("panel"===this.layout||"grid"===this.layout))if(this._config.aspect_ratio){const o=(0,h.A)(this._config.aspect_ratio);o&&o.w>0&&o.h>0&&(t=`${(100*o.h/o.w).toFixed(2)}%`)}else t="50%";const o=new URL(this._config.url,location.toString()).protocol;if("https:"===location.protocol&&"https:"!==o)return a.qy` <ha-alert alert-type="error"> ${this.hass.localize("ui.panel.lovelace.cards.iframe.error_secure_context",{target_protocol:o,context_protocol:location.protocol})} </ha-alert> `;let i="";this._config.allow_open_top_navigation&&(i+="allow-top-navigation-by-user-activation");const e=this._config.disable_sandbox?void 0:`${i} ${u.D}`;return a.qy` <ha-card class=${(0,s.H)({"hide-background":this._config.hide_background})} .header=${this._config.title}> <div id="root" style=${(0,c.W)({"padding-top":t})};> <iframe title=${(0,l.J)(this._config.title)} src=${this._config.url} sandbox=${(0,l.J)(e)} allow=${this._config.allow??"fullscreen"}></iframe> </div> </ha-card> `}getGridOptions(){return{columns:"full",rows:4,min_columns:3,min_rows:2}}}f.styles=a.AH`ha-card{flex-direction:column;width:100%;height:100%;display:flex;overflow:hidden}ha-card.hide-background{box-shadow:none;background:0 0;border:none}#root{width:100%;height:100%;position:relative}iframe{border:none;width:100%;height:100%;position:absolute;top:0;left:0}`,(0,r.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"layout",void 0),(0,r.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,r.Cg)([(0,n.wk)()],f.prototype,"_config",void 0),f=(0,r.Cg)([(0,n.EM)("hui-iframe-card")],f),i.d(o,{HuiIframeCard:()=>f}),e()}catch(t){e(t)}})},15977(t,o,i){i.d(o,{},{D:"allow-forms allow-popups allow-pointer-lock allow-same-origin allow-scripts allow-modals allow-downloads"})}};
//# sourceMappingURL=38759.73ce16fbade78a3a.js.map