!function(){functione(t,i,o){if(!(thisinstanceofe))thrownewError('JSONEditor constructor called without "new".');varn=util.getInternetExplorerVersion();if(-1!=n&&9>n)thrownewError("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");arguments.length&&this._create(t,i,o)}functiont(e,i,o){if(!(thisinstanceoft))thrownewError('TreeEditor constructor called without "new".');this._create(e,i,o)}functioni(e,t,o){if(!(thisinstanceofi))thrownewError('TextEditor constructor called without "new".');this._create(e,t,o)}functiono(e,t){this.editor=e,this.dom={},this.expanded=!1,t&&tinstanceofObject?(this.setField(t.field,t.fieldEditable),this.setValue(t.value,t.type)):(this.setField(""),this.setValue(null))}functionn(e){this.editor=e,this.dom={}}functions(e,t){functioni(e,t,n){n.forEach(function(n){if("separator"==n.type){vars=document.createElement("div");s.className="separator",a=document.createElement("li"),a.appendChild(s),e.appendChild(a)}else{varr={},a=document.createElement("li");e.appendChild(a);varl=document.createElement("button");if(l.className=n.className,r.button=l,n.title&&(l.title=n.title),n.click&&(l.onclick=function(){o.hide(),n.click()}),a.appendChild(l),n.submenu){vard=document.createElement("div");d.className="icon",l.appendChild(d),l.appendChild(document.createTextNode(n.text));varh;if(n.click){l.className+=" default";varc=document.createElement("button");r.buttonExpand=c,c.className="expand",c.innerHTML='<div class="expand"></div>',a.appendChild(c),n.submenuTitle&&(c.title=n.submenuTitle),h=c}else{varu=document.createElement("div");u.className="expand",l.appendChild(u),h=l}h.onclick=function(){o._onExpandItem(r),h.focus()};varp=[];r.subItems=p;varm=document.createElement("ul");r.ul=m,m.className="menu",m.style.height="0",a.appendChild(m),i(m,p,n.submenu)}elsel.innerHTML='<div class="icon"></div>'+n.text;t.push(r)}})}this.dom={};varo=this,n=this.dom;this.anchor=void0,this.items=e,this.eventListeners={},this.selection=void0,this.visibleSubmenu=void0,this.onClose=t?t.close:void0;vars=document.createElement("div");s.className="jsoneditor-contextmenu",n.menu=s;varr=document.createElement("ul");r.className="menu",s.appendChild(r),n.list=r,n.items=[];vara=document.createElement("button");n.focusButton=a;varl=document.createElement("li");l.style.overflow="hidden",l.style.height="0",l.appendChild(a),r.appendChild(l),i(r,this.dom.items,e),this.maxHeight=0,e.forEach(function(t){vari=24*(e.length+(t.submenu?t.submenu.length:0));o.maxHeight=Math.max(o.maxHeight,i)})}functionr(e){this.editor=e,this.clear(),this.actions={editField:{undo:function(e){e.node.updateField(e.oldValue)},redo:function(e){e.node.updateField(e.newValue)}},editValue:{undo:function(e){e.node.updateValue(e.oldValue)},redo:function(e){e.node.updateValue(e.newValue)}},appendNode:{undo:function(e){e.parent.removeChild(e.node)},redo:function(e){e.parent.appendChild(e.node)}},insertBeforeNode:{undo:function(e){e.parent.removeChild(e.node)},redo:function(e){e.parent.insertBefore(e.node,e.beforeNode)}},insertAfterNode:{undo:function(e){e.parent.removeChild(e.node)},redo:function(e){e.parent.insertAfter(e.node,e.afterNode)}},removeNode:{undo:function(e){vart=e.parent,i=t.childs[e.index]||t.append;t.insertBefore(e.node,i)},redo:function(e){e.parent.removeChild(e.node)}},duplicateNode:{undo:function(e){e.parent.removeChild(e.clone)},redo:function(e){e.parent.insertAfter(e.clone,e.node)}},changeType:{undo:function(e){e.node.changeType(e.oldType)},redo:function(e){e.node.changeType(e.newType)}},moveNode:{undo:function(e){e.startParent.moveTo(e.node,e.startIndex)},redo:function(e){e.endParent.moveTo(e.node,e.endIndex)}},sort:{undo:function(e){vart=e.node;t.hideChilds(),t.sort=e.oldSort,t.childs=e.oldChilds,t.showChilds()},redo:function(e){vart=e.node;t.hideChilds(),t.sort=e.newSort,t.childs=e.newChilds,t.showChilds()}}}}functiona(e,t,i){functiono(t){e.setMode(t);vari=e.dom&&e.dom.modeBox;i&&i.focus()}for(varn={code:{text:"Code",title:"Switch to code highlighter",click:funct
}}x&&(this.drag.mouseX=y,this.drag.level=this.getLevel()),this.editor.startAutoScroll(g),e.preventDefault()},o.prototype._onDragEnd=function(e){vart={node:this,startParent:this.drag.startParent,startIndex:this.drag.startIndex,endParent:this.parent,endIndex:this.parent.childs.indexOf(this)};(t.startParent!=t.endParent||t.startIndex!=t.endIndex)&&this.editor._onAction("moveNode",t),document.body.style.cursor=this.drag.oldCursor,this.editor.highlighter.unlock(),deletethis.drag,this.mousemove&&(util.removeEventListener(document,"mousemove",this.mousemove),deletethis.mousemove),this.mouseup&&(util.removeEventListener(document,"mouseup",this.mouseup),deletethis.mouseup),this.editor.stopAutoScroll(),e.preventDefault()},o.prototype._isChildOf=function(e){for(vart=this.parent;t;){if(t==e)return!0;t=t.parent}return!1},o.prototype._createDomField=function(){returndocument.createElement("div")},o.prototype.setHighlight=function(e){this.dom.tr&&(this.dom.tr.className=e?"highlight":"",this.append&&this.append.setHighlight(e),this.childs&&this.childs.forEach(function(t){t.setHighlight(e)}))},o.prototype.updateValue=function(e){this.value=e,this.updateDom()},o.prototype.updateField=function(e){this.field=e,this.updateDom()},o.prototype.updateDom=function(e){vart=this.dom.tree;t&&(t.style.marginLeft=24*this.getLevel()+"px");vari=this.dom.field;if(i){1==this.fieldEditable?(i.contentEditable=this.editor.mode.edit,i.spellcheck=!1,i.className="field"):i.className="readonly";varo;o=void0!=this.index?this.index:void0!=this.field?this.field:this._hasChilds()?this.type:"",i.innerHTML=this._escapeHTML(o)}varn=this.dom.value;if(n){vars=this.childs?this.childs.length:0;n.innerHTML="array"==this.type?"["+s+"]":"object"==this.type?"{"+s+"}":this._escapeHTML(this.value)}this._updateDomField(),this._updateDomValue(),e&&1==e.updateIndexes&&this._updateDomIndexes(),e&&1==e.recurse&&this.childs&&this.childs.forEach(function(t){t.updateDom(e)}),this.append&&this.append.updateDom()},o.prototype._updateDomIndexes=function(){vare=this.dom.value,t=this.childs;e&&t&&("array"==this.type?t.forEach(function(e,t){e.index=t;vari=e.dom.field;i&&(i.innerHTML=t)}):"object"==this.type&&t.forEach(function(e){void0!=e.index&&(deletee.index,void0==e.field&&(e.field=""))}))},o.prototype._createDomValue=function(){vare;return"array"==this.type?(e=document.createElement("div"),e.className="readonly",e.innerHTML="[...]"):"object"==this.type?(e=document.createElement("div"),e.className="readonly",e.innerHTML="{...}"):!this.editor.mode.edit&&util.isUrl(this.value)?(e=document.createElement("a"),e.className="value",e.href=this.value,e.target="_blank",e.innerHTML=this._escapeHTML(this.value)):(e=document.createElement("div"),e.contentEditable=!this.editor.mode.view,e.spellcheck=!1,e.className="value",e.innerHTML=this._escapeHTML(this.value)),e},o.prototype._createDomExpandButton=function(){vare=document.createElement("button");returnthis._hasChilds()?(e.className=this.expanded?"expanded":"collapsed",e.title="Click to expand/collapse this field (Ctrl+E). \nCtrl+Click to expand/collapse including all childs."):(e.className="invisible",e.title=""),e},o.prototype._createDomTree=function(){vare=this.dom,t=document.createElement("table"),i=document.createElement("tbody");t.style.borderCollapse="collapse",t.className="values",t.appendChild(i);varo=document.createElement("tr");i.appendChild(o);varn=document.createElement("td");n.className="tree",o.appendChild(n),e.expand=this._createDomExpandButton(),n.appendChild(e.expand),e.tdExpand=n;vars=document.createElement("td");s.className="tree",o.appendChild(s),e.field=this._createDomField(),s.appendChild(e.field),e.tdField=s;varr=document.createElement("td");r.className="tree",o.appendChild(r),"object"!=this.type&&"array"!=this.type&&(r.appendChild(document.createTextNode(":")),r.className="separator"),e.tdSeparator=r;vara=document.createElement("td");returna.className="tree",o.appendChild(a),e.value=this._createDomValue(),a.appendChild(e.value),e.tdValue=a,t},o.prototype.onEvent=function(e){vart,i=e.type,o=e.targ