UNPKG

iobroker.lovelace

Version:

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

2 lines 31.1 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["79390"],{92636:function(t,e,i){i.d(e,{z:()=>a});i(19083),i(61006);const a=t=>(e,i)=>t.includes(e,i)},19631:function(t,e,i){i.a(t,(async function(t,a){try{i.d(e,{Bt:()=>d,T8:()=>c});i(19083);var n=i(16485),o=i(88977),s=i(20382),r=t([n]);n=(r.then?(await r)():r)[0];const l=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],d=t=>t.first_weekday===s.FS.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(t.language).weekInfo.firstDay%7:(0,o.L)(t.language)%7:l.includes(t.first_weekday)?l.indexOf(t.first_weekday):1,c=t=>{const e=d(t);return l[e]};a()}catch(l){a(l)}}))},94947:function(t,e,i){i.a(t,(async function(t,a){try{i.d(e,{G:()=>d});var n=i(16485),o=i(27486),s=i(27046),r=t([n,s]);[n,s]=r.then?(await r)():r;const l=(0,o.Z)((t=>new Intl.RelativeTimeFormat(t.language,{numeric:"auto"}))),d=(t,e,i,a=!0)=>{const n=(0,s.W)(t,i,e);return a?l(e).format(n.value,n.unit):Intl.NumberFormat(e.language,{style:"unit",unit:n.unit,unitDisplay:"long"}).format(Math.abs(n.value))};a()}catch(l){a(l)}}))},87733:function(t,e,i){i.d(e,{f:()=>a});const a=t=>t.charAt(0).toUpperCase()+t.slice(1)},27046:function(t,e,i){i.a(t,(async function(t,a){try{i.d(e,{W:()=>g});i(19423);var n=i(13809),o=i(29558),s=i(94763),r=i(19631),l=t([r]);r=(l.then?(await l)():l)[0];const c=1e3,u=60,h=60*u;function g(t,e=Date.now(),i,a={}){const l=Object.assign(Object.assign({},p),a||{}),d=(+t-+e)/c;if(Math.abs(d)<l.second)return{value:Math.round(d),unit:"second"};const g=d/u;if(Math.abs(g)<l.minute)return{value:Math.round(g),unit:"minute"};const m=d/h;if(Math.abs(m)<l.hour)return{value:Math.round(m),unit:"hour"};const f=new Date(t),v=new Date(e);f.setHours(0,0,0,0),v.setHours(0,0,0,0);const y=(0,n.j)(f,v);if(0===y)return{value:Math.round(m),unit:"hour"};if(Math.abs(y)<l.day)return{value:y,unit:"day"};const _=(0,r.Bt)(i),k=(0,o.z)(f,{weekStartsOn:_}),b=(0,o.z)(v,{weekStartsOn:_}),w=(0,s.p)(k,b);if(0===w)return{value:y,unit:"day"};if(Math.abs(w)<l.week)return{value:w,unit:"week"};const x=f.getFullYear()-v.getFullYear(),A=12*x+f.getMonth()-v.getMonth();return 0===A?{value:w,unit:"week"}:Math.abs(A)<l.month||0===x?{value:A,unit:"month"}:{value:Math.round(x),unit:"year"}}const p={second:45,minute:45,hour:22,day:5,week:4,month:11};a()}catch(d){a(d)}}))},34273:function(t,e,i){var a=i(61701),n=i(72621),o=(i(71695),i(9359),i(31526),i(47021),i(22997),i(57243)),s=i(50778),r=i(5111),l=i(76525);let d,c,u=t=>t;(0,a.Z)([(0,s.Mo)("ha-button-menu")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",key:l.gA,value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"corner",value(){return"BOTTOM_START"}},{kind:"field",decorators:[(0,s.Cb)({attribute:"menu-corner"})],key:"menuCorner",value(){return"START"}},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"x",value(){return null}},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"y",value(){return null}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"multi",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"activatable",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"fixed",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"no-anchor"})],key:"noAnchor",value(){return!1}},{kind:"field",decorators:[(0,s.IO)("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){var t;return null===(t=this._menu)||void 0===t?void 0:t.items}},{kind:"get",key:"selected",value:function(){var t;return null===(t=this._menu)||void 0===t?void 0:t.selected}},{kind:"method",key:"focus",value:function(){var t,e;null!==(t=this._menu)&&void 0!==t&&t.open?this._menu.focusItemAtIndex(0):null===(e=this._triggerButton)||void 0===e||e.focus()}},{kind:"method",key:"render",value:function(){return(0,o.dy)(d||(d=u` <div @click="${0}"> <slot name="trigger" @slotchange="${0}"></slot> </div> <mwc-menu .corner="${0}" .menuCorner="${0}" .fixed="${0}" .multi="${0}" .activatable="${0}" .y="${0}" .x="${0}"> <slot></slot> </mwc-menu> `),this._handleClick,this._setTriggerAria,this.corner,this.menuCorner,this.fixed,this.multi,this.activatable,this.y,this.x)}},{kind:"method",key:"firstUpdated",value:function(t){(0,n.Z)(i,"firstUpdated",this,3)([t]),"rtl"===r.E.document.dir&&this.updateComplete.then((()=>{this.querySelectorAll("mwc-list-item").forEach((t=>{const e=document.createElement("style");e.innerHTML="span.material-icons:first-of-type { margin-left: var(--mdc-list-item-graphic-margin, 32px) !important; margin-right: 0px !important;}",t.shadowRoot.appendChild(e)}))}))}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this.noAnchor?null:this,this._menu.show())}},{kind:"get",key:"_triggerButton",value:function(){return this.querySelector('ha-icon-button[slot="trigger"], mwc-button[slot="trigger"]')}},{kind:"method",key:"_setTriggerAria",value:function(){this._triggerButton&&(this._triggerButton.ariaHasPopup="menu")}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(c||(c=u`:host{display:inline-block;position:relative}::slotted([disabled]){color:var(--disabled-text-color)}`))}}]}}),o.oi)},20130:function(t,e,i){var a=i(61701),n=i(72621),o=(i(71695),i(47021),i(39785)),s=i(52876),r=i(50778),l=i(57243),d=i(5111);let c,u,h,g=t=>t;(0,a.Z)([(0,r.Mo)("ha-fab")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"method",key:"firstUpdated",value:function(t){(0,n.Z)(i,"firstUpdated",this,3)([t]),this.style.setProperty("--mdc-theme-secondary","var(--primary-color)")}},{kind:"field",static:!0,key:"styles",value(){return[s.W,(0,l.iv)(c||(c=g`:host .mdc-fab--extended .mdc-fab__icon{margin-inline-start:-8px;margin-inline-end:12px;direction:var(--direction)}:disabled{--mdc-theme-secondary:var(--disabled-text-color);pointer-events:none}`)),"rtl"===d.E.document.dir?(0,l.iv)(u||(u=g`:host .mdc-fab--extended .mdc-fab__icon{direction:rtl}`)):(0,l.iv)(h||(h=g``))]}}]}}),o._)},59959:function(t,e,i){i.a(t,(async function(t,a){try{i.r(e),i.d(e,{HaIconOverflowMenu:()=>b});var n=i(61701),o=(i(71695),i(9359),i(70104),i(47021),i(57243)),s=i(50778),r=i(35359),l=i(28008),d=(i(34273),i(23334),i(7285),i(37583),i(56032)),c=t([d]);d=(c.then?(await c)():c)[0];let u,h,g,p,m,f,v,y,_=t=>t;const k="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";let b=(0,n.Z)([(0,s.Mo)("ha-icon-overflow-menu")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Array})],key:"items",value(){return[]}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,o.dy)(u||(u=_` ${0} `),this.narrow?(0,o.dy)(h||(h=_` <ha-button-menu @click="${0}" @closed="${0}" class="ha-icon-overflow-menu-overflow" absolute> <ha-icon-button .label="${0}" .path="${0}" slot="trigger"></ha-icon-button> ${0} </ha-button-menu>`),this._handleIconOverflowMenuOpened,this._handleIconOverflowMenuClosed,this.hass.localize("ui.common.overflow_menu"),k,this.items.map((t=>t.divider?(0,o.dy)(g||(g=_`<li divider role="separator"></li>`)):(0,o.dy)(p||(p=_`<ha-list-item graphic="icon" ?disabled="${0}" @click="${0}" class="${0}"> <div slot="graphic"> <ha-svg-icon class="${0}" .path="${0}"></ha-svg-icon> </div> ${0} </ha-list-item> `),t.disabled,t.action,(0,r.$)({warning:Boolean(t.warning)}),(0,r.$)({warning:Boolean(t.warning)}),t.path,t.label)))):(0,o.dy)(m||(m=_` ${0} `),this.items.map((t=>{var e;return t.narrowOnly?o.Ld:t.divider?(0,o.dy)(f||(f=_`<div role="separator"></div>`)):(0,o.dy)(v||(v=_`<ha-tooltip .disabled="${0}" .content="${0}"> <ha-icon-button @click="${0}" .label="${0}" .path="${0}" ?disabled="${0}"></ha-icon-button> </ha-tooltip>`),!t.tooltip,null!==(e=t.tooltip)&&void 0!==e?e:"",t.action,t.label,t.path,t.disabled)}))))}},{kind:"method",key:"_handleIconOverflowMenuOpened",value:function(t){t.stopPropagation();const e=this.closest(".mdc-data-table__row");e&&(e.style.zIndex="1")}},{kind:"method",key:"_handleIconOverflowMenuClosed",value:function(){const t=this.closest(".mdc-data-table__row");t&&(t.style.zIndex="")}},{kind:"get",static:!0,key:"styles",value:function(){return[l.Qx,(0,o.iv)(y||(y=_`:host{display:flex;justify-content:flex-end}li[role=separator]{border-bottom-color:var(--divider-color)}div[role=separator]{border-right:1px solid var(--divider-color);width:1px}ha-list-item[disabled] ha-svg-icon{color:var(--disabled-text-color)}`))]}}]}}),o.oi);a()}catch(u){a(u)}}))},7285:function(t,e,i){i.d(e,{M:()=>g});var a=i(61701),n=i(72621),o=(i(71695),i(47021),i(65703)),s=i(46289),r=i(57243),l=i(50778);let d,c,u,h=t=>t,g=(0,a.Z)([(0,l.Mo)("ha-list-item")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,n.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[s.W,(0,r.iv)(d||(d=h`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`)),"rtl"===document.dir?(0,r.iv)(c||(c=h`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,r.iv)(u||(u=h``))]}}]}}),o.K)},95975:function(t,e,i){i.a(t,(async function(t,e){try{var a=i(61701),n=i(72621),o=(i(71695),i(47021),i(74760)),s=i(57243),r=i(50778),l=i(94947),d=i(87733),c=t([l]);l=(c.then?(await c)():c)[0];(0,a.Z)([(0,r.Mo)("ha-relative-time")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"datetime",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"capitalize",value(){return!1}},{kind:"field",key:"_interval",value:void 0},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._clearInterval()}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this.datetime&&this._startInterval()}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"firstUpdated",value:function(t){(0,n.Z)(i,"firstUpdated",this,3)([t]),this._updateRelative()}},{kind:"method",key:"update",value:function(t){(0,n.Z)(i,"update",this,3)([t]),this._updateRelative()}},{kind:"method",key:"_clearInterval",value:function(){this._interval&&(window.clearInterval(this._interval),this._interval=void 0)}},{kind:"method",key:"_startInterval",value:function(){this._clearInterval(),this._interval=window.setInterval((()=>this._updateRelative()),6e4)}},{kind:"method",key:"_updateRelative",value:function(){if(this.datetime){const t="string"==typeof this.datetime?(0,o.D)(this.datetime):this.datetime,e=(0,l.G)(t,this.hass.locale);this.innerHTML=this.capitalize?(0,d.f)(e):e}else this.innerHTML=this.hass.localize("ui.components.relative_time.never")}}]}}),s.fl);e()}catch(u){e(u)}}))},56032:function(t,e,i){i.a(t,(async function(t,e){try{var a=i(61701),n=(i(71695),i(47021),i(80519)),o=i(1261),s=i(57243),r=i(50778),l=i(85605),d=t([n]);n=(d.then?(await d)():d)[0];let c,u=t=>t;(0,l.jx)("tooltip.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:150,easing:"ease"}}),(0,l.jx)("tooltip.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:400,easing:"ease"}});(0,a.Z)([(0,r.Mo)("ha-tooltip")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[o.Z,(0,s.iv)(c||(c=u`:host{--sl-tooltip-background-color:var(--secondary-background-color);--sl-tooltip-color:var(--primary-text-color);--sl-tooltip-font-family:Roboto,sans-serif;--sl-tooltip-font-size:12px;--sl-tooltip-font-weight:normal;--sl-tooltip-line-height:1;--sl-tooltip-padding:8px;--sl-tooltip-border-radius:var(--ha-tooltip-border-radius, 4px);--sl-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 8px);--sl-z-index-tooltip:var(--ha-tooltip-z-index, 1000)}`))]}}]}}),n.Z);e()}catch(c){e(c)}}))},14473:function(t,e,i){i.d(e,{B$:()=>r,EQ:()=>f,Es:()=>c,Gd:()=>d,HF:()=>b,Ip:()=>k,J8:()=>A,Kc:()=>_,Pl:()=>w,SC:()=>u,SQ:()=>p,W9:()=>y,Xm:()=>x,Yc:()=>l,r4:()=>g,sq:()=>m});i(71695),i(92745),i(9359),i(31526),i(70104),i(19423),i(47021);var a=i(83523),n=i(95262),o=i(68418),s=i(58776);const r="single",l=10,d=t=>{if("condition"in t&&Array.isArray(t.condition))return{condition:"and",conditions:t.condition};for(const e of["and","or","not"])if(e in t)return{condition:e,conditions:t[e]};return t},c=(t,e)=>{t.callService("automation","trigger",{entity_id:e,skip_condition:!0})},u=(t,e)=>t.callApi("DELETE",`config/automation/config/${e}`);let h;const g=(t,e)=>t.callApi("GET",`config/automation/config/${e}`),p=(t,e)=>t.callWS({type:"automation/config",entity_id:e}),m=(t,e,i)=>t.callApi("POST",`config/automation/config/${e}`,i),f=t=>{t=v(t);for(const e of["triggers","conditions","actions"]){const i=t[e];i&&!Array.isArray(i)&&(t[e]=[i])}return t},v=t=>("trigger"in t&&("triggers"in t||(t.triggers=t.trigger),delete t.trigger),"condition"in t&&("conditions"in t||(t.conditions=t.condition),delete t.condition),"action"in t&&("actions"in t||(t.actions=t.action),delete t.action),t.triggers&&(t.triggers=y(t.triggers)),t.actions&&(t.actions=(0,o.eR)(t.actions)),t),y=t=>t?Array.isArray(t)?t.map(y):("triggers"in t&&t.triggers&&(t.triggers=y(t.triggers)),"platform"in t&&("trigger"in t||(t.trigger=t.platform),delete t.platform),t):t,_=t=>{if(!t)return[];const e=[];return(0,n.r)(t).forEach((t=>{"triggers"in t?t.triggers&&e.push(..._(t.triggers)):e.push(t)})),e},k=(t,e)=>{h=t;const i=e?`?${(0,s.ou)({expanded:"1"})}`:"";(0,a.c)(`/config/automation/edit/new${i}`)},b=t=>{k(Object.assign(Object.assign({},t),{},{id:void 0,alias:void 0}))},w=()=>{const t=h;return h=void 0,t},x=(t,e,i,a)=>t.connection.subscribeMessage(e,{type:"subscribe_trigger",trigger:i,variables:a}),A=(t,e,i)=>t.callWS({type:"test_condition",condition:e,variables:i})},68418:function(t,e,i){i.d(e,{EH:()=>d,FI:()=>w,Kx:()=>h,Pw:()=>x,TL:()=>g,eM:()=>k,eR:()=>$,kC:()=>m,oE:()=>_,oR:()=>v,rg:()=>b,rq:()=>f,sf:()=>A,vA:()=>c});i(71695),i(9359),i(70104),i(47021);var a=i(62900),n=i(92636),o=i(83523),s=i(14473),r=i(97969),l=i(58776);const d=["single","restart","queued","parallel"],c=(0,n.z)(["queued","parallel"]),u=(0,a.Ry)({alias:(0,a.jt)((0,a.Z_)()),continue_on_error:(0,a.jt)((0,a.O7)()),enabled:(0,a.jt)((0,a.O7)())}),h=(0,a.Ry)({entity_id:(0,a.jt)((0,a.G0)([(0,a.Z_)(),(0,a.IX)((0,a.Z_)())])),device_id:(0,a.jt)((0,a.G0)([(0,a.Z_)(),(0,a.IX)((0,a.Z_)())])),area_id:(0,a.jt)((0,a.G0)([(0,a.Z_)(),(0,a.IX)((0,a.Z_)())])),floor_id:(0,a.jt)((0,a.G0)([(0,a.Z_)(),(0,a.IX)((0,a.Z_)())])),label_id:(0,a.jt)((0,a.G0)([(0,a.Z_)(),(0,a.IX)((0,a.Z_)())]))}),g=(0,a.f0)(u,(0,a.Ry)({action:(0,a.jt)((0,a.Z_)()),service_template:(0,a.jt)((0,a.Z_)()),entity_id:(0,a.jt)((0,a.Z_)()),target:(0,a.jt)(h),data:(0,a.jt)((0,a.Ry)()),response_variable:(0,a.jt)((0,a.Z_)()),metadata:(0,a.jt)((0,a.Ry)())})),p=(0,a.f0)(u,(0,a.Ry)({action:(0,a.i0)("media_player.play_media"),target:(0,a.jt)((0,a.Ry)({entity_id:(0,a.jt)((0,a.Z_)())})),entity_id:(0,a.jt)((0,a.Z_)()),data:(0,a.Ry)({media_content_id:(0,a.Z_)(),media_content_type:(0,a.Z_)()}),metadata:(0,a.Ry)()})),m=(t,e,i)=>t.callService("script",e,i),f=t=>"off"===t.state||!!("on"===t.state&&c(t.attributes.mode)&&t.attributes.current<t.attributes.max),v=(t,e)=>t.callApi("DELETE",`config/script/config/${e}`);let y;const _=(t,e)=>t.callApi("GET",`config/script/config/${e}`),k=(t,e)=>t.callWS({type:"script/config",entity_id:e}),b=(t,e)=>{y=t;const i=e?`?${(0,l.ou)({expanded:"1"})}`:"";(0,o.c)(`/config/script/edit/new${i}`)},w=()=>{const t=y;return y=void 0,t},x=t=>"delay"in t?"delay":"wait_template"in t?"wait_template":["condition","and","or","not"].some((e=>e in t))?"check_condition":"event"in t?"fire_event":"device_id"in t?"device_action":"repeat"in t?"repeat":"choose"in t?"choose":"if"in t?"if":"wait_for_trigger"in t?"wait_for_trigger":"variables"in t?"variables":"stop"in t?"stop":"sequence"in t?"sequence":"parallel"in t?"parallel":"set_conversation_response"in t?"set_conversation_response":"action"in t||"service"in t?"metadata"in t&&(0,a.is)(t,p)?"play_media":"service":"unknown",A=(t,e)=>{var i;const a=null===(i=t.services.script[(0,r.p)(e)])||void 0===i?void 0:i.fields;return void 0!==a&&Object.keys(a).length>0},$=t=>{if(!t)return t;if(Array.isArray(t))return t.map($);if("service"in t&&("action"in t||(t.action=t.service),delete t.service),"scene"in t&&(t.action="scene.turn_on",t.target={entity_id:t.scene},delete t.scene),"sequence"in t)for(const i of t.sequence)$(i);const e=x(t);if("parallel"===e){$(t.parallel)}if("choose"===e){const e=t;if(Array.isArray(e.choose))for(const t of e.choose)$(t.sequence);else e.choose&&$(e.choose.sequence);e.default&&$(e.default)}if("repeat"===e){$(t.repeat.sequence)}if("if"===e){const e=t;$(e.then),e.else&&$(e.else)}if("wait_for_trigger"===e){const e=t;(0,s.W9)(e.wait_for_trigger)}return t}},44643:function(t,e,i){i.d(e,{$3:()=>n,AM:()=>a,Lp:()=>s,Pn:()=>r,ln:()=>o});i(19423),i(40251);const a="tag_scanned",n=async t=>t.callWS({type:"tag/list"}),o=async(t,e,i)=>t.callWS(Object.assign({type:"tag/create",tag_id:i},e)),s=async(t,e,i)=>t.callWS(Object.assign(Object.assign({},i),{},{type:"tag/update",tag_id:e})),r=async(t,e)=>t.callWS({type:"tag/delete",tag_id:e})},7658:function(t,e,i){i.a(t,(async function(t,a){try{i.r(e),i.d(e,{HaConfigTags:()=>P});var n=i(61701),o=i(72621),s=(i(71695),i(9359),i(56475),i(1331),i(70104),i(19423),i(40251),i(47021),i(57243)),r=i(50778),l=i(27486),d=i(68958),c=(i(20130),i(23334),i(59959)),u=i(95975),h=i(14473),g=i(44643),p=i(76131),m=i(38419),f=i(6736),v=i(73192),y=i(82967),_=i(28968),k=(i(17598),t([c,u,m]));[c,u,m]=k.then?(await k)():k;let b,w,x,A,$,H,C,M,T=t=>t;const V="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",Z="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",j="M19 19V15H17V19H15L18 22L21 19H19M12.1 19H11V21H9V19H7C5.9 19 5 18.1 5 17V15H3V13H5V11H3V9H5V7C5 5.9 5.9 5 7 5H9V3H11V5H13V3H15V5H17C18.1 5 19 5.9 19 7V9H21V11H19V12.1C18.7 12 18.3 12 18 12S17.3 12 17 12.1V7H7V17H12.1C12 17.3 12 17.7 12 18S12 18.7 12.1 19M9 15H12.8C13.3 14.1 14.1 13.3 15 12.8V9H9V15M11 11H13V13H11V11Z",z="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",I="M12,2A2,2 0 0,1 14,4C14,4.74 13.6,5.39 13,5.73V7H14A7,7 0 0,1 21,14H22A1,1 0 0,1 23,15V18A1,1 0 0,1 22,19H21V20A2,2 0 0,1 19,22H5A2,2 0 0,1 3,20V19H2A1,1 0 0,1 1,18V15A1,1 0 0,1 2,14H3A7,7 0 0,1 10,7H11V5.73C10.4,5.39 10,4.74 10,4A2,2 0 0,1 12,2M7.5,13A2.5,2.5 0 0,0 5,15.5A2.5,2.5 0 0,0 7.5,18A2.5,2.5 0 0,0 10,15.5A2.5,2.5 0 0,0 7.5,13M16.5,13A2.5,2.5 0 0,0 14,15.5A2.5,2.5 0 0,0 16.5,18A2.5,2.5 0 0,0 19,15.5A2.5,2.5 0 0,0 16.5,13Z";let P=(0,n.Z)([(0,r.Mo)("ha-config-tags")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:"is-wide",type:Boolean})],key:"isWide",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_tags",value(){return[]}},{kind:"get",key:"_canWriteTags",value:function(){var t;return null===(t=this.hass.auth.external)||void 0===t?void 0:t.config.canWriteTag}},{kind:"field",decorators:[(0,d.t)({storage:"sessionStorage",key:"tags-table-search",state:!0,subscribe:!1})],key:"_filter",value(){return""}},{kind:"field",key:"_columns",value(){return(0,l.Z)((t=>{const e={icon:{title:"",moveable:!1,showNarrow:!0,label:t("ui.panel.config.tag.headers.icon"),type:"icon",template:t=>(0,s.dy)(b||(b=T`<tag-image .tag="${0}"></tag-image>`),t)},display_name:{title:t("ui.panel.config.tag.headers.name"),main:!0,sortable:!0,filterable:!0,flex:2},last_scanned_datetime:{title:t("ui.panel.config.tag.headers.last_scanned"),sortable:!0,direction:"desc",template:t=>(0,s.dy)(w||(w=T` ${0} `),t.last_scanned_datetime?(0,s.dy)(x||(x=T`<ha-relative-time .hass="${0}" .datetime="${0}" capitalize></ha-relative-time>`),this.hass,t.last_scanned_datetime):this.hass.localize("ui.panel.config.tag.never_scanned"))}};return this._canWriteTags&&(e.write={title:"",label:t("ui.panel.config.tag.headers.write"),type:"icon-button",showNarrow:!0,template:t=>(0,s.dy)(A||(A=T`<ha-icon-button .tag="${0}" @click="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),t,this._handleWriteClick,this.hass.localize("ui.panel.config.tag.write"),j)}),e.actions={title:"",label:t("ui.panel.config.generic.headers.actions"),showNarrow:!0,moveable:!1,hideable:!1,type:"overflow-menu",template:t=>(0,s.dy)($||($=T` <ha-icon-overflow-menu .hass="${0}" narrow .items="${0}"> </ha-icon-overflow-menu> `),this.hass,[{label:this.hass.localize("ui.panel.config.tag.create_automation"),path:I,action:()=>this._createAutomation(t)},{label:this.hass.localize("ui.common.delete"),path:V,action:()=>this._removeTag(t),warning:!0}])},e}))}},{kind:"field",key:"_data",value(){return(0,l.Z)((t=>t.map((t=>Object.assign(Object.assign({},t),{},{display_name:t.name||t.id,last_scanned_datetime:t.last_scanned?new Date(t.last_scanned):null})))))}},{kind:"method",key:"firstUpdated",value:function(t){(0,o.Z)(i,"firstUpdated",this,3)([t]),this._fetchTags()}},{kind:"method",key:"hassSubscribe",value:function(){return[this.hass.connection.subscribeEvents((t=>{const e=this._tags.find((e=>e.id===t.data.tag_id));e?(e.last_scanned=t.time_fired,this._tags=[...this._tags]):this._fetchTags()}),g.AM)]}},{kind:"method",key:"render",value:function(){return(0,s.dy)(H||(H=T` <hass-tabs-subpage-data-table .hass="${0}" .narrow="${0}" back-path="/config" .route="${0}" .tabs="${0}" .columns="${0}" .data="${0}" .noDataText="${0}" .filter="${0}" @search-changed="${0}" has-fab clickable @row-click="${0}" id="id"> <ha-icon-button slot="toolbar-icon" @click="${0}" .label="${0}" .path="${0}"></ha-icon-button> <ha-fab slot="fab" .label="${0}" extended @click="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-fab> </hass-tabs-subpage-data-table> `),this.hass,this.narrow,this.route,y.configSections.tags,this._columns(this.hass.localize),this._data(this._tags),this.hass.localize("ui.panel.config.tag.no_tags"),this._filter,this._handleSearchChange,this._editTag,this._showHelp,this.hass.localize("ui.common.help"),Z,this.hass.localize("ui.panel.config.tag.add_tag"),this._addTag,z)}},{kind:"field",key:"_handleWriteClick",value(){return t=>this._openWrite(t.currentTarget.tag)}},{kind:"field",key:"_createAutomation",value(){return t=>{const e={alias:this.hass.localize("ui.panel.config.tag.automation_title",{name:t.name||t.id}),trigger:[{trigger:"tag",tag_id:t.id}]};(0,h.Ip)(e)}}},{kind:"field",key:"_editTag",value(){return t=>{const e=this._tags.find((e=>e.id===t.detail.id));this._openDialog(e)}}},{kind:"method",key:"_showHelp",value:function(){(0,p.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.tag.caption"),text:(0,s.dy)(C||(C=T` <p> ${0} </p> <p> <a href="${0}" target="_blank" rel="noreferrer"> ${0} </a> </p> `),this.hass.localize("ui.panel.config.tag.detail.usage",{companion_link:(0,s.dy)(M||(M=T`<a href="https://companion.home-assistant.io/" target="_blank" rel="noreferrer">${0}</a>`),this.hass.localize("ui.panel.config.tag.detail.companion_apps"))}),(0,v.R)(this.hass,"/integrations/tag/"),this.hass.localize("ui.panel.config.tag.learn_more"))})}},{kind:"method",key:"_fetchTags",value:async function(){this._tags=await(0,g.$3)(this.hass)}},{kind:"method",key:"_openWrite",value:function(t){this.hass.auth.external.fireMessage({type:"tag/write",payload:{name:t.name||null,tag:t.id}})}},{kind:"method",key:"_addTag",value:function(){this._openDialog()}},{kind:"method",key:"_openDialog",value:function(t){(0,_.U)(this,{entry:t,openWrite:this._canWriteTags?t=>this._openWrite(t):void 0,createEntry:(t,e)=>this._createTag(t,e),updateEntry:t?e=>this._updateTag(t,e):void 0,removeEntry:t?()=>this._removeTag(t):void 0})}},{kind:"method",key:"_createTag",value:async function(t,e){const i=await(0,g.ln)(this.hass,t,e);return this._tags=[...this._tags,i],i}},{kind:"method",key:"_updateTag",value:async function(t,e){const i=await(0,g.Lp)(this.hass,t.id,e);return this._tags=this._tags.map((e=>e.id===t.id?i:e)),i}},{kind:"method",key:"_removeTag",value:async function(t){if(!(await(0,p.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.tag.confirm_delete_title"),text:this.hass.localize("ui.panel.config.tag.confirm_delete",{tag:t.name||t.id}),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0})))return!1;try{return await(0,g.Pn)(this.hass,t.id),this._tags=this._tags.filter((e=>e.id!==t.id)),!0}catch(e){return!1}}},{kind:"method",key:"_handleSearchChange",value:function(t){this._filter=t.detail.value}}]}}),(0,f.f)(s.oi));a()}catch(b){a(b)}}))},28968:function(t,e,i){i.d(e,{U:()=>o});i(71695),i(40251),i(47021);var a=i(36522);const n=()=>Promise.all([i.e("2142"),i.e("53750"),i.e("21319"),i.e("24650")]).then(i.bind(i,59694)),o=(t,e)=>{(0,a.B)(t,"show-dialog",{dialogTag:"dialog-tag-detail",dialogImport:n,dialogParams:e})}},17598:function(t,e,i){var a=i(61701),n=(i(71695),i(47021),i(57243)),o=i(50778);i(37583);let s,r,l=t=>t;(0,a.Z)([(0,o.Mo)("tag-image")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"tag",value:void 0},{kind:"field",key:"_timeout",value:void 0},{kind:"method",key:"updated",value:function(){var t;const e=null!==(t=this.tag)&&void 0!==t&&t.last_scanned_datetime?(new Date).getTime()-this.tag.last_scanned_datetime.getTime():void 0;e&&e<1e3?(this._timeout?(clearTimeout(this._timeout),this._timeout=void 0,this.classList.remove("just-scanned"),requestAnimationFrame((()=>this.classList.add("just-scanned")))):this.classList.add("just-scanned"),this._timeout=window.setTimeout((()=>{this.classList.remove("just-scanned"),this._timeout=void 0}),1e4)):(!e||e>1e4)&&(clearTimeout(this._timeout),this._timeout=void 0,this.classList.remove("just-scanned"))}},{kind:"method",key:"render",value:function(){return this.tag?(0,n.dy)(s||(s=l`<div class="container"> <div class="image"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> </div>`),"M18,6H13A2,2 0 0,0 11,8V10.28C10.41,10.62 10,11.26 10,12A2,2 0 0,0 12,14C13.11,14 14,13.1 14,12C14,11.26 13.6,10.62 13,10.28V8H16V16H8V8H10V6H8L6,6V18H18M20,20H4V4H20M20,2H4A2,2 0 0,0 2,4V20A2,2 0 0,0 4,22H20C21.11,22 22,21.1 22,20V4C22,2.89 21.11,2 20,2Z"):n.Ld}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(r||(r=l`.image{height:100%;width:100%;background-size:cover;border-radius:50%;display:flex;justify-content:center;align-items:center}.container{height:40px;width:40px;border-radius:50%}:host(.just-scanned) .container{animation:glow 10s}@keyframes glow{0%{box-shadow:0px 0px 24px 0px rgba(var(--rgb-primary-color),0)}10%{box-shadow:0px 0px 24px 0px rgba(var(--rgb-primary-color),1)}100%{box-shadow:0px 0px 24px 0px rgba(var(--rgb-primary-color),0)}}`))}}]}}),n.oi)},16485:function(t,e,i){i.a(t,(async function(t,e){try{i(71695),i(92745),i(40251),i(47021);var a=i(61449),n=i(40574),o=i(30532),s=i(41674),r=i(49722),l=i(76632),d=i(7884),c=i(35185),u=i(65401),h=i(44180),g=i(49447);const t=async()=>{const t=(0,h.sS)(),e=[];(0,o.shouldPolyfill)()&&await Promise.all([i.e("80210"),i.e("74055")]).then(i.bind(i,98133)),(0,r.shouldPolyfill)()&&await Promise.all([i.e("2142"),i.e("75297"),i.e("80210"),i.e("60251")]).then(i.bind(i,59095)),(0,a.shouldPolyfill)(t)&&e.push(Promise.all([i.e("2142"),i.e("75297"),i.e("68250")]).then(i.bind(i,80561)).then((()=>(0,g.H)()))),(0,u.shouldPolyfill)()&&e.push(Promise.all([i.e("2142"),i.e("75297"),i.e("65578")]).then(i.bind(i,97995))),(0,n.shouldPolyfill)(t)&&e.push(Promise.all([i.e("2142"),i.e("75297"),i.e("59826")]).then(i.bind(i,31514))),(0,s.shouldPolyfill)(t)&&e.push(Promise.all([i.e("2142"),i.e("75297"),i.e("23649")]).then(i.bind(i,93840))),(0,l.shouldPolyfill)(t)&&e.push(Promise.all([i.e("2142"),i.e("75297"),i.e("42831")]).then(i.bind(i,29559))),(0,d.shouldPolyfill)(t)&&e.push(Promise.all([i.e("2142"),i.e("75297"),i.e("57377")]).then(i.bind(i,39030)).then((()=>i.e("61236").then(i.t.bind(i,4121,23))))),(0,c.shouldPolyfill)(t)&&e.push(Promise.all([i.e("2142"),i.e("75297"),i.e("13870")]).then(i.bind(i,74546))),0!==e.length&&await Promise.all(e).then((()=>(0,g.n)(t)))};await t(),e()}catch(p){e(p)}}),1)},73192:function(t,e,i){i.d(e,{R:()=>a});const a=(t,e)=>`https://www.iobroker.net/#${t.language&&t.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`}}]); //# sourceMappingURL=79390.81e6fc8066180ad0.js.map