homeassistant/custom_components/hacs/hacs_frontend_experimental/frontend_es5/9766.OmCEn859YPI.js

2 lines
9.8 KiB
JavaScript
Raw Normal View History

2025-01-10 21:08:35 -08:00
"use strict";(self.webpackChunkhacs_frontend=self.webpackChunkhacs_frontend||[]).push([[9766],{86089:function(e,t,r){r.d(t,{U:function(){return o}});var o=function(e){return e.stopPropagation()}},25799:function(e,t,r){var o,i=r(88962),n=r(46097),a=r(99312),d=r(81043),s=r(33368),l=r(71650),u=r(68308),c=r(82390),h=r(69205),f=r(91808),v=r(34541),p=r(47838),m=(r(97393),r(46798),r(94570),r(51358),r(47084),r(5239),r(98490),r(36513),r(51467),r(46349),r(70320),r(65974),r(76843),r(22859),r(91989),r(5095)),k=r(95260),y=r(14516),C=r(18394),_=r(86089),b={key:"Mod-s",run:function(e){return(0,C.B)(e.dom,"editor-save"),!0}},g=function(e){var t=document.createElement("ha-icon");return t.icon=e.label,t};(0,f.Z)([(0,k.Mo)("ha-code-editor")],(function(e,t){var f,Z,M=function(t){function r(){var t;(0,l.Z)(this,r);for(var o=arguments.length,i=new Array(o),n=0;n<o;n++)i[n]=arguments[n];return t=(0,u.Z)(this,r,[].concat(i)),e((0,c.Z)(t)),t}return(0,h.Z)(r,t),(0,s.Z)(r)}(t);return{F:M,d:[{kind:"field",key:"codemirror",value:void 0},{kind:"field",decorators:[(0,k.Cb)()],key:"mode",value:function(){return"yaml"}},{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,k.Cb)({type:Boolean})],key:"autofocus",value:function(){return!1}},{kind:"field",decorators:[(0,k.Cb)({type:Boolean})],key:"readOnly",value:function(){return!1}},{kind:"field",decorators:[(0,k.Cb)({type:Boolean,attribute:"autocomplete-entities"})],key:"autocompleteEntities",value:function(){return!1}},{kind:"field",decorators:[(0,k.Cb)({type:Boolean,attribute:"autocomplete-icons"})],key:"autocompleteIcons",value:function(){return!1}},{kind:"field",decorators:[(0,k.Cb)({type:Boolean})],key:"error",value:function(){return!1}},{kind:"field",decorators:[(0,k.SB)()],key:"_value",value:function(){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;var e=this._loadedCodeMirror.highlightingFor(this.codemirror.state,[this._loadedCodeMirror.tags.comment]);return!!this.renderRoot.querySelector("span.".concat(e))}},{kind:"method",key:"connectedCallback",value:function(){(0,v.Z)((0,p.Z)(M.prototype),"connectedCallback",this).call(this),this.hasUpdated&&this.requestUpdate(),this.addEventListener("keydown",_.U),this.codemirror&&!1!==this.autofocus&&this.codemirror.focus()}},{kind:"method",key:"disconnectedCallback",value:function(){var e=this;(0,v.Z)((0,p.Z)(M.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("keydown",_.U),this.updateComplete.then((function(){e.codemirror.destroy(),delete e.codemirror}))}},{kind:"method",key:"scheduleUpdate",value:(Z=(0,d.Z)((0,a.Z)().mark((function e(){var t;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=this._loadedCodeMirror)||void 0===t){e.next=4;break}e.next=7;break;case 4:return e.next=6,Promise.all([r.e(2771),r.e(2562),r.e(9146)]).then(r.bind(r,59146));case 6:this._loadedCodeMirror=e.sent;case 7:(0,v.Z)((0,p.Z)(M.prototype),"scheduleUpdate",this).call(this);case 8:case"end":return e.stop()}}),e,this)}))),function(){return Z.apply(this,arguments)})},{kind:"method",key:"update",value:function(e){if((0,v.Z)((0,p.Z)(M.prototype),"update",this).call(this,e),this.codemirror){var t,r=[];if(e.has("mode")&&r.push({effects:this._loadedCodeMirror.langCompartment.reconfigure(this._mode)}),e.has("readOnly")&&r.push({effects:this._loadedCodeMirror.readonlyCompartment.reconfigure(this._loadedCodeMirror.EditorView.editable.of(!this.readOnly))}),e.has("_value")&&this._value!==this.value&&r.push({changes:{from:0,to:this.codemirror.state.doc.length,insert:this._value}}),r.length>0)(t=this.codemirror).dispatch.apply(t,r);e.has("error")&&this.classList.toggle("error-state",this.error)}else this._createCodeMirror()}},{kind:"get",key:"_mode",value:function(){return this._loadedCodeM
//# sourceMappingURL=9766.OmCEn859YPI.js.map