"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["68622"],{26218:function(t,e,a){a.d(e,{a:function(){return r}});a(16280);const o=(0,a(77796).n)(t=>{history.replaceState({scrollPosition:t},"")},300);function r(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const r=e.connectedCallback;e.connectedCallback=function(){r.call(this);const e=this[a];e&&this.updateComplete.then(()=>{const a=this.renderRoot.querySelector(t);a&&setTimeout(()=>{a.scrollTop=e},0)})};const n=Object.getOwnPropertyDescriptor(e,a);let i;if(void 0===n)i={get(){var t;return this[`__${String(a)}`]||(null===(t=history.state)||void 0===t?void 0:t.scrollPosition)},set(t){o(t),this[`__${String(a)}`]=t},configurable:!0,enumerable:!0};else{const t=n.set;i=Object.assign(Object.assign({},n),{},{set(e){o(e),this[`__${String(a)}`]=e,null==t||t.call(this,e)}})}Object.defineProperty(e,a,i)}}},77796:function(t,e,a){a.d(e,{n:function(){return o}});a(62953);const o=(t,e,a=!0,o=!0)=>{let r,n=0;const i=(...i)=>{const s=()=>{n=!1===a?0:Date.now(),r=void 0,t(...i)},l=Date.now();n||!1!==a||(n=l);const d=e-(l-n);d<=0||d>e?(r&&(clearTimeout(r),r=void 0),n=l,t(...i)):r||!1===o||(r=window.setTimeout(s,d))};return i.cancel=()=>{clearTimeout(r),r=void 0,n=0},i}},76776:function(t,e,a){a(62953);var o=a(40445),r=a(96196),n=a(77845);let i,s,l,d=t=>t;class c extends r.WF{render(){return(0,r.qy)(i||(i=d` ${0} <slot></slot> `),this.header?(0,r.qy)(s||(s=d`<h1 class="card-header">${0}</h1>`),this.header):r.s6)}constructor(...t){super(...t),this.raised=!1}}c.styles=(0,r.AH)(l||(l=d`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)}
    :host
      ::slotted(
        .card-content:not(:nth-child(1 of .card-content, .card-header))
      ),
    slot:not(:first-child)::slotted(.card-content) {
      padding-top: 0;
      margin-top: calc(var(--ha-space-2) * -1);
    }
    :host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`)),(0,o.Cg)([(0,n.MZ)()],c.prototype,"header",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],c.prototype,"raised",void 0),c=(0,o.Cg)([(0,n.EM)("ha-card")],c)},70947:function(t,e,a){a(62953);var o=a(40445),r=a(90075),n=(a(43776),a(96196)),i=a(77845);a(67094);let s,l,d=t=>t;class c extends r.A{renderCheckboxIcon(){return(0,n.qy)(s||(s=d` <ha-svg-icon id="check" part="checkmark" .path="${0}"></ha-svg-icon> `),this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z")}static get styles(){return[r.A.styles,(0,n.AH)(l||(l=d`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`))]}constructor(...t){super(...t),this.selected=!1}}(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],c.prototype,"selected",void 0),c=(0,o.Cg)([(0,i.EM)("ha-dropdown-item")],c)},29823:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953);var o=a(40445),r=a(52254),n=a(96196),i=a(77845),s=t([r]);r=(s.then?(await s)():s)[0];let l,d=t=>t;class c extends r.A{get anchorElement(){var t;return null===(t=this.popup)||void 0===t?void 0:t.anchor}set anchorElement(t){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=t)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!0)}async hideMenu(){const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!1),await super.hideMenu()}static get styles(){return[r.A.styles,(0,n.AH)(l||(l=d`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var(
            --card-background-color,
            var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)),
          )}#menu{padding:var(--ha-space-1)}`))]}constructor(...t){super(...t),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,o.Cg)([(0,i.MZ)({attribute:!1})],c.prototype,"dropdownTag",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],c.prototype,"dropdownItemTag",void 0),c=(0,o.Cg)([(0,i.EM)("ha-dropdown")],c),e()}catch(l){e(l)}})},90248:function(t,e,a){a.a(t,async function(t,o){try{a.r(e),a.d(e,{HaIconButtonArrowPrev:function(){return f}});a(62953);var r=a(40445),n=a(96196),i=a(77845),s=a(63091),l=a(26300),d=t([l]);l=(d.then?(await d)():d)[0];let c,h=t=>t;const p="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",u="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class f extends n.WF{render(){var t;return(0,n.qy)(c||(c=h` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))||"Back",this._icon,this.href,this.target,this.rel,this.download)}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===s.G.document.dir?u:p}}(0,r.Cg)([(0,i.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean})],f.prototype,"disabled",void 0),(0,r.Cg)([(0,i.MZ)()],f.prototype,"label",void 0),(0,r.Cg)([(0,i.MZ)()],f.prototype,"href",void 0),(0,r.Cg)([(0,i.MZ)()],f.prototype,"target",void 0),(0,r.Cg)([(0,i.MZ)()],f.prototype,"rel",void 0),(0,r.Cg)([(0,i.MZ)()],f.prototype,"download",void 0),(0,r.Cg)([(0,i.wk)()],f.prototype,"_icon",void 0),f=(0,r.Cg)([(0,i.EM)("ha-icon-button-arrow-prev")],f),o()}catch(c){o(c)}})},26300:function(t,e,a){a.a(t,async function(t,o){try{a.r(e),a.d(e,{HaIconButton:function(){return g}});a(62953);var r=a(40445),n=a(96196),i=a(77845),s=a(32288),l=a(18350),d=(a(67094),t([l]));l=(d.then?(await d)():d)[0];let c,h,p,u,f=t=>t;class g extends n.WF{render(){return(0,n.qy)(c||(c=f` <ha-button appearance="plain" variant="neutral" aria-label="${0}" title="${0}" aria-haspopup="${0}" .disabled="${0}" .iconTag="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"> ${0} </ha-button> `),(0,s.J)(this.label),(0,s.J)(this.hideTitle?void 0:this.label),(0,s.J)(this.ariaHasPopup),this.disabled,this.path?"ha-svg-icon":"span",this.href,this.target,this.rel,this.download,this.path?(0,n.qy)(h||(h=f`<ha-svg-icon .path="${0}"></ha-svg-icon>`),this.path):(0,n.qy)(p||(p=f`<span><slot></slot></span>`)))}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}g.shadowRootOptions={mode:"open",delegatesFocus:!0},g.styles=(0,n.AH)(u||(u=f`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var(
        --ha-icon-button-padding-inline,
        --ha-space-2
      );--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1}@media (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`)),(0,r.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],g.prototype,"disabled",void 0),(0,r.Cg)([(0,i.MZ)({type:String})],g.prototype,"path",void 0),(0,r.Cg)([(0,i.MZ)({type:String})],g.prototype,"label",void 0),(0,r.Cg)([(0,i.MZ)({type:String,attribute:"aria-haspopup"})],g.prototype,"ariaHasPopup",void 0),(0,r.Cg)([(0,i.MZ)({attribute:"hide-title",type:Boolean})],g.prototype,"hideTitle",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],g.prototype,"selected",void 0),(0,r.Cg)([(0,i.MZ)()],g.prototype,"href",void 0),(0,r.Cg)([(0,i.MZ)()],g.prototype,"target",void 0),(0,r.Cg)([(0,i.MZ)()],g.prototype,"rel",void 0),(0,r.Cg)([(0,i.MZ)()],g.prototype,"download",void 0),g=(0,r.Cg)([(0,i.EM)("ha-icon-button")],g),o()}catch(c){o(c)}})},2054:function(t,e,a){a.a(t,async function(t,e){try{a(16280),a(62953);var o=a(40445),r=a(96196),n=a(77845),i=a(1087),s=a(44249),l=a(26300),d=t([l]);l=(d.then?(await d)():d)[0];let c,h,p,u=t=>t;const f="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class g extends r.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return r.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return(0,r.qy)(c||(c=u` <ha-icon-button .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> ${0} `),this.hass.localize("ui.sidebar.sidebar_toggle"),f,this._toggleMenu,t?(0,r.qy)(h||(h=u`<div class="dot"></div>`)):"")}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const e=t.has("hass")?t.get("hass"):this.hass,a=t.has("narrow")?t.get("narrow"):this.narrow,o=!1===(null==e?void 0:e.kioskMode)&&(a||"always_hidden"===(null==e?void 0:e.dockedSidebar)),r=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&o===r||(this._show=r||this._alwaysVisible,r?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,s.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,i.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}g.styles=(0,r.AH)(p||(p=u`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`)),(0,o.Cg)([(0,n.MZ)({type:Boolean})],g.prototype,"narrow",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_hasNotifications",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_show",void 0),g=(0,o.Cg)([(0,n.EM)("ha-menu-button")],g),e()}catch(c){e(c)}})},67094:function(t,e,a){a.r(e),a.d(e,{HaSvgIcon:function(){return h}});var o=a(40445),r=a(96196),n=a(77845);let i,s,l,d,c=t=>t;class h extends r.WF{render(){return(0,r.JW)(i||(i=c` <svg viewBox="${0}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${0} ${0} </g> </svg>`),this.viewBox||"0 0 24 24",this.path?(0,r.JW)(s||(s=c`<path class="primary-path" d="${0}"></path>`),this.path):r.s6,this.secondaryPath?(0,r.JW)(l||(l=c`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):r.s6)}}h.styles=(0,r.AH)(d||(d=c`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`)),(0,o.Cg)([(0,n.MZ)()],h.prototype,"path",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"secondaryPath",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"viewBox",void 0),h=(0,o.Cg)([(0,n.EM)("ha-svg-icon")],h)},82e3:function(t,e,a){a.d(e,{D5:function(){return o},Fy:function(){return h},Gk:function(){return f},Hg:function(){return r},TJ:function(){return i},UQ:function(){return c},Y_:function(){return g},ds:function(){return u},e0:function(){return n},ec:function(){return p},go:function(){return l},n2:function(){return d},sq:function(){return s}});a(74423),a(18111),a(61701),a(33110),a(3362);const o=14881==a.j?`${location.protocol}//${location.host}`:null,r=t=>t.map(t=>{if("string"!==t.type)return t;switch(t.name){case"username":return{...t,autocomplete:"username",autofocus:!0};case"password":return{...t,autocomplete:"current-password"};case"code":return{...t,autocomplete:"one-time-code",autofocus:!0};default:return t}}),n=(t,e)=>t.callWS({type:"auth/sign_path",path:e}),i=()=>fetch("/auth/providers",{credentials:"same-origin"}),s=(t,e,a)=>fetch("/auth/login_flow",{method:"POST",credentials:"same-origin",body:JSON.stringify({client_id:t,handler:a,redirect_uri:e})}),l=(t,e)=>fetch(`/auth/login_flow/${t}`,{method:"POST",credentials:"same-origin",body:JSON.stringify(e)}),d=t=>fetch(`/auth/login_flow/${t}`,{method:"DELETE",credentials:"same-origin"}),c=(t,e,a,o)=>{t.includes("?")?t.endsWith("&")||(t+="&"):t+="?",t+=`code=${encodeURIComponent(e)}`,a&&(t+=`&state=${encodeURIComponent(a)}`),o&&(t+="&storeToken=true"),document.location.assign(t)},h=async(t,e,a,o)=>t.callWS({type:"config/auth_provider/homeassistant/create",user_id:e,username:a,password:o}),p=(t,e,a)=>t.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:e,new_password:a}),u=(t,e,a)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:e,password:a}),f=(t,e,a)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:e,username:a}),g=(t,e,a)=>t.callWS({type:"auth/delete_all_refresh_tokens",token_type:e,delete_current_token:a})},26571:function(t,e,a){a.d(e,{Al:function(){return n},KY:function(){return r},PN:function(){return l},dG:function(){return c},jm:function(){return d},m7:function(){return g},sR:function(){return h},t1:function(){return s},t2:function(){return u},x:function(){return f},yu:function(){return p}});var o=a(95350);const r=["bluetooth","dhcp","discovery","esphome","hardware","hassio","homekit","integration_discovery","mqtt","ssdp","unignore","usb","zeroconf"],n=["reauth"],i={"HA-Frontend-Base":`${location.protocol}//${location.host}`},s=(t,e,a)=>{var o;return t.callApi("POST","config/config_entries/flow",{handler:e,show_advanced_options:Boolean(null===(o=t.userData)||void 0===o?void 0:o.showAdvanced),entry_id:a},i)},l=(t,e)=>t.callApi("GET",`config/config_entries/flow/${e}`,void 0,i),d=(t,e,a)=>t.callApi("POST",`config/config_entries/flow/${e}`,a,i),c=(t,e,a)=>t.callWS({type:"config_entries/ignore_flow",flow_id:e,title:a}),h=(t,e)=>t.callApi("DELETE",`config/config_entries/flow/${e}`),p=(t,e)=>t.callApi("GET","config/config_entries/flow_handlers"+(e?`?type=${e}`:"")),u=t=>t.sendMessagePromise({type:"config_entries/flow/progress"}),f=(t,e)=>t.connection.subscribeMessage(t=>e(t),{type:"config_entries/flow/subscribe"}),g=(t,e)=>e.context.title_placeholders&&0!==Object.keys(e.context.title_placeholders).length?t(`component.${e.handler}.config.flow_title`,e.context.title_placeholders)||("name"in e.context.title_placeholders?e.context.title_placeholders.name:(0,o.p$)(t,e.handler)):(0,o.p$)(t,e.handler)},96204:function(t,e,a){a.d(e,{Dh:function(){return o},It:function(){return i},WV:function(){return n},g9:function(){return r}});const o=t=>t.callWS({type:"diagnostics/list"}),r=(t,e)=>t.callWS({type:"diagnostics/get",domain:e}),n=t=>`/api/diagnostics/config_entry/${t}`,i=(t,e)=>`/api/diagnostics/config_entry/${t}/device/${e}`},20505:function(t,e,a){a.d(e,{CE:function(){return n},CW:function(){return r},Er:function(){return o},pW:function(){return i}});const o=t=>t.callWS({type:"otbr/info"}),r=(t,e)=>t.callWS({type:"otbr/create_network",extended_address:e}),n=(t,e,a)=>t.callWS({type:"otbr/set_network",extended_address:e,dataset_id:a}),i=(t,e,a)=>t.callWS({type:"otbr/set_channel",extended_address:e,channel:a})},44249:function(t,e,a){a.d(e,{V:function(){return o}});a(62953);const o=(t,e)=>{const a=new r,o=t.subscribeMessage(t=>e(a.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{o.then(t=>null==t?void 0:t())}};class r{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications={...this.notifications,...t.notifications};return Object.values(this.notifications)}constructor(){this.notifications={}}}},16790:function(t,e,a){a.d(e,{It:function(){return s},W4:function(){return d},dy:function(){return i},l1:function(){return c},rY:function(){return l},sL:function(){return n},wm:function(){return r}});class o{processEvent(t){return"router_discovered"===t.type?this.routers[t.key]=t.data:"router_removed"===t.type&&delete this.routers[t.key],Object.values(this.routers)}constructor(){this.routers={}}}const r=(t,e)=>{const a=new o;return t.connection.subscribeMessage(t=>e(a.processEvent(t)),{type:"thread/discover_routers"})},n=t=>t.callWS({type:"thread/list_datasets"}),i=(t,e)=>t.callWS({type:"thread/get_dataset_tlv",dataset_id:e}),s=(t,e,a)=>t.callWS({type:"thread/add_dataset_tlv",source:e,tlv:a}),l=(t,e)=>t.callWS({type:"thread/delete_dataset",dataset_id:e}),d=(t,e)=>t.callWS({type:"thread/set_preferred_dataset",dataset_id:e}),c=(t,e,a,o)=>t.callWS({type:"thread/set_preferred_border_agent",dataset_id:e,border_agent_id:a,extended_address:o})},77763:function(t,e,a){a.d(e,{W:function(){return m}});a(89463),a(3362),a(62953);var o=a(96196),r=a(26571),n=a(95350),i=a(29094);let s,l,d,c,h,p,u,f,g,v=t=>t;const m=(t,e)=>(0,i.g)(t,e,{flowType:"config_flow",showDevices:!0,createFlow:async(t,a)=>{const[o]=await Promise.all([(0,r.t1)(t,a,e.entryId),t.loadFragmentTranslation("config"),t.loadBackendTranslation("config",a),t.loadBackendTranslation("selector",a),t.loadBackendTranslation("title",a)]);return o},fetchFlow:async(t,e)=>{const[a]=await Promise.all([(0,r.PN)(t,e),t.loadFragmentTranslation("config")]);return await Promise.all([t.loadBackendTranslation("config",a.handler),t.loadBackendTranslation("selector",a.handler),t.loadBackendTranslation("title",a.handler)]),a},handleFlowStep:r.jm,deleteFlow:r.sR,renderAbortDescription(t,e){const a=t.localize(`component.${e.translation_domain||e.handler}.config.abort.${e.reason}`,e.description_placeholders);return a?(0,o.qy)(s||(s=v` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),a):e.reason},renderShowFormStepHeader(t,e){return t.localize(`component.${e.translation_domain||e.handler}.config.step.${e.step_id}.title`,e.description_placeholders)||t.localize(`component.${e.handler}.title`)},renderShowFormStepDescription(t,e){const a=t.localize(`component.${e.translation_domain||e.handler}.config.step.${e.step_id}.description`,e.description_placeholders);return a?(0,o.qy)(l||(l=v` <ha-markdown .allowDataUrl="${0}" allow-svg breaks .content="${0}"></ha-markdown> `),"zwave_js"===e.handler,a):""},renderShowFormStepFieldLabel(t,e,a,o){var r;if("expandable"===a.type)return t.localize(`component.${e.handler}.config.step.${e.step_id}.sections.${a.name}.name`,e.description_placeholders)||a.name;const n=null!=o&&null!==(r=o.path)&&void 0!==r&&r[0]?`sections.${o.path[0]}.`:"";return t.localize(`component.${e.handler}.config.step.${e.step_id}.${n}data.${a.name}`,e.description_placeholders)||a.name},renderShowFormStepFieldHelper(t,e,a,r){var n;if("expandable"===a.type)return t.localize(`component.${e.translation_domain||e.handler}.config.step.${e.step_id}.sections.${a.name}.description`,e.description_placeholders);const i=null!=r&&null!==(n=r.path)&&void 0!==n&&n[0]?`sections.${r.path[0]}.`:"",s=t.localize(`component.${e.translation_domain||e.handler}.config.step.${e.step_id}.${i}data_description.${a.name}`,e.description_placeholders);return s?(0,o.qy)(d||(d=v`<ha-markdown breaks .content="${0}"></ha-markdown>`),s):""},renderShowFormStepFieldError(t,e,a){return t.localize(`component.${e.translation_domain||e.translation_domain||e.handler}.config.error.${a}`,e.description_placeholders)||a},renderShowFormStepFieldLocalizeValue(t,e,a){return t.localize(`component.${e.handler}.selector.${a}`)},renderShowFormStepSubmitButton(t,e){return t.localize(`component.${e.handler}.config.step.${e.step_id}.submit`)||t.localize("ui.panel.config.integrations.config_flow."+(!1===e.last_step?"next":"submit"))},renderExternalStepHeader(t,e){return t.localize(`component.${e.handler}.config.step.${e.step_id}.title`)||t.localize("ui.panel.config.integrations.config_flow.external_step.open_site")},renderExternalStepDescription(t,e){const a=t.localize(`component.${e.translation_domain||e.handler}.config.${e.step_id}.description`,e.description_placeholders);return(0,o.qy)(c||(c=v` <p> ${0} </p> ${0} `),t.localize("ui.panel.config.integrations.config_flow.external_step.description"),a?(0,o.qy)(h||(h=v` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),a):"")},renderCreateEntryDescription(t,e){const a=t.localize(`component.${e.translation_domain||e.handler}.config.create_entry.${e.description||"default"}`,e.description_placeholders);return(0,o.qy)(p||(p=v` ${0} `),a?(0,o.qy)(u||(u=v` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),a):o.s6)},renderShowFormProgressHeader(t,e){return t.localize(`component.${e.handler}.config.step.${e.step_id}.title`)||t.localize(`component.${e.handler}.title`)},renderShowFormProgressDescription(t,e){const a=t.localize(`component.${e.translation_domain||e.handler}.config.progress.${e.progress_action}`,e.description_placeholders);return a?(0,o.qy)(f||(f=v` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),a):""},renderMenuHeader(t,e){return t.localize(`component.${e.handler}.config.step.${e.step_id}.title`)||t.localize(`component.${e.handler}.title`)},renderMenuDescription(t,e){const a=t.localize(`component.${e.translation_domain||e.handler}.config.step.${e.step_id}.description`,e.description_placeholders);return a?(0,o.qy)(g||(g=v` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),a):""},renderMenuOption(t,e,a){return t.localize(`component.${e.translation_domain||e.handler}.config.step.${e.step_id}.menu_options.${a}`,e.description_placeholders)},renderMenuOptionDescription(t,e,a){return t.localize(`component.${e.translation_domain||e.handler}.config.step.${e.step_id}.menu_option_descriptions.${a}`,e.description_placeholders)},renderLoadingDescription(t,e,a,o){if("loading_flow"!==e&&"loading_step"!==e)return"";const r=(null==o?void 0:o.handler)||a;return t.localize(`ui.panel.config.integrations.config_flow.loading.${e}`,{integration:r?(0,n.p$)(t.localize,r):t.localize("ui.panel.config.integrations.config_flow.loading.fallback_title")})}})},29094:function(t,e,a){a.d(e,{g:function(){return n}});a(3362),a(62953);var o=a(1087);const r=()=>Promise.all([a.e("62066"),a.e("46095"),a.e("31065"),a.e("30628"),a.e("92769"),a.e("83431"),a.e("62453"),a.e("89385"),a.e("19942"),a.e("17040"),a.e("61153"),a.e("20253"),a.e("83798"),a.e("78398"),a.e("39005"),a.e("78547"),a.e("40524")]).then(a.bind(a,78314)),n=(t,e,a)=>{(0,o.r)(t,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:r,dialogParams:Object.assign(Object.assign({},e),{},{flowConfig:a,dialogParentElement:t})})}},81310:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var o=a(40445),r=a(96196),n=a(77845),i=a(94333),s=a(26218),l=a(91926),d=a(90248),c=a(2054),h=a(14503),p=t([d,c]);[d,c]=p.then?(await p)():p;let u,f,g,v,m,b=t=>t;class _ extends r.WF{render(){var t;return(0,r.qy)(u||(u=b` <div class="toolbar ${0}"> <div class="toolbar-content"> ${0} <div class="main-title"> <slot name="header">${0}</slot> </div> <slot name="toolbar-icon"></slot> </div> </div> <div class="content ha-scrollbar" @scroll="${0}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `),(0,i.H)({narrow:this.narrow}),this.mainPage||null!==(t=history.state)&&void 0!==t&&t.root?(0,r.qy)(f||(f=b` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):this.backPath?(0,r.qy)(g||(g=b` <ha-icon-button-arrow-prev href="${0}" .hass="${0}"></ha-icon-button-arrow-prev> `),this.backPath,this.hass):(0,r.qy)(v||(v=b` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.header,this._saveScrollPos)}_saveScrollPos(t){this._savedScrollPos=t.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,l.O)()}static get styles(){return[h.dp,(0,r.AH)(m||(m=b`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{background-color:var(--app-header-background-color);padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right)}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box;padding:8px 12px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;align-items:center;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin-inline-start:var(--ha-space-6);line-height:var(--ha-line-height-normal);min-width:0;flex-grow:1;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.narrow .main-title{margin-inline-start:var(--ha-space-2)}.content{position:relative;width:calc(100% - var(--safe-area-inset-right,0px));height:calc(100% - 1px - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));padding-bottom:var(--safe-area-inset-bottom,0px);margin-right:var(--safe-area-inset-right);overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}:host([narrow]) .content{width:calc(100% - var(--safe-area-inset-left,0px) - var(--safe-area-inset-right,0px));margin-left:var(--safe-area-inset-left)}#fab{position:absolute;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right,0px));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2)}:host([narrow]) #fab.tabs{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:calc(24px + var(--safe-area-inset-bottom,0px));right:calc(24px + var(--safe-area-inset-right,0px));inset-inline-end:calc(24px + var(--safe-area-inset-right,0px));inset-inline-start:initial}`))]}constructor(...t){super(...t),this.mainPage=!1,this.narrow=!1}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)()],_.prototype,"header",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,attribute:"main-page"})],_.prototype,"mainPage",void 0),(0,o.Cg)([(0,n.MZ)({type:String,attribute:"back-path"})],_.prototype,"backPath",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"backCallback",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],_.prototype,"narrow",void 0),(0,o.Cg)([(0,s.a)(".content")],_.prototype,"_savedScrollPos",void 0),(0,o.Cg)([(0,n.Ls)({passive:!0})],_.prototype,"_saveScrollPos",null),_=(0,o.Cg)([(0,n.EM)("hass-subpage")],_),e()}catch(u){e(u)}})},81540:function(t,e,a){a.d(e,{s:function(){return r}});a(3362),a(62953);var o=a(1087);const r=(t,e)=>{(0,o.r)(t,"show-dialog",{dialogTag:"ha-dialog-thread-dataset",dialogImport:()=>Promise.all([a.e("44778"),a.e("2351")]).then(a.bind(a,64946)),dialogParams:e})}},99954:function(t,e,a){a.a(t,async function(t,o){try{a.r(e),a.d(e,{ThreadConfigPanel:function(){return Q}});a(44114),a(26910),a(18111),a(20116),a(61701),a(3362),a(27495),a(25440),a(62953);var r=a(40445),n=a(96196),i=a(77845),s=a(22786),l=a(36312),d=a(52220),c=a(6030),h=a(18350),p=(a(76776),a(29823)),u=(a(70947),a(82e3)),f=a(96204),g=a(20505),v=a(16790),m=a(77763),b=a(65063),_=a(81310),w=a(54706),y=a(14503),x=a(44144),$=a(36918),k=a(30039),C=a(81540),z=t([h,p,_]);[h,p,_]=z.then?(await z)():z;let M,A,H,S,T,E,V,B,q,Z,P,D,I,W,F,L,O,U,N,j=t=>t;const R="M7 1C5.9 1 5 1.9 5 3V7H7V4H17V20H7V17H5V21C5 22.1 5.9 23 7 23H17C18.1 23 19 22.1 19 21V3C19 1.9 18.1 1 17 1H7M6 9C4.3 9 3 10.3 3 12S4.3 15 6 15C7.3 15 8.4 14.2 8.8 13H11V15H13V13H15V11H8.8C8.4 9.8 7.3 9 6 9M6 11C6.6 11 7 11.4 7 12S6.6 13 6 13 5 12.6 5 12 5.4 11 6 11Z",J="M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z",Y="M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",G="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",K="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z";class Q extends((0,w.E)(n.WF)){render(){var t;const e=this._groupRoutersByNetwork(this._routers,this._datasets);return(0,n.qy)(M||(M=j` <hass-subpage .narrow="${0}" .hass="${0}" header="Thread" back-path="/config"> <ha-dropdown slot="toolbar-icon"> <ha-icon-button .path="${0}" slot="trigger" .label="${0}"></ha-icon-button> <a href="${0}" target="_blank" @click="${0}"> <ha-dropdown-item> ${0} </ha-dropdown-item> </a> <ha-dropdown-item @click="${0}">${0}</ha-dropdown-item> <ha-dropdown-item @click="${0}">${0}</ha-dropdown-item> </ha-dropdown> <div class="content"> <h1>${0}</h1> ${0} ${0} </div> ${0} </hass-subpage> `),this.narrow,this.hass,G,this.hass.localize("ui.common.menu"),(0,f.WV)(this._configEntryId||""),this._signUrl,this.hass.localize("ui.panel.config.integrations.config_entry.download_diagnostics"),this._addTLV,this.hass.localize("ui.panel.config.thread.add_dataset_from_tlv"),this._addOTBR,this.hass.localize("ui.panel.config.thread.add_open_thread_border_router"),this.hass.localize("ui.panel.config.thread.my_network"),e.preferred?this._renderNetwork(e.preferred):(0,n.qy)(A||(A=j`<ha-card> <div class="card-content no-routers"> <h3> ${0} </h3> <ha-svg-icon .path="${0}"></ha-svg-icon> <ha-button appearance="plain" size="small" href="${0}" target="_blank"> ${0}</ha-button> </div> </ha-card>`),this.hass.localize("ui.panel.config.thread.no_preferred_network"),Y,(0,$.o)(this.hass,"/integrations/thread"),this.hass.localize("ui.panel.config.thread.more_info")),e.networks.length?(0,n.qy)(H||(H=j`<h3> ${0} </h3> ${0}`),this.hass.localize("ui.panel.config.thread.other_networks"),e.networks.map(t=>this._renderNetwork(t))):"",null!==(t=this.hass.auth.external)&&void 0!==t&&t.config.canImportThreadCredentials?(0,n.qy)(S||(S=j`<ha-fab slot="fab" @click="${0}" extended .label="${0}"><ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon></ha-fab>`),this._importExternalThreadCredentials,this.hass.localize("ui.panel.config.thread.thread_network_send_credentials_ha"),R):n.s6)}_renderNetwork(t){var e,a,o,r,i;const s=this._otbrInfo&&t.dataset&&(t.dataset.preferred_extended_address&&this._otbrInfo[t.dataset.preferred_extended_address]||Object.values(this._otbrInfo).find(e=>e.extended_pan_id===t.dataset.extended_pan_id)),l=null===(e=this.hass.auth.external)||void 0===e?void 0:e.config.canTransferThreadCredentialsToKeychain;return(0,n.qy)(T||(T=j`<ha-card> <div class="card-header"> ${0}${0} </div> ${0} ${0} ${0} </ha-card>`),t.name,t.dataset?(0,n.qy)(E||(E=j`<div> <ha-icon-button .label="${0}" .otbr="${0}" .network="${0}" .path="${0}" @click="${0}"></ha-icon-button>${0} </div>`),this.hass.localize("ui.panel.config.thread.thread_network_info"),s,t,K,this._showDatasetInfo,t.dataset.preferred||null!==(a=t.routers)&&void 0!==a&&a.length?"":(0,n.qy)(V||(V=j`<ha-icon-button .label="${0}" .networkDataset="${0}" .path="${0}" @click="${0}"></ha-icon-button>`),this.hass.localize("ui.panel.config.thread.thread_network_delete_credentials"),t.dataset,J,this._removeDataset)):"",null!==(o=t.routers)&&void 0!==o&&o.length?(0,n.qy)(B||(B=j`<div class="card-content routers"> <h4> ${0} </h4> </div> ${0}`),this.hass.localize("ui.panel.config.thread.border_routers",{count:t.routers.length}),t.routers.map(e=>{var a,o,r;const i=this._otbrInfo&&this._otbrInfo[e.extended_address],s=!!t.dataset,l=s&&e.extended_address===t.dataset.preferred_extended_address,d=s||i;return(0,n.qy)(q||(q=j`<ha-list-item class="router" twoline graphic="avatar" .hasMeta="${0}"> <img slot="graphic" .src="${0}" alt="${0}" crossorigin="anonymous" referrerpolicy="no-referrer" @error="${0}" @load="${0}"> ${0} <span slot="secondary">${0}</span> ${0} </ha-list-item>`),d,(0,x.MR)({domain:e.brand,type:"icon",darkOptimized:null===(a=this.hass.themes)||void 0===a?void 0:a.darkMode},this.hass.auth.data.hassUrl),e.brand,this._onImageError,this._onImageLoad,e.instance_name||e.model_name||(null===(o=e.server)||void 0===o?void 0:o.replace(".local.",""))||"",e.server,d?(0,n.qy)(Z||(Z=j`${0} <ha-dropdown slot="meta" .network="${0}" .router="${0}" .otbr="${0}" @wa-select="${0}"> <ha-icon-button .label="${0}" .path="${0}" slot="trigger"></ha-icon-button> ${0} ${0} </ha-dropdown>`),l?(0,n.qy)(P||(P=j`<ha-svg-icon .path="${0}" .title="${0}"></ha-svg-icon>`),R,this.hass.localize("ui.panel.config.thread.default_router")):"",t,e,i,this._handleRouterAction,this.hass.localize("ui.common.overflow_menu"),G,s?(0,n.qy)(D||(D=j`<ha-dropdown-item value="set-default" .disabled="${0}"> ${0} </ha-dropdown-item>`),l,l?this.hass.localize("ui.panel.config.thread.default_router"):this.hass.localize("ui.panel.config.thread.set_default_router")):"",i?(0,n.qy)(I||(I=j`<ha-dropdown-item value="reset-router"> ${0}</ha-dropdown-item> <ha-dropdown-item value="change-channel"> ${0}</ha-dropdown-item> ${0}`),this.hass.localize("ui.panel.config.thread.reset_border_router"),this.hass.localize("ui.panel.config.thread.change_channel"),null!==(r=t.dataset)&&void 0!==r&&r.preferred?"":(0,n.qy)(W||(W=j`<ha-dropdown-item value="add-to-network"> ${0} </ha-dropdown-item>`),this.hass.localize("ui.panel.config.thread.add_to_my_network"))):""):"")})):(0,n.qy)(F||(F=j`<div class="card-content no-routers"> <ha-svg-icon .path="${0}"></ha-svg-icon> ${0} </div> `),Y,s?(0,n.qy)(L||(L=j`${0} <ha-button appearance="plain" size="small" .otbr="${0}" @click="${0}">${0}</ha-button>`),this.hass.localize("ui.panel.config.thread.no_routers_otbr_network"),s,this._resetBorderRouterEvent,this.hass.localize("ui.panel.config.thread.reset_border_router")):this.hass.localize("ui.panel.config.thread.no_border_routers")),t.dataset&&!t.dataset.preferred?(0,n.qy)(O||(O=j`<div class="card-actions"> <ha-button .datasetId="${0}" @click="${0}">${0}</ha-button> </div>`),t.dataset.dataset_id,this._setPreferred,this.hass.localize("ui.panel.config.thread.thread_network_make_preferred")):"",l&&null!==(r=t.dataset)&&void 0!==r&&r.preferred&&null!==(i=t.routers)&&void 0!==i&&i.length?(0,n.qy)(U||(U=j`<div class="card-actions"> <ha-button size="small" .networkDataset="${0}" @click="${0}">${0}</ha-button> </div>`),t.dataset,this._sendCredentials,this.hass.localize("ui.panel.config.thread.thread_network_send_credentials_phone")):"")}async _sendCredentials(t){const e=t.currentTarget.networkDataset;e&&(e.preferred_extended_address||e.preferred_border_agent_id?this.hass.auth.external.fireMessage({type:"thread/store_in_platform_keychain",payload:{mac_extended_address:e.preferred_extended_address,border_agent_id:e.preferred_border_agent_id,active_operational_dataset:(await(0,v.dy)(this.hass,e.dataset_id)).tlv,extended_pan_id:e.extended_pan_id}}):(0,b.showAlertDialog)(this,{title:"Error",text:this.hass.localize("ui.panel.config.thread.no_preferred_router")}))}async _showDatasetInfo(t){const e=t.currentTarget.network,a=t.currentTarget.otbr;(0,C.s)(this,{network:e,otbrInfo:a})}_importExternalThreadCredentials(){this.hass.auth.external.fireMessage({type:"thread/import_credentials"})}_onImageError(t){t.target.style.display="none"}_onImageLoad(t){t.target.style.display=""}hassSubscribe(){return[(0,v.wm)(this.hass,t=>{this._routers=t})]}firstUpdated(t){super.firstUpdated(t),this._refresh(),this._configEntryId=(0,c.p9)("config_entry")}async _refresh(){if((0,v.sL)(this.hass).then(t=>{this._datasets=t.datasets}),(0,l.x)(this.hass,"otbr"))try{this._otbrInfo=await(0,g.Er)(this.hass)}catch(t){this._otbrInfo=void 0}}async _signUrl(t){const e=t.target.closest("a");t.preventDefault();const a=await(0,u.e0)(this.hass,e.getAttribute("href"));(0,k.R)(a.path)}_addOTBR(){var t;(0,m.W)(this,{dialogClosedCallback:()=>{this._refresh()},startFlowHandler:"otbr",showAdvanced:null===(t=this.hass.userData)||void 0===t?void 0:t.showAdvanced})}_handleRouterAction(t){const e=t.currentTarget.network,a=t.currentTarget.router,o=t.currentTarget.otbr;switch(t.detail.item.value){case"set-default":this._setPreferredBorderAgent(e.dataset,a);break;case"reset-router":this._resetBorderRouter(o);break;case"change-channel":this._changeChannel(o);break;case"add-to-network":this._setDataset(o)}}_resetBorderRouterEvent(t){const e=t.currentTarget.otbr;this._resetBorderRouter(e)}async _resetBorderRouter(t){if(await(0,b.dk)(this,{title:this.hass.localize("ui.panel.config.thread.confirm_reset_border_router"),text:this.hass.localize("ui.panel.config.thread.confirm_reset_border_router_text")})){try{await(0,g.CW)(this.hass,t.extended_address)}catch(e){(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.otbr_config_failed"),text:e.message})}this._refresh()}}async _setDataset(t){var e;const a=null===(e=this._groupRoutersByNetwork(this._routers,this._datasets).preferred)||void 0===e||null===(e=e.dataset)||void 0===e?void 0:e.dataset_id;if(!a)return;if(await(0,b.dk)(this,{title:this.hass.localize("ui.panel.config.thread.confirm_set_dataset_border_router"),text:this.hass.localize("ui.panel.config.thread.confirm_set_dataset_border_router_text")})){try{await(0,g.CE)(this.hass,t.extended_address,a)}catch(o){(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.otbr_config_failed"),text:o.message})}this._refresh()}}async _setPreferred(t){const e=t.target.datasetId;await(0,v.W4)(this.hass,e),this._refresh()}async _setPreferredBorderAgent(t,e){await(0,v.l1)(this.hass,t.dataset_id,e.border_agent_id,e.extended_address),this._refresh()}async _addTLV(){const t=await(0,b.an)(this,{title:this.hass.localize("ui.panel.config.thread.add_dataset"),inputLabel:this.hass.localize("ui.panel.config.thread.add_dataset_label"),confirmText:this.hass.localize("ui.panel.config.thread.add_dataset_button")});if(t){try{await(0,v.It)(this.hass,"manual",t)}catch(e){(0,b.showAlertDialog)(this,{title:"Error",text:e.message||e})}this._refresh()}}async _removeDataset(t){const e=t.currentTarget.networkDataset;if(await(0,b.dk)(this,{title:this.hass.localize("ui.panel.config.thread.confirm_delete_dataset",{name:e.network_name}),text:this.hass.localize("ui.panel.config.thread.confirm_delete_dataset_text"),destructive:!0,confirmText:this.hass.localize("ui.common.delete")})){try{await(0,v.rY)(this.hass,e.dataset_id)}catch(a){(0,b.showAlertDialog)(this,{title:"Error",text:a.message||a})}this._refresh()}}async _changeChannel(t){const e=t.channel,a=await(0,b.an)(this,{title:this.hass.localize("ui.panel.config.thread.change_channel"),text:this.hass.localize("ui.panel.config.thread.change_channel_text"),inputLabel:this.hass.localize("ui.panel.config.thread.change_channel_label"),confirmText:this.hass.localize("ui.panel.config.thread.change_channel"),inputType:"number",inputMin:"11",inputMax:"26",defaultValue:e?e.toString():void 0});if(!a)return;const o=parseInt(a);if(o<11||o>26)(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.change_channel_invalid"),text:this.hass.localize("ui.panel.config.thread.change_channel_range")});else{try{const e=await(0,g.pW)(this.hass,t.extended_address,o);(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.change_channel_initiated_title"),text:this.hass.localize("ui.panel.config.thread.change_channel_initiated_text",{delay:Math.floor(e.delay/60)})})}catch(r){if("multiprotocol_enabled"===r.code)return void(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.change_channel_multiprotocol_enabled_title"),text:this.hass.localize("ui.panel.config.thread.change_channel_multiprotocol_enabled_text")});(0,b.showAlertDialog)(this,{title:"Error",text:r.message||r})}this._refresh()}}constructor(...t){super(...t),this.narrow=!1,this._configEntryId=null,this._routers=[],this._datasets=[],this._groupRoutersByNetwork=(0,s.A)((t,e)=>{let a;const o={};for(const n of t){const t=n.extended_pan_id;t in o?o[t].routers.push(n):o[t]={name:n.network_name||"",routers:[n]}}for(const n of e){const t=n.extended_pan_id;var r;if(t)if(n.preferred)a={name:n.network_name,dataset:n,routers:null===(r=o[t])||void 0===r?void 0:r.routers},delete o[t];else t in o?o[t].dataset=n:o[t]={name:n.network_name,dataset:n}}return{preferred:a,networks:Object.values(o).sort((t,e)=>(0,d.xL)(t.name,e.name,this.hass.locale.language))}})}}Q.styles=[y.RF,(0,n.AH)(N||(N=j`.content{padding:24px 8px 32px;max-width:600px;margin:0 auto;direction:ltr}ha-list-item.router{--mdc-list-item-meta-size:auto;--mdc-list-item-meta-display:flex;--mdc-list-side-padding:16px;cursor:default;overflow:visible}ha-list-item img{border-radius:var(--ha-border-radius-square)}ha-svg-icon[slot=meta]{width:24px}ha-dropdown a{text-decoration:none}.routers{padding-bottom:0}.no-routers{display:flex;flex-direction:column;align-items:center;text-align:center}.no-routers ha-svg-icon{background-color:var(--light-primary-color);color:var(--secondary-text-color);padding:16px;border-radius:var(--ha-border-radius-circle);margin-bottom:8px}ha-card{margin-bottom:16px}h4{margin:0}.card-header{display:flex;justify-content:space-between}`))],(0,r.Cg)([(0,i.MZ)({attribute:!1})],Q.prototype,"hass",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean})],Q.prototype,"narrow",void 0),(0,r.Cg)([(0,i.wk)()],Q.prototype,"_configEntryId",void 0),(0,r.Cg)([(0,i.wk)()],Q.prototype,"_routers",void 0),(0,r.Cg)([(0,i.wk)()],Q.prototype,"_datasets",void 0),(0,r.Cg)([(0,i.wk)()],Q.prototype,"_otbrInfo",void 0),Q=(0,r.Cg)([(0,i.EM)("thread-config-panel")],Q),o()}catch(M){o(M)}})},69235:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await a.e("71055").then(a.bind(a,52370))).default),e()}catch(o){e(o)}},1)},14503:function(t,e,a){a.d(e,{RF:function(){return p},dp:function(){return g},kO:function(){return f},nA:function(){return u},og:function(){return h}});var o=a(96196);let r,n,i,s,l,d,c=t=>t;const h=(0,o.AH)(r||(r=c`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`)),p=(0,o.AH)(n||(n=c`:host{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease}@media (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${0} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`),h),u=(0,o.AH)(i||(i=c`
  ha-dialog,
  ha-adaptive-dialog {
    --mdc-dialog-min-width: 400px;
    --mdc-dialog-max-width: 600px;
    --mdc-dialog-max-width: min(600px, 95vw);
    --justify-action-buttons: space-between;
    --dialog-container-padding: var(--safe-area-inset-top, 0)
      var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0)
      var(--safe-area-inset-left, 0);
    --dialog-surface-padding: 0px;
  }

  ha-dialog .form,
  ha-adaptive-dialog .form {
    color: var(--primary-text-color);
  }

  a {
    color: var(--primary-color);
  }

  /* make dialog fullscreen on small screens */
  @media all and (max-width: 450px), all and (max-height: 500px) {
    ha-dialog,
    ha-adaptive-dialog {
      --mdc-dialog-min-width: 100vw;
      --mdc-dialog-max-width: 100vw;
      --mdc-dialog-min-height: 100vh;
      --mdc-dialog-min-height: 100svh;
      --mdc-dialog-max-height: 100vh;
      --mdc-dialog-max-height: 100svh;
      --dialog-container-padding: 0px;
      --dialog-surface-padding: var(--safe-area-inset-top, 0)
        var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0)
        var(--safe-area-inset-left, 0);
      --vertical-align-dialog: flex-end;
      --ha-dialog-border-radius: var(--ha-border-radius-square);
    ha-dialog,
    ha-adaptive-dialog {
     --mdc-dialog-min-width: 100vw;
     --mdc-dialog-max-width: 100vw;
     --mdc-dialog-min-height: 100vh;
     --mdc-dialog-min-height: 100svh;
     --mdc-dialog-max-height: 100vh;
     --mdc-dialog-max-height: 100svh;
     --dialog-container-padding: 0px;
     --dialog-surface-padding: var(--safe-area-inset-top, 0)
       var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0)
       var(--safe-area-inset-left, 0);
     --vertical-align-dialog: flex-end;
   }
   ha-dialog {
      --ha-dialog-border-radius: var(--ha-border-radius-square);
   }
  }
  .error {
    color: var(--error-color);
  }
