iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
16 lines • 31.4 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[32340],{93421:function(t,e,o){o.d(e,{IW:function(){return d},dH:function(){return c},fI:function(){return l}});o(44114),o(62953);var a=o(35211),n=o(22792),i=o(32172);const r=(t,e)=>{let o=t;for(const a of e){if(null==o)return;o=o[a]}return o},s=(t,e,o)=>{const n=(0,i.p)({transformer:function(t){return o.call(this,t)},watch:e?[e]:[]}),r=(0,a.Fg)({context:t,subscribe:!0});return(t,e)=>{n(t,e),r(t,e)}},l=t=>s(n.iN,t.entityIdPath[0],function(e){const o=r(this,t.entityIdPath);return"string"==typeof o?null==e?void 0:e[o]:void 0}),c=t=>s(n.X1,t.entityIdPath[0],function(e){const o=r(this,t.entityIdPath);return"string"==typeof o?null==e?void 0:e[o]:void 0}),d=()=>s(n.D5,void 0,({localize:t})=>t)},32172:function(t,e,o){o.d(e,{p:function(){return a}});o(16280),o(18111),o(7588),o(45367),o(92731),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(62953);function a(t){return(e,o)=>{if("object"==typeof o)throw new Error("This decorator does not support this compilation type.");const a=String(o),n=e;if(n._transformers){if(!n.hasOwnProperty("_transformers")){const t=n._transformers;n._transformers=new Map,t.forEach((t,e)=>n._transformers.set(e,t))}}else{n._transformers=new Map,n._watching=new Map;const t=n.willUpdate;n.willUpdate=function(e){t.call(this,e);const o=new Set;e.forEach((t,e)=>{const a=this._watching.get(e);void 0!==a&&a.forEach(t=>o.add(t))}),o.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}n._transformers.set(o,t.transformer),t.watch&&t.watch.forEach(t=>{let e=n._watching.get(t);e||(e=new Set,n._watching.set(t,e)),e.add(o)});const i=Object.getOwnPropertyDescriptor(e,o);let r;if(void 0===i)r={get(){return this[`__transform_${a}`]},set(t){const e=this[`__transform_${a}`],o=this._transformers.get(a);this[`__transform_${a}`]=o?o.call(this,t):t,this[`__original_${a}`]=t,this.requestUpdate(a,e)},configurable:!0,enumerable:!0};else{const t=i.set;r=Object.assign(Object.assign({},i),{},{set(e){const o=this[`__transform_${a}`],n=this._transformers.get(a);this[`__transform_${a}`]=n?n.call(this,e):e,this[`__original_${a}`]=e,this.requestUpdate(a,o),null==t||t.call(this,e)}})}Object.defineProperty(e,o,r)}}},38962:function(t,e,o){o.a(t,async function(t,a){try{o.r(e);o(62953);var n=o(40445),i=o(5124),r=o(67576),s=o(6412),l=o(93421),c=o(1087),d=o(26300),h=(o(67094),t([d]));d=(h.then?(await h)():h)[0];let p,u,m,g,v=t=>t;const b="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",f={info:"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",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class _ extends i.WF{render(){var t;return(0,i.qy)(p||(p=v` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,s.H)({[this.alertType]:!0}),this.title?"":"no-title",f[this.alertType],(0,s.H)({content:!0,narrow:this.narrow}),this.title?(0,i.qy)(u||(u=v`<div class="title">${0}</div>`),this.title):i.s6,this.dismissable?(0,i.qy)(m||(m=v`<ha-icon-button ="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(t=this._localize)||void 0===t?void 0:t.call(this,"ui.common.dismiss_alert"),b):i.s6)}_dismissClicked(){(0,c.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}_.styles=(0,i.AH)(g||(g=v`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`)),(0,n.Cg)([(0,r.MZ)()],_.prototype,"title",void 0),(0,n.Cg)([(0,r.MZ)({attribute:"alert-type"})],_.prototype,"alertType",void 0),(0,n.Cg)([(0,r.MZ)({type:Boolean})],_.prototype,"dismissable",void 0),(0,n.Cg)([(0,r.wk)(),(0,l.IW)()],_.prototype,"_localize",void 0),(0,n.Cg)([(0,r.MZ)({type:Boolean})],_.prototype,"narrow",void 0),_=(0,n.Cg)([(0,r.EM)("ha-alert")],_),a()}catch(p){a(p)}})},76776:function(t,e,o){o(62953);var a=o(40445),n=o(5124),i=o(67576);let r,s,l,c=t=>t;class d extends n.WF{render(){return(0,n.qy)(r||(r=c` ${0} <slot></slot> `),this.header?(0,n.qy)(s||(s=c`<h1 class="card-header">${0}</h1>`),this.header):n.s6)}constructor(...t){super(...t),this.raised=!1}}d.styles=(0,n.AH)(l||(l=c`: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,a.Cg)([(0,i.MZ)()],d.prototype,"header",void 0),(0,a.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],d.prototype,"raised",void 0),d=(0,a.Cg)([(0,i.EM)("ha-card")],d)},43661:function(t,e,o){o.r(e),o.d(e,{HaIconNext:function(){return s}});o(62953);var a=o(40445),n=o(67576),i=o(63091),r=o(67094);class s extends r.HaSvgIcon{constructor(...t){super(...t),this.path="rtl"===i.G.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}(0,a.Cg)([(0,n.MZ)()],s.prototype,"path",void 0),s=(0,a.Cg)([(0,n.EM)("ha-icon-next")],s)},2846:function(t,e,o){o.d(e,{G:function(){return p},J:function(){return h}});var a=o(40445),n=o(58168),i=o(82553),r=o(5124),s=o(67576);o(54276);let l,c,d=t=>t;const h=[i.R,(0,r.AH)(l||(l=d`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color)}md-item{overflow:var(--md-item-overflow,hidden);align-items:var(--md-item-align-items,center);gap:var(--ha-md-list-item-gap,16px)}`))];class p extends n.n{renderRipple(){return"text"===this.type?r.s6:(0,r.qy)(c||(c=d`<ha-ripple part="ripple" for="item" ?disabled="${0}"></ha-ripple>`),this.disabled&&"link"!==this.type)}}p.styles=h,p=(0,a.Cg)([(0,s.EM)("ha-md-list-item")],p)},17308:function(t,e,o){var a=o(40445),n=o(49838),i=o(11245),r=o(5124),s=o(67576);let l;class c extends n.B{}c.styles=[i.R,(0,r.AH)(l||(l=(t=>t)`:host{--md-sys-color-surface:var(--card-background-color)}`))],c=(0,a.Cg)([(0,s.EM)("ha-md-list")],c)},54276:function(t,e,o){o(62953);var a=o(40445),n=o(76482),i=o(91382),r=o(96245),s=o(5124),l=o(67576);let c;class d extends i.n{attach(t){super.attach(t),this.attachableTouchController.attach(t)}disconnectedCallback(){super.disconnectedCallback(),this.hovered=!1,this.pressed=!1}detach(){super.detach(),this.attachableTouchController.detach()}_onTouchControlChange(t,e){null==t||t.removeEventListener("touchend",this._handleTouchEnd),null==e||e.addEventListener("touchend",this._handleTouchEnd)}constructor(...t){super(...t),this.attachableTouchController=new n.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}d.styles=[r.R,(0,s.AH)(c||(c=(t=>t)`:host{--md-ripple-hover-opacity:var(--ha-ripple-hover-opacity, 0.08);--md-ripple-pressed-opacity:var(--ha-ripple-pressed-opacity, 0.12);--md-ripple-hover-color:var(
--ha-ripple-hover-color,
var(--ha-ripple-color, var(--secondary-text-color))
);--md-ripple-pressed-color:var(
--ha-ripple-pressed-color,
var(--ha-ripple-color, var(--secondary-text-color))
)}`))],d=(0,a.Cg)([(0,l.EM)("ha-ripple")],d)},7749:function(t,e,o){o.d(e,{HH:function(){return a},TY:function(){return n},lu:function(){return i},mu:function(){return r}});const a=(t,e)=>t.callApi("POST","config/config_entries/options/flow",{handler:e}),n=(t,e)=>t.callApi("GET",`config/config_entries/options/flow/${e}`),i=(t,e,o)=>t.callApi("POST",`config/config_entries/options/flow/${e}`,o),r=(t,e)=>t.callApi("DELETE",`config/config_entries/options/flow/${e}`)},29094:function(t,e,o){o.d(e,{g:function(){return i}});o(3362),o(62953);var a=o(1087);const n=()=>Promise.all([o.e(72850),o.e(39763),o.e(32450),o.e(46095),o.e(7305),o.e(92769),o.e(3283),o.e(80131),o.e(98470),o.e(54066),o.e(84038),o.e(62364),o.e(62574),o.e(26092),o.e(39005),o.e(28501),o.e(29792)]).then(o.bind(o,78314)),i=(t,e,o)=>{(0,a.r)(t,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:n,dialogParams:Object.assign(Object.assign({},e),{},{flowConfig:o,dialogParentElement:t})})}},70241:function(t,e,o){o.d(e,{Q:function(){return m}});o(3362),o(62953);var a=o(5124),n=o(95350),i=o(7749),r=o(29094);let s,l,c,d,h,p,u=t=>t;const m=(t,e,o)=>(0,r.g)(t,Object.assign({startFlowHandler:e.entry_id,domain:e.domain},o),{flowType:"options_flow",showDevices:!1,createFlow:async(t,o)=>{const[a]=await Promise.all([(0,i.HH)(t,o),t.loadFragmentTranslation("config"),t.loadBackendTranslation("options",e.domain),t.loadBackendTranslation("selector",e.domain)]);return a},fetchFlow:async(t,o)=>{const[a]=await Promise.all([(0,i.TY)(t,o),t.loadFragmentTranslation("config"),t.loadBackendTranslation("options",e.domain),t.loadBackendTranslation("selector",e.domain)]);return a},handleFlowStep:i.lu,deleteFlow:i.mu,renderAbortDescription(t,o){const n=t.localize(`component.${o.translation_domain||e.domain}.options.abort.${o.reason}`,o.description_placeholders);return n?(0,a.qy)(s||(s=u` <ha-markdown breaks allow-svg .content="${0}"></ha-markdown> `),n):o.reason},renderShowFormStepHeader(t,o){return t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.title`,o.description_placeholders)||t.localize("ui.dialogs.options_flow.form.header")},renderShowFormStepDescription(t,o){const n=t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.description`,o.description_placeholders);return n?(0,a.qy)(l||(l=u` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),n):""},renderShowFormStepFieldLabel(t,o,a,n){var i;if("expandable"===a.type)return t.localize(`component.${e.domain}.options.step.${o.step_id}.sections.${a.name}.name`,o.description_placeholders)||a.name;const r=null!=n&&null!==(i=n.path)&&void 0!==i&&i[0]?`sections.${n.path[0]}.`:"";return t.localize(`component.${e.domain}.options.step.${o.step_id}.${r}data.${a.name}`,o.description_placeholders)||a.name},renderShowFormStepFieldHelper(t,o,n,i){var r;if("expandable"===n.type)return t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.sections.${n.name}.description`,o.description_placeholders);const s=null!=i&&null!==(r=i.path)&&void 0!==r&&r[0]?`sections.${i.path[0]}.`:"",l=t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.${s}data_description.${n.name}`,o.description_placeholders);return l?(0,a.qy)(c||(c=u`<ha-markdown breaks .content="${0}"></ha-markdown>`),l):""},renderShowFormStepFieldError(t,o,a){return t.localize(`component.${o.translation_domain||e.domain}.options.error.${a}`,o.description_placeholders)||a},renderShowFormStepFieldLocalizeValue(t,o,a){return t.localize(`component.${e.domain}.selector.${a}`)},renderShowFormStepSubmitButton(t,o){return t.localize(`component.${e.domain}.options.step.${o.step_id}.submit`)||t.localize("ui.panel.config.integrations.config_flow."+(!1===o.last_step?"next":"submit"))},renderExternalStepHeader(t,e){return""},renderExternalStepDescription(t,e){return""},renderCreateEntryDescription(t,e){return(0,a.qy)(d||(d=u` <p>${0}</p> `),t.localize("ui.dialogs.options_flow.success.description"))},renderShowFormProgressHeader(t,o){return t.localize(`component.${e.domain}.options.step.${o.step_id}.title`)||t.localize(`component.${e.domain}.title`)},renderShowFormProgressDescription(t,o){const n=t.localize(`component.${o.translation_domain||e.domain}.options.progress.${o.progress_action}`,o.description_placeholders);return n?(0,a.qy)(h||(h=u` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),n):""},renderMenuHeader(t,o){return t.localize(`component.${e.domain}.options.step.${o.step_id}.title`)||t.localize(`component.${e.domain}.title`)},renderMenuDescription(t,o){const n=t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.description`,o.description_placeholders);return n?(0,a.qy)(p||(p=u` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),n):""},renderMenuOption(t,o,a){return t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.menu_options.${a}`,o.description_placeholders)},renderMenuOptionDescription(t,o,a){return t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.menu_option_descriptions.${a}`,o.description_placeholders)},renderLoadingDescription(t,o){return t.localize(`component.${e.domain}.options.loading`)||("loading_flow"===o||"loading_step"===o?t.localize(`ui.dialogs.options_flow.loading.${o}`,{integration:(0,n.p$)(t.localize,e.domain)}):"")}})},81310:function(t,e,o){o.a(t,async function(t,e){try{o(62953);var a=o(40445),n=o(5124),i=o(67576),r=o(6412),s=o(26218),l=o(91926),c=o(90248),d=o(2054),h=o(14503),p=t([c,d]);[c,d]=p.then?(await p)():p;let u,m,g,v,b,f=t=>t;class _ extends n.WF{render(){var t;return(0,n.qy)(u||(u=f` <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="${0}" ="${0}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `),(0,r.H)({narrow:this.narrow}),this.mainPage||null!==(t=history.state)&&void 0!==t&&t.root?(0,n.qy)(m||(m=f` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):this.backPath?(0,n.qy)(g||(g=f` <ha-icon-button-arrow-prev href="${0}" .hass="${0}"></ha-icon-button-arrow-prev> `),this.backPath,this.hass):(0,n.qy)(v||(v=f` <ha-icon-button-arrow-prev .hass="${0}" ="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.header,(0,r.H)({content:!0,"ha-scrollbar":this.scrollable,"not-scrollable":!this.scrollable}),this._saveScrollPos)}_saveScrollPos(t){this._savedScrollPos=t.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,l.OE)()}static get styles(){return[h.dp,(0,n.AH)(b||(b=f`: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}.content.not-scrollable{overflow:hidden;display:flex;flex-direction:column}: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);--ha-button-box-shadow:var(--ha-box-shadow-l)}: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,this.scrollable=!0}}(0,a.Cg)([(0,i.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,a.Cg)([(0,i.MZ)()],_.prototype,"header",void 0),(0,a.Cg)([(0,i.MZ)({type:Boolean,attribute:"main-page"})],_.prototype,"mainPage",void 0),(0,a.Cg)([(0,i.MZ)({type:String,attribute:"back-path"})],_.prototype,"backPath",void 0),(0,a.Cg)([(0,i.MZ)({attribute:!1})],_.prototype,"backCallback",void 0),(0,a.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],_.prototype,"narrow",void 0),(0,a.Cg)([(0,i.MZ)({type:Boolean})],_.prototype,"scrollable",void 0),(0,a.Cg)([(0,s.a)(".content")],_.prototype,"_savedScrollPos",void 0),(0,a.Cg)([(0,i.Ls)({passive:!0})],_.prototype,"_saveScrollPos",null),_=(0,a.Cg)([(0,i.EM)("hass-subpage")],_),e()}catch(u){e(u)}})},21356:function(t,e,o){o.a(t,async function(t,a){try{o.r(e),o.d(e,{BluetoothAdapterInfoPage:function(){return H}});o(44114),o(18111),o(22489),o(20116),o(61701),o(45367),o(92731),o(3362),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(62953);var n=o(40445),i=o(5124),r=o(67576),s=o(22786),l=o(37981),c=o(38962),d=o(18350),h=(o(76776),o(26300)),p=(o(43661),o(17308),o(2846),o(67094),o(21030)),u=o(77423),m=o(70241),g=o(65063),v=o(81310),b=o(14503),f=t([c,d,h,v]);[c,d,h,v]=f.then?(await f)():f;let _,y,w,x,$,C,k,L,M,S=t=>t;const z="M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M10,22C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.79,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,13L21.54,14.63C21.73,14.78 21.79,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.04 19.05,18.95L16.56,17.95C16.04,18.34 15.5,18.68 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10M11.25,4L10.88,6.61C9.68,6.86 8.62,7.5 7.85,8.39L5.44,7.35L4.69,8.65L6.8,10.2C6.4,11.37 6.4,12.64 6.8,13.8L4.68,15.36L5.43,16.66L7.86,15.62C8.63,16.5 9.68,17.14 10.87,17.38L11.24,20H12.76L13.13,17.39C14.32,17.14 15.37,16.5 16.14,15.62L18.57,16.66L19.32,15.36L17.2,13.81C17.6,12.64 17.6,11.37 17.2,10.2L19.31,8.65L18.56,7.35L16.15,8.39C15.38,7.5 14.32,6.86 13.12,6.62L12.75,4H11.25Z",A="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";class H extends i.WF{connectedCallback(){super.connectedCallback(),this.hass&&(this._loadConfigEntries(),this._subscribeBluetoothConnectionAllocations(),this._subscribeBluetoothScannerState(),this._subscribeScannerDetails())}async _loadConfigEntries(){this._configEntries=await(0,u.VN)(this.hass,{domain:"bluetooth"})}async _subscribeBluetoothConnectionAllocations(){this._unsubConnectionAllocations||(this._unsubConnectionAllocations=await(0,p.gO)(this.hass.connection,t=>{this._connectionAllocationData=t}))}async _subscribeBluetoothScannerState(){this._unsubScannerState||(this._unsubScannerState=await(0,p.wj)(this.hass.connection,t=>{this._scannerStates=Object.assign(Object.assign({},this._scannerStates),{},{[t.source]:t})}))}_subscribeScannerDetails(){this._unsubScannerDetails||(this._unsubScannerDetails=(0,p.mj)(this.hass.connection,t=>{this._scannerDetails=t}))}disconnectedCallback(){super.disconnectedCallback(),this._unsubConnectionAllocations&&(this._unsubConnectionAllocations(),this._unsubConnectionAllocations=void 0),this._unsubScannerState&&(this._unsubScannerState(),this._unsubScannerState=void 0),this._unsubScannerDetails&&(this._unsubScannerDetails(),this._unsubScannerDetails=void 0)}render(){const{enabledDevices:t,disabledDevices:e,disabledEntriesWithoutDevice:o}=this._getBluetoothDevices(this.hass.devices,this._configEntries);return(0,i.qy)(_||(_=S` <hass-subpage .hass="${0}" .narrow="${0}" .header="${0}" back-path="/config/bluetooth/dashboard"> <div class="container"> <ha-card> <ha-md-list> ${0} ${0} ${0} </ha-md-list> <div class="card-actions"> <ha-button appearance="plain" href="/config/integrations/integration/bluetooth"> ${0} </ha-button> </div> </ha-card> </div> </hass-subpage> `),this.hass,this.narrow,this.hass.localize("ui.panel.config.bluetooth.adapter_info_title"),this._renderAdaptersList(t),e.map(({device:t,entry:e})=>{const o=[t.area_id&&this.hass.areas[t.area_id]?this.hass.areas[t.area_id].name:void 0,this.hass.localize("ui.panel.config.bluetooth.disabled_by_user")].filter(Boolean).join(" · ");return(0,i.qy)(y||(y=S` <ha-md-list-item class="disabled"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline"> ${0} </div> <div slot="supporting-text">${0}</div> <ha-button slot="end" .entry="${0}" ="${0}"> ${0} </ha-button> </ha-md-list-item> `),A,(0,l.xn)(t)||e.title,o,e,this._handleEnable,this.hass.localize("ui.common.enable"))}),o.map(t=>(0,i.qy)(w||(w=S` <ha-md-list-item class="disabled"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline">${0}</div> <div slot="supporting-text"> ${0} </div> <ha-button slot="end" .entry="${0}" ="${0}"> ${0} </ha-button> </ha-md-list-item> `),A,t.title,this.hass.localize("ui.panel.config.bluetooth.disabled_by_user"),t,this._handleEnable,this.hass.localize("ui.common.enable"))),this.hass.localize("ui.panel.config.bluetooth.manage_integration"))}_renderAdaptersList(t){return 0===t.length?(0,i.qy)(x||(x=S`<ha-md-list-item> <div slot="headline"> ${0} </div> </ha-md-list-item>`),this.hass.localize("ui.panel.config.bluetooth.no_scanner_state_available")):t.map(({device:t,entry:e})=>{var o,a;const n=t.connections.find(t=>"bluetooth"===t[0]),r=null==n?void 0:n[1],s=r&&this._scannerDetails?Object.values(this._scannerDetails).find(t=>t.source===r):void 0,c=s?this._scannerStates[s.source]:void 0,d=null!==(o=null==s?void 0:s.scanner_type)&&void 0!==o?o:"unknown",h="remote"===d,u=c&&(0,p.SB)(c),m=s?this._connectionAllocationData.find(t=>t.source===s.source):void 0,g=(0,l.xn)(t)||e.title,v=t.area_id?null===(a=this.hass.areas[t.area_id])||void 0===a?void 0:a.name:void 0,b=this._formatScannerModeText(c),f=m&&m.slots>0,_=[v,b,m?f?`${m.slots-m.free}/${m.slots} ${this.hass.localize("ui.panel.config.bluetooth.active_connections")}`:this.hass.localize("ui.panel.config.bluetooth.no_connection_slots"):this.hass.localize("ui.panel.config.bluetooth.no_connection_slot_allocations")].filter(Boolean);return(0,i.qy)($||($=S` <ha-md-list-item type="link" href="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline">${0}</div> <div slot="supporting-text">${0}</div> ${0} <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> ${0} `),`/config/bluetooth/connection-monitor?source=${r}`,A,g,_.join(" · "),h?i.s6:(0,i.qy)(C||(C=S`<ha-icon-button slot="end" .path="${0}" .entry="${0}" ="${0}" .label="${0}"></ha-icon-button>`),z,e,this._openOptionFlow,this.hass.localize("ui.panel.config.bluetooth.option_flow")),u&&s?this._renderScannerMismatchWarning(g,c,d):i.s6)})}_renderScannerMismatchWarning(t,e,o){const a=[];return"remote"!==o&&"unknown"!==o||a.push(this.hass.localize("ui.panel.config.bluetooth.scanner_mode_mismatch_remote")),"usb"!==o&&"unknown"!==o||a.push(this.hass.localize("ui.panel.config.bluetooth.scanner_mode_mismatch_usb")),"uart"!==o&&"unknown"!==o||a.push(this.hass.localize("ui.panel.config.bluetooth.scanner_mode_mismatch_uart")),(0,i.qy)(k||(k=S`<ha-alert alert-type="warning"> <div> ${0} </div> <ul> ${0} </ul> </ha-alert>`),this.hass.localize("ui.panel.config.bluetooth.scanner_mode_mismatch",{name:t,requested:this._formatMode(e.requested_mode),current:this._formatMode(e.current_mode)}),a.map(t=>(0,i.qy)(L||(L=S`<li>${0}</li>`),t)))}_formatMode(t){switch(t){case null:return this.hass.localize("ui.panel.config.bluetooth.scanning_mode_none");case"active":return this.hass.localize("ui.panel.config.bluetooth.scanning_mode_active");case"passive":return this.hass.localize("ui.panel.config.bluetooth.scanning_mode_passive");default:return t}}_formatModeLabel(t){switch(t){case null:return this.hass.localize("ui.panel.config.bluetooth.scanning_mode_none_label");case"active":return this.hass.localize("ui.panel.config.bluetooth.scanning_mode_active_label");case"passive":return this.hass.localize("ui.panel.config.bluetooth.scanning_mode_passive_label");default:return t}}_formatScannerModeText(t){return t?"auto"===t.requested_mode?this.hass.localize("ui.panel.config.bluetooth.scanning_mode_auto_with_current",{current:this._formatMode(t.current_mode)}):this._formatModeLabel(t.current_mode):this.hass.localize("ui.panel.config.bluetooth.scanner_state_unknown")}async _handleEnable(t){const e=t.currentTarget.entry.entry_id;try{(await(0,u.k3)(this.hass,e)).require_restart&&(0,g.showAlertDialog)(this,{text:this.hass.localize("ui.panel.config.integrations.config_entry.enable_restart_confirm")}),this._loadConfigEntries()}catch(o){(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.integrations.config_entry.disable_error"),text:o.message})}}_openOptionFlow(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget;(0,m.Q)(this,e.entry)}static get styles(){return[b.RF,(0,i.AH)(M||(M=S`.container{padding:var(--ha-space-2) var(--ha-space-4) var(--ha-space-4)}ha-card{max-width:600px;margin:0 auto var(--ha-space-4)}ha-md-list{background:0 0;padding:0}ha-md-list-item{--md-item-overflow:visible}ha-md-list-item ha-svg-icon[slot=start]{color:var(--secondary-text-color)}ha-md-list-item.disabled [slot=headline],ha-md-list-item.disabled [slot=supporting-text],ha-md-list-item.disabled ha-svg-icon[slot=start]{opacity:.5}.card-actions{display:flex;justify-content:flex-end;border-top:1px solid var(--divider-color);padding:var(--ha-space-2) var(--ha-space-4)}`))]}constructor(...t){super(...t),this.narrow=!1,this.isWide=!1,this._configEntries=[],this._connectionAllocationData=[],this._scannerStates={},this._getBluetoothDevices=(0,s.A)((t,e)=>{const o=new Map(e.map(t=>[t.entry_id,t])),a=[],n=[],i=new Set;for(const r of Object.values(t)){if(!r.connections.find(t=>"bluetooth"===t[0]))continue;const t=r.config_entries.map(t=>o.get(t)).find(t=>void 0!==t);t&&(i.add(t.entry_id),null!==t.disabled_by?n.push({device:r,entry:t}):a.push({device:r,entry:t}))}return{enabledDevices:a,disabledDevices:n,disabledEntriesWithoutDevice:e.filter(t=>null!==t.disabled_by&&!i.has(t.entry_id))}})}}(0,n.Cg)([(0,r.MZ)({attribute:!1})],H.prototype,"hass",void 0),(0,n.Cg)([(0,r.MZ)({attribute:!1})],H.prototype,"route",void 0),(0,n.Cg)([(0,r.MZ)({type:Boolean})],H.prototype,"narrow",void 0),(0,n.Cg)([(0,r.MZ)({attribute:"is-wide",type:Boolean})],H.prototype,"isWide",void 0),(0,n.Cg)([(0,r.wk)()],H.prototype,"_configEntries",void 0),(0,n.Cg)([(0,r.wk)()],H.prototype,"_connectionAllocationData",void 0),(0,n.Cg)([(0,r.wk)()],H.prototype,"_scannerStates",void 0),(0,n.Cg)([(0,r.wk)()],H.prototype,"_scannerDetails",void 0),H=(0,n.Cg)([(0,r.EM)("bluetooth-adapter-info-page")],H),a()}catch(_){a(_)}})}}]);