/*! * 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, Opera, Internet Explorer 8+ * * @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-2020 Jos de Jong, http://jsoneditoronline.org * * @author Jos de Jong, * @version 8.6.8 * @date 2020-05-13 */ !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()}(window,function(){return n={},r.m=i=[function(e,t,i){"use strict";i.r(t),i.d(t,"parse",function(){return g}),i.d(t,"repair",function(){return p}),i.d(t,"escapeUnicodeChars",function(){return m}),i.d(t,"validate",function(){return f}),i.d(t,"extend",function(){return C}),i.d(t,"clear",function(){return I}),i.d(t,"getType",function(){return A}),i.d(t,"isUrl",function(){return b}),i.d(t,"isArray",function(){return y}),i.d(t,"getAbsoluteLeft",function(){return w}),i.d(t,"getAbsoluteTop",function(){return S}),i.d(t,"addClassName",function(){return x}),i.d(t,"removeAllClassNames",function(){return k}),i.d(t,"removeClassName",function(){return R}),i.d(t,"stripFormatting",function(){return E}),i.d(t,"setEndOfContentEditable",function(){return B}),i.d(t,"selectContentEditable",function(){return Z}),i.d(t,"getSelection",function(){return T}),i.d(t,"setSelection",function(){return G}),i.d(t,"getSelectionOffset",function(){return W}),i.d(t,"setSelectionOffset",function(){return _}),i.d(t,"getInnerText",function(){return H}),i.d(t,"hasParentNode",function(){return L}),i.d(t,"getInternetExplorerVersion",function(){return $}),i.d(t,"isFirefox",function(){return V}),i.d(t,"addEventListener",function(){return O}),i.d(t,"removeEventListener",function(){return F}),i.d(t,"isChildOf",function(){return P}),i.d(t,"parsePath",function(){return K}),i.d(t,"stringifyPath",function(){return M}),i.d(t,"improveSchemaError",function(){return j}),i.d(t,"isPromise",function(){return D}),i.d(t,"isValidValidationError",function(){return X}),i.d(t,"insideRect",function(){return Y}),i.d(t,"debounce",function(){return z}),i.d(t,"textDiff",function(){return J}),i.d(t,"getInputSelection",function(){return U}),i.d(t,"getIndexForPosition",function(){return Q}),i.d(t,"getPositionForPath",function(){return q}),i.d(t,"compileJSONPointer",function(){return ee}),i.d(t,"getColorCSS",function(){return te}),i.d(t,"isValidColor",function(){return ie}),i.d(t,"makeFieldTooltip",function(){return ne}),i.d(t,"get",function(){return re}),i.d(t,"findUniqueName",function(){return oe}),i.d(t,"getChildPaths",function(){return se}),i.d(t,"sort",function(){return ae}),i.d(t,"sortObjectKeys",function(){return le}),i.d(t,"parseString",function(){return ce}),i.d(t,"isTimestamp",function(){return he}),i.d(t,"formatSize",function(){return de}),i.d(t,"limitCharacters",function(){return ue}),i.d(t,"isObject",function(){return ge}),i.d(t,"contains",function(){return pe}),i.d(t,"isValidationErrorChanged",function(){return me});i(24);var n=i(11),o=i.n(n),r=i(22),s=i.n(r),a=i(33),l=i.n(a),c=i(1);function h(e){return(h="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 d=1e4,u=9466848e5;function g(t){try{return JSON.parse(t)}catch(e){throw f(t),e}}function p(n){var i=[],r=0,e=0,t=!1,o=n.match(/^\s*(\/\*(.|[\r\n])*?\*\/)?\s*[\da-zA-Z_$]+\s*\(([\s\S]*)\)\s*;?\s*$/);o&&(n=o[3]);var s,a={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},l={None:"null",True:"true",False:"false"};function c(){return n.charAt(r)}function h(){return n.charAt(r+1)}function d(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function u(){for(var e=i.length-1;0<=e;){var t=i[e];if(!d(t))return t;e--}return""}function g(){for(var e=r+1;e=e.left&&t.right+n<=e.right&&t.top-n>=e.top&&t.bottom+n<=e.bottom}function z(n,r,o){var s;return function(){var e=this,t=arguments,i=o&&!s;clearTimeout(s),s=setTimeout(function(){s=null,o||n.apply(e,t)},r),i&&n.apply(e,t)}}function J(e,t){for(var i=t.length,n=0,r=e.length,o=t.length;t.charAt(n)===e.charAt(n)&&n',r.appendChild(c),t.submenuTitle&&(c.title=t.submenuTitle),c):((h=document.createElement("div")).className="jsoneditor-expand",o.appendChild(h),o)).onclick=function(e){e.preventDefault(),f._onExpandItem(n),l.focus()},d=[],n.subItems=d,u=document.createElement("ul"),(n.ul=u).className="jsoneditor-menu",u.style.height="0",r.appendChild(u),g(u,d,t.submenu)):o.innerHTML='
'+Object(C.c)(t.text)+"
",m.push(n))})}(o,this.dom.items,i),this.maxHeight=0,i.forEach(function(e){var t=24*(i.length+(e.submenu?e.submenu.length:0));f.maxHeight=Math.max(f.maxHeight,t)})}var e,t,i;return e=d,(t=[{key:"_getVisibleButtons",value:function(){var t=[],i=this;return this.dom.items.forEach(function(e){t.push(e.button),e.buttonExpand&&t.push(e.buttonExpand),e.subItems&&e===i.expandedItem&&e.subItems.forEach(function(e){t.push(e.button),e.buttonExpand&&t.push(e.buttonExpand)})}),t}},{key:"show",value:function(e,t,i){this.hide();var n=!0,r=e.parentNode,o=e.getBoundingClientRect(),s=r.getBoundingClientRect(),a=t.getBoundingClientRect(),l=this;this.dom.absoluteAnchor=Object(u.a)(e,t,function(){l.hide()}),o.bottom+this.maxHeighta.top&&(n=!1);var c,h=i?0:o.top-s.top;n?(c=e.offsetHeight,this.dom.menu.style.left="0",this.dom.menu.style.top=h+c+"px",this.dom.menu.style.bottom=""):(this.dom.menu.style.left="0",this.dom.menu.style.top="",this.dom.menu.style.bottom="0px"),this.dom.absoluteAnchor.appendChild(this.dom.root),this.selection=Object(g.getSelection)(),this.anchor=e,setTimeout(function(){l.dom.focusButton.focus()},0),d.visibleMenu&&d.visibleMenu.hide(),d.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()),d.visibleMenu===this&&(d.visibleMenu=void 0)}},{key:"_onExpandItem",value:function(i){var n,r=this,e=i===this.expandedItem,t=this.expandedItem;t&&(t.ul.style.height="0",t.ul.style.padding="",setTimeout(function(){r.expandedItem!==t&&(t.ul.style.display="",Object(g.removeClassName)(t.ul.parentNode,"jsoneditor-selected"))},300),this.expandedItem=void 0),e||((n=i.ul).style.display="block",n.clientHeight,setTimeout(function(){if(r.expandedItem===i){for(var e=0,t=0;t
'+Object(o.c)("sort")+"
"+Object(o.c)("sortFieldLabel")+'
'+Object(o.c)("sortDirectionLabel")+'
';r()({parent:e,content:n,overlayClass:"jsoneditor-modal-overlay",overlayStyles:{backgroundColor:"rgb(1,1,1)",opacity:.3},modalClass:"jsoneditor-modal jsoneditor-modal-sort"}).afterCreate(function(t){var e=t.modalElem().querySelector("form"),i=t.modalElem().querySelector("#ok"),n=t.modalElem().querySelector("#field"),r=t.modalElem().querySelector("#direction");function o(e){r.value=e,r.className="jsoneditor-button-group jsoneditor-button-group-value-"+r.value}a.forEach(function(e){var t,i=document.createElement("option");i.text=""===(t=e)?"@":"."===t[0]?t.slice(1):t,i.value=e,n.appendChild(i)}),n.value=l||a[0],o(c||"asc"),r.onclick=function(e){o(e.target.getAttribute("data-value"))},i.onclick=function(e){e.preventDefault(),e.stopPropagation(),t.close(),s({path:n.value,direction:r.value})},e&&(e.onsubmit=i.onclick)}).afterClose(function(e){e.destroy()}).show()}},function(e,t,i){"use strict";i.r(t),i.d(t,"showTransformModal",function(){return c});var n=i(14),o=i.n(n),r=i(10),E=i.n(r),s=i(1);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(e,t,i,n){return"boolean"==typeof e||e instanceof Boolean||null===e||"number"==typeof e||e instanceof Number||"string"==typeof e||e instanceof String||e instanceof Date?JSON.stringify(e):Array.isArray(e)?function(e,t,i,n){for(var r=t?i+t:void 0,o=t?"[\n":"[",s=0;sn)return o+"..."}return o+=t?"\n"+i+"]":"]"}(e,t,i,n):e&&"object"===a(e)?function(e,t,i,n){var r=t?i+t:void 0,o=!0,s=t?"{\n":"{";if("function"==typeof e.toJSON)return B(e.toJSON(),t,i,n);for(var a in e)if(c=e,h=a,Object.prototype.hasOwnProperty.call(c,h)){var l=e[a];if(o?o=!1:s+=t?",\n":",",s+=t?r+'"'+a+'": ':'"'+a+'":',(s+=B(l,t,r,n)).length>n)return s+"..."}var c,h;return s+=t?"\n"+i+"}":"}"}(e,t,i,n):void 0}function Z(e,t){for(var i="";0JMESPath query to filter, sort, or transform the JSON data.
To learn JMESPath, go to the interactive tutorial.';function c(e){var t=e.container,w=e.json,i=e.queryDescription,n=void 0===i?l:i,S=e.createQuery,x=e.executeQuery,k=e.onTransform,R=w,r='