mooxphp/moox

View on GitHub
public/js/awcodes/headings/invaders-filament-jsoneditor.js

Summary

Maintainability
A
0 mins
Test Coverage
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JSONEditor=t():e.JSONEditor=t()}(self,(function(){return t={897:function(e,t,i){"use strict";i.d(t,{x:function(){return a}});var n=i(2602),r=i(9791),o=i(7907);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,n.key,n)}}var a=function(){function e(t,i){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.dom={};var n=this,r=this.dom,s=((i=(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,document.createElement("div"))).className="jsoneditor-contextmenu-root",r.root=i,document.createElement("div"));(i=(s.className="jsoneditor-contextmenu",r.menu=s,i.appendChild(s),document.createElement("ul"))).className="jsoneditor-menu",s.appendChild(i),r.list=i,r.items=[],s=document.createElement("button");(r=(s.type="button",r.focusButton=s,document.createElement("li"))).style.overflow="hidden",r.style.height="0",r.appendChild(s),i.appendChild(r),function e(t,i,r){r.forEach((function(r){var s,a,l,c,h,d;"separator"===r.type?((h=document.createElement("div")).className="jsoneditor-separator",(a=document.createElement("li")).appendChild(h),t.appendChild(a)):(s={},h=document.createElement("li"),t.appendChild(h),(a=document.createElement("button")).type="button",a.className=r.className,s.button=a,r.title&&(a.title=r.title),r.click&&(a.onclick=function(e){e.preventDefault(),n.hide(),r.click()}),h.appendChild(a),r.submenu?((c=document.createElement("div")).className="jsoneditor-icon",a.appendChild(c),(c=document.createElement("div")).className="jsoneditor-text"+(r.click?"":" jsoneditor-right-margin"),c.appendChild(document.createTextNode(r.text)),a.appendChild(c),(l=r.click?(a.className+=" jsoneditor-default",(c=document.createElement("button")).type="button",(s.buttonExpand=c).className="jsoneditor-expand",(d=document.createElement("div")).className="jsoneditor-expand",c.appendChild(d),h.appendChild(c),r.submenuTitle&&(c.title=r.submenuTitle),c):((d=document.createElement("div")).className="jsoneditor-expand",a.appendChild(d),a)).onclick=function(e){e.preventDefault(),n._onExpandItem(s),l.focus()},s.subItems=c=[],d=document.createElement("ul"),(s.ul=d).className="jsoneditor-menu",d.style.height="0",h.appendChild(d),e(d,c,r.submenu)):((h=document.createElement("div")).className="jsoneditor-icon",a.appendChild(h),(d=document.createElement("div")).className="jsoneditor-text",d.appendChild(document.createTextNode((0,o.Iu)(r.text))),a.appendChild(d)),i.push(s))}))}(i,this.dom.items,t),this.maxHeight=0,t.forEach((function(e){e=24*(t.length+(e.submenu?e.submenu.length:0)),n.maxHeight=Math.max(n.maxHeight,e)}))}var t,i;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,o){this.hide();var s=!0,a=t.parentNode,l=t.getBoundingClientRect(),c=(a=a.getBoundingClientRect(),i.getBoundingClientRect()),h=this;this.dom.absoluteAnchor=(0,n.w)(t,i,(function(){h.hide()})),l.bottom+this.maxHeight<c.bottom||l.top-this.maxHeight>c.top&&(s=!1),i=o?0:l.top-a.top;s?(o=t.offsetHeight,this.dom.menu.style.left="0",this.dom.menu.style.top=i+o+"px",this.dom.menu.style.bottom=""):(this.dom.menu.style.left="0",this.dom.menu.style.top="",this.dom.menu.style.bottom="0px"),this.limitHeight&&(a=s?c.bottom-l.bottom-10:l.top-c.top-10,this.dom.list.style.maxHeight=a+"px",this.dom.list.style.overflowY="auto"),this.dom.absoluteAnchor.appendChild(this.dom.root),this.selection=(0,r.getSelection)(),this.anchor=t,setTimeout((function(){h.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,i=this,n=e===this.expandedItem,o=this.expandedItem;o&&(o.ul.style.height="0",o.ul.style.padding="",setTimeout((function(){i.expandedItem!==o&&(o.ul.style.display="",r.removeClassName)(o.ul.parentNode,"jsoneditor-selected")}),300),this.expandedItem=void 0),n||((t=e.ul).style.display="block",t.clientHeight,setTimeout((function(){if(i.expandedItem===e){for(var n=0,r=0;r<t.childNodes.length;r++)n+=t.childNodes[r].clientHeight;t.style.height=n+"px",t.style.padding="5px 10px"}}),0),(0,r.addClassName)(t.parentNode,"jsoneditor-selected"),this.expandedItem=e)}},{key:"_onKeyDown",value:function(e){var t,i,n,o,s=e.target,a=e.which,l=!1;27===a?(this.selection&&(0,r.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=(n=(n=t[i-1])&&"jsoneditor-expand"===n.className?t[i-2]:n)||t[t.length-1])&&n.focus(),l=!0):39===a?(i=(t=this._getVisibleButtons()).indexOf(s),(o=t[i+1])&&"jsoneditor-expand"===o.className&&o.focus(),l=!0):40===a&&(i=(t=this._getVisibleButtons()).indexOf(s),(o=(o=(o=t[i+1])&&"jsoneditor-expand"===o.className?t[i+2]:o)||t[0])&&(o.focus(),l=!0),l=!0),l&&(e.stopPropagation(),e.preventDefault())}}])&&s(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();a.visibleMenu=void 0},6436:function(e,t,i){"use strict";function n(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)}}i.d(t,{Q:function(){return r}});var r=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.errorTableVisible=t.errorTableVisible,this.onToggleVisibility=t.onToggleVisibility,this.onFocusLine=t.onFocusLine||function(){},this.onChangeHeight=t.onChangeHeight,this.dom={};var i;(i=((t=document.createElement("div")).className="jsoneditor-validation-errors-container",this.dom.validationErrorsContainer=t,document.createElement("div"))).style.display="none",i.className="jsoneditor-additional-errors fadein",i.textContent="Scroll for more ▿",this.dom.additionalErrorsIndication=i,t.appendChild(i),t=document.createElement("span");(i=(t.className="jsoneditor-validation-error-icon",t.style.display="none",this.dom.validationErrorIcon=t,document.createElement("span"))).className="jsoneditor-validation-error-count",i.style.display="none",this.dom.validationErrorCount=i,this.dom.parseErrorIndication=document.createElement("span"),this.dom.parseErrorIndication.className="jsoneditor-parse-error-icon",this.dom.parseErrorIndication.style.display="none"}var t,i;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,n,r=this,o=(this.dom.validationErrors&&(this.dom.validationErrors.parentNode.removeChild(this.dom.validationErrors),this.dom.validationErrors=null,this.dom.additionalErrorsIndication.style.display="none"),this.errorTableVisible&&0<e.length?((o=document.createElement("div")).className="jsoneditor-validation-errors",(n=document.createElement("table")).className="jsoneditor-text-errors",o.appendChild(n),i=document.createElement("tbody"),n.appendChild(i),e.forEach((function(e){isNaN(e.line)?e.dataPath&&(s=t.find((function(t){return t.path===e.dataPath})))&&(n=s.line+1):n=e.line;var n,o,s=document.createElement("tr"),a=(s.className=isNaN(n)?"":"jump-to-line","error"===e.type?s.className+=" parse-error":s.className+=" validation-error",document.createElement("td"));(o=((o=document.createElement("button")).className="jsoneditor-schema-error",a.appendChild(o),s.appendChild(a),document.createElement("td"))).style="white-space: nowrap;",o.textContent=isNaN(n)?"":"Ln "+n,s.appendChild(o),"string"==typeof e?((a=document.createElement("td")).colSpan=2,(o=document.createElement("pre")).appendChild(document.createTextNode(e)),a.appendChild(o),s.appendChild(a)):((o=document.createElement("td")).appendChild(document.createTextNode(e.dataPath||"")),s.appendChild(o),a=document.createElement("td"),(o=document.createElement("pre")).appendChild(document.createTextNode(e.message.replace(/<br>/gi,"\n"))),a.appendChild(o),s.appendChild(a)),s.onclick=function(){r.onFocusLine(n)},i.appendChild(s)})),this.dom.validationErrors=o,this.dom.validationErrorsContainer.appendChild(o),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(){r.dom.additionalErrorsIndication.style.display=0<r.dom.validationErrorsContainer.clientHeight&&0===r.dom.validationErrorsContainer.scrollTop?"block":"none"}):this.dom.validationErrorsContainer.onscroll=void 0,n=this.dom.validationErrorsContainer.clientHeight+(this.dom.statusBar?this.dom.statusBar.clientHeight:0),this.onChangeHeight(n)):this.onChangeHeight(0),e.filter((function(e){return"error"!==e.type})).length);0<o?(this.dom.validationErrorCount.style.display="inline",this.dom.validationErrorCount.innerText=o,this.dom.validationErrorCount.onclick=this.toggleTableVisibility.bind(this),this.dom.validationErrorIcon.style.display="inline",this.dom.validationErrorIcon.title=o+" 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}))?(n=e[0].line,this.dom.parseErrorIndication.style.display="block",this.dom.parseErrorIndication.title=isNaN(n)?"parse error - check that the json is valid":"parse error on line "+n,this.dom.parseErrorIndication.onclick=this.toggleTableVisibility.bind(this)):this.dom.parseErrorIndication.style.display="none"}}])&&n(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},2474:function(e,t,i){"use strict";function n(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)}}i.d(t,{R:function(){return r}});var r=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");if(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;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){(e=(e=e.target)===this.target||!(!this.target.contains(e)&&!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))}}])&&n(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},3161:function(e,t,i){"use strict";var n=i(8170),r=i(8037),o=i(8038).treeModeMixins,s=i(5956).textModeMixins,a=i(341).previewModeMixins,l=(g=i(9791)).clear,c=g.extend,h=g.getInnerText,d=g.getInternetExplorerVersion,u=g.parse,g=i(2744).tryRequireAjv,p=i(2558).showTransformModal,m=i(6210).showSortModal,f=g();function C(e,t,i){if(!(this instanceof C))throw new Error('JSONEditor constructor called without "new".');var n=d();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","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"],C.prototype._create=function(e,t,i){this.container=e,this.options=t||{},this.json=i||{},e=this.options.mode||this.options.modes&&this.options.modes[0]||"tree",this.setMode(e)},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=u(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=c({},this.options),n=i.mode,r=(i.mode=e,C.modes[e]);if(!r)throw new Error('Unknown mode "'+i.mode+'"');var o="text"===r.data,s=this.getName(),a=this[o?"getText":"get"]();if(this.destroy(),l(this),c(this,r.mixin),this.create(t,i),this.setName(s),this[o?"setText":"set"](a),"function"==typeof r.load)try{r.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):alert(e.toString())},C.prototype.setSchema=function(e,t){if(e){var n;try{this.options.ajv?n=this.options.ajv:((n=f({allErrors:!0,verbose:!0,schemaId:"auto",$data:!0})).addMetaSchema(i(7171)),n.addMetaSchema(i(6273)))}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 r in t)n.removeSchema(r),t[r]&&n.addSchema(t[r],r);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()},C.prototype.validate=function(){},C.prototype.refresh=function(){},(C.registerMode=function(e){var t;if(Array.isArray(e))for(r=0;r<e.length;r++)C.registerMode(e[r]);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 i=e.mode;if(i in C.modes)throw new Error('Mode "'+i+'" already registered');if("function"!=typeof e.mixin.create)throw new Error('Required function "create" missing on mixin');for(var n=["setMode","registerMode","modes"],r=0;r<n.length;r++)if((t=n[r])in e.mixin)throw new Error('Reserved property "'+t+'" not allowed in mixin');C.modes[i]=e}})(o),C.registerMode(s),C.registerMode(a),C.ace=n,C.Ajv=f,C.VanillaPicker=r,C.showTransformModal=p,C.showSortModal=m,C.getInnerText=h,e.exports=C.default=C},6617:function(e,t,i){"use strict";i.d(t,{x:function(){return s}});var n=i(897),r=i(7907);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,n.key,n)}}var s=function(){function e(t,i,o,s){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");for(var a={code:{text:(0,r.Iu)("modeCodeText"),title:(0,r.Iu)("modeCodeTitle"),click:function(){s("code")}},form:{text:(0,r.Iu)("modeFormText"),title:(0,r.Iu)("modeFormTitle"),click:function(){s("form")}},text:{text:(0,r.Iu)("modeTextText"),title:(0,r.Iu)("modeTextTitle"),click:function(){s("text")}},tree:{text:(0,r.Iu)("modeTreeText"),title:(0,r.Iu)("modeTreeTitle"),click:function(){s("tree")}},view:{text:(0,r.Iu)("modeViewText"),title:(0,r.Iu)("modeViewTitle"),click:function(){s("view")}},preview:{text:(0,r.Iu)("modePreviewText"),title:(0,r.Iu)("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"+(o===h?" jsoneditor-selected":""),l.push(d)}if(!(u=a[o]))throw new Error('Unknown mode "'+o+'"');var u=u.text,g=document.createElement("button");(u=(g.type="button",g.className="jsoneditor-modes jsoneditor-separator",g.textContent=u+" ▾",g.title=(0,r.Iu)("modeEditorTitle"),g.onclick=function(){new n.x(l).show(g,t)},document.createElement("div"))).className="jsoneditor-modes",u.style.position="relative",u.appendChild(g),t.appendChild(u),this.dom={container:t,box:g,frame:u}}var t,i;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}}])&&o(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},8170:function(e,t,i){var n;if(window.ace)n=window.ace;else try{n=i(6225),i(4091),i(3330);var r=i(7923);n.config.setModuleUrl("ace/mode/json_worker",r)}catch(e){}e.exports=n},4864: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)}))},6589:function(e,t){var i;(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,r,o,s){var a=o.length-1;switch(r){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.$=o[a-1];case 13:this.$={};break;case 14:case 19:this.$=o[a-1];break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[];break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[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],r=[],o=this.table,s="",a=0,l=0,c=0,h=(this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,void 0===this.lexer.yylloc&&(this.lexer.yylloc={}),this.lexer.yylloc);function d(){var e=t.lexer.lex()||1;return"number"!=typeof e&&t.symbols_[e]||e}r.push(h),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var u,g,p,m,f,C,I,v,A={};;){if(p=i[i.length-1],void 0===(m=this.defaultActions[p]||(null==u&&(u=d()),o[p]&&o[p][u]))||!m.length||!m[0]){if(!c){for(f in v=[],o[p])this.terminals_[f]&&2<f&&v.push("'"+this.terminals_[f]+"'");var b="";b=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+this.terminals_[u]+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==u?"end of input":"'"+(this.terminals_[u]||u)+"'");this.parseError(b,{text:this.lexer.match,token:this.terminals_[u]||u,line:this.lexer.yylineno,loc:h,expected:v})}if(3==c){if(1==u)throw new Error(b||"Parsing halted.");l=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,h=this.lexer.yylloc,u=d()}for(;!(2..toString()in o[p]);){if(0==p)throw new Error(b||"Parsing halted.");1,i.length=i.length-2,n.length=n.length-1,r.length=r.length-1,p=i[i.length-1]}g=u,u=2,m=o[p=i[i.length-1]]&&o[p][2],c=3}if(m[0]instanceof Array&&1<m.length)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),r.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,0<c&&c--);break;case 2:if(C=this.productions_[m[1]][1],A.$=n[n.length-C],A._$={first_line:r[r.length-(C||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(C||1)].first_column,last_column:r[r.length-1].last_column},void 0!==(I=this.performAction.call(A,s,l,a,this.yy,m[1],n,r)))return I;C&&(i=i.slice(0,-1*C*2),n=n.slice(0,-1*C),r=r.slice(0,-1*C)),i.push(this.productions_[m[1]][0]),n.push(A.$),r.push(A._$),I=o[i[i.length-2]][i[i.length-1]],i.push(I);break;case 3:return!0}}return!0}}).lexer={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(20<e.length?"...":"")+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)+(20<e.length?"...":"")).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;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e,t,i,n,r=this._currentRules(),o=0;o<r.length&&(!(t=this._input.match(this.rules[r[o]]))||e&&!(t[0].length>e[0].length)||(e=t,i=o,this.options.flex));o++);return e?((n=e[0].match(/\n.*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-1:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,r[i],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n||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}}},t.parser=i,t.parse=i.parse.bind(i)},3879:function(e){"use strict";function t(){}var i={defaultSelected:!0,width:"auto",disabled:!1,searchable:!0,clearable:!1,sortSelected:!1,allowDeselect:!1,closeOnScroll:!1,nativeDropdown:!1,placeholder:"Select an option...",taggable:!1,tagPlaceholder:"Enter a tag..."},n=(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},{extend:function(e,t){for(var i in t=t||{},e)!e.hasOwnProperty(i)||t.hasOwnProperty(i)||(t[i]=e[i]);return t},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 r=0,o=e.length;r<o;r++)t.call(i,r,e[r],e)},createElement:function(e,t){var i,n,r=document,o=r.createElement(e);if(t&&"[object Object]"===Object.prototype.toString.call(t))for(i in t)i in o?o[i]=t[i]:"html"===i?o.textContent=t[i]:"text"===i?(n=r.createTextNode(t[i]),o.appendChild(n)):o.setAttribute(i,t[i]);return o},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){n.hasClass(e,t)||(e.classList?e.classList.add(t):e.className=e.className.trim()+" "+t)},removeClass:function(e,t){n.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:n.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 r=this,o=arguments,s=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||e.apply(r,o)}),t),s&&e.apply(r,o)}},rect:function(e,t){var i=window,n=(e=e.getBoundingClientRect(),t?i.pageXOffset:0);t=t?i.pageYOffset:0;return{bottom:e.bottom+t,height:e.height,left:e.left+n,right:e.right+n,top:e.top+t,width:e.width}},includes:function(e,t){return-1<e.indexOf(t)},truncate:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}});function r(e,t){return e.hasOwnProperty(t)&&(!0===e[t]||e[t].length)}function o(e,t,i){e.parentNode?e.parentNode.parentNode||t.appendChild(e.parentNode):t.appendChild(e),n.removeClass(e,"excluded"),i||(e.textContent=e.textContent+"")}function s(){var e,t;this.items.length&&(e=document.createDocumentFragment(),this.config.pagination?(t=this.pages.slice(0,this.pageIndex),n.each(t,(function(t,i){n.each(i,(function(t,i){o(i,e,this.customOption)}),this)}),this)):n.each(this.items,(function(t,i){o(i,e,this.customOption)}),this),e.childElementCount&&(n.removeClass(this.items[this.navIndex],"active"),this.navIndex=e.querySelector(".selectr-option").idx,n.addClass(this.items[this.navIndex],"active")),this.tree.appendChild(e))}function a(e,t){return t=t||e,t=this.customOption?this.config.renderOption(t):e.textContent,(t=n.createElement("li",{class:"selectr-option",html:t,role:"treeitem","aria-selected":!1})).idx=e.idx,this.items.push(t),e.defaultSelected&&this.defaultSelected.push(e.idx),e.disabled&&(t.disabled=!0,n.addClass(t,"disabled")),t}function l(){var e,t=this.tree,i=t.scrollTop;t.scrollHeight-t.offsetHeight<=i&&this.pageIndex<this.pages.length&&(e=document.createDocumentFragment(),n.each(this.pages[this.pageIndex],(function(t,i){o(i,e,this.customOption)}),this),t.appendChild(e),this.pageIndex++,this.emit("selectr.paginate",{items:this.items.length,total:this.data.length,page:this.pageIndex,pages:this.pages.length}))}function c(){(this.config.searchable||this.config.taggable)&&(this.input.value=null,this.searching=!1,this.config.searchable&&n.removeClass(this.inputContainer,"active"),n.hasClass(this.container,"notice")&&(n.removeClass(this.container,"notice"),n.addClass(this.container,"open"),this.input.focus()),n.each(this.items,(function(e,t){n.removeClass(t,"excluded"),this.customOption||(t.textContent=t.textContent+"")}),this))}function h(e,t){if(t=t||{},!e)throw new Error("You must supply either a HTMLSelectElement or a CSS3 selector string.");if("string"==typeof(this.el=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)}h.prototype.render=function(e){var o;this.rendered||(this.config=n.extend(i,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=r(this.config,"disabled"),this.opened=!1,this.config.taggable&&(this.config.searchable=!1),this.navigating=!1,this.mobileDevice=!1,/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,t.mixin(this),function(){this.requiresPagination=this.config.pagination&&0<this.config.pagination,r(this.config,"width")&&(n.isInt(this.config.width)?this.width=this.config.width+"px":"auto"===this.config.width?this.width="100%":n.includes(this.config.width,"%")&&(this.width=this.config.width)),this.container=n.createElement("div",{class:"selectr-container"}),this.config.customClass&&n.addClass(this.container,this.config.customClass),this.mobileDevice?n.addClass(this.container,"selectr-mobile"):n.addClass(this.container,"selectr-desktop"),this.el.tabIndex=-1,this.config.nativeDropdown||this.mobileDevice?n.addClass(this.el,"selectr-visible"):n.addClass(this.el,"selectr-hidden"),this.selected=n.createElement("div",{class:"selectr-selected",disabled:this.disabled,tabIndex:1,"aria-expanded":!1}),this.label=n.createElement(this.el.multiple?"ul":"span",{class:"selectr-label"});var e,t,i,o,s=n.createElement("div",{class:"selectr-options-container"}),l=(this.tree=n.createElement("ul",{class:"selectr-options",role:"tree","aria-hidden":!0,"aria-expanded":!1}),this.notice=n.createElement("div",{class:"selectr-notice"}),this.el.setAttribute("aria-hidden",!0),this.disabled&&(this.el.disabled=!0),this.el.multiple&&(n.addClass(this.label,"selectr-tags"),n.addClass(this.container,"multiple"),this.tags=[],this.selectedValues=this.getSelectedProperties("value"),this.selectedIndexes=this.getSelectedProperties("idx")),this.selected.appendChild(this.label),this.config.clearable&&(this.selectClear=n.createElement("button",{class:"selectr-clear",type:"button"}),this.container.appendChild(this.selectClear),n.addClass(this.container,"clearable")),this.config.taggable&&(e=n.createElement("li",{class:"input-tag"}),this.input=n.createElement("input",{class:"selectr-tag-input",placeholder:this.config.tagPlaceholder,tagIndex:0,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox",type:"search"}),e.appendChild(this.input),this.label.appendChild(e),n.addClass(this.container,"taggable"),this.tagSeperators=[","],this.config.tagSeperators&&(this.tagSeperators=this.tagSeperators.concat(this.config.tagSeperators))),this.config.searchable&&(this.input=n.createElement("input",{class:"selectr-input",tagIndex:-1,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox",type:"search"}),this.inputClear=n.createElement("button",{class:"selectr-input-clear",type:"button"}),this.inputContainer=n.createElement("div",{class:"selectr-input-container"}),this.inputContainer.appendChild(this.input),this.inputContainer.appendChild(this.inputClear),s.appendChild(this.inputContainer)),s.appendChild(this.notice),s.appendChild(this.tree),this.items=[],this.options=[],this.el.options.length&&(this.options=[].slice.call(this.el.options)),!1),c=0;this.el.children.length&&n.each(this.el.children,(function(e,t){"OPTGROUP"===t.nodeName?(l=n.createElement("ul",{class:"selectr-optgroup",role:"group",html:"<li class='selectr-optgroup--label'>"+t.label+"</li>"}),n.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)&&(t=!(this.data=[]),l=!1,c=0,n.each(this.config.data,(function(e,o){r(o,"children")?(t=n.createElement("optgroup",{label:o.text}),l=n.createElement("ul",{class:"selectr-optgroup",role:"group",html:"<li class='selectr-optgroup--label'>"+o.text+"</li>"}),n.each(o.children,(function(e,n){(i=new Option(n.text,n.value,!1,n.hasOwnProperty("selected")&&!0===n.selected)).disabled=r(n,"disabled"),this.options.push(i),t.appendChild(i),i.idx=c,l.appendChild(a.call(this,i,n)),this.data[c]=n,c++}),this)):((i=new Option(o.text,o.value,!1,o.hasOwnProperty("selected")&&!0===o.selected)).disabled=r(o,"disabled"),this.options.push(i),i.idx=c,a.call(this,i,o),this.data[c]=o,c++)}),this)),this.setSelected(!0);for(var h=this.navIndex=0;h<this.items.length;h++)if(o=this.items[h],!n.hasClass(o,"disabled")){n.addClass(o,"active"),this.navIndex=h;break}this.requiresPagination&&(this.pageIndex=1,this.paginate()),this.container.appendChild(this.selected),this.container.appendChild(s),this.placeEl=n.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)}.call(this),this.bindEvents(),this.update(),this.optsRect=n.rect(this.tree),this.rendered=!0,this.el.multiple||(this.el.selectedIndex=this.selectedIndex),o=this,setTimeout((function(){o.emit("selectr.init")}),20))},h.prototype.getSelected=function(){return this.el.querySelectorAll("option:checked")},h.prototype.getSelectedProperties=function(e){var t=this.getSelected();return[].slice.call(t).map((function(t){return t[e]})).filter((function(e){return null!=e}))},h.prototype.bindEvents=function(){var e=this;this.events={},this.events.dismiss=function(e){e=e.target,this.container.contains(e)||!this.opened&&!n.hasClass(this.container,"notice")||this.close()}.bind(this),this.events.navigate=function(e){if(e=e||window.event,this.items.length&&this.opened&&n.includes([13,38,40],e.which)){if(e.preventDefault(),13===e.which)return!(this.config.taggable&&0<this.input.value.length)&&this.change(this.navIndex);var t,i=this.items[this.navIndex];switch(e.which){case 38:(t=0)<this.navIndex&&this.navIndex--;break;case 40:this.navIndex<this.items.length-(t=1)&&this.navIndex++}for(this.navigating=!0;n.hasClass(this.items[this.navIndex],"disabled")||n.hasClass(this.items[this.navIndex],"excluded");)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}}e=n.rect(this.items[this.navIndex]),t?(0===this.navIndex?this.tree.scrollTop=0:e.top+e.height>this.optsRect.top+this.optsRect.height&&(this.tree.scrollTop=this.tree.scrollTop+(e.top+e.height-(this.optsRect.top+this.optsRect.height))),this.navIndex===this.tree.childElementCount-1&&this.requiresPagination&&l.call(this)):0===this.navIndex?this.tree.scrollTop=0:e.top-this.optsRect.top<0&&(this.tree.scrollTop=this.tree.scrollTop+(e.top-this.optsRect.top)),i&&n.removeClass(i,"active"),n.addClass(this.items[this.navIndex],"active")}else this.navigating=!1}.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.config.nativeDropdown||this.mobileDevice)&&this.container.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation(),t.target===e.el&&e.toggle()})),this.el.addEventListener("change",(function(t){var i;e.el.multiple?(i=e.getSelectedProperties("idx"),i=function(e,t){for(var i,n=[],r=e.slice(0),o=0;o<t.length;o++)-1<(i=r.indexOf(t[o]))?r.splice(i,1):n.push(t[o]);return[n,r]}(e.selectedIndexes,i),n.each(i[0],(function(t,i){e.select(i)}),e),n.each(i[1],(function(t,i){e.deselect(i)}),e)):-1<e.el.selectedIndex&&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(),t.stopPropagation()})),this.label.addEventListener("click",(function(t){n.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){t.preventDefault(),t.stopPropagation(),(t=n.closest(t.target,(function(e){return e&&n.hasClass(e,"selectr-option")})))&&!n.hasClass(t,"disabled")&&(n.hasClass(t,"selected")?(e.el.multiple||!e.el.multiple&&e.config.allowDeselect)&&e.deselect(t.idx):e.select(t.idx),e.opened&&!e.el.multiple&&e.close())})),this.tree.addEventListener("mouseover",(function(t){!n.hasClass(t.target,"selectr-option")||n.hasClass(t.target,"disabled")||(n.removeClass(e.items[e.navIndex],"active"),n.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?n.addClass(this.parentNode,"active"):n.removeClass(this.parentNode,"active"))})),this.inputClear.addEventListener("click",(function(t){e.input.value=null,c.call(e),e.tree.childElementCount||s.call(e)}))),this.config.taggable&&this.input.addEventListener("keyup",(function(t){var i;e.search(),e.config.taggable&&this.value.length&&(i=this.value.trim(),13!==t.which&&!n.includes(e.tagSeperators,t.key)||(n.each(e.tagSeperators,(function(e,t){i=i.replace(t,"")})),e.add({value:i,text:i,selected:!0},!0)?(e.close(),c.call(e)):(this.value="",e.setMessage("That tag is already in use."))))})),this.update=n.debounce((function(){e.opened&&e.config.closeOnScroll&&e.close(),e.width&&(e.container.style.width=e.width),e.invert()}),50),this.requiresPagination&&(this.paginateItems=n.debounce((function(){l.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.el.form&&this.el.form.addEventListener("reset",this.events.reset)},h.prototype.setSelected=function(e){var t;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,-1<this.selectedIndex&&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),n.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.select(0),t=0,n.each(this.config.data,(function(e,i){r(i,"children")?n.each(i.children,(function(e,i){i.hasOwnProperty("selected")&&!0===i.selected&&this.select(t),t++}),this):(i.hasOwnProperty("selected")&&!0===i.selected&&this.select(t),t++)}),this))},h.prototype.destroy=function(){this.rendered&&(this.emit("selectr.destroy"),"select-one"===this.originalType&&(this.el.multiple=!1),this.config.data&&(this.el.textContent=""),n.removeClass(this.el,"selectr-hidden"),this.el.form&&n.off(this.el.form,"reset",this.events.reset),n.off(document,"click",this.events.dismiss),n.off(document,"keydown",this.events.navigate),n.off(window,"resize",this.update),n.off(window,"scroll",this.update),this.container.parentNode.replaceChild(this.el,this.container),this.rendered=!1)},h.prototype.change=function(e){var t=this.items[e],i=this.options[e];i.disabled||(i.selected&&n.hasClass(t,"selected")?this.deselect(e):this.select(e),this.opened&&!this.el.multiple&&this.close())},h.prototype.select=function(e){var t=this.items[e],i=[].slice.call(this.el.options),r=this.options[e];if(this.el.multiple){if(n.includes(this.selectedIndexes,e))return!1;if(this.config.maxSelections&&this.tags.length===this.config.maxSelections)return this.setMessage("A maximum of "+this.config.maxSelections+" items can be selected.",!0),!1;this.selectedValues.push(r.value),this.selectedIndexes.push(e),function(e){var t,i=this,r=document.createDocumentFragment(),o=this.options[e.idx],s=this.data?this.data[e.idx]:o,a=(s=this.customSelected?this.config.renderSelection(s):o.textContent,s=n.createElement("li",{class:"selectr-tag",html:s}),n.createElement("button",{class:"selectr-tag-remove",type:"button"}));s.appendChild(a),s.idx=e.idx,s.tag=o.value,this.tags.push(s),this.config.sortSelected?(a=this.tags.slice(),t=function(e,t){e.replace(/(\d+)|(\D+)/g,(function(e,i,n){t.push([i||1/0,n||""])}))},a.sort((function(e,n){var r,o,s=[],a=[];for(!0===i.config.sortSelected?(r=e.tag,o=n.tag):"text"===i.config.sortSelected&&(r=e.textContent,o=n.textContent),t(r,s),t(o,a);s.length&&a.length;){var l=s.shift(),c=a.shift();if(l=l[0]-c[0]||l[1].localeCompare(c[1]))return l}return s.length-a.length})),n.each(a,(function(e,t){r.appendChild(t)})),this.label.textContent=""):r.appendChild(s),this.config.taggable?this.label.insertBefore(r,this.input.parentNode):this.label.appendChild(r)}.call(this,t)}else{var o=this.data?this.data[e]:r;this.label.textContent=this.customSelected?this.config.renderSelection(o):r.textContent,this.selectedValue=r.value,this.selectedIndex=e,n.each(this.options,(function(t,i){var r=this.items[t];t!==e&&(r&&n.removeClass(r,"selected"),i.selected=!1,i.removeAttribute("selected"))}),this)}n.includes(i,r)||this.el.add(r),t.setAttribute("aria-selected",!0),n.addClass(t,"selected"),n.addClass(this.container,"has-selected"),r.selected=!0,r.setAttribute("selected",""),this.emit("selectr.change",r),this.emit("selectr.select",r)},h.prototype.deselect=function(e,t){var i=this.items[e],r=this.options[e];if(this.el.multiple){var o=this.selectedIndexes.indexOf(e);o=(this.selectedIndexes.splice(o,1),this.selectedValues.indexOf(r.value));this.selectedValues.splice(o,1),function(e){var t=!1;n.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))}.call(this,i),this.tags.length||n.removeClass(this.container,"has-selected")}else{if(!t&&!this.config.clearable&&!this.config.allowDeselect)return!1;this.label.textContent="",this.selectedValue=null,this.el.selectedIndex=this.selectedIndex=-1,n.removeClass(this.container,"has-selected")}this.items[e].setAttribute("aria-selected",!1),n.removeClass(this.items[e],"selected"),r.selected=!1,r.removeAttribute("selected"),this.emit("selectr.change",null),this.emit("selectr.deselect",r)},h.prototype.setValue=function(e){var t=Array.isArray(e);if(t||(e=e.toString().trim()),!this.el.multiple&&t)return!1;n.each(this.options,(function(i,r){(t&&n.includes(e.toString(),r.value)||r.value===e)&&this.change(r.idx)}),this)},h.prototype.getValue=function(e,t){var i,r;return this.el.multiple?e?this.selectedIndexes.length&&(r={values:[]},n.each(this.selectedIndexes,(function(e,t){t=this.options[t],r.values[e]={value:t.value,text:t.textContent}}),this)):r=this.selectedValues.slice():r=e?{value:(i=this.options[this.selectedIndex]).value,text:i.textContent}:this.selectedValue,r=e&&t?JSON.stringify(r):r},h.prototype.add=function(e,t){if(e){if(this.data=this.data||[],this.items=this.items||[],this.options=this.options||[],Array.isArray(e))n.each(e,(function(e,i){this.add(i,t)}),this);else if("[object Object]"===Object.prototype.toString.call(e)){if(t){var i=!1;if(n.each(this.options,(function(t,n){n.value.toLowerCase()===e.value.toLowerCase()&&(i=!0)})),i)return!1}var r=n.createElement("option",e);return this.data.push(e),this.options.push(r),r.idx=0<this.options.length?this.options.length-1:0,a.call(this,r),e.selected&&this.select(r.idx),r}return this.setPlaceholder(),this.config.pagination&&this.paginate(),!0}},h.prototype.remove=function(e){var t,i=[];Array.isArray(e)?n.each(e,(function(t,r){n.isInt(r)?i.push(this.getOptionByIndex(r)):"string"==typeof e&&i.push(this.getOptionByValue(r))}),this):n.isInt(e)?i.push(this.getOptionByIndex(e)):"string"==typeof e&&i.push(this.getOptionByValue(e)),i.length&&(n.each(i,(function(e,i){t=i.idx,this.el.remove(i),this.options.splice(t,1),(i=this.items[t].parentNode)&&i.removeChild(this.items[t]),this.items.splice(t,1),n.each(this.options,(function(e,t){t.idx=e,this.items[e].idx=e}),this)}),this),this.setPlaceholder(),this.config.pagination&&this.paginate())},h.prototype.removeAll=function(){this.clear(!0),n.each(this.el.options,(function(e,t){this.el.remove(t)}),this),n.truncate(this.tree),this.items=[],this.options=[],this.data=[],this.navIndex=0,this.requiresPagination&&(this.requiresPagination=!1,this.pageIndex=1,this.pages=[]),this.setPlaceholder()},h.prototype.search=function(e){var t,i,r;this.navigating||(e=e||this.input.value,t=document.createDocumentFragment(),this.removeMessage(),n.truncate(this.tree),1<e.length?(n.each(this.options,(function(i,r){var s,a,l=this.items[r.idx];n.includes(r.textContent.toLowerCase(),e.toLowerCase())&&!r.disabled?(o(l,t,this.customOption),n.removeClass(l,"excluded"),this.customOption||(l.textContent="",s=e,r=r.textContent,(a=(s=new RegExp(s,"i").exec(r))?(a=s.index,s=s.index+s[0].length,{before:r.substring(0,a),match:r.substring(a,s),after:r.substring(s)}):null)&&(l.appendChild(document.createTextNode(a.before)),(r=document.createElement("span")).className="selectr-match",r.appendChild(document.createTextNode(a.match)),l.appendChild(r),l.appendChild(document.createTextNode(a.after))))):n.addClass(l,"excluded")}),this),t.childElementCount?(i=this.items[this.navIndex],r=t.firstElementChild,n.removeClass(i,"active"),this.navIndex=r.idx,n.addClass(r,"active")):this.config.taggable||this.setMessage("no results.")):s.call(this),this.tree.appendChild(t))},h.prototype.toggle=function(){this.disabled||(this.opened?this.close():this.open())},h.prototype.open=function(){var e=this;return!!this.options.length&&(this.opened||this.emit("selectr.open"),this.opened=!0,this.mobileDevice||this.config.nativeDropdown?(n.addClass(this.container,"native-open"),void(this.config.data&&n.each(this.options,(function(e,t){this.el.add(t)}),this))):(n.addClass(this.container,"open"),s.call(this),this.invert(),this.tree.scrollTop=0,n.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))))},h.prototype.close=function(){var e;this.opened&&this.emit("selectr.close"),this.opened=!1,this.mobileDevice||this.config.nativeDropdown?n.removeClass(this.container,"native-open"):(e=n.hasClass(this.container,"notice"),this.config.searchable&&!e&&(this.input.blur(),this.input.tabIndex=-1,this.searching=!1),e&&(n.removeClass(this.container,"notice"),this.notice.textContent=""),n.removeClass(this.container,"open"),n.removeClass(this.container,"native-open"),this.selected.setAttribute("aria-expanded",!1),this.tree.setAttribute("aria-hidden",!0),this.tree.setAttribute("aria-expanded",!1),n.truncate(this.tree),c.call(this))},h.prototype.enable=function(){this.disabled=!1,this.el.disabled=!1,this.selected.tabIndex=this.originalIndex,this.el.multiple&&n.each(this.tags,(function(e,t){t.lastElementChild.tabIndex=0})),n.removeClass(this.container,"selectr-disabled")},h.prototype.disable=function(e){e||(this.el.disabled=!0),this.selected.tabIndex=-1,this.el.multiple&&n.each(this.tags,(function(e,t){t.lastElementChild.tabIndex=-1})),this.disabled=!0,n.addClass(this.container,"selectr-disabled")},h.prototype.reset=function(){this.disabled||(this.clear(),this.setSelected(!0),n.each(this.defaultSelected,(function(e,t){this.select(t)}),this),this.emit("selectr.reset"))},h.prototype.clear=function(e){var t;this.el.multiple?this.selectedIndexes.length&&(t=this.selectedIndexes.slice(),n.each(t,(function(e,t){this.deselect(t)}),this)):-1<this.selectedIndex&&this.deselect(this.selectedIndex,e),this.emit("selectr.clear")},h.prototype.serialise=function(e){var t=[];return n.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},h.prototype.serialize=function(e){return this.serialise(e)},h.prototype.setPlaceholder=function(e){e=e||this.config.placeholder||this.el.getAttribute("placeholder"),this.options.length||(e="No options available"),this.placeEl.textContent=e},h.prototype.paginate=function(){var e;if(this.items.length)return(e=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},h.prototype.setMessage=function(e,t){t&&this.close(),n.addClass(this.container,"notice"),this.notice.textContent=e},h.prototype.removeMessage=function(){n.removeClass(this.container,"notice"),this.notice.textContent=""},h.prototype.invert=function(){var e=n.rect(this.selected),t=this.tree.parentNode.offsetHeight,i=window.innerHeight;e.top+e.height+t>i?(n.addClass(this.container,"inverted"),this.isInverted=!0):(n.removeClass(this.container,"inverted"),this.isInverted=!1),this.optsRect=n.rect(this.tree)},h.prototype.getOptionByIndex=function(e){return this.options[e]},h.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=h},4188:function(e,t,i){"use strict";i.d(t,{EX:function(){return r},WF:function(){return o},oW:function(){return s},qD:function(){return n}});var n=document.body,r=10485760,o=2e4,s=2147483648},2602:function(e,t,i){"use strict";i.d(t,{w:function(){return r}});var n=i(9791);function r(e,t,i){var r,o=3<arguments.length&&void 0!==arguments[3]&&arguments[3],s="function"==typeof(l=e).getRootNode?l.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)r=t,Object.prototype.hasOwnProperty.call(a,r)&&((r=a[t])&&(0,n.removeEventListener)(s,t,r),delete a[t]);"function"==typeof i&&i(e)}var r}function u(e){(e=e.target)===h||(0,n.isChildOf)(e,h)||d()}return 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),o&&(r=null,h.onmouseover=function(){clearTimeout(r),r=null},h.onmouseout=function(){r=r||setTimeout(d,200)}),h.destroy=d,h}},7923:function(e){e.exports="data:application/javascript;base64,Im5vIHVzZSBzdHJpY3QiOwohKGZ1bmN0aW9uKHdpbmRvdykgewppZiAodHlwZW9mIHdpbmRvdy53aW5kb3cgIT0gInVuZGVmaW5lZCIgJiYgd2luZG93LmRvY3VtZW50KQogICAgcmV0dXJuOwppZiAod2luZG93LnJlcXVpcmUgJiYgd2luZG93LmRlZmluZSkKICAgIHJldHVybjsKCmlmICghd2luZG93LmNvbnNvbGUpIHsKICAgIHdpbmRvdy5jb25zb2xlID0gZnVuY3Rpb24oKSB7CiAgICAgICAgdmFyIG1zZ3MgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDApOwogICAgICAgIHBvc3RNZXNzYWdlKHt0eXBlOiAibG9nIiwgZGF0YTogbXNnc30pOwogICAgfTsKICAgIHdpbmRvdy5jb25zb2xlLmVycm9yID0KICAgIHdpbmRvdy5jb25zb2xlLndhcm4gPSAKICAgIHdpbmRvdy5jb25zb2xlLmxvZyA9CiAgICB3aW5kb3cuY29uc29sZS50cmFjZSA9IHdpbmRvdy5jb25zb2xlOwp9CndpbmRvdy53aW5kb3cgPSB3aW5kb3c7CndpbmRvdy5hY2UgPSB3aW5kb3c7Cgp3aW5kb3cub25lcnJvciA9IGZ1bmN0aW9uKG1lc3NhZ2UsIGZpbGUsIGxpbmUsIGNvbCwgZXJyKSB7CiAgICBwb3N0TWVzc2FnZSh7dHlwZTogImVycm9yIiwgZGF0YTogewogICAgICAgIG1lc3NhZ2U6IG1lc3NhZ2UsCiAgICAgICAgZGF0YTogZXJyLmRhdGEsCiAgICAgICAgZmlsZTogZmlsZSwKICAgICAgICBsaW5lOiBsaW5lLCAKICAgICAgICBjb2w6IGNvbCwKICAgICAgICBzdGFjazogZXJyLnN0YWNrCiAgICB9fSk7Cn07Cgp3aW5kb3cubm9ybWFsaXplTW9kdWxlID0gZnVuY3Rpb24ocGFyZW50SWQsIG1vZHVsZU5hbWUpIHsKICAgIC8vIG5vcm1hbGl6ZSBwbHVnaW4gcmVxdWlyZXMKICAgIGlmIChtb2R1bGVOYW1lLmluZGV4T2YoIiEiKSAhPT0gLTEpIHsKICAgICAgICB2YXIgY2h1bmtzID0gbW9kdWxlTmFtZS5zcGxpdCgiISIpOwogICAgICAgIHJldHVybiB3aW5kb3cubm9ybWFsaXplTW9kdWxlKHBhcmVudElkLCBjaHVua3NbMF0pICsgIiEiICsgd2luZG93Lm5vcm1hbGl6ZU1vZHVsZShwYXJlbnRJZCwgY2h1bmtzWzFdKTsKICAgIH0KICAgIC8vIG5vcm1hbGl6ZSByZWxhdGl2ZSByZXF1aXJlcwogICAgaWYgKG1vZHVsZU5hbWUuY2hhckF0KDApID09ICIuIikgewogICAgICAgIHZhciBiYXNlID0gcGFyZW50SWQuc3BsaXQoIi8iKS5zbGljZSgwLCAtMSkuam9pbigiLyIpOwogICAgICAgIG1vZHVsZU5hbWUgPSAoYmFzZSA/IGJhc2UgKyAiLyIgOiAiIikgKyBtb2R1bGVOYW1lOwogICAgICAgIAogICAgICAgIHdoaWxlIChtb2R1bGVOYW1lLmluZGV4T2YoIi4iKSAhPT0gLTEgJiYgcHJldmlvdXMgIT0gbW9kdWxlTmFtZSkgewogICAgICAgICAgICB2YXIgcHJldmlvdXMgPSBtb2R1bGVOYW1lOwogICAgICAgICAgICBtb2R1bGVOYW1lID0gbW9kdWxlTmFtZS5yZXBsYWNlKC9eXC5cLy8sICIiKS5yZXBsYWNlKC9cL1wuXC8vLCAiLyIpLnJlcGxhY2UoL1teXC9dK1wvXC5cLlwvLywgIiIpOwogICAgICAgIH0KICAgIH0KICAgIAogICAgcmV0dXJuIG1vZHVsZU5hbWU7Cn07Cgp3aW5kb3cucmVxdWlyZSA9IGZ1bmN0aW9uIHJlcXVpcmUocGFyZW50SWQsIGlkKSB7CiAgICBpZiAoIWlkKSB7CiAgICAgICAgaWQgPSBwYXJlbnRJZDsKICAgICAgICBwYXJlbnRJZCA9IG51bGw7CiAgICB9CiAgICBpZiAoIWlkLmNoYXJBdCkKICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIndvcmtlci5qcyByZXF1aXJlKCkgYWNjZXB0cyBvbmx5IChwYXJlbnRJZCwgaWQpIGFzIGFyZ3VtZW50cyIpOwoKICAgIGlkID0gd2luZG93Lm5vcm1hbGl6ZU1vZHVsZShwYXJlbnRJZCwgaWQpOwoKICAgIHZhciBtb2R1bGUgPSB3aW5kb3cucmVxdWlyZS5tb2R1bGVzW2lkXTsKICAgIGlmIChtb2R1bGUpIHsKICAgICAgICBpZiAoIW1vZHVsZS5pbml0aWFsaXplZCkgewogICAgICAgICAgICBtb2R1bGUuaW5pdGlhbGl6ZWQgPSB0cnVlOwogICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IG1vZHVsZS5mYWN0b3J5KCkuZXhwb3J0czsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIG1vZHVsZS5leHBvcnRzOwogICAgfQogICAKICAgIGlmICghd2luZG93LnJlcXVpcmUudGxucykKICAgICAgICByZXR1cm4gY29uc29sZS5sb2coInVuYWJsZSB0byBsb2FkICIgKyBpZCk7CiAgICAKICAgIHZhciBwYXRoID0gcmVzb2x2ZU1vZHVsZUlkKGlkLCB3aW5kb3cucmVxdWlyZS50bG5zKTsKICAgIGlmIChwYXRoLnNsaWNlKC0zKSAhPSAiLmpzIikgcGF0aCArPSAiLmpzIjsKICAgIAogICAgd2luZG93LnJlcXVpcmUuaWQgPSBpZDsKICAgIHdpbmRvdy5yZXF1aXJlLm1vZHVsZXNbaWRdID0ge307IC8vIHByZXZlbnQgaW5maW5pdGUgbG9vcCBvbiBicm9rZW4gbW9kdWxlcwogICAgaW1wb3J0U2NyaXB0cyhwYXRoKTsKICAgIHJldHVybiB3aW5kb3cucmVxdWlyZShwYXJlbnRJZCwgaWQpOwp9OwpmdW5jdGlvbiByZXNvbHZlTW9kdWxlSWQoaWQsIHBhdGhzKSB7CiAgICB2YXIgdGVzdFBhdGggPSBpZCwgdGFpbCA9ICIiOwogICAgd2hpbGUgKHRlc3RQYXRoKSB7CiAgICAgICAgdmFyIGFsaWFzID0gcGF0aHNbdGVzdFBhdGhdOwogICAgICAgIGlmICh0eXBlb2YgYWxpYXMgPT0gInN0cmluZyIpIHsKICAgICAgICAgICAgcmV0dXJuIGFsaWFzICsgdGFpbDsKICAgICAgICB9IGVsc2UgaWYgKGFsaWFzKSB7CiAgICAgICAgICAgIHJldHVybiAgYWxpYXMubG9jYXRpb24ucmVwbGFjZSgvXC8qJC8sICIvIikgKyAodGFpbCB8fCBhbGlhcy5tYWluIHx8IGFsaWFzLm5hbWUpOwogICAgICAgIH0gZWxzZSBpZiAoYWxpYXMgPT09IGZhbHNlKSB7CiAgICAgICAgICAgIHJldHVybiAiIjsKICAgICAgICB9CiAgICAgICAgdmFyIGkgPSB0ZXN0UGF0aC5sYXN0SW5kZXhPZigiLyIpOwogICAgICAgIGlmIChpID09PSAtMSkgYnJlYWs7CiAgICAgICAgdGFpbCA9IHRlc3RQYXRoLnN1YnN0cihpKSArIHRhaWw7CiAgICAgICAgdGVzdFBhdGggPSB0ZXN0UGF0aC5zbGljZSgwLCBpKTsKICAgIH0KICAgIHJldHVybiBpZDsKfQp3aW5kb3cucmVxdWlyZS5tb2R1bGVzID0ge307CndpbmRvdy5yZXF1aXJlLnRsbnMgPSB7fTsKCndpbmRvdy5kZWZpbmUgPSBmdW5jdGlvbihpZCwgZGVwcywgZmFjdG9yeSkgewogICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT0gMikgewogICAgICAgIGZhY3RvcnkgPSBkZXBzOwogICAgICAgIGlmICh0eXBlb2YgaWQgIT0gInN0cmluZyIpIHsKICAgICAgICAgICAgZGVwcyA9IGlkOwogICAgICAgICAgICBpZCA9IHdpbmRvdy5yZXF1aXJlLmlkOwogICAgICAgIH0KICAgIH0gZWxzZSBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PSAxKSB7CiAgICAgICAgZmFjdG9yeSA9IGlkOwogICAgICAgIGRlcHMgPSBbXTsKICAgICAgICBpZCA9IHdpbmRvdy5yZXF1aXJlLmlkOwogICAgfQogICAgCiAgICBpZiAodHlwZW9mIGZhY3RvcnkgIT0gImZ1bmN0aW9uIikgewogICAgICAgIHdpbmRvdy5yZXF1aXJlLm1vZHVsZXNbaWRdID0gewogICAgICAgICAgICBleHBvcnRzOiBmYWN0b3J5LAogICAgICAgICAgICBpbml0aWFsaXplZDogdHJ1ZQogICAgICAgIH07CiAgICAgICAgcmV0dXJuOwogICAgfQoKICAgIGlmICghZGVwcy5sZW5ndGgpCiAgICAgICAgLy8gSWYgdGhlcmUgaXMgbm8gZGVwZW5kZW5jaWVzLCB3ZSBpbmplY3QgInJlcXVpcmUiLCAiZXhwb3J0cyIgYW5kCiAgICAgICAgLy8gIm1vZHVsZSIgYXMgZGVwZW5kZW5jaWVzLCB0byBwcm92aWRlIENvbW1vbkpTIGNvbXBhdGliaWxpdHkuCiAgICAgICAgZGVwcyA9IFsicmVxdWlyZSIsICJleHBvcnRzIiwgIm1vZHVsZSJdOwoKICAgIHZhciByZXEgPSBmdW5jdGlvbihjaGlsZElkKSB7CiAgICAgICAgcmV0dXJuIHdpbmRvdy5yZXF1aXJlKGlkLCBjaGlsZElkKTsKICAgIH07CgogICAgd2luZG93LnJlcXVpcmUubW9kdWxlc1tpZF0gPSB7CiAgICAgICAgZXhwb3J0czoge30sCiAgICAgICAgZmFjdG9yeTogZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIHZhciBtb2R1bGUgPSB0aGlzOwogICAgICAgICAgICB2YXIgcmV0dXJuRXhwb3J0cyA9IGZhY3RvcnkuYXBwbHkodGhpcywgZGVwcy5zbGljZSgwLCBmYWN0b3J5Lmxlbmd0aCkubWFwKGZ1bmN0aW9uKGRlcCkgewogICAgICAgICAgICAgICAgc3dpdGNoIChkZXApIHsKICAgICAgICAgICAgICAgICAgICAvLyBCZWNhdXNlICJyZXF1aXJlIiwgImV4cG9ydHMiIGFuZCAibW9kdWxlIiBhcmVuJ3QgYWN0dWFsCiAgICAgICAgICAgICAgICAgICAgLy8gZGVwZW5kZW5jaWVzLCB3ZSBtdXN0IGhhbmRsZSB0aGVtIHNlcGVyYXRlbHkuCiAgICAgICAgICAgICAgICAgICAgY2FzZSAicmVxdWlyZSI6IHJldHVybiByZXE7CiAgICAgICAgICAgICAgICAgICAgY2FzZSAiZXhwb3J0cyI6IHJldHVybiBtb2R1bGUuZXhwb3J0czsKICAgICAgICAgICAgICAgICAgICBjYXNlICJtb2R1bGUiOiAgcmV0dXJuIG1vZHVsZTsKICAgICAgICAgICAgICAgICAgICAvLyBCdXQgZm9yIGFsbCBvdGhlciBkZXBlbmRlbmNpZXMsIHdlIGNhbiBqdXN0IGdvIGFoZWFkIGFuZAogICAgICAgICAgICAgICAgICAgIC8vIHJlcXVpcmUgdGhlbS4KICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OiAgICAgICAgcmV0dXJuIHJlcShkZXApOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KSk7CiAgICAgICAgICAgIGlmIChyZXR1cm5FeHBvcnRzKQogICAgICAgICAgICAgICAgbW9kdWxlLmV4cG9ydHMgPSByZXR1cm5FeHBvcnRzOwogICAgICAgICAgICByZXR1cm4gbW9kdWxlOwogICAgICAgIH0KICAgIH07Cn07CndpbmRvdy5kZWZpbmUuYW1kID0ge307CnJlcXVpcmUudGxucyA9IHt9Owp3aW5kb3cuaW5pdEJhc2VVcmxzICA9IGZ1bmN0aW9uIGluaXRCYXNlVXJscyh0b3BMZXZlbE5hbWVzcGFjZXMpIHsKICAgIGZvciAodmFyIGkgaW4gdG9wTGV2ZWxOYW1lc3BhY2VzKQogICAgICAgIHJlcXVpcmUudGxuc1tpXSA9IHRvcExldmVsTmFtZXNwYWNlc1tpXTsKfTsKCndpbmRvdy5pbml0U2VuZGVyID0gZnVuY3Rpb24gaW5pdFNlbmRlcigpIHsKCiAgICB2YXIgRXZlbnRFbWl0dGVyID0gd2luZG93LnJlcXVpcmUoImFjZS9saWIvZXZlbnRfZW1pdHRlciIpLkV2ZW50RW1pdHRlcjsKICAgIHZhciBvb3AgPSB3aW5kb3cucmVxdWlyZSgiYWNlL2xpYi9vb3AiKTsKICAgIAogICAgdmFyIFNlbmRlciA9IGZ1bmN0aW9uKCkge307CiAgICAKICAgIChmdW5jdGlvbigpIHsKICAgICAgICAKICAgICAgICBvb3AuaW1wbGVtZW50KHRoaXMsIEV2ZW50RW1pdHRlcik7CiAgICAgICAgICAgICAgICAKICAgICAgICB0aGlzLmNhbGxiYWNrID0gZnVuY3Rpb24oZGF0YSwgY2FsbGJhY2tJZCkgewogICAgICAgICAgICBwb3N0TWVzc2FnZSh7CiAgICAgICAgICAgICAgICB0eXBlOiAiY2FsbCIsCiAgICAgICAgICAgICAgICBpZDogY2FsbGJhY2tJZCwKICAgICAgICAgICAgICAgIGRhdGE6IGRhdGEKICAgICAgICAgICAgfSk7CiAgICAgICAgfTsKICAgIAogICAgICAgIHRoaXMuZW1pdCA9IGZ1bmN0aW9uKG5hbWUsIGRhdGEpIHsKICAgICAgICAgICAgcG9zdE1lc3NhZ2UoewogICAgICAgICAgICAgICAgdHlwZTogImV2ZW50IiwKICAgICAgICAgICAgICAgIG5hbWU6IG5hbWUsCiAgICAgICAgICAgICAgICBkYXRhOiBkYXRhCiAgICAgICAgICAgIH0pOwogICAgICAgIH07CiAgICAgICAgCiAgICB9KS5jYWxsKFNlbmRlci5wcm90b3R5cGUpOwogICAgCiAgICByZXR1cm4gbmV3IFNlbmRlcigpOwp9OwoKdmFyIG1haW4gPSB3aW5kb3cubWFpbiA9IG51bGw7CnZhciBzZW5kZXIgPSB3aW5kb3cuc2VuZGVyID0gbnVsbDsKCndpbmRvdy5vbm1lc3NhZ2UgPSBmdW5jdGlvbihlKSB7CiAgICB2YXIgbXNnID0gZS5kYXRhOwogICAgaWYgKG1zZy5ldmVudCAmJiBzZW5kZXIpIHsKICAgICAgICBzZW5kZXIuX3NpZ25hbChtc2cuZXZlbnQsIG1zZy5kYXRhKTsKICAgIH0KICAgIGVsc2UgaWYgKG1zZy5jb21tYW5kKSB7CiAgICAgICAgaWYgKG1haW5bbXNnLmNvbW1hbmRdKQogICAgICAgICAgICBtYWluW21zZy5jb21tYW5kXS5hcHBseShtYWluLCBtc2cuYXJncyk7CiAgICAgICAgZWxzZSBpZiAod2luZG93W21zZy5jb21tYW5kXSkKICAgICAgICAgICAgd2luZG93W21zZy5jb21tYW5kXS5hcHBseSh3aW5kb3csIG1zZy5hcmdzKTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcigiVW5rbm93biBjb21tYW5kOiIgKyBtc2cuY29tbWFuZCk7CiAgICB9CiAgICBlbHNlIGlmIChtc2cuaW5pdCkgewogICAgICAgIHdpbmRvdy5pbml0QmFzZVVybHMobXNnLnRsbnMpOwogICAgICAgIHNlbmRlciA9IHdpbmRvdy5zZW5kZXIgPSB3aW5kb3cuaW5pdFNlbmRlcigpOwogICAgICAgIHZhciBjbGF6eiA9IHJlcXVpcmUobXNnLm1vZHVsZSlbbXNnLmNsYXNzbmFtZV07CiAgICAgICAgbWFpbiA9IHdpbmRvdy5tYWluID0gbmV3IGNsYXp6KHNlbmRlcik7CiAgICB9Cn07Cn0pKHRoaXMpOwoKYWNlLmRlZmluZSgiYWNlL2xpYi9vb3AiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKZXhwb3J0cy5pbmhlcml0cyA9IGZ1bmN0aW9uKGN0b3IsIHN1cGVyQ3RvcikgewogICAgY3Rvci5zdXBlcl8gPSBzdXBlckN0b3I7CiAgICBjdG9yLnByb3RvdHlwZSA9IE9iamVjdC5jcmVhdGUoc3VwZXJDdG9yLnByb3RvdHlwZSwgewogICAgICAgIGNvbnN0cnVjdG9yOiB7CiAgICAgICAgICAgIHZhbHVlOiBjdG9yLAogICAgICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSwKICAgICAgICAgICAgd3JpdGFibGU6IHRydWUsCiAgICAgICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZQogICAgICAgIH0KICAgIH0pOwp9OwoKZXhwb3J0cy5taXhpbiA9IGZ1bmN0aW9uKG9iaiwgbWl4aW4pIHsKICAgIGZvciAodmFyIGtleSBpbiBtaXhpbikgewogICAgICAgIG9ialtrZXldID0gbWl4aW5ba2V5XTsKICAgIH0KICAgIHJldHVybiBvYmo7Cn07CgpleHBvcnRzLmltcGxlbWVudCA9IGZ1bmN0aW9uKHByb3RvLCBtaXhpbikgewogICAgZXhwb3J0cy5taXhpbihwcm90bywgbWl4aW4pOwp9OwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvcmFuZ2UiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwp2YXIgY29tcGFyZVBvaW50cyA9IGZ1bmN0aW9uKHAxLCBwMikgewogICAgcmV0dXJuIHAxLnJvdyAtIHAyLnJvdyB8fCBwMS5jb2x1bW4gLSBwMi5jb2x1bW47Cn07CnZhciBSYW5nZSA9IGZ1bmN0aW9uKHN0YXJ0Um93LCBzdGFydENvbHVtbiwgZW5kUm93LCBlbmRDb2x1bW4pIHsKICAgIHRoaXMuc3RhcnQgPSB7CiAgICAgICAgcm93OiBzdGFydFJvdywKICAgICAgICBjb2x1bW46IHN0YXJ0Q29sdW1uCiAgICB9OwoKICAgIHRoaXMuZW5kID0gewogICAgICAgIHJvdzogZW5kUm93LAogICAgICAgIGNvbHVtbjogZW5kQ29sdW1uCiAgICB9Owp9OwoKKGZ1bmN0aW9uKCkgewogICAgdGhpcy5pc0VxdWFsID0gZnVuY3Rpb24ocmFuZ2UpIHsKICAgICAgICByZXR1cm4gdGhpcy5zdGFydC5yb3cgPT09IHJhbmdlLnN0YXJ0LnJvdyAmJgogICAgICAgICAgICB0aGlzLmVuZC5yb3cgPT09IHJhbmdlLmVuZC5yb3cgJiYKICAgICAgICAgICAgdGhpcy5zdGFydC5jb2x1bW4gPT09IHJhbmdlLnN0YXJ0LmNvbHVtbiAmJgogICAgICAgICAgICB0aGlzLmVuZC5jb2x1bW4gPT09IHJhbmdlLmVuZC5jb2x1bW47CiAgICB9OwogICAgdGhpcy50b1N0cmluZyA9IGZ1bmN0aW9uKCkgewogICAgICAgIHJldHVybiAoIlJhbmdlOiBbIiArIHRoaXMuc3RhcnQucm93ICsgIi8iICsgdGhpcy5zdGFydC5jb2x1bW4gKwogICAgICAgICAgICAiXSAtPiBbIiArIHRoaXMuZW5kLnJvdyArICIvIiArIHRoaXMuZW5kLmNvbHVtbiArICJdIik7CiAgICB9OwoKICAgIHRoaXMuY29udGFpbnMgPSBmdW5jdGlvbihyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pID09IDA7CiAgICB9OwogICAgdGhpcy5jb21wYXJlUmFuZ2UgPSBmdW5jdGlvbihyYW5nZSkgewogICAgICAgIHZhciBjbXAsCiAgICAgICAgICAgIGVuZCA9IHJhbmdlLmVuZCwKICAgICAgICAgICAgc3RhcnQgPSByYW5nZS5zdGFydDsKCiAgICAgICAgY21wID0gdGhpcy5jb21wYXJlKGVuZC5yb3csIGVuZC5jb2x1bW4pOwogICAgICAgIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICBjbXAgPSB0aGlzLmNvbXBhcmUoc3RhcnQucm93LCBzdGFydC5jb2x1bW4pOwogICAgICAgICAgICBpZiAoY21wID09IDEpIHsKICAgICAgICAgICAgICAgIHJldHVybiAyOwogICAgICAgICAgICB9IGVsc2UgaWYgKGNtcCA9PSAwKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gMTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgICAgICB9CiAgICAgICAgfSBlbHNlIGlmIChjbXAgPT0gLTEpIHsKICAgICAgICAgICAgcmV0dXJuIC0yOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGNtcCA9IHRoaXMuY29tcGFyZShzdGFydC5yb3csIHN0YXJ0LmNvbHVtbik7CiAgICAgICAgICAgIGlmIChjbXAgPT0gLTEpIHsKICAgICAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICAgICAgfSBlbHNlIGlmIChjbXAgPT0gMSkgewogICAgICAgICAgICAgICAgcmV0dXJuIDQyOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jb21wYXJlUG9pbnQgPSBmdW5jdGlvbihwKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZShwLnJvdywgcC5jb2x1bW4pOwogICAgfTsKICAgIHRoaXMuY29udGFpbnNSYW5nZSA9IGZ1bmN0aW9uKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuY29tcGFyZVBvaW50KHJhbmdlLnN0YXJ0KSA9PSAwICYmIHRoaXMuY29tcGFyZVBvaW50KHJhbmdlLmVuZCkgPT0gMDsKICAgIH07CiAgICB0aGlzLmludGVyc2VjdHMgPSBmdW5jdGlvbihyYW5nZSkgewogICAgICAgIHZhciBjbXAgPSB0aGlzLmNvbXBhcmVSYW5nZShyYW5nZSk7CiAgICAgICAgcmV0dXJuIChjbXAgPT0gLTEgfHwgY21wID09IDAgfHwgY21wID09IDEpOwogICAgfTsKICAgIHRoaXMuaXNFbmQgPSBmdW5jdGlvbihyb3csIGNvbHVtbikgewogICAgICAgIHJldHVybiB0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW47CiAgICB9OwogICAgdGhpcy5pc1N0YXJ0ID0gZnVuY3Rpb24ocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4gdGhpcy5zdGFydC5yb3cgPT0gcm93ICYmIHRoaXMuc3RhcnQuY29sdW1uID09IGNvbHVtbjsKICAgIH07CiAgICB0aGlzLnNldFN0YXJ0ID0gZnVuY3Rpb24ocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLnN0YXJ0LmNvbHVtbiA9IHJvdy5jb2x1bW47CiAgICAgICAgICAgIHRoaXMuc3RhcnQucm93ID0gcm93LnJvdzsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICB0aGlzLnN0YXJ0LnJvdyA9IHJvdzsKICAgICAgICAgICAgdGhpcy5zdGFydC5jb2x1bW4gPSBjb2x1bW47CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuc2V0RW5kID0gZnVuY3Rpb24ocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodHlwZW9mIHJvdyA9PSAib2JqZWN0IikgewogICAgICAgICAgICB0aGlzLmVuZC5jb2x1bW4gPSByb3cuY29sdW1uOwogICAgICAgICAgICB0aGlzLmVuZC5yb3cgPSByb3cucm93OwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHRoaXMuZW5kLnJvdyA9IHJvdzsKICAgICAgICAgICAgdGhpcy5lbmQuY29sdW1uID0gY29sdW1uOwogICAgICAgIH0KICAgIH07CiAgICB0aGlzLmluc2lkZSA9IGZ1bmN0aW9uKHJvdywgY29sdW1uKSB7CiAgICAgICAgaWYgKHRoaXMuY29tcGFyZShyb3csIGNvbHVtbikgPT0gMCkgewogICAgICAgICAgICBpZiAodGhpcy5pc0VuZChyb3csIGNvbHVtbikgfHwgdGhpcy5pc1N0YXJ0KHJvdywgY29sdW1uKSkgewogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfTsKICAgIHRoaXMuaW5zaWRlU3RhcnQgPSBmdW5jdGlvbihyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pID09IDApIHsKICAgICAgICAgICAgaWYgKHRoaXMuaXNFbmQocm93LCBjb2x1bW4pKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9OwogICAgdGhpcy5pbnNpZGVFbmQgPSBmdW5jdGlvbihyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pID09IDApIHsKICAgICAgICAgICAgaWYgKHRoaXMuaXNTdGFydChyb3csIGNvbHVtbikpIHsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiBmYWxzZTsKICAgIH07CiAgICB0aGlzLmNvbXBhcmUgPSBmdW5jdGlvbihyb3csIGNvbHVtbikgewogICAgICAgIGlmICghdGhpcy5pc011bHRpTGluZSgpKSB7CiAgICAgICAgICAgIGlmIChyb3cgPT09IHRoaXMuc3RhcnQucm93KSB7CiAgICAgICAgICAgICAgICByZXR1cm4gY29sdW1uIDwgdGhpcy5zdGFydC5jb2x1bW4gPyAtMSA6IChjb2x1bW4gPiB0aGlzLmVuZC5jb2x1bW4gPyAxIDogMCk7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIGlmIChyb3cgPCB0aGlzLnN0YXJ0LnJvdykKICAgICAgICAgICAgcmV0dXJuIC0xOwoKICAgICAgICBpZiAocm93ID4gdGhpcy5lbmQucm93KQogICAgICAgICAgICByZXR1cm4gMTsKCiAgICAgICAgaWYgKHRoaXMuc3RhcnQucm93ID09PSByb3cpCiAgICAgICAgICAgIHJldHVybiBjb2x1bW4gPj0gdGhpcy5zdGFydC5jb2x1bW4gPyAwIDogLTE7CgogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT09IHJvdykKICAgICAgICAgICAgcmV0dXJuIGNvbHVtbiA8PSB0aGlzLmVuZC5jb2x1bW4gPyAwIDogMTsKCiAgICAgICAgcmV0dXJuIDA7CiAgICB9OwogICAgdGhpcy5jb21wYXJlU3RhcnQgPSBmdW5jdGlvbihyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLnN0YXJ0LnJvdyA9PSByb3cgJiYgdGhpcy5zdGFydC5jb2x1bW4gPT0gY29sdW1uKSB7CiAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlKHJvdywgY29sdW1uKTsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jb21wYXJlRW5kID0gZnVuY3Rpb24ocm93LCBjb2x1bW4pIHsKICAgICAgICBpZiAodGhpcy5lbmQucm93ID09IHJvdyAmJiB0aGlzLmVuZC5jb2x1bW4gPT0gY29sdW1uKSB7CiAgICAgICAgICAgIHJldHVybiAxOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJldHVybiB0aGlzLmNvbXBhcmUocm93LCBjb2x1bW4pOwogICAgICAgIH0KICAgIH07CiAgICB0aGlzLmNvbXBhcmVJbnNpZGUgPSBmdW5jdGlvbihyb3csIGNvbHVtbikgewogICAgICAgIGlmICh0aGlzLmVuZC5yb3cgPT0gcm93ICYmIHRoaXMuZW5kLmNvbHVtbiA9PSBjb2x1bW4pIHsKICAgICAgICAgICAgcmV0dXJuIDE7CiAgICAgICAgfSBlbHNlIGlmICh0aGlzLnN0YXJ0LnJvdyA9PSByb3cgJiYgdGhpcy5zdGFydC5jb2x1bW4gPT0gY29sdW1uKSB7CiAgICAgICAgICAgIHJldHVybiAtMTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICByZXR1cm4gdGhpcy5jb21wYXJlKHJvdywgY29sdW1uKTsKICAgICAgICB9CiAgICB9OwogICAgdGhpcy5jbGlwUm93cyA9IGZ1bmN0aW9uKGZpcnN0Um93LCBsYXN0Um93KSB7CiAgICAgICAgaWYgKHRoaXMuZW5kLnJvdyA+IGxhc3RSb3cpCiAgICAgICAgICAgIHZhciBlbmQgPSB7cm93OiBsYXN0Um93ICsgMSwgY29sdW1uOiAwfTsKICAgICAgICBlbHNlIGlmICh0aGlzLmVuZC5yb3cgPCBmaXJzdFJvdykKICAgICAgICAgICAgdmFyIGVuZCA9IHtyb3c6IGZpcnN0Um93LCBjb2x1bW46IDB9OwoKICAgICAgICBpZiAodGhpcy5zdGFydC5yb3cgPiBsYXN0Um93KQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7cm93OiBsYXN0Um93ICsgMSwgY29sdW1uOiAwfTsKICAgICAgICBlbHNlIGlmICh0aGlzLnN0YXJ0LnJvdyA8IGZpcnN0Um93KQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7cm93OiBmaXJzdFJvdywgY29sdW1uOiAwfTsKCiAgICAgICAgcmV0dXJuIFJhbmdlLmZyb21Qb2ludHMoc3RhcnQgfHwgdGhpcy5zdGFydCwgZW5kIHx8IHRoaXMuZW5kKTsKICAgIH07CiAgICB0aGlzLmV4dGVuZCA9IGZ1bmN0aW9uKHJvdywgY29sdW1uKSB7CiAgICAgICAgdmFyIGNtcCA9IHRoaXMuY29tcGFyZShyb3csIGNvbHVtbik7CgogICAgICAgIGlmIChjbXAgPT0gMCkKICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgZWxzZSBpZiAoY21wID09IC0xKQogICAgICAgICAgICB2YXIgc3RhcnQgPSB7cm93OiByb3csIGNvbHVtbjogY29sdW1ufTsKICAgICAgICBlbHNlCiAgICAgICAgICAgIHZhciBlbmQgPSB7cm93OiByb3csIGNvbHVtbjogY29sdW1ufTsKCiAgICAgICAgcmV0dXJuIFJhbmdlLmZyb21Qb2ludHMoc3RhcnQgfHwgdGhpcy5zdGFydCwgZW5kIHx8IHRoaXMuZW5kKTsKICAgIH07CgogICAgdGhpcy5pc0VtcHR5ID0gZnVuY3Rpb24oKSB7CiAgICAgICAgcmV0dXJuICh0aGlzLnN0YXJ0LnJvdyA9PT0gdGhpcy5lbmQucm93ICYmIHRoaXMuc3RhcnQuY29sdW1uID09PSB0aGlzLmVuZC5jb2x1bW4pOwogICAgfTsKICAgIHRoaXMuaXNNdWx0aUxpbmUgPSBmdW5jdGlvbigpIHsKICAgICAgICByZXR1cm4gKHRoaXMuc3RhcnQucm93ICE9PSB0aGlzLmVuZC5yb3cpOwogICAgfTsKICAgIHRoaXMuY2xvbmUgPSBmdW5jdGlvbigpIHsKICAgICAgICByZXR1cm4gUmFuZ2UuZnJvbVBvaW50cyh0aGlzLnN0YXJ0LCB0aGlzLmVuZCk7CiAgICB9OwogICAgdGhpcy5jb2xsYXBzZVJvd3MgPSBmdW5jdGlvbigpIHsKICAgICAgICBpZiAodGhpcy5lbmQuY29sdW1uID09IDApCiAgICAgICAgICAgIHJldHVybiBuZXcgUmFuZ2UodGhpcy5zdGFydC5yb3csIDAsIE1hdGgubWF4KHRoaXMuc3RhcnQucm93LCB0aGlzLmVuZC5yb3ctMSksIDApOwogICAgICAgIGVsc2UKICAgICAgICAgICAgcmV0dXJuIG5ldyBSYW5nZSh0aGlzLnN0YXJ0LnJvdywgMCwgdGhpcy5lbmQucm93LCAwKTsKICAgIH07CiAgICB0aGlzLnRvU2NyZWVuUmFuZ2UgPSBmdW5jdGlvbihzZXNzaW9uKSB7CiAgICAgICAgdmFyIHNjcmVlblBvc1N0YXJ0ID0gc2Vzc2lvbi5kb2N1bWVudFRvU2NyZWVuUG9zaXRpb24odGhpcy5zdGFydCk7CiAgICAgICAgdmFyIHNjcmVlblBvc0VuZCA9IHNlc3Npb24uZG9jdW1lbnRUb1NjcmVlblBvc2l0aW9uKHRoaXMuZW5kKTsKCiAgICAgICAgcmV0dXJuIG5ldyBSYW5nZSgKICAgICAgICAgICAgc2NyZWVuUG9zU3RhcnQucm93LCBzY3JlZW5Qb3NTdGFydC5jb2x1bW4sCiAgICAgICAgICAgIHNjcmVlblBvc0VuZC5yb3csIHNjcmVlblBvc0VuZC5jb2x1bW4KICAgICAgICApOwogICAgfTsKICAgIHRoaXMubW92ZUJ5ID0gZnVuY3Rpb24ocm93LCBjb2x1bW4pIHsKICAgICAgICB0aGlzLnN0YXJ0LnJvdyArPSByb3c7CiAgICAgICAgdGhpcy5zdGFydC5jb2x1bW4gKz0gY29sdW1uOwogICAgICAgIHRoaXMuZW5kLnJvdyArPSByb3c7CiAgICAgICAgdGhpcy5lbmQuY29sdW1uICs9IGNvbHVtbjsKICAgIH07Cgp9KS5jYWxsKFJhbmdlLnByb3RvdHlwZSk7ClJhbmdlLmZyb21Qb2ludHMgPSBmdW5jdGlvbihzdGFydCwgZW5kKSB7CiAgICByZXR1cm4gbmV3IFJhbmdlKHN0YXJ0LnJvdywgc3RhcnQuY29sdW1uLCBlbmQucm93LCBlbmQuY29sdW1uKTsKfTsKUmFuZ2UuY29tcGFyZVBvaW50cyA9IGNvbXBhcmVQb2ludHM7CgpSYW5nZS5jb21wYXJlUG9pbnRzID0gZnVuY3Rpb24ocDEsIHAyKSB7CiAgICByZXR1cm4gcDEucm93IC0gcDIucm93IHx8IHAxLmNvbHVtbiAtIHAyLmNvbHVtbjsKfTsKCgpleHBvcnRzLlJhbmdlID0gUmFuZ2U7Cn0pOwoKYWNlLmRlZmluZSgiYWNlL2FwcGx5X2RlbHRhIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKSB7CiJ1c2Ugc3RyaWN0IjsKCmZ1bmN0aW9uIHRocm93RGVsdGFFcnJvcihkZWx0YSwgZXJyb3JUZXh0KXsKICAgIGNvbnNvbGUubG9nKCJJbnZhbGlkIERlbHRhOiIsIGRlbHRhKTsKICAgIHRocm93ICJJbnZhbGlkIERlbHRhOiAiICsgZXJyb3JUZXh0Owp9CgpmdW5jdGlvbiBwb3NpdGlvbkluRG9jdW1lbnQoZG9jTGluZXMsIHBvc2l0aW9uKSB7CiAgICByZXR1cm4gcG9zaXRpb24ucm93ICAgID49IDAgJiYgcG9zaXRpb24ucm93ICAgIDwgIGRvY0xpbmVzLmxlbmd0aCAmJgogICAgICAgICAgIHBvc2l0aW9uLmNvbHVtbiA+PSAwICYmIHBvc2l0aW9uLmNvbHVtbiA8PSBkb2NMaW5lc1twb3NpdGlvbi5yb3ddLmxlbmd0aDsKfQoKZnVuY3Rpb24gdmFsaWRhdGVEZWx0YShkb2NMaW5lcywgZGVsdGEpIHsKICAgIGlmIChkZWx0YS5hY3Rpb24gIT0gImluc2VydCIgJiYgZGVsdGEuYWN0aW9uICE9ICJyZW1vdmUiKQogICAgICAgIHRocm93RGVsdGFFcnJvcihkZWx0YSwgImRlbHRhLmFjdGlvbiBtdXN0IGJlICdpbnNlcnQnIG9yICdyZW1vdmUnIik7CiAgICBpZiAoIShkZWx0YS5saW5lcyBpbnN0YW5jZW9mIEFycmF5KSkKICAgICAgICB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsICJkZWx0YS5saW5lcyBtdXN0IGJlIGFuIEFycmF5Iik7CiAgICBpZiAoIWRlbHRhLnN0YXJ0IHx8ICFkZWx0YS5lbmQpCiAgICAgICB0aHJvd0RlbHRhRXJyb3IoZGVsdGEsICJkZWx0YS5zdGFydC9lbmQgbXVzdCBiZSBhbiBwcmVzZW50Iik7CiAgICB2YXIgc3RhcnQgPSBkZWx0YS5zdGFydDsKICAgIGlmICghcG9zaXRpb25JbkRvY3VtZW50KGRvY0xpbmVzLCBkZWx0YS5zdGFydCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuc3RhcnQgbXVzdCBiZSBjb250YWluZWQgaW4gZG9jdW1lbnQiKTsKICAgIHZhciBlbmQgPSBkZWx0YS5lbmQ7CiAgICBpZiAoZGVsdGEuYWN0aW9uID09ICJyZW1vdmUiICYmICFwb3NpdGlvbkluRG9jdW1lbnQoZG9jTGluZXMsIGVuZCkpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEuZW5kIG11c3QgY29udGFpbmVkIGluIGRvY3VtZW50IGZvciAncmVtb3ZlJyBhY3Rpb25zIik7CiAgICB2YXIgbnVtUmFuZ2VSb3dzID0gZW5kLnJvdyAtIHN0YXJ0LnJvdzsKICAgIHZhciBudW1SYW5nZUxhc3RMaW5lQ2hhcnMgPSAoZW5kLmNvbHVtbiAtIChudW1SYW5nZVJvd3MgPT0gMCA/IHN0YXJ0LmNvbHVtbiA6IDApKTsKICAgIGlmIChudW1SYW5nZVJvd3MgIT0gZGVsdGEubGluZXMubGVuZ3RoIC0gMSB8fCBkZWx0YS5saW5lc1tudW1SYW5nZVJvd3NdLmxlbmd0aCAhPSBudW1SYW5nZUxhc3RMaW5lQ2hhcnMpCiAgICAgICAgdGhyb3dEZWx0YUVycm9yKGRlbHRhLCAiZGVsdGEucmFuZ2UgbXVzdCBtYXRjaCBkZWx0YSBsaW5lcyIpOwp9CgpleHBvcnRzLmFwcGx5RGVsdGEgPSBmdW5jdGlvbihkb2NMaW5lcywgZGVsdGEsIGRvTm90VmFsaWRhdGUpIHsKICAgIAogICAgdmFyIHJvdyA9IGRlbHRhLnN0YXJ0LnJvdzsKICAgIHZhciBzdGFydENvbHVtbiA9IGRlbHRhLnN0YXJ0LmNvbHVtbjsKICAgIHZhciBsaW5lID0gZG9jTGluZXNbcm93XSB8fCAiIjsKICAgIHN3aXRjaCAoZGVsdGEuYWN0aW9uKSB7CiAgICAgICAgY2FzZSAiaW5zZXJ0IjoKICAgICAgICAgICAgdmFyIGxpbmVzID0gZGVsdGEubGluZXM7CiAgICAgICAgICAgIGlmIChsaW5lcy5sZW5ndGggPT09IDEpIHsKICAgICAgICAgICAgICAgIGRvY0xpbmVzW3Jvd10gPSBsaW5lLnN1YnN0cmluZygwLCBzdGFydENvbHVtbikgKyBkZWx0YS5saW5lc1swXSArIGxpbmUuc3Vic3RyaW5nKHN0YXJ0Q29sdW1uKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHZhciBhcmdzID0gW3JvdywgMV0uY29uY2F0KGRlbHRhLmxpbmVzKTsKICAgICAgICAgICAgICAgIGRvY0xpbmVzLnNwbGljZS5hcHBseShkb2NMaW5lcywgYXJncyk7CiAgICAgICAgICAgICAgICBkb2NMaW5lc1tyb3ddID0gbGluZS5zdWJzdHJpbmcoMCwgc3RhcnRDb2x1bW4pICsgZG9jTGluZXNbcm93XTsKICAgICAgICAgICAgICAgIGRvY0xpbmVzW3JvdyArIGRlbHRhLmxpbmVzLmxlbmd0aCAtIDFdICs9IGxpbmUuc3Vic3RyaW5nKHN0YXJ0Q29sdW1uKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBicmVhazsKICAgICAgICBjYXNlICJyZW1vdmUiOgogICAgICAgICAgICB2YXIgZW5kQ29sdW1uID0gZGVsdGEuZW5kLmNvbHVtbjsKICAgICAgICAgICAgdmFyIGVuZFJvdyA9IGRlbHRhLmVuZC5yb3c7CiAgICAgICAgICAgIGlmIChyb3cgPT09IGVuZFJvdykgewogICAgICAgICAgICAgICAgZG9jTGluZXNbcm93XSA9IGxpbmUuc3Vic3RyaW5nKDAsIHN0YXJ0Q29sdW1uKSArIGxpbmUuc3Vic3RyaW5nKGVuZENvbHVtbik7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBkb2NMaW5lcy5zcGxpY2UoCiAgICAgICAgICAgICAgICAgICAgcm93LCBlbmRSb3cgLSByb3cgKyAxLAogICAgICAgICAgICAgICAgICAgIGxpbmUuc3Vic3RyaW5nKDAsIHN0YXJ0Q29sdW1uKSArIGRvY0xpbmVzW2VuZFJvd10uc3Vic3RyaW5nKGVuZENvbHVtbikKICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICB9Cn07Cn0pOwoKYWNlLmRlZmluZSgiYWNlL2xpYi9ldmVudF9lbWl0dGVyIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKSB7CiJ1c2Ugc3RyaWN0IjsKCnZhciBFdmVudEVtaXR0ZXIgPSB7fTsKdmFyIHN0b3BQcm9wYWdhdGlvbiA9IGZ1bmN0aW9uKCkgeyB0aGlzLnByb3BhZ2F0aW9uU3RvcHBlZCA9IHRydWU7IH07CnZhciBwcmV2ZW50RGVmYXVsdCA9IGZ1bmN0aW9uKCkgeyB0aGlzLmRlZmF1bHRQcmV2ZW50ZWQgPSB0cnVlOyB9OwoKRXZlbnRFbWl0dGVyLl9lbWl0ID0KRXZlbnRFbWl0dGVyLl9kaXNwYXRjaEV2ZW50ID0gZnVuY3Rpb24oZXZlbnROYW1lLCBlKSB7CiAgICB0aGlzLl9ldmVudFJlZ2lzdHJ5IHx8ICh0aGlzLl9ldmVudFJlZ2lzdHJ5ID0ge30pOwogICAgdGhpcy5fZGVmYXVsdEhhbmRsZXJzIHx8ICh0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB7fSk7CgogICAgdmFyIGxpc3RlbmVycyA9IHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXSB8fCBbXTsKICAgIHZhciBkZWZhdWx0SGFuZGxlciA9IHRoaXMuX2RlZmF1bHRIYW5kbGVyc1tldmVudE5hbWVdOwogICAgaWYgKCFsaXN0ZW5lcnMubGVuZ3RoICYmICFkZWZhdWx0SGFuZGxlcikKICAgICAgICByZXR1cm47CgogICAgaWYgKHR5cGVvZiBlICE9ICJvYmplY3QiIHx8ICFlKQogICAgICAgIGUgPSB7fTsKCiAgICBpZiAoIWUudHlwZSkKICAgICAgICBlLnR5cGUgPSBldmVudE5hbWU7CiAgICBpZiAoIWUuc3RvcFByb3BhZ2F0aW9uKQogICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uID0gc3RvcFByb3BhZ2F0aW9uOwogICAgaWYgKCFlLnByZXZlbnREZWZhdWx0KQogICAgICAgIGUucHJldmVudERlZmF1bHQgPSBwcmV2ZW50RGVmYXVsdDsKCiAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgIGZvciAodmFyIGk9MDsgaTxsaXN0ZW5lcnMubGVuZ3RoOyBpKyspIHsKICAgICAgICBsaXN0ZW5lcnNbaV0oZSwgdGhpcyk7CiAgICAgICAgaWYgKGUucHJvcGFnYXRpb25TdG9wcGVkKQogICAgICAgICAgICBicmVhazsKICAgIH0KICAgIAogICAgaWYgKGRlZmF1bHRIYW5kbGVyICYmICFlLmRlZmF1bHRQcmV2ZW50ZWQpCiAgICAgICAgcmV0dXJuIGRlZmF1bHRIYW5kbGVyKGUsIHRoaXMpOwp9OwoKCkV2ZW50RW1pdHRlci5fc2lnbmFsID0gZnVuY3Rpb24oZXZlbnROYW1lLCBlKSB7CiAgICB2YXIgbGlzdGVuZXJzID0gKHRoaXMuX2V2ZW50UmVnaXN0cnkgfHwge30pW2V2ZW50TmFtZV07CiAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICByZXR1cm47CiAgICBsaXN0ZW5lcnMgPSBsaXN0ZW5lcnMuc2xpY2UoKTsKICAgIGZvciAodmFyIGk9MDsgaTxsaXN0ZW5lcnMubGVuZ3RoOyBpKyspCiAgICAgICAgbGlzdGVuZXJzW2ldKGUsIHRoaXMpOwp9OwoKRXZlbnRFbWl0dGVyLm9uY2UgPSBmdW5jdGlvbihldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICB2YXIgX3NlbGYgPSB0aGlzOwogICAgdGhpcy5vbihldmVudE5hbWUsIGZ1bmN0aW9uIG5ld0NhbGxiYWNrKCkgewogICAgICAgIF9zZWxmLm9mZihldmVudE5hbWUsIG5ld0NhbGxiYWNrKTsKICAgICAgICBjYWxsYmFjay5hcHBseShudWxsLCBhcmd1bWVudHMpOwogICAgfSk7CiAgICBpZiAoIWNhbGxiYWNrKSB7CiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uKHJlc29sdmUpIHsKICAgICAgICAgICAgY2FsbGJhY2sgPSByZXNvbHZlOwogICAgICAgIH0pOwogICAgfQp9OwoKCkV2ZW50RW1pdHRlci5zZXREZWZhdWx0SGFuZGxlciA9IGZ1bmN0aW9uKGV2ZW50TmFtZSwgY2FsbGJhY2spIHsKICAgIHZhciBoYW5kbGVycyA9IHRoaXMuX2RlZmF1bHRIYW5kbGVyczsKICAgIGlmICghaGFuZGxlcnMpCiAgICAgICAgaGFuZGxlcnMgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnMgPSB7X2Rpc2FibGVkXzoge319OwogICAgCiAgICBpZiAoaGFuZGxlcnNbZXZlbnROYW1lXSkgewogICAgICAgIHZhciBvbGQgPSBoYW5kbGVyc1tldmVudE5hbWVdOwogICAgICAgIHZhciBkaXNhYmxlZCA9IGhhbmRsZXJzLl9kaXNhYmxlZF9bZXZlbnROYW1lXTsKICAgICAgICBpZiAoIWRpc2FibGVkKQogICAgICAgICAgICBoYW5kbGVycy5fZGlzYWJsZWRfW2V2ZW50TmFtZV0gPSBkaXNhYmxlZCA9IFtdOwogICAgICAgIGRpc2FibGVkLnB1c2gob2xkKTsKICAgICAgICB2YXIgaSA9IGRpc2FibGVkLmluZGV4T2YoY2FsbGJhY2spOwogICAgICAgIGlmIChpICE9IC0xKSAKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQogICAgaGFuZGxlcnNbZXZlbnROYW1lXSA9IGNhbGxiYWNrOwp9OwpFdmVudEVtaXR0ZXIucmVtb3ZlRGVmYXVsdEhhbmRsZXIgPSBmdW5jdGlvbihldmVudE5hbWUsIGNhbGxiYWNrKSB7CiAgICB2YXIgaGFuZGxlcnMgPSB0aGlzLl9kZWZhdWx0SGFuZGxlcnM7CiAgICBpZiAoIWhhbmRsZXJzKQogICAgICAgIHJldHVybjsKICAgIHZhciBkaXNhYmxlZCA9IGhhbmRsZXJzLl9kaXNhYmxlZF9bZXZlbnROYW1lXTsKICAgIAogICAgaWYgKGhhbmRsZXJzW2V2ZW50TmFtZV0gPT0gY2FsbGJhY2spIHsKICAgICAgICBpZiAoZGlzYWJsZWQpCiAgICAgICAgICAgIHRoaXMuc2V0RGVmYXVsdEhhbmRsZXIoZXZlbnROYW1lLCBkaXNhYmxlZC5wb3AoKSk7CiAgICB9IGVsc2UgaWYgKGRpc2FibGVkKSB7CiAgICAgICAgdmFyIGkgPSBkaXNhYmxlZC5pbmRleE9mKGNhbGxiYWNrKTsKICAgICAgICBpZiAoaSAhPSAtMSkKICAgICAgICAgICAgZGlzYWJsZWQuc3BsaWNlKGksIDEpOwogICAgfQp9OwoKRXZlbnRFbWl0dGVyLm9uID0KRXZlbnRFbWl0dGVyLmFkZEV2ZW50TGlzdGVuZXIgPSBmdW5jdGlvbihldmVudE5hbWUsIGNhbGxiYWNrLCBjYXB0dXJpbmcpIHsKICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9ldmVudFJlZ2lzdHJ5IHx8IHt9OwoKICAgIHZhciBsaXN0ZW5lcnMgPSB0aGlzLl9ldmVudFJlZ2lzdHJ5W2V2ZW50TmFtZV07CiAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICBsaXN0ZW5lcnMgPSB0aGlzLl9ldmVudFJlZ2lzdHJ5W2V2ZW50TmFtZV0gPSBbXTsKCiAgICBpZiAobGlzdGVuZXJzLmluZGV4T2YoY2FsbGJhY2spID09IC0xKQogICAgICAgIGxpc3RlbmVyc1tjYXB0dXJpbmcgPyAidW5zaGlmdCIgOiAicHVzaCJdKGNhbGxiYWNrKTsKICAgIHJldHVybiBjYWxsYmFjazsKfTsKCkV2ZW50RW1pdHRlci5vZmYgPQpFdmVudEVtaXR0ZXIucmVtb3ZlTGlzdGVuZXIgPQpFdmVudEVtaXR0ZXIucmVtb3ZlRXZlbnRMaXN0ZW5lciA9IGZ1bmN0aW9uKGV2ZW50TmFtZSwgY2FsbGJhY2spIHsKICAgIHRoaXMuX2V2ZW50UmVnaXN0cnkgPSB0aGlzLl9ldmVudFJlZ2lzdHJ5IHx8IHt9OwoKICAgIHZhciBsaXN0ZW5lcnMgPSB0aGlzLl9ldmVudFJlZ2lzdHJ5W2V2ZW50TmFtZV07CiAgICBpZiAoIWxpc3RlbmVycykKICAgICAgICByZXR1cm47CgogICAgdmFyIGluZGV4ID0gbGlzdGVuZXJzLmluZGV4T2YoY2FsbGJhY2spOwogICAgaWYgKGluZGV4ICE9PSAtMSkKICAgICAgICBsaXN0ZW5lcnMuc3BsaWNlKGluZGV4LCAxKTsKfTsKCkV2ZW50RW1pdHRlci5yZW1vdmVBbGxMaXN0ZW5lcnMgPSBmdW5jdGlvbihldmVudE5hbWUpIHsKICAgIGlmICghZXZlbnROYW1lKSB0aGlzLl9ldmVudFJlZ2lzdHJ5ID0gdGhpcy5fZGVmYXVsdEhhbmRsZXJzID0gdW5kZWZpbmVkOwogICAgaWYgKHRoaXMuX2V2ZW50UmVnaXN0cnkpIHRoaXMuX2V2ZW50UmVnaXN0cnlbZXZlbnROYW1lXSA9IHVuZGVmaW5lZDsKICAgIGlmICh0aGlzLl9kZWZhdWx0SGFuZGxlcnMpIHRoaXMuX2RlZmF1bHRIYW5kbGVyc1tldmVudE5hbWVdID0gdW5kZWZpbmVkOwp9OwoKZXhwb3J0cy5FdmVudEVtaXR0ZXIgPSBFdmVudEVtaXR0ZXI7Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9hbmNob3IiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKdmFyIG9vcCA9IHJlcXVpcmUoIi4vbGliL29vcCIpOwp2YXIgRXZlbnRFbWl0dGVyID0gcmVxdWlyZSgiLi9saWIvZXZlbnRfZW1pdHRlciIpLkV2ZW50RW1pdHRlcjsKCnZhciBBbmNob3IgPSBleHBvcnRzLkFuY2hvciA9IGZ1bmN0aW9uKGRvYywgcm93LCBjb2x1bW4pIHsKICAgIHRoaXMuJG9uQ2hhbmdlID0gdGhpcy5vbkNoYW5nZS5iaW5kKHRoaXMpOwogICAgdGhpcy5hdHRhY2goZG9jKTsKICAgIAogICAgaWYgKHR5cGVvZiBjb2x1bW4gPT0gInVuZGVmaW5lZCIpCiAgICAgICAgdGhpcy5zZXRQb3NpdGlvbihyb3cucm93LCByb3cuY29sdW1uKTsKICAgIGVsc2UKICAgICAgICB0aGlzLnNldFBvc2l0aW9uKHJvdywgY29sdW1uKTsKfTsKCihmdW5jdGlvbigpIHsKCiAgICBvb3AuaW1wbGVtZW50KHRoaXMsIEV2ZW50RW1pdHRlcik7CiAgICB0aGlzLmdldFBvc2l0aW9uID0gZnVuY3Rpb24oKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJGNsaXBQb3NpdGlvblRvRG9jdW1lbnQodGhpcy5yb3csIHRoaXMuY29sdW1uKTsKICAgIH07CiAgICB0aGlzLmdldERvY3VtZW50ID0gZnVuY3Rpb24oKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuZG9jdW1lbnQ7CiAgICB9OwogICAgdGhpcy4kaW5zZXJ0UmlnaHQgPSBmYWxzZTsKICAgIHRoaXMub25DaGFuZ2UgPSBmdW5jdGlvbihkZWx0YSkgewogICAgICAgIGlmIChkZWx0YS5zdGFydC5yb3cgPT0gZGVsdGEuZW5kLnJvdyAmJiBkZWx0YS5zdGFydC5yb3cgIT0gdGhpcy5yb3cpCiAgICAgICAgICAgIHJldHVybjsKCiAgICAgICAgaWYgKGRlbHRhLnN0YXJ0LnJvdyA+IHRoaXMucm93KQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIAogICAgICAgIHZhciBwb2ludCA9ICRnZXRUcmFuc2Zvcm1lZFBvaW50KGRlbHRhLCB7cm93OiB0aGlzLnJvdywgY29sdW1uOiB0aGlzLmNvbHVtbn0sIHRoaXMuJGluc2VydFJpZ2h0KTsKICAgICAgICB0aGlzLnNldFBvc2l0aW9uKHBvaW50LnJvdywgcG9pbnQuY29sdW1uLCB0cnVlKTsKICAgIH07CiAgICAKICAgIGZ1bmN0aW9uICRwb2ludHNJbk9yZGVyKHBvaW50MSwgcG9pbnQyLCBlcXVhbFBvaW50c0luT3JkZXIpIHsKICAgICAgICB2YXIgYkNvbElzQWZ0ZXIgPSBlcXVhbFBvaW50c0luT3JkZXIgPyBwb2ludDEuY29sdW1uIDw9IHBvaW50Mi5jb2x1bW4gOiBwb2ludDEuY29sdW1uIDwgcG9pbnQyLmNvbHVtbjsKICAgICAgICByZXR1cm4gKHBvaW50MS5yb3cgPCBwb2ludDIucm93KSB8fCAocG9pbnQxLnJvdyA9PSBwb2ludDIucm93ICYmIGJDb2xJc0FmdGVyKTsKICAgIH0KICAgICAgICAgICAgCiAgICBmdW5jdGlvbiAkZ2V0VHJhbnNmb3JtZWRQb2ludChkZWx0YSwgcG9pbnQsIG1vdmVJZkVxdWFsKSB7CiAgICAgICAgdmFyIGRlbHRhSXNJbnNlcnQgPSBkZWx0YS5hY3Rpb24gPT0gImluc2VydCI7CiAgICAgICAgdmFyIGRlbHRhUm93U2hpZnQgPSAoZGVsdGFJc0luc2VydCA/IDEgOiAtMSkgKiAoZGVsdGEuZW5kLnJvdyAgICAtIGRlbHRhLnN0YXJ0LnJvdyk7CiAgICAgICAgdmFyIGRlbHRhQ29sU2hpZnQgPSAoZGVsdGFJc0luc2VydCA/IDEgOiAtMSkgKiAoZGVsdGEuZW5kLmNvbHVtbiAtIGRlbHRhLnN0YXJ0LmNvbHVtbik7CiAgICAgICAgdmFyIGRlbHRhU3RhcnQgPSBkZWx0YS5zdGFydDsKICAgICAgICB2YXIgZGVsdGFFbmQgPSBkZWx0YUlzSW5zZXJ0ID8gZGVsdGFTdGFydCA6IGRlbHRhLmVuZDsgLy8gQ29sbGFwc2UgaW5zZXJ0IHJhbmdlLgogICAgICAgIGlmICgkcG9pbnRzSW5PcmRlcihwb2ludCwgZGVsdGFTdGFydCwgbW92ZUlmRXF1YWwpKSB7CiAgICAgICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICAgICByb3c6IHBvaW50LnJvdywKICAgICAgICAgICAgICAgIGNvbHVtbjogcG9pbnQuY29sdW1uCiAgICAgICAgICAgIH07CiAgICAgICAgfQogICAgICAgIGlmICgkcG9pbnRzSW5PcmRlcihkZWx0YUVuZCwgcG9pbnQsICFtb3ZlSWZFcXVhbCkpIHsKICAgICAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgICAgIHJvdzogcG9pbnQucm93ICsgZGVsdGFSb3dTaGlmdCwKICAgICAgICAgICAgICAgIGNvbHVtbjogcG9pbnQuY29sdW1uICsgKHBvaW50LnJvdyA9PSBkZWx0YUVuZC5yb3cgPyBkZWx0YUNvbFNoaWZ0IDogMCkKICAgICAgICAgICAgfTsKICAgICAgICB9CiAgICAgICAgCiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgcm93OiBkZWx0YVN0YXJ0LnJvdywKICAgICAgICAgICAgY29sdW1uOiBkZWx0YVN0YXJ0LmNvbHVtbgogICAgICAgIH07CiAgICB9CiAgICB0aGlzLnNldFBvc2l0aW9uID0gZnVuY3Rpb24ocm93LCBjb2x1bW4sIG5vQ2xpcCkgewogICAgICAgIHZhciBwb3M7CiAgICAgICAgaWYgKG5vQ2xpcCkgewogICAgICAgICAgICBwb3MgPSB7CiAgICAgICAgICAgICAgICByb3c6IHJvdywKICAgICAgICAgICAgICAgIGNvbHVtbjogY29sdW1uCiAgICAgICAgICAgIH07CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgcG9zID0gdGhpcy4kY2xpcFBvc2l0aW9uVG9Eb2N1bWVudChyb3csIGNvbHVtbik7CiAgICAgICAgfQoKICAgICAgICBpZiAodGhpcy5yb3cgPT0gcG9zLnJvdyAmJiB0aGlzLmNvbHVtbiA9PSBwb3MuY29sdW1uKQogICAgICAgICAgICByZXR1cm47CgogICAgICAgIHZhciBvbGQgPSB7CiAgICAgICAgICAgIHJvdzogdGhpcy5yb3csCiAgICAgICAgICAgIGNvbHVtbjogdGhpcy5jb2x1bW4KICAgICAgICB9OwoKICAgICAgICB0aGlzLnJvdyA9IHBvcy5yb3c7CiAgICAgICAgdGhpcy5jb2x1bW4gPSBwb3MuY29sdW1uOwogICAgICAgIHRoaXMuX3NpZ25hbCgiY2hhbmdlIiwgewogICAgICAgICAgICBvbGQ6IG9sZCwKICAgICAgICAgICAgdmFsdWU6IHBvcwogICAgICAgIH0pOwogICAgfTsKICAgIHRoaXMuZGV0YWNoID0gZnVuY3Rpb24oKSB7CiAgICAgICAgdGhpcy5kb2N1bWVudC5vZmYoImNoYW5nZSIsIHRoaXMuJG9uQ2hhbmdlKTsKICAgIH07CiAgICB0aGlzLmF0dGFjaCA9IGZ1bmN0aW9uKGRvYykgewogICAgICAgIHRoaXMuZG9jdW1lbnQgPSBkb2MgfHwgdGhpcy5kb2N1bWVudDsKICAgICAgICB0aGlzLmRvY3VtZW50Lm9uKCJjaGFuZ2UiLCB0aGlzLiRvbkNoYW5nZSk7CiAgICB9OwogICAgdGhpcy4kY2xpcFBvc2l0aW9uVG9Eb2N1bWVudCA9IGZ1bmN0aW9uKHJvdywgY29sdW1uKSB7CiAgICAgICAgdmFyIHBvcyA9IHt9OwoKICAgICAgICBpZiAocm93ID49IHRoaXMuZG9jdW1lbnQuZ2V0TGVuZ3RoKCkpIHsKICAgICAgICAgICAgcG9zLnJvdyA9IE1hdGgubWF4KDAsIHRoaXMuZG9jdW1lbnQuZ2V0TGVuZ3RoKCkgLSAxKTsKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IHRoaXMuZG9jdW1lbnQuZ2V0TGluZShwb3Mucm93KS5sZW5ndGg7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKHJvdyA8IDApIHsKICAgICAgICAgICAgcG9zLnJvdyA9IDA7CiAgICAgICAgICAgIHBvcy5jb2x1bW4gPSAwOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcG9zLnJvdyA9IHJvdzsKICAgICAgICAgICAgcG9zLmNvbHVtbiA9IE1hdGgubWluKHRoaXMuZG9jdW1lbnQuZ2V0TGluZShwb3Mucm93KS5sZW5ndGgsIE1hdGgubWF4KDAsIGNvbHVtbikpOwogICAgICAgIH0KCiAgICAgICAgaWYgKGNvbHVtbiA8IDApCiAgICAgICAgICAgIHBvcy5jb2x1bW4gPSAwOwoKICAgICAgICByZXR1cm4gcG9zOwogICAgfTsKCn0pLmNhbGwoQW5jaG9yLnByb3RvdHlwZSk7Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS9kb2N1bWVudCIsW10sIGZ1bmN0aW9uKHJlcXVpcmUsIGV4cG9ydHMsIG1vZHVsZSkgewoidXNlIHN0cmljdCI7Cgp2YXIgb29wID0gcmVxdWlyZSgiLi9saWIvb29wIik7CnZhciBhcHBseURlbHRhID0gcmVxdWlyZSgiLi9hcHBseV9kZWx0YSIpLmFwcGx5RGVsdGE7CnZhciBFdmVudEVtaXR0ZXIgPSByZXF1aXJlKCIuL2xpYi9ldmVudF9lbWl0dGVyIikuRXZlbnRFbWl0dGVyOwp2YXIgUmFuZ2UgPSByZXF1aXJlKCIuL3JhbmdlIikuUmFuZ2U7CnZhciBBbmNob3IgPSByZXF1aXJlKCIuL2FuY2hvciIpLkFuY2hvcjsKCnZhciBEb2N1bWVudCA9IGZ1bmN0aW9uKHRleHRPckxpbmVzKSB7CiAgICB0aGlzLiRsaW5lcyA9IFsiIl07CiAgICBpZiAodGV4dE9yTGluZXMubGVuZ3RoID09PSAwKSB7CiAgICAgICAgdGhpcy4kbGluZXMgPSBbIiJdOwogICAgfSBlbHNlIGlmIChBcnJheS5pc0FycmF5KHRleHRPckxpbmVzKSkgewogICAgICAgIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMoe3JvdzogMCwgY29sdW1uOiAwfSwgdGV4dE9yTGluZXMpOwogICAgfSBlbHNlIHsKICAgICAgICB0aGlzLmluc2VydCh7cm93OiAwLCBjb2x1bW46MH0sIHRleHRPckxpbmVzKTsKICAgIH0KfTsKCihmdW5jdGlvbigpIHsKCiAgICBvb3AuaW1wbGVtZW50KHRoaXMsIEV2ZW50RW1pdHRlcik7CiAgICB0aGlzLnNldFZhbHVlID0gZnVuY3Rpb24odGV4dCkgewogICAgICAgIHZhciBsZW4gPSB0aGlzLmdldExlbmd0aCgpIC0gMTsKICAgICAgICB0aGlzLnJlbW92ZShuZXcgUmFuZ2UoMCwgMCwgbGVuLCB0aGlzLmdldExpbmUobGVuKS5sZW5ndGgpKTsKICAgICAgICB0aGlzLmluc2VydCh7cm93OiAwLCBjb2x1bW46IDB9LCB0ZXh0KTsKICAgIH07CiAgICB0aGlzLmdldFZhbHVlID0gZnVuY3Rpb24oKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuZ2V0QWxsTGluZXMoKS5qb2luKHRoaXMuZ2V0TmV3TGluZUNoYXJhY3RlcigpKTsKICAgIH07CiAgICB0aGlzLmNyZWF0ZUFuY2hvciA9IGZ1bmN0aW9uKHJvdywgY29sdW1uKSB7CiAgICAgICAgcmV0dXJuIG5ldyBBbmNob3IodGhpcywgcm93LCBjb2x1bW4pOwogICAgfTsKICAgIGlmICgiYWFhIi5zcGxpdCgvYS8pLmxlbmd0aCA9PT0gMCkgewogICAgICAgIHRoaXMuJHNwbGl0ID0gZnVuY3Rpb24odGV4dCkgewogICAgICAgICAgICByZXR1cm4gdGV4dC5yZXBsYWNlKC9cclxufFxyL2csICJcbiIpLnNwbGl0KCJcbiIpOwogICAgICAgIH07CiAgICB9IGVsc2UgewogICAgICAgIHRoaXMuJHNwbGl0ID0gZnVuY3Rpb24odGV4dCkgewogICAgICAgICAgICByZXR1cm4gdGV4dC5zcGxpdCgvXHJcbnxccnxcbi8pOwogICAgICAgIH07CiAgICB9CgoKICAgIHRoaXMuJGRldGVjdE5ld0xpbmUgPSBmdW5jdGlvbih0ZXh0KSB7CiAgICAgICAgdmFyIG1hdGNoID0gdGV4dC5tYXRjaCgvXi4qPyhcclxufFxyfFxuKS9tKTsKICAgICAgICB0aGlzLiRhdXRvTmV3TGluZSA9IG1hdGNoID8gbWF0Y2hbMV0gOiAiXG4iOwogICAgICAgIHRoaXMuX3NpZ25hbCgiY2hhbmdlTmV3TGluZU1vZGUiKTsKICAgIH07CiAgICB0aGlzLmdldE5ld0xpbmVDaGFyYWN0ZXIgPSBmdW5jdGlvbigpIHsKICAgICAgICBzd2l0Y2ggKHRoaXMuJG5ld0xpbmVNb2RlKSB7CiAgICAgICAgICBjYXNlICJ3aW5kb3dzIjoKICAgICAgICAgICAgcmV0dXJuICJcclxuIjsKICAgICAgICAgIGNhc2UgInVuaXgiOgogICAgICAgICAgICByZXR1cm4gIlxuIjsKICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgIHJldHVybiB0aGlzLiRhdXRvTmV3TGluZSB8fCAiXG4iOwogICAgICAgIH0KICAgIH07CgogICAgdGhpcy4kYXV0b05ld0xpbmUgPSAiIjsKICAgIHRoaXMuJG5ld0xpbmVNb2RlID0gImF1dG8iOwogICAgdGhpcy5zZXROZXdMaW5lTW9kZSA9IGZ1bmN0aW9uKG5ld0xpbmVNb2RlKSB7CiAgICAgICAgaWYgKHRoaXMuJG5ld0xpbmVNb2RlID09PSBuZXdMaW5lTW9kZSkKICAgICAgICAgICAgcmV0dXJuOwoKICAgICAgICB0aGlzLiRuZXdMaW5lTW9kZSA9IG5ld0xpbmVNb2RlOwogICAgICAgIHRoaXMuX3NpZ25hbCgiY2hhbmdlTmV3TGluZU1vZGUiKTsKICAgIH07CiAgICB0aGlzLmdldE5ld0xpbmVNb2RlID0gZnVuY3Rpb24oKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJG5ld0xpbmVNb2RlOwogICAgfTsKICAgIHRoaXMuaXNOZXdMaW5lID0gZnVuY3Rpb24odGV4dCkgewogICAgICAgIHJldHVybiAodGV4dCA9PSAiXHJcbiIgfHwgdGV4dCA9PSAiXHIiIHx8IHRleHQgPT0gIlxuIik7CiAgICB9OwogICAgdGhpcy5nZXRMaW5lID0gZnVuY3Rpb24ocm93KSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJGxpbmVzW3Jvd10gfHwgIiI7CiAgICB9OwogICAgdGhpcy5nZXRMaW5lcyA9IGZ1bmN0aW9uKGZpcnN0Um93LCBsYXN0Um93KSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJGxpbmVzLnNsaWNlKGZpcnN0Um93LCBsYXN0Um93ICsgMSk7CiAgICB9OwogICAgdGhpcy5nZXRBbGxMaW5lcyA9IGZ1bmN0aW9uKCkgewogICAgICAgIHJldHVybiB0aGlzLmdldExpbmVzKDAsIHRoaXMuZ2V0TGVuZ3RoKCkpOwogICAgfTsKICAgIHRoaXMuZ2V0TGVuZ3RoID0gZnVuY3Rpb24oKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuJGxpbmVzLmxlbmd0aDsKICAgIH07CiAgICB0aGlzLmdldFRleHRSYW5nZSA9IGZ1bmN0aW9uKHJhbmdlKSB7CiAgICAgICAgcmV0dXJuIHRoaXMuZ2V0TGluZXNGb3JSYW5nZShyYW5nZSkuam9pbih0aGlzLmdldE5ld0xpbmVDaGFyYWN0ZXIoKSk7CiAgICB9OwogICAgdGhpcy5nZXRMaW5lc0ZvclJhbmdlID0gZnVuY3Rpb24ocmFuZ2UpIHsKICAgICAgICB2YXIgbGluZXM7CiAgICAgICAgaWYgKHJhbmdlLnN0YXJ0LnJvdyA9PT0gcmFuZ2UuZW5kLnJvdykgewogICAgICAgICAgICBsaW5lcyA9IFt0aGlzLmdldExpbmUocmFuZ2Uuc3RhcnQucm93KS5zdWJzdHJpbmcocmFuZ2Uuc3RhcnQuY29sdW1uLCByYW5nZS5lbmQuY29sdW1uKV07CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgbGluZXMgPSB0aGlzLmdldExpbmVzKHJhbmdlLnN0YXJ0LnJvdywgcmFuZ2UuZW5kLnJvdyk7CiAgICAgICAgICAgIGxpbmVzWzBdID0gKGxpbmVzWzBdIHx8ICIiKS5zdWJzdHJpbmcocmFuZ2Uuc3RhcnQuY29sdW1uKTsKICAgICAgICAgICAgdmFyIGwgPSBsaW5lcy5sZW5ndGggLSAxOwogICAgICAgICAgICBpZiAocmFuZ2UuZW5kLnJvdyAtIHJhbmdlLnN0YXJ0LnJvdyA9PSBsKQogICAgICAgICAgICAgICAgbGluZXNbbF0gPSBsaW5lc1tsXS5zdWJzdHJpbmcoMCwgcmFuZ2UuZW5kLmNvbHVtbik7CiAgICAgICAgfQogICAgICAgIHJldHVybiBsaW5lczsKICAgIH07CiAgICB0aGlzLmluc2VydExpbmVzID0gZnVuY3Rpb24ocm93LCBsaW5lcykgewogICAgICAgIGNvbnNvbGUud2FybigiVXNlIG9mIGRvY3VtZW50Lmluc2VydExpbmVzIGlzIGRlcHJlY2F0ZWQuIFVzZSB0aGUgaW5zZXJ0RnVsbExpbmVzIG1ldGhvZCBpbnN0ZWFkLiIpOwogICAgICAgIHJldHVybiB0aGlzLmluc2VydEZ1bGxMaW5lcyhyb3csIGxpbmVzKTsKICAgIH07CiAgICB0aGlzLnJlbW92ZUxpbmVzID0gZnVuY3Rpb24oZmlyc3RSb3csIGxhc3RSb3cpIHsKICAgICAgICBjb25zb2xlLndhcm4oIlVzZSBvZiBkb2N1bWVudC5yZW1vdmVMaW5lcyBpcyBkZXByZWNhdGVkLiBVc2UgdGhlIHJlbW92ZUZ1bGxMaW5lcyBtZXRob2QgaW5zdGVhZC4iKTsKICAgICAgICByZXR1cm4gdGhpcy5yZW1vdmVGdWxsTGluZXMoZmlyc3RSb3csIGxhc3RSb3cpOwogICAgfTsKICAgIHRoaXMuaW5zZXJ0TmV3TGluZSA9IGZ1bmN0aW9uKHBvc2l0aW9uKSB7CiAgICAgICAgY29uc29sZS53YXJuKCJVc2Ugb2YgZG9jdW1lbnQuaW5zZXJ0TmV3TGluZSBpcyBkZXByZWNhdGVkLiBVc2UgaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIFsnJywgJyddKSBpbnN0ZWFkLiIpOwogICAgICAgIHJldHVybiB0aGlzLmluc2VydE1lcmdlZExpbmVzKHBvc2l0aW9uLCBbIiIsICIiXSk7CiAgICB9OwogICAgdGhpcy5pbnNlcnQgPSBmdW5jdGlvbihwb3NpdGlvbiwgdGV4dCkgewogICAgICAgIGlmICh0aGlzLmdldExlbmd0aCgpIDw9IDEpCiAgICAgICAgICAgIHRoaXMuJGRldGVjdE5ld0xpbmUodGV4dCk7CiAgICAgICAgCiAgICAgICAgcmV0dXJuIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMocG9zaXRpb24sIHRoaXMuJHNwbGl0KHRleHQpKTsKICAgIH07CiAgICB0aGlzLmluc2VydEluTGluZSA9IGZ1bmN0aW9uKHBvc2l0aW9uLCB0ZXh0KSB7CiAgICAgICAgdmFyIHN0YXJ0ID0gdGhpcy5jbGlwcGVkUG9zKHBvc2l0aW9uLnJvdywgcG9zaXRpb24uY29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5wb3MocG9zaXRpb24ucm93LCBwb3NpdGlvbi5jb2x1bW4gKyB0ZXh0Lmxlbmd0aCk7CiAgICAgICAgCiAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LAogICAgICAgICAgICBlbmQ6IGVuZCwKICAgICAgICAgICAgYWN0aW9uOiAiaW5zZXJ0IiwKICAgICAgICAgICAgbGluZXM6IFt0ZXh0XQogICAgICAgIH0sIHRydWUpOwogICAgICAgIAogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKGVuZCk7CiAgICB9OwogICAgCiAgICB0aGlzLmNsaXBwZWRQb3MgPSBmdW5jdGlvbihyb3csIGNvbHVtbikgewogICAgICAgIHZhciBsZW5ndGggPSB0aGlzLmdldExlbmd0aCgpOwogICAgICAgIGlmIChyb3cgPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICByb3cgPSBsZW5ndGg7CiAgICAgICAgfSBlbHNlIGlmIChyb3cgPCAwKSB7CiAgICAgICAgICAgIHJvdyA9IDA7CiAgICAgICAgfSBlbHNlIGlmIChyb3cgPj0gbGVuZ3RoKSB7CiAgICAgICAgICAgIHJvdyA9IGxlbmd0aCAtIDE7CiAgICAgICAgICAgIGNvbHVtbiA9IHVuZGVmaW5lZDsKICAgICAgICB9CiAgICAgICAgdmFyIGxpbmUgPSB0aGlzLmdldExpbmUocm93KTsKICAgICAgICBpZiAoY29sdW1uID09IHVuZGVmaW5lZCkKICAgICAgICAgICAgY29sdW1uID0gbGluZS5sZW5ndGg7CiAgICAgICAgY29sdW1uID0gTWF0aC5taW4oTWF0aC5tYXgoY29sdW1uLCAwKSwgbGluZS5sZW5ndGgpOwogICAgICAgIHJldHVybiB7cm93OiByb3csIGNvbHVtbjogY29sdW1ufTsKICAgIH07CiAgICAKICAgIHRoaXMuY2xvbmVQb3MgPSBmdW5jdGlvbihwb3MpIHsKICAgICAgICByZXR1cm4ge3JvdzogcG9zLnJvdywgY29sdW1uOiBwb3MuY29sdW1ufTsKICAgIH07CiAgICAKICAgIHRoaXMucG9zID0gZnVuY3Rpb24ocm93LCBjb2x1bW4pIHsKICAgICAgICByZXR1cm4ge3Jvdzogcm93LCBjb2x1bW46IGNvbHVtbn07CiAgICB9OwogICAgCiAgICB0aGlzLiRjbGlwUG9zaXRpb24gPSBmdW5jdGlvbihwb3NpdGlvbikgewogICAgICAgIHZhciBsZW5ndGggPSB0aGlzLmdldExlbmd0aCgpOwogICAgICAgIGlmIChwb3NpdGlvbi5yb3cgPj0gbGVuZ3RoKSB7CiAgICAgICAgICAgIHBvc2l0aW9uLnJvdyA9IE1hdGgubWF4KDAsIGxlbmd0aCAtIDEpOwogICAgICAgICAgICBwb3NpdGlvbi5jb2x1bW4gPSB0aGlzLmdldExpbmUobGVuZ3RoIC0gMSkubGVuZ3RoOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHBvc2l0aW9uLnJvdyA9IE1hdGgubWF4KDAsIHBvc2l0aW9uLnJvdyk7CiAgICAgICAgICAgIHBvc2l0aW9uLmNvbHVtbiA9IE1hdGgubWluKE1hdGgubWF4KHBvc2l0aW9uLmNvbHVtbiwgMCksIHRoaXMuZ2V0TGluZShwb3NpdGlvbi5yb3cpLmxlbmd0aCk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBwb3NpdGlvbjsKICAgIH07CiAgICB0aGlzLmluc2VydEZ1bGxMaW5lcyA9IGZ1bmN0aW9uKHJvdywgbGluZXMpIHsKICAgICAgICByb3cgPSBNYXRoLm1pbihNYXRoLm1heChyb3csIDApLCB0aGlzLmdldExlbmd0aCgpKTsKICAgICAgICB2YXIgY29sdW1uID0gMDsKICAgICAgICBpZiAocm93IDwgdGhpcy5nZXRMZW5ndGgoKSkgewogICAgICAgICAgICBsaW5lcyA9IGxpbmVzLmNvbmNhdChbIiJdKTsKICAgICAgICAgICAgY29sdW1uID0gMDsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBsaW5lcyA9IFsiIl0uY29uY2F0KGxpbmVzKTsKICAgICAgICAgICAgcm93LS07CiAgICAgICAgICAgIGNvbHVtbiA9IHRoaXMuJGxpbmVzW3Jvd10ubGVuZ3RoOwogICAgICAgIH0KICAgICAgICB0aGlzLmluc2VydE1lcmdlZExpbmVzKHtyb3c6IHJvdywgY29sdW1uOiBjb2x1bW59LCBsaW5lcyk7CiAgICB9OyAgICAKICAgIHRoaXMuaW5zZXJ0TWVyZ2VkTGluZXMgPSBmdW5jdGlvbihwb3NpdGlvbiwgbGluZXMpIHsKICAgICAgICB2YXIgc3RhcnQgPSB0aGlzLmNsaXBwZWRQb3MocG9zaXRpb24ucm93LCBwb3NpdGlvbi5jb2x1bW4pOwogICAgICAgIHZhciBlbmQgPSB7CiAgICAgICAgICAgIHJvdzogc3RhcnQucm93ICsgbGluZXMubGVuZ3RoIC0gMSwKICAgICAgICAgICAgY29sdW1uOiAobGluZXMubGVuZ3RoID09IDEgPyBzdGFydC5jb2x1bW4gOiAwKSArIGxpbmVzW2xpbmVzLmxlbmd0aCAtIDFdLmxlbmd0aAogICAgICAgIH07CiAgICAgICAgCiAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgc3RhcnQ6IHN0YXJ0LAogICAgICAgICAgICBlbmQ6IGVuZCwKICAgICAgICAgICAgYWN0aW9uOiAiaW5zZXJ0IiwKICAgICAgICAgICAgbGluZXM6IGxpbmVzCiAgICAgICAgfSk7CiAgICAgICAgCiAgICAgICAgcmV0dXJuIHRoaXMuY2xvbmVQb3MoZW5kKTsKICAgIH07CiAgICB0aGlzLnJlbW92ZSA9IGZ1bmN0aW9uKHJhbmdlKSB7CiAgICAgICAgdmFyIHN0YXJ0ID0gdGhpcy5jbGlwcGVkUG9zKHJhbmdlLnN0YXJ0LnJvdywgcmFuZ2Uuc3RhcnQuY29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5jbGlwcGVkUG9zKHJhbmdlLmVuZC5yb3csIHJhbmdlLmVuZC5jb2x1bW4pOwogICAgICAgIHRoaXMuYXBwbHlEZWx0YSh7CiAgICAgICAgICAgIHN0YXJ0OiBzdGFydCwKICAgICAgICAgICAgZW5kOiBlbmQsCiAgICAgICAgICAgIGFjdGlvbjogInJlbW92ZSIsCiAgICAgICAgICAgIGxpbmVzOiB0aGlzLmdldExpbmVzRm9yUmFuZ2Uoe3N0YXJ0OiBzdGFydCwgZW5kOiBlbmR9KQogICAgICAgIH0pOwogICAgICAgIHJldHVybiB0aGlzLmNsb25lUG9zKHN0YXJ0KTsKICAgIH07CiAgICB0aGlzLnJlbW92ZUluTGluZSA9IGZ1bmN0aW9uKHJvdywgc3RhcnRDb2x1bW4sIGVuZENvbHVtbikgewogICAgICAgIHZhciBzdGFydCA9IHRoaXMuY2xpcHBlZFBvcyhyb3csIHN0YXJ0Q29sdW1uKTsKICAgICAgICB2YXIgZW5kID0gdGhpcy5jbGlwcGVkUG9zKHJvdywgZW5kQ29sdW1uKTsKICAgICAgICAKICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogc3RhcnQsCiAgICAgICAgICAgIGVuZDogZW5kLAogICAgICAgICAgICBhY3Rpb246ICJyZW1vdmUiLAogICAgICAgICAgICBsaW5lczogdGhpcy5nZXRMaW5lc0ZvclJhbmdlKHtzdGFydDogc3RhcnQsIGVuZDogZW5kfSkKICAgICAgICB9LCB0cnVlKTsKICAgICAgICAKICAgICAgICByZXR1cm4gdGhpcy5jbG9uZVBvcyhzdGFydCk7CiAgICB9OwogICAgdGhpcy5yZW1vdmVGdWxsTGluZXMgPSBmdW5jdGlvbihmaXJzdFJvdywgbGFzdFJvdykgewogICAgICAgIGZpcnN0Um93ID0gTWF0aC5taW4oTWF0aC5tYXgoMCwgZmlyc3RSb3cpLCB0aGlzLmdldExlbmd0aCgpIC0gMSk7CiAgICAgICAgbGFzdFJvdyAgPSBNYXRoLm1pbihNYXRoLm1heCgwLCBsYXN0Um93ICksIHRoaXMuZ2V0TGVuZ3RoKCkgLSAxKTsKICAgICAgICB2YXIgZGVsZXRlRmlyc3ROZXdMaW5lID0gbGFzdFJvdyA9PSB0aGlzLmdldExlbmd0aCgpIC0gMSAmJiBmaXJzdFJvdyA+IDA7CiAgICAgICAgdmFyIGRlbGV0ZUxhc3ROZXdMaW5lICA9IGxhc3RSb3cgIDwgdGhpcy5nZXRMZW5ndGgoKSAtIDE7CiAgICAgICAgdmFyIHN0YXJ0Um93ID0gKCBkZWxldGVGaXJzdE5ld0xpbmUgPyBmaXJzdFJvdyAtIDEgICAgICAgICAgICAgICAgICA6IGZpcnN0Um93ICAgICAgICAgICAgICAgICAgICApOwogICAgICAgIHZhciBzdGFydENvbCA9ICggZGVsZXRlRmlyc3ROZXdMaW5lID8gdGhpcy5nZXRMaW5lKHN0YXJ0Um93KS5sZW5ndGggOiAwICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICB2YXIgZW5kUm93ICAgPSAoIGRlbGV0ZUxhc3ROZXdMaW5lICA/IGxhc3RSb3cgKyAxICAgICAgICAgICAgICAgICAgIDogbGFzdFJvdyAgICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgdmFyIGVuZENvbCAgID0gKCBkZWxldGVMYXN0TmV3TGluZSAgPyAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHRoaXMuZ2V0TGluZShlbmRSb3cpLmxlbmd0aCApOyAKICAgICAgICB2YXIgcmFuZ2UgPSBuZXcgUmFuZ2Uoc3RhcnRSb3csIHN0YXJ0Q29sLCBlbmRSb3csIGVuZENvbCk7CiAgICAgICAgdmFyIGRlbGV0ZWRMaW5lcyA9IHRoaXMuJGxpbmVzLnNsaWNlKGZpcnN0Um93LCBsYXN0Um93ICsgMSk7CiAgICAgICAgCiAgICAgICAgdGhpcy5hcHBseURlbHRhKHsKICAgICAgICAgICAgc3RhcnQ6IHJhbmdlLnN0YXJ0LAogICAgICAgICAgICBlbmQ6IHJhbmdlLmVuZCwKICAgICAgICAgICAgYWN0aW9uOiAicmVtb3ZlIiwKICAgICAgICAgICAgbGluZXM6IHRoaXMuZ2V0TGluZXNGb3JSYW5nZShyYW5nZSkKICAgICAgICB9KTsKICAgICAgICByZXR1cm4gZGVsZXRlZExpbmVzOwogICAgfTsKICAgIHRoaXMucmVtb3ZlTmV3TGluZSA9IGZ1bmN0aW9uKHJvdykgewogICAgICAgIGlmIChyb3cgPCB0aGlzLmdldExlbmd0aCgpIC0gMSAmJiByb3cgPj0gMCkgewogICAgICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICAgICAgc3RhcnQ6IHRoaXMucG9zKHJvdywgdGhpcy5nZXRMaW5lKHJvdykubGVuZ3RoKSwKICAgICAgICAgICAgICAgIGVuZDogdGhpcy5wb3Mocm93ICsgMSwgMCksCiAgICAgICAgICAgICAgICBhY3Rpb246ICJyZW1vdmUiLAogICAgICAgICAgICAgICAgbGluZXM6IFsiIiwgIiJdCiAgICAgICAgICAgIH0pOwogICAgICAgIH0KICAgIH07CiAgICB0aGlzLnJlcGxhY2UgPSBmdW5jdGlvbihyYW5nZSwgdGV4dCkgewogICAgICAgIGlmICghKHJhbmdlIGluc3RhbmNlb2YgUmFuZ2UpKQogICAgICAgICAgICByYW5nZSA9IFJhbmdlLmZyb21Qb2ludHMocmFuZ2Uuc3RhcnQsIHJhbmdlLmVuZCk7CiAgICAgICAgaWYgKHRleHQubGVuZ3RoID09PSAwICYmIHJhbmdlLmlzRW1wdHkoKSkKICAgICAgICAgICAgcmV0dXJuIHJhbmdlLnN0YXJ0OwogICAgICAgIGlmICh0ZXh0ID09IHRoaXMuZ2V0VGV4dFJhbmdlKHJhbmdlKSkKICAgICAgICAgICAgcmV0dXJuIHJhbmdlLmVuZDsKCiAgICAgICAgdGhpcy5yZW1vdmUocmFuZ2UpOwogICAgICAgIHZhciBlbmQ7CiAgICAgICAgaWYgKHRleHQpIHsKICAgICAgICAgICAgZW5kID0gdGhpcy5pbnNlcnQocmFuZ2Uuc3RhcnQsIHRleHQpOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgZW5kID0gcmFuZ2Uuc3RhcnQ7CiAgICAgICAgfQogICAgICAgIAogICAgICAgIHJldHVybiBlbmQ7CiAgICB9OwogICAgdGhpcy5hcHBseURlbHRhcyA9IGZ1bmN0aW9uKGRlbHRhcykgewogICAgICAgIGZvciAodmFyIGk9MDsgaTxkZWx0YXMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgdGhpcy5hcHBseURlbHRhKGRlbHRhc1tpXSk7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMucmV2ZXJ0RGVsdGFzID0gZnVuY3Rpb24oZGVsdGFzKSB7CiAgICAgICAgZm9yICh2YXIgaT1kZWx0YXMubGVuZ3RoLTE7IGk+PTA7IGktLSkgewogICAgICAgICAgICB0aGlzLnJldmVydERlbHRhKGRlbHRhc1tpXSk7CiAgICAgICAgfQogICAgfTsKICAgIHRoaXMuYXBwbHlEZWx0YSA9IGZ1bmN0aW9uKGRlbHRhLCBkb05vdFZhbGlkYXRlKSB7CiAgICAgICAgdmFyIGlzSW5zZXJ0ID0gZGVsdGEuYWN0aW9uID09ICJpbnNlcnQiOwogICAgICAgIGlmIChpc0luc2VydCA/IGRlbHRhLmxpbmVzLmxlbmd0aCA8PSAxICYmICFkZWx0YS5saW5lc1swXQogICAgICAgICAgICA6ICFSYW5nZS5jb21wYXJlUG9pbnRzKGRlbHRhLnN0YXJ0LCBkZWx0YS5lbmQpKSB7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CiAgICAgICAgCiAgICAgICAgaWYgKGlzSW5zZXJ0ICYmIGRlbHRhLmxpbmVzLmxlbmd0aCA+IDIwMDAwKSB7CiAgICAgICAgICAgIHRoaXMuJHNwbGl0QW5kYXBwbHlMYXJnZURlbHRhKGRlbHRhLCAyMDAwMCk7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBhcHBseURlbHRhKHRoaXMuJGxpbmVzLCBkZWx0YSwgZG9Ob3RWYWxpZGF0ZSk7CiAgICAgICAgICAgIHRoaXMuX3NpZ25hbCgiY2hhbmdlIiwgZGVsdGEpOwogICAgICAgIH0KICAgIH07CiAgICAKICAgIHRoaXMuJHNhZmVBcHBseURlbHRhID0gZnVuY3Rpb24oZGVsdGEpIHsKICAgICAgICB2YXIgZG9jTGVuZ3RoID0gdGhpcy4kbGluZXMubGVuZ3RoOwogICAgICAgIGlmICgKICAgICAgICAgICAgZGVsdGEuYWN0aW9uID09ICJyZW1vdmUiICYmIGRlbHRhLnN0YXJ0LnJvdyA8IGRvY0xlbmd0aCAmJiBkZWx0YS5lbmQucm93IDwgZG9jTGVuZ3RoCiAgICAgICAgICAgIHx8IGRlbHRhLmFjdGlvbiA9PSAiaW5zZXJ0IiAmJiBkZWx0YS5zdGFydC5yb3cgPD0gZG9jTGVuZ3RoCiAgICAgICAgKSB7CiAgICAgICAgICAgIHRoaXMuYXBwbHlEZWx0YShkZWx0YSk7CiAgICAgICAgfQogICAgfTsKICAgIAogICAgdGhpcy4kc3BsaXRBbmRhcHBseUxhcmdlRGVsdGEgPSBmdW5jdGlvbihkZWx0YSwgTUFYKSB7CiAgICAgICAgdmFyIGxpbmVzID0gZGVsdGEubGluZXM7CiAgICAgICAgdmFyIGwgPSBsaW5lcy5sZW5ndGggLSBNQVggKyAxOwogICAgICAgIHZhciByb3cgPSBkZWx0YS5zdGFydC5yb3c7IAogICAgICAgIHZhciBjb2x1bW4gPSBkZWx0YS5zdGFydC5jb2x1bW47CiAgICAgICAgZm9yICh2YXIgZnJvbSA9IDAsIHRvID0gMDsgZnJvbSA8IGw7IGZyb20gPSB0bykgewogICAgICAgICAgICB0byArPSBNQVggLSAxOwogICAgICAgICAgICB2YXIgY2h1bmsgPSBsaW5lcy5zbGljZShmcm9tLCB0byk7CiAgICAgICAgICAgIGNodW5rLnB1c2goIiIpOwogICAgICAgICAgICB0aGlzLmFwcGx5RGVsdGEoewogICAgICAgICAgICAgICAgc3RhcnQ6IHRoaXMucG9zKHJvdyArIGZyb20sIGNvbHVtbiksCiAgICAgICAgICAgICAgICBlbmQ6IHRoaXMucG9zKHJvdyArIHRvLCBjb2x1bW4gPSAwKSwKICAgICAgICAgICAgICAgIGFjdGlvbjogZGVsdGEuYWN0aW9uLAogICAgICAgICAgICAgICAgbGluZXM6IGNodW5rCiAgICAgICAgICAgIH0sIHRydWUpOwogICAgICAgIH0KICAgICAgICBkZWx0YS5saW5lcyA9IGxpbmVzLnNsaWNlKGZyb20pOwogICAgICAgIGRlbHRhLnN0YXJ0LnJvdyA9IHJvdyArIGZyb207CiAgICAgICAgZGVsdGEuc3RhcnQuY29sdW1uID0gY29sdW1uOwogICAgICAgIHRoaXMuYXBwbHlEZWx0YShkZWx0YSwgdHJ1ZSk7CiAgICB9OwogICAgdGhpcy5yZXZlcnREZWx0YSA9IGZ1bmN0aW9uKGRlbHRhKSB7CiAgICAgICAgdGhpcy4kc2FmZUFwcGx5RGVsdGEoewogICAgICAgICAgICBzdGFydDogdGhpcy5jbG9uZVBvcyhkZWx0YS5zdGFydCksCiAgICAgICAgICAgIGVuZDogdGhpcy5jbG9uZVBvcyhkZWx0YS5lbmQpLAogICAgICAgICAgICBhY3Rpb246IChkZWx0YS5hY3Rpb24gPT0gImluc2VydCIgPyAicmVtb3ZlIiA6ICJpbnNlcnQiKSwKICAgICAgICAgICAgbGluZXM6IGRlbHRhLmxpbmVzLnNsaWNlKCkKICAgICAgICB9KTsKICAgIH07CiAgICB0aGlzLmluZGV4VG9Qb3NpdGlvbiA9IGZ1bmN0aW9uKGluZGV4LCBzdGFydFJvdykgewogICAgICAgIHZhciBsaW5lcyA9IHRoaXMuJGxpbmVzIHx8IHRoaXMuZ2V0QWxsTGluZXMoKTsKICAgICAgICB2YXIgbmV3bGluZUxlbmd0aCA9IHRoaXMuZ2V0TmV3TGluZUNoYXJhY3RlcigpLmxlbmd0aDsKICAgICAgICBmb3IgKHZhciBpID0gc3RhcnRSb3cgfHwgMCwgbCA9IGxpbmVzLmxlbmd0aDsgaSA8IGw7IGkrKykgewogICAgICAgICAgICBpbmRleCAtPSBsaW5lc1tpXS5sZW5ndGggKyBuZXdsaW5lTGVuZ3RoOwogICAgICAgICAgICBpZiAoaW5kZXggPCAwKQogICAgICAgICAgICAgICAgcmV0dXJuIHtyb3c6IGksIGNvbHVtbjogaW5kZXggKyBsaW5lc1tpXS5sZW5ndGggKyBuZXdsaW5lTGVuZ3RofTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHtyb3c6IGwtMSwgY29sdW1uOiBpbmRleCArIGxpbmVzW2wtMV0ubGVuZ3RoICsgbmV3bGluZUxlbmd0aH07CiAgICB9OwogICAgdGhpcy5wb3NpdGlvblRvSW5kZXggPSBmdW5jdGlvbihwb3MsIHN0YXJ0Um93KSB7CiAgICAgICAgdmFyIGxpbmVzID0gdGhpcy4kbGluZXMgfHwgdGhpcy5nZXRBbGxMaW5lcygpOwogICAgICAgIHZhciBuZXdsaW5lTGVuZ3RoID0gdGhpcy5nZXROZXdMaW5lQ2hhcmFjdGVyKCkubGVuZ3RoOwogICAgICAgIHZhciBpbmRleCA9IDA7CiAgICAgICAgdmFyIHJvdyA9IE1hdGgubWluKHBvcy5yb3csIGxpbmVzLmxlbmd0aCk7CiAgICAgICAgZm9yICh2YXIgaSA9IHN0YXJ0Um93IHx8IDA7IGkgPCByb3c7ICsraSkKICAgICAgICAgICAgaW5kZXggKz0gbGluZXNbaV0ubGVuZ3RoICsgbmV3bGluZUxlbmd0aDsKCiAgICAgICAgcmV0dXJuIGluZGV4ICsgcG9zLmNvbHVtbjsKICAgIH07Cgp9KS5jYWxsKERvY3VtZW50LnByb3RvdHlwZSk7CgpleHBvcnRzLkRvY3VtZW50ID0gRG9jdW1lbnQ7Cn0pOwoKYWNlLmRlZmluZSgiYWNlL2xpYi9sYW5nIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKSB7CiJ1c2Ugc3RyaWN0IjsKCmV4cG9ydHMubGFzdCA9IGZ1bmN0aW9uKGEpIHsKICAgIHJldHVybiBhW2EubGVuZ3RoIC0gMV07Cn07CgpleHBvcnRzLnN0cmluZ1JldmVyc2UgPSBmdW5jdGlvbihzdHJpbmcpIHsKICAgIHJldHVybiBzdHJpbmcuc3BsaXQoIiIpLnJldmVyc2UoKS5qb2luKCIiKTsKfTsKCmV4cG9ydHMuc3RyaW5nUmVwZWF0ID0gZnVuY3Rpb24gKHN0cmluZywgY291bnQpIHsKICAgIHZhciByZXN1bHQgPSAnJzsKICAgIHdoaWxlIChjb3VudCA+IDApIHsKICAgICAgICBpZiAoY291bnQgJiAxKQogICAgICAgICAgICByZXN1bHQgKz0gc3RyaW5nOwoKICAgICAgICBpZiAoY291bnQgPj49IDEpCiAgICAgICAgICAgIHN0cmluZyArPSBzdHJpbmc7CiAgICB9CiAgICByZXR1cm4gcmVzdWx0Owp9OwoKdmFyIHRyaW1CZWdpblJlZ2V4cCA9IC9eXHNccyovOwp2YXIgdHJpbUVuZFJlZ2V4cCA9IC9cc1xzKiQvOwoKZXhwb3J0cy5zdHJpbmdUcmltTGVmdCA9IGZ1bmN0aW9uIChzdHJpbmcpIHsKICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSh0cmltQmVnaW5SZWdleHAsICcnKTsKfTsKCmV4cG9ydHMuc3RyaW5nVHJpbVJpZ2h0ID0gZnVuY3Rpb24gKHN0cmluZykgewogICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKHRyaW1FbmRSZWdleHAsICcnKTsKfTsKCmV4cG9ydHMuY29weU9iamVjdCA9IGZ1bmN0aW9uKG9iaikgewogICAgdmFyIGNvcHkgPSB7fTsKICAgIGZvciAodmFyIGtleSBpbiBvYmopIHsKICAgICAgICBjb3B5W2tleV0gPSBvYmpba2V5XTsKICAgIH0KICAgIHJldHVybiBjb3B5Owp9OwoKZXhwb3J0cy5jb3B5QXJyYXkgPSBmdW5jdGlvbihhcnJheSl7CiAgICB2YXIgY29weSA9IFtdOwogICAgZm9yICh2YXIgaT0wLCBsPWFycmF5Lmxlbmd0aDsgaTxsOyBpKyspIHsKICAgICAgICBpZiAoYXJyYXlbaV0gJiYgdHlwZW9mIGFycmF5W2ldID09ICJvYmplY3QiKQogICAgICAgICAgICBjb3B5W2ldID0gdGhpcy5jb3B5T2JqZWN0KGFycmF5W2ldKTsKICAgICAgICBlbHNlIAogICAgICAgICAgICBjb3B5W2ldID0gYXJyYXlbaV07CiAgICB9CiAgICByZXR1cm4gY29weTsKfTsKCmV4cG9ydHMuZGVlcENvcHkgPSBmdW5jdGlvbiBkZWVwQ29weShvYmopIHsKICAgIGlmICh0eXBlb2Ygb2JqICE9PSAib2JqZWN0IiB8fCAhb2JqKQogICAgICAgIHJldHVybiBvYmo7CiAgICB2YXIgY29weTsKICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHsKICAgICAgICBjb3B5ID0gW107CiAgICAgICAgZm9yICh2YXIga2V5ID0gMDsga2V5IDwgb2JqLmxlbmd0aDsga2V5KyspIHsKICAgICAgICAgICAgY29weVtrZXldID0gZGVlcENvcHkob2JqW2tleV0pOwogICAgICAgIH0KICAgICAgICByZXR1cm4gY29weTsKICAgIH0KICAgIGlmIChPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwob2JqKSAhPT0gIltvYmplY3QgT2JqZWN0XSIpCiAgICAgICAgcmV0dXJuIG9iajsKICAgIAogICAgY29weSA9IHt9OwogICAgZm9yICh2YXIga2V5IGluIG9iaikKICAgICAgICBjb3B5W2tleV0gPSBkZWVwQ29weShvYmpba2V5XSk7CiAgICByZXR1cm4gY29weTsKfTsKCmV4cG9ydHMuYXJyYXlUb01hcCA9IGZ1bmN0aW9uKGFycikgewogICAgdmFyIG1hcCA9IHt9OwogICAgZm9yICh2YXIgaT0wOyBpPGFyci5sZW5ndGg7IGkrKykgewogICAgICAgIG1hcFthcnJbaV1dID0gMTsKICAgIH0KICAgIHJldHVybiBtYXA7Cgp9OwoKZXhwb3J0cy5jcmVhdGVNYXAgPSBmdW5jdGlvbihwcm9wcykgewogICAgdmFyIG1hcCA9IE9iamVjdC5jcmVhdGUobnVsbCk7CiAgICBmb3IgKHZhciBpIGluIHByb3BzKSB7CiAgICAgICAgbWFwW2ldID0gcHJvcHNbaV07CiAgICB9CiAgICByZXR1cm4gbWFwOwp9OwpleHBvcnRzLmFycmF5UmVtb3ZlID0gZnVuY3Rpb24oYXJyYXksIHZhbHVlKSB7CiAgZm9yICh2YXIgaSA9IDA7IGkgPD0gYXJyYXkubGVuZ3RoOyBpKyspIHsKICAgIGlmICh2YWx1ZSA9PT0gYXJyYXlbaV0pIHsKICAgICAgYXJyYXkuc3BsaWNlKGksIDEpOwogICAgfQogIH0KfTsKCmV4cG9ydHMuZXNjYXBlUmVnRXhwID0gZnVuY3Rpb24oc3RyKSB7CiAgICByZXR1cm4gc3RyLnJlcGxhY2UoLyhbLiorP14ke30oKXxbXF1cL1xcXSkvZywgJ1xcJDEnKTsKfTsKCmV4cG9ydHMuZXNjYXBlSFRNTCA9IGZ1bmN0aW9uKHN0cikgewogICAgcmV0dXJuICgiIiArIHN0cikucmVwbGFjZSgvJi9nLCAiJiMzODsiKS5yZXBsYWNlKC8iL2csICImIzM0OyIpLnJlcGxhY2UoLycvZywgIiYjMzk7IikucmVwbGFjZSgvPC9nLCAiJiM2MDsiKTsKfTsKCmV4cG9ydHMuZ2V0TWF0Y2hPZmZzZXRzID0gZnVuY3Rpb24oc3RyaW5nLCByZWdFeHApIHsKICAgIHZhciBtYXRjaGVzID0gW107CgogICAgc3RyaW5nLnJlcGxhY2UocmVnRXhwLCBmdW5jdGlvbihzdHIpIHsKICAgICAgICBtYXRjaGVzLnB1c2goewogICAgICAgICAgICBvZmZzZXQ6IGFyZ3VtZW50c1thcmd1bWVudHMubGVuZ3RoLTJdLAogICAgICAgICAgICBsZW5ndGg6IHN0ci5sZW5ndGgKICAgICAgICB9KTsKICAgIH0pOwoKICAgIHJldHVybiBtYXRjaGVzOwp9OwpleHBvcnRzLmRlZmVycmVkQ2FsbCA9IGZ1bmN0aW9uKGZjbikgewogICAgdmFyIHRpbWVyID0gbnVsbDsKICAgIHZhciBjYWxsYmFjayA9IGZ1bmN0aW9uKCkgewogICAgICAgIHRpbWVyID0gbnVsbDsKICAgICAgICBmY24oKTsKICAgIH07CgogICAgdmFyIGRlZmVycmVkID0gZnVuY3Rpb24odGltZW91dCkgewogICAgICAgIGRlZmVycmVkLmNhbmNlbCgpOwogICAgICAgIHRpbWVyID0gc2V0VGltZW91dChjYWxsYmFjaywgdGltZW91dCB8fCAwKTsKICAgICAgICByZXR1cm4gZGVmZXJyZWQ7CiAgICB9OwoKICAgIGRlZmVycmVkLnNjaGVkdWxlID0gZGVmZXJyZWQ7CgogICAgZGVmZXJyZWQuY2FsbCA9IGZ1bmN0aW9uKCkgewogICAgICAgIHRoaXMuY2FuY2VsKCk7CiAgICAgICAgZmNuKCk7CiAgICAgICAgcmV0dXJuIGRlZmVycmVkOwogICAgfTsKCiAgICBkZWZlcnJlZC5jYW5jZWwgPSBmdW5jdGlvbigpIHsKICAgICAgICBjbGVhclRpbWVvdXQodGltZXIpOwogICAgICAgIHRpbWVyID0gbnVsbDsKICAgICAgICByZXR1cm4gZGVmZXJyZWQ7CiAgICB9OwogICAgCiAgICBkZWZlcnJlZC5pc1BlbmRpbmcgPSBmdW5jdGlvbigpIHsKICAgICAgICByZXR1cm4gdGltZXI7CiAgICB9OwoKICAgIHJldHVybiBkZWZlcnJlZDsKfTsKCgpleHBvcnRzLmRlbGF5ZWRDYWxsID0gZnVuY3Rpb24oZmNuLCBkZWZhdWx0VGltZW91dCkgewogICAgdmFyIHRpbWVyID0gbnVsbDsKICAgIHZhciBjYWxsYmFjayA9IGZ1bmN0aW9uKCkgewogICAgICAgIHRpbWVyID0gbnVsbDsKICAgICAgICBmY24oKTsKICAgIH07CgogICAgdmFyIF9zZWxmID0gZnVuY3Rpb24odGltZW91dCkgewogICAgICAgIGlmICh0aW1lciA9PSBudWxsKQogICAgICAgICAgICB0aW1lciA9IHNldFRpbWVvdXQoY2FsbGJhY2ssIHRpbWVvdXQgfHwgZGVmYXVsdFRpbWVvdXQpOwogICAgfTsKCiAgICBfc2VsZi5kZWxheSA9IGZ1bmN0aW9uKHRpbWVvdXQpIHsKICAgICAgICB0aW1lciAmJiBjbGVhclRpbWVvdXQodGltZXIpOwogICAgICAgIHRpbWVyID0gc2V0VGltZW91dChjYWxsYmFjaywgdGltZW91dCB8fCBkZWZhdWx0VGltZW91dCk7CiAgICB9OwogICAgX3NlbGYuc2NoZWR1bGUgPSBfc2VsZjsKCiAgICBfc2VsZi5jYWxsID0gZnVuY3Rpb24oKSB7CiAgICAgICAgdGhpcy5jYW5jZWwoKTsKICAgICAgICBmY24oKTsKICAgIH07CgogICAgX3NlbGYuY2FuY2VsID0gZnVuY3Rpb24oKSB7CiAgICAgICAgdGltZXIgJiYgY2xlYXJUaW1lb3V0KHRpbWVyKTsKICAgICAgICB0aW1lciA9IG51bGw7CiAgICB9OwoKICAgIF9zZWxmLmlzUGVuZGluZyA9IGZ1bmN0aW9uKCkgewogICAgICAgIHJldHVybiB0aW1lcjsKICAgIH07CgogICAgcmV0dXJuIF9zZWxmOwp9Owp9KTsKCmFjZS5kZWZpbmUoImFjZS93b3JrZXIvbWlycm9yIixbXSwgZnVuY3Rpb24ocmVxdWlyZSwgZXhwb3J0cywgbW9kdWxlKSB7CiJ1c2Ugc3RyaWN0IjsKCnZhciBSYW5nZSA9IHJlcXVpcmUoIi4uL3JhbmdlIikuUmFuZ2U7CnZhciBEb2N1bWVudCA9IHJlcXVpcmUoIi4uL2RvY3VtZW50IikuRG9jdW1lbnQ7CnZhciBsYW5nID0gcmVxdWlyZSgiLi4vbGliL2xhbmciKTsKICAgIAp2YXIgTWlycm9yID0gZXhwb3J0cy5NaXJyb3IgPSBmdW5jdGlvbihzZW5kZXIpIHsKICAgIHRoaXMuc2VuZGVyID0gc2VuZGVyOwogICAgdmFyIGRvYyA9IHRoaXMuZG9jID0gbmV3IERvY3VtZW50KCIiKTsKICAgIAogICAgdmFyIGRlZmVycmVkVXBkYXRlID0gdGhpcy5kZWZlcnJlZFVwZGF0ZSA9IGxhbmcuZGVsYXllZENhbGwodGhpcy5vblVwZGF0ZS5iaW5kKHRoaXMpKTsKICAgIAogICAgdmFyIF9zZWxmID0gdGhpczsKICAgIHNlbmRlci5vbigiY2hhbmdlIiwgZnVuY3Rpb24oZSkgewogICAgICAgIHZhciBkYXRhID0gZS5kYXRhOwogICAgICAgIGlmIChkYXRhWzBdLnN0YXJ0KSB7CiAgICAgICAgICAgIGRvYy5hcHBseURlbHRhcyhkYXRhKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGRhdGEubGVuZ3RoOyBpICs9IDIpIHsKICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGRhdGFbaSsxXSkpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgZCA9IHthY3Rpb246ICJpbnNlcnQiLCBzdGFydDogZGF0YVtpXSwgbGluZXM6IGRhdGFbaSsxXX07CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIHZhciBkID0ge2FjdGlvbjogInJlbW92ZSIsIHN0YXJ0OiBkYXRhW2ldLCBlbmQ6IGRhdGFbaSsxXX07CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBkb2MuYXBwbHlEZWx0YShkLCB0cnVlKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZiAoX3NlbGYuJHRpbWVvdXQpCiAgICAgICAgICAgIHJldHVybiBkZWZlcnJlZFVwZGF0ZS5zY2hlZHVsZShfc2VsZi4kdGltZW91dCk7CiAgICAgICAgX3NlbGYub25VcGRhdGUoKTsKICAgIH0pOwp9OwoKKGZ1bmN0aW9uKCkgewogICAgCiAgICB0aGlzLiR0aW1lb3V0ID0gNTAwOwogICAgCiAgICB0aGlzLnNldFRpbWVvdXQgPSBmdW5jdGlvbih0aW1lb3V0KSB7CiAgICAgICAgdGhpcy4kdGltZW91dCA9IHRpbWVvdXQ7CiAgICB9OwogICAgCiAgICB0aGlzLnNldFZhbHVlID0gZnVuY3Rpb24odmFsdWUpIHsKICAgICAgICB0aGlzLmRvYy5zZXRWYWx1ZSh2YWx1ZSk7CiAgICAgICAgdGhpcy5kZWZlcnJlZFVwZGF0ZS5zY2hlZHVsZSh0aGlzLiR0aW1lb3V0KTsKICAgIH07CiAgICAKICAgIHRoaXMuZ2V0VmFsdWUgPSBmdW5jdGlvbihjYWxsYmFja0lkKSB7CiAgICAgICAgdGhpcy5zZW5kZXIuY2FsbGJhY2sodGhpcy5kb2MuZ2V0VmFsdWUoKSwgY2FsbGJhY2tJZCk7CiAgICB9OwogICAgCiAgICB0aGlzLm9uVXBkYXRlID0gZnVuY3Rpb24oKSB7CiAgICB9OwogICAgCiAgICB0aGlzLmlzUGVuZGluZyA9IGZ1bmN0aW9uKCkgewogICAgICAgIHJldHVybiB0aGlzLmRlZmVycmVkVXBkYXRlLmlzUGVuZGluZygpOwogICAgfTsKICAgIAp9KS5jYWxsKE1pcnJvci5wcm90b3R5cGUpOwoKfSk7CgphY2UuZGVmaW5lKCJhY2UvbW9kZS9qc29uL2pzb25fcGFyc2UiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKICAgIHZhciBhdCwgICAgIC8vIFRoZSBpbmRleCBvZiB0aGUgY3VycmVudCBjaGFyYWN0ZXIKICAgICAgICBjaCwgICAgIC8vIFRoZSBjdXJyZW50IGNoYXJhY3RlcgogICAgICAgIGVzY2FwZWUgPSB7CiAgICAgICAgICAgICciJzogICciJywKICAgICAgICAgICAgJ1xcJzogJ1xcJywKICAgICAgICAgICAgJy8nOiAgJy8nLAogICAgICAgICAgICBiOiAgICAnXGInLAogICAgICAgICAgICBmOiAgICAnXGYnLAogICAgICAgICAgICBuOiAgICAnXG4nLAogICAgICAgICAgICByOiAgICAnXHInLAogICAgICAgICAgICB0OiAgICAnXHQnCiAgICAgICAgfSwKICAgICAgICB0ZXh0LAoKICAgICAgICBlcnJvciA9IGZ1bmN0aW9uIChtKSB7CgogICAgICAgICAgICB0aHJvdyB7CiAgICAgICAgICAgICAgICBuYW1lOiAgICAnU3ludGF4RXJyb3InLAogICAgICAgICAgICAgICAgbWVzc2FnZTogbSwKICAgICAgICAgICAgICAgIGF0OiAgICAgIGF0LAogICAgICAgICAgICAgICAgdGV4dDogICAgdGV4dAogICAgICAgICAgICB9OwogICAgICAgIH0sCgogICAgICAgIG5leHQgPSBmdW5jdGlvbiAoYykgewoKICAgICAgICAgICAgaWYgKGMgJiYgYyAhPT0gY2gpIHsKICAgICAgICAgICAgICAgIGVycm9yKCJFeHBlY3RlZCAnIiArIGMgKyAiJyBpbnN0ZWFkIG9mICciICsgY2ggKyAiJyIpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBjaCA9IHRleHQuY2hhckF0KGF0KTsKICAgICAgICAgICAgYXQgKz0gMTsKICAgICAgICAgICAgcmV0dXJuIGNoOwogICAgICAgIH0sCgogICAgICAgIG51bWJlciA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHZhciBudW1iZXIsCiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnJzsKCiAgICAgICAgICAgIGlmIChjaCA9PT0gJy0nKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgPSAnLSc7CiAgICAgICAgICAgICAgICBuZXh0KCctJyk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgd2hpbGUgKGNoID49ICcwJyAmJiBjaCA8PSAnOScpIHsKICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY2ggPT09ICcuJykgewogICAgICAgICAgICAgICAgc3RyaW5nICs9ICcuJzsKICAgICAgICAgICAgICAgIHdoaWxlIChuZXh0KCkgJiYgY2ggPj0gJzAnICYmIGNoIDw9ICc5JykgewogICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoY2ggPT09ICdlJyB8fCBjaCA9PT0gJ0UnKSB7CiAgICAgICAgICAgICAgICBzdHJpbmcgKz0gY2g7CiAgICAgICAgICAgICAgICBuZXh0KCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICctJyB8fCBjaCA9PT0gJysnKSB7CiAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHdoaWxlIChjaCA+PSAnMCcgJiYgY2ggPD0gJzknKSB7CiAgICAgICAgICAgICAgICAgICAgc3RyaW5nICs9IGNoOwogICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBudW1iZXIgPSArc3RyaW5nOwogICAgICAgICAgICBpZiAoaXNOYU4obnVtYmVyKSkgewogICAgICAgICAgICAgICAgZXJyb3IoIkJhZCBudW1iZXIiKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7CiAgICAgICAgICAgIH0KICAgICAgICB9LAoKICAgICAgICBzdHJpbmcgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICB2YXIgaGV4LAogICAgICAgICAgICAgICAgaSwKICAgICAgICAgICAgICAgIHN0cmluZyA9ICcnLAogICAgICAgICAgICAgICAgdWZmZmY7CgogICAgICAgICAgICBpZiAoY2ggPT09ICciJykgewogICAgICAgICAgICAgICAgd2hpbGUgKG5leHQoKSkgewogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJyInKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0cmluZzsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoID09PSAnXFwnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoID09PSAndScpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVmZmZmID0gMDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA0OyBpICs9IDEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZXggPSBwYXJzZUludChuZXh0KCksIDE2KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzRmluaXRlKGhleCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVmZmZmID0gdWZmZmYgKiAxNiArIGhleDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKHVmZmZmKTsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgZXNjYXBlZVtjaF0gPT09ICdzdHJpbmcnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcgKz0gZXNjYXBlZVtjaF07CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2ggPT0gIlxuIiB8fCBjaCA9PSAiXHIiKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyArPSBjaDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBzdHJpbmciKTsKICAgICAgICB9LAoKICAgICAgICB3aGl0ZSA9IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAgIHdoaWxlIChjaCAmJiBjaCA8PSAnICcpIHsKICAgICAgICAgICAgICAgIG5leHQoKTsKICAgICAgICAgICAgfQogICAgICAgIH0sCgogICAgICAgIHdvcmQgPSBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgICBzd2l0Y2ggKGNoKSB7CiAgICAgICAgICAgIGNhc2UgJ3QnOgogICAgICAgICAgICAgICAgbmV4dCgndCcpOwogICAgICAgICAgICAgICAgbmV4dCgncicpOwogICAgICAgICAgICAgICAgbmV4dCgndScpOwogICAgICAgICAgICAgICAgbmV4dCgnZScpOwogICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgIGNhc2UgJ2YnOgogICAgICAgICAgICAgICAgbmV4dCgnZicpOwogICAgICAgICAgICAgICAgbmV4dCgnYScpOwogICAgICAgICAgICAgICAgbmV4dCgnbCcpOwogICAgICAgICAgICAgICAgbmV4dCgncycpOwogICAgICAgICAgICAgICAgbmV4dCgnZScpOwogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICBjYXNlICduJzoKICAgICAgICAgICAgICAgIG5leHQoJ24nKTsKICAgICAgICAgICAgICAgIG5leHQoJ3UnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIG5leHQoJ2wnKTsKICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVycm9yKCJVbmV4cGVjdGVkICciICsgY2ggKyAiJyIpOwogICAgICAgIH0sCgogICAgICAgIHZhbHVlLCAgLy8gUGxhY2UgaG9sZGVyIGZvciB0aGUgdmFsdWUgZnVuY3Rpb24uCgogICAgICAgIGFycmF5ID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGFycmF5ID0gW107CgogICAgICAgICAgICBpZiAoY2ggPT09ICdbJykgewogICAgICAgICAgICAgICAgbmV4dCgnWycpOwogICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ10nKSB7CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnXScpOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheTsgICAvLyBlbXB0eSBhcnJheQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgd2hpbGUgKGNoKSB7CiAgICAgICAgICAgICAgICAgICAgYXJyYXkucHVzaCh2YWx1ZSgpKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ10nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoJ10nKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFycmF5OwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBuZXh0KCcsJyk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvcigiQmFkIGFycmF5Iik7CiAgICAgICAgfSwKCiAgICAgICAgb2JqZWN0ID0gZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgdmFyIGtleSwKICAgICAgICAgICAgICAgIG9iamVjdCA9IHt9OwoKICAgICAgICAgICAgaWYgKGNoID09PSAneycpIHsKICAgICAgICAgICAgICAgIG5leHQoJ3snKTsKICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICBpZiAoY2ggPT09ICd9JykgewogICAgICAgICAgICAgICAgICAgIG5leHQoJ30nKTsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2JqZWN0OyAgIC8vIGVtcHR5IG9iamVjdAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgd2hpbGUgKGNoKSB7CiAgICAgICAgICAgICAgICAgICAga2V5ID0gc3RyaW5nKCk7CiAgICAgICAgICAgICAgICAgICAgd2hpdGUoKTsKICAgICAgICAgICAgICAgICAgICBuZXh0KCc6Jyk7CiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iamVjdCwga2V5KSkgewogICAgICAgICAgICAgICAgICAgICAgICBlcnJvcignRHVwbGljYXRlIGtleSAiJyArIGtleSArICciJyk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIG9iamVjdFtrZXldID0gdmFsdWUoKTsKICAgICAgICAgICAgICAgICAgICB3aGl0ZSgpOwogICAgICAgICAgICAgICAgICAgIGlmIChjaCA9PT0gJ30nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQoJ30nKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgbmV4dCgnLCcpOwogICAgICAgICAgICAgICAgICAgIHdoaXRlKCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZXJyb3IoIkJhZCBvYmplY3QiKTsKICAgICAgICB9OwoKICAgIHZhbHVlID0gZnVuY3Rpb24gKCkgewoKICAgICAgICB3aGl0ZSgpOwogICAgICAgIHN3aXRjaCAoY2gpIHsKICAgICAgICBjYXNlICd7JzoKICAgICAgICAgICAgcmV0dXJuIG9iamVjdCgpOwogICAgICAgIGNhc2UgJ1snOgogICAgICAgICAgICByZXR1cm4gYXJyYXkoKTsKICAgICAgICBjYXNlICciJzoKICAgICAgICAgICAgcmV0dXJuIHN0cmluZygpOwogICAgICAgIGNhc2UgJy0nOgogICAgICAgICAgICByZXR1cm4gbnVtYmVyKCk7CiAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgcmV0dXJuIGNoID49ICcwJyAmJiBjaCA8PSAnOScgPyBudW1iZXIoKSA6IHdvcmQoKTsKICAgICAgICB9CiAgICB9OwoKICAgIHJldHVybiBmdW5jdGlvbiAoc291cmNlLCByZXZpdmVyKSB7CiAgICAgICAgdmFyIHJlc3VsdDsKCiAgICAgICAgdGV4dCA9IHNvdXJjZTsKICAgICAgICBhdCA9IDA7CiAgICAgICAgY2ggPSAnICc7CiAgICAgICAgcmVzdWx0ID0gdmFsdWUoKTsKICAgICAgICB3aGl0ZSgpOwogICAgICAgIGlmIChjaCkgewogICAgICAgICAgICBlcnJvcigiU3ludGF4IGVycm9yIik7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gdHlwZW9mIHJldml2ZXIgPT09ICdmdW5jdGlvbicgPyBmdW5jdGlvbiB3YWxrKGhvbGRlciwga2V5KSB7CiAgICAgICAgICAgIHZhciBrLCB2LCB2YWx1ZSA9IGhvbGRlcltrZXldOwogICAgICAgICAgICBpZiAodmFsdWUgJiYgdHlwZW9mIHZhbHVlID09PSAnb2JqZWN0JykgewogICAgICAgICAgICAgICAgZm9yIChrIGluIHZhbHVlKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5oYXNPd25Qcm9wZXJ0eS5jYWxsKHZhbHVlLCBrKSkgewogICAgICAgICAgICAgICAgICAgICAgICB2ID0gd2Fsayh2YWx1ZSwgayk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2ICE9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlW2tdID0gdjsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB2YWx1ZVtrXTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gcmV2aXZlci5jYWxsKGhvbGRlciwga2V5LCB2YWx1ZSk7CiAgICAgICAgfSh7Jyc6IHJlc3VsdH0sICcnKSA6IHJlc3VsdDsKICAgIH07Cn0pOwoKYWNlLmRlZmluZSgiYWNlL21vZGUvanNvbl93b3JrZXIiLFtdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpIHsKInVzZSBzdHJpY3QiOwoKdmFyIG9vcCA9IHJlcXVpcmUoIi4uL2xpYi9vb3AiKTsKdmFyIE1pcnJvciA9IHJlcXVpcmUoIi4uL3dvcmtlci9taXJyb3IiKS5NaXJyb3I7CnZhciBwYXJzZSA9IHJlcXVpcmUoIi4vanNvbi9qc29uX3BhcnNlIik7Cgp2YXIgSnNvbldvcmtlciA9IGV4cG9ydHMuSnNvbldvcmtlciA9IGZ1bmN0aW9uKHNlbmRlcikgewogICAgTWlycm9yLmNhbGwodGhpcywgc2VuZGVyKTsKICAgIHRoaXMuc2V0VGltZW91dCgyMDApOwp9OwoKb29wLmluaGVyaXRzKEpzb25Xb3JrZXIsIE1pcnJvcik7CgooZnVuY3Rpb24oKSB7CgogICAgdGhpcy5vblVwZGF0ZSA9IGZ1bmN0aW9uKCkgewogICAgICAgIHZhciB2YWx1ZSA9IHRoaXMuZG9jLmdldFZhbHVlKCk7CiAgICAgICAgdmFyIGVycm9ycyA9IFtdOwogICAgICAgIHRyeSB7CiAgICAgICAgICAgIGlmICh2YWx1ZSkKICAgICAgICAgICAgICAgIHBhcnNlKHZhbHVlKTsKICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIHZhciBwb3MgPSB0aGlzLmRvYy5pbmRleFRvUG9zaXRpb24oZS5hdC0xKTsKICAgICAgICAgICAgZXJyb3JzLnB1c2goewogICAgICAgICAgICAgICAgcm93OiBwb3Mucm93LAogICAgICAgICAgICAgICAgY29sdW1uOiBwb3MuY29sdW1uLAogICAgICAgICAgICAgICAgdGV4dDogZS5tZXNzYWdlLAogICAgICAgICAgICAgICAgdHlwZTogImVycm9yIgogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgICAgdGhpcy5zZW5kZXIuZW1pdCgiYW5ub3RhdGUiLCBlcnJvcnMpOwogICAgfTsKCn0pLmNhbGwoSnNvbldvcmtlci5wcm90b3R5cGUpOwoKfSk7Cg=="},7907:function(e,t,i){"use strict";i.d(t,{Iu:function(){return h},cC:function(){return c},m0:function(){return l}}),i(4987);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:'Field type "auto". The field type is automatically determined from the value and can be a string, number, boolean, or null.',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:"Codigo",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:"Arbol",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 validas",containsInvalidItems:"Contiene items no validos"},"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:"잘못된 항목이 포함되어 있습니다"}},r=Object.keys(n),o="en",s="undefined"!=typeof navigator?navigator.language||navigator.userLanguage:void 0,a=r.find((function(e){return e===s}))||o;function l(e){var t;e&&((t=r.find((function(t){return t===e})))?a=t:console.error("Language not found"))}function c(e){if(e)for(var t in e)!function(t){r.find((function(e){return e===t}))||r.push(t),n[t]=Object.assign({},n.en,n[t],e[t])}(t)}function h(e,t,i){var r=n[i=i||a][e]||n.en[e]||e;if(t)for(var o in t)r=r.replace("${"+o+"}",t[o]);return r}},6056:function(e,t,i){"use strict";i.d(t,{J:function(){return s},r:function(){return o}});t=i(5156);var n=i.n(t),r=i(9791);function o(e,t){var i,n=t.sort,o=t.filter,s=(t=t.projection,"");return o?(i="@"!==o.field?["0"].concat((0,r.parsePath)("."+o.field)):["0"],i="string"==typeof(0,r.get)(e,i)?o.value:(0,r.parseString)(o.value),s+="[? "+o.field+" "+o.relation+" `"+JSON.stringify(i)+"`]"):s+=Array.isArray(e)?"[*]":"@",n&&("desc"===n.direction?s+=" | reverse(sort_by(@, &"+n.field+"))":s+=" | sort_by(@, &"+n.field+")"),t&&("]"!==s[s.length-1]&&(s+=" | [*]"),1===t.fields.length?s+="."+t.fields[0]:1<t.fields.length&&(s+=".{"+t.fields.map((function(e){var t=e.split(".");return t[t.length-1]+": "+e})).join(", ")+"}")),s}function s(e,t){return n().search(e,t)}},4987:function(){function e(e){void 0===e||"remove"in e||Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){void 0!==this.parentNode&&this.parentNode.removeChild(this)}})}"undefined"!=typeof Element&&(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[e=this.findIndex(e)]},configurable:!0,writable:!0}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})},341:function(e,t,i){"use strict";i.r(t),i.d(t,{previewModeMixins:function(){return m}});t=i(3860);var n=i.n(t),r=i(4188),o=i(6436),s=i(2474);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,n.key,n)}}var l=function(){function e(t,i,n){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.onChange=t,this.calculateItemSize=i||function(){return 1},this.limit=n,this.items=[],this.index=-1}var t,i;return t=e,(i=[{key:"add",value:function(e){for(;this._calculateHistorySize()>this.limit&&1<this.items.length;)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 0<this.index}},{key:"canRedo",value:function(){return this.index<this.items.length-1}},{key:"clear",value:function(){this.items=[],this.index=-1,this.onChange()}}])&&a(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),c=i(7907),h=i(6056),d=i(6617),u=i(6210),g=i(2558),p=(t=i(5956),i(9791)),m=(i=t.textModeMixins[0].mixin,t={create:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=(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||h.r,t.executeQuery=t.executeQuery||h.J,"number"==typeof(this.options=t).indentation?this.indentation=Number(t.indentation):this.indentation=2,(0,c.cC)(this.options.languages),(0,c.m0)(this.options.language),this.mode="preview",this);this.container=e,this.dom={},this.json=void 0,this.text="",this._debouncedValidate=(0,p.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()},e={target:this.frame,onFocus:this.options.onFocus||null,onBlur:this.options.onBlur||null};this.frameFocusTracker=new s.R(e),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,p.addClassName)(this.content,"has-main-menu-bar"),this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu),(e=document.createElement("button")).type="button",e.className="jsoneditor-format",e.title=(0,c.Iu)("formatTitle"),this.menu.appendChild(e),e.onclick=function(){i.executeWithBusyMessage((function(){try{i.format()}catch(e){i._onError(e)}}),"formatting...")},(e=document.createElement("button")).type="button",e.className="jsoneditor-compact",e.title=(0,c.Iu)("compactTitle"),this.menu.appendChild(e),e.onclick=function(){i.executeWithBusyMessage((function(){try{i.compact()}catch(e){i._onError(e)}}),"compacting...")},this.options.enableSort&&((e=document.createElement("button")).type="button",e.className="jsoneditor-sort",e.title=(0,c.Iu)("sortTitleShort"),e.onclick=function(){i._showSortModal()},this.menu.appendChild(e)),this.options.enableTransform&&((e=document.createElement("button")).type="button",e.title=(0,c.Iu)("transformTitleShort"),e.className="jsoneditor-transform",e.onclick=function(){i._showTransformModal()},this.dom.transform=e,this.menu.appendChild(e)),(e=document.createElement("button")).type="button",e.className="jsoneditor-repair",e.title=(0,c.Iu)("repairTitle"),this.menu.appendChild(e),!(e.onclick=function(){void 0===i.json&&i.executeWithBusyMessage((function(){try{i.repair()}catch(e){i._onError(e)}}),"repairing...")})!==this.options.history&&(this.history=new l((function(){i.dom.undo.disabled=!i.history.canUndo(),i.dom.redo.disabled=!i.history.canRedo()}),(function(e){return 2*e.text.length}),r.oW),(e=document.createElement("button")).type="button",e.className="jsoneditor-undo jsoneditor-separator",e.title=(0,c.Iu)("undo"),e.onclick=function(){var e=i.history.undo();e&&i._applyHistory(e)},this.menu.appendChild(e),this.dom.undo=e,(e=document.createElement("button")).type="button",e.className="jsoneditor-redo",e.title=(0,c.Iu)("redo"),e.onclick=function(){var e=i.history.redo();e&&i._applyHistory(e)},this.menu.appendChild(e),this.dom.redo=e,this.history.onChange()),this.options&&this.options.modes&&this.options.modes.length&&(this.modeSwitcher=new d.x(this.menu,this.options.modes,this.options.mode,(function(e){try{i.setMode(e),i.modeSwitcher.focus()}catch(e){i._onError(e)}})))),this.errorTable=new o.Q({errorTableVisible:!0,onToggleVisibility:function(){i.validate()},onFocusLine:null,onChangeHeight:function(e){e=e+(i.dom.statusBar?i.dom.statusBar.clientHeight:0)+1,i.content.style.marginBottom=-e+"px",i.content.style.paddingBottom=e+"px"}}),this.frame.appendChild(this.content),this.frame.appendChild(this.errorTable.getErrorTable()),this.container.appendChild(this.frame),t.statusBar&&((0,p.addClassName)(this.content,"has-status-bar"),e=document.createElement("div"),(this.dom.statusBar=e).className="jsoneditor-statusbar",this.frame.appendChild(e),this.dom.fileSizeInfo=document.createElement("span"),this.dom.fileSizeInfo.className="jsoneditor-size-info",this.dom.fileSizeInfo.innerText="",e.appendChild(this.dom.fileSizeInfo),this.dom.arrayInfo=document.createElement("span"),this.dom.arrayInfo.className="jsoneditor-size-info",this.dom.arrayInfo.innerText="",e.appendChild(this.dom.arrayInfo),e.appendChild(this.errorTable.getErrorCounter()),e.appendChild(this.errorTable.getWarningIcon()),e.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,p.limitCharacters)(e,r.WF),this.dom.fileSizeInfo&&(this.dom.fileSizeInfo.innerText="Size: "+(0,p.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)}}},t._showSortModal=function(){var e=this;this.executeWithBusyMessage((function(){var t=e.options.modalAnchor||r.qD,i=e.get();e._renderPreview(),(0,u.showSortModal)(t,i,(function(t){e.executeWithBusyMessage((function(){var n,r,o;n=i,r=t,Array.isArray(n)&&(o=(0,p.sort)(n,r.path,r.direction),e.sortedBy=r,e._setAndFireOnChange(o)),(0,p.isObject)(n)&&(o=(0,p.sortObjectKeys)(n,r.direction),e.sortedBy=r,e._setAndFireOnChange(o))}),"sorting...")}),e.sortedBy)}),"parsing...")},t._showTransformModal=function(){var e=this;this.executeWithBusyMessage((function(){var t=(o=e.options).createQuery,i=o.executeQuery,n=o.modalAnchor,o=o.queryDescription,s=e.get();e._renderPreview(),(0,g.showTransformModal)({container:n||r.qD,json:s,queryDescription:o,createQuery:t,executeQuery:i,onTransform:function(t){e.executeWithBusyMessage((function(){var n=i(s,t);e._setAndFireOnChange(n)}),"transforming...")}})}),"parsing...")},t.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()},t.compact=function(){var e=this.get(),t=JSON.stringify(e);this._setTextAndFireOnChange(t,e)},t.format=function(){var e=this.get(),t=JSON.stringify(e,null,this.indentation);this._setTextAndFireOnChange(t,e)},t.repair=function(){var e=this.getText();try{var t=n()(e);this._setTextAndFireOnChange(t)}catch(e){}},t.focus=function(){this.dom.transform.focus()},t.set=function(e){this.history&&this.history.clear(),this._set(e)},t.update=function(e){this._set(e)},t._set=function(e){this.text=void 0,this.json=e,this._renderPreview(),this._pushHistory(),this._debouncedValidate()},t._setAndFireOnChange=function(e){this._set(e),this._onChange()},t.get=function(){var e;return void 0===this.json&&(e=this.getText(),this.json=(0,p.parse)(e)),this.json},t.getText=function(){return void 0===this.text&&(this.text=JSON.stringify(this.json,null,this.indentation),!0===this.options.escapeUnicode&&(this.text=(0,p.escapeUnicodeChars)(this.text))),this.text},t.setText=function(e){this.history&&this.history.clear(),this._setText(e)},t.updateText=function(e){this.getText()!==e&&this._setText(e)},t._setText=function(e,t){var i;!0===this.options.escapeUnicode?this.text=(0,p.escapeUnicodeChars)(e):this.text=e,this.json=t,this._renderPreview(),void 0===this.json?(i=this).executeWithBusyMessage((function(){try{i.json=i.get(),i._renderPreview(),i._pushHistory()}catch(e){}}),"parsing..."):this._pushHistory(),this._debouncedValidate()},t._setTextAndFireOnChange=function(e,t){this._setText(e,t),this._onChange()},t._applyHistory=function(e){this.json=e.json,this.text=e.text,this._renderPreview(),this._debouncedValidate()},t._pushHistory=function(){var e;this.history&&(e={text:this.text,json:this.json},this.history.add(e))},t.executeWithBusyMessage=function(e,t){var i;this.getText().length>r.EX?((0,p.addClassName)((i=this).frame,"busy"),i.dom.busyContent.innerText=t,setTimeout((function(){e(),(0,p.removeClassName)(i.frame,"busy"),i.dom.busyContent.innerText=""}),100)):e()},t.validate=i.validate,t._renderErrors=i._renderErrors,[{mode:"preview",mixin:t,data:"json"}])},6210:function(e,t,i){"use strict";i.r(t),i.d(t,{showSortModal:function(){return s}});t=i(483);var n=i.n(t),r=i(7907),o=i(9791);function s(e,t,i,s){var a=Array.isArray(t)?(0,o.getChildPaths)(t):[""],l=s&&s.path&&(0,o.contains)(a,s.path)?s.path:a[0],c=s&&s.direction||"asc";t='<div class="pico-modal-contents"><div class="pico-modal-header">'+(0,r.Iu)("sort")+"</div><form><table><tbody><tr>  <td>"+(0,r.Iu)("sortFieldLabel")+' </td>  <td class="jsoneditor-modal-input">  <div class="jsoneditor-select-wrapper">    <select id="field" title="'+(0,r.Iu)("sortFieldTitle")+'">    </select>  </div>  </td></tr><tr>  <td>'+(0,r.Iu)("sortDirectionLabel")+' </td>  <td class="jsoneditor-modal-input">  <div id="direction" class="jsoneditor-button-group"><input type="button" value="'+(0,r.Iu)("sortAscending")+'" title="'+(0,r.Iu)("sortAscendingTitle")+'" data-value="asc" class="jsoneditor-button-first jsoneditor-button-asc"/><input type="button" value="'+(0,r.Iu)("sortDescending")+'" title="'+(0,r.Iu)("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.Iu)("ok")+'" /></td></tr></tbody></table></form></div>';n()({parent:e,content:t,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"),r=e.modalElem().querySelector("#field"),o=e.modalElem().querySelector("#direction");function s(e){o.value=e,o.className="jsoneditor-button-group jsoneditor-button-group-value-"+o.value}a.forEach((function(e){var t,i=document.createElement("option");i.text=""===(t=e)?"@":"."===t[0]?t.slice(1):t,i.value=e,r.appendChild(i)})),r.value=l||a[0],s(c||"asc"),o.onclick=function(e){s(e.target.getAttribute("data-value"))},n.onclick=function(t){t.preventDefault(),t.stopPropagation(),e.close(),i({path:r.value,direction:o.value})},t&&(t.onsubmit=n.onclick)})).afterClose((function(e){e.destroy()})).show()}},2558:function(e,t,i){"use strict";i.r(t),i.d(t,{showTransformModal:function(){return d}});t=i(483);var n=i.n(t),r=(t=i(3879),i.n(t)),o=i(7907);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})(e)}function a(e,t,i,n){if("boolean"==typeof e||e instanceof Boolean||null===e||"number"==typeof e||e instanceof Number||"string"==typeof e||e instanceof String||e instanceof Date)return JSON.stringify(e);if(Array.isArray(e)){for(var r=e,o=t,l=i,c=n,h=o?l+o:void 0,d=o?"[\n":"[",u=0;u<r.length;u++){var g=r[u];if(o&&(d+=h),d+=void 0!==g&&"function"!=typeof g?a(g,o,h,c):"null",u<r.length-1&&(d+=o?",\n":","),d.length>c)return d+"..."}return d+(o?"\n"+l+"]":"]")}if(e&&"object"===s(e)){var p,m=e,f=t,C=(l=i,n),I=f?l+f:void 0,v=!0,A=f?"{\n":"{";if("function"==typeof m.toJSON)return a(m.toJSON(),f,l,C);for(p in m)if(function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(m,p)){if(v?v=!1:A+=f?",\n":",",(A=(A+=f?I+'"'+p+'": ':'"'+p+'":')+a(m[p],f,I,C)).length>C)return A+"..."}return A+(f?"\n"+l+"}":"}")}}function l(e,t){for(var i="";0<t--;)i+=e;return i}var c=i(9791),h=i(4188);function d(e){var t=e.container,i=e.json,s=void 0===(s=e.queryDescription)?'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>.':s,d=e.createQuery,u=e.executeQuery,g=e.onTransform,p=i;e='<label class="pico-modal-contents"><div class="pico-modal-header">'+(0,o.Iu)("transform")+"</div><p>"+s+'</p><div class="jsoneditor-jmespath-label">'+(0,o.Iu)("transformWizardLabel")+' </div><div id="wizard" class="jsoneditor-jmespath-block jsoneditor-jmespath-wizard">  <table class="jsoneditor-jmespath-wizard-table">    <tbody>      <tr>        <th>'+(0,o.Iu)("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="<">&lt;</option>              <option value="<=">&lt;=</option>              <option value=">">&gt;</option>              <option value=">=">&gt;=</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,o.Iu)("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,o.Iu)("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,o.Iu)("transformQueryLabel")+' </div><div class="jsoneditor-jmespath-block">  <textarea id="query"             rows="4"             autocomplete="off"             autocorrect="off"             autocapitalize="off"             spellcheck="false"            title="'+(0,o.Iu)("transformQueryTitle")+'">[*]</textarea></div><div class="jsoneditor-jmespath-label">'+(0,o.Iu)("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,o.Iu)("ok")+'" autofocus /></div></div>';n()({parent:t,content:e,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"),s=t.querySelector("#filterField"),m=t.querySelector("#filterRelation"),f=t.querySelector("#filterValue"),C=t.querySelector("#sortField"),I=t.querySelector("#sortOrder"),v=t.querySelector("#selectFields"),A=t.querySelector("#query"),b=t.querySelector("#preview");Array.isArray(p)||(n.style.fontStyle="italic",n.textContent="(wizard not available for objects, only for arrays)"),(0,c.getChildPaths)(i).forEach((function(e){var t;e=k(e);(t=((t=document.createElement("option")).text=e,t.value=e,s.appendChild(t),document.createElement("option"))).text=e,t.value=e,C.appendChild(t)}));n=(0,c.getChildPaths)(i,!0).filter((function(e){return""!==e})),0<n.length?n.forEach((function(e){e=k(e);var t=document.createElement("option");t.text=e,t.value=e,v.appendChild(t)})):(n=t.querySelector("#selectFieldsPart"))&&(n.style.display="none"),n=new(r())(s,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"field..."});var y=new(r())(m,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"compare..."}),w=new(r())(C,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"field..."}),S=new(r())(I,{defaultSelected:!1,clearable:!0,allowDeselect:!0,placeholder:"order..."}),x=new(r())(v,{multiple:!0,clearable:!0,defaultSelected:!1,placeholder:"select fields..."});function k(e){return""===e?"@":"."===e[0]?e.slice(1):e}n.on("selectr.change",T),y.on("selectr.change",T),f.oninput=T,w.on("selectr.change",T),S.on("selectr.change",T),x.on("selectr.change",T),t.querySelector(".pico-modal-contents").onclick=function(e){"A"!==e.target.nodeName&&e.preventDefault()};var E=(0,c.debounce)((function(){try{var e=u(p,A.value);b.className="jsoneditor-transform-preview",b.value=(t=e,i=2,n=h.WF,"number"==typeof i?10<i?r=l(" ",10):1<=i&&(r=l(" ",i)):"string"==typeof i&&""!==i&&(r=i),(i=a(t,r,"",n)).length>n?(t=i,("number"==typeof(r=n)?t.slice(0,r):t)+"..."):i),o.disabled=!1}catch(e){b.className="jsoneditor-transform-preview jsoneditor-error",b.value=e.toString(),o.disabled=!0}var t,i,n,r}),300);function R(e,t){try{A.value=d(e,t),o.disabled=!1,E()}catch(t){e='Error: an error happened when executing "createQuery": '+(t.message||t.toString()),A.value="",o.disabled=!0,b.className="jsoneditor-transform-preview jsoneditor-error",b.value=e}}function T(){var e={};if(s.value&&m.value&&f.value&&(e.filter={field:s.value,relation:m.value,value:f.value}),C.value&&I.value&&(e.sort={field:C.value,direction:I.value}),v.value){for(var t,n=[],r=0;r<v.options.length;r++)v.options[r].selected&&(t=v.options[r].value,n.push(t));e.projection={fields:n}}R(i,e)}A.oninput=E,o.onclick=function(t){t.preventDefault(),t.stopPropagation(),e.close(),g(A.value)},R(i,{}),setTimeout((function(){A.select(),A.focus(),A.selectionStart=3,A.selectionEnd=3}))})).afterClose((function(e){e.destroy()})).show()}},5956:function(e,t,i){"use strict";i.r(t),i.d(t,{textModeMixins:function(){return I}});t=i(3860);var n=i.n(t),r=(t=i(8170),i.n(t)),o=i(4188),s=i(6436),a=i(2474),l=i(7907),c=i(6056),h=i(6617),d=i(6210),u=i(2558),g=i(9125),p=i(9791);function m(e){return(m="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})(e)}var f="ace/theme/jsoneditor";function C(){try{this.format()}catch(e){}}(t={}).create=function(e){var t,i,n,o=this,d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},u=(void 0===d.statusBar&&(d.statusBar=!0),d.mainMenuBar=!1!==d.mainMenuBar,d.enableSort=!1!==d.enableSort,d.enableTransform=!1!==d.enableTransform,d.createQuery=d.createQuery||c.r,d.executeQuery=d.executeQuery||c.J,"number"==typeof(this.options=d).indentation?this.indentation=Number(d.indentation):this.indentation=2,(0,l.cC)(this.options.languages),(0,l.m0)(this.options.language),d.ace||r()),C=(this.mode="code"===d.mode?"code":"text","code"===this.mode&&void 0===u&&(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=d.theme||f,this.theme===f&&u&&(0,g.O)(),d.onTextSelectionChange&&this.onTextSelectionChange(d.onTextSelectionChange),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,p.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){C._onKeyDown(e)},e={target:this.frame,onFocus:this.options.onFocus||null,onBlur:this.options.onBlur||null},this.frameFocusTracker=new a.R(e),this.content=document.createElement("div"),this.content.className="jsoneditor-outer",this.options.mainMenuBar&&((0,p.addClassName)(this.content,"has-main-menu-bar"),this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu),(e=document.createElement("button")).type="button",e.className="jsoneditor-format",e.title=(0,l.Iu)("formatTitle"),this.menu.appendChild(e),e.onclick=function(){try{C.format(),C._onChange()}catch(e){C._onError(e)}},(e=document.createElement("button")).type="button",e.className="jsoneditor-compact",e.title=(0,l.Iu)("compactTitle"),this.menu.appendChild(e),e.onclick=function(){try{C.compact(),C._onChange()}catch(e){C._onError(e)}},this.options.enableSort&&((e=document.createElement("button")).type="button",e.className="jsoneditor-sort",e.title=(0,l.Iu)("sortTitleShort"),e.onclick=function(){C._showSortModal()},this.menu.appendChild(e)),this.options.enableTransform&&((e=document.createElement("button")).type="button",e.title=(0,l.Iu)("transformTitleShort"),e.className="jsoneditor-transform",e.onclick=function(){C._showTransformModal()},this.menu.appendChild(e)),(e=document.createElement("button")).type="button",e.className="jsoneditor-repair",e.title=(0,l.Iu)("repairTitle"),this.menu.appendChild(e),e.onclick=function(){try{C.repair(),C._onChange()}catch(e){C._onError(e)}},"code"===this.mode&&((e=document.createElement("button")).type="button",e.className="jsoneditor-undo jsoneditor-separator",e.title=(0,l.Iu)("undo"),e.onclick=function(){o.aceEditor.getSession().getUndoManager().undo()},this.menu.appendChild(e),this.dom.undo=e,(e=document.createElement("button")).type="button",e.className="jsoneditor-redo",e.title=(0,l.Iu)("redo"),e.onclick=function(){o.aceEditor.getSession().getUndoManager().redo()},this.menu.appendChild(e),this.dom.redo=e),this.options&&this.options.modes&&this.options.modes.length&&(this.modeSwitcher=new h.x(this.menu,this.options.modes,this.options.mode,(function(e){try{C.setMode(e),C.modeSwitcher.focus()}catch(e){C._onError(e)}}))),"code"===this.mode&&((t=document.createElement("a")).appendChild(document.createTextNode("powered by ace")),t.href="https://ace.c9.io/",t.target="_blank",t.className="jsoneditor-poweredBy",t.onclick=function(){window.open(t.href,t.target,"noreferrer")},this.menu.appendChild(t))),e=this.options.onEditable&&m("function"===this.options.onEditable)&&!this.options.onEditable({});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),n=(u=u.edit(this.editorDom)).getSession(),u.$blockScrolling=1/0,u.setTheme(this.theme),u.setOptions({readOnly:e}),u.setShowPrintMargin(!1),u.setFontSize("14px"),n.setMode("ace/mode/json"),n.setTabSize(this.indentation),n.setUseSoftTabs(!0),n.setUseWrapMode(!0),i=n.setAnnotations,n.setAnnotations=function(e){i.call(this,e&&e.length?e:C.annotations)},u.commands.bindKey("Ctrl-L",null),u.commands.bindKey("Command-L",null),u.commands.bindKey("Ctrl-\\",null),u.commands.bindKey("Command-\\",null),u.commands.bindKey("Ctrl-Shift-\\",null),u.commands.bindKey("Command-Shift-\\",null),(this.aceEditor=u).on("change",this._onChange.bind(this)),u.on("changeSelection",this._onSelect.bind(this))):((n=document.createElement("textarea")).className="jsoneditor-text",n.spellcheck=!1,this.content.appendChild(n),this.textarea=n,this.textarea.readOnly=e,null===this.textarea.oninput?this.textarea.oninput=this._onChange.bind(this):this.textarea.onchange=this._onChange.bind(this),n.onselect=this._onSelect.bind(this),n.onmousedown=this._onMouseDown.bind(this),n.onblur=this._onBlur.bind(this)),this._updateHistoryButtons(),this.errorTable=new s.Q({errorTableVisible:"text"===this.mode,onToggleVisibility:function(){C._validateAndCatch()},onFocusLine:function(e){C.isFocused=!0,isNaN(e)||C.setTextSelection({row:e,column:1},{row:e,column:1e3})},onChangeHeight:function(e){e=e+(C.dom.statusBar?C.dom.statusBar.clientHeight:0)+1,C.content.style.marginBottom=-e+"px",C.content.style.paddingBottom=e+"px"}}),this.frame.appendChild(this.errorTable.getErrorTable()),d.statusBar&&((0,p.addClassName)(this.content,"has-status-bar"),this.curserInfoElements={},u=document.createElement("div"),(this.dom.statusBar=u).className="jsoneditor-statusbar",this.frame.appendChild(u),(e=document.createElement("span")).className="jsoneditor-curserinfo-label",e.innerText="Ln:",(n=document.createElement("span")).className="jsoneditor-curserinfo-val",n.innerText="1",u.appendChild(e),u.appendChild(n),(d=document.createElement("span")).className="jsoneditor-curserinfo-label",d.innerText="Col:",(e=document.createElement("span")).className="jsoneditor-curserinfo-val",e.innerText="1",u.appendChild(d),u.appendChild(e),this.curserInfoElements.colVal=e,this.curserInfoElements.lnVal=n,(d=document.createElement("span")).className="jsoneditor-curserinfo-label",d.innerText="characters selected",d.style.display="none",(e=document.createElement("span")).className="jsoneditor-curserinfo-count",e.innerText="0",e.style.display="none",this.curserInfoElements.countLabel=d,this.curserInfoElements.countVal=e,u.appendChild(e),u.appendChild(d),u.appendChild(this.errorTable.getErrorCounter()),u.appendChild(this.errorTable.getWarningIcon()),u.appendChild(this.errorTable.getErrorIcon())),this.setSchema(this.options.schema,this.options.schemaRefs)},t._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)}}},t._updateHistoryButtons=function(){var e;this.aceEditor&&this.dom.undo&&this.dom.redo&&(e=this.aceEditor.getSession().getUndoManager())&&e.hasUndo&&e.hasRedo&&(this.dom.undo.disabled=!e.hasUndo(),this.dom.redo.disabled=!e.hasRedo())},t._showSortModal=function(){try{var e=this,t=this.options.modalAnchor||o.qD,i=this.get();(0,d.showSortModal)(t,i,(function(t){var n;Array.isArray(i)&&(n=(0,p.sort)(i,t.path,t.direction),e.sortedBy=t,e.update(n)),(0,p.isObject)(i)&&(n=(0,p.sortObjectKeys)(i,t.direction),e.sortedBy=t,e.update(n))}),e.sortedBy)}catch(t){this._onError(t)}},t._showTransformModal=function(){var e=this;try{var t=this.options,i=t.modalAnchor,n=t.createQuery,r=t.executeQuery,s=t.queryDescription,a=this.get();(0,u.showTransformModal)({container:i||o.qD,json:a,queryDescription:s,createQuery:n,executeQuery:r,onTransform:function(t){t=r(a,t),e.update(t)}})}catch(t){this._onError(t)}},t._onSelect=function(){this._updateCursorInfo(),this._emitSelectionChange()},t._onKeyDown=function(e){var t=!1;73===(e.which||e.keyCode)&&e.ctrlKey&&(e.shiftKey?this.compact():this.format(),this._onChange(),t=!0),t&&(e.preventDefault(),e.stopPropagation()),this._updateCursorInfo(),this._emitSelectionChange()},t._onMouseDown=function(){this._updateCursorInfo(),this._emitSelectionChange()},t._onBlur=function(){var e=this;setTimeout((function(){e.isFocused||(e._updateCursorInfo(),e._emitSelectionChange()),e.isFocused=!1}))},t._updateCursorInfo=function(){var e,t,i,n,r,o=this;function s(){o.curserInfoElements.countVal.innerText!==r&&(o.curserInfoElements.countVal.innerText=r,o.curserInfoElements.countVal.style.display=r?"inline":"none",o.curserInfoElements.countLabel.style.display=r?"inline":"none"),o.curserInfoElements.lnVal.innerText=i,o.curserInfoElements.colVal.innerText=n}this.textarea?setTimeout((function(){var e=(0,p.getInputSelection)(o.textarea);e.startIndex!==e.endIndex&&(r=e.endIndex-e.startIndex),n=r&&o.cursorInfo&&o.cursorInfo.line===e.end.row&&o.cursorInfo.column===e.end.column?(i=e.start.row,e.start.column):(i=e.end.row,e.end.column),o.cursorInfo={line:i,column:n,count:r},o.options.statusBar&&s()}),0):this.aceEditor&&this.curserInfoElements&&(e=this.aceEditor.getCursorPosition(),t=this.aceEditor.getSelectedText(),i=e.row+1,n=e.column+1,r=t.length,o.cursorInfo={line:i,column:n,count:r},this.options.statusBar&&s())},t._emitSelectionChange=function(){var e;this._selectionChangedHandler&&(e=this.getTextSelection(),this._selectionChangedHandler(e.start,e.end,e.text))},t._refreshAnnotations=function(){var e,t=this.aceEditor&&this.aceEditor.getSession();t&&(e=t.getAnnotations().filter((function(e){return"error"===e.type})),t.setAnnotations(e))},t.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()},t.compact=function(){var e=this.get();e=JSON.stringify(e);this.updateText(e)},t.format=function(){var e=this.get();e=JSON.stringify(e,null,this.indentation);this.updateText(e)},t.repair=function(){var e=this.getText();try{var t=n()(e);this.updateText(t)}catch(e){}},t.focus=function(){this.textarea&&this.textarea.focus(),this.aceEditor&&this.aceEditor.focus()},t.resize=function(){this.aceEditor&&this.aceEditor.resize(!1)},t.set=function(e){this.setText(JSON.stringify(e,null,this.indentation))},t.update=function(e){this.updateText(JSON.stringify(e,null,this.indentation))},t.get=function(){var e=this.getText();return(0,p.parse)(e)},t.getText=function(){return this.textarea?this.textarea.value:this.aceEditor?this.aceEditor.getValue():""},t._setText=function(e,t){var i,n=this;e=!0===this.options.escapeUnicode?(0,p.escapeUnicodeChars)(e):e;this.textarea&&(this.textarea.value=e),this.aceEditor&&(this.onChangeDisabled=!0,this.aceEditor.setValue(e,-1),this.onChangeDisabled=!1,t&&(i=this,setTimeout((function(){i.aceEditor&&i.aceEditor.session.getUndoManager().reset()}))),setTimeout((function(){n._updateHistoryButtons&&n._updateHistoryButtons()}))),this._debouncedValidate()},t.setText=function(e){this._setText(e,!0)},t.updateText=function(e){this.getText()!==e&&this._setText(e,!1)},t.validate=function(){var e,t=this,i=[],n=[];try{var r=this.get(),o=(this.validateSchema&&!this.validateSchema(r)&&(i=this.validateSchema.errors.map((function(e){return e.type="validation",(0,p.improveSchemaError)(e)}))),this.validationSequence=(this.validationSequence||0)+1,this),s=this.validationSequence;return function(e,t){if(!t)return Promise.resolve([]);try{var i=t(e);return((0,p.isPromise)(i)?i:Promise.resolve(i)).then((function(e){return Array.isArray(e)?e.filter((function(e){var t=(0,p.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,p.stringifyPath)(e.path),message:e.message,type:"customValidation"}})):[]}))}catch(e){return Promise.reject(e)}}(r,this.options.onValidate).then((function(e){return s===o.validationSequence&&(e=i.concat(n).concat(e),o._renderErrors(e),"function"==typeof t.options.onValidationError&&(0,p.isValidationErrorChanged)(e,t.lastSchemaErrors)&&t.options.onValidationError.call(t,e),t.lastSchemaErrors=e),t.lastSchemaErrors}))}catch(t){return this.getText()&&((r=/\w*line\s*(\d+)\w*/g.exec(t.message))&&(e=+r[1]),n=[{type:"error",message:t.message.replace(/\n/g,"<br>"),line:e}]),this._renderErrors(n),"function"==typeof this.options.onValidationError&&(0,p.isValidationErrorChanged)(n,this.lastSchemaErrors)&&this.options.onValidationError.call(this,n),this.lastSchemaErrors=n,Promise.resolve(this.lastSchemaErrors)}},t._validateAndCatch=function(){this.validate().catch((function(e){console.error("Error running validation:",e)}))},t._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),t=(0,p.getPositionForPath)(t,i);this.aceEditor&&(this.annotations=t.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,t),this.aceEditor&&this.aceEditor.resize(!1)},t.getTextSelection=function(){var e,t,i,n={};return this.textarea?(i=(0,p.getInputSelection)(this.textarea),this.cursorInfo&&this.cursorInfo.line===i.end.row&&this.cursorInfo.column===i.end.column?(n.start=i.end,n.end=i.start):n=i,{start:n.start,end:n.end,text:this.textarea.value.substring(i.startIndex,i.endIndex)}):this.aceEditor?(i=this.aceEditor.getSelection(),e=this.aceEditor.getSelectedText(),t=i.getRange(),(i=i.getSelectionLead()).row===t.end.row&&i.column===t.end.column?n=t:(n.start=t.end,n.end=t.start),{start:{row:n.start.row+1,column:n.start.column+1},end:{row:n.end.row+1,column:n.end.column+1},text:e}):void 0},t.onTextSelectionChange=function(e){"function"==typeof e&&(this._selectionChangedHandler=(0,p.debounce)(e,this.DEBOUNCE_INTERVAL))},t.setTextSelection=function(e,t){var i,n,r;e&&t&&(this.textarea?(i=(0,p.getIndexForPosition)(this.textarea,e.row,e.column),r=(0,p.getIndexForPosition)(this.textarea,t.row,t.column),-1<i&&-1<r&&(this.textarea.setSelectionRange?(this.textarea.focus(),this.textarea.setSelectionRange(i,r)):this.textarea.createTextRange&&((n=this.textarea.createTextRange()).collapse(!0),n.moveEnd("character",r),n.moveStart("character",i),n.select()),r=(this.textarea.value.match(/\n/g)||[]).length+1,i=this.textarea.scrollHeight/r,n=e.row*i,this.textarea.scrollTop=n>this.textarea.clientHeight?n-this.textarea.clientHeight/2:0)):this.aceEditor&&(r={start:{row:e.row-1,column:e.column-1},end:{row:t.row-1,column:t.column-1}},this.aceEditor.selection.setRange(r),this.aceEditor.scrollToLine(e.row-1,!0)))};var I=[{mode:"text",mixin:t,data:"text",load:C},{mode:"code",mixin:t,data:"text",load:C}]},8038:function(e,t,i){"use strict";i.r(t),i.d(t,{treeModeMixins:function(){return V}});var n={start:function(e,t,i){return 0===t.indexOf(e)},contain:function(e,t,i){return-1<t.indexOf(e)}},r=i(897),o=i(2474);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,n.key,n)}}var a=function(){function e(){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.locked=!1}var t,i;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(){var e;this.locked||(e=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}}])&&s(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),l=i(7907),c=i(6056),h=i(6617),d=(t=i(233),i.n(t)),u=i(2602),g=i(9791),p=i(6210),m=i(2558),f=i(4188);function C(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||A(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 I(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,r,o=[],s=!0,a=!1;try{for(i=i.call(e);!(s=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);s=!0);}catch(e){a=!0,r=e}finally{try{s||null==i.return||i.return()}finally{if(a)throw r}}return o}}(e,t)||A(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 v(e,t){var i,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=A(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),i=0,{s:t=function(){},n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t};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,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,r=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw r}}}}function A(e,t){if(e){if("string"==typeof e)return b(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(i="Object"===i&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?b(e,t):void 0}}function b(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 y(e){return(y="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})(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,n.key,n)}}var S=function(){function e(t,i){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");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,g.debounce)(this._onChangeValue.bind(this),e.prototype.DEBOUNCE_INTERVAL),this._debouncedOnChangeField=(0,g.debounce)(this._onChangeField.bind(this),e.prototype.DEBOUNCE_INTERVAL),this.visibleChilds=this.getMaxVisibleChilds()}var t,i;return t=e,(i=[{key:"getMaxVisibleChilds",value:function(){return this.editor&&this.editor.options&&this.editor.options.maxVisibleChilds?this.editor.options.maxVisibleChilds:x}},{key:"_updateEditability",value:function(){var e,t;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||(e=this.getValue.bind(this),"boolean"==typeof(t=this.editor.options.onEditable({field:this.field,get value(){return e()},path:this.getPath()}))?(this.editable.field=t,this.editable.value=t):"object"===y(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,g.parsePath)(e),i=this;i&&0<t.length;)!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]}}();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,g.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"),r=(n.type="button",n.className="jsoneditor-button jsoneditor-schema-error",function(){e.dom.popupAnchor&&e.dom.popupAnchor.destroy()}),o=function(){delete e.dom.popupAnchor},s=function(i){var r=e.editor.frame;e.dom.popupAnchor=(0,u.w)(n,e.editor.getPopupAnchor(),o,i),i=n.getBoundingClientRect(),r=120<r.getBoundingClientRect().width-i.x?"jsoneditor-above":"jsoneditor-left";(i=document.createElement("div")).className="jsoneditor-popover "+r,i.appendChild(document.createTextNode(t.message)),e.dom.popupAnchor.appendChild(i)},a=(n.onmouseover=function(){e.dom.popupAnchor||s(!0)},n.onfocus=function(){r(),s(!1)},n.onblur=function(){r()},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,g.removeClassName)(this.dom.tr,"jsoneditor-validation-error"),i&&(this.dom.tdError.parentNode.removeChild(this.dom.tdError),delete this.dom.tdError)}},{key:"getIndex",value:function(){var e;return this.parent?-1!==(e=this.parent.childs.indexOf(this))?e:null:-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,r,o,s,a,l,c=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=[]),n=0;n<t.length;n++)void 0===(a=t[n])||a instanceof Function||(n<this.childs.length?((o=this.childs[n]).fieldEditable=!1,o.index=n,o.setValue(a)):(o=new e(this.editor,{value:a}),s=n<this.getMaxVisibleChilds(),this.appendChild(o,s,!1)));for(r=this.childs.length;r>=t.length;r--)this.removeChild(this.childs[r],!1)}else if("object"===this.type){for(this.childs||(this.childs=[]),r=this.childs.length-1;0<=r;r--)R(t,this.childs[r].field)||this.removeChild(this.childs[r],!1);for(var h in n=0,t)R(t,h)&&(void 0===(a=t[h])||a instanceof Function||((l=this.findChildByProperty(h))?(l.setField(h,!0),l.setValue(a)):(l=new e(this.editor,{field:h,value:a}),h=n<this.getMaxVisibleChilds(),this.appendChild(l,h,!1))),n++);!(this.value="")===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(c)!==Array.isArray(this.childs)&&this.recreateDom(),this.updateDom({updateIndexes:!0}),this.previousValue=this.value}},{key:"setInternalValue",value:function(t){var i,n,r,o,s,a=this.childs;if(this.type=t.type,"array"===t.type){for(this.childs||(this.childs=[]),o=0;o<t.childs.length;o++)void 0===(i=t.childs[o])||i instanceof Function||(o<this.childs.length?((n=this.childs[o]).fieldEditable=!1,n.index=o,n.setInternalValue(i)):(n=new e(this.editor,{internalValue:i}),r=o<this.getMaxVisibleChilds(),this.appendChild(n,r,!1)));for(s=this.childs.length;s>=t.childs.length;s--)this.removeChild(this.childs[s],!1)}else if("object"===t.type){for(this.childs||(this.childs=[]),o=0;o<t.childs.length;o++)void 0===(i=t.childs[o])||i instanceof Function||(o<this.childs.length?(delete(n=this.childs[o]).index,n.setField(i.field,!0),n.setInternalValue(i.value)):(n=new e(this.editor,{field:i.field,internalValue:i.value}),r=o<this.getMaxVisibleChilds(),this.appendChild(n,r,!1)));for(s=this.childs.length;s>=t.childs.length;s--)this.removeChild(this.childs[s],!1)}else this.hideChilds(),delete this.append,delete this.showMore,delete this.expanded,delete this.childs,this.value=t.value;Array.isArray(a)!==Array.isArray(this.childs)&&this.recreateDom(),this.updateDom({updateIndexes:!0}),this.previousValue=this.value}},{key:"recreateDom",value:function(){var e;this.dom&&this.dom.tr&&this.dom.tr.parentNode?(e=this._detachFromDom(),this.clearDom(),this._attachToDom(e)):this.clearDom()}},{key:"getValue",value:function(){var e,t;return"array"===this.type?(e=[],this.childs.forEach((function(t){e.push(t.getValue())})),e):"object"===this.type?(t={},this.childs.forEach((function(e){t[e.getField()]=e.getValue()})),t):(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,i;return(t=new e(this.editor)).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?(i=[],this.childs.forEach((function(e){(e=e.clone()).setParent(t),i.push(e)})),t.childs=i):t.childs=void 0,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((e=this.childs)&&this.expanded){var e,t=(e=this.dom.tr)?e.parentNode:void 0;if(t){for(var i=this.getAppendDom(),n=(i.parentNode||((r=e.nextSibling)?t.insertBefore(i,r):t.appendChild(i)),Math.min(this.childs.length,this.visibleChilds)),r=this._getNextTr(),o=0;o<n;o++){var s=this.childs[o];s.getDom().parentNode||t.insertBefore(s.getDom(),r),s.showChilds()}e=this.getShowMoreDom(),r=this._getNextTr(),e.parentNode||t.insertBefore(e,r),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){var t;this.childs&&this.expanded&&((t=this.getAppendDom()).parentNode&&t.parentNode.removeChild(t),this.childs.forEach((function(e){e.hide()})),(t=this.getShowMoreDom()).parentNode&&t.parentNode.removeChild(t),e&&!e.resetVisibleChilds||(this.visibleChilds=this.getMaxVisibleChilds()))}},{key:"_updateCssClassName",value:function(){var e,t;this.dom.field&&this.editor&&this.editor.options&&"function"==typeof this.editor.options.onClassName&&this.dom.tree&&((0,g.removeAllClassNames)(this.dom.tree),e=this.getValue.bind(this),t=this.editor.options.onClassName({path:this.getPath(),field:this.field,get value(){return e()}})||"",(0,g.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){var n,r;this._hasChilds()&&(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&&(t=e.getDom(),r=(n=this._getNextTr())?n.parentNode:void 0,n&&r&&r.insertBefore(t,n),e.showChilds(),this.visibleChilds++),!1!==i&&(this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0})))}},{key:"moveBefore",value:function(e,t,i){var n,r,o;this._hasChilds()&&((n=this.dom.tr?this.dom.tr.parentNode:void 0)&&((r=document.createElement("tr")).style.height=n.clientHeight+"px",n.appendChild(r)),e.parent&&e.parent.removeChild(e),t instanceof T||!t?this.childs.length+1>this.visibleChilds?(o=this.childs[this.visibleChilds-1],this.insertBefore(e,o,i)):this.appendChild(e,!0,i):this.insertBefore(e,t,i),n&&r&&n.removeChild(r))}},{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)}var r;this.expanded&&(n=e.getDom(),r=(t=t.getDom())?t.parentNode:void 0,t&&r&&r.insertBefore(n,t),e.showChilds(),this.showChilds()),!1!==i&&(this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0}))}}},{key:"insertAfter",value:function(e,t){this._hasChilds()&&(t=this.childs.indexOf(t),(t=this.childs[t+1])?this.insertBefore(e,t):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.menu).focus();break;case"menu":i.menu.focus();break;case"expand":this._hasChilds()?i.expand.focus():i.field&&this.fieldEditable?(i.field.focus(),(0,g.selectContentEditable)(i.field)):i.value&&!this._hasChilds()?(i.value.focus(),(0,g.selectContentEditable)(i.value)):i.menu.focus();break;case"field":i.field&&this.fieldEditable?(i.field.focus(),(0,g.selectContentEditable)(i.field)):i.value&&!this._hasChilds()?(i.value.focus(),(0,g.selectContentEditable)(i.value)):(this._hasChilds()?i.expand:i.menu).focus();break;default:i.select?i.select.focus():i.value&&!this._hasChilds()?(i.value.focus(),(0,g.selectContentEditable)(i.value)):i.field&&this.fieldEditable?(i.field.focus(),(0,g.selectContentEditable)(i.field)):(this._hasChilds()?i.expand: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)return i<this.visibleChilds&&this.expanded&&this.visibleChilds--,e.hide(),delete e.searchField,delete e.searchValue,(e=this.childs.splice(i,1)[0]).parent=null,!1!==t&&this.updateDom({updateIndexes:!0}),e}}},{key:"_remove",value:function(e){this.removeChild(e)}},{key:"changeType",value:function(e){var t,i=this.type;i!==e&&("string"!==e&&"auto"!==e||"string"!==i&&"auto"!==i?(t=this._detachFromDom(),this.clearDom(),"object"===(this.type=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"!==i&&"auto"!==i||(this.expanded=!0)):"array"===e?(this.childs||(this.childs=[]),this.childs.forEach((function(e,t){e.clearDom(),e.fieldEditable=!1,e.index=t})),"string"!==i&&"auto"!==i||(this.expanded=!0)):this.expanded=!1,this._attachToDom(t)):this.type=e,"auto"!==e&&"string"!==e||(this.value="string"===e?String(this.value):(0,g.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"!==y(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,g.getInnerText)(this.dom.value),""===this.valueInnerText&&""!==this.dom.value.innerHTML&&(this.dom.value.textContent="")),void 0!==this.valueInnerText)try{var e,t;(t="string"===this.type?this._unescapeHTML(this.valueInnerText):(e=this._unescapeHTML(this.valueInnerText),(0,g.parseString)(e)))!==this.value&&(this.value=t,this._debouncedOnChangeValue())}catch(e){this._setValueError((0,l.Iu)("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,t=this.editor.getDomSelection(),i=(t.range&&(i=(0,g.textDiff)(String(this.value),String(this.previousValue)),t.range.startOffset=i.start,t.range.endOffset=i.end),this.editor.getDomSelection());i.range&&(e=(0,g.textDiff)(String(this.previousValue),String(this.value)),i.range.startOffset=e.start,i.range.endOffset=e.end),this.editor._onAction("editValue",{path:this.getInternalPath(),oldValue:this.previousValue,newValue:this.value,oldSelection:t,newSelection:i}),this.previousValue=this.value}},{key:"_onChangeField",value:function(){var e=this.editor.getDomSelection(),t=this.previousField||"",i=(e.range&&(i=(0,g.textDiff)(this.field,t),e.range.startOffset=i.start,e.range.endOffset=i.end),this.editor.getDomSelection());i.range&&(t=(0,g.textDiff)(t,this.field),i.range.startOffset=t.start,i.range.endOffset=t.end),this.editor._onAction("editField",{parentPath:this.parent.getInternalPath(),index:this.getIndex(),oldValue:this.previousField,newValue:this.field,oldSelection:e,newSelection:i}),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,g.getType)(i):this.type,r="string"===n&&(0,g.isUrl)(i);if(t.push("jsoneditor-"+n),r&&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?(t=this.childs?this.childs.length:0,e.title=this.type+" containing "+t+" items"):r&&this.editable.value?e.title=(0,l.Iu)("openUrl"):e.title="","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?(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,(t=document.createElement("option")).value="",t.textContent="--",this.dom.select.appendChild(t),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||R(this.schema,"oneOf")||R(this.schema,"anyOf")||R(this.schema,"allOf")?delete this.valueFieldHTML:(this.valueFieldHTML=this.dom.tdValue.innerHTML,this.dom.tdValue.style.visibility="hidden",this.dom.tdValue.textContent="")):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)),this.editor.options.colorPicker&&"string"==typeof i&&(0,g.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,g.addClassName)(this.dom.value,"jsoneditor-color-value"),(this.editable.value?g.removeClassName:g.addClassName)(this.dom.color,"jsoneditor-color-readonly"),this.dom.color.style.backgroundColor=i):this._deleteDomColor(),this._showTimestampTag()){if(this.dom.date||(this.dom.date=document.createElement("div"),this.dom.date.className="jsoneditor-date",this.dom.value.parentNode.appendChild(this.dom.date)),r=null,r="function"==typeof this.editor.options.timestampFormat?this.editor.options.timestampFormat({field:this.field,value:this.value,path:this.getPath()}):r){for(;this.dom.date.firstChild;)this.dom.date.removeChild(this.dom.date.firstChild);this.dom.date.appendChild(document.createTextNode(r))}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,g.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,g.removeClassName)(this.dom.value,"jsoneditor-color-value"))}},{key:"_updateDomField",value:function(){var e,t=this.dom.field;t&&((e=(0,g.makeFieldTooltip)(this.schema,this.editor.options.language))&&(t.title=e),(""===String(this.field)&&this.parent&&"array"!==this.parent.type?g.addClassName:g.removeClassName)(t,"jsoneditor-empty"),(this.searchFieldActive?g.addClassName:g.removeClassName)(t,"jsoneditor-highlight-active"),(this.searchField?g.addClassName:g.removeClassName)(t,"jsoneditor-highlight"),(0,g.stripFormatting)(t))}},{key:"_getDomField",value:function(e){if(this._clearFieldError(),this.dom.field&&this.fieldEditable&&(this.fieldInnerText=(0,g.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,g.findUniqueName)(t,i))!==this.field&&(this.field=t,this._debouncedOnChangeField()):this._setFieldError((0,l.Iu)("duplicateFieldError")):t!==this.field&&(this.field=t,this._debouncedOnChangeField())}catch(e){this._setFieldError((0,l.Iu)("cannotParseFieldError"))}}},{key:"_updateDomDefault",value:function(){var e;this.schema&&void 0!==this.schema.default&&!this._hasChilds()&&(e=this.dom.select||this.dom.value)&&(this.value===this.schema.default?(e.title=(0,l.Iu)("default"),(0,g.addClassName)(e,"jsoneditor-is-default"),(0,g.removeClassName)(e,"jsoneditor-is-not-default")):(e.removeAttribute("title"),(0,g.removeClassName)(e,"jsoneditor-is-default"),(0,g.addClassName)(e,"jsoneditor-is-not-default")))}},{key:"_showTimestampTag",value:function(){if("number"!=typeof this.value)return!1;var e,t=this.editor.options.timestampTag;return"function"==typeof t?"boolean"==typeof(e=t({field:this.field,value:this.value,path:this.getPath()}))?e:(0,g.isTimestamp)(this.field,this.value):!0===t&&(0,g.isTimestamp)(this.field,this.value)}},{key:"clearDom",value:function(){this.dom={}}},{key:"getDom",value:function(){var e,t=this.dom;if(t.tr)return t.tr;this._updateEditability(),t.tr=document.createElement("tr"),"tree"===(t.tr.node=this).editor.options.mode&&(i=document.createElement("td"),this.editable.field&&this.parent&&((e=document.createElement("button")).type="button",(t.drag=e).className="jsoneditor-button jsoneditor-dragarea",e.title=(0,l.Iu)("drag"),i.appendChild(e)),t.tr.appendChild(i),e=document.createElement("td"),(i=document.createElement("button")).type="button",(t.menu=i).className="jsoneditor-button jsoneditor-contextmenu-button",i.title=(0,l.Iu)("actionsMenu"),e.appendChild(t.menu),t.tr.appendChild(e));var i=document.createElement("td");return t.tr.appendChild(i),t.tree=this._createDomTree(),i.appendChild(t.tree),this.updateDom({updateIndexes:!0}),t.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?g.addClassName:g.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?g.addClassName:g.removeClassName)(this.dom.tr,"jsoneditor-selected"),(t?g.addClassName:g.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,n;(n=((n=((n=((n=this.dom.tree)&&(n.style.marginLeft=24*this.getLevel()+"px"),this.dom.field))&&(this.fieldEditable?(n.contentEditable=this.editable.field,n.spellcheck=!1,n.className="jsoneditor-field"):(n.contentEditable=!1,n.className="jsoneditor-readonly"),i=void 0!==this.index?this.index:void 0!==this.field?this.field:(i=this.editor.options.schema?e._findSchema(this.editor.options.schema,this.editor.options.schemaRefs||{},this.getPath()):void 0)&&i.title?i.title:this._hasChilds()?this.type:"",i=this._escapeHTML(i),document.activeElement!==n&&i!==this._unescapeHTML((0,g.getInnerText)(n))&&(n.innerHTML=i),this._updateSchema(),this._updateEnumOptions()),this.dom.value))&&("array"===this.type||"object"===this.type?this.updateNodeName():(i=this._escapeHTML(this.value),document.activeElement!==n&&i!==this._unescapeHTML((0,g.getInnerText)(n))&&(n.innerHTML=i))),this.dom.tr))&&("array"===this.type||"object"===this.type?((0,g.addClassName)(n,"jsoneditor-expandable"),this.expanded?((0,g.addClassName)(n,"jsoneditor-expanded"),(0,g.removeClassName)(n,"jsoneditor-collapsed")):((0,g.addClassName)(n,"jsoneditor-collapsed"),(0,g.removeClassName)(n,"jsoneditor-expanded"))):((0,g.removeClassName)(n,"jsoneditor-expandable"),(0,g.removeClassName)(n,"jsoneditor-expanded"),(0,g.removeClassName)(n,"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,(e=e.dom.field)&&(e.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,g.isUrl)(this.value)?(e=document.createElement("a")).href=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,l.Iu)("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"),n=(t.style.borderCollapse="collapse",t.className="jsoneditor-values",t.appendChild(i),document.createElement("tr"));return(i=((i=((i=((i=(i.appendChild(n),document.createElement("td"))).className="jsoneditor-tree",n.appendChild(i),e.expand=this._createDomExpandButton(),i.appendChild(e.expand),e.tdExpand=i,document.createElement("td"))).className="jsoneditor-tree",n.appendChild(i),e.field=this._createDomField(),i.appendChild(e.field),e.tdField=i,document.createElement("td"))).className="jsoneditor-tree",n.appendChild(i),"object"!==this.type&&"array"!==this.type&&(i.appendChild(document.createTextNode(":")),i.className="jsoneditor-separator"),e.tdSeparator=i,document.createElement("td"))).className="jsoneditor-tree",n.appendChild(i),e.value=this._createDomValue(),i.appendChild(e.value),e.tdValue=i,t}},{key:"onEvent",value:function(e){var t,i=e.type,n=e.target||e.srcElement,r=this.dom,o=this,s=this._hasChilds(),a=(n!==r.drag&&n!==r.menu||("mouseover"===i?this.editor.highlighter.highlight(this):"mouseout"===i&&this.editor.highlighter.unhighlight()),"click"===i&&n===r.menu&&((t=o.editor.highlighter).highlight(o),t.lock(),(0,g.addClassName)(r.menu,"jsoneditor-selected"),this.showContextMenu(r.menu,(function(){(0,g.removeClassName)(r.menu,"jsoneditor-selected"),t.unlock(),t.unhighlight()}))),"click"===i&&n===r.expand&&s&&(d=e.ctrlKey,this._onExpand(d)),"click"!==i||e.target!==o.dom.tdColor&&e.target!==o.dom.color||!this.editable.value||this._showColorPicker(),"change"===i&&n===r.checkbox&&(this.dom.value.textContent=String(!this.value),this._getDomValue(),this._updateDomDefault()),"change"===i&&n===r.select&&(this.dom.value.innerHTML=this._escapeHTML(r.select.value),this._getDomValue(),this._updateDomValue()),r.value);if(n===a)switch(i){case"blur":case"change":this._getDomValue(),this._clearValueError(),this._updateDomValue();var l=this._escapeHTML(this.value);l!==this._unescapeHTML((0,g.getInnerText)(a))&&(a.innerHTML=l);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,g.isUrl)(this.value)&&(e.preventDefault(),window.open(this.value,"_blank","noreferrer"));break;case"cut":case"paste":setTimeout((function(){o._getDomValue(),o._updateDomValue()}),1)}var c=r.field;if(n===c)switch(i){case"blur":this._getDomField(!0),this._updateDomField();var h=this._escapeHTML(this.field);h!==this._unescapeHTML((0,g.getInnerText)(c))&&(c.innerHTML=h);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 d=r.tree;d&&n===d.parentNode&&"click"===i&&!e.hasMoved&&((void 0!==e.offsetX?e.offsetX<24*(this.getLevel()+1):e.pageX<(0,g.getAbsoluteLeft)(r.tdSeparator))||s?c&&((0,g.setEndOfContentEditable)(c),c.focus()):a&&!this.enum&&((0,g.setEndOfContentEditable)(a),a.focus())),(n!==r.tdExpand||s)&&n!==r.tdField&&n!==r.tdSeparator||"click"!==i||e.hasMoved||c&&((0,g.setEndOfContentEditable)(c),c.focus()),"keydown"===i&&this.onKeyDown(e),"function"==typeof this.editor.options.onEvent&&this._onEvent(e)}},{key:"_onEvent",value:function(e){var t=(i=e.target)===this.dom.field,i=i===this.dom.value||i===this.dom.checkbox||i===this.dom.select;(t||i)&&(t={field:this.getField(),path:this.getPath()},i&&!this._hasChilds()&&(t.value=this.getValue()),this.editor.options.onEvent(t,e))}},{key:"onKeyDown",value:function(t){var i,n,r,o,s,a,l,c,h,d,u,p,m,f,C=t.which||t.keyCode,I=t.target||t.srcElement,v=t.ctrlKey,A=t.shiftKey,b=t.altKey,y=!1,w="tree"===this.editor.options.mode,S=0<this.editor.multiselection.nodes.length?this.editor.multiselection.nodes:[this],x=S[0],k=S[S.length-1];13===C?I===this.dom.value?this.editable.value&&!t.ctrlKey||(0,g.isUrl)(this.value)&&(window.open(this.value,"_blank","noreferrer"),y=!0):I===this.dom.expand&&this._hasChilds()&&(m=t.ctrlKey,this._onExpand(m),I.focus(),y=!0):68===C?v&&w&&(e.onDuplicate(S),y=!0):69===C?v&&(this._onExpand(A),I.focus(),y=!0):77===C&&w?v&&(this.showContextMenu(I),y=!0):46===C&&w?v&&(e.onRemove(S),y=!0):45===C&&w?v&&!A?(this._onInsertBefore(),y=!0):v&&A&&(this._onInsertAfter(),y=!0):35===C?b&&((m=this._lastNode())&&m.focus(e.focusElement||this._getElementName(I)),y=!0):36===C?b&&((m=this._firstNode())&&m.focus(e.focusElement||this._getElementName(I)),y=!0):37===C?b&&!A?((m=this._previousElement(I))&&this.focus(this._getElementName(m)),y=!0):b&&A&&w&&(m=k.expanded?(m=k.getAppendDom())?m.nextSibling:void 0:k.getDom().nextSibling)&&(u=e.getNodeFromTarget(m),m=m.nextSibling,p=e.getNodeFromTarget(m),u&&u instanceof T&&1!==k.parent.childs.length&&p&&p.parent&&(n=this.editor.getDomSelection(),r=(o=x.parent).childs[k.getIndex()+1]||o.append,s=x.getIndex(),a=p.getIndex(),l=o.getInternalPath(),c=p.parent.getInternalPath(),S.forEach((function(e){p.parent.moveBefore(e,p)})),this.focus(e.focusElement||this._getElementName(I)),this.editor._onAction("moveNodes",{count:S.length,fieldNames:S.map(E),oldParentPath:o.getInternalPath(),newParentPath:x.parent.getInternalPath(),oldIndex:r.getIndex(),newIndex:x.getIndex(),oldIndexRedo:s,newIndexRedo:a,oldParentPathRedo:l,newParentPathRedo:c,oldSelection:n,newSelection:this.editor.getDomSelection()}))):38===C?b&&!A?((i=this._previousNode())&&(this.editor.deselect(!0),i.focus(e.focusElement||this._getElementName(I))),y=!0):!b&&v&&A&&w?((i=this._previousNode())&&((d=this.editor.multiselection).start=d.start||this,d.end=i,h=this.editor._findTopLevelNodes(d.start,d.end),this.editor.select(h),i.focus("field")),y=!0):b&&A&&w&&((i=x._previousNode())&&i.parent&&(n=this.editor.getDomSelection(),r=(o=x.parent).childs[k.getIndex()+1]||o.append,s=x.getIndex(),a=i.getIndex(),l=o.getInternalPath(),c=i.parent.getInternalPath(),S.forEach((function(e){i.parent.moveBefore(e,i)})),this.focus(e.focusElement||this._getElementName(I)),this.editor._onAction("moveNodes",{count:S.length,fieldNames:S.map(E),oldParentPath:o.getInternalPath(),newParentPath:x.parent.getInternalPath(),oldIndex:r.getIndex(),newIndex:x.getIndex(),oldIndexRedo:s,newIndexRedo:a,oldParentPathRedo:l,newParentPathRedo:c,oldSelection:n,newSelection:this.editor.getDomSelection()})),y=!0):39===C?b&&!A?((m=this._nextElement(I))&&this.focus(this._getElementName(m)),y=!0):b&&A&&w&&(m=x.getDom().previousSibling)&&(i=e.getNodeFromTarget(m))&&i.parent&&!i.isVisible()&&(n=this.editor.getDomSelection(),r=(o=x.parent).childs[k.getIndex()+1]||o.append,s=x.getIndex(),a=i.getIndex(),l=o.getInternalPath(),c=i.parent.getInternalPath(),S.forEach((function(e){i.parent.moveBefore(e,i)})),this.focus(e.focusElement||this._getElementName(I)),this.editor._onAction("moveNodes",{count:S.length,fieldNames:S.map(E),oldParentPath:o.getInternalPath(),newParentPath:x.parent.getInternalPath(),oldIndex:r.getIndex(),newIndex:x.getIndex(),oldIndexRedo:s,newIndexRedo:a,oldParentPathRedo:l,newParentPathRedo:c,oldSelection:n,newSelection:this.editor.getDomSelection()})):40===C&&(b&&!A?((u=this._nextNode())&&(this.editor.deselect(!0),u.focus(e.focusElement||this._getElementName(I))),y=!0):!b&&v&&A&&w?((u=this._nextNode())&&((d=this.editor.multiselection).start=d.start||this,d.end=u,h=this.editor._findTopLevelNodes(d.start,d.end),this.editor.select(h),u.focus("field")),y=!0):b&&A&&w&&((f=(u=(u=(u=k.expanded?k.append?k.append._nextNode():void 0:k._nextNode())&&!u.isVisible()?u.parent.showMore:u)&&u instanceof T?k:u)&&(u._nextNode()||u.parent.append))&&f.parent&&(n=this.editor.getDomSelection(),r=(o=x.parent).childs[k.getIndex()+1]||o.append,s=x.getIndex(),a=f.getIndex(),l=o.getInternalPath(),c=f.parent.getInternalPath(),S.forEach((function(e){f.parent.moveBefore(e,f)})),this.focus(e.focusElement||this._getElementName(I)),this.editor._onAction("moveNodes",{count:S.length,fieldNames:S.map(E),oldParentPath:o.getInternalPath(),newParentPath:x.parent.getInternalPath(),oldParentPathRedo:l,newParentPathRedo:c,oldIndexRedo:s,newIndexRedo:a,oldIndex:r.getIndex(),newIndex:x.getIndex(),oldSelection:n,newSelection:this.editor.getDomSelection()})),y=!0)),y&&(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)}},{key:"_showColorPicker",value:function(){var e,t;"function"==typeof this.editor.options.onColorPicker&&this.dom.color&&((e=this)._deleteDomColor(),e.updateDom(),t=(0,u.w)(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 r=this.editor.getDomSelection();(t=new e(this.editor,{field:void 0!==t?t:"",value:void 0!==i?i:"",type:n})).expand(!0),i=this.getInternalPath(),this.parent.insertBefore(t,this),this.editor.highlighter.unhighlight(),t.focus("field"),n=this.editor.getDomSelection();this.editor._onAction("insertBeforeNodes",{nodes:[t],paths:[t.getInternalPath()],beforePath:i,parentPath:this.parent.getInternalPath(),oldSelection:r,newSelection:n})}},{key:"_onInsertAfter",value:function(t,i,n){var r=this.editor.getDomSelection();(t=new e(this.editor,{field:void 0!==t?t:"",value:void 0!==i?i:"",type:n})).expand(!0),this.parent.insertAfter(t,this),this.editor.highlighter.unhighlight(),t.focus("field"),i=this.editor.getDomSelection();this.editor._onAction("insertAfterNodes",{nodes:[t],paths:[t.getInternalPath()],afterPath:this.getInternalPath(),parentPath:this.parent.getInternalPath(),oldSelection:r,newSelection:i})}},{key:"_onAppend",value:function(t,i,n){var r=this.editor.getDomSelection();(t=new e(this.editor,{field:void 0!==t?t:"",value:void 0!==i?i:"",type:n})).expand(!0),this.parent.appendChild(t),this.editor.highlighter.unhighlight(),t.focus("field"),i=this.editor.getDomSelection();this.editor._onAction("appendNodes",{nodes:[t],paths:[t.getInternalPath()],parentPath:this.parent.getInternalPath(),oldSelection:r,newSelection:i})}},{key:"_onChangeType",value:function(e){var t,i,n=this.type;e!==n&&(t=this.editor.getDomSelection(),this.changeType(e),i=this.editor.getDomSelection(),this.editor._onAction("changeType",{path:this.getInternalPath(),oldType:n,newType:e,oldSelection:t,newSelection:i}))}},{key:"sort",value:function(e,t){var i,n,r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];"string"==typeof e&&(e=(0,g.parsePath)(e)),this._hasChilds()&&(this.hideChilds(),i=this.childs,this.childs=this.childs.concat(),n="desc"===t?-1:1,"object"===this.type?this.childs.sort((function(e,t){return n*d()(e.field,t.field)})):this.childs.sort((function(t,i){return t=t.getNestedChild(e),i=i.getNestedChild(e),t?i?(t=t.value,i=i.value,"string"!=typeof t&&"string"!=typeof i?i<t?n:t<i?-n:0:n*d()(t,i)):-n:n})),this._updateDomIndexes(),this.showChilds(),!0===r&&this.editor._onAction("sort",{path:this.getInternalPath(),oldChilds:i,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=this.dom.tr?this.dom.tr.parentNode:void 0,t=(t=this.expanded?this.getAppendDom():this.getDom())&&t.parentNode?t.nextSibling:void 0;return this.hide({resetVisibleChilds:!1}),{table:e,nextTr:t}}},{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),r=(this.setValue(n),this.getInternalValue());this.editor._onAction("transform",{path:this.getInternalPath(),oldValue:t,newValue:r}),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(),t=(this.editor._setRoot(this),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 T(this.editor),this.append.setParent(this)),this.append.getDom()}},{key:"getShowMoreDom",value:function(){return this.showMore||(this.showMore=new $(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)for(var n=i;n=n.previousSibling,t=e.getNodeFromTarget(n),n&&t&&t instanceof T&&!t.isVisible(););return t}},{key:"_nextNode",value:function(){var t=null,i=this.getDom();if(i&&i.parentNode)for(var n=i;n=n.nextSibling,t=e.getNodeFromTarget(n),n&&t&&t instanceof T&&!t.isVisible(););return t}},{key:"_firstNode",value:function(){var t=null,i=this.getDom();return i&&i.parentNode&&(i=i.parentNode.firstChild,t=e.getNodeFromTarget(i)),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;null!=n&&(n.length&&e.push({type:"separator"}),n.forEach((function(n){e.push({text:n.text,className:n.className||"jsoneditor-type-object",title:n.title,click:(t?function(e,t){i._onAppend(e,t)}:function(e,t){i._onInsertBefore(e,t)}).bind(this,n.field,n.value)})})))}},{key:"showContextMenu",value:function(t,i){var n,o=this,s=[];this.editable.value&&s.push({text:(0,l.Iu)("type"),title:(0,l.Iu)("typeTitle"),className:"jsoneditor-type-"+this.type,submenu:[{text:(0,l.Iu)("auto"),className:"jsoneditor-type-auto"+("auto"===this.type?" jsoneditor-selected":""),title:(0,l.Iu)("autoType"),click:function(){o._onChangeType("auto")}},{text:(0,l.Iu)("array"),className:"jsoneditor-type-array"+("array"===this.type?" jsoneditor-selected":""),title:(0,l.Iu)("arrayType"),click:function(){o._onChangeType("array")}},{text:(0,l.Iu)("object"),className:"jsoneditor-type-object"+("object"===this.type?" jsoneditor-selected":""),title:(0,l.Iu)("objectType"),click:function(){o._onChangeType("object")}},{text:(0,l.Iu)("string"),className:"jsoneditor-type-string"+("string"===this.type?" jsoneditor-selected":""),title:(0,l.Iu)("stringType"),click:function(){o._onChangeType("string")}}]}),this._hasChilds()&&(this.editor.options.enableSort&&s.push({text:(0,l.Iu)("sort"),title:(0,l.Iu)("sortTitle",{type:this.type}),className:"jsoneditor-sort-asc",click:function(){o.showSortModal()}}),this.editor.options.enableTransform&&s.push({text:(0,l.Iu)("transform"),title:(0,l.Iu)("transformTitle",{type:this.type}),className:"jsoneditor-transform",click:function(){o.showTransformModal()}}),this.parent&&s.push({text:(0,l.Iu)("extract"),title:(0,l.Iu)("extractTitle",{type:this.type}),className:"jsoneditor-extract",click:function(){o.extract()}})),this.parent&&this.parent._hasChilds()&&(s.length&&s.push({type:"separator"}),n=o.parent.childs,o===n[n.length-1]&&(n=[{text:(0,l.Iu)("auto"),className:"jsoneditor-type-auto",title:(0,l.Iu)("autoType"),click:function(){o._onAppend("","","auto")}},{text:(0,l.Iu)("array"),className:"jsoneditor-type-array",title:(0,l.Iu)("arrayType"),click:function(){o._onAppend("",[])}},{text:(0,l.Iu)("object"),className:"jsoneditor-type-object",title:(0,l.Iu)("objectType"),click:function(){o._onAppend("",{})}},{text:(0,l.Iu)("string"),className:"jsoneditor-type-string",title:(0,l.Iu)("stringType"),click:function(){o._onAppend("","","string")}}],o.addTemplates(n,!0),s.push({text:(0,l.Iu)("appendText"),title:(0,l.Iu)("appendTitle"),submenuTitle:(0,l.Iu)("appendSubmenuTitle"),className:"jsoneditor-append",click:function(){o._onAppend("","","auto")},submenu:n})),n=[{text:(0,l.Iu)("auto"),className:"jsoneditor-type-auto",title:(0,l.Iu)("autoType"),click:function(){o._onInsertBefore("","","auto")}},{text:(0,l.Iu)("array"),className:"jsoneditor-type-array",title:(0,l.Iu)("arrayType"),click:function(){o._onInsertBefore("",[])}},{text:(0,l.Iu)("object"),className:"jsoneditor-type-object",title:(0,l.Iu)("objectType"),click:function(){o._onInsertBefore("",{})}},{text:(0,l.Iu)("string"),className:"jsoneditor-type-string",title:(0,l.Iu)("stringType"),click:function(){o._onInsertBefore("","","string")}}],o.addTemplates(n,!1),s.push({text:(0,l.Iu)("insert"),title:(0,l.Iu)("insertTitle"),submenuTitle:(0,l.Iu)("insertSub"),className:"jsoneditor-insert",click:function(){o._onInsertBefore("","","auto")},submenu:n}),this.editable.field&&(s.push({text:(0,l.Iu)("duplicateText"),title:(0,l.Iu)("duplicateField"),className:"jsoneditor-duplicate",click:function(){e.onDuplicate(o)}}),s.push({text:(0,l.Iu)("removeText"),title:(0,l.Iu)("removeField"),className:"jsoneditor-remove",click:function(){e.onRemove(o)}}))),this.editor.options.onCreateMenu&&(n=o.getPath(),s=this.editor.options.onCreateMenu(s,{type:"single",path:n,paths:[n]})),new r.x(s,{close:i}).show(t,this.editor.getPopupAnchor())}},{key:"showSortModal",value:function(){var e=this,t=this.editor.options.modalAnchor||f.qD,i=this.getValue();(0,p.showSortModal)(t,i,(function(t){var i=t.path;i=(0,g.parsePath)(i);e.sortedBy=t,e.sort(i,t.direction)}),e.sortedBy)}},{key:"showTransformModal",value:function(){var e=this,t=(r=this.editor.options).modalAnchor,i=r.createQuery,n=r.executeQuery,r=r.queryDescription,o=this.getValue();(0,m.showTransformModal)({container:t||f.qD,json:o,queryDescription:r,createQuery:i,executeQuery:n,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,g.parseString)(e)?"string":"auto"}},{key:"_escapeHTML",value:function(e){return"string"!=typeof e?String(e):(e=String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/ {2}/g," &nbsp;").replace(/^ /,"&nbsp;").replace(/ $/,"&nbsp;"),e=(e=JSON.stringify(e)).substring(1,e.length-1),!0===this.editor.options.escapeUnicode?(0,g.escapeUnicodeChars)(e):e)}},{key:"_unescapeHTML",value:function(e){return e='"'+this._escapeJSON(e)+'"',(0,g.parse)(e).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&nbsp;|\u00A0/g," ").replace(/&amp;/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=this.childs?this.childs.length:0;if("object"===this.type||"array"===this.type){if(this.editor.options.onNodeName)try{var t=this.getValue.bind(this),i=this.editor.options.onNodeName({path:this.getPath(),size:e,type:this.type,get value(){return t()}})}catch(e){console.error("Error in onNodeName callback: ",e)}this.dom.value.textContent="object"===this.type?"{"+(i||e)+"}":"["+(i||e)+"]"}}},{key:"recursivelyUpdateNodeName",value:function(){if(this.expanded&&(this.updateNodeName(),"undefined"!==this.childs))for(var e in this.childs)this.childs[e].recursivelyUpdateNodeName()}}])&&w(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),x=(S.prototype.DEBOUNCE_INTERVAL=150,S.prototype.MAX_SEARCH_RESULTS=999,100);function k(e){return e.getInternalPath()}function E(e){return e.getField()}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}S.focusElement=void 0,S.select=function(e){setTimeout((function(){(0,g.selectContentEditable)(e)}),0)},S.onDragStart=function(e,t){if(!Array.isArray(e))return S.onDragStart([e],t);var i,n,r,o,s;0!==e.length&&(i=e[0],n=e[e.length-1],r=i.parent,s=S.getNodeFromTarget(t.target),o=i.editor,s=(0,g.getAbsoluteTop)(s.dom.tr)-(0,g.getAbsoluteTop)(i.dom.tr),o.mousemove||(o.mousemove=(0,g.addEventListener)(t.view,"mousemove",(function(t){S.onDrag(e,t)}))),o.mouseup||(o.mouseup=(0,g.addEventListener)(t.view,"mouseup",(function(t){S.onDragEnd(e,t)}))),o.highlighter.lock(),o.drag={oldCursor:document.body.style.cursor,oldSelection:o.getDomSelection(),oldPaths:e.map(k),oldParent:r,oldNextNode:r.childs[n.getIndex()+1]||r.append,oldParentPathRedo:r.getInternalPath(),oldIndexRedo:i.getIndex(),mouseX:t.pageX,offsetY:s,level:i.getLevel()},document.body.style.cursor="move",t.preventDefault())},S.onDrag=function(e,t){if(!Array.isArray(e))return S.onDrag([e],t);if(0!==e.length){var i,n,r,o,s,a=e[0].editor,l=t.pageY-a.drag.offsetY,c=t.pageX,h=!1,d=e[0],u=d.dom.tr,p=(0,g.getAbsoluteTop)(u),m=u.offsetHeight;if(l<p){for(v=u;v=v.previousSibling,A=S.getNodeFromTarget(v),r=v?(0,g.getAbsoluteTop)(v):0,v&&l<r;);(A=A&&!A.parent?void 0:A)||(v=(u=u.parentNode.firstChild)?u.nextSibling:void 0,(A=S.getNodeFromTarget(v))===d&&(A=void 0)),!(A=A&&A.isVisible()&&(r=(v=A.dom.tr)?(0,g.getAbsoluteTop)(v):0)+m<l?void 0:A)||!1!==a.options.limitDragging&&A.parent!==e[0].parent||(e.forEach((function(e){A.parent.moveBefore(e,A)})),h=!0)}else{var f=e[e.length-1];if(m=(u=f.expanded&&f.append?f.append.getDom():f.dom.tr)?u.nextSibling:void 0){for(o=(0,g.getAbsoluteTop)(m),i=m;n=S.getNodeFromTarget(i),i&&(s=i.nextSibling?(0,g.getAbsoluteTop)(i.nextSibling):0,s=i?s-o:0,n&&n.parent.childs.length===e.length&&n.parent.childs[e.length-1]===f&&(p+=27),i=i.nextSibling),i&&p+s<l;);if(n&&n.parent){m=c-a.drag.mouseX,m=Math.round(m/24/2);for(var C=a.drag.level+m,I=n.getLevel(),v=n.dom.tr&&n.dom.tr.previousSibling;I<C&&v;){var A=S.getNodeFromTarget(v),b=e.some((function(e){return e===A||A.isDescendantOf(e)}));if(!b){if(!(A instanceof T))break;if((b=A.parent.childs).length===e.length&&b[e.length-1]===f)break;I=(n=S.getNodeFromTarget(v)).getLevel()}v=v.previousSibling}(n=n instanceof T&&!n.isVisible()&&n.parent.showMore.isVisible()?n._nextNode():n)&&(!1===a.options.limitDragging||n.parent===e[0].parent)&&n.dom.tr&&n.dom.tr!==u.nextSibling&&(e.forEach((function(e){n.parent.moveBefore(e,n)})),h=!0)}}}h&&(a.drag.mouseX=c,a.drag.level=d.getLevel()),a.startAutoScroll(l),t.preventDefault()}},S.onDragEnd=function(e,t){if(!Array.isArray(e))return S.onDrag([e],t);var i,n,r,o,s,a,l,c,h;0!==e.length&&(a=e[0],i=a.editor,a&&a.dom.menu&&a.dom.menu.focus(),n=i.drag.oldParent.getInternalPath(),r=a.parent.getInternalPath(),o=i.drag.oldParent===a.parent,s=i.drag.oldNextNode.getIndex(),a=a.getIndex(),l=i.drag.oldParentPathRedo,c=i.drag.oldIndexRedo,h=o&&c<a?a+e.length:a,o&&c===a||i._onAction("moveNodes",{count:e.length,fieldNames:e.map(E),oldParentPath:n,newParentPath:r,oldIndex:s,newIndex:a,oldIndexRedo:c,newIndexRedo:h,oldParentPathRedo:l,newParentPathRedo:null,oldSelection:i.drag.oldSelection,newSelection:i.getDomSelection()}),document.body.style.cursor=i.drag.oldCursor,i.highlighter.unlock(),e.forEach((function(e){e.updateDom(),t.target!==e.dom.drag&&t.target!==e.dom.menu&&i.highlighter.unhighlight()})),delete i.drag,i.mousemove&&((0,g.removeEventListener)(t.view,"mousemove",i.mousemove),delete i.mousemove),i.mouseup&&((0,g.removeEventListener)(t.view,"mouseup",i.mouseup),delete i.mouseup),i.stopAutoScroll(),t.preventDefault())},S._findEnum=function(e){return e.enum?e.enum:(e=e.oneOf||e.anyOf||e.allOf)&&0<(e=e.filter((function(e){return e.enum}))).length?e[0].enum:null},S._findSchema=function(e,t,i){for(var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:e,r=i.slice(1,i.length),o=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=v(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.length))throw Error("Unable to resolve reference ".concat(g));var p,m,f,A=I(g.split("#/"),2),b=A[0],w=A[1];if(b in t)return p=t[b],m={$ref:"#/".concat(w)},(f=[]).push(o),0<r.length&&f.push.apply(f,C(r)),S._findSchema(p,t,f,m);throw Error("Unable to resolve reference ".concat(g))}var x,k=g.substring(2).split("/"),E=(n=e,v(k));try{for(E.s();!(x=E.n()).done;){var R=x.value;if(!(R in n))throw Error("Unable to resolve reference ".concat(g));n=n[R]}}catch(e){E.e(e)}finally{E.f()}}}if(void 0===o)return n;if("string"==typeof o){if("object"===y(n.properties)&&null!==n.properties&&o in n.properties)return n=n.properties[o],S._findSchema(e,t,r,n);if("object"===y(n.patternProperties)&&null!==n.patternProperties)for(var T in n.patternProperties)if(o.match(T))return n=n.patternProperties[T],S._findSchema(e,t,r,n);if("object"===y(n.additionalProperties))return n=n.additionalProperties,S._findSchema(e,t,r,n)}else if("number"==typeof o&&"object"===y(n.items)&&null!==n.items)return n=n.items,S._findSchema(e,t,r,n)}}catch(e){d.e(e)}finally{d.f()}return null},S.onRemove=function(e){if(!Array.isArray(e))return S.onRemove([e]);var t,i,n,r,o,s;e&&0<e.length&&(t=(n=e[0]).parent,i=n.editor,n=n.getIndex(),i.highlighter.unhighlight(),r=i.getDomSelection(),S.blurNodes(e),o=i.getDomSelection(),s=e.map(k),e.forEach((function(e){e.parent._remove(e)})),i._onAction("removeNodes",{nodes:e,paths:s,parentPath:t.getInternalPath(),index:n,oldSelection:r,newSelection:o}))},S.onDuplicate=function(e){if(!Array.isArray(e))return S.onDuplicate([e]);var t,i,n,r,o,s,a;e&&0<e.length&&(t=e[e.length-1],i=t.parent,(n=t.editor).deselect(n.multiselection.nodes),r=n.getDomSelection(),o=t,s=e.map((function(e){var t,n=e.clone();return"object"===e.parent.type&&(t=e.parent.getFieldNames(),n.field=(0,g.findUniqueName)(e.field,t)),i.insertAfter(n,o),o=n})),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),a=n.getDomSelection(),n._onAction("duplicateNodes",{paths:e.map(k),clonePaths:s.map(k),afterPath:t.getInternalPath(),parentPath:i.getInternalPath(),oldSelection:r,newSelection:a}))},S.getNodeFromTarget=function(e){for(;e;){if(e.node)return e.node;e=e.parentNode}},S.targetIsColorPicker=function(e){var t=S.getNodeFromTarget(e);if(t)for(var i=e&&e.parentNode;i;){if(i===t.dom.color)return!0;i=i.parentNode}return!1},S.blurNodes=function(e){var t,i;Array.isArray(e)?(t=(i=e[0]).parent,i=i.getIndex(),(t.childs[i+e.length]?t.childs[i+e.length]:t.childs[i-1]||t).focus()):S.blurNodes([e])},(_.prototype=new S).getDom=function(){var e=this.dom;if(e.tr)return e.tr;this._updateEditability();var t=document.createElement("tr"),i=(t.className="jsoneditor-append",t.node=this,e.tr=t,"tree"===this.editor.options.mode&&(e.tdDrag=document.createElement("td"),n=document.createElement("td"),e.tdMenu=n,(i=document.createElement("button")).type="button",i.className="jsoneditor-button jsoneditor-contextmenu-button",i.title="Click to open the actions menu (Ctrl+M)",e.menu=i,n.appendChild(e.menu)),document.createElement("td")),n=document.createElement("div");return n.appendChild(document.createTextNode("("+(0,l.Iu)("empty")+")")),n.className="jsoneditor-readonly",i.appendChild(n),e.td=i,e.text=n,this.updateDom(),t},_.prototype.getPath=function(){return null},_.prototype.getIndex=function(){return null},_.prototype.updateDom=function(e){var t=this.dom,i=t.td,n=((n=(i&&(i.style.paddingLeft=24*this.getLevel()+26+"px"),t.text))&&(n.firstChild.nodeValue="("+(0,l.Iu)("empty")+" "+this.parent.type+")"),t.tr);this.isVisible()?t.tr.firstChild||(t.tdDrag&&n.appendChild(t.tdDrag),t.tdMenu&&n.appendChild(t.tdMenu),n.appendChild(i)):t.tr.firstChild&&(t.tdDrag&&n.removeChild(t.tdDrag),t.tdMenu&&n.removeChild(t.tdMenu),n.removeChild(i))},_.prototype.isVisible=function(){return 0===this.parent.childs.length},_.prototype.showContextMenu=function(e,t){var i,n=this,o=[{text:(0,l.Iu)("auto"),className:"jsoneditor-type-auto",title:(0,l.Iu)("autoType"),click:function(){n._onAppend("","","auto")}},{text:(0,l.Iu)("array"),className:"jsoneditor-type-array",title:(0,l.Iu)("arrayType"),click:function(){n._onAppend("",[])}},{text:(0,l.Iu)("object"),className:"jsoneditor-type-object",title:(0,l.Iu)("objectType"),click:function(){n._onAppend("",{})}},{text:(0,l.Iu)("string"),className:"jsoneditor-type-string",title:(0,l.Iu)("stringType"),click:function(){n._onAppend("","","string")}}];n.addTemplates(o,!0),o=[{text:(0,l.Iu)("appendText"),title:(0,l.Iu)("appendTitleAuto"),submenuTitle:(0,l.Iu)("appendSubmenuTitle"),className:"jsoneditor-insert",click:function(){n._onAppend("","","auto")},submenu:o}];this.editor.options.onCreateMenu&&(i=n.parent.getPath(),o=this.editor.options.onCreateMenu(o,{type:"append",path:i,paths:[i]})),new r.x(o,{close:t}).show(e,this.editor.getPopupAnchor())},_.prototype.onEvent=function(e){var t,i=e.type,n=e.target||e.srcElement,r=this.dom;n===r.menu&&("mouseover"===i?this.editor.highlighter.highlight(this.parent):"mouseout"===i&&this.editor.highlighter.unhighlight()),"click"===i&&n===r.menu&&((t=this.editor.highlighter).highlight(this.parent),t.lock(),(0,g.addClassName)(r.menu,"jsoneditor-selected"),this.showContextMenu(r.menu,(function(){(0,g.removeClassName)(r.menu,"jsoneditor-selected"),t.unlock(),t.unhighlight()}))),"keydown"===i&&this.onKeyDown(e)};var T=_;function _(e){this.editor=e,this.dom={}}(L.prototype=new S).getDom=function(){return this.dom.tr||(this._updateEditability(),this.dom.tr||(t=(e=this).parent,(r=document.createElement("a")).appendChild(document.createTextNode((0,l.Iu)("showMore"))),r.href="#",r.onclick=function(i){return t.visibleChilds=Math.floor(t.visibleChilds/t.getMaxVisibleChilds()+1)*t.getMaxVisibleChilds(),e.updateDom(),t.showChilds(),i.preventDefault(),!1},(o=document.createElement("a")).appendChild(document.createTextNode((0,l.Iu)("showAll"))),o.href="#",o.onclick=function(i){return t.visibleChilds=1/0,e.updateDom(),t.showChilds(),i.preventDefault(),!1},i=document.createElement("div"),n=document.createTextNode(this._getShowMoreText()),i.className="jsoneditor-show-more",i.appendChild(n),i.appendChild(r),i.appendChild(document.createTextNode(". ")),i.appendChild(o),i.appendChild(document.createTextNode(". ")),(r=document.createElement("td")).appendChild(i),o=document.createElement("tr"),"tree"===this.editor.options.mode&&(o.appendChild(document.createElement("td")),o.appendChild(document.createElement("td"))),o.appendChild(r),o.className="jsoneditor-show-more",this.dom.tr=o,this.dom.moreContents=i,this.dom.moreText=n),this.updateDom(),this.dom.tr);var e,t,i,n,r,o},L.prototype.updateDom=function(e){var t;this.isVisible()?(this.dom.tr.node=this.parent.childs[this.parent.visibleChilds],this.dom.tr.parentNode||(t=this.parent._getNextTr())&&t.parentNode.insertBefore(this.dom.tr,t),this.dom.moreText.nodeValue=this._getShowMoreText(),this.dom.moreContents.style.marginLeft=24*(this.getLevel()+1)+"px"):this.dom.tr&&this.dom.tr.parentNode&&this.dom.tr.parentNode.removeChild(this.dom.tr)},L.prototype._getShowMoreText=function(){return(0,l.Iu)("showMoreStatus",{visibleChilds:this.parent.visibleChilds,totalChilds:this.parent.childs.length})+" "},L.prototype.isVisible=function(){return this.parent.expanded&&this.parent.childs.length>this.parent.visibleChilds},L.prototype.onEvent=function(e){"keydown"===e.type&&this.onKeyDown(e)};var $=L;function L(e,t){this.editor=e,this.parent=t,this.dom={}}function B(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)}}var W=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");function i(e){return t.node.findNodeByInternalPath(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,r=e.clone();"object"===t.type&&(i=t.getFieldNames(),r.field=(0,g.findUniqueName)(e.field,i)),t.insertAfter(r,n),n=r}))}},moveNodes:{undo:function(e){var t=i(e.oldParentPath),n=i(e.newParentPath),r=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,r)})),null===e.newParentPathRedo&&(e.newParentPathRedo=n.getInternalPath())},redo:function(e){var t=i(e.oldParentPathRedo),n=i(e.newParentPathRedo),r=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,r)}))}},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;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 0<=this.index}},{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}}])&&B(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function N(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)}}var G=function(){function e(t,i){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");var n=this,r=(t=(this.editor=t,this.timeout=void 0,this.delay=200,this.lastText=void 0,this.results=null,this.dom={},this.dom.container=i,document.createElement("div")),i=((this.dom.wrapper=t).className="jsoneditor-search",i.appendChild(t),document.createElement("div")),i=((this.dom.results=i).className="jsoneditor-results",t.appendChild(i),document.createElement("div")),(t=((this.dom.input=i).className="jsoneditor-frame",i.title=(0,l.Iu)("searchTitle"),t.appendChild(i),document.createElement("button"))).type="button",t.className="jsoneditor-refresh",i.appendChild(t),document.createElement("input"));(t=((t=(r.type="text",(this.dom.search=r).oninput=function(e){n._onDelayedSearch(e)},r.onchange=function(e){n._onSearch()},r.onkeydown=function(e){n._onKeyDown(e)},r.onkeyup=function(e){n._onKeyUp(e)},t.onclick=function(e){r.select()},i.appendChild(r),document.createElement("button"))).type="button",t.title=(0,l.Iu)("searchNextResultTitle"),t.className="jsoneditor-next",t.onclick=function(){n.next()},i.appendChild(t),document.createElement("button"))).type="button",t.title=(0,l.Iu)("searchPreviousResultTitle"),t.className="jsoneditor-previous",t.onclick=function(){n.previous()},i.appendChild(t)}var t,i;return t=e,(i=[{key:"next",value:function(e){var t;this.results&&((t=null!==this.resultIndex?this.resultIndex+1:0)>this.results.length-1&&(t=0),this._setActiveResult(t,e))}},{key:"previous",value:function(e){var t,i;this.results&&(t=this.results.length-1,i=null!==this.resultIndex?this.resultIndex-1:t,this._setActiveResult(i=i<0?t:i,e))}},{key:"_setActiveResult",value:function(e,t){var i;if(this.activeResult&&(i=this.activeResult.node,"field"===this.activeResult.elem?delete i.searchFieldActive:delete i.searchValueActive,i.updateDom()),!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,r=this.results[this.resultIndex].elem;"field"===r?n.searchFieldActive=!0:n.searchValueActive=!0,this.activeResult=this.results[this.resultIndex],n.updateDom(),n.scrollTo((function(){t&&n.focus(r)}))}},{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){var t;if(this._clearDelay(),(t=0<(t=this.dom.search.value).length?t:void 0)!==this.lastText||e){this.lastText=t,this.results=this.editor.search(t);e=this.results[0]?this.results[0].node.MAX_SEARCH_RESULTS:1/0;var i=0;if(this.activeResult)for(var n=0;n<this.results.length;n++)if(this.results[n].node===this.activeResult.node){i=n;break}this._setActiveResult(i,!1),void 0!==t?(t=this.results.length,this.dom.results.textContent=0===t?"no results":1===t?"1 result":e<t?e+"+ results":t+" results"):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()}}])&&N(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function P(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)}}var F=function(){function e(t,i){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");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;return t=e,(i=[{key:"reset",value:function(){this.path.textContent=(0,l.Iu)("selectNode")}},{key:"setPath",value:function(e){var t=this;this.path.textContent="",e&&e.length&&e.forEach((function(i,n){var o,s=document.createElement("span");s.className="jsoneditor-treepath-element",s.innerText=i.name,s.onclick=function(e){this.selectionCallback&&this.selectionCallback(e)}.bind(t,i),t.path.appendChild(s),i.children.length&&((o=document.createElement("span")).className="jsoneditor-treepath-seperator",o.textContent="►",o.onclick=function(){t.contentMenuClicked=!0;var s=[];i.children.forEach((function(r){s.push({text:r.name,className:"jsoneditor-type-modes"+(e[n+1]+1&&e[n+1].name===r.name?" jsoneditor-selected":""),click:function(e,t){this.contextMenuCallback&&this.contextMenuCallback(e,t)}.bind(t,i,r.name)})})),new r.x(s,{limitHeight:!0}).show(o,t.root,!0)},t.path.appendChild(o)),n===e.length-1&&(s=(o||s).getBoundingClientRect().right,t.path.offsetWidth<s&&(t.path.scrollLeft=s),t.path.scrollLeft&&((s=document.createElement("span")).className="jsoneditor-treepath-show-all-btn",s.title="show all path",s.textContent="...",s.onclick=function(e){(t.contentMenuClicked=!1,g.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,g.removeClassName)(t.path,"show-all"),t.path.onblur=void 0,t.path.style.width="",t.setPath(e)}}.bind(t,e),t.path.insertBefore(s,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)}}])&&P(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),H=(t=i(8037),i.n(t)),V=((i={}).create=function(e,t){if(!e)throw new Error("No container element provided.");function i(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 r(e){return void 0===h&&((h=document.createElement("span")).style.visibility="hidden",h.style.position="fixed",h.style.outline="0",h.style.margin="0",h.style.padding="0",h.style.border="0",h.style.left="0",h.style.whiteSpace="pre",h.style.fontSize=u,h.style.fontFamily=g,h.style.fontWeight="normal",document.body.appendChild(h)),h.textContent=e,h.getBoundingClientRect().right}function o(){this.style.backgroundColor="#ddd"}function s(){this.style.backgroundColor=""}function l(){A.hide(),A.onmouseselection(this.__hint,A.rs)}var c,h,d,u,g,p,m,f,C,I,v,A,b,y,w,S;this.container=e,this.dom={},this.highlighter=new a,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=((c=(c=t.autocomplete)||{}).filter=c.filter||"start",c.trigger=c.trigger||"keydown",c.confirmKeys=c.confirmKeys||[39,35,9],c.caseSensitive=c.caseSensitive||!1,g=u="",(p=document.createElement("div")).style.position="relative",p.style.outline="0",p.style.border="0",p.style.margin="0",p.style.padding="0",(m=document.createElement("div")).className="autocomplete dropdown",m.style.position="absolute",m.style.visibility="hidden",f=m,C=[],v=-1,y=A={rs:b={onArrowDown:function(){},onArrowUp:function(){},onEnter:function(){},onTab:function(){},startFrom:I=0,options:[],element:null,elementHint:null,elementStyle:null,wrapper:p,show:function(e,t,i){var n=this;this.startFrom=t,this.wrapper.remove(),this.elementHint&&(this.elementHint.remove(),this.elementHint=null),""===u&&(u=window.getComputedStyle(e).getPropertyValue("font-size")),""===g&&(g=window.getComputedStyle(e).getPropertyValue("font-family")),m.style.marginLeft="0",m.style.marginTop=e.getBoundingClientRect().height+"px",this.options=i.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(){n.element.focus()},this.element.addEventListener&&(this.element.removeEventListener("keydown",w),this.element.addEventListener("keydown",w,!1),this.element.removeEventListener("blur",S),this.element.addEventListener("blur",S,!1)),p.appendChild(this.elementHint),p.appendChild(m),e.parentElement.appendChild(p),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,y.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(e){e=(e=e.innerText).replace("\n","");var t=this.options.length,i=e.substring(this.startFrom);d=e.substring(0,this.startFrom);for(var n=0;n<t;n++){var o=this.options[n];if(!c.caseSensitive&&0===o.toLowerCase().indexOf(i.toLowerCase())||c.caseSensitive&&0===o.indexOf(i)){this.elementHint.innerText=d+i+o.substring(i.length),this.elementHint.realInnerText=d+o;break}}m.style.left=r(d)+"px",y.refresh(i,this.options),this.elementHint.style.width=r(this.elementHint.innerText)+10+"px","hidden"!==m.style.visibility&&(this.elementHint.style.width=r(this.elementHint.innerText)+m.clientWidth+"px")}},hide:function(){f.style.visibility="hidden"},refresh:function(e,t){f.style.visibility="hidden",I=0,f.textContent="";var i=window.innerHeight||document.documentElement.clientHeight,r=(h=f.parentNode.getBoundingClientRect()).top-6,a=(i=i-h.bottom-6,C=[],"function"==typeof c.filter?c.filter:n[c.filter]),h=a?t.filter((function(t){return a(c.caseSensitive?e:e.toLowerCase(),c.caseSensitive?t:t.toLowerCase(),c)})):[];0===(C=h.map((function(t){var i=document.createElement("div"),n=(i.className="item",i.onmouseover=o,i.onmouseout=s,i.onmousedown=l,i.__hint=t,i.textContent="",i.appendChild(document.createTextNode(t.substring(0,e.length))),document.createElement("b"));return n.appendChild(document.createTextNode(t.substring(e.length))),i.appendChild(n),f.appendChild(i),i}))).length||1===C.length&&(e.toLowerCase()===C[0].__hint.toLowerCase()&&!c.caseSensitive||e===C[0].__hint&&c.caseSensitive)||C.length<2||(A.highlight(0),3*i<r?(f.style.maxHeight=r+"px",f.style.top="",f.style.bottom="100%"):(f.style.top="100%",f.style.bottom="",f.style.maxHeight=i+"px"),f.style.visibility="visible")},highlight:function(e){-1!==v&&C[v]&&(C[v].className="item"),C[e].className="item hover",v=e},move:function(e){return"hidden"===f.style.visibility?"":(I+e===-1||I+e===C.length||(I+=e,A.highlight(I)),C[I].__hint)},onmouseselection:function(){}},w=function(e){var t=(e=e||window.event).keyCode;if(null!=this.elementHint&&33!==t&&34!==t){if(27===t)return b.hideDropDown(),b.element.focus(),e.preventDefault(),void e.stopPropagation();var n,r=(r=this.element.innerText).replace("\n","");if(0<=c.confirmKeys.indexOf(t))return 9===t&&0===this.elementHint.innerText.length&&b.onTab(),void(0<this.elementHint.innerText.length&&this.element.innerText!==this.elementHint.realInnerText&&(this.element.innerText=this.elementHint.realInnerText,b.hideDropDown(),i(this.element),9===t&&(b.element.focus(),e.preventDefault(),e.stopPropagation())));if(13===t)if(0===this.elementHint.innerText.length)b.onEnter();else{var o="hidden"===m.style.visibility;if(y.hide(),o)return b.hideDropDown(),b.element.focus(),void b.onEnter();this.element.innerText=this.elementHint.realInnerText,b.hideDropDown(),i(this.element),e.preventDefault(),e.stopPropagation()}else{if(40===t)return o=r.substring(this.startFrom),""===(n=y.move(1))&&b.onArrowDown(),this.elementHint.innerText=d+o+n.substring(o.length),this.elementHint.realInnerText=d+n,e.preventDefault(),void e.stopPropagation();38===t&&(o=r.substring(this.startFrom),""===(n=y.move(-1))&&b.onArrowUp(),this.elementHint.innerText=d+o+n.substring(o.length),this.elementHint.realInnerText=d+n,e.preventDefault(),e.stopPropagation())}}}.bind(b),S=function(e){b.hideDropDown()},y.onmouseselection=function(e,t){t.element.innerText=t.elementHint.innerText=d+e,t.hideDropDown(),window.setTimeout((function(){t.element.focus(),i(t.element)}),1)},b)),this.options.history&&"view"!==this.options.mode&&(this.history=new W(this)),this._createFrame(),this._createTable()},i.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()},i._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){var n;H()?(n=e.getBoundingClientRect().top,n=(0,g.getWindow)(e).innerHeight-n<300&&300<n,new(H())({parent:e,color:t,popup:n?"top":"bottom",onDone:function(e){e=1===e.rgba[3]?e.hex.substr(0,7):e.hex,i(e)}}).show()):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:c.r,executeQuery:c.J,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,g.debounce)(this._validateAndCatch.bind(this),this.DEBOUNCE_INTERVAL),e.onSelectionChange&&this.onSelectionChange(e.onSelectionChange),(0,l.cC)(this.options.languages),(0,l.m0)(this.options.language)},i.set=function(e){e instanceof Function||void 0===e?this.clear():(this.content.removeChild(this.table),e={field:this.options.name,value:e},e=new S(this,e),this._setRoot(e),this._validateAndCatch(),this.node.expand(!1),this.content.appendChild(this.table)),this.history&&this.history.clear(),this.searchBox&&this.searchBox.clear()},i.update=function(e){var t,i;this.node.deepEqual(e)||(t=this.getSelection(),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?(e=this.node.findNodeByPath(t.start.path),i=this.node.findNodeByPath(t.end.path),e&&i?this.setSelection(t.start,t.end):this.setSelection({},{})):this.setSelection({},{}))},i.get=function(){if(this.node)return this.node.getValue()},i.getText=function(){return JSON.stringify(this.get())},i.setText=function(e){try{this.set((0,g.parse)(e))}catch(t){e=(0,g.tryJsonRepair)(e),this.set((0,g.parse)(e))}},i.updateText=function(e){try{this.update((0,g.parse)(e))}catch(t){e=(0,g.tryJsonRepair)(e),this.update((0,g.parse)(e))}},i.setName=function(e){this.options.name=e,this.node&&this.node.updateField(this.options.name)},i.getName=function(){return this.options.name},i.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()},i.clear=function(){this.node&&(this.node.hide(),delete this.node),this.treePath&&this.treePath.reset()},i._setRoot=function(e){this.clear(),(this.node=e).setParent(null),e.setField(this.getName(),!1),delete e.index,this.tbody.appendChild(e.getDom())},i.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},i.expandAll=function(){this.node&&(this.content.removeChild(this.table),this.node.expand(),this.content.appendChild(this.table))},i.collapseAll=function(){this.node&&(this.content.removeChild(this.table),this.node.collapse(),this.content.appendChild(this.table))},i._onAction=function(e,t){this.history&&this.history.add(e,t),this._onChange()},i._onChange=function(){if(!this.onChangeDisabled){var e;if(this.selection=this.getDomSelection(),this._debouncedValidate(),this.treePath&&((e=this.node&&this.selection?this.node.findNodeByInternalPath(this.selection.path):this.multiselection?this.multiselection.nodes[0]:void 0)?this._updateTreePath(e.getNodePath()):this.treePath.reset()),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)}}},i.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,g.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 r=this,o=this.validationSequence;return this._validateCustom(i).then((function(t){return o===r.validationSequence&&(t=[].concat(n,t||[]),r._renderValidationErrors(t),"function"==typeof e.options.onValidationError&&(0,g.isValidationErrorChanged)(t,e.lastSchemaErrors)&&e.options.onValidationError.call(e,t),e.lastSchemaErrors=t),e.lastSchemaErrors}))}catch(i){return Promise.reject(i)}}},i._validateAndCatch=function(){this.validate().catch((function(e){console.error("Error running validation:",e)}))},i._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,l.Iu)("containsInvalidProperties"):(0,l.Iu)("containsInvalidItems")}}})).concat(e).map((function(e){return e.node.setError(e.error,e.child),e.node}))},i._validateCustom=function(e){try{var t,i;if(this.options.onValidate)return t=this.node,i=this.options.onValidate(e),((0,g.isPromise)(i)?i:Promise.resolve(i)).then((function(e){return Array.isArray(e)?e.filter((function(e){var t=(0,g.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)},i.refresh=function(){this.node&&this.node.updateDom({recurse:!0})},i.startAutoScroll=function(e){var t=this,i=this.scrollableContent,n=(0,g.getAbsoluteTop)(i),r=i.clientHeight,o=n+r;e<n+24&&0<i.scrollTop?this.autoScrollStep=(n+24-e)/3:o-24<e&&r+i.scrollTop<i.scrollHeight?this.autoScrollStep=(o-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()},i.stopAutoScroll=function(){this.autoScrollTimer&&(clearTimeout(this.autoScrollTimer),delete this.autoScrollTimer),this.autoScrollStep&&delete this.autoScrollStep},i.setDomSelection=function(e){var t,i,n;e&&("scrollTop"in e&&this.scrollableContent&&(this.scrollableContent.scrollTop=e.scrollTop),e.paths?(t=this,i=e.paths.map((function(e){return t.node.findNodeByInternalPath(e)})),this.select(i)):(n=(i=e.path?this.node.findNodeByInternalPath(e.path):null)&&e.domName?i.dom[e.domName]:null,e.range&&n?(e=Object.assign({},e.range,{container:n}),(0,g.setSelectionOffset)(e)):i&&i.focus()))},i.getDomSelection=function(){var e=S.getNodeFromTarget(this.focusTarget),t=this.focusTarget,i=e?Object.keys(e.dom).find((function(i){return e.dom[i]===t})):null,n=(0,g.getSelectionOffset)();return(n=(n=n&&"DIV"!==n.container.nodeName?null:n)&&n.container!==t?null:n)&&delete n.container,{path:e?e.getInternalPath():null,domName:i,range:n,paths:0<this.multiselection.length?this.multiselection.nodes.map((function(e){return e.getInternalPath()})):null,scrollTop:this.scrollableContent?this.scrollableContent.scrollTop:0}},i.scrollTo=function(e,t){var i,n,r,o,s=this.scrollableContent;s?((i=this).animateTimeout&&(clearTimeout(i.animateTimeout),delete i.animateTimeout),i.animateCallback&&(i.animateCallback(!1),delete i.animateCallback),n=s.clientHeight,r=s.scrollHeight-n,o=Math.min(Math.max(e-n/4,0),r),function e(){var n=s.scrollTop;n=o-n;3<Math.abs(n)?(s.scrollTop+=n/3,i.animateCallback=t,i.animateTimeout=setTimeout(e,50)):(t&&t(!0),s.scrollTop=o,delete i.animateTimeout,delete i.animateCallback)}()):t&&t(!1)},i._createFrame=function(){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 e=this;function t(t){e._onEvent&&e._onEvent(t)}var i,n,r,s={target:this.frame,onFocus:this.options.onFocus||null,onBlur:this.options.onBlur||null};this.frameFocusTracker=new o.R(s),this.frame.onclick=function(e){var i=e.target;t(e),"BUTTON"===i.nodeName&&e.preventDefault()},this.frame.oninput=t,this.frame.onchange=t,this.frame.onkeydown=t,this.frame.onkeyup=t,this.frame.oncut=t,this.frame.onpaste=t,this.frame.onmousedown=t,this.frame.onmouseup=t,this.frame.onmouseover=t,this.frame.onmouseout=t,(0,g.addEventListener)(this.frame,"focus",t,!0),(0,g.addEventListener)(this.frame,"blur",t,!0),this.frame.onfocusin=t,this.frame.onfocusout=t,this.options.mainMenuBar&&((0,g.addClassName)(this.contentOuter,"has-main-menu-bar"),this.menu=document.createElement("div"),this.menu.className="jsoneditor-menu",this.frame.appendChild(this.menu),(s=document.createElement("button")).type="button",s.className="jsoneditor-expand-all",s.title=(0,l.Iu)("expandAll"),s.onclick=function(){e.expandAll()},this.menu.appendChild(s),(s=document.createElement("button")).type="button",s.title=(0,l.Iu)("collapseAll"),s.className="jsoneditor-collapse-all",s.onclick=function(){e.collapseAll()},this.menu.appendChild(s),this.options.enableSort&&((s=document.createElement("button")).type="button",s.className="jsoneditor-sort",s.title=(0,l.Iu)("sortTitleShort"),s.onclick=function(){e.node.showSortModal()},this.menu.appendChild(s)),this.options.enableTransform&&((s=document.createElement("button")).type="button",s.title=(0,l.Iu)("transformTitleShort"),s.className="jsoneditor-transform",s.onclick=function(){e.node.showTransformModal()},this.menu.appendChild(s)),this.history&&((i=document.createElement("button")).type="button",i.className="jsoneditor-undo jsoneditor-separator",i.title=(0,l.Iu)("undo"),i.onclick=function(){e._onUndo()},this.menu.appendChild(i),this.dom.undo=i,(n=document.createElement("button")).type="button",n.className="jsoneditor-redo",n.title=(0,l.Iu)("redo"),n.onclick=function(){e._onRedo()},this.menu.appendChild(n),this.dom.redo=n,this.history.onChange=function(){i.disabled=!e.history.canUndo(),n.disabled=!e.history.canRedo()},this.history.onChange()),this.options&&this.options.modes&&this.options.modes.length&&((r=this).modeSwitcher=new h.x(this.menu,this.options.modes,this.options.mode,(function(e){try{r.setMode(e),r.modeSwitcher.focus()}catch(e){r._onError(e)}}))),this.options.search&&(this.searchBox=new G(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 F(this.navBar,this.getPopupAnchor()),this.treePath.onSectionSelected(this._onTreePathSectionSelected.bind(this)),this.treePath.onContextMenuItemSelected(this._onTreePathMenuItemSelected.bind(this)))},i._onUndo=function(){this.history&&(this.history.undo(),this._onChange())},i._onRedo=function(){this.history&&(this.history.redo(),this._onChange())},i._onEvent=function(e){if(!S.targetIsColorPicker(e.target)){var t,i=S.getNodeFromTarget(e.target);if("keydown"===e.type&&this._onKeyDown(e),i&&"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),i&&this.options&&this.options.navigationBar&&i&&("keydown"===e.type||"mousedown"===e.type)&&(t=this,setTimeout((function(){t._updateTreePath(i.getNodePath())}))),i&&i.selected){if("click"===e.type){if(e.target===i.dom.menu)return void this.showContextMenu(e.target);e.hasMoved||this.deselect()}"mousedown"===e.type&&S.onDragStart(this.multiselection.nodes,e)}else"mousedown"===e.type&&(0,g.hasParentNode)(e.target,this.content)&&(this.deselect(),i&&e.target===i.dom.drag?S.onDragStart(i,e):i&&(e.target===i.dom.field||e.target===i.dom.value||e.target===i.dom.select)||this._onMultiSelectStart(e));i&&i.onEvent(e)}},i._updateTreePath=function(e){var t;function i(e){return e.parent?"array"===e.parent.type?e.index:e.field:e.field||e.type}e&&e.length?((0,g.removeClassName)(this.navBar,"nav-bar-empty"),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)):(0,g.addClassName)(this.navBar,"nav-bar-empty")},i._onTreePathSectionSelected=function(e){e&&e.node&&(e.node.expandTo(),e.node.focus())},i._onTreePathMenuItemSelected=function(e,t){e&&e.children.length&&(e=e.children.find((function(e){return e.name===t})))&&e.node&&(this._updateTreePath(e.node.getNodePath()),e.node.expandTo(),e.node.focus())},i._startDragDistance=function(e){this.dragDistanceEvent={initialTarget:e.target,initialPageX:e.pageX,initialPageY:e.pageY,dragDistance:0,hasMoved:!1}},i._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||10<this.dragDistanceEvent.dragDistance,e.dragDistance=this.dragDistanceEvent.dragDistance,e.hasMoved=this.dragDistanceEvent.hasMoved,e.dragDistance},i._onMultiSelectStart=function(e){var t,i=S.getNodeFromTarget(e.target);"tree"===this.options.mode&&void 0===this.options.onEditable&&(this.multiselection={start:i||null,end:null,nodes:[]},this._startDragDistance(e),(t=this).mousemove||(this.mousemove=(0,g.addEventListener)(e.view,"mousemove",(function(e){t._onMultiSelect(e)}))),this.mouseup||(this.mouseup=(0,g.addEventListener)(e.view,"mouseup",(function(e){t._onMultiSelectEnd(e)}))),e.preventDefault())},i._onMultiSelect=function(e){var t;e.preventDefault(),this._updateDragDistance(e),e.hasMoved&&((e=S.getNodeFromTarget(e.target))&&(null==this.multiselection.start&&(this.multiselection.start=e),this.multiselection.end=e),this.deselect(),e=this.multiselection.start,t=this.multiselection.end||this.multiselection.start,e&&t&&(this.multiselection.nodes=this._findTopLevelNodes(e,t),this.multiselection.nodes&&this.multiselection.nodes.length&&(e=this.multiselection.nodes[0],this.multiselection.start===e||this.multiselection.start.isDescendantOf(e)?this.multiselection.direction="down":this.multiselection.direction="up"),this.select(this.multiselection.nodes)))},i._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,g.removeEventListener)(e.view,"mousemove",this.mousemove),delete this.mousemove),this.mouseup&&((0,g.removeEventListener)(e.view,"mouseup",this.mouseup),delete this.mouseup)},i.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()},i.select=function(e){if(!Array.isArray(e))return this.select([e]);var t;e&&(this.deselect(),this.multiselection.nodes=e.slice(0),t=e[0],e.forEach((function(e){e.expandPathToNode(),e.setSelected(!0,e===t)})),this._selectionChangedHandler&&(e=this.getSelection(),this._selectionChangedHandler(e.start,e.end)))},i._findTopLevelNodes=function(e,t){for(var i=e.getNodePath(),n=t.getNodePath(),r=0;r<i.length&&i[r]===n[r];)r++;e=i[r-1],t=i[r];var o,s=n[r];return t&&s||(e.parent?e=(s=t=e).parent:(t=e.childs[0],s=e.childs[e.childs.length-1])),e&&t&&s?(t=e.childs.indexOf(t),s=e.childs.indexOf(s),o=Math.min(t,s),t=Math.max(t,s),e.childs.slice(o,t+1)):[]},i._showAutoComplete=function(e){var t,i=S.getNodeFromTarget(e),n="";0<=e.className.indexOf("jsoneditor-value")&&(n="value"),""!==(n=0<=e.className.indexOf("jsoneditor-field")?"field":n)&&(t=this,setTimeout((function(){var r;i&&("focus"===t.options.autocomplete.trigger||0<e.innerText.length)&&null!==(r=t.options.autocomplete.getOptions(e.innerText,i.getPath(),n,i.editor))?"function"==typeof r.then?r.then((function(i){null===i?t.autocomplete.hideDropDown():i.options?t.autocomplete.show(e,i.startFrom,i.options):t.autocomplete.show(e,0,i)})).catch((function(e){console.error(e)})):r.options?t.autocomplete.show(e,r.startFrom,r.options):t.autocomplete.show(e,0,r):t.autocomplete.hideDropDown()}),50))},i._onKeyDown=function(e){var t,i=e.which||e.keyCode,n=e.altKey,r=e.ctrlKey,o=e.metaKey,s=e.shiftKey,a=!1,l=this.focusTarget;9===i&&(t=this,setTimeout((function(){t.focusTarget!==l&&(0,g.selectContentEditable)(t.focusTarget)}),0)),this.searchBox&&(r&&70===i?(this.searchBox.dom.search.focus(),this.searchBox.dom.search.select(),a=!0):(114===i||r&&71===i)&&(s?this.searchBox.previous(!0):this.searchBox.next(!0),a=!0)),this.history&&(r&&!s&&90===i?(this._onUndo(),a=!0):r&&s&&90===i&&(this._onRedo(),a=!0)),!this.options.autocomplete||a||r||n||o||1!==e.key.length&&8!==i&&46!==i||(a=!1,this._showAutoComplete(e.target)),a&&(e.preventDefault(),e.stopPropagation())},i._createTable=function(){var e;this.options.navigationBar&&(0,g.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)},i.showContextMenu=function(e,t){var i,n=[],o=this.multiselection.nodes.slice();n.push({text:(0,l.Iu)("duplicateText"),title:(0,l.Iu)("duplicateTitle"),className:"jsoneditor-duplicate",click:function(){S.onDuplicate(o)}}),n.push({text:(0,l.Iu)("remove"),title:(0,l.Iu)("removeTitle"),className:"jsoneditor-remove",click:function(){S.onRemove(o)}}),this.options.onCreateMenu&&(i=o.map((function(e){return e.getPath()})),n=this.options.onCreateMenu(n,{type:"multiple",path:i[0],paths:i})),new r.x(n,{close:t}).show(e,this.getPopupAnchor())},i.getPopupAnchor=function(){return this.options.popupAnchor||this.frame},i.getSelection=function(){var e,t,i={start:null,end:null};return this.multiselection.nodes&&this.multiselection.nodes.length&&this.multiselection.nodes.length&&(e=this.multiselection.nodes[0],t=this.multiselection.nodes[this.multiselection.nodes.length-1],"down"===this.multiselection.direction?(i.start=e.serialize(),i.end=t.serialize()):(i.start=t.serialize(),i.end=e.serialize())),i},i.onSelectionChange=function(e){"function"==typeof e&&(this._selectionChangedHandler=(0,g.debounce)(e,this.DEBOUNCE_INTERVAL))},i.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)),(e=this._getNodeInstancesByRange(e,t)).forEach((function(e){e.expandTo()})),this.select(e)},i._getNodeInstancesByRange=function(e,t){e&&e.path&&(i=this.node.findNodeByPath(e.path),t&&t.path&&(n=this.node.findNodeByPath(t.path)));var i,n,r=[];if(i instanceof S)if(n instanceof S&&n!==i)if(i.parent===n.parent){t=i.getIndex()<n.getIndex()?(e=i,n):(e=n,i);var o=e;for(r.push(o);o=o.nextSibling(),r.push(o),o&&o!==t;);}else r=this._findTopLevelNodes(i,n);else r.push(i);return r},i.getNodesByRange=function(e,t){e=this._getNodeInstancesByRange(e,t);var i=[];return e.forEach((function(e){i.push(e.serialize())})),i},[{mode:"tree",mixin:i,data:"json"},{mode:"view",mixin:i,data:"json"},{mode:"form",mixin:i,data:"json"}])},2744:function(e,t,i){t.tryRequireAjv=function(){try{return i(8903)}catch(e){}}},9125:function(e,t,i){t.O=function(){try{i(4864)}catch(e){console.error(e)}}},9791:function(e,t,i){"use strict";i.r(t),i.d(t,{addClassName:function(){return y},addEventListener:function(){return F},clear:function(){return p},compileJSONPointer:function(){return Q},contains:function(){return ue},debounce:function(){return z},escapeUnicodeChars:function(){return d},extend:function(){return g},findUniqueName:function(){return ne},formatSize:function(){return ce},get:function(){return ie},getAbsoluteLeft:function(){return A},getAbsoluteTop:function(){return b},getChildPaths:function(){return re},getColorCSS:function(){return q},getIndexForPosition:function(){return Y},getInnerText:function(){return L},getInputSelection:function(){return J},getInternetExplorerVersion:function(){return N},getPositionForPath:function(){return U},getSelection:function(){return R},getSelectionOffset:function(){return _},getType:function(){return m},getWindow:function(){return v},hasParentNode:function(){return W},improveSchemaError:function(){return O},insideRect:function(){return j},isArray:function(){return I},isChildOf:function(){return V},isFirefox:function(){return P},isObject:function(){return de},isPromise:function(){return D},isTimestamp:function(){return le},isUrl:function(){return C},isValidColor:function(){return ee},isValidValidationError:function(){return K},isValidationErrorChanged:function(){return ge},limitCharacters:function(){return he},makeFieldTooltip:function(){return te},parse:function(){return c},parsePath:function(){return Z},parseString:function(){return ae},removeAllClassNames:function(){return w},removeClassName:function(){return S},removeEventListener:function(){return H},removeReturnsAndSurroundingWhitespace:function(){return B},selectContentEditable:function(){return E},setEndOfContentEditable:function(){return k},setSelection:function(){return T},setSelectionOffset:function(){return $},sort:function(){return oe},sortObjectKeys:function(){return se},stringifyPath:function(){return M},stripFormatting:function(){return x},textDiff:function(){return X},tryJsonRepair:function(){return h},validate:function(){return u}}),i(4987);t=i(233);var n=i.n(t),r=(t=i(3860),i.n(t)),o=i(6589),s=i(7026),a=i(7907);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})(e)}function c(e){try{return JSON.parse(e)}catch(t){throw u(e),t}}function h(e){try{return r()(e)}catch(t){return e}}function d(e){return e.replace(/[\u007F-\uFFFF]/g,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))}function u(e){(void 0!==o?o:JSON).parse(e)}function g(e,t){for(var i in t)pe(t,i)&&(e[i]=t[i]);return e}function p(e){for(var t in e)pe(e,t)&&delete e[t];return e}function m(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":I(e)?"array":"object"}var f=/^https?:\/\/\S+$/;function C(e){return("string"==typeof e||e instanceof String)&&f.test(e)}function I(e){return"[object Array]"===Object.prototype.toString.call(e)}function v(e){return e.ownerDocument.defaultView}function A(e){return e.getBoundingClientRect().left+window.pageXOffset||document.scrollLeft||0}function b(e){return e.getBoundingClientRect().top+window.pageYOffset||document.scrollTop||0}function y(e,t){var i=e.className.split(" ");-1===i.indexOf(t)&&(i.push(t),e.className=i.join(" "))}function w(e){e.className=""}function S(e,t){var i=e.className.split(" ");-1!==(t=i.indexOf(t))&&(i.splice(t,1),e.className=i.join(" "))}function x(e){for(var t=e.childNodes,i=0,n=t.length;i<n;i++){var r=t[i],o=(r.style&&r.removeAttribute("style"),r.attributes);if(o)for(var s=o.length-1;0<=s;s--){var a=o[s];!0===a.specified&&r.removeAttribute(a.name)}x(r)}}function k(e){var t;document.createRange&&((t=document.createRange()).selectNodeContents(e),t.collapse(!1),(e=window.getSelection()).removeAllRanges(),e.addRange(t))}function E(e){var t;e&&"DIV"===e.nodeName&&window.getSelection&&document.createRange&&((t=document.createRange()).selectNodeContents(e),(e=window.getSelection()).removeAllRanges(),e.addRange(t))}function R(){if(window.getSelection){var e=window.getSelection();if(e.getRangeAt&&e.rangeCount)return e.getRangeAt(0)}return null}function T(e){var t;e&&window.getSelection&&((t=window.getSelection()).removeAllRanges(),t.addRange(e))}function _(){var e=R();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 $(e){var t;document.createRange&&window.getSelection&&window.getSelection()&&(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),T(t))}function L(e,t){var i;if(void 0===t&&(t={_text:"",flush:function(){var e=this._text;return this._text="",e},set:function(e){this._text=e}}),e.nodeValue)return""!==(i=B(e.nodeValue))?t.flush()+i:"";if(e.hasChildNodes()){for(var n=e.childNodes,r="",o=0,s=n.length;o<s;o++){var a,l=n[o];"DIV"===l.nodeName||"P"===l.nodeName?((a=(a=n[o-1])?a.nodeName:void 0)&&"DIV"!==a&&"P"!==a&&"BR"!==a&&(""!==r&&(r+="\n"),t.flush()),r+=L(l,t),t.set("\n")):"BR"===l.nodeName?(r+=t.flush(),t.set("\n")):r+=L(l,t)}return r}return""}function B(e){return e.replace(/(\b|^)\s*(\b|$)/g,(function(e){return/\n/.exec(e)?"":e}))}function W(e,t){for(var i=e?e.parentNode:void 0;i;){if(i===t)return!0;i=i.parentNode}return!1}function N(){var e;return-1===G&&(e=-1,"undefined"!=typeof navigator&&"Microsoft Internet Explorer"===navigator.appName&&null!=/MSIE ([0-9]+[.0-9]+)/.exec(navigator.userAgent)&&(e=parseFloat(RegExp.$1)),G=e),G}var G=-1;function P(){return"undefined"!=typeof navigator&&-1!==navigator.userAgent.indexOf("Firefox")}function F(e,t,i,n){return e.addEventListener?(void 0===n&&(n=!1),"mousewheel"===t&&P()&&(t="DOMMouseScroll"),e.addEventListener(t,i,n),i):e.attachEvent?(e.attachEvent("on"+t,n=function(){return i.call(e,window.event)}),n):void 0}function H(e,t,i,n){e.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===t&&P()&&(t="DOMMouseScroll"),e.removeEventListener(t,i,n)):e.detachEvent&&e.detachEvent("on"+t,i)}function V(e,t){for(var i=e.parentNode;i;){if(i===t)return!0;i=i.parentNode}return!1}function Z(e){var t=[],i=0;function n(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(function(){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}());else{if("["!==e[i])throw new Error('Invalid JSON path: unexpected character "'+e[i]+'" at index '+i);if("'"===e[++i]||'"'===e[i]){var r=e[i];if(i++,t.push(n(r)),e[i]!==r)throw new Error("Invalid JSON path: closing quote ' expected at index "+i);i++}else{if(0===(r=n("]").trim()).length)throw new Error("Invalid JSON path: array value expected at index "+i);r="*"===r?r:JSON.parse(r),t.push(r)}if("]"!==e[i])throw new Error("Invalid JSON path: closing bracket ] expected at index "+i);i++}return t}function M(e){return e.map((function(e){return"number"==typeof e?"["+e+"]":"string"==typeof e&&e.match(/^[A-Za-z0-9_$]+$/)?"."+e:'["'+e+'"]'})).join("")}function O(e){var t,i;return"enum"===e.keyword&&Array.isArray(e.schema)&&(i=e.schema)&&(5<(i=i.map((function(e){return JSON.stringify(e)}))).length&&(t=["("+(i.length-5)+" more...)"],(i=i.slice(0,5)).push(t)),e.message="should be equal to one of: "+i.join(", ")),"additionalProperties"===e.keyword&&(e.message="should NOT have additional property: "+e.params.additionalProperty),e}function D(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}function K(e){return"object"===l(e)&&Array.isArray(e.path)&&"string"==typeof e.message}function j(e,t,i){return i=void 0!==i?i:0,t.left-i>=e.left&&t.right+i<=e.right&&t.top-i>=e.top&&t.bottom+i<=e.bottom}function z(e,t,i){var n;return function(){var r=this,o=arguments,s=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||e.apply(r,o)}),t),s&&e.apply(r,o)}}function X(e,t){for(var i=t.length,n=0,r=e.length,o=t.length;t.charAt(n)===e.charAt(n)&&n<i;)n++;for(;t.charAt(o-1)===e.charAt(r-1)&&n<o&&0<r;)o--,r--;return{start:n,end:o}}function J(e){var t,i,n,r,o=0,s=0;return"number"==typeof e.selectionStart&&"number"==typeof e.selectionEnd?(o=e.selectionStart,s=e.selectionEnd):(r=document.selection.createRange())&&r.parentElement()===e&&(n=e.value.length,t=e.value.replace(/\r\n/g,"\n"),(i=e.createTextRange()).moveToBookmark(r.getBookmark()),(r=e.createTextRange()).collapse(!1),-1<i.compareEndPoints("StartToEnd",r)?o=s=n:(o=-i.moveStart("character",-n),o+=t.slice(0,o).split("\n").length-1,-1<i.compareEndPoints("EndToEnd",r)?s=n:(s=-i.moveEnd("character",-n),s+=t.slice(0,s).split("\n").length-1))),{startIndex:o,endIndex:s,start:a(o),end:a(s)};function a(t){return{row:((t=e.value.substring(0,t)).match(/\n/g)||[]).length+1,column:t.length-t.lastIndexOf("\n")}}}function Y(e,t,i){e=e.value||"";return 0<t&&0<i?(e=e.split("\n",t),t=Math.min(e.length,t),i=Math.min(e[t-1].length,i-1),i=1===t?i:i+1,e.slice(0,t-1).join("\n").length+i):-1}function U(e,t){var i,n=[];if(!t||!t.length)return n;try{i=s.parse(e)}catch(e){return n}return t.forEach((function(e){var t=Q(Z(e));(t=i.pointers[t])&&n.push({path:e,line:t.key?t.key.line:t.value?t.value.line:0,column:t.key?t.key.column:t.value?t.value.column:0})})),n}function Q(e){return e.map((function(e){return"/"+String(e).replace(/~/g,"~0").replace(/\//g,"~1")})).join("")}function q(e){var t=document.createElement("div");return t.style.color=e,t.style.color.split(/\s+/).join("").toLowerCase()||null}function ee(e){return!!q(e)}function te(e,t){if(!e)return"";var i="";return e.title&&(i+=e.title),e.description&&(0<i.length&&(i+="\n"),i+=e.description),e.default&&(0<i.length&&(i+="\n\n"),i=(i+=(0,a.Iu)("default",void 0,t)+"\n")+JSON.stringify(e.default,null,2)),Array.isArray(e.examples)&&0<e.examples.length&&(0<i.length&&(i+="\n\n"),i+=(0,a.Iu)("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 ie(e,t){for(var i=e,n=0;n<t.length&&null!=i;n++)i=i[t[n]];return i}function ne(e,t){for(var i=e.replace(/ \(copy( \d+)?\)$/,""),n=i,r=1;-1!==t.indexOf(n);)n=i+" (copy"+(1<r?" "+r:"")+")",r++;return n}function re(e,t){var i={};if(Array.isArray(e))for(var n=Math.min(e.length,1e4),r=0;r<n;r++)!function e(t,i,n,r){(Array.isArray(t)||de(t))&&!r||(i[n||""]=!0),de(t)&&Object.keys(t).forEach((function(o){e(t[o],i,n+"."+o,r)}))}(e[r],i,"",t);else i[""]=!0;return Object.keys(i).sort()}function oe(e,t,i){var n=t&&"."!==t?Z(t):[],r="desc"===i?-1:1;return(t=e.slice()).sort((function(e,t){return e=ie(e,n),t=ie(t,n),r*(t<e?1:e<t?-1:0)})),t}function se(e,t){var i="desc"===t?-1:1,r=(t=Object.keys(e).sort((function(e,t){return i*n()(e,t)})),{});return t.forEach((function(t){r[t]=e[t]})),r}function ae(e){if(""===e)return"";if("null"===(t=e.toLowerCase()))return null;if("true"===t)return!0;if("false"===t)return!1;var t=Number(e),i=parseFloat(e);return isNaN(t)||isNaN(i)?e:t}function le(e,t){return"number"==typeof t&&9466848e5<t&&isFinite(t)&&Math.floor(t)===t&&!isNaN(new Date(t).valueOf())}function ce(e){return e<900?e.toFixed()+" B":(e/=1e3)<900?e.toFixed(1)+" KB":(e/=1e3)<900?e.toFixed(1)+" MB":(e/=1e3)<900?e.toFixed(1)+" GB":(e/1e3).toFixed(1)+" TB"}function he(e,t){return e.length<=t?e:e.slice(0,t)+"..."}function de(e){return"object"===l(e)&&null!==e&&!Array.isArray(e)}function ue(e,t){return-1!==e.indexOf(t)}function ge(e,t){if(!t&&!e)return!1;if(t&&!e||!t&&e)return!0;if(t.length!==e.length)return!0;for(var i=0;i<e.length;++i){var 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}}(i);if("object"===l(n))return n.v}return!1}function pe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},8037:function(e,t,i){var n;if(window.Picker)n=window.Picker;else try{n=i(4049)}catch(e){}e.exports=n},6225:function(e,t,i){function n(e,t){var i,n;return t=h(e,t),(e=a.modules[t])||("function"==typeof(e=a.payloads[t])&&(i={id:t,uri:"",exports:n={},packaged:!0},n=e((function(e,i){return l(t,e,i)}),n,i)||i.exports,a.modules[t]=n,delete a.payloads[t]),e=a.modules[t]=n||e),e}var r,o,s,a,l,c,h;e=i.nmd(e),(s=function(){return this}())||"undefined"==typeof window||(s=window),(a=function(e,t,i){"string"!=typeof e?a.original?a.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace()):(2==arguments.length&&(i=t),a.modules[e]||(a.payloads[e]=i,a.modules[e]=null))}).modules={},a.payloads={},l=function(e,t,i){if("string"==typeof t){var r=n(e,t);if(null!=r)return i&&i(),r}else if("[object Array]"===Object.prototype.toString.call(t)){for(var o=[],s=0,a=t.length;s<a;++s){var l=n(e,t[s]);if(null==l&&c.original)return;o.push(l)}return i&&i.apply(null,o)||!0}},c=function(e,t){var i=l("",e,t);return null==i&&c.original?c.original.apply(this,arguments):i},h=function(e,t){var i;if(-1!==t.indexOf("!"))return i=t.split("!"),h(e,i[0])+"!"+h(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},o=s,(r="ace")&&(s[r]||(s[r]={}),o=s[r]),o.define&&o.define.packaged||(a.original=o.define,o.define=a,o.define.packaged=!0),o.require&&o.require.packaged||(c.original=o.require,o.require=c,o.require.packaged=!0),ace.define("ace/lib/fixoldbrowsers",["require","exports","module"],(function(e,t,i){"use strict";"undefined"==typeof Element||Element.prototype.remove||Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})})),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:{},r=(/mac|win|linux/i.exec(n.platform)||["other"])[0].toLowerCase(),o=n.userAgent||"";n=n.appName||"";t.isWin="win"==r,t.isMac="mac"==r,t.isLinux="linux"==r,t.isIE="Microsoft Internet Explorer"==n||0<=n.indexOf("MSAppHost")?parseFloat((o.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((o.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=o.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(o.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(o.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(o.split(" Edge/")[1])||void 0,t.isAIR=0<=o.indexOf("AdobeAIR"),t.isAndroid=0<=o.indexOf("Android"),t.isChromeOS=0<=o.indexOf(" CrOS "),t.isIOS=/iPad|iPhone|iPod/.test(o)&&!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";e=e("./useragent");var n,r,o=(t.buildDom=function e(t,i,n){if("string"==typeof t&&t)return c=document.createTextNode(t),i&&i.appendChild(c),c;if(!Array.isArray(t))return t&&t.appendChild&&i&&i.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var r=[],o=0;o<t.length;o++){var s=e(t[o],i,n);s&&r.push(s)}return r}var a=document.createElement(t[0]),l=t[1],c=1;for(o=c=l&&"object"==typeof l&&!Array.isArray(l)?2:c;o<t.length;o++)e(t[o],a,n);return 2==c&&Object.keys(l).forEach((function(e){var t=l[e];"class"===e?a.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e||"$"==e[0]?a[e]=t:"ref"===e?n&&(n[t]=a):"style"===e?"string"==typeof t&&(a.style.cssText=t):null!=t&&a.setAttribute(e,t)})),i&&i.appendChild(a),a},t.getDocumentHead=function(e){return(e=e||document).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 r=i.indexOf(t);if(-1==r)break;n=!1,i.splice(r,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},[]);function s(){var e=o;o=null,e&&e.forEach((function(e){a(e[0],e[1])}))}function a(e,i,r){if("undefined"!=typeof document){if(o)if(r)s();else if(!1===r)return o.push([e,i]);if(!n){var a=r;r=(a=r&&r.getRootNode&&(a=r.getRootNode())&&a!=r?a:document).ownerDocument||a;if(i&&t.hasCssString(i,a))return null;i&&(e+="\n/*# sourceURL=ace/css/"+i+" */");var l=t.createElement("style");l.appendChild(r.createTextNode(e)),i&&(l.id=i),(a=a==r?t.getDocumentHead(r):a).insertBefore(l,a.firstChild)}}}t.useStrictCSP=function(e){0==(n=e)?s():o=o||[]},t.importCssString=a,t.importCssStylsheet=function(e,i){t.buildDom(["link",{rel:"stylesheet",href:e}],t.getDocumentHead(i))},t.scrollbarWidth=function(e){var i,n=t.createElement("ace_inner"),r=(n.style.width="100%",n.style.minWidth="0px",n.style.height="200px",n.style.display="block",t.createElement("ace_outer")),o=((e=((i=r.style).position="absolute",i.left="-10000px",i.overflow="hidden",i.width="200px",i.minWidth="0px",i.height="150px",i.display="block",r.appendChild(n),e.documentElement)).appendChild(r),n.offsetWidth);return o==(i=(i.overflow="scroll",n.offsetWidth))&&(i=r.clientWidth),e.removeChild(r),o-i},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=!e.isWin||"undefined"!=typeof window&&1.5<=window.devicePixelRatio,e.isChromeOS&&(t.HI_DPI=!1),"undefined"!=typeof document&&(r=document.createElement("div"),t.HI_DPI&&void 0!==r.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),e.isEdge||void 0===r.style.animationName||(t.HAS_CSS_ANIMATION=!0),r=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/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/keys",["require","exports","module","ace/lib/oop"],(function(e,t,i){"use strict";var n=e("./oop"),r=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.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);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,i[173]="-";for(var r=["cmd","ctrl","alt","shift"],o=Math.pow(2,r.length);o--;)i.KEY_MODS[o]=r.filter((function(e){return o&i.KEY_MODS[e]})).join("-")+"-";return i.KEY_MODS[0]="",i.KEY_MODS[-1]="input-",i}();n.mixin(t,r),t.keyCodeToString=function(e){var t=r[e];return(t="string"!=typeof 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,r=e("./keys"),o=e("./useragent"),s=null,a=0;function l(){if(null==n){n=!1;try{document.createComment("").addEventListener("test",(function(){}),{get passive(){n={passive:!1}}})}catch(e){}}return n}function c(e,t,i){this.elem=e,this.type=t,this.callback=i}function h(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}c.prototype.destroy=function(){g(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var d,u=t.addListener=function(e,t,i,n){e.addEventListener(t,i,l()),n&&n.$toDestroy.push(new c(e,t,i))},g=t.removeListener=function(e,t,i){e.removeEventListener(t,i,l())};function p(e,t,i){var n=h(t);if(!o.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(n|=8),s.altGr){if(3==(3&n))return;s.altGr=0}18!==i&&17!==i||(l="location"in t?t.location:t.keyLocation,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 r.MODIFIER_KEYS&&(i=-1),!n&&13===i){var l="location"in t?t.location:t.keyLocation;if(3===l&&(e(t,n,-i),t.defaultPrevented))return}if(o.isChromeOS&&8&n){if(e(t,n,i),t.defaultPrevented)return;n&=-9}return!!(n||i in r.FUNCTION_KEYS||i in r.PRINTABLE_KEYS)&&e(t,n,i)}function m(){s=Object.create(null)}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||o.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.button},t.capture=function(e,t,i){var n=e&&e.ownerDocument||document;function r(e){t&&t(e),i&&i(e),g(n,"mousemove",t),g(n,"mouseup",r),g(n,"dragstart",r)}return u(n,"mousemove",t),u(n,"mouseup",r),u(n,"dragstart",r),r},t.addMouseWheelListener=function(e,t,i){"onmousewheel"in e?u(e,"mousewheel",(function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),t(e)}),i):"onwheel"in e?u(e,"wheel",(function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}t(e)}),i):u(e,"DOMMouseScroll",(function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),t(e)}),i)},t.addMultiMouseDownListener=function(e,i,n,r,s){var a,l,c,h=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};function g(e){var s;if(0!==t.getButton(e)?h=0:1<e.detail&&!(4<++h)||(h=1),o.isIE&&(s=5<Math.abs(e.clientX-a)||5<Math.abs(e.clientY-l),c&&!s||(h=1),c&&clearTimeout(c),c=setTimeout((function(){c=null}),i[h-1]||600),1==h&&(a=e.clientX,l=e.clientY)),e._clicks=h,n[r]("mousedown",e),4<h)h=0;else if(1<h)return n[r](d[h],e)}(e=Array.isArray(e)?e:[e]).forEach((function(e){u(e,"mousedown",g,s)}))},t.getModifierString=function(e){return r.KEY_MODS[h(e)]},t.addCommandKeyListener=function(e,i,n){var r,a;o.isOldGecko||o.isOpera&&!("KeyboardEvent"in window)?(r=null,u(e,"keydown",(function(e){r=e.keyCode}),n),u(e,"keypress",(function(e){return p(i,e,r)}),n)):(a=null,u(e,"keydown",(function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=p(i,e,e.keyCode);return a=e.defaultPrevented,t}),n),u(e,"keypress",(function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),n),u(e,"keyup",(function(e){s[e.keyCode]=null}),n),s||(m(),u(window,"focus",m)))},"object"==typeof window&&window.postMessage&&!o.isOldIE&&(d=1,t.nextTick=function(e,i){i=i||window;var n="zero-timeout-message-"+d++;u(i,"message",(function r(o){o.data==n&&(t.stopPropagation(o),g(i,"message",r),e())})),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/range",["require","exports","module"],(function(e,t,i){"use strict";function n(e,t,i,n){this.start={row:e,column:t},this.end={row:i,column:n}}(function(){this.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},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t=e.end;e=e.start;return 1==(t=this.compare(t.row,t.column))?1==(t=this.compare(e.row,e.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(e.row,e.column))?-1:1==t?42:0},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){return-1==(e=this.compareRange(e))||0==e||1==e},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.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)},this.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)},this.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.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:t<this.start.column?-1:t>this.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.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)},this.clipRows=function(e,t){var i,r;return this.end.row>t?i={row:t+1,column:0}:this.end.row<e&&(i={row:e,column:0}),this.start.row>t?r={row:t+1,column:0}:this.start.row<e&&(r={row:e,column:0}),n.fromPoints(r||this.start,i||this.end)},this.extend=function(e,t){var i,r,o=this.compare(e,t);return 0==o?this:(-1==o?i={row:e,column:t}:r={row:e,column:t},n.fromPoints(i||this.start,r||this.end))},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return n.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new n(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new n(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start);e=e.documentToScreenPosition(this.end);return new n(t.row,t.column,e.row,e.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(n.prototype),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},n.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=n})),ace.define("ace/lib/lang",["require","exports","module"],(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="";0<t;)1&t&&(i+=e),(t>>=1)&&(e+=e);return i};var n=/^\s\s*/,r=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(n,"")},t.stringTrimRight=function(e){return e.replace(r,"")},t.copyObject=function(e){var t,i={};for(t in e)i[t]=e[t];return i},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=function e(t){if("object"!=typeof t||!t)return t;if(Array.isArray(t)){for(var i=[],n=0;n<t.length;n++)i[n]=e(t[n]);return i}if("[object Object]"!==Object.prototype.toString.call(t))return t;for(n in i={},t)i[n]=e(t[n]);return i},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,i=Object.create(null);for(t in e)i[t]=e[t];return i},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,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},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){function t(){n=null,e()}function i(e){return i.cancel(),n=setTimeout(t,e||0),i}var n=null;return(i.schedule=i).call=function(){return this.cancel(),e(),i},i.cancel=function(){return clearTimeout(n),n=null,i},i.isPending=function(){return n},i},t.delayedCall=function(e,t){function i(){r=null,e()}function n(e){null==r&&(r=setTimeout(i,e||t))}var r=null;return n.delay=function(e){r&&clearTimeout(r),r=setTimeout(i,e||t)},(n.schedule=n).call=function(){this.cancel(),e()},n.cancel=function(){r&&clearTimeout(r),r=null},n.isPending=function(){return r},n}})),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/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],(function(e,t,i){"use strict";var n=e("../lib/event"),r=e("../lib/useragent"),o=e("../lib/dom"),s=e("../lib/lang"),a=e("../clipboard"),l=r.isChrome<18,c=r.isIE,h=63<r.isChrome,d=e("../lib/keys"),u=d.KEY_MODS,g=r.isIOS,p=g?/\s/:/\n/,m=r.isMobile;t.TextInput=function(e,t){var i=o.createElement("textarea"),f=(i.className="ace_text-input",i.setAttribute("wrap","off"),i.setAttribute("autocorrect","off"),i.setAttribute("autocapitalize","off"),i.setAttribute("spellcheck",!1),i.style.opacity="0",e.insertBefore(i,e.firstChild),!1),C=!1,I=!1,v=!1,A="",b=(m||(i.style.fontSize="1px"),!1),y=!1,w="",S=0,x=0,k=0;try{var E=document.activeElement===i}catch(e){}function R(e){F(e,!0)}function T(e){F(e,!1)}function _(e){var o=P(e);a.pasteCancelled()||("string"==typeof o?(o&&t.onPaste(o,e),r.isIE&&setTimeout($),n.preventDefault(e)):(i.value="",C=!0))}n.addListener(i,"blur",(function(e){y||(t.onBlur(e),E=!1)}),t),n.addListener(i,"focus",(function(e){if(!y){if(E=!0,r.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),r.isEdge?setTimeout($):$()}}),t),this.$focusScroll=!1,this.focus=function(){if(A||h||"browser"==this.$focusScroll)return i.focus({preventScroll:!0});var e=i.style.top;i.style.position="fixed",i.style.top="0px";try{var t=0!=i.getBoundingClientRect().top}catch(e){return}var n=[];if(t)for(var r=i.parentElement;r&&1==r.nodeType;)n.push(r),r.setAttribute("ace_nocontext",!0),r=!r.parentElement&&r.getRootNode?r.getRootNode().host:r.parentElement;i.focus({preventScroll:!0}),t&&n.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 E},t.on("beforeEndOperation",(function(){var e=t.curOp,n=e&&e.command&&e.command.name;"insertstring"!=n&&(n=n&&(e.docChanged||e.selectionChanged),I&&n&&(w=i.value="",V()),$())}));var $=g?function(e){var n;!E||f&&!e||v||((n="\n ab"+(e=e||"")+"cde fg\n")!=i.value&&(i.value=w=n),n=4+(e.length||(t.selection.isEmpty()?0:1)),4==S&&x==n||i.setSelectionRange(4,n),S=4,x=n)}:function(){if(!I&&!v&&(E||W)){I=!0;var e,n,r=0,o=0,s="",a=(t.session&&(a=(e=t.selection).getRange(),e=e.cursor.row,r=a.start.column,o=a.end.column,s=t.session.getLine(e),a.start.row!=e?(n=t.session.getLine(e-1),r=a.start.row<e-1?0:r,o+=n.length+1,s=n+"\n"+s):a.end.row!=e?(n=t.session.getLine(e+1),o=a.end.row>e+1?n.length:o,o+=s.length+1,s=s+"\n"+n):m&&0<e&&(s="\n"+s,o+=1,r+=1),400<s.length&&(r<400&&o<400?s=s.slice(0,400):(s="\n",r==o?r=o=0:(r=0,o=1)))),s+"\n\n");if(a!=w&&(i.value=w=a,S=x=a.length),W&&(S=i.selectionStart,x=i.selectionEnd),x!=o||S!=r||i.selectionEnd!=x)try{i.setSelectionRange(r,o),S=r,x=o}catch(e){}I=!1}},L=(this.resetSelection=$,E&&t.onFocus(),function(e){return 0===e.selectionStart&&e.selectionEnd>=w.length&&e.value===w&&w&&e.selectionEnd!==x}),B=null,W=(this.setInputHandler=function(e){B=e},!(this.getInputHandler=function(){return B})),N=function(e,n){if(W=W&&!1,C)return $(),e&&t.onPaste(e),C=!1,"";for(var o=i.selectionStart,s=i.selectionEnd,a=S,l=w.length-x,c=e,h=e.length-o,d=e.length-s,u=0;0<a&&w[u]==e[u];)u++,a--;for(c=c.slice(u),u=1;0<l&&w.length-u>S-1&&w[w.length-u]==e[e.length-u];)u++,l--;h-=u-1,d-=u-1;var g=c.length-u+1;return g<0&&(a=-g,g=0),c=c.slice(0,g),n||c||h||a||l||d?(g=!(v=!0),r.isAndroid&&". "==c&&(c="  ",g=!0),c&&!a&&!l&&!h&&!d||b?t.onTextInput(c):t.onTextInput(c,{extendLeft:a,extendRight:l,restoreStart:h,restoreEnd:d}),v=!1,w=e,S=o,x=s,k=d,g?"\n":c):""},G=function(e){if(I)return H();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}e=i.value;var n=N(e,!0);(500<e.length||p.test(n)||m&&S<1&&S==x)&&$()},P=function(e,t,i){var n=e.clipboardData||window.clipboardData;if(n&&!l){var r=c||i?"Text":"text/plain";try{return t?!1!==n.setData(r,t):n.getData(r)}catch(e){if(!i)return P(e,t,!0)}}},F=function(e,r){var o=t.getCopyText();if(!o)return n.preventDefault(e);P(e,o)?(g&&($(o),f=o,setTimeout((function(){f=!1}),10)),r?t.onCut():t.onCopy(),n.preventDefault(e)):(f=!0,i.value=o,i.select(),setTimeout((function(){f=!1,$(),r?t.onCut():t.onCopy()})))},H=(n.addCommandKeyListener(i,t.onCommandKey.bind(t),t),n.addListener(i,"select",(function(e){I||(f?f=!1:L(i)?(t.selectAll(),$()):m&&i.selectionStart!=S&&$())}),t),n.addListener(i,"input",G,t),n.addListener(i,"cut",R,t),n.addListener(i,"copy",T,t),n.addListener(i,"paste",_,t),"oncut"in i&&"oncopy"in i&&"onpaste"in i||n.addListener(e,"keydown",(function(e){if((!r.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:T(e);break;case 86:_(e);break;case 88:R(e)}}),t),function(){var e;if(I&&t.onCompositionUpdate&&!t.$readOnly)return b?Z():void(I.useTextareaForIME?t.onCompositionUpdate(i.value):(e=i.value,N(e),I.markerRange&&(I.context&&(I.markerRange.start.column=I.selectionStart=I.context.compositionStartOffset),I.markerRange.end.column=I.markerRange.start.column+x-I.selectionStart+k)))}),V=function(e){t.onCompositionEnd&&!t.$readOnly&&(I=!1,t.onCompositionEnd(),t.off("mousedown",Z),e&&G())};function Z(){y=!0,i.blur(),i.focus(),y=!1}var M,O=s.delayedCall(H,50).schedule.bind(null,null);function D(){clearTimeout(M),M=setTimeout((function(){A&&(i.style.cssText=A,A=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()}),0)}function K(e){t.textInput.onContextMenu(e),D()}if(n.addListener(i,"compositionstart",(function(e){I||!t.onCompositionStart||t.$readOnly||(I={},b||(e.data&&(I.useTextareaForIME=!1),setTimeout(H,0),t._signal("compositionStart"),t.on("mousedown",Z),(e=t.getSelectionRange()).end.row=e.start.row,e.end.column=e.start.column,I.markerRange=e,I.selectionStart=S,t.onCompositionStart(I),I.useTextareaForIME?(w=i.value="",x=S=0):(i.msGetInputContext&&(I.context=i.msGetInputContext()),i.getInputContext&&(I.context=i.getInputContext()))))}),t),n.addListener(i,"compositionupdate",H,t),n.addListener(i,"keyup",(function(e){27==e.keyCode&&i.value.length<i.selectionStart&&(I||(w=i.value),S=x=-1,$()),O()}),t),n.addListener(i,"keydown",O,t),n.addListener(i,"compositionend",V,t),this.getElement=function(){return i},this.setCommandMode=function(e){b=e,i.readOnly=!1},this.setReadOnly=function(e){b||(i.readOnly=e)},this.setCopyWithEmptySelection=function(e){},this.onContextMenu=function(e){W=!0,$(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,s){function a(e){o.translate(i,e.clientX-h-2,Math.min(e.clientY-c-2,d))}A=A||i.style.cssText,i.style.cssText=(s?"z-index:100000;":"")+(r.isIE?"opacity:0.1;":"")+"text-indent: -"+(S+x)*t.renderer.characterWidth*.5+"px;";s=t.container.getBoundingClientRect();var l=o.computedStyle(t.container),c=s.top+(parseInt(l.borderTopWidth)||0),h=s.left+(parseInt(s.borderLeftWidth)||0),d=s.bottom-c-i.clientHeight-2;a(e),"mousedown"==e.type&&(t.renderer.$isMousePressed=!0,clearTimeout(M),r.isWin&&n.capture(t.container,a,D))},this.onContextMenuClose=D,n.addListener(i,"mouseup",K,t),n.addListener(i,"mousedown",(function(e){e.preventDefault(),D()}),t),n.addListener(t.renderer.scroller,"contextmenu",K,t),n.addListener(i,"contextmenu",K,t),g){var j=t,z=i;function Y(e){var t,i,n,r;document.activeElement!==z||J||I||j.$mouseHandler.isMousePressed||f||(t=z.selectionStart,i=z.selectionEnd,n=null,(r=0)==t?n=d.up:1==t?n=d.home:x<i&&"\n"==w[i]?n=d.end:t<S&&" "==w[t-1]?(n=d.left,r=u.option):t<S||t==S&&x!=S&&t==i?n=d.left:x<i&&2<w.slice(0,i).split("\n").length?n=d.down:x<i&&" "==w[i-1]?(n=d.right,r=u.option):(x<i||i==x&&x!=S&&t==i)&&(n=d.right),t!==i&&(r|=u.shift),n&&(!j.onCommandKey({},r,n)&&j.commands&&(n=d.keyCodeToString(n),(r=j.commands.findKeyCommand(r,n))&&j.execCommand(r)),S=t,x=i,$("")))}var X=null,J=!1;z.addEventListener("keydown",(function(e){X&&clearTimeout(X),J=!0}),!0),z.addEventListener("keyup",(function(e){X=setTimeout((function(){J=!1}),100)}),!0),document.addEventListener("selectionchange",Y),j.on("destroy",(function(){document.removeEventListener("selectionchange",Y)}))}},t.$setUserAgentForTests=function(e,t){m=e,g=t}})),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],(function(e,t,i){"use strict";var n=e("../lib/useragent");function r(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")}function o(e,t){return(e.start.row==e.end.row?2*t.column-e.start.column-e.end.column:e.start.row!=e.end.row-1||e.start.column||e.end.column?2*t.row-e.start.row-e.end.row:t.column-4)<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}(function(){this.onMouseDown=function(e){var t=e.inSelection(),i=e.getDocumentPosition(),r=(this.mousedownEvent=e,this.editor),o=e.getButton();return 0!==o?(!r.getSelectionRange().isEmpty()&&1!=o||r.selection.moveToPosition(i),void(2==o&&(r.textInput.onContextMenu(e.domEvent),n.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||r.isFocused()||(r.focus(),!this.$focusTimeout||this.$clickSelection||r.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(i,1<e.domEvent._clicks),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.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.renderer.scroller.setCapture&&i.renderer.scroller.setCapture(),i.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,i=t.renderer.screenToTextCoordinates(this.x,this.y);this.$clickSelection&&(e=-1==(e=this.$clickSelection.comparePoint(i))?this.$clickSelection.end:1==e?this.$clickSelection.start:(i=(e=o(this.$clickSelection,i)).cursor,e.anchor),t.selection.setSelectionAnchor(e.row,e.column)),t.selection.selectToPosition(i),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,i,n,r=this.editor,s=r.renderer.screenToTextCoordinates(this.x,this.y);e=r.selection[e](s.row,s.column);this.$clickSelection&&(i=this.$clickSelection.comparePoint(e.start),t=this.$clickSelection.comparePoint(e.end),-1==i&&t<=0?(n=this.$clickSelection.end,e.end.row==s.row&&e.end.column==s.column||(s=e.start)):1==t&&0<=i?(n=this.$clickSelection.start,e.start.row==s.row&&e.start.column==s.column||(s=e.end)):n=-1==i&&1==t?(s=e.end,e.start):(s=(i=o(this.$clickSelection,s)).cursor,i.anchor),r.selection.setSelectionAnchor(n.row,n.column)),r.selection.selectToPosition(s),r.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){n=this.mousedownEvent.x,e=this.mousedownEvent.y,i=this.x,t=this.y;var e,t,i=Math.sqrt(Math.pow(i-n,2)+Math.pow(t-e,2)),n=Date.now();(0<i||n-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){e=e.getDocumentPosition();var t=this.editor,i=t.session.getBracketRange(e);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=t.selection.getWordRange(e.row,e.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(e){e=e.getDocumentPosition();var t=this.editor,i=(this.setState("selectByLines"),t.getSelectionRange());i.isMultiLine()&&i.contains(e.row,e.column)?(this.$clickSelection=t.selection.getLineRange(i.start.row),this.$clickSelection.end=t.selection.getLineRange(i.end.row).end):this.$clickSelection=t.selection.getLineRange(e.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){var t,i,n,r,o,s,a;if(!e.getAccelKey())return e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0),t=this.editor,this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0}),i=this.$lastScroll,r=(s=(n=e.domEvent.timeStamp)-i.t)?e.wheelX/s:i.vx,o=s?e.wheelY/s:i.vy,s<550&&(r=(r+i.vx)/2,o=(o+i.vy)/2),a=!1,1<=(s=Math.abs(r/o))&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(a=!0),(a=!!(s<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed))||a)?i.allowed=n:n-i.allowed<550&&(Math.abs(r)<=1.5*Math.abs(i.vx)&&Math.abs(o)<=1.5*Math.abs(i.vy)?(a=!0,i.allowed=n):i.allowed=0),i.t=n,i.vx=r,i.vy=o,a?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}).call(r.prototype),t.DefaultHandlers=r})),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],(function(e,t,i){"use strict";e("./lib/oop");var n=e("./lib/dom");function r(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}(function(){this.$init=function(){return this.$element=n.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){n.addCssClass(this.getElement(),e)},this.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)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(r.prototype),t.Tooltip=r})),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],(function(e,t,i){"use strict";var n=e("../lib/dom"),r=e("../lib/oop"),o=e("../lib/event"),s=e("../tooltip").Tooltip;function a(e){s.call(this,e)}r.inherits(a,s),function(){this.setPosition=function(e,t){var i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,r=this.getWidth(),o=this.getHeight();i<(e+=15)+r&&(e-=e+r-i),n<(t+=15)+o&&(t-=20+o),s.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=function(e){var t,i,r,s=e.editor,l=s.renderer.$gutterLayer,c=new a(s.container);function h(){t=t&&clearTimeout(t),r&&(c.hide(),r=null,s._signal("hideGutterTooltip",c),s.off("mousewheel",h))}function d(e){c.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",(function(t){if(s.isFocused()&&0==t.getButton()&&"foldWidgets"!=(i=l.getRegion(t))){var i=t.getDocumentPosition().row,n=s.session.selection;if(t.getShiftKey())n.selectTo(i,0);else{if(2==t.domEvent.detail)return s.selectAll(),t.preventDefault();e.$clickSelection=s.selection.getLineRange(i)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}})),e.editor.setDefaultHandler("guttermousemove",(function(o){var a=o.domEvent.target||o.domEvent.srcElement;if(n.hasCssClass(a,"ace_fold-widget"))return h();r&&e.$tooltipFollowsMouse&&d(o),i=o,t=t||setTimeout((function(){t=null,(i&&!e.isMousePressed?function(){var t=i.getDocumentPosition().row,n=l.$annotations[t];if(!n)return h();if(t==s.session.getLength()){t=s.renderer.pixelToScreenCoordinates(0,i.y).row;var o=i.$pos;if(t>s.session.documentToScreenRow(o.row,o.column))return h()}r!=n&&(r=n.text.join("<br/>"),c.setHtml(r),c.show(),s._signal("showGutterTooltip",c),s.on("mousewheel",h),e.$tooltipFollowsMouse?d(i):(t=i.domEvent.target.getBoundingClientRect(),(o=c.getElement().style).left=t.right+"px",o.top=t.bottom+"px"))}:h)()}),50)})),o.addListener(s.renderer.$gutter,"mouseout",(function(e){i=null,r&&!t&&(t=setTimeout((function(){t=null,h()}),50))}),s),s.on("changeSession",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"),r=e("../lib/useragent");e=t.MouseEvent=function(e,t){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};(function(){this.stopPropagation=function(){n.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){n.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e,t=this.editor.getSelectionRange();return t.isEmpty()?this.$inSelection=!1:(e=this.getDocumentPosition(),this.$inSelection=t.contains(e.row,e.column)),this.$inSelection},this.getButton=function(){return n.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=r.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(e.prototype)})),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"),r=e("../lib/event"),o=e("../lib/useragent");function s(e){var t,i,s,l,c,h,d,u,g,p,m,f=e.editor,C=n.createElement("div"),I=(C.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",C.textContent=" ",["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach((function(t){e[t]=this[t]}),this),f.on("mousedown",this.onMouseDown.bind(e)),f.container),v=0;function A(){var e,t,n,r,o,l,c,d,u=h;n=h=f.renderer.screenToTextCoordinates(i,s),t=u,r=Date.now(),e=!t||n.row!=t.row,t=!t||n.column!=t.column,!p||e||t?(f.moveCursorToPosition(n),p=r,m={x:i,y:s}):5<a(m.x,m.y,i,s)?p=null:200<=r-p&&(f.renderer.scrollCursorIntoView(),p=null),e=h,t=u,n=Date.now(),r=f.renderer.layerConfig.lineHeight,u=f.renderer.layerConfig.characterWidth,o=f.renderer.scroller.getBoundingClientRect(),o={x:{left:i-o.left,right:o.right-i},y:{top:s-o.top,bottom:o.bottom-s}},l=Math.min(o.x.left,o.x.right),c=Math.min(o.y.top,o.y.bottom),d={row:e.row,column:e.column},l/u<=2&&(d.column+=o.x.left<o.x.right?-3:2),c/r<=1&&(d.row+=o.y.top<o.y.bottom?-1:1),l=e.row!=d.row,u=e.column!=d.column,c=!t||e.row!=t.row,l||u&&!c?g?200<=n-g&&f.renderer.scrollCursorIntoView(d):g=n:g=null}function b(){c=f.selection.toOrientedRange(),t=f.session.addMarker(c,"ace_selection",f.getSelectionStyle()),f.clearSelection(),f.isFocused()&&f.renderer.$cursorLayer.setBlinking(!1),clearInterval(l),A(),l=setInterval(A,20),v=0,r.addListener(document,"mousemove",S)}function y(){clearInterval(l),f.session.removeMarker(t),t=null,f.selection.fromOrientedRange(c),f.isFocused()&&!u&&f.$resetCursorStyle(),v=0,p=g=h=c=null,r.removeListener(document,"mousemove",S)}this.onDragStart=function(e){var t;if(this.cancelDrag||!I.draggable)return t=this,setTimeout((function(){t.startSelect(),t.captureMouse(e)}),0),e.preventDefault();c=f.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=f.getReadOnly()?"copy":"copyMove",f.container.appendChild(C),i.setDragImage&&i.setDragImage(C,0,0),setTimeout((function(){f.container.removeChild(C)})),i.clearData(),i.setData("Text",f.session.getTextRange()),u=!0,this.setState("drag")},this.onDragEnd=function(e){I.draggable=!1,u=!1,this.setState(null),f.getReadOnly()||(e=e.dataTransfer.dropEffect,d||"move"!=e||f.session.remove(f.getSelectionRange()),f.$resetCursorStyle()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!f.getReadOnly()&&x(e.dataTransfer))return i=e.clientX,s=e.clientY,t||b(),v++,e.dataTransfer.dropEffect=d=k(e),r.preventDefault(e)},this.onDragOver=function(e){if(!f.getReadOnly()&&x(e.dataTransfer))return i=e.clientX,s=e.clientY,t||(b(),v++),null!==w&&(w=null),e.dataTransfer.dropEffect=d=k(e),r.preventDefault(e)},this.onDragLeave=function(e){if(--v<=0&&t)return y(),d=null,r.preventDefault(e)},this.onDrop=function(e){if(h){var t=e.dataTransfer;if(u)switch(d){case"move":c=c.contains(h.row,h.column)?{start:h,end:h}:f.moveText(c,h);break;case"copy":c=f.moveText(c,h,!0)}else t=t.getData("Text"),c={start:h,end:f.session.insert(h,t)},f.focus(),d=null;return y(),r.preventDefault(e)}},r.addListener(I,"dragstart",this.onDragStart.bind(e),f),r.addListener(I,"dragend",this.onDragEnd.bind(e),f),r.addListener(I,"dragenter",this.onDragEnter.bind(e),f),r.addListener(I,"dragover",this.onDragOver.bind(e),f),r.addListener(I,"dragleave",this.onDragLeave.bind(e),f),r.addListener(I,"drop",this.onDrop.bind(e),f);var w=null;function S(){null==w&&(w=setTimeout((function(){null!=w&&t&&y()}),20))}function x(e){return!(e=e.types)||Array.prototype.some.call(e,(function(e){return"text/plain"==e||"Text"==e}))}function k(e){var t=["copy","copymove","all","uninitialized"],i=o.isMac?e.altKey:e.ctrlKey,n="uninitialized";try{n=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var r="none";return i&&0<=t.indexOf(n)?r="copy":0<=["move","copymove","linkmove","all","uninitialized"].indexOf(n)?r="move":0<=t.indexOf(n)&&(r="copy"),r}}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,t=(e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging"),o.isWin?"default":"move");e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;o.isIE&&"dragReady"==this.state&&3<a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)&&t.dragDrop(),"dragWait"===this.state&&0<a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){var t,i,n;this.$dragEnabled&&(this.mousedownEvent=e,t=this.editor,i=e.inSelection(),n=e.getButton(),1!==(e.domEvent.detail||1)||0!==n||!i||e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey())||(this.mousedownEvent.time=Date.now(),"unselectable"in(n=e.domEvent.target||e.domEvent.srcElement)&&(n.unselectable="on"),t.getDragDelay()?(o.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,r=e("../lib/event"),o=e("../lib/dom");t.addTouchListeners=function(e,t){var i,s,a,l,c,h,d,u,g,p="scroll",m=0,f=0,C=0,I=0;function v(){g||function(){function e(e){var r,s=e.target.getAttribute("action");if("more"==s||!n)return n=!n,e=t.getCopyText(),r=t.session.getUndoManager().hasUndo(),void g.replaceChild(o.buildDom(n?["span",!e&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],e&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],e&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],i&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],r&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),g.firstChild);"paste"==s?i.readText().then((function(e){t.execCommand(s,e)})):s&&("cut"!=s&&"copy"!=s||(i?i.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(s)),g.firstChild.style.display="none",n=!1,"openCommandPallete"!=s&&t.focus()}var i=window.navigator&&window.navigator.clipboard,n=!1;g=o.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){p="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(t){t.stopPropagation(),t.preventDefault(),e(t)},onclick:e},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container)}();var e=t.selection.cursor,i=(e=t.renderer.textToScreenCoordinates(e.row,e.column),t.renderer.textToScreenCoordinates(0,0).pageX),n=t.renderer.scrollLeft,r=t.container.getBoundingClientRect();g.style.top=e.pageY-r.top-3+"px",e.pageX-r.left<r.width-70?(g.style.left="",g.style.right="10px"):(g.style.right="",g.style.left=i+n-r.left+"px"),g.style.display="",g.firstChild.style.display="none",t.on("input",A)}function A(e){g&&(g.style.display="none"),t.off("input",A)}function b(){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",v()}r.addListener(e,"contextmenu",(function(e){u&&t.textInput.getElement().focus()}),t),r.addListener(e,"touchstart",(function(e){var r=e.touches;if(c||1<r.length)return clearTimeout(c),c=null,a=-1,void(p="zoom");u=t.$mouseHandler.isMousePressed=!0;var o=t.renderer.layerConfig.lineHeight,h=t.renderer.layerConfig.lineHeight,g=e.timeStamp,v=(A=(l=g,r[0])).clientX,A=A.clientY;Math.abs(i-v)+Math.abs(s-A)>o&&(a=-1),i=e.clientX=v,s=e.clientY=A,C=I=0,v=new n(e,t);if(d=v.getDocumentPosition(),g-a<500&&1==r.length&&!m)f++,e.preventDefault(),e.button=0,c=null,clearTimeout(c),t.selection.moveToPosition(d),(A=2<=f?t.selection.getLineRange(d.row):t.session.getBracketRange(d))&&!A.isEmpty()?t.selection.setRange(A):t.selection.selectWord(),p="wait";else{f=0;v=t.selection.cursor,r=t.selection.isEmpty()?v:t.selection.anchor,A=t.renderer.$cursorLayer.getPixelPosition(v,!0),v=t.renderer.$cursorLayer.getPixelPosition(r,!0),r=t.renderer.scroller.getBoundingClientRect();var y=t.renderer.layerConfig.offset,w=t.renderer.scrollLeft,S=function(e,t){return(e/=h)*e+(t=t/o-.75)*t};if(e.clientX<r.left)return void(p="zoom");A=S(e.clientX-r.left-A.left+w,e.clientY-r.top-A.top+y),S=S(e.clientX-r.left-v.left+w,e.clientY-r.top-v.top+y),A<3.5&&S<3.5&&(p=S<A?"cursor":"anchor"),p=S<3.5?"anchor":A<3.5?"cursor":"scroll",c=setTimeout(b,450)}a=g}),t),r.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,v()):"scroll"==p?(m+=60,h=setInterval((function(){m--<=0&&(clearInterval(h),h=null),Math.abs(C)<.01&&(C=0),Math.abs(I)<.01&&(I=0),m<20&&(C*=.9),m<20&&(I*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*C,10*I),e==t.session.getScrollTop()&&(m=0)}),10),A()):v(),clearTimeout(c),c=null}),t),r.addListener(e,"touchmove",(function(e){if(c&&(clearTimeout(c),c=null),!(1<(r=e.touches).length||"zoom"==p)){var r=r[0],o=i-r.clientX,a=s-r.clientY;if("wait"==p){if(!(4<o*o+a*a))return e.preventDefault();p="cursor"}i=r.clientX,s=r.clientY,e.clientX=r.clientX,e.clientY=r.clientY;var h=(r=e.timeStamp)-l;l=r,"scroll"==p?((r=new n(e,t)).speed=1,r.wheelX=o,r.wheelY=a,10*Math.abs(o)<Math.abs(a)&&(o=0),10*Math.abs(a)<Math.abs(o)&&(a=0),0!=h&&(C=o/h,I=a/h),t._emit("mousewheel",r),r.propagationStopped||(C=I=0)):(o=new n(e,t).getDocumentPosition(),"cursor"==p?t.selection.moveCursorToPosition(o):"anchor"==p&&t.selection.setSelectionAnchor(o.row,o.column),t.renderer.scrollCursorIntoView(o),e.preventDefault())}}),t)}})),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(),r=document.createElement("script");r.src=e,i.appendChild(r),r.onload=r.onreadystatechange=function(e,i){!i&&r.readyState&&"loaded"!=r.readyState&&"complete"!=r.readyState||(r=r.onload=r.onreadystatechange=null,i||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}})),ace.define("ace/lib/event_emitter",["require","exports","module"],(function(e,t,i){"use strict";function n(){this.propagationStopped=!0}function r(){this.defaultPrevented=!0}var o={};o._emit=o._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var i=this._eventRegistry[e]||[],o=this._defaultHandlers[e];if(i.length||o){(t="object"==typeof t&&t?t:{}).type||(t.type=e),t.stopPropagation||(t.stopPropagation=n),t.preventDefault||(t.preventDefault=r);i=i.slice();for(var s=0;s<i.length&&(i[s](t,this),!t.propagationStopped);s++);return o&&!t.defaultPrevented?o(t,this):void 0}},o._signal=function(e,t){if(i=(this._eventRegistry||{})[e])for(var i=i.slice(),n=0;n<i.length;n++)i[n](t,this)},o.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}))},o.setDefaultHandler=function(e,t){var i,n,r=this._defaultHandlers;(r=r||(this._defaultHandlers={_disabled_:{}}))[e]&&(n=r[e],(i=r._disabled_[e])||(r._disabled_[e]=i=[]),i.push(n),-1!=(n=i.indexOf(t))&&i.splice(n,1)),r[e]=t},o.removeDefaultHandler=function(e,t){var i,n=this._defaultHandlers;n&&(i=n._disabled_[e],n[e]==t?i&&this.setDefaultHandler(e,i.pop()):i&&-1!=(n=i.indexOf(t))&&i.splice(n,1))},o.on=o.addEventListener=function(e,t,i){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];return-1==(n=n||(this._eventRegistry[e]=[])).indexOf(t)&&n[i?"unshift":"push"](t),t},o.off=o.removeListener=o.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{},!(e=this._eventRegistry[e])||-1!==(t=e.indexOf(t))&&e.splice(t,1)},o.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=o})),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,i){var n=e("./oop"),r=e("./event_emitter").EventEmitter,o={setOptions:function(e){Object.keys(e).forEach((function(t){this.setOption(t,e[t])}),this)},getOptions:function(e){var t,i={};return e?Array.isArray(e)||(i=e,e=Object.keys(i)):(t=this.$options,e=Object.keys(t).filter((function(e){return!t[e].hidden}))),e.forEach((function(e){i[e]=this.getOption(e)}),this),i},setOption:function(e,t){var i;if(this["$"+e]!==t)return(i=this.$options[e])?i.forwardTo?this[i.forwardTo]&&this[i.forwardTo].setOption(e,t):(i.handlesSet||(this["$"+e]=t),void(i&&i.set&&i.set.call(this,t))):s('misspelled option "'+e+'"')},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]:s('misspelled option "'+e+'"')}};function s(e){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}function a(e,t){var i=new Error(e);i.data=t,"object"==typeof console&&console.error&&console.error(i),setTimeout((function(){throw i}))}function l(){this.$defaultOptions={}}(function(){n.implement(this,r),this.defineOptions=function(e,t,i){return e.$options||(this.$defaultOptions[t]=e.$options={}),Object.keys(i).forEach((function(t){var n=i[t];(n="string"==typeof n?{forwardTo:n}:n).name||(n.name=t),"initialValue"in(e.$options[n.name]=n)&&(e["$"+n.name]=n.initialValue)})),n.implement(e,o),this},this.resetOptions=function(e){Object.keys(e.$options).forEach((function(t){var i=e.$options[t];"value"in i&&e.setOption(t,i.value)}))},this.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)},this.setDefaultValues=function(e,t){Object.keys(t).forEach((function(i){this.setDefaultValue(e,i,t[i])}),this)},this.warn=s,this.reportError=a}).call(l.prototype),t.AppConfig=l})),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/dom","ace/lib/app_config"],(function(e,t,n){var r=e("./lib/lang"),o=(e("./lib/oop"),e("./lib/net")),s=e("./lib/dom"),a=e("./lib/app_config").AppConfig,l=(n.exports=t=new a,function(){return this||"undefined"!=typeof window&&window}()),c={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null},h=(t.get=function(e){if(c.hasOwnProperty(e))return c[e];throw new Error("Unknown config key: "+e)},t.set=function(e,t){if(c.hasOwnProperty(e))c[e]=t;else if(0==this.setDefaultValue("",e,t))throw new Error("Unknown config key: "+e);"useStrictCSP"==e&&s.useStrictCSP(t)},t.all=function(){return r.copyObject(c)},t.$modes={},t.moduleUrl=function(e,t){if(c.$moduleUrls[e])return c.$moduleUrls[e];e=e.split("/");var i="snippets"==(t=t||e[e.length-2]||"")?"/":"-",n=e[e.length-1],r=("worker"==t&&"-"==i&&(r=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g"),n=n.replace(r,"")),(!n||n==t)&&1<e.length&&(n=e[e.length-2]),c[t+"Path"]);return null==r?r=c.basePath:"/"==i&&(t=i=""),r&&"/"!=r.slice(-1)&&(r+="/"),r+t+i+n+this.get("suffix")},t.setModuleUrl=function(e,t){return c.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(i,n){var r,s;Array.isArray(i)&&(s=i[0],i=i[1]);try{r=e(i)}catch(n){}if(r&&!t.$loading[i])return n&&n(r);if(t.$loading[i]||(t.$loading[i]=[]),t.$loading[i].push(n),!(1<t.$loading[i].length)){function a(){e([i],(function(e){t._emit("load.module",{name:i,module:e});var n=t.$loading[i];t.$loading[i]=null,n.forEach((function(t){t&&t(e)}))}))}if(!t.get("packaged"))return a();o.loadScript(t.moduleUrl(i,s),a),h()}},function(){c.basePath||c.workerPath||c.modePath||c.themePath||Object.keys(c.$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"),h=function(){})});function d(r){if(l&&l.document){c.packaged=r||e.packaged||n.packaged||l.define&&i.amdD.packaged;for(var o,s={},a="",h=((r=document.currentScript||document._currentScript)&&r.ownerDocument||document).getElementsByTagName("script"),d=0;d<h.length;d++){var u=h[d],g=u.src||u.getAttribute("src");if(g){for(var p=u.attributes,m=0,f=p.length;m<f;m++){var C=p[m];0===C.name.indexOf("data-ace-")&&(s[C.name.replace(/^data-ace-/,"").replace(/-(.)/g,(function(e,t){return t.toUpperCase()}))]=C.value)}(u=g.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/))&&(a=u[1])}}for(o 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[o]&&t.set(o,s[o])}}d(!0),t.init=d,t.version="1.4.14"})),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";function n(e){function t(t){document.hasFocus&&document.hasFocus()&&(e.isFocused()||document.activeElement!=(e.textInput&&e.textInput.getElement()))||window.focus(),e.focus()}var i=this,n=(this.editor=e,new s(this),new a(this),new c(this),e.renderer.getMouseEventTarget()),l=(r.addListener(n,"click",this.onMouseEvent.bind(this,"click"),e),r.addListener(n,"mousemove",this.onMouseMove.bind(this,"mousemove"),e),r.addMultiMouseDownListener([n,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),r.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"),e),h(e.container,e),e.renderer.$gutter);r.addListener(l,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),e),r.addListener(l,"click",this.onMouseEvent.bind(this,"gutterclick"),e),r.addListener(l,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),e),r.addListener(l,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),e),r.addListener(n,"mousedown",t,e),r.addListener(l,"mousedown",t,e),o.isIE&&e.renderer.scrollBarV&&(r.addListener(e.renderer.scrollBarV.element,"mousedown",t,e),r.addListener(e.renderer.scrollBarH.element,"mousedown",t,e)),e.on("mousemove",(function(t){var n,r;i.state||i.$dragDelay||!i.$dragEnabled||(t=e.renderer.screenToTextCoordinates(t.x,t.y),n=e.session.selection.getRange(),r=e.renderer,!n.isEmpty()&&n.insideStart(t.row,t.column)?r.setCursorStyle("default"):r.setCursorStyle(""))}),e)}var r=e("../lib/event"),o=e("../lib/useragent"),s=e("./default_handlers").DefaultHandlers,a=e("./default_gutter_handler").GutterHandler,l=e("./mouse_event").MouseEvent,c=e("./dragdrop_handler").DragdropHandler,h=e("./touch_handler").addTouchListeners;e=e("../config");(function(){this.onMouseEvent=function(e,t){this.editor.session&&this.editor._emit(e,new l(t,this.editor))},this.onMouseMove=function(e,t){var i=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;i&&i.length&&this.editor._emit(e,new l(t,this.editor))},this.onMouseWheel=function(e,t){var i=new l(t,this.editor);i.speed=2*this.$scrollSpeed,i.wheelX=t.wheelX,i.wheelY=t.wheelY,this.editor._emit(e,i)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){function i(e){if(e){if(o.isWebKit&&!e.which&&h.releaseMouse)return h.releaseMouse();h.x=e.clientX,h.y=e.clientY,t&&t(e),h.mouseEvent=new l(e,h.editor),h.$mouseMoved=!0}}function n(e){a.off("beforeEndOperation",d),clearInterval(u),a.session&&s(),h[h.state+"End"]&&h[h.state+"End"](e),h.state="",h.isMousePressed=c.$isMousePressed=!1,c.$keepTextAreaAtCursor&&c.$moveTextAreaToCursor(),h.$onCaptureMouseMove=h.releaseMouse=null,e&&h.onMouseEvent("mouseup",e),a.endOperation()}function s(){h[h.state]&&h[h.state](),h.$mouseMoved=!1}this.x=e.x,this.y=e.y,this.isMousePressed=!0;var a=this.editor,c=this.editor.renderer,h=(c.$isMousePressed=!0,this);if(o.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout((function(){n(e)}));var d=function(e){h.releaseMouse&&a.curOp.command.name&&a.curOp.selectionChanged&&(h[h.state+"End"]&&h[h.state+"End"](),h.state="",h.releaseMouse())},u=(a.on("beforeEndOperation",d),a.startOperation({command:{name:"mouse"}}),h.$onCaptureMouseMove=i,h.releaseMouse=r.capture(this.editor.container,i,n),setInterval(s,20))},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&r.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)},this.destroy=function(){this.releaseMouse&&this.releaseMouse()}}).call(n.prototype),e.defineOptions(n.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:o.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=n})),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("../lib/dom");t.FoldHandler=function(e){e.on("click",(function(t){var i=t.getDocumentPosition(),r=e.session;(i=((i=r.getFoldAt(i.row,i.column,1))&&(t.getAccelKey()?r.removeFold(i):r.expandFold(i),t.stop()),t.domEvent&&t.domEvent.target))&&n.hasCssClass(i,"ace_inline_button")&&n.hasCssClass(i,"ace_toggle_wrap")&&(r.setOption("wrap",!r.getUseWrapMode()),e.renderer.scrollCursorIntoView())})),e.on("gutterclick",(function(t){var i,n;"foldWidgets"==e.renderer.$gutterLayer.getRegion(t)&&(i=t.getDocumentPosition().row,(n=e.session).foldWidgets&&n.foldWidgets[i]&&e.session.onFoldWidgetClick(i,t),e.isFocused()||e.focus(),t.stop())})),e.on("gutterdblclick",(function(t){var i,n,r;"foldWidgets"==e.renderer.$gutterLayer.getRegion(t)&&(r=t.getDocumentPosition().row,(n=(n=(i=e.session).getParentFoldRangeData(r,!0)).range||n.firstRange)&&(r=n.start.row,(r=i.getFoldAt(r,i.getLine(r).length,1))?i.removeFold(r):(i.addFold("...",n),e.renderer.scrollCursorIntoView({row:n.start.row,column:0}))),t.stop())}))}})),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],(function(e,t,i){"use strict";function n(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)}var r=e("../lib/keys"),o=e("../lib/event");(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.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)}},this.addKeyboardHandler=function(e,t){var i;e&&("function"!=typeof e||e.handleKeyboard||(e.handleKeyboard=e),-1!=(i=this.$handlers.indexOf(e))&&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))},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.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(" ")},this.$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},this.onCommandKey=function(e,t,i){var n=r.keyCodeToString(i);return this.$callKeyboardHandlers(t,n,i,e)},this.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)}}).call(n.prototype),t.KeyBinding=n})),ace.define("ace/lib/bidiutil",["require","exports","module"],(function(e,t,i){"use strict";var n=0,r=0,o=!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=11,d=18,u=[d,d,d,d,d,d,d,d,d,6,5,6,8,5,d,d,d,d,d,d,d,d,d,d,d,d,d,d,5,5,5,6,8,4,4,h,h,h,4,4,4,4,4,10,9,10,9,9,2,2,2,2,2,2,2,2,2,2,9,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,d,d,d,d,d,d,5,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,9,4,h,h,h,h,4,4,4,4,0,4,4,d,4,4,h,h,2,2,4,0,4,4,4,2,0,4,4,4,4,4],g=[8,8,8,8,8,8,8,8,8,8,8,d,d,d,0,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,5,13,14,15,16,17,9,h,h,h,h,h,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8];function p(e,t,i){if(!(r<e))if(1!=e||1!=n||s)for(var o,a,l,c,h=i.length,d=0;d<h;){if(t[d]>=e){for(o=d+1;o<h&&t[o]>=e;)o++;for(a=d,l=o-1;a<l;a++,l--)c=i[a],i[a]=i[l],i[l]=c;d=o}d++}else i.reverse()}function m(e){var t=e.charCodeAt(0),i=t>>8;return 0==i?191<t?0:u[t]:5==i?/[\u0591-\u05f4]/.test(e)?1:0:6==i?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?h:/[\u06f0-\u06f9]/.test(e)?2:7:32==i&&t<=8287?g[255&t]:254==i&&65136<=t?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,i,u){if(e.length<2)return{};var g=e.split(""),f=new Array(g.length),C=new Array(g.length),I=[];n=u?1:0,function(e,t,i,u){var g,p,f,C=n?c:l,I=0,v=-1,A=null,b=null,y=[];if(!u)for(A=0,u=[];A<i;A++)u[A]=m(e[A]);for(r=n,a=s=o=!1,b=0;b<i;b++){if(f=I,y[b]=g=function(e,t,i,r){var l,c,u,g=t[r];switch(g){case 0:case 1:o=!1;case 4:case 3:return g;case 2:return o?3:2;case 7:return o=!0,1;case 8:return 4;case 9:return r<1||r+1>=t.length||2!=(l=i[r-1])&&3!=l||2!=(p=t[r+1])&&3!=p?4:(p=o?3:p)==l?p:4;case 10:return 2==(l=0<r?i[r-1]:5)&&r+1<t.length&&2==t[r+1]?2:4;case h:if(0<r&&2==i[r-1])return 2;if(o)return 4;for(u=r+1,c=t.length;u<c&&t[u]==h;)u++;return u<c&&2==t[u]?2:4;case 12:for(c=t.length,u=r+1;u<c&&12==t[u];)u++;if(u<c){var p=1425<=(p=e[r])&&p<=2303||64286==p;if(l=t[u],p&&(1==l||7==l))return 1}return r<1||5==(l=t[r-1])?4:i[r-1];case 5:return s=!(o=!1),n;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:o=!1;case d:return 4}}(e,u,y,b),f=240&(I=C[f][g]),I&=15,t[b]=p=C[I][5],0<f)if(16==f){for(A=v;A<b;A++)t[A]=1;v=-1}else v=-1;if(C[I][6])-1==v&&(v=b);else if(-1<v){for(A=v;A<b;A++)t[A]=p;v=-1}5==u[b]&&(t[b]=0),r|=p}if(a)for(A=0;A<i;A++)if(6==u[A]){t[A]=n;for(var w=A-1;0<=w&&8==u[w];w--)t[w]=n}}(g,I,g.length,i);for(var v=0;v<f.length;f[v]=v,v++);for(p(2,I,f),p(1,I,f),v=0;v<f.length-1;v++)3===i[v]?I[v]=t.AN:1===I[v]&&(i[v]>7&&i[v]<13||4===i[v]||i[v]===d)?I[v]=t.ON_R:0<v&&"ل"===g[v-1]&&/\u0622|\u0623|\u0625|\u0627/.test(g[v])&&(I[v-1]=I[v]=t.R_H,v++);for(g[g.length-1]===t.DOT&&(I[g.length-1]=t.B),"‫"===g[0]&&(I[0]=t.RLE),v=0;v<f.length;v++)C[v]=I[f[v]];return{logicalFromVisual:f,bidiLevels:C}},t.hasBidiCharacters=function(e,t){for(var i=!1,n=0;n<e.length;n++)t[n]=m(e.charAt(n)),i||1!=t[n]&&7!=t[n]&&3!=t[n]||(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";function n(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=r,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=s.test(e.getValue())}var r=e("./lib/bidiutil"),o=e("./lib/lang"),s=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/;(function(){this.isBidiRow=function(e,t,i){return!!this.seenBidi&&(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,i),this.updateBidiMap()),this.bidiMap.bidiLevels)},this.onChange=function(e){this.seenBidi?this.currentRow=null:"insert"==e.action&&s.test(e.lines.join("\n"))&&(this.seenBidi=!0,this.currentRow=null)},this.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;return t.length&&0<=(t=this.session.$getRowCacheIndex(t,this.currentRow))?this.session.$docRowCache[t]:e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var i,n=this.session.$getRowCacheIndex(t,this.currentRow);0<this.currentRow-e&&(i=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===n;)n=i,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){var i,n=(e=void 0===e?this.getDocumentRow():e)===this.session.getLength()-1?this.EOF:this.EOL,s=(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode?((e=this.session.$wrapData[e])&&(0<(t=void 0===t?this.getSplitIndex():t)&&e.length?(this.wrapIndent=e.indent,this.wrapOffset=this.wrapIndent*this.charWidths[r.L],this.line=t<e.length?this.line.substring(e[t-1],e[t]):this.line.substring(e[e.length-1])):this.line=this.line.substring(0,e[t])),t==e.length&&(this.line+=this.showInvisibles?n:r.DOT)):this.line+=this.showInvisibles?n:r.DOT,this.session),a=0;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,(function(e,t){return"\t"===e||s.isFullWidth(e.charCodeAt(0))?(i="\t"===e?s.getScreenTabSize(t+a):2,a+=i-1,o.stringRepeat(r.DOT,i)):e})),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==r.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},this.updateBidiMap=function(){var e=[];r.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=r.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},this.markAsDirty=function(){this.currentRow=null},this.updateCharacterWidths=function(e){var t;this.characterWidth!==e.$characterSize.width&&(this.fontMetrics=e,t=this.characterWidth=e.$characterSize.width,e=e.$measureCharWidth("ה"),this.charWidths[r.L]=this.charWidths[r.EN]=this.charWidths[r.ON_R]=t,this.charWidths[r.R]=this.charWidths[r.AN]=e,this.charWidths[r.R_H]=.45*e,this.charWidths[r.B]=this.charWidths[r.RLE]=0,this.currentRow=null)},this.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},this.setEolChar=function(e){this.EOL=e},this.setContentWidth=function(e){this.contentWidth=e},this.isRtlLine=function(e){return!!this.$isRtl||(null!=e?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir)},this.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)},this.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,i=t<e?this.session.getOverwrite()?e:e-1:t,n=r.getVisualFromLogicalIdx(i,this.bidiMap),o=this.bidiMap.bidiLevels,s=0;!this.session.getOverwrite()&&e<=t&&o[n]%2!=0&&n++;for(var a=0;a<n;a++)s+=this.charWidths[o[a]];return!this.session.getOverwrite()&&t<e&&o[n]%2==0&&(s+=this.charWidths[o[n]]),this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(s+=this.rtlLineOffset),s},this.getSelections=function(e,t){var i,n=this.bidiMap,r=n.bidiLevels,o=[],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<r.length;g++)u=n.logicalFromVisual[g],i=r[g],(c=a<=u&&u<l)&&!h?d=s:!c&&h&&o.push({left:d,width:s-d}),s+=this.charWidths[i],h=c;if(c&&g===r.length&&o.push({left:d,width:s-d}),this.isRtlDir)for(var p=0;p<o.length;p++)o[p].left+=this.rtlLineOffset;return o},this.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,i=(e=Math.max(e,0),0),n=0,r=this.bidiMap.bidiLevels,o=this.charWidths[r[n]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);i+o/2<e;){if(i+=o,n===r.length-1){o=0;break}o=this.charWidths[r[++n]]}return 0===(t=0<n&&r[n-1]%2!=0&&r[n]%2==0?(e<i&&n--,this.bidiMap.logicalFromVisual[n]):0<n&&r[n-1]%2==0&&r[n]%2!=0?1+(i<e?this.bidiMap.logicalFromVisual[n]:this.bidiMap.logicalFromVisual[n-1]):this.isRtlDir&&n===r.length-1&&0===o&&r[n-1]%2==0||!this.isRtlDir&&0===n&&r[n]%2!=0?1+this.bidiMap.logicalFromVisual[n]:(0<n&&r[n-1]%2!=0&&0!==o&&n--,this.bidiMap.logicalFromVisual[n]))&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(n.prototype),t.BidiHandler=n})),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";function n(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")}))}var r=e("./lib/oop"),o=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,a=e("./range").Range;(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?a.fromPoints(t,t):this.isBackwards()?a.fromPoints(t,e):a.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var i=t?e.end:e.start;t=t?e.start:e.end;this.$setSelection(i.row,i.column,t.row,t.column)},this.$setSelection=function(e,t,i,n){var r,o;this.$silent||(r=this.$isEmpty,o=this.inMultiSelectMode,this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(i,n),this.$isEmpty=!a.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||r!=this.$isEmpty||o)&&this._emit("changeSelection"))},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection((function(){this.moveCursorTo(e,t)}))},this.selectToPosition=function(e){this.$moveSelection((function(){this.moveCursorToPosition(e)}))},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){var i;return void 0===t&&(e=(i=e||this.lead).row,t=i.column),this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor();e=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(e)},this.getLineRange=function(e,t){e="number"==typeof e?e:this.lead.row;var i=(i=this.session.getFoldLine(e))?(e=i.start.row,i.end.row):e;return!0===t?new a(e,0,i,this.session.getLine(i).length):new a(e,0,i+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,i){var n=e.column,r=e.column+t;return i<0&&(n=e.column-t,r=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(n,r).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();(e=this.session.getFoldAt(t.row,t.column,-1))?this.moveCursorTo(e.start.row,e.start.column):0===t.column?0<t.row&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length):(e=this.session.getTabSize(),this.wouldMoveIntoSoftTab(t,e,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-e):this.moveCursorBy(0,-1))},this.moveCursorRight=function(){var e,t=this.lead.getPosition();(e=this.session.getFoldAt(t.row,t.column,1))?this.moveCursorTo(e.end.row,e.end.column):this.lead.column==this.doc.getLine(this.lead.row).length?this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0):(e=this.session.getTabSize(),t=this.lead,this.wouldMoveIntoSoftTab(t,e,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,e):this.moveCursorBy(0,1))},this.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,i=this.session.documentToScreenRow(e,t);i=this.session.screenToDocumentPosition(i,0);(e=this.session.getDisplayLine(e,null,i.row,i.column).match(/^\s*/))[0].length==t||this.session.$useEmacsStyleLineStart||(i.column+=e[0].length),this.moveCursorToPosition(i)},this.moveCursorLineEnd=function(){var e,t=this.lead;t=this.session.getDocumentLastRowColumnPosition(t.row,t.column);this.lead.column==t.column&&(e=this.session.getLine(t.row),t.column==e.length&&0<(e=e.search(/\s+$/))&&(t.column=e)),this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t),r=(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.getFoldAt(e,t,1));if(r)this.moveCursorTo(r.end.row,r.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)}},this.moveCursorLongWordLeft=function(){var e=this.lead.row,t=this.lead.column;if(i=this.session.getFoldAt(e,t,-1))this.moveCursorTo(i.start.row,i.start.column);else{var i=(null==(i=this.session.getFoldStringAt(e,t,-1))&&(i=this.doc.getLine(e).substring(0,t)),o.stringReverse(i));if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(i)&&(t-=this.session.nonTokenRe.lastIndex,i=i.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),t<=0)return this.moveCursorTo(e,0),this.moveCursorLeft(),void(0<e&&this.moveCursorWordLeft());this.session.tokenRe.exec(i)&&(t-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)}},this.$shortWordEndIndex=function(e){var t,i=0,n=/\s/,r=this.session.tokenRe;if(r.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(r.lastIndex=0;(t=e[i])&&!r.test(t);)if(r.lastIndex=0,i++,n.test(t)){if(2<i){i--;break}for(;(t=e[i])&&n.test(t);)i++;if(2<i)break}}return r.lastIndex=0,i},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,i=this.doc.getLine(e),n=i.substring(t),r=this.session.getFoldAt(e,t,1);if(r)return this.moveCursorTo(r.end.row,r.end.column);if(t==i.length){for(var o=this.doc.getLength();n=this.doc.getLine(++e),e<o&&/^\s*$/.test(n););/^\s+/.test(n)||(n=""),t=0}r=this.$shortWordEndIndex(n),this.moveCursorTo(e,t+r)},this.moveCursorShortWordLeft=function(){var e=this.lead.row,t=this.lead.column;if(n=this.session.getFoldAt(e,t,-1))return this.moveCursorTo(n.start.row,n.start.column);var i=this.session.getLine(e).substring(0,t);if(0===t){for(;i=this.doc.getLine(--e),0<e&&/^\s*$/.test(i););t=i.length,/\s+$/.test(i)||(i="")}var n=o.stringReverse(i);n=this.$shortWordEndIndex(n);return this.moveCursorTo(e,t-n)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var i,n=this.session.documentToScreenPosition(this.lead.row,this.lead.column),r=(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]&&(r=this.session.lineWidgets[this.lead.row],e<0?e-=r.rowsAbove||0:0<e&&(e+=r.rowCount-(r.rowsAbove||0))),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)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,i){var n=((n=this.session.getFoldAt(e,t,1))&&(e=n.start.row,t=n.start.column),this.$keepDesiredColumnOnChange=!0,this.session.getLine(e));/[\uDC00-\uDFFF]/.test(n.charAt(t))&&n.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)},this.moveCursorToScreen=function(e,t,i){e=this.session.screenToDocumentPosition(e,t),this.moveCursorTo(e.row,e.column,i)},this.detach=function(){this.lead.detach(),this.anchor.detach()},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.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},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var i=this.getCursor();return a.fromPoints(t,i)}catch(e){return a.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){var e;return this.rangeCount?e=this.ranges.map((function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t})):(e=this.getRange()).isBackwards=this.isBackwards(),e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&1<e.length){this.toSingleRange(e[0]);for(var t=e.length;t--;){var i=a.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)},this.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}}).call(n.prototype),t.Selection=n})),ace.define("ace/tokenizer",["require","exports","module","ace/config"],(function(e,t,i){"use strict";function n(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var i=this.states[t],n=[],r=0,o=this.matchMappings[t]={defaultToken:"text"},s="g",a=[],l=0;l<i.length;l++){var c,h,d=i[l];d.defaultToken&&(o.defaultToken=d.defaultToken),d.caseInsensitive&&(s="gi"),null!=d.regex&&(d.regex instanceof RegExp&&(d.regex=d.regex.toString().slice(1,-1)),c=d.regex,h=new RegExp("(?:("+c+")|(.))").exec("a").length-2,Array.isArray(d.token)?1==d.token.length||1==h?d.token=d.token[0]:h-1!=d.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:d,groupCount:h-1}),d.token=d.token[0]):(d.tokenArray=d.token,d.token=null,d.onMatch=this.$arrayTokens):"function"!=typeof d.token||d.onMatch||(d.onMatch=1<h?this.$applyToken:d.token),1<h&&(c=/\\\d/.test(d.regex)?d.regex.replace(/\\([0-9]+)/g,(function(e,t){return"\\"+(parseInt(t,10)+r+1)})):(h=1,this.removeCapturingGroups(d.regex)),d.splitRegex||"string"==typeof d.token||a.push(d)),o[r]=l,r+=h,n.push(c),d.onMatch||(d.onMatch=null))}n.length||(o[0]=0,n.push("$")),a.forEach((function(e){e.splitRegex=this.createSplitterRegexp(e.regex,s)}),this),this.regExps[t]=new RegExp("("+n.join(")|(")+")|($)",s)}}var r=e("./config"),o=2e3;(function(){this.$setMaxTokenCount=function(e){o=0|e},this.$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=[],r=0,o=i.length;r<o;r++)t[r]&&(n[n.length]={type:i[r],value:t[r]});return n},this.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";for(var i=[],n=this.tokenArray,r=0,o=n.length;r<o;r++)t[r+1]&&(i[i.length]={type:n[r],value:t[r+1]});return i},this.removeCapturingGroups=function(e){return e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,(function(e,t){return t?"(?:":e}))},this.createSplitterRegexp=function(e,t){var i,n,r;return-1!=e.indexOf("(?=")&&(i=0,n=!1,r={},e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,(function(e,t,o,s,a,l){return n?n="]"!=a:a?n=!0:s?(i==r.stack&&(r.end=l+1,r.stack=-1),i--):o&&(i++,1!=o.length&&(r.stack=i,r.start=l)),e})),null!=r.end&&/^\)*$/.test(e.substr(r.end))&&(e=e.substring(0,r.start)+e.substr(r.end))),"$"!=(e="^"!=e.charAt(0)?"^"+e:e).charAt(e.length-1)&&(e+="$"),new RegExp(e,(t||"").replace("g",""))},this.getLineTokens=function(e,t){t&&"string"!=typeof t?"#tmp"===(t=(i=t.slice(0))[0])&&(i.shift(),t=i.shift()):i=[];for(var i,n,r=t||"start",s=(s=this.states[r])||this.states[r="start"],a=this.matchMappings[r],l=this.regExps[r],c=[],h=l.lastIndex=0,d=0,u={type:null,value:""};n=l.exec(e);){var g,p=a.defaultToken,m=null,f=n[0],C=l.lastIndex;C-f.length>h&&(g=e.substring(h,C-f.length),u.type==p?u.value+=g:(u.type&&c.push(u),u={type:p,value:g}));for(var I=0;I<n.length-2;I++)if(void 0!==n[I+1]){p=(m=s[a[I]]).onMatch?m.onMatch(f,r,i,e):m.token,m.next&&(r="string"==typeof m.next?m.next:m.next(r,i),(s=this.states[r])||(this.reportError("state doesn't exist",r),s=this.states[r="start"]),a=this.matchMappings[r],(l=this.regExps[r]).lastIndex=h=C),m.consumeLineEnd&&(h=C);break}if(f)if("string"==typeof p)m&&!1===m.merge||u.type!==p?(u.type&&c.push(u),u={type:p,value:f}):u.value+=f;else if(p)for(u.type&&c.push(u),u={type:null,value:""},I=0;I<p.length;I++)c.push(p[I]);if(h==e.length)break;if(h=C,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"};r="start",i=[];break}}return u.type&&c.push(u),1<i.length&&i[0]!==r&&i.unshift("#tmp",r),{tokens:c,state:i.length?i:r}},this.reportError=r.reportError}).call(n.prototype),t.Tokenizer=n})),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],(function(e,t,i){"use strict";function n(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}}var r=e("../lib/lang");(function(){function e(e,t){return"start"==e&&!t.length||t.unshift(this.nextState,e),this.nextState}function t(e,t){return t.shift(),t.shift()||"start"}this.addRules=function(e,t){if(t)for(var i in e){for(var n=e[i],r=0;r<n.length;r++){var o=n[r];(o.next||o.onMatch)&&("string"==typeof o.next&&0!==o.next.indexOf(t)&&(o.next=t+o.next),o.nextState&&0!==o.nextState.indexOf(t)&&(o.nextState=t+o.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,o){if(e="function"==typeof e?(new e).getRules():e,n)for(var s=0;s<n.length;s++)n[s]=t+n[s];else for(var a in n=[],e)n.push(t+a);if(this.addRules(e,t),i){var l=Array.prototype[o?"push":"unshift"];for(s=0;s<n.length;s++)l.apply(this.$rules[n[s]],r.deepCopy(i))}this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds},this.normalizeRules=function(){var i=0,n=this.$rules;Object.keys(n).forEach((function r(o){var s=n[o];s.processed=!0;for(var a=0;a<s.length;a++){var l=s[a],c=null,h=(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),l.next||l.push);if(h&&Array.isArray(h)?((u=l.stateName)||("string"!=typeof(u=l.token)&&(u=u[0]||""),n[u]&&(u+=i++)),n[u]=h,r(l.next=u)):"pop"==h&&(l.next=t),l.push&&(l.nextState=l.next||l.push,l.next=e,delete l.push),l.rules)for(var d in l.rules)n[d]?n[d].push&&n[d].push.apply(n[d],l.rules[d]):n[d]=l.rules[d];var u="string"==typeof l?l:l.include;(c=u?Array.isArray(u)?u.map((function(e){return n[e]})):n[u]:c)&&(h=[a,1].concat(c),l.noEscape&&(h=h.filter((function(e){return!e.next}))),s.splice.apply(s,h),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 r=Object.create(null);return this.$keywordList=[],Object.keys(e).forEach((function(t){for(var o=e[t].split(n||"|"),s=o.length;s--;){var a=o[s];this.$keywordList.push(a),i&&(a=a.toLowerCase()),r[a]=t}}),this),e=null,i?function(e){return r[e.toLowerCase()]||t}:function(e){return r[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(n.prototype),t.TextHighlightRules=n})),ace.define("ace/mode/behaviour",["require","exports","module"],(function(e,t,i){"use strict";function n(){this.$behaviours={}}(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){e=("function"==typeof e?new e:e).getBehaviours(t),this.addBehaviours(e)},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.prototype),t.Behaviour=n})),ace.define("ace/token_iterator",["require","exports","module","ace/range"],(function(e,t,i){"use strict";function n(e,t,i){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t),e=e.getTokenAt(t,i),this.$tokenIndex=e?e.index:-1}var r=e("./range").Range;(function(){this.stepBackward=function(){for(--this.$tokenIndex;this.$tokenIndex<0;){if(--this.$row,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]},this.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]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,i=e[t].start;if(void 0!==i)return i;for(i=0;0<t;)i+=e[--t].value.length;return i},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new r(this.$row,t,this.$row,t+e.value.length)}}).call(n.prototype),t.TokenIterator=n})),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";function n(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,g.rangeCount!=e.multiSelect.rangeCount&&(g={rangeCount:e.multiSelect.rangeCount})),g[t])return s=g[t];s=g[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}}function r(e,t,i,n){var r=e.end.row-e.start.row;return{text:i+t+n,selection:[0,e.start.column+1,r,e.end.column+(r?0:1)]}}function o(e){this.add("braces","insertion",(function(t,i,a,l,c){var d=a.getCursorPosition(),u=l.doc.getLine(d.row);if("{"==c)return n(a),p=a.getSelectionRange(),""!==(m=l.doc.getTextRange(p))&&"{"!==m&&a.getWrapBehavioursEnabled()?r(p,m,"{","}"):o.isSaneInsertion(a,l)?/[\]\}\)]/.test(u[d.column])||a.inMultiSelectMode||e&&e.braces?(o.recordAutoInsert(a,l,"}"),{text:"{}",selection:[1,1]}):(o.recordMaybeInsert(a,l,"{"),{text:"{",selection:[1,1]}):void 0;if("}"==c){n(a);var g=u.substring(d.column,d.column+1);if("}"==g&&null!==l.$findOpeningBracket("}",{column:d.column+1,row:d.row})&&o.isAutoInsertedClosing(d,u,c))return o.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==c||"\r\n"==c){n(a);var p="";if(o.isMaybeInsertedClosing(d,u)&&(p=h.stringRepeat("}",s.maybeInsertedBrackets),o.clearMaybeInsertedClosing()),"}"===(g=u.substring(d.column,d.column+1))){var m=l.findMatchingBracket({row:d.row,column:d.column+1},"}");if(!m)return null;var f=this.$getIndent(l.getLine(m.row))}else{if(!p)return void o.clearMaybeInsertedClosing();f=this.$getIndent(u)}return{text:"\n"+(c=f+l.getTabString())+"\n"+f+p,selection:[1,c.length,1,c.length]}}o.clearMaybeInsertedClosing()}})),this.add("braces","deletion",(function(e,t,i,r,o){var a=r.doc.getTextRange(o);if(!o.isMultiLine()&&"{"==a){if(n(i),"}"==r.doc.getLine(o.start.row).substring(o.end.column,o.end.column+1))return o.end.column++,o;s.maybeInsertedBrackets--}})),this.add("parens","insertion",(function(e,t,i,s,a){if("("==a)return n(i),l=i.getSelectionRange(),""!==(c=s.doc.getTextRange(l))&&i.getWrapBehavioursEnabled()?r(l,c,"(",")"):o.isSaneInsertion(i,s)?(o.recordAutoInsert(i,s,")"),{text:"()",selection:[1,1]}):void 0;if(")"==a){n(i);var l=i.getCursorPosition(),c=s.doc.getLine(l.row);if(")"==(i=c.substring(l.column,l.column+1))&&null!==s.$findOpeningBracket(")",{column:l.column+1,row:l.row})&&o.isAutoInsertedClosing(l,c,a))return o.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("parens","deletion",(function(e,t,i,r,o){var s=r.doc.getTextRange(o);if(!o.isMultiLine()&&"("==s&&(n(i),")"==r.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,s,a){if("["==a)return n(i),l=i.getSelectionRange(),""!==(c=s.doc.getTextRange(l))&&i.getWrapBehavioursEnabled()?r(l,c,"[","]"):o.isSaneInsertion(i,s)?(o.recordAutoInsert(i,s,"]"),{text:"[]",selection:[1,1]}):void 0;if("]"==a){n(i);var l=i.getCursorPosition(),c=s.doc.getLine(l.row);if("]"==(i=c.substring(l.column,l.column+1))&&null!==s.$findOpeningBracket("]",{column:l.column+1,row:l.row})&&o.isAutoInsertedClosing(l,c,a))return o.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("brackets","deletion",(function(e,t,i,r,o){var s=r.doc.getTextRange(o);if(!o.isMultiLine()&&"["==s&&(n(i),"]"==r.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,o,s){var a=o.$mode.$quotes||p;if(1==s.length&&a[s]&&(!this.lineCommentStart||-1==this.lineCommentStart.indexOf(s))){n(i);var l=i.getSelectionRange();if(!(""===(c=o.doc.getTextRange(l))||1==c.length&&a[c])&&i.getWrapBehavioursEnabled())return r(l,c,s,s);if(!c){a=i.getCursorPosition();var c=(l=o.doc.getLine(a.row)).substring(a.column-1,a.column),h=(i=l.substring(a.column,a.column+1),o.getTokenAt(a.row,a.column)),d=o.getTokenAt(a.row,a.column+1);if("\\"==c&&h&&/escape/.test(h.type))return null;h=h&&/string|escape/.test(h.type);var u,g=!d||/string|escape/.test(d.type);if(i==s)(u=h!==g)&&/string\.end/.test(d.type)&&(u=!1);else{if(h&&!g)return null;if(h&&g)return null;if((d=o.$mode.tokenRe).lastIndex=0,h=d.test(c),d.lastIndex=0,g=d.test(c),h||g)return null;if(i&&!/[\s;,.})\]\\]/.test(i))return null;if(o=l[a.column-2],c==s&&(o==s||d.test(o)))return null;u=!0}return{text:u?s+s:"",selection:[1,1]}}}})),this.add("string_dquotes","deletion",(function(e,t,i,r,o){var s=r.$mode.$quotes||p,a=r.doc.getTextRange(o);if(!o.isMultiLine()&&s.hasOwnProperty(a)&&(n(i),r.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)==a))return o.end.column++,o}))}var s,a=e("../../lib/oop"),l=e("../behaviour").Behaviour,c=e("../../token_iterator").TokenIterator,h=e("../../lib/lang"),d=["text","paren.rparen","rparen","paren","punctuation.operator"],u=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],g={},p={'"':'"',"'":"'"};o.isSaneInsertion=function(e,t){var i=e.getCursorPosition(),n=new c(t,i.row,i.column);if(!this.$matchTokenType(n.getCurrentToken()||"text",d)){if(/[)}\]]/.test(e.session.getLine(i.row)[i.column]))return!0;if(e=new c(t,i.row,i.column+1),!this.$matchTokenType(e.getCurrentToken()||"text",d))return!1}return n.stepForward(),n.getCurrentTokenRow()!==i.row||this.$matchTokenType(n.getCurrentToken()||"text",u)},o.$matchTokenType=function(e,t){return-1<t.indexOf(e.type||e)},o.recordAutoInsert=function(e,t,i){e=e.getCursorPosition(),t=t.doc.getLine(e.row),this.isAutoInsertedClosing(e,t,s.autoInsertedLineEnd[0])||(s.autoInsertedBrackets=0),s.autoInsertedRow=e.row,s.autoInsertedLineEnd=i+t.substr(e.column),s.autoInsertedBrackets++},o.recordMaybeInsert=function(e,t,i){e=e.getCursorPosition(),t=t.doc.getLine(e.row),this.isMaybeInsertedClosing(e,t)||(s.maybeInsertedBrackets=0),s.maybeInsertedRow=e.row,s.maybeInsertedLineStart=t.substr(0,e.column)+i,s.maybeInsertedLineEnd=t.substr(e.column),s.maybeInsertedBrackets++},o.isAutoInsertedClosing=function(e,t,i){return 0<s.autoInsertedBrackets&&e.row===s.autoInsertedRow&&i===s.autoInsertedLineEnd[0]&&t.substr(e.column)===s.autoInsertedLineEnd},o.isMaybeInsertedClosing=function(e,t){return 0<s.maybeInsertedBrackets&&e.row===s.maybeInsertedRow&&t.substr(e.column)===s.maybeInsertedLineEnd&&t.substr(0,e.column)==s.maybeInsertedLineStart},o.popAutoInsertedClosing=function(){s.autoInsertedLineEnd=s.autoInsertedLineEnd.substr(1),s.autoInsertedBrackets--},o.clearMaybeInsertedClosing=function(){s&&(s.maybeInsertedBrackets=0,s.maybeInsertedRow=-1)},a.inherits(o,l),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],r=0,o=[],s=0;s<n.length;s+=2)o.push(r+=n[s]),n[s+1]&&o.push(45,r+=n[s+1]);t.wordChars=String.fromCharCode.apply(null,o)})),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";function n(){this.HighlightRules=s}var r=e("../config"),o=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 o(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,i,n){var r=t.doc,o=!0,s=!0,a=1/0,l=t.getTabSize(),h=!1;if(this.lineCommentStart){f=Array.isArray(this.lineCommentStart)?(I=this.lineCommentStart.map(c.escapeRegExp).join("|"),this.lineCommentStart[0]):(I=c.escapeRegExp(this.lineCommentStart),this.lineCommentStart),I=new RegExp("^(\\s*)(?:"+I+") ?"),h=t.getUseSoftTabs();var d=function(e,t){var i,n,o=e.match(I);o&&(i=o[1].length,n=o[0].length,m(e,i,n)||" "!=o[0][n-1]||n--,r.removeInLine(t,i,n))},u=f+" ",g=function(e,t){o&&!/\S/.test(e)||(m(e,a,a)?r.insertInLine({row:t,column:a},u):r.insertInLine({row:t,column:a},f))},p=function(e,t){return I.test(e)},m=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 2<l?n%l!=l-1:n%l==0}}else{if(!this.blockComment)return!1;var f=this.blockComment.start,C=this.blockComment.end,I=new RegExp("^(\\s*)(?:"+c.escapeRegExp(f)+")"),v=new RegExp("(?:"+c.escapeRegExp(C)+")\\s*$");g=function(e,t){p(e,t)||o&&!/\S/.test(e)||(r.insertInLine({row:t,column:e.length},C),r.insertInLine({row:t,column:a},f))},d=function(e,t){var i;(i=e.match(v))&&r.removeInLine(t,e.length-i[0].length,e.length),(i=e.match(I))&&r.removeInLine(t,i[1].length,i[0].length)},p=function(e,i){if(I.test(e))return!0;for(var n=t.getTokens(i),r=0;r<n.length;r++)if("comment"===n[r].type)return!0}}function A(e){for(var t=i;t<=n;t++)e(r.getLine(t),t)}var b=1/0;A((function(e,t){var i=e.search(/\S/);-1!==i?(i<a&&(a=i),s&&!p(e,t)&&(s=!1)):b>e.length&&(b=e.length)})),a==1/0&&(a=b,s=o=!1),h&&a%l!=0&&(a=Math.floor(a/l)*l),A(s?d:g)},this.toggleBlockComment=function(e,t,i,n){var r=this.blockComment;if(r){!r.start&&r[0]&&(r=r[0]);var o,s,a=(p=new h(t,n.row,n.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(;a&&/comment/.test(a.type);){if(-1!=(m=a.value.indexOf(r.start))){var c=p.getCurrentTokenRow(),u=p.getCurrentTokenColumn()+m,g=new d(c,u,c,u+r.start.length);break}a=p.stepBackward()}var p,m;for(a=(p=new h(t,n.row,n.column)).getCurrentToken();a&&/comment/.test(a.type);){if(-1!=(m=a.value.indexOf(r.end))){c=p.getCurrentTokenRow(),u=p.getCurrentTokenColumn()+m;var f=new d(c,u,c,u+r.end.length);break}a=p.stepForward()}f&&t.remove(f),g&&(t.remove(g),o=g.start.row,s=-r.start.length)}else s=r.start.length,o=i.start.row,t.insert(i.end,r.end),t.insert(i.start,r.start);l.start.row==o&&(l.start.column+=s),l.end.row==o&&(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){var i,n,o;e[t]&&(n=(i=e[t]).prototype.$id,(o=r.$modes[n])||(r.$modes[n]=o=new i),r.$modes[t]||(r.$modes[t]=o),this.$embeds.push(t),this.$modes[t]=o)}var s=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;t<s.length;t++)!function(e){var i=s[t],n=e[i];e[s[t]]=function(){return this.$delegator(i,arguments,n)}}(this)},this.$delegator=function(e,t,i){var n=t[0]||"start";if("string"!=typeof n){if(Array.isArray(n[2])){var r=n[2][n[2].length-1];if(s=this.$modes[r])return s[e].apply(s,[n[1]].concat([].slice.call(t,1)))}n=n[0]||"start"}for(var o=0;o<this.$embeds.length;o++)if(this.$modes[this.$embeds[o]]){var s,a=n.split(this.$embeds[o]);if(!a[0]&&a[1])return t[0]=a[1],(s=this.$modes[this.$embeds[o]])[e].apply(s,t)}return r=i.apply(this,t),i?r:void 0},this.transformAction=function(e,t,i,n,r){if(this.$behaviour){var o,s=this.$behaviour.getBehaviours();for(o in s)if(s[o][t]){var a=s[o][t].apply(this,arguments);if(a)return a}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,i=[];for(s in t)for(var n=t[s],r=0,o=n.length;r<o;r++)if("string"==typeof n[r].token)/keyword|support|storage/.test(n[r].token)&&i.push(n[r].regex);else if("object"==typeof n[r].token)for(var s,a=0,l=n[r].token.length;a<l;a++)/keyword|support|storage/.test(n[r].token[a])&&(s=n[r].regex.match(/\(.+?\)/g)[a],i.push(s.substr(1,s.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.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,r=t.start.column,o=e[n]||"";switch(t.action){case"insert":1===t.lines.length?e[n]=o.substring(0,r)+t.lines[0]+o.substring(r):(s=[n,1].concat(t.lines),e.splice.apply(e,s),e[n]=o.substring(0,r)+e[n],e[n+t.lines.length-1]+=o.substring(r));break;case"remove":var s=t.end.column,a=t.end.row;n===a?e[n]=o.substring(0,r)+o.substring(s):e.splice(n,a-n+1,o.substring(0,r)+e[a].substring(s))}}})),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"),r=e("./lib/event_emitter").EventEmitter;e=t.Anchor=function(e,t,i){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===i?this.setPosition(t.row,t.column):this.setPosition(t,i)};(function(){function e(e,t,i){return i=i?e.column<=t.column:e.column<t.column,e.row<t.row||e.row==t.row&&i}n.implement(this,r),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(t){t.start.row==t.end.row&&t.start.row!=this.row||t.start.row>this.row||(t=function(t,i,n){var r=((a="insert"==t.action)?1:-1)*(t.end.row-t.start.row),o=(a?1:-1)*(t.end.column-t.start.column),s=t.start,a=a?s:t.end;return e(i,s,n)?{row:i.row,column:i.column}:e(a,i,!n)?{row:i.row+r,column:i.column+(i.row==a.row?o:0)}:{row:s.row,column:s.column}}(t,{row:this.row,column:this.column},this.$insertRight),this.setPosition(t.row,t.column,!0))},this.setPosition=function(e,t,i){i=i?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row==i.row&&this.column==i.column||(e={row:this.row,column:this.column},this.row=i.row,this.column=i.column,this._signal("change",{old:e,value:i}))},this.detach=function(){this.document.off("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$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}}).call(e.prototype)})),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";function n(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)}var r=e("./lib/oop"),o=e("./apply_delta").applyDelta,s=e("./lib/event_emitter").EventEmitter,a=e("./range").Range,l=e("./anchor").Anchor;(function(){r.implement(this,s),this.setValue=function(e){var t=this.getLength()-1;this.remove(new a(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new l(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){e=e.match(/^.*?(\r\n|\r|\n)/m),this.$autoNewLine=e?e[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t,i;return e.start.row===e.end.row?t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)]:((t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column),i=t.length-1,e.end.row-e.start.row==i&&(t[i]=t[i].substring(0,e.end.column))),t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var i=this.clippedPos(e.row,e.column);e=this.pos(e.row,e.column+t.length);return this.applyDelta({start:i,end:e,action:"insert",lines:[t]},!0),this.clonePos(e)},this.clippedPos=function(e,t){var i=this.getLength();void 0===e?e=i:e<0?e=0:i<=e&&(e=i-1,t=void 0),i=this.getLine(e);return null==t&&(t=i.length),{row:e,column:t=Math.min(Math.max(t,0),i.length)}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$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},this.insertFullLines=function(e,t){var i=(e=Math.min(Math.max(e,0),this.getLength()))<this.getLength()?(t=t.concat([""]),0):(t=[""].concat(t),this.$lines[--e].length);this.insertMergedLines({row:e,column:i},t)},this.insertMergedLines=function(e,t){var i={row:(e=this.clippedPos(e.row,e.column)).row+t.length-1,column:(1==t.length?e.column:0)+t[t.length-1].length};return this.applyDelta({start:e,end:i,action:"insert",lines:t}),this.clonePos(i)},this.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column);e=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:e,action:"remove",lines:this.getLinesForRange({start:t,end:e})}),this.clonePos(t)},this.removeInLine=function(e,t,i){return t=this.clippedPos(e,t),e=this.clippedPos(e,i),this.applyDelta({start:t,end:e,action:"remove",lines:this.getLinesForRange({start:t,end:e})},!0),this.clonePos(t)},this.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&&0<e,n=t<this.getLength()-1,r=i?e-1:e,o=(i=i?this.getLine(r).length:0,n?t+1:t);n=n?0:this.getLine(o).length,r=new a(r,i,o,n),i=this.$lines.slice(e,t+1);return this.applyDelta({start:r.start,end:r.end,action:"remove",lines:this.getLinesForRange(r)}),i},this.removeNewLine=function(e){e<this.getLength()-1&&0<=e&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){return e instanceof a||(e=a.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)},this.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},this.revertDeltas=function(e){for(var t=e.length-1;0<=t;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var i="insert"==e.action;(i?e.lines.length<=1&&!e.lines[0]:!a.comparePoints(e.start,e.end))||(i&&2e4<e.lines.length?this.$splitAndapplyLargeDelta(e,2e4):(o(this.$lines,e,t),this._signal("change",e)))},this.$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)},this.$splitAndapplyLargeDelta=function(e,t){for(var i=e.lines,n=i.length-t+1,r=e.start.row,o=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(r+s,o),end:this.pos(r+a,o=0),action:e.action,lines:l},!0)}e.lines=i.slice(s),e.start.row=r+s,e.start.column=o,this.applyDelta(e,!0)},this.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()})},this.indexToPosition=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,r=t||0,o=i.length;r<o;r++)if((e-=i[r].length+n)<0)return{row:r,column:e+i[r].length+n};return{row:o-1,column:e+i[o-1].length+n}},this.positionToIndex=function(e,t){for(var i=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,r=0,o=Math.min(e.row,i.length),s=t||0;s<o;++s)r+=i[s].length+n;return r+e.column}}).call(n.prototype),t.Document=n})),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,i){"use strict";function n(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,r=i.doc,o=t;i.lines[t];)t++;var s=r.getLength(),a=0;for(i.running=!1;t<s;){for(i.$tokenizeRow(t),n=t;t++,i.lines[t];);if(++a%5==0&&20<new Date-e){i.running=setTimeout(i.$worker,20);break}}i.currentLine=t,o<=(n=-1==n?t:n)&&i.fireUpdateEvent(o,n)}}}var r=e("./lib/oop"),o=e("./lib/event_emitter").EventEmitter;(function(){r.implement(this,o),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){this._signal("update",{data:{first:e,last:t}})},this.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)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,i=e.end.row-t;0==i?this.lines[t]=null:"remove"==e.action?(this.lines.splice(t,1+i,null),this.states.splice(t,1+i,null)):((e=Array(1+i)).unshift(t,1),this.lines.splice.apply(this.lines,e),this.states.splice.apply(this.states,e)),this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),i=this.states[e-1];t=this.tokenizer.getLineTokens(t,i,e);return this.states[e]+""!=t.state+""?(this.states[e]=t.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=t.tokens}}).call(n.prototype),t.BackgroundTokenizer=n})),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,i){"use strict";function n(e,t,i){this.setRegexp(e),this.clazz=t,this.type=i||"text"}var r=e("./lib/lang"),o=(e("./lib/oop"),e("./range").Range);(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,i,n){if(this.regExp)for(var s=n.firstRow,a=n.lastRow,l=s;l<=a;l++){var c=this.cache[l];null==c&&(c=(c=(c=r.getMatchOffsets(i.getLine(l),this.regExp)).length>this.MAX_RANGES?c.slice(0,this.MAX_RANGES):c).map((function(e){return new o(l,e.offset,l,e.offset+e.length)})),this.cache[l]=c.length?c:"");for(var h=c.length;h--;)t.drawSingleLineMarker(e,c[h].toScreenRange(i),this.clazz,n)}}}).call(n.prototype),t.SearchHighlight=n})),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],(function(e,t,i){"use strict";var n=e("../range").Range;function r(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t],e=t[t.length-1],this.range=new n(t[0].start.row,t[0].start.column,e.end.row,e.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach((function(e){e.setFoldLine(this)}),this)}(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach((function(t){t.start.row+=e,t.end.row+=e}))},this.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)})),0<this.range.compareEnd(e.start.row,e.start.column)?(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},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,i){var n,r,o=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==(r=(n=s[l]).range.compareStart(t,i)))return void e(null,t,i,o,a);if(!e(null,n.start.row,n.start.column,o,a)&&e(n.placeholder,n.start.row,n.start.column,o)||0===r)return;a=!n.sameRow,o=n.end.column}e(null,t,i,o,a)},this.getNextFoldTo=function(e,t){for(var i,n,r=0;r<this.folds.length;r++){if(-1==(n=(i=this.folds[r]).range.compareEnd(e,t)))return{fold:i,kind:"after"};if(0===n)return{fold:i,kind:"inside"}}return null},this.addRemoveChars=function(e,t,i){var n,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 o,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}},this.split=function(e,t){if(!(e=this.getNextFoldTo(e,t))||"inside"==e.kind)return null;t=e.fold,e=this.folds;var i=this.foldData,n=(t=e.indexOf(t),e[t-1]);this.end.row=n.end.row,this.end.column=n.end.column,n=new r(i,e=e.splice(t,e.length-t));return i.splice(i.indexOf(this)+1,0,n),n},this.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)},this.toString=function(){var e=[this.range.toString()+": ["];return this.folds.forEach((function(t){e.push("  "+t.toString())})),e.push("]"),e.join("\n")},this.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}}}).call(r.prototype),t.FoldLine=r})),ace.define("ace/range_list",["require","exports","module","ace/range"],(function(e,t,i){"use strict";function n(){this.ranges=[],this.$bias=1}var r=e("./range").Range.comparePoints;(function(){this.comparePoints=r,this.pointIndex=function(e,t,i){for(var n=this.ranges,o=i||0;o<n.length;o++){var s=n[o],a=r(e,s.end);if(!(0<a))return s=r(e,s.start),0===a?t&&0!==s?-o-2:o:0<s||0===s&&!t?o:-o-1}return-o-1},this.add=function(e){var t=!e.isEmpty(),i=this.pointIndex(e.start,t);return(t=this.pointIndex(e.end,t,i=i<0?-i-1:i))<0?t=-t-1:t++,this.ranges.splice(i,t-i,e)},this.addList=function(e){for(var t=[],i=e.length;i--;)t.push.apply(t,this.add(e[i]));return t},this.substractPoint=function(e){if(0<=(e=this.pointIndex(e)))return this.ranges.splice(e,1)},this.merge=function(){for(var e=[],t=this.ranges,i=(t=t.sort((function(e,t){return r(e.start,t.start)})))[0],n=1;n<t.length;n++){var o=i,s=(i=t[n],r(o.end,i.start));s<0||(0!=s||o.isEmpty()||i.isEmpty())&&(r(o.end,i.end)<0&&(o.end.row=i.end.row,o.end.column=i.end.column),t.splice(n,1),e.push(i),i=o,n--)}return this.ranges=t,e},this.contains=function(e,t){return 0<=this.pointIndex({row:e,column:t})},this.containsPoint=function(e){return 0<=this.pointIndex(e)},this.rangeAtPoint=function(e){if(0<=(e=this.pointIndex(e)))return this.ranges[e]},this.clipRows=function(e,t){var i=this.ranges;if(i[0].start.row>t||i[i.length-1].start.row<e)return[];e=this.pointIndex({row:e,column:0});for(var n=this.pointIndex({row:t,column:0},e=e<0?-e-1:e),r=(n<0&&(n=-n-1),[]),o=e;o<n;o++)r.push(i[o]);return r},this.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},this.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},this.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},this.$onChange=function(e){for(var t=e.start,i=e.end,n=t.row,r=i.row,o=this.ranges,s=0,a=o.length;s<a&&!((h=o[s]).end.row>=n);s++);if("insert"==e.action)for(var l=r-n,c=-t.column+i.column;s<a&&!((h=o[s]).start.row>n);s++)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&&(h.end.column==t.column&&this.$bias<0||(h.end.column==t.column&&0<c&&s<a-1&&h.end.column>h.start.column&&h.end.column==o[s+1].start.column&&(h.end.column-=c),h.end.column+=c,h.end.row+=l));else{var h;for(l=n-r,c=t.column-i.column;s<a&&!((h=o[s]).start.row>r);s++)h.end.row<r&&(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==r?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>r&&(h.end.row+=l),h.start.row<r&&(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==r?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>r&&(h.start.row+=l)}if(0!=l&&s<a)for(;s<a;s++)(h=o[s]).start.row+=l,h.end.row+=l}}).call(n.prototype),t.RangeList=n})),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list","ace/lib/oop"],(function(e,t,i){"use strict";var n=e("../range_list").RangeList,r=(e=e("../lib/oop"),t.Fold=function(e,t){this.foldLine=null,this.placeholder=t,this.range=e,this.start=e.start,this.end=e.end,this.sameRow=e.start.row==e.end.row,this.subFolds=this.ranges=[]});function o(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function s(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}e.inherits(r,n),function(){this.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},this.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach((function(t){t.setFoldLine(e)}))},this.clone=function(){var e=this.range.clone(),t=new r(e,this.placeholder);return this.subFolds.forEach((function(e){t.subFolds.push(e.clone())})),t.collapseChildren=this.collapseChildren,t},this.addSubFold=function(e){if(!this.range.isEqual(e)){s=e,a=this.start,o(s.start,a),o(s.end,a);for(var t=e.start.row,i=e.start.column,n=0,r=-1;n<this.subFolds.length&&1==(r=this.subFolds[n].range.compare(t,i));n++);var s=this.subFolds[n],a=0;if(0==r){if(s.range.containsRange(e))return s.addSubFold(e);a=1}t=e.range.end.row,i=e.range.end.column;var l=n;for(r=-1;l<this.subFolds.length&&1==(r=this.subFolds[l].range.compare(t,i));l++);0==r&&l++;for(var c=this.subFolds.splice(n,l-n,e),h=0==r?c.length-1:c.length,d=a;d<h;d++)e.addSubFold(c[d]);return e.setFoldLine(this.foldLine),e}},this.restoreRange=function(e){return e=e,t=this.start,s(e.start,t),void s(e.end,t);var t}}.call(r.prototype)})),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],(function(e,t,i){"use strict";var n=e("../range").Range,r=e("./fold_line").FoldLine,o=e("./fold").Fold,s=e("../token_iterator").TokenIterator;t.Folding=function(){this.getFoldAt=function(e,t,i){var n=this.getFoldLine(e);if(!n)return null;for(var r=n.folds,o=0;o<r.length;o++){var s=r[o].range;if(s.contains(e,t)&&(1!=i||!s.isEnd(e,t)||s.isEmpty())&&(-1!=i||!s.isStart(e,t)||s.isEmpty()))return r[o]}},this.getFoldsInRange=function(e){var t=e.start,i=e.end,n=this.$foldData,r=[];t.column+=1,--i.column;for(var o=0;o<n.length;o++){var s=n[o].range.compareRange(e);if(2!=s){if(-2==s)break;for(var a=n[o].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;r.push(c)}}}}return--t.column,i.column+=1,r},this.getFoldsInRangeList=function(e){var t;return Array.isArray(e)?(t=[],e.forEach((function(e){t=t.concat(this.getFoldsInRange(e))}),this)):t=this.getFoldsInRange(e),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 r,o={end:{column:0}},s=0;s<n.folds.length;s++){var a,l=(a=n.folds[s]).range.compareEnd(e,t);if(-1==l){r=this.getLine(a.start.row).substring(o.end.column,a.start.column);break}if(0===l)return null;o=a}return r=r||this.getLine(a.start.row).substring(o.end.column),-1==i?r.substring(0,t-o.end.column):1==i?r.substring(t-o.end.column):r},this.getFoldLine=function(e,t){var i=this.$foldData,n=0;for(-1==(n=t?i.indexOf(t):n)&&(n=0);n<i.length;n++){var r=i[n];if(r.start.row<=e&&r.end.row>=e)return r;if(r.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var i=this.$foldData,n=0;for(-1==(n=t?i.indexOf(t):n)&&(n=0);n<i.length;n++){var r=i[n];if(r.end.row>=e)return r}return null},this.getFoldedRowCount=function(e,t){for(var i=this.$foldData,n=t-e+1,r=0;r<i.length;r++){var o=(s=i[r]).end.row,s=s.start.row;if(t<=o){s<t&&(e<=s?n-=t-s:n=0);break}e<=o&&(n-=e<=s?o-s:o-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,a=(e instanceof o?i=e:(i=new o(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(i.range),i.start.row),l=(e=i.start.column,i.end.row),c=(t=i.end.column,this.getFoldAt(a,e,1)),h=this.getFoldAt(l,t,-1);if(c&&h==c)return c.addSubFold(i);c&&!c.range.isStart(a,e)&&this.removeFold(c),h&&!h.range.isEnd(l,t)&&this.removeFold(h),0<(e=this.getFoldsInRange(i.range)).length&&(this.removeFolds(e),i.collapseChildren||e.forEach((function(e){i.addSubFold(e)})));for(var d=0;d<n.length;d++){var u=n[d];if(l==u.start.row){u.addFold(i),s=!0;break}if(a==u.end.row){if(u.addFold(i),s=!0,!i.sameRow){var g=n[d+1];if(g&&g.start.row==l){u.merge(g);break}}break}if(l<=u.start.row)break}return s||(u=this.$addFoldLine(new r(this.$foldData,i))),this.$useWrapMode?this.$updateWrapData(u.start.row,u.start.row):this.$updateRowLengthCache(u.start.row,u.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,r=this.$foldData,o=t.folds;1==o.length?r.splice(r.indexOf(t),1):t.range.isEnd(e.end.row,e.end.column)?(o.pop(),t.end.row=o[o.length-1].end.row,t.end.column=o[o.length-1].end.column):t.range.isStart(e.start.row,e.start.column)?(o.shift(),t.start.row=o[0].start.row,t.start.column=o[0].start.column):e.sameRow?o.splice(o.indexOf(e),1):((o=(r=t.split(e.start.row,e.start.column)).folds).shift(),r.start.row=o[0].start.row,r.start.column=o[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),0<e.collapseChildren&&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;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 r=[],e.forEach((function(e){r=r.concat(this.unfold(e))}),this),r;i=e}var r;for(e=r=this.getFoldsInRangeList(i);1==r.length&&n.comparePoints(r[0].start,i.start)<0&&0<n.comparePoints(r[0].end,i.end);)this.expandFolds(r),r=this.getFoldsInRangeList(i);if(0!=t?this.removeFolds(r):this.expandFolds(r),e.length)return e},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){return(t=this.getFoldLine(e,t))?t.end.row:e},this.getRowFoldStart=function(e,t){return(t=this.getFoldLine(e,t))?t.start.row:e},this.getFoldDisplayLine=function(e,t,i,n,r){null==n&&(n=e.start.row),null==r&&(r=0),null==t&&(t=e.end.row),null==i&&(i=this.getLine(t).length);var o=this.doc,s="";return e.walk((function(e,t,i,a){if(!(t<n)){if(t==n){if(i<r)return;a=Math.max(r,a)}s+=null!=e?e:o.getLine(t).substring(a,i)}}),t,i),s},this.getDisplayLine=function(e,t,i,n){var r=this.getFoldLine(e);return r?this.getFoldDisplayLine(r,e,t,i,n):(r=this.doc.getLine(e)).substring(n||0,t||r.length)},this.$cloneFoldData=function(){var e=[];return e=this.$foldData.map((function(t){return t=t.folds.map((function(e){return e.clone()})),new r(e,t)}))},this.toggleFold=function(e){var t=this.selection.getRange();if(t.isEmpty()){var i,n=t.start;if(i=this.getFoldAt(n.row,n.column))return void this.expandFold(i);(r=this.findMatchingBracket(n))?1==t.comparePoint(r)?t.end=r:(t.start=r,t.start.column++,t.end.column--):(r=this.findMatchingBracket({row:n.row,column:n.column+1}))?(1==t.comparePoint(r)?t.end=r:t.start=r,t.start.column++):t=this.getCommentFoldRange(n.row,n.column)||t}else{var r=this.getFoldsInRange(t);if(e&&r.length)return void this.expandFolds(r);1==r.length&&(i=r[0])}if((i=i||this.getFoldAt(t.start.row,t.start.column))&&i.range.toString()==t.toString())this.expandFold(i);else{if(n="...",!t.isMultiLine()){if((n=this.getTextRange(t)).length<4)return;n=n.trim().substring(0,2)+".."}this.addFold(n,t)}},this.getCommentFoldRange=function(e,t,i){var r=new s(this,e,t),o=r.getCurrentToken(),a=o&&o.type;if(o&&/^comment|string/.test(a)){"comment"==(a=a.match(/comment|string/)[0])&&(a+="|doc-start");var l=new RegExp(a);a=new n;if(1!=i){for(;(o=r.stepBackward())&&l.test(o.type););r.stepForward()}if(a.start.row=r.getCurrentTokenRow(),a.start.column=r.getCurrentTokenColumn()+2,r=new s(this,e,t),-1!=i){var c=-1;do{if(o=r.stepForward(),-1==c){var h=this.getState(r.$row);l.test(h)||(c=r.$row)}else if(r.$row>c)break}while(o&&l.test(o.type));o=r.stepBackward()}else o=r.getCurrentToken();return a.end.row=r.getCurrentTokenRow(),a.end.column=r.getCurrentTokenColumn()+o.value.length-2,a}},this.foldAll=function(e,t,i,n){null==i&&(i=1e5);var r=this.foldWidgets;if(r){t=t||this.getLength();for(var o,s=e=e||0;s<t;s++)null==r[s]&&(r[s]=this.getFoldWidget(s)),"start"!=r[s]||n&&!n(s)||(o=this.getFoldWidgetRange(s))&&o.isMultiLine()&&o.end.row<=t&&o.start.row>=e&&(s=o.end.row,o.collapseChildren=i,this.addFold("...",o))}},this.foldToLevel=function(e){for(this.foldAll();0<e--;)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 r=i[n];if("text"!=r.type||!/^\s+$/.test(r.value))return!!/comment/.test(r.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(", ")+"]");this.$foldStyle!=e&&("manual"==(this.$foldStyle=e)&&this.unfold(),e=this.$foldMode,this.$setFolding(null),this.$setFolding(e))},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=e-1;0<=n;){var r=i[n];if("start"==(r=null==r?i[n]=this.getFoldWidget(n):r)){var o=this.getFoldWidgetRange(n),s=s||o;if(o&&o.end.row>=e)break}n--}return{range:-1!==n&&o,firstRange:s}},this.onFoldWidgetClick=function(e,t){var i={children:(t=t.domEvent).shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};this.$toggleFoldWidget(e,i)||(e=t.target||t.srcElement)&&/ace_fold-widget/.test(e.className)&&(e.className+=" ace_invalid")},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var i,n,r=this.getFoldWidget(e),o=this.getLine(e);r="end"===r?-1:1;return(o=this.getFoldAt(e,-1==r?0:o.length,r))?(t.children||t.all?this.removeFold(o):this.expandFold(o),o):(r=this.getFoldWidgetRange(e,!0))&&!r.isMultiLine()&&(o=this.getFoldAt(r.start.row,r.start.column,1))&&r.isEqual(o.range)?(this.removeFold(o),o):(t.siblings?((o=this.getParentFoldRangeData(e)).range&&(i=o.range.start.row+1,n=o.range.end.row),this.foldAll(i,n,t.all?1e4:0)):t.children?(n=r?r.end.row:this.getLength(),this.foldAll(e+1,n,t.all?1e4:0)):r&&(t.all&&(r.collapseChildren=1e4),this.addFold("...",r)),r)}},this.toggleFoldWidget=function(e){var t,i=this.selection.getCursor().row;i=this.getRowFoldStart(i),this.$toggleFoldWidget(i,{})||(t=(t=this.getParentFoldRangeData(i,!0)).range||t.firstRange)&&(i=t.start.row,(i=this.getFoldAt(i,this.getLine(i).length,1))?this.removeFold(i):this.addFold("...",t))},this.updateFoldWidgets=function(e){var t=e.start.row,i=e.end.row-t;0==i?this.foldWidgets[t]=null:"remove"==e.action?this.foldWidgets.splice(t,1+i,null):((e=Array(1+i)).unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,e))},this.tokenizerUpdateFoldWidgets=function(e){(e=e.data).first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.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,r=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){return 0==e.column||""==(t=t||this.getLine(e.row).charAt(e.column-1))?null:(t=t.match(/([\(\[\{])|([\)\]\}])/))?t[1]?this.$findClosingBracket(t[1],e):this.$findOpeningBracket(t[2],e):null},this.getBracketRange=function(e){var t,i,n=this.getLine(e.row),o=!0,s=n.charAt(e.column-1),a=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(a||(s=n.charAt(e.column),e={row:e.row,column:e.column+1},a=s&&s.match(/([\(\[\{])|([\)\]\}])/),o=!1),!a)return null;if(a[1]){if(!(i=this.$findClosingBracket(a[1],e)))return null;t=r.fromPoints(e,i),o||(t.end.column++,t.start.column--),t.cursor=t.end}else{if(!(i=this.$findOpeningBracket(a[2],e)))return null;t=r.fromPoints(i,e),o||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.getMatchingBracketRanges=function(e){var t=this.getLine(e.row),i=t.charAt(e.column-1),n=i&&i.match(/([\(\[\{])|([\)\]\}])/);return n||(i=t.charAt(e.column),e={row:e.row,column:e.column+1},n=i&&i.match(/([\(\[\{])|([\)\]\}])/)),n?(t=new r(e.row,e.column-1,e.row,e.column),(i=n[1]?this.$findClosingBracket(n[1],e):this.$findOpeningBracket(n[2],e))?[t,new r(i.row,i.column,i.row,i.column+1)]:[t]):null},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,i){var r=this.$brackets[e],o=1,s=new n(this,t.row,t.column),a=s.getCurrentToken();if(a=a||s.stepForward()){i=i||new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+");for(var l=t.column-s.getCurrentTokenColumn()-2,c=a.value;;){for(;0<=l;){var h=c.charAt(l);if(h==r){if(0==--o)return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else h==e&&(o+=1);--l}for(;(a=s.stepBackward())&&!i.test(a.type););if(null==a)break;l=(c=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,i){var r=this.$brackets[e],o=1,s=new n(this,t.row,t.column),a=s.getCurrentToken();if(a=a||s.stepForward()){i=i||new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+");for(var l=t.column-s.getCurrentTokenColumn();;){for(var c=a.value,h=c.length;l<h;){var d=c.charAt(l);if(d==r){if(0==--o)return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else d==e&&(o+=1);l+=1}for(;(a=s.stepForward())&&!i.test(a.type););if(null==a)break;l=0}return null}}}})),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/edit_session/folding","ace/edit_session/bracket_match"],(function(e,t,i){"use strict";function n(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++n.$uid,this.$foldData.toString=function(){return this.join("\n")},this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof e&&e.getLine||(e=new u(e)),this.setDocument(e),this.selection=new c(this),this.$bidiHandler=new s(this),a.resetOptions(this),this.setMode(t),a._signal("session",this)}var r=e("./lib/oop"),o=e("./lib/lang"),s=e("./bidihandler").BidiHandler,a=e("./config"),l=e("./lib/event_emitter").EventEmitter,c=e("./selection").Selection,h=e("./mode/text").Mode,d=e("./range").Range,u=e("./document").Document,g=e("./background_tokenizer").BackgroundTokenizer,p=e("./search_highlight").SearchHighlight;n.$uid=0,function(){r.implement(this,l),this.setDocument=function(e){this.doc&&this.doc.off("change",this.$onChange),(this.doc=e).on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e)return this.$docRowCache=[],void(this.$screenRowCache=[]);var t=this.$docRowCache.length;(e=this.$getRowCacheIndex(this.$docRowCache,e)+1)<t&&(this.$docRowCache.splice(e,t),this.$screenRowCache.splice(e,t))},this.$getRowCacheIndex=function(e,t){for(var i=0,n=e.length-1;i<=n;){var r=i+n>>1,o=e[r];if(o<t)i=1+r;else{if(!(t<o))return r;n=r-1}}return i-1},this.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.bgTokenizer&&this.bgTokenizer.start(0)},this.onChangeFold=function(e){e=e.data,this.$resetRowCache(e.start.row)},this.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&&this.bgTokenizer.$updateOnChange(e),this._signal("change",e)},this.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(e){return this.bgTokenizer.getState(e)},this.getTokens=function(e){return this.bgTokenizer.getTokens(e)},this.getTokenAt=function(e,t){var i=this.bgTokenizer.getTokens(e),n=0;if(null==t){var r=i.length-1;n=this.getLine(e).length}else for(r=0;r<i.length&&!(t<=(n+=i[r].value.length));r++);return(e=i[r])?(e.index=r,e.start=n-e.value.length,e):null},this.setUndoManager=function(e){var t;this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e?(e.addSession(t=this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=o.delayedCall(this.$syncInformUndoManager)):this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?o.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++)this.$breakpoints[e[t]]="ace_breakpoint";this._signal("changeBreakpoint",{})},this.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},this.setBreakpoint=function(e,t){(t=void 0===t?"ace_breakpoint":t)?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.clearBreakpoint=function(e){delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.addMarker=function(e,t,i,n){var r=this.$markerId++;e={range:e,type:i||"line",renderer:"function"==typeof i?i:null,clazz:t,inFront:!!n,id:r};return n?(this.$frontMarkers[r]=e,this._signal("changeFrontMarker")):(this.$backMarkers[r]=e,this._signal("changeBackMarker")),r},this.addDynamicMarker=function(e,t){var i;if(e.update)return i=this.$markerId++,e.id=i,e.inFront=!!t,t?(this.$frontMarkers[i]=e,this._signal("changeFrontMarker")):(this.$backMarkers[i]=e,this._signal("changeBackMarker")),e},this.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"))},this.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},this.highlight=function(e){var t;this.$searchHighlight||(t=new p(null,"ace_selected-word","text"),this.$searchHighlight=this.addDynamicMarker(t)),this.$searchHighlight.setRegexp(e)},this.highlightLines=function(e,t,i,n){return"number"!=typeof t&&(i=t,t=e),i=i||"ace_step",(e=new d(e,0,t,1/0)).id=this.addMarker(e,i,"fullLine",n),e},this.setAnnotations=function(e){this.$annotations=e,this._signal("changeAnnotation",{})},this.getAnnotations=function(){return this.$annotations||[]},this.clearAnnotations=function(){this.setAnnotations([])},this.$detectNewLine=function(e){e=e.match(/^.*?(\r?\n)/m),this.$autoNewLine=e?e[1]:"\n"},this.getWordRange=function(e,t){var i,n=this.getLine(e),r=!1,o=(i=(r=(r=0<t?!!n.charAt(t-1).match(this.tokenRe):r)||!!n.charAt(t).match(this.tokenRe))?this.tokenRe:/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe,t);if(0<o){for(;0<=--o&&n.charAt(o).match(i););o++}for(var s=t;s<n.length&&n.charAt(s).match(i);)s++;return new d(e,o,e,s)},this.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},this.setNewLineMode=function(e){this.doc.setNewLineMode(e)},this.getNewLineMode=function(){return this.doc.getNewLineMode()},this.setUseWorker=function(e){this.setOption("useWorker",e)},this.getUseWorker=function(){return this.$useWorker},this.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._signal("tokenizerUpdate",e)},this.$modes=a.$modes,this.$mode=null,this.$modeId=null,this.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 h),this.$modes[n]&&!i)return this.$onChangeMode(this.$modes[n]),void(t&&t());this.$modeId=n,a.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).$id=n),this.$onChangeMode(e)),t&&t()}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},this.$onChangeMode=function(e,t){var i,n,r,o;t||(this.$modeId=e.$id),this.$mode!==e&&(i=this.$mode,this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker(),void 0!==(n=e.getTokenizer()).on&&(r=this.onReloadTokenizer.bind(this),n.on("update",r)),this.bgTokenizer?this.bgTokenizer.setTokenizer(n):(this.bgTokenizer=new g(n),(o=this).bgTokenizer.on("update",(function(e){o._signal("tokenizerUpdate",e)}))),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})))},this.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},this.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){a.warn("Could not load worker",e),this.$worker=null}},this.getMode=function(){return this.$mode},this.$scrollTop=0,this.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal("changeScrollTop",e))},this.getScrollTop=function(){return this.$scrollTop},this.$scrollLeft=0,this.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal("changeScrollLeft",e))},this.getScrollLeft=function(){return this.$scrollLeft},this.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},this.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},this.$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,r=0,o=this.$foldData[r],s=o?o.start.row:1/0,a=t.length,l=0;l<a;l++){if(s<l){if(a<=(l=o.end.row+1))break;s=(o=this.$foldData[r++])?o.start.row:1/0}null==i[l]&&(i[l]=this.$getStringScreenWidth(t[l])[0]),i[l]>n&&(n=i[l])}this.screenWidth=n}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.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}},this.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}},this.setUndoSelect=function(e){this.$undoSelect=e},this.$getUndoSelection=function(e,t){function i(e){return t?"insert"!==e.action:"insert"===e.action}for(var n,r,o=0;o<e.length;o++){var s=e[o];s.start&&(n?i(s)?(r=s.start,-1==n.compare(r.row,r.column)&&n.setStart(r),r=s.end,1==n.compare(r.row,r.column)&&n.setEnd(r)):(r=s.start,-1==n.compare(r.row,r.column)&&(n=d.fromPoints(s.start,s.start))):n=i(s)?d.fromPoints(s.start,s.end):d.fromPoints(s.start,s.start))}return n},this.replace=function(e,t){return this.doc.replace(e,t)},this.moveText=function(e,t,i){var n,r,o,s=this.getTextRange(e),a=this.getFoldsInRange(e);t=d.fromPoints(t,t);return i||(this.remove(e),r=e.start.row-e.end.row,(o=r?-e.end.column:e.start.column-e.end.column)&&(t.start.row==e.end.row&&t.start.column>e.end.column&&(t.start.column+=o),t.end.row==e.end.row&&t.end.column>e.end.column&&(t.end.column+=o)),r&&t.start.row>=e.end.row&&(t.start.row+=r,t.end.row+=r)),t.end=this.insert(t.start,s),a.length&&(n=e.start,i=t.start,r=i.row-n.row,o=i.column-n.column,this.addFolds(a.map((function(e){return(e=e.clone()).start.row==n.row&&(e.start.column+=o),e.end.row==n.row&&(e.end.column+=o),e.start.row+=r,e.end.row+=r,e})))),t},this.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)},this.outdentRows=function(e){for(var t=e.collapseRows(),i=new d(0,0,0,0),n=this.getTabSize(),r=t.start.row;r<=t.end.row;++r){var o=this.getLine(r);i.start.row=r,i.end.row=r;for(var s=0;s<n&&" "==o.charAt(s);++s);s<n&&"\t"==o.charAt(s)?(i.start.column=s,i.end.column=s+1):(i.start.column=0,i.end.column=s),this.remove(i)}},this.$moveLines=function(e,t,i){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),i<0){if((r=this.getRowFoldStart(e+i))<0)return 0;var n=r-e}else if(0<i){if((r=this.getRowFoldEnd(t+i))>this.doc.getLength()-1)return 0;n=r-t}else e=this.$clipRowToDocument(e),n=(t=this.$clipRowToDocument(t))-e+1;var r=new d(e,0,t,Number.MAX_VALUE);r=this.getFoldsInRange(r).map((function(e){return(e=e.clone()).start.row+=n,e.end.row+=n,e})),i=0==i?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+n,i),r.length&&this.addFolds(r),n},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){var i;return t=Math.max(0,t),t=e<0?e=0:(i=this.doc.getLength())<=e?this.doc.getLine(e=i-1).length:Math.min(this.doc.getLine(e).length,t),{row:e,column:t}},this.$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},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){e!=this.$useWrapMode&&(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e&&(e=this.getLength(),this.$wrapData=Array(e),this.$updateWrapData(0,e-1)),this._signal("changeWrapMode"))},this.getUseWrapMode=function(){return this.$useWrapMode},this.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"))},this.adjustWrapLimit=function(e,t){var i=this.$wrapLimitRange;return(t=(i.max<0&&(i={min:t,max:t}),this.$constrainWrapLimit(e,i.min,i.max)))!=this.$wrapLimit&&1<t&&(this.$wrapLimit=t,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,i){return t&&(e=Math.max(t,e)),i?Math.min(i,e):e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,i=e.action,n=e.start,r=e.end,o=n.row,s=r.row,a=s-o,l=null;if(this.$updating=!0,0!=a)if("remove"===i){this[t?"$wrapData":"$rowLengthCache"].splice(o,a);var c=this.$foldData;l=this.getFoldsInRange(e);this.removeFolds(l);var h=0;for((g=this.getFoldLine(r.row))&&(g.addRemoveChars(r.row,r.column,n.column-r.column),g.shiftRow(-a),(d=this.getFoldLine(o))&&d!==g&&(d.merge(g),g=d),h=c.indexOf(g)+1);h<c.length;h++)(g=c[h]).start.row>=r.row&&g.shiftRow(-a);s=o}else{var d=Array(a),u=(d.unshift(o,0),t?this.$wrapData:this.$rowLengthCache);c=(u.splice.apply(u,d),this.$foldData),h=0;for((g=this.getFoldLine(o))&&(0==(u=g.range.compareInside(n.row,n.column))?(g=g.split(n.row,n.column))&&(g.shiftRow(a),g.addRemoveChars(s,0,r.column-n.column)):-1==u&&(g.addRemoveChars(o,0,r.column-n.column),g.shiftRow(a)),h=c.indexOf(g)+1);h<c.length;h++)(g=c[h]).start.row>=o&&g.shiftRow(a)}else{var g;a=Math.abs(e.start.column-e.end.column);"remove"===i&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(g=this.getFoldLine(o))&&g.addRemoveChars(o,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(o,s):this.$updateRowLengthCache(o,s),l},this.$updateRowLengthCache=function(e,t,i){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(i,n){var r,o,s=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,c=this.$wrapLimit,h=i;for(n=Math.min(n,s.length-1);h<=n;)(o=this.getFoldLine(h,o))?(r=[],o.walk(function(i,n,o,a){var l;if(null!=i){(l=this.$getDisplayTokens(i,r.length))[0]=e;for(var c=1;c<l.length;c++)l[c]=t}else l=this.$getDisplayTokens(s[n].substring(a,o),r.length);r=r.concat(l)}.bind(this),o.end.row,s[o.end.row].length+1),l[o.start.row]=this.$computeWrapSplits(r,c,a),h=o.end.row+1):(r=this.$getDisplayTokens(s[h]),l[h]=this.$computeWrapSplits(r,c,a),h++)};var e=3,t=4;function i(e){return!(e<4352)&&(4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12288<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510)}this.$computeWrapSplits=function(i,n,r){if(0==i.length)return[];var o=[],s=i.length,a=0,l=0,c=this.$wrapAsCode,h=this.$indentedSoftWrap,d=n<=Math.max(2*r,8)||!1===h?0:Math.floor(n/2);function u(e){for(var t=e-a,n=a;n<e;n++){var s=i[n];12!==s&&2!==s||--t}o.length||(g=function(){var e=0;if(0===d)return e;if(h)for(var t=0;t<i.length;t++){var n=i[t];if(10==n)e+=1;else if(11==n)e+=r;else if(12!=n)break}return c&&!1!==h&&(e+=r),Math.min(e,d)}(),o.indent=g),l+=t,o.push(l),a=e}for(var g=0;n-g<s-a;){var p=a+n-g;if(10<=i[p-1]&&10<=i[p])u(p);else if(i[p]==e||i[p]==t){for(;p!=a-1&&i[p]!=e;p--);if(a<p)u(p);else{for(p=a+n;p<i.length&&i[p]==t;p++);if(p==i.length)break;u(p)}}else{for(var m=Math.max(p-(n-(n>>2)),a-1);m<p&&i[p]<e;)p--;if(c){for(;m<p&&i[p]<e;)p--;for(;m<p&&9==i[p];)p--}else for(;m<p&&i[p]<10;)p--;m<p?u(++p):(2==i[p=a+n]&&p--,u(p-g))}}return o},this.$getDisplayTokens=function(e,t){var n,r=[];t=t||0;for(var o=0;o<e.length;o++){var s=e.charCodeAt(o);if(9==s){n=this.getScreenTabSize(r.length+t),r.push(11);for(var a=1;a<n;a++)r.push(12)}else 32==s?r.push(10):39<s&&s<48||57<s&&s<64?r.push(9):4352<=s&&i(s)?r.push(1,2):r.push(1)}return r},this.$getStringScreenWidth=function(e,t,n){if(0==t)return[0,0];var r,o;for(null==t&&(t=1/0),n=n||0,o=0;o<e.length&&(9==(r=e.charCodeAt(o))?n+=this.getScreenTabSize(n):4352<=r&&i(r)?n+=2:n+=1,!(t<n));o++);return[n,o]},this.lineWidgets=null,this.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},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){var t;return this.$useWrapMode?(e=this.screenToDocumentPosition(e,Number.MAX_VALUE),(t=this.$wrapData[e.row]).length&&t[0]<e.column?t.indent:0):0},this.getScreenLastRowColumn=function(e){return e=this.screenToDocumentPosition(e,Number.MAX_VALUE),this.documentToScreenColumn(e.row,e.column)},this.getDocumentLastRowColumn=function(e,t){return e=this.documentToScreenRow(e,t),this.getScreenLastRowColumn(e)},this.getDocumentLastRowColumnPosition=function(e,t){return e=this.documentToScreenRow(e,t),this.screenToDocumentPosition(e,Number.MAX_VALUE/10)},this.getRowSplitData=function(e){if(this.$useWrapMode)return this.$wrapData[e]},this.getScreenTabSize=function(e){return this.$tabSize-(e%this.$tabSize|0)},this.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row},this.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column},this.screenToDocumentPosition=function(e,t,i){if(e<0)return{row:0,column:0};for(var n,r,o,s=0,a=0,l=0,c=0,h=this.$screenRowCache,d=this.$getRowCacheIndex(h,e),u=h.length,g=(o=u&&0<=d?(l=h[d],s=this.$docRowCache[d],e>h[u-1]):!u,this.getLength()-1),p=this.getNextFoldLine(s),m=p?p.start.row:1/0;l<=e&&!(e<l+(c=this.getRowLength(s))||g<=s);)l+=c,m<++s&&(s=p.end.row+1,m=(p=this.getNextFoldLine(s,p))?p.start.row:1/0),o&&(this.$docRowCache.push(s),this.$screenRowCache.push(l));if(p&&p.start.row<=s)n=this.getFoldDisplayLine(p),s=p.start.row;else{if(l+c<=e||g<s)return{row:g,column:this.getLine(g).length};n=this.getLine(s),p=null}return d=0,h=Math.floor(e-l),this.$useWrapMode&&(u=this.$wrapData[s])&&(r=u[h],0<h&&u.length&&(d=u.indent,a=u[h-1]||u[u.length-1],n=n.substring(a))),void 0!==i&&this.$bidiHandler.isBidiRow(l+h,s,h)&&(t=this.$bidiHandler.offsetToCol(i)),a+=this.$getStringScreenWidth(n,t-d)[1],this.$useWrapMode&&r<=a&&(a=r-1),p?p.idxToPosition(a):{row:s,column:a}},this.documentToScreenPosition=function(e,t){var i=(e=(n=void 0===t?this.$clipPositionToDocument(e.row,e.column):this.$clipPositionToDocument(e,t)).row,t=n.column,0),n=null;(a=this.getFoldAt(e,t,1))&&(e=a.start.row,t=a.start.column);for(var r,o,s=0,a=this.$docRowCache,l=this.$getRowCacheIndex(a,e),c=a.length,h=(o=c&&0<=l?(s=a[l],i=this.$screenRowCache[l],e>a[c-1]):!c,this.getNextFoldLine(s)),d=h?h.start.row:1/0;s<e;){if(d<=s){if(e<(r=h.end.row+1))break;d=(h=this.getNextFoldLine(r,h))?h.start.row:1/0}else r=s+1;i+=this.getRowLength(s),s=r,o&&(this.$docRowCache.push(s),this.$screenRowCache.push(i))}var u="";n=h&&d<=s?(u=this.getFoldDisplayLine(h,e,t),h.start.row):(u=this.getLine(e).substring(0,t),e),l=0;if(this.$useWrapMode){var g=this.$wrapData[n];if(g){for(var p=0;u.length>=g[p];)i++,p++;u=u.substring(g[p-1]||0,u.length),l=0<p?g.indent:0}}return this.lineWidgets&&this.lineWidgets[s]&&this.lineWidgets[s].rowsAbove&&(i+=this.lineWidgets[s].rowsAbove),{row:i,column:l+this.$getStringScreenWidth(u)[0]}},this.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},this.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},this.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var i=this.$wrapData.length,n=0,r=0,o=(t=this.$foldData[r++])?t.start.row:1/0;n<i;){var s=this.$wrapData[n];e+=s?s.length+1:1,o<++n&&(n=t.end.row+1,o=(t=this.$foldData[r++])?t.start.row:1/0)}else{e=this.getLength();var a=this.$foldData;for(r=0;r<a.length;r++)e-=(t=a[r]).end.row-t.start.row}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},this.$setFontMetrics=function(e){this.$enableVarChar&&(this.$getStringScreenWidth=function(t,i,n){if(0===i)return[0,0];var r,o;for(i=i||1/0,n=n||0,o=0;o<t.length&&!(i<(n+="\t"===(r=t.charAt(o))?this.getScreenTabSize(n):e.getCharacterWidth(r)));o++);return[n,o]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},this.isFullWidth=i}.call(n.prototype),e("./edit_session/folding").Folding.call(n.prototype),e("./edit_session/bracket_match").BracketMatch.call(n.prototype),a.defineOptions(n.prototype,"session",{wrap:{set:function(e){e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e&&((this.$wrap=e)?(this.setWrapLimitRange(e="number"==typeof e?e:null,e),this.setUseWrapMode(!0)):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){0<(e=parseInt(e))&&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=n})),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,i){"use strict";function n(){this.$options={}}var r=e("./lib/lang"),o=e("./lib/oop"),s=e("./range").Range;(function(){this.set=function(e){return o.mixin(this.$options,e),this},this.getOptions=function(){return r.copyObject(this.$options)},this.setOptions=function(e){this.$options=e},this.find=function(e){var t=this.$options;if(!(e=this.$matchIterator(e,t)))return!1;var i=null;return e.forEach((function(e,n,r,o){return i=new s(e,n,r,o),!(n==o&&t.start&&t.start.start&&0!=t.skipCurrent&&i.isEqual(t.start)&&(i=null,1))})),i},this.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var i=t.range,n=i?e.getLines(i.start.row,i.end.row):e.doc.getAllLines(),o=[],a=t.re;if(t.$isMultiLine){var l,c=a.length,h=n.length-c;e:for(var d=a.offset||0;d<=h;d++){for(var u=0;u<c;u++)if(-1==n[d+u].search(a[u]))continue e;var g=n[d],p=n[d+c-1];g=g.length-g.match(a[0])[0].length,p=p.match(a[c-1])[0].length;l&&l.end.row===d&&l.end.column>g||(o.push(l=new s(d,g,d+c-1,p)),2<c&&(d=d+c-2))}}else for(var m=0;m<n.length;m++){var f=r.getMatchOffsets(n[m],a);for(u=0;u<f.length;u++){var C=f[u];o.push(new s(m,C.offset,m,C.offset+C.length))}}if(i){var I=i.start.column,v=i.start.column;for(m=0,u=o.length-1;m<u&&o[m].start.column<I&&o[m].start.row==i.start.row;)m++;for(;m<u&&o[u].end.column>v&&o[u].end.row==i.end.row;)u--;for(o=o.slice(m,u+1),m=0,u=o.length;m<u;m++)o[m].start.row+=i.start.row,o[m].end.row+=i.start.row}return o},this.replace=function(e,t){var i=this.$options,n=this.$assembleRegExp(i);if(i.$isMultiLine)return t;if(n){var r=n.exec(e);if(!r||r[0].length!=e.length)return null;if(t=e.replace(n,t),i.preserveCase){t=t.split("");for(var o=Math.min(e.length,e.length);o--;){var s=e[o];s&&s.toLowerCase()!=s?t[o]=t[o].toUpperCase():t[o]=t[o].toLowerCase()}t=t.join("")}return t}},this.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var i,n=e.needle;if(!e.needle)return e.re=!1;function o(e){return/\w/.test(e)||i.regExp?"\\b":""}e.regExp||(n=r.escapeRegExp(n)),e.wholeWord&&(i=e,n=o((s=n)[0])+s+o(s[s.length-1]));var s=e.caseSensitive?"gm":"gmi";if(e.$isMultiLine=!t&&/[\n\r]/.test(n),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(n,s);try{var a=new RegExp(n,s)}catch(e){a=!1}return e.re=a},this.$assembleMultilineRegExp=function(e,t){for(var i=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),n=[],r=0;r<i.length;r++)try{n.push(new RegExp(i[r],t))}catch(e){return!1}return n},this.$matchIterator=function(e,t){var i=this.$assembleRegExp(t);if(!i)return!1;var n,r,o=1==t.backwards,s=0!=t.skipCurrent,a=t.range,l=t.start,c=((l=l||(a?a[o?"end":"start"]:e.selection.getRange())).start&&(l=l[s!=o?"end":"start"]),a?a.start.row:0),h=a?a.end.row:e.getLength()-1;return r=t.$isMultiLine?(n=i.length,function(t,r,s){var a=o?t-n+1:t;if(!(a<0||a+n>e.getLength())){var l=e.getLine(a);t=l.search(i[0]);if(!(!o&&t<r||-1===t)){for(var c=1;c<n;c++)if(-1==(l=e.getLine(a+c)).search(i[c]))return;var h=l.match(i[n-1])[0].length;if(!(o&&r<h))return!!s(a,t,a+n-1,h)||void 0}}}):o?function(t,n,r){var o,s=e.getLine(t),a=[];for(i.lastIndex=0;o=i.exec(s);){var l=o[0].length,c=o.index;if(!l){if(c>=s.length)break;i.lastIndex=c+=1}if(o.index+l>n)break;a.push(o.index,l)}for(var h=a.length-1;0<=h;h-=2){var d=a[h-1];if(r(t,d,t,d+(l=a[h])))return!0}}:function(t,n,r){var o=e.getLine(t);for(i.lastIndex=n;s=i.exec(o);){var s,a=s[0].length;if(r(t,s=s.index,t,s+a))return!0;if(!a&&(i.lastIndex=s+=1,s>=o.length))return!1}},{forEach:o?function(e){var i=l.row;if(!r(i,l.column,e)){for(i--;c<=i;i--)if(r(i,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(i=h,c=l.row;c<=i;i--)if(r(i,Number.MAX_VALUE,e))return}}:function(e){var i=l.row;if(!r(i,l.column,e)){for(i+=1;i<=h;i++)if(r(i,0,e))return;if(0!=t.wrap)for(i=c,h=l.row;i<=h;i++)if(r(i,0,e))return}}}}}).call(n.prototype),t.Search=n})),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,i){"use strict";var n=e("../lib/keys"),r=e("../lib/useragent"),o=n.KEY_MODS;function s(e,t){this.platform=t||(r.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=!0}function a(e,t){s.call(this,e,t),this.$singleCommand=!1}a.prototype=s.prototype,function(){function e(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}this.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),(this.commands[e.name]=e).bindKey&&this._buildKeyHash(e)},this.removeCommand=function(e,t){var i,n=e&&("string"==typeof e?e:e.name),r=(e=this.commands[n],t||delete this.commands[n],this.commandKeyBinding);for(i in r){var o,s=r[i];s==e?delete r[i]:Array.isArray(s)&&-1!=(o=s.indexOf(e))&&(s.splice(o,1),1==s.length&&(r[i]=s[0]))}},this.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="",r=(-1!=e.indexOf(" ")&&(e=(r=e.split(/\s+/)).pop(),r.forEach((function(e){e=this.parseKeys(e),e=o[e.hashId]+e.key,n+=(n?" ":"")+e,this._addCommandToBinding(n,"chainKeys")}),this),n+=" "),this.parseKeys(e));e=o[r.hashId]+r.key;this._addCommandToBinding(n+e,t,i)}),this)},this._addCommandToBinding=function(t,i,n){var r=this.commandKeyBinding;if(i)if(!r[t]||this.$singleCommand)r[t]=i;else{Array.isArray(r[t])?-1!=(s=r[t].indexOf(i))&&r[t].splice(s,1):r[t]=[r[t]],"number"!=typeof n&&(n=e(i));for(var o=r[t],s=0;s<o.length&&!(n<e(o[s]));s++);o.splice(s,0,i)}else delete r[t]},this.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);"object"==typeof(i="function"==typeof i?{exec:i}:i)&&(i.name||(i.name=t),this.addCommand(i))}}),this)},this.removeCommands=function(e){Object.keys(e).forEach((function(t){this.removeCommand(e[t])}),this)},this.bindKeys=function(e){Object.keys(e).forEach((function(t){this.bindKey(t,e[t])}),this)},this._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},this.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter((function(e){return e})),i=t.pop(),r=n[i];if(n.FUNCTION_KEYS[r])i=n.FUNCTION_KEYS[r].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=n.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}},this.findKeyCommand=function(e,t){return e=o[e]+t,this.commandKeyBinding[e]},this.handleKeyboard=function(e,t,i,n){var r,s;if(!(n<0))return r=o[t]+i,s=this.commandKeyBinding[r],e.$keyChain&&(e.$keyChain+=" "+r,s=this.commandKeyBinding[e.$keyChain]||s),!s||"chainKeys"!=s&&"chainKeys"!=s[s.length-1]?(e.$keyChain&&(t&&4!=t||1!=i.length?(-1==t||0<n)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-r.length-1)),{command:s}):(e.$keyChain=e.$keyChain||r,{command:"null"})},this.getStatusText=function(e,t){return t.$keyChain||""}}.call(s.prototype),t.HashHandler=s,t.MultiHashHandler=a})),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";function n(e,t){o.call(this,t,e),this.byName=this.commands,this.setDefaultHandler("exec",(function(e){return e.command.exec(e.editor,e.args||{})}))}var r=e("../lib/oop"),o=e("../keyboard/hash_handler").MultiHashHandler,s=e("../lib/event_emitter").EventEmitter;r.inherits(n,o),function(){r.implement(this,s),this.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(!(e="string"==typeof 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 r={editor:t,command:e,args:i};return r.returnValue=this._emit("exec",r),this._signal("afterExec",r),!1!==r.returnValue},this.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)},this.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}}},this.trimMacro=function(e){return e.map((function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]?e:e[0]}))}}.call(n.prototype),t.CommandManager=n})),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"),r=e("../config"),o=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){r.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){r.loadModule("./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){r.loadModule("./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){r.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){r.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()},multiSelectAction:"forEachLine",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:"joinlines",description:"Join lines",bindKey:s(null,null),exec:function(e){for(var t=(r=e.selection.isBackwards())?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),i=r?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),r=e.session.doc.getLine(t.row).length,s=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,a=e.session.doc.getLine(t.row),l=t.row+1;l<=i.row+1;l++){var c=n.stringTrimLeft(n.stringTrimRight(e.session.doc.getLine(l)));a+=c=0!==c.length?" "+c:c}i.row+1<e.session.doc.getLength()-1&&(a+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new o(t.row,0,i.row+2,0),a),0<s?(e.selection.moveCursorTo(t.row,t.column),e.selection.selectTo(t.row,t.column+s)):(r=e.session.doc.getLine(t.row).length>r?r+1:r,e.selection.moveCursorTo(t.row,r))},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,r=[];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||r.push(new o(n[s].end.row,n[s].end.column,t,i)),0===s?0===n[s].start.row&&0===n[s].start.column||r.push(new o(0,0,n[s].start.row,n[s].start.column)):r.push(new o(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<r.length;s++)e.selection.addRange(r[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",description:"Open command pallete",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/editor",["require","exports","module","ace/lib/fixoldbrowsers","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/clipboard"],(function(e,t,i){"use strict";function n(e,t,i){this.$toDestroy=[];var r=e.getContainerElement();this.container=r,this.renderer=e,this.id="editor"+ ++n.$uid,this.commands=new f(a.isMac?"mac":"win",C),"object"==typeof document&&(this.textInput=new l(e.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.bgTokenizer&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",(function(e,t){t._$emitInputEvent.schedule(31)})),this.setSession(t||i&&i.session||new u("")),I.resetOptions(this),i&&this.setOptions(i),I._signal("editor",this)}e("./lib/fixoldbrowsers");var r=e("./lib/oop"),o=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,C=e("./commands/default_commands").commands,I=e("./config"),v=e("./token_iterator").TokenIterator,A=e("./clipboard"),b=(n.$uid=0,function(){r.implement(this,m),this.$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)},this.curOp=null,this.prevOp={},this.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()},this.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)&&(this._signal("beforeEndOperation"),this.curOp)){var t=(e=this.curOp.command)&&e.scrollIntoView;if(t){switch(t){case"center-animate":t="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var i=this.selection.getRange(),n=this.renderer.layerConfig;(i.start.row>=n.lastRow||i.end.row<=n.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==t&&this.renderer.animateScrolling(this.curOp.scrollTop)}e=this.selection.toJSON(),this.curOp.selectionAfter=e,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(e),this.prevOp=this.curOp,this.curOp=null}}},this.$mergeableCommands=["backspace","del","insertstring"],this.$historyTracker=function(e){var t,i,n,r;this.$mergeUndoDeltas&&(t=this.prevOp,i=this.$mergeableCommands,n=t.command&&e.command.name==t.command.name,"insertstring"==e.command.name?(r=e.args,void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\s/.test(r)||/\s/.test(t.args)),this.mergeNextCommand=!0):n=n&&-1!==i.indexOf(e.command.name),(n=!("always"!=this.$mergeUndoDeltas&&2e3<Date.now()-this.sequenceStartTime)&&n)?this.session.mergeUndoDeltas=!0:-1!==i.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now()))},this.setKeyboardHandler=function(e,t){var i;e&&"string"==typeof e&&"ace"!=e?(this.$keybindingId=e,i=this,I.loadModule(["keybinding",e],(function(n){i.$keybindingId==e&&i.keyBinding.setKeyboardHandler(n&&n.handler),t&&t()}))):(this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t())},this.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},this.setSession=function(e){var t,i;this.session!=e&&(this.curOp&&this.endOperation(),this.curOp={},(t=this.session)&&(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),(i=this.session.getSelection()).off("changeCursor",this.$onCursorChange),i.off("changeSelection",this.$onSelectionChange)),(this.session=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.bgTokenizer&&e.bgTokenizer.scheduleStart())},this.getSession=function(){return this.session},this.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},this.getValue=function(){return this.session.getValue()},this.getSelection=function(){return this.selection},this.resize=function(e){this.renderer.onResize(e)},this.setTheme=function(e,t){this.renderer.setTheme(e,t)},this.getTheme=function(){return this.renderer.getTheme()},this.setStyle=function(e){this.renderer.setStyle(e)},this.unsetStyle=function(e){this.renderer.unsetStyle(e)},this.getFontSize=function(){return this.getOption("fontSize")||o.computedStyle(this.container).fontSize},this.setFontSize=function(e){this.setOption("fontSize",e)},this.$highlightBrackets=function(){var e;this.$highlightPending||((e=this).$highlightPending=!0,setTimeout((function(){e.$highlightPending=!1;var t,i,n=e.session;n&&n.bgTokenizer&&(n.$bracketHighlight&&(n.$bracketHighlight.markerIds.forEach((function(e){n.removeMarker(e)})),n.$bracketHighlight=null),(t=!(t=n.getMatchingBracketRanges(e.getCursorPosition()))&&n.$mode.getMatching?n.$mode.getMatching(e.session):t)&&(i="ace_bracket",Array.isArray(t)?1==t.length&&(i="ace_error_bracket"):t=[t],2==t.length&&(0==p.comparePoints(t[0].end,t[1].start)?t=[p.fromPoints(t[0].start,t[1].end)]:0==p.comparePoints(t[0].start,t[1].end)&&(t=[p.fromPoints(t[1].start,t[0].end)])),n.$bracketHighlight={ranges:t,markerIds:t.map((function(e){return n.addMarker(e,i,"text")}))}))}),50))},this.$highlightTags=function(){var e;this.$highlightTagPending||((e=this).$highlightTagPending=!0,setTimeout((function(){e.$highlightTagPending=!1;var t=e.session;if(t&&t.bgTokenizer){var i=e.getCursorPosition(),n=new v(e.session,i.row,i.column),r=n.getCurrentToken();if(!r||!/\b(?:tag-open|tag-name)/.test(r.type))return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);if(-1===r.type.indexOf("tag-open")||(r=n.stepForward())){var o=r.value,s=r.value,a=0,l=n.stepBackward();if("<"===l.value)for(;l=r,(r=n.stepForward())&&(-1!==r.type.indexOf("tag-name")?o===(s=r.value)&&("<"===l.value?a++:"</"===l.value&&a--):o===s&&"/>"===r.value&&a--),r&&0<=a;);else{do{if(r=l,l=n.stepBackward(),r)if(-1!==r.type.indexOf("tag-name"))o===r.value&&("<"===l.value?a++:"</"===l.value&&a--);else if("/>"===r.value){for(var c=0,h=l;h;){if(-1!==h.type.indexOf("tag-name")&&h.value===o){a--;break}if("<"===h.value)break;h=n.stepBackward(),c++}for(var d=0;d<c;d++)n.stepForward()}}while(l&&a<=0);n.stepForward()}if(!r)return t.removeMarker(t.$tagHighlight),void(t.$tagHighlight=null);i=n.getCurrentTokenRow();var u=n.getCurrentTokenColumn();i=new p(i,u,i,u+r.value.length),u=t.$backMarkers[t.$tagHighlight];t.$tagHighlight&&null!=u&&0!==i.compareRange(u.range)&&(t.removeMarker(t.$tagHighlight),t.$tagHighlight=null),t.$tagHighlight||(t.$tagHighlight=t.addMarker(i,"ace_bracket","text"))}}}),50))},this.focus=function(){var e=this;setTimeout((function(){e.isFocused()||e.textInput.focus()})),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},this.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e))},this.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$highlightTags(),this.$updateHighlightActiveLine()},this.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()},this.onTokenizerUpdate=function(e){e=e.data,this.renderer.updateLines(e.first,e.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},this.$updateHighlightActiveLine=function(){var e,t,i=this.getSession();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()||1<this.renderer.$minLines||(e=!1)),i.$highlightLineMarker&&!e?(i.removeMarker(i.$highlightLineMarker.id),i.$highlightLineMarker=null):!i.$highlightLineMarker&&e?((t=new p(e.row,e.column,e.row,1/0)).id=i.addMarker(t,"ace_active-line","screenLine"),i.$highlightLineMarker=t):e&&(i.$highlightLineMarker.start.row=e.row,i.$highlightLineMarker.end.row=e.row,i.$highlightLineMarker.start.column=e.column,i._signal("changeBackMarker"))},this.onSelectionChange=function(e){var t,i,n=((n=this.session).$selectionMarker&&n.removeMarker(n.$selectionMarker),n.$selectionMarker=null,this.selection.isEmpty()?this.$updateHighlightActiveLine():(t=this.selection.getRange(),i=this.getSelectionStyle(),n.$selectionMarker=n.addMarker(t,"ace_selection",i)),this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp());this.session.highlight(n),this._signal("changeSelection")},this.$getSelectionHighLightRegexp=function(){var e=this.session;if(!(t=this.getSelectionRange()).isEmpty()&&!t.isMultiLine()){var t,i=t.start.column,n=t.end.column;if(!(5e3<(t=(e=e.getLine(t.start.row)).substring(i,n)).length)&&/[\w\d]/.test(t)&&(t=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:t}),e=e.substring(i-1,n+1),t.test(e)))return t}},this.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},this.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},this.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},this.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},this.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},this.onChangeWrapLimit=function(){this.renderer.updateFull()},this.onChangeWrapMode=function(){this.renderer.onResize(!0)},this.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},this.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},this.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(),r=0;r<n.length;r++){var o=n[r];r&&n[r-1].start.row==o.start.row||(e+=this.session.getLine(o.start.row)+t)}}var s={text:e};return this._signal("copy",s),A.lineMode=!!i&&s.text,s.text},this.onCopy=function(){this.commands.exec("copy",this)},this.onCut=function(){this.commands.exec("cut",this)},this.onPaste=function(e,t){this.commands.exec("paste",this,{text:e,event:t})},this.$handlePaste=function(e){this._signal("paste",e="string"==typeof e?{text:e}:e);var t=e.text,i=(e=t===A.lineMode,this.session);if(!this.inMultiSelectMode||this.inVirtualSelectionMode)e?i.insert({row:this.selection.lead.row,column:0},t):this.insert(t);else if(e)this.selection.rangeList.ranges.forEach((function(e){i.insert({row:e.start.row,column:0},t)}));else{var n=t.split(/\r\n|\r|\n/),r=this.selection.rangeList.ranges;e=!(2!=n.length||n[0]&&n[1]);if(n.length!=r.length||e)return this.commands.exec("insertstring",this,t);for(var o=r.length;o--;){var s=r[o];s.isEmpty()||i.remove(s),i.insert(s.start,n[o])}}},this.execCommand=function(e,t){return this.commands.exec(e,this,t)},this.insert=function(e,t){var i,n=this.session,r=n.getMode(),o=this.getCursorPosition(),s=(!this.getBehavioursEnabled()||t||(i=r.transformAction(n.getState(o.row),"insertion",this,n,e))&&(e===i.text||this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1),e=i.text),"\t"==e&&(e=this.session.getTabString()),this.selection.isEmpty()?this.session.getOverwrite()&&-1==e.indexOf("\n")&&((s=new p.fromPoints(o,o)).end.column+=e.length,this.session.remove(s)):(s=this.getSelectionRange(),o=this.session.remove(s),this.clearSelection()),"\n"!=e&&"\r\n"!=e||(a=n.getLine(o.row),o.column>a.search(/\S|$/)&&(t=a.substr(o.column).search(/\S|$/),n.doc.removeInLine(o.row,o.column,o.column+t))),this.clearSelection(),o.column),a=(t=n.getState(o.row),n.getLine(o.row)),l=r.checkOutdent(t,a,e);n.insert(o,e),i&&i.selection&&(2==i.selection.length?this.selection.setSelectionRange(new p(o.row,s+i.selection[0],o.row,s+i.selection[1])):this.selection.setSelectionRange(new p(o.row+i.selection[0],i.selection[1],o.row+i.selection[2],i.selection[3]))),this.$enableAutoIndent&&(n.getDocument().isNewLine(e)&&(s=r.getNextLineIndent(t,a.slice(0,o.column),n.getTabString()),n.insert({row:o.row+1,column:0},s)),l&&r.autoOutdent(t,n,o.row))},this.autoIndent=function(){for(var e,t,i,n,r,o=this.session,s=o.getMode(),a=(i=this.selection.isEmpty()?(t=0,o.doc.getLength()-1):(t=(e=this.getSelectionRange()).start.row,e.end.row),""),l="",c=o.getTabString(),h=t;h<=i;h++)0<h&&(a=o.getState(h-1),n=o.getLine(h-1),l=s.getNextLineIndent(a,n,c)),n=o.getLine(h),l!==(r=s.$getIndent(n))&&(0<r.length&&(r=new p(h,0,h,r.length),o.remove(r)),0<l.length&&o.insert({row:h,column:0},l)),s.autoOutdent(a,o,h)},this.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}}),e=this.applyComposition.bind(this,e,t),this.selection.rangeCount?this.forEachSelection(e):e(),this.endOperation()},this.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))},this.onCommandKey=function(e,t,i){return this.keyBinding.onCommandKey(e,t,i)},this.setOverwrite=function(e){this.session.setOverwrite(e)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},this.getScrollSpeed=function(){return this.getOption("scrollSpeed")},this.setDragDelay=function(e){this.setOption("dragDelay",e)},this.getDragDelay=function(){return this.getOption("dragDelay")},this.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},this.getSelectionStyle=function(){return this.getOption("selectionStyle")},this.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},this.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(e){this.setOption("readOnly",e)},this.getReadOnly=function(){return this.getOption("readOnly")},this.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},this.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},this.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},this.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},this.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},this.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t,i,n;e=this.getSelectionRange();this.getBehavioursEnabled()&&(i=(t=this.session).getState(e.start.row),i=t.getMode().transformAction(i,"deletion",this,t,e),0===e.end.column&&"\n"==(n=t.getTextRange(e))[n.length-1]&&(n=t.getLine(e.end.row),/^\s+$/.test(n)&&(e.end.column=n.length)),i&&(e=i)),this.session.remove(e),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.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()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},this.transposeLetters=function(){var e,t,i,n;!this.selection.isEmpty()||0!==(t=(e=this.getCursorPosition()).column)&&(n=t<(n=this.session.getLine(e.row)).length?(i=n.charAt(t)+n.charAt(t-1),new p(e.row,t-1,e.row,t+1)):(i=n.charAt(t-1)+n.charAt(t-2),new p(e.row,t-2,e.row,t)),this.session.replace(n,i),this.session.selection.moveToPosition(n.end))},this.toLowerCase=function(){var e=this.getSelectionRange(),t=(this.selection.isEmpty()&&this.selection.selectWord(),this.getSelectionRange()),i=this.session.getTextRange(t);this.session.replace(t,i.toLowerCase()),this.selection.setSelectionRange(e)},this.toUpperCase=function(){var e=this.getSelectionRange(),t=(this.selection.isEmpty()&&this.selection.selectWord(),this.getSelectionRange()),i=this.session.getTextRange(t);this.session.replace(t,i.toUpperCase()),this.selection.setSelectionRange(e)},this.indent=function(){var e=this.session,t=this.getSelectionRange();if(t.start.row<t.end.row)return r=this.$getSelectedRows(),void e.indentRows(r.first,r.last,"\t");if(t.start.column<t.end.column){var i=e.getTextRange(t);if(!/^\s+$/.test(i))return r=this.$getSelectedRows(),void e.indentRows(r.first,r.last,"\t")}var n=e.getLine(t.start.row),r=(i=t.start,e.getTabSize());e=e.documentToScreenColumn(i.row,i.column);if(this.session.getUseSoftTabs())var o=r-e%r,a=s.stringRepeat(" ",o);else{for(o=e%r;" "==n[t.start.column-1]&&o;)t.start.column--,o--;this.selection.setSelectionRange(t),a="\t"}return this.insert(a)},this.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,"\t")},this.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},this.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 r=new p(0,0,0,0);for(n=e.first;n<=e.last;n++){var o=t.getLine(n);r.start.row=n,r.end.row=n,r.end.column=o.length,t.replace(r,i[n-e.first])}},this.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},this.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),i=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,i,e)},this.getNumberAt=function(e,t){for(var i=/[\-]?[0-9]+(?:\.[0-9]+)?/g,n=(i.lastIndex=0,this.session.getLine(e));i.lastIndex<t;){var r=i.exec(n);if(r.index<=t&&r.index+r[0].length>=t)return{value:r[0],start:r.index,end:r.index+r[0].length}}return null},this.modifyNumber=function(e){var t,i,n,r=this.selection.getCursor().row,o=this.selection.getCursor().column,s=new p(r,o-1,r,o);s=this.session.getTextRange(s);!isNaN(parseFloat(s))&&isFinite(s)?(s=this.getNumberAt(r,o))&&(n=0<=s.value.indexOf(".")?s.start+s.value.indexOf(".")+1:s.end,t=s.start+s.value.length-n,i=parseFloat(s.value),i*=Math.pow(10,t),n!==s.end&&o<n?e*=Math.pow(10,s.end-o-1):e*=Math.pow(10,s.end-o),n=(i=(i+=e)/Math.pow(10,t)).toFixed(t),e=new p(r,s.start,r,s.end),this.session.replace(e,n),this.moveCursorTo(r,Math.max(s.start+1,o+n.length-s.value.length))):this.toggleWord()},this.$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"],["&&","||"],["==","!="]],this.toggleWord=function(){for(var e,t=this.selection.getCursor().row,i=this.selection.getCursor().column,n=(this.selection.selectWord(),this.getSelectedText()),r=this.selection.getWordRange().start.column,o=n.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),a=i-r-1,l=(a<0&&(a=0),0),c=this,h=(n.match(/[A-Za-z0-9_]+/)&&o.forEach((function(i,o){e=l+i.length,l<=a&&a<=e&&(n=i,c.selection.clearSelection(),c.moveCursorTo(t,l+r),c.selection.selectTo(t,e+r)),l=e})),this.$toggleWordPairs),d=0;d<h.length;d++)for(var u=h[d],g=0;g<=1;g++){var p=+!g,m=n.match(new RegExp("^\\s?_?("+s.escapeRegExp(u[g])+")\\s?$","i"));m&&n.match(new RegExp("([_]|^|\\s)("+s.escapeRegExp(m[1])+")($|\\s)","g"))&&(m=n.replace(new RegExp(s.escapeRegExp(u[g]),"i"),(function(e){var t=u[p];return e.toUpperCase()==e?t=t.toUpperCase():e.charAt(0).toUpperCase()==e.charAt(0)&&(t=t.substr(0,0)+u[p].charAt(0).toUpperCase()+t.substr(1)),t})),this.insert(m))}},this.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},this.duplicateSelection=function(){var e,t=this.selection,i=this.session,n=t.getRange(),r=t.isBackwards();n.isEmpty()?(e=n.start.row,i.duplicateLines(e,e)):(e=r?n.start:n.end,i=i.insert(e,i.getTextRange(n),!1),n.start=e,n.end=i,t.setSelectionRange(n,r))},this.moveLinesDown=function(){this.$moveLines(1,!1)},this.moveLinesUp=function(){this.$moveLines(-1,!1)},this.moveText=function(e,t,i){return this.session.moveText(e,t,i)},this.copyLinesUp=function(){this.$moveLines(-1,!0)},this.copyLinesDown=function(){this.$moveLines(1,!0)},this.$moveLines=function(e,t){var i=this.selection;if(!i.inMultiSelectMode||this.inVirtualSelectionMode){var n=i.toOrientedRange(),r=this.$getSelectedRows(n),o=this.session.$moveLines(r.first,r.last,t?0:e);n.moveBy(o=t&&-1==e?0:o,0),i.fromOrientedRange(n)}else{for(var s=i.rangeList.ranges,a=(i.rangeList.detach(this.session),this.inVirtualSelectionMode=!0,0),l=0,c=s.length,h=0;h<c;h++){for(var d=h,u=(s[h].moveBy(a,0),(r=this.$getSelectedRows(s[h])).first),g=r.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++;l+=a=t?a:0}i.fromOrientedRange(i.ranges[0]),i.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},this.onCompositionStart=function(e){this.renderer.showComposition(e)},this.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},this.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(e,t){var i=this.renderer,n=this.renderer.layerConfig,r=e*Math.floor(n.height/n.lineHeight);!0===t?this.selection.$moveSelection((function(){this.moveCursorBy(r,0)})):!1===t&&(this.selection.moveCursorBy(r,0),this.selection.clearSelection()),e=i.scrollTop;i.scrollBy(0,r*n.lineHeight),null!=t&&i.scrollCursorIntoView(null,.5),i.animateScrolling(e)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(e){this.renderer.scrollToRow(e)},this.scrollToLine=function(e,t,i,n){this.renderer.scrollToLine(e,t,i,n)},this.centerSelection=function(){var e=this.getSelectionRange();e={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(e,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.selection.selectAll()},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},this.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},this.jumpToMatching=function(e,t){var i=this.getCursorPosition(),n=new v(this.session,i.row,i.column),r=n.getCurrentToken(),o=r||n.stepForward();if(o){var s,a,l,c=!1,h={},d=i.column-o.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(o.value.match(/[{}()\[\]]/g)){for(;d<o.value.length&&!c;d++)if(u[o.value[d]])switch(a=u[o.value[d]]+"."+o.type.replace("rparen","lparen"),isNaN(h[a])&&(h[a]=0),o.value[d]){case"(":case"[":case"{":h[a]++;break;case")":case"]":case"}":h[a]--,-1===h[a]&&(s="bracket",c=!0)}}else-1!==o.type.indexOf("tag-name")&&(isNaN(h[o.value])&&(h[o.value]=0),"<"===r.value?h[o.value]++:"</"===r.value&&h[o.value]--,-1===h[o.value]&&(s="tag",c=!0))}while(c||(r=o,o=n.stepForward(),d=0),o&&!c);if(s){if("bracket"===s)(g=this.session.getBracketRange(i))||(l=(g=new p(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+d-1,n.getCurrentTokenRow(),n.getCurrentTokenColumn()+d-1)).start,(t||l.row===i.row&&Math.abs(l.column-i.column)<2)&&(g=this.session.getBracketRange(l)));else if("tag"===s){if(!o||-1===o.type.indexOf("tag-name"))return;var g,m=o.value;if(0===(g=new p(n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2,n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2)).compare(i.row,i.column))for(c=!1;o=r,(r=n.stepBackward())&&(-1!==r.type.indexOf("tag-close")&&g.setEnd(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+1),o.value===m&&-1!==o.type.indexOf("tag-name")&&("<"===r.value?h[m]++:"</"===r.value&&h[m]--,0===h[m]&&(c=!0))),r&&!c;);o&&o.type.indexOf("tag-name")&&(l=g.start).row==i.row&&Math.abs(l.column-i.column)<2&&(l=g.end)}(l=g&&g.cursor||l)&&(e?g&&t?this.selection.setRange(g):g&&g.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(l.row,l.column):this.selection.moveTo(l.row,l.column))}}},this.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)},this.navigateTo=function(e,t){this.selection.moveTo(e,t)},this.navigateUp=function(e){var t;if(this.selection.isMultiLine()&&!this.selection.isBackwards())return t=this.selection.anchor.getPosition(),this.moveCursorToPosition(t);this.selection.clearSelection(),this.selection.moveCursorBy(-e||-1,0)},this.navigateDown=function(e){var t;if(this.selection.isMultiLine()&&this.selection.isBackwards())return t=this.selection.anchor.getPosition(),this.moveCursorToPosition(t);this.selection.clearSelection(),this.selection.moveCursorBy(e||1,0)},this.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()},this.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()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(e,t){t&&this.$search.set(t);var i=0;return(t=this.$search.find(this.session))&&(this.$tryReplace(t,e)&&(i=1),this.selection.setSelectionRange(t),this.renderer.scrollSelectionIntoView(t.start,t.end)),i},this.replaceAll=function(e,t){t&&this.$search.set(t);var i=this.$search.findAll(this.session),n=0;if(!i.length)return n;t=this.getSelectionRange(),this.selection.moveTo(0,0);for(var r=i.length-1;0<=r;--r)this.$tryReplace(i[r],e)&&n++;return this.selection.setSelectionRange(t),n},this.$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},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(e,t,i){t=t||{},"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&r.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}),e=this.$search.find(this.session);return t.preventScroll?e:e?(this.revealRange(e,i),e):(t.backwards?n.start=n.end:n.end=n.start,void this.selection.setRange(n))},this.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},this.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},this.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)},this.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},this.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()},this.setAutoScrollEditorIntoView=function(e){var t,i,n,r,o,s,a;e&&(n=!1,(i=this).$scrollAnchor||(this.$scrollAnchor=document.createElement("div")),(r=this.$scrollAnchor).style.cssText="position:absolute",this.container.insertBefore(r,this.container.firstChild),o=this.on("changeSelection",(function(){n=!0})),s=this.renderer.on("beforeRender",(function(){n&&(t=i.renderer.container.getBoundingClientRect())})),a=this.renderer.on("afterRender",(function(){var e,o,s;n&&t&&(i.isFocused()||i.searchBox&&i.searchBox.isFocused())&&(e=(o=i.renderer).$cursorLayer.$pixelPos,o=o.layerConfig,s=e.top-o.offset,null!=(n=0<=e.top&&s+t.top<0||!(e.top<o.height&&e.top+t.top+o.lineHeight>window.innerHeight)&&null)&&(r.style.top=s+"px",r.style.left=e.left+"px",r.style.height=o.lineHeight+"px",r.scrollIntoView(n)),n=t=null)})),this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",o),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",s))})},this.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,o.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},this.prompt=function(e,t,i){var n=this;I.loadModule("./ext/prompt",(function(r){r.prompt(n,e,t,i)}))}}.call(n.prototype),I.defineOptions(n.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?b.attach(this):b.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?b.attach(this):b.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.getValue());e&&this.renderer.placeholderNode?(this.renderer.off("afterRender",this.$updatePlaceholder),o.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null):e||this.renderer.placeholderNode?!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||""):(this.renderer.on("afterRender",this.$updatePlaceholder),o.addCssClass(this.container,"ace_hasPlaceholder"),(e=o.createElement("div")).className="ace_placeholder",e.textContent=this.$placeholder||"",this.renderer.placeholderNode=e,this.renderer.content.appendChild(this.renderer.placeholderNode))}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"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"}),{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=n})),ace.define("ace/undomanager",["require","exports","module","ace/range"],(function(e,t,i){"use strict";function n(){this.$maxRev=0,this.$fromUndo=!1,this.reset()}(function(){this.addSession=function(e){this.$session=e},this.add=function(e,t,i){this.$fromUndo||e!=this.$lastDelta&&(this.$keepRedoStack||(this.$redoStack.length=0),!1!==t&&this.lastDeltas||(this.lastDeltas=[],this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev),"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e))},this.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},this.startNewGroup=function(){return this.lastDeltas=null,this.$rev},this.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=i.length;n--;){var r=i[n][0];if(r.id<=e)break;r.id<t&&(r.ignore=!0)}this.lastDeltas=null},this.getSelection=function(e,t){for(var i=this.selections,n=i.length;n--;){var r=i[n];if(r.rev<e)return t?i[n+1]:r}},this.getRevision=function(){return this.$rev},this.getDeltas=function(e,t){null==t&&(t=this.$rev+1);for(var i=this.$undoStack,n=null,r=0,o=i.length;o--;){var s=i[o][0];if(s.id<t&&!n&&(n=o+1),s.id<=e){r=o+1;break}}return i.slice(r,n)},this.getChangedRanges=function(e,t){null==t&&this.$rev},this.getChangedLines=function(e,t){null==t&&this.$rev},this.undo=function(e,t){this.lastDeltas=null;var i,n=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 r=function(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]}(e[i],e[i+1]);e[i]=r[0],e[i+1]=r[1],i++}return 1}}}(n,n.length))return e=e||this.$session,this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0,i=null,(n=n.pop())&&(i=e.undoChanges(n,t),this.$redoStack.push(n),this.$syncRev()),this.$fromUndo=!1,i},this.redo=function(e,t){if(this.lastDeltas=null,e=e||this.$session,this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){for(var i=this.getDeltas(this.$redoStackBaseRev,this.$rev+1),n=this.$redoStack,a=i,l=0;l<a.length;l++)for(var c=a[l],g=0;g<c.length;g++){p=void 0,m=void 0,f=void 0,C=void 0,I=void 0,v=void 0;var p=n,m=c[g];m=function(e){return{start:s(e.start),end:s(e.end),action:e.action,lines:e.lines.slice()}}(m);for(var f=p.length;f--;){for(var C=p[f],I=0;I<C.length;I++){var v=function(e,t){var i,n,s="insert"==e.action,a="insert"==t.action;if(s&&a)o(e.start,t.start)<0?h(t,e,1):h(e,t,1);else if(s&&!a)0<=o(e.start,t.end)?h(e,t,-1):(o(e.start,t.start)<=0||h(e,r.fromPoints(t.start,e.start),-1),h(t,e,1));else if(!s&&a)0<=o(t.start,e.end)?h(t,e,-1):(o(t.start,e.start)<=0||h(t,r.fromPoints(e.start,t.start),-1),h(e,t,1));else if(!s&&!a)if(0<=o(t.start,e.end))h(t,e,-1);else{if(!(o(t.end,e.start)<=0))return o(e.start,t.start)<0&&(e=u(i=e,t.start)),0<o(e.end,t.end)&&(n=u(e,t.end)),d(t.end,e.start,e.end,-1),n&&!i&&(e.lines=n.lines,e.start=n.start,e.end=n.end,n=e),[t,i,n].filter(Boolean);h(e,t,-1)}return[t,e]}(C[I],m);m=v[0],2!=v.length&&(v[2]?(C.splice(I+1,1,v[1],v[2]),I++):v[1]||(C.splice(I,1),I--))}C.length||p.splice(f,1)}}this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach((function(e){e[0].id=++this.$maxRev}),this)}var A=null;return(i=this.$redoStack.pop())&&(A=e.redoChanges(i,t),this.$undoStack.push(i),this.$syncRev()),this.$fromUndo=!1,A},this.$syncRev=function(){var e=(e=(e=this.$undoStack)[e.length-1])&&e[0].id||0;this.$redoStackBaseRev=e,this.$rev=e},this.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},this.canUndo=function(){return 0<this.$undoStack.length},this.canRedo=function(){return 0<this.$redoStack.length},this.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},this.isAtBookmark=function(){return this.$rev===this.mark},this.toJSON=function(){},this.fromJSON=function(){},this.hasUndo=this.canUndo,this.hasRedo=this.canRedo,this.isClean=this.isAtBookmark,this.markClean=this.bookmark,this.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)}}).call(n.prototype);var r=e("./range").Range,o=r.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(0<=o(t.start,e.end))h(t,e,-1);else{if(!(o(t.start,e.start)<=0))return;h(e,t,1)}else if(i&&!n)if(0<=o(t.start,e.end))h(t,e,-1);else{if(!(o(t.end,e.start)<=0))return;h(e,t,-1)}else if(!i&&n)if(0<=o(t.start,e.start))h(t,e,1);else{if(!(o(t.start,e.start)<=0))return;h(e,t,1)}else if(!i&&!n)if(0<=o(t.start,e.start))h(t,e,1);else{if(!(o(t.end,e.start)<=0))return;h(e,t,-1)}return 1}function h(e,t,i){d(e.start,t.start,t.end,i),d(e.end,t.start,t.end,i)}function d(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 u(e,t){var i=e.lines,n=e.end,r=(e.end=s(t),e.end.row-e.start.row),o=i.splice(r,i.length);r=r?t.column:t.column-e.start.column;return i.push(o[0].substring(0,r)),o[0]=o[0].substr(r),{start:s(t),end:n,lines:o,action:e.action}}r.comparePoints,t.UndoManager=n})),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";function n(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}var r=e("../lib/dom");(function(){this.moveContainer=function(e){r.translate(this.element,0,-e.firstRowScreen*e.lineHeight%this.canvasHeight-e.offset*this.$offsetCoefficient)},this.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},this.computeLineTop=function(e,t,i){var n=t.firstRowScreen*t.lineHeight;n=Math.floor(n/this.canvasHeight);return i.documentToScreenRow(e,0)*t.lineHeight-n*this.canvasHeight},this.computeLineHeight=function(e,t,i){return t.lineHeight*i.getRowLineCount(e)},this.getLength=function(){return this.cells.length},this.get=function(e){return this.cells[e]},this.shift=function(){this.$cacheCell(this.cells.shift())},this.pop=function(){this.$cacheCell(this.cells.pop())},this.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=r.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)},this.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);for(var t=r.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)},this.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},this.$cacheCell=function(e){e&&(e.element.remove(),this.cellCache.push(e))},this.createCell=function(e,t,i,n){var o,s=this.cellCache.pop();return s||(o=r.createElement("div"),n&&n(o),this.element.appendChild(o),s={element:o,text:"",row:e}),s.row=e,s}}).call(n.prototype),t.Lines=n})),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines"],(function(e,t,i){"use strict";function n(e){this.element=r.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 l(this.element),this.$lines.$offsetCoefficient=1}var r=e("../lib/dom"),o=e("../lib/oop"),s=e("../lib/lang"),a=e("../lib/event_emitter").EventEmitter,l=e("./lines").Lines;function c(e){var t=document.createTextNode("");e.appendChild(t),t=r.createElement("span");return e.appendChild(t),e}(function(){o.implement(this,a),this.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),(this.session=e)&&e.on("change",this.$updateAnnotations)},this.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,t)},this.setAnnotations=function(e){this.$annotations=[];for(var t=0;t<e.length;t++){var i=e[t],n=i.row,r=(r=this.$annotations[n])||(this.$annotations[n]={text:[]});n=(n=i.text)?s.escapeHTML(n):i.html||"";"error"==(n=(-1===r.text.indexOf(n)&&r.text.push(n),i.type))?r.className=" ace_error":"warning"==n&&" ace_error"!=r.className?r.className=" ace_warning":"info"!=n||r.className||(r.className=" ace_info")}},this.$updateAnnotations=function(e){var t,i;this.$annotations.length&&(t=e.start.row,0!=(i=e.end.row-t)&&("remove"==e.action?this.$annotations.splice(t,1+i,null):((e=new Array(1+i)).unshift(t,1),this.$annotations.splice.apply(this.$annotations,e))))},this.update=function(e){this.config=e;for(var t=this.session,i=e.firstRow,n=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1),r=(this.oldLastRow=n,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow(),t.getNextFoldLine(i)),o=r?r.start.row:1/0,s=null,a=-1,l=i;;){if(o<l&&(l=r.end.row+1,o=(r=t.getNextFoldLine(l,r))?r.start.row:1/0),n<l){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,c),this.$lines.push(s)),this.$renderCell(s,e,r,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},this.$updateGutterWidth=function(e){var t=this.session,i=t.gutterRenderer||this.$renderer,n=t.$firstLineNumber,r=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(r=t.getLength()+n-1),n=i?i.getWidth(t,r,e):r.toString().length*e.characterWidth;(n+=(i=this.$padding||this.$computePadding()).left+i.right)===this.gutterWidth||isNaN(n)||(this.gutterWidth=n,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",n))},this.$updateCursorRow=function(){var e;this.$highlightGutterLine&&(e=this.session.selection.getCursor(),this.$cursorRow!==e.row&&(this.$cursorRow=e.row))},this.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 r=this.session.getFoldLine(this.$cursorRow);if(!(0<i&&r&&r.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}}}}},this.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 r=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);0<r;r--)this.$lines.shift();if(i<n)for(r=this.session.getFoldedRowCount(i+1,n);0<r;r--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1)),n<i&&this.$lines.push(this.$renderLines(e,n+1,i)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},this.$renderLines=function(e,t,i){for(var n=[],r=t,o=this.session.getNextFoldLine(r),s=o?o.start.row:1/0;s<r&&(r=o.end.row+1,s=(o=this.session.getNextFoldLine(r,o))?o.start.row:1/0),!(i<r);){var a=this.$lines.createCell(r,e,this.session,c);this.$renderCell(a,e,o,r),n.push(a),r++}return n},this.$renderCell=function(e,t,i,n){var o,s=e.element,a=this.session,l=s.childNodes[0],c=s.childNodes[1],h=a.$firstLineNumber,d=a.$breakpoints,u=a.$decorations,g=a.gutterRenderer||this.$renderer,p=this.$showFoldWidgets&&a.foldWidgets,m=i?i.start.row:Number.MAX_VALUE,f="ace_gutter-cell ";return(u=(this.$highlightGutterLine&&(n==this.$cursorRow||i&&n<this.$cursorRow&&m<=n&&this.$cursorRow<=i.end.row)&&(f+="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)),d[n]&&(f+=d[n]),u[n]&&(f+=u[n]),this.$annotations[n]&&(f+=this.$annotations[n].className),s.className!=f&&(s.className=f),!p||null==(o=p[n])&&(o=p[n]=a.getFoldWidget(n)),o?(f="ace_fold-widget ace_"+o,"start"==o&&n==m&&n<i.end.row?f+=" ace_closed":f+=" ace_open",c.className!=f&&(c.className=f),d=t.lineHeight+"px",r.setStyle(c.style,"height",d),r.setStyle(c.style,"display","inline-block")):c&&r.setStyle(c.style,"display","none"),(g?g.getText(a,n):n+h).toString()))!==l.data&&(l.data=u),r.setStyle(e.element.style,"height",this.$lines.computeLineHeight(n,t,a)+"px"),r.setStyle(e.element.style,"top",this.$lines.computeLineTop(n,t,a)+"px"),e.text=u,e},this.$fixedWidth=!1,this.$highlightGutterLine=!0,this.$renderer="",this.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},this.$showLineNumbers=!0,this.$renderer="",this.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},this.getShowLineNumbers=function(){return this.$showLineNumbers},this.$showFoldWidgets=!0,this.setShowFoldWidgets=function(e){e?r.addCssClass(this.element,"ace_folding-enabled"):r.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},this.getShowFoldWidgets=function(){return this.$showFoldWidgets},this.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=r.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},this.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}}).call(n.prototype),t.Gutter=n})),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],(function(e,t,i){"use strict";function n(e){this.element=o.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}var r=e("../range").Range,o=e("../lib/dom");(function(){this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setMarkers=function(e){this.markers=e},this.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},this.update=function(e){if(e){var t,i;for(i in this.config=e,this.i=0,this.markers){var n,r,o,s=this.markers[i];s.range?(o=s.range.clipRows(e.firstRow,e.lastRow)).isEmpty()||(o=o.toScreenRange(this.session),s.renderer?(n=this.$getTop(o.start.row,e),r=this.$padding+o.start.column*e.characterWidth,s.renderer(t,o,r,n,e)):"fullLine"==s.type?this.drawFullLineMarker(t,o,s.clazz,e):"screenLine"==s.type?this.drawScreenLineMarker(t,o,s.clazz,e):o.isMultiLine()?"text"==s.type?this.drawTextMarker(t,o,s.clazz,e):this.drawMultiLineMarker(t,o,s.clazz,e):this.drawSingleLineMarker(t,o,s.clazz+" ace_start ace_br15",e)):s.update(t,this,this.session,e)}if(-1!=this.i)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},this.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},this.drawTextMarker=function(e,t,i,n,o){for(var s,a=this.session,l=t.start.row,c=t.end.row,h=l,d=0,u=a.getScreenLastRowColumn(h),g=new r(h,t.start.column,h,d);h<=c;h++)g.start.row=g.end.row=h,g.start.column=h==l?t.start.column:a.getRowWrapIndent(h),g.end.column=u,s=d,d=u,u=h+1<c?a.getScreenLastRowColumn(h+1):h==c?0:t.end.column,this.drawSingleLineMarker(e,g,i+(h==l?" ace_start":"")+" ace_br"+((h==l||h==l+1&&t.start.column?1:0)|(s<d?2:0)|(u<d?4:0)|(h==c?8:0)),n,h==c?0:1,o)},this.drawMultiLineMarker=function(e,t,i,n,r){var o,s=this.$padding,a=n.lineHeight,l=this.$getTop(t.start.row,n),c=s+t.start.column*n.characterWidth;r=r||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((o=t.clone()).end.row=o.start.row,o.end.column=this.session.getLine(o.start.row).length,this.drawBidiSingleLineMarker(e,o,i+" ace_br1 ace_start",n,null,r)):this.elt(i+" ace_br1 ace_start","height:"+a+"px;right:0;top:"+l+"px;left:"+c+"px;"+(r||"")),this.session.$bidiHandler.isBidiRow(t.end.row)?((o=t.clone()).start.row=o.end.row,o.start.column=0,this.drawBidiSingleLineMarker(e,o,i+" ace_br12",n,null,r)):(l=this.$getTop(t.end.row,n),c=t.end.column*n.characterWidth,this.elt(i+" ace_br12","height:"+a+"px;width:"+c+"px;top:"+l+"px;left:"+s+"px;"+(r||""))),(a=(t.end.row-t.start.row-1)*n.lineHeight)<=0||(l=this.$getTop(t.start.row+1,n),e=(t.start.column?1:0)|(t.end.column?0:8),this.elt(i+(e?" ace_br"+e:""),"height:"+a+"px;right:0;top:"+l+"px;left:"+s+"px;"+(r||"")))},this.drawSingleLineMarker=function(e,t,i,n,r,o){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,i,n,r,o);e=n.lineHeight,r=(t.end.column+(r||0)-t.start.column)*n.characterWidth;var s=this.$getTop(t.start.row,n);t=this.$padding+t.start.column*n.characterWidth;this.elt(i,"height:"+e+"px;width:"+r+"px;top:"+s+"px;left:"+t+"px;"+(o||""))},this.drawBidiSingleLineMarker=function(e,t,i,n,r,o){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+(r||0)+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(o||""))}),this)},this.drawFullLineMarker=function(e,t,i,n,r){var o=this.$getTop(t.start.row,n),s=n.lineHeight;t.start.row!=t.end.row&&(s+=this.$getTop(t.end.row,n)-o),this.elt(i,"height:"+s+"px;top:"+o+"px;left:0;right:0;"+(r||""))},this.drawScreenLineMarker=function(e,t,i,n,r){t=this.$getTop(t.start.row,n),n=n.lineHeight,this.elt(i,"height:"+n+"px;top:"+t+"px;left:0;right:0;"+(r||""))}}).call(n.prototype),t.Marker=n})),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter"],(function(e,t,i){"use strict";function n(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 a(this.element)}var r=e("../lib/oop"),o=e("../lib/dom"),s=e("../lib/lang"),a=e("./lines").Lines,l=e("../lib/event_emitter").EventEmitter;(function(){r.implement(this,l),this.EOF_CHAR="¶",this.EOL_CHAR_LF="¬",this.EOL_CHAR_CRLF="¤",this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR="—",this.SPACE_CHAR="·",this.$padding=0,this.MAX_LINE_LENGTH=1e4,this.$updateEolChar=function(){var e="\n"==(e=this.session.doc).getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=e)return this.EOL_CHAR=e,!0},this.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(e){(this.session=e)&&this.$computeTabString()},this.showInvisibles=!1,this.showSpaces=!1,this.showTabs=!1,this.showEOL=!1,this.setShowInvisibles=function(e){return this.showInvisibles!=e&&("string"==typeof(this.showInvisibles=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)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){for(var e,t,i,n,r,o,a=this.session.getTabSize(),l=(this.tabSize=a,this.$tabStrings=[0]),c=1;c<a+1;c++)this.showTabs?((o=this.dom.createElement("span")).className="ace_invisible ace_invisible_tab",o.textContent=s.stringRepeat(this.TAB_CHAR,c),l.push(o)):l.push(this.dom.createTextNode(s.stringRepeat(" ",c),this.element));this.displayIndentGuides&&(this.$indentGuideRe=/\s\S| \t|\t |\s$/,e="ace_indent-guide",t=this.showSpaces?" ace_invisible ace_invisible_space":"",i=this.showSpaces?s.stringRepeat(this.SPACE_CHAR,this.tabSize):s.stringRepeat(" ",this.tabSize),n=this.showTabs?" ace_invisible ace_invisible_tab":"",r=this.showTabs?s.stringRepeat(this.TAB_CHAR,this.tabSize):i,(o=this.dom.createElement("span")).className=e+t,o.textContent=i,this.$tabStrings[" "]=o,(o=this.dom.createElement("span")).className=e+n,o.textContent=r,this.$tabStrings["\t"]=o)},this.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),r=Math.min(i,e.lastRow),o=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);h<a&&(a=l.end.row+1,h=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(r<a);){var d,u=o[s++];u&&(this.dom.removeChildren(u),this.$renderLine(u,a,a==h&&l),c&&(u.style.top=this.$lines.computeLineTop(a,e,this.session)+"px"),d=e.lineHeight*this.session.getRowLength(a)+"px",u.style.height!=d&&(c=!0,u.style.height=d)),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"}},this.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 r=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);0<r;r--)this.$lines.shift();if(t.lastRow>e.lastRow)for(r=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);0<r;r--)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.$renderLinesFragment=function(e,t,i){for(var n=[],r=t,s=this.session.getNextFoldLine(r),a=s?s.start.row:1/0;a<r&&(r=s.end.row+1,a=(s=this.session.getNextFoldLine(r,s))?s.start.row:1/0),!(i<r);){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},this.update=function(e){this.$lines.moveContainer(e);for(var t=(this.config=e).firstRow,i=e.lastRow,n=this.$lines;n.getLength();)n.pop();n.push(this.$renderLinesFragment(e,t,i))},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(e,t,i,n){for(var r,o,a=this,l=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC]+)|(\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,c=this.dom.createFragment(this.element),h=0;r=l.exec(n);){var d,u,g=r[1],p=r[2],m=r[3],f=r[4],C=r[5];!a.showSpaces&&p||(d=h!=r.index?n.slice(h,r.index):"",h=r.index+r[0].length,d&&c.appendChild(this.dom.createTextNode(d,this.element)),g?(d=a.session.getScreenTabSize(t+r.index),c.appendChild(a.$tabStrings[d].cloneNode(!0)),t+=d-1):p?a.showSpaces?((u=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",u.textContent=s.stringRepeat(a.SPACE_CHAR,p.length),c.appendChild(u)):c.appendChild(this.com.createTextNode(p,this.element)):m?((u=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",u.textContent=s.stringRepeat(a.SPACE_CHAR,m.length),c.appendChild(u)):f?(t+=1,(u=this.dom.createElement("span")).style.width=2*a.config.characterWidth+"px",u.className=a.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",u.textContent=a.showSpaces?a.SPACE_CHAR:f,c.appendChild(u)):C&&(t+=1,(u=this.dom.createElement("span")).style.width=2*a.config.characterWidth+"px",u.className="ace_cjk",u.textContent=C,c.appendChild(u)))}return c.appendChild(this.dom.createTextNode(h?n.slice(h):n,this.element)),this.$textToken[i.type]?e.appendChild(c):(o="ace_"+i.type.replace(/\./g," ace_"),u=this.dom.createElement("span"),"fold"==i.type&&(u.style.width=i.value.length*this.config.characterWidth+"px"),u.className=o,u.appendChild(c),e.appendChild(u)),t+n.length},this.renderIndentGuide=function(e,t,i){var n=t.search(this.$indentGuideRe);if(n<=0||i<=n)return t;if(" "==t[0]){for(var r=(n-=n%this.tabSize)/this.tabSize,o=0;o<r;o++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return t.substr(n)}if("\t"!=t[0])return t;for(o=0;o<n;o++)e.appendChild(this.$tabStrings["\t"].cloneNode(!0));return t.substr(n)},this.$createLineElement=function(e){var t=this.dom.createElement("div");return t.className="ace_line",t.style.height=this.config.lineHeight+"px",t},this.$renderWrappedLine=function(e,t,i){var n=0,r=0,o=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,o)))continue;n-=d.length}if(n+d.length<o)a=this.$renderToken(l,a,h,d),n+=d.length;else{for(;n+d.length>=o;)a=this.$renderToken(l,a,h,d.substring(0,o-n)),d=d.substring(o-n),n=o,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(s.stringRepeat(" ",i.indent),this.element)),a=0,o=i[++r]||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)},this.$renderSimpleLine=function(e,t){var i=0,n=t[0],r=n.value;(r=this.displayIndentGuides?this.renderIndentGuide(e,r):r)&&(i=this.$renderToken(e,i,n,r));for(var o=1;o<t.length;o++){if(i+(r=(n=t[o]).value).length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,i,n,r);i=this.$renderToken(e,i,n,r)}},this.$renderOverflowMessage=function(e,t,i,n,r){i&&this.$renderToken(e,t,i,n.slice(0,this.MAX_LINE_LENGTH-t)),(i=this.dom.createElement("span")).className="ace_inline_button ace_keyword ace_toggle_wrap",i.textContent=r?"<hide>":"<click to see more...>",e.appendChild(i)},this.$renderLine=function(e,t,i){var n,r,o=e;(n=(i=i||0==i?i:this.session.getFoldLine(t))?this.$getFoldLineTokens(t,i):this.session.getTokens(t)).length?(r=this.session.getRowSplitData(t))&&r.length?(this.$renderWrappedLine(e,n,r),o=e.lastChild):(o=e,this.$useLineGroups()&&(o=this.$createLineElement(),e.appendChild(o)),this.$renderSimpleLine(o,n)):this.$useLineGroups()&&(o=this.$createLineElement(),e.appendChild(o)),this.showEOL&&o&&(i&&(t=i.end.row),(r=this.dom.createElement("span")).className="ace_invisible ace_invisible_eol",r.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,o.appendChild(r))},this.$getFoldLineTokens=function(e,t){var i=this.session,n=[],r=i.getTokens(e);return t.walk((function(e,t,o,s,a){if(null!=e)n.push({type:"fold",value:e});else if((r=a?i.getTokens(t):r).length){for(var l,c=r,h=s,d=o,u=0,g=0;g+c[u].value.length<h;)if(g+=c[u].value.length,++u==c.length)return;for(g!=h&&((l=c[u].value.substring(h-g)).length>d-h&&(l=l.substring(0,d-h)),n.push({type:c[u].type,value:l}),g=h+l.length,u+=1);g<d&&u<c.length;)(l=c[u].value).length+g>d?n.push({type:c[u].type,value:l.substring(0,d-g)}):n.push(c[u]),g+=l.length,u+=1}}),t.end.row,this.session.getLine(t.end.row).length),n},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){}}).call(n.prototype),t.Text=n})),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";function n(e){this.element=r.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(),r.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}var r=e("../lib/dom");(function(){this.$updateOpacity=function(e){for(var t=this.cursors,i=t.length;i--;)r.setStyle(t[i].style,"opacity",e?"":"0")},this.$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&&r.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},this.$stopCssAnimation=function(){this.$isAnimating=!1,r.removeCssClass(this.element,"ace_animate-blinking")},this.$padding=0,this.setPadding=function(e){this.$padding=e},this.setSession=function(e){this.session=e},this.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},this.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},this.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,r.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},this.addCursor=function(){var e=r.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},this.removeCursor=function(){var e;if(1<this.cursors.length)return(e=this.cursors.pop()).parentNode.removeChild(e),e},this.hideCursor=function(){this.isVisible=!1,r.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.showCursor=function(){this.isVisible=!0,r.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},this.restartTimer=function(){var e,t=this.$updateCursors;clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,r.removeCssClass(this.element,"ace_smooth-blinking")),t(!0),this.isBlinking&&this.blinkInterval&&this.isVisible?(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&r.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),r.HAS_CSS_ANIMATION?this.$startCssAnimation():(e=function(){this.timeoutId=setTimeout((function(){t(!1)}),.6*this.blinkInterval)}.bind(this),this.intervalId=setInterval((function(){t(!0),e()}),this.blinkInterval),e())):this.$stopCssAnimation()},this.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}},this.isCursorInView=function(e,t){return 0<=e.top&&e.top<t.maxHeight},this.update=function(e){this.config=e;for(var t=this.session.$selectionMarkers,i=0,n=0,o=(i=0,(t=void 0!==t&&0!==t.length?t:[{cursor:null}]).length);i<o;i++){var s,a,l=this.getPixelPosition(t[i].cursor,!0);(l.top>e.height+e.offset||l.top<0)&&1<i||(a=(s=this.cursors[n++]||this.addCursor()).style,this.drawCursor?this.drawCursor(s,l,e,t[i],this.session):this.isCursorInView(l,e)?(r.setStyle(a,"display","block"),r.translate(s,l.left,l.top),r.setStyle(a,"width",Math.round(e.characterWidth)+"px"),r.setStyle(a,"height",e.lineHeight+"px")):r.setStyle(a,"display","none"))}for(;this.cursors.length>n;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=l,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(e){e!=this.overwrite&&((this.overwrite=e)?r.addCssClass(this.element,"ace_overwrite-cursors"):r.removeCssClass(this.element,"ace_overwrite-cursors"))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(n.prototype),t.Cursor=n})),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";function n(e){this.element=a.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix,this.inner=a.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,l.addListener(this.element,"scroll",this.onScroll.bind(this)),l.addListener(this.element,"mousedown",l.preventDefault)}function r(e,t){n.call(this,e),this.scrollTop=0,this.scrollHeight=0,t.$scrollbarWidth=this.width=a.scrollbarWidth(e.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+"px",this.$minWidth=0}function o(e,t){n.call(this,e),this.scrollLeft=0,this.height=t.$scrollbarWidth,this.inner.style.height=this.element.style.height=(this.height||15)+5+"px"}var s=e("./lib/oop"),a=e("./lib/dom"),l=e("./lib/event"),c=e("./lib/event_emitter").EventEmitter;(function(){s.implement(this,c),this.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1}}).call(n.prototype),s.inherits(r,n),function(){this.classSuffix="-v",this.onScroll=function(){var e;this.skipEvent||(this.scrollTop=this.element.scrollTop,1!=this.coeff&&(e=this.element.clientHeight/this.scrollHeight,this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)),this._emit("scroll",{data:this.scrollTop})),this.skipEvent=!1},this.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(e){this.element.style.height=e+"px"},this.setInnerHeight=this.setScrollHeight=function(e){32768<(this.scrollHeight=e)?(this.coeff=32768/e,e=32768):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},this.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)}}.call(r.prototype),s.inherits(o,n),function(){this.classSuffix="-h",this.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},this.getHeight=function(){return this.isVisible?this.height:0},this.setWidth=function(e){this.element.style.width=e+"px"},this.setInnerWidth=function(e){this.inner.style.width=e+"px"},this.setScrollWidth=function(e){this.inner.style.width=e+"px"},this.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)}}.call(o.prototype),t.ScrollBar=r,t.ScrollBarV=r,t.ScrollBarH=o,t.VScrollBar=r,t.HScrollBar=o})),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],(function(e,t,i){"use strict";function n(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;t&&(r.blockIdle(100),i.changes=0,i.onRender(t)),i.changes?i.$recursionLimit--<0||i.schedule():i.$recursionLimit=2}}var r=e("./lib/event");(function(){this.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(r.nextFrame(this._flush),this.pending=!0)},this.clear=function(e){var t=this.changes;return this.changes=0,t}}).call(n.prototype),t.RenderLoop=n})),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"),r=e("../lib/dom"),o=e("../lib/lang"),s=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,c="function"==typeof ResizeObserver;e=t.FontMetrics=function(e){this.el=r.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=r.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=r.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=o.stringRepeat("X",256),this.$characterSize={width:0,height:0},c?this.$addObserver():this.checkForSizeChanges()};(function(){n.implement(this,l),this.$characterSize={width:0,height:0},this.$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"},this.checkForSizeChanges=function(e){var t;!(e=void 0===e?this.$measureSizes():e)||this.$characterSize.width===e.width&&this.$characterSize.height===e.height||(this.$measureNode.style.fontWeight="bold",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}))},this.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver((function(t){e.checkForSizeChanges()})),this.$observer.observe(this.$measureNode)},this.$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)},this.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(e){return 0===(e={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/256}).width||0===e.height?null:e},this.$measureCharWidth=function(e){return this.$main.textContent=o.stringRepeat(e,256),this.$main.getBoundingClientRect().width/256},this.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t?this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width:t},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},this.$getZoom=function e(t){return t&&t.parentElement?(window.getComputedStyle(t).zoom||1)*e(t.parentElement):1},this.$initTransformMeasureNodes=function(){function e(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]}this.els=r.buildDom([e(0,0),e(200,0),e(0,200),e(200,200)],this.el)},this.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 r(e,t){return[e[0]+t[0],e[1]+t[1]]}function o(e,t){return[e*t[0],e*t[1]]}function s(e){return[(e=e.getBoundingClientRect()).left,e.top]}e=e&&o(1/this.$getZoom(this.el),e),this.els||this.$initTransformMeasureNodes();var a,l=s(this.els[0]),c=s(this.els[1]),h=s(this.els[2]);c=o(1+(a=i(n(a=s(this.els[3]),c),n(a,h),n(r(c,h),r(a,l))))[0],n(c,l)),h=o(1+a[1],n(h,l));if(t)return d=a[0]*t[0]/200+a[1]*t[1]/200+1,t=r(o(t[0],c),o(t[1],h)),r(o(1/d/200,t),l);var d=n(e,l);t=i(n(c,o(a[0],d)),n(h,o(a[1],d)),d);return o(200,t)}}).call(e.prototype)})),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/lib/useragent"],(function(e,t,i){"use strict";function n(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",!0),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),e=this.$textLayer=new c(this.content);this.canvas=e.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 p(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=!C.isIOS,this.$loop=new g(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),s.resetOptions(this),s._signal("renderer",this)}var r=e("./lib/oop"),o=e("./lib/dom"),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("./renderloop").RenderLoop,p=e("./layer/font_metrics").FontMetrics,m=e("./lib/event_emitter").EventEmitter,f='.ace_br1 {border-top-left-radius    : 3px;}.ace_br2 {border-top-right-radius   : 3px;}.ace_br3 {border-top-left-radius    : 3px; border-top-right-radius:    3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius    : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius   : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius    : 3px; border-bottom-left-radius:  3px;}.ace_br10{border-top-right-radius   : 3px; border-bottom-left-radius:  3px;}.ace_br11{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-left-radius:  3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br13{border-top-left-radius    : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br14{border-top-right-radius   : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}.ace_br15{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_editor {position: relative;overflow: hidden;padding: 0;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;box-sizing: border-box;min-width: 100%;contain: style size layout;font-variant-ligatures: no-common-ligatures;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;contain: style size layout;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {position: absolute;top: 0;left: 0;right: 0;padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {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==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {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==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {contain: strict;position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;contain: strict;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: transparent;color: inherit;z-index: 1000;opacity: 1;}.ace_composition_placeholder { color: transparent }.ace_composition_marker { border-bottom: 1px solid;position: absolute;border-radius: 0;margin-top: 1px;}[ace_nocontext=true] {transform: none!important;filter: none!important;clip-path: none!important;mask : none!important;contain: none!important;perspective: none!important;mix-blend-mode: initial!important;z-index: auto;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;height: 1000000px;contain: style size layout;}.ace_text-layer {font: inherit !important;position: absolute;height: 1000000px;width: 1000000px;contain: style size layout;}.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {contain: style size layout;position: absolute;top: 0;left: 0;right: 0;}.ace_hidpi .ace_text-layer,.ace_hidpi .ace_gutter-layer,.ace_hidpi .ace_content,.ace_hidpi .ace_gutter {contain: strict;will-change: transform;}.ace_hidpi .ace_text-layer > .ace_line, .ace_hidpi .ace_text-layer > .ace_line_group {contain: strict;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {opacity: 0;}.ace_smooth-blinking .ace_cursor {transition: opacity 0.18s;}.ace_animate-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: step-end;animation-name: blink-ace-animate;animation-iteration-count: infinite;}.ace_animate-blinking.ace_smooth-blinking .ace_cursor {animation-duration: 1000ms;animation-timing-function: ease-in-out;animation-name: blink-ace-animate-smooth;}@keyframes blink-ace-animate {from, to { opacity: 1; }60% { opacity: 0; }}@keyframes blink-ace-animate-smooth {from, to { opacity: 1; }45% { opacity: 1; }60% { opacity: 0; }85% { opacity: 0; }}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_error_bracket {position: absolute;border-bottom: 1px solid #DE5555;border-radius: 0;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;box-sizing: border-box;}.ace_line .ace_fold {box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block;   }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_inline_button {border: 1px solid lightgray;display: inline-block;margin: -1px 8px;padding: 0 5px;pointer-events: auto;cursor: pointer;}.ace_inline_button:hover {border-color: gray;background: rgba(200,200,200,0.2);display: inline-block;pointer-events: auto;}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_mobile-menu {position: absolute;line-height: 1.5;border-radius: 4px;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;background: white;box-shadow: 1px 3px 2px grey;border: 1px solid #dcdcdc;color: black;}.ace_dark > .ace_mobile-menu {background: #333;color: #ccc;box-shadow: 1px 3px 2px grey;border: 1px solid #444;}.ace_mobile-button {padding: 2px;cursor: pointer;overflow: hidden;}.ace_mobile-button:hover {background-color: #eee;opacity:1;}.ace_mobile-button:active {background-color: #ddd;}.ace_placeholder {font-family: arial;transform: scale(0.9);transform-origin: left;white-space: pre;opacity: 0.7;margin: 0 10px;}',C=e("./lib/useragent"),I=C.isIE;o.importCssString(f,"ace_editor.css",!1),function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,r.implement(this,m),this.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")},this.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),(this.session=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))},this.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)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(e,t,i,n){if(!(2<this.resizing)){0<this.resizing?this.resizing++:this.resizing=e?1:0;var r=this.container;r=(n=n||r.clientHeight||r.scrollHeight,i=i||r.clientWidth||r.scrollWidth,this.$updateCachedSize(e,t,i,n));if(!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.$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};return 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.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"),t=this.scrollBarV.getWidth()+"px",o.setStyle(this.scrollBarH.element.style,"right",t),o.setStyle(this.scroller.style,"right",t),o.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(r|=this.CHANGE_FULL)),s.$dirty=!i||!n,r&&this._signal("resize",a),r},this.onGutterResize=function(e){(e=this.$showGutter?e:0)!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,e,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},this.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding;e=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(e,this.$showPrintMargin&&this.$printMarginColumn)},this.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},this.getAnimatedScroll=function(){return this.$animatedScroll},this.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},this.getShowInvisibles=function(){return this.getOption("showInvisibles")},this.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},this.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},this.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},this.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},this.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},this.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},this.getShowGutter=function(){return this.getOption("showGutter")},this.setShowGutter=function(e){return this.setOption("showGutter",e)},this.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},this.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},this.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},this.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},this.$updatePrintMargin=function(){var e;(this.$showPrintMargin||this.$printMarginEl)&&(this.$printMarginEl||((e=o.createElement("div")).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)),(e=this.$printMarginEl.style).left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",e.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit())},this.getContainerElement=function(){return this.container},this.getMouseEventTarget=function(){return this.scroller},this.getTextAreaContainer=function(){return this.container},this.$moveTextAreaToCursor=function(){var e,t,i,n,r,s,a;this.$isMousePressed||(e=this.textarea.style,s=this.$composition,this.$keepTextAreaAtCursor||s?(i=this.$cursorLayer.$pixelPos)&&(s&&s.markerRange&&(i=this.$cursorLayer.getPixelPosition(s.markerRange.start,!0)),a=this.layerConfig,t=i.top,i=i.left,t-=a.offset,n=s&&s.useTextareaForIME?this.lineHeight:I?0:1,t<0||t>a.height-n?o.translate(this.textarea,0,0):(a=1,r=this.$size.height-n,s?s.useTextareaForIME?(s=this.textarea.value,a=this.characterWidth*this.session.$getStringScreenWidth(s)[0]):t+=this.lineHeight+2:t+=this.lineHeight,(i-=this.scrollLeft)>this.$size.scrollerWidth-a&&(i=this.$size.scrollerWidth-a),i+=this.gutterWidth+this.margin.left,o.setStyle(e,"height",n+"px"),o.setStyle(e,"width",a+"px"),o.translate(this.textarea,Math.min(i,this.$size.scrollerWidth-a),Math.min(t,r)))):o.translate(this.textarea,-100,0))},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.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},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.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()},this.setScrollMargin=function(e,t,i,n){var r=this.scrollMargin;r.top=0|e,r.bottom=0|t,r.right=0|n,r.left=0|i,r.v=r.top+r.bottom,r.h=r.left+r.right,r.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-r.top),this.updateFull()},this.setMargin=function(e,t,i,n){var r=this.margin;r.top=0|e,r.bottom=0|t,r.right=0|n,r.left=0|i,r.v=r.top+r.bottom,r.h=r.left+r.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},this.$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)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$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,n;t=this.layerConfig;return(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)&&(e|=this.$computeLayerConfig()|this.$loop.clear(),t.firstRow!=this.layerConfig.firstRow&&t.firstRowScreen==this.layerConfig.firstRowScreen&&0<(i=this.scrollTop+(t.firstRow-this.layerConfig.firstRow)*this.lineHeight)&&(this.scrollTop=i,e=(e|=this.CHANGE_SCROLL)|this.$computeLayerConfig()|this.$loop.clear()),t=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),o.translate(this.content,-this.scrollLeft,-t.offset),i=t.width+2*this.$padding+"px",n=t.minHeight+"px",o.setStyle(this.content.style,"width",i),o.setStyle(this.content.style,"height",n)),e&this.CHANGE_H_SCROLL&&(o.translate(this.content,-this.scrollLeft,-t.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller":"ace_scroller ace_scroll-left"),e&this.CHANGE_FULL?(this.$changedLines=null,this.$textLayer.update(t),this.$showGutter&&this.$gutterLayer.update(t),this.$markerBack.update(t),this.$markerFront.update(t),this.$cursorLayer.update(t),this.$moveTextAreaToCursor(),void this._signal("afterRender",e)):(e&this.CHANGE_SCROLL?(this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(t):this.$textLayer.scrollLines(t),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(t):this.$gutterLayer.scrollLines(t)),this.$markerBack.update(t),this.$markerFront.update(t),this.$cursorLayer.update(t),this.$moveTextAreaToCursor()):(e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(t),this.$showGutter&&this.$gutterLayer.update(t)):e&this.CHANGE_LINES?(this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(t):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?this.$showGutter&&this.$gutterLayer.update(t):e&this.CHANGE_CURSOR&&this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(t),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(t),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(t),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(t)),void this._signal("afterRender",e))}this.$changes|=e},this.$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()),t=!((i=this.$maxPixelHeight&&i>this.$maxPixelHeight?this.$maxPixelHeight:i)<=2*this.lineHeight)&&t<e,i==this.desiredHeight&&this.$size.height==this.desiredHeight&&t==this.$vScroll||(t!=this.$vScroll&&(this.$vScroll=t,this.scrollBarV.setVisible(t)),e=this.container.clientWidth,this.container.style.height=i+"px",this.$updateCachedSize(!0,this.$gutterWidth,e,i),this.desiredHeight=i,this._signal("autosize"))},this.$computeLayerConfig=function(){var e,t,i=this.session,n=this.$size,r=n.height<=2*this.lineHeight,o=this.session.getScreenLength()*this.lineHeight,s=this.$getLongestLine(),a=!r&&(this.$hScrollBarAlwaysVisible||n.scrollerWidth-s-2*this.$padding<0),l=this.$horizScroll!==a,c=(a=(l&&(this.$horizScroll=a,this.scrollBarH.setVisible(a)),this.$vScroll),this.$maxLines&&1<this.lineHeight&&this.$autosize(),n.scrollerHeight+this.lineHeight),h=(o+=t=!this.$maxLines&&this.$scrollPastEnd?(n.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0,this.scrollMargin),d=(h=((t=a!==(r=(this.session.setScrollTop(Math.max(-h.top,Math.min(this.scrollTop,o-n.scrollerHeight+h.bottom))),this.session.setScrollLeft(Math.max(-h.left,Math.min(this.scrollLeft,s+2*this.$padding-n.scrollerWidth+h.right))),!r&&(this.$vScrollBarAlwaysVisible||n.scrollerHeight-o+t<0||this.scrollTop>h.top))))&&(this.$vScroll=r,this.scrollBarV.setVisible(r)),this.scrollTop%this.lineHeight),a=Math.ceil(c/this.lineHeight)-1,a=(r=Math.max(0,Math.round((this.scrollTop-h)/this.lineHeight)))+a,this.lineHeight),u=(r=i.screenToDocumentRow(r,0),i.getFoldLine(r));u&&(r=u.start.row),u=i.documentToScreenRow(r,0),e=i.getRowLength(r)*d,a=Math.min(i.screenToDocumentRow(a,0),i.getLength()-1),c=n.scrollerHeight+i.getRowLength(a)*d+e,h=this.scrollTop-u*d,i=0;return this.layerConfig.width==s&&!l||(i=this.CHANGE_H_SCROLL),(l||t)&&(i|=this.$updateCachedSize(!0,this.gutterWidth,n.width,n.height),this._signal("scrollbarVisibilityChanged"),t&&(s=this.$getLongestLine())),this.layerConfig={width:s,padding:this.$padding,firstRow:r,firstRowScreen:u,lastRow:a,lineHeight:d,characterWidth:this.characterWidth,minHeight:c,maxHeight:o,offset:h,gutterOffset:d?Math.max(0,Math.ceil((h+n.height-n.scrollerHeight)/d)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(s-this.$padding),i},this.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow,i=(this.$changedLines=null,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)}},this.$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))},this.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},this.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},this.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},this.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},this.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},this.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},this.hideCursor=function(){this.$cursorLayer.hideCursor()},this.showCursor=function(){this.$cursorLayer.showCursor()},this.scrollSelectionIntoView=function(e,t,i){this.scrollCursorIntoView(e,i),this.scrollCursorIntoView(t,i)},this.scrollCursorIntoView=function(e,t,i){var n,r,o;0!==this.$size.scrollerHeight&&(n=(e=this.$cursorLayer.getPixelPosition(e)).left,e=e.top,o=i&&i.top||0,i=i&&i.bottom||0,e<(r=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop)+o?(t&&r+o>e+this.lineHeight&&(e-=t*this.$size.scrollerHeight),0===e&&(e=-this.scrollMargin.top),this.session.setScrollTop(e)):r+this.$size.scrollerHeight-i<e+this.lineHeight&&(t&&r+this.$size.scrollerHeight-i<e-this.lineHeight&&(e+=t*this.$size.scrollerHeight),this.session.setScrollTop(e+this.lineHeight+i-this.$size.scrollerHeight)),n<(o=this.scrollLeft)?(n<this.$padding+2*this.layerConfig.characterWidth&&(n=-this.scrollMargin.left),this.session.setScrollLeft(n)):o+this.$size.scrollerWidth<n+this.characterWidth?this.session.setScrollLeft(Math.round(n+this.characterWidth-this.$size.scrollerWidth)):o<=this.$padding&&n-o<this.characterWidth&&this.session.setScrollLeft(0))},this.getScrollTop=function(){return this.session.getScrollTop()},this.getScrollLeft=function(){return this.session.getScrollLeft()},this.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},this.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},this.scrollToRow=function(e){this.session.setScrollTop(e*this.lineHeight)},this.alignCursor=function(e,t){e=this.$cursorLayer.getPixelPosition(e="number"==typeof e?{row:e,column:0}:e);var i=this.$size.scrollerHeight-this.lineHeight;e=e.top-i*(t||0);return this.session.setScrollTop(e),e},this.STEPS=8,this.$calcSteps=function(e,t){var i,n,r=0,o=this.STEPS,s=[];for(r=0;r<o;++r)s.push((i=r/this.STEPS,(t-(n=e))*(Math.pow(i-1,3)+1)+n));return s},this.scrollToLine=function(e,t,i,n){e=this.$cursorLayer.getPixelPosition({row:e,column:0}).top,t&&(e-=this.$size.scrollerHeight/2),t=this.scrollTop,this.session.setScrollTop(e),!1!==i&&this.animateScrolling(t,n)},this.animateScrolling=function(e,t){var i=this.scrollTop;if(this.$animatedScroll){var n=this;if(e!=i){if(this.$scrollAnimation){var r=this.$scrollAnimation.steps;if(r.length&&(e=r[0])==i)return}var o=n.$calcSteps(e,i);this.$scrollAnimation={from:e,to:i,steps:o},clearInterval(this.$timer),n.session.setScrollTop(o.shift()),n.session.$scrollTop=i,this.$timer=setInterval((function(){if(!n.session)return clearInterval(n.$timer);o.length?(n.session.setScrollTop(o.shift()),n.session.$scrollTop=i):null!=i?(n.session.$scrollTop=-1,n.session.setScrollTop(i),i=null):(n.$timer=clearInterval(n.$timer),n.$scrollAnimation=null,t&&t())}),10)}}},this.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},this.scrollToX=function(e){this.scrollLeft!==e&&(this.scrollLeft=e),this.$loop.schedule(this.CHANGE_H_SCROLL)},this.scrollTo=function(e,t){this.session.setScrollTop(t),this.session.setScrollLeft(e)},this.scrollBy=function(e,t){t&&this.session.setScrollTop(this.session.getScrollTop()+t),e&&this.session.setScrollLeft(this.session.getScrollLeft()+e)},this.isScrollableBy=function(e,t){return t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||0<t&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||0<e&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},this.pixelToScreenCoordinates=function(e,t){this.$hasCssTransforms?(n={top:0,left:0},e=(i=this.$fontMetrics.transformCoordinates([e,t]))[1]-this.gutterWidth-this.margin.left,t=i[0]):n=this.scroller.getBoundingClientRect();var i=e+this.scrollLeft-n.left-this.$padding,n=(e=i/this.characterWidth,t=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),this.$blockCursor?Math.floor(e):Math.round(e));return{row:t,column:n,side:0<e-n?1:-1,offsetX:i}},this.screenToTextCoordinates=function(e,t){this.$hasCssTransforms?(i={top:0,left:0},e=(n=this.$fontMetrics.transformCoordinates([e,t]))[1]-this.gutterWidth-this.margin.left,t=n[0]):i=this.scroller.getBoundingClientRect();var i,n=e+this.scrollLeft-i.left-this.$padding;e=n/this.characterWidth,e=this.$blockCursor?Math.floor(e):Math.round(e),t=Math.floor((t+this.scrollTop-i.top)/this.lineHeight);return this.session.screenToDocumentPosition(t,Math.max(e,0),n)},this.textToScreenCoordinates=function(e,t){var i=this.scroller.getBoundingClientRect();t=this.session.documentToScreenPosition(e,t),e=this.$padding+(this.session.$bidiHandler.isBidiRow(t.row,e)?this.session.$bidiHandler.getPosLeft(t.column):Math.round(t.column*this.characterWidth)),t=t.row*this.lineHeight;return{pageX:i.left+e-this.scrollLeft,pageY:i.top+t-this.scrollTop}},this.visualizeFocus=function(){o.addCssClass(this.container,"ace_focus")},this.visualizeBlur=function(){o.removeCssClass(this.container,"ace_focus")},this.showComposition=function(e){(this.$composition=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")},this.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},this.hideComposition=function(){var e;this.$composition&&(this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),o.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText,e=this.session.selection.cursor,this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display="")},this.addToken=function(e,t,i,n){var r=this.session,o=(r.bgTokenizer.lines[i]=null,{type:t,value:e}),s=r.getTokens(i);if(null==n)s.push(o);else 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);h=c.value.slice(h);s.splice(l,1,{type:c.type,value:d},o,{type:c.type,value:h});break}}this.updateLines(i,i)},this.removeExtraToken=function(e,t){this.updateLines(e,e)},this.setTheme=function(e,t){var i,n=this;function r(i){if(n.$themeId!=e)return t&&t();if(!i||!i.cssClass)throw new Error("couldn't load module "+e+" or it didn't call define");i.$id&&(n.$themeId=i.$id),o.importCssString(i.cssText,i.cssClass,n.container),n.theme&&o.removeCssClass(n.container,n.theme.cssClass);var r="padding"in i?i.padding:"padding"in(n.theme||{})?4:n.$padding;n.$padding&&r!=n.$padding&&n.setPadding(r),n.$theme=i.cssClass,n.theme=i,o.addCssClass(n.container,i.cssClass),o.setCssClass(n.container,"ace_dark",i.isDark),n.$size&&(n.$size.width=0,n.$updateSizeAsync()),n._dispatchEvent("themeLoaded",{theme:i}),t&&t()}this.$themeId=e,n._dispatchEvent("themeChange",{theme:e}),e&&"string"!=typeof e?r(e):(i=e||this.$options.theme.initialValue,s.loadModule(["theme",i],r))},this.getTheme=function(){return this.$themeId},this.setStyle=function(e,t){o.setCssClass(this.container,e,!1!==t)},this.unsetStyle=function(e){o.removeCssClass(this.container,e)},this.setCursorStyle=function(e){o.setStyle(this.scroller.style,"cursor",e)},this.setMouseCursor=function(e){o.setStyle(this.scroller.style,"cursor",e)},this.attachToShadowRoot=function(){o.importCssString(f,"ace_editor.css",this.container)},this.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent=""}}.call(n.prototype),s.defineOptions(n.prototype,"renderer",{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},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},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){this.$scrollPastEnd!=(e=+e||0)&&(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)}},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!C.isMobile&&!C.isIE}}),t.VirtualRenderer=n})),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"),r=e("../lib/net"),o=e("../lib/event_emitter").EventEmitter,s=e("../config");function a(e){return"undefined"==typeof Worker?{postMessage:function(){},terminate:function(){}}:s.get("loadWorkerFromBlob")?(t=function(e){e="importScripts('"+r.qualifyURL(e)+"');";try{return new Blob([e],{type:"application/javascript"})}catch(i){var t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return t.append(e),t.getBlob("application/javascript")}}(e),t=(window.URL||window.webkitURL).createObjectURL(t),new Worker(t)):new Worker(e);var t}function l(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,o),this.$createWorkerFromOldConfig=function(t,i,n,r,o){var l,c;return e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),s.get("packaged")||!e.toUrl?r=r||s.moduleUrl(i,"worker"):(l=this.$normalizePath,r=r||l(e.toUrl("ace/worker/worker.js",null,"_")),c={},t.forEach((function(t){c[t]=l(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))}))),this.$worker=a(r),o&&this.send("importScripts",o),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 r.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),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){var n;i&&(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.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)},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,50<e.length&&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,r=!1,a=Object.create(o),c=[],h=new l({messageBuffer:c,terminate:function(){},postMessage:function(e){c.push(e),n&&(r?setTimeout(d):d())}}),d=(h.setEmitSync=function(e){r=e},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";function n(e,t,i,n,r,o){var s=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=r,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate),this.$others=n,this.$onCursorChange=function(){setTimeout((function(){s.onCursorChange()}))},this.$pos=i,t=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=t.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}var r=e("./range").Range,o=e("./lib/event_emitter").EventEmitter,s=e("./lib/oop");(function(){s.implement(this,o),this.setup=function(){var e=this,t=this.doc,i=this.session,n=(this.selectionBefore=i.selection.toJSON(),i.selection.inMultiSelectMode&&i.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column),this.pos);n.$insertRight=!0,n.detach(),n.markerId=i.addMarker(new r(n.row,n.column,n.row,n.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach((function(i){(i=t.createAnchor(i.row,i.column)).$insertRight=!0,i.detach(),e.others.push(i)})),i.setUndoSelect(!1)},this.showOtherMarkers=function(){var e,t;this.othersActive||(e=this.session,(t=this).othersActive=!0,this.others.forEach((function(i){i.markerId=e.addMarker(new r(i.row,i.column,i.row,i.column+t.length),t.othersClass,null,!1)})))},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},this.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,n=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,o=t.start.column-this.pos.column;if(this.updateAnchors(e),n&&(this.length+=i),n&&!this.session.$fromUndo)if("insert"===e.action)for(var s=this.others.length-1;0<=s;s--){var a={row:(l=this.others[s]).row,column:l.column+o};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(s=this.others.length-1;0<=s;s--){var l;a={row:(l=this.others[s]).row,column:l.column+o};this.doc.remove(new r(a.row,a.column,a.row,a.column-i))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,i=function(i,n){t.removeMarker(i.markerId),i.markerId=t.addMarker(new r(i.row,i.column,i.row,i.column+e.length),n,null,!1)};i(this.pos,this.mainClass);for(var n=this.others.length;n--;)i(this.others[n],this.othersClass)}},this.onCursorChange=function(e){var t;!this.$updating&&this.session&&((t=this.session.selection.getCursor()).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)))},this.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},this.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)}}}).call(n.prototype),t.PlaceHolder=n})),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"),r=e("../lib/useragent");function o(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&&r.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,u,g,p,m,f,C,I=e.editor,v=I.selection,A=I.inMultiSelectMode,b=e.getDocumentPosition(),y=v.getCursor(),w=(y=e.inSelection()||v.isEmpty()&&o(b,y),e.x),S=e.y,x=I.session,k=I.renderer.pixelToScreenCoordinates(w,S),E=k;if(I.$mouseHandler.$enableJumpToDef)a&&i||l&&i?h=s?"block":"add":i&&I.$blockSelectEnabled&&(h="block");else if(l&&!i){if(h="add",!A&&s)return}else i&&I.$blockSelectEnabled&&(h="block");if(h&&r.isMac&&t.ctrlKey&&I.$mouseHandler.cancelContextMenu(),"add"==h)!A&&y||(A||(d=v.toOrientedRange(),I.addSelectionMarker(d)),u=v.rangeList.rangeAtPoint(b),I.inVirtualSelectionMode=!0,s&&(u=null,d=v.ranges[0]||d,I.removeSelectionMarker(d)),I.once("mouseup",(function(){var e=v.toOrientedRange();u&&e.isEmpty()&&o(u.cursor,e.cursor)?v.substractPoint(e.cursor):(s?v.substractPoint(d.cursor):d&&(I.removeSelectionMarker(d),v.addRange(d)),v.addRange(e)),I.inVirtualSelectionMode=!1})));else if("block"==h)return e.stop(),I.inVirtualSelectionMode=!0,p=[],m=function(){var e=I.renderer.pixelToScreenCoordinates(w,S),t=x.screenToDocumentPosition(e.row,e.column,e.offsetX);o(E,e)&&o(t,v.lead)||(E=e,I.selection.moveToPosition(t),I.renderer.scrollCursorIntoView(),I.removeSelectionMarkers(p),p=v.rectangularRangeBlock(E,k),I.$mouseHandler.$clickSelection&&1==p.length&&p[0].isEmpty()&&(p[0]=I.$mouseHandler.$clickSelection.clone()),p.forEach(I.addSelectionMarker,I),I.updateSelectionMarkers())},A&&!l?v.toSingleRange():!A&&l&&(g=v.toOrientedRange(),I.addSelectionMarker(g)),s?k=x.documentToScreenPosition(v.lead):v.moveToPosition(b),E={row:-1,column:-1},f=m,n.capture(I.container,(function(e){w=e.clientX,S=e.clientY}),(function(e){m(),clearInterval(C),I.removeSelectionMarkers(p),p.length||(p=[v.toOrientedRange()]),g&&(I.removeSelectionMarker(g),v.toSingleRange(g));for(var t=0;t<p.length;t++)v.addRange(p[t]);I.inVirtualSelectionMode=!1,I.$mouseHandler.$clickSelection=null})),C=setInterval((function(){f()}),20),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 into lines",exec:function(e){1<e.multiSelect.rangeCount?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}}],e=e("../keyboard/hash_handler").HashHandler,t.keyboardHandler=new e(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,r=e("./range").Range,o=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(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)}return e.cursor||(e.cursor=e.end),i=this.rangeList.add(e),this.$onAddRange(e),i.length&&this.$onRemoveRange(i),1<this.rangeCount&&!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){if(e=this.rangeList.substractPoint(e))return this.$onRemoveRange(e),e[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){var t;this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode&&(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],o=n.start.row,s=n.end.row;if(o===s)t.push(n.clone());else{for(t.push(new r(o,n.start.column,o,this.session.getLine(o).length));++o<s;)t.push(this.getLineRange(o,!0));t.push(new r(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=(t=this.rangeList.ranges)[t.length-1],t=r.fromPoints(t[0].start,e.end);this.toSingleRange(),this.setSelectionRange(t,e.cursor==e.start)},this.toggleBlockSelection=function(){var e,t;1<this.rangeCount?(t=(e=this.rangeList.ranges)[e.length-1],e=r.fromPoints(e[0].start,t.end),this.toSingleRange(),this.setSelectionRange(e,t.cursor==t.start)):(e=this.session.documentToScreenPosition(this.cursor),t=this.session.documentToScreenPosition(this.anchor),this.rectangularRangeBlock(e,t).forEach(this.addRange,this))},this.rectangularRangeBlock=function(e,t,i){var n,o,s,a,l,c,h,d=[],u=e.column<t.column,g=(a=u?(n=e.column,o=t.column,s=e.offsetX,t.offsetX):(n=t.column,o=e.column,s=t.offsetX,e.offsetX),e.row<t.row);c=g?(l=e.row,t.row):(l=t.row,e.row),n<0&&(n=0),(l=l<0?0:l)==c&&(i=!0);for(var p,m,f=l;f<=c;f++){var C=r.fromPoints(this.session.screenToDocumentPosition(f,n,s),this.session.screenToDocumentPosition(f,o,a));if(C.isEmpty()){if(h&&(m=h,(p=C.end).row==m.row&&p.column==m.column))break;h=C.end}C.cursor=u?C.start:C.end,d.push(C)}if(g&&d.reverse(),!i){for(var I=d.length-1;d[I].isEmpty()&&0<I;)I--;if(0<I)for(var v=0;d[v].isEmpty();)v++;for(var A=I;v<=A;A--)d[A].isEmpty()&&d.splice(A,1)}return d}}.call(o.prototype),d=e("./editor").Editor;function u(e){var i,n;function r(e){n&&(i.renderer.setMouseCursor(""),n=!1)}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),(i=e).textInput&&(e=i.textInput.getElement(),n=!1,a.addListener(e,"keydown",(function(e){e=18==e.keyCode&&!(e.ctrlKey||e.shiftKey||e.metaKey),i.$blockSelectEnabled&&e?n||(i.renderer.setMouseCursor("crosshair"),n=!0):n&&r()}),i),a.addListener(e,"keyup",r,i),a.addListener(e,"blur",r,i)))}(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){e.marker&&(this.session.removeMarker(e.marker),-1!=(e=this.session.$selectionMarkers.indexOf(e))&&this.session.$selectionMarkers.splice(e,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];n.marker&&(this.session.removeMarker(n.marker),-1!=(n=t.indexOf(n))&&t.splice(n,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,i=e.command,n=e.editor;if(n.multiSelect)return i.multiSelectAction?t="forEach"==i.multiSelectAction?n.forEachSelection(i,e.args):"forEachLine"==i.multiSelectAction?n.forEachSelection(i,e.args,!0):"single"==i.multiSelectAction?(n.exitMultiSelectMode(),i.exec(n,e.args||{})):i.multiSelectAction(n,e.args||{}):(t=i.exec(n,e.args||{}),n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()),t},this.forEachSelection=function(e,t,i){if(!this.inVirtualSelectionMode){var n,r=i&&i.keepOrder,s=1==i||i&&i.$byLines,a=this.session,l=(i=this.selection).rangeList,c=(r?i:l).ranges;if(!c.length)return e.exec?e.exec(this,t||{}):e(this,t||{});r=i._eventRegistry;var h=(i._eventRegistry={},new o(a));this.inVirtualSelectionMode=!0;for(var d=c.length;d--;){if(s)for(;0<d&&c[d].start.row==c[d-1].end.row;)d--;h.fromOrientedRange(c[d]),h.index=d,this.selection=a.selection=h;var u=e.exec?e.exec(this,t||{}):e(this,t||{});n||void 0===u||(n=u),h.toOrientedRange(c[d])}return h.detach(),this.selection=a.selection=i,this.inVirtualSelectionMode=!1,i._eventRegistry=r,i.mergeOverlappingRanges(),i.ranges[0]&&i.fromOrientedRange(i.ranges[0]),l=this.renderer.$scrollAnimation,this.onCursorChange(),this.onSelectionChange(),l&&l.from==l.to&&this.renderer.animateScrolling(l.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 r=this.session.getDocument().getNewLineCharacter();(e=i.join(r)).length==(i.length-1)*r.length&&(e="")}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.$checkMultiselectChange=function(e,t){var i;this.inMultiSelectMode&&!this.inVirtualSelectionMode&&(i=this.multiSelect.ranges[0],this.multiSelect.isEmpty()&&t==this.multiSelect.anchor||((i=t==this.multiSelect.anchor?i.cursor==i.start?i.end:i.start:i.cursor).row!=t.row||this.session.$clipPositionToDocument(i.row,i.column).column!=t.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()))},this.findAll=function(e,t,i){(t=t||{}).needle=e||t.needle,null==t.needle&&(n=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange(),t.needle=this.session.getTextRange(n)),this.$search.set(t);var n,r=this.$search.findAll(this.session);if(!r.length)return 0;var o=this.multiSelect;i||o.toSingleRange(r[0]);for(var s=r.length;s--;)o.addRange(r[s],!0);return n&&o.rangeList.rangeAtPoint(n.start)&&o.addRange(n,!0),r.length},this.selectMoreLines=function(e,t){var i,n,o,s=this.selection.toOrientedRange(),a=s.cursor==s.end,l=this.session.documentToScreenPosition(s.cursor),c=(this.selection.$desiredColumn&&(l.column=this.selection.$desiredColumn),this.session.screenToDocumentPosition(l.row+e,l.column));e=s.isEmpty()?c:(i=this.session.documentToScreenPosition(a?s.end:s.start),this.session.screenToDocumentPosition(i.row+e,i.column)),a?(n=r.fromPoints(c,e)).cursor=n.start:(n=r.fromPoints(e,c)).cursor=n.end,n.desiredColumn=l.column,this.selection.inMultiSelectMode?t&&(o=s.cursor):this.selection.addRange(s),this.selection.addRange(n),o&&this.selection.substractPoint(o)},this.transposeSelections=function(e){for(var t=this.session,i=t.multiSelect,n=i.ranges,r=n.length;r--;)(s=n[r]).isEmpty()&&(a=t.getWordRange(s.start.row,s.start.column),s.start.row=a.start.row,s.start.column=a.start.column,s.end.row=a.end.row,s.end.column=a.end.column);i.mergeOverlappingRanges();var o=[];for(r=n.length;r--;){var s=n[r];o.unshift(t.getTextRange(s))}for(e<0?o.unshift(o.pop()):o.push(o.shift()),r=n.length;r--;){var a=(s=n[r]).clone();t.replace(s,o[r]),s.start.row=a.start.row,s.start.column=a.start.column}i.fromOrientedRange(i.ranges[0])},this.selectMore=function(e,t,i){var n,r=this.session,o=r.multiSelect.toOrientedRange();o.isEmpty()&&((o=r.getWordRange(o.start.row,o.start.column)).cursor=-1==e?o.start:o.end,this.multiSelect.addRange(o),i)||(i=r.getTextRange(o),r=r,i=i,n=e,h.$options.wrap=!0,h.$options.needle=i,h.$options.backwards=-1==n,(i=h.find(r))&&(i.cursor=-1==e?i.start:i.end,this.session.unfold(i),this.multiSelect.addRange(i),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,o=i.filter((function(e){if(e.cursor.row==n)return!0;n=e.cursor.row}));if(i.length&&o.length!=i.length-1){o.forEach((function(e){t.substractPoint(e.cursor)}));var s=0,a=1/0,c=i.map((function(t){t=t.cursor;var i=e.getLine(t.row).substr(t.column).search(/\S/g);return t.column>s&&(s=t.column),(i=-1==i?0:i)<a&&(a=i),i}));i.forEach((function(t,i){var n=t.cursor,o=s-n.column;(i=c[i]-a)<o?e.insert(n,l.stringRepeat(" ",o-i)):e.remove(new r(n.row,n.column,n.row,n.column-o+i)),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=(o=this.selection.getRange()).start.row,d=o.end.row;if(i=h==d){for(var u,g=this.session.getLength();u=this.session.getLine(d),/[=:]/.test(u)&&++d<g;);for(;u=this.session.getLine(h),/[=:]/.test(u)&&0<--h;);h<0&&(h=0),g<=d&&(d=g-1)}var p=this.session.removeFullLines(h,d);p=this.$reAlignText(p,i);this.session.insert({row:h,column:0},p.join("\n")+"\n"),i||(o.start.column=0,o.end.column=p[p.length-1].length),this.selection.setRange(o)}},this.$reAlignText=function(e,t){var i,n,r,o=!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,r=t[3].length):(i+n+r!=t[1].length+t[2].length+t[3].length&&(s=!1),i!=t[1].length&&(o=!1),i>t[1].length&&(i=t[1].length),n<t[2].length&&(n=t[2].length),r>t[3].length&&(r=t[3].length)),t):[e]})).map(t?c:o?s?function(e){return e[2]?a(i+n-e[2].length)+e[2]+a(r)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:c:function(e){return e[2]?a(i)+e[2]+a(r)+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+r)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(d.prototype),t.onSessionChange=function(e){var t=e.session;(e=(t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect,e.oldSession))&&(e.multiSelect.off("addRange",this.$onAddRange),e.multiSelect.off("removeRange",this.$onRemoveRange),e.multiSelect.off("multiSelect",this.$onMultiSelect),e.multiSelect.off("singleSelect",this.$onSingleSelect),e.multiSelect.lead.off("change",this.$checkMultiselectChange),e.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=u,e("./config").defineOptions(d.prototype,"editor",{enableMultiselect:{set:function(e){u(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",s)):(this.off("changeSession",this.$multiselectOnSessionChange),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;e=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,i){return e=e.getLine(i),this.foldingStartMarker.test(e)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(e)?"end":""},this.getFoldWidgetRange=function(e,t,i){return null},this.indentationBlock=function(e,t,i){var r=/\S/,o=(l=e.getLine(t)).search(r);if(-1!=o){i=i||l.length;for(var s,a=e.getLength(),l=t,c=t;++t<a;){var h=e.getLine(t).search(r);if(-1!=h){if(h<=o&&(!(h=e.getTokenAt(t,0))||"string"!==h.type))break;c=t}}return l<c?(s=e.getLine(c).length,new n(l,i,c,s)):void 0}},this.openingBracketBlock=function(e,t,i,r,o){if(i={row:i,column:r+1},r=e.$findClosingBracket(t,i,o))return"start"==(t=null==(t=e.foldWidgets[r.row])?e.getFoldWidget(r.row):t)&&r.row>i.row&&(r.row--,r.column=e.getLine(r.row).length),n.fromPoints(i,r)},this.closingBracketBlock=function(e,t,i,r,o){if(i={row:i,column:r},r=e.$findOpeningBracket(t,i))return r.column++,i.column--,n.fromPoints(r,i)}}).call(e.prototype)})),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)})),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],(function(e,t,i){"use strict";var n=e("./lib/dom");function r(e){this.session=e,(this.session.widgetManager=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)}(function(){this.getRowLength=function(e){var t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach((function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)})),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),(this.editor=e)&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(e){var t=this.editor;t&&(this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets),(t=this.session.lineWidgets)&&t.forEach((function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})))},this.updateOnFold=function(e,t){var i=t.lineWidgets;if(i&&e.action){for(var n=(t=e.data).start.row,r=t.end.row,o="add"==e.action,s=n+1;s<r;s++)i[s]&&(i[s].hidden=o);i[r]&&(o?i[n]?i[r].hidden=o:i[n]=i[r]:(i[n]==i[r]&&(i[n]=void 0),i[r].hidden=o))}},this.updateOnChange=function(e){var t,i,n,r=this.session.lineWidgets;r&&(t=e.start.row,0!=(i=e.end.row-t)&&("remove"==e.action?(n=r.splice(t+1,i),!r[t]&&n[n.length-1]&&(r[t]=n.pop()),n.forEach((function(e){e&&this.removeLineWidget(e)}),this)):(n=new Array(i),r[t]&&null!=r[t].column&&e.start.column>r[t].column&&t++,n.unshift(t,0),r.splice.apply(r,n)),this.$updateRows()))},this.$updateRows=function(){var e,t=this.session.lineWidgets;t&&(e=!0,t.forEach((function(t,i){if(t)for(e=!1,t.row=i;t.$oldWidget;)t.$oldWidget.row=i,t=t.$oldWidget})),e&&(this.session.lineWidgets=null))},this.$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).el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1),this.session.lineWidgets[e.row]=e},this.addLineWidget=function(e){if(this.$registerLineWidget(e),e.session=this.session,!this.editor)return e;var t,i=this.editor.renderer,r=(e.html&&!e.el&&(e.el=n.createElement("div"),e.el.innerHTML=e.html),e.el&&(n.addCssClass(e.el,"ace_lineWidgetContainer"),e.el.style.position="absolute",e.el.style.zIndex=5,i.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/i.layerConfig.lineHeight),this.session.getFoldAt(e.row,0));return(e.$fold=r)&&(t=this.session.lineWidgets,e.row!=r.end.row||t[r.start.row]?e.hidden=!0:t[r.start.row]=e),this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,i),this.onWidgetChanged(e),e},this.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()},this.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,i=t&&t[e],n=[];i;)n.push(i),i=i.$oldWidget;return n},this.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(e,t){var i=this.session._changedWidgets,n=t.layerConfig;if(i&&i.length){for(var r=1/0,o=0;o<i.length;o++){var s=i[o];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<r&&(r=s.row))}}r!=1/0&&(this.session._emit("changeFold",{data:{start:{row:r}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},this.renderWidgets=function(e,t){var i=t.layerConfig,n=this.session.lineWidgets;if(n){for(var r=Math.min(this.firstRow,i.firstRow),o=Math.max(this.lastRow,i.lastRow,n.length);0<r&&!n[r];)r--;this.firstRow=i.firstRow,this.lastRow=i.lastRow,t.$cursorLayer.config=i;for(var s=r;s<=o;s++){var a,l=n[s];l&&l.el&&(l.hidden?l.el.style.top=-100-(l.pixelHeight||0)+"px":(l._inDocument||(l._inDocument=!0,t.container.appendChild(l.el)),a=t.$cursorLayer.getPixelPosition({row:s,column:0},!0).top,l.coverLine||(a+=i.lineHeight*this.session.getRowLineCount(l.row)),l.el.style.top=a-i.offset+"px",a=l.coverGutter?0:t.gutterWidth,l.fixedWidth||(a-=t.scrollLeft),l.el.style.left=a+"px",l.fullWidth&&l.screenWidth&&(l.el.style.minWidth=i.width+2*i.padding+"px"),l.fixedWidth?l.el.style.right=t.scrollBar.getWidth()+"px":l.el.style.right=""))}}}}).call(r.prototype),t.LineWidgets=r})),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],(function(e,t,i){"use strict";var n=e("../line_widgets").LineWidgets,r=e("../lib/dom"),o=e("../range").Range;function s(e,t,i){var n=e.getAnnotations().sort(o.comparePoints);if(n.length){var r=function(e,t,i){for(var n=0,r=e.length-1;n<=r;){var o=n+r>>1,s=i(t,e[o]);if(0<s)n=1+o;else{if(!(s<0))return o;r=o-1}}return-(n+1)}(n,{row:t,column:-1},o.comparePoints),s=((r=r<0?-r-1:r)>=n.length?r=0<i?0:n.length-1:0===r&&i<0&&(r=n.length-1),n[r]);if(s&&i){if(s.row===t){for(;(s=n[r+=i])&&s.row===t;);if(!s)return n.slice()}var a=[];for(t=s.row;a[i<0?"unshift":"push"](s),(s=n[r+=i])&&s.row==t;);return a.length&&a}}}t.showErrorMarker=function(e,t){var i,o=e.session,a=(o.widgetManager||(o.widgetManager=new n(o),o.widgetManager.attach(e)),e.getCursorPosition()),l=a.row,c=o.widgetManager.getWidgetsAtRow(l).filter((function(e){return"errorMarker"==e.type}))[0];if(l=(c?c.destroy():l-=t,s(o,l,t)))t=l[0],a.column=(t.pos&&"number"!=typeof t.column?t.pos.sc:t.column)||0,a.row=t.row,i=e.renderer.$gutterLayer.$annotations[a.row];else{if(c)return;i={text:["Looks good!"],className:"ace_ok"}}function h(e,t,i){if(0===t&&("esc"===i||"return"===i))return d.destroy(),{command:"null"}}e.session.unfold(a.row),e.selection.moveToPosition(a);var d={row:a.row,fixedWidth:!0,coverGutter:!0,el:r.createElement("div"),type:"errorMarker"};l=d.el.appendChild(r.createElement("div")),(t=d.el.appendChild(r.createElement("div"))).className="error_widget_arrow "+i.className,c=e.renderer.$cursorLayer.getPixelPosition(a).left;t.style.left=c+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",l.className="error_widget "+i.className,l.innerHTML=i.text.join("<br>"),l.appendChild(r.createElement("div")),d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(h),o.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(h),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},r.importCssString("    .error_widget_wrapper {        background: inherit;        color: inherit;        border:none    }    .error_widget {        border-top: solid 2px;        border-bottom: solid 2px;        margin: 5px 0;        padding: 10px 40px;        white-space: pre-wrap;    }    .error_widget.ace_error, .error_widget_arrow.ace_error{        border-color: #ff5a5a    }    .error_widget.ace_warning, .error_widget_arrow.ace_warning{        border-color: #F1D817    }    .error_widget.ace_info, .error_widget_arrow.ace_info{        border-color: #5a5a5a    }    .error_widget.ace_ok, .error_widget_arrow.ace_ok{        border-color: #5aaa5a    }    .error_widget_arrow {        position: absolute;        border: solid 5px;        border-top-color: transparent!important;        border-right-color: transparent!important;        border-left-color: transparent!important;        top: -5px;    }","error_marker.css",!1)})),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","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"],(function(e,t,n){"use strict";e("./lib/fixoldbrowsers");var r=e("./lib/dom"),o=e("./lib/event"),s=e("./range").Range,a=e("./editor").Editor,l=e("./edit_session").EditSession,c=e("./undomanager").UndoManager,h=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.require=e,t.define=i.amdD,t.edit=function(e,i){if("string"==typeof e){var n=e;if(!(e=document.getElementById(n)))throw new Error("ace.edit can't find div #"+n)}if(e&&e.env&&e.env.editor instanceof a)return e.env.editor;n="";var s,l={document:n=(e&&/input|textarea/i.test(e.tagName)?(n=(s=e).value,e=r.createElement("pre"),s.parentNode.replaceChild(e,s)):e&&(n=e.textContent,e.innerHTML=""),t.createEditSession(n)),editor:e=new a(new h(e),n,i),onResize:e.resize.bind(e,null)};return s&&(l.textarea=s),o.addListener(window,"resize",l.onResize),e.on("destroy",(function(){o.removeListener(window,"resize",l.onResize),l.editor.container.env=null})),e.container.env=e.env=l,e},t.createEditSession=function(e,t){return(e=new l(e,t)).setUndoManager(new c),e},t.Range=s,t.Editor=a,t.EditSession=l,t.UndoManager=c,t.VirtualRenderer=h,t.version=t.config.version})),ace.require(["ace/ace"],(function(t){for(var i in t&&(t.config.init(!0),t.define=ace.define),window.ace||(window.ace=t),t)t.hasOwnProperty(i)&&(window.ace[i]=t[i]);window.ace.default=window.ace,e&&(e.exports=window.ace)}))},3330:function(e,t,i){e=i.nmd(e),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],(function(e,t,i){"use strict";function n(e,t,i){var n=r.createElement("div");r.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:"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"},"All"]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},"Replace"],["span",{action:"replaceAll",class:"ace_searchbtn"},"All"]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:"Search In Selection"},"S"]]],n),this.element=n.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),r.importCssString(a,"ace_searchbox",e.container)}var r=e("../lib/dom"),o=e("../lib/lang"),s=e("../lib/event"),a='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width:  2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing:    border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',l=e("../keyboard/hash_handler").HashHandler,c=e("../lib/keys");r.importCssString(a,"ace_searchbox",!1),function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(e){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element,t=(this.$initElements(e),this);s.addListener(e,"mousedown",(function(e){setTimeout((function(){t.activeInput.focus()}),0),s.stopPropagation(e)})),s.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),s.stopPropagation(e)})),s.addCommandKeyListener(e,(function(e,i,n){n=c.keyCodeToString(n),(i=t.$searchBarKb.findKeyCommand(i,n))&&i.exec&&(i.exec(t),s.stopEvent(e))})),this.$onChange=o.delayedCall((function(){t.find(!1,!1)})),s.addListener(this.searchInput,"input",(function(){t.$onChange.schedule(20)})),s.addListener(this.searchInput,"focus",(function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()})),s.addListener(this.replaceInput,"focus",(function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()}))},this.$closeSearchBarKb=new l([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new l,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.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()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){(this.searchRange=e)?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){r.setCssClass(this.replaceOption,"checked",this.searchRange),r.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",r.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),r.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),r.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);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)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,i){e=!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,r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,i=0,n=0;if(t){var r,o,s=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),a=e.session.doc.positionToIndex(e.selection.anchor);for(this.searchRange&&(a-=e.session.doc.positionToIndex(this.searchRange.start)),t.lastIndex=0;(o=t.exec(s))&&((r=o.index)<=a&&n++,!(999<++i))&&(o[0]||(t.lastIndex=r+=1,!(r>=s.length))););}this.searchCounter.textContent=n+" of "+(999<i?"999+":i)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=!this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked})&&this.searchInput.value;r.setCssClass(this.searchBox,"ace_nomatch",e),this.editor._emit("findSearchBox",{match:!e}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}.call(n.prototype),t.SearchBox=n,t.Search=function(e,t){(e.searchBox||new n(e)).show(e.session.getTextRange(),t)}})),ace.require(["ace/ext/searchbox"],(function(t){e&&(e.exports=t)}))},4091: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";function n(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}}var r=e("../lib/oop");e=e("./text_highlight_rules").TextHighlightRules;r.inherits(n,e),t.JsonHighlightRules=n})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(e,t,i){"use strict";function n(){}var r=e("../range").Range;(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){if(!(i=e.getLine(t).match(/^(\s*\})/)))return 0;var i=i[1].length,n=e.findMatchingBracket({row:t,column:i});if(!n||n.row==t)return 0;n=this.$getIndent(e.getLine(n.row)),e.replace(new r(t,0,t,i-1),n)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(n.prototype),t.MatchingBraceOutdent=n})),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"),r=e("../../range").Range;e=e("./fold_mode").FoldMode,t=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(t,e),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);return!this.singleLineBlockCommentRe.test(n)||this.startRegionRe.test(n)||this.tripleStarBlockCommentRe.test(n)?!(e=this._getFoldWidgetBase(e,t,i))&&this.startRegionRe.test(n)?"start":e:""},this.getFoldWidgetRange=function(e,t,i,n){var r=e.getLine(i);if(this.startRegionRe.test(r))return this.getCommentRegionBlock(e,r,i);var o=r.match(this.foldingStartMarker);if(o){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=(l=e.getLine(t)).search(/\S/),n=t,o=l.length,s=t+=1,a=e.getLength();++t<a;){var l,c=(l=e.getLine(t)).search(/\S/);if(-1!==c){if(c<i)break;var h=this.getFoldWidgetRange(e,"all",t);if(h){if(h.start.row<=n)break;if(h.isMultiLine())t=h.end.row;else if(i==c)break}s=t}}return new r(n,o,s,e.getLine(s).length)},this.getCommentRegionBlock=function(e,t,i){for(var n=t.search(/\s*$/),o=e.getLength(),s=i,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++i<o;){t=e.getLine(i);var c=a.exec(t);if(c&&(c[1]?l--:l++,!l))break}if(s<i)return new r(s,n,i,t.length)}}.call(t.prototype)})),ace.define("ace/mode/json",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/worker/worker_client"],(function(e,t,i){"use strict";function n(){this.HighlightRules=s,this.$outdent=new a,this.$behaviour=new l,this.foldingRules=new c}var r=e("../lib/oop"),o=e("./text").Mode,s=e("./json_highlight_rules").JsonHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,l=e("./behaviour/cstyle").CstyleBehaviour,c=e("./folding/cstyle").FoldMode,h=e("../worker/worker_client").WorkerClient;r.inherits(n,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 h(["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(n.prototype),t.Mode=n})),ace.require(["ace/mode/json"],(function(t){e&&(e.exports=t)}))},8903:function(e,t,i){"use strict";var n=i(5689),r=i(3969),o=i(5255),s=i(4293),a=i(3508),l=i(3368),c=i(742),h=i(9394),d=i(3724),u=(e=((e.exports=m).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 i=(e=this._addSchema(e)).validate||this._compile(e);return e=i(t),!0!==i.$async&&(this.errors=i.errors),e},m.prototype.compile=function(e,t){return(e=this._addSchema(e,void 0,t)).validate||this._compile(e)},m.prototype.addSchema=function(e,t,i,n){if(Array.isArray(e)){for(var o=0;o<e.length;o++)this.addSchema(e[o],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 b(this,t=r.normalizeId(t||s)),this._schemas[t]=this._addSchema(e,i,n,!0),this},m.prototype.addMetaSchema=function(e,t,i){return this.addSchema(e,t,i,!0),this},m.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(u)?u:void 0,e._opts.defaultMeta}(this)))return this.logger.warn("meta-schema not available"),!(this.errors=null);if(!(i=this.validate(i,e))&&t){if(e="schema is invalid: "+this.errorsText(),"log"!=this._opts.validateSchema)throw new Error(e);this.logger.error(e)}return i},m.prototype.getSchema=function(e){var t=f(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,a,l=r.schema.call(e,{schema:{}},t);if(l)return i=l.schema,o=l.root,l=l.baseId,a=n.call(e,i,o,void 0,l),e._fragments[t]=new s({ref:t,fragment:!0,schema:i,root:o,baseId:l,validate:a}),a}(this,e)}},m.prototype.removeSchema=function(e){if(e instanceof RegExp)return C(this,this._schemas,e),C(this,this._refs,e),this;switch(typeof e){case"undefined":return C(this,this._schemas),C(this,this._refs),this._cache.clear(),this;case"string":var t=f(this,e);return t&&this._cache.del(t.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":t=(t=this._opts.serialize)?t(e):e,this._cache.del(t),(t=this._getId(e))&&(t=r.normalizeId(t),delete this._schemas[t],delete this._refs[t])}return this},m.prototype.addFormat=function(e,t){return"string"==typeof t&&(t=new RegExp(t)),this._formats[e]=t,this},m.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,r="",o=0;o<e.length;o++){var s=e[o];s&&(r+=n+s.dataPath+" "+s.message+i)}return r.slice(0,-i.length)},m.prototype._addSchema=function(e,t,i,n){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var o,a=(a=this._opts.serialize)?a(e):e,l=this._cache.get(a);if(l)return l;n=n||!1!==this._opts.addUsedSchema,(l=r.normalizeId(this._getId(e)))&&n&&b(this,l),(t=!1!==this._opts.validateSchema&&!t)&&!(o=l&&l==r.normalizeId(e.$schema))&&this.validateSchema(e,!0);var c=r.ids.call(this,e);c=new s({id:l,schema:e,localRefs:c,cacheKey:a,meta:i});return"#"!=l[0]&&n&&(this._refs[l]=c),this._cache.put(a,c),t&&o&&this.validateSchema(e,!0),c},m.prototype._compile=function(e,t){if(e.compiling)return(e.validate=o).schema=e.schema,o.errors=null,o.root=t||o,!0===e.schema.$async&&(o.$async=!0),o;var i,r;e.compiling=!0,e.meta&&(i=this._opts,this._opts=this._metaOpts);try{r=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=r,e.refs=r.refs,e.refVal=r.refVal,e.root=r.root,r;function o(){var t=e.validate,i=t.apply(this,arguments);return o.errors=t.errors,i}},m.prototype.compileAsync=i(9677),i(7931)),e=(m.prototype.addKeyword=e.add,m.prototype.getKeyword=e.get,m.prototype.removeKeyword=e.remove,m.prototype.validateKeyword=e.validate,i(5359)),m.ValidationError=e.Validation,m.MissingRefError=e.MissingRef,m.$dataMetaSchema=h,"http://json-schema.org/draft-07/schema"),g=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],p=["/properties"];function m(e){if(!(this instanceof m))return new m(e);e=this._opts=d.copy(e)||{};var t=(S=this)._opts.logger;if(!1===t)S.logger={log:y,warn:y,error:y};else{if(!("object"==typeof(t=void 0===t?console:t)&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");S.logger=t}if(this._schemas={},this._refs={},this._fragments={},this._formats=l(e.format),this._cache=e.cache||new o,this._loadingSchemas={},this._compilations=[],this.RULES=c(),this._getId=function(e){switch(e.schemaId){case"auto":return A;case"id":return I;default:return v}}(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<g.length;i++)delete t[g[i]];return t}(this),e.formats){var n,r=this;for(n in r._opts.formats){var s=r._opts.formats[n];r.addFormat(n,s)}}if(e.keywords){var f,C=this;for(f in C._opts.keywords){var b=C._opts.keywords[f];C.addKeyword(f,b)}}var w,S,x=((S=this)._opts.$data&&(w=i(894),S.addMetaSchema(w,w.$id,!0)),!1!==S._opts.meta&&(w=i(6680),S._opts.$data&&(w=h(w,p)),S.addMetaSchema(w,u,!0),S._refs["http://json-schema.org/schema"]=u),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),this),k=x._opts.schemas;if(k)if(Array.isArray(k))x.addSchema(k);else for(var E in k)x.addSchema(k[E],E)}function f(e,t){return t=r.normalizeId(t),e._schemas[t]||e._refs[t]||e._fragments[t]}function C(e,t,i){for(var n in t){var r=t[n];r.meta||i&&!i.test(n)||(e._cache.del(r.cacheKey),delete t[n])}}function I(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function v(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 b(e,t){if(e._schemas[t]||e._refs[t])throw new Error('schema with key or id "'+t+'" already exists')}function y(){}},5255:function(e){"use strict";(e=e.exports=function(){this._cache={}}).prototype.put=function(e,t){this._cache[e]=t},e.prototype.get=function(e){return this._cache[e]},e.prototype.del=function(e){delete this._cache[e]},e.prototype.clear=function(){this._cache={}}},9677:function(e,t,i){"use strict";var n=i(5359).MissingRef;e.exports=function e(t,i,r){var o=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof i&&(r=i,i=void 0);var s=a(t).then((function(){var e=o._addSchema(t,void 0,i);return e.validate||function e(t){try{return o._compile(t)}catch(r){if(r instanceof n)return function(n){var r=n.missingSchema;if(l(r))throw new Error("Schema "+r+" is loaded but "+n.missingRef+" cannot be resolved");return(n=o._loadingSchemas[r])||(n=o._loadingSchemas[r]=o._opts.loadSchema(r)).then(s,s),n.then((function(e){if(!l(r))return a(e).then((function(){l(r)||o.addSchema(e,r,void 0,i)}))})).then((function(){return e(t)}));function s(){delete o._loadingSchemas[r]}function l(e){return o._refs[e]||o._schemas[e]}}(r);throw r}}(e)}));return r&&s.then((function(e){r(null,e)}),r),s;function a(t){return(t=t.$schema)&&!o.getSchema(t)?e.call(o,{$ref:t},!0):Promise.resolve()}}},5359:function(e,t,i){"use strict";var n=i(3969);function r(e,t,i){this.message=i||r.message(e,t),this.missingRef=n.url(e,t),this.missingSchema=n.normalizeId(n.fullPath(this.missingRef))}function o(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e}e.exports={Validation:o((function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0})),MissingRef:o(r)},r.message=function(e,t){return"can't resolve reference "+t+" from id "+e}},3368:function(e,t,i){"use strict";var n=i(3724),r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[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=(i=/^(?=.{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,/^(?:[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),l=/^(?:(?:[^\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,c=/^(?:(?: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,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,u=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,g=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function p(e){return n.copy(p[e="full"==e?"full":"fast"])}function m(e){if(!(e=e.match(r)))return!1;var t=+e[1],i=+e[2];e=+e[3];return 1<=i&&i<=12&&1<=e&&e<=(2!=i||(e=t)%4!=0||e%100==0&&e%400!=0?o[i]:29)}function f(e,t){if(!(e=e.match(s)))return!1;var i=e[1],n=e[2],r=e[3];e=e[5];return(i<=23&&n<=59&&r<=59||23==i&&59==n&&60==r)&&(!t||e)}(e.exports=p).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":l,url:c,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:i,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:A,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":u,"relative-json-pointer":g},p.full={date:m,time:f,"date-time":function(e){return 2==(e=e.split(C)).length&&m(e[0])&&f(e[1],!0)},uri:function(e){return I.test(e)&&a.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":l,url:c,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:i,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:A,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":u,"relative-json-pointer":g};var C=/t|\s/i,I=/\/|:/,v=/[^\\]\\Z/;function A(e){if(v.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},5689:function(e,t,i){"use strict";var n=i(3969),r=i(3724),o=i(5359),s=i(3508),a=i(1869),l=r.ucs2length,c=i(2303),h=o.Validation;function d(e,t,i){for(var n=0;n<this._compilations.length;n++){var r=this._compilations[n];if(r.schema==e&&r.root==t&&r.baseId==i)return n}return-1}function u(e,t){return"var pattern"+e+" = new RegExp("+r.toQuotedString(t[e])+");"}function g(e){return"var default"+e+" = defaults["+e+"];"}function p(e,t){return void 0===t[e]?"":"var refVal"+e+" = refVal["+e+"];"}function m(e){return"var customRule"+e+" = customRules["+e+"];"}function f(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,C,I){var v=this,A=this._opts,b=[void 0],y={},w=[],S={},x=[],k={},E=[],R=function(e,t,i){var n=d.call(this,e,t,i);return 0<=n?{index:n,compiling:!0}:(n=this._compilations.length,this._compilations[n]={schema:e,root:t,baseId:i},{index:n,compiling:!1})}.call(this,t,i=i||{schema:t,refVal:b,refs:y},I),T=this._compilations[R.index];if(R.compiling)return T.callValidate=function e(){var t=T.validate,i=t.apply(this,arguments);return e.errors=t.errors,i};var _=this._formats,$=this.RULES;try{var L=W(t,i,C,I),B=(T.validate=L,T.callValidate);return B&&(B.schema=L.schema,B.errors=null,B.refs=L.refs,B.refVal=L.refVal,B.root=L.root,B.$async=L.$async,A.sourceCode&&(B.source=L.source)),L}finally{(function(e,t,i){0<=(e=d.call(this,e,t,i))&&this._compilations.splice(e,1)}).call(this,t,i,I)}function W(t,s,d,C){var I=!s||s.schema==t;if(s.schema!=i.schema)return e.call(v,t,s,d,C);d=!0===t.$async,C=a({isTop:!0,schema:t,isRoot:I,baseId:C,root:s,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:o.MissingRef,RULES:$,validate:a,util:r,resolve:n,resolveRef:N,usePattern:F,useDefault:H,useCustomRule:V,opts:A,formats:_,logger:v.logger,self:v}),C=f(b,p)+f(w,u)+f(x,g)+f(E,m)+C,A.processCode&&(C=A.processCode(C,t));try{var S=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",C)(v,$,_,i,b,x,E,c,l,h);b[0]=S}catch(t){throw v.logger.error("Error compiling schema, function code:",C),t}return S.schema=t,S.errors=null,S.refs=y,S.refVal=b,S.root=I?S:s,d&&(S.$async=!0),!0===A.sourceCode&&(S.source={code:C,patterns:w,defaults:x}),S}function N(t,r,o){r=n.url(t,r);var s=y[r];if(void 0!==s)return P(a=b[s],l="refVal["+s+"]");if(!o&&i.refs&&void 0!==(s=i.refs[r]))return P(a=i.refVal[s],l=G(r,a));var a,l=G(r);if(void 0!==(o=n.call(v,W,i,r))||(s=C&&C[r])&&(o=n.inlineRef(s,A.inlineRefs)?s:e.call(v,s,i,C,t)),void 0!==o)return a=o,s=y[s=r],b[s]=a,P(o,l);delete y[r]}function G(e,t){var i=b.length;return b[i]=t,"refVal"+(y[e]=i)}function P(e,t){return"object"==typeof e||"boolean"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&!!e.$async}}function F(e){var t=S[e];return void 0===t&&(t=S[e]=w.length,w[t]=e),"pattern"+t}function H(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return r.toQuotedString(e);case"object":if(null===e)return"null";var t=s(e),i=k[t];return void 0===i&&(i=k[t]=x.length,x[i]=e),"default"+i}}function V(e,t,i,n){if(!1!==v._opts.validateSchema){if((o=e.definition.dependencies)&&!o.every((function(e){return Object.prototype.hasOwnProperty.call(i,e)})))throw new Error("parent schema must have all required keywords: "+o.join(","));if((o=e.definition.validateSchema)&&!o(t)){if(o="keyword schema is invalid: "+v.errorsText(o.errors),"log"!=v._opts.validateSchema)throw new Error(o);v.logger.error(o)}}var r,o=e.definition.compile,s=e.definition.inline,a=e.definition.macro;if(o)r=o.call(v,t,i,n);else if(a)r=a.call(v,t,i,n),!1!==A.validateSchema&&v.validateSchema(r,!0);else if(s)r=s.call(v,n,e.keyword,t,i);else if(!(r=e.definition.validate))return;if(void 0===r)throw new Error('custom keyword "'+e.keyword+'"failed to compile');return{code:"customRule"+(o=E.length),validate:E[o]=r}}}},3969:function(e,t,i){"use strict";var n=i(7533),r=i(2303),o=i(3724),s=i(4293),a=i(500);function l(e,t,i){var n,r,o,a;if("string"==typeof(a=this._refs[i])){if(!this._refs[a])return l.call(this,e,t,a);a=this._refs[a]}return(a=a||this._schemas[i])instanceof s?g(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a):((a=c.call(this,t,i))&&(n=a.schema,t=a.root,o=a.baseId),n instanceof s?r=n.validate||e.call(this,n.schema,t,void 0,o):void 0!==n&&(r=g(n,this._opts.inlineRefs)?n:e.call(this,n,t,void 0,o)),r)}function c(e,t){var i=n.parse(t),r=m(i),o=p(this._getId(e.schema));if(0===Object.keys(e.schema).length||r!==o){r=C(r);var a=this._refs[r];if("string"==typeof a)return function(e,t,i){var n,r;if(t=c.call(this,e,t))return n=t.schema,r=t.baseId,e=t.root,(t=this._getId(n))&&(r=I(r,t)),d.call(this,i,r,n,e)}.call(this,e,a,i);if(a instanceof s)a.validate||this._compile(a),e=a;else{if(!((a=this._schemas[r])instanceof s))return;if(a.validate||this._compile(a),r==C(t))return{schema:a,root:e,baseId:o};e=a}if(!e.schema)return;o=p(this._getId(e.schema))}return d.call(this,i,o,e.schema,e)}(e.exports=l).normalizeId=C,l.fullPath=p,l.url=I,l.ids=function(e){var t=C(this._getId(e)),i={"":t},s={"":p(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];h=s[h]+"/"+d;if(void 0!==g&&(h+="/"+("number"==typeof g?g:o.escapeFragment(g))),"string"==typeof p)if(p=m=C(m?n.resolve(m,p):p),(d="string"==typeof(d=c._refs[p])?c._refs[d]:d)&&d.schema){if(!r(e,d.schema))throw new Error('id "'+p+'" resolves to more than one schema')}else if(p!=C(h))if("#"==p[0]){if(l[p]&&!r(e,l[p]))throw new Error('id "'+p+'" resolves to more than one schema');l[p]=e}else c._refs[p]=h;i[t]=m,s[t]=h}})),l},l.inlineRef=g,l.schema=c;var h=o.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function d(e,t,i,n){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var r=e.fragment.split("/"),s=1;s<r.length;s++){var a=r[s];if(a){if(void 0===(i=i[a=o.unescapeFragment(a)]))break;h[a]||((a=this._getId(i))&&(t=I(t,a)),i.$ref&&(a=I(t,i.$ref),(a=c.call(this,n,a))&&(i=a.schema,n=a.root,t=a.baseId)))}}return void 0!==i&&i!==n.schema?{schema:i,root:n,baseId:t}:void 0}}var u=o.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function g(e,t){return!1!==t&&(void 0===t||!0===t?function e(t){var i;if(Array.isArray(t)){for(var n=0;n<t.length;n++)if("object"==typeof(i=t[n])&&!e(i))return!1}else for(var r in t){if("$ref"==r)return!1;if("object"==typeof(i=t[r])&&!e(i))return!1}return!0}(e):t?function e(t){var i,n=0;if(Array.isArray(t)){for(var r=0;r<t.length;r++)if("object"==typeof(i=t[r])&&(n+=e(i)),n==1/0)return 1/0}else for(var o in t){if("$ref"==o)return 1/0;if(u[o])n++;else if("object"==typeof(i=t[o])&&(n+=e(i)+1),n==1/0)return 1/0}return n}(e)<=t:void 0)}function p(e,t){return!1!==t&&(e=C(e)),m(n.parse(e))}function m(e){return n.serialize(e).split("#")[0]+"#"}var f=/#\/?$/;function C(e){return e?e.replace(f,""):""}function I(e,t){return t=C(t),n.resolve(e,t)}},742:function(e,t,i){"use strict";var n=i(9646),r=i(3724).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=r(t),e.types=r(["number","integer","string","array","object","boolean","null"]),e.forEach((function(i){i.rules=i.rules.map((function(i){var r,o;return"object"==typeof i&&(o=i[r=Object.keys(i)[0]],i=r,o.forEach((function(i){t.push(i),e.all[i]=!0}))),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=r(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},4293:function(e,t,i){"use strict";var n=i(3724);e.exports=function(e){n.copy(e,this)}},6887:function(e){"use strict";e.exports=function(e){for(var t,i=0,n=e.length,r=0;r<n;)i++,55296<=(t=e.charCodeAt(r++))&&t<=56319&&r<n&&56320==(64512&(t=e.charCodeAt(r)))&&r++;return i}},3724:function(e,t,i){"use strict";function n(e,t,i,n){var r=n?" !== ":" === ",o=n?" || ":" && ",s=n?"!":"",a=n?"":"!";switch(e){case"null":return t+r+"null";case"array":return s+"Array.isArray("+t+")";case"object":return"("+s+t+o+"typeof "+t+r+'"object"'+o+a+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+r+'"number"'+o+a+"("+t+" % 1)"+o+t+r+t+(i?o+s+"isFinite("+t+")":"")+")";case"number":return"(typeof "+t+r+'"'+e+'"'+(i?o+s+"isFinite("+t+")":"")+")";default:return"typeof "+t+r+'"'+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 r,s="";e=o(e);for(r in e.array&&e.object&&(s=e.null?"(":"(!"+t+" || ",s+="typeof "+t+' !== "object")',delete e.null,delete e.array,delete e.object),e.number&&delete e.integer,e)s+=(s?" && ":"")+n(r,t,i,!0);return s},coerceToTypes:function(e,t){if(!Array.isArray(t))return r[t]?[t]:"array"===e&&"array"===t?["array"]:void 0;for(var i=[],n=0;n<t.length;n++){var o=t[n];(r[o]||"array"===e&&"array"===o)&&(i[i.length]=o)}return i.length?i:void 0},toHash:o,getProperty:l,escapeQuotes:c,equal:i(2303),ucs2length:i(6887),varOccurences:function(e,t){return t+="[^0-9]",(e=e.match(new RegExp(t,"g")))?e.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){return g(e,i=h(i?"/"+p(t):l(t)))},getData:function(e,t,i){var n,r,o;if(""===e)return"rootData";if("/"==e[0]){if(!d.test(e))throw new Error("Invalid JSON-pointer: "+e);n=e,r="rootData"}else{if(!(o=e.match(u)))throw new Error("Invalid JSON-pointer: "+e);if(e=+o[1],"#"==(n=o[2])){if(t<=e)throw new Error("Cannot access property/index "+e+" levels up, current level is "+t);return i[t-e]}if(t<e)throw new Error("Cannot access data "+e+" levels up, current level is "+t);if(r="data"+(t-e||""),!n)return r}for(var s=r,a=n.split("/"),c=0;c<a.length;c++){var h=a[c];h&&(s+=" && "+(r+=l(m(h))))}return s},unescapeFragment:function(e){return m(decodeURIComponent(e))},unescapeJsonPointer:m,escapeFragment:function(e){return encodeURIComponent(p(e))},escapeJsonPointer:p};var r=o(["string","number","integer","boolean","null"]);function o(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,"~")}},9394: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));for(var r=i[n].split("/"),o=e,s=1;s<r.length;s++)o=o[r[s]];for(s=0;s<t.length;s++){var a=t[s],l=o[a];l&&(o[a]={anyOf:[l,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e}},5868:function(e,t,i){"use strict";i=i(6680),e.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:i.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:i.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"}]}}}},1796:function(e){"use strict";e.exports=function(e,t,i){var n,r,o,s,a,l=" ",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=e.opts.$data&&d&&d.$data,C=f?(l+=" var schema"+c+" = "+e.util.getData(d.$data,h,e.dataPathArr)+"; ","schema"+c):d,I="maximum"==t,v=I?"exclusiveMaximum":"exclusiveMinimum",A=e.schema[v],b=e.opts.$data&&A&&A.$data,y=I?"<":">",w=I?">":"<",S=void 0;if(!f&&"number"!=typeof d&&void 0!==d)throw new Error(t+" must be number");if(!b&&void 0!==A&&"number"!=typeof A&&"boolean"!=typeof A)throw new Error(v+" must be number or boolean");b?(h=e.util.getData(A.$data,h,e.dataPathArr),o="exclIsNumber"+c,s="' + "+(a="op"+c)+" + '",S=v,(x=x||[]).push(l=l+" var schemaExcl"+c+" = "+h+";  var "+(n="exclusive"+c)+"; var "+(r="exclType"+c)+" = typeof "+(h="schemaExcl"+c)+"; if ("+r+" != 'boolean' && "+r+" != 'undefined' && "+r+" != 'number') { "),l="",!1!==e.createErrors?(l+=" { keyword: '"+(S||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: {} ",!1!==e.opts.messages&&(l+=" , message: '"+v+" should be boolean' "),e.opts.verbose&&(l+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),l+=" } "):l+=" {} ",k=l,l=x.pop(),!e.compositeRule&&p?e.async?l+=" throw new ValidationError(["+k+"]); ":l+=" validate.errors = ["+k+"]; return false; ":l+=" var err = "+k+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l+=" } else if ( ",f&&(l+=" ("+C+" !== undefined && typeof "+C+" != 'number') || "),l+=" "+r+" == 'number' ? ( ("+n+" = "+C+" === undefined || "+h+" "+y+"= "+C+") ? "+m+" "+w+"= "+h+" : "+m+" "+w+" "+C+" ) : ( ("+n+" = "+h+" === true) ? "+m+" "+w+"= "+C+" : "+m+" "+w+" "+C+" ) || "+m+" !== "+m+") { var op"+c+" = "+n+" ? '"+y+"' : '"+y+"='; ",void 0===d&&(g=e.errSchemaPath+"/"+(S=v),C=h,f=b)):(s=y,(o="number"==typeof A)&&f?(a="'"+s+"'",l+=" if ( ",f&&(l+=" ("+C+" !== undefined && typeof "+C+" != 'number') || "),l+=" ( "+C+" === undefined || "+A+" "+y+"= "+C+" ? "+m+" "+w+"= "+A+" : "+m+" "+w+" "+C+" ) || "+m+" !== "+m+") { "):(o&&void 0===d?(n=!0,g=e.errSchemaPath+"/"+(S=v),C=A,w+="="):(o&&(C=Math[I?"min":"max"](A,d)),A===(!o||C)?(n=!0,g=e.errSchemaPath+"/"+(S=v),w+="="):(n=!1,s+="=")),a="'"+s+"'",l+=" if ( ",f&&(l+=" ("+C+" !== undefined && typeof "+C+" != 'number') || "),l+=" "+m+" "+w+" "+C+" || "+m+" !== "+m+") { ")),S=S||t,(x=x||[]).push(l),l="",!1!==e.createErrors?(l+=" { keyword: '"+(S||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { comparison: "+a+", limit: "+C+", exclusive: "+n+" } ",!1!==e.opts.messages&&(l=l+" , message: 'should be "+s+" "+(f?"' + "+C:C+"'")),e.opts.verbose&&(l=(l+=" , schema:  ")+(f?"validate.schema"+u:""+d)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),l+=" } "):l+=" {} ";var x,k=l;return l=x.pop(),!e.compositeRule&&p?e.async?l+=" throw new ValidationError(["+k+"]); ":l+=" validate.errors = ["+k+"]; return false; ":l+=" var err = "+k+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l+=" } ",p&&(l+=" else { "),l}},2407:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),d=e.opts.$data&&s&&s.$data;o=d?(n+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+r):s;if(!d&&"number"!=typeof s)throw new Error(t+" must be number");n+="if ( ",d&&(n+=" ("+o+" !== undefined && typeof "+o+" != 'number') || ");r=t;var u=[];u.push(n+=" "+h+".length "+("maxItems"==t?">":"<")+" "+o+") { "),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o+" } ",!1!==e.opts.messages&&(n=(n=(n+=" , message: 'should NOT have ")+("maxItems"==t?"more":"fewer")+" than ")+(d?"' + "+o+" + '":""+s)+" items' "),e.opts.verbose&&(n=(n+=" , schema:  ")+(d?"validate.schema"+a:""+s)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",r=n,n=u.pop();return!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+r+"]); ":n+=" validate.errors = ["+r+"]; return false; ":n+=" var err = "+r+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},1250:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),d=e.opts.$data&&s&&s.$data;o=d?(n+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+r):s;if(!d&&"number"!=typeof s)throw new Error(t+" must be number");n+="if ( ",d&&(n+=" ("+o+" !== undefined && typeof "+o+" != 'number') || "),!1===e.opts.unicode?n+=" "+h+".length ":n+=" ucs2length("+h+") ";r=t;var u=[];u.push(n+=" "+("maxLength"==t?">":"<")+" "+o+") { "),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o+" } ",!1!==e.opts.messages&&(n=(n=(n+=" , message: 'should NOT be ")+("maxLength"==t?"longer":"shorter")+" than ")+(d?"' + "+o+" + '":""+s)+" characters' "),e.opts.verbose&&(n=(n+=" , schema:  ")+(d?"validate.schema"+a:""+s)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",r=n,n=u.pop();return!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+r+"]); ":n+=" validate.errors = ["+r+"]; return false; ":n+=" var err = "+r+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},2596:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),d=e.opts.$data&&s&&s.$data;o=d?(n+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+r):s;if(!d&&"number"!=typeof s)throw new Error(t+" must be number");n+="if ( ",d&&(n+=" ("+o+" !== undefined && typeof "+o+" != 'number') || ");r=t;var u=[];u.push(n+=" Object.keys("+h+").length "+("maxProperties"==t?">":"<")+" "+o+") { "),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o+" } ",!1!==e.opts.messages&&(n=(n=(n+=" , message: 'should NOT have ")+("maxProperties"==t?"more":"fewer")+" than ")+(d?"' + "+o+" + '":""+s)+" properties' "),e.opts.verbose&&(n=(n+=" , schema:  ")+(d?"validate.schema"+a:""+s)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",r=n,n=u.pop();return!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+r+"]); ":n+=" validate.errors = ["+r+"]; return false; ":n+=" var err = "+r+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},9486:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,a=!e.opts.allErrors,l=e.util.copy(e),c="",h=(l.level++,"valid"+l.level),d=l.baseId,u=!0,g=r;if(g)for(var p,m=-1,f=g.length-1;m<f;)p=g[m+=1],(e.opts.strictKeywords?"object"==typeof p&&0<Object.keys(p).length||!1===p:e.util.schemaHasRules(p,e.RULES.all))&&(u=!1,l.schema=p,l.schemaPath=o+"["+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}},5347:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=(t=!e.opts.allErrors,o="data"+(o||""),"valid"+r),h=(r="errs__"+r,e.util.copy(e)),d="",u=(h.level++,"valid"+h.level);if(s.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&0<Object.keys(t).length||!1===t:e.util.schemaHasRules(t,e.RULES.all)}))){var g=h.baseId,p=(n+=" var "+r+" = errors; var "+c+" = false;  ",e.compositeRule),m=(e.compositeRule=h.compositeRule=!0,s);if(m)for(var f,C=-1,I=m.length-1;C<I;)f=m[C+=1],h.schema=f,h.schemaPath=a+"["+C+"]",h.errSchemaPath=l+"/"+C,n+="  "+e.validate(h)+" ",h.baseId=g,n+=" "+c+" = "+c+" || "+u+"; if (!"+c+") { ",d+="}";e.compositeRule=h.compositeRule=p,n+=" "+d+" if (!"+c+") {   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: "+o+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&t&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } else {  errors = "+r+"; if (vErrors !== null) { if ("+r+") vErrors.length = "+r+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else t&&(n+=" if (true) { ");return n}},923:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.schema[t];t=e.errSchemaPath+"/"+t,e.opts.allErrors,r=e.util.toQuotedString(r);return!0===e.opts.$comment?n+=" console.log("+r+");":"function"==typeof e.opts.$comment&&(n+=" self._opts.$comment("+r+", "+e.util.toQuotedString(t)+", validate.root.schema);"),n}},2617:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c="data"+(o||""),h="valid"+r,d=e.opts.$data&&s&&s.$data;(s=(d&&(n+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; "),d||(n+=" var schema"+r+" = validate.schema"+a+";"),[])).push(n+="var "+h+" = equal("+c+", schema"+r+"); if (!"+h+") {   "),n="",!1!==e.createErrors?(n+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { allowedValue: schema"+r+" } ",!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: "+c+" "),n+=" } "):n+=" {} ",o=n,n=s.pop();return!e.compositeRule&&l?e.async?n+=" throw new ValidationError(["+o+"]); ":n+=" validate.errors = ["+o+"]; return false; ":n+=" var err = "+o+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",l&&(n+=" else { "),n}},2119:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c=(o="data"+(o||""),"valid"+r),h="errs__"+r,d=e.util.copy(e),u=(d.level++,"valid"+d.level),g=(r="i"+r,d.dataLevel=e.dataLevel+1),p="data"+g,m=e.baseId,f=e.opts.strictKeywords?"object"==typeof s&&0<Object.keys(s).length||!1===s:e.util.schemaHasRules(s,e.RULES.all);(r=(n+="var "+h+" = errors;var "+c+";",f?(c=e.compositeRule,e.compositeRule=d.compositeRule=!0,d.schema=s,d.schemaPath=a,d.errSchemaPath=t,n+=" var "+u+" = false; for (var "+r+" = 0; "+r+" < "+o+".length; "+r+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,r,e.opts.jsonPointers,!0),s=o+"["+r+"]",d.dataPathArr[g]=r,g=e.validate(d),d.baseId=m,e.util.varOccurences(g,p)<2?n+=" "+e.util.varReplace(g,p,s)+" ":n+=" var "+p+" = "+s+"; "+g+" ",n+=" if ("+u+") break; }  ",e.compositeRule=d.compositeRule=c,n+="  if (!"+u+") {"):n+=" if ("+o+".length == 0) {",[])).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , 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: "+o+" "),n+=" } "):n+=" {} ",m=n,n=r.pop();return!e.compositeRule&&l?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { ",f&&(n+="  errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(n+=" } "),n}},1793:function(e){"use strict";e.exports=function(e,t,i){var n,r,o,s=" ",a=e.level,l=e.dataLevel,c=e.schema[t],h=e.schemaPath+e.util.getProperty(t),d=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,g="data"+(l||""),p="valid"+a,m="errs__"+a,f=e.opts.$data&&c&&c.$data,C=f?(s+=" var schema"+a+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ","schema"+a):c,I="definition"+a,v=this.definition,A="";if(f&&v.$data){var b="keywordValidate"+a,y=v.validateSchema;s+=" var "+I+" = RULES.custom['"+t+"'].definition; var "+b+" = "+I+".validate;"}else{if(!(k=e.useCustomRule(this,c,e.schema,e)))return;C="validate.schema"+h,b=k.code,n=v.compile,r=v.inline,o=v.macro}t=b+".errors",c="i"+a;var w,S,x,k,E,R="ruleErr"+a,T=v.async;if(T&&!e.async)throw new Error("async keyword in sync schema");return r||o||(s+=t+" = null;"),s+="var "+m+" = errors;var "+p+";",f&&v.$data&&(A+="}",s+=" if ("+C+" === undefined) { "+p+" = true; } else { ",y&&(A+="}",s+=" "+p+" = "+I+".validateSchema("+C+"); if ("+p+") { ")),r?v.statements?s+=" "+k.validate+" ":s+=" "+p+" = "+k.validate+"; ":o?(A="",(f=e.util.copy(e)).level++,w="valid"+f.level,f.schema=k.validate,f.schemaPath="",y=e.compositeRule,e.compositeRule=f.compositeRule=!0,I=e.validate(f).replace(/validate\.schema/g,b),e.compositeRule=f.compositeRule=y,s+=" "+I):((E=E||[]).push(s),s="",s+="  "+b+".call( ",e.opts.passContext?s+="this":s+="self",n||!1===v.schema?s+=" , "+g+" ":s+=" , "+C+" , "+g+" , validate.schema"+e.schemaPath+" ",s+=" , (dataPath || '')",'""'!=e.errorPath&&(s+=" + "+e.errorPath),k=s+=" , "+(S=l?"data"+(l-1||""):"parentData")+" , "+(x=l?e.dataPathArr[l]:"parentDataProperty")+" , rootData )  ",s=E.pop(),!1===v.errors?(s+=" "+p+" = ",T&&(s+="await "),s+=k+"; "):s+=T?" var "+(t="customErrors"+a)+" = null; try { "+p+" = await "+k+"; } catch (e) { "+p+" = false; if (e instanceof ValidationError) "+t+" = e.errors; else throw e; } ":" "+t+" = null; "+p+" = "+k+"; "),v.modifying&&(s+=" if ("+S+") "+g+" = "+S+"["+x+"];"),s+=""+A,v.valid?u&&(s+=" if (true) { "):(s+=" if ( ",void 0===v.valid?s=s+" !"+(o?""+w:p):s+=" "+!v.valid+" ",f=this.keyword,(E=E||[]).push(s+=") { "),(E=E||[]).push(s=""),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(s+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(s+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),s+=" } "):s+=" {} ",y=s,s=E.pop(),!e.compositeRule&&u?e.async?s+=" throw new ValidationError(["+y+"]); ":s+=" validate.errors = ["+y+"]; return false; ":s+=" var err = "+y+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",I=s,s=E.pop(),r?v.errors?"full"!=v.errors&&(s+="  for (var "+c+"="+m+"; "+c+"<errors; "+c+"++) { var "+R+" = vErrors["+c+"]; if ("+R+".dataPath === undefined) "+R+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+R+".schemaPath === undefined) { "+R+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(s+=" "+R+".schema = "+C+"; "+R+".data = "+g+"; "),s+=" } "):!1===v.errors?s+=" "+I+" ":(s+=" if ("+m+" == errors) { "+I+" } else {  for (var "+c+"="+m+"; "+c+"<errors; "+c+"++) { var "+R+" = vErrors["+c+"]; if ("+R+".dataPath === undefined) "+R+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+R+".schemaPath === undefined) { "+R+'.schemaPath = "'+d+'"; } ',e.opts.verbose&&(s+=" "+R+".schema = "+C+"; "+R+".data = "+g+"; "),s+=" } } "):o?(s+="   var err =   ",!1!==e.createErrors?(s+=" { keyword: '"+(f||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(s+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(s+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),s+=" } "):s+=" {} ",s+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?s+=" throw new ValidationError(vErrors); ":s+=" validate.errors = vErrors; return false; ")):!1===v.errors?s+=" "+I+" ":(s+=" if (Array.isArray("+t+")) { if (vErrors === null) vErrors = "+t+"; else vErrors = vErrors.concat("+t+"); errors = vErrors.length;  for (var "+c+"="+m+"; "+c+"<errors; "+c+"++) { var "+R+" = vErrors["+c+"]; if ("+R+".dataPath === undefined) "+R+".dataPath = (dataPath || '') + "+e.errorPath+";  "+R+'.schemaPath = "'+d+'";  ',e.opts.verbose&&(s+=" "+R+".schema = "+C+"; "+R+".data = "+g+"; "),s+=" } } else { "+I+" } "),s+=" } ",u&&(s+=" else { ")),s}},9115:function(e){"use strict";e.exports=function(e,t,i){var n,r=" ",o=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=(t="errs__"+o,e.util.copy(e)),g="",p=(u.level++,"valid"+u.level),m={},f={},C=e.opts.ownProperties;for($ in a)"__proto__"!=$&&(B=a[$],(n=Array.isArray(B)?f:m)[$]=B);var I=e.errorPath;for($ in r=r+"var "+t+" = errors;var missing"+o+";",f)if((n=f[$]).length){if(r+=" if ( "+d+e.util.getProperty($)+" !== undefined ",C&&(r+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes($)+"') "),h){r+=" && ( ";var v=n;if(v)for(var A=-1,b=v.length-1;A<b;)k=v[A+=1],A&&(r+=" || "),r+=" ( ( "+(_=d+(T=e.util.getProperty(k)))+" === undefined ",C&&(r+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(k)+"') "),r+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?k:T)+") ) ";r+=")) {  ";var y="' + "+(S="missing"+o)+" + '",w=(e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(I,S,!0):I+" + "+S),w||[]),S=(w.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes($)+"', missingProperty: '"+y+"', depsCount: "+n.length+", deps: '"+e.util.escapeQuotes(1==n.length?n[0]:n.join(", "))+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should have ",1==n.length?r+="property "+e.util.escapeQuotes(n[0]):r+="properties "+e.util.escapeQuotes(n.join(", ")),r+=" when property "+e.util.escapeQuotes($)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ",r);r=w.pop();!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{r+=" ) { ";var x=n;if(x)for(var k,E=-1,R=x.length-1;E<R;){k=x[E+=1];var T=e.util.getProperty(k),_=(y=e.util.escapeQuotes(k),d+T);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(I,k,e.opts.jsonPointers)),r+=" if ( "+_+" === undefined ",C&&(r+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(k)+"') "),r+=") {  var err =   ",!1!==e.createErrors?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes($)+"', missingProperty: '"+y+"', depsCount: "+n.length+", deps: '"+e.util.escapeQuotes(1==n.length?n[0]:n.join(", "))+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should have ",1==n.length?r+="property "+e.util.escapeQuotes(n[0]):r+="properties "+e.util.escapeQuotes(n.join(", ")),r+=" when property "+e.util.escapeQuotes($)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ",r+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r+=" }   ",h&&(g+="}",r+=" else { ")}e.errorPath=I;var $,L=u.baseId;for($ in m){var B=m[$];(e.opts.strictKeywords?"object"==typeof B&&0<Object.keys(B).length||!1===B:e.util.schemaHasRules(B,e.RULES.all))&&(r+=" "+p+" = true; if ( "+d+e.util.getProperty($)+" !== undefined ",C&&(r+=" && Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes($)+"') "),r+=") { ",u.schema=B,u.schemaPath=l+e.util.getProperty($),u.errSchemaPath=c+"/"+e.util.escapeFragment($),r+="  "+e.validate(u)+" ",u.baseId=L,r+=" }  ",h&&(r+=" if ("+p+") { ",g+="}"))}return h&&(r+="   "+g+" if ("+t+" == errors) {"),r}},9317:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c="data"+(o||""),h="valid"+r,d=e.opts.$data&&s&&s.$data;d&&(n+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; "),s="i"+r,o="schema"+r,(o=(d||(n+=" var "+o+" = validate.schema"+a+";"),n+="var "+h+";",d&&(n+=" if (schema"+r+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+r+")) "+h+" = false; else {"),n+=h+" = false;for (var "+s+"=0; "+s+"<"+o+".length; "+s+"++) if (equal("+c+", "+o+"["+s+"])) { "+h+" = true; break; }",d&&(n+="  }  "),[])).push(n+=" if (!"+h+") {   "),n="",!1!==e.createErrors?(n+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { allowedValues: schema"+r+" } ",!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: "+c+" "),n+=" } "):n+=" {} ",s=n,n=o.pop();return!e.compositeRule&&l?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+=" }",l&&(n+=" else { "),n}},8327:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c="data"+(o||"");if(!1===e.opts.format)return l&&(n+=" if (true) { "),n;var h,d=e.opts.$data&&s&&s.$data,u=(o=d?(n+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+r):s,e.opts.unknownFormats),g=Array.isArray(u);if(d)n+=" var "+(h="format"+r)+" = formats["+o+"]; var "+(p="isObject"+r)+" = typeof "+h+" == 'object' && !("+h+" instanceof RegExp) && "+h+".validate; var "+(f="formatType"+r)+" = "+p+" && "+h+".type || 'string'; if ("+p+") { ",e.async&&(n+=" var async"+r+" = "+h+".async; "),n+=" "+h+" = "+h+".validate; } if (  ",d&&(n+=" ("+o+" !== undefined && typeof "+o+" != 'string') || "),n+=" (","ignore"!=u&&(n+=" ("+o+" && !"+h+" ",g&&(n+=" && self._opts.unknownFormats.indexOf("+o+") == -1 "),n+=") || "),n+=" ("+h+" && "+f+" == '"+i+"' && !(typeof "+h+" == 'function' ? ",e.async?n+=" (async"+r+" ? await "+h+"("+c+") : "+h+"("+c+")) ":n+=" "+h+"("+c+") ",n+=" : "+h+".test("+c+"))))) {";else{if(!(h=e.formats[s])){if("ignore"==u)return e.logger.warn('unknown format "'+s+'" ignored in schema at path "'+e.errSchemaPath+'"'),l&&(n+=" if (true) { "),n;if(g&&0<=u.indexOf(s))return l&&(n+=" if (true) { "),n;throw new Error('unknown format "'+s+'" is used in schema at path "'+e.errSchemaPath+'"')}var p,m,f=(p="object"==typeof h&&!(h instanceof RegExp)&&h.validate)&&h.type||"string";if(p&&(m=!0===h.async,h=h.validate),f!=i)return l&&(n+=" if (true) { "),n;if(m){if(!e.async)throw new Error("async format in sync schema");n+=" if (!(await "+(C="formats"+e.util.getProperty(s)+".validate")+"("+c+"))) { "}else{n+=" if (! ";var C="formats"+e.util.getProperty(s);p&&(C+=".validate"),n=n+("function"==typeof h?" "+C+"("+c+") ":" "+C+".test("+c+") ")+") { "}}return(r=[]).push(n),n="",!1!==e.createErrors?(n=(n+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { format:  ")+(d?""+o:""+e.util.toQuotedString(s))+"  } ",!1!==e.opts.messages&&(n=(n+=" , message: 'should match format \"")+(d?"' + "+o+" + '":""+e.util.escapeQuotes(s))+"\"' "),e.opts.verbose&&(n=(n=(n+=" , schema:  ")+(d?"validate.schema"+a:""+e.util.toQuotedString(s)))+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ",g=n,n=r.pop(),!e.compositeRule&&l?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",l&&(n+=" else { "),n}},5926:function(e){"use strict";e.exports=function(e,t,i){var n,r=" ",o=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),h=(s="data"+(s||""),"valid"+o),d="errs__"+o,u=e.util.copy(e),g=(u.level++,"valid"+u.level),p=e.schema.then,m=e.schema.else,f=(p=void 0!==p&&(e.opts.strictKeywords?"object"==typeof p&&0<Object.keys(p).length||!1===p:e.util.schemaHasRules(p,e.RULES.all)),m=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&0<Object.keys(m).length||!1===m:e.util.schemaHasRules(m,e.RULES.all)),u.baseId);return p||m?(u.createErrors=!1,u.schema=a,u.schemaPath=l,u.errSchemaPath=t,r+=" var "+d+" = errors; var "+h+" = true;  ",a=e.compositeRule,e.compositeRule=u.compositeRule=!0,r+="  "+e.validate(u)+" ",u.baseId=f,u.createErrors=!0,r+="  errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }  ",e.compositeRule=u.compositeRule=a,p?(r+=" if ("+g+") {  ",u.schema=e.schema.then,u.schemaPath=e.schemaPath+".then",u.errSchemaPath=e.errSchemaPath+"/then",r+="  "+e.validate(u)+" ",u.baseId=f,r+=" "+h+" = "+g+"; ",p&&m?r+=" var "+(n="ifClause"+o)+" = 'then'; ":n="'then'",r+=" } ",m&&(r+=" else { ")):r+=" if (!"+g+") { ",m&&(u.schema=e.schema.else,u.schemaPath=e.schemaPath+".else",u.errSchemaPath=e.errSchemaPath+"/else",r+="  "+e.validate(u)+" ",u.baseId=f,r+=" "+h+" = "+g+"; ",p&&m?r+=" var "+(n="ifClause"+o)+" = 'else'; ":n="'else'",r+=" } "),r+=" if (!"+h+") {   var err =   ",!1!==e.createErrors?(r+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { failingKeyword: "+n+" } ",!1!==e.opts.messages&&(r+=" , message: 'should match \"' + "+n+" + '\" schema' "),e.opts.verbose&&(r+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+s+" "),r+=" } "):r+=" {} ",r+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?r+=" throw new ValidationError(vErrors); ":r+=" validate.errors = vErrors; return false; "),r+=" }   ",c&&(r+=" else { ")):c&&(r+=" if (true) { "),r}},9646:function(e,t,i){"use strict";e.exports={$ref:i(2331),allOf:i(9486),anyOf:i(5347),$comment:i(923),const:i(2617),contains:i(2119),dependencies:i(9115),enum:i(9317),format:i(8327),if:i(5926),items:i(392),maximum:i(1796),minimum:i(1796),maxItems:i(2407),minItems:i(2407),maxLength:i(1250),minLength:i(1250),maxProperties:i(2596),minProperties:i(2596),multipleOf:i(6039),not:i(7946),oneOf:i(9344),pattern:i(9737),properties:i(2537),propertyNames:i(2127),required:i(1204),uniqueItems:i(1985),validate:i(1869)}},392:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),d=(t="valid"+r,o="errs__"+r,e.util.copy(e)),u="",g=(d.level++,"valid"+d.level),p=(r="i"+r,d.dataLevel=e.dataLevel+1),m="data"+p,f=e.baseId;if(n+="var "+o+" = errors;var "+t+";",Array.isArray(s)){var C,I,v=e.schema.additionalItems,A=(!1===v&&(n+=" "+t+" = "+h+".length <= "+s.length+"; ",C=l,l=e.errSchemaPath+"/additionalItems",(I=I||[]).push(n+="  if (!"+t+") {   "),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+=" {} ",t=n,n=I.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+t+"]); ":n+=" validate.errors = ["+t+"]; return false; ":n+=" var err = "+t+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",l=C,c&&(u+="}",n+=" else { ")),s);if(A)for(var b=-1,y=A.length-1;b<y;){var w,S,x=A[b+=1];(e.opts.strictKeywords?"object"==typeof x&&0<Object.keys(x).length||!1===x:e.util.schemaHasRules(x,e.RULES.all))&&(n+=" "+g+" = true; if ("+h+".length > "+b+") { ",w=h+"["+b+"]",d.schema=x,d.schemaPath=a+"["+b+"]",d.errSchemaPath=l+"/"+b,d.errorPath=e.util.getPathExpr(e.errorPath,b,e.opts.jsonPointers,!0),d.dataPathArr[p]=b,S=e.validate(d),d.baseId=f,e.util.varOccurences(S,m)<2?n+=" "+e.util.varReplace(S,m,w)+" ":n+=" var "+m+" = "+w+"; "+S+" ",n+=" }  ",c&&(n+=" if ("+g+") { ",u+="}"))}"object"==typeof v&&(e.opts.strictKeywords?"object"==typeof v&&0<Object.keys(v).length||!1===v:e.util.schemaHasRules(v,e.RULES.all))&&(d.schema=v,d.schemaPath=e.schemaPath+".additionalItems",d.errSchemaPath=e.errSchemaPath+"/additionalItems",n+=" "+g+" = true; if ("+h+".length > "+s.length+") {  for (var "+r+" = "+s.length+"; "+r+" < "+h+".length; "+r+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,r,e.opts.jsonPointers,!0),w=h+"["+r+"]",d.dataPathArr[p]=r,S=e.validate(d),d.baseId=f,e.util.varOccurences(S,m)<2?n+=" "+e.util.varReplace(S,m,w)+" ":n+=" var "+m+" = "+w+"; "+S+" ",c&&(n+=" if (!"+g+") break; "),n+=" } }  ",c&&(n+=" if ("+g+") { ",u+="}"))}else(e.opts.strictKeywords?"object"==typeof s&&0<Object.keys(s).length||!1===s:e.util.schemaHasRules(s,e.RULES.all))&&(d.schema=s,d.schemaPath=a,d.errSchemaPath=l,n+="  for (var "+r+" = 0; "+r+" < "+h+".length; "+r+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,r,e.opts.jsonPointers,!0),w=h+"["+r+"]",d.dataPathArr[p]=r,S=e.validate(d),d.baseId=f,e.util.varOccurences(S,m)<2?n+=" "+e.util.varReplace(S,m,w)+" ":n+=" var "+m+" = "+w+"; "+S+" ",c&&(n+=" if (!"+g+") break; "),n+=" }");return c&&(n+=" "+u+" if ("+o+" == errors) {"),n}},6039:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(o||""),d=e.opts.$data&&s&&s.$data;o=d?(n+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+r):s;if(!d&&"number"!=typeof s)throw new Error(t+" must be number");return n+="var division"+r+";if (",d&&(n+=" "+o+" !== undefined && ( typeof "+o+" != 'number' || "),n+=" (division"+r+" = "+h+" / "+o+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+r+") - division"+r+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+r+" !== parseInt(division"+r+") ",n+=" ) ",d&&(n+="  )  "),(t=[]).push(n+=" ) {   "),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+o+" } ",!1!==e.opts.messages&&(n=n+" , message: 'should be multiple of "+(d?"' + "+o:o+"'")),e.opts.verbose&&(n=(n+=" , schema:  ")+(d?"validate.schema"+a:""+s)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",r=n,n=t.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+r+"]); ":n+=" validate.errors = ["+r+"]; return false; ":n+=" var err = "+r+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},7946:function(e){"use strict";e.exports=function(e,t,i){var n,r,o=" ",s=e.level,a=e.dataLevel,l=e.schema[t],c=e.schemaPath+e.util.getProperty(t),h=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),d=(a="data"+(a||""),s="errs__"+s,e.util.copy(e)),u=(d.level++,"valid"+d.level);return(e.opts.strictKeywords?"object"==typeof l&&0<Object.keys(l).length||!1===l:e.util.schemaHasRules(l,e.RULES.all))?(d.schema=l,d.schemaPath=c,d.errSchemaPath=t,o+=" var "+s+" = errors;  ",l=e.compositeRule,e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(r=d.opts.allErrors,d.opts.allErrors=!1),o+=" "+e.validate(d)+" ",d.createErrors=!0,r&&(d.opts.allErrors=r),e.compositeRule=d.compositeRule=l,(n=n||[]).push(o+=" if ("+u+") {   "),o="",!1!==e.createErrors?(o+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: {} ",!1!==e.opts.messages&&(o+=" , message: 'should NOT be valid' "),e.opts.verbose&&(o+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+a+" "),o+=" } "):o+=" {} ",r=o,o=n.pop(),!e.compositeRule&&h?e.async?o+=" throw new ValidationError(["+r+"]); ":o+=" validate.errors = ["+r+"]; return false; ":o+=" var err = "+r+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",o+=" } else {  errors = "+s+"; if (vErrors !== null) { if ("+s+") vErrors.length = "+s+"; else vErrors = null; } ",e.opts.allErrors&&(o+=" } ")):(o+="  var err =   ",!1!==e.createErrors?(o+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: {} ",!1!==e.opts.messages&&(o+=" , message: 'should NOT be valid' "),e.opts.verbose&&(o+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+a+" "),o+=" } "):o+=" {} ",o+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(o+=" if (false) { ")),o}},9344:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=(t=!e.opts.allErrors,o="data"+(o||""),"valid"+r),h="errs__"+r,d=e.util.copy(e),u="",g=(d.level++,"valid"+d.level),p=d.baseId,m="prevValid"+r,f="passingSchemas"+r,C=(r=(n+="var "+h+" = errors , "+m+" = false , "+c+" = false , "+f+" = null; ",e.compositeRule),e.compositeRule=d.compositeRule=!0,s);if(C)for(var I,v=-1,A=C.length-1;v<A;)I=C[v+=1],(e.opts.strictKeywords?"object"==typeof I&&0<Object.keys(I).length||!1===I:e.util.schemaHasRules(I,e.RULES.all))?(d.schema=I,d.schemaPath=a+"["+v+"]",d.errSchemaPath=l+"/"+v,n+="  "+e.validate(d)+" ",d.baseId=p):n+=" var "+g+" = true; ",v&&(n+=" if ("+g+" && "+m+") { "+c+" = false; "+f+" = ["+f+", "+v+"]; } else { ",u+="}"),n+=" if ("+g+") { "+c+" = "+m+" = true; "+f+" = "+v+"; }";return e.compositeRule=d.compositeRule=r,n+=u+"if (!"+c+") {   var err =   ",!1!==e.createErrors?(n+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+f+" } ",!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: "+o+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&t&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+="} else {  errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(n+=" } "),n}},9737:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),c="data"+(o||""),h=e.opts.$data&&s&&s.$data,d=(o=h?(n+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ","schema"+r):s,r=h?"(new RegExp("+o+"))":e.usePattern(s),n+="if ( ",h&&(n+=" ("+o+" !== undefined && typeof "+o+" != 'string') || "),[]);d.push(n+=" !"+r+".test("+c+") ) {   "),n="",!1!==e.createErrors?(n=(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { pattern:  ")+(h?""+o:""+e.util.toQuotedString(s))+"  } ",!1!==e.opts.messages&&(n=(n+=" , message: 'should match pattern \"")+(h?"' + "+o+" + '":""+e.util.escapeQuotes(s))+"\"' "),e.opts.verbose&&(n=(n=(n+=" , schema:  ")+(h?"validate.schema"+a:""+e.util.toQuotedString(s)))+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ",r=n,n=d.pop();return!e.compositeRule&&l?e.async?n+=" throw new ValidationError(["+r+"]); ":n+=" validate.errors = ["+r+"]; return false; ":n+=" var err = "+r+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",l&&(n+=" else { "),n}},2537:function(e){"use strict";e.exports=function(e,t,i){var n,r=" ",o=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=(t="errs__"+o,e.util.copy(e)),g="",p=(u.level++,"valid"+u.level),m="key"+o,f="idx"+o,C=u.dataLevel=e.dataLevel+1,I="data"+C,v="dataProperties"+o,A=(s=Object.keys(a||{}).filter($),e.schema.patternProperties||{}),b=Object.keys(A).filter($),y=e.schema.additionalProperties,w=s.length||b.length,S=!1===y,x="object"==typeof y&&Object.keys(y).length,k=e.opts.removeAdditional,E=S||x||k,R=e.opts.ownProperties,T=e.baseId,_=e.schema.required;function $(e){return"__proto__"!==e}if(_&&(!e.opts.$data||!_.$data)&&_.length<e.opts.loopRequired&&(n=e.util.toHash(_)),r+="var "+t+" = errors;var "+p+" = true;",R&&(r+=" var "+v+" = undefined;"),E){if(r+=R?" "+v+" = "+v+" || Object.keys("+d+"); for (var "+f+"=0; "+f+"<"+v+".length; "+f+"++) { var "+m+" = "+v+"["+f+"]; ":" for (var "+m+" in "+d+") { ",w){if(r+=" var isAdditional"+o+" = !(false ",s.length)if(8<s.length)r+=" || validate.schema"+l+".hasOwnProperty("+m+") ";else{var L=s;if(L)for(var B=-1,W=L.length-1;B<W;)V=L[B+=1],r+=" || "+m+" == "+e.util.toQuotedString(V)+" "}if(b.length){var N=b;if(N)for(var G=-1,P=N.length-1;G<P;)Q=N[G+=1],r+=" || "+e.usePattern(Q)+".test("+m+") "}r+=" ); if (isAdditional"+o+") { "}"all"==k?r+=" delete "+d+"["+m+"]; ":(K=e.errorPath,_="' + "+m+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers)),S?k?r+=" delete "+d+"["+m+"]; ":(j=c,c=e.errSchemaPath+"/additionalProperties",(X=X||[]).push(r+=" "+p+" = false; "),r="",!1!==e.createErrors?(r+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { additionalProperty: '"+_+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is an invalid additional property":r+="should NOT have additional properties",r+="' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ",J=r,r=X.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+J+"]); ":r+=" validate.errors = ["+J+"]; return false; ":r+=" var err = "+J+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=j,h&&(r+=" break; ")):x&&("failing"==k?(r+=" var "+t+" = errors;  ",E=e.compositeRule,e.compositeRule=u.compositeRule=!0,u.schema=y,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),te=d+"["+m+"]",u.dataPathArr[C]=m,ie=e.validate(u),u.baseId=T,e.util.varOccurences(ie,I)<2?r+=" "+e.util.varReplace(ie,I,te)+" ":r+=" var "+I+" = "+te+"; "+ie+" ",r+=" if (!"+p+") { errors = "+t+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+d+"["+m+"]; }  ",e.compositeRule=u.compositeRule=E):(u.schema=y,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),te=d+"["+m+"]",u.dataPathArr[C]=m,ie=e.validate(u),u.baseId=T,e.util.varOccurences(ie,I)<2?r+=" "+e.util.varReplace(ie,I,te)+" ":r+=" var "+I+" = "+te+"; "+ie+" ",h&&(r+=" if (!"+p+") break; "))),e.errorPath=K),w&&(r+=" } "),r+=" }  ",h&&(r+=" if ("+p+") { ",g+="}")}var F=e.opts.useDefaults&&!e.compositeRule;if(s.length){var H=s;if(H)for(var V,Z=-1,M=H.length-1;Z<M;){var O,D,K,j,z,X,J,Y=a[V=H[Z+=1]];(e.opts.strictKeywords?"object"==typeof Y&&0<Object.keys(Y).length||!1===Y:e.util.schemaHasRules(Y,e.RULES.all))&&(te=d+(z=e.util.getProperty(V)),O=F&&void 0!==Y.default,u.schema=Y,u.schemaPath=l+z,u.errSchemaPath=c+"/"+e.util.escapeFragment(V),u.errorPath=e.util.getPath(e.errorPath,V,e.opts.jsonPointers),u.dataPathArr[C]=e.util.toQuotedString(V),ie=e.validate(u),u.baseId=T,e.util.varOccurences(ie,I)<2?(ie=e.util.varReplace(ie,I,te),D=te):r+=" var "+(D=I)+" = "+te+"; ",O?r+=" "+ie+" ":(n&&n[V]?(r+=" if ( "+D+" === undefined ",R&&(r+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(V)+"') "),r+=") { "+p+" = false; ",K=e.errorPath,j=c,z=e.util.escapeQuotes(V),e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(K,V,e.opts.jsonPointers)),c=e.errSchemaPath+"/required",(X=X||[]).push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { missingProperty: '"+z+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+z+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),r+=" } "):r+=" {} ",J=r,r=X.pop(),!e.compositeRule&&h?e.async?r+=" throw new ValidationError(["+J+"]); ":r+=" validate.errors = ["+J+"]; return false; ":r+=" var err = "+J+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c=j,e.errorPath=K,r+=" } else { "):h?(r+=" if ( "+D+" === undefined ",R&&(r+=" || ! Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(V)+"') "),r+=") { "+p+" = true; } else { "):(r+=" if ("+D+" !== undefined ",R&&(r+=" &&   Object.prototype.hasOwnProperty.call("+d+", '"+e.util.escapeQuotes(V)+"') "),r+=" ) { "),r+=" "+ie+" } ")),h&&(r+=" if ("+p+") { ",g+="}")}}if(b.length){var U=b;if(U)for(var Q,q=-1,ee=U.length-1;q<ee;){var te,ie;Y=A[Q=U[q+=1]];(e.opts.strictKeywords?"object"==typeof Y&&0<Object.keys(Y).length||!1===Y:e.util.schemaHasRules(Y,e.RULES.all))&&(u.schema=Y,u.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(Q),u.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(Q),r=(r+=R?" "+v+" = "+v+" || Object.keys("+d+"); for (var "+f+"=0; "+f+"<"+v+".length; "+f+"++) { var "+m+" = "+v+"["+f+"]; ":" for (var "+m+" in "+d+") { ")+" if ("+e.usePattern(Q)+".test("+m+")) { ",u.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers),te=d+"["+m+"]",u.dataPathArr[C]=m,ie=e.validate(u),u.baseId=T,e.util.varOccurences(ie,I)<2?r+=" "+e.util.varReplace(ie,I,te)+" ":r+=" var "+I+" = "+te+"; "+ie+" ",h&&(r+=" if (!"+p+") break; "),r+=" } ",h&&(r+=" else "+p+" = true; "),r+=" }  ",h&&(r+=" if ("+p+") { ",g+="}"))}}return h&&(r+=" "+g+" if ("+t+" == errors) {"),r}},2127:function(e){"use strict";e.exports=function(e,t,i){var n,r,o,s,a,l,c,h=" ",d=e.level,u=e.dataLevel,g=e.schema[t],p=e.schemaPath+e.util.getProperty(t),m=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),f=(u="data"+(u||""),"errs__"+d),C=e.util.copy(e),I=(C.level++,"valid"+C.level);return h+="var "+f+" = errors;",(e.opts.strictKeywords?"object"==typeof g&&0<Object.keys(g).length||!1===g:e.util.schemaHasRules(g,e.RULES.all))&&(C.schema=g,C.schemaPath=p,C.errSchemaPath=t,g="idx"+d,r="i"+d,o="' + "+(n="key"+d)+" + '",s="data"+(C.dataLevel=e.dataLevel+1),c="dataProperties"+d,l=e.opts.ownProperties,a=e.baseId,l&&(h+=" var "+c+" = undefined; "),h=h+(l?" "+c+" = "+c+" || Object.keys("+u+"); for (var "+g+"=0; "+g+"<"+c+".length; "+g+"++) { var "+n+" = "+c+"["+g+"]; ":" for (var "+n+" in "+u+") { ")+" var startErrs"+d+" = errors; ",l=n,c=e.compositeRule,e.compositeRule=C.compositeRule=!0,g=e.validate(C),C.baseId=a,e.util.varOccurences(g,s)<2?h+=" "+e.util.varReplace(g,s,l)+" ":h+=" var "+s+" = "+l+"; "+g+" ",e.compositeRule=C.compositeRule=c,h+=" if (!"+I+") { for (var "+r+"=startErrs"+d+"; "+r+"<errors; "+r+"++) { vErrors["+r+"].propertyName = "+n+"; }   var err =   ",!1!==e.createErrors?(h+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { propertyName: '"+o+"' } ",!1!==e.opts.messages&&(h+=" , message: 'property name \\'"+o+"\\' is invalid' "),e.opts.verbose&&(h+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),h+=" } "):h+=" {} ",h+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&m&&(e.async?h+=" throw new ValidationError(vErrors); ":h+=" validate.errors = vErrors; return false; "),m&&(h+=" break; "),h+=" } }"),m&&(h+="  if ("+f+" == errors) {"),h}},2331:function(e){"use strict";e.exports=function(e,t,i){var n,r,o=" ",s=e.level,a=e.dataLevel,l=e.schema[t],c=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),h="data"+(a||"");s="valid"+s;if("#"==l||"#/"==l)r=e.isRoot?(n=e.async,"validate"):(n=!0===e.root.schema.$async,"root.refVal[0]");else{var d=e.resolveRef(e.baseId,l,e.isRoot);if(void 0===d){var u=e.MissingRefError.message(e.baseId,l);if("fail"==e.opts.missingRefs)e.logger.error(u),(g=g||[]).push(o),o="",!1!==e.createErrors?(o+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",!1!==e.opts.messages&&(o+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(o+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),o+=" } "):o+=" {} ",t=o,o=g.pop(),!e.compositeRule&&c?e.async?o+=" throw new ValidationError(["+t+"]); ":o+=" validate.errors = ["+t+"]; return false; ":o+=" var err = "+t+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(o+=" if (false) { ");else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,l,u);e.logger.warn(u),c&&(o+=" if (true) { ")}}else d.inline?((t=e.util.copy(e)).level++,u="valid"+t.level,t.schema=d.schema,t.schemaPath="",t.errSchemaPath=l,o+=" "+e.validate(t).replace(/validate\.schema/g,d.code)+" ",c&&(o+=" if ("+u+") { ")):(n=!0===d.$async||e.async&&!1!==d.$async,r=d.code)}if(r){(g=g||[]).push(o),o="",e.opts.passContext?o+=" "+r+".call(this, ":o+=" "+r+"( ",o+=" "+h+", (dataPath || '')",'""'!=e.errorPath&&(o+=" + "+e.errorPath);var g;t=o+=" , "+(l=a?"data"+(a-1||""):"parentData")+" , "+(a?e.dataPathArr[a]:"parentDataProperty")+", rootData)  ";if(o=g.pop(),n){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(o+=" var "+s+"; "),o+=" try { await "+t+"; ",c&&(o+=" "+s+" = true; "),o+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(o+=" "+s+" = false; "),o+=" } ",c&&(o+=" if ("+s+") { ")}else o+=" if (!"+t+") { if (vErrors === null) vErrors = "+r+".errors; else vErrors = vErrors.concat("+r+".errors); errors = vErrors.length; } ",c&&(o+=" else { ")}return o}},1204:function(e){"use strict";e.exports=function(e,t,i){var n=" ",r=e.level,o=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=(t=!e.opts.allErrors,"data"+(o||"")),h="valid"+r,d=e.opts.$data&&s&&s.$data;d&&(n+=" var schema"+r+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; "),o="schema"+r;if(!d)if(s.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var u=[],g=s;if(g)for(var p=-1,m=g.length-1;p<m;){var f=g[p+=1],C=e.schema.properties[f];C&&(e.opts.strictKeywords?"object"==typeof C&&0<Object.keys(C).length||!1===C:e.util.schemaHasRules(C,e.RULES.all))||(u[u.length]=f)}}else u=s;if(d||u.length){var I=e.errorPath,v=(s=d||u.length>=e.opts.loopRequired,e.opts.ownProperties);if(t)if(n+=" var missing"+r+"; ",s){d||(n+=" var "+o+" = validate.schema"+a+"; ");var A="' + "+(k="schema"+r+"["+(w="i"+r)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(I,k,e.opts.jsonPointers)),n+=" var "+h+" = true; ",d&&(n+=" if (schema"+r+" === undefined) "+h+" = true; else if (!Array.isArray(schema"+r+")) "+h+" = false; else {"),n+=" for (var "+w+" = 0; "+w+" < "+o+".length; "+w+"++) { "+h+" = "+c+"["+o+"["+w+"]] !== undefined ",v&&(n+=" &&   Object.prototype.hasOwnProperty.call("+c+", "+o+"["+w+"]) "),n+="; if (!"+h+") break; } ",d&&(n+="  }  "),(x=x||[]).push(n+="  if (!"+h+") {   "),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+A+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ";var b=n;n=x.pop();!e.compositeRule&&t?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+=" } else { "}else{n+=" if ( ";var y=u;if(y)for(var w=-1,S=y.length-1;w<S;)R=y[w+=1],w&&(n+=" || "),n+=" ( ( "+(L=c+($=e.util.getProperty(R)))+" === undefined ",v&&(n+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(R)+"') "),n+=") && (missing"+r+" = "+e.util.toQuotedString(e.opts.jsonPointers?R:$)+") ) ";n+=") {  ",A="' + "+(k="missing"+r)+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(I,k,!0):I+" + "+k),(x=x||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+A+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ";var x;b=n;n=x.pop(),!e.compositeRule&&t?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+=" } else { "}else if(s){d||(n+=" var "+o+" = validate.schema"+a+"; ");var k;A="' + "+(k="schema"+r+"["+(w="i"+r)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(I,k,e.opts.jsonPointers)),d&&(n+=" if ("+o+" && !Array.isArray("+o+")) {  var err =   ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+A+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+o+" !== undefined) { "),n+=" for (var "+w+" = 0; "+w+" < "+o+".length; "+w+"++) { if ("+c+"["+o+"["+w+"]] === undefined ",v&&(n+=" || ! Object.prototype.hasOwnProperty.call("+c+", "+o+"["+w+"]) "),n+=") {  var err =   ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+A+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",d&&(n+="  }  ")}else{var E=u;if(E)for(var R,T=-1,_=E.length-1;T<_;){R=E[T+=1];var $=e.util.getProperty(R),L=(A=e.util.escapeQuotes(R),c+$);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(I,R,e.opts.jsonPointers)),n+=" if ( "+L+" === undefined ",v&&(n+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(R)+"') "),n+=") {  var err =   ",!1!==e.createErrors?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+A+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ",n+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=I}else t&&(n+=" if (true) {");return n}},1985:function(e){"use strict";e.exports=function(e,t,i){var n,r=" ",o=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),c=(t=e.errSchemaPath+"/"+t,!e.opts.allErrors),h="data"+(s||""),d="valid"+o,u=e.opts.$data&&a&&a.$data;s=u?(r+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ","schema"+o):a;return(a||u)&&!1!==e.opts.uniqueItems?(u&&(r+=" var "+d+"; if ("+s+" === false || "+s+" === undefined) "+d+" = true; else if (typeof "+s+" != 'boolean') "+d+" = false; else { "),r+=" var i = "+h+".length , "+d+" = true , j; if (i > 1) { ",o=e.schema.items&&e.schema.items.type,s=Array.isArray(o),!o||"object"==o||"array"==o||s&&(0<=o.indexOf("object")||0<=o.indexOf("array"))?r+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+d+" = false; break outer; } } } ":(r=(r+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ")+" if ("+e.util["checkDataType"+(s?"s":"")](o,"item",e.opts.strictNumbers,!0)+") continue; ",s&&(r+=" if (typeof item == 'string') item = '\"' + item; "),r+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "),r+=" } ",u&&(r+="  }  "),(n=n||[]).push(r+=" if (!"+d+") {   "),r="",!1!==e.createErrors?(r+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(r+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(r=(r+=" , schema:  ")+(u?"validate.schema"+l:""+a)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),r+=" } "):r+=" {} ",o=r,r=n.pop(),!e.compositeRule&&c?e.async?r+=" throw new ValidationError(["+o+"]); ":r+=" validate.errors = ["+o+"]; return false; ":r+=" var err = "+o+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",c&&(r+=" else { ")):c&&(r+=" if (true) { "),r}},1869:function(e){"use strict";e.exports=function(e,t,i){var n="",r=!0===e.schema.$async,o=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),s=e.self._getId(e.schema);if(e.opts.strictKeywords&&(T=e.util.schemaUnknownRules(e.schema,e.RULES.keywords))){if(T="unknown keyword: "+T,"log"!==e.opts.strictKeywords)throw new Error(T);e.logger.warn(T)}if(e.isTop&&(n+=" var validate = ",r&&(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||!o&&!e.schema.$ref)return l=e.level,c=e.dataLevel,B=e.schema[t="false schema"],A=e.schemaPath+e.util.getProperty(t),b=e.errSchemaPath+"/"+t,g=!e.opts.allErrors,h="data"+(c||""),u="valid"+l,!1===e.schema?(e.isTop?g=!0:n+=" var "+u+" = false; ",(M=M||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: 'boolean schema is false' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",R=n,n=M.pop(),!e.compositeRule&&g?e.async?n+=" throw new ValidationError(["+R+"]); ":n+=" validate.errors = ["+R+"]; return false; ":n+=" var err = "+R+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "):e.isTop?n+=r?" return data; ":" validate.errors = null; return true; ":n+=" var "+u+" = true; ",e.isTop&&(n+=" }; return validate; "),n;if(e.isTop){var a=e.isTop,l=e.level=0,c=e.dataLevel=0,h="data";if(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 d="default is ignored in the schema root";if("log"!==e.opts.strictDefaults)throw new Error(d);e.logger.warn(d)}n=(n+=" var vErrors = null; ")+" var errors = 0;      if (rootData === undefined) rootData = data; "}else{if(l=e.level,h="data"+((c=e.dataLevel)||""),s&&(e.baseId=e.resolve.url(e.baseId,s)),r&&!e.async)throw new Error("async schema in sync schema");n+=" var errs_"+l+" = errors;"}var u="valid"+l,g=!e.opts.allErrors,p="",m="",f=e.schema.type,C=Array.isArray(f);if(f&&e.opts.nullable&&!0===e.schema.nullable&&(C?-1==f.indexOf("null")&&(f=f.concat("null")):"null"!=f&&(f=[f,"null"],C=!0)),C&&1==f.length&&(f=f[0],C=!1),e.schema.$ref&&o){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&&(o=!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")),f){e.opts.coerceTypes&&(I=e.util.coerceToTypes(e.opts.coerceTypes,f));var I,v=e.RULES.types[f];if(I||C||!0===v||v&&!z(v)){var A=e.schemaPath+".type",b=e.errSchemaPath+"/type";A=e.schemaPath+".type",b=e.errSchemaPath+"/type";if(n+=" if ("+e.util[C?"checkDataTypes":"checkDataType"](f,h,e.opts.strictNumbers,!0)+") { ",I){var y="dataType"+l,w="coerced"+l,S=(n+=" var "+y+" = typeof "+h+"; var "+w+" = undefined; ","array"==e.opts.coerceTypes&&(n+=" if ("+y+" == 'object' && Array.isArray("+h+") && "+h+".length == 1) { "+h+" = "+h+"[0]; "+y+" = typeof "+h+"; if ("+e.util.checkDataType(e.schema.type,h,e.opts.strictNumbers)+") "+w+" = "+h+"; } "),n+=" if ("+w+" !== undefined) ; ",I);if(S)for(var x,k=-1,E=S.length-1;k<E;)"string"==(x=S[k+=1])?n+=" else if ("+y+" == 'number' || "+y+" == 'boolean') "+w+" = '' + "+h+"; else if ("+h+" === null) "+w+" = ''; ":"number"==x||"integer"==x?(n+=" else if ("+y+" == 'boolean' || "+h+" === null || ("+y+" == 'string' && "+h+" && "+h+" == +"+h+" ","integer"==x&&(n+=" && !("+h+" % 1)"),n+=")) "+w+" = +"+h+"; "):"boolean"==x?n+=" else if ("+h+" === 'false' || "+h+" === 0 || "+h+" === null) "+w+" = false; else if ("+h+" === 'true' || "+h+" === 1) "+w+" = true; ":"null"==x?n+=" else if ("+h+" === '' || "+h+" === 0 || "+h+" === false) "+w+" = null; ":"array"==e.opts.coerceTypes&&"array"==x&&(n+=" else if ("+y+" == 'string' || "+y+" == 'number' || "+y+" == 'boolean' || "+h+" == null) "+w+" = ["+h+"]; ");(M=M||[]).push(n+=" else {   "),n="",!1!==e.createErrors?(n=(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: { type: '")+(C?""+f.join(","):""+f)+"' } ",!1!==e.opts.messages&&(n=(n+=" , message: 'should be ")+(C?""+f.join(","):""+f)+"' "),e.opts.verbose&&(n+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var R=n,T=(n=M.pop(),!e.compositeRule&&g?e.async?n+=" throw new ValidationError(["+R+"]); ":n+=" validate.errors = ["+R+"]; return false; ":n+=" var err = "+R+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c?"data"+(c-1||""):"parentData");n=n+" } if ("+w+" !== undefined) {   "+h+" = "+w+"; ",c||(n+="if ("+T+" !== undefined)"),n+=" "+T+"["+(c?e.dataPathArr[c]:"parentDataProperty")+"] = "+w+"; } "}else(M=M||[]).push(n),n="",!1!==e.createErrors?(n=(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: { type: '")+(C?""+f.join(","):""+f)+"' } ",!1!==e.opts.messages&&(n=(n+=" , message: 'should be ")+(C?""+f.join(","):""+f)+"' "),e.opts.verbose&&(n+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",R=n,n=M.pop(),!e.compositeRule&&g?e.async?n+=" throw new ValidationError(["+R+"]); ":n+=" validate.errors = ["+R+"]; return false; ":n+=" var err = "+R+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";n+=" } "}}if(e.schema.$ref&&!o)n+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",g&&(n=(n+=" } if (errors === ")+(a?"0":"errs_"+l)+") { ",m+="}");else{var _=e.RULES;if(_)for(var $=-1,L=_.length-1;$<L;)if(z(v=_[$+=1])){if(v.type&&(n+=" if ("+e.util.checkDataType(v.type,h,e.opts.strictNumbers)+") { "),e.opts.useDefaults)if("object"==v.type&&e.schema.properties){var B=e.schema.properties,W=Object.keys(B);if(W)for(var N,G=-1,P=W.length-1;G<P;)if(void 0!==(V=B[N=W[G+=1]]).default){var F=h+e.util.getProperty(N);if(e.compositeRule){if(e.opts.strictDefaults){if(d="default is ignored for: "+F,"log"!==e.opts.strictDefaults)throw new Error(d);e.logger.warn(d)}}else n+=" if ("+F+" === undefined ","empty"==e.opts.useDefaults&&(n+=" || "+F+" === null || "+F+" === '' "),n+=" ) "+F+" = ","shared"==e.opts.useDefaults?n+=" "+e.useDefault(V.default)+" ":n+=" "+JSON.stringify(V.default)+" ",n+="; "}}else if("array"==v.type&&Array.isArray(e.schema.items)){var H=e.schema.items;if(H){k=-1;for(var V,Z=H.length-1;k<Z;)if(void 0!==(V=H[k+=1]).default)if(F=h+"["+k+"]",e.compositeRule){if(e.opts.strictDefaults){if(d="default is ignored for: "+F,"log"!==e.opts.strictDefaults)throw new Error(d);e.logger.warn(d)}}else n+=" if ("+F+" === undefined ","empty"==e.opts.useDefaults&&(n+=" || "+F+" === null || "+F+" === '' "),n+=" ) "+F+" = ","shared"==e.opts.useDefaults?n+=" "+e.useDefault(V.default)+" ":n+=" "+JSON.stringify(V.default)+" ",n+="; "}}var M,O=v.rules;if(O)for(var D,K=-1,j=O.length-1;K<j;)!X(D=O[K+=1])||(D=D.code(e,D.keyword,v.type))&&(n+=" "+D+" ",g&&(p+="}"));g&&(n+=" "+p+" ",p=""),v.type&&(n+=" } ",f&&f===v.type&&!I&&(n+=" else { ",A=e.schemaPath+".type",b=e.errSchemaPath+"/type",(M=M||[]).push(n),n="",!1!==e.createErrors?(n=(n+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(b)+" , params: { type: '")+(C?""+f.join(","):""+f)+"' } ",!1!==e.opts.messages&&(n=(n+=" , message: 'should be ")+(C?""+f.join(","):""+f)+"' "),e.opts.verbose&&(n+=" , schema: validate.schema"+A+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",R=n,n=M.pop(),!e.compositeRule&&g?e.async?n+=" throw new ValidationError(["+R+"]); ":n+=" validate.errors = ["+R+"]; return false; ":n+=" var err = "+R+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ")),g&&(n=(n+=" if (errors === ")+(a?"0":"errs_"+l)+") { ",m+="}")}}function z(e){for(var t=e.rules,i=0;i<t.length;i++)if(X(t[i]))return 1}function X(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 1}(t)}return g&&(n+=" "+m+" "),a?n=n+(r?" if (errors === 0) return data;            else throw new ValidationError(vErrors); ":" validate.errors = vErrors;  return errors === 0;       ")+" }; return validate;":n+=" var "+u+" = errors === errs_"+l+";",n}},7931:function(e,t,i){"use strict";var n=/^[a-z_$][a-z0-9_$-]*$/i,r=i(1793),o=i(5868);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 o=t.type;if(Array.isArray(o))for(var s=0;s<o.length;s++)l(e,o[s],t);else l(e,o,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 o,s=0;s<i.length;s++){var a=i[s];if(a.type==t){o=a;break}}o||i.push(o={type:t,rules:[]}),n={keyword:e,definition:n,custom:!0,code:r,implements:n.implements},o.rules.push(n),i.custom[e]=n}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,r=0;r<n.length;r++)if(n[r].keyword==e){n.splice(r,1);break}return this},validate:function e(t,i){e.errors=null;var n=this._validateKeyword=this._validateKeyword||this.compile(o,!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}}},2303: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,r,o;if(Array.isArray(t)){if((n=t.length)!=i.length)return!1;for(r=n;0!=r--;)if(!e(t[r],i[r]))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=(o=Object.keys(t)).length)!==Object.keys(i).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(i,o[r]))return!1;for(r=n;0!=r--;){var s=o[r];if(!e(t[s],i[s]))return!1}return!0}return t!=t&&i!=i}},3508:function(e){"use strict";e.exports=function(e,t){var i,n="boolean"==typeof(t="function"==typeof(t=t||{})?{cmp:t}:t).cycles&&t.cycles,r=t.cmp&&(i=t.cmp,function(e){return function(t,n){return t={key:t,value:e[t]},n={key:n,value:e[n]},i(t,n)}}),o=[];return function e(t){if(void 0!==(t=t&&t.toJSON&&"function"==typeof t.toJSON?t.toJSON():t)){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);if(Array.isArray(t)){for(a="[",l=0;l<t.length;l++)l&&(a+=","),a+=e(t[l])||"null";return a+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}for(var i=o.push(t)-1,s=Object.keys(t).sort(r&&r(t)),a="",l=0;l<s.length;l++){var c=s[l],h=e(t[c]);h&&(a&&(a+=","),a+=JSON.stringify(c)+":"+h)}return o.splice(i,1),"{"+a+"}"}}(e)}},233:function(e){e.exports=function e(t,i){"use strict";function n(t){return e.insensitive&&(""+t).toLowerCase()||""+t}var r,o,s=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,a=/(^[ ]*|[ ]*$)/g,l=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0x[0-9a-f]+$/i,h=/^0/,d=(t=n(t).replace(a,"")||"",i=n(i).replace(a,"")||"",t.replace(s,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")),u=i.replace(s,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0");a=parseInt(t.match(c),16)||1!==d.length&&t.match(l)&&Date.parse(t);if(s=parseInt(i.match(c),16)||a&&i.match(l)&&Date.parse(i)||null){if(a<s)return-1;if(s<a)return 1}for(var g=0,p=Math.max(d.length,u.length);g<p;g++){if(r=!(d[g]||"").match(h)&&parseFloat(d[g])||d[g]||0,o=!(u[g]||"").match(h)&&parseFloat(u[g])||u[g]||0,isNaN(r)!==isNaN(o))return isNaN(r)?1:-1;if(typeof r!=typeof o&&(r+="",o+=""),r<o)return-1;if(o<r)return 1}return 0}},5156: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,r){if(e===r)return!0;if(Object.prototype.toString.call(e)!==Object.prototype.toString.call(r))return!1;if(!0===t(e)){if(e.length!==r.length)return!1;for(var o=0;o<e.length;o++)if(!1===n(e[o],r[o]))return!1;return!0}if(!0!==i(e))return!1;var s,a,l={};for(s in e)if(hasOwnProperty.call(e,s)){if(!1===n(e[s],r[s]))return!1;l[s]=!0}for(a in r)if(hasOwnProperty.call(r,a)&&!0!==l[a])return!1;return!0}function r(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 o="function"==typeof String.prototype.trimLeft?function(e){return e.trimLeft()}:function(e){return e.match(/^\s*(.*)/)[1]},s={0:"number",1:"any",2:"string",3:"array",4:"object",5:"boolean",6:"expression",7:"null",8:"Array<number>",9:"Array<string>"},a="UnquotedIdentifier",l="QuotedIdentifier",c="Rbracket",h="Rparen",d="Comma",u="Colon",g="Rbrace",p="Number",m="Current",f="Expref",C="Pipe",I="Flatten",v="Star",A="Filter",b="Lbrace",y="Lbracket",w="Lparen",S="Literal",x={".":"Dot","*":v,",":d,":":u,"{":b,"}":g,"]":c,"(":w,")":h,"@":m},k={"<":!0,">":!0,"=":!0,"!":!0},E={" ":!0,"\t":!0,"\n":!0};function R(e){return"0"<=e&&e<="9"||"-"===e}function T(){}T.prototype={tokenize:function(e){var t,i,n=[];for(this._current=0;this._current<e.length;)if("a"<=(o=e[this._current])&&o<="z"||"A"<=o&&o<="Z"||"_"===o)r=this._current,t=this._consumeUnquotedIdentifier(e),n.push({type:a,value:t,start:r});else if(void 0!==x[e[this._current]])n.push({type:x[e[this._current]],value:e[this._current],start:this._current}),this._current++;else if(R(e[this._current]))i=this._consumeNumber(e),n.push(i);else if("["===e[this._current])i=this._consumeLBracket(e),n.push(i);else if('"'===e[this._current])r=this._current,t=this._consumeQuotedIdentifier(e),n.push({type:l,value:t,start:r});else if("'"===e[this._current])r=this._current,t=this._consumeRawStringLiteral(e),n.push({type:S,value:t,start:r});else if("`"===e[this._current]){var r=this._current,o=this._consumeLiteral(e);n.push({type:S,value:o,start:r})}else if(void 0!==k[e[this._current]])n.push(this._consumeOperator(e));else if(void 0!==E[e[this._current]])this._current++;else if("&"===e[this._current])r=this._current,this._current++,"&"===e[this._current]?(this._current++,n.push({type:"And",value:"&&",start:r})):n.push({type:f,value:"&",start:r});else{if("|"!==e[this._current])throw(o=new Error("Unknown character:"+e[this._current])).name="LexerError",o;r=this._current,this._current++,"|"===e[this._current]?(this._current++,n.push({type:"Or",value:"||",start:r})):n.push({type:C,value:"|",start:r})}return n},_consumeUnquotedIdentifier:function(e){var t,i=this._current;for(this._current++;this._current<e.length&&("a"<=(t=e[this._current])&&t<="z"||"A"<=t&&t<="Z"||"0"<=t&&t<="9"||"_"===t);)this._current++;return e.slice(i,this._current)},_consumeQuotedIdentifier:function(e){for(var t=this._current,i=(this._current++,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){for(var t=this._current,i=(this._current++,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){for(var t=this._current,i=(this._current++,e.length);R(e[this._current])&&this._current<i;)this._current++;var n=parseInt(e.slice(t,this._current));return{type:p,value:n,start:t}},_consumeLBracket:function(e){var t=this._current;return this._current++,"?"===e[this._current]?(this._current++,{type:A,value:"[?",start:t}):"]"===e[this._current]?(this._current++,{type:I,value:"[]",start:t}):{type:y,value:"[",start:t}},_consumeOperator:function(e){var t=this._current,i=e[t];return this._current++,"!"===i?"="===e[this._current]?(this._current++,{type:"NE",value:"!=",start:t}):{type:"Not",value:"!",start:t}:"<"===i?"="===e[this._current]?(this._current++,{type:"LTE",value:"<=",start:t}):{type:"LT",value:"<",start:t}:">"===i?"="===e[this._current]?(this._current++,{type:"GTE",value:">=",start:t}):{type:"GT",value:">",start:t}:"="===i&&"="===e[this._current]?(this._current++,{type:"EQ",value:"==",start:t}):void 0},_consumeLiteral:function(e){this._current++;for(var t=this._current,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 t=(t=o(e.slice(t,this._current))).replace("\\`","`"),t=this._looksLikeJSON(t)?JSON.parse(t):JSON.parse('"'+t+'"'),this._current++,t},_looksLikeJSON:function(e){if(""===e)return!1;if(0<='[{"'.indexOf(e[0]))return!0;if(0<=["true","false","null"].indexOf(e))return!0;if(!(0<="-0123456789".indexOf(e[0])))return!1;try{return JSON.parse(e),!0}catch(e){return!1}}};var _={};function $(){}function L(e){this.runtime=e}function B(e){this._interpreter=e,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[0]}]},avg:{_func:this._functionAvg,_signature:[{types:[8]}]},ceil:{_func:this._functionCeil,_signature:[{types:[0]}]},contains:{_func:this._functionContains,_signature:[{types:[2,3]},{types:[1]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[2]},{types:[2]}]},floor:{_func:this._functionFloor,_signature:[{types:[0]}]},length:{_func:this._functionLength,_signature:[{types:[2,3,4]}]},map:{_func:this._functionMap,_signature:[{types:[6]},{types:[3]}]},max:{_func:this._functionMax,_signature:[{types:[8,9]}]},merge:{_func:this._functionMerge,_signature:[{types:[4],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[3]},{types:[6]}]},sum:{_func:this._functionSum,_signature:[{types:[8]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[2]},{types:[2]}]},min:{_func:this._functionMin,_signature:[{types:[8,9]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[3]},{types:[6]}]},type:{_func:this._functionType,_signature:[{types:[1]}]},keys:{_func:this._functionKeys,_signature:[{types:[4]}]},values:{_func:this._functionValues,_signature:[{types:[4]}]},sort:{_func:this._functionSort,_signature:[{types:[9,8]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[3]},{types:[6]}]},join:{_func:this._functionJoin,_signature:[{types:[2]},{types:[9]}]},reverse:{_func:this._functionReverse,_signature:[{types:[2,3]}]},to_array:{_func:this._functionToArray,_signature:[{types:[1]}]},to_string:{_func:this._functionToString,_signature:[{types:[1]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[1]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[1],variadic:!0}]}}}_.EOF=0,_[a]=0,_[l]=0,_[c]=0,_[h]=0,_[d]=0,_[g]=0,_[p]=0,_[m]=0,_[f]=0,_.Pipe=1,_.Or=2,_.And=3,_.EQ=5,_.GT=5,_.LT=5,_.GTE=5,_.LTE=5,_.NE=5,_[I]=9,_.Star=20,_[A]=21,_.Dot=40,_.Not=45,_[b]=50,_[y]=55,_[w]=60,$.prototype={parse:function(e){this._loadTokens(e),this.index=0;var t;e=this.expression(0);if("EOF"!==this._lookahead(0))throw t=this._lookaheadToken(0),(t=new Error("Unexpected token type: "+t.type+", value: "+t.value)).name="ParserError",t;return e},_loadTokens:function(e){var t=(new T).tokenize(e);t.push({type:"EOF",value:"",start:e.length}),this.tokens=t},expression:function(e){for(var t=this._lookaheadToken(0),i=(this._advance(),this.nud(t)),n=this._lookahead(0);e<_[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 S:return{type:"Literal",value:e.value};case a:return{type:"Field",name:e.value};case l:var n={type:"Field",name:e.value};if(this._lookahead(0)===w)throw new Error("Quoted identifier not allowed for function names.");return n;case"Not":return{type:"NotExpression",children:[t=this.expression(_.Not)]};case v:return t=null,{type:"ValueProjection",children:[{type:"Identity"},t=this._lookahead(0)===c?{type:"Identity"}:this._parseProjectionRHS(_.Star)]};case A:return this.led(e.type,{type:"Identity"});case b:return this._parseMultiselectHash();case I:return{type:"Projection",children:[{type:I,children:[{type:"Identity"}]},t=this._parseProjectionRHS(_.Flatten)]};case y:return this._lookahead(0)===p||this._lookahead(0)===u?(t=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},t)):this._lookahead(0)===v&&this._lookahead(1)===c?(this._advance(),this._advance(),{type:"Projection",children:[{type:"Identity"},t=this._parseProjectionRHS(_.Star)]}):this._parseMultiselectList();case m:return{type:m};case f:return{type:"ExpressionReference",children:[i=this.expression(_.Expref)]};case w:for(var r=[];this._lookahead(0)!==h;)this._lookahead(0)===m?(i={type:m},this._advance()):i=this.expression(0),r.push(i);return this._match(h),r[0];default:this._errorToken(e)}},led:function(e,t){var i;switch(e){case"Dot":var n=_.Dot;return this._lookahead(0)!==v?{type:"Subexpression",children:[t,i=this._parseDotRHS(n)]}:(this._advance(),{type:"ValueProjection",children:[t,i=this._parseProjectionRHS(n)]});case C:return i=this.expression(_.Pipe),{type:C,children:[t,i]};case"Or":return{type:"OrExpression",children:[t,i=this.expression(_.Or)]};case"And":return{type:"AndExpression",children:[t,i=this.expression(_.And)]};case w:n=t.name;for(var r,o=[];this._lookahead(0)!==h;)this._lookahead(0)===m?(r={type:m},this._advance()):r=this.expression(0),this._lookahead(0)===d&&this._match(d),o.push(r);return this._match(h),{type:"Function",name:n,children:o};case A:return n=this.expression(0),this._match(c),{type:"FilterProjection",children:[t,i=this._lookahead(0)===I?{type:"Identity"}:this._parseProjectionRHS(_.Filter),n]};case I:return{type:"Projection",children:[{type:I,children:[t]},this._parseProjectionRHS(_.Flatten)]};case"EQ":case"NE":case"GT":case"GTE":case"LT":case"LTE":return this._parseComparator(t,e);case y:return(n=this._lookaheadToken(0)).type===p||n.type===u?(i=this._parseIndexExpression(),this._projectIfSlice(t,i)):(this._match(v),this._match(c),{type:"Projection",children:[t,i=this._parseProjectionRHS(_.Star)]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(e){var t;if(this._lookahead(0)!==e)throw t=this._lookaheadToken(0),(e=new Error("Expected "+e+", got: "+t.type)).name="ParserError",e;this._advance()},_errorToken:function(e){throw(e=new Error("Invalid token ("+e.type+'): "'+e.value+'"')).name="ParserError",e},_parseIndexExpression:function(){var e;return this._lookahead(0)===u||this._lookahead(1)===u?this._parseSliceExpression():(e={type:"Index",value:this._lookaheadToken(0).value},this._advance(),this._match(c),e)},_projectIfSlice:function(e,t){return e={type:"IndexExpression",children:[e,t]},"Slice"===t.type?{type:"Projection",children:[e,this._parseProjectionRHS(_.Star)]}:e},_parseSliceExpression:function(){for(var e,t=[null,null,null],i=0,n=this._lookahead(0);n!==c&&i<3;){if(n===u)i++,this._advance();else{if(n!==p)throw e=this._lookahead(0),(e=new Error("Syntax error, unexpected token: "+e.value+"("+e.type+")")).name="Parsererror",e;t[i]=this._lookaheadToken(0).value,this._advance()}n=this._lookahead(0)}return this._match(c),{type:"Slice",children:t}},_parseComparator:function(e,t){return{type:"Comparator",name:t,children:[e,this.expression(_[t])]}},_parseDotRHS:function(e){var t=this._lookahead(0);return 0<=[a,l,v].indexOf(t)?this.expression(e):t===y?(this._match(y),this._parseMultiselectList()):t===b?(this._match(b),this._parseMultiselectHash()):void 0},_parseProjectionRHS:function(e){var t,i;if(_[this._lookahead(0)]<10)t={type:"Identity"};else if(this._lookahead(0)===y)t=this.expression(e);else if(this._lookahead(0)===A)t=this.expression(e);else{if("Dot"!==this._lookahead(0))throw i=this._lookaheadToken(0),(i=new Error("Sytanx error, unexpected token: "+i.value+"("+i.type+")")).name="ParserError",i;this._match("Dot"),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)===d&&(this._match(d),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=[a,l];;){if(e=this._lookaheadToken(0),n.indexOf(e.type)<0)throw new Error("Expecting an identifier token, got: "+e.type);if(e=e.value,this._advance(),this._match(u),t=this.expression(0),i.push({type:"KeyValuePair",name:e,value:t}),this._lookahead(0)===d)this._match(d);else if(this._lookahead(0)===g){this._match(g);break}}return{type:"MultiSelectHash",children:i}}},L.prototype={search:function(e,t){return this.visit(e,t)},visit:function(e,o){var s,a,l,c,h,d;switch(e.type){case"Field":return null!==o&&i(o)?void 0===(u=o[e.name])?null:u:null;case"Subexpression":for(A=this.visit(e.children[0],o),S=1;S<e.children.length;S++)if(null===(A=this.visit(e.children[1],A)))return null;return A;case"IndexExpression":return h=this.visit(e.children[0],o),this.visit(e.children[1],h);case"Index":return t(o)?void 0===(A=o[u=(u=e.value)<0?o.length+u:u])?null:A:null;case"Slice":if(!t(o))return null;var u=e.children.slice(0),g=(u=this.computeSliceParams(o.length,u))[0],p=u[1],v=u[2],A=[];if(0<v)for(S=g;S<p;S+=v)A.push(o[S]);else for(S=g;p<S;S+=v)A.push(o[S]);return A;case"Projection":var b=this.visit(e.children[0],o);if(!t(b))return null;for(y=[],S=0;S<b.length;S++)null!==(a=this.visit(e.children[1],b[S]))&&y.push(a);return y;case"ValueProjection":if(!i(b=this.visit(e.children[0],o)))return null;for(var y=[],w=function(e){for(var t=Object.keys(e),i=[],n=0;n<t.length;n++)i.push(e[t[n]]);return i}(b),S=0;S<w.length;S++)null!==(a=this.visit(e.children[1],w[S]))&&y.push(a);return y;case"FilterProjection":if(!t(b=this.visit(e.children[0],o)))return null;var x=[],k=[];for(S=0;S<b.length;S++)r(s=this.visit(e.children[2],b[S]))||x.push(b[S]);for(var E=0;E<x.length;E++)null!==(a=this.visit(e.children[1],x[E]))&&k.push(a);return k;case"Comparator":switch(l=this.visit(e.children[0],o),c=this.visit(e.children[1],o),e.name){case"EQ":A=n(l,c);break;case"NE":A=!n(l,c);break;case"GT":A=c<l;break;case"GTE":A=c<=l;break;case"LT":A=l<c;break;case"LTE":A=l<=c;break;default:throw new Error("Unknown comparator: "+e.name)}return A;case I:var R=this.visit(e.children[0],o);if(!t(R))return null;var T=[];for(S=0;S<R.length;S++)t(a=R[S])?T.push.apply(T,a):T.push(a);return T;case"Identity":return o;case"MultiSelectList":if(null===o)return null;for(y=[],S=0;S<e.children.length;S++)y.push(this.visit(e.children[S],o));return y;case"MultiSelectHash":if(null===o)return null;for(y={},S=0;S<e.children.length;S++)y[(d=e.children[S]).name]=this.visit(d.value,o);return y;case"OrExpression":return r(s=this.visit(e.children[0],o))?this.visit(e.children[1],o):s;case"AndExpression":return!0===r(l=this.visit(e.children[0],o))?l:this.visit(e.children[1],o);case"NotExpression":return r(l=this.visit(e.children[0],o));case"Literal":return e.value;case C:return h=this.visit(e.children[0],o),this.visit(e.children[1],h);case m:return o;case"Function":var _=[];for(S=0;S<e.children.length;S++)_.push(this.visit(e.children[S],o));return this.runtime.callFunction(e.name,_);case"ExpressionReference":return(u=e.children[0]).jmespathType=f,u;default:throw new Error("Unknown node type: "+e.type)}},computeSliceParams:function(e,t){var i=t[0],n=t[1],r=[null,null,null];if(null===(t=t[2]))t=1;else if(0===t)throw(o=new Error("Invalid slice, step cannot be 0")).name="RuntimeError",o;var o=t<0;i=null===i?o?e-1:0:this.capSliceRange(e,i,t),n=null===n?o?-1:e:this.capSliceRange(e,n,t);return r[0]=i,r[1]=n,r[2]=t,r},capSliceRange:function(e,t,i){return t<0?(t+=e)<0&&(t=i<0?-1:0):e<=t&&(t=i<0?e-1:e),t}},B.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;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 r=0;r<i.length;r++){for(var o,a=!1,l=i[r].types,c=this._getTypeName(t[r]),h=0;h<l.length;h++)if(this._typeMatches(c,l[h],t[r])){a=!0;break}if(!a)throw o=l.map((function(e){return s[e]})).join(","),new Error("TypeError: "+e+"() expected argument "+(r+1)+" to be type "+o+" but received type "+s[c]+" instead.")}},_typeMatches:function(e,t,i){if(1===t)return!0;if(9!==t&&8!==t&&3!==t)return e===t;if(3===t)return 3===e;if(3===e){var n;8===t?n=0:9===t&&(n=2);for(var r=0;r<i.length;r++)if(!this._typeMatches(this._getTypeName(i[r]),n,i[r]))return!1;return!0}},_getTypeName:function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return 2;case"[object Number]":return 0;case"[object Array]":return 3;case"[object Boolean]":return 5;case"[object Null]":return 7;case"[object Object]":return e.jmespathType===f?6:4}},_functionStartsWith:function(e){return 0===e[0].lastIndexOf(e[1])},_functionEndsWith:function(e){var t=e[0];e=e[1];return-1!==t.indexOf(e,t.length-e.length)},_functionReverse:function(e){var t;if(2!==this._getTypeName(e[0]))return(t=e[0].slice(0)).reverse(),t;for(var i=e[0],n="",r=i.length-1;0<=r;r--)n+=i[r];return n},_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 0<=e[0].indexOf(e[1])},_functionFloor:function(e){return Math.floor(e[0])},_functionLength:function(e){return(i(e[0])?Object.keys(e[0]):e[0]).length},_functionMap:function(e){for(var t=[],i=this._interpreter,n=e[0],r=e[1],o=0;o<r.length;o++)t.push(i.visit(n,r[o]));return t},_functionMerge:function(e){for(var t={},i=0;i<e.length;i++){var n,r=e[i];for(n in r)t[n]=r[n]}return t},_functionMax:function(e){if(0<e[0].length){if(0===this._getTypeName(e[0][0]))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(0<e[0].length){if(0===this._getTypeName(e[0][0]))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 0:return"number";case 2:return"string";case 3:return"array";case 4:return"object";case 5:return"boolean";case 6: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=[],r=0;r<i.length;r++)n.push(t[i[r]]);return n},_functionJoin:function(e){var t=e[0];return e[1].join(t)},_functionToArray:function(e){return 3===this._getTypeName(e[0])?e[0]:[e[0]]},_functionToString:function(e){return 2===this._getTypeName(e[0])?e[0]:JSON.stringify(e[0])},_functionToNumber:function(e){var t=this._getTypeName(e[0]);return 0===t?e[0]:2!==t||(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){return(e=e[0].slice(0)).sort(),e},_functionSortBy:function(e){var t=e[0].slice(0);if(0===t.length)return t;var i=this._interpreter,n=e[1],r=this._getTypeName(i.visit(n,t[0]));if([0,2].indexOf(r)<0)throw new Error("TypeError");for(var o=this,s=[],a=0;a<t.length;a++)s.push([a,t[a]]);s.sort((function(e,t){var s=i.visit(n,e[1]),a=i.visit(n,t[1]);if(o._getTypeName(s)!==r)throw new Error("TypeError: expected "+r+", received "+o._getTypeName(s));if(o._getTypeName(a)!==r)throw new Error("TypeError: expected "+r+", received "+o._getTypeName(a));return a<s?1:s<a?-1:e[0]-t[0]}));for(var l=0;l<s.length;l++)t[l]=s[l][1];return t},_functionMaxBy:function(e){for(var t,i,n=e[1],r=e[0],o=this.createKeyFunction(n,[0,2]),s=-1/0,a=0;a<r.length;a++)s<(i=o(r[a]))&&(s=i,t=r[a]);return t},_functionMinBy:function(e){for(var t,i,n=e[1],r=e[0],o=this.createKeyFunction(n,[0,2]),s=1/0,a=0;a<r.length;a++)(i=o(r[a]))<s&&(s=i,t=r[a]);return t},createKeyFunction:function(e,t){var i=this,n=this._interpreter;return function(r){var o;r=n.visit(e,r);if(t.indexOf(i._getTypeName(r))<0)throw o="TypeError: expected one of "+t+", received "+i._getTypeName(r),new Error(o);return r}}},e.tokenize=function(e){return(new T).tokenize(e)},e.compile=function(e){return(new $).parse(e)},e.search=function(e,t){var i=new $,n=new L(r=new B),r=(r._interpreter=n,i.parse(t));return n.search(r,e)},e.strictDeepEqual=n}(t)},500:function(e){"use strict";var t=e.exports=function(e,n,r){"function"==typeof n&&(r=n,n={}),function e(n,r,o,s,a,l,c,h,d,u){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var g in r(s,a,l,c,h,d,u),s){var p=s[g];if(Array.isArray(p)){if(g in t.arrayKeywords)for(var m=0;m<p.length;m++)e(n,r,o,p[m],a+"/"+g+"/"+m,l,a,g,s,m)}else if(g in t.propsKeywords){if(p&&"object"==typeof p)for(var f in p)e(n,r,o,p[f],a+"/"+g+"/"+i(f),l,a,g,s,f)}else(g in t.keywords||n.allKeys&&!(g in t.skipKeywords))&&e(n,r,o,p,a+"/"+g,l,a,g,s)}o(s,a,l,c,h,d,u)}}(n,"function"==typeof(r=n.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function i(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}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}},7026:function(e,t){"use strict";var i={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",'"':'"',"/":"/","\\":"\\"},n="a".charCodeAt(),r=(t.parse=function(e,t,r){var o={},s=0,a=0,l=0,c=r&&r.bigint&&"undefined"!=typeof BigInt;return{data:function t(i,n){h(),C(i,"value");var r,o=g();switch(o){case"t":u("rue"),r=!0;break;case"f":u("alse"),r=!1;break;case"n":u("ull"),r=null;break;case'"':r=d();break;case"[":r=function(e){h();var i=[],n=0;if("]"==g())return i;for(p();;){var r=e+"/"+n;r=(i.push(t(r)),h(),g());if("]"==r)break;","!=r&&b(),h(),n++}return i}(i);break;case"{":r=function(e){h();var i={};if("}"==g())return i;for(p();;){var n=v(),r=('"'!=g()&&b(),d()),o=e+"/"+m(r);n=(I(o,"key",n),C(o,"keyEnd"),h(),":"!=g()&&b(),h(),i[r]=t(o),h(),g());if("}"==n)break;","!=n&&b(),h()}return i}(i);break;default:p(),0<="-0123456789".indexOf(o)?r=function(){var t="",i=!0;"-"==e[l]&&(t+=g()),t+=("0"==e[l]?g:f)(),"."==e[l]&&(t+=g()+f(),i=!1),"e"!=e[l]&&"E"!=e[l]||(t+=g(),"+"!=e[l]&&"-"!=e[l]||(t+=g()),t+=f(),i=!1);var n=+t;return c&&i&&(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)?BigInt(t):n}():A()}return C(i,"valueEnd"),h(),n&&l<e.length&&A(),r}("",!0),pointers:o};function h(){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 d(){for(var e,t="";'"'!=(e=g());)"\\"==e?(e=g())in i?t+=i[e]:"u"==e?t+=function(){for(var e=4,t=0;e--;){t<<=4;var i=g().toLowerCase();"a"<=i&&i<="f"?t+=i.charCodeAt()-n+10:"0"<=i&&i<="9"?t+=+i:b()}return String.fromCharCode(t)}():b():t+=e;return t}function u(e){for(var t=0;t<e.length;t++)g()!==e[t]&&b()}function g(){y();var t=e[l];return l++,a++,t}function p(){l--,a--}function f(){for(var t="";"0"<=e[l]&&e[l]<="9";)t+=g();if(t.length)return t;y(),A()}function C(e,t){I(e,t,v())}function I(e,t,i){o[e]=o[e]||{},o[e][t]=i}function v(){return{line:s,column:a,pos:l}}function A(){throw new SyntaxError("Unexpected token "+e[l]+" in JSON at position "+l)}function b(){p(),A()}function y(){if(l>=e.length)throw new SyntaxError("Unexpected end of JSON input")}},t.stringify=function(e,t,i){if(o(e)){var n=0;switch(typeof(s="object"==typeof i?i.space:i)){case"number":var r=10<s?10:s<0?0:Math.floor(s),s=r&&b(r," "),a=r,l=r;break;case"string":s=s.slice(0,10);for(var c=l=a=0;c<s.length;c++){switch(s[c]){case" ":l++;break;case"\t":l+=4;break;case"\r":l=0;break;case"\n":l=0,n++;break;default:throw new Error("whitespace characters not allowed in JSON")}a++}break;default:s=void 0}var h="",d={},g=0,p=0,f=0,C=i&&i.es6&&"function"==typeof Map;return function e(t,i,n){switch(A(n,"value"),typeof t){case"number":case"bigint":case"boolean":I(""+t);break;case"string":I(u(t));break;case"object":null===t?I("null"):"function"==typeof t.toJSON?I(u(t.toJSON())):Array.isArray(t)?r():C?t.constructor.BYTES_PER_ELEMENT?r():t instanceof Map?l():t instanceof Set?l(!0):a():a()}function r(){if(t.length){I("[");for(var r=i+1,s=0;s<t.length;s++){s&&I(","),v(r);var a=o(t[s])?t[s]:null;e(a,r,n+"/"+s)}v(i),I("]")}else I("[]")}function a(){var r=Object.keys(t);if(r.length){I("{");for(var a=i+1,l=0;l<r.length;l++){var c,h=r[l],d=t[h];o(d)&&(l&&I(","),c=n+"/"+m(h),v(a),A(c,"key"),I(u(h)),A(c,"keyEnd"),I(":"),s&&I(" "),e(d,a,c))}v(i),I("}")}else I("{}")}function l(r){if(t.size){I("{");for(var a=i+1,l=!0,c=t.entries(),h=c.next();!h.done;){var d,g,p=(g=h.value)[0];o(g=!!r||g[1])&&(l||I(","),l=!1,d=n+"/"+m(p),v(a),A(d,"key"),I(u(p)),A(d,"keyEnd"),I(":"),s&&I(" "),e(g,a,d)),h=c.next()}v(i),I("}")}else I("{}")}A(n,"valueEnd")}(e,0,""),{json:h,pointers:d}}function I(e){p+=e.length,f+=e.length,h+=e}function v(e){if(s){for(h+="\n"+b(e,s),g++,p=0;e--;)n?(g+=n,p=l):p+=l,f+=a;f+=1}}function A(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)}},["number","bigint","boolean","string","object"]);function o(e){return 0<=r.indexOf(typeof e)}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")}},483:function(e,t){var i,n;!function(){"use strict";n=[],void 0!==(n="function"==typeof(i=function(){function e(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType}function t(){var e=[];return{watch:e.push.bind(e),trigger:function(t,i){for(var n=!0,r={detail:i,preventDefault:function(){n=!1}},o=0;o<e.length;o++)e[o](t,r);return n}}}function i(e){return"none"===window.getComputedStyle(e).display}function n(e){this.elem=e}function r(e,t){return n.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()}))}n.make=function(e,t){"string"==typeof e&&(e=document.querySelector(e));var i=document.createElement(t||"div");return(e||document.body).appendChild(i),new n(i)},n.prototype={child:function(e){return n.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 n(t)))return!0;t=t.parentNode}return!1},isVisible:function(){return!i(this.elem)}};var o=1;function s(e,t){var i=e("width","auto");"number"==typeof i&&(i+="px");var r=e("modalId","pico-"+o++);return n.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",r).attr("role","dialog").attr("aria-labelledby",e("ariaLabelledBy")).attr("aria-describedby",e("ariaDescribedBy",r)).onClick((function(e){new n(e.target).anyAncestor((function(e){return/\bpico-close\b/.test(e.elem.className)}))&&t()}))}function a(e,t){if(t("closeButton",!0))return e.child("button").html(t("closeHtml","&#xD7;")).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 l(e){return function(){return e().elem}}var c=t(),h=t();function d(e,t){function n(e,t){return(e.msMatchesSelector||e.webkitMatchesSelector||e.matches).call(e,t)}function r(e){return!(i(e)||n(e,":disabled")||e.hasAttribute("contenteditable"))&&(e.hasAttribute("tabindex")||n(e,"input,select,textarea,button,a[href],area[href],iframe"))}function o(e){for(var t=e.getElementsByTagName("*"),i=0;i<t.length;i++)if(r(t[i]))return t[i]}function s(e){for(var t=e.getElementsByTagName("*"),i=t.length;i--;)if(r(t[i]))return t[i]}var a;e.beforeShow((function(){a=document.activeElement})),e.afterShow((function(){if(t()){var i=o(e.modalElem());i&&i.focus()}})),e.afterClose((function(){t()&&a&&a.focus(),a=null})),h.watch((function(i){if(t()&&e.isVisible()){var n=o(e.modalElem()),r=s(e.modalElem());(i.shiftKey?n:r)===document.activeElement&&((i.shiftKey?r:n).focus(),i.preventDefault())}}))}function u(e,t){var i,r=new n(document.body);e.beforeShow((function(){i=r.elem.style.overflow,t()&&r.stylize({overflow:"hidden"})})),e.afterClose((function(){r.stylize({overflow:i})}))}return document.documentElement.addEventListener("keydown",(function(e){var t=e.which||e.keyCode;27===t?c.trigger():9===t&&h.trigger(e)})),function(i){(function(e){return"string"==typeof e}(i)||e(i))&&(i={content:i});var n=t(),o=t(),h=t(),g=t(),p=t();function m(e,t){var n=i[e];return"function"==typeof n&&(n=n(t)),void 0===n?t:n}var f,C,I=S.bind(window,"modal"),v=S.bind(window,"overlay"),A=S.bind(window,"close");function b(e){v().hide(),I().hide(),p.trigger(f,e)}function y(e){g.trigger(f,e)&&b(e)}function w(e){return function(){return e.apply(this,arguments),f}}function S(e,t){if(!C){var i=s(m,y);C={modal:i,overlay:r(m,y),close:a(i,m)},n.trigger(f,t)}return C[e]}return f={modalElem:l(I),closeElem:l(A),overlayElem:l(v),buildDom:w(S.bind(null,null)),isVisible:function(){return!!(C&&I&&I().isVisible())},show:function(e){return o.trigger(f,e)&&(v().show(),A(),I().show(),h.trigger(f,e)),this},close:w(y),forceClose:w(b),destroy:function(){I().destroy(),v().destroy(),v=I=A=void 0},options:function(e){Object.keys(e).map((function(t){i[t]=e[t]}))},afterCreate:w(n.watch),beforeShow:w(o.watch),afterShow:w(h.watch),beforeClose:w(g.watch),afterClose:w(p.watch)},d(f,m.bind(null,"focus",!0)),u(f,m.bind(null,"bodyOverflow",!0)),c.watch((function(){m("escCloses",!0)&&f.isVisible()&&f.close()})),f}})?i.apply(t,n):i)&&(e.exports=n)}()},7533: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,r=1;r<n;++r)t[r]=t[r].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 r(e){return e.toUpperCase()}function o(e){var n="[A-Za-z]",r="[0-9]",o=t(r,"[A-Fa-f]"),s=i(i("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+i("%[89A-Fa-f]"+o+"%"+o+o)+"|"+i("%"+o+o)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",l=t("[\\:\\/\\?\\#\\[\\]\\@]",a),c=e?"[\\uE000-\\uF8FF]":"[]",h=t(n,r,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),d=i(n+t(n,r,"[\\+\\-\\.]")+"*"),u=i(i(s+"|"+t(h,a,"[\\:]"))+"*"),g=(i(i("25[0-5]")+"|"+i("2[0-4]"+r)+"|"+i("1"+r+r)+"|"+i("[1-9]"+r)+"|"+r),i(i("25[0-5]")+"|"+i("2[0-4]"+r)+"|"+i("1"+r+r)+"|"+i("0?[1-9]"+r)+"|0?0?"+r)),p=i(g+"\\."+g+"\\."+g+"\\."+g),m=i(o+"{1,4}"),f=i(i(m+"\\:"+m)+"|"+p),C=i(i(m+"\\:")+"{6}"+f),I=i("\\:\\:"+i(m+"\\:")+"{5}"+f),v=i(i(m)+"?\\:\\:"+i(m+"\\:")+"{4}"+f),A=i(i(i(m+"\\:")+"{0,1}"+m)+"?\\:\\:"+i(m+"\\:")+"{3}"+f),b=i(i(i(m+"\\:")+"{0,2}"+m)+"?\\:\\:"+i(m+"\\:")+"{2}"+f),y=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([C,I,v,A,b,y,w,S,x].join("|")),E=i(i(h+"|"+s)+"+"),R=(i(k+"\\%25"+E),i(k+i("\\%25|\\%(?!"+o+"{2})")+E)),T=i("[vV]"+o+"+\\."+t(h,a,"[\\:]")+"+"),_=i("\\["+i(R+"|"+k+"|"+T)+"\\]"),$=i(i(s+"|"+t(h,a))+"*"),L=i(_+"|"+p+"(?!"+$+")|"+$),B=i(r+"*"),W=i(i(u+"@")+"?"+L+i("\\:"+B)+"?"),N=i(s+"|"+t(h,a,"[\\:\\@]")),G=i(N+"*"),P=i(N+"+"),F=i(i(s+"|"+t(h,a,"[\\@]"))+"+"),H=i(i("\\/"+G)+"*"),V=i("\\/"+i(P+H)+"?"),Z=i(F+H),M=i(P+H),O="(?!"+N+")",D=(i(H+"|"+V+"|"+Z+"|"+M+"|"+O),i(i(N+"|"+t("[\\/\\?]",c))+"*")),K=i(i(N+"|[\\/\\?]")+"*"),j=i(i("\\/\\/"+W+H)+"|"+V+"|"+M+"|"+O),z=i(d+"\\:"+j+i("\\?"+D)+"?"+i("\\#"+K)+"?"),X=i(i("\\/\\/"+W+H)+"|"+V+"|"+Z+"|"+O),J=i(X+i("\\?"+D)+"?"+i("\\#"+K)+"?");i(z+"|"+J),i(d+"\\:"+j+i("\\?"+D)+"?"),i(i("\\/\\/("+i("("+u+")@")+"?("+L+")"+i("\\:("+B+")")+"?)")+"?("+H+"|"+V+"|"+M+"|"+O+")"),i("\\?("+D+")"),i("\\#("+K+")"),i(i("\\/\\/("+i("("+u+")@")+"?("+L+")"+i("\\:("+B+")")+"?)")+"?("+H+"|"+V+"|"+Z+"|"+O+")"),i("\\?("+D+")"),i("\\#("+K+")"),i(i("\\/\\/("+i("("+u+")@")+"?("+L+")"+i("\\:("+B+")")+"?)")+"?("+H+"|"+V+"|"+M+"|"+O+")"),i("\\?("+D+")"),i("\\#("+K+")"),i("("+u+")@"),i("\\:("+B+")");return{NOT_SCHEME:new RegExp(t("[^]",n,r,"[\\+\\-\\.]"),"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|\\%(?!"+o+"{2})")+"("+E+")")+"?\\]?$")}}var s=o(!1),a=o(!0),l=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,r=!1,o=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){r=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw o}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},c=2147483647,h=36,d=/^xn--/,u=/[^\0-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,f=String.fromCharCode;function C(e){throw new RangeError(p[e])}function I(e,t){var i=e.split("@"),n="";i.length>1&&(n=i[0]+"@",e=i[1]);var r=function(e,t){for(var i=[],n=e.length;n--;)i[n]=t(e[n]);return i}((e=e.replace(g,".")).split("."),t).join(".");return n+r}function v(e){for(var t=[],i=0,n=e.length;i<n;){var r=e.charCodeAt(i++);if(r>=55296&&r<=56319&&i<n){var o=e.charCodeAt(i++);56320==(64512&o)?t.push(((1023&r)<<10)+(1023&o)+65536):(t.push(r),i--)}else t.push(r)}return t}var A=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:h},b=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},y=function(e,t,i){var n=0;for(e=i?m(e/700):e>>1,e+=m(e/t);e>455;n+=h)e=m(e/35);return m(n+36*e/(e+38))},w=function(e){var t=[],i=e.length,n=0,r=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var a=0;a<s;++a)e.charCodeAt(a)>=128&&C("not-basic"),t.push(e.charCodeAt(a));for(var l=s>0?s+1:0;l<i;){for(var d=n,u=1,g=h;;g+=h){l>=i&&C("invalid-input");var p=A(e.charCodeAt(l++));(p>=h||p>m((c-n)/u))&&C("overflow"),n+=p*u;var f=g<=o?1:g>=o+26?26:g-o;if(p<f)break;var I=h-f;u>m(c/I)&&C("overflow"),u*=I}var v=t.length+1;o=y(n-d,v,0==d),m(n/v)>c-r&&C("overflow"),r+=m(n/v),n%=v,t.splice(n++,0,r)}return String.fromCodePoint.apply(String,t)},S=function e(t){var i=[],n=(t=v(t)).length,r=128,o=0,s=72,a=!0,l=!1,d=void 0;try{for(var u,g=t[Symbol.iterator]();!(a=(u=g.next()).done);a=!0){var p=u.value;p<128&&i.push(f(p))}}catch(e){l=!0,d=e}finally{try{!a&&g.return&&g.return()}finally{if(l)throw d}}var I=i.length,A=I;for(I&&i.push("-");A<n;){var w=c,S=!0,x=!1,k=void 0;try{for(var E,R=t[Symbol.iterator]();!(S=(E=R.next()).done);S=!0){var T=E.value;T>=r&&T<w&&(w=T)}}catch(e){x=!0,k=e}finally{try{!S&&R.return&&R.return()}finally{if(x)throw k}}var _=A+1;w-r>m((c-o)/_)&&C("overflow"),o+=(w-r)*_,r=w;var $=!0,L=!1,B=void 0;try{for(var W,N=t[Symbol.iterator]();!($=(W=N.next()).done);$=!0){var G=W.value;if(G<r&&++o>c&&C("overflow"),G==r){for(var P=o,F=h;;F+=h){var H=F<=s?1:F>=s+26?26:F-s;if(P<H)break;var V=P-H,Z=h-H;i.push(f(b(H+V%Z,0))),P=m(V/Z)}i.push(f(b(P,0))),s=y(o,_,A==I),o=0,++A}}}catch(e){L=!0,B=e}finally{try{!$&&N.return&&N.return()}finally{if(L)throw B}}++o,++r}return i.join("")},x=function(e){return I(e,(function(e){return u.test(e)?"xn--"+S(e):e}))},k=function(e){return I(e,(function(e){return d.test(e)?w(e.slice(4).toLowerCase()):e}))},E={};function R(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 T(e){for(var t="",i=0,n=e.length;i<n;){var r=parseInt(e.substr(i+1,2),16);if(r<128)t+=String.fromCharCode(r),i+=3;else if(r>=194&&r<224){if(n-i>=6){var o=parseInt(e.substr(i+4,2),16);t+=String.fromCharCode((31&r)<<6|63&o)}else t+=e.substr(i,6);i+=6}else if(r>=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&r)<<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 _(e,t){function i(e){var i=T(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,R).replace(t.PCT_ENCODED,r)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,i).toLowerCase().replace(t.NOT_HOST,R).replace(t.PCT_ENCODED,r)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,i).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,R).replace(t.PCT_ENCODED,r)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,i).replace(t.NOT_QUERY,R).replace(t.PCT_ENCODED,r)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,i).replace(t.NOT_FRAGMENT,R).replace(t.PCT_ENCODED,r)),e}function $(e){return e.replace(/^0*(.*)/,"$1")||"0"}function L(e,t){var i=e.match(t.IPV4ADDRESS)||[],n=l(i,2)[1];return n?n.split(".").map($).join("."):e}function B(e,t){var i=e.match(t.IPV6ADDRESS)||[],n=l(i,3),r=n[1],o=n[2];if(r){for(var s=r.toLowerCase().split("::").reverse(),a=l(s,2),c=a[0],h=a[1],d=h?h.split(":").map($):[],u=c.split(":").map($),g=t.IPV4ADDRESS.test(u[u.length-1]),p=g?7:8,m=u.length-p,f=Array(p),C=0;C<p;++C)f[C]=d[C]||u[m+C]||"";g&&(f[p-1]=L(f[p-1],t));var I=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}),[]),v=I.sort((function(e,t){return t.length-e.length}))[0],A=void 0;if(v&&v.length>1){var b=f.slice(0,v.index),y=f.slice(v.index+v.length);A=b.join(":")+"::"+y.join(":")}else A=f.join(":");return o&&(A+="%"+o),A}return e}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,N=void 0==="".match(/(){0}/)[1];function G(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={},n=!1!==t.iri?a:s;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var r=e.match(W);if(r){N?(i.scheme=r[1],i.userinfo=r[3],i.host=r[4],i.port=parseInt(r[5],10),i.path=r[6]||"",i.query=r[7],i.fragment=r[8],isNaN(i.port)&&(i.port=r[5])):(i.scheme=r[1]||void 0,i.userinfo=-1!==e.indexOf("@")?r[3]:void 0,i.host=-1!==e.indexOf("//")?r[4]:void 0,i.port=parseInt(r[5],10),i.path=r[6]||"",i.query=-1!==e.indexOf("?")?r[7]:void 0,i.fragment=-1!==e.indexOf("#")?r[8]:void 0,isNaN(i.port)&&(i.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?r[4]:void 0)),i.host&&(i.host=B(L(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 o=E[(t.scheme||i.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)_(i,n);else{if(i.host&&(t.domainHost||o&&o.domainHost))try{i.host=x(i.host.replace(n.PCT_ENCODED,T).toLowerCase())}catch(e){i.error=i.error||"Host's domain name can not be converted to ASCII via punycode: "+e}_(i,s)}o&&o.parse&&o.parse(i,t)}else i.error=i.error||"URI can not be parsed.";return i}function P(e,t){var i=!1!==t.iri?a:s,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(B(L(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 F=/^\.\.?\//,H=/^\/\.(\/|$)/,V=/^\/\.\.(\/|$)/,Z=/^\/?(?:.|\n)*?(?=\/|$)/;function M(e){for(var t=[];e.length;)if(e.match(F))e=e.replace(F,"");else if(e.match(H))e=e.replace(H,"/");else if(e.match(V))e=e.replace(V,"/"),t.pop();else if("."===e||".."===e)e="";else{var i=e.match(Z);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 O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.iri?a:s,n=[],r=E[(t.scheme||e.scheme||"").toLowerCase()];if(r&&r.serialize&&r.serialize(e,t),e.host)if(i.IPV6ADDRESS.test(e.host));else if(t.domainHost||r&&r.domainHost)try{e.host=t.iri?k(e.host):x(e.host.replace(i.PCT_ENCODED,T).toLowerCase())}catch(i){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+i}_(e,i),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=P(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var l=e.path;t.absolutePath||r&&r.absolutePath||(l=M(l)),void 0===o&&(l=l.replace(/^\/\//,"/%2F")),n.push(l)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function D(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],r={};return n||(e=G(O(e,i),i),t=G(O(t,i),i)),!(i=i||{}).tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=M(t.path||""),r.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=M(t.path||""),r.query=t.query):(t.path?("/"===t.path.charAt(0)?r.path=M(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path:r.path="/"+t.path,r.path=M(r.path)),r.query=t.query):(r.path=e.path,void 0!==t.query?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function K(e,t){return e&&e.toString().replace(t&&t.iri?a.PCT_ENCODED:s.PCT_ENCODED,T)}var j={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}},z={scheme:"https",domainHost:j.domainHost,parse:j.parse,serialize:j.serialize};function X(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var J={scheme:"ws",domainHost:!0,parse:function(e,t){var i=e;return i.secure=X(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!==(X(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=l(i,2),r=n[0],o=n[1];e.path=r&&"/"!==r?r:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},Y={scheme:"wss",domainHost:J.domainHost,parse:J.parse,serialize:J.serialize},U={},Q="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",q="[0-9A-Fa-f]",ee=i(i("%[EFef]"+q+"%"+q+q+"%"+q+q)+"|"+i("%[89A-Fa-f]"+q+"%"+q+q)+"|"+i("%"+q+q)),te=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),ie=new RegExp(Q,"g"),ne=new RegExp(ee,"g"),re=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',te),"g"),oe=new RegExp(t("[^]",Q,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),se=oe;function ae(e){var t=T(e);return t.match(ie)?t:e}var le={scheme:"mailto",parse:function e(t,i){var n=t,r=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var o=!1,s={},a=n.query.split("&"),l=0,c=a.length;l<c;++l){var h=a[l].split("=");switch(h[0]){case"to":for(var d=h[1].split(","),u=0,g=d.length;u<g;++u)r.push(d[u]);break;case"subject":n.subject=K(h[1],i);break;case"body":n.body=K(h[1],i);break;default:o=!0,s[K(h[0],i)]=K(h[1],i)}}o&&(n.headers=s)}n.query=void 0;for(var p=0,m=r.length;p<m;++p){var f=r[p].split("@");if(f[0]=K(f[0]),i.unicodeSupport)f[1]=K(f[1],i).toLowerCase();else try{f[1]=x(K(f[1],i).toLowerCase())}catch(e){n.error=n.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}r[p]=f.join("@")}return n},serialize:function e(t,i){var n=t,o=function(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}(t.to);if(o){for(var s=0,a=o.length;s<a;++s){var l=String(o[s]),c=l.lastIndexOf("@"),h=l.slice(0,c).replace(ne,ae).replace(ne,r).replace(re,R),d=l.slice(c+1);try{d=i.iri?k(d):x(K(d,i).toLowerCase())}catch(e){n.error=n.error||"Email address's domain name can not be converted to "+(i.iri?"Unicode":"ASCII")+" via punycode: "+e}o[s]=h+"@"+d}n.path=o.join(",")}var u=t.headers=t.headers||{};t.subject&&(u.subject=t.subject),t.body&&(u.body=t.body);var g=[];for(var p in u)u[p]!==U[p]&&g.push(p.replace(ne,ae).replace(ne,r).replace(oe,R)+"="+u[p].replace(ne,ae).replace(ne,r).replace(se,R));return g.length&&(n.query=g.join("&")),n}},ce=/^([^\:]+)\:(.*)/,he={scheme:"urn",parse:function(e,t){var i=e.path&&e.path.match(ce),n=e;if(i){var r=t.scheme||n.scheme||"urn",o=i[1].toLowerCase(),s=i[2],a=r+":"+(t.nid||o),l=E[a];n.nid=o,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,r=i+":"+(t.nid||n),o=E[r];o&&(e=o.serialize(e,t));var s=e,a=e.nss;return s.path=(n||t.nid)+":"+a,s}},de=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ue={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(de)||(i.error=i.error||"UUID is not valid."),i},serialize:function(e,t){var i=e;return i.nss=(e.uuid||"").toLowerCase(),i}};E[j.scheme]=j,E[z.scheme]=z,E[J.scheme]=J,E[Y.scheme]=Y,E[le.scheme]=le,E[he.scheme]=he,E[ue.scheme]=ue,e.SCHEMES=E,e.pctEncChar=R,e.pctDecChars=T,e.parse=G,e.removeDotSegments=M,e.serialize=O,e.resolveComponents=D,e.resolve=function(e,t,i){var n=function(e,t){var i=e;if(t)for(var n in t)i[n]=t[n];return i}({scheme:"null"},i);return O(D(G(e,n),G(t,n),n,!0),n)},e.normalize=function(e,t){return"string"==typeof e?e=O(G(e,t),t):"object"===n(e)&&(e=G(O(e,t),t)),e},e.equal=function(e,t,i){return"string"==typeof e?e=O(G(e,i),i):"object"===n(e)&&(e=O(e,i)),"string"==typeof t?t=O(G(t,i),i):"object"===n(t)&&(t=O(t,i)),e===t},e.escapeComponent=function(e,t){return e&&e.toString().replace(t&&t.iri?a.ESCAPE:s.ESCAPE,R)},e.unescapeComponent=K,Object.defineProperty(e,"__esModule",{value:!0})}(t)},4049: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(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,r=!1,o=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){r=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw o}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=(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},{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 r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=t>0?e.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):e.toString();return i||"0"}var o=function(){function o(t,n,r,s){e(this,o);var a=this;if(void 0===t);else if(Array.isArray(t))this.rgba=t;else if(void 0===r){var l=t&&""+t;l&&function(e){if(e.startsWith("hsl")){var t=e.match(/([\-\d\.e]+)/g).map(Number),n=i(t,4),r=n[0],s=n[1],l=n[2],c=n[3];void 0===c&&(c=1),r/=360,s/=100,l/=100,a.hsla=[r,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=o.hexToRgb(e):a.rgba=o.nameToRgb(e)||o.hexToRgb(e)}(l.toLowerCase())}else this.rgba=[t,n,r,void 0===s?1:s]}return t(o,[{key:"printRGB",value:function(e){var t=(e?this.rgba:this.rgba.slice(0,3)).map((function(e,t){return r(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 r(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=o.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=o.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(){var e=this.rgba.map((function(e,t){return t<3?e.toString(16):Math.round(255*e).toString(16)}));return"#"+e.map((function(e){return e.padStart(2,"0")})).join("")},set:function(e){this.rgba=o.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:o.hexToRgb(i.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(e){var t=i(e,4),n=t[0],r=t[1],o=t[2],s=t[3];n/=255,r/=255,o/=255;var a=Math.max(n,r,o),l=Math.min(n,r,o),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=(r-o)/u+(r<o?6:0);break;case r:c=(o-n)/u+2;break;case o:c=(n-r)/u+4}c/=6}return[c,h,d,s]}},{key:"hslToRgb",value:function(e){var t=i(e,4),n=t[0],r=t[1],o=t[2],s=t[3],a=void 0,l=void 0,c=void 0;if(0===r)a=l=c=o;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=o<.5?o*(1+r):o+r-o*r,u=2*o-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}}]),o}(),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(r){var o=!0;return e&&e!==r.target&&(o=!1),t&&t!==r.type&&(o=!1),n&&n!==r.handler&&(o=!1),o&&i._doRemove(r.target,r.type,r.handler),!o}))}},{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,t,i){var n=!1;function r(e,t,i){return Math.max(t,Math.min(e,i))}function o(e,o,s){if(s&&(n=!0),n){e.preventDefault();var a=t.getBoundingClientRect(),l=a.width,c=a.height,h=o.clientX,d=o.clientY,u=r(h-a.left,0,l),g=r(d-a.top,0,c);i(u/l,g/c)}}function s(e,t){1===(void 0===e.buttons?e.which:e.buttons)?o(e,e,t):n=!1}function a(e,t){1===e.touches.length?o(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 l="keydown",c="mousedown",h="focusin";function d(e,t){return(t||document).querySelector(e)}function u(e){e.preventDefault(),e.stopPropagation()}function g(e,t,i,n,r){e.add(t,l,(function(e){i.indexOf(e.key)>=0&&(r&&u(e),n(e))}))}var p=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),function(e,t,i){for(var n in e)i&&i.indexOf(n)>=0||(t[n]=e[n])}(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 r=i.parent;if(r&&i.popup&&!this._popupInited){var o=function(e){return t.openHandler(e)};this._events.add(r,"click",o),g(this._events,r,[" ","Spacebar","Enter"],o),this._popupInited=!0}else e.parent&&!i.popup&&this.show()}}},{key:"openHandler",value:function(e){if(this.show()){e&&e.preventDefault(),this.settings.parent.style.pointerEvents="none";var t=e&&e.type===l?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===c||t===h){var n=(this.__containedEvent||0)+100;e.timeStamp>n&&(i=!0)}else u(e),i=!0;else i=!0;i&&this.hide()&&(this.settings.parent.style.pointerEvents="",t!==c&&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,i){if("string"==typeof t&&(t=t.trim()),t){i=i||{};var n=void 0;try{n=new o(t)}catch(e){if(i.failSilently)return;throw e}if(!this.settings.alpha){var r=n.hsla;r[3]=1,n.hsla=r}this.colour=this.color=n,this._setHSLA(null,null,null,null,i)}}},{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=function(e){var t=document.createElement("div");return t.innerHTML=e,t.firstElementChild}(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=d(".picker_hue",t),this._domSL=d(".picker_sl",t),this._domA=d(".picker_alpha",t),this._domEdit=d(".picker_editor input",t),this._domSample=d(".picker_sample",t),this._domOkay=d(".picker_done button",t),this._domCancel=d(".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 r(e,t,i){n.add(e,t,i)}r(i,"click",(function(e){return e.preventDefault()})),a(n,this._domH,(function(e,i){return t._setHSLA(e)})),a(n,this._domSL,(function(e,i){return t._setHSLA(null,e,1-i)})),this.settings.alpha&&a(n,this._domA,(function(e,i){return t._setHSLA(null,null,null,1-i)}));var o=this._domEdit;r(o,"input",(function(e){t._setColor(this.value,{fromEditor:!0,failSilently:!0})})),r(o,"focus",(function(e){var t=this;t.selectionStart===t.selectionEnd&&t.select()})),this._ifPopup((function(){var t=function(t){return e.closeHandler(t)};r(window,c,t),r(window,h,t),g(n,i,["Esc","Escape"],t);var o=function(t){e.__containedEvent=t.timeStamp};r(i,c,o),r(i,h,o),r(e._domCancel,"click",t)}));var s=function(t){e._ifPopup((function(){return e.closeHandler(t)})),e.onDone&&e.onDone(e.colour)};r(this._domOkay,"click",s),g(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,r){r=r||{};var o=this.colour,s=o.hsla;[e,t,i,n].forEach((function(e,t){(e||0===e)&&(s[t]=e)})),o.hsla=s,this._updateUI(r),this.onChange&&!r.silent&&this.onChange(o)}},{key:"_updateUI",value:function(e){if(this.domElement){e=e||{};var t=this.colour,i=t.hsla,n="hsl("+360*i[0]+", 100%, 50%)",r=t.hslString,o=t.hslaString,s=this._domH,a=this._domSL,l=this._domA,c=d(".picker_selector",s),h=d(".picker_selector",a),u=d(".picker_selector",l);v(0,c,i[0]),this._domSL.style.backgroundColor=this._domH.style.color=n,v(0,h,i[1]),A(0,h,1-i[2]),a.style.color=r,A(0,u,1-i[3]);var g=r,p=g.replace("hsl","hsla").replace(")",", 0)"),m="linear-gradient("+[g,p]+")";if(this._domA.style.background=m+", 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",!e.fromEditor){var f=this.settings.editorFormat,C=this.settings.alpha,I=void 0;switch(f){case"rgb":I=t.printRGB(C);break;case"hsl":I=t.printHSL(C);break;default:I=t.printHex(C)}this._domEdit.value=I}this._domSample.style.color=o}function v(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}(),m=document.createElement("style");return m.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(m),p.StyleElement=m,p}()},402:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),((t.default=function e(t,i){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.message=t+" (char "+i+")",this.char=i,this.stack=(new Error).stack}).prototype=new Error).constructor=Error},3860:function(e,t,i){e.exports=i(7490).default},7490:function(e,t,i){"use strict";t.default=function(e){u="",g=0,p=(d=e).charAt(0),m="",f=o,A();var t=f;if(w(),b(),""===m)return u;if(t===f&&v()){for(var i="";t===f&&v();)i+=u=(0,r.insertBeforeLastWhitespace)(u,","),u="",w(),b();return"[\n".concat(i).concat(u,"\n]")}throw new n.default("Unexpected characters",g-m.length)};var n=(t=i(402))&&t.__esModule?t:{default:t},r=i(9422),o=6,s={"":!0,"{":!0,"}":!0,"[":!0,"]":!0,":":!0,",":!0,"(":!0,")":!0,";":!0,"+":!0},a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},l={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},c={null:"null",true:"true",false:"false"},h={None:"null",True:"true",False:"false"},d="",u="",g=0,p="",m="",f=o;function C(){g++,p=d.charAt(g)}function I(){C(),"\\"===p&&C()}function v(){return 0===f&&("["===m||"{"===m)||2===f||1===f||3===f}function A(){if(u+=m,f=o,m="",s[p])f=0,m=p,C();else if((0,r.isDigit)(p)||"-"===p){if(f=1,"-"===p){if(m+=p,C(),!(0,r.isDigit)(p))throw new n.default("Invalid number, digit expected",g)}else"0"===p&&(m+=p,C());for(;(0,r.isDigit)(p);)m+=p,C();if("."===p){if(m+=p,C(),!(0,r.isDigit)(p))throw new n.default("Invalid number, digit expected",g);for(;(0,r.isDigit)(p);)m+=p,C()}if("e"===p||"E"===p){if(m+=p,C(),"+"!==p&&"-"!==p||(m+=p,C()),!(0,r.isDigit)(p))throw new n.default("Invalid number, digit expected",g);for(;(0,r.isDigit)(p);)m+=p,C()}}else"\\"===p&&'"'===d.charAt(g+1)?(C(),y(I)):y(C);4===f&&(m=(0,r.normalizeWhitespace)(m),A()),5===f&&(f=o,m="",A())}function b(){","===m&&(m="",f=o,A())}function y(e){if((0,r.isQuote)(p)){var t=(0,r.normalizeQuote)(p),i=(0,r.isSingleQuote)(p)?r.isSingleQuote:r.isDoubleQuote;for(m+='"',f=2,e();""!==p&&!i(p);)if("\\"===p)if(e(),void 0!==a[p])m+="\\"+p,e();else if("u"===p){m+="\\u",e();for(var s=0;s<4;s++){if(!(0,r.isHex)(p))throw new n.default("Invalid unicode character",g-m.length);m+=p,e()}}else{if("'"!==p)throw new n.default('Invalid escape character "\\'+p+'"',g);m+="'",e()}else m+=l[p]?l[p]:'"'===p?'\\"':p,e();if((0,r.normalizeQuote)(p)!==t)throw new n.default("End of string expected",g-m.length);return m+='"',void e()}if((0,r.isAlpha)(p))for(f=3;(0,r.isAlpha)(p)||(0,r.isDigit)(p)||"$"===p;)m+=p,C();else if((0,r.isWhitespace)(p)||(0,r.isSpecialWhitespace)(p))for(f=4;(0,r.isWhitespace)(p)||(0,r.isSpecialWhitespace)(p);)m+=p,C();else if("/"===p&&"*"===d[g+1]){for(f=5;""!==p&&("*"!==p||"*"===p&&"/"!==d[g+1]);)m+=p,C();"*"===p&&"/"===d[g+1]&&(m+=p,C(),m+=p,C())}else{if("/"!==p||"/"!==d[g+1]){for(f=o;""!==p;)m+=p,C();throw new n.default('Syntax error in part "'+m+'"',g-m.length)}for(f=5;""!==p&&"\n"!==p;)m+=p,C()}}function w(){if(0===f&&"{"===m)if(A(),0===f&&"}"===m)A();else{for(;;){if(3!==f&&1!==f||(f=2,m='"'.concat(m,'"')),2!==f)throw new n.default("Object key expected",g-m.length);if(A(),0===f&&":"===m)A();else{if(!v())throw new n.default("Colon expected",g-m.length);u=(0,r.insertBeforeLastWhitespace)(u,":")}if(w(),0===f&&","===m){if(A(),0===f&&"}"===m){u=(0,r.stripLastOccurrence)(u,",");break}if(""===m){u=(0,r.stripLastOccurrence)(u,",");break}}else{if(2!==f&&1!==f&&3!==f)break;u=(0,r.insertBeforeLastWhitespace)(u,",")}}0===f&&"}"===m?A():u=(0,r.insertBeforeLastWhitespace)(u,"}")}else if(0===f&&"["===m)if(A(),0===f&&"]"===m)A();else{for(;;)if(w(),0===f&&","===m){if(A(),0===f&&"]"===m){u=(0,r.stripLastOccurrence)(u,",");break}if(""===m){u=(0,r.stripLastOccurrence)(u,",");break}}else{if(!v())break;u=(0,r.insertBeforeLastWhitespace)(u,",")}0===f&&"]"===m?A():u=(0,r.insertBeforeLastWhitespace)(u,"]")}else if(2===f)for(A();0===f&&"+"===m;){var e;m="",A(),2===f&&(e=u.lastIndexOf('"'),u=u.substring(0,e)+m.substring(1),m="",A())}else if(1===f)A();else{if(3!==f)throw""===m?new n.default("Unexpected end of json string",g-m.length):new n.default("Value expected",g-m.length);if(c[m])A();else{if(h[m])return m=h[m],void A();var t=m,i=u.length;if(m="",A(),0===f&&"("===m)return m="",A(),w(),void(0===f&&")"===m&&(m="",A(),0===f&&";"===m&&(m="",A())));for(u=(0,r.insertAtIndex)(u,'"'.concat(t),i);3===f||1===f;)A();u+='"'}}}},9422:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAlpha=function(e){return r.test(e)},t.isHex=function(e){return o.test(e)},t.isDigit=function(e){return s.test(e)},t.isWhitespace=a,t.isSpecialWhitespace=l,t.normalizeWhitespace=function(e){for(var t="",i=0;i<e.length;i++){var n=e[i];t+=l(n)?" ":n}return t},t.isQuote=function(e){return!0===i[e]||!0===n[e]},t.isSingleQuote=function(e){return!0===i[e]},t.isDoubleQuote=function(e){return!0===n[e]},t.normalizeQuote=function(e){return!0!==i[e]?!0!==n[e]?e:'"':"'"},t.stripLastOccurrence=function(e,t){return-1!==(t=e.lastIndexOf(t))?e.substring(0,t)+e.substring(t+1):e},t.insertBeforeLastWhitespace=function(e,t){var i=e.length;if(!a(e[i-1]))return e+t;for(;a(e[i-1]);)i--;return e.substring(0,i)+t+e.substring(i)},t.insertAtIndex=function(e,t,i){return e.substring(0,i)+t+e.substring(i)};var i={"'":!0,"‘":!0,"’":!0,"`":!0,"´":!0},n={'"':!0,"“":!0,"”":!0},r=/^[a-zA-Z_]$/,o=/^[0-9a-fA-F]$/,s=/^[0-9]$/;function a(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function l(e){return" "===e||" "<=e&&e<=" "||" "===e||" "===e||" "===e}},894: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}')},7171: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":{}}')},6273: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":{}}')},6680: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}')}},i={},e.amdD=function(){throw new Error("define cannot be used indirect")},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,{a:i}),i},e.d=function(t,i){for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},e(3161);function e(n){var r=i[n];return void 0!==r||(r=i[n]={id:n,loaded:!1,exports:{}},t[n].call(r.exports,r,r.exports,e),r.loaded=!0),r.exports}var t,i}));