export const ids=["9329"];export const modules={85690:function(e,t,i){i.d(t,{v:function(){return a}});const a=async(e,t)=>{if(navigator.clipboard)try{return void await navigator.clipboard.writeText(e)}catch{}const i=t??document.body,a=document.createElement("textarea");a.value=e,i.appendChild(a),a.select(),document.execCommand("copy"),i.removeChild(a)}},1192:function(e,t,i){var a=i(44249),n=i(57243),s=i(50778);(0,a.Z)([(0,s.Mo)("ha-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"raised",value:()=>!1},{kind:"get",static:!0,key:"styles",value:function(){return n.iv`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,12px);border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, 24px);letter-spacing:-.012em;line-height:48px;padding:12px 16px 16px;display:block;margin-block-start:0px;margin-block-end:0px;font-weight:400}:host ::slotted(.card-content:not(:first-child)),slot:not(:first-child)::slotted(.card-content){padding-top:0px;margin-top:-8px}:host ::slotted(.card-content){padding:16px}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:5px 16px}`}},{kind:"method",key:"render",value:function(){return n.dy` ${this.header?n.dy`

${this.header}

`:n.Ld} `}}]}}),n.oi)},56412:function(e,t,i){var a=i(44249),n=i(72621),s=(i(92745),i(13334),i(57243)),o=i(50778),r=i(27486),d=i(11297),l=i(81036);const c={key:"Mod-s",run:e=>((0,d.B)(e.dom,"editor-save"),!0)},h=e=>{const t=document.createElement("ha-icon");return t.icon=e.label,t};(0,a.Z)([(0,o.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,o.Cb)()],key:"mode",value:()=>"yaml"},{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"autofocus",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({attribute:"read-only",type:Boolean})],key:"readOnly",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"linewrap",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,attribute:"autocomplete-entities"})],key:"autocompleteEntities",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,attribute:"autocomplete-icons"})],key:"autocompleteIcons",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"error",value:()=>!1},{kind:"field",decorators:[(0,o.SB)()],key:"_value",value:()=>""},{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,n.Z)(a,"connectedCallback",this,3)([]),this.hasUpdated&&this.requestUpdate(),this.addEventListener("keydown",l.U),this.codemirror&&!1!==this.autofocus&&this.codemirror.focus()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(a,"disconnectedCallback",this,3)([]),this.removeEventListener("keydown",l.U),this.updateComplete.then((()=>{this.codemirror.destroy(),delete this.codemirror}))}},{kind:"method",key:"scheduleUpdate",value:async function(){this._loadedCodeMirror??=await Promise.all([i.e("3895"),i.e("1117"),i.e("2309")]).then(i.bind(i,51198)),(0,n.Z)(a,"scheduleUpdate",this,3)([])}},{kind:"method",key:"update",value:function(e){if((0,n.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,c]),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:()=>(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=[],this._iconList=e.map((e=>({type:"variable",label:`mdi:${e.name}`,detail:e.keywords.join(", "),info:h})))}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:"get",static:!0,key:"styles",value:function(){return s.iv`:host(.error-state) .cm-gutters{border-color:var(--error-state-color,red)}`}}]}}),s.fl)},2383:function(e,t,i){var a=i(44249),n=i(72621),s=i(57243),o=i(50778),r=i(35359),d=i(11297),l=i(30137);i(10508);const c="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z";(0,a.Z)([(0,o.Mo)("ha-expansion-panel")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"expanded",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"outlined",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({attribute:!1,type:Boolean,reflect:!0})],key:"leftChevron",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({attribute:!1,type:Boolean,reflect:!0})],key:"noCollapse",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"secondary",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_showContent",value(){return this.expanded}},{kind:"field",decorators:[(0,o.IO)(".container")],key:"_container",value:void 0},{kind:"method",key:"render",value:function(){return s.dy`
${this.leftChevron&&!this.noCollapse?s.dy` `:""}
${this.header} ${this.secondary}
${this.leftChevron||this.noCollapse?"":s.dy` `}
${this._showContent?s.dy``:""}
`}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(i,"willUpdate",this,3)([e]),e.has("expanded")&&(this._showContent=this.expanded,setTimeout((()=>{this._container.style.overflow=this.expanded?"initial":"hidden"}),300))}},{kind:"method",key:"_handleTransitionEnd",value:function(){this._container.style.removeProperty("height"),this._container.style.overflow=this.expanded?"initial":"hidden",this._showContent=this.expanded}},{kind:"method",key:"_toggleContainer",value:async function(e){if(e.defaultPrevented)return;if("keydown"===e.type&&"Enter"!==e.key&&" "!==e.key)return;if(e.preventDefault(),this.noCollapse)return;const t=!this.expanded;(0,d.B)(this,"expanded-will-change",{expanded:t}),this._container.style.overflow="hidden",t&&(this._showContent=!0,await(0,l.y)());const i=this._container.scrollHeight;this._container.style.height=`${i}px`,t||setTimeout((()=>{this._container.style.height="0px"}),0),this.expanded=t,(0,d.B)(this,"expanded-changed",{expanded:this.expanded})}},{kind:"method",key:"_focusChanged",value:function(e){this.noCollapse||this.shadowRoot.querySelector(".top").classList.toggle("focused","focus"===e.type)}},{kind:"get",static:!0,key:"styles",value:function(){return s.iv`:host{display:block}.top{display:flex;align-items:center;border-radius:var(--ha-card-border-radius,12px)}.top.expanded{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.top.focused{background:var(--input-fill-color)}:host([outlined]){box-shadow:none;border-width:1px;border-style:solid;border-color:var(--outline-color);border-radius:var(--ha-card-border-radius,12px)}.summary-icon{transition:transform 150ms cubic-bezier(.4, 0, .2, 1);direction:var(--direction);margin-left:8px;margin-inline-start:8px;margin-inline-end:initial}:host([leftchevron]) .summary-icon{margin-left:0;margin-right:8px;margin-inline-start:0;margin-inline-end:8px}#summary{flex:1;display:flex;padding:var(--expansion-panel-summary-padding,0 8px);min-height:48px;align-items:center;cursor:pointer;overflow:hidden;font-weight:500;outline:0}#summary.noCollapse{cursor:default}.summary-icon.expanded{transform:rotate(180deg)}.header,::slotted([slot=header]){flex:1}.container{padding:var(--expansion-panel-content-padding,0 8px);overflow:hidden;transition:height .3s cubic-bezier(.4, 0, .2, 1);height:0px}.container.expanded{height:auto}.secondary{display:block;color:var(--secondary-text-color);font-size:12px}`}}]}}),s.oi)},27196:function(e,t,i){var a=i(44249),n=i(72621),s=i(76848),o=i(57243),r=i(50778),d=i(11297),l=i(66193),c=(i(56412),i(46694)),h=i(85690);i(20095);(0,a.Z)([(0,r.Mo)("ha-yaml-editor")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"yamlSchema",value:()=>s.oW},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"defaultValue",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:"is-valid",type:Boolean})],key:"isValid",value:()=>!0},{kind:"field",decorators:[(0,r.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:"auto-update",type:Boolean})],key:"autoUpdate",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({attribute:"read-only",type:Boolean})],key:"readOnly",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({attribute:"copy-clipboard",type:Boolean})],key:"copyClipboard",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({attribute:"has-extra-actions",type:Boolean})],key:"hasExtraActions",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_yaml",value:()=>""},{kind:"field",decorators:[(0,r.IO)("ha-code-editor")],key:"_codeEditor",value:void 0},{kind:"method",key:"setValue",value:function(e){try{this._yaml=(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})(e)?"":(0,s.$w)(e,{schema:this.yamlSchema,quotingType:'"',noRefs:!0})}catch(t){console.error(t,e),alert(`There was an error converting to YAML: ${t}`)}}},{kind:"method",key:"firstUpdated",value:function(){void 0!==this.defaultValue&&this.setValue(this.defaultValue)}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(i,"willUpdate",this,3)([e]),this.autoUpdate&&e.has("value")&&this.setValue(this.value)}},{kind:"method",key:"focus",value:function(){this._codeEditor?.codemirror&&this._codeEditor?.codemirror.focus()}},{kind:"method",key:"render",value:function(){return void 0===this._yaml?o.Ld:o.dy` ${this.label?o.dy`

${this.label}${this.required?" *":""}

`:o.Ld} ${this.copyClipboard||this.hasExtraActions?o.dy`
${this.copyClipboard?o.dy` ${this.hass.localize("ui.components.yaml-editor.copy_to_clipboard")} `:o.Ld}
`:o.Ld} `}},{kind:"method",key:"_onChange",value:function(e){let t;e.stopPropagation(),this._yaml=e.detail.value;let i,a=!0;if(this._yaml)try{t=(0,s.zD)(this._yaml,{schema:this.yamlSchema})}catch(e){a=!1,i=`${this.hass.localize("ui.components.yaml-editor.error",{reason:e.reason})}${e.mark?` (${this.hass.localize("ui.components.yaml-editor.error_location",{line:e.mark.line+1,column:e.mark.column+1})})`:""}`}else t={};this.value=t,this.isValid=a,(0,d.B)(this,"value-changed",{value:t,isValid:a,errorMsg:i})}},{kind:"get",key:"yaml",value:function(){return this._yaml}},{kind:"method",key:"_copyYaml",value:async function(){this.yaml&&(await(0,h.v)(this.yaml),(0,c.C)(this,{message:this.hass.localize("ui.common.copied_clipboard")}))}},{kind:"get",static:!0,key:"styles",value:function(){return[l.Qx,o.iv`.card-actions{border-radius:var(--actions-border-radius,0px 0px var(--ha-card-border-radius,12px) var(--ha-card-border-radius,12px));border:1px solid var(--divider-color);padding:5px 16px}ha-code-editor{flex-grow:1}`]}}]}}),o.oi)},68024:function(e,t,i){var a=i(44249),n=i(57243),s=i(50778),o=i(27486);i(42877);(0,a.Z)([(0,s.Mo)("assist-pipeline-detail-config")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"data",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1,type:Array})],key:"supportedLanguages",value:void 0},{kind:"method",key:"focus",value:async function(){await this.updateComplete;const e=this.renderRoot?.querySelector("ha-form");e?.focus()}},{kind:"field",key:"_schema",value:()=>(0,o.Z)((e=>[{name:"",type:"grid",schema:[{name:"name",required:!0,selector:{text:{}}},e?{name:"language",required:!0,selector:{language:{languages:e}}}:{name:"",type:"constant"}]}]))},{kind:"field",key:"_computeLabel",value(){return e=>e.name?this.hass.localize(`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${e.name}`):""}},{kind:"method",key:"render",value:function(){return n.dy`

${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.config.title")}

${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.config.description")}

`}},{kind:"get",static:!0,key:"styles",value:function(){return n.iv`.section{border:1px solid var(--divider-color);border-radius:8px;box-sizing:border-box;padding:16px}.intro{margin-bottom:16px}h3{font-weight:400;font-size:22px;line-height:28px;margin-top:0;margin-bottom:4px}p{color:var(--secondary-text-color);font-size:var(--mdc-typography-body2-font-size, .875rem);margin-top:0;margin-bottom:0}`}}]}}),n.oi)},54859:function(e,t,i){var a=i(44249),n=(i(92745),i(57243)),s=i(50778),o=i(27486),r=(i(42877),i(11297));(0,a.Z)([(0,s.Mo)("assist-pipeline-detail-conversation")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"data",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_supportedLanguages",value:void 0},{kind:"field",key:"_schema",value:()=>(0,o.Z)(((e,t,i)=>{const a=[{name:"",type:"grid",schema:[{name:"conversation_engine",required:!0,selector:{conversation_agent:{language:t}}}]}];return"*"!==i&&i?.length&&a[0].schema.push({name:"conversation_language",required:!0,selector:{language:{languages:i,no_sort:!0}}}),"conversation.home_assistant"!==e&&a.push({name:"prefer_local_intents",default:!0,selector:{boolean:{}}}),a}))},{kind:"field",key:"_computeLabel",value(){return e=>e.name?this.hass.localize(`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${e.name}`):""}},{kind:"field",key:"_computeHelper",value(){return e=>e.name?this.hass.localize(`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${e.name}_description`):""}},{kind:"method",key:"render",value:function(){return n.dy`

${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.conversation.title")}

${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.conversation.description")}

`}},{kind:"method",key:"_supportedLanguagesChanged",value:function(e){"*"===e.detail.value&&setTimeout((()=>{const e={...this.data};e.conversation_language="*",(0,r.B)(this,"value-changed",{value:e})}),0),this._supportedLanguages=e.detail.value}},{kind:"get",static:!0,key:"styles",value:function(){return n.iv`.section{border:1px solid var(--divider-color);border-radius:8px;box-sizing:border-box;padding:16px}.intro{margin-bottom:16px}h3{font-weight:400;font-size:22px;line-height:28px;margin-top:0;margin-bottom:4px}p{color:var(--secondary-text-color);font-size:var(--mdc-typography-body2-font-size, .875rem);margin-top:0;margin-bottom:0}`}}]}}),n.oi)},46343:function(e,t,i){var a=i(44249),n=i(57243),s=i(50778),o=i(27486);i(42877);(0,a.Z)([(0,s.Mo)("assist-pipeline-detail-stt")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"data",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_supportedLanguages",value:void 0},{kind:"field",key:"_schema",value:()=>(0,o.Z)(((e,t)=>[{name:"",type:"grid",schema:[{name:"stt_engine",selector:{stt:{language:e}}},t?.length?{name:"stt_language",required:!0,selector:{language:{languages:t,no_sort:!0}}}:{name:"",type:"constant"}]}]))},{kind:"field",key:"_computeLabel",value(){return e=>e.name?this.hass.localize(`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${e.name}`):""}},{kind:"method",key:"render",value:function(){return n.dy`

${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.stt.title")}

${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.stt.description")}

`}},{kind:"method",key:"_supportedLanguagesChanged",value:function(e){this._supportedLanguages=e.detail.value}},{kind:"get",static:!0,key:"styles",value:function(){return n.iv`.section{border:1px solid var(--divider-color);border-radius:8px;box-sizing:border-box;padding:16px}.intro{margin-bottom:16px}h3{font-weight:400;font-size:22px;line-height:28px;margin-top:0;margin-bottom:4px}p{color:var(--secondary-text-color);font-size:var(--mdc-typography-body2-font-size, .875rem);margin-top:0;margin-bottom:0}`}}]}}),n.oi)},52511:function(e,t,i){var a=i("44249"),n=i("57243"),s=i("50778"),o=i("27486"),r=(i("20095"),i("42877"),i("11297"));const d=()=>i.e("5624").then(i.bind(i,40137));(0,a.Z)([(0,s.Mo)("assist-pipeline-detail-tts")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"data",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_supportedLanguages",value:void 0},{kind:"field",key:"_schema",value:()=>(0,o.Z)(((e,t)=>[{name:"",type:"grid",schema:[{name:"tts_engine",selector:{tts:{language:e}}},t?.length?{name:"tts_language",required:!0,selector:{language:{languages:t,no_sort:!0}}}:{name:"",type:"constant"},{name:"tts_voice",selector:{tts_voice:{}},context:{language:"tts_language",engineId:"tts_engine"},required:!0}]}]))},{kind:"field",key:"_computeLabel",value(){return e=>e.name?this.hass.localize(`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${e.name}`):""}},{kind:"method",key:"render",value:function(){return n.dy`

${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.tts.title")}

${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.tts.description")}

${this.data?.tts_engine?n.dy``:n.Ld}
`}},{kind:"method",key:"_preview",value:async function(){if(!this.data)return;const e=this.data.tts_engine,t=this.data.tts_language||void 0,i=this.data.tts_voice||void 0;var a,n;e&&(a=this,n={engine:e,language:t,voice:i},(0,r.B)(a,"show-dialog",{addHistory:!1,dialogTag:"dialog-tts-try",dialogImport:d,dialogParams:n}))}},{kind:"method",key:"_supportedLanguagesChanged",value:function(e){this._supportedLanguages=e.detail.value}},{kind:"get",static:!0,key:"styles",value:function(){return n.iv`.section{border:1px solid var(--divider-color);border-radius:8px}.content{padding:16px}.intro{margin-bottom:16px}h3{font-weight:400;font-size:22px;line-height:28px;margin-top:0;margin-bottom:4px}p{color:var(--secondary-text-color);font-size:var(--mdc-typography-body2-font-size, .875rem);margin-top:0;margin-bottom:0}.footer{border-top:1px solid var(--divider-color);padding:8px 16px}`}}]}}),n.oi)},37744:function(e,t,i){var a=i("44249"),n=(i("39527"),i("13334"),i("36993"),i("57243")),s=i("50778"),o=i("27486");i("42877");var r=i("11297");(0,a.Z)([(0,s.Mo)("assist-pipeline-detail-wakeword")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"data",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_wakeWords",value:void 0},{kind:"field",key:"_schema",value:()=>(0,o.Z)((e=>[{name:"",type:"grid",schema:[{name:"wake_word_entity",selector:{entity:{domain:"wake_word"}}},e?.length?{name:"wake_word_id",required:!0,selector:{select:{mode:"dropdown",sort:!0,options:e.map((e=>({value:e.id,label:e.name})))}}}:{name:"",type:"constant"}]}]))},{kind:"field",key:"_computeLabel",value(){return e=>e.name?this.hass.localize(`ui.panel.config.voice_assistants.assistants.pipeline.detail.form.${e.name}`):""}},{kind:"method",key:"willUpdate",value:function(e){e.has("data")&&e.get("data")?.wake_word_entity!==this.data?.wake_word_entity&&(e.get("data")?.wake_word_entity&&this.data?.wake_word_id&&(0,r.B)(this,"value-changed",{value:{...this.data,wake_word_id:void 0}}),this._fetchWakeWords())}},{kind:"method",key:"render",value:function(){return n.dy`

${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.wakeword.title")}

${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.wakeword.description")}

${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.steps.wakeword.note")}
`}},{kind:"method",key:"_fetchWakeWords",value:async function(){if(this._wakeWords=void 0,!this.data?.wake_word_entity)return;const e=this.data.wake_word_entity,t=await(i=this.hass,a=e,i.callWS({type:"wake_word/info",entity_id:a}));var i,a;this.data.wake_word_entity===e&&(this._wakeWords=t.wake_words,!this.data||this.data?.wake_word_id&&this._wakeWords.some((e=>e.id===this.data.wake_word_id))||(0,r.B)(this,"value-changed",{value:{...this.data,wake_word_id:this._wakeWords[0]?.id}}))}},{kind:"get",static:!0,key:"styles",value:function(){return n.iv`.section{border:1px solid var(--divider-color);border-radius:8px}.content{padding:16px}.intro{margin-bottom:16px}h3{font-weight:400;font-size:22px;line-height:28px;margin-top:0;margin-bottom:4px}p{color:var(--secondary-text-color);font-size:var(--mdc-typography-body2-font-size, .875rem);margin-top:0;margin-bottom:0}a{color:var(--primary-color)}`}}]}}),n.oi)},22380:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),n=(i(39527),i(41360),i(57243)),s=i(50778),o=i(27486),r=i(4855),d=i(35047),l=e([d]);d=(l.then?(await l)():l)[0];(0,a.Z)([(0,s.Mo)("assist-render-pipeline-events")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"events",value:void 0},{kind:"field",key:"_processEvents",value:()=>(0,o.Z)((e=>{let t;return e.forEach((e=>{t=(0,r.eP)(t,e)})),t}))},{kind:"method",key:"render",value:function(){const e=this._processEvents(this.events);return e?n.dy` `:this.events.length?n.dy`Error showing run Raw
${JSON.stringify(this.events,null,2)}
`:n.dy`There were no events in this run.`}}]}}),n.oi);t()}catch(e){t(e)}}))},35047:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),n=(i(92745),i(39527),i(67670),i(13334),i(57243)),s=i(50778),o=(i(1192),i(17949),i(20095),i(90977),i(2383),i(52745)),r=(i(27196),i(4557)),d=e([o]);o=(d.then?(await d)():d)[0];const l={pipeline:"Pipeline",language:"Language"},c={engine:"Engine"},h={engine:"Engine"},p={engine:"Engine",language:"Language",intent_input:"Input"},u={engine:"Engine",language:"Language",voice:"Voice",tts_input:"Input"},v={ready:0,wake_word:1,stt:2,intent:3,tts:4,done:5,error:6},g=(e,t)=>e.init_options?v[e.init_options.start_stage]<=v[t]&&v[t]<=v[e.init_options.end_stage]:t in e,m=(e,t,i)=>"error"in e&&i===t?n.dy` ${e.error.message} (${e.error.code}) `:"",y=(e,t,i,a="-start")=>{const s=t.events.find((e=>e.type===`${i}`+a)),r=t.events.find((e=>e.type===`${i}-end`));if(!s)return"";if(!r)return"error"in t?n.dy`❌`:n.dy` `;const d=new Date(r.timestamp).getTime()-new Date(s.timestamp).getTime(),l=(0,o.uf)(d/1e3,e.locale,{maximumFractionDigits:2});return n.dy`${l}s ✅`},_=(e,t)=>Object.entries(t).map((([t,i])=>n.dy`
${i}
${e[t]}
`)),f=(e,t)=>{const i={};let a=!1;for(const n in e)n in t||"done"===n||(a=!0,i[n]=e[n]);return a?n.dy` Raw `:""};(0,a.Z)([(0,s.Mo)("assist-render-pipeline-run")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"pipelineRun",value:void 0},{kind:"method",key:"render",value:function(){const e=this.pipelineRun&&["tts","intent","stt","wake_word"].find((e=>e in this.pipelineRun))||"ready",t=[],i=(this.pipelineRun.init_options&&"text"in this.pipelineRun.init_options.input?this.pipelineRun.init_options.input.text:void 0)||this.pipelineRun?.stt?.stt_output?.text||this.pipelineRun?.intent?.intent_input;return i&&t.push({from:"user",text:i}),this.pipelineRun?.intent?.intent_output?.response?.speech?.plain?.speech&&t.push({from:"hass",text:this.pipelineRun.intent.intent_output.response.speech.plain.speech}),n.dy`
Run
${this.pipelineRun.stage}
${_(this.pipelineRun.run,l)} ${t.length>0?n.dy`
${t.map((({from:e,text:t})=>n.dy`
${t}
`))}
`:""}
${m(this.pipelineRun,"ready",e)} ${g(this.pipelineRun,"wake_word")?n.dy`
Wake word ${y(this.hass,this.pipelineRun,"wake_word")}
${this.pipelineRun.wake_word?n.dy`
${_(this.pipelineRun.wake_word,h)} ${this.pipelineRun.wake_word.wake_word_output?n.dy`
Model
${this.pipelineRun.wake_word.wake_word_output.ww_id}
Timestamp
${this.pipelineRun.wake_word.wake_word_output.timestamp}
`:""} ${f(this.pipelineRun.wake_word,c)}
`:""}
`:""} ${m(this.pipelineRun,"wake_word",e)} ${g(this.pipelineRun,"stt")?n.dy`
Speech-to-text ${y(this.hass,this.pipelineRun,"stt","-vad-end")}
${this.pipelineRun.stt?n.dy`
${_(this.pipelineRun.stt,h)}
Language
${this.pipelineRun.stt.metadata.language}
${this.pipelineRun.stt.stt_output?n.dy`
Output
${this.pipelineRun.stt.stt_output.text}
`:""} ${f(this.pipelineRun.stt,h)}
`:""}
`:""} ${m(this.pipelineRun,"stt",e)} ${g(this.pipelineRun,"intent")?n.dy`
Natural Language Processing ${y(this.hass,this.pipelineRun,"intent")}
${this.pipelineRun.intent?n.dy`
${_(this.pipelineRun.intent,p)} ${this.pipelineRun.intent.intent_output?n.dy`
Response type
${this.pipelineRun.intent.intent_output.response.response_type}
${"error"===this.pipelineRun.intent.intent_output.response.response_type?n.dy`
Error code
${this.pipelineRun.intent.intent_output.response.data.code}
`:""}`:""}
Prefer handling locally
${this.pipelineRun.intent.prefer_local_intents}
Processed locally
${this.pipelineRun.intent.processed_locally}
${f(this.pipelineRun.intent,p)}
`:""}
`:""} ${m(this.pipelineRun,"intent",e)} ${g(this.pipelineRun,"tts")?n.dy`
Text-to-speech ${y(this.hass,this.pipelineRun,"tts")}
${this.pipelineRun.tts?n.dy`
${_(this.pipelineRun.tts,u)} ${f(this.pipelineRun.tts,u)}
`:""}
${this.pipelineRun?.tts?.tts_output?n.dy`
Play Audio
`:""}
`:""} ${m(this.pipelineRun,"tts",e)} Raw `}},{kind:"method",key:"_playTTS",value:function(){const e=this.pipelineRun.tts.tts_output.url,t=new Audio(e);t.addEventListener("error",(()=>{(0,r.Ys)(this,{title:"Error",text:"Error playing audio"})})),t.addEventListener("canplaythrough",(()=>{t.play()}))}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{display:block}ha-alert,ha-card{display:block;margin-bottom:16px}.row{display:flex;justify-content:space-between}.row>div:last-child{text-align:right}ha-expansion-panel{padding-left:8px;padding-inline-start:8px;padding-inline-end:initial}.card-content ha-expansion-panel{padding-left:0px;padding-inline-start:0px;padding-inline-end:initial;--expansion-panel-summary-padding:0px;--expansion-panel-content-padding:0px}.heading{font-weight:500;margin-bottom:16px}.messages{margin-top:8px}.message{font-size:18px;margin:8px 0;padding:8px;border-radius:15px;clear:both}.message.user{margin-left:24px;margin-inline-start:24px;margin-inline-end:initial;float:var(--float-end);text-align:right;border-bottom-right-radius:0px;background-color:var(--light-primary-color);color:var(--text-light-primary-color,var(--primary-text-color));direction:var(--direction)}.message.hass{margin-right:24px;margin-inline-end:24px;margin-inline-start:initial;float:var(--float-start);border-bottom-left-radius:0px;background-color:var(--primary-color);color:var(--text-primary-color);direction:var(--direction)}`}]}}),n.oi);t()}catch(e){t(e)}}))},26942:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{DialogVoiceAssistantPipelineDetail:function(){return y}});var n=i(44249),s=(i(39527),i(41360),i(36993),i(57243)),o=i(50778),r=i(27486),d=i(11297),l=(i(20095),i(28906),i(42877),i(4855)),c=i(66193),h=(i(68024),i(54859),i(46343),i(52511),i(37744),i(22380)),p=i(79575),u=i(81036),v=e([h]);h=(v.then?(await v)():v)[0];const g="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",m="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 y=(0,n.Z)([(0,o.Mo)("dialog-voice-assistant-pipeline-detail")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_data",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_hideWakeWord",value:()=>!1},{kind:"field",decorators:[(0,o.SB)()],key:"_cloudActive",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_submitting",value:()=>!1},{kind:"field",decorators:[(0,o.SB)()],key:"_supportedLanguages",value:void 0},{kind:"method",key:"showDialog",value:function(e){if(this._params=e,this._error=void 0,this._cloudActive=this._params.cloudActiveSubscription,this._params.pipeline)return this._data={prefer_local_intents:!1,...this._params.pipeline},void(this._hideWakeWord=this._params.hideWakeWord||!this._data.wake_word_entity);let t,i;if(this._hideWakeWord=!0,this._cloudActive)for(const e of Object.values(this.hass.entities))if("cloud"===e.platform)if("stt"===(0,p.M)(e.entity_id)){if(t=e.entity_id,i)break}else if("tts"===(0,p.M)(e.entity_id)&&(i=e.entity_id,t))break;this._data={language:(this.hass.config.language||this.hass.locale.language).substring(0,2),stt_engine:t,tts_engine:i}}},{kind:"method",key:"closeDialog",value:function(){this._params=void 0,this._data=void 0,this._hideWakeWord=!1,(0,d.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"firstUpdated",value:function(){this._getSupportedLanguages()}},{kind:"method",key:"_getSupportedLanguages",value:async function(){const{languages:e}=await(0,l.Dy)(this.hass);this._supportedLanguages=e}},{kind:"field",key:"_hasWakeWorkEntities",value:()=>(0,r.Z)((e=>Object.keys(e).some((e=>e.startsWith("wake_word.")))))},{kind:"method",key:"render",value:function(){if(!this._params||!this._data)return s.Ld;const e=this._params.pipeline?.id?this._params.pipeline.name:this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.add_assistant_title");return s.dy` ${e} ${this._hideWakeWord&&!this._params.hideWakeWord&&this._hasWakeWorkEntities(this.hass.states)?s.dy` ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.add_streaming_wake_word")} `:s.Ld}
${this._error?s.dy`${this._error}`:s.Ld} ${this._cloudActive||"cloud"!==this._data.tts_engine&&"cloud"!==this._data.stt_engine?s.Ld:s.dy` ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.no_cloud_message")} ${this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.no_cloud_action")} `} ${this._hideWakeWord?s.Ld:s.dy``}
${this._params.pipeline?.id?this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.update_assistant_action"):this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.add_assistant_action")}
`}},{kind:"method",key:"_handleShowWakeWord",value:function(){this._hideWakeWord=!1}},{kind:"method",key:"_valueChanged",value:function(e){this._error=void 0;const t={};e.currentTarget.getAttribute("keys").split(",").forEach((i=>{t[i]=e.detail.value[i]})),this._data={...this._data,...t}}},{kind:"method",key:"_updatePipeline",value:async function(){this._submitting=!0;try{const e=this._data,t={name:e.name,language:e.language,conversation_engine:e.conversation_engine,conversation_language:e.conversation_language??null,prefer_local_intents:e.prefer_local_intents??!0,stt_engine:e.stt_engine??null,stt_language:e.stt_language??null,tts_engine:e.tts_engine??null,tts_language:e.tts_language??null,tts_voice:e.tts_voice??null,wake_word_entity:e.wake_word_entity??null,wake_word_id:e.wake_word_id??null};this._params.pipeline?.id?await this._params.updatePipeline(t):this._params.createPipeline?await this._params.createPipeline(t):console.error("No createPipeline function provided"),this.closeDialog()}catch(e){this._error=e?.message||"Unknown error"}finally{this._submitting=!1}}},{kind:"get",static:!0,key:"styles",value:function(){return[c.yu,s.iv`.content>:not(:last-child){margin-bottom:16px;display:block}ha-alert{margin-bottom:16px;display:block}a{text-decoration:none}`]}}]}}),s.oi);a()}catch(e){a(e)}}))}}; //# sourceMappingURL=9329.6b846c0461566ec3.js.map