(window.console_bundle_jsonpfunction=window.console_bundle_jsonpfunction||[]).push([[1],Array(32).concat([function(e,t,n){e.exports=n(10)(1801)},function(e,t,n){"use strict";var r=n(54);e.exports={EOL:r.EOL||"\n",tryParseNumber:function(e,t){var n,r,o="",i=0,s=!0,a=0;function c(){return r=e.charAt(a),a++,r}for(c(),"-"===r&&(o="-",c());r>="0"&&r<="9";)s&&("0"==r?i++:s=!1),o+=r,c();if(s&&i--,"."===r)for(o+=".";c()&&r>="0"&&r<="9";)o+=r;if("e"===r||"E"===r)for(o+=r,c(),"-"!==r&&"+"!==r||(o+=r,c());r>="0"&&r<="9";)o+=r,c();for(;r&&r<=" ";)c();return t&&(","!==r&&"}"!==r&&"]"!==r&&"#"!==r&&("/"!==r||"/"!==e[a]&&"*"!==e[a])||(r=0)),n=+o,r||i||!isFinite(n)?void 0:n},createComment:function(e,t){return Object.defineProperty&&Object.defineProperty(e,"__COMMENTS__",{enumerable:!1,writable:!0}),e.__COMMENTS__=t||{}},removeComment:function(e){Object.defineProperty(e,"__COMMENTS__",{value:void 0})},getComment:function(e){return e.__COMMENTS__},forceComment:function(e){if(!e)return"";var t,n,r,o,i=e.split("\n");for(r=0;r" "){i[r]="# "+t;break}}return i.join("\n")}}},function(e,t,n){ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(e,t,n){"use strict";var r=e("../lib/oop"),o=e("./text_highlight_rules").TextHighlightRules,i=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};r.inherits(i,o),t.JsonHighlightRules=i})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var r=e("../range").Range,o=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var o=n[1].length,i=e.findMatchingBracket({row:t,column:o});if(!i||i.row==t)return 0;var s=this.$getIndent(e.getLine(i.row));e.replace(new r(t,0,t,o-1),s)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(o.prototype),t.MatchingBraceOutdent=o})),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],(function(e,t,n){"use strict";var r=e("../../lib/oop"),o=e("../../range").Range,i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(s,i),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var o=this._getFoldWidgetBase(e,t,n);return!o&&this.startRegionRe.test(r)?"start":o},this.getFoldWidgetRange=function(e,t,n,r){var o,i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);if(o=i.match(this.foldingStartMarker)){var s=o.index;if(o[1])return this.openingBracketBlock(e,o[1],n,s);var a=e.getCommentFoldRange(n,s+o[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(o=i.match(this.foldingStopMarker))?(s=o.index+o[0].length,o[1]?this.closingBracketBlock(e,o[1],n,s):e.getCommentFoldRange(n,s,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),i=t,s=n.length,a=t+=1,c=e.getLength();++tl)break;var u=this.getFoldWidgetRange(e,"all",t);if(u){if(u.start.row<=i)break;if(u.isMultiLine())t=u.end.row;else if(r==l)break}a=t}}return new o(i,s,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),i=e.getLength(),s=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,c=1;++ns)return new o(s,r,n,t.length)}}.call(s.prototype)})),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"],(function(e,t,r){"use strict";var o=e("../lib/oop"),i=e("./text").Mode,s=e("./json_highlight_rules").JsonHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,c=e("./behaviour/cstyle").CstyleBehaviour,l=e("./folding/cstyle").FoldMode,u=e("../worker/worker_client").WorkerClient,p=function(){this.HighlightRules=s,this.$outdent=new a,this.$behaviour=new c,this.foldingRules=new l};o.inherits(p,i),function(){this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);return"start"==e&&t.match(/^.*[\{\(\[]\s*$/)&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new u(["ace"],n(45),"JsonWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",(function(t){e.setAnnotations(t.data)})),t.on("terminate",(function(){e.clearAnnotations()})),t},this.$id="ace/mode/json"}.call(p.prototype),t.Mode=p}))},function(e,t,n){"use strict";function r(e,t){if(e)for(var n=0;ne.autoIndent()),500,{leading:!0,trailing:!0}),s=e.getCoreEditor();s.registerKeyboardShortcut({keys:{win:"Ctrl-Enter",mac:"Command-Enter"},name:o.SEND_TO_ELASTICSEARCH,fn:()=>{t()}}),s.registerKeyboardShortcut({name:o.OPEN_DOCUMENTATION,keys:{win:"Ctrl-/",mac:"Command-/"},fn:()=>{n()}}),s.registerKeyboardShortcut({name:o.AUTO_INDENT_REQUEST,keys:{win:"Ctrl-I",mac:"Command-I"},fn:()=>{i()}}),s.registerKeyboardShortcut({name:o.MOVE_TO_PREVIOUS_REQUEST,keys:{win:"Ctrl-Up",mac:"Command-Up"},fn:()=>{e.moveToPreviousRequestEdge()}}),s.registerKeyboardShortcut({name:o.MOVE_TO_NEXT_REQUEST,keys:{win:"Ctrl-Down",mac:"Command-Down"},fn:()=>{e.moveToNextRequestEdge(!1)}}),s.registerKeyboardShortcut({name:o.GO_TO_LINE,keys:{win:"Ctrl-L",mac:"Command-L"},fn:e=>{var t;const n=parseInt(null!==(t=prompt("Enter line number"))&&void 0!==t?t:"",10);isNaN(n)||e.gotoLine(n)}})}function s(e){const t=e.getCoreEditor();Object.values(o).forEach((e=>{t.unregisterKeyboardShortcut(e)}))}},function(e,t,n){e.exports.VectorTile=n(59),e.exports.VectorTileFeature=n(43),e.exports.VectorTileLayer=n(42)},function(e,t,n){"use strict";var r=n(43);function o(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(i,this,t),this.length=this._features.length}function i(e,t,n){15===e?t.version=n.readVarint():1===e?t.name=n.readString():5===e?t.extent=n.readVarint():2===e?t._features.push(n.pos):3===e?t._keys.push(n.readString()):4===e&&t._values.push(function(e){for(var t=null,n=e.readVarint()+e.pos;e.pos>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}(n))}e.exports=o,o.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new r(this._pbf,t,this.extent,this._keys,this._values)}},function(e,t,n){"use strict";var r=n(60);function o(e,t,n,r,o){this.properties={},this.extent=n,this.type=0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=o,e.readFields(i,this,t)}function i(e,t,n){1==e?t.id=n.readVarint():2==e?function(e,t){for(var n=e.readVarint()+e.pos;e.pos>3}if(i--,1===o||2===o)s+=e.readSVarint(),a+=e.readSVarint(),1===o&&(t&&c.push(t),t=[]),t.push(new r(s,a));else{if(7!==o)throw new Error("unknown command "+o);t&&t.push(t[0].clone())}}return t&&c.push(t),c},o.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,n=1,r=0,o=0,i=0,s=1/0,a=-1/0,c=1/0,l=-1/0;e.pos>3}if(r--,1===n||2===n)(o+=e.readSVarint())a&&(a=o),(i+=e.readSVarint())l&&(l=i);else if(7!==n)throw new Error("unknown command "+n)}return[s,c,a,l]},o.prototype.toGeoJSON=function(e,t,n){var r,i,a=this.extent*Math.pow(2,n),c=this.extent*e,l=this.extent*t,u=this.loadGeometry(),p=o.types[this.type];function d(e){for(var t=0;t1?t-1:0),r=1;r3?t.t-4:t.t:Array.isArray(e)?1:p(e)?2:d(e)?3:0}function a(e,t){return 2===s(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){return 2===s(e)?e.get(t):e[t]}function l(e,t,n){var r=s(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function u(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e){return V&&e instanceof Map}function d(e){return H&&e instanceof Set}function h(e){return e.i||e.u}function f(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Y(e);delete t[K];for(var n=X(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=g),Object.freeze(e),t&&i(e,(function(e,t){return m(t,!0)}),!0)),e}function g(){n(2)}function b(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function w(e){var t=Z[e];return t||n(18,e),t}function y(e,t){Z[e]||(Z[e]=t)}function v(){return B}function x(e,t){t&&(w("Patches"),e.o=[],e.v=[],e.s=t)}function j(e){_(e),e.p.forEach(E),e.p=null}function _(e){e===B&&(B=e.l)}function O(e){return B={p:[],l:B,h:e,_:!0,m:0}}function E(e){var t=e[K];0===t.t||1===t.t?t.j():t.O=!0}function k(e,t){t.m=t.p.length;var r=t.p[0],i=void 0!==e&&e!==r;return t.h.S||w("ES5").P(t,e,i),i?(r[K].M&&(j(t),n(4)),o(e)&&(e=R(t,e),t.l||T(t,e)),t.o&&w("Patches").g(r[K].u,e,t.o,t.v)):e=R(t,r,[]),j(t),t.o&&t.s(t.o,t.v),e!==W?e:void 0}function R(e,t,n){if(b(t))return t;var r=t[K];if(!r)return i(t,(function(o,i){return S(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.M)return T(e,r.u,!0),r.u;if(!r.R){r.R=!0,r.A.m--;var o=4===r.t||5===r.t?r.i=f(r.k):r.i;i(3===r.t?new Set(o):o,(function(t,i){return S(e,r,o,t,i,n)})),T(e,o,!1),n&&e.o&&w("Patches").F(r,n,e.o,e.v)}return r.i}function S(e,t,n,i,s,c){if(r(s)){var u=R(e,s,c&&t&&3!==t.t&&!a(t.D,i)?c.concat(i):void 0);if(l(n,i,u),!r(u))return;e._=!1}if(o(s)&&!b(s)){if(!e.h.K&&e.m<1)return;R(e,s),t&&t.A.l||T(e,s)}}function T(e,t,n){void 0===n&&(n=!1),e.h.K&&e._&&m(t,n)}function C(e,t){var n=e[K];return(n?h(n):e)[t]}function A(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function P(e){e.M||(e.M=!0,e.l&&P(e.l))}function L(e){e.i||(e.i=f(e.u))}function N(e,t,n){var r=p(t)?w("MapSet").$(t,n):d(t)?w("MapSet").C(t,n):e.S?function(e,t){var n=Array.isArray(e),r={t:n?1:0,A:t?t.A:v(),M:!1,R:!1,D:{},l:t,u:e,k:null,i:null,j:null,I:!1},o=r,i=ee;n&&(o=[r],i=te);var s=Proxy.revocable(o,i),a=s.revoke,c=s.proxy;return r.k=c,r.j=a,c}(t,n):w("ES5").J(t,n);return(n?n.A:v()).p.push(r),r}function M(e){return r(e)||n(22,e),function e(t){if(!o(t))return t;var n,r=t[K],a=s(t);if(r){if(!r.M&&(r.t<4||!w("ES5").N(r)))return r.u;r.R=!0,n=I(t,a),r.R=!1}else n=I(t,a);return i(n,(function(t,o){r&&c(r.u,t)===o||l(n,t,e(o))})),3===a?new Set(n):n}(e)}function I(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return f(e)}function q(){function e(e,t){var n=s[e];return n?n.enumerable=t:s[e]=n={configurable:!0,enumerable:t,get:function(){return ee.get(this[K],e)},set:function(t){ee.set(this[K],e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var r=e[t][K];if(!r.M)switch(r.t){case 5:o(r)&&P(r);break;case 4:n(r)&&P(r)}}}function n(e){for(var t=e.u,n=e.k,r=X(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==K){var s=t[i];if(void 0===s&&!a(t,i))return!0;var c=n[i],l=c&&c[K];if(l?l.u!==s:!u(c,s))return!0}}var p=!!t[K];return r.length!==X(t).length+(p?0:1)}function o(e){var t=e.k;if(t.length!==e.u.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r1?n-1:0),i=1;i1?r-1:0),i=1;i=0;n--){var o=t[n];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}n>-1&&(t=t.slice(n+1));var i=w("Patches").W;return r(e)?i(e,t):this.produce(e,(function(e){return i(e,t)}))},e}(),re=new ne,oe=re.produce,ie=re.produceWithPatches.bind(re),se=re.setAutoFreeze.bind(re),ae=re.setUseProxies.bind(re),ce=re.applyPatches.bind(re),le=re.createDraft.bind(re),ue=re.finishDraft.bind(re);t.Immer=ne,t.applyPatches=ce,t.castDraft=function(e){return e},t.castImmutable=function(e){return e},t.createDraft=le,t.current=M,t.default=oe,t.enableAllPlugins=function(){q(),F(),D()},t.enableES5=q,t.enableMapSet=F,t.enablePatches=D,t.finishDraft=ue,t.freeze=m,t.immerable=G,t.isDraft=r,t.isDraftable=o,t.nothing=W,t.original=function(e){return r(e)||n(23,e),e[K].u},t.produce=oe,t.produceWithPatches=ie,t.setAutoFreeze=se,t.setUseProxies=ae},function(e,t){e.exports.id="ace/mode/json_worker",e.exports.src='"no use strict";!function(window){function resolveModuleId(id,paths){for(var testPath=id,tail="";testPath;){var alias=paths[testPath];if("string"==typeof alias)return alias+tail;if(alias)return alias.location.replace(/\\/*$/,"/")+(tail||alias.main||alias.name);if(alias===!1)return"";var i=testPath.lastIndexOf("/");if(-1===i)break;tail=testPath.substr(i)+tail,testPath=testPath.slice(0,i)}return id}if(!(void 0!==window.window&&window.document||window.acequire&&window.define)){window.console||(window.console=function(){var msgs=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:msgs})},window.console.error=window.console.warn=window.console.log=window.console.trace=window.console),window.window=window,window.ace=window,window.onerror=function(message,file,line,col,err){postMessage({type:"error",data:{message:message,data:err.data,file:file,line:line,col:col,stack:err.stack}})},window.normalizeModule=function(parentId,moduleName){if(-1!==moduleName.indexOf("!")){var chunks=moduleName.split("!");return window.normalizeModule(parentId,chunks[0])+"!"+window.normalizeModule(parentId,chunks[1])}if("."==moduleName.charAt(0)){var base=parentId.split("/").slice(0,-1).join("/");for(moduleName=(base?base+"/":"")+moduleName;-1!==moduleName.indexOf(".")&&previous!=moduleName;){var previous=moduleName;moduleName=moduleName.replace(/^\\.\\//,"").replace(/\\/\\.\\//,"/").replace(/[^\\/]+\\/\\.\\.\\//,"")}}return moduleName},window.acequire=function acequire(parentId,id){if(id||(id=parentId,parentId=null),!id.charAt)throw Error("worker.js acequire() accepts only (parentId, id) as arguments");id=window.normalizeModule(parentId,id);var module=window.acequire.modules[id];if(module)return module.initialized||(module.initialized=!0,module.exports=module.factory().exports),module.exports;if(!window.acequire.tlns)return console.log("unable to load "+id);var path=resolveModuleId(id,window.acequire.tlns);return".js"!=path.slice(-3)&&(path+=".js"),window.acequire.id=id,window.acequire.modules[id]={},importScripts(path),window.acequire(parentId,id)},window.acequire.modules={},window.acequire.tlns={},window.define=function(id,deps,factory){if(2==arguments.length?(factory=deps,"string"!=typeof id&&(deps=id,id=window.acequire.id)):1==arguments.length&&(factory=id,deps=[],id=window.acequire.id),"function"!=typeof factory)return window.acequire.modules[id]={exports:factory,initialized:!0},void 0;deps.length||(deps=["require","exports","module"]);var req=function(childId){return window.acequire(id,childId)};window.acequire.modules[id]={exports:{},factory:function(){var module=this,returnExports=factory.apply(this,deps.map(function(dep){switch(dep){case"require":return req;case"exports":return module.exports;case"module":return module;default:return req(dep)}}));return returnExports&&(module.exports=returnExports),module}}},window.define.amd={},acequire.tlns={},window.initBaseUrls=function(topLevelNamespaces){for(var i in topLevelNamespaces)acequire.tlns[i]=topLevelNamespaces[i]},window.initSender=function(){var EventEmitter=window.acequire("ace/lib/event_emitter").EventEmitter,oop=window.acequire("ace/lib/oop"),Sender=function(){};return function(){oop.implement(this,EventEmitter),this.callback=function(data,callbackId){postMessage({type:"call",id:callbackId,data:data})},this.emit=function(name,data){postMessage({type:"event",name:name,data:data})}}.call(Sender.prototype),new Sender};var main=window.main=null,sender=window.sender=null;window.onmessage=function(e){var msg=e.data;if(msg.event&&sender)sender._signal(msg.event,msg.data);else if(msg.command)if(main[msg.command])main[msg.command].apply(main,msg.args);else{if(!window[msg.command])throw Error("Unknown command:"+msg.command);window[msg.command].apply(window,msg.args)}else if(msg.init){window.initBaseUrls(msg.tlns),acequire("ace/lib/es5-shim"),sender=window.sender=window.initSender();var clazz=acequire(msg.module)[msg.classname];main=window.main=new clazz(sender)}}}}(this),ace.define("ace/lib/oop",["require","exports","module"],function(acequire,exports){"use strict";exports.inherits=function(ctor,superCtor){ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}})},exports.mixin=function(obj,mixin){for(var key in mixin)obj[key]=mixin[key];return obj},exports.implement=function(proto,mixin){exports.mixin(proto,mixin)}}),ace.define("ace/range",["require","exports","module"],function(acequire,exports){"use strict";var comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},Range=function(startRow,startColumn,endRow,endColumn){this.start={row:startRow,column:startColumn},this.end={row:endRow,column:endColumn}};(function(){this.isEqual=function(range){return this.start.row===range.start.row&&this.end.row===range.end.row&&this.start.column===range.start.column&&this.end.column===range.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(row,column){return 0==this.compare(row,column)},this.compareRange=function(range){var cmp,end=range.end,start=range.start;return cmp=this.compare(end.row,end.column),1==cmp?(cmp=this.compare(start.row,start.column),1==cmp?2:0==cmp?1:0):-1==cmp?-2:(cmp=this.compare(start.row,start.column),-1==cmp?-1:1==cmp?42:0)},this.comparePoint=function(p){return this.compare(p.row,p.column)},this.containsRange=function(range){return 0==this.comparePoint(range.start)&&0==this.comparePoint(range.end)},this.intersects=function(range){var cmp=this.compareRange(range);return-1==cmp||0==cmp||1==cmp},this.isEnd=function(row,column){return this.end.row==row&&this.end.column==column},this.isStart=function(row,column){return this.start.row==row&&this.start.column==column},this.setStart=function(row,column){"object"==typeof row?(this.start.column=row.column,this.start.row=row.row):(this.start.row=row,this.start.column=column)},this.setEnd=function(row,column){"object"==typeof row?(this.end.column=row.column,this.end.row=row.row):(this.end.row=row,this.end.column=column)},this.inside=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)||this.isStart(row,column)?!1:!0:!1},this.insideStart=function(row,column){return 0==this.compare(row,column)?this.isEnd(row,column)?!1:!0:!1},this.insideEnd=function(row,column){return 0==this.compare(row,column)?this.isStart(row,column)?!1:!0:!1},this.compare=function(row,column){return this.isMultiLine()||row!==this.start.row?this.start.row>row?-1:row>this.end.row?1:this.start.row===row?column>=this.start.column?0:-1:this.end.row===row?this.end.column>=column?0:1:0:this.start.column>column?-1:column>this.end.column?1:0},this.compareStart=function(row,column){return this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.compareEnd=function(row,column){return this.end.row==row&&this.end.column==column?1:this.compare(row,column)},this.compareInside=function(row,column){return this.end.row==row&&this.end.column==column?1:this.start.row==row&&this.start.column==column?-1:this.compare(row,column)},this.clipRows=function(firstRow,lastRow){if(this.end.row>lastRow)var end={row:lastRow+1,column:0};else if(firstRow>this.end.row)var end={row:firstRow,column:0};if(this.start.row>lastRow)var start={row:lastRow+1,column:0};else if(firstRow>this.start.row)var start={row:firstRow,column:0};return Range.fromPoints(start||this.start,end||this.end)},this.extend=function(row,column){var cmp=this.compare(row,column);if(0==cmp)return this;if(-1==cmp)var start={row:row,column:column};else var end={row:row,column:column};return Range.fromPoints(start||this.start,end||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return Range.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new Range(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new Range(this.start.row,0,this.end.row,0)},this.toScreenRange=function(session){var screenPosStart=session.documentToScreenPosition(this.start),screenPosEnd=session.documentToScreenPosition(this.end);return new Range(screenPosStart.row,screenPosStart.column,screenPosEnd.row,screenPosEnd.column)},this.moveBy=function(row,column){this.start.row+=row,this.start.column+=column,this.end.row+=row,this.end.column+=column}}).call(Range.prototype),Range.fromPoints=function(start,end){return new Range(start.row,start.column,end.row,end.column)},Range.comparePoints=comparePoints,Range.comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column},exports.Range=Range}),ace.define("ace/apply_delta",["require","exports","module"],function(acequire,exports){"use strict";exports.applyDelta=function(docLines,delta){var row=delta.start.row,startColumn=delta.start.column,line=docLines[row]||"";switch(delta.action){case"insert":var lines=delta.lines;if(1===lines.length)docLines[row]=line.substring(0,startColumn)+delta.lines[0]+line.substring(startColumn);else{var args=[row,1].concat(delta.lines);docLines.splice.apply(docLines,args),docLines[row]=line.substring(0,startColumn)+docLines[row],docLines[row+delta.lines.length-1]+=line.substring(startColumn)}break;case"remove":var endColumn=delta.end.column,endRow=delta.end.row;row===endRow?docLines[row]=line.substring(0,startColumn)+line.substring(endColumn):docLines.splice(row,endRow-row+1,line.substring(0,startColumn)+docLines[endRow].substring(endColumn))}}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(acequire,exports){"use strict";var EventEmitter={},stopPropagation=function(){this.propagationStopped=!0},preventDefault=function(){this.defaultPrevented=!0};EventEmitter._emit=EventEmitter._dispatchEvent=function(eventName,e){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var listeners=this._eventRegistry[eventName]||[],defaultHandler=this._defaultHandlers[eventName];if(listeners.length||defaultHandler){"object"==typeof e&&e||(e={}),e.type||(e.type=eventName),e.stopPropagation||(e.stopPropagation=stopPropagation),e.preventDefault||(e.preventDefault=preventDefault),listeners=listeners.slice();for(var i=0;listeners.length>i&&(listeners[i](e,this),!e.propagationStopped);i++);return defaultHandler&&!e.defaultPrevented?defaultHandler(e,this):void 0}},EventEmitter._signal=function(eventName,e){var listeners=(this._eventRegistry||{})[eventName];if(listeners){listeners=listeners.slice();for(var i=0;listeners.length>i;i++)listeners[i](e,this)}},EventEmitter.once=function(eventName,callback){var _self=this;callback&&this.addEventListener(eventName,function newCallback(){_self.removeEventListener(eventName,newCallback),callback.apply(null,arguments)})},EventEmitter.setDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers||(handlers=this._defaultHandlers={_disabled_:{}}),handlers[eventName]){var old=handlers[eventName],disabled=handlers._disabled_[eventName];disabled||(handlers._disabled_[eventName]=disabled=[]),disabled.push(old);var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}handlers[eventName]=callback},EventEmitter.removeDefaultHandler=function(eventName,callback){var handlers=this._defaultHandlers;if(handlers){var disabled=handlers._disabled_[eventName];if(handlers[eventName]==callback)handlers[eventName],disabled&&this.setDefaultHandler(eventName,disabled.pop());else if(disabled){var i=disabled.indexOf(callback);-1!=i&&disabled.splice(i,1)}}},EventEmitter.on=EventEmitter.addEventListener=function(eventName,callback,capturing){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];return listeners||(listeners=this._eventRegistry[eventName]=[]),-1==listeners.indexOf(callback)&&listeners[capturing?"unshift":"push"](callback),callback},EventEmitter.off=EventEmitter.removeListener=EventEmitter.removeEventListener=function(eventName,callback){this._eventRegistry=this._eventRegistry||{};var listeners=this._eventRegistry[eventName];if(listeners){var index=listeners.indexOf(callback);-1!==index&&listeners.splice(index,1)}},EventEmitter.removeAllListeners=function(eventName){this._eventRegistry&&(this._eventRegistry[eventName]=[])},exports.EventEmitter=EventEmitter}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(acequire,exports){"use strict";var oop=acequire("./lib/oop"),EventEmitter=acequire("./lib/event_emitter").EventEmitter,Anchor=exports.Anchor=function(doc,row,column){this.$onChange=this.onChange.bind(this),this.attach(doc),column===void 0?this.setPosition(row.row,row.column):this.setPosition(row,column)};(function(){function $pointsInOrder(point1,point2,equalPointsInOrder){var bColIsAfter=equalPointsInOrder?point1.column<=point2.column:point1.columnthis.row)){var point=$getTransformedPoint(delta,{row:this.row,column:this.column},this.$insertRight);this.setPosition(point.row,point.column,!0)}},this.setPosition=function(row,column,noClip){var pos;if(pos=noClip?{row:row,column:column}:this.$clipPositionToDocument(row,column),this.row!=pos.row||this.column!=pos.column){var old={row:this.row,column:this.column};this.row=pos.row,this.column=pos.column,this._signal("change",{old:old,value:pos})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(doc){this.document=doc||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(row,column){var pos={};return row>=this.document.getLength()?(pos.row=Math.max(0,this.document.getLength()-1),pos.column=this.document.getLine(pos.row).length):0>row?(pos.row=0,pos.column=0):(pos.row=row,pos.column=Math.min(this.document.getLine(pos.row).length,Math.max(0,column))),0>column&&(pos.column=0),pos}}).call(Anchor.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(acequire,exports){"use strict";var oop=acequire("./lib/oop"),applyDelta=acequire("./apply_delta").applyDelta,EventEmitter=acequire("./lib/event_emitter").EventEmitter,Range=acequire("./range").Range,Anchor=acequire("./anchor").Anchor,Document=function(textOrLines){this.$lines=[""],0===textOrLines.length?this.$lines=[""]:Array.isArray(textOrLines)?this.insertMergedLines({row:0,column:0},textOrLines):this.insert({row:0,column:0},textOrLines)};(function(){oop.implement(this,EventEmitter),this.setValue=function(text){var len=this.getLength()-1;this.remove(new Range(0,0,len,this.getLine(len).length)),this.insert({row:0,column:0},text)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(row,column){return new Anchor(this,row,column)},this.$split=0==="aaa".split(/a/).length?function(text){return text.replace(/\\r\\n|\\r/g,"\\n").split("\\n")}:function(text){return text.split(/\\r\\n|\\r|\\n/)},this.$detectNewLine=function(text){var match=text.match(/^.*?(\\r\\n|\\r|\\n)/m);this.$autoNewLine=match?match[1]:"\\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\\r\\n";case"unix":return"\\n";default:return this.$autoNewLine||"\\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(newLineMode){this.$newLineMode!==newLineMode&&(this.$newLineMode=newLineMode,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(text){return"\\r\\n"==text||"\\r"==text||"\\n"==text},this.getLine=function(row){return this.$lines[row]||""},this.getLines=function(firstRow,lastRow){return this.$lines.slice(firstRow,lastRow+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(range){return this.getLinesForRange(range).join(this.getNewLineCharacter())},this.getLinesForRange=function(range){var lines;if(range.start.row===range.end.row)lines=[this.getLine(range.start.row).substring(range.start.column,range.end.column)];else{lines=this.getLines(range.start.row,range.end.row),lines[0]=(lines[0]||"").substring(range.start.column);var l=lines.length-1;range.end.row-range.start.row==l&&(lines[l]=lines[l].substring(0,range.end.column))}return lines},this.insertLines=function(row,lines){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(row,lines)},this.removeLines=function(firstRow,lastRow){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(firstRow,lastRow)},this.insertNewLine=function(position){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, [\'\', \'\']) instead."),this.insertMergedLines(position,["",""])},this.insert=function(position,text){return 1>=this.getLength()&&this.$detectNewLine(text),this.insertMergedLines(position,this.$split(text))},this.insertInLine=function(position,text){var start=this.clippedPos(position.row,position.column),end=this.pos(position.row,position.column+text.length);return this.applyDelta({start:start,end:end,action:"insert",lines:[text]},!0),this.clonePos(end)},this.clippedPos=function(row,column){var length=this.getLength();void 0===row?row=length:0>row?row=0:row>=length&&(row=length-1,column=void 0);var line=this.getLine(row);return void 0==column&&(column=line.length),column=Math.min(Math.max(column,0),line.length),{row:row,column:column}},this.clonePos=function(pos){return{row:pos.row,column:pos.column}},this.pos=function(row,column){return{row:row,column:column}},this.$clipPosition=function(position){var length=this.getLength();return position.row>=length?(position.row=Math.max(0,length-1),position.column=this.getLine(length-1).length):(position.row=Math.max(0,position.row),position.column=Math.min(Math.max(position.column,0),this.getLine(position.row).length)),position},this.insertFullLines=function(row,lines){row=Math.min(Math.max(row,0),this.getLength());var column=0;this.getLength()>row?(lines=lines.concat([""]),column=0):(lines=[""].concat(lines),row--,column=this.$lines[row].length),this.insertMergedLines({row:row,column:column},lines)},this.insertMergedLines=function(position,lines){var start=this.clippedPos(position.row,position.column),end={row:start.row+lines.length-1,column:(1==lines.length?start.column:0)+lines[lines.length-1].length};return this.applyDelta({start:start,end:end,action:"insert",lines:lines}),this.clonePos(end)},this.remove=function(range){var start=this.clippedPos(range.start.row,range.start.column),end=this.clippedPos(range.end.row,range.end.column);return this.applyDelta({start:start,end:end,action:"remove",lines:this.getLinesForRange({start:start,end:end})}),this.clonePos(start)},this.removeInLine=function(row,startColumn,endColumn){var start=this.clippedPos(row,startColumn),end=this.clippedPos(row,endColumn);return this.applyDelta({start:start,end:end,action:"remove",lines:this.getLinesForRange({start:start,end:end})},!0),this.clonePos(start)},this.removeFullLines=function(firstRow,lastRow){firstRow=Math.min(Math.max(0,firstRow),this.getLength()-1),lastRow=Math.min(Math.max(0,lastRow),this.getLength()-1);var deleteFirstNewLine=lastRow==this.getLength()-1&&firstRow>0,deleteLastNewLine=this.getLength()-1>lastRow,startRow=deleteFirstNewLine?firstRow-1:firstRow,startCol=deleteFirstNewLine?this.getLine(startRow).length:0,endRow=deleteLastNewLine?lastRow+1:lastRow,endCol=deleteLastNewLine?0:this.getLine(endRow).length,range=new Range(startRow,startCol,endRow,endCol),deletedLines=this.$lines.slice(firstRow,lastRow+1);return this.applyDelta({start:range.start,end:range.end,action:"remove",lines:this.getLinesForRange(range)}),deletedLines},this.removeNewLine=function(row){this.getLength()-1>row&&row>=0&&this.applyDelta({start:this.pos(row,this.getLine(row).length),end:this.pos(row+1,0),action:"remove",lines:["",""]})},this.replace=function(range,text){if(range instanceof Range||(range=Range.fromPoints(range.start,range.end)),0===text.length&&range.isEmpty())return range.start;if(text==this.getTextRange(range))return range.end;this.remove(range);var end;return end=text?this.insert(range.start,text):range.start},this.applyDeltas=function(deltas){for(var i=0;deltas.length>i;i++)this.applyDelta(deltas[i])},this.revertDeltas=function(deltas){for(var i=deltas.length-1;i>=0;i--)this.revertDelta(deltas[i])},this.applyDelta=function(delta,doNotValidate){var isInsert="insert"==delta.action;(isInsert?1>=delta.lines.length&&!delta.lines[0]:!Range.comparePoints(delta.start,delta.end))||(isInsert&&delta.lines.length>2e4&&this.$splitAndapplyLargeDelta(delta,2e4),applyDelta(this.$lines,delta,doNotValidate),this._signal("change",delta))},this.$splitAndapplyLargeDelta=function(delta,MAX){for(var lines=delta.lines,l=lines.length,row=delta.start.row,column=delta.start.column,from=0,to=0;;){from=to,to+=MAX-1;var chunk=lines.slice(from,to);if(to>l){delta.lines=chunk,delta.start.row=row+from,delta.start.column=column;break}chunk.push(""),this.applyDelta({start:this.pos(row+from,column),end:this.pos(row+to,column=0),action:delta.action,lines:chunk},!0)}},this.revertDelta=function(delta){this.applyDelta({start:this.clonePos(delta.start),end:this.clonePos(delta.end),action:"insert"==delta.action?"remove":"insert",lines:delta.lines.slice()})},this.indexToPosition=function(index,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,i=startRow||0,l=lines.length;l>i;i++)if(index-=lines[i].length+newlineLength,0>index)return{row:i,column:index+lines[i].length+newlineLength};return{row:l-1,column:lines[l-1].length}},this.positionToIndex=function(pos,startRow){for(var lines=this.$lines||this.getAllLines(),newlineLength=this.getNewLineCharacter().length,index=0,row=Math.min(pos.row,lines.length),i=startRow||0;row>i;++i)index+=lines[i].length+newlineLength;return index+pos.column}}).call(Document.prototype),exports.Document=Document}),ace.define("ace/lib/lang",["require","exports","module"],function(acequire,exports){"use strict";exports.last=function(a){return a[a.length-1]},exports.stringReverse=function(string){return string.split("").reverse().join("")},exports.stringRepeat=function(string,count){for(var result="";count>0;)1&count&&(result+=string),(count>>=1)&&(string+=string);return result};var trimBeginRegexp=/^\\s\\s*/,trimEndRegexp=/\\s\\s*$/;exports.stringTrimLeft=function(string){return string.replace(trimBeginRegexp,"")},exports.stringTrimRight=function(string){return string.replace(trimEndRegexp,"")},exports.copyObject=function(obj){var copy={};for(var key in obj)copy[key]=obj[key];return copy},exports.copyArray=function(array){for(var copy=[],i=0,l=array.length;l>i;i++)copy[i]=array[i]&&"object"==typeof array[i]?this.copyObject(array[i]):array[i];return copy},exports.deepCopy=function deepCopy(obj){if("object"!=typeof obj||!obj)return obj;var copy;if(Array.isArray(obj)){copy=[];for(var key=0;obj.length>key;key++)copy[key]=deepCopy(obj[key]);return copy}if("[object Object]"!==Object.prototype.toString.call(obj))return obj;copy={};for(var key in obj)copy[key]=deepCopy(obj[key]);return copy},exports.arrayToMap=function(arr){for(var map={},i=0;arr.length>i;i++)map[arr[i]]=1;return map},exports.createMap=function(props){var map=Object.create(null);for(var i in props)map[i]=props[i];return map},exports.arrayRemove=function(array,value){for(var i=0;array.length>=i;i++)value===array[i]&&array.splice(i,1)},exports.escapeRegExp=function(str){return str.replace(/([.*+?^${}()|[\\]\\/\\\\])/g,"\\\\$1")},exports.escapeHTML=function(str){return str.replace(/&/g,"&").replace(/"/g,""").replace(/\'/g,"'").replace(/i;i+=2){if(Array.isArray(data[i+1]))var d={action:"insert",start:data[i],lines:data[i+1]};else var d={action:"remove",start:data[i],end:data[i+1]};doc.applyDelta(d,!0)}return _self.$timeout?deferredUpdate.schedule(_self.$timeout):(_self.onUpdate(),void 0)})};(function(){this.$timeout=500,this.setTimeout=function(timeout){this.$timeout=timeout},this.setValue=function(value){this.doc.setValue(value),this.deferredUpdate.schedule(this.$timeout)},this.getValue=function(callbackId){this.sender.callback(this.doc.getValue(),callbackId)},this.onUpdate=function(){},this.isPending=function(){return this.deferredUpdate.isPending()}}).call(Mirror.prototype)}),ace.define("ace/mode/json/json_parse",["require","exports","module"],function(){"use strict";var at,ch,text,value,escapee={\'"\':\'"\',"\\\\":"\\\\","/":"/",b:"\\b",f:"\\f",n:"\\n",r:"\\r",t:"\t"},error=function(m){throw{name:"SyntaxError",message:m,at:at,text:text}},next=function(c){return c&&c!==ch&&error("Expected \'"+c+"\' instead of \'"+ch+"\'"),ch=text.charAt(at),at+=1,ch},number=function(){var number,string="";for("-"===ch&&(string="-",next("-"));ch>="0"&&"9">=ch;)string+=ch,next();if("."===ch)for(string+=".";next()&&ch>="0"&&"9">=ch;)string+=ch;if("e"===ch||"E"===ch)for(string+=ch,next(),("-"===ch||"+"===ch)&&(string+=ch,next());ch>="0"&&"9">=ch;)string+=ch,next();return number=+string,isNaN(number)?(error("Bad number"),void 0):number},string=function(){var hex,i,uffff,string="";if(\'"\'===ch)for(;next();){if(\'"\'===ch)return next(),string;if("\\\\"===ch)if(next(),"u"===ch){for(uffff=0,i=0;4>i&&(hex=parseInt(next(),16),isFinite(hex));i+=1)uffff=16*uffff+hex;string+=String.fromCharCode(uffff)}else{if("string"!=typeof escapee[ch])break;string+=escapee[ch]}else string+=ch}error("Bad string")},white=function(){for(;ch&&" ">=ch;)next()},word=function(){switch(ch){case"t":return next("t"),next("r"),next("u"),next("e"),!0;case"f":return next("f"),next("a"),next("l"),next("s"),next("e"),!1;case"n":return next("n"),next("u"),next("l"),next("l"),null}error("Unexpected \'"+ch+"\'")},array=function(){var array=[];if("["===ch){if(next("["),white(),"]"===ch)return next("]"),array;for(;ch;){if(array.push(value()),white(),"]"===ch)return next("]"),array;next(","),white()}}error("Bad array")},object=function(){var key,object={};if("{"===ch){if(next("{"),white(),"}"===ch)return next("}"),object;for(;ch;){if(key=string(),white(),next(":"),Object.hasOwnProperty.call(object,key)&&error(\'Duplicate key "\'+key+\'"\'),object[key]=value(),white(),"}"===ch)return next("}"),object;next(","),white()}}error("Bad object")};return value=function(){switch(white(),ch){case"{":return object();case"[":return array();case\'"\':return string();case"-":return number();default:return ch>="0"&&"9">=ch?number():word()}},function(source,reviver){var result;return text=source,at=0,ch=" ",result=value(),white(),ch&&error("Syntax error"),"function"==typeof reviver?function walk(holder,key){var k,v,value=holder[key];if(value&&"object"==typeof value)for(k in value)Object.hasOwnProperty.call(value,k)&&(v=walk(value,k),void 0!==v?value[k]=v:delete value[k]);return reviver.call(holder,key,value)}({"":result},""):result}}),ace.define("ace/mode/json_worker",["require","exports","module","ace/lib/oop","ace/worker/mirror","ace/mode/json/json_parse"],function(acequire,exports){"use strict";var oop=acequire("../lib/oop"),Mirror=acequire("../worker/mirror").Mirror,parse=acequire("./json/json_parse"),JsonWorker=exports.JsonWorker=function(sender){Mirror.call(this,sender),this.setTimeout(200)};oop.inherits(JsonWorker,Mirror),function(){this.onUpdate=function(){var value=this.doc.getValue(),errors=[];try{value&&parse(value)}catch(e){var pos=this.doc.indexToPosition(e.at-1);errors.push({row:pos.row,column:pos.column,text:e.message,type:"error"})}this.sender.emit("annotate",errors)}}.call(JsonWorker.prototype)}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(){function Empty(){}function doesDefinePropertyWork(object){try{return Object.defineProperty(object,"sentinel",{}),"sentinel"in object}catch(exception){}}function toInteger(n){return n=+n,n!==n?n=0:0!==n&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n))),n}Function.prototype.bind||(Function.prototype.bind=function(that){var target=this;if("function"!=typeof target)throw new TypeError("Function.prototype.bind called on incompatible "+target);var args=slice.call(arguments,1),bound=function(){if(this instanceof bound){var result=target.apply(this,args.concat(slice.call(arguments)));return Object(result)===result?result:this}return target.apply(that,args.concat(slice.call(arguments)))};return target.prototype&&(Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null),bound});var defineGetter,defineSetter,lookupGetter,lookupSetter,supportsAccessors,call=Function.prototype.call,prototypeOfArray=Array.prototype,prototypeOfObject=Object.prototype,slice=prototypeOfArray.slice,_toString=call.bind(prototypeOfObject.toString),owns=call.bind(prototypeOfObject.hasOwnProperty);if((supportsAccessors=owns(prototypeOfObject,"__defineGetter__"))&&(defineGetter=call.bind(prototypeOfObject.__defineGetter__),defineSetter=call.bind(prototypeOfObject.__defineSetter__),lookupGetter=call.bind(prototypeOfObject.__lookupGetter__),lookupSetter=call.bind(prototypeOfObject.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function makeArray(l){var a=Array(l+2);return a[0]=a[1]=0,a}var lengthBefore,array=[];return array.splice.apply(array,makeArray(20)),array.splice.apply(array,makeArray(26)),lengthBefore=array.length,array.splice(5,0,"XXX"),lengthBefore+1==array.length,lengthBefore+1==array.length?!0:void 0\n}()){var array_splice=Array.prototype.splice;Array.prototype.splice=function(start,deleteCount){return arguments.length?array_splice.apply(this,[void 0===start?0:start,void 0===deleteCount?this.length-start:deleteCount].concat(slice.call(arguments,2))):[]}}else Array.prototype.splice=function(pos,removeCount){var length=this.length;pos>0?pos>length&&(pos=length):void 0==pos?pos=0:0>pos&&(pos=Math.max(length+pos,0)),length>pos+removeCount||(removeCount=length-pos);var removed=this.slice(pos,pos+removeCount),insert=slice.call(arguments,2),add=insert.length;if(pos===length)add&&this.push.apply(this,insert);else{var remove=Math.min(removeCount,length-pos),tailOldPos=pos+remove,tailNewPos=tailOldPos+add-remove,tailCount=length-tailOldPos,lengthAfterRemove=length-remove;if(tailOldPos>tailNewPos)for(var i=0;tailCount>i;++i)this[tailNewPos+i]=this[tailOldPos+i];else if(tailNewPos>tailOldPos)for(i=tailCount;i--;)this[tailNewPos+i]=this[tailOldPos+i];if(add&&pos===lengthAfterRemove)this.length=lengthAfterRemove,this.push.apply(this,insert);else for(this.length=lengthAfterRemove+add,i=0;add>i;++i)this[pos+i]=insert[i]}return removed};Array.isArray||(Array.isArray=function(obj){return"[object Array]"==_toString(obj)});var boxedString=Object("a"),splitString="a"!=boxedString[0]||!(0 in boxedString);if(Array.prototype.forEach||(Array.prototype.forEach=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,thisp=arguments[1],i=-1,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError;for(;length>++i;)i in self&&fun.call(thisp,self[i],i,object)}),Array.prototype.map||(Array.prototype.map=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,result=Array(length),thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)i in self&&(result[i]=fun.call(thisp,self[i],i,object));return result}),Array.prototype.filter||(Array.prototype.filter=function(fun){var value,object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,result=[],thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)i in self&&(value=self[i],fun.call(thisp,value,i,object)&&result.push(value));return result}),Array.prototype.every||(Array.prototype.every=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)if(i in self&&!fun.call(thisp,self[i],i,object))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0,thisp=arguments[1];if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");for(var i=0;length>i;i++)if(i in self&&fun.call(thisp,self[i],i,object))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");if(!length&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var result,i=0;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i++];break}if(++i>=length)throw new TypeError("reduce of empty array with no initial value")}for(;length>i;i++)i in self&&(result=fun.call(void 0,result,self[i],i,object));return result}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(fun){var object=toObject(this),self=splitString&&"[object String]"==_toString(this)?this.split(""):object,length=self.length>>>0;if("[object Function]"!=_toString(fun))throw new TypeError(fun+" is not a function");if(!length&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var result,i=length-1;if(arguments.length>=2)result=arguments[1];else for(;;){if(i in self){result=self[i--];break}if(0>--i)throw new TypeError("reduceRight of empty array with no initial value")}do i in this&&(result=fun.call(void 0,result,self[i],i,object));while(i--);return result}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(sought){var self=splitString&&"[object String]"==_toString(this)?this.split(""):toObject(this),length=self.length>>>0;if(!length)return-1;var i=0;for(arguments.length>1&&(i=toInteger(arguments[1])),i=i>=0?i:Math.max(0,length+i);length>i;i++)if(i in self&&self[i]===sought)return i;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(sought){var self=splitString&&"[object String]"==_toString(this)?this.split(""):toObject(this),length=self.length>>>0;if(!length)return-1;var i=length-1;for(arguments.length>1&&(i=Math.min(i,toInteger(arguments[1]))),i=i>=0?i:length-Math.abs(i);i>=0;i--)if(i in self&&sought===self[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(object){return object.__proto__||(object.constructor?object.constructor.prototype:prototypeOfObject)}),!Object.getOwnPropertyDescriptor){var ERR_NON_OBJECT="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(object,property){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT+object);if(owns(object,property)){var descriptor,getter,setter;if(descriptor={enumerable:!0,configurable:!0},supportsAccessors){var prototype=object.__proto__;object.__proto__=prototypeOfObject;var getter=lookupGetter(object,property),setter=lookupSetter(object,property);if(object.__proto__=prototype,getter||setter)return getter&&(descriptor.get=getter),setter&&(descriptor.set=setter),descriptor}return descriptor.value=object[property],descriptor}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(object){return Object.keys(object)}),!Object.create){var createEmpty;createEmpty=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var empty={};for(var i in empty)empty[i]=null;return empty.constructor=empty.hasOwnProperty=empty.propertyIsEnumerable=empty.isPrototypeOf=empty.toLocaleString=empty.toString=empty.valueOf=empty.__proto__=null,empty},Object.create=function(prototype,properties){var object;if(null===prototype)object=createEmpty();else{if("object"!=typeof prototype)throw new TypeError("typeof prototype["+typeof prototype+"] != \'object\'");var Type=function(){};Type.prototype=prototype,object=new Type,object.__proto__=prototype}return void 0!==properties&&Object.defineProperties(object,properties),object}}if(Object.defineProperty){var definePropertyWorksOnObject=doesDefinePropertyWork({}),definePropertyWorksOnDom="undefined"==typeof document||doesDefinePropertyWork(document.createElement("div"));if(!definePropertyWorksOnObject||!definePropertyWorksOnDom)var definePropertyFallback=Object.defineProperty}if(!Object.defineProperty||definePropertyFallback){var ERR_NON_OBJECT_DESCRIPTOR="Property description must be an object: ",ERR_NON_OBJECT_TARGET="Object.defineProperty called on non-object: ",ERR_ACCESSORS_NOT_SUPPORTED="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(object,property,descriptor){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError(ERR_NON_OBJECT_TARGET+object);if("object"!=typeof descriptor&&"function"!=typeof descriptor||null===descriptor)throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR+descriptor);if(definePropertyFallback)try{return definePropertyFallback.call(Object,object,property,descriptor)}catch(exception){}if(owns(descriptor,"value"))if(supportsAccessors&&(lookupGetter(object,property)||lookupSetter(object,property))){var prototype=object.__proto__;object.__proto__=prototypeOfObject,delete object[property],object[property]=descriptor.value,object.__proto__=prototype}else object[property]=descriptor.value;else{if(!supportsAccessors)throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);owns(descriptor,"get")&&defineGetter(object,property,descriptor.get),owns(descriptor,"set")&&defineSetter(object,property,descriptor.set)}return object}}Object.defineProperties||(Object.defineProperties=function(object,properties){for(var property in properties)owns(properties,property)&&Object.defineProperty(object,property,properties[property]);return object}),Object.seal||(Object.seal=function(object){return object}),Object.freeze||(Object.freeze=function(object){return object});try{Object.freeze(function(){})}catch(exception){Object.freeze=function(freezeObject){return function(object){return"function"==typeof object?object:freezeObject(object)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(object){return object}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(object){if(Object(object)===object)throw new TypeError;for(var name="";owns(object,name);)name+="?";object[name]=!0;var returnValue=owns(object,name);return delete object[name],returnValue}),!Object.keys){var hasDontEnumBug=!0,dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dontEnumsLength=dontEnums.length;for(var key in{toString:null})hasDontEnumBug=!1;Object.keys=function(object){if("object"!=typeof object&&"function"!=typeof object||null===object)throw new TypeError("Object.keys called on a non-object");var keys=[];for(var name in object)owns(object,name)&&keys.push(name);if(hasDontEnumBug)for(var i=0,ii=dontEnumsLength;ii>i;i++){var dontEnum=dontEnums[i];owns(object,dontEnum)&&keys.push(dontEnum)}return keys}}Date.now||(Date.now=function(){return(new Date).getTime()});var ws="\t\\n\v\\f\\r   ᠎              \\u2028\\u2029\ufeff";if(!String.prototype.trim||ws.trim()){ws="["+ws+"]";var trimBeginRegexp=RegExp("^"+ws+ws+"*"),trimEndRegexp=RegExp(ws+ws+"*$");String.prototype.trim=function(){return(this+"").replace(trimBeginRegexp,"").replace(trimEndRegexp,"")}}var toObject=function(o){if(null==o)throw new TypeError("can\'t convert "+o+" to object");return Object(o)}});'},function(e,t){ace.define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/anchor","ace/keyboard/hash_handler","ace/tokenizer","ace/lib/dom","ace/editor"],(function(e,t,n){"use strict";var r=e("./lib/oop"),o=e("./lib/event_emitter").EventEmitter,i=e("./lib/lang"),s=e("./range").Range,a=e("./anchor").Anchor,c=e("./keyboard/hash_handler").HashHandler,l=e("./tokenizer").Tokenizer,u=s.comparePoints,p=function(){this.snippetMap={},this.snippetNameMap={}};(function(){r.implement(this,o),this.getTokenizer=function(){function e(e,t,n){return e=e.substr(1),/^\d+$/.test(e)&&!n.inFormatString?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function t(e){return"(?:[^\\\\"+e+"]|\\\\.)"}return p.$tokenizer=new l({start:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectIf?(n[0].expectIf=!1,n[0].elseBranch=n[0],[n[0]]):":"}},{regex:/\\./,onMatch:function(e,t,n){var r=e[1];return"}"==r&&n.length||-1!="`$\\".indexOf(r)?e=r:n.inFormatString&&("n"==r||"t"==r?e="\n":-1!="ulULE".indexOf(r)&&(e={changeCase:r,local:r>"a"})),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:e},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(t,n,r){var o=e(t.substr(1),0,r);return r.unshift(o[0]),o},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+t("\\|")+"*\\|",onMatch:function(e,t,n){n[0].choices=e.slice(1,-1).split(",")},next:"start"},{regex:"/("+t("/")+"+)/(?:("+t("/")+"*)/)(\\w*):?",onMatch:function(e,t,n){var r=n[0];return r.fmtString=e,e=this.splitRegex.exec(e),r.guard=e[1],r.fmt=e[2],r.flag=e[3],""},next:"start"},{regex:"`"+t("`")+"*`",onMatch:function(e,t,n){return n[0].code=e.splice(1,-1),""},next:"start"},{regex:"\\?",onMatch:function(e,t,n){n[0]&&(n[0].expectIf=!0)},next:"start"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:"/("+t("/")+"+)/",token:"regex"},{regex:"",onMatch:function(e,t,n){n.inFormatString=!0},next:"start"}]}),p.prototype.getTokenizer=function(){return p.$tokenizer},p.$tokenizer},this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map((function(e){return e.value||e}))},this.$getDefaultValue=function(e,t){if(/^[A-Z]\d+$/.test(t)){var n=t.substr(1);return(this.variables[t[0]+"__"]||{})[n]}if(/^\d+$/.test(t))return(this.variables.__||{})[t];if(t=t.replace(/^TM_/,""),e){var r=e.session;switch(t){case"CURRENT_WORD":var o=r.getWordRange();case"SELECTION":case"SELECTED_TEXT":return r.getTextRange(o);case"CURRENT_LINE":return r.getLine(e.getCursorPosition().row);case"PREV_LINE":return r.getLine(e.getCursorPosition().row-1);case"LINE_INDEX":return e.getCursorPosition().column;case"LINE_NUMBER":return e.getCursorPosition().row+1;case"SOFT_TABS":return r.getUseSoftTabs()?"YES":"NO";case"TAB_SIZE":return r.getTabSize();case"FILENAME":case"FILEPATH":return"";case"FULLNAME":return"Ace"}}},this.variables={},this.getVariableValue=function(e,t){return this.variables.hasOwnProperty(t)?this.variables[t](e,t)||"":this.$getDefaultValue(e,t)||""},this.tmStrFormat=function(e,t,n){var r=t.flag||"",o=t.guard;o=new RegExp(o,r.replace(/[^gi]/,""));var i=this.tokenizeTmSnippet(t.fmt,"formatString"),s=this,a=e.replace(o,(function(){s.variables.__=arguments;for(var e=s.resolveVariables(i,n),t="E",r=0;r1?(w=t[t.length-1].length,b+=t.length-1):w+=e.length,y+=e}else e.start?e.end={row:b,column:w}:e.start={row:b,column:w}}));var v=e.getSelectionRange(),x=e.session.replace(v,y),j=new d(e),_=e.inVirtualSelectionMode&&e.selection.index;j.addTabstops(a,v.start,x,_)},this.insertSnippet=function(e,t){var n=this;if(e.inVirtualSelectionMode)return n.insertSnippetForSelection(e,t);e.forEachSelection((function(){n.insertSnippetForSelection(e,t)}),null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},this.$getScope=function(e){var t=e.session.$mode.$id||"";if("html"===(t=t.split("/").pop())||"php"===t){"php"!==t||e.session.$mode.inlinePhp||(t="html");var n=e.getCursorPosition(),r=e.session.getState(n.row);"object"==typeof r&&(r=r[0]),r.substring&&("js-"==r.substring(0,3)?t="javascript":"css-"==r.substring(0,4)?t="css":"php-"==r.substring(0,4)&&(t="php"))}return t},this.getActiveScopes=function(e){var t=this.$getScope(e),n=[t],r=this.snippetMap;return r[t]&&r[t].includeScopes&&n.push.apply(n,r[t].includeScopes),n.push("_"),n},this.expandWithTab=function(e,t){var n=this,r=e.forEachSelection((function(){return n.expandSnippetForSelection(e,t)}),null,{keepOrder:!0});return r&&e.tabstopManager&&e.tabstopManager.tabNext(),r},this.expandSnippetForSelection=function(e,t){var n,r=e.getCursorPosition(),o=e.session.getLine(r.row),i=o.substring(0,r.column),s=o.substr(r.column),a=this.snippetMap;return this.getActiveScopes(e).some((function(e){var t=a[e];return t&&(n=this.findMatchingSnippet(t,i,s)),!!n}),this),!!n&&(t&&t.dryRun||(e.session.doc.removeInLine(r.row,r.column-n.replaceBefore.length,r.column+n.replaceAfter.length),this.variables.M__=n.matchBefore,this.variables.T__=n.matchAfter,this.insertSnippetForSelection(e,n.content),this.variables.M__=this.variables.T__=null),!0)},this.findMatchingSnippet=function(e,t,n){for(var r=e.length;r--;){var o=e[r];if((!o.startRe||o.startRe.test(t))&&(!o.endRe||o.endRe.test(n))&&(o.startRe||o.endRe))return o.matchBefore=o.startRe?o.startRe.exec(t):[""],o.matchAfter=o.endRe?o.endRe.exec(n):[""],o.replaceBefore=o.triggerRe?o.triggerRe.exec(t)[0]:"",o.replaceAfter=o.endTriggerRe?o.endTriggerRe.exec(n)[0]:"",o}},this.snippetMap={},this.snippetNameMap={},this.register=function(e,t){var n=this.snippetMap,r=this.snippetNameMap,o=this;function s(e){return e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)&&(e="(?:"+e+")"),e||""}function a(e,t,n){return e=s(e),t=s(t),n?(e=t+e)&&"$"!=e[e.length-1]&&(e+="$"):(e+=t)&&"^"!=e[0]&&(e="^"+e),new RegExp(e)}function c(e){e.scope||(e.scope=t||"_"),t=e.scope,n[t]||(n[t]=[],r[t]={});var s=r[t];if(e.name){var c=s[e.name];c&&o.unregister(c),s[e.name]=e}n[t].push(e),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=i.escapeRegExp(e.tabTrigger)),(e.trigger||e.guard||e.endTrigger||e.endGuard)&&(e.startRe=a(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger,"",!0),e.endRe=a(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger,"",!0))}e||(e=[]),e&&e.content?c(e):Array.isArray(e)&&e.forEach(c),this._signal("registerSnippets",{scope:t})},this.unregister=function(e,t){var n=this.snippetMap,r=this.snippetNameMap;function o(e){var o=r[e.scope||t];if(o&&o[e.name]){delete o[e.name];var i=n[e.scope||t],s=i&&i.indexOf(e);s>=0&&i.splice(s,1)}}e.content?o(e):Array.isArray(e)&&e.forEach(o)},this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");for(var t,n=[],r={},o=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;t=o.exec(e);){if(t[1])try{r=JSON.parse(t[1]),n.push(r)}catch(e){}if(t[4])r.content=t[4].replace(/^\t/gm,""),n.push(r),r={};else{var i=t[2],s=t[3];if("regex"==i){var a=/\/((?:[^\/\\]|\\.)*)|$/g;r.guard=a.exec(s)[1],r.trigger=a.exec(s)[1],r.endTrigger=a.exec(s)[1],r.endGuard=a.exec(s)[1]}else"snippet"==i?(r.tabTrigger=s.match(/^\S*/)[0],r.name||(r.name=s)):r[i]=s}}return n},this.getSnippetByName=function(e,t){var n,r=this.snippetNameMap;return this.getActiveScopes(t).some((function(t){var o=r[t];return o&&(n=o[e]),!!n}),this),n}}).call(p.prototype);var d=function(e){if(e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=i.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)};(function(){this.attach=function(e){this.index=0,this.ranges=[],this.tabstops=[],this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges=null,this.tabstops=null,this.selectedTabstop=null,this.editor.removeListener("change",this.$onChange),this.editor.removeListener("changeSelection",this.$onChangeSelection),this.editor.removeListener("changeSession",this.$onChangeSession),this.editor.commands.removeListener("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.editor=null},this.onChange=function(e){var t="r"==e.action[0],n=e.start,r=e.end,o=n.row,i=r.row-o,s=r.column-n.column;if(t&&(i=-i,s=-s),!this.$inChange&&t){var a=this.selectedTabstop,c=a&&!a.some((function(e){return u(e.start,n)<=0&&u(e.end,r)>=0}));if(c)return this.detach()}for(var l=this.ranges,p=0;p0?(this.removeRange(d),p--):(d.start.row==o&&d.start.column>n.column&&(d.start.column+=s),d.end.row==o&&d.end.column>=n.column&&(d.end.column+=s),d.start.row>=o&&(d.start.row+=i),d.end.row>=o&&(d.end.row+=i),u(d.start,d.end)>0&&this.removeRange(d)))}l.length||this.detach()},this.updateLinkedFields=function(){var e=this.selectedTabstop;if(e&&e.hasLinkedRanges){this.$inChange=!0;for(var n=this.editor.session,r=n.getTextRange(e.firstNonLinked),o=e.length;o--;){var i=e[o];if(i.linked){var s=t.snippetManager.tmStrFormat(r,i.original);n.replace(i,s)}}this.$inChange=!1}},this.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},this.onChangeSelection=function(){if(this.editor){for(var e=this.editor.selection.lead,t=this.editor.selection.anchor,n=this.editor.selection.isEmpty(),r=this.ranges.length;r--;)if(!this.ranges[r].linked){var o=this.ranges[r].contains(e.row,e.column),i=n||this.ranges[r].contains(t.row,t.column);if(o&&i)return}this.detach()}},this.onChangeSession=function(){this.detach()},this.tabNext=function(e){var t=this.tabstops.length,n=this.index+(e||1);(n=Math.min(Math.max(n,1),t))==t&&(n=0),this.selectTabstop(n),0===n&&this.detach()},this.selectTabstop=function(e){this.$openTabstops=null;var t=this.tabstops[this.index];if(t&&this.addTabstopMarkers(t),this.index=e,(t=this.tabstops[this.index])&&t.length){if(this.selectedTabstop=t,this.editor.inVirtualSelectionMode)this.editor.selection.setRange(t.firstNonLinked);else{var n=this.editor.multiSelect;n.toSingleRange(t.firstNonLinked.clone());for(var r=t.length;r--;)t.hasLinkedRanges&&t[r].linked||n.addRange(t[r].clone(),!0);n.ranges[0]&&n.addRange(n.ranges[0].clone())}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)}},this.addTabstops=function(e,t,n){if(this.$openTabstops||(this.$openTabstops=[]),!e[0]){var r=s.fromPoints(n,n);m(r.start,t),m(r.end,t),e[0]=[r],e[0].index=0}var o=[this.index+1,0],i=this.ranges;e.forEach((function(e,n){for(var r=this.$openTabstops[n]||e,a=e.length;a--;){var c=e[a],l=s.fromPoints(c.start,c.end||c.start);f(l.start,t),f(l.end,t),l.original=c,l.tabstop=r,i.push(l),r!=e?r.unshift(l):r[a]=l,c.fmtString?(l.linked=!0,r.hasLinkedRanges=!0):r.firstNonLinked||(r.firstNonLinked=l)}r.firstNonLinked||(r.hasLinkedRanges=!1),r===e&&(o.push(r),this.$openTabstops[n]=r),this.addTabstopMarkers(r)}),this),o.length>2&&(this.tabstops.length&&o.push(o.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,o))},this.addTabstopMarkers=function(e){var t=this.editor.session;e.forEach((function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))}))},this.removeTabstopMarkers=function(e){var t=this.editor.session;e.forEach((function(e){t.removeMarker(e.markerId),e.markerId=null}))},this.removeRange=function(e){var t=e.tabstop.indexOf(e);e.tabstop.splice(t,1),t=this.ranges.indexOf(e),this.ranges.splice(t,1),this.editor.session.removeMarker(e.markerId),e.tabstop.length||(-1!=(t=this.tabstops.indexOf(e.tabstop))&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},this.keyboardHandler=new c,this.keyboardHandler.bindKeys({Tab:function(e){t.snippetManager&&t.snippetManager.expandWithTab(e)||e.tabstopManager.tabNext(1)},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1)},Esc:function(e){e.tabstopManager.detach()},Return:function(e){return!1}})}).call(d.prototype);var h={};h.onChange=a.prototype.onChange,h.setPosition=function(e,t){this.pos.row=e,this.pos.column=t},h.update=function(e,t,n){this.$insertRight=n,this.pos=e,this.onChange(t)};var f=function(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row},m=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};e("./lib/dom").importCssString(".ace_snippet-marker { -moz-box-sizing: border-box; box-sizing: border-box; background: rgba(194, 193, 208, 0.09); border: 1px dotted rgba(211, 208, 235, 0.62); position: absolute;}"),t.snippetManager=new p;var g=e("./editor").Editor;(function(){this.insertSnippet=function(e,n){return t.snippetManager.insertSnippet(this,e,n)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(g.prototype)})),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom"],(function(e,t,n){"use strict";var r=e("../virtual_renderer").VirtualRenderer,o=e("../editor").Editor,i=e("../range").Range,s=e("../lib/event"),a=e("../lib/lang"),c=e("../lib/dom"),l=function(e){var t=new r(e);t.$maxLines=4;var n=new o(t);return n.setHighlightActiveLine(!1),n.setShowPrintMargin(!1),n.renderer.setShowGutter(!1),n.renderer.setHighlightGutterLine(!1),n.$mouseHandler.$focusWaitTimout=0,n.$highlightTagPending=!0,n};c.importCssString(".ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #CAD6FA; z-index: 1;}.ace_editor.ace_autocomplete .ace_line-hover { border: 1px solid #abbffe; margin-top: -1px; background: rgba(233,233,253,0.4);}.ace_editor.ace_autocomplete .ace_line-hover { position: absolute; z-index: 2;}.ace_editor.ace_autocomplete .ace_scroller { background: none; border: none; box-shadow: none;}.ace_rightAlignedText { color: gray; display: inline-block; position: absolute; right: 4px; text-align: right; z-index: -1;}.ace_editor.ace_autocomplete .ace_completion-highlight{ color: #000; text-shadow: 0 0 0.01em;}.ace_editor.ace_autocomplete { width: 280px; z-index: 200000; background: #fbfbfb; color: #444; border: 1px lightgray solid; position: fixed; box-shadow: 2px 3px 5px rgba(0,0,0,.2); line-height: 1.4;}"),t.AcePopup=function(e){var t=c.createElement("div"),n=new l(t);e&&e.appendChild(t),t.style.display="none",n.renderer.content.style.cursor="default",n.renderer.setStyle("ace_autocomplete"),n.setOption("displayIndentGuides",!1),n.setOption("dragDelay",150);var r,o=function(){};n.focus=o,n.$isFocused=!0,n.renderer.$cursorLayer.restartTimer=o,n.renderer.$cursorLayer.element.style.opacity=0,n.renderer.$maxLines=8,n.renderer.$keepTextAreaAtCursor=!1,n.setHighlightActiveLine(!1),n.session.highlight(""),n.session.$searchHighlight.clazz="ace_highlight-marker",n.on("mousedown",(function(e){var t=e.getDocumentPosition();n.selection.moveToPosition(t),p.start.row=p.end.row=t.row,e.stop()}));var u=new i(-1,0,-1,1/0),p=new i(-1,0,-1,1/0);p.id=n.session.addMarker(p,"ace_active-line","fullLine"),n.setSelectOnHover=function(e){e?u.id&&(n.session.removeMarker(u.id),u.id=null):u.id=n.session.addMarker(u,"ace_line-hover","fullLine")},n.setSelectOnHover(!1),n.on("mousemove",(function(e){if(r){if(r.x!=e.x||r.y!=e.y){(r=e).scrollTop=n.renderer.scrollTop;var t=r.getDocumentPosition().row;u.start.row!=t&&(u.id||n.setRow(t),h(t))}}else r=e})),n.renderer.on("beforeRender",(function(){if(r&&-1!=u.start.row){r.$pos=null;var e=r.getDocumentPosition().row;u.id||n.setRow(e),h(e,!0)}})),n.renderer.on("afterRender",(function(){var e=n.getRow(),t=n.renderer.$textLayer,r=t.element.childNodes[e-t.config.firstRow];r!=t.selectedNode&&(t.selectedNode&&c.removeCssClass(t.selectedNode,"ace_selected"),t.selectedNode=r,r&&c.addCssClass(r,"ace_selected"))}));var d=function(){h(-1)},h=function(e,t){e!==u.start.row&&(u.start.row=u.end.row=e,t||n.session._emit("changeBackMarker"),n._emit("changeHoverMarker"))};n.getHoveredRow=function(){return u.start.row},s.addListener(n.container,"mouseout",d),n.on("hide",d),n.on("changeSelection",d),n.session.doc.getLength=function(){return n.data.length},n.session.doc.getLine=function(e){var t=n.data[e];return"string"==typeof t?t:t&&t.value||""};var f=n.session.bgTokenizer;return f.$tokenizeRow=function(e){var t=n.data[e],r=[];if(!t)return r;"string"==typeof t&&(t={value:t}),t.caption||(t.caption=t.value||t.name);for(var o,i,s=-1,a=0;ac-2&&(l=l.substr(0,c-t.caption.length-3)+"…"),r.push({type:"rightAlignedText",value:l})}return r},f.$updateOnChange=o,f.start=o,n.session.$computeWidth=function(){return this.screenWidth=0},n.$blockScrolling=1/0,n.isOpen=!1,n.isTopdown=!1,n.autoSelect=!0,n.data=[],n.setData=function(e){n.setValue(a.stringRepeat("\n",e.length),-1),n.data=e||[],n.setRow(0)},n.getData=function(e){return n.data[e]},n.getRow=function(){return p.start.row},n.setRow=function(e){e=Math.max(this.autoSelect?0:-1,Math.min(this.data.length,e)),p.start.row!=e&&(n.selection.clearSelection(),p.start.row=p.end.row=e||0,n.session._emit("changeBackMarker"),n.moveCursorTo(e||0,0),n.isOpen&&n._signal("select"))},n.on("changeSelection",(function(){n.isOpen&&n.setRow(n.selection.lead.row),n.renderer.scrollCursorIntoView()})),n.hide=function(){this.container.style.display="none",this._signal("hide"),n.isOpen=!1},n.show=function(e,t,o){var i=this.container,s=window.innerHeight,a=window.innerWidth,c=this.renderer,l=c.$maxLines*t*1.4,u=e.top+this.$borderSize;u>s/2&&!o&&u+t+l>s?(c.$maxPixelHeight=u-2*this.$borderSize,i.style.top="",i.style.bottom=s-u+"px",n.isTopdown=!1):(u+=t,c.$maxPixelHeight=s-u-.2*t,i.style.top=u+"px",i.style.bottom="",n.isTopdown=!0),i.style.display="",this.renderer.$textLayer.checkForSizeChanges();var p=e.left;p+i.offsetWidth>a&&(p=a-i.offsetWidth),i.style.left=p+"px",this._signal("show"),r=null,n.isOpen=!0},n.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},n.$imageSize=0,n.$borderSize=1,n}})),ace.define("ace/autocomplete/util",["require","exports","module"],(function(e,t,n){"use strict";t.parForEach=function(e,t,n){var r=0,o=e.length;0===o&&n();for(var i=0;i=0&&n.test(e[i]);i--)o.push(e[i]);return o.reverse().join("")},t.retrieveFollowingIdentifier=function(e,t,n){n=n||r;for(var o=[],i=t;i=n?-1:t+1;break;case"start":t=0;break;case"end":t=n}this.popup.setRow(t)},this.insertMatch=function(e,t){if(e||(e=this.popup.getData(this.popup.getRow())),!e)return!1;if(e.completer&&e.completer.insertMatch)e.completer.insertMatch(this.editor,e);else{if(this.completions.filterText)for(var n,r=this.editor.selection.getAllRanges(),o=0;n=r[o];o++)n.start.column-=this.completions.filterText.length,this.editor.session.remove(n);e.snippet?c.insertSnippet(this.editor,e.snippet):this.editor.execCommand("insertstring",e.value||e)}this.detach()},this.commands={Up:function(e){e.completer.goTo("up")},Down:function(e){e.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(e){e.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(e){e.completer.goTo("end")},Esc:function(e){e.completer.detach()},Return:function(e){return e.completer.insertMatch()},"Shift-Return":function(e){e.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(e){var t=e.completer.insertMatch();if(t||e.tabstopManager)return t;e.completer.goTo("down")},PageUp:function(e){e.completer.popup.gotoPageUp()},PageDown:function(e){e.completer.popup.gotoPageDown()}},this.gatherCompletions=function(e,t){var n=e.getSession(),r=e.getCursorPosition(),o=i.getCompletionPrefix(e);this.base=n.doc.createAnchor(r.row,r.column-o.length),this.base.$insertRight=!0;var s=[],a=e.completers.length;return e.completers.forEach((function(c,l){c.getCompletions(e,n,r,o,(function(n,r){!n&&r&&(s=s.concat(r)),t(null,{prefix:i.getCompletionPrefix(e),matches:s,finished:0==--a})}))})),!0},this.showPopup=function(e){this.editor&&this.detach(),this.activated=!0,this.editor=e,e.completer!=this&&(e.completer&&e.completer.detach(),e.completer=this),e.on("changeSelection",this.changeListener),e.on("blur",this.blurListener),e.on("mousedown",this.mousedownListener),e.on("mousewheel",this.mousewheelListener),this.updateCompletions()},this.updateCompletions=function(e){if(e&&this.base&&this.completions){var t=this.editor.getCursorPosition(),n=this.editor.session.getTextRange({start:this.base,end:t});if(n==this.completions.filterText)return;return this.completions.setFilter(n),this.completions.filtered.length&&(1!=this.completions.filtered.length||this.completions.filtered[0].value!=n||this.completions.filtered[0].snippet)?void this.openPopup(this.editor,n,e):this.detach()}var r=this.gatherCompletionsId;this.gatherCompletions(this.editor,function(t,n){var o=function(){if(n.finished)return this.detach()}.bind(this),i=n.prefix,s=n&&n.matches;if(!s||!s.length)return o();if(0===i.indexOf(n.prefix)&&r==this.gatherCompletionsId){this.completions=new u(s),this.exactMatch&&(this.completions.exactMatch=!0),this.completions.setFilter(i);var a=this.completions.filtered;return a.length&&(1!=a.length||a[0].value!=i||a[0].snippet)?this.autoInsert&&1==a.length&&n.finished?this.insertMatch(a[0]):void this.openPopup(this.editor,i,e):o()}}.bind(this))},this.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},this.updateDocTooltip=function(){var e=this.popup,t=e.data,n=t&&(t[e.getHoveredRow()]||t[e.getRow()]),r=null;return n&&this.editor&&this.popup.isOpen?(this.editor.completers.some((function(e){return e.getDocTooltip&&(r=e.getDocTooltip(n)),r})),r||(r=n),"string"==typeof r&&(r={docText:r}),r&&(r.docHTML||r.docText)?void this.showDocTooltip(r):this.hideDocTooltip()):this.hideDocTooltip()},this.showDocTooltip=function(e){this.tooltipNode||(this.tooltipNode=a.createElement("div"),this.tooltipNode.className="ace_tooltip ace_doc-tooltip",this.tooltipNode.style.margin=0,this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this));var t=this.tooltipNode;e.docHTML?t.innerHTML=e.docHTML:e.docText&&(t.textContent=e.docText),t.parentNode||document.body.appendChild(t);var n=this.popup,r=n.container.getBoundingClientRect();t.style.top=n.container.style.top,t.style.bottom=n.container.style.bottom,window.innerWidth-r.right<320?(t.style.right=window.innerWidth-r.left+"px",t.style.left=""):(t.style.left=r.right+1+"px",t.style.right=""),t.style.display="block"},this.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),this.tooltipNode){var e=this.tooltipNode;this.editor.isFocused()||document.activeElement!=e||this.editor.focus(),this.tooltipNode=null,e.parentNode&&e.parentNode.removeChild(e)}},this.onTooltipClick=function(e){for(var t=e.target;t&&t!=this.tooltipNode;){if("A"==t.nodeName&&t.href){t.rel="noreferrer",t.target="_blank";break}t=t.parentNode}}}).call(l.prototype),l.startCommand={name:"startAutocomplete",exec:function(e){e.completer||(e.completer=new l),e.completer.autoInsert=!1,e.completer.autoSelect=!0,e.completer.showPopup(e),e.completer.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var u=function(e,t){this.all=e,this.filtered=e,this.filterText=t||"",this.exactMatch=!1};(function(){this.setFilter=function(e){if(e.length>this.filterText&&0===e.lastIndexOf(this.filterText,0))var t=this.filtered;else t=this.all;this.filterText=e,t=(t=this.filterCompletions(t,this.filterText)).sort((function(e,t){return t.exactMatch-e.exactMatch||t.score-e.score}));var n=null;t=t.filter((function(e){var t=e.snippet||e.caption||e.value;return t!==n&&(n=t,!0)})),this.filtered=t},this.filterCompletions=function(e,t){var n=[],r=t.toUpperCase(),o=t.toLowerCase();e:for(var i,s=0;i=e[s];s++){var a=i.value||i.caption||i.snippet;if(a){var c,l,u=-1,p=0,d=0;if(this.exactMatch){if(t!==a.substr(0,t.length))continue e}else for(var h=0;h=0&&(m<0||f0&&(-1===u&&(d+=10),d+=l),p|=1<",s.escapeHTML(e.caption),"","
",s.escapeHTML(e.snippet)].join(""))}},p=[u,c,l];t.setCompleters=function(e){p.length=0,e&&p.push.apply(p,e)},t.addCompleter=function(e){p.push(e)},t.textCompleter=c,t.keyWordCompleter=l,t.snippetCompleter=u;var d={name:"expandSnippet",exec:function(e){return r.expandWithTab(e)},bindKey:"Tab"},h=function(e,t){f(t.session.$mode)},f=function(e){var t=e.$id;r.files||(r.files={}),m(t),e.modes&&e.modes.forEach(f)},m=function(e){if(e&&!r.files[e]){var t=e.replace("mode","snippets");r.files[e]={},i.loadModule(t,(function(t){t&&(r.files[e]=t,!t.snippets&&t.snippetText&&(t.snippets=r.parseSnippetFile(t.snippetText)),r.register(t.snippets||[],t.scope),t.includeScopes&&(r.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach((function(e){m("ace/mode/"+e)}))))}))}},g=function(e){var t=e.editor,n=t.completer&&t.completer.activated;"backspace"===e.command.name?n&&!a.getCompletionPrefix(t)&&t.completer.detach():"insertstring"===e.command.name&&a.getCompletionPrefix(t)&&!n&&(t.completer||(t.completer=new o),t.completer.autoInsert=!1,t.completer.showPopup(t))},b=e("../editor").Editor;e("../config").defineOptions(b.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:p),this.commands.addCommand(o.startCommand)):this.commands.removeCommand(o.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:p),this.commands.on("afterExec",g)):this.commands.removeListener("afterExec",g)},value:!1},enableSnippets:{set:function(e){e?(this.commands.addCommand(d),this.on("changeMode",h),h(0,this)):(this.commands.removeCommand(d),this.off("changeMode",h))},value:!1}})})),ace.acequire(["ace/ext/language_tools"],(function(){}))},function(e,t){ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],(function(e,t,n){"use strict";var r=e("../lib/dom"),o=e("../lib/lang"),i=e("../lib/event"),s=e("../keyboard/hash_handler").HashHandler,a=e("../lib/keys");r.importCssString('.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;box-sizing: border-box!important;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;box-sizing: content-box!important;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',"ace_searchbox");var c=''.replace(/> +/g,">"),l=function(e,t,n){var o=r.createElement("div");o.innerHTML=c,this.element=o.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;i.addListener(e,"mousedown",(function(e){setTimeout((function(){t.activeInput.focus()}),0),i.stopPropagation(e)})),i.addListener(e,"click",(function(e){var n=(e.target||e.srcElement).getAttribute("action");n&&t[n]?t[n]():t.$searchBarKb.commands[n]&&t.$searchBarKb.commands[n].exec(t),i.stopPropagation(e)})),i.addCommandKeyListener(e,(function(e,n,r){var o=a.keyCodeToString(r),s=t.$searchBarKb.findKeyCommand(n,o);s&&s.exec&&(s.exec(t),i.stopEvent(e))})),this.$onChange=o.delayedCall((function(){t.find(!1,!1)})),i.addListener(this.searchInput,"input",(function(){t.$onChange.schedule(20)})),i.addListener(this.searchInput,"focus",(function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()})),i.addListener(this.replaceInput,"focus",(function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()}))},this.$closeSearchBarKb=new s([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new s,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus()},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout((function(){e.hide()}))},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked),this.replaceBox.style.display=this.replaceOption.checked?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,n){var o=!this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:n,range:this.searchRange})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",o),this.editor._emit("findSearchBox",{match:!o}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,r=0;if(t){var o=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),i=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(i-=e.session.doc.positionToIndex(this.searchRange.start));for(var s,a=t.lastIndex=0;(s=t.exec(o))&&(n++,(a=s.index)<=i&&r++,!(n>999))&&(s[0]||(t.lastIndex=a+=1,!(a>=o.length))););}this.searchCounter.textContent=r+" of "+(n>999?"999+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(l.prototype),t.SearchBox=l,t.Search=function(e,t){(e.searchBox||new l(e)).show(e.session.getTextRange(),t)}})),ace.acequire(["ace/ext/searchbox"],(function(){}))},function(e,t,n){var r,o=function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",r={};function o(e,t){if(!r[e]){r[e]={};for(var n=0;n>>8,n[2*r+1]=s%256}return n},decompressFromUint8Array:function(t){if(null==t)return i.decompress(t);for(var n=new Array(t.length/2),r=0,o=n.length;r>=1}else{for(o=1,r=0;r>=1}0==--p&&(p=Math.pow(2,h),h++),delete a[u]}else for(o=s[u],r=0;r>=1;0==--p&&(p=Math.pow(2,h),h++),s[l]=d++,u=String(c)}if(""!==u){if(Object.prototype.hasOwnProperty.call(a,u)){if(u.charCodeAt(0)<256){for(r=0;r>=1}else{for(o=1,r=0;r>=1}0==--p&&(p=Math.pow(2,h),h++),delete a[u]}else for(o=s[u],r=0;r>=1;0==--p&&(p=Math.pow(2,h),h++)}for(o=2,r=0;r>=1;for(;;){if(m<<=1,g==t-1){f.push(n(m));break}g++}return f.join("")},decompress:function(e){return null==e?"":""==e?null:i._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(t,n,r){var o,i,s,a,c,l,u,p=[],d=4,h=4,f=3,m="",g=[],b={val:r(0),position:n,index:1};for(o=0;o<3;o+=1)p[o]=o;for(s=0,c=Math.pow(2,2),l=1;l!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),s|=(a>0?1:0)*l,l<<=1;switch(s){case 0:for(s=0,c=Math.pow(2,8),l=1;l!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),s|=(a>0?1:0)*l,l<<=1;u=e(s);break;case 1:for(s=0,c=Math.pow(2,16),l=1;l!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),s|=(a>0?1:0)*l,l<<=1;u=e(s);break;case 2:return""}for(p[3]=u,i=u,g.push(u);;){if(b.index>t)return"";for(s=0,c=Math.pow(2,f),l=1;l!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),s|=(a>0?1:0)*l,l<<=1;switch(u=s){case 0:for(s=0,c=Math.pow(2,8),l=1;l!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),s|=(a>0?1:0)*l,l<<=1;p[h++]=e(s),u=h-1,d--;break;case 1:for(s=0,c=Math.pow(2,16),l=1;l!=c;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=n,b.val=r(b.index++)),s|=(a>0?1:0)*l,l<<=1;p[h++]=e(s),u=h-1,d--;break;case 2:return g.join("")}if(0==d&&(d=Math.pow(2,f),f++),p[u])m=p[u];else{if(u!==h)return null;m=i+i.charAt(0)}g.push(m),p[h++]=i+m.charAt(0),i=m,0==--d&&(d=Math.pow(2,f),f++)}}};return i}();void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)},function(e,t,n){"use strict";const r=n(50),o=n(51),i=n(52);function s(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function a(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function c(e,t){return t.decode?o(e):e}function l(e){return Array.isArray(e)?e.sort():"object"==typeof e?l(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function u(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function p(e){const t=(e=u(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function d(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function h(e,t){s((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const o="string"==typeof n&&n.split("").indexOf(e.arrayFormatSeparator)>-1?n.split(e.arrayFormatSeparator).map((t=>c(t,e))):null===n?n:c(n,e);r[t]=o};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const o of e.split("&")){let[e,s]=i(t.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator"].includes(t.arrayFormat)?s:c(s,t),n(c(e,t),s,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=d(n[e],t);else r[e]=d(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=l(n):e[t]=n,e}),Object.create(null))}t.extract=p,t.parse=h,t.stringify=(e,t)=>{if(!e)return"";s((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[a(t,e),"[",o,"]"].join("")]:[...n,[a(t,e),"[",a(o,e),"]=",a(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[a(t,e),"[]"].join("")]:[...n,[a(t,e),"[]=",a(r,e)].join("")];case"comma":case"separator":return t=>(n,r)=>null==r||0===r.length?n:0===n.length?[[a(t,e),"=",a(r,e)].join("")]:[[n,a(r,e)].join(e.arrayFormatSeparator)];default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,a(t,e)]:[...n,[a(t,e),"=",a(r,e)].join("")]}}(t),o={};for(const t of Object.keys(e))n(t)||(o[t]=e[t]);const i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map((n=>{const o=e[n];return void 0===o?"":null===o?a(n,t):Array.isArray(o)?o.reduce(r(n),[]).join("&"):a(n,t)+"="+a(o,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=i(e,"#");return Object.assign({url:n.split("?")[0]||"",query:h(p(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:c(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0},n);const r=u(e.url).split("?")[0]||"",o=t.extract(e.url),i=t.parse(o,{sort:!1}),s=Object.assign(i,e.query);let c=t.stringify(s,n);c&&(c=`?${c}`);let l=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(l=`#${a(e.fragmentIdentifier,n)}`),`${r}${c}${l}`}},function(e,t,n){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},function(e,t,n){"use strict";var r="%[a-f0-9]{2}",o=new RegExp("("+r+")|([^%]+?)","gi"),i=new RegExp("("+r+")+","gi");function s(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],s(n),s(r))}function a(e){try{return decodeURIComponent(e)}catch(r){for(var t=e.match(o)||[],n=1;n{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},function(e,t,n){"use strict"; /*! * Hjson v3.2.1 * http://hjson.org * * Copyright 2014-2017 Christian Zangl, MIT license * Details and documentation: * https://github.com/hjson/hjson-js * * This code is based on the the JSON version by Douglas Crockford: * https://github.com/douglascrockford/JSON-js (json_parse.js, json2.js) */var r=n(33),o=n(55),i=n(56),s=n(57),a=n(58),c=n(35);e.exports={parse:i,stringify:s,endOfLine:function(){return r.EOL},setEndOfLine:function(e){"\n"!==e&&"\r\n"!==e||(r.EOL=e)},version:o,rt:{parse:function(e,t){return(t=t||{}).keepWsc=!0,i(e,t)},stringify:function(e,t){return(t=t||{}).keepWsc=!0,s(e,t)}},comments:a,dsf:c.std}},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},function(e,t){e.exports="3.2.1"},function(e,t,n){"use strict";e.exports=function(e,t){var r,o,i,s,a,c=n(33),l=n(35),u={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function p(){o=0,i=" "}function d(e){return"{"===e||"}"===e||"["===e||"]"===e||","===e||":"===e}function h(e){var t,n=0,i=1;for(t=o-1;t>0&&"\n"!==r[t];t--,n++);for(;t>0;t--)"\n"===r[t]&&i++;throw new Error(e+" at line "+i+","+n+" >>>"+r.substr(o-n,20)+" ...")}function f(){return i=r.charAt(o),o++,i}function m(e){return r.charAt(o+e)}function g(e){for(var t="",n=i;f();){if(i===n)return f(),e&&"'"===n&&"'"===i&&0===t.length?(f(),b()):t;if("\\"===i)if(f(),"u"===i){for(var r=0,o=0;o<4;o++){f();var s,a=i.charCodeAt(0);i>="0"&&i<="9"?s=a-48:i>="a"&&i<="f"?s=a-97+10:i>="A"&&i<="F"?s=a-65+10:h("Bad \\u char "+i),r=16*r+s}t+=String.fromCharCode(r)}else{if("string"!=typeof u[i])break;t+=u[i]}else"\n"===i||"\r"===i?h("Bad string containing newline"):t+=i}h("Bad string")}function b(){for(var e="",t=0,n=0;;){var r=m(-n-5);if(!r||"\n"===r)break;n++}function o(){for(var e=n;i&&i<=" "&&"\n"!==i&&e-- >0;)f()}for(;i&&i<=" "&&"\n"!==i;)f();for("\n"===i&&(f(),o());;){if(i){if("'"===i){if(t++,f(),3===t)return"\n"===e.slice(-1)&&(e=e.slice(0,-1)),e;continue}for(;t>0;)e+="'",t--}else h("Bad multiline string");"\n"===i?(e+="\n",f(),o()):("\r"!==i&&(e+=i),f())}}function w(){if('"'===i||"'"===i)return g(!1);for(var e="",t=o,n=-1;;){if(":"===i)return e?n>=0&&n!==e.length&&(o=t+n,h("Found whitespace in your key name (use quotes to include)")):h("Found ':' but no key name (for an empty key name use quotes)"),e;i<=" "?i?n<0&&(n=e.length):h("Found EOF while looking for a key name (check your syntax)"):d(i)?h("Found '"+i+"' where a key name was expected (check your syntax or use quotes if the key name includes {}[],: or whitespace)"):e+=i,f()}}function y(){for(;i;){for(;i&&i<=" ";)f();if("#"===i||"/"===i&&"/"===m(0))for(;i&&"\n"!==i;)f();else{if("/"!==i||"*"!==m(0))break;for(f(),f();i&&("*"!==i||"/"!==m(0));)f();i&&(f(),f())}}}function v(e,t){var n;for(e--,n=o-2;n>e&&r[n]<=" "&&"\n"!==r[n];n--);"\n"===r[n]&&n--,"\r"===r[n]&&n--;var i=r.substr(e,n-e+1);for(n=0;n" "){var s=i.indexOf("\n");if(s>=0){var a=[i.substr(0,s),i.substr(s+1)];return t&&0===a[0].trim().length&&a.shift(),a}return[i]}return[]}function x(e){function t(e,n){var r,o,i,s;switch(typeof e){case"string":e.indexOf(n)>=0&&(s=e);break;case"object":if("[object Array]"===Object.prototype.toString.apply(e))for(r=0,i=e.length;r "+r+"\n (unquoted strings contain everything up to the next line!)":""}return n("}")||n("]")}function j(){var e,t,n,r=[];try{if(s&&(e=c.createComment(r,{a:[]})),f(),t=o,y(),e&&(n=v(t,!0).join("\n")),"]"===i)return f(),e&&(e.e=[n]),r;for(;i;){if(r.push(O()),t=o,y(),","===i&&(f(),t=o,y()),e){var a=v(t);e.a.push([n||"",a[0]||""]),n=a[1]}if("]"===i)return f(),e&&(e.a[e.a.length-1][1]+=n||""),r;y()}h("End of input while parsing an array (missing ']')")}catch(e){throw e.hint=e.hint||x(r),e}}function _(e){var t,n,r,a="",l={};try{if(s&&(t=c.createComment(l,{c:{},o:[]})),e?n=1:(f(),n=o),y(),t&&(r=v(n,!0).join("\n")),"}"===i&&!e)return t&&(t.e=[r]),f(),l;for(;i;){if(a=w(),y(),":"!==i&&h("Expected ':' instead of '"+i+"'"),f(),l[a]=O(),n=o,y(),","===i&&(f(),n=o,y()),t){var u=v(n);t.c[a]=[r||"",u[0]||""],r=u[1],t.o.push(a)}if("}"===i&&!e)return f(),t&&(t.c[a][1]+=r||""),l;y()}if(e)return l;h("End of input while parsing an object (missing '}')")}catch(e){throw e.hint=e.hint||x(l),e}}function O(){switch(y(),i){case"{":return _();case"[":return j();case"'":case'"':return g(!0);default:return function(){var e=i;for(d(i)&&h("Found a punctuator character '"+i+"' when expecting a quoteless string (check your syntax)");;){f();var t="\r"===i||"\n"===i||""===i;if(t||","===i||"}"===i||"]"===i||"#"===i||"/"===i&&("/"===m(0)||"*"===m(0))){var n=e[0];switch(n){case"f":if("false"===e.trim())return!1;break;case"n":if("null"===e.trim())return null;break;case"t":if("true"===e.trim())return!0;break;default:if("-"===n||n>="0"&&n<="9"){var r=c.tryParseNumber(e);if(void 0!==r)return r}}if(t){e=e.trim();var o=a(e);return void 0!==o?o:e}}e+=i}}()}}function E(e,t){var n=o;if(y(),i&&h("Syntax error, found trailing characters"),s){var r=t.join("\n"),a=v(n).join("\n");(a||r)&&(c.createComment(e,c.getComment(e)).r=[r,a])}return e}if("string"!=typeof e)throw new Error("source is not a string");var k=null,R=!0;return t&&"object"==typeof t&&(s=t.keepWsc,k=t.dsf,R=!1!==t.legacyRoot),a=l.loadDsf(k,"parse"),r=e,p(),R?function(){y();var e=s?v(1):null;switch(i){case"{":return E(_(),e);case"[":return E(j(),e)}try{return E(_(!0),e)}catch(t){p();try{return E(O(),e)}catch(e){throw t}}}():function(){y();var e=s?v(1):null;switch(i){case"{":return E(_(),e);case"[":return E(j(),e);default:return E(O(),e)}}()}},function(e,t,n){"use strict";e.exports=function(e,t){var r,o=n(33),i=n(35),s={obj:["{","}"],arr:["[","]"],key:["",""],qkey:['"','"'],col:[":",""],com:[",",""],str:["",""],qstr:['"','"'],mstr:["'''","'''"],num:["",""],lit:["",""],dsf:["",""],esc:["\\",""],uni:["\\u",""],rem:["",""]},a=o.EOL,c=" ",l=!1,u=!1,p=!1,d=!1,h=0,f=1,m="",g=null,b=!1,w=s;if(t&&"object"==typeof t){t.quotes="always"===t.quotes?"strings":t.quotes,"\n"!==t.eol&&"\r\n"!==t.eol||(a=t.eol),l=t.keepWsc,h=t.condense||0,u=t.bracesSameLine,p="all"===t.quotes||"keys"===t.quotes,d="all"===t.quotes||"strings"===t.quotes||!0===t.separator,f=d||"off"==t.multiline?0:"no-tabs"==t.multiline?2:1,m=!0===t.separator?w.com[0]:"",g=t.dsf,b=t.sortProps,"number"==typeof t.space?c=new Array(t.space+1).join(" "):"string"==typeof t.space&&(c=t.space),!0===t.colors&&(w={obj:["{","}"],arr:["[","]"],key:["",""],qkey:['"','"'],col:[":",""],com:[",",""],str:["",""],qstr:['"','"'],mstr:["'''","'''"],num:["",""],lit:["",""],dsf:["",""],esc:["\\",""],uni:["\\u",""],rem:["",""]});var y,v=Object.keys(s);for(y=v.length-1;y>=0;y--){var x=v[y];w[x].push(s[x][0].length,s[x][1].length)}}var j="-Ÿ­؀-؄܏឴឵‌-‏\u2028- ⁠-\ufeff￰-￿",_=new RegExp('[\\\\\\"\0-'+j+"]","g"),O=new RegExp("^\\s|^\"|^'|^#|^\\/\\*|^\\/\\/|^\\{|^\\}|^\\[|^\\]|^:|^,|\\s$|[\0-"+j+"]","g"),E=new RegExp("'''|^[\\s]+$|[\0-"+(2===f?"\t":"\b")+"\v\f-"+j+"]","g"),k=new RegExp("^(true|false|null)\\s*((,|\\]|\\}|#|//|/\\*).*)?$"),R={"\b":"b","\t":"t","\n":"n","\f":"f","\r":"r",'"':'"',"\\":"\\"},S=/[,\{\[\}\]\s:#"']|\/\/|\/\*/,T="",C=0;function A(e,t){return C+=e[0].length+e[1].length-e[2]-e[3],e[0]+t+e[1]}function P(e){return e.replace(_,(function(e){var t=R[e];return"string"==typeof t?A(w.esc,t):A(w.uni,("0000"+e.charCodeAt(0).toString(16)).slice(-4))}))}function L(e){return e?p||S.test(e)?(_.lastIndex=0,A(w.qkey,_.test(e)?P(e):e)):A(w.key,e):'""'}r=i.loadDsf(g,"stringify");var N="",M=l?M=(o.getComment(e)||{}).r:null;return M&&M[0]&&(N=M[0]+"\n"),N+=function e(t,n,i,s){function p(e){return e&&"\n"===e["\r"===e[0]?1:0]}function g(e){return e&&!p(e)}function y(e,t,n){if(!e)return"";var r,i=(e=o.forceComment(e)).length;for(r=0;r0&&(e=e.substr(r)),r0){var r=u(t,null,1);r+="\n# Orphaned comments:\n",n.forEach((function(e){r+=("# "+e.path.join("/")+": "+function(){var e="";return[].forEach.call(arguments,(function(t){t&&""!==t.trim()&&(e&&(e+="; "),e+=t.trim())})),e}(e.b,e.a,e.e)).replace("\n","\\n ")+"\n"})),u(t,r,1)}},header:function(e,t){return u(e,t,0)},footer:function(e,t){return u(e,t,1)}}},function(e,t,n){"use strict";var r=n(42);function o(e,t,n){if(3===e){var o=new r(n,n.readVarint()+n.pos);o.length&&(t[o.name]=o)}}e.exports=function(e,t){this.layers=e.readFields(o,{},t)}},function(e,t,n){"use strict";function r(e,t){this.x=e,this.y=t}e.exports=r,r.prototype={clone:function(){return new r(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,o=n*this.x+t*this.y;return this.x=r,this.y=o,this},_rotateAround:function(e,t){var n=Math.cos(e),r=Math.sin(e),o=t.x+n*(this.x-t.x)-r*(this.y-t.y),i=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=o,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},r.convert=function(e){return e instanceof r?e:Array.isArray(e)?new r(e[0],e[1]):e}},function(e,t,n){"use strict";e.exports=o;var r=n(62);function o(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}o.Varint=0,o.Fixed64=1,o.Bytes=2,o.Fixed32=5;var i=4294967296,s=1/i,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function c(e){return e.type===o.Bytes?e.readVarint()+e.pos:e.pos+1}function l(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function u(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(r);for(var o=n.pos-1;o>=e;o--)n.buf[o+r]=n.buf[o]}function p(e,t){for(var n=0;n>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function j(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}o.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n=n||this.length;this.pos>3,i=this.pos;this.type=7&r,e(o,t,this),this.pos===i&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=v(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=j(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=v(this.buf,this.pos)+v(this.buf,this.pos+4)*i;return this.pos+=8,e},readSFixed64:function(){var e=v(this.buf,this.pos)+j(this.buf,this.pos+4)*i;return this.pos+=8,e},readFloat:function(){var e=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,n,r=this.buf;return t=127&(n=r[this.pos++]),n<128?t:(t|=(127&(n=r[this.pos++]))<<7,n<128?t:(t|=(127&(n=r[this.pos++]))<<14,n<128?t:(t|=(127&(n=r[this.pos++]))<<21,n<128?t:function(e,t,n){var r,o,i=n.buf;if(r=(112&(o=i[n.pos++]))>>4,o<128)return l(e,r,t);if(r|=(127&(o=i[n.pos++]))<<3,o<128)return l(e,r,t);if(r|=(127&(o=i[n.pos++]))<<10,o<128)return l(e,r,t);if(r|=(127&(o=i[n.pos++]))<<17,o<128)return l(e,r,t);if(r|=(127&(o=i[n.pos++]))<<24,o<128)return l(e,r,t);if(r|=(1&(o=i[n.pos++]))<<31,o<128)return l(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(n=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&a?function(e,t,n){return a.decode(e.subarray(t,n))}(this.buf,t,e):function(e,t,n){for(var r="",o=t;o239?4:c>223?3:c>191?2:1;if(o+u>n)break;1===u?c<128&&(l=c):2===u?128==(192&(i=e[o+1]))&&(l=(31&c)<<6|63&i)<=127&&(l=null):3===u?(i=e[o+1],s=e[o+2],128==(192&i)&&128==(192&s)&&((l=(15&c)<<12|(63&i)<<6|63&s)<=2047||l>=55296&&l<=57343)&&(l=null)):4===u&&(i=e[o+1],s=e[o+2],a=e[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&((l=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,u=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),o+=u}return r}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==o.Bytes)return e.push(this.readVarint(t));var n=c(this);for(e=e||[];this.pos127;);else if(t===o.Bytes)this.pos=this.readVarint()+this.pos;else if(t===o.Fixed32)this.pos+=4;else{if(t!==o.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?function(e,t){var n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,n){n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos]=127&e}(n,0,t),function(e,t){var n=(7&e)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,n){for(var r,o,i=0;i55295&&r<57344){if(!o){r>56319||i+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):o=r;continue}if(r<56320){e[n++]=239,e[n++]=191,e[n++]=189,o=r;continue}r=o-55296<<10|r-56320|65536,o=null}else o&&(e[n++]=239,e[n++]=191,e[n++]=189,o=null);r<128?e[n++]=r:(r<2048?e[n++]=r>>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return n}(this.buf,e,this.pos);var n=this.pos-t;n>=128&&u(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(e){this.realloc(4),r.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),r.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n=128&&u(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,n){this.writeTag(e,o.Bytes),this.writeRawMessage(t,n)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,p,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,d,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,m,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,h,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,f,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,g,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,b,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,w,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,y,t)},writeBytesField:function(e,t){this.writeTag(e,o.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,o.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,o.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,o.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,o.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,o.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,o.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,o.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,o.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,o.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},function(e,t,n){e.exports=n(10)(2945)},function(e,t){ace.define("ace/mode/hjson_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(e,t,n){"use strict";var r=e("../lib/oop"),o=e("./text_highlight_rules").TextHighlightRules,i=function(){this.$rules={start:[{include:"#comments"},{include:"#rootObject"},{include:"#value"}],"#array":[{token:"paren.lparen",regex:/\[/,push:[{token:"paren.rparen",regex:/\]/,next:"pop"},{include:"#value"},{include:"#comments"},{token:"text",regex:/,|$/},{token:"invalid.illegal",regex:/[^\s\]]/},{defaultToken:"array"}]}],"#comments":[{token:["comment.punctuation","comment.line"],regex:/(#)(.*$)/},{token:"comment.punctuation",regex:/\/\*/,push:[{token:"comment.punctuation",regex:/\*\//,next:"pop"},{defaultToken:"comment.block"}]},{token:["comment.punctuation","comment.line"],regex:/(\/\/)(.*$)/}],"#constant":[{token:"constant",regex:/\b(?:true|false|null)\b/}],"#keyname":[{token:"keyword",regex:/(?:[^,\{\[\}\]\s]+|"(?:[^"\\]|\\.)*")\s*(?=:)/}],"#mstring":[{token:"string",regex:/'''/,push:[{token:"string",regex:/'''/,next:"pop"},{defaultToken:"string"}]}],"#number":[{token:"constant.numeric",regex:/-?(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:[eE][+-]?\d+)?)?/,comment:"handles integer and decimal numbers"}],"#object":[{token:"paren.lparen",regex:/\{/,push:[{token:"paren.rparen",regex:/\}/,next:"pop"},{include:"#keyname"},{include:"#value"},{token:"text",regex:/:/},{token:"text",regex:/,/},{defaultToken:"paren"}]}],"#rootObject":[{token:"paren",regex:/(?=\s*(?:[^,\{\[\}\]\s]+|"(?:[^"\\]|\\.)*")\s*:)/,push:[{token:"paren.rparen",regex:/---none---/,next:"pop"},{include:"#keyname"},{include:"#value"},{token:"text",regex:/:/},{token:"text",regex:/,/},{defaultToken:"paren"}]}],"#string":[{token:"string",regex:/"/,push:[{token:"string",regex:/"/,next:"pop"},{token:"constant.language.escape",regex:/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/},{token:"invalid.illegal",regex:/\\./},{defaultToken:"string"}]}],"#ustring":[{token:"string",regex:/\b[^:,0-9\-\{\[\}\]\s].*$/}],"#value":[{include:"#constant"},{include:"#number"},{include:"#string"},{include:"#array"},{include:"#object"},{include:"#comments"},{include:"#mstring"},{include:"#ustring"}]},this.normalizeRules()};i.metaData={fileTypes:["hjson"],foldingStartMarker:"(?x: # turn on extended mode\n ^ # a line beginning with\n \\s* # some optional space\n [{\\[] # the start of an object or array\n (?! # but not followed by\n .* # whatever\n [}\\]] # and the close of an object or array\n ,? # an optional comma\n \\s* # some optional space\n $ # at the end of the line\n )\n | # ...or...\n [{\\[] # the start of an object or array\n \\s* # some optional space\n $ # at the end of the line\n )",foldingStopMarker:"(?x: # turn on extended mode\n ^ # a line beginning with\n \\s* # some optional space\n [}\\]] # and the close of an object or array\n )",keyEquivalent:"^~J",name:"Hjson",scopeName:"source.hjson"},r.inherits(i,o),t.HjsonHighlightRules=i})),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],(function(e,t,n){"use strict";var r=e("../../lib/oop"),o=e("../../range").Range,i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(s,i),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var o=this._getFoldWidgetBase(e,t,n);return!o&&this.startRegionRe.test(r)?"start":o},this.getFoldWidgetRange=function(e,t,n,r){var o,i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);if(o=i.match(this.foldingStartMarker)){var s=o.index;if(o[1])return this.openingBracketBlock(e,o[1],n,s);var a=e.getCommentFoldRange(n,s+o[0].length,1);return a&&!a.isMultiLine()&&(r?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(o=i.match(this.foldingStopMarker))?(s=o.index+o[0].length,o[1]?this.closingBracketBlock(e,o[1],n,s):e.getCommentFoldRange(n,s,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),r=n.search(/\S/),i=t,s=n.length,a=t+=1,c=e.getLength();++tl)break;var u=this.getFoldWidgetRange(e,"all",t);if(u){if(u.start.row<=i)break;if(u.isMultiLine())t=u.end.row;else if(r==l)break}a=t}}return new o(i,s,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var r=t.search(/\s*$/),i=e.getLength(),s=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,c=1;++ns)return new o(s,r,n,t.length)}}.call(s.prototype)})),ace.define("ace/mode/hjson",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/hjson_highlight_rules","ace/mode/folding/cstyle"],(function(e,t,n){"use strict";var r=e("../lib/oop"),o=e("./text").Mode,i=e("./hjson_highlight_rules").HjsonHighlightRules,s=e("./folding/cstyle").FoldMode,a=function(){this.HighlightRules=i,this.foldingRules=new s};r.inherits(a,o),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$id="ace/mode/hjson"}.call(a.prototype),t.Mode=a}))},function(e,t){ace.define("ace/mode/yaml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(e,t,n){"use strict";var r=e("../lib/oop"),o=e("./text_highlight_rules").TextHighlightRules,i=function(){this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"list.markup",regex:/^(?:-{3}|\.{3})\s*(?=#|$)/},{token:"list.markup",regex:/^\s*[\-?](?:$|\s)/},{token:"constant",regex:"!![\\w//]+"},{token:"constant.language",regex:"[&\\*][a-zA-Z0-9-_]+"},{token:["meta.tag","keyword"],regex:/^(\s*\w.*?)(:(?=\s|$))/},{token:["meta.tag","keyword"],regex:/(\w+?)(\s*:(?=\s|$))/},{token:"keyword.operator",regex:"<<\\w*:\\w*"},{token:"keyword.operator",regex:"-\\s*(?=[{])"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:/[|>][-+\d\s]*$/,onMatch:function(e,t,n,r){var o=/^\s*/.exec(r)[0];return n.length<1?n.push(this.next):n[0]="mlString",n.length<2?n.push(o.length):n[1]=o.length,this.token},next:"mlString"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",regex:/(\b|[+\-\.])[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)(?=[^\d-\w]|$)/},{token:"constant.numeric",regex:/[+\-]?\.inf\b|NaN\b|0x[\dA-Fa-f_]+|0b[10_]+/},{token:"constant.language.boolean",regex:"\\b(?:true|false|TRUE|FALSE|True|False|yes|no)\\b"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:/[^\s,:\[\]\{\}]+/}],mlString:[{token:"indent",regex:/^\s*$/},{token:"indent",regex:/^\s*/,onMatch:function(e,t,n){return n[1]>=e.length?(this.next="start",n.splice(0)):this.next="mlString",this.token},next:"mlString"},{token:"string",regex:".+"}]},this.normalizeRules()};r.inherits(i,o),t.YamlHighlightRules=i})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var r=e("../range").Range,o=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var o=n[1].length,i=e.findMatchingBracket({row:t,column:o});if(!i||i.row==t)return 0;var s=this.$getIndent(e.getLine(i.row));e.replace(new r(t,0,t,o-1),s)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(o.prototype),t.MatchingBraceOutdent=o})),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],(function(e,t,n){"use strict";var r=e("../../lib/oop"),o=e("./fold_mode").FoldMode,i=e("../../range").Range,s=t.FoldMode=function(){};r.inherits(s,o),function(){this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;var o=/\S/,s=e.getLine(n),a=s.search(o);if(-1!=a&&"#"==s[a]){for(var c=s.length,l=e.getLength(),u=n,p=n;++nu){var h=e.getLine(p).length;return new i(u,c,p,h)}}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),o=r.search(/\S/),i=e.getLine(n+1),s=e.getLine(n-1),a=s.search(/\S/),c=i.search(/\S/);if(-1==o)return e.foldWidgets[n-1]=-1!=a&&a{const t=(t,n)=>null==e?void 0:e.reportUiCounter("console",t,n);return{count:e=>{t(p.METRIC_TYPE.COUNT,e)},load:e=>{t(p.METRIC_TYPE.LOADED,e)}}};var h=n(0),f=n.n(h),m=n(9);class local_storage_object_client_LocalObjectStorage{constructor(e,t){f()(this,"prefix",void 0),this.client=e,this.prefix=`console_local_${t}`}async create(e){const t=Object(m.v4)(),n={id:t,...e};return this.client.set(`${this.prefix}_${t}`,n),n}async update(e){this.client.set(`${this.prefix}_${e.id}`,e)}async findAll(){const e=this.client.keys().filter((e=>e.includes(this.prefix))),t=[];for(const n of e)t.push(this.client.get(n));return t}}const g=e=>({text:new local_storage_object_client_LocalObjectStorage(e,"text-object")});var b=n(3),w=n(24),y=n(1),v=n.n(y),x=n(31),j=n.n(x),_=n(23);const O=Object(r.createContext)(null);function E({children:e,value:t}){return Object(r.useEffect)((()=>{t.services.esHostService.init()}),[t.services.esHostService]),Object(_.jsx)(O.Provider,{value:t},e)}const k=()=>{const e=Object(r.useContext)(O);if(null==e)throw new Error("useServicesContext must be used inside the ServicesContextProvider.");return e},R=(e,t)=>()=>{const n=Object(r.useContext)(e);if(!n)throw new Error(`${t} should be used inside of ${t}Provider!`);return n};var S=n(36),T=n(37);const C={data:null,type:"unknown"},A=Object(S.produce)({requestInFlight:!1,lastResult:C},T.identity),P=(e,t)=>Object(S.produce)(e,(e=>"sendRequest"===t.type?(e.requestInFlight=!0,void(e.lastResult=C)):"requestSuccess"===t.type?(e.requestInFlight=!1,void(e.lastResult=t.payload)):"requestFail"===t.type?(e.requestInFlight=!1,void(e.lastResult={...C,error:t.payload})):void 0)),L=Object(r.createContext)(A),N=Object(r.createContext)((()=>{}));function M({children:e}){const[t,n]=Object(r.useReducer)(P,A);return Object(_.jsx)(L.Provider,{value:t},Object(_.jsx)(N.Provider,{value:n},e))}const I=R(L,"RequestReadContext"),q=R(N,"RequestActionContext"),D=Object(S.produce)({ready:!1,settings:u.b,currentTextObject:null},T.identity),F=(e,t)=>Object(S.produce)(e,(e=>{if("setInputEditor"!==t.type)if("updateSettings"!==t.type){if("setCurrentTextObject"!==t.type)return e;e.currentTextObject=t.payload}else e.settings=t.payload;else t.payload&&(e.ready=!0)})),B=Object(r.createContext)(D),U=Object(r.createContext)((()=>{}));function V({children:e,settings:t}){const[n,o]=Object(r.useReducer)(F,D,(e=>({...e,settings:t})));return Object(_.jsx)(B.Provider,{value:n},Object(_.jsx)(U.Provider,{value:o},e))}const H=R(B,"EditorReadContext"),z=R(U,"EditorActionContext");class split_panel_registry_PanelRegistry{constructor(){f()(this,"panels",[])}registerPanel(e){this.panels.push(e)}getPanels(){return this.panels}}const W=Object(r.createContext)({registry:new split_panel_registry_PanelRegistry});function G({children:e,registry:t}){return Object(_.jsx)(W.Provider,{value:{registry:t}},e)}const K=()=>{const e=Object(r.useContext)(W);if(void 0===e)throw new Error("usePanelContext must be used within a ");return e};var J=n(5);function Q(e,...t){const n=new J.ResizeChecker(e);return n.on("resize",(()=>t.forEach((e=>{e.getCoreEditor?e.getCoreEditor().resize():e.resize(),e.updateActionsBar&&e.updateActionsBar()})))),()=>n.destroy()}var X=n(32),Y=n.n(X);const Z={id:"sense_editor/mode/worker",src:"/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0 and the Server Side Public License, v 1; you may not use this file except\n * in compliance with, at your election, the Elastic License 2.0 or the Server\n * Side Public License, v 1.\n */\n\n/* @notice\n *\n * This product includes code that is based on Ace editor, which was available\n * under a \"BSD\" license.\n *\n * Distributed under the BSD license:\n *\n * Copyright (c) 2010, Ajax.org B.V.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * * Neither the name of Ajax.org B.V. nor the\n * names of its contributors may be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* eslint-disable prettier/prettier,prefer-const,eqeqeq,import/no-commonjs,no-undef,no-sequences,\n block-scoped-var,no-use-before-define,no-var,one-var,guard-for-in,new-cap,no-nested-ternary,no-redeclare,\n no-unused-vars,no-extend-native,no-empty,camelcase,no-proto,@kbn/imports/no_unresolvable_imports */\n/*\n This file is loaded up as a blob by Brace to hand to Ace to load as Jsonp\n (hence the redefining of everything). It is based on the javascript\n mode from the brace distro.\n*/\nfunction init(window) {\n function resolveModuleId(id, paths) {\n for (let testPath = id, tail = ''; testPath;) {\n let alias = paths[testPath];\n if ('string' === typeof alias) return alias + tail;\n if (alias)\n {return (\n alias.location.replace(/\\/*$/, '/') +\n (tail || alias.main || alias.name)\n );}\n if (alias === !1) return '';\n let i = testPath.lastIndexOf('/');\n if (-1 === i) break;\n (tail = testPath.substr(i) + tail), (testPath = testPath.slice(0, i));\n }\n return id;\n }\n if (\n !(\n (void 0 !== window.window && window.document) ||\n (window.acequire && window.define)\n )\n ) {\n window.console ||\n ((window.console = function () {\n let msgs = Array.prototype.slice.call(arguments, 0);\n postMessage({ type: 'log', data: msgs });\n }),\n (window.console.error = window.console.warn = window.console.log = window.console.trace =\n window.console)),\n (window.window = window),\n (window.ace = window),\n (window.onerror = function (message, file, line, col, err) {\n postMessage({\n type: 'error',\n data: {\n message: message,\n data: err.data,\n file: file,\n line: line,\n col: col,\n stack: err.stack,\n },\n });\n }),\n (window.normalizeModule = function (parentId, moduleName) {\n if (-1 !== moduleName.indexOf('!')) {\n let chunks = moduleName.split('!');\n return (\n window.normalizeModule(parentId, chunks[0]) +\n '!' +\n window.normalizeModule(parentId, chunks[1])\n );\n }\n if ('.' == moduleName.charAt(0)) {\n let base = parentId\n .split('/')\n .slice(0, -1)\n .join('/');\n for (\n moduleName = (base ? base + '/' : '') + moduleName;\n -1 !== moduleName.indexOf('.') && previous != moduleName;\n\n ) {\n var previous = moduleName;\n moduleName = moduleName\n .replace(/^\\.\\//, '')\n .replace(/\\/\\.\\//, '/')\n .replace(/[^\\/]+\\/\\.\\.\\//, '');\n }\n }\n return moduleName;\n }),\n (window.acequire = function acequire(parentId, id) {\n if ((id || ((id = parentId), (parentId = null)), !id.charAt))\n {throw Error(\n 'worker.js acequire() accepts only (parentId, id) as arguments'\n );}\n id = window.normalizeModule(parentId, id);\n let module = window.acequire.modules[id];\n if (module)\n {return (\n module.initialized ||\n ((module.initialized = !0),\n (module.exports = module.factory().exports)),\n module.exports\n );}\n if (!window.acequire.tlns) return console.log('unable to load ' + id);\n let path = resolveModuleId(id, window.acequire.tlns);\n return (\n '.js' != path.slice(-3) && (path += '.js'),\n (window.acequire.id = id),\n (window.acequire.modules[id] = {}),\n importScripts(path),\n window.acequire(parentId, id)\n );\n }),\n (window.acequire.modules = {}),\n (window.acequire.tlns = {}),\n (window.define = function (id, deps, factory) {\n if (\n (2 == arguments.length\n ? ((factory = deps),\n 'string' !== typeof id && ((deps = id), (id = window.acequire.id)))\n : 1 == arguments.length &&\n ((factory = id), (deps = []), (id = window.acequire.id)),\n 'function' !== typeof factory)\n )\n {return (\n (window.acequire.modules[id] = {\n exports: factory,\n initialized: !0,\n }),\n void 0\n );}\n deps.length || (deps = ['require', 'exports', 'module']);\n let req = function (childId) {\n return window.acequire(id, childId);\n };\n window.acequire.modules[id] = {\n exports: {},\n factory: function () {\n let module = this,\n returnExports = factory.apply(\n this,\n deps.map(function (dep) {\n switch (dep) {\n case 'require':\n return req;\n case 'exports':\n return module.exports;\n case 'module':\n return module;\n default:\n return req(dep);\n }\n })\n );\n return returnExports && (module.exports = returnExports), module;\n },\n };\n }),\n (window.define.amd = {}),\n (acequire.tlns = {}),\n (window.initBaseUrls = function (topLevelNamespaces) {\n for (let i in topLevelNamespaces)\n {acequire.tlns[i] = topLevelNamespaces[i];}\n }),\n (window.initSender = function () {\n let EventEmitter = window.acequire('ace/lib/event_emitter')\n .EventEmitter,\n oop = window.acequire('ace/lib/oop'),\n Sender = function () {};\n return (\n function () {\n oop.implement(this, EventEmitter),\n (this.callback = function (data, callbackId) {\n postMessage({ type: 'call', id: callbackId, data: data });\n }),\n (this.emit = function (name, data) {\n postMessage({ type: 'event', name: name, data: data });\n });\n }.call(Sender.prototype),\n new Sender()\n );\n });\n let main = (window.main = null),\n sender = (window.sender = null);\n window.onmessage = function (e) {\n let msg = e.data;\n if (msg.event && sender) sender._signal(msg.event, msg.data);\n else if (msg.command)\n {if (main[msg.command]) main[msg.command].apply(main, msg.args);\n else {\n if (!window[msg.command])\n throw Error('Unknown command:' + msg.command);\n window[msg.command].apply(window, msg.args);\n }}\n else if (msg.init) {\n window.initBaseUrls(msg.tlns),\n acequire('ace/lib/es5-shim'),\n (sender = window.sender = window.initSender());\n let clazz = acequire(msg.module)[msg.classname];\n main = window.main = new clazz(sender);\n }\n };\n }\n}\ninit(this);\nace.define('ace/lib/oop', ['require', 'exports', 'module'], function (\n acequire,\n exports\n) {\n (exports.inherits = function (ctor, superCtor) {\n (ctor.super_ = superCtor),\n (ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0,\n },\n }));\n }),\n (exports.mixin = function (obj, mixin) {\n for (let key in mixin) obj[key] = mixin[key];\n return obj;\n }),\n (exports.implement = function (proto, mixin) {\n exports.mixin(proto, mixin);\n });\n}),\nace.define('ace/range', ['require', 'exports', 'module'], function (\n acequire,\n exports\n) {\n let comparePoints = function (p1, p2) {\n return p1.row - p2.row || p1.column - p2.column;\n },\n Range = function (startRow, startColumn, endRow, endColumn) {\n (this.start = { row: startRow, column: startColumn }),\n (this.end = { row: endRow, column: endColumn });\n };\n (function () {\n (this.isEqual = function (range) {\n return (\n this.start.row === range.start.row &&\n this.end.row === range.end.row &&\n this.start.column === range.start.column &&\n this.end.column === range.end.column\n );\n }),\n (this.toString = function () {\n return (\n 'Range: [' +\n this.start.row +\n '/' +\n this.start.column +\n '] -> [' +\n this.end.row +\n '/' +\n this.end.column +\n ']'\n );\n }),\n (this.contains = function (row, column) {\n return 0 == this.compare(row, column);\n }),\n (this.compareRange = function (range) {\n let cmp,\n end = range.end,\n start = range.start;\n return (\n (cmp = this.compare(end.row, end.column)),\n 1 == cmp\n ? ((cmp = this.compare(start.row, start.column)),\n 1 == cmp ? 2 : 0 == cmp ? 1 : 0)\n : -1 == cmp\n ? -2\n : ((cmp = this.compare(start.row, start.column)),\n -1 == cmp ? -1 : 1 == cmp ? 42 : 0)\n );\n }),\n (this.comparePoint = function (p) {\n return this.compare(p.row, p.column);\n }),\n (this.containsRange = function (range) {\n return (\n 0 == this.comparePoint(range.start) &&\n 0 == this.comparePoint(range.end)\n );\n }),\n (this.intersects = function (range) {\n let cmp = this.compareRange(range);\n return -1 == cmp || 0 == cmp || 1 == cmp;\n }),\n (this.isEnd = function (row, column) {\n return this.end.row == row && this.end.column == column;\n }),\n (this.isStart = function (row, column) {\n return this.start.row == row && this.start.column == column;\n }),\n (this.setStart = function (row, column) {\n 'object' === typeof row\n ? ((this.start.column = row.column), (this.start.row = row.row))\n : ((this.start.row = row), (this.start.column = column));\n }),\n (this.setEnd = function (row, column) {\n 'object' === typeof row\n ? ((this.end.column = row.column), (this.end.row = row.row))\n : ((this.end.row = row), (this.end.column = column));\n }),\n (this.inside = function (row, column) {\n return 0 == this.compare(row, column)\n ? this.isEnd(row, column) || this.isStart(row, column)\n ? !1\n : !0\n : !1;\n }),\n (this.insideStart = function (row, column) {\n return 0 == this.compare(row, column)\n ? this.isEnd(row, column)\n ? !1\n : !0\n : !1;\n }),\n (this.insideEnd = function (row, column) {\n return 0 == this.compare(row, column)\n ? this.isStart(row, column)\n ? !1\n : !0\n : !1;\n }),\n (this.compare = function (row, column) {\n return this.isMultiLine() || row !== this.start.row\n ? this.start.row > row\n ? -1\n : row > this.end.row\n ? 1\n : this.start.row === row\n ? column >= this.start.column\n ? 0\n : -1\n : this.end.row === row\n ? this.end.column >= column\n ? 0\n : 1\n : 0\n : this.start.column > column\n ? -1\n : column > this.end.column\n ? 1\n : 0;\n }),\n (this.compareStart = function (row, column) {\n return this.start.row == row && this.start.column == column\n ? -1\n : this.compare(row, column);\n }),\n (this.compareEnd = function (row, column) {\n return this.end.row == row && this.end.column == column\n ? 1\n : this.compare(row, column);\n }),\n (this.compareInside = function (row, column) {\n return this.end.row == row && this.end.column == column\n ? 1\n : this.start.row == row && this.start.column == column\n ? -1\n : this.compare(row, column);\n }),\n (this.clipRows = function (firstRow, lastRow) {\n if (this.end.row > lastRow) var end = { row: lastRow + 1, column: 0 };\n else if (firstRow > this.end.row)\n {var end = { row: firstRow, column: 0 };}\n if (this.start.row > lastRow)\n {var start = { row: lastRow + 1, column: 0 };}\n else if (firstRow > this.start.row)\n {var start = { row: firstRow, column: 0 };}\n return Range.fromPoints(start || this.start, end || this.end);\n }),\n (this.extend = function (row, column) {\n let cmp = this.compare(row, column);\n if (0 == cmp) return this;\n if (-1 == cmp) var start = { row: row, column: column };\n else var end = { row: row, column: column };\n return Range.fromPoints(start || this.start, end || this.end);\n }),\n (this.isEmpty = function () {\n return (\n this.start.row === this.end.row &&\n this.start.column === this.end.column\n );\n }),\n (this.isMultiLine = function () {\n return this.start.row !== this.end.row;\n }),\n (this.clone = function () {\n return Range.fromPoints(this.start, this.end);\n }),\n (this.collapseRows = function () {\n return 0 == this.end.column\n ? new Range(\n this.start.row,\n 0,\n Math.max(this.start.row, this.end.row - 1),\n 0\n )\n : new Range(this.start.row, 0, this.end.row, 0);\n }),\n (this.toScreenRange = function (session) {\n let screenPosStart = session.documentToScreenPosition(this.start),\n screenPosEnd = session.documentToScreenPosition(this.end);\n return new Range(\n screenPosStart.row,\n screenPosStart.column,\n screenPosEnd.row,\n screenPosEnd.column\n );\n }),\n (this.moveBy = function (row, column) {\n (this.start.row += row),\n (this.start.column += column),\n (this.end.row += row),\n (this.end.column += column);\n });\n }.call(Range.prototype),\n (Range.fromPoints = function (start, end) {\n return new Range(start.row, start.column, end.row, end.column);\n }),\n (Range.comparePoints = comparePoints),\n (Range.comparePoints = function (p1, p2) {\n return p1.row - p2.row || p1.column - p2.column;\n }),\n (exports.Range = Range));\n}),\nace.define('ace/apply_delta', ['require', 'exports', 'module'], function (\n acequire,\n exports\n) {\n exports.applyDelta = function (docLines, delta) {\n let row = delta.start.row,\n startColumn = delta.start.column,\n line = docLines[row] || '';\n switch (delta.action) {\n case 'insert':\n var lines = delta.lines;\n if (1 === lines.length)\n {docLines[row] =\n line.substring(0, startColumn) +\n delta.lines[0] +\n line.substring(startColumn);}\n else {\n let args = [row, 1].concat(delta.lines);\n docLines.splice.apply(docLines, args),\n (docLines[row] = line.substring(0, startColumn) + docLines[row]),\n (docLines[row + delta.lines.length - 1] += line.substring(\n startColumn\n ));\n }\n break;\n case 'remove':\n var endColumn = delta.end.column,\n endRow = delta.end.row;\n row === endRow\n ? (docLines[row] =\n line.substring(0, startColumn) + line.substring(endColumn))\n : docLines.splice(\n row,\n endRow - row + 1,\n line.substring(0, startColumn) +\n docLines[endRow].substring(endColumn)\n );\n }\n };\n}),\nace.define(\n 'ace/lib/event_emitter',\n ['require', 'exports', 'module'],\n function (acequire, exports) {\n let EventEmitter = {},\n stopPropagation = function () {\n this.propagationStopped = !0;\n },\n preventDefault = function () {\n this.defaultPrevented = !0;\n };\n (EventEmitter._emit = EventEmitter._dispatchEvent = function (\n eventName,\n e\n ) {\n this._eventRegistry || (this._eventRegistry = {}),\n this._defaultHandlers || (this._defaultHandlers = {});\n let listeners = this._eventRegistry[eventName] || [],\n defaultHandler = this._defaultHandlers[eventName];\n if (listeners.length || defaultHandler) {\n ('object' === typeof e && e) || (e = {}),\n e.type || (e.type = eventName),\n e.stopPropagation || (e.stopPropagation = stopPropagation),\n e.preventDefault || (e.preventDefault = preventDefault),\n (listeners = listeners.slice());\n for (\n let i = 0;\n listeners.length > i &&\n (listeners[i](e, this), !e.propagationStopped);\n i++\n );\n return defaultHandler && !e.defaultPrevented\n ? defaultHandler(e, this)\n : void 0;\n }\n }),\n (EventEmitter._signal = function (eventName, e) {\n let listeners = (this._eventRegistry || {})[eventName];\n if (listeners) {\n listeners = listeners.slice();\n for (let i = 0; listeners.length > i; i++) listeners[i](e, this);\n }\n }),\n (EventEmitter.once = function (eventName, callback) {\n let _self = this;\n callback &&\n this.addEventListener(eventName, function newCallback() {\n _self.removeEventListener(eventName, newCallback),\n callback.apply(null, arguments);\n });\n }),\n (EventEmitter.setDefaultHandler = function (eventName, callback) {\n let handlers = this._defaultHandlers;\n if (\n (handlers ||\n (handlers = this._defaultHandlers = { _disabled_: {} }),\n handlers[eventName])\n ) {\n let old = handlers[eventName],\n disabled = handlers._disabled_[eventName];\n disabled || (handlers._disabled_[eventName] = disabled = []),\n disabled.push(old);\n let i = disabled.indexOf(callback);\n -1 != i && disabled.splice(i, 1);\n }\n handlers[eventName] = callback;\n }),\n (EventEmitter.removeDefaultHandler = function (eventName, callback) {\n let handlers = this._defaultHandlers;\n if (handlers) {\n let disabled = handlers._disabled_[eventName];\n if (handlers[eventName] == callback)\n {handlers[eventName],\n disabled && this.setDefaultHandler(eventName, disabled.pop());}\n else if (disabled) {\n let i = disabled.indexOf(callback);\n -1 != i && disabled.splice(i, 1);\n }\n }\n }),\n (EventEmitter.on = EventEmitter.addEventListener = function (\n eventName,\n callback,\n capturing\n ) {\n this._eventRegistry = this._eventRegistry || {};\n let listeners = this._eventRegistry[eventName];\n return (\n listeners || (listeners = this._eventRegistry[eventName] = []),\n -1 == listeners.indexOf(callback) &&\n listeners[capturing ? 'unshift' : 'push'](callback),\n callback\n );\n }),\n (EventEmitter.off = EventEmitter.removeListener = EventEmitter.removeEventListener = function (\n eventName,\n callback\n ) {\n this._eventRegistry = this._eventRegistry || {};\n let listeners = this._eventRegistry[eventName];\n if (listeners) {\n let index = listeners.indexOf(callback);\n -1 !== index && listeners.splice(index, 1);\n }\n }),\n (EventEmitter.removeAllListeners = function (eventName) {\n this._eventRegistry && (this._eventRegistry[eventName] = []);\n }),\n (exports.EventEmitter = EventEmitter);\n }\n),\nace.define(\n 'ace/anchor',\n ['require', 'exports', 'module', 'ace/lib/oop', 'ace/lib/event_emitter'],\n function (acequire, exports) {\n let oop = acequire('./lib/oop'),\n EventEmitter = acequire('./lib/event_emitter').EventEmitter,\n Anchor = (exports.Anchor = function (doc, row, column) {\n (this.$onChange = this.onChange.bind(this)),\n this.attach(doc),\n column === void 0\n ? this.setPosition(row.row, row.column)\n : this.setPosition(row, column);\n });\n (function () {\n function $pointsInOrder(point1, point2, equalPointsInOrder) {\n let bColIsAfter = equalPointsInOrder\n ? point1.column <= point2.column\n : point1.column < point2.column;\n return (\n point1.row < point2.row || (point1.row == point2.row && bColIsAfter)\n );\n }\n function $getTransformedPoint(delta, point, moveIfEqual) {\n let deltaIsInsert = 'insert' == delta.action,\n deltaRowShift =\n (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row),\n deltaColShift =\n (deltaIsInsert ? 1 : -1) *\n (delta.end.column - delta.start.column),\n deltaStart = delta.start,\n deltaEnd = deltaIsInsert ? deltaStart : delta.end;\n return $pointsInOrder(point, deltaStart, moveIfEqual)\n ? { row: point.row, column: point.column }\n : $pointsInOrder(deltaEnd, point, !moveIfEqual)\n ? {\n row: point.row + deltaRowShift,\n column:\n point.column +\n (point.row == deltaEnd.row ? deltaColShift : 0),\n }\n : { row: deltaStart.row, column: deltaStart.column };\n }\n oop.implement(this, EventEmitter),\n (this.getPosition = function () {\n return this.$clipPositionToDocument(this.row, this.column);\n }),\n (this.getDocument = function () {\n return this.document;\n }),\n (this.$insertRight = !1),\n (this.onChange = function (delta) {\n if (\n !(\n (delta.start.row == delta.end.row &&\n delta.start.row != this.row) ||\n delta.start.row > this.row\n )\n ) {\n let point = $getTransformedPoint(\n delta,\n { row: this.row, column: this.column },\n this.$insertRight\n );\n this.setPosition(point.row, point.column, !0);\n }\n }),\n (this.setPosition = function (row, column, noClip) {\n let pos;\n if (\n ((pos = noClip\n ? { row: row, column: column }\n : this.$clipPositionToDocument(row, column)),\n this.row != pos.row || this.column != pos.column)\n ) {\n let old = { row: this.row, column: this.column };\n (this.row = pos.row),\n (this.column = pos.column),\n this._signal('change', { old: old, value: pos });\n }\n }),\n (this.detach = function () {\n this.document.removeEventListener('change', this.$onChange);\n }),\n (this.attach = function (doc) {\n (this.document = doc || this.document),\n this.document.on('change', this.$onChange);\n }),\n (this.$clipPositionToDocument = function (row, column) {\n let pos = {};\n return (\n row >= this.document.getLength()\n ? ((pos.row = Math.max(0, this.document.getLength() - 1)),\n (pos.column = this.document.getLine(pos.row).length))\n : 0 > row\n ? ((pos.row = 0), (pos.column = 0))\n : ((pos.row = row),\n (pos.column = Math.min(\n this.document.getLine(pos.row).length,\n Math.max(0, column)\n ))),\n 0 > column && (pos.column = 0),\n pos\n );\n });\n }.call(Anchor.prototype));\n }\n),\nace.define(\n 'ace/document',\n [\n 'require',\n 'exports',\n 'module',\n 'ace/lib/oop',\n 'ace/apply_delta',\n 'ace/lib/event_emitter',\n 'ace/range',\n 'ace/anchor',\n ],\n function (acequire, exports) {\n let oop = acequire('./lib/oop'),\n applyDelta = acequire('./apply_delta').applyDelta,\n EventEmitter = acequire('./lib/event_emitter').EventEmitter,\n Range = acequire('./range').Range,\n Anchor = acequire('./anchor').Anchor,\n Document = function (textOrLines) {\n (this.$lines = ['']),\n 0 === textOrLines.length\n ? (this.$lines = [''])\n : Array.isArray(textOrLines)\n ? this.insertMergedLines({ row: 0, column: 0 }, textOrLines)\n : this.insert({ row: 0, column: 0 }, textOrLines);\n };\n (function () {\n oop.implement(this, EventEmitter),\n (this.setValue = function (text) {\n let len = this.getLength() - 1;\n this.remove(new Range(0, 0, len, this.getLine(len).length)),\n this.insert({ row: 0, column: 0 }, text);\n }),\n (this.getValue = function () {\n return this.getAllLines().join(this.getNewLineCharacter());\n }),\n (this.createAnchor = function (row, column) {\n return new Anchor(this, row, column);\n }),\n (this.$split =\n 0 === 'aaa'.split(/a/).length\n ? function (text) {\n return text.replace(/\\r\\n|\\r/g, '\\n').split('\\n');\n }\n : function (text) {\n return text.split(/\\r\\n|\\r|\\n/);\n }),\n (this.$detectNewLine = function (text) {\n let match = text.match(/^.*?(\\r\\n|\\r|\\n)/m);\n (this.$autoNewLine = match ? match[1] : '\\n'),\n this._signal('changeNewLineMode');\n }),\n (this.getNewLineCharacter = function () {\n switch (this.$newLineMode) {\n case 'windows':\n return '\\r\\n';\n case 'unix':\n return '\\n';\n default:\n return this.$autoNewLine || '\\n';\n }\n }),\n (this.$autoNewLine = ''),\n (this.$newLineMode = 'auto'),\n (this.setNewLineMode = function (newLineMode) {\n this.$newLineMode !== newLineMode &&\n ((this.$newLineMode = newLineMode),\n this._signal('changeNewLineMode'));\n }),\n (this.getNewLineMode = function () {\n return this.$newLineMode;\n }),\n (this.isNewLine = function (text) {\n return '\\r\\n' == text || '\\r' == text || '\\n' == text;\n }),\n (this.getLine = function (row) {\n return this.$lines[row] || '';\n }),\n (this.getLines = function (firstRow, lastRow) {\n return this.$lines.slice(firstRow, lastRow + 1);\n }),\n (this.getAllLines = function () {\n return this.getLines(0, this.getLength());\n }),\n (this.getLength = function () {\n return this.$lines.length;\n }),\n (this.getTextRange = function (range) {\n return this.getLinesForRange(range).join(\n this.getNewLineCharacter()\n );\n }),\n (this.getLinesForRange = function (range) {\n let lines;\n if (range.start.row === range.end.row)\n {lines = [\n this.getLine(range.start.row).substring(\n range.start.column,\n range.end.column\n ),\n ];}\n else {\n (lines = this.getLines(range.start.row, range.end.row)),\n (lines[0] = (lines[0] || '').substring(range.start.column));\n let l = lines.length - 1;\n range.end.row - range.start.row == l &&\n (lines[l] = lines[l].substring(0, range.end.column));\n }\n return lines;\n }),\n (this.insertLines = function (row, lines) {\n return (\n console.warn(\n 'Use of document.insertLines is deprecated. Use the insertFullLines method instead.'\n ),\n this.insertFullLines(row, lines)\n );\n }),\n (this.removeLines = function (firstRow, lastRow) {\n return (\n console.warn(\n 'Use of document.removeLines is deprecated. Use the removeFullLines method instead.'\n ),\n this.removeFullLines(firstRow, lastRow)\n );\n }),\n (this.insertNewLine = function (position) {\n return (\n console.warn(\n 'Use of document.insertNewLine is deprecated. Use insertMergedLines(position, [\\'\\', \\'\\']) instead.'\n ),\n this.insertMergedLines(position, ['', ''])\n );\n }),\n (this.insert = function (position, text) {\n return (\n 1 >= this.getLength() && this.$detectNewLine(text),\n this.insertMergedLines(position, this.$split(text))\n );\n }),\n (this.insertInLine = function (position, text) {\n let start = this.clippedPos(position.row, position.column),\n end = this.pos(position.row, position.column + text.length);\n return (\n this.applyDelta(\n { start: start, end: end, action: 'insert', lines: [text] },\n !0\n ),\n this.clonePos(end)\n );\n }),\n (this.clippedPos = function (row, column) {\n let length = this.getLength();\n void 0 === row\n ? (row = length)\n : 0 > row\n ? (row = 0)\n : row >= length && ((row = length - 1), (column = void 0));\n let line = this.getLine(row);\n return (\n void 0 == column && (column = line.length),\n (column = Math.min(Math.max(column, 0), line.length)),\n { row: row, column: column }\n );\n }),\n (this.clonePos = function (pos) {\n return { row: pos.row, column: pos.column };\n }),\n (this.pos = function (row, column) {\n return { row: row, column: column };\n }),\n (this.$clipPosition = function (position) {\n let length = this.getLength();\n return (\n position.row >= length\n ? ((position.row = Math.max(0, length - 1)),\n (position.column = this.getLine(length - 1).length))\n : ((position.row = Math.max(0, position.row)),\n (position.column = Math.min(\n Math.max(position.column, 0),\n this.getLine(position.row).length\n ))),\n position\n );\n }),\n (this.insertFullLines = function (row, lines) {\n row = Math.min(Math.max(row, 0), this.getLength());\n let column = 0;\n this.getLength() > row\n ? ((lines = lines.concat([''])), (column = 0))\n : ((lines = [''].concat(lines)),\n row--,\n (column = this.$lines[row].length)),\n this.insertMergedLines({ row: row, column: column }, lines);\n }),\n (this.insertMergedLines = function (position, lines) {\n let start = this.clippedPos(position.row, position.column),\n end = {\n row: start.row + lines.length - 1,\n column:\n (1 == lines.length ? start.column : 0) +\n lines[lines.length - 1].length,\n };\n return (\n this.applyDelta({\n start: start,\n end: end,\n action: 'insert',\n lines: lines,\n }),\n this.clonePos(end)\n );\n }),\n (this.remove = function (range) {\n let start = this.clippedPos(range.start.row, range.start.column),\n end = this.clippedPos(range.end.row, range.end.column);\n return (\n this.applyDelta({\n start: start,\n end: end,\n action: 'remove',\n lines: this.getLinesForRange({ start: start, end: end }),\n }),\n this.clonePos(start)\n );\n }),\n (this.removeInLine = function (row, startColumn, endColumn) {\n let start = this.clippedPos(row, startColumn),\n end = this.clippedPos(row, endColumn);\n return (\n this.applyDelta(\n {\n start: start,\n end: end,\n action: 'remove',\n lines: this.getLinesForRange({ start: start, end: end }),\n },\n !0\n ),\n this.clonePos(start)\n );\n }),\n (this.removeFullLines = function (firstRow, lastRow) {\n (firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1)),\n (lastRow = Math.min(Math.max(0, lastRow), this.getLength() - 1));\n let deleteFirstNewLine =\n lastRow == this.getLength() - 1 && firstRow > 0,\n deleteLastNewLine = this.getLength() - 1 > lastRow,\n startRow = deleteFirstNewLine ? firstRow - 1 : firstRow,\n startCol = deleteFirstNewLine ? this.getLine(startRow).length : 0,\n endRow = deleteLastNewLine ? lastRow + 1 : lastRow,\n endCol = deleteLastNewLine ? 0 : this.getLine(endRow).length,\n range = new Range(startRow, startCol, endRow, endCol),\n deletedLines = this.$lines.slice(firstRow, lastRow + 1);\n return (\n this.applyDelta({\n start: range.start,\n end: range.end,\n action: 'remove',\n lines: this.getLinesForRange(range),\n }),\n deletedLines\n );\n }),\n (this.removeNewLine = function (row) {\n this.getLength() - 1 > row &&\n row >= 0 &&\n this.applyDelta({\n start: this.pos(row, this.getLine(row).length),\n end: this.pos(row + 1, 0),\n action: 'remove',\n lines: ['', ''],\n });\n }),\n (this.replace = function (range, text) {\n if (\n (range instanceof Range ||\n (range = Range.fromPoints(range.start, range.end)),\n 0 === text.length && range.isEmpty())\n )\n {return range.start;}\n if (text == this.getTextRange(range)) return range.end;\n this.remove(range);\n let end;\n return (end = text ? this.insert(range.start, text) : range.start);\n }),\n (this.applyDeltas = function (deltas) {\n for (let i = 0; deltas.length > i; i++) this.applyDelta(deltas[i]);\n }),\n (this.revertDeltas = function (deltas) {\n for (let i = deltas.length - 1; i >= 0; i--)\n {this.revertDelta(deltas[i]);}\n }),\n (this.applyDelta = function (delta, doNotValidate) {\n let isInsert = 'insert' == delta.action;\n (isInsert\n ? 1 >= delta.lines.length && !delta.lines[0]\n : !Range.comparePoints(delta.start, delta.end)) ||\n (isInsert &&\n delta.lines.length > 2e4 &&\n this.$splitAndapplyLargeDelta(delta, 2e4),\n applyDelta(this.$lines, delta, doNotValidate),\n this._signal('change', delta));\n }),\n (this.$splitAndapplyLargeDelta = function (delta, MAX) {\n for (\n let lines = delta.lines,\n l = lines.length,\n row = delta.start.row,\n column = delta.start.column,\n from = 0,\n to = 0;\n ;\n\n ) {\n (from = to), (to += MAX - 1);\n let chunk = lines.slice(from, to);\n if (to > l) {\n (delta.lines = chunk),\n (delta.start.row = row + from),\n (delta.start.column = column);\n break;\n }\n chunk.push(''),\n this.applyDelta(\n {\n start: this.pos(row + from, column),\n end: this.pos(row + to, (column = 0)),\n action: delta.action,\n lines: chunk,\n },\n !0\n );\n }\n }),\n (this.revertDelta = function (delta) {\n this.applyDelta({\n start: this.clonePos(delta.start),\n end: this.clonePos(delta.end),\n action: 'insert' == delta.action ? 'remove' : 'insert',\n lines: delta.lines.slice(),\n });\n }),\n (this.indexToPosition = function (index, startRow) {\n for (\n var lines = this.$lines || this.getAllLines(),\n newlineLength = this.getNewLineCharacter().length,\n i = startRow || 0,\n l = lines.length;\n l > i;\n i++\n )\n {if (((index -= lines[i].length + newlineLength), 0 > index))\n return {\n row: i,\n column: index + lines[i].length + newlineLength,\n };}\n return { row: l - 1, column: lines[l - 1].length };\n }),\n (this.positionToIndex = function (pos, startRow) {\n for (\n var lines = this.$lines || this.getAllLines(),\n newlineLength = this.getNewLineCharacter().length,\n index = 0,\n row = Math.min(pos.row, lines.length),\n i = startRow || 0;\n row > i;\n ++i\n )\n {index += lines[i].length + newlineLength;}\n return index + pos.column;\n });\n }.call(Document.prototype),\n (exports.Document = Document));\n }\n),\nace.define('ace/lib/lang', ['require', 'exports', 'module'], function (\n acequire,\n exports\n) {\n (exports.last = function (a) {\n return a[a.length - 1];\n }),\n (exports.stringReverse = function (string) {\n return string\n .split('')\n .reverse()\n .join('');\n }),\n (exports.stringRepeat = function (string, count) {\n for (var result = ''; count > 0;)\n {1 & count && (result += string), (count >>= 1) && (string += string);}\n return result;\n });\n let trimBeginRegexp = /^\\s\\s*/,\n trimEndRegexp = /\\s\\s*$/;\n (exports.stringTrimLeft = function (string) {\n return string.replace(trimBeginRegexp, '');\n }),\n (exports.stringTrimRight = function (string) {\n return string.replace(trimEndRegexp, '');\n }),\n (exports.copyObject = function (obj) {\n let copy = {};\n for (let key in obj) copy[key] = obj[key];\n return copy;\n }),\n (exports.copyArray = function (array) {\n for (var copy = [], i = 0, l = array.length; l > i; i++)\n {copy[i] =\n array[i] && 'object' == typeof array[i]\n ? this.copyObject(array[i])\n : array[i];}\n return copy;\n }),\n (exports.deepCopy = function deepCopy(obj) {\n if ('object' !== typeof obj || !obj) return obj;\n let copy;\n if (Array.isArray(obj)) {\n copy = [];\n for (var key = 0; obj.length > key; key++)\n {copy[key] = deepCopy(obj[key]);}\n return copy;\n }\n if ('[object Object]' !== Object.prototype.toString.call(obj))\n {return obj;}\n copy = {};\n for (var key in obj) copy[key] = deepCopy(obj[key]);\n return copy;\n }),\n (exports.arrayToMap = function (arr) {\n for (var map = {}, i = 0; arr.length > i; i++) map[arr[i]] = 1;\n return map;\n }),\n (exports.createMap = function (props) {\n let map = Object.create(null);\n for (let i in props) map[i] = props[i];\n return map;\n }),\n (exports.arrayRemove = function (array, value) {\n for (let i = 0; array.length >= i; i++)\n {value === array[i] && array.splice(i, 1);}\n }),\n (exports.escapeRegExp = function (str) {\n return str.replace(/([.*+?^${}()|[\\]\\/\\\\])/g, '\\\\$1');\n }),\n (exports.escapeHTML = function (str) {\n return str\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(/ i; i += 2) {\n if (Array.isArray(data[i + 1]))\n var d = {\n action: 'insert',\n start: data[i],\n lines: data[i + 1],\n };\n else\n var d = {\n action: 'remove',\n start: data[i],\n end: data[i + 1],\n };\n doc.applyDelta(d, !0);\n }}\n return _self.$timeout\n ? deferredUpdate.schedule(_self.$timeout)\n : (_self.onUpdate(), void 0);\n });\n });\n (function () {\n (this.$timeout = 500),\n (this.setTimeout = function (timeout) {\n this.$timeout = timeout;\n }),\n (this.setValue = function (value) {\n this.doc.setValue(value),\n this.deferredUpdate.schedule(this.$timeout);\n }),\n (this.getValue = function (callbackId) {\n this.sender.callback(this.doc.getValue(), callbackId);\n }),\n (this.onUpdate = function () {}),\n (this.isPending = function () {\n return this.deferredUpdate.isPending();\n });\n }.call(Mirror.prototype));\n }\n),\nace.define('ace/lib/es5-shim', ['require', 'exports', 'module'], function () {\n function Empty() {}\n function doesDefinePropertyWork(object) {\n try {\n return (\n Object.defineProperty(object, 'sentinel', {}), 'sentinel' in object\n );\n } catch (exception) {}\n }\n function toInteger(n) {\n return (\n (n = +n),\n n !== n\n ? (n = 0)\n : 0 !== n &&\n n !== 1 / 0 &&\n n !== -(1 / 0) &&\n (n = (n > 0 || -1) * Math.floor(Math.abs(n))),\n n\n );\n }\n Function.prototype.bind ||\n (Function.prototype.bind = function (that) {\n let target = this;\n if ('function' !== typeof target)\n {throw new TypeError(\n 'Function.prototype.bind called on incompatible ' + target\n );}\n var args = slice.call(arguments, 1),\n bound = function () {\n if (this instanceof bound) {\n let result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n return Object(result) === result ? result : this;\n }\n return target.apply(that, args.concat(slice.call(arguments)));\n };\n return (\n target.prototype &&\n ((Empty.prototype = target.prototype),\n (bound.prototype = new Empty()),\n (Empty.prototype = null)),\n bound\n );\n });\n var defineGetter,\n defineSetter,\n lookupGetter,\n lookupSetter,\n supportsAccessors,\n call = Function.prototype.call,\n prototypeOfArray = Array.prototype,\n prototypeOfObject = Object.prototype,\n slice = prototypeOfArray.slice,\n _toString = call.bind(prototypeOfObject.toString),\n owns = call.bind(prototypeOfObject.hasOwnProperty);\n if (\n ((supportsAccessors = owns(prototypeOfObject, '__defineGetter__')) &&\n ((defineGetter = call.bind(prototypeOfObject.__defineGetter__)),\n (defineSetter = call.bind(prototypeOfObject.__defineSetter__)),\n (lookupGetter = call.bind(prototypeOfObject.__lookupGetter__)),\n (lookupSetter = call.bind(prototypeOfObject.__lookupSetter__))),\n 2 != [1, 2].splice(0).length)\n )\n {if (\n (function() {\n function makeArray(l) {\n var a = Array(l + 2);\n return (a[0] = a[1] = 0), a;\n }\n var lengthBefore,\n array = [];\n return (\n array.splice.apply(array, makeArray(20)),\n array.splice.apply(array, makeArray(26)),\n (lengthBefore = array.length),\n array.splice(5, 0, 'XXX'),\n lengthBefore + 1 == array.length,\n lengthBefore + 1 == array.length ? !0 : void 0\n );\n })()\n ) {\n var array_splice = Array.prototype.splice;\n Array.prototype.splice = function(start, deleteCount) {\n return arguments.length\n ? array_splice.apply(\n this,\n [\n void 0 === start ? 0 : start,\n void 0 === deleteCount ? this.length - start : deleteCount,\n ].concat(slice.call(arguments, 2))\n )\n : [];\n };\n } else\n Array.prototype.splice = function(pos, removeCount) {\n var length = this.length;\n pos > 0\n ? pos > length && (pos = length)\n : void 0 == pos\n ? (pos = 0)\n : 0 > pos && (pos = Math.max(length + pos, 0)),\n length > pos + removeCount || (removeCount = length - pos);\n var removed = this.slice(pos, pos + removeCount),\n insert = slice.call(arguments, 2),\n add = insert.length;\n if (pos === length) add && this.push.apply(this, insert);\n else {\n var remove = Math.min(removeCount, length - pos),\n tailOldPos = pos + remove,\n tailNewPos = tailOldPos + add - remove,\n tailCount = length - tailOldPos,\n lengthAfterRemove = length - remove;\n if (tailOldPos > tailNewPos)\n for (var i = 0; tailCount > i; ++i)\n this[tailNewPos + i] = this[tailOldPos + i];\n else if (tailNewPos > tailOldPos)\n for (i = tailCount; i--; )\n this[tailNewPos + i] = this[tailOldPos + i];\n if (add && pos === lengthAfterRemove)\n (this.length = lengthAfterRemove), this.push.apply(this, insert);\n else\n for (this.length = lengthAfterRemove + add, i = 0; add > i; ++i)\n this[pos + i] = insert[i];\n }\n return removed;\n };}\n Array.isArray ||\n (Array.isArray = function (obj) {\n return '[object Array]' == _toString(obj);\n });\n let boxedString = Object('a'),\n splitString = 'a' != boxedString[0] || !(0 in boxedString);\n if (\n (Array.prototype.forEach ||\n (Array.prototype.forEach = function (fun) {\n let object = toObject(this),\n self =\n splitString && '[object String]' == _toString(this)\n ? this.split('')\n : object,\n thisp = arguments[1],\n i = -1,\n length = self.length >>> 0;\n if ('[object Function]' != _toString(fun)) throw new TypeError();\n for (; length > ++i;)\n {i in self && fun.call(thisp, self[i], i, object);}\n }),\n Array.prototype.map ||\n (Array.prototype.map = function (fun) {\n let object = toObject(this),\n self =\n splitString && '[object String]' == _toString(this)\n ? this.split('')\n : object,\n length = self.length >>> 0,\n result = Array(length),\n thisp = arguments[1];\n if ('[object Function]' != _toString(fun))\n {throw new TypeError(fun + ' is not a function');}\n for (let i = 0; length > i; i++)\n {i in self && (result[i] = fun.call(thisp, self[i], i, object));}\n return result;\n }),\n Array.prototype.filter ||\n (Array.prototype.filter = function (fun) {\n let value,\n object = toObject(this),\n self =\n splitString && '[object String]' == _toString(this)\n ? this.split('')\n : object,\n length = self.length >>> 0,\n result = [],\n thisp = arguments[1];\n if ('[object Function]' != _toString(fun))\n {throw new TypeError(fun + ' is not a function');}\n for (let i = 0; length > i; i++)\n {i in self &&\n ((value = self[i]),\n fun.call(thisp, value, i, object) && result.push(value));}\n return result;\n }),\n Array.prototype.every ||\n (Array.prototype.every = function (fun) {\n let object = toObject(this),\n self =\n splitString && '[object String]' == _toString(this)\n ? this.split('')\n : object,\n length = self.length >>> 0,\n thisp = arguments[1];\n if ('[object Function]' != _toString(fun))\n {throw new TypeError(fun + ' is not a function');}\n for (let i = 0; length > i; i++)\n {if (i in self && !fun.call(thisp, self[i], i, object)) return !1;}\n return !0;\n }),\n Array.prototype.some ||\n (Array.prototype.some = function (fun) {\n let object = toObject(this),\n self =\n splitString && '[object String]' == _toString(this)\n ? this.split('')\n : object,\n length = self.length >>> 0,\n thisp = arguments[1];\n if ('[object Function]' != _toString(fun))\n {throw new TypeError(fun + ' is not a function');}\n for (let i = 0; length > i; i++)\n {if (i in self && fun.call(thisp, self[i], i, object)) return !0;}\n return !1;\n }),\n Array.prototype.reduce ||\n (Array.prototype.reduce = function (fun) {\n let object = toObject(this),\n self =\n splitString && '[object String]' == _toString(this)\n ? this.split('')\n : object,\n length = self.length >>> 0;\n if ('[object Function]' != _toString(fun))\n {throw new TypeError(fun + ' is not a function');}\n if (!length && 1 == arguments.length)\n {throw new TypeError('reduce of empty array with no initial value');}\n let result,\n i = 0;\n if (arguments.length >= 2) result = arguments[1];\n else\n {for (;;) {\n if (i in self) {\n result = self[i++];\n break;\n }\n if (++i >= length)\n throw new TypeError(\n 'reduce of empty array with no initial value'\n );\n }}\n for (; length > i; i++)\n {i in self &&\n (result = fun.call(void 0, result, self[i], i, object));}\n return result;\n }),\n Array.prototype.reduceRight ||\n (Array.prototype.reduceRight = function (fun) {\n let object = toObject(this),\n self =\n splitString && '[object String]' == _toString(this)\n ? this.split('')\n : object,\n length = self.length >>> 0;\n if ('[object Function]' != _toString(fun))\n {throw new TypeError(fun + ' is not a function');}\n if (!length && 1 == arguments.length)\n {throw new TypeError(\n 'reduceRight of empty array with no initial value'\n );}\n let result,\n i = length - 1;\n if (arguments.length >= 2) result = arguments[1];\n else\n {for (;;) {\n if (i in self) {\n result = self[i--];\n break;\n }\n if (0 > --i)\n throw new TypeError(\n 'reduceRight of empty array with no initial value'\n );\n }}\n do\n {i in this &&\n (result = fun.call(void 0, result, self[i], i, object));}\n while (i--);\n return result;\n }),\n (Array.prototype.indexOf && -1 == [0, 1].indexOf(1, 2)) ||\n (Array.prototype.indexOf = function (sought) {\n let self =\n splitString && '[object String]' == _toString(this)\n ? this.split('')\n : toObject(this),\n length = self.length >>> 0;\n if (!length) return -1;\n let i = 0;\n for (\n arguments.length > 1 && (i = toInteger(arguments[1])),\n i = i >= 0 ? i : Math.max(0, length + i);\n length > i;\n i++\n )\n {if (i in self && self[i] === sought) return i;}\n return -1;\n }),\n (Array.prototype.lastIndexOf && -1 == [0, 1].lastIndexOf(0, -3)) ||\n (Array.prototype.lastIndexOf = function (sought) {\n let self =\n splitString && '[object String]' == _toString(this)\n ? this.split('')\n : toObject(this),\n length = self.length >>> 0;\n if (!length) return -1;\n let i = length - 1;\n for (\n arguments.length > 1 && (i = Math.min(i, toInteger(arguments[1]))),\n i = i >= 0 ? i : length - Math.abs(i);\n i >= 0;\n i--\n )\n {if (i in self && sought === self[i]) return i;}\n return -1;\n }),\n Object.getPrototypeOf ||\n (Object.getPrototypeOf = function (object) {\n return (\n object.__proto__ ||\n (object.constructor\n ? object.constructor.prototype\n : prototypeOfObject)\n );\n }),\n !Object.getOwnPropertyDescriptor)\n ) {\n let ERR_NON_OBJECT =\n 'Object.getOwnPropertyDescriptor called on a non-object: ';\n Object.getOwnPropertyDescriptor = function (object, property) {\n if (\n ('object' !== typeof object && 'function' !== typeof object) ||\n null === object\n )\n {throw new TypeError(ERR_NON_OBJECT + object);}\n if (owns(object, property)) {\n var descriptor, getter, setter;\n if (\n ((descriptor = { enumerable: !0, configurable: !0 }),\n supportsAccessors)\n ) {\n let prototype = object.__proto__;\n object.__proto__ = prototypeOfObject;\n var getter = lookupGetter(object, property),\n setter = lookupSetter(object, property);\n if (((object.__proto__ = prototype), getter || setter))\n {return (\n getter && (descriptor.get = getter),\n setter && (descriptor.set = setter),\n descriptor\n );}\n }\n return (descriptor.value = object[property]), descriptor;\n }\n };\n }\n if (\n (Object.getOwnPropertyNames ||\n (Object.getOwnPropertyNames = function (object) {\n return Object.keys(object);\n }),\n !Object.create)\n ) {\n let createEmpty;\n (createEmpty =\n null === Object.prototype.__proto__\n ? function () {\n return { __proto__: null };\n }\n : function () {\n let empty = {};\n for (let i in empty) empty[i] = null;\n return (\n (empty.constructor = empty.hasOwnProperty = empty.propertyIsEnumerable = empty.isPrototypeOf = empty.toLocaleString = empty.toString = empty.valueOf = empty.__proto__ = null),\n empty\n );\n }),\n (Object.create = function (prototype, properties) {\n let object;\n if (null === prototype) object = createEmpty();\n else {\n if ('object' !== typeof prototype)\n {throw new TypeError(\n 'typeof prototype[' + typeof prototype + \"] != 'object'\"\n );}\n let Type = function () {};\n (Type.prototype = prototype),\n (object = new Type()),\n (object.__proto__ = prototype);\n }\n return (\n void 0 !== properties &&\n Object.defineProperties(object, properties),\n object\n );\n });\n }\n if (Object.defineProperty) {\n let definePropertyWorksOnObject = doesDefinePropertyWork({}),\n definePropertyWorksOnDom =\n 'undefined' === typeof document ||\n doesDefinePropertyWork(document.createElement('div'));\n if (!definePropertyWorksOnObject || !definePropertyWorksOnDom)\n {var definePropertyFallback = Object.defineProperty;}\n }\n if (!Object.defineProperty || definePropertyFallback) {\n let ERR_NON_OBJECT_DESCRIPTOR =\n 'Property description must be an object: ',\n ERR_NON_OBJECT_TARGET = 'Object.defineProperty called on non-object: ',\n ERR_ACCESSORS_NOT_SUPPORTED =\n 'getters & setters can not be defined on this javascript engine';\n Object.defineProperty = function (object, property, descriptor) {\n if (\n ('object' !== typeof object && 'function' !== typeof object) ||\n null === object\n )\n {throw new TypeError(ERR_NON_OBJECT_TARGET + object);}\n if (\n ('object' !== typeof descriptor && 'function' !== typeof descriptor) ||\n null === descriptor\n )\n {throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);}\n if (definePropertyFallback)\n {try {\n return definePropertyFallback.call(\n Object,\n object,\n property,\n descriptor\n );\n } catch (exception) {}}\n if (owns(descriptor, 'value'))\n {if (\n supportsAccessors &&\n (lookupGetter(object, property) || lookupSetter(object, property))\n ) {\n var prototype = object.__proto__;\n (object.__proto__ = prototypeOfObject),\n delete object[property],\n (object[property] = descriptor.value),\n (object.__proto__ = prototype);\n } else object[property] = descriptor.value;}\n else {\n if (!supportsAccessors)\n {throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);}\n owns(descriptor, 'get') &&\n defineGetter(object, property, descriptor.get),\n owns(descriptor, 'set') &&\n defineSetter(object, property, descriptor.set);\n }\n return object;\n };\n }\n Object.defineProperties ||\n (Object.defineProperties = function (object, properties) {\n for (let property in properties)\n {owns(properties, property) &&\n Object.defineProperty(object, property, properties[property]);}\n return object;\n }),\n Object.seal ||\n (Object.seal = function (object) {\n return object;\n }),\n Object.freeze ||\n (Object.freeze = function (object) {\n return object;\n });\n try {\n Object.freeze(function () {});\n } catch (exception) {\n Object.freeze = (function (freezeObject) {\n return function (object) {\n return 'function' === typeof object ? object : freezeObject(object);\n };\n }(Object.freeze));\n }\n if (\n (Object.preventExtensions ||\n (Object.preventExtensions = function (object) {\n return object;\n }),\n Object.isSealed ||\n (Object.isSealed = function () {\n return !1;\n }),\n Object.isFrozen ||\n (Object.isFrozen = function () {\n return !1;\n }),\n Object.isExtensible ||\n (Object.isExtensible = function (object) {\n if (Object(object) === object) throw new TypeError();\n for (var name = ''; owns(object, name);) name += '?';\n object[name] = !0;\n let returnValue = owns(object, name);\n return delete object[name], returnValue;\n }),\n !Object.keys)\n ) {\n let hasDontEnumBug = !0,\n dontEnums = [\n 'toString',\n 'toLocaleString',\n 'valueOf',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'constructor',\n ],\n dontEnumsLength = dontEnums.length;\n for (let key in { toString: null }) hasDontEnumBug = !1;\n Object.keys = function (object) {\n if (\n ('object' !== typeof object && 'function' !== typeof object) ||\n null === object\n )\n {throw new TypeError('Object.keys called on a non-object');}\n let keys = [];\n for (let name in object) owns(object, name) && keys.push(name);\n if (hasDontEnumBug)\n {for (var i = 0, ii = dontEnumsLength; ii > i; i++) {\n var dontEnum = dontEnums[i];\n owns(object, dontEnum) && keys.push(dontEnum);\n }}\n return keys;\n };\n }\n Date.now ||\n (Date.now = function () {\n return new Date().getTime();\n });\n let ws = '\t\\nv\\f\\r   ᠎              \\u2028\\u2029\ufeff';\n if (!String.prototype.trim || ws.trim()) {\n ws = '[' + ws + ']';\n let trimBeginRegexp = RegExp('^' + ws + ws + '*'),\n trimEndRegexp = RegExp(ws + ws + '*$');\n String.prototype.trim = function () {\n return (this + '')\n .replace(trimBeginRegexp, '')\n .replace(trimEndRegexp, '');\n };\n }\n var toObject = function (o) {\n if (null == o) throw new TypeError('can\\'t convert ' + o + ' to object');\n return Object(o);\n };\n});\nace.define(\n 'sense_editor/mode/worker_parser',\n ['require', 'exports', 'module'],\n function () {\n let at, // The index of the current character\n ch, // The current character\n annos, // annotations\n escapee = {\n '\"': '\"',\n '\\\\': '\\\\',\n '/': '/',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t',\n },\n text,\n annotate = function (type, text) {\n annos.push({ type: type, text: text, at: at });\n },\n error = function (m) {\n throw {\n name: 'SyntaxError',\n message: m,\n at: at,\n text: text,\n };\n },\n reset = function (newAt) {\n ch = text.charAt(newAt);\n at = newAt + 1;\n },\n next = function (c) {\n if (c && c !== ch) {\n error('Expected \\'' + c + '\\' instead of \\'' + ch + '\\'');\n }\n\n ch = text.charAt(at);\n at += 1;\n return ch;\n },\n nextUpTo = function (upTo, errorMessage) {\n let currentAt = at,\n i = text.indexOf(upTo, currentAt);\n if (i < 0) {\n error(errorMessage || 'Expected \\'' + upTo + '\\'');\n }\n reset(i + upTo.length);\n return text.substring(currentAt, i);\n },\n peek = function (offset) {\n return text.charAt(at + offset);\n },\n number = function () {\n let number,\n string = '';\n\n if (ch === '-') {\n string = '-';\n next('-');\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n if (ch === '.') {\n string += '.';\n while (next() && ch >= '0' && ch <= '9') {\n string += ch;\n }\n }\n if (ch === 'e' || ch === 'E') {\n string += ch;\n next();\n if (ch === '-' || ch === '+') {\n string += ch;\n next();\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n }\n number = +string;\n if (isNaN(number)) {\n error('Bad number');\n } else {\n return number;\n }\n },\n string = function () {\n let hex,\n i,\n string = '',\n uffff;\n\n if (ch === '\"') {\n // If the current and the next characters are equal to \"\", empty string or start of triple quoted strings\n if (peek(0) === '\"' && peek(1) === '\"') {\n // literal\n next('\"');\n next('\"');\n return nextUpTo('\"\"\"', 'failed to find closing \\'\"\"\"\\'');\n } else {\n while (next()) {\n if (ch === '\"') {\n next();\n return string;\n } else if (ch === '\\\\') {\n next();\n if (ch === 'u') {\n uffff = 0;\n for (i = 0; i < 4; i += 1) {\n hex = parseInt(next(), 16);\n if (!isFinite(hex)) {\n break;\n }\n uffff = uffff * 16 + hex;\n }\n string += String.fromCharCode(uffff);\n } else if (typeof escapee[ch] === 'string') {\n string += escapee[ch];\n } else {\n break;\n }\n } else {\n string += ch;\n }\n }\n }\n }\n error('Bad string');\n },\n white = function () {\n while (ch) {\n // Skip whitespace.\n while (ch && ch <= ' ') {\n next();\n }\n // if the current char in iteration is '#' or the char and the next char is equal to '//'\n // we are on the single line comment\n if (ch === '#' || ch === '/' && peek(0) === '/') {\n // Until we are on the new line, skip to the next char\n while (ch && ch !== '\\n') {\n next();\n }\n } else if (ch === '/' && peek(0) === '*') {\n // If the chars starts with '/*', we are on the multiline comment\n next();\n next();\n while (ch && !(ch === '*' && peek(0) === '/')) {\n // Until we have closing tags '*/', skip to the next char\n next();\n }\n if (ch) {\n next();\n next();\n }\n } else break;\n }\n },\n strictWhite = function () {\n while (ch && (ch == ' ' || ch == '\\t')) {\n next();\n }\n },\n newLine = function () {\n if (ch == '\\n') next();\n },\n word = function () {\n switch (ch) {\n case 't':\n next('t');\n next('r');\n next('u');\n next('e');\n return true;\n case 'f':\n next('f');\n next('a');\n next('l');\n next('s');\n next('e');\n return false;\n case 'n':\n next('n');\n next('u');\n next('l');\n next('l');\n return null;\n }\n error('Unexpected \\'' + ch + '\\'');\n },\n // parses and returns the method\n method = function () {\n switch (ch) {\n case 'g':\n next('g');\n next('e');\n next('t');\n return 'get';\n case 'G':\n next('G');\n next('E');\n next('T');\n return 'GET';\n case 'h':\n next('h');\n next('e');\n next('a');\n next('d');\n return 'head';\n case 'H':\n next('H');\n next('E');\n next('A');\n next('D');\n return 'HEAD';\n case 'd':\n next('d');\n next('e');\n next('l');\n next('e');\n next('t');\n next('e');\n return 'delete';\n case 'D':\n next('D');\n next('E');\n next('L');\n next('E');\n next('T');\n next('E');\n return 'DELETE';\n case 'p':\n next('p');\n switch (ch) {\n case 'u':\n next('u');\n next('t');\n return 'put';\n case 'o':\n next('o');\n next('s');\n next('t');\n return 'post';\n default:\n error('Unexpected \\'' + ch + '\\'');\n }\n break;\n case 'P':\n next('P');\n switch (ch) {\n case 'U':\n next('U');\n next('T');\n return 'PUT';\n case 'O':\n next('O');\n next('S');\n next('T');\n return 'POST';\n default:\n error('Unexpected \\'' + ch + '\\'');\n }\n break;\n default:\n error('Expected one of GET/POST/PUT/DELETE/HEAD');\n }\n },\n value, // Place holder for the value function.\n array = function () {\n const array = [];\n\n if (ch === '[') {\n next('[');\n white();\n if (ch === ']') {\n next(']');\n return array; // empty array\n }\n while (ch) {\n array.push(value());\n white();\n if (ch === ']') {\n next(']');\n return array;\n }\n next(',');\n white();\n }\n }\n error('Bad array');\n },\n object = function () {\n let key,\n object = {};\n\n if (ch === '{') {\n next('{');\n white();\n if (ch === '}') {\n next('}');\n return object; // empty object\n }\n while (ch) {\n key = string();\n white();\n next(':');\n if (Object.hasOwnProperty.call(object, key)) {\n error('Duplicate key \"' + key + '\"');\n }\n object[key] = value();\n white();\n if (ch === '}') {\n next('}');\n return object;\n }\n next(',');\n white();\n }\n }\n error('Bad object');\n };\n\n value = function () {\n white();\n switch (ch) {\n case '{':\n return object();\n case '[':\n return array();\n case '\"':\n return string();\n case '-':\n return number();\n default:\n return ch >= '0' && ch <= '9' ? number() : word();\n }\n };\n\n let url = function () {\n let url = '';\n while (ch && ch != '\\n') {\n url += ch;\n next();\n }\n if (url == '') {\n error('Missing url');\n }\n return url;\n },\n request = function () {\n white();\n method();\n strictWhite();\n url();\n strictWhite(); // advance to one new line\n newLine();\n strictWhite();\n if (ch == '{') {\n object();\n }\n // multi doc request\n strictWhite(); // advance to one new line\n newLine();\n strictWhite();\n while (ch == '{') {\n // another object\n object();\n strictWhite();\n newLine();\n strictWhite();\n }\n },\n comment = function () {\n while (ch == '#') {\n while (ch && ch !== '\\n') {\n next();\n }\n white();\n }\n },\n multi_request = function () {\n while (ch && ch != '') {\n white();\n if (!ch) {\n continue;\n }\n try {\n comment();\n white();\n if (!ch) {\n continue;\n }\n request();\n white();\n } catch (e) {\n annotate('error', e.message);\n // snap\n const substring = text.substr(at);\n const nextMatch = substring.search(/^POST|HEAD|GET|PUT|DELETE/m);\n if (nextMatch < 1) return;\n reset(at + nextMatch);\n }\n }\n };\n\n return function (source, reviver) {\n let result;\n\n text = source;\n at = 0;\n annos = [];\n next();\n multi_request();\n white();\n if (ch) {\n annotate('error', 'Syntax error');\n }\n\n result = { annotations: annos };\n\n return typeof reviver === 'function'\n ? (function walk(holder, key) {\n let k,\n v,\n value = holder[key];\n if (value && typeof value === 'object') {\n for (k in value) {\n if (Object.hasOwnProperty.call(value, k)) {\n v = walk(value, k);\n if (v !== undefined) {\n value[k] = v;\n } else {\n delete value[k];\n }\n }\n }\n }\n return reviver.call(holder, key, value);\n }({ '': result }, ''))\n : result;\n };\n }\n);\n\nace.define(\n 'sense_editor/mode/worker',\n [\n 'require',\n 'exports',\n 'module',\n 'ace/lib/oop',\n 'ace/worker/mirror',\n 'sense_editor/mode/worker_parser',\n ],\n function (require, exports) {\n const oop = require('ace/lib/oop');\n const Mirror = require('ace/worker/mirror').Mirror;\n const parse = require('sense_editor/mode/worker_parser');\n\n const SenseWorker = (exports.SenseWorker = function (sender) {\n Mirror.call(this, sender);\n this.setTimeout(200);\n });\n\n oop.inherits(SenseWorker, Mirror);\n\n (function () {\n this.id = 'senseWorker';\n this.onUpdate = function () {\n const value = this.doc.getValue();\n let pos, result;\n try {\n result = parse(value);\n } catch (e) {\n pos = this.charToDocumentPosition(e.at - 1);\n this.sender.emit('error', {\n row: pos.row,\n column: pos.column,\n text: e.message,\n type: 'error',\n });\n return;\n }\n for (let i = 0; i < result.annotations.length; i++) {\n pos = this.charToDocumentPosition(result.annotations[i].at - 1);\n result.annotations[i].row = pos.row;\n result.annotations[i].column = pos.column;\n }\n this.sender.emit('ok', result.annotations);\n };\n\n this.charToDocumentPosition = function (charPos) {\n let i = 0;\n const len = this.doc.getLength();\n const nl = this.doc.getNewLineCharacter().length;\n\n if (!len) {\n return { row: 0, column: 0 };\n }\n\n let lineStart = 0,\n line;\n while (i < len) {\n line = this.doc.getLine(i);\n const lineLength = line.length + nl;\n if (lineStart + lineLength > charPos) {\n return {\n row: i,\n column: charPos - lineStart,\n };\n }\n\n lineStart += lineLength;\n i += 1;\n }\n\n return {\n row: i - 1,\n column: line.length,\n };\n };\n }.call(SenseWorker.prototype));\n }\n);\n"},{TextHighlightRules:ee}=Y.a.acequire("ace/mode/text_highlight_rules"),te=Y.a.acequire("ace/lib/oop"),ne=function(){const e=this.createKeywordMapper({keyword:["describe|between|in|like|not|and|or|desc|select|from|where|having|group|by|orderasc|desc|pivot|for|in|as|show|columns|include|frozen|tables|escape|limit|rlike|all|distinct|is","avg|count|first|first_value|last|last_value|max|min|sum|kurtosis|mad|percentile|percentile_rank|skewness|stddev_pop|sum_of_squares|var_pop|histogram|case|coalesce|greatest|ifnull|iif|isnull|least|nullif|nvl|curdate|current_date|current_time|current_timestamp|curtime|dateadd|datediff|datepart|datetrunc|date_add|date_diff|date_part|date_trunc|day|dayname|dayofmonth|dayofweek|dayofyear|day_name|day_of_month|day_of_week|day_of_year|dom|dow|doy|hour|hour_of_day|idow|isodayofweek|isodow|isoweek|isoweekofyear|iso_day_of_week|iso_week_of_year|iw|iwoy|minute|minute_of_day|minute_of_hour|month|monthname|month_name|month_of_year|now|quarter|second|second_of_minute|timestampadd|timestampdiff|timestamp_add|timestamp_diff|today|week|week_of_year|year|abs|acos|asin|atan|atan2|cbrt|ceil|ceiling|cos|cosh|cot|degrees|e|exp|expm1|floor|log|log10|mod|pi|power|radians|rand|random|round|sign|signum|sin|sinh|sqrt|tan|truncate|ascii|bit_length|char|character_length|char_length|concat|insert|lcase|left|length|locate|ltrim|octet_length|position|repeat|replace|right|rtrim|space|substring|ucase|cast|convert|database|user|st_astext|st_aswkt|st_distance|st_geometrytype|st_geomfromtext|st_wkttosql|st_x|st_y|st_z|score","true|false","null|boolean|byte|short|integer|long|double|float|half_float|scaled_float|keyword|text|binary|date|ip|object|nested|time|interval_year|interval_month|interval_day|interval_hour|interval_minute|interval_second|interval_year_to_monthinteval_day_to_hour|interval_day_to_minute|interval_day_to_second|interval_hour_to_minute|interval_hour_to_secondinterval_minute_to_second|geo_point|geo_shape|shape"].join("|")},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"comment",start:"/\\*",end:"\\*/"},{token:"string",regex:'".*?"'},{token:"constant",regex:"'.*?'"},{token:"string",regex:"`.*?`"},{token:"entity.name.function",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"⇐|<⇒|\\*|\\.|\\:\\:|\\+|\\-|\\/|\\/\\/|%|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules()};te.inherits(ne,ee);const re=Y.a.acequire("ace/lib/oop"),{TextHighlightRules:oe}=Y.a.acequire("ace/mode/text_highlight_rules"),ie="def|int|long|byte|String|float|double|char|null|if|else|while|do|for|continue|break|new|try|catch|throw|this|instanceof|return|ctx";function se(){this.name="ScriptHighlightRules",this.$rules={start:[{token:"script.comment",regex:"\\/\\/.*$"},{token:"script.string.regexp",regex:"[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"},{token:"script.string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"script.constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"script.constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"script.constant.language.boolean",regex:"(?:true|false)\\b"},{token:"script.keyword",regex:ie},{token:"script.text",regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"script.keyword.operator",regex:"\\?\\.|\\*\\.|=~|==~|!|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|->|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|typeof|void)"},{token:"script.lparen",regex:"[[({]"},{token:"script.rparen",regex:"[\\])}]"},{token:"script.text",regex:"\\s+"}]}}re.inherits(se,oe),n(34);const{JsonHighlightRules:ae}=Y.a.acequire("ace/mode/json_highlight_rules"),ce=Y.a.acequire("ace/lib/oop"),le=function(e){const t={},n=[{token:["variable","whitespace","ace.punctuation.colon","whitespace","punctuation.start_triple_quote"],regex:'("(?:[^"]*_)?script"|"inline"|"source")(\\s*?)(:)(\\s*?)(""")',next:"script-start",merge:!1,push:!0},{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"punctuation.start_triple_quote",regex:'"""',next:"string_literal",merge:!1,push:!0},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"invalid.illegal",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"invalid.illegal",regex:"\\/\\/.*$"},{token:"paren.lparen",merge:!1,regex:"{",next:e=e||"json",push:!0},{token:"paren.lparen",merge:!1,regex:"[[(]"},{token:"paren.rparen",merge:!1,regex:"[\\])]"},{token:"paren.rparen",regex:"}",merge:!1,next:"pop"},{token:"punctuation.comma",regex:","},{token:"punctuation.colon",regex:":"},{token:"whitespace",regex:"\\s+"},{token:"text",regex:".+?"}];return t[e]=n,t[e+"-sql"]=[{token:["variable","whitespace","ace.punctuation.colon","whitespace","punctuation.start_triple_quote"],regex:'("query")(\\s*?)(:)(\\s*?)(""")',next:"sql-start",merge:!1,push:!0}].concat(n),t.string_literal=[{token:"punctuation.end_triple_quote",regex:'"""',next:"pop"},{token:"multi_string",regex:"."}],t};function ue(){this.$rules={...le("start")},this.embedRules(se,"script-",[{token:"punctuation.end_triple_quote",regex:'"""',next:"pop"}]),this.embedRules(ne,"sql-",[{token:"punctuation.end_triple_quote",regex:'"""',next:"pop"}])}function pe(e,t){e.$rules=Object(y.defaultsDeep)(e.$rules,le(t)),e.embedRules(se,"script-",[{token:"punctuation.end_triple_quote",regex:'"""',next:"pop"}]),e.embedRules(ne,"sql-",[{token:"punctuation.end_triple_quote",regex:'"""',next:"pop"}])}ce.inherits(ue,ae);const de={id:"ace/mode/json_worker",src:'/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0 and the Server Side Public License, v 1; you may not use this file except\n * in compliance with, at your election, the Elastic License 2.0 or the Server\n * Side Public License, v 1.\n */\n\n/* @notice\n *\n * This product includes code that is based on Ace editor, which was available\n * under a "BSD" license.\n *\n * Distributed under the BSD license:\n *\n * Copyright (c) 2010, Ajax.org B.V.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * * Neither the name of Ajax.org B.V. nor the\n * names of its contributors may be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* eslint-disable prettier/prettier,no-var,eqeqeq,no-use-before-define,block-scoped-var,no-undef,\n guard-for-in,one-var,strict,no-redeclare,no-sequences,no-proto,new-cap,no-nested-ternary,no-unused-vars,\n prefer-const,no-empty,no-extend-native,camelcase */\n/*\n This file is loaded up as a blob by Brace to hand to Ace to load as Jsonp\n (hence the redefining of everything). It is based on the json\n mode from the brace distro.\n\n It is very likely that this file will be removed in future but for now it enables\n extended JSON parsing, like e.g. """{}""" (triple quotes)\n*/\n// @internal\n// @ts-nocheck\n"no use strict";\n! function(window) {\n function resolveModuleId(id, paths) {\n for (var testPath = id, tail = ""; testPath;) {\n var alias = paths[testPath];\n if ("string" == typeof alias) return alias + tail;\n if (alias) return alias.location.replace(/\\/*$/, "/") + (tail || alias.main || alias.name);\n if (alias === !1) return "";\n var i = testPath.lastIndexOf("/");\n if (-1 === i) break;\n tail = testPath.substr(i) + tail, testPath = testPath.slice(0, i)\n }\n return id\n }\n if (!(void 0 !== window.window && window.document || window.acequire && window.define)) {\n window.console || (window.console = function() {\n var msgs = Array.prototype.slice.call(arguments, 0);\n postMessage({\n type: "log",\n data: msgs\n })\n }, window.console.error = window.console.warn = window.console.log = window.console.trace = window.console), window.window = window, window.ace = window, window.onerror = function(message, file, line, col, err) {\n postMessage({\n type: "error",\n data: {\n message: message,\n data: err.data,\n file: file,\n line: line,\n col: col,\n stack: err.stack\n }\n })\n }, window.normalizeModule = function(parentId, moduleName) {\n if (-1 !== moduleName.indexOf("!")) {\n var chunks = moduleName.split("!");\n return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1])\n }\n if ("." == moduleName.charAt(0)) {\n var base = parentId.split("/").slice(0, -1).join("/");\n for (moduleName = (base ? base + "/" : "") + moduleName; - 1 !== moduleName.indexOf(".") && previous != moduleName;) {\n var previous = moduleName;\n moduleName = moduleName.replace(/^\\.\\//, "").replace(/\\/\\.\\//, "/").replace(/[^\\/]+\\/\\.\\.\\//, "")\n }\n }\n return moduleName\n }, window.acequire = function acequire(parentId, id) {\n if (id || (id = parentId, parentId = null), !id.charAt) throw Error("worker.js acequire() accepts only (parentId, id) as arguments");\n id = window.normalizeModule(parentId, id);\n var module = window.acequire.modules[id];\n if (module) return module.initialized || (module.initialized = !0, module.exports = module.factory().exports), module.exports;\n if (!window.acequire.tlns) return console.log("unable to load " + id);\n var path = resolveModuleId(id, window.acequire.tlns);\n return ".js" != path.slice(-3) && (path += ".js"), window.acequire.id = id, window.acequire.modules[id] = {}, importScripts(path), window.acequire(parentId, id)\n }, window.acequire.modules = {}, window.acequire.tlns = {}, window.define = function(id, deps, factory) {\n if (2 == arguments.length ? (factory = deps, "string" != typeof id && (deps = id, id = window.acequire.id)) : 1 == arguments.length && (factory = id, deps = [], id = window.acequire.id), "function" != typeof factory) return window.acequire.modules[id] = {\n exports: factory,\n initialized: !0\n }, void 0;\n deps.length || (deps = ["require", "exports", "module"]);\n var req = function(childId) {\n return window.acequire(id, childId)\n };\n window.acequire.modules[id] = {\n exports: {},\n factory: function() {\n var module = this,\n returnExports = factory.apply(this, deps.map(function(dep) {\n switch (dep) {\n case "require":\n return req;\n case "exports":\n return module.exports;\n case "module":\n return module;\n default:\n return req(dep)\n }\n }));\n return returnExports && (module.exports = returnExports), module\n }\n }\n }, window.define.amd = {}, acequire.tlns = {}, window.initBaseUrls = function(topLevelNamespaces) {\n for (var i in topLevelNamespaces) acequire.tlns[i] = topLevelNamespaces[i]\n }, window.initSender = function() {\n var EventEmitter = window.acequire("ace/lib/event_emitter").EventEmitter,\n oop = window.acequire("ace/lib/oop"),\n Sender = function() {};\n return function() {\n oop.implement(this, EventEmitter), this.callback = function(data, callbackId) {\n postMessage({\n type: "call",\n id: callbackId,\n data: data\n })\n }, this.emit = function(name, data) {\n postMessage({\n type: "event",\n name: name,\n data: data\n })\n }\n }.call(Sender.prototype), new Sender\n };\n var main = window.main = null,\n sender = window.sender = null;\n window.onmessage = function(e) {\n var msg = e.data;\n if (msg.event && sender) sender._signal(msg.event, msg.data);\n else if (msg.command)\n if (main[msg.command]) main[msg.command].apply(main, msg.args);\n else {\n if (!window[msg.command]) throw Error("Unknown command:" + msg.command);\n window[msg.command].apply(window, msg.args)\n }\n else if (msg.init) {\n window.initBaseUrls(msg.tlns), acequire("ace/lib/es5-shim"), sender = window.sender = window.initSender();\n var clazz = acequire(msg.module)[msg.classname];\n main = window.main = new clazz(sender)\n }\n }\n }\n}(this), ace.define("ace/lib/oop", ["require", "exports", "module"], function(acequire, exports) {\n "use strict";\n exports.inherits = function(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n })\n }, exports.mixin = function(obj, mixin) {\n for (var key in mixin) obj[key] = mixin[key];\n return obj\n }, exports.implement = function(proto, mixin) {\n exports.mixin(proto, mixin)\n }\n}), ace.define("ace/range", ["require", "exports", "module"], function(acequire, exports) {\n "use strict";\n var comparePoints = function(p1, p2) {\n return p1.row - p2.row || p1.column - p2.column\n },\n Range = function(startRow, startColumn, endRow, endColumn) {\n this.start = {\n row: startRow,\n column: startColumn\n }, this.end = {\n row: endRow,\n column: endColumn\n }\n };\n (function() {\n this.isEqual = function(range) {\n return this.start.row === range.start.row && this.end.row === range.end.row && this.start.column === range.start.column && this.end.column === range.end.column\n }, this.toString = function() {\n return "Range: [" + this.start.row + "/" + this.start.column + "] -> [" + this.end.row + "/" + this.end.column + "]"\n }, this.contains = function(row, column) {\n return 0 == this.compare(row, column)\n }, this.compareRange = function(range) {\n var cmp, end = range.end,\n start = range.start;\n return cmp = this.compare(end.row, end.column), 1 == cmp ? (cmp = this.compare(start.row, start.column), 1 == cmp ? 2 : 0 == cmp ? 1 : 0) : -1 == cmp ? -2 : (cmp = this.compare(start.row, start.column), -1 == cmp ? -1 : 1 == cmp ? 42 : 0)\n }, this.comparePoint = function(p) {\n return this.compare(p.row, p.column)\n }, this.containsRange = function(range) {\n return 0 == this.comparePoint(range.start) && 0 == this.comparePoint(range.end)\n }, this.intersects = function(range) {\n var cmp = this.compareRange(range);\n return -1 == cmp || 0 == cmp || 1 == cmp\n }, this.isEnd = function(row, column) {\n return this.end.row == row && this.end.column == column\n }, this.isStart = function(row, column) {\n return this.start.row == row && this.start.column == column\n }, this.setStart = function(row, column) {\n "object" == typeof row ? (this.start.column = row.column, this.start.row = row.row) : (this.start.row = row, this.start.column = column)\n }, this.setEnd = function(row, column) {\n "object" == typeof row ? (this.end.column = row.column, this.end.row = row.row) : (this.end.row = row, this.end.column = column)\n }, this.inside = function(row, column) {\n return 0 == this.compare(row, column) ? this.isEnd(row, column) || this.isStart(row, column) ? !1 : !0 : !1\n }, this.insideStart = function(row, column) {\n return 0 == this.compare(row, column) ? this.isEnd(row, column) ? !1 : !0 : !1\n }, this.insideEnd = function(row, column) {\n return 0 == this.compare(row, column) ? this.isStart(row, column) ? !1 : !0 : !1\n }, this.compare = function(row, column) {\n return this.isMultiLine() || row !== this.start.row ? this.start.row > row ? -1 : row > this.end.row ? 1 : this.start.row === row ? column >= this.start.column ? 0 : -1 : this.end.row === row ? this.end.column >= column ? 0 : 1 : 0 : this.start.column > column ? -1 : column > this.end.column ? 1 : 0\n }, this.compareStart = function(row, column) {\n return this.start.row == row && this.start.column == column ? -1 : this.compare(row, column)\n }, this.compareEnd = function(row, column) {\n return this.end.row == row && this.end.column == column ? 1 : this.compare(row, column)\n }, this.compareInside = function(row, column) {\n return this.end.row == row && this.end.column == column ? 1 : this.start.row == row && this.start.column == column ? -1 : this.compare(row, column)\n }, this.clipRows = function(firstRow, lastRow) {\n if (this.end.row > lastRow) var end = {\n row: lastRow + 1,\n column: 0\n };\n else if (firstRow > this.end.row) var end = {\n row: firstRow,\n column: 0\n };\n if (this.start.row > lastRow) var start = {\n row: lastRow + 1,\n column: 0\n };\n else if (firstRow > this.start.row) var start = {\n row: firstRow,\n column: 0\n };\n return Range.fromPoints(start || this.start, end || this.end)\n }, this.extend = function(row, column) {\n var cmp = this.compare(row, column);\n if (0 == cmp) return this;\n if (-1 == cmp) var start = {\n row: row,\n column: column\n };\n else var end = {\n row: row,\n column: column\n };\n return Range.fromPoints(start || this.start, end || this.end)\n }, this.isEmpty = function() {\n return this.start.row === this.end.row && this.start.column === this.end.column\n }, this.isMultiLine = function() {\n return this.start.row !== this.end.row\n }, this.clone = function() {\n return Range.fromPoints(this.start, this.end)\n }, this.collapseRows = function() {\n return 0 == this.end.column ? new Range(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0) : new Range(this.start.row, 0, this.end.row, 0)\n }, this.toScreenRange = function(session) {\n var screenPosStart = session.documentToScreenPosition(this.start),\n screenPosEnd = session.documentToScreenPosition(this.end);\n return new Range(screenPosStart.row, screenPosStart.column, screenPosEnd.row, screenPosEnd.column)\n }, this.moveBy = function(row, column) {\n this.start.row += row, this.start.column += column, this.end.row += row, this.end.column += column\n }\n }).call(Range.prototype), Range.fromPoints = function(start, end) {\n return new Range(start.row, start.column, end.row, end.column)\n }, Range.comparePoints = comparePoints, Range.comparePoints = function(p1, p2) {\n return p1.row - p2.row || p1.column - p2.column\n }, exports.Range = Range\n}), ace.define("ace/apply_delta", ["require", "exports", "module"], function(acequire, exports) {\n "use strict";\n exports.applyDelta = function(docLines, delta) {\n var row = delta.start.row,\n startColumn = delta.start.column,\n line = docLines[row] || "";\n switch (delta.action) {\n case "insert":\n var lines = delta.lines;\n if (1 === lines.length) docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);\n else {\n var args = [row, 1].concat(delta.lines);\n docLines.splice.apply(docLines, args), docLines[row] = line.substring(0, startColumn) + docLines[row], docLines[row + delta.lines.length - 1] += line.substring(startColumn)\n }\n break;\n case "remove":\n var endColumn = delta.end.column,\n endRow = delta.end.row;\n row === endRow ? docLines[row] = line.substring(0, startColumn) + line.substring(endColumn) : docLines.splice(row, endRow - row + 1, line.substring(0, startColumn) + docLines[endRow].substring(endColumn))\n }\n }\n}), ace.define("ace/lib/event_emitter", ["require", "exports", "module"], function(acequire, exports) {\n "use strict";\n var EventEmitter = {},\n stopPropagation = function() {\n this.propagationStopped = !0\n },\n preventDefault = function() {\n this.defaultPrevented = !0\n };\n EventEmitter._emit = EventEmitter._dispatchEvent = function(eventName, e) {\n this._eventRegistry || (this._eventRegistry = {}), this._defaultHandlers || (this._defaultHandlers = {});\n var listeners = this._eventRegistry[eventName] || [],\n defaultHandler = this._defaultHandlers[eventName];\n if (listeners.length || defaultHandler) {\n "object" == typeof e && e || (e = {}), e.type || (e.type = eventName), e.stopPropagation || (e.stopPropagation = stopPropagation), e.preventDefault || (e.preventDefault = preventDefault), listeners = listeners.slice();\n for (var i = 0; listeners.length > i && (listeners[i](e, this), !e.propagationStopped); i++);\n return defaultHandler && !e.defaultPrevented ? defaultHandler(e, this) : void 0\n }\n }, EventEmitter._signal = function(eventName, e) {\n var listeners = (this._eventRegistry || {})[eventName];\n if (listeners) {\n listeners = listeners.slice();\n for (var i = 0; listeners.length > i; i++) listeners[i](e, this)\n }\n }, EventEmitter.once = function(eventName, callback) {\n var _self = this;\n callback && this.addEventListener(eventName, function newCallback() {\n _self.removeEventListener(eventName, newCallback), callback.apply(null, arguments)\n })\n }, EventEmitter.setDefaultHandler = function(eventName, callback) {\n var handlers = this._defaultHandlers;\n if (handlers || (handlers = this._defaultHandlers = {\n _disabled_: {}\n }), handlers[eventName]) {\n var old = handlers[eventName],\n disabled = handlers._disabled_[eventName];\n disabled || (handlers._disabled_[eventName] = disabled = []), disabled.push(old);\n var i = disabled.indexOf(callback); - 1 != i && disabled.splice(i, 1)\n }\n handlers[eventName] = callback\n }, EventEmitter.removeDefaultHandler = function(eventName, callback) {\n var handlers = this._defaultHandlers;\n if (handlers) {\n var disabled = handlers._disabled_[eventName];\n if (handlers[eventName] == callback) handlers[eventName], disabled && this.setDefaultHandler(eventName, disabled.pop());\n else if (disabled) {\n var i = disabled.indexOf(callback); - 1 != i && disabled.splice(i, 1)\n }\n }\n }, EventEmitter.on = EventEmitter.addEventListener = function(eventName, callback, capturing) {\n this._eventRegistry = this._eventRegistry || {};\n var listeners = this._eventRegistry[eventName];\n return listeners || (listeners = this._eventRegistry[eventName] = []), -1 == listeners.indexOf(callback) && listeners[capturing ? "unshift" : "push"](callback), callback\n }, EventEmitter.off = EventEmitter.removeListener = EventEmitter.removeEventListener = function(eventName, callback) {\n this._eventRegistry = this._eventRegistry || {};\n var listeners = this._eventRegistry[eventName];\n if (listeners) {\n var index = listeners.indexOf(callback); - 1 !== index && listeners.splice(index, 1)\n }\n }, EventEmitter.removeAllListeners = function(eventName) {\n this._eventRegistry && (this._eventRegistry[eventName] = [])\n }, exports.EventEmitter = EventEmitter\n}), ace.define("ace/anchor", ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"], function(acequire, exports) {\n "use strict";\n var oop = acequire("./lib/oop"),\n EventEmitter = acequire("./lib/event_emitter").EventEmitter,\n Anchor = exports.Anchor = function(doc, row, column) {\n this.$onChange = this.onChange.bind(this), this.attach(doc), column === void 0 ? this.setPosition(row.row, row.column) : this.setPosition(row, column)\n };\n (function() {\n function $pointsInOrder(point1, point2, equalPointsInOrder) {\n var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;\n return point1.row < point2.row || point1.row == point2.row && bColIsAfter\n }\n\n function $getTransformedPoint(delta, point, moveIfEqual) {\n var deltaIsInsert = "insert" == delta.action,\n deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row),\n deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column),\n deltaStart = delta.start,\n deltaEnd = deltaIsInsert ? deltaStart : delta.end;\n return $pointsInOrder(point, deltaStart, moveIfEqual) ? {\n row: point.row,\n column: point.column\n } : $pointsInOrder(deltaEnd, point, !moveIfEqual) ? {\n row: point.row + deltaRowShift,\n column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)\n } : {\n row: deltaStart.row,\n column: deltaStart.column\n }\n }\n oop.implement(this, EventEmitter), this.getPosition = function() {\n return this.$clipPositionToDocument(this.row, this.column)\n }, this.getDocument = function() {\n return this.document\n }, this.$insertRight = !1, this.onChange = function(delta) {\n if (!(delta.start.row == delta.end.row && delta.start.row != this.row || delta.start.row > this.row)) {\n var point = $getTransformedPoint(delta, {\n row: this.row,\n column: this.column\n }, this.$insertRight);\n this.setPosition(point.row, point.column, !0)\n }\n }, this.setPosition = function(row, column, noClip) {\n var pos;\n if (pos = noClip ? {\n row: row,\n column: column\n } : this.$clipPositionToDocument(row, column), this.row != pos.row || this.column != pos.column) {\n var old = {\n row: this.row,\n column: this.column\n };\n this.row = pos.row, this.column = pos.column, this._signal("change", {\n old: old,\n value: pos\n })\n }\n }, this.detach = function() {\n this.document.removeEventListener("change", this.$onChange)\n }, this.attach = function(doc) {\n this.document = doc || this.document, this.document.on("change", this.$onChange)\n }, this.$clipPositionToDocument = function(row, column) {\n var pos = {};\n return row >= this.document.getLength() ? (pos.row = Math.max(0, this.document.getLength() - 1), pos.column = this.document.getLine(pos.row).length) : 0 > row ? (pos.row = 0, pos.column = 0) : (pos.row = row, pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column))), 0 > column && (pos.column = 0), pos\n }\n }).call(Anchor.prototype)\n}), ace.define("ace/document", ["require", "exports", "module", "ace/lib/oop", "ace/apply_delta", "ace/lib/event_emitter", "ace/range", "ace/anchor"], function(acequire, exports) {\n "use strict";\n var oop = acequire("./lib/oop"),\n applyDelta = acequire("./apply_delta").applyDelta,\n EventEmitter = acequire("./lib/event_emitter").EventEmitter,\n Range = acequire("./range").Range,\n Anchor = acequire("./anchor").Anchor,\n Document = function(textOrLines) {\n this.$lines = [""], 0 === textOrLines.length ? this.$lines = [""] : Array.isArray(textOrLines) ? this.insertMergedLines({\n row: 0,\n column: 0\n }, textOrLines) : this.insert({\n row: 0,\n column: 0\n }, textOrLines)\n };\n (function() {\n oop.implement(this, EventEmitter), this.setValue = function(text) {\n var len = this.getLength() - 1;\n this.remove(new Range(0, 0, len, this.getLine(len).length)), this.insert({\n row: 0,\n column: 0\n }, text)\n }, this.getValue = function() {\n return this.getAllLines().join(this.getNewLineCharacter())\n }, this.createAnchor = function(row, column) {\n return new Anchor(this, row, column)\n }, this.$split = 0 === "aaa".split(/a/).length ? function(text) {\n return text.replace(/\\r\\n|\\r/g, "\\n").split("\\n")\n } : function(text) {\n return text.split(/\\r\\n|\\r|\\n/)\n }, this.$detectNewLine = function(text) {\n var match = text.match(/^.*?(\\r\\n|\\r|\\n)/m);\n this.$autoNewLine = match ? match[1] : "\\n", this._signal("changeNewLineMode")\n }, this.getNewLineCharacter = function() {\n switch (this.$newLineMode) {\n case "windows":\n return "\\r\\n";\n case "unix":\n return "\\n";\n default:\n return this.$autoNewLine || "\\n"\n }\n }, this.$autoNewLine = "", this.$newLineMode = "auto", this.setNewLineMode = function(newLineMode) {\n this.$newLineMode !== newLineMode && (this.$newLineMode = newLineMode, this._signal("changeNewLineMode"))\n }, this.getNewLineMode = function() {\n return this.$newLineMode\n }, this.isNewLine = function(text) {\n return "\\r\\n" == text || "\\r" == text || "\\n" == text\n }, this.getLine = function(row) {\n return this.$lines[row] || ""\n }, this.getLines = function(firstRow, lastRow) {\n return this.$lines.slice(firstRow, lastRow + 1)\n }, this.getAllLines = function() {\n return this.getLines(0, this.getLength())\n }, this.getLength = function() {\n return this.$lines.length\n }, this.getTextRange = function(range) {\n return this.getLinesForRange(range).join(this.getNewLineCharacter())\n }, this.getLinesForRange = function(range) {\n var lines;\n if (range.start.row === range.end.row) lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];\n else {\n lines = this.getLines(range.start.row, range.end.row), lines[0] = (lines[0] || "").substring(range.start.column);\n var l = lines.length - 1;\n range.end.row - range.start.row == l && (lines[l] = lines[l].substring(0, range.end.column))\n }\n return lines\n }, this.insertLines = function(row, lines) {\n return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."), this.insertFullLines(row, lines)\n }, this.removeLines = function(firstRow, lastRow) {\n return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."), this.removeFullLines(firstRow, lastRow)\n }, this.insertNewLine = function(position) {\n return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, [\'\', \'\']) instead."), this.insertMergedLines(position, ["", ""])\n }, this.insert = function(position, text) {\n return 1 >= this.getLength() && this.$detectNewLine(text), this.insertMergedLines(position, this.$split(text))\n }, this.insertInLine = function(position, text) {\n var start = this.clippedPos(position.row, position.column),\n end = this.pos(position.row, position.column + text.length);\n return this.applyDelta({\n start: start,\n end: end,\n action: "insert",\n lines: [text]\n }, !0), this.clonePos(end)\n }, this.clippedPos = function(row, column) {\n var length = this.getLength();\n void 0 === row ? row = length : 0 > row ? row = 0 : row >= length && (row = length - 1, column = void 0);\n var line = this.getLine(row);\n return void 0 == column && (column = line.length), column = Math.min(Math.max(column, 0), line.length), {\n row: row,\n column: column\n }\n }, this.clonePos = function(pos) {\n return {\n row: pos.row,\n column: pos.column\n }\n }, this.pos = function(row, column) {\n return {\n row: row,\n column: column\n }\n }, this.$clipPosition = function(position) {\n var length = this.getLength();\n return position.row >= length ? (position.row = Math.max(0, length - 1), position.column = this.getLine(length - 1).length) : (position.row = Math.max(0, position.row), position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length)), position\n }, this.insertFullLines = function(row, lines) {\n row = Math.min(Math.max(row, 0), this.getLength());\n var column = 0;\n this.getLength() > row ? (lines = lines.concat([""]), column = 0) : (lines = [""].concat(lines), row--, column = this.$lines[row].length), this.insertMergedLines({\n row: row,\n column: column\n }, lines)\n }, this.insertMergedLines = function(position, lines) {\n var start = this.clippedPos(position.row, position.column),\n end = {\n row: start.row + lines.length - 1,\n column: (1 == lines.length ? start.column : 0) + lines[lines.length - 1].length\n };\n return this.applyDelta({\n start: start,\n end: end,\n action: "insert",\n lines: lines\n }), this.clonePos(end)\n }, this.remove = function(range) {\n var start = this.clippedPos(range.start.row, range.start.column),\n end = this.clippedPos(range.end.row, range.end.column);\n return this.applyDelta({\n start: start,\n end: end,\n action: "remove",\n lines: this.getLinesForRange({\n start: start,\n end: end\n })\n }), this.clonePos(start)\n }, this.removeInLine = function(row, startColumn, endColumn) {\n var start = this.clippedPos(row, startColumn),\n end = this.clippedPos(row, endColumn);\n return this.applyDelta({\n start: start,\n end: end,\n action: "remove",\n lines: this.getLinesForRange({\n start: start,\n end: end\n })\n }, !0), this.clonePos(start)\n }, this.removeFullLines = function(firstRow, lastRow) {\n firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1), lastRow = Math.min(Math.max(0, lastRow), this.getLength() - 1);\n var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0,\n deleteLastNewLine = this.getLength() - 1 > lastRow,\n startRow = deleteFirstNewLine ? firstRow - 1 : firstRow,\n startCol = deleteFirstNewLine ? this.getLine(startRow).length : 0,\n endRow = deleteLastNewLine ? lastRow + 1 : lastRow,\n endCol = deleteLastNewLine ? 0 : this.getLine(endRow).length,\n range = new Range(startRow, startCol, endRow, endCol),\n deletedLines = this.$lines.slice(firstRow, lastRow + 1);\n return this.applyDelta({\n start: range.start,\n end: range.end,\n action: "remove",\n lines: this.getLinesForRange(range)\n }), deletedLines\n }, this.removeNewLine = function(row) {\n this.getLength() - 1 > row && row >= 0 && this.applyDelta({\n start: this.pos(row, this.getLine(row).length),\n end: this.pos(row + 1, 0),\n action: "remove",\n lines: ["", ""]\n })\n }, this.replace = function(range, text) {\n if (range instanceof Range || (range = Range.fromPoints(range.start, range.end)), 0 === text.length && range.isEmpty()) return range.start;\n if (text == this.getTextRange(range)) return range.end;\n this.remove(range);\n var end;\n return end = text ? this.insert(range.start, text) : range.start\n }, this.applyDeltas = function(deltas) {\n for (var i = 0; deltas.length > i; i++) this.applyDelta(deltas[i])\n }, this.revertDeltas = function(deltas) {\n for (var i = deltas.length - 1; i >= 0; i--) this.revertDelta(deltas[i])\n }, this.applyDelta = function(delta, doNotValidate) {\n var isInsert = "insert" == delta.action;\n (isInsert ? 1 >= delta.lines.length && !delta.lines[0] : !Range.comparePoints(delta.start, delta.end)) || (isInsert && delta.lines.length > 2e4 && this.$splitAndapplyLargeDelta(delta, 2e4), applyDelta(this.$lines, delta, doNotValidate), this._signal("change", delta))\n }, this.$splitAndapplyLargeDelta = function(delta, MAX) {\n for (var lines = delta.lines, l = lines.length, row = delta.start.row, column = delta.start.column, from = 0, to = 0;;) {\n from = to, to += MAX - 1;\n var chunk = lines.slice(from, to);\n if (to > l) {\n delta.lines = chunk, delta.start.row = row + from, delta.start.column = column;\n break\n }\n chunk.push(""), this.applyDelta({\n start: this.pos(row + from, column),\n end: this.pos(row + to, column = 0),\n action: delta.action,\n lines: chunk\n }, !0)\n }\n }, this.revertDelta = function(delta) {\n this.applyDelta({\n start: this.clonePos(delta.start),\n end: this.clonePos(delta.end),\n action: "insert" == delta.action ? "remove" : "insert",\n lines: delta.lines.slice()\n })\n }, this.indexToPosition = function(index, startRow) {\n for (var lines = this.$lines || this.getAllLines(), newlineLength = this.getNewLineCharacter().length, i = startRow || 0, l = lines.length; l > i; i++)\n if (index -= lines[i].length + newlineLength, 0 > index) return {\n row: i,\n column: index + lines[i].length + newlineLength\n };\n return {\n row: l - 1,\n column: lines[l - 1].length\n }\n }, this.positionToIndex = function(pos, startRow) {\n for (var lines = this.$lines || this.getAllLines(), newlineLength = this.getNewLineCharacter().length, index = 0, row = Math.min(pos.row, lines.length), i = startRow || 0; row > i; ++i) index += lines[i].length + newlineLength;\n return index + pos.column\n }\n }).call(Document.prototype), exports.Document = Document\n}), ace.define("ace/lib/lang", ["require", "exports", "module"], function(acequire, exports) {\n "use strict";\n exports.last = function(a) {\n return a[a.length - 1]\n }, exports.stringReverse = function(string) {\n return string.split("").reverse().join("")\n }, exports.stringRepeat = function(string, count) {\n for (var result = ""; count > 0;) 1 & count && (result += string), (count >>= 1) && (string += string);\n return result\n };\n var trimBeginRegexp = /^\\s\\s*/,\n trimEndRegexp = /\\s\\s*$/;\n exports.stringTrimLeft = function(string) {\n return string.replace(trimBeginRegexp, "")\n }, exports.stringTrimRight = function(string) {\n return string.replace(trimEndRegexp, "")\n }, exports.copyObject = function(obj) {\n var copy = {};\n for (var key in obj) copy[key] = obj[key];\n return copy\n }, exports.copyArray = function(array) {\n for (var copy = [], i = 0, l = array.length; l > i; i++) copy[i] = array[i] && "object" == typeof array[i] ? this.copyObject(array[i]) : array[i];\n return copy\n }, exports.deepCopy = function deepCopy(obj) {\n if ("object" != typeof obj || !obj) return obj;\n var copy;\n if (Array.isArray(obj)) {\n copy = [];\n for (var key = 0; obj.length > key; key++) copy[key] = deepCopy(obj[key]);\n return copy\n }\n if ("[object Object]" !== Object.prototype.toString.call(obj)) return obj;\n copy = {};\n for (var key in obj) copy[key] = deepCopy(obj[key]);\n return copy\n }, exports.arrayToMap = function(arr) {\n for (var map = {}, i = 0; arr.length > i; i++) map[arr[i]] = 1;\n return map\n }, exports.createMap = function(props) {\n var map = Object.create(null);\n for (var i in props) map[i] = props[i];\n return map\n }, exports.arrayRemove = function(array, value) {\n for (var i = 0; array.length >= i; i++) value === array[i] && array.splice(i, 1)\n }, exports.escapeRegExp = function(str) {\n return str.replace(/([.*+?^${}()|[\\]\\/\\\\])/g, "\\\\$1")\n }, exports.escapeHTML = function(str) {\n return str.replace(/&/g, "&").replace(/"/g, """).replace(/\'/g, "'").replace(/ i; i += 2) {\n if (Array.isArray(data[i + 1])) var d = {\n action: "insert",\n start: data[i],\n lines: data[i + 1]\n };\n else var d = {\n action: "remove",\n start: data[i],\n end: data[i + 1]\n };\n doc.applyDelta(d, !0)\n }\n return _self.$timeout ? deferredUpdate.schedule(_self.$timeout) : (_self.onUpdate(), void 0)\n })\n };\n (function() {\n this.$timeout = 500, this.setTimeout = function(timeout) {\n this.$timeout = timeout\n }, this.setValue = function(value) {\n this.doc.setValue(value), this.deferredUpdate.schedule(this.$timeout)\n }, this.getValue = function(callbackId) {\n this.sender.callback(this.doc.getValue(), callbackId)\n }, this.onUpdate = function() {}, this.isPending = function() {\n return this.deferredUpdate.isPending()\n }\n }).call(Mirror.prototype)\n}), ace.define("ace/mode/json/json_parse", ["require", "exports", "module"], function() {\n "use strict";\n var at, ch, text, value, escapee = {\n \'"\': \'"\',\n "\\\\": "\\\\",\n "/": "/",\n b: "\\b",\n f: "\\f",\n n: "\\n",\n r: "\\r",\n t: "\t"\n },\n error = function(m) {\n throw {\n name: "SyntaxError",\n message: m,\n at: at,\n text: text\n }\n },\n reset = function (newAt) {\n ch = text.charAt(newAt);\n at = newAt + 1;\n },\n next = function(c) {\n return c && c !== ch && error("Expected \'" + c + "\' instead of \'" + ch + "\'"), ch = text.charAt(at), at += 1, ch\n },\n nextUpTo = function (upTo, errorMessage) {\n let currentAt = at,\n i = text.indexOf(upTo, currentAt);\n if (i < 0) {\n error(errorMessage || \'Expected \\\'\' + upTo + \'\\\'\');\n }\n reset(i + upTo.length);\n return text.substring(currentAt, i);\n },\n peek = function (c) {\n return text.substr(at, c.length) === c; // nocommit - double check\n },\n number = function() {\n var number, string = "";\n for ("-" === ch && (string = "-", next("-")); ch >= "0" && "9" >= ch;) string += ch, next();\n if ("." === ch)\n for (string += "."; next() && ch >= "0" && "9" >= ch;) string += ch;\n if ("e" === ch || "E" === ch)\n for (string += ch, next(), ("-" === ch || "+" === ch) && (string += ch, next()); ch >= "0" && "9" >= ch;) string += ch, next();\n return number = +string, isNaN(number) ? (error("Bad number"), void 0) : number\n },\n string = function() {\n var hex, i, uffff, string = "";\n if (\'"\' === ch) {\n if (peek(\'""\')) {\n // literal\n next(\'"\');\n next(\'"\');\n return nextUpTo(\'"""\', \'failed to find closing \\\'"""\\\'\');\n } else {\n for (; next();) {\n if (\'"\' === ch) return next(), string;\n if ("\\\\" === ch)\n if (next(), "u" === ch) {\n for (uffff = 0, i = 0; 4 > i && (hex = parseInt(next(), 16), isFinite(hex)); i += 1) uffff = 16 * uffff + hex;\n string += String.fromCharCode(uffff)\n } else {\n if ("string" != typeof escapee[ch]) break;\n string += escapee[ch]\n }\n else string += ch\n }\n }\n }\n error("Bad string")\n },\n white = function() {\n for (; ch && " " >= ch;) next()\n },\n word = function() {\n switch (ch) {\n case "t":\n return next("t"), next("r"), next("u"), next("e"), !0;\n case "f":\n return next("f"), next("a"), next("l"), next("s"), next("e"), !1;\n case "n":\n return next("n"), next("u"), next("l"), next("l"), null\n }\n error("Unexpected \'" + ch + "\'")\n },\n array = function() {\n var array = [];\n if ("[" === ch) {\n if (next("["), white(), "]" === ch) return next("]"), array;\n for (; ch;) {\n if (array.push(value()), white(), "]" === ch) return next("]"), array;\n next(","), white()\n }\n }\n error("Bad array")\n },\n object = function() {\n var key, object = {};\n if ("{" === ch) {\n if (next("{"), white(), "}" === ch) return next("}"), object;\n for (; ch;) {\n if (key = string(), white(), next(":"), Object.hasOwnProperty.call(object, key) && error(\'Duplicate key "\' + key + \'"\'), object[key] = value(), white(), "}" === ch) return next("}"), object;\n next(","), white()\n }\n }\n error("Bad object")\n };\n return value = function() {\n switch (white(), ch) {\n case "{":\n return object();\n case "[":\n return array();\n case \'"\':\n return string();\n case "-":\n return number();\n default:\n return ch >= "0" && "9" >= ch ? number() : word()\n }\n },\n function(source, reviver) {\n var result;\n return text = source, at = 0, ch = " ", result = value(), white(), ch && error("Syntax error"), "function" == typeof reviver ? function walk(holder, key) {\n var k, v, value = holder[key];\n if (value && "object" == typeof value)\n for (k in value) Object.hasOwnProperty.call(value, k) && (v = walk(value, k), void 0 !== v ? value[k] = v : delete value[k]);\n return reviver.call(holder, key, value)\n }({\n "": result\n }, "") : result\n }\n}), ace.define("ace/mode/json_worker", ["require", "exports", "module", "ace/lib/oop", "ace/worker/mirror", "ace/mode/json/json_parse"], function(acequire, exports) {\n "use strict";\n var oop = acequire("../lib/oop"),\n Mirror = acequire("../worker/mirror").Mirror,\n parse = acequire("./json/json_parse"),\n JsonWorker = exports.JsonWorker = function(sender) {\n Mirror.call(this, sender), this.setTimeout(200)\n };\n oop.inherits(JsonWorker, Mirror),\n function() {\n this.onUpdate = function() {\n var value = this.doc.getValue(),\n errors = [];\n try {\n value && parse(value)\n } catch (e) {\n var pos = this.doc.indexToPosition(e.at - 1);\n errors.push({\n row: pos.row,\n column: pos.column,\n text: e.message,\n type: "error"\n })\n }\n this.sender.emit("annotate", errors)\n }\n }.call(JsonWorker.prototype)\n}), ace.define("ace/lib/es5-shim", ["require", "exports", "module"], function() {\n function Empty() {}\n\n function doesDefinePropertyWork(object) {\n try {\n return Object.defineProperty(object, "sentinel", {}), "sentinel" in object\n } catch (exception) {}\n }\n\n function toInteger(n) {\n return n = +n, n !== n ? n = 0 : 0 !== n && n !== 1 / 0 && n !== -(1 / 0) && (n = (n > 0 || -1) * Math.floor(Math.abs(n))), n\n }\n Function.prototype.bind || (Function.prototype.bind = function(that) {\n var target = this;\n if ("function" != typeof target) throw new TypeError("Function.prototype.bind called on incompatible " + target);\n var args = slice.call(arguments, 1),\n bound = function() {\n if (this instanceof bound) {\n var result = target.apply(this, args.concat(slice.call(arguments)));\n return Object(result) === result ? result : this\n }\n return target.apply(that, args.concat(slice.call(arguments)))\n };\n return target.prototype && (Empty.prototype = target.prototype, bound.prototype = new Empty, Empty.prototype = null), bound\n });\n var defineGetter, defineSetter, lookupGetter, lookupSetter, supportsAccessors, call = Function.prototype.call,\n prototypeOfArray = Array.prototype,\n prototypeOfObject = Object.prototype,\n slice = prototypeOfArray.slice,\n _toString = call.bind(prototypeOfObject.toString),\n owns = call.bind(prototypeOfObject.hasOwnProperty);\n if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__")) && (defineGetter = call.bind(prototypeOfObject.__defineGetter__), defineSetter = call.bind(prototypeOfObject.__defineSetter__), lookupGetter = call.bind(prototypeOfObject.__lookupGetter__), lookupSetter = call.bind(prototypeOfObject.__lookupSetter__)), 2 != [1, 2].splice(0).length)\n if (function() {\n function makeArray(l) {\n var a = Array(l + 2);\n return a[0] = a[1] = 0, a\n }\n var lengthBefore, array = [];\n return array.splice.apply(array, makeArray(20)), array.splice.apply(array, makeArray(26)), lengthBefore = array.length, array.splice(5, 0, "XXX"), lengthBefore + 1 == array.length, lengthBefore + 1 == array.length ? !0 : void 0\n }()) {\n var array_splice = Array.prototype.splice;\n Array.prototype.splice = function(start, deleteCount) {\n return arguments.length ? array_splice.apply(this, [void 0 === start ? 0 : start, void 0 === deleteCount ? this.length - start : deleteCount].concat(slice.call(arguments, 2))) : []\n }\n } else Array.prototype.splice = function(pos, removeCount) {\n var length = this.length;\n pos > 0 ? pos > length && (pos = length) : void 0 == pos ? pos = 0 : 0 > pos && (pos = Math.max(length + pos, 0)), length > pos + removeCount || (removeCount = length - pos);\n var removed = this.slice(pos, pos + removeCount),\n insert = slice.call(arguments, 2),\n add = insert.length;\n if (pos === length) add && this.push.apply(this, insert);\n else {\n var remove = Math.min(removeCount, length - pos),\n tailOldPos = pos + remove,\n tailNewPos = tailOldPos + add - remove,\n tailCount = length - tailOldPos,\n lengthAfterRemove = length - remove;\n if (tailOldPos > tailNewPos)\n for (var i = 0; tailCount > i; ++i) this[tailNewPos + i] = this[tailOldPos + i];\n else if (tailNewPos > tailOldPos)\n for (i = tailCount; i--;) this[tailNewPos + i] = this[tailOldPos + i];\n if (add && pos === lengthAfterRemove) this.length = lengthAfterRemove, this.push.apply(this, insert);\n else\n for (this.length = lengthAfterRemove + add, i = 0; add > i; ++i) this[pos + i] = insert[i]\n }\n return removed\n };\n Array.isArray || (Array.isArray = function(obj) {\n return "[object Array]" == _toString(obj)\n });\n var boxedString = Object("a"),\n splitString = "a" != boxedString[0] || !(0 in boxedString);\n if (Array.prototype.forEach || (Array.prototype.forEach = function(fun) {\n var object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n thisp = arguments[1],\n i = -1,\n length = self.length >>> 0;\n if ("[object Function]" != _toString(fun)) throw new TypeError;\n for (; length > ++i;) i in self && fun.call(thisp, self[i], i, object)\n }), Array.prototype.map || (Array.prototype.map = function(fun) {\n var object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n length = self.length >>> 0,\n result = Array(length),\n thisp = arguments[1];\n if ("[object Function]" != _toString(fun)) throw new TypeError(fun + " is not a function");\n for (var i = 0; length > i; i++) i in self && (result[i] = fun.call(thisp, self[i], i, object));\n return result\n }), Array.prototype.filter || (Array.prototype.filter = function(fun) {\n var value, object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n length = self.length >>> 0,\n result = [],\n thisp = arguments[1];\n if ("[object Function]" != _toString(fun)) throw new TypeError(fun + " is not a function");\n for (var i = 0; length > i; i++) i in self && (value = self[i], fun.call(thisp, value, i, object) && result.push(value));\n return result\n }), Array.prototype.every || (Array.prototype.every = function(fun) {\n var object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n length = self.length >>> 0,\n thisp = arguments[1];\n if ("[object Function]" != _toString(fun)) throw new TypeError(fun + " is not a function");\n for (var i = 0; length > i; i++)\n if (i in self && !fun.call(thisp, self[i], i, object)) return !1;\n return !0\n }), Array.prototype.some || (Array.prototype.some = function(fun) {\n var object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n length = self.length >>> 0,\n thisp = arguments[1];\n if ("[object Function]" != _toString(fun)) throw new TypeError(fun + " is not a function");\n for (var i = 0; length > i; i++)\n if (i in self && fun.call(thisp, self[i], i, object)) return !0;\n return !1\n }), Array.prototype.reduce || (Array.prototype.reduce = function(fun) {\n var object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n length = self.length >>> 0;\n if ("[object Function]" != _toString(fun)) throw new TypeError(fun + " is not a function");\n if (!length && 1 == arguments.length) throw new TypeError("reduce of empty array with no initial value");\n var result, i = 0;\n if (arguments.length >= 2) result = arguments[1];\n else\n for (;;) {\n if (i in self) {\n result = self[i++];\n break\n }\n if (++i >= length) throw new TypeError("reduce of empty array with no initial value")\n }\n for (; length > i; i++) i in self && (result = fun.call(void 0, result, self[i], i, object));\n return result\n }), Array.prototype.reduceRight || (Array.prototype.reduceRight = function(fun) {\n var object = toObject(this),\n self = splitString && "[object String]" == _toString(this) ? this.split("") : object,\n length = self.length >>> 0;\n if ("[object Function]" != _toString(fun)) throw new TypeError(fun + " is not a function");\n if (!length && 1 == arguments.length) throw new TypeError("reduceRight of empty array with no initial value");\n var result, i = length - 1;\n if (arguments.length >= 2) result = arguments[1];\n else\n for (;;) {\n if (i in self) {\n result = self[i--];\n break\n }\n if (0 > --i) throw new TypeError("reduceRight of empty array with no initial value")\n }\n do i in this && (result = fun.call(void 0, result, self[i], i, object)); while (i--);\n return result\n }), Array.prototype.indexOf && -1 == [0, 1].indexOf(1, 2) || (Array.prototype.indexOf = function(sought) {\n var self = splitString && "[object String]" == _toString(this) ? this.split("") : toObject(this),\n length = self.length >>> 0;\n if (!length) return -1;\n var i = 0;\n for (arguments.length > 1 && (i = toInteger(arguments[1])), i = i >= 0 ? i : Math.max(0, length + i); length > i; i++)\n if (i in self && self[i] === sought) return i;\n return -1\n }), Array.prototype.lastIndexOf && -1 == [0, 1].lastIndexOf(0, -3) || (Array.prototype.lastIndexOf = function(sought) {\n var self = splitString && "[object String]" == _toString(this) ? this.split("") : toObject(this),\n length = self.length >>> 0;\n if (!length) return -1;\n var i = length - 1;\n for (arguments.length > 1 && (i = Math.min(i, toInteger(arguments[1]))), i = i >= 0 ? i : length - Math.abs(i); i >= 0; i--)\n if (i in self && sought === self[i]) return i;\n return -1\n }), Object.getPrototypeOf || (Object.getPrototypeOf = function(object) {\n return object.__proto__ || (object.constructor ? object.constructor.prototype : prototypeOfObject)\n }), !Object.getOwnPropertyDescriptor) {\n var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a non-object: ";\n Object.getOwnPropertyDescriptor = function(object, property) {\n if ("object" != typeof object && "function" != typeof object || null === object) throw new TypeError(ERR_NON_OBJECT + object);\n if (owns(object, property)) {\n var descriptor, getter, setter;\n if (descriptor = {\n enumerable: !0,\n configurable: !0\n }, supportsAccessors) {\n var prototype = object.__proto__;\n object.__proto__ = prototypeOfObject;\n var getter = lookupGetter(object, property),\n setter = lookupSetter(object, property);\n if (object.__proto__ = prototype, getter || setter) return getter && (descriptor.get = getter), setter && (descriptor.set = setter), descriptor\n }\n return descriptor.value = object[property], descriptor\n }\n }\n }\n if (Object.getOwnPropertyNames || (Object.getOwnPropertyNames = function(object) {\n return Object.keys(object)\n }), !Object.create) {\n var createEmpty;\n createEmpty = null === Object.prototype.__proto__ ? function() {\n return {\n __proto__: null\n }\n } : function() {\n var empty = {};\n for (var i in empty) empty[i] = null;\n return empty.constructor = empty.hasOwnProperty = empty.propertyIsEnumerable = empty.isPrototypeOf = empty.toLocaleString = empty.toString = empty.valueOf = empty.__proto__ = null, empty\n }, Object.create = function(prototype, properties) {\n var object;\n if (null === prototype) object = createEmpty();\n else {\n if ("object" != typeof prototype) throw new TypeError("typeof prototype[" + typeof prototype + "] != \'object\'");\n var Type = function() {};\n Type.prototype = prototype, object = new Type, object.__proto__ = prototype\n }\n return void 0 !== properties && Object.defineProperties(object, properties), object\n }\n }\n if (Object.defineProperty) {\n var definePropertyWorksOnObject = doesDefinePropertyWork({}),\n definePropertyWorksOnDom = "undefined" == typeof document || doesDefinePropertyWork(document.createElement("div"));\n if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) var definePropertyFallback = Object.defineProperty\n }\n if (!Object.defineProperty || definePropertyFallback) {\n var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: ",\n ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: ",\n ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined on this javascript engine";\n Object.defineProperty = function(object, property, descriptor) {\n if ("object" != typeof object && "function" != typeof object || null === object) throw new TypeError(ERR_NON_OBJECT_TARGET + object);\n if ("object" != typeof descriptor && "function" != typeof descriptor || null === descriptor) throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);\n if (definePropertyFallback) try {\n return definePropertyFallback.call(Object, object, property, descriptor)\n } catch (exception) {}\n if (owns(descriptor, "value"))\n if (supportsAccessors && (lookupGetter(object, property) || lookupSetter(object, property))) {\n var prototype = object.__proto__;\n object.__proto__ = prototypeOfObject, delete object[property], object[property] = descriptor.value, object.__proto__ = prototype\n } else object[property] = descriptor.value;\n else {\n if (!supportsAccessors) throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);\n owns(descriptor, "get") && defineGetter(object, property, descriptor.get), owns(descriptor, "set") && defineSetter(object, property, descriptor.set)\n }\n return object\n }\n }\n Object.defineProperties || (Object.defineProperties = function(object, properties) {\n for (var property in properties) owns(properties, property) && Object.defineProperty(object, property, properties[property]);\n return object\n }), Object.seal || (Object.seal = function(object) {\n return object\n }), Object.freeze || (Object.freeze = function(object) {\n return object\n });\n try {\n Object.freeze(function() {})\n } catch (exception) {\n Object.freeze = function(freezeObject) {\n return function(object) {\n return "function" == typeof object ? object : freezeObject(object)\n }\n }(Object.freeze)\n }\n if (Object.preventExtensions || (Object.preventExtensions = function(object) {\n return object\n }), Object.isSealed || (Object.isSealed = function() {\n return !1\n }), Object.isFrozen || (Object.isFrozen = function() {\n return !1\n }), Object.isExtensible || (Object.isExtensible = function(object) {\n if (Object(object) === object) throw new TypeError;\n for (var name = ""; owns(object, name);) name += "?";\n object[name] = !0;\n var returnValue = owns(object, name);\n return delete object[name], returnValue\n }), !Object.keys) {\n var hasDontEnumBug = !0,\n dontEnums = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"],\n dontEnumsLength = dontEnums.length;\n for (var key in {\n toString: null\n }) hasDontEnumBug = !1;\n Object.keys = function(object) {\n if ("object" != typeof object && "function" != typeof object || null === object) throw new TypeError("Object.keys called on a non-object");\n var keys = [];\n for (var name in object) owns(object, name) && keys.push(name);\n if (hasDontEnumBug)\n for (var i = 0, ii = dontEnumsLength; ii > i; i++) {\n var dontEnum = dontEnums[i];\n owns(object, dontEnum) && keys.push(dontEnum)\n }\n return keys\n }\n }\n Date.now || (Date.now = function() {\n return (new Date).getTime()\n });\n var ws = "\t\\n\v\\f\\r   ᠎              \\u2028\\u2029\ufeff";\n if (!String.prototype.trim || ws.trim()) {\n ws = "[" + ws + "]";\n var trimBeginRegexp = RegExp("^" + ws + ws + "*"),\n trimEndRegexp = RegExp(ws + ws + "*$");\n String.prototype.trim = function() {\n return (this + "").replace(trimBeginRegexp, "").replace(trimEndRegexp, "")\n }\n }\n var toObject = function(o) {\n if (null == o) throw new TypeError("can\'t convert " + o + " to object");\n return Object(o)\n }\n});\n'},{WorkerClient:he}=Y.a.acequire("ace/worker/worker_client"),fe=Y.a.acequire("ace/lib/oop"),{Mode:me}=Y.a.acequire("ace/mode/json"),{Tokenizer:ge}=Y.a.acequire("ace/tokenizer"),{MatchingBraceOutdent:be}=Y.a.acequire("ace/mode/matching_brace_outdent"),{CstyleBehaviour:we}=Y.a.acequire("ace/mode/behaviour/cstyle"),{FoldMode:ye}=Y.a.acequire("ace/mode/folding/cstyle"),ve=function(){const e=new ue;e.normalizeRules(),this.$tokenizer=new ge(e.getRules()),this.$outdent=new be,this.$behaviour=new we,this.foldingRules=new ye};fe.inherits(ve,me),ve.prototype.createWorker=function(e){const t=new he(["ace"],de,"JsonWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",(function(t){e.setAnnotations(t.data)})),t.on("terminate",(function(){e.clearAnnotations()})),t};const xe=Y.a.acequire("ace/mode/text").Mode,je=Y.a.acequire("ace/mode/matching_brace_outdent").MatchingBraceOutdent,_e=Y.a.acequire("ace/mode/behaviour/cstyle").CstyleBehaviour,Oe=Y.a.acequire("ace/mode/folding/cstyle").FoldMode;Y.a.acequire("ace/tokenizer");class ScriptMode extends xe{constructor(){super(),this.$outdent=new je,this.$behaviour=new _e,this.foldingRules=new Oe}}function Ee(e,t,n,r){return"object"==typeof t&&(t=t.source),[{token:e.concat(["whitespace"]),regex:t+"(\\s*)$",next:n},{token:e,regex:t,next:r}]}(function(){this.HighlightRules=se,this.getNextLineIndent=function(e,t,n){let r=this.$getIndent(t);return t.match(/^.*[\{\[]\s*$/)&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)}}).call(ScriptMode.prototype);const ke=(...e)=>[].concat.apply([],e),Re=Y.a.acequire("ace/mode/text_highlight_rules").TextHighlightRules;class input_highlight_rules_InputHighlightRules extends Re{constructor(){super(),this.$rules={"start-sql":[{token:"whitespace",regex:"\\s+"},{token:"paren.lparen",regex:"{",next:"json-sql",push:!0},{regex:"",next:"start"}],start:ke([{token:"warning",regex:"#!.*$"},{include:"comments"},{token:"paren.lparen",regex:"{",next:"json",push:!0}],Ee(["method"],/([a-zA-Z]+)/,"start","method_sep"),[{token:"whitespace",regex:"\\s+"},{token:"text",regex:".+?"}]),method_sep:ke(Ee(["whitespace","url.protocol_host","url.slash"],/(\s+)(https?:\/\/[^?\/,]+)(\/)/,"start","url"),Ee(["whitespace","variable.template"],/(\s+)(\${\w+})/,"start","url"),Ee(["whitespace","url.protocol_host"],/(\s+)(https?:\/\/[^?\/,]+)/,"start","url"),Ee(["whitespace","url.slash"],/(\s+)(\/)/,"start","url"),Ee(["whitespace"],/(\s+)/,"start","url")),url:ke(Ee(["variable.template"],/(\${\w+})/,"start"),Ee(["url.part"],/(_sql)/,"start-sql","url-sql"),Ee(["url.part"],/([^?\/,\s]+)/,"start"),Ee(["url.comma"],/(,)/,"start"),Ee(["url.slash"],/(\/)/,"start"),Ee(["url.questionmark"],/(\?)/,"start","urlParams"),Ee(["whitespace","comment.punctuation","comment.line"],/(\s+)(\/\/)(.*$)/,"start")),urlParams:ke(Ee(["url.param","url.equal","variable.template"],/([^&=]+)(=)(\${\w+})/,"start"),Ee(["url.param","url.equal","url.value"],/([^&=]+)(=)([^&]*)/,"start"),Ee(["url.param"],/([^&=]+)/,"start"),Ee(["url.amp"],/(&)/,"start"),Ee(["whitespace","comment.punctuation","comment.line"],/(\s+)(\/\/)(.*$)/,"start")),"url-sql":ke(Ee(["url.part"],/([^?\/,\s]+)/,"start-sql"),Ee(["url.comma"],/(,)/,"start-sql"),Ee(["url.slash"],/(\/)/,"start-sql"),Ee(["url.questionmark"],/(\?)/,"start-sql","urlParams-sql")),"urlParams-sql":ke(Ee(["url.param","url.equal","url.value"],/([^&=]+)(=)([^&]*)/,"start-sql"),Ee(["url.param"],/([^&=]+)/,"start-sql"),Ee(["url.amp"],/(&)/,"start-sql")),comments:[{token:["comment.punctuation","comment.line"],regex:/(#)(.*$)/},{token:"comment.punctuation",regex:/\/\*/,push:[{token:"comment.punctuation",regex:/\*\//,next:"pop"},{defaultToken:"comment.block"}]},{token:["comment.punctuation","comment.line"],regex:/(\/\/)(.*$)/}]},pe(this,"json"),this.$rules.json.unshift({include:"comments"}),this.$rules.json.unshift({token:"variable.template",regex:/("\${\w+}")/}),this instanceof input_highlight_rules_InputHighlightRules&&this.normalizeRules()}}const Se=Y.a.acequire("ace/mode/text").Mode,Te=Y.a.acequire("ace/mode/matching_brace_outdent").MatchingBraceOutdent,Ce=Y.a.acequire("ace/mode/behaviour/cstyle").CstyleBehaviour,Ae=Y.a.acequire("ace/mode/folding/cstyle").FoldMode,Pe=Y.a.acequire("ace/worker/worker_client").WorkerClient,Le=Y.a.acequire("ace/tokenizer").Tokenizer;class input_Mode extends Se{constructor(){super(),this.$tokenizer=new Le((new input_highlight_rules_InputHighlightRules).getRules()),this.$outdent=new Te,this.$behaviour=new Ce,this.foldingRules=new Ae,this.createModeDelegates({"script-":ScriptMode})}}(function(){this.getCompletions=function(){return[]},this.getNextLineIndent=function(e,t,n){let r=this.$getIndent(t);return"string_literal"!==e&&t.match(/^.*[\{\(\[]\s*$/)&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){const t=new Pe(["ace","sense_editor"],Z,"SenseWorker");return t.attachToDocument(e.getDocument()),t.on("error",(function(t){e.setAnnotations([t.data])})),t.on("ok",(function(t){e.setAnnotations(t.data)})),t}}).call(input_Mode.prototype),n(46),n(47),n(38);var Ne=n(28),Me=n.n(Ne);const Ie=(e,t,n)=>({type:n.type,value:n.value,position:{lineNumber:e,column:t}});class AceTokensProvider{constructor(e){this.session=e}getTokens(e){if(e<1)return null;if(e>this.session.getLength())return null;const t=this.session.getTokens(e-1);return t&&t.length?((e,t)=>{let n="";return t.map((t=>{const r=n.length+1;return n+=t.value,Ie(e,r,t)}))})(e,t):[]}getTokenAt(e){const t=this.session.getTokens(e.lineNumber-1);return t?((e,t,n)=>{let r="";for(const o of n){const n=r.length+1;r+=o.value;const i=r.length;if(!(ti+1))return Ie(e,n,o)}return null})(e.lineNumber,e.column,t):null}}function qe(e){return e.match(/^\s*?curl\s+(-X[A-Z]+)?\s*['"]?.*?['"]?(\s*$|\s+?-d\s*?['"])/)}var De=function(e){const t=e.resize,n=Object(y.throttle)((()=>{t.call(e,!1);const r=Object(y.get)(n,"topRow",0);0!==r&&e.renderer.scrollToLine(r,!1,!1,(()=>{}))}),35);return n};const Fe=Y.a.acequire("ace/range").Range,$e=({start:e,end:t})=>new Fe(e.lineNumber-1,e.column-1,t.lineNumber-1,t.column-1);class legacy_core_editor_LegacyCoreEditor{constructor(e,t){f()(this,"_aceOnPaste",void 0),f()(this,"$actions",void 0),f()(this,"resize",void 0),f()(this,"setActionsBar",((e,t="top")=>{null===e?this.$actions.css("visibility","hidden"):"top"===t?this.$actions.css({bottom:"auto",top:e,visibility:"visible"}):this.$actions.css({top:"auto",bottom:e,visibility:"visible"})})),f()(this,"hideActionsBar",(()=>{this.setActionsBar(null)})),this.editor=e,this.$actions=Me()(t),this.editor.setShowPrintMargin(!1);const n=this.editor.getSession();n.setMode(new input_Mode),n.setFoldStyle("markbeginend"),n.setTabSize(2),n.setUseWrapMode(!0),this.resize=De(this.editor),this._aceOnPaste=this.editor.onPaste,this.editor.onPaste=this.DO_NOT_USE_onPaste.bind(this),this.editor.setOptions({enableBasicAutocompletion:!0}),this.editor.$blockScrolling=1/0,this.hideActionsBar(),this.editor.focus()}waitForLatestTokens(){return new Promise((e=>{const t=this.editor.getSession(),n=()=>{t.bgTokenizer&&(t.bgTokenizer.running?setTimeout(n,25):e())};setTimeout(n,0)}))}getLineState(e){return this.editor.getSession().getState(e-1)}getValueInRange(e){return this.editor.getSession().getTextRange($e(e))}getTokenProvider(){return new AceTokensProvider(this.editor.getSession())}getValue(){return this.editor.getValue()}async setValue(e,t){this.editor.getSession().setValue(e),t&&await this.forceRetokenize()}getLineValue(e){return this.editor.getSession().getLine(e-1)}getCurrentPosition(){const e=this.editor.getCursorPosition();return{lineNumber:e.row+1,column:e.column+1}}clearSelection(){this.editor.clearSelection()}getTokenAt(e){return this.getTokenProvider().getTokenAt(e)}insert(e,t){"string"!=typeof e?this.editor.getSession().getDocument().insert({column:e.column-1,row:e.lineNumber-1},t||""):this.editor.insert(e)}moveCursorToPosition(e){this.editor.moveCursorToPosition({row:e.lineNumber-1,column:e.column-1})}replace(e,t){this.editor.getSession().replace($e(e),t)}getLines(e,t){return this.editor.getSession().getLines(e-1,t-1)}replaceRange(e,t){const n=this.editor.getCursorPosition();this.editor.getSession().replace($e(e),t);const r=Math.max(e.start.lineNumber-1+t.split("\n").length-1,1);n.row=Math.min(n.row,r),this.editor.moveCursorToPosition(n),this.editor.clearSelection()}getSelectionRange(){const e=this.editor.getSelectionRange();return{start:{lineNumber:e.start.row+1,column:e.start.column+1},end:{lineNumber:e.end.row+1,column:e.end.column+1}}}getLineCount(){return this.editor.getSession().getLength()}addMarker(e){return this.editor.getSession().addMarker($e(e),"ace_snippet-marker","fullLine",!1)}removeMarker(e){this.editor.getSession().removeMarker(e)}getWrapLimit(){return this.editor.getSession().getWrapLimit()}on(e,t){"changeCursor"===e?this.editor.getSession().selection.on(e,t):"changeSelection"===e?this.editor.on(e,t):this.editor.getSession().on(e,t)}off(e,t){"changeSelection"===e&&this.editor.off(e,t)}isCompleterActive(){return Boolean(this.editor.completer&&this.editor.completer.activated)}detachCompleter(){const e=this.editor.completer;return null==e?void 0:e.detach()}forceRetokenize(){const e=this.editor.getSession();return new Promise((t=>{setTimeout((function(){let n;for(n=0;n0&&(n.push(r.join("")),r=[]),t="LF",n.push("\n")}function j(e){const t=o.match(e);t?(r.push(t[1]),o=o.substr(t[0].length),v()):(r.push(o),o="")}function _(){let e,r="GET",i="";(e=o.match(h))&&(r=e[1]);const s=f.test(o)?m:g;(e=o.match(s))&&(i=e[1]),n.push(r+" /"+i+"\n"),(e=o.match(b))?(o=o.substr(e[0].length),v(),a.test(o)&&(o="")):(t="NONE",o="",n.push(""))}for(i.length>0&&/^\s*#!/.test(i[0])&&i.shift();o.length>0||0!==i.length&&(o=i.shift().replace(/[\r\n]+/g,"\n")+"\n",1);)"SINGLE_QUOTE"===t?j(l):"DOUBLE_QUOTE"===t?(j(u),y()):"UNQUOTED"===t?(j(p),r.length&&y(),"UNQUOTED"===t&&(x(),o="")):"BODY"===t?c.test(o)||a.test(o)?x():(r.push(o),o=""):a.test(o)?("LF"!==t&&(n.push("\n"),t="LF"),o=""):(s=o.match(c))?(n.push("#"+s[1]+"\n"),t="NONE",o=""):d.test(o)?_():(s=o.match(w))?(n.push(s[1]+" /"+s[2]+"\n"),o="",t="BODY"):(n.push("### "+o),o="");return x(),n.join("").trim()}(e);this.editor.insert(t)}else this._aceOnPaste.call(this.editor,e)}execCommand(e){this.editor.execCommand(e)}getContainer(){return this.editor.container}setStyles(e){this.editor.getSession().setUseWrapMode(e.wrapLines),this.editor.container.style.fontSize=e.fontSize}registerKeyboardShortcut(e){this.editor.commands.addCommand({exec:e.fn,name:e.name,bindKey:e.keys})}unregisterKeyboardShortcut(e){this.editor.commands.removeCommand(e)}legacyUpdateUI(e){if(this.$actions&&e){const t=Me()(this.editor.container).offset().top,n=e.start.lineNumber,r=e.start.column,o=this.getLineValue(n),i=this.getWrapLimit()-5,s=o.length>i,a=t-(window.pageYOffset||0),c=e=>this.editor.renderer.textToScreenCoordinates(e-1,r).pageY-a,l=c(n);if(l>=0){const{bottom:e}=this.editor.container.getBoundingClientRect();if(l>e-a)return void this.setActionsBar(0,"bottom");let t=0;if(s){const e=Me()(this.editor.container.querySelector("textArea")),r=this.getLineValue(n).length1?void this.setActionsBar(c(n-1)):void this.setActionsBar(c(n+1));t+=this.getLineValue(n).length*e.height()}return void this.setActionsBar(l+t)}if(this.editor.renderer.textToScreenCoordinates(e.end.lineNumber,e.end.column).pageY-t>=0)return void this.setActionsBar(0)}}registerAutocompleter(e){Y.a.define("ace/autocomplete/text_completer",["require","exports","module"],(function(e,t){t.getCompletions=function(e,t,n,r,o){o(null,[])}})),Y.a.acequire("ace/ext/language_tools").setCompleters([{identifierRegexps:[/[a-zA-Z_0-9\.\$\-\u00A2-\uFFFF]/],getCompletions:(t,n,r,o,i)=>{const s={lineNumber:r.row+1,column:r.column+1};e(s,o,i,(()=>{let e;return{setAnnotation(t){const o=n.getAnnotations();e={text:t,row:r.row,column:r.column,type:"warning"},n.setAnnotations([...o,e])},removeAnnotation(){n.setAnnotations(n.getAnnotations().filter((t=>t!==e)))}}})())}}])}destroy(){this.editor.destroy()}autoIndent(e){const t=this.editor.getSession(),n=t.getMode(),r=e.start.lineNumber,o=e.end.lineNumber,i=t.getTabString();for(let e=r;e<=o;e++){let r="",o="";if(e>0){r=t.getState(e-1);const s=t.getLine(e-1);o=n.getNextLineIndent(r,s,i)}const s=t.getLine(e),a=n.$getIndent(s);if(o!==a){if(a.length>0){const n=new Fe(e,0,e,a.length);t.remove(n)}o.length>0&&t.insert({row:e,column:0},o)}n.autoOutdent(r,t,e)}}getAllFoldRanges(){return this.editor.getSession().getAllFolds().map((e=>e.range))}addFoldsAtRanges(e){const t=this.editor.getSession();e.forEach((e=>{try{t.addFold("...",Fe.fromPoints(e.start,e.end))}catch(e){}}))}}const Be=Y.a.acequire("ace/mode/json_highlight_rules").JsonHighlightRules,Ue=e=>{const t=null==e?void 0:e.match(/\d+/);if(t){const e=parseInt(t[0],10);return e<=199?"badge.badge--default":e<=299?"badge.badge--success":e<=399?"badge.badge--primary":e<=499?"badge.badge--warning":"badge.badge--danger"}};class output_highlight_rules_OutputJsonHighlightRules extends Be{constructor(){super(),this.$rules={},pe(this,"start"),this.$rules.start.unshift({token:"warning",regex:"#!.*$"},{token:"comment",regex:/#(.*?)(?=[1-5][0-9][0-9]\s(?:[\sA-Za-z]+)|(?:[1-5][0-9][0-9])|$)/},{token:Ue,regex:/([1-5][0-9][0-9]\s?[\sA-Za-z]+$)/}),this instanceof output_highlight_rules_OutputJsonHighlightRules&&this.normalizeRules()}}const Ve=Y.a.acequire("ace/mode/json").Mode,He=Y.a.acequire("ace/mode/matching_brace_outdent").MatchingBraceOutdent,ze=Y.a.acequire("ace/mode/behaviour/cstyle").CstyleBehaviour,We=Y.a.acequire("ace/mode/folding/cstyle").FoldMode;Y.a.acequire("ace/worker/worker_client");const Ge=Y.a.acequire("ace/tokenizer").Tokenizer;class output_Mode extends Ve{constructor(){super(),this.$tokenizer=new Ge((new output_highlight_rules_OutputJsonHighlightRules).getRules()),this.$outdent=new He,this.$behaviour=new ze,this.foldingRules=new We}}function Ke(e){const t=Y.a.acequire("ace/ace").edit(e),n=new output_Mode;var r;return t.$blockScrolling=1/0,t.resize=De(t),t.update=(e,r,o)=>{"function"==typeof r&&(o=r,r=void 0);const i=t.getSession(),s=e?r||n:"ace/mode/text";i.setMode(s),i.setValue(e),"function"==typeof o&&setTimeout(o)},t.append=(e,n,r)=>{"function"==typeof n&&(r=n,n=!0),v.a.isUndefined(n)&&(n=!0);const o=t.getSession(),i=o.getLength();n&&t.moveCursorTo(Math.max(0,i-1),0),o.insert({row:i,column:0},"\n"+e),t.moveCursorTo(i+1,0),"function"==typeof r&&setTimeout(r)},(r=t.getSession()).setMode("ace/mode/text"),r.setFoldStyle("markbeginend"),r.setTabSize(2),r.setUseWrapMode(!0),t.setShowPrintMargin(!1),t.setReadOnly(!0),t}(function(){this.createWorker=function(){return null},this.$id="sense/mode/input"}).call(output_Mode.prototype);const Je=e=>{const t=document.querySelector("#ConAppEditorActions");if(!t)throw new Error("Could not find ConAppEditorActions element!");const n=Y.a.edit(e);return new legacy_core_editor_LegacyCoreEditor(n,t)};function Qe(e,t){e.setStyles?e.setStyles({wrapLines:t.wrapMode,fontSize:t.fontSize+"px"}):(e.getSession().setUseWrapMode(t.wrapMode),e.container.style.fontSize=t.fontSize+"px")}const{collapseLiteralStrings:Xe,expandLiteralStrings:Ye}=s.XJson;function Ze(e,t){return JSON.stringify(e,null,t?2:0)}function et(e,t){let n=!1;const r=[];for(let o=0;o{if(e)return e.slice().sort(((e,t)=>e.response.statusCode-t.response.statusCode)).pop()},rt=(e,t)=>{const n=/\${(\w+)}/g,r=/([\\"]?)"\${(\w+)}"(?!")/g,o=/([\\"]?)"""\${(\w+)}"""(?!")/g;return e.map((e=>e&&e.url&&e.data?(n.test(e.url)&&(e.url=e.url.replaceAll(n,((e,n)=>{var r;const o=t.find((({name:e})=>e===n));return null!==(r=null==o?void 0:o.value)&&void 0!==r?r:e}))),e.data=e.data.map((e=>(r.test(e)&&(e=e.replaceAll(r,((e,n,r)=>{const o=t.find((({name:e})=>e===r));if(!n&&o){const{value:e}=o;return e.startsWith("{")&&e.endsWith("}")?e:isNaN(parseFloat(e))||ot(e)?e.startsWith("[")&&e.endsWith("]")||"true"===e||"false"===e?e:JSON.stringify(e):e}return e}))),o.test(e)&&(e=e.replaceAll(o,((e,n,r)=>{const o=t.find((({name:e})=>e===r));return!n&&null!=o&&o.value?'""'+JSON.stringify(null==o?void 0:o.value)+'""':e}))),e))),e):e))},ot=e=>"string"==typeof e&&e.match(/[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}/),it=new input_Mode;function st({settings:e,req:t}){const n=Object(r.useRef)(null),o=Object(r.useRef)(null);if(Object(r.useEffect)((()=>{const e=Ke(n.current);o.current=e;const t=Q(n.current,e);return()=>t()}),[]),Object(r.useEffect)((()=>{Qe(o.current,e)}),[e]),o.current){const{current:e}=o;if(t){const n=!0,r=t.data?et([t.data],n).data:"",o=t.method+" "+t.endpoint+"\n"+r;e.update(o,it),e.clearSelection()}else e.update(b.i18n.translate("console.historyPage.noHistoryTextMessage",{defaultMessage:"No history available"}),it)}return Object(_.jsx)("div",{className:"conHistory__viewer",ref:n})}const at=new class editor_registry_EditorRegistry{constructor(){f()(this,"inputEditor",void 0)}setInputEditor(e){this.inputEditor=e}getInputEditor(){return this.inputEditor}},ct=()=>{const e=z();return Object(r.useCallback)((t=>{e({type:"setInputEditor",payload:t}),at.setInputEditor(t)}),[e])},lt={REQUEST_START:2,IN_REQUEST:4,MULTI_DOC_CUR_DOC_END:8,REQUEST_END:16,BETWEEN_REQUESTS:32};class row_parser_RowParser{constructor(e){f()(this,"MODE",lt),this.editor=e}getRowParseMode(e=this.editor.getCurrentPosition().lineNumber){const t=this.editor.getLineCount();if(e>t||e<1)return lt.BETWEEN_REQUESTS;const n=this.editor.getLineState(e);if(!n)return lt.BETWEEN_REQUESTS;if("start"!==n&&"start-sql"!==n)return lt.IN_REQUEST;let r=(this.editor.getLineValue(e)||"").trim();return!r||r.startsWith("#")||r.startsWith("//")||r.startsWith("/*")?lt.BETWEEN_REQUESTS:r.endsWith("}")&&!this.isRequestLine(r)?++e=t+1?lt.REQUEST_START|lt.REQUEST_END:(r=(this.editor.getLineValue(e)||"").trim(),0!==r.indexOf("{")?lt.REQUEST_START|lt.REQUEST_END:lt.REQUEST_START)}rowPredicate(e,t,n){return(this.getRowParseMode(e)&n)>0}isEndRequestRow(e,t){const n=t||this.editor;return this.rowPredicate(e,n,lt.REQUEST_END)}isRequestEdge(e,t){const n=t||this.editor;return this.rowPredicate(e,n,lt.REQUEST_END|lt.REQUEST_START)}isStartRequestRow(e,t){const n=t||this.editor;return this.rowPredicate(e,n,lt.REQUEST_START)}isInBetweenRequestsRow(e,t){const n=t||this.editor;return this.rowPredicate(e,n,lt.BETWEEN_REQUESTS)}isInRequestsRow(e,t){const n=t||this.editor;return this.rowPredicate(e,n,lt.IN_REQUEST)}isMultiDocDocEndRow(e,t){const n=t||this.editor;return this.rowPredicate(e,n,lt.MULTI_DOC_CUR_DOC_END)}isEmptyToken(e){const t=e&&e.getCurrentToken?e.getCurrentToken():e;return!t||"whitespace"===t.type}isUrlOrMethodToken(e){var t;const n=null!==(t=null==e?void 0:e.getCurrentToken())&&void 0!==t?t:e;return n&&n.type&&("method"===n.type||0===n.type.indexOf("url"))}nextNonEmptyToken(e){let t=e.stepForward();for(;t&&this.isEmptyToken(t);)t=e.stepForward();return t}prevNonEmptyToken(e){let t=e.stepBackward();for(;(t||e.getCurrentPosition().lineNumber>1)&&this.isEmptyToken(t);)t=e.stepBackward();return t}isCommentToken(e){return e&&e.type&&("comment.punctuation"===e.type||"comment.line"===e.type||"comment.block"===e.type)}isRequestLine(e){return["GET","POST","PUT","DELETE","HEAD","PATCH","OPTIONS"].some((t=>e.startsWith(t)))}}const ut=()=>Object(r.useCallback)((e=>{!function(e,t){const n=e.getCoreEditor();let r=n.getCurrentPosition(),o="",i="\n";const s=new row_parser_RowParser(n);if(s.isStartRequestRow(r.lineNumber))r.column=1,i+="\n";else if(s.isEndRequestRow(r.lineNumber)){const e=n.getLineValue(r.lineNumber);r.column=e.length+1,o="\n\n"}else s.isInBetweenRequestsRow(r.lineNumber)?r.column=1:(r=e.nextRequestEnd(r),o="\n\n");let a=o+t.method+" "+t.endpoint;if(t.data){const e=!0;a+="\n"+et([t.data],e).data}a+=i,n.insert(r,a),n.moveCursorToPosition({lineNumber:r.lineNumber+o.length,column:1}),n.clearSelection(),n.getContainer().focus()}(at.getInputEditor(),e)}),[]);var pt=n(8),dt=n(25);const ht=({onClearHistory:e,onDisableSavingToHistory:t})=>Object(_.jsx)(w.EuiFlexGroup,{alignItems:"center"},Object(_.jsx)(w.EuiFlexItem,null,Object(_.jsx)(w.EuiButtonEmpty,{onClick:e},Object(_.jsx)(dt.FormattedMessage,{id:"console.notification.clearHistory",defaultMessage:"Clear history"}))),Object(_.jsx)(w.EuiFlexItem,null,Object(_.jsx)(w.EuiButton,{onClick:t},Object(_.jsx)(dt.FormattedMessage,{id:"console.notification.disableSavingToHistory",defaultMessage:"Disable saving"}))));var ft=n(4);function mt(e){const t=e.startsWith(ft.c),n=window.location.origin;if(t)return`${n}/${Object(y.trimStart)(e.replace(ft.c,""),"/")}`}const{collapseLiteralStrings:gt}=s.XJson,bt=e=>{var t;return null!==(t=null==e?void 0:e.headers.get("Content-Type"))&&void 0!==t?t:""},wt=(e,t)=>{var n,r,o,i;return t.startsWith(ft.c)?{statusCode:null!==(o=null==e?void 0:e.status)&&void 0!==o?o:500,statusText:null!==(i=null==e?void 0:e.statusText)&&void 0!==i?i:"error"}:{statusCode:parseInt(null!==(n=null==e?void 0:e.headers.get("x-console-proxy-status-code"))&&void 0!==n?n:"500",10),statusText:null!==(r=null==e?void 0:e.headers.get("x-console-proxy-status-text"))&&void 0!==r?r:"error"}};let yt=0;class AutocompleteComponent{constructor(e){this.name=e}getTerms(){return[]}match(){return{next:this.next}}}class shared_component_SharedComponent extends AutocompleteComponent{constructor(e,t){super(e),this._nextDict={},t&&t.addComponent(this),this._parent=t}getComponent(e){return(this._nextDict[e]||[void 0])[0]}addComponent(e){const t=this._nextDict[e.name]||[];t.push(e),this._nextDict[e.name]=t,this.next=[].concat.apply([],v.a.values(this._nextDict))}}class constant_component_ConstantComponent extends shared_component_SharedComponent{constructor(e,t,n){super(e,t),v.a.isString(n)&&(n=[n]),this.options=n||[e]}getTerms(){return this.options}addOption(e){Array.isArray(e)||(e=[e]),[].push.apply(this.options,e),this.options=v.a.uniq(this.options)}match(e,t,n){return e!==this.name?null:super.match(e,t,n)}}class list_component_ListComponent extends shared_component_SharedComponent{constructor(e,t,n,r,o){super(e,n),this.listGenerator=Array.isArray(t)?function(){return t}:t,this.multiValued=!!v.a.isUndefined(r)||r,this.allowNonValidValues=!v.a.isUndefined(o)&&o}getTerms(e,t){if(!this.multiValued&&e.otherTokenValues)return[];let n=e.otherTokenValues||[];v.a.isString(n)&&(n=[n]);let r=v.a.difference(this.listGenerator(e,t),n);if(this.getDefaultTermMeta()){const e=this.getDefaultTermMeta();r=v.a.map(r,(function(t){return v.a.isString(t)&&(t={name:t}),v.a.defaults(t,{meta:e})}))}return r}validateTokens(e){if(!this.multiValued&&e.length>1)return!1;const t=this.listGenerator();return!v.a.some(e,(function(e){return-1===t.indexOf(e)}))}getContextKey(){return this.name}getDefaultTermMeta(){return this.name}match(e,t,n){if(Array.isArray(e)||(e=[e]),!this.allowNonValidValues&&!this.validateTokens(e,t,n))return null;const r=super.match(e,t,n);return r.context_values=r.context_values||{},r.context_values[this.getContextKey()]=e,r}}class simple_param_component_SimpleParamComponent extends shared_component_SharedComponent{constructor(e,t){super(e,t)}match(e,t,n){const r=super.match(e,t,n);return r.context_values=r.context_values||{},r.context_values[this.name]=e,r}}class conditional_proxy_ConditionalProxy extends shared_component_SharedComponent{constructor(e,t){super("__condition"),this.predicate=e,this.delegate=t}getTerms(e,t){return this.predicate(e,t)?this.delegate.getTerms(e,t):null}match(e,t,n){return!!this.predicate(t,n)&&this.delegate.match(e,t,n)}}class global_only_component_GlobalOnlyComponent extends shared_component_SharedComponent{getTerms(){return null}match(e,t){const n={next:[]},r=t.globalComponentResolver(e,!1);return r&&n.next.push.apply(n.next,r),n.next.length||(n.next=[this]),n}}class object_component_ObjectComponent extends shared_component_SharedComponent{constructor(e,t,n){super(e),this.constants=t,this.patternsAndWildCards=n}getTerms(e,t){const n=[];return v.a.each(this.constants,(function(r){n.push.apply(n,r.getTerms(e,t))})),v.a.each(this.patternsAndWildCards,(function(r){n.push.apply(n,r.getTerms(e,t))})),n}match(e,t,n){const r={next:[]};v.a.each(this.constants,(function(o){const i=o.match(e,t,n);i&&i.next&&r.next.push.apply(r.next,i.next)}));const o=t.globalComponentResolver(e,!1);return o&&r.next.push.apply(r.next,o),r.next.length||v.a.each(this.patternsAndWildCards,(function(o){const i=o.match(e,t,n);i&&i.next&&r.next.push.apply(r.next,i.next)})),r}}const vt="__url_path_end__";class accept_endpoint_component_AcceptEndpointComponent extends shared_component_SharedComponent{constructor(e,t){super(e.id,t),this.endpoint=e}match(e,t,n){if(e!==vt)return null;if(this.endpoint.methods&&-1===v.a.indexOf(this.endpoint.methods,t.method))return null;const r=super.match(e,t,n);return r.context_values=r.context_values||{},r.context_values.endpoint=this.endpoint,v.a.isNumber(this.endpoint.priority)&&(r.priority=this.endpoint.priority),r}}class full_request_component_FullRequestComponent extends constant_component_ConstantComponent{constructor(e,t,n){super(e,t),f()(this,"name",void 0),this.template=n,this.name=e}getTerms(){return[{name:this.name,snippet:this.template}]}}class url_pattern_matcher_UrlPatternMatcher{constructor(e){f()(this,"getTopLevelComponents",(function(e){const t=this[e];return t?t.rootComponent.next:[]})),["HEAD","GET","PUT","POST","DELETE"].forEach((t=>{this[t]={rootComponent:new shared_component_SharedComponent("ROOT"),parametrizedComponentFactories:e||{getComponent:()=>{}}}}))}addEndpoint(e,t){t.methods.forEach((n=>{let r,o=this[n].rootComponent;t.template&&new full_request_component_FullRequestComponent(e+"[body]",o,t.template);const i=t.url_components||{},s=e.split("/");v.a.each(s,((e,a)=>{if(e.search(/^{.+}$/)>=0){if(e=e.substr(1,e.length-2),o.getComponent(e))return void(o=o.getComponent(e));(r=i[e])?Array.isArray(r)?r=new list_component_ListComponent(e,r,o):v.a.isObject(r)&&"list"===r.type?r=new list_component_ListComponent(e,r.list,o,r.multiValued,r.allow_non_valid):(console.warn("incorrectly configured url component ",e," in endpoint",t),r=new shared_component_SharedComponent(e)):r=(r=this[n].parametrizedComponentFactories.getComponent(e))?r(e,o):new simple_param_component_SimpleParamComponent(e,o),o=r}else{let t,n=e;for(a++;a=0));a++)n+="/"+t;o.getComponent(e)?(o=o.getComponent(e),o.addOption(n)):(r=new constant_component_ConstantComponent(e,o,n),o=r)}})),new accept_endpoint_component_AcceptEndpointComponent(t,o)}))}}function xt(e){return!("_all"===e||"_"!==e[0])}class index_autocomplete_component_IndexAutocompleteComponent extends list_component_ListComponent{constructor(e,t,n){super(e,Object(u.h)().getEntityProvider(u.c.INDICES),t,n)}validateTokens(e){return!(!this.multiValued&&e.length>1||v.a.find(e,xt))}}function jt(e){return v.a.map(Object(u.h)().getEntityProvider(u.c.FIELDS,e),(function(e){return{name:e.name,meta:e.type}}))}class field_autocomplete_component_FieldAutocompleteComponent extends list_component_ListComponent{constructor(e,t,n){super(e,jt,t,n)}validateTokens(e){return!(!this.multiValued&&e.length>1||v.a.find(e,(function(e){return e.match(/[^\w.?*]/)})))}getDefaultTermMeta(){return"field"}getContextKey(){return"fields"}}class index_template_autocomplete_component_IndexTemplateAutocompleteComponent extends list_component_ListComponent{constructor(e,t){super(e,Object(u.h)().getEntityProvider(u.c.INDEX_TEMPLATES),t,!0,!0)}getContextKey(){return"index_template"}}class component_template_autocomplete_component_ComponentTemplateAutocompleteComponent extends list_component_ListComponent{constructor(e,t){super(e,Object(u.h)().getEntityProvider(u.c.COMPONENT_TEMPLATES),t,!0,!0)}getContextKey(){return"component_template"}}class data_stream_autocomplete_component_DataStreamAutocompleteComponent extends list_component_ListComponent{constructor(e,t,n){super(e,Object(u.h)().getEntityProvider(u.c.DATA_STREAMS),t,n)}getContextKey(){return"data_stream"}}class legacy_template_autocomplete_component_LegacyTemplateAutocompleteComponent extends list_component_ListComponent{constructor(e,t){super(e,Object(u.h)().getEntityProvider("legacyTemplates"),t,!0,!0)}getContextKey(){return"template"}}class url_params_ParamComponent extends constant_component_ConstantComponent{constructor(e,t,n){super(e,t),this.description=n}getTerms(){const e={name:this.name};return"__flag__"===this.description?e.meta="flag":(e.meta="param",e.insertValue=this.name+"="),[e]}}class url_params_UrlParams{constructor(e,t){this.rootComponent=new shared_component_SharedComponent("ROOT"),v.a.isUndefined(t)&&(t={pretty:"__flag__",format:["json","yaml"],filter_path:""}),e=v.a.clone(e||{}),v.a.defaults(e,t),v.a.each(e,((e,t)=>{const n=new url_params_ParamComponent(t,this.rootComponent,e);Array.isArray(e)?new list_component_ListComponent(t,e,n):"__flag__"===e&&new list_component_ListComponent(t,["true","false"],n)}))}getTopLevelComponents(){return this.rootComponent.next}}const _t=function(){window.engine_trace&&console.log.call(console,...arguments)};function Ot(e,t){function n(){}n.prototype=e;const r=new n;return t&&(t.unshift(r),v.a.assign.apply(v.a,t),t.shift()),r}function Et(e,t,n,r,o){this.parentName=e,this.components=t,this.contextExtensionList=n,this.depth=r||0,this.priority=o}function kt(e,t,n,r){if(!e||0===e.length)return t;const o=e[0],i=[];return _t("starting token evaluation ["+o+"]"),v.a.each(t,(function(e){const t=Ot(n,e.contextExtensionList);v.a.each(e.components,(function(n){_t("evaluating ["+o+"] with ["+n.name+"]",n);const s=n.match(o,t,r);if(s&&!v.a.isEmpty(s)){let t,r;_t("matched ["+o+"] with:",s),t=s.next&&!Array.isArray(s.next)?[s.next]:s.next,s.context_values?(r=[],[].push.apply(r,e.contextExtensionList),r.push(s.context_values)):r=e.contextExtensionList;let a=e.priority;v.a.isNumber(s.priority)&&(a=v.a.isNumber(a)?Math.min(a,s.priority):s.priority),i.push(new Et(n.name,t,r,e.depth+1,a))}}))})),0===i.length?v.a.map(t,(function(e){return new Et(e.name,[],e.contextExtensionList)})):kt(e.slice(1),i,n,r)}function Rt(e,t,n,r,o){let i=kt(e,[new Et("ROOT",o,[])],t,n);if(r){let e=[];v.a.each(i,(function(r){const o=Ot(t,r.contextExtensionList);v.a.each(r.components,(function(t){v.a.each(t.getTerms(o,n),(function(t){v.a.isObject(t)||(t={name:t}),e.push(t)}))}))})),e=v.a.uniq(e),t.autoCompleteSet=e}if(0!==i.length){let e;i=v.a.sortBy(i,(function(e){return v.a.isNumber(e.priority)?e.priority:Number.MAX_VALUE})),e=v.a.find(i,(function(e){return v.a.isEmpty(e.components)})),!e&&i.length>1&&!r&&console.info("more than one context active for current path, but autocomplete isn't requested",i),e||(e=i[0]),v.a.each(e.contextExtensionList,(function(e){v.a.assign(t,e)}))}}function St(e,t){this.parametrizedComponentFactories=t,this.endpointId=e}class body_completer_ScopeResolver extends shared_component_SharedComponent{constructor(e,t){super("__scope_link"),v.a.isString(e)&&"."===e[0]&&(e="."===e?t.endpointId:t.endpointId+e),this.link=e,this.compilingContext=t}resolveLinkToComponents(e,t){if(v.a.isFunction(this.link))return At(this.link(e,t),this.compilingContext);if(!v.a.isString(this.link))throw new Error("unsupported link format",this.link);let n=this.link.replace(/\./g,"{").split(/(\{)/);const r=n[0];let o;try{if("GLOBAL"===r){if(n.length<3)throw new Error("missing term in global link: "+this.link);const t=n[2];o=e.globalComponentResolver(t),n=n.slice(3)}else n=n.slice(1),o=e.endpointComponentResolver(r)}catch(e){throw new Error("failed to resolve link ["+this.link+"]: "+e)}return function(e,t,n,r){const o=kt(e,[new Et("ROOT",r,[])],t,n);return[].concat.apply([],v.a.map(o,"components"))}(n,e,t,o)}getTerms(e,t){const n=[],r=this.resolveLinkToComponents(e,t);return v.a.each(r,(function(r){n.push.apply(n,r.getTerms(e,t))})),n}match(e,t,n){const r={next:[]},o=this.resolveLinkToComponents(t,n);return v.a.each(o,(function(o){const i=o.match(e,t,n);i&&i.next&&r.next.push.apply(r.next,i.next)})),r}}function Tt(e){if(e.__template)return e.__raw&&v.a.isString(e.__template)?{__raw:!0,value:e.__template}:e.__template;if(e.__one_of)return Tt(e.__one_of[0]);if(e.__any_of)return[];if(e.__scope_link)return{};if(Array.isArray(e)){if(1===e.length&&v.a.isObject(e[0])){const t=Tt(e[0]);return null!=t?[t]:[]}return[]}return v.a.isObject(e)?{}:(v.a.isString(e)&&/^\{.*\}$/.test(e),e)}function Ct(e){const t={},n=Tt(e);return v.a.isUndefined(n)||(t.template=n),t}function At(e,t){if(Array.isArray(e))return[Lt(e,t)];if(v.a.isObject(e)){if(e.__scope_link)return[new body_completer_ScopeResolver(e.__scope_link,t)];if(e.__any_of)return[Lt(e.__any_of,t)];if(e.__one_of)return v.a.flatten(v.a.map(e.__one_of,(function(e){return At(e,t)})));const n=function(e,t){const n=new constant_component_ConstantComponent("{"),r=[],o=[];return v.a.each(e,(function(e,n){if(0===n.indexOf("__"))return;const i=Ct(e);let s;/^\{.*\}$/.test(n)?(s=Pt(n,t,i.template),o.push(s)):"*"===n?(s=new shared_component_SharedComponent(n),o.push(s)):(i.name=n,s=new constant_component_ConstantComponent(n,null,[i]),r.push(s)),v.a.map(At(e,t),(function(e){s.addComponent(e)}))})),n.addComponent(new object_component_ObjectComponent("inner",r,o)),n}(e,t);return e.__condition?[Nt(e.__condition,n)]:[n]}return v.a.isString(e)&&/^\{.*\}$/.test(e)?[Pt(e,t)]:[new constant_component_ConstantComponent(e)]}function Pt(e,t,n){e=e.substr(1,e.length-2).toLowerCase();let r=t.parametrizedComponentFactories.getComponent(e,!0);return r?(r=r(e,null,n),v.a.isUndefined(n)||(r=function(e,t){const n=e.getTerms;return e.getTerms=function(r,o){let i=n.call(e,r,o);return i?(i=v.a.map(i,(e=>(v.a.isObject(e)||(e={name:e}),v.a.defaults(e,t)))),i):i},e}(r,{template:n})),r):(console.warn("[Console] no factory found for '"+e+"'"),new constant_component_ConstantComponent(e.toUpperCase()))}function Lt(e,t){const n=new constant_component_ConstantComponent("[");return v.a.each(e,(function(e){v.a.each(At(e,t),(function(e){n.addComponent(e)}))})),n}function Nt(e,t){if(e.lines_regex)return new conditional_proxy_ConditionalProxy((function(t,n){const r=n.getLines(t.requestStartRow,n.getCurrentPosition().lineNumber).join("\n");return new RegExp(e.lines_regex,"m").test(r)}),t);throw"unknown condition type - got: "+JSON.stringify(e)}function Mt(e,t,n){return At(t,new St(e,n))}function It(e,t){this.globalRules=Object.create(null),this.endpoints=Object.create(null),this.urlPatternMatcher=new url_pattern_matcher_UrlPatternMatcher(e),this.globalBodyComponentFactories=t,this.name=""}var qt;(qt=It.prototype).addGlobalAutocompleteRules=function(e,t){this.globalRules[e]=Mt("GLOBAL."+e,t,this.globalBodyComponentFactories)},qt.getGlobalAutocompleteComponents=function(e,t){const n=this.globalRules[e];if(v.a.isUndefined(n)&&(t||v.a.isUndefined(t)))throw new Error("failed to resolve global components for ['"+e+"']");return n},qt.addEndpointDescription=function(e,t){const n={};v.a.assign(n,t||{}),v.a.defaults(n,{id:e,patterns:[e],methods:["GET"]}),v.a.each(n.patterns,(e=>{this.urlPatternMatcher.addEndpoint(e,n)})),n.paramsAutocomplete=new url_params_UrlParams(n.url_params),n.bodyAutocompleteRootComponents=Mt(n.id,n.data_autocomplete_rules,this.globalBodyComponentFactories),this.endpoints[e]=n},qt.getEndpointDescriptionByEndpoint=function(e){return this.endpoints[e]},qt.getTopLevelUrlCompleteComponents=function(e){return this.urlPatternMatcher.getTopLevelComponents(e)},qt.getUnmatchedEndpointComponents=function(){return[new global_only_component_GlobalOnlyComponent("__global__")]},qt.clear=function(){this.endpoints={},this.globalRules={}};var Dt=It;let Ft=new Dt;const $t={getComponent:function(e,t,n){return this[e]?this[e]:n?new list_component_ListComponent(e,[],t,!1):void 0},index:function(e,t){if(!(e=>"_"===e[0]&&"_all"!==e)(e))return new index_autocomplete_component_IndexAutocompleteComponent(e,t,!0)},fields:function(e,t){return new field_autocomplete_component_FieldAutocompleteComponent(e,t,!0)},field:function(e,t){return new field_autocomplete_component_FieldAutocompleteComponent(e,t,!1)},template:function(e,t){return new legacy_template_autocomplete_component_LegacyTemplateAutocompleteComponent(e,t)},index_template:function(e,t){return new index_template_autocomplete_component_IndexTemplateAutocompleteComponent(e,t)},component_template:function(e,t){return new component_template_autocomplete_component_ComponentTemplateAutocompleteComponent(e,t)},data_stream:function(e,t){return new data_stream_autocomplete_component_DataStreamAutocompleteComponent(e,t)}};function Bt(e){const t=function(e){return Ft.getEndpointDescriptionByEndpoint(e)}(e);if(!t)throw new Error("failed to resolve endpoint ['"+e+"']");return t.bodyAutocompleteRootComponents}function Ut(e){return Ft.getTopLevelUrlCompleteComponents(e)}function Vt(e,t){return Ft.getGlobalAutocompleteComponents(e,t)}!function e(t){t?Ft=t:Me.a.ajax({url:"../api/console/api_server",dataType:"json",headers:{"kbn-xsrf":"kibana","x-elastic-internal-origin":"Kibana"}}).then((function(t){e(function(e,t,n){try{const r=new Dt(t=t||$t,n=n||t),o=[];return v.a.each(e,(function(e,t){o.unshift(t),v.a.each(e.globals||{},(function(e,t){r.addGlobalAutocompleteRules(t,e)})),v.a.each(e.endpoints||{},(function(e,t){r.addEndpointDescription(t,e)}))})),r.name=o.join(","),r}catch(e){console.error(e)}}(t))}),(function(e){console.log("failed to load API '"+t+"': "+e.responseText)}))}();class token_iterator_TokenIterator{constructor(e,t){f()(this,"currentTokenIdx",-1),f()(this,"currentPosition",{lineNumber:-1,column:-1}),f()(this,"tokensLineCache",void 0),this.provider=e,this.tokensLineCache=this.provider.getTokens(t.lineNumber)||[];const n=this.tokensLineCache.findIndex((e=>function(e,t){return!(e-1?this.updatePosition({tokenIdx:n,position:this.tokensLineCache[n].position}):this.updatePosition({tokenIdx:-1,position:t})}updateLineTokens(e){this.tokensLineCache=e}updatePosition(e){this.currentTokenIdx=e.tokenIdx,this.currentPosition={...e.position}}step(e){const t=this.currentTokenIdx+e;let n=this.tokensLineCache[t];if(n)return this.updatePosition({tokenIdx:t,position:n.position}),n;const r=this.currentPosition.lineNumber+e,o=this.provider.getTokens(r);if(o){let t;this.updateLineTokens(o),e>0?(n=o[0],t=0):(n=o[o.length-1],t=n?o.length-1:0);const i=n?n.position:{column:1,lineNumber:r};return this.updatePosition({tokenIdx:t,position:i}),n||null}return null}getCurrentToken(){return this.tokensLineCache[this.currentTokenIdx]||null}getCurrentPosition(){return this.currentPosition}stepBackward(){return this.step(-1)}stepForward(){return this.step(1)}getCurrentTokenLineNumber(){const e=this.getCurrentToken();return e?e.position.lineNumber:null}getCurrentTokenColumn(){const e=this.getCurrentToken();return e?e.position.column:null}}function Ht({editor:e,position:t}){const n=e.getTokenProvider();return new token_iterator_TokenIterator(n,t)}let zt=null;function Wt(e){switch((e||{}).type){case"url.param":case"url.equal":case"url.value":case"url.questionmark":case"url.amp":return!0;default:return!1}}function Gt(e,t,n,r){const o=Ht({editor:e,position:t}),i=t;let s=[];const a={};let c=3,l=o.getCurrentToken();l?1===i.column&&(l=o.stepBackward(),c=1):1===i.column&&(l=o.stepBackward(),c=3);let u,p=!1;for(;l&&-1===l.type.indexOf("url")&&"method"!==l.type;l=o.stepBackward())switch("whitespace"!==l.type&&(p=!0),l.type){case"variable":0===c&&s.unshift(l.value.trim().replace(/"/g,"")),c=1;break;case"paren.lparen":s.unshift(l.value),1===c&&(c=0);break;case"paren.rparen":c=1;let e=1;for(l=o.stepBackward();l&&e>0;){switch(l.type){case"paren.lparen":e--;break;case"paren.rparen":e++}e>0&&(l=o.stepBackward())}if(!l)return{};continue;case"punctuation.end_triple_quote":for(c=1,l=o.stepBackward();l;l=o.stepBackward())if("punctuation.start_triple_quote"===l.type){l=o.stepBackward();break}if(!l)return{};continue;case"punctuation.start_triple_quote":3===c?c=0:0===c&&(c=1),s.unshift('"""');continue;case"string":case"constant.numeric":case"constant.language.boolean":case"text":3===c?c=0:0===c&&(c=1);break;case"punctuation.comma":3===c&&(c=1);break;case"punctuation.colon":case"whitespace":3===c&&(c=0)}if(p&&(!s||0===s.length)&&!r)return{};if(a.urlTokenPath=[],o.getCurrentPosition().lineNumber===i.lineNumber){if(l&&("url.part"===l.type||"url.param"===l.type||"url.value"===l.type))for(r&&"url.part"===l.type&&(a.urlTokenPath.push(l.value),a.urlTokenPath.push(vt)),l=o.stepBackward();"whitespace"===l.type;)l=o.stepBackward();s=null}for(a.bodyTokenPath=s,a.urlParamsTokenPath=null,a.requestStartRow=o.getCurrentPosition().lineNumber;l&&Wt(l);){switch(l.type){case"url.value":Array.isArray(u)?u.unshift(l.value):u=u?[l.value,u]:l.value;break;case"url.comma":u?Array.isArray(u)||(u=[u]):u=[];break;case"url.param":const e=u;u={},u[l.value]=e;break;case"url.amp":case"url.questionmark":a.urlParamsTokenPath||(a.urlParamsTokenPath=[]),a.urlParamsTokenPath.unshift(u||{}),u=null}l=o.stepBackward()}for(u=null;l&&-1!==l.type.indexOf("url");){switch(l.type){case"url.part":Array.isArray(u)?u.unshift(l.value):u=u?[l.value,u]:l.value;break;case"url.comma":u?Array.isArray(u)||(u=[u]):u=[];break;case"url.slash":u&&(a.urlTokenPath.unshift(u),u=null)}l=n.prevNonEmptyToken(o)}return u&&a.urlTokenPath.unshift(u),a.bodyTokenPath||a.urlParamsTokenPath?a.urlTokenPath.push(vt):a.urlTokenPath.length>0&&(a.otherTokenValues=a.urlTokenPath[0]),l&&"method"===l.type&&(a.method=l.value),a}var Kt=function({coreEditor:e,parser:t}){function n(e){switch((e||{}).type){case"url.slash":case"url.comma":case"url.part":return!0;default:return!1}}function r(t,n){const r=n&&n[t];if(r){const t=e.getCurrentPosition().lineNumber;if("object"==typeof(s=r)&&null!==s&&"__one_of"in s){const n=o(t,r.__one_of),s=i(e.getLines(n,t).join("\n"),r.__one_of);if(s&&s.__template)return s.__template}}var s}function o(t,n){return 1===t||i(e.getLineValue(t),n)?t:o(t-1,n)}function i(e,t){return t.find((t=>!(!t.__condition||!t.__condition.lines_regex)&&new RegExp(t.__condition.lines_regex,"m").test(e)))}function s(n,r,o){n.updatedForToken=v.a.clone(e.getTokenAt({lineNumber:r.lineNumber,column:r.column})),n.updatedForToken||(n.updatedForToken={value:"",type:"",position:{column:r.column,lineNumber:r.lineNumber}});let i=n.createdWithToken;switch(i||(i=n.updatedForToken),n.updatedForToken.type){case"variable":case"string":case"text":case"constant.numeric":case"constant.language.boolean":case"method":case"url.index":case"url.type":case"url.id":case"url.method":case"url.endpoint":case"url.part":case"url.param":case"url.value":n.rangeToReplace={start:{lineNumber:r.lineNumber,column:i.position.column},end:{lineNumber:r.lineNumber,column:n.updatedForToken.position.column+n.updatedForToken.value.length}},n.replacingToken=!0;break;default:o&&n.updatedForToken.value===o?(n.rangeToReplace={start:{lineNumber:r.lineNumber,column:i.position.column},end:{lineNumber:r.lineNumber,column:n.updatedForToken.position.column+n.updatedForToken.value.length}},n.replacingToken=!0):(n.rangeToReplace={start:{lineNumber:r.lineNumber,column:r.column},end:{lineNumber:r.lineNumber,column:r.column}},n.replacingToken=!1)}switch(n.textBoxPosition={lineNumber:n.rangeToReplace.start.lineNumber,column:n.rangeToReplace.start.column},n.autoCompleteType){case"path":case"url_params":!function(e){e.prefixToAdd="",e.suffixToAdd=""}(n);break;case"method":!function(n){n.prefixToAdd="",n.suffixToAdd="";const r=Ht({editor:e,position:e.getCurrentPosition()}),o=r.getCurrentPosition().lineNumber,i=t.nextNonEmptyToken(r);r.getCurrentPosition().lineNumber===o&&i||(n.suffixToAdd=" ")}(n);break;case"body":!function(n){var r;n.prefixToAdd="",n.suffixToAdd="";let o,i=Ht({editor:e,position:e.getCurrentPosition()}),s=t.nextNonEmptyToken(i);switch(s?s.type:"NOTOKEN"){case"NOTOKEN":case"paren.lparen":case"paren.rparen":case"punctuation.comma":n.addTemplate=!0;break;case"punctuation.colon":if(n.addTemplate=!1,s=t.nextNonEmptyToken(i),!s||"{"!==s.value)break;if(s=t.nextNonEmptyToken(i),!s||"}"!==s.value)break;switch(n.addTemplate=!0,n.rangeToReplace.end.lineNumber=i.getCurrentTokenLineNumber(),n.rangeToReplace.end.column=i.getCurrentTokenColumn()+s.value.length,s=t.nextNonEmptyToken(i),s?s.type:"NOTOKEN"){case"NOTOKEN":case"paren.rparen":case"punctuation.comma":case"punctuation.colon":break;default:n.suffixToAdd=", "}break;default:n.addTemplate=!0,n.suffixToAdd=", "}if(i=Ht({editor:e,position:e.getCurrentPosition()}),s=i.getCurrentToken(),n.replacingToken)o=0;else{const t=e.getCurrentPosition();o=t.column===n.updatedForToken.position.column?-1:t.column1){var o,i;const e=s.lineNumber,r=(null!==(o=null===(i=t.editor)||void 0===i?void 0:i.getLineValue(e))&&void 0!==o?o:"").length,a=t.rangeToReplace.end.lineNumber-e,c=0===a;let l=r+1,u=t.rangeToReplace.start.column-1;c&&(l=s.column+n,u=t.rangeToReplace.end.column-l-2),t.rangeToReplace={start:{lineNumber:e,column:l},end:{...t.rangeToReplace.end}},u=u>=0?u:0;const p=c&&0===u?1:u,d="\n".repeat(a>=0?a:0),h=" ".repeat(p);t.prefixToAdd=`,${d}${h}`}}}const c=v.a.debounce((function(n){let r=e.getTokenAt(n);if(!r){if(1===n.lineNumber)return void(zt=null);r={position:{column:0,lineNumber:0},value:"",type:""}}if(r.position.lineNumber=n.lineNumber,t.isEmptyToken(r)){const o=e.getTokenAt({...n,column:n.column+1});t.isEmptyToken(o)?(r.position.column=n.column,zt=r):(o.position.lineNumber=n.lineNumber,zt=o)}else if(zt)if(zt.position.column===r.position.column&&zt.position.lineNumber===r.position.lineNumber||zt.value!==r.value){switch(r.type||"UNKNOWN"){case"paren.lparen":case"paren.rparen":case"punctuation.colon":case"punctuation.comma":case"comment.line":case"comment.punctuation":case"comment.block":case"UNKNOWN":return}zt=r,e.execCommand("startAutocomplete")}else zt=r;else zt=r}),100);function l(){const t=e.getCurrentPosition();t&&!e.isCompleterActive()&&c(t)}function u(n,o){const i=v.a.map(o.filter((e=>Boolean(e)&&null!=e.name)),(function(o){const i={value:(o="object"!=typeof o?{name:o}:v.a.clone(o)).name,meta:"API",score:0,context:n};return"body"===n.autoCompleteType&&(i.completer={insertMatch:()=>function(n){var o,i,a,c;const u=n.context;if(null!=u&&u.endpoint&&n.value){const{data_autocomplete_rules:e}=u.endpoint,t=r(n.value,e);t&&(n.template=t)}let p;s(u,e.getCurrentPosition(),n.insertValue),"body"===u.autoCompleteType?(p="string"==typeof n.insertValue?'"'+n.insertValue+'"':n.insertValue+"","["!==n.insertValue&&"{"!==n.insertValue||(p="")):p=n.insertValue+"";let d=p,h=!1;if(!u.addTemplate||v.a.isUndefined(n.template)||v.a.isNull(n.template))h=!0,"["===n.value?d+="[]":"{"===n.value?d+="{}":h=!1;else{let t;t=n.template.__raw&&n.template.value?n.template.value.split("\n"):Ze(n.template,!0).split("\n");let r=e.getLineValue(u.rangeToReplace.start.lineNumber);r=r.match(/^\s*/)[0];for(let e=1;e0&&function(t,n){const r=t.length-1;t.forEach(((t,o)=>{if(o>=r)return;const i=n+o+1,s={lineNumber:i,column:0},a={lineNumber:i,column:e.getLineValue(i).length-1};e.replace({start:s,end:a},t)}))}(n,o.lineNumber),m=r,u.rangeToReplace.start.lineNumber=u.rangeToReplace.end.lineNumber,u.rangeToReplace.start.column=0}d=m+d+u.suffixToAdd,u.rangeToReplace.start.column!==u.rangeToReplace.end.column?e.replace(u.rangeToReplace,d):e.insert(d),e.clearSelection();let y={lineNumber:u.rangeToReplace.start.lineNumber,column:u.rangeToReplace.start.column+p.length+m.length+(h?0:u.suffixToAdd.length)};const x=Ht({editor:e,position:y});if("body"===u.autoCompleteType){let n=t.nextNonEmptyToken(x);switch(n?n.type:"NOTOKEN"){case"paren.rparen":y=x.getCurrentPosition();break;case"punctuation.colon":n=t.nextNonEmptyToken(x),"paren.lparen"===(n||{}).type&&(n=t.nextNonEmptyToken(x),y=x.getCurrentPosition(),n&&0===n.value.indexOf('"')&&y.column++);break;case"paren.lparen":case"punctuation.comma":x.stepForward(),y=x.getCurrentPosition()}e.moveCursorToPosition(y)}e.on("changeSelection",l)}(o)}),v.a.defaults(o,i)}));return i.sort((function(e,t){return e.score>t.score?-1:e.score({name:e,score:-t,meta:b.i18n.translate("console.autocomplete.addMethodMetaText",{defaultMessage:"method"})})))}(a);break;case"body":!function(n,r){const o=Gt(e,r,t);if(n.method=o.method,n.otherTokenValues=o.otherTokenValues,n.urlTokenPath=o.urlTokenPath,n.requestStartRow=o.requestStartRow,!o.urlTokenPath)return n;if(Rt(o.urlTokenPath,n,e,!1,Ut(n.method)),n.bodyTokenPath=o.bodyTokenPath,!o.bodyTokenPath)return n;let i;n.endpointComponentResolver=Bt,n.globalComponentResolver=Vt,i=n.endpoint?n.endpoint.bodyAutocompleteRootComponents:Ft.getUnmatchedEndpointComponents(),Rt(o.bodyTokenPath,n,e,!0,i)}(a,o);break;default:return null}const c="body"===a.autoCompleteType&&!(null===(i=a.asyncResultsState)||void 0===i||!i.isLoading);return a.autoCompleteSet||c?(s(a,o),a.createdWithToken=v.a.clone(a.updatedForToken),a):null}(e,r);if(o){var c;if(null===(c=o.asyncResultsState)||void 0===c||!c.isLoading){const e=p(u(o,o.autoCompleteSet));i(null,e)}o.asyncResultsState&&(a.setAnnotation(b.i18n.translate("console.autocomplete.fieldsFetchingAnnotation",{defaultMessage:"Fields fetching is in progress"})),o.asyncResultsState.results.then((e=>{const t=p(u(o,e));i(null,t),a.removeAnnotation()})))}else i(null,[])}catch(e){console.error(e),i(e,null)}}return e.on("changeSelection",l),{getCompletions:d,_test:{getCompletions:(e,t,n,r,o,i)=>d(n,0,o,i),addReplacementInfoToContext:s,addChangeListener:()=>e.on("changeSelection",l),removeChangeListener:()=>e.off("changeSelection",l)}}};function Jt(e,t,n){const r=e.getLineValue(t.lineNumber),o={...Gt(e,{column:r.length+1,lineNumber:t.lineNumber},n,!0)},i=Ut(o.method);return Rt(o.urlTokenPath,o,e,!0,i),o.endpoint}const Qt=()=>{const{services:{history:e,settings:t,notifications:n,trackUiMetric:o,http:i,autocompleteInfo:s,storage:c},theme$:l}=k(),p=q();return Object(r.useCallback)((async()=>{try{const r=at.getInputEditor(),d=c.get(u.d.VARIABLES,ft.b);let h=await r.getRequestsInRange();if(h=rt(h,d),!h.length)return void n.toasts.add(b.i18n.translate("console.notification.error.noRequestSelectedTitle",{defaultMessage:"No request selected. Select a request by placing the cursor inside it."}));p({type:"sendRequest",payload:void 0}),setTimeout((()=>((e,t,n)=>{const r=t.getCoreEditor(),o=Jt(r,r.getCurrentPosition(),t.parser);if(e[0]&&o){var i;const t=`${e[0].method}_${null!==(i=o.id)&&void 0!==i?i:"unknown"}`;n.count(t)}})(h,r,o)),0);const f=await function(e){const t=e.requests.slice();return new Promise(((n,r)=>{const o=++yt,i=[];if(o!==yt)return;if(0===t.length)return;const s=t.length>1,a=async()=>{if(o!==yt)return void n(i);if(0===t.length)return void n(i);const c=t.shift(),l=c.url,u=c.method;let p=gt(c.data.join("\n"));p&&(p+="\n");const d=Date.now();try{const{response:t,body:n}=await async function({http:e,method:t,path:n,data:r,asSystemRequest:o=!1,withProductOrigin:i=!1,asResponse:s=!1}){const a=mt(n);if(a){const n=t.toLowerCase(),i=new URL(a),{pathname:c,searchParams:l}=i,u=Object.fromEntries(l.entries()),p=["post","put","patch"].includes(n)?r:null;return await e[n](c,{body:p,query:u,asResponse:s,asSystemRequest:o})}return await e.post(`${ft.a}/proxy`,{query:{path:n,method:t,...i&&{withProductOrigin:i}},body:r,asResponse:s,asSystemRequest:o})}({http:e.http,method:u,path:l,data:p,asResponse:!0}),{statusCode:r,statusText:h}=wt(t,l);if(o!==yt)return;if(t){let e;e=n instanceof ArrayBuffer||"string"==typeof n?n:JSON.stringify(n,null,2);const o=t.headers.get("warning");if(o){const t=function(e){const t=/\d{3} [0-9a-zA-Z!#$%&'*+-.^_`|~]+ \"((?:\t| |!|[\x23-\x5b]|[\x5d-\x7e]|[\x80-\xff]|\\\\|\\")*)\"(?: \"[^"]*\")?/;return v.a.map(function(e){let t=!1;const n=[];let r="",o=0;for(;o{const n=t.exec(e);return"#! "+(null!==n?n[1].replace(/\\\\/g,"\\").replace(/\\"/g,'"'):e)}))}(o);e=t.join("\n")+"\n"+e}s&&(e=`# ${c.method} ${c.url} ${r} ${h}\n${e}`),i.push({response:{timeMs:Date.now()-d,statusCode:r,statusText:h,contentType:bt(t),value:e},request:{data:p,method:u,path:l}}),await a()}}catch(e){let t;const{response:n,body:o}=e,{statusCode:h,statusText:f}=wt(n,l);t=o?JSON.stringify(o,null,2):"Request failed to get to the server (status code: "+h+")",s&&(t=`# ${c.method} ${c.url} ${h} ${f}\n${t}`);const m={response:{value:t,contentType:bt(n),timeMs:Date.now()-d,statusCode:h,statusText:f},request:{data:p,method:u,path:l}};n||r(m),i.push(m),await a()}};a()}))}({http:i,requests:h});let m;const{isHistoryEnabled:g}=t.toJSON();if(g&&f.forEach((({request:{path:t,method:n,data:r}})=>{try{e.addToHistory(t,n,r)}catch(e){m||(m=e)}})),m){const r=b.i18n.translate("console.notification.error.couldNotSaveRequestTitle",{defaultMessage:"Could not save request to Console history."});if(Object(pt.b)(m)){const r=n.toasts.addWarning({title:b.i18n.translate("console.notification.error.historyQuotaReachedMessage",{defaultMessage:"Request history is full. Clear the console history or disable saving new requests."}),text:Object(a.toMountPoint)(ht({onClearHistory:()=>{e.clearHistory(),n.toasts.remove(r)},onDisableSavingToHistory:()=>{t.setIsHistoryEnabled(!1),n.toasts.remove(r)}}),{theme$:l})})}else n.toasts.addError(m,{title:r})}const{polling:w}=t.toJSON();w&&s.retrieve(t,t.getAutocomplete()),p({type:"requestSuccess",payload:{data:f}})}catch(e){null!=e&&e.response?p({type:"requestFail",payload:e}):(p({type:"requestFail",payload:void 0}),n.toasts.addError(e,{title:b.i18n.translate("console.notification.error.unknownErrorTitle",{defaultMessage:"Unknown Request Error"})}))}}),[c,p,i,t,n.toasts,o,e,l,s])},Xt=()=>{const e=Object(r.useRef)(Promise.resolve()),{services:{objectStorageClient:t}}=k(),{currentTextObject:n}=H();return Object(r.useCallback)(Object(y.throttle)((r=>{const{current:o}=e;n&&o.finally((()=>t.text.update({...n,text:r,updatedAt:Date.now()})))}),500,{trailing:!0}),[t,n])},Yt=()=>{const[e,t]=Object(r.useState)(null),[n,o]=Object(r.useState)(!1),[i,s]=Object(r.useState)({}),a=Object(r.useCallback)((()=>{s({}),o(!1),t(null)}),[]),{services:{objectStorageClient:c,history:l}}=k(),u=z();return Object(r.useEffect)((()=>{(async()=>{try{await async function({history:e,objectStorageClient:t}){const n=e.getLegacySavedEditorState();n&&(await t.text.create({createdAt:Date.now(),updatedAt:Date.now(),text:n.content}),e.deleteLegacySavedEditorState())}({history:l,objectStorageClient:c});const e=await c.text.findAll();if(e.length)u({type:"setCurrentTextObject",payload:e.sort(((e,t)=>e.createdAt-t.createdAt))[0]});else{const e=await c.text.create({createdAt:Date.now(),updatedAt:Date.now(),text:""});u({type:"setCurrentTextObject",payload:e})}}catch(e){t(e)}finally{o(!0)}})()}),[u,c,l,i]),{error:e,done:n,retry:a}},Zt="historyReq";function en({close:e}){const{services:{history:t}}=k(),{settings:n}=H(),[i,s]=Object(r.useState)(t.getHistory()),a=Object(r.useCallback)((()=>{t.clearHistory(),s(t.getHistory())}),[t]),c=Object(r.useRef)(null),[l,u]=Object(r.useState)(null),[p,d]=Object(r.useState)(0),h=Object(r.useRef)(null),f=Object(r.useMemo)((()=>{const e=e=>{const t=e.endpoint,n=j()(e.time);let r=n.format("MMM D");return n.diff(j()(),"days")>-7&&(r=n.fromNow()),`${t} (${r})`};return e.cache=new WeakMap,Object(y.memoize)(e)}),[]),m=Object(r.useCallback)((e=>{const t=c.current.querySelector(`#${Zt}${e}`);t&&t.scrollIntoView()}),[]),g=Object(r.useCallback)((()=>{f.cache=new WeakMap,u(i[0]),h.current=i[0],d(0),m(0)}),[f,i,m]),v=ut();return Object(r.useEffect)((()=>{g()}),[g]),Object(r.useEffect)((()=>{const e=t.change(s);return()=>e()}),[t]),Object(_.jsx)(o.a.Fragment,null,Object(_.jsx)("div",{className:"conHistory"},Object(_.jsx)(w.EuiTitle,{size:"s"},Object(_.jsx)("h2",null,b.i18n.translate("console.historyPage.pageTitle",{defaultMessage:"History"}))),Object(_.jsx)(w.EuiSpacer,{size:"s"}),Object(_.jsx)("div",{className:"conHistory__body"},Object(_.jsx)("ul",{ref:c,onKeyDown:e=>{if(e.key===w.keys.ENTER)return void v(h.current);let t=p;e.key===w.keys.ARROW_UP?(e.preventDefault(),--t):e.key===w.keys.ARROW_DOWN&&(e.preventDefault(),++t);const n=Math.min(Math.max(0,t),i.length-1);u(i[n]),h.current=i[n],d(n),m(n)},role:"listbox",className:"list-group conHistory__reqs",tabIndex:0,"aria-activedescendant":`${Zt}${p}`,"aria-label":b.i18n.translate("console.historyPage.requestListAriaLabel",{defaultMessage:"History of sent requests"})},i.map(((e,t)=>{const n=f(e),r=l===e;return Object(_.jsx)("li",{key:t,id:`${Zt}${t}`,className:"list-group-item conHistory__req "+(r?"conHistory__req-selected":""),onClick:()=>{u(e),h.current=e,d(t)},role:"option",onMouseEnter:()=>u(e),onMouseLeave:()=>u(h.current),onDoubleClick:()=>v(h.current),"aria-label":b.i18n.translate("console.historyPage.itemOfRequestListAriaLabel",{defaultMessage:"Request: {historyItem}",values:{historyItem:n}}),"aria-selected":r},n,Object(_.jsx)("span",{className:"conHistory__reqIcon"},Object(_.jsx)(w.EuiIcon,{type:"arrowRight"})))}))),Object(_.jsx)("div",{className:"conHistory__body__spacer"}),Object(_.jsx)(st,{settings:n,req:l})),Object(_.jsx)(w.EuiSpacer,{size:"s"}),Object(_.jsx)(w.EuiFlexGroup,{justifyContent:"spaceBetween",alignItems:"center"},Object(_.jsx)(w.EuiFlexItem,{grow:!1},Object(_.jsx)(w.EuiButtonEmpty,{"data-test-subj":"consoleClearHistoryButton",color:"danger",onClick:()=>(a(),void g())},b.i18n.translate("console.historyPage.clearHistoryButtonLabel",{defaultMessage:"Clear"}))),Object(_.jsx)(w.EuiFlexItem,{grow:!1},Object(_.jsx)(w.EuiFlexGroup,{justifyContent:"flexEnd",alignItems:"center"},Object(_.jsx)(w.EuiFlexItem,{grow:!1},Object(_.jsx)(w.EuiButtonEmpty,{"data-test-subj":"consoleHistoryCloseButton",color:"primary",onClick:()=>e()},b.i18n.translate("console.historyPage.closehistoryButtonLabel",{defaultMessage:"Close"}))),Object(_.jsx)(w.EuiFlexItem,{grow:!1},Object(_.jsx)(w.EuiButton,{"data-test-subj":"consoleHistoryApplyButton",color:"primary",disabled:!h,onClick:()=>v(h.current)},b.i18n.translate("console.historyPage.applyHistoryButtonLabel",{defaultMessage:"Apply"}))))))),Object(_.jsx)(w.EuiSpacer,{size:"s"}))}var tn=n(48),nn=n(49),rn={name:"1azakc",styles:"text-align:center"};const on=()=>{const e=rn;return Object(_.jsx)("div",{css:e},Object(_.jsx)(w.EuiLoadingSpinner,null))};var sn=n(39),an=n.n(sn);const cn=(e,t=Object(_.jsx)(on,null))=>o.a.forwardRef(((n,o)=>Object(_.jsx)(w.EuiErrorBoundary,null,Object(_.jsx)(r.Suspense,{fallback:t},Object(_.jsx)(e,an()({},n,{ref:o})))))),ln=e=>e<=199?"default":e<=299?"success":e<=399?"primary":e<=499?"warning":"danger",un=({requestInProgress:e,requestResult:t})=>{let n=null;if(e)n=Object(_.jsx)(w.EuiFlexItem,{grow:!1},Object(_.jsx)(w.EuiBadge,{color:"hollow"},b.i18n.translate("console.requestInProgressBadgeText",{defaultMessage:"Request in progress"})));else if(t){const{endpoint:e,method:r,statusCode:i,statusText:s,timeElapsedMs:a}=t;n=Object(_.jsx)(o.a.Fragment,null,Object(_.jsx)(w.EuiFlexItem,{grow:!1},Object(_.jsx)(w.EuiToolTip,{position:"top",content:Object(_.jsx)(w.EuiText,{size:"s"},`${r} ${e.startsWith("/")?e:"/"+e}`)},Object(_.jsx)(w.EuiBadge,{"data-test-subj":"consoleResponseStatusBadge",color:ln(i)},i," - ",s))),Object(_.jsx)(w.EuiFlexItem,{grow:!1},Object(_.jsx)(w.EuiToolTip,{position:"top",content:Object(_.jsx)(w.EuiText,{size:"s"},b.i18n.translate("console.requestTimeElapasedBadgeTooltipContent",{defaultMessage:"Time Elapsed"}))},Object(_.jsx)(w.EuiText,{size:"s"},Object(_.jsx)(w.EuiBadge,{color:"default"},a," ","ms")))))}return Object(_.jsx)(w.EuiFlexGroup,{justifyContent:"flexEnd",alignItems:"center",direction:"row",gutterSize:"s",responsive:!1},n)},pn=({error:e,onButtonClick:t})=>(Object(r.useEffect)((()=>{console.error(e)}),[e]),Object(_.jsx)(w.EuiCallOut,{iconType:"warning",color:"danger",title:b.i18n.translate("console.loadingError.title",{defaultMessage:"Cannot load Console"})},Object(_.jsx)(w.EuiText,null,Object(_.jsx)("p",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.loadingError.message",defaultMessage:"Try reloading to get the latest data."}))),Object(_.jsx)(w.EuiSpacer,{size:"m"}),Object(_.jsx)(w.EuiButton,{color:"danger",onClick:()=>t()},Object(_.jsx)(dt.FormattedMessage,{id:"console.loadingError.buttonLabel",defaultMessage:"Reload Console"})))),dn=({items:e,disabled:t})=>Object(_.jsx)(w.EuiTabs,{size:"s"},e.map(((e,n)=>Object(_.jsx)(w.EuiTab,{key:n,disabled:t,onClick:e.onClick,title:e.label,"data-test-subj":e.testId},e.label))));class console_menu_ConsoleMenu extends r.Component{constructor(e){super(e),f()(this,"mouseEnter",(()=>{this.state.isPopoverOpen||this.props.getCurl().then((e=>{this.setState({curlCode:e,curlError:null})})).catch((e=>{this.setState({curlError:e})}))})),f()(this,"onButtonClick",(()=>{this.setState((e=>({isPopoverOpen:!e.isPopoverOpen})))})),f()(this,"closePopover",(()=>{this.setState({isPopoverOpen:!1})})),f()(this,"openDocs",(async()=>{this.closePopover();const e=await this.props.getDocumentation();e&&window.open(e,"_blank")})),f()(this,"autoIndent",(e=>{this.closePopover(),this.props.autoIndent(e)})),this.state={curlCode:"",isPopoverOpen:!1,curlError:null}}async copyAsCurl(){const{notifications:e}=this.props;try{await this.copyText(this.state.curlCode),e.toasts.add({title:b.i18n.translate("console.consoleMenu.copyAsCurlMessage",{defaultMessage:"Request copied as cURL"})})}catch(t){e.toasts.addError(t,{title:b.i18n.translate("console.consoleMenu.copyAsCurlFailedMessage",{defaultMessage:"Could not copy request as cURL"})})}}async copyText(e){var t;if(this.state.curlError)throw this.state.curlError;if(null===(t=window.navigator)||void 0===t||!t.clipboard)throw new Error("Could not copy to clipboard!");await window.navigator.clipboard.writeText(e)}render(){var e;const t=Object(_.jsx)(w.EuiLink,{onClick:this.onButtonClick,"data-test-subj":"toggleConsoleMenu","aria-label":b.i18n.translate("console.requestOptionsButtonAriaLabel",{defaultMessage:"Request options"})},Object(_.jsx)(w.EuiIcon,{type:"wrench"})),n=[Object(_.jsx)(w.EuiContextMenuItem,{key:"Copy as cURL","data-test-subj":"consoleMenuCopyAsCurl",id:"ConCopyAsCurl",disabled:!(null!==(e=window.navigator)&&void 0!==e&&e.clipboard),onClick:()=>{this.closePopover(),this.copyAsCurl()}},Object(_.jsx)(dt.FormattedMessage,{id:"console.requestOptions.copyAsUrlButtonLabel",defaultMessage:"Copy as cURL"})),Object(_.jsx)(w.EuiContextMenuItem,{key:"Open documentation","data-test-subj":"consoleMenuOpenDocs",onClick:()=>{this.openDocs()}},Object(_.jsx)(dt.FormattedMessage,{id:"console.requestOptions.openDocumentationButtonLabel",defaultMessage:"Open documentation"})),Object(_.jsx)(w.EuiContextMenuItem,{"data-test-subj":"consoleMenuAutoIndent",key:"Auto indent",onClick:this.autoIndent},Object(_.jsx)(dt.FormattedMessage,{id:"console.requestOptions.autoIndentButtonLabel",defaultMessage:"Auto indent"}))];return Object(_.jsx)("span",{onMouseEnter:this.mouseEnter},Object(_.jsx)(w.EuiPopover,{id:"contextMenu",button:t,isOpen:this.state.isPopoverOpen,closePopover:this.closePopover,panelPaddingSize:"none",anchorPosition:"downLeft"},Object(_.jsx)(w.EuiContextMenuPanel,{items:n,"data-test-subj":"consoleMenu"})))}}var hn=n(53);const{collapseLiteralStrings:fn}=s.XJson;class sense_editor_SenseEditor{constructor(e){f()(this,"currentReqRange",void 0),f()(this,"parser",void 0),f()(this,"autocomplete",void 0),f()(this,"prevRequestStart",(e=>{let t;for(t=null==e?this.coreEditor.getCurrentPosition().lineNumber:v.a.isObject(e)?e.lineNumber:e;t>0&&!this.parser.isStartRequestRow(t,this.coreEditor);)t--;return{lineNumber:t,column:1}})),f()(this,"nextRequestStart",(e=>{let t;t=null==e?this.coreEditor.getCurrentPosition().lineNumber:v.a.isObject(e)?e.lineNumber:e;const n=this.coreEditor.getLineCount();for(;t{await this.coreEditor.waitForLatestTokens();const e=await this.getRequestRange();if(!e)return;const t=await this.getRequest();if(t)if(t.data.some((e=>tt(e))))this.coreEditor.autoIndent(t.range);else if(t.data&&t.data.length>0){let n=1===t.data.length,r=et(t.data,n);r.changed||(n=!n,r=et(t.data,n)),t.data=r.data,this.replaceRequestRange(t,e)}}),25)),f()(this,"update",(async(e,t=!1)=>this.coreEditor.setValue(e,t))),f()(this,"replaceRequestRange",((e,t)=>{const n=function(e){let t=e.data;return"string"!=typeof t&&(t=t.join("\n")),e.method+" "+e.url+"\n"+t}(e);t?this.coreEditor.replaceRange(t,n):this.coreEditor.insert(this.coreEditor.getCurrentPosition(),n)})),f()(this,"getRequestRange",(async e=>{if(await this.coreEditor.waitForLatestTokens(),this.parser.isInBetweenRequestsRow(e))return null;const t=this.prevRequestStart(e),n=this.nextRequestEnd(t);return{start:{...t},end:{...n}}})),f()(this,"expandRangeToRequestEdges",(async(e=this.coreEditor.getSelectionRange())=>{await this.coreEditor.waitForLatestTokens();let t=e.start.lineNumber,n=e.end.lineNumber;const r=Math.max(1,this.coreEditor.getLineCount());if(this.parser.isInBetweenRequestsRow(t));else for(;t>=1&&!this.parser.isStartRequestRow(t);t--);if(t<1||t>n)return null;if(this.parser.isInBetweenRequestsRow(n))for(;n>=t&&!this.parser.isEndRequestRow(n);n--);else for(;n<=r&&!this.parser.isEndRequestRow(n);n++);return nr?null:{start:{lineNumber:t,column:1},end:{lineNumber:n,column:(this.coreEditor.getLineValue(n)||"").replace(/\s+$/,"").length+1}}})),f()(this,"getRequestInRange",(async e=>{if(await this.coreEditor.waitForLatestTokens(),!e)return null;const t={method:"",data:[],url:"",range:e},n=e.start,r=Ht({editor:this.coreEditor,position:n});let o=r.getCurrentToken();if(this.parser.isEmptyToken(o)&&(o=this.parser.nextNonEmptyToken(r)),null==o)return null;if(t.method=o.value,o=this.parser.nextNonEmptyToken(r),!o||"method"===o.type)return null;for(t.url="";o&&o.type&&(0===o.type.indexOf("url")||"variable.template"===o.type);)t.url+=o.value,o=r.stepForward();for(this.parser.isEmptyToken(o)&&(o=this.parser.nextNonEmptyToken(r));this.parser.isCommentToken(o);)o=r.stepForward();let i,s=(o?0:1)+r.getCurrentPosition().lineNumber;for(;s{if(await this.coreEditor.waitForLatestTokens(),!e)return[];const n=await this.expandRangeToRequestEdges(e);if(!n)return[];const r=[];let o=n.start.lineNumber;const i=n.end.lineNumber;let s=n.start.lineNumber;const a=()=>{if(t){const e=this.coreEditor.getLines(o,s-1).join("\n");e&&r.push(e)}};for(;s<=i;)if(this.parser.isStartRequestRow(s)){a();const e=await this.getRequest(s);if(!e)return r;r.push(e),o=s=e.range.end.lineNumber+1}else++s;return a(),r})),f()(this,"getRequest",(async e=>{if(await this.coreEditor.waitForLatestTokens(),this.parser.isInBetweenRequestsRow(e))return null;const t=await this.getRequestRange(e);return this.getRequestInRange(t)})),f()(this,"moveToPreviousRequestEdge",(async()=>{await this.coreEditor.waitForLatestTokens();const e=this.coreEditor.getCurrentPosition();for(e.lineNumber--;e.lineNumber>1&&!this.parser.isRequestEdge(e.lineNumber);e.lineNumber--);this.coreEditor.moveCursorToPosition({lineNumber:e.lineNumber,column:1})})),f()(this,"moveToNextRequestEdge",(async e=>{await this.coreEditor.waitForLatestTokens();const t=this.coreEditor.getCurrentPosition(),n=this.coreEditor.getLineCount();for(e||t.lineNumber++;t.lineNumber{e=e||this.coreEditor.getCurrentPosition();const t=this.coreEditor.getLineCount();let n=e.lineNumber;for(;n<=t;++n){const t=this.parser.getRowParseMode(n);if((t&this.parser.MODE.REQUEST_END)>0)break;if(n!==e.lineNumber&&(t&this.parser.MODE.REQUEST_START)>0)break}return{lineNumber:n,column:(this.coreEditor.getLineValue(n)||"").replace(/\s+$/,"").length+1}})),f()(this,"nextDataDocEnd",(e=>{let t=(e=e||this.coreEditor.getCurrentPosition()).lineNumber;const n=this.coreEditor.getLineCount();for(;t0)break;if((n&this.parser.MODE.MULTI_DOC_CUR_DOC_END)>0)break;if(t!==e.lineNumber&&(n&this.parser.MODE.REQUEST_START)>0)break}return{lineNumber:t,column:(this.coreEditor.getLineValue(t)||"").length+1}})),f()(this,"highlightCurrentRequestsAndUpdateActionBar",v.a.debounce((async()=>{await this.coreEditor.waitForLatestTokens();const e=await this.expandRangeToRequestEdges();null===e&&null===this.currentReqRange||(null===e||null===this.currentReqRange||e.start.lineNumber!==this.currentReqRange.start.lineNumber||e.end.lineNumber!==this.currentReqRange.end.lineNumber?(this.currentReqRange&&this.coreEditor.removeMarker(this.currentReqRange.markerRef),this.currentReqRange=e,this.currentReqRange&&(this.currentReqRange.markerRef=this.coreEditor.addMarker(this.currentReqRange)),this.updateActionsBar()):this.coreEditor.getCurrentPosition().lineNumber===this.currentReqRange.start.lineNumber&&this.updateActionsBar())}),25)),f()(this,"getRequestsAsCURL",(async(e,t)=>{const n=Object(u.i)().get(u.d.VARIABLES,ft.b);let r=await this.getRequestsInRange(t,!0);return r=rt(r,n),v.a.map(r,(t=>{if("string"==typeof t)return t;const n=t.url,r=t.method,o=t.data,i=function(e,t){const n=mt(t);let r=`${Object(y.trimEnd)(e,"/")}/${Object(y.trimStart)(t,"/")}`;n&&(r=n);const{origin:o,pathname:i,search:s}=new URL(r);return`${o}${(e=>{var t;const n=null!==(t=new URLSearchParams(`path=${e}`).get("path"))&&void 0!==t?t:"";return e===n?e:`/${encodeURIComponent(Object(y.trimStart)(n,"/"))}`})(i)}${null!=s?s:""}`}(e,n);let s=`curl -X${r.toUpperCase()} "${i}" -H "kbn-xsrf: reporting"`;if(o&&o.length){const e=o.join("\n");let t;try{if(s+=' -H "Content-Type: application/json" -d\'\n',tt(e)){const n=Object(hn.parse)(e);t=fn(JSON.stringify(n,null,2))}else t=fn(e);s+=t.replace(/'/g,"'\\''"),o.length>1&&(s+="\n"),s+="'"}catch(e){throw new Error(`Error parsing data: ${e.message}`)}}return s})).join("\n")})),f()(this,"updateActionsBar",(()=>this.coreEditor.legacyUpdateUI(this.currentReqRange))),this.coreEditor=e,this.currentReqRange=null,this.parser=new row_parser_RowParser(this.coreEditor),this.autocomplete=Kt({coreEditor:e,parser:this.parser}),this.coreEditor.registerAutocompleter(this.autocomplete.getCompletions),this.coreEditor.on("tokenizerUpdate",this.highlightCurrentRequestsAndUpdateActionBar.bind(this)),this.coreEditor.on("changeCursor",this.highlightCurrentRequestsAndUpdateActionBar.bind(this)),this.coreEditor.on("changeScrollTop",this.updateActionsBar.bind(this))}getCoreEditor(){return this.coreEditor}}var mn=Object(w.withEuiTheme)((({panel:e,example:t,theme:n,linesOfExampleCode:i=6,mode:s="input"})=>{const a=`help-example-${e}-input`,c=Object(r.useRef)(null),l=Object(r.useRef)();Object(r.useEffect)((()=>{if(c.current){l.current=Ke(c.current);const e=l.current,n="input"===s?new input_Mode:new output_Mode;e.update((t||'\nGET _search\n{\n "query": {\n "match_all": {}\n }\n}\n').trim(),n),e.session.setUseWorker(!1),e.setHighlightActiveLine(!1);const r=c.current.querySelector("textarea");r&&(r.setAttribute("id",a),r.setAttribute("readonly","true"))}return()=>{l.current&&l.current.destroy()}}),[t,a,s]);const u={height:parseInt(n.euiTheme.size.base,10)*i+"px",margin:`${n.euiTheme.size.base} 0`};return Object(_.jsx)(o.a.Fragment,null,Object(_.jsx)(w.EuiScreenReaderOnly,null,Object(_.jsx)("label",{htmlFor:a},b.i18n.translate("console.exampleOutputTextarea",{defaultMessage:"Dev Tools Console editor example"}))),Object(_.jsx)("div",{ref:c,className:"conApp_example",css:u}))}));const gn="\n# retrieve sets of saved objects \nPOST kbn:api/saved_objects/_export\n",bn='\n# POST test_index/_doc/test_doc 200 OK\n{\n "_index": "test_index",\n "_id": "test_doc",\n "_version": 3,\n "result": "updated",\n "_shards": {\n "total": 2,\n "successful": 1,\n "failed": 0\n },\n "_seq_no": 2,\n "_primary_term": 1\n}\n# POST notAnEndpoint 405 Method Not Allowed\n{\n "error": "Incorrect HTTP method for uri [/notAnEndpoint?pretty=true] and method [POST], allowed: [HEAD, GET, PUT, DELETE]",\n "status": 405\n}\n',wn='\n# This request searches all of your indices.\nGET _search\n{\n // The query parameter indicates query context.\n "query": {\n // Matches all documents.\n /*"match_all": {\n "boost": 1.2\n }*/\n "match_none": {} // Matches no document.\n }\n}\n',yn='\nGET ${pathVariable}\n{\n "query": {\n "match": {\n "${bodyNameVariable}": "${bodyValueVariable}"\n }\n }\n}\n';function vn(e){return Object(_.jsx)(w.EuiFlyout,{onClose:e.onDismiss,"data-test-subj":"welcomePanel",size:"m",maxWidth:0,ownFocus:!1},Object(_.jsx)(w.EuiFlyoutHeader,{hasBorder:!0},Object(_.jsx)(w.EuiTitle,{size:"m"},Object(_.jsx)("h2",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.welcomePage.pageTitle",defaultMessage:"Send requests with Console"})))),Object(_.jsx)(w.EuiFlyoutBody,null,Object(_.jsx)(w.EuiText,null,Object(_.jsx)("p",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.welcomePage.quickIntroDescription",defaultMessage:"Console understands commands in a cURL-like syntax. Here is a request to the Elasticsearch _search API."})),Object(_.jsx)(mn,{panel:"welcome-example-1"}),Object(_.jsx)("p",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.welcomePage.kibanaAPIsDescription",defaultMessage:"To send a request to a Kibana API, prefix the path with {kibanaApiPrefix}.",values:{kibanaApiPrefix:Object(_.jsx)(w.EuiCode,null,"kbn:")}})),Object(_.jsx)(mn,{panel:"welcome-example-2",example:gn,linesOfExampleCode:2}),Object(_.jsx)("h4",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.welcomePage.sendMultipleRequestsTitle",defaultMessage:"Send multiple requests"})),Object(_.jsx)("p",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.welcomePage.sendMultipleRequestsDescription",defaultMessage:"Select multiple requests and send them together. You'll get responses to all your requests, regardless of whether they succeed or fail."})),Object(_.jsx)(mn,{panel:"welcome-example-3",example:bn,linesOfExampleCode:22,mode:"output"}),Object(_.jsx)("h4",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.welcomePage.addCommentsTitle",defaultMessage:"Add comments in request bodies"})),Object(_.jsx)("p",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.welcomePage.addCommentsDescription",defaultMessage:"To add a single-line comment, use {hash} or {doubleSlash}. For a multiline comment, mark the beginning with {slashAsterisk} and the end with {asteriskSlash}.",values:{hash:Object(_.jsx)(w.EuiCode,null,"#"),doubleSlash:Object(_.jsx)(w.EuiCode,null,"//"),slashAsterisk:Object(_.jsx)(w.EuiCode,null,"/*"),asteriskSlash:Object(_.jsx)(w.EuiCode,null,"*/")}})),Object(_.jsx)(mn,{panel:"welcome-example-4",example:wn,linesOfExampleCode:14}),Object(_.jsx)("h4",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.welcomePage.useVariablesTitle",defaultMessage:"Reuse values with variables"})),Object(_.jsx)("p",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.welcomePage.useVariablesDescription",defaultMessage:"Define variables in Console, and then use them in your requests in the form of {variableName}.",values:{variableName:Object(_.jsx)(w.EuiCode,null,"${variableName}")}})),Object(_.jsx)("ol",null,Object(_.jsx)("li",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.welcomePage.useVariables.step1",defaultMessage:"Click {variableText}, and then enter the variable name and value.",values:{variableText:Object(_.jsx)("strong",null,"Variables")}})),Object(_.jsx)("li",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.welcomePage.useVariables.step2",defaultMessage:"Refer to variables in the paths and bodies of your requests as many times as you like."}))),Object(_.jsx)(mn,{panel:"welcome-example-5",example:yn,linesOfExampleCode:9}))),Object(_.jsx)(w.EuiFlyoutFooter,null,Object(_.jsx)(w.EuiButton,{fill:!0,fullWidth:!1,"data-test-subj":"help-close-button",onClick:e.onDismiss},Object(_.jsx)(dt.FormattedMessage,{id:"console.welcomePage.closeButtonLabel",defaultMessage:"Dismiss"}))))}function xn(e){const{docLinks:t}=k();return Object(_.jsx)(w.EuiFlyout,{onClose:e.onClose,"data-test-subj":"helpFlyout",size:"s"},Object(_.jsx)(w.EuiFlyoutHeader,{hasBorder:!0},Object(_.jsx)(w.EuiTitle,{size:"m"},Object(_.jsx)("h2",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.pageTitle",defaultMessage:"Help"})))),Object(_.jsx)(w.EuiFlyoutBody,null,Object(_.jsx)(w.EuiText,null,Object(_.jsx)("h3",null,Object(_.jsx)(dt.FormattedMessage,{defaultMessage:"Request format",id:"console.helpPage.requestFormatTitle"})),Object(_.jsx)("p",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.requestFormatDescription",defaultMessage:"You can type one or more requests in the editor. Console understands requests in a compact format."})),Object(_.jsx)("p",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.learnAboutConsoleAndQueryDslText",defaultMessage:"Learn about {console} and {queryDsl}",values:{console:Object(_.jsx)(w.EuiLink,{href:t.console.guide,target:"_blank",external:!0},"Console"),queryDsl:Object(_.jsx)(w.EuiLink,{href:t.query.queryDsl,target:"_blank",external:!0},"Query DSL")}})),Object(_.jsx)(mn,{panel:"help"}),Object(_.jsx)("h3",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.keyboardCommandsTitle",defaultMessage:"Keyboard commands"})),Object(_.jsx)(w.EuiSpacer,null),Object(_.jsx)("dl",null,Object(_.jsx)("dt",null,"Ctrl/Cmd + I"),Object(_.jsx)("dd",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.keyboardCommands.autoIndentDescription",defaultMessage:"Auto indent current request"})),Object(_.jsx)("dt",null,"Ctrl/Cmd + /"),Object(_.jsx)("dd",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.keyboardCommands.openDocumentationDescription",defaultMessage:"Open documentation for current request"})),Object(_.jsx)("dt",null,"Ctrl + Space"),Object(_.jsx)("dd",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.keyboardCommands.openAutoCompleteDescription",defaultMessage:"Open Auto complete (even if not typing)"})),Object(_.jsx)("dt",null,"Ctrl/Cmd + Enter"),Object(_.jsx)("dd",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.keyboardCommands.submitRequestDescription",defaultMessage:"Submit request"})),Object(_.jsx)("dt",null,"Ctrl/Cmd + Up/Down"),Object(_.jsx)("dd",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.keyboardCommands.jumpToPreviousNextRequestDescription",defaultMessage:"Jump to the previous/next request start or end."})),Object(_.jsx)("dt",null,"Ctrl/Cmd + Alt + L"),Object(_.jsx)("dd",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.keyboardCommands.collapseExpandCurrentScopeDescription",defaultMessage:"Collapse/expand current scope."})),Object(_.jsx)("dt",null,"Ctrl/Cmd + Option + 0"),Object(_.jsx)("dd",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.keyboardCommands.collapseAllScopesDescription",defaultMessage:"Collapse all scopes but the current one. Expand by adding a shift."})),Object(_.jsx)("dt",null,"Down arrow"),Object(_.jsx)("dd",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.keyboardCommands.switchFocusToAutoCompleteMenuDescription",defaultMessage:"Switch focus to auto-complete menu. Use arrows to further select a term"})),Object(_.jsx)("dt",null,"Enter/Tab"),Object(_.jsx)("dd",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.keyboardCommands.selectCurrentlySelectedInAutoCompleteMenuDescription",defaultMessage:"Select the currently selected or the top most term in auto-complete menu"})),Object(_.jsx)("dt",null,"Ctrl/Cmd + L"),Object(_.jsx)("dd",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.keyboardCommands.goToLineNumberDescription",defaultMessage:"Go to line number"})),Object(_.jsx)("dt",null,"Esc"),Object(_.jsx)("dd",null,Object(_.jsx)(dt.FormattedMessage,{id:"console.helpPage.keyboardCommands.closeAutoCompleteMenuDescription",defaultMessage:"Close auto-complete menu"}))))))}const jn=()=>Object(_.jsx)(w.EuiPageContent_Deprecated,{className:"conApp__editor__spinner"},Object(_.jsx)(w.EuiSkeletonText,{lines:10})),_n=o.a.lazy((()=>n.e(2).then(n.bind(null,65)).then((({DevToolsSettingsModal:e})=>({default:e}))))),On=cn(_n),En=o.a.lazy((()=>n.e(3).then(n.bind(null,67)).then((({DevToolsVariablesFlyout:e})=>({default:e}))))),kn=cn(En);function Rn(e,t){return e.getRequestsInRange().then((n=>{if(!n||0===n.length)return null;const r=n[0].range.end;r.column=r.column-1;const o=Jt(e.getCoreEditor(),r,e.parser);return o&&o.documentation&&-1!==o.documentation.indexOf("http")?o.documentation.replace("/master/",`/${t}/`).replace("/current/",`/${t}/`).replace("/{branch}/",`/${t}/`):null}))}var Sn=n(40);const{useUIAceKeyboardMode:Tn}=s.ace,Cn={position:"absolute",top:"0",left:"0",bottom:"0",right:"0"},An='# Click the Variables button, above, to create your own variables.\nGET ${exampleVariable1} // _search\n{\n "query": {\n "${exampleVariable2}": {} // match_all\n }\n}',Pn="ConAppInputTextarea";function Ln({initialTextValue:e,setEditorInstance:t}){const{services:{history:n,notifications:o,settings:i,esHostService:s,http:a,autocompleteInfo:c,storage:l},docLinkVersion:p}=k(),{settings:d}=H(),h=ct(),f=Qt(),m=Xt(),g=Object(r.useRef)(null),v=Object(r.useRef)(null),[x,j]=Object(r.useState)(null);Tn(x,d.isAccessibilityOverlayEnabled);const O=Object(r.useCallback)((async()=>{const e=await Rn(v.current,p);e&&window.open(e,"_blank")}),[p]);return Object(r.useEffect)((()=>{v.current=function(e){const t=Je(e),n=new sense_editor_SenseEditor(t);return n.highlightCurrentRequestsAndUpdateActionBar(),n}(g.current);const t=v.current,n=g.current.querySelector("textarea");n&&(n.setAttribute("id",Pn),n.setAttribute("data-test-subj","console-textarea"));const r=()=>{const[,e]=(window.location.hash||"").split("?");return Object(nn.parse)(e||"",{sort:!1})},s=n=>{const r=t.getCoreEditor(),i=new URL(n).toString();if(/^https?:\/\//.test(i)){const o={url:n,dataType:"text",kbnXsrfToken:!1};/https?:\/\/api\.github\.com/.test(n)&&(o.headers={Accept:"application/vnd.github.v3.raw"}),$.ajax(o).done((async n=>{await t.update(`${e}\n ${n}`,!0),t.moveToNextRequestEdge(!1),r.clearSelection(),t.highlightCurrentRequestsAndUpdateActionBar(),r.getContainer().focus()}))}if(/^data:/.test(n)){const e=Object(tn.decompressFromEncodedURIComponent)(n.replace(/^data:text\/plain,/,""));if(null===e||""===e)return void o.toasts.addWarning(b.i18n.translate("console.loadFromDataUriErrorMessage",{defaultMessage:"Unable to load data from the load_from query parameter in the URL"}));t.update(e,!0),t.moveToNextRequestEdge(!1),r.clearSelection(),t.highlightCurrentRequestsAndUpdateActionBar(),r.getContainer().focus()}},a=Object(y.debounce)((()=>{const{load_from:e}=r();e&&s(e)}),200);window.addEventListener("hashchange",a);const p=r();function d(){try{const e=t.getCoreEditor().getValue();m(e)}catch(e){}}p.load_from?s(p.load_from):t.update(e||An),function(){if(t){const e=l.get(u.d.FOLDS,[]);t.getCoreEditor().addFoldsAtRanges(e)}}(),t&&t.getCoreEditor().on("changeFold",(()=>{const e=t.getCoreEditor().getAllFoldRanges();l.set(u.d.FOLDS,e)})),h(t),j(g.current.querySelector("textarea")),c.retrieve(i,i.getAutocomplete());const f=Q(g.current,t);return function(){let e;t.getCoreEditor().on("change",(()=>{e&&clearTimeout(e),e=window.setTimeout(d,500)}))}(),()=>{var e;f(),c.clearSubscriptions(),window.removeEventListener("hashchange",a),v.current&&(null===(e=v.current)||void 0===e||e.getCoreEditor().detachCompleter(),v.current.getCoreEditor().destroy())}}),[o.toasts,m,e,n,h,i,a,c,l]),Object(r.useEffect)((()=>{const{current:e}=v;Qe(e.getCoreEditor(),d),e.getCoreEditor().getContainer().focus()}),[d]),Object(r.useEffect)((()=>{const{isKeyboardShortcutsEnabled:e}=d;e&&Object(Sn.a)({senseEditor:v.current,sendCurrentRequest:f,openDocumentation:O})}),[O,d,f]),Object(r.useEffect)((()=>{const{current:e}=v;e&&t(e)}),[t]),Object(_.jsx)("div",{style:Cn,"data-test-subj":"console-application",className:"conApp"},Object(_.jsx)("div",{className:"conApp__editor"},Object(_.jsx)("ul",{className:"conApp__autoComplete",id:"autocomplete"}),Object(_.jsx)(w.EuiFlexGroup,{className:"conApp__editorActions",id:"ConAppEditorActions",gutterSize:"none",responsive:!1},Object(_.jsx)(w.EuiFlexItem,null,Object(_.jsx)(w.EuiToolTip,{content:b.i18n.translate("console.sendRequestButtonTooltip",{defaultMessage:"Click to send request"})},Object(_.jsx)(w.EuiLink,{color:"success",onClick:f,"data-test-subj":"sendRequestButton","aria-label":b.i18n.translate("console.sendRequestButtonTooltip",{defaultMessage:"Click to send request"})},Object(_.jsx)(w.EuiIcon,{type:"playFilled"})))),Object(_.jsx)(w.EuiFlexItem,null,Object(_.jsx)(console_menu_ConsoleMenu,{getCurl:()=>v.current.getRequestsAsCURL(s.getHost()),getDocumentation:()=>Rn(v.current,p),autoIndent:e=>{!async function(e,t){t.preventDefault(),await e.autoIndent(),e.getCoreEditor().getContainer().focus()}(v.current,e)},notifications:o}))),Object(_.jsx)(w.EuiScreenReaderOnly,null,Object(_.jsx)("label",{htmlFor:Pn},b.i18n.translate("console.inputTextarea",{defaultMessage:"Dev Tools Console"}))),Object(_.jsx)("div",{ref:g,id:"ConAppEditor",className:"conApp__editorContent","data-test-subj":"request-editor"})))}const Nn=o.a.memo(Ln);var Mn=n(41),In=n(61),qn=n.n(In);n(63),n(64);const Dn=e=>Boolean(e&&e.indexOf("application/json")>=0),Fn=e=>{var t;return null!==(t=null==e?void 0:e.includes("application/vnd.mapbox-vector-tile"))&&void 0!==t&&t},$n=e=>{try{return l(e)}catch(t){return e}};function Bn(e){return e?Dn(e)||Fn(e)?"ace/mode/hjson":e.indexOf("application/yaml")>=0?"ace/mode/yaml":"ace/mode/text":"ace/mode/text"}function Un(){const e=Object(r.useRef)(null),t=Object(r.useRef)(null),{services:n}=k(),{settings:i}=H(),{lastResult:{data:s,error:a}}=I(),c="ConAppOutputTextarea";return Object(r.useEffect)((()=>{t.current=Ke(e.current);const n=Q(e.current,t.current),r=e.current.querySelector("textarea");return r.setAttribute("id",c),r.setAttribute("readonly","true"),()=>{n(),t.current.destroy()}}),[n.settings]),Object(r.useEffect)((()=>{const e=t.current;if(s){const t=s.length>1?new output_Mode:Bn(s[0].response.contentType);e.update(s.map((e=>{const{value:t,contentType:n}=e.response;let r;if(i.tripleQuotes&&Dn(n))r=$n(t);else if(Fn(n)){const e=function(e){const t=e.layers,n={};for(const e in t)if(t.hasOwnProperty(e)){const r=t[e],o=[];for(let e=0;e{Qe(t.current,i)}),[i]),Object(_.jsx)(o.a.Fragment,null,Object(_.jsx)(w.EuiScreenReaderOnly,null,Object(_.jsx)("label",{htmlFor:c},b.i18n.translate("console.outputTextarea",{defaultMessage:"Dev Tools Console output"}))),Object(_.jsx)("div",{ref:e,className:"conApp__output","data-test-subj":"response-editor"},Object(_.jsx)("div",{className:"conApp__outputContent",id:"ConAppOutput"})))}const Vn=o.a.memo(Un),Hn="100px",zn=Object(r.memo)((({loading:e,setEditorInstance:t})=>{const{services:{storage:n}}=k(),{currentTextObject:i}=H(),{requestInFlight:s}=I(),[a,c]=Object(r.useState)(!1);Object(r.useEffect)((()=>{const e=Object(u.h)().mapping.isLoading$.subscribe(c);return()=>{e.unsubscribe()}}),[]);const[l,p]=n.get(u.d.WIDTH,[50,50]),d=Object(r.useCallback)(Object(y.debounce)((e=>{n.set(u.d.WIDTH,e)}),300),[]);return i?Object(_.jsx)(o.a.Fragment,null,s||a?Object(_.jsx)("div",{className:"conApp__requestProgressBarContainer"},Object(_.jsx)(w.EuiProgress,{size:"xs",color:"accent",position:"absolute"})):null,Object(_.jsx)(tr,{onPanelWidthChange:d,resizerClassName:"conApp__resizer"},Object(_.jsx)(Xn,{style:{height:"100%",position:"relative",minWidth:Hn},initialWidth:l},e?Object(_.jsx)(jn,null):Object(_.jsx)(Nn,{initialTextValue:i.text,setEditorInstance:t})),Object(_.jsx)(Xn,{style:{height:"100%",position:"relative",minWidth:Hn},initialWidth:p},e?Object(_.jsx)(jn,null):Object(_.jsx)(Vn,null)))):null})),Wn=(e,t)=>Object.keys(e.autocomplete).filter((n=>t.autocomplete[n]!==e.autocomplete[n]));function Gn({onClose:e,editorInstance:t}){const{services:{settings:n,autocompleteInfo:r}}=k(),o=z();return Object(_.jsx)(On,{onClose:e,onSaveSettings:t=>{const i=n.toJSON();((e,t,n)=>{if(t.polling){const o=Wn(t,n),i=o.length>0,s=n.polling!==t.polling;if(i){const n=o.reduce(((e,n)=>(e[n]=t.autocomplete[n],e)),{});r.retrieve(e,{...e.getAutocomplete(),...n})}else s&&t.polling&&r.retrieve(e,e.getAutocomplete())}})(n,t,i),n.updateSettings(t),o({type:"updateSettings",payload:t}),e()},refreshAutocompleteSettings:e=>((e,t)=>{r.retrieve(e,t)})(n,e),settings:n.toJSON(),editorInstance:t})}function Kn({onClose:e}){const{services:{storage:t}}=k();return Object(_.jsx)(kn,{onClose:e,onSaveVariables:n=>{t.set(u.d.VARIABLES,n),e()},variables:t.get(u.d.VARIABLES,ft.b)})}function Jn({onClickHistory:e,onClickSettings:t,onClickHelp:n,onClickVariables:r}){return[{id:"history",label:b.i18n.translate("console.topNav.historyTabLabel",{defaultMessage:"History"}),description:b.i18n.translate("console.topNav.historyTabDescription",{defaultMessage:"History"}),onClick:()=>{e()},testId:"consoleHistoryButton"},{id:"settings",label:b.i18n.translate("console.topNav.settingsTabLabel",{defaultMessage:"Settings"}),description:b.i18n.translate("console.topNav.settingsTabDescription",{defaultMessage:"Settings"}),onClick:()=>{t()},testId:"consoleSettingsButton"},{id:"variables",label:b.i18n.translate("console.topNav.variablesTabLabel",{defaultMessage:"Variables"}),description:b.i18n.translate("console.topNav.variablesTabDescription",{defaultMessage:"Variables"}),onClick:()=>{r()},testId:"consoleVariablesButton"},{id:"help",label:b.i18n.translate("console.topNav.helpTabLabel",{defaultMessage:"Help"}),description:b.i18n.translate("console.topNav.helpTabDescription",{defaultMessage:"Help"}),onClick:()=>{n()},testId:"consoleHelpButton"}]}function Qn(){var e;const{services:{storage:t}}=k(),{ready:n}=H(),{requestInFlight:o,lastResult:{data:i,error:s}}=I(),[a,c]=Object(r.useState)((()=>"@@SENSE_REVISION"!==t.get("version_welcome_shown"))),[l,u]=Object(r.useState)(!1),[p,d]=Object(r.useState)(!1),[h,f]=Object(r.useState)(!1),[m,g]=Object(r.useState)(!1),[y,v]=Object(r.useState)(null),{done:x,error:j,retry:O}=Yt();if(j)return Object(_.jsx)(w.EuiPageContent_Deprecated,null,Object(_.jsx)(pn,{onButtonClick:O,error:j}));const E=null!==(e=nt(i))&&void 0!==e?e:s;return Object(_.jsx)("div",{id:"consoleRoot"},Object(_.jsx)(w.EuiFlexGroup,{className:"consoleContainer",gutterSize:"none",direction:"column",responsive:!1},Object(_.jsx)(w.EuiFlexItem,{grow:!1},Object(_.jsx)(w.EuiTitle,{className:"euiScreenReaderOnly"},Object(_.jsx)("h1",null,b.i18n.translate("console.pageHeading",{defaultMessage:"Console"}))),Object(_.jsx)(w.EuiFlexGroup,{gutterSize:"none"},Object(_.jsx)(w.EuiFlexItem,null,Object(_.jsx)(dn,{disabled:!x,items:Jn({onClickHistory:()=>u(!l),onClickSettings:()=>d(!0),onClickHelp:()=>f(!h),onClickVariables:()=>g(!m)})})),Object(_.jsx)(w.EuiFlexItem,{grow:!1,className:"conApp__tabsExtension"},Object(_.jsx)(un,{requestInProgress:o,requestResult:E?{method:E.request.method.toUpperCase(),endpoint:E.request.path,statusCode:E.response.statusCode,statusText:E.response.statusText,timeElapsedMs:E.response.timeMs}:void 0})))),l?Object(_.jsx)(w.EuiFlexItem,{grow:!1},n?Object(_.jsx)(en,{close:()=>u(!1)}):null):null,Object(_.jsx)(w.EuiFlexItem,null,Object(_.jsx)(zn,{loading:!x,setEditorInstance:v}))),x&&a?Object(_.jsx)(vn,{onDismiss:()=>{t.set("version_welcome_shown","@@SENSE_REVISION"),c(!1)}}):null,p?Object(_.jsx)(Gn,{onClose:()=>d(!1),editorInstance:y}):null,m?Object(_.jsx)(Kn,{onClose:()=>g(!1)}):null,h?Object(_.jsx)(xn,{onClose:()=>f(!1)}):null)}function Xn({children:e,className:t,initialWidth:n=100,style:o={}}){const[i,s]=Object(r.useState)(`${n}%`),{registry:a}=K(),c=Object(r.useRef)(null);return Object(r.useEffect)((()=>{a.registerPanel({width:n,setWidth(e){s(e+"%"),this.width=e},getWidth:()=>c.current.getBoundingClientRect().width})}),[n,a]),Object(_.jsx)("div",{className:t,ref:c,style:{...o,width:i,display:"flex"}},e)}function Yn(e){return Object(_.jsx)("button",an()({},e,{"data-test-subj":"splitPanelResizer","aria-label":b.i18n.translate("console.splitPanel.adjustPanelSizeAriaLabel",{defaultMessage:"Press left/right to adjust panels size"})}),Object(_.jsx)(w.EuiIcon,{type:"grabHorizontal"}))}const Zn={isDragging:!1,currentResizerPos:-1},er=(e,t)=>e/t*100;function tr({children:e,className:t,onPanelWidthChange:n,resizerClassName:o}){const i=r.Children.toArray(e),[s,a]=i,c=Object(r.useRef)(new split_panel_registry_PanelRegistry),l=Object(r.useRef)(null),[u,p]=Object(r.useState)(Zn),d=Object(r.useCallback)((e=>{p({...u,isDragging:!0,currentResizerPos:e.clientX})}),[u]),h=Object(r.useCallback)((e=>{const{key:t}=e;if(t===w.keys.ARROW_LEFT||t===w.keys.ARROW_RIGHT){e.preventDefault();const{current:r}=c,[o,i]=r.getPanels(),s=o.width-(t===w.keys.ARROW_LEFT?1:-1),a=i.width-(t===w.keys.ARROW_RIGHT?1:-1);o.setWidth(s),i.setWidth(a),n&&n([s,a])}}),[n]);Object(r.useEffect)((()=>{}),[i.length]);const f=[s,Object(_.jsx)(Yn,{key:"resizer",className:o,onKeyDown:h,onMouseDown:d}),a];return Object(_.jsx)(G,{registry:c.current},Object(_.jsx)("div",{className:t,ref:l,style:{display:"flex",height:"100%",width:"100%"},onMouseMove:e=>{if(u.isDragging){const{clientX:t}=e,{current:r}=c,[o,i]=r.getPanels(),s=t-u.currentResizerPos,a=l.current.getBoundingClientRect().width,d=er(o.getWidth()+s,a),h=er(i.getWidth()-s,a);o.setWidth(d),i.setWidth(h),n&&n([d,h]),p({...u,currentResizerPos:t})}},onMouseUp:()=>{p(Zn)}},f))}const nr=({http:e})=>({getEsConfig:()=>Object(s.sendRequest)(e,{path:"/api/console/es_config",method:"get"})});class es_host_service_EsHostService{constructor(e){f()(this,"host","http://localhost:9200"),this.api=e}setHost(e){this.host=e}async init(){const{data:e}=await this.api.getEsConfig();e&&e.host&&this.setHost(e.host)}getHost(){return this.host}}const rr=({api:e})=>new es_host_service_EsHostService(e);function or({I18nContext:e,notifications:t,docLinkVersion:n,usageCollection:r,element:o,http:s,theme$:c,docLinks:l,autocompleteInfo:p}){const h=d(r);h.load("opened_app");const f=Object(u.g)({engine:window.localStorage,prefix:"sense:"});Object(u.k)(f);const m=Object(u.e)({storage:f}),b=Object(u.f)({storage:f}),w=g(f),y=nr({http:s}),v=rr({api:y});return p.mapping.setup(s,b),Object(i.render)(Object(_.jsx)(e,null,Object(_.jsx)(a.KibanaThemeProvider,{theme$:c},Object(_.jsx)(E,{value:{docLinkVersion:n,docLinks:l,services:{esHostService:v,storage:f,history:m,settings:b,notifications:t,trackUiMetric:h,objectStorageClient:w,http:s,autocompleteInfo:p},theme$:c}},Object(_.jsx)(M,null,Object(_.jsx)(V,{settings:b.toJSON()},Object(_.jsx)(Qn,null)))))),o),()=>Object(i.unmountComponentAtNode)(o)}}])]);