File: /var/www/zaklada/wp-content/plugins/responsive-lightbox/assets/jstree/jstree.min.js
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(E,P){"use strict";if(!E.jstree){var s=0,a=!1,n=!1,o=!1,r=[],e=E("script:last").attr("src"),y=window.document,c=window.setImmediate,i=window.Promise;!c&&i&&(c=function(e,t){i.resolve(t).then(e)}),E.jstree={version:"3.3.10",defaults:{plugins:[]},plugins:{},path:e&&-1!==e.indexOf("/")?e.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g,root:"#"},E.jstree.create=function(e,r){var i=new E.jstree.core(++s),t=r;return r=E.extend(!0,{},E.jstree.defaults,r),t&&t.plugins&&(r.plugins=t.plugins),E.each(r.plugins,function(e,t){"core"!==e&&(i=i.plugin(t,r[t]))}),E(e).data("jstree",i),i.init(e,r),i},E.jstree.destroy=function(){E(".jstree:jstree").jstree("destroy"),E(y).off(".jstree")},E.jstree.core=function(e){this._id=e,this._cnt=0,this._wrk=null,this._data={core:{themes:{name:!1,dots:!1,icons:!1,ellipsis:!1},selected:[],last_error:{},working:!1,worker_queue:[],focused:null}}},E.jstree.reference=function(t){var r=null,e=null;if(!t||!t.id||t.tagName&&t.nodeType||(t=t.id),!e||!e.length)try{e=E(t)}catch(e){}if(!e||!e.length)try{e=E("#"+t.replace(E.jstree.idregex,"\\$&"))}catch(e){}return e&&e.length&&(e=e.closest(".jstree")).length&&(e=e.data("jstree"))?r=e:E(".jstree").each(function(){var e=E(this).data("jstree");if(e&&e._model.data[t])return r=e,!1}),r},E.fn.jstree=function(r){var i="string"==typeof r,s=Array.prototype.slice.call(arguments,1),a=null;return!(!0===r&&!this.length)&&(this.each(function(){var e=E.jstree.reference(this),t=i&&e?e[r]:null;if(a=i&&t?t.apply(e,s):null,e||i||r!==P&&!E.isPlainObject(r)||E.jstree.create(this,r),(e&&!i||!0===r)&&(a=e||!1),null!==a&&a!==P)return!1}),null!==a&&a!==P?a:this)},E.expr.pseudos.jstree=E.expr.createPseudo(function(e){return function(e){return E(e).hasClass("jstree")&&E(e).data("jstree")!==P}}),E.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:E.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,ellipsis:!1,stripes:!1,variant:!1,responsive:!1},expand_selected_onload:!0,worker:!0,force_text:!1,dblclick_toggle:!0,loaded_state:!1,restore_focus:!0,keyboard:{"ctrl-space":function(e){e.type="click",E(e.currentTarget).trigger(e)},enter:function(e){e.type="click",E(e.currentTarget).trigger(e)},left:function(e){var t;e.preventDefault(),this.is_open(e.currentTarget)?this.close_node(e.currentTarget):(t=this.get_parent(e.currentTarget))&&t.id!==E.jstree.root&&this.get_node(t,!0).children(".jstree-anchor").focus()},up:function(e){e.preventDefault();var t=this.get_prev_dom(e.currentTarget);t&&t.length&&t.children(".jstree-anchor").focus()},right:function(e){var t;e.preventDefault(),this.is_closed(e.currentTarget)?this.open_node(e.currentTarget,function(e){this.get_node(e,!0).children(".jstree-anchor").focus()}):!this.is_open(e.currentTarget)||(t=this.get_node(e.currentTarget,!0).children(".jstree-children")[0])&&E(this._firstChild(t)).children(".jstree-anchor").focus()},down:function(e){e.preventDefault();var t=this.get_next_dom(e.currentTarget);t&&t.length&&t.children(".jstree-anchor").focus()},"*":function(e){this.open_all()},home:function(e){e.preventDefault();var t=this._firstChild(this.get_container_ul()[0]);t&&E(t).children(".jstree-anchor").filter(":visible").focus()},end:function(e){e.preventDefault(),this.element.find(".jstree-anchor").filter(":visible").last().focus()},f2:function(e){e.preventDefault(),this.edit(e.currentTarget)}}},E.jstree.core.prototype={plugin:function(e,t){var r=E.jstree.plugins[e];return r?(this._data[e]={},r.prototype=this,new r(t,this)):this},init:function(e,t){this._model={data:{},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}},this._model.data[E.jstree.root]={id:E.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}},this.element=E(e).addClass("jstree jstree-"+this._id),this.settings=t,this._data.core.ready=!1,this._data.core.loaded=!1,this._data.core.rtl="rtl"===this.element.css("direction"),this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl"),this.element.attr("role","tree"),this.settings.core.multiple&&this.element.attr("aria-multiselectable",!0),this.element.attr("tabindex")||this.element.attr("tabindex","0"),this.bind(),this.trigger("init"),this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0),this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.element.html("<ul class='jstree-container-ul jstree-children' role='group'><li id='j"+this._id+"_loading' class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='presentation'><i class='jstree-icon jstree-ocl'></i><a class='jstree-anchor' role='treeitem' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>"+this.get_string("Loading ...")+"</a></li></ul>"),this.element.attr("aria-activedescendant","j"+this._id+"_loading"),this._data.core.li_height=this.get_container_ul().children("li").first().outerHeight()||24,this._data.core.node=this._create_prototype_node(),this.trigger("loading"),this.load_node(E.jstree.root)},destroy:function(e){if(this.trigger("destroy"),this._wrk)try{window.URL.revokeObjectURL(this._wrk),this._wrk=null}catch(e){}e||this.element.empty(),this.teardown()},_create_prototype_node:function(){var e,t,r=y.createElement("LI");return r.setAttribute("role","presentation"),(e=y.createElement("I")).className="jstree-icon jstree-ocl",e.setAttribute("role","presentation"),r.appendChild(e),(e=y.createElement("A")).className="jstree-anchor",e.setAttribute("href","#"),e.setAttribute("tabindex","-1"),e.setAttribute("role","treeitem"),(t=y.createElement("I")).className="jstree-icon jstree-themeicon",t.setAttribute("role","presentation"),e.appendChild(t),r.appendChild(e),e=t=null,r},_kbevent_to_func:function(e){var t=[];if(e.ctrlKey&&t.push("ctrl"),e.altKey&&t.push("alt"),e.shiftKey&&t.push("shift"),t.push({8:"Backspace",9:"Tab",13:"Enter",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",16:"Shift",17:"Ctrl",18:"Alt",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:"*",173:"-"}[e.which]||e.which),"shift-shift"===(t=t.sort().join("-").toLowerCase())||"ctrl-ctrl"===t||"alt-alt"===t)return null;var r,i,s=this.settings.core.keyboard;for(r in s)if(s.hasOwnProperty(r)&&("-"!==(i=r)&&"+"!==i&&(i=(i=i.replace("--","-MINUS").replace("+-","-MINUS").replace("++","-PLUS").replace("-+","-PLUS")).split(/-|\+/).sort().join("-").replace("MINUS","-").replace("PLUS","+").toLowerCase()),i===t))return s[r];return null},teardown:function(){this.unbind(),this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")}),this.element=null},bind:function(){var a="",n=null,t=0;this.element.on("dblclick.jstree",function(e){if(e.target.tagName&&"input"===e.target.tagName.toLowerCase())return!0;if(y.selection&&y.selection.empty)y.selection.empty();else if(window.getSelection){var t=window.getSelection();try{t.removeAllRanges(),t.collapse()}catch(e){}}}).on("mousedown.jstree",E.proxy(function(e){e.target===this.element[0]&&(e.preventDefault(),t=+new Date)},this)).on("mousedown.jstree",".jstree-ocl",function(e){e.preventDefault()}).on("click.jstree",".jstree-ocl",E.proxy(function(e){this.toggle_node(e.target)},this)).on("dblclick.jstree",".jstree-anchor",E.proxy(function(e){return!(!e.target.tagName||"input"!==e.target.tagName.toLowerCase())||void(this.settings.core.dblclick_toggle&&this.toggle_node(e.target))},this)).on("click.jstree",".jstree-anchor",E.proxy(function(e){e.preventDefault(),e.currentTarget!==y.activeElement&&E(e.currentTarget).focus(),this.activate_node(e.currentTarget,e)},this)).on("keydown.jstree",".jstree-anchor",E.proxy(function(e){if(e.target.tagName&&"input"===e.target.tagName.toLowerCase())return!0;this._data.core.rtl&&(37===e.which?e.which=39:39===e.which&&(e.which=37));var t=this._kbevent_to_func(e);if(t){var r=t.call(this,e);if(!1===r||!0===r)return r}},this)).on("load_node.jstree",E.proxy(function(e,t){t.status&&(t.node.id!==E.jstree.root||this._data.core.loaded||(this._data.core.loaded=!0,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.trigger("loaded")),this._data.core.ready||setTimeout(E.proxy(function(){if(this.element&&!this.get_container_ul().find(".jstree-loading").length){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){for(var e=[],t=0,r=this._data.core.selected.length;t<r;t++)e=e.concat(this._model.data[this._data.core.selected[t]].parents);for(t=0,r=(e=E.vakata.array_unique(e)).length;t<r;t++)this.open_node(e[t],!1,0)}this.trigger("changed",{action:"ready",selected:this._data.core.selected})}this.trigger("ready")}},this),0))},this)).on("keypress.jstree",E.proxy(function(e){if(e.target.tagName&&"input"===e.target.tagName.toLowerCase())return!0;n&&clearTimeout(n),n=setTimeout(function(){a=""},500);var r=String.fromCharCode(e.which).toLowerCase(),t=this.element.find(".jstree-anchor").filter(":visible"),i=t.index(y.activeElement)||0,s=!1;if(1<(a+=r).length){if(t.slice(i).each(E.proxy(function(e,t){if(0===E(t).text().toLowerCase().indexOf(a))return E(t).focus(),!(s=!0)},this)),s)return;if(t.slice(0,i).each(E.proxy(function(e,t){if(0===E(t).text().toLowerCase().indexOf(a))return E(t).focus(),!(s=!0)},this)),s)return}if(new RegExp("^"+r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"+$").test(a)){if(t.slice(i+1).each(E.proxy(function(e,t){if(E(t).text().toLowerCase().charAt(0)===r)return E(t).focus(),!(s=!0)},this)),s)return;if(t.slice(0,i+1).each(E.proxy(function(e,t){if(E(t).text().toLowerCase().charAt(0)===r)return E(t).focus(),!(s=!0)},this)),s)return}},this)).on("init.jstree",E.proxy(function(){var e=this.settings.core.themes;this._data.core.themes.dots=e.dots,this._data.core.themes.stripes=e.stripes,this._data.core.themes.icons=e.icons,this._data.core.themes.ellipsis=e.ellipsis,this.set_theme(e.name||"default",e.url),this.set_theme_variant(e.variant)},this)).on("loading.jstree",E.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"](),this[this._data.core.themes.icons?"show_icons":"hide_icons"](),this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"](),this[this._data.core.themes.ellipsis?"show_ellipsis":"hide_ellipsis"]()},this)).on("blur.jstree",".jstree-anchor",E.proxy(function(e){this._data.core.focused=null,E(e.currentTarget).filter(".jstree-hovered").trigger("mouseleave"),this.element.attr("tabindex","0")},this)).on("focus.jstree",".jstree-anchor",E.proxy(function(e){var t=this.get_node(e.currentTarget);t&&t.id&&(this._data.core.focused=t.id),this.element.find(".jstree-hovered").not(e.currentTarget).trigger("mouseleave"),E(e.currentTarget).trigger("mouseenter"),this.element.attr("tabindex","-1")},this)).on("focus.jstree",E.proxy(function(){var e;500<new Date-t&&!this._data.core.focused&&this.settings.core.restore_focus&&(t=0,(e=this.get_node(this.element.attr("aria-activedescendant"),!0))&&e.find("> .jstree-anchor").focus())},this)).on("mouseenter.jstree",".jstree-anchor",E.proxy(function(e){this.hover_node(e.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",E.proxy(function(e){this.dehover_node(e.currentTarget)},this))},unbind:function(){this.element.off(".jstree"),E(y).off(".jstree-"+this._id)},trigger:function(e,t){((t=t||{}).instance=this).element.triggerHandler(e.replace(".jstree","")+".jstree",t)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children(".jstree-children").first()},get_string:function(e){var t=this.settings.core.strings;return"function"==typeof t?t.call(this,e):t&&t[e]?t[e]:e},_firstChild:function(e){for(e=e?e.firstChild:null;null!==e&&1!==e.nodeType;)e=e.nextSibling;return e},_nextSibling:function(e){for(e=e?e.nextSibling:null;null!==e&&1!==e.nodeType;)e=e.nextSibling;return e},_previousSibling:function(e){for(e=e?e.previousSibling:null;null!==e&&1!==e.nodeType;)e=e.previousSibling;return e},get_node:function(e,t){var r;e&&e.id&&(e=e.id),e instanceof E&&e.length&&e[0].id&&(e=e[0].id);try{if(this._model.data[e])e=this._model.data[e];else if("string"==typeof e&&this._model.data[e.replace(/^#/,"")])e=this._model.data[e.replace(/^#/,"")];else if("string"==typeof e&&(r=E("#"+e.replace(E.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[r.closest(".jstree-node").attr("id")])e=this._model.data[r.closest(".jstree-node").attr("id")];else if((r=this.element.find(e)).length&&this._model.data[r.closest(".jstree-node").attr("id")])e=this._model.data[r.closest(".jstree-node").attr("id")];else{if(!(r=this.element.find(e)).length||!r.hasClass("jstree"))return!1;e=this._model.data[E.jstree.root]}return t&&(e=e.id===E.jstree.root?this.element:E("#"+e.id.replace(E.jstree.idregex,"\\$&"),this.element)),e}catch(e){return!1}},get_path:function(e,t,r){if(!(e=e.parents?e:this.get_node(e))||e.id===E.jstree.root||!e.parents)return!1;var i,s,a=[];for(a.push(r?e.id:e.text),i=0,s=e.parents.length;i<s;i++)a.push(r?e.parents[i]:this.get_text(e.parents[i]));return a=a.reverse().slice(1),t?a.join(t):a},get_next_dom:function(e,t){var r;if((e=this.get_node(e,!0))[0]===this.element[0]){for(r=this._firstChild(this.get_container_ul()[0]);r&&0===r.offsetHeight;)r=this._nextSibling(r);return!!r&&E(r)}if(!e||!e.length)return!1;if(t){for(r=e[0];(r=this._nextSibling(r))&&0===r.offsetHeight;);return!!r&&E(r)}if(e.hasClass("jstree-open")){for(r=this._firstChild(e.children(".jstree-children")[0]);r&&0===r.offsetHeight;)r=this._nextSibling(r);if(null!==r)return E(r)}for(r=e[0];(r=this._nextSibling(r))&&0===r.offsetHeight;);return null!==r?E(r):e.parentsUntil(".jstree",".jstree-node").nextAll(".jstree-node:visible").first()},get_prev_dom:function(e,t){var r;if((e=this.get_node(e,!0))[0]===this.element[0]){for(r=this.get_container_ul()[0].lastChild;r&&0===r.offsetHeight;)r=this._previousSibling(r);return!!r&&E(r)}if(!e||!e.length)return!1;if(t){for(r=e[0];(r=this._previousSibling(r))&&0===r.offsetHeight;);return!!r&&E(r)}for(r=e[0];(r=this._previousSibling(r))&&0===r.offsetHeight;);if(null===r)return!(!(r=e[0].parentNode.parentNode)||!r.className||-1===r.className.indexOf("jstree-node"))&&E(r);for(e=E(r);e.hasClass("jstree-open");)e=e.children(".jstree-children").first().children(".jstree-node:visible:last");return e},get_parent:function(e){return!(!(e=this.get_node(e))||e.id===E.jstree.root)&&e.parent},get_children_dom:function(e){return(e=this.get_node(e,!0))[0]===this.element[0]?this.get_container_ul().children(".jstree-node"):!(!e||!e.length)&&e.children(".jstree-children").children(".jstree-node")},is_parent:function(e){return(e=this.get_node(e))&&(!1===e.state.loaded||0<e.children.length)},is_loaded:function(e){return(e=this.get_node(e))&&e.state.loaded},is_loading:function(e){return(e=this.get_node(e))&&e.state&&e.state.loading},is_open:function(e){return(e=this.get_node(e))&&e.state.opened},is_closed:function(e){return(e=this.get_node(e))&&this.is_parent(e)&&!e.state.opened},is_leaf:function(e){return!this.is_parent(e)},load_node:function(n,o){var e,t,r,i,s;if(Array.isArray(n))return this._load_nodes(n.slice(),o),!0;if(!(n=this.get_node(n)))return o&&o.call(this,n,!1),!1;if(n.state.loaded){for(n.state.loaded=!1,r=0,i=n.parents.length;r<i;r++)this._model.data[n.parents[r]].children_d=E.vakata.array_filter(this._model.data[n.parents[r]].children_d,function(e){return-1===E.inArray(e,n.children_d)});for(e=0,t=n.children_d.length;e<t;e++)this._model.data[n.children_d[e]].state.selected&&(s=!0),delete this._model.data[n.children_d[e]];s&&(this._data.core.selected=E.vakata.array_filter(this._data.core.selected,function(e){return-1===E.inArray(e,n.children_d)})),n.children=[],n.children_d=[],s&&this.trigger("changed",{action:"load_node",node:n,selected:this._data.core.selected})}return n.state.failed=!1,n.state.loading=!0,this.get_node(n,!0).addClass("jstree-loading").attr("aria-busy",!0),this._load_node(n,E.proxy(function(e){(n=this._model.data[n.id]).state.loading=!1,n.state.loaded=e,n.state.failed=!n.state.loaded;for(var t=this.get_node(n,!0),r=0,i=this._model.data,s=!1,r=0,a=n.children.length;r<a;r++)if(i[n.children[r]]&&!i[n.children[r]].state.hidden){s=!0;break}n.state.loaded&&t&&t.length&&(t.removeClass("jstree-closed jstree-open jstree-leaf"),s?"#"!==n.id&&t.addClass(n.state.opened?"jstree-open":"jstree-closed"):t.addClass("jstree-leaf")),t.removeClass("jstree-loading").attr("aria-busy",!1),this.trigger("load_node",{node:n,status:e}),o&&o.call(this,n,e)},this)),!0},_load_nodes:function(e,t,r,i){for(var s=!0,a=function(){this._load_nodes(e,t,!0)},n=this._model.data,o=[],d=0,c=e.length;d<c;d++)n[e[d]]&&(!n[e[d]].state.loaded&&!n[e[d]].state.failed||!r&&i)&&(this.is_loading(e[d])||this.load_node(e[d],a),s=!1);if(s){for(d=0,c=e.length;d<c;d++)n[e[d]]&&n[e[d]].state.loaded&&o.push(e[d]);t&&!t.done&&(t.call(this,o),t.done=!0)}},load_all:function(e,t){if(e=e||E.jstree.root,!(e=this.get_node(e)))return!1;var r,i,s=[],a=this._model.data,n=a[e.id].children_d;for(e.state&&!e.state.loaded&&s.push(e.id),r=0,i=n.length;r<i;r++)a[n[r]]&&a[n[r]].state&&!a[n[r]].state.loaded&&s.push(n[r]);s.length?this._load_nodes(s,function(){this.load_all(e,t)}):(t&&t.call(this,e),this.trigger("load_all",{node:e}))},_load_node:function(s,a){function n(){return 3!==this.nodeType&&8!==this.nodeType}var e,t=this.settings.core.data;return t?"function"==typeof t?t.call(this,s,E.proxy(function(e){!1===e?a.call(this,!1):this["string"==typeof e?"_append_html_data":"_append_json_data"](s,"string"==typeof e?E(E.parseHTML(e)).filter(n):e,function(e){a.call(this,e)})},this)):"object"==typeof t?t.url?("function"==typeof(t=E.extend(!0,{},t)).url&&(t.url=t.url.call(this,s)),"function"==typeof t.data&&(t.data=t.data.call(this,s)),E.ajax(t).done(E.proxy(function(e,t,r){var i=r.getResponseHeader("Content-Type");return i&&-1!==i.indexOf("json")||"object"==typeof e?this._append_json_data(s,e,function(e){a.call(this,e)}):i&&-1!==i.indexOf("html")||"string"==typeof e?this._append_html_data(s,E(E.parseHTML(e)).filter(n),function(e){a.call(this,e)}):(this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:s.id,xhr:r})},this.settings.core.error.call(this,this._data.core.last_error),a.call(this,!1))},this)).fail(E.proxy(function(e){this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:s.id,xhr:e})},a.call(this,!1),this.settings.core.error.call(this,this._data.core.last_error)},this))):(e=Array.isArray(t)?E.extend(!0,[],t):E.isPlainObject(t)?E.extend(!0,{},t):t,s.id===E.jstree.root?this._append_json_data(s,e,function(e){a.call(this,e)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_05",reason:"Could not load node",data:JSON.stringify({id:s.id})},this.settings.core.error.call(this,this._data.core.last_error),a.call(this,!1))):"string"==typeof t?s.id===E.jstree.root?this._append_html_data(s,E(E.parseHTML(t)).filter(n),function(e){a.call(this,e)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_06",reason:"Could not load node",data:JSON.stringify({id:s.id})},this.settings.core.error.call(this,this._data.core.last_error),a.call(this,!1)):a.call(this,!1):s.id===E.jstree.root?this._append_html_data(s,this._data.core.original_container_html.clone(!0),function(e){a.call(this,e)}):a.call(this,!1)},_node_changed:function(e){(e=this.get_node(e))&&-1===E.inArray(e.id,this._model.changed)&&this._model.changed.push(e.id)},_append_html_data:function(e,t,r){(e=this.get_node(e)).children=[],e.children_d=[];var i,s,a,n=t.is("ul")?t.children():t,o=e.id,d=[],c=[],l=this._model.data,h=l[o],_=this._data.core.selected.length;for(n.each(E.proxy(function(e,t){(i=this._parse_model_from_html(E(t),o,h.parents.concat()))&&(d.push(i),c.push(i),l[i].children_d.length&&(c=c.concat(l[i].children_d)))},this)),h.children=d,h.children_d=c,s=0,a=h.parents.length;s<a;s++)l[h.parents[s]].children_d=l[h.parents[s]].children_d.concat(c);this.trigger("model",{nodes:c,parent:o}),o!==E.jstree.root?(this._node_changed(o),this.redraw()):(this.get_container_ul().children(".jstree-initial-node").remove(),this.redraw(!0)),this._data.core.selected.length!==_&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),r.call(this,!0)},_append_json_data:function(e,t,d,r){if(null!==this.element){(e=this.get_node(e)).children=[],e.children_d=[],t.d&&"string"==typeof(t=t.d)&&(t=JSON.parse(t)),Array.isArray(t)||(t=[t]);var i=null,s={df:this._model.default_state,dat:t,par:e.id,m:this._model.data,t_id:this._id,t_cnt:this._cnt,sel:this._data.core.selected},j=this,a=function(e,c){e.data&&(e=e.data);var t,r,i,s,a=e.dat,n=e.par,o=[],d=[],l=[],h=e.df,_=e.t_id,u=e.t_cnt,g=e.m,f=g[n],p=e.sel,m=function(e,t,r){r=r?r.concat():[],t&&r.unshift(t);var i,s,a,n,o=e.id.toString(),d={id:o,text:e.text||"",icon:e.icon===c||e.icon,parent:t,parents:r,children:e.children||[],children_d:e.children_d||[],data:e.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(i in h)h.hasOwnProperty(i)&&(d.state[i]=h[i]);if(e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(d.icon=e.data.jstree.icon),d.icon!==c&&null!==d.icon&&""!==d.icon||(d.icon=!0),e&&e.data&&(d.data=e.data,e.data.jstree))for(i in e.data.jstree)e.data.jstree.hasOwnProperty(i)&&(d.state[i]=e.data.jstree[i]);if(e&&"object"==typeof e.state)for(i in e.state)e.state.hasOwnProperty(i)&&(d.state[i]=e.state[i]);if(e&&"object"==typeof e.li_attr)for(i in e.li_attr)e.li_attr.hasOwnProperty(i)&&(d.li_attr[i]=e.li_attr[i]);if(d.li_attr.id||(d.li_attr.id=o),e&&"object"==typeof e.a_attr)for(i in e.a_attr)e.a_attr.hasOwnProperty(i)&&(d.a_attr[i]=e.a_attr[i]);for(e&&e.children&&!0===e.children&&(d.state.loaded=!1,d.children=[],d.children_d=[]),i=0,s=(g[d.id]=d).children.length;i<s;i++)a=m(g[d.children[i]],d.id,r),n=g[a],d.children_d.push(a),n.children_d.length&&(d.children_d=d.children_d.concat(n.children_d));return delete e.data,delete e.children,g[d.id].original=e,d.state.selected&&l.push(d.id),d.id},v=function(e,t,r){r=r?r.concat():[],t&&r.unshift(t);for(var i,s,a,n,o,d=!1;d="j"+_+"_"+ ++u,g[d];);for(i in o={id:!1,text:"string"==typeof e?e:"",icon:"object"!=typeof e||e.icon===c||e.icon,parent:t,parents:r,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},h)h.hasOwnProperty(i)&&(o.state[i]=h[i]);if(e&&e.id&&(o.id=e.id.toString()),e&&e.text&&(o.text=e.text),e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(o.icon=e.data.jstree.icon),o.icon!==c&&null!==o.icon&&""!==o.icon||(o.icon=!0),e&&e.data&&(o.data=e.data,e.data.jstree))for(i in e.data.jstree)e.data.jstree.hasOwnProperty(i)&&(o.state[i]=e.data.jstree[i]);if(e&&"object"==typeof e.state)for(i in e.state)e.state.hasOwnProperty(i)&&(o.state[i]=e.state[i]);if(e&&"object"==typeof e.li_attr)for(i in e.li_attr)e.li_attr.hasOwnProperty(i)&&(o.li_attr[i]=e.li_attr[i]);if(o.li_attr.id&&!o.id&&(o.id=o.li_attr.id.toString()),o.id||(o.id=d),o.li_attr.id||(o.li_attr.id=o.id),e&&"object"==typeof e.a_attr)for(i in e.a_attr)e.a_attr.hasOwnProperty(i)&&(o.a_attr[i]=e.a_attr[i]);if(e&&e.children&&e.children.length){for(i=0,s=e.children.length;i<s;i++)a=v(e.children[i],o.id,r),n=g[a],o.children.push(a),n.children_d.length&&(o.children_d=o.children_d.concat(n.children_d));o.children_d=o.children_d.concat(o.children)}return e&&e.children&&!0===e.children&&(o.state.loaded=!1,o.children=[],o.children_d=[]),delete e.data,delete e.children,o.original=e,(g[o.id]=o).state.selected&&l.push(o.id),o.id};if(a.length&&a[0].id!==c&&a[0].parent!==c){for(r=0,i=a.length;r<i;r++)a[r].children||(a[r].children=[]),a[r].state||(a[r].state={}),g[a[r].id.toString()]=a[r];for(r=0,i=a.length;r<i;r++)g[a[r].parent.toString()]?(g[a[r].parent.toString()].children.push(a[r].id.toString()),f.children_d.push(a[r].id.toString())):void 0!==j&&(j._data.core.last_error={error:"parse",plugin:"core",id:"core_07",reason:"Node with invalid parent",data:JSON.stringify({id:a[r].id.toString(),parent:a[r].parent.toString()})},j.settings.core.error.call(j,j._data.core.last_error));for(r=0,i=f.children.length;r<i;r++)t=m(g[f.children[r]],n,f.parents.concat()),d.push(t),g[t].children_d.length&&(d=d.concat(g[t].children_d));for(r=0,i=f.parents.length;r<i;r++)g[f.parents[r]].children_d=g[f.parents[r]].children_d.concat(d);s={cnt:u,mod:g,sel:p,par:n,dpc:d,add:l}}else{for(r=0,i=a.length;r<i;r++)(t=v(a[r],n,f.parents.concat()))&&(o.push(t),d.push(t),g[t].children_d.length&&(d=d.concat(g[t].children_d)));for(f.children=o,f.children_d=d,r=0,i=f.parents.length;r<i;r++)g[f.parents[r]].children_d=g[f.parents[r]].children_d.concat(d);s={cnt:u,mod:g,sel:p,par:n,dpc:d,add:l}}if("undefined"!=typeof window&&void 0!==window.document)return s;postMessage(s)},n=function(e,t){if(null!==this.element){this._cnt=e.cnt;var r,i=this._model.data;for(r in i)i.hasOwnProperty(r)&&i[r].state&&i[r].state.loading&&e.mod[r]&&(e.mod[r].state.loading=!0);if(this._model.data=e.mod,t){var s,a=e.add,n=e.sel,o=this._data.core.selected.slice(),i=this._model.data;if(n.length!==o.length||E.vakata.array_unique(n.concat(o)).length!==n.length){for(r=0,s=n.length;r<s;r++)-1===E.inArray(n[r],a)&&-1===E.inArray(n[r],o)&&(i[n[r]].state.selected=!1);for(r=0,s=o.length;r<s;r++)-1===E.inArray(o[r],n)&&(i[o[r]].state.selected=!0)}}e.add.length&&(this._data.core.selected=this._data.core.selected.concat(e.add)),this.trigger("model",{nodes:e.dpc,parent:e.par}),e.par!==E.jstree.root?(this._node_changed(e.par),this.redraw()):this.redraw(!0),e.add.length&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),!t&&c?c(function(){d.call(j,!0)}):d.call(j,!0)}};if(this.settings.core.worker&&window.Blob&&window.URL&&window.Worker)try{null===this._wrk&&(this._wrk=window.URL.createObjectURL(new window.Blob(["self.onmessage = "+a.toString()],{type:"text/javascript"}))),!this._data.core.working||r?(this._data.core.working=!0,(i=new window.Worker(this._wrk)).onmessage=E.proxy(function(e){n.call(this,e.data,!0);try{i.terminate(),i=null}catch(e){}this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1},this),s.par?i.postMessage(s):this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1):this._data.core.worker_queue.push([e,t,d,!0])}catch(e){n.call(this,a(s),!1),this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1}else n.call(this,a(s),!1)}},_parse_model_from_html:function(e,t,r){r=r?[].concat(r):[],t&&r.unshift(t);var i,s,a,n,o,d=this._model.data,c={id:!1,text:!1,icon:!0,parent:t,parents:r,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(a in this._model.default_state)this._model.default_state.hasOwnProperty(a)&&(c.state[a]=this._model.default_state[a]);if(n=E.vakata.attributes(e,!0),E.each(n,function(e,t){return!(t=t.trim()).length||(c.li_attr[e]=t,void("id"===e&&(c.id=t.toString())))}),(n=e.children("a").first()).length&&(n=E.vakata.attributes(n,!0),E.each(n,function(e,t){(t=t.trim()).length&&(c.a_attr[e]=t)})),(n=e.children("a").first().length?e.children("a").first().clone():e.clone()).children("ins, i, ul").remove(),n=n.html(),n=E("<div></div>").html(n),c.text=this.settings.core.force_text?n.text():n.html(),n=e.data(),c.data=n?E.extend(!0,{},n):null,c.state.opened=e.hasClass("jstree-open"),c.state.selected=e.children("a").hasClass("jstree-clicked"),c.state.disabled=e.children("a").hasClass("jstree-disabled"),c.data&&c.data.jstree)for(a in c.data.jstree)c.data.jstree.hasOwnProperty(a)&&(c.state[a]=c.data.jstree[a]);for((n=e.children("a").children(".jstree-themeicon")).length&&(c.icon=!n.hasClass("jstree-themeicon-hidden")&&n.attr("rel")),c.state.icon!==P&&(c.icon=c.state.icon),c.icon!==P&&null!==c.icon&&""!==c.icon||(c.icon=!0),n=e.children("ul").children("li");d[o="j"+this._id+"_"+ ++this._cnt];);return c.id=c.li_attr.id?c.li_attr.id.toString():o,n.length?(n.each(E.proxy(function(e,t){i=this._parse_model_from_html(E(t),c.id,r),s=this._model.data[i],c.children.push(i),s.children_d.length&&(c.children_d=c.children_d.concat(s.children_d))},this)),c.children_d=c.children_d.concat(c.children)):e.hasClass("jstree-closed")&&(c.state.loaded=!1),c.li_attr.class&&(c.li_attr.class=c.li_attr.class.replace("jstree-closed","").replace("jstree-open","")),c.a_attr.class&&(c.a_attr.class=c.a_attr.class.replace("jstree-clicked","").replace("jstree-disabled","")),(d[c.id]=c).state.selected&&this._data.core.selected.push(c.id),c.id},_parse_model_from_flat_json:function(e,t,r){r=r?r.concat():[],t&&r.unshift(t);var i,s,a,n,o=e.id.toString(),d=this._model.data,c=this._model.default_state,l={id:o,text:e.text||"",icon:e.icon===P||e.icon,parent:t,parents:r,children:e.children||[],children_d:e.children_d||[],data:e.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(i in c)c.hasOwnProperty(i)&&(l.state[i]=c[i]);if(e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(l.icon=e.data.jstree.icon),l.icon!==P&&null!==l.icon&&""!==l.icon||(l.icon=!0),e&&e.data&&(l.data=e.data,e.data.jstree))for(i in e.data.jstree)e.data.jstree.hasOwnProperty(i)&&(l.state[i]=e.data.jstree[i]);if(e&&"object"==typeof e.state)for(i in e.state)e.state.hasOwnProperty(i)&&(l.state[i]=e.state[i]);if(e&&"object"==typeof e.li_attr)for(i in e.li_attr)e.li_attr.hasOwnProperty(i)&&(l.li_attr[i]=e.li_attr[i]);if(l.li_attr.id||(l.li_attr.id=o),e&&"object"==typeof e.a_attr)for(i in e.a_attr)e.a_attr.hasOwnProperty(i)&&(l.a_attr[i]=e.a_attr[i]);for(e&&e.children&&!0===e.children&&(l.state.loaded=!1,l.children=[],l.children_d=[]),i=0,s=(d[l.id]=l).children.length;i<s;i++)n=d[a=this._parse_model_from_flat_json(d[l.children[i]],l.id,r)],l.children_d.push(a),n.children_d.length&&(l.children_d=l.children_d.concat(n.children_d));return delete e.data,delete e.children,d[l.id].original=e,l.state.selected&&this._data.core.selected.push(l.id),l.id},_parse_model_from_json:function(e,t,r){r=r?r.concat():[],t&&r.unshift(t);for(var i,s,a,n,o,d=!1,c=this._model.data,l=this._model.default_state;c[d="j"+this._id+"_"+ ++this._cnt];);for(i in o={id:!1,text:"string"==typeof e?e:"",icon:"object"!=typeof e||e.icon===P||e.icon,parent:t,parents:r,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},l)l.hasOwnProperty(i)&&(o.state[i]=l[i]);if(e&&e.id&&(o.id=e.id.toString()),e&&e.text&&(o.text=e.text),e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(o.icon=e.data.jstree.icon),o.icon!==P&&null!==o.icon&&""!==o.icon||(o.icon=!0),e&&e.data&&(o.data=e.data,e.data.jstree))for(i in e.data.jstree)e.data.jstree.hasOwnProperty(i)&&(o.state[i]=e.data.jstree[i]);if(e&&"object"==typeof e.state)for(i in e.state)e.state.hasOwnProperty(i)&&(o.state[i]=e.state[i]);if(e&&"object"==typeof e.li_attr)for(i in e.li_attr)e.li_attr.hasOwnProperty(i)&&(o.li_attr[i]=e.li_attr[i]);if(o.li_attr.id&&!o.id&&(o.id=o.li_attr.id.toString()),o.id||(o.id=d),o.li_attr.id||(o.li_attr.id=o.id),e&&"object"==typeof e.a_attr)for(i in e.a_attr)e.a_attr.hasOwnProperty(i)&&(o.a_attr[i]=e.a_attr[i]);if(e&&e.children&&e.children.length){for(i=0,s=e.children.length;i<s;i++)n=c[a=this._parse_model_from_json(e.children[i],o.id,r)],o.children.push(a),n.children_d.length&&(o.children_d=o.children_d.concat(n.children_d));o.children_d=o.children.concat(o.children_d)}return e&&e.children&&!0===e.children&&(o.state.loaded=!1,o.children=[],o.children_d=[]),delete e.data,delete e.children,o.original=e,(c[o.id]=o).state.selected&&this._data.core.selected.push(o.id),o.id},_redraw:function(){for(var e,t=this._model.force_full_redraw?this._model.data[E.jstree.root].children.concat([]):this._model.changed.concat([]),r=y.createElement("UL"),i=this._data.core.focused,s=0,a=t.length;s<a;s++)(e=this.redraw_node(t[s],!0,this._model.force_full_redraw))&&this._model.force_full_redraw&&r.appendChild(e);this._model.force_full_redraw&&(r.className=this.get_container_ul()[0].className,r.setAttribute("role","group"),this.element.empty().append(r)),null!==i&&this.settings.core.restore_focus&&((e=this.get_node(i,!0))&&e.length&&e.children(".jstree-anchor")[0]!==y.activeElement?e.children(".jstree-anchor").focus():this._data.core.focused=null),this._model.force_full_redraw=!1,this._model.changed=[],this.trigger("redraw",{nodes:t})},redraw:function(e){e&&(this._model.force_full_redraw=!0),this._redraw()},draw_children:function(e){var t=this.get_node(e),r=!1,i=!1,s=!1,a=y;if(!t)return!1;if(t.id===E.jstree.root)return this.redraw(!0);if(!(e=this.get_node(e,!0))||!e.length)return!1;if(e.children(".jstree-children").remove(),e=e[0],t.children.length&&t.state.loaded){for((s=a.createElement("UL")).setAttribute("role","group"),s.className="jstree-children",r=0,i=t.children.length;r<i;r++)s.appendChild(this.redraw_node(t.children[r],!0,!0));e.appendChild(s)}},redraw_node:function(e,t,r,i){var s=this.get_node(e),a=!1,n=!1,o=!1,d=!1,c=!1,l=!1,h="",_=y,u=this._model.data,g=!1,f=null,p=0,m=0,v=!1,j=!1;if(!s)return!1;if(s.id===E.jstree.root)return this.redraw(!0);if(t=t||0===s.children.length,e=y.querySelector?this.element[0].querySelector("#"+(-1!=="0123456789".indexOf(s.id[0])?"\\3"+s.id[0]+" "+s.id.substr(1).replace(E.jstree.idregex,"\\$&"):s.id.replace(E.jstree.idregex,"\\$&"))):y.getElementById(s.id))e=E(e),r||((a=e.parent().parent()[0])===this.element[0]&&(a=null),n=e.index()),t||!s.children.length||e.children(".jstree-children").length||(t=!0),t||(o=e.children(".jstree-children")[0]),g=e.children(".jstree-anchor")[0]===y.activeElement,e.remove();else if(t=!0,!r){if(!(null===(a=s.parent!==E.jstree.root?E("#"+s.parent.replace(E.jstree.idregex,"\\$&"),this.element)[0]:null)||a&&u[s.parent].state.opened))return!1;n=E.inArray(s.id,null===a?u[E.jstree.root].children:u[s.parent].children)}for(d in e=this._data.core.node.cloneNode(!0),h="jstree-node ",s.li_attr)if(s.li_attr.hasOwnProperty(d)){if("id"===d)continue;"class"!==d?e.setAttribute(d,s.li_attr[d]):h+=s.li_attr[d]}for(s.a_attr.id||(s.a_attr.id=s.id+"_anchor"),e.setAttribute("aria-selected",!!s.state.selected),e.childNodes[1].setAttribute("aria-selected",!!s.state.selected),e.setAttribute("aria-level",s.parents.length),e.childNodes[1].setAttribute("aria-level",s.parents.length),e.setAttribute("aria-labelledby",s.a_attr.id),s.state.disabled&&(e.setAttribute("aria-disabled",!0),e.childNodes[1].setAttribute("aria-disabled",!0)),d=0,c=s.children.length;d<c;d++)if(!u[s.children[d]].state.hidden){v=!0;break}if(null!==s.parent&&u[s.parent]&&!s.state.hidden&&(d=E.inArray(s.id,u[s.parent].children),j=s.id,-1!==d))for(d++,c=u[s.parent].children.length;d<c&&(u[u[s.parent].children[d]].state.hidden||(j=u[s.parent].children[d]),j===s.id);d++);for(c in s.state.hidden&&(h+=" jstree-hidden"),s.state.loading&&(h+=" jstree-loading"),s.state.loaded&&!v?h+=" jstree-leaf":(h+=s.state.opened&&s.state.loaded?" jstree-open":" jstree-closed",e.setAttribute("aria-expanded",s.state.opened&&s.state.loaded),e.childNodes[1].setAttribute("aria-expanded",s.state.opened&&s.state.loaded)),j===s.id&&(h+=" jstree-last"),e.id=s.id,e.className=h,h=(s.state.selected?" jstree-clicked":"")+(s.state.disabled?" jstree-disabled":""),s.a_attr)if(s.a_attr.hasOwnProperty(c)){if("href"===c&&"#"===s.a_attr[c])continue;"class"!==c?e.childNodes[1].setAttribute(c,s.a_attr[c]):h+=" "+s.a_attr[c]}if(h.length&&(e.childNodes[1].className="jstree-anchor "+h),(s.icon&&!0!==s.icon||!1===s.icon)&&(!1===s.icon?e.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":-1===s.icon.indexOf("/")&&-1===s.icon.indexOf(".")?e.childNodes[1].childNodes[0].className+=" "+s.icon+" jstree-themeicon-custom":(e.childNodes[1].childNodes[0].style.backgroundImage='url("'+s.icon+'")',e.childNodes[1].childNodes[0].style.backgroundPosition="center center",e.childNodes[1].childNodes[0].style.backgroundSize="auto",e.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),this.settings.core.force_text?e.childNodes[1].appendChild(_.createTextNode(s.text)):e.childNodes[1].innerHTML+=s.text,t&&s.children.length&&(s.state.opened||i)&&s.state.loaded){for((l=_.createElement("UL")).setAttribute("role","group"),l.className="jstree-children",d=0,c=s.children.length;d<c;d++)l.appendChild(this.redraw_node(s.children[d],t,!0));e.appendChild(l)}if(o&&e.appendChild(o),!r){for(d=0,c=(a=a||this.element[0]).childNodes.length;d<c;d++)if(a.childNodes[d]&&a.childNodes[d].className&&-1!==a.childNodes[d].className.indexOf("jstree-children")){f=a.childNodes[d];break}f||((f=_.createElement("UL")).setAttribute("role","group"),f.className="jstree-children",a.appendChild(f)),n<(a=f).childNodes.length?a.insertBefore(e,a.childNodes[n]):a.appendChild(e),g&&(p=this.element[0].scrollTop,m=this.element[0].scrollLeft,e.childNodes[1].focus(),this.element[0].scrollTop=p,this.element[0].scrollLeft=m)}return s.state.opened&&!s.state.loaded&&(s.state.opened=!1,setTimeout(E.proxy(function(){this.open_node(s.id,!1,0)},this),0)),e},open_node:function(e,r,i){var t,s,a,n;if(Array.isArray(e)){for(t=0,s=(e=e.slice()).length;t<s;t++)this.open_node(e[t],r,i);return!0}return!(!(e=this.get_node(e))||e.id===E.jstree.root)&&(i=i===P?this.settings.core.animation:i,this.is_closed(e)?this.is_loaded(e)?(a=this.get_node(e,!0),n=this,a.length&&(i&&a.children(".jstree-children").length&&a.children(".jstree-children").stop(!0,!0),e.children.length&&!this._firstChild(a.children(".jstree-children")[0])&&this.draw_children(e),i?(this.trigger("before_open",{node:e}),a.children(".jstree-children").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",!0).children(".jstree-anchor").attr("aria-expanded",!0).end().children(".jstree-children").stop(!0,!0).slideDown(i,function(){this.style.display="",n.element&&n.trigger("after_open",{node:e})})):(this.trigger("before_open",{node:e}),a[0].className=a[0].className.replace("jstree-closed","jstree-open"),a[0].setAttribute("aria-expanded",!0),a[0].childNodes[1].setAttribute("aria-expanded",!0))),e.state.opened=!0,r&&r.call(this,e,!0),a.length||this.trigger("before_open",{node:e}),this.trigger("open_node",{node:e}),i&&a.length||this.trigger("after_open",{node:e}),!0):this.is_loading(e)?setTimeout(E.proxy(function(){this.open_node(e,r,i)},this),500):void this.load_node(e,function(e,t){return t?this.open_node(e,r,i):!!r&&r.call(this,e,!1)}):(r&&r.call(this,e,!1),!1))},_open_to:function(e){if(!(e=this.get_node(e))||e.id===E.jstree.root)return!1;for(var t=e.parents,r=0,i=t.length;r<i;r+=1)r!==E.jstree.root&&this.open_node(t[r],!1,0);return E("#"+e.id.replace(E.jstree.idregex,"\\$&"),this.element)},close_node:function(e,t){var r,i,s,a;if(Array.isArray(e)){for(r=0,i=(e=e.slice()).length;r<i;r++)this.close_node(e[r],t);return!0}return!(!(e=this.get_node(e))||e.id===E.jstree.root)&&(!this.is_closed(e)&&(t=t===P?this.settings.core.animation:t,a=(s=this).get_node(e,!0),e.state.opened=!1,this.trigger("close_node",{node:e}),void(a.length?t?a.children(".jstree-children").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",!1).children(".jstree-anchor").attr("aria-expanded",!1).end().children(".jstree-children").stop(!0,!0).slideUp(t,function(){this.style.display="",a.children(".jstree-children").remove(),s.element&&s.trigger("after_close",{node:e})}):(a[0].className=a[0].className.replace("jstree-open","jstree-closed"),a.children(".jstree-anchor").attr("aria-expanded",!1),a.attr("aria-expanded",!1).children(".jstree-children").remove(),this.trigger("after_close",{node:e})):this.trigger("after_close",{node:e}))))},toggle_node:function(e){var t,r;if(Array.isArray(e)){for(t=0,r=(e=e.slice()).length;t<r;t++)this.toggle_node(e[t]);return!0}return this.is_closed(e)?this.open_node(e):this.is_open(e)?this.close_node(e):void 0},open_all:function(e,r,i){if(e=e||E.jstree.root,!(e=this.get_node(e)))return!1;var t,s,a,n=e.id===E.jstree.root?this.get_container_ul():this.get_node(e,!0);if(!n.length){for(t=0,s=e.children_d.length;t<s;t++)this.is_closed(this._model.data[e.children_d[t]])&&(this._model.data[e.children_d[t]].state.opened=!0);return this.trigger("open_all",{node:e})}i=i||n,(n=(a=this).is_closed(e)?n.find(".jstree-closed").addBack():n.find(".jstree-closed")).each(function(){a.open_node(this,function(e,t){t&&this.is_parent(e)&&this.open_all(e,r,i)},r||0)}),0===i.find(".jstree-closed").length&&this.trigger("open_all",{node:this.get_node(i)})},close_all:function(e,t){if(e=e||E.jstree.root,!(e=this.get_node(e)))return!1;var r,i,s=e.id===E.jstree.root?this.get_container_ul():this.get_node(e,!0),a=this;for(s.length&&(s=this.is_open(e)?s.find(".jstree-open").addBack():s.find(".jstree-open"),E(s.get().reverse()).each(function(){a.close_node(this,t||0)})),r=0,i=e.children_d.length;r<i;r++)this._model.data[e.children_d[r]].state.opened=!1;this.trigger("close_all",{node:e})},is_disabled:function(e){return(e=this.get_node(e))&&e.state&&e.state.disabled},enable_node:function(e){var t,r;if(Array.isArray(e)){for(t=0,r=(e=e.slice()).length;t<r;t++)this.enable_node(e[t]);return!0}if(!(e=this.get_node(e))||e.id===E.jstree.root)return!1;e.state.disabled=!1,this.get_node(e,!0).children(".jstree-anchor").removeClass("jstree-disabled").attr("aria-disabled",!1),this.trigger("enable_node",{node:e})},disable_node:function(e){var t,r;if(Array.isArray(e)){for(t=0,r=(e=e.slice()).length;t<r;t++)this.disable_node(e[t]);return!0}if(!(e=this.get_node(e))||e.id===E.jstree.root)return!1;e.state.disabled=!0,this.get_node(e,!0).children(".jstree-anchor").addClass("jstree-disabled").attr("aria-disabled",!0),this.trigger("disable_node",{node:e})},is_hidden:function(e){return!0===(e=this.get_node(e)).state.hidden},hide_node:function(e,t){var r,i;if(Array.isArray(e)){for(r=0,i=(e=e.slice()).length;r<i;r++)this.hide_node(e[r],!0);return t||this.redraw(),!0}if(!(e=this.get_node(e))||e.id===E.jstree.root)return!1;e.state.hidden||(e.state.hidden=!0,this._node_changed(e.parent),t||this.redraw(),this.trigger("hide_node",{node:e}))},show_node:function(e,t){var r,i;if(Array.isArray(e)){for(r=0,i=(e=e.slice()).length;r<i;r++)this.show_node(e[r],!0);return t||this.redraw(),!0}if(!(e=this.get_node(e))||e.id===E.jstree.root)return!1;e.state.hidden&&(e.state.hidden=!1,this._node_changed(e.parent),t||this.redraw(),this.trigger("show_node",{node:e}))},hide_all:function(e){var t,r=this._model.data,i=[];for(t in r)r.hasOwnProperty(t)&&t!==E.jstree.root&&!r[t].state.hidden&&(r[t].state.hidden=!0,i.push(t));return this._model.force_full_redraw=!0,e||this.redraw(),this.trigger("hide_all",{nodes:i}),i},show_all:function(e){var t,r=this._model.data,i=[];for(t in r)r.hasOwnProperty(t)&&t!==E.jstree.root&&r[t].state.hidden&&(r[t].state.hidden=!1,i.push(t));return this._model.force_full_redraw=!0,e||this.redraw(),this.trigger("show_all",{nodes:i}),i},activate_node:function(e,t){if(this.is_disabled(e))return!1;if(t&&"object"==typeof t||(t={}),this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==P?this.get_node(this._data.core.last_clicked.id):null,this._data.core.last_clicked&&!this._data.core.last_clicked.state.selected&&(this._data.core.last_clicked=null),!this._data.core.last_clicked&&this._data.core.selected.length&&(this._data.core.last_clicked=this.get_node(this._data.core.selected[this._data.core.selected.length-1])),this.settings.core.multiple&&(t.metaKey||t.ctrlKey||t.shiftKey)&&(!t.shiftKey||this._data.core.last_clicked&&this.get_parent(e)&&this.get_parent(e)===this._data.core.last_clicked.parent))if(t.shiftKey){for(var r=this.get_node(e).id,i=this._data.core.last_clicked.id,s=this.get_node(this._data.core.last_clicked.parent).children,a=!1,n=0,o=s.length;n<o;n+=1)s[n]===r&&(a=!a),s[n]===i&&(a=!a),this.is_disabled(s[n])||!a&&s[n]!==r&&s[n]!==i?this.deselect_node(s[n],!0,t):this.is_hidden(s[n])||this.select_node(s[n],!0,!1,t);this.trigger("changed",{action:"select_node",node:this.get_node(e),selected:this._data.core.selected,event:t})}else this.is_selected(e)?this.deselect_node(e,!1,t):this.select_node(e,!1,!1,t);else!this.settings.core.multiple&&(t.metaKey||t.ctrlKey||t.shiftKey)&&this.is_selected(e)?this.deselect_node(e,!1,t):(this.deselect_all(!0),this.select_node(e,!1,!1,t),this._data.core.last_clicked=this.get_node(e));this.trigger("activate_node",{node:this.get_node(e),event:t})},hover_node:function(e){if(!(e=this.get_node(e,!0))||!e.length||e.children(".jstree-hovered").length)return!1;var t=this.element.find(".jstree-hovered"),r=this.element;t&&t.length&&this.dehover_node(t),e.children(".jstree-anchor").addClass("jstree-hovered"),this.trigger("hover_node",{node:this.get_node(e)}),setTimeout(function(){r.attr("aria-activedescendant",e[0].id)},0)},dehover_node:function(e){if(!(e=this.get_node(e,!0))||!e.length||!e.children(".jstree-hovered").length)return!1;e.children(".jstree-anchor").removeClass("jstree-hovered"),this.trigger("dehover_node",{node:this.get_node(e)})},select_node:function(e,t,r,i){var s,a,n;if(Array.isArray(e)){for(a=0,n=(e=e.slice()).length;a<n;a++)this.select_node(e[a],t,r,i);return!0}if(!(e=this.get_node(e))||e.id===E.jstree.root)return!1;s=this.get_node(e,!0),e.state.selected||(e.state.selected=!0,this._data.core.selected.push(e.id),r||(s=this._open_to(e)),s&&s.length&&s.attr("aria-selected",!0).children(".jstree-anchor").addClass("jstree-clicked").attr("aria-selected",!0),this.trigger("select_node",{node:e,selected:this._data.core.selected,event:i}),t||this.trigger("changed",{action:"select_node",node:e,selected:this._data.core.selected,event:i}))},deselect_node:function(e,t,r){var i,s,a;if(Array.isArray(e)){for(i=0,s=(e=e.slice()).length;i<s;i++)this.deselect_node(e[i],t,r);return!0}if(!(e=this.get_node(e))||e.id===E.jstree.root)return!1;a=this.get_node(e,!0),e.state.selected&&(e.state.selected=!1,this._data.core.selected=E.vakata.array_remove_item(this._data.core.selected,e.id),a.length&&a.attr("aria-selected",!1).children(".jstree-anchor").removeClass("jstree-clicked").attr("aria-selected",!1),this.trigger("deselect_node",{node:e,selected:this._data.core.selected,event:r}),t||this.trigger("changed",{action:"deselect_node",node:e,selected:this._data.core.selected,event:r}))},select_all:function(e){var t,r,i=this._data.core.selected.concat([]);for(this._data.core.selected=this._model.data[E.jstree.root].children_d.concat(),t=0,r=this._data.core.selected.length;t<r;t++)this._model.data[this._data.core.selected[t]]&&(this._model.data[this._data.core.selected[t]].state.selected=!0);this.redraw(!0),this.trigger("select_all",{selected:this._data.core.selected}),e||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:i})},deselect_all:function(e){for(var t=this._data.core.selected.concat([]),r=0,i=this._data.core.selected.length;r<i;r++)this._model.data[this._data.core.selected[r]]&&(this._model.data[this._data.core.selected[r]].state.selected=!1);this._data.core.selected=[],this.element.find(".jstree-clicked").removeClass("jstree-clicked").attr("aria-selected",!1).parent().attr("aria-selected",!1),this.trigger("deselect_all",{selected:this._data.core.selected,node:t}),e||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:t})},is_selected:function(e){return!(!(e=this.get_node(e))||e.id===E.jstree.root)&&e.state.selected},get_selected:function(e){return e?E.map(this._data.core.selected,E.proxy(function(e){return this.get_node(e)},this)):this._data.core.selected.slice()},get_top_selected:function(e){for(var t,r,i=this.get_selected(!0),s={},a=0,n=i.length;a<n;a++)s[i[a].id]=i[a];for(a=0,n=i.length;a<n;a++)for(t=0,r=i[a].children_d.length;t<r;t++)s[i[a].children_d[t]]&&delete s[i[a].children_d[t]];for(a in i=[],s)s.hasOwnProperty(a)&&i.push(a);return e?E.map(i,E.proxy(function(e){return this.get_node(e)},this)):i},get_bottom_selected:function(e){for(var t=this.get_selected(!0),r=[],i=0,s=t.length;i<s;i++)t[i].children.length||r.push(t[i].id);return e?E.map(r,E.proxy(function(e){return this.get_node(e)},this)):r},get_state:function(){var e,t={core:{open:[],loaded:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},selected:[]}};for(e in this._model.data)this._model.data.hasOwnProperty(e)&&e!==E.jstree.root&&(this._model.data[e].state.loaded&&this.settings.core.loaded_state&&t.core.loaded.push(e),this._model.data[e].state.opened&&t.core.open.push(e),this._model.data[e].state.selected&&t.core.selected.push(e));return t},set_state:function(t,r){if(t){if(t.core&&t.core.selected&&t.core.initial_selection===P&&(t.core.initial_selection=this._data.core.selected.concat([]).sort().join(",")),t.core){var i,e;if(t.core.loaded)return this.settings.core.loaded_state&&Array.isArray(t.core.loaded)&&t.core.loaded.length?this._load_nodes(t.core.loaded,function(e){delete t.core.loaded,this.set_state(t,r)}):(delete t.core.loaded,this.set_state(t,r)),!1;if(t.core.open)return Array.isArray(t.core.open)&&t.core.open.length?this._load_nodes(t.core.open,function(e){this.open_node(e,!1,0),delete t.core.open,this.set_state(t,r)}):(delete t.core.open,this.set_state(t,r)),!1;if(t.core.scroll)return t.core.scroll&&t.core.scroll.left!==P&&this.element.scrollLeft(t.core.scroll.left),t.core.scroll&&t.core.scroll.top!==P&&this.element.scrollTop(t.core.scroll.top),delete t.core.scroll,this.set_state(t,r),!1;if(t.core.selected)return i=this,t.core.initial_selection!==P&&t.core.initial_selection!==this._data.core.selected.concat([]).sort().join(",")||(this.deselect_all(),E.each(t.core.selected,function(e,t){i.select_node(t,!1,!0)})),delete t.core.initial_selection,delete t.core.selected,this.set_state(t,r),!1;for(e in t)t.hasOwnProperty(e)&&"core"!==e&&-1===E.inArray(e,this.settings.plugins)&&delete t[e];if(E.isEmptyObject(t.core))return delete t.core,this.set_state(t,r),!1}return E.isEmptyObject(t)?(t=null,r&&r.call(this),this.trigger("set_state"),!1):!0}return!1},refresh:function(e,t){this._data.core.state=!0===t?{}:this.get_state(),t&&"function"==typeof t&&(this._data.core.state=t.call(this,this._data.core.state)),this._cnt=0,this._model.data={},this._model.data[E.jstree.root]={id:E.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}},this._data.core.selected=[],this._data.core.last_clicked=null,this._data.core.focused=null;var r=this.get_container_ul()[0].className;e||(this.element.html("<ul class='"+r+"' role='group'><li class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='presentation' id='j"+this._id+"_loading'><i class='jstree-icon jstree-ocl'></i><a class='jstree-anchor' role='treeitem' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>"+this.get_string("Loading ...")+"</a></li></ul>"),this.element.attr("aria-activedescendant","j"+this._id+"_loading")),this.load_node(E.jstree.root,function(e,t){t&&(this.get_container_ul()[0].className=r,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.set_state(E.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")})),this._data.core.state=null})},refresh_node:function(t){if(!(t=this.get_node(t))||t.id===E.jstree.root)return!1;var r=[],e=[],i=this._data.core.selected.concat([]);e.push(t.id),!0===t.state.opened&&r.push(t.id),this.get_node(t,!0).find(".jstree-open").each(function(){e.push(this.id),r.push(this.id)}),this._load_nodes(e,E.proxy(function(e){this.open_node(r,!1,0),this.select_node(i),this.trigger("refresh_node",{node:t,nodes:e})},this),!1,!0)},set_id:function(e,t){if(!(e=this.get_node(e))||e.id===E.jstree.root)return!1;var r,i,s=this._model.data,a=e.id;for(t=t.toString(),s[e.parent].children[E.inArray(e.id,s[e.parent].children)]=t,r=0,i=e.parents.length;r<i;r++)s[e.parents[r]].children_d[E.inArray(e.id,s[e.parents[r]].children_d)]=t;for(r=0,i=e.children.length;r<i;r++)s[e.children[r]].parent=t;for(r=0,i=e.children_d.length;r<i;r++)s[e.children_d[r]].parents[E.inArray(e.id,s[e.children_d[r]].parents)]=t;return-1!==(r=E.inArray(e.id,this._data.core.selected))&&(this._data.core.selected[r]=t),(r=this.get_node(e.id,!0))&&(r.attr("id",t),this.element.attr("aria-activedescendant")===e.id&&this.element.attr("aria-activedescendant",t)),delete s[e.id],e.id=t,s[e.li_attr.id=t]=e,this.trigger("set_id",{node:e,new:e.id,old:a}),!0},get_text:function(e){return!(!(e=this.get_node(e))||e.id===E.jstree.root)&&e.text},set_text:function(e,t){var r,i;if(Array.isArray(e)){for(r=0,i=(e=e.slice()).length;r<i;r++)this.set_text(e[r],t);return!0}return!(!(e=this.get_node(e))||e.id===E.jstree.root)&&(e.text=t,this.get_node(e,!0).length&&this.redraw_node(e.id),this.trigger("set_text",{obj:e,text:t}),!0)},get_json:function(e,t,r){if(!(e=this.get_node(e||E.jstree.root)))return!1;t&&t.flat&&!r&&(r=[]);var i,s,a={id:e.id,text:e.text,icon:this.get_icon(e),li_attr:E.extend(!0,{},e.li_attr),a_attr:E.extend(!0,{},e.a_attr),state:{},data:(!t||!t.no_data)&&E.extend(!0,Array.isArray(e.data)?[]:{},e.data)};if(t&&t.flat?a.parent=e.parent:a.children=[],t&&t.no_state)delete a.state;else for(i in e.state)e.state.hasOwnProperty(i)&&(a.state[i]=e.state[i]);if(t&&t.no_li_attr&&delete a.li_attr,t&&t.no_a_attr&&delete a.a_attr,t&&t.no_id&&(delete a.id,a.li_attr&&a.li_attr.id&&delete a.li_attr.id,a.a_attr&&a.a_attr.id&&delete a.a_attr.id),t&&t.flat&&e.id!==E.jstree.root&&r.push(a),!t||!t.no_children)for(i=0,s=e.children.length;i<s;i++)t&&t.flat?this.get_json(e.children[i],t,r):a.children.push(this.get_json(e.children[i],t));return t&&t.flat?r:e.id===E.jstree.root?a.children:a},create_node:function(e,t,r,i,s){if(null===e&&(e=E.jstree.root),!(e=this.get_node(e)))return!1;if(!(r=r===P?"last":r).toString().match(/^(before|after)$/)&&!s&&!this.is_loaded(e))return this.load_node(e,function(){this.create_node(e,t,r,i,!0)});var a,n,o,d;switch((t="string"==typeof(t=t||{text:this.get_string("New node")})?{text:t}:E.extend(!0,{},t)).text===P&&(t.text=this.get_string("New node")),e.id===E.jstree.root&&("before"===r&&(r="first"),"after"===r&&(r="last")),r){case"before":a=this.get_node(e.parent),r=E.inArray(e.id,a.children),e=a;break;case"after":a=this.get_node(e.parent),r=E.inArray(e.id,a.children)+1,e=a;break;case"inside":case"first":r=0;break;case"last":r=e.children.length;break;default:r=r||0}if(r>e.children.length&&(r=e.children.length),t.id||(t.id=!0),!this.check("create_node",t,e,r))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(!0===t.id&&delete t.id,!(t=this._parse_model_from_json(t,e.id,e.parents.concat())))return!1;for(a=this.get_node(t),(n=[]).push(t),n=n.concat(a.children_d),this.trigger("model",{nodes:n,parent:e.id}),e.children_d=e.children_d.concat(n),o=0,d=e.parents.length;o<d;o++)this._model.data[e.parents[o]].children_d=this._model.data[e.parents[o]].children_d.concat(n);for(t=a,a=[],o=0,d=e.children.length;o<d;o++)a[r<=o?o+1:o]=e.children[o];return a[r]=t.id,e.children=a,this.redraw_node(e,!0),this.trigger("create_node",{node:this.get_node(t),parent:e.id,position:r}),i&&i.call(this,this.get_node(t)),t.id},rename_node:function(e,t){var r,i,s;if(Array.isArray(e)){for(r=0,i=(e=e.slice()).length;r<i;r++)this.rename_node(e[r],t);return!0}return!(!(e=this.get_node(e))||e.id===E.jstree.root)&&(s=e.text,this.check("rename_node",e,this.get_parent(e),t)?(this.set_text(e,t),this.trigger("rename_node",{node:e,text:t,old:s}),!0):(this.settings.core.error.call(this,this._data.core.last_error),!1))},delete_node:function(e){var t,r,i,s,a,n,o,d,c,l,h,_;if(Array.isArray(e)){for(t=0,r=(e=e.slice()).length;t<r;t++)this.delete_node(e[t]);return!0}if(!(e=this.get_node(e))||e.id===E.jstree.root)return!1;if(i=this.get_node(e.parent),s=E.inArray(e.id,i.children),l=!1,!this.check("delete_node",e,i,s))return this.settings.core.error.call(this,this._data.core.last_error),!1;for(-1!==s&&(i.children=E.vakata.array_remove(i.children,s)),(a=e.children_d.concat([])).push(e.id),n=0,o=e.parents.length;n<o;n++)this._model.data[e.parents[n]].children_d=E.vakata.array_filter(this._model.data[e.parents[n]].children_d,function(e){return-1===E.inArray(e,a)});for(d=0,c=a.length;d<c;d++)if(this._model.data[a[d]].state.selected){l=!0;break}for(l&&(this._data.core.selected=E.vakata.array_filter(this._data.core.selected,function(e){return-1===E.inArray(e,a)})),this.trigger("delete_node",{node:e,parent:i.id}),l&&this.trigger("changed",{action:"delete_node",node:e,selected:this._data.core.selected,parent:i.id}),d=0,c=a.length;d<c;d++)delete this._model.data[a[d]];return-1!==E.inArray(this._data.core.focused,a)&&(this._data.core.focused=null,h=this.element[0].scrollTop,_=this.element[0].scrollLeft,i.id===E.jstree.root?this._model.data[E.jstree.root].children[0]&&this.get_node(this._model.data[E.jstree.root].children[0],!0).children(".jstree-anchor").focus():this.get_node(i,!0).children(".jstree-anchor").focus(),this.element[0].scrollTop=h,this.element[0].scrollLeft=_),this.redraw_node(i,!0),!0},check:function(e,t,r,i,s){t=t&&t.id?t:this.get_node(t),r=r&&r.id?r:this.get_node(r);var a=e.match(/^move_node|copy_node|create_node$/i)?r:t,n=this.settings.core.check_callback;if("move_node"===e||"copy_node"===e){if(!(s&&s.is_multi||"move_node"!==e||E.inArray(t.id,r.children)!==i))return!(this._data.core.last_error={error:"check",plugin:"core",id:"core_08",reason:"Moving node to its current position",data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!r||!r.id)&&r.id})});if(!(s&&s.is_multi||t.id!==r.id&&("move_node"!==e||E.inArray(t.id,r.children)!==i)&&-1===E.inArray(r.id,t.children_d)))return!(this._data.core.last_error={error:"check",plugin:"core",id:"core_01",reason:"Moving parent inside child",data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!r||!r.id)&&r.id})})}return a&&a.data&&(a=a.data),a&&a.functions&&(!1===a.functions[e]||!0===a.functions[e])?(!1===a.functions[e]&&(this._data.core.last_error={error:"check",plugin:"core",id:"core_02",reason:"Node data prevents function: "+e,data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!r||!r.id)&&r.id})}),a.functions[e]):!(!1===n||"function"==typeof n&&!1===n.call(this,e,t,r,i,s)||n&&!1===n[e])||!(this._data.core.last_error={error:"check",plugin:"core",id:"core_03",reason:"User config for core.check_callback prevents function: "+e,data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!r||!r.id)&&r.id})})},last_error:function(){return this._data.core.last_error},move_node:function(e,t,r,i,s,a,n){var o,d,c,l,h,_,u,g,f,p,m,v,j,y;if(t=this.get_node(t),r=r===P?0:r,!t)return!1;if(!r.toString().match(/^(before|after)$/)&&!s&&!this.is_loaded(t))return this.load_node(t,function(){this.move_node(e,t,r,i,!0,!1,n)});if(Array.isArray(e)){if(1!==e.length){for(o=0,d=e.length;o<d;o++)(f=this.move_node(e[o],t,r,i,s,!1,n))&&(t=f,r="after");return this.redraw(),!0}e=e[0]}if(!(e=e&&e.id?e:this.get_node(e))||e.id===E.jstree.root)return!1;if(c=(e.parent||E.jstree.root).toString(),h=r.toString().match(/^(before|after)$/)&&t.id!==E.jstree.root?this.get_node(t.parent):t,u=!(_=n||(this._model.data[e.id]?this:E.jstree.reference(e.id)))||!_._id||this._id!==_._id,l=_&&_._id&&c&&_._model.data[c]&&_._model.data[c].children?E.inArray(e.id,_._model.data[c].children):-1,_&&_._id&&(e=_._model.data[e.id]),u)return!!(f=this.copy_node(e,t,r,i,s,!1,n))&&(_&&_.delete_node(e),f);switch(t.id===E.jstree.root&&("before"===r&&(r="first"),"after"===r&&(r="last")),r){case"before":r=E.inArray(t.id,h.children);break;case"after":r=E.inArray(t.id,h.children)+1;break;case"inside":case"first":r=0;break;case"last":r=h.children.length;break;default:r=r||0}if(r>h.children.length&&(r=h.children.length),!this.check("move_node",e,h,r,{core:!0,origin:n,is_multi:_&&_._id&&_._id!==this._id,is_foreign:!_||!_._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(e.parent===h.id){for(g=h.children.concat(),-1!==(f=E.inArray(e.id,g))&&(g=E.vakata.array_remove(g,f),f<r&&r--),f=[],p=0,m=g.length;p<m;p++)f[r<=p?p+1:p]=g[p];f[r]=e.id,h.children=f,this._node_changed(h.id),this.redraw(h.id===E.jstree.root)}else{for((f=e.children_d.concat()).push(e.id),p=0,m=e.parents.length;p<m;p++){for(g=[],v=0,j=(y=_._model.data[e.parents[p]].children_d).length;v<j;v++)-1===E.inArray(y[v],f)&&g.push(y[v]);_._model.data[e.parents[p]].children_d=g}for(_._model.data[c].children=E.vakata.array_remove_item(_._model.data[c].children,e.id),p=0,m=h.parents.length;p<m;p++)this._model.data[h.parents[p]].children_d=this._model.data[h.parents[p]].children_d.concat(f);for(g=[],p=0,m=h.children.length;p<m;p++)g[r<=p?p+1:p]=h.children[p];for(g[r]=e.id,h.children=g,h.children_d.push(e.id),h.children_d=h.children_d.concat(e.children_d),e.parent=h.id,(f=h.parents.concat()).unshift(h.id),y=e.parents.length,f=(e.parents=f).concat(),p=0,m=e.children_d.length;p<m;p++)this._model.data[e.children_d[p]].parents=this._model.data[e.children_d[p]].parents.slice(0,-1*y),Array.prototype.push.apply(this._model.data[e.children_d[p]].parents,f);c!==E.jstree.root&&h.id!==E.jstree.root||(this._model.force_full_redraw=!0),this._model.force_full_redraw||(this._node_changed(c),this._node_changed(h.id)),a||this.redraw()}return i&&i.call(this,e,h,r),this.trigger("move_node",{node:e,parent:h.id,position:r,old_parent:c,old_position:l,is_multi:_&&_._id&&_._id!==this._id,is_foreign:!_||!_._id,old_instance:_,new_instance:this}),e.id},copy_node:function(e,t,r,i,s,a,n){var o,d,c,l,h,_,u,g,f,p;if(t=this.get_node(t),r=r===P?0:r,!t)return!1;if(!r.toString().match(/^(before|after)$/)&&!s&&!this.is_loaded(t))return this.load_node(t,function(){this.copy_node(e,t,r,i,!0,!1,n)});if(Array.isArray(e)){if(1!==e.length){for(o=0,d=e.length;o<d;o++)(l=this.copy_node(e[o],t,r,i,s,!0,n))&&(t=l,r="after");return this.redraw(),!0}e=e[0]}if(!(e=e&&e.id?e:this.get_node(e))||e.id===E.jstree.root)return!1;switch(g=(e.parent||E.jstree.root).toString(),f=r.toString().match(/^(before|after)$/)&&t.id!==E.jstree.root?this.get_node(t.parent):t,(p=n||(this._model.data[e.id]?this:E.jstree.reference(e.id)))&&p._id&&(this._id,p._id),p&&p._id&&(e=p._model.data[e.id]),t.id===E.jstree.root&&("before"===r&&(r="first"),"after"===r&&(r="last")),r){case"before":r=E.inArray(t.id,f.children);break;case"after":r=E.inArray(t.id,f.children)+1;break;case"inside":case"first":r=0;break;case"last":r=f.children.length;break;default:r=r||0}if(r>f.children.length&&(r=f.children.length),!this.check("copy_node",e,f,r,{core:!0,origin:n,is_multi:p&&p._id&&p._id!==this._id,is_foreign:!p||!p._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(!(u=p?p.get_json(e,{no_id:!0,no_data:!0,no_state:!0}):e))return!1;if(!0===u.id&&delete u.id,!(u=this._parse_model_from_json(u,f.id,f.parents.concat())))return!1;for(l=this.get_node(u),e&&e.state&&!1===e.state.loaded&&(l.state.loaded=!1),(c=[]).push(u),c=c.concat(l.children_d),this.trigger("model",{nodes:c,parent:f.id}),h=0,_=f.parents.length;h<_;h++)this._model.data[f.parents[h]].children_d=this._model.data[f.parents[h]].children_d.concat(c);for(c=[],h=0,_=f.children.length;h<_;h++)c[r<=h?h+1:h]=f.children[h];return c[r]=l.id,f.children=c,f.children_d.push(l.id),f.children_d=f.children_d.concat(l.children_d),f.id===E.jstree.root&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||this._node_changed(f.id),a||this.redraw(f.id===E.jstree.root),i&&i.call(this,l,f,r),this.trigger("copy_node",{node:l,original:e,parent:f.id,position:r,old_parent:g,old_position:p&&p._id&&g&&p._model.data[g]&&p._model.data[g].children?E.inArray(e.id,p._model.data[g].children):-1,is_multi:p&&p._id&&p._id!==this._id,is_foreign:!p||!p._id,old_instance:p,new_instance:this}),l.id},cut:function(e){if(e=e||this._data.core.selected.concat(),Array.isArray(e)||(e=[e]),!e.length)return!1;for(var t,r=[],i=0,s=e.length;i<s;i++)(t=this.get_node(e[i]))&&t.id&&t.id!==E.jstree.root&&r.push(t);if(!r.length)return!1;a=r,n="move_node",(o=this).trigger("cut",{node:e})},copy:function(e){if(e=e||this._data.core.selected.concat(),Array.isArray(e)||(e=[e]),!e.length)return!1;for(var t,r=[],i=0,s=e.length;i<s;i++)(t=this.get_node(e[i]))&&t.id&&t.id!==E.jstree.root&&r.push(t);if(!r.length)return!1;a=r,n="copy_node",(o=this).trigger("copy",{node:e})},get_buffer:function(){return{mode:n,node:a,inst:o}},can_paste:function(){return!1!==n&&!1!==a},paste:function(e,t){if(!((e=this.get_node(e))&&n&&n.match(/^(copy_node|move_node)$/)&&a))return!1;this[n](a,e,t,!1,!1,!1,o)&&this.trigger("paste",{parent:e.id,node:a,mode:n}),o=n=a=!1},clear_buffer:function(){o=n=a=!1,this.trigger("clear_buffer")},edit:function(s,e,a){var t,r,n,o,d,c,l,i,h,_=!1;return!!(s=this.get_node(s))&&(this.check("edit",s,this.get_parent(s))?(h=s,e="string"==typeof e?e:s.text,this.set_text(s,""),s=this._open_to(s),h.text=e,t=this._data.core.rtl,r=this.element.width(),this._data.core.focused=h.id,n=s.children(".jstree-anchor").focus(),o=E("<span></span>"),d=e,c=E("<div></div>",{css:{position:"absolute",top:"-200px",left:t?"0px":"-1000px",visibility:"hidden"}}).appendTo(y.body),l=E("<input />",{value:d,class:"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:E.proxy(function(e){e.stopImmediatePropagation(),e.preventDefault();var t,r=o.children(".jstree-rename-input").val(),i=this.settings.core.force_text;""===r&&(r=d),c.remove(),o.replaceWith(n),o.remove(),d=i?d:E("<div></div>").append(E.parseHTML(d)).html(),s=this.get_node(s),this.set_text(s,d),(t=!!this.rename_node(s,i?E("<div></div>").text(r).text():E("<div></div>").append(E.parseHTML(r)).html()))||this.set_text(s,d),this._data.core.focused=h.id,setTimeout(E.proxy(function(){var e=this.get_node(h.id,!0);e.length&&(this._data.core.focused=h.id,e.children(".jstree-anchor").focus())},this),0),a&&a.call(this,h,t,_),l=null},this),keydown:function(e){var t=e.which;27===t&&(_=!0,this.value=d),27!==t&&13!==t&&37!==t&&38!==t&&39!==t&&40!==t&&32!==t||e.stopImmediatePropagation(),27!==t&&13!==t||(e.preventDefault(),this.blur())},click:function(e){e.stopImmediatePropagation()},mousedown:function(e){e.stopImmediatePropagation()},keyup:function(e){l.width(Math.min(c.text("pW"+this.value).width(),r))},keypress:function(e){if(13===e.which)return!1}}),i={fontFamily:n.css("fontFamily")||"",fontSize:n.css("fontSize")||"",fontWeight:n.css("fontWeight")||"",fontStyle:n.css("fontStyle")||"",fontStretch:n.css("fontStretch")||"",fontVariant:n.css("fontVariant")||"",letterSpacing:n.css("letterSpacing")||"",wordSpacing:n.css("wordSpacing")||""},o.attr("class",n.attr("class")).append(n.contents().clone()).append(l),n.replaceWith(o),c.css(i),l.css(i).width(Math.min(c.text("pW"+l[0].value).width(),r))[0].select(),void E(y).one("mousedown.jstree touchstart.jstree dnd_start.vakata",function(e){l&&e.target!==l&&E(l).trigger("blur")})):(this.settings.core.error.call(this,this._data.core.last_error),!1))},set_theme:function(e,t){if(!e)return!1;!0===t&&(t=(this.settings.core.themes.dir||E.jstree.path+"/themes")+"/"+e+"/style.css"),t&&-1===E.inArray(t,r)&&(E("head").append('<link rel="stylesheet" href="'+t+'" type="text/css" />'),r.push(t)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=e,this.element.addClass("jstree-"+e),this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+e+"-responsive"),this.trigger("set_theme",{theme:e})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(e){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant),(this._data.core.themes.variant=e)&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0,this.get_container_ul().addClass("jstree-striped"),this.trigger("show_stripes")},hide_stripes:function(){this._data.core.themes.stripes=!1,this.get_container_ul().removeClass("jstree-striped"),this.trigger("hide_stripes")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0,this.get_container_ul().removeClass("jstree-no-dots"),this.trigger("show_dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.get_container_ul().addClass("jstree-no-dots"),this.trigger("hide_dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.get_container_ul().removeClass("jstree-no-icons"),this.trigger("show_icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.get_container_ul().addClass("jstree-no-icons"),this.trigger("hide_icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},show_ellipsis:function(){this._data.core.themes.ellipsis=!0,this.get_container_ul().addClass("jstree-ellipsis"),this.trigger("show_ellipsis")},hide_ellipsis:function(){this._data.core.themes.ellipsis=!1,this.get_container_ul().removeClass("jstree-ellipsis"),this.trigger("hide_ellipsis")},toggle_ellipsis:function(){this._data.core.themes.ellipsis?this.hide_ellipsis():this.show_ellipsis()},set_icon:function(e,t){var r,i,s,a;if(Array.isArray(e)){for(r=0,i=(e=e.slice()).length;r<i;r++)this.set_icon(e[r],t);return!0}return!(!(e=this.get_node(e))||e.id===E.jstree.root)&&(a=e.icon,e.icon=!0===t||null===t||t===P||""===t||t,s=this.get_node(e,!0).children(".jstree-anchor").children(".jstree-themeicon"),!1===t?(s.removeClass("jstree-themeicon-custom "+a).css("background","").removeAttr("rel"),this.hide_icon(e)):(!0===t||null===t||t===P||""===t?s.removeClass("jstree-themeicon-custom "+a).css("background","").removeAttr("rel"):-1===t.indexOf("/")&&-1===t.indexOf(".")?(s.removeClass(a).css("background",""),s.addClass(t+" jstree-themeicon-custom").attr("rel",t)):(s.removeClass(a).css("background",""),s.addClass("jstree-themeicon-custom").css("background","url('"+t+"') center center no-repeat").attr("rel",t)),!1===a&&this.show_icon(e)),!0)},get_icon:function(e){return!(!(e=this.get_node(e))||e.id===E.jstree.root)&&e.icon},hide_icon:function(e){var t,r;if(Array.isArray(e)){for(t=0,r=(e=e.slice()).length;t<r;t++)this.hide_icon(e[t]);return!0}return!(!(e=this.get_node(e))||e===E.jstree.root)&&(e.icon=!1,this.get_node(e,!0).children(".jstree-anchor").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0)},show_icon:function(e){var t,r,i;if(Array.isArray(e)){for(t=0,r=(e=e.slice()).length;t<r;t++)this.show_icon(e[t]);return!0}return!(!(e=this.get_node(e))||e===E.jstree.root)&&(i=this.get_node(e,!0),e.icon=!i.length||i.children(".jstree-anchor").children(".jstree-themeicon").attr("rel"),e.icon||(e.icon=!0),i.children(".jstree-anchor").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0)}},E.vakata={},E.vakata.attributes=function(e,r){e=E(e)[0];var i=r?{}:[];return e&&e.attributes&&E.each(e.attributes,function(e,t){-1===E.inArray(t.name.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])&&null!==t.value&&""!==t.value.trim()&&(r?i[t.name]=t.value:i.push(t.name))}),i},E.vakata.array_unique=function(e){for(var t=[],r={},i=0,s=e.length;i<s;i++)r[e[i]]===P&&(t.push(e[i]),r[e[i]]=!0);return t},E.vakata.array_remove=function(e,t){return e.splice(t,1),e},E.vakata.array_remove_item=function(e,t){var r=E.inArray(t,e);return-1!==r?E.vakata.array_remove(e,r):e},E.vakata.array_filter=function(e,t,r,i,s){if(e.filter)return e.filter(t,r);for(s in i=[],e)~~s+""==s+""&&0<=s&&t.call(r,e[s],+s,e)&&i.push(e[s]);return i},E.jstree.plugins.changed=function(e,a){var n=[];this.trigger=function(e,t){if(t=t||{},"changed"===e.replace(".jstree","")){t.changed={selected:[],deselected:[]};for(var r={},i=0,s=n.length;i<s;i++)r[n[i]]=1;for(i=0,s=t.selected.length;i<s;i++)r[t.selected[i]]?r[t.selected[i]]=2:t.changed.selected.push(t.selected[i]);for(i=0,s=n.length;i<s;i++)1===r[n[i]]&&t.changed.deselected.push(n[i]);n=t.selected.slice()}a.trigger.call(this,e,t)},this.refresh=function(e,t){return n=[],a.refresh.apply(this,arguments)}};var h,_,u,d,l,g,f,w,p=y.createElement("I");p.className="jstree-icon jstree-checkbox",p.setAttribute("role","presentation"),E.jstree.defaults.checkbox={visible:!0,three_state:!0,whole_node:!0,keep_selected_style:!0,cascade:"",tie_selection:!0,cascade_to_disabled:!0,cascade_to_hidden:!0},E.jstree.plugins.checkbox=function(e,d){this.bind=function(){d.bind.call(this),this._data.checkbox.uto=!1,this._data.checkbox.selected=[],this.settings.checkbox.three_state&&(this.settings.checkbox.cascade="up+down+undetermined"),this.element.on("init.jstree",E.proxy(function(){this._data.checkbox.visible=this.settings.checkbox.visible,this.settings.checkbox.keep_selected_style||this.element.addClass("jstree-checkbox-no-clicked"),this.settings.checkbox.tie_selection&&this.element.addClass("jstree-checkbox-selection")},this)).on("loading.jstree",E.proxy(function(){this[this._data.checkbox.visible?"show_checkboxes":"hide_checkboxes"]()},this)),-1!==this.settings.checkbox.cascade.indexOf("undetermined")&&this.element.on("changed.jstree uncheck_node.jstree check_node.jstree uncheck_all.jstree check_all.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree",E.proxy(function(){this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(E.proxy(this._undetermined,this),50)},this)),this.settings.checkbox.tie_selection||this.element.on("model.jstree",E.proxy(function(e,t){for(var r=this._model.data,i=(r[t.parent],t.nodes),s=0,a=i.length;s<a;s++)r[i[s]].state.checked=r[i[s]].state.checked||r[i[s]].original&&r[i[s]].original.state&&r[i[s]].original.state.checked,r[i[s]].state.checked&&this._data.checkbox.selected.push(i[s])},this)),-1===this.settings.checkbox.cascade.indexOf("up")&&-1===this.settings.checkbox.cascade.indexOf("down")||this.element.on("model.jstree",E.proxy(function(e,t){var r,i,s,a,n,o,d=this._model.data,c=d[t.parent],l=t.nodes,h=[],_=this.settings.checkbox.cascade,u=this.settings.checkbox.tie_selection;if(-1!==_.indexOf("down"))if(c.state[u?"selected":"checked"]){for(i=0,s=l.length;i<s;i++)d[l[i]].state[u?"selected":"checked"]=!0;this._data[u?"core":"checkbox"].selected=this._data[u?"core":"checkbox"].selected.concat(l)}else for(i=0,s=l.length;i<s;i++)if(d[l[i]].state[u?"selected":"checked"]){for(a=0,n=d[l[i]].children_d.length;a<n;a++)d[d[l[i]].children_d[a]].state[u?"selected":"checked"]=!0;this._data[u?"core":"checkbox"].selected=this._data[u?"core":"checkbox"].selected.concat(d[l[i]].children_d)}if(-1!==_.indexOf("up")){for(i=0,s=c.children_d.length;i<s;i++)d[c.children_d[i]].children.length||h.push(d[c.children_d[i]].parent);for(a=0,n=(h=E.vakata.array_unique(h)).length;a<n;a++)for(c=d[h[a]];c&&c.id!==E.jstree.root;){for(i=r=0,s=c.children.length;i<s;i++)r+=d[c.children[i]].state[u?"selected":"checked"];if(r!==s)break;c.state[u?"selected":"checked"]=!0,this._data[u?"core":"checkbox"].selected.push(c.id),(o=this.get_node(c,!0))&&o.length&&o.attr("aria-selected",!0).children(".jstree-anchor").addClass(u?"jstree-clicked":"jstree-checked"),c=this.get_node(c.parent)}}this._data[u?"core":"checkbox"].selected=E.vakata.array_unique(this._data[u?"core":"checkbox"].selected)},this)).on(this.settings.checkbox.tie_selection?"select_node.jstree":"check_node.jstree",E.proxy(function(e,t){var r,i,s=t.node,a=this._model.data,n=this.get_node(s.parent),o=this.settings.checkbox.cascade,d=this.settings.checkbox.tie_selection,c={},l=this._data[d?"core":"checkbox"].selected;for(u=0,g=l.length;u<g;u++)c[l[u]]=!0;if(-1!==o.indexOf("down"))for(var h=this._cascade_new_checked_state(s.id,!0),_=s.children_d.concat(s.id),u=0,g=_.length;u<g;u++)-1<h.indexOf(_[u])?c[_[u]]=!0:delete c[_[u]];if(-1!==o.indexOf("up"))for(;n&&n.id!==E.jstree.root;){for(u=r=0,g=n.children.length;u<g;u++)r+=a[n.children[u]].state[d?"selected":"checked"];if(r!==g)break;n.state[d?"selected":"checked"]=!0,c[n.id]=!0,(i=this.get_node(n,!0))&&i.length&&i.attr("aria-selected",!0).children(".jstree-anchor").addClass(d?"jstree-clicked":"jstree-checked"),n=this.get_node(n.parent)}for(u in l=[],c)c.hasOwnProperty(u)&&l.push(u);this._data[d?"core":"checkbox"].selected=l},this)).on(this.settings.checkbox.tie_selection?"deselect_all.jstree":"uncheck_all.jstree",E.proxy(function(e,t){for(var r,i=this.get_node(E.jstree.root),s=this._model.data,a=0,n=i.children_d.length;a<n;a++)(r=s[i.children_d[a]])&&r.original&&r.original.state&&r.original.state.undetermined&&(r.original.state.undetermined=!1)},this)).on(this.settings.checkbox.tie_selection?"deselect_node.jstree":"uncheck_node.jstree",E.proxy(function(e,t){var r,i,s,a,n=t.node,o=(this.get_node(n,!0),this.settings.checkbox.cascade),d=this.settings.checkbox.tie_selection,c=this._data[d?"core":"checkbox"].selected,l=n.children_d.concat(n.id);if(-1!==o.indexOf("down")&&(a=this._cascade_new_checked_state(n.id,!1),c=E.vakata.array_filter(c,function(e){return-1===l.indexOf(e)||-1<a.indexOf(e)})),-1!==o.indexOf("up")&&-1===c.indexOf(n.id)){for(r=0,i=n.parents.length;r<i;r++)(s=this._model.data[n.parents[r]]).state[d?"selected":"checked"]=!1,s&&s.original&&s.original.state&&s.original.state.undetermined&&(s.original.state.undetermined=!1),(s=this.get_node(n.parents[r],!0))&&s.length&&s.attr("aria-selected",!1).children(".jstree-anchor").removeClass(d?"jstree-clicked":"jstree-checked");c=E.vakata.array_filter(c,function(e){return-1===n.parents.indexOf(e)})}this._data[d?"core":"checkbox"].selected=c},this)),-1!==this.settings.checkbox.cascade.indexOf("up")&&this.element.on("delete_node.jstree",E.proxy(function(e,t){for(var r,i,s,a,n=this.get_node(t.parent),o=this._model.data,d=this.settings.checkbox.tie_selection;n&&n.id!==E.jstree.root&&!n.state[d?"selected":"checked"];){for(r=s=0,i=n.children.length;r<i;r++)s+=o[n.children[r]].state[d?"selected":"checked"];if(!(0<i&&s===i))break;n.state[d?"selected":"checked"]=!0,this._data[d?"core":"checkbox"].selected.push(n.id),(a=this.get_node(n,!0))&&a.length&&a.attr("aria-selected",!0).children(".jstree-anchor").addClass(d?"jstree-clicked":"jstree-checked"),n=this.get_node(n.parent)}},this)).on("move_node.jstree",E.proxy(function(e,t){var r,i,s,a,n,o=t.is_multi,d=t.old_parent,c=this.get_node(t.parent),l=this._model.data,h=this.settings.checkbox.tie_selection;if(!o)for(r=this.get_node(d);r&&r.id!==E.jstree.root&&!r.state[h?"selected":"checked"];){for(s=i=0,a=r.children.length;s<a;s++)i+=l[r.children[s]].state[h?"selected":"checked"];if(!(0<a&&i===a))break;r.state[h?"selected":"checked"]=!0,this._data[h?"core":"checkbox"].selected.push(r.id),(n=this.get_node(r,!0))&&n.length&&n.attr("aria-selected",!0).children(".jstree-anchor").addClass(h?"jstree-clicked":"jstree-checked"),r=this.get_node(r.parent)}for(r=c;r&&r.id!==E.jstree.root;){for(s=i=0,a=r.children.length;s<a;s++)i+=l[r.children[s]].state[h?"selected":"checked"];if(i===a)r.state[h?"selected":"checked"]||(r.state[h?"selected":"checked"]=!0,this._data[h?"core":"checkbox"].selected.push(r.id),(n=this.get_node(r,!0))&&n.length&&n.attr("aria-selected",!0).children(".jstree-anchor").addClass(h?"jstree-clicked":"jstree-checked"));else{if(!r.state[h?"selected":"checked"])break;r.state[h?"selected":"checked"]=!1,this._data[h?"core":"checkbox"].selected=E.vakata.array_remove_item(this._data[h?"core":"checkbox"].selected,r.id),(n=this.get_node(r,!0))&&n.length&&n.attr("aria-selected",!1).children(".jstree-anchor").removeClass(h?"jstree-clicked":"jstree-checked")}r=this.get_node(r.parent)}},this))},this.get_undetermined=function(e){if(-1===this.settings.checkbox.cascade.indexOf("undetermined"))return[];for(var r,i,s={},a=this._model.data,t=this.settings.checkbox.tie_selection,n=this._data[t?"core":"checkbox"].selected,o=[],d=this,c=[],l=0,h=n.length;l<h;l++)if(a[n[l]]&&a[n[l]].parents)for(r=0,i=a[n[l]].parents.length;r<i&&s[a[n[l]].parents[r]]===P;r++)a[n[l]].parents[r]!==E.jstree.root&&(s[a[n[l]].parents[r]]=!0,o.push(a[n[l]].parents[r]));for(this.element.find(".jstree-closed").not(":has(.jstree-children)").each(function(){var e,t=d.get_node(this);if(t)if(t.state.loaded){for(l=0,h=t.children_d.length;l<h;l++)if(!(e=a[t.children_d[l]]).state.loaded&&e.original&&e.original.state&&e.original.state.undetermined&&!0===e.original.state.undetermined)for(s[e.id]===P&&e.id!==E.jstree.root&&(s[e.id]=!0,o.push(e.id)),r=0,i=e.parents.length;r<i;r++)s[e.parents[r]]===P&&e.parents[r]!==E.jstree.root&&(s[e.parents[r]]=!0,o.push(e.parents[r]))}else if(t.original&&t.original.state&&t.original.state.undetermined&&!0===t.original.state.undetermined)for(s[t.id]===P&&t.id!==E.jstree.root&&(s[t.id]=!0,o.push(t.id)),r=0,i=t.parents.length;r<i;r++)s[t.parents[r]]===P&&t.parents[r]!==E.jstree.root&&(s[t.parents[r]]=!0,o.push(t.parents[r]))}),l=0,h=o.length;l<h;l++)a[o[l]].state[t?"selected":"checked"]||c.push(e?a[o[l]]:o[l]);return c},this._undetermined=function(){if(null!==this.element){var e,t,r,i=this.get_undetermined(!1);for(this.element.find(".jstree-undetermined").removeClass("jstree-undetermined"),e=0,t=i.length;e<t;e++)(r=this.get_node(i[e],!0))&&r.length&&r.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-undetermined")}},this.redraw_node=function(e,t,r,i){if(e=d.redraw_node.apply(this,arguments)){for(var s=null,a=null,n=0,o=e.childNodes.length;n<o;n++)if(e.childNodes[n]&&e.childNodes[n].className&&-1!==e.childNodes[n].className.indexOf("jstree-anchor")){s=e.childNodes[n];break}s&&(!this.settings.checkbox.tie_selection&&this._model.data[e.id].state.checked&&(s.className+=" jstree-checked"),a=p.cloneNode(!1),this._model.data[e.id].state.checkbox_disabled&&(a.className+=" jstree-checkbox-disabled"),s.insertBefore(a,s.childNodes[0]))}return r||-1===this.settings.checkbox.cascade.indexOf("undetermined")||(this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(E.proxy(this._undetermined,this),50)),e},this.show_checkboxes=function(){this._data.core.themes.checkboxes=!0,this.get_container_ul().removeClass("jstree-no-checkboxes")},this.hide_checkboxes=function(){this._data.core.themes.checkboxes=!1,this.get_container_ul().addClass("jstree-no-checkboxes")},this.toggle_checkboxes=function(){this._data.core.themes.checkboxes?this.hide_checkboxes():this.show_checkboxes()},this.is_undetermined=function(e){e=this.get_node(e);var t,r,i=this.settings.checkbox.cascade,s=this.settings.checkbox.tie_selection,a=this._data[s?"core":"checkbox"].selected,n=this._model.data;if(!e||!0===e.state[s?"selected":"checked"]||-1===i.indexOf("undetermined")||-1===i.indexOf("down")&&-1===i.indexOf("up"))return!1;if(!e.state.loaded&&!0===e.original.state.undetermined)return!0;for(t=0,r=e.children_d.length;t<r;t++)if(-1!==E.inArray(e.children_d[t],a)||!n[e.children_d[t]].state.loaded&&n[e.children_d[t]].original.state.undetermined)return!0;return!1},this.disable_checkbox=function(e){var t,r,i;if(Array.isArray(e)){for(t=0,r=(e=e.slice()).length;t<r;t++)this.disable_checkbox(e[t]);return!0}if(!(e=this.get_node(e))||e.id===E.jstree.root)return!1;i=this.get_node(e,!0),e.state.checkbox_disabled||(e.state.checkbox_disabled=!0,i&&i.length&&i.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-checkbox-disabled"),this.trigger("disable_checkbox",{node:e}))},this.enable_checkbox=function(e){var t,r,i;if(Array.isArray(e)){for(t=0,r=(e=e.slice()).length;t<r;t++)this.enable_checkbox(e[t]);return!0}if(!(e=this.get_node(e))||e.id===E.jstree.root)return!1;i=this.get_node(e,!0),e.state.checkbox_disabled&&(e.state.checkbox_disabled=!1,i&&i.length&&i.children(".jstree-anchor").children(".jstree-checkbox").removeClass("jstree-checkbox-disabled"),this.trigger("enable_checkbox",{node:e}))},this.activate_node=function(e,t){return!E(t.target).hasClass("jstree-checkbox-disabled")&&(this.settings.checkbox.tie_selection&&(this.settings.checkbox.whole_node||E(t.target).hasClass("jstree-checkbox"))&&(t.ctrlKey=!0),this.settings.checkbox.tie_selection||!this.settings.checkbox.whole_node&&!E(t.target).hasClass("jstree-checkbox")?d.activate_node.call(this,e,t):!this.is_disabled(e)&&(this.is_checked(e)?this.uncheck_node(e,t):this.check_node(e,t),void this.trigger("activate_node",{node:this.get_node(e)})))},this._cascade_new_checked_state=function(e,t){var r,i,s=this.settings.checkbox.tie_selection,a=this._model.data[e],n=[],o=[];if(!this.settings.checkbox.cascade_to_disabled&&a.state.disabled||!this.settings.checkbox.cascade_to_hidden&&a.state.hidden)c=this.get_checked_descendants(e),a.state[s?"selected":"checked"]&&c.push(a.id),n=n.concat(c);else{if(a.children)for(r=0,i=a.children.length;r<i;r++){var d=a.children[r],c=this._cascade_new_checked_state(d,t),n=n.concat(c);-1<c.indexOf(d)&&o.push(d)}var l=this.get_node(a,!0),h=0<o.length&&o.length<a.children.length;a.original&&a.original.state&&a.original.state.undetermined&&(a.original.state.undetermined=h),!h&&t&&o.length===a.children.length?(a.state[s?"selected":"checked"]=t,n.push(a.id),l.attr("aria-selected",!0).children(".jstree-anchor").addClass(s?"jstree-clicked":"jstree-checked")):(a.state[s?"selected":"checked"]=!1,l.attr("aria-selected",!1).children(".jstree-anchor").removeClass(s?"jstree-clicked":"jstree-checked"))}return n},this.get_checked_descendants=function(e){var t=this,r=t.settings.checkbox.tie_selection,i=t._model.data[e];return E.vakata.array_filter(i.children_d,function(e){return t._model.data[e].state[r?"selected":"checked"]})},this.check_node=function(e,t){if(this.settings.checkbox.tie_selection)return this.select_node(e,!1,!0,t);var r,i,s;if(Array.isArray(e)){for(i=0,s=(e=e.slice()).length;i<s;i++)this.check_node(e[i],t);return!0}if(!(e=this.get_node(e))||e.id===E.jstree.root)return!1;r=this.get_node(e,!0),e.state.checked||(e.state.checked=!0,this._data.checkbox.selected.push(e.id),r&&r.length&&r.children(".jstree-anchor").addClass("jstree-checked"),this.trigger("check_node",{node:e,selected:this._data.checkbox.selected,event:t}))},this.uncheck_node=function(e,t){if(this.settings.checkbox.tie_selection)return this.deselect_node(e,!1,t);var r,i,s;if(Array.isArray(e)){for(r=0,i=(e=e.slice()).length;r<i;r++)this.uncheck_node(e[r],t);return!0}if(!(e=this.get_node(e))||e.id===E.jstree.root)return!1;s=this.get_node(e,!0),e.state.checked&&(e.state.checked=!1,this._data.checkbox.selected=E.vakata.array_remove_item(this._data.checkbox.selected,e.id),s.length&&s.children(".jstree-anchor").removeClass("jstree-checked"),this.trigger("uncheck_node",{node:e,selected:this._data.checkbox.selected,event:t}))},this.check_all=function(){if(this.settings.checkbox.tie_selection)return this.select_all();var e,t;this._data.checkbox.selected.concat([]);for(this._data.checkbox.selected=this._model.data[E.jstree.root].children_d.concat(),e=0,t=this._data.checkbox.selected.length;e<t;e++)this._model.data[this._data.checkbox.selected[e]]&&(this._model.data[this._data.checkbox.selected[e]].state.checked=!0);this.redraw(!0),this.trigger("check_all",{selected:this._data.checkbox.selected})},this.uncheck_all=function(){if(this.settings.checkbox.tie_selection)return this.deselect_all();for(var e=this._data.checkbox.selected.concat([]),t=0,r=this._data.checkbox.selected.length;t<r;t++)this._model.data[this._data.checkbox.selected[t]]&&(this._model.data[this._data.checkbox.selected[t]].state.checked=!1);this._data.checkbox.selected=[],this.element.find(".jstree-checked").removeClass("jstree-checked"),this.trigger("uncheck_all",{selected:this._data.checkbox.selected,node:e})},this.is_checked=function(e){return this.settings.checkbox.tie_selection?this.is_selected(e):!(!(e=this.get_node(e))||e.id===E.jstree.root)&&e.state.checked},this.get_checked=function(e){return this.settings.checkbox.tie_selection?this.get_selected(e):e?E.map(this._data.checkbox.selected,E.proxy(function(e){return this.get_node(e)},this)):this._data.checkbox.selected.slice()},this.get_top_checked=function(e){if(this.settings.checkbox.tie_selection)return this.get_top_selected(e);for(var t,r,i=this.get_checked(!0),s={},a=0,n=i.length;a<n;a++)s[i[a].id]=i[a];for(a=0,n=i.length;a<n;a++)for(t=0,r=i[a].children_d.length;t<r;t++)s[i[a].children_d[t]]&&delete s[i[a].children_d[t]];for(a in i=[],s)s.hasOwnProperty(a)&&i.push(a);return e?E.map(i,E.proxy(function(e){return this.get_node(e)},this)):i},this.get_bottom_checked=function(e){if(this.settings.checkbox.tie_selection)return this.get_bottom_selected(e);for(var t=this.get_checked(!0),r=[],i=0,s=t.length;i<s;i++)t[i].children.length||r.push(t[i].id);return e?E.map(r,E.proxy(function(e){return this.get_node(e)},this)):r},this.load_node=function(e,t){var r,i,s;if(!Array.isArray(e)&&!this.settings.checkbox.tie_selection&&(s=this.get_node(e))&&s.state.loaded)for(r=0,i=s.children_d.length;r<i;r++)this._model.data[s.children_d[r]].state.checked&&(this._data.checkbox.selected=E.vakata.array_remove_item(this._data.checkbox.selected,s.children_d[r]));return d.load_node.apply(this,arguments)},this.get_state=function(){var e=d.get_state.apply(this,arguments);return this.settings.checkbox.tie_selection||(e.checkbox=this._data.checkbox.selected.slice()),e},this.set_state=function(e,t){var r,i=d.set_state.apply(this,arguments);return i&&e.checkbox?(this.settings.checkbox.tie_selection||(this.uncheck_all(),r=this,E.each(e.checkbox,function(e,t){r.check_node(t)})),delete e.checkbox,this.set_state(e,t),!1):i},this.refresh=function(e,t){return this.settings.checkbox.tie_selection&&(this._data.checkbox.selected=[]),d.refresh.apply(this,arguments)}},E.jstree.defaults.conditionalselect=function(){return!0},E.jstree.plugins.conditionalselect=function(e,r){this.activate_node=function(e,t){if(this.settings.conditionalselect.call(this,this.get_node(e),t))return r.activate_node.call(this,e,t)}},E.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(e,t){return{create:{separator_before:!1,separator_after:!0,_disabled:!1,label:"Create",action:function(e){var r=E.jstree.reference(e.reference),t=r.get_node(e.reference);r.create_node(t,{},"last",function(t){try{r.edit(t)}catch(e){setTimeout(function(){r.edit(t)},0)}})}},rename:{separator_before:!1,separator_after:!1,_disabled:!1,label:"Rename",action:function(e){var t=E.jstree.reference(e.reference),r=t.get_node(e.reference);t.edit(r)}},remove:{separator_before:!1,icon:!1,separator_after:!1,_disabled:!1,label:"Delete",action:function(e){var t=E.jstree.reference(e.reference),r=t.get_node(e.reference);t.is_selected(r)?t.delete_node(t.get_selected()):t.delete_node(r)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(e){var t=E.jstree.reference(e.reference),r=t.get_node(e.reference);t.is_selected(r)?t.cut(t.get_top_selected()):t.cut(r)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(e){var t=E.jstree.reference(e.reference),r=t.get_node(e.reference);t.is_selected(r)?t.copy(t.get_top_selected()):t.copy(r)}},paste:{separator_before:!1,icon:!1,_disabled:function(e){return!E.jstree.reference(e.reference).can_paste()},separator_after:!1,label:"Paste",action:function(e){var t=E.jstree.reference(e.reference),r=t.get_node(e.reference);t.paste(r)}}}}}}},E.jstree.plugins.contextmenu=function(e,a){this.bind=function(){a.bind.call(this);var t,r,i=0,s=null;this.element.on("init.jstree loading.jstree ready.jstree",E.proxy(function(){this.get_container_ul().addClass("jstree-contextmenu")},this)).on("contextmenu.jstree",".jstree-anchor",E.proxy(function(e,t){"input"!==e.target.tagName.toLowerCase()&&(e.preventDefault(),i=e.ctrlKey?+new Date:0,(t||s)&&(i=+new Date+1e4),s&&clearTimeout(s),this.is_loading(e.currentTarget)||this.show_contextmenu(e.currentTarget,e.pageX,e.pageY,e))},this)).on("click.jstree",".jstree-anchor",E.proxy(function(e){this._data.contextmenu.visible&&(!i||250<new Date-i)&&E.vakata.context.hide(),i=0},this)).on("touchstart.jstree",".jstree-anchor",function(e){e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(t=e.originalEvent.changedTouches[0].clientX,r=e.originalEvent.changedTouches[0].clientY,s=setTimeout(function(){E(e.currentTarget).trigger("contextmenu",!0)},750))}).on("touchmove.vakata.jstree",function(e){s&&e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(10<Math.abs(t-e.originalEvent.changedTouches[0].clientX)||10<Math.abs(r-e.originalEvent.changedTouches[0].clientY))&&(clearTimeout(s),E.vakata.context.hide())}).on("touchend.vakata.jstree",function(e){s&&clearTimeout(s)}),E(y).on("context_hide.vakata.jstree",E.proxy(function(e,t){this._data.contextmenu.visible=!1,E(t.reference).removeClass("jstree-context")},this))},this.teardown=function(){this._data.contextmenu.visible&&E.vakata.context.hide(),a.teardown.call(this)},this.show_contextmenu=function(t,r,i,e){if(!(t=this.get_node(t))||t.id===E.jstree.root)return!1;var s=this.settings.contextmenu,a=this.get_node(t,!0).children(".jstree-anchor"),n=!1,o=!1;!s.show_at_node&&r!==P&&i!==P||(n=a.offset(),r=n.left,i=n.top+this._data.core.li_height),this.settings.contextmenu.select_node&&!this.is_selected(t)&&this.activate_node(t,e),"function"==typeof(o=s.items)&&(o=o.call(this,t,E.proxy(function(e){this._show_contextmenu(t,r,i,e)},this))),E.isPlainObject(o)&&this._show_contextmenu(t,r,i,o)},this._show_contextmenu=function(e,t,r,i){var s=this.get_node(e,!0).children(".jstree-anchor");E(y).one("context_show.vakata.jstree",E.proxy(function(e,t){var r="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";E(t.element).addClass(r),s.addClass("jstree-context")},this)),this._data.contextmenu.visible=!0,E.vakata.context.show(s,{x:t,y:r},i),this.trigger("show_contextmenu",{node:e,x:t,y:r})}},u={element:_=!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1},(h=E).vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(e){h(y).triggerHandler("context_"+e+".vakata",{reference:u.reference,element:u.element,position:{x:u.position_x,y:u.position_y}})},_execute:function(e){return!(!(e=u.items[e])||e._disabled&&("function"!=typeof e._disabled||e._disabled({item:e,reference:u.reference,element:u.element}))||!e.action)&&e.action.call(null,{item:e,reference:u.reference,element:u.element,position:{x:u.position_x,y:u.position_y}})},_parse:function(e,t){if(!e)return!1;t||(u.html="",u.items=[]);var r,i="",s=!1;return t&&(i+="<ul>"),h.each(e,function(e,t){return!t||(u.items.push(t),!s&&t.separator_before&&(i+="<li class='vakata-context-separator'><a href='#' "+(h.vakata.context.settings.icons?"":'style="margin-left:0px;"')+"> </a></li>"),s=!1,i+="<li class='"+(t._class||"")+(!0===t._disabled||"function"==typeof t._disabled&&t._disabled({item:t,reference:u.reference,element:u.element})?" vakata-contextmenu-disabled ":"")+"' "+(t.shortcut?" data-shortcut='"+t.shortcut+"' ":"")+">",i+="<a href='#' rel='"+(u.items.length-1)+"' "+(t.title?"title='"+t.title+"'":"")+">",h.vakata.context.settings.icons&&(i+="<i ",t.icon&&(-1!==t.icon.indexOf("/")||-1!==t.icon.indexOf(".")?i+=" style='background:url(\""+t.icon+"\") center center no-repeat' ":i+=" class='"+t.icon+"' "),i+="></i><span class='vakata-contextmenu-sep'> </span>"),i+=("function"==typeof t.label?t.label({item:e,reference:u.reference,element:u.element}):t.label)+(t.shortcut?' <span class="vakata-contextmenu-shortcut vakata-contextmenu-shortcut-'+t.shortcut+'">'+(t.shortcut_label||"")+"</span>":"")+"</a>",t.submenu&&(r=h.vakata.context._parse(t.submenu,!0))&&(i+=r),i+="</li>",void(t.separator_after&&(i+="<li class='vakata-context-separator'><a href='#' "+(h.vakata.context.settings.icons?"":'style="margin-left:0px;"')+"> </a></li>",s=!0)))}),i=i.replace(/<li class\='vakata-context-separator'\><\/li\>$/,""),t&&(i+="</ul>"),t||(u.html=i,h.vakata.context._trigger("parse")),10<i.length&&i},_show_submenu:function(e){var t,r,i,s,a,n,o,d;(e=h(e)).length&&e.children("ul").length&&(t=e.children("ul"),i=(r=e.offset().left)+e.outerWidth(),s=e.offset().top,a=t.width(),n=t.height(),o=h(window).width()+h(window).scrollLeft(),d=h(window).height()+h(window).scrollTop(),_?e[i-(a+10+e.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):e[o<i+a&&o-i<r?"addClass":"removeClass"]("vakata-context-right"),d<s+n+10&&t.css("bottom","-1px"),e.hasClass("vakata-context-right")?r<a&&t.css("margin-right",r-a):o-i<a&&t.css("margin-left",o-i-a),t.show())},show:function(e,t,r){var i,s,a,n,o,d,c,l;switch(u.element&&u.element.length&&u.element.width(""),!0){case!t&&!e:return!1;case!!t&&!!e:u.reference=e,u.position_x=t.x,u.position_y=t.y;break;case!t&&!!e:i=(u.reference=e).offset(),u.position_x=i.left+e.outerHeight(),u.position_y=i.top;break;case!!t&&!e:u.position_x=t.x,u.position_y=t.y}e&&!r&&h(e).data("vakata_contextmenu")&&(r=h(e).data("vakata_contextmenu")),h.vakata.context._parse(r)&&u.element.html(u.html),u.items.length&&(u.element.appendTo(y.body),s=u.element,a=u.position_x,n=u.position_y,o=s.width(),d=s.height(),c=h(window).width()+h(window).scrollLeft(),l=h(window).height()+h(window).scrollTop(),_&&(a-=s.outerWidth()-h(e).outerWidth())<h(window).scrollLeft()+20&&(a=h(window).scrollLeft()+20),c<a+o+20&&(a=c-(o+20)),l<n+d+20&&(n=l-(d+20)),u.element.css({left:a,top:n}).show().find("a").first().focus().parent().addClass("vakata-context-hover"),u.is_visible=!0,h.vakata.context._trigger("show"))},hide:function(){u.is_visible&&(u.element.hide().find("ul").hide().end().find(":focus").blur().end().detach(),u.is_visible=!1,h.vakata.context._trigger("hide"))}},h(function(){_="rtl"===h(y.body).css("direction");var t=!1;u.element=h("<ul class='vakata-context'></ul>"),u.element.on("mouseenter","li",function(e){e.stopImmediatePropagation(),h.contains(this,e.relatedTarget)||(t&&clearTimeout(t),u.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),h(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),h.vakata.context._show_submenu(this))}).on("mouseleave","li",function(e){h.contains(this,e.relatedTarget)||h(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(e){h(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),h.vakata.context.settings.hide_onmouseleave&&(t=setTimeout(function(){h.vakata.context.hide()},h.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(e){e.preventDefault(),h(this).trigger("blur").parent().hasClass("vakata-context-disabled")||!1===h.vakata.context._execute(h(this).attr("rel"))||h.vakata.context.hide()}).on("keydown","a",function(e){var t=null;switch(e.which){case 13:case 32:e.type="click",e.preventDefault(),h(e.currentTarget).trigger(e);break;case 37:u.is_visible&&(u.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 38:u.is_visible&&((t=u.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first()).length||(t=u.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),t.addClass("vakata-context-hover").children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 39:u.is_visible&&(u.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 40:u.is_visible&&((t=u.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first()).length||(t=u.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),t.addClass("vakata-context-hover").children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 27:h.vakata.context.hide(),e.preventDefault()}}).on("keydown",function(e){e.preventDefault();var t=u.element.find(".vakata-contextmenu-shortcut-"+e.which).parent();t.parent().not(".vakata-context-disabled")&&t.trigger("click")}),h(y).on("mousedown.vakata.jstree",function(e){u.is_visible&&u.element[0]!==e.target&&!h.contains(u.element[0],e.target)&&h.vakata.context.hide()}).on("context_show.vakata.jstree",function(e,t){u.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),_&&u.element.addClass("vakata-context-rtl").css("direction","rtl"),u.element.find("ul").hide().end()})}),E.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0,check_while_dragging:!0,always_copy:!1,inside_pos:0,drag_selection:!0,touch:!0,large_drop_target:!1,large_drag_target:!1,use_html5:!1},E.jstree.plugins.dnd=function(e,o){this.init=function(e,t){o.init.call(this,e,t),this.settings.dnd.use_html5=this.settings.dnd.use_html5&&"draggable"in y.createElement("span")},this.bind=function(){o.bind.call(this),this.element.on(this.settings.dnd.use_html5?"dragstart.jstree":"mousedown.jstree touchstart.jstree",this.settings.dnd.large_drag_target?".jstree-node":".jstree-anchor",E.proxy(function(e){if(this.settings.dnd.large_drag_target&&E(e.target).closest(".jstree-node")[0]!==e.currentTarget)return!0;if("touchstart"===e.type&&(!this.settings.dnd.touch||"selected"===this.settings.dnd.touch&&!E(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").hasClass("jstree-clicked")))return!0;var t=this.get_node(e.target),r=this.is_selected(t)&&this.settings.dnd.drag_selection?this.get_top_selected().length:1,i=1<r?r+" "+this.get_string("nodes"):this.get_text(e.currentTarget);if(this.settings.core.force_text&&(i=E.vakata.html.escape(i)),t&&t.id&&t.id!==E.jstree.root&&(1===e.which||"touchstart"===e.type||"dragstart"===e.type)&&(!0===this.settings.dnd.is_draggable||"function"==typeof this.settings.dnd.is_draggable&&this.settings.dnd.is_draggable.call(this,1<r?this.get_top_selected(!0):[t],e))){if(d={jstree:!0,origin:this,obj:this.get_node(t,!0),nodes:1<r?this.get_top_selected():[t.id]},l=e.currentTarget,!this.settings.dnd.use_html5)return this.element.trigger("mousedown.jstree"),E.vakata.dnd.start(e,d,'<div id="jstree-dnd" class="jstree-'+this.get_theme()+" jstree-"+this.get_theme()+"-"+this.get_theme_variant()+" "+(this.settings.core.themes.responsive?" jstree-dnd-responsive":"")+'"><i class="jstree-icon jstree-er"></i>'+i+'<ins class="jstree-copy" style="display:none;">+</ins></div>');E.vakata.dnd._trigger("start",e,{helper:E(),element:l,data:d})}},this)),this.settings.dnd.use_html5&&this.element.on("dragover.jstree",function(e){return e.preventDefault(),E.vakata.dnd._trigger("move",e,{helper:E(),element:l,data:d}),!1}).on("drop.jstree",E.proxy(function(e){return e.preventDefault(),E.vakata.dnd._trigger("stop",e,{helper:E(),element:l,data:d}),!1},this))},this.redraw_node=function(e,t,r,i){if((e=o.redraw_node.apply(this,arguments))&&this.settings.dnd.use_html5)if(this.settings.dnd.large_drag_target)e.setAttribute("draggable",!0);else{for(var s=null,a=0,n=e.childNodes.length;a<n;a++)if(e.childNodes[a]&&e.childNodes[a].className&&-1!==e.childNodes[a].className.indexOf("jstree-anchor")){s=e.childNodes[a];break}s&&s.setAttribute("draggable",!0)}return e}},E(function(){var A=!1,N=!1,T=!1,O=!1,S=E('<div id="jstree-marker"> </div>').hide();E(y).on("dragover.vakata.jstree",function(e){l&&E.vakata.dnd._trigger("move",e,{helper:E(),element:l,data:d})}).on("drop.vakata.jstree",function(e){l&&(E.vakata.dnd._trigger("stop",e,{helper:E(),element:l,data:d}),d=l=null)}).on("dnd_start.vakata.jstree",function(e,t){T=A=!1,t&&t.data&&t.data.jstree&&S.appendTo(y.body)}).on("dnd_move.vakata.jstree",function(e,s){var a=s.event.target!==T.target;if(O&&(s.event&&"dragover"===s.event.type&&!a||clearTimeout(O)),s&&s.data&&s.data.jstree&&(!s.event.target.id||"jstree-marker"!==s.event.target.id)){T=s.event;var n,o,d,c,l,h,_,u,g,f,p,m,v,j,y,k,x,b=E.jstree.reference(s.event.target),w=!1,C=!1,t=!1;if(b&&b._data&&b._data.dnd)if(S.attr("class","jstree-"+b.get_theme()+(b.settings.core.themes.responsive?" jstree-dnd-responsive":"")),y=s.data.origin&&(s.data.origin.settings.dnd.always_copy||s.data.origin.settings.dnd.copy&&(s.event.metaKey||s.event.ctrlKey)),s.helper.children().attr("class","jstree-"+b.get_theme()+" jstree-"+b.get_theme()+"-"+b.get_theme_variant()+" "+(b.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[y?"show":"hide"](),s.event.target!==b.element[0]&&s.event.target!==b.get_container_ul()[0]||0!==b.get_container_ul().children().length){if((w=b.settings.dnd.large_drop_target?E(s.event.target).closest(".jstree-node").children(".jstree-anchor"):E(s.event.target).closest(".jstree-anchor"))&&w.length&&w.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(C=w.offset(),t=(s.event.pageY!==P?s.event.pageY:s.event.originalEvent.pageY)-C.top,d=w.outerHeight(),h=t<d/3?["b","i","a"]:d-d/3<t?["a","i","b"]:d/2<t?["i","a","b"]:["i","b","a"],E.each(h,function(e,t){switch(t){case"b":n=C.left-6,o=C.top,c=b.get_parent(w),l=w.parent().index(),x="jstree-below";break;case"i":v=b.settings.dnd.inside_pos,j=b.get_node(w.parent()),n=C.left-2,o=C.top+d/2+1,c=j.id,l="first"===v?0:"last"===v?j.children.length:Math.min(v,j.children.length),x="jstree-inside";break;case"a":n=C.left-6,o=C.top+d,c=b.get_parent(w),l=w.parent().index()+1,x="jstree-above"}for(_=!0,u=0,g=s.data.nodes.length;u<g;u++)if(f=s.data.origin&&(s.data.origin.settings.dnd.always_copy||s.data.origin.settings.dnd.copy&&(s.event.metaKey||s.event.ctrlKey))?"copy_node":"move_node",p=l,"move_node"==f&&"a"===t&&s.data.origin&&s.data.origin===b&&c===b.get_parent(s.data.nodes[u])&&(m=b.get_node(c),p>E.inArray(s.data.nodes[u],m.children)&&--p),!(_=_&&(b&&b.settings&&b.settings.dnd&&!1===b.settings.dnd.check_while_dragging||b.check(f,s.data.origin&&s.data.origin!==b?s.data.origin.get_node(s.data.nodes[u]):s.data.nodes[u],c,p,{dnd:!0,ref:b.get_node(w.parent()),pos:t,origin:s.data.origin,is_multi:s.data.origin&&s.data.origin!==b,is_foreign:!s.data.origin})))){b&&b.last_error&&(N=b.last_error());break}var r,i;if("i"===t&&w.parent().is(".jstree-closed")&&b.settings.dnd.open_timeout&&(s.event&&"dragover"===s.event.type&&!a||(O&&clearTimeout(O),O=setTimeout((i=w,function(){r.open_node(i)}),(r=b).settings.dnd.open_timeout))),_)return(k=b.get_node(c,!0)).hasClass(".jstree-dnd-parent")||(E(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),k.addClass("jstree-dnd-parent")),A={ins:b,par:c,pos:"i"!==t||"last"!==v||0!==l||b.is_loaded(j)?l:"last"},S.css({left:n+"px",top:o+"px"}).show(),S.removeClass("jstree-above jstree-inside jstree-below").addClass(x),s.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),s.event.originalEvent&&s.event.originalEvent.dataTransfer&&(s.event.originalEvent.dataTransfer.dropEffect=y?"copy":"move"),N={},!(h=!0)}),!0===h))return}else{for(_=!0,u=0,g=s.data.nodes.length;u<g&&(_=_&&b.check(s.data.origin&&(s.data.origin.settings.dnd.always_copy||s.data.origin.settings.dnd.copy&&(s.event.metaKey||s.event.ctrlKey))?"copy_node":"move_node",s.data.origin&&s.data.origin!==b?s.data.origin.get_node(s.data.nodes[u]):s.data.nodes[u],E.jstree.root,"last",{dnd:!0,ref:b.get_node(E.jstree.root),pos:"i",origin:s.data.origin,is_multi:s.data.origin&&s.data.origin!==b,is_foreign:!s.data.origin}));u++);if(_)return A={ins:b,par:E.jstree.root,pos:"last"},S.hide(),s.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),void(s.event.originalEvent&&s.event.originalEvent.dataTransfer&&(s.event.originalEvent.dataTransfer.dropEffect=y?"copy":"move"))}E(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),A=!1,s.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),s.event.originalEvent&&s.event.originalEvent.dataTransfer,S.hide()}}).on("dnd_scroll.vakata.jstree",function(e,t){t&&t.data&&t.data.jstree&&(S.hide(),T=A=!1,t.helper.find(".jstree-icon").first().removeClass("jstree-ok").addClass("jstree-er"))}).on("dnd_stop.vakata.jstree",function(e,t){if(E(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),O&&clearTimeout(O),t&&t.data&&t.data.jstree){S.hide().detach();var r,i,s=[];if(A){for(r=0,i=t.data.nodes.length;r<i;r++)s[r]=t.data.origin?t.data.origin.get_node(t.data.nodes[r]):t.data.nodes[r];A.ins[t.data.origin&&(t.data.origin.settings.dnd.always_copy||t.data.origin.settings.dnd.copy&&(t.event.metaKey||t.event.ctrlKey))?"copy_node":"move_node"](s,A.par,A.pos,!1,!1,!1,t.data.origin)}else(r=E(t.event.target).closest(".jstree")).length&&N&&N.error&&"check"===N.error&&(r=r.jstree(!0))&&r.settings.core.error.call(this,N);A=T=!1}}).on("keyup.jstree keydown.jstree",function(e,t){(t=E.vakata.dnd._get())&&t.data&&t.data.jstree&&("keyup"===e.type&&27===e.which?(O&&clearTimeout(O),O=T=N=A=!1,S.hide().detach(),E.vakata.dnd._clean()):(t.helper.find(".jstree-copy").first()[t.data.origin&&(t.data.origin.settings.dnd.always_copy||t.data.origin.settings.dnd.copy&&(e.metaKey||e.ctrlKey))?"show":"hide"](),T&&(T.metaKey=e.metaKey,T.ctrlKey=e.ctrlKey,E.vakata.dnd._trigger("move",T))))})}),f={element:!((g=E).vakata.html={div:g("<div></div>"),escape:function(e){return g.vakata.html.div.text(e).html()},strip:function(e){return g.vakata.html.div.empty().append(g.parseHTML(e)).text()}}),target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1},g.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:10},_trigger:function(e,t,r){r===P&&(r=g.vakata.dnd._get()),r.event=t,g(y).triggerHandler("dnd_"+e+".vakata",r)},_get:function(){return{data:f.data,element:f.element,helper:f.helper}},_clean:function(){f.helper&&f.helper.remove(),f.scroll_i&&(clearInterval(f.scroll_i),f.scroll_i=!1),f={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1},l=null,g(y).off("mousemove.vakata.jstree touchmove.vakata.jstree",g.vakata.dnd.drag),g(y).off("mouseup.vakata.jstree touchend.vakata.jstree",g.vakata.dnd.stop)},_scroll:function(e){if(!f.scroll_e||!f.scroll_l&&!f.scroll_t)return f.scroll_i&&(clearInterval(f.scroll_i),f.scroll_i=!1),!1;if(!f.scroll_i)return f.scroll_i=setInterval(g.vakata.dnd._scroll,100),!1;if(!0===e)return!1;var t=f.scroll_e.scrollTop(),r=f.scroll_e.scrollLeft();f.scroll_e.scrollTop(t+f.scroll_t*g.vakata.dnd.settings.scroll_speed),f.scroll_e.scrollLeft(r+f.scroll_l*g.vakata.dnd.settings.scroll_speed),t===f.scroll_e.scrollTop()&&r===f.scroll_e.scrollLeft()||g.vakata.dnd._trigger("scroll",f.scroll_e)},start:function(e,t,r){"touchstart"===e.type&&e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(e.pageX=e.originalEvent.changedTouches[0].pageX,e.pageY=e.originalEvent.changedTouches[0].pageY,e.target=y.elementFromPoint(e.originalEvent.changedTouches[0].pageX-window.pageXOffset,e.originalEvent.changedTouches[0].pageY-window.pageYOffset)),f.is_drag&&g.vakata.dnd.stop({});try{e.currentTarget.unselectable="on",e.currentTarget.onselectstart=function(){return!1},e.currentTarget.style&&(e.currentTarget.style.touchAction="none",e.currentTarget.style.msTouchAction="none",e.currentTarget.style.MozUserSelect="none")}catch(e){}return f.init_x=e.pageX,f.init_y=e.pageY,f.data=t,f.is_down=!0,f.element=e.currentTarget,f.target=e.target,f.is_touch="touchstart"===e.type,!1!==r&&(f.helper=g("<div id='vakata-dnd'></div>").html(r).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),g(y).on("mousemove.vakata.jstree touchmove.vakata.jstree",g.vakata.dnd.drag),g(y).on("mouseup.vakata.jstree touchend.vakata.jstree",g.vakata.dnd.stop),!1},drag:function(r){if("touchmove"===r.type&&r.originalEvent&&r.originalEvent.changedTouches&&r.originalEvent.changedTouches[0]&&(r.pageX=r.originalEvent.changedTouches[0].pageX,r.pageY=r.originalEvent.changedTouches[0].pageY,r.target=y.elementFromPoint(r.originalEvent.changedTouches[0].pageX-window.pageXOffset,r.originalEvent.changedTouches[0].pageY-window.pageYOffset)),f.is_down){if(!f.is_drag){if(!(Math.abs(r.pageX-f.init_x)>(f.is_touch?g.vakata.dnd.settings.threshold_touch:g.vakata.dnd.settings.threshold)||Math.abs(r.pageY-f.init_y)>(f.is_touch?g.vakata.dnd.settings.threshold_touch:g.vakata.dnd.settings.threshold)))return;f.helper&&(f.helper.appendTo(y.body),f.helper_w=f.helper.outerWidth()),f.is_drag=!0,g(f.target).one("click.vakata",!1),g.vakata.dnd._trigger("start",r)}var e=!1,t=!1,i=!1,s=!1,a=!1,n=!1,o=!1,d=!1,c=!1,l=!1;return f.scroll_t=0,f.scroll_l=0,f.scroll_e=!1,g(g(r.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(g(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var e=g(this),t=e.offset();if(this.scrollHeight>this.offsetHeight&&(t.top+e.height()-r.pageY<g.vakata.dnd.settings.scroll_proximity&&(f.scroll_t=1),r.pageY-t.top<g.vakata.dnd.settings.scroll_proximity&&(f.scroll_t=-1)),this.scrollWidth>this.offsetWidth&&(t.left+e.width()-r.pageX<g.vakata.dnd.settings.scroll_proximity&&(f.scroll_l=1),r.pageX-t.left<g.vakata.dnd.settings.scroll_proximity&&(f.scroll_l=-1)),f.scroll_t||f.scroll_l)return f.scroll_e=g(this),!1}),f.scroll_e||(e=g(y),t=g(window),i=e.height(),s=t.height(),a=e.width(),n=t.width(),o=e.scrollTop(),d=e.scrollLeft(),s<i&&r.pageY-o<g.vakata.dnd.settings.scroll_proximity&&(f.scroll_t=-1),s<i&&s-(r.pageY-o)<g.vakata.dnd.settings.scroll_proximity&&(f.scroll_t=1),n<a&&r.pageX-d<g.vakata.dnd.settings.scroll_proximity&&(f.scroll_l=-1),n<a&&n-(r.pageX-d)<g.vakata.dnd.settings.scroll_proximity&&(f.scroll_l=1),(f.scroll_t||f.scroll_l)&&(f.scroll_e=e)),f.scroll_e&&g.vakata.dnd._scroll(!0),f.helper&&(c=parseInt(r.pageY+g.vakata.dnd.settings.helper_top,10),l=parseInt(r.pageX+g.vakata.dnd.settings.helper_left,10),i&&i<c+25&&(c=i-50),a&&l+f.helper_w>a&&(l=a-(f.helper_w+2)),f.helper.css({left:l+"px",top:c+"px"})),g.vakata.dnd._trigger("move",r),!1}},stop:function(e){var t;return"touchend"===e.type&&e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(e.pageX=e.originalEvent.changedTouches[0].pageX,e.pageY=e.originalEvent.changedTouches[0].pageY,e.target=y.elementFromPoint(e.originalEvent.changedTouches[0].pageX-window.pageXOffset,e.originalEvent.changedTouches[0].pageY-window.pageYOffset)),f.is_drag?(e.target!==f.target&&g(f.target).off("click.vakata"),g.vakata.dnd._trigger("stop",e)):"touchend"===e.type&&e.target===f.target&&(t=setTimeout(function(){g(e.target).trigger("click")},100),g(e.target).one("click",function(){t&&clearTimeout(t)})),g.vakata.dnd._clean(),!1}},E.jstree.defaults.massload=null,E.jstree.plugins.massload=function(e,l){this.init=function(e,t){this._data.massload={},l.init.call(this,e,t)},this._load_nodes=function(a,n,o,d){var e,t,c,r=this.settings.massload,i=[],s=this._model.data;if(!o){for(e=0,t=a.length;e<t;e++)s[a[e]]&&(s[a[e]].state.loaded||s[a[e]].state.failed)&&!d||(i.push(a[e]),(c=this.get_node(a[e],!0))&&c.length&&c.addClass("jstree-loading").attr("aria-busy",!0));if(this._data.massload={},i.length){if("function"==typeof r)return r.call(this,i,E.proxy(function(e){var t,r;if(e)for(t in e)e.hasOwnProperty(t)&&(this._data.massload[t]=e[t]);for(t=0,r=a.length;t<r;t++)(c=this.get_node(a[t],!0))&&c.length&&c.removeClass("jstree-loading").attr("aria-busy",!1);l._load_nodes.call(this,a,n,o,d)},this));if("object"==typeof r&&r&&r.url)return"function"==typeof(r=E.extend(!0,{},r)).url&&(r.url=r.url.call(this,i)),"function"==typeof r.data&&(r.data=r.data.call(this,i)),E.ajax(r).done(E.proxy(function(e,t,r){var i,s;if(e)for(i in e)e.hasOwnProperty(i)&&(this._data.massload[i]=e[i]);for(i=0,s=a.length;i<s;i++)(c=this.get_node(a[i],!0))&&c.length&&c.removeClass("jstree-loading").attr("aria-busy",!1);l._load_nodes.call(this,a,n,o,d)},this)).fail(E.proxy(function(e){l._load_nodes.call(this,a,n,o,d)},this))}}return l._load_nodes.call(this,a,n,o,d)},this._load_node=function(e,t){var r,i=this._data.massload[e.id],s=null;return i?(s=this["string"==typeof i?"_append_html_data":"_append_json_data"](e,"string"==typeof i?E(E.parseHTML(i)).filter(function(){return 3!==this.nodeType}):i,function(e){t.call(this,e)}),(r=this.get_node(e.id,!0))&&r.length&&r.removeClass("jstree-loading").attr("aria-busy",!1),delete this._data.massload[e.id],s):l._load_node.call(this,e,t)}},E.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,show_only_matches_children:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},E.jstree.plugins.search=function(e,o){this.bind=function(){o.bind.call(this),this._data.search.str="",this._data.search.dom=E(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=!1,this._data.search.smc=!1,this._data.search.hdn=[],this.element.on("search.jstree",E.proxy(function(e,t){if(this._data.search.som&&t.res.length){for(var r,i,s=this._model.data,a=[],n=0,o=t.res.length;n<o;n++)if(s[t.res[n]]&&!s[t.res[n]].state.hidden&&(a.push(t.res[n]),a=a.concat(s[t.res[n]].parents),this._data.search.smc))for(r=0,i=s[t.res[n]].children_d.length;r<i;r++)s[s[t.res[n]].children_d[r]]&&!s[s[t.res[n]].children_d[r]].state.hidden&&a.push(s[t.res[n]].children_d[r]);a=E.vakata.array_remove_item(E.vakata.array_unique(a),E.jstree.root),this._data.search.hdn=this.hide_all(!0),this.show_node(a,!0),this.redraw(!0)}},this)).on("clear_search.jstree",E.proxy(function(e,t){this._data.search.som&&t.res.length&&(this.show_node(this._data.search.hdn,!0),this.redraw(!0))},this))},this.search=function(i,e,t,r,s,a){if(!1===i||""===i.toString().trim())return this.clear_search();r=(r=this.get_node(r))&&r.id?r.id:null,i=i.toString();var n,o,d=this.settings.search,c=!!d.ajax&&d.ajax,l=this._model.data,h=null,_=[],u=[];if(this._data.search.res.length&&!s&&this.clear_search(),t===P&&(t=d.show_only_matches),a===P&&(a=d.show_only_matches_children),!e&&!1!==c)return"function"==typeof c?c.call(this,i,E.proxy(function(e){e&&e.d&&(e=e.d),this._load_nodes(Array.isArray(e)?E.vakata.array_unique(e):[],function(){this.search(i,!0,t,r,s,a)})},this),r):((c=E.extend({},c)).data||(c.data={}),c.data.str=i,r&&(c.data.inside=r),this._data.search.lastRequest&&this._data.search.lastRequest.abort(),this._data.search.lastRequest=E.ajax(c).fail(E.proxy(function(){this._data.core.last_error={error:"ajax",plugin:"search",id:"search_01",reason:"Could not load search parents",data:JSON.stringify(c)},this.settings.core.error.call(this,this._data.core.last_error)},this)).done(E.proxy(function(e){e&&e.d&&(e=e.d),this._load_nodes(Array.isArray(e)?E.vakata.array_unique(e):[],function(){this.search(i,!0,t,r,s,a)})},this)),this._data.search.lastRequest);if(s||(this._data.search.str=i,this._data.search.dom=E(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=t,this._data.search.smc=a),h=new E.vakata.search(i,!0,{caseSensitive:d.case_sensitive,fuzzy:d.fuzzy}),E.each(l[r||E.jstree.root].children_d,function(e,t){var r=l[t];r.text&&!r.state.hidden&&(!d.search_leaves_only||r.state.loaded&&0===r.children.length)&&(d.search_callback&&d.search_callback.call(this,i,r)||!d.search_callback&&h.search(r.text).isMatch)&&(_.push(t),u=u.concat(r.parents))}),_.length){for(n=0,o=(u=E.vakata.array_unique(u)).length;n<o;n++)u[n]!==E.jstree.root&&l[u[n]]&&!0===this.open_node(u[n],null,0)&&this._data.search.opn.push(u[n]);s?(this._data.search.dom=this._data.search.dom.add(E(this.element[0].querySelectorAll("#"+E.map(_,function(e){return-1!=="0123456789".indexOf(e[0])?"\\3"+e[0]+" "+e.substr(1).replace(E.jstree.idregex,"\\$&"):e.replace(E.jstree.idregex,"\\$&")}).join(", #")))),this._data.search.res=E.vakata.array_unique(this._data.search.res.concat(_))):(this._data.search.dom=E(this.element[0].querySelectorAll("#"+E.map(_,function(e){return-1!=="0123456789".indexOf(e[0])?"\\3"+e[0]+" "+e.substr(1).replace(E.jstree.idregex,"\\$&"):e.replace(E.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.res=_),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search")}this.trigger("search",{nodes:this._data.search.dom,str:i,res:this._data.search.res,show_only_matches:t})},this.clear_search=function(){this.settings.search.close_opened_onclear&&this.close_node(this._data.search.opn,0),this.trigger("clear_search",{nodes:this._data.search.dom,str:this._data.search.str,res:this._data.search.res}),this._data.search.res.length&&(this._data.search.dom=E(this.element[0].querySelectorAll("#"+E.map(this._data.search.res,function(e){return-1!=="0123456789".indexOf(e[0])?"\\3"+e[0]+" "+e.substr(1).replace(E.jstree.idregex,"\\$&"):e.replace(E.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search")),this._data.search.str="",this._data.search.res=[],this._data.search.opn=[],this._data.search.dom=E()},this.redraw_node=function(e,t,r,i){if((e=o.redraw_node.apply(this,arguments))&&-1!==E.inArray(e.id,this._data.search.res)){for(var s=null,a=0,n=e.childNodes.length;a<n;a++)if(e.childNodes[a]&&e.childNodes[a].className&&-1!==e.childNodes[a].className.indexOf("jstree-anchor")){s=e.childNodes[a];break}s&&(s.className+=" jstree-search")}return e}},(w=E).vakata.search=function(p,e,m){m=m||{},!1!==(m=w.extend({},w.vakata.search.defaults,m)).fuzzy&&(m.fuzzy=!0),p=m.caseSensitive?p:p.toLowerCase();var v,j,y,t,k=m.location,s=m.distance,x=m.threshold,b=p.length;return 32<b&&(m.fuzzy=!1),m.fuzzy&&(v=1<<b-1,j=function(){for(var e={},t=0,t=0;t<b;t++)e[p.charAt(t)]=0;for(t=0;t<b;t++)e[p.charAt(t)]|=1<<b-t-1;return e}(),y=function(e,t){var r=e/b,i=Math.abs(k-t);return s?r+i/s:i?1:r}),t=function(e){if(e=m.caseSensitive?e:e.toLowerCase(),p===e||-1!==e.indexOf(p))return{isMatch:!0,score:0};if(!m.fuzzy)return{isMatch:!1,score:1};var t,r,i,s,a,n,o,d,c,l=e.length,h=x,_=e.indexOf(p,k),u=b+l,g=1,f=[];for(-1!==_&&(h=Math.min(y(0,_),h),-1!==(_=e.lastIndexOf(p,k+b))&&(h=Math.min(y(0,_),h))),_=-1,t=0;t<b;t++){for(i=0,s=u;i<s;)y(t,k+s)<=h?i=s:u=s,s=Math.floor((u-i)/2+i);for(u=s,n=Math.max(1,k-s+1),o=Math.min(k+s,l)+b,(d=new Array(o+2))[o+1]=(1<<t)-1,r=o;n<=r;r--)if(c=j[e.charAt(r-1)],d[r]=0===t?(d[r+1]<<1|1)&c:(d[r+1]<<1|1)&c|(a[r+1]|a[r])<<1|1|a[r+1],d[r]&v&&(g=y(t,r-1))<=h){if(h=g,_=r-1,f.push(_),!(k<_))break;n=Math.max(1,2*k-_)}if(y(t+1,k)>h)break;a=d}return{isMatch:0<=_,score:g}},!0===e?{search:t}:t(e)},w.vakata.search.defaults={location:0,distance:100,threshold:.6,fuzzy:!1,caseSensitive:!1},E.jstree.defaults.sort=function(e,t){return this.get_text(e)>this.get_text(t)?1:-1};var m=!(E.jstree.plugins.sort=function(e,t){this.bind=function(){t.bind.call(this),this.element.on("model.jstree",E.proxy(function(e,t){this.sort(t.parent,!0)},this)).on("rename_node.jstree create_node.jstree",E.proxy(function(e,t){this.sort(t.parent||t.node.parent,!1),this.redraw_node(t.parent||t.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",E.proxy(function(e,t){this.sort(t.parent,!1),this.redraw_node(t.parent,!0)},this))},this.sort=function(e,t){var r,i;if((e=this.get_node(e))&&e.children&&e.children.length&&(e.children.sort(E.proxy(this.settings.sort,this)),t))for(r=0,i=e.children_d.length;r<i;r++)this.sort(e.children_d[r],!1)}});E.jstree.defaults.state={key:"jstree",events:"changed.jstree open_node.jstree close_node.jstree check_node.jstree uncheck_node.jstree",ttl:!1,filter:!1,preserve_loaded:!1},E.jstree.plugins.state=function(e,t){this.bind=function(){t.bind.call(this);var r=E.proxy(function(){this.element.on(this.settings.state.events,E.proxy(function(){m&&clearTimeout(m),m=setTimeout(E.proxy(function(){this.save_state()},this),100)},this)),this.trigger("state_ready")},this);this.element.on("ready.jstree",E.proxy(function(e,t){this.element.one("restore_state.jstree",r),this.restore_state()||r()},this))},this.save_state=function(){var e=this.get_state();this.settings.state.preserve_loaded||delete e.core.loaded;var t={state:e,ttl:this.settings.state.ttl,sec:+new Date};E.vakata.storage.set(this.settings.state.key,JSON.stringify(t))},this.restore_state=function(){var r=E.vakata.storage.get(this.settings.state.key);if(r)try{r=JSON.parse(r)}catch(e){return!1}return!(r&&r.ttl&&r.sec&&new Date-r.sec>r.ttl)&&(r&&r.state&&(r=r.state),r&&"function"==typeof this.settings.state.filter&&(r=this.settings.state.filter.call(this,r)),!!r&&(this.settings.state.preserve_loaded||delete r.core.loaded,this.element.one("set_state.jstree",function(e,t){t.instance.trigger("restore_state",{state:E.extend(!0,{},r)})}),this.set_state(r),!0))},this.clear_state=function(){return E.vakata.storage.del(this.settings.state.key)}},E.vakata.storage={set:function(e,t){return window.localStorage.setItem(e,t)},get:function(e){return window.localStorage.getItem(e)},del:function(e){return window.localStorage.removeItem(e)}},E.jstree.defaults.types={default:{}},E.jstree.defaults.types[E.jstree.root]={},E.jstree.plugins.types=function(e,l){this.init=function(e,t){var r,i;if(t&&t.types&&t.types.default)for(r in t.types)if("default"!==r&&r!==E.jstree.root&&t.types.hasOwnProperty(r))for(i in t.types.default)t.types.default.hasOwnProperty(i)&&t.types[r][i]===P&&(t.types[r][i]=t.types.default[i]);l.init.call(this,e,t),this._model.data[E.jstree.root].type=E.jstree.root},this.refresh=function(e,t){l.refresh.call(this,e,t),this._model.data[E.jstree.root].type=E.jstree.root},this.bind=function(){this.element.on("model.jstree",E.proxy(function(e,t){for(var r,i=this._model.data,s=t.nodes,a=this.settings.types,n="default",o=0,d=s.length;o<d;o++){if(n="default",i[s[o]].original&&i[s[o]].original.type&&a[i[s[o]].original.type]&&(n=i[s[o]].original.type),i[s[o]].data&&i[s[o]].data.jstree&&i[s[o]].data.jstree.type&&a[i[s[o]].data.jstree.type]&&(n=i[s[o]].data.jstree.type),i[s[o]].type=n,!0===i[s[o]].icon&&a[n].icon!==P&&(i[s[o]].icon=a[n].icon),a[n].li_attr!==P&&"object"==typeof a[n].li_attr)for(r in a[n].li_attr)if(a[n].li_attr.hasOwnProperty(r)){if("id"===r)continue;i[s[o]].li_attr[r]===P?i[s[o]].li_attr[r]=a[n].li_attr[r]:"class"===r&&(i[s[o]].li_attr.class=a[n].li_attr.class+" "+i[s[o]].li_attr.class)}if(a[n].a_attr!==P&&"object"==typeof a[n].a_attr)for(r in a[n].a_attr)if(a[n].a_attr.hasOwnProperty(r)){if("id"===r)continue;i[s[o]].a_attr[r]===P?i[s[o]].a_attr[r]=a[n].a_attr[r]:"href"===r&&"#"===i[s[o]].a_attr[r]?i[s[o]].a_attr.href=a[n].a_attr.href:"class"===r&&(i[s[o]].a_attr.class=a[n].a_attr.class+" "+i[s[o]].a_attr.class)}}i[E.jstree.root].type=E.jstree.root},this)),l.bind.call(this)},this.get_json=function(e,t,r){var i,s,a=this._model.data,n=t?E.extend(!0,{},t,{no_id:!1}):{},o=l.get_json.call(this,e,n,r);if(!1===o)return!1;if(Array.isArray(o))for(i=0,s=o.length;i<s;i++)o[i].type=o[i].id&&a[o[i].id]&&a[o[i].id].type?a[o[i].id].type:"default",t&&t.no_id&&(delete o[i].id,o[i].li_attr&&o[i].li_attr.id&&delete o[i].li_attr.id,o[i].a_attr&&o[i].a_attr.id&&delete o[i].a_attr.id);else o.type=o.id&&a[o.id]&&a[o.id].type?a[o.id].type:"default",t&&t.no_id&&(o=this._delete_ids(o));return o},this._delete_ids=function(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)e[t]=this._delete_ids(e[t]);return e}return delete e.id,e.li_attr&&e.li_attr.id&&delete e.li_attr.id,e.a_attr&&e.a_attr.id&&delete e.a_attr.id,e.children&&Array.isArray(e.children)&&(e.children=this._delete_ids(e.children)),e},this.check=function(e,t,r,i,s){if(!1===l.check.call(this,e,t,r,i,s))return!1;t=t&&t.id?t:this.get_node(t),r=r&&r.id?r:this.get_node(r);var a,n,o,d,c=(c=t&&t.id?s&&s.origin?s.origin:E.jstree.reference(t.id):null)&&c._model&&c._model.data?c._model.data:null;switch(e){case"create_node":case"move_node":case"copy_node":if("move_node"!==e||-1===E.inArray(t.id,r.children)){if((a=this.get_rules(r)).max_children!==P&&-1!==a.max_children&&a.max_children===r.children.length)return!(this._data.core.last_error={error:"check",plugin:"types",id:"types_01",reason:"max_children prevents function: "+e,data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!r||!r.id)&&r.id})});if(a.valid_children!==P&&-1!==a.valid_children&&-1===E.inArray(t.type||"default",a.valid_children))return!(this._data.core.last_error={error:"check",plugin:"types",id:"types_02",reason:"valid_children prevents function: "+e,data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!r||!r.id)&&r.id})});if(c&&t.children_d&&t.parents){for(o=n=0,d=t.children_d.length;o<d;o++)n=Math.max(n,c[t.children_d[o]].parents.length);n=n-t.parents.length+1}(n<=0||n===P)&&(n=1);do{if(a.max_depth!==P&&-1!==a.max_depth&&a.max_depth<n)return!(this._data.core.last_error={error:"check",plugin:"types",id:"types_03",reason:"max_depth prevents function: "+e,data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!r||!r.id)&&r.id})});r=this.get_node(r.parent),a=this.get_rules(r),n++}while(r)}}return!0},this.get_rules=function(e){if(!(e=this.get_node(e)))return!1;var t=this.get_type(e,!0);return t.max_depth===P&&(t.max_depth=-1),t.max_children===P&&(t.max_children=-1),t.valid_children===P&&(t.valid_children=-1),t},this.get_type=function(e,t){return!!(e=this.get_node(e))&&(t?E.extend({type:e.type},this.settings.types[e.type]):e.type)},this.set_type=function(e,t){var r,i,s,a,n,o,d,c,l=this._model.data;if(Array.isArray(e)){for(i=0,s=(e=e.slice()).length;i<s;i++)this.set_type(e[i],t);return!0}if(r=this.settings.types,e=this.get_node(e),!r[t]||!e)return!1;if((d=this.get_node(e,!0))&&d.length&&(c=d.children(".jstree-anchor")),a=e.type,n=this.get_icon(e),e.type=t,!0!==n&&r[a]&&(r[a].icon===P||n!==r[a].icon)||this.set_icon(e,r[t].icon===P||r[t].icon),r[a]&&r[a].li_attr!==P&&"object"==typeof r[a].li_attr)for(o in r[a].li_attr)if(r[a].li_attr.hasOwnProperty(o)){if("id"===o)continue;"class"===o?(l[e.id].li_attr.class=(l[e.id].li_attr.class||"").replace(r[a].li_attr[o],""),d&&d.removeClass(r[a].li_attr[o])):l[e.id].li_attr[o]===r[a].li_attr[o]&&(l[e.id].li_attr[o]=null,d&&d.removeAttr(o))}if(r[a]&&r[a].a_attr!==P&&"object"==typeof r[a].a_attr)for(o in r[a].a_attr)if(r[a].a_attr.hasOwnProperty(o)){if("id"===o)continue;"class"===o?(l[e.id].a_attr.class=(l[e.id].a_attr.class||"").replace(r[a].a_attr[o],""),c&&c.removeClass(r[a].a_attr[o])):l[e.id].a_attr[o]===r[a].a_attr[o]&&("href"===o?(l[e.id].a_attr[o]="#",c&&c.attr("href","#")):(delete l[e.id].a_attr[o],c&&c.removeAttr(o)))}if(r[t].li_attr!==P&&"object"==typeof r[t].li_attr)for(o in r[t].li_attr)if(r[t].li_attr.hasOwnProperty(o)){if("id"===o)continue;l[e.id].li_attr[o]===P?(l[e.id].li_attr[o]=r[t].li_attr[o],d&&("class"===o?d.addClass(r[t].li_attr[o]):d.attr(o,r[t].li_attr[o]))):"class"===o&&(l[e.id].li_attr.class=r[t].li_attr[o]+" "+l[e.id].li_attr.class,d&&d.addClass(r[t].li_attr[o]))}if(r[t].a_attr!==P&&"object"==typeof r[t].a_attr)for(o in r[t].a_attr)if(r[t].a_attr.hasOwnProperty(o)){if("id"===o)continue;l[e.id].a_attr[o]===P?(l[e.id].a_attr[o]=r[t].a_attr[o],c&&("class"===o?c.addClass(r[t].a_attr[o]):c.attr(o,r[t].a_attr[o]))):"href"===o&&"#"===l[e.id].a_attr[o]?(l[e.id].a_attr.href=r[t].a_attr.href,c&&c.attr("href",r[t].a_attr.href)):"class"===o&&(l[e.id].a_attr.class=r[t].a_attr.class+" "+l[e.id].a_attr.class,c&&c.addClass(r[t].a_attr[o]))}return!0}},E.jstree.defaults.unique={case_sensitive:!1,trim_whitespace:!1,duplicate:function(e,t){return e+" ("+t+")"}},E.jstree.plugins.unique=function(e,f){this.check=function(e,t,r,i,s){if(!1===f.check.call(this,e,t,r,i,s))return!1;if(t=t&&t.id?t:this.get_node(t),!(r=r&&r.id?r:this.get_node(r))||!r.children)return!0;for(var a,n="rename_node"===e?i:t.text,o=[],d=this.settings.unique.case_sensitive,c=this.settings.unique.trim_whitespace,l=this._model.data,h=0,_=r.children.length;h<_;h++)a=l[r.children[h]].text,d||(a=a.toLowerCase()),c&&(a=a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),o.push(a);switch(d||(n=n.toLowerCase()),c&&(n=n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),e){case"delete_node":return!0;case"rename_node":return a=t.text||"",d||(a=a.toLowerCase()),c&&(a=a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),(h=-1===E.inArray(n,o)||t.text&&a===n)||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_01",reason:"Child with name "+n+" already exists. Preventing: "+e,data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!r||!r.id)&&r.id})}),h;case"create_node":return(h=-1===E.inArray(n,o))||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_04",reason:"Child with name "+n+" already exists. Preventing: "+e,data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!r||!r.id)&&r.id})}),h;case"copy_node":return(h=-1===E.inArray(n,o))||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_02",reason:"Child with name "+n+" already exists. Preventing: "+e,data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!r||!r.id)&&r.id})}),h;case"move_node":return(h=t.parent===r.id&&(!s||!s.is_multi)||-1===E.inArray(n,o))||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_03",reason:"Child with name "+n+" already exists. Preventing: "+e,data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!r||!r.id)&&r.id})}),h}return!0},this.create_node=function(e,t,r,i,s){if(!t||t.text===P){if(null===e&&(e=E.jstree.root),!(e=this.get_node(e)))return f.create_node.call(this,e,t,r,i,s);if(!(r=r===P?"last":r).toString().match(/^(before|after)$/)&&!s&&!this.is_loaded(e))return f.create_node.call(this,e,t,r,i,s);t=t||{};for(var a,n,o=this._model.data,d=this.settings.unique.case_sensitive,c=this.settings.unique.trim_whitespace,l=this.settings.unique.duplicate,h=a=this.get_string("New node"),_=[],u=0,g=e.children.length;u<g;u++)n=o[e.children[u]].text,d||(n=n.toLowerCase()),c&&(n=n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),_.push(n);for(u=1,n=h,d||(n=n.toLowerCase()),c&&(n=n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""));-1!==E.inArray(n,_);)n=h=l.call(this,a,++u).toString(),d||(n=n.toLowerCase()),c&&(n=n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""));t.text=h}return f.create_node.call(this,e,t,r,i,s)}};var v=y.createElement("DIV");if(v.setAttribute("unselectable","on"),v.setAttribute("role","presentation"),v.className="jstree-wholerow",v.innerHTML=" ",E.jstree.plugins.wholerow=function(e,a){this.bind=function(){a.bind.call(this),this.element.on("ready.jstree set_state.jstree",E.proxy(function(){this.hide_dots()},this)).on("init.jstree loading.jstree ready.jstree",E.proxy(function(){this.get_container_ul().addClass("jstree-wholerow-ul")},this)).on("deselect_all.jstree",E.proxy(function(e,t){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).on("changed.jstree",E.proxy(function(e,t){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked");for(var r=!1,i=0,s=t.selected.length;i<s;i++)(r=this.get_node(t.selected[i],!0))&&r.length&&r.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("open_node.jstree",E.proxy(function(e,t){this.get_node(t.node,!0).find(".jstree-clicked").parent().children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("hover_node.jstree dehover_node.jstree",E.proxy(function(e,t){"hover_node"===e.type&&this.is_disabled(t.node)||this.get_node(t.node,!0).children(".jstree-wholerow")["hover_node"===e.type?"addClass":"removeClass"]("jstree-wholerow-hovered")},this)).on("contextmenu.jstree",".jstree-wholerow",E.proxy(function(e){var t;this._data.contextmenu&&(e.preventDefault(),t=E.Event("contextmenu",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,pageX:e.pageX,pageY:e.pageY}),E(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(t))},this)).on("click.jstree",".jstree-wholerow",function(e){e.stopImmediatePropagation();var t=E.Event("click",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey});E(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(t).focus()}).on("dblclick.jstree",".jstree-wholerow",function(e){e.stopImmediatePropagation();var t=E.Event("dblclick",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey});E(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(t).focus()}).on("click.jstree",".jstree-leaf > .jstree-ocl",E.proxy(function(e){e.stopImmediatePropagation();var t=E.Event("click",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey});E(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(t).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",E.proxy(function(e){return e.stopImmediatePropagation(),this.is_disabled(e.currentTarget)||this.hover_node(e.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",E.proxy(function(e){this.dehover_node(e.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),a.teardown.call(this)},this.redraw_node=function(e,t,r,i){var s;return(e=a.redraw_node.apply(this,arguments))&&(s=v.cloneNode(!0),-1!==E.inArray(e.id,this._data.core.selected)&&(s.className+=" jstree-wholerow-clicked"),this._data.core.focused&&this._data.core.focused===e.id&&(s.className+=" jstree-wholerow-hovered"),e.insertBefore(s,e.childNodes[0])),e}},window.customElements&&Object&&Object.create){var t=Object.create(HTMLElement.prototype);t.createdCallback=function(){var e,t={core:{},plugins:[]};for(e in E.jstree.plugins)E.jstree.plugins.hasOwnProperty(e)&&this.attributes[e]&&(t.plugins.push(e),this.getAttribute(e)&&JSON.parse(this.getAttribute(e))&&(t[e]=JSON.parse(this.getAttribute(e))));for(e in E.jstree.defaults.core)E.jstree.defaults.core.hasOwnProperty(e)&&this.attributes[e]&&(t.core[e]=JSON.parse(this.getAttribute(e))||this.getAttribute(e));E(this).jstree(t)};try{window.customElements.define("vakata-jstree",function(){},{prototype:t})}catch(e){}}}});