/*! * 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-2019 Jos de Jong, http://jsoneditoronline.org * * @author Jos de Jong, * @version 6.2.1 * @date 2019-08-01 */ !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,c,t){"use strict";t(23);var o=t(24),i=t(72),n=t(73),r=t(1).translate;c.parse=function(t){try{return JSON.parse(t)}catch(e){throw c.validate(t),e}},c.repair=function(n){var i=[],r=0,e=n.match(/^\s*(\/\*(.|[\r\n])*?\*\/)?\s*[\da-zA-Z_$]+\s*\(([\s\S]*)\)\s*;?\s*$/);e&&(n=e[3]);var t,o={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function s(){return n.charAt(r)}function a(){return n.charAt(r+1)}function l(e){return" "===e||"\n"===e||"\r"===e||"\t"===e}function c(){for(var e=i.length-1;0<=e;){var t=i[e];if(!l(t))return t;e--}return""}function h(){for(var e=r+1;e=e.left&&t.right+n<=e.right&&t.top-n>=e.top&&t.bottom+n<=e.bottom},c.debounce=function(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)}},c.textDiff=function(e,t){for(var i=t.length,n=0,r=e.length,o=t.length;t.charAt(n)===e.charAt(n)&&n',n.appendChild(l),t.submenuTitle&&(l.title=t.submenuTitle),s=l}else{var c=document.createElement("div");c.className="jsoneditor-expand",r.appendChild(c),s=r}s.onclick=function(e){e.preventDefault(),m._onExpandItem(i),s.focus()};var h=[];i.subItems=h;var d=document.createElement("ul");(i.ul=d).className="jsoneditor-menu",d.style.height="0",n.appendChild(d),u(d,h,t.submenu)}else r.innerHTML='
'+g(t.text)+"
";p.push(i)}})}(o,this.dom.items,i),this.maxHeight=0,i.forEach(function(e){var t=24*(i.length+(e.submenu?e.submenu.length:0));m.maxHeight=Math.max(m.maxHeight,t)})}f.prototype._getVisibleButtons=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},f.visibleMenu=void 0,f.prototype.show=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=d(e,t,function(){l.hide()}),o.bottom+this.maxHeighta.top&&(n=!1);var c=i?0:o.top-s.top;if(n){var h=e.offsetHeight;this.dom.menu.style.left="0",this.dom.menu.style.top=c+h+"px",this.dom.menu.style.bottom=""}else 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=u.getSelection(),this.anchor=e,setTimeout(function(){l.dom.focusButton.focus()},0),f.visibleMenu&&f.visibleMenu.hide(),f.visibleMenu=this},f.prototype.hide=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()),f.visibleMenu==this&&(f.visibleMenu=void 0)},f.prototype._onExpandItem=function(i){var n=this,e=i==this.expandedItem,t=this.expandedItem;if(t&&(t.ul.style.height="0",t.ul.style.padding="",setTimeout(function(){n.expandedItem!=t&&(t.ul.style.display="",u.removeClassName(t.ul.parentNode,"jsoneditor-selected"))},300),this.expandedItem=void 0),!e){var r=i.ul;r.style.display="block";r.clientHeight;setTimeout(function(){if(n.expandedItem==i){for(var e=0,t=0;t":!0,"=":!0,"!":!0},N={" ":!0,"\t":!0,"\n":!0};function j(e){return"0"<=e&&e<="9"||"-"===e}function n(){}n.prototype={tokenize:function(e){var t,i,n,r,o=[];for(this._current=0;this._current"===i?"="===e[this._current]?(this._current++,{type:R,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,i=this._current,n=e.length;"`"!==e[this._current]&&this._current
'+o("sort")+"
"+o("sortFieldLabel")+'
'+o("sortDirectionLabel")+'
';r({parent:e,content:n,overlayClass:"jsoneditor-modal-overlay",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=document.createElement("option");t.text=function(e){return""===e?"@":"."===e[0]?e.slice(1):e}(e),t.value=e,n.appendChild(t)}),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){var F=i(5),n=i(26),S=i(79),r=i(1).translate,_=i(80).stringifyPartial,k=i(0),D=i(2).MAX_PREVIEW_CHARACTERS,$=k.debounce;e.exports=function(e,E,A){var x=E,t='