p3x-redis-ui-material
Version:
💿 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via http and socket.io
23 lines • 1.04 MB
JavaScript
/*!
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
For more information about all licenses, please see 807.a566eb0aa7b3bf348ed5.js.LICENSE.txt
*/
(self.webpackChunkp3x_redis_ui_material=self.webpackChunkp3x_redis_ui_material||[]).push([[807],{8353:(e,t,i)=>{"use strict";i.r(t)},9807:(e,t,i)=>{i(8353),i.g.JSONEditor=i(6897),ace.config.setModuleUrl("ace/theme/twilight",i(1002))},1002:(e,t,i)=>{e=i.nmd(e),ace.define("ace/theme/twilight-css",["require","exports","module"],(function(e,t,i){i.exports=".ace-twilight .ace_gutter {\n background: #232323;\n color: #E2E2E2\n}\n\n.ace-twilight .ace_print-margin {\n width: 1px;\n background: #232323\n}\n\n.ace-twilight {\n background-color: #141414;\n color: #F8F8F8\n}\n\n.ace-twilight .ace_cursor {\n color: #A7A7A7\n}\n\n.ace-twilight .ace_marker-layer .ace_selection {\n background: rgba(221, 240, 255, 0.20)\n}\n\n.ace-twilight.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px #141414;\n}\n\n.ace-twilight .ace_marker-layer .ace_step {\n background: rgb(102, 82, 0)\n}\n\n.ace-twilight .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgba(255, 255, 255, 0.25)\n}\n\n.ace-twilight .ace_marker-layer .ace_active-line {\n background: rgba(255, 255, 255, 0.031)\n}\n\n.ace-twilight .ace_gutter-active-line {\n background-color: rgba(255, 255, 255, 0.031)\n}\n\n.ace-twilight .ace_marker-layer .ace_selected-word {\n border: 1px solid rgba(221, 240, 255, 0.20)\n}\n\n.ace-twilight .ace_invisible {\n color: rgba(255, 255, 255, 0.25)\n}\n\n.ace-twilight .ace_keyword,\n.ace-twilight .ace_meta {\n color: #CDA869\n}\n\n.ace-twilight .ace_constant,\n.ace-twilight .ace_constant.ace_character,\n.ace-twilight .ace_constant.ace_character.ace_escape,\n.ace-twilight .ace_constant.ace_other,\n.ace-twilight .ace_heading,\n.ace-twilight .ace_markup.ace_heading,\n.ace-twilight .ace_support.ace_constant {\n color: #CF6A4C\n}\n\n.ace-twilight .ace_invalid.ace_illegal {\n color: #F8F8F8;\n background-color: rgba(86, 45, 86, 0.75)\n}\n\n.ace-twilight .ace_invalid.ace_deprecated {\n text-decoration: underline;\n font-style: italic;\n color: #D2A8A1\n}\n\n.ace-twilight .ace_support {\n color: #9B859D\n}\n\n.ace-twilight .ace_fold {\n background-color: #AC885B;\n border-color: #F8F8F8\n}\n\n.ace-twilight .ace_support.ace_function {\n color: #DAD085\n}\n\n.ace-twilight .ace_list,\n.ace-twilight .ace_markup.ace_list,\n.ace-twilight .ace_storage {\n color: #F9EE98\n}\n\n.ace-twilight .ace_entity.ace_name.ace_function,\n.ace-twilight .ace_meta.ace_tag {\n color: #AC885B\n}\n\n.ace-twilight .ace_string {\n color: #8F9D6A\n}\n\n.ace-twilight .ace_string.ace_regexp {\n color: #E9C062\n}\n\n.ace-twilight .ace_comment {\n font-style: italic;\n color: #5F5A60\n}\n\n.ace-twilight .ace_variable {\n color: #7587A6\n}\n\n.ace-twilight .ace_xml-pe {\n color: #494949\n}\n\n.ace-twilight .ace_indent-guide {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y\n}\n\n.ace-twilight .ace_indent-guide-active {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;\n}\n"})),ace.define("ace/theme/twilight",["require","exports","module","ace/theme/twilight-css","ace/lib/dom"],(function(e,t,i){t.isDark=!0,t.cssClass="ace-twilight",t.cssText=e("./twilight-css"),e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)})),ace.require(["ace/theme/twilight"],(function(t){e&&(e.exports=t)}))},6897:e=>{var t;self,t=function(){return function(){var e={6545:function(e,t,i){"use strict";i.d(t,{t:function(){return c}});var n=i(1925),o=i(6237),r=i(3057);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:String(t)}var c=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.dom={};var n=this,o=this.dom;this.anchor=void 0,this.items=t,this.eventListeners={},this.selection=void 0,this.onClose=i?i.close:void 0,this.limitHeight=!!i&&i.limitHeight;var s=document.createElement("div");s.className="jsoneditor-contextmenu-root",o.root=s;var a=document.createElement("div");a.className="jsoneditor-contextmenu",o.menu=a,s.appendChild(a);var l=document.createElement("ul");l.className="jsoneditor-menu",a.appendChild(l),o.list=l,o.items=[];var c=document.createElement("button");c.type="button",o.focusButton=c;var h=document.createElement("li");h.style.overflow="hidden",h.style.height="0",h.appendChild(c),l.appendChild(h),function e(t,i,o){o.forEach((function(o){if("separator"===o.type){var s=document.createElement("div");s.className="jsoneditor-separator";var a=document.createElement("li");a.appendChild(s),t.appendChild(a)}else{var l={},c=document.createElement("li");t.appendChild(c);var h=document.createElement("button");if(h.type="button",h.className=o.className,l.button=h,o.title&&(h.title=o.title),o.click&&(h.onclick=function(e){e.preventDefault(),n.hide(),o.click()}),c.appendChild(h),o.submenu){var d=document.createElement("div");d.className="jsoneditor-icon",h.appendChild(d);var u,g=document.createElement("div");if(g.className="jsoneditor-text"+(o.click?"":" jsoneditor-right-margin"),g.appendChild(document.createTextNode(o.text)),h.appendChild(g),o.click){h.className+=" jsoneditor-default";var p=document.createElement("button");p.type="button",l.buttonExpand=p,p.className="jsoneditor-expand";var m=document.createElement("div");m.className="jsoneditor-expand",p.appendChild(m),c.appendChild(p),o.submenuTitle&&(p.title=o.submenuTitle),u=p}else{var f=document.createElement("div");f.className="jsoneditor-expand",h.appendChild(f),u=h}u.onclick=function(e){e.preventDefault(),n._onExpandItem(l),u.focus()};var v=[];l.subItems=v;var C=document.createElement("ul");l.ul=C,C.className="jsoneditor-menu",C.style.height="0",c.appendChild(C),e(C,v,o.submenu)}else{var y=document.createElement("div");y.className="jsoneditor-icon",h.appendChild(y);var I=document.createElement("div");I.className="jsoneditor-text",I.appendChild(document.createTextNode((0,r.Tl)(o.text))),h.appendChild(I)}i.push(l)}}))}(l,this.dom.items,t),this.maxHeight=0,t.forEach((function(e){var i=24*(t.length+(e.submenu?e.submenu.length:0));n.maxHeight=Math.max(n.maxHeight,i)}))}var t,i,s;return t=e,(i=[{key:"_getVisibleButtons",value:function(){var e=[],t=this;return this.dom.items.forEach((function(i){e.push(i.button),i.buttonExpand&&e.push(i.buttonExpand),i.subItems&&i===t.expandedItem&&i.subItems.forEach((function(t){e.push(t.button),t.buttonExpand&&e.push(t.buttonExpand)}))})),e}},{key:"show",value:function(t,i,r){this.hide();var s=!0,a=t.parentNode,l=t.getBoundingClientRect(),c=a.getBoundingClientRect(),h=i.getBoundingClientRect(),d=this;this.dom.absoluteAnchor=(0,n.p)(t,i,(function(){d.hide()})),l.bottom+this.maxHeight<h.bottom||l.top-this.maxHeight>h.top&&(s=!1);var u=r?0:l.top-c.top;if(s){var g=t.offsetHeight;this.dom.menu.style.left="0",this.dom.menu.style.top=u+g+"px",this.dom.menu.style.bottom=""}else this.dom.menu.style.left="0",this.dom.menu.style.top="",this.dom.menu.style.bottom="0px";if(this.limitHeight){var p=s?h.bottom-l.bottom-10:l.top-h.top-10;this.dom.list.style.maxHeight=p+"px",this.dom.list.style.overflowY="auto"}this.dom.absoluteAnchor.appendChild(this.dom.root),this.selection=(0,o.getSelection)(),this.anchor=t,setTimeout((function(){d.dom.focusButton.focus()}),0),e.visibleMenu&&e.visibleMenu.hide(),e.visibleMenu=this}},{key:"hide",value:function(){this.dom.absoluteAnchor&&(this.dom.absoluteAnchor.destroy(),delete this.dom.absoluteAnchor),this.dom.root.parentNode&&(this.dom.root.parentNode.removeChild(this.dom.root),this.onClose&&this.onClose()),e.visibleMenu===this&&(e.visibleMenu=void 0)}},{key:"_onExpandItem",value:function(e){var t=this,i=e===this.expandedItem,n=this.expandedItem;if(n&&(n.ul.style.height="0",n.ul.style.padding="",setTimeout((function(){t.expandedItem!==n&&(n.ul.style.display="",(0,o.removeClassName)(n.ul.parentNode,"jsoneditor-selected"))}),300),this.expandedItem=void 0),!i){var r=e.ul;r.style.display="block",r.clientHeight,setTimeout((function(){if(t.expandedItem===e){for(var i=0,n=0;n<r.childNodes.length;n++)i+=r.childNodes[n].clientHeight;r.style.height=i+"px",r.style.padding="5px 10px"}}),0),(0,o.addClassName)(r.parentNode,"jsoneditor-selected"),this.expandedItem=e}}},{key:"_onKeyDown",value:function(e){var t,i,n,r,s=e.target,a=e.which,l=!1;27===a?(this.selection&&(0,o.setSelection)(this.selection),this.anchor&&this.anchor.focus(),this.hide(),l=!0):9===a?e.shiftKey?0===(i=(t=this._getVisibleButtons()).indexOf(s))&&(t[t.length-1].focus(),l=!0):(i=(t=this._getVisibleButtons()).indexOf(s))===t.length-1&&(t[0].focus(),l=!0):37===a?("jsoneditor-expand"===s.className&&(i=(t=this._getVisibleButtons()).indexOf(s),(n=t[i-1])&&n.focus()),l=!0):38===a?(i=(t=this._getVisibleButtons()).indexOf(s),(n=t[i-1])&&"jsoneditor-expand"===n.className&&(n=t[i-2]),n||(n=t[t.length-1]),n&&n.focus(),l=!0):39===a?(i=(t=this._getVisibleButtons()).indexOf(s),(r=t[i+1])&&"jsoneditor-expand"===r.className&&r.focus(),l=!0):40===a&&(i=(t=this._getVisibleButtons()).indexOf(s),(r=t[i+1])&&"jsoneditor-expand"===r.className&&(r=t[i+2]),r||(r=t[0]),r&&(r.focus(),l=!0),l=!0),l&&(e.stopPropagation(),e.preventDefault())}}])&&a(t.prototype,i),s&&a(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}();c.visibleMenu=void 0},2115:function(e,t,i){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,r(n.key),n)}}function r(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var o=i.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:String(t)}i.d(t,{N:function(){return s}});var s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.errorTableVisible=t.errorTableVisible,this.onToggleVisibility=t.onToggleVisibility,this.onFocusLine=t.onFocusLine||function(){},this.onChangeHeight=t.onChangeHeight,this.dom={};var i=document.createElement("div");i.className="jsoneditor-validation-errors-container",this.dom.validationErrorsContainer=i;var n=document.createElement("div");n.style.display="none",n.className="jsoneditor-additional-errors fadein",n.textContent="Scroll for more ▿",this.dom.additionalErrorsIndication=n,i.appendChild(n);var o=document.createElement("span");o.className="jsoneditor-validation-error-icon",o.style.display="none",this.dom.validationErrorIcon=o;var r=document.createElement("span");r.className="jsoneditor-validation-error-count",r.style.display="none",this.dom.validationErrorCount=r,this.dom.parseErrorIndication=document.createElement("span"),this.dom.parseErrorIndication.className="jsoneditor-parse-error-icon",this.dom.parseErrorIndication.style.display="none"}var t,i,n;return t=e,(i=[{key:"getErrorTable",value:function(){return this.dom.validationErrorsContainer}},{key:"getErrorCounter",value:function(){return this.dom.validationErrorCount}},{key:"getWarningIcon",value:function(){return this.dom.validationErrorIcon}},{key:"getErrorIcon",value:function(){return this.dom.parseErrorIndication}},{key:"toggleTableVisibility",value:function(){this.errorTableVisible=!this.errorTableVisible,this.onToggleVisibility(this.errorTableVisible)}},{key:"setErrors",value:function(e,t){var i=this;if(this.dom.validationErrors&&(this.dom.validationErrors.parentNode.removeChild(this.dom.validationErrors),this.dom.validationErrors=null,this.dom.additionalErrorsIndication.style.display="none"),this.errorTableVisible&&e.length>0){var n=document.createElement("div");n.className="jsoneditor-validation-errors";var o=document.createElement("table");o.className="jsoneditor-text-errors",n.appendChild(o);var r=document.createElement("tbody");o.appendChild(r),e.forEach((function(e){var n;if(isNaN(e.line)){if(e.dataPath){var o=t.find((function(t){return t.path===e.dataPath}));o&&(n=o.line+1)}}else n=e.line;var s=document.createElement("tr");s.className=isNaN(n)?"":"jump-to-line","error"===e.type?s.className+=" parse-error":s.className+=" validation-error";var a=document.createElement("td"),l=document.createElement("button");l.className="jsoneditor-schema-error",a.appendChild(l),s.appendChild(a);var c=document.createElement("td");if(c.style="white-space: nowrap;",c.textContent=isNaN(n)?"":"Ln "+n,s.appendChild(c),"string"==typeof e){var h=document.createElement("td");h.colSpan=2;var d=document.createElement("pre");d.appendChild(document.createTextNode(e)),h.appendChild(d),s.appendChild(h)}else{var u=document.createElement("td");u.appendChild(document.createTextNode(e.dataPath||"")),s.appendChild(u);var g=document.createElement("td"),p=document.createElement("pre");p.appendChild(document.createTextNode(e.message.replace(/<br>/gi,"\n"))),g.appendChild(p),s.appendChild(g)}s.onclick=function(){i.onFocusLine(n)},r.appendChild(s)})),this.dom.validationErrors=n,this.dom.validationErrorsContainer.appendChild(n),this.dom.additionalErrorsIndication.title=e.length+" errors total",this.dom.validationErrorsContainer.clientHeight<this.dom.validationErrorsContainer.scrollHeight?(this.dom.additionalErrorsIndication.style.display="block",this.dom.validationErrorsContainer.onscroll=function(){i.dom.additionalErrorsIndication.style.display=i.dom.validationErrorsContainer.clientHeight>0&&0===i.dom.validationErrorsContainer.scrollTop?"block":"none"}):this.dom.validationErrorsContainer.onscroll=void 0;var s=this.dom.validationErrorsContainer.clientHeight+(this.dom.statusBar?this.dom.statusBar.clientHeight:0);this.onChangeHeight(s)}else this.onChangeHeight(0);var a=e.filter((function(e){return"error"!==e.type})).length;if(a>0?(this.dom.validationErrorCount.style.display="inline",this.dom.validationErrorCount.innerText=a,this.dom.validationErrorCount.onclick=this.toggleTableVisibility.bind(this),this.dom.validationErrorIcon.style.display="inline",this.dom.validationErrorIcon.title=a+" schema validation error(s) found",this.dom.validationErrorIcon.onclick=this.toggleTableVisibility.bind(this)):(this.dom.validationErrorCount.style.display="none",this.dom.validationErrorIcon.style.display="none"),e.some((function(e){return"error"===e.type}))){var l=e[0].line;this.dom.parseErrorIndication.style.display="block",this.dom.parseErrorIndication.title=isNaN(l)?"parse error - check that the json is valid":"parse error on line "+l,this.dom.parseErrorIndication.onclick=this.toggleTableVisibility.bind(this)}else this.dom.parseErrorIndication.style.display="none"}}])&&o(t.prototype,i),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},2877:function(e,t,i){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,r(n.key),n)}}function r(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var o=i.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:String(t)}i.d(t,{$:function(){return s}});var s=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=t.target||null,!this.target)throw new Error('FocusTracker constructor called without a "target" to track.');this.onFocus="function"==typeof t.onFocus?t.onFocus:null,this.onBlur="function"==typeof t.onBlur?t.onBlur:null,this._onClick=this._onEvent.bind(this),this._onKeyUp=function(e){9!==e.which&&9!==e.keyCode||this._onEvent(e)}.bind(this),this._onBlur=this._onEvent.bind(this),this.focusFlag=!1,this.firstEventFlag=!0,(this.onFocus||this.onBlur)&&(document.addEventListener("click",this._onClick),document.addEventListener("keyup",this._onKeyUp),document.addEventListener("blur",this._onBlur))}var t,i,n;return t=e,(i=[{key:"destroy",value:function(){document.removeEventListener("click",this._onClick),document.removeEventListener("keyup",this._onKeyUp),document.removeEventListener("blur",this._onBlur),this._onEvent({target:document.body})}},{key:"_onEvent",value:function(e){var t=e.target;t===this.target||this.target.contains(t)||this.target.contains(document.activeElement)?this.focusFlag||(this.onFocus&&this.onFocus({type:"focus",target:this.target}),this.focusFlag=!0):(this.focusFlag||this.firstEventFlag)&&(this.onBlur&&this.onBlur({type:"blur",target:this.target}),this.focusFlag=!1,this.firstEventFlag&&(this.firstEventFlag=!1))}}])&&o(t.prototype,i),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1346:function(e,t,i){"use strict";var n=i(7413),o=i(1746),r=i(5633).treeModeMixins,s=i(1948).textModeMixins,a=i(7483).previewModeMixins,l=i(6237),c=l.clear,h=l.extend,d=l.getInnerText,u=l.getInternetExplorerVersion,g=l.parse,p=i(2870).tryRequireAjv,m=i(5609).showTransformModal,f=i(2915).showSortModal,v=p();function C(e,t,i){if(!(this instanceof C))throw new Error('JSONEditor constructor called without "new".');var n=u();if(-1!==n&&n<9)throw new Error("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");t&&(t.error&&(console.warn('Option "error" has been renamed to "onError"'),t.onError=t.error,delete t.error),t.change&&(console.warn('Option "change" has been renamed to "onChange"'),t.onChange=t.change,delete t.change),t.editable&&(console.warn('Option "editable" has been renamed to "onEditable"'),t.onEditable=t.editable,delete t.editable),t.onChangeJSON&&("text"===t.mode||"code"===t.mode||t.modes&&(-1!==t.modes.indexOf("text")||-1!==t.modes.indexOf("code")))&&console.warn('Option "onChangeJSON" is not applicable to modes "text" and "code". Use "onChangeText" or "onChange" instead.'),t&&Object.keys(t).forEach((function(e){-1===C.VALID_OPTIONS.indexOf(e)&&console.warn('Unknown option "'+e+'". This option will be ignored')}))),arguments.length&&this._create(e,t,i)}"undefined"==typeof Promise&&console.error("Promise undefined. Please load a Promise polyfill in the browser in order to use JSONEditor"),C.modes={},C.prototype.DEBOUNCE_INTERVAL=150,C.VALID_OPTIONS=["ajv","schema","schemaRefs","templates","ace","theme","autocomplete","onChange","onChangeJSON","onChangeText","onExpand","onEditable","onError","onEvent","onModeChange","onNodeName","onValidate","onCreateMenu","onSelectionChange","onTextSelectionChange","onClassName","onFocus","onBlur","colorPicker","onColorPicker","timestampTag","timestampFormat","escapeUnicode","history","search","mode","modes","name","indentation","sortObjectKeys","navigationBar","statusBar","mainMenuBar","languages","language","enableSort","enableTransform","limitDragging","maxVisibleChilds","onValidationError","modalAnchor","popupAnchor","createQuery","executeQuery","queryDescription","allowSchemaSuggestions","showErrorTable"],C.prototype._create=function(e,t,i){this.container=e,this.options=t||{},this.json=i||{};var n=this.options.mode||this.options.modes&&this.options.modes[0]||"tree";this.setMode(n)},C.prototype.destroy=function(){},C.prototype.set=function(e){this.json=e},C.prototype.get=function(){return this.json},C.prototype.setText=function(e){this.json=g(e)},C.prototype.getText=function(){return JSON.stringify(this.json)},C.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},C.prototype.getName=function(){return this.options&&this.options.name},C.prototype.setMode=function(e){if(e!==this.options.mode||!this.create){var t=this.container,i=h({},this.options),n=i.mode;i.mode=e;var o=C.modes[e];if(!o)throw new Error('Unknown mode "'+i.mode+'"');var r="text"===o.data,s=this.getName(),a=this[r?"getText":"get"]();if(this.destroy(),c(this),h(this,o.mixin),this.create(t,i),this.setName(s),this[r?"setText":"set"](a),"function"==typeof o.load)try{o.load.call(this)}catch(e){console.error(e)}if("function"==typeof i.onModeChange&&e!==n)try{i.onModeChange(e,n)}catch(e){console.error(e)}}},C.prototype.getMode=function(){return this.options.mode},C.prototype._onError=function(e){this.options&&"function"==typeof this.options.onError?this.options.onError(e):window.alert(e.toString())},C.prototype.setSchema=function(e,t){if(e){var n;try{this.options.ajv?n=this.options.ajv:((n=v({allErrors:!0,verbose:!0,schemaId:"auto",$data:!0})).addMetaSchema(i(5207)),n.addMetaSchema(i(6801)))}catch(e){console.warn("Failed to create an instance of Ajv, JSON Schema validation is not available. Please use a JSONEditor bundle including Ajv, or pass an instance of Ajv as via the configuration option `ajv`.")}if(n){if(t){for(var o in t)n.removeSchema(o),t[o]&&n.addSchema(t[o],o);this.options.schemaRefs=t}this.validateSchema=n.compile(e),this.options.schema=e,this.options.schemaRefs=t,this.validate()}this.refresh()}else this.validateSchema=null,this.options.schema=null,this.options.schemaRefs=null,this.validate(),this.refresh();"function"==typeof this._onSchemaChange&&this._onSchemaChange(e,t)},C.prototype.validate=function(){},C.prototype.refresh=function(){},C.registerMode=function(e){var t,i;if(Array.isArray(e))for(t=0;t<e.length;t++)C.registerMode(e[t]);else{if(!("mode"in e))throw new Error('Property "mode" missing');if(!("mixin"in e))throw new Error('Property "mixin" missing');if(!("data"in e))throw new Error('Property "data" missing');var n=e.mode;if(n in C.modes)throw new Error('Mode "'+n+'" already registered');if("function"!=typeof e.mixin.create)throw new Error('Required function "create" missing on mixin');var o=["setMode","registerMode","modes"];for(t=0;t<o.length;t++)if((i=o[t])in e.mixin)throw new Error('Reserved property "'+i+'" not allowed in mixin');C.modes[n]=e}},C.registerMode(r),C.registerMode(s),C.registerMode(a),C.ace=n,C.Ajv=v,C.VanillaPicker=o,C.showTransformModal=m,C.showSortModal=f,C.getInnerText=d,C.default=C,e.exports=C},1389:function(e,t,i){"use strict";i.d(t,{n:function(){return l}});var n=i(6545),o=i(3057);function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function s(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:String(t)}var l=function(){function e(t,i,r,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);for(var a={code:{text:(0,o.Tl)("modeCodeText"),title:(0,o.Tl)("modeCodeTitle"),click:function(){s("code")}},form:{text:(0,o.Tl)("modeFormText"),title:(0,o.Tl)("modeFormTitle"),click:function(){s("form")}},text:{text:(0,o.Tl)("modeTextText"),title:(0,o.Tl)("modeTextTitle"),click:function(){s("text")}},tree:{text:(0,o.Tl)("modeTreeText"),title:(0,o.Tl)("modeTreeTitle"),click:function(){s("tree")}},view:{text:(0,o.Tl)("modeViewText"),title:(0,o.Tl)("modeViewTitle"),click:function(){s("view")}},preview:{text:(0,o.Tl)("modePreviewText"),title:(0,o.Tl)("modePreviewTitle"),click:function(){s("preview")}}},l=[],c=0;c<i.length;c++){var h=i[c],d=a[h];if(!d)throw new Error('Unknown mode "'+h+'"');d.className="jsoneditor-type-modes"+(r===h?" jsoneditor-selected":""),l.push(d)}var u=a[r];if(!u)throw new Error('Unknown mode "'+r+'"');var g=u.text,p=document.createElement("button");p.type="button",p.className="jsoneditor-modes jsoneditor-separator",p.textContent=g+" ▾",p.title=(0,o.Tl)("modeEditorTitle"),p.onclick=function(){new n.t(l).show(p,t)};var m=document.createElement("div");m.className="jsoneditor-modes",m.style.position="relative",m.appendChild(p),t.appendChild(m),this.dom={container:t,box:p,frame:m}}var t,i,r;return t=e,(i=[{key:"focus",value:function(){this.dom.box.focus()}},{key:"destroy",value:function(){this.dom&&this.dom.frame&&this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame),this.dom=null}}])&&s(t.prototype,i),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},7413:function(e,t,i){var n;if(window.ace)n=window.ace;else try{n=i(6990),i(4221),i(6534),i(6489);var o=i(5477);n.config.setModuleUrl("ace/mode/json_worker",o)}catch(e){}e.exports=n},9762:function(){window.ace.define("ace/theme/jsoneditor",["require","exports","module","ace/lib/dom"],(function(e,t,i){t.isDark=!1,t.cssClass="ace-jsoneditor",t.cssText='.ace-jsoneditor .ace_gutter {\nbackground: #ebebeb;\ncolor: #333\n}\n\n.ace-jsoneditor.ace_editor {\nline-height: 1.3;\nbackground-color: #fff;\n}\n.ace-jsoneditor .ace_print-margin {\nwidth: 1px;\nbackground: #e8e8e8\n}\n.ace-jsoneditor .ace_scroller {\nbackground-color: #FFFFFF\n}\n.ace-jsoneditor .ace_text-layer {\ncolor: gray\n}\n.ace-jsoneditor .ace_variable {\ncolor: #1a1a1a\n}\n.ace-jsoneditor .ace_cursor {\nborder-left: 2px solid #000000\n}\n.ace-jsoneditor .ace_overwrite-cursors .ace_cursor {\nborder-left: 0px;\nborder-bottom: 1px solid #000000\n}\n.ace-jsoneditor .ace_marker-layer .ace_selection {\nbackground: lightgray\n}\n.ace-jsoneditor.ace_multiselect .ace_selection.ace_start {\nbox-shadow: 0 0 3px 0px #FFFFFF;\nborder-radius: 2px\n}\n.ace-jsoneditor .ace_marker-layer .ace_step {\nbackground: rgb(255, 255, 0)\n}\n.ace-jsoneditor .ace_marker-layer .ace_bracket {\nmargin: -1px 0 0 -1px;\nborder: 1px solid #BFBFBF\n}\n.ace-jsoneditor .ace_marker-layer .ace_active-line {\nbackground: #FFFBD1\n}\n.ace-jsoneditor .ace_gutter-active-line {\nbackground-color : #dcdcdc\n}\n.ace-jsoneditor .ace_marker-layer .ace_selected-word {\nborder: 1px solid lightgray\n}\n.ace-jsoneditor .ace_invisible {\ncolor: #BFBFBF\n}\n.ace-jsoneditor .ace_keyword,\n.ace-jsoneditor .ace_meta,\n.ace-jsoneditor .ace_support.ace_constant.ace_property-value {\ncolor: #AF956F\n}\n.ace-jsoneditor .ace_keyword.ace_operator {\ncolor: #484848\n}\n.ace-jsoneditor .ace_keyword.ace_other.ace_unit {\ncolor: #96DC5F\n}\n.ace-jsoneditor .ace_constant.ace_language {\ncolor: darkorange\n}\n.ace-jsoneditor .ace_constant.ace_numeric {\ncolor: red\n}\n.ace-jsoneditor .ace_constant.ace_character.ace_entity {\ncolor: #BF78CC\n}\n.ace-jsoneditor .ace_invalid {\ncolor: #FFFFFF;\nbackground-color: #FF002A;\n}\n.ace-jsoneditor .ace_fold {\nbackground-color: #AF956F;\nborder-color: #000000\n}\n.ace-jsoneditor .ace_storage,\n.ace-jsoneditor .ace_support.ace_class,\n.ace-jsoneditor .ace_support.ace_function,\n.ace-jsoneditor .ace_support.ace_other,\n.ace-jsoneditor .ace_support.ace_type {\ncolor: #C52727\n}\n.ace-jsoneditor .ace_string {\ncolor: green\n}\n.ace-jsoneditor .ace_comment {\ncolor: #BCC8BA\n}\n.ace-jsoneditor .ace_entity.ace_name.ace_tag,\n.ace-jsoneditor .ace_entity.ace_other.ace_attribute-name {\ncolor: #606060\n}\n.ace-jsoneditor .ace_markup.ace_underline {\ntext-decoration: underline\n}\n.ace-jsoneditor .ace_indent-guide {\nbackground: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y\n}',e("../lib/dom").importCssString(t.cssText,t.cssClass)}))},5736:function(e,t){var i,n,o=(i={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(e,t,i,n,o,r,s){var a=r.length-1;switch(o){case 1:this.$=e.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(e);break;case 3:this.$=null;break;case 4:this.$=!0;break;case 5:this.$=!1;break;case 6:return this.$=r[a-1];case 13:this.$={};break;case 14:case 19:this.$=r[a-1];break;case 15:this.$=[r[a-2],r[a]];break;case 16:this.$={},this.$[r[a][0]]=r[a][1];break;case 17:this.$=r[a-2],r[a-2][r[a][0]]=r[a][1];break;case 18:this.$=[];break;case 20:this.$=[r[a]];break;case 21:this.$=r[a-2],r[a-2].push(r[a])}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function(e,t){throw new Error(e)},parse:function(e){var t=this,i=[0],n=[null],o=[],r=this.table,s="",a=0,l=0,c=0;this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var h=this.lexer.yylloc;function d(){var e;return"number"!=typeof(e=t.lexer.lex()||1)&&(e=t.symbols_[e]||e),e}o.push(h),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var u,g,p,m,f,v,C,y,I,b,A={};;){if(p=i[i.length-1],this.defaultActions[p]?m=this.defaultActions[p]:(null==u&&(u=d()),m=r[p]&&r[p][u]),void 0===m||!m.length||!m[0]){if(!c){for(v in I=[],r[p])this.terminals_[v]&&v>2&&I.push("'"+this.terminals_[v]+"'");var w="";w=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+I.join(", ")+", got '"+this.terminals_[u]+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==u?"end of input":"'"+(this.terminals_[u]||u)+"'"),this.parseError(w,{text:this.lexer.match,token:this.terminals_[u]||u,line:this.lexer.yylineno,loc:h,expected:I})}if(3==c){if(1==u)throw new Error(w||"Parsing halted.");l=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,h=this.lexer.yylloc,u=d()}for(;!(2..toString()in r[p]);){if(0==p)throw new Error(w||"Parsing halted.");b=1,i.length=i.length-2*b,n.length=n.length-b,o.length=o.length-b,p=i[i.length-1]}g=u,u=2,m=r[p=i[i.length-1]]&&r[p][2],c=3}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+u);switch(m[0]){case 1:i.push(u),n.push(this.lexer.yytext),o.push(this.lexer.yylloc),i.push(m[1]),u=null,g?(u=g,g=null):(l=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,h=this.lexer.yylloc,c>0&&c--);break;case 2:if(C=this.productions_[m[1]][1],A.$=n[n.length-C],A._$={first_line:o[o.length-(C||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(C||1)].first_column,last_column:o[o.length-1].last_column},void 0!==(f=this.performAction.call(A,s,l,a,this.yy,m[1],n,o)))return f;C&&(i=i.slice(0,-1*C*2),n=n.slice(0,-1*C),o=o.slice(0,-1*C)),i.push(this.productions_[m[1]][0]),n.push(A.$),o.push(A._$),y=r[i[i.length-2]][i[i.length-1]],i.push(y);break;case 3:return!0}}return!0}},n=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parseError)throw new Error(e);this.yy.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e,e.match(/\n/)&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},less:function(e){this._input=this.match.slice(e)+this._input},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;var e,t,i,n,o;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length&&(!(i=this._input.match(this.rules[r[s]]))||t&&!(i[0].length>t[0].length)||(t=i,n=s,this.options.flex));s++);return t?((o=t[0].match(/\n.*/g))&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-1:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,r[n],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e||void 0):""===this._input?this.EOF:void this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return void 0!==e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)},options:{},performAction:function(e,t,i,n){switch(i){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return e}(),i.lexer=n,i);t.parser=o,t.parse=o.parse.bind(o)},4772:function(e){"use strict";var t=function(){};t.prototype={on:function(e,t){this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(t)},off:function(e,t){this._events=this._events||{},e in this._events!=0&&this._events[e].splice(this._events[e].indexOf(t),1)},emit:function(e){if(this._events=this._events||{},e in this._events!=0)for(var t=0;t<this._events[e].length;t++)this._events[e][t].apply(this,Array.prototype.slice.call(arguments,1))}},t.mixin=function(e){for(var i=["on","off","emit"],n=0;n<i.length;n++)"function"==typeof e?e.prototype[i[n]]=t.prototype[i[n]]:e[i[n]]=t.prototype[i[n]];return e};var i={escapeRegExp:function(e){var t=/[\\^$.*+?()[\]{}|]/g,i=new RegExp(t.source);return e&&i.test(e)?e.replace(t,"\\$&"):e},extend:function(e,t){for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];o&&"[object Object]"===Object.prototype.toString.call(o)?(e[n]=e[n]||{},i.extend(e[n],o)):e[n]=o}return e},each:function(e,t,i){if("[object Object]"===Object.prototype.toString.call(e))for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.call(i,n,e[n],e);else for(var o=0,r=e.length;o<r;o++)t.call(i,o,e[o],e)},createElement:function(e,t){var i,n=document.createElement(e);if(t&&"[object Object]"===Object.prototype.toString.call(t))for(i in t)i in n?n[i]=t[i]:"html"===i?n.innerHTML=t[i]:n.setAttribute(i,t[i]);return n},hasClass:function(e,t){if(e)return e.classList?e.classList.contains(t):!!e.className&&!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))},addClass:function(e,t){i.hasClass(e,t)||(e.classList?e.classList.add(t):e.className=e.className.trim()+" "+t)},removeClass:function(e,t){i.hasClass(e,t)&&(e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," "))},closest:function(e,t){return e&&e!==document.body&&(t(e)?e:i.closest(e.parentNode,t))},isInt:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},debounce:function(e,t,i){var n;return function(){var o=this,r=arguments,s=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||e.apply(o,r)}),t),s&&e.apply(o,r)}},rect:function(e,t){var i=window,n=e.getBoundingClientRect(),o=t?i.pageXOffset:0,r=t?i.pageYOffset:0;return{bottom:n.bottom+r,height:n.height,left:n.left+o,right:n.right+o,top:n.top+r,width:n.width}},includes:function(e,t){return e.indexOf(t)>-1},startsWith:function(e,t){return e.substr(0,t.length)===t},truncate:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}};function n(e,t){return e.hasOwnProperty(t)&&(!0===e[t]||e[t].length)}function o(e,t,n){e.parentNode?e.parentNode.parentNode||t.appendChild(e.parentNode):t.appendChild(e),i.removeClass(e,"excluded"),n||(e.textContent=e.textContent)}var r=function(){if(this.items.length){var e=document.createDocumentFragment();if(this.config.pagination){var t=this.pages.slice(0,this.pageIndex);i.each(t,(function(t,n){i.each(n,(function(t,i){o(i,e,this.customOption)}),this)}),this)}else i.each(this.items,(function(t,i){o(i,e,this.customOption)}),this);e.childElementCount&&(i.removeClass(this.items[this.navIndex],"active"),this.navIndex=(e.querySelector(".selectr-option.selected")||e.querySelector(".selectr-option")).idx,i.addClass(this.items[this.navIndex],"active")),this.tree.appendChild(e)}},s=function(e){var t=e.target;this.container.contains(t)||!this.opened&&!i.hasClass(this.container,"notice")||this.close()},a=function(e,t){t=t||e;var n={class:"selectr-option",role:"treeitem","aria-selected":!1};this.customOption?n.html=this.config.renderOption(t):n.textContent=e.textContent;var o=i.createElement("li",n);return o.idx=e.idx,this.items.push(o),e.defaultSelected&&this.defaultSelected.push(e.idx),e.disabled&&(o.disabled=!0,i.addClass(o,"disabled")),o},l=function(){this.requiresPagination=this.config.pagination&&this.config.pagination>0,n(this.config,"width")&&(i.isInt(this.config.width)?this.width=this.config.width+"px":"auto"===this.config.width?this.width="100%":i.includes(this.config.width,"%")&&(this.width=this.config.width)),this.container=i.createElement("div",{class:"selectr-container"}),this.config.customClass&&i.addClass(this.container,this.config.customClass),this.mobileDevice?i.addClass(this.container,"selectr-mobile"):i.addClass(this.container,"selectr-desktop"),this.el.tabIndex=-1,this.config.nativeDropdown||this.mobileDevice?i.addClass(this.el,"selectr-visible"):i.addClass(this.el,"selectr-hidden"),this.selected=i.createElement("div",{class:"selectr-selected",disabled:this.disabled,tabIndex:0,"aria-expanded":!1}),this.label=i.createElement(this.el.multiple?"ul":"span",{class:"selectr-label"});var e=i.createElement("div",{class:"selectr-options-container"});if(this.tree=i.createElement("ul",{class:"selectr-options",role:"tree","aria-hidden":!0,"aria-expanded":!1}),this.notice=i.createElement("div",{class:"selectr-notice"}),this.el.setAttribute("aria-hidden",!0),this.disabled&&(this.el.disabled=!0),this.el.multiple?(i.addClass(this.label,"selectr-tags"),i.addClass(this.container,"multiple"),this.tags=[],this.selectedValues=this.config.defaultSelected?this.getSelectedProperties("value"):[],this.selectedIndexes=this.getSelectedProperties("idx")):(this.selectedValue=null,this.selectedIndex=-1),this.selected.appendChild(this.label),this.config.clearable&&(this.selectClear=i.createElement("button",{class:"selectr-clear",type:"button"}),this.container.appendChild(this.selectClear),i.addClass(this.container,"clearable")),this.config.taggable){var t=i.createElement("li",{class:"input-tag"});if(this.input=i.createElement("input",{class:"selectr-tag-input",placeholder:this.config.tagPlaceholder,tagIndex:0,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox",type:"search"}),t.appendChild(this.input),this.label.appendChild(t),i.addClass(this.container,"taggable"),this.tagSeperators=[","],this.config.tagSeperators){this.tagSeperators=this.tagSeperators.concat(this.config.tagSeperators);for(var o=[],r=0;r<this.tagSeperators.length;r++)o.push(i.escapeRegExp(this.tagSeperators[r]));this.tagSeperatorsRegex=new RegExp(o.join("|"),"i")}else this.tagSeperatorsRegex=new RegExp(",","i")}this.config.searchable&&(this.input=i.createElement("input",{class:"selectr-input",tagIndex:-1,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox",type:"search",placeholder:this.config.messages.searchPlaceholder}),this.inputClear=i.createElement("button",{class:"selectr-input-clear",type:"button"}),this.inputContainer=i.createElement("div",{class:"selectr-input-container"}),this.inputContainer.appendChild(this.input),this.inputContainer.appendChild(this.inputClear),e.appendChild(this.inputContainer)),e.appendChild(this.notice),e.appendChild(this.tree),this.items=[],this.options=[],this.el.options.length&&(this.options=[].slice.call(this.el.options));var s,l=!1,c=0;if(this.el.children.length&&i.each(this.el.children,(function(e,t){"OPTGROUP"===t.nodeName?(l=i.createElement("ul",{class:"selectr-optgroup",role:"group",html:"<li class='selectr-optgroup--label'>"+t.label+"</li>"}),i.each(t.children,(function(e,t){t.idx=c,l.appendChild(a.call(this,t,l)),c++}),this)):(t.idx=c,a.call(this,t),c++)}),this),this.config.data&&Array.isArray(this.config.data)){this.data=[];var h,d=!1;l=!1,c=0,i.each(this.config.data,(function(e,t){n(t,"children")?(d=i.createElement("optgroup",{label:t.text}),l=i.createElement("ul",{class:"selectr-optgroup",role:"group",html:"<li class='selectr-optgroup--label'>"+t.text+"</li>"}),i.each(t.children,(function(e,t){(h=new Option(t.text,t.value,!1,t.hasOwnProperty("selected")&&!0===t.selected)).disabled=n(t,"disabled"),this.options.push(h),d.appendChild(h),h.idx=c,l.appendChild(a.call(this,h,t)),this.data[c]=t,c++}),this),this.el.appendChild(d)):((h=new Option(t.text,t.value,!1,t.hasOwnProperty("selected")&&!0===t.selected)).disabled=n(t,"disabled"),this.options.push(h),h.idx=c,a.call(this,h,t),this.data[c]=t,c++)}),this)}this.setSelected(!0),this.navIndex=0;for(var u=0;u<this.items.length;u++)if(s=this.items[u],!i.hasClass(s,"disabled")){i.addClass(s,"active"),this.navIndex=u;break}this.requiresPagination&&(this.pageIndex=1,this.paginate()),this.container.appendChild(this.selected),this.container.appendChild(e),this.placeEl=i.createElement("div",{class:"selectr-placeholder"}),this.setPlaceholder(),this.selected.appendChild(this.placeEl),this.disabled&&this.disable(),this.el.parentNode.insertBefore(this.container,this.el),this.container.appendChild(this.el)},c=function(e){if(e=e||window.event,this.items.length&&this.opened&&i.includes([13,38,40],e.which)){if(e.preventDefault(),13===e.which)return!(this.noResults||this.config.taggable&&this.input.value.length>0)&&this.change(this.navIndex);var t,n=this.items[this.navIndex],o=this.navIndex;switch(e.which){case 38:t=0,this.navIndex>0&&this.navIndex--;break;case 40:t=1,this.navIndex<this.items.length-1&&this.navIndex++}for(this.navigating=!0;i.hasClass(this.items[this.navIndex],"disabled")||i.hasClass(this.items[this.navIndex],"excluded");){if(!(this.navIndex>0&&this.navIndex<this.items.length-1)){this.navIndex=o;break}if(t?this.navIndex++:this.navIndex--,this.searching){if(this.navIndex>this.tree.lastElementChild.idx){this.navIndex=this.tree.lastElementChild.idx;break}if(this.navIndex<this.tree.firstElementChild.idx){this.navIndex=this.tree.firstElementChild.idx;break}}}var r=i.rect(this.items[this.navIndex]);t?(0===this.navIndex?this.tree.scrollTop=0:r.top+r.height>this.optsRect.top+this.optsRect.height&&(this.tree.scrollTop=this.tree.scrollTop+(r.top+r.height-(this.optsRect.top+this.optsRect.height))),this.navIndex===this.tree.childElementCount-1&&this.requiresPagination&&u.call(this)):0===this.navIndex?this.tree.scrollTop=0:r.top-this.optsRect.top<0&&(this.tree.scrollTop=this.tree.scrollTop+(r.top-this.optsRect.top)),n&&i.removeClass(n,"active"),i.addClass(this.items[this.navIndex],"active")}else this.navigating=!1},h=function(e){var t,n=this,o=document.createDocumentFragment(),r=this.options[e.idx],s=this.data?this.data[e.idx]:r,a={class:"selectr-tag"};this.customSelected?a.html=this.config.renderSelection(s):a.textContent=r.textContent;var l=i.createElement("li",a),c=i.createElement("button",{class:"selectr-tag-remove",type:"button"});if(l.appendChild(c),l.idx=e.idx,l.tag=r.value,this.tags.push(l),this.config.sortSelected){var h=this.tags.slice();t=function(e,t){e.replace(/(\d+)|(\D+)/g,(function(e,i,n){t.push([i||1/0,n||""])}))},h.sort((function(e,i){var o,r,s=[],a=[];for(!0===n.config.sortSelected?(o=e.tag,r=i.tag):"text"===n.config.sortSelected&&(o=e.textContent,r=i.textContent),t(o,s),t(r,a);s.length&&a.length;){var l=s.shift(),c=a.shift(),h=l[0]-c[0]||l[1].localeCompare(c[1]);if(h)return h}return s.length-a.length})),i.each(h,(function(e,t){o.appendChild(t)})),this.label.innerHTML=""}else o.appendChild(l);this.config.taggable?this.label.insertBefore(o,this.input.parentNode):this.label.appendChild(o)},d=function(e){var t=!1;i.each(this.tags,(function(i,n){n.idx===e.idx&&(t=n)}),this),t&&(this.label.removeChild(t),this.tags.splice(this.tags.indexOf(t),1))},u=function(){var e=this.tree;if(e.scrollTop>=e.scrollHeight-e.offsetHeight&&this.pageIndex<this.pages.length){var t=document.createDocumentFragment();i.each(this.pages[this.pageIndex],(function(e,i){o(i,t,this.customOption)}),this),e.appendChild(t),this.pageIndex++,this.emit("selectr.paginate",{items:this.items.length,total:this.data.length,page:this.pageIndex,pages:this.pages.length})}},g=function(){(this.config.searchable||this.config.taggable)&&(this.input.value=null,this.searching=!1,this.config.searchable&&i.removeClass(this.inputContainer,"active"),i.hasClass(this.container,"notice")&&(i.removeClass(this.container,"notice"),i.addClass(this.container,"open"),this.input.focus()),i.each(this.items,(function(e,t){i.removeClass(t,"excluded"),this.customOption||(t.textContent=t.textContent)}),this))},p=function(e,t){if(!e)throw new Error("You must supply either a HTMLSelectElement or a CSS3 selector string.");if(this.el=e,"string"==typeof e&&(this.el=document.querySelector(e)),null===this.el)throw new Error("The element you passed to Selectr can not be found.");if("select"!==this.el.nodeName.toLowerCase())throw new Error("The element you passed to Selectr is not a HTMLSelectElement.");this.render(t)};p.prototype.render=function(e){if(!this.rendered){this.el.selectr=this,this.config=i.extend({defaultSelected:!0,width:"auto",disabled:!1,disabledMobile:!1,searchable:!0,clearable:!1,sortSelected:!1,allowDeselect:!1,closeOnScroll:!1,nativeDropdown:!1,nativeKeyboard:!1,placeholder:"Select an option...",taggable:!1,tagPlaceholder:"Enter a tag...",messages:{noResults:"No results.",noOptions:"No options available.",maxSelections:"A maximum of {max} items can be selected.",tagDuplicate:"That tag is already in use.",searchPlaceholder:"Search options..."}},e),this.originalType=this.el.type,this.originalIndex=this.el.tabIndex,this.defaultSelected=[],this.originalOptionCount=this.el.options.length,(this.config.multiple||this.config.taggable)&&(this.el.multiple=!0),this.disabled=n(this.config,"disabled"),this.opened=!1,this.config.taggable&&(this.config.searchable=!1),this.navigating=!1,this.mobileDevice=!1,!this.config.disabledMobile&&/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(navigator.userAgent)&&(this.mobileDevice=!0),this.customOption=this.config.hasOwnProperty("renderOption")&&"function"==typeof this.config.renderOption,this.customSelected=this.config.hasOwnProperty("renderSelection")&&"function"==typeof this.config.renderSelection,this.supportsEventPassiveOption=this.detectEventPassiveOption(),t.mixin(this),l.call(this),this.bindEvents(),this.update(),this.optsRect=i.rect(this.tree),this.rendered=!0,this.el.multiple||(this.el.selectedIndex=this.selectedIndex);var o=this;setTimeout((function(){o.emit("selectr.init")}),20)}},p.prototype.getSelected=function(){return this.el.querySelectorAll("option:checked")},p.prototype.getSelectedProperties=function(e){var t=this.getSelected();return[].slice.call(t).map((function(t){return t[e]})).filter((function(e){return null!=e}))},p.prototype.detectEventPassiveOption=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t)}catch(e){}return e},p.prototype.bindEvents=function(){var e=this;if(this.events={},this.events.dismiss=s.bind(this),this.events.navigate=c.bind(this),this.events.reset=this.reset.bind(this),(this.config.nativeDropdown||this.mobileDevice)&&(this.container.addEventListener("touchstart",(function(t){t.changedTouches[0].target===e.el&&e.toggle()}),!!this.supportsEventPassiveOption&&{passive:!0}),this.container.addEventListener("click",(function(t){t.target===e.el&&e.toggle()})),this.el.addEventListener("change",(function(t){if(!t.__selfTriggered)if(e.el.multiple){var n=e.getSelectedProperties("idx"),o=function(e,t){for(var i,n=[],o=e.slice(0),r=0;r<t.length;r++)(i=o.indexOf(t[r]))>-1?o.splice(i,1):n.push(t[r]);return[n,o]}(e.selectedIndexes,n);i.each(o[0],(function(t,i){e.select(i)}),e),i.each(o[1],(function(t,i){e.deselect(i)}),e)}else e.el.selectedIndex>-1&&e.select(e.el.selectedIndex)}))),this.config.nativeDropdown&&this.container.addEventListener("keydown",(function(t){"Enter"===t.key&&e.selected===document.activeElement&&(e.toggle(),setTimeout((function(){e.el.focus()}),200))})),this.selected.addEventListener("click",(function(t){e.disabled||e.toggle(),t.preventDefault()})),this.config.nativeKeyboard){var t="";this.selected.addEventListener("keydown",(function(i){if(!(e.disabled||e.selected!==document.activeElement||i.altKey||i.ctrlKey||i.metaKey)){if(" "===i.key||!e.opened&&["Enter","ArrowUp","ArrowDown"].indexOf(i.key)>-1)return e.toggle(),i.preventDefault(),void i.stopPropagation();if(i.key.length<=2&&String[String.fromCodePoint?"fromCodePoint":"fromCharCode"](i.key[String.codePointAt?"codePointAt":"charCodeAt"](0))===i.key){if(e.config.multiple)e.open(),e.config.searchable&&(e.input.value=i.key,e.input.focus(),e.search(null,!0));else{t+=i.key;var n=e.search(t,!0);n&&n.length&&(e.clear(),e.setValue(n[0].value)),setTimeout((function(){t=""}),1e3)}return i.preventDefault(),void i.stopPropagation()}}})),this.container.addEventListener("keyup",(function(t){e.opened&&"Escape"===t.key&&(e.close(),t.stopPropagation(),e.selected.focus())}))}this.label.addEventListener("click",(function(t){i.hasClass(t.target,"selectr-tag-remove")&&e.deselect(t.target.parentNode.idx)})),this.selectClear&&this.selectClear.addEventListener("click",this.clear.bind(this)),this.tree.addEventListener("mousedown",(function(e){e.preventDefault()})),this.tree.addEventListener("click",(function(t){var n=i.closest(t.target,(function(e){return e&&i.hasClass(e,"selectr-option")}));n&&(i.hasClass(n,"disabled")||(i.hasClass(n,"selected")?(e.el.multiple||!e.el.multiple&&e.config.allowDeselect)&&e.deselect(n.idx):e.select(n.idx),e.opened&&!e.el.multiple&&e.close())),t.preventDefault(),t.stopPropagation()})),this.tree.addEventListener("mouseover",(function(t){i.hasClass(t.target,"selectr-option")&&(i.hasClass(t.target,"disabled")||(i.removeClass(e.items[e.navIndex],"active"),i.addClass(t.target,"active"),e.navIndex=[].slice.call(e.items).indexOf(t.target)))})),this.config.searchable&&(this.input.addEventListener("focus",(function(t){e.searching=!0})),this.input.addEventListener("blur",(function(t){e.searching=!1})),this.input.addEventListener("keyup",(function(t){e.search(),e.config.taggable||(this.value.length?i.addClass(this.parentNode,"active"):i.removeClass(this.parentNode,"active"))})),this.inputClear.addEventListener("click",(function(t){e.input.value=null,g.call(e),e.tree.childElementCount||r.call(e)}))),this.config.taggable&&this.input.addEventListener("keyup",(function(t){if(e.search(),e.config.taggable&&this.value.length){var n=this.value.trim();if(n.length&&(13===t.which||e.tagSeperatorsRegex.test(n))){var o,r=n.replace(e.tagSeperatorsRegex,"");(r=(r=i.escapeRegExp(r)).trim()).length&&(o=e.add({value:r,textContent:r,selected:!0},!0)),o?(e.close(),g.call(e)):(this.value="",e.setMessage(e.config.messages.tagDuplicate))}}})),this.update=i.debounce((function(){e.opened&&e.config.closeOnScroll&&e.close(),e.width&&(e.container.style.width=e.width),e.invert()}),50),this.requiresPagination&&(this.paginateItems=i.debounce((function(){u.call(this)}),50),this.tree.addEventListener("scroll",this.paginateItems.bind(this))),document.addEventListener("click",this.events.dismiss),window.addEventListener("keydown",this.events.navigate),window.addEventListener("resize",this.update),window.addEventListener("scroll",this.update),this.on("selectr.destroy",(function(){document.removeEventListener("click",this.events.dismiss),window.removeEventListener("keydown",this.events.navigate),window.removeEventListener("resize",this.update),window.removeEventListener("scroll",this.update)})),this.el.form&&(this.el.form.addEventListener("reset",this.events.reset),this.on("selectr.destroy",(function(){this.el.form.removeEventListener("reset",this.events.reset)})))},p.prototype.setSelected=function(e){if(this.config.data||this.el.multiple||!this.el.options.length||(0===this.el.selectedIndex&&(this.el.options[0].defaultSelected||this.config.defaultSelected||(this.el.selectedIndex=-1)),this.selectedIndex=this.el.selectedIndex,this.selectedIndex>-1&&this.select(this.selectedIndex)),this.config.multiple&&"select-one"===this.originalType&&!this.config.data&&this.el.options[0].selected&&!this.el.options[0].defaultSelected&&(this.el.options[0].selected=!1),i.each(this.options,(function(e,t){t.selected&&t.defaultSelected&&this.select(t.idx)}),this),this.config.selectedValue&&this.setValue(this.config.selectedValue),this.config.data){!this.el.multiple&&this.config.defaultSelected&&this.el.selectedIndex<0&&this.config.data.length>0&&this.select(0);var t=0;i.each(this.config.data,(function(e,o){n(o,"children")?i.each(o.children,(function(e,i){i.hasOwnProperty("selected")&&!0===i.selected&&this.select(t),t++}),this):(o.hasOwnProperty("selected")&&!0===o.selected&&this.select(t),t++)}),this)}},p.prototype.destroy=function(){this.rendered&&(this.emit("selectr.destroy"),"select-one"===this.originalType&&(this.el.multiple=!1),this.config.data&&(this.el.innerHTML=""),i.removeClass(this.el,"selectr-hidden"),this.container.parentNode.replaceChild(this.el,this.container),this.rendered=!1,delete this.el.selectr)},p.prototype.change=function(e){var t=this.items[e],n=this.options[e];n.disabled||(n.selected&&i.hasClass(t,"selected")?this.deselect(e):this.select(e),this.opened&&!this.el.multiple&&this.close())},p.prototype.select=function(e){var t=this.items[e],n=[].slice.call(this.el.options),o=this.options[e];if(this.el.multiple){if(i.includes(this.selectedIndexes,e))return!1;if(this.config.maxSelections&&this.tags.length===this.config.maxSelections)return this.setMessage(this.config.messages.maxSelections.replace("{max}",this.config.maxSelections),!0),!1;this.selectedValues.push(o.value),this.selectedIndexes.push(e),h.call(this,t)}else{var r=this.data?this.data[e]:o;this.customSelected?this.label.innerHTML=this.config.renderSelection(r):this.label.textContent=o.textContent,this.selectedValue=o.value,this.selectedIndex=e,i.each(this.options,(function(t,n){var o=this.items[t];t!==e&&(o&&i.removeClass(o,"selected"),n.selected=!1,n.removeAttribute("selected"))}),this)}if(i.includes(n,o)||this.el.add(o),t.setAttribute("aria-selected",!0),i.addClass(t,"selected"),i.addClass(this.container,"has-selected"),o.selected=!0,o.setAttribute("selected",""),this.emit("selectr.change",o),this.emit("selectr.select",o),"createEvent"in document){var s=document.createEvent("HTMLEvents");s.initEvent("change",!0,!0),s.__selfTriggered=!0,this.el.dispatchEvent(s)}else this.el.fireEvent("onchange")},p.prototype.deselect=function(e,t){var n=this.items[e],o=this.options[e];if(this.el.multiple){var r=this.selectedIndexes.indexOf(e);this.selectedIndexes.splice(r,1);var s=this.selectedValues.indexOf(o.value);this.selectedValues.splice(s,1),d.call(this,n),this.tags.length||i.removeClass(this.container,"has-selected")}else{if(!t&&!this.config.clearable&&!this.config.allowDeselect)return!1;this.label.innerHTML="",this.selectedValue=null,this.el.selectedIndex=this.selectedIndex=-1,i.removeClass(this.container,"has-selected")}if(this.items[e].setAttribute("aria-selected",!1),i.removeClass(this.items[e],"selected"),o.selected=!1,o.removeAttribute("selected"),this.emit("selectr.change",null),this.emit("selectr.deselect",o),"createEvent"in document){var a=document.createEvent("HTMLEvents");a.initEvent("change",!0,!0),a.__selfTriggered=!0,this.el.dispatchEvent(a)}else this.el.fireEvent("onchange")},p.prototype.setValue=function(e){var t=Array.isArray(e);if(t||(e=e.toString().trim()),!this.el.multiple&&t)return!1;i.each(this.options,(function(i,n){(t&&e.indexOf(n.value)>-1||n.value===e)&&this.change(n.idx)}),this)},p.prototype.getValue=function(e,t){var n;if(this.el.multiple)e?this.selectedIndexes.length&&((n={}).values=[],i.each(this.selectedIndexes,(function(e,t){var i=this.options[t];n.values[e]={value:i.value,text:i.textContent}}),this)):n=this.selectedValues.slice();else if(e){var o=this.options[this.selectedIndex];n={value:o.value,text:o.textContent}}else n=this.selectedValue;return e&&t&&(n=JSON.stringify(n)),n},p.prototype.add=function(e,t){if(e){if(this.data=this.data||[],this.items=this.items||[],this.options=this.options||[],Array.isArray(e))i.each(e,(function(e,i){this.add(i,t)}),this);else if("[object Object]"===Object.prototype.toString.call(e)){if(t){var n=!1;if(i.each(this.options,(function(t,i){i.value.toLowerCase()===e.value.toLowerCase()&&(n=!0)})),n)return!1}var o=i.createElement("option",e);return this.data.push(e),this.mobileDevice&&this.el.add(o),this.options.push(o),o.idx=this.options.length>0?this.options.length-1:0,a.call(this,o),e.selected&&this.select(o.idx),this.setPlaceholder(),o}return this.config.pagination&&this.paginate(),!0}},p.prototype.remove=function(e){var t,n=[];Array.isArray(e)?i.each(e,(function(e,t){i.isInt(t)?n.push(this.getOptionByIndex(t)):"string"==typeof t&&n.push(this.getOptionByValue(t))}),this):i.isInt(e)?n.push(this.getOptionByIndex(e)):"string"==typeof e&&n.push(this.getOptionByValue(e)),n.length&&(i.each(n,(function(e,n){t=n.idx,this.el.remove(n),this.options.splice(t,1);var o=this.items[t].parentNode;o&&o.removeChild(this.items[t]),this.items.splice(t,1),i.each(this.options,(function(e,t){t.idx=e,this.items[e].idx=e}),this)}),this),this.setPlaceholder(),this.config.pagination&&this.paginate())},p.prototype.removeAll=function(){this.clear(!0),i.each(this.el.options,(function(e,t){this.el.remove(t)}),this),i.truncate(this.tree),this.items=[],this.options=[],this.data=[],this.navIndex=0,this.requiresPagination&&(this.requiresPagination=!1,this.pageIndex=1,this.pages=[]),this.setPlaceholder()},p.prototype.search=function(e,t){if(!this.navigating){var n=!1;e||(e=this.input.value,n=!0,this.removeMessage(),i.truncate(this.tree));var s=[],a=document.createDocumentFragment();if((e=e.trim().toLowerCase()).length>0){var l=t?i.startsWith:i.includes;if(i.each(this.options,(function(t,r){var c=this.items[r.idx];l(r.textContent.trim().toLowerCase(),e)&&!r.disabled?(s.push({text:r.textContent,value:r.value}),n&&(o(c,a,this.customOption),i.removeClass(c,"excluded"),this.customOption||function(e,t){var i=t.textContent,n=new RegExp(e,"ig"),o=n.exec(i);if(o){t.innerHTML="";var r=document.createElement("span");r.classList.add("selectr-match"),r.textContent=o[0],t.appendChild(document.createTextNode(i.substring(0,o.index))),t.appendChild(r),t.appendChild(document.createTextNode(i.substring(n.lastIndex)))}}(e,r))):n&&i.addClass(c,"excluded")}),this),n){if(a.childElementCount){var c=this.items[this.navIndex],h=a.querySelector(".selectr-option:not(.excluded)");this.noResults=!1,i.removeClass(c,"active"),this.navIndex=h.idx,i.addClass(h,"active")}else this.config.taggable||(this.noResults=!0,this.setMessage(this.config.messages.noResults));this.tree.appendChild(a)}}else r.call(this);return s}},p.prototype.toggle=function(){this.disabled||(this.opened?this.close():this.open())},p.prototype.open=function(){var e=this;return!!this.options.length&&(this.opened||this.emit("selectr.open"),this.opened=!0,this.mobileDevice||this.config.nativeDropdown?(i.addClass(this.container,"native-open"),void(this.config.data&&i.each(this.options,(function(e,t){this.el.add(t)}),this))):(i.addClass(this.container,"open"),r.call(this),this.invert(),this.tree.scrollTop=0,i.removeClass(this.container,"notice"),this.selected.setAttribute("aria-expanded",!0),this.tree.setAttribute("aria-hidden",!1),this.tree.setAttribute("aria-expanded",!0),void(this.config.searchable&&!this.config.taggable&&setTimeout((function(){e.input.focus(),e.input.tabIndex=0}),10))))},p.prototype.close=function(){if(this.opened&&this.emit("selectr.close"),this.opened=!1,this.navigating=!1,this.mobileDevice||this.config.nativeDropdown)i.removeClass(this.container,"native-open");else{var e=i.hasClass(this.container,"notice");this.config.searchable&&!e&&(this.input.blur(),this.input.tabIndex=-1,this.searching=!1),e&&(i.removeClass(this.container,"notice"),this.notice.textContent=""),i.removeClass(this.container,"open"),i.removeClass(this.container,"native-open"),this.selected.setAttribute("aria-expanded",!1),this.tree.setAttribute("aria-hidden",!0),this.tree.setAttribute("aria-expanded",!1),i.truncate(this.tree),g.call(this)}},p.prototype.enable=function(){this.disabled=!1,this.el.disabled=!1,this.selected.tabIndex=this.originalIndex,this.el.multiple&&i.each(this.tags,(function(e,t){t.lastElementChild.tabIndex=0})),i.removeClass(this.container,"selectr-disabled")},p.prototype.disable=function(e){e||(this.el.disabled=!0),this.selected.tabIndex=-1,this.el.multiple&&i.each(this.tags,(function(e,t){t.lastElementChild.tabIndex=-1})),this.disabled=!0,i.addClass(this.container,"selectr-disabled")},p.prototype.reset=function(){this.disabled||(this.clear(),this.setSelected(!0),i.each(this.defaultSelected,(function(e,t){this.select(t)}),this),this.emit("selectr.reset"))},p.prototype.clear=function(e,t){if(this.el.multiple){if(this.selectedIndexes.length){var n=this.selectedIndexes.slice();t?this.deselect(n.slice(-1)[0]):i.each(n,(function(e,t){this.deselect(t)}),this)}}else this.selectedIndex>-1&&this.deselect(this.selectedIndex,e);this.emit("selectr.clear")},p.prototype.serialise=function(e){var t=[];return i.each(this.options,(function(e,i){var n={value:i.value,text:i.textContent};i.selected&&(n.selected=!0),i.disabled&&(n.disabled=!0),t[e]=n})),e?JSON.stringify(t):t},p.prototype.serialize=function(e){return this.serialise(e)},p.prototype.setPlaceholder=function(e){e=e||this.config.placeholder||this.el.getAttribute("placeholder"),this.options.length||(e=this.config.messages.noOptions),this.placeEl.innerHTML=e},p.prototype.paginate=function(){if(this.items.length){var e=this;return this.pages=this.items.map((function(t,i){return i%e.config.pagination==0?e.items.slice(i,i+e.config.pagination):null})).filter((function(e){return e})),this.pages}},p.prototype.setMessage=function(e,t){t&&this.close(),i.addClass(this.container,"notice"),this.notice.textContent=e},p.prototype.removeMessage=function(){i.removeClass(this.container,"notice"),this.notice.innerHTML=""},p.prototype.invert=function(){var e=i.rect(this.selected),t=this.tree.parentNode.offsetHeight,n=window.innerHeight;e.top+e.height+t>n?(i.addClass(this.container,"inverted"),this.isInverted=!0):(i.removeClass(this.container,"inverted"),this.isInverted=!1),this.optsRect=i.rect(this.tree)},p.prototype.getOptionByIndex=function(e){return this.options[e]},p.prototype.getOptionByValue=function(e){for(var t=!1,i=0,n=this.options.length;i<n;i++)if(this.options[i].value.trim()===e.toString().trim()){t=this.options[i];break}return t},e.exports=p},660:function(e,t,i){"use strict";i.d(t,{Oq:function(){return o},SC:function(){return s},ai:function(){return n},hJ:function(){return r}});var n=document.body,o=10485760,r=2e4,s=2147483648},1925:function(e,t,i){"use strict";i.d(t,{p:function(){return o}});var n=i(6237);function o(e,t,i){var o,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s="function"==typeof(o=e).getRootNode?o.getRootNode():window,a={},l=e.getBoundingClientRect(),c=t.getBoundingClientRect(),h=document.createElement("div");function d(){if(h&&h.parentNode){for(var t in h.parentNode.removeChild(h),a)if(r=a,l=t,Object.prototype.hasOwnProperty.call(r,l)){var o=a[t];o&&(0,n.removeEventListener)(s,t,o),delete a[t]}"function"==typeof i&&i(e)}var r,l}function u(e){var t;(t=e.target)===h||(0,n.isChildOf)(t,h)||d()}if(h.className="jsoneditor-anchor",h.style.position="absolute",h.style.left=l.left-c.left+"px",h.style.top=l.top-c.top+"px",h.style.width=l.width-2+"px",h.style.height=l.height-2+"px",h.style.boxSizing="border-box",t.appendChild(h),a.mousedown=(0,n.addEventListener)(s,"mousedown",u),a.mousewheel=(0,n.addEventListener)(s,"mousewheel",u),r){var g=null;h.onmouseover=function(){clearTimeout(g),g=null},h.onmouseout=function(){g||(g=setTimeout(d,200))}}return h.destroy=d,h}},5477:function(e){e.exports="data:application/javascript;base64,Im5vIHVzZSBzdHJpY3QiOwohKGZ1bmN0aW9uKHdpbmRvdykgewppZiAodHlwZW9mIHdpbmRvdy53aW5kb3cgIT0gInVuZGVmaW5lZCIgJiYgd2luZG93LmRvY3VtZW50KQogICAgcmV0dXJuOwppZiAod2luZG93LnJlcXVpcmUgJiYgd2luZG93LmRlZmluZSkKICAgIHJldHVybjsKCmlmICghd2luZG93LmNvbnNvbGUpIHsKICAgIHdpbmRvdy5jb25zb2xlID0gZnVuY3Rpb24oKSB7CiAgICAgICAgdmFyIG1zZ3MgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDApOwogICAgICAgIHBvc3RNZXNzYWdlKHt0eXBlOiAibG9nIiwgZGF0YTogbXNnc30pOwogICAgfTsKICAgIHdpbmRvdy5jb25zb2xlLmVycm9yID0KICAgIHdpbmRvdy5jb25zb2xlLndhcm4gPSAKICAgIHdpbmRvdy5jb25zb2xlLmxvZyA9CiAgICB3aW5kb3cuY29uc29sZS50cmFjZSA9IHdpbmRvdy5jb25zb2xlOwp9CndpbmRvdy53aW5kb3cgPSB3aW5kb3c7CndpbmRvdy5hY2UgPSB3aW5kb3c7Cgp3aW5kb3cub25lcnJvciA9IGZ1bmN0aW9uKG1lc3NhZ2UsIGZpbGUsIGxpbmUsIGNvbCwgZXJyKSB7CiAgICBwb3N0TWVzc2FnZSh7dHlwZTogImVycm9yIiwgZGF0YTogewogICAgICAgIG1lc3NhZ2U6IG1lc3NhZ2UsCiAgICAgICAgZGF0YTogZXJyICYmIGVyci5kYXRhLAogICAgICAgIGZpbGU6IGZpbGUsCiAgICAgICAgbGluZTogbGluZSwgCiAgICAgICAgY29sOiBjb2wsCiAgICAgICAgc3RhY2s6IGVyciAmJiBlcnIuc3RhY2sKICAgIH19KTsKfTsKCndpbmRvdy5ub3JtYWxpemVNb2R1bGUgPSBmdW5jdGlvbihwYXJlbnRJZCwgbW9kdWxlTmFtZSkgewogICAgLy8gbm9ybWFsaXplIHBsdWdpbiByZXF1aXJlcwogICAgaWYgKG1vZHVsZU5hbWUuaW5kZXhPZigiISIpICE9PSAtMSkgewogICAgICAgIHZhciBjaHVua3MgPSBtb2R1bGVOYW1lLnNwbGl0KCIhIik7CiAgICAgICAgcmV0dXJuIHdpbmRvdy5ub3JtYWxpemVNb2R1bGUocGFyZW50SWQsIGNodW5rc1swXSkgKyAiISIgKyB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBjaHVua3NbMV0pOwogICAgfQogICAgLy8gbm9ybWFsaXplIHJlbGF0aXZlIHJlcXVpcmVzCiAgICBpZiAobW9kdWxlTmFtZS5jaGFyQXQoMCkgPT0gIi4iKSB7CiAgICAgICAgdmFyIGJhc2UgPSBwYXJlbnRJZC5zcGxpdCgiLyIpLnNsaWNlKDAsIC0xKS5qb2luKCIvIik7CiAgICAgICAgbW9kdWxlTmFtZSA9IChiYXNlID8gYmFzZSArICIvIiA6ICIiKSArIG1vZHVsZU5hbWU7CiAgICAgICAgCiAgICAgICAgd2hpbGUgKG1vZHVsZU5hbWUuaW5kZXhPZigiLiIpICE9PSAtMSAmJiBwcmV2aW91cyAhPSBtb2R1bGVOYW1lKSB7CiAgICAgICAgICAgIHZhciBwcmV2aW91cyA9IG1vZHVsZU5hbWU7CiAgICAgICAgICAgIG1vZHVsZU5hbWUgPSBtb2R1bGVOYW1lLnJlcGxhY2UoL15cLlwvLywgIiIpLnJlcGxhY2UoL1wvXC5cLy8sICIvIikucmVwbGFjZSgvW15cL10rXC9cLlwuXC8vLCAiIik7CiAgICAgICAgfQogICAgfQogICAgCiAgICByZXR1cm4gbW9kdWxlTmFtZTsKfTsKCndpbmRvdy5yZXF1aXJlID0gZnVuY3Rpb24gcmVxdWlyZShwYXJlbnRJZCwgaWQpIHsKICAgIGlmICghaWQpIHsKICAgICAgICBpZCA9IHBhcmVudElkOwogICAgICAgIHBhcmVudElkID0gbnVsbDsKICAgIH0KICAgIGlmICghaWQuY2hhckF0KQogICAgICAgIHRocm93IG5ldyBFcnJvcigid29ya2VyLmpzIHJlcXVpcmUoKSBhY2NlcHRzIG9ubHkgKHBhcmVudElkLCBpZCkgYXMgYXJndW1lbnRzIik7CgogICAgaWQgPSB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBpZCk7CgogICAgdmFyIG1vZHVsZSA9IHdpbmRvdy5yZXF1aXJlLm1vZHVsZXNbaWRdOwogICAgaWYgKG1vZHVsZSkgewogICAgICAgIGlmICghbW9kdWxlLmluaXRpYWxpemVkKSB7CiAgICAgICAgICAgIG1vZHVsZS5pbml0aWFsaXplZCA9IHRydWU7CiAgICAgICAgICAgIG1vZHVsZS5leHBvcnRzID0gbW9kdWxlLmZhY3RvcnkoKS5leHBvcnRzOwogICAgICAgIH0KICAgICAgICByZXR1cm4gbW9kdWxlLmV4cG9ydHM7CiAgICB9CiAgIAogICAgaWYgKCF3aW5kb3cucmVxdWlyZS50bG5zKQogICAgICAgIHJldHVybiBjb25zb2xlLmxvZygidW5hYmxlIHRvIGxvYWQgIiArIGlkKTsKICAgIAogICAgdmFyIHBhdGggPSByZXNvbHZlTW9kdWxlSWQoaWQsIHdpbmRvdy5yZXF1aXJlLnRsbnMpOwogICAgaWYgKHBhdGguc2xpY2UoLTMpICE9ICIuanMiKSBwYXRoICs9ICIuanMiOwogICAgCiAgICB3aW5kb3cucmVxdWlyZS5pZCA9IGlkOwogICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7fTsgLy8gcHJldmVudCBpbmZpbml0ZSBsb29wIG9uIGJyb2tlbiBtb2R1bGVzCiAgICBpbXBvcnRTY3JpcHRzKHBhdGgpOwogICAgcmV0dXJuIHdpbmRvdy5yZXF1aXJlKHBhcmVudElkLCBpZCk7Cn07CmZ1bmN0aW9uIHJlc29sdmVNb2R1bGVJZChpZCwgcGF0aHMpIHsKICAgIHZhciB0ZXN0UGF0aCA9IGlkLCB0YWlsID0gIiI7CiAgICB3aGlsZSAodGVzdFBhdGgpIHsKICAgICAgICB2YXIgYWxpYXMgPSBwYXRoc1t0ZXN0UGF0aF07CiAgICAgICAgaWYgKHR5cGVvZiBhbGlhcyA9PSAic3RyaW5nIikgewogICAgICAgICAgICByZXR1cm4gYWxpYXMgKyB0YWlsOwogICAgICAgIH0gZWxzZSBpZiAoYWxpYXMpIHsKICAgICAgICAgICAgcmV0dXJuICBhbGlhcy5sb2NhdGlvbi5yZXBsYWNlKC9cLyokLywgIi8iKSArICh0YWlsIHx8IGFsaWFzLm1haW4gfHwgYWxpYXMubmFtZSk7CiAgICAgICAgfSBlbHNlIGlmIChhbGlhcyA9PT0gZmFsc2UpIHsKICAgICAgICAgICAgcmV0dXJuICIiOwogICAgICAgIH0KICAgICAgICB2YXIgaSA9IHRlc3RQYXRoLmxhc3RJbmRleE9mKCIvIik7CiAgICAgICAgaWYgKGkgPT09IC0xKSBicmVhazsKICAgICAgICB0YWlsID0gdGVzdFBhdGguc3Vic3RyKGkpICsgdGFpbDsKICAgICAgICB0ZXN0UGF0aCA9IHRlc3RQYXRoLnNsaWNlKDAsIGkpOwogICAgfQogICAgcmV0dXJuIGlkOwp9CndpbmRvdy5yZXF1aXJlLm1vZHVsZXMgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9OwoKd2luZG93LmRlZmluZSA9IGZ1bmN0aW9uKGlkLCBkZXBzLCBmYWN0b3J5KSB7CiAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PSAyKSB7CiAgICAgICAgZmFjdG9yeSA9IGRlcHM7CiAgICAgICAgaWYgKHR5cGVvZiBpZCAhPSAic3RyaW5nIikgewogICAgICAgICAgICBkZXBzID0gaWQ7CiAgICAgICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICAgICAgfQogICAgfSBlbHNlIGlmIChhcmd1bWVudHMubGVuZ3RoID09IDEpIHsKICAgICAgICBmYWN0b3J5ID0gaWQ7CiAgICAgICAgZGVwcyA9IFtdOwogICAgICAgIGlkID0gd2luZG93LnJlcXVpcmUuaWQ7CiAgICB9CiAgICAKICAgIGlmICh0eXBlb2YgZmFjdG9yeSAhPSAiZnVuY3Rpb24iKSB7CiAgICAgICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7CiAgICAgICAgICAgIGV4cG9ydHM6IGZhY3RvcnksCiAgICAgICAgICAgIGluaXRpYWxpemVkOiB0cnVlCiAgICAgICAgfTsKICAgICAgICByZXR1cm47CiAgICB9CgogICAgaWYgKCFkZXBzLmxlbmd0aCkKICAgICAgICAvLyBJZiB0aGVyZSBpcyBubyBkZXBlbmRlbmNpZXMsIHdlIGluamVjdCAicmVxdWlyZSIsICJleHBvcnRzIiBhbmQKICAgICAgICAvLyAibW9kdWxlIiBhcyBkZXBlbmRlbmNpZXMsIHRvIHByb3ZpZGUgQ29tbW9uSlMgY29tcGF0aWJpbGl0eS4KICAgICAgICBkZXBzID0gWyJyZXF1aXJlIiwgImV4cG9ydHMiLCAibW9kdWxlIl07CgogICAgdmFyIHJlcSA9IGZ1bmN0aW9uKGNoaWxkSWQpIHsKICAgICAgICByZXR1cm4gd2luZG93LnJlcXVpcmUoaWQsIGNoaWxkSWQpOwogICAgfTsKCiAgICB3aW5kb3cucmVxdWlyZS5tb2R1bGVzW2lkXSA9IHsKICAgICAgICBleHBvcnRzOiB7fSwKICAgICAgICBmYWN0b3J5OiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgdmFyIG1vZHVsZSA9IHRoaXM7CiAgICAgICAgICAgIHZhciByZXR1cm5FeHBvcnRzID0gZmFjdG9yeS5hcHBseSh0aGlzLCBkZXBzLnNsaWNlKDAsIGZhY3RvcnkubGVuZ3RoKS5tYXAoZnVuY3Rpb24oZGVwKSB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggKGRlcCkgewogICAgICAgICAgICAgICAgICAgIC8vIEJlY2F1c2UgInJlcXVpcmUiLCAiZXhwb3J0cyIgYW5kICJtb2R1bGUiIGFyZW4ndCBhY3R1YWwKICAgICAgICAgICAgICAgICAgICAvLyBkZXBlbmRlbmNpZXMsIHdlIG11c3QgaGFuZGxlIHRoZW0gc2VwZXJhdGVseS4KICAgICAgICAgICAgICAgICAgICBjYXNlICJyZXF1aXJlIjogcmV0dXJuIHJlcTsKICAgICAgICAgICAgICAgICAgICBjYXNlICJleHBvcnRzIjogcmV0dXJuIG1vZHVsZS5leHBvcnRzOwogICAgICAgICAgICAgICAgICAgIGNhc2UgIm1vZHVsZSI6ICByZXR1cm4gbW9kdWxlOwogICAgICAgICAgICAgICAgICAgIC8vIEJ1dCBmb3IgYWxsIG90aGVyIGRlcGVuZGVuY2llcywgd2UgY2FuIGp1c3QgZ28gYWhlYWQgYW5kCiAgICAgICAgICAgICAgICAgICAgLy8gcmVxdWlyZSB0aGVtLgogICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6ICAgICAgICByZXR1cm4gcmVxKGRlcCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pKTsKICAgICAgICAgICAgaWYgKHJldHVybkV4cG9ydHMpCiAgICAgICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IHJldHVybkV4cG9ydHM7CiAgICAgICAgICAgIHJldHVybiBtb2R1bGU7CiAgICAgICAgfQogICAgfTsKfTsKd2luZG93LmRlZmluZS5hbWQgPSB7fTsKd2luZG93LnJlcXVpcmUudGxucyA9IHt9Owp3aW5kb3cuaW5pdEJhc2VVcmxzICA9IGZ1bmN0aW9uIGluaXRCYXNlVXJscyh0b3BMZXZlbE5hbWVzcGFjZXMpIHsKICAgIGZvciAodmFyIGkgaW4gdG9wTGV2ZWxOYW1lc3BhY2VzKQogICAgICAgIHRoaXMucmVxdWlyZS50bG5zW2ldID0gdG9wTGV2ZWxOYW1lc3BhY2VzW2ldOwp9OwoKd2luZG93LmluaXRTZW5kZXIgPSBmdW5jdGlvbiBpbml0U2VuZGVyKCkgewoKICAgIHZhciBFdmVudEVtaXR0ZXIgPSB3aW5kb3cucmVxdWlyZSgiYWNlL2xpYi9ldmVudF9lbWl0dGVyIikuRXZlbnRFbWl0dGVyOwogICAgdmFyIG9vcCA9IHdpbmRvdy5yZXF1aXJlKCJhY2UvbGliL29vcCIpOwogICAgCiAgICB2YXIgU2VuZGVyID0gZnVuY3Rpb24oKSB7fTsKICAgIAogICAgKGZ1bmN0aW9uKCkgewogICAgICAgIAogICAgICAgIG9vcC5pbXBsZW1lbnQodGhpcywgRXZlbnRFbWl0dGVyKTsKICAgICAgICAgICAgICAgIAogICAgICAgIHRoaXMuY2FsbGJhY2sgPSBmdW5jdGlvbihkYXRhLCBjYWxsYmFja0lkKSB7CiAgICAgICAgICAgIHBvc3RNZXNzYWdlKHsKICAgICAgICAgICAgICAgIHR5cGU6ICJjYWxsIiwKICAgICAgICAgICAgICAgIGlkOiBjYWxsYmFja0lkLAogICAgICAgICAgICAgICAgZGF0YTogZGF0YQogICAgICAgICAgICB9KTsKICAgICAgICB9OwogICAgCiAgICAgICAgdGhpcy5lbWl0ID0gZnVuY3Rpb24obmFtZSwgZGF0YSkgewogICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICB0eXBlOiAiZXZlbnQiLAogICAgICAgICAgICAgICAgbmFtZTogbmFtZSwKICAgICAgICAgICAgICAgIGRhdGE6IGRhdGEKICAgICAgICAgICAgfSk7CiAgICAgICAgfTsKICAgICAgICAKICAgIH0pLmNhbGwoU2VuZGVyLnByb3RvdHlwZSk7CiAgICAKICAgIHJldHVybiBuZXcgU2VuZGVyKCk7Cn07Cgp2YXIgbWFpbiA9IHdpbmRvdy5tYWluID0gbnVsbDsKdmFyIHNlbmRlciA9IHdpbmRvdy5zZW5kZXIgPSBudWxsOwoKd2luZG93Lm9ubWVzc2FnZSA9IGZ1bmN0aW9uKGUpIHsKICAgIHZhciBtc2cgPSBlLmRhdGE7CiAgICBpZiAobXNnLmV2ZW50ICYmIHNlbmRlcikgewogICAgICAgIHNlbmRlci5fc2lnbmFsKG1zZy5ldmVudCwgbXNnLmRhdGEpOwogICAgfQogICAgZWxzZSBpZiAobXNnLmNvbW1hbmQpIHsKICAgICAgICBpZiAobWFpblttc2cuY29tbWFuZF0pCiAgICAgICAgICAgIG1haW5bbXNnLmNvbW1hbmRdLmFwcGx5KG1haW4sIG1zZy5hcmdzKTsKICAgICAgICBlbHNlIGlmICh3aW5kb3dbbXNnLmNvbW1hbmRdKQogICAgICAgICAgICB3aW5kb3dbbXNnLmNvbW1hbmRdLmFwcGx5KHdpbmRvdywgbXNnLmFyZ3MpOwogICAgICAgIGVsc2UKICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJVbmtub3duIGNvbW1hbmQ6IiArIG1zZy5jb21tYW5kKTsKICAgIH0KICAgIGVsc2UgaWYgKG1zZy5pbml0KSB7CiAgICAgICAgd2luZG93LmluaXRCYXNlVXJscyhtc2cudGxucyk7CiAgICAgICAgc2VuZGVyID0gd2luZG93LnNlbmRlciA9IHdpbmRvdy5pbml0U2VuZGVyKCk7CiAgICAgICAgdmFyIGNsYXp6ID0gdGhpcy5yZXF1aXJlKG1zZy5tb2R1bGUpW21zZy5jbGFzc25hbWVdOwogICAgICAgIG1haW4gPSB3aW5kb3cubWFpbiA9IG5ldyBjbGF6eihzZW5kZXIpOwogICAgfQp9Owp9KSh0aGlzKTsKCmFjZS5kZWZpbmUoImFjZS9saWIvb29wIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CmV4cG9ydHMuaW5oZXJpdHMgPSBmdW5jdGlvbiAoY3Rvciwgc3VwZXJDdG9yKSB7CiAgICBjdG9yLnN1cGVyXyA9IHN1cGVyQ3RvcjsKICAgIGN0b3IucHJvdG90eXBlID0gT2JqZWN0LmNyZWF0ZShzdXBlckN0b3IucHJvdG90eXBlLCB7CiAgICAgICAgY29uc3RydWN0b3I6IHsKICAgICAgICAgICAgdmFsdWU6IGN0b3IsCiAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlLAogICAgICAgICAgICB3cml0YWJsZTogdHJ1ZSwKICAgICAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlCiAgICAgICAgfQogICAgfSk7Cn07CmV4cG9ydHMubWl4aW4gPSBmdW5jdGlvbiAob2JqLCBtaXhpbikgewogICAgZm9yICh2YXIga2V5IGluIG1peGluKSB7CiAgICAgICAgb2JqW2tleV0gPSBtaXhpbltrZXldOwogICAgfQogICAgcmV0dXJuIG9iajsKfTsKZXhwb3J0cy5pbXBsZW1lbnQgPSBmdW5jdGlvbiAocHJvdG8sIG1peGluKSB7CiAgICBleHBvcnRzLm1peGluKHByb3RvLCBtaXhpbik7Cn07Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9hcHBseV9kZWx0YSIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwpmdW5jdGlvbiB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsIGVycm9yVGV4dCkgewogICAgY29uc29sZS5sb2coIkludmFsaWQgRGVsdGE6IiwgZGVsdGEpOwogICAgdGhyb3cgIkludmFsaWQgRGVsdGE6ICIgKyBlcnJvclRleHQ7Cn0KZnVuY3Rpb24gcG9zaXRpb25JbkRvY3VtZW50KGRvY0xpbmVzLCBwb3NpdGlvbikgewogICAgcmV0dXJuIHBvc2l0aW9uLnJvdyA+PSAwICYmIHBvc2l0aW9uLnJvdyA8IGRvY0xpbmVzLmxlbmd0aCAmJgogICAgICAgIHBvc2l0aW9uLmNvbHVtbiA+PSAwICYmIHBvc2l0aW9uLmNvbHVtbiA8PSBkb2NMaW5lc1twb3NpdGlvbi5yb3ddLmxlbmd0aDsKfQpmdW5jdGlvbiB2YWxpZGF0ZURlbHRhKGRvY0xpbmVzLCBkZWx0YSkgewogICAgaWYgKGRlbHRhLmFjdGlvbiAhPSAiaW5zZXJ0IiAmJiBkZWx0YS5hY3Rpb24gIT0gInJlbW92ZSIpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuYWN0aW9uIG11c3QgYmUgJ2luc2VydCcgb3IgJ3JlbW92ZSciKTsKICAgIGlmICghKGRlbHRhLmxpbmVzIGluc3RhbmNlb2YgQXJyYXkpKQogICAgICAgIHRocm93RGVsdGFFcnJvcihkZWx0YSwgImRlbHRhLmxpbmVzIG11c3QgYmUgYW4gQXJyYXkiKTsKICAgIGlmICghZGVsdGEuc3RhcnQgfHwgIWRlbHRhLmVuZCkKICAgICAgICB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsICJkZWx0YS5zdGFydC9lbmQgbXVzdCBiZSBhbiBwcmVzZW50Iik7CiAgICB2YXIgc3RhcnQgPSBkZWx0YS5zdGFydDsKICAgIGlmICghcG9zaXRpb25JbkRvY3VtZW50KGRvY0xpbmVzLCBkZWx0YS5zdGFydCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuc3RhcnQgbXVzdCBiZSBjb250YWluZWQgaW4gZG9jdW1lbnQiKTsKICAgIHZhciBlbmQgPSBkZWx0YS5lbmQ7CiAgICBpZiAoZGVsdGEuYWN0aW9uID09ICJyZW1vdmUiICYmICFwb3NpdGlvbkluRG9jdW1lbnQoZG9jTGluZXMsIGVuZCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuZW5kIG11c3QgY29udGFpbmVkIGluIGRvY3VtZW50IGZvciAncmVtb3ZlJyBhY3Rpb25zIik7CiAgICB2YXIgbnVtUmFuZ2VSb3dzID0gZW5kLnJvdyAtIHN0YXJ0LnJvdzsKICAgIHZhciBudW1SYW5nZUxhc3RMaW5lQ2hhcnMgPSAoZW5kLmNvbHVtbiAtIChudW1SYW5nZVJvd3MgPT0gMCA/IHN0YXJ0LmNvbHVtbiA6IDApKTsKICAgIGlmIChudW1SYW5nZVJvd3MgIT0gZGVsdGEubGluZXMubGVuZ3RoIC0gMSB8fCBkZWx0YS5saW5lc1tudW1SYW5nZVJvd3NdLmxlbmd0aCAhPSBudW1SYW5nZUxhc3RMaW5lQ2hhcnMpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEucmFuZ2UgbXVzdCBtYXRjaCBkZWx0YSBsaW5lcyIpOwp9CmV4cG9ydHMuYXBwbHlEZWx0YSA9IGZ1bmN0aW9uIChkb2NMaW5lcywgZGVsdGEsIGRvTm90VmFsaWRhdGUpIHsKICAgIHZhciByb3cgPSBkZWx0YS5zdGFydC5yb3c7CiAgICB2YXIgc3RhcnRDb2x1bW4gPSBkZWx0YS5zdGFydC5jb2x1bW47CiAgICB2YXIgbGluZSA9IGRvY0xpbmVzW3Jvd10gfHwgIiI7CiAgICBzd2l0Y2ggKGRlbHRhLmFjdGlvbikgewogICAgICAgIGNhc2UgImluc2VydCI6CiAgICAgICAgICAgIHZhciBsaW5lcyA9IGRlbHRhLmxpbmVzOwogICAgICAgICAgICBpZiAobGluZXMubGVuZ3RoID09PSAxKSB7CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3ddID0gbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZGVsdGEubGluZXNbMF0gKyBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICB2YXIgYXJncyA9IFtyb3csIDFdLmNvbmNhdChkZWx0YS5saW5lcyk7CiAgICAgICAgICAgICAgICBkb2NMaW5lcy5zcGxpY2UuYXBwbHkoZG9jTGluZXMsIGFyZ3MpOwogICAgICAgICAgICAgICAgZG9jTGluZXNbcm93XSA9IGxpbmUuc3Vic3RyaW5nKDAsIHN0YXJ0Q29sdW1uKSArIGRvY0xpbmVzW3Jvd107CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3cgKyBkZWx0YS5saW5lcy5sZW5ndGggLSAxXSArPSBsaW5lLnN1YnN0cmluZyhzdGFydENvbHVtbik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAicmVtb3ZlIjoKICAgICAgICAgICAgdmFyIGVuZENvbHVtbiA9IGRlbHRhLmVuZC5jb2x1bW47CiAgICAgICAgICAgIHZhciBlbmRSb3cgPSBkZWx0YS5lbmQucm93OwogICAgICAgICAgICBpZiAocm93ID09PSBlbmRSb3cpIHsKICAgICAgICAgICAgICAgIGRvY0xpbmVzW3Jvd10gPSBsaW5lLnN1YnN0cmluZygwLCBzdGFydENvbHVtbikgKyBsaW5lLnN1YnN0cmluZyhlbmRDb2x1bW4pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgZG9jTGluZXMuc3BsaWNlKHJvdywgZW5kUm93IC0gcm93ICsgMSwgbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZG9jTGluZXNbZW5kUm93XS5zdWJzdHJpbmcoZW5kQ29sdW1uKSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICB9Cn07Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9saWIvZXZlbnRfZW1pdHRlciIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgRXZlbnRFbWl0dGVyID0ge307CnZhciBzdG9wUHJvcGFnYXRpb24gPSBmdW5jdGlvbiAoKSB7IHRoaXMucHJvcGFnYXRpb25TdG9wcGVkID0gdHJ1ZTsgfTsKdmFyIHByZXZlbnREZWZhdWx0ID0gZnVuY3Rpb24gKCkgeyB0aGlzLmRlZmF1bHRQcmV2ZW50ZWQgPSB0cnVlOyB9OwpFdmVudEVtaXR0ZXIuX2VtaXQgPQogICAgRXZlbnRFbWl0dGVyLl9kaXNwYXRjaEV2ZW50ID0gZnVuY3Rpb24gKGV2ZW50TmFtZSwgZSkgewogICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwgKHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB7fSk7CiAgICAgICAgdGhpcy5fZGVmYXVsdEhhbmRsZXJzIHx8ICh0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB7fSk7CiAgICAgICAgdmFyIGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXSB8fCBbXTsKICAgICAgICB2YXIgZGVmYXVsdEhhbmRsZXIgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnNbZXZlbnROYW1lXTsKICAgICAgICBpZiAoIWxpc3RlbmVycy5sZW5ndGggJiYgIWRlZmF1bHRIYW5kbGVyKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgaWYgKHR5cGVvZiBlICE9ICJvYmplY3QiIHx8ICFlKQogICAgICAgICAgICBlID0ge307CiAgICAgICAgaWYgKCFlLnR5cGUpCiAgICAgICAgICAgIGUudHlwZSA9IGV2ZW50TmFtZTsKICAgICAgICBpZiAoIWUuc3RvcFByb3BhZ2F0aW9uKQogICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbiA9IHN0b3BQcm9wYWdhdGlvbjsKICAgICAgICBpZiAoIWUucHJldmVudERlZmF1bHQpCiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQgPSBwcmV2ZW50RGVmYXVsdDsKICAgICAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpc3RlbmVycy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBsaXN0ZW5lcnNbaV0oZSwgdGhpcyk7CiAgICAgICAgICAgIGlmIChlLnByb3BhZ2F0aW9uU3RvcHBlZCkKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgICAgICBpZiAoZGVmYXVsdEhhbmRsZXIgJiYgIWUuZGVmYXVsdFByZXZlbnRlZCkKICAgICAgICAgICAgcmV0dXJuIGRlZmF1bHRIYW5kbGVyKGUsIHRoaXMpOwogICAgfTsKRXZlbnRFbWl0dGVyLl9zaWduYWwgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBlKSB7CiAgICB2YXIgbGlzdGVuZXJzID0gKHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwge30pW2V2ZW50TmFtZV07CiAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICByZXR1cm47CiAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGlzdGVuZXJzLmxlbmd0aDsgaSsrKQogICAgICAgIGxpc3RlbmVyc1tpXShlLCB0aGlzKTsKfTsKRXZlbnRFbWl0dGVyLm9uY2UgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaykgewogICAgdmFyIF9zZWxmID0gdGhpczsKICAgIHRoaXMub24oZXZlbnROYW1lLCBmdW5jdGlvbiBuZXdDYWxsYmFjaygpIHsKICAgICAgICBfc2VsZi5vZmYoZXZlbnROYW1lLCBuZXdDYWxsYmFjayk7CiAgICAgICAgY2FsbGJhY2suYXBwbHkobnVsbCwgYXJndW1lbnRzKTsKICAgIH0pOwogICAgaWYgKCFjYWxsYmFjaykgewogICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbiAocmVzb2x2ZSkgewogICAgICAgICAgICBjYWxsYmFjayA9IHJlc29sdmU7CiAgICAgICAgfSk7CiAgICB9Cn07CkV2ZW50RW1pdHRlci5zZXREZWZhdWx0SGFuZGxlciA9IGZ1bmN0aW9uIChldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICB2YXIgaGFuZGxlcnMgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnM7CiAgICBpZiAoIWhhbmRsZXJzKQogICAgICAgIGhhbmRsZXJzID0gdGhpcy5fZGVmYXVsdEhhbmRsZXJzID0geyBfZGlzYWJsZWRfOiB7fSB9OwogICAgaWYgKGhhbmRsZXJzW2V2ZW50TmFtZV0pIHsKICAgICAgICB2YXIgb2xkID0gaGFuZGxlcnNbZXZlbnROYW1lXTsKICAgICAgICB2YXIgZGlzYWJsZWQgPSBoYW5kbGVycy5fZGlzYWJsZWRfW2V2ZW50TmFtZV07CiAgICAgICAgaWYgKCFkaXNhYmxlZCkKICAgICAgICAgICAgaGFuZGxlcnMuX2Rpc2FibGVkX1tldmVudE5hbWVdID0gZGlzYWJsZWQgPSBbXTsKICAgICAgICBkaXNhYmxlZC5wdXNoKG9sZCk7CiAgICAgICAgdmFyIGkgPSBkaXNhYmxlZC5pbmRleE9mKGNhbGxiYWNrKTsKICAgICAgICBpZiAoaSAhPSAtMSkKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQogICAgaGFuZGxlcnNbZXZlbnROYW1lXSA9IGNhbGxiYWNrOwp9OwpFdmVudEVtaXR0ZXIucmVtb3ZlRGVmYXVsdEhhbmRsZXIgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaykgewogICAgdmFyIGhhbmRsZXJzID0gdGhpcy5fZGVmYXVsdEhhbmRsZXJzOwogICAgaWYgKCFoYW5kbGVycykKICAgICAgICByZXR1cm47CiAgICB2YXIgZGlzYWJsZWQgPSBoYW5kbGVycy5fZGlzYWJsZWRfW2V2ZW50TmFtZV07CiAgICBpZiAoaGFuZGxlcnNbZXZlbnROYW1lXSA9PSBjYWxsYmFjaykgewogICAgICAgIGlmIChkaXNhYmxlZCkKICAgICAgICAgICAgdGhpcy5zZXREZWZhdWx0SGFuZGxlcihldmVudE5hbWUsIGRpc2FibGVkLnBvcCgpKTsKICAgIH0KICAgIGVsc2UgaWYgKGRpc2FibGVkKSB7CiAgICAgICAgdmFyIGkgPSBkaXNhYmxlZC5pbmRleE9mKGNhbGxiYWNrKTsKICAgICAgICBpZiAoaSAhPSAtMSkKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQp9OwpFdmVudEVtaXR0ZXIub24gPQogICAgRXZlbnRFbWl0dGVyLmFkZEV2ZW50TGlzdGVuZXIgPSBmdW5jdGlvbiAoZXZlbnROYW1lLCBjYWxsYmFjaywgY2FwdHVyaW5nKSB7CiAgICAgICAgdGhpcy5fZXZlbnRSZWdpc3RyeSA9IHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwge307CiAgICAgICAgdmFyIGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXTsKICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdID0gW107CiAgICAgICAgaWYgKGxpc3RlbmVycy5pbmRleE9mKGNhbGxiYWNrKSA9PSAtMSkKICAgICAgICAgICAgbGlzdGVuZXJzW2NhcHR1cmluZyA/ICJ1bnNoaWZ0IiA6ICJwdXNoIl0oY2FsbGJhY2spOwogICAgICAgIHJldHVybiBjYWxsYmFjazsKICAgIH07CkV2ZW50RW1pdHRlci5vZmYgPQogICAgRXZlbnRFbWl0dGVyLnJlbW92ZUxpc3RlbmVyID0KICAgICAgICBFdmVudEVtaXR0ZXIucmVtb3ZlRXZlbnRMaXN0ZW5lciA9IGZ1bmN0aW9uIChldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICAgICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9ldmVudFJlZ2lzdHJ5IHx8IHt9OwogICAgICAgICAgICB2YXIgbGlzdGVuZXJzID0gdGhpcy5fZXZlbnRSZWdpc3RyeVtldmVudE5hbWVdOwogICAgICAgICAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgdmFyIGluZGV4ID0gbGlzdGVuZXJzLmluZGV4T2YoY2FsbGJhY2spOwogICAgICAgICAgICBpZiAoaW5kZXggIT09IC0xKQogICAgICAgICAgICAgICAgbGlzdGVuZXJzLnNwbGljZShpbmRleCwgMSk7CiAgICAgICAgfTsKRXZlbnRFbWl0dGVyLnJlbW92ZUFsbExpc3RlbmVycyA9IGZ1bmN0aW9uIChldmVudE5hbWUpIHsKICAgIGlmICghZXZlbnROYW1lKQogICAgICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB1bmRlZmluZWQ7CiAgICBpZiAodGhpcy5fZXZlbnRSZWdpc3RyeSkKICAgICAgICB0aGlzLl9ldmVudFJlZ2lzdHJ5W2V2ZW50TmFtZV0gPSB1bmRlZmluZWQ7CiAgICBpZiAodGhpcy5fZGVmYXVsdEhhbmRsZXJzKQogICAgICAgIHRoaXMuX2RlZmF1bHRIYW5kbGVyc1tldmVudE5hbWVdID0gdW5kZWZpbmVkOwp9OwpleHBvcnRzLkV2ZW50RW1pdHRlciA9IEV2ZW50RW1pdHRlcjsKCn0pOwoKYWNlLmRlZmluZSgiYWNlL3JhbmdlIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXsidXNlIHN0cmljdCI7CnZhciBSYW5nZSA9IC8qKiBAY2xhc3MgKi8gKGZ1bmN0aW9uICgpIHsKICAgIGZ1bmN0aW9uIFJhbmdlKHN0YXJ0Um93LCBzdGFydENvbHVtbiwgZW5kUm93LCBlbmRDb2x1bW4pIHsKICAgICAgICB0aGlzLnN0YXJ0ID0gewogICAgICAgICAgICByb3c6IHN0YXJ0Um93LAogICAgICAgICAgICBjb2x1bW46IHN0YXJ0Q29sdW1uCiAgICAgICAgfTsKICAgICAgICB0aGlzLmVuZCA9IHsKICAgICAgICAgICAgcm93OiBlbmRSb3csCiAgICAgICAgICAgIGNvbHVtbjogZW5kQ29sdW1uCiAgICAgICAgfTsKICAgIH0KICAgIFJhbmdlLnByb3RvdHlwZS5pc0VxdWFsID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuc3RhcnQucm93ID09PSByYW5nZS5zdGFydC5yb3cgJiYKICAgICAgICAgICAgdGhpcy5lbmQucm93ID09PSByYW5nZS5lbmQucm93ICYmCiAgICAgICAgICAgIHRoaXMuc3RhcnQuY29sdW1uID09PSByYW5nZS5zdGFydC5jb2x1bW4gJiYKICAgICAgICAgICAgdGhpcy5lbmQuY29sdW1uID09PSByYW5nZS5lbmQuY29sdW1uOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS50b1N0cmluZyA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gKCJSYW5nZTogWyIgKyB0aGlzLnN0YXJ0LnJvdyArICIvIiArIHRoaXMuc3RhcnQuY29sdW1uICsKICAgICAgICAgICAgIl0gLT4gWyIgKyB0aGlzLmVuZC5yb3cgKyAiLyIgKyB0aGlzLmVuZC5jb2x1bW4gKyAiXSIpOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jb250YWlucyA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pID09IDA7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmVSYW5nZSA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAsIGVuZCA9IHJhbmdlLmVuZCwgc3RhcnQgPSByYW5nZS5zdGFydDsKICAgICAgICBjbXAgPSB0aGlzLmNvbXBhcmUoZW5kLnJvdywgZW5kLmNvbHVtbik7CiAgICAgICAgaWYgKGNtcCA9PSAxKSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAoY21wID09IDApIHsKICAgICAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoY21wID09IC0xKSB7CiAgICAgICAgICAgIHJldHVybiAtMjsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gLTEpIHsKICAgICAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDQyOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmVQb2ludCA9IGZ1bmN0aW9uIChwKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShwLnJvdywgcC5jb2x1bW4pOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jb250YWluc1JhbmdlID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZVBvaW50KHJhbmdlLnN0YXJ0KSA9PSAwICYmIHRoaXMuY29tcGFyZVBvaW50KHJhbmdlLmVuZCkgPT0gMDsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuaW50ZXJzZWN0cyA9IGZ1bmN0aW9uIChyYW5nZSkgewogICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmVSYW5nZShyYW5nZSk7CiAgICAgICAgcmV0dXJuIChjbXAgPT0gLTEgfHwgY21wID09IDAgfHwgY21wID09IDEpOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5pc0VuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW47CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmlzU3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4gdGhpcy5zdGFydC5yb3cgPT0gcm93ICYmIHRoaXMuc3RhcnQuY29sdW1uID09IGNvbHVtbjsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuc2V0U3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IHJvdy5jb2x1bW47CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93LnJvdzsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93OwogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB9CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLnNldEVuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0eXBlb2Ygcm93ID09ICJvYmplY3QiKSB7CiAgICAgICAgICAgIHRoaXMuZW5kLmNvbHVtbiA9IHJvdy5jb2x1bW47CiAgICAgICAgICAgIHRoaXMuZW5kLnJvdyA9IHJvdy5yb3c7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICB0aGlzLmVuZC5yb3cgPSByb3c7CiAgICAgICAgICAgIHRoaXMuZW5kLmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB9CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmluc2lkZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pID09IDApIHsKICAgICAgICAgICAgaWYgKHRoaXMuaXNFbmQocm93LCBjb2x1bW4pIHx8IHRoaXMuaXNTdGFydChyb3csIGNvbHVtbikpIHsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiBmYWxzZTsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuaW5zaWRlU3RhcnQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzRW5kKHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5pbnNpZGVFbmQgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodGhpcy5jb21wYXJlKHJvdywgY29sdW1uKSA9PSAwKSB7CiAgICAgICAgICAgIGlmICh0aGlzLmlzU3RhcnQocm93LCBjb2x1bW4pKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNvbXBhcmUgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAoIXRoaXMuaXNNdWx0aUxpbmUoKSkgewogICAgICAgICAgICBpZiAocm93ID09PSB0aGlzLnN0YXJ0LnJvdykgewogICAgICAgICAgICAgICAgcmV0dXJuIGNvbHVtbiA8IHRoaXMuc3RhcnQuY29sdW1uID8gLTEgOiAoY29sdW1uID4gdGhpcy5lbmQuY29sdW1uID8gMSA6IDApOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmIChyb3cgPCB0aGlzLnN0YXJ0LnJvdykKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIGlmIChyb3cgPiB0aGlzLmVuZC5yb3cpCiAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgIGlmICh0aGlzLnN0YXJ0LnJvdyA9PT0gcm93KQogICAgICAgICAgICByZXR1cm4gY29sdW1uID49IHRoaXMuc3RhcnQuY29sdW1uID8gMCA6IC0xOwogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT09IHJvdykKICAgICAgICAgICAgcmV0dXJuIGNvbHVtbiA8PSB0aGlzLmVuZC5jb2x1bW4gPyAwIDogMTsKICAgICAgICByZXR1cm4gMDsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuY29tcGFyZVN0YXJ0ID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7CiAgICAgICAgfQogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jb21wYXJlRW5kID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA9PSByb3cgJiYgdGhpcy5lbmQuY29sdW1uID09IGNvbHVtbikgewogICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pOwogICAgICAgIH0KICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuY29tcGFyZUluc2lkZSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHRoaXMuc3RhcnQucm93ID09IHJvdyAmJiB0aGlzLnN0YXJ0LmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIC0xOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7CiAgICAgICAgfQogICAgfTsKICAgIFJhbmdlLnByb3RvdHlwZS5jbGlwUm93cyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPiBsYXN0Um93KQogICAgICAgICAgICB2YXIgZW5kID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLmVuZC5yb3cgPCBmaXJzdFJvdykKICAgICAgICAgICAgdmFyIGVuZCA9IHsgcm93OiBmaXJzdFJvdywgY29sdW1uOiAwIH07CiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID4gbGFzdFJvdykKICAgICAgICAgICAgdmFyIHN0YXJ0ID0geyByb3c6IGxhc3RSb3cgKyAxLCBjb2x1bW46IDAgfTsKICAgICAgICBlbHNlIGlmICh0aGlzLnN0YXJ0LnJvdyA8IGZpcnN0Um93KQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7IHJvdzogZmlyc3RSb3csIGNvbHVtbjogMCB9OwogICAgICAgIHJldHVybiBSYW5nZS5mcm9tUG9pbnRzKHN0YXJ0IHx8IHRoaXMuc3RhcnQsIGVuZCB8fCB0aGlzLmVuZCk7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmV4dGVuZCA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pOwogICAgICAgIGlmIChjbXAgPT0gMCkKICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgZWxzZSBpZiAoY21wID09IC0xKQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7IHJvdzogcm93LCBjb2x1bW46IGNvbHVtbiB9OwogICAgICAgIGVsc2UKICAgICAgICAgICAgdmFyIGVuZCA9IHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH07CiAgICAgICAgcmV0dXJuIFJhbmdlLmZyb21Qb2ludHMoc3RhcnQgfHwgdGhpcy5zdGFydCwgZW5kIHx8IHRoaXMuZW5kKTsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuaXNFbXB0eSA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gKHRoaXMuc3RhcnQucm93ID09PSB0aGlzLmVuZC5yb3cgJiYgdGhpcy5zdGFydC5jb2x1bW4gPT09IHRoaXMuZW5kLmNvbHVtbik7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmlzTXVsdGlMaW5lID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiAodGhpcy5zdGFydC5yb3cgIT09IHRoaXMuZW5kLnJvdyk7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLmNsb25lID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiBSYW5nZS5mcm9tUG9pbnRzKHRoaXMuc3RhcnQsIHRoaXMuZW5kKTsKICAgIH07CiAgICBSYW5nZS5wcm90b3R5cGUuY29sbGFwc2VSb3dzID0gZnVuY3Rpb24gKCkgewogICAgICAgIGlmICh0aGlzLmVuZC5jb2x1bW4gPT0gMCkKICAgICAgICAgICAgcmV0dXJuIG5ldyBSYW5nZSh0aGlzLnN0YXJ0LnJvdywgMCwgTWF0aC5tYXgodGhpcy5zdGFydC5yb3csIHRoaXMuZW5kLnJvdyAtIDEpLCAwKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIHJldHVybiBuZXcgUmFuZ2UodGhpcy5zdGFydC5yb3csIDAsIHRoaXMuZW5kLnJvdywgMCk7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLnRvU2NyZWVuUmFuZ2UgPSBmdW5jdGlvbiAoc2Vzc2lvbikgewogICAgICAgIHZhciBzY3JlZW5Qb3NTdGFydCA9IHNlc3Npb24uZG9jdW1lbnRUb1NjcmVlblBvc2l0aW9uKHRoaXMuc3RhcnQpOwogICAgICAgIHZhciBzY3JlZW5Qb3NFbmQgPSBzZXNzaW9uLmRvY3VtZW50VG9TY3JlZW5Qb3NpdGlvbih0aGlzLmVuZCk7CiAgICAgICAgcmV0dXJuIG5ldyBSYW5nZShzY3JlZW5Qb3NTdGFydC5yb3csIHNjcmVlblBvc1N0YXJ0LmNvbHVtbiwgc2NyZWVuUG9zRW5kLnJvdywgc2NyZWVuUG9zRW5kLmNvbHVtbik7CiAgICB9OwogICAgUmFuZ2UucHJvdG90eXBlLm1vdmVCeSA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHRoaXMuc3RhcnQucm93ICs9IHJvdzsKICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiArPSBjb2x1bW47CiAgICAgICAgdGhpcy5lbmQucm93ICs9IHJvdzsKICAgICAgICB0aGlzLmVuZC5jb2x1bW4gKz0gY29sdW1uOwogICAgfTsKICAgIHJldHVybiBSYW5nZTsKfSgpKTsKUmFuZ2UuZnJvbVBvaW50cyA9IGZ1bmN0aW9uIChzdGFydCwgZW5kKSB7CiAgICByZXR1cm4gbmV3IFJhbmdlKHN0YXJ0LnJvdywgc3RhcnQuY29sdW1uLCBlbmQucm93LCBlbmQuY29sdW1uKTsKfTsKUmFuZ2UuY29tcGFyZVBvaW50cyA9IGZ1bmN0aW9uIChwMSwgcDIpIHsKICAgIHJldHVybiBwMS5yb3cgLSBwMi5yb3cgfHwgcDEuY29sdW1uIC0gcDIuY29sdW1uOwp9OwpleHBvcnRzLlJhbmdlID0gUmFuZ2U7Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9hbmNob3IiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpeyJ1c2Ugc3RyaWN0IjsKdmFyIG9vcCA9IHJlcXVpcmUoIi4vbGliL29vcCIpOwp2YXIgRXZlbnRFbWl0dGVyID0gcmVxdWlyZSgiLi9saWIvZXZlbnRfZW1pdHRlciIpLkV2ZW50RW1pdHRlcjsKdmFyIEFuY2hvciA9IC8qKiBAY2xhc3MgKi8gKGZ1bmN0aW9uICgpIHsKICAgIGZ1bmN0aW9uIEFuY2hvcihkb2MsIHJvdywgY29sdW1uKSB7CiAgICAgICAgdGhpcy4kb25DaGFuZ2UgPSB0aGlzLm9uQ2hhbmdlLmJpbmQodGhpcyk7CiAgICAgICAgdGhpcy5hdHRhY2goZG9jKTsKICAgICAgICBpZiAodHlwZW9mIHJvdyAhPSAibnVtYmVyIikKICAgICAgICAgICAgdGhpcy5zZXRQb3NpdGlvbihyb3cucm93LCByb3cuY29sdW1uKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIHRoaXMuc2V0UG9zaXRpb24ocm93LCBjb2x1bW4pOwogICAgfQogICAgQW5jaG9yLnByb3RvdHlwZS5nZXRQb3NpdGlvbiA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGhpcy4kY2xpcFBvc2l0aW9uVG9Eb2N1bWVudCh0aGlzLnJvdywgdGhpcy5jb2x1bW4pOwogICAgfTsKICAgIEFuY2hvci5wcm90b3R5cGUuZ2V0RG9jdW1lbnQgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuZG9jdW1lbnQ7CiAgICB9OwogICAgQW5jaG9yLnByb3RvdHlwZS5vbkNoYW5nZSA9IGZ1bmN0aW9uIChkZWx0YSkgewogICAgICAgIGlmIChkZWx0YS5zdGFydC5yb3cgPT0gZGVsdGEuZW5kLnJvdyAmJiBkZWx0YS5zdGFydC5yb3cgIT0gdGhpcy5yb3cpCiAgICAgICAgICAgIHJldHVybjsKICAgICAgICBpZiAoZGVsdGEuc3RhcnQucm93ID4gdGhpcy5yb3cpCiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB2YXIgcG9pbnQgPSAkZ2V0VHJhbnNmb3JtZWRQb2ludChkZWx0YSwgeyByb3c6IHRoaXMucm93LCBjb2x1bW46IHRoaXMuY29sdW1uIH0sIHRoaXMuJGluc2VydFJpZ2h0KTsKICAgICAgICB0aGlzLnNldFBvc2l0aW9uKHBvaW50LnJvdywgcG9pbnQuY29sdW1uLCB0cnVlKTsKICAgIH07CiAgICBBbmNob3IucHJvdG90eXBlLnNldFBvc2l0aW9uID0gZnVuY3Rpb24gKHJvdywgY29sdW1uLCBub0NsaXApIHsKICAgICAgICB2YXIgcG9zOwogICAgICAgIGlmIChub0NsaXApIHsKICAgICAgICAgICAgcG9zID0gewogICAgICAgICAgICAgICAgcm93OiByb3csCiAgICAgICAgICAgICAgICBjb2x1bW46IGNvbHVtbgogICAgICAgICAgICB9OwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcG9zID0gdGhpcy4kY2xpcFBvc2l0aW9uVG9Eb2N1bWVudChyb3csIGNvbHVtbik7CiAgICAgICAgfQogICAgICAgIGlmICh0aGlzLnJvdyA9PSBwb3Mucm93ICYmIHRoaXMuY29sdW1uID09IHBvcy5jb2x1bW4pCiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB2YXIgb2xkID0gewogICAgICAgICAgICByb3c6IHRoaXMucm93LAogICAgICAgICAgICBjb2x1bW46IHRoaXMuY29sdW1uCiAgICAgICAgfTsKICAgICAgICB0aGlzLnJvdyA9IHBvcy5yb3c7CiAgICAgICAgdGhpcy5jb2x1bW4gPSBwb3MuY29sdW1uOwogICAgICAgIHRoaXMuX3NpZ25hbCgiY2hhbmdlIiwgewogICAgICAgICAgICBvbGQ6IG9sZCwKICAgICAgICAgICAgdmFsdWU6IHBvcwogICAgICAgIH0pOwogICAgfTsKICAgIEFuY2hvci5wcm90b3R5cGUuZGV0YWNoID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRoaXMuZG9jdW1lbnQub2ZmKCJjaGFuZ2UiLCB0aGlzLiRvbkNoYW5nZSk7CiAgICB9OwogICAgQW5jaG9yLnByb3RvdHlwZS5hdHRhY2ggPSBmdW5jdGlvbiAoZG9jKSB7CiAgICAgICAgdGhpcy5kb2N1bWVudCA9IGRvYyB8fCB0aGlzLmRvY3VtZW50OwogICAgICAgIHRoaXMuZG9jdW1lbnQub24oImNoYW5nZSIsIHRoaXMuJG9uQ2hhbmdlKTsKICAgIH07CiAgICBBbmNob3IucHJvdG90eXBlLiRjbGlwUG9zaXRpb25Ub0RvY3VtZW50ID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgdmFyIHBvcyA9IHt9OwogICAgICAgIGlmIChyb3cgPj0gdGhpcy5kb2N1bWVudC5nZXRMZW5ndGgoKSkgewogICAgICAgICAgICBwb3Mucm93ID0gTWF0aC5tYXgoMCwgdGhpcy5kb2N1bWVudC5nZXRMZW5ndGgoKSAtIDEpOwogICAgICAgICAgICBwb3MuY29sdW1uID0gdGhpcy5kb2N1bWVudC5nZXRMaW5lKHBvcy5yb3cpLmxlbmd0aDsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAocm93IDwgMCkgewogICAgICAgICAgICBwb3Mucm93ID0gMDsKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IDA7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBwb3Mucm93ID0gcm93OwogICAgICAgICAgICBwb3MuY29sdW1uID0gTWF0aC5taW4odGhpcy5kb2N1bWVudC5nZXRMaW5lKHBvcy5yb3cpLmxlbmd0aCwgTWF0aC5tYXgoMCwgY29sdW1uKSk7CiAgICAgICAgfQogICAgICAgIGlmIChjb2x1bW4gPCAwKQogICAgICAgICAgICBwb3MuY29sdW1uID0gMDsKICAgICAgICByZXR1cm4gcG9zOwogICAgfTsKICAgIHJldHVybiBBbmNob3I7Cn0oKSk7CkFuY2hvci5wcm90b3R5cGUuJGluc2VydFJpZ2h0ID0gZmFsc2U7Cm9vcC5pbXBsZW1lbnQoQW5jaG9yLnByb3RvdHlwZSwgRXZlbnRFbWl0dGVyKTsKZnVuY3Rpb24gJHBvaW50c0luT3JkZXIocG9pbnQxLCBwb2ludDIsIGVxdWFsUG9pbnRzSW5PcmRlcikgewogICAgdmFyIGJDb2xJc0FmdGVyID0gZXF1YWxQb2ludHNJbk9yZGVyID8gcG9pbnQxLmNvbHVtbiA8PSBwb2ludDIuY29sdW1uIDogcG9pbnQxLmNvbHVtbiA8IHBvaW50Mi5jb2x1bW47CiAgICByZXR1cm4gKHBvaW50MS5yb3cgPCBwb2ludDIucm93KSB8fCAocG9pbnQxLnJvdyA9PSBwb2ludDIucm93ICYmIGJDb2xJc0FmdGVyKTsKfQpmdW5jdGlvbiAkZ2V0VHJhbnNmb3JtZWRQb2ludChkZWx0YSwgcG9pbnQsIG1vdmVJZkVxdWFsKSB7CiAgICB2YXIgZGVsdGFJc0luc2VydCA9IGRlbHRhLmFjdGlvbiA9PSAiaW5zZXJ0IjsKICAgIHZhciBkZWx0YVJvd1NoaWZ0ID0gKGRlbHRhSXNJbnNlcnQgPyAxIDogLTEpICogKGRlbHRhLmVuZC5yb3cgLSBkZWx0YS5zdGFydC5yb3cpOwogICAgdmFyIGRlbHRhQ29sU2hpZnQgPSAoZGVsdGFJc0luc2VydCA/IDEgOiAtMSkgKiAoZGVsdGEuZW5kLmNvbHVtbiAtIGRlbHRhLnN0YXJ0LmNvbHVtbik7CiAgICB2YXIgZGVsdGFTdGFydCA9IGRlbHRhLnN0YXJ0OwogICAgdmFyIGRlbHRhRW5kID0gZGVsdGFJc0luc2VydCA/IGRlbHRhU3RhcnQgOiBkZWx0YS5lbmQ7IC8vIENvbGxhcHNlIGluc2VydCByYW5nZS4KICAgIGlmICgkcG9pbnRzSW5PcmRlcihwb2ludCwgZGVsdGFTdGFydCwgbW92ZUlmRXF1YWwpKSB7CiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgcm93OiBwb2ludC5yb3csCiAgICAgICAgICAgIGNvbHVtbjogcG9pbnQuY29sdW1uCiAgICAgICAgfTsKICAgIH0KICAgIGlmICgkcG9pbnRzSW5PcmRlcihkZWx0YUVuZCwgcG9pbnQsICFtb3ZlSWZFcXVhbCkpIHsKICAgICAgICByZXR1cm4gewogICAgICAgICAgICByb3c6IHBvaW50LnJvdyArIGRlbHRhUm93U2hpZnQsCiAgICAgICAgICAgIGNvbHVtbjogcG9pbnQuY29sdW1uICsgKHBvaW50LnJvdyA9PSBkZWx0YUVuZC5yb3cgPyBkZWx0YUNvbFNoaWZ0IDogMCkKICAgICAgICB9OwogICAgfQogICAgcmV0dXJuIHsKICAgICAgICByb3c6IGRlbHRhU3RhcnQucm93LAogICAgICAgIGNvbHVtbjogZGVsdGFTdGFydC5jb2x1bW4KICAgIH07Cn0KZXhwb3J0cy5BbmNob3IgPSBBbmNob3I7Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9kb2N1bWVudCIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSl7InVzZSBzdHJpY3QiOwp2YXIgb29wID0gcmVxdWlyZSgiLi9saWIvb29wIik7CnZhciBhcHBseURlbHRhID0gcmVxdWlyZSgiLi9hcHBseV9kZWx0YSIpLmFwcGx5RGVsdGE7CnZhciBFdmVudEVtaXR0ZXIgPSByZXF1aXJlKCIuL2xpYi9ldmVudF9lbWl0dGVyIikuRXZlbnRFbWl0dGVyOwp2YXIgUmFuZ2UgPSByZXF1aXJlKCIuL3JhbmdlIikuUmFuZ2U7CnZhciBBbmNob3IgPSByZXF1aXJlKCIuL2FuY2hvciIpLkFuY2hvcjsKdmFyIERvY3VtZW50ID0gLyoqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKCkgewogICAgZnVuY3Rpb24gRG9jdW1lbnQodGV4dE9yTGluZXMpIHsKICAgICAgICB0aGlzLiRsaW5lcyA9IFsiIl07CiAgICAgICAgaWYgKHRleHRPckxpbmVzLmxlbmd0aCA9PT0gMCkgewogICAgICAgICAgICB0aGlzLiRsaW5lcyA9IFsiIl07CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKEFycmF5LmlzQXJyYXkodGV4dE9yTGluZXMpKSB7CiAgICAgICAgICAgIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMoeyByb3c6IDAsIGNvbHVtbjogMCB9LCB0ZXh0T3JMaW5lcyk7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICB0aGlzLmluc2VydCh7IHJvdzogMCwgY29sdW1uOiAwIH0sIHRleHRPckxpbmVzKTsKICAgICAgICB9CiAgICB9CiAgICBEb2N1bWVudC5wcm90b3R5cGUuc2V0VmFsdWUgPSBmdW5jdGlvbiAodGV4dCkgewogICAgICAgIHZhciBsZW4gPSB0aGlzLmdldExlbmd0aCgpIC0gMTsKICAgICAgICB0aGlzLnJlbW92ZShuZXcgUmFuZ2UoMCwgMCwgbGVuLCB0aGlzLmdldExpbmUobGVuKS5sZW5ndGgpKTsKICAgICAgICB0aGlzLmluc2VydCh7IHJvdzogMCwgY29sdW1uOiAwIH0sIHRleHQgfHwgIiIpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRWYWx1ZSA9IGZ1bmN0aW9uICgpIHsKICAgICAgICByZXR1cm4gdGhpcy5nZXRBbGxMaW5lcygpLmpvaW4odGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyKCkpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5jcmVhdGVBbmNob3IgPSBmdW5jdGlvbiAocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4gbmV3IEFuY2hvcih0aGlzLCByb3csIGNvbHVtbik7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLiRkZXRlY3ROZXdMaW5lID0gZnVuY3Rpb24gKHRleHQpIHsKICAgICAgICB2YXIgbWF0Y2ggPSB0ZXh0Lm1hdGNoKC9eLio/KFxyXG58XHJ8XG4pL20pOwogICAgICAgIHRoaXMuJGF1dG9OZXdMaW5lID0gbWF0Y2ggPyBtYXRjaFsxXSA6ICJcbiI7CiAgICAgICAgdGhpcy5fc2lnbmFsKCJjaGFuZ2VOZXdMaW5lTW9kZSIpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXROZXdMaW5lQ2hhcmFjdGVyID0gZnVuY3Rpb24gKCkgewogICAgICAgIHN3aXRjaCAodGhpcy4kbmV3TGluZU1vZGUpIHsKICAgICAgICAgICAgY2FzZSAid2luZG93cyI6CiAgICAgICAgICAgICAgICByZXR1cm4gIlxyXG4iOwogICAgICAgICAgICBjYXNlICJ1bml4IjoKICAgICAgICAgICAgICAgIHJldHVybiAiXG4iOwogICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuJGF1dG9OZXdMaW5lIHx8ICJcbiI7CiAgICAgICAgfQogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5zZXROZXdMaW5lTW9kZSA9IGZ1bmN0aW9uIChuZXdMaW5lTW9kZSkgewogICAgICAgIGlmICh0aGlzLiRuZXdMaW5lTW9kZSA9PT0gbmV3TGluZU1vZGUpCiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB0aGlzLiRuZXdMaW5lTW9kZSA9IG5ld0xpbmVNb2RlOwogICAgICAgIHRoaXMuX3NpZ25hbCgiY2hhbmdlTmV3TGluZU1vZGUiKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuZ2V0TmV3TGluZU1vZGUgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJG5ld0xpbmVNb2RlOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5pc05ld0xpbmUgPSBmdW5jdGlvbiAodGV4dCkgewogICAgICAgIHJldHVybiAodGV4dCA9PSAiXHJcbiIgfHwgdGV4dCA9PSAiXHIiIHx8IHRleHQgPT0gIlxuIik7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmdldExpbmUgPSBmdW5jdGlvbiAocm93KSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJGxpbmVzW3Jvd10gfHwgIiI7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmdldExpbmVzID0gZnVuY3Rpb24gKGZpcnN0Um93LCBsYXN0Um93KSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJGxpbmVzLnNsaWNlKGZpcnN0Um93LCBsYXN0Um93ICsgMSk7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmdldEFsbExpbmVzID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aGlzLmdldExpbmVzKDAsIHRoaXMuZ2V0TGVuZ3RoKCkpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5nZXRMZW5ndGggPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJGxpbmVzLmxlbmd0aDsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuZ2V0VGV4dFJhbmdlID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuZ2V0TGluZXNGb3JSYW5nZShyYW5nZSkuam9pbih0aGlzLmdldE5ld0xpbmVDaGFyYWN0ZXIoKSk7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmdldExpbmVzRm9yUmFuZ2UgPSBmdW5jdGlvbiAocmFuZ2UpIHsKICAgICAgICB2YXIgbGluZXM7CiAgICAgICAgaWYgKHJhbmdlLnN0YXJ0LnJvdyA9PT0gcmFuZ2UuZW5kLnJvdykgewogICAgICAgICAgICBsaW5lcyA9IFt0aGlzLmdldExpbmUocmFuZ2Uuc3RhcnQucm93KS5zdWJzdHJpbmcocmFuZ2Uuc3RhcnQuY29sdW1uLCByYW5nZS5lbmQuY29sdW1uKV07CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBsaW5lcyA9IHRoaXMuZ2V0TGluZXMocmFuZ2Uuc3RhcnQucm93LCByYW5nZS5lbmQucm93KTsKICAgICAgICAgICAgbGluZXNbMF0gPSAobGluZXNbMF0gfHwgIiIpLnN1YnN0cmluZyhyYW5nZS5zdGFydC5jb2x1bW4pOwogICAgICAgICAgICB2YXIgbCA9IGxpbmVzLmxlbmd0aCAtIDE7CiAgICAgICAgICAgIGlmIChyYW5nZS5lbmQucm93IC0gcmFuZ2Uuc3RhcnQucm93ID09IGwpCiAgICAgICAgICAgICAgICBsaW5lc1tsXSA9IGxpbmVzW2xdLnN1YnN0cmluZygwLCByYW5nZS5lbmQuY29sdW1uKTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGxpbmVzOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5pbnNlcnRMaW5lcyA9IGZ1bmN0aW9uIChyb3csIGxpbmVzKSB7CiAgICAgICAgY29uc29sZS53YXJuKCJVc2Ugb2YgZG9jdW1lbnQuaW5zZXJ0TGluZXMgaXMgZGVwcmVjYXRlZC4gVXNlIHRoZSBpbnNlcnRGdWxsTGluZXMgbWV0aG9kIGluc3RlYWQuIik7CiAgICAgICAgcmV0dXJuIHRoaXMuaW5zZXJ0RnVsbExpbmVzKHJvdywgbGluZXMpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5yZW1vdmVMaW5lcyA9IGZ1bmN0aW9uIChmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIGNvbnNvbGUud2FybigiVXNlIG9mIGRvY3VtZW50LnJlbW92ZUxpbmVzIGlzIGRlcHJlY2F0ZWQuIFVzZSB0aGUgcmVtb3ZlRnVsbExpbmVzIG1ldGhvZCBpbnN0ZWFkLiIpOwogICAgICAgIHJldHVybiB0aGlzLnJlbW92ZUZ1bGxMaW5lcyhmaXJzdFJvdywgbGFzdFJvdyk7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmluc2VydE5ld0xpbmUgPSBmdW5jdGlvbiAocG9zaXRpb24pIHsKICAgICAgICBjb25zb2xlLndhcm4oIlVzZSBvZiBkb2N1bWVudC5pbnNlcnROZXdMaW5lIGlzIGRlcHJlY2F0ZWQuIFVzZSBpbnNlcnRNZXJnZWRMaW5lcyhwb3NpdGlvbiwgWycnLCAnJ10pIGluc3RlYWQuIik7CiAgICAgICAgcmV0dXJuIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIFsiIiwgIiJdKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaW5zZXJ0ID0gZnVuY3Rpb24gKHBvc2l0aW9uLCB0ZXh0KSB7CiAgICAgICAgaWYgKHRoaXMuZ2V0TGVuZ3RoKCkgPD0gMSkKICAgICAgICAgICAgdGhpcy4kZGV0ZWN0TmV3TGluZSh0ZXh0KTsKICAgICAgICByZXR1cm4gdGhpcy5pbnNlcnRNZXJnZWRMaW5lcyhwb3NpdGlvbiwgdGhpcy4kc3BsaXQodGV4dCkpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5pbnNlcnRJbkxpbmUgPSBmdW5jdGlvbiAocG9zaXRpb24sIHRleHQpIHsKICAgICAgICB2YXIgc3RhcnQgPSB0aGlzLmNsaXBwZWRQb3MocG9zaXRpb24ucm93LCBwb3NpdGlvbi5jb2x1bW4pOwogICAgICAgIHZhciBlbmQgPSB0aGlzLnBvcyhwb3NpdGlvbi5yb3csIHBvc2l0aW9uLmNvbHVtbiArIHRleHQubGVuZ3RoKTsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgICAgIGVuZDogZW5kLAogICAgICAgICAgICBhY3Rpb246ICJpbnNlcnQiLAogICAgICAgICAgICBsaW5lczogW3RleHRdCiAgICAgICAgfSwgdHJ1ZSk7CiAgICAgICAgcmV0dXJuIHRoaXMuY2xvbmVQb3MoZW5kKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuY2xpcHBlZFBvcyA9IGZ1bmN0aW9uIChyb3csIGNvbHVtbikgewogICAgICAgIHZhciBsZW5ndGggPSB0aGlzLmdldExlbmd0aCgpOwogICAgICAgIGlmIChyb3cgPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICByb3cgPSBsZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA8IDApIHsKICAgICAgICAgICAgcm93ID0gMDsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAocm93ID49IGxlbmd0aCkgewogICAgICAgICAgICByb3cgPSBsZW5ndGggLSAxOwogICAgICAgICAgICBjb2x1bW4gPSB1bmRlZmluZWQ7CiAgICAgICAgfQogICAgICAgIHZhciBsaW5lID0gdGhpcy5nZXRMaW5lKHJvdyk7CiAgICAgICAgaWYgKGNvbHVtbiA9PSB1bmRlZmluZWQpCiAgICAgICAgICAgIGNvbHVtbiA9IGxpbmUubGVuZ3RoOwogICAgICAgIGNvbHVtbiA9IE1hdGgubWluKE1hdGgubWF4KGNvbHVtbiwgMCksIGxpbmUubGVuZ3RoKTsKICAgICAgICByZXR1cm4geyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuY2xvbmVQb3MgPSBmdW5jdGlvbiAocG9zKSB7CiAgICAgICAgcmV0dXJuIHsgcm93OiBwb3Mucm93LCBjb2x1bW46IHBvcy5jb2x1bW4gfTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucG9zID0gZnVuY3Rpb24gKHJvdywgY29sdW1uKSB7CiAgICAgICAgcmV0dXJuIHsgcm93OiByb3csIGNvbHVtbjogY29sdW1uIH07CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLiRjbGlwUG9zaXRpb24gPSBmdW5jdGlvbiAocG9zaXRpb24pIHsKICAgICAgICB2YXIgbGVuZ3RoID0gdGhpcy5nZXRMZW5ndGgoKTsKICAgICAgICBpZiAocG9zaXRpb24ucm93ID49IGxlbmd0aCkgewogICAgICAgICAgICBwb3NpdGlvbi5yb3cgPSBNYXRoLm1heCgwLCBsZW5ndGggLSAxKTsKICAgICAgICAgICAgcG9zaXRpb24uY29sdW1uID0gdGhpcy5nZXRMaW5lKGxlbmd0aCAtIDEpLmxlbmd0aDsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIHBvc2l0aW9uLnJvdyA9IE1hdGgubWF4KDAsIHBvc2l0aW9uLnJvdyk7CiAgICAgICAgICAgIHBvc2l0aW9uLmNvbHVtbiA9IE1hdGgubWluKE1hdGgubWF4KHBvc2l0aW9uLmNvbHVtbiwgMCksIHRoaXMuZ2V0TGluZShwb3NpdGlvbi5yb3cpLmxlbmd0aCk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBwb3NpdGlvbjsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuaW5zZXJ0RnVsbExpbmVzID0gZnVuY3Rpb24gKHJvdywgbGluZXMpIHsKICAgICAgICByb3cgPSBNYXRoLm1pbihNYXRoLm1heChyb3csIDApLCB0aGlzLmdldExlbmd0aCgpKTsKICAgICAgICB2YXIgY29sdW1uID0gMDsKICAgICAgICBpZiAocm93IDwgdGhpcy5nZXRMZW5ndGgoKSkgewogICAgICAgICAgICBsaW5lcyA9IGxpbmVzLmNvbmNhdChbIiJdKTsKICAgICAgICAgICAgY29sdW1uID0gMDsKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGxpbmVzID0gWyIiXS5jb25jYXQobGluZXMpOwogICAgICAgICAgICByb3ctLTsKICAgICAgICAgICAgY29sdW1uID0gdGhpcy4kbGluZXNbcm93XS5sZW5ndGg7CiAgICAgICAgfQogICAgICAgIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMoeyByb3c6IHJvdywgY29sdW1uOiBjb2x1bW4gfSwgbGluZXMpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5pbnNlcnRNZXJnZWRMaW5lcyA9IGZ1bmN0aW9uIChwb3NpdGlvbiwgbGluZXMpIHsKICAgICAgICB2YXIgc3RhcnQgPSB0aGlzLmNsaXBwZWRQb3MocG9zaXRpb24ucm93LCBwb3NpdGlvbi5jb2x1bW4pOwogICAgICAgIHZhciBlbmQgPSB7CiAgICAgICAgICAgIHJvdzogc3RhcnQucm93ICsgbGluZXMubGVuZ3RoIC0gMSwKICAgICAgICAgICAgY29sdW1uOiAobGluZXMubGVuZ3RoID09IDEgPyBzdGFydC5jb2x1bW4gOiAwKSArIGxpbmVzW2xpbmVzLmxlbmd0aCAtIDFdLmxlbmd0aAogICAgICAgIH07CiAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LAogICAgICAgICAgICBlbmQ6IGVuZCwKICAgICAgICAgICAgYWN0aW9uOiAiaW5zZXJ0IiwKICAgICAgICAgICAgbGluZXM6IGxpbmVzCiAgICAgICAgfSk7CiAgICAgICAgcmV0dXJuIHRoaXMuY2xvbmVQb3MoZW5kKTsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmVtb3ZlID0gZnVuY3Rpb24gKHJhbmdlKSB7CiAgICAgICAgdmFyIHN0YXJ0ID0gdGhpcy5jbGlwcGVkUG9zKHJhbmdlLnN0YXJ0LnJvdywgcmFuZ2Uuc3RhcnQuY29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5jbGlwcGVkUG9zKHJhbmdlLmVuZC5yb3csIHJhbmdlLmVuZC5jb2x1bW4pOwogICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCwKICAgICAgICAgICAgZW5kOiBlbmQsCiAgICAgICAgICAgIGFjdGlvbjogInJlbW92ZSIsCiAgICAgICAgICAgIGxpbmVzOiB0aGlzLmdldExpbmVzRm9yUmFuZ2UoeyBzdGFydDogc3RhcnQsIGVuZDogZW5kIH0pCiAgICAgICAgfSk7CiAgICAgICAgcmV0dXJuIHRoaXMuY2xvbmVQb3Moc3RhcnQpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5yZW1vdmVJbkxpbmUgPSBmdW5jdGlvbiAocm93LCBzdGFydENvbHVtbiwgZW5kQ29sdW1uKSB7CiAgICAgICAgdmFyIHN0YXJ0ID0gdGhpcy5jbGlwcGVkUG9zKHJvdywgc3RhcnRDb2x1bW4pOwogICAgICAgIHZhciBlbmQgPSB0aGlzLmNsaXBwZWRQb3Mocm93LCBlbmRDb2x1bW4pOwogICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCwKICAgICAgICAgICAgZW5kOiBlbmQsCiAgICAgICAgICAgIGFjdGlvbjogInJlbW92ZSIsCiAgICAgICAgICAgIGxpbmVzOiB0aGlzLmdldExpbmVzRm9yUmFuZ2UoeyBzdGFydDogc3RhcnQsIGVuZDogZW5kIH0pCiAgICAgICAgfSwgdHJ1ZSk7CiAgICAgICAgcmV0dXJuIHRoaXMuY2xvbmVQb3Moc3RhcnQpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5yZW1vdmVGdWxsTGluZXMgPSBmdW5jdGlvbiAoZmlyc3RSb3csIGxhc3RSb3cpIHsKICAgICAgICBmaXJzdFJvdyA9IE1hdGgubWluKE1hdGgubWF4KDAsIGZpcnN0Um93KSwgdGhpcy5nZXRMZW5ndGgoKSAtIDEpOwogICAgICAgIGxhc3RSb3cgPSBNYXRoLm1pbihNYXRoLm1heCgwLCBsYXN0Um93KSwgdGhpcy5nZXRMZW5ndGgoKSAtIDEpOwogICAgICAgIHZhciBkZWxldGVGaXJzdE5ld0xpbmUgPSBsYXN0Um93ID09IHRoaXMuZ2V0TGVuZ3RoKCkgLSAxICYmIGZpcnN0Um93ID4gMDsKICAgICAgICB2YXIgZGVsZXRlTGFzdE5ld0xpbmUgPSBsYXN0Um93IDwgdGhpcy5nZXRMZW5ndGgoKSAtIDE7CiAgICAgICAgdmFyIHN0YXJ0Um93ID0gKGRlbGV0ZUZpcnN0TmV3TGluZSA/IGZpcnN0Um93IC0gMSA6IGZpcnN0Um93KTsKICAgICAgICB2YXIgc3RhcnRDb2wgPSAoZGVsZXRlRmlyc3ROZXdMaW5lID8gdGhpcy5nZXRMaW5lKHN0YXJ0Um93KS5sZW5ndGggOiAwKTsKICAgICAgICB2YXIgZW5kUm93ID0gKGRlbGV0ZUxhc3ROZXdMaW5lID8gbGFzdFJvdyArIDEgOiBsYXN0Um93KTsKICAgICAgICB2YXIgZW5kQ29sID0gKGRlbGV0ZUxhc3ROZXdMaW5lID8gMCA6IHRoaXMuZ2V0TGluZShlbmRSb3cpLmxlbmd0aCk7CiAgICAgICAgdmFyIHJhbmdlID0gbmV3IFJhbmdlKHN0YXJ0Um93LCBzdGFydENvbCwgZW5kUm93LCBlbmRDb2wpOwogICAgICAgIHZhciBkZWxldGVkTGluZXMgPSB0aGlzLiRsaW5lcy5zbGljZShmaXJzdFJvdywgbGFzdFJvdyArIDEpOwogICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiByYW5nZS5zdGFydCwKICAgICAgICAgICAgZW5kOiByYW5nZS5lbmQsCiAgICAgICAgICAgIGFjdGlvbjogInJlbW92ZSIsCiAgICAgICAgICAgIGxpbmVzOiB0aGlzLmdldExpbmVzRm9yUmFuZ2UocmFuZ2UpCiAgICAgICAgfSk7CiAgICAgICAgcmV0dXJuIGRlbGV0ZWRMaW5lczsKICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmVtb3ZlTmV3TGluZSA9IGZ1bmN0aW9uIChyb3cpIHsKICAgICAgICBpZiAocm93IDwgdGhpcy5nZXRMZW5ndGgoKSAtIDEgJiYgcm93ID49IDApIHsKICAgICAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgICAgIHN0YXJ0OiB0aGlzLnBvcyhyb3csIHRoaXMuZ2V0TGluZShyb3cpLmxlbmd0aCksCiAgICAgICAgICAgICAgICBlbmQ6IHRoaXMucG9zKHJvdyArIDEsIDApLAogICAgICAgICAgICAgICAgYWN0aW9uOiAicmVtb3ZlIiwKICAgICAgICAgICAgICAgIGxpbmVzOiBbIiIsICIiXQogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnJlcGxhY2UgPSBmdW5jdGlvbiAocmFuZ2UsIHRleHQpIHsKICAgICAgICBpZiAoIShyYW5nZSBpbnN0YW5jZW9mIFJhbmdlKSkKICAgICAgICAgICAgcmFuZ2UgPSBSYW5nZS5mcm9tUG9pbnRzKHJhbmdlLnN0YXJ0LCByYW5nZS5lbmQpOwogICAgICAgIGlmICh0ZXh0Lmxlbmd0aCA9PT0gMCAmJiByYW5nZS5pc0VtcHR5KCkpCiAgICAgICAgICAgIHJldHVybiByYW5nZS5zdGFydDsKICAgICAgICBpZiAodGV4dCA9PSB0aGlzLmdldFRleHRSYW5nZShyYW5nZSkpCiAgICAgICAgICAgIHJldHVybiByYW5nZS5lbmQ7CiAgICAgICAgdGhpcy5yZW1vdmUocmFuZ2UpOwogICAgICAgIHZhciBlbmQ7CiAgICAgICAgaWYgKHRleHQpIHsKICAgICAgICAgICAgZW5kID0gdGhpcy5pbnNlcnQocmFuZ2Uuc3RhcnQsIHRleHQpOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgZW5kID0gcmFuZ2Uuc3RhcnQ7CiAgICAgICAgfQogICAgICAgIHJldHVybiBlbmQ7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmFwcGx5RGVsdGFzID0gZnVuY3Rpb24gKGRlbHRhcykgewogICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZGVsdGFzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIHRoaXMuYXBwbHlEZWx0YShkZWx0YXNbaV0pOwogICAgICAgIH0KICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUucmV2ZXJ0RGVsdGFzID0gZnVuY3Rpb24gKGRlbHRhcykgewogICAgICAgIGZvciAodmFyIGkgPSBkZWx0YXMubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHsKICAgICAgICAgICAgdGhpcy5yZXZlcnREZWx0YShkZWx0YXNbaV0pOwogICAgICAgIH0KICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuYXBwbHlEZWx0YSA9IGZ1bmN0aW9uIChkZWx0YSwgZG9Ob3RWYWxpZGF0ZSkgewogICAgICAgIHZhciBpc0luc2VydCA9IGRlbHRhLmFjdGlvbiA9PSAiaW5zZXJ0IjsKICAgICAgICBpZiAoaXNJbnNlcnQgPyBkZWx0YS5saW5lcy5sZW5ndGggPD0gMSAmJiAhZGVsdGEubGluZXNbMF0KICAgICAgICAgICAgOiAhUmFuZ2UuY29tcGFyZVBvaW50cyhkZWx0YS5zdGFydCwgZGVsdGEuZW5kKSkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIGlmIChpc0luc2VydCAmJiBkZWx0YS5saW5lcy5sZW5ndGggPiAyMDAwMCkgewogICAgICAgICAgICB0aGlzLiRzcGxpdEFuZGFwcGx5TGFyZ2VEZWx0YShkZWx0YSwgMjAwMDApOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgYXBwbHlEZWx0YSh0aGlzLiRsaW5lcywgZGVsdGEsIGRvTm90VmFsaWRhdGUpOwogICAgICAgICAgICB0aGlzLl9zaWduYWwoImNoYW5nZSIsIGRlbHRhKTsKICAgICAgICB9CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLiRzYWZlQXBwbHlEZWx0YSA9IGZ1bmN0aW9uIChkZWx0YSkgewogICAgICAgIHZhciBkb2NMZW5ndGggPSB0aGlzLiRsaW5lcy5sZW5ndGg7CiAgICAgICAgaWYgKGRlbHRhLmFjdGlvbiA9PSAicmVtb3ZlIiAmJiBkZWx0YS5zdGFydC5yb3cgPCBkb2NMZW5ndGggJiYgZGVsdGEuZW5kLnJvdyA8IGRvY0xlbmd0aAogICAgICAgICAgICB8fCBkZWx0YS5hY3Rpb24gPT0gImluc2VydCIgJiYgZGVsdGEuc3RhcnQucm93IDw9IGRvY0xlbmd0aCkgewogICAgICAgICAgICB0aGlzLmFwcGx5RGVsdGEoZGVsdGEpOwogICAgICAgIH0KICAgIH07CiAgICBEb2N1bWVudC5wcm90b3R5cGUuJHNwbGl0QW5kYXBwbHlMYXJnZURlbHRhID0gZnVuY3Rpb24gKGRlbHRhLCBNQVgpIHsKICAgICAgICB2YXIgbGluZXMgPSBkZWx0YS5saW5lczsKICAgICAgICB2YXIgbCA9IGxpbmVzLmxlbmd0aCAtIE1BWCArIDE7CiAgICAgICAgdmFyIHJvdyA9IGRlbHRhLnN0YXJ0LnJvdzsKICAgICAgICB2YXIgY29sdW1uID0gZGVsdGEuc3RhcnQuY29sdW1uOwogICAgICAgIGZvciAodmFyIGZyb20gPSAwLCB0byA9IDA7IGZyb20gPCBsOyBmcm9tID0gdG8pIHsKICAgICAgICAgICAgdG8gKz0gTUFYIC0gMTsKICAgICAgICAgICAgdmFyIGNodW5rID0gbGluZXMuc2xpY2UoZnJvbSwgdG8pOwogICAgICAgICAgICBjaHVuay5wdXNoKCIiKTsKICAgICAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgICAgIHN0YXJ0OiB0aGlzLnBvcyhyb3cgKyBmcm9tLCBjb2x1bW4pLAogICAgICAgICAgICAgICAgZW5kOiB0aGlzLnBvcyhyb3cgKyB0bywgY29sdW1uID0gMCksCiAgICAgICAgICAgICAgICBhY3Rpb246IGRlbHRhLmFjdGlvbiwKICAgICAgICAgICAgICAgIGxpbmVzOiBjaHVuawogICAgICAgICAgICB9LCB0cnVlKTsKICAgICAgICB9CiAgICAgICAgZGVsdGEubGluZXMgPSBsaW5lcy5zbGljZShmcm9tKTsKICAgICAgICBkZWx0YS5zdGFydC5yb3cgPSByb3cgKyBmcm9tOwogICAgICAgIGRlbHRhLnN0YXJ0LmNvbHVtbiA9IGNvbHVtbjsKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoZGVsdGEsIHRydWUpOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS5yZXZlcnREZWx0YSA9IGZ1bmN0aW9uIChkZWx0YSkgewogICAgICAgIHRoaXMuJHNhZmVBcHBseURlbHRhKHsKICAgICAgICAgICAgc3RhcnQ6IHRoaXMuY2xvbmVQb3MoZGVsdGEuc3RhcnQpLAogICAgICAgICAgICBlbmQ6IHRoaXMuY2xvbmVQb3MoZGVsdGEuZW5kKSwKICAgICAgICAgICAgYWN0aW9uOiAoZGVsdGEuYWN0aW9uID09ICJpbnNlcnQiID8gInJlbW92ZSIgOiAiaW5zZXJ0IiksCiAgICAgICAgICAgIGxpbmVzOiBkZWx0YS5saW5lcy5zbGljZSgpCiAgICAgICAgfSk7CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLmluZGV4VG9Qb3NpdGlvbiA9IGZ1bmN0aW9uIChpbmRleCwgc3RhcnRSb3cpIHsKICAgICAgICB2YXIgbGluZXMgPSB0aGlzLiRsaW5lcyB8fCB0aGlzLmdldEFsbExpbmVzKCk7CiAgICAgICAgdmFyIG5ld2xpbmVMZW5ndGggPSB0aGlzLmdldE5ld0xpbmVDaGFyYWN0ZXIoKS5sZW5ndGg7CiAgICAgICAgZm9yICh2YXIgaSA9IHN0YXJ0Um93IHx8IDAsIGwgPSBsaW5lcy5sZW5ndGg7IGkgPCBsOyBpKyspIHsKICAgICAgICAgICAgaW5kZXggLT0gbGluZXNbaV0ubGVuZ3RoICsgbmV3bGluZUxlbmd0aDsKICAgICAgICAgICAgaWYgKGluZGV4IDwgMCkKICAgICAgICAgICAgICAgIHJldHVybiB7IHJvdzogaSwgY29sdW1uOiBpbmRleCArIGxpbmVzW2ldLmxlbmd0aCArIG5ld2xpbmVMZW5ndGggfTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHsgcm93OiBsIC0gMSwgY29sdW1uOiBpbmRleCArIGxpbmVzW2wgLSAxXS5sZW5ndGggKyBuZXdsaW5lTGVuZ3RoIH07CiAgICB9OwogICAgRG9jdW1lbnQucHJvdG90eXBlLnBvc2l0aW9uVG9JbmRleCA9IGZ1bmN0aW9uIChwb3MsIHN0YXJ0Um93KSB7CiAgICAgICAgdmFyIGxpbmVzID0gdGhpcy4kbGluZXMgfHwgdGhpcy5nZXRBbGxMaW5lcygpOwogICAgICAgIHZhciBuZXdsaW5lTGVuZ3RoID0gdGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyKCkubGVuZ3RoOwogICAgICAgIHZhciBpbmRleCA9IDA7CiAgICAgICAgdmFyIHJvdyA9IE1hdGgubWluKHBvcy5yb3csIGxpbmVzLmxlbmd0aCk7CiAgICAgICAgZm9yICh2YXIgaSA9IHN0YXJ0Um93IHx8IDA7IGkgPCByb3c7ICsraSkKICAgICAgICAgICAgaW5kZXggKz0gbGluZXNbaV0ubGVuZ3RoICsgbmV3bGluZUxlbmd0aDsKICAgICAgICByZXR1cm4gaW5kZXggKyBwb3MuY29sdW1uOwogICAgfTsKICAgIERvY3VtZW50LnByb3RvdHlwZS4kc3BsaXQgPSBmdW5jdGlvbiAodGV4dCkgewogICAgICAgIHJldHVybiB0ZXh0LnNwbGl0KC9cclxufFxyfFxuLyk7CiAgICB9OwogICAgcmV0dXJuIERvY3VtZW50Owp9KCkpOwpEb2N1bWVudC5wcm90b3R5cGUuJGF1dG9OZXdMaW5lID0gIiI7CkRvY3VtZW50LnByb3RvdHlwZS4kbmV3TGluZU1vZGUgPSAiYXV0byI7Cm9vcC5pbXBsZW1lbnQoRG9jdW1lbnQucHJvdG90eXBlLCBFdmVudEVtaXR0ZXIpOwpleHBvcnRzLkRvY3VtZW50ID0gRG9jdW1lbnQ7Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9saWIvZGVlcF9jb3B5IixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKXtleHBvcnRzLmRlZXBDb3B5ID0gZnVuY3Rpb24gZGVlcENvcHkob2JqKSB7CiAgICBpZiAodHlwZW9mIG9iaiAhPT0gIm9iamVjdCIgfHwgIW9iaikKICAgICAgICByZXR1cm4gb2JqOwogICAgdmFyIGNvcHk7CiAgICBpZiAoQXJyYXkuaXNBcnJheShvYmopKSB7CiAgICAgICAgY29weSA9IFtdOwogICAgICAgIGZvciAodmFyIGtleSA9IDA7IGtleSA8IG9iai5sZW5ndGg7IGtleSsrKSB7CiAgICAgICAgICAgIGNvcHlba2V5XSA9IGRlZXBDb3B5KG9ialtrZXldKTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGNvcHk7CiAgICB9CiAgICBpZiAoT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKG9iaikgIT09ICJbb2JqZWN0IE9iamVjdF0iKQogICAgICAgIHJldHVybiBvYmo7CiAgICBjb3B5ID0ge307CiAgICBmb3IgKHZhciBrZXkgaW4gb2JqKQogICAgICAgIGNvcHlba2V5XSA9IGRlZXBDb3B5KG9ialtrZXldKTsKICAgIHJldHVybiBjb3B5Owp9OwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbGliL2xhbmciLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpeyJ1c2Ugc3RyaWN0IjsKZXhwb3J0cy5sYXN0ID0gZnVuY3Rpb24gKGEpIHsKICAgIHJldHVybiBhW2EubGVuZ3RoIC0gMV07Cn07CmV4cG9ydHMuc3RyaW5nUmV2ZXJzZSA9IGZ1bmN0aW9uIChzdHJpbmcpIHsKICAgIHJldHVybiBzdHJpbmcuc3BsaXQoIiIpLnJldmVyc2UoKS5qb2luKCIiKTsKfTsKZXhwb3J0cy5zdHJpbmdSZXBlYXQgPSBmdW5jdGlvbiAoc3RyaW5nLCBjb3VudCkgewogICAgdmFyIHJlc3VsdCA9ICcnOwogICAgd2hpbGUgKGNvdW50ID4gMCkgewogICAgICAgIGlmIChjb3VudCAmIDEpCiAgICAgICAgICAgIHJlc3VsdCArPSBzdHJpbmc7CiAgICAgICAgaWYgKGNvdW50ID4+PSAxKQogICAgICAgICAgICBzdHJpbmcgKz0gc3RyaW5nOwogICAgfQogICAgcmV0dXJuIHJlc3VsdDsKfTsKdmFyIHRyaW1CZWdpblJlZ2V4cCA9IC9eXHNccyovOwp2YXIgdHJpbUVuZFJlZ2V4cCA9IC9cc1xzKiQvOwpleHBvcnRzLnN0cmluZ1RyaW1MZWZ0ID0gZnVuY3Rpb24gKHN0cmluZykgewogICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKHRyaW1CZWdpblJlZ2V4cCwgJycpOwp9OwpleHBvcnRzLnN0cmluZ1RyaW1SaWdodCA9IGZ1bmN0aW9uIChzdHJpbmcpIHsKICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSh0cmltRW5kUmVnZXhwLCAnJyk7Cn07CmV4cG9ydHMuY29weU9iamVjdCA9IGZ1bmN0aW9uIChvYmopIHsKICAgIHZhciBjb3B5ID0ge307CiAgICBmb3IgKHZhciBrZXkgaW4gb2JqKSB7CiAgICAgICAgY29weVtrZXldID0gb2JqW2tleV07CiAgICB9CiAgICByZXR1cm4gY29weTsKfTsKZXhwb3J0cy5jb3B5QXJyYXkgPSBmdW5jdGlvbiAoYXJyYXkpIHsKICAgIHZhciBjb3B5ID0gW107CiAgICBmb3IgKHZhciBpID0gMCwgbCA9IGFycmF5Lmxlbmd0aDsgaSA8IGw7IGkrKykgewogICAgICAgIGlmIChhcnJheVtpXSAmJiB0eXBlb2YgYXJyYXlbaV0gPT0gIm9iamVjdCIpCiAgICAgICAgICAgIGNvcHlbaV0gPSB0aGlzLmNvcHlPYmplY3QoYXJyYXlbaV0pOwogICAgICAgIGVsc2UKICAgICAgICAgICAgY29weVtpXSA9IGFycmF5W2ldOwogICAgfQogICAgcmV0dXJuIGNvcHk7Cn07CmV4cG9ydHMuZGVlcENvcHkgPSByZXF1aXJlKCIuL2RlZXBfY29weSIpLmRlZXBDb3B5OwpleHBvcnRzLmFycmF5VG9NYXAgPSBmdW5jdGlvbiAoYXJyKSB7CiAgICB2YXIgbWFwID0ge307CiAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykgewogICAgICAgIG1hcFthcnJbaV1dID0gMTsKICAgIH0KICAgIHJldHVybiBtYXA7Cn07CmV4cG9ydHMuY3JlYXRlTWFwID0gZnVuY3Rpb24gKHByb3BzKSB7CiAgICB2YXIgbWFwID0gT2JqZWN0LmNyZWF0ZShudWxsKTsKICAgIGZvciAodmFyIGkgaW4gcHJvcHMpIHsKICAgICAgICBtYXBbaV0gPSBwcm9wc1tpXTsKICAgIH0KICAgIHJldHVybiBtYXA7Cn07CmV4cG9ydHMuYXJyYXlSZW1vdmUgPSBmdW5jdGlvbiAoYXJyYXksIHZhbHVlKSB7CiAgICBmb3IgKHZhciBpID0gMDsgaSA8PSBhcnJheS5sZW5ndGg7IGkrKykgewogICAgICAgIGlmICh2YWx1ZSA9PT0gYXJyYXlbaV0pIHsKICAgICAgICAgICAgYXJyYXkuc3BsaWNlKGksIDEpOwogICAgICAgIH0KICAgIH0KfTsKZXhwb3J0cy5lc2NhcGVSZWdFeHAgPSBmdW5jdGlvbiAoc3RyKSB7CiAgICByZXR1cm4gc3RyLnJlcGxhY2UoLyhbLiorP14ke30oKXxbXF1cL1xcXSkvZywgJ1xcJDEnKTsKfTsKZXhwb3J0cy5lc2NhcGVIVE1MID0gZnVuY3Rpb24gKHN0cikgewogICAgcmV0dXJuICgiIiArIHN0cikucmVwbGFjZSgvJi9nLCAiJiMzODsiKS5yZXBsYWNlKC8iL2csICImIzM0OyIpLnJlcGxhY2UoLycvZywgIiYjMzk7IikucmVwbGFjZSgvPC9nLCAiJiM2MDsiKTsKfTsKZXhwb3J0cy5nZXRNYXRjaE9mZnNldHMgPSBmdW5jdGlvbiAoc3RyaW5nLCByZWdFeHApIHsKICAgIHZhciBtYXRjaGVzID0gW107CiAgICBzdHJpbmcucmVwbGFjZShyZWdFeHAsIGZ1bmN0aW9uIChzdHIpIHsKICAgICAgICBtYXRjaGVzLnB1c2goewogICAgICAgICAgICBvZmZzZXQ6IGFyZ3VtZW50c1thcmd1bWVudHMubGVuZ3RoIC0gMl0sCiAgICAgICAgICAgIGxlbmd0aDogc3RyLmxlbmd0aAogICAgICAgIH0pOwogICAgfSk7CiAgICByZXR1cm4gbWF0Y2hlczsKfTsKZXhwb3J0cy5kZWZlcnJlZENhbGwgPSBmdW5jdGlvbiAoZmNuKSB7CiAgICB2YXIgdGltZXIgPSBudWxsOwogICAgdmFyIGNhbGxiYWNrID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRpbWVyID0gbnVsbDsKICAgICAgICBmY24oKTsKICAgIH07CiAgICB2YXIgZGVmZXJyZWQgPSBmdW5jdGlvbiAodGltZW91dCkgewogICAgICAgIGRlZmVycmVkLmNhbmNlbCgpOwogICAgICAgIHRpbWVyID0gc2V0VGltZW91dChjYWxsYmFjaywgdGltZW91dCB8fCAwKTsKICAgICAgICByZXR1cm4gZGVmZXJyZWQ7CiAgICB9OwogICAgZGVmZXJyZWQuc2NoZWR1bGUgPSBkZWZlcnJlZDsKICAgIGRlZmVycmVkLmNhbGwgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgdGhpcy5jYW5jZWwoKTsKICAgICAgICBmY24oKTsKICAgICAgICByZXR1cm4gZGVmZXJyZWQ7CiAgICB9OwogICAgZGVmZXJyZWQuY2FuY2VsID0gZnVuY3Rpb24gKCkgewogICAgICAgIGNsZWFyVGltZW91dCh0aW1lcik7CiAgICAgICAgdGltZXIgPSBudWxsOwogICAgICAgIHJldHVybiBkZWZlcnJlZDsKICAgIH07CiAgICBkZWZlcnJlZC5pc1BlbmRpbmcgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgcmV0dXJuIHRpbWVyOwogICAgfTsKICAgIHJldHVybiBkZWZlcnJlZDsKfTsKZXhwb3J0cy5kZWxheWVkQ2FsbCA9IGZ1bmN0aW9uIChmY24sIGRlZmF1bHRUaW1lb3V0KSB7CiAgICB2YXIgdGltZXIgPSBudWxsOwogICAgdmFyIGNhbGxiYWNrID0gZnVuY3Rpb24gKCkgewogICAgICAgIHRpbWVyID0gbnVsbDsKICAgICAgICBmY24oKTsKICAgIH07CiAgICB2YXIgX3NlbGYgPSBmdW5jdGlvbiAodGltZW91dCkgewogICAgICAgIGlmICh0aW1lciA9PSBudWxsKQogICAgICAgICAgICB0aW1lciA9IHNldFRpbWVvdXQoY2FsbGJhY2ssIHRpbWVvdXQgfHwgZGVmYXVsdFRpbWVvdXQpOwogICAgfTsKICAgIF9zZWxmLmRlbGF5ID0gZnVuY3Rpb24gKHRpbWVvdXQpIHsKICAgICAgICB0aW1lciAmJiBjbGVhclRpbWVvdXQodGltZXIpOwogICAgICAgIHRpbWVyID0gc2V0VGltZW91dChjYWxsYmFjaywgdGltZW91dCB8fCBkZWZhdWx0VGltZW91dCk7CiAgICB9OwogICAgX3NlbGYuc2NoZWR1bGUgPSBfc2VsZjsKICAgIF9zZWxmLmNhbGwgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgdGhpcy5jYW5jZWwoKTsKICAgICAgICBmY24oKTsKICAgIH07CiAgICBfc2VsZi5jYW5jZWwgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgdGltZXIgJiYgY2xlYXJUaW1lb3V0KHRpbWVyKTsKICAgICAgICB0aW1lciA9IG51bGw7CiAgICB9OwogICAgX3NlbGYuaXNQZW5kaW5nID0gZnVuY3Rpb24gKCkgewogICAgICAgIHJldHVybiB0aW1lcjsKICAgIH07CiAgICByZXR1cm4gX3NlbGY7Cn07CmV4cG9ydHMuc3VwcG9ydHNMb29rYmVoaW5kID0gZnVuY3Rpb24gKCkgewogICAgdHJ5IHsKICAgICAgICBuZXcgUmVnRXhwKCcoPzw9LiknKTsKICAgIH0KICAgIGNhdGNoIChlKSB7CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfQogICAgcmV0dXJuIHRydWU7Cn07CmV4cG9ydHMuc2tpcEVtcHR5TWF0Y2ggPSBmdW5jdGlvbiAobGluZSwgbGFzdCwgc3VwcG9ydHNVbmljb2RlRmxhZykgewogICAgcmV0dXJuIHN1cHBvcnRzVW5pY29kZUZsYWcgJiYgbGluZS5jb2RlUG9pbnRBdChsYXN0KSA+IDB4ZmZmZiA/IDIgOiAxOwp9OwoKfSk7CgphY2UuZGVmaW5lKCJhY2Uvd29ya2VyL21pcnJvciIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSkgewoidXNlIHN0cmljdCI7Cgp2YXIgRG9jdW1lbnQgPSByZXF1aXJlKCIuLi9kb2N1bWVudCIpLkRvY3VtZW50Owp2YXIgbGFuZyA9IHJlcXVpcmUoIi4uL2xpYi9sYW5nIik7CiAgICAKdmFyIE1pcnJvciA9IGV4cG9ydHMuTWlycm9yID0gZnVuY3Rpb24oc2VuZGVyKSB7CiAgICB0aGlzLnNlbmRlciA9IHNlbmRlcjsKICAgIHZhciBkb2MgPSB0aGlzLmRvYyA9IG5ldyBEb2N1bWVudCgiIik7CiAgICAKICAgIHZhciBkZWZlcnJlZFVwZGF0ZSA9IHRoaXMuZGVmZXJyZWRVcGRhdGUgPSBsYW5nLmRlbGF5ZWRDYWxsKHRoaXMub25VcGRhdGUuYmluZCh0aGlzKSk7CiAgICAKICAgIHZhciBfc2VsZiA9IHRoaXM7CiAgICBzZW5kZXIub24oImNoYW5nZSIsIGZ1bmN0aW9uKGUpIHsKICAgICAgICB2YXIgZGF0YSA9IGUuZGF0YTsKICAgICAgICBpZiAoZGF0YVswXS5zdGFydCkgewogICAgICAgICAgICBkb2MuYXBwbHlEZWx0YXMoZGF0YSk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBkYXRhLmxlbmd0aDsgaSArPSAyKSB7CiAgICAgICAgICAgICAgICB2YXIgZCwgZXJyOyAKICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGRhdGFbaSsxXSkpIHsKICAgICAgICAgICAgICAgICAgICBkID0ge2FjdGlvbjogImluc2VydCIsIHN0YXJ0OiBkYXRhW2ldLCBsaW5lczogZGF0YVtpKzFdfTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgZCA9IHthY3Rpb246ICJyZW1vdmUiLCBzdGFydDogZGF0YVtpXSwgZW5kOiBkYXRhW2krMV19OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICBpZiAoKGQuYWN0aW9uID09ICJpbnNlcnQiID8gZC5zdGFydCA6IGQuZW5kKS5yb3cgPj0gZG9jLiRsaW5lcy5sZW5ndGgpIHsKICAgICAgICAgICAgICAgICAgICBlcnIgPSBuZXcgRXJyb3IoIkludmFsaWQgZGVsdGEiKTsKICAgICAgICAgICAgICAgICAgICBlcnIuZGF0YSA9IHsKICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogX3NlbGYuJHBhdGgsCiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzTGVuZ3RoOiBkb2MuJGxpbmVzLmxlbmd0aCwKICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IGQuc3RhcnQsCiAgICAgICAgICAgICAgICAgICAgICAgIGVuZDogZC5lbmQKICAgICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgIHRocm93IGVycjsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBkb2MuYXBwbHlEZWx0YShkLCB0cnVlKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZiAoX3NlbGYuJHRpbWVvdXQpCiAgICAgICAgICAgIHJldHVybiBkZWZlcnJlZFVwZGF0ZS5zY2hlZHVsZShfc2VsZi4kdGltZW91dCk7CiAgICAgICAgX3NlbGYub25VcGRhdGUoKTsKICAgIH0pOwp9OwoKKGZ1bmN0aW9uKCkgewogICAgCiAgICB0aGlzLiR0aW1lb3V0ID0gNTAwOwogICAgCiAgICB0aGlzLnNldFRpbWVvdXQgPSBmdW5jdGlvbih0aW1lb3V0KSB7CiAgICAgICAgdGhpcy4kdGltZW91dCA9IHRpbWVvdXQ7CiAgICB9OwogICAgCiAgICB0aGlzLnNldFZhbHVlID0gZnVuY3Rpb24odmFsdWUpIHsKICAgICAgICB0aGlzLmRvYy5zZXRWYWx1ZSh2YWx1ZSk7CiAgICAgICAgdGhpcy5kZWZlcnJlZFVwZGF0ZS5zY2hlZHVsZSh0aGlzLiR0aW1lb3V0KTsKICAgIH07CiAgICAKICAgIHRoaXMuZ2V0VmFsdWUgPSBmdW5jdGlvbihjYWxsYmFja0lkKSB7CiAgICAgICAgdGhpcy5zZW5kZXIuY2FsbGJhY2sodGhpcy5kb2MuZ2V0VmFsdWUoKSwgY2FsbGJhY2tJZCk7CiAgICB9OwogICAgCiAgICB0aGlzLm9uVXBkYXRlID0gZnVuY3Rpb24oKSB7CiAgICB9OwogICAgCiAgICB0aGlzLmlzUGVuZGluZyA9IGZ1bmN0aW9uKCkgewogICAgICAgIHJldHVybiB0aGlzLmRlZmVycmVkVXBkYXRlLmlzUGVuZGluZygpOwogICAgfTsKICAgIAp9KS5jYWxsKE1pcnJvci5wcm90b3R5cGUpOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbW9kZS9qc29uL2pzb25fcGFyc2UiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKICAgIHZhciBhdCwgICAgIC8vIFRoZSBpbmRleCBvZiB0aGUgY3VycmVudCBjaGFyYWN0ZXIKICAgICAgICBjaCwgICAgIC8vIFRoZSBjdXJyZW50IGNoYXJhY3RlcgogICAgICAgIGVzY2FwZWUgPSB7CiAgICAgICAgICAgICciJzogICciJywKICAgICAgICAgICAgJ1xcJzogJ1xcJywKICAgICAgICAgICAgJy8nOiAgJy8nLAogICAgICAgICAgICBiOiAgICAnXGInLAogICAgICAgICAgICBmOiAgICAnXGYnLAogICAgICAgICAgICBuOiAgICAnXG4nLAogICAgICAgICAgICByOiAgICAnXHInLAogICAgICAgICAgICB0OiAgICAnXHQnCiAgICAgICAgfSwKICAgICAgICB0ZXh0LAoKICAgICAgICBlcnJvciA9IGZ1bmN0aW9uIChtKSB7CgogICAgICAgICAgICB0aHJvdyB7CiAgICAgICAgICAgICAgICBuYW1lOiAgICAnU3ludGF4RXJyb3InLAogICAgICAgICAgICAgICAgbWVzc2FnZTogbSwKICAgICAgICAgICAgICAgIGF0OiAgICAgIGF0LAogICAgICAgICAgICAgICAgdGV4dDogICAgdGV4dAogICAgICAgICAgICB9OwogICAgICAgIH0sCgogICAgICAgIG5leHQgPSBmdW5jdGlvbiAoYykgewoKICAgICAgICAgICAgaWYgKGMgJiYgYyAhPT0gY2gpIHsKICAgICAgICAgICAgICAgIGVycm9yKCJFeHBlY3RlZCAnIiArIGMgKyAiJyBpbnN0ZWFkIG9mICciICsgY2ggKyAiJyIpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBjaCA9IHRleHQuY2hhckF0KGF0KTsKICAgICAgICAgICAgYXQgKz0gMTsKICAgICAgICAgICAgcmV0dXJuIGNoOwogICAgICAgIH0sCgogICAgICAgIG51bWJlciA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHZhciBudW1iZXIsCiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnJzsKCiAgICAgICAgICAgIGlmIChjaCA9PT0gJy0nKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnLSc7CiAgICAgICAgICAgICAgICBuZXh0KCctJyk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgd2hpbGUgKGNoID49ICcwJyAmJiBjaCA8PSAnOScpIHsKICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY2ggPT09ICcuJykgewogICAgICAgICAgICAgICAgc3RyaW5nICs9ICcuJzsKICAgICAgICAgICAgICAgIHdoaWxlIChuZXh0KCkgJiYgY2ggPj0gJzAnICYmIGNoIDw9ICc5JykgewogICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY2ggPT09ICdlJyB8fCBjaCA9PT0gJ0UnKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICctJyB8fCBjaCA9PT0gJysnKSB7CiAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHdoaWxlIChjaCA+PSAnMCcgJiYgY2ggPD0gJzknKSB7CiAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBudW1iZXIgPSArc3RyaW5nOwogICAgICAgICAgICBpZiAoaXNOYU4obnVtYmVyKSkgewogICAgICAgICAgICAgICAgZXJyb3IoIkJhZCBudW1iZXIiKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICBzdHJpbmcgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICB2YXIgaGV4LAogICAgICAgICAgICAgICAgaSwKICAgICAgICAgICAgICAgIHN0cmluZyA9ICcnLAogICAgICAgICAgICAgICAgdWZmZmY7CgogICAgICAgICAgICBpZiAoY2ggPT09ICciJykgewogICAgICAgICAgICAgICAgd2hpbGUgKG5leHQoKSkgewogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJyInKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0cmluZzsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09PSAnXFwnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoID09PSAndScpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVmZmZmID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA0OyBpICs9IDEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZXggPSBwYXJzZUludChuZXh0KCksIDE2KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzRmluaXRlKGhleCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVmZmZmID0gdWZmZmYgKiAxNiArIGhleDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKHVmZmZmKTsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgZXNjYXBlZVtjaF0gPT09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gZXNjYXBlZVtjaF07CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gIlxuIiB8fCBjaCA9PSAiXHIiKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBzdHJpbmciKTsKICAgICAgICB9LAoKICAgICAgICB3aGl0ZSA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHdoaWxlIChjaCAmJiBjaCA8PSAnICcpIHsKICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgIHdvcmQgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICBzd2l0Y2ggKGNoKSB7CiAgICAgICAgICAgIGNhc2UgJ3QnOgogICAgICAgICAgICAgICAgbmV4dCgndCcpOwogICAgICAgICAgICAgICAgbmV4dCgncicpOwogICAgICAgICAgICAgICAgbmV4dCgndScpOwogICAgICAgICAgICAgICAgbmV4dCgnZScpOwogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIGNhc2UgJ2YnOgogICAgICAgICAgICAgICAgbmV4dCgnZicpOwogICAgICAgICAgICAgICAgbmV4dCgnYScpOwogICAgICAgICAgICAgICAgbmV4dCgnbCcpOwogICAgICAgICAgICAgICAgbmV4dCgncycpOwogICAgICAgICAgICAgICAgbmV4dCgnZScpOwogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICBjYXNlICduJzoKICAgICAgICAgICAgICAgIG5leHQoJ24nKTsKICAgICAgICAgICAgICAgIG5leHQoJ3UnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVycm9yKCJVbmV4cGVjdGVkICciICsgY2ggKyAiJyIpOwogICAgICAgIH0sCgogICAgICAgIHZhbHVlLCAgLy8gUGxhY2UgaG9sZGVyIGZvciB0aGUgdmFsdWUgZnVuY3Rpb24uCgogICAgICAgIGFycmF5ID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGFycmF5ID0gW107CgogICAgICAgICAgICBpZiAoY2ggPT09ICdbJykgewogICAgICAgICAgICAgICAgbmV4dCgnWycpOwogICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ10nKSB7CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnXScpOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheTsgICAvLyBlbXB0eSBhcnJheQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgd2hpbGUgKGNoKSB7CiAgICAgICAgICAgICAgICAgICAgYXJyYXkucHVzaCh2YWx1ZSgpKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ10nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoJ10nKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFycmF5OwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBuZXh0KCcsJyk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvcigiQmFkIGFycmF5Iik7CiAgICAgICAgfSwKCiAgICAgICAgb2JqZWN0ID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGtleSwKICAgICAgICAgICAgICAgIG9iamVjdCA9IHt9OwoKICAgICAgICAgICAgaWYgKGNoID09PSAneycpIHsKICAgICAgICAgICAgICAgIG5leHQoJ3snKTsKICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICd9JykgewogICAgICAgICAgICAgICAgICAgIG5leHQoJ30nKTsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2JqZWN0OyAgIC8vIGVtcHR5IG9iamVjdAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgd2hpbGUgKGNoKSB7CiAgICAgICAgICAgICAgICAgICAga2V5ID0gc3RyaW5nKCk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgICAgICBuZXh0KCc6Jyk7CiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iamVjdCwga2V5KSkgewogICAgICAgICAgICAgICAgICAgICAgICBlcnJvcignRHVwbGljYXRlIGtleSAiJyArIGtleSArICciJyk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIG9iamVjdFtrZXldID0gdmFsdWUoKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ30nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoJ30nKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnLCcpOwogICAgICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBvYmplY3QiKTsKICAgICAgICB9OwoKICAgIHZhbHVlID0gZnVuY3Rpb24gKCkgewoKICAgICAgICB3aGl0ZSgpOwogICAgICAgIHN3aXRjaCAoY2gpIHsKICAgICAgICBjYXNlICd7JzoKICAgICAgICAgICAgcmV0dXJuIG9iamVjdCgpOwogICAgICAgIGNhc2UgJ1snOgogICAgICAgICAgICByZXR1cm4gYXJyYXkoKTsKICAgICAgICBjYXNlICciJzoKICAgICAgICAgICAgcmV0dXJuIHN0cmluZygpOwogICAgICAgIGNhc2UgJy0nOgogICAgICAgICAgICByZXR1cm4gbnVtYmVyKCk7CiAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgcmV0dXJuIGNoID49ICcwJyAmJiBjaCA8PSAnOScgPyBudW1iZXIoKSA6IHdvcmQoKTsKICAgICAgICB9CiAgICB9OwoKICAgIHJldHVybiBmdW5jdGlvbiAoc291cmNlLCByZXZpdmVyKSB7CiAgICAgICAgdmFyIHJlc3VsdDsKCiAgICAgICAgdGV4dCA9IHNvdXJjZTsKICAgICAgICBhdCA9IDA7CiAgICAgICAgY2ggPSAnICc7CiAgICAgICAgcmVzdWx0ID0gdmFsdWUoKTsKICAgICAgICB3aGl0ZSgpOwogICAgICAgIGlmIChjaCkgewogICAgICAgICAgICBlcnJvcigiU3ludGF4IGVycm9yIik7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gdHlwZW9mIHJldml2ZXIgPT09ICdmdW5jdGlvbicgPyBmdW5jdGlvbiB3YWxrKGhvbGRlciwga2V5KSB7CiAgICAgICAgICAgIHZhciBrLCB2LCB2YWx1ZSA9IGhvbGRlcltrZXldOwogICAgICAgICAgICBpZiAodmFsdWUgJiYgdHlwZW9mIHZhbHVlID09PSAnb2JqZWN0JykgewogICAgICAgICAgICAgICAgZm9yIChrIGluIHZhbHVlKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5oYXNPd25Qcm9wZXJ0eS5jYWxsKHZhbHVlLCBrKSkgewogICAgICAgICAgICAgICAgICAgICAgICB2ID0gd2Fsayh2YWx1ZSwgayk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2ICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlW2tdID0gdjsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB2YWx1ZVtrXTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gcmV2aXZlci5jYWxsKGhvbGRlciwga2V5LCB2YWx1ZSk7CiAgICAgICAgfSh7Jyc6IHJlc3VsdH0sICcnKSA6IHJlc3VsdDsKICAgIH07Cn0pOwoKYWNlLmRlZmluZSgiYWNlL21vZGUvanNvbl93b3JrZXIiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKdmFyIG9vcCA9IHJlcXVpcmUoIi4uL2xpYi9vb3AiKTsKdmFyIE1pcnJvciA9IHJlcXVpcmUoIi4uL3dvcmtlci9taXJyb3IiKS5NaXJyb3I7CnZhciBwYXJzZSA9IHJlcXVpcmUoIi4vanNvbi9qc29uX3BhcnNlIik7Cgp2YXIgSnNvbldvcmtlciA9IGV4cG9ydHMuSnNvbldvcmtlciA9IGZ1bmN0aW9uKHNlbmRlcikgewogICAgTWlycm9yLmNhbGwodGhpcywgc2VuZGVyKTsKICAgIHRoaXMuc2V0VGltZW91dCgyMDApOwp9OwoKb29wLmluaGVyaXRzKEpzb25Xb3JrZXIsIE1pcnJvcik7CgooZnVuY3Rpb24oKSB7CgogICAgdGhpcy5vblVwZGF0ZSA9IGZ1bmN0aW9uKCkgewogICAgICAgIHZhciB2YWx1ZSA9IHRoaXMuZG9jLmdldFZhbHVlKCk7CiAgICAgICAgdmFyIGVycm9ycyA9IFtdOwogICAgICAgIHRyeSB7CiAgICAgICAgICAgIGlmICh2YWx1ZSkKICAgICAgICAgICAgICAgIHBhcnNlKHZhbHVlKTsKICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIHZhciBwb3MgPSB0aGlzLmRvYy5pbmRleFRvUG9zaXRpb24oZS5hdC0xKTsKICAgICAgICAgICAgZXJyb3JzLnB1c2goewogICAgICAgICAgICAgICAgcm93OiBwb3Mucm93LAogICAgICAgICAgICAgICAgY29sdW1uOiBwb3MuY29sdW1uLAogICAgICAgICAgICAgICAgdGV4dDogZS5tZXNzYWdlLAogICAgICAgICAgICAgICAgdHlwZTogImVycm9yIgogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgICAgdGhpcy5zZW5kZXIuZW1pdCgiYW5ub3RhdGUiLCBlcnJvcnMpOwogICAgfTsKCn0pLmNhbGwoSnNvbldvcmtlci5wcm90b3R5cGUpOwoKfSk7Cg=="},3057:function(e,t,i){"use strict";i.d(t,{AI:function(){return c},Tl:function(){return h},xC:function(){return l}}),i(1081);var n={en:{array:"Array",auto:"Auto",appendText:"Append",appendTitle:"Append a new field with type 'auto' after this field (Ctrl+Shift+Ins)",appendSubmenuTitle:"Select the type of the field to be appended",appendTitleAuto:"Append a new field with type 'auto' (Ctrl+Shift+Ins)",ascending:"Ascending",ascendingTitle:"Sort the childs of this ${type} in ascending order",actionsMenu:"Click to open the actions menu (Ctrl+M)",cannotParseFieldError:"Cannot parse field into JSON",cannotParseValueError:"Cannot parse value into JSON",collapseAll:"Collapse all fields",compactTitle:"Compact JSON data, remove all whitespaces (Ctrl+Shift+I)",descending:"Descending",descendingTitle:"Sort the childs of this ${type} in descending order",drag:"Drag to move this field (Alt+Shift+Arrows)",duplicateKey:"duplicate key",duplicateText:"Duplicate",duplicateTitle:"Duplicate selected fields (Ctrl+D)",duplicateField:"Duplicate this field (Ctrl+D)",duplicateFieldError:"Duplicate field name",empty:"empty",expandAll:"Expand all fields",expandTitle:"Click to expand/collapse this field (Ctrl+E). \nCtrl+Click to expand/collapse including all childs.",formatTitle:"Format JSON data, with proper indentation and line feeds (Ctrl+I)",insert:"Insert",insertTitle:"Insert a new field with type 'auto' before this field (Ctrl+Ins)",insertSub:"Select the type of the field to be inserted",object:"Object",ok:"Ok",redo:"Redo (Ctrl+Shift+Z)",removeText:"Remove",removeTitle:"Remove selected fields (Ctrl+Del)",removeField:"Remove this field (Ctrl+Del)",repairTitle:"Repair JSON: fix quotes and escape characters, remove comments and JSONP notation, turn JavaScript objects into JSON.",searchTitle:"Search fields and values",searchNextResultTitle:"Next result (Enter)",searchPreviousResultTitle:"Previous result (Shift + Enter)",selectNode:"Select a node...",showAll:"show all",showMore:"show more",showMoreStatus:"displaying ${visibleChilds} of ${totalChilds} items.",sort:"Sort",sortTitle:"Sort the childs of this ${type}",sortTitleShort:"Sort contents",sortFieldLabel:"Field:",sortDirectionLabel:"Direction:",sortFieldTitle:"Select the nested field by which to sort the array or object",sortAscending:"Ascending",sortAscendingTitle:"Sort the selected field in ascending order",sortDescending:"Descending",sortDescendingTitle:"Sort the selected field in descending order",string:"String",transform:"Transform",transformTitle:"Filter, sort, or transform the childs of this ${type}",transformTitleShort:"Filter, sort, or transform contents",extract:"Extract",extractTitle:"Extract this ${type}",transformQueryTitle:"Enter a JMESPath query",transformWizardLabel:"Wizard",transformWizardFilter:"Filter",transformWizardSortBy:"Sort by",transformWizardSelectFields:"Select fields",transformQueryLabel:"Query",transformPreviewLabel:"Preview",type:"Type",typeTitle:"Change the type of this field",openUrl:"Ctrl+Click or Ctrl+Enter to open url in new window",undo:"Undo last action (Ctrl+Z)",validationCannotMove:"Cannot move a field into a child of itself",autoType:'Field type "auto". The field type is automatically determined from the value and can be a string, number, boolean, or null.',objectType:'Field type "object". An object contains an unordered set of key/value pairs.',arrayType:'Field type "array". An array contains an ordered collection of values.',stringType:'Field type "string". Field type is not determined from the value, but always returned as string.',modeEditorTitle:"Switch Editor Mode",modeCodeText:"Code",modeCodeTitle:"Switch to code highlighter",modeFormText:"Form",modeFormTitle:"Switch to form editor",modeTextText:"Text",modeTextTitle:"Switch to plain text editor",modeTreeText:"Tree",modeTreeTitle:"Switch to tree editor",modeViewText:"View",modeViewTitle:"Switch to tree view",modePreviewText:"Preview",modePreviewTitle:"Switch to preview mode",examples:"Examples",default:"Default",containsInvalidProperties:"Contains invalid properties",containsInvalidItems:"Contains invalid items"},es:{array:"Matriz",auto:"Auto",appendText:"Agregar",appendTitle:"Agregue un nuevo campo con el tipo 'auto' después de este campo (Ctrl + Shift + Ins)",appendSubmenuTitle:"Seleccione el tipo de campo que se agregará",appendTitleAuto:"Agregue un nuevo campo con el tipo 'auto' (Ctrl + Shift + Ins)",ascending:"Ascendente",ascendingTitle:"Ordene los elementos secundarios de este ${type} en orden ascendente",actionsMenu:"Haga clic para abrir el menú de acciones (Ctrl + M)",cannotParseFieldError:"No se puede parsear el campo en JSON",cannotParseValueError:"No se puede parsear el valor en JSON",collapseAll:"Contraer todos los campos",compactTitle:"Compactar datos JSON, eliminar todos los espacios en blanco (Ctrl + Shift + I)",descending:"Descendente",descendingTitle:"Ordene los hijos de este ${type} en orden descendente",drag:"Arrastre para mover este campo (Alt + Mayús + Flechas)",duplicateKey:"llave duplicada",duplicateText:"Duplicar",duplicateTitle:"Duplicar campos seleccionados (Ctrl + D)",duplicateField:"Duplicar este campo (Ctrl + D)",duplicateFieldError:"Nombre de campo duplicado",empty:"vacio",expandAll:"Expandir todos los campos",expandTitle:"Haga clic para expandir/contraer este campo (Ctrl + E). \n Ctrl+Clic para expandir/contraer incluyendo todos los niños.",formatTitle:"Formatee los datos JSON, con la sangría y los avances de línea adecuados (Ctrl + I)",insert:"Insertar",insertTitle:"Inserte un nuevo campo con el tipo 'auto' antes de este campo (Ctrl + Ins)",insertSub:"Seleccione el tipo de campo a insertar",object:"Objeto",ok:"Ok",redo:"Rehacer (Ctrl+Mayús+Z)",removeText:"Eliminar",removeTitle:"Eliminar campos seleccionados (Ctrl+Supr)",removeField:"Eliminar este campo (Ctrl+Supr)",repairTitle:"Reparar JSON: corrija comillas y caracteres de escape, elimine comentarios y notación JSONP, convierta objetos JavaScript en JSON.",searchTitle:"Campos de búsqueda y valores",searchNextResultTitle:"Siguiente resultado (Entrar)",searchPreviousResultTitle:"Resultado anterior (Shift + Enter)",selectNode:"Seleccione un nodo...",showAll:"mostrar todo",showMore:"mostrar más",showMoreStatus:"mostrando ${visibleChilds} de ${totalChilds} elementos.",sort:"Ordenar",sortTitle:"Ordene los hijos de este ${type}",sortTitleShort:"Ordenar contenidos",sortFieldLabel:"Campo:",sortDirectionLabel:"Dirección:",sortFieldTitle:"Seleccione el campo anidado por el cual ordenar la matriz u objeto",sortAscending:"Ascendente",sortAscendingTitle:"Ordenar el campo seleccionado en orden ascendente",sortDescending:"Descendente",sortDescendingTitle:"Ordenar por el campo seleccionado, en orden descendente",string:"Texto",transform:"Transformar",transformTitle:"Filtrar, ordenar o transformar los hijos de este ${type}",transformTitleShort:"Filtrar, ordenar o transformar contenidos",extract:"Extraer",extractTitle:"Extrae este ${type}",transformQueryTitle:"Ingrese una consulta JMESPath",transformWizardLabel:"Wizard",transformWizardFilter:"Filtro",transformWizardSortBy:"Ordenar por",transformWizardSelectFields:"Seleccione un campo",transformQueryLabel:"Consulta",transformPreviewLabel:"Vista Previa",type:"Tipo",typeTitle:"Cambiar el tipo de campo",openUrl:"Ctrl+Click o Ctrl+Enter para abrir la URL en una nueva ventana",undo:"Deshacer la última acción (Ctrl+Z)",validationCannotMove:"No se puede mover un campo a un hijo de sí mismo.",autoType:'Tipo de campo "auto". El tipo de campo se determina automáticamente a partir del valor y puede ser una cadena, un número, un booleano o un valor nulo.',objectType:'Tipo de campo "objeto". Un objeto contiene un conjunto desordenado de pares clave/valor.',arrayType:'Tipo de campo "matriz". Una matriz contiene una colección ordenada de valores.',stringType:'Tipo de campo "cadena". El tipo de campo no se determina a partir del valor, pero siempre se devuelve como una cadena.',modeEditorTitle:"Cambiar modo de editor",modeCodeText:"Código",modeCodeTitle:"Cambiar al resaltador de código",modeFormText:"Formulario",modeFormTitle:"Cambiar al editor de formularios",modeTextText:"Texto",modeTextTitle:"Cambiar al editor de texto sin formato",modeTreeText:"Árbol",modeTreeTitle:"Cambiar al editor de árbol",modeViewText:"Vista",modeViewTitle:"Cambiar a la vista de árbol",modePreviewText:"Vista Previa",modePreviewTitle:"Cambiar al modo de vista previa",examples:"Ejemplos",default:"Predeterminado",containsInvalidProperties:"Contiene propiedades no válidas",containsInvalidItems:"Contiene ítems no válidos"},"zh-CN":{array:"数组",auto:"自动",appendText:"追加",appendTitle:"在此字段后追加一个类型为“auto”的新字段 (Ctrl+Shift+Ins)",appendSubmenuTitle:"选择要追加的字段类型",appendTitleAuto:"追加类型为“auto”的新字段 (Ctrl+Shift+Ins)",ascending:"升序",ascendingTitle:"升序排列${type}的子节点",actionsMenu:"点击打开动作菜单(Ctrl+M)",cannotParseFieldError:"无法将字段解析为JSON",cannotParseValueError:"无法将值解析为JSON",collapseAll:"缩进所有字段",compactTitle:"压缩JSON数据,删除所有空格 (Ctrl+Shift+I)",descending:"降序",descendingTitle:"降序排列${type}的子节点",drag:"拖拽移动该节点(Alt+Shift+Arrows)",duplicateKey:"重复键",duplicateText:"复制",duplicateTitle:"复制选中字段(Ctrl+D)",duplicateField:"复制该字段(Ctrl+D)",duplicateFieldError:"重复的字段名称",empty:"清空",expandAll:"展开所有字段",expandTitle:"点击 展开/收缩 该字段(Ctrl+E). \nCtrl+Click 展开/收缩 包含所有子节点.",formatTitle:"使用适当的缩进和换行符格式化JSON数据 (Ctrl+I)",insert:"插入",insertTitle:"在此字段前插入类型为“auto”的新字段 (Ctrl+Ins)",insertSub:"选择要插入的字段类型",object:"对象",ok:"Ok",redo:"重做 (Ctrl+Shift+Z)",removeText:"移除",removeTitle:"移除选中字段 (Ctrl+Del)",removeField:"移除该字段 (Ctrl+Del)",repairTitle:"修复JSON:修复引号和转义符,删除注释和JSONP表示法,将JavaScript对象转换为JSON。",selectNode:"选择一个节点...",showAll:"展示全部",showMore:"展示更多",showMoreStatus:"显示${totalChilds}的${visibleChilds}项目.",sort:"排序",sortTitle:"排序${type}的子节点",sortTitleShort:"内容排序",sortFieldLabel:"字段:",sortDirectionLabel:"方向:",sortFieldTitle:"选择用于对数组或对象排序的嵌套字段",sortAscending:"升序排序",sortAscendingTitle:"按照该字段升序排序",sortDescending:"降序排序",sortDescendingTitle:"按照该字段降序排序",string:"字符串",transform:"变换",transformTitle:"筛选,排序,或者转换${type}的子节点",transformTitleShort:"筛选,排序,或者转换内容",extract:"提取",extractTitle:"提取这个 ${type}",transformQueryTitle:"输入JMESPath查询",transformWizardLabel:"向导",transformWizardFilter:"筛选",transformWizardSortBy:"排序",transformWizardSelectFields:"选择字段",transformQueryLabel:"查询",transformPreviewLabel:"预览",type:"类型",typeTitle:"更改字段类型",openUrl:"Ctrl+Click 或者 Ctrl+Enter 在新窗口打开链接",undo:"撤销上次动作 (Ctrl+Z)",validationCannotMove:"无法将字段移入其子节点",autoType:'字段类型 "auto". 字段类型由值自动确定 可以为 string,number,boolean,或者 null.',objectType:'字段类型 "object". 对象包含一组无序的键/值对.',arrayType:'字段类型 "array". 数组包含值的有序集合.',stringType:'字段类型 "string". 字段类型由值自动确定,但始终作为字符串返回.',modeCodeText:"代码",modeCodeTitle:"切换至代码高亮",modeFormText:"表单",modeFormTitle:"切换至表单编辑",modeTextText:"文本",modeTextTitle:"切换至文本编辑",modeTreeText:"树",modeTreeTitle:"切换至树编辑",modeViewText:"视图",modeViewTitle:"切换至树视图",modePreviewText:"预览",modePreviewTitle:"切换至预览模式",examples:"例子",default:"缺省",containsInvalidProperties:"包含无效的属性",containsInvalidItems:"包含无效项目"},"pt-BR":{array:"Lista",auto:"Automatico",appendText:"Adicionar",appendTitle:"Adicionar novo campo com tipo 'auto' depois deste campo (Ctrl+Shift+Ins)",appendSubmenuTitle:"Selecione o tipo do campo a ser adicionado",appendTitleAuto:"Adicionar novo campo com tipo 'auto' (Ctrl+Shift+Ins)",ascending:"Ascendente",ascendingTitle:"Organizar filhor do tipo ${type} em crescente",actionsMenu:"Clique para abrir o menu de ações (Ctrl+M)",cannotParseFieldError:"Não é possível analisar o campo no JSON",cannotParseValueError:"Não é possível analisar o valor em JSON",collapseAll:"Fechar todos campos",compactTitle:"Dados JSON compactos, remova todos os espaços em branco (Ctrl+Shift+I)",descending:"Descendente",descendingTitle:"Organizar o filhos do tipo ${type} em decrescente",duplicateKey:"chave duplicada",drag:"Arraste para mover este campo (Alt+Shift+Arrows)",duplicateText:"Duplicar",duplicateTitle:"Duplicar campos selecionados (Ctrl+D)",duplicateField:"Duplicar este campo (Ctrl+D)",duplicateFieldError:"Nome do campo duplicado",empty:"vazio",expandAll:"Expandir todos campos",expandTitle:"Clique para expandir/encolher este campo (Ctrl+E). \nCtrl+Click para expandir/encolher incluindo todos os filhos.",formatTitle:"Formate dados JSON, com recuo e feeds de linha adequados (Ctrl+I)",insert:"Inserir",insertTitle:"Inserir um novo campo do tipo 'auto' antes deste campo (Ctrl+Ins)",insertSub:"Selecionar o tipo de campo a ser inserido",object:"Objeto",ok:"Ok",redo:"Refazer (Ctrl+Shift+Z)",removeText:"Remover",removeTitle:"Remover campos selecionados (Ctrl+Del)",removeField:"Remover este campo (Ctrl+Del)",repairTitle:"Repare JSON: corrija aspas e caracteres de escape, remova comentários e notação JSONP, transforme objetos JavaScript em JSON.",selectNode:"Selecione um nódulo...",showAll:"mostrar todos",showMore:"mostrar mais",showMoreStatus:"exibindo ${visibleChilds} de ${totalChilds} itens.",sort:"Organizar",sortTitle:"Organizar os filhos deste ${type}",sortTitleShort:"Organizar os filhos",sortFieldLabel:"Campo:",sortDirectionLabel:"Direção:",sortFieldTitle:"Selecione um campo filho pelo qual ordenar o array ou objeto",sortAscending:"Ascendente",sortAscendingTitle:"Ordenar o campo selecionado por ordem ascendente",sortDescending:"Descendente",sortDescendingTitle:"Ordenar o campo selecionado por ordem descendente",string:"Texto",transform:"Transformar",transformTitle:"Filtrar, ordenar ou transformar os filhos deste ${type}",transformTitleShort:"Filtrar, ordenar ou transformar conteúdos",transformQueryTitle:"Insira uma expressão JMESPath",transformWizardLabel:"Assistente",transformWizardFilter:"Filtro",transformWizardSortBy:"Ordenar por",transformWizardSelectFields:"Selecionar campos",transformQueryLabel:"Expressão",transformPreviewLabel:"Visualizar",type:"Tipo",typeTitle:"Mudar o tipo deste campo",openUrl:"Ctrl+Click ou Ctrl+Enter para abrir link em nova janela",undo:"Desfazer último ação (Ctrl+Z)",validationCannotMove:"Não pode mover um campo como filho dele mesmo",autoType:'Campo do tipo "auto". O tipo do campo é determinao automaticamente a partir do seu valor e pode ser texto, número, verdade/falso ou nulo.',objectType:'Campo do tipo "objeto". Um objeto contém uma lista de pares com chave e valor.',arrayType:'Campo do tipo "lista". Uma lista contem uma coleção de valores ordenados.',stringType:'Campo do tipo "string". Campo do tipo nao é determinado através do seu valor, mas sempre retornara um texto.',examples:"Exemplos",default:"Revelia",containsInvalidProperties:"Contém propriedades inválidas",containsInvalidItems:"Contém itens inválidos"},tr:{array:"Dizin",auto:"Otomatik",appendText:"Ekle",appendTitle:"Bu alanın altına 'otomatik' tipinde yeni bir alan ekle (Ctrl+Shift+Ins)",appendSubmenuTitle:"Eklenecek alanın tipini seç",appendTitleAuto:"'Otomatik' tipinde yeni bir alan ekle (Ctrl+Shift+Ins)",ascending:"Artan",ascendingTitle:"${type}'ın alt tiplerini artan düzende sırala",actionsMenu:"Aksiyon menüsünü açmak için tıklayın (Ctrl+M)",collapseAll:"Tüm alanları kapat",descending:"Azalan",descendingTitle:"${type}'ın alt tiplerini azalan düzende sırala",drag:"Bu alanı taşımak için sürükleyin (Alt+Shift+Arrows)",duplicateKey:"Var olan anahtar",duplicateText:"Aşağıya kopyala",duplicateTitle:"Seçili alanlardan bir daha oluştur (Ctrl+D)",duplicateField:"Bu alandan bir daha oluştur (Ctrl+D)",duplicateFieldError:"Duplicate field name",cannotParseFieldError:"Alan JSON'a ayrıştırılamıyor",cannotParseValueError:"JSON'a değer ayrıştırılamıyor",empty:"boş",expandAll:"Tüm alanları aç",expandTitle:"Bu alanı açmak/kapatmak için tıkla (Ctrl+E). \nAlt alanlarda dahil tüm alanları açmak için Ctrl+Click ",insert:"Ekle",insertTitle:"Bu alanın üstüne 'otomatik' tipinde yeni bir alan ekle (Ctrl+Ins)",insertSub:"Araya eklenecek alanın tipini seç",object:"Nesne",ok:"Tamam",redo:"Yeniden yap (Ctrl+Shift+Z)",removeText:"Kaldır",removeTitle:"Seçilen alanları kaldır (Ctrl+Del)",removeField:"Bu alanı kaldır (Ctrl+Del)",selectNode:"Bir nesne seç...",showAll:"tümünü göster",showMore:"daha fazla göster",showMoreStatus:"${totalChilds} alanın ${visibleChilds} alt alanları gösteriliyor",sort:"Sırala",sortTitle:"${type}'ın alt alanlarını sırala",sortTitleShort:"İçerikleri sırala",sortFieldLabel:"Alan:",sortDirectionLabel:"Yön:",sortFieldTitle:"Diziyi veya nesneyi sıralamak için iç içe geçmiş alanı seçin",sortAscending:"Artan",sortAscendingTitle:"Seçili alanı artan düzende sırala",sortDescending:"Azalan",sortDescendingTitle:"Seçili alanı azalan düzende sırala",string:"Karakter Dizisi",transform:"Dönüştür",transformTitle:"${type}'ın alt alanlarını filtrele, sırala veya dönüştür",transformTitleShort:"İçerikleri filterele, sırala veya dönüştür",transformQueryTitle:"JMESPath sorgusu gir",transformWizardLabel:"Sihirbaz",transformWizardFilter:"Filtre",transformWizardSortBy:"Sırala",transformWizardSelectFields:"Alanları seç",transformQueryLabel:"Sorgu",transformPreviewLabel:"Önizleme",type:"Tip",typeTitle:"Bu alanın tipini değiştir",openUrl:"URL'i yeni bir pencerede açmak için Ctrl+Click veya Ctrl+Enter",undo:"Son değişikliği geri al (Ctrl+Z)",validationCannotMove:"Alt alan olarak taşınamıyor",autoType:'Alan tipi "otomatik". Alan türü otomatik olarak değerden belirlenirve bir dize, sayı, boolean veya null olabilir.',objectType:'Alan tipi "nesne". Bir nesne, sıralanmamış bir anahtar / değer çifti kümesi içerir.',arrayType:'Alan tipi "dizi". Bir dizi, düzenli değerler koleksiyonu içerir.',stringType:'Alan tipi "karakter dizisi". Alan türü değerden belirlenmez,ancak her zaman karakter dizisi olarak döndürülür.',modeCodeText:"Kod",modeCodeTitle:"Kod vurgulayıcıya geç",modeFormText:"Form",modeFormTitle:"Form düzenleyiciye geç",modeTextText:"Metin",modeTextTitle:"Düz metin düzenleyiciye geç",modeTreeText:"Ağaç",modeTreeTitle:"Ağaç düzenleyiciye geç",modeViewText:"Görünüm",modeViewTitle:"Ağaç görünümüne geç",examples:"Örnekler",default:"Varsayılan",containsInvalidProperties:"Geçersiz özellikler içeriyor",containsInvalidItems:"Geçersiz öğeler içeriyor"},ja:{array:"配列",auto:"オート",appendText:"追加",appendTitle:'次のフィールドに"オート"のフィールドを追加 (Ctrl+Shift+Ins)',appendSubmenuTitle:"追加するフィールドの型を選択してください",appendTitleAuto:'"オート"のフィールドを追加 (Ctrl+Shift+Ins)',ascending:"昇順",ascendingTitle:"${type}の子要素を昇順に並べ替え",actionsMenu:"クリックしてアクションメニューを開く (Ctrl+M)",collapseAll:"すべてを折りたたむ",descending:"降順",descendingTitle:"${type}の子要素を降順に並べ替え",drag:"ドラッグして選択中のフィールドを移動 (Alt+Shift+Arrows)",duplicateKey:"複製キー",duplicateText:"複製",duplicateTitle:"選択中のフィールドを複製 (Ctrl+D)",duplicateField:"選択中のフィールドを複製 (Ctrl+D)",duplicateFieldError:"フィールド名が重複しています",cannotParseFieldError:"JSONのフィールドを解析できません",cannotParseValueError:"JSONの値を解析できません",empty:"空",expandAll:"すべてを展開",expandTitle:"クリックしてフィールドを展開/折りたたむ (Ctrl+E). \nCtrl+Click ですべての子要素を展開/折りたたむ",insert:"挿入",insertTitle:"選択中のフィールドの前に新しいフィールドを挿入 (Ctrl+Ins)",insertSub:"挿入するフィールドの型を選択",object:"オブジェクト",ok:"実行",redo:"やり直す (Ctrl+Shift+Z)",removeText:"削除",removeTitle:"選択中のフィールドを削除 (Ctrl+Del)",removeField:"選択中のフィールドを削除 (Ctrl+Del)",selectNode:"ノードを選択...",showAll:"すべてを表示",showMore:"もっと見る",showMoreStatus:"${totalChilds}個のアイテムのうち ${visibleChilds}個を表示しています。",sort:"並べ替え",sortTitle:"${type}の子要素を並べ替え",sortTitleShort:"並べ替え",sortFieldLabel:"フィールド:",sortDirectionLabel:"順序:",sortFieldTitle:"配列またはオブジェクトを並び替えるためのフィールドを選択",sortAscending:"昇順",sortAscendingTitle:"選択中のフィールドを昇順に並び替え",sortDescending:"降順",sortDescendingTitle:"選択中のフィールドを降順に並び替え",string:"文字列",transform:"変換",transformTitle:"${type}の子要素をフィルター・並び替え・変換する",transformTitleShort:"内容をフィルター・並び替え・変換する",extract:"抽出",extractTitle:"${type}を抽出",transformQueryTitle:"JMESPathクエリを入力",transformWizardLabel:"ウィザード",transformWizardFilter:"フィルター",transformWizardSortBy:"並び替え",transformWizardSelectFields:"フィールドを選択",transformQueryLabel:"クエリ",transformPreviewLabel:"プレビュー",type:"型",typeTitle:"選択中のフィールドの型を変更",openUrl:"Ctrl+Click または Ctrl+Enter で 新規ウィンドウでURLを開く",undo:"元に戻す (Ctrl+Z)",validationCannotMove:"子要素に移動できません ",autoType:"オート: フィールドの型は値から自動的に決定されます。 (文字列・数値・ブール・null)",objectType:"オブジェクト: オブジェクトは順序が決まっていないキーと値のペア組み合わせです。",arrayType:"配列: 配列は順序が決まっている値の集合体です。",stringType:"文字列: フィールド型は値から決定されませんが、常に文字列として返されます。",modeCodeText:"コードモード",modeCodeTitle:"ハイライトモードに切り替え",modeFormText:"フォームモード",modeFormTitle:"フォームモードに切り替え",modeTextText:"テキストモード",modeTextTitle:"テキストモードに切り替え",modeTreeText:"ツリーモード",modeTreeTitle:"ツリーモードに切り替え",modeViewText:"ビューモード",modeViewTitle:"ビューモードに切り替え",modePreviewText:"プレビュー",modePreviewTitle:"プレビューに切り替え",examples:"例",default:"デフォルト",containsInvalidProperties:"無効なプロパティが含まれています",containsInvalidItems:"無効なアイテムが含まれています"},"fr-FR":{array:"Liste",auto:"Auto",appendText:"Ajouter",appendTitle:"Ajouter un champ de type 'auto' après ce champ (Ctrl+Shift+Ins)",appendSubmenuTitle:"Sélectionner le type du champ à ajouter",appendTitleAuto:"Ajouter un champ de type 'auto' (Ctrl+Shift+Ins)",ascending:"Ascendant",ascendingTitle:"Trier les enfants de ce ${type} par ordre ascendant",actionsMenu:"Ouvrir le menu des actions (Ctrl+M)",collapseAll:"Regrouper",descending:"Descendant",descendingTitle:"Trier les enfants de ce ${type} par ordre descendant",drag:"Déplacer (Alt+Shift+Arrows)",duplicateKey:"Dupliquer la clé",duplicateText:"Dupliquer",duplicateTitle:"Dupliquer les champs sélectionnés (Ctrl+D)",duplicateField:"Dupliquer ce champ (Ctrl+D)",duplicateFieldError:"Dupliquer le nom de champ",cannotParseFieldError:"Champ impossible à parser en JSON",cannotParseValueError:"Valeur impossible à parser en JSON",empty:"vide",expandAll:"Étendre",expandTitle:"Étendre/regrouper ce champ (Ctrl+E). \nCtrl+Click pour étendre/regrouper avec tous les champs.",insert:"Insérer",insertTitle:"Insérer un champ de type 'auto' avant ce champ (Ctrl+Ins)",insertSub:"Sélectionner le type de champ à insérer",object:"Objet",ok:"Ok",redo:"Rejouer (Ctrl+Shift+Z)",removeText:"Supprimer",removeTitle:"Supprimer les champs sélectionnés (Ctrl+Del)",removeField:"Supprimer ce champ (Ctrl+Del)",searchTitle:"Rechercher champs et valeurs",searchNextResultTitle:"Résultat suivant (Enter)",searchPreviousResultTitle:"Résultat précédent (Shift + Enter)",selectNode:"Sélectionner un nœud...",showAll:"voir tout",showMore:"voir plus",showMoreStatus:"${visibleChilds} éléments affichés de ${totalChilds}.",sort:"Trier",sortTitle:"Trier les champs de ce ${type}",sortTitleShort:"Trier",sortFieldLabel:"Champ:",sortDirectionLabel:"Direction:",sortFieldTitle:"Sélectionner les champs permettant de trier les listes et objet",sortAscending:"Ascendant",sortAscendingTitle:"Trier les champs sélectionnés par ordre ascendant",sortDescending:"Descendant",sortDescendingTitle:"Trier les champs sélectionnés par ordre descendant",string:"Chaîne",transform:"Transformer",transformTitle:"Filtrer, trier, or transformer les enfants de ce ${type}",transformTitleShort:"Filtrer, trier ou transformer le contenu",extract:"Extraire",extractTitle:"Extraire ce ${type}",transformQueryTitle:"Saisir une requête JMESPath",transformWizardLabel:"Assistant",transformWizardFilter:"Filtrer",transformWizardSortBy:"Trier par",transformWizardSelectFields:"Sélectionner les champs",transformQueryLabel:"Requête",transformPreviewLabel:"Prévisualisation",type:"Type",typeTitle:"Changer le type de ce champ",openUrl:"Ctrl+Click ou Ctrl+Enter pour ouvrir l'url dans une autre fenêtre",undo:"Annuler la dernière action (Ctrl+Z)",validationCannotMove:"Cannot move a field into a child of itself",autoType:'Champe de type "auto". Ce type de champ est automatiquement déterminé en fonction de la valeur et peut être de type "chaîne", "nombre", "booléen" ou null.',objectType:'Champ de type "objet". Un objet contient un ensemble non ordonné de paires clé/valeur.',arrayType:'Champ de type "liste". Une liste contient une collection ordonnée de valeurs.',stringType:'Champ de type "chaîne". Ce type de champ n\'est pas déterminé en fonction de la valeur, mais retourne systématiquement une chaîne de caractères.',modeEditorTitle:"Changer mode d'édition",modeCodeText:"Code",modeCodeTitle:"Activer surlignage code",modeFormText:"Formulaire",modeFormTitle:"Activer formulaire",modeTextText:"Texte",modeTextTitle:"Activer éditeur texte",modeTreeText:"Arbre",modeTreeTitle:"Activer éditeur arbre",modeViewText:"Lecture seule",modeViewTitle:"Activer vue arbre",modePreviewText:"Prévisualisation",modePreviewTitle:"Activer mode prévisualiser",examples:"Exemples",default:"Défaut",containsInvalidProperties:"Contient des propriétés non valides",containsInvalidItems:"Contient des éléments invalides"},de:{array:"Auflistung",auto:"Auto",appendText:"anhängen",appendTitle:"Fügen Sie nach diesem Feld ein neues Feld mit dem Typ 'auto' ein (Strg+Umschalt+Ein)",appendSubmenuTitle:"Wählen Sie den Typ des neuen Feldes",appendTitleAuto:"Ein neues Feld vom Typ 'auto' hinzufügen (Strg+Umschalt+Ein)",ascending:"Aufsteigend",ascendingTitle:"Sortieren Sie die Elemente dieses ${type} in aufsteigender Reihenfolge",actionsMenu:"Klicken Sie zum Öffnen des Aktionsmenüs (Strg+M)",cannotParseFieldError:"Feld kann nicht in JSON geparst werden",cannotParseValueError:"Wert kann nicht in JSON geparst werden",collapseAll:"Alle Felder zuklappen",compactTitle:"JSON-Daten verdichten, alle Leerzeichen entfernen (Strg+Umschalt+\\)",descending:"Absteigend",descendingTitle:"Sortieren Sie die Elemente dieses ${type} in absteigender Reihenfolge",drag:"Ziehen, um dieses Feld zu verschieben (Alt+Umschalt+Pfeile)",duplicateKey:"Doppelter Schlüssel",duplicateText:"Duplikat",duplicateTitle:"Ausgewählte Felder duplizieren (Strg+D)",duplicateField:"Dieses Feld duplizieren (Strg+D)",duplicateFieldError:"Doppelter Feldname",empty:"leer",expandAll:"Alle Felder anzeigen",expandTitle:"Klicken Sie, um dieses Feld zu erweitern/zu kollabieren (Strg+E). \nStrg+Klicken Sie, um dieses Feld einschließlich aller Elemente zu erweitern/zu kollabieren.",formatTitle:"JSON-Daten mit korrekter Einrückung und Zeilenvorschüben formatieren (Strg+\\)",insert:"einfügen",insertTitle:"Fügen Sie vor diesem Feld ein neues Feld mit dem Typ 'auto' ein (Strg+Einfg)",insertSub:"Wählen Sie den Typ des neuen Feldes",object:"Objekt",ok:"Ok",redo:"Wiederholen (Strg+Umschalt+Z)",removeText:"entfernen",removeTitle:"Ausgewählte Felder entfernen (Strg+Entf)",removeField:"Dieses Feld entfernen (Strg+Entf)",repairTitle:"JSON reparieren: Anführungszeichen und Escape-Zeichen korrigieren, Kommentare und JSONP-Notation entfernen, JavaScript-Objekte in JSON umwandeln.",searchTitle:"Suchfelder und Werte",searchNextResultTitle:"Nächstes Ergebnis (Enter)",searchPreviousResultTitle:"Vorheriges Ergebnis (Umschalt + Eingabe)",selectNode:"Wählen Sie einen Knoten aus...",showAll:"alle anzeigen",showMore:"mehr anzeigen",showMoreStatus:"Anzeige von ${visibleChilds} von ${totalChilds}-Elementen.",sort:"Sortieren",sortTitle:"Sortieren Sie die Elemente dieses ${type}",sortTitleShort:"Inhalt sortieren",sortFieldLabel:"Feld:",sortDirectionLabel:"Richtung:",sortFieldTitle:"Wählen Sie das verschachtelte Feld, nach dem das Array oder Objekt sortiert werden soll.",sortAscending:"Aufsteigend",sortAscendingTitle:"Sortieren Sie das ausgewählte Feld in aufsteigender Reihenfolge",sortDescending:"Absteigend",sortDescendingTitle:"Sortieren Sie das ausgewählte Feld in absteigender Reihenfolge",string:"Zeichenfolge",transform:"Verwandeln",transformTitle:"Die Elemente dieses ${type} filtern, sortieren oder transformieren",transformTitleShort:"Inhalte filtern, sortieren oder transformieren",extract:"Auszug",extractTitle:"Extrahieren Sie diesen ${type}",transformQueryTitle:"Eine JMESPath-Abfrage eingeben",transformWizardLabel:"Zauberer",transformWizardFilter:"Filter",transformWizardSortBy:"Sortieren nach",transformWizardSelectFields:"Felder auswählen",transformQueryLabel:"Anfrage",transformPreviewLabel:"Vorschau",type:"Geben Sie ein.",typeTitle:"Ändern Sie den Typ dieses Feldes",openUrl:"Strg+Klicken oder Strg+Eingabe, um die URL in einem neuen Fenster zu öffnen",undo:"Letzte Aktion rückgängig machen (Strg+Z)",validationCannotMove:"Kann ein Feld nicht in ein Kind seiner selbst verschieben",autoType:'Feldtyp "auto". Der Feldtyp wird automatisch aus dem Wert bestimmt und kann ein String, eine Zahl, boolesch oder null sein.',objectType:'Feldtyp "Objekt". Ein Objekt enthält eine ungeordnete Menge von Schlüssel/Wert-Paaren.',arrayType:'Feldtyp "Array". Ein Array enthält eine geordnete Sammlung von Werten.',stringType:'Feldtyp "Zeichenfolge". Der Feldtyp wird nicht aus dem Wert bestimmt, sondern immer als Zeichenfolge zurückgegeben.',modeEditorTitle:"Editor-Modus umschalten",modeCodeText:"Code",modeCodeTitle:"Umschalten auf Code-Highlighter",modeFormText:"Formular",modeFormTitle:"Zum Formular-Editor wechseln",modeTextText:"Text",modeTextTitle:"Zum Editor für einfachen Text wechseln",modeTreeText:"Baum",modeTreeTitle:"Zum Baum-Editor wechseln",modeViewText:"Siehe",modeViewTitle:"Zur Baumansicht wechseln",modePreviewText:"Vorschau",modePreviewTitle:"In den Vorschau-Modus wechseln",examples:"Beispiele",default:"Standardmäßig",containsInvalidProperties:"Enthält ungültige Eigenschaften",containsInvalidItems:"Enthält ungültige Elemente"},ru:{array:"Массив",auto:"Авто",appendText:"Добавить",appendTitle:"Добавить новое поле с типом 'авто' после этого поля (Ctrl+Shift+Ins)",appendSubmenuTitle:"Выбрать тип поля для добавления",appendTitleAuto:"Добавить новое поле с типом 'авто' (Ctrl+Shift+Ins)",ascending:"По возрастанию",ascendingTitle:"Сортировать ${type} по возрастанию",actionsMenu:"Нажмите для открытия меню действий (Ctrl+M)",cannotParseFieldError:"Невозможно преобразовать поле в JSON",cannotParseValueError:"Невозможно преобразовать значение в JSON",collapseAll:"Свернуть все",compactTitle:"Минификация JSON (Ctrl+Shift+I)",descending:"По убыванию",descendingTitle:"Сортировать ${type} по убыванию",drag:"Потяните для перемещения этого поля (Alt+Shift+Arrows)",duplicateKey:"повторяющийся ключ",duplicateText:"Дублировать",duplicateTitle:"Дублирование полей (Ctrl+D)",duplicateField:"Дублировать поле (Ctrl+D)",duplicateFieldError:"Дублирование названия поля",empty:"пустой",expandAll:"Развернуть все",expandTitle:"Нажмите для раскрытия/скрытия поля (Ctrl+E)\nили Ctrl+Click для раскрытия/скрытия всех потомков.",formatTitle:"Форматирование JSON (Ctrl+I)",insert:"Вставить",insertTitle:"Вставить новое поле с типом 'авто' перед этим полем (Ctrl+Ins)",insertSub:"Выбрать тип поля для вставки",object:"Объект",ok:"ОК",redo:"Повторить (Ctrl+Shift+Z)",removeText:"Удалить",removeTitle:"Удалить выбранные поля (Ctrl+Del)",removeField:"Удалить поле (Ctrl+Del)",repairTitle:"Восстановите JSON: исправьте кавычки и escape-символы, удалите комментарии и нотацию JSONP, модифицируйте объекты JavaScript в JSON.",searchTitle:"Поиск",searchNextResultTitle:"Следующий результат (Enter)",searchPreviousResultTitle:"Предыдущий результат (Shift + Enter)",selectNode:"Выбор узла...",showAll:"показать все",showMore:"больше",showMoreStatus:"${visibleChilds} из ${totalChilds}",sort:"Сортировка",sortTitle:"Сортировка потомков типа ${type}",sortTitleShort:"Сортировка содержимого",sortFieldLabel:"Поле:",sortDirectionLabel:"Направление:",sortFieldTitle:"Выберите поле для сортировки массива или объекта",sortAscending:"По возрастанию",sortAscendingTitle:"Сортировка выбранного поря по возрастанию",sortDescending:"По убыванию",sortDescendingTitle:"Сортировка выбранного поря по убыванию",string:"Строка",transform:"Модификация",transformTitle:"Фильтрация, сортировка или модификация данных типа ${type}",transformTitleShort:"Фильтрация, сортировка или модификация данных",extract:"Извлечение",extractTitle:"Извлечь тип ${type}",transformQueryTitle:"Введите JMESpath запрос",transformWizardLabel:"Мастер",transformWizardFilter:"Фильтр",transformWizardSortBy:"Сортировка",transformWizardSelectFields:"Поля",transformQueryLabel:"Запрос",transformPreviewLabel:"Просмотр",type:"Тип",typeTitle:"Изменить тип этого поля",openUrl:"Ctrl+Click или Ctrl+Enter для открытия url в новом окне",undo:"Отменить (Ctrl+Z)",validationCannotMove:"Поле не может быть перемещено в потомка",autoType:"Тип поля автоматически определяется по значению и может быть строкой, числом, логическим значением или null.",objectType:"Объект содержит неупорядоченный набор пар ключ/значение.",arrayType:"Массив содержит упорядоченный набор значений.",stringType:"Тип поля не определяется из значения, но всегда возвращается как строка.",modeEditorTitle:"Переключение режима редактора",modeCodeText:"Код",modeCodeTitle:"Переключить в режим редактора кода",modeFormText:"Форма",modeFormTitle:"Переключить в режим формы",modeTextText:"Текст",modeTextTitle:"Переключить в режим редактора текста",modeTreeText:"Дерево",modeTreeTitle:"Переключить в режим редактора дерева",modeViewText:"Просмотр дерева",modeViewTitle:"Переключить в режим просмотра дерева",modePreviewText:"Просмотр",modePreviewTitle:"Переключить в режим просмотра",examples:"Примеры",default:"По умолчанию",containsInvalidProperties:"Содержит недопустимые свойства",containsInvalidItems:"Содержит недопустимые элементы"},ko:{array:"배열",auto:"자동",appendText:"추가",appendTitle:'선택한 요소 아래에 "자동" 요소를 추가합니다. (Ctrl + Shift + Ins)',appendSubmenuTitle:"추가할 요소의 유형을 선택해주세요.",appendTitleAuto:'"자동" 요소를 추가합니다. (Ctrl + Shift + Ins)',ascending:"오름차순",ascendingTitle:"선택한 ${type}의 하위 요소를 오름차순 정렬합니다.",actionsMenu:"메뉴 열기 (Ctrl + M)",cannotParseFieldError:"JSON의 요소를 해석할 수 없습니다.",cannotParseValueError:"JSON의 값을 해석할 수 없습니다.",collapseAll:"모두 접기",compactTitle:"모든 공백을 제거하여 JSON 데이터를 작게 만듭니다. (Ctrl + Shift + I)",descending:"내림차순",descendingTitle:"선택한 ${type}의 하위 요소를 내림차순으로 정렬",drag:"드래그하여 요소를 이동합니다. (Alt + Shift + Arrows)",duplicateKey:"복제키",duplicateText:"복제",duplicateTitle:"선택한 요소를 복제합니다. (Ctrl + D)",duplicateField:"선택한 요소를 복제합니다. (Ctrl + D)",duplicateFieldError:"요소 이름이 중복되었습니다.",empty:"비어있음",expandAll:"모두 열기",expandTitle:"클릭하여 요소를 열거나 닫습니다. (Ctrl + E) \nCtrl + Click으로 모든 하위 요소를 열거나 닫습니다.",formatTitle:"적절한 들여쓰기 및 줄바꿈으로 JSON 데이터를 정형화합니다. (Ctrl + I)",insert:"삽입",insertTitle:"선택한 요소 위에 새요소를 삽입합니다. (Ctrl + Ins)",insertSub:"삽입할 요소의 유형을 선택해주세요.",object:"객체",ok:"확인",redo:"다시 실행 (Ctrl + Shift + Z)",removeText:"삭제",removeTitle:"선택한 요소를 삭제합니다. (Ctrl + Del)",removeField:"선택한 요소를 삭제합니다. (Ctrl + Del)",repairTitle:"JSON 교정: JSON 내의 주석과 JSONP 표기법을 지우고 따옴표와 이스케이프 문자를 수정합니다.",searchTitle:"요소 또는 값 찾기",searchNextResultTitle:"다음으로 찾기 (Enter)",searchPreviousResultTitle:"이전으로 찾기 (Shift + Enter)",selectNode:"요소를 선택해주세요...",showAll:"모두보기",showMore:"더보기",showMoreStatus:"${totalChilds} 개의 항목 중 ${visibleChilds} 개를 표시합니다.",sort:"정렬",sortTitle:"선택한 ${type}의 하위 요소를 정렬합니다.",sortTitleShort:"정렬",sortFieldLabel:"요소:",sortDirectionLabel:"순서:",sortFieldTitle:"배열이나 객체를 정렬하는 요소를 선택해주세요.",sortAscending:"오름차순",sortAscendingTitle:"선택한 요소를 오름차순으로 정렬합니다.",sortDescending:"내림차순",sortDescendingTitle:"선택한 요소를 내림차순으로 정렬합니다.",string:"문자",transform:"변환",transformTitle:"선택한 ${type}의 하위 요소를 필터하거나 정렬 또는 변환합니다.",transformTitleShort:"내용을 필터하거나 정렬 또는 변환합니다.",extract:"추출",extractTitle:"선택한 ${type}의 값을 최상위에 위치시킵니다.",transformQueryTitle:"JMESPath 쿼리를 입력해주세요.",transformWizardLabel:"마법사",transformWizardFilter:"필터",transformWizardSortBy:"정렬",transformWizardSelectFields:"요소를 선택해주세요.",transformQueryLabel:"쿼리",transformPreviewLabel:"미리보기",type:"유형",typeTitle:"선택한 요소의 유형을 변경합니다.",openUrl:"Ctrl + Click 또는 Ctrl + Enter로 새 창에서 URL 열기",undo:"실행 취소 (Ctrl + Z)",validationCannotMove:"하위 요소로 이동할 수 없습니다.",autoType:"자동: 요소의 형식이 값의 유형으로 결정됩니다. 문자, 숫자, 부울, 또는 null만 허용됩니다.",objectType:"객체: 순서대로 나열되지 않은 이름/값 쌍으로 이루어진 집합입니다.",arrayType:"배열: 순서대로 나열된 값의 집합입니다.",stringType:"문자: 요소의 유형이 값에서 결정되지 않지만 항상 문자로 반환됩니다.",modeEditorTitle:"편집기 유형 변경",modeCodeText:"코드",modeCodeTitle:"형식 교정을 도와주는 기능이 포함된 문자 편집기",modeFormText:"입력 양식",modeFormTitle:"정해진 요소에 값을 입력하는 편집기",modeTextText:"문자",modeTextTitle:"단순 문자 편집기",modeTreeText:"트리",modeTreeTitle:"트리 구조로 표시되는 편집기",modeViewText:"보기",modeViewTitle:"읽기전용 트리 구조로 JSON을 표시",modePreviewText:"미리보기",modePreviewTitle:"읽기전용 문자로 JSON을 표시",examples:"예제",default:"기본값",containsInvalidProperties:"잘못된 속성이 포함되어 있습니다.",containsInvalidItems:"잘못된 항목이 포함되어 있습니다"}},o=Object.keys(n),r="en",s="undefined"!=typeof navigator?navigator.language||navigator.userLanguage:void 0,a=o.find((function(e){return e===s}))||r;function l(e){if(e){var t=o.find((function(t){return t===e}));t?a=t:console.error("Language not found")}}function c(e){if(e){var t=function(t){o.find((function(e){return e===t}))||o.push(t),n[t]=Object.assign({},n[r],n[t],e[t])};for(var i in e)t(i)}}function h(e,t,i){i||(i=a);var o=n[i][e]||n[r][e]||e;if(t)for(var s in t)o=o.replace("${"+s+"}",t[s]);return o}},359:function(e,t,i){"use strict";i.d(t,{V:function(){return s},e:function(){return a}});var n=i(9151),o=i.n(n),r=i(6237);function s(e,t){var i=t.sort,n=t.filter,o=t.projection,s="";if(n){var a="@"!==n.field?["0"].concat((0,r.parsePath)("."+n.field)):["0"],l="string"==typeof(0,r.get)(e,a)?n.value:(0,r.parseString)(n.value);s+="[? "+n.field+" "+n.relation+" `"+JSON.stringify(l)+"`]"}else s+=Array.isArray(e)?"[*]":"@";return i&&("desc"===i.direction?s+=" | reverse(sort_by(@, &"+i.field+"))":s+=" | sort_by(@, &"+i.field+")"),o&&("]"!==s[s.length-1]&&(s+=" | [*]"),1===o.fields.length?s+="."+o.fields[0]:o.fields.length>1&&(s+=".{"+o.fields.map((function(e){var t=e.split(".");return t[t.length-1]+": "+e})).join(", ")+"}")),s}function a(e,t){return o().search(e,t)}},1081:function(){"undefined"!=typeof Element&&function(){function e(e){if(void 0!==e){if("remove"in e)return;Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){void 0!==this.parentNode&&this.parentNode.removeChild(this)}})}}void 0!==window.Element&&e(window.Element.prototype),void 0!==window.CharacterData&&e(window.CharacterData.prototype),void 0!==window.DocumentType&&e(window.DocumentType.prototype)}(),Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){for(var t=0;t<this.length;t++){var i=this[t];if(e.call(this,i,t,this))return t}return-1},configurable:!0,writable:!0}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){return this[this.findIndex(e)]},configurable:!0,writable:!0}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})},7483:function(e,t,i){"use strict";i.r(t),i.d(t,{previewModeMixins:function(){return I}});var n=i(9857),o=i(660),r=i(2115),s=i(2877);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function l(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c(n.key),n)}}function c(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:String(t)}var h=function(){function e(t,i,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onChange=t,this.calculateItemSize=i||function(){return 1},this.limit=n,this.items=[],this.index=-1}var t,i,n;return t=e,(i=[{key:"add",value:function(e){for(;this._calculateHistorySize()>this.limit&&this.items.length>1;)this.items.shift(),this.index--;this.items=this.items.slice(0,this.index+1),this.items.push(e),this.index++,this.onChange()}},{key:"_calculateHistorySize",value:function(){var e=this.calculateItemSize,t=0;return this.items.forEach((function(i){t+=e(i)})),t}},{key:"undo",value:function(){if(this.canUndo())return this.index--,this.onChange(),this.items[this.index]}},{key:"redo",value:function(){if(this.canRedo())return this.index++,this.onChange(),this.items[this.index]}},{key:"canUndo",value:function(){return this.index>0}},{key:"canRedo",value:function(){return this.index<this.items.length-1}},{key:"clear",value:function(){this.items=[],this.index=-1,this.onChange()}}])&&l(t.prototype,i),n&&l(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),d=i(3057),u=i(359),g=i(1389),p=i(2915),m=i(5609),f=i(1948),v=i(6237),C=f.textModeMixins[0].mixin,y={create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===t.statusBar&&(t.statusBar=!0),t.mainMenuBar=!1!==t.mainMenuBar,t.enableSort=!1!==t.enableSort,t.enableTransform=!1!==t.enableTransform,t.createQuery=t.createQuery||u.V,t.executeQuery=t.executeQuery||u.e,this.options=t,"number"==typeof t.indentation?this.indentation=Number(t.indentation):this.indentation=2,(0,d.AI)(this.options.languages),(0,d.xC)(this.options.language),this.mode="preview";var i=this;this.container=e,this.dom={},this.json=void 0,this.text="",this._debouncedValidate=(0,v.debounce)(this.validate.bind(this),this.DEBOUNCE_INTERVAL),this.width=e.clientWidth,this.height=e.clientHeight,this.frame=document.createElement("div"),this.frame.className="jsoneditor jsoneditor-mode-preview",this.frame.onclick=function(e){e.preventDefault()};var n={target:this.frame,onFocus:this.options.onFocus||null,onBlur:this.options.onBlur||null};if(this.frameFocusTracker=new s.$(n),this.content=document.createElement("div"),this.content.className="jsoneditor-outer",this.dom.busy=document.createElement("div"),this.dom.busy.className="jsoneditor-busy",this.dom.busyContent=document.createElement("span"),this.dom.busyContent.textContent="busy...",this.dom.busy.appendChild(this.dom.busyContent),this.content.appendChild(this.dom.busy),this.dom.previewContent=document.createElement("pre"),this.dom.previewContent.className="jsoneditor-preview",this.dom.previewText=document.createTextNode(""),this.dom.previewContent.appendChild(this.dom.previewText),this.content.appendChild(this.dom.previewContent),this.options.mainMenuBar){(0,v.addClassName)(this.content,"has-main-menu-bar"),this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu);var a=document.createElement("button");a.type="button",a.className="jsoneditor-format",a.title=(0,d.Tl)("formatTitle"),this.menu.appendChild(a),a.onclick=function(){i.executeWithBusyMessage((function(){try{i.format()}catch(e){i._onError(e)}}),"formatting...")};var l=document.createElement("button");if(l.type="button",l.className="jsoneditor-compact",l.title=(0,d.Tl)("compactTitle"),this.menu.appendChild(l),l.onclick=function(){i.executeWithBusyMessage((function(){try{i.compact()}catch(e){i._onError(e)}}),"compacting...")},this.options.enableSort){var c=document.createElement("button");c.type="button",c.className="jsoneditor-sort",c.title=(0,d.Tl)("sortTitleShort"),c.onclick=function(){i._showSortModal()},this.menu.appendChild(c)}if(this.options.enableTransform){var p=document.createElement("button");p.type="button",p.title=(0,d.Tl)("transformTitleShort"),p.className="jsoneditor-transform",p.onclick=function(){i._showTransformModal()},this.dom.transform=p,this.menu.appendChild(p)}var m=document.createElement("button");if(m.type="button",m.className="jsoneditor-repair",m.title=(0,d.Tl)("repairTitle"),this.menu.appendChild(m),m.onclick=function(){void 0===i.json&&i.executeWithBusyMessage((function(){try{i.repair()}catch(e){i._onError(e)}}),"repairing...")},!1!==this.options.history){this.history=new h((function(){i.dom.undo.disabled=!i.history.canUndo(),i.dom.redo.disabled=!i.history.canRedo()}),(function(e){return 2*e.text.length}),o.SC);var f=document.createElement("button");f.type="button",f.className="jsoneditor-undo jsoneditor-separator",f.title=(0,d.Tl)("undo"),f.onclick=function(){var e=i.history.undo();e&&i._applyHistory(e)},this.menu.appendChild(f),this.dom.undo=f;var C=document.createElement("button");C.type="button",C.className="jsoneditor-redo",C.title=(0,d.Tl)("redo"),C.onclick=function(){var e=i.history.redo();e&&i._applyHistory(e)},this.menu.appendChild(C),this.dom.redo=C,this.history.onChange()}this.options&&this.options.modes&&this.options.modes.length&&(this.modeSwitcher=new g.n(this.menu,this.options.modes,this.options.mode,(function(e){try{i.setMode(e),i.modeSwitcher.focus()}catch(e){i._onError(e)}})))}var y=Array.isArray(this.options.showErrorTable)?this.options.showErrorTable.includes(this.mode):!0===this.options.showErrorTable;if(this.errorTable=new r.N({errorTableVisible:y,onToggleVisibility:function(){i.validate()},onFocusLine:null,onChangeHeight:function(e){var t=e+(i.dom.statusBar?i.dom.statusBar.clientHeight:0)+1;i.content.style.marginBottom=-t+"px",i.content.style.paddingBottom=t+"px"}}),this.frame.appendChild(this.content),this.frame.appendChild(this.errorTable.getErrorTable()),this.container.appendChild(this.frame),t.statusBar){(0,v.addClassName)(this.content,"has-status-bar");var I=document.createElement("div");this.dom.statusBar=I,I.className="jsoneditor-statusbar",this.frame.appendChild(I),this.dom.fileSizeInfo=document.createElement("span"),this.dom.fileSizeInfo.className="jsoneditor-size-info",this.dom.fileSizeInfo.innerText="",I.appendChild(this.dom.fileSizeInfo),this.dom.arrayInfo=document.createElement("span"),this.dom.arrayInfo.className="jsoneditor-size-info",this.dom.arrayInfo.innerText="",I.appendChild(this.dom.arrayInfo),I.appendChild(this.errorTable.getErrorCounter()),I.appendChild(this.errorTable.getWarningIcon()),I.appendChild(this.errorTable.getErrorIcon())}this._renderPreview(),this.setSchema(this.options.schema,this.options.schemaRefs)},_renderPreview:function(){var e=this.getText();this.dom.previewText.nodeValue=(0,v.limitCharacters)(e,o.hJ),this.dom.fileSizeInfo&&(this.dom.fileSizeInfo.innerText="Size: "+(0,v.formatSize)(e.length)),this.dom.arrayInfo&&(Array.isArray(this.json)?this.dom.arrayInfo.innerText="Array: "+this.json.length+" items":this.dom.arrayInfo.innerText="")},_onChange:function(){if(this._debouncedValidate(),this.options.onChange)try{this.options.onChange()}catch(e){console.error("Error in onChange callback: ",e)}if(this.options.onChangeJSON)try{this.options.onChangeJSON(this.get())}catch(e){console.error("Error in onChangeJSON callback: ",e)}if(this.options.onChangeText)try{this.options.onChangeText(this.getText())}catch(e){console.error("Error in onChangeText callback: ",e)}},_showSortModal:function(){var e=this;this.executeWithBusyMessage((function(){var t=e.options.modalAnchor||o.ai,i=e.get();e._renderPreview(),(0,p.showSortModal)(t,i,(function(t){e.executeWithBusyMessage((function(){!function(t,i){if(Array.isArray(t)){var n=(0,v.sort)(t,i.path,i.direction);e.sortedBy=i,e._setAndFireOnChange(n)}if((0,v.isObject)(t)){var o=(0,v.sortObjectKeys)(t,i.direction);e.sortedBy=i,e._setAndFireOnChange(o)}}(i,t)}),"sorting...")}),e.sortedBy)}),"parsing...")},_showTransformModal:function(){var e=this;this.executeWithBusyMessage((function(){var t=e.options,i=t.createQuery,n=t.executeQuery,r=t.modalAnchor,s=t.queryDescription,a=e.get();e._renderPreview(),(0,m.showTransformModal)({container:r||o.ai,json:a,queryDescription:s,createQuery:i,executeQuery:n,onTransform:function(t){e.executeWithBusyMessage((function(){var i=n(a,t);e._setAndFireOnChange(i)}),"transforming...")}})}),"parsing...")},destroy:function(){this.frame&&this.container&&this.frame.parentNode===this.container&&this.container.removeChild(this.frame),this.modeSwitcher&&(this.modeSwitcher.destroy(),this.modeSwitcher=null),this._debouncedValidate=null,this.history&&(this.history.clear(),this.history=null),this.frameFocusTracker.destroy()},compact:function(){var e=this.get(),t=JSON.stringify(e);this._setTextAndFireOnChange(t,e)},format:function(){var e=this.get(),t=JSON.stringify(e,null,this.indentation);this._setTextAndFireOnChange(t,e)},repair:function(){var e=this.getText();try{var t=(0,n.m)(e);this._setTextAndFireOnChange(t)}catch(e){}},focus:function(){this.dom.transform.focus()},set:function(e){this.history&&this.history.clear(),this._set(e)},update:function(e){this._set(e)},_set:function(e){this.text=void 0,this.json=e,this._renderPreview(),this._pushHistory(),this._debouncedValidate()},_setAndFireOnChange:function(e){this._set(e),this._onChange()},get:function(){if(void 0===this.json){var e=this.getText();this.json=(0,v.parse)(e)}return this.json},getText:function(){return void 0===this.text&&(this.text=JSON.stringify(this.json,null,this.indentation),!0===this.options.escapeUnicode&&(this.text=(0,v.escapeUnicodeChars)(this.text))),this.text},setText:function(e){this.history&&this.history.clear(),this._setText(e)},updateText:function(e){this.getText()!==e&&this._setText(e)},_setText:function(e,t){if(!0===this.options.escapeUnicode?this.text=(0,v.escapeUnicodeChars)(e):this.text=e,this.json=t,this._renderPreview(),void 0===this.json){var i=this;this.executeWithBusyMessage((function(){try{i.json=i.get(),i._renderPreview(),i._pushHistory()}catch(e){}}),"parsing...")}else this._pushHistory();this._debouncedValidate()},_setTextAndFireOnChange:function(e,t){this._setText(e,t),this._onChange()},_applyHistory:function(e){this.json=e.json,this.text=e.text,this._renderPreview(),this._debouncedValidate()},_pushHistory:function(){if(this.history){var e={text:this.text,json:this.json};this.history.add(e)}},executeWithBusyMessage:function(e,t){if(this.getText().length>o.Oq){var i=this;(0,v.addClassName)(i.frame,"busy"),i.dom.busyContent.innerText=t,setTimeout((function(){e(),(0,v.removeClassName)(i.frame,"busy"),i.dom.busyContent.innerText=""}),100)}else e()}};y.validate=C.validate,y._renderErrors=C._renderErrors;var I=[{mode:"preview",mixin:y,data:"json"}]},2915:function(e,t,i){"use strict";i.r(t),i.d(t,{showSortModal:function(){return a}});var n=i(8340),o=i.n(n),r=i(3057),s=i(6237);function a(e,t,i,n){var a=Array.isArray(t)?(0,s.getChildPaths)(t):[""],l=n&&n.path&&(0,s.contains)(a,n.path)?n.path:a[0],c=n&&n.direction||"asc",h='<div class="pico-modal-contents"><div class="pico-modal-header">'+(0,r.Tl)("sort")+"</div><form><table><tbody><tr> <td>"+(0,r.Tl)("sortFieldLabel")+' </td> <td class="jsoneditor-modal-input"> <div class="jsoneditor-select-wrapper"> <select id="field" title="'+(0,r.Tl)("sortFieldTitle")+'"> </select> </div> </td></tr><tr> <td>'+(0,r.Tl)("sortDirectionLabel")+' </td> <td class="jsoneditor-modal-input"> <div id="direction" class="jsoneditor-button-group"><input type="button" value="'+(0,r.Tl)("sortAscending")+'" title="'+(0,r.Tl)("sortAscendingTitle")+'" data-value="asc" class="jsoneditor-button-first jsoneditor-button-asc"/><input type="button" value="'+(0,r.Tl)("sortDescending")+'" title="'+(0,r.Tl)("sortDescendingTitle")+'" data-value="desc" class="jsoneditor-button-last jsoneditor-button-desc"/> </div> </td></tr><tr><td colspan="2" class="jsoneditor-modal-input jsoneditor-modal-actions"> <input type="submit" id="ok" value="'+(0,r.Tl)("ok")+'" /></td></tr></tbody></table></form></div>';o()({parent:e,content:h,overlayClass:"jsoneditor-modal-overlay",overlayStyles:{backgroundColor:"rgb(1,1,1)",opacity:.3},modalClass:"jsoneditor-modal jsoneditor-modal-sort"}).afterCreate((function(e){var t=e.modalElem().querySelector("form"),n=e.modalElem().querySelector("#ok"),o=e.modalElem().querySelector("#field"),r=e.modalElem().querySelector("#direction");function s(e){r.value=e,r.className="jsoneditor-button-group jsoneditor-button-group-value-"+r.value}a.forEach((function(e){var t=document.createElement("option");t.text=function(e){return""===e?"@":"."===e[0]?e.slice(1):e}(e),t.value=e,o.appendChild(t)})),o.value=l||a[0],s(c||"asc"),r.onclick=function(e){s(e.target.getAttribute("data-value"))},n.onclick=function(t){t.preventDefault(),t.stopPropagation(),e.close(),i({path:o.value,direction:r.value})},t&&(t.onsubmit=n.onclick)})).afterClose((function(e){e.destroy()})).show()}},5609:function(e,t,i){"use strict";i.r(t),i.d(t,{showTransformModal:function(){return m}});var n=i(8340),o=i.n(n),r=i(4772),s=i.n(r),a=i(3057);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e,t,i,n){return"boolean"==typeof e||e instanceof Boolean||null===e||"number"==typeof e||e instanceof Number||"string"==typeof e||e instanceof String||e instanceof Date?JSON.stringify(e):Array.isArray(e)?function(e,t,i,n){for(var o=t?i+t:void 0,r=t?"[\n":"[",s=0;s<e.length;s++){var a=e[s];if(t&&(r+=o),r+=void 0!==a&&"function"!=typeof a?c(a,t,o,n):"null",s<e.length-1&&(r+=t?",\n":","),r.length>n)return r+"..."}return r+=t?"\n"+i+"]":"]"}(e,t,i,n):e&&"object"===l(e)?function(e,t,i,n){var o=t?i+t:void 0,r=!0,s=t?"{\n":"{";if("function"==typeof e.toJSON)return c(e.toJSON(),t,i,n);for(var a in e)if(d(e,a)&&(r?r=!1:s+=t?",\n":",",s+=t?o+'"'+a+'": ':'"'+a+'":',(s+=c(e[a],t,o,n)).length>n))return s+"...";return s+=t?"\n"+i+"}":"}"}(e,t,i,n):void 0}function h(e,t){for(var i="";t-- >0;)i+=e;return i}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var u=i(6237),g=i(660),p='Enter a <a href="http://jmespath.org" target="_blank">JMESPath</a> query to filter, sort, or transform the JSON data.<br/>To learn JMESPath, go to <a href="http://jmespath.org/tutorial.html" target="_blank">the interactive tutorial</a>.';function m(e){var t=e.container,i=e.json,n=e.queryDescription,r=void 0===n?p:n,l=e.createQuery,d=e.executeQuery,m=e.onTransform,f=i,v='<label class="pico-modal-contents"><div class="pico-modal-header">'+(0,a.Tl)("transform")+"</div><p>"+r+'</p><div class="jsoneditor-jmespath-label">'+(0,a.Tl)("transformWizardLabel")+' </div><div id="wizard" class="jsoneditor-jmespath-block jsoneditor-jmespath-wizard"> <table class="jsoneditor-jmespath-wizard-table"> <tbody> <tr> <th>'+(0,a.Tl)("transformWizardFilter")+'</th> <td class="jsoneditor-jmespath-filter"> <div class="jsoneditor-inline jsoneditor-jmespath-filter-field" > <select id="filterField"> </select> </div> <div class="jsoneditor-inline jsoneditor-jmespath-filter-relation" > <select id="filterRelation"> <option value="==">==</option> <option value="!=">!=</option> <option value="<"><</option> <option value="<="><=</option> <option value=">">></option> <option value=">=">>=</option> </select> </div> <div class="jsoneditor-inline jsoneditor-jmespath-filter-value" > <input type="text" class="value" placeholder="value..." id="filterValue" /> </div> </td> </tr> <tr> <th>'+(0,a.Tl)("transformWizardSortBy")+'</th> <td class="jsoneditor-jmespath-filter"> <div class="jsoneditor-inline jsoneditor-jmespath-sort-field"> <select id="sortField"> </select> </div> <div class="jsoneditor-inline jsoneditor-jmespath-sort-order" > <select id="sortOrder"> <option value="asc">Ascending</option> <option value="desc">Descending</option> </select> </div> </td> </tr> <tr id="selectFieldsPart"> <th>'+(0,a.Tl)("transformWizardSelectFields")+'</th> <td class="jsoneditor-jmespath-filter"> <select class="jsoneditor-jmespath-select-fields" id="selectFields" multiple></select> </td> </tr> </tbody> </table></div><div class="jsoneditor-jmespath-label">'+(0,a.Tl)("transformQueryLabel")+' </div><div class="jsoneditor-jmespath-block"> <textarea id="query" rows="4" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" title="'+(0,a.Tl)("transformQueryTitle")+'">[*]</textarea></div><div class="jsoneditor-jmespath-label">'+(0,a.Tl)("transformPreviewLabel")+' </div><div class="jsoneditor-jmespath-block"> <textarea id="preview" class="jsoneditor-transform-preview" readonly> </textarea></div><div class="jsoneditor-jmespath-block jsoneditor-modal-actions"> <input type="submit" id="ok" value="'+(0,a.Tl)("ok")+'" autofocus /></div></div>';o()({parent:t,content:v,overlayClass:"jsoneditor-modal-overlay",overlayStyles:{backgroundColor:"rgb(1,1,1)",opacity:.3},modalClass:"jsoneditor-modal jsoneditor-modal-transform",focus:!1}).afterCreate((function(e){var t=e.modalElem(),n=t.querySelector("#wizard"),o=t.querySelector("#ok"),r=t.querySelector("#filterField"),a=t.querySelector("#filterRelation"),p=t.querySelector("#filterValue"),v=t.querySelector("#sortField"),C=t.querySelector("#sortOrder"),y=t.querySelector("#selectFields"),I=t.querySelector("#query"),b=t.querySelector("#preview");Array.isArray(f)||(n.style.fontStyle="italic",n.textContent="(wizard not available for objects, only for arrays)"),(0,u.getChildPaths)(i).forEach((function(e){var t=R(e),i=document.createElement("option");i.text=t,i.value=t,r.appendChild(i);var n=document.createElement("option");n.text=t,n.value=t,v.appendChild(n)}));var A=(0,u.getChildPaths)(i,!0).filter((function(e){return""!==e}));if(A.length>0)A.forEach((function(e){var t=R(e),i=document.createElement("option");i.text=t,i.value=t,y.appendChild(i)}));else{var w=t.querySelector("#selectFieldsPart");w&&(w.style.display="none")}var S=new(s())(r,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"field..."}),x=new(s())(a,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"compare..."}),k=new(s())(v,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"field..."}),T=new(s())(C,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"order..."}),E=new(s())(y,{multiple:!0,clearable:!0,defaultSelected:!1,placeholder:"select fields..."});function R(e){return""===e?"@":"."===e[0]?e.slice(1):e}S.on("selectr.change",L),x.on("selectr.change",L),p.oninput=L,k.on("selectr.change",L),T.on("selectr.change",L),E.on("selectr.change",L),t.querySelector(".pico-modal-contents").onclick=function(e){"A"!==e.target.nodeName&&e.preventDefault()};var _=(0,u.debounce)((function(){try{var e=d(f,I.value);b.className="jsoneditor-transform-preview",b.value=function(e,t,i){var n;"number"==typeof t?t>10?n=h(" ",10):t>=1&&(n=h(" ",t)):"string"==typeof t&&""!==t&&(n=t);var o=c(e,n,"",i);return o.length>i?function(e,t){return"number"==typeof t?e.slice(0,t):e}(o,i)+"...":o}(e,2,g.hJ),o.disabled=!1}catch(e){b.className="jsoneditor-transform-preview jsoneditor-error",b.value=e.toString(),o.disabled=!0}}),300);function $(e,t){try{I.value=l(e,t),o.disabled=!1,_()}catch(e){var i='Error: an error happened when executing "createQuery": '+(e.message||e.toString());I.value="",o.disabled=!0,b.className="jsoneditor-transform-preview jsoneditor-error",b.value=i}}function L(){var e={};if(r.value&&a.value&&p.value&&(e.filter={field:r.value,relation:a.value,value:p.value}),v.value&&C.value&&(e.sort={field:v.value,direction:C.value}),y.value){for(var t=[],n=0;n<y.options.length;n++)if(y.options[n].selected){var o=y.options[n].value;t.push(o)}e.projection={fields:t}}$(i,e)}I.oninput=_,o.onclick=function(t){t.preventDefault(),t.stopPropagation(),e.close(),m(I.value)},$(i,{}),setTimeout((function(){I.select(),I.focus(),I.selectionStart=3,I.selectionEnd=3}))})).afterClose((function(e){e.destroy()})).show()}},1948:function(e,t,i){"use strict";i.r(t),i.d(t,{textModeMixins:function(){return x}});var n=i(9857),o=i(7413),r=i.n(o),s=i(660),a=i(2115),l=i(2877),c=i(3057),h=i(359),d=i(1389),u=i(2915),g=i(5609),p=i(5467),m=i(3094),f=i(6237);function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function C(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y(n.key),n)}}function y(e){var t=function(e,t){if("object"!=v(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==v(t)?t:String(t)}var I=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schema=t,this.schemaRefs=i||{},this.suggestions={},this.suggestionsRefs={},this._buildSuggestions()}var t,i,n;return t=e,(i=[{key:"_buildSuggestions",value:function(){for(var e in this._handleSchemaEntry("",this.schema,this.suggestions),this.schemaRefs)this.suggestionsRefs[e]={},this._handleSchemaEntry("",this.schemaRefs[e],this.suggestionsRefs[e])}},{key:"_handleRef",value:function(e,t,i){i[e]=i[e]||{},i[e].refs=i[e].refs||[],i[e].refs=(0,f.uniqueMergeArrays)(i[e].refs,[t])}},{key:"_handleSchemaEntry",value:function(e,t,i){if(t)if(t.$ref)this._handleRef(e,t.$ref,i);else{var n=this._checkOfConditon(t);if(n)this._handleOfCondition(e,t[n],i);else switch(t.type){case"object":this._handleObject(e,t,i);break;case"string":case"number":case"integer":this._handlePrimitive(e,t,i);break;case"boolean":this._handleBoolean(e,t,i);break;case"array":this._handleArray(e,t,i)}}else console.error("SchemaTextCompleter: schema node is missing for path",e)}},{key:"_handleObject",value:function(e,t,i){var n=this;if((0,f.isObject)(t.properties)){var o=Object.keys(t.properties);i[e]=i[e]||{},i[e].props=i[e].props||[],i[e].props=(0,f.uniqueMergeArrays)(i[e].props,o),o.forEach((function(o){(0,f.asyncExec)((function(){n._handleSchemaEntry("".concat(e,"/").concat(o),t.properties[o],i)}))}))}}},{key:"_handlePrimitive",value:function(e,t,i){i[e]=i[e]||{},(0,f.isArray)(t.examples)&&(i[e].examples=i[e].examples||[],i[e].examples=(0,f.uniqueMergeArrays)(i[e].examples,t.examples)),(0,f.isArray)(t.enum)&&(i[e].enum=i[e].enum||[],i[e].enum=(0,f.uniqueMergeArrays)(i[e].enum,t.enum))}},{key:"_handleBoolean",value:function(e,t,i){i[e]||(i[e]={bool:[!0,!1]})}},{key:"_handleArray",value:function(e,t,i){var n=this;t.items&&(0,f.asyncExec)((function(){n._handleSchemaEntry("".concat(e,"/\\d+"),t.items,i)}))}},{key:"_handleOfCondition",value:function(e,t,i){var n=this;t&&t.length&&t.forEach((function(t){(0,f.asyncExec)((function(){n._handleSchemaEntry(e,t,i)}))}))}},{key:"_checkOfConditon",value:function(e){if(e)return e.oneOf?"oneOf":e.anyOf?"anyOf":e.allOf?"allOf":void 0}},{key:"getCompletions",value:function(e,t,i,n,o){var r=this;try{var s=m.parse(t.getValue()).pointers||{};Object.keys(s).forEach((function(e){(0,f.asyncExec)((function(){var t,n,a,l,c,h,d,u,g;if((null===(t=s[e].key)||void 0===t?void 0:t.line)===i.row&&i.column>=s[e].key.column&&i.column<=s[e].keyEnd.column&&(c=e.slice(0,e.lastIndexOf("/"))),(null===(n=s[e].value)||void 0===n?void 0:n.line)===i.row&&(null===(a=s[e].value)||void 0===a?void 0:a.line)===(null===(l=s[e].valueEnd)||void 0===l?void 0:l.line)&&i.column>=s[e].value.column&&i.column<=s[e].valueEnd.column&&(c=e),c){var p=function e(t,i,n){var o=Object.keys(i).reduce((function(e,i){return new RegExp("^".concat(n).concat(i)).test(t)&&(!e||e.length<i.length)?i:e}),null);if("string"==typeof o){var s;if(null!==(s=i[o])&&void 0!==s&&null!==(s=s.refs)&&void 0!==s&&s.length){var a={};for(var l in i[o].refs){var c=i[o].refs[l];if(r.suggestionsRefs[c]){var h=e(t,r.suggestionsRefs[c],"".concat(n).concat(o));null!=h&&h.enum&&(a.enum=(0,f.uniqueMergeArrays)(a.enum,h.enum)),null!=h&&h.examples&&(a.examples=(0,f.uniqueMergeArrays)(a.examples,h.examples)),null!=h&&h.bool&&(a.bool=(0,f.uniqueMergeArrays)(a.bool,h.bool)),null!=h&&h.props&&(a.props=(0,f.uniqueMergeArrays)(a.props,h.props))}}return a}if(new RegExp("^".concat(n).concat(o,"$")).test(t))return i[o]}}(c,r.suggestions,"");h=p,d=[],u=0,(g=function(e){var t,i={props:"property",enum:"enum",bool:"boolean",examples:"examples"};h&&null!==(t=h[e])&&void 0!==t&&t.length&&(d=d.concat(h[e].map((function(t){return{caption:t+"",meta:"schema [".concat(i[e],"]"),score:u++,value:t+""}}))))})("props"),g("enum"),g("bool"),g("examples"),d.length&&o(null,d)}}))}))}catch(e){}}}])&&C(t.prototype,i),n&&C(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}var A={},w="ace/theme/jsoneditor";function S(){try{this.format()}catch(e){}}A.create=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===i.statusBar&&(i.statusBar=!0),i.mainMenuBar=!1!==i.mainMenuBar,i.enableSort=!1!==i.enableSort,i.enableTransform=!1!==i.enableTransform,i.createQuery=i.createQuery||h.V,i.executeQuery=i.executeQuery||h.e,i.showErrorTable=void 0!==i.showErrorTable?i.showErrorTable:["text","preview"],this.options=i,"number"==typeof i.indentation?this.indentation=Number(i.indentation):this.indentation=2,(0,c.AI)(this.options.languages),(0,c.xC)(this.options.language);var n=i.ace?i.ace:r();this.mode="code"===i.mode?"code":"text","code"===this.mode&&void 0===n&&(this.mode="text",console.warn("Failed to load Ace editor, falling back to plain text mode. Please use a JSONEditor bundle including Ace, or pass Ace as via the configuration option `ace`.")),this.theme=i.theme||w,this.theme===w&&n&&(0,p.J)(),i.onTextSelectionChange&&this.onTextSelectionChange(i.onTextSelectionChange);var o=this;this.container=e,this.dom={},this.aceEditor=void 0,this.textarea=void 0,this.validateSchema=null,this.annotations=[],this.lastSchemaErrors=void 0,this._debouncedValidate=(0,f.debounce)(this._validateAndCatch.bind(this),this.DEBOUNCE_INTERVAL),this.width=e.clientWidth,this.height=e.clientHeight,this.frame=document.createElement("div"),this.frame.className="jsoneditor jsoneditor-mode-"+this.options.mode,this.frame.onclick=function(e){e.preventDefault()},this.frame.onkeydown=function(e){o._onKeyDown(e)};var s={target:this.frame,onFocus:this.options.onFocus||null,onBlur:this.options.onBlur||null};if(this.frameFocusTracker=new l.$(s),this.content=document.createElement("div"),this.content.className="jsoneditor-outer",this.options.mainMenuBar){(0,f.addClassName)(this.content,"has-main-menu-bar"),this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu);var u=document.createElement("button");u.type="button",u.className="jsoneditor-format",u.title=(0,c.Tl)("formatTitle"),this.menu.appendChild(u),u.onclick=function(){try{o.format(),o._onChange()}catch(e){o._onError(e)}};var g=document.createElement("button");if(g.type="button",g.className="jsoneditor-compact",g.title=(0,c.Tl)("compactTitle"),this.menu.appendChild(g),g.onclick=function(){try{o.compact(),o._onChange()}catch(e){o._onError(e)}},this.options.enableSort){var m=document.createElement("button");m.type="button",m.className="jsoneditor-sort",m.title=(0,c.Tl)("sortTitleShort"),m.onclick=function(){o._showSortModal()},this.menu.appendChild(m)}if(this.options.enableTransform){var v=document.createElement("button");v.type="button",v.title=(0,c.Tl)("transformTitleShort"),v.className="jsoneditor-transform",v.onclick=function(){o._showTransformModal()},this.menu.appendChild(v)}var C=document.createElement("button");if(C.type="button",C.className="jsoneditor-repair",C.title=(0,c.Tl)("repairTitle"),this.menu.appendChild(C),C.onclick=function(){try{o.repair(),o._onChange()}catch(e){o._onError(e)}},"code"===this.mode){var y=document.createElement("button");y.type="button",y.className="jsoneditor-undo jsoneditor-separator",y.title=(0,c.Tl)("undo"),y.onclick=function(){t.aceEditor.getSession().getUndoManager().undo()},this.menu.appendChild(y),this.dom.undo=y;var I=document.createElement("button");I.type="button",I.className="jsoneditor-redo",I.title=(0,c.Tl)("redo"),I.onclick=function(){t.aceEditor.getSession().getUndoManager().redo()},this.menu.appendChild(I),this.dom.redo=I}if(this.options&&this.options.modes&&this.options.modes.length&&(this.modeSwitcher=new d.n(this.menu,this.options.modes,this.options.mode,(function(e){try{o.setMode(e),o.modeSwitcher.focus()}catch(e){o._onError(e)}}))),"code"===this.mode){var A=document.createElement("a");A.appendChild(document.createTextNode("powered by ace")),A.href="https://ace.c9.io/",A.target="_blank",A.className="jsoneditor-poweredBy",A.onclick=function(){window.open(A.href,A.target,"noreferrer")},this.menu.appendChild(A)}}var S=this.options.onEditable&&b("function"===this.options.onEditable)&&!this.options.onEditable({});if(this.frame.appendChild(this.content),this.container.appendChild(this.frame),"code"===this.mode){this.editorDom=document.createElement("div"),this.editorDom.style.height="100%",this.editorDom.style.width="100%",this.content.appendChild(this.editorDom);var x=n.edit(this.editorDom),k=x.getSession();x.$blockScrolling=1/0,x.setTheme(this.theme),x.setOptions({readOnly:S}),x.setShowPrintMargin(!1),x.setFontSize("14px"),k.setMode("ace/mode/json"),k.setTabSize(this.indentation),k.setUseSoftTabs(!0),k.setUseWrapMode(!0);var T=k.setAnnotations;k.setAnnotations=function(e){T.call(this,e&&e.length?e:o.annotations)},x.commands.bindKey("Ctrl-L",null),x.commands.bindKey("Command-L",null),x.commands.bindKey("Ctrl-\\",null),x.commands.bindKey("Command-\\",null),x.commands.bindKey("Ctrl-Shift-\\",null),x.commands.bindKey("Command-Shift-\\",null),this.aceEditor=x,x.on("change",this._onChange.bind(this)),x.on("changeSelection",this._onSelect.bind(this))}else{var E=document.createElement("textarea");E.className="jsoneditor-text",E.spellcheck=!1,this.content.appendChild(E),this.textarea=E,this.textarea.readOnly=S,null===this.textarea.oninput?this.textarea.oninput=this._onChange.bind(this):this.textarea.onchange=this._onChange.bind(this),E.onselect=this._onSelect.bind(this),E.onmousedown=this._onMouseDown.bind(this),E.onblur=this._onBlur.bind(this)}this._updateHistoryButtons();var R=Array.isArray(this.options.showErrorTable)?this.options.showErrorTable.includes(this.mode):!0===this.options.showErrorTable;if(this.errorTable=new a.N({errorTableVisible:R,onToggleVisibility:function(){o._validateAndCatch()},onFocusLine:function(e){o.isFocused=!0,isNaN(e)||o.setTextSelection({row:e,column:1},{row:e,column:1e3})},onChangeHeight:function(e){var t=e+(o.dom.statusBar?o.dom.statusBar.clientHeight:0)+1;o.content.style.marginBottom=-t+"px",o.content.style.paddingBottom=t+"px"}}),this.frame.appendChild(this.errorTable.getErrorTable()),i.statusBar){(0,f.addClassName)(this.content,"has-status-bar"),this.curserInfoElements={};var _=document.createElement("div");this.dom.statusBar=_,_.className="jsoneditor-statusbar",this.frame.appendChild(_);var $=document.createElement("span");$.className="jsoneditor-curserinfo-label",$.innerText="Ln:";var L=document.createElement("span");L.className="jsoneditor-curserinfo-val",L.innerText="1",_.appendChild($),_.appendChild(L);var N=document.createElement("span");N.className="jsoneditor-curserinfo-label",N.innerText="Col:";var M=document.createElement("span");M.className="jsoneditor-curserinfo-val",M.innerText="1",_.appendChild(N),_.appendChild(M),this.curserInfoElements.colVal=M,this.curserInfoElements.lnVal=L;var B=document.createElement("span");B.className="jsoneditor-curserinfo-label",B.innerText="characters selected",B.style.display="none";var W=document.createElement("span");W.className="jsoneditor-curserinfo-count",W.innerText="0",W.style.display="none",this.curserInfoElements.countLabel=B,this.curserInfoElements.countVal=W,_.appendChild(W),_.appendChild(B),_.appendChild(this.errorTable.getErrorCounter()),_.appendChild(this.errorTable.getWarningIcon()),_.appendChild(this.errorTable.getErrorIcon())}this.setSchema(this.options.schema,this.options.schemaRefs)},A._onSchemaChange=function(e,t){this.aceEditor&&(this.options.allowSchemaSuggestions&&e?(this.aceEditor.setOption("enableBasicAutocompletion",[new I(e,t)]),this.aceEditor.setOption("enableLiveAutocompletion",!0)):(this.aceEditor.setOption("enableBasicAutocompletion",void 0),this.aceEditor.setOption("enableLiveAutocompletion",!1)))},A._onChange=function(){var e=this;if(!this.onChangeDisabled){if(setTimeout((function(){e._updateHistoryButtons&&e._updateHistoryButtons()})),this._debouncedValidate(),this.options.onChange)try{this.options.onChange()}catch(e){console.error("Error in onChange callback: ",e)}if(this.options.onChangeText)try{this.options.onChangeText(this.getText())}catch(e){console.error("Error in onChangeText callback: ",e)}}},A._updateHistoryButtons=function(){if(this.aceEditor&&this.dom.undo&&this.dom.redo){var e=this.aceEditor.getSession().getUndoManager();e&&e.hasUndo&&e.hasRedo&&(this.dom.undo.disabled=!e.hasUndo(),this.dom.redo.disabled=!e.hasRedo())}},A._showSortModal=function(){try{var e=this,t=this.options.modalAnchor||s.ai,i=this.get();(0,u.showSortModal)(t,i,(function(t){if(Array.isArray(i)){var n=(0,f.sort)(i,t.path,t.direction);e.sortedBy=t,e.update(n)}if((0,f.isObject)(i)){var o=(0,f.sortObjectKeys)(i,t.direction);e.sortedBy=t,e.update(o)}}),e.sortedBy)}catch(e){this._onError(e)}},A._showTransformModal=function(){var e=this;try{var t=this.options,i=t.modalAnchor,n=t.createQuery,o=t.executeQuery,r=t.queryDescription,a=this.get();(0,g.showTransformModal)({container:i||s.ai,json:a,queryDescription:r,createQuery:n,executeQuery:o,onTransform:function(t){var i=o(a,t);e.update(i)}})}catch(e){this._onError(e)}},A._onSelect=function(){this._updateCursorInfo(),this._emitSelectionChange()},A._onKeyDown=function(e){var t=!1;73===(e.which||e.keyCode)&&e.ctrlKey&&(e.shiftKey?(this.compact(),this._onChange()):(this.format(),this._onChange()),t=!0),t&&(e.preventDefault(),e.stopPropagation()),this._updateCursorInfo(),this._emitSelectionChange()},A._onMouseDown=function(){this._updateCursorInfo(),this._emitSelectionChange()},A._onBlur=function(){var e=this;setTimeout((function(){e.isFocused||(e._updateCursorInfo(),e._emitSelectionChange()),e.isFocused=!1}))},A._updateCursorInfo=function(){var e,t,i,n=this;if(this.textarea)setTimeout((function(){var o=(0,f.getInputSelection)(n.textarea);o.startIndex!==o.endIndex&&(i=o.endIndex-o.startIndex),i&&n.cursorInfo&&n.cursorInfo.line===o.end.row&&n.cursorInfo.column===o.end.column?(e=o.start.row,t=o.start.column):(e=o.end.row,t=o.end.column),n.cursorInfo={line:e,column:t,count:i},n.options.statusBar&&s()}),0);else if(this.aceEditor&&this.curserInfoElements){var o=this.aceEditor.getCursorPosition(),r=this.aceEditor.getSelectedText();e=o.row+1,t=o.column+1,i=r.length,n.cursorInfo={line:e,column:t,count:i},this.options.statusBar&&s()}function s(){n.curserInfoElements.countVal.innerText!==i&&(n.curserInfoElements.countVal.innerText=i,n.curserInfoElements.countVal.style.display=i?"inline":"none",n.curserInfoElements.countLabel.style.display=i?"inline":"none"),n.curserInfoElements.lnVal.innerText=e,n.curserInfoElements.colVal.innerText=t}},A._emitSelectionChange=function(){if(this._selectionChangedHandler){var e=this.getTextSelection();this._selectionChangedHandler(e.start,e.end,e.text)}},A._refreshAnnotations=function(){var e=this.aceEditor&&this.aceEditor.getSession();if(e){var t=e.getAnnotations().filter((function(e){return"error"===e.type}));e.setAnnotations(t)}},A.destroy=function(){this.aceEditor&&(this.aceEditor.destroy(),this.aceEditor=null),this.frame&&this.container&&this.frame.parentNode===this.container&&this.container.removeChild(this.frame),this.modeSwitcher&&(this.modeSwitcher.destroy(),this.modeSwitcher=null),this.textarea=null,this._debouncedValidate=null,this.frameFocusTracker.destroy()},A.compact=function(){var e=this.get(),t=JSON.stringify(e);this.updateText(t)},A.format=function(){var e=this.get(),t=JSON.stringify(e,null,this.indentation);this.updateText(t)},A.repair=function(){var e=this.getText();try{var t=(0,n.m)(e);this.updateText(t)}catch(e){}},A.focus=function(){this.textarea&&this.textarea.focus(),this.aceEditor&&this.aceEditor.focus()},A.resize=function(){this.aceEditor&&this.aceEditor.resize(!1)},A.set=function(e){this.setText(JSON.stringify(e,null,this.indentation))},A.update=function(e){this.updateText(JSON.stringify(e,null,this.indentation))},A.get=function(){var e=this.getText();return(0,f.parse)(e)},A.getText=function(){return this.textarea?this.textarea.value:this.aceEditor?this.aceEditor.getValue():""},A._setText=function(e,t){var i=this,n=!0===this.options.escapeUnicode?(0,f.escapeUnicodeChars)(e):e;if(this.textarea&&(this.textarea.value=n),this.aceEditor){if(this.onChangeDisabled=!0,this.aceEditor.setValue(n,-1),this.onChangeDisabled=!1,t){var o=this;setTimeout((function(){o.aceEditor&&o.aceEditor.session.getUndoManager().reset()}))}setTimeout((function(){i._updateHistoryButtons&&i._updateHistoryButtons()}))}this._debouncedValidate()},A.setText=function(e){this._setText(e,!0)},A.updateText=function(e){this.getText()!==e&&this._setText(e,!1)},A.validate=function(){var e,t=this,i=[],n=[];try{e=this.get(),this.validateSchema&&(this.validateSchema(e)||(i=this.validateSchema.errors.map((function(e){return e.type="validation",(0,f.improveSchemaError)(e)})))),this.validationSequence=(this.validationSequence||0)+1;var o=this,r=this.validationSequence;return function(e,t){if(!t)return Promise.resolve([]);try{var i=t(e);return((0,f.isPromise)(i)?i:Promise.resolve(i)).then((function(e){return Array.isArray(e)?e.filter((function(e){var t=(0,f.isValidValidationError)(e);return t||console.warn('Ignoring a custom validation error with invalid structure. Expected structure: {path: [...], message: "..."}. Actual error:',e),t})).map((function(e){return{dataPath:(0,f.stringifyPath)(e.path),message:e.message,type:"customValidation"}})):[]}))}catch(e){return Promise.reject(e)}}(e,this.options.onValidate).then((function(e){if(r===o.validationSequence){var s=i.concat(n).concat(e);o._renderErrors(s),"function"==typeof t.options.onValidationError&&(0,f.isValidationErrorChanged)(s,t.lastSchemaErrors)&&t.options.onValidationError.call(t,s),t.lastSchemaErrors=s}return t.lastSchemaErrors}))}catch(e){if(this.getText()){var s,a=/\w*line\s*(\d+)\w*/g.exec(e.message);a&&(s=+a[1]),n=[{type:"error",message:e.message.replace(/\n/g,"<br>"),line:s}]}return this._renderErrors(n),"function"==typeof this.options.onValidationError&&(0,f.isValidationErrorChanged)(n,this.lastSchemaErrors)&&this.options.onValidationError.call(this,n),this.lastSchemaErrors=n,Promise.resolve(this.lastSchemaErrors)}},A._validateAndCatch=function(){this.validate().catch((function(e){console.error("Error running validation:",e)}))},A._renderErrors=function(e){var t=this.getText(),i=[];e.reduce((function(e,t){return"string"==typeof t.dataPath&&-1===e.indexOf(t.dataPath)&&e.push(t.dataPath),e}),i);var n=(0,f.getPositionForPath)(t,i);this.aceEditor&&(this.annotations=n.map((function(t){var i=e.filter((function(e){return e.dataPath===t.path})),n=i.map((function(e){return e.message})).join("\n");return n?{row:t.line,column:t.column,text:"Schema validation error"+(1!==i.length?"s":"")+": \n"+n,type:"warning",source:"jsoneditor"}:{}})),this._refreshAnnotations()),this.errorTable.setErrors(e,n),this.aceEditor&&this.aceEditor.resize(!1)},A.getTextSelection=function(){var e={};if(this.textarea){var t=(0,f.getInputSelection)(this.textarea);return this.cursorInfo&&this.cursorInfo.line===t.end.row&&this.cursorInfo.column===t.end.column?(e.start=t.end,e.end=t.start):e=t,{start:e.start,end:e.end,text:this.textarea.value.substring(t.startIndex,t.endIndex)}}if(this.aceEditor){var i=this.aceEditor.getSelection(),n=this.aceEditor.getSelectedText(),o=i.getRange(),r=i.getSelectionLead();return r.row===o.end.row&&r.column===o.end.column?e=o:(e.start=o.end,e.end=o.start),{start:{row:e.start.row+1,column:e.start.column+1},end:{row:e.end.row+1,column:e.end.column+1},text:n}}},A.onTextSelectionChange=function(e){"function"==typeof e&&(this._selectionChangedHandler=(0,f.debounce)(e,this.DEBOUNCE_INTERVAL))},A.setTextSelection=function(e,t){if(e&&t)if(this.textarea){var i=(0,f.getIndexForPosition)(this.textarea,e.row,e.column),n=(0,f.getIndexForPosition)(this.textarea,t.row,t.column);if(i>-1&&n>-1){if(this.textarea.setSelectionRange)this.textarea.focus(),this.textarea.setSelectionRange(i,n);else if(this.textarea.createTextRange){var o=this.textarea.createTextRange();o.collapse(!0),o.moveEnd("character",n),o.moveStart("character",i),o.select()}var r=(this.textarea.value.match(/\n/g)||[]).length+1,s=this.textarea.scrollHeight/r,a=e.row*s;this.textarea.scrollTop=a>this.textarea.clientHeight?a-this.textarea.clientHeight/2:0}}else if(this.aceEditor){var l={start:{row:e.row-1,column:e.column-1},end:{row:t.row-1,column:t.column-1}};this.aceEditor.selection.setRange(l),this.aceEditor.scrollToLine(e.row-1,!0)}};var x=[{mode:"text",mixin:A,data:"text",load:S},{mode:"code",mixin:A,data:"text",load:S}]},5633:function(e,t,i){"use strict";i.r(t),i.d(t,{treeModeMixins:function(){return J}});var n={start:function(e,t,i){return 0===t.indexOf(e)},contain:function(e,t,i){return t.indexOf(e)>-1}},o=i(6545),r=i(2877);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:String(t)}var c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.locked=!1}var t,i,n;return t=e,(i=[{key:"highlight",value:function(e){this.locked||(this.node!==e&&(this.node&&this.node.setHighlight(!1),this.node=e,this.node.setHighlight(!0)),this._cancelUnhighlight())}},{key:"unhighlight",value:function(){if(!this.locked){var e=this;this.node&&(this._cancelUnhighlight(),this.unhighlightTimer=setTimeout((function(){e.node.setHighlight(!1),e.node=void 0,e.unhighlightTimer=void 0}),0))}}},{key:"_cancelUnhighlight",value:function(){this.unhighlightTimer&&(clearTimeout(this.unhighlightTimer),this.unhighlightTimer=void 0)}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}}])&&a(t.prototype,i),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),h=i(3057),d=i(359),u=i(1389),g=i(1342),p=i.n(g),m=i(1925),f=i(6237),v=i(2915),C=i(5609),y=i(660);function I(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||w(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,o,r,s,a=[],l=!0,c=!1;try{if(r=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=r.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||w(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function A(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=w(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,r=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw r}}}}function w(e,t){if(e){if("string"==typeof e)return S(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function k(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,T(n.key),n)}}function T(e){var t=function(e,t){if("object"!=x(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==x(t)?t:String(t)}var E=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.editor=t,this.dom={},this.expanded=!1,i&&i instanceof Object?(this.setField(i.field,i.fieldEditable),"value"in i&&this.setValue(i.value,i.type),"internalValue"in i&&this.setInternalValue(i.internalValue)):(this.setField(""),this.setValue(null)),this._debouncedOnChangeValue=(0,f.debounce)(this._onChangeValue.bind(this),e.prototype.DEBOUNCE_INTERVAL),this._debouncedOnChangeField=(0,f.debounce)(this._onChangeField.bind(this),e.prototype.DEBOUNCE_INTERVAL),this.visibleChilds=this.getMaxVisibleChilds()}var t,i,n;return t=e,i=[{key:"getMaxVisibleChilds",value:function(){return this.editor&&this.editor.options&&this.editor.options.maxVisibleChilds?this.editor.options.maxVisibleChilds:R}},{key:"_updateEditability",value:function(){if(this.editable={field:!0,value:!0},this.editor&&(this.editable.field="tree"===this.editor.options.mode,this.editable.value="view"!==this.editor.options.mode,("tree"===this.editor.options.mode||"form"===this.editor.options.mode)&&"function"==typeof this.editor.options.onEditable)){var e=this.getValue.bind(this),t=this.editor.options.onEditable({field:this.field,get value(){return e()},path:this.getPath()});"boolean"==typeof t?(this.editable.field=t,this.editable.value=t):"object"===x(t)&&null!==t?("boolean"==typeof t.field&&(this.editable.field=t.field),"boolean"==typeof t.value&&(this.editable.value=t.value)):(console.error("Invalid return value for function onEditable.","Actual value:",t,".","Either a boolean or object { field: boolean, value: boolean } expected."),this.editable.field=!1,this.editable.value=!1)}}},{key:"getPath",value:function(){for(var e=this,t=[];e;){var i=e.getName();void 0!==i&&t.unshift(i),e=e.parent}return t}},{key:"getInternalPath",value:function(){for(var e=this,t=[];e;)e.parent&&t.unshift(e.getIndex()),e=e.parent;return t}},{key:"getName",value:function(){return this.parent?"array"!==this.parent.type?this.field:this.index:void 0}},{key:"findNodeByPath",value:function(e){if(e){if(0===e.length)return this;if(e.length&&this.childs&&this.childs.length)for(var t=0;t<this.childs.length;++t)if(""+e[0]==""+this.childs[t].getName())return this.childs[t].findNodeByPath(e.slice(1))}}},{key:"findNodeByInternalPath",value:function(e){if(e){for(var t=this,i=0;i<e.length&&t;i++){var n=e[i];t=t.childs[n]}return t}}},{key:"serialize",value:function(){return{value:this.getValue(),path:this.getPath()}}},{key:"findNode",value:function(e){for(var t=(0,f.parsePath)(e),i=this,n=function(){var e=t.shift();if("number"==typeof e){if("array"!==i.type)throw new Error("Cannot get child node at index "+e+": node is no array");i=i.childs[e]}else{if("object"!==i.type)throw new Error("Cannot get child node "+e+": node is no object");i=i.childs.filter((function(t){return t.field===e}))[0]}};i&&t.length>0;)n();return i}},{key:"findParents",value:function(){for(var e=[],t=this.parent;t;)e.unshift(t),t=t.parent;return e}},{key:"setError",value:function(e,t){this.error=e,this.errorChild=t,this.dom&&this.dom.tr&&this.updateError()}},{key:"updateError",value:function(){var e=this,t=this.fieldError||this.valueError||this.error,i=this.dom.tdError;if(t&&this.dom&&this.dom.tr){(0,f.addClassName)(this.dom.tr,"jsoneditor-validation-error"),i||(i=document.createElement("td"),this.dom.tdError=i,this.dom.tdValue.parentNode.appendChild(i));var n=document.createElement("button");n.type="button",n.className="jsoneditor-button jsoneditor-schema-error";var o=function(){e.dom.popupAnchor&&e.dom.popupAnchor.destroy()},r=function(){delete e.dom.popupAnchor},s=function(i){var o=e.editor.frame;e.dom.popupAnchor=(0,m.p)(n,e.editor.getPopupAnchor(),r,i);var s=n.getBoundingClientRect(),a=o.getBoundingClientRect().width-s.x>120?"jsoneditor-above":"jsoneditor-left",l=document.createElement("div");l.className="jsoneditor-popover "+a,l.appendChild(document.createTextNode(t.message)),e.dom.popupAnchor.appendChild(l)};n.onmouseover=function(){e.dom.popupAnchor||s(!0)},n.onfocus=function(){o(),s(!1)},n.onblur=function(){o()};var a=this.errorChild;for(a&&(n.onclick=function(){a.findParents().forEach((function(e){e.expand(!1)})),a.scrollTo((function(){a.focus()}))});i.firstChild;)i.removeChild(i.firstChild);i.appendChild(n)}else this.dom.tr&&(0,f.removeClassName)(this.dom.tr,"jsoneditor-validation-error"),i&&(this.dom.tdError.parentNode.removeChild(this.dom.tdError),delete this.dom.tdError)}},{key:"getIndex",value:function(){if(this.parent){var e=this.parent.childs.indexOf(this);return-1!==e?e:null}return-1}},{key:"setParent",value:function(e){this.parent=e}},{key:"setField",value:function(e,t){this.field=e,this.previousField=e,this.fieldEditable=!0===t}},{key:"getField",value:function(){return void 0===this.field&&this._getDomField(),this.field}},{key:"setValue",value:function(t,i){var n,o,r,s,a=!1,l=this.childs;if(this.type=this._getType(t),i&&i!==this.type){if("string"!==i||"auto"!==this.type)throw new Error('Type mismatch: cannot cast value of type "'+this.type+' to the specified type "'+i+'"');this.type=i}if("array"===this.type){for(this.childs||(this.childs=[]),r=0;r<t.length;r++)if(void 0!==(n=t[r])&&!(n instanceof Function))if(r<this.childs.length)(o=this.childs[r]).fieldEditable=!1,o.index=r,o.setValue(n);else{o=new e(this.editor,{value:n});var c=r<this.getMaxVisibleChilds();this.appendChild(o,c,a)}for(s=this.childs.length;s>=t.length;s--)this.removeChild(this.childs[s],a)}else if("object"===this.type){for(this.childs||(this.childs=[]),s=this.childs.length-1;s>=0;s--)L(t,this.childs[s].field)||this.removeChild(this.childs[s],a);for(var h in r=0,t)if(L(t,h)){if(void 0!==(n=t[h])&&!(n instanceof Function)){var d=this.findChildByProperty(h);if(d)d.setField(h,!0),d.setValue(n);else{var u=new e(this.editor,{field:h,value:n}),g=r<this.getMaxVisibleChilds();this.appendChild(u,g,a)}}r++}this.value="",!0===this.editor.options.sortObjectKeys&&this.sort([],"asc",!1)}else this.hideChilds(),delete this.append,delete this.showMore,delete this.expanded,delete this.childs,this.value=t;Array.isArray(l)!==Array.isArray(this.childs)&&this.recreateDom(),this.updateDom({updateIndexes:!0}),this.previousValue=this.value}},{key:"setInternalValue",value:function(t){var i,n,o,r,s,a=!1,l=this.childs;if(this.type=t.type,"array"===t.type){for(this.childs||(this.childs=[]),r=0;r<t.childs.length;r++)void 0===(i=t.childs[r])||i instanceof Function||(r<this.childs.length?((n=this.childs[r]).fieldEditable=!1,n.index=r,n.setInternalValue(i)):(n=new e(this.editor,{internalValue:i}),o=r<this.getMaxVisibleChilds(),this.appendChild(n,o,a)));for(s=this.childs.length;s>=t.childs.length;s--)this.removeChild(this.childs[s],a)}else if("object"===t.type){for(this.childs||(this.childs=[]),r=0;r<t.childs.length;r++)void 0===(i=t.childs[r])||i instanceof Function||(r<this.childs.length?(delete(n=this.childs[r]).index,n.setField(i.field,!0),n.setInternalValue(i.value)):(n=new e(this.editor,{field:i.field,internalValue:i.value}),o=r<this.getMaxVisibleChilds(),this.appendChild(n,o,a)));for(s=this.childs.length;s>=t.childs.length;s--)this.removeChild(this.childs[s],a)}else this.hideChilds(),delete this.append,delete this.showMore,delete this.expanded,delete this.childs,this.value=t.value;Array.isArray(l)!==Array.isArray(this.childs)&&this.recreateDom(),this.updateDom({updateIndexes:!0}),this.previousValue=this.value}},{key:"recreateDom",value:function(){if(this.dom&&this.dom.tr&&this.dom.tr.parentNode){var e=this._detachFromDom();this.clearDom(),this._attachToDom(e)}else this.clearDom()}},{key:"getValue",value:function(){if("array"===this.type){var e=[];return this.childs.forEach((function(t){e.push(t.getValue())})),e}if("object"===this.type){var t={};return this.childs.forEach((function(e){t[e.getField()]=e.getValue()})),t}return void 0===this.value&&this._getDomValue(),this.value}},{key:"getInternalValue",value:function(){return"array"===this.type?{type:this.type,childs:this.childs.map((function(e){return e.getInternalValue()}))}:"object"===this.type?{type:this.type,childs:this.childs.map((function(e){return{field:e.getField(),value:e.getInternalValue()}}))}:(void 0===this.value&&this._getDomValue(),{type:this.type,value:this.value})}},{key:"getLevel",value:function(){return this.parent?this.parent.getLevel()+1:0}},{key:"getNodePath",value:function(){var e=this.parent?this.parent.getNodePath():[];return e.push(this),e}},{key:"clone",value:function(){var t=new e(this.editor);if(t.type=this.type,t.field=this.field,t.fieldInnerText=this.fieldInnerText,t.fieldEditable=this.fieldEditable,t.previousField=this.previousField,t.value=this.value,t.valueInnerText=this.valueInnerText,t.previousValue=this.previousValue,t.expanded=this.expanded,t.visibleChilds=this.visibleChilds,this.childs){var i=[];this.childs.forEach((function(e){var n=e.clone();n.setParent(t),i.push(n)})),t.childs=i}else t.childs=void 0;return t}},{key:"expand",value:function(e){this.childs&&(this.expanded=!0,this.dom.expand&&(this.dom.expand.className="jsoneditor-button jsoneditor-expanded"),this.showChilds(),!1!==e&&this.childs.forEach((function(t){t.expand(e)})),this.updateDom({recurse:!1}))}},{key:"collapse",value:function(e){this.childs&&(this.hideChilds(),!1!==e&&this.childs.forEach((function(t){t.collapse(e)})),this.dom.expand&&(this.dom.expand.className="jsoneditor-button jsoneditor-collapsed"),this.expanded=!1,this.updateDom({recurse:!1}))}},{key:"showChilds",value:function(){if(this.childs&&this.expanded){var e,t=this.dom.tr,i=t?t.parentNode:void 0;if(i){var n=this.getAppendDom();n.parentNode||((e=t.nextSibling)?i.insertBefore(n,e):i.appendChild(n));var o=Math.min(this.childs.length,this.visibleChilds);e=this._getNextTr();for(var r=0;r<o;r++){var s=this.childs[r];s.getDom().parentNode||i.insertBefore(s.getDom(),e),s.showChilds()}var a=this.getShowMoreDom();e=this._getNextTr(),a.parentNode||i.insertBefore(a,e),this.showMore.updateDom()}}}},{key:"_getNextTr",value:function(){return this.showMore&&this.showMore.getDom().parentNode?this.showMore.getDom():this.append&&this.append.getDom().parentNode?this.append.getDom():void 0}},{key:"hide",value:function(e){var t=this.dom.tr,i=t?t.parentNode:void 0;i&&i.removeChild(t),this.dom.popupAnchor&&this.dom.popupAnchor.destroy(),this.hideChilds(e)}},{key:"hideChilds",value:function(e){if(this.childs&&this.expanded){var t=this.getAppendDom();t.parentNode&&t.parentNode.removeChild(t),this.childs.forEach((function(e){e.hide()}));var i=this.getShowMoreDom();i.parentNode&&i.parentNode.removeChild(i),e&&!e.resetVisibleChilds||(this.visibleChilds=this.getMaxVisibleChilds())}}},{key:"_updateCssClassName",value:function(){if(this.dom.field&&this.editor&&this.editor.options&&"function"==typeof this.editor.options.onClassName&&this.dom.tree){(0,f.removeAllClassNames)(this.dom.tree);var e=this.getValue.bind(this),t=this.editor.options.onClassName({path:this.getPath(),field:this.field,get value(){return e()}})||"";(0,f.addClassName)(this.dom.tree,"jsoneditor-values "+t)}}},{key:"recursivelyUpdateCssClassesOnNodes",value:function(){if(this._updateCssClassName(),Array.isArray(this.childs))for(var e=0;e<this.childs.length;e++)this.childs[e].recursivelyUpdateCssClassesOnNodes()}},{key:"expandTo",value:function(){for(var e=this.parent;e;)e.expanded||e.expand(),e=e.parent}},{key:"appendChild",value:function(e,t,i){if(this._hasChilds()){if(e.setParent(this),e.fieldEditable="object"===this.type,"array"===this.type&&(e.index=this.childs.length),"object"===this.type&&void 0===e.field&&e.setField(""),this.childs.push(e),this.expanded&&!1!==t){var n=e.getDom(),o=this._getNextTr(),r=o?o.parentNode:void 0;o&&r&&r.insertBefore(n,o),e.showChilds(),this.visibleChilds++}!1!==i&&(this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0}))}}},{key:"moveBefore",value:function(e,t,i){if(this._hasChilds()){var n,o=this.dom.tr?this.dom.tr.parentNode:void 0;if(o&&((n=document.createElement("tr")).style.height=o.clientHeight+"px",o.appendChild(n)),e.parent&&e.parent.removeChild(e),t instanceof N||!t)if(this.childs.length+1>this.visibleChilds){var r=this.childs[this.visibleChilds-1];this.insertBefore(e,r,i)}else this.appendChild(e,!0,i);else this.insertBefore(e,t,i);o&&n&&o.removeChild(n)}}},{key:"insertBefore",value:function(e,t,i){if(this._hasChilds()){if(this.visibleChilds++,"object"===this.type&&void 0===e.field&&e.setField(""),t===this.append)e.setParent(this),e.fieldEditable="object"===this.type,this.childs.push(e);else{var n=this.childs.indexOf(t);if(-1===n)throw new Error("Node not found");e.setParent(this),e.fieldEditable="object"===this.type,this.childs.splice(n,0,e)}if(this.expanded){var o=e.getDom(),r=t.getDom(),s=r?r.parentNode:void 0;r&&s&&s.insertBefore(o,r),e.showChilds(),this.showChilds()}!1!==i&&(this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0}))}}},{key:"insertAfter",value:function(e,t){if(this._hasChilds()){var i=this.childs.indexOf(t),n=this.childs[i+1];n?this.insertBefore(e,n):this.appendChild(e)}}},{key:"search",value:function(e,t){Array.isArray(t)||(t=[]);var i=e?e.toLowerCase():void 0;return delete this.searchField,delete this.searchValue,void 0!==this.field&&t.length<=this.MAX_SEARCH_RESULTS&&(-1!==String(this.field).toLowerCase().indexOf(i)&&(this.searchField=!0,t.push({node:this,elem:"field"})),this._updateDomField()),this._hasChilds()?this.childs&&this.childs.forEach((function(i){i.search(e,t)})):void 0!==this.value&&t.length<=this.MAX_SEARCH_RESULTS&&(-1!==String(this.value).toLowerCase().indexOf(i)&&(this.searchValue=!0,t.push({node:this,elem:"value"})),this._updateDomValue()),t}},{key:"scrollTo",value:function(e){this.expandPathToNode(),this.dom.tr&&this.dom.tr.parentNode&&this.editor.scrollTo(this.dom.tr.offsetTop,e)}},{key:"expandPathToNode",value:function(){for(var e=this;e&&e.parent;){for(var t="array"===e.parent.type?e.index:e.parent.childs.indexOf(e);e.parent.visibleChilds<t+1;)e.parent.visibleChilds+=this.getMaxVisibleChilds();e.parent.expand(!1),e=e.parent}}},{key:"focus",value:function(t){if(e.focusElement=t,this.dom.tr&&this.dom.tr.parentNode){var i=this.dom;switch(t){case"drag":i.drag?i.drag.focus():i.menu.focus();break;case"menu":i.menu.focus();break;case"expand":this._hasChilds()?i.expand.focus():i.field&&this.fieldEditable?(i.field.focus(),(0,f.selectContentEditable)(i.field)):i.value&&!this._hasChilds()?(i.value.focus(),(0,f.selectContentEditable)(i.value)):i.menu.focus();break;case"field":i.field&&this.fieldEditable?(i.field.focus(),(0,f.selectContentEditable)(i.field)):i.value&&!this._hasChilds()?(i.value.focus(),(0,f.selectContentEditable)(i.value)):this._hasChilds()?i.expand.focus():i.menu.focus();break;default:i.select?i.select.focus():i.value&&!this._hasChilds()?(i.value.focus(),(0,f.selectContentEditable)(i.value)):i.field&&this.fieldEditable?(i.field.focus(),(0,f.selectContentEditable)(i.field)):this._hasChilds()?i.expand.focus():i.menu.focus()}}}},{key:"containsNode",value:function(e){if(this===e)return!0;var t=this.childs;if(t)for(var i=0,n=t.length;i<n;i++)if(t[i].containsNode(e))return!0;return!1}},{key:"removeChild",value:function(e,t){if(this.childs){var i=this.childs.indexOf(e);if(-1!==i){i<this.visibleChilds&&this.expanded&&this.visibleChilds--,e.hide(),delete e.searchField,delete e.searchValue;var n=this.childs.splice(i,1)[0];return n.parent=null,!1!==t&&this.updateDom({updateIndexes:!0}),n}}}},{key:"_remove",value:function(e){this.removeChild(e)}},{key:"changeType",value:function(e){var t=this.type;if(t!==e){if("string"!==e&&"auto"!==e||"string"!==t&&"auto"!==t){var i=this._detachFromDom();this.clearDom(),this.type=e,"object"===e?(this.childs||(this.childs=[]),this.childs.forEach((function(e){e.clearDom(),delete e.index,e.fieldEditable=!0,void 0===e.field&&(e.field="")})),"string"!==t&&"auto"!==t||(this.expanded=!0)):"array"===e?(this.childs||(this.childs=[]),this.childs.forEach((function(e,t){e.clearDom(),e.fieldEditable=!1,e.index=t})),"string"!==t&&"auto"!==t||(this.expanded=!0)):this.expanded=!1,this._attachToDom(i)}else this.type=e;"auto"!==e&&"string"!==e||(this.value="string"===e?String(this.value):(0,f.parseString)(String(this.value)),this.focus()),this.updateDom({updateIndexes:!0})}}},{key:"deepEqual",value:function(e){var t;if("array"===this.type){if(!Array.isArray(e))return!1;if(this.childs.length!==e.length)return!1;for(t=0;t<this.childs.length;t++)if(!this.childs[t].deepEqual(e[t]))return!1}else if("object"===this.type){if("object"!==x(e)||!e)return!1;var i=Object.keys(e);if(this.childs.length!==i.length)return!1;for(t=0;t<i.length;t++){var n=this.childs[t];if(n.field!==i[t]||!n.deepEqual(e[n.field]))return!1}}else if(this.value!==e)return!1;return!0}},{key:"_getDomValue",value:function(){if(this._clearValueError(),this.dom.value&&"array"!==this.type&&"object"!==this.type&&(this.valueInnerText=(0,f.getInnerText)(this.dom.value),""===this.valueInnerText&&""!==this.dom.value.innerHTML&&(this.dom.value.textContent="")),void 0!==this.valueInnerText)try{var e;if("string"===this.type)e=this._unescapeHTML(this.valueInnerText);else{var t=this._unescapeHTML(this.valueInnerText);e=(0,f.parseString)(t)}e!==this.value&&(this.value=e,this._debouncedOnChangeValue())}catch(e){this._setValueError((0,h.Tl)("cannotParseValueError"))}}},{key:"_setValueError",value:function(e){this.valueError={message:e},this.updateError()}},{key:"_clearValueError",value:function(){this.valueError&&(this.valueError=null,this.updateError())}},{key:"_setFieldError",value:function(e){this.fieldError={message:e},this.updateError()}},{key:"_clearFieldError",value:function(){this.fieldError&&(this.fieldError=null,this.updateError())}},{key:"_onChangeValue",value:function(){var e=this.editor.getDomSelection();if(e.range){var t=(0,f.textDiff)(String(this.value),String(this.previousValue));e.range.startOffset=t.start,e.range.endOffset=t.end}var i=this.editor.getDomSelection();if(i.range){var n=(0,f.textDiff)(String(this.previousValue),String(this.value));i.range.startOffset=n.start,i.range.endOffset=n.end}this.editor._onAction("editValue",{path:this.getInternalPath(),oldValue:this.previousValue,newValue:this.value,oldSelection:e,newSelection:i}),this.previousValue=this.value}},{key:"_onChangeField",value:function(){var e=this.editor.getDomSelection(),t=this.previousField||"";if(e.range){var i=(0,f.textDiff)(this.field,t);e.range.startOffset=i.start,e.range.endOffset=i.end}var n=this.editor.getDomSelection();if(n.range){var o=(0,f.textDiff)(t,this.field);n.range.startOffset=o.start,n.range.endOffset=o.end}this.editor._onAction("editField",{parentPath:this.parent.getInternalPath(),index:this.getIndex(),oldValue:this.previousField,newValue:this.field,oldSelection:e,newSelection:n}),this.previousField=this.field}},{key:"_updateDomValue",value:function(){var e=this.dom.value;if(e){var t=["jsoneditor-value"],i=this.value,n="auto"===this.type?(0,f.getType)(i):this.type,o="string"===n&&(0,f.isUrl)(i);if(t.push("jsoneditor-"+n),o&&t.push("jsoneditor-url"),""===String(this.value)&&"array"!==this.type&&"object"!==this.type&&t.push("jsoneditor-empty"),this.searchValueActive&&t.push("jsoneditor-highlight-active"),this.searchValue&&t.push("jsoneditor-highlight"),e.className=t.join(" "),"array"===n||"object"===n){var r=this.childs?this.childs.length:0;e.title=this.type+" containing "+r+" items"}else o&&this.editable.value?e.title=(0,h.Tl)("openUrl"):e.title="";if("boolean"===n&&this.editable.value?(this.dom.checkbox||(this.dom.checkbox=document.createElement("input"),this.dom.checkbox.type="checkbox",this.dom.tdCheckbox=document.createElement("td"),this.dom.tdCheckbox.className="jsoneditor-tree",this.dom.tdCheckbox.appendChild(this.dom.checkbox),this.dom.tdValue.parentNode.insertBefore(this.dom.tdCheckbox,this.dom.tdValue)),this.dom.checkbox.checked=this.value):this.dom.tdCheckbox&&(this.dom.tdCheckbox.parentNode.removeChild(this.dom.tdCheckbox),delete this.dom.tdCheckbox,delete this.dom.checkbox),this.enum&&this.editable.value){if(!this.dom.select){this.dom.select=document.createElement("select"),this.id=this.field+"_"+(new Date).getUTCMilliseconds(),this.dom.select.id=this.id,this.dom.select.name=this.dom.select.id;var s=document.createElement("option");s.value="",s.textContent="--",this.dom.select.appendChild(s),this._updateEnumOptions(),this.dom.tdSelect=document.createElement("td"),this.dom.tdSelect.className="jsoneditor-tree",this.dom.tdSelect.appendChild(this.dom.select),this.dom.tdValue.parentNode.insertBefore(this.dom.tdSelect,this.dom.tdValue)}this.dom.select.value=-1!==this.enum.indexOf(this.value)?this.value:"",!this.schema||L(this.schema,"oneOf")||L(this.schema,"anyOf")||L(this.schema,"allOf")?delete this.valueFieldHTML:(this.valueFieldHTML=this.dom.tdValue.innerHTML,this.dom.tdValue.style.visibility="hidden",this.dom.tdValue.textContent="")}else this.dom.tdSelect&&(this.dom.tdSelect.parentNode.removeChild(this.dom.tdSelect),delete this.dom.tdSelect,delete this.dom.select,this.dom.tdValue.innerHTML=this.valueFieldHTML,this.dom.tdValue.style.visibility="",delete this.valueFieldHTML,this.dom.tdValue.appendChild(this.dom.value));if(this.editor.options.colorPicker&&"string"==typeof i&&(0,f.isValidColor)(i)?(this.dom.color||(this.dom.color=document.createElement("div"),this.dom.color.className="jsoneditor-color",this.dom.tdColor=document.createElement("td"),this.dom.tdColor.className="jsoneditor-tree",this.dom.tdColor.appendChild(this.dom.color),this.dom.tdValue.parentNode.insertBefore(this.dom.tdColor,this.dom.tdValue)),(0,f.addClassName)(this.dom.value,"jsoneditor-color-value"),this.editable.value?(0,f.removeClassName)(this.dom.color,"jsoneditor-color-readonly"):(0,f.addClassName)(this.dom.color,"jsoneditor-color-readonly"),this.dom.color.style.backgroundColor=i):this._deleteDomColor(),this._showTimestampTag()){this.dom.date||(this.dom.date=document.createElement("div"),this.dom.date.className="jsoneditor-date",this.dom.value.parentNode.appendChild(this.dom.date));var a=null;if("function"==typeof this.editor.options.timestampFormat&&(a=this.editor.options.timestampFormat({field:this.field,value:this.value,path:this.getPath()})),a){for(;this.dom.date.firstChild;)this.dom.date.removeChild(this.dom.date.firstChild);this.dom.date.appendChild(document.createTextNode(a))}else this.dom.date.textContent=new Date(i).toISOString();this.dom.date.title=new Date(i).toString()}else this.dom.date&&(this.dom.date.parentNode.removeChild(this.dom.date),delete this.dom.date);(0,f.stripFormatting)(e),this._updateDomDefault()}}},{key:"_updateEnumOptions",value:function(){if(this.enum&&this.dom.select){this.dom.select.innerHTML="";for(var e=0;e<this.enum.length;e++){var t=document.createElement("option");t.value=this.enum[e],t.textContent=this.enum[e],this.dom.select.appendChild(t)}}}},{key:"_deleteDomColor",value:function(){this.dom.color&&(this.dom.tdColor.parentNode.removeChild(this.dom.tdColor),delete this.dom.tdColor,delete this.dom.color,(0,f.removeClassName)(this.dom.value,"jsoneditor-color-value"))}},{key:"_updateDomField",value:function(){var e=this.dom.field;if(e){var t=(0,f.makeFieldTooltip)(this.schema,this.editor.options.language);t&&(e.title=t),""===String(this.field)&&this.parent&&"array"!==this.parent.type?(0,f.addClassName)(e,"jsoneditor-empty"):(0,f.removeClassName)(e,"jsoneditor-empty"),this.searchFieldActive?(0,f.addClassName)(e,"jsoneditor-highlight-active"):(0,f.removeClassName)(e,"jsoneditor-highlight-active"),this.searchField?(0,f.addClassName)(e,"jsoneditor-highlight"):(0,f.removeClassName)(e,"jsoneditor-highlight"),(0,f.stripFormatting)(e)}}},{key:"_getDomField",value:function(e){if(this._clearFieldError(),this.dom.field&&this.fieldEditable&&(this.fieldInnerText=(0,f.getInnerText)(this.dom.field),""===this.fieldInnerText&&""!==this.dom.field.innerHTML&&(this.dom.field.textContent="")),void 0!==this.fieldInnerText)try{var t=this._unescapeHTML(this.fieldInnerText),i=this.parent.getFieldNames(this);-1!==i.indexOf(t)?e?(t=(0,f.findUniqueName)(t,i))!==this.field&&(this.field=t,this._debouncedOnChangeField()):this._setFieldError((0,h.Tl)("duplicateFieldError")):t!==this.field&&(this.field=t,this._debouncedOnChangeField())}catch(e){this._setFieldError((0,h.Tl)("cannotParseFieldError"))}}},{key:"_updateDomDefault",value:function(){if(this.schema&&void 0!==this.schema.default&&!this._hasChilds()){var e=this.dom.select?this.dom.select:this.dom.value;e&&(this.value===this.schema.default?(e.title=(0,h.Tl)("default"),(0,f.addClassName)(e,"jsoneditor-is-default"),(0,f.removeClassName)(e,"jsoneditor-is-not-default")):(e.removeAttribute("title"),(0,f.removeClassName)(e,"jsoneditor-is-default"),(0,f.addClassName)(e,"jsoneditor-is-not-default")))}}},{key:"_showTimestampTag",value:function(){if("number"!=typeof this.value)return!1;var e=this.editor.options.timestampTag;if("function"==typeof e){var t=e({field:this.field,value:this.value,path:this.getPath()});return"boolean"==typeof t?t:(0,f.isTimestamp)(this.field,this.value)}return!0===e&&(0,f.isTimestamp)(this.field,this.value)}},{key:"clearDom",value:function(){this.dom={}}},{key:"getDom",value:function(){var e=this.dom;if(e.tr)return e.tr;if(this._updateEditability(),e.tr=document.createElement("tr"),e.tr.node=this,"tree"===this.editor.options.mode){var t=document.createElement("td");if(this.editable.field&&this.parent){var i=document.createElement("button");i.type="button",e.drag=i,i.className="jsoneditor-button jsoneditor-dragarea",i.title=(0,h.Tl)("drag"),t.appendChild(i)}e.tr.appendChild(t);var n=document.createElement("td"),o=document.createElement("button");o.type="button",e.menu=o,o.className="jsoneditor-button jsoneditor-contextmenu-button",o.title=(0,h.Tl)("actionsMenu"),n.appendChild(e.menu),e.tr.appendChild(n)}var r=document.createElement("td");return e.tr.appendChild(r),e.tree=this._createDomTree(),r.appendChild(e.tree),this.updateDom({updateIndexes:!0}),e.tr}},{key:"isVisible",value:function(){return this.dom&&this.dom.tr&&this.dom.tr.parentNode||!1}},{key:"isDescendantOf",value:function(e){for(var t=this.parent;t;){if(t===e)return!0;t=t.parent}return!1}},{key:"_createDomField",value:function(){return document.createElement("div")}},{key:"setHighlight",value:function(e){this.dom.tr&&(e?(0,f.addClassName)(this.dom.tr,"jsoneditor-highlight"):(0,f.removeClassName)(this.dom.tr,"jsoneditor-highlight"),this.append&&this.append.setHighlight(e),this.childs&&this.childs.forEach((function(t){t.setHighlight(e)})))}},{key:"setSelected",value:function(e,t){this.selected=e,this.dom.tr&&(e?(0,f.addClassName)(this.dom.tr,"jsoneditor-selected"):(0,f.removeClassName)(this.dom.tr,"jsoneditor-selected"),t?(0,f.addClassName)(this.dom.tr,"jsoneditor-first"):(0,f.removeClassName)(this.dom.tr,"jsoneditor-first"),this.append&&this.append.setSelected(e),this.showMore&&this.showMore.setSelected(e),this.childs&&this.childs.forEach((function(t){t.setSelected(e)})))}},{key:"updateValue",value:function(e){this.value=e,this.previousValue=e,this.valueError=void 0,this.updateDom()}},{key:"updateField",value:function(e){this.field=e,this.previousField=e,this.fieldError=void 0,this.updateDom()}},{key:"updateDom",value:function(t){var i=this.dom.tree;i&&(i.style.marginLeft=24*this.getLevel()+"px");var n=this.dom.field;if(n){var o;if(this.fieldEditable?(n.contentEditable=this.editable.field,n.spellcheck=!1,n.className="jsoneditor-field"):(n.contentEditable=!1,n.className="jsoneditor-readonly"),void 0!==this.index)o=this.index;else if(void 0!==this.field)o=this.field;else{var r=this.editor.options.schema?e._findSchema(this.editor.options.schema,this.editor.options.schemaRefs||{},this.getPath()):void 0;o=r&&r.title?r.title:this._hasChilds()?this.type:""}var s=this._escapeHTML(o);document.activeElement!==n&&s!==this._unescapeHTML((0,f.getInnerText)(n))&&(n.innerHTML=s),this._updateSchema(),this._updateEnumOptions()}var a=this.dom.value;if(a)if("array"===this.type||"object"===this.type)this.updateNodeName();else{var l=this._escapeHTML(this.value);document.activeElement!==a&&l!==this._unescapeHTML((0,f.getInnerText)(a))&&(a.innerHTML=l)}var c=this.dom.tr;c&&("array"===this.type||"object"===this.type?((0,f.addClassName)(c,"jsoneditor-expandable"),this.expanded?((0,f.addClassName)(c,"jsoneditor-expanded"),(0,f.removeClassName)(c,"jsoneditor-collapsed")):((0,f.addClassName)(c,"jsoneditor-collapsed"),(0,f.removeClassName)(c,"jsoneditor-expanded"))):((0,f.removeClassName)(c,"jsoneditor-expandable"),(0,f.removeClassName)(c,"jsoneditor-expanded"),(0,f.removeClassName)(c,"jsoneditor-collapsed"))),this._updateDomField(),this._updateDomValue(),t&&!0===t.updateIndexes&&this._updateDomIndexes(),t&&!0===t.recurse&&this.childs&&this.childs.forEach((function(e){e.updateDom(t)})),this.error&&this.updateError(),this.append&&this.append.updateDom(),this.showMore&&this.showMore.updateDom(),this._updateCssClassName()}},{key:"_updateSchema",value:function(){this.editor&&this.editor.options&&(this.schema=this.editor.options.schema?e._findSchema(this.editor.options.schema,this.editor.options.schemaRefs||{},this.getPath()):null,this.schema?this.enum=e._findEnum(this.schema):delete this.enum)}},{key:"_updateDomIndexes",value:function(){var e=this.dom.value,t=this.childs;e&&t&&("array"===this.type?t.forEach((function(e,t){e.index=t;var i=e.dom.field;i&&(i.textContent=t)})):"object"===this.type&&t.forEach((function(e){void 0!==e.index&&(delete e.index,void 0===e.field&&(e.field=""))})))}},{key:"_createDomValue",value:function(){var e;return"array"===this.type?(e=document.createElement("div")).textContent="[...]":"object"===this.type?(e=document.createElement("div")).textContent="{...}":!this.editable.value&&(0,f.isUrl)(this.value)?((e=document.createElement("a")).href=this.value,e.innerHTML=this._escapeHTML(this.value)):((e=document.createElement("div")).contentEditable=this.editable.value,e.spellcheck=!1,e.innerHTML=this._escapeHTML(this.value)),e}},{key:"_createDomExpandButton",value:function(){var e=document.createElement("button");return e.type="button",this._hasChilds()?(e.className=this.expanded?"jsoneditor-button jsoneditor-expanded":"jsoneditor-button jsoneditor-collapsed",e.title=(0,h.Tl)("expandTitle")):(e.className="jsoneditor-button jsoneditor-invisible",e.title=""),e}},{key:"_createDomTree",value:function(){var e=this.dom,t=document.createElement("table"),i=document.createElement("tbody");t.style.borderCollapse="collapse",t.className="jsoneditor-values",t.appendChild(i);var n=document.createElement("tr");i.appendChild(n);var o=document.createElement("td");o.className="jsoneditor-tree",n.appendChild(o),e.expand=this._createDomExpandButton(),o.appendChild(e.expand),e.tdExpand=o;var r=document.createElement("td");r.className="jsoneditor-tree",n.appendChild(r),e.field=this._createDomField(),r.appendChild(e.field),e.tdField=r;var s=document.createElement("td");s.className="jsoneditor-tree",n.appendChild(s),"object"!==this.type&&"array"!==this.type&&(s.appendChild(document.createTextNode(":")),s.className="jsoneditor-separator"),e.tdSeparator=s;var a=document.createElement("td");return a.className="jsoneditor-tree",n.appendChild(a),e.value=this._createDomValue(),a.appendChild(e.value),e.tdValue=a,t}},{key:"onEvent",value:function(e){var t=e.type,i=e.target||e.srcElement,n=this.dom,o=this,r=this._hasChilds();if(i!==n.drag&&i!==n.menu||("mouseover"===t?this.editor.highlighter.highlight(this):"mouseout"===t&&this.editor.highlighter.unhighlight()),"click"===t&&i===n.menu){var s=o.editor.highlighter;s.highlight(o),s.lock(),(0,f.addClassName)(n.menu,"jsoneditor-selected"),this.showContextMenu(n.menu,(function(){(0,f.removeClassName)(n.menu,"jsoneditor-selected"),s.unlock(),s.unhighlight()}))}if("click"===t&&i===n.expand&&r){var a=e.ctrlKey;this._onExpand(a)}"click"!==t||e.target!==o.dom.tdColor&&e.target!==o.dom.color||!this.editable.value||this._showColorPicker(),"change"===t&&i===n.checkbox&&(this.dom.value.textContent=String(!this.value),this._getDomValue(),this._updateDomDefault()),"change"===t&&i===n.select&&(this.dom.value.innerHTML=this._escapeHTML(n.select.value),this._getDomValue(),this._updateDomValue());var l=n.value;if(i===l)switch(t){case"blur":case"change":this._getDomValue(),this._clearValueError(),this._updateDomValue();var c=this._escapeHTML(this.value);c!==this._unescapeHTML((0,f.getInnerText)(l))&&(l.innerHTML=c);break;case"input":case"keyup":this._getDomValue(),this._updateDomValue();break;case"keydown":case"mousedown":this.editor.selection=this.editor.getDomSelection();break;case"click":e.ctrlKey&&this.editable.value&&(0,f.isUrl)(this.value)&&(e.preventDefault(),window.open(this.value,"_blank","noreferrer"));break;case"cut":case"paste":setTimeout((function(){o._getDomValue(),o._updateDomValue()}),1)}var h=n.field;if(i===h)switch(t){case"blur":this._getDomField(!0),this._updateDomField();var d=this._escapeHTML(this.field);d!==this._unescapeHTML((0,f.getInnerText)(h))&&(h.innerHTML=d);break;case"input":this._getDomField(),this._updateSchema(),this._updateDomField(),this._updateDomValue();break;case"keydown":case"mousedown":this.editor.selection=this.editor.getDomSelection();break;case"keyup":this._getDomField(),this._updateDomField();break;case"cut":case"paste":setTimeout((function(){o._getDomField(),o._updateDomField()}),1)}var u=n.tree;u&&i===u.parentNode&&"click"===t&&!e.hasMoved&&((void 0!==e.offsetX?e.offsetX<24*(this.getLevel()+1):e.pageX<(0,f.getAbsoluteLeft)(n.tdSeparator))||r?h&&((0,f.setEndOfContentEditable)(h),h.focus()):l&&!this.enum&&((0,f.setEndOfContentEditable)(l),l.focus())),(i!==n.tdExpand||r)&&i!==n.tdField&&i!==n.tdSeparator||"click"!==t||e.hasMoved||h&&((0,f.setEndOfContentEditable)(h),h.focus()),"keydown"===t&&this.onKeyDown(e),"function"==typeof this.editor.options.onEvent&&this._onEvent(e)}},{key:"_onEvent",value:function(e){var t=e.target,i=t===this.dom.field,n=t===this.dom.value||t===this.dom.checkbox||t===this.dom.select;if(i||n){var o={field:this.getField(),path:this.getPath()};n&&!this._hasChilds()&&(o.value=this.getValue()),this.editor.options.onEvent(o,e)}}},{key:"onKeyDown",value:function(t){var i,n,o,r,s,a,l,c,h,d,u,g,p,m=t.which||t.keyCode,v=t.target||t.srcElement,C=t.ctrlKey,y=t.shiftKey,I=t.altKey,b=!1,A="tree"===this.editor.options.mode,w=this.editor.multiselection.nodes.length>0?this.editor.multiselection.nodes:[this],S=w[0],x=w[w.length-1];if(13===m){if(v===this.dom.value)this.editable.value&&!t.ctrlKey||(0,f.isUrl)(this.value)&&(window.open(this.value,"_blank","noreferrer"),b=!0);else if(v===this.dom.expand&&this._hasChilds()){var k=t.ctrlKey;this._onExpand(k),v.focus(),b=!0}}else if(68===m)C&&A&&(e.onDuplicate(w),b=!0);else if(69===m)C&&(this._onExpand(y),v.focus(),b=!0);else if(77===m&&A)C&&(this.showContextMenu(v),b=!0);else if(46===m&&A)C&&(e.onRemove(w),b=!0);else if(45===m&&A)C&&!y?(this._onInsertBefore(),b=!0):C&&y&&(this._onInsertAfter(),b=!0);else if(35===m){if(I){var T=this._lastNode();T&&T.focus(e.focusElement||this._getElementName(v)),b=!0}}else if(36===m){if(I){var E=this._firstNode();E&&E.focus(e.focusElement||this._getElementName(v)),b=!0}}else if(37===m){if(I&&!y){var R=this._previousElement(v);R&&this.focus(this._getElementName(R)),b=!0}else if(I&&y&&A){if(x.expanded){var _=x.getAppendDom();o=_?_.nextSibling:void 0}else o=x.getDom().nextSibling;if(o){n=e.getNodeFromTarget(o),r=o.nextSibling;var L=e.getNodeFromTarget(r);n&&n instanceof N&&1!==x.parent.childs.length&&L&&L.parent&&(s=this.editor.getDomSelection(),a=(l=S.parent).childs[x.getIndex()+1]||l.append,c=S.getIndex(),h=L.getIndex(),d=l.getInternalPath(),u=L.parent.getInternalPath(),w.forEach((function(e){L.parent.moveBefore(e,L)})),this.focus(e.focusElement||this._getElementName(v)),this.editor._onAction("moveNodes",{count:w.length,fieldNames:w.map($),oldParentPath:l.getInternalPath(),newParentPath:S.parent.getInternalPath(),oldIndex:a.getIndex(),newIndex:S.getIndex(),oldIndexRedo:c,newIndexRedo:h,oldParentPathRedo:d,newParentPathRedo:u,oldSelection:s,newSelection:this.editor.getDomSelection()}))}}}else if(38===m)I&&!y?((i=this._previousNode())&&(this.editor.deselect(!0),i.focus(e.focusElement||this._getElementName(v))),b=!0):!I&&C&&y&&A?((i=this._previousNode())&&((p=this.editor.multiselection).start=p.start||this,p.end=i,g=this.editor._findTopLevelNodes(p.start,p.end),this.editor.select(g),i.focus("field")),b=!0):I&&y&&A&&((i=S._previousNode())&&i.parent&&(s=this.editor.getDomSelection(),a=(l=S.parent).childs[x.getIndex()+1]||l.append,c=S.getIndex(),h=i.getIndex(),d=l.getInternalPath(),u=i.parent.getInternalPath(),w.forEach((function(e){i.parent.moveBefore(e,i)})),this.focus(e.focusElement||this._getElementName(v)),this.editor._onAction("moveNodes",{count:w.length,fieldNames:w.map($),oldParentPath:l.getInternalPath(),newParentPath:S.parent.getInternalPath(),oldIndex:a.getIndex(),newIndex:S.getIndex(),oldIndexRedo:c,newIndexRedo:h,oldParentPathRedo:d,newParentPathRedo:u,oldSelection:s,newSelection:this.editor.getDomSelection()})),b=!0);else if(39===m){if(I&&!y){var M=this._nextElement(v);M&&this.focus(this._getElementName(M)),b=!0}else if(I&&y&&A){var B=S.getDom().previousSibling;B&&(i=e.getNodeFromTarget(B))&&i.parent&&!i.isVisible()&&(s=this.editor.getDomSelection(),a=(l=S.parent).childs[x.getIndex()+1]||l.append,c=S.getIndex(),h=i.getIndex(),d=l.getInternalPath(),u=i.parent.getInternalPath(),w.forEach((function(e){i.parent.moveBefore(e,i)})),this.focus(e.focusElement||this._getElementName(v)),this.editor._onAction("moveNodes",{count:w.length,fieldNames:w.map($),oldParentPath:l.getInternalPath(),newParentPath:S.parent.getInternalPath(),oldIndex:a.getIndex(),newIndex:S.getIndex(),oldIndexRedo:c,newIndexRedo:h,oldParentPathRedo:d,newParentPathRedo:u,oldSelection:s,newSelection:this.editor.getDomSelection()}))}}else if(40===m)if(I&&!y)(n=this._nextNode())&&(this.editor.deselect(!0),n.focus(e.focusElement||this._getElementName(v))),b=!0;else if(!I&&C&&y&&A)(n=this._nextNode())&&((p=this.editor.multiselection).start=p.start||this,p.end=n,g=this.editor._findTopLevelNodes(p.start,p.end),this.editor.select(g),n.focus("field")),b=!0;else if(I&&y&&A){(n=x.expanded?x.append?x.append._nextNode():void 0:x._nextNode())&&!n.isVisible()&&(n=n.parent.showMore),n&&n instanceof N&&(n=x);var W=n&&(n._nextNode()||n.parent.append);W&&W.parent&&(s=this.editor.getDomSelection(),a=(l=S.parent).childs[x.getIndex()+1]||l.append,c=S.getIndex(),h=W.getIndex(),d=l.getInternalPath(),u=W.parent.getInternalPath(),w.forEach((function(e){W.parent.moveBefore(e,W)})),this.focus(e.focusElement||this._getElementName(v)),this.editor._onAction("moveNodes",{count:w.length,fieldNames:w.map($),oldParentPath:l.getInternalPath(),newParentPath:S.parent.getInternalPath(),oldParentPathRedo:d,newParentPathRedo:u,oldIndexRedo:c,newIndexRedo:h,oldIndex:a.getIndex(),newIndex:S.getIndex(),oldSelection:s,newSelection:this.editor.getDomSelection()})),b=!0}b&&(t.preventDefault(),t.stopPropagation())}},{key:"_onExpand",value:function(e){var t,i,n;e&&(n=(i=(t=this.dom.tr.parentNode).parentNode).scrollTop,i.removeChild(t)),this.expanded?this.collapse(e):this.expand(e),e&&(i.appendChild(t),i.scrollTop=n),"function"==typeof this.editor.options.onExpand&&this.editor.options.onExpand({path:this.getPath(),isExpand:this.expanded,recursive:e})}},{key:"_showColorPicker",value:function(){if("function"==typeof this.editor.options.onColorPicker&&this.dom.color){var e=this;e._deleteDomColor(),e.updateDom();var t=(0,m.p)(this.dom.color,this.editor.getPopupAnchor());this.editor.options.onColorPicker(t,this.value,(function(t){"string"==typeof t&&t!==e.value&&(e._deleteDomColor(),e.value=t,e.updateDom(),e._debouncedOnChangeValue())}))}}},{key:"getFieldNames",value:function(e){return"object"===this.type?this.childs.filter((function(t){return t!==e})).map((function(e){return e.field})):[]}},{key:"_onInsertBefore",value:function(t,i,n){var o=this.editor.getDomSelection(),r=new e(this.editor,{field:void 0!==t?t:"",value:void 0!==i?i:"",type:n});r.expand(!0);var s=this.getInternalPath();this.parent.insertBefore(r,this),this.editor.highlighter.unhighlight(),r.focus("field");var a=this.editor.getDomSelection();this.editor._onAction("insertBeforeNodes",{nodes:[r],paths:[r.getInternalPath()],beforePath:s,parentPath:this.parent.getInternalPath(),oldSelection:o,newSelection:a})}},{key:"_onInsertAfter",value:function(t,i,n){var o=this.editor.getDomSelection(),r=new e(this.editor,{field:void 0!==t?t:"",value:void 0!==i?i:"",type:n});r.expand(!0),this.parent.insertAfter(r,this),this.editor.highlighter.unhighlight(),r.focus("field");var s=this.editor.getDomSelection();this.editor._onAction("insertAfterNodes",{nodes:[r],paths:[r.getInternalPath()],afterPath:this.getInternalPath(),parentPath:this.parent.getInternalPath(),oldSelection:o,newSelection:s})}},{key:"_onAppend",value:function(t,i,n){var o=this.editor.getDomSelection(),r=new e(this.editor,{field:void 0!==t?t:"",value:void 0!==i?i:"",type:n});r.expand(!0),this.parent.appendChild(r),this.editor.highlighter.unhighlight(),r.focus("field");var s=this.editor.getDomSelection();this.editor._onAction("appendNodes",{nodes:[r],paths:[r.getInternalPath()],parentPath:this.parent.getInternalPath(),oldSelection:o,newSelection:s})}},{key:"_onChangeType",value:function(e){var t=this.type;if(e!==t){var i=this.editor.getDomSelection();this.changeType(e);var n=this.editor.getDomSelection();this.editor._onAction("changeType",{path:this.getInternalPath(),oldType:t,newType:e,oldSelection:i,newSelection:n})}}},{key:"sort",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("string"==typeof e&&(e=(0,f.parsePath)(e)),this._hasChilds()){this.hideChilds();var n=this.childs;this.childs=this.childs.concat();var o="desc"===t?-1:1;"object"===this.type?this.childs.sort((function(e,t){return o*p()(e.field,t.field)})):this.childs.sort((function(t,i){var n=t.getNestedChild(e),r=i.getNestedChild(e);if(!n)return o;if(!r)return-o;var s=n.value,a=r.value;return"string"!=typeof s&&"string"!=typeof a?s>a?o:s<a?-o:0:o*p()(s,a)})),this._updateDomIndexes(),this.showChilds(),!0===i&&this.editor._onAction("sort",{path:this.getInternalPath(),oldChilds:n,newChilds:this.childs})}}},{key:"update",value:function(e){var t=this.getInternalValue();this.setValue(e),this.editor._onAction("transform",{path:this.getInternalPath(),oldValue:t,newValue:this.getInternalValue()})}},{key:"_detachFromDom",value:function(){var e,t=this.dom.tr?this.dom.tr.parentNode:void 0,i=(e=this.expanded?this.getAppendDom():this.getDom())&&e.parentNode?e.nextSibling:void 0;return this.hide({resetVisibleChilds:!1}),{table:t,nextTr:i}}},{key:"_attachToDom",value:function(e){e.table&&(e.nextTr?e.table.insertBefore(this.getDom(),e.nextTr):e.table.appendChild(this.getDom())),this.expanded&&this.showChilds()}},{key:"transform",value:function(e){if(this._hasChilds()){this.hideChilds();try{var t=this.getInternalValue(),i=this.getValue(),n=this.editor.options.executeQuery(i,e);this.setValue(n);var o=this.getInternalValue();this.editor._onAction("transform",{path:this.getInternalPath(),oldValue:t,newValue:o}),this.showChilds()}catch(e){this.showChilds(),this.editor._onError(e)}}}},{key:"extract",value:function(){this.editor.node.hideChilds(),this.hideChilds();try{var e=this.editor.node.getInternalValue();this.editor._setRoot(this);var t=this.editor.node.getInternalValue();this.editor._onAction("transform",{path:this.editor.node.getInternalPath(),oldValue:e,newValue:t})}catch(e){this.editor._onError(e)}finally{this.updateDom({recurse:!0}),this.showChilds()}}},{key:"getNestedChild",value:function(e){for(var t=0,i=this;i&&t<e.length;)i=i.findChildByProperty(e[t]),t++;return i}},{key:"findChildByProperty",value:function(e){if("object"===this.type)return this.childs.find((function(t){return t.field===e}))}},{key:"getAppendDom",value:function(){return this.append||(this.append=new N(this.editor),this.append.setParent(this)),this.append.getDom()}},{key:"getShowMoreDom",value:function(){return this.showMore||(this.showMore=new M(this.editor,this)),this.showMore.getDom()}},{key:"nextSibling",value:function(){var e=this.parent.childs.indexOf(this);return this.parent.childs[e+1]||this.parent.append}},{key:"_previousNode",value:function(){var t=null,i=this.getDom();if(i&&i.parentNode){var n=i;do{n=n.previousSibling,t=e.getNodeFromTarget(n)}while(n&&t&&t instanceof N&&!t.isVisible())}return t}},{key:"_nextNode",value:function(){var t=null,i=this.getDom();if(i&&i.parentNode){var n=i;do{n=n.nextSibling,t=e.getNodeFromTarget(n)}while(n&&t&&t instanceof N&&!t.isVisible())}return t}},{key:"_firstNode",value:function(){var t=null,i=this.getDom();if(i&&i.parentNode){var n=i.parentNode.firstChild;t=e.getNodeFromTarget(n)}return t}},{key:"_lastNode",value:function(){var t=null,i=this.getDom();if(i&&i.parentNode){var n=i.parentNode.lastChild;for(t=e.getNodeFromTarget(n);n&&t&&!t.isVisible();)n=n.previousSibling,t=e.getNodeFromTarget(n)}return t}},{key:"_previousElement",value:function(e){var t=this.dom;switch(e){case t.value:if(this.fieldEditable)return t.field;case t.field:if(this._hasChilds())return t.expand;case t.expand:return t.menu;case t.menu:if(t.drag)return t.drag;default:return null}}},{key:"_nextElement",value:function(e){var t=this.dom;switch(e){case t.drag:return t.menu;case t.menu:if(this._hasChilds())return t.expand;case t.expand:if(this.fieldEditable)return t.field;case t.field:if(!this._hasChilds())return t.value;default:return null}}},{key:"_getElementName",value:function(e){var t=this;return Object.keys(this.dom).find((function(i){return t.dom[i]===e}))}},{key:"_hasChilds",value:function(){return"array"===this.type||"object"===this.type}},{key:"addTemplates",value:function(e,t){var i=this,n=i.editor.options.templates;if(null!=n){n.length&&e.push({type:"separator"});var o=function(e,t){i._onAppend(e,t)},r=function(e,t){i._onInsertBefore(e,t)};n.forEach((function(i){e.push({text:i.text,className:i.className||"jsoneditor-type-object",title:i.title,click:t?o.bind(this,i.field,i.value):r.bind(this,i.field,i.value)})}))}}},{key:"showContextMenu",value:function(t,i){var n=this,r=[];if(this.editable.value&&r.push({text:(0,h.Tl)("type"),title:(0,h.Tl)("typeTitle"),className:"jsoneditor-type-"+this.type,submenu:[{text:(0,h.Tl)("auto"),className:"jsoneditor-type-auto"+("auto"===this.type?" jsoneditor-selected":""),title:(0,h.Tl)("autoType"),click:function(){n._onChangeType("auto")}},{text:(0,h.Tl)("array"),className:"jsoneditor-type-array"+("array"===this.type?" jsoneditor-selected":""),title:(0,h.Tl)("arrayType"),click:function(){n._onChangeType("array")}},{text:(0,h.Tl)("object"),className:"jsoneditor-type-object"+("object"===this.type?" jsoneditor-selected":""),title:(0,h.Tl)("objectType"),click:function(){n._onChangeType("object")}},{text:(0,h.Tl)("string"),className:"jsoneditor-type-string"+("string"===this.type?" jsoneditor-selected":""),title:(0,h.Tl)("stringType"),click:function(){n._onChangeType("string")}}]}),this._hasChilds()&&(this.editor.options.enableSort&&r.push({text:(0,h.Tl)("sort"),title:(0,h.Tl)("sortTitle",{type:this.type}),className:"jsoneditor-sort-asc",click:function(){n.showSortModal()}}),this.editor.options.enableTransform&&r.push({text:(0,h.Tl)("transform"),title:(0,h.Tl)("transformTitle",{type:this.type}),className:"jsoneditor-transform",click:function(){n.showTransformModal()}}),this.parent&&r.push({text:(0,h.Tl)("extract"),title:(0,h.Tl)("extractTitle",{type:this.type}),className:"jsoneditor-extract",click:function(){n.extract()}})),this.parent&&this.parent._hasChilds()){r.length&&r.push({type:"separator"});var s=n.parent.childs;if(n===s[s.length-1]){var a=[{text:(0,h.Tl)("auto"),className:"jsoneditor-type-auto",title:(0,h.Tl)("autoType"),click:function(){n._onAppend("","","auto")}},{text:(0,h.Tl)("array"),className:"jsoneditor-type-array",title:(0,h.Tl)("arrayType"),click:function(){n._onAppend("",[])}},{text:(0,h.Tl)("object"),className:"jsoneditor-type-object",title:(0,h.Tl)("objectType"),click:function(){n._onAppend("",{})}},{text:(0,h.Tl)("string"),className:"jsoneditor-type-string",title:(0,h.Tl)("stringType"),click:function(){n._onAppend("","","string")}}];n.addTemplates(a,!0),r.push({text:(0,h.Tl)("appendText"),title:(0,h.Tl)("appendTitle"),submenuTitle:(0,h.Tl)("appendSubmenuTitle"),className:"jsoneditor-append",click:function(){n._onAppend("","","auto")},submenu:a})}var l=[{text:(0,h.Tl)("auto"),className:"jsoneditor-type-auto",title:(0,h.Tl)("autoType"),click:function(){n._onInsertBefore("","","auto")}},{text:(0,h.Tl)("array"),className:"jsoneditor-type-array",title:(0,h.Tl)("arrayType"),click:function(){n._onInsertBefore("",[])}},{text:(0,h.Tl)("object"),className:"jsoneditor-type-object",title:(0,h.Tl)("objectType"),click:function(){n._onInsertBefore("",{})}},{text:(0,h.Tl)("string"),className:"jsoneditor-type-string",title:(0,h.Tl)("stringType"),click:function(){n._onInsertBefore("","","string")}}];n.addTemplates(l,!1),r.push({text:(0,h.Tl)("insert"),title:(0,h.Tl)("insertTitle"),submenuTitle:(0,h.Tl)("insertSub"),className:"jsoneditor-insert",click:function(){n._onInsertBefore("","","auto")},submenu:l}),this.editable.field&&(r.push({text:(0,h.Tl)("duplicateText"),title:(0,h.Tl)("duplicateField"),className:"jsoneditor-duplicate",click:function(){e.onDuplicate(n)}}),r.push({text:(0,h.Tl)("removeText"),title:(0,h.Tl)("removeField"),className:"jsoneditor-remove",click:function(){e.onRemove(n)}}))}if(this.editor.options.onCreateMenu){var c=n.getPath();r=this.editor.options.onCreateMenu(r,{type:"single",path:c,paths:[c]})}new o.t(r,{close:i}).show(t,this.editor.getPopupAnchor())}},{key:"showSortModal",value:function(){var e=this,t=this.editor.options.modalAnchor||y.ai,i=this.getValue();(0,v.showSortModal)(t,i,(function(t){var i=t.path,n=(0,f.parsePath)(i);e.sortedBy=t,e.sort(n,t.direction)}),e.sortedBy)}},{key:"showTransformModal",value:function(){var e=this,t=this.editor.options,i=t.modalAnchor,n=t.createQuery,o=t.executeQuery,r=t.queryDescription,s=this.getValue();(0,C.showTransformModal)({container:i||y.ai,json:s,queryDescription:r,createQuery:n,executeQuery:o,onTransform:function(t){e.transform(t)}})}},{key:"_getType",value:function(e){return e instanceof Array?"array":e instanceof Object?"object":"string"==typeof e&&"string"!=typeof(0,f.parseString)(e)?"string":"auto"}},{key:"_escapeHTML",value:function(e){if("string"!=typeof e)return String(e);var t=String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/ {2}/g," ").replace(/^ /," ").replace(/ $/," "),i=JSON.stringify(t),n=i.substring(1,i.length-1);return!0===this.editor.options.escapeUnicode&&(n=(0,f.escapeUnicodeChars)(n)),n}},{key:"_unescapeHTML",value:function(e){var t='"'+this._escapeJSON(e)+'"';return(0,f.parse)(t).replace(/</g,"<").replace(/>/g,">").replace(/ |\u00A0/g," ").replace(/&/g,"&")}},{key:"_escapeJSON",value:function(e){for(var t="",i=0;i<e.length;){var n=e.charAt(i);"\n"===n?t+="\\n":"\\"===n?(t+=n,i++,""!==(n=e.charAt(i))&&-1!=='"\\/bfnrtu'.indexOf(n)||(t+="\\"),t+=n):t+='"'===n?'\\"':n,i++}return t}},{key:"updateNodeName",value:function(){var e,t=this.childs?this.childs.length:0;if("object"===this.type||"array"===this.type){if(this.editor.options.onNodeName)try{var i=this.getValue.bind(this);e=this.editor.options.onNodeName({path:this.getPath(),size:t,type:this.type,get value(){return i()}})}catch(e){console.error("Error in onNodeName callback: ",e)}this.dom.value.textContent="object"===this.type?"{"+(e||t)+"}":"["+(e||t)+"]"}}},{key:"recursivelyUpdateNodeName",value:function(){var e;if(this.expanded&&(this.updateNodeName(),"undefined"!==this.childs))for(e in this.childs)this.childs[e].recursivelyUpdateNodeName()}}],i&&k(t.prototype,i),n&&k(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();E.prototype.DEBOUNCE_INTERVAL=150,E.prototype.MAX_SEARCH_RESULTS=999;var R=100;function _(e){return e.getInternalPath()}function $(e){return e.getField()}function L(e,t){return Object.prototype.hasOwnProperty.call(e,t)}E.focusElement=void 0,E.select=function(e){setTimeout((function(){(0,f.selectContentEditable)(e)}),0)},E.onDragStart=function(e,t){if(!Array.isArray(e))return E.onDragStart([e],t);if(0!==e.length){var i=e[0],n=e[e.length-1],o=i.parent,r=E.getNodeFromTarget(t.target),s=i.editor,a=(0,f.getAbsoluteTop)(r.dom.tr)-(0,f.getAbsoluteTop)(i.dom.tr);s.mousemove||(s.mousemove=(0,f.addEventListener)(t.view,"mousemove",(function(t){E.onDrag(e,t)}))),s.mouseup||(s.mouseup=(0,f.addEventListener)(t.view,"mouseup",(function(t){E.onDragEnd(e,t)}))),s.highlighter.lock(),s.drag={oldCursor:document.body.style.cursor,oldSelection:s.getDomSelection(),oldPaths:e.map(_),oldParent:o,oldNextNode:o.childs[n.getIndex()+1]||o.append,oldParentPathRedo:o.getInternalPath(),oldIndexRedo:i.getIndex(),mouseX:t.pageX,offsetY:a,level:i.getLevel()},document.body.style.cursor="move",t.preventDefault()}},E.onDrag=function(e,t){if(!Array.isArray(e))return E.onDrag([e],t);if(0!==e.length){var i,n,o,r,s,a,l,c,h,d,u,g=e[0].editor,p=t.pageY-g.drag.offsetY,m=t.pageX,v=!1,C=e[0],y=C.dom.tr,I=(0,f.getAbsoluteTop)(y),b=y.offsetHeight;if(p<I){i=y;do{i=i.previousSibling,a=E.getNodeFromTarget(i),c=i?(0,f.getAbsoluteTop)(i):0}while(i&&p<c);a&&!a.parent&&(a=void 0),a||(i=(s=y.parentNode.firstChild)?s.nextSibling:void 0,(a=E.getNodeFromTarget(i))===C&&(a=void 0)),a&&a.isVisible()&&p>(c=(i=a.dom.tr)?(0,f.getAbsoluteTop)(i):0)+b&&(a=void 0),!a||!1!==g.options.limitDragging&&a.parent!==e[0].parent||(e.forEach((function(e){a.parent.moveBefore(e,a)})),v=!0)}else{var A=e[e.length-1];if(o=(r=A.expanded&&A.append?A.append.getDom():A.dom.tr)?r.nextSibling:void 0){h=(0,f.getAbsoluteTop)(o),n=o;do{l=E.getNodeFromTarget(n),n&&(d=n.nextSibling?(0,f.getAbsoluteTop)(n.nextSibling):0,u=n?d-h:0,l&&l.parent.childs.length===e.length&&l.parent.childs[e.length-1]===A&&(I+=27),n=n.nextSibling)}while(n&&p>I+u);if(l&&l.parent){var w=m-g.drag.mouseX,S=Math.round(w/24/2),x=g.drag.level+S,k=l.getLevel();for(i=l.dom.tr&&l.dom.tr.previousSibling;k<x&&i;){if(a=E.getNodeFromTarget(i),e.some((function(e){return e===a||a.isDescendantOf(e)})));else{if(!(a instanceof N))break;var T=a.parent.childs;if(T.length===e.length&&T[e.length-1]===A)break;k=(l=E.getNodeFromTarget(i)).getLevel()}i=i.previousSibling}l instanceof N&&!l.isVisible()&&l.parent.showMore.isVisible()&&(l=l._nextNode()),l&&(!1===g.options.limitDragging||l.parent===e[0].parent)&&l.dom.tr&&l.dom.tr!==r.nextSibling&&(e.forEach((function(e){l.parent.moveBefore(e,l)})),v=!0)}}}v&&(g.drag.mouseX=m,g.drag.level=C.getLevel()),g.startAutoScroll(p),t.preventDefault()}},E.onDragEnd=function(e,t){if(!Array.isArray(e))return E.onDrag([e],t);if(0!==e.length){var i=e[0],n=i.editor;i&&i.dom.menu&&i.dom.menu.focus();var o=n.drag.oldParent.getInternalPath(),r=i.parent.getInternalPath(),s=n.drag.oldParent===i.parent,a=n.drag.oldNextNode.getIndex(),l=i.getIndex(),c=n.drag.oldParentPathRedo,h=n.drag.oldIndexRedo,d=s&&h<l?l+e.length:l;s&&h===l||n._onAction("moveNodes",{count:e.length,fieldNames:e.map($),oldParentPath:o,newParentPath:r,oldIndex:a,newIndex:l,oldIndexRedo:h,newIndexRedo:d,oldParentPathRedo:c,newParentPathRedo:null,oldSelection:n.drag.oldSelection,newSelection:n.getDomSelection()}),document.body.style.cursor=n.drag.oldCursor,n.highlighter.unlock(),e.forEach((function(e){e.updateDom(),t.target!==e.dom.drag&&t.target!==e.dom.menu&&n.highlighter.unhighlight()})),delete n.drag,n.mousemove&&((0,f.removeEventListener)(t.view,"mousemove",n.mousemove),delete n.mousemove),n.mouseup&&((0,f.removeEventListener)(t.view,"mouseup",n.mouseup),delete n.mouseup),n.stopAutoScroll(),t.preventDefault()}},E._findEnum=function(e){if(e.enum)return e.enum;var t=e.oneOf||e.anyOf||e.allOf;if(t){var i=t.filter((function(e){return e.enum}));if(i.length>0)return i[0].enum}return null},E._findSchema=function(e,t,i){for(var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=i.slice(1,i.length),r=i[0],s=[n],a=0,l=[n.oneOf,n.anyOf,n.allOf];a<l.length;a++){var c=l[a];Array.isArray(c)&&(s=s.concat(c))}var h,d=A(s);try{for(d.s();!(h=d.n()).done;){if("$ref"in(n=h.value)&&"string"==typeof n.$ref){var u,g=n.$ref;if(g in t)n=t[g];else{if(!g.startsWith("#/")){if(1===(null===(u=g.match(/#\//g))||void 0===u?void 0:u.length)){var p=b(g.split("#/"),2),m=p[0],f=p[1];if(m in t){var v=t[m],C={$ref:"#/".concat(f)},y=[];return y.push(r),o.length>0&&y.push.apply(y,I(o)),E._findSchema(v,t,y,C)}throw Error("Unable to resolve reference ".concat(g))}throw Error("Unable to resolve reference ".concat(g))}var w=g.substring(2).split("/");n=e;var S,k=A(w);try{for(k.s();!(S=k.n()).done;){var T=S.value;if(!(T in n))throw Error("Unable to resolve reference ".concat(g));n=n[T]}}catch(e){k.e(e)}finally{k.f()}}}if(void 0===r)return n;if("string"!=typeof r){if("number"==typeof r&&"object"===x(n.items)&&null!==n.items)return n=n.items,E._findSchema(e,t,o,n)}else{if("object"===x(n.properties)&&null!==n.properties&&r in n.properties)return n=n.properties[r],E._findSchema(e,t,o,n);if("object"===x(n.patternProperties)&&null!==n.patternProperties)for(var R in n.patternProperties)if(r.match(R))return n=n.patternProperties[R],E._findSchema(e,t,o,n);if("object"===x(n.additionalProperties))return n=n.additionalProperties,E._findSchema(e,t,o,n)}}}catch(e){d.e(e)}finally{d.f()}return null},E.onRemove=function(e){if(!Array.isArray(e))return E.onRemove([e]);if(e&&e.length>0){var t=e[0],i=t.parent,n=t.editor,o=t.getIndex();n.highlighter.unhighlight();var r=n.getDomSelection();E.blurNodes(e);var s=n.getDomSelection(),a=e.map(_);e.forEach((function(e){e.parent._remove(e)})),n._onAction("removeNodes",{nodes:e,paths:a,parentPath:i.getInternalPath(),index:o,oldSelection:r,newSelection:s})}},E.onDuplicate=function(e){if(!Array.isArray(e))return E.onDuplicate([e]);if(e&&e.length>0){var t=e[e.length-1],i=t.parent,n=t.editor;n.deselect(n.multiselection.nodes);var o=n.getDomSelection(),r=t,s=e.map((function(e){var t=e.clone();if("object"===e.parent.type){var n=e.parent.getFieldNames();t.field=(0,f.findUniqueName)(e.field,n)}return i.insertAfter(t,r),r=t,t}));1===e.length?"object"===s[0].parent.type?(s[0].dom.field.innerHTML=e[0]._escapeHTML(e[0].field),s[0].focus("field")):s[0].focus():n.select(s);var a=n.getDomSelection();n._onAction("duplicateNodes",{paths:e.map(_),clonePaths:s.map(_),afterPath:t.getInternalPath(),parentPath:i.getInternalPath(),oldSelection:o,newSelection:a})}},E.getNodeFromTarget=function(e){for(;e;){if(e.node)return e.node;e=e.parentNode}},E.targetIsColorPicker=function(e){var t=E.getNodeFromTarget(e);if(t)for(var i=e&&e.parentNode;i;){if(i===t.dom.color)return!0;i=i.parentNode}return!1},E.blurNodes=function(e){if(Array.isArray(e)){var t=e[0],i=t.parent,n=t.getIndex();i.childs[n+e.length]?i.childs[n+e.length].focus():i.childs[n-1]?i.childs[n-1].focus():i.focus()}else E.blurNodes([e])};var N=function(e){function t(e){this.editor=e,this.dom={}}return t.prototype=new e,t.prototype.getDom=function(){var e=this.dom;if(e.tr)return e.tr;this._updateEditability();var t=document.createElement("tr");if(t.className="jsoneditor-append",t.node=this,e.tr=t,"tree"===this.editor.options.mode){e.tdDrag=document.createElement("td");var i=document.createElement("td");e.tdMenu=i;var n=document.createElement("button");n.type="button",n.className="jsoneditor-button jsoneditor-contextmenu-button",n.title="Click to open the actions menu (Ctrl+M)",e.menu=n,i.appendChild(e.menu)}var o=document.createElement("td"),r=document.createElement("div");return r.appendChild(document.createTextNode("("+(0,h.Tl)("empty")+")")),r.className="jsoneditor-readonly",o.appendChild(r),e.td=o,e.text=r,this.updateDom(),t},t.prototype.getPath=function(){return null},t.prototype.getIndex=function(){return null},t.prototype.updateDom=function(e){var t=this.dom,i=t.td;i&&(i.style.paddingLeft=24*this.getLevel()+26+"px");var n=t.text;n&&(n.firstChild.nodeValue="("+(0,h.Tl)("empty")+" "+this.parent.type+")");var o=t.tr;this.isVisible()?t.tr.firstChild||(t.tdDrag&&o.appendChild(t.tdDrag),t.tdMenu&&o.appendChild(t.tdMenu),o.appendChild(i)):t.tr.firstChild&&(t.tdDrag&&o.removeChild(t.tdDrag),t.tdMenu&&o.removeChild(t.tdMenu),o.removeChild(i))},t.prototype.isVisible=function(){return 0===this.parent.childs.length},t.prototype.showContextMenu=function(e,t){var i=this,n=[{text:(0,h.Tl)("auto"),className:"jsoneditor-type-auto",title:(0,h.Tl)("autoType"),click:function(){i._onAppend("","","auto")}},{text:(0,h.Tl)("array"),className:"jsoneditor-type-array",title:(0,h.Tl)("arrayType"),click:function(){i._onAppend("",[])}},{text:(0,h.Tl)("object"),className:"jsoneditor-type-object",title:(0,h.Tl)("objectType"),click:function(){i._onAppend("",{})}},{text:(0,h.Tl)("string"),className:"jsoneditor-type-string",title:(0,h.Tl)("stringType"),click:function(){i._onAppend("","","string")}}];i.addTemplates(n,!0);var r=[{text:(0,h.Tl)("appendText"),title:(0,h.Tl)("appendTitleAuto"),submenuTitle:(0,h.Tl)("appendSubmenuTitle"),className:"jsoneditor-insert",click:function(){i._onAppend("","","auto")},submenu:n}];if(this.editor.options.onCreateMenu){var s=i.parent.getPath();r=this.editor.options.onCreateMenu(r,{type:"append",path:s,paths:[s]})}new o.t(r,{close:t}).show(e,this.editor.getPopupAnchor())},t.prototype.onEvent=function(e){var t=e.type,i=e.target||e.srcElement,n=this.dom;if(i===n.menu&&("mouseover"===t?this.editor.highlighter.highlight(this.parent):"mouseout"===t&&this.editor.highlighter.unhighlight()),"click"===t&&i===n.menu){var o=this.editor.highlighter;o.highlight(this.parent),o.lock(),(0,f.addClassName)(n.menu,"jsoneditor-selected"),this.showContextMenu(n.menu,(function(){(0,f.removeClassName)(n.menu,"jsoneditor-selected"),o.unlock(),o.unhighlight()}))}"keydown"===t&&this.onKeyDown(e)},t}(E),M=function(e){function t(e,t){this.editor=e,this.parent=t,this.dom={}}return t.prototype=new e,t.prototype.getDom=function(){if(this.dom.tr)return this.dom.tr;if(this._updateEditability(),!this.dom.tr){var e=this,t=this.parent,i=document.createElement("a");i.appendChild(document.createTextNode((0,h.Tl)("showMore"))),i.href="#",i.onclick=function(i){return t.visibleChilds=Math.floor(t.visibleChilds/t.getMaxVisibleChilds()+1)*t.getMaxVisibleChilds(),e.updateDom(),t.showChilds(),i.preventDefault(),!1};var n=document.createElement("a");n.appendChild(document.createTextNode((0,h.Tl)("showAll"))),n.href="#",n.onclick=function(i){return t.visibleChilds=1/0,e.updateDom(),t.showChilds(),i.preventDefault(),!1};var o=document.createElement("div"),r=document.createTextNode(this._getShowMoreText());o.className="jsoneditor-show-more",o.appendChild(r),o.appendChild(i),o.appendChild(document.createTextNode(". ")),o.appendChild(n),o.appendChild(document.createTextNode(". "));var s=document.createElement("td");s.appendChild(o);var a=document.createElement("tr");"tree"===this.editor.options.mode&&(a.appendChild(document.createElement("td")),a.appendChild(document.createElement("td"))),a.appendChild(s),a.className="jsoneditor-show-more",this.dom.tr=a,this.dom.moreContents=o,this.dom.moreText=r}return this.updateDom(),this.dom.tr},t.prototype.updateDom=function(e){if(this.isVisible()){if(this.dom.tr.node=this.parent.childs[this.parent.visibleChilds],!this.dom.tr.parentNode){var t=this.parent._getNextTr();t&&t.parentNode.insertBefore(this.dom.tr,t)}this.dom.moreText.nodeValue=this._getShowMoreText(),this.dom.moreContents.style.marginLeft=24*(this.getLevel()+1)+"px"}else this.dom.tr&&this.dom.tr.parentNode&&this.dom.tr.parentNode.removeChild(this.dom.tr)},t.prototype._getShowMoreText=function(){return(0,h.Tl)("showMoreStatus",{visibleChilds:this.parent.visibleChilds,totalChilds:this.parent.childs.length})+" "},t.prototype.isVisible=function(){return this.parent.expanded&&this.parent.childs.length>this.parent.visibleChilds},t.prototype.onEvent=function(e){"keydown"===e.type&&this.onKeyDown(e)},t}(E);function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}function W(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,P(n.key),n)}}function P(e){var t=function(e,t){if("object"!=B(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=B(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==B(t)?t:String(t)}var H=function(){function e(t){function i(e){return t.node.findNodeByInternalPath(e)}!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.editor=t,this.history=[],this.index=-1,this.clear(),this.actions={editField:{undo:function(e){i(e.parentPath).childs[e.index].updateField(e.oldValue)},redo:function(e){i(e.parentPath).childs[e.index].updateField(e.newValue)}},editValue:{undo:function(e){i(e.path).updateValue(e.oldValue)},redo:function(e){i(e.path).updateValue(e.newValue)}},changeType:{undo:function(e){i(e.path).changeType(e.oldType)},redo:function(e){i(e.path).changeType(e.newType)}},appendNodes:{undo:function(e){var t=i(e.parentPath);e.paths.map(i).forEach((function(e){t.removeChild(e)}))},redo:function(e){var t=i(e.parentPath);e.nodes.forEach((function(e){t.appendChild(e)}))}},insertBeforeNodes:{undo:function(e){var t=i(e.parentPath);e.paths.map(i).forEach((function(e){t.removeChild(e)}))},redo:function(e){var t=i(e.parentPath),n=i(e.beforePath);e.nodes.forEach((function(e){t.insertBefore(e,n)}))}},insertAfterNodes:{undo:function(e){var t=i(e.parentPath);e.paths.map(i).forEach((function(e){t.removeChild(e)}))},redo:function(e){var t=i(e.parentPath),n=i(e.afterPath);e.nodes.forEach((function(e){t.insertAfter(e,n),n=e}))}},removeNodes:{undo:function(e){var t=i(e.parentPath),n=t.childs[e.index]||t.append;e.nodes.forEach((function(e){t.insertBefore(e,n)}))},redo:function(e){var t=i(e.parentPath);e.paths.map(i).forEach((function(e){t.removeChild(e)}))}},duplicateNodes:{undo:function(e){var t=i(e.parentPath);e.clonePaths.map(i).forEach((function(e){t.removeChild(e)}))},redo:function(e){var t=i(e.parentPath),n=i(e.afterPath);e.paths.map(i).forEach((function(e){var i=e.clone();if("object"===t.type){var o=t.getFieldNames();i.field=(0,f.findUniqueName)(e.field,o)}t.insertAfter(i,n),n=i}))}},moveNodes:{undo:function(e){var t=i(e.oldParentPath),n=i(e.newParentPath),o=t.childs[e.oldIndex]||t.append;n.childs.slice(e.newIndex,e.newIndex+e.count).forEach((function(i,n){i.field=e.fieldNames[n],t.moveBefore(i,o)})),null===e.newParentPathRedo&&(e.newParentPathRedo=n.getInternalPath())},redo:function(e){var t=i(e.oldParentPathRedo),n=i(e.newParentPathRedo),o=n.childs[e.newIndexRedo]||n.append;t.childs.slice(e.oldIndexRedo,e.oldIndexRedo+e.count).forEach((function(t,i){t.field=e.fieldNames[i],n.moveBefore(t,o)}))}},sort:{undo:function(e){var t=i(e.path);t.hideChilds(),t.childs=e.oldChilds,t.updateDom({updateIndexes:!0}),t.showChilds()},redo:function(e){var t=i(e.path);t.hideChilds(),t.childs=e.newChilds,t.updateDom({updateIndexes:!0}),t.showChilds()}},transform:{undo:function(e){i(e.path).setInternalValue(e.oldValue)},redo:function(e){i(e.path).setInternalValue(e.newValue)}}}}var t,i,n;return t=e,(i=[{key:"onChange",value:function(){}},{key:"add",value:function(e,t){this.index++,this.history[this.index]={action:e,params:t,timestamp:new Date},this.index<this.history.length-1&&this.history.splice(this.index+1,this.history.length-this.index-1),this.onChange()}},{key:"clear",value:function(){this.history=[],this.index=-1,this.onChange()}},{key:"canUndo",value:function(){return this.index>=0}},{key:"canRedo",value:function(){return this.index<this.history.length-1}},{key:"undo",value:function(){if(this.canUndo()){var e=this.history[this.index];if(e){var t=this.actions[e.action];if(t&&t.undo){if(t.undo(e.params),e.params.oldSelection)try{this.editor.setDomSelection(e.params.oldSelection)}catch(e){console.error(e)}}else console.error(new Error('unknown action "'+e.action+'"'))}this.index--,this.onChange()}}},{key:"redo",value:function(){if(this.canRedo()){this.index++;var e=this.history[this.index];if(e){var t=this.actions[e.action];if(t&&t.redo){if(t.redo(e.params),e.params.newSelection)try{this.editor.setDomSelection(e.params.newSelection)}catch(e){console.error(e)}}else console.error(new Error('unknown action "'+e.action+'"'))}this.onChange()}}},{key:"destroy",value:function(){this.editor=null,this.history=[],this.index=-1}}])&&W(t.prototype,i),n&&W(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function G(e){return G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G(e)}function F(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,O(n.key),n)}}function O(e){var t=function(e,t){if("object"!=G(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=G(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==G(t)?t:String(t)}var V=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=this;this.editor=t,this.timeout=void 0,this.delay=200,this.lastText=void 0,this.results=null,this.dom={},this.dom.container=i;var o=document.createElement("div");this.dom.wrapper=o,o.className="jsoneditor-search",i.appendChild(o);var r=document.createElement("div");this.dom.results=r,r.className="jsoneditor-results",o.appendChild(r);var s=document.createElement("div");this.dom.input=s,s.className="jsoneditor-frame",s.title=(0,h.Tl)("searchTitle"),o.appendChild(s);var a=document.createElement("button");a.type="button",a.className="jsoneditor-refresh",s.appendChild(a);var l=document.createElement("input");l.type="text",this.dom.search=l,l.oninput=function(e){n._onDelayedSearch(e)},l.onchange=function(e){n._onSearch()},l.onkeydown=function(e){n._onKeyDown(e)},l.onkeyup=function(e){n._onKeyUp(e)},a.onclick=function(e){l.select()},s.appendChild(l);var c=document.createElement("button");c.type="button",c.title=(0,h.Tl)("searchNextResultTitle"),c.className="jsoneditor-next",c.onclick=function(){n.next()},s.appendChild(c);var d=document.createElement("button");d.type="button",d.title=(0,h.Tl)("searchPreviousResultTitle"),d.className="jsoneditor-previous",d.onclick=function(){n.previous()},s.appendChild(d)}var t,i,n;return t=e,(i=[{key:"next",value:function(e){if(this.results){var t=null!==this.resultIndex?this.resultIndex+1:0;t>this.results.length-1&&(t=0),this._setActiveResult(t,e)}}},{key:"previous",value:function(e){if(this.results){var t=this.results.length-1,i=null!==this.resultIndex?this.resultIndex-1:t;i<0&&(i=t),this._setActiveResult(i,e)}}},{key:"_setActiveResult",value:function(e,t){if(this.activeResult){var i=this.activeResult.node;"field"===this.activeResult.elem?delete i.searchFieldActive:delete i.searchValueActive,i.updateDom()}if(!this.results||!this.results[e])return this.resultIndex=void 0,void(this.activeResult=void 0);this.resultIndex=e;var n=this.results[this.resultIndex].node,o=this.results[this.resultIndex].elem;"field"===o?n.searchFieldActive=!0:n.searchValueActive=!0,this.activeResult=this.results[this.resultIndex],n.updateDom(),n.scrollTo((function(){t&&n.focus(o)}))}},{key:"_clearDelay",value:function(){void 0!==this.timeout&&(clearTimeout(this.timeout),delete this.timeout)}},{key:"_onDelayedSearch",value:function(e){this._clearDelay();var t=this;this.timeout=setTimeout((function(e){t._onSearch()}),this.delay)}},{key:"_onSearch",value:function(e){this._clearDelay();var t=this.dom.search.value,i=t.length>0?t:void 0;if(i!==this.lastText||e){this.lastText=i,this.results=this.editor.search(i);var n=this.results[0]?this.results[0].node.MAX_SEARCH_RESULTS:1/0,o=0;if(this.activeResult)for(var r=0;r<this.results.length;r++)if(this.results[r].node===this.activeResult.node){o=r;break}if(this._setActiveResult(o,!1),void 0!==i){var s=this.results.length;this.dom.results.textContent=0===s?"no results":1===s?"1 result":s>n?n+"+ results":s+" results"}else this.dom.results.textContent=""}}},{key:"_onKeyDown",value:function(e){var t=e.which;27===t?(this.dom.search.value="",this._onSearch(),e.preventDefault(),e.stopPropagation()):13===t&&(e.ctrlKey?this._onSearch(!0):e.shiftKey?this.previous():this.next(),e.preventDefault(),e.stopPropagation())}},{key:"_onKeyUp",value:function(e){var t=e.keyCode;27!==t&&13!==t&&this._onDelayedSearch(e)}},{key:"clear",value:function(){this.dom.search.value="",this._onSearch()}},{key:"forceSearch",value:function(){this._onSearch(!0)}},{key:"isEmpty",value:function(){return""===this.dom.search.value}},{key:"destroy",value:function(){this.editor=null,this.dom.container.removeChild(this.dom.wrapper),this.dom=null,this.results=null,this.activeResult=null,this._clearDelay()}}])&&F(t.prototype,i),n&&F(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Z(e){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z(e)}function D(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,j(n.key),n)}}function j(e){var t=function(e,t){if("object"!=Z(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=Z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Z(t)?t:String(t)}var K=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t&&(this.root=i,this.path=document.createElement("div"),this.path.className="jsoneditor-treepath",this.path.setAttribute("tabindex",0),this.contentMenuClicked=!1,t.appendChild(this.path),this.reset())}var t,i,n;return t=e,(i=[{key:"reset",value:function(){this.path.textContent=(0,h.Tl)("selectNode")}},{key:"setPath",value:function(e){var t=this;function i(e){t.contentMenuClicked=!1,(0,f.addClassName)(t.path,"show-all"),t.path.style.width=t.path.parentNode.getBoundingClientRect().width-10+"px",t.path.onblur=function(){if(t.contentMenuClicked)return t.contentMenuClicked=!1,void t.path.focus();(0,f.removeClassName)(t.path,"show-all"),t.path.onblur=void 0,t.path.style.width="",t.setPath(e)}}function n(e){this.selectionCallback&&this.selectionCallback(e)}function r(e,t){this.contextMenuCallback&&this.contextMenuCallback(e,t)}this.path.textContent="",e&&e.length&&e.forEach((function(s,a){var l,c=document.createElement("span");if(c.className="jsoneditor-treepath-element",c.innerText=s.name,c.onclick=n.bind(t,s),t.path.appendChild(c),s.children.length&&((l=document.createElement("span")).className="jsoneditor-treepath-seperator",l.textContent="►",l.onclick=function(){t.contentMenuClicked=!0;var i=[];s.children.forEach((function(n){i.push({text:n.name,className:"jsoneditor-type-modes"+(e[a+1]+1&&e[a+1].name===n.name?" jsoneditor-selected":""),click:r.bind(t,s,n.name)})})),new o.t(i,{limitHeight:!0}).show(l,t.root,!0)},t.path.appendChild(l)),a===e.length-1){var h=(l||c).getBoundingClientRect().right;if(t.path.offsetWidth<h&&(t.path.scrollLeft=h),t.path.scrollLeft){var d=document.createElement("span");d.className="jsoneditor-treepath-show-all-btn",d.title="show all path",d.textContent="...",d.onclick=i.bind(t,e),t.path.insertBefore(d,t.path.firstChild)}}}))}},{key:"onSectionSelected",value:function(e){"function"==typeof e&&(this.selectionCallback=e)}},{key:"onContextMenuItemSelected",value:function(e){"function"==typeof e&&(this.contextMenuCallback=e)}}])&&D(t.prototype,i),n&&D(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),z=i(1746),X=i.n(z),Y={create:function(e,t){if(!e)throw new Error("No container element provided.");this.container=e,this.dom={},this.highlighter=new c,this.selection=void 0,this.multiselection={nodes:[]},this.validateSchema=null,this.validationSequence=0,this.errorNodes=[],this.lastSchemaErrors=void 0,this.node=null,this.focusTarget=null,this._setOptions(t),t.autocomplete&&(this.autocomplete=function(e){(e=e||{}).filter=e.filter||"start",e.trigger=e.trigger||"keydown",e.confirmKeys=e.confirmKeys||[39,35,9],e.caseSensitive=e.caseSensitive||!1;var t="",i="",o=document.createElement("div");o.style.position="relative",o.style.outline="0",o.style.border="0",o.style.margin="0",o.style.padding="0";var r,s,a=document.createElement("div");function l(e){var t,i;document.createRange?((t=document.createRange()).selectNodeContents(e),t.collapse(!1),(i=window.getSelection()).removeAllRanges(),i.addRange(t)):document.selection&&((t=document.body.createTextRange()).moveToElementText(e),t.collapse(!1),t.select())}function c(e){return void 0===r&&((r=document.createElement("span")).style.visibility="hidden",r.style.position="fixed",r.style.outline="0",r.style.margin="0",r.style.padding="0",r.style.border="0",r.style.left="0",r.style.whiteSpace="pre",r.style.fontSize=t,r.style.fontFamily=i,r.style.fontWeight="normal",document.body.appendChild(r)),r.textContent=e,r.getBoundingClientRect().right}a.className="autocomplete dropdown",a.style.position="absolute",a.style.visibility="hidden";var h={onArrowDown:function(){},onArrowUp:function(){},onEnter:function(){},onTab:function(){},startFrom:0,options:[],element:null,elementHint:null,elementStyle:null,wrapper:o,show:function(e,n,r){var s=this;this.startFrom=n,this.wrapper.remove(),this.elementHint&&(this.elementHint.remove(),this.elementHint=null),""===t&&(t=window.getComputedStyle(e).getPropertyValue("font-size")),""===i&&(i=window.getComputedStyle(e).getPropertyValue("font-family")),a.style.marginLeft="0",a.style.marginTop=e.getBoundingClientRect().height+"px",this.options=r.map(String),this.element!==e&&(this.element=e,this.elementStyle={zIndex:this.element.style.zIndex,position:this.element.style.position,backgroundColor:this.element.style.backgroundColor,borderColor:this.element.style.borderColor}),this.element.style.zIndex=3,this.element.style.position="relative",this.element.style.backgroundColor="transparent",this.element.style.borderColor="transparent",this.elementHint=e.cloneNode(),this.elementHint.className="autocomplete hint",this.elementHint.style.zIndex=2,this.elementHint.style.position="absolute",this.elementHint.onfocus=function(){s.element.focus()},this.element.addEventListener&&(this.element.removeEventListener("keydown",u),this.element.addEventListener("keydown",u,!1),this.element.removeEventListener("blur",g),this.element.addEventListener("blur",g,!1)),o.appendChild(this.elementHint),o.appendChild(a),e.parentElement.appendChild(o),this.repaint(e)},setText:function(e){this.element.innerText=e},getText:function(){return this.element.innerText},hideDropDown:function(){this.wrapper.remove(),this.elementHint&&(this.elementHint.remove(),this.elementHint=null,d.hide(),this.element.style.zIndex=this.elementStyle.zIndex,this.element.style.position=this.elementStyle.position,this.element.style.backgroundColor=this.elementStyle.backgroundColor,this.element.style.borderColor=this.elementStyle.borderColor)},repaint:function(t){var i=t.innerText;i=i.replace("\n","");var n=this.options.length,o=i.substring(this.startFrom);s=i.substring(0,this.startFrom);for(var r=0;r<n;r++){var l=this.options[r];if(!e.caseSensitive&&0===l.toLowerCase().indexOf(o.toLowerCase())||e.caseSensitive&&0===l.indexOf(o)){this.elementHint.innerText=s+o+l.substring(o.length),this.elementHint.realInnerText=s+l;break}}a.style.left=c(s)+"px",d.refresh(o,this.options),this.elementHint.style.width=c(this.elementHint.innerText)+10+"px","hidden"===a.style.visibility||(this.elementHint.style.width=c(this.elementHint.innerText)+a.clientWidth+"px")}},d=function(t,i){var o=[],r=0,s=-1,a=function(){this.style.backgroundColor="#ddd"},l=function(){this.style.backgroundColor=""},c=function(){h.hide(),h.onmouseselection(this.__hint,h.rs)},h={rs:i,hide:function(){t.style.visibility="hidden"},refresh:function(i,s){t.style.visibility="hidden",r=0,t.textContent="";var d=window.innerHeight||document.documentElement.clientHeight,u=t.parentNode.getBoundingClientRect(),g=u.top-6,p=d-u.bottom-6;o=[];var m="function"==typeof e.filter?e.filter:n[e.filter],f=m?s.filter((function(t){return m(e.caseSensitive?i:i.toLowerCase(),e.caseSensitive?t:t.toLowerCase(),e)})):[];0!==(o=f.map((function(e){var n=document.createElement("div");n.className="item",n.onmouseover=a,n.onmouseout=l,n.onmousedown=c,n.__hint=e,n.textContent="",n.appendChild(document.createTextNode(e.substring(0,i.length)));var o=document.createElement("b");return o.appendChild(document.createTextNode(e.substring(i.length))),n.appendChild(o),t.appendChild(n),n}))).length&&(1===o.length&&(i.toLowerCase()===o[0].__hint.toLowerCase()&&!e.caseSensitive||i===o[0].__hint&&e.caseSensitive)||o.length<2||(h.highlight(0),g>3*p?(t.style.maxHeight=g+"px",t.style.top="",t.style.bottom="100%"):(t.style.top="100%",t.style.bottom="",t.style.maxHeight=p+"px"),t.style.visibility="visible"))},highlight:function(e){-1!==s&&o[s]&&(o[s].className="item"),o[e].className="item hover",s=e},move:function(e){return"hidden"===t.style.visibility?"":(r+e===-1||r+e===o.length||(r+=e,h.highlight(r)),o[r].__hint)},onmouseselection:function(){}};return h}(a,h),u=function(t){var i=(t=t||window.event).keyCode;if(null!=this.elementHint&&33!==i&&34!==i){if(27===i)return h.hideDropDown(),h.element.focus(),t.preventDefault(),void t.stopPropagation();var n=this.element.innerText;if(n=n.replace("\n",""),e.confirmKeys.indexOf(i)>=0)return 9===i&&0===this.elementHint.innerText.length&&h.onTab(),void(this.elementHint.innerText.length>0&&this.element.innerText!==this.elementHint.realInnerText&&(this.element.innerText=this.elementHint.realInnerText,h.hideDropDown(),l(this.element),9===i&&(h.element.focus(),t.preventDefault(),t.stopPropagation())));if(13!==i){if(40===i){var o=n.substring(this.startFrom),r=d.move(1);return""===r&&h.onArrowDown(),this.elementHint.innerText=s+o+r.substring(o.length),this.elementHint.realInnerText=s+r,t.preventDefault(),void t.stopPropagation()}if(38===i){var c=n.substring(this.startFrom),u=d.move(-1);""===u&&h.onArrowUp(),this.elementHint.innerText=s+c+u.substring(c.length),this.elementHint.realInnerText=s+u,t.preventDefault(),t.stopPropagation()}}else if(0===this.elementHint.innerText.length)h.onEnter();else{var g="hidden"===a.style.visibility;if(d.hide(),g)return h.hideDropDown(),h.element.focus(),void h.onEnter();this.element.innerText=this.elementHint.realInnerText,h.hideDropDown(),l(this.element),t.preventDefault(),t.stopPropagation()}}}.bind(h),g=function(e){h.hideDropDown()};return d.onmouseselection=function(e,t){t.element.innerText=t.elementHint.innerText=s+e,t.hideDropDown(),window.setTimeout((function(){t.element.focus(),l(t.element)}),1)},h}(t.autocomplete)),this.options.history&&"view"!==this.options.mode&&(this.history=new H(this)),this._createFrame(),this._createTable()},destroy:function(){this.frame&&this.container&&this.frame.parentNode===this.container&&(this.container.removeChild(this.frame),this.frame=null),this.container=null,this.dom=null,this.clear(),this.node=null,this.focusTarget=null,this.selection=null,this.multiselection=null,this.errorNodes=null,this.validateSchema=null,this._debouncedValidate=null,this.history&&(this.history.destroy(),this.history=null),this.searchBox&&(this.searchBox.destroy(),this.searchBox=null),this.modeSwitcher&&(this.modeSwitcher.destroy(),this.modeSwitcher=null),this.frameFocusTracker.destroy()},_setOptions:function(e){var t=this;this.options={search:!0,history:!0,mode:"tree",name:void 0,schema:null,schemaRefs:null,autocomplete:null,navigationBar:!0,mainMenuBar:!0,limitDragging:!1,onSelectionChange:null,colorPicker:!0,onColorPicker:function(e,t,i){if(X()){var n=e.getBoundingClientRect().top,o=(0,f.getWindow)(e).innerHeight-n<300&&n>300;new(X())({parent:e,color:t,popup:o?"top":"bottom",onDone:function(e){var t=1===e.rgba[3]?e.hex.substr(0,7):e.hex;i(t)}}).show()}else console.warn("Cannot open color picker: the `vanilla-picker` library is not included in the bundle. Either use the full bundle or implement your own color picker using `onColorPicker`.")},timestampTag:!0,timestampFormat:null,createQuery:d.V,executeQuery:d.e,onEvent:null,enableSort:!0,enableTransform:!0},e&&(Object.keys(e).forEach((function(i){t.options[i]=e[i]})),null==e.limitDragging&&null!=e.schema&&(this.options.limitDragging=!0)),this.setSchema(this.options.schema,this.options.schemaRefs),this._debouncedValidate=(0,f.debounce)(this._validateAndCatch.bind(this),this.DEBOUNCE_INTERVAL),e.onSelectionChange&&this.onSelectionChange(e.onSelectionChange),(0,h.AI)(this.options.languages),(0,h.xC)(this.options.language)},set:function(e){if(e instanceof Function||void 0===e)this.clear();else{this.content.removeChild(this.table);var t={field:this.options.name,value:e},i=new E(this,t);this._setRoot(i),this._validateAndCatch(),this.node.expand(!1),this.content.appendChild(this.table)}this.history&&this.history.clear(),this.searchBox&&this.searchBox.clear()},update:function(e){if(!this.node.deepEqual(e)){var t=this.getSelection();if(this.onChangeDisabled=!0,this.node.update(e),this.onChangeDisabled=!1,this._validateAndCatch(),this.searchBox&&!this.searchBox.isEmpty()&&this.searchBox.forceSearch(),t&&t.start&&t.end){var i=this.node.findNodeByPath(t.start.path),n=this.node.findNodeByPath(t.end.path);i&&n?this.setSelection(t.start,t.end):this.setSelection({},{})}else this.setSelection({},{})}},get:function(){return this.node?this.node.getValue():void 0},getText:function(){return JSON.stringify(this.get())},setText:function(e){try{this.set((0,f.parse)(e))}catch(i){var t=(0,f.tryJsonRepair)(e);this.set((0,f.parse)(t))}},updateText:function(e){try{this.update((0,f.parse)(e))}catch(i){var t=(0,f.tryJsonRepair)(e);this.update((0,f.parse)(t))}},setName:function(e){this.options.name=e,this.node&&this.node.updateField(this.options.name)},getName:function(){return this.options.name},focus:function(){var e=this.scrollableContent.querySelector("[contenteditable=true]");e?e.focus():this.node.dom.expand?this.node.dom.expand.focus():this.node.dom.menu?this.node.dom.menu.focus():(e=this.frame.querySelector("button"))&&e.focus()},clear:function(){this.node&&(this.node.hide(),delete this.node),this.treePath&&this.treePath.reset()},_setRoot:function(e){this.clear(),this.node=e,e.setParent(null),e.setField(this.getName(),!1),delete e.index,this.tbody.appendChild(e.getDom())},search:function(e){var t;return this.node?(this.content.removeChild(this.table),t=this.node.search(e),this.content.appendChild(this.table)):t=[],t},expandAll:function(){this.node&&(this.content.removeChild(this.table),this.node.expand(),this.content.appendChild(this.table))},collapseAll:function(){this.node&&(this.content.removeChild(this.table),this.node.collapse(),this.content.appendChild(this.table))},expand:function(e){if(e){var t=this.node?this.node.findNodeByPath(e.path):null;t&&(e.isExpand?t.expand(e.recursive):t.collapse(e.recursive))}},_onAction:function(e,t){this.history&&this.history.add(e,t),this._onChange()},_onChange:function(){if(!this.onChangeDisabled){if(this.selection=this.getDomSelection(),this._debouncedValidate(),this.treePath){var e=this.node&&this.selection?this.node.findNodeByInternalPath(this.selection.path):this.multiselection?this.multiselection.nodes[0]:void 0;e?this._updateTreePath(e.getNodePath()):this.treePath.reset()}if(this.options.onChange)try{this.options.onChange()}catch(e){console.error("Error in onChange callback: ",e)}if(this.options.onChangeJSON)try{this.options.onChangeJSON(this.get())}catch(e){console.error("Error in onChangeJSON callback: ",e)}if(this.options.onChangeText)try{this.options.onChangeText(this.getText())}catch(e){console.error("Error in onChangeText callback: ",e)}if(this.options.onClassName&&this.node.recursivelyUpdateCssClassesOnNodes(),this.options.onNodeName&&this.node.childs)try{this.node.recursivelyUpdateNodeName()}catch(e){console.error("Error in onNodeName callback: ",e)}}},validate:function(){var e=this,t=this.node;if(t){var i=t.getValue(),n=[];this.validateSchema&&(this.validateSchema(i)||(n=this.validateSchema.errors.map((function(e){return(0,f.improveSchemaError)(e)})).map((function(e){return{node:t.findNode(e.dataPath),error:e,type:"validation"}})).filter((function(e){return null!=e.node}))));try{this.validationSequence++;var o=this,r=this.validationSequence;return this._validateCustom(i).then((function(t){if(r===o.validationSequence){var i=[].concat(n,t||[]);o._renderValidationErrors(i),"function"==typeof e.options.onValidationError&&(0,f.isValidationErrorChanged)(i,e.lastSchemaErrors)&&e.options.onValidationError.call(e,i),e.lastSchemaErrors=i}return e.lastSchemaErrors}))}catch(e){return Promise.reject(e)}}},_validateAndCatch:function(){this.validate().catch((function(e){console.error("Error running validation:",e)}))},_renderValidationErrors:function(e){this.errorNodes&&this.errorNodes.forEach((function(e){e.setError(null)}));var t=e.reduce((function(e,t){return t.node.findParents().filter((function(t){return!e.some((function(e){return e[0]===t}))})).map((function(e){return[e,t.node]})).concat(e)}),[]);this.errorNodes=t.map((function(e){return{node:e[0],child:e[1],error:{message:"object"===e[0].type?(0,h.Tl)("containsInvalidProperties"):(0,h.Tl)("containsInvalidItems")}}})).concat(e).map((function(e){return e.node.setError(e.error,e.child),e.node}))},_validateCustom:function(e){try{if(this.options.onValidate){var t=this.node,i=this.options.onValidate(e);return((0,f.isPromise)(i)?i:Promise.resolve(i)).then((function(e){return Array.isArray(e)?e.filter((function(e){var t=(0,f.isValidValidationError)(e);return t||console.warn('Ignoring a custom validation error with invalid structure. Expected structure: {path: [...], message: "..."}. Actual error:',e),t})).map((function(e){var i;try{i=e&&e.path?t.findNodeByPath(e.path):null}catch(e){}return i||console.warn("Ignoring validation error: node not found. Path:",e.path,"Error:",e),{node:i,error:e,type:"customValidation"}})).filter((function(e){return e&&e.node&&e.error&&e.error.message})):null}))}}catch(e){return Promise.reject(e)}return Promise.resolve(null)},refresh:function(){this.node&&this.node.updateDom({recurse:!0})},startAutoScroll:function(e){var t=this,i=this.scrollableContent,n=(0,f.getAbsoluteTop)(i),o=i.clientHeight,r=n+o;e<n+24&&i.scrollTop>0?this.autoScrollStep=(n+24-e)/3:e>r-24&&o+i.scrollTop<i.scrollHeight?this.autoScrollStep=(r-24-e)/3:this.autoScrollStep=void 0,this.autoScrollStep?this.autoScrollTimer||(this.autoScrollTimer=setInterval((function(){t.autoScrollStep?i.scrollTop-=t.autoScrollStep:t.stopAutoScroll()}),50)):this.stopAutoScroll()},stopAutoScroll:function(){this.autoScrollTimer&&(clearTimeout(this.autoScrollTimer),delete this.autoScrollTimer),this.autoScrollStep&&delete this.autoScrollStep},setDomSelection:function(e){if(e)if("scrollTop"in e&&this.scrollableContent&&(this.scrollableContent.scrollTop=e.scrollTop),e.paths){var t=this,i=e.paths.map((function(e){return t.node.findNodeByInternalPath(e)}));this.select(i)}else{var n=e.path?this.node.findNodeByInternalPath(e.path):null,o=n&&e.domName?n.dom[e.domName]:null;if(e.range&&o){var r=Object.assign({},e.range,{container:o});(0,f.setSelectionOffset)(r)}else n&&n.focus()}},getDomSelection:function(){var e=E.getNodeFromTarget(this.focusTarget),t=this.focusTarget,i=e?Object.keys(e.dom).find((function(i){return e.dom[i]===t})):null,n=(0,f.getSelectionOffset)();return n&&"DIV"!==n.container.nodeName&&(n=null),n&&n.container!==t&&(n=null),n&&delete n.container,{path:e?e.getInternalPath():null,domName:i,range:n,paths:this.multiselection.length>0?this.multiselection.nodes.map((function(e){return e.getInternalPath()})):null,scrollTop:this.scrollableContent?this.scrollableContent.scrollTop:0}},scrollTo:function(e,t){var i=this.scrollableContent;if(i){var n=this;n.animateTimeout&&(clearTimeout(n.animateTimeout),delete n.animateTimeout),n.animateCallback&&(n.animateCallback(!1),delete n.animateCallback);var o=i.clientHeight,r=i.scrollHeight-o,s=Math.min(Math.max(e-o/4,0),r);!function e(){var o=i.scrollTop,r=s-o;Math.abs(r)>3?(i.scrollTop+=r/3,n.animateCallback=t,n.animateTimeout=setTimeout(e,50)):(t&&t(!0),i.scrollTop=s,delete n.animateTimeout,delete n.animateCallback)}()}else t&&t(!1)},_createFrame:function(){var e=this;this.frame=document.createElement("div"),this.frame.className="jsoneditor jsoneditor-mode-"+this.options.mode,this.container.appendChild(this.frame),this.contentOuter=document.createElement("div"),this.contentOuter.className="jsoneditor-outer";var t=this;function i(e){t._onEvent&&t._onEvent(e)}var n={target:this.frame,onFocus:this.options.onFocus||null,onBlur:this.options.onBlur||null};if(this.frameFocusTracker=new r.$(n),this.frame.onclick=function(e){var t=e.target;i(e),"BUTTON"===t.nodeName&&e.preventDefault()},this.frame.oninput=i,this.frame.onchange=i,this.frame.onkeydown=i,this.frame.onkeyup=i,this.frame.oncut=i,this.frame.onpaste=i,this.frame.onmousedown=i,this.frame.onmouseup=i,this.frame.onmouseover=i,this.frame.onmouseout=i,(0,f.addEventListener)(this.frame,"focus",i,!0),(0,f.addEventListener)(this.frame,"blur",i,!0),this.frame.onfocusin=i,this.frame.onfocusout=i,this.options.mainMenuBar){(0,f.addClassName)(this.contentOuter,"has-main-menu-bar"),this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu);var o=document.createElement("button");o.type="button",o.className="jsoneditor-expand-all",o.title=(0,h.Tl)("expandAll"),o.onclick=function(){t.expandAll(),"function"==typeof e.options.onExpand&&e.options.onExpand({path:[],isExpand:!0,recursive:!0})},this.menu.appendChild(o);var s=document.createElement("button");if(s.type="button",s.title=(0,h.Tl)("collapseAll"),s.className="jsoneditor-collapse-all",s.onclick=function(){t.collapseAll(),"function"==typeof e.options.onExpand&&e.options.onExpand({path:[],isExpand:!1,recursive:!0})},this.menu.appendChild(s),this.options.enableSort){var a=document.createElement("button");a.type="button",a.className="jsoneditor-sort",a.title=(0,h.Tl)("sortTitleShort"),a.onclick=function(){t.node.showSortModal()},this.menu.appendChild(a)}if(this.options.enableTransform){var l=document.createElement("button");l.type="button",l.title=(0,h.Tl)("transformTitleShort"),l.className="jsoneditor-transform",l.onclick=function(){t.node.showTransformModal()},this.menu.appendChild(l)}if(this.history){var c=document.createElement("button");c.type="button",c.className="jsoneditor-undo jsoneditor-separator",c.title=(0,h.Tl)("undo"),c.onclick=function(){t._onUndo()},this.menu.appendChild(c),this.dom.undo=c;var d=document.createElement("button");d.type="button",d.className="jsoneditor-redo",d.title=(0,h.Tl)("redo"),d.onclick=function(){t._onRedo()},this.menu.appendChild(d),this.dom.redo=d,this.history.onChange=function(){c.disabled=!t.history.canUndo(),d.disabled=!t.history.canRedo()},this.history.onChange()}if(this.options&&this.options.modes&&this.options.modes.length){var g=this;this.modeSwitcher=new u.n(this.menu,this.options.modes,this.options.mode,(function(e){try{g.setMode(e),g.modeSwitcher.focus()}catch(e){g._onError(e)}}))}this.options.search&&(this.searchBox=new V(this,this.menu))}this.options.navigationBar&&(this.navBar=document.createElement("div"),this.navBar.className="jsoneditor-navigation-bar nav-bar-empty",this.frame.appendChild(this.navBar),this.treePath=new K(this.navBar,this.getPopupAnchor()),this.treePath.onSectionSelected(this._onTreePathSectionSelected.bind(this)),this.treePath.onContextMenuItemSelected(this._onTreePathMenuItemSelected.bind(this)))},_onUndo:function(){this.history&&(this.history.undo(),this._onChange())},_onRedo:function(){this.history&&(this.history.redo(),this._onChange())},_onEvent:function(e){if(!E.targetIsColorPicker(e.target)){var t=E.getNodeFromTarget(e.target);if("keydown"===e.type&&this._onKeyDown(e),t&&"focus"===e.type&&(this.focusTarget=e.target,this.options.autocomplete&&"focus"===this.options.autocomplete.trigger&&this._showAutoComplete(e.target)),"mousedown"===e.type&&this._startDragDistance(e),"mousemove"!==e.type&&"mouseup"!==e.type&&"click"!==e.type||this._updateDragDistance(e),t&&this.options&&this.options.navigationBar&&t&&("keydown"===e.type||"mousedown"===e.type)){var i=this;setTimeout((function(){i._updateTreePath(t.getNodePath())}))}if(t&&t.selected){if("click"===e.type){if(e.target===t.dom.menu)return void this.showContextMenu(e.target);e.hasMoved||this.deselect()}"mousedown"===e.type&&E.onDragStart(this.multiselection.nodes,e)}else"mousedown"===e.type&&(0,f.hasParentNode)(e.target,this.content)&&(this.deselect(),t&&e.target===t.dom.drag?E.onDragStart(t,e):(!t||e.target!==t.dom.field&&e.target!==t.dom.value&&e.target!==t.dom.select)&&this._onMultiSelectStart(e));t&&t.onEvent(e)}},_updateTreePath:function(e){if(e&&e.length){(0,f.removeClassName)(this.navBar,"nav-bar-empty");var t=[];e.forEach((function(e){var n={name:i(e),node:e,children:[]};e.childs&&e.childs.length&&e.childs.forEach((function(e){n.children.push({name:i(e),node:e})})),t.push(n)})),this.treePath.setPath(t)}else(0,f.addClassName)(this.navBar,"nav-bar-empty");function i(e){return e.parent?"array"===e.parent.type?e.index:e.field:e.field||e.type}},_onTreePathSectionSelected:function(e){e&&e.node&&(e.node.expandTo(),e.node.focus())},_onTreePathMenuItemSelected:function(e,t){if(e&&e.children.length){var i=e.children.find((function(e){return e.name===t}));i&&i.node&&(this._updateTreePath(i.node.getNodePath()),i.node.expandTo(),i.node.focus())}},_startDragDistance:function(e){this.dragDistanceEvent={initialTarget:e.target,initialPageX:e.pageX,initialPageY:e.pageY,dragDistance:0,hasMoved:!1}},_updateDragDistance:function(e){this.dragDistanceEvent||this._startDragDistance(e);var t=e.pageX-this.dragDistanceEvent.initialPageX,i=e.pageY-this.dragDistanceEvent.initialPageY;return this.dragDistanceEvent.dragDistance=Math.sqrt(t*t+i*i),this.dragDistanceEvent.hasMoved=this.dragDistanceEvent.hasMoved||this.dragDistanceEvent.dragDistance>10,e.dragDistance=this.dragDistanceEvent.dragDistance,e.hasMoved=this.dragDistanceEvent.hasMoved,e.dragDistance},_onMultiSelectStart:function(e){var t=E.getNodeFromTarget(e.target);if("tree"===this.options.mode&&void 0===this.options.onEditable){this.multiselection={start:t||null,end:null,nodes:[]},this._startDragDistance(e);var i=this;this.mousemove||(this.mousemove=(0,f.addEventListener)(e.view,"mousemove",(function(e){i._onMultiSelect(e)}))),this.mouseup||(this.mouseup=(0,f.addEventListener)(e.view,"mouseup",(function(e){i._onMultiSelectEnd(e)}))),e.preventDefault()}},_onMultiSelect:function(e){if(e.preventDefault(),this._updateDragDistance(e),e.hasMoved){var t=E.getNodeFromTarget(e.target);t&&(null==this.multiselection.start&&(this.multiselection.start=t),this.multiselection.end=t),this.deselect();var i=this.multiselection.start,n=this.multiselection.end||this.multiselection.start;if(i&&n){if(this.multiselection.nodes=this._findTopLevelNodes(i,n),this.multiselection.nodes&&this.multiselection.nodes.length){var o=this.multiselection.nodes[0];this.multiselection.start===o||this.multiselection.start.isDescendantOf(o)?this.multiselection.direction="down":this.multiselection.direction="up"}this.select(this.multiselection.nodes)}}},_onMultiSelectEnd:function(e){var t=this.multiselection.nodes[0];t&&t.dom.menu&&t.dom.menu.focus(),this.multiselection.start=null,this.multiselection.end=null,this.mousemove&&((0,f.removeEventListener)(e.view,"mousemove",this.mousemove),delete this.mousemove),this.mouseup&&((0,f.removeEventListener)(e.view,"mouseup",this.mouseup),delete this.mouseup)},deselect:function(e){var t=!!this.multiselection.nodes.length;this.multiselection.nodes.forEach((function(e){e.setSelected(!1)})),this.multiselection.nodes=[],e&&(this.multiselection.start=null,this.multiselection.end=null),t&&this._selectionChangedHandler&&this._selectionChangedHandler()},select:function(e){if(!Array.isArray(e))return this.select([e]);if(e){this.deselect(),this.multiselection.nodes=e.slice(0);var t=e[0];if(e.forEach((function(e){e.expandPathToNode(),e.setSelected(!0,e===t)})),this._selectionChangedHandler){var i=this.getSelection();this._selectionChangedHandler(i.start,i.end)}}},_findTopLevelNodes:function(e,t){for(var i=e.getNodePath(),n=t.getNodePath(),o=0;o<i.length&&i[o]===n[o];)o++;var r=i[o-1],s=i[o],a=n[o];if(s&&a||(r.parent?(s=r,a=r,r=r.parent):(s=r.childs[0],a=r.childs[r.childs.length-1])),r&&s&&a){var l=r.childs.indexOf(s),c=r.childs.indexOf(a),h=Math.min(l,c),d=Math.max(l,c);return r.childs.slice(h,d+1)}return[]},_showAutoComplete:function(e){var t=E.getNodeFromTarget(e),i="";if(e.className.indexOf("jsoneditor-value")>=0&&(i="value"),e.className.indexOf("jsoneditor-field")>=0&&(i="field"),""!==i){var n=this;setTimeout((function(){if(t&&("focus"===n.options.autocomplete.trigger||e.innerText.length>0)){var o=n.options.autocomplete.getOptions(e.innerText,t.getPath(),i,t.editor);null===o?n.autocomplete.hideDropDown():"function"==typeof o.then?o.then((function(t){null===t?n.autocomplete.hideDropDown():t.options?n.autocomplete.show(e,t.startFrom,t.options):n.autocomplete.show(e,0,t)})).catch((function(e){console.error(e)})):o.options?n.autocomplete.show(e,o.startFrom,o.options):n.autocomplete.show(e,0,o)}else n.autocomplete.hideDropDown()}),50)}},_onKeyDown:function(e){var t=e.which||e.keyCode,i=e.altKey,n=e.ctrlKey,o=e.metaKey,r=e.shiftKey,s=!1,a=this.focusTarget;if(9===t){var l=this;setTimeout((function(){l.focusTarget!==a&&(0,f.selectContentEditable)(l.focusTarget)}),0)}this.searchBox&&(n&&70===t?(this.searchBox.dom.search.focus(),this.searchBox.dom.search.select(),s=!0):(114===t||n&&71===t)&&(r?this.searchBox.previous(!0):this.searchBox.next(!0),s=!0)),this.history&&(n&&!r&&90===t?(this._onUndo(),s=!0):n&&r&&90===t&&(this._onRedo(),s=!0)),this.options.autocomplete&&!s&&(n||i||o||1!==e.key.length&&8!==t&&46!==t||(s=!1,this._showAutoComplete(e.target))),s&&(e.preventDefault(),e.stopPropagation())},_createTable:function(){var e;this.options.navigationBar&&(0,f.addClassName)(this.contentOuter,"has-nav-bar"),this.scrollableContent=document.createElement("div"),this.scrollableContent.className="jsoneditor-tree",this.contentOuter.appendChild(this.scrollableContent),this.content=document.createElement("div"),this.content.className="jsoneditor-tree-inner",this.scrollableContent.appendChild(this.content),this.table=document.createElement("table"),this.table.className="jsoneditor-tree",this.content.appendChild(this.table),this.colgroupContent=document.createElement("colgroup"),"tree"===this.options.mode&&((e=document.createElement("col")).width="24px",this.colgroupContent.appendChild(e)),(e=document.createElement("col")).width="24px",this.colgroupContent.appendChild(e),e=document.createElement("col"),this.colgroupContent.appendChild(e),this.table.appendChild(this.colgroupContent),this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.frame.appendChild(this.contentOuter)},showContextMenu:function(e,t){var i=[],n=this.multiselection.nodes.slice();if(i.push({text:(0,h.Tl)("duplicateText"),title:(0,h.Tl)("duplicateTitle"),className:"jsoneditor-duplicate",click:function(){E.onDuplicate(n)}}),i.push({text:(0,h.Tl)("remove"),title:(0,h.Tl)("removeTitle"),className:"jsoneditor-remove",click:function(){E.onRemove(n)}}),this.options.onCreateMenu){var r=n.map((function(e){return e.getPath()}));i=this.options.onCreateMenu(i,{type:"multiple",path:r[0],paths:r})}new o.t(i,{close:t}).show(e,this.getPopupAnchor())},getPopupAnchor:function(){return this.options.popupAnchor||this.frame},getSelection:function(){var e={start:null,end:null};if(this.multiselection.nodes&&this.multiselection.nodes.length&&this.multiselection.nodes.length){var t=this.multiselection.nodes[0],i=this.multiselection.nodes[this.multiselection.nodes.length-1];"down"===this.multiselection.direction?(e.start=t.serialize(),e.end=i.serialize()):(e.start=i.serialize(),e.end=t.serialize())}return e},onSelectionChange:function(e){"function"==typeof e&&(this._selectionChangedHandler=(0,f.debounce)(e,this.DEBOUNCE_INTERVAL))},setSelection:function(e,t){e&&e.dom&&e.range&&(console.warn("setSelection/getSelection usage for text selection is deprecated and should not be used, see documentation for supported selection options"),this.setDomSelection(e));var i=this._getNodeInstancesByRange(e,t);i.forEach((function(e){e.expandTo()})),this.select(i)},_getNodeInstancesByRange:function(e,t){var i,n;e&&e.path&&(i=this.node.findNodeByPath(e.path),t&&t.path&&(n=this.node.findNodeByPath(t.path)));var o=[];if(i instanceof E)if(n instanceof E&&n!==i)if(i.parent===n.parent){i.getIndex()<n.getIndex()?(e=i,t=n):(e=n,t=i);var r=e;o.push(r);do{r=r.nextSibling(),o.push(r)}while(r&&r!==t)}else o=this._findTopLevelNodes(i,n);else o.push(i);return o},getNodesByRange:function(e,t){var i=this._getNodeInstancesByRange(e,t),n=[];return i.forEach((function(e){n.push(e.serialize())})),n}},J=[{mode:"tree",mixin:Y,data:"json"},{mode:"view",mixin:Y,data:"json"},{mode:"form",mixin:Y,data:"json"}]},2870:function(e,t,i){t.tryRequireAjv=function(){try{return i(2229)}catch(e){}}},5467:function(e,t,i){t.J=function(){try{i(9762)}catch(e){console.error(e)}}},6237:function(e,t,i){"use strict";i.r(t),i.d(t,{addClassName:function(){return T},addEventListener:function(){return Z},asyncExec:function(){return Ie},clear:function(){return y},compileJSONPointer:function(){return ne},contains:function(){return ve},debounce:function(){return Q},escapeUnicodeChars:function(){return f},extend:function(){return C},findUniqueName:function(){return le},formatSize:function(){return pe},get:function(){return ae},getAbsoluteLeft:function(){return x},getAbsoluteTop:function(){return k},getChildPaths:function(){return ce},getColorCSS:function(){return oe},getIndexForPosition:function(){return te},getInnerText:function(){return P},getInputSelection:function(){return ee},getInternetExplorerVersion:function(){return F},getPositionForPath:function(){return ie},getSelection:function(){return N},getSelectionOffset:function(){return B},getType:function(){return I},getWindow:function(){return S},hasParentNode:function(){return G},improveSchemaError:function(){return X},insideRect:function(){return U},isArray:function(){return w},isChildOf:function(){return j},isFirefox:function(){return V},isObject:function(){return fe},isPromise:function(){return Y},isTimestamp:function(){return ge},isUrl:function(){return A},isValidColor:function(){return re},isValidValidationError:function(){return J},isValidationErrorChanged:function(){return Ce},limitCharacters:function(){return me},makeFieldTooltip:function(){return se},parse:function(){return p},parsePath:function(){return K},parseString:function(){return ue},removeAllClassNames:function(){return E},removeClassName:function(){return R},removeEventListener:function(){return D},removeReturnsAndSurroundingWhitespace:function(){return H},selectContentEditable:function(){return L},setEndOfContentEditable:function(){return $},setSelection:function(){return M},setSelectionOffset:function(){return W},sort:function(){return he},sortObjectKeys:function(){return de},stringifyPath:function(){return z},stripFormatting:function(){return _},textDiff:function(){return q},tryJsonRepair:function(){return m},uniqueMergeArrays:function(){return ye},validate:function(){return v}}),i(1081);var n=i(1342),o=i.n(n),r=i(9857),s=i(5736),a=i(3094),l=i(3057);function c(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?h(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}var u=1e4,g=9466848e5;function p(e){try{return JSON.parse(e)}catch(t){throw v(e),t}}function m(e){try{return(0,r.m)(e)}catch(t){return e}}function f(e){return e.replace(/[\u007F-\uFFFF]/g,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))}function v(e){void 0!==s?s.parse(e):JSON.parse(e)}function C(e,t){for(var i in t)be(t,i)&&(e[i]=t[i]);return e}function y(e){for(var t in e)be(e,t)&&delete e[t];return e}function I(e){return null===e?"null":void 0===e?"undefined":e instanceof Number||"number"==typeof e?"number":e instanceof String||"string"==typeof e?"string":e instanceof Boolean||"boolean"==typeof e?"boolean":e instanceof RegExp?"regexp":w(e)?"array":"object"}var b=/^https?:\/\/\S+$/;function A(e){return("string"==typeof e||e instanceof String)&&b.test(e)}function w(e){return"[object Array]"===Object.prototype.toString.call(e)}function S(e){return e.ownerDocument.defaultView}function x(e){return e.getBoundingClientRect().left+window.pageXOffset||document.scrollLeft||0}function k(e){return e.getBoundingClientRect().top+window.pageYOffset||document.scrollTop||0}function T(e,t){var i=e.className.split(" ");-1===i.indexOf(t)&&(i.push(t),e.className=i.join(" "))}function E(e){e.className=""}function R(e,t){var i=e.className.split(" "),n=i.indexOf(t);-1!==n&&(i.splice(n,1),e.className=i.join(" "))}function _(e){for(var t=e.childNodes,i=0,n=t.length;i<n;i++){var o=t[i];o.style&&o.removeAttribute("style");var r=o.attributes;if(r)for(var s=r.length-1;s>=0;s--){var a=r[s];!0===a.specified&&o.removeAttribute(a.name)}_(o)}}function $(e){var t,i;document.createRange&&((t=document.createRange()).selectNodeContents(e),t.collapse(!1),(i=window.getSelection()).removeAllRanges(),i.addRange(t))}function L(e){var t,i;e&&"DIV"===e.nodeName&&window.getSelection&&document.createRange&&((i=document.createRange()).selectNodeContents(e),(t=window.getSelection()).removeAllRanges(),t.addRange(i))}function N(){if(window.getSelection){var e=window.getSelection();if(e.getRangeAt&&e.rangeCount)return e.getRangeAt(0)}return null}function M(e){if(e&&window.getSelection){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)}}function B(){var e=N();return e&&"startOffset"in e&&"endOffset"in e&&e.startContainer&&e.startContainer===e.endContainer?{startOffset:e.startOffset,endOffset:e.endOffset,container:e.startContainer.parentNode}:null}function W(e){if(document.createRange&&window.getSelection&&window.getSelection()){var t=document.createRange();e.container.firstChild||e.container.appendChild(document.createTextNode("")),t.setStart(e.container.firstChild,e.startOffset),t.setEnd(e.container.firstChild,e.endOffset),M(t)}}function P(e,t){if(void 0===t&&(t={_text:"",flush:function(){var e=this._text;return this._text="",e},set:function(e){this._text=e}}),e.nodeValue){var i=H(e.nodeValue);return""!==i?t.flush()+i:""}if(e.hasChildNodes()){for(var n=e.childNodes,o="",r=0,s=n.length;r<s;r++){var a=n[r];if("DIV"===a.nodeName||"P"===a.nodeName){var l=n[r-1],c=l?l.nodeName:void 0;c&&"DIV"!==c&&"P"!==c&&"BR"!==c&&(""!==o&&(o+="\n"),t.flush()),o+=P(a,t),t.set("\n")}else"BR"===a.nodeName?(o+=t.flush(),t.set("\n")):o+=P(a,t)}return o}return""}function H(e){return e.replace(/(\b|^)\s*(\b|$)/g,(function(e){return/\n/.exec(e)?"":e}))}function G(e,t){for(var i=e?e.parentNode:void 0;i;){if(i===t)return!0;i=i.parentNode}return!1}function F(){if(-1===O){var e=-1;if("undefined"!=typeof navigator&&"Microsoft Internet Explorer"===navigator.appName){var t=navigator.userAgent;null!=/MSIE ([0-9]+[.0-9]+)/.exec(t)&&(e=parseFloat(RegExp.$1))}O=e}return O}var O=-1;function V(){return"undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("Firefox")}function Z(e,t,i,n){if(e.addEventListener)return void 0===n&&(n=!1),"mousewheel"===t&&V()&&(t="DOMMouseScroll"),e.addEventListener(t,i,n),i;if(e.attachEvent){var o=function(){return i.call(e,window.event)};return e.attachEvent("on"+t,o),o}}function D(e,t,i,n){e.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===t&&V()&&(t="DOMMouseScroll"),e.removeEventListener(t,i,n)):e.detachEvent&&e.detachEvent("on"+t,i)}function j(e,t){for(var i=e.parentNode;i;){if(i===t)return!0;i=i.parentNode}return!1}function K(e){var t=[],i=0;function n(){for(var t="";void 0!==e[i]&&/[\w$]/.test(e[i]);)t+=e[i],i++;if(""===t)throw new Error("Invalid JSON path: property name expected at index "+i);return t}function o(t){for(var n="";void 0!==e[i]&&e[i]!==t;)n+=e[i],i++;if(e[i]!==t)throw new Error("Invalid JSON path: unexpected end, character "+t+" expected");return n}for(;void 0!==e[i];)if("."===e[i])i++,t.push(n());else{if("["!==e[i])throw new Error('Invalid JSON path: unexpected character "'+e[i]+'" at index '+i);if(i++,"'"===e[i]||'"'===e[i]){var r=e[i];if(i++,t.push(o(r)),e[i]!==r)throw new Error("Invalid JSON path: closing quote ' expected at index "+i);i++}else{var s=o("]").trim();if(0===s.length)throw new Error("Invalid JSON path: array value expected at index "+i);s="*"===s?s:JSON.parse(s),t.push(s)}if("]"!==e[i])throw new Error("Invalid JSON path: closing bracket ] expected at index "+i);i++}return t}function z(e){return e.map((function(e){return"number"==typeof e?"["+e+"]":"string"==typeof e&&e.match(/^[A-Za-z0-9_$]+$/)?"."+e:'["'+e+'"]'})).join("")}function X(e){if("enum"===e.keyword&&Array.isArray(e.schema)){var t=e.schema;if(t){if((t=t.map((function(e){return JSON.stringify(e)}))).length>5){var i=["("+(t.length-5)+" more...)"];(t=t.slice(0,5)).push(i)}e.message="should be equal to one of: "+t.join(", ")}}return"additionalProperties"===e.keyword&&(e.message="should NOT have additional property: "+e.params.additionalProperty),e}function Y(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}function J(e){return"object"===d(e)&&Array.isArray(e.path)&&"string"==typeof e.message}function U(e,t,i){var n=void 0!==i?i:0;return t.left-n>=e.left&&t.right+n<=e.right&&t.top-n>=e.top&&t.bottom+n<=e.bottom}function Q(e,t,i){var n;return function(){var o=this,r=arguments,s=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||e.apply(o,r)}),t),s&&e.apply(o,r)}}function q(e,t){for(var i=t.length,n=0,o=e.length,r=t.length;t.charAt(n)===e.charAt(n)&&n<i;)n++;for(;t.charAt(r-1)===e.charAt(o-1)&&r>n&&o>0;)r--,o--;return{start:n,end:r}}function ee(e){var t,i,n,o,r,s=0,a=0;return"number"==typeof e.selectionStart&&"number"==typeof e.selectionEnd?(s=e.selectionStart,a=e.selectionEnd):(i=document.selection.createRange())&&i.parentElement()===e&&(o=e.value.length,t=e.value.replace(/\r\n/g,"\n"),(n=e.createTextRange()).moveToBookmark(i.getBookmark()),(r=e.createTextRange()).collapse(!1),n.compareEndPoints("StartToEnd",r)>-1?s=a=o:(s=-n.moveStart("character",-o),s+=t.slice(0,s).split("\n").length-1,n.compareEndPoints("EndToEnd",r)>-1?a=o:(a=-n.moveEnd("character",-o),a+=t.slice(0,a).split("\n").length-1))),{startIndex:s,endIndex:a,start:l(s),end:l(a)};function l(t){var i=e.value.substring(0,t);return{row:(i.match(/\n/g)||[]).length+1,column:i.length-i.lastIndexOf("\n")}}}function te(e,t,i){var n=e.value||"";if(t>0&&i>0){var o=n.split("\n",t);t=Math.min(o.length,t),i=Math.min(o[t-1].length,i-1);var r=1===t?i:i+1;return o.slice(0,t-1).join("\n").length+r}return-1}function ie(e,t){var i,n=[];if(!t||!t.length)return n;try{i=a.parse(e)}catch(e){return n}return t.forEach((function(e){var t=ne(K(e)),o=i.pointers[t];o&&n.push({path:e,line:o.key?o.key.line:o.value?o.value.line:0,column:o.key?o.key.column:o.value?o.value.column:0})})),n}function ne(e){return e.map((function(e){return"/"+String(e).replace(/~/g,"~0").replace(/\//g,"~1")})).join("")}function oe(e){var t=document.createElement("div");return t.style.color=e,t.style.color.split(/\s+/).join("").toLowerCase()||null}function re(e){return!!oe(e)}function se(e,t){if(!e)return"";var i="";return e.title&&(i+=e.title),e.description&&(i.length>0&&(i+="\n"),i+=e.description),e.default&&(i.length>0&&(i+="\n\n"),i+=(0,l.Tl)("default",void 0,t)+"\n",i+=JSON.stringify(e.default,null,2)),Array.isArray(e.examples)&&e.examples.length>0&&(i.length>0&&(i+="\n\n"),i+=(0,l.Tl)("examples",void 0,t)+"\n",e.examples.forEach((function(t,n){i+=JSON.stringify(t,null,2),n!==e.examples.length-1&&(i+="\n")}))),i}function ae(e,t){for(var i=e,n=0;n<t.length&&null!=i;n++)i=i[t[n]];return i}function le(e,t){for(var i=e.replace(/ \(copy( \d+)?\)$/,""),n=i,o=1;-1!==t.indexOf(n);)n=i+" (copy"+(o>1?" "+o:"")+")",o++;return n}function ce(e,t){var i={};function n(e,t,i,o){(!Array.isArray(e)&&!fe(e)||o)&&(t[i||""]=!0),fe(e)&&Object.keys(e).forEach((function(r){n(e[r],t,i+"."+r,o)}))}if(Array.isArray(e))for(var o=Math.min(e.length,u),r=0;r<o;r++)n(e[r],i,"",t);else i[""]=!0;return Object.keys(i).sort()}function he(e,t,i){var n=t&&"."!==t?K(t):[],o="desc"===i?-1:1,r=e.slice();return r.sort((function(e,t){var i=ae(e,n),r=ae(t,n);return o*(i>r?1:i<r?-1:0)})),r}function de(e,t){var i="desc"===t?-1:1,n=Object.keys(e).sort((function(e,t){return i*o()(e,t)})),r={};return n.forEach((function(t){r[t]=e[t]})),r}function ue(e){if(""===e)return"";var t=e.toLowerCase();if("null"===t)return null;if("true"===t)return!0;if("false"===t)return!1;if(/^0\d+$/.test(e))return e;var i=Number(e),n=parseFloat(e);return isNaN(i)||isNaN(n)?e:i}function ge(e,t){return"number"==typeof t&&t>g&&isFinite(t)&&Math.floor(t)===t&&!isNaN(new Date(t).valueOf())}function pe(e){if(e<900)return e.toFixed()+" B";var t=e/1e3;if(t<900)return t.toFixed(1)+" KB";var i=t/1e3;if(i<900)return i.toFixed(1)+" MB";var n=i/1e3;return n<900?n.toFixed(1)+" GB":(n/1e3).toFixed(1)+" TB"}function me(e,t){return e.length<=t?e:e.slice(0,t)+"..."}function fe(e){return"object"===d(e)&&null!==e&&!Array.isArray(e)}function ve(e,t){return-1!==e.indexOf(t)}function Ce(e,t){if(!t&&!e)return!1;if(t&&!e||!t&&e)return!0;if(t.length!==e.length)return!0;for(var i,n=function(i){if(!("error"===e[i].type?t.find((function(t){return t.line===e[i].line})):t.find((function(t){return t.dataPath===e[i].dataPath&&t.schemaPath===e[i].schemaPath}))))return{v:!0}},o=0;o<e.length;++o)if(i=n(o))return i.v;return!1}function ye(e,t){var i=null!=e&&e.length?e:[],n=null!=t&&t.length?t:[];return c(new Set(i.concat(n)))}function Ie(e){setTimeout(e)}function be(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},1746:function(e,t,i){var n;if(window.Picker)n=window.Picker;else try{n=i(7598)}catch(e){}e.exports=n},6990:function(e,t,i){e=i.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,i,n){"string"==typeof e?(2==arguments.length&&(n=i),t.modules[e]||(t.payloads[e]=n,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var i,n,o=function(e,t,i){if("string"==typeof t){var n=a(e,t);if(null!=n)return i&&i(),n}else if("[object Array]"===Object.prototype.toString.call(t)){for(var o=[],s=0,l=t.length;s<l;++s){var c=a(e,t[s]);if(null==c&&r.original)return;o.push(c)}return i&&i.apply(null,o)||!0}},r=function(e,t){var i=o("",e,t);return null==i&&r.original?r.original.apply(this,arguments):i},s=function(e,t){if(-1!==t.indexOf("!")){var i=t.split("!");return s(e,i[0])+"!"+s(e,i[1])}if("."==t.charAt(0))for(t=e.split("/").slice(0,-1).join("/")+"/"+t;-1!==t.indexOf(".")&&n!=t;){var n=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t},a=function(e,i){i=s(e,i);var n=t.modules[i];if(!n){if("function"==typeof(n=t.payloads[i])){var r={},a={id:i,uri:"",exports:r,packaged:!0};r=n((function(e,t){return o(i,e,t)}),r,a)||a.exports,t.modules[i]=r,delete t.payloads[i]}n=t.modules[i]=r||n}return n};n=e,(i="ace")&&(e[i]||(e[i]={}),n=e[i]),n.define&&n.define.packaged||(t.original=n.define,n.define=t,n.define.packaged=!0),n.require&&n.require.packaged||(r.original=n.require,n.require=r,n.require.packaged=!0)}(),ace.define("ace/lib/es6-shim",["require","exports","module"],(function(e,t,i){function n(e,t,i){Object.defineProperty(e,t,{value:i,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||n(String.prototype,"startsWith",(function(e,t){return t=t||0,this.lastIndexOf(e,t)===t})),String.prototype.endsWith||n(String.prototype,"endsWith",(function(e,t){var i=this;(void 0===t||t>i.length)&&(t=i.length),t-=e.length;var n=i.indexOf(e,t);return-1!==n&&n===t})),String.prototype.repeat||n(String.prototype,"repeat",(function(e){for(var t="",i=this;e>0;)1&e&&(t+=i),(e>>=1)&&(i+=i);return t})),String.prototype.includes||n(String.prototype,"includes",(function(e,t){return-1!=this.indexOf(e,t)})),Object.assign||(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];null!=n&&Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t}),Object.values||(Object.values=function(e){return Object.keys(e).map((function(t){return e[t]}))}),Array.prototype.find||n(Array.prototype,"find",(function(e){for(var t=this.length,i=arguments[1],n=0;n<t;n++){var o=this[n];if(e.call(i,o,n,this))return o}})),Array.prototype.findIndex||n(Array.prototype,"findIndex",(function(e){for(var t=this.length,i=arguments[1],n=0;n<t;n++){var o=this[n];if(e.call(i,o,n,this))return n}})),Array.prototype.includes||n(Array.prototype,"includes",(function(e,t){return-1!=this.indexOf(e,t)})),Array.prototype.fill||n(Array.prototype,"fill",(function(e){for(var t=this,i=t.length>>>0,n=arguments[1]>>0,o=n<0?Math.max(i+n,0):Math.min(n,i),r=arguments[2],s=void 0===r?i:r>>0,a=s<0?Math.max(i+s,0):Math.min(s,i);o<a;)t[o]=e,o++;return t})),Array.of||n(Array,"of",(function(){return Array.prototype.slice.call(arguments)}))})),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],(function(e,t,i){"use strict";e("./es6-shim")})),ace.define("ace/lib/deep_copy",["require","exports","module"],(function(e,t,i){t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;var i;if(Array.isArray(t)){i=[];for(var n=0;n<t.length;n++)i[n]=e(t[n]);return i}if("[object Object]"!==Object.prototype.toString.call(t))return t;for(var n in i={},t)i[n]=e(t[n]);return i}})),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],(function(e,t,i){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var i="";t>0;)1&t&&(i+=e),(t>>=1)&&(e+=e);return i};var n=/^\s\s*/,o=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(n,"")},t.stringTrimRight=function(e){return e.replace(o,"")},t.copyObject=function(e){var t={};for(var i in e)t[i]=e[i];return t},t.copyArray=function(e){for(var t=[],i=0,n=e.length;i<n;i++)e[i]&&"object"==typeof e[i]?t[i]=this.copyObject(e[i]):t[i]=e[i];return t},t.deepCopy=e("./deep_copy").deepCopy,t.arrayToMap=function(e){for(var t={},i=0;i<e.length;i++)t[e[i]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var i in e)t[i]=e[i];return t},t.arrayRemove=function(e,t){for(var i=0;i<=e.length;i++)t===e[i]&&e.splice(i,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},t.getMatchOffsets=function(e,t){var i=[];return e.replace(t,(function(e){i.push({offset:arguments[arguments.length-2],length:e.length})})),i},t.deferredCall=function(e){var t=null,i=function(){t=null,e()},n=function(e){return n.cancel(),t=setTimeout(i,e||0),n};return n.schedule=n,n.call=function(){return this.cancel(),e(),n},n.cancel=function(){return clearTimeout(t),t=null,n},n.isPending=function(){return t},n},t.delayedCall=function(e,t){var i=null,n=function(){i=null,e()},o=function(e){null==i&&(i=setTimeout(n,e||t))};return o.delay=function(e){i&&clearTimeout(i),i=setTimeout(n,e||t)},o.schedule=o,o.call=function(){this.cancel(),e()},o.cancel=function(){i&&clearTimeout(i),i=null},o.isPending=function(){return i},o},t.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch(e){return!1}return!0},t.skipEmptyMatch=function(e,t,i){return i&&e.codePointAt(t)>65535?2:1}})),ace.define("ace/lib/useragent",["require","exports","module"],(function(e,t,i){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var n="object"==typeof navigator?navigator:{},o=(/mac|win|linux/i.exec(n.platform)||["other"])[0].toLowerCase(),r=n.userAgent||"",s=n.appName||"";t.isWin="win"==o,t.isMac="mac"==o,t.isLinux="linux"==o,t.isIE="Microsoft Internet Explorer"==s||s.indexOf("MSAppHost")>=0?parseFloat((r.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((r.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=r.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(r.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(r.split(" Chrome/")[1])||void 0,t.isSafari=parseFloat(r.split(" Safari/")[1])&&!t.isChrome||void 0,t.isEdge=parseFloat(r.split(" Edge/")[1])||void 0,t.isAIR=r.indexOf("AdobeAIR")>=0,t.isAndroid=r.indexOf("Android")>=0,t.isChromeOS=r.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(r)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid})),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],(function(e,t,i){"use strict";var n,o=e("./useragent");t.buildDom=function e(t,i,n){if("string"==typeof t&&t){var o=document.createTextNode(t);return i&&i.appendChild(o),o}if(!Array.isArray(t))return t&&t.appendChild&&i&&i.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var r=[],s=0;s<t.length;s++){var a=e(t[s],i,n);a&&r.push(a)}return r}var l=document.createElement(t[0]),c=t[1],h=1;for(c&&"object"==typeof c&&!Array.isArray(c)&&(h=2),s=h;s<t.length;s++)e(t[s],l,n);return 2==h&&Object.keys(c).forEach((function(e){var t=c[e];"class"===e?l.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e||"$"==e[0]?l[e]=t:"ref"===e?n&&(n[t]=l):"style"===e?"string"==typeof t&&(l.style.cssText=t):null!=t&&l.setAttribute(e,t)})),i&&i.appendChild(l),l},t.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},t.removeChildren=function(e){e.innerHTML=""},t.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},t.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},t.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},t.addCssClass=function(e,i){t.hasCssClass(e,i)||(e.className+=" "+i)},t.removeCssClass=function(e,t){for(var i=e.className.split(/\s+/g);;){var n=i.indexOf(t);if(-1==n)break;i.splice(n,1)}e.className=i.join(" ")},t.toggleCssClass=function(e,t){for(var i=e.className.split(/\s+/g),n=!0;;){var o=i.indexOf(t);if(-1==o)break;n=!1,i.splice(o,1)}return n&&i.push(t),e.className=i.join(" "),n},t.setCssClass=function(e,i,n){n?t.addCssClass(e,i):t.removeCssClass(e,i)},t.hasCssString=function(e,t){var i,n=0;if(i=(t=t||document).querySelectorAll("style"))for(;n<i.length;)if(i[n++].id===e)return!0},t.removeElementById=function(e,t){(t=t||document).getElementById(e)&&t.getElementById(e).remove()};var r=[];function s(){var e=r;r=null,e&&e.forEach((function(e){a(e[0],e[1])}))}function a(e,i,o){if("undefined"!=typeof document){if(r)if(o)s();else if(!1===o)return r.push([e,i]);if(!n){var a=o;o&&o.getRootNode&&(a=o.getRootNode())&&a!=o||(a=document);var l=a.ownerDocument||a;if(i&&t.hasCssString(i,a))return null;i&&(e+="\n/*# sourceURL=ace/css/"+i+" */");var c=t.createElement("style");c.appendChild(l.createTextNode(e)),i&&(c.id=i),a==l&&(a=t.getDocumentHead(l)),a.insertBefore(c,a.firstChild)}}}if(t.useStrictCSP=function(e){n=e,0==e?s():r||(r=[])},t.importCssString=a,t.importCssStylsheet=function(e,i){t.buildDom(["link",{rel:"stylesheet",href:e}],t.getDocumentHead(i))},t.scrollbarWidth=function(e){var i=t.createElement("ace_inner");i.style.width="100%",i.style.minWidth="0px",i.style.height="200px",i.style.display="block";var n=t.createElement("ace_outer"),o=n.style;o.position="absolute",o.left="-10000px",o.overflow="hidden",o.width="200px",o.minWidth="0px",o.height="150px",o.display="block",n.appendChild(i);var r=e&&e.documentElement||document&&document.documentElement;if(!r)return 0;r.appendChild(n);var s=i.offsetWidth;o.overflow="scroll";var a=i.offsetWidth;return s===a&&(a=n.clientWidth),r.removeChild(n),s-a},t.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}},t.setStyle=function(e,t,i){e[t]!==i&&(e[t]=i)},t.HAS_CSS_ANIMATION=!1,t.HAS_CSS_TRANSFORMS=!1,t.HI_DPI=!o.isWin||"undefined"!=typeof window&&window.devicePixelRatio>=1.5,o.isChromeOS&&(t.HI_DPI=!1),"undefined"!=typeof document){var l=document.createElement("div");t.HI_DPI&&void 0!==l.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),o.isEdge||void 0===l.style.animationName||(t.HAS_CSS_ANIMATION=!0),l=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,i){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(i)+"px)"}:t.translate=function(e,t,i){e.style.top=Math.round(i)+"px",e.style.left=Math.round(t)+"px"}})),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("./dom");t.get=function(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.onreadystatechange=function(){4===i.readyState&&t(i.responseText)},i.send(null)},t.loadScript=function(e,t){var i=n.getDocumentHead(),o=document.createElement("script");o.src=e,i.appendChild(o),o.onload=o.onreadystatechange=function(e,i){!i&&o.readyState&&"loaded"!=o.readyState&&"complete"!=o.readyState||(o=o.onload=o.onreadystatechange=null,i||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}})),ace.define("ace/lib/oop",["require","exports","module"],(function(e,t,i){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var i in t)e[i]=t[i];return e},t.implement=function(e,i){t.mixin(e,i)}})),ace.define("ace/lib/event_emitter",["require","exports","module"],(function(e,t,i){"use strict";var n={},o=function(){this.propagationStopped=!0},r=function(){this.defaultPrevented=!0};n._emit=n._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[e]||[],n=this._defaultHandlers[e];if(i.length||n){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=o),t.preventDefault||(t.preventDefault=r),i=i.slice();for(var s=0;s<i.length&&(i[s](t,this),!t.propagationStopped);s++);return n&&!t.defaultPrevented?n(t,this):void 0}},n._signal=function(e,t){var i=(this._eventRegistry||{})[e];if(i){i=i.slice();for(var n=0;n<i.length;n++)i[n](t,this)}},n.once=function(e,t){var i=this;if(this.on(e,(function n(){i.off(e,n),t.apply(null,arguments)})),!t)return new Promise((function(e){t=e}))},n.setDefaultHandler=function(e,t){var i=this._defaultHandlers;if(i||(i=this._defaultHandlers={_disabled_:{}}),i[e]){var n=i[e],o=i._disabled_[e];o||(i._disabled_[e]=o=[]),o.push(n);var r=o.indexOf(t);-1!=r&&o.splice(r,1)}i[e]=t},n.removeDefaultHandler=function(e,t){var i=this._defaultHandlers;if(i){var n=i._disabled_[e];if(i[e]==t)n&&this.setDefaultHandler(e,n.pop());else if(n){var o=n.indexOf(t);-1!=o&&n.splice(o,1)}}},n.on=n.addEventListener=function(e,t,i){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];return n||(n=this._eventRegistry[e]=[]),-1==n.indexOf(t)&&n[i?"unshift":"push"](t),t},n.off=n.removeListener=n.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[e];if(i){var n=i.indexOf(t);-1!==n&&i.splice(n,1)}},n.removeAllListeners=function(e){e||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[e]=void 0),this._defaultHandlers&&(this._defaultHandlers[e]=void 0)},t.EventEmitter=n})),ace.define("ace/lib/report_error",["require","exports","module"],(function(e,t,i){t.reportError=function(e,t){var i=new Error(e);i.data=t,"object"==typeof console&&console.error&&console.error(i),setTimeout((function(){throw i}))}})),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error"],(function(e,t,i){var n,o=e("./oop"),r=e("./event_emitter").EventEmitter,s=e("./report_error").reportError,a={setOptions:function(e){Object.keys(e).forEach((function(t){this.setOption(t,e[t])}),this)},getOptions:function(e){var t={};if(e)Array.isArray(e)||(t=e,e=Object.keys(t));else{var i=this.$options;e=Object.keys(i).filter((function(e){return!i[e].hidden}))}return e.forEach((function(e){t[e]=this.getOption(e)}),this),t},setOption:function(e,t){if(this["$"+e]!==t){var i=this.$options[e];if(!i)return l('misspelled option "'+e+'"');if(i.forwardTo)return this[i.forwardTo]&&this[i.forwardTo].setOption(e,t);i.handlesSet||(this["$"+e]=t),i&&i.set&&i.set.call(this,t)}},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:l('misspelled option "'+e+'"')}};function l(e){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}var c=function(){function e(){this.$defaultOptions={}}return e.prototype.defineOptions=function(e,t,i){return e.$options||(this.$defaultOptions[t]=e.$options={}),Object.keys(i).forEach((function(t){var n=i[t];"string"==typeof n&&(n={forwardTo:n}),n.name||(n.name=t),e.$options[n.name]=n,"initialValue"in n&&(e["$"+n.name]=n.initialValue)})),o.implement(e,a),this},e.prototype.resetOptions=function(e){Object.keys(e.$options).forEach((function(t){var i=e.$options[t];"value"in i&&e.setOption(t,i.value)}))},e.prototype.setDefaultValue=function(e,t,i){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][t])break;if(!this.$defaultOptions[e][t])return!1}var n=this.$defaultOptions[e]||(this.$defaultOptions[e]={});n[t]&&(n.forwardTo?this.setDefaultValue(n.forwardTo,t,i):n[t].value=i)},e.prototype.setDefaultValues=function(e,t){Object.keys(t).forEach((function(i){this.setDefaultValue(e,i,t[i])}),this)},e.prototype.setMessages=function(e){n=e},e.prototype.nls=function(e,t){n&&!n[e]&&l("No message found for '"+e+"' in the provided messages, falling back to default English message.");var i=n&&n[e]||e;return t&&(i=i.replace(/\$(\$|[\d]+)/g,(function(e,i){return"$"==i?"$":t[i]}))),i},e}();c.prototype.warn=l,c.prototype.reportError=s,o.implement(c.prototype,r),t.AppConfig=c})),ace.define("ace/theme/textmate-css",["require","exports","module"],(function(e,t,i){i.exports='.ace-tm .ace_gutter {\n background: #f0f0f0;\n color: #333;\n}\n\n.ace-tm .ace_print-margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-tm .ace_fold {\n background-color: #6B72E6;\n}\n\n.ace-tm {\n background-color: #FFFFFF;\n color: black;\n}\n\n.ace-tm .ace_cursor {\n color: black;\n}\n \n.ace-tm .ace_invisible {\n color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_storage,\n.ace-tm .ace_keyword {\n color: blue;\n}\n\n.ace-tm .ace_constant {\n color: rgb(197, 6, 11);\n}\n\n.ace-tm .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_constant.ace_language {\n color: rgb(88, 92, 246);\n}\n\n.ace-tm .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_invalid {\n background-color: rgba(255, 0, 0, 0.1);\n color: red;\n}\n\n.ace-tm .ace_support.ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_support.ace_constant {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_support.ace_type,\n.ace-tm .ace_support.ace_class {\n color: rgb(109, 121, 222);\n}\n\n.ace-tm .ace_keyword.ace_operator {\n color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_string {\n color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_comment {\n color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_comment.ace_doc {\n color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_comment.ace_doc.ace_tag {\n color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_constant.ace_numeric {\n color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_variable {\n color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_xml-pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_entity.ace_name.ace_function {\n color: #0000A2;\n}\n\n\n.ace-tm .ace_heading {\n color: rgb(12, 7, 255);\n}\n\n.ace-tm .ace_list {\n color:rgb(185, 6, 144);\n}\n\n.ace-tm .ace_meta.ace_tag {\n color:rgb(0, 22, 142);\n}\n\n.ace-tm .ace_string.ace_regex {\n color: rgb(255, 0, 0)\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n.ace-tm.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px white;\n}\n.ace-tm .ace_marker-layer .ace_step {\n background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active-line {\n background: rgba(0, 0, 0, 0.07);\n}\n\n.ace-tm .ace_gutter-active-line {\n background-color : #dcdcdc;\n}\n\n.ace-tm .ace_marker-layer .ace_selected-word {\n background: rgb(250, 250, 255);\n border: 1px solid rgb(200, 200, 250);\n}\n\n.ace-tm .ace_indent-guide {\n background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;\n}\n\n.ace-tm .ace_indent-guide-active {\n background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;\n}\n'})),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],(function(e,t,i){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText=e("./textmate-css"),t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)})),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],(function(e,t,i){var n=e("./lib/lang"),o=e("./lib/net"),r=e("./lib/dom"),s=e("./lib/app_config").AppConfig;i.exports=t=new s;var a,l={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};t.get=function(e){if(!l.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return l[e]},t.set=function(e,t){if(l.hasOwnProperty(e))l[e]=t;else if(0==this.setDefaultValue("",e,t))throw new Error("Unknown config key: "+e);"useStrictCSP"==e&&r.useStrictCSP(t)},t.all=function(){return n.copyObject(l)},t.$modes={},t.moduleUrl=function(e,t){if(l.$moduleUrls[e])return l.$moduleUrls[e];var i=e.split("/"),n="snippets"==(t=t||i[i.length-2]||"")?"/":"-",o=i[i.length-1];if("worker"==t&&"-"==n){var r=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");o=o.replace(r,"")}(!o||o==t)&&i.length>1&&(o=i[i.length-2]);var s=l[t+"Path"];return null==s?s=l.basePath:"/"==n&&(t=n=""),s&&"/"!=s.slice(-1)&&(s+="/"),s+t+n+o+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.setLoader=function(e){a=e},t.dynamicModules=Object.create(null),t.$loading={},t.$loaded={},t.loadModule=function(i,n){var r;if(Array.isArray(i))var s=i[0],l=i[1];else"string"==typeof i&&(l=i);var h=function(i){if(i&&!t.$loading[l])return n&&n(i);if(t.$loading[l]||(t.$loading[l]=[]),t.$loading[l].push(n),!(t.$loading[l].length>1)){var r=function(){!function(t,i){"ace/theme/textmate"===t||"./theme/textmate"===t?i(null,e("./theme/textmate")):a?a(t,i):console.error("loader is not configured")}(l,(function(e,i){i&&(t.$loaded[l]=i),t._emit("load.module",{name:l,module:i});var n=t.$loading[l];t.$loading[l]=null,n.forEach((function(e){e&&e(i)}))}))};if(!t.get("packaged"))return r();o.loadScript(t.moduleUrl(l,s),r),c()}};if(t.dynamicModules[l])t.dynamicModules[l]().then((function(e){e.default?h(e.default):h(e)}));else{try{r=this.$require(l)}catch(e){}h(r||t.$loaded[l])}},t.$require=function(e){if("function"==typeof i.require)return i.require(e)},t.setModuleLoader=function(e,i){t.dynamicModules[e]=i};var c=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),c=function(){})};t.version="1.32.7"})),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],(function(e,t,n){"use strict";e("./lib/fixoldbrowsers");var o=e("./config");o.setLoader((function(t,i){e([t],(function(e){i(null,e)}))}));var r=function(){return this||"undefined"!=typeof window&&window}();function s(t){if(r&&r.document){o.set("packaged",t||e.packaged||n.packaged||r.define&&i.amdD.packaged);var s={},a="",l=document.currentScript||document._currentScript,c=l&&l.ownerDocument||document;l&&l.src&&(a=l.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var h,d=c.getElementsByTagName("script"),u=0;u<d.length;u++){var g=d[u],p=g.src||g.getAttribute("src");if(p){for(var m=g.attributes,f=0,v=m.length;f<v;f++){var C=m[f];0===C.name.indexOf("data-ace-")&&(s[(h=C.name.replace(/^data-ace-/,""),h.replace(/-(.)/g,(function(e,t){return t.toUpperCase()})))]=C.value)}var y=p.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);y&&(a=y[1])}}for(var I in a&&(s.base=s.base||a,s.packaged=!0),s.basePath=s.base,s.workerPath=s.workerPath||s.base,s.modePath=s.modePath||s.base,s.themePath=s.themePath||s.base,delete s.base,s)void 0!==s[I]&&o.set(I,s[I])}}n.exports=function(t){o.init=s,o.$require=e,t.require=e,t.define=i.amdD},s(!0)})),ace.define("ace/range",["require","exports","module"],(function(e,t,i){"use strict";var n=function(){function e(e,t,i,n){this.start={row:e,column:t},this.end={row:i,column:n}}return e.prototype.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},e.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},e.prototype.contains=function(e,t){return 0==this.compare(e,t)},e.prototype.compareRange=function(e){var t,i=e.end,n=e.start;return 1==(t=this.compare(i.row,i.column))?1==(t=this.compare(n.row,n.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(n.row,n.column))?-1:1==t?42:0},e.prototype.comparePoint=function(e){return this.compare(e.row,e.column)},e.prototype.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},e.prototype.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},e.prototype.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},e.prototype.isStart=function(e,t){return this.start.row==e&&this.start.column==t},e.prototype.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},e.prototype.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},e.prototype.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},e.prototype.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},e.prototype.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},e.prototype.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:t<this.start.column?-1:t>this.end.column?1:0},e.prototype.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},e.prototype.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.clipRows=function(t,i){if(this.end.row>i)var n={row:i+1,column:0};else this.end.row<t&&(n={row:t,column:0});if(this.start.row>i)var o={row:i+1,column:0};else this.start.row<t&&(o={row:t,column:0});return e.fromPoints(o||this.start,n||this.end)},e.prototype.extend=function(t,i){var n=this.compare(t,i);if(0==n)return this;if(-1==n)var o={row:t,column:i};else var r={row:t,column:i};return e.fromPoints(o||this.start,r||this.end)},e.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},e.prototype.isMultiLine=function(){return this.start.row!==this.end.row},e.prototype.clone=function(){return e.fromPoints(this.start,this.end)},e.prototype.collapseRows=function(){return 0==this.end.column?new e(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new e(this.start.row,0,this.end.row,0)},e.prototype.toScreenRange=function(t){var i=t.documentToScreenPosition(this.start),n=t.documentToScreenPosition(this.end);return new e(i.row,i.column,n.row,n.column)},e.prototype.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t},e}();n.fromPoints=function(e,t){return new n(e.row,e.column,t.row,t.column)},n.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=n})),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],(function(e,t,i){"use strict";var n=e("./oop"),o=function(){var e,t,i={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in i.PRINTABLE_KEYS[173]="-",i.FUNCTION_KEYS)e=i.FUNCTION_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);for(t in i.PRINTABLE_KEYS)e=i.PRINTABLE_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);return n.mixin(i,i.MODIFIER_KEYS),n.mixin(i,i.PRINTABLE_KEYS),n.mixin(i,i.FUNCTION_KEYS),i.enter=i.return,i.escape=i.esc,i.del=i.delete,function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)i.KEY_MODS[t]=e.filter((function(e){return t&i.KEY_MODS[e]})).join("-")+"-"}(),i.KEY_MODS[0]="",i.KEY_MODS[-1]="input-",i}();n.mixin(t,o),t.default=t,t.keyCodeToString=function(e){var t=o[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}})),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,i){"use strict";var n,o=e("./keys"),r=e("./useragent"),s=null,a=0;function l(){return null==n&&function(){n=!1;try{document.createComment("").addEventListener("test",(function(){}),{get passive(){return n={passive:!1},!0}})}catch(e){}}(),n}function c(e,t,i){this.elem=e,this.type=t,this.callback=i}c.prototype.destroy=function(){d(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var h=t.addListener=function(e,t,i,n){e.addEventListener(t,i,l()),n&&n.$toDestroy.push(new c(e,t,i))},d=t.removeListener=function(e,t,i){e.removeEventListener(t,i,l())};function u(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}function g(){s=Object.create(null)}if(t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation&&e.stopPropagation()},t.preventDefault=function(e){e.preventDefault&&e.preventDefault()},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||r.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.button},t.capture=function(e,t,i){var n=e&&e.ownerDocument||document;function o(e){t&&t(e),i&&i(e),d(n,"mousemove",t),d(n,"mouseup",o),d(n,"dragstart",o)}return h(n,"mousemove",t),h(n,"mouseup",o),h(n,"dragstart",o),o},t.addMouseWheelListener=function(e,t,i){h(e,"wheel",(function(e){var i=e.deltaX||0,n=e.deltaY||0;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.15*i,e.wheelY=.15*n;break;case e.DOM_DELTA_LINE:e.wheelX=15*i,e.wheelY=15*n;break;case e.DOM_DELTA_PAGE:e.wheelX=150*i,e.wheelY=150*n}t(e)}),i)},t.addMultiMouseDownListener=function(e,i,n,o,s){var a,l,c,d=0,u={2:"dblclick",3:"tripleclick",4:"quadclick"};function g(e){if(0!==t.getButton(e)?d=0:e.detail>1?++d>4&&(d=1):d=1,r.isIE){var s=Math.abs(e.clientX-a)>5||Math.abs(e.clientY-l)>5;c&&!s||(d=1),c&&clearTimeout(c),c=setTimeout((function(){c=null}),i[d-1]||600),1==d&&(a=e.clientX,l=e.clientY)}if(e._clicks=d,n[o]("mousedown",e),d>4)d=0;else if(d>1)return n[o](u[d],e)}Array.isArray(e)||(e=[e]),e.forEach((function(e){h(e,"mousedown",g,s)}))},t.getModifierString=function(e){return o.KEY_MODS[u(e)]},t.addCommandKeyListener=function(e,i,n){var l=null;h(e,"keydown",(function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=function(e,t,i){var n=u(t);if(!r.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(n|=8),s.altGr){if(3==(3&n))return;s.altGr=0}if(18===i||17===i){var l=t.location;17===i&&1===l?1==s[i]&&(a=t.timeStamp):18===i&&3===n&&2===l&&t.timeStamp-a<50&&(s.altGr=!0)}}if(i in o.MODIFIER_KEYS&&(i=-1),n||13!==i||3!==t.location||(e(t,n,-i),!t.defaultPrevented)){if(r.isChromeOS&&8&n){if(e(t,n,i),t.defaultPrevented)return;n&=-9}return!!(n||i in o.FUNCTION_KEYS||i in o.PRINTABLE_KEYS)&&e(t,n,i)}}(i,e,e.keyCode);return l=e.defaultPrevented,t}),n),h(e,"keypress",(function(e){l&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),l=null)}),n),h(e,"keyup",(function(e){s[e.keyCode]=null}),n),s||(g(),h(window,"focus",g))},"object"==typeof window&&window.postMessage&&!r.isOldIE){var p=1;t.nextTick=function(e,i){i=i||window;var n="zero-timeout-message-"+p++,o=function(r){r.data==n&&(t.stopPropagation(r),d(i,"message",o),e())};h(i,"message",o),i.postMessage(n,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,i){return setTimeout((function i(){t.$idleBlocked?setTimeout(i,100):e()}),i)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout((function(){t.$idleBlocked=!1}),e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}})),ace.define("ace/clipboard",["require","exports","module"],(function(e,t,i){"use strict";var n;i.exports={lineMode:!1,pasteCancelled:function(){return!!(n&&n>Date.now()-50)||(n=!1)},cancel:function(){n=Date.now()}}})),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],(function(e,t,i){"use strict";var n,o=e("../lib/event"),r=e("../config").nls,s=e("../lib/useragent"),a=e("../lib/dom"),l=e("../lib/lang"),c=e("../clipboard"),h=s.isChrome<18,d=s.isIE,u=s.isChrome>63,g=400,p=e("../lib/keys"),m=p.KEY_MODS,f=s.isIOS,v=f?/\s/:/\n/,C=s.isMobile;n=function(e,t){var i=a.createElement("textarea");i.className="ace_text-input",i.setAttribute("wrap","off"),i.setAttribute("autocorrect","off"),i.setAttribute("autocapitalize","off"),i.setAttribute("spellcheck","false"),i.style.opacity="0",e.insertBefore(i,e.firstChild);var n=!1,y=!1,I=!1,b=!1,A="";C||(i.style.fontSize="1px");var w=!1,S=!1,x="",k=0,T=0,E=0,R=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER,$=0;try{var L=document.activeElement===i}catch(e){}this.setNumberOfExtraLines=function(e){R=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER,$=e<0?0:e},this.setAriaOptions=function(e){if(e.activeDescendant?(i.setAttribute("aria-haspopup","true"),i.setAttribute("aria-autocomplete",e.inline?"both":"list"),i.setAttribute("aria-activedescendant",e.activeDescendant)):(i.setAttribute("aria-haspopup","false"),i.setAttribute("aria-autocomplete","both"),i.removeAttribute("aria-activedescendant")),e.role&&i.setAttribute("role",e.role),e.setLabel&&(i.setAttribute("aria-roledescription",r("editor")),t.session)){var n=t.session.selection.cursor.row;i.setAttribute("aria-label",r("Cursor at row $0",[n+1]))}},this.setAriaOptions({role:"textbox"}),o.addListener(i,"blur",(function(e){S||(t.onBlur(e),L=!1)}),t),o.addListener(i,"focus",(function(e){if(!S){if(L=!0,s.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),s.isEdge?setTimeout(M):M()}}),t),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:t.renderer.enableKeyboardAccessibility}),A||u||"browser"==this.$focusScroll)return i.focus({preventScroll:!0});var e=i.style.top;i.style.position="fixed",i.style.top="0px";try{var n=0!=i.getBoundingClientRect().top}catch(e){return}var o=[];if(n)for(var r=i.parentElement;r&&1==r.nodeType;)o.push(r),r.setAttribute("ace_nocontext","true"),r=!r.parentElement&&r.getRootNode?r.getRootNode().host:r.parentElement;i.focus({preventScroll:!0}),n&&o.forEach((function(e){e.removeAttribute("ace_nocontext")})),setTimeout((function(){i.style.position="","0px"==i.style.top&&(i.style.top=e)}),0)},this.blur=function(){i.blur()},this.isFocused=function(){return L},t.on("beforeEndOperation",(function(){var e=t.curOp,n=e&&e.command&&e.command.name;if("insertstring"!=n){var o=n&&(e.docChanged||e.selectionChanged);I&&o&&(x=i.value="",j()),M()}}));var N=function(e,i){for(var n=i,o=1;o<=e-R&&o<2*$+1;o++)n+=t.session.getLine(e-o).length+1;return n},M=f?function(e){if(L&&(!n||e)&&!b){e||(e="");var o="\n ab"+e+"cde fg\n";o!=i.value&&(i.value=x=o);var r=4+(e.length||(t.selection.isEmpty()?0:1));4==k&&T==r||i.setSelectionRange(4,r),k=4,T=r}}:function(){if(!I&&!b&&(L||W)){I=!0;var e=0,n=0,o="";if(t.session){var r=t.selection,s=r.getRange(),a=r.cursor.row;a===_+1?_=(R=_+1)+2*$:a===R-1?R=(_=R-1)-2*$:(a<R-1||a>_+1)&&(R=a>$?a-$:0,_=a>$?a+$:2*$);for(var l=[],c=R;c<=_;c++)l.push(t.session.getLine(c));if(o=l.join("\n"),e=N(s.start.row,s.start.column),n=N(s.end.row,s.end.column),s.start.row<R){var h=t.session.getLine(R-1);e=s.start.row<R-1?0:e,n+=h.length+1,o=h+"\n"+o}else if(s.end.row>_){var d=t.session.getLine(_+1);n=s.end.row>_+1?d.length:s.end.column,n+=o.length+1,o=o+"\n"+d}else C&&a>0&&(o="\n"+o,n+=1,e+=1);o.length>g&&(e<g&&n<g?o=o.slice(0,g):(o="\n",e==n?e=n=0:(e=0,n=1)));var u=o+"\n\n";u!=x&&(i.value=x=u,k=T=u.length)}if(W&&(k=i.selectionStart,T=i.selectionEnd),T!=n||k!=e||i.selectionEnd!=T)try{i.setSelectionRange(e,n),k=e,T=n}catch(e){}I=!1}};this.resetSelection=M,L&&t.onFocus();var B=null;this.setInputHandler=function(e){B=e},this.getInputHandler=function(){return B};var W=!1,P=function(e,n){if(W&&(W=!1),y)return M(),e&&t.onPaste(e),y=!1,"";for(var o=i.selectionStart,r=i.selectionEnd,a=k,l=x.length-T,c=e,h=e.length-o,d=e.length-r,u=0;a>0&&x[u]==e[u];)u++,a--;for(c=c.slice(u),u=1;l>0&&x.length-u>k-1&&x[x.length-u]==e[e.length-u];)u++,l--;h-=u-1,d-=u-1;var g=c.length-u+1;if(g<0&&(a=-g,g=0),c=c.slice(0,g),!(n||c||h||a||l||d))return"";b=!0;var p=!1;return s.isAndroid&&". "==c&&(c=" ",p=!0),c&&!a&&!l&&!h&&!d||w?t.onTextInput(c):t.onTextInput(c,{extendLeft:a,extendRight:l,restoreStart:h,restoreEnd:d}),b=!1,x=e,k=o,T=r,E=d,p?"\n":c},H=function(e){if(I)return D();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var n=i.value,o=P(n,!0);(n.length>500||v.test(o)||C&&k<1&&k==T)&&M()},G=function(e,t,i){var n=e.clipboardData||window.clipboardData;if(n&&!h){var o=d||i?"Text":"text/plain";try{return t?!1!==n.setData(o,t):n.getData(o)}catch(e){if(!i)return G(e,t,!0)}}},F=function(e,r){var s=t.getCopyText();if(!s)return o.preventDefault(e);G(e,s)?(f&&(M(s),n=s,setTimeout((function(){n=!1}),10)),r?t.onCut():t.onCopy(),o.preventDefault(e)):(n=!0,i.value=s,i.select(),setTimeout((function(){n=!1,M(),r?t.onCut():t.onCopy()})))},O=function(e){F(e,!0)},V=function(e){F(e,!1)},Z=function(e){var n=G(e);c.pasteCancelled()||("string"==typeof n?(n&&t.onPaste(n,e),s.isIE&&setTimeout(M),o.preventDefault(e)):(i.value="",y=!0))};o.addCommandKeyListener(i,(function(e,i,n){if(!I)return t.onCommandKey(e,i,n)}),t),o.addListener(i,"select",(function(e){I||(n?n=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=x.length&&e.value===x&&x&&e.selectionEnd!==T}(i)?(t.selectAll(),M()):C&&i.selectionStart!=k&&M())}),t),o.addListener(i,"input",H,t),o.addListener(i,"cut",O,t),o.addListener(i,"copy",V,t),o.addListener(i,"paste",Z,t),"oncut"in i&&"oncopy"in i&&"onpaste"in i||o.addListener(e,"keydown",(function(e){if((!s.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:V(e);break;case 86:Z(e);break;case 88:O(e)}}),t);var D=function(){if(I&&t.onCompositionUpdate&&!t.$readOnly){if(w)return K();if(I.useTextareaForIME)t.onCompositionUpdate(i.value);else{var e=i.value;P(e),I.markerRange&&(I.context&&(I.markerRange.start.column=I.selectionStart=I.context.compositionStartOffset),I.markerRange.end.column=I.markerRange.start.column+T-I.selectionStart+E)}}},j=function(e){t.onCompositionEnd&&!t.$readOnly&&(I=!1,t.onCompositionEnd(),t.off("mousedown",K),e&&H())};function K(){S=!0,i.blur(),i.focus(),S=!1}var z,X=l.delayedCall(D,50).schedule.bind(null,null);function Y(){clearTimeout(z),z=setTimeout((function(){A&&(i.style.cssText=A,A=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()}),0)}o.addListener(i,"compositionstart",(function(e){if(!I&&t.onCompositionStart&&!t.$readOnly&&(I={},!w)){e.data&&(I.useTextareaForIME=!1),setTimeout(D,0),t._signal("compositionStart"),t.on("mousedown",K);var n=t.getSelectionRange();n.end.row=n.start.row,n.end.column=n.start.column,I.markerRange=n,I.selectionStart=k,t.onCompositionStart(I),I.useTextareaForIME?(x=i.value="",k=0,T=0):(i.msGetInputContext&&(I.context=i.msGetInputContext()),i.getInputContext&&(I.context=i.getInputContext()))}}),t),o.addListener(i,"compositionupdate",D,t),o.addListener(i,"keyup",(function(e){27==e.keyCode&&i.value.length<i.selectionStart&&(I||(x=i.value),k=T=-1,M()),X()}),t),o.addListener(i,"keydown",X,t),o.addListener(i,"compositionend",j,t),this.getElement=function(){return i},this.setCommandMode=function(e){w=e,i.readOnly=!1},this.setReadOnly=function(e){w||(i.readOnly=e)},this.setCopyWithEmptySelection=function(e){},this.onContextMenu=function(e){W=!0,M(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,n){A||(A=i.style.cssText),i.style.cssText=(n?"z-index:100000;":"")+(s.isIE?"opacity:0.1;":"")+"text-indent: -"+(k+T)*t.renderer.characterWidth*.5+"px;";var r=t.container.getBoundingClientRect(),l=a.computedStyle(t.container),c=r.top+(parseInt(l.borderTopWidth)||0),h=r.left+(parseInt(r.borderLeftWidth)||0),d=r.bottom-c-i.clientHeight-2,u=function(e){a.translate(i,e.clientX-h-2,Math.min(e.clientY-c-2,d))};u(e),"mousedown"==e.type&&(t.renderer.$isMousePressed=!0,clearTimeout(z),s.isWin&&o.capture(t.container,u,Y))},this.onContextMenuClose=Y;var J=function(e){t.textInput.onContextMenu(e),Y()};o.addListener(i,"mouseup",J,t),o.addListener(i,"mousedown",(function(e){e.preventDefault(),Y()}),t),o.addListener(t.renderer.scroller,"contextmenu",J,t),o.addListener(i,"contextmenu",J,t),f&&function(e,t,i){var o=null,r=!1;i.addEventListener("keydown",(function(e){o&&clearTimeout(o),r=!0}),!0),i.addEventListener("keyup",(function(e){o=setTimeout((function(){r=!1}),100)}),!0);var s=function(e){if(document.activeElement===i&&!(r||I||t.$mouseHandler.isMousePressed||n)){var o=i.selectionStart,s=i.selectionEnd,a=null,l=0;if(0==o?a=p.up:1==o?a=p.home:s>T&&"\n"==x[s]?a=p.end:o<k&&" "==x[o-1]?(a=p.left,l=m.option):o<k||o==k&&T!=k&&o==s?a=p.left:s>T&&x.slice(0,s).split("\n").length>2?a=p.down:s>T&&" "==x[s-1]?(a=p.right,l=m.option):(s>T||s==T&&T!=k&&o==s)&&(a=p.right),o!==s&&(l|=m.shift),a){if(!t.onCommandKey({},l,a)&&t.commands){a=p.keyCodeToString(a);var c=t.commands.findKeyCommand(l,a);c&&t.execCommand(c)}k=o,T=s,M("")}}};document.addEventListener("selectionchange",s),t.on("destroy",(function(){document.removeEventListener("selectionchange",s)}))}(0,t,i),this.destroy=function(){i.parentElement&&i.parentElement.removeChild(i)}},t.TextInput=n,t.$setUserAgentForTests=function(e,t){C=e,f=t}})),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],(function(e,t,i){"use strict";var n=e("../lib/useragent"),o=function(){function e(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach((function(t){e[t]=this[t]}),this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}return e.prototype.onMouseDown=function(e){var t=e.inSelection(),i=e.getDocumentPosition();this.mousedownEvent=e;var o=this.editor,r=e.getButton();return 0!==r?((o.getSelectionRange().isEmpty()||1==r)&&o.selection.moveToPosition(i),void(2==r&&(o.textInput.onContextMenu(e.domEvent),n.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||o.isFocused()||(o.focus(),!this.$focusTimeout||this.$clickSelection||o.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(i,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},e.prototype.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(e):t||i.selection.moveToPosition(e),t||this.select(),i.setStyle("ace_selecting"),this.setState("select"))},e.prototype.select=function(){var e,t=this.editor,i=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var n=this.$clickSelection.comparePoint(i);if(-1==n)e=this.$clickSelection.end;else if(1==n)e=this.$clickSelection.start;else{var o=r(this.$clickSelection,i);i=o.cursor,e=o.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(i),t.renderer.scrollCursorIntoView()},e.prototype.extendSelectionBy=function(e){var t,i=this.editor,n=i.renderer.screenToTextCoordinates(this.x,this.y),o=i.selection[e](n.row,n.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(o.start),a=this.$clickSelection.comparePoint(o.end);if(-1==s&&a<=0)t=this.$clickSelection.end,o.end.row==n.row&&o.end.column==n.column||(n=o.start);else if(1==a&&s>=0)t=this.$clickSelection.start,o.start.row==n.row&&o.start.column==n.column||(n=o.end);else if(-1==s&&1==a)n=o.end,t=o.start;else{var l=r(this.$clickSelection,n);n=l.cursor,t=l.anchor}i.selection.setSelectionAnchor(t.row,t.column)}i.selection.selectToPosition(n),i.renderer.scrollCursorIntoView()},e.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},e.prototype.focusWait=function(){var e,t,i,n,o=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,i=this.x,n=this.y,Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))),r=Date.now();(o>0||r-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},e.prototype.onDoubleClick=function(e){var t=e.getDocumentPosition(),i=this.editor,n=i.session.getBracketRange(t);n?(n.isEmpty()&&(n.start.column--,n.end.column++),this.setState("select")):(n=i.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=n,this.select()},e.prototype.onTripleClick=function(e){var t=e.getDocumentPosition(),i=this.editor;this.setState("selectByLines");var n=i.getSelectionRange();n.isMultiLine()&&n.contains(t.row,t.column)?(this.$clickSelection=i.selection.getLineRange(n.start.row),this.$clickSelection.end=i.selection.getLineRange(n.end.row).end):this.$clickSelection=i.selection.getLineRange(t.row),this.select()},e.prototype.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},e.prototype.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var i=this.$lastScroll,n=e.domEvent.timeStamp,o=n-i.t,r=o?e.wheelX/o:i.vx,s=o?e.wheelY/o:i.vy;o<550&&(r=(r+i.vx)/2,s=(s+i.vy)/2);var a=Math.abs(r/s),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?i.allowed=n:n-i.allowed<550&&(Math.abs(r)<=1.5*Math.abs(i.vx)&&Math.abs(s)<=1.5*Math.abs(i.vy)?(l=!0,i.allowed=n):i.allowed=0),i.t=n,i.vx=r,i.vy=s,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}},e}();function r(e,t){if(e.start.row==e.end.row)var i=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)i=2*t.row-e.start.row-e.end.row;else var i=t.column-4;return i<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}o.prototype.selectEnd=o.prototype.selectByLinesEnd,o.prototype.selectAllEnd=o.prototype.selectByLinesEnd,o.prototype.selectByWordsEnd=o.prototype.selectByLinesEnd,t.DefaultHandlers=o})),ace.define("ace/lib/scroll",["require","exports","module"],(function(e,t,i){t.preventParentScroll=function(e){e.stopPropagation();var t=e.currentTarget;t.scrollHeight>t.clientHeight||e.preventDefault()}})),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],(function(e,t,i){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=e("./lib/dom"),a=(e("./lib/event"),e("./range").Range),l=e("./lib/scroll").preventParentScroll,c="ace_tooltip",h=function(){function e(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}return e.prototype.$init=function(){return this.$element=s.createElement("div"),this.$element.className=c,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},e.prototype.getElement=function(){return this.$element||this.$init()},e.prototype.setText=function(e){this.getElement().textContent=e},e.prototype.setHtml=function(e){this.getElement().innerHTML=e},e.prototype.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},e.prototype.setClassName=function(e){s.addCssClass(this.getElement(),e)},e.prototype.setTheme=function(e){this.$element.className=c+" "+(e.isDark?"ace_dark ":"")+(e.cssClass||"")},e.prototype.show=function(e,t,i){null!=e&&this.setText(e),null!=t&&null!=i&&this.setPosition(t,i),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},e.prototype.hide=function(e){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=c,this.isOpen=!1)},e.prototype.getHeight=function(){return this.getElement().offsetHeight},e.prototype.getWidth=function(){return this.getElement().offsetWidth},e.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},e}(),d=new(function(){function e(){this.popups=[]}return e.prototype.addPopup=function(e){this.popups.push(e),this.updatePopups()},e.prototype.removePopup=function(e){var t=this.popups.indexOf(e);-1!==t&&(this.popups.splice(t,1),this.updatePopups())},e.prototype.updatePopups=function(){var e,t,i,n;this.popups.sort((function(e,t){return t.priority-e.priority}));var o=[];try{for(var s=r(this.popups),a=s.next();!a.done;a=s.next()){var l=a.value,c=!0;try{for(var h=(i=void 0,r(o)),d=h.next();!d.done;d=h.next()){var u=d.value;if(this.doPopupsOverlap(u,l)){c=!1;break}}}catch(e){i={error:e}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}c?o.push(l):l.hide()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}},e.prototype.doPopupsOverlap=function(e,t){var i=e.getElement().getBoundingClientRect(),n=t.getElement().getBoundingClientRect();return i.left<n.right&&i.right>n.left&&i.top<n.bottom&&i.bottom>n.top},e}());t.popupManager=d,t.Tooltip=h;var u=function(e){function t(t){void 0===t&&(t=document.body);var i=e.call(this,t)||this;i.timeout=void 0,i.lastT=0,i.idleTime=350,i.lastEvent=void 0,i.onMouseOut=i.onMouseOut.bind(i),i.onMouseMove=i.onMouseMove.bind(i),i.waitForHover=i.waitForHover.bind(i),i.hide=i.hide.bind(i);var n=i.getElement();return n.style.whiteSpace="pre-wrap",n.style.pointerEvents="auto",n.addEventListener("mouseout",i.onMouseOut),n.tabIndex=-1,n.addEventListener("blur",function(){n.contains(document.activeElement)||this.hide()}.bind(i)),n.addEventListener("wheel",l),i}return o(t,e),t.prototype.addToEditor=function(e){e.on("mousemove",this.onMouseMove),e.on("mousedown",this.hide),e.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},t.prototype.removeFromEditor=function(e){e.off("mousemove",this.onMouseMove),e.off("mousedown",this.hide),e.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},t.prototype.onMouseMove=function(e,t){this.lastEvent=e,this.lastT=Date.now();var i=t.$mouseHandler.isMousePressed;if(this.isOpen){var n=this.lastEvent&&this.lastEvent.getDocumentPosition();this.range&&this.range.contains(n.row,n.column)&&!i&&!this.isOutsideOfText(this.lastEvent)||this.hide()}this.timeout||i||(this.lastEvent=e,this.timeout=setTimeout(this.waitForHover,this.idleTime))},t.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var e=Date.now()-this.lastT;this.idleTime-e>10?this.timeout=setTimeout(this.waitForHover,this.idleTime-e):(this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor))},t.prototype.isOutsideOfText=function(e){var t=e.editor,i=e.getDocumentPosition(),n=t.session.getLine(i.row);if(i.column==n.length){var o=t.renderer.pixelToScreenCoordinates(e.clientX,e.clientY),r=t.session.documentToScreenPosition(i.row,i.column);if(r.column!=o.column||r.row!=o.row)return!0}return!1},t.prototype.setDataProvider=function(e){this.$gatherData=e},t.prototype.showForRange=function(e,t,i,n){if(!(n&&n!=this.lastEvent||this.isOpen&&document.activeElement==this.getElement())){var o=e.renderer;this.isOpen||(d.addPopup(this),this.$registerCloseEvents(),this.setTheme(o.theme)),this.isOpen=!0,this.addMarker(t,e.session),this.range=a.fromPoints(t.start,t.end);var r=o.textToScreenCoordinates(t.start.row,t.start.column),s=o.scroller.getBoundingClientRect();r.pageX<s.left&&(r.pageX=s.left);var l=this.getElement();l.innerHTML="",l.appendChild(i),l.style.maxHeight="",l.style.display="block";var c=l.clientHeight,h=l.clientWidth,u=window.innerHeight-r.pageY-o.lineHeight,g=!0;r.pageY-c<0&&r.pageY<u&&(g=!1),l.style.maxHeight=(g?r.pageY:u)-10+"px",l.style.top=g?"":r.pageY+o.lineHeight+"px",l.style.bottom=g?window.innerHeight-r.pageY+"px":"",l.style.left=Math.min(r.pageX,window.innerWidth-h-10)+"px"}},t.prototype.addMarker=function(e,t){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=t,this.marker=t&&t.addMarker(e,"ace_highlight-marker","text")},t.prototype.hide=function(e){(e||document.activeElement!=this.getElement())&&(e&&e.target&&("keydown"!=e.type||e.ctrlKey||e.metaKey)&&this.$element.contains(e.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,d.removePopup(this))))},t.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},t.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},t.prototype.onMouseOut=function(e){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&e.relatedTarget&&!this.getElement().contains(e.relatedTarget)&&(e&&e.currentTarget.contains(e.relatedTarget)||e.relatedTarget.classList.contains("ace_content")||this.hide())},t}(h);t.HoverTooltip=u})),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config"],(function(e,t,i){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=e("../lib/dom"),a=e("../lib/event"),l=e("../tooltip").Tooltip,c=e("../config").nls;t.GutterHandler=function(e){var t,i,n=e.editor,o=n.renderer.$gutterLayer,r=new h(n);function l(){t&&(t=clearTimeout(t)),r.isOpen&&(r.hideTooltip(),n.off("mousewheel",l))}function c(e){r.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",(function(t){if(n.isFocused()&&0==t.getButton()&&"foldWidgets"!=o.getRegion(t)){var i=t.getDocumentPosition().row,r=n.session.selection;if(t.getShiftKey())r.selectTo(i,0);else{if(2==t.domEvent.detail)return n.selectAll(),t.preventDefault();e.$clickSelection=n.selection.getLineRange(i)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}})),e.editor.setDefaultHandler("guttermousemove",(function(a){var h=a.domEvent.target||a.domEvent.srcElement;if(s.hasCssClass(h,"ace_fold-widget"))return l();r.isOpen&&e.$tooltipFollowsMouse&&c(a),i=a,t||(t=setTimeout((function(){t=null,i&&!e.isMousePressed?function(){var t=i.getDocumentPosition().row;if(t==n.session.getLength()){var s=n.renderer.pixelToScreenCoordinates(0,i.y).row,a=i.$pos;if(s>n.session.documentToScreenRow(a.row,a.column))return l()}if(r.showTooltip(t),r.isOpen)if(n.on("mousewheel",l),e.$tooltipFollowsMouse)c(i);else{var h=i.getGutterRow(),d=o.$lines.get(h);if(d){var u=d.element.querySelector(".ace_gutter_annotation").getBoundingClientRect(),g=r.getElement().style;g.left=u.right+"px",g.top=u.bottom+"px"}else c(i)}}():l()}),50))})),a.addListener(n.renderer.$gutter,"mouseout",(function(e){i=null,r.isOpen&&!t&&(t=setTimeout((function(){t=null,l()}),50))}),n),n.on("changeSession",l),n.on("input",l)};var h=function(e){function t(t){var i=e.call(this,t.container)||this;return i.editor=t,i}return o(t,e),t.prototype.setPosition=function(e,t){var i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,o=this.getWidth(),r=this.getHeight();(e+=15)+o>i&&(e-=e+o-i),(t+=15)+r>n&&(t-=20+r),l.prototype.setPosition.call(this,e,t)},Object.defineProperty(t,"annotationLabels",{get:function(){return{error:{singular:c("error"),plural:c("errors")},warning:{singular:c("warning"),plural:c("warnings")},info:{singular:c("information message"),plural:c("information messages")}}},enumerable:!1,configurable:!0}),t.prototype.showTooltip=function(e){var i,n=this.editor.renderer.$gutterLayer,o=n.$annotations[e];i=o?{text:Array.from(o.text),type:Array.from(o.type)}:{text:[],type:[]};var r=n.session.getFoldLine(e);if(r&&n.$showFoldedAnnotations){for(var s,a={error:[],warning:[],info:[]},l=e+1;l<=r.end.row;l++)if(n.$annotations[l])for(var c=0;c<n.$annotations[l].text.length;c++){var h=n.$annotations[l].type[c];a[h].push(n.$annotations[l].text[c]),"error"!==h?"warning"!==h||(s="warning_fold"):s="error_fold"}if("error_fold"===s||"warning_fold"===s){var d="".concat(t.annotationsToSummaryString(a)," in folded code.");i.text.push(d),i.type.push(s)}}if(0===i.text.length)return this.hide();var u={error:[],warning:[],info:[]},g=n.$useSvgGutterIcons?"ace_icon_svg":"ace_icon";for(l=0;l<i.text.length;l++){var p="<span class='ace_".concat(i.type[l]," ").concat(g,"' aria-label='").concat(t.annotationLabels[i.type[l].replace("_fold","")].singular,"' role=img> </span> ").concat(i.text[l]);u[i.type[l].replace("_fold","")].push(p)}var m=[].concat(u.error,u.warning,u.info).join("<br>");this.setHtml(m),this.$element.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},t.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},t.annotationsToSummaryString=function(e){var i,n,o=[];try{for(var s=r(["error","warning","info"]),a=s.next();!a.done;a=s.next()){var l=a.value;if(e[l].length){var c=1===e[l].length?t.annotationLabels[l].singular:t.annotationLabels[l].plural;o.push("".concat(e[l].length," ").concat(c))}}}catch(e){i={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o.join(", ")},t}(l);t.GutterTooltip=h})),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,i){"use strict";var n=e("../lib/event"),o=e("../lib/useragent"),r=function(){function e(e,t){this.speed,this.wheelX,this.wheelY,this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return e.prototype.stopPropagation=function(){n.stopPropagation(this.domEvent),this.propagationStopped=!0},e.prototype.preventDefault=function(){n.preventDefault(this.domEvent),this.defaultPrevented=!0},e.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},e.prototype.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},e.prototype.getGutterRow=function(){var e=this.getDocumentPosition().row;return this.editor.session.documentToScreenRow(e,0)-this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0)},e.prototype.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},e.prototype.getButton=function(){return n.getButton(this.domEvent)},e.prototype.getShiftKey=function(){return this.domEvent.shiftKey},e.prototype.getAccelKey=function(){return o.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},e}();t.MouseEvent=r})),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],(function(e,t,i){"use strict";var n=e("../lib/dom"),o=e("../lib/event"),r=e("../lib/useragent");function s(e){var t=e.editor,i=n.createElement("div");i.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",i.textContent=" ",["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach((function(t){e[t]=this[t]}),this),t.on("mousedown",this.onMouseDown.bind(e));var s,l,c,h,d,u,g,p,m,f,v,C=t.container,y=0;function I(){var e=u;(function(e,i){var n=Date.now(),o=!i||e.row!=i.row,r=!i||e.column!=i.column;!f||o||r?(t.moveCursorToPosition(e),f=n,v={x:l,y:c}):a(v.x,v.y,l,c)>5?f=null:n-f>=200&&(t.renderer.scrollCursorIntoView(),f=null)})(u=t.renderer.screenToTextCoordinates(l,c),e),function(e,i){var n=Date.now(),o=t.renderer.layerConfig.lineHeight,r=t.renderer.layerConfig.characterWidth,s=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-s.left,right:s.right-l},y:{top:c-s.top,bottom:s.bottom-c}},h=Math.min(a.x.left,a.x.right),d=Math.min(a.y.top,a.y.bottom),u={row:e.row,column:e.column};h/r<=2&&(u.column+=a.x.left<a.x.right?-3:2),d/o<=1&&(u.row+=a.y.top<a.y.bottom?-1:1);var g=e.row!=u.row,p=e.column!=u.column,f=!i||e.row!=i.row;g||p&&!f?m?n-m>=200&&t.renderer.scrollCursorIntoView(u):m=n:m=null}(u,e)}function b(){d=t.selection.toOrientedRange(),s=t.session.addMarker(d,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(h),I(),h=setInterval(I,20),y=0,o.addListener(document,"mousemove",S)}function A(){clearInterval(h),t.session.removeMarker(s),s=null,t.selection.fromOrientedRange(d),t.isFocused()&&!p&&t.$resetCursorStyle(),d=null,u=null,y=0,m=null,f=null,o.removeListener(document,"mousemove",S)}this.onDragStart=function(e){if(this.cancelDrag||!C.draggable){var n=this;return setTimeout((function(){n.startSelect(),n.captureMouse(e)}),0),e.preventDefault()}d=t.getSelectionRange();var o=e.dataTransfer;o.effectAllowed=t.getReadOnly()?"copy":"copyMove",t.container.appendChild(i),o.setDragImage&&o.setDragImage(i,0,0),setTimeout((function(){t.container.removeChild(i)})),o.clearData(),o.setData("Text",t.session.getTextRange()),p=!0,this.setState("drag")},this.onDragEnd=function(e){if(C.draggable=!1,p=!1,this.setState(null),!t.getReadOnly()){var i=e.dataTransfer.dropEffect;g||"move"!=i||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&x(e.dataTransfer))return l=e.clientX,c=e.clientY,s||b(),y++,e.dataTransfer.dropEffect=g=k(e),o.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&x(e.dataTransfer))return l=e.clientX,c=e.clientY,s||(b(),y++),null!==w&&(w=null),e.dataTransfer.dropEffect=g=k(e),o.preventDefault(e)},this.onDragLeave=function(e){if(--y<=0&&s)return A(),g=null,o.preventDefault(e)},this.onDrop=function(e){if(u){var i=e.dataTransfer;if(p)switch(g){case"move":d=d.contains(u.row,u.column)?{start:u,end:u}:t.moveText(d,u);break;case"copy":d=t.moveText(d,u,!0)}else{var n=i.getData("Text");d={start:u,end:t.session.insert(u,n)},t.focus(),g=null}return A(),o.preventDefault(e)}},o.addListener(C,"dragstart",this.onDragStart.bind(e),t),o.addListener(C,"dragend",this.onDragEnd.bind(e),t),o.addListener(C,"dragenter",this.onDragEnter.bind(e),t),o.addListener(C,"dragover",this.onDragOver.bind(e),t),o.addListener(C,"dragleave",this.onDragLeave.bind(e),t),o.addListener(C,"drop",this.onDrop.bind(e),t);var w=null;function S(){null==w&&(w=setTimeout((function(){null!=w&&s&&A()}),20))}function x(e){var t=e.types;return!t||Array.prototype.some.call(t,(function(e){return"text/plain"==e||"Text"==e}))}function k(e){var t=["copy","copymove","all","uninitialized"],i=r.isMac?e.altKey:e.ctrlKey,n="uninitialized";try{n=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var o="none";return i&&t.indexOf(n)>=0?o="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(n)>=0?o="move":t.indexOf(n)>=0&&(o="copy"),o}}function a(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=r.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;r.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,i=e.inSelection(),n=e.getButton();if(1===(e.domEvent.detail||1)&&0===n&&i){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var o=e.domEvent.target||e.domEvent.srcElement;"unselectable"in o&&(o.unselectable="on"),t.getDragDelay()?(r.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(s.prototype),t.DragdropHandler=s})),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("./mouse_event").MouseEvent,o=e("../lib/event"),r=e("../lib/dom");t.addTouchListeners=function(e,t){var i,s,a,l,c,h,d,u,g,p="scroll",m=0,f=0,v=0,C=0;function y(){var e=window.navigator&&window.navigator.clipboard,i=!1,n=function(n){var o,s,a=n.target.getAttribute("action");if("more"==a||!i)return i=!i,o=t.getCopyText(),s=t.session.getUndoManager().hasUndo(),void g.replaceChild(r.buildDom(i?["span",!o&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],o&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],o&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],s&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),g.firstChild);"paste"==a?e.readText().then((function(e){t.execCommand(a,e)})):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),g.firstChild.style.display="none",i=!1,"openCommandPalette"!=a&&t.focus()};g=r.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){p="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),n(e)},onclick:n},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container)}function I(){g||y();var e=t.selection.cursor,i=t.renderer.textToScreenCoordinates(e.row,e.column),n=t.renderer.textToScreenCoordinates(0,0).pageX,o=t.renderer.scrollLeft,r=t.container.getBoundingClientRect();g.style.top=i.pageY-r.top-3+"px",i.pageX-r.left<r.width-70?(g.style.left="",g.style.right="10px"):(g.style.right="",g.style.left=n+o-r.left+"px"),g.style.display="",g.firstChild.style.display="none",t.on("input",b)}function b(e){g&&(g.style.display="none"),t.off("input",b)}function A(){c=null,clearTimeout(c);var e=t.selection.getRange(),i=e.contains(d.row,d.column);!e.isEmpty()&&i||(t.selection.moveToPosition(d),t.selection.selectWord()),p="wait",I()}o.addListener(e,"contextmenu",(function(e){u&&t.textInput.getElement().focus()}),t),o.addListener(e,"touchstart",(function(e){var o=e.touches;if(c||o.length>1)return clearTimeout(c),c=null,a=-1,void(p="zoom");u=t.$mouseHandler.isMousePressed=!0;var r=t.renderer.layerConfig.lineHeight,h=t.renderer.layerConfig.lineHeight,g=e.timeStamp;l=g;var y=o[0],I=y.clientX,b=y.clientY;Math.abs(i-I)+Math.abs(s-b)>r&&(a=-1),i=e.clientX=I,s=e.clientY=b,v=C=0;var w=new n(e,t);if(d=w.getDocumentPosition(),g-a<500&&1==o.length&&!m)f++,e.preventDefault(),e.button=0,function(){c=null,clearTimeout(c),t.selection.moveToPosition(d);var e=f>=2?t.selection.getLineRange(d.row):t.session.getBracketRange(d);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),p="wait"}();else{f=0;var S=t.selection.cursor,x=t.selection.isEmpty()?S:t.selection.anchor,k=t.renderer.$cursorLayer.getPixelPosition(S,!0),T=t.renderer.$cursorLayer.getPixelPosition(x,!0),E=t.renderer.scroller.getBoundingClientRect(),R=t.renderer.layerConfig.offset,_=t.renderer.scrollLeft,$=function(e,t){return(e/=h)*e+(t=t/r-.75)*t};if(e.clientX<E.left)return void(p="zoom");var L=$(e.clientX-E.left-k.left+_,e.clientY-E.top-k.top+R),N=$(e.clientX-E.left-T.left+_,e.clientY-E.top-T.top+R);L<3.5&&N<3.5&&(p=L>N?"cursor":"anchor"),p=N<3.5?"anchor":L<3.5?"cursor":"scroll",c=setTimeout(A,450)}a=g}),t),o.addListener(e,"touchend",(function(e){u=t.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),"zoom"==p?(p="",m=0):c?(t.selection.moveToPosition(d),m=0,I()):"scroll"==p?(m+=60,h=setInterval((function(){m--<=0&&(clearInterval(h),h=null),Math.abs(v)<.01&&(v=0),Math.abs(C)<.01&&(C=0),m<20&&(v*=.9),m<20&&(C*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*v,10*C),e==t.session.getScrollTop()&&(m=0)}),10),b()):I(),clearTimeout(c),c=null}),t),o.addListener(e,"touchmove",(function(e){c&&(clearTimeout(c),c=null);var o=e.touches;if(!(o.length>1||"zoom"==p)){var r=o[0],a=i-r.clientX,h=s-r.clientY;if("wait"==p){if(!(a*a+h*h>4))return e.preventDefault();p="cursor"}i=r.clientX,s=r.clientY,e.clientX=r.clientX,e.clientY=r.clientY;var d=e.timeStamp,u=d-l;if(l=d,"scroll"==p){var g=new n(e,t);g.speed=1,g.wheelX=a,g.wheelY=h,10*Math.abs(a)<Math.abs(h)&&(a=0),10*Math.abs(h)<Math.abs(a)&&(h=0),0!=u&&(v=a/u,C=h/u),t._emit("mousewheel",g),g.propagationStopped||(v=C=0)}else{var m=new n(e,t).getDocumentPosition();"cursor"==p?t.selection.moveCursorToPosition(m):"anchor"==p&&t.selection.setSelectionAnchor(m.row,m.column),t.renderer.scrollCursorIntoView(m),e.preventDefault()}}}),t)}})),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],(function(e,t,i){"use strict";var n=e("../lib/event"),o=e("../lib/useragent"),r=e("./default_handlers").DefaultHandlers,s=e("./default_gutter_handler").GutterHandler,a=e("./mouse_event").MouseEvent,l=e("./dragdrop_handler").DragdropHandler,c=e("./touch_handler").addTouchListeners,h=e("../config"),d=function(){function e(e){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var t=this;this.editor=e,new r(this),new s(this),new l(this);var i=function(t){(!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement()))&&window.focus(),e.focus(),setTimeout((function(){e.isFocused()||e.focus()}))},a=e.renderer.getMouseEventTarget();n.addListener(a,"click",this.onMouseEvent.bind(this,"click"),e),n.addListener(a,"mousemove",this.onMouseMove.bind(this,"mousemove"),e),n.addMultiMouseDownListener([a,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",e),n.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"),e),c(e.container,e);var h=e.renderer.$gutter;n.addListener(h,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),e),n.addListener(h,"click",this.onMouseEvent.bind(this,"gutterclick"),e),n.addListener(h,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),e),n.addListener(h,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),e),n.addListener(a,"mousedown",i,e),n.addListener(h,"mousedown",i,e),o.isIE&&e.renderer.scrollBarV&&(n.addListener(e.renderer.scrollBarV.element,"mousedown",i,e),n.addListener(e.renderer.scrollBarH.element,"mousedown",i,e)),e.on("mousemove",(function(i){if(!t.state&&!t.$dragDelay&&t.$dragEnabled){var n=e.renderer.screenToTextCoordinates(i.x,i.y),o=e.session.selection.getRange(),r=e.renderer;!o.isEmpty()&&o.insideStart(n.row,n.column)?r.setCursorStyle("default"):r.setCursorStyle("")}}),e)}return e.prototype.onMouseEvent=function(e,t){this.editor.session&&this.editor._emit(e,new a(t,this.editor))},e.prototype.onMouseMove=function(e,t){var i=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;i&&i.length&&this.editor._emit(e,new a(t,this.editor))},e.prototype.onMouseWheel=function(e,t){var i=new a(t,this.editor);i.speed=2*this.$scrollSpeed,i.wheelX=t.wheelX,i.wheelY=t.wheelY,this.editor._emit(e,i)},e.prototype.setState=function(e){this.state=e},e.prototype.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var i=this.editor,r=this.editor.renderer;r.$isMousePressed=!0;var s=this,l=function(e){if(e){if(o.isWebKit&&!e.which&&s.releaseMouse)return s.releaseMouse();s.x=e.clientX,s.y=e.clientY,t&&t(e),s.mouseEvent=new a(e,s.editor),s.$mouseMoved=!0}},c=function(e){i.off("beforeEndOperation",d),clearInterval(u),i.session&&h(),s[s.state+"End"]&&s[s.state+"End"](e),s.state="",s.isMousePressed=r.$isMousePressed=!1,r.$keepTextAreaAtCursor&&r.$moveTextAreaToCursor(),s.$onCaptureMouseMove=s.releaseMouse=null,e&&s.onMouseEvent("mouseup",e),i.endOperation()},h=function(){s[s.state]&&s[s.state](),s.$mouseMoved=!1};if(o.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout((function(){c(e)}));var d=function(e){s.releaseMouse&&i.curOp.command.name&&i.curOp.selectionChanged&&(s[s.state+"End"]&&s[s.state+"End"](),s.state="",s.releaseMouse())};i.on("beforeEndOperation",d),i.startOperation({command:{name:"mouse"}}),s.$onCaptureMouseMove=l,s.releaseMouse=n.capture(this.editor.container,l,c);var u=setInterval(h,20)},e.prototype.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&n.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)},e.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},e}();d.prototype.releaseMouse=null,h.defineOptions(d.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:o.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=d})),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("../lib/dom"),o=function(e){e.on("click",(function(t){var i=t.getDocumentPosition(),o=e.session,r=o.getFoldAt(i.row,i.column,1);r&&(t.getAccelKey()?o.removeFold(r):o.expandFold(r),t.stop());var s=t.domEvent&&t.domEvent.target;s&&n.hasCssClass(s,"ace_inline_button")&&n.hasCssClass(s,"ace_toggle_wrap")&&(o.setOption("wrap",!o.getUseWrapMode()),e.renderer.scrollCursorIntoView())})),e.on("gutterclick",(function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var i=t.getDocumentPosition().row,n=e.session;n.foldWidgets&&n.foldWidgets[i]&&e.session.onFoldWidgetClick(i,t),e.isFocused()||e.focus(),t.stop()}})),e.on("gutterdblclick",(function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var i=t.getDocumentPosition().row,n=e.session,o=n.getParentFoldRangeData(i,!0),r=o.range||o.firstRange;if(r){i=r.start.row;var s=n.getFoldAt(i,n.getLine(i).length,1);s?n.removeFold(s):(n.addFold("...",r),e.renderer.scrollCursorIntoView({row:r.start.row,column:0}))}t.stop()}}))};t.FoldHandler=o})),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],(function(e,t,i){"use strict";var n=e("../lib/keys"),o=e("../lib/event"),r=function(){function e(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)}return e.prototype.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},e.prototype.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},e.prototype.addKeyboardHandler=function(e,t){if(e){"function"!=typeof e||e.handleKeyboard||(e.handleKeyboard=e);var i=this.$handlers.indexOf(e);-1!=i&&this.$handlers.splice(i,1),null==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==i&&e.attach&&e.attach(this.$editor)}},e.prototype.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},e.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},e.prototype.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map((function(i){return i.getStatusText&&i.getStatusText(t,e)||""})).filter(Boolean).join(" ")},e.prototype.$callKeyboardHandlers=function(e,t,i,n){for(var r,s=!1,a=this.$editor.commands,l=this.$handlers.length;l--&&!((r=this.$handlers[l].handleKeyboard(this.$data,e,t,i,n))&&r.command&&((s="null"==r.command||a.exec(r.command,this.$editor,r.args,n))&&n&&-1!=e&&1!=r.passEvent&&1!=r.command.passEvent&&o.stopEvent(n),s)););return s||-1!=e||(r={command:"insertstring"},s=a.exec("insertstring",this.$editor,t)),s&&this.$editor._signal&&this.$editor._signal("keyboardActivity",r),s},e.prototype.onCommandKey=function(e,t,i){var o=n.keyCodeToString(i);return this.$callKeyboardHandlers(t,o,i,e)},e.prototype.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)},e}();t.KeyBinding=r})),ace.define("ace/lib/bidiutil",["require","exports","module"],(function(e,t,i){"use strict";var n=0,o=0,r=!1,s=!1,a=!1,l=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],c=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],h=0,d=1,u=2,g=3,p=4,m=5,f=6,v=7,C=8,y=9,I=10,b=11,A=12,w=13,S=14,x=15,k=16,T=17,E=18,R=[E,E,E,E,E,E,E,E,E,f,m,f,C,m,E,E,E,E,E,E,E,E,E,E,E,E,E,E,m,m,m,f,C,p,p,b,b,b,p,p,p,p,p,I,y,I,y,y,u,u,u,u,u,u,u,u,u,u,y,p,p,p,p,p,p,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,p,p,p,p,p,p,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,h,p,p,p,p,E,E,E,E,E,E,m,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,E,y,p,b,b,b,b,p,p,p,p,h,p,p,E,p,p,b,b,u,u,p,h,p,p,p,u,h,p,p,p,p,p],_=[C,C,C,C,C,C,C,C,C,C,C,E,E,E,h,d,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,C,m,w,S,x,k,T,y,b,b,b,b,b,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,y,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,C];function $(e,t,i){if(!(o<e))if(1!=e||1!=n||s)for(var r,a,l,c,h=i.length,d=0;d<h;){if(t[d]>=e){for(r=d+1;r<h&&t[r]>=e;)r++;for(a=d,l=r-1;a<l;a++,l--)c=i[a],i[a]=i[l],i[l]=c;d=r}d++}else i.reverse()}function L(e,t,i,o){var l,c,R,_,$=t[o];switch($){case h:case d:r=!1;case p:case g:return $;case u:return r?g:u;case v:return r=!0,d;case C:return p;case y:return o<1||o+1>=t.length||(l=i[o-1])!=u&&l!=g||(c=t[o+1])!=u&&c!=g?p:(r&&(c=g),c==l?c:p);case I:return(l=o>0?i[o-1]:m)==u&&o+1<t.length&&t[o+1]==u?u:p;case b:if(o>0&&i[o-1]==u)return u;if(r)return p;for(_=o+1,R=t.length;_<R&&t[_]==b;)_++;return _<R&&t[_]==u?u:p;case A:for(R=t.length,_=o+1;_<R&&t[_]==A;)_++;if(_<R){var L=e[o],N=L>=1425&&L<=2303||64286==L;if(l=t[_],N&&(l==d||l==v))return d}return o<1||(l=t[o-1])==m?p:i[o-1];case m:return r=!1,s=!0,n;case f:return a=!0,p;case w:case S:case k:case T:case x:r=!1;case E:return p}}function N(e){var t=e.charCodeAt(0),i=t>>8;return 0==i?t>191?h:R[t]:5==i?/[\u0591-\u05f4]/.test(e)?d:h:6==i?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?A:/[\u0660-\u0669\u066b-\u066c]/.test(e)?g:1642==t?b:/[\u06f0-\u06f9]/.test(e)?u:v:32==i&&t<=8287?_[255&t]:254==i&&t>=65136?v:p}t.L=h,t.R=d,t.EN=u,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,i,h){if(e.length<2)return{};var u=e.split(""),y=new Array(u.length),I=new Array(u.length),b=[];n=h?1:0,function(e,t,i,h){var d=n?c:l,u=null,g=null,p=null,v=0,y=null,I=-1,b=null,A=null,w=[];if(!h)for(b=0,h=[];b<i;b++)h[b]=N(e[b]);for(o=n,r=!1,s=!1,a=!1,A=0;A<i;A++){if(u=v,w[A]=g=L(e,h,w,A),y=240&(v=d[u][g]),v&=15,t[A]=p=d[v][5],y>0)if(16==y){for(b=I;b<A;b++)t[b]=1;I=-1}else I=-1;if(d[v][6])-1==I&&(I=A);else if(I>-1){for(b=I;b<A;b++)t[b]=p;I=-1}h[A]==m&&(t[A]=0),o|=p}if(a)for(b=0;b<i;b++)if(h[b]==f){t[b]=n;for(var S=b-1;S>=0&&h[S]==C;S--)t[S]=n}}(u,b,u.length,i);for(var A=0;A<y.length;y[A]=A,A++);for($(2,b,y),$(1,b,y),A=0;A<y.length-1;A++)i[A]===g?b[A]=t.AN:b[A]===d&&(i[A]>v&&i[A]<w||i[A]===p||i[A]===E)?b[A]=t.ON_R:A>0&&"ل"===u[A-1]&&/\u0622|\u0623|\u0625|\u0627/.test(u[A])&&(b[A-1]=b[A]=t.R_H,A++);for(u[u.length-1]===t.DOT&&(b[u.length-1]=t.B),""===u[0]&&(b[0]=t.RLE),A=0;A<y.length;A++)I[A]=b[y[A]];return{logicalFromVisual:y,bidiLevels:I}},t.hasBidiCharacters=function(e,t){for(var i=!1,n=0;n<e.length;n++)t[n]=N(e.charAt(n)),i||t[n]!=d&&t[n]!=v&&t[n]!=g||(i=!0);return i},t.getVisualFromLogicalIdx=function(e,t){for(var i=0;i<t.logicalFromVisual.length;i++)if(t.logicalFromVisual[i]==e)return i;return 0}})),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],(function(e,t,i){"use strict";var n=e("./lib/bidiutil"),o=e("./lib/lang"),r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,s=function(){function e(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=n,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=r.test(e.getValue())}return e.prototype.isBidiRow=function(e,t,i){return!!this.seenBidi&&(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,i),this.updateBidiMap()),this.bidiMap.bidiLevels)},e.prototype.onChange=function(e){this.seenBidi?this.currentRow=null:"insert"==e.action&&r.test(e.lines.join("\n"))&&(this.seenBidi=!0,this.currentRow=null)},e.prototype.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var i=this.session.$getRowCacheIndex(t,this.currentRow);i>=0&&(e=this.session.$docRowCache[i])}return e},e.prototype.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var i,n=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(i=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===n;)n=i,e++;else e=this.currentRow;return e},e.prototype.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var i=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var r=this.session.$wrapData[e];r&&(void 0===t&&(t=this.getSplitIndex()),t>0&&r.length?(this.wrapIndent=r.indent,this.wrapOffset=this.wrapIndent*this.charWidths[n.L],this.line=t<r.length?this.line.substring(r[t-1],r[t]):this.line.substring(r[r.length-1])):this.line=this.line.substring(0,r[t]),t==r.length&&(this.line+=this.showInvisibles?i:n.DOT))}else this.line+=this.showInvisibles?i:n.DOT;var s,a=this.session,l=0;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,(function(e,t){return"\t"===e||a.isFullWidth(e.charCodeAt(0))?(s="\t"===e?a.getScreenTabSize(t+l):2,l+=s-1,o.stringRepeat(n.DOT,s)):e})),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==n.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},e.prototype.updateBidiMap=function(){var e=[];n.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=n.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},e.prototype.markAsDirty=function(){this.currentRow=null},e.prototype.updateCharacterWidths=function(e){if(this.characterWidth!==e.$characterSize.width){this.fontMetrics=e;var t=this.characterWidth=e.$characterSize.width,i=e.$measureCharWidth("ה");this.charWidths[n.L]=this.charWidths[n.EN]=this.charWidths[n.ON_R]=t,this.charWidths[n.R]=this.charWidths[n.AN]=i,this.charWidths[n.R_H]=.45*i,this.charWidths[n.B]=this.charWidths[n.RLE]=0,this.currentRow=null}},e.prototype.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},e.prototype.setEolChar=function(e){this.EOL=e},e.prototype.setContentWidth=function(e){this.contentWidth=e},e.prototype.isRtlLine=function(e){return!!this.$isRtl||(null!=e?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir)},e.prototype.setRtlDirection=function(e,t){for(var i=e.getCursorPosition(),n=e.selection.getSelectionAnchor().row;n<=i.row;n++)t||e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE?t&&e.session.getLine(n).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:n},e.session.$bidiHandler.RLE):e.session.doc.removeInLine(n,0,1)},e.prototype.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,i=e>t?this.session.getOverwrite()?e:e-1:t,o=n.getVisualFromLogicalIdx(i,this.bidiMap),r=this.bidiMap.bidiLevels,s=0;!this.session.getOverwrite()&&e<=t&&r[o]%2!=0&&o++;for(var a=0;a<o;a++)s+=this.charWidths[r[a]];return!this.session.getOverwrite()&&e>t&&r[o]%2==0&&(s+=this.charWidths[r[o]]),this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(s+=this.rtlLineOffset),s},e.prototype.getSelections=function(e,t){var i,n=this.bidiMap,o=n.bidiLevels,r=[],s=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,c=!1,h=!1,d=0;this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var u,g=0;g<o.length;g++)u=n.logicalFromVisual[g],i=o[g],(c=u>=a&&u<l)&&!h?d=s:!c&&h&&r.push({left:d,width:s-d}),s+=this.charWidths[i],h=c;if(c&&g===o.length&&r.push({left:d,width:s-d}),this.isRtlDir)for(var p=0;p<r.length;p++)r[p].left+=this.rtlLineOffset;return r},e.prototype.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,i=(e=Math.max(e,0),0),n=0,o=this.bidiMap.bidiLevels,r=this.charWidths[o[n]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);e>i+r/2;){if(i+=r,n===o.length-1){r=0;break}r=this.charWidths[o[++n]]}return n>0&&o[n-1]%2!=0&&o[n]%2==0?(e<i&&n--,t=this.bidiMap.logicalFromVisual[n]):n>0&&o[n-1]%2==0&&o[n]%2!=0?t=1+(e>i?this.bidiMap.logicalFromVisual[n]:this.bidiMap.logicalFromVisual[n-1]):this.isRtlDir&&n===o.length-1&&0===r&&o[n-1]%2==0||!this.isRtlDir&&0===n&&o[n]%2!=0?t=1+this.bidiMap.logicalFromVisual[n]:(n>0&&o[n-1]%2!=0&&0!==r&&n--,t=this.bidiMap.logicalFromVisual[n]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent},e}();t.BidiHandler=s})),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],(function(e,t,i){"use strict";var n=e("./lib/oop"),o=e("./lib/lang"),r=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,a=function(){function e(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",(function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)})),this.anchor.on("change",(function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")}))}return e.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},e.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},e.prototype.getCursor=function(){return this.lead.getPosition()},e.prototype.setAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},e.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},e.prototype.getSelectionLead=function(){return this.lead.getPosition()},e.prototype.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},e.prototype.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?s.fromPoints(t,t):this.isBackwards()?s.fromPoints(t,e):s.fromPoints(e,t)},e.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},e.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},e.prototype.setRange=function(e,t){var i=t?e.end:e.start,n=t?e.start:e.end;this.$setSelection(i.row,i.column,n.row,n.column)},e.prototype.$setSelection=function(e,t,i,n){if(!this.$silent){var o=this.$isEmpty,r=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(i,n),this.$isEmpty=!s.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||o!=this.$isEmpty||r)&&this._emit("changeSelection")}},e.prototype.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},e.prototype.selectTo=function(e,t){this.$moveSelection((function(){this.moveCursorTo(e,t)}))},e.prototype.selectToPosition=function(e){this.$moveSelection((function(){this.moveCursorToPosition(e)}))},e.prototype.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},e.prototype.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},e.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},e.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},e.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},e.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},e.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},e.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},e.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},e.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},e.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},e.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},e.prototype.getWordRange=function(e,t){if(void 0===t){var i=e||this.lead;e=i.row,t=i.column}return this.session.getWordRange(e,t)},e.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},e.prototype.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},e.prototype.getLineRange=function(e,t){var i,n="number"==typeof e?e:this.lead.row,o=this.session.getFoldLine(n);return o?(n=o.start.row,i=o.end.row):i=n,!0===t?new s(n,0,i,this.session.getLine(i).length):new s(n,0,i+1,0)},e.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},e.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},e.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},e.prototype.wouldMoveIntoSoftTab=function(e,t,i){var n=e.column,o=e.column+t;return i<0&&(n=e.column-t,o=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(n,o).split(" ").length-1==t},e.prototype.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var i=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,i,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-i):this.moveCursorBy(0,-1)}},e.prototype.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var i=this.session.getTabSize();t=this.lead,this.wouldMoveIntoSoftTab(t,i,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,i):this.moveCursorBy(0,1)}},e.prototype.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,i=this.session.documentToScreenRow(e,t),n=this.session.screenToDocumentPosition(i,0),o=this.session.getDisplayLine(e,null,n.row,n.column).match(/^\s*/);o[0].length==t||this.session.$useEmacsStyleLineStart||(n.column+=o[0].length),this.moveCursorToPosition(n)},e.prototype.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var i=this.session.getLine(t.row);if(t.column==i.length){var n=i.search(/\s+$/);n>0&&(t.column=n)}}this.moveCursorTo(t.row,t.column)},e.prototype.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},e.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},e.prototype.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var o=this.session.getFoldAt(e,t,1);if(o)this.moveCursorTo(o.end.row,o.end.column);else{if(this.session.nonTokenRe.exec(n)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,n=i.substring(t)),t>=i.length)return this.moveCursorTo(e,i.length),this.moveCursorRight(),void(e<this.doc.getLength()-1&&this.moveCursorWordRight());this.session.tokenRe.exec(n)&&(t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)}},e.prototype.moveCursorLongWordLeft=function(){var e,t=this.lead.row,i=this.lead.column;if(e=this.session.getFoldAt(t,i,-1))this.moveCursorTo(e.start.row,e.start.column);else{var n=this.session.getFoldStringAt(t,i,-1);null==n&&(n=this.doc.getLine(t).substring(0,i));var r=o.stringReverse(n);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(r)&&(i-=this.session.nonTokenRe.lastIndex,r=r.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),i<=0)return this.moveCursorTo(t,0),this.moveCursorLeft(),void(t>0&&this.moveCursorWordLeft());this.session.tokenRe.exec(r)&&(i-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,i)}},e.prototype.$shortWordEndIndex=function(e){var t,i=0,n=/\s/,o=this.session.tokenRe;if(o.lastIndex=0,this.session.tokenRe.exec(e))i=this.session.tokenRe.lastIndex;else{for(;(t=e[i])&&n.test(t);)i++;if(i<1)for(o.lastIndex=0;(t=e[i])&&!o.test(t);)if(o.lastIndex=0,i++,n.test(t)){if(i>2){i--;break}for(;(t=e[i])&&n.test(t);)i++;if(i>2)break}}return o.lastIndex=0,i},e.prototype.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t),o=this.session.getFoldAt(e,t,1);if(o)return this.moveCursorTo(o.end.row,o.end.column);if(t==i.length){var r=this.doc.getLength();do{e++,n=this.doc.getLine(e)}while(e<r&&/^\s*$/.test(n));/^\s+/.test(n)||(n=""),t=0}var s=this.$shortWordEndIndex(n);this.moveCursorTo(e,t+s)},e.prototype.moveCursorShortWordLeft=function(){var e,t=this.lead.row,i=this.lead.column;if(e=this.session.getFoldAt(t,i,-1))return this.moveCursorTo(e.start.row,e.start.column);var n=this.session.getLine(t).substring(0,i);if(0===i){do{t--,n=this.doc.getLine(t)}while(t>0&&/^\s*$/.test(n));i=n.length,/\s+$/.test(n)||(n="")}var r=o.stringReverse(n),s=this.$shortWordEndIndex(r);return this.moveCursorTo(t,i-s)},e.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},e.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},e.prototype.moveCursorBy=function(e,t){var i,n=this.session.documentToScreenPosition(this.lead.row,this.lead.column);if(0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(n.row,this.lead.row)?(i=this.session.$bidiHandler.getPosLeft(n.column),n.column=Math.round(i/this.session.$bidiHandler.charWidths[0])):i=n.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column),0!=e&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var o=this.session.lineWidgets[this.lead.row];e<0?e-=o.rowsAbove||0:e>0&&(e+=o.rowCount-(o.rowsAbove||0))}var r=this.session.screenToDocumentPosition(n.row+e,n.column,i);0!==e&&0===t&&r.row===this.lead.row&&(r.column,this.lead.column),this.moveCursorTo(r.row,r.column+t,0===t)},e.prototype.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},e.prototype.moveCursorTo=function(e,t,i){var n=this.session.getFoldAt(e,t,1);n&&(e=n.start.row,t=n.start.column),this.$keepDesiredColumnOnChange=!0;var o=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(o.charAt(t))&&o.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,i||(this.$desiredColumn=null)},e.prototype.moveCursorToScreen=function(e,t,i){var n=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(n.row,n.column,i)},e.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},e.prototype.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},e.prototype.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},e.prototype.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var i=this.getCursor();return s.fromPoints(t,i)}catch(e){return s.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},e.prototype.toJSON=function(){if(this.rangeCount)var e=this.ranges.map((function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t}));else(e=this.getRange()).isBackwards=this.isBackwards();return e},e.prototype.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var i=s.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(i.cursor=i.start),this.addRange(i,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},e.prototype.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0},e}();a.prototype.setSelectionAnchor=a.prototype.setAnchor,a.prototype.getSelectionAnchor=a.prototype.getAnchor,a.prototype.setSelectionRange=a.prototype.setRange,n.implement(a.prototype,r),t.Selection=a})),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],(function(e,t,i){"use strict";var n=e("./lib/report_error").reportError,o=2e3,r=function(){function e(e){for(var t in this.splitRegex,this.states=e,this.regExps={},this.matchMappings={},this.states){for(var i=this.states[t],n=[],o=0,r=this.matchMappings[t]={defaultToken:"text"},s="g",a=[],l=0;l<i.length;l++){var c=i[l];if(c.defaultToken&&(r.defaultToken=c.defaultToken),c.caseInsensitive&&-1===s.indexOf("i")&&(s+="i"),c.unicode&&-1===s.indexOf("u")&&(s+="u"),null!=c.regex){c.regex instanceof RegExp&&(c.regex=c.regex.toString().slice(1,-1));var h=c.regex,d=new RegExp("(?:("+h+")|(.))").exec("a").length-2;Array.isArray(c.token)?1==c.token.length||1==d?c.token=c.token[0]:d-1!=c.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:c,groupCount:d-1}),c.token=c.token[0]):(c.tokenArray=c.token,c.token=null,c.onMatch=this.$arrayTokens):"function"!=typeof c.token||c.onMatch||(c.onMatch=d>1?this.$applyToken:c.token),d>1&&(/\\\d/.test(c.regex)?h=c.regex.replace(/\\([0-9]+)/g,(function(e,t){return"\\"+(parseInt(t,10)+o+1)})):(d=1,h=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||a.push(c)),r[o]=l,o+=d,n.push(h),c.onMatch||(c.onMatch=null)}}n.length||(r[0]=0,n.push("$")),a.forEach((function(e){e.splitRegex=this.createSplitterRegexp(e.regex,s)}),this),this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",s)}}return e.prototype.$setMaxTokenCount=function(e){o=0|e},e.prototype.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),i=this.token.apply(this,t);if("string"==typeof i)return[{type:i,value:e}];for(var n=[],o=0,r=i.length;o<r;o++)t[o]&&(n[n.length]={type:i[o],value:t[o]});return n},e.prototype.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";for(var i=[],n=this.tokenArray,o=0,r=n.length;o<r;o++)t[o+1]&&(i[i.length]={type:n[o],value:t[o+1]});return i},e.prototype.removeCapturingGroups=function(e){return e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,(function(e,t){return t?"(?:":e}))},e.prototype.createSplitterRegexp=function(e,t){if(-1!=e.indexOf("(?=")){var i=0,n=!1,o={};e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,(function(e,t,r,s,a,l){return n?n="]"!=a:a?n=!0:s?(i==o.stack&&(o.end=l+1,o.stack=-1),i--):r&&(i++,1!=r.length&&(o.stack=i,o.start=l)),e})),null!=o.end&&/^\)*$/.test(e.substr(o.end))&&(e=e.substring(0,o.start)+e.substr(o.end))}return"^"!=e.charAt(0)&&(e="^"+e),"$"!=e.charAt(e.length-1)&&(e+="$"),new RegExp(e,(t||"").replace("g",""))},e.prototype.getLineTokens=function(e,t){if(t&&"string"!=typeof t){var i=t.slice(0);"#tmp"===(t=i[0])&&(i.shift(),t=i.shift())}else i=[];var n=t||"start",r=this.states[n];r||(n="start",r=this.states[n]);var s=this.matchMappings[n],a=this.regExps[n];a.lastIndex=0;for(var l,c=[],h=0,d=0,u={type:null,value:""};l=a.exec(e);){var g=s.defaultToken,p=null,m=l[0],f=a.lastIndex;if(f-m.length>h){var v=e.substring(h,f-m.length);u.type==g?u.value+=v:(u.type&&c.push(u),u={type:g,value:v})}for(var C=0;C<l.length-2;C++)if(void 0!==l[C+1]){g=(p=r[s[C]]).onMatch?p.onMatch(m,n,i,e):p.token,p.next&&(n="string"==typeof p.next?p.next:p.next(n,i),(r=this.states[n])||(this.reportError("state doesn't exist",n),n="start",r=this.states[n]),s=this.matchMappings[n],h=f,(a=this.regExps[n]).lastIndex=f),p.consumeLineEnd&&(h=f);break}if(m)if("string"==typeof g)p&&!1===p.merge||u.type!==g?(u.type&&c.push(u),u={type:g,value:m}):u.value+=m;else if(g)for(u.type&&c.push(u),u={type:null,value:""},C=0;C<g.length;C++)c.push(g[C]);if(h==e.length)break;if(h=f,d++>o){for(d>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});h<e.length;)u.type&&c.push(u),u={value:e.substring(h,h+=500),type:"overflow"};n="start",i=[];break}}return u.type&&c.push(u),i.length>1&&i[0]!==n&&i.unshift("#tmp",n),{tokens:c,state:i.length?i:n}},e}();r.prototype.reportError=n,t.Tokenizer=r})),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],(function(e,t,i){"use strict";var n,o=e("../lib/deep_copy").deepCopy;(function(){this.addRules=function(e,t){if(t)for(var i in e){for(var n=e[i],o=0;o<n.length;o++){var r=n[o];(r.next||r.onMatch)&&("string"==typeof r.next&&0!==r.next.indexOf(t)&&(r.next=t+r.next),r.nextState&&0!==r.nextState.indexOf(t)&&(r.nextState=t+r.nextState))}this.$rules[t+i]=n}else for(var i in e)this.$rules[i]=e[i]},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,i,n,r){var s="function"==typeof e?(new e).getRules():e;if(n)for(var a=0;a<n.length;a++)n[a]=t+n[a];else for(var l in n=[],s)n.push(t+l);if(this.addRules(s,t),i){var c=Array.prototype[r?"push":"unshift"];for(a=0;a<n.length;a++)c.apply(this.$rules[n[a]],o(i))}this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};var e=function(e,t){return("start"!=e||t.length)&&t.unshift(this.nextState,e),this.nextState},t=function(e,t){return t.shift(),t.shift()||"start"};this.normalizeRules=function(){var i=0,n=this.$rules;Object.keys(n).forEach((function o(r){var s=n[r];s.processed=!0;for(var a=0;a<s.length;a++){var l=s[a],c=null;Array.isArray(l)&&(c=l,l={}),!l.regex&&l.start&&(l.regex=l.start,l.next||(l.next=[]),l.next.push({defaultToken:l.token},{token:l.token+".end",regex:l.end||l.start,next:"pop"}),l.token=l.token+".start",l.push=!0);var h=l.next||l.push;if(h&&Array.isArray(h)){var d=l.stateName;d||("string"!=typeof(d=l.token)&&(d=d[0]||""),n[d]&&(d+=i++)),n[d]=h,l.next=d,o(d)}else"pop"==h&&(l.next=t);if(l.push&&(l.nextState=l.next||l.push,l.next=e,delete l.push),l.rules)for(var u in l.rules)n[u]?n[u].push&&n[u].push.apply(n[u],l.rules[u]):n[u]=l.rules[u];var g="string"==typeof l?l:l.include;if(g&&("$self"===g&&(g="start"),c=Array.isArray(g)?g.map((function(e){return n[e]})):n[g]),c){var p=[a,1].concat(c);l.noEscape&&(p=p.filter((function(e){return!e.next}))),s.splice.apply(s,p),a--}l.keywordMap&&(l.token=this.createKeywordMapper(l.keywordMap,l.defaultToken||"text",l.caseInsensitive),delete l.defaultToken)}}),this)},this.createKeywordMapper=function(e,t,i,n){var o=Object.create(null);return this.$keywordList=[],Object.keys(e).forEach((function(t){for(var r=e[t].split(n||"|"),s=r.length;s--;){var a=r[s];this.$keywordList.push(a),i&&(a=a.toLowerCase()),o[a]=t}}),this),e=null,i?function(e){return o[e.toLowerCase()]||t}:function(e){return o[e]||t}},this.getKeywords=function(){return this.$keywords}}).call((n=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}}).prototype),t.TextHighlightRules=n})),ace.define("ace/mode/behaviour",["require","exports","module"],(function(e,t,i){"use strict";var n;(function(){this.add=function(e,t,i){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=i},this.addBehaviours=function(e){for(var t in e)for(var i in e[t])this.add(t,i,e[t][i])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if("function"==typeof e)var i=(new e).getBehaviours(t);else i=e.getBehaviours(t);this.addBehaviours(i)},this.getBehaviours=function(e){if(e){for(var t={},i=0;i<e.length;i++)this.$behaviours[e[i]]&&(t[e[i]]=this.$behaviours[e[i]]);return t}return this.$behaviours}}).call((n=function(){this.$behaviours={}}).prototype),t.Behaviour=n})),ace.define("ace/token_iterator",["require","exports","module","ace/range"],(function(e,t,i){"use strict";var n=e("./range").Range,o=function(){function e(e,t,i){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var n=e.getTokenAt(t,i);this.$tokenIndex=n?n.index:-1}return e.prototype.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},e.prototype.stepForward=function(){var e;for(this.$tokenIndex+=1;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentTokenRow=function(){return this.$row},e.prototype.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,i=e[t].start;if(void 0!==i)return i;for(i=0;t>0;)i+=e[t-=1].value.length;return i},e.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},e.prototype.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new n(this.$row,t,this.$row,t+e.value.length)},e}();t.TokenIterator=o})),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],(function(e,t,i){"use strict";var n,o,r=e("../../lib/oop"),s=e("../behaviour").Behaviour,a=e("../../token_iterator").TokenIterator,l=e("../../lib/lang"),c=["text","paren.rparen","rparen","paren","punctuation.operator"],h=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],d={},u={'"':'"',"'":"'"},g=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,d.rangeCount!=e.multiSelect.rangeCount&&(d={rangeCount:e.multiSelect.rangeCount})),d[t])return n=d[t];n=d[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},p=function(e,t,i,n){var o=e.end.row-e.start.row;return{text:i+t+n,selection:[0,e.start.column+1,o,e.end.column+(o?0:1)]}};(o=function(e){e=e||{},this.add("braces","insertion",(function(t,i,r,s,a){var c=r.getCursorPosition(),h=s.doc.getLine(c.row);if("{"==a){g(r);var d=r.getSelectionRange(),u=s.doc.getTextRange(d);if(""!==u&&"{"!==u&&r.getWrapBehavioursEnabled())return p(d,u,"{","}");if(o.isSaneInsertion(r,s))return/[\]\}\)]/.test(h[c.column])||r.inMultiSelectMode||e.braces?(o.recordAutoInsert(r,s,"}"),{text:"{}",selection:[1,1]}):(o.recordMaybeInsert(r,s,"{"),{text:"{",selection:[1,1]})}else if("}"==a){if(g(r),"}"==h.substring(c.column,c.column+1)&&null!==s.$findOpeningBracket("}",{column:c.column+1,row:c.row})&&o.isAutoInsertedClosing(c,h,a))return o.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==a||"\r\n"==a){g(r);var m="";if(o.isMaybeInsertedClosing(c,h)&&(m=l.stringRepeat("}",n.maybeInsertedBrackets),o.clearMaybeInsertedClosing()),"}"===h.substring(c.column,c.column+1)){var f=s.findMatchingBracket({row:c.row,column:c.column+1},"}");if(!f)return null;var v=this.$getIndent(s.getLine(f.row))}else{if(!m)return void o.clearMaybeInsertedClosing();v=this.$getIndent(h)}var C=v+s.getTabString();return{text:"\n"+C+"\n"+v+m,selection:[1,C.length,1,C.length]}}o.clearMaybeInsertedClosing()}})),this.add("braces","deletion",(function(e,t,i,o,r){var s=o.doc.getTextRange(r);if(!r.isMultiLine()&&"{"==s){if(g(i),"}"==o.doc.getLine(r.start.row).substring(r.end.column,r.end.column+1))return r.end.column++,r;n.maybeInsertedBrackets--}})),this.add("parens","insertion",(function(e,t,i,n,r){if("("==r){g(i);var s=i.getSelectionRange(),a=n.doc.getTextRange(s);if(""!==a&&i.getWrapBehavioursEnabled())return p(s,a,"(",")");if(o.isSaneInsertion(i,n))return o.recordAutoInsert(i,n,")"),{text:"()",selection:[1,1]}}else if(")"==r){g(i);var l=i.getCursorPosition(),c=n.doc.getLine(l.row);if(")"==c.substring(l.column,l.column+1)&&null!==n.$findOpeningBracket(")",{column:l.column+1,row:l.row})&&o.isAutoInsertedClosing(l,c,r))return o.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("parens","deletion",(function(e,t,i,n,o){var r=n.doc.getTextRange(o);if(!o.isMultiLine()&&"("==r&&(g(i),")"==n.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)))return o.end.column++,o})),this.add("brackets","insertion",(function(e,t,i,n,r){if("["==r){g(i);var s=i.getSelectionRange(),a=n.doc.getTextRange(s);if(""!==a&&i.getWrapBehavioursEnabled())return p(s,a,"[","]");if(o.isSaneInsertion(i,n))return o.recordAutoInsert(i,n,"]"),{text:"[]",selection:[1,1]}}else if("]"==r){g(i);var l=i.getCursorPosition(),c=n.doc.getLine(l.row);if("]"==c.substring(l.column,l.column+1)&&null!==n.$findOpeningBracket("]",{column:l.column+1,row:l.row})&&o.isAutoInsertedClosing(l,c,r))return o.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("brackets","deletion",(function(e,t,i,n,o){var r=n.doc.getTextRange(o);if(!o.isMultiLine()&&"["==r&&(g(i),"]"==n.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)))return o.end.column++,o})),this.add("string_dquotes","insertion",(function(e,t,i,n,o){var r=n.$mode.$quotes||u;if(1==o.length&&r[o]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(o))return;g(i);var s=o,a=i.getSelectionRange(),l=n.doc.getTextRange(a);if(!(""===l||1==l.length&&r[l])&&i.getWrapBehavioursEnabled())return p(a,l,s,s);if(!l){var c=i.getCursorPosition(),h=n.doc.getLine(c.row),d=h.substring(c.column-1,c.column),m=h.substring(c.column,c.column+1),f=n.getTokenAt(c.row,c.column),v=n.getTokenAt(c.row,c.column+1);if("\\"==d&&f&&/escape/.test(f.type))return null;var C,y=f&&/string|escape/.test(f.type),I=!v||/string|escape/.test(v.type);if(m==s)(C=y!==I)&&/string\.end/.test(v.type)&&(C=!1);else{if(y&&!I)return null;if(y&&I)return null;var b=n.$mode.tokenRe;b.lastIndex=0;var A=b.test(d);b.lastIndex=0;var w=b.test(m),S=n.$mode.$pairQuotesAfter;if(!(S&&S[s]&&S[s].test(d))&&A||w)return null;if(m&&!/[\s;,.})\]\\]/.test(m))return null;var x=h[c.column-2];if(d==s&&(x==s||b.test(x)))return null;C=!0}return{text:C?s+s:"",selection:[1,1]}}}})),this.add("string_dquotes","deletion",(function(e,t,i,n,o){var r=n.$mode.$quotes||u,s=n.doc.getTextRange(o);if(!o.isMultiLine()&&r.hasOwnProperty(s)&&(g(i),n.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)==s))return o.end.column++,o})),!1!==e.closeDocComment&&this.add("doc comment end","insertion",(function(e,t,i,n,o){if("doc-start"===e&&("\n"===o||"\r\n"===o)&&i.selection.isEmpty()){var r=i.getCursorPosition(),s=n.doc.getLine(r.row),a=n.doc.getLine(r.row+1),l=this.$getIndent(s);if(/\s*\*/.test(a))return/^\s*\*/.test(s)?{text:o+l+"* ",selection:[1,3+l.length,1,3+l.length]}:{text:o+l+" * ",selection:[1,3+l.length,1,3+l.length]};if(/\/\*\*/.test(s.substring(0,r.column)))return{text:o+l+" * "+o+" "+l+"*/",selection:[1,4+l.length,1,4+l.length]}}}))}).isSaneInsertion=function(e,t){var i=e.getCursorPosition(),n=new a(t,i.row,i.column);if(!this.$matchTokenType(n.getCurrentToken()||"text",c)){if(/[)}\]]/.test(e.session.getLine(i.row)[i.column]))return!0;var o=new a(t,i.row,i.column+1);if(!this.$matchTokenType(o.getCurrentToken()||"text",c))return!1}return n.stepForward(),n.getCurrentTokenRow()!==i.row||this.$matchTokenType(n.getCurrentToken()||"text",h)},o.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},o.recordAutoInsert=function(e,t,i){var o=e.getCursorPosition(),r=t.doc.getLine(o.row);this.isAutoInsertedClosing(o,r,n.autoInsertedLineEnd[0])||(n.autoInsertedBrackets=0),n.autoInsertedRow=o.row,n.autoInsertedLineEnd=i+r.substr(o.column),n.autoInsertedBrackets++},o.recordMaybeInsert=function(e,t,i){var o=e.getCursorPosition(),r=t.doc.getLine(o.row);this.isMaybeInsertedClosing(o,r)||(n.maybeInsertedBrackets=0),n.maybeInsertedRow=o.row,n.maybeInsertedLineStart=r.substr(0,o.column)+i,n.maybeInsertedLineEnd=r.substr(o.column),n.maybeInsertedBrackets++},o.isAutoInsertedClosing=function(e,t,i){return n.autoInsertedBrackets>0&&e.row===n.autoInsertedRow&&i===n.autoInsertedLineEnd[0]&&t.substr(e.column)===n.autoInsertedLineEnd},o.isMaybeInsertedClosing=function(e,t){return n.maybeInsertedBrackets>0&&e.row===n.maybeInsertedRow&&t.substr(e.column)===n.maybeInsertedLineEnd&&t.substr(0,e.column)==n.maybeInsertedLineStart},o.popAutoInsertedClosing=function(){n.autoInsertedLineEnd=n.autoInsertedLineEnd.substr(1),n.autoInsertedBrackets--},o.clearMaybeInsertedClosing=function(){n&&(n.maybeInsertedBrackets=0,n.maybeInsertedRow=-1)},r.inherits(o,s),t.CstyleBehaviour=o})),ace.define("ace/unicode",["require","exports","module"],(function(e,t,i){"use strict";for(var n=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],o=0,r=[],s=0;s<n.length;s+=2)r.push(o+=n[s]),n[s+1]&&r.push(45,o+=n[s+1]);t.wordChars=String.fromCharCode.apply(null,r)})),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],(function(e,t,i){"use strict";var n,o=e("../config"),r=e("../tokenizer").Tokenizer,s=e("./text_highlight_rules").TextHighlightRules,a=e("./behaviour/cstyle").CstyleBehaviour,l=e("../unicode"),c=e("../lib/lang"),h=e("../token_iterator").TokenIterator,d=e("../range").Range;(function(){this.$defaultBehaviour=new a,this.tokenRe=new RegExp("^["+l.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+l.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new r(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,i,n){var o=t.doc,r=!0,s=!0,a=1/0,l=t.getTabSize(),h=!1;if(this.lineCommentStart){Array.isArray(this.lineCommentStart)?(m=this.lineCommentStart.map(c.escapeRegExp).join("|"),g=this.lineCommentStart[0]):(m=c.escapeRegExp(this.lineCommentStart),g=this.lineCommentStart),m=new RegExp("^(\\s*)(?:"+m+") ?"),h=t.getUseSoftTabs(),C=function(e,t){var i=e.match(m);if(i){var n=i[1].length,r=i[0].length;u(e,n,r)||" "!=i[0][r-1]||r--,o.removeInLine(t,n,r)}};var d=g+" ",u=(v=function(e,t){r&&!/\S/.test(e)||(u(e,a,a)?o.insertInLine({row:t,column:a},d):o.insertInLine({row:t,column:a},g))},y=function(e,t){return m.test(e)},function(e,t,i){for(var n=0;t--&&" "==e.charAt(t);)n++;if(n%l!=0)return!1;for(n=0;" "==e.charAt(i++);)n++;return l>2?n%l!=l-1:n%l==0})}else{if(!this.blockComment)return!1;var g=this.blockComment.start,p=this.blockComment.end,m=new RegExp("^(\\s*)(?:"+c.escapeRegExp(g)+")"),f=new RegExp("(?:"+c.escapeRegExp(p)+")\\s*$"),v=function(e,t){y(e,t)||r&&!/\S/.test(e)||(o.insertInLine({row:t,column:e.length},p),o.insertInLine({row:t,column:a},g))},C=function(e,t){var i;(i=e.match(f))&&o.removeInLine(t,e.length-i[0].length,e.length),(i=e.match(m))&&o.removeInLine(t,i[1].length,i[0].length)},y=function(e,i){if(m.test(e))return!0;for(var n=t.getTokens(i),o=0;o<n.length;o++)if("comment"===n[o].type)return!0}}function I(e){for(var t=i;t<=n;t++)e(o.getLine(t),t)}var b=1/0;I((function(e,t){var i=e.search(/\S/);-1!==i?(i<a&&(a=i),s&&!y(e,t)&&(s=!1)):b>e.length&&(b=e.length)})),a==1/0&&(a=b,r=!1,s=!1),h&&a%l!=0&&(a=Math.floor(a/l)*l),I(s?C:v)},this.toggleBlockComment=function(e,t,i,n){var o=this.blockComment;if(o){!o.start&&o[0]&&(o=o[0]);var r,s,a=(m=new h(t,n.row,n.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var c,u;a&&/comment/.test(a.type);){if(-1!=(f=a.value.indexOf(o.start))){var g=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+f;c=new d(g,p,g,p+o.start.length);break}a=m.stepBackward()}var m;for(a=(m=new h(t,n.row,n.column)).getCurrentToken();a&&/comment/.test(a.type);){var f;if(-1!=(f=a.value.indexOf(o.end))){g=m.getCurrentTokenRow(),p=m.getCurrentTokenColumn()+f,u=new d(g,p,g,p+o.end.length);break}a=m.stepForward()}u&&t.remove(u),c&&(t.remove(c),r=c.start.row,s=-o.start.length)}else s=o.start.length,r=i.start.row,t.insert(i.end,o.end),t.insert(i.start,o.start);l.start.row==r&&(l.start.column+=s),l.end.row==r&&(l.end.column+=s),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,i){return this.$getIndent(t)},this.checkOutdent=function(e,t,i){return!1},this.autoOutdent=function(e,t,i){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var i=e[t],n=i.prototype.$id,r=o.$modes[n];r||(o.$modes[n]=r=new i),o.$modes[t]||(o.$modes[t]=r),this.$embeds.push(t),this.$modes[t]=r}var s=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],a=function(e){var t,i,n;n=(t=l)[i=s[e]],t[s[e]]=function(){return this.$delegator(i,arguments,n)}},l=this;for(t=0;t<s.length;t++)a(t)},this.$delegator=function(e,t,i){var n=t[0]||"start";if("string"!=typeof n){if(Array.isArray(n[2])){var o=n[2][n[2].length-1];if(s=this.$modes[o])return s[e].apply(s,[n[1]].concat([].slice.call(t,1)))}n=n[0]||"start"}for(var r=0;r<this.$embeds.length;r++)if(this.$modes[this.$embeds[r]]){var s,a=n.split(this.$embeds[r]);if(!a[0]&&a[1])return t[0]=a[1],(s=this.$modes[this.$embeds[r]])[e].apply(s,t)}var l=i.apply(this,t);return i?l:void 0},this.transformAction=function(e,t,i,n,o){if(this.$behaviour){var r=this.$behaviour.getBehaviours();for(var s in r)if(r[s][t]){var a=r[s][t].apply(this,arguments);if(a)return a}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,i=[];for(var n in t)for(var o=t[n],r=0,s=o.length;r<s;r++)if("string"==typeof o[r].token)/keyword|support|storage/.test(o[r].token)&&i.push(o[r].regex);else if("object"==typeof o[r].token)for(var a=0,l=o[r].token.length;a<l;a++)/keyword|support|storage/.test(o[r].token[a])&&(n=o[r].regex.match(/\(.+?\)/g)[a],i.push(n.substr(1,n.length-2)));this.completionKeywords=i}return e?i.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,t,i,n){return(this.$keywordList||this.$createKeywordList()).map((function(e){return{name:e,value:e,score:0,meta:"keyword"}}))},this.$id="ace/mode/text"}).call((n=function(){this.HighlightRules=s}).prototype),t.Mode=n})),ace.define("ace/apply_delta",["require","exports","module"],(function(e,t,i){"use strict";t.applyDelta=function(e,t,i){var n=t.start.row,o=t.start.column,r=e[n]||"";switch(t.action){case"insert":if(1===t.lines.length)e[n]=r.substring(0,o)+t.lines[0]+r.substring(o);else{var s=[n,1].concat(t.lines);e.splice.apply(e,s),e[n]=r.substring(0,o)+e[n],e[n+t.lines.length-1]+=r.substring(o)}break;case"remove":var a=t.end.column,l=t.end.row;n===l?e[n]=r.substring(0,o)+r.substring(a):e.splice(n,l-n+1,r.substring(0,o)+e[l].substring(a))}}})),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,i){"use strict";var n=e("./lib/oop"),o=e("./lib/event_emitter").EventEmitter,r=function(){function e(e,t,i){this.$onChange=this.onChange.bind(this),this.attach(e),"number"!=typeof t?this.setPosition(t.row,t.column):this.setPosition(t,i)}return e.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},e.prototype.getDocument=function(){return this.document},e.prototype.onChange=function(e){if(!(e.start.row==e.end.row&&e.start.row!=this.row||e.start.row>this.row)){var t=function(e,t,i){var n="insert"==e.action,o=(n?1:-1)*(e.end.row-e.start.row),r=(n?1:-1)*(e.end.column-e.start.column),a=e.start,l=n?a:e.end;return s(t,a,i)?{row:t.row,column:t.column}:s(l,t,!i)?{row:t.row+o,column:t.column+(t.row==l.row?r:0)}:{row:a.row,column:a.column}}(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(t.row,t.column,!0)}},e.prototype.setPosition=function(e,t,i){var n;if(n=i?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=n.row||this.column!=n.column){var o={row:this.row,column:this.column};this.row=n.row,this.column=n.column,this._signal("change",{old:o,value:n})}},e.prototype.detach=function(){this.document.off("change",this.$onChange)},e.prototype.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},e.prototype.$clipPositionToDocument=function(e,t){var i={};return e>=this.document.getLength()?(i.row=Math.max(0,this.document.getLength()-1),i.column=this.document.getLine(i.row).length):e<0?(i.row=0,i.column=0):(i.row=e,i.column=Math.min(this.document.getLine(i.row).length,Math.max(0,t))),t<0&&(i.column=0),i},e}();function s(e,t,i){var n=i?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&n}r.prototype.$insertRight=!1,n.implement(r.prototype,o),t.Anchor=r})),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],(function(e,t,i){"use strict";var n=e("./lib/oop"),o=e("./apply_delta").applyDelta,r=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,a=e("./anchor").Anchor,l=function(){function e(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)}return e.prototype.setValue=function(e){var t=this.getLength()-1;this.remove(new s(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e||"")},e.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},e.prototype.createAnchor=function(e,t){return new a(this,e,t)},e.prototype.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},e.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},e.prototype.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},e.prototype.getNewLineMode=function(){return this.$newLineMode},e.prototype.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},e.prototype.getLine=function(e){return this.$lines[e]||""},e.prototype.getLines=function(e,t){return this.$lines.slice(e,t+1)},e.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},e.prototype.getLength=function(){return this.$lines.length},e.prototype.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},e.prototype.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var i=t.length-1;e.end.row-e.start.row==i&&(t[i]=t[i].substring(0,e.end.column))}return t},e.prototype.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},e.prototype.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},e.prototype.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},e.prototype.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},e.prototype.insertInLine=function(e,t){var i=this.clippedPos(e.row,e.column),n=this.pos(e.row,e.column+t.length);return this.applyDelta({start:i,end:n,action:"insert",lines:[t]},!0),this.clonePos(n)},e.prototype.clippedPos=function(e,t){var i=this.getLength();void 0===e?e=i:e<0?e=0:e>=i&&(e=i-1,t=void 0);var n=this.getLine(e);return null==t&&(t=n.length),{row:e,column:t=Math.min(Math.max(t,0),n.length)}},e.prototype.clonePos=function(e){return{row:e.row,column:e.column}},e.prototype.pos=function(e,t){return{row:e,column:t}},e.prototype.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},e.prototype.insertFullLines=function(e,t){var i=0;(e=Math.min(Math.max(e,0),this.getLength()))<this.getLength()?(t=t.concat([""]),i=0):(t=[""].concat(t),e--,i=this.$lines[e].length),this.insertMergedLines({row:e,column:i},t)},e.prototype.insertMergedLines=function(e,t){var i=this.clippedPos(e.row,e.column),n={row:i.row+t.length-1,column:(1==t.length?i.column:0)+t[t.length-1].length};return this.applyDelta({start:i,end:n,action:"insert",lines:t}),this.clonePos(n)},e.prototype.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),i=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:i,action:"remove",lines:this.getLinesForRange({start:t,end:i})}),this.clonePos(t)},e.prototype.removeInLine=function(e,t,i){var n=this.clippedPos(e,t),o=this.clippedPos(e,i);return this.applyDelta({start:n,end:o,action:"remove",lines:this.getLinesForRange({start:n,end:o})},!0),this.clonePos(n)},e.prototype.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);var i=(t=Math.min(Math.max(0,t),this.getLength()-1))==this.getLength()-1&&e>0,n=t<this.getLength()-1,o=i?e-1:e,r=i?this.getLine(o).length:0,a=n?t+1:t,l=n?0:this.getLine(a).length,c=new s(o,r,a,l),h=this.$lines.slice(e,t+1);return this.applyDelta({start:c.start,end:c.end,action:"remove",lines:this.getLinesForRange(c)}),h},e.prototype.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},e.prototype.replace=function(e,t){return e instanceof s||(e=s.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},e.prototype.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},e.prototype.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--)this.revertDelta(e[t])},e.prototype.applyDelta=function(e,t){var i="insert"==e.action;(i?e.lines.length<=1&&!e.lines[0]:!s.comparePoints(e.start,e.end))||(i&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(o(this.$lines,e,t),this._signal("change",e)))},e.prototype.$safeApplyDelta=function(e){var t=this.$lines.length;("remove"==e.action&&e.start.row<t&&e.end.row<t||"insert"==e.action&&e.start.row<=t)&&this.applyDelta(e)},e.prototype.$splitAndapplyLargeDelta=function(e,t){for(var i=e.lines,n=i.length-t+1,o=e.start.row,r=e.start.column,s=0,a=0;s<n;s=a){a+=t-1;var l=i.slice(s,a);l.push(""),this.applyDelta({start:this.pos(o+s,r),end:this.pos(o+a,r=0),action:e.action,lines:l},!0)}e.lines=i.slice(s),e.start.row=o+s,e.start.column=r,this.applyDelta(e,!0)},e.prototype.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},e.prototype.indexToPosition=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,o=t||0,r=i.length;o<r;o++)if((e-=i[o].length+n)<0)return{row:o,column:e+i[o].length+n};return{row:r-1,column:e+i[r-1].length+n}},e.prototype.positionToIndex=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,o=0,r=Math.min(e.row,i.length),s=t||0;s<r;++s)o+=i[s].length+n;return o+e.column},e.prototype.$split=function(e){return e.split(/\r\n|\r|\n/)},e}();l.prototype.$autoNewLine="",l.prototype.$newLineMode="auto",n.implement(l.prototype,r),t.Document=l})),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,i){"use strict";var n=e("./lib/oop"),o=e("./lib/event_emitter").EventEmitter,r=function(){function e(e,t){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var i=this;this.$worker=function(){if(i.running){for(var e=new Date,t=i.currentLine,n=-1,o=i.doc,r=t;i.lines[t];)t++;var s=o.getLength(),a=0;for(i.running=!1;t<s;){i.$tokenizeRow(t),n=t;do{t++}while(i.lines[t]);if(++a%5==0&&new Date-e>20){i.running=setTimeout(i.$worker,20);break}}i.currentLine=t,-1==n&&(n=t),r<=n&&i.fireUpdateEvent(r,n)}}}return e.prototype.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},e.prototype.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},e.prototype.fireUpdateEvent=function(e,t){var i={first:e,last:t};this._signal("update",{data:i})},e.prototype.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},e.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},e.prototype.$updateOnChange=function(e){var t=e.start.row,i=e.end.row-t;if(0===i)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,i+1,null),this.states.splice(t,i+1,null);else{var n=Array(i+1);n.unshift(t,1),this.lines.splice.apply(this.lines,n),this.states.splice.apply(this.states,n)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},e.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},e.prototype.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},e.prototype.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},e.prototype.$tokenizeRow=function(e){var t=this.doc.getLine(e),i=this.states[e-1],n=this.tokenizer.getLineTokens(t,i,e);return this.states[e]+""!=n.state+""?(this.states[e]=n.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=n.tokens},e.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},e}();n.implement(r.prototype,o),t.BackgroundTokenizer=r})),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],(function(e,t,i){"use strict";var n=e("./lib/lang"),o=e("./range").Range,r=function(){function e(e,t,i){void 0===i&&(i="text"),this.setRegexp(e),this.clazz=t,this.type=i}return e.prototype.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},e.prototype.update=function(e,t,i,r){if(this.regExp)for(var s=r.firstRow,a=r.lastRow,l={},c=s;c<=a;c++){var h=this.cache[c];null==h&&((h=n.getMatchOffsets(i.getLine(c),this.regExp)).length>this.MAX_RANGES&&(h=h.slice(0,this.MAX_RANGES)),h=h.map((function(e){return new o(c,e.offset,c,e.offset+e.length)})),this.cache[c]=h.length?h:"");for(var d=h.length;d--;){var u=h[d].toScreenRange(i),g=u.toString();l[g]||(l[g]=!0,t.drawSingleLineMarker(e,u,this.clazz,r))}}},e}();r.prototype.MAX_RANGES=500,t.SearchHighlight=r})),ace.define("ace/undomanager",["require","exports","module","ace/range"],(function(e,t,i){"use strict";var n=function(){function e(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return e.prototype.addSession=function(e){this.$session=e},e.prototype.add=function(e,t,i){if(!this.$fromUndo&&e!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),!1===t||!this.lastDeltas){this.lastDeltas=[];var n=this.$undoStack.length;n>this.$undoDepth-1&&this.$undoStack.splice(0,n-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev}"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e)}},e.prototype.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},e.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},e.prototype.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=i.length;n--;){var o=i[n][0];if(o.id<=e)break;o.id<t&&(o.ignore=!0)}this.lastDeltas=null},e.prototype.getSelection=function(e,t){for(var i=this.selections,n=i.length;n--;){var o=i[n];if(o.rev<e)return t&&(o=i[n+1]),o}},e.prototype.getRevision=function(){return this.$rev},e.prototype.getDeltas=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=null,o=0,r=i.length;r--;){var s=i[r][0];if(s.id<t&&!n&&(n=r+1),s.id<=e){o=r+1;break}}return i.slice(o,n)},e.prototype.getChangedRanges=function(e,t){null==t&&(t=this.$rev+1)},e.prototype.getChangedLines=function(e,t){null==t&&(t=this.$rev+1)},e.prototype.undo=function(e,t){this.lastDeltas=null;var i=this.$undoStack;if(function(e,t){for(var i=t;i--;){var n=e[i];if(n&&!n[0].ignore){for(;i<t-1;){var o=h(e[i],e[i+1]);e[i]=o[0],e[i+1]=o[1],i++}return!0}}}(i,i.length)){e||(e=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var n=i.pop(),o=null;return n&&(o=e.undoChanges(n,t),this.$redoStack.push(n),this.$syncRev()),this.$fromUndo=!1,o}},e.prototype.redo=function(e,t){if(this.lastDeltas=null,e||(e=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var i=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);!function(e,t){for(var i=0;i<t.length;i++)for(var n=t[i],o=0;o<n.length;o++)m(e,n[o])}(this.$redoStack,i),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach((function(e){e[0].id=++this.$maxRev}),this)}var n=this.$redoStack.pop(),o=null;return n&&(o=e.redoChanges(n,t),this.$undoStack.push(n),this.$syncRev()),this.$fromUndo=!1,o},e.prototype.$syncRev=function(){var e=this.$undoStack,t=e[e.length-1],i=t&&t[0].id||0;this.$redoStackBaseRev=i,this.$rev=i},e.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},e.prototype.canUndo=function(){return this.$undoStack.length>0},e.prototype.canRedo=function(){return this.$redoStack.length>0},e.prototype.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},e.prototype.isAtBookmark=function(){return this.$rev===this.mark},e.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},e.prototype.fromJSON=function(e){this.reset(),this.$undoStack=e.$undoStack,this.$redoStack=e.$redoStack},e.prototype.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)},e}();n.prototype.hasUndo=n.prototype.canUndo,n.prototype.hasRedo=n.prototype.canRedo,n.prototype.isClean=n.prototype.isAtBookmark,n.prototype.markClean=n.prototype.bookmark;var o=e("./range").Range,r=o.comparePoints;function s(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function c(e,t){var i="insert"==e.action,n="insert"==t.action;if(i&&n)if(r(t.start,e.end)>=0)u(t,e,-1);else{if(!(r(t.start,e.start)<=0))return null;u(e,t,1)}else if(i&&!n)if(r(t.start,e.end)>=0)u(t,e,-1);else{if(!(r(t.end,e.start)<=0))return null;u(e,t,-1)}else if(!i&&n)if(r(t.start,e.start)>=0)u(t,e,1);else{if(!(r(t.start,e.start)<=0))return null;u(e,t,1)}else if(!i&&!n)if(r(t.start,e.start)>=0)u(t,e,1);else{if(!(r(t.end,e.start)<=0))return null;u(e,t,-1)}return[t,e]}function h(e,t){for(var i=e.length;i--;)for(var n=0;n<t.length;n++)if(!c(e[i],t[n])){for(;i<e.length;){for(;n--;)c(t[n],e[i]);n=t.length,i++}return[e,t]}return e.selectionBefore=t.selectionBefore=e.selectionAfter=t.selectionAfter=null,[t,e]}function d(e,t){var i="insert"==e.action,n="insert"==t.action;if(i&&n)r(e.start,t.start)<0?u(t,e,1):u(e,t,1);else if(i&&!n)r(e.start,t.end)>=0?u(e,t,-1):(r(e.start,t.start)<=0||u(e,o.fromPoints(t.start,e.start),-1),u(t,e,1));else if(!i&&n)r(t.start,e.end)>=0?u(t,e,-1):(r(t.start,e.start)<=0||u(t,o.fromPoints(e.start,t.start),-1),u(e,t,1));else if(!i&&!n)if(r(t.start,e.end)>=0)u(t,e,-1);else{var s,a;if(!(r(t.end,e.start)<=0))return r(e.start,t.start)<0&&(s=e,e=p(e,t.start)),r(e.end,t.end)>0&&(a=p(e,t.end)),g(t.end,e.start,e.end,-1),a&&!s&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,s,a].filter(Boolean);u(e,t,-1)}return[t,e]}function u(e,t,i){g(e.start,t.start,t.end,i),g(e.end,t.start,t.end,i)}function g(e,t,i,n){e.row==(1==n?t:i).row&&(e.column+=n*(i.column-t.column)),e.row+=n*(i.row-t.row)}function p(e,t){var i=e.lines,n=e.end;e.end=s(t);var o=e.end.row-e.start.row,r=i.splice(o,i.length),a=o?t.column:t.column-e.start.column;return i.push(r[0].substring(0,a)),r[0]=r[0].substr(a),{start:s(t),end:n,lines:r,action:e.action}}function m(e,t){t=function(e){return{start:s(e.start),end:s(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var i=e.length;i--;){for(var n=e[i],o=0;o<n.length;o++){var r=d(n[o],t);t=r[0],2!=r.length&&(r[2]?(n.splice(o+1,1,r[1],r[2]),o++):r[1]||(n.splice(o,1),o--))}n.length||e.splice(i,1)}return e}o.comparePoints,t.UndoManager=n})),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],(function(e,t,i){"use strict";var n=e("../range").Range,o=function(){function e(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var i=t[t.length-1];this.range=new n(t[0].start.row,t[0].start.column,i.end.row,i.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach((function(e){e.setFoldLine(this)}),this)}return e.prototype.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach((function(t){t.start.row+=e,t.end.row+=e}))},e.prototype.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort((function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)})),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},e.prototype.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},e.prototype.walk=function(e,t,i){var n,o,r=0,s=this.folds,a=!0;null==t&&(t=this.end.row,i=this.end.column);for(var l=0;l<s.length;l++){if(-1==(o=(n=s[l]).range.compareStart(t,i)))return void e(null,t,i,r,a);if(!e(null,n.start.row,n.start.column,r,a)&&e(n.placeholder,n.start.row,n.start.column,r)||0===o)return;a=!n.sameRow,r=n.end.column}e(null,t,i,r,a)},e.prototype.getNextFoldTo=function(e,t){for(var i,n,o=0;o<this.folds.length;o++){if(-1==(n=(i=this.folds[o]).range.compareEnd(e,t)))return{fold:i,kind:"after"};if(0===n)return{fold:i,kind:"inside"}}return null},e.prototype.addRemoveChars=function(e,t,i){var n,o,r=this.getNextFoldTo(e,t);if(r)if(n=r.fold,"inside"==r.kind&&n.start.column!=t&&n.start.row!=e)window.console&&window.console.log(e,t,n);else if(n.start.row==e){var s=(o=this.folds).indexOf(n);for(0===s&&(this.start.column+=i);s<o.length;s++){if((n=o[s]).start.column+=i,!n.sameRow)return;n.end.column+=i}this.end.column+=i}},e.prototype.split=function(t,i){var n=this.getNextFoldTo(t,i);if(!n||"inside"==n.kind)return null;var o=n.fold,r=this.folds,s=this.foldData,a=r.indexOf(o),l=r[a-1];this.end.row=l.end.row,this.end.column=l.end.column;var c=new e(s,r=r.splice(a,r.length-a));return s.splice(s.indexOf(this)+1,0,c),c},e.prototype.merge=function(e){for(var t=e.folds,i=0;i<t.length;i++)this.addFold(t[i]);var n=this.foldData;n.splice(n.indexOf(e),1)},e.prototype.toString=function(){var e=[this.range.toString()+": ["];return this.folds.forEach((function(t){e.push(" "+t.toString())})),e.push("]"),e.join("\n")},e.prototype.idxToPosition=function(e){for(var t=0,i=0;i<this.folds.length;i++){var n=this.folds[i];if((e-=n.start.column-t)<0)return{row:n.start.row,column:n.start.column+e};if((e-=n.placeholder.length)<0)return n.start;t=n.end.column}return{row:this.end.row,column:this.end.column+e}},e}();t.FoldLine=o})),ace.define("ace/range_list",["require","exports","module","ace/range"],(function(e,t,i){"use strict";var n=e("./range").Range.comparePoints,o=function(){function e(){this.ranges=[],this.$bias=1}return e.prototype.pointIndex=function(e,t,i){for(var o=this.ranges,r=i||0;r<o.length;r++){var s=o[r],a=n(e,s.end);if(!(a>0)){var l=n(e,s.start);return 0===a?t&&0!==l?-r-2:r:l>0||0===l&&!t?r:-r-1}}return-r-1},e.prototype.add=function(e){var t=!e.isEmpty(),i=this.pointIndex(e.start,t);i<0&&(i=-i-1);var n=this.pointIndex(e.end,t,i);return n<0?n=-n-1:n++,this.ranges.splice(i,n-i,e)},e.prototype.addList=function(e){for(var t=[],i=e.length;i--;)t.push.apply(t,this.add(e[i]));return t},e.prototype.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},e.prototype.merge=function(){for(var e,t=[],i=this.ranges,o=(i=i.sort((function(e,t){return n(e.start,t.start)})))[0],r=1;r<i.length;r++){e=o,o=i[r];var s=n(e.end,o.start);s<0||(0!=s||e.isEmpty()||o.isEmpty())&&(n(e.end,o.end)<0&&(e.end.row=o.end.row,e.end.column=o.end.column),i.splice(r,1),t.push(o),o=e,r--)}return this.ranges=i,t},e.prototype.contains=function(e,t){return this.pointIndex({row:e,column:t})>=0},e.prototype.containsPoint=function(e){return this.pointIndex(e)>=0},e.prototype.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},e.prototype.clipRows=function(e,t){var i=this.ranges;if(i[0].start.row>t||i[i.length-1].start.row<e)return[];var n=this.pointIndex({row:e,column:0});n<0&&(n=-n-1);var o=this.pointIndex({row:t,column:0},n);o<0&&(o=-o-1);for(var r=[],s=n;s<o;s++)r.push(i[s]);return r},e.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},e.prototype.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},e.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},e.prototype.$onChange=function(e){for(var t=e.start,i=e.end,n=t.row,o=i.row,r=this.ranges,s=0,a=r.length;s<a&&!((h=r[s]).end.row>=n);s++);if("insert"==e.action){for(var l=o-n,c=-t.column+i.column;s<a&&!((h=r[s]).start.row>n);s++)if(h.start.row==n&&h.start.column>=t.column&&(h.start.column==t.column&&this.$bias<=0||(h.start.column+=c,h.start.row+=l)),h.end.row==n&&h.end.column>=t.column){if(h.end.column==t.column&&this.$bias<0)continue;h.end.column==t.column&&c>0&&s<a-1&&h.end.column>h.start.column&&h.end.column==r[s+1].start.column&&(h.end.column-=c),h.end.column+=c,h.end.row+=l}}else for(l=n-o,c=t.column-i.column;s<a&&!((h=r[s]).start.row>o);s++)h.end.row<o&&(n<h.end.row||n==h.end.row&&t.column<h.end.column)?(h.end.row=n,h.end.column=t.column):h.end.row==o?h.end.column<=i.column?(l||h.end.column>t.column)&&(h.end.column=t.column,h.end.row=t.row):(h.end.column+=c,h.end.row+=l):h.end.row>o&&(h.end.row+=l),h.start.row<o&&(n<h.start.row||n==h.start.row&&t.column<h.start.column)?(h.start.row=n,h.start.column=t.column):h.start.row==o?h.start.column<=i.column?(l||h.start.column>t.column)&&(h.start.column=t.column,h.start.row=t.row):(h.start.column+=c,h.start.row+=l):h.start.row>o&&(h.start.row+=l);if(0!=l&&s<a)for(;s<a;s++){var h;(h=r[s]).start.row+=l,h.end.row+=l}},e}();o.prototype.comparePoints=n,t.RangeList=o})),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],(function(e,t,i){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=function(e){function t(t,i){var n=e.call(this)||this;return n.foldLine=null,n.placeholder=i,n.range=t,n.start=t.start,n.end=t.end,n.sameRow=t.start.row==t.end.row,n.subFolds=n.ranges=[],n}return o(t,e),t.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},t.prototype.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach((function(t){t.setFoldLine(e)}))},t.prototype.clone=function(){var e=new t(this.range.clone(),this.placeholder);return this.subFolds.forEach((function(t){e.subFolds.push(t.clone())})),e.collapseChildren=this.collapseChildren,e},t.prototype.addSubFold=function(e){if(!this.range.isEqual(e)){var t,i;t=e,i=this.start,s(t.start,i),s(t.end,i);for(var n=e.start.row,o=e.start.column,r=0,a=-1;r<this.subFolds.length&&1==(a=this.subFolds[r].range.compare(n,o));r++);var l=this.subFolds[r],c=0;if(0==a){if(l.range.containsRange(e))return l.addSubFold(e);c=1}n=e.range.end.row,o=e.range.end.column;var h=r;for(a=-1;h<this.subFolds.length&&1==(a=this.subFolds[h].range.compare(n,o));h++);0==a&&h++;for(var d=this.subFolds.splice(r,h-r,e),u=0==a?d.length-1:d.length,g=c;g<u;g++)e.addSubFold(d[g]);return e.setFoldLine(this.foldLine),e}},t.prototype.restoreRange=function(e){return function(e,t){a(e.start,t),a(e.end,t)}(e,this.start)},t}(e("../range_list").RangeList);function s(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function a(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}t.Fold=r})),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],(function(e,t,i){"use strict";var n=e("../range").Range,o=e("./fold_line").FoldLine,r=e("./fold").Fold,s=e("../token_iterator").TokenIterator,a=e("../mouse/mouse_event").MouseEvent;t.Folding=function(){this.getFoldAt=function(e,t,i){var n=this.getFoldLine(e);if(!n)return null;for(var o=n.folds,r=0;r<o.length;r++){var s=o[r].range;if(s.contains(e,t)){if(1==i&&s.isEnd(e,t)&&!s.isEmpty())continue;if(-1==i&&s.isStart(e,t)&&!s.isEmpty())continue;return o[r]}}},this.getFoldsInRange=function(e){var t=e.start,i=e.end,n=this.$foldData,o=[];t.column+=1,i.column-=1;for(var r=0;r<n.length;r++){var s=n[r].range.compareRange(e);if(2!=s){if(-2==s)break;for(var a=n[r].folds,l=0;l<a.length;l++){var c=a[l];if(-2==(s=c.range.compareRange(e)))break;if(2!=s){if(42==s)break;o.push(c)}}}}return t.column-=1,i.column+=1,o},this.getFoldsInRangeList=function(e){if(Array.isArray(e)){var t=[];e.forEach((function(e){t=t.concat(this.getFoldsInRange(e))}),this)}else t=this.getFoldsInRange(e);return t},this.getAllFolds=function(){for(var e=[],t=this.$foldData,i=0;i<t.length;i++)for(var n=0;n<t[i].folds.length;n++)e.push(t[i].folds[n]);return e},this.getFoldStringAt=function(e,t,i,n){if(!(n=n||this.getFoldLine(e)))return null;for(var o,r,s={end:{column:0}},a=0;a<n.folds.length;a++){var l=(r=n.folds[a]).range.compareEnd(e,t);if(-1==l){o=this.getLine(r.start.row).substring(s.end.column,r.start.column);break}if(0===l)return null;s=r}return o||(o=this.getLine(r.start.row).substring(s.end.column)),-1==i?o.substring(0,t-s.end.column):1==i?o.substring(t-s.end.column):o},this.getFoldLine=function(e,t){var i=this.$foldData,n=0;for(t&&(n=i.indexOf(t)),-1==n&&(n=0);n<i.length;n++){var o=i[n];if(o.start.row<=e&&o.end.row>=e)return o;if(o.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var i=this.$foldData,n=0;for(t&&(n=i.indexOf(t)),-1==n&&(n=0);n<i.length;n++){var o=i[n];if(o.end.row>=e)return o}return null},this.getFoldedRowCount=function(e,t){for(var i=this.$foldData,n=t-e+1,o=0;o<i.length;o++){var r=i[o],s=r.end.row,a=r.start.row;if(s>=t){a<t&&(a>=e?n-=t-a:n=0);break}s>=e&&(n-=a>=e?s-a:s-e+1)}return n},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort((function(e,t){return e.start.row-t.start.row})),e},this.addFold=function(e,t){var i,n=this.$foldData,s=!1;e instanceof r?i=e:(i=new r(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(i.range);var a=i.start.row,l=i.start.column,c=i.end.row,h=i.end.column,d=this.getFoldAt(a,l,1),u=this.getFoldAt(c,h,-1);if(d&&u==d)return d.addSubFold(i);d&&!d.range.isStart(a,l)&&this.removeFold(d),u&&!u.range.isEnd(c,h)&&this.removeFold(u);var g=this.getFoldsInRange(i.range);g.length>0&&(this.removeFolds(g),i.collapseChildren||g.forEach((function(e){i.addSubFold(e)})));for(var p=0;p<n.length;p++){var m=n[p];if(c==m.start.row){m.addFold(i),s=!0;break}if(a==m.end.row){if(m.addFold(i),s=!0,!i.sameRow){var f=n[p+1];if(f&&f.start.row==c){m.merge(f);break}}break}if(c<=m.start.row)break}return s||(m=this.$addFoldLine(new o(this.$foldData,i))),this.$useWrapMode?this.$updateWrapData(m.start.row,m.start.row):this.$updateRowLengthCache(m.start.row,m.start.row),this.$modified=!0,this._signal("changeFold",{data:i,action:"add"}),i},this.addFolds=function(e){e.forEach((function(e){this.addFold(e)}),this)},this.removeFold=function(e){var t=e.foldLine,i=t.start.row,n=t.end.row,o=this.$foldData,r=t.folds;if(1==r.length)o.splice(o.indexOf(t),1);else if(t.range.isEnd(e.end.row,e.end.column))r.pop(),t.end.row=r[r.length-1].end.row,t.end.column=r[r.length-1].end.column;else if(t.range.isStart(e.start.row,e.start.column))r.shift(),t.start.row=r[0].start.row,t.start.column=r[0].start.column;else if(e.sameRow)r.splice(r.indexOf(e),1);else{var s=t.split(e.start.row,e.start.column);(r=s.folds).shift(),s.start.row=r[0].start.row,s.start.column=r[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(i,n):this.$updateRowLengthCache(i,n)),this.$modified=!0,this._signal("changeFold",{data:e,action:"remove"})},this.removeFolds=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i]);t.forEach((function(e){this.removeFold(e)}),this),this.$modified=!0},this.expandFold=function(e){this.removeFold(e),e.subFolds.forEach((function(t){e.restoreRange(t),this.addFold(t)}),this),e.collapseChildren>0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach((function(e){this.expandFold(e)}),this)},this.unfold=function(e,t){var i,o;if(null==e)i=new n(0,0,this.getLength(),0),null==t&&(t=!0);else if("number"==typeof e)i=new n(e,0,e,this.getLine(e).length);else if("row"in e)i=n.fromPoints(e,e);else{if(Array.isArray(e))return o=[],e.forEach((function(e){o=o.concat(this.unfold(e))}),this),o;i=e}for(var r=o=this.getFoldsInRangeList(i);1==o.length&&n.comparePoints(o[0].start,i.start)<0&&n.comparePoints(o[0].end,i.end)>0;)this.expandFolds(o),o=this.getFoldsInRangeList(i);if(0!=t?this.removeFolds(o):this.expandFolds(o),r.length)return r},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var i=this.getFoldLine(e,t);return i?i.end.row:e},this.getRowFoldStart=function(e,t){var i=this.getFoldLine(e,t);return i?i.start.row:e},this.getFoldDisplayLine=function(e,t,i,n,o){null==n&&(n=e.start.row),null==o&&(o=0),null==t&&(t=e.end.row),null==i&&(i=this.getLine(t).length);var r=this.doc,s="";return e.walk((function(e,t,i,a){if(!(t<n)){if(t==n){if(i<o)return;a=Math.max(o,a)}s+=null!=e?e:r.getLine(t).substring(a,i)}}),t,i),s},this.getDisplayLine=function(e,t,i,n){var o,r=this.getFoldLine(e);return r?this.getFoldDisplayLine(r,e,t,i,n):(o=this.doc.getLine(e)).substring(n||0,t||o.length)},this.$cloneFoldData=function(){var e=[];return e=this.$foldData.map((function(t){var i=t.folds.map((function(e){return e.clone()}));return new o(e,i)}))},this.toggleFold=function(e){var t,i,n=this.selection.getRange();if(n.isEmpty()){var o=n.start;if(t=this.getFoldAt(o.row,o.column))return void this.expandFold(t);(i=this.findMatchingBracket(o))?1==n.comparePoint(i)?n.end=i:(n.start=i,n.start.column++,n.end.column--):(i=this.findMatchingBracket({row:o.row,column:o.column+1}))?(1==n.comparePoint(i)?n.end=i:n.start=i,n.start.column++):n=this.getCommentFoldRange(o.row,o.column)||n}else{var r=this.getFoldsInRange(n);if(e&&r.length)return void this.expandFolds(r);1==r.length&&(t=r[0])}if(t||(t=this.getFoldAt(n.start.row,n.start.column)),t&&t.range.toString()==n.toString())this.expandFold(t);else{var s="...";if(!n.isMultiLine()){if((s=this.getTextRange(n)).length<4)return;s=s.trim().substring(0,2)+".."}this.addFold(s,n)}},this.getCommentFoldRange=function(e,t,i){var o=new s(this,e,t),r=o.getCurrentToken(),a=r&&r.type;if(r&&/^comment|string/.test(a)){"comment"==(a=a.match(/comment|string/)[0])&&(a+="|doc-start|\\.doc");var l=new RegExp(a),c=new n;if(1!=i){do{r=o.stepBackward()}while(r&&l.test(r.type)&&!/^comment.end/.test(r.type));r=o.stepForward()}if(c.start.row=o.getCurrentTokenRow(),c.start.column=o.getCurrentTokenColumn()+(/^comment.start/.test(r.type)?r.value.length:2),o=new s(this,e,t),-1!=i){var h=-1;do{if(r=o.stepForward(),-1==h){var d=this.getState(o.$row);l.test(d)||(h=o.$row)}else if(o.$row>h)break}while(r&&l.test(r.type)&&!/^comment.start/.test(r.type));r=o.stepBackward()}else r=o.getCurrentToken();return c.end.row=o.getCurrentTokenRow(),c.end.column=o.getCurrentTokenColumn(),/^comment.end/.test(r.type)||(c.end.column+=r.value.length-2),c}},this.foldAll=function(e,t,i,n){null==i&&(i=1e5);var o=this.foldWidgets;if(o){t=t||this.getLength();for(var r=e=e||0;r<t;r++)if(null==o[r]&&(o[r]=this.getFoldWidget(r)),"start"==o[r]&&(!n||n(r))){var s=this.getFoldWidgetRange(r);s&&s.isMultiLine()&&s.end.row<=t&&s.start.row>=e&&(r=s.end.row,s.collapseChildren=i,this.addFold("...",s))}}},this.foldToLevel=function(e){for(this.foldAll();e-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,(function(t){for(var i=e.getTokens(t),n=0;n<i.length;n++){var o=i[n];if("text"!=o.type||!/^\s+$/.test(o.value))return!!/comment/.test(o.type)}}))},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var i=this.foldWidgets;if(!i||t&&i[e])return{};for(var n,o=e-1;o>=0;){var r=i[o];if(null==r&&(r=i[o]=this.getFoldWidget(o)),"start"==r){var s=this.getFoldWidgetRange(o);if(n||(n=s),s&&s.end.row>=e)break}o--}return{range:-1!==o&&s,firstRange:n}},this.onFoldWidgetClick=function(e,t){t instanceof a&&(t=t.domEvent);var i={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,i)){var n=t.target||t.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var i=this.getFoldWidget(e),n=this.getLine(e),o="end"===i?-1:1,r=this.getFoldAt(e,-1===o?0:n.length,o);if(r)return t.children||t.all?this.removeFold(r):this.expandFold(r),r;var s=this.getFoldWidgetRange(e,!0);if(s&&!s.isMultiLine()&&(r=this.getFoldAt(s.start.row,s.start.column,1))&&s.isEqual(r.range))return this.removeFold(r),r;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,c=a.range.end.row;this.foldAll(l,c,t.all?1e4:0)}else t.children?(c=s?s.end.row:this.getLength(),this.foldAll(e+1,c,t.all?1e4:0)):s&&(t.all&&(s.collapseChildren=1e4),this.addFold("...",s));return s}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var i=this.$toggleFoldWidget(t,{});if(!i){var n=this.getParentFoldRangeData(t,!0);if(i=n.range||n.firstRange){t=i.start.row;var o=this.getFoldAt(t,this.getLine(t).length,1);o?this.removeFold(o):this.addFold("...",i)}}},this.updateFoldWidgets=function(e){var t=e.start.row,i=e.end.row-t;if(0===i)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,i+1,null);else{var n=Array(i+1);n.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,n)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}})),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],(function(e,t,i){"use strict";var n=e("../token_iterator").TokenIterator,o=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var i=t||this.getLine(e.row).charAt(e.column-1);if(""==i)return null;var n=i.match(/([\(\[\{])|([\)\]\}])/);return n?n[1]?this.$findClosingBracket(n[1],e):this.$findOpeningBracket(n[2],e):null},this.getBracketRange=function(e){var t,i=this.getLine(e.row),n=!0,r=i.charAt(e.column-1),s=r&&r.match(/([\(\[\{])|([\)\]\}])/);if(s||(r=i.charAt(e.column),e={row:e.row,column:e.column+1},s=r&&r.match(/([\(\[\{])|([\)\]\}])/),n=!1),!s)return null;if(s[1]){if(!(a=this.$findClosingBracket(s[1],e)))return null;t=o.fromPoints(e,a),n||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(s[2],e)))return null;t=o.fromPoints(a,e),n||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.getMatchingBracketRanges=function(e,t){var i=this.getLine(e.row),n=/([\(\[\{])|([\)\]\}])/,r=!t&&i.charAt(e.column-1),s=r&&r.match(n);if(s||(r=(void 0===t||t)&&i.charAt(e.column),e={row:e.row,column:e.column+1},s=r&&r.match(n)),!s)return null;var a=new o(e.row,e.column-1,e.row,e.column),l=s[1]?this.$findClosingBracket(s[1],e):this.$findOpeningBracket(s[2],e);return l?[a,new o(l.row,l.column,l.row,l.column+1)]:[a]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,i){var o=this.$brackets[e],r=1,s=new n(this,t.row,t.column),a=s.getCurrentToken();if(a||(a=s.stepForward()),a){i||(i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var l=t.column-s.getCurrentTokenColumn()-2,c=a.value;;){for(;l>=0;){var h=c.charAt(l);if(h==o){if(0==(r-=1))return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else h==e&&(r+=1);l-=1}do{a=s.stepBackward()}while(a&&!i.test(a.type));if(null==a)break;l=(c=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,i){var o=this.$brackets[e],r=1,s=new n(this,t.row,t.column),a=s.getCurrentToken();if(a||(a=s.stepForward()),a){i||(i=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var l=t.column-s.getCurrentTokenColumn();;){for(var c=a.value,h=c.length;l<h;){var d=c.charAt(l);if(d==o){if(0==(r-=1))return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else d==e&&(r+=1);l+=1}do{a=s.stepForward()}while(a&&!i.test(a.type));if(null==a)break;l=0}return null}},this.getMatchingTags=function(e){var t=new n(this,e.row,e.column),i=this.$findTagName(t);if(i)return"<"===t.stepBackward().value?this.$findClosingTag(t,i):this.$findOpeningTag(t,i)},this.$findTagName=function(e){var t=e.getCurrentToken(),i=!1,n=!1;if(t&&-1===t.type.indexOf("tag-name"))do{(t=n?e.stepBackward():e.stepForward())&&("/>"===t.value?n=!0:-1!==t.type.indexOf("tag-name")&&(i=!0))}while(t&&!i);return t},this.$findClosingTag=function(e,t){var i,n=t.value,r=t.value,s=0,a=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);t=e.stepForward();var l=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length),c=!1;do{if(i=t,t=e.stepForward()){if(">"===t.value&&!c){var h=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);c=!0}if(-1!==t.type.indexOf("tag-name")){if(r===(n=t.value))if("<"===i.value)s++;else if("</"===i.value&&--s<0){e.stepBackward();var d=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2);t=e.stepForward();var u=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);if(!(t=e.stepForward())||">"!==t.value)return;var g=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else r===n&&"/>"===t.value&&--s<0&&(g=u=d=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2),h=new o(l.end.row,l.end.column,l.end.row,l.end.column+1))}}while(t&&s>=0);if(a&&h&&d&&g&&l&&u)return{openTag:new o(a.start.row,a.start.column,h.end.row,h.end.column),closeTag:new o(d.start.row,d.start.column,g.end.row,g.end.column),openTagName:l,closeTagName:u}},this.$findOpeningTag=function(e,t){var i=e.getCurrentToken(),n=t.value,r=0,s=e.getCurrentTokenRow(),a=e.getCurrentTokenColumn(),l=a+2,c=new o(s,a,s,l);e.stepForward();var h=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);if((t=e.stepForward())&&">"===t.value){var d=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);e.stepBackward(),e.stepBackward();do{if(t=i,s=e.getCurrentTokenRow(),l=(a=e.getCurrentTokenColumn())+t.value.length,i=e.stepBackward(),t)if(-1!==t.type.indexOf("tag-name")){if(n===t.value)if("<"===i.value){if(++r>0){var u=new o(s,a,s,l),g=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);do{t=e.stepForward()}while(t&&">"!==t.value);var p=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else"</"===i.value&&r--}else if("/>"===t.value){for(var m=0,f=i;f;){if(-1!==f.type.indexOf("tag-name")&&f.value===n){r--;break}if("<"===f.value)break;f=e.stepBackward(),m++}for(var v=0;v<m;v++)e.stepForward()}}while(i&&r<=0);return g&&p&&c&&d&&u&&h?{openTag:new o(g.start.row,g.start.column,p.end.row,p.end.column),closeTag:new o(c.start.row,c.start.column,d.end.row,d.end.column),openTagName:u,closeTagName:h}:void 0}}}})),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],(function(e,t,i){"use strict";var n=e("./lib/oop"),o=e("./lib/lang"),r=e("./bidihandler").BidiHandler,s=e("./config"),a=e("./lib/event_emitter").EventEmitter,l=e("./selection").Selection,c=e("./mode/text").Mode,h=e("./range").Range,d=e("./document").Document,u=e("./background_tokenizer").BackgroundTokenizer,g=e("./search_highlight").SearchHighlight,p=e("./undomanager").UndoManager,m=function(){function e(t,i){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++e.$uid,this.$foldData.toString=function(){return this.join("\n")},this.bgTokenizer=new u((new c).getTokenizer(),this);var n=this;this.bgTokenizer.on("update",(function(e){n._signal("tokenizerUpdate",e)})),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof t&&t.getLine||(t=new d(t)),this.setDocument(t),this.selection=new l(this),this.$bidiHandler=new r(this),s.resetOptions(this),this.setMode(i),s._signal("session",this),this.destroyed=!1}return e.prototype.setDocument=function(e){this.doc&&this.doc.off("change",this.$onChange),this.doc=e,e.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},e.prototype.getDocument=function(){return this.doc},e.prototype.$resetRowCache=function(e){if(!e)return this.$docRowCache=[],void(this.$screenRowCache=[]);var t=this.$docRowCache.length,i=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>i&&(this.$docRowCache.splice(i,t),this.$screenRowCache.splice(i,t))},e.prototype.$getRowCacheIndex=function(e,t){for(var i=0,n=e.length-1;i<=n;){var o=i+n>>1,r=e[o];if(t>r)i=o+1;else{if(!(t<r))return o;n=o-1}}return i-1},e.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},e.prototype.onChangeFold=function(e){var t=e.data;this.$resetRowCache(t.start.row)},e.prototype.onChange=function(e){this.$modified=!0,this.$bidiHandler.onChange(e),this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&(t&&t.length&&(this.$undoManager.add({action:"removeFolds",folds:t},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(e,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(e),this._signal("change",e)},e.prototype.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},e.fromJSON=function(t){"string"==typeof t&&(t=JSON.parse(t));var i=new p;i.$undoStack=t.history.undo,i.$redoStack=t.history.redo,i.mark=t.history.mark,i.$rev=t.history.rev;var n=new e(t.value);return t.folds.forEach((function(e){n.addFold("...",h.fromPoints(e.start,e.end))})),n.setAnnotations(t.annotations),n.setBreakpoints(t.breakpoints),n.setMode(t.mode),n.setScrollLeft(t.scrollLeft),n.setScrollTop(t.scrollTop),n.setUndoManager(i),n.selection.fromJSON(t.selection),n},e.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map((function(e){return e.range})),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},e.prototype.toString=function(){return this.doc.getValue()},e.prototype.getSelection=function(){return this.selection},e.prototype.getState=function(e){return this.bgTokenizer.getState(e)},e.prototype.getTokens=function(e){return this.bgTokenizer.getTokens(e)},e.prototype.getTokenAt=function(e,t){var i,n=this.bgTokenizer.getTokens(e),o=0;if(null==t){var r=n.length-1;o=this.getLine(e).length}else for(r=0;r<n.length&&!((o+=n[r].value.length)>=t);r++);return(i=n[r])?(i.index=r,i.start=o-i.value.length,i):null},e.prototype.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=o.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},e.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},e.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},e.prototype.getTabString=function(){return this.getUseSoftTabs()?o.stringRepeat(" ",this.getTabSize()):"\t"},e.prototype.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},e.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},e.prototype.setTabSize=function(e){this.setOption("tabSize",e)},e.prototype.getTabSize=function(){return this.$tabSize},e.prototype.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},e.prototype.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},e.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},e.prototype.setOverwrite=function(e){this.setOption("overwrite",e)},e.prototype.getOverwrite=function(){return this.$overwrite},e.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},e.prototype.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},e.prototype.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},e.prototype.getBreakpoints=function(){return this.$breakpoints},e.prototype.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++)this.$breakpoints[e[t]]="ace_breakpoint";this._signal("changeBreakpoint",{})},e.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},e.prototype.setBreakpoint=function(e,t){void 0===t&&(t="ace_breakpoint"),t?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},e.prototype.clearBreakpoint=function(e){delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},e.prototype.addMarker=function(e,t,i,n){var o=this.$markerId++,r={range:e,type:i||"line",renderer:"function"==typeof i?i:null,clazz:t,inFront:!!n,id:o};return n?(this.$frontMarkers[o]=r,this._signal("changeFrontMarker")):(this.$backMarkers[o]=r,this._signal("changeBackMarker")),o},e.prototype.addDynamicMarker=function(e,t){if(e.update){var i=this.$markerId++;return e.id=i,e.inFront=!!t,t?(this.$frontMarkers[i]=e,this._signal("changeFrontMarker")):(this.$backMarkers[i]=e,this._signal("changeBackMarker")),e}},e.prototype.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];t&&(delete(t.inFront?this.$frontMarkers:this.$backMarkers)[e],this._signal(t.inFront?"changeFrontMarker":"changeBackMarker"))},e.prototype.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},e.prototype.highlight=function(e){if(!this.$searchHighlight){var t=new g(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(t)}this.$searchHighlight.setRegexp(e)},e.prototype.highlightLines=function(e,t,i,n){"number"!=typeof t&&(i=t,t=e),i||(i="ace_step");var o=new h(e,0,t,1/0);return o.id=this.addMarker(o,i,"fullLine",n),o},e.prototype.setAnnotations=function(e){this.$annotations=e,this._signal("changeAnnotation",{})},e.prototype.getAnnotations=function(){return this.$annotations||[]},e.prototype.clearAnnotations=function(){this.setAnnotations([])},e.prototype.$detectNewLine=function(e){var t=e.match(/^.*?(\r?\n)/m);this.$autoNewLine=t?t[1]:"\n"},e.prototype.getWordRange=function(e,t){var i=this.getLine(e),n=!1;if(t>0&&(n=!!i.charAt(t-1).match(this.tokenRe)),n||(n=!!i.charAt(t).match(this.tokenRe)),n)var o=this.tokenRe;else o=/^\s+$/.test(i.slice(t-1,t+1))?/\s/:this.nonTokenRe;var r=t;if(r>0){do{r--}while(r>=0&&i.charAt(r).match(o));r++}for(var s=t;s<i.length&&i.charAt(s).match(o);)s++;return new h(e,r,e,s)},e.prototype.getAWordRange=function(e,t){for(var i=this.getWordRange(e,t),n=this.getLine(i.end.row);n.charAt(i.end.column).match(/[ \t]/);)i.end.column+=1;return i},e.prototype.setNewLineMode=function(e){this.doc.setNewLineMode(e)},e.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},e.prototype.setUseWorker=function(e){this.setOption("useWorker",e)},e.prototype.getUseWorker=function(){return this.$useWorker},e.prototype.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._signal("tokenizerUpdate",e)},e.prototype.setMode=function(e,t){if(e&&"object"==typeof e){if(e.getTokenizer)return this.$onChangeMode(e);var i=e,n=i.path}else n=e||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new c),this.$modes[n]&&!i)return this.$onChangeMode(this.$modes[n]),void(t&&t());this.$modeId=n,s.loadModule(["mode",n],function(e){if(this.$modeId!==n)return t&&t();this.$modes[n]&&!i?this.$onChangeMode(this.$modes[n]):e&&e.Mode&&(e=new e.Mode(i),i||(this.$modes[n]=e,e.$id=n),this.$onChangeMode(e)),t&&t()}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},e.prototype.$onChangeMode=function(e,t){if(t||(this.$modeId=e.$id),this.$mode!==e){var i=this.$mode;this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker();var n=e.getTokenizer();if(void 0!==n.on){var o=this.onReloadTokenizer.bind(this);n.on("update",o)}this.bgTokenizer.setTokenizer(n),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,t||(e.attachToSession&&e.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(e.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:i,mode:e}))}},e.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},e.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){s.warn("Could not load worker",e),this.$worker=null}},e.prototype.getMode=function(){return this.$mode},e.prototype.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal("changeScrollTop",e))},e.prototype.getScrollTop=function(){return this.$scrollTop},e.prototype.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal("changeScrollLeft",e))},e.prototype.getScrollLeft=function(){return this.$scrollLeft},e.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},e.prototype.getLineWidgetMaxWidth=function(){if(null!=this.lineWidgetsWidth)return this.lineWidgetsWidth;var e=0;return this.lineWidgets.forEach((function(t){t&&t.screenWidth>e&&(e=t.screenWidth)})),this.lineWidgetWidth=e},e.prototype.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),i=this.$rowLengthCache,n=0,o=0,r=this.$foldData[o],s=r?r.start.row:1/0,a=t.length,l=0;l<a;l++){if(l>s){if((l=r.end.row+1)>=a)break;s=(r=this.$foldData[o++])?r.start.row:1/0}null==i[l]&&(i[l]=this.$getStringScreenWidth(t[l])[0]),i[l]>n&&(n=i[l])}this.screenWidth=n}},e.prototype.getLine=function(e){return this.doc.getLine(e)},e.prototype.getLines=function(e,t){return this.doc.getLines(e,t)},e.prototype.getLength=function(){return this.doc.getLength()},e.prototype.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},e.prototype.insert=function(e,t){return this.doc.insert(e,t)},e.prototype.remove=function(e){return this.doc.remove(e)},e.prototype.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},e.prototype.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=e.length-1;-1!=i;i--){var n=e[i];"insert"==n.action||"remove"==n.action?this.doc.revertDelta(n):n.folds&&this.addFolds(n.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},e.prototype.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var i=0;i<e.length;i++){var n=e[i];"insert"!=n.action&&"remove"!=n.action||this.doc.$safeApplyDelta(n)}!t&&this.$undoSelect&&(e.selectionAfter?this.selection.fromJSON(e.selectionAfter):this.selection.setRange(this.$getUndoSelection(e,!1))),this.$fromUndo=!1}},e.prototype.setUndoSelect=function(e){this.$undoSelect=e},e.prototype.$getUndoSelection=function(e,t){function i(e){return t?"insert"!==e.action:"insert"===e.action}for(var n,o,r=0;r<e.length;r++){var s=e[r];s.start&&(n?i(s)?(o=s.start,-1==n.compare(o.row,o.column)&&n.setStart(o),o=s.end,1==n.compare(o.row,o.column)&&n.setEnd(o)):(o=s.start,-1==n.compare(o.row,o.column)&&(n=h.fromPoints(s.start,s.start))):n=i(s)?h.fromPoints(s.start,s.end):h.fromPoints(s.start,s.start))}return n},e.prototype.replace=function(e,t){return this.doc.replace(e,t)},e.prototype.moveText=function(e,t,i){var n=this.getTextRange(e),o=this.getFoldsInRange(e),r=h.fromPoints(t,t);if(!i){this.remove(e);var s=e.start.row-e.end.row;(c=s?-e.end.column:e.start.column-e.end.column)&&(r.start.row==e.end.row&&r.start.column>e.end.column&&(r.start.column+=c),r.end.row==e.end.row&&r.end.column>e.end.column&&(r.end.column+=c)),s&&r.start.row>=e.end.row&&(r.start.row+=s,r.end.row+=s)}if(r.end=this.insert(r.start,n),o.length){var a=e.start,l=r.start,c=(s=l.row-a.row,l.column-a.column);this.addFolds(o.map((function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=c),e.end.row==a.row&&(e.end.column+=c),e.start.row+=s,e.end.row+=s,e})))}return r},e.prototype.indentRows=function(e,t,i){i=i.replace(/\t/g,this.getTabString());for(var n=e;n<=t;n++)this.doc.insertInLine({row:n,column:0},i)},e.prototype.outdentRows=function(e){for(var t=e.collapseRows(),i=new h(0,0,0,0),n=this.getTabSize(),o=t.start.row;o<=t.end.row;++o){var r=this.getLine(o);i.start.row=o,i.end.row=o;for(var s=0;s<n&&" "==r.charAt(s);++s);s<n&&"\t"==r.charAt(s)?(i.start.column=s,i.end.column=s+1):(i.start.column=0,i.end.column=s),this.remove(i)}},e.prototype.$moveLines=function(e,t,i){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),i<0){if((o=this.getRowFoldStart(e+i))<0)return 0;var n=o-e}else if(i>0){var o;if((o=this.getRowFoldEnd(t+i))>this.doc.getLength()-1)return 0;n=o-t}else e=this.$clipRowToDocument(e),n=(t=this.$clipRowToDocument(t))-e+1;var r=new h(e,0,t,Number.MAX_VALUE),s=this.getFoldsInRange(r).map((function(e){return(e=e.clone()).start.row+=n,e.end.row+=n,e})),a=0==i?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+n,a),s.length&&this.addFolds(s),n},e.prototype.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},e.prototype.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},e.prototype.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},e.prototype.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},e.prototype.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},e.prototype.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var i=this.doc.getLength();e>=i?(e=i-1,t=this.doc.getLine(i-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},e.prototype.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},e.prototype.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},e.prototype.getUseWrapMode=function(){return this.$useWrapMode},e.prototype.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},e.prototype.adjustWrapLimit=function(e,t){var i=this.$wrapLimitRange;i.max<0&&(i={min:t,max:t});var n=this.$constrainWrapLimit(e,i.min,i.max);return n!=this.$wrapLimit&&n>1&&(this.$wrapLimit=n,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},e.prototype.$constrainWrapLimit=function(e,t,i){return t&&(e=Math.max(t,e)),i&&(e=Math.min(i,e)),e},e.prototype.getWrapLimit=function(){return this.$wrapLimit},e.prototype.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},e.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},e.prototype.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,i=e.action,n=e.start,o=e.end,r=n.row,s=o.row,a=s-r,l=null;if(this.$updating=!0,0!=a)if("remove"===i){this[t?"$wrapData":"$rowLengthCache"].splice(r,a);var c=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var h=0;if(m=this.getFoldLine(o.row)){m.addRemoveChars(o.row,o.column,n.column-o.column),m.shiftRow(-a);var d=this.getFoldLine(r);d&&d!==m&&(d.merge(m),m=d),h=c.indexOf(m)+1}for(;h<c.length;h++)(m=c[h]).start.row>=o.row&&m.shiftRow(-a);s=r}else{var u=Array(a);u.unshift(r,0);var g=t?this.$wrapData:this.$rowLengthCache;if(g.splice.apply(g,u),c=this.$foldData,h=0,m=this.getFoldLine(r)){var p=m.range.compareInside(n.row,n.column);0==p?(m=m.split(n.row,n.column))&&(m.shiftRow(a),m.addRemoveChars(s,0,o.column-n.column)):-1==p&&(m.addRemoveChars(r,0,o.column-n.column),m.shiftRow(a)),h=c.indexOf(m)+1}for(;h<c.length;h++){var m;(m=c[h]).start.row>=r&&m.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===i&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(m=this.getFoldLine(r))&&m.addRemoveChars(r,n.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(r,s):this.$updateRowLengthCache(r,s),l},e.prototype.$updateRowLengthCache=function(e,t){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},e.prototype.$updateWrapData=function(e,t){var i,n,o=this.doc.getAllLines(),r=this.getTabSize(),s=this.$wrapData,a=this.$wrapLimit,l=e;for(t=Math.min(t,o.length-1);l<=t;)(n=this.getFoldLine(l,n))?(i=[],n.walk(function(e,t,n,r){var s;if(null!=e){(s=this.$getDisplayTokens(e,i.length))[0]=C;for(var a=1;a<s.length;a++)s[a]=y}else s=this.$getDisplayTokens(o[t].substring(r,n),i.length);i=i.concat(s)}.bind(this),n.end.row,o[n.end.row].length+1),s[n.start.row]=this.$computeWrapSplits(i,a,r),l=n.end.row+1):(i=this.$getDisplayTokens(o[l]),s[l]=this.$computeWrapSplits(i,a,r),l++)},e.prototype.$computeWrapSplits=function(e,t,i){if(0==e.length)return[];var n=[],o=e.length,r=0,s=0,a=this.$wrapAsCode,l=this.$indentedSoftWrap,c=t<=Math.max(2*i,8)||!1===l?0:Math.floor(t/2);function h(t){for(var o=t-r,h=r;h<t;h++){var u=e[h];12!==u&&2!==u||(o-=1)}n.length||(d=function(){var t=0;if(0===c)return t;if(l)for(var n=0;n<e.length;n++){var o=e[n];if(o==b)t+=1;else{if(o!=A){if(o==w)continue;break}t+=i}}return a&&!1!==l&&(t+=i),Math.min(t,c)}(),n.indent=d),s+=o,n.push(s),r=t}for(var d=0;o-r>t-d;){var u=r+t-d;if(e[u-1]>=b&&e[u]>=b)h(u);else if(e[u]!=C&&e[u]!=y){for(var g=Math.max(u-(t-(t>>2)),r-1);u>g&&e[u]<C;)u--;if(a){for(;u>g&&e[u]<C;)u--;for(;u>g&&e[u]==I;)u--}else for(;u>g&&e[u]<b;)u--;u>g?h(++u):(e[u=r+t]==v&&u--,h(u-d))}else{for(;u!=r-1&&e[u]!=C;u--);if(u>r){h(u);continue}for(u=r+t;u<e.length&&e[u]==y;u++);if(u==e.length)break;h(u)}}return n},e.prototype.$getDisplayTokens=function(e,t){var i,n=[];t=t||0;for(var o=0;o<e.length;o++){var r=e.charCodeAt(o);if(9==r){i=this.getScreenTabSize(n.length+t),n.push(A);for(var s=1;s<i;s++)n.push(w)}else 32==r?n.push(b):r>39&&r<48||r>57&&r<64?n.push(I):r>=4352&&S(r)?n.push(f,v):n.push(f)}return n},e.prototype.$getStringScreenWidth=function(e,t,i){if(0==t)return[0,0];var n,o;for(null==t&&(t=1/0),i=i||0,o=0;o<e.length&&(9==(n=e.charCodeAt(o))?i+=this.getScreenTabSize(i):n>=4352&&S(n)?i+=2:i+=1,!(i>t));o++);return[i,o]},e.prototype.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+t:t},e.prototype.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},e.prototype.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),i=this.$wrapData[t.row];return i.length&&i[0]<t.column?i.indent:0}return 0},e.prototype.getScreenLastRowColumn=function(e){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE);return this.documentToScreenColumn(t.row,t.column)},e.prototype.getDocumentLastRowColumn=function(e,t){var i=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(i)},e.prototype.getDocumentLastRowColumnPosition=function(e,t){var i=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(i,Number.MAX_VALUE/10)},e.prototype.getRowSplitData=function(e){return this.$useWrapMode?this.$wrapData[e]:void 0},e.prototype.getScreenTabSize=function(e){return this.$tabSize-(e%this.$tabSize|0)},e.prototype.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row},e.prototype.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column},e.prototype.screenToDocumentPosition=function(e,t,i){if(e<0)return{row:0,column:0};var n,o,r=0,s=0,a=0,l=0,c=this.$screenRowCache,h=this.$getRowCacheIndex(c,e),d=c.length;if(d&&h>=0){a=c[h],r=this.$docRowCache[h];var u=e>c[d-1]}else u=!d;for(var g=this.getLength()-1,p=this.getNextFoldLine(r),m=p?p.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(r))>e||r>=g);)a+=l,++r>m&&(r=p.end.row+1,m=(p=this.getNextFoldLine(r,p))?p.start.row:1/0),u&&(this.$docRowCache.push(r),this.$screenRowCache.push(a));if(p&&p.start.row<=r)n=this.getFoldDisplayLine(p),r=p.start.row;else{if(a+l<=e||r>g)return{row:g,column:this.getLine(g).length};n=this.getLine(r),p=null}var f=0,v=Math.floor(e-a);if(this.$useWrapMode){var C=this.$wrapData[r];C&&(o=C[v],v>0&&C.length&&(f=C.indent,s=C[v-1]||C[C.length-1],n=n.substring(s)))}return void 0!==i&&this.$bidiHandler.isBidiRow(a+v,r,v)&&(t=this.$bidiHandler.offsetToCol(i)),s+=this.$getStringScreenWidth(n,t-f)[1],this.$useWrapMode&&s>=o&&(s=o-1),p?p.idxToPosition(s):{row:r,column:s}},e.prototype.documentToScreenPosition=function(e,t){if(void 0===t)var i=this.$clipPositionToDocument(e.row,e.column);else i=this.$clipPositionToDocument(e,t);e=i.row,t=i.column;var n,o=0,r=null;(n=this.getFoldAt(e,t,1))&&(e=n.start.row,t=n.start.column);var s,a=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,e),h=l.length;if(h&&c>=0){a=l[c],o=this.$screenRowCache[c];var d=e>l[h-1]}else d=!h;for(var u=this.getNextFoldLine(a),g=u?u.start.row:1/0;a<e;){if(a>=g){if((s=u.end.row+1)>e)break;g=(u=this.getNextFoldLine(s,u))?u.start.row:1/0}else s=a+1;o+=this.getRowLength(a),a=s,d&&(this.$docRowCache.push(a),this.$screenRowCache.push(o))}var p="";u&&a>=g?(p=this.getFoldDisplayLine(u,e,t),r=u.start.row):(p=this.getLine(e).substring(0,t),r=e);var m=0;if(this.$useWrapMode){var f=this.$wrapData[r];if(f){for(var v=0;p.length>=f[v];)o++,v++;p=p.substring(f[v-1]||0,p.length),m=v>0?f.indent:0}}return this.lineWidgets&&this.lineWidgets[a]&&this.lineWidgets[a].rowsAbove&&(o+=this.lineWidgets[a].rowsAbove),{row:o,column:m+this.$getStringScreenWidth(p)[0]}},e.prototype.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},e.prototype.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},e.prototype.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var i=this.$wrapData.length,n=0,o=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);n<i;){var r=this.$wrapData[n];e+=r?r.length+1:1,++n>o&&(n=t.end.row+1,o=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var s=this.$foldData,a=0;a<s.length;a++)e-=(t=s[a]).end.row-t.start.row}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},e.prototype.$setFontMetrics=function(e){this.$enableVarChar&&(this.$getStringScreenWidth=function(t,i,n){if(0===i)return[0,0];var o,r;for(i||(i=1/0),n=n||0,r=0;r<t.length&&!((n+="\t"===(o=t.charAt(r))?this.getScreenTabSize(n):e.getCharacterWidth(o))>i);r++);return[n,r]})},e.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},e}();m.$uid=0,m.prototype.$modes=s.$modes,m.prototype.getValue=m.prototype.toString,m.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},m.prototype.$overwrite=!1,m.prototype.$mode=null,m.prototype.$modeId=null,m.prototype.$scrollTop=0,m.prototype.$scrollLeft=0,m.prototype.$wrapLimit=80,m.prototype.$useWrapMode=!1,m.prototype.$wrapLimitRange={min:null,max:null},m.prototype.lineWidgets=null,m.prototype.isFullWidth=S,n.implement(m.prototype,a);var f=1,v=2,C=3,y=4,I=9,b=10,A=11,w=12;function S(e){return!(e<4352)&&(e>=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}e("./edit_session/folding").Folding.call(m.prototype),e("./edit_session/bracket_match").BracketMatch.call(m.prototype),s.defineOptions(m.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=m})),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,i){"use strict";var n=e("./lib/lang"),o=e("./lib/oop"),r=e("./range").Range,s=function(){function e(){this.$options={}}return e.prototype.set=function(e){return o.mixin(this.$options,e),this},e.prototype.getOptions=function(){return n.copyObject(this.$options)},e.prototype.setOptions=function(e){this.$options=e},e.prototype.find=function(e){var t=this.$options,i=this.$matchIterator(e,t);if(!i)return!1;var n=null;return i.forEach((function(e,i,o,s){return n=new r(e,i,o,s),!(i==s&&t.start&&t.start.start&&0!=t.skipCurrent&&n.isEqual(t.start)&&(n=null,1))})),n},e.prototype.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var i=t.range,o=i?e.getLines(i.start.row,i.end.row):e.doc.getAllLines(),s=[],a=t.re;if(t.$isMultiLine){var l,c=a.length,h=o.length-c;e:for(var d=a.offset||0;d<=h;d++){for(var u=0;u<c;u++)if(-1==o[d+u].search(a[u]))continue e;var g=o[d],p=o[d+c-1],m=g.length-g.match(a[0])[0].length,f=p.match(a[c-1])[0].length;l&&l.end.row===d&&l.end.column>m||(s.push(l=new r(d,m,d+c-1,f)),c>2&&(d=d+c-2))}}else for(var v=0;v<o.length;v++){var C=n.getMatchOffsets(o[v],a);for(u=0;u<C.length;u++){var y=C[u];s.push(new r(v,y.offset,v,y.offset+y.length))}}if(i){var I=i.start.column,b=i.end.column;for(v=0,u=s.length-1;v<u&&s[v].start.column<I&&0==s[v].start.row;)v++;for(var A=i.end.row-i.start.row;v<u&&s[u].end.column>b&&s[u].end.row==A;)u--;for(s=s.slice(v,u+1),v=0,u=s.length;v<u;v++)s[v].start.row+=i.start.row,s[v].end.row+=i.start.row}return s},e.prototype.replace=function(e,t){var i=this.$options,n=this.$assembleRegExp(i);if(i.$isMultiLine)return t;if(n){var o=n.exec(e);if(!o||o[0].length!=e.length)return null;if(i.regExp||(t=t.replace(/\$/g,"$$$$")),t=e.replace(n,t),i.preserveCase){t=t.split("");for(var r=Math.min(e.length,e.length);r--;){var s=e[r];s&&s.toLowerCase()!=s?t[r]=t[r].toUpperCase():t[r]=t[r].toLowerCase()}t=t.join("")}return t}},e.prototype.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var i=e.needle;if(!e.needle)return e.re=!1;e.regExp||(i=n.escapeRegExp(i));var o=e.caseSensitive?"gm":"gmi";try{new RegExp(i,"u"),e.$supportsUnicodeFlag=!0,o+="u"}catch(t){e.$supportsUnicodeFlag=!1}if(e.wholeWord&&(i=function(e,t){var i=n.supportsLookbehind();function o(e,n){return void 0===n&&(n=!0),(i&&t.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w")).test(e)||t.regExp?i&&t.$supportsUnicodeFlag?n?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var r=Array.from(e),s=r[0],a=r[r.length-1];return o(s)+e+o(a,!1)}(i,e)),e.$isMultiLine=!t&&/[\n\r]/.test(i),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(i,o);try{var r=new RegExp(i,o)}catch(e){r=!1}return e.re=r},e.prototype.$assembleMultilineRegExp=function(e,t){for(var i=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),n=[],o=0;o<i.length;o++)try{n.push(new RegExp(i[o],t))}catch(e){return!1}return n},e.prototype.$matchIterator=function(e,t){var i=this.$assembleRegExp(t);if(!i)return!1;var o=1==t.backwards,r=0!=t.skipCurrent,s=i.unicode,a=t.range,l=t.start;l||(l=a?a[o?"end":"start"]:e.selection.getRange()),l.start&&(l=l[r!=o?"end":"start"]);var c=a?a.start.row:0,h=a?a.end.row:e.getLength()-1;if(o)var d=function(e){var i=l.row;if(!g(i,l.column,e)){for(i--;i>=c;i--)if(g(i,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(i=h,c=l.row;i>=c;i--)if(g(i,Number.MAX_VALUE,e))return}};else d=function(e){var i=l.row;if(!g(i,l.column,e)){for(i+=1;i<=h;i++)if(g(i,0,e))return;if(0!=t.wrap)for(i=c,h=l.row;i<=h;i++)if(g(i,0,e))return}};if(t.$isMultiLine)var u=i.length,g=function(t,n,r){var s=o?t-u+1:t;if(!(s<0||s+u>e.getLength())){var a=e.getLine(s),l=a.search(i[0]);if(!(!o&&l<n||-1===l)){for(var c=1;c<u;c++)if(-1==(a=e.getLine(s+c)).search(i[c]))return;var h=a.match(i[u-1])[0].length;if(!(o&&h>n))return!!r(s,l,s+u-1,h)||void 0}}};else g=o?function(t,o,r){var a,l=e.getLine(t),c=[],h=0;for(i.lastIndex=0;a=i.exec(l);){var d=a[0].length;if(h=a.index,!d){if(h>=l.length)break;i.lastIndex=h+=n.skipEmptyMatch(l,h,s)}if(a.index+d>o)break;c.push(a.index,d)}for(var u=c.length-1;u>=0;u-=2){var g=c[u-1];if(r(t,g,t,g+(d=c[u])))return!0}}:function(t,o,r){var a,l,c=e.getLine(t);for(i.lastIndex=o;l=i.exec(c);){var h=l[0].length;if(r(t,a=l.index,t,a+h))return!0;if(!h&&(i.lastIndex=a+=n.skipEmptyMatch(c,a,s),a>=c.length))return!1}};return{forEach:d}},e}();t.Search=s})),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,i){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=e("../lib/keys"),s=e("../lib/useragent"),a=r.KEY_MODS,l=function(){function e(e,t){this.$init(e,t,!1)}return e.prototype.$init=function(e,t,i){this.platform=t||(s.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=i},e.prototype.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},e.prototype.removeCommand=function(e,t){var i=e&&("string"==typeof e?e:e.name);e=this.commands[i],t||delete this.commands[i];var n=this.commandKeyBinding;for(var o in n){var r=n[o];if(r==e)delete n[o];else if(Array.isArray(r)){var s=r.indexOf(e);-1!=s&&(r.splice(s,1),1==r.length&&(n[o]=r[0]))}}},e.prototype.bindKey=function(e,t,i){if("object"==typeof e&&e&&(null==i&&(i=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach((function(e){var n="";if(-1!=e.indexOf(" ")){var o=e.split(/\s+/);e=o.pop(),o.forEach((function(e){var t=this.parseKeys(e),i=a[t.hashId]+t.key;n+=(n?" ":"")+i,this._addCommandToBinding(n,"chainKeys")}),this),n+=" "}var r=this.parseKeys(e),s=a[r.hashId]+r.key;this._addCommandToBinding(n+s,t,i)}),this)},e.prototype._addCommandToBinding=function(e,t,i){var n,o=this.commandKeyBinding;if(t)if(!o[e]||this.$singleCommand)o[e]=t;else{Array.isArray(o[e])?-1!=(n=o[e].indexOf(t))&&o[e].splice(n,1):o[e]=[o[e]],"number"!=typeof i&&(i=c(t));var r=o[e];for(n=0;n<r.length&&!(c(r[n])>i);n++);r.splice(n,0,t)}else delete o[e]},e.prototype.addCommands=function(e){e&&Object.keys(e).forEach((function(t){var i=e[t];if(i){if("string"==typeof i)return this.bindKey(i,t);"function"==typeof i&&(i={exec:i}),"object"==typeof i&&(i.name||(i.name=t),this.addCommand(i))}}),this)},e.prototype.removeCommands=function(e){Object.keys(e).forEach((function(t){this.removeCommand(e[t])}),this)},e.prototype.bindKeys=function(e){Object.keys(e).forEach((function(t){this.bindKey(t,e[t])}),this)},e.prototype._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},e.prototype.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter((function(e){return e})),i=t.pop(),n=r[i];if(r.FUNCTION_KEYS[n])i=r.FUNCTION_KEYS[n].toLowerCase();else{if(!t.length)return{key:i,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:i.toUpperCase(),hashId:-1}}for(var o=0,s=t.length;s--;){var a=r.KEY_MODS[t[s]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[s]+" in "+e),!1;o|=a}return{key:i,hashId:o}},e.prototype.findKeyCommand=function(e,t){var i=a[e]+t;return this.commandKeyBinding[i]},e.prototype.handleKeyboard=function(e,t,i,n){if(!(n<0)){var o=a[t]+i,r=this.commandKeyBinding[o];return e.$keyChain&&(e.$keyChain+=" "+o,r=this.commandKeyBinding[e.$keyChain]||r),!r||"chainKeys"!=r&&"chainKeys"!=r[r.length-1]?(e.$keyChain&&(t&&4!=t||1!=i.length?(-1==t||n>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-o.length-1)),{command:r}):(e.$keyChain=e.$keyChain||o,{command:"null"})}},e.prototype.getStatusText=function(e,t){return t.$keyChain||""},e}();function c(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}var h=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.$singleCommand=!0,n}return o(t,e),t}(l);h.call=function(e,t,i){l.prototype.$init.call(e,t,i,!0)},l.call=function(e,t,i){l.prototype.$init.call(e,t,i,!1)},t.HashHandler=h,t.MultiHashHandler=l})),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],(function(e,t,i){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=e("../lib/oop"),s=e("../keyboard/hash_handler").MultiHashHandler,a=e("../lib/event_emitter").EventEmitter,l=function(e){function t(t,i){var n=e.call(this,i,t)||this;return n.byName=n.commands,n.setDefaultHandler("exec",(function(e){return e.args?e.command.exec(e.editor,e.args,e.event,!1):e.command.exec(e.editor,{},e.event,!0)})),n}return o(t,e),t.prototype.exec=function(e,t,i){if(Array.isArray(e)){for(var n=e.length;n--;)if(this.exec(e[n],t,i))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var o={editor:t,command:e,args:i};return o.returnValue=this._emit("exec",o),this._signal("afterExec",o),!1!==o.returnValue},t.prototype.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},t.prototype.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach((function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])}),this)}finally{this.$inReplay=!1}}},t.prototype.trimMacro=function(e){return e.map((function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e}))},t}(s);r.implement(l.prototype,a),t.CommandManager=l})),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],(function(e,t,i){"use strict";var n=e("../lib/lang"),o=e("../config"),r=e("../range").Range;function s(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:s("Ctrl-,","Command-,"),exec:function(e){o.loadModule("ace/ext/settings_menu",(function(t){t.init(e),e.showSettingsMenu()}))},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:s("Alt-E","F4"),exec:function(e){o.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,1)}))},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:s("Alt-Shift-E","Shift-F4"),exec:function(e){o.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,-1)}))},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:s("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:s(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:s("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:s("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:s("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:s("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:s("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:s("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:s("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:s("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:s("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:s("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:s("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:s("Ctrl-F","Command-F"),exec:function(e){o.loadModule("ace/ext/searchbox",(function(t){t.Search(e)}))},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:s("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:s("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:s("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:s("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:s("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:s("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:s("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:s("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:s("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:s("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:s("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:s("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:s("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:s("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:s("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:s("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:s("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:s("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:s("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:s("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:s(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:s("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:s(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:s("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:s("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:s("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:s("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:s("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:s("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:s("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:s(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:s("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:s("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:s("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:s("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:s("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:s("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:s("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:s("Ctrl-H","Command-Option-F"),exec:function(e){o.loadModule("ace/ext/searchbox",(function(t){t.Search(e,!0)}))}},{name:"undo",description:"Undo",bindKey:s("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:s("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:s("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:s("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:s("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:s("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:s("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:s("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:s("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:s("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:s("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:s("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:s("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:s("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:s("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:s("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:s("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:s("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:s("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(n.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:s(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:s("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:s("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:s("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:s(null,null),exec:function(e){e.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:s("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:s("Ctrl+F3","F3"),exec:function(e){e.openLink()}},{name:"joinlines",description:"Join lines",bindKey:s(null,null),exec:function(e){for(var t=e.selection.isBackwards(),i=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),o=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),s=e.session.doc.getLine(i.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(i.row),c=i.row+1;c<=o.row+1;c++){var h=n.stringTrimLeft(n.stringTrimRight(e.session.doc.getLine(c)));0!==h.length&&(h=" "+h),l+=h}o.row+1<e.session.doc.getLength()-1&&(l+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new r(i.row,0,o.row+2,0),l),a>0?(e.selection.moveCursorTo(i.row,i.column),e.selection.selectTo(i.row,i.column+a)):(s=e.session.doc.getLine(i.row).length>s?s+1:s,e.selection.moveCursorTo(i.row,s))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:s(null,null),exec:function(e){var t=e.session.doc.getLength()-1,i=e.session.doc.getLine(t).length,n=e.selection.rangeList.ranges,o=[];n.length<1&&(n=[e.selection.getRange()]);for(var s=0;s<n.length;s++)s==n.length-1&&(n[s].end.row===t&&n[s].end.column===i||o.push(new r(n[s].end.row,n[s].end.column,t,i))),0===s?0===n[s].start.row&&0===n[s].start.column||o.push(new r(0,0,n[s].start.row,n[s].start.column)):o.push(new r(n[s-1].end.row,n[s-1].end.column,n[s].start.row,n[s].start.column));for(e.exitMultiSelectMode(),e.clearSelection(),s=0;s<o.length;s++)e.selection.addRange(o[s],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(e){e.selection.clearSelection(),e.navigateLineEnd(),e.insert("\n")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(e){e.selection.clearSelection();var t=e.getCursorPosition();e.selection.moveTo(t.row-1,Number.MAX_VALUE),e.insert("\n"),0===t.row&&e.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(e){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),e.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:s("F1","F1"),exec:function(e){e.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:s(null,null),exec:function(e){e.prompt({$type:"modes"})},readOnly:!0}];for(var a=1;a<9;a++)t.commands.push({name:"foldToLevel"+a,description:"Fold To Level "+a,level:a,exec:function(e){e.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})})),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("./lib/dom"),o=function(){function e(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}return e.prototype.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},e.prototype.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach((function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)})),e},e.prototype.$onChangeEditor=function(e){this.attach(e.editor)},e.prototype.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},e.prototype.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var i=this.session.lineWidgets;i&&i.forEach((function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))}))}},e.prototype.updateOnFold=function(e,t){var i=t.lineWidgets;if(i&&e.action){for(var n=e.data,o=n.start.row,r=n.end.row,s="add"==e.action,a=o+1;a<r;a++)i[a]&&(i[a].hidden=s);i[r]&&(s?i[o]?i[r].hidden=s:i[o]=i[r]:(i[o]==i[r]&&(i[o]=void 0),i[r].hidden=s))}},e.prototype.updateOnChange=function(e){var t=this.session.lineWidgets;if(t){var i=e.start.row,n=e.end.row-i;if(0===n);else if("remove"==e.action){var o=t.splice(i+1,n);!t[i]&&o[o.length-1]&&(t[i]=o.pop()),o.forEach((function(e){e&&this.removeLineWidget(e)}),this),this.$updateRows()}else{var r=new Array(n);t[i]&&null!=t[i].column&&e.start.column>t[i].column&&i++,r.unshift(i,0),t.splice.apply(t,r),this.$updateRows()}}},e.prototype.$updateRows=function(){var e=this.session.lineWidgets;if(e){var t=!0;e.forEach((function(e,i){if(e)for(t=!1,e.row=i;e.$oldWidget;)e.$oldWidget.row=i,e=e.$oldWidget})),t&&(this.session.lineWidgets=null)}},e.prototype.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e},e.prototype.addLineWidget=function(e){if(this.$registerLineWidget(e),e.session=this.session,!this.editor)return e;var t=this.editor.renderer;e.html&&!e.el&&(e.el=n.createElement("div"),e.el.innerHTML=e.html),e.text&&!e.el&&(e.el=n.createElement("div"),e.el.textContent=e.text),e.el&&(n.addCssClass(e.el,"ace_lineWidgetContainer"),e.className&&n.addCssClass(e.el,e.className),e.el.style.position="absolute",e.el.style.zIndex="5",t.container.appendChild(e.el),e._inDocument=!0,e.coverGutter||(e.el.style.zIndex="3"),null==e.pixelHeight&&(e.pixelHeight=e.el.offsetHeight)),null==e.rowCount&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight);var i=this.session.getFoldAt(e.row,0);if(e.$fold=i,i){var o=this.session.lineWidgets;e.row!=i.end.row||o[i.start.row]?e.hidden=!0:o[i.start.row]=e}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e),e},e.prototype.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},e.prototype.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,i=t&&t[e],n=[];i;)n.push(i),i=i.$oldWidget;return n},e.prototype.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},e.prototype.measureWidgets=function(e,t){var i=this.session._changedWidgets,n=t.layerConfig;if(i&&i.length){for(var o=1/0,r=0;r<i.length;r++){var s=i[r];if(s&&s.el&&s.session==this.session){if(!s._inDocument){if(this.session.lineWidgets[s.row]!=s)continue;s._inDocument=!0,t.container.appendChild(s.el)}s.h=s.el.offsetHeight,s.fixedWidth||(s.w=s.el.offsetWidth,s.screenWidth=Math.ceil(s.w/n.characterWidth));var a=s.h/n.lineHeight;s.coverLine&&(a-=this.session.getRowLineCount(s.row))<0&&(a=0),s.rowCount!=a&&(s.rowCount=a,s.row<o&&(o=s.row))}}o!=1/0&&(this.session._emit("changeFold",{data:{start:{row:o}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},e.prototype.renderWidgets=function(e,t){var i=t.layerConfig,n=this.session.lineWidgets;if(n){for(var o=Math.min(this.firstRow,i.firstRow),r=Math.max(this.lastRow,i.lastRow,n.length);o>0&&!n[o];)o--;this.firstRow=i.firstRow,this.lastRow=i.lastRow,t.$cursorLayer.config=i;for(var s=o;s<=r;s++){var a=n[s];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:s,column:0},!0).top;a.coverLine||(l+=i.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-i.offset+"px";var c=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(c-=t.scrollLeft),a.el.style.left=c+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=i.width+2*i.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}},e}();t.LineWidgets=o})),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],(function(e,t,i){"use strict";var n=e("../lib/keys"),o=e("../mouse/default_gutter_handler").GutterTooltip,r=function(){function e(e){this.editor=e,this.gutterLayer=e.renderer.$gutterLayer,this.element=e.renderer.$gutter,this.lines=e.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new o(this.editor)}return e.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this))},e.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this))},e.prototype.$onGutterKeyDown=function(e){if(this.annotationTooltip.isOpen)return e.preventDefault(),void(e.keyCode===n.escape&&this.annotationTooltip.hideTooltip());if(e.target===this.element){if(e.keyCode!=n.enter)return;e.preventDefault();var t=this.editor.getCursorPosition().row;return this.editor.isRowVisible(t)||this.editor.scrollToLine(t,!0,!0),void setTimeout(function(){var e=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),t=this.$findNearestFoldWidget(e),i=this.$findNearestAnnotation(e);if(null!==t||null!==i)return null===t&&null!==i?(this.activeRowIndex=i,this.activeLane="annotation",void this.$focusAnnotation(this.activeRowIndex)):null!==t&&null===i?(this.activeRowIndex=t,this.activeLane="fold",void this.$focusFoldWidget(this.activeRowIndex)):Math.abs(i-e)<Math.abs(t-e)?(this.activeRowIndex=i,this.activeLane="annotation",void this.$focusAnnotation(this.activeRowIndex)):(this.activeRowIndex=t,this.activeLane="fold",void this.$focusFoldWidget(this.activeRowIndex))}.bind(this),10)}this.$handleGutterKeyboardInteraction(e),setTimeout(function(){this.editor._signal("gutterkeydown",new s(e,this))}.bind(this),10)},e.prototype.$handleGutterKeyboardInteraction=function(e){if(e.keyCode!==n.tab){if(e.keyCode===n.escape)return e.preventDefault(),this.$blurGutter(),this.element.focus(),void(this.lane=null);if(e.keyCode!==n.up)if(e.keyCode!==n.down){if(e.keyCode===n.left)return e.preventDefault(),void this.$switchLane("annotation");if(e.keyCode===n.right)return e.preventDefault(),void this.$switchLane("fold");if(e.keyCode!==n.enter&&e.keyCode!==n.space);else switch(e.preventDefault(),this.activeLane){case"fold":if("start"===this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]){var t=this.$rowIndexToRow(this.activeRowIndex);this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),e),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==t&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(t),this.$focusFoldWidget(this.activeRowIndex))}.bind(this),10);break}if("end"===this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)])break;return;case"annotation":var i=this.lines.cells[this.activeRowIndex].element.childNodes[2].getBoundingClientRect(),o=this.annotationTooltip.getElement().style;o.left=i.right+"px",o.top=i.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex))}}else switch(e.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown()}else switch(e.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp()}}else e.preventDefault()},e.prototype.$blurGutter=function(){if(null!==this.activeRowIndex)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex)}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip()},e.prototype.$isFoldWidgetVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e)),i="none"!==this.$getFoldWidget(e).style.display;return t&&i},e.prototype.$isAnnotationVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e)),i="none"!==this.$getAnnotation(e).style.display;return t&&i},e.prototype.$getFoldWidget=function(e){return this.lines.get(e).element.childNodes[1]},e.prototype.$getAnnotation=function(e){return this.lines.get(e).element.childNodes[2]},e.prototype.$findNearestFoldWidget=function(e){if(this.$isFoldWidgetVisible(e))return e;for(var t=0;e-t>0||e+t<this.lines.getLength()-1;){if(e-++t>=0&&this.$isFoldWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(e+t))return e+t}return null},e.prototype.$findNearestAnnotation=function(e){if(this.$isAnnotationVisible(e))return e;for(var t=0;e-t>0||e+t<this.lines.getLength()-1;){if(e-++t>=0&&this.$isAnnotationVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isAnnotationVisible(e+t))return e+t}return null},e.prototype.$focusFoldWidget=function(e){if(null!=e){var t=this.$getFoldWidget(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},e.prototype.$focusAnnotation=function(e){if(null!=e){var t=this.$getAnnotation(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},e.prototype.$blurFoldWidget=function(e){var t=this.$getFoldWidget(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},e.prototype.$blurAnnotation=function(e){var t=this.$getAnnotation(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},e.prototype.$moveFoldWidgetUp=function(){for(var e=this.activeRowIndex;e>0;)if(e--,this.$isFoldWidgetVisible(e))return this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=e,void this.$focusFoldWidget(this.activeRowIndex)},e.prototype.$moveFoldWidgetDown=function(){for(var e=this.activeRowIndex;e<this.lines.getLength()-1;)if(e++,this.$isFoldWidgetVisible(e))return this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=e,void this.$focusFoldWidget(this.activeRowIndex)},e.prototype.$moveAnnotationUp=function(){for(var e=this.activeRowIndex;e>0;)if(e--,this.$isAnnotationVisible(e))return this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,void this.$focusAnnotation(this.activeRowIndex)},e.prototype.$moveAnnotationDown=function(){for(var e=this.activeRowIndex;e<this.lines.getLength()-1;)if(e++,this.$isAnnotationVisible(e))return this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,void this.$focusAnnotation(this.activeRowIndex)},e.prototype.$switchLane=function(e){switch(e){case"annotation":if("annotation"===this.activeLane)break;var t=this.$findNearestAnnotation(this.activeRowIndex);if(null==t)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=t,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if("fold"===this.activeLane)break;var i=this.$findNearestFoldWidget(this.activeRowIndex);if(null==i)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=i,this.$focusFoldWidget(this.activeRowIndex)}},e.prototype.$rowIndexToRow=function(e){var t=this.lines.get(e);return t?t.row:null},e.prototype.$rowToRowIndex=function(e){for(var t=0;t<this.lines.getLength();t++)if(this.lines.get(t).row==e)return t;return null},e}();t.GutterKeyboardHandler=r;var s=function(){function e(e,t){this.gutterKeyboardHandler=t,this.domEvent=e}return e.prototype.getKey=function(){return n.keyCodeToString(this.domEvent.keyCode)},e.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},e.prototype.isInAnnotationLane=function(){return"annotation"===this.gutterKeyboardHandler.activeLane},e.prototype.isInFoldLane=function(){return"fold"===this.gutterKeyboardHandler.activeLane},e}();t.GutterKeyboardEvent=s})),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/line_widgets","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"],(function(e,t,i){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=e("./lib/oop"),r=e("./lib/dom"),s=e("./lib/lang"),a=e("./lib/useragent"),l=e("./keyboard/textinput").TextInput,c=e("./mouse/mouse_handler").MouseHandler,h=e("./mouse/fold_handler").FoldHandler,d=e("./keyboard/keybinding").KeyBinding,u=e("./edit_session").EditSession,g=e("./search").Search,p=e("./range").Range,m=e("./lib/event_emitter").EventEmitter,f=e("./commands/command_manager").CommandManager,v=e("./commands/default_commands").commands,C=e("./config"),y=e("./token_iterator").TokenIterator,I=e("./line_widgets").LineWidgets,b=e("./keyboard/gutter_handler").GutterKeyboardHandler,A=e("./config").nls,w=e("./clipboard"),S=e("./lib/keys"),x=function(){function e(t,i,n){this.session,this.$toDestroy=[];var o=t.getContainerElement();this.container=o,this.renderer=t,this.id="editor"+ ++e.$uid,this.commands=new f(a.isMac?"mac":"win",v),"object"==typeof document&&(this.textInput=new l(t.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new c(this),new h(this)),this.keyBinding=new d(this),this.$search=(new g).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=s.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",(function(e,t){t._$emitInputEvent.schedule(31)})),this.setSession(i||n&&n.session||new u("")),C.resetOptions(this),n&&this.setOptions(n),C._signal("editor",this)}return e.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=s.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},e.prototype.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||(this.previousCommand=null,e={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:e.command||{},args:e.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},e.prototype.endOperation=function(e){if(this.curOp&&this.session){if(e&&!1===e.returnValue||!this.session)return this.curOp=null;if(1==e&&this.curOp.command&&"mouse"==this.curOp.command.name)return;if(this._signal("beforeEndOperation"),!this.curOp)return;var t=this.curOp.command,i=t&&t.scrollIntoView;if(i){switch(i){case"center-animate":i="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var n=this.selection.getRange(),o=this.renderer.layerConfig;(n.start.row>=o.lastRow||n.end.row<=o.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==i&&this.renderer.animateScrolling(this.curOp.scrollTop)}var r=this.selection.toJSON();this.curOp.selectionAfter=r,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(r),this.prevOp=this.curOp,this.curOp=null}},e.prototype.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,i=this.$mergeableCommands,n=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var o=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\s/.test(o)||/\s/.test(t.args)),this.mergeNextCommand=!0}else n=n&&-1!==i.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(n=!1),n?this.session.mergeUndoDeltas=!0:-1!==i.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},e.prototype.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var i=this;C.loadModule(["keybinding",e],(function(n){i.$keybindingId==e&&i.keyBinding.setKeyboardHandler(n&&n.handler),t&&t()}))}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},e.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},e.prototype.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var i=this.session.getSelection();i.off("changeCursor",this.$onCursorChange),i.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&!e.destroyed&&e.bgTokenizer.scheduleStart()}},e.prototype.getSession=function(){return this.session},e.prototype.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},e.prototype.getValue=function(){return this.session.getValue()},e.prototype.getSelection=function(){return this.selection},e.prototype.resize=function(e){this.renderer.onResize(e)},e.prototype.setTheme=function(e,t){this.renderer.setTheme(e,t)},e.prototype.getTheme=function(){return this.renderer.getTheme()},e.prototype.setStyle=function(e){this.renderer.setStyle(e)},e.prototype.unsetStyle=function(e){this.renderer.unsetStyle(e)},e.prototype.getFontSize=function(){return this.getOption("fontSize")||r.computedStyle(this.container).fontSize},e.prototype.setFontSize=function(e){this.setOption("fontSize",e)},e.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout((function(){e.$highlightPending=!1;var t=e.session;if(t&&!t.destroyed){t.$bracketHighlight&&(t.$bracketHighlight.markerIds.forEach((function(e){t.removeMarker(e)})),t.$bracketHighlight=null);var i=e.getCursorPosition(),n=e.getKeyboardHandler(),o=n&&n.$getDirectionForHighlight&&n.$getDirectionForHighlight(e),r=t.getMatchingBracketRanges(i,o);if(!r){var s=new y(t,i.row,i.column).getCurrentToken();if(s&&/\b(?:tag-open|tag-name)/.test(s.type)){var a=t.getMatchingTags(i);a&&(r=[a.openTagName,a.closeTagName])}}if(!r&&t.$mode.getMatching&&(r=t.$mode.getMatching(e.session)),r){var l="ace_bracket";Array.isArray(r)?1==r.length&&(l="ace_error_bracket"):r=[r],2==r.length&&(0==p.comparePoints(r[0].end,r[1].start)?r=[p.fromPoints(r[0].start,r[1].end)]:0==p.comparePoints(r[0].start,r[1].end)&&(r=[p.fromPoints(r[1].start,r[0].end)])),t.$bracketHighlight={ranges:r,markerIds:r.map((function(e){return t.addMarker(e,l,"text")}))},e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide()}else e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide()}}),50)}},e.prototype.focus=function(){this.textInput.focus()},e.prototype.isFocused=function(){return this.textInput.isFocused()},e.prototype.blur=function(){this.textInput.blur()},e.prototype.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},e.prototype.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e))},e.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},e.prototype.onDocumentChange=function(e){var t=this.session.$useWrapMode,i=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,i,t),this._signal("change",e),this.$cursorChange()},e.prototype.onTokenizerUpdate=function(e){var t=e.data;this.renderer.updateLines(t.first,t.last)},e.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},e.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},e.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},e.prototype.$updateHighlightActiveLine=function(){var e,t=this.getSession();if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(e=!1),!this.renderer.$maxLines||1!==this.session.getLength()||this.renderer.$minLines>1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var i=new p(e.row,e.column,e.row,1/0);i.id=t.addMarker(i,"ace_active-line","screenLine"),t.$highlightLineMarker=i}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},e.prototype.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var i=this.selection.getRange(),n=this.getSelectionStyle();t.$selectionMarker=t.addMarker(i,"ace_selection",n)}var o=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(o),this._signal("changeSelection")},e.prototype.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var i=t.start.column,n=t.end.column,o=e.getLine(t.start.row),r=o.substring(i,n);if(!(r.length>5e3)&&/[\w\d]/.test(r)){var s=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:r}),a=o.substring(i-1,n+1);if(s.test(a))return s}}},e.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},e.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},e.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},e.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},e.prototype.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},e.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},e.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},e.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},e.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},e.prototype.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),i=!1;if(!e&&this.$copyWithEmptySelection){i=!0;for(var n=this.selection.getAllRanges(),o=0;o<n.length;o++){var r=n[o];o&&n[o-1].start.row==r.start.row||(e+=this.session.getLine(r.start.row)+t)}}var s={text:e};return this._signal("copy",s),w.lineMode=!!i&&s.text,s.text},e.prototype.onCopy=function(){this.commands.exec("copy",this)},e.prototype.onCut=function(){this.commands.exec("cut",this)},e.prototype.onPaste=function(e,t){var i={text:e,event:t};this.commands.exec("paste",this,i)},e.prototype.$handlePaste=function(e){"string"==typeof e&&(e={text:e}),this._signal("paste",e);var t=e.text,i=t===w.lineMode,n=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)i?n.insert({row:this.selection.lead.row,column:0},t):this.insert(t);else if(i)this.selection.rangeList.ranges.forEach((function(e){n.insert({row:e.start.row,column:0},t)}));else{var o=t.split(/\r\n|\r|\n/),r=this.selection.rangeList.ranges,s=!(2!=o.length||o[0]&&o[1]);if(o.length!=r.length||s)return this.commands.exec("insertstring",this,t);for(var a=r.length;a--;){var l=r[a];l.isEmpty()||n.remove(l),n.insert(l.start,o[a])}}},e.prototype.execCommand=function(e,t){return this.commands.exec(e,this,t)},e.prototype.insert=function(e,t){var i=this.session,n=i.getMode(),o=this.getCursorPosition();if(this.getBehavioursEnabled()&&!t){var r=n.transformAction(i.getState(o.row),"insertion",this,i,e);r&&(e!==r.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),e=r.text)}if("\t"==e&&(e=this.session.getTabString()),this.selection.isEmpty())this.session.getOverwrite()&&-1==e.indexOf("\n")&&((s=p.fromPoints(o,o)).end.column+=e.length,this.session.remove(s));else{var s=this.getSelectionRange();o=this.session.remove(s),this.clearSelection()}if("\n"==e||"\r\n"==e){var a=i.getLine(o.row);if(o.column>a.search(/\S|$/)){var l=a.substr(o.column).search(/\S|$/);i.doc.removeInLine(o.row,o.column,o.column+l)}}this.clearSelection();var c=o.column,h=i.getState(o.row),d=(a=i.getLine(o.row),n.checkOutdent(h,a,e));if(i.insert(o,e),r&&r.selection&&(2==r.selection.length?this.selection.setSelectionRange(new p(o.row,c+r.selection[0],o.row,c+r.selection[1])):this.selection.setSelectionRange(new p(o.row+r.selection[0],r.selection[1],o.row+r.selection[2],r.selection[3]))),this.$enableAutoIndent){if(i.getDocument().isNewLine(e)){var u=n.getNextLineIndent(h,a.slice(0,o.column),i.getTabString());i.insert({row:o.row+1,column:0},u)}d&&n.autoOutdent(h,i,o.row)}},e.prototype.autoIndent=function(){for(var e=this.session,t=e.getMode(),i=this.selection.isEmpty()?[new p(0,0,e.doc.getLength()-1,0)]:this.selection.getAllRanges(),n="",o="",r="",s=e.getTabString(),a=0;a<i.length;a++)for(var l=i[a].start.row,c=i[a].end.row,h=l;h<=c;h++){h>0&&(n=e.getState(h-1),o=e.getLine(h-1),r=t.getNextLineIndent(n,o,s));var d=e.getLine(h),u=t.$getIndent(d);if(r!==u){if(u.length>0){var g=new p(h,0,h,u.length);e.remove(g)}r.length>0&&e.insert({row:h,column:0},r)}t.autoOutdent(n,e,h)}},e.prototype.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var i=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(i):i(),this.endOperation()},e.prototype.applyComposition=function(e,t){var i;(t.extendLeft||t.extendRight)&&((i=this.selection.getRange()).start.column-=t.extendLeft,i.end.column+=t.extendRight,i.start.column<0&&(i.start.row--,i.start.column+=this.session.getLine(i.start.row).length+1),this.selection.setRange(i),e||i.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((i=this.selection.getRange()).start.column-=t.restoreStart,i.end.column-=t.restoreEnd,this.selection.setRange(i))},e.prototype.onCommandKey=function(e,t,i){return this.keyBinding.onCommandKey(e,t,i)},e.prototype.setOverwrite=function(e){this.session.setOverwrite(e)},e.prototype.getOverwrite=function(){return this.session.getOverwrite()},e.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},e.prototype.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},e.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},e.prototype.setDragDelay=function(e){this.setOption("dragDelay",e)},e.prototype.getDragDelay=function(){return this.getOption("dragDelay")},e.prototype.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},e.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},e.prototype.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},e.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},e.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},e.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},e.prototype.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},e.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},e.prototype.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},e.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},e.prototype.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},e.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},e.prototype.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},e.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},e.prototype.setHighlightIndentGuides=function(e){this.renderer.setHighlightIndentGuides(e)},e.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},e.prototype.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},e.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},e.prototype.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},e.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},e.prototype.setReadOnly=function(e){this.setOption("readOnly",e)},e.prototype.getReadOnly=function(){return this.getOption("readOnly")},e.prototype.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},e.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},e.prototype.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},e.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},e.prototype.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},e.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},e.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},e.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},e.prototype.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var i=this.session,n=i.getState(t.start.row),o=i.getMode().transformAction(n,"deletion",this,i,t);if(0===t.end.column){var r=i.getTextRange(t);if("\n"==r[r.length-1]){var s=i.getLine(t.end.row);/^\s+$/.test(s)&&(t.end.column=s.length)}}o&&(t=o)}this.session.remove(t),this.clearSelection()},e.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},e.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},e.prototype.setGhostText=function(e,t){this.session.widgetManager||(this.session.widgetManager=new I(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(e,t)},e.prototype.removeGhostText=function(){this.session.widgetManager&&this.renderer.removeGhostText()},e.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var i,n,o=this.session.getLine(e.row);t<o.length?(i=o.charAt(t)+o.charAt(t-1),n=new p(e.row,t-1,e.row,t+1)):(i=o.charAt(t-1)+o.charAt(t-2),n=new p(e.row,t-2,e.row,t)),this.session.replace(n,i),this.session.selection.moveToPosition(n.end)}}},e.prototype.toLowerCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),i=this.session.getTextRange(t);this.session.replace(t,i.toLowerCase()),this.selection.setSelectionRange(e)},e.prototype.toUpperCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),i=this.session.getTextRange(t);this.session.replace(t,i.toUpperCase()),this.selection.setSelectionRange(e)},e.prototype.indent=function(){var e=this.session,t=this.getSelectionRange();if(!(t.start.row<t.end.row)){if(t.start.column<t.end.column){var i=e.getTextRange(t);if(!/^\s+$/.test(i))return h=this.$getSelectedRows(),void e.indentRows(h.first,h.last,"\t")}var n=e.getLine(t.start.row),o=t.start,r=e.getTabSize(),a=e.documentToScreenColumn(o.row,o.column);if(this.session.getUseSoftTabs())var l=r-a%r,c=s.stringRepeat(" ",l);else{for(l=a%r;" "==n[t.start.column-1]&&l;)t.start.column--,l--;this.selection.setSelectionRange(t),c="\t"}return this.insert(c)}var h=this.$getSelectedRows();e.indentRows(h.first,h.last,"\t")},e.prototype.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,"\t")},e.prototype.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},e.prototype.sortLines=function(){for(var e=this.$getSelectedRows(),t=this.session,i=[],n=e.first;n<=e.last;n++)i.push(t.getLine(n));i.sort((function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0}));var o=new p(0,0,0,0);for(n=e.first;n<=e.last;n++){var r=t.getLine(n);o.start.row=n,o.end.row=n,o.end.column=r.length,t.replace(o,i[n-e.first])}},e.prototype.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},e.prototype.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),i=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,i,e)},e.prototype.getNumberAt=function(e,t){var i=/[\-]?[0-9]+(?:\.[0-9]+)?/g;i.lastIndex=0;for(var n=this.session.getLine(e);i.lastIndex<t;){var o=i.exec(n);if(o.index<=t&&o.index+o[0].length>=t)return{value:o[0],start:o.index,end:o.index+o[0].length}}return null},e.prototype.modifyNumber=function(e){var t=this.selection.getCursor().row,i=this.selection.getCursor().column,n=new p(t,i-1,t,i),o=this.session.getTextRange(n);if(!isNaN(parseFloat(o))&&isFinite(o)){var r=this.getNumberAt(t,i);if(r){var s=r.value.indexOf(".")>=0?r.start+r.value.indexOf(".")+1:r.end,a=r.start+r.value.length-s,l=parseFloat(r.value);l*=Math.pow(10,a),s!==r.end&&i<s?e*=Math.pow(10,r.end-i-1):e*=Math.pow(10,r.end-i),l+=e;var c=(l/=Math.pow(10,a)).toFixed(a),h=new p(t,r.start,t,r.end);this.session.replace(h,c),this.moveCursorTo(t,Math.max(r.start+1,i+c.length-r.value.length))}}else this.toggleWord()},e.prototype.toggleWord=function(){var e=this.selection.getCursor().row,t=this.selection.getCursor().column;this.selection.selectWord();var i=this.getSelectedText(),n=this.selection.getWordRange().start.column,o=i.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),r=t-n-1;r<0&&(r=0);var a=0,l=0,c=this;i.match(/[A-Za-z0-9_]+/)&&o.forEach((function(t,o){l=a+t.length,r>=a&&r<=l&&(i=t,c.selection.clearSelection(),c.moveCursorTo(e,a+n),c.selection.selectTo(e,l+n)),a=l}));for(var h,d=this.$toggleWordPairs,u=0;u<d.length;u++)for(var g=d[u],p=0;p<=1;p++){var m=+!p,f=i.match(new RegExp("^\\s?_?("+s.escapeRegExp(g[p])+")\\s?$","i"));f&&i.match(new RegExp("([_]|^|\\s)("+s.escapeRegExp(f[1])+")($|\\s)","g"))&&(h=i.replace(new RegExp(s.escapeRegExp(g[p]),"i"),(function(e){var t=g[m];return e.toUpperCase()==e?t=t.toUpperCase():e.charAt(0).toUpperCase()==e.charAt(0)&&(t=t.substr(0,0)+g[m].charAt(0).toUpperCase()+t.substr(1)),t})),this.insert(h),h="")}},e.prototype.findLinkAt=function(e,t){var i,o,r=this.session.getLine(e).split(/((?:https?|ftp):\/\/[\S]+)/),s=t;s<0&&(s=0);var a,l=0,c=0;try{for(var h=n(r),d=h.next();!d.done;d=h.next()){var u=d.value;if(c=l+u.length,s>=l&&s<=c&&u.match(/((?:https?|ftp):\/\/[\S]+)/)){a=u.replace(/[\s:.,'";}\]]+$/,"");break}l=c}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}return a},e.prototype.openLink=function(){var e=this.selection.getCursor(),t=this.findLinkAt(e.row,e.column);return t&&window.open(t,"_blank"),null!=t},e.prototype.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},e.prototype.duplicateSelection=function(){var e=this.selection,t=this.session,i=e.getRange(),n=e.isBackwards();if(i.isEmpty()){var o=i.start.row;t.duplicateLines(o,o)}else{var r=n?i.start:i.end,s=t.insert(r,t.getTextRange(i));i.start=r,i.end=s,e.setSelectionRange(i,n)}},e.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},e.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},e.prototype.moveText=function(e,t,i){return this.session.moveText(e,t,i)},e.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},e.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},e.prototype.$moveLines=function(e,t){var i,n,o=this.selection;if(!o.inMultiSelectMode||this.inVirtualSelectionMode){var r=o.toOrientedRange();i=this.$getSelectedRows(r),n=this.session.$moveLines(i.first,i.last,t?0:e),t&&-1==e&&(n=0),r.moveBy(n,0),o.fromOrientedRange(r)}else{var s=o.rangeList.ranges;o.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var a=0,l=0,c=s.length,h=0;h<c;h++){var d=h;s[h].moveBy(a,0);for(var u=(i=this.$getSelectedRows(s[h])).first,g=i.last;++h<c;){l&&s[h].moveBy(l,0);var p=this.$getSelectedRows(s[h]);if(t&&p.first!=g)break;if(!t&&p.first>g+1)break;g=p.last}for(h--,a=this.session.$moveLines(u,g,t?0:e),t&&-1==e&&(d=h+1);d<=h;)s[d].moveBy(a,0),d++;t||(a=0),l+=a}o.fromOrientedRange(o.ranges[0]),o.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},e.prototype.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},e.prototype.onCompositionStart=function(e){this.renderer.showComposition(e)},e.prototype.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},e.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},e.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},e.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},e.prototype.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},e.prototype.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},e.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},e.prototype.$moveByPage=function(e,t){var i=this.renderer,n=this.renderer.layerConfig,o=e*Math.floor(n.height/n.lineHeight);!0===t?this.selection.$moveSelection((function(){this.moveCursorBy(o,0)})):!1===t&&(this.selection.moveCursorBy(o,0),this.selection.clearSelection());var r=i.scrollTop;i.scrollBy(0,o*n.lineHeight),null!=t&&i.scrollCursorIntoView(null,.5),i.animateScrolling(r)},e.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},e.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},e.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},e.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},e.prototype.scrollPageDown=function(){this.$moveByPage(1)},e.prototype.scrollPageUp=function(){this.$moveByPage(-1)},e.prototype.scrollToRow=function(e){this.renderer.scrollToRow(e)},e.prototype.scrollToLine=function(e,t,i,n){this.renderer.scrollToLine(e,t,i,n)},e.prototype.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},e.prototype.getCursorPosition=function(){return this.selection.getCursor()},e.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},e.prototype.getSelectionRange=function(){return this.selection.getRange()},e.prototype.selectAll=function(){this.selection.selectAll()},e.prototype.clearSelection=function(){this.selection.clearSelection()},e.prototype.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},e.prototype.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},e.prototype.jumpToMatching=function(e,t){var i=this.getCursorPosition(),n=new y(this.session,i.row,i.column),o=n.getCurrentToken(),r=0;o&&-1!==o.type.indexOf("tag-name")&&(o=n.stepBackward());var s=o||n.stepForward();if(s){var a,l,c=!1,h={},d=i.column-s.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;d<s.value.length&&!c;d++)if(u[s.value[d]])switch(l=u[s.value[d]]+"."+s.type.replace("rparen","lparen"),isNaN(h[l])&&(h[l]=0),s.value[d]){case"(":case"[":case"{":h[l]++;break;case")":case"]":case"}":h[l]--,-1===h[l]&&(a="bracket",c=!0)}}else-1!==s.type.indexOf("tag-name")&&(isNaN(h[s.value])&&(h[s.value]=0),"<"===o.value&&r>1?h[s.value]++:"</"===o.value&&h[s.value]--,-1===h[s.value]&&(a="tag",c=!0));c||(o=s,r++,s=n.stepForward(),d=0)}while(s&&!c);if(a){var g,m;if("bracket"===a)(g=this.session.getBracketRange(i))||(m=(g=new p(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+d-1,n.getCurrentTokenRow(),n.getCurrentTokenColumn()+d-1)).start,(t||m.row===i.row&&Math.abs(m.column-i.column)<2)&&(g=this.session.getBracketRange(m)));else if("tag"===a){if(!s||-1===s.type.indexOf("tag-name"))return;if(0===(g=new p(n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2,n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2)).compare(i.row,i.column)){var f=this.session.getMatchingTags(i);f&&(f.openTag.contains(i.row,i.column)?m=(g=f.closeTag).start:(g=f.openTag,m=f.closeTag.start.row===i.row&&f.closeTag.start.column===i.column?g.end:g.start))}m=m||g.start}(m=g&&g.cursor||m)&&(e?g&&t?this.selection.setRange(g):g&&g.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(m.row,m.column):this.selection.moveTo(m.row,m.column))}}},e.prototype.gotoLine=function(e,t,i){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(e-1,t||0),this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,i)},e.prototype.navigateTo=function(e,t){this.selection.moveTo(e,t)},e.prototype.navigateUp=function(e){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(-e||-1,0)},e.prototype.navigateDown=function(e){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(e||1,0)},e.prototype.navigateLeft=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorLeft();else{var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}this.clearSelection()},e.prototype.navigateRight=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorRight();else{var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}this.clearSelection()},e.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},e.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},e.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},e.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},e.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},e.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},e.prototype.replace=function(e,t){t&&this.$search.set(t);var i=this.$search.find(this.session),n=0;return i?(this.$tryReplace(i,e)&&(n=1),this.selection.setSelectionRange(i),this.renderer.scrollSelectionIntoView(i.start,i.end),n):n},e.prototype.replaceAll=function(e,t){t&&this.$search.set(t);var i=this.$search.findAll(this.session),n=0;if(!i.length)return n;var o=this.getSelectionRange();this.selection.moveTo(0,0);for(var r=i.length-1;r>=0;--r)this.$tryReplace(i[r],e)&&n++;return this.selection.setSelectionRange(o),n},e.prototype.$tryReplace=function(e,t){var i=this.session.getTextRange(e);return null!==(t=this.$search.replace(i,t))?(e.end=this.session.replace(e,t),e):null},e.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},e.prototype.find=function(e,t,i){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&o.mixin(t,e);var n=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(n)||this.$search.$options.needle)||(n=this.session.getWordRange(n.start.row,n.start.column),e=this.session.getTextRange(n)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:n});var r=this.$search.find(this.session);return t.preventScroll?r:r?(this.revealRange(r,i),r):(t.backwards?n.start=n.end:n.end=n.start,void this.selection.setRange(n))},e.prototype.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},e.prototype.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},e.prototype.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var i=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(i)},e.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},e.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},e.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach((function(e){e.destroy()})),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},e.prototype.setAutoScrollEditorIntoView=function(e){if(e){var t,i=this,n=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var o=this.$scrollAnchor;o.style.cssText="position:absolute",this.container.insertBefore(o,this.container.firstChild);var r=this.on("changeSelection",(function(){n=!0})),s=this.renderer.on("beforeRender",(function(){n&&(t=i.renderer.container.getBoundingClientRect())})),a=this.renderer.on("afterRender",(function(){if(n&&t&&(i.isFocused()||i.searchBox&&i.searchBox.isFocused())){var e=i.renderer,r=e.$cursorLayer.$pixelPos,s=e.layerConfig,a=r.top-s.offset;null!=(n=r.top>=0&&a+t.top<0||!(r.top<s.height&&r.top+t.top+s.lineHeight>window.innerHeight)&&null)&&(o.style.top=a+"px",o.style.left=r.left+"px",o.style.height=s.lineHeight+"px",o.scrollIntoView(n)),n=t=null}}));this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",r),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",s))}}},e.prototype.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,r.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},e.prototype.prompt=function(e,t,i){var n=this;C.loadModule("ace/ext/prompt",(function(o){o.prompt(n,e,t,i)}))},e}();x.$uid=0,x.prototype.curOp=null,x.prototype.prevOp={},x.prototype.$mergeableCommands=["backspace","del","insertstring"],x.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],o.implement(x.prototype,m),C.defineOptions(x.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?k.attach(this):k.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?k.attach(this):k.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),r.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(e||this.renderer.placeholderNode)!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");else{this.renderer.on("afterRender",this.$updatePlaceholder),r.addCssClass(this.container,"ace_hasPlaceholder");var t=r.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(e){var t,i={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(e){e.blur(),e.renderer.scroller.focus()},readOnly:!0},n=function(e){if(e.target==this.renderer.scroller&&e.keyCode===S.enter){e.preventDefault();var t=this.getCursorPosition().row;this.isRowVisible(t)||this.scrollToLine(t,!0,!0),this.focus()}};e?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(a.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",A("editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",A("Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",n.bind(this)),this.commands.addCommand(i),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",A("editor")),this.renderer.$gutter.setAttribute("aria-label",A("Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),t||(t=new b(this)),t.addListener()):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",n.bind(this)),this.commands.removeCommand(i),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),t&&t.removeListener())},initialValue:!1},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var k={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,i){return Math.max(t.toString().length,(i.lastRow+1).toString().length,2)*i.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=x})),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("../lib/dom"),o=function(){function e(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return e.prototype.moveContainer=function(e){n.translate(this.element,0,-e.firstRowScreen*e.lineHeight%this.canvasHeight-e.offset*this.$offsetCoefficient)},e.prototype.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},e.prototype.computeLineTop=function(e,t,i){var n=t.firstRowScreen*t.lineHeight,o=Math.floor(n/this.canvasHeight);return i.documentToScreenRow(e,0)*t.lineHeight-o*this.canvasHeight},e.prototype.computeLineHeight=function(e,t,i){return t.lineHeight*i.getRowLineCount(e)},e.prototype.getLength=function(){return this.cells.length},e.prototype.get=function(e){return this.cells[e]},e.prototype.shift=function(){this.$cacheCell(this.cells.shift())},e.prototype.pop=function(){this.$cacheCell(this.cells.pop())},e.prototype.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=n.createFragment(this.element),i=0;i<e.length;i++)t.appendChild(e[i].element);this.element.appendChild(t)}else this.cells.push(e),this.element.appendChild(e.element)},e.prototype.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);for(var t=n.createFragment(this.element),i=0;i<e.length;i++)t.appendChild(e[i].element);this.element.firstChild?this.element.insertBefore(t,this.element.firstChild):this.element.appendChild(t)}else this.cells.unshift(e),this.element.insertAdjacentElement("afterbegin",e.element)},e.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},e.prototype.$cacheCell=function(e){e&&(e.element.remove(),this.cellCache.push(e))},e.prototype.createCell=function(e,t,i,o){var r=this.cellCache.pop();if(!r){var s=n.createElement("div");o&&o(s),this.element.appendChild(s),r={element:s,text:"",row:e}}return r.row=e,r},e}();t.Lines=o})),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],(function(e,t,i){"use strict";var n=e("../lib/dom"),o=e("../lib/oop"),r=e("../lib/lang"),s=e("../lib/event_emitter").EventEmitter,a=e("./lines").Lines,l=e("../config").nls,c=function(){function e(e){this.element=n.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new a(this.element),this.$lines.$offsetCoefficient=1}return e.prototype.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},e.prototype.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,t)},e.prototype.removeGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,t)},e.prototype.setAnnotations=function(e){this.$annotations=[];for(var t=0;t<e.length;t++){var i=e[t],n=i.row,o=this.$annotations[n];o||(o=this.$annotations[n]={text:[],type:[]});var s=i.text,a=i.type;s=s?r.escapeHTML(s):i.html||"",-1===o.text.indexOf(s)&&(o.text.push(s),o.type.push(a));var l=i.className;l?o.className=l:"error"==a?o.className=" ace_error":"warning"==a&&" ace_error"!=o.className?o.className=" ace_warning":"info"!=a||o.className||(o.className=" ace_info")}},e.prototype.$updateAnnotations=function(e){if(this.$annotations.length){var t=e.start.row,i=e.end.row-t;if(0===i);else if("remove"==e.action)this.$annotations.splice(t,i+1,null);else{var n=new Array(i+1);n.unshift(t,1),this.$annotations.splice.apply(this.$annotations,n)}}},e.prototype.update=function(e){this.config=e;var t=this.session,i=e.firstRow,n=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1);this.oldLastRow=n,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var o=t.getNextFoldLine(i),r=o?o.start.row:1/0,s=null,a=-1,l=i;;){if(l>r&&(l=o.end.row+1,r=(o=t.getNextFoldLine(l,o))?o.start.row:1/0),l>n){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(s=this.$lines.get(++a))?s.row=l:(s=this.$lines.createCell(l,e,this.session,h),this.$lines.push(s)),this.$renderCell(s,e,o,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},e.prototype.$updateGutterWidth=function(e){var t=this.session,i=t.gutterRenderer||this.$renderer,n=t.$firstLineNumber,o=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(o=t.getLength()+n-1);var r=i?i.getWidth(t,o,e):o.toString().length*e.characterWidth,s=this.$padding||this.$computePadding();(r+=s.left+s.right)===this.gutterWidth||isNaN(r)||(this.gutterWidth=r,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",r))},e.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},e.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var i=0;i<t.length;i++){var n=t[i];if(n.row>=this.$cursorRow){if(n.row>this.$cursorRow){var o=this.session.getFoldLine(this.$cursorRow);if(!(i>0&&o&&o.start.row==t[i-1].row))break;n=t[i-1]}n.element.className="ace_gutter-active-line "+n.element.className,this.$cursorCell=n;break}}}}},e.prototype.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),n=this.oldLastRow;if(this.oldLastRow=i,!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var o=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);o>0;o--)this.$lines.shift();if(n>i)for(o=this.session.getFoldedRowCount(i+1,n);o>0;o--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1)),i>n&&this.$lines.push(this.$renderLines(e,n+1,i)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},e.prototype.$renderLines=function(e,t,i){for(var n=[],o=t,r=this.session.getNextFoldLine(o),s=r?r.start.row:1/0;o>s&&(o=r.end.row+1,s=(r=this.session.getNextFoldLine(o,r))?r.start.row:1/0),!(o>i);){var a=this.$lines.createCell(o,e,this.session,h);this.$renderCell(a,e,r,o),n.push(a),o++}return n},e.prototype.$renderCell=function(e,t,i,o){var r=e.element,s=this.session,a=r.childNodes[0],c=r.childNodes[1],h=r.childNodes[2],d=h.firstChild,u=s.$firstLineNumber,g=s.$breakpoints,p=s.$decorations,m=s.gutterRenderer||this.$renderer,f=this.$showFoldWidgets&&s.foldWidgets,v=i?i.start.row:Number.MAX_VALUE,C=t.lineHeight+"px",y=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",I=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",b=(m?m.getText(s,o):o+u).toString();if(this.$highlightGutterLine&&(o==this.$cursorRow||i&&o<this.$cursorRow&&o>=v&&this.$cursorRow<=i.end.row)&&(y+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),g[o]&&(y+=g[o]),p[o]&&(y+=p[o]),this.$annotations[o]&&o!==v&&(y+=this.$annotations[o].className),f){var A=f[o];null==A&&(A=f[o]=s.getFoldWidget(o))}if(A){var w="ace_fold-widget ace_"+A,S="start"==A&&o==v&&o<i.end.row;if(S){w+=" ace_closed";for(var x="",k=!1,T=o+1;T<=i.end.row;T++)if(this.$annotations[T]){if(" ace_error"===this.$annotations[T].className){k=!0,x=" ace_error_fold";break}" ace_warning"!==this.$annotations[T].className||(k=!0,x=" ace_warning_fold")}y+=x}else w+=" ace_open";c.className!=w&&(c.className=w),n.setStyle(c.style,"height",C),n.setStyle(c.style,"display","inline-block"),c.setAttribute("role","button"),c.setAttribute("tabindex","-1");var E=s.getFoldWidgetRange(o);E?c.setAttribute("aria-label",l("Toggle code folding, rows $0 through $1",[E.start.row+1,E.end.row+1])):i?c.setAttribute("aria-label",l("Toggle code folding, rows $0 through $1",[i.start.row+1,i.end.row+1])):c.setAttribute("aria-label",l("Toggle code folding, row $0",[o+1])),S?(c.setAttribute("aria-expanded","false"),c.setAttribute("title",l("Unfold code"))):(c.setAttribute("aria-expanded","true"),c.setAttribute("title",l("Fold code")))}else c&&(n.setStyle(c.style,"display","none"),c.setAttribute("tabindex","0"),c.removeAttribute("role"),c.removeAttribute("aria-label"));return k&&this.$showFoldedAnnotations?(h.className="ace_gutter_annotation",d.className=I,d.className+=x,n.setStyle(d.style,"height",C),n.setStyle(h.style,"display","block"),n.setStyle(h.style,"height",C),h.setAttribute("aria-label",l("Read annotations row $0",[b])),h.setAttribute("tabindex","-1"),h.setAttribute("role","button")):this.$annotations[o]?(h.className="ace_gutter_annotation",d.className=I,this.$useSvgGutterIcons?d.className+=this.$annotations[o].className:r.classList.add(this.$annotations[o].className.replace(" ","")),n.setStyle(d.style,"height",C),n.setStyle(h.style,"display","block"),n.setStyle(h.style,"height",C),h.setAttribute("aria-label",l("Read annotations row $0",[b])),h.setAttribute("tabindex","-1"),h.setAttribute("role","button")):(n.setStyle(h.style,"display","none"),h.removeAttribute("aria-label"),h.removeAttribute("role"),h.setAttribute("tabindex","0")),b!==a.data&&(a.data=b),r.className!=y&&(r.className=y),n.setStyle(e.element.style,"height",this.$lines.computeLineHeight(o,t,s)+"px"),n.setStyle(e.element.style,"top",this.$lines.computeLineTop(o,t,s)+"px"),e.text=b,"none"===h.style.display&&"none"===c.style.display?e.element.setAttribute("aria-hidden",!0):e.element.setAttribute("aria-hidden",!1),e},e.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},e.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},e.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},e.prototype.setShowFoldWidgets=function(e){e?n.addCssClass(this.element,"ace_folding-enabled"):n.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},e.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},e.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=n.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},e.prototype.getRegion=function(e){var t=this.$padding||this.$computePadding(),i=this.element.getBoundingClientRect();return e.x<t.left+i.left?"markers":this.$showFoldWidgets&&e.x>i.right-t.right?"foldWidgets":void 0},e}();function h(e){var t=document.createTextNode("");e.appendChild(t);var i=n.createElement("span");e.appendChild(i);var o=n.createElement("span");e.appendChild(o);var r=n.createElement("span");return o.appendChild(r),e}c.prototype.$fixedWidth=!1,c.prototype.$highlightGutterLine=!0,c.prototype.$renderer="",c.prototype.$showLineNumbers=!0,c.prototype.$showFoldWidgets=!0,o.implement(c.prototype,s),t.Gutter=c})),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("../range").Range,o=e("../lib/dom"),r=function(){function e(e){this.element=o.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}return e.prototype.setPadding=function(e){this.$padding=e},e.prototype.setSession=function(e){this.session=e},e.prototype.setMarkers=function(e){this.markers=e},e.prototype.elt=function(e,t){var i=-1!=this.i&&this.element.childNodes[this.i];i?this.i++:(i=document.createElement("div"),this.element.appendChild(i),this.i=-1),i.style.cssText=t,i.className=e},e.prototype.update=function(e){if(e){var t;for(var i in this.config=e,this.i=0,this.markers){var n=this.markers[i];if(n.range){var o=n.range.clipRows(e.firstRow,e.lastRow);if(!o.isEmpty())if(o=o.toScreenRange(this.session),n.renderer){var r=this.$getTop(o.start.row,e),s=this.$padding+o.start.column*e.characterWidth;n.renderer(t,o,s,r,e)}else"fullLine"==n.type?this.drawFullLineMarker(t,o,n.clazz,e):"screenLine"==n.type?this.drawScreenLineMarker(t,o,n.clazz,e):o.isMultiLine()?"text"==n.type?this.drawTextMarker(t,o,n.clazz,e):this.drawMultiLineMarker(t,o,n.clazz,e):this.drawSingleLineMarker(t,o,n.clazz+" ace_start ace_br15",e)}else n.update(t,this,this.session,e)}if(-1!=this.i)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},e.prototype.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},e.prototype.drawTextMarker=function(e,t,i,o,r){for(var s=this.session,a=t.start.row,l=t.end.row,c=a,h=0,d=0,u=s.getScreenLastRowColumn(c),g=new n(c,t.start.column,c,d);c<=l;c++)g.start.row=g.end.row=c,g.start.column=c==a?t.start.column:s.getRowWrapIndent(c),g.end.column=u,h=d,d=u,u=c+1<l?s.getScreenLastRowColumn(c+1):c==l?0:t.end.column,this.drawSingleLineMarker(e,g,i+(c==a?" ace_start":"")+" ace_br"+((c==a||c==a+1&&t.start.column?1:0)|(h<d?2:0)|(d>u?4:0)|(c==l?8:0)),o,c==l?0:1,r)},e.prototype.drawMultiLineMarker=function(e,t,i,n,o){var r=this.$padding,s=n.lineHeight,a=this.$getTop(t.start.row,n),l=r+t.start.column*n.characterWidth;if(o=o||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((c=t.clone()).end.row=c.start.row,c.end.column=this.session.getLine(c.start.row).length,this.drawBidiSingleLineMarker(e,c,i+" ace_br1 ace_start",n,null,o)):this.elt(i+" ace_br1 ace_start","height:"+s+"px;right:0;top:"+a+"px;left:"+l+"px;"+(o||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var c;(c=t.clone()).start.row=c.end.row,c.start.column=0,this.drawBidiSingleLineMarker(e,c,i+" ace_br12",n,null,o)}else{a=this.$getTop(t.end.row,n);var h=t.end.column*n.characterWidth;this.elt(i+" ace_br12","height:"+s+"px;width:"+h+"px;top:"+a+"px;left:"+r+"px;"+(o||""))}if(!((s=(t.end.row-t.start.row-1)*n.lineHeight)<=0)){a=this.$getTop(t.start.row+1,n);var d=(t.start.column?1:0)|(t.end.column?0:8);this.elt(i+(d?" ace_br"+d:""),"height:"+s+"px;right:0;top:"+a+"px;left:"+r+"px;"+(o||""))}},e.prototype.drawSingleLineMarker=function(e,t,i,n,o,r){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,i,n,o,r);var s=n.lineHeight,a=(t.end.column+(o||0)-t.start.column)*n.characterWidth,l=this.$getTop(t.start.row,n),c=this.$padding+t.start.column*n.characterWidth;this.elt(i,"height:"+s+"px;width:"+a+"px;top:"+l+"px;left:"+c+"px;"+(r||""))},e.prototype.drawBidiSingleLineMarker=function(e,t,i,n,o,r){var s=n.lineHeight,a=this.$getTop(t.start.row,n),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach((function(e){this.elt(i,"height:"+s+"px;width:"+(e.width+(o||0))+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(r||""))}),this)},e.prototype.drawFullLineMarker=function(e,t,i,n,o){var r=this.$getTop(t.start.row,n),s=n.lineHeight;t.start.row!=t.end.row&&(s+=this.$getTop(t.end.row,n)-r),this.elt(i,"height:"+s+"px;top:"+r+"px;left:0;right:0;"+(o||""))},e.prototype.drawScreenLineMarker=function(e,t,i,n,o){var r=this.$getTop(t.start.row,n),s=n.lineHeight;this.elt(i,"height:"+s+"px;top:"+r+"px;left:0;right:0;"+(o||""))},e}();r.prototype.$padding=0,t.Marker=r})),ace.define("ace/layer/text_util",["require","exports","module"],(function(e,t,i){var n=new Set(["text","rparen","lparen"]);t.isTextToken=function(e){return n.has(e)}})),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],(function(e,t,i){"use strict";var n=e("../lib/oop"),o=e("../lib/dom"),r=e("../lib/lang"),s=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=e("../config").nls,c=e("./text_util").isTextToken,h=function(){function e(e){this.dom=o,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new s(this.element)}return e.prototype.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},e.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},e.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},e.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},e.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},e.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},e.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},e.prototype.setSession=function(e){this.session=e,e&&this.$computeTabString()},e.prototype.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,"string"==typeof e?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},e.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},e.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides!==e&&(this.$highlightIndentGuides=e,e)},e.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],i=1;i<e+1;i++)this.showTabs?((n=this.dom.createElement("span")).className="ace_invisible ace_invisible_tab",n.textContent=r.stringRepeat(this.TAB_CHAR,i),t.push(n)):t.push(this.dom.createTextNode(r.stringRepeat(" ",i),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var n,o="ace_indent-guide",s=this.showSpaces?" ace_invisible ace_invisible_space":"",a=this.showSpaces?r.stringRepeat(this.SPACE_CHAR,this.tabSize):r.stringRepeat(" ",this.tabSize),l=this.showTabs?" ace_invisible ace_invisible_tab":"",c=this.showTabs?r.stringRepeat(this.TAB_CHAR,this.tabSize):a;(n=this.dom.createElement("span")).className=o+s,n.textContent=a,this.$tabStrings[" "]=n,(n=this.dom.createElement("span")).className=o+l,n.textContent=c,this.$tabStrings["\t"]=n}},e.prototype.updateLines=function(e,t,i){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var n=Math.max(t,e.firstRow),o=Math.min(i,e.lastRow),r=this.element.childNodes,s=0,a=e.firstRow;a<n;a++){if(l=this.session.getFoldLine(a)){if(l.containsRow(n)){n=l.start.row;break}a=l.end.row}s++}for(var l,c=!1,h=(a=n,(l=this.session.getNextFoldLine(a))?l.start.row:1/0);a>h&&(a=l.end.row+1,h=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>o);){var d=r[s++];if(d){this.dom.removeChildren(d),this.$renderLine(d,a,a==h&&l),c&&(d.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var u=e.lineHeight*this.session.getRowLength(a)+"px";d.style.height!=u&&(c=!0,d.style.height=u)}a++}if(c)for(;s<this.$lines.cells.length;){var g=this.$lines.cells[s++];g.element.style.top=this.$lines.computeLineTop(g.row,e,this.session)+"px"}},e.prototype.scrollLines=function(e){var t=this.config;if(this.config=e,this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var i=e.lastRow,n=t?t.lastRow:-1;if(!t||n<e.firstRow)return this.update(e);if(i<t.firstRow)return this.update(e);if(!t||t.lastRow<e.firstRow)return this.update(e);if(e.lastRow<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var o=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);o>0;o--)this.$lines.shift();if(t.lastRow>e.lastRow)for(o=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);o>0;o--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,t.firstRow-1)),e.lastRow>t.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},e.prototype.$renderLinesFragment=function(e,t,i){for(var n=[],r=t,s=this.session.getNextFoldLine(r),a=s?s.start.row:1/0;r>a&&(r=s.end.row+1,a=(s=this.session.getNextFoldLine(r,s))?s.start.row:1/0),!(r>i);){var l=this.$lines.createCell(r,e,this.session),c=l.element;this.dom.removeChildren(c),o.setStyle(c.style,"height",this.$lines.computeLineHeight(r,e,this.session)+"px"),o.setStyle(c.style,"top",this.$lines.computeLineTop(r,e,this.session)+"px"),this.$renderLine(c,r,r==a&&s),this.$useLineGroups()?c.className="ace_line_group":c.className="ace_line",n.push(l),r++}return n},e.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,i=e.lastRow,n=this.$lines;n.getLength();)n.pop();n.push(this.$renderLinesFragment(e,t,i))},e.prototype.$renderToken=function(e,t,i,n){for(var o,s=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,h=this.dom.createFragment(this.element),d=0;o=a.exec(n);){var u=o[1],g=o[2],p=o[3],m=o[4],f=o[5];if(s.showSpaces||!g){var v=d!=o.index?n.slice(d,o.index):"";if(d=o.index+o[0].length,v&&h.appendChild(this.dom.createTextNode(v,this.element)),u){var C=s.session.getScreenTabSize(t+o.index);h.appendChild(s.$tabStrings[C].cloneNode(!0)),t+=C-1}else g?s.showSpaces?((I=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",I.textContent=r.stringRepeat(s.SPACE_CHAR,g.length),h.appendChild(I)):h.appendChild(this.dom.createTextNode(g,this.element)):p?((I=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",I.textContent=r.stringRepeat(s.SPACE_CHAR,p.length),h.appendChild(I)):m?(t+=1,(I=this.dom.createElement("span")).style.width=2*s.config.characterWidth+"px",I.className=s.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",I.textContent=s.showSpaces?s.SPACE_CHAR:m,h.appendChild(I)):f&&(t+=1,(I=this.dom.createElement("span")).style.width=2*s.config.characterWidth+"px",I.className="ace_cjk",I.textContent=f,h.appendChild(I))}}if(h.appendChild(this.dom.createTextNode(d?n.slice(d):n,this.element)),c(i.type))e.appendChild(h);else{var y="ace_"+i.type.replace(/\./g," ace_"),I=this.dom.createElement("span");"fold"==i.type&&(I.style.width=i.value.length*this.config.characterWidth+"px",I.setAttribute("title",l("Unfold code"))),I.className=y,I.appendChild(h),e.appendChild(I)}return t+n.length},e.prototype.renderIndentGuide=function(e,t,i){var n=t.search(this.$indentGuideRe);if(n<=0||n>=i)return t;if(" "==t[0]){for(var o=(n-=n%this.tabSize)/this.tabSize,r=0;r<o;r++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),t.substr(n)}if("\t"==t[0]){for(r=0;r<n;r++)e.appendChild(this.$tabStrings["\t"].cloneNode(!0));return this.$highlightIndentGuide(),t.substr(n)}return this.$highlightIndentGuide(),t},e.prototype.$highlightIndentGuide=function(){if(this.$highlightIndentGuides&&this.displayIndentGuides){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var e=this.session.doc.$lines;if(e){var t=this.session.selection.getCursor(),i=/^\s*/.exec(this.session.doc.getLine(t.row))[0].length,n=Math.floor(i/this.tabSize);if(this.$highlightIndentGuideMarker={indentLevel:n,start:t.row},this.session.$bracketHighlight)for(var o=this.session.$bracketHighlight.ranges,r=0;r<o.length;r++)if(t.row!==o[r].start.row){this.$highlightIndentGuideMarker.end=o[r].start.row,t.row>o[r].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}if(!this.$highlightIndentGuideMarker.end&&""!==e[t.row]&&t.column===e[t.row].length)for(this.$highlightIndentGuideMarker.dir=1,r=t.row+1;r<e.length;r++){var s=e[r],a=/^\s*/.exec(s)[0].length;if(""!==s&&(this.$highlightIndentGuideMarker.end=r,a<=i))break}this.$renderHighlightIndentGuide()}}},e.prototype.$clearActiveIndentGuide=function(){for(var e=this.$lines.cells,t=0;t<e.length;t++){var i=e[t].element.childNodes;if(i.length>0)for(var n=0;n<i.length;n++)if(i[n].classList&&i[n].classList.contains("ace_indent-guide-active")){i[n].classList.remove("ace_indent-guide-active");break}}},e.prototype.$setIndentGuideActive=function(e,t){if(""!==this.session.doc.getLine(e.row)){var i=e.element.childNodes;if(i){var n=i[t-1];n&&n.classList&&n.classList.contains("ace_indent-guide")&&n.classList.add("ace_indent-guide-active")}}},e.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells;this.$clearActiveIndentGuide();var t=this.$highlightIndentGuideMarker.indentLevel;if(0!==t)if(1===this.$highlightIndentGuideMarker.dir)for(var i=0;i<e.length;i++){var n=e[i];if(this.$highlightIndentGuideMarker.end&&n.row>=this.$highlightIndentGuideMarker.start+1){if(n.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(n,t)}}else for(i=e.length-1;i>=0;i--)if(n=e[i],this.$highlightIndentGuideMarker.end&&n.row<this.$highlightIndentGuideMarker.start){if(n.row<=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(n,t)}}},e.prototype.$createLineElement=function(e){var t=this.dom.createElement("div");return t.className="ace_line",t.style.height=this.config.lineHeight+"px",t},e.prototype.$renderWrappedLine=function(e,t,i){var n=0,o=0,s=i[0],a=0,l=this.$createLineElement();e.appendChild(l);for(var c=0;c<t.length;c++){var h=t[c],d=h.value;if(0==c&&this.displayIndentGuides){if(n=d.length,!(d=this.renderIndentGuide(l,d,s)))continue;n-=d.length}if(n+d.length<s)a=this.$renderToken(l,a,h,d),n+=d.length;else{for(;n+d.length>=s;)a=this.$renderToken(l,a,h,d.substring(0,s-n)),d=d.substring(s-n),n=s,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(r.stringRepeat(" ",i.indent),this.element)),a=0,s=i[++o]||Number.MAX_VALUE;0!=d.length&&(n+=d.length,a=this.$renderToken(l,a,h,d))}}i[i.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},e.prototype.$renderSimpleLine=function(e,t){for(var i=0,n=0;n<t.length;n++){var o=t[n],r=o.value;if(0!=n||!this.displayIndentGuides||(r=this.renderIndentGuide(e,r))){if(i+r.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,i,o,r);i=this.$renderToken(e,i,o,r)}}},e.prototype.$renderOverflowMessage=function(e,t,i,n,o){i&&this.$renderToken(e,t,i,n.slice(0,this.MAX_LINE_LENGTH-t));var r=this.dom.createElement("span");r.className="ace_inline_button ace_keyword ace_toggle_wrap",r.textContent=o?"<hide>":"<click to see more...>",e.appendChild(r)},e.prototype.$renderLine=function(e,t,i){if(i||0==i||(i=this.session.getFoldLine(t)),i)var n=this.$getFoldLineTokens(t,i);else n=this.session.getTokens(t);var o=e;if(n.length){var r=this.session.getRowSplitData(t);r&&r.length?(this.$renderWrappedLine(e,n,r),o=e.lastChild):(o=e,this.$useLineGroups()&&(o=this.$createLineElement(),e.appendChild(o)),this.$renderSimpleLine(o,n))}else this.$useLineGroups()&&(o=this.$createLineElement(),e.appendChild(o));if(this.showEOL&&o){i&&(t=i.end.row);var s=this.dom.createElement("span");s.className="ace_invisible ace_invisible_eol",s.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,o.appendChild(s)}},e.prototype.$getFoldLineTokens=function(e,t){var i=this.session,n=[],o=i.getTokens(e);return t.walk((function(e,t,r,s,a){null!=e?n.push({type:"fold",value:e}):(a&&(o=i.getTokens(t)),o.length&&function(e,t,i){for(var o=0,r=0;r+e[o].value.length<t;)if(r+=e[o].value.length,++o==e.length)return;for(r!=t&&((s=e[o].value.substring(t-r)).length>i-t&&(s=s.substring(0,i-t)),n.push({type:e[o].type,value:s}),r=t+s.length,o+=1);r<i&&o<e.length;){var s;(s=e[o].value).length+r>i?n.push({type:e[o].type,value:s.substring(0,i-r)}):n.push(e[o]),r+=s.length,o+=1}}(o,s,r))}),t.end.row,this.session.getLine(t.end.row).length),n},e.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},e}();h.prototype.EOF_CHAR="¶",h.prototype.EOL_CHAR_LF="¬",h.prototype.EOL_CHAR_CRLF="¤",h.prototype.EOL_CHAR=h.prototype.EOL_CHAR_LF,h.prototype.TAB_CHAR="—",h.prototype.SPACE_CHAR="·",h.prototype.$padding=0,h.prototype.MAX_LINE_LENGTH=1e4,h.prototype.showInvisibles=!1,h.prototype.showSpaces=!1,h.prototype.showTabs=!1,h.prototype.showEOL=!1,h.prototype.displayIndentGuides=!0,h.prototype.$highlightIndentGuides=!0,h.prototype.$tabStrings=[],h.prototype.destroy={},h.prototype.onChangeTabSize=h.prototype.$computeTabString,n.implement(h.prototype,a),t.Text=h})),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("../lib/dom"),o=function(){function e(e){this.element=n.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),n.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return e.prototype.$updateOpacity=function(e){for(var t=this.cursors,i=t.length;i--;)n.setStyle(t[i].style,"opacity",e?"":"0")},e.prototype.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&n.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},e.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,n.removeCssClass(this.element,"ace_animate-blinking")},e.prototype.setPadding=function(e){this.$padding=e},e.prototype.setSession=function(e){this.session=e},e.prototype.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},e.prototype.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},e.prototype.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,n.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},e.prototype.addCursor=function(){var e=n.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},e.prototype.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},e.prototype.hideCursor=function(){this.isVisible=!1,n.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},e.prototype.showCursor=function(){this.isVisible=!0,n.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},e.prototype.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,n.removeCssClass(this.element,"ace_smooth-blinking")),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&n.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),n.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout((function(){e(!1)}),.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval((function(){e(!0),t()}),this.blinkInterval),t()}else this.$stopCssAnimation()},e.prototype.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var i=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,e.row)?this.session.$bidiHandler.getPosLeft(i.column):i.column*this.config.characterWidth),top:(i.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},e.prototype.isCursorInView=function(e,t){return e.top>=0&&e.top<t.maxHeight},e.prototype.update=function(e){this.config=e;var t=this.session.$selectionMarkers,i=0,o=0;void 0!==t&&0!==t.length||(t=[{cursor:null}]),i=0;for(var r=t.length;i<r;i++){var s=this.getPixelPosition(t[i].cursor,!0);if(!((s.top>e.height+e.offset||s.top<0)&&i>1)){var a=this.cursors[o++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,s,e,t[i],this.session):this.isCursorInView(s,e)?(n.setStyle(l,"display","block"),n.translate(a,s.left,s.top),n.setStyle(l,"width",Math.round(e.characterWidth)+"px"),n.setStyle(l,"height",e.lineHeight+"px")):n.setStyle(l,"display","none")}}for(;this.cursors.length>o;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=s,this.restartTimer()},e.prototype.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?n.addCssClass(this.element,"ace_overwrite-cursors"):n.removeCssClass(this.element,"ace_overwrite-cursors"))},e.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},e}();o.prototype.$padding=0,o.prototype.drawCursor=null,t.Cursor=o})),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,i){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=e("./lib/oop"),s=e("./lib/dom"),a=e("./lib/event"),l=e("./lib/event_emitter").EventEmitter,c=32768,h=function(){function e(e,t){this.element=s.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+t,this.inner=s.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addListener(this.element,"scroll",this.onScroll.bind(this)),a.addListener(this.element,"mousedown",a.preventDefault)}return e.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},e}();r.implement(h.prototype,l);var d=function(e){function t(t,i){var n=e.call(this,t,"-v")||this;return n.scrollTop=0,n.scrollHeight=0,i.$scrollbarWidth=n.width=s.scrollbarWidth(t.ownerDocument),n.inner.style.width=n.element.style.width=(n.width||15)+5+"px",n.$minWidth=0,n}return o(t,e),t.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},t.prototype.setHeight=function(e){this.element.style.height=e+"px"},t.prototype.setScrollHeight=function(e){this.scrollHeight=e,e>c?(this.coeff=c/e,e=c):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},t.prototype.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)},t}(h);d.prototype.setInnerHeight=d.prototype.setScrollHeight;var u=function(e){function t(t,i){var n=e.call(this,t,"-h")||this;return n.scrollLeft=0,n.height=i.$scrollbarWidth,n.inner.style.height=n.element.style.height=(n.height||15)+5+"px",n}return o(t,e),t.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},t.prototype.getHeight=function(){return this.isVisible?this.height:0},t.prototype.setWidth=function(e){this.element.style.width=e+"px"},t.prototype.setInnerWidth=function(e){this.inner.style.width=e+"px"},t.prototype.setScrollWidth=function(e){this.inner.style.width=e+"px"},t.prototype.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)},t}(h);t.ScrollBar=d,t.ScrollBarV=d,t.ScrollBarH=u,t.VScrollBar=d,t.HScrollBar=u})),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,i){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),r=e("./lib/oop"),s=e("./lib/dom"),a=e("./lib/event"),l=e("./lib/event_emitter").EventEmitter;s.importCssString(".ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{\n position: absolute;\n background: rgba(128, 128, 128, 0.6);\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n border: 1px solid #bbb;\n border-radius: 2px;\n z-index: 8;\n}\n.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {\n position: absolute;\n z-index: 6;\n background: none;\n overflow: hidden!important;\n}\n.ace_editor>.ace_sb-v {\n z-index: 6;\n right: 0;\n top: 0;\n width: 12px;\n}\n.ace_editor>.ace_sb-v div {\n z-index: 8;\n right: 0;\n width: 100%;\n}\n.ace_editor>.ace_sb-h {\n bottom: 0;\n left: 0;\n height: 12px;\n}\n.ace_editor>.ace_sb-h div {\n bottom: 0;\n height: 100%;\n}\n.ace_editor>.ace_sb_grabbed {\n z-index: 8;\n background: #000;\n}","ace_scrollbar.css",!1);var c=function(){function e(e,t){this.element=s.createElement("div"),this.element.className="ace_sb"+t,this.inner=s.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return e.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},e}();r.implement(c.prototype,l);var h=function(e){function t(t,i){var n=e.call(this,t,"-v")||this;return n.scrollTop=0,n.scrollHeight=0,n.parent=t,n.width=n.VScrollWidth,n.renderer=i,n.inner.style.width=n.element.style.width=(n.width||15)+"px",n.$minWidth=0,n}return o(t,e),t.prototype.onMouseDown=function(e,t){if("mousedown"===e&&0===a.getButton(t)&&2!==t.detail){if(t.target===this.inner){var i=this,n=t.clientY,o=t.clientY,r=this.thumbTop;a.capture(this.inner,(function(e){n=e.clientY}),(function(){clearInterval(s)}));var s=setInterval((function(){if(void 0!==n){var e=i.scrollTopFromThumbTop(r+n-o);e!==i.scrollTop&&i._emit("scroll",{data:e})}}),20);return a.preventDefault(t)}var l=t.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(l)}),a.preventDefault(t)}},t.prototype.getHeight=function(){return this.height},t.prototype.scrollTopFromThumbTop=function(e){var t=e*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return(t>>=0)<0?t=0:t>this.pageHeight-this.viewHeight&&(t=this.pageHeight-this.viewHeight),t},t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},t.prototype.setHeight=function(e){this.height=Math.max(0,e),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},t.prototype.setScrollHeight=function(e,t){(this.pageHeight!==e||t)&&(this.pageHeight=e,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},t.prototype.setScrollTop=function(e){this.scrollTop=e,e<0&&(e=0),this.thumbTop=e*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},t}(c);h.prototype.setInnerHeight=h.prototype.setScrollHeight;var d=function(e){function t(t,i){var n=e.call(this,t,"-h")||this;return n.scrollLeft=0,n.scrollWidth=0,n.height=n.HScrollHeight,n.inner.style.height=n.element.style.height=(n.height||12)+"px",n.renderer=i,n}return o(t,e),t.prototype.onMouseDown=function(e,t){if("mousedown"===e&&0===a.getButton(t)&&2!==t.detail){if(t.target===this.inner){var i=this,n=t.clientX,o=t.clientX,r=this.thumbLeft;a.capture(this.inner,(function(e){n=e.clientX}),(function(){clearInterval(s)}));var s=setInterval((function(){if(void 0!==n){var e=i.scrollLeftFromThumbLeft(r+n-o);e!==i.scrollLeft&&i._emit("scroll",{data:e})}}),20);return a.preventDefault(t)}var l=t.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(l)}),a.preventDefault(t)}},t.prototype.getHeight=function(){return this.isVisible?this.height:0},t.prototype.scrollLeftFromThumbLeft=function(e){var t=e*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return(t>>=0)<0?t=0:t>this.pageWidth-this.viewWidth&&(t=this.pageWidth-this.viewWidth),t},t.prototype.setWidth=function(e){this.width=Math.max(0,e),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},t.prototype.setScrollWidth=function(e,t){(this.pageWidth!==e||t)&&(this.pageWidth=e,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},t.prototype.setScrollLeft=function(e){this.scrollLeft=e,e<0&&(e=0),this.thumbLeft=e*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},t}(c);d.prototype.setInnerWidth=d.prototype.setScrollWidth,t.ScrollBar=h,t.ScrollBarV=h,t.ScrollBarH=d,t.VScrollBar=h,t.HScrollBar=d})),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],(function(e,t,i){"use strict";var n=e("./lib/event"),o=function(){function e(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var i=this;this._flush=function(e){i.pending=!1;var t=i.changes;if(t&&(n.blockIdle(100),i.changes=0,i.onRender(t)),i.changes){if(i.$recursionLimit--<0)return;i.schedule()}else i.$recursionLimit=2}}return e.prototype.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(n.nextFrame(this._flush),this.pending=!0)},e.prototype.clear=function(e){var t=this.changes;return this.changes=0,t},e}();t.RenderLoop=o})),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],(function(e,t,i){var n=e("../lib/oop"),o=e("../lib/dom"),r=e("../lib/lang"),s=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,c=512,h="function"==typeof ResizeObserver,d=200,u=function(){function e(e){this.el=o.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=o.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=o.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=r.stringRepeat("X",c),this.$characterSize={width:0,height:0},h?this.$addObserver():this.checkForSizeChanges()}return e.prototype.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},e.prototype.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},e.prototype.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver((function(t){e.checkForSizeChanges()})),this.$observer.observe(this.$measureNode)},e.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=s.onIdle((function t(){e.checkForSizeChanges(),s.onIdle(t,500)}),500)},e.prototype.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},e.prototype.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/c};return 0===t.width||0===t.height?null:t},e.prototype.$measureCharWidth=function(e){return this.$main.textContent=r.stringRepeat(e,c),this.$main.getBoundingClientRect().width/c},e.prototype.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},e.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.$getZoom=function(e){return e&&e.parentElement?(window.getComputedStyle(e).zoom||1)*this.$getZoom(e.parentElement):1},e.prototype.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=o.buildDom([e(0,0),e(d,0),e(0,d),e(d,d)],this.el)},e.prototype.transformCoordinates=function(e,t){function i(e,t,i){var n=e[1]*t[0]-e[0]*t[1];return[(-t[1]*i[0]+t[0]*i[1])/n,(+e[1]*i[0]-e[0]*i[1])/n]}function n(e,t){return[e[0]-t[0],e[1]-t[1]]}function o(e,t){return[e[0]+t[0],e[1]+t[1]]}function r(e,t){return[e*t[0],e*t[1]]}function s(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=r(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=s(this.els[0]),l=s(this.els[1]),c=s(this.els[2]),h=s(this.els[3]),u=i(n(h,l),n(h,c),n(o(l,c),o(h,a))),g=r(1+u[0],n(l,a)),p=r(1+u[1],n(c,a));if(t){var m=t,f=u[0]*m[0]/d+u[1]*m[1]/d+1,v=o(r(m[0],g),r(m[1],p));return o(r(1/f/d,v),a)}var C=n(e,a),y=i(n(g,r(u[0],C)),n(p,r(u[1],C)),C);return r(d,y)},e}();u.prototype.$characterSize={width:0,height:0},n.implement(u.prototype,l),t.FontMetrics=u})),ace.define("ace/css/editor-css",["require","exports","module"],(function(e,t,i){i.exports='\n.ace_br1 {border-top-left-radius : 3px;}\n.ace_br2 {border-top-right-radius : 3px;}\n.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}\n.ace_br4 {border-bottom-right-radius: 3px;}\n.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}\n.ace_br8 {border-bottom-left-radius : 3px;}\n.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n\n\n.ace_editor {\n position: relative;\n overflow: hidden;\n padding: 0;\n font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'Source Code Pro\', \'source-code-pro\', monospace;\n direction: ltr;\n text-align: left;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n.ace_scroller {\n position: absolute;\n overflow: hidden;\n top: 0;\n bottom: 0;\n background-color: inherit;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n cursor: text;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n min-width: 100%;\n contain: style size layout;\n font-variant-ligatures: no-common-ligatures;\n}\n\n.ace_keyboard-focus:focus {\n box-shadow: inset 0 0 0 2px #5E9ED6;\n outline: none;\n}\n\n.ace_dragging .ace_scroller:before{\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: \'\';\n background: rgba(250, 250, 250, 0.01);\n z-index: 1000;\n}\n.ace_dragging.ace_dark .ace_scroller:before{\n background: rgba(0, 0, 0, 0.01);\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n width: auto;\n top: 0;\n bottom: 0;\n left: 0;\n cursor: default;\n z-index: 4;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n contain: style size layout;\n}\n\n.ace_gutter-active-line {\n position: absolute;\n left: 0;\n right: 0;\n}\n\n.ace_scroller.ace_scroll-left:after {\n content: "";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\n pointer-events: none;\n}\n\n.ace_gutter-cell, .ace_gutter-cell_svg-icons {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-left: 19px;\n padding-right: 6px;\n background-repeat: no-repeat;\n}\n\n.ace_gutter-cell_svg-icons .ace_gutter_annotation {\n margin-left: -14px;\n float: left;\n}\n\n.ace_gutter-cell .ace_gutter_annotation {\n margin-left: -19px;\n float: left;\n}\n\n.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info, .ace_icon.ace_info {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");\n}\n\n.ace_icon_svg.ace_error {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");\n background-color: darkorange;\n}\n.ace_icon_svg.ace_info {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");\n background-color: royalblue;\n}\n\n.ace_icon_svg.ace_error_fold {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning_fold {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");\n background-color: darkorange;\n}\n\n.ace_scrollbar {\n contain: strict;\n position: absolute;\n right: 0;\n bottom: 0;\n z-index: 6;\n}\n\n.ace_scrollbar-inner {\n position: absolute;\n cursor: text;\n left: 0;\n top: 0;\n}\n\n.ace_scrollbar-v{\n overflow-x: hidden;\n overflow-y: scroll;\n top: 0;\n}\n\n.ace_scrollbar-h {\n overflow-x: scroll;\n overflow-y: hidden;\n left: 0;\n}\n\n.ace_print-margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_text-input {\n position: absolute;\n z-index: 0;\n width: 0.5em;\n height: 1em;\n opacity: 0;\n background: transparent;\n -moz-appearance: none;\n appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n font: inherit;\n padding: 0 1px;\n margin: 0 -1px;\n contain: strict;\n -ms-user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n user-select: text;\n /*with `pre-line` chrome inserts instead of space*/\n white-space: pre!important;\n}\n.ace_text-input.ace_composition {\n background: transparent;\n color: inherit;\n z-index: 1000;\n opacity: 1;\n}\n.ace_composition_placeholder { color: transparent }\n.ace_composition_marker { \n border-bottom: 1px solid;\n position: absolute;\n border-radius: 0;\n margin-top: 1px;\n}\n\n[ace_nocontext=true] {\n transform: none!important;\n filter: none!important;\n clip-path: none!important;\n mask : none!important;\n contain: none!important;\n perspective: none!important;\n mix-blend-mode: initial!important;\n z-index: auto;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/\n word-wrap: normal;\n white-space: pre;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter-layer {\n position: relative;\n width: auto;\n text-align: right;\n pointer-events: auto;\n height: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer {\n font: inherit !important;\n position: absolute;\n height: 1000000px;\n width: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {\n contain: style size layout;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ace_hidpi .ace_text-layer,\n.ace_hidpi .ace_gutter-layer,\n.ace_hidpi .ace_content,\n.ace_hidpi .ace_gutter {\n contain: strict;\n}\n.ace_hidpi .ace_text-layer > .ace_line, \n.ace_hidpi .ace_text-layer > .ace_line_group {\n contain: strict;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n box-sizing: border-box;\n border-left: 2px solid;\n /* workaround for smooth cursor repaintng whole screen in chrome */\n transform: translatez(0);\n}\n\n.ace_multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_slim-cursors .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_overwrite-cursors .ace_cursor {\n border-left-width: 0;\n border-bottom: 1px solid;\n}\n\n.ace_hidden-cursors .ace_cursor {\n opacity: 0.2;\n}\n\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\n opacity: 0;\n}\n\n.ace_smooth-blinking .ace_cursor {\n transition: opacity 0.18s;\n}\n\n.ace_animate-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: step-end;\n animation-name: blink-ace-animate;\n animation-iteration-count: infinite;\n}\n\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: ease-in-out;\n animation-name: blink-ace-animate-smooth;\n}\n \n@keyframes blink-ace-animate {\n from, to { opacity: 1; }\n 60% { opacity: 0; }\n}\n\n@keyframes blink-ace-animate-smooth {\n from, to { opacity: 1; }\n 45% { opacity: 1; }\n 60% { opacity: 0; }\n 85% { opacity: 0; }\n}\n\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_error_bracket {\n position: absolute;\n border-bottom: 1px solid #DE5555;\n border-radius: 0;\n}\n\n.ace_marker-layer .ace_active-line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selected-word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n\n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image:\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n border-radius: 2px;\n\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image:\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");\n}\n\n.ace_tooltip {\n background-color: #f5f5f5;\n border: 1px solid gray;\n border-radius: 1px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n color: black;\n max-width: 100%;\n padding: 3px 4px;\n position: fixed;\n z-index: 999999;\n box-sizing: border-box;\n cursor: default;\n white-space: pre-wrap;\n word-wrap: break-word;\n line-height: normal;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n pointer-events: none;\n overflow: auto;\n max-width: min(60em, 66vw);\n overscroll-behavior: contain;\n}\n.ace_tooltip pre {\n white-space: pre-wrap;\n}\n\n.ace_tooltip.ace_dark {\n background-color: #636363;\n color: #fff;\n}\n\n.ace_tooltip:focus {\n outline: 1px solid #5E9ED6;\n}\n\n.ace_icon {\n display: inline-block;\n width: 18px;\n vertical-align: top;\n}\n\n.ace_icon_svg {\n display: inline-block;\n width: 12px;\n vertical-align: top;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: 12px;\n -webkit-mask-position: center;\n}\n\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\n padding-right: 13px;\n}\n\n.ace_fold-widget {\n box-sizing: border-box;\n\n margin: 0 -12px 0 1px;\n display: none;\n width: 11px;\n vertical-align: top;\n\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: center;\n\n border-radius: 3px;\n \n border: 1px solid transparent;\n cursor: pointer;\n}\n\n.ace_folding-enabled .ace_fold-widget {\n display: inline-block; \n}\n\n.ace_fold-widget.ace_end {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");\n}\n\n.ace_fold-widget.ace_closed {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n/**\n * Dark version for fold widgets\n */\n.ace_dark .ace_fold-widget {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");\n}\n.ace_dark .ace_fold-widget.ace_end {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");\n}\n.ace_dark .ace_fold-widget.ace_closed {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");\n}\n.ace_dark .ace_fold-widget:hover {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n background-color: rgba(255, 255, 255, 0.1);\n}\n.ace_dark .ace_fold-widget:active {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n}\n\n.ace_inline_button {\n border: 1px solid lightgray;\n display: inline-block;\n margin: -1px 8px;\n padding: 0 5px;\n pointer-events: auto;\n cursor: pointer;\n}\n.ace_inline_button:hover {\n border-color: gray;\n background: rgba(200,200,200,0.2);\n display: inline-block;\n pointer-events: auto;\n}\n\n.ace_fold-widget.ace_invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n transition: opacity 0.4s ease 0.05s;\n opacity: 0;\n}\n\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n transition: opacity 0.05s ease 0.05s;\n opacity:1;\n}\n\n.ace_underline {\n text-decoration: underline;\n}\n\n.ace_bold {\n font-weight: bold;\n}\n\n.ace_nobold .ace_bold {\n font-weight: normal;\n}\n\n.ace_italic {\n font-style: italic;\n}\n\n\n.ace_error-marker {\n background-color: rgba(255, 0, 0,0.2);\n position: absolute;\n z-index: 9;\n}\n\n.ace_highlight-marker {\n background-color: rgba(255, 255, 0,0.2);\n position: absolute;\n z-index: 8;\n}\n\n.ace_mobile-menu {\n position: absolute;\n line-height: 1.5;\n border-radius: 4px;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n background: white;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #dcdcdc;\n color: black;\n}\n.ace_dark > .ace_mobile-menu {\n background: #333;\n color: #ccc;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #444;\n\n}\n.ace_mobile-button {\n padding: 2px;\n cursor: pointer;\n overflow: hidden;\n}\n.ace_mobile-button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_mobile-button:active {\n background-color: #ddd;\n}\n\n.ace_placeholder {\n font-family: arial;\n transform: scale(0.9);\n transform-origin: left;\n white-space: pre;\n opacity: 0.7;\n margin: 0 10px;\n}\n\n.ace_ghost_text {\n opacity: 0.5;\n font-style: italic;\n white-space: pre;\n}\n\n.ace_screenreader-only {\n position:absolute;\n left:-10000px;\n top:auto;\n width:1px;\n height:1px;\n overflow:hidden;\n}'})),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,i){"use strict";var n=e("../lib/dom"),o=e("../lib/oop"),r=e("../lib/event_emitter").EventEmitter,s=function(){function e(e,t){this.canvas=n.createElement("canvas"),this.renderer=t,this.pixelRatio=1,this.maxHeight=t.layerConfig.maxHeight,this.lineHeight=t.layerConfig.lineHeight,this.canvasHeight=e.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=e.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},e.element.appendChild(this.canvas)}return e.prototype.$updateDecorators=function(e){var t=!0===this.renderer.theme.isDark?this.colors.dark:this.colors.light;e&&(this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.height,(e.lastRow+1)*this.lineHeight<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight);var i=this.canvas.getContext("2d"),n=this.renderer.session.$annotations;if(i.clearRect(0,0,this.canvas.width,this.canvas.height),n){var o={info:1,warning:2,error:3};n.forEach((function(e){e.priority=o[e.type]||null})),n=n.sort((function(e,t){return e.priority<t.priority?-1:e.priority>t.priority?1:0}));for(var r=this.renderer.session.$foldData,s=0;s<n.length;s++){var a=n[s].row,l=this.compensateFoldRows(a,r),c=Math.round((a-l)*this.lineHeight*this.heightRatio),h=Math.round((a-l)*this.lineHeight*this.heightRatio),d=Math.round(((a-l)*this.lineHeight+this.lineHeight)*this.heightRatio);if(d-h<this.minDecorationHeight){var u=(h+d)/2|0;u<this.halfMinDecorationHeight?u=this.halfMinDecorationHeight:u+this.halfMinDecorationHeight>this.canvasHeight&&(u=this.canvasHeight-this.halfMinDecorationHeight),h=Math.round(u-this.halfMinDecorationHeight),d=Math.round(u+this.halfMinDecorationHeight)}i.fillStyle=t[n[s].type]||null,i.fillRect(0,c,this.canvasWidth,d-h)}}var g=this.renderer.session.selection.getCursor();g&&(l=this.compensateFoldRows(g.row,r),c=Math.round((g.row-l)*this.lineHeight*this.heightRatio),i.fillStyle="rgba(0, 0, 0, 0.5)",i.fillRect(0,c,this.canvasWidth,2))},e.prototype.compensateFoldRows=function(e,t){var i=0;if(t&&t.length>0)for(var n=0;n<t.length;n++)e>t[n].start.row&&e<t[n].end.row?i+=e-t[n].start.row:e>=t[n].end.row&&(i+=t[n].end.row-t[n].start.row);return i},e}();o.implement(s.prototype,r),t.Decorator=s})),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent"],(function(e,t,i){"use strict";var n=e("./lib/oop"),o=e("./lib/dom"),r=e("./lib/lang"),s=e("./config"),a=e("./layer/gutter").Gutter,l=e("./layer/marker").Marker,c=e("./layer/text").Text,h=e("./layer/cursor").Cursor,d=e("./scrollbar").HScrollBar,u=e("./scrollbar").VScrollBar,g=e("./scrollbar_custom").HScrollBar,p=e("./scrollbar_custom").VScrollBar,m=e("./renderloop").RenderLoop,f=e("./layer/font_metrics").FontMetrics,v=e("./lib/event_emitter").EventEmitter,C=e("./css/editor-css"),y=e("./layer/decorators").Decorator,I=e("./lib/useragent");o.importCssString(C,"ace_editor.css",!1);var b=function(){function e(e,t){var i=this;this.container=e||o.createElement("div"),o.addCssClass(this.container,"ace_editor"),o.HI_DPI&&o.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),null==s.get("useStrictCSP")&&s.set("useStrictCSP",!1),this.$gutter=o.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=o.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=o.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new a(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new l(this.content);var n=this.$textLayer=new c(this.content);this.canvas=n.element,this.$markerFront=new l(this.content),this.$cursorLayer=new h(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new d(this.container,this),this.scrollBarV.on("scroll",(function(e){i.$scrollAnimation||i.session.setScrollTop(e.data-i.scrollMargin.top)})),this.scrollBarH.on("scroll",(function(e){i.$scrollAnimation||i.session.setScrollLeft(e.data-i.scrollMargin.left)})),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new f(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",(function(e){i.updateCharacterSize(),i.onResize(!0,i.gutterWidth,i.$size.width,i.$size.height),i._signal("changeCharacterSize",e)})),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!I.isIOS,this.$loop=new m(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),s.resetOptions(this),s._signal("renderer",this)}return e.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),o.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},e.prototype.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},e.prototype.updateLines=function(e,t,i){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRow<t&&(this.$changedLines.lastRow=t)):this.$changedLines={firstRow:e,lastRow:t},this.$changedLines.lastRow<this.layerConfig.firstRow){if(!i)return;this.$changedLines.lastRow=this.layerConfig.lastRow}this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},e.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},e.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},e.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},e.prototype.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},e.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},e.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},e.prototype.onResize=function(e,t,i,n){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var o=this.container;n||(n=o.clientHeight||o.scrollHeight),i||(i=o.clientWidth||o.scrollWidth);var r=this.$updateCachedSize(e,t,i,n);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!i&&!n)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(r|this.$changes,!0):this.$loop.schedule(r|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},e.prototype.$updateCachedSize=function(e,t,i,n){n-=this.$extraHeight||0;var r=0,s=this.$size,a={width:s.width,height:s.height,scrollerHeight:s.scrollerHeight,scrollerWidth:s.scrollerWidth};if(n&&(e||s.height!=n)&&(s.height=n,r|=this.CHANGE_SIZE,s.scrollerHeight=s.height,this.$horizScroll&&(s.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(s.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",r|=this.CHANGE_SCROLL),i&&(e||s.width!=i)){r|=this.CHANGE_SIZE,s.width=i,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,o.setStyle(this.scrollBarH.element.style,"left",t+"px"),o.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),s.scrollerWidth=Math.max(0,i-t-this.scrollBarV.getWidth()-this.margin.h),o.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";o.setStyle(this.scrollBarH.element.style,"right",l),o.setStyle(this.scroller.style,"right",l),o.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(s.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(r|=this.CHANGE_FULL)}return s.$dirty=!i||!n,r&&this._signal("resize",a),r},e.prototype.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},e.prototype.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},e.prototype.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},e.prototype.getAnimatedScroll=function(){return this.$animatedScroll},e.prototype.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},e.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},e.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},e.prototype.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},e.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},e.prototype.setHighlightIndentGuides=function(e){this.setOption("highlightIndentGuides",e)},e.prototype.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},e.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},e.prototype.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},e.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},e.prototype.getShowGutter=function(){return this.getOption("showGutter")},e.prototype.setShowGutter=function(e){return this.setOption("showGutter",e)},e.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},e.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},e.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},e.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},e.prototype.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=o.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=o.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},e.prototype.getContainerElement=function(){return this.container},e.prototype.getMouseEventTarget=function(){return this.scroller},e.prototype.getTextAreaContainer=function(){return this.container},e.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var i=this.$cursorLayer.$pixelPos;if(i){t&&t.markerRange&&(i=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var n=this.layerConfig,r=i.top,s=i.left;r-=n.offset;var a=t&&t.useTextareaForIME||I.isMobile?this.lineHeight:1;if(r<0||r>n.height-a)o.translate(this.textarea,0,0);else{var l=1,c=this.$size.height-a;if(t)if(t.useTextareaForIME){var h=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(h)[0]}else r+=this.lineHeight+2;else r+=this.lineHeight;(s-=this.scrollLeft)>this.$size.scrollerWidth-l&&(s=this.$size.scrollerWidth-l),s+=this.gutterWidth+this.margin.left,o.setStyle(e,"height",a+"px"),o.setStyle(e,"width",l+"px"),o.translate(this.textarea,Math.min(s,this.$size.scrollerWidth-l),Math.min(r,c))}}}else o.translate(this.textarea,-100,0)}},e.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},e.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},e.prototype.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},e.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},e.prototype.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},e.prototype.setScrollMargin=function(e,t,i,n){var o=this.scrollMargin;o.top=0|e,o.bottom=0|t,o.right=0|n,o.left=0|i,o.v=o.top+o.bottom,o.h=o.left+o.right,o.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-o.top),this.updateFull()},e.prototype.setMargin=function(e,t,i,n){var o=this.margin;o.top=0|e,o.bottom=0|t,o.right=0|n,o.left=0|i,o.v=o.top+o.bottom,o.h=o.left+o.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},e.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},e.prototype.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},e.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},e.prototype.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},e.prototype.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},e.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},e.prototype.freeze=function(){this.$frozen=!0},e.prototype.unfreeze=function(){this.$frozen=!1},e.prototype.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var i=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),i.firstRow!=this.layerConfig.firstRow&&i.firstRowScreen==this.layerConfig.firstRowScreen){var n=this.scrollTop+(i.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;n>0&&(this.scrollTop=n,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}i=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),o.translate(this.content,-this.scrollLeft,-i.offset);var r=i.width+2*this.$padding+"px",s=i.minHeight+"px";o.setStyle(this.content.style,"width",r),o.setStyle(this.content.style,"height",s)}if(e&this.CHANGE_H_SCROLL&&(o.translate(this.content,-this.scrollLeft,-i.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(i),this.$showGutter&&this.$gutterLayer.update(i),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(i),this.$markerBack.update(i),this.$markerFront.update(i),this.$cursorLayer.update(i),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(i):this.$textLayer.scrollLines(i),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(i):this.$gutterLayer.scrollLines(i)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(i),this.$markerBack.update(i),this.$markerFront.update(i),this.$cursorLayer.update(i),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(i),this.$showGutter&&this.$gutterLayer.update(i),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(i)):e&this.CHANGE_LINES?((this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(i),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(i)):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(i),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(i)):e&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(i),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(i)),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(i),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(i),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(i),this._signal("afterRender",e)}else this.$changes|=e},e.prototype.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,i=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(i+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&i>this.$maxPixelHeight&&(i=this.$maxPixelHeight);var n=!(i<=2*this.lineHeight)&&e>t;if(i!=this.desiredHeight||this.$size.height!=this.desiredHeight||n!=this.$vScroll){n!=this.$vScroll&&(this.$vScroll=n,this.scrollBarV.setVisible(n));var o=this.container.clientWidth;this.container.style.height=i+"px",this.$updateCachedSize(!0,this.$gutterWidth,o,i),this.desiredHeight=i,this._signal("autosize")}},e.prototype.$computeLayerConfig=function(){var e=this.session,t=this.$size,i=t.height<=2*this.lineHeight,n=this.session.getScreenLength()*this.lineHeight,o=this.$getLongestLine(),r=!i&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-o-2*this.$padding<0),s=this.$horizScroll!==r;s&&(this.$horizScroll=r,this.scrollBarH.setVisible(r));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,c=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;n+=c;var h=this.scrollMargin;this.session.setScrollTop(Math.max(-h.top,Math.min(this.scrollTop,n-t.scrollerHeight+h.bottom))),this.session.setScrollLeft(Math.max(-h.left,Math.min(this.scrollLeft,o+2*this.$padding-t.scrollerWidth+h.right)));var d=!i&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-n+c<0||this.scrollTop>h.top),u=a!==d;u&&(this.$vScroll=d,this.scrollBarV.setVisible(d));var g,p,m=this.scrollTop%this.lineHeight,f=Math.ceil(l/this.lineHeight)-1,v=Math.max(0,Math.round((this.scrollTop-m)/this.lineHeight)),C=v+f,y=this.lineHeight;v=e.screenToDocumentRow(v,0);var I=e.getFoldLine(v);I&&(v=I.start.row),g=e.documentToScreenRow(v,0),p=e.getRowLength(v)*y,C=Math.min(e.screenToDocumentRow(C,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(C)*y+p,m=this.scrollTop-g*y;var b=0;return(this.layerConfig.width!=o||s)&&(b=this.CHANGE_H_SCROLL),(s||u)&&(b|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),u&&(o=this.$getLongestLine())),this.layerConfig={width:o,padding:this.$padding,firstRow:v,firstRowScreen:g,lastRow:C,lineHeight:y,characterWidth:this.characterWidth,minHeight:l,maxHeight:n,offset:m,gutterOffset:y?Math.max(0,Math.ceil((m+t.height-t.scrollerHeight)/y)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(o-this.$padding),b},e.prototype.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var i=this.layerConfig;if(!(e>i.lastRow+1||t<i.firstRow))return t===1/0?(this.$showGutter&&this.$gutterLayer.update(i),void this.$textLayer.update(i)):(this.$textLayer.updateLines(i,e,t),!0)}},e.prototype.$getLongestLine=function(){var e=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(e+=1),this.$textLayer&&e>this.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},e.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},e.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},e.prototype.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},e.prototype.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},e.prototype.updateBreakpoints=function(e){this._rows=e,this.$loop.schedule(this.CHANGE_GUTTER)},e.prototype.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},e.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},e.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},e.prototype.showCursor=function(){this.$cursorLayer.showCursor()},e.prototype.scrollSelectionIntoView=function(e,t,i){this.scrollCursorIntoView(e,i),this.scrollCursorIntoView(t,i)},e.prototype.scrollCursorIntoView=function(e,t,i){if(0!==this.$size.scrollerHeight){var n=this.$cursorLayer.getPixelPosition(e),o=n.left,r=n.top,s=i&&i.top||0,a=i&&i.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+s>r?(t&&l+s>r+this.lineHeight&&(r-=t*this.$size.scrollerHeight),0===r&&(r=-this.scrollMargin.top),this.session.setScrollTop(r)):l+this.$size.scrollerHeight-a<r+this.lineHeight&&(t&&l+this.$size.scrollerHeight-a<r-this.lineHeight&&(r+=t*this.$size.scrollerHeight),this.session.setScrollTop(r+this.lineHeight+a-this.$size.scrollerHeight));var c=this.scrollLeft,h=2*this.layerConfig.characterWidth;o-h<c?((o-=h)<this.$padding+h&&(o=-this.scrollMargin.left),this.session.setScrollLeft(o)):(o+=h,c+this.$size.scrollerWidth<o+this.characterWidth?this.session.setScrollLeft(Math.round(o+this.characterWidth-this.$size.scrollerWidth)):c<=this.$padding&&o-c<this.characterWidth&&this.session.setScrollLeft(0))}},e.prototype.getScrollTop=function(){return this.session.getScrollTop()},e.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},e.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},e.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},e.prototype.scrollToRow=function(e){this.session.setScrollTop(e*this.lineHeight)},e.prototype.alignCursor=function(e,t){"number"==typeof e&&(e={row:e,column:0});var i=this.$cursorLayer.getPixelPosition(e),n=this.$size.scrollerHeight-this.lineHeight,o=i.top-n*(t||0);return this.session.setScrollTop(o),o},e.prototype.$calcSteps=function(e,t){var i,n,o=0,r=this.STEPS,s=[];for(o=0;o<r;++o)s.push((i=o/this.STEPS,n=e,(t-e)*(Math.pow(i-1,3)+1)+n));return s},e.prototype.scrollToLine=function(e,t,i,n){var o=this.$cursorLayer.getPixelPosition({row:e,column:0}).top;t&&(o-=this.$size.scrollerHeight/2);var r=this.scrollTop;this.session.setScrollTop(o),!1!==i&&this.animateScrolling(r,n)},e.prototype.animateScrolling=function(e,t){var i=this.scrollTop;if(this.$animatedScroll){var n=this;if(e!=i){if(this.$scrollAnimation){var o=this.$scrollAnimation.steps;if(o.length&&(e=o[0])==i)return}var r=n.$calcSteps(e,i);this.$scrollAnimation={from:e,to:i,steps:r},clearInterval(this.$timer),n.session.setScrollTop(r.shift()),n.session.$scrollTop=i,this.$timer=setInterval((function(){if(!n.$stopAnimation)return n.session?void(r.length?(n.session.setScrollTop(r.shift()),n.session.$scrollTop=i):null!=i?(n.session.$scrollTop=-1,n.session.setScrollTop(i),i=null):s()):clearInterval(n.$timer);s()}),10)}}function s(){n.$timer=clearInterval(n.$timer),n.$scrollAnimation=null,n.$stopAnimation=!1,t&&t()}},e.prototype.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},e.prototype.scrollToX=function(e){this.scrollLeft!==e&&(this.scrollLeft=e),this.$loop.schedule(this.CHANGE_H_SCROLL)},e.prototype.scrollTo=function(e,t){this.session.setScrollTop(t),this.session.setScrollLeft(e)},e.prototype.scrollBy=function(e,t){t&&this.session.setScrollTop(this.session.getScrollTop()+t),e&&this.session.setScrollLeft(this.session.getScrollLeft()+e)},e.prototype.isScrollableBy=function(e,t){return t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},e.prototype.pixelToScreenCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left,t=n[0]}else i=this.scroller.getBoundingClientRect();var o=e+this.scrollLeft-i.left-this.$padding,r=o/this.characterWidth,s=Math.floor((t+this.scrollTop-i.top)/this.lineHeight),a=this.$blockCursor?Math.floor(r):Math.round(r);return{row:s,column:a,side:r-a>0?1:-1,offsetX:o}},e.prototype.screenToTextCoordinates=function(e,t){var i;if(this.$hasCssTransforms){i={top:0,left:0};var n=this.$fontMetrics.transformCoordinates([e,t]);e=n[1]-this.gutterWidth-this.margin.left,t=n[0]}else i=this.scroller.getBoundingClientRect();var o=e+this.scrollLeft-i.left-this.$padding,r=o/this.characterWidth,s=this.$blockCursor?Math.floor(r):Math.round(r),a=Math.floor((t+this.scrollTop-i.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(s,0),o)},e.prototype.textToScreenCoordinates=function(e,t){var i=this.scroller.getBoundingClientRect(),n=this.session.documentToScreenPosition(e,t),o=this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e)?this.session.$bidiHandler.getPosLeft(n.column):Math.round(n.column*this.characterWidth)),r=n.row*this.lineHeight;return{pageX:i.left+o-this.scrollLeft,pageY:i.top+r-this.scrollTop}},e.prototype.visualizeFocus=function(){o.addCssClass(this.container,"ace_focus")},e.prototype.visualizeBlur=function(){o.removeCssClass(this.container,"ace_focus")},e.prototype.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),null==e.useTextareaForIME&&(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(o.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},e.prototype.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},e.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),o.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var e=this.session.selection.cursor;this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},e.prototype.setGhostText=function(e,t){var i=this.session.selection.cursor,n=t||{row:i.row,column:i.column};this.removeGhostText();var o=e.split("\n");if(this.addToken(o[0],"ghost_text",n.row,n.column),this.$ghostText={text:e,position:{row:n.row,column:n.column}},o.length>1){this.$ghostTextWidget={text:o.slice(1).join("\n"),row:n.row,column:n.column,className:"ace_ghost_text"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var r=this.$cursorLayer.getPixelPosition(n,!0),s=this.container.getBoundingClientRect().height,a=o.length*this.lineHeight;if(a<s-r.top)return;a<s?this.scrollBy(0,(o.length-1)*this.lineHeight):this.scrollBy(0,r.top)}},e.prototype.removeGhostText=function(){if(this.$ghostText){var e=this.$ghostText.position;this.removeExtraToken(e.row,e.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},e.prototype.addToken=function(e,t,i,n){var o=this.session;o.bgTokenizer.lines[i]=null;var r={type:t,value:e},s=o.getTokens(i);if(null!=n&&s.length)for(var a=0,l=0;l<s.length;l++){var c=s[l];if(n<=(a+=c.value.length)){var h=c.value.length-(a-n),d=c.value.slice(0,h),u=c.value.slice(h);s.splice(l,1,{type:c.type,value:d},r,{type:c.type,value:u});break}}else s.push(r);this.updateLines(i,i)},e.prototype.removeExtraToken=function(e,t){this.session.bgTokenizer.lines[e]=null,this.updateLines(e,e)},e.prototype.setTheme=function(e,t){var i=this;if(this.$themeId=e,i._dispatchEvent("themeChange",{theme:e}),e&&"string"!=typeof e)r(e);else{var n=e||this.$options.theme.initialValue;s.loadModule(["theme",n],r)}function r(n){if(i.$themeId!=e)return t&&t();if(!n||!n.cssClass)throw new Error("couldn't load module "+e+" or it didn't call define");n.$id&&(i.$themeId=n.$id),o.importCssString(n.cssText,n.cssClass,i.container),i.theme&&o.removeCssClass(i.container,i.theme.cssClass);var r="padding"in n?n.padding:"padding"in(i.theme||{})?4:i.$padding;i.$padding&&r!=i.$padding&&i.setPadding(r),i.$theme=n.cssClass,i.theme=n,o.addCssClass(i.container,n.cssClass),o.setCssClass(i.container,"ace_dark",n.isDark),i.$size&&(i.$size.width=0,i.$updateSizeAsync()),i._dispatchEvent("themeLoaded",{theme:n}),t&&t()}},e.prototype.getTheme=function(){return this.$themeId},e.prototype.setStyle=function(e,t){o.setCssClass(this.container,e,!1!==t)},e.prototype.unsetStyle=function(e){o.removeCssClass(this.container,e)},e.prototype.setCursorStyle=function(e){o.setStyle(this.scroller.style,"cursor",e)},e.prototype.setMouseCursor=function(e){o.setStyle(this.scroller.style,"cursor",e)},e.prototype.attachToShadowRoot=function(){o.importCssString(C,"ace_editor.css",this.container)},e.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},e.prototype.$updateCustomScrollbar=function(e){var t=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,!0===e?(this.scrollBarV=new p(this.container,this),this.scrollBarH=new g(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollTop(e.data-t.scrollMargin.top)})),this.scrollBarH.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollLeft(e.data-t.scrollMargin.left)})),this.$scrollDecorator=new y(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new u(this.container,this),this.scrollBarH=new d(this.container,this),this.scrollBarV.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollTop(e.data-t.scrollMargin.top)})),this.scrollBarH.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollLeft(e.data-t.scrollMargin.left)})))},e.prototype.$addResizeObserver=function(){if(window.ResizeObserver&&!this.$resizeObserver){var e=this;this.$resizeTimer=r.delayedCall((function(){e.destroyed||e.onResize()}),50),this.$resizeObserver=new window.ResizeObserver((function(t){var i=t[0].contentRect.width,n=t[0].contentRect.height;Math.abs(e.$size.width-i)>1||Math.abs(e.$size.height-n)>1?e.$resizeTimer.delay():e.$resizeTimer.cancel()})),this.$resizeObserver.observe(this.container)}},e}();b.prototype.CHANGE_CURSOR=1,b.prototype.CHANGE_MARKER=2,b.prototype.CHANGE_GUTTER=4,b.prototype.CHANGE_SCROLL=8,b.prototype.CHANGE_LINES=16,b.prototype.CHANGE_TEXT=32,b.prototype.CHANGE_SIZE=64,b.prototype.CHANGE_MARKER_BACK=128,b.prototype.CHANGE_MARKER_FRONT=256,b.prototype.CHANGE_FULL=512,b.prototype.CHANGE_H_SCROLL=1024,b.prototype.$changes=0,b.prototype.$padding=null,b.prototype.$frozen=!1,b.prototype.STEPS=8,n.implement(b.prototype,v),s.defineOptions(b.prototype,"renderer",{useResizeObserver:{set:function(e){!e&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):e&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(e){this.$gutterLayer.$useSvgGutterIcons=e},initialValue:!1},showFoldedAnnotations:{set:function(e){this.$gutterLayer.$showFoldedAnnotations=e},initialValue:!1},fadeFoldWidgets:{set:function(e){o.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(e){1==this.$textLayer.setHighlightIndentGuides(e)?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){this.$hScrollBarAlwaysVisible&&this.$horizScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){this.$vScrollBarAlwaysVisible&&this.$vScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof e&&(e+="px"),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(e){this.$updateCustomScrollbar(e)},initialValue:!1},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!I.isMobile&&!I.isIE}}),t.VirtualRenderer=b})),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],(function(e,t,i){"use strict";var n=e("../lib/oop"),o=e("../lib/net"),r=e("../lib/event_emitter").EventEmitter,s=e("../config");function a(e){if("undefined"==typeof Worker)return{postMessage:function(){},terminate:function(){}};if(s.get("loadWorkerFromBlob")){var t=function(e){var t="importScripts('"+o.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var i=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return i.append(t),i.getBlob("application/javascript")}}(e),i=(window.URL||window.webkitURL).createObjectURL(t);return new Worker(i)}return new Worker(e)}var l=function(e){e.postMessage||(e=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=e,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){n.implement(this,r),this.$createWorkerFromOldConfig=function(t,i,n,o,r){if(e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),s.get("packaged")||!e.toUrl)o=o||s.moduleUrl(i,"worker");else{var l=this.$normalizePath;o=o||l(e.toUrl("ace/worker/worker.js",null,"_"));var c={};t.forEach((function(t){c[t]=l(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))}))}return this.$worker=a(o),r&&this.send("importScripts",r),this.$worker.postMessage({init:!0,tlns:c,module:i,classname:n}),this.$worker},this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var i=this.callbacks[t.id];i&&(i(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return o.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(e){e.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,i){if(i){var n=this.callbackId++;this.callbacks[n]=i,t.push(n)}this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker&&this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener,!0)},this.changeListener=function(e){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),"insert"==e.action?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,e.length>50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,i){var n=null,o=!1,a=Object.create(r),c=[],h=new l({messageBuffer:c,terminate:function(){},postMessage:function(e){c.push(e),n&&(o?setTimeout(d):d())}});h.setEmitSync=function(e){o=e};var d=function(){var e=c.shift();e.command?n[e.command].apply(n,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){h.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},s.loadModule(["worker",t],(function(e){for(n=new e[i](a);c.length;)d()})),h},t.WorkerClient=l,t.createWorker=a})),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],(function(e,t,i){"use strict";var n=e("./range").Range,o=e("./lib/event_emitter").EventEmitter,r=e("./lib/oop"),s=function(){function e(e,t,i,n,o,r){var s=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=o,this.othersClass=r,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=n,this.$onCursorChange=function(){setTimeout((function(){s.onCursorChange()}))},this.$pos=i;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}return e.prototype.setup=function(){var e=this,t=this.doc,i=this.session;this.selectionBefore=i.selection.toJSON(),i.selection.inMultiSelectMode&&i.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var o=this.pos;o.$insertRight=!0,o.detach(),o.markerId=i.addMarker(new n(o.row,o.column,o.row,o.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach((function(i){var n=t.createAnchor(i.row,i.column);n.$insertRight=!0,n.detach(),e.others.push(n)})),i.setUndoSelect(!1)},e.prototype.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach((function(i){i.markerId=e.addMarker(new n(i.row,i.column,i.row,i.column+t.length),t.othersClass,null,!1)}))}},e.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},e.prototype.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var i="insert"===e.action?t.end.column-t.start.column:t.start.column-t.end.column,o=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,r=t.start.column-this.pos.column;if(this.updateAnchors(e),o&&(this.length+=i),o&&!this.session.$fromUndo)if("insert"===e.action)for(var s=this.others.length-1;s>=0;s--){var a={row:(l=this.others[s]).row,column:l.column+r};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(s=this.others.length-1;s>=0;s--){var l;a={row:(l=this.others[s]).row,column:l.column+r},this.doc.remove(new n(a.row,a.column,a.row,a.column-i))}this.$updating=!1,this.updateMarkers()}},e.prototype.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},e.prototype.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,i=function(i,o){t.removeMarker(i.markerId),i.markerId=t.addMarker(new n(i.row,i.column,i.row,i.column+e.length),o,null,!1)};i(this.pos,this.mainClass);for(var o=this.others.length;o--;)i(this.others[o],this.othersClass)}},e.prototype.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},e.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},e.prototype.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,i=0;i<t;i++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},e}();r.implement(s.prototype,o),t.PlaceHolder=s})),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,i){var n=e("../lib/event"),o=e("../lib/useragent");function r(e,t){return e.row==t.row&&e.column==t.column}t.onMouseDown=function(e){var t=e.domEvent,i=t.altKey,s=t.shiftKey,a=t.ctrlKey,l=e.getAccelKey(),c=e.getButton();if(a&&o.isMac&&(c=t.button),e.editor.inMultiSelectMode&&2==c)e.editor.textInput.onContextMenu(e.domEvent);else if(a||i||l){if(0===c){var h,d=e.editor,u=d.selection,g=d.inMultiSelectMode,p=e.getDocumentPosition(),m=u.getCursor(),f=e.inSelection()||u.isEmpty()&&r(p,m),v=e.x,C=e.y,y=d.session,I=d.renderer.pixelToScreenCoordinates(v,C),b=I;if(d.$mouseHandler.$enableJumpToDef)a&&i||l&&i?h=s?"block":"add":i&&d.$blockSelectEnabled&&(h="block");else if(l&&!i){if(h="add",!g&&s)return}else i&&d.$blockSelectEnabled&&(h="block");if(h&&o.isMac&&t.ctrlKey&&d.$mouseHandler.cancelContextMenu(),"add"==h){if(!g&&f)return;if(!g){var A=u.toOrientedRange();d.addSelectionMarker(A)}var w=u.rangeList.rangeAtPoint(p);d.inVirtualSelectionMode=!0,s&&(w=null,A=u.ranges[0]||A,d.removeSelectionMarker(A)),d.once("mouseup",(function(){var e=u.toOrientedRange();w&&e.isEmpty()&&r(w.cursor,e.cursor)?u.substractPoint(e.cursor):(s?u.substractPoint(A.cursor):A&&(d.removeSelectionMarker(A),u.addRange(A)),u.addRange(e)),d.inVirtualSelectionMode=!1}))}else if("block"==h){var S;e.stop(),d.inVirtualSelectionMode=!0;var x=[],k=function(){var e=d.renderer.pixelToScreenCoordinates(v,C),t=y.screenToDocumentPosition(e.row,e.column,e.offsetX);r(b,e)&&r(t,u.lead)||(b=e,d.selection.moveToPosition(t),d.renderer.scrollCursorIntoView(),d.removeSelectionMarkers(x),x=u.rectangularRangeBlock(b,I),d.$mouseHandler.$clickSelection&&1==x.length&&x[0].isEmpty()&&(x[0]=d.$mouseHandler.$clickSelection.clone()),x.forEach(d.addSelectionMarker,d),d.updateSelectionMarkers())};g&&!l?u.toSingleRange():!g&&l&&(S=u.toOrientedRange(),d.addSelectionMarker(S)),s?I=y.documentToScreenPosition(u.lead):u.moveToPosition(p),b={row:-1,column:-1};var T=k;n.capture(d.container,(function(e){v=e.clientX,C=e.clientY}),(function(e){k(),clearInterval(E),d.removeSelectionMarkers(x),x.length||(x=[u.toOrientedRange()]),S&&(d.removeSelectionMarker(S),u.toSingleRange(S));for(var t=0;t<x.length;t++)u.addRange(x[t]);d.inVirtualSelectionMode=!1,d.$mouseHandler.$clickSelection=null}));var E=setInterval((function(){T()}),20);return e.preventDefault()}}}else 0===c&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode()}})),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],(function(e,t,i){t.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(e){e.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(e){e.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split selection into lines",exec:function(e){e.multiSelect.rangeCount>1?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var n=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new n(t.multiSelectCommands)})),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],(function(e,t,i){var n=e("./range_list").RangeList,o=e("./range").Range,r=e("./selection").Selection,s=e("./mouse/multi_select_handler").onMouseDown,a=e("./lib/event"),l=e("./lib/lang"),c=e("./commands/multi_select_commands");t.commands=c.defaultCommands.concat(c.multiSelectCommands);var h=new(0,e("./search").Search),d=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(d.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var i=this.toOrientedRange();if(this.rangeList.add(i),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(i),this.$onAddRange(i)}e.cursor||(e.cursor=e.end);var n=this.rangeList.add(e);return this.$onAddRange(e),n.length&&this.$onRemoveRange(n),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var i=e.length;i--;){var n=this.ranges.indexOf(e[i]);this.ranges.splice(n,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new n,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var e=this.ranges.length?this.ranges:[this.getRange()],t=[],i=0;i<e.length;i++){var n=e[i],r=n.start.row,s=n.end.row;if(r===s)t.push(n.clone());else{for(t.push(new o(r,n.start.column,r,this.session.getLine(r).length));++r<s;)t.push(this.getLineRange(r,!0));t.push(new o(s,0,s,n.end.column))}0!=i||this.isBackwards()||(t=t.reverse())}for(this.toSingleRange(),i=t.length;i--;)this.addRange(t[i])},this.joinSelections=function(){var e=this.rangeList.ranges,t=e[e.length-1],i=o.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(i,t.cursor==t.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],i=o.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(i,t.cursor==t.start)}else{var n=this.session.documentToScreenPosition(this.cursor),r=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(n,r).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,i){var n=[],r=e.column<t.column;if(r)var s=e.column,a=t.column,l=e.offsetX,c=t.offsetX;else s=t.column,a=e.column,l=t.offsetX,c=e.offsetX;var h,d,u,g=e.row<t.row;if(g)var p=e.row,m=t.row;else p=t.row,m=e.row;s<0&&(s=0),p<0&&(p=0),p==m&&(i=!0);for(var f=p;f<=m;f++){var v=o.fromPoints(this.session.screenToDocumentPosition(f,s,l),this.session.screenToDocumentPosition(f,a,c));if(v.isEmpty()){if(h&&(d=v.end,u=h,d.row==u.row&&d.column==u.column))break;h=v.end}v.cursor=r?v.start:v.end,n.push(v)}if(g&&n.reverse(),!i){for(var C=n.length-1;n[C].isEmpty()&&C>0;)C--;if(C>0)for(var y=0;n[y].isEmpty();)y++;for(var I=C;I>=y;I--)n[I].isEmpty()&&n.splice(I,1)}return n}}.call(r.prototype);var u=e("./editor").Editor;function g(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",s),e.commands.addCommands(c.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),i=!1;a.addListener(t,"keydown",(function(t){var o=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&o?i||(e.renderer.setMouseCursor("crosshair"),i=!0):i&&n()}),e),a.addListener(t,"keyup",n,e),a.addListener(t,"blur",n,e)}function n(t){i&&(e.renderer.setMouseCursor(""),i=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,i=e.length;i--;){var n=e[i];if(n.marker){this.session.removeMarker(n.marker);var o=t.indexOf(n);-1!=o&&t.splice(o,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(c.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(c.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,i=e.editor;if(i.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?n=i.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?n=i.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(i.exitMultiSelectMode(),n=t.exec(i,e.args||{})):n=t.multiSelectAction(i,e.args||{});else{var n=t.exec(i,e.args||{});i.multiSelect.addRange(i.multiSelect.toOrientedRange()),i.multiSelect.mergeOverlappingRanges()}return n}},this.forEachSelection=function(e,t,i){if(!this.inVirtualSelectionMode){var n,o=i&&i.keepOrder,s=1==i||i&&i.$byLines,a=this.session,l=this.selection,c=l.rangeList,h=(o?l:c).ranges;if(!h.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var d=l._eventRegistry;l._eventRegistry={};var u=new r(a);this.inVirtualSelectionMode=!0;for(var g=h.length;g--;){if(s)for(;g>0&&h[g].start.row==h[g-1].end.row;)g--;u.fromOrientedRange(h[g]),u.index=g,this.selection=a.selection=u;var p=e.exec?e.exec(this,t||{}):e(this,t||{});n||void 0===p||(n=p),u.toOrientedRange(h[g])}u.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=d,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var m=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),m&&m.from==m.to&&this.renderer.animateScrolling(m.from),n}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,i=[],n=0;n<t.length;n++)i.push(this.session.getTextRange(t[n]));var o=this.session.getDocument().getNewLineCharacter();(e=i.join(o)).length==(i.length-1)*o.length&&(e="")}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.$checkMultiselectChange=function(e,t){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var i=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&t==this.multiSelect.anchor)return;var n=t==this.multiSelect.anchor?i.cursor==i.start?i.end:i.start:i.cursor;n.row!=t.row||this.session.$clipPositionToDocument(n.row,n.column).column!=t.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(e,t,i){if((t=t||{}).needle=e||t.needle,null==t.needle){var n=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();t.needle=this.session.getTextRange(n)}this.$search.set(t);var o=this.$search.findAll(this.session);if(!o.length)return 0;var r=this.multiSelect;i||r.toSingleRange(o[0]);for(var s=o.length;s--;)r.addRange(o[s],!0);return n&&r.rangeList.rangeAtPoint(n.start)&&r.addRange(n,!0),o.length},this.selectMoreLines=function(e,t){var i=this.selection.toOrientedRange(),n=i.cursor==i.end,r=this.session.documentToScreenPosition(i.cursor);this.selection.$desiredColumn&&(r.column=this.selection.$desiredColumn);var s,a=this.session.screenToDocumentPosition(r.row+e,r.column);if(i.isEmpty())c=a;else var l=this.session.documentToScreenPosition(n?i.end:i.start),c=this.session.screenToDocumentPosition(l.row+e,l.column);if(n?(s=o.fromPoints(a,c)).cursor=s.start:(s=o.fromPoints(c,a)).cursor=s.end,s.desiredColumn=r.column,this.selection.inMultiSelectMode){if(t)var h=i.cursor}else this.selection.addRange(i);this.selection.addRange(s),h&&this.selection.substractPoint(h)},this.transposeSelections=function(e){for(var t=this.session,i=t.multiSelect,n=i.ranges,o=n.length;o--;)if((a=n[o]).isEmpty()){var r=t.getWordRange(a.start.row,a.start.column);a.start.row=r.start.row,a.start.column=r.start.column,a.end.row=r.end.row,a.end.column=r.end.column}i.mergeOverlappingRanges();var s=[];for(o=n.length;o--;){var a=n[o];s.unshift(t.getTextRange(a))}for(e<0?s.unshift(s.pop()):s.push(s.shift()),o=n.length;o--;){var l=(a=n[o]).clone();t.replace(a,s[o]),a.start.row=l.start.row,a.start.column=l.start.column}i.fromOrientedRange(i.ranges[0])},this.selectMore=function(e,t,i){var n=this.session,o=n.multiSelect.toOrientedRange();if(!o.isEmpty()||((o=n.getWordRange(o.start.row,o.start.column)).cursor=-1==e?o.start:o.end,this.multiSelect.addRange(o),!i)){var r=n.getTextRange(o),s=function(e,t,i){return h.$options.wrap=!0,h.$options.needle=t,h.$options.backwards=-1==i,h.find(e)}(n,r,e);s&&(s.cursor=-1==e?s.start:s.end,this.session.unfold(s),this.multiSelect.addRange(s),this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(o.cursor)}},this.alignCursors=function(){var e=this.session,t=e.multiSelect,i=t.ranges,n=-1,r=i.filter((function(e){if(e.cursor.row==n)return!0;n=e.cursor.row}));if(i.length&&r.length!=i.length-1){r.forEach((function(e){t.substractPoint(e.cursor)}));var s=0,a=1/0,c=i.map((function(t){var i=t.cursor,n=e.getLine(i.row).substr(i.column).search(/\S/g);return-1==n&&(n=0),i.column>s&&(s=i.column),n<a&&(a=n),n}));i.forEach((function(t,i){var n=t.cursor,r=s-n.column,h=c[i]-a;r>h?e.insert(n,l.stringRepeat(" ",r-h)):e.remove(new o(n.row,n.column,n.row,n.column-r+h)),t.start.column=t.end.column=s,t.start.row=t.end.row=n.row,t.cursor=t.end})),t.fromOrientedRange(i[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var h=this.selection.getRange(),d=h.start.row,u=h.end.row,g=d==u;if(g){var p,m=this.session.getLength();do{p=this.session.getLine(u)}while(/[=:]/.test(p)&&++u<m);do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&--d>0);d<0&&(d=0),u>=m&&(u=m-1)}var f=this.session.removeFullLines(d,u);f=this.$reAlignText(f,g),this.session.insert({row:d,column:0},f.join("\n")+"\n"),g||(h.start.column=0,h.end.column=f[f.length-1].length),this.selection.setRange(h)}},this.$reAlignText=function(e,t){var i,n,o,r=!0,s=!0;return e.map((function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==i?(i=t[1].length,n=t[2].length,o=t[3].length,t):(i+n+o!=t[1].length+t[2].length+t[3].length&&(s=!1),i!=t[1].length&&(r=!1),i>t[1].length&&(i=t[1].length),n<t[2].length&&(n=t[2].length),o>t[3].length&&(o=t[3].length),t):[e]})).map(t?c:r?s?function(e){return e[2]?a(i+n-e[2].length)+e[2]+a(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:c:function(e){return e[2]?a(i)+e[2]+a(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function c(e){return e[2]?a(i)+e[2]+a(n-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(u.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var i=e.oldSession;i&&(i.multiSelect.off("addRange",this.$onAddRange),i.multiSelect.off("removeRange",this.$onRemoveRange),i.multiSelect.off("multiSelect",this.$onMultiSelect),i.multiSelect.off("singleSelect",this.$onSingleSelect),i.multiSelect.lead.off("change",this.$checkMultiselectChange),i.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=g,e("./config").defineOptions(u.prototype,"editor",{enableMultiselect:{set:function(e){g(this),e?this.on("mousedown",s):this.off("mousedown",s)},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})})),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],(function(e,t,i){"use strict";var n=e("../../range").Range,o=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,i){var n=e.getLine(i);return this.foldingStartMarker.test(n)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(n)?"end":""},this.getFoldWidgetRange=function(e,t,i){return null},this.indentationBlock=function(e,t,i){var o=/\S/,r=e.getLine(t),s=r.search(o);if(-1!=s){for(var a=i||r.length,l=e.getLength(),c=t,h=t;++t<l;){var d=e.getLine(t).search(o);if(-1!=d){if(d<=s){var u=e.getTokenAt(t,0);if(!u||"string"!==u.type)break}h=t}}if(h>c){var g=e.getLine(h).length;return new n(c,a,h,g)}}},this.openingBracketBlock=function(e,t,i,o,r){var s={row:i,column:o+1},a=e.$findClosingBracket(t,s,r);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>s.row&&(a.row--,a.column=e.getLine(a.row).length),n.fromPoints(s,a)}},this.closingBracketBlock=function(e,t,i,o,r){var s={row:i,column:o},a=e.$findOpeningBracket(t,s);if(a)return a.column++,s.column--,n.fromPoints(a,s)}}).call(o.prototype)})),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"],(function(e,t,i){"use strict";var n=e("../line_widgets").LineWidgets,o=e("../lib/dom"),r=e("../range").Range,s=e("../config").nls;t.showErrorMarker=function(e,t){var i=e.session;i.widgetManager||(i.widgetManager=new n(i),i.widgetManager.attach(e));var a=e.getCursorPosition(),l=a.row,c=i.widgetManager.getWidgetsAtRow(l).filter((function(e){return"errorMarker"==e.type}))[0];c?c.destroy():l-=t;var h,d=function(e,t,i){var n=e.getAnnotations().sort(r.comparePoints);if(n.length){var o=function(e,t,i){for(var n=0,o=e.length-1;n<=o;){var r=n+o>>1,s=i(t,e[r]);if(s>0)n=r+1;else{if(!(s<0))return r;o=r-1}}return-(n+1)}(n,{row:t,column:-1},r.comparePoints);o<0&&(o=-o-1),o>=n.length?o=i>0?0:n.length-1:0===o&&i<0&&(o=n.length-1);var s=n[o];if(s&&i){if(s.row===t){do{s=n[o+=i]}while(s&&s.row===t);if(!s)return n.slice()}var a=[];t=s.row;do{a[i<0?"unshift":"push"](s),s=n[o+=i]}while(s&&s.row==t);return a.length&&a}}}(i,l,t);if(d){var u=d[0];a.column=(u.pos&&"number"!=typeof u.column?u.pos.sc:u.column)||0,a.row=u.row,h=e.renderer.$gutterLayer.$annotations[a.row]}else{if(c)return;h={text:[s("Looks good!")],className:"ace_ok"}}e.session.unfold(a.row),e.selection.moveToPosition(a);var g={row:a.row,fixedWidth:!0,coverGutter:!0,el:o.createElement("div"),type:"errorMarker"},p=g.el.appendChild(o.createElement("div")),m=g.el.appendChild(o.createElement("div"));m.className="error_widget_arrow "+h.className;var f=e.renderer.$cursorLayer.getPixelPosition(a).left;m.style.left=f+e.renderer.gutterWidth-5+"px",g.el.className="error_widget_wrapper",p.className="error_widget "+h.className,p.innerHTML=h.text.join("<br>"),p.appendChild(o.createElement("div"));var v=function(e,t,i){if(0===t&&("esc"===i||"return"===i))return g.destroy(),{command:"null"}};g.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(v),i.widgetManager.removeLineWidget(g),e.off("changeSelection",g.destroy),e.off("changeSession",g.destroy),e.off("mouseup",g.destroy),e.off("change",g.destroy))},e.keyBinding.addKeyboardHandler(v),e.on("changeSelection",g.destroy),e.on("changeSession",g.destroy),e.on("mouseup",g.destroy),e.on("change",g.destroy),e.session.widgetManager.addLineWidget(g),g.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:g.el.offsetHeight})},o.importCssString("\n .error_widget_wrapper {\n background: inherit;\n color: inherit;\n border:none\n }\n .error_widget {\n border-top: solid 2px;\n border-bottom: solid 2px;\n margin: 5px 0;\n padding: 10px 40px;\n white-space: pre-wrap;\n }\n .error_widget.ace_error, .error_widget_arrow.ace_error{\n border-color: #ff5a5a\n }\n .error_widget.ace_warning, .error_widget_arrow.ace_warning{\n border-color: #F1D817\n }\n .error_widget.ace_info, .error_widget_arrow.ace_info{\n border-color: #5a5a5a\n }\n .error_widget.ace_ok, .error_widget_arrow.ace_ok{\n border-color: #5aaa5a\n }\n .error_widget_arrow {\n position: absolute;\n border: solid 5px;\n border-top-color: transparent!important;\n border-right-color: transparent!important;\n border-left-color: transparent!important;\n top: -5px;\n }\n","error_marker.css",!1)})),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],(function(e,t,i){"use strict";e("./loader_build")(t);var n=e("./lib/dom"),o=e("./range").Range,r=e("./editor").Editor,s=e("./edit_session").EditSession,a=e("./undomanager").UndoManager,l=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.edit=function(e,i){if("string"==typeof e){var o=e;if(!(e=document.getElementById(o)))throw new Error("ace.edit can't find div #"+o)}if(e&&e.env&&e.env.editor instanceof r)return e.env.editor;var s="";if(e&&/input|textarea/i.test(e.tagName)){var a=e;s=a.value,e=n.createElement("pre"),a.parentNode.replaceChild(e,a)}else e&&(s=e.textContent,e.innerHTML="");var c=t.createEditSession(s),h=new r(new l(e),c,i),d={document:c,editor:h,onResize:h.resize.bind(h,null)};return a&&(d.textarea=a),h.on("destroy",(function(){d.editor.container.env=null})),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var i=new s(e,t);return i.setUndoManager(new a),i},t.Range=o,t.Editor=r,t.EditSession=s,t.UndoManager=a,t.VirtualRenderer=l,t.version=t.config.version})),ace.require(["ace/ace"],(function(t){t&&(t.config.init(!0),t.define=ace.define);var i=function(){return this}();for(var n in i||"undefined"==typeof window||(i=window),i||"undefined"==typeof self||(i=self),i.ace||(i.ace=t),t)t.hasOwnProperty(n)&&(i.ace[n]=t[n]);i.ace.default=i.ace,e&&(e.exports=i.ace)}))},6489:function(e,t,i){e=i.nmd(e),ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],(function(e,t,i){"use strict";var n=e("./lib/dom"),o=e("./lib/oop"),r=e("./lib/event_emitter").EventEmitter,s=e("./lib/lang"),a=e("./range").Range,l=e("./range_list").RangeList,c=e("./keyboard/hash_handler").HashHandler,h=e("./tokenizer").Tokenizer,d=e("./clipboard"),u={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,i){var n=e.session.getTextRange();return i?n.replace(/\n\r?([ \t]*\S)/g,"\n"+i+"$1"):n},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return d.getText&&d.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(e){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.start||""},BLOCK_COMMENT_END:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.end||""},LINE_COMMENT:function(e){return(e.session.$mode||{}).lineCommentStart||""},CURRENT_YEAR:g.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:g.bind(null,{year:"2-digit"}),CURRENT_MONTH:g.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:g.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:g.bind(null,{month:"short"}),CURRENT_DATE:g.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:g.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:g.bind(null,{weekday:"short"}),CURRENT_HOUR:g.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:g.bind(null,{minute:"2-digit"}),CURRENT_SECOND:g.bind(null,{second:"2-digit"})};function g(e){var t=(new Date).toLocaleString("en-us",e);return 1==t.length?"0"+t:t}u.SELECTED_TEXT=u.SELECTION;var p=function(){function e(){this.snippetMap={},this.snippetNameMap={},this.variables=u}return e.prototype.getTokenizer=function(){return e.$tokenizer||this.createTokenizer()},e.prototype.createTokenizer=function(){function t(e){return e=e.substr(1),/^\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function i(e){return"(?:[^\\\\"+e+"]|\\\\.)"}var n={regex:"/("+i("/")+"+)/",onMatch:function(e,t,i){var n=i[0];return n.fmtString=!0,n.guard=e.slice(1,-1),n.flag="",""},next:"formatString"};return e.$tokenizer=new h({start:[{regex:/\\./,onMatch:function(e,t,i){var n=e[1];return("}"==n&&i.length||-1!="`$\\".indexOf(n))&&(e=n),[e]}},{regex:/}/,onMatch:function(e,t,i){return[i.length?i.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:t},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(e,i,n){var o=t(e.substr(1));return n.unshift(o[0]),o},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+i("\\|")+"*\\|",onMatch:function(e,t,i){var n=e.slice(1,-1).replace(/\\[,|\\]|,/g,(function(e){return 2==e.length?e[1]:"\0"})).split("\0").map((function(e){return{value:e}}));return i[0].choices=n,[n[0]]},next:"start"},n,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(e,t,i){return i.length&&i[0].expectElse?(i[0].expectElse=!1,i[0].ifEnd={elseEnd:i[0]},[i[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(e,t,i){var n=e[1];return"}"==n&&i.length||-1!="`$\\".indexOf(n)?e=n:"n"==n?e="\n":"t"==n?e="\t":-1!="ulULE".indexOf(n)&&(e={changeCase:n,local:n>"a"}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,i){var n=i.shift();return n&&(n.flag=e.slice(1,-1)),this.next=n&&n.tabstopId?"start":"",[n||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e,t,i){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,i){var n={text:e.slice(2)};return i.unshift(n),[n]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,i){var n=i.shift();return this.next=n&&n.tabstopId?"start":"",[n||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,i){return i[0].formatFunction=e.slice(2,-1),[i.shift()]},next:"formatString"},n,{regex:/:[\?\-+]?/,onMatch:function(e,t,i){"+"==e[1]&&(i[0].ifEnd=i[0]),"?"==e[1]&&(i[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),e.$tokenizer},e.prototype.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map((function(e){return e.value||e}))},e.prototype.getVariableValue=function(e,t,i){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";if(t=t.replace(/^TM_/,""),!this.variables.hasOwnProperty(t))return"";var n=this.variables[t];return"function"==typeof n&&(n=this.variables[t](e,t,i)),n??""},e.prototype.tmStrFormat=function(e,t,i){if(!t.fmt)return e;var n=t.flag||"",o=t.guard;o=new RegExp(o,n.replace(/[^gim]/g,""));var r="string"==typeof t.fmt?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,s=this,a=e.replace(o,(function(){var e=s.variables.__;s.variables.__=[].slice.call(arguments);for(var t=s.resolveVariables(r,i),n="E",o=0;o<t.length;o++){var a=t[o];if("object"==typeof a)if(t[o]="",a.changeCase&&a.local){var l=t[o+1];l&&"string"==typeof l&&("u"==a.changeCase?t[o]=l[0].toUpperCase():t[o]=l[0].toLowerCase(),t[o+1]=l.substr(1))}else a.changeCase&&(n=a.changeCase);else"U"==n?t[o]=a.toUpperCase():"L"==n&&(t[o]=a.toLowerCase())}return s.variables.__=e,t.join("")}));return a},e.prototype.tmFormatFunction=function(e,t,i){return"upcase"==t.formatFunction?e.toUpperCase():"downcase"==t.formatFunction?e.toLowerCase():e},e.prototype.resolveVariables=function(e,t){for(var i=[],n="",o=!0,r=0;r<e.length;r++){var s=e[r];if("string"!=typeof s){if(s){if(o=!1,s.fmtString){var a=e.indexOf(s,r+1);-1==a&&(a=e.length),s.fmt=e.slice(r+1,a),r=a}if(s.text){var l=this.getVariableValue(t,s.text,n)+"";s.fmtString&&(l=this.tmStrFormat(l,s,t)),s.formatFunction&&(l=this.tmFormatFunction(l,s,t)),l&&!s.ifEnd?(i.push(l),c(s)):!l&&s.ifEnd&&c(s.ifEnd)}else s.elseEnd?c(s.elseEnd):(null!=s.tabstopId||null!=s.changeCase)&&i.push(s)}}else i.push(s),"\n"==s?(o=!0,n=""):o&&(n=/^\t*/.exec(s)[0],o=/\S/.test(s))}function c(t){var i=e.indexOf(t,r+1);-1!=i&&(r=i)}return i},e.prototype.getDisplayTextForSnippet=function(e,t){return m.call(this,e,t).text},e.prototype.insertSnippetForSelection=function(e,t,i){void 0===i&&(i={});var n=m.call(this,e,t,i),o=e.getSelectionRange(),r=e.session.replace(o,n.text),s=new f(e),a=e.inVirtualSelectionMode&&e.selection.index;s.addTabstops(n.tabstops,o.start,r,a)},e.prototype.insertSnippet=function(e,t,i){void 0===i&&(i={});var n=this;if(e.inVirtualSelectionMode)return n.insertSnippetForSelection(e,t,i);e.forEachSelection((function(){n.insertSnippetForSelection(e,t,i)}),null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},e.prototype.$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 i=e.getCursorPosition(),n=e.session.getState(i.row);"object"==typeof n&&(n=n[0]),n.substring&&("js-"==n.substring(0,3)?t="javascript":"css-"==n.substring(0,4)?t="css":"php-"==n.substring(0,4)&&(t="php"))}return t},e.prototype.getActiveScopes=function(e){var t=this.$getScope(e),i=[t],n=this.snippetMap;return n[t]&&n[t].includeScopes&&i.push.apply(i,n[t].includeScopes),i.push("_"),i},e.prototype.expandWithTab=function(e,t){var i=this,n=e.forEachSelection((function(){return i.expandSnippetForSelection(e,t)}),null,{keepOrder:!0});return n&&e.tabstopManager&&e.tabstopManager.tabNext(),n},e.prototype.expandSnippetForSelection=function(e,t){var i,n=e.getCursorPosition(),o=e.session.getLine(n.row),r=o.substring(0,n.column),s=o.substr(n.column),a=this.snippetMap;return this.getActiveScopes(e).some((function(e){var t=a[e];return t&&(i=this.findMatchingSnippet(t,r,s)),!!i}),this),!!i&&(t&&t.dryRun||(e.session.doc.removeInLine(n.row,n.column-i.replaceBefore.length,n.column+i.replaceAfter.length),this.variables.M__=i.matchBefore,this.variables.T__=i.matchAfter,this.insertSnippetForSelection(e,i.content),this.variables.M__=this.variables.T__=null),!0)},e.prototype.findMatchingSnippet=function(e,t,i){for(var n=e.length;n--;){var o=e[n];if((!o.startRe||o.startRe.test(t))&&(!o.endRe||o.endRe.test(i))&&(o.startRe||o.endRe))return o.matchBefore=o.startRe?o.startRe.exec(t):[""],o.matchAfter=o.endRe?o.endRe.exec(i):[""],o.replaceBefore=o.triggerRe?o.triggerRe.exec(t)[0]:"",o.replaceAfter=o.endTriggerRe?o.endTriggerRe.exec(i)[0]:"",o}},e.prototype.register=function(e,t){var i=this.snippetMap,n=this.snippetNameMap,o=this;function r(e){return e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)&&(e="(?:"+e+")"),e||""}function a(e,t,i){return e=r(e),t=r(t),i?(e=t+e)&&"$"!=e[e.length-1]&&(e+="$"):(e+=t)&&"^"!=e[0]&&(e="^"+e),new RegExp(e)}function l(e){e.scope||(e.scope=t||"_"),t=e.scope,i[t]||(i[t]=[],n[t]={});var r=n[t];if(e.name){var l=r[e.name];l&&o.unregister(l),r[e.name]=e}i[t].push(e),e.prefix&&(e.tabTrigger=e.prefix),!e.content&&e.body&&(e.content=Array.isArray(e.body)?e.body.join("\n"):e.body),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=s.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),e.endRe=a(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger))}e||(e=[]),Array.isArray(e)?e.forEach(l):Object.keys(e).forEach((function(t){l(e[t])})),this._signal("registerSnippets",{scope:t})},e.prototype.unregister=function(e,t){var i=this.snippetMap,n=this.snippetNameMap;function o(e){var o=n[e.scope||t];if(o&&o[e.name]){delete o[e.name];var r=i[e.scope||t],s=r&&r.indexOf(e);s>=0&&r.splice(s,1)}}e.content?o(e):Array.isArray(e)&&e.forEach(o)},e.prototype.parseSnippetFile=function(e){e=e.replace(/\r/g,"");for(var t,i=[],n={},o=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;t=o.exec(e);){if(t[1])try{n=JSON.parse(t[1]),i.push(n)}catch(e){}if(t[4])n.content=t[4].replace(/^\t/gm,""),i.push(n),n={};else{var r=t[2],s=t[3];if("regex"==r){var a=/\/((?:[^\/\\]|\\.)*)|$/g;n.guard=a.exec(s)[1],n.trigger=a.exec(s)[1],n.endTrigger=a.exec(s)[1],n.endGuard=a.exec(s)[1]}else"snippet"==r?(n.tabTrigger=s.match(/^\S*/)[0],n.name||(n.name=s)):r&&(n[r]=s)}}return i},e.prototype.getSnippetByName=function(e,t){var i,n=this.snippetNameMap;return this.getActiveScopes(t).some((function(t){var o=n[t];return o&&(i=o[e]),!!i}),this),i},e}();o.implement(p.prototype,r);var m=function(e,t,i){void 0===i&&(i={});var n=e.getCursorPosition(),o=e.session.getLine(n.row),r=e.session.getTabString(),s=o.match(/^\s*/)[0];n.column<s.length&&(s=s.slice(0,n.column)),t=t.replace(/\r/g,"");var a=this.tokenizeTmSnippet(t);a=(a=this.resolveVariables(a,e)).map((function(e){return"\n"!=e||i.excludeExtraIndent?"string"==typeof e?e.replace(/\t/g,r):e:e+s}));var l=[];a.forEach((function(e,t){if("object"==typeof e){var i=e.tabstopId,n=l[i];if(n||((n=l[i]=[]).index=i,n.value="",n.parents={}),-1===n.indexOf(e)){e.choices&&!n.choices&&(n.choices=e.choices),n.push(e);var o=a.indexOf(e,t+1);if(-1!==o){var r=a.slice(t+1,o);r.some((function(e){return"object"==typeof e}))&&!n.value?n.value=r:!r.length||n.value&&"string"==typeof n.value||(n.value=r.join(""))}}}})),l.forEach((function(e){e.length=0}));var c={};function h(e){for(var t=[],i=0;i<e.length;i++){var n=e[i];if("object"==typeof n){if(c[n.tabstopId])continue;n=t[e.lastIndexOf(n,i-1)]||{tabstopId:n.tabstopId}}t[i]=n}return t}for(var d=0;d<a.length;d++){var u=a[d];if("object"==typeof u){var g=u.tabstopId,p=l[g],m=a.indexOf(u,d+1);if(c[g])c[g]===u&&(delete c[g],Object.keys(c).forEach((function(e){p.parents[e]=!0})));else{c[g]=u;var f=p.value;"string"!=typeof f?f=h(f):u.fmt&&(f=this.tmStrFormat(f,u,e)),a.splice.apply(a,[d+1,Math.max(0,m-d)].concat(f,u)),-1===p.indexOf(u)&&p.push(u)}}}var v=0,C=0,y="";return a.forEach((function(e){if("string"==typeof e){var t=e.split("\n");t.length>1?(C=t[t.length-1].length,v+=t.length-1):C+=e.length,y+=e}else e&&(e.start?e.end={row:v,column:C}:e.start={row:v,column:C})})),{text:y,tabstops:l,tokens:a}},f=function(){function e(e){if(this.index=0,this.ranges=[],this.tabstops=[],e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=s.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)}return e.prototype.attach=function(e){this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.session=e.session,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)},e.prototype.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges.length=0,this.tabstops.length=0,this.selectedTabstop=null,this.editor.off("change",this.$onChange),this.editor.off("changeSelection",this.$onChangeSelection),this.editor.off("changeSession",this.$onChangeSession),this.editor.commands.off("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.session=null,this.editor=null},e.prototype.onChange=function(e){for(var t="r"==e.action[0],i=this.selectedTabstop||{},n=i.parents||{},o=this.tabstops.slice(),r=0;r<o.length;r++){var s=o[r],a=s==i||n[s.index];if(s.rangeList.$bias=a?0:1,"remove"==e.action&&s!==i){var l=s.parents&&s.parents[i.index],c=s.rangeList.pointIndex(e.start,l);c=c<0?-c-1:c+1;var h=s.rangeList.pointIndex(e.end,l);h=h<0?-h-1:h-1;for(var d=s.rangeList.ranges.slice(c,h),u=0;u<d.length;u++)this.removeRange(d[u])}s.rangeList.$onChange(e)}var g=this.session;this.$inChange||!t||1!=g.getLength()||g.getValue()||this.detach()},e.prototype.updateLinkedFields=function(){var e=this.selectedTabstop;if(e&&e.hasLinkedRanges&&e.firstNonLinked){this.$inChange=!0;for(var i=this.session,n=i.getTextRange(e.firstNonLinked),o=0;o<e.length;o++){var r=e[o];if(r.linked){var s=r.original,a=t.snippetManager.tmStrFormat(n,s,this.editor);i.replace(r,a)}}this.$inChange=!1}},e.prototype.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},e.prototype.onChangeSelection=function(){if(this.editor){for(var e=this.editor.selection.lead,t=this.editor.selection.anchor,i=this.editor.selection.isEmpty(),n=0;n<this.ranges.length;n++)if(!this.ranges[n].linked){var o=this.ranges[n].contains(e.row,e.column),r=i||this.ranges[n].contains(t.row,t.column);if(o&&r)return}this.detach()}},e.prototype.onChangeSession=function(){this.detach()},e.prototype.tabNext=function(e){var t=this.tabstops.length,i=this.index+(e||1);(i=Math.min(Math.max(i,1),t))==t&&(i=0),this.selectTabstop(i),this.updateTabstopMarkers(),0===i&&this.detach()},e.prototype.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){this.selectedTabstop=t;var i=t.firstNonLinked||t;if(t.choices&&(i.cursor=i.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(i);else{var n=this.editor.multiSelect;n.toSingleRange(i);for(var o=0;o<t.length;o++)t.hasLinkedRanges&&t[o].linked||n.addRange(t[o].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},e.prototype.addTabstops=function(e,t,i){var n=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!e[0]){var o=a.fromPoints(i,i);C(o.start,t),C(o.end,t),e[0]=[o],e[0].index=0}var r=[this.index+1,0],s=this.ranges,c=this.snippetId=(this.snippetId||0)+1;e.forEach((function(e,i){var o=this.$openTabstops[i]||e;o.snippetId=c;for(var h=0;h<e.length;h++){var d=e[h],u=a.fromPoints(d.start,d.end||d.start);v(u.start,t),v(u.end,t),u.original=d,u.tabstop=o,s.push(u),o!=e?o.unshift(u):o[h]=u,d.fmtString||o.firstNonLinked&&n?(u.linked=!0,o.hasLinkedRanges=!0):o.firstNonLinked||(o.firstNonLinked=u)}o.firstNonLinked||(o.hasLinkedRanges=!1),o===e&&(r.push(o),this.$openTabstops[i]=o),this.addTabstopMarkers(o),o.rangeList=o.rangeList||new l,o.rangeList.$bias=0,o.rangeList.addList(o)}),this),r.length>2&&(this.tabstops.length&&r.push(r.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,r))},e.prototype.addTabstopMarkers=function(e){var t=this.session;e.forEach((function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))}))},e.prototype.removeTabstopMarkers=function(e){var t=this.session;e.forEach((function(e){t.removeMarker(e.markerId),e.markerId=null}))},e.prototype.updateTabstopMarkers=function(){if(this.selectedTabstop){var e=this.selectedTabstop.snippetId;0===this.selectedTabstop.index&&e--,this.tabstops.forEach((function(t){t.snippetId===e?this.addTabstopMarkers(t):this.removeTabstopMarkers(t)}),this)}},e.prototype.removeRange=function(e){var t=e.tabstop.indexOf(e);-1!=t&&e.tabstop.splice(t,1),-1!=(t=this.ranges.indexOf(e))&&this.ranges.splice(t,1),-1!=(t=e.tabstop.rangeList.ranges.indexOf(e))&&e.tabstop.splice(t,1),this.session.removeMarker(e.markerId),e.tabstop.length||(-1!=(t=this.tabstops.indexOf(e.tabstop))&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},e}();f.prototype.keyboardHandler=new c,f.prototype.keyboardHandler.bindKeys({Tab:function(e){t.snippetManager&&t.snippetManager.expandWithTab(e)||(e.tabstopManager.tabNext(1),e.renderer.scrollCursorIntoView())},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1),e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}});var v=function(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row},C=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};n.importCssString("\n.ace_snippet-marker {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n background: rgba(194, 193, 208, 0.09);\n border: 1px dotted rgba(211, 208, 235, 0.62);\n position: absolute;\n}","snippets.css",!1),t.snippetManager=new p;var y=e("./editor").Editor;(function(){this.insertSnippet=function(e,i){return t.snippetManager.insertSnippet(this,e,i)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(y.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","ace/config","ace/lib/useragent"],(function(e,t,i){"use strict";var n=e("../virtual_renderer").VirtualRenderer,o=e("../editor").Editor,r=e("../range").Range,s=e("../lib/event"),a=e("../lib/lang"),l=e("../lib/dom"),c=e("../config").nls,h=e("./../lib/useragent"),d=function(e){return"suggest-aria-id:".concat(e)},u=h.isSafari?"menu":"listbox",g=h.isSafari?"menuitem":"option",p=h.isSafari?"aria-current":"aria-selected",m=function(e){var t=new n(e);t.$maxLines=4;var i=new o(t);return i.setHighlightActiveLine(!1),i.setShowPrintMargin(!1),i.renderer.setShowGutter(!1),i.renderer.setHighlightGutterLine(!1),i.$mouseHandler.$focusTimeout=0,i.$highlightTagPending=!0,i},f=function(e){var t=l.createElement("div"),i=m(t);e&&e.appendChild(t),t.style.display="none",i.renderer.content.style.cursor="default",i.renderer.setStyle("ace_autocomplete"),i.renderer.$textLayer.element.setAttribute("role",u),i.renderer.$textLayer.element.setAttribute("aria-roledescription",c("Autocomplete suggestions")),i.renderer.$textLayer.element.setAttribute("aria-label",c("Autocomplete suggestions")),i.renderer.textarea.setAttribute("aria-hidden","true"),i.setOption("displayIndentGuides",!1),i.setOption("dragDelay",150);var n,o=function(){};i.focus=o,i.$isFocused=!0,i.renderer.$cursorLayer.restartTimer=o,i.renderer.$cursorLayer.element.style.opacity="0",i.renderer.$maxLines=8,i.renderer.$keepTextAreaAtCursor=!1,i.setHighlightActiveLine(!1),i.session.highlight(""),i.session.$searchHighlight.clazz="ace_highlight-marker",i.on("mousedown",(function(e){var t=e.getDocumentPosition();i.selection.moveToPosition(t),f.start.row=f.end.row=t.row,e.stop()}));var h=new r(-1,0,-1,1/0),f=new r(-1,0,-1,1/0);f.id=i.session.addMarker(f,"ace_active-line","fullLine"),i.setSelectOnHover=function(e){e?h.id&&(i.session.removeMarker(h.id),h.id=null):h.id=i.session.addMarker(h,"ace_line-hover","fullLine")},i.setSelectOnHover(!1),i.on("mousemove",(function(e){if(n){if(n.x!=e.x||n.y!=e.y){(n=e).scrollTop=i.renderer.scrollTop,i.isMouseOver=!0;var t=n.getDocumentPosition().row;h.start.row!=t&&(h.id||i.setRow(t),C(t))}}else n=e})),i.renderer.on("beforeRender",(function(){if(n&&-1!=h.start.row){n.$pos=null;var e=n.getDocumentPosition().row;h.id||i.setRow(e),C(e,!0)}})),i.renderer.on("afterRender",(function(){var e=i.getRow(),t=i.renderer.$textLayer,n=t.element.childNodes[e-t.config.firstRow],o=document.activeElement;if(n!==i.selectedNode&&i.selectedNode&&(l.removeCssClass(i.selectedNode,"ace_selected"),o.removeAttribute("aria-activedescendant"),i.selectedNode.removeAttribute(p),i.selectedNode.removeAttribute("id")),i.selectedNode=n,n){l.addCssClass(n,"ace_selected");var r=d(e);n.id=r,t.element.setAttribute("aria-activedescendant",r),o.setAttribute("aria-activedescendant",r),n.setAttribute("role",g),n.setAttribute("aria-roledescription",c("item")),n.setAttribute("aria-label",i.getData(e).caption||i.getData(e).value),n.setAttribute("aria-setsize",i.data.length),n.setAttribute("aria-posinset",e+1),n.setAttribute("aria-describedby","doc-tooltip"),n.setAttribute(p,"true")}}));var v=function(){C(-1)},C=function(e,t){e!==h.start.row&&(h.start.row=h.end.row=e,t||i.session._emit("changeBackMarker"),i._emit("changeHoverMarker"))};i.getHoveredRow=function(){return h.start.row},s.addListener(i.container,"mouseout",(function(){i.isMouseOver=!1,v()})),i.on("hide",v),i.on("changeSelection",v),i.session.doc.getLength=function(){return i.data.length},i.session.doc.getLine=function(e){var t=i.data[e];return"string"==typeof t?t:t&&t.value||""};var y=i.session.bgTokenizer;return y.$tokenizeRow=function(e){var t=i.data[e],n=[];if(!t)return n;"string"==typeof t&&(t={value:t});var o=t.caption||t.value||t.name;function r(e,i){e&&n.push({type:(t.className||"")+(i||""),value:e})}for(var s=o.toLowerCase(),a=(i.filterText||"").toLowerCase(),l=0,c=0,h=0;h<=a.length;h++)if(h!=c&&(t.matchMask&1<<h||h==a.length)){var d=a.slice(c,h);c=h;var u=s.indexOf(d,l);if(-1==u)continue;r(o.slice(l,u),""),l=u+d.length,r(o.slice(u,l),"completion-highlight")}return r(o.slice(l,o.length),""),n.push({type:"completion-spacer",value:" "}),t.meta&&n.push({type:"completion-meta",value:t.meta}),t.message&&n.push({type:"completion-message",value:t.message}),n},y.$updateOnChange=o,y.start=o,i.session.$computeWidth=function(){return this.screenWidth=0},i.isOpen=!1,i.isTopdown=!1,i.autoSelect=!0,i.filterText="",i.isMouseOver=!1,i.data=[],i.setData=function(e,t){i.filterText=t||"",i.setValue(a.stringRepeat("\n",e.length),-1),i.data=e||[],i.setRow(0)},i.getData=function(e){return i.data[e]},i.getRow=function(){return f.start.row},i.setRow=function(e){e=Math.max(this.autoSelect?0:-1,Math.min(this.data.length-1,e)),f.start.row!=e&&(i.selection.clearSelection(),f.start.row=f.end.row=e||0,i.session._emit("changeBackMarker"),i.moveCursorTo(e||0,0),i.isOpen&&i._signal("select"))},i.on("changeSelection",(function(){i.isOpen&&i.setRow(i.selection.lead.row),i.renderer.scrollCursorIntoView()})),i.hide=function(){this.container.style.display="none",i.anchorPos=null,i.anchor=null,i.isOpen&&(i.isOpen=!1,this._signal("hide"))},i.tryShow=function(e,t,o,r){if(!r&&i.isOpen&&i.anchorPos&&i.anchor&&i.anchorPos.top===e.top&&i.anchorPos.left===e.left&&i.anchor===o)return!0;var s=this.container,a=window.innerHeight,l=window.innerWidth,c=this.renderer,h=c.$maxLines*t*1.4,d={top:0,bottom:0,left:0},u=a-e.top-3*this.$borderSize-t,g=e.top-3*this.$borderSize;o||(o=g<=u||u>=h?"bottom":"top"),"top"===o?(d.bottom=e.top-this.$borderSize,d.top=d.bottom-h):"bottom"===o&&(d.top=e.top+t+this.$borderSize,d.bottom=d.top+h);var p=d.top>=0&&d.bottom<=a;if(!r&&!p)return!1;c.$maxPixelHeight=p?null:"top"===o?g:u,"top"===o?(s.style.top="",s.style.bottom=a-d.bottom+"px",i.isTopdown=!1):(s.style.top=d.top+"px",s.style.bottom="",i.isTopdown=!0),s.style.display="";var m=e.left;return m+s.offsetWidth>l&&(m=l-s.offsetWidth),s.style.left=m+"px",s.style.right="",i.isOpen||(i.isOpen=!0,this._signal("show"),n=null),i.anchorPos=e,i.anchor=o,!0},i.show=function(e,t,i){this.tryShow(e,t,i?"bottom":void 0,!0)},i.goTo=function(e){var t=this.getRow(),i=this.session.getLength()-1;switch(e){case"up":t=t<=0?i:t-1;break;case"down":t=t>=i?-1:t+1;break;case"start":t=0;break;case"end":t=i}this.setRow(t)},i.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},i.$imageSize=0,i.$borderSize=1,i};l.importCssString('\n.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #CAD6FA;\n z-index: 1;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n background-color: #3a674e;\n}\n.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid #abbffe;\n margin-top: -1px;\n background: rgba(233,233,253,0.4);\n position: absolute;\n z-index: 2;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n border: 1px solid rgba(109, 150, 13, 0.8);\n background: rgba(58, 103, 78, 0.62);\n}\n.ace_completion-meta {\n opacity: 0.5;\n margin-left: 0.9em;\n}\n.ace_completion-message {\n margin-left: 0.9em;\n color: blue;\n}\n.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #2d69c7;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n color: #93ca12;\n}\n.ace_editor.ace_autocomplete {\n width: 300px;\n z-index: 200000;\n border: 1px lightgray solid;\n position: fixed;\n box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n line-height: 1.4;\n background: #fefefe;\n color: #111;\n}\n.ace_dark.ace_editor.ace_autocomplete {\n border: 1px #484747 solid;\n box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\n line-height: 1.4;\n background: #25282c;\n color: #c1c1c1;\n}\n.ace_autocomplete .ace_text-layer {\n width: calc(100% - 8px);\n}\n.ace_autocomplete .ace_line {\n display: flex;\n align-items: center;\n}\n.ace_autocomplete .ace_line > * {\n min-width: 0;\n flex: 0 0 auto;\n}\n.ace_autocomplete .ace_line .ace_ {\n flex: 0 1 auto;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.ace_autocomplete .ace_completion-spacer {\n flex: 1;\n}\n.ace_autocomplete.ace_loading:after {\n content: "";\n position: absolute;\n top: 0px;\n height: 2px;\n width: 8%;\n background: blue;\n z-index: 100;\n animation: ace_progress 3s infinite linear;\n animation-delay: 300ms;\n transform: translateX(-100%) scaleX(1);\n}\n@keyframes ace_progress {\n 0% { transform: translateX(-100%) scaleX(1) }\n 50% { transform: translateX(625%) scaleX(2) } \n 100% { transform: translateX(1500%) scaleX(3) } \n}\n@media (prefers-reduced-motion) {\n .ace_autocomplete.ace_loading:after {\n transform: translateX(625%) scaleX(2);\n animation: none;\n }\n}\n',"autocompletion.css",!1),t.AcePopup=f,t.$singleLineEditor=m,t.getAriaId=d})),ace.define("ace/autocomplete/inline_screenreader",["require","exports","module"],(function(e,t,i){"use strict";var n=function(){function e(e){this.editor=e,this.screenReaderDiv=document.createElement("div"),this.screenReaderDiv.classList.add("ace_screenreader-only"),this.editor.container.appendChild(this.screenReaderDiv)}return e.prototype.setScreenReaderContent=function(e){for(!this.popup&&this.editor.completer&&this.editor.completer.popup&&(this.popup=this.editor.completer.popup,this.popup.renderer.on("afterRender",function(){var e=this.popup.getRow(),t=this.popup.renderer.$textLayer,i=t.element.childNodes[e-t.config.firstRow];if(i){for(var n="doc-tooltip ",o=0;o<this._lines.length;o++)n+="ace-inline-screenreader-line-".concat(o," ");i.setAttribute("aria-describedby",n)}}.bind(this)));this.screenReaderDiv.firstChild;)this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);this._lines=e.split(/\r\n|\r|\n/);var t=this.createCodeBlock();this.screenReaderDiv.appendChild(t)},e.prototype.destroy=function(){this.screenReaderDiv.remove()},e.prototype.createCodeBlock=function(){var e=document.createElement("pre");e.setAttribute("id","ace-inline-screenreader");for(var t=0;t<this._lines.length;t++){var i=document.createElement("code");i.setAttribute("id","ace-inline-screenreader-line-".concat(t));var n=document.createTextNode(this._lines[t]);i.appendChild(n),e.appendChild(i)}return e},e}();t.AceInlineScreenReader=n})),ace.define("ace/autocomplete/inline",["require","exports","module","ace/snippets","ace/autocomplete/inline_screenreader"],(function(e,t,i){"use strict";var n=e("../snippets").snippetManager,o=e("./inline_screenreader").AceInlineScreenReader,r=function(){function e(){this.editor=null}return e.prototype.show=function(e,t,i){if(i=i||"",e&&this.editor&&this.editor!==e&&(this.hide(),this.editor=null,this.inlineScreenReader=null),!e||!t)return!1;this.inlineScreenReader||(this.inlineScreenReader=new o(e));var r=t.snippet?n.getDisplayTextForSnippet(e,t.snippet):t.value;return!(t.hideInlinePreview||!r||!r.startsWith(i)||(this.editor=e,this.inlineScreenReader.setScreenReaderContent(r),""===(r=r.slice(i.length))?e.removeGhostText():e.setGhostText(r),0))},e.prototype.isOpen=function(){return!!this.editor&&!!this.editor.renderer.$ghostText},e.prototype.hide=function(){return!!this.editor&&(this.editor.removeGhostText(),!0)},e.prototype.destroy=function(){this.hide(),this.editor=null,this.inlineScreenReader&&(this.inlineScreenReader.destroy(),this.inlineScreenReader=null)},e}();t.AceInline=r})),ace.define("ace/autocomplete/util",["require","exports","module"],(function(e,t,i){"use strict";t.parForEach=function(e,t,i){var n=0,o=e.length;0===o&&i();for(var r=0;r<o;r++)t(e[r],(function(e,t){++n===o&&i(e,t)}))};var n=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;t.retrievePrecedingIdentifier=function(e,t,i){i=i||n;for(var o=[],r=t-1;r>=0&&i.test(e[r]);r--)o.push(e[r]);return o.reverse().join("")},t.retrieveFollowingIdentifier=function(e,t,i){i=i||n;for(var o=[],r=t;r<e.length&&i.test(e[r]);r++)o.push(e[r]);return o},t.getCompletionPrefix=function(e){var t,i=e.getCursorPosition(),n=e.session.getLine(i.row);return e.completers.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(e){!t&&e&&(t=this.retrievePrecedingIdentifier(n,i.column,e))}.bind(this))}.bind(this)),t||this.retrievePrecedingIdentifier(n,i.column)},t.triggerAutocomplete=function(e){var t=e.getCursorPosition(),i=e.session.getLine(t.row)[0===t.column?0:t.column-1];return e.completers.some((function(e){if(e.triggerCharacters&&Array.isArray(e.triggerCharacters))return e.triggerCharacters.includes(i)}))}})),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/inline","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config","ace/lib/event","ace/lib/scroll"],(function(e,t,i){"use strict";var n=e("./keyboard/hash_handler").HashHandler,o=e("./autocomplete/popup").AcePopup,r=e("./autocomplete/inline").AceInline,s=e("./autocomplete/popup").getAriaId,a=e("./autocomplete/util"),l=e("./lib/lang"),c=e("./lib/dom"),h=e("./snippets").snippetManager,d=e("./config"),u=e("./lib/event"),g=e("./lib/scroll").preventParentScroll,p=function(e,t){t.completer&&t.completer.destroy()},m=function(){function e(){this.autoInsert=!1,this.autoSelect=!0,this.autoShown=!1,this.exactMatch=!1,this.inlineEnabled=!1,this.keyboardHandler=new n,this.keyboardHandler.bindKeys(this.commands),this.parentNode=null,this.setSelectOnHover=!1,this.hasSeen=new Set,this.showLoadingState=!1,this.stickySelectionDelay=500,this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.onLayoutChange=this.onLayoutChange.bind(this),this.changeTimer=l.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=l.delayedCall(this.updateDocTooltip.bind(this),50),this.popupTimer=l.delayedCall(this.$updatePopupPosition.bind(this),50),this.stickySelectionTimer=l.delayedCall(function(){this.stickySelection=!0}.bind(this),this.stickySelectionDelay),this.$firstOpenTimer=l.delayedCall(function(){var t=this.completionProvider&&this.completionProvider.initialPosition;this.autoShown||this.popup&&this.popup.isOpen||!t||0===this.editor.completers.length||(this.completions=new v(e.completionsForLoading),this.openPopup(this.editor,t.prefix,!1),this.popup.renderer.setStyle("ace_loading",!0))}.bind(this),this.stickySelectionDelay)}return Object.defineProperty(e,"completionsForLoading",{get:function(){return[{caption:d.nls("Loading..."),value:""}]},enumerable:!1,configurable:!0}),e.prototype.$init=function(){return this.popup=new o(this.parentNode||document.body||document.documentElement),this.popup.on("click",function(e){this.insertMatch(),e.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.$onPopupShow.bind(this)),this.popup.on("hide",this.$onHidePopup.bind(this)),this.popup.on("select",this.$onPopupChange.bind(this)),u.addListener(this.popup.container,"mouseout",this.mouseOutListener.bind(this)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup.renderer.on("afterRender",this.$onPopupRender.bind(this)),this.popup},e.prototype.$initInline=function(){if(this.inlineEnabled&&!this.inlineRenderer)return this.inlineRenderer=new r,this.inlineRenderer},e.prototype.getPopup=function(){return this.popup||this.$init()},e.prototype.$onHidePopup=function(){this.inlineRenderer&&this.inlineRenderer.hide(),this.hideDocTooltip(),this.stickySelectionTimer.cancel(),this.popupTimer.cancel(),this.stickySelection=!1},e.prototype.$seen=function(e){!this.hasSeen.has(e)&&e&&e.completer&&e.completer.onSeen&&"function"==typeof e.completer.onSeen&&(e.completer.onSeen(this.editor,e),this.hasSeen.add(e))},e.prototype.$onPopupChange=function(e){if(this.inlineRenderer&&this.inlineEnabled){var t=e?null:this.popup.getData(this.popup.getRow());if(this.$updateGhostText(t),this.popup.isMouseOver&&this.setSelectOnHover)return void this.tooltipTimer.call(null,null);this.popupTimer.schedule(),this.tooltipTimer.schedule()}else this.popupTimer.call(null,null),this.tooltipTimer.call(null,null)},e.prototype.$updateGhostText=function(e){var t=this.base.row,i=this.base.column,n=this.editor.getCursorPosition().column,o=this.editor.session.getLine(t).slice(i,n);this.inlineRenderer.show(this.editor,e,o)?this.$seen(e):this.inlineRenderer.hide()},e.prototype.$onPopupRender=function(){var e=this.inlineRenderer&&this.inlineEnabled;if(this.completions&&this.completions.filtered&&this.completions.filtered.length>0)for(var t=this.popup.getFirstVisibleRow();t<=this.popup.getLastVisibleRow();t++){var i=this.popup.getData(t);!i||e&&!i.hideInlinePreview||this.$seen(i)}},e.prototype.$onPopupShow=function(e){this.$onPopupChange(e),this.stickySelection=!1,this.stickySelectionDelay>=0&&this.stickySelectionTimer.schedule(this.stickySelectionDelay)},e.prototype.observeLayoutChanges=function(){if(!this.$elements&&this.editor){window.addEventListener("resize",this.onLayoutChange,{passive:!0}),window.addEventListener("wheel",this.mousewheelListener);for(var e=this.editor.container.parentNode,t=[];e;)t.push(e),e.addEventListener("scroll",this.onLayoutChange,{passive:!0}),e=e.parentNode;this.$elements=t}},e.prototype.unObserveLayoutChanges=function(){var e=this;window.removeEventListener("resize",this.onLayoutChange,{passive:!0}),window.removeEventListener("wheel",this.mousewheelListener),this.$elements&&this.$elements.forEach((function(t){t.removeEventListener("scroll",e.onLayoutChange,{passive:!0})})),this.$elements=null},e.prototype.onLayoutChange=function(){if(!this.popup.isOpen)return this.unObserveLayoutChanges();this.$updatePopupPosition(),this.updateDocTooltip()},e.prototype.$updatePopupPosition=function(){var e=this.editor,t=e.renderer,i=t.layerConfig.lineHeight,n=t.$cursorLayer.getPixelPosition(this.base,!0);n.left-=this.popup.getTextLeftOffset();var o=e.container.getBoundingClientRect();n.top+=o.top-t.layerConfig.offset,n.left+=o.left-e.renderer.scrollLeft,n.left+=t.gutterWidth;var r={top:n.top,left:n.left};t.$ghostText&&t.$ghostTextWidget&&this.base.row===t.$ghostText.position.row&&(r.top+=t.$ghostTextWidget.el.offsetHeight);var s=e.container.getBoundingClientRect().bottom-i,a=s<r.top?{top:s,left:r.left}:r;this.popup.tryShow(a,i,"bottom")||this.popup.tryShow(n,i,"top")||this.popup.show(n,i)},e.prototype.openPopup=function(e,t,i){this.$firstOpenTimer.cancel(),this.popup||this.$init(),this.inlineEnabled&&!this.inlineRenderer&&this.$initInline(),this.popup.autoSelect=this.autoSelect,this.popup.setSelectOnHover(this.setSelectOnHover);var n,o=this.popup.getRow(),r=this.popup.data[o];this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions&&this.editor.textInput.setAriaOptions({activeDescendant:s(this.popup.getRow()),inline:this.inlineEnabled}),e.keyBinding.addKeyboardHandler(this.keyboardHandler),this.stickySelection&&(n=this.popup.data.indexOf(r)),n&&-1!==n||(n=0),this.popup.setRow(this.autoSelect?n:-1),n===o&&r!==this.completions.filtered[n]&&this.$onPopupChange();var a=this.inlineRenderer&&this.inlineEnabled;if(n===o&&a){var l=this.popup.getData(this.popup.getRow());this.$updateGhostText(l)}i?i&&!t&&this.detach():(this.popup.setTheme(e.getTheme()),this.popup.setFontSize(e.getFontSize()),this.$updatePopupPosition(),this.tooltipNode&&this.updateDocTooltip()),this.changeTimer.cancel(),this.observeLayoutChanges()},e.prototype.detach=function(){this.editor&&(this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener)),this.$firstOpenTimer.cancel(),this.changeTimer.cancel(),this.hideDocTooltip(),this.completionProvider&&this.completionProvider.detach(),this.popup&&this.popup.isOpen&&this.popup.hide(),this.popup&&this.popup.renderer&&this.popup.renderer.off("afterRender",this.$onPopupRender),this.base&&this.base.detach(),this.activated=!1,this.completionProvider=this.completions=this.base=null,this.unObserveLayoutChanges()},e.prototype.changeListener=function(e){var t=this.editor.selection.lead;(t.row!=this.base.row||t.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},e.prototype.blurListener=function(e){var t=document.activeElement,i=this.editor.textInput.getElement(),n=e.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(e.relatedTarget),o=this.popup&&this.popup.container;t==i||t.parentNode==o||n||t==this.tooltipNode||e.relatedTarget==i||this.detach()},e.prototype.mousedownListener=function(e){this.detach()},e.prototype.mousewheelListener=function(e){this.popup.isMouseOver||this.detach()},e.prototype.mouseOutListener=function(e){this.popup.isOpen&&this.$updatePopupPosition()},e.prototype.goTo=function(e){this.popup.goTo(e)},e.prototype.insertMatch=function(e,t){if(e||(e=this.popup.getData(this.popup.getRow())),!e)return!1;if(""===e.value)return this.detach();var i=this.completions,n=this.getCompletionProvider().insertMatch(this.editor,e,i.filterText,t);return this.completions==i&&this.detach(),n},e.prototype.showPopup=function(e,t){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(!1,t)},e.prototype.getCompletionProvider=function(e){return this.completionProvider||(this.completionProvider=new f(e)),this.completionProvider},e.prototype.gatherCompletions=function(e,t){return this.getCompletionProvider().gatherCompletions(e,t)},e.prototype.updateCompletions=function(t,i){if(t&&this.base&&this.completions){var n=this.editor.getCursorPosition();if((r=this.editor.session.getTextRange({start:this.base,end:n}))==this.completions.filterText)return;return this.completions.setFilter(r),this.completions.filtered.length&&(1!=this.completions.filtered.length||this.completions.filtered[0].value!=r||this.completions.filtered[0].snippet)?void this.openPopup(this.editor,r,t):this.detach()}if(i&&i.matches)return n=this.editor.getSelectionRange().start,this.base=this.editor.session.doc.createAnchor(n.row,n.column),this.base.$insertRight=!0,this.completions=new v(i.matches),this.getCompletionProvider().completions=this.completions,this.openPopup(this.editor,"",t);var o=this.editor.getSession(),r=(n=this.editor.getCursorPosition(),a.getCompletionPrefix(this.editor));this.base=o.doc.createAnchor(n.row,n.column-r.length),this.base.$insertRight=!0;var s={exactMatch:this.exactMatch,ignoreCaption:this.ignoreCaption};this.getCompletionProvider({prefix:r,pos:n}).provideCompletions(this.editor,s,function(i,n,o){var r=n.filtered,s=a.getCompletionPrefix(this.editor);if(this.$firstOpenTimer.cancel(),o){if(!r.length){var l=!this.autoShown&&this.emptyMessage;if("function"==typeof l&&(l=this.emptyMessage(s)),l){var c=[{caption:l,value:""}];return this.completions=new v(c),this.openPopup(this.editor,s,t),void this.popup.renderer.setStyle("ace_loading",!1)}return this.detach()}if(1==r.length&&r[0].value==s&&!r[0].snippet)return this.detach();if(this.autoInsert&&!this.autoShown&&1==r.length)return this.insertMatch(r[0])}this.completions=!o&&this.showLoadingState?new v(e.completionsForLoading.concat(r),n.filterText):n,this.openPopup(this.editor,s,t),this.popup.renderer.setStyle("ace_loading",!o)}.bind(this)),!this.showLoadingState||this.autoShown||this.popup&&this.popup.isOpen||this.$firstOpenTimer.delay(this.stickySelectionDelay/2)},e.prototype.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},e.prototype.updateDocTooltip=function(){var e=this.popup,t=this.completions.filtered,i=t&&(t[e.getHoveredRow()]||t[e.getRow()]),n=null;if(!i||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();for(var o=this.editor.completers.length,r=0;r<o;r++){var s=this.editor.completers[r];if(s.getDocTooltip&&i.completerId===s.id){n=s.getDocTooltip(i);break}}if(n||"string"==typeof i||(n=i),"string"==typeof n&&(n={docText:n}),!n||!n.docHTML&&!n.docText)return this.hideDocTooltip();this.showDocTooltip(n)},e.prototype.showDocTooltip=function(e){this.tooltipNode||(this.tooltipNode=c.createElement("div"),this.tooltipNode.style.margin="0",this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.style.overscrollBehavior="contain",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this),this.tooltipNode.id="doc-tooltip",this.tooltipNode.setAttribute("role","tooltip"),this.tooltipNode.addEventListener("wheel",g));var t=this.editor.renderer.theme;this.tooltipNode.className="ace_tooltip ace_doc-tooltip "+(t.isDark?"ace_dark ":"")+(t.cssClass||"");var i=this.tooltipNode;e.docHTML?i.innerHTML=e.docHTML:e.docText&&(i.textContent=e.docText),i.parentNode||this.popup.container.appendChild(this.tooltipNode);var n=this.popup,o=n.container.getBoundingClientRect();i.style.top=n.container.style.top,i.style.bottom=n.container.style.bottom,i.style.display="block",window.innerWidth-o.right<320?o.left<320?n.isTopdown?(i.style.top=o.bottom+"px",i.style.left=o.left+"px",i.style.right="",i.style.bottom=""):(i.style.top=n.container.offsetTop-i.offsetHeight+"px",i.style.left=o.left+"px",i.style.right="",i.style.bottom=""):(i.style.right=window.innerWidth-o.left+"px",i.style.left=""):(i.style.left=o.right+1+"px",i.style.right="")},e.prototype.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)}},e.prototype.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}},e.prototype.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var e=this.popup.container;e&&e.parentNode&&e.parentNode.removeChild(e)}this.editor&&this.editor.completer==this&&(this.editor.off("destroy",p),this.editor.completer=null),this.inlineRenderer=this.popup=this.editor=null},e}();m.prototype.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()}},m.for=function(e){return e.completer instanceof m||(e.completer&&(e.completer.destroy(),e.completer=null),d.get("sharedPopups")?(m.$sharedInstance||(m.$sharedInstance=new m),e.completer=m.$sharedInstance):(e.completer=new m,e.once("destroy",p))),e.completer},m.startCommand={name:"startAutocomplete",exec:function(e,t){var i=m.for(e);i.autoInsert=!1,i.autoSelect=!0,i.autoShown=!1,i.showPopup(e,t),i.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var f=function(){function e(e){this.initialPosition=e,this.active=!0}return e.prototype.insertByIndex=function(e,t,i){return!(!this.completions||!this.completions.filtered)&&this.insertMatch(e,this.completions.filtered[t],i)},e.prototype.insertMatch=function(e,t,i){if(!t)return!1;if(e.startOperation({command:{name:"insertMatch"}}),t.completer&&t.completer.insertMatch)t.completer.insertMatch(e,t);else{if(!this.completions)return!1;var n=this.completions.filterText.length,o=0;if(t.range&&t.range.start.row===t.range.end.row&&(n-=this.initialPosition.prefix.length,n+=this.initialPosition.pos.column-t.range.start.column,o+=t.range.end.column-this.initialPosition.pos.column),n||o){var r;r=e.selection.getAllRanges?e.selection.getAllRanges():[e.getSelectionRange()];for(var s,a=0;s=r[a];a++)s.start.column-=n,s.end.column+=o,e.session.remove(s)}t.snippet?h.insertSnippet(e,t.snippet):this.$insertString(e,t),t.completer&&t.completer.onInsert&&"function"==typeof t.completer.onInsert&&t.completer.onInsert(e,t),t.command&&"startAutocomplete"===t.command&&e.execCommand(t.command)}return e.endOperation(),!0},e.prototype.$insertString=function(e,t){var i=t.value||t;e.execCommand("insertstring",i)},e.prototype.gatherCompletions=function(e,t){var i=e.getSession(),n=e.getCursorPosition(),o=a.getCompletionPrefix(e),r=[];this.completers=e.completers;var s=e.completers.length;return e.completers.forEach((function(l,c){l.getCompletions(e,i,n,o,(function(i,n){l.hideInlinePreview&&(n=n.map((function(e){return Object.assign(e,{hideInlinePreview:l.hideInlinePreview})}))),!i&&n&&(r=r.concat(n)),t(null,{prefix:a.getCompletionPrefix(e),matches:r,finished:0==--s})}))})),!0},e.prototype.provideCompletions=function(e,t,i){var n=function(e){var n=e.prefix,o=e.matches;this.completions=new v(o),t.exactMatch&&(this.completions.exactMatch=!0),t.ignoreCaption&&(this.completions.ignoreCaption=!0),this.completions.setFilter(n),(e.finished||this.completions.filtered.length)&&i(null,this.completions,e.finished)}.bind(this),o=!0,r=null;if(this.gatherCompletions(e,function(e,t){this.active&&(e&&(i(e,[],!0),this.detach()),0===t.prefix.indexOf(t.prefix)&&(o?r=t:n(t)))}.bind(this)),o=!1,r){var s=r;r=null,n(s)}},e.prototype.detach=function(){this.active=!1,this.completers&&this.completers.forEach((function(e){"function"==typeof e.cancel&&e.cancel()}))},e}(),v=function(){function e(e,t){this.all=e,this.filtered=e,this.filterText=t||"",this.exactMatch=!1,this.ignoreCaption=!1}return e.prototype.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||(e.caption||e.value).localeCompare(t.caption||t.value)}));var i=null;t=t.filter((function(e){var t=e.snippet||e.caption||e.value;return t!==i&&(i=t,!0)})),this.filtered=t},e.prototype.filterCompletions=function(e,t){var i=[],n=t.toUpperCase(),o=t.toLowerCase();e:for(var r,s=0;r=e[s];s++){var a=!this.ignoreCaption&&r.caption||r.value||r.snippet;if(a){var l,c,h=-1,d=0,u=0;if(this.exactMatch){if(t!==a.substr(0,t.length))continue e}else{var g=a.toLowerCase().indexOf(o);if(g>-1)u=g;else for(var p=0;p<t.length;p++){var m=a.indexOf(o[p],h+1),f=a.indexOf(n[p],h+1);if((l=m>=0&&(f<0||m<f)?m:f)<0)continue e;(c=l-h-1)>0&&(-1===h&&(u+=10),u+=c,d|=1<<p),h=l}}r.matchMask=d,r.exactMatch=u?0:1,r.$score=(r.score||0)-u,i.push(r)}}return i},e}();t.Autocomplete=m,t.CompletionProvider=f,t.FilteredList=v})),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],(function(e,t,i){var n=e("../range").Range,o=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function r(e,t){var i=function(e,t){return e.getTextRange(n.fromPoints({row:0,column:0},t)).split(o).length-1}(e,t),r=e.getValue().split(o),s=Object.create(null),a=r[i];return r.forEach((function(e,t){if(e&&e!==a){var n=Math.abs(i-t),o=r.length-n;s[e]?s[e]=Math.max(o,s[e]):s[e]=o}})),s}t.getCompletions=function(e,t,i,n,o){var s=r(t,i);o(null,Object.keys(s).map((function(e){return{caption:e,value:e,score:s[e],meta:"local"}})))}})),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],(function(e,t,i){"use strict";var n=e("../snippets").snippetManager,o=e("../autocomplete").Autocomplete,r=e("../config"),s=e("../lib/lang"),a=e("../autocomplete/util"),l=e("../autocomplete/text_completer"),c={getCompletions:function(e,t,i,n,o){if(t.$mode.completer)return t.$mode.completer.getCompletions(e,t,i,n,o);var r=e.session.getState(i.row),s=t.$mode.getCompletions(r,t,i,n);o(null,s=s.map((function(e){return e.completerId=c.id,e})))},id:"keywordCompleter"},h={getCompletions:function(e,t,i,o,r){var s=[],a=t.getTokenAt(i.row,i.column);a&&a.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?s.push("html-tag"):s=n.getActiveScopes(e);var l=n.snippetMap,c=[];s.forEach((function(e){for(var t=l[e]||[],i=t.length;i--;){var n=t[i],o=n.name||n.tabTrigger;o&&c.push({caption:o,snippet:n.content,meta:n.tabTrigger&&!n.name?n.tabTrigger+"⇥ ":"snippet",completerId:h.id})}}),this),r(null,c)},getDocTooltip:function(e){var t,i;e.snippet&&!e.docHTML&&(e.docHTML=["<b>",s.escapeHTML(e.caption),"</b>","<hr></hr>",s.escapeHTML((t=e.snippet,i={},t.replace(/\${(\d+)(:(.*?))?}/g,(function(e,t,n,o){return i[t]=o||""})).replace(/\$(\d+?)/g,(function(e,t){return i[t]}))))].join(""))},id:"snippetCompleter"},d=[h,l,c];t.setCompleters=function(e){d.length=0,e&&d.push.apply(d,e)},t.addCompleter=function(e){d.push(e)},t.textCompleter=l,t.keyWordCompleter=c,t.snippetCompleter=h;var u,g={name:"expandSnippet",exec:function(e){return n.expandWithTab(e)},bindKey:"Tab"},p=function(e,t){m(t.session.$mode)},m=function(e){"string"==typeof e&&(e=r.$modes[e]),e&&(n.files||(n.files={}),f(e.$id,e.snippetFileId),e.modes&&e.modes.forEach(m))},f=function(e,t){t&&e&&!n.files[e]&&(n.files[e]={},r.loadModule(t,(function(t){t&&(n.files[e]=t,!t.snippets&&t.snippetText&&(t.snippets=n.parseSnippetFile(t.snippetText)),n.register(t.snippets||[],t.scope),t.includeScopes&&(n.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach((function(e){m("ace/mode/"+e)}))))})))},v=function(e){var t=e.editor,i=t.completer&&t.completer.activated;if("backspace"===e.command.name)i&&!a.getCompletionPrefix(t)&&t.completer.detach();else if("insertstring"===e.command.name&&!i){u=e;var n=e.editor.$liveAutocompletionDelay;n?C.delay(n):y(e)}},C=s.delayedCall((function(){y(u)}),0),y=function(e){var t=e.editor,i=a.getCompletionPrefix(t),n=a.triggerAutocomplete(t);if(i&&i.length>=t.$liveAutocompletionThreshold||n){var r=o.for(t);r.autoShown=!0,r.showPopup(t)}},I=e("../editor").Editor;e("../config").defineOptions(I.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:d),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:d),this.commands.on("afterExec",v)):this.commands.off("afterExec",v)},value:!1},liveAutocompletionDelay:{initialValue:0},liveAutocompletionThreshold:{initialValue:0},enableSnippets:{set:function(e){e?(this.commands.addCommand(g),this.on("changeMode",p),p(0,this)):(this.commands.removeCommand(g),this.off("changeMode",p))},value:!1}})})),ace.require(["ace/ext/language_tools"],(function(t){e&&(e.exports=t)}))},6534:function(e,t,i){e=i.nmd(e),ace.define("ace/ext/searchbox-css",["require","exports","module"],(function(e,t,i){i.exports='\n\n/* ------------------------------------------------------------------------------------------\n * Editor Search Form\n * --------------------------------------------------------------------------------------- */\n.ace_search {\n background-color: #ddd;\n color: #666;\n border: 1px solid #cbcbcb;\n border-top: 0 none;\n overflow: hidden;\n margin: 0;\n padding: 4px 6px 0 4px;\n position: absolute;\n top: 0;\n z-index: 99;\n white-space: normal;\n}\n.ace_search.left {\n border-left: 0 none;\n border-radius: 0px 0px 5px 0px;\n left: 0;\n}\n.ace_search.right {\n border-radius: 0px 0px 0px 5px;\n border-right: 0 none;\n right: 0;\n}\n\n.ace_search_form, .ace_replace_form {\n margin: 0 20px 4px 0;\n overflow: hidden;\n line-height: 1.9;\n}\n.ace_replace_form {\n margin-right: 0;\n}\n.ace_search_form.ace_nomatch {\n outline: 1px solid red;\n}\n\n.ace_search_field {\n border-radius: 3px 0 0 3px;\n background-color: white;\n color: black;\n border: 1px solid #cbcbcb;\n border-right: 0 none;\n outline: 0;\n padding: 0;\n font-size: inherit;\n margin: 0;\n line-height: inherit;\n padding: 0 6px;\n min-width: 17em;\n vertical-align: top;\n min-height: 1.8em;\n box-sizing: content-box;\n}\n.ace_searchbtn {\n border: 1px solid #cbcbcb;\n line-height: inherit;\n display: inline-block;\n padding: 0 6px;\n background: #fff;\n border-right: 0 none;\n border-left: 1px solid #dcdcdc;\n cursor: pointer;\n margin: 0;\n position: relative;\n color: #666;\n}\n.ace_searchbtn:last-child {\n border-radius: 0 3px 3px 0;\n border-right: 1px solid #cbcbcb;\n}\n.ace_searchbtn:disabled {\n background: none;\n cursor: default;\n}\n.ace_searchbtn:hover {\n background-color: #eef1f6;\n}\n.ace_searchbtn.prev, .ace_searchbtn.next {\n padding: 0px 0.7em\n}\n.ace_searchbtn.prev:after, .ace_searchbtn.next:after {\n content: "";\n border: solid 2px #888;\n width: 0.5em;\n height: 0.5em;\n border-width: 2px 0 0 2px;\n display:inline-block;\n transform: rotate(-45deg);\n}\n.ace_searchbtn.next:after {\n border-width: 0 2px 2px 0 ;\n}\n.ace_searchbtn_close {\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;\n border-radius: 50%;\n border: 0 none;\n color: #656565;\n cursor: pointer;\n font: 16px/16px Arial;\n padding: 0;\n height: 14px;\n width: 14px;\n top: 9px;\n right: 7px;\n position: absolute;\n}\n.ace_searchbtn_close:hover {\n background-color: #656565;\n background-position: 50% 100%;\n color: white;\n}\n\n.ace_button {\n margin-left: 2px;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow: hidden;\n opacity: 0.7;\n border: 1px solid rgba(100,100,100,0.23);\n padding: 1px;\n box-sizing: border-box!important;\n color: black;\n}\n\n.ace_button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_button:active {\n background-color: #ddd;\n}\n\n.ace_button.checked {\n border-color: #3399ff;\n opacity:1;\n}\n\n.ace_search_options{\n margin-bottom: 3px;\n text-align: right;\n -webkit-user-select: none;\n -moz-user-select: none;\n -o-user-select: none;\n -ms-user-select: none;\n user-select: none;\n clear: both;\n}\n\n.ace_search_counter {\n float: left;\n font-family: arial;\n padding: 0 8px;\n}'})),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/ext/searchbox-css","ace/keyboard/hash_handler","ace/lib/keys","ace/config"],(function(e,t,i){"use strict";var n=e("../lib/dom"),o=e("../lib/lang"),r=e("../lib/event"),s=e("./searchbox-css"),a=e("../keyboard/hash_handler").HashHandler,l=e("../lib/keys"),c=e("../config").nls;n.importCssString(s,"ace_searchbox",!1);var h=function(){function e(e,t,i){this.activeInput;var o=n.createElement("div");n.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:c("Search for"),spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},""],["span",{action:"findNext",class:"ace_searchbtn next"},""],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},c("All")]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:c("Replace with"),spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},c("Replace")],["span",{action:"replaceAll",class:"ace_searchbtn"},c("All")]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:c("Toggle Replace mode"),style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:c("RegExp Search")},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:c("CaseSensitive Search")},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:c("Whole Word Search")},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:c("Search In Selection")},"S"]]],o),this.element=o.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),n.importCssString(s,"ace_searchbox",e.container)}return e.prototype.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},e.prototype.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},e.prototype.$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")},e.prototype.$init=function(){var e=this.element;this.$initElements(e);var t=this;r.addListener(e,"mousedown",(function(e){setTimeout((function(){t.activeInput.focus()}),0),r.stopPropagation(e)})),r.addListener(e,"click",(function(e){var i=(e.target||e.srcElement).getAttribute("action");i&&t[i]?t[i]():t.$searchBarKb.commands[i]&&t.$searchBarKb.commands[i].exec(t),r.stopPropagation(e)})),r.addCommandKeyListener(e,(function(e,i,n){var o=l.keyCodeToString(n),s=t.$searchBarKb.findKeyCommand(i,o);s&&s.exec&&(s.exec(t),r.stopEvent(e))})),this.$onChange=o.delayedCall((function(){t.find(!1,!1)})),r.addListener(this.searchInput,"input",(function(){t.$onChange.schedule(20)})),r.addListener(this.searchInput,"focus",(function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()})),r.addListener(this.replaceInput,"focus",(function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()}))},e.prototype.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)},e.prototype.$syncOptions=function(e){n.setCssClass(this.replaceOption,"checked",this.searchRange),n.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",n.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),n.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),n.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},e.prototype.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},e.prototype.find=function(e,t,i){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:i,range:this.searchRange})&&this.searchInput.value;n.setCssClass(this.searchBox,"ace_nomatch",o),this.editor._emit("findSearchBox",{match:!o}),this.highlight(),this.updateCounter()},e.prototype.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,i=t.unicode,n=0,r=0;if(t){var s=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),a=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(a-=e.session.doc.positionToIndex(this.searchRange.start));for(var l,h=t.lastIndex=0;(l=t.exec(s))&&(n++,(h=l.index)<=a&&r++,!(n>999))&&(l[0]||(t.lastIndex=h+=o.skipEmptyMatch(s,h,i),!(h>=s.length))););}this.searchCounter.textContent=c("$0 of $1",[r,n>999?"999+":n])},e.prototype.findNext=function(){this.find(!0,!1)},e.prototype.findPrev=function(){this.find(!0,!0)},e.prototype.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;n.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},e.prototype.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},e.prototype.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},e.prototype.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},e.prototype.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()},e.prototype.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)},e.prototype.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput},e}(),d=new a;d.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.editor.getReadOnly()||(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()}}),d.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()}}]);var u=new a([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]);h.prototype.$searchBarKb=d,h.prototype.$closeSearchBarKb=u,t.SearchBox=h,t.Search=function(e,t){(e.searchBox||new h(e)).show(e.session.getTextRange(),t)}})),ace.require(["ace/ext/searchbox"],(function(t){e&&(e.exports=t)}))},4221:function(e,t,i){e=i.nmd(e),ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],(function(e,t,i){"use strict";var n=e("../lib/oop"),o=e("./text_highlight_rules").TextHighlightRules,r=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:"punctuation.operator",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"}]}};n.inherits(r,o),t.JsonHighlightRules=r})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(e,t,i){"use strict";var n=e("../range").Range,o=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var i=e.getLine(t).match(/^(\s*\})/);if(!i)return 0;var o=i[1].length,r=e.findMatchingBracket({row:t,column:o});if(!r||r.row==t)return 0;var s=this.$getIndent(e.getLine(r.row));e.replace(new n(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,i){"use strict";var n=e("../../lib/oop"),o=e("../../range").Range,r=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)))};n.inherits(s,r),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,i){var n=e.getLine(i);if(this.singleLineBlockCommentRe.test(n)&&!this.startRegionRe.test(n)&&!this.tripleStarBlockCommentRe.test(n))return"";var o=this._getFoldWidgetBase(e,t,i);return!o&&this.startRegionRe.test(n)?"start":o},this.getFoldWidgetRange=function(e,t,i,n){var o,r=e.getLine(i);if(this.startRegionRe.test(r))return this.getCommentRegionBlock(e,r,i);if(o=r.match(this.foldingStartMarker)){var s=o.index;if(o[1])return this.openingBracketBlock(e,o[1],i,s);var a=e.getCommentFoldRange(i,s+o[0].length,1);return a&&!a.isMultiLine()&&(n?a=this.getSectionRange(e,i):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(o=r.match(this.foldingStopMarker))?(s=o.index+o[0].length,o[1]?this.closingBracketBlock(e,o[1],i,s):e.getCommentFoldRange(i,s,-1)):void 0},this.getSectionRange=function(e,t){for(var i=e.getLine(t),n=i.search(/\S/),r=t,s=i.length,a=t+=1,l=e.getLength();++t<l;){var c=(i=e.getLine(t)).search(/\S/);if(-1!==c){if(n>c)break;var h=this.getFoldWidgetRange(e,"all",t);if(h){if(h.start.row<=r)break;if(h.isMultiLine())t=h.end.row;else if(n==c)break}a=t}}return new o(r,s,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,i){for(var n=t.search(/\s*$/),r=e.getLength(),s=i,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++i<r;){t=e.getLine(i);var c=a.exec(t);if(c&&(c[1]?l--:l++,!l))break}if(i>s)return new o(s,n,i,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/folding/cstyle","ace/worker/worker_client"],(function(e,t,i){"use strict";var n=e("../lib/oop"),o=e("./text").Mode,r=e("./json_highlight_rules").JsonHighlightRules,s=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("./folding/cstyle").FoldMode,l=e("../worker/worker_client").WorkerClient,c=function(){this.HighlightRules=r,this.$outdent=new s,this.$behaviour=this.$defaultBehaviour,this.foldingRules=new a};n.inherits(c,o),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,i){var n=this.$getIndent(t);return"start"==e&&t.match(/^.*[\{\(\[]\s*$/)&&(n+=i),n},this.checkOutdent=function(e,t,i){return this.$outdent.checkOutdent(t,i)},this.autoOutdent=function(e,t,i){this.$outdent.autoOutdent(t,i)},this.createWorker=function(e){var t=new l(["ace"],"ace/mode/json_worker","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(c.prototype),t.Mode=c})),ace.require(["ace/mode/json"],(function(t){e&&(e.exports=t)}))},2229:function(e,t,i){"use strict";var n=i(2620),o=i(4292),r=i(9336),s=i(4427),a=i(9306),l=i(2084),c=i(3483),h=i(8852),d=i(6862);e.exports=v,v.prototype.validate=function(e,t){var i;if("string"==typeof e){if(!(i=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var n=this._addSchema(e);i=n.validate||this._compile(n)}var o=i(t);return!0!==i.$async&&(this.errors=i.errors),o},v.prototype.compile=function(e,t){var i=this._addSchema(e,void 0,t);return i.validate||this._compile(i)},v.prototype.addSchema=function(e,t,i,n){if(Array.isArray(e)){for(var r=0;r<e.length;r++)this.addSchema(e[r],void 0,i,n);return this}var s=this._getId(e);if(void 0!==s&&"string"!=typeof s)throw new Error("schema id must be string");return w(this,t=o.normalizeId(t||s)),this._schemas[t]=this._addSchema(e,i,n,!0),this},v.prototype.addMetaSchema=function(e,t,i){return this.addSchema(e,t,i,!0),this},v.prototype.validateSchema=function(e,t){var i=e.$schema;if(void 0!==i&&"string"!=typeof i)throw new Error("$schema must be a string");if(!(i=i||this._opts.defaultMeta||function(e){var t=e._opts.meta;return e._opts.defaultMeta="object"==typeof t?e._getId(t)||t:e.getSchema(p)?p:void 0,e._opts.defaultMeta}(this)))return this.logger.warn("meta-schema not available"),this.errors=null,!0;var n=this.validate(i,e);if(!n&&t){var o="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(o);this.logger.error(o)}return n},v.prototype.getSchema=function(e){var t=C(this,e);switch(typeof t){case"object":return t.validate||this._compile(t);case"string":return this.getSchema(t);case"undefined":return function(e,t){var i=o.schema.call(e,{schema:{}},t);if(i){var r=i.schema,a=i.root,l=i.baseId,c=n.call(e,r,a,void 0,l);return e._fragments[t]=new s({ref:t,fragment:!0,schema:r,root:a,baseId:l,validate:c}),c}}(this,e)}},v.prototype.removeSchema=function(e){if(e instanceof RegExp)return y(this,this._schemas,e),y(this,this._refs,e),this;switch(typeof e){case"undefined":return y(this,this._schemas),y(this,this._refs),this._cache.clear(),this;case"string":var t=C(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":var i=this._opts.serialize,n=i?i(e):e;this._cache.del(n);var r=this._getId(e);r&&(r=o.normalizeId(r),delete this._schemas[r],delete this._refs[r])}return this},v.prototype.addFormat=function(e,t){return"string"==typeof t&&(t=new RegExp(t)),this._formats[e]=t,this},v.prototype.errorsText=function(e,t){if(!(e=e||this.errors))return"No errors";for(var i=void 0===(t=t||{}).separator?", ":t.separator,n=void 0===t.dataVar?"data":t.dataVar,o="",r=0;r<e.length;r++){var s=e[r];s&&(o+=n+s.dataPath+" "+s.message+i)}return o.slice(0,-i.length)},v.prototype._addSchema=function(e,t,i,n){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var r=this._opts.serialize,a=r?r(e):e,l=this._cache.get(a);if(l)return l;n=n||!1!==this._opts.addUsedSchema;var c=o.normalizeId(this._getId(e));c&&n&&w(this,c);var h,d=!1!==this._opts.validateSchema&&!t;d&&!(h=c&&c==o.normalizeId(e.$schema))&&this.validateSchema(e,!0);var u=o.ids.call(this,e),g=new s({id:c,schema:e,localRefs:u,cacheKey:a,meta:i});return"#"!=c[0]&&n&&(this._refs[c]=g),this._cache.put(a,g),d&&h&&this.validateSchema(e,!0),g},v.prototype._compile=function(e,t){if(e.compiling)return e.validate=r,r.schema=e.schema,r.errors=null,r.root=t||r,!0===e.schema.$async&&(r.$async=!0),r;var i,o;e.compiling=!0,e.meta&&(i=this._opts,this._opts=this._metaOpts);try{o=n.call(this,e.schema,t,e.localRefs)}catch(t){throw delete e.validate,t}finally{e.compiling=!1,e.meta&&(this._opts=i)}return e.validate=o,e.refs=o.refs,e.refVal=o.refVal,e.root=o.root,o;function r(){var t=e.validate,i=t.apply(this,arguments);return r.errors=t.errors,i}},v.prototype.compileAsync=i(600);var u=i(413);v.prototype.addKeyword=u.add,v.prototype.getKeyword=u.get,v.prototype.removeKeyword=u.remove,v.prototype.validateKeyword=u.validate;var g=i(3689);v.ValidationError=g.Validation,v.MissingRefError=g.MissingRef,v.$dataMetaSchema=h;var p="http://json-schema.org/draft-07/schema",m=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],f=["/properties"];function v(e){if(!(this instanceof v))return new v(e);e=this._opts=d.copy(e)||{},function(e){var t=e._opts.logger;if(!1===t)e.logger={log:S,warn:S,error:S};else{if(void 0===t&&(t=console),!("object"==typeof t&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");e.logger=t}}(this),this._schemas={},this._refs={},this._fragments={},this._formats=l(e.format),this._cache=e.cache||new r,this._loadingSchemas={},this._compilations=[],this.RULES=c(),this._getId=function(e){switch(e.schemaId){case"auto":return A;case"id":return I;default:return b}}(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=a),this._metaOpts=function(e){for(var t=d.copy(e._opts),i=0;i<m.length;i++)delete t[m[i]];return t}(this),e.formats&&function(e){for(var t in e._opts.formats){var i=e._opts.formats[t];e.addFormat(t,i)}}(this),e.keywords&&function(e){for(var t in e._opts.keywords){var i=e._opts.keywords[t];e.addKeyword(t,i)}}(this),function(e){var t;if(e._opts.$data&&(t=i(3420),e.addMetaSchema(t,t.$id,!0)),!1!==e._opts.meta){var n=i(8198);e._opts.$data&&(n=h(n,f)),e.addMetaSchema(n,p,!0),e._refs["http://json-schema.org/schema"]=p}}(this),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),function(e){var t=e._opts.schemas;if(t)if(Array.isArray(t))e.addSchema(t);else for(var i in t)e.addSchema(t[i],i)}(this)}function C(e,t){return t=o.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function y(e,t,i){for(var n in t){var o=t[n];o.meta||i&&!i.test(n)||(e._cache.del(o.cacheKey),delete t[n])}}function I(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function b(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function A(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function w(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function S(){}},9336:function(e){"use strict";var t=e.exports=function(){this._cache={}};t.prototype.put=function(e,t){this._cache[e]=t},t.prototype.get=function(e){return this._cache[e]},t.prototype.del=function(e){delete this._cache[e]},t.prototype.clear=function(){this._cache={}}},600:function(e,t,i){"use strict";var n=i(3689).MissingRef;e.exports=function e(t,i,o){var r=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof i&&(o=i,i=void 0);var s=a(t).then((function(){var e=r._addSchema(t,void 0,i);return e.validate||l(e)}));return o&&s.then((function(e){o(null,e)}),o),s;function a(t){var i=t.$schema;return i&&!r.getSchema(i)?e.call(r,{$ref:i},!0):Promise.resolve()}function l(e){try{return r._compile(e)}catch(t){if(t instanceof n)return function(t){var n=t.missingSchema;if(c(n))throw new Error("Schema "+n+" is loaded but "+t.missingRef+" cannot be resolved");var o=r._loadingSchemas[n];return o||(o=r._loadingSchemas[n]=r._opts.loadSchema(n)).then(s,s),o.then((function(e){if(!c(n))return a(e).then((function(){c(n)||r.addSchema(e,n,void 0,i)}))})).then((function(){return l(e)}));function s(){delete r._loadingSchemas[n]}function c(e){return r._refs[e]||r._schemas[e]}}(t);throw t}}}},3689:function(e,t,i){"use strict";var n=i(4292);function o(e,t,i){this.message=i||o.message(e,t),this.missingRef=n.url(e,t),this.missingSchema=n.normalizeId(n.fullPath(this.missingRef))}function r(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}e.exports={Validation:r((function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0})),MissingRef:r(o)},o.message=function(e,t){return"can't resolve reference "+t+" from id "+e}},2084:function(e,t,i){"use strict";var n=i(6862),o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,r=[0,31,28,31,30,31,30,31,31,30,31,30,31],s=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,a=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,l=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,c=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,h=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,d=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,u=/^(?:\/(?:[^~/]|~0|~1)*)*$/,g=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",n.copy(m[e])}function f(e){var t=e.match(o);if(!t)return!1;var i=+t[1],n=+t[2],s=+t[3];return n>=1&&n<=12&&s>=1&&s<=(2==n&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(i)?29:r[n])}function v(e,t){var i=e.match(s);if(!i)return!1;var n=i[1],o=i[2],r=i[3],a=i[5];return(n<=23&&o<=59&&r<=59||23==n&&59==o&&60==r)&&(!t||a)}e.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":c,url:h,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:a,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:b,uuid:d,"json-pointer":u,"json-pointer-uri-fragment":g,"relative-json-pointer":p},m.full={date:f,time:v,"date-time":function(e){var t=e.split(C);return 2==t.length&&f(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":c,url:h,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:a,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:b,uuid:d,"json-pointer":u,"json-pointer-uri-fragment":g,"relative-json-pointer":p};var C=/t|\s/i,y=/\/|:/,I=/[^\\]\\Z/;function b(e){if(I.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},2620:function(e,t,i){"use strict";var n=i(4292),o=i(6862),r=i(3689),s=i(9306),a=i(1035),l=o.ucs2length,c=i(5215),h=r.Validation;function d(e,t,i){var n=g.call(this,e,t,i);return n>=0?{index:n,compiling:!0}:(n=this._compilations.length,this._compilations[n]={schema:e,root:t,baseId:i},{index:n,compiling:!1})}function u(e,t,i){var n=g.call(this,e,t,i);n>=0&&this._compilations.splice(n,1)}function g(e,t,i){for(var n=0;n<this._compilations.length;n++){var o=this._compilations[n];if(o.schema==e&&o.root==t&&o.baseId==i)return n}return-1}function p(e,t){return"var pattern"+e+" = new RegExp("+o.toQuotedString(t[e])+");"}function m(e){return"var default"+e+" = defaults["+e+"];"}function f(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function v(e){return"var customRule"+e+" = customRules["+e+"];"}function C(e,t){if(!e.length)return"";for(var i="",n=0;n<e.length;n++)i+=t(n,e);return i}e.exports=function e(t,i,g,y){var I=this,b=this._opts,A=[void 0],w={},S=[],x={},k=[],T={},E=[];i=i||{schema:t,refVal:A,refs:w};var R=d.call(this,t,i,y),_=this._compilations[R.index];if(R.compiling)return _.callValidate=function e(){var t=_.validate,i=t.apply(this,arguments);return e.errors=t.errors,i};var $=this._formats,L=this.RULES;try{var N=B(t,i,g,y);_.validate=N;var M=_.callValidate;return M&&(M.schema=N.schema,M.errors=null,M.refs=N.refs,M.refVal=N.refVal,M.root=N.root,M.$async=N.$async,b.sourceCode&&(M.source=N.source)),N}finally{u.call(this,t,i,y)}function B(t,s,d,u){var g=!s||s&&s.schema==t;if(s.schema!=i.schema)return e.call(I,t,s,d,u);var y,x=!0===t.$async,T=a({isTop:!0,schema:t,isRoot:g,baseId:u,root:s,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:r.MissingRef,RULES:L,validate:a,util:o,resolve:n,resolveRef:W,usePattern:G,useDefault:F,useCustomRule:O,opts:b,formats:$,logger:I.logger,self:I});T=C(A,f)+C(S,p)+C(k,m)+C(E,v)+T,b.processCode&&(T=b.processCode(T,t));try{y=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",T)(I,L,$,i,A,k,E,c,l,h),A[0]=y}catch(e){throw I.logger.error("Error compiling schema, function code:",T),e}return y.schema=t,y.errors=null,y.refs=w,y.refVal=A,y.root=g?y:s,x&&(y.$async=!0),!0===b.sourceCode&&(y.source={code:T,patterns:S,defaults:k}),y}function W(t,o,r){o=n.url(t,o);var s,a,l=w[o];if(void 0!==l)return H(s=A[l],a="refVal["+l+"]");if(!r&&i.refs){var c=i.refs[o];if(void 0!==c)return H(s=i.refVal[c],a=P(o,s))}a=P(o);var h=n.call(I,B,i,o);if(void 0===h){var d=g&&g[o];d&&(h=n.inlineRef(d,b.inlineRefs)?d:e.call(I,d,i,g,t))}if(void 0!==h)return function(e,t){var i=w[e];A[i]=t}(o,h),H(h,a);!function(e){delete w[e]}(o)}function P(e,t){var i=A.length;return A[i]=t,w[e]=i,"refVal"+i}function H(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function G(e){var t=x[e];return void 0===t&&(t=x[e]=S.length,S[t]=e),"pattern"+t}function F(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return o.toQuotedString(e);case"object":if(null===e)return"null";var t=s(e),i=T[t];return void 0===i&&(i=T[t]=k.length,k[i]=e),"default"+i}}function O(e,t,i,n){if(!1!==I._opts.validateSchema){var o=e.definition.dependencies;if(o&&!o.every((function(e){return Object.prototype.hasOwnProperty.call(i,e)})))throw new Error("parent schema must have all required keywords: "+o.join(","));var r=e.definition.validateSchema;if(r&&!r(t)){var s="keyword schema is invalid: "+I.errorsText(r.errors);if("log"!=I._opts.validateSchema)throw new Error(s);I.logger.error(s)}}var a,l=e.definition.compile,c=e.definition.inline,h=e.definition.macro;if(l)a=l.call(I,t,i,n);else if(h)a=h.call(I,t,i,n),!1!==b.validateSchema&&I.validateSchema(a,!0);else if(c)a=c.call(I,n,e.keyword,t,i);else if(!(a=e.definition.validate))return;if(void 0===a)throw new Error('custom keyword "'+e.keyword+'"failed to compile');var d=E.length;return E[d]=a,{code:"customRule"+d,validate:a}}}},4292:function(e,t,i){"use strict";var n=i(6777),o=i(5215),r=i(6862),s=i(4427),a=i(4316);function l(e,t,i){var n=this._refs[i];if("string"==typeof n){if(!this._refs[n])return l.call(this,e,t,n);n=this._refs[n]}if((n=n||this._schemas[i])instanceof s)return p(n.schema,this._opts.inlineRefs)?n.schema:n.validate||this._compile(n);var o,r,a,h=c.call(this,t,i);return h&&(o=h.schema,t=h.root,a=h.baseId),o instanceof s?r=o.validate||e.call(this,o.schema,t,void 0,a):void 0!==o&&(r=p(o,this._opts.inlineRefs)?o:e.call(this,o,t,void 0,a)),r}function c(e,t){var i=n.parse(t),o=C(i),r=v(this._getId(e.schema));if(0===Object.keys(e.schema).length||o!==r){var a=I(o),l=this._refs[a];if("string"==typeof l)return h.call(this,e,l,i);if(l instanceof s)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[a])instanceof s))return;if(l.validate||this._compile(l),a==I(t))return{schema:l,root:e,baseId:r};e=l}if(!e.schema)return;r=v(this._getId(e.schema))}return u.call(this,i,r,e.schema,e)}function h(e,t,i){var n=c.call(this,e,t);if(n){var o=n.schema,r=n.baseId;e=n.root;var s=this._getId(o);return s&&(r=b(r,s)),u.call(this,i,r,o,e)}}e.exports=l,l.normalizeId=I,l.fullPath=v,l.url=b,l.ids=function(e){var t=I(this._getId(e)),i={"":t},s={"":v(t,!1)},l={},c=this;return a(e,{allKeys:!0},(function(e,t,a,h,d,u,g){if(""!==t){var p=c._getId(e),m=i[h],f=s[h]+"/"+d;if(void 0!==g&&(f+="/"+("number"==typeof g?g:r.escapeFragment(g))),"string"==typeof p){p=m=I(m?n.resolve(m,p):p);var v=c._refs[p];if("string"==typeof v&&(v=c._refs[v]),v&&v.schema){if(!o(e,v.schema))throw new Error('id "'+p+'" resolves to more than one schema')}else if(p!=I(f))if("#"==p[0]){if(l[p]&&!o(e,l[p]))throw new Error('id "'+p+'" resolves to more than one schema');l[p]=e}else c._refs[p]=f}i[t]=m,s[t]=f}})),l},l.inlineRef=p,l.schema=c;var d=r.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function u(e,t,i,n){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var o=e.fragment.split("/"),s=1;s<o.length;s++){var a=o[s];if(a){if(void 0===(i=i[a=r.unescapeFragment(a)]))break;var l;if(!d[a]&&((l=this._getId(i))&&(t=b(t,l)),i.$ref)){var h=b(t,i.$ref),u=c.call(this,n,h);u&&(i=u.schema,n=u.root,t=u.baseId)}}}return void 0!==i&&i!==n.schema?{schema:i,root:n,baseId:t}:void 0}}var g=r.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function p(e,t){return!1!==t&&(void 0===t||!0===t?m(e):t?f(e)<=t:void 0)}function m(e){var t;if(Array.isArray(e)){for(var i=0;i<e.length;i++)if("object"==typeof(t=e[i])&&!m(t))return!1}else for(var n in e){if("$ref"==n)return!1;if("object"==typeof(t=e[n])&&!m(t))return!1}return!0}function f(e){var t,i=0;if(Array.isArray(e)){for(var n=0;n<e.length;n++)if("object"==typeof(t=e[n])&&(i+=f(t)),i==1/0)return 1/0}else for(var o in e){if("$ref"==o)return 1/0;if(g[o])i++;else if("object"==typeof(t=e[o])&&(i+=f(t)+1),i==1/0)return 1/0}return i}function v(e,t){return!1!==t&&(e=I(e)),C(n.parse(e))}function C(e){return n.serialize(e).split("#")[0]+"#"}var y=/#\/?$/;function I(e){return e?e.replace(y,""):""}function b(e,t){return t=I(t),n.resolve(e,t)}},3483:function(e,t,i){"use strict";var n=i(8161),o=i(6862).toHash;e.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=o(t),e.types=o(["number","integer","string","array","object","boolean","null"]),e.forEach((function(i){i.rules=i.rules.map((function(i){var o;if("object"==typeof i){var r=Object.keys(i)[0];o=i[r],i=r,o.forEach((function(i){t.push(i),e.all[i]=!0}))}return t.push(i),e.all[i]={keyword:i,code:n[i],implements:o}})),e.all.$comment={keyword:"$comment",code:n.$comment},i.type&&(e.types[i.type]=i)})),e.keywords=o(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},4427:function(e,t,i){"use strict";var n=i(6862);e.exports=function(e){n.copy(e,this)}},611:function(e){"use strict";e.exports=function(e){for(var t,i=0,n=e.length,o=0;o<n;)i++,(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<n&&56320==(64512&(t=e.charCodeAt(o)))&&o++;return i}},6862:function(e,t,i){"use strict";function n(e,t,i,n){var o=n?" !== ":" === ",r=n?" || ":" && ",s=n?"!":"",a=n?"":"!";switch(e){case"null":return t+o+"null";case"array":return s+"Array.isArray("+t+")";case"object":return"("+s+t+r+"typeof "+t+o+'"object"'+r+a+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+o+'"number"'+r+a+"("+t+" % 1)"+r+t+o+t+(i?r+s+"isFinite("+t+")":"")+")";case"number":return"(typeof "+t+o+'"'+e+'"'+(i?r+s+"isFinite("+t+")":"")+")";default:return"typeof "+t+o+'"'+e+'"'}}e.exports={copy:function(e,t){for(var i in t=t||{},e)t[i]=e[i];return t},checkDataType:n,checkDataTypes:function(e,t,i){if(1===e.length)return n(e[0],t,i,!0);var o="",s=r(e);for(var a in s.array&&s.object&&(o=s.null?"(":"(!"+t+" || ",o+="typeof "+t+' !== "object")',delete s.null,delete s.array,delete s.object),s.number&&delete s.integer,s)o+=(o?" && ":"")+n(a,t,i,!0);return o},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var i=[],n=0;n<t.length;n++){var r=t[n];(o[r]||"array"===e&&"array"===r)&&(i[i.length]=r)}if(i.length)return i}else{if(o[t])return[t];if("array"===e&&"array"===t)return["array"]}},toHash:r,getProperty:l,escapeQuotes:c,equal:i(5215),ucs2length:i(611),varOccurences:function(e,t){t+="[^0-9]";var i=e.match(new RegExp(t,"g"));return i?i.length:0},varReplace:function(e,t,i){return t+="([^0-9])",i=i.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),i+"$1")},schemaHasRules:function(e,t){if("boolean"==typeof e)return!e;for(var i in e)if(t[i])return!0},schemaHasRulesExcept:function(e,t,i){if("boolean"==typeof e)return!e&&"not"!=i;for(var n in e)if(n!=i&&t[n])return!0},schemaUnknownRules:function(e,t){if("boolean"!=typeof e)for(var i in e)if(!t[i])return i},toQuotedString:h,getPathExpr:function(e,t,i,n){return g(e,i?"'/' + "+t+(n?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):n?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")},getPath:function(e,t,i){var n=h(i?"/"+p(t):l(t));return g(e,n)},getData:function(e,t,i){var n,o,r,s;if(""===e)return"rootData";if("/"==e[0]){if(!d.test(e))throw new Error("Invalid JSON-pointer: "+e);o=e,r="rootData"}else{if(!(s=e.match(u)))throw new Error("Invalid JSON-pointer: "+e);if(n=+s[1],"#"==(o=s[2])){if(n>=t)throw new Error("Cannot access property/index "+n+" levels up, current level is "+t);return i[t-n]}if(n>t)throw new Error("Cannot access data "+n+" levels up, current level is "+t);if(r="data"+(t-n||""),!o)return r}for(var a=r,c=o.split("/"),h=0;h<c.length;h++){var g=c[h];g&&(a+=" && "+(r+=l(m(g))))}return a},unescapeFragment:function(e){return m(decodeURIComponent(e))},unescapeJsonPointer:m,escapeFragment:function(e){return encodeURIComponent(p(e))},escapeJsonPointer:p};var o=r(["string","number","integer","boolean","null"]);function r(e){for(var t={},i=0;i<e.length;i++)t[e[i]]=!0;return t}var s=/^[a-z$_][a-z$_0-9]*$/i,a=/'|\\/g;function l(e){return"number"==typeof e?"["+e+"]":s.test(e)?"."+e:"['"+c(e)+"']"}function c(e){return e.replace(a,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function h(e){return"'"+c(e)+"'"}var d=/^\/(?:[^~]|~0|~1)*$/,u=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function g(e,t){return'""'==e?t:(e+" + "+t).replace(/([^\\])' \+ '/g,"$1")}function p(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function m(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}},8852:function(e){"use strict";var t=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,i){for(var n=0;n<i.length;n++){e=JSON.parse(JSON.stringify(e));var o,r=i[n].split("/"),s=e;for(o=1;o<r.length;o++)s=s[r[o]];for(o=0;o<t.length;o++){var a=t[o],l=s[a];l&&(s[a]={anyOf:[l,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e}},9407:function(e,t,i){"use strict";var n=i(8198);e.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:n.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:n.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},1765:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(s||""),u=e.opts.$data&&a&&a.$data;u?(o+=" var schema"+r+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",n="schema"+r):n=a;var g="maximum"==t,p=g?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[p],f=e.opts.$data&&m&&m.$data,v=g?"<":">",C=g?">":"<",y=void 0;if(!u&&"number"!=typeof a&&void 0!==a)throw new Error(t+" must be number");if(!f&&void 0!==m&&"number"!=typeof m&&"boolean"!=typeof m)throw new Error(p+" must be number or boolean");if(f){var I,b=e.util.getData(m.$data,s,e.dataPathArr),A="exclusive"+r,w="exclType"+r,S="exclIsNumber"+r,x="' + "+(T="op"+r)+" + '";o+=" var schemaExcl"+r+" = "+b+"; ",o+=" var "+A+"; var "+w+" = typeof "+(b="schemaExcl"+r)+"; if ("+w+" != 'boolean' && "+w+" != 'undefined' && "+w+" != 'number') { ",y=p,(I=I||[]).push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(y||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",!1!==e.opts.messages&&(o+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(o+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var k=o;o=I.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+k+"]); ":o+=" validate.errors = ["+k+"]; return false; ":o+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+=" } else if ( ",u&&(o+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),o+=" "+w+" == 'number' ? ( ("+A+" = "+n+" === undefined || "+b+" "+v+"= "+n+") ? "+d+" "+C+"= "+b+" : "+d+" "+C+" "+n+" ) : ( ("+A+" = "+b+" === true) ? "+d+" "+C+"= "+n+" : "+d+" "+C+" "+n+" ) || "+d+" !== "+d+") { var op"+r+" = "+A+" ? '"+v+"' : '"+v+"='; ",void 0===a&&(y=p,c=e.errSchemaPath+"/"+p,n=b,u=f)}else if(x=v,(S="number"==typeof m)&&u){var T="'"+x+"'";o+=" if ( ",u&&(o+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),o+=" ( "+n+" === undefined || "+m+" "+v+"= "+n+" ? "+d+" "+C+"= "+m+" : "+d+" "+C+" "+n+" ) || "+d+" !== "+d+") { "}else S&&void 0===a?(A=!0,y=p,c=e.errSchemaPath+"/"+p,n=m,C+="="):(S&&(n=Math[g?"min":"max"](m,a)),m===(!S||n)?(A=!0,y=p,c=e.errSchemaPath+"/"+p,C+="="):(A=!1,x+="=")),T="'"+x+"'",o+=" if ( ",u&&(o+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),o+=" "+d+" "+C+" "+n+" || "+d+" !== "+d+") { ";return y=y||t,(I=I||[]).push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(y||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { comparison: "+T+", limit: "+n+", exclusive: "+A+" } ",!1!==e.opts.messages&&(o+=" , message: 'should be "+x+" ",o+=u?"' + "+n:n+"'"),e.opts.verbose&&(o+=" , schema: ",o+=u?"validate.schema"+l:""+a,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ",k=o,o=I.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+k+"]); ":o+=" validate.errors = ["+k+"]; return false; ":o+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+=" } ",h&&(o+=" else { "),o}},9337:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(s||""),u=e.opts.$data&&a&&a.$data;if(u?(o+=" var schema"+r+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",n="schema"+r):n=a,!u&&"number"!=typeof a)throw new Error(t+" must be number");o+="if ( ",u&&(o+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),o+=" "+d+".length "+("maxItems"==t?">":"<")+" "+n+") { ";var g=t,p=p||[];p.push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(g||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+n+" } ",!1!==e.opts.messages&&(o+=" , message: 'should NOT have ",o+="maxItems"==t?"more":"fewer",o+=" than ",o+=u?"' + "+n+" + '":""+a,o+=" items' "),e.opts.verbose&&(o+=" , schema: ",o+=u?"validate.schema"+l:""+a,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var m=o;return o=p.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+m+"]); ":o+=" validate.errors = ["+m+"]; return false; ":o+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",h&&(o+=" else { "),o}},5433:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(s||""),u=e.opts.$data&&a&&a.$data;if(u?(o+=" var schema"+r+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",n="schema"+r):n=a,!u&&"number"!=typeof a)throw new Error(t+" must be number");var g="maxLength"==t?">":"<";o+="if ( ",u&&(o+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),!1===e.opts.unicode?o+=" "+d+".length ":o+=" ucs2length("+d+") ",o+=" "+g+" "+n+") { ";var p=t,m=m||[];m.push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+n+" } ",!1!==e.opts.messages&&(o+=" , message: 'should NOT be ",o+="maxLength"==t?"longer":"shorter",o+=" than ",o+=u?"' + "+n+" + '":""+a,o+=" characters' "),e.opts.verbose&&(o+=" , schema: ",o+=u?"validate.schema"+l:""+a,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var f=o;return o=m.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+f+"]); ":o+=" validate.errors = ["+f+"]; return false; ":o+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",h&&(o+=" else { "),o}},7724:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(s||""),u=e.opts.$data&&a&&a.$data;if(u?(o+=" var schema"+r+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",n="schema"+r):n=a,!u&&"number"!=typeof a)throw new Error(t+" must be number");o+="if ( ",u&&(o+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),o+=" Object.keys("+d+").length "+("maxProperties"==t?">":"<")+" "+n+") { ";var g=t,p=p||[];p.push(o),o="",!1!==e.createErrors?(o+=" { keyword: '"+(g||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+n+" } ",!1!==e.opts.messages&&(o+=" , message: 'should NOT have ",o+="maxProperties"==t?"more":"fewer",o+=" than ",o+=u?"' + "+n+" + '":""+a,o+=" properties' "),e.opts.verbose&&(o+=" , schema: ",o+=u?"validate.schema"+l:""+a,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var m=o;return o=p.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+m+"]); ":o+=" validate.errors = ["+m+"]; return false; ":o+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",h&&(o+=" else { "),o}},3531:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.schema[t],r=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,a=!e.opts.allErrors,l=e.util.copy(e),c="";l.level++;var h="valid"+l.level,d=l.baseId,u=!0,g=o;if(g)for(var p,m=-1,f=g.length-1;m<f;)p=g[m+=1],(e.opts.strictKeywords?"object"==typeof p&&Object.keys(p).length>0||!1===p:e.util.schemaHasRules(p,e.RULES.all))&&(u=!1,l.schema=p,l.schemaPath=r+"["+m+"]",l.errSchemaPath=s+"/"+m,n+=" "+e.validate(l)+" ",l.baseId=d,a&&(n+=" if ("+h+") { ",c+="}"));return a&&(n+=u?" if (true) { ":" "+c.slice(0,-1)+" "),n}},8854:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d="valid"+o,u="errs__"+o,g=e.util.copy(e),p="";g.level++;var m="valid"+g.level,f=s.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0||!1===t:e.util.schemaHasRules(t,e.RULES.all)}));if(f){var v=g.baseId;n+=" var "+u+" = errors; var "+d+" = false; ";var C=e.compositeRule;e.compositeRule=g.compositeRule=!0;var y=s;if(y)for(var I,b=-1,A=y.length-1;b<A;)I=y[b+=1],g.schema=I,g.schemaPath=a+"["+b+"]",g.errSchemaPath=l+"/"+b,n+=" "+e.validate(g)+" ",g.baseId=v,n+=" "+d+" = "+d+" || "+m+"; if (!"+d+") { ",p+="}";e.compositeRule=g.compositeRule=C,n+=" "+p+" if (!"+d+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else c&&(n+=" if (true) { ");return n}},8372:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.schema[t],r=e.errSchemaPath+"/"+t,s=(e.opts.allErrors,e.util.toQuotedString(o));return!0===e.opts.$comment?n+=" console.log("+s+");":"function"==typeof e.opts.$comment&&(n+=" self._opts.$comment("+s+", "+e.util.toQuotedString(r)+", validate.root.schema);"),n}},9650:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d="valid"+o,u=e.opts.$data&&s&&s.$data;u&&(n+=" var schema"+o+" = "+e.util.getData(s.$data,r,e.dataPathArr)+"; "),u||(n+=" var schema"+o+" = validate.schema"+a+";"),n+="var "+d+" = equal("+h+", schema"+o+"); if (!"+d+") { ";var g=g||[];g.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValue: schema"+o+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to constant' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var p=n;return n=g.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",c&&(n+=" else { "),n}},1292:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d="valid"+o,u="errs__"+o,g=e.util.copy(e);g.level++;var p="valid"+g.level,m="i"+o,f=g.dataLevel=e.dataLevel+1,v="data"+f,C=e.baseId,y=e.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:e.util.schemaHasRules(s,e.RULES.all);if(n+="var "+u+" = errors;var "+d+";",y){var I=e.compositeRule;e.compositeRule=g.compositeRule=!0,g.schema=s,g.schemaPath=a,g.errSchemaPath=l,n+=" var "+p+" = false; for (var "+m+" = 0; "+m+" < "+h+".length; "+m+"++) { ",g.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var b=h+"["+m+"]";g.dataPathArr[f]=m;var A=e.validate(g);g.baseId=C,e.util.varOccurences(A,v)<2?n+=" "+e.util.varReplace(A,v,b)+" ":n+=" var "+v+" = "+b+"; "+A+" ",n+=" if ("+p+") break; } ",e.compositeRule=g.compositeRule=I,n+=" if (!"+p+") {"}else n+=" if ("+h+".length == 0) {";var w=w||[];w.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should contain a valid item' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var S=n;return n=w.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+S+"]); ":n+=" validate.errors = ["+S+"]; return false; ":n+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { ",y&&(n+=" errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } "),e.opts.allErrors&&(n+=" } "),n}},8050:function(e){"use strict";e.exports=function(e,t,i){var n,o,r=" ",s=e.level,a=e.dataLevel,l=e.schema[t],c=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,u="data"+(a||""),g="valid"+s,p="errs__"+s,m=e.opts.$data&&l&&l.$data;m?(r+=" var schema"+s+" = "+e.util.getData(l.$data,a,e.dataPathArr)+"; ",o="schema"+s):o=l;var f,v,C,y,I,b=this,A="definition"+s,w=b.definition,S="";if(m&&w.$data){I="keywordValidate"+s;var x=w.validateSchema;r+=" var "+A+" = RULES.custom['"+t+"'].definition; var "+I+" = "+A+".validate;"}else{if(!(y=e.useCustomRule(b,l,e.schema,e)))return;o="validate.schema"+c,I=y.code,f=w.compile,v=w.inline,C=w.macro}var k=I+".errors",T="i"+s,E="ruleErr"+s,R=w.async;if(R&&!e.async)throw new Error("async keyword in sync schema");if(v||C||(r+=k+" = null;"),r+="var "+p+" = errors;var "+g+";",m&&w.$data&&(S+="}",r+=" if ("+o+" === undefined) { "+g+" = true; } else { ",x&&(S+="}",r+=" "+g+" = "+A+".validateSchema("+o+"); if ("+g+") { ")),v)w.statements?r+=" "+y.validate+" ":r+=" "+g+" = "+y.validate+"; ";else if(C){var _=e.util.copy(e);S="",_.level++;var $="valid"+_.level;_.schema=y.validate,_.schemaPath="";var L=e.compositeRule;e.compositeRule=_.compositeRule=!0;var N=e.validate(_).replace(/validate\.schema/g,I);e.compositeRule=_.compositeRule=L,r+=" "+N}else{(P=P||[]).push(r),r="",r+=" "+I+".call( ",e.opts.passContext?r+="this":r+="self",f||!1===w.schema?r+=" , "+u+" ":r+=" , "+o+" , "+u+" , validate.schema"+e.schemaPath+" ",r+=" , (dataPath || '')",'""'!=e.errorPath&&(r+=" + "+e.errorPath);var M=a?"data"+(a-1||""):"parentData",B=a?e.dataPathArr[a]:"parentDataProperty",W=r+=" , "+M+" , "+B+" , rootData ) ";r=P.pop(),!1===w.errors?(r+=" "+g+" = ",R&&(r+="await "),r+=W+"; "):r+=R?" var "+(k="customErrors"+s)+" = null; try { "+g+" = await "+W+"; } catch (e) { "+g+" = false; if (e instanceof ValidationError) "+k+" = e.errors; else throw e; } ":" "+k+" = null; "+g+" = "+W+"; "}if(w.modifying&&(r+=" if ("+M+") "+u+" = "+M+"["+B+"];"),r+=""+S,w.valid)d&&(r+=" if (true) { ");else{var P;r+=" if ( ",void 0===w.valid?(r+=" !",r+=C?""+$:""+g):r+=" "+!w.valid+" ",r+=") { ",n=b.keyword,(P=P||[]).push(r),r="",(P=P||[]).push(r),r="",!1!==e.createErrors?(r+=" { keyword: '"+(n||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { keyword: '"+b.keyword+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should pass \""+b.keyword+"\" keyword validation' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ";var H=r;r=P.pop(),!e.compositeRule&&d?e.async?r+=" throw new ValidationError(["+H+"]); ":r+=" validate.errors = ["+H+"]; return false; ":r+=" var err = "+H+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var G=r;r=P.pop(),v?w.errors?"full"!=w.errors&&(r+=" for (var "+T+"="+p+"; "+T+"<errors; "+T+"++) { var "+E+" = vErrors["+T+"]; if ("+E+".dataPath === undefined) "+E+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+E+".schemaPath === undefined) { "+E+'.schemaPath = "'+h+'"; } ',e.opts.verbose&&(r+=" "+E+".schema = "+o+"; "+E+".data = "+u+"; "),r+=" } "):!1===w.errors?r+=" "+G+" ":(r+=" if ("+p+" == errors) { "+G+" } else { for (var "+T+"="+p+"; "+T+"<errors; "+T+"++) { var "+E+" = vErrors["+T+"]; if ("+E+".dataPath === undefined) "+E+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+E+".schemaPath === undefined) { "+E+'.schemaPath = "'+h+'"; } ',e.opts.verbose&&(r+=" "+E+".schema = "+o+"; "+E+".data = "+u+"; "),r+=" } } "):C?(r+=" var err = ",!1!==e.createErrors?(r+=" { keyword: '"+(n||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { keyword: '"+b.keyword+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should pass \""+b.keyword+"\" keyword validation' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; ")):!1===w.errors?r+=" "+G+" ":(r+=" if (Array.isArray("+k+")) { if (vErrors === null) vErrors = "+k+"; else vErrors = vErrors.concat("+k+"); errors = vErrors.length; for (var "+T+"="+p+"; "+T+"<errors; "+T+"++) { var "+E+" = vErrors["+T+"]; if ("+E+".dataPath === undefined) "+E+".dataPath = (dataPath || '') + "+e.errorPath+"; "+E+'.schemaPath = "'+h+'"; ',e.opts.verbose&&(r+=" "+E+".schema = "+o+"; "+E+".data = "+u+"; "),r+=" } } else { "+G+" } "),r+=" } ",d&&(r+=" else { ")}return r}},2860:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d="errs__"+o,u=e.util.copy(e),g="";u.level++;var p="valid"+u.level,m={},f={},v=e.opts.ownProperties;for(b in s)if("__proto__"!=b){var C=s[b],y=Array.isArray(C)?f:m;y[b]=C}n+="var "+d+" = errors;";var I=e.errorPath;for(var b in n+="var missing"+o+";",f)if((y=f[b]).length){if(n+=" if ( "+h+e.util.getProperty(b)+" !== undefined ",v&&(n+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(b)+"') "),c){n+=" && ( ";var A=y;if(A)for(var w=-1,S=A.length-1;w<S;)_=A[w+=1],w&&(n+=" || "),n+=" ( ( "+(M=h+(N=e.util.getProperty(_)))+" === undefined ",v&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(_)+"') "),n+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?_:N)+") ) ";n+=")) { ";var x="missing"+o,k="' + "+x+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(I,x,!0):I+" + "+x);var T=T||[];T.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { property: '"+e.util.escapeQuotes(b)+"', missingProperty: '"+k+"', depsCount: "+y.length+", deps: '"+e.util.escapeQuotes(1==y.length?y[0]:y.join(", "))+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should have ",1==y.length?n+="property "+e.util.escapeQuotes(y[0]):n+="properties "+e.util.escapeQuotes(y.join(", ")),n+=" when property "+e.util.escapeQuotes(b)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var E=n;n=T.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+E+"]); ":n+=" validate.errors = ["+E+"]; return false; ":n+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{n+=" ) { ";var R=y;if(R)for(var _,$=-1,L=R.length-1;$<L;){_=R[$+=1];var N=e.util.getProperty(_),M=(k=e.util.escapeQuotes(_),h+N);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(I,_,e.opts.jsonPointers)),n+=" if ( "+M+" === undefined ",v&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(_)+"') "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { property: '"+e.util.escapeQuotes(b)+"', missingProperty: '"+k+"', depsCount: "+y.length+", deps: '"+e.util.escapeQuotes(1==y.length?y[0]:y.join(", "))+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should have ",1==y.length?n+="property "+e.util.escapeQuotes(y[0]):n+="properties "+e.util.escapeQuotes(y.join(", ")),n+=" when property "+e.util.escapeQuotes(b)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}n+=" } ",c&&(g+="}",n+=" else { ")}e.errorPath=I;var B=u.baseId;for(var b in m)C=m[b],(e.opts.strictKeywords?"object"==typeof C&&Object.keys(C).length>0||!1===C:e.util.schemaHasRules(C,e.RULES.all))&&(n+=" "+p+" = true; if ( "+h+e.util.getProperty(b)+" !== undefined ",v&&(n+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(b)+"') "),n+=") { ",u.schema=C,u.schemaPath=a+e.util.getProperty(b),u.errSchemaPath=l+"/"+e.util.escapeFragment(b),n+=" "+e.validate(u)+" ",u.baseId=B,n+=" } ",c&&(n+=" if ("+p+") { ",g+="}"));return c&&(n+=" "+g+" if ("+d+" == errors) {"),n}},7112:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d="valid"+o,u=e.opts.$data&&s&&s.$data;u&&(n+=" var schema"+o+" = "+e.util.getData(s.$data,r,e.dataPathArr)+"; ");var g="i"+o,p="schema"+o;u||(n+=" var "+p+" = validate.schema"+a+";"),n+="var "+d+";",u&&(n+=" if (schema"+o+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+o+")) "+d+" = false; else {"),n+=d+" = false;for (var "+g+"=0; "+g+"<"+p+".length; "+g+"++) if (equal("+h+", "+p+"["+g+"])) { "+d+" = true; break; }",u&&(n+=" } "),n+=" if (!"+d+") { ";var m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValues: schema"+o+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var f=n;return n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+f+"]); ":n+=" validate.errors = ["+f+"]; return false; ":n+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",c&&(n+=" else { "),n}},4682:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||"");if(!1===e.opts.format)return c&&(n+=" if (true) { "),n;var d,u=e.opts.$data&&s&&s.$data;u?(n+=" var schema"+o+" = "+e.util.getData(s.$data,r,e.dataPathArr)+"; ",d="schema"+o):d=s;var g=e.opts.unknownFormats,p=Array.isArray(g);if(u)n+=" var "+(m="format"+o)+" = formats["+d+"]; var "+(f="isObject"+o)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(v="formatType"+o)+" = "+f+" && "+m+".type || 'string'; if ("+f+") { ",e.async&&(n+=" var async"+o+" = "+m+".async; "),n+=" "+m+" = "+m+".validate; } if ( ",u&&(n+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),n+=" (","ignore"!=g&&(n+=" ("+d+" && !"+m+" ",p&&(n+=" && self._opts.unknownFormats.indexOf("+d+") == -1 "),n+=") || "),n+=" ("+m+" && "+v+" == '"+i+"' && !(typeof "+m+" == 'function' ? ",e.async?n+=" (async"+o+" ? await "+m+"("+h+") : "+m+"("+h+")) ":n+=" "+m+"("+h+") ",n+=" : "+m+".test("+h+"))))) {";else{var m;if(!(m=e.formats[s])){if("ignore"==g)return e.logger.warn('unknown format "'+s+'" ignored in schema at path "'+e.errSchemaPath+'"'),c&&(n+=" if (true) { "),n;if(p&&g.indexOf(s)>=0)return c&&(n+=" if (true) { "),n;throw new Error('unknown format "'+s+'" is used in schema at path "'+e.errSchemaPath+'"')}var f,v=(f="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(f){var C=!0===m.async;m=m.validate}if(v!=i)return c&&(n+=" if (true) { "),n;if(C){if(!e.async)throw new Error("async format in sync schema");n+=" if (!(await "+(y="formats"+e.util.getProperty(s)+".validate")+"("+h+"))) { "}else{n+=" if (! ";var y="formats"+e.util.getProperty(s);f&&(y+=".validate"),n+="function"==typeof m?" "+y+"("+h+") ":" "+y+".test("+h+") ",n+=") { "}}var I=I||[];I.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",n+=u?""+d:""+e.util.toQuotedString(s),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match format \"",n+=u?"' + "+d+" + '":""+e.util.escapeQuotes(s),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=u?"validate.schema"+a:""+e.util.toQuotedString(s),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var b=n;return n=I.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},1678:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d="valid"+o,u="errs__"+o,g=e.util.copy(e);g.level++;var p="valid"+g.level,m=e.schema.then,f=e.schema.else,v=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0||!1===m:e.util.schemaHasRules(m,e.RULES.all)),C=void 0!==f&&(e.opts.strictKeywords?"object"==typeof f&&Object.keys(f).length>0||!1===f:e.util.schemaHasRules(f,e.RULES.all)),y=g.baseId;if(v||C){var I;g.createErrors=!1,g.schema=s,g.schemaPath=a,g.errSchemaPath=l,n+=" var "+u+" = errors; var "+d+" = true; ";var b=e.compositeRule;e.compositeRule=g.compositeRule=!0,n+=" "+e.validate(g)+" ",g.baseId=y,g.createErrors=!0,n+=" errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.compositeRule=g.compositeRule=b,v?(n+=" if ("+p+") { ",g.schema=e.schema.then,g.schemaPath=e.schemaPath+".then",g.errSchemaPath=e.errSchemaPath+"/then",n+=" "+e.validate(g)+" ",g.baseId=y,n+=" "+d+" = "+p+"; ",v&&C?n+=" var "+(I="ifClause"+o)+" = 'then'; ":I="'then'",n+=" } ",C&&(n+=" else { ")):n+=" if (!"+p+") { ",C&&(g.schema=e.schema.else,g.schemaPath=e.schemaPath+".else",g.errSchemaPath=e.errSchemaPath+"/else",n+=" "+e.validate(g)+" ",g.baseId=y,n+=" "+d+" = "+p+"; ",v&&C?n+=" var "+(I="ifClause"+o)+" = 'else'; ":I="'else'",n+=" } "),n+=" if (!"+d+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { failingKeyword: "+I+" } ",!1!==e.opts.messages&&(n+=" , message: 'should match \"' + "+I+" + '\" schema' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } ",c&&(n+=" else { ")}else c&&(n+=" if (true) { ");return n}},8161:function(e,t,i){"use strict";e.exports={$ref:i(7096),allOf:i(3531),anyOf:i(8854),$comment:i(8372),const:i(9650),contains:i(1292),dependencies:i(2860),enum:i(7112),format:i(4682),if:i(1678),items:i(3913),maximum:i(1765),minimum:i(1765),maxItems:i(9337),minItems:i(9337),maxLength:i(5433),minLength:i(5433),maxProperties:i(7724),minProperties:i(7724),multipleOf:i(812),not:i(1004),oneOf:i(6288),pattern:i(2079),properties:i(2124),propertyNames:i(4926),required:i(2e3),uniqueItems:i(7812),validate:i(1035)}},3913:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d="valid"+o,u="errs__"+o,g=e.util.copy(e),p="";g.level++;var m="valid"+g.level,f="i"+o,v=g.dataLevel=e.dataLevel+1,C="data"+v,y=e.baseId;if(n+="var "+u+" = errors;var "+d+";",Array.isArray(s)){var I=e.schema.additionalItems;if(!1===I){n+=" "+d+" = "+h+".length <= "+s.length+"; ";var b=l;l=e.errSchemaPath+"/additionalItems",n+=" if (!"+d+") { ";var A=A||[];A.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+s.length+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have more than "+s.length+" items' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var w=n;n=A.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+w+"]); ":n+=" validate.errors = ["+w+"]; return false; ":n+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",l=b,c&&(p+="}",n+=" else { ")}var S=s;if(S)for(var x,k=-1,T=S.length-1;k<T;)if(x=S[k+=1],e.opts.strictKeywords?"object"==typeof x&&Object.keys(x).length>0||!1===x:e.util.schemaHasRules(x,e.RULES.all)){n+=" "+m+" = true; if ("+h+".length > "+k+") { ";var E=h+"["+k+"]";g.schema=x,g.schemaPath=a+"["+k+"]",g.errSchemaPath=l+"/"+k,g.errorPath=e.util.getPathExpr(e.errorPath,k,e.opts.jsonPointers,!0),g.dataPathArr[v]=k;var R=e.validate(g);g.baseId=y,e.util.varOccurences(R,C)<2?n+=" "+e.util.varReplace(R,C,E)+" ":n+=" var "+C+" = "+E+"; "+R+" ",n+=" } ",c&&(n+=" if ("+m+") { ",p+="}")}"object"==typeof I&&(e.opts.strictKeywords?"object"==typeof I&&Object.keys(I).length>0||!1===I:e.util.schemaHasRules(I,e.RULES.all))&&(g.schema=I,g.schemaPath=e.schemaPath+".additionalItems",g.errSchemaPath=e.errSchemaPath+"/additionalItems",n+=" "+m+" = true; if ("+h+".length > "+s.length+") { for (var "+f+" = "+s.length+"; "+f+" < "+h+".length; "+f+"++) { ",g.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers,!0),E=h+"["+f+"]",g.dataPathArr[v]=f,R=e.validate(g),g.baseId=y,e.util.varOccurences(R,C)<2?n+=" "+e.util.varReplace(R,C,E)+" ":n+=" var "+C+" = "+E+"; "+R+" ",c&&(n+=" if (!"+m+") break; "),n+=" } } ",c&&(n+=" if ("+m+") { ",p+="}"))}else(e.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:e.util.schemaHasRules(s,e.RULES.all))&&(g.schema=s,g.schemaPath=a,g.errSchemaPath=l,n+=" for (var "+f+" = 0; "+f+" < "+h+".length; "+f+"++) { ",g.errorPath=e.util.getPathExpr(e.errorPath,f,e.opts.jsonPointers,!0),E=h+"["+f+"]",g.dataPathArr[v]=f,R=e.validate(g),g.baseId=y,e.util.varOccurences(R,C)<2?n+=" "+e.util.varReplace(R,C,E)+" ":n+=" var "+C+" = "+E+"; "+R+" ",c&&(n+=" if (!"+m+") break; "),n+=" }");return c&&(n+=" "+p+" if ("+u+" == errors) {"),n}},812:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(s||""),u=e.opts.$data&&a&&a.$data;if(u?(o+=" var schema"+r+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",n="schema"+r):n=a,!u&&"number"!=typeof a)throw new Error(t+" must be number");o+="var division"+r+";if (",u&&(o+=" "+n+" !== undefined && ( typeof "+n+" != 'number' || "),o+=" (division"+r+" = "+d+" / "+n+", ",e.opts.multipleOfPrecision?o+=" Math.abs(Math.round(division"+r+") - division"+r+") > 1e-"+e.opts.multipleOfPrecision+" ":o+=" division"+r+" !== parseInt(division"+r+") ",o+=" ) ",u&&(o+=" ) "),o+=" ) { ";var g=g||[];g.push(o),o="",!1!==e.createErrors?(o+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { multipleOf: "+n+" } ",!1!==e.opts.messages&&(o+=" , message: 'should be multiple of ",o+=u?"' + "+n:n+"'"),e.opts.verbose&&(o+=" , schema: ",o+=u?"validate.schema"+l:""+a,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var p=o;return o=g.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+p+"]); ":o+=" validate.errors = ["+p+"]; return false; ":o+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",h&&(o+=" else { "),o}},1004:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d="errs__"+o,u=e.util.copy(e);u.level++;var g="valid"+u.level;if(e.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:e.util.schemaHasRules(s,e.RULES.all)){u.schema=s,u.schemaPath=a,u.errSchemaPath=l,n+=" var "+d+" = errors; ";var p,m=e.compositeRule;e.compositeRule=u.compositeRule=!0,u.createErrors=!1,u.opts.allErrors&&(p=u.opts.allErrors,u.opts.allErrors=!1),n+=" "+e.validate(u)+" ",u.createErrors=!0,p&&(u.opts.allErrors=p),e.compositeRule=u.compositeRule=m,n+=" if ("+g+") { ";var f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var v=n;n=f.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else n+=" var err = ",!1!==e.createErrors?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(n+=" if (false) { ");return n}},6288:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d="valid"+o,u="errs__"+o,g=e.util.copy(e),p="";g.level++;var m="valid"+g.level,f=g.baseId,v="prevValid"+o,C="passingSchemas"+o;n+="var "+u+" = errors , "+v+" = false , "+d+" = false , "+C+" = null; ";var y=e.compositeRule;e.compositeRule=g.compositeRule=!0;var I=s;if(I)for(var b,A=-1,w=I.length-1;A<w;)b=I[A+=1],(e.opts.strictKeywords?"object"==typeof b&&Object.keys(b).length>0||!1===b:e.util.schemaHasRules(b,e.RULES.all))?(g.schema=b,g.schemaPath=a+"["+A+"]",g.errSchemaPath=l+"/"+A,n+=" "+e.validate(g)+" ",g.baseId=f):n+=" var "+m+" = true; ",A&&(n+=" if ("+m+" && "+v+") { "+d+" = false; "+C+" = ["+C+", "+A+"]; } else { ",p+="}"),n+=" if ("+m+") { "+d+" = "+v+" = true; "+C+" = "+A+"; }";return e.compositeRule=g.compositeRule=y,n+=p+"if (!"+d+") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+C+" } ",!1!==e.opts.messages&&(n+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+="} else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; }",e.opts.allErrors&&(n+=" } "),n}},2079:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(s||""),u=e.opts.$data&&a&&a.$data;u?(o+=" var schema"+r+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",n="schema"+r):n=a,o+="if ( ",u&&(o+=" ("+n+" !== undefined && typeof "+n+" != 'string') || "),o+=" !"+(u?"(new RegExp("+n+"))":e.usePattern(a))+".test("+d+") ) { ";var g=g||[];g.push(o),o="",!1!==e.createErrors?(o+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { pattern: ",o+=u?""+n:""+e.util.toQuotedString(a),o+=" } ",!1!==e.opts.messages&&(o+=" , message: 'should match pattern \"",o+=u?"' + "+n+" + '":""+e.util.escapeQuotes(a),o+="\"' "),e.opts.verbose&&(o+=" , schema: ",o+=u?"validate.schema"+l:""+e.util.toQuotedString(a),o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var p=o;return o=g.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+p+"]); ":o+=" validate.errors = ["+p+"]; return false; ":o+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+="} ",h&&(o+=" else { "),o}},2124:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d="errs__"+o,u=e.util.copy(e),g="";u.level++;var p="valid"+u.level,m="key"+o,f="idx"+o,v=u.dataLevel=e.dataLevel+1,C="data"+v,y="dataProperties"+o,I=Object.keys(s||{}).filter(N),b=e.schema.patternProperties||{},A=Object.keys(b).filter(N),w=e.schema.additionalProperties,S=I.length||A.length,x=!1===w,k="object"==typeof w&&Object.keys(w).length,T=e.opts.removeAdditional,E=x||k||T,R=e.opts.ownProperties,_=e.baseId,$=e.schema.required;if($&&(!e.opts.$data||!$.$data)&&$.length<e.opts.loopRequired)var L=e.util.toHash($);function N(e){return"__proto__"!==e}if(n+="var "+d+" = errors;var "+p+" = true;",R&&(n+=" var "+y+" = undefined;"),E){if(n+=R?" "+y+" = "+y+" || Object.keys("+h+"); for (var "+f+"=0; "+f+"<"+y+".length; "+f+"++) { var "+m+" = "+y+"["+f+"]; ":" for (var "+m+" in "+h+") { ",S){if(n+=" var isAdditional"+o+" = !(false ",I.length)if(I.length>8)n+=" || validate.schema"+a+".hasOwnProperty("+m+") ";else{var M=I;if(M)for(var B=-1,W=M.length-1;B<W;)Y=M[B+=1],n+=" || "+m+" == "+e.util.toQuotedString(Y)+" "}if(A.length){var P=A;if(P)for(var H=-1,G=P.length-1;H<G;)re=P[H+=1],n+=" || "+e.usePattern(re)+".test("+m+") "}n+=" ); if (isAdditional"+o+") { "}if("all"==T)n+=" delete "+h+"["+m+"]; ";else{var F=e.errorPath,O="' + "+m+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers)),x)if(T)n+=" delete "+h+"["+m+"]; ";else{n+=" "+p+" = false; ";var V=l;l=e.errSchemaPath+"/additionalProperties",(ie=ie||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { additionalProperty: '"+O+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is an invalid additional property":n+="should NOT have additional properties",n+="' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var Z=n;n=ie.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+Z+"]); ":n+=" validate.errors = ["+Z+"]; return false; ":n+=" var err = "+Z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=V,c&&(n+=" break; ")}else if(k)if("failing"==T){n+=" var "+d+" = errors; ";var D=e.compositeRule;e.compositeRule=u.compositeRule=!0,u.schema=w,u.schemaPath=e.schemaPath+".additionalProperties",u.errSchemaPath=e.errSchemaPath+"/additionalProperties",u.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var j=h+"["+m+"]";u.dataPathArr[v]=m;var K=e.validate(u);u.baseId=_,e.util.varOccurences(K,C)<2?n+=" "+e.util.varReplace(K,C,j)+" ":n+=" var "+C+" = "+j+"; "+K+" ",n+=" if (!"+p+") { errors = "+d+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+h+"["+m+"]; } ",e.compositeRule=u.compositeRule=D}else u.schema=w,u.schemaPath=e.schemaPath+".additionalProperties",u.errSchemaPath=e.errSchemaPath+"/additionalProperties",u.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers),j=h+"["+m+"]",u.dataPathArr[v]=m,K=e.validate(u),u.baseId=_,e.util.varOccurences(K,C)<2?n+=" "+e.util.varReplace(K,C,j)+" ":n+=" var "+C+" = "+j+"; "+K+" ",c&&(n+=" if (!"+p+") break; ");e.errorPath=F}S&&(n+=" } "),n+=" } ",c&&(n+=" if ("+p+") { ",g+="}")}var z=e.opts.useDefaults&&!e.compositeRule;if(I.length){var X=I;if(X)for(var Y,J=-1,U=X.length-1;J<U;){var Q=s[Y=X[J+=1]];if(e.opts.strictKeywords?"object"==typeof Q&&Object.keys(Q).length>0||!1===Q:e.util.schemaHasRules(Q,e.RULES.all)){var q=e.util.getProperty(Y),ee=(j=h+q,z&&void 0!==Q.default);if(u.schema=Q,u.schemaPath=a+q,u.errSchemaPath=l+"/"+e.util.escapeFragment(Y),u.errorPath=e.util.getPath(e.errorPath,Y,e.opts.jsonPointers),u.dataPathArr[v]=e.util.toQuotedString(Y),K=e.validate(u),u.baseId=_,e.util.varOccurences(K,C)<2){K=e.util.varReplace(K,C,j);var te=j}else te=C,n+=" var "+C+" = "+j+"; ";if(ee)n+=" "+K+" ";else{if(L&&L[Y]){n+=" if ( "+te+" === undefined ",R&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(Y)+"') "),n+=") { "+p+" = false; ",F=e.errorPath,V=l;var ie,ne=e.util.escapeQuotes(Y);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(F,Y,e.opts.jsonPointers)),l=e.errSchemaPath+"/required",(ie=ie||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+ne+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+ne+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",Z=n,n=ie.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+Z+"]); ":n+=" validate.errors = ["+Z+"]; return false; ":n+=" var err = "+Z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=V,e.errorPath=F,n+=" } else { "}else c?(n+=" if ( "+te+" === undefined ",R&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(Y)+"') "),n+=") { "+p+" = true; } else { "):(n+=" if ("+te+" !== undefined ",R&&(n+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(Y)+"') "),n+=" ) { ");n+=" "+K+" } "}}c&&(n+=" if ("+p+") { ",g+="}")}}if(A.length){var oe=A;if(oe)for(var re,se=-1,ae=oe.length-1;se<ae;)Q=b[re=oe[se+=1]],(e.opts.strictKeywords?"object"==typeof Q&&Object.keys(Q).length>0||!1===Q:e.util.schemaHasRules(Q,e.RULES.all))&&(u.schema=Q,u.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(re),u.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(re),n+=R?" "+y+" = "+y+" || Object.keys("+h+"); for (var "+f+"=0; "+f+"<"+y+".length; "+f+"++) { var "+m+" = "+y+"["+f+"]; ":" for (var "+m+" in "+h+") { ",n+=" if ("+e.usePattern(re)+".test("+m+")) { ",u.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers),j=h+"["+m+"]",u.dataPathArr[v]=m,K=e.validate(u),u.baseId=_,e.util.varOccurences(K,C)<2?n+=" "+e.util.varReplace(K,C,j)+" ":n+=" var "+C+" = "+j+"; "+K+" ",c&&(n+=" if (!"+p+") break; "),n+=" } ",c&&(n+=" else "+p+" = true; "),n+=" } ",c&&(n+=" if ("+p+") { ",g+="}"))}return c&&(n+=" "+g+" if ("+d+" == errors) {"),n}},4926:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d="errs__"+o,u=e.util.copy(e);u.level++;var g="valid"+u.level;if(n+="var "+d+" = errors;",e.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:e.util.schemaHasRules(s,e.RULES.all)){u.schema=s,u.schemaPath=a,u.errSchemaPath=l;var p="key"+o,m="idx"+o,f="i"+o,v="' + "+p+" + '",C="data"+(u.dataLevel=e.dataLevel+1),y="dataProperties"+o,I=e.opts.ownProperties,b=e.baseId;I&&(n+=" var "+y+" = undefined; "),n+=I?" "+y+" = "+y+" || Object.keys("+h+"); for (var "+m+"=0; "+m+"<"+y+".length; "+m+"++) { var "+p+" = "+y+"["+m+"]; ":" for (var "+p+" in "+h+") { ",n+=" var startErrs"+o+" = errors; ";var A=p,w=e.compositeRule;e.compositeRule=u.compositeRule=!0;var S=e.validate(u);u.baseId=b,e.util.varOccurences(S,C)<2?n+=" "+e.util.varReplace(S,C,A)+" ":n+=" var "+C+" = "+A+"; "+S+" ",e.compositeRule=u.compositeRule=w,n+=" if (!"+g+") { for (var "+f+"=startErrs"+o+"; "+f+"<errors; "+f+"++) { vErrors["+f+"].propertyName = "+p+"; } var err = ",!1!==e.createErrors?(n+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { propertyName: '"+v+"' } ",!1!==e.opts.messages&&(n+=" , message: 'property name \\'"+v+"\\' is invalid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),c&&(n+=" break; "),n+=" } }"}return c&&(n+=" if ("+d+" == errors) {"),n}},7096:function(e){"use strict";e.exports=function(e,t,i){var n,o,r=" ",s=e.level,a=e.dataLevel,l=e.schema[t],c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(a||""),u="valid"+s;if("#"==l||"#/"==l)e.isRoot?(n=e.async,o="validate"):(n=!0===e.root.schema.$async,o="root.refVal[0]");else{var g=e.resolveRef(e.baseId,l,e.isRoot);if(void 0===g){var p=e.MissingRefError.message(e.baseId,l);if("fail"==e.opts.missingRefs){e.logger.error(p),(C=C||[]).push(r),r="",!1!==e.createErrors?(r+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",!1!==e.opts.messages&&(r+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(r+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ";var m=r;r=C.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(r+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,l,p);e.logger.warn(p),h&&(r+=" if (true) { ")}}else if(g.inline){var f=e.util.copy(e);f.level++;var v="valid"+f.level;f.schema=g.schema,f.schemaPath="",f.errSchemaPath=l,r+=" "+e.validate(f).replace(/validate\.schema/g,g.code)+" ",h&&(r+=" if ("+v+") { ")}else n=!0===g.$async||e.async&&!1!==g.$async,o=g.code}if(o){var C;(C=C||[]).push(r),r="",e.opts.passContext?r+=" "+o+".call(this, ":r+=" "+o+"( ",r+=" "+d+", (dataPath || '')",'""'!=e.errorPath&&(r+=" + "+e.errorPath);var y=r+=" , "+(a?"data"+(a-1||""):"parentData")+" , "+(a?e.dataPathArr[a]:"parentDataProperty")+", rootData) ";if(r=C.pop(),n){if(!e.async)throw new Error("async schema referenced by sync schema");h&&(r+=" var "+u+"; "),r+=" try { await "+y+"; ",h&&(r+=" "+u+" = true; "),r+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",h&&(r+=" "+u+" = false; "),r+=" } ",h&&(r+=" if ("+u+") { ")}else r+=" if (!"+y+") { if (vErrors === null) vErrors = "+o+".errors; else vErrors = vErrors.concat("+o+".errors); errors = vErrors.length; } ",h&&(r+=" else { ")}return r}},2e3:function(e){"use strict";e.exports=function(e,t,i){var n=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d="valid"+o,u=e.opts.$data&&s&&s.$data;u&&(n+=" var schema"+o+" = "+e.util.getData(s.$data,r,e.dataPathArr)+"; ");var g="schema"+o;if(!u)if(s.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var p=[],m=s;if(m)for(var f,v=-1,C=m.length-1;v<C;){f=m[v+=1];var y=e.schema.properties[f];y&&(e.opts.strictKeywords?"object"==typeof y&&Object.keys(y).length>0||!1===y:e.util.schemaHasRules(y,e.RULES.all))||(p[p.length]=f)}}else p=s;if(u||p.length){var I=e.errorPath,b=u||p.length>=e.opts.loopRequired,A=e.opts.ownProperties;if(c)if(n+=" var missing"+o+"; ",b){u||(n+=" var "+g+" = validate.schema"+a+"; ");var w="' + "+(R="schema"+o+"["+(T="i"+o)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(I,R,e.opts.jsonPointers)),n+=" var "+d+" = true; ",u&&(n+=" if (schema"+o+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+o+")) "+d+" = false; else {"),n+=" for (var "+T+" = 0; "+T+" < "+g+".length; "+T+"++) { "+d+" = "+h+"["+g+"["+T+"]] !== undefined ",A&&(n+=" && Object.prototype.hasOwnProperty.call("+h+", "+g+"["+T+"]) "),n+="; if (!"+d+") break; } ",u&&(n+=" } "),n+=" if (!"+d+") { ",(x=x||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+w+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+w+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var S=n;n=x.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+S+"]); ":n+=" validate.errors = ["+S+"]; return false; ":n+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else{n+=" if ( ";var x,k=p;if(k)for(var T=-1,E=k.length-1;T<E;)$=k[T+=1],T&&(n+=" || "),n+=" ( ( "+(B=h+(M=e.util.getProperty($)))+" === undefined ",A&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes($)+"') "),n+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?$:M)+") ) ";n+=") { ",w="' + "+(R="missing"+o)+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(I,R,!0):I+" + "+R),(x=x||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+w+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+w+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",S=n,n=x.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+S+"]); ":n+=" validate.errors = ["+S+"]; return false; ":n+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else if(b){var R;u||(n+=" var "+g+" = validate.schema"+a+"; "),w="' + "+(R="schema"+o+"["+(T="i"+o)+"]")+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(I,R,e.opts.jsonPointers)),u&&(n+=" if ("+g+" && !Array.isArray("+g+")) { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+w+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+w+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+g+" !== undefined) { "),n+=" for (var "+T+" = 0; "+T+" < "+g+".length; "+T+"++) { if ("+h+"["+g+"["+T+"]] === undefined ",A&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", "+g+"["+T+"]) "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+w+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+w+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",u&&(n+=" } ")}else{var _=p;if(_)for(var $,L=-1,N=_.length-1;L<N;){$=_[L+=1];var M=e.util.getProperty($),B=(w=e.util.escapeQuotes($),h+M);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(I,$,e.opts.jsonPointers)),n+=" if ( "+B+" === undefined ",A&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes($)+"') "),n+=") { var err = ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+w+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+w+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=I}else c&&(n+=" if (true) {");return n}},7812:function(e){"use strict";e.exports=function(e,t,i){var n,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,d="data"+(s||""),u="valid"+r,g=e.opts.$data&&a&&a.$data;if(g?(o+=" var schema"+r+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",n="schema"+r):n=a,(a||g)&&!1!==e.opts.uniqueItems){g&&(o+=" var "+u+"; if ("+n+" === false || "+n+" === undefined) "+u+" = true; else if (typeof "+n+" != 'boolean') "+u+" = false; else { "),o+=" var i = "+d+".length , "+u+" = true , j; if (i > 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(p.indexOf("object")>=0||p.indexOf("array")>=0))o+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+d+"[i], "+d+"[j])) { "+u+" = false; break outer; } } } ";else{o+=" var itemIndices = {}, item; for (;i--;) { var item = "+d+"[i]; ";var f="checkDataType"+(m?"s":"");o+=" if ("+e.util[f](p,"item",e.opts.strictNumbers,!0)+") continue; ",m&&(o+=" if (typeof item == 'string') item = '\"' + item; "),o+=" if (typeof itemIndices[item] == 'number') { "+u+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}o+=" } ",g&&(o+=" } "),o+=" if (!"+u+") { ";var v=v||[];v.push(o),o="",!1!==e.createErrors?(o+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(o+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(o+=" , schema: ",o+=g?"validate.schema"+l:""+a,o+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),o+=" } "):o+=" {} ";var C=o;o=v.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+C+"]); ":o+=" validate.errors = ["+C+"]; return false; ":o+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+=" } ",h&&(o+=" else { ")}else h&&(o+=" if (true) { ");return o}},1035:function(e){"use strict";e.exports=function(e,t,i){var n="",o=!0===e.schema.$async,r=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),s=e.self._getId(e.schema);if(e.opts.strictKeywords){var a=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(a){var l="unknown keyword: "+a;if("log"!==e.opts.strictKeywords)throw new Error(l);e.logger.warn(l)}}if(e.isTop&&(n+=" var validate = ",o&&(e.async=!0,n+="async "),n+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",s&&(e.opts.sourceCode||e.opts.processCode)&&(n+=" /*# sourceURL="+s+" */ ")),"boolean"==typeof e.schema||!r&&!e.schema.$ref){t="false schema";var c=e.level,h=e.dataLevel,d=e.schema[t],u=e.schemaPath+e.util.getProperty(t),g=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,m="data"+(h||""),f="valid"+c;if(!1===e.schema){e.isTop?p=!0:n+=" var "+f+" = false; ",(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'boolean schema is false' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ";var v=n;n=j.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?n+=o?" return data; ":" validate.errors = null; return true; ":n+=" var "+f+" = true; ";return e.isTop&&(n+=" }; return validate; "),n}if(e.isTop){var C=e.isTop;if(c=e.level=0,h=e.dataLevel=0,m="data",e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var y="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(y);e.logger.warn(y)}n+=" var vErrors = null; ",n+=" var errors = 0; ",n+=" if (rootData === undefined) rootData = data; "}else{if(c=e.level,m="data"+((h=e.dataLevel)||""),s&&(e.baseId=e.resolve.url(e.baseId,s)),o&&!e.async)throw new Error("async schema in sync schema");n+=" var errs_"+c+" = errors;"}f="valid"+c,p=!e.opts.allErrors;var I="",b="",A=e.schema.type,w=Array.isArray(A);if(A&&e.opts.nullable&&!0===e.schema.nullable&&(w?-1==A.indexOf("null")&&(A=A.concat("null")):"null"!=A&&(A=[A,"null"],w=!0)),w&&1==A.length&&(A=A[0],w=!1),e.schema.$ref&&r){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');!0!==e.opts.extendRefs&&(r=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(n+=" "+e.RULES.all.$comment.code(e,"$comment")),A){if(e.opts.coerceTypes)var S=e.util.coerceToTypes(e.opts.coerceTypes,A);var x=e.RULES.types[A];if(S||w||!0===x||x&&!U(x)){u=e.schemaPath+".type",g=e.errSchemaPath+"/type",u=e.schemaPath+".type",g=e.errSchemaPath+"/type";var k=w?"checkDataTypes":"checkDataType";if(n+=" if ("+e.util[k](A,m,e.opts.strictNumbers,!0)+") { ",S){var T="dataType"+c,E="coerced"+c;n+=" var "+T+" = typeof "+m+"; var "+E+" = undefined; ","array"==e.opts.coerceTypes&&(n+=" if ("+T+" == 'object' && Array.isArray("+m+") && "+m+".length == 1) { "+m+" = "+m+"[0]; "+T+" = typeof "+m+"; if ("+e.util.checkDataType(e.schema.type,m,e.opts.strictNumbers)+") "+E+" = "+m+"; } "),n+=" if ("+E+" !== undefined) ; ";var R=S;if(R)for(var _,$=-1,L=R.length-1;$<L;)"string"==(_=R[$+=1])?n+=" else if ("+T+" == 'number' || "+T+" == 'boolean') "+E+" = '' + "+m+"; else if ("+m+" === null) "+E+" = ''; ":"number"==_||"integer"==_?(n+=" else if ("+T+" == 'boolean' || "+m+" === null || ("+T+" == 'string' && "+m+" && "+m+" == +"+m+" ","integer"==_&&(n+=" && !("+m+" % 1)"),n+=")) "+E+" = +"+m+"; "):"boolean"==_?n+=" else if ("+m+" === 'false' || "+m+" === 0 || "+m+" === null) "+E+" = false; else if ("+m+" === 'true' || "+m+" === 1) "+E+" = true; ":"null"==_?n+=" else if ("+m+" === '' || "+m+" === 0 || "+m+" === false) "+E+" = null; ":"array"==e.opts.coerceTypes&&"array"==_&&(n+=" else if ("+T+" == 'string' || "+T+" == 'number' || "+T+" == 'boolean' || "+m+" == null) "+E+" = ["+m+"]; ");n+=" else { ",(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { type: '",n+=w?""+A.join(","):""+A,n+="' } ",!1!==e.opts.messages&&(n+=" , message: 'should be ",n+=w?""+A.join(","):""+A,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ",v=n,n=j.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } if ("+E+" !== undefined) { ";var N=h?"data"+(h-1||""):"parentData";n+=" "+m+" = "+E+"; ",h||(n+="if ("+N+" !== undefined)"),n+=" "+N+"["+(h?e.dataPathArr[h]:"parentDataProperty")+"] = "+E+"; } "}else(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { type: '",n+=w?""+A.join(","):""+A,n+="' } ",!1!==e.opts.messages&&(n+=" , message: 'should be ",n+=w?""+A.join(","):""+A,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ",v=n,n=j.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";n+=" } "}}if(e.schema.$ref&&!r)n+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",p&&(n+=" } if (errors === ",n+=C?"0":"errs_"+c,n+=") { ",b+="}");else{var M=e.RULES;if(M)for(var B=-1,W=M.length-1;B<W;)if(U(x=M[B+=1])){if(x.type&&(n+=" if ("+e.util.checkDataType(x.type,m,e.opts.strictNumbers)+") { "),e.opts.useDefaults)if("object"==x.type&&e.schema.properties){d=e.schema.properties;var P=Object.keys(d);if(P)for(var H,G=-1,F=P.length-1;G<F;)if(void 0!==(Z=d[H=P[G+=1]]).default){var O=m+e.util.getProperty(H);if(e.compositeRule){if(e.opts.strictDefaults){if(y="default is ignored for: "+O,"log"!==e.opts.strictDefaults)throw new Error(y);e.logger.warn(y)}}else n+=" if ("+O+" === undefined ","empty"==e.opts.useDefaults&&(n+=" || "+O+" === null || "+O+" === '' "),n+=" ) "+O+" = ","shared"==e.opts.useDefaults?n+=" "+e.useDefault(Z.default)+" ":n+=" "+JSON.stringify(Z.default)+" ",n+="; "}}else if("array"==x.type&&Array.isArray(e.schema.items)){var V=e.schema.items;if(V){$=-1;for(var Z,D=V.length-1;$<D;)if(void 0!==(Z=V[$+=1]).default)if(O=m+"["+$+"]",e.compositeRule){if(e.opts.strictDefaults){if(y="default is ignored for: "+O,"log"!==e.opts.strictDefaults)throw new Error(y);e.logger.warn(y)}}else n+=" if ("+O+" === undefined ","empty"==e.opts.useDefaults&&(n+=" || "+O+" === null || "+O+" === '' "),n+=" ) "+O+" = ","shared"==e.opts.useDefaults?n+=" "+e.useDefault(Z.default)+" ":n+=" "+JSON.stringify(Z.default)+" ",n+="; "}}var j,K=x.rules;if(K)for(var z,X=-1,Y=K.length-1;X<Y;)if(Q(z=K[X+=1])){var J=z.code(e,z.keyword,x.type);J&&(n+=" "+J+" ",p&&(I+="}"))}if(p&&(n+=" "+I+" ",I=""),x.type&&(n+=" } ",A&&A===x.type&&!S))n+=" else { ",u=e.schemaPath+".type",g=e.errSchemaPath+"/type",(j=j||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { type: '",n+=w?""+A.join(","):""+A,n+="' } ",!1!==e.opts.messages&&(n+=" , message: 'should be ",n+=w?""+A.join(","):""+A,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),n+=" } "):n+=" {} ",v=n,n=j.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ";p&&(n+=" if (errors === ",n+=C?"0":"errs_"+c,n+=") { ",b+="}")}}function U(e){for(var t=e.rules,i=0;i<t.length;i++)if(Q(t[i]))return!0}function Q(t){return void 0!==e.schema[t.keyword]||t.implements&&function(t){for(var i=t.implements,n=0;n<i.length;n++)if(void 0!==e.schema[i[n]])return!0}(t)}return p&&(n+=" "+b+" "),C?(o?(n+=" if (errors === 0) return data; ",n+=" else throw new ValidationError(vErrors); "):(n+=" validate.errors = vErrors; ",n+=" return errors === 0; "),n+=" }; return validate;"):n+=" var "+f+" = errors === errs_"+c+";",n}},413:function(e,t,i){"use strict";var n=/^[a-z_$][a-z0-9_$-]*$/i,o=i(8050),r=i(9407);e.exports={add:function(e,t){var i=this.RULES;if(i.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!n.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(t){this.validateKeyword(t,!0);var r=t.type;if(Array.isArray(r))for(var s=0;s<r.length;s++)l(e,r[s],t);else l(e,r,t);var a=t.metaSchema;a&&(t.$data&&this._opts.$data&&(a={anyOf:[a,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),t.validateSchema=this.compile(a,!0))}function l(e,t,n){for(var r,s=0;s<i.length;s++){var a=i[s];if(a.type==t){r=a;break}}r||(r={type:t,rules:[]},i.push(r));var l={keyword:e,definition:n,custom:!0,code:o,implements:n.implements};r.rules.push(l),i.custom[e]=l}return i.keywords[e]=i.all[e]=!0,this},get:function(e){var t=this.RULES.custom[e];return t?t.definition:this.RULES.keywords[e]||!1},remove:function(e){var t=this.RULES;delete t.keywords[e],delete t.all[e],delete t.custom[e];for(var i=0;i<t.length;i++)for(var n=t[i].rules,o=0;o<n.length;o++)if(n[o].keyword==e){n.splice(o,1);break}return this},validate:function e(t,i){e.errors=null;var n=this._validateKeyword=this._validateKeyword||this.compile(r,!0);if(n(t))return!0;if(e.errors=n.errors,i)throw new Error("custom keyword definition is invalid: "+this.errorsText(n.errors));return!1}}},5215:function(e){"use strict";e.exports=function e(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;var n,o,r;if(Array.isArray(t)){if((n=t.length)!=i.length)return!1;for(o=n;0!=o--;)if(!e(t[o],i[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if((n=(r=Object.keys(t)).length)!==Object.keys(i).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(i,r[o]))return!1;for(o=n;0!=o--;){var s=r[o];if(!e(t[s],i[s]))return!1}return!0}return t!=t&&i!=i}},9306:function(e){"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var i,n="boolean"==typeof t.cycles&&t.cycles,o=t.cmp&&(i=t.cmp,function(e){return function(t,n){var o={key:t,value:e[t]},r={key:n,value:e[n]};return i(o,r)}}),r=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var i,s;if(Array.isArray(t)){for(s="[",i=0;i<t.length;i++)i&&(s+=","),s+=e(t[i])||"null";return s+"]"}if(null===t)return"null";if(-1!==r.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=r.push(t)-1,l=Object.keys(t).sort(o&&o(t));for(s="",i=0;i<l.length;i++){var c=l[i],h=e(t[c]);h&&(s&&(s+=","),s+=JSON.stringify(c)+":"+h)}return r.splice(a,1),"{"+s+"}"}}(e)}},1342:function(e){e.exports=function e(t,i){"use strict";var n,o,r=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,s=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,c=/^0/,h=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},d=h(t).replace(s,"")||"",u=h(i).replace(s,"")||"",g=d.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=u.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=parseInt(d.match(l),16)||1!==g.length&&d.match(a)&&Date.parse(d),f=parseInt(u.match(l),16)||m&&u.match(a)&&Date.parse(u)||null;if(f){if(m<f)return-1;if(m>f)return 1}for(var v=0,C=Math.max(g.length,p.length);v<C;v++){if(n=!(g[v]||"").match(c)&&parseFloat(g[v])||g[v]||0,o=!(p[v]||"").match(c)&&parseFloat(p[v])||p[v]||0,isNaN(n)!==isNaN(o))return isNaN(n)?1:-1;if(typeof n!=typeof o&&(n+="",o+=""),n<o)return-1;if(n>o)return 1}return 0}},9151:function(e,t){!function(e){"use strict";function t(e){return null!==e&&"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function n(e,o){if(e===o)return!0;if(Object.prototype.toString.call(e)!==Object.prototype.toString.call(o))return!1;if(!0===t(e)){if(e.length!==o.length)return!1;for(var r=0;r<e.length;r++)if(!1===n(e[r],o[r]))return!1;return!0}if(!0===i(e)){var s={};for(var a in e)if(hasOwnProperty.call(e,a)){if(!1===n(e[a],o[a]))return!1;s[a]=!0}for(var l in o)if(hasOwnProperty.call(o,l)&&!0!==s[l])return!1;return!0}return!1}function o(e){if(""===e||!1===e||null===e)return!0;if(t(e)&&0===e.length)return!0;if(i(e)){for(var n in e)if(e.hasOwnProperty(n))return!1;return!0}return!1}var r;r="function"==typeof String.prototype.trimLeft?function(e){return e.trimLeft()}:function(e){return e.match(/^\s*(.*)/)[1]};var s=0,a=1,l=2,c=3,h=4,d=6,u=8,g=9,p={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},m="EOF",f="UnquotedIdentifier",v="QuotedIdentifier",C="Rbracket",y="Rparen",I="Comma",b="Colon",A="Rbrace",w="Number",S="Current",x="Expref",k="Pipe",T="Or",E="And",R="EQ",_="GT",$="LT",L="GTE",N="LTE",M="NE",B="Flatten",W="Star",P="Filter",H="Dot",G="Not",F="Lbrace",O="Lbracket",V="Lparen",Z="Literal",D={".":H,"*":W,",":I,":":b,"{":F,"}":A,"]":C,"(":V,")":y,"@":S},j={"<":!0,">":!0,"=":!0,"!":!0},K={" ":!0,"\t":!0,"\n":!0};function z(e){return e>="0"&&e<="9"||"-"===e}function X(){}X.prototype={tokenize:function(e){var t,i,n,o,r=[];for(this._current=0;this._current<e.length;)if((o=e[this._current])>="a"&&o<="z"||o>="A"&&o<="Z"||"_"===o)t=this._current,i=this._consumeUnquotedIdentifier(e),r.push({type:f,value:i,start:t});else if(void 0!==D[e[this._current]])r.push({type:D[e[this._current]],value:e[this._current],start:this._current}),this._current++;else if(z(e[this._current]))n=this._consumeNumber(e),r.push(n);else if("["===e[this._current])n=this._consumeLBracket(e),r.push(n);else if('"'===e[this._current])t=this._current,i=this._consumeQuotedIdentifier(e),r.push({type:v,value:i,start:t});else if("'"===e[this._current])t=this._current,i=this._consumeRawStringLiteral(e),r.push({type:Z,value:i,start:t});else if("`"===e[this._current]){t=this._current;var s=this._consumeLiteral(e);r.push({type:Z,value:s,start:t})}else if(void 0!==j[e[this._current]])r.push(this._consumeOperator(e));else if(void 0!==K[e[this._current]])this._current++;else if("&"===e[this._current])t=this._current,this._current++,"&"===e[this._current]?(this._current++,r.push({type:E,value:"&&",start:t})):r.push({type:x,value:"&",start:t});else{if("|"!==e[this._current]){var a=new Error("Unknown character:"+e[this._current]);throw a.name="LexerError",a}t=this._current,this._current++,"|"===e[this._current]?(this._current++,r.push({type:T,value:"||",start:t})):r.push({type:k,value:"|",start:t})}return r},_consumeUnquotedIdentifier:function(e){var t,i=this._current;for(this._current++;this._current<e.length&&((t=e[this._current])>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||"_"===t);)this._current++;return e.slice(i,this._current)},_consumeQuotedIdentifier:function(e){var t=this._current;this._current++;for(var i=e.length;'"'!==e[this._current]&&this._current<i;){var n=this._current;"\\"!==e[n]||"\\"!==e[n+1]&&'"'!==e[n+1]?n++:n+=2,this._current=n}return this._current++,JSON.parse(e.slice(t,this._current))},_consumeRawStringLiteral:function(e){var t=this._current;this._current++;for(var i=e.length;"'"!==e[this._current]&&this._current<i;){var n=this._current;"\\"!==e[n]||"\\"!==e[n+1]&&"'"!==e[n+1]?n++:n+=2,this._current=n}return this._current++,e.slice(t+1,this._current-1).replace("\\'","'")},_consumeNumber:function(e){var t=this._current;this._current++;for(var i=e.length;z(e[this._current])&&this._current<i;)this._current++;var n=parseInt(e.slice(t,this._current));return{type:w,value:n,start:t}},_consumeLBracket:function(e){var t=this._current;return this._current++,"?"===e[this._current]?(this._current++,{type:P,value:"[?",start:t}):"]"===e[this._current]?(this._current++,{type:B,value:"[]",start:t}):{type:O,value:"[",start:t}},_consumeOperator:function(e){var t=this._current,i=e[t];return this._current++,"!"===i?"="===e[this._current]?(this._current++,{type:M,value:"!=",start:t}):{type:G,value:"!",start:t}:"<"===i?"="===e[this._current]?(this._current++,{type:N,value:"<=",start:t}):{type:$,value:"<",start:t}:">"===i?"="===e[this._current]?(this._current++,{type:L,value:">=",start:t}):{type:_,value:">",start:t}:"="===i&&"="===e[this._current]?(this._current++,{type:R,value:"==",start:t}):void 0},_consumeLiteral:function(e){this._current++;for(var t,i=this._current,n=e.length;"`"!==e[this._current]&&this._current<n;){var o=this._current;"\\"!==e[o]||"\\"!==e[o+1]&&"`"!==e[o+1]?o++:o+=2,this._current=o}var s=r(e.slice(i,this._current));return s=s.replace("\\`","`"),t=this._looksLikeJSON(s)?JSON.parse(s):JSON.parse('"'+s+'"'),this._current++,t},_looksLikeJSON:function(e){if(""===e)return!1;if('[{"'.indexOf(e[0])>=0)return!0;if(["true","false","null"].indexOf(e)>=0)return!0;if(!("-0123456789".indexOf(e[0])>=0))return!1;try{return JSON.parse(e),!0}catch(e){return!1}}};var Y={};function J(){}function U(e){this.runtime=e}function Q(e){this._interpreter=e,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[s]}]},avg:{_func:this._functionAvg,_signature:[{types:[u]}]},ceil:{_func:this._functionCeil,_signature:[{types:[s]}]},contains:{_func:this._functionContains,_signature:[{types:[l,c]},{types:[a]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[l]},{types:[l]}]},floor:{_func:this._functionFloor,_signature:[{types:[s]}]},length:{_func:this._functionLength,_signature:[{types:[l,c,h]}]},map:{_func:this._functionMap,_signature:[{types:[d]},{types:[c]}]},max:{_func:this._functionMax,_signature:[{types:[u,g]}]},merge:{_func:this._functionMerge,_signature:[{types:[h],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[c]},{types:[d]}]},sum:{_func:this._functionSum,_signature:[{types:[u]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[l]},{types:[l]}]},min:{_func:this._functionMin,_signature:[{types:[u,g]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[c]},{types:[d]}]},type:{_func:this._functionType,_signature:[{types:[a]}]},keys:{_func:this._functionKeys,_signature:[{types:[h]}]},values:{_func:this._functionValues,_signature:[{types:[h]}]},sort:{_func:this._functionSort,_signature:[{types:[g,u]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[c]},{types:[d]}]},join:{_func:this._functionJoin,_signature:[{types:[l]},{types:[g]}]},reverse:{_func:this._functionReverse,_signature:[{types:[l,c]}]},to_array:{_func:this._functionToArray,_signature:[{types:[a]}]},to_string:{_func:this._functionToString,_signature:[{types:[a]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[a]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[a],variadic:!0}]}}}Y[m]=0,Y[f]=0,Y[v]=0,Y[C]=0,Y[y]=0,Y[I]=0,Y[A]=0,Y[w]=0,Y[S]=0,Y[x]=0,Y[k]=1,Y[T]=2,Y[E]=3,Y[R]=5,Y[_]=5,Y[$]=5,Y[L]=5,Y[N]=5,Y[M]=5,Y[B]=9,Y[W]=20,Y[P]=21,Y[H]=40,Y[G]=45,Y[F]=50,Y[O]=55,Y[V]=60,J.prototype={parse:function(e){this._loadTokens(e),this.index=0;var t=this.expression(0);if(this._lookahead(0)!==m){var i=this._lookaheadToken(0),n=new Error("Unexpected token type: "+i.type+", value: "+i.value);throw n.name="ParserError",n}return t},_loadTokens:function(e){var t=(new X).tokenize(e);t.push({type:m,value:"",start:e.length}),this.tokens=t},expression:function(e){var t=this._lookaheadToken(0);this._advance();for(var i=this.nud(t),n=this._lookahead(0);e<Y[n];)this._advance(),i=this.led(n,i),n=this._lookahead(0);return i},_lookahead:function(e){return this.tokens[this.index+e].type},_lookaheadToken:function(e){return this.tokens[this.index+e]},_advance:function(){this.index++},nud:function(e){var t,i;switch(e.type){case Z:return{type:"Literal",value:e.value};case f:return{type:"Field",name:e.value};case v:var n={type:"Field",name:e.value};if(this._lookahead(0)===V)throw new Error("Quoted identifier not allowed for function names.");return n;case G:return{type:"NotExpression",children:[t=this.expression(Y.Not)]};case W:return t=null,{type:"ValueProjection",children:[{type:"Identity"},t=this._lookahead(0)===C?{type:"Identity"}:this._parseProjectionRHS(Y.Star)]};case P:return this.led(e.type,{type:"Identity"});case F:return this._parseMultiselectHash();case B:return{type:"Projection",children:[{type:B,children:[{type:"Identity"}]},t=this._parseProjectionRHS(Y.Flatten)]};case O:return this._lookahead(0)===w||this._lookahead(0)===b?(t=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},t)):this._lookahead(0)===W&&this._lookahead(1)===C?(this._advance(),this._advance(),{type:"Projection",children:[{type:"Identity"},t=this._parseProjectionRHS(Y.Star)]}):this._parseMultiselectList();case S:return{type:S};case x:return{type:"ExpressionReference",children:[i=this.expression(Y.Expref)]};case V:for(var o=[];this._lookahead(0)!==y;)this._lookahead(0)===S?(i={type:S},this._advance()):i=this.expression(0),o.push(i);return this._match(y),o[0];default:this._errorToken(e)}},led:function(e,t){var i;switch(e){case H:var n=Y.Dot;return this._lookahead(0)!==W?{type:"Subexpression",children:[t,i=this._parseDotRHS(n)]}:(this._advance(),{type:"ValueProjection",children:[t,i=this._parseProjectionRHS(n)]});case k:return i=this.expression(Y.Pipe),{type:k,children:[t,i]};case T:return{type:"OrExpression",children:[t,i=this.expression(Y.Or)]};case E:return{type:"AndExpression",children:[t,i=this.expression(Y.And)]};case V:for(var o,r=t.name,s=[];this._lookahead(0)!==y;)this._lookahead(0)===S?(o={type:S},this._advance()):o=this.expression(0),this._lookahead(0)===I&&this._match(I),s.push(o);return this._match(y),{type:"Function",name:r,children:s};case P:var a=this.expression(0);return this._match(C),{type:"FilterProjection",children:[t,i=this._lookahead(0)===B?{type:"Identity"}:this._parseProjectionRHS(Y.Filter),a]};case B:return{type:"Projection",children:[{type:B,children:[t]},this._parseProjectionRHS(Y.Flatten)]};case R:case M:case _:case L:case $:case N:return this._parseComparator(t,e);case O:var l=this._lookaheadToken(0);return l.type===w||l.type===b?(i=this._parseIndexExpression(),this._projectIfSlice(t,i)):(this._match(W),this._match(C),{type:"Projection",children:[t,i=this._parseProjectionRHS(Y.Star)]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(e){if(this._lookahead(0)!==e){var t=this._lookaheadToken(0),i=new Error("Expected "+e+", got: "+t.type);throw i.name="ParserError",i}this._advance()},_errorToken:function(e){var t=new Error("Invalid token ("+e.type+'): "'+e.value+'"');throw t.name="ParserError",t},_parseIndexExpression:function(){if(this._lookahead(0)===b||this._lookahead(1)===b)return this._parseSliceExpression();var e={type:"Index",value:this._lookaheadToken(0).value};return this._advance(),this._match(C),e},_projectIfSlice:function(e,t){var i={type:"IndexExpression",children:[e,t]};return"Slice"===t.type?{type:"Projection",children:[i,this._parseProjectionRHS(Y.Star)]}:i},_parseSliceExpression:function(){for(var e=[null,null,null],t=0,i=this._lookahead(0);i!==C&&t<3;){if(i===b)t++,this._advance();else{if(i!==w){var n=this._lookahead(0),o=new Error("Syntax error, unexpected token: "+n.value+"("+n.type+")");throw o.name="Parsererror",o}e[t]=this._lookaheadToken(0).value,this._advance()}i=this._lookahead(0)}return this._match(C),{type:"Slice",children:e}},_parseComparator:function(e,t){return{type:"Comparator",name:t,children:[e,this.expression(Y[t])]}},_parseDotRHS:function(e){var t=this._lookahead(0);return[f,v,W].indexOf(t)>=0?this.expression(e):t===O?(this._match(O),this._parseMultiselectList()):t===F?(this._match(F),this._parseMultiselectHash()):void 0},_parseProjectionRHS:function(e){var t;if(Y[this._lookahead(0)]<10)t={type:"Identity"};else if(this._lookahead(0)===O)t=this.expression(e);else if(this._lookahead(0)===P)t=this.expression(e);else{if(this._lookahead(0)!==H){var i=this._lookaheadToken(0),n=new Error("Sytanx error, unexpected token: "+i.value+"("+i.type+")");throw n.name="ParserError",n}this._match(H),t=this._parseDotRHS(e)}return t},_parseMultiselectList:function(){for(var e=[];this._lookahead(0)!==C;){var t=this.expression(0);if(e.push(t),this._lookahead(0)===I&&(this._match(I),this._lookahead(0)===C))throw new Error("Unexpected token Rbracket")}return this._match(C),{type:"MultiSelectList",children:e}},_parseMultiselectHash:function(){for(var e,t,i,n=[],o=[f,v];;){if(e=this._lookaheadToken(0),o.indexOf(e.type)<0)throw new Error("Expecting an identifier token, got: "+e.type);if(t=e.value,this._advance(),this._match(b),i={type:"KeyValuePair",name:t,value:this.expression(0)},n.push(i),this._lookahead(0)===I)this._match(I);else if(this._lookahead(0)===A){this._match(A);break}}return{type:"MultiSelectHash",children:n}}},U.prototype={search:function(e,t){return this.visit(e,t)},visit:function(e,r){var s,a,l,c,h,d,u,g,p;switch(e.type){case"Field":return null!==r&&i(r)?void 0===(d=r[e.name])?null:d:null;case"Subexpression":for(l=this.visit(e.children[0],r),p=1;p<e.children.length;p++)if(null===(l=this.visit(e.children[1],l)))return null;return l;case"IndexExpression":return u=this.visit(e.children[0],r),this.visit(e.children[1],u);case"Index":if(!t(r))return null;var m=e.value;return m<0&&(m=r.length+m),void 0===(l=r[m])&&(l=null),l;case"Slice":if(!t(r))return null;var f=e.children.slice(0),v=this.computeSliceParams(r.length,f),C=v[0],y=v[1],I=v[2];if(l=[],I>0)for(p=C;p<y;p+=I)l.push(r[p]);else for(p=C;p>y;p+=I)l.push(r[p]);return l;case"Projection":var b=this.visit(e.children[0],r);if(!t(b))return null;for(g=[],p=0;p<b.length;p++)null!==(a=this.visit(e.children[1],b[p]))&&g.push(a);return g;case"ValueProjection":if(!i(b=this.visit(e.children[0],r)))return null;g=[];var A=function(e){for(var t=Object.keys(e),i=[],n=0;n<t.length;n++)i.push(e[t[n]]);return i}(b);for(p=0;p<A.length;p++)null!==(a=this.visit(e.children[1],A[p]))&&g.push(a);return g;case"FilterProjection":if(!t(b=this.visit(e.children[0],r)))return null;var w=[],T=[];for(p=0;p<b.length;p++)o(s=this.visit(e.children[2],b[p]))||w.push(b[p]);for(var E=0;E<w.length;E++)null!==(a=this.visit(e.children[1],w[E]))&&T.push(a);return T;case"Comparator":switch(c=this.visit(e.children[0],r),h=this.visit(e.children[1],r),e.name){case R:l=n(c,h);break;case M:l=!n(c,h);break;case _:l=c>h;break;case L:l=c>=h;break;case $:l=c<h;break;case N:l=c<=h;break;default:throw new Error("Unknown comparator: "+e.name)}return l;case B:var W=this.visit(e.children[0],r);if(!t(W))return null;var P=[];for(p=0;p<W.length;p++)t(a=W[p])?P.push.apply(P,a):P.push(a);return P;case"Identity":return r;case"MultiSelectList":if(null===r)return null;for(g=[],p=0;p<e.children.length;p++)g.push(this.visit(e.children[p],r));return g;case"MultiSelectHash":if(null===r)return null;var H;for(g={},p=0;p<e.children.length;p++)g[(H=e.children[p]).name]=this.visit(H.value,r);return g;case"OrExpression":return o(s=this.visit(e.children[0],r))&&(s=this.visit(e.children[1],r)),s;case"AndExpression":return!0===o(c=this.visit(e.children[0],r))?c:this.visit(e.children[1],r);case"NotExpression":return o(c=this.visit(e.children[0],r));case"Literal":return e.value;case k:return u=this.visit(e.children[0],r),this.visit(e.children[1],u);case S:return r;case"Function":var G=[];for(p=0;p<e.children.length;p++)G.push(this.visit(e.children[p],r));return this.runtime.callFunction(e.name,G);case"ExpressionReference":var F=e.children[0];return F.jmespathType=x,F;default:throw new Error("Unknown node type: "+e.type)}},computeSliceParams:function(e,t){var i=t[0],n=t[1],o=t[2],r=[null,null,null];if(null===o)o=1;else if(0===o){var s=new Error("Invalid slice, step cannot be 0");throw s.name="RuntimeError",s}var a=o<0;return i=null===i?a?e-1:0:this.capSliceRange(e,i,o),n=null===n?a?-1:e:this.capSliceRange(e,n,o),r[0]=i,r[1]=n,r[2]=o,r},capSliceRange:function(e,t,i){return t<0?(t+=e)<0&&(t=i<0?-1:0):t>=e&&(t=i<0?e-1:e),t}},Q.prototype={callFunction:function(e,t){var i=this.functionTable[e];if(void 0===i)throw new Error("Unknown function: "+e+"()");return this._validateArgs(e,t,i._signature),i._func.call(this,t)},_validateArgs:function(e,t,i){var n,o,r,s;if(i[i.length-1].variadic){if(t.length<i.length)throw n=1===i.length?" argument":" arguments",new Error("ArgumentError: "+e+"() takes at least"+i.length+n+" but received "+t.length)}else if(t.length!==i.length)throw n=1===i.length?" argument":" arguments",new Error("ArgumentError: "+e+"() takes "+i.length+n+" but received "+t.length);for(var a=0;a<i.length;a++){s=!1,o=i[a].types,r=this._getTypeName(t[a]);for(var l=0;l<o.length;l++)if(this._typeMatches(r,o[l],t[a])){s=!0;break}if(!s){var c=o.map((function(e){return p[e]})).join(",");throw new Error("TypeError: "+e+"() expected argument "+(a+1)+" to be type "+c+" but received type "+p[r]+" instead.")}}},_typeMatches:function(e,t,i){if(t===a)return!0;if(t!==g&&t!==u&&t!==c)return e===t;if(t===c)return e===c;if(e===c){var n;t===u?n=s:t===g&&(n=l);for(var o=0;o<i.length;o++)if(!this._typeMatches(this._getTypeName(i[o]),n,i[o]))return!1;return!0}},_getTypeName:function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return l;case"[object Number]":return s;case"[object Array]":return c;case"[object Boolean]":return 5;case"[object Null]":return 7;case"[object Object]":return e.jmespathType===x?d:h}},_functionStartsWith:function(e){return 0===e[0].lastIndexOf(e[1])},_functionEndsWith:function(e){var t=e[0],i=e[1];return-1!==t.indexOf(i,t.length-i.length)},_functionReverse:function(e){if(this._getTypeName(e[0])===l){for(var t=e[0],i="",n=t.length-1;n>=0;n--)i+=t[n];return i}var o=e[0].slice(0);return o.reverse(),o},_functionAbs:function(e){return Math.abs(e[0])},_functionCeil:function(e){return Math.ceil(e[0])},_functionAvg:function(e){for(var t=0,i=e[0],n=0;n<i.length;n++)t+=i[n];return t/i.length},_functionContains:function(e){return e[0].indexOf(e[1])>=0},_functionFloor:function(e){return Math.floor(e[0])},_functionLength:function(e){return i(e[0])?Object.keys(e[0]).length:e[0].length},_functionMap:function(e){for(var t=[],i=this._interpreter,n=e[0],o=e[1],r=0;r<o.length;r++)t.push(i.visit(n,o[r]));return t},_functionMerge:function(e){for(var t={},i=0;i<e.length;i++){var n=e[i];for(var o in n)t[o]=n[o]}return t},_functionMax:function(e){if(e[0].length>0){if(this._getTypeName(e[0][0])===s)return Math.max.apply(Math,e[0]);for(var t=e[0],i=t[0],n=1;n<t.length;n++)i.localeCompare(t[n])<0&&(i=t[n]);return i}return null},_functionMin:function(e){if(e[0].length>0){if(this._getTypeName(e[0][0])===s)return Math.min.apply(Math,e[0]);for(var t=e[0],i=t[0],n=1;n<t.length;n++)t[n].localeCompare(i)<0&&(i=t[n]);return i}return null},_functionSum:function(e){for(var t=0,i=e[0],n=0;n<i.length;n++)t+=i[n];return t},_functionType:function(e){switch(this._getTypeName(e[0])){case s:return"number";case l:return"string";case c:return"array";case h:return"object";case 5:return"boolean";case d:return"expref";case 7:return"null"}},_functionKeys:function(e){return Object.keys(e[0])},_functionValues:function(e){for(var t=e[0],i=Object.keys(t),n=[],o=0;o<i.length;o++)n.push(t[i[o]]);return n},_functionJoin:function(e){var t=e[0];return e[1].join(t)},_functionToArray:function(e){return this._getTypeName(e[0])===c?e[0]:[e[0]]},_functionToString:function(e){return this._getTypeName(e[0])===l?e[0]:JSON.stringify(e[0])},_functionToNumber:function(e){var t,i=this._getTypeName(e[0]);return i===s?e[0]:i!==l||(t=+e[0],isNaN(t))?null:t},_functionNotNull:function(e){for(var t=0;t<e.length;t++)if(7!==this._getTypeName(e[t]))return e[t];return null},_functionSort:function(e){var t=e[0].slice(0);return t.sort(),t},_functionSortBy:function(e){var t=e[0].slice(0);if(0===t.length)return t;var i=this._interpreter,n=e[1],o=this._getTypeName(i.visit(n,t[0]));if([s,l].indexOf(o)<0)throw new Error("TypeError");for(var r=this,a=[],c=0;c<t.length;c++)a.push([c,t[c]]);a.sort((function(e,t){var s=i.visit(n,e[1]),a=i.visit(n,t[1]);if(r._getTypeName(s)!==o)throw new Error("TypeError: expected "+o+", received "+r._getTypeName(s));if(r._getTypeName(a)!==o)throw new Error("TypeError: expected "+o+", received "+r._getTypeName(a));return s>a?1:s<a?-1:e[0]-t[0]}));for(var h=0;h<a.length;h++)t[h]=a[h][1];return t},_functionMaxBy:function(e){for(var t,i,n=e[1],o=e[0],r=this.createKeyFunction(n,[s,l]),a=-1/0,c=0;c<o.length;c++)(i=r(o[c]))>a&&(a=i,t=o[c]);return t},_functionMinBy:function(e){for(var t,i,n=e[1],o=e[0],r=this.createKeyFunction(n,[s,l]),a=1/0,c=0;c<o.length;c++)(i=r(o[c]))<a&&(a=i,t=o[c]);return t},createKeyFunction:function(e,t){var i=this,n=this._interpreter;return function(o){var r=n.visit(e,o);if(t.indexOf(i._getTypeName(r))<0){var s="TypeError: expected one of "+t+", received "+i._getTypeName(r);throw new Error(s)}return r}}},e.tokenize=function(e){return(new X).tokenize(e)},e.compile=function(e){return(new J).parse(e)},e.search=function(e,t){var i=new J,n=new Q,o=new U(n);n._interpreter=o;var r=i.parse(t);return o.search(r,e)},e.strictDeepEqual=n}(t)},4316:function(e){"use strict";var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),i(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function i(e,n,o,r,s,a,l,c,h,d){if(r&&"object"==typeof r&&!Array.isArray(r)){for(var u in n(r,s,a,l,c,h,d),r){var g=r[u];if(Array.isArray(g)){if(u in t.arrayKeywords)for(var p=0;p<g.length;p++)i(e,n,o,g[p],s+"/"+u+"/"+p,a,s,u,r,p)}else if(u in t.propsKeywords){if(g&&"object"==typeof g)for(var m in g)i(e,n,o,g[m],s+"/"+u+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),a,s,u,r,m)}else(u in t.keywords||e.allKeys&&!(u in t.skipKeywords))&&i(e,n,o,g,s+"/"+u,a,s,u,r)}o(r,s,a,l,c,h,d)}}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},3094:function(e,t){"use strict";var i={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",'"':'"',"/":"/","\\":"\\"},n="a".charCodeAt();t.parse=function(e,t,o){var r={},s=0,a=0,l=0,c=o&&o.bigint&&"undefined"!=typeof BigInt;return{data:h("",!0),pointers:r};function h(t,i){var n;d(),y(t,"value");var o=p();switch(o){case"t":g("rue"),n=!0;break;case"f":g("alse"),n=!1;break;case"n":g("ull"),n=null;break;case'"':n=u();break;case"[":n=function(e){d();var t=[],i=0;if("]"==p())return t;for(f();;){var n=e+"/"+i;t.push(h(n)),d();var o=p();if("]"==o)break;","!=o&&w(),d(),i++}return t}(t);break;case"{":n=function(e){d();var t={};if("}"==p())return t;for(f();;){var i=b();'"'!=p()&&w();var n=u(),o=e+"/"+m(n);I(o,"key",i),y(o,"keyEnd"),d(),":"!=p()&&w(),d(),t[n]=h(o),d();var r=p();if("}"==r)break;","!=r&&w(),d()}return t}(t);break;default:f(),"-0123456789".indexOf(o)>=0?n=function(){var t="",i=!0;"-"==e[l]&&(t+=p()),t+="0"==e[l]?p():C(),"."==e[l]&&(t+=p()+C(),i=!1),"e"!=e[l]&&"E"!=e[l]||(t+=p(),"+"!=e[l]&&"-"!=e[l]||(t+=p()),t+=C(),i=!1);var n=+t;return c&&i&&(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)?BigInt(t):n}():A()}return y(t,"valueEnd"),d(),i&&l<e.length&&A(),n}function d(){e:for(;l<e.length;){switch(e[l]){case" ":a++;break;case"\t":a+=4;break;case"\r":a=0;break;case"\n":a=0,s++;break;default:break e}l++}}function u(){for(var e,t="";'"'!=(e=p());)"\\"==e?(e=p())in i?t+=i[e]:"u"==e?t+=v():w():t+=e;return t}function g(e){for(var t=0;t<e.length;t++)p()!==e[t]&&w()}function p(){S();var t=e[l];return l++,a++,t}function f(){l--,a--}function v(){for(var e=4,t=0;e--;){t<<=4;var i=p().toLowerCase();i>="a"&&i<="f"?t+=i.charCodeAt()-n+10:i>="0"&&i<="9"?t+=+i:w()}return String.fromCharCode(t)}function C(){for(var t="";e[l]>="0"&&e[l]<="9";)t+=p();if(t.length)return t;S(),A()}function y(e,t){I(e,t,b())}function I(e,t,i){r[e]=r[e]||{},r[e][t]=i}function b(){return{line:s,column:a,pos:l}}function A(){throw new SyntaxError("Unexpected token "+e[l]+" in JSON at position "+l)}function w(){f(),A()}function S(){if(l>=e.length)throw new SyntaxError("Unexpected end of JSON input")}},t.stringify=function(e,t,i){if(r(e)){var n,o,s=0,a="object"==typeof i?i.space:i;switch(typeof a){case"number":var l=a>10?10:a<0?0:Math.floor(a);a=l&&b(l," "),n=l,o=l;break;case"string":a=a.slice(0,10),n=0,o=0;for(var c=0;c<a.length;c++){switch(a[c]){case" ":o++;break;case"\t":o+=4;break;case"\r":o=0;break;case"\n":o=0,s++;break;default:throw new Error("whitespace characters not allowed in JSON")}n++}break;default:a=void 0}var h="",d={},g=0,p=0,f=0,v=i&&i.es6&&"function"==typeof Map;return function e(t,i,n){switch(I(n,"value"),typeof t){case"number":case"bigint":case"boolean":C(""+t);break;case"string":C(u(t));break;case"object":null===t?C("null"):"function"==typeof t.toJSON?C(u(t.toJSON())):Array.isArray(t)?o():v?t.constructor.BYTES_PER_ELEMENT?o():t instanceof Map?l():t instanceof Set?l(!0):s():s()}function o(){if(t.length){C("[");for(var o=i+1,s=0;s<t.length;s++){s&&C(","),y(o);var a=r(t[s])?t[s]:null;e(a,o,n+"/"+s)}y(i),C("]")}else C("[]")}function s(){var o=Object.keys(t);if(o.length){C("{");for(var s=i+1,l=0;l<o.length;l++){var c=o[l],h=t[c];if(r(h)){l&&C(",");var d=n+"/"+m(c);y(s),I(d,"key"),C(u(c)),I(d,"keyEnd"),C(":"),a&&C(" "),e(h,s,d)}}y(i),C("}")}else C("{}")}function l(o){if(t.size){C("{");for(var s=i+1,l=!0,c=t.entries(),h=c.next();!h.done;){var d=h.value,g=d[0],p=!!o||d[1];if(r(p)){l||C(","),l=!1;var f=n+"/"+m(g);y(s),I(f,"key"),C(u(g)),I(f,"keyEnd"),C(":"),a&&C(" "),e(p,s,f)}h=c.next()}y(i),C("}")}else C("{}")}I(n,"valueEnd")}(e,0,""),{json:h,pointers:d}}function C(e){p+=e.length,f+=e.length,h+=e}function y(e){if(a){for(h+="\n"+b(e,a),g++,p=0;e--;)s?(g+=s,p=o):p+=o,f+=n;f+=1}}function I(e,t){d[e]=d[e]||{},d[e][t]={line:g,column:p,pos:f}}function b(e,t){return Array(e+1).join(t)}};var o=["number","bigint","boolean","string","object"];function r(e){return o.indexOf(typeof e)>=0}var s=/"|\\/g,a=/[\b]/g,l=/\f/g,c=/\n/g,h=/\r/g,d=/\t/g;function u(e){return'"'+(e=e.replace(s,"\\$&").replace(l,"\\f").replace(a,"\\b").replace(c,"\\n").replace(h,"\\r").replace(d,"\\t"))+'"'}var g=/~/g,p=/\//g;function m(e){return e.replace(g,"~0").replace(p,"~1")}},8340:function(e,t){var i,n,o;!function(r,s){"use strict";n=[],i=function(){function e(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType}function t(e){return"string"==typeof e}function i(){var e=[];return{watch:e.push.bind(e),trigger:function(t,i){for(var n=!0,o={detail:i,preventDefault:function(){n=!1}},r=0;r<e.length;r++)e[r](t,o);return n}}}function n(e){return"none"===window.getComputedStyle(e).display}function o(e){this.elem=e}function r(e,t){return o.make(e("parent")).clazz("pico-overlay").clazz(e("overlayClass","")).stylize({display:"none",position:"fixed",top:"0px",left:"0px",height:"100%",width:"100%",zIndex:1e4}).stylize(e("overlayStyles",{opacity:.5,background:"#000"})).onClick((function(){e("overlayClose",!0)&&t()}))}o.make=function(e,t){"string"==typeof e&&(e=document.querySelector(e));var i=document.createElement(t||"div");return(e||document.body).appendChild(i),new o(i)},o.prototype={child:function(e){return o.make(this.elem,e)},stylize:function(e){for(var t in void 0!==(e=e||{}).opacity&&(e.filter="alpha(opacity="+100*e.opacity+")"),e)e.hasOwnProperty(t)&&(this.elem.style[t]=e[t]);return this},clazz:function(e){return this.elem.className+=" "+e,this},html:function(t){return e(t)?this.elem.appendChild(t):this.elem.innerHTML=t,this},onClick:function(e){return this.elem.addEventListener("click",e),this},destroy:function(){this.elem.parentNode.removeChild(this.elem)},hide:function(){this.elem.style.display="none"},show:function(){this.elem.style.display="block"},attr:function(e,t){return void 0!==t&&this.elem.setAttribute(e,t),this},anyAncestor:function(e){for(var t=this.elem;t;){if(e(new o(t)))return!0;t=t.parentNode}return!1},isVisible:function(){return!n(this.elem)}};var s=1;function a(e,t){var i=e("width","auto");"number"==typeof i&&(i+="px");var n=e("modalId","pico-"+s++);return o.make(e("parent")).clazz("pico-content").clazz(e("modalClass","")).stylize({display:"none",position:"fixed",zIndex:10001,left:"50%",top:"38.1966%",maxHeight:"90%",boxSizing:"border-box",width:i,"-ms-transform":"translate(-50%,-38.1966%)","-moz-transform":"translate(-50%,-38.1966%)","-webkit-transform":"translate(-50%,-38.1966%)","-o-transform":"translate(-50%,-38.1966%)",transform:"translate(-50%,-38.1966%)"}).stylize(e("modalStyles",{overflow:"auto",backgroundColor:"white",padding:"20px",borderRadius:"5px"})).html(e("content")).attr("id",n).attr("role","dialog").attr("aria-labelledby",e("ariaLabelledBy")).attr("aria-describedby",e("ariaDescribedBy",n)).onClick((function(e){var i=new o(e.target).anyAncestor((function(e){return/\bpico-close\b/.test(e.elem.className)}));i&&t()}))}function l(e,t){if(t("closeButton",!0))return e.child("button").html(t("closeHtml","×")).clazz("pico-close").clazz(t("closeClass","")).stylize(t("closeStyles",{borderRadius:"2px",border:0,padding:0,cursor:"pointer",height:"15px",width:"15px",position:"absolute",top:"5px",right:"5px",fontSize:"16px",textAlign:"center",lineHeight:"15px",background:"#CCC"})).attr("aria-label",t("close-label","Close"))}function c(e){return function(){return e().elem}}var h=i(),d=i();function u(e,t){function i(e,t){return(e.msMatchesSelector||e.webkitMatchesSelector||e.matches).call(e,t)}function o(e){return!(n(e)||i(e,":disabled")||e.hasAttribute("contenteditable"))&&(e.hasAttribute("tabindex")||i(e,"input,select,textarea,button,a[href],area[href],iframe"))}function r(e){for(var t=e.getElementsByTagName("*"),i=0;i<t.length;i++)if(o(t[i]))return t[i]}function s(e){for(var t=e.getElementsByTagName("*"),i=t.length;i--;)if(o(t[i]))return t[i]}var a;e.beforeShow((function(){a=document.activeElement})),e.afterShow((function(){if(t()){var i=r(e.modalElem());i&&i.focus()}})),e.afterClose((function(){t()&&a&&a.focus(),a=null})),d.watch((function(i){if(t()&&e.isVisible()){var n=r(e.modalElem()),o=s(e.modalElem());(i.shiftKey?n:o)===document.activeElement&&((i.shiftKey?o:n).focus(),i.preventDefault())}}))}function g(e,t){var i,n=new o(document.body);e.beforeShow((function(){i=n.elem.style.overflow,t()&&n.stylize({overflow:"hidden"})})),e.afterClose((function(){n.stylize({overflow:i})}))}return document.documentElement.addEventListener("keydown",(function(e){var t=e.which||e.keyCode;27===t?h.trigger():9===t&&d.trigger(e)})),function(n){(t(n)||e(n))&&(n={content:n});var o=i(),s=i(),d=i(),p=i(),m=i();function f(e,t){var i=n[e];return"function"==typeof i&&(i=i(t)),void 0===i?t:i}var v,C,y=x.bind(window,"modal"),I=x.bind(window,"overlay"),b=x.bind(window,"close");function A(e){I().hide(),y().hide(),m.trigger(v,e)}function w(e){p.trigger(v,e)&&A(e)}function S(e){return function(){return e.apply(this,arguments),v}}function x(e,t){if(!C){var i=a(f,w);C={modal:i,overlay:r(f,w),close:l(i,f)},o.trigger(v,t)}return C[e]}return u(v={modalElem:c(y),closeElem:c(b),overlayElem:c(I),buildDom:S(x.bind(null,null)),isVisible:function(){return!!(C&&y&&y().isVisible())},show:function(e){return s.trigger(v,e)&&(I().show(),b(),y().show(),d.trigger(v,e)),this},close:S(w),forceClose:S(A),destroy:function(){y().destroy(),I().destroy(),I=y=b=void 0},options:function(e){Object.keys(e).map((function(t){n[t]=e[t]}))},afterCreate:S(o.watch),beforeShow:S(s.watch),afterShow:S(d.watch),beforeClose:S(p.watch),afterClose:S(m.watch)},f.bind(null,"focus",!0)),g(v,f.bind(null,"bodyOverflow",!0)),h.watch((function(){f("escCloses",!0)&&v.isVisible()&&v.close()})),v}},void 0===(o="function"==typeof i?i.apply(t,n):i)||(e.exports=o)}()},6777:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];if(t.length>1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,o=1;o<n;++o)t[o]=t[o].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}return t[0]}function i(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function r(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function s(e,t){var i=e;if(t)for(var n in t)i[n]=t[n];return i}function a(e){var n="[A-Za-z]",o="[0-9]",r=t(o,"[A-Fa-f]"),s=i(i("%[EFef]"+r+"%"+r+r+"%"+r+r)+"|"+i("%[89A-Fa-f]"+r+"%"+r+r)+"|"+i("%"+r+r)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",l=t("[\\:\\/\\?\\#\\[\\]\\@]",a),c=e?"[\\uE000-\\uF8FF]":"[]",h=t(n,o,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),d=i(n+t(n,o,"[\\+\\-\\.]")+"*"),u=i(i(s+"|"+t(h,a,"[\\:]"))+"*"),g=(i(i("25[0-5]")+"|"+i("2[0-4]"+o)+"|"+i("1"+o+o)+"|"+i("[1-9]"+o)+"|"+o),i(i("25[0-5]")+"|"+i("2[0-4]"+o)+"|"+i("1"+o+o)+"|"+i("0?[1-9]"+o)+"|0?0?"+o)),p=i(g+"\\."+g+"\\."+g+"\\."+g),m=i(r+"{1,4}"),f=i(i(m+"\\:"+m)+"|"+p),v=i(i(m+"\\:")+"{6}"+f),C=i("\\:\\:"+i(m+"\\:")+"{5}"+f),y=i(i(m)+"?\\:\\:"+i(m+"\\:")+"{4}"+f),I=i(i(i(m+"\\:")+"{0,1}"+m)+"?\\:\\:"+i(m+"\\:")+"{3}"+f),b=i(i(i(m+"\\:")+"{0,2}"+m)+"?\\:\\:"+i(m+"\\:")+"{2}"+f),A=i(i(i(m+"\\:")+"{0,3}"+m)+"?\\:\\:"+m+"\\:"+f),w=i(i(i(m+"\\:")+"{0,4}"+m)+"?\\:\\:"+f),S=i(i(i(m+"\\:")+"{0,5}"+m)+"?\\:\\:"+m),x=i(i(i(m+"\\:")+"{0,6}"+m)+"?\\:\\:"),k=i([v,C,y,I,b,A,w,S,x].join("|")),T=i(i(h+"|"+s)+"+"),E=(i(k+"\\%25"+T),i(k+i("\\%25|\\%(?!"+r+"{2})")+T)),R=i("[vV]"+r+"+\\."+t(h,a,"[\\:]")+"+"),_=i("\\["+i(E+"|"+k+"|"+R)+"\\]"),$=i(i(s+"|"+t(h,a))+"*"),L=i(_+"|"+p+"(?!"+$+")|"+$),N=i(o+"*"),M=i(i(u+"@")+"?"+L+i("\\:"+N)+"?"),B=i(s+"|"+t(h,a,"[\\:\\@]")),W=i(B+"*"),P=i(B+"+"),H=i(i(s+"|"+t(h,a,"[\\@]"))+"+"),G=i(i("\\/"+W)+"*"),F=i("\\/"+i(P+G)+"?"),O=i(H+G),V=i(P+G),Z="(?!"+B+")",D=(i(G+"|"+F+"|"+O+"|"+V+"|"+Z),i(i(B+"|"+t("[\\/\\?]",c))+"*")),j=i(i(B+"|[\\/\\?]")+"*"),K=i(i("\\/\\/"+M+G)+"|"+F+"|"+V+"|"+Z),z=i(d+"\\:"+K+i("\\?"+D)+"?"+i("\\#"+j)+"?"),X=i(i("\\/\\/"+M+G)+"|"+F+"|"+O+"|"+Z),Y=i(X+i("\\?"+D)+"?"+i("\\#"+j)+"?");return i(z+"|"+Y),i(d+"\\:"+K+i("\\?"+D)+"?"),i(i("\\/\\/("+i("("+u+")@")+"?("+L+")"+i("\\:("+N+")")+"?)")+"?("+G+"|"+F+"|"+V+"|"+Z+")"),i("\\?("+D+")"),i("\\#("+j+")"),i(i("\\/\\/("+i("("+u+")@")+"?("+L+")"+i("\\:("+N+")")+"?)")+"?("+G+"|"+F+"|"+O+"|"+Z+")"),i("\\?("+D+")"),i("\\#("+j+")"),i(i("\\/\\/("+i("("+u+")@")+"?("+L+")"+i("\\:("+N+")")+"?)")+"?("+G+"|"+F+"|"+V+"|"+Z+")"),i("\\?("+D+")"),i("\\#("+j+")"),i("("+u+")@"),i("\\:("+N+")"),{NOT_SCHEME:new RegExp(t("[^]",n,o,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(t("[^\\%\\:]",h,a),"g"),NOT_HOST:new RegExp(t("[^\\%\\[\\]\\:]",h,a),"g"),NOT_PATH:new RegExp(t("[^\\%\\/\\:\\@]",h,a),"g"),NOT_PATH_NOSCHEME:new RegExp(t("[^\\%\\/\\@]",h,a),"g"),NOT_QUERY:new RegExp(t("[^\\%]",h,a,"[\\:\\@\\/\\?]",c),"g"),NOT_FRAGMENT:new RegExp(t("[^\\%]",h,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(t("[^]",h,a),"g"),UNRESERVED:new RegExp(h,"g"),OTHER_CHARS:new RegExp(t("[^\\%]",h,l),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+p+")$"),IPV6ADDRESS:new RegExp("^\\[?("+k+")"+i(i("\\%25|\\%(?!"+r+"{2})")+"("+T+")")+"?\\]?$")}}var l=a(!1),c=a(!0),h=function(){function e(e,t){var i=[],n=!0,o=!1,r=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(i.push(s.value),!t||i.length!==t);n=!0);}catch(e){o=!0,r=e}finally{try{!n&&a.return&&a.return()}finally{if(o)throw r}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)},u=2147483647,g=36,p=1,m=26,f=38,v=700,C=72,y=128,I="-",b=/^xn--/,A=/[^\0-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=g-p,k=Math.floor,T=String.fromCharCode;function E(e){throw new RangeError(S[e])}function R(e,t){for(var i=[],n=e.length;n--;)i[n]=t(e[n]);return i}function _(e,t){var i=e.split("@"),n="";return i.length>1&&(n=i[0]+"@",e=i[1]),n+R((e=e.replace(w,".")).split("."),t).join(".")}function $(e){for(var t=[],i=0,n=e.length;i<n;){var o=e.charCodeAt(i++);if(o>=55296&&o<=56319&&i<n){var r=e.charCodeAt(i++);56320==(64512&r)?t.push(((1023&o)<<10)+(1023&r)+65536):(t.push(o),i--)}else t.push(o)}return t}var L=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:g},N=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},M=function(e,t,i){var n=0;for(e=i?k(e/v):e>>1,e+=k(e/t);e>x*m>>1;n+=g)e=k(e/x);return k(n+(x+1)*e/(e+f))},B=function(e){var t=[],i=e.length,n=0,o=y,r=C,s=e.lastIndexOf(I);s<0&&(s=0);for(var a=0;a<s;++a)e.charCodeAt(a)>=128&&E("not-basic"),t.push(e.charCodeAt(a));for(var l=s>0?s+1:0;l<i;){for(var c=n,h=1,d=g;;d+=g){l>=i&&E("invalid-input");var f=L(e.charCodeAt(l++));(f>=g||f>k((u-n)/h))&&E("overflow"),n+=f*h;var v=d<=r?p:d>=r+m?m:d-r;if(f<v)break;var b=g-v;h>k(u/b)&&E("overflow"),h*=b}var A=t.length+1;r=M(n-c,A,0==c),k(n/A)>u-o&&E("overflow"),o+=k(n/A),n%=A,t.splice(n++,0,o)}return String.fromCodePoint.apply(String,t)},W=function(e){var t=[],i=(e=$(e)).length,n=y,o=0,r=C,s=!0,a=!1,l=void 0;try{for(var c,h=e[Symbol.iterator]();!(s=(c=h.next()).done);s=!0){var d=c.value;d<128&&t.push(T(d))}}catch(e){a=!0,l=e}finally{try{!s&&h.return&&h.return()}finally{if(a)throw l}}var f=t.length,v=f;for(f&&t.push(I);v<i;){var b=u,A=!0,w=!1,S=void 0;try{for(var x,R=e[Symbol.iterator]();!(A=(x=R.next()).done);A=!0){var _=x.value;_>=n&&_<b&&(b=_)}}catch(e){w=!0,S=e}finally{try{!A&&R.return&&R.return()}finally{if(w)throw S}}var L=v+1;b-n>k((u-o)/L)&&E("overflow"),o+=(b-n)*L,n=b;var B=!0,W=!1,P=void 0;try{for(var H,G=e[Symbol.iterator]();!(B=(H=G.next()).done);B=!0){var F=H.value;if(F<n&&++o>u&&E("overflow"),F==n){for(var O=o,V=g;;V+=g){var Z=V<=r?p:V>=r+m?m:V-r;if(O<Z)break;var D=O-Z,j=g-Z;t.push(T(N(Z+D%j,0))),O=k(D/j)}t.push(T(N(O,0))),r=M(o,L,v==f),o=0,++v}}}catch(e){W=!0,P=e}finally{try{!B&&G.return&&G.return()}finally{if(W)throw P}}++o,++n}return t.join("")},P=function(e){return _(e,(function(e){return b.test(e)?B(e.slice(4).toLowerCase()):e}))},H=function(e){return _(e,(function(e){return A.test(e)?"xn--"+W(e):e}))},G={version:"2.1.0",ucs2:{decode:$,encode:function(e){return String.fromCodePoint.apply(String,d(e))}},decode:B,encode:W,toASCII:H,toUnicode:P},F={};function O(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function V(e){for(var t="",i=0,n=e.length;i<n;){var o=parseInt(e.substr(i+1,2),16);if(o<128)t+=String.fromCharCode(o),i+=3;else if(o>=194&&o<224){if(n-i>=6){var r=parseInt(e.substr(i+4,2),16);t+=String.fromCharCode((31&o)<<6|63&r)}else t+=e.substr(i,6);i+=6}else if(o>=224){if(n-i>=9){var s=parseInt(e.substr(i+4,2),16),a=parseInt(e.substr(i+7,2),16);t+=String.fromCharCode((15&o)<<12|(63&s)<<6|63&a)}else t+=e.substr(i,9);i+=9}else t+=e.substr(i,3),i+=3}return t}function Z(e,t){function i(e){var i=V(e);return i.match(t.UNRESERVED)?i:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,i).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,i).replace(t.NOT_USERINFO,O).replace(t.PCT_ENCODED,o)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,i).toLowerCase().replace(t.NOT_HOST,O).replace(t.PCT_ENCODED,o)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,i).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,O).replace(t.PCT_ENCODED,o)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,i).replace(t.NOT_QUERY,O).replace(t.PCT_ENCODED,o)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,i).replace(t.NOT_FRAGMENT,O).replace(t.PCT_ENCODED,o)),e}function D(e){return e.replace(/^0*(.*)/,"$1")||"0"}function j(e,t){var i=e.match(t.IPV4ADDRESS)||[],n=h(i,2)[1];return n?n.split(".").map(D).join("."):e}function K(e,t){var i=e.match(t.IPV6ADDRESS)||[],n=h(i,3),o=n[1],r=n[2];if(o){for(var s=o.toLowerCase().split("::").reverse(),a=h(s,2),l=a[0],c=a[1],d=c?c.split(":").map(D):[],u=l.split(":").map(D),g=t.IPV4ADDRESS.test(u[u.length-1]),p=g?7:8,m=u.length-p,f=Array(p),v=0;v<p;++v)f[v]=d[v]||u[m+v]||"";g&&(f[p-1]=j(f[p-1],t));var C=f.reduce((function(e,t,i){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===i?n.length++:e.push({index:i,length:1})}return e}),[]).sort((function(e,t){return t.length-e.length}))[0],y=void 0;if(C&&C.length>1){var I=f.slice(0,C.index),b=f.slice(C.index+C.length);y=I.join(":")+"::"+b.join(":")}else y=f.join(":");return r&&(y+="%"+r),y}return e}var z=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,X=void 0==="".match(/(){0}/)[1];function Y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={},n=!1!==t.iri?c:l;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var o=e.match(z);if(o){X?(i.scheme=o[1],i.userinfo=o[3],i.host=o[4],i.port=parseInt(o[5],10),i.path=o[6]||"",i.query=o[7],i.fragment=o[8],isNaN(i.port)&&(i.port=o[5])):(i.scheme=o[1]||void 0,i.userinfo=-1!==e.indexOf("@")?o[3]:void 0,i.host=-1!==e.indexOf("//")?o[4]:void 0,i.port=parseInt(o[5],10),i.path=o[6]||"",i.query=-1!==e.indexOf("?")?o[7]:void 0,i.fragment=-1!==e.indexOf("#")?o[8]:void 0,isNaN(i.port)&&(i.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:void 0)),i.host&&(i.host=K(j(i.host,n),n)),void 0!==i.scheme||void 0!==i.userinfo||void 0!==i.host||void 0!==i.port||i.path||void 0!==i.query?void 0===i.scheme?i.reference="relative":void 0===i.fragment?i.reference="absolute":i.reference="uri":i.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==i.reference&&(i.error=i.error||"URI is not a "+t.reference+" reference.");var r=F[(t.scheme||i.scheme||"").toLowerCase()];if(t.unicodeSupport||r&&r.unicodeSupport)Z(i,n);else{if(i.host&&(t.domainHost||r&&r.domainHost))try{i.host=G.toASCII(i.host.replace(n.PCT_ENCODED,V).toLowerCase())}catch(e){i.error=i.error||"Host's domain name can not be converted to ASCII via punycode: "+e}Z(i,l)}r&&r.parse&&r.parse(i,t)}else i.error=i.error||"URI can not be parsed.";return i}function J(e,t){var i=!1!==t.iri?c:l,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(K(j(String(e.host),i),i).replace(i.IPV6ADDRESS,(function(e,t,i){return"["+t+(i?"%25"+i:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var U=/^\.\.?\//,Q=/^\/\.(\/|$)/,q=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(U))e=e.replace(U,"");else if(e.match(Q))e=e.replace(Q,"/");else if(e.match(q))e=e.replace(q,"/"),t.pop();else if("."===e||".."===e)e="";else{var i=e.match(ee);if(!i)throw new Error("Unexpected dot segment condition");var n=i[0];e=e.slice(n.length),t.push(n)}return t.join("")}function ie(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.iri?c:l,n=[],o=F[(t.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,t),e.host)if(i.IPV6ADDRESS.test(e.host));else if(t.domainHost||o&&o.domainHost)try{e.host=t.iri?G.toUnicode(e.host):G.toASCII(e.host.replace(i.PCT_ENCODED,V).toLowerCase())}catch(i){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+i}Z(e,i),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var r=J(e,t);if(void 0!==r&&("suffix"!==t.reference&&n.push("//"),n.push(r),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var s=e.path;t.absolutePath||o&&o.absolutePath||(s=te(s)),void 0===r&&(s=s.replace(/^\/\//,"/%2F")),n.push(s)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=Y(ie(e,i),i),t=Y(ie(t,i),i)),!(i=i||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=te(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function oe(e,t,i){var n=s({scheme:"null"},i);return ie(ne(Y(e,n),Y(t,n),n,!0),n)}function re(e,t){return"string"==typeof e?e=ie(Y(e,t),t):"object"===n(e)&&(e=Y(ie(e,t),t)),e}function se(e,t,i){return"string"==typeof e?e=ie(Y(e,i),i):"object"===n(e)&&(e=ie(e,i)),"string"==typeof t?t=ie(Y(t,i),i):"object"===n(t)&&(t=ie(t,i)),e===t}function ae(e,t){return e&&e.toString().replace(t&&t.iri?c.ESCAPE:l.ESCAPE,O)}function le(e,t){return e&&e.toString().replace(t&&t.iri?c.PCT_ENCODED:l.PCT_ENCODED,V)}var ce={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var i="https"===String(e.scheme).toLowerCase();return e.port!==(i?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},he={scheme:"https",domainHost:ce.domainHost,parse:ce.parse,serialize:ce.serialize};function de(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var ue={scheme:"ws",domainHost:!0,parse:function(e,t){var i=e;return i.secure=de(i),i.resourceName=(i.path||"/")+(i.query?"?"+i.query:""),i.path=void 0,i.query=void 0,i},serialize:function(e,t){if(e.port!==(de(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var i=e.resourceName.split("?"),n=h(i,2),o=n[0],r=n[1];e.path=o&&"/"!==o?o:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},ge={scheme:"wss",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize},pe={},me="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",fe="[0-9A-Fa-f]",ve=i(i("%[EFef]"+fe+"%"+fe+fe+"%"+fe+fe)+"|"+i("%[89A-Fa-f]"+fe+"%"+fe+fe)+"|"+i("%"+fe+fe)),Ce="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ye=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Ie="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",be=new RegExp(me,"g"),Ae=new RegExp(ve,"g"),we=new RegExp(t("[^]",Ce,"[\\.]",'[\\"]',ye),"g"),Se=new RegExp(t("[^]",me,Ie),"g"),xe=Se;function ke(e){var t=V(e);return t.match(be)?t:e}var Te={scheme:"mailto",parse:function(e,t){var i=e,n=i.to=i.path?i.path.split(","):[];if(i.path=void 0,i.query){for(var o=!1,r={},s=i.query.split("&"),a=0,l=s.length;a<l;++a){var c=s[a].split("=");switch(c[0]){case"to":for(var h=c[1].split(","),d=0,u=h.length;d<u;++d)n.push(h[d]);break;case"subject":i.subject=le(c[1],t);break;case"body":i.body=le(c[1],t);break;default:o=!0,r[le(c[0],t)]=le(c[1],t)}}o&&(i.headers=r)}i.query=void 0;for(var g=0,p=n.length;g<p;++g){var m=n[g].split("@");if(m[0]=le(m[0]),t.unicodeSupport)m[1]=le(m[1],t).toLowerCase();else try{m[1]=G.toASCII(le(m[1],t).toLowerCase())}catch(e){i.error=i.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[g]=m.join("@")}return i},serialize:function(e,t){var i=e,n=r(e.to);if(n){for(var s=0,a=n.length;s<a;++s){var l=String(n[s]),c=l.lastIndexOf("@"),h=l.slice(0,c).replace(Ae,ke).replace(Ae,o).replace(we,O),d=l.slice(c+1);try{d=t.iri?G.toUnicode(d):G.toASCII(le(d,t).toLowerCase())}catch(e){i.error=i.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}n[s]=h+"@"+d}i.path=n.join(",")}var u=e.headers=e.headers||{};e.subject&&(u.subject=e.subject),e.body&&(u.body=e.body);var g=[];for(var p in u)u[p]!==pe[p]&&g.push(p.replace(Ae,ke).replace(Ae,o).replace(Se,O)+"="+u[p].replace(Ae,ke).replace(Ae,o).replace(xe,O));return g.length&&(i.query=g.join("&")),i}},Ee=/^([^\:]+)\:(.*)/,Re={scheme:"urn",parse:function(e,t){var i=e.path&&e.path.match(Ee),n=e;if(i){var o=t.scheme||n.scheme||"urn",r=i[1].toLowerCase(),s=i[2],a=o+":"+(t.nid||r),l=F[a];n.nid=r,n.nss=s,n.path=void 0,l&&(n=l.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var i=t.scheme||e.scheme||"urn",n=e.nid,o=i+":"+(t.nid||n),r=F[o];r&&(e=r.serialize(e,t));var s=e,a=e.nss;return s.path=(n||t.nid)+":"+a,s}},_e=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,$e={scheme:"urn:uuid",parse:function(e,t){var i=e;return i.uuid=i.nss,i.nss=void 0,t.tolerant||i.uuid&&i.uuid.match(_e)||(i.error=i.error||"UUID is not valid."),i},serialize:function(e,t){var i=e;return i.nss=(e.uuid||"").toLowerCase(),i}};F[ce.scheme]=ce,F[he.scheme]=he,F[ue.scheme]=ue,F[ge.scheme]=ge,F[Te.scheme]=Te,F[Re.scheme]=Re,F[$e.scheme]=$e,e.SCHEMES=F,e.pctEncChar=O,e.pctDecChars=V,e.parse=Y,e.removeDotSegments=te,e.serialize=ie,e.resolveComponents=ne,e.resolve=oe,e.normalize=re,e.equal=se,e.escapeComponent=ae,e.unescapeComponent=le,Object.defineProperty(e,"__esModule",{value:!0})}(t)},7598:function(e){e.exports=function(){"use strict";var e=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),i=function(){function e(e,t){var i=[],n=!0,o=!1,r=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(i.push(s.value),!t||i.length!==t);n=!0);}catch(e){o=!0,r=e}finally{try{!n&&a.return&&a.return()}finally{if(o)throw r}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();String.prototype.startsWith=String.prototype.startsWith||function(e){return 0===this.indexOf(e)},String.prototype.padStart=String.prototype.padStart||function(e,t){for(var i=this;i.length<e;)i=t+i;return i};var n={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(t>0?e.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):e.toString())||"0"}var r=function(){function r(t,n,o,s){e(this,r);var a=this;function l(e){if(e.startsWith("hsl")){var t=e.match(/([\-\d\.e]+)/g).map(Number),n=i(t,4),o=n[0],s=n[1],l=n[2],c=n[3];void 0===c&&(c=1),o/=360,s/=100,l/=100,a.hsla=[o,s,l,c]}else if(e.startsWith("rgb")){var h=e.match(/([\-\d\.e]+)/g).map(Number),d=i(h,4),u=d[0],g=d[1],p=d[2],m=d[3];void 0===m&&(m=1),a.rgba=[u,g,p,m]}else e.startsWith("#")?a.rgba=r.hexToRgb(e):a.rgba=r.nameToRgb(e)||r.hexToRgb(e)}if(void 0===t);else if(Array.isArray(t))this.rgba=t;else if(void 0===o){var c=t&&""+t;c&&l(c.toLowerCase())}else this.rgba=[t,n,o,void 0===s?1:s]}return t(r,[{key:"printRGB",value:function(e){var t=(e?this.rgba:this.rgba.slice(0,3)).map((function(e,t){return o(e,3===t?3:0)}));return e?"rgba("+t+")":"rgb("+t+")"}},{key:"printHSL",value:function(e){var t=[360,100,100,1],i=["","%","%",""],n=(e?this.hsla:this.hsla.slice(0,3)).map((function(e,n){return o(e*t[n],3===n?3:1)+i[n]}));return e?"hsla("+n+")":"hsl("+n+")"}},{key:"printHex",value:function(e){var t=this.hex;return e?t:t.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=r.hslToRgb(this._hsla)},set:function(e){3===e.length&&(e[3]=1),this._rgba=e,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=r.rgbToHsl(this._rgba)},set:function(e){3===e.length&&(e[3]=1),this._hsla=e,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){return"#"+this.rgba.map((function(e,t){return t<3?e.toString(16):Math.round(255*e).toString(16)})).map((function(e){return e.padStart(2,"0")})).join("")},set:function(e){this.rgba=r.hexToRgb(e)}}],[{key:"hexToRgb",value:function(e){var t=(e.startsWith("#")?e.slice(1):e).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!t.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+e);var i=t.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(e){return parseInt(e,16)}));return i[3]=i[3]/255,i}},{key:"nameToRgb",value:function(e){var t=e.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),i=n[t];return void 0===i?i:r.hexToRgb(i.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(e){var t=i(e,4),n=t[0],o=t[1],r=t[2],s=t[3];n/=255,o/=255,r/=255;var a=Math.max(n,o,r),l=Math.min(n,o,r),c=void 0,h=void 0,d=(a+l)/2;if(a===l)c=h=0;else{var u=a-l;switch(h=d>.5?u/(2-a-l):u/(a+l),a){case n:c=(o-r)/u+(o<r?6:0);break;case o:c=(r-n)/u+2;break;case r:c=(n-o)/u+4}c/=6}return[c,h,d,s]}},{key:"hslToRgb",value:function(e){var t=i(e,4),n=t[0],o=t[1],r=t[2],s=t[3],a=void 0,l=void 0,c=void 0;if(0===o)a=l=c=r;else{var h=function(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},d=r<.5?r*(1+o):r+o-r*o,u=2*r-d;a=h(u,d,n+1/3),l=h(u,d,n),c=h(u,d,n-1/3)}var g=[255*a,255*l,255*c].map(Math.round);return g[3]=s,g}}]),r}(),s=function(){function i(){e(this,i),this._events=[]}return t(i,[{key:"add",value:function(e,t,i){e.addEventListener(t,i,!1),this._events.push({target:e,type:t,handler:i})}},{key:"remove",value:function(e,t,n){this._events=this._events.filter((function(o){var r=!0;return e&&e!==o.target&&(r=!1),t&&t!==o.type&&(r=!1),n&&n!==o.handler&&(r=!1),r&&i._doRemove(o.target,o.type,o.handler),!r}))}},{key:"destroy",value:function(){this._events.forEach((function(e){return i._doRemove(e.target,e.type,e.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(e,t,i){e.removeEventListener(t,i,!1)}}]),i}();function a(e){var t=document.createElement("div");return t.innerHTML=e,t.firstElementChild}function l(e,t,i){var n=!1;function o(e,t,i){return Math.max(t,Math.min(e,i))}function r(e,r,s){if(s&&(n=!0),n){e.preventDefault();var a=t.getBoundingClientRect(),l=a.width,c=a.height,h=r.clientX,d=r.clientY,u=o(h-a.left,0,l),g=o(d-a.top,0,c);i(u/l,g/c)}}function s(e,t){1===(void 0===e.buttons?e.which:e.buttons)?r(e,e,t):n=!1}function a(e,t){1===e.touches.length?r(e,e.touches[0],t):n=!1}e.add(t,"mousedown",(function(e){s(e,!0)})),e.add(t,"touchstart",(function(e){a(e,!0)})),e.add(window,"mousemove",s),e.add(t,"touchmove",a),e.add(window,"mouseup",(function(e){n=!1})),e.add(t,"touchend",(function(e){n=!1})),e.add(t,"touchcancel",(function(e){n=!1}))}var c="linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",h=360,d="keydown",u="mousedown",g="focusin";function p(e,t){return(t||document).querySelector(e)}function m(e){e.preventDefault(),e.stopPropagation()}function f(e,t,i,n,o){e.add(t,d,(function(e){i.indexOf(e.key)>=0&&(o&&m(e),n(e))}))}var v=function(){function i(t){e(this,i),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new s,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(t)}return t(i,[{key:"setOptions",value:function(e){var t=this;if(e){var i=this.settings;if(e instanceof HTMLElement)i.parent=e;else{i.parent&&e.parent&&i.parent!==e.parent&&(this._events.remove(i.parent),this._popupInited=!1),s(e,i),e.onChange&&(this.onChange=e.onChange),e.onDone&&(this.onDone=e.onDone),e.onOpen&&(this.onOpen=e.onOpen),e.onClose&&(this.onClose=e.onClose);var n=e.color||e.colour;n&&this._setColor(n)}var o=i.parent;if(o&&i.popup&&!this._popupInited){var r=function(e){return t.openHandler(e)};this._events.add(o,"click",r),f(this._events,o,[" ","Spacebar","Enter"],r),this._popupInited=!0}else e.parent&&!i.popup&&this.show()}function s(e,t,i){for(var n in e)i&&i.indexOf(n)>=0||(t[n]=e[n])}}},{key:"openHandler",value:function(e){if(this.show()){e&&e.preventDefault(),this.settings.parent.style.pointerEvents="none";var t=e&&e.type===d?this._domEdit:this.domElement;setTimeout((function(){return t.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(e){var t=e&&e.type,i=!1;if(e)if(t===u||t===g){var n=(this.__containedEvent||0)+100;e.timeStamp>n&&(i=!0)}else m(e),i=!0;else i=!0;i&&this.hide()&&(this.settings.parent.style.pointerEvents="",t!==u&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(e,t){this.closeHandler(),this.setOptions(e),t&&this.openHandler()}},{key:"setColor",value:function(e,t){this._setColor(e,{silent:t})}},{key:"_setColor",value:function(e,t){if("string"==typeof e&&(e=e.trim()),e){t=t||{};var i=void 0;try{i=new r(e)}catch(e){if(t.failSilently)return;throw e}if(!this.settings.alpha){var n=i.hsla;n[3]=1,i.hsla=n}this.colour=this.color=i,this._setHSLA(null,null,null,null,t)}}},{key:"setColour",value:function(e,t){this.setColor(e,t)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var e=this._toggleDOM(!0);return this._setPosition(),e}var t=a(this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>');return this.domElement=t,this._domH=p(".picker_hue",t),this._domSL=p(".picker_sl",t),this._domA=p(".picker_alpha",t),this._domEdit=p(".picker_editor input",t),this._domSample=p(".picker_sample",t),this._domOkay=p(".picker_done button",t),this._domCancel=p(".picker_cancel button",t),t.classList.add("layout_"+this.settings.layout),this.settings.alpha||t.classList.add("no_alpha"),this.settings.editor||t.classList.add("no_editor"),this.settings.cancelButton||t.classList.add("no_cancel"),this._ifPopup((function(){return t.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var e=this,t=this,i=this.domElement,n=this._events;function o(e,t,i){n.add(e,t,i)}o(i,"click",(function(e){return e.preventDefault()})),l(n,this._domH,(function(e,i){return t._setHSLA(e)})),l(n,this._domSL,(function(e,i){return t._setHSLA(null,e,1-i)})),this.settings.alpha&&l(n,this._domA,(function(e,i){return t._setHSLA(null,null,null,1-i)}));var r=this._domEdit;o(r,"input",(function(e){t._setColor(this.value,{fromEditor:!0,failSilently:!0})})),o(r,"focus",(function(e){var t=this;t.selectionStart===t.selectionEnd&&t.select()})),this._ifPopup((function(){var t=function(t){return e.closeHandler(t)};o(window,u,t),o(window,g,t),f(n,i,["Esc","Escape"],t);var r=function(t){e.__containedEvent=t.timeStamp};o(i,u,r),o(i,g,r),o(e._domCancel,"click",t)}));var s=function(t){e._ifPopup((function(){return e.closeHandler(t)})),e.onDone&&e.onDone(e.colour)};o(this._domOkay,"click",s),f(n,i,["Enter"],s)}},{key:"_setPosition",value:function(){var e=this.settings.parent,t=this.domElement;e!==t.parentNode&&e.appendChild(t),this._ifPopup((function(i){"static"===getComputedStyle(e).position&&(e.style.position="relative");var n=!0===i?"popup_right":"popup_"+i;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(e){e===n?t.classList.add(e):t.classList.remove(e)})),t.classList.add(n)}))}},{key:"_setHSLA",value:function(e,t,i,n,o){o=o||{};var r=this.colour,s=r.hsla;[e,t,i,n].forEach((function(e,t){(e||0===e)&&(s[t]=e)})),r.hsla=s,this._updateUI(o),this.onChange&&!o.silent&&this.onChange(r)}},{key:"_updateUI",value:function(e){if(this.domElement){e=e||{};var t=this.colour,i=t.hsla,n="hsl("+i[0]*h+", 100%, 50%)",o=t.hslString,r=t.hslaString,s=this._domH,a=this._domSL,l=this._domA,d=p(".picker_selector",s),u=p(".picker_selector",a),g=p(".picker_selector",l);b(s,d,i[0]),this._domSL.style.backgroundColor=this._domH.style.color=n,b(a,u,i[1]),A(a,u,1-i[2]),a.style.color=o,A(l,g,1-i[3]);var m=o,f=m.replace("hsl","hsla").replace(")",", 0)"),v="linear-gradient("+[m,f]+")";if(this._domA.style.background=v+", "+c,!e.fromEditor){var C=this.settings.editorFormat,y=this.settings.alpha,I=void 0;switch(C){case"rgb":I=t.printRGB(y);break;case"hsl":I=t.printHSL(y);break;default:I=t.printHex(y)}this._domEdit.value=I}this._domSample.style.color=r}function b(e,t,i){t.style.left=100*i+"%"}function A(e,t,i){t.style.top=100*i+"%"}}},{key:"_ifPopup",value:function(e,t){this.settings.parent&&this.settings.popup?e&&e(this.settings.popup):t&&t()}},{key:"_toggleDOM",value:function(e){var t=this.domElement;if(!t)return!1;var i=e?"":"none",n=t.style.display!==i;return n&&(t.style.display=i),n}}]),i}(),C=document.createElement("style");return C.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(C),v.StyleElement=C,v}()},9857:function(e,t,i){"use strict";i.d(t,{m:function(){return de}});class n extends Error{constructor(e,t){super(e+" at position "+t),this.position=t}}const o=92,r=47,s=42,a=123,l=125,c=91,h=93,d=40,u=41,g=32,p=10,m=9,f=13,v=8,C=12,y=34,I=43,b=45,A=39,w=48,S=57,x=44,k=46,T=58,E=59,R=65,_=97,$=69,L=101,N=70,M=102,B=160,W=8192,P=8202,H=8239,G=8287,F=12288,O=8220,V=8221,Z=8216,D=8217,j=96,K=180;function z(e){return e>=w&&e<=S}function X(e){return e>=32&&e<=1114111}function Y(e){return J.test(e)}const J=/^[,:[\]/{}()\n+]$/;function U(e){return Q.test(e)||e&&te(e.charCodeAt(0))}const Q=/^[[{\w-]$/;function q(e){return e===p||e===f||e===m||e===v||e===C}function ee(e){return e===g||e===p||e===m||e===f}function te(e){return ie(e)||oe(e)}function ie(e){return e===y||e===O||e===V}function ne(e){return e===y}function oe(e){return e===A||e===Z||e===D||e===j||e===K}function re(e){return e===A}function se(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.lastIndexOf(t);return-1!==n?e.substring(0,n)+(i?"":e.substring(n+1)):e}function ae(e,t){let i=e.length;if(!ee(e.charCodeAt(i-1)))return e+t;for(;ee(e.charCodeAt(i-1));)i--;return e.substring(0,i)+t+e.substring(i)}function le(e,t,i){return e.substring(0,t)+e.substring(t+i)}const ce={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},he={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function de(e){let t=0,i="";m()||function(){throw new n("Unexpected end of json string",e.length)}();const g=A(x);for(g&&f(),U(e[t])&&function(e){return/[,\n][ \t\r]*$/.test(e)}(i)?(g||(i=ae(i,",")),function(){let e=!0,t=!0;for(;t;)e?e=!1:A(x)||(i=ae(i,",")),t=m();t||(i=se(i,",")),i="[\n".concat(i,"\n]")}()):g&&(i=se(i,","));e.charCodeAt(t)===l||e.charCodeAt(t)===h;)t++,f();if(t>=e.length)return i;function m(){f();const n=function(){if(e.charCodeAt(t)===a){i+="{",t++,f();let n=!0;for(;t<e.length&&e.charCodeAt(t)!==l;){let o;if(n?(o=!0,n=!1):(o=A(x),o||(i=ae(i,",")),f()),!V()&&!j()){e.charCodeAt(t)===l||e.charCodeAt(t)===a||e.charCodeAt(t)===h||e.charCodeAt(t)===c||void 0===e[t]?i=se(i,","):ge();break}f();const r=A(T),s=t>=e.length;r||(U(e[t])||s?i=ae(i,":"):pe()),m()||(r||s?i+="null":pe())}return e.charCodeAt(t)===l?(i+="}",t++):i=ae(i,"}"),!0}return!1}()||function(){if(e.charCodeAt(t)===c){i+="[",t++,f();let n=!0;for(;t<e.length&&e.charCodeAt(t)!==h;)if(n?n=!1:A(x)||(i=ae(i,",")),!m()){i=se(i,",");break}return e.charCodeAt(t)===h?(i+="]",t++):i=ae(i,"]"),!0}return!1}()||V()||function(){const n=t;if(e.charCodeAt(t)===b&&(t++,Q(n)))return!0;for(;z(e.charCodeAt(t));)t++;if(e.charCodeAt(t)===k){if(t++,Q(n))return!0;for(;z(e.charCodeAt(t));)t++}if(e.charCodeAt(t)===L||e.charCodeAt(t)===$){if(t++,e.charCodeAt(t)!==b&&e.charCodeAt(t)!==I||t++,Q(n))return!0;for(;z(e.charCodeAt(t));)t++}if(t>n){const o=e.slice(n,t),r=/^0\d/.test(o);return i+=r?'"'.concat(o,'"'):o,!0}return!1}()||D("true","true")||D("false","false")||D("null","null")||D("True","true")||D("False","false")||D("None","null")||j();return f(),n}function f(){const e=t;let i=v();do{i=C(),i&&(i=v())}while(i);return t>e}function v(){let n,o="";for(;(n=ee(e.charCodeAt(t)))||(r=e.charCodeAt(t))===B||r>=W&&r<=P||r===H||r===G||r===F;)o+=n?e[t]:" ",t++;var r;return o.length>0&&(i+=o,!0)}function C(){if(e.charCodeAt(t)===r&&e.charCodeAt(t+1)===s){for(;t<e.length&&!ue(e,t);)t++;return t+=2,!0}if(e.charCodeAt(t)===r&&e.charCodeAt(t+1)===r){for(;t<e.length&&e.charCodeAt(t)!==p;)t++;return!0}return!1}function A(n){return e.charCodeAt(t)===n&&(i+=e[t],t++,!0)}function O(){return i=o,e.charCodeAt(t)===i&&(t++,!0);var i}function V(){let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=e.charCodeAt(t)===o;if(r&&(t++,r=!0),te(e.charCodeAt(t))){const a=ne(e.charCodeAt(t))?ne:re(e.charCodeAt(t))?re:oe(e.charCodeAt(t))?oe:ie,l=t,c=i.length;let h='"';for(t++;;){if(t>=e.length)return n?(h=ae(h,'"'),i+=h,!0):(t=l,i=i.substring(0,c),V(!0));if(a(e.charCodeAt(t))){const o=t,r=h.length;if(h+='"',t++,i+=h,f(),n||t>=e.length||Y(e.charAt(t))||te(e.charCodeAt(t)))return Z(),!0;if(Y(e.charAt(K(o-1))))return t=l,i=i.substring(0,c),V(!0);i=i.substring(0,c),t=o+1,h=h.substring(0,r)+"\\"+h.substring(r)}else{if(n&&Y(e[t]))return h=ae(h,'"'),i+=h,Z(),!0;if(e.charCodeAt(t)===o){const i=e.charAt(t+1);if(void 0!==he[i])h+=e.slice(t,t+2),t+=2;else if("u"===i){let i=2;for(;i<6&&((s=e.charCodeAt(t+i))>=w&&s<=S||s>=R&&s<=N||s>=_&&s<=M);)i++;6===i?(h+=e.slice(t,t+6),t+=6):t+i>=e.length?t=e.length:me()}else h+=i,t+=2}else{const i=e.charAt(t),n=e.charCodeAt(t);n===y&&e.charCodeAt(t-1)!==o?(h+="\\"+i,t++):q(n)?(h+=ce[i],t++):(X(n)||de(i),h+=i,t++)}}r&&O()}}var s;return!1}function Z(){let n=!1;for(f();e.charCodeAt(t)===I;){n=!0,t++,f(),i=se(i,'"',!0);const e=i.length,o=V();i=o?le(i,e,1):ae(i,'"')}return n}function D(n,o){return e.slice(t,t+n.length)===n&&(i+=o,t+=n.length,!0)}function j(){const n=t;for(;t<e.length&&!Y(e[t])&&!te(e.charCodeAt(t));)t++;if(t>n){if(e.charCodeAt(t)===d)return t++,m(),e.charCodeAt(t)===u&&(t++,e.charCodeAt(t)===E&&t++),!0;{for(;ee(e.charCodeAt(t-1))&&t>0;)t--;const o=e.slice(n,t);return i+="undefined"===o?"null":JSON.stringify(o),e.charCodeAt(t)===y&&t++,!0}}}function K(t){let i=t;for(;i>0&&ee(e.charCodeAt(i));)i--;return i}function J(i){if(!z(e.charCodeAt(t))){const o=e.slice(i,t);throw new n("Invalid number '".concat(o,"', expecting a digit ").concat(e[t]?"but got '".concat(e[t],"'"):"but reached end of input"),t)}}function Q(n){return t>=e.length?(i+=e.slice(n,t)+"0",!0):(J(n),!1)}function de(e){throw new n("Invalid character "+JSON.stringify(e),t)}function ge(){throw new n("Object key expected",t)}function pe(){throw new n("Colon expected",t)}function me(){const i=e.slice(t,t+6);throw new n('Invalid unicode character "'.concat(i,'"'),t)}!function(){throw new n("Unexpected character "+JSON.stringify(e[t]),t)}()}function ue(e,t){return"*"===e[t]&&"/"===e[t+1]}},3420:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON Schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},5207:function(e){"use strict";e.exports=JSON.parse('{"id":"http://json-schema.org/draft-04/schema#","$schema":"http://json-schema.org/draft-04/schema#","description":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"positiveInteger":{"type":"integer","minimum":0},"positiveIntegerDefault0":{"allOf":[{"$ref":"#/definitions/positiveInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"minItems":1,"uniqueItems":true}},"type":"object","properties":{"id":{"type":"string"},"$schema":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"multipleOf":{"type":"number","minimum":0,"exclusiveMinimum":true},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"boolean","default":false},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"boolean","default":false},"maxLength":{"$ref":"#/definitions/positiveInteger"},"minLength":{"$ref":"#/definitions/positiveIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/positiveInteger"},"minItems":{"$ref":"#/definitions/positiveIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxProperties":{"$ref":"#/definitions/positiveInteger"},"minProperties":{"$ref":"#/definitions/positiveIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"anyOf":[{"type":"boolean"},{"$ref":"#"}],"default":{}},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"dependencies":{"exclusiveMaximum":["maximum"],"exclusiveMinimum":["minimum"]},"default":{}}')},6801:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-06/schema#","$id":"http://json-schema.org/draft-06/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"examples":{"type":"array","items":{}},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":{},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":{}}')},8198:function(e){"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.loaded=!0,r.exports}return i.amdD=function(){throw new Error("define cannot be used indirect")},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},i(1346)}()},e.exports=t()}}]);