`)),f=(0,o.AH)(s||(s=c`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc(
      100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--mdc-dialog-max-height:calc(
      100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--ha-dialog-max-height:calc(
      100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--ha-dialog-max-height:calc(
      100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    )}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`)),g=(0,o.AH)(l||(l=c`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`));(0,o.AH)(d||(d=c`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`))},36918:function(t,e,a){a.d(e,{o:function(){return o}});a(74423);const o=(t,e)=>`https://${t.config.version.includes("b")?"rc":t.config.version.includes("dev")?"next":"www"}.home-assistant.io${e}`},30039:function(t,e,a){a.d(e,{R:function(){return o}});const o=(t,e="")=>{const a=document.createElement("a");a.target="_blank",a.href=t,a.download=e,a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a)}},63463:function(t){var e=TypeError;t.exports=function(t){if("string"==typeof t)return t;throw new e("Argument is not a string")}},83972:function(t,e,a){var o=a(20034),r=String,n=TypeError;t.exports=function(t){if(void 0===t||o(t))return t;throw new n(r(t)+" is not an object or undefined")}},34154:function(t,e,a){var o=a(36955),r=TypeError;t.exports=function(t){if("Uint8Array"===o(t))return t;throw new r("Argument is not an Uint8Array")}},35370:function(t,e,a){var o=a(26198);t.exports=function(t,e,a){for(var r=0,n=arguments.length>2?a:o(e),i=new t(n);n>r;)i[r]=e[r++];return i}},92804:function(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=e+"+/",o=e+"-_",r=function(t){for(var e={},a=0;a<64;a++)e[t.charAt(a)]=a;return e};t.exports={i2c:a,c2i:r(a),i2cUrl:o,c2iUrl:r(o)}},944:function(t){var e=TypeError;t.exports=function(t){var a=t&&t.alphabet;if(void 0===a||"base64"===a||"base64url"===a)return a||"base64";throw new e("Incorrect `alphabet` option")}},59143:function(t,e,a){var o=a(44576),r=a(79504),n=a(83972),i=a(63463),s=a(39297),l=a(92804),d=a(944),c=a(55169),h=l.c2i,p=l.c2iUrl,u=o.SyntaxError,f=o.TypeError,g=r("".charAt),v=function(t,e){for(var a=t.length;e<a;e++){var o=g(t,e);if(" "!==o&&"\t"!==o&&"\n"!==o&&"\f"!==o&&"\r"!==o)break}return e},m=function(t,e,a){var o=t.length;o<4&&(t+=2===o?"AA":"A");var r=(e[g(t,0)]<<18)+(e[g(t,1)]<<12)+(e[g(t,2)]<<6)+e[g(t,3)],n=[r>>16&255,r>>8&255,255&r];if(2===o){if(a&&0!==n[1])throw new u("Extra bits");return[n[0]]}if(3===o){if(a&&0!==n[2])throw new u("Extra bits");return[n[0],n[1]]}return n},b=function(t,e,a){for(var o=e.length,r=0;r<o;r++)t[a+r]=e[r];return a+o};t.exports=function(t,e,a,o){i(t),n(e);var r="base64"===d(e)?h:p,l=e?e.lastChunkHandling:void 0;if(void 0===l&&(l="loose"),"loose"!==l&&"strict"!==l&&"stop-before-partial"!==l)throw new f("Incorrect `lastChunkHandling` option");a&&c(a.buffer);var _=t.length,w=a||[],y=0,x=0,$="",k=0;if(o)for(;;){if((k=v(t,k))===_){if($.length>0){if("stop-before-partial"===l)break;if("loose"!==l)throw new u("Missing padding");if(1===$.length)throw new u("Malformed padding: exactly one additional character");y=b(w,m($,r,!1),y)}x=_;break}var C=g(t,k);if(++k,"="===C){if($.length<2)throw new u("Padding is too early");if(k=v(t,k),2===$.length){if(k===_){if("stop-before-partial"===l)break;throw new u("Malformed padding: only one =")}"="===g(t,k)&&(++k,k=v(t,k))}if(k<_)throw new u("Unexpected character after padding");y=b(w,m($,r,"strict"===l),y),x=_;break}if(!s(r,C))throw new u("Unexpected character");var z=o-y;if(1===z&&2===$.length||2===z&&3===$.length)break;if(4===($+=C).length&&(y=b(w,m($,r,!1),y),$="",x=k,y===o))break}return{bytes:w,read:x,written:y}}},42303:function(t,e,a){var o=a(44576),r=a(79504),n=o.Uint8Array,i=o.SyntaxError,s=o.parseInt,l=Math.min,d=/[^\da-f]/i,c=r(d.exec),h=r("".slice);t.exports=function(t,e){var a=t.length;if(a%2!=0)throw new i("String should be an even number of characters");for(var o=e?l(e.length,a/2):a/2,r=e||new n(o),p=0,u=0;u<o;){var f=h(t,p,p+=2);if(c(d,f))throw new i("String should only contain hex characters");r[u++]=s(f,16)}return{bytes:r,read:p}}},54743:function(t,e,a){var o=a(46518),r=a(44576),n=a(66346),i=a(87633),s="ArrayBuffer",l=n[s];o({global:!0,constructor:!0,forced:r[s]!==l},{ArrayBuffer:l}),i(s)},11745:function(t,e,a){var o=a(46518),r=a(27476),n=a(79039),i=a(66346),s=a(28551),l=a(35610),d=a(18014),c=i.ArrayBuffer,h=i.DataView,p=h.prototype,u=r(c.prototype.slice),f=r(p.getUint8),g=r(p.setUint8);o({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:n(function(){return!new c(2).slice(1,void 0).byteLength})},{slice:function(t,e){if(u&&void 0===e)return u(s(this),t);for(var a=s(this).byteLength,o=l(t,a),r=l(void 0===e?a:e,a),n=new c(d(r-o)),i=new h(this),p=new h(n),v=0;o<r;)g(p,v++,f(i,o++));return n}})},21489:function(t,e,a){a(15823)("Uint8",function(t){return function(e,a,o){return t(this,e,a,o)}})},16632:function(t,e,a){var o=a(46518),r=a(44576),n=a(59143),i=a(34154),s=r.Uint8Array,l=!s||!s.prototype.setFromBase64||!function(){var t=new s([255,255,255,255,255]);try{return void t.setFromBase64("",null)}catch(e){}try{return void t.setFromBase64("a")}catch(e){}try{t.setFromBase64("MjYyZg===")}catch(e){return 50===t[0]&&54===t[1]&&50===t[2]&&255===t[3]&&255===t[4]}}();s&&o({target:"Uint8Array",proto:!0,forced:l},{setFromBase64:function(t){i(this);var e=n(t,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:e.read,written:e.written}}})},34226:function(t,e,a){var o=a(46518),r=a(44576),n=a(63463),i=a(34154),s=a(55169),l=a(42303);r.Uint8Array&&o({target:"Uint8Array",proto:!0,forced:function(){try{var t=new ArrayBuffer(16,{maxByteLength:1024});new Uint8Array(t).setFromHex("cafed00d")}catch(e){return!0}}()},{setFromHex:function(t){i(this),n(t),s(this.buffer);var e=l(t,this).read;return{read:e,written:e/2}}})},9486:function(t,e,a){var o=a(46518),r=a(44576),n=a(79504),i=a(83972),s=a(34154),l=a(55169),d=a(92804),c=a(944),h=d.i2c,p=d.i2cUrl,u=n("".charAt),f=r.Uint8Array,g=!f||!f.prototype.toBase64||!function(){try{(new f).toBase64(null)}catch(t){return!0}}();f&&o({target:"Uint8Array",proto:!0,forced:g},{toBase64:function(){var t=s(this),e=arguments.length?i(arguments[0]):void 0,a="base64"===c(e)?h:p,o=!!e&&!!e.omitPadding;l(this.buffer);for(var r,n="",d=0,f=t.length,g=function(t){return u(a,r>>6*t&63)};d+2<f;d+=3)r=(t[d]<<16)+(t[d+1]<<8)+t[d+2],n+=g(3)+g(2)+g(1)+g(0);return d+2===f?(r=(t[d]<<16)+(t[d+1]<<8),n+=g(3)+g(2)+g(1)+(o?"":"=")):d+1===f&&(r=t[d]<<16,n+=g(3)+g(2)+(o?"":"==")),n}})},20456:function(t,e,a){var o=a(46518),r=a(44576),n=a(79504),i=a(34154),s=a(55169),l=n(1.1.toString),d=r.Uint8Array,c=!d||!d.prototype.toHex||!function(){try{return"ffffffffffffffff"===new d([255,255,255,255,255,255,255,255]).toHex()}catch(t){return!1}}();d&&o({target:"Uint8Array",proto:!0,forced:c},{toHex:function(){i(this),s(this.buffer);for(var t="",e=0,a=this.length;e<a;e++){var o=l(this[e],16);t+=1===o.length?"0"+o:o}return t}})}}]);
//# sourceMappingURL=68622.3fc248611f745b3e.js.map