(()=>{var e={37846:()=>{if(/^((?!chrome|android).)*version\/14\.0.*safari/i.test(navigator.userAgent)){const e=window.Element.prototype.attachShadow;window.Element.prototype.attachShadow=function(t){return t&&t.delegatesFocus&&delete t.delegatesFocus,e.apply(this,[t])}}}},t={};function n(o){if(t[o])return t[o].exports;var l=t[o]={exports:{}};return e[o](l,l.exports,n),l.exports}(()=>{"use strict";n(37846);const e=(e,t,n)=>new Promise(((o,l)=>{const r=document.createElement(e);let a="src",s="body";switch(r.onload=()=>o(t),r.onerror=()=>l(t),e){case"script":r.async=!0,n&&(r.type=n);break;case"link":r.type="text/css",r.rel="stylesheet",a="href",s="head"}r[a]=t,document[s].appendChild(r)})),t=t=>e("script",t),o="customElements"in window&&"content"in document.createElement("template"),l={},r=n=>{const o=(e=>e.html_url?{type:"html",url:e.html_url}:e.module_url&&e.js_url||e.module_url?{type:"module",url:e.module_url}:{type:"js",url:e.js_url})(n);return"js"===o.type?(o.url in l||(l[o.url]=t(o.url)),l[o.url]):"module"===o.type?(r=o.url,e("script",r,"module")):Promise.reject("No valid url found in panel config.");var r};let a,s;function c(e){s&&((e,t)=>{"setProperties"in e?e.setProperties(t):Object.keys(t).forEach((n=>{e[n]=t[n]}))})(s,e)}function d(e,n){const l=document.createElement("style");l.innerHTML="body{margin:0}",document.head.appendChild(l);const d=e.config._panel_custom;let i=Promise.resolve();o||(i=i.then((()=>t("/static/polyfills/webcomponents-bundle.js")))),i.then((()=>r(d))).then((()=>a||Promise.resolve())).then((()=>{s=(e=>{const t="html_url"in e?"ha-panel-"+e.name:e.name;return document.createElement(t)})(d);s.addEventListener("hass-toggle-menu",(e=>{window.parent.customPanel&&((e,t,n,o)=>{o=o||{},n=null==n?{}:n;const l=new Event(t,{bubbles:void 0===o.bubbles||o.bubbles,cancelable:Boolean(o.cancelable),composed:void 0===o.composed||o.composed});l.detail=n,e.dispatchEvent(l)})(window.parent.customPanel,e.type,e.detail)})),window.addEventListener("location-changed",(e=>{window.parent.customPanel&&window.parent.customPanel.navigate(window.location.pathname,!!e.detail&&e.detail.replace)})),c({panel:e,...n}),document.body.appendChild(s)}),(t=>{console.error(t,e),alert(`Unable to load the panel source: ${t}.`)}))}window.loadES5Adapter=()=>(a||(a=t("/static/polyfills/custom-elements-es5-adapter.js").catch()),a),document.addEventListener("DOMContentLoaded",(()=>window.parent.customPanel.registerIframe(d,c)),{once:!0})})()})();
//# sourceMappingURL=custom-panel.bd93bcf1.js.map