iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 28.6 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["74950"],{95262:function(e,t,i){function a(e){return null==e||Array.isArray(e)?e:[e]}i.d(t,{r:()=>a})},49976:function(e,t,i){i.d(t,{U:()=>a});const a=e=>e.stopPropagation()},99426:function(e,t,i){i.r(t);var a=i(61701),o=(i(71695),i(47021),i(57243)),s=i(50778),n=i(35359),r=i(36522);i(23334),i(37583);let d,c,l,u,h=e=>e;const f={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};(0,a.Z)([(0,s.Mo)("ha-alert")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)()],key:"title",value(){return""}},{kind:"field",decorators:[(0,s.Cb)({attribute:"alert-type"})],key:"alertType",value(){return"info"}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"dismissable",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,o.dy)(d||(d=h` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,n.$)({[this.alertType]:!0}),this.title?"":"no-title",f[this.alertType],(0,n.$)({content:!0,narrow:this.narrow}),this.title?(0,o.dy)(c||(c=h`<div class="title">${0}</div>`),this.title):o.Ld,this.dismissable?(0,o.dy)(l||(l=h`<ha-icon-button ="${0}" label="Dismiss alert" .path="${0}"></ha-icon-button>`),this._dismissClicked,"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"):o.Ld)}},{kind:"method",key:"_dismissClicked",value:function(){(0,r.B)(this,"alert-dismissed-clicked")}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(u||(u=h`.issue-type{position:relative;padding:8px;display:flex}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:4px}.icon{z-index:1}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:0}.title{margin-top:2px;font-weight:700}.action ha-icon-button,.action mwc-button{--mdc-theme-primary:var(--primary-text-color);--mdc-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`))}}]}}),o.oi)},59826:function(e,t,i){var a=i(61701),o=(i(71695),i(47021),i(31622)),s=i(57243),n=i(50778),r=i(22344);let d,c=e=>e;(0,a.Z)([(0,n.Mo)("ha-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[r.W,(0,s.iv)(d||(d=c`::slotted([slot=icon]){margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction);display:block}.mdc-button{height:var(--button-height,36px)}.trailing-icon{display:flex}.slot-container{overflow:var(--button-slot-container-overflow,visible)}:host([destructive]){--mdc-theme-primary:var(--error-color)}`))]}}]}}),o.Button)},68325:function(e,t,i){var a=i(61701),o=i(72621),s=(i(52247),i(71695),i(92745),i(9359),i(70104),i(40251),i(11740),i(47021),i(57243)),n=i(50778),r=i(27486),d=i(36522),c=i(49976);i(65981);let l,u=e=>e;const h={key:"Mod-s",run:e=>((0,d.B)(e.dom,"editor-save"),!0)},f=e=>{const t=document.createElement("ha-icon");return t.icon=e.label,t};(0,a.Z)([(0,n.Mo)("ha-code-editor")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",key:"codemirror",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"mode",value(){return"yaml"}},{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"autofocus",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({attribute:"read-only",type:Boolean})],key:"readOnly",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"linewrap",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"autocomplete-entities"})],key:"autocompleteEntities",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"autocomplete-icons"})],key:"autocompleteIcons",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"error",value(){return!1}},{kind:"field",decorators:[(0,n.SB)()],key:"_value",value(){return""}},{kind:"field",key:"_loadedCodeMirror",value:void 0},{kind:"field",key:"_iconList",value:void 0},{kind:"set",key:"value",value:function(e){this._value=e}},{kind:"get",key:"value",value:function(){return this.codemirror?this.codemirror.state.doc.toString():this._value}},{kind:"get",key:"hasComments",value:function(){if(!this.codemirror||!this._loadedCodeMirror)return!1;const e=this._loadedCodeMirror.highlightingFor(this.codemirror.state,[this._loadedCodeMirror.tags.comment]);return!!this.renderRoot.querySelector(`span.${e}`)}},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)(a,"connectedCallback",this,3)([]),this.hasUpdated&&this.requestUpdate(),this.addEventListener("keydown",c.U),this.codemirror&&!1!==this.autofocus&&this.codemirror.focus()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(a,"disconnectedCallback",this,3)([]),this.removeEventListener("keydown",c.U),this.updateComplete.then((()=>{this.codemirror.destroy(),delete this.codemirror}))}},{kind:"method",key:"scheduleUpdate",value:async function(){var e;null!==(e=this._loadedCodeMirror)&&void 0!==e||(this._loadedCodeMirror=await Promise.all([i.e("2142"),i.e("93505"),i.e("8771"),i.e("66153")]).then(i.bind(i,2765))),(0,o.Z)(a,"scheduleUpdate",this,3)([])}},{kind:"method",key:"update",value:function(e){if((0,o.Z)(a,"update",this,3)([e]),!this.codemirror)return void this._createCodeMirror();const t=[];e.has("mode")&&t.push({effects:[this._loadedCodeMirror.langCompartment.reconfigure(this._mode),this._loadedCodeMirror.foldingCompartment.reconfigure(this._getFoldingExtensions())]}),e.has("readOnly")&&t.push({effects:this._loadedCodeMirror.readonlyCompartment.reconfigure(this._loadedCodeMirror.EditorView.editable.of(!this.readOnly))}),e.has("linewrap")&&t.push({effects:this._loadedCodeMirror.linewrapCompartment.reconfigure(this.linewrap?this._loadedCodeMirror.EditorView.lineWrapping:[])}),e.has("_value")&&this._value!==this.value&&t.push({changes:{from:0,to:this.codemirror.state.doc.length,insert:this._value}}),t.length>0&&this.codemirror.dispatch(...t),e.has("error")&&this.classList.toggle("error-state",this.error)}},{kind:"get",key:"_mode",value:function(){return this._loadedCodeMirror.langs[this.mode]}},{kind:"method",key:"_createCodeMirror",value:function(){if(!this._loadedCodeMirror)throw new Error("Cannot create editor before CodeMirror is loaded");const e=[this._loadedCodeMirror.lineNumbers(),this._loadedCodeMirror.history(),this._loadedCodeMirror.drawSelection(),this._loadedCodeMirror.EditorState.allowMultipleSelections.of(!0),this._loadedCodeMirror.rectangularSelection(),this._loadedCodeMirror.crosshairCursor(),this._loadedCodeMirror.highlightSelectionMatches(),this._loadedCodeMirror.highlightActiveLine(),this._loadedCodeMirror.indentationMarkers({thickness:0,activeThickness:1,colors:{activeLight:"var(--secondary-text-color)",activeDark:"var(--secondary-text-color)"}}),this._loadedCodeMirror.keymap.of([...this._loadedCodeMirror.defaultKeymap,...this._loadedCodeMirror.searchKeymap,...this._loadedCodeMirror.historyKeymap,...this._loadedCodeMirror.tabKeyBindings,h]),this._loadedCodeMirror.langCompartment.of(this._mode),this._loadedCodeMirror.haTheme,this._loadedCodeMirror.haSyntaxHighlighting,this._loadedCodeMirror.readonlyCompartment.of(this._loadedCodeMirror.EditorView.editable.of(!this.readOnly)),this._loadedCodeMirror.linewrapCompartment.of(this.linewrap?this._loadedCodeMirror.EditorView.lineWrapping:[]),this._loadedCodeMirror.EditorView.updateListener.of(this._onUpdate),this._loadedCodeMirror.foldingCompartment.of(this._getFoldingExtensions())];if(!this.readOnly){const t=[];this.autocompleteEntities&&this.hass&&t.push(this._entityCompletions.bind(this)),this.autocompleteIcons&&t.push(this._mdiCompletions.bind(this)),t.length>0&&e.push(this._loadedCodeMirror.autocompletion({override:t,maxRenderedOptions:10}))}this.codemirror=new this._loadedCodeMirror.EditorView({state:this._loadedCodeMirror.EditorState.create({doc:this._value,extensions:e}),parent:this.renderRoot})}},{kind:"field",key:"_getStates",value(){return(0,r.Z)((e=>{if(!e)return[];return Object.keys(e).map((t=>({type:"variable",label:t,detail:e[t].attributes.friendly_name,info:`State: ${e[t].state}`})))}))}},{kind:"method",key:"_entityCompletions",value:function(e){const t=e.matchBefore(/[a-z_]{3,}\.\w*/);if(!t||t.from===t.to&&!e.explicit)return null;const i=this._getStates(this.hass.states);return i&&i.length?{from:Number(t.from),options:i,validFor:/^[a-z_]{3,}\.\w*$/}:null}},{kind:"field",key:"_getIconItems",value(){return async()=>{if(!this._iconList){let e;e=(await i.e("25016").then(i.t.bind(i,58134,19))).default,this._iconList=e.map((e=>({type:"variable",label:`mdi:${e.name}`,detail:e.keywords.join(", "),info:f})))}return this._iconList}}},{kind:"method",key:"_mdiCompletions",value:async function(e){const t=e.matchBefore(/mdi:\S*/);if(!t||t.from===t.to&&!e.explicit)return null;const i=await this._getIconItems();return{from:Number(t.from),options:i,validFor:/^mdi:\S*$/}}},{kind:"field",key:"_onUpdate",value(){return e=>{e.docChanged&&(this._value=e.state.doc.toString(),(0,d.B)(this,"value-changed",{value:this._value}))}}},{kind:"field",key:"_getFoldingExtensions",value(){return()=>"yaml"===this.mode?[this._loadedCodeMirror.foldGutter(),this._loadedCodeMirror.foldingOnIndent]:[]}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(l||(l=u`:host(.error-state) .cm-gutters{border-color:var(--error-state-color,red)}`))}}]}}),s.fl)},65981:function(e,t,i){i.r(t),i.d(t,{HaIcon:()=>M});var a=i(61701),o=i(72621),s=(i(19083),i(71695),i(40251),i(61006),i(47021),i(57243)),n=i(50778),r=i(36522),d=i(22381),c=i(80654),l=(i(92745),i(9359),i(31526),i(27608)),u=i(27486),h=i(37394);const f=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"}]}'),p=(0,u.Z)((async()=>{const e=(0,l.MT)("hass-icon-db","mdi-icon-store");{const t=await(0,l.U2)("_version",e);t?t!==f.version&&(await(0,l.ZH)(e),(0,l.t8)("_version",f.version,e)):(0,l.t8)("_version",f.version,e)}return e})),v=["mdi","hass","hassio","hademo"];let b=[];i(37583);let m,g,y,k=e=>e;const _={},w={},C=(0,d.D)((()=>(async e=>{const t=Object.keys(e),i=await Promise.all(Object.values(e));(await p())("readwrite",(a=>{i.forEach(((i,o)=>{Object.entries(i).forEach((([e,t])=>{a.put(t,e)})),delete e[t[o]]}))}))})(w)),2e3),x={};let M=(0,a.Z)([(0,n.Mo)("ha-icon")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,n.Cb)()],key:"icon",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_path",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_secondaryPath",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_viewBox",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_legacy",value(){return!1}},{kind:"method",key:"willUpdate",value:function(e){(0,o.Z)(a,"willUpdate",this,3)([e]),e.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}},{kind:"method",key:"render",value:function(){return this.icon?this._legacy?(0,s.dy)(m||(m=k` <iron-icon .icon="${0}"></iron-icon>`),this.icon):(0,s.dy)(g||(g=k`<ha-svg-icon .path="${0}" .secondaryPath="${0}" .viewBox="${0}"></ha-svg-icon>`),this._path,this._secondaryPath,this._viewBox):s.Ld}},{kind:"method",key:"_loadIcon",value:async function(){if(!this.icon)return;const e=this.icon,[t,a]=this.icon.split(":",2);let o,s=a;if(!t||!s)return;if(!v.includes(t)){const i=c.g[t];return i?void(i&&"function"==typeof i.getIcon&&this._setCustomPath(i.getIcon(s),e)):void(this._legacy=!0)}if(this._legacy=!1,s in _){const e=_[s];let i;e.newName?(i=`Icon ${t}:${s} was renamed to ${t}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,s=e.newName):i=`Icon ${t}:${s} 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(i),(0,r.B)(this,"write_log",{level:"warning",message:i})}if(s in x)return void(this._path=x[s]);if("home-assistant"===s){const t=(await i.e("48348").then(i.bind(i,30511))).mdiHomeAssistant;return this.icon===e&&(this._path=t),void(x[s]=t)}try{o=await(e=>new Promise(((t,i)=>{if(b.push([e,t,i]),b.length>1)return;const a=p();(0,h.n)(1e3,(async()=>{(await a)("readonly",(e=>{for(const[t,i,a]of b)(0,l.RV)(e.get(t)).then((e=>i(e))).catch((e=>a(e)));b=[]}))})()).catch((e=>{for(const[,,t]of b)t(e);b=[]}))})))(s)}catch(u){o=void 0}if(o)return this.icon===e&&(this._path=o),void(x[s]=o);const n=(e=>{let t;for(const i of f.parts){if(void 0!==i.start&&e<i.start)break;t=i}return t.file})(s);if(n in w)return void this._setPath(w[n],s,e);const d=fetch(`/static/mdi/${n}.json`).then((e=>e.json()));w[n]=d,this._setPath(d,s,e),C()}},{kind:"method",key:"_setCustomPath",value:async function(e,t){const i=await e;this.icon===t&&(this._path=i.path,this._secondaryPath=i.secondaryPath,this._viewBox=i.viewBox)}},{kind:"method",key:"_setPath",value:async function(e,t,i){const a=await e;this.icon===i&&(this._path=a[t]),x[t]=a[t]}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(y||(y=k`:host{fill:currentcolor}`))}}]}}),s.oi)},40917:function(e,t,i){var a=i(61701),o=i(72621),s=(i(71695),i(47021),i(27323)),n=i(33990),r=i(88540),d=i(57243),c=i(50778);let l,u=e=>e;(0,a.Z)([(0,c.Mo)("ha-textarea")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,c.Cb)({type:Boolean,reflect:!0})],key:"autogrow",value(){return!1}},{kind:"method",key:"updated",value:function(e){(0,o.Z)(i,"updated",this,3)([e]),this.autogrow&&e.has("value")&&(this.mdcRoot.dataset.value=this.value+'="')}},{kind:"field",static:!0,key:"styles",value(){return[n.W,r.W,(0,d.iv)(l||(l=u`:host([autogrow]) .mdc-text-field{position:relative;min-height:74px;min-width:178px;max-height:200px}:host([autogrow]) .mdc-text-field:after{content:attr(data-value);margin-top:23px;margin-bottom:9px;line-height:1.5rem;min-height:42px;padding:0px 32px 0 16px;letter-spacing:var(
--mdc-typography-subtitle1-letter-spacing,
.009375em
);visibility:hidden;white-space:pre-wrap}:host([autogrow]) .mdc-text-field__input{position:absolute;height:calc(100% - 32px)}:host([autogrow]) .mdc-text-field.mdc-text-field--no-label:after{margin-top:16px;margin-bottom:16px}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start) top} only screen and (min-width:459px){:host([mobile-multiline]) .mdc-text-field__input{white-space:nowrap;max-height:16px}}`))]}}]}}),s.O)},42740:function(e,t,i){i.d(t,{KH:()=>r,T1:()=>n,rM:()=>s,zt:()=>o});var a=i(95262);let o=function(e){return e[e.CONTROL=1]="CONTROL",e}({});const s=(e,t,i)=>e.callWS({type:"conversation/agent/list",language:t,country:i}),n=(e,t,i,o)=>e.callWS({type:"conversation/agent/homeassistant/debug",sentences:(0,a.r)(t),language:i,device_id:o}),r=(e,t,i)=>e.callWS({type:"conversation/agent/homeassistant/language_scores",language:t,country:i})},80654:function(e,t,i){i.d(t,{g:()=>n});const a=window;"customIconsets"in a||(a.customIconsets={});const o=a.customIconsets,s=window;"customIcons"in s||(s.customIcons={});const n=new Proxy(s.customIcons,{get:(e,t)=>{var i;return null!==(i=e[t])&&void 0!==i?i:o[t]?{getIcon:o[t]}:void 0}})},6736:function(e,t,i){i.d(t,{f:()=>n});var a=i(61701),o=i(72621),s=(i(19083),i(71695),i(9359),i(52924),i(40251),i(61006),i(47021),i(50778));const n=e=>(0,a.Z)(null,(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",key:"hassSubscribeRequiredHostProps",value:void 0},{kind:"field",key:"__unsubs",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)(i,"connectedCallback",this,3)([]),this._checkSubscribed()}},{kind:"method",key:"disconnectedCallback",value:function(){if((0,o.Z)(i,"disconnectedCallback",this,3)([]),this.__unsubs){for(;this.__unsubs.length;){const e=this.__unsubs.pop();e instanceof Promise?e.then((e=>e())):e()}this.__unsubs=void 0}}},{kind:"method",key:"updated",value:function(e){if((0,o.Z)(i,"updated",this,3)([e]),e.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const t of e.keys())if(this.hassSubscribeRequiredHostProps.includes(t))return void this._checkSubscribed()}},{kind:"method",key:"hassSubscribe",value:function(){return[]}},{kind:"method",key:"_checkSubscribed",value:function(){var e;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(e=this.hassSubscribeRequiredHostProps)&&void 0!==e&&e.some((e=>void 0===this[e]))||(this.__unsubs=this.hassSubscribe())}}]}}),e)},36515:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var o=i(61701),s=(i(19083),i(71695),i(92745),i(9359),i(56475),i(1331),i(31526),i(70104),i(77439),i(40251),i(61006),i(52128),i(47021),i(76848)),n=i(57243),r=i(50778),d=i(68958),c=i(94369),l=(i(99426),i(59826),i(54977),i(68325),i(2790)),u=(i(40917),i(42740)),h=i(6736),f=i(28008),p=i(58014),v=e([l,c]);[l,c]=v.then?(await v)():v;let b,m,g,y,k,_,w,C=e=>e;const x="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z",M="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z";(0,o.Z)([(0,r.Mo)("developer-tools-assist")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"supportedLanguages",value:void 0},{kind:"field",decorators:[(0,d.t)({key:"assist_debug_language",state:!0,subscribe:!1,storage:"localStorage"})],key:"_language",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_results",value(){return[]}},{kind:"field",decorators:[(0,r.IO)("#sentences-input")],key:"_sentencesInput",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_validInput",value(){return!1}},{kind:"method",key:"_languageChanged",value:function(e){this._language=e.detail.value}},{kind:"method",key:"_handleKeyDown",value:function(e){"Enter"!==e.code||e.shiftKey||(e.preventDefault(),this._parse())}},{kind:"method",key:"_textAreaInput",value:function(e){const t=e.target.value,i=Boolean(t);i!==this._validInput&&(this._validInput=i)}},{kind:"method",key:"_parse",value:async function(){const e=this._sentencesInput.value.split("\n").filter((e=>""!==e)),{results:t}=await(0,u.T1)(this.hass,e,this._language);this._sentencesInput.value="";const i=[];e.forEach(((e,a)=>{const o=t[a];i.push({sentence:e,language:this._language,result:o})})),this._results=[...i,...this._results]}},{kind:"method",key:"_fetchLanguages",value:async function(){var e;const{agents:t}=await(0,u.rM)(this.hass),i=t.find((e=>"conversation.home_assistant"===e.id));this.supportedLanguages="*"===(null==i?void 0:i.supported_languages)||null==i?void 0:i.supported_languages,!this._language&&null!==(e=this.supportedLanguages)&&void 0!==e&&e.includes(this.hass.locale.language)?this._language=this.hass.locale.language:this._language||(this._language="en")}},{kind:"method",key:"firstUpdated",value:function(){this._fetchLanguages()}},{kind:"method",key:"render",value:function(){return(0,n.dy)(b||(b=C` <div class="content"> <ha-card .header="${0}" class="form"> <div class="card-content"> <p class="description"> ${0} </p> ${0} <ha-textarea autogrow .label="${0}" id="sentences-input" ="${0}" ="${0}"></ha-textarea> </div> <div class="card-actions"> <ha-button ="${0}" .disabled="${0}"> ${0} </ha-button> </div> </ha-card> ${0} ${0} </div> `),this.hass.localize("ui.panel.developer-tools.tabs.assist.title"),this.hass.localize("ui.panel.developer-tools.tabs.assist.description"),this.supportedLanguages?(0,n.dy)(m||(m=C` <ha-language-picker .languages="${0}" .hass="${0}" .value="${0}" -changed="${0}"></ha-language-picker> `),this.supportedLanguages,this.hass,this._language,this._languageChanged):n.Ld,this.hass.localize("ui.panel.developer-tools.tabs.assist.sentences"),this._textAreaInput,this._handleKeyDown,this._parse,!this._language||!this._validInput,this.hass.localize("ui.panel.developer-tools.tabs.assist.parse_sentences"),this._results.length?(0,n.dy)(g||(g=C` <div class="result-toolbar"> <ha-button outlined ="${0}" destructive> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-button> <ha-button outlined ="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-button> </div> `),this._clear,M,this.hass.localize("ui.common.clear"),this._download,x,this.hass.localize("ui.panel.developer-tools.tabs.assist.download_results")):"",this._results.map((e=>{const{sentence:t,result:i,language:a}=e,o=null!=i;return(0,n.dy)(y||(y=C` <ha-card class="result"> <div class="card-content"> <div class="sentence"> <p>${0}</p> <p>${0}</p> </div> <div class="info"> ${0}: ${0} (${0}) </div> ${0} </div> </ha-card> `),t,o?"✅":"❌",this.hass.localize("ui.panel.developer-tools.tabs.assist.language"),(0,c.u)(a,this.hass.locale),a,i?(0,n.dy)(k||(k=C` <ha-code-editor mode="yaml" .hass="${0}" .value="${0}" read-only dir="ltr"></ha-code-editor> `),this.hass,(0,s.dump)(i).trimRight()):(0,n.dy)(_||(_=C`<ha-alert alert-type="error"> ${0} </ha-alert>`),this.hass.localize("ui.panel.developer-tools.tabs.assist.no_match")))})))}},{kind:"method",key:"_download",value:function(){(0,p.N)(`data:text/plain;charset=utf-8,${encodeURIComponent(JSON.stringify({results:this._results},null,2))}`,"intent_results.json")}},{kind:"method",key:"_clear",value:function(){this._results=[]}},{kind:"get",static:!0,key:"styles",value:function(){return[f.Qx,(0,n.iv)(w||(w=C`.content{padding:28px 20px 16px;padding:max(28px,calc(12px + env(safe-area-inset-top))) max(20px,calc(4px + env(safe-area-inset-right))) max(16px,env(safe-area-inset-bottom)) max(20px,calc(4px + env(safe-area-inset-left)));max-width:1040px;margin:0 auto}.description{margin:0;margin-bottom:16px}ha-textarea{width:100%}.card-actions{text-align:right}.form{margin-bottom:16px}.result-toolbar{text-align:center;margin-bottom:16px}.result{margin-bottom:16px}.sentence{font-weight:500;margin-bottom:8px;display:flex;flex-direction:row;justify-content:space-between}.sentence p{margin:0}.info p{margin:0}ha-alert,ha-code-editor{display:block;margin-top:16px}`))]}}]}}),(0,h.f)(n.oi));a()}catch(b){a(b)}}))},58014:function(e,t,i){i.d(t,{N:()=>o,G:()=>s});var a=i(18117);const o=(e,t="")=>{const i=document.createElement("a");i.target="_blank",i.href=e,i.download=t,i.style.display="none",document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click")),document.body.removeChild(i)},s=e=>{var t;return!(e=>!!e.auth.external&&a.G)(e)||!(null===(t=e.auth.external)||void 0===t||!t.config.downloadFileSupported)}},18117:function(e,t,i){i.d(t,{G:()=>a});i(19134),i(5740);const a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}}]);
//# sourceMappingURL=74950.ca31e236c9633dd0.js.map