jsoneditor
Version:
A web-based tool to view, edit, format, and validate JSON
30 lines • 1.04 MB
JavaScript
/*!
* jsoneditor.js
*
* @brief
* JSONEditor is a web-based tool to view, edit, format, and validate JSON.
* It has various modes such as a tree editor, a code editor, and a plain text
* editor.
*
* Supported browsers: Chrome, Firefox, Safari, Edge
*
* @license
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*
* Copyright (c) 2011-2025 Jos de Jong, http://jsoneditoronline.org
*
* @author Jos de Jong, <wjosdejong@gmail.com>
* @version 10.2.0
* @date 2025-03-28
*/
((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 n={359:function(e,t,n){n.d(t,{V:function(){return o},e:function(){return r}});var t=n(9151),i=n.n(t),s=n(6237);function o(e,t){var n,i=t.sort,o=t.filter,t=t.projection,r="";return o?(n="@"!==o.field?["0"].concat((0,s.parsePath)("."+o.field)):["0"],n="string"==typeof(0,s.get)(e,n)?o.value:(0,s.parseString)(o.value),r+="[? "+o.field+" "+o.relation+" `"+JSON.stringify(n)+"`]"):r+=Array.isArray(e)?"[*]":"@",i&&("desc"===i.direction?r+=" | reverse(sort_by(@, &"+i.field+"))":r+=" | sort_by(@, &"+i.field+")"),t&&("]"!==r[r.length-1]&&(r+=" | [*]"),1===t.fields.length?r+="."+t.fields[0]:1<t.fields.length&&(r+=".{"+t.fields.map(function(e){var t=e.split(".");return t[t.length-1]+": "+e}).join(", ")+"}")),r}function r(e,t){return i().search(e,t)}},413:function(e,t,n){var a=/^[a-z_$][a-z0-9_$-]*$/i,l=n(8050),i=n(9407);function o(e,t){o.errors=null;var n=this._validateKeyword=this._validateKeyword||this.compile(i,!0);if(n(e))return!0;if(o.errors=n.errors,t)throw new Error("custom keyword definition is invalid: "+this.errorsText(n.errors));return!1}e.exports={add:function(e,t){var s=this.RULES;if(s.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!a.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(t){this.validateKeyword(t,!0);var n=t.type;if(Array.isArray(n))for(var i=0;i<n.length;i++)r(e,n[i],t);else r(e,n,t);var o=t.metaSchema;o&&(t.$data&&this._opts.$data&&(o={anyOf:[o,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),t.validateSchema=this.compile(o,!0))}function r(e,t,n){for(var i,o=0;o<s.length;o++){var r=s[o];if(r.type==t){i=r;break}}i||s.push(i={type:t,rules:[]});n={keyword:e,definition:n,custom:!0,code:l,implements:n.implements};i.rules.push(n),s.custom[e]=n}return s.keywords[e]=s.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 n=0;n<t.length;n++)for(var i=t[n].rules,o=0;o<i.length;o++)if(i[o].keyword==e){i.splice(o,1);break}return this},validate:o}},600:function(e,t,n){var i=n(3689).MissingRef;function o(t,s,n){var a=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof s&&(n=s,s=void 0);var e=l(t).then(function(){var e=a._addSchema(t,void 0,s);return e.validate||function o(r){try{return a._compile(r)}catch(e){if(e instanceof i)return t(e);throw e}function t(e){var t=e.missingSchema;if(i(t))throw new Error("Schema "+t+" is loaded but "+e.missingRef+" cannot be resolved");e=a._loadingSchemas[t];return e||(e=a._loadingSchemas[t]=a._opts.loadSchema(t)).then(n,n),e.then(function(e){if(!i(t))return l(e).then(function(){i(t)||a.addSchema(e,t,void 0,s)})}).then(function(){return o(r)});function n(){delete a._loadingSchemas[t]}function i(e){return a._refs[e]||a._schemas[e]}}}(e)});return n&&e.then(function(e){n(null,e)},n),e;function l(e){e=e.$schema;return e&&!a.getSchema(e)?o.call(a,{$ref:e},!0):Promise.resolve()}}e.exports=o},611:function(e){e.exports=function(e){for(var t,n=0,i=e.length,o=0;o<i;)n++,55296<=(t=e.charCodeAt(o++))&&t<=56319&&o<i&&56320==(64512&e.charCodeAt(o))&&o++;return n}},660:function(e,t,n){n.d(t,{Oq:function(){return o},SC:function(){return s},ai:function(){return i},hJ:function(){return r}});var i=document.body,o=10485760,r=2e4,s=2147483648},812:function(e){e.exports=function(e,t,n){var i=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,h="data"+(r||""),d=e.opts.$data&&s&&s.$data,r=d?(i+=" var schema"+o+" = "+e.util.getData(s.$data,r,e.dataPathArr)+"; ","schema"+o):s;if(!d&&"number"!=typeof s)throw new Error(t+" must be number");i+="var division"+o+";if (",d&&(i+=" "+r+" !== undefined && ( typeof "+r+" != 'number' || "),i+=" (division"+o+" = "+h+" / "+r+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+o+" !== parseInt(division"+o+") ",i+=" ) ",d&&(i+=" ) ");t=[],t.push(i+=" ) { "),i="",!1!==e.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+r+" } ",!1!==e.opts.messages&&(i=i+" , message: 'should be multiple of "+(d?"' + "+r:r+"'")),e.opts.verbose&&(i=(i+=" , schema: ")+(d?"validate.schema"+a:""+s)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),i+=" } "):i+=" {} ",o=i,i=t.pop();return!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+o+"]); ":i+=" validate.errors = ["+o+"]; return false; ":i+=" var err = "+o+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",c&&(i+=" else { "),i}},1004:function(e){e.exports=function(e,t,n){var i,o,r=" ",s=e.level,a=e.dataLevel,l=e.schema[t],c=e.schemaPath+e.util.getProperty(t),t=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,a="data"+(a||""),s="errs__"+s,d=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,r+=" var "+s+" = errors; ",l=e.compositeRule,e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(o=d.opts.allErrors,d.opts.allErrors=!1),r+=" "+e.validate(d)+" ",d.createErrors=!0,o&&(d.opts.allErrors=o),e.compositeRule=d.compositeRule=l,(i=i||[]).push(r+=" if ("+u+") { "),r="",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+a+" "),r+=" } "):r+=" {} ",o=r,r=i.pop(),!e.compositeRule&&h?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+=" } else { errors = "+s+"; if (vErrors !== null) { if ("+s+") vErrors.length = "+s+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")):(r+=" var err = ",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+a+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(r+=" if (false) { ")),r}},1035:function(e){e.exports=function(i,e,W){var t="",n=!0===i.schema.$async,o=i.util.schemaHasRulesExcept(i.schema,i.RULES.all,"$ref"),r=i.self._getId(i.schema);if(i.opts.strictKeywords){var s=i.util.schemaUnknownRules(i.schema,i.RULES.keywords);if(s){s="unknown keyword: "+s;if("log"!==i.opts.strictKeywords)throw new Error(s);i.logger.warn(s)}}if(i.isTop&&(t+=" var validate = ",n&&(i.async=!0,t+="async "),t+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",r)&&(i.opts.sourceCode||i.opts.processCode)&&(t+=" /*# sourceURL="+r+" */ "),"boolean"==typeof i.schema||!o&&!i.schema.$ref)l=i.level,c=i.dataLevel,R=i.schema[e="false schema"],v=i.schemaPath+i.util.getProperty(e),b=i.errSchemaPath+"/"+e,g=!i.opts.allErrors,h="data"+(c||""),u="valid"+l,!1===i.schema?(i.isTop?g=!0:t+=" var "+u+" = false; ",(N=N||[]).push(t),t="",!1!==i.createErrors?(t+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(b)+" , params: {} ",!1!==i.opts.messages&&(t+=" , message: 'boolean schema is false' "),i.opts.verbose&&(t+=" , schema: false , parentSchema: validate.schema"+i.schemaPath+" , data: "+h+" "),t+=" } "):t+=" {} ",T=t,t=N.pop(),!i.compositeRule&&g?i.async?t+=" throw new ValidationError(["+T+"]); ":t+=" validate.errors = ["+T+"]; return false; ":t+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "):i.isTop?t+=n?" return data; ":" validate.errors = null; return true; ":t+=" var "+u+" = true; ",i.isTop&&(t+=" }; return validate; ");else{if(i.isTop){var a=i.isTop,l=i.level=0,c=i.dataLevel=0,h="data";if(i.rootId=i.resolve.fullPath(i.self._getId(i.root.schema)),i.baseId=i.baseId||i.rootId,delete i.isTop,i.dataPathArr=[""],void 0!==i.schema.default&&i.opts.useDefaults&&i.opts.strictDefaults){var d="default is ignored in the schema root";if("log"!==i.opts.strictDefaults)throw new Error(d);i.logger.warn(d)}t=(t+=" var vErrors = null; ")+" var errors = 0; "+" if (rootData === undefined) rootData = data; "}else{l=i.level,h="data"+((c=i.dataLevel)||"");if(r&&(i.baseId=i.resolve.url(i.baseId,r)),n&&!i.async)throw new Error("async schema in sync schema");t+=" var errs_"+l+" = errors;"}var u="valid"+l,g=!i.opts.allErrors,p="",m="",f=i.schema.type,C=Array.isArray(f);if(f&&i.opts.nullable&&!0===i.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),i.schema.$ref&&o){if("fail"==i.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+i.errSchemaPath+'" (see option extendRefs)');!0!==i.opts.extendRefs&&(o=!1,i.logger.warn('$ref: keywords ignored in schema at path "'+i.errSchemaPath+'"'))}if(i.schema.$comment&&i.opts.$comment&&(t+=" "+i.RULES.all.$comment.code(i,"$comment")),f){i.opts.coerceTypes&&(y=i.util.coerceToTypes(i.opts.coerceTypes,f));var y,I=i.RULES.types[f];if(y||C||!0===I||I&&!z(I)){var v=i.schemaPath+".type",b=i.errSchemaPath+"/type",v=i.schemaPath+".type",b=i.errSchemaPath+"/type";if(t+=" if ("+i.util[C?"checkDataTypes":"checkDataType"](f,h,i.opts.strictNumbers,!0)+") { ",y){var A="dataType"+l,w="coerced"+l,x=(t+=" var "+A+" = typeof "+h+"; var "+w+" = undefined; ","array"==i.opts.coerceTypes&&(t+=" if ("+A+" == 'object' && Array.isArray("+h+") && "+h+".length == 1) { "+h+" = "+h+"[0]; "+A+" = typeof "+h+"; if ("+i.util.checkDataType(i.schema.type,h,i.opts.strictNumbers)+") "+w+" = "+h+"; } "),t+=" if ("+w+" !== undefined) ; ",y);if(x)for(var S,k=-1,D=x.length-1;k<D;)"string"==(S=x[k+=1])?t+=" else if ("+A+" == 'number' || "+A+" == 'boolean') "+w+" = '' + "+h+"; else if ("+h+" === null) "+w+" = ''; ":"number"==S||"integer"==S?(t+=" else if ("+A+" == 'boolean' || "+h+" === null || ("+A+" == 'string' && "+h+" && "+h+" == +"+h+" ","integer"==S&&(t+=" && !("+h+" % 1)"),t+=")) "+w+" = +"+h+"; "):"boolean"==S?t+=" else if ("+h+" === 'false' || "+h+" === 0 || "+h+" === null) "+w+" = false; else if ("+h+" === 'true' || "+h+" === 1) "+w+" = true; ":"null"==S?t+=" else if ("+h+" === '' || "+h+" === 0 || "+h+" === false) "+w+" = null; ":"array"==i.opts.coerceTypes&&"array"==S&&(t+=" else if ("+A+" == 'string' || "+A+" == 'number' || "+A+" == 'boolean' || "+h+" == null) "+w+" = ["+h+"]; ");(N=N||[]).push(t+=" else { "),t="",!1!==i.createErrors?(t=(t+=" { keyword: 'type' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(b)+" , params: { type: '")+(C?""+f.join(","):""+f)+"' } ",!1!==i.opts.messages&&(t=(t+=" , message: 'should be ")+(C?""+f.join(","):""+f)+"' "),i.opts.verbose&&(t+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+i.schemaPath+" , data: "+h+" "),t+=" } "):t+=" {} ";var T=t,s=(t=N.pop(),!i.compositeRule&&g?i.async?t+=" throw new ValidationError(["+T+"]); ":t+=" validate.errors = ["+T+"]; return false; ":t+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c?"data"+(c-1||""):"parentData");t=t+(" } if ("+w+" !== undefined) { ")+(" "+h+" = "+w+"; "),c||(t+="if ("+s+" !== undefined)"),t+=" "+s+"["+(c?i.dataPathArr[c]:"parentDataProperty")+"] = "+w+"; } "}else{T=((N=N||[]).push(t),t="",!1!==i.createErrors?(t=(t+=" { keyword: 'type' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(b)+" , params: { type: '")+(C?""+f.join(","):""+f)+"' } ",!1!==i.opts.messages&&(t=(t+=" , message: 'should be ")+(C?""+f.join(","):""+f)+"' "),i.opts.verbose&&(t+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+i.schemaPath+" , data: "+h+" "),t+=" } "):t+=" {} ",t);t=N.pop(),!i.compositeRule&&g?i.async?t+=" throw new ValidationError(["+T+"]); ":t+=" validate.errors = ["+T+"]; return false; ":t+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}t+=" } "}}if(i.schema.$ref&&!o)t+=" "+i.RULES.all.$ref.code(i,"$ref")+" ",g&&(t=(t+=" } if (errors === ")+(a?"0":"errs_"+l)+") { ",m+="}");else{var E=i.RULES;if(E)for(var O=-1,P=E.length-1;O<P;)if(z(I=E[O+=1])){if(I.type&&(t+=" if ("+i.util.checkDataType(I.type,h,i.opts.strictNumbers)+") { "),i.opts.useDefaults)if("object"==I.type&&i.schema.properties){var R=i.schema.properties,_=Object.keys(R);if(_)for(var H,G=-1,F=_.length-1;G<F;)if(void 0!==(M=R[H=_[G+=1]]).default){var $=h+i.util.getProperty(H);if(i.compositeRule){if(i.opts.strictDefaults){d="default is ignored for: "+$;if("log"!==i.opts.strictDefaults)throw new Error(d);i.logger.warn(d)}}else t+=" if ("+$+" === undefined ","empty"==i.opts.useDefaults&&(t+=" || "+$+" === null || "+$+" === '' "),t+=" ) "+$+" = ","shared"==i.opts.useDefaults?t+=" "+i.useDefault(M.default)+" ":t+=" "+JSON.stringify(M.default)+" ",t+="; "}}else if("array"==I.type&&Array.isArray(i.schema.items)){var L=i.schema.items;if(L)for(var M,k=-1,Z=L.length-1;k<Z;)if(void 0!==(M=L[k+=1]).default){$=h+"["+k+"]";if(i.compositeRule){if(i.opts.strictDefaults){d="default is ignored for: "+$;if("log"!==i.opts.strictDefaults)throw new Error(d);i.logger.warn(d)}}else t+=" if ("+$+" === undefined ","empty"==i.opts.useDefaults&&(t+=" || "+$+" === null || "+$+" === '' "),t+=" ) "+$+" = ","shared"==i.opts.useDefaults?t+=" "+i.useDefault(M.default)+" ":t+=" "+JSON.stringify(M.default)+" ",t+="; "}}var N,V=I.rules;if(V)for(var B,j=-1,K=V.length-1;j<K;)Y(B=V[j+=1])&&(B=B.code(i,B.keyword,I.type))&&(t+=" "+B+" ",g)&&(p+="}");g&&(t+=" "+p+" ",p=""),I.type&&(t+=" } ",f)&&f===I.type&&!y&&(t+=" else { ",v=i.schemaPath+".type",b=i.errSchemaPath+"/type",(N=N||[]).push(t),t="",!1!==i.createErrors?(t=(t+=" { keyword: 'type' , dataPath: (dataPath || '') + "+i.errorPath+" , schemaPath: "+i.util.toQuotedString(b)+" , params: { type: '")+(C?""+f.join(","):""+f)+"' } ",!1!==i.opts.messages&&(t=(t+=" , message: 'should be ")+(C?""+f.join(","):""+f)+"' "),i.opts.verbose&&(t+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+i.schemaPath+" , data: "+h+" "),t+=" } "):t+=" {} ",T=t,t=N.pop(),!i.compositeRule&&g?i.async?t+=" throw new ValidationError(["+T+"]); ":t+=" validate.errors = ["+T+"]; return false; ":t+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } "),g&&(t=(t+=" if (errors === ")+(a?"0":"errs_"+l)+") { ",m+="}")}}g&&(t+=" "+m+" "),a?t=t+(n?" if (errors === 0) return data; else throw new ValidationError(vErrors); ":" validate.errors = vErrors; return errors === 0; ")+" }; return validate;":t+=" var "+u+" = errors === errs_"+l+";"}return t;function z(e){for(var t=e.rules,n=0;n<t.length;n++)if(Y(t[n]))return 1}function Y(e){return void 0!==i.schema[e.keyword]||e.implements&&(e=>{for(var t=e.implements,n=0;n<t.length;n++)if(void 0!==i.schema[t[n]])return 1})(e)}}},1081: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 n=this[t];if(e.call(this,n,t,this))return t}return-1},configurable:!0,writable:!0}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){e=this.findIndex(e);return this[e]},configurable:!0,writable:!0}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})},1292:function(e){e.exports=function(e,t,n){var i=" ",o=e.level,r=e.dataLevel,s=e.schema[t],a=e.schemaPath+e.util.getProperty(t),t=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,r="data"+(r||""),c="valid"+o,h="errs__"+o,d=e.util.copy(e),u=(d.level++,"valid"+d.level),o="i"+o,g=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),o=(i+="var "+h+" = errors;var "+c+";",f?(c=e.compositeRule,e.compositeRule=d.compositeRule=!0,d.schema=s,d.schemaPath=a,d.errSchemaPath=t,i+=" var "+u+" = false; for (var "+o+" = 0; "+o+" < "+r+".length; "+o+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,o,e.opts.jsonPointers,!0),s=r+"["+o+"]",d.dataPathArr[g]=o,g=e.validate(d),d.baseId=m,e.util.varOccurences(g,p)<2?i+=" "+e.util.varReplace(g,p,s)+" ":i+=" var "+p+" = "+s+"; "+g+" ",i+=" if ("+u+") break; } ",e.compositeRule=d.compositeRule=c,i+=" if (!"+u+") {"):i+=" if ("+r+".length == 0) {",[]),m=(o.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+a+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+r+" "),i+=" } "):i+=" {} ",i),i=o.pop();return!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",f&&(i+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i}},1342:function(e){e.exports=function t(e,n){function i(e){return t.insensitive&&(""+e).toLowerCase()||""+e}var o,r,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/,e=i(e).replace(a,"")||"",n=i(n).replace(a,"")||"",d=e.replace(s,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),u=n.replace(s,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),a=parseInt(e.match(c),16)||1!==d.length&&e.match(l)&&Date.parse(e),s=parseInt(n.match(c),16)||a&&n.match(l)&&Date.parse(n)||null;if(s){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(o=!(d[g]||"").match(h)&&parseFloat(d[g])||d[g]||0,r=!(u[g]||"").match(h)&&parseFloat(u[g])||u[g]||0,isNaN(o)!==isNaN(r))return isNaN(o)?1:-1;if(typeof o!=typeof r&&(o+="",r+=""),o<r)return-1;if(r<o)return 1}return 0}},1346:function(e,t,o){var n=o(7413),i=o(1746),r=o(5633).treeModeMixins,s=o(1948).textModeMixins,a=o(7483).previewModeMixins,l=o(6237),c=l.clear,h=l.extend,d=l.getInnerText,u=l.getInternetExplorerVersion,g=l.parse,l=o(2870).tryRequireAjv,p=o(5609).showTransformModal,m=o(2915).showSortModal,f=l();function C(e,t,n){if(!(this instanceof C))throw new Error('JSONEditor constructor called without "new".');var i=u();if(-1!==i&&i<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,n)}"undefined"==typeof Promise&&console.error("Promise undefined. Please load a Promise polyfill in the browser in order to use JSONEditor"),C.modes={},C.prototype.DEBOUNCE_INTERVAL=150,C.VALID_OPTIONS=["ajv","schema","schemaRefs","templates","ace","theme","autocomplete","onChange","onChangeJSON","onChangeText","onExpand","onEditable","onError","onEvent","onModeChange","onNodeName","onValidate","onCreateMenu","onSelectionChange","onTextSelectionChange","onClassName","onFocus","onBlur","colorPicker","onColorPicker","timestampTag","timestampFormat","escapeUnicode","history","search","mode","modes","name","indentation","sortObjectKeys","navigationBar","statusBar","mainMenuBar","languages","language","enableSort","enableTransform","limitDragging","maxVisibleChilds","onValidationError","modalAnchor","popupAnchor","createQuery","executeQuery","queryDescription","allowSchemaSuggestions","showErrorTable"],C.prototype._create=function(e,t,n){this.container=e,this.options=t||{},this.json=n||{};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=g(e)},C.prototype.getText=function(){return JSON.stringify(this.json)},C.prototype.setName=function(e){this.options||(this.options={}),this.options.name=e},C.prototype.getName=function(){return this.options&&this.options.name},C.prototype.setMode=function(e){if(e!==this.options.mode||!this.create){var t=this.container,n=h({},this.options),i=n.mode,o=C.modes[n.mode=e];if(!o)throw new Error('Unknown mode "'+n.mode+'"');var r="text"===o.data,s=this.getName(),a=this[r?"getText":"get"]();if(this.destroy(),c(this),h(this,o.mixin),this.create(t,n),this.setName(s),this[r?"setText":"set"](a),"function"==typeof o.load)try{o.load.call(this)}catch(e){console.error(e)}if("function"==typeof n.onModeChange&&e!==i)try{n.onModeChange(e,i)}catch(e){console.error(e)}}},C.prototype.getMode=function(){return this.options.mode},C.prototype._onError=function(e){this.options&&"function"==typeof this.options.onError?this.options.onError(e):window.alert(e.toString())},C.prototype.setSchema=function(e,t){if(e){var n;try{this.options.ajv?n=this.options.ajv:((n=f({allErrors:!0,verbose:!0,schemaId:"auto",$data:!0})).addMetaSchema(o(5207)),n.addMetaSchema(o(6801)))}catch(e){console.warn("Failed to create an instance of Ajv, JSON Schema validation is not available. Please use a JSONEditor bundle including Ajv, or pass an instance of Ajv as via the configuration option `ajv`.")}if(n){if(t){for(var i in t)n.removeSchema(i),t[i]&&n.addSchema(t[i],i);this.options.schemaRefs=t}this.validateSchema=n.compile(e),this.options.schema=e,this.options.schemaRefs=t,this.validate()}}else this.validateSchema=null,this.options.schema=null,this.options.schemaRefs=null,this.validate();this.refresh(),"function"==typeof this._onSchemaChange&&this._onSchemaChange(e,t)},C.prototype.validate=function(){},C.prototype.refresh=function(){},(C.registerMode=function(e){var t;if(Array.isArray(e))for(o=0;o<e.length;o++)C.registerMode(e[o]);else{if(!("mode"in e))throw new Error('Property "mode" missing');if(!("mixin"in e))throw new Error('Property "mixin" missing');if(!("data"in e))throw new Error('Property "data" missing');var n=e.mode;if(n in C.modes)throw new Error('Mode "'+n+'" already registered');if("function"!=typeof e.mixin.create)throw new Error('Required function "create" missing on mixin');for(var i=["setMode","registerMode","modes"],o=0;o<i.length;o++)if((t=i[o])in e.mixin)throw new Error('Reserved property "'+t+'" not allowed in mixin');C.modes[n]=e}})(r),C.registerMode(s),C.registerMode(a),C.ace=n,C.Ajv=f,C.VanillaPicker=i,C.showTransformModal=p,C.showSortModal=m,C.getInnerText=d,e.exports=C.default=C},1389:function(e,t,n){n.d(t,{n:function(){return r}});var u=n(6545),g=n(3057);function o(e){return(o="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 i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(e=>(e=((e,t)=>{if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=o(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==o(e)?e:e+""))(i.key),i)}}var r=(()=>{function d(e,t,n,i){if(!(this instanceof d))throw new TypeError("Cannot call a class as a function");for(var o={code:{text:(0,g.Tl)("modeCodeText"),title:(0,g.Tl)("modeCodeTitle"),click:function(){i("code")}},form:{text:(0,g.Tl)("modeFormText"),title:(0,g.Tl)("modeFormTitle"),click:function(){i("form")}},text:{text:(0,g.Tl)("modeTextText"),title:(0,g.Tl)("modeTextTitle"),click:function(){i("text")}},tree:{text:(0,g.Tl)("modeTreeText"),title:(0,g.Tl)("modeTreeTitle"),click:function(){i("tree")}},view:{text:(0,g.Tl)("modeViewText"),title:(0,g.Tl)("modeViewTitle"),click:function(){i("view")}},preview:{text:(0,g.Tl)("modePreviewText"),title:(0,g.Tl)("modePreviewTitle"),click:function(){i("preview")}}},r=[],s=0;s<t.length;s++){var a=t[s],l=o[a];if(!l)throw new Error('Unknown mode "'+a+'"');l.className="jsoneditor-type-modes"+(n===a?" jsoneditor-selected":""),r.push(l)}var c=o[n];if(!c)throw new Error('Unknown mode "'+n+'"');var c=c.text,h=document.createElement("button"),c=(h.type="button",h.className="jsoneditor-modes jsoneditor-separator",h.textContent=c+" ▾",h.title=(0,g.Tl)("modeEditorTitle"),h.onclick=function(){new u.t(r).show(h,e)},document.createElement("div"));c.className="jsoneditor-modes",c.style.position="relative",c.appendChild(h),e.appendChild(c),this.dom={container:e,box:h,frame:c}}return e=d,(t=[{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}}])&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n})()},1678:function(e){e.exports=function(e,t,n){var i,o=" ",r=e.level,s=e.dataLevel,a=e.schema[t],l=e.schemaPath+e.util.getProperty(t),t=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,s="data"+(s||""),h="valid"+r,d="errs__"+r,u=e.util.copy(e),g=(u.level++,"valid"+u.level),p=e.schema.then,m=e.schema.else,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)),f=u.baseId;return p||m?(u.createErrors=!1,u.schema=a,u.schemaPath=l,u.errSchemaPath=t,o+=" var "+d+" = errors; var "+h+" = true; ",a=e.compositeRule,e.compositeRule=u.compositeRule=!0,o+=" "+e.validate(u)+" ",u.baseId=f,u.createErrors=!0,o+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=u.compositeRule=a,p?(o+=" if ("+g+") { ",u.schema=e.schema.then,u.schemaPath=e.schemaPath+".then",u.errSchemaPath=e.errSchemaPath+"/then",o+=" "+e.validate(u)+" ",u.baseId=f,o+=" "+h+" = "+g+"; ",p&&m?o+=" var "+(i="ifClause"+r)+" = 'then'; ":i="'then'",o+=" } ",m&&(o+=" else { ")):o+=" if (!"+g+") { ",m&&(u.schema=e.schema.else,u.schemaPath=e.schemaPath+".else",u.errSchemaPath=e.errSchemaPath+"/else",o+=" "+e.validate(u)+" ",u.baseId=f,o+=" "+h+" = "+g+"; ",p&&m?o+=" var "+(i="ifClause"+r)+" = 'else'; ":i="'else'",o+=" } "),o+=" if (!"+h+") { var err = ",!1!==e.createErrors?(o+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(t)+" , params: { failingKeyword: "+i+" } ",!1!==e.opts.messages&&(o+=" , message: 'should match \"' + "+i+" + '\" schema' "),e.opts.verbose&&(o+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+s+" "),o+=" } "):o+=" {} ",o+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?o+=" throw new ValidationError(vErrors); ":o+=" validate.errors = vErrors; return false; "),o+=" } ",c&&(o+=" else { ")):c&&(o+=" if (true) { "),o}},1746:function(e,t,n){var i;if(window.Picker)i=window.Picker;else try{i=n(7598)}catch(e){}e.exports=i},1765:function(e){e.exports=function(e,t,n){var i,o,r,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,y="maximum"==t,I=y?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[I],b=e.opts.$data&&v&&v.$data,A=y?"<":">",w=y?">":"<",x=void 0;if(!f&&"number"!=typeof d&&void 0!==d)throw new Error(t+" must be number");if(!b&&void 0!==v&&"number"!=typeof v&&"boolean"!=typeof v)throw new Error(I+" must be number or boolean");b?(h=e.util.getData(v.$data,h,e.dataPathArr),r="exclIsNumber"+c,s="' + "+(a="op"+c)+" + '",x=I,(S=S||[]).push(l=l+(" var schemaExcl"+c+" = "+h+"; ")+(" var "+(i="exclusive"+c)+"; var "+(o="exclType"+c)+" = typeof "+(h="schemaExcl"+c)+"; if ("+o+" != 'boolean' && "+o+" != 'undefined' && "+o+" != 'number') { ")),l="",!1!==e.createErrors?(l+=" { keyword: '"+(x||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: {} ",!1!==e.opts.messages&&(l+=" , message: '"+I+" should be boolean' "),e.opts.verbose&&(l+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),l+=" } "):l+=" {} ",k=l,l=S.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+=" "+o+" == 'number' ? ( ("+i+" = "+C+" === undefined || "+h+" "+A+"= "+C+") ? "+m+" "+w+"= "+h+" : "+m+" "+w+" "+C+" ) : ( ("+i+" = "+h+" === true) ? "+m+" "+w+"= "+C+" : "+m+" "+w+" "+C+" ) || "+m+" !== "+m+") { var op"+c+" = "+i+" ? '"+A+"' : '"+A+"='; ",void 0===d&&(g=e.errSchemaPath+"/"+(x=I),C=h,f=b)):(s=A,(r="number"==typeof v)&&f?(a="'"+s+"'",l+=" if ( ",f&&(l+=" ("+C+" !== undefined && typeof "+C+" != 'number') || "),l+=" ( "+C+" === undefined || "+v+" "+A+"= "+C+" ? "+m+" "+w+"= "+v+" : "+m+" "+w+" "+C+" ) || "+m+" !== "+m+") { "):(r&&void 0===d?(i=!0,g=e.errSchemaPath+"/"+(x=I),C=v,w+="="):(r&&(C=Math[y?"min":"max"](v,d)),v===(!r||C)?(i=!0,g=e.errSchemaPath+"/"+(x=I),w+="="):(i=!1,s+="=")),a="'"+s+"'",l+=" if ( ",f&&(l+=" ("+C+" !== undefined && typeof "+C+" != 'number') || "),l+=" "+m+" "+w+" "+C+" || "+m+" !== "+m+") { ")),x=x||t;(S=S||[]).push(l),l="",!1!==e.createErrors?(l+=" { keyword: '"+(x||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { comparison: "+a+", limit: "+C+", exclusive: "+i+" } ",!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 S,k=l;return l=S.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}},1925:function(e,t,n){n.d(t,{p:function(){return i}});var u=n(6237);function i(n,e,i){var t,o=3<arguments.length&&void 0!==arguments[3]&&arguments[3],r="function"==typeof(a=n).getRootNode?a.getRootNode():window,s={},a=n.getBoundingClientRect(),l=e.getBoundingClientRect(),c=document.createElement("div");function h(){if(c&&c.parentNode){for(var e in c.parentNode.removeChild(c),s)t=e,Object.prototype.hasOwnProperty.call(s,t)&&((t=s[e])&&(0,u.removeEventListener)(r,e,t),delete s[e]);"function"==typeof i&&i(n)}var t}function d(e){(e=e.target)===c||(0,u.isChildOf)(e,c)||h()}return c.className="jsoneditor-anchor",c.style.position="absolute",c.style.left=a.left-l.left+"px",c.style.top=a.top-l.top+"px",c.style.width=a.width-2+"px",c.style.height=a.height-2+"px",c.style.boxSizing="border-box",e.appendChild(c),s.mousedown=(0,u.addEventListener)(r,"mousedown",d),s.mousewheel=(0,u.addEventListener)(r,"mousewheel",d),o&&(t=null,c.onmouseover=function(){clearTimeout(t),t=null},c.onmouseout=function(){t=t||setTimeout(h,200)}),c.destroy=h,c}},1948:function(e,t,n){n.r(t),n.d(t,{textModeMixins:function(){return A}});var i=n(9857),t=n(7413),l=n.n(t),a=n(660),c=n(2115),h=n(2877),d=n(3057),u=n(359),g=n(1389),o=n(2915),p=n(5609),m=n(5467),f=n(3094),C=n(6237);function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(e=>(e=((e,t)=>{if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);if("object"!=r(n=n.call(e,t||"default")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")})(e,"string"),"symbol"==r(e)?e:e+""))(i.key),i)}}var y=(()=>{function n(e,t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function");this.schema=e,this.schemaRefs=t||{},this.suggestions={},this.suggestionsRefs={},this._buildSuggestions()}return e=n,(t=[{key:"_buildSuggestions",value:function(){for(var e in this._handleSchemaEntry("",this.schema,this.suggestions),this.schemaRefs)this.suggestionsRefs[e]={},this._handleSchemaEntry("",this.schemaRefs[e],this.suggestionsRefs[e])}},{key:"_handleRef",value:function(e,t,n){n[e]=n[e]||{},n[e].refs=n[e].refs||[],n[e].refs=(0,C.uniqueMergeArrays)(n[e].refs,[t])}},{key:"_handleSchemaEntry",value:function(e,t,n){if(t)if(t.$ref)this._handleRef(e,t.$ref,n);else{var i=this._checkOfConditon(t);if(i)this._handleOfCondition(e,t[i],n);else switch(t.type){case"object":this._handleObject(e,t,n);break;case"string":case"number":case"integer":this._handlePrimitive(e,t,n);break;case"boolean":this._handleBoolean(e,t,n);break;case"array":this._handleArray(e,t,n)}}else console.error("SchemaTextCompleter: schema node is missing for path",e)}},{key:"_handleObject",value:function(t,n,i){var e,o=this;(0,C.isObject)(n.properties)&&(e=Object.keys(n.properties),i[t]=i[t]||{},i[t].props=i[t].props||[],i[t].props=(0,C.uniqueMergeArrays)(i[t].props,e),e.forEach(function(e){(0,C.asyncExec)(function(){o._handleSchemaEntry("".concat(t,"/").concat(e),n.properties[e],i)})}))}},{key:"_handlePrimitive",value:function(e,t,n){n[e]=n[e]||{},(0,C.isArray)(t.examples)&&(n[e].examples=n[e].examples||[],n[e].examples=(0,C.uniqueMergeArrays)(n[e].examples,t.examples)),(0,C.isArray)(t.enum)&&(n[e].enum=n[e].enum||[],n[e].enum=(0,C.uniqueMergeArrays)(n[e].enum,t.enum))}},{key:"_handleBoolean",value:function(e,t,n){n[e]||(n[e]={bool:[!0,!1]})}},{key:"_handleArray",value:function(e,t,n){var i=this;t.items&&(0,C.asyncExec)(function(){i._handleSchemaEntry("".concat(e,"/\\d+"),t.items,n)})}},{key:"_handleOfCondition",value:function(t,e,n){var i=this;e&&e.length&&e.forEach(function(e){(0,C.asyncExec)(function(){i._handleSchemaEntry(t,e,n)})})}},{key:"_checkOfConditon",value:function(e){if(e)return e.oneOf?"oneOf":e.anyOf?"anyOf":e.allOf?"allOf":void 0}},{key:"getCompletions",value:function(e,t,i,n,s){var c=this;try{var o=f.parse(t.getValue()).pointers||{},r=function(i){function e(t){var e,n={props:"property",enum:"enum",bool:"boolean",examples:"examples"};i&&null!=(e=i[t])&&e.length&&(o=o.concat(i[t].map(function(e){return{caption:e+"",meta:"schema [".concat(n[t],"]"),score:r++,value:e+""}})))}var o=[],r=0;e("props"),e("enum"),e("bool"),e("examples"),o.length&&s(null,o)};Object.keys(o).forEach(function(n){(0,C.asyncExec)(function(){function l(n,e,i){var t,o=Object.keys(e).reduce(function(e,t){return new RegExp("^".concat(i).concat(t)).test(n)&&(!e||e.length<t.length)?t:e},null);if("string"==typeof o){if(null!=(t=e[o])&&null!=(t=t.refs)&&t.length){var r,s={};for(r in e[o].refs){var a=e[o].refs[r];c.suggestionsRefs[a]&&(null!=(a=l(n,c.suggestionsRefs[a],"".concat(i).concat(o)))&&a.enum&&(s.enum=(0,C.uniqueMergeArrays)(s.enum,a.enum)),null!=a&&a.examples&&(s.examples=(0,C.uniqueMergeArrays)(s.examples,a.examples)),null!=a&&a.bool&&(s.bool=(0,C.uniqueMergeArrays)(s.bool,a.bool)),null!=a)&&a.props&&(s.props=(0,C.uniqueMergeArrays)(s.props,a.props))}return s}if(new RegExp("^".concat(i).concat(o,"$")).test(n))return e[o]}}var e,t;(null==(t=o[n].key)?void 0:t.line)===i.row&&i.column>=o[n].key.column&&i.column<=o[n].keyEnd.column&&(e=n.slice(0,n.lastIndexOf("/"))),(e=(null==(t=o[n].value)?void 0:t.line)===i.row&&(null==(t=o[n].value)?void 0:t.line)===(null==(t=o[n].valueEnd)?void 0:t.line)&&i.column>=o[n].value.column&&i.column<=o[n].valueEnd.column?n:e)&&(t=l(e,c.suggestions,""),r(t))})})}catch(e){}}}])&&s(e.prototype,t),i&&s(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i})();function I(e){return(I="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 t={},v="ace/theme/jsoneditor";function b(){try{this.format()}catch(e){}}t.create=function(e){var t,n,i,o=this,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},s=(void 0===r.statusBar&&(r.statusBar=!0),r.mainMenuBar=!1!==r.mainMenuBar,r.enableSort=!1!==r.enableSort,r.enableTransform=!1!==r.enableTransform,r.createQuery=r.createQuery||u.V,r.executeQuery=r.executeQuery||u.e,r.showErrorTable=void 0!==r.showErrorTable?r.showErrorTable:["text","preview"],this.options=r,this.indentation="number"==typeof r.indentation?Number(r.indentation):2,(0,d.AI)(this.options.languages),(0,d.xC)(this.options.language),r.ace||l()),a=(this.mode="code"===r.mode?"code":"text","code"===this.mode&&void 0===s&&(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=r.theme||v,this.theme===v&&s&&(0,m.J)(),r.onTextSelectionChange&&this.onTextSelectionChange(r.onTextSelectionChange),this),e=(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,C.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){a._onKeyDown(e)},{target:this.frame,onFocus:this.options.onFocus||null,onBlur:this.options.onBlur||null}),e=(this.frameFocusTracker=new h.$(e),this.content=document.createElement("div"),this.content.className="jsoneditor-outer",this.options.mainMenuBar&&((0,C.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,d.Tl)("formatTitle"),this.menu.appendChild(e),e.onclick=function(){try{a.format(),a._onChange()}catch(e){a._onError(e)}},(e=document.createElement("button")).type="button",e.className="jsoneditor-compact",e.title=(0,d.Tl)("compactTitle"),this.menu.appendChild(e),e.onclick=function(){try{a.compact(),a._onChange()}catch(e){a._onError(e)}},this.options.enableSort&&((e=document.createElement("button")).type="button",e.className="jsoneditor-sort",e.title=(0,d.Tl)("sortTitleShort"),e.onclick=function(){a._showSortModal()},this.menu.appendChild(e)),this.options.enableTransform&&((e=document.createElement("button")).type="button",e.title=(0,d.Tl)("transformTitleShort"),e.className="jsoneditor-transform",e.onclick=function(){a._showTransformModal()},this.menu.appendChild(e)),(e=document.createElement("button")).type="button",e.className="jsoneditor-repair",e.title=(0,d.Tl)("repairTitle"),this.menu.appendChild(e),e.onclick=function(){try{a.repair(),a._onChange()}catch(e){a._onError(e)}},"code"===this.mode&&((e=document.createElement("button")).type="button",e.className="jsoneditor-undo jsoneditor-separator",e.title=(0,d.Tl)("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,d.Tl)("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 g.n(this.menu,this.options.modes,this.options.mode,function(e){try{a.setMode(e),a.modeSwitcher.focus()}catch(e){a._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)),this.options.onEditable&&I("function"===this.options.onEditable)&&!this.options.onEditable({})),s=(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),i=(s=s.edit(this.editorDom)).getSession(),s.$blockScrolling=1/0,s.setTheme(this.theme),s.setOptions({readOnly:e}),s.setShowPrintMargin(!1),s.setFontSize("14px"),i.setMode("ace/mode/json"),i.setTabSize(this.indentation),i.setUseSoftTabs(!0),i.setUseWrapMode(!0),n=i.setAnnotations,i.setAnnotations=function(e){n.call(this,e&&e.length?e:a.annotations)},s.commands.bindKey("Ctrl-L",null),s.commands.bindKey("Command-L",null),s.commands.bindKey("Ctrl-\\",null),s.commands.bindKey("Command-\\",null),s.commands.bindKey("Ctrl-Shift-\\",null),s.commands.bindKey("Command-Shift-\\",null),(this.aceEditor=s).on("change",this._onChange.bind(this)),s.on("changeSelection",this._onSelect.bind(this))):((i=document.createElement("textarea")).className="jsoneditor-text",i.spellcheck=!1,this.content.appendChild(i),this.textarea=i,this.textarea.readOnly=e,null===this.textarea.oninput?this.textarea.oninput=this._onChange.bind(this):this.textarea.onchange=this._onChange.bind(this),i.onselect=this._onSelect.bind(this),i.onmousedown=this._onMouseDown.bind(this),i.onblur=this._onBlur.bind(this)),this._updateHistoryButtons(),Array.isArray(this.options.showErrorTable)?this.options.showErrorTable.includes(this.mode):!0===this.options.showErrorTable);this.errorTable=new c.N({errorTableVisible:s,onToggleVisibility:function(){a._validateAndCatch()},onFocusLine:function(e){a.isFocused=!0,isNaN(e)||a.setTextSelection({row:e,column:1},{row:e,column:1e3})},onChangeHeight:function(e){e=e+(a.dom.statusBar?a.dom.statusBar.clientHeight:0)+1;a.content.style.marginBottom=-e+"px",a.content.style.paddingBottom=e+"px"}}),this.frame.appendChild(this.errorTable.getErrorTable()),r.statusBar&&((0,C.addClassName)(this.content,"has-status-bar"),this.curserInfoElements={},e=document.createElement("div"),(this.dom.statusBar=e).className="jsoneditor-statusbar",this.frame.appendChild(e),(i=document.createElement("span")).className="jsoneditor-curserinfo-label",i.innerText="Ln:",(s=document.createElement("span")).className="jsoneditor-curserinfo-val",s.innerText="1",e.appendChild(i),e.appendChild(s),(r=document.createElement("span")).className="jsoneditor-curserinfo-label",r.innerText="Col:",(i=document.createElement("span")).className="jsoneditor-curserinfo-val",i.innerText="1",e.appendChild(r),e.appendChild(i),this.curserInfoElements.colVal=i,this.curserInfoElements.lnVal=s,(r=document.createElement("span")).className="jsoneditor-curserinfo-label",r.innerText="characters selected",r.style.display="none",(i=document.createElement("span")).className="jsoneditor-curserinfo-count",i.innerText="0",i.style.display="none",this.curserInfoElements.countLabel=r,this.curserInfoElements.countVal=i,e.appendChild(i),e.appendChild(r),e.appendChild(this.errorTable.getErrorCounter()),e.appendChild(this.errorTable.getWarningIcon()),e.appendChild(this.errorTable.getErrorIcon())),this.setSchema(this.options.schema,this.options.schemaRefs)},t._onSchemaChange=function(e,t){this.aceEditor&&(this.options.allowSchemaSuggestions&&e?(this.aceEditor.setOption("enableBasicAutocompletion",[new y(e,t)]),this.aceEditor.setOption("enableLiveAutocompletion",!0)):(this.aceEditor.setOption("enableBasicAutocompletion",void 0),this.aceEditor.setOption("enableLiveAutocompletion",!1)))},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 n=this,e=this.options.modalAnchor||a.ai,i=this.get();(0,o.showSortModal)(e,i,function(e){var t;Array.isArray(i)&&(t=(0,C.sort)(i,e.path,e.direction),n.sortedBy=e,n.update(t)),(0,C.isObject)(i)&&(t=(0,C.sortObjectKeys)(i,e.direction),n.sortedBy=e,n.update(t))},n.sortedBy)}catch(e){this._onError(e)}},t._showTransformModal=function(){var t=this;try{var e=this.options,n=e.modalAnchor,i=e.createQuery,o=e.executeQuery,r=e.queryDescription,s=this.get();(0,p.showTransformModal)({container:n||a.ai,json:s,queryDescription:r,createQuery:i,executeQuery:o,onTransform:function(e){e=o(s,e);t.update(e)}})}catch(e){this._onError(e)}},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,n,i,o,r=this;function s(){r.curserInfoElements.countVal.innerText!==o&&(r.curserInfoElements.countVal.innerText=o,r.curserInfoElements.countVal.style.display=o?"inline":"none",r.curserInfoElements.countLabel.style.display=o?"inline":"none"),r.curserInfoElements.lnVal.innerText=n,r.curserInfoElements.colVal.innerText=i}this.textarea?setTimeout(function(){var e=(0,C.getInputSelection)(r.textarea);e.startIndex!==e.endIndex&&(o=e.endIndex-e.startIndex),i=(o&&r.cursorInfo&&r.cursorInfo.line===e.end.row&&r.cursorInfo.column===e.end.column?(n=e.start.row,e.start):(n=e.end.row,e.end)).column,r.cursorInfo={line:n,column:i,count:o},r.options.statusBar&&s()},0):this.aceEditor&&this.curserInfoElements&&(e=this.aceEditor.getCursorPosition(),t=this.aceEditor.getSelectedText(),n=e.row+1,i=e.column+1,o=t.length,r.cursorInfo={line:n,column:i,count:o},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