iobroker.nspanel-lovelace-ui
Version:
NsPanel Lovelace UI is a Firmware for the nextion screen inside of NSPanel in the Design of Lovelace UI Design.
172 lines (135 loc) • 636 kB
JavaScript
import{a as mi}from"./AdminComponentEasyAccessSet__loadShare__react__loadShare__.js-VQUi_FZ-.js";import{p as wt}from"./useTheme-7761-x-Y.js";import{c as we,r as bt}from"./AdminComponentEasyAccessSet__loadShare__react__loadShare__.js_commonjs-proxy-xiMWmJG0.js";var We={},Ie={},Jt={exports:{}};(function(N,D){(function(){var A="ace",M=(function(){return this})();!M&&typeof window<"u"&&(M=window);var E=function(e,t,i){if(typeof e!="string"){E.original?E.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(i=t),E.modules[e]||(E.payloads[e]=i,E.modules[e]=null)};E.modules={},E.payloads={};var h=function(e,t,i){if(typeof t=="string"){var r=s(e,t);if(r!=null)return i&&i(),r}else if(Object.prototype.toString.call(t)==="[object Array]"){for(var n=[],o=0,l=t.length;o<l;++o){var u=s(e,t[o]);if(u==null&&d.original)return;n.push(u)}return i&&i.apply(null,n)||!0}},d=function(e,t){var i=h("",e,t);return i==null&&d.original?d.original.apply(this,arguments):i},p=function(e,t){if(t.indexOf("!")!==-1){var i=t.split("!");return p(e,i[0])+"!"+p(e,i[1])}if(t.charAt(0)=="."){var r=e.split("/").slice(0,-1).join("/");for(t=r+"/"+t;t.indexOf(".")!==-1&&n!=t;){var n=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t},s=function(e,t){t=p(e,t);var i=E.modules[t];if(!i){if(i=E.payloads[t],typeof i=="function"){var r={},n={id:t,uri:"",exports:r,packaged:!0},o=function(u,f){return h(t,u,f)},l=i(o,r,n);r=l||n.exports,E.modules[t]=r,delete E.payloads[t]}i=E.modules[t]=r||i}return i};function a(e){var t=M;M[e]||(M[e]={}),t=M[e],(!t.define||!t.define.packaged)&&(E.original=t.define,t.define=E,t.define.packaged=!0),(!t.require||!t.require.packaged)&&(d.original=t.require,t.require=d,t.require.packaged=!0)}a(A)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(A,M,E){function h(d,p,s){Object.defineProperty(d,p,{value:s,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||h(String.prototype,"startsWith",function(d,p){return p=p||0,this.lastIndexOf(d,p)===p}),String.prototype.endsWith||h(String.prototype,"endsWith",function(d,p){var s=this;(p===void 0||p>s.length)&&(p=s.length),p-=d.length;var a=s.indexOf(d,p);return a!==-1&&a===p}),String.prototype.repeat||h(String.prototype,"repeat",function(d){for(var p="",s=this;d>0;)d&1&&(p+=s),(d>>=1)&&(s+=s);return p}),String.prototype.includes||h(String.prototype,"includes",function(d,p){return this.indexOf(d,p)!=-1}),Object.assign||(Object.assign=function(d){if(d==null)throw new TypeError("Cannot convert undefined or null to object");for(var p=Object(d),s=1;s<arguments.length;s++){var a=arguments[s];a!=null&&Object.keys(a).forEach(function(e){p[e]=a[e]})}return p}),Object.values||(Object.values=function(d){return Object.keys(d).map(function(p){return d[p]})}),Array.prototype.find||h(Array.prototype,"find",function(d){for(var p=this.length,s=arguments[1],a=0;a<p;a++){var e=this[a];if(d.call(s,e,a,this))return e}}),Array.prototype.findIndex||h(Array.prototype,"findIndex",function(d){for(var p=this.length,s=arguments[1],a=0;a<p;a++){var e=this[a];if(d.call(s,e,a,this))return a}}),Array.prototype.includes||h(Array.prototype,"includes",function(d,p){return this.indexOf(d,p)!=-1}),Array.prototype.fill||h(Array.prototype,"fill",function(d){for(var p=this,s=p.length>>>0,a=arguments[1],e=a>>0,t=e<0?Math.max(s+e,0):Math.min(e,s),i=arguments[2],r=i===void 0?s:i>>0,n=r<0?Math.max(s+r,0):Math.min(r,s);t<n;)p[t]=d,t++;return p}),Array.of||h(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(A,M,E){A("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(A,M,E){M.deepCopy=function h(d){if(typeof d!="object"||!d)return d;var p;if(Array.isArray(d)){p=[];for(var s=0;s<d.length;s++)p[s]=h(d[s]);return p}if(Object.prototype.toString.call(d)!=="[object Object]")return d;p={};for(var s in d)p[s]=h(d[s]);return p}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(A,M,E){M.last=function(p){return p[p.length-1]},M.stringReverse=function(p){return p.split("").reverse().join("")},M.stringRepeat=function(p,s){for(var a="";s>0;)s&1&&(a+=p),(s>>=1)&&(p+=p);return a};var h=/^\s\s*/,d=/\s\s*$/;M.stringTrimLeft=function(p){return p.replace(h,"")},M.stringTrimRight=function(p){return p.replace(d,"")},M.copyObject=function(p){var s={};for(var a in p)s[a]=p[a];return s},M.copyArray=function(p){for(var s=[],a=0,e=p.length;a<e;a++)p[a]&&typeof p[a]=="object"?s[a]=this.copyObject(p[a]):s[a]=p[a];return s},M.deepCopy=A("./deep_copy").deepCopy,M.arrayToMap=function(p){for(var s={},a=0;a<p.length;a++)s[p[a]]=1;return s},M.createMap=function(p){var s=Object.create(null);for(var a in p)s[a]=p[a];return s},M.arrayRemove=function(p,s){for(var a=0;a<=p.length;a++)s===p[a]&&p.splice(a,1)},M.escapeRegExp=function(p){return p.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},M.escapeHTML=function(p){return(""+p).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},M.getMatchOffsets=function(p,s){var a=[];return p.replace(s,function(e){a.push({offset:arguments[arguments.length-2],length:e.length})}),a},M.deferredCall=function(p){var s=null,a=function(){s=null,p()},e=function(t){return e.cancel(),s=setTimeout(a,t||0),e};return e.schedule=e,e.call=function(){return this.cancel(),p(),e},e.cancel=function(){return clearTimeout(s),s=null,e},e.isPending=function(){return s},e},M.delayedCall=function(p,s){var a=null,e=function(){a=null,p()},t=function(i){a==null&&(a=setTimeout(e,i||s))};return t.delay=function(i){a&&clearTimeout(a),a=setTimeout(e,i||s)},t.schedule=t,t.call=function(){this.cancel(),p()},t.cancel=function(){a&&clearTimeout(a),a=null},t.isPending=function(){return a},t},M.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},M.skipEmptyMatch=function(p,s,a){return a&&p.codePointAt(s)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(A,M,E){M.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},M.getOS=function(){return M.isMac?M.OS.MAC:M.isLinux?M.OS.LINUX:M.OS.WINDOWS};var h=typeof navigator=="object"?navigator:{},d=(/mac|win|linux/i.exec(h.platform)||["other"])[0].toLowerCase(),p=h.userAgent||"",s=h.appName||"";M.isWin=d=="win",M.isMac=d=="mac",M.isLinux=d=="linux",M.isIE=s=="Microsoft Internet Explorer"||s.indexOf("MSAppHost")>=0?parseFloat((p.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((p.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),M.isOldIE=M.isIE&&M.isIE<9,M.isGecko=M.isMozilla=p.match(/ Gecko\/\d+/),M.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",M.isWebKit=parseFloat(p.split("WebKit/")[1])||void 0,M.isChrome=parseFloat(p.split(" Chrome/")[1])||void 0,M.isSafari=parseFloat(p.split(" Safari/")[1])&&!M.isChrome||void 0,M.isEdge=parseFloat(p.split(" Edge/")[1])||void 0,M.isAIR=p.indexOf("AdobeAIR")>=0,M.isAndroid=p.indexOf("Android")>=0,M.isChromeOS=p.indexOf(" CrOS ")>=0,M.isIOS=/iPad|iPhone|iPod/.test(p)&&!window.MSStream,M.isIOS&&(M.isMac=!0),M.isMobile=M.isIOS||M.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(A,M,E){var h=A("./useragent"),d="http://www.w3.org/1999/xhtml";M.buildDom=function i(r,n,o){if(typeof r=="string"&&r){var l=document.createTextNode(r);return n&&n.appendChild(l),l}if(!Array.isArray(r))return r&&r.appendChild&&n&&n.appendChild(r),r;if(typeof r[0]!="string"||!r[0]){for(var u=[],f=0;f<r.length;f++){var _=i(r[f],n,o);_&&u.push(_)}return u}var b=document.createElement(r[0]),v=r[1],c=1;v&&typeof v=="object"&&!Array.isArray(v)&&(c=2);for(var f=c;f<r.length;f++)i(r[f],b,o);return c==2&&Object.keys(v).forEach(function(y){var L=v[y];y==="class"?b.className=Array.isArray(L)?L.join(" "):L:typeof L=="function"||y=="value"||y[0]=="$"?b[y]=L:y==="ref"?o&&(o[L]=b):y==="style"?typeof L=="string"&&(b.style.cssText=L):L!=null&&b.setAttribute(y,L)}),n&&n.appendChild(b),b},M.getDocumentHead=function(i){return i||(i=document),i.head||i.getElementsByTagName("head")[0]||i.documentElement},M.createElement=function(i,r){return document.createElementNS?document.createElementNS(r||d,i):document.createElement(i)},M.removeChildren=function(i){i.innerHTML=""},M.createTextNode=function(i,r){var n=r?r.ownerDocument:document;return n.createTextNode(i)},M.createFragment=function(i){var r=i?i.ownerDocument:document;return r.createDocumentFragment()},M.hasCssClass=function(i,r){var n=(i.className+"").split(/\s+/g);return n.indexOf(r)!==-1},M.addCssClass=function(i,r){M.hasCssClass(i,r)||(i.className+=" "+r)},M.removeCssClass=function(i,r){for(var n=i.className.split(/\s+/g);;){var o=n.indexOf(r);if(o==-1)break;n.splice(o,1)}i.className=n.join(" ")},M.toggleCssClass=function(i,r){for(var n=i.className.split(/\s+/g),o=!0;;){var l=n.indexOf(r);if(l==-1)break;o=!1,n.splice(l,1)}return o&&n.push(r),i.className=n.join(" "),o},M.setCssClass=function(i,r,n){n?M.addCssClass(i,r):M.removeCssClass(i,r)},M.hasCssString=function(i,r){var n=0,o;if(r=r||document,o=r.querySelectorAll("style")){for(;n<o.length;)if(o[n++].id===i)return!0}},M.removeElementById=function(i,r){r=r||document,r.getElementById(i)&&r.getElementById(i).remove()};var p,s=[];M.useStrictCSP=function(i){p=i,i==!1?a():s||(s=[])};function a(){var i=s;s=null,i&&i.forEach(function(r){e(r[0],r[1])})}function e(i,r,n){if(!(typeof document>"u")){if(s){if(n)a();else if(n===!1)return s.push([i,r])}if(!p){var o=n;!n||!n.getRootNode?o=document:(o=n.getRootNode(),(!o||o==n)&&(o=document));var l=o.ownerDocument||o;if(r&&M.hasCssString(r,o))return null;r&&(i+=`
/*# sourceURL=ace/css/`+r+" */");var u=M.createElement("style");u.appendChild(l.createTextNode(i)),r&&(u.id=r),o==l&&(o=M.getDocumentHead(l)),o.insertBefore(u,o.firstChild)}}}if(M.importCssString=e,M.importCssStylsheet=function(i,r){M.buildDom(["link",{rel:"stylesheet",href:i}],M.getDocumentHead(r))},M.$fixPositionBug=function(i){var r=i.getBoundingClientRect();if(i.style.left){var n=parseFloat(i.style.left),o=+r.left;Math.abs(n-o)>1&&(i.style.left=2*n-o+"px")}if(i.style.right){var n=parseFloat(i.style.right),o=window.innerWidth-r.right;Math.abs(n-o)>1&&(i.style.right=2*n-o+"px")}if(i.style.top){var n=parseFloat(i.style.top),o=+r.top;Math.abs(n-o)>1&&(i.style.top=2*n-o+"px")}if(i.style.bottom){var n=parseFloat(i.style.bottom),o=window.innerHeight-r.bottom;Math.abs(n-o)>1&&(i.style.bottom=2*n-o+"px")}},M.scrollbarWidth=function(i){var r=M.createElement("ace_inner");r.style.width="100%",r.style.minWidth="0px",r.style.height="200px",r.style.display="block";var n=M.createElement("ace_outer"),o=n.style;o.position="absolute",o.left="-10000px",o.overflow="hidden",o.width="200px",o.minWidth="0px",o.height="150px",o.display="block",n.appendChild(r);var l=i&&i.documentElement||document&&document.documentElement;if(!l)return 0;l.appendChild(n);var u=r.offsetWidth;o.overflow="scroll";var f=r.offsetWidth;return u===f&&(f=n.clientWidth),l.removeChild(n),u-f},M.computedStyle=function(i,r){return window.getComputedStyle(i,"")||{}},M.setStyle=function(i,r,n){i[r]!==n&&(i[r]=n)},M.HAS_CSS_ANIMATION=!1,M.HAS_CSS_TRANSFORMS=!1,M.HI_DPI=h.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,h.isChromeOS&&(M.HI_DPI=!1),typeof document<"u"){var t=document.createElement("div");M.HI_DPI&&t.style.transform!==void 0&&(M.HAS_CSS_TRANSFORMS=!0),!h.isEdge&&typeof t.style.animationName<"u"&&(M.HAS_CSS_ANIMATION=!0),t=null}M.HAS_CSS_TRANSFORMS?M.translate=function(i,r,n){i.style.transform="translate("+Math.round(r)+"px, "+Math.round(n)+"px)"}:M.translate=function(i,r,n){i.style.top=Math.round(n)+"px",i.style.left=Math.round(r)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(A,M,E){var h=A("./dom");M.get=function(d,p){var s=new XMLHttpRequest;s.open("GET",d,!0),s.onreadystatechange=function(){s.readyState===4&&p(s.responseText)},s.send(null)},M.loadScript=function(d,p){var s=h.getDocumentHead(),a=document.createElement("script");a.src=d,s.appendChild(a),a.onload=a.onreadystatechange=function(e,t){(t||!a.readyState||a.readyState=="loaded"||a.readyState=="complete")&&(a=a.onload=a.onreadystatechange=null,t||p())}},M.qualifyURL=function(d){var p=document.createElement("a");return p.href=d,p.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(A,M,E){M.inherits=function(h,d){h.super_=d,h.prototype=Object.create(d.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}})},M.mixin=function(h,d){for(var p in d)h[p]=d[p];return h},M.implement=function(h,d){M.mixin(h,d)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(A,M,E){var h={},d=function(){this.propagationStopped=!0},p=function(){this.defaultPrevented=!0};h._emit=h._dispatchEvent=function(s,a){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var e=this._eventRegistry[s]||[],t=this._defaultHandlers[s];if(!(!e.length&&!t)){(typeof a!="object"||!a)&&(a={}),a.type||(a.type=s),a.stopPropagation||(a.stopPropagation=d),a.preventDefault||(a.preventDefault=p),e=e.slice();for(var i=0;i<e.length&&(e[i](a,this),!a.propagationStopped);i++);if(t&&!a.defaultPrevented)return t(a,this)}},h._signal=function(s,a){var e=(this._eventRegistry||{})[s];if(e){e=e.slice();for(var t=0;t<e.length;t++)e[t](a,this)}},h.once=function(s,a){var e=this;if(this.on(s,function t(){e.off(s,t),a.apply(null,arguments)}),!a)return new Promise(function(t){a=t})},h.setDefaultHandler=function(s,a){var e=this._defaultHandlers;if(e||(e=this._defaultHandlers={_disabled_:{}}),e[s]){var t=e[s],i=e._disabled_[s];i||(e._disabled_[s]=i=[]),i.push(t);var r=i.indexOf(a);r!=-1&&i.splice(r,1)}e[s]=a},h.removeDefaultHandler=function(s,a){var e=this._defaultHandlers;if(e){var t=e._disabled_[s];if(e[s]==a)t&&this.setDefaultHandler(s,t.pop());else if(t){var i=t.indexOf(a);i!=-1&&t.splice(i,1)}}},h.on=h.addEventListener=function(s,a,e){this._eventRegistry=this._eventRegistry||{};var t=this._eventRegistry[s];return t||(t=this._eventRegistry[s]=[]),t.indexOf(a)==-1&&t[e?"unshift":"push"](a),a},h.off=h.removeListener=h.removeEventListener=function(s,a){this._eventRegistry=this._eventRegistry||{};var e=this._eventRegistry[s];if(e){var t=e.indexOf(a);t!==-1&&e.splice(t,1)}},h.removeAllListeners=function(s){s||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[s]=void 0),this._defaultHandlers&&(this._defaultHandlers[s]=void 0)},M.EventEmitter=h}),ace.define("ace/lib/report_error",["require","exports","module"],function(A,M,E){M.reportError=function(d,p){var s=new Error(d);s.data=p,typeof console=="object"&&console.error&&console.error(s),setTimeout(function(){throw s})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(A,M,E){var h={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor gutter","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages","gutter.annotation.aria-label.security":"Security finding, read annotations row $0","gutter.annotation.aria-label.hint":"Suggestion, read annotations row $0","gutter-tooltip.aria-label.security.singular":"security finding","gutter-tooltip.aria-label.security.plural":"security findings","gutter-tooltip.aria-label.hint.singular":"suggestion","gutter-tooltip.aria-label.hint.plural":"suggestions","editor.tooltip.disable-editing":"Editing is disabled"};M.defaultEnglishMessages=h}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"],function(A,M,E){"no use strict";var h=A("./oop"),d=A("./event_emitter").EventEmitter,p=A("./report_error").reportError,s=A("./default_english_messages").defaultEnglishMessages,a={setOptions:function(n){Object.keys(n).forEach(function(o){this.setOption(o,n[o])},this)},getOptions:function(n){var o={};if(n)Array.isArray(n)||(n=Object.keys(n));else{var l=this.$options;n=Object.keys(l).filter(function(u){return!l[u].hidden})}return n.forEach(function(u){o[u]=this.getOption(u)},this),o},setOption:function(n,o){if(this["$"+n]!==o){var l=this.$options[n];if(!l)return e('misspelled option "'+n+'"');if(l.forwardTo)return this[l.forwardTo]&&this[l.forwardTo].setOption(n,o);l.handlesSet||(this["$"+n]=o),l&&l.set&&l.set.call(this,o)}},getOption:function(n){var o=this.$options[n];return o?o.forwardTo?this[o.forwardTo]&&this[o.forwardTo].getOption(n):o&&o.get?o.get.call(this):this["$"+n]:e('misspelled option "'+n+'"')}};function e(n){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var t,i,r=(function(){function n(){this.$defaultOptions={},t=s,i="dollarSigns"}return n.prototype.defineOptions=function(o,l,u){return o.$options||(this.$defaultOptions[l]=o.$options={}),Object.keys(u).forEach(function(f){var _=u[f];typeof _=="string"&&(_={forwardTo:_}),_.name||(_.name=f),o.$options[_.name]=_,"initialValue"in _&&(o["$"+_.name]=_.initialValue)}),h.implement(o,a),this},n.prototype.resetOptions=function(o){Object.keys(o.$options).forEach(function(l){var u=o.$options[l];"value"in u&&o.setOption(l,u.value)})},n.prototype.setDefaultValue=function(o,l,u){if(!o){for(o in this.$defaultOptions)if(this.$defaultOptions[o][l])break;if(!this.$defaultOptions[o][l])return!1}var f=this.$defaultOptions[o]||(this.$defaultOptions[o]={});f[l]&&(f.forwardTo?this.setDefaultValue(f.forwardTo,l,u):f[l].value=u)},n.prototype.setDefaultValues=function(o,l){Object.keys(l).forEach(function(u){this.setDefaultValue(o,u,l[u])},this)},n.prototype.setMessages=function(o,l){t=o,l&&l.placeholders&&(i=l.placeholders)},n.prototype.nls=function(o,l,u){t[o]||(e("No message found for the key '"+o+"' in messages with id "+t.$id+", trying to find a translation for the default string '"+l+"'."),t[l]||e("No message found for the default string '"+l+"' in the provided messages. Falling back to the default English message."));var f=t[o]||t[l]||l;return u&&(i==="dollarSigns"&&(f=f.replace(/\$(\$|[\d]+)/g,function(_,b){return b=="$"?"$":u[b]})),i==="curlyBrackets"&&(f=f.replace(/\{([^\}]+)\}/g,function(_,b){return u[b]}))),f},n})();r.prototype.warn=e,r.prototype.reportError=p,h.implement(r.prototype,d),M.AppConfig=r}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(A,M,E){E.exports=`.ace-tm .ace_gutter {
background: #f0f0f0;
color: #333;
}
.ace-tm .ace_print-margin {
width: 1px;
background: #e8e8e8;
}
.ace-tm .ace_fold {
background-color: #6B72E6;
}
.ace-tm {
background-color: #FFFFFF;
color: black;
}
.ace-tm .ace_cursor {
color: black;
}
.ace-tm .ace_invisible {
color: rgb(191, 191, 191);
}
.ace-tm .ace_storage,
.ace-tm .ace_keyword {
color: blue;
}
.ace-tm .ace_constant {
color: rgb(197, 6, 11);
}
.ace-tm .ace_constant.ace_buildin {
color: rgb(88, 72, 246);
}
.ace-tm .ace_constant.ace_language {
color: rgb(88, 92, 246);
}
.ace-tm .ace_constant.ace_library {
color: rgb(6, 150, 14);
}
.ace-tm .ace_invalid {
background-color: rgba(255, 0, 0, 0.1);
color: red;
}
.ace-tm .ace_support.ace_function {
color: rgb(60, 76, 114);
}
.ace-tm .ace_support.ace_constant {
color: rgb(6, 150, 14);
}
.ace-tm .ace_support.ace_type,
.ace-tm .ace_support.ace_class {
color: rgb(109, 121, 222);
}
.ace-tm .ace_keyword.ace_operator {
color: rgb(104, 118, 135);
}
.ace-tm .ace_string {
color: rgb(3, 106, 7);
}
.ace-tm .ace_comment {
color: rgb(76, 136, 107);
}
.ace-tm .ace_comment.ace_doc {
color: rgb(0, 102, 255);
}
.ace-tm .ace_comment.ace_doc.ace_tag {
color: rgb(128, 159, 191);
}
.ace-tm .ace_constant.ace_numeric {
color: rgb(0, 0, 205);
}
.ace-tm .ace_variable {
color: rgb(49, 132, 149);
}
.ace-tm .ace_xml-pe {
color: rgb(104, 104, 91);
}
.ace-tm .ace_entity.ace_name.ace_function {
color: #0000A2;
}
.ace-tm .ace_heading {
color: rgb(12, 7, 255);
}
.ace-tm .ace_list {
color:rgb(185, 6, 144);
}
.ace-tm .ace_meta.ace_tag {
color:rgb(0, 22, 142);
}
.ace-tm .ace_string.ace_regex {
color: rgb(255, 0, 0)
}
.ace-tm .ace_marker-layer .ace_selection {
background: rgb(181, 213, 255);
}
.ace-tm.ace_multiselect .ace_selection.ace_start {
box-shadow: 0 0 3px 0px white;
}
.ace-tm .ace_marker-layer .ace_step {
background: rgb(252, 255, 0);
}
.ace-tm .ace_marker-layer .ace_stack {
background: rgb(164, 229, 101);
}
.ace-tm .ace_marker-layer .ace_bracket {
margin: -1px 0 0 -1px;
border: 1px solid rgb(192, 192, 192);
}
.ace-tm .ace_marker-layer .ace_active-line {
background: rgba(0, 0, 0, 0.07);
}
.ace-tm .ace_gutter-active-line {
background-color : #dcdcdc;
}
.ace-tm .ace_marker-layer .ace_selected-word {
background: rgb(250, 250, 255);
border: 1px solid rgb(200, 200, 250);
}
.ace-tm .ace_indent-guide {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;
}
.ace-tm .ace_indent-guide-active {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
}
`}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(A,M,E){M.isDark=!1,M.cssClass="ace-tm",M.cssText=A("./textmate-css"),M.$id="ace/theme/textmate";var h=A("../lib/dom");h.importCssString(M.cssText,M.cssClass,!1)}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],function(A,M,E){"no use strict";var h=A("./lib/lang"),d=A("./lib/net"),p=A("./lib/dom"),s=A("./lib/app_config").AppConfig;E.exports=M=new s;var a={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};M.get=function(r){if(!a.hasOwnProperty(r))throw new Error("Unknown config key: "+r);return a[r]},M.set=function(r,n){if(a.hasOwnProperty(r))a[r]=n;else if(this.setDefaultValue("",r,n)==!1)throw new Error("Unknown config key: "+r);r=="useStrictCSP"&&p.useStrictCSP(n)},M.all=function(){return h.copyObject(a)},M.$modes={},M.moduleUrl=function(r,n){if(a.$moduleUrls[r])return a.$moduleUrls[r];var o=r.split("/");n=n||o[o.length-2]||"";var l=n=="snippets"?"/":"-",u=o[o.length-1];if(n=="worker"&&l=="-"){var f=new RegExp("^"+n+"[\\-_]|[\\-_]"+n+"$","g");u=u.replace(f,"")}(!u||u==n)&&o.length>1&&(u=o[o.length-2]);var _=a[n+"Path"];return _==null?_=a.basePath:l=="/"&&(n=l=""),_&&_.slice(-1)!="/"&&(_+="/"),_+n+l+u+this.get("suffix")},M.setModuleUrl=function(r,n){return a.$moduleUrls[r]=n};var e=function(r,n){if(r==="ace/theme/textmate"||r==="./theme/textmate")return n(null,A("./theme/textmate"));if(t)return t(r,n);console.error("loader is not configured")},t;M.setLoader=function(r){t=r},M.dynamicModules=Object.create(null),M.$loading={},M.$loaded={},M.loadModule=function(r,n){var o;if(Array.isArray(r))var l=r[0],u=r[1];else if(typeof r=="string")var u=r;var f=function(_){if(_&&!M.$loading[u])return n&&n(_);if(M.$loading[u]||(M.$loading[u]=[]),M.$loading[u].push(n),!(M.$loading[u].length>1)){var b=function(){e(u,function(v,c){c&&(M.$loaded[u]=c),M._emit("load.module",{name:u,module:c});var y=M.$loading[u];M.$loading[u]=null,y.forEach(function(L){L&&L(c)})})};if(!M.get("packaged"))return b();d.loadScript(M.moduleUrl(u,l),b),i()}};if(M.dynamicModules[u])M.dynamicModules[u]().then(function(_){_.default?f(_.default):f(_)});else{try{o=this.$require(u)}catch{}f(o||M.$loaded[u])}},M.$require=function(r){if(typeof E.require=="function"){var n="require";return E[n](r)}},M.setModuleLoader=function(r,n){M.dynamicModules[r]=n};var i=function(){!a.basePath&&!a.workerPath&&!a.modePath&&!a.themePath&&!Object.keys(a.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),i=function(){})};M.version="1.43.4"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(A,M,E){A("./lib/fixoldbrowsers");var h=A("./config");h.setLoader(function(a,e){A([a],function(t){e(null,t)})});var d=(function(){return this||typeof window<"u"&&window})();E.exports=function(a){h.init=p,h.$require=A,a.require=A},p(!0);function p(a){if(!(!d||!d.document)){h.set("packaged",a||A.packaged||E.packaged||d.define&&(void 0).packaged);var e={},t="",i=document.currentScript||document._currentScript,r=i&&i.ownerDocument||document;i&&i.src&&(t=i.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var n=r.getElementsByTagName("script"),o=0;o<n.length;o++){var l=n[o],u=l.src||l.getAttribute("src");if(u){for(var f=l.attributes,_=0,b=f.length;_<b;_++){var v=f[_];v.name.indexOf("data-ace-")===0&&(e[s(v.name.replace(/^data-ace-/,""))]=v.value)}var c=u.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);c&&(t=c[1])}}t&&(e.base=e.base||t,e.packaged=!0),e.basePath=e.base,e.workerPath=e.workerPath||e.base,e.modePath=e.modePath||e.base,e.themePath=e.themePath||e.base,delete e.base;for(var y in e)typeof e[y]<"u"&&h.set(y,e[y])}}function s(a){return a.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(A,M,E){var h=(function(){function d(p,s,a,e){this.start={row:p,column:s},this.end={row:a,column:e}}return d.prototype.isEqual=function(p){return this.start.row===p.start.row&&this.end.row===p.end.row&&this.start.column===p.start.column&&this.end.column===p.end.column},d.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},d.prototype.contains=function(p,s){return this.compare(p,s)==0},d.prototype.compareRange=function(p){var s,a=p.end,e=p.start;return s=this.compare(a.row,a.column),s==1?(s=this.compare(e.row,e.column),s==1?2:s==0?1:0):s==-1?-2:(s=this.compare(e.row,e.column),s==-1?-1:s==1?42:0)},d.prototype.comparePoint=function(p){return this.compare(p.row,p.column)},d.prototype.containsRange=function(p){return this.comparePoint(p.start)==0&&this.comparePoint(p.end)==0},d.prototype.intersects=function(p){var s=this.compareRange(p);return s==-1||s==0||s==1},d.prototype.isEnd=function(p,s){return this.end.row==p&&this.end.column==s},d.prototype.isStart=function(p,s){return this.start.row==p&&this.start.column==s},d.prototype.setStart=function(p,s){typeof p=="object"?(this.start.column=p.column,this.start.row=p.row):(this.start.row=p,this.start.column=s)},d.prototype.setEnd=function(p,s){typeof p=="object"?(this.end.column=p.column,this.end.row=p.row):(this.end.row=p,this.end.column=s)},d.prototype.inside=function(p,s){return this.compare(p,s)==0?!(this.isEnd(p,s)||this.isStart(p,s)):!1},d.prototype.insideStart=function(p,s){return this.compare(p,s)==0?!this.isEnd(p,s):!1},d.prototype.insideEnd=function(p,s){return this.compare(p,s)==0?!this.isStart(p,s):!1},d.prototype.compare=function(p,s){return!this.isMultiLine()&&p===this.start.row?s<this.start.column?-1:s>this.end.column?1:0:p<this.start.row?-1:p>this.end.row?1:this.start.row===p?s>=this.start.column?0:-1:this.end.row===p?s<=this.end.column?0:1:0},d.prototype.compareStart=function(p,s){return this.start.row==p&&this.start.column==s?-1:this.compare(p,s)},d.prototype.compareEnd=function(p,s){return this.end.row==p&&this.end.column==s?1:this.compare(p,s)},d.prototype.compareInside=function(p,s){return this.end.row==p&&this.end.column==s?1:this.start.row==p&&this.start.column==s?-1:this.compare(p,s)},d.prototype.clipRows=function(p,s){if(this.end.row>s)var a={row:s+1,column:0};else if(this.end.row<p)var a={row:p,column:0};if(this.start.row>s)var e={row:s+1,column:0};else if(this.start.row<p)var e={row:p,column:0};return d.fromPoints(e||this.start,a||this.end)},d.prototype.extend=function(p,s){var a=this.compare(p,s);if(a==0)return this;if(a==-1)var e={row:p,column:s};else var t={row:p,column:s};return d.fromPoints(e||this.start,t||this.end)},d.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},d.prototype.isMultiLine=function(){return this.start.row!==this.end.row},d.prototype.clone=function(){return d.fromPoints(this.start,this.end)},d.prototype.collapseRows=function(){return this.end.column==0?new d(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new d(this.start.row,0,this.end.row,0)},d.prototype.toScreenRange=function(p){var s=p.documentToScreenPosition(this.start),a=p.documentToScreenPosition(this.end);return new d(s.row,s.column,a.row,a.column)},d.prototype.moveBy=function(p,s){this.start.row+=p,this.start.column+=s,this.end.row+=p,this.end.column+=s},d})();h.fromPoints=function(d,p){return new h(d.row,d.column,p.row,p.column)},h.comparePoints=function(d,p){return d.row-p.row||d.column-p.column},M.Range=h}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(A,M,E){for(var h=A("./oop"),d={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},p={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},s=0;s<10;s++)p["Digit"+s]=48+s,p["Numpad"+s]=96+s,d.PRINTABLE_KEYS[48+s]=""+s,d.FUNCTION_KEYS[96+s]="Numpad"+s;for(var s=65;s<91;s++){var a=String.fromCharCode(s+32);p["Key"+a.toUpperCase()]=s,d.PRINTABLE_KEYS[s]=a}for(var s=1;s<13;s++)p["F"+s]=111+s,d.FUNCTION_KEYS[111+s]="F"+s;var e={Shift:16,Control:17,Alt:18,Meta:224};for(var t in e)p[t]=p[t+"Left"]=p[t+"Right"]=e[t];M.$codeToKeyCode=p,d.PRINTABLE_KEYS[173]="-";for(var i in d.FUNCTION_KEYS){var r=d.FUNCTION_KEYS[i].toLowerCase();d[r]=parseInt(i,10)}for(var i in d.PRINTABLE_KEYS){var r=d.PRINTABLE_KEYS[i].toLowerCase();d[r]=parseInt(i,10)}h.mixin(d,d.MODIFIER_KEYS),h.mixin(d,d.PRINTABLE_KEYS),h.mixin(d,d.FUNCTION_KEYS),d.enter=d.return,d.escape=d.esc,d.del=d.delete,(function(){for(var n=["cmd","ctrl","alt","shift"],o=Math.pow(2,n.length);o--;)d.KEY_MODS[o]=n.filter(function(l){return o&d.KEY_MODS[l]}).join("-")+"-"})(),d.KEY_MODS[0]="",d.KEY_MODS[-1]="input-",h.mixin(M,d),M.default=M,M.keyCodeToString=function(n){var o=d[n];return typeof o!="string"&&(o=String.fromCharCode(n)),o.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(A,M,E){var h=A("./keys"),d=A("./useragent"),p=null,s=0,a;function e(){a=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return a={passive:!1},!0}})}catch{}}function t(){return a==null&&e(),a}function i(_,b,v){this.elem=_,this.type=b,this.callback=v}i.prototype.destroy=function(){n(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var r=M.addListener=function(_,b,v,c){_.addEventListener(b,v,t()),c&&c.$toDestroy.push(new i(_,b,v))},n=M.removeListener=function(_,b,v){_.removeEventListener(b,v,t())};M.stopEvent=function(_){return M.stopPropagation(_),M.preventDefault(_),!1},M.stopPropagation=function(_){_.stopPropagation&&_.stopPropagation()},M.preventDefault=function(_){_.preventDefault&&_.preventDefault()},M.getButton=function(_){return _.type=="dblclick"?0:_.type=="contextmenu"||d.isMac&&_.ctrlKey&&!_.altKey&&!_.shiftKey?2:_.button},M.capture=function(_,b,v){var c=_&&_.ownerDocument||document;function y(L){b&&b(L),v&&v(L),n(c,"mousemove",b),n(c,"mouseup",y),n(c,"dragstart",y)}return r(c,"mousemove",b),r(c,"mouseup",y),r(c,"dragstart",y),y},M.addMouseWheelListener=function(_,b,v){r(_,"wheel",function(c){var y=.15,L=c.deltaX||0,w=c.deltaY||0;switch(c.deltaMode){case c.DOM_DELTA_PIXEL:c.wheelX=L*y,c.wheelY=w*y;break;case c.DOM_DELTA_LINE:var x=15;c.wheelX=L*x,c.wheelY=w*x;break;case c.DOM_DELTA_PAGE:var T=150;c.wheelX=L*T,c.wheelY=w*T;break}b(c)},v)},M.addMultiMouseDownListener=function(_,b,v,c,y){var L=0,w,x,T,S={2:"dblclick",3:"tripleclick",4:"quadclick"};function C(m){if(M.getButton(m)!==0?L=0:m.detail>1?(L++,L>4&&(L=1)):L=1,d.isIE){var g=Math.abs(m.clientX-w)>5||Math.abs(m.clientY-x)>5;(!T||g)&&(L=1),T&&clearTimeout(T),T=setTimeout(function(){T=null},b[L-1]||600),L==1&&(w=m.clientX,x=m.clientY)}if(m._clicks=L,v[c]("mousedown",m),L>4)L=0;else if(L>1)return v[c](S[L],m)}Array.isArray(_)||(_=[_]),_.forEach(function(m){r(m,"mousedown",C,y)})};function o(_){return 0|(_.ctrlKey?1:0)|(_.altKey?2:0)|(_.shiftKey?4:0)|(_.metaKey?8:0)}M.getModifierString=function(_){return h.KEY_MODS[o(_)]};function l(_,b,v){var c=o(b);if(!v&&b.code&&(v=h.$codeToKeyCode[b.code]||v),!d.isMac&&p){if(b.getModifierState&&(b.getModifierState("OS")||b.getModifierState("Win"))&&(c|=8),p.altGr)if((3&c)!=3)p.altGr=0;else return;if(v===18||v===17){var y=b.location;if(v===17&&y===1)p[v]==1&&(s=b.timeStamp);else if(v===18&&c===3&&y===2){var L=b.timeStamp-s;L<50&&(p.altGr=!0)}}}if(v in h.MODIFIER_KEYS&&(v=-1),!(!c&&v===13&&b.location===3&&(_(b,c,-v),b.defaultPrevented))){if(d.isChromeOS&&c&8){if(_(b,c,v),b.defaultPrevented)return;c&=-9}return!c&&!(v in h.FUNCTION_KEYS)&&!(v in h.PRINTABLE_KEYS)?!1:_(b,c,v)}}M.addCommandKeyListener=function(_,b,v){var c=null;r(_,"keydown",function(y){p[y.keyCode]=(p[y.keyCode]||0)+1;var L=l(b,y,y.keyCode);return c=y.defaultPrevented,L},v),r(_,"keypress",function(y){c&&(y.ctrlKey||y.altKey||y.shiftKey||y.metaKey)&&(M.stopEvent(y),c=null)},v),r(_,"keyup",function(y){p[y.keyCode]=null},v),p||(u(),r(window,"focus",u))};function u(){p=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!d.isOldIE){var f=1;M.nextTick=function(_,b){b=b||window;var v="zero-timeout-message-"+f++,c=function(y){y.data==v&&(M.stopPropagation(y),n(b,"message",c),_())};r(b,"message",c),b.postMessage(v,"*")}}M.$idleBlocked=!1,M.onIdle=function(_,b){return setTimeout(function v(){M.$idleBlocked?setTimeout(v,100):_()},b)},M.$idleBlockId=null,M.blockIdle=function(_){M.$idleBlockId&&clearTimeout(M.$idleBlockId),M.$idleBlocked=!0,M.$idleBlockId=setTimeout(function(){M.$idleBlocked=!1},_||100)},M.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),M.nextFrame?M.nextFrame=M.nextFrame.bind(window):M.nextFrame=function(_){setTimeout(_,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(A,M,E){var h;E.exports={lineMode:!1,pasteCancelled:function(){return h&&h>Date.now()-50?!0:h=!1},cancel:function(){h=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(A,M,E){var h=A("../lib/event"),d=A("../config").nls,p=A("../lib/useragent"),s=A("../lib/dom"),a=A("../lib/lang"),e=A("../clipboard"),t=p.isChrome<18,i=p.isIE,r=p.isChrome>63,n=400,o=A("../lib/keys"),l=o.KEY_MODS,u=p.isIOS,f=u?/\s/:/\n/,_=p.isMobile,b=(function(){function v(c,y){var L=this;this.host=y,this.text=s.createElement("textarea"),this.text.className="ace_text-input",this.text.setAttribute("wrap","off"),this.text.setAttribute("autocomplete","off"),this.text.setAttribute("autocorrect","off"),this.text.setAttribute("autocapitalize","off"),this.text.setAttribute("spellcheck","false"),this.text.style.opacity="0",c.insertBefore(this.text,c.firstChild),this.copied=!1,this.pasted=!1,this.inComposition=!1,this.sendingText=!1,this.tempStyle="",_||(this.text.style.fontSize="1px"),this.commandMode=!1,this.ignoreFocusEvents=!1,this.lastValue="",this.lastSelectionStart=0,this.lastSelectionEnd=0,this.lastRestoreEnd=0,this.rowStart=Number.MAX_SAFE_INTEGER,this.rowEnd=Number.MIN_SAFE_INTEGER,this.numberOfExtraLines=0;try{this.$isFocused=document.activeElement===this.text}catch{}this.cancelComposition=this.cancelComposition.bind(this),this.setAriaOptions({role:"textbox"}),h.addListener(this.text,"blur",function(w){L.ignoreFocusEvents||(y.onBlur(w),L.$isFocused=!1)},y),h.addListener(this.text,"focus",function(w){if(!L.ignoreFocusEvents){if(L.$isFocused=!0,p.isEdge)try{if(!document.hasFocus())return}catch{}y.onFocus(w),p.isEdge?setTimeout(L.resetSelection.bind(L)):L.resetSelection()}},y),this.$focusScroll=!1,y.on("beforeEndOperation",function(){var w=y.curOp,x=w&&w.command&&w.command.name;if(x!="insertstring"){var T=x&&(w.docChanged||w.selectionChanged);L.inComposition&&T&&(L.lastValue=L.text.value="",L.onCompositionEnd()),L.resetSelection()}}),y.on("changeSelection",this.setAriaLabel.bind(this)),this.resetSelection=u?this.$resetSelectionIOS:this.$resetSelection,this.$isFocused&&y.onFocus(),this.inputHandler=null,this.afterContextMenu=!1,h.addCommandKeyListener(this.text,function(w,x,T){if(!L.inComposition)return y.onCommandKey(w,x,T)},y),h.addListener(this.text,"select",this.onSelect.bind(this),y),h.addListener(this.text,"input",this.onInput.bind(this),y),h.addListener(this.text,"cut",this.onCut.bind(this),y),h.addListener(this.text,"copy",this.onCopy.bind(this),y),h.addListener(this.text,"paste",this.onPaste.bind(this),y),(!("oncut"in this.text)||!("oncopy"in this.text)||!("onpaste"in this.text))&&h.addListener(c,"keydown",function(w){if(!(p.isMac&&!w.metaKey||!w.ctrlKey))switch(w.keyCode){case 67:L.onCopy(w);break;case 86:L.onPaste(w);break;case 88:L.onCut(w);break}},y),this.syncComposition=a.delayedCall(this.onCompositionUpdate.bind(this),50).schedule.bind(null,null),h.addListener(this.text,"compositionstart",this.onCompositionStart.bind(this),y),h.addListener(this.text,"compositionupdate",this.onCompositionUpdate.bind(this),y),h.addListener(this.text,"keyup",this.onKeyup.bind(this),y),h.addListener(this.text,"keydown",this.syncComposition.bind(this),y),h.addListener(this.text,"compositionend",this.onCompositionEnd.bind(this),y),this.closeTimeout,h.addListener(this.text,"mouseup",this.$onContextMenu.bind(this),y),h.addListener(this.text,"mousedown",function(w){w.preventDefault(),L.onContextMenuClose()},y),h.addListener(y.renderer.scroller,"contextmenu",this.$onContextMenu.bind(this),y),h.addListener(this.text,"contextmenu",this.$onContextMenu.bind(this),y),u&&this.addIosSelectionHandler(c,y,this.text)}return v.prototype.addIosSelectionHandler=function(c,y,L){var w=this,x=null,T=!1;L.addEventListener("keydown",function(C){x&&clearTimeout(x),T=!0},!0),L.addEventListener("keyup",function(C){x=setTimeout(function(){T=!1},100)},!0);var S=function(C){if(document.activeElement===L&&!(T||w.inComposition||y.$mouseHandler.isMousePressed)&&!w.copied){var m=L.selectionStart,g=L.selectionEnd,$=null,k=0;if(m==0?$=o.up:m==1?$=o.home:g>w.lastSelectionEnd&&w.lastValue[g]==`
`?$=o.end:m<w.lastSelectionStart&&w.lastValue[m-1]==" "?($=o.left,k=l.option):m<w.lastSelectionStart||m==w.lastSelectionStart&&w.lastSelectionEnd!=w.lastSelectionStart&&m==g?$=o.left:g>w.lastSelectionEnd&&w.lastValue.slice(0,g).split(`
`).length>2?$=o.down:g>w.lastSelectionEnd&&w.lastValue[g-1]==" "?($=o.right,k=l.option):(g>w.lastSelectionEnd||g==w.lastSelectionEnd&&w.lastSelectionEnd!=w.lastSelectionStart&&m==g)&&($=o.right),m!==g&&(k|=l.shift),$){var R=y.onCommandKey({},k,$);if(!R&&y.commands){$=o.keyCodeToString($);var I=y.commands.findKeyCommand(k,$);I&&y.execCommand(I)}w.lastSelectionStart=m,w.lastSelectionEnd=g,w.resetSelection("")}}};document.addEventListener("selectionchange",S),y.on("destroy",function(){document.removeEventListener("selectionchange",S)})},v.prototype.onContextMenuClose=function(){var c=this;clearTimeout(this.closeTimeout),this.closeTimeout=setTimeout(function(){c.tempStyle&&(c.text.style.cssText=c.tempStyle,c.tempStyle=""),c.host.renderer.$isMousePressed=!1,c.host.renderer.$keepTextAreaAtCursor&&c.host.renderer.$moveTextAreaToCursor()},0)},v.prototype.$onContextMenu=function(c){this.host.textInput.onContextMenu(c),this.onContextMenuClose()},v.prototype.onKeyup=function(c){c.keyCode==27&&this.text.value.length<this.text.selectionStart&&(this.inComposition||(this.lastValue=this.text.value),this.lastSelectionStart=this.lastSelectionEnd=-1,this.resetSelection()),this.syncComposition()},v.prototype.cancelComposition=function(){this.ignoreFocusEvents=!0,this.text.blur(),this.text.focus(),this.ignoreFocusEvents=!1},v.prototype.onCompositionStart=function(c){if(!(this.inComposition||!this.host.onCompositionStart||this.host.$readOnly)&&(this.inComposition={},!this.commandMode)){c.data&&(this.inComposition.useTextareaForIME=!1),setTimeout(this.onCompositionUpdate.bind(this),0),this.host._signal("compositionStart"),this.host.on("mousedown",this.cancelComposition);var y=this.host.getSelectionRange();y.end.row=y.start.row,y.end.column=y.start.column,this.inComposition.markerRange=y,this.inComposition.selectionStart=this.lastSelectionStart,this.host.onCompositionStart(this.inComposition),this.inComposition.useTextareaForIME?(this.lastValue=this.text.value="",this.lastSelectionStart=0,this.lastSelectionEnd=0):(this.text.msGetInputContext&&(this.inComposition.context=this.text.msGetInputContext()),this.text.getInputContext&&(this.inComposition.context=this.text.getInputContext()))}},v.prototype.onCompositionUpdate=function(){if(!(!this.inComposition||!this.host.onCompositionUpdate||this.host.$readOnly)){if(this.commandMode)return this.cancelComposition();if(this.inComposition.useTextareaForIME)this.host.onCompositionUpdate(this.text.value);else{var c=this.text.value;this.sendText(c),this.inComposition.markerRange&&(this.inComposition.context&&(this.inComposition.markerRange.start.column=this.inComposition.selectionStart=this.inComposition.context.compositionStartOffset),this.inComposition.markerRange.end.column=this.inComposition.markerRange.start.column+this.lastSelectionEnd-this.inComposition.selectionStart+this.lastRestoreEnd)}}},v.prototype.onCompositionEnd=function(c){!this.host.onCompositionEnd||this.host.$readOnly||(this.inComposition=!1,this.host.onCompositionEnd(),this.host.off("mousedown",this.cancelComposition),c&&this.onInput())},v.prototype.onCut=function(c){this.doCopy(c,!0)},v.prototype.onCopy=function(c){this.doCopy(c,!1)},v.prototype.onPaste=function(c){var y=this.handleClipboardData(c);e.pasteCancelled()||(typeof y=="string"?(y&&this.host.onPaste(y,c),p.isIE&&setTimeout(this.resetSelection),h.preventDefault(c)):(this.text.value="",this.pasted=!0))},v.prototype.doCopy=function(c,y){var L=this,w=this.host.getCopyText();if(!w)return h.preventDefault(c);this.handleClipboardData(c,w)?(u&&(this.resetSelection(w),this.copied=w,setTimeout(function(){L.copied=!1},10)),y?this.host.onCut():this.host.onCopy(),h.preventDefault(c)):(this.copied=!0,this.text.value=w,this.text.select(),setTimeout(function(){L.copied=!1,L.resetSelection(),y?L.host.onCut():L.host.onCopy()}))},v.prototype.handleClipboardData=function(c,y,L){var w=c.clipboardData||window.clipboardData;if(!(!w||t)){var x=i||L?"Text":"text/plain";try{return y?w.setData(x,y)!==!1:w.getData(x)}catch(T){if(!L)return this.handleClipboardData(T,y,!0)}}},v.prototype.onInput=function(c){if(this.inComposition)return this.onCompositionUpdate();if(c&&c.inputType){if(c.inputType=="historyUndo")return this.host.execCommand("undo");if(c.inputType=="historyRedo")return this.host.execCommand("redo")}var y=this.text.value,L=this.sendText(y,!0);(y.length>n+100||f.test(L)||_&&this.lastSelectionStart<1&&this.lastSelectionStart==this.lastSelectionEnd)&&this.resetSelection()},v.prototype.sendText=function(c,y){if(this.afterContextMenu&&(this.afterContextMenu=!1),this.pasted)return this.resetSelection(),c&&this.host.onPaste(c),this.pasted=!1,"";for(var L=this.text.selectionStart,w=this.text.selectionEnd,x=this.lastSelectionStart,T=this.lastValue.length-this.lastSelectionEnd,S=c,C=c.length-L,m=c.length-w,g=0;x>0&&this.lastValue[g]==c[g];)g++,x--;for(S=S.slice(g),g=1;T>0&&this.lastValue.length-g>this.lastSelectionStart-1&&this.lastValue[this.lastValue.length-g]==c[c.length-g];)g++,T--;C-=g-1,m-=g-1;var $=S.length-g+1;if($<0&&(x=-$,$=0),S=S.slice(0,$),!y&&!S&&!C&&!x&&!T&&!m)return"";this.sendingText=!0;var k=!1;return p.isAndroid&&S==". "&&(S=" ",k=!0),S&&!x&&!T&&!C&&!m||this.commandMode?this.host.onTextInput(S):this.host.onTextInput(S,{extendLeft:x,extendRight:T,restoreStart:C,restoreEnd:m}),this.sendingText=!1,this.lastValue=c,this.lastSelectionStart=L,this.lastSelectionEnd=w,this.lastRestoreEnd=m,k?`
`:S},v.prototype.onSelect=function(c){var y=this;if(!this.inComposition){var L=function(w){return w.selectionStart===0&&w.selectionEnd>=y.lastValue.length&&w.value===y.lastValue&&y.lastValue&&w.selectionEnd!==y.lastSelectionEnd};this.copied?this.copied=!1:L(this.text)?(this.host.selectAll(),this.resetSelection()):_&&this.text.selectionStart!=this.lastSelectionStart&&this.resetSelection()}},v.prototype.$resetSelectionIOS=function(c){if(!(!this.$isFocused||this.copied&&!c||this.sendingText)){c||(c="");var y=`
ab`+c+`cde fg
`;y!=this.text.value&&(this.text.value=this.lastValue=y);var L=4,w=4+(c.length||(this.host.selection.isEmpty()?0:1));(this.lastSelectionStart!=L||this.lastSelectionEnd!=w)&&this.text.setSelectionRange(L,w),this.lastSelectionStart=L,this.lastSelectionEnd=w}},v.prototype.$resetSelection=function(){var c=this;if(!(this.inComposition||this.sendingText)&&!(!this.$isFocused&&!this.afterContextMenu)){this.inComposition=!0;var y=0,L=0,w="",x=function(I,O){for(var P=O,j=1;j<=I-c.rowStart&&j<2*c.numberOfExtraLines+1;j++)P+=c.host.session.getLine(I-j).length+1;return P};if(this.host.session){var T=this.host.selection,S=T.getRange(),C=T.cursor.row;C===this.rowEnd+1?(this.rowStart=this.rowEnd+1,this.rowEnd=this.rowStart+2*this.numberOfExtraLines):C===this.rowStart-1?(this.rowEnd=this.rowStart-1,this.rowStart=this.rowEnd-2*this.numberOfExtraLines):(C<this.rowStart-1||C>this.rowEnd+1)&&(this.rowStart=C>this.numberOfExtraLines?C-this.numberOfExtraLines:0,this.rowEnd=C>this.numberOfExtraLines?C+this.numberOfExtraLines:2*this.numberOfExtraLines);for(var m=[],g=this.rowStart;g<=this.rowEnd;g++)m.push(this.host.session.getLine(g));if(w=m.join(`
`),y=x(S.start.row,S.start.column),L=x(S.end.row,S.end.column),S.start.row<this.rowStart){var $=this.host.session.getLine(this.rowStart-1);y=S.start.row<this.rowStart-1?0:y,L+=$.length+1,w=$+`
`+w}else if(S.end.row>this.rowEnd){var k=this.host.session.getLine(this.rowEnd+1);L=S.end.row>this.rowEnd+1?k.length:S.end.column,L+=w.length+1,w=w+`
`+k}else _&&C>0&&(w=`
`+w,L+=1,y+=1);w.length>n&&(y<n&&L<n?w=w.slice(0,n):(w=`
`,y==L?y=L=0:(y=0,L=1)));var R=w+`
`;R!=this.lastValue&&(this.text.value=this.lastValue=R,this.lastSelectionStart=this.lastSelectionEnd=R.length)}if(this.afterContextMenu&&(this.lastSelectionStart=this.text.selectionStart,this.lastSelectionEnd=this.text.selectionEnd),this.lastSelectionEnd!=L||this.lastSelectionStart!=y||this.text.selectionEnd!=this.lastSelectionEnd)try{this.text.setSelectionRange(y,L),this.lastSelectionStart=y,this.lastSelectionEnd=L}catch{}this.inComposition=!1}