UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

51 lines 37.3 kB
export const __rspack_esm_id=46660;export const __rspack_esm_ids=[46660];export const __webpack_modules__={50248(e,t,a){a.d(t,{n:()=>o});const o=(e=document)=>e.activeElement?.shadowRoot?.activeElement?o(e.activeElement.shadowRoot):e.activeElement},57237(e,t,a){a.d(t,{d:()=>o});const o=e=>e.stopPropagation()},65522(e,t,a){a.d(t,{A:()=>o});const o=e=>e.name?.trim()},37981(e,t,a){a.d(t,{xn:()=>r,T:()=>s,Kh:()=>n});a(18111),a(22489),a(61701);var o=a(22786);a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var i=a(28978);const r=e=>(e.name_by_user||e.name)?.trim(),s=(e,t,a,o)=>r(e)||o&&l(a,o)||t("ui.panel.config.devices.unnamed_device",{type:t(`ui.panel.config.devices.type.${e.entry_type||"device"}`)}),l=(e,t)=>{for(const a of t||[]){const t=e["string"==typeof a?a:a.entity_id];if(t)return(0,i.u)(t)}},n=(0,o.A)(e=>function(e){const t=new Set,a=new Set;for(const o of e)a.has(o)?t.add(o):a.add(o);return t}(Object.values(e).map(e=>r(e)).filter(e=>void 0!==e)))},55931(e,t,a){a.d(t,{X:()=>o});const o=e=>e.name?.trim()},68246(e,t,a){a.d(t,{Y:()=>o});const o=e=>e.slice(e.indexOf(".")+1)},28978(e,t,a){a.d(t,{_:()=>i,u:()=>r});var o=a(68246);const i=(e,t)=>void 0===t.friendly_name?(0,o.Y)(e).replace(/_/g," "):(t.friendly_name??"").toString(),r=e=>i(e.entity_id,e.attributes)},28455(e,t,a){a.d(t,{EX:()=>i,jI:()=>r,ln:()=>o});const o=(e,t,a,o,i)=>{const s=t[e.entity_id];return s?r(s,t,a,o,i):{entity:null,device:null,area:null,floor:null}},i=(e,t,a)=>{const o=t[e];if(!o)return;const i=o.device_id,r=i?a[i]:void 0;return o.area_id||r?.area_id||void 0},r=(e,t,a,o,i)=>{const r=t[e.entity_id],s=e?.device_id,l=s?a[s]:void 0,n=e?.area_id||l?.area_id,d=n?o[n]:void 0,c=d?.floor_id;return{entity:r,device:l||null,area:d||null,floor:(c?i[c]:void 0)||null}}},67258(e,t,a){a.d(t,{d:()=>o});const o=e=>{switch(e.language){case"cs":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}}},8549(e,t,a){a.d(t,{A:()=>i});var o=a(67258);const i=(e,t)=>"°"===e?"":t&&"%"===e?(0,o.d)(t):" "},63130(e,t,a){a.d(t,{l:()=>i});var o=a(50248);const i=async(e,t)=>{if(navigator.clipboard)try{return void await navigator.clipboard.writeText(e)}catch{}const a=t||(0,o.n)()?.getRootNode()||document.body,i=document.createElement("textarea");i.value=e,i.setAttribute("readonly",""),i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.opacity="0",a.appendChild(i),i.select(),document.execCommand("copy"),a.removeChild(i)}},19459(e,t,a){a.d(t,{b:()=>o});a(45367),a(92731),a(69479),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);const o=(e,t,a)=>{if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let i,r;if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(i=r;0!==i--;)if(!o(e[i],t[i],a))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;for(i of e.entries())if(!o(i[1],t.get(i[0]),a))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!==t.length)return!1;for(i=r;0!==i--;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const s=Object.keys(e);if(r=s.length,r!==Object.keys(t).length)return!1;for(i=r;0!==i--;)if(!Object.prototype.hasOwnProperty.call(t,s[i]))return!1;for(i=r;0!==i--;){const r=s[i];if(!o(e[r],t[r],a))return!1}if(a?.compareSymbols){const i=Object.getOwnPropertySymbols(e),r=Object.getOwnPropertySymbols(t);if(i.length!==r.length)return!1;for(const r of i){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(!o(e[r],t[r],a))return!1}}return!0}return e!=e&&t!=t}},7553(e,t,a){a.d(t,{h:()=>i});class o extends Error{constructor(e,...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,o),this.name="TimeoutError",this.timeout=e,this.message=`Timed out in ${e} ms.`}}const i=(e,t)=>{const a=new Promise((t,a)=>{setTimeout(()=>{a(new o(e))},e)});return Promise.race([t,a])}},47680(e,t,a){a.r(t),a.d(t,{HaIcon:()=>_});a(74423);var o=a(62826),i=a(5124),r=a(22441),s=a(1087),l=a(9899),n=a(700),d=(a(44114),a(18111),a(7588),a(95192)),c=a(7553);const h=JSON.parse('{"version":"7.4.47","parts":[{"file":"7a7139d465f1f41cb26ab851a17caa21a9331234"},{"start":"account-supervisor-circle-","file":"9561286c4c1021d46b9006596812178190a7cc1c"},{"start":"alpha-r-c","file":"eb466b7087fb2b4d23376ea9bc86693c45c500fa"},{"start":"arrow-decision-o","file":"4b3c01b7e0723b702940c5ac46fb9e555646972b"},{"start":"baby-f","file":"2611401d85450b95ab448ad1d02c1a432b409ed2"},{"start":"battery-hi","file":"89bcd31855b34cd9d31ac693fb073277e74f1f6a"},{"start":"blur-r","file":"373709cd5d7e688c2addc9a6c5d26c2d57c02c48"},{"start":"briefcase-account-","file":"a75956cf812ee90ee4f656274426aafac81e1053"},{"start":"calendar-question-","file":"3253f2529b5ebdd110b411917bacfacb5b7063e6"},{"start":"car-lig","file":"74566af3501ad6ae58ad13a8b6921b3cc2ef879d"},{"start":"cellphone-co","file":"7677f1cfb2dd4f5562a2aa6d3ae43a2e6997b21a"},{"start":"circle-slice-2","file":"70d08c50ec4522dd75d11338db57846588263ee2"},{"start":"cloud-co","file":"141d2bfa55ca4c83f4bae2812a5da59a84fec4ff"},{"start":"cog-s","file":"5a640365f8e47c609005d5e098e0e8104286d120"},{"start":"cookie-l","file":"dd85b8eb8581b176d3acf75d1bd82e61ca1ba2fc"},{"start":"currency-eur-","file":"15362279f4ebfc3620ae55f79d2830ad86d5213e"},{"start":"delete-o","file":"239434ab8df61237277d7599ebe066c55806c274"},{"start":"draw-","file":"5605918a592070803ba2ad05a5aba06263da0d70"},{"start":"emoticon-po","file":"a838cfcec34323946237a9f18e66945f55260f78"},{"start":"fan","file":"effd56103b37a8c7f332e22de8e4d67a69b70db7"},{"start":"file-question-","file":"b2424b50bd465ae192593f1c3d086c5eec893af8"},{"start":"flask-off-","file":"3b76295cde006a18f0301dd98eed8c57e1d5a425"},{"start":"food-s","file":"1c6941474cbeb1755faaaf5771440577f4f1f9c6"},{"start":"gamepad-u","file":"c6efe18db6bc9654ae3540c7dee83218a5450263"},{"start":"google-f","file":"df341afe6ad4437457cf188499cb8d2df8ac7b9e"},{"start":"head-c","file":"282121c9e45ed67f033edcc1eafd279334c00f46"},{"start":"home-pl","file":"27e8e38fc7adcacf2a210802f27d841b49c8c508"},{"start":"inbox-","file":"0f0316ec7b1b7f7ce3eaabce26c9ef619b5a1694"},{"start":"key-v","file":"ea33462be7b953ff1eafc5dac2d166b210685a60"},{"start":"leaf-circle-","file":"33db9bbd66ce48a2db3e987fdbd37fb0482145a4"},{"start":"lock-p","file":"b89e27ed39e9d10c44259362a4b57f3c579d3ec8"},{"start":"message-s","file":"7b5ab5a5cadbe06e3113ec148f044aa701eac53a"},{"start":"moti","file":"01024d78c248d36805b565e343dd98033cc3bcaf"},{"start":"newspaper-variant-o","file":"22a6ec4a4fdd0a7c0acaf805f6127b38723c9189"},{"start":"on","file":"c73d55b412f394e64632e2011a59aa05e5a1f50d"},{"start":"paw-ou","file":"3f669bf26d16752dc4a9ea349492df93a13dcfbf"},{"start":"pigg","file":"0c24edb27eb1c90b6e33fc05f34ef3118fa94256"},{"start":"printer-pos-sy","file":"41a55cda866f90b99a64395c3bb18c14983dcf0a"},{"start":"read","file":"c7ed91552a3a64c9be88c85e807404cf705b7edf"},{"start":"robot-vacuum-variant-o","file":"917d2a35d7268c0ea9ad9ecab2778060e19d90e0"},{"start":"sees","file":"6e82d9861d8fac30102bafa212021b819f303bdb"},{"start":"shoe-f","file":"e2fe7ce02b5472301418cc90a0e631f187b9f238"},{"start":"snowflake-m","file":"a28ba9f5309090c8b49a27ca20ff582a944f6e71"},{"start":"st","file":"7e92d03f095ec27e137b708b879dfd273bd735ab"},{"start":"su","file":"61c74913720f9de59a379bdca37f1d2f0dc1f9db"},{"start":"tag-plus-","file":"8f3184156a4f38549cf4c4fffba73a6a941166ae"},{"start":"timer-a","file":"baab470d11cfb3a3cd3b063ee6503a77d12a80d0"},{"start":"transit-d","file":"8561c0d9b1ac03fab360fd8fe9729c96e8693239"},{"start":"vector-arrange-b","file":"c9a3439257d4bab33d3355f1f2e11842e8171141"},{"start":"water-ou","file":"02dbccfb8ca35f39b99f5a085b095fc1275005a0"},{"start":"webc","file":"57bafd4b97341f4f2ac20a609d023719f23a619c"},{"start":"zip","file":"65ae094e8263236fa50486584a08c03497a38d93"}]}');let p;const f=()=>(p||(p=u().catch(e=>{throw p=void 0,e})),p),u=async()=>{const e=(0,d.y$)("hass-icon-db","mdi-icon-store"),t=await(0,d.Jt)("_version",e);return t?t!==h.version&&(await(0,d.IU)(e),(0,d.hZ)("_version",h.version,e)):(0,d.hZ)("_version",h.version,e),e},m=["mdi","hass","hassio","hademo"];let b=[];a(67094);const v={},g={},y=(0,l.s)(()=>(async e=>{const t=Object.keys(e),a=await Promise.allSettled(Object.values(e));(await f())("readwrite",o=>{a.forEach((a,i)=>{"fulfilled"===a.status&&Object.entries(a.value).forEach(([e,t])=>{o.put(t,e)}),delete e[t[i]]})})})(g),2e3),w={},x={"home-assistant":()=>a.e(58781).then(a.bind(a,53580)).then(e=>e.mdiHomeAssistant),"music-assistant":()=>a.e(56009).then(a.bind(a,10576)).then(e=>e.mdiMusicAssistant),esphome:()=>a.e(88800).then(a.bind(a,45091)).then(e=>e.mdiEsphomeLogo)};class _ extends i.WF{willUpdate(e){super.willUpdate(e),e.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}render(){return this.icon?this._legacy?i.qy` <iron-icon .icon="${this.icon}"></iron-icon>`:i.qy`<ha-svg-icon .path="${this._path}" .secondaryPath="${this._secondaryPath}" .viewBox="${this._viewBox}"></ha-svg-icon>`:i.s6}async _loadIcon(){if(!this.icon)return;const e=this.icon,[t,a]=this.icon.split(":",2);let o,i=a;if(!t||!i)return;if(!m.includes(t)){const a=n.y[t];return a?void(a&&"function"==typeof a.getIcon&&this._setCustomPath(a.getIcon(i),e)):void(this._legacy=!0)}if(this._legacy=!1,i in v){const e=v[i];let a;e.newName?(a=`Icon ${t}:${i} was renamed to ${t}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,i=e.newName):a=`Icon ${t}:${i} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${e.removeIn}.`,console.warn(a),(0,s.r)(this,"write_log",{level:"warning",message:a})}if(i in w)return void(this._path=w[i]);if(i in x){const t=await x[i]();return this.icon===e&&(this._path=t),void(w[i]=t)}try{o=await(e=>new Promise((t,a)=>{if(b.push([e,t,a]),b.length>1)return;const o=f();(0,c.h)(1e3,(async()=>{(await o)("readonly",e=>{for(const[t,a,o]of b)(0,d.Yd)(e.get(t)).then(e=>a(e)).catch(e=>o(e));b=[]})})()).catch(e=>{for(const[,,t]of b)t(e);b=[]})}))(i)}catch(e){o=void 0}if(o)return this.icon===e&&(this._path=o),void(w[i]=o);const r=(e=>{let t;for(const a of h.parts){if(void 0!==a.start&&e<a.start)break;t=a}return t.file})(i);if(r in g)return void this._setPath(g[r],i,e);const l=fetch(`/static/mdi/${r}.json`).then(e=>e.json());g[r]=l,this._setPath(l,i,e),l.catch(()=>{delete g[r]}),y()}async _setCustomPath(e,t){const a=await e;this.icon===t&&(this._path=a.path,this._secondaryPath=a.secondaryPath,this._viewBox=a.viewBox)}async _setPath(e,t,a){try{const o=await e;this.icon===a&&(this._path=o[t]),w[t]=o[t]}catch(e){}}constructor(...e){super(...e),this._legacy=!1}}_.styles=i.AH`:host{fill:currentcolor}`,(0,o.Cg)([(0,r.MZ)()],_.prototype,"icon",void 0),(0,o.Cg)([(0,r.wk)()],_.prototype,"_path",void 0),(0,o.Cg)([(0,r.wk)()],_.prototype,"_secondaryPath",void 0),(0,o.Cg)([(0,r.wk)()],_.prototype,"_viewBox",void 0),(0,o.Cg)([(0,r.wk)()],_.prototype,"_legacy",void 0),_=(0,o.Cg)([(0,r.EM)("ha-icon")],_)},3449(e,t,a){var o=a(62826),i=a(5124),r=a(22441);class s extends i.WF{render(){return i.qy`<slot></slot>`}constructor(...e){super(...e),this.disabled=!1}}s.styles=i.AH`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:var(--ha-font-size-s);padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px;letter-spacing:var( --mdc-typography-caption-letter-spacing, .0333333333em );line-height:normal}:host([disabled]){color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}`,(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],s.prototype,"disabled",void 0),s=(0,o.Cg)([(0,r.EM)("ha-input-helper-text")],s)},2846(e,t,a){a.d(t,{G:()=>d,J:()=>n});var o=a(62826),i=a(58168),r=a(82553),s=a(5124),l=a(22441);a(54276);const n=[r.R,s.AH`: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 d extends i.n{renderRipple(){return"text"===this.type?s.s6:s.qy`<ha-ripple part="ripple" for="item" ?disabled="${this.disabled&&"link"!==this.type}"></ha-ripple>`}}d.styles=n,d=(0,o.Cg)([(0,l.EM)("ha-md-list-item")],d)},17308(e,t,a){var o=a(62826),i=a(49838),r=a(11245),s=a(5124),l=a(22441);class n extends i.B{}n.styles=[r.R,s.AH`:host{--md-sys-color-surface:var(--card-background-color)}`],n=(0,o.Cg)([(0,l.EM)("ha-md-list")],n)},54276(e,t,a){var o=a(62826),i=a(76482),r=a(91382),s=a(96245),l=a(5124),n=a(22441);class d extends r.n{attach(e){super.attach(e),this.attachableTouchController.attach(e)}disconnectedCallback(){super.disconnectedCallback(),this.hovered=!1,this.pressed=!1}detach(){super.detach(),this.attachableTouchController.detach()}_onTouchControlChange(e,t){e?.removeEventListener("touchend",this._handleTouchEnd),t?.addEventListener("touchend",this._handleTouchEnd)}constructor(...e){super(...e),this.attachableTouchController=new i.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}d.styles=[s.R,l.AH`: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,o.Cg)([(0,n.EM)("ha-ripple")],d)},97951(e,t,a){a.a(e,async function(e,o){try{a.r(t),a.d(t,{HaObjectSelector:()=>y});a(44114),a(18111),a(22489),a(61701);var i=a(62826),r=a(5124),s=a(22441),l=a(22786),n=a(44537),d=a(1087),c=a(93387),h=a(1135),p=(a(3449),a(17308),a(2846),a(85938),a(10763)),f=a(19459),u=e([p]);p=(u.then?(await u)():u)[0];const m="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",b="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",v="M21 11H3V9H21V11M21 13H3V15H21V13Z",g="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z";class y extends r.WF{_renderItem(e,t){const a=this.selector.object.fields,o=this.selector.object.label_field,i=o&&o in a?(0,c.C)(this.hass,e[o],a[o]?.selector):Object.entries(a).map(([t,a])=>(0,c.C)(this.hass,e[t],a.selector)).filter(Boolean).join(" · ");let s="";const l=this.selector.object.description_field;if(l&&l in a){const t=a[l]?.selector;s=t?(0,c.C)(this.hass,e[l],t):""}const n=this.selector.object.multiple||!1,d=this.selector.object.multiple||!1;return r.qy` <ha-md-list-item class="item"> ${n?r.qy` <ha-svg-icon class="handle" .path="${v}" slot="start"></ha-svg-icon> `:r.s6} <div slot="headline" class="label">${i}</div> ${s?r.qy`<div slot="supporting-text" class="description"> ${s} </div>`:r.s6} <ha-icon-button slot="end" .item="${e}" .index="${t}" .label="${this.hass.localize("ui.common.edit")}" .path="${g}" @click="${this._editItem}"></ha-icon-button> <ha-icon-button slot="end" .index="${t}" .label="${this.hass.localize("ui.common.delete")}" .path="${d?b:m}" @click="${this._deleteItem}"></ha-icon-button> </ha-md-list-item> `}render(){if(this.selector.object?.fields){if(this.selector.object.multiple){const e=(0,n.e)(this.value??[]);return r.qy` ${this.label?r.qy`<label>${this.label}</label>`:r.s6} <div class="items-container"> <ha-sortable handle-selector=".handle" draggable-selector=".item" @item-moved="${this._itemMoved}"> <ha-md-list> ${e.map((e,t)=>this._renderItem(e,t))} </ha-md-list> </ha-sortable> <ha-button appearance="filled" @click="${this._addItem}"> ${this.hass.localize("ui.common.add")} </ha-button> </div> `}return r.qy` ${this.label?r.qy`<label>${this.label}</label>`:r.s6} <div class="items-container"> ${this.value?r.qy`<ha-md-list> ${this._renderItem(this.value,0)} </ha-md-list>`:r.qy` <ha-button appearance="filled" @click="${this._addItem}"> ${this.hass.localize("ui.common.add")} </ha-button> `} </div> `}return r.qy`<ha-yaml-editor .readonly="${this.disabled}" .label="${this.label}" .required="${this.required}" .placeholder="${this.placeholder}" .defaultValue="${this.value}" @value-changed="${this._handleChange}"></ha-yaml-editor> ${this.helper?r.qy`<ha-input-helper-text .disabled="${this.disabled}">${this.helper}</ha-input-helper-text>`:""} `}_itemMoved(e){e.stopPropagation();const t=e.detail.newIndex,a=e.detail.oldIndex;if(!this.selector.object.multiple)return;const o=(0,n.e)(this.value??[]).concat(),i=o.splice(a,1)[0];o.splice(t,0,i),(0,d.r)(this,"value-changed",{value:o})}async _addItem(e){e.stopPropagation();const t=await(0,h.O)(this,{title:this.hass.localize("ui.common.add"),schema:this._schema(this.selector),data:{},computeLabel:this._computeLabel,computeHelper:this._computeHelper,submitText:this.hass.localize("ui.common.add")});if(null===t)return;if(!this.selector.object.multiple)return void(0,d.r)(this,"value-changed",{value:t});const a=(0,n.e)(this.value??[]).concat();a.push(t),(0,d.r)(this,"value-changed",{value:a})}async _editItem(e){e.stopPropagation();const t=e.currentTarget.item,a=e.currentTarget.index,o=await(0,h.O)(this,{title:this.hass.localize("ui.common.edit"),schema:this._schema(this.selector),data:t,computeLabel:this._computeLabel,computeHelper:this._computeHelper,submitText:this.hass.localize("ui.common.save")});if(null===o)return;if(!this.selector.object.multiple)return void(0,d.r)(this,"value-changed",{value:o});const i=(0,n.e)(this.value??[]).concat();i[a]=o,(0,d.r)(this,"value-changed",{value:i})}_deleteItem(e){e.stopPropagation();const t=e.currentTarget.index;if(!this.selector.object.multiple)return void(0,d.r)(this,"value-changed",{value:void 0});const a=(0,n.e)(this.value??[]).concat();a.splice(t,1),(0,d.r)(this,"value-changed",{value:a})}updated(e){super.updated(e),e.has("value")&&!this._valueChangedFromChild&&this._yamlEditor&&!(0,f.b)(this.value,e.get("value"))&&this._yamlEditor.setValue(this.value),this._valueChangedFromChild=!1}_handleChange(e){e.stopPropagation(),this._valueChangedFromChild=!0;const t=e.target.value;e.target.isValid&&this.value!==t&&(0,d.r)(this,"value-changed",{value:t})}static get styles(){return[r.AH`ha-md-list{gap:var(--ha-space-2)}ha-md-list-item{border:1px solid var(--divider-color);border-radius:var(--ha-border-radius-md);--ha-md-list-item-gap:0;--md-list-item-top-space:0;--md-list-item-bottom-space:0;--md-list-item-leading-space:12px;--md-list-item-trailing-space:4px;--md-list-item-two-line-container-height:48px;--md-list-item-one-line-container-height:48px}.handle{cursor:move;padding:8px;margin-inline-start:-8px}label{margin-bottom:8px;display:block}ha-md-list-item .description,ha-md-list-item .label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}`]}constructor(...e){super(...e),this.disabled=!1,this.required=!0,this._valueChangedFromChild=!1,this._computeLabel=e=>{const t=this.selector.object?.translation_key;if(this.localizeValue&&t){const a=this.localizeValue(`${t}.fields.${e.name}.name`)||this.localizeValue(`${t}.fields.${e.name}`);if(a)return a}return this.selector.object?.fields?.[e.name]?.label||e.name},this._computeHelper=e=>{const t=this.selector.object?.translation_key;if(this.localizeValue&&t){const a=this.localizeValue(`${t}.fields.${e.name}.description`);if(a)return a}return this.selector.object?.fields?.[e.name]?.description||""},this._schema=(0,l.A)(e=>e.object&&e.object.fields?Object.entries(e.object.fields).map(([e,t])=>({name:e,selector:t.selector,required:t.required??!1})):[])}}(0,i.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"selector",void 0),(0,i.Cg)([(0,s.MZ)()],y.prototype,"value",void 0),(0,i.Cg)([(0,s.MZ)()],y.prototype,"label",void 0),(0,i.Cg)([(0,s.MZ)()],y.prototype,"helper",void 0),(0,i.Cg)([(0,s.MZ)()],y.prototype,"placeholder",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"disabled",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"required",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"localizeValue",void 0),(0,i.Cg)([(0,s.P)("ha-yaml-editor",!0)],y.prototype,"_yamlEditor",void 0),y=(0,i.Cg)([(0,s.EM)("ha-selector-object")],y),o()}catch(e){o(e)}})},85938(e,t,a){a(18111),a(22489),a(46058);var o=a(62826),i=a(5124),r=a(22441),s=a(1087);class l extends i.WF{updated(e){e.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}disconnectedCallback(){super.disconnectedCallback(),this._shouldBeDestroy=!0,setTimeout(()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)},1)}connectedCallback(){super.connectedCallback(),this._shouldBeDestroy=!1,this.hasUpdated&&!this.disabled&&this._createSortable()}createRenderRoot(){return this}render(){return this.noStyle?i.s6:i.qy` <style>.sortable-fallback{display:none!important}.sortable-ghost{box-shadow:0 0 0 2px var(--primary-color);background:rgba(var(--rgb-primary-color),.25);border-radius:var(--ha-border-radius-sm);opacity:.4}.sortable-drag{border-radius:var(--ha-border-radius-sm);opacity:1;background:var(--card-background-color);box-shadow:0px 4px 8px 3px #00000026;cursor:grabbing}</style> `}async _createSortable(){if(this._sortable)return;const e=this.children[0];if(!e)return;const t=(await Promise.all([a.e(85283),a.e(70322)]).then(a.bind(a,80745))).default,o={scroll:!0,forceAutoScrollFallback:!0,scrollSpeed:20,animation:150,...this.options,onChoose:this._handleChoose,onStart:this._handleStart,onEnd:this._handleEnd,onUpdate:this._handleUpdate,onAdd:this._handleAdd,onRemove:this._handleRemove};this.draggableSelector&&(o.draggable=this.draggableSelector),this.handleSelector&&(o.handle=this.handleSelector),void 0!==this.invertSwap&&(o.invertSwap=this.invertSwap),this.group&&(o.group=this.group),this.filter&&(o.filter=this.filter),this._sortable=new t(e,o)}_destroySortable(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}constructor(...e){super(...e),this.disabled=!1,this.noStyle=!1,this.invertSwap=!1,this.rollback=!0,this._shouldBeDestroy=!1,this._handleUpdate=e=>{(0,s.r)(this,"item-moved",{newIndex:e.newIndex,oldIndex:e.oldIndex})},this._handleAdd=e=>{(0,s.r)(this,"item-added",{index:e.newIndex,data:e.item.sortableData,item:e.item})},this._handleRemove=e=>{(0,s.r)(this,"item-removed",{index:e.oldIndex})},this._handleEnd=async e=>{(0,s.r)(this,"drag-end"),this.rollback&&e.item.placeholder&&(e.item.placeholder.replaceWith(e.item),delete e.item.placeholder)},this._handleStart=()=>{(0,s.r)(this,"drag-start")},this._handleChoose=e=>{this.rollback&&(e.item.placeholder=document.createComment("sort-placeholder"),e.item.after(e.item.placeholder))}}}(0,o.Cg)([(0,r.MZ)({type:Boolean})],l.prototype,"disabled",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"no-style"})],l.prototype,"noStyle",void 0),(0,o.Cg)([(0,r.MZ)({type:String,attribute:"draggable-selector"})],l.prototype,"draggableSelector",void 0),(0,o.Cg)([(0,r.MZ)({type:String,attribute:"handle-selector"})],l.prototype,"handleSelector",void 0),(0,o.Cg)([(0,r.MZ)({type:String,attribute:"filter"})],l.prototype,"filter",void 0),(0,o.Cg)([(0,r.MZ)({type:String})],l.prototype,"group",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"invert-swap"})],l.prototype,"invertSwap",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],l.prototype,"options",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],l.prototype,"rollback",void 0),l=(0,o.Cg)([(0,r.EM)("ha-sortable")],l)},34127(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(52630),r=a(5124),s=a(22441),l=e([i]);i=(l.then?(await l)():l)[0];class n extends i.A{static get styles(){return[i.A.styles,r.AH`:host{--wa-tooltip-background-color:var( --ha-tooltip-background-color, var(--ha-color-surface-default) );--wa-tooltip-content-color:var( --ha-tooltip-text-color, var(--primary-text-color) );--wa-tooltip-font-family:var( --ha-tooltip-font-family, var(--ha-font-family-body) );--wa-tooltip-font-size:var( --ha-tooltip-font-size, var(--ha-font-size-m) );--wa-tooltip-font-weight:var( --ha-tooltip-font-weight, var(--ha-font-weight-medium) );--wa-tooltip-line-height:var( --ha-tooltip-line-height, var(--ha-line-height-condensed) );--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var( --ha-tooltip-border-radius, var(--ha-border-radius-md) );--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 0px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}.tooltip::part(popup){animation-duration:var(--ha-tooltip-animation-duration, 0)}.body{box-shadow:var(--ha-tooltip-box-shadow,var(--ha-box-shadow-m))}`]}constructor(...e){super(...e),this.showDelay=350,this.hideDelay=150}}(0,o.Cg)([(0,s.MZ)({attribute:"show-delay",type:Number})],n.prototype,"showDelay",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"hide-delay",type:Number})],n.prototype,"hideDelay",void 0),n=(0,o.Cg)([(0,s.EM)("ha-tooltip")],n),t()}catch(e){t(e)}})},10763(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(53289),r=a(5124),s=a(22441),l=a(35211),n=a(1087),d=a(63130),c=a(14503),h=a(81619),p=a(18350),f=a(15717),u=a(22792),m=e([p,f]);[p,f]=m.then?(await m)():m;const b=e=>{if("object"!=typeof e||null===e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0};class v extends r.WF{setValue(e){try{this._yaml=b(e)?"":(0,i.dump)(e,{schema:this.yamlSchema,quotingType:'"',noRefs:!0})}catch(t){console.error(t,e),alert(`There was an error converting to YAML: ${t}`)}}firstUpdated(){void 0!==this.defaultValue&&this.setValue(this.defaultValue)}willUpdate(e){super.willUpdate(e),this.autoUpdate&&e.has("value")&&this.setValue(this.value)}focus(){this._codeEditor?.codemirror&&this._codeEditor?.codemirror.focus()}disableCodeEditorFullscreen(){this.disableFullscreen=!0,this._codeEditor&&(this._codeEditor.disableFullscreen=!0)}render(){return void 0===this._yaml?r.s6:r.qy` ${this.label?r.qy`<p>${this.label}${this.required?" *":""}</p>`:r.s6} <ha-code-editor .value="${this._yaml}" .readOnly="${this.readOnly}" .disableFullscreen="${this.disableFullscreen}" .inDialog="${this.inDialog}" mode="yaml" lint autocomplete-entities autocomplete-icons .error="${!1===this.isValid}" @value-changed="${this._onChange}" @editor-save="${this._onEditorSave}" dir="ltr"></ha-code-editor> ${this.copyClipboard||this.hasExtraActions?r.qy` <div class="card-actions"> ${this.copyClipboard?r.qy` <ha-button appearance="plain" @click="${this._copyYaml}"> ${this._i18n.localize("ui.components.yaml-editor.copy_to_clipboard")} </ha-button> `:r.s6} <slot name="extra-actions"></slot> </div> `:r.s6} `}_onChange(e){let t;e.stopPropagation(),this._yaml=e.detail.value;let a,o=!0,r=null;if(this._yaml)try{t=(0,i.Hh)(this._yaml,{schema:this.yamlSchema})}catch(e){o=!1,r=e,a=`${this._i18n.localize("ui.components.yaml-editor.error",{reason:e.reason})}${e.mark?` (${this._i18n.localize("ui.components.yaml-editor.error_location",{line:e.mark.line+1,column:e.mark.column+1})})`:""}`}else t={};this._codeEditor?.setYamlError(r),this.value=t,this.isValid=o,(0,n.r)(this,"value-changed",{value:t,isValid:o,errorMsg:a})}get yaml(){return this._yaml}get codemirror(){return this._codeEditor?.codemirror}get hasComments(){return this._codeEditor?.hasComments??!1}_onEditorSave(e){(0,n.r)(this,"editor-save"),e.stopPropagation()}async _copyYaml(){this.yaml&&(await(0,d.l)(this.yaml),(0,h.P)(this,{message:this._i18n.localize("ui.common.copied_clipboard")}))}static get styles(){return[c.RF,r.AH`.card-actions{border-radius:var(--actions-border-radius,var(--ha-border-radius-square) var(--ha-border-radius-square) var(--ha-card-border-radius,var(--ha-border-radius-lg)) var(--ha-card-border-radius,var(--ha-border-radius-lg)));border:1px solid var(--divider-color);padding:5px 16px}ha-code-editor{flex-grow:1;min-height:0}`]}constructor(...e){super(...e),this.yamlSchema=i.my,this.isValid=!0,this.autoUpdate=!1,this.readOnly=!1,this.disableFullscreen=!1,this.inDialog=!1,this.required=!1,this.copyClipboard=!1,this.hasExtraActions=!1,this._yaml=""}}(0,o.Cg)([(0,s.MZ)()],v.prototype,"value",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],v.prototype,"yamlSchema",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],v.prototype,"defaultValue",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"is-valid",type:Boolean})],v.prototype,"isValid",void 0),(0,o.Cg)([(0,s.MZ)()],v.prototype,"label",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"auto-update",type:Boolean})],v.prototype,"autoUpdate",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"read-only",type:Boolean})],v.prototype,"readOnly",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"disable-fullscreen"})],v.prototype,"disableFullscreen",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"in-dialog"})],v.prototype,"inDialog",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],v.prototype,"required",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"copy-clipboard",type:Boolean})],v.prototype,"copyClipboard",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"has-extra-actions",type:Boolean})],v.prototype,"hasExtraActions",void 0),(0,o.Cg)([(0,s.wk)()],v.prototype,"_yaml",void 0),(0,o.Cg)([(0,s.wk)(),(0,l.Fg)({context:u.D5,subscribe:!0})],v.prototype,"_i18n",void 0),(0,o.Cg)([(0,s.P)("ha-code-editor")],v.prototype,"_codeEditor",void 0),v=(0,o.Cg)([(0,s.EM)("ha-yaml-editor")],v),t()}catch(e){t(e)}})},700(e,t,a){a.d(t,{y:()=>s});const o=window;"customIconsets"in o||(o.customIconsets={});const i=o.customIconsets,r=window;"customIcons"in r||(r.customIcons={});const s=new Proxy(r.customIcons,{get:(e,t)=>e[t]??(i[t]?{getIcon:i[t]}:void 0)})},93387(e,t,a){a.d(t,{C:()=>s});a(18111),a(22489),a(61701),a(33110);var o=a(44537),i=a(65522),r=a(8549);const s=(e,t,a)=>{if(null==t)return"";if(!a)return(0,o.e)(t).join(", ");if("text"in a){const{prefix:e,suffix:i}=a.text||{};return(0,o.e)(t).map(t=>`${e||""}${t}${i||""}`).join(", ")}if("number"in a){const{unit_of_measurement:i}=a.number||{};return(0,o.e)(t).map(t=>{const a=Number(t);return isNaN(a)?t:i?`${a}${(0,r.A)(i,e.locale)}${i}`:a.toString()}).join(", ")}if("floor"in a){return(0,o.e)(t).map(t=>{const a=e.floors[t];return a&&a.name||t}).join(", ")}if("area"in a){return(0,o.e)(t).map(t=>{const a=e.areas[t];return a?(0,i.A)(a):t}).join(", ")}if("entity"in a){return(0,o.e)(t).map(t=>{const a=e.states[t];if(!a)return t;return e.formatEntityName(a,[{type:"device"},{type:"entity"}])||t}).join(", ")}if("device"in a){return(0,o.e)(t).map(t=>{const a=e.devices[t];return a&&a.name||t}).join(", ")}if("object"in a){const{fields:i}=a.object??{};return(0,o.e)(t).map(t=>null==t||"object"!=typeof t?String(t):i?Object.entries(i).filter(([e])=>e in t&&null!=t[e]).map(([a,o])=>s(e,t[a],o.selector)).join(" = "):JSON.stringify(t)).join(", ")}return(0,o.e)(t).map(e=>null!=e&&"object"==typeof e?JSON.stringify(e):String(e)).join(", ")}},1135(e,t,a){a.d(t,{O:()=>i});var o=a(1087);const i=(e,t)=>new Promise(i=>{const r=t.cancel,s=t.submit;(0,o.r)(e,"show-dialog",{dialogTag:"dialog-form",dialogImport:()=>a.e(45654).then(a.bind(a,87285)),dialogParams:{...t,cancel:()=>{i(null),r&&r()},submit:e=>{i(e),s&&s(e)}}})})},14503(e,t,a){a.d(t,{RF:()=>r,dp:()=>n,kO:()=>l,nA:()=>s,og:()=>i});var o=a(5124);const i=o.AH`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`,r=o.AH`: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)}${i} .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}`,s=o.AH`ha-adaptive-dialog,ha-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-adaptive-dialog .form,ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-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)}`,l=o.AH`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}}`,n=o.AH`.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}`;o.AH`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`},36918(e,t,a){a.d(t,{o:()=>o});const o=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},89429(e){e.exports=function(){}}};