iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 29.5 kB
JavaScript
export const __webpack_ids__=["79390"];export const __webpack_modules__={92636:function(t,e,i){i.d(e,{z:()=>a});const a=t=>(e,i)=>t.includes(e,i)},19631:function(t,e,i){i.d(e,{Bt:()=>s,T8:()=>r});var a=i(88977),n=i(20382);const o=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],s=t=>t.first_weekday===n.FS.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(t.language).weekInfo.firstDay%7:(0,a.L)(t.language)%7:o.includes(t.first_weekday)?o.indexOf(t.first_weekday):1,r=t=>{const e=s(t);return o[e]}},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(t){a(t)}}))},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:()=>u});var n=i(13809),o=i(29558),s=i(94763),r=i(19631);const l=1e3,d=60,c=60*d;function u(t,e=Date.now(),i,a={}){const u={...h,...a||{}},p=(+t-+e)/l;if(Math.abs(p)<u.second)return{value:Math.round(p),unit:"second"};const g=p/d;if(Math.abs(g)<u.minute)return{value:Math.round(g),unit:"minute"};const m=p/c;if(Math.abs(m)<u.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)<u.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)<u.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)<u.month||0===x?{value:A,unit:"month"}:{value:Math.round(x),unit:"year"}}const h={second:45,minute:45,hour:22,day:5,week:4,month:11};a()}catch(p){a(p)}}))},34273:function(t,e,i){var a=i(44249),n=i(72621),o=(i(9359),i(31526),i(22997),i(57243)),s=i(15093),r=i(5111),l=i(76525);(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:()=>"BOTTOM_START"},{kind:"field",decorators:[(0,s.Cb)({attribute:"menu-corner"})],key:"menuCorner",value:()=>"START"},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"x",value:()=>null},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"y",value:()=>null},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"multi",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"activatable",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"fixed",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"no-anchor"})],key:"noAnchor",value:()=>!1},{kind:"field",decorators:[(0,s.IO)("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){return this._menu?.items}},{kind:"get",key:"selected",value:function(){return this._menu?.selected}},{kind:"method",key:"focus",value:function(){this._menu?.open?this._menu.focusItemAtIndex(0):this._triggerButton?.focus()}},{kind:"method",key:"render",value:function(){return o.dy` <div @click="${this._handleClick}"> <slot name="trigger" @slotchange="${this._setTriggerAria}"></slot> </div> <mwc-menu .corner="${this.corner}" .menuCorner="${this.menuCorner}" .fixed="${this.fixed}" .multi="${this.multi}" .activatable="${this.activatable}" .y="${this.y}" .x="${this.x}"> <slot></slot> </mwc-menu> `}},{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:()=>o.iv`:host{display:inline-block;position:relative}::slotted([disabled]){color:var(--disabled-text-color)}`}]}}),o.oi)},20130:function(t,e,i){var a=i(44249),n=i(72621),o=i(39785),s=i(52876),r=i(15093),l=i(57243),d=i(5111);(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:()=>[s.W,l.iv`: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?l.iv`:host .mdc-fab--extended .mdc-fab__icon{direction:rtl}`:l.iv``]}]}}),o._)},59959:function(t,e,i){i.a(t,(async function(t,a){try{i.r(e),i.d(e,{HaIconOverflowMenu:()=>h});var n=i(44249),o=(i(9359),i(70104),i(57243)),s=i(15093),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];const u="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 h=(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:()=>[]},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"method",key:"render",value:function(){return o.dy` ${this.narrow?o.dy` <ha-button-menu @click="${this._handleIconOverflowMenuOpened}" @closed="${this._handleIconOverflowMenuClosed}" class="ha-icon-overflow-menu-overflow" absolute> <ha-icon-button .label="${this.hass.localize("ui.common.overflow_menu")}" .path="${u}" slot="trigger"></ha-icon-button> ${this.items.map((t=>t.divider?o.dy`<li divider role="separator"></li>`:o.dy`<ha-list-item graphic="icon" ?disabled="${t.disabled}" @click="${t.action}" class="${(0,r.$)({warning:Boolean(t.warning)})}"> <div slot="graphic"> <ha-svg-icon class="${(0,r.$)({warning:Boolean(t.warning)})}" .path="${t.path}"></ha-svg-icon> </div> ${t.label} </ha-list-item> `))} </ha-button-menu>`:o.dy` ${this.items.map((t=>t.narrowOnly?o.Ld:t.divider?o.dy`<div role="separator"></div>`:o.dy`<ha-tooltip .disabled="${!t.tooltip}" .content="${t.tooltip??""}"> <ha-icon-button @click="${t.action}" .label="${t.label}" .path="${t.path}" ?disabled="${t.disabled}"></ha-icon-button> </ha-tooltip>`))} `} `}},{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,o.iv`: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(t){a(t)}}))},7285:function(t,e,i){i.d(e,{M:()=>d});var a=i(44249),n=i(72621),o=i(65703),s=i(46289),r=i(57243),l=i(15093);let d=(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,r.iv`: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?r.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:r.iv``]}}]}}),o.K)},95975:function(t,e,i){i.a(t,(async function(t,e){try{var a=i(44249),n=i(72621),o=i(74760),s=i(57243),r=i(15093),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:()=>!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(t){e(t)}}))},56032:function(t,e,i){i.a(t,(async function(t,e){try{var a=i(44249),n=i(80519),o=i(1261),s=i(57243),r=i(15093),l=i(85605),d=t([n]);n=(d.then?(await d)():d)[0],(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:()=>[o.Z,s.iv`: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(t){e(t)}}))},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:()=>g,W9:()=>y,Xm:()=>x,Yc:()=>l,r4:()=>p,sq:()=>m});i(92745),i(9359),i(31526),i(70104);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 p=(t,e)=>t.callApi("GET",`config/automation/config/${e}`),g=(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({...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:()=>p,eM:()=>k,eR:()=>$,kC:()=>m,oE:()=>_,oR:()=>v,rg:()=>b,rq:()=>f,sf:()=>A,vA:()=>c});i(9359),i(70104);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_)())]))}),p=(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)())})),g=(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,g)?"play_media":"service":"unknown",A=(t,e)=>{const i=t.services.script[(0,r.p)(e)]?.fields;return void 0!==i&&Object.keys(i).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 e of t.sequence)$(e);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});const a="tag_scanned",n=async t=>t.callWS({type:"tag/list"}),o=async(t,e,i)=>t.callWS({type:"tag/create",tag_id:i,...e}),s=async(t,e,i)=>t.callWS({...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:()=>$});var n=i(44249),o=i(72621),s=(i(9359),i(56475),i(1331),i(70104),i(57243)),r=i(15093),l=i(27486),d=i(68958),c=(i(20130),i(23334),i(59959)),u=i(95975),h=i(14473),p=i(44643),g=i(76131),m=(i(38419),i(6736)),f=i(73192),v=i(82967),y=i(28968),_=(i(17598),t([c,u]));[c,u]=_.then?(await _)():_;const k="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",b="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",w="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",x="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",A="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 $=(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:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_tags",value:()=>[]},{kind:"get",key:"_canWriteTags",value:function(){return this.hass.auth.external?.config.canWriteTag}},{kind:"field",decorators:[(0,d.t)({storage:"sessionStorage",key:"tags-table-search",state:!0,subscribe:!1})],key:"_filter",value:()=>""},{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=>s.dy`<tag-image .tag="${t}"></tag-image>`},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=>s.dy` ${t.last_scanned_datetime?s.dy`<ha-relative-time .hass="${this.hass}" .datetime="${t.last_scanned_datetime}" capitalize></ha-relative-time>`: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=>s.dy`<ha-icon-button .tag="${t}" @click="${this._handleWriteClick}" .label="${this.hass.localize("ui.panel.config.tag.write")}" .path="${w}"></ha-icon-button>`}),e.actions={title:"",label:t("ui.panel.config.generic.headers.actions"),showNarrow:!0,moveable:!1,hideable:!1,type:"overflow-menu",template:t=>s.dy` <ha-icon-overflow-menu .hass="${this.hass}" narrow .items="${[{label:this.hass.localize("ui.panel.config.tag.create_automation"),path:A,action:()=>this._createAutomation(t)},{label:this.hass.localize("ui.common.delete"),path:k,action:()=>this._removeTag(t),warning:!0}]}"> </ha-icon-overflow-menu> `},e}))}},{kind:"field",key:"_data",value:()=>(0,l.Z)((t=>t.map((t=>({...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()}),p.AM)]}},{kind:"method",key:"render",value:function(){return s.dy` <hass-tabs-subpage-data-table .hass="${this.hass}" .narrow="${this.narrow}" back-path="/config" .route="${this.route}" .tabs="${v.configSections.tags}" .columns="${this._columns(this.hass.localize)}" .data="${this._data(this._tags)}" .noDataText="${this.hass.localize("ui.panel.config.tag.no_tags")}" .filter="${this._filter}" @search-changed="${this._handleSearchChange}" has-fab clickable @row-click="${this._editTag}" id="id"> <ha-icon-button slot="toolbar-icon" @click="${this._showHelp}" .label="${this.hass.localize("ui.common.help")}" .path="${b}"></ha-icon-button> <ha-fab slot="fab" .label="${this.hass.localize("ui.panel.config.tag.add_tag")}" extended @click="${this._addTag}"> <ha-svg-icon slot="icon" .path="${x}"></ha-svg-icon> </ha-fab> </hass-tabs-subpage-data-table> `}},{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,g.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.tag.caption"),text:s.dy` <p> ${this.hass.localize("ui.panel.config.tag.detail.usage",{companion_link:s.dy`<a href="https://companion.home-assistant.io/" target="_blank" rel="noreferrer">${this.hass.localize("ui.panel.config.tag.detail.companion_apps")}</a>`})} </p> <p> <a href="${(0,f.R)(this.hass,"/integrations/tag/")}" target="_blank" rel="noreferrer"> ${this.hass.localize("ui.panel.config.tag.learn_more")} </a> </p> `})}},{kind:"method",key:"_fetchTags",value:async function(){this._tags=await(0,p.$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,y.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,p.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,p.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,g.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,p.Pn)(this.hass,t.id),this._tags=this._tags.filter((e=>e.id!==t.id)),!0}catch(t){return!1}}},{kind:"method",key:"_handleSearchChange",value:function(t){this._filter=t.detail.value}}]}}),(0,m.f)(s.oi));a()}catch(t){a(t)}}))},28968:function(t,e,i){i.d(e,{U:()=>o});var a=i(36522);const n=()=>Promise.all([i.e("83895"),i.e("53750"),i.e("61012"),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(44249),n=i(57243),o=i(15093);i(37583);(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(){const t=this.tag?.last_scanned_datetime?(new Date).getTime()-this.tag.last_scanned_datetime.getTime():void 0;t&&t<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)):(!t||t>1e4)&&(clearTimeout(this._timeout),this._timeout=void 0,this.classList.remove("just-scanned"))}},{kind:"method",key:"render",value:function(){return this.tag?n.dy`<div class="container"> <div class="image"> <ha-svg-icon .path="${"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"}"></ha-svg-icon> </div> </div>`:n.Ld}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`.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(92745);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(60933),h=i(44180),p=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("83895"),i.e("75297"),i.e("80210"),i.e("60251")]).then(i.bind(i,59095)),(0,a.shouldPolyfill)(t)&&e.push(Promise.all([i.e("83895"),i.e("75297"),i.e("68250")]).then(i.bind(i,80561)).then((()=>(0,p.H)()))),(0,u.shouldPolyfill)()&&e.push(Promise.all([i.e("83895"),i.e("75297"),i.e("65578")]).then(i.bind(i,97995))),(0,n.shouldPolyfill)(t)&&e.push(Promise.all([i.e("83895"),i.e("75297"),i.e("59826")]).then(i.bind(i,31514))),(0,s.shouldPolyfill)(t)&&e.push(Promise.all([i.e("83895"),i.e("75297"),i.e("23649")]).then(i.bind(i,93840))),(0,l.shouldPolyfill)(t)&&e.push(Promise.all([i.e("83895"),i.e("75297"),i.e("42831")]).then(i.bind(i,29559))),(0,d.shouldPolyfill)(t)&&e.push(Promise.all([i.e("83895"),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("83895"),i.e("75297"),i.e("13870")]).then(i.bind(i,74546))),0!==e.length&&await Promise.all(e).then((()=>(0,p.n)(t)))};await t(),e()}catch(t){e(t)}}),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.df7fca88855531f1.js.map