Файловый менеджер - Редактировать - /home/lmsyaran/public_html/media/com_phocacart/js/jstree/jstree.min.js
Назад
/*! jsTree - v3.3.9 - 2015-05-04 - (MIT) */ !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,t){"use strict";if(!e.jstree){var i=0,r=!1,s=!1,n=!1,a=[],d=e("script:last").attr("src"),o=window.document,l=window.setImmediate,c=window.Promise;!l&&c&&(l=function(e,t){c.resolve(t).then(e)}),e.jstree={version:"{{VERSION}}",defaults:{plugins:[]},plugins:{},path:d&&-1!==d.indexOf("/")?d.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g,root:"#"},e.jstree.create=function(t,r){var s=new e.jstree.core(++i),n=r;return r=e.extend(!0,{},e.jstree.defaults,r),n&&n.plugins&&(r.plugins=n.plugins),e.each(r.plugins,function(e,t){"core"!==e&&(s=s.plugin(t,r[t]))}),e(t).data("jstree",s),s.init(t,r),s},e.jstree.destroy=function(){e(".jstree:jstree").jstree("destroy"),e(o).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 i=null,r=null;if(!t||!t.id||t.tagName&&t.nodeType||(t=t.id),!r||!r.length)try{r=e(t)}catch(e){}if(!r||!r.length)try{r=e("#"+t.replace(e.jstree.idregex,"\\$&"))}catch(e){}return r&&r.length&&(r=r.closest(".jstree")).length&&(r=r.data("jstree"))?i=r:e(".jstree").each(function(){var r=e(this).data("jstree");if(r&&r._model.data[t])return i=r,!1}),i},e.fn.jstree=function(i){var r="string"==typeof i,s=Array.prototype.slice.call(arguments,1),n=null;return!(!0===i&&!this.length)&&(this.each(function(){var a=e.jstree.reference(this),d=r&&a?a[i]:null;if(n=r&&d?d.apply(a,s):null,a||r||i!==t&&!e.isPlainObject(i)||e.jstree.create(this,i),(a&&!r||!0===i)&&(n=a||!1),null!==n&&n!==t)return!1}),null!==n&&n!==t?n:this)},e.expr.pseudos.jstree=e.expr.createPseudo(function(i){return function(i){return e(i).hasClass("jstree")&&e(i).data("jstree")!==t}}),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(t){t.type="click",e(t.currentTarget).trigger(t)},enter:function(t){t.type="click",e(t.currentTarget).trigger(t)},left:function(t){if(t.preventDefault(),this.is_open(t.currentTarget))this.close_node(t.currentTarget);else{var i=this.get_parent(t.currentTarget);i&&i.id!==e.jstree.root&&this.get_node(i,!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(t){if(t.preventDefault(),this.is_closed(t.currentTarget))this.open_node(t.currentTarget,function(e){this.get_node(e,!0).children(".jstree-anchor").focus()});else if(this.is_open(t.currentTarget)){var i=this.get_node(t.currentTarget,!0).children(".jstree-children")[0];i&&e(this._firstChild(i)).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(t){t.preventDefault();var i=this._firstChild(this.get_container_ul()[0]);i&&e(i).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(t,i){var r=e.jstree.plugins[t];return r?(this._data[t]={},r.prototype=this,new r(i,this)):this},init:function(t,i){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(t).addClass("jstree jstree-"+this._id),this.settings=i,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='treeitem'><i class='jstree-icon jstree-ocl'></i><a class='jstree-anchor' 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,i=o.createElement("LI");return i.setAttribute("role","treeitem"),(e=o.createElement("I")).className="jstree-icon jstree-ocl",e.setAttribute("role","presentation"),i.appendChild(e),(e=o.createElement("A")).className="jstree-anchor",e.setAttribute("href","#"),e.setAttribute("tabindex","-1"),(t=o.createElement("I")).className="jstree-icon jstree-themeicon",t.setAttribute("role","presentation"),e.appendChild(t),i.appendChild(e),e=t=null,i},_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 i,r,s=this.settings.core.keyboard;for(i in s)if(s.hasOwnProperty(i)&&("-"!==(r=i)&&"+"!==r&&(r=(r=r.replace("--","-MINUS").replace("+-","-MINUS").replace("++","-PLUS").replace("-+","-PLUS")).split(/-|\+/).sort().join("-").replace("MINUS","-").replace("PLUS","+").toLowerCase()),r===t))return s[i];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 t="",i=null,r=0;this.element.on("dblclick.jstree",function(e){if(e.target.tagName&&"input"===e.target.tagName.toLowerCase())return!0;if(o.selection&&o.selection.empty)o.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(),r=+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){if(e.target.tagName&&"input"===e.target.tagName.toLowerCase())return!0;this.settings.core.dblclick_toggle&&this.toggle_node(e.target)},this)).on("click.jstree",".jstree-anchor",e.proxy(function(t){t.preventDefault(),t.currentTarget!==o.activeElement&&e(t.currentTarget).focus(),this.activate_node(t.currentTarget,t)},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 i=t.call(this,e);if(!1===i||!0===i)return i}},this)).on("load_node.jstree",e.proxy(function(t,i){i.status&&(i.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){var t,i,r=[];for(t=0,i=this._data.core.selected.length;t<i;t++)r=r.concat(this._model.data[this._data.core.selected[t]].parents);for(t=0,i=(r=e.vakata.array_unique(r)).length;t<i;t++)this.open_node(r[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(r){if(r.target.tagName&&"input"===r.target.tagName.toLowerCase())return!0;i&&clearTimeout(i),i=setTimeout(function(){t=""},500);var s=String.fromCharCode(r.which).toLowerCase(),n=this.element.find(".jstree-anchor").filter(":visible"),a=n.index(o.activeElement)||0,d=!1;if((t+=s).length>1){if(n.slice(a).each(e.proxy(function(i,r){if(0===e(r).text().toLowerCase().indexOf(t))return e(r).focus(),d=!0,!1},this)),d)return;if(n.slice(0,a).each(e.proxy(function(i,r){if(0===e(r).text().toLowerCase().indexOf(t))return e(r).focus(),d=!0,!1},this)),d)return}if(new RegExp("^"+s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"+$").test(t)){if(n.slice(a+1).each(e.proxy(function(t,i){if(e(i).text().toLowerCase().charAt(0)===s)return e(i).focus(),d=!0,!1},this)),d)return;if(n.slice(0,a+1).each(e.proxy(function(t,i){if(e(i).text().toLowerCase().charAt(0)===s)return e(i).focus(),d=!0,!1},this)),d)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(t){this._data.core.focused=null,e(t.currentTarget).filter(".jstree-hovered").trigger("mouseleave"),this.element.attr("tabindex","0")},this)).on("focus.jstree",".jstree-anchor",e.proxy(function(t){var i=this.get_node(t.currentTarget);i&&i.id&&(this._data.core.focused=i.id),this.element.find(".jstree-hovered").not(t.currentTarget).trigger("mouseleave"),e(t.currentTarget).trigger("mouseenter"),this.element.attr("tabindex","-1")},this)).on("focus.jstree",e.proxy(function(){if(+new Date-r>500&&!this._data.core.focused&&this.settings.core.restore_focus){r=0;var e=this.get_node(this.element.attr("aria-activedescendant"),!0);e&&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(o).off(".jstree-"+this._id)},trigger:function(e,t){t||(t={}),t.instance=this,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(t){var i=this.settings.core.strings;return e.isFunction(i)?i.call(this,t):i&&i[t]?i[t]:t},_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(t,i){var r;t&&t.id&&(t=t.id),t instanceof e&&t.length&&t[0].id&&(t=t[0].id);try{if(this._model.data[t])t=this._model.data[t];else if("string"==typeof t&&this._model.data[t.replace(/^#/,"")])t=this._model.data[t.replace(/^#/,"")];else if("string"==typeof t&&(r=e("#"+t.replace(e.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[r.closest(".jstree-node").attr("id")])t=this._model.data[r.closest(".jstree-node").attr("id")];else if((r=this.element.find(t)).length&&this._model.data[r.closest(".jstree-node").attr("id")])t=this._model.data[r.closest(".jstree-node").attr("id")];else{if(!(r=this.element.find(t)).length||!r.hasClass("jstree"))return!1;t=this._model.data[e.jstree.root]}return i&&(t=t.id===e.jstree.root?this.element:e("#"+t.id.replace(e.jstree.idregex,"\\$&"),this.element)),t}catch(e){return!1}},get_path:function(t,i,r){if(!(t=t.parents?t:this.get_node(t))||t.id===e.jstree.root||!t.parents)return!1;var s,n,a=[];for(a.push(r?t.id:t.text),s=0,n=t.parents.length;s<n;s++)a.push(r?t.parents[s]:this.get_text(t.parents[s]));return a=a.reverse().slice(1),i?a.join(i):a},get_next_dom:function(t,i){var r;if((t=this.get_node(t,!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(!t||!t.length)return!1;if(i){r=t[0];do{r=this._nextSibling(r)}while(r&&0===r.offsetHeight);return!!r&&e(r)}if(t.hasClass("jstree-open")){for(r=this._firstChild(t.children(".jstree-children")[0]);r&&0===r.offsetHeight;)r=this._nextSibling(r);if(null!==r)return e(r)}r=t[0];do{r=this._nextSibling(r)}while(r&&0===r.offsetHeight);return null!==r?e(r):t.parentsUntil(".jstree",".jstree-node").nextAll(".jstree-node:visible").first()},get_prev_dom:function(t,i){var r;if((t=this.get_node(t,!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(!t||!t.length)return!1;if(i){r=t[0];do{r=this._previousSibling(r)}while(r&&0===r.offsetHeight);return!!r&&e(r)}r=t[0];do{r=this._previousSibling(r)}while(r&&0===r.offsetHeight);if(null!==r){for(t=e(r);t.hasClass("jstree-open");)t=t.children(".jstree-children").first().children(".jstree-node:visible:last");return t}return!(!(r=t[0].parentNode.parentNode)||!r.className||-1===r.className.indexOf("jstree-node"))&&e(r)},get_parent:function(t){return!(!(t=this.get_node(t))||t.id===e.jstree.root)&&t.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||e.children.length>0)},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(t,i){var r,s,n,a,d;if(e.isArray(t))return this._load_nodes(t.slice(),i),!0;if(!(t=this.get_node(t)))return i&&i.call(this,t,!1),!1;if(t.state.loaded){for(t.state.loaded=!1,n=0,a=t.parents.length;n<a;n++)this._model.data[t.parents[n]].children_d=e.vakata.array_filter(this._model.data[t.parents[n]].children_d,function(i){return-1===e.inArray(i,t.children_d)});for(r=0,s=t.children_d.length;r<s;r++)this._model.data[t.children_d[r]].state.selected&&(d=!0),delete this._model.data[t.children_d[r]];d&&(this._data.core.selected=e.vakata.array_filter(this._data.core.selected,function(i){return-1===e.inArray(i,t.children_d)})),t.children=[],t.children_d=[],d&&this.trigger("changed",{action:"load_node",node:t,selected:this._data.core.selected})}return t.state.failed=!1,t.state.loading=!0,this.get_node(t,!0).addClass("jstree-loading").attr("aria-busy",!0),this._load_node(t,e.proxy(function(e){(t=this._model.data[t.id]).state.loading=!1,t.state.loaded=e,t.state.failed=!t.state.loaded;var r,s=this.get_node(t,!0),n=0,a=this._model.data,d=!1;for(n=0,r=t.children.length;n<r;n++)if(a[t.children[n]]&&!a[t.children[n]].state.hidden){d=!0;break}t.state.loaded&&s&&s.length&&(s.removeClass("jstree-closed jstree-open jstree-leaf"),d?"#"!==t.id&&s.addClass(t.state.opened?"jstree-open":"jstree-closed"):s.addClass("jstree-leaf")),s.removeClass("jstree-loading").attr("aria-busy",!1),this.trigger("load_node",{node:t,status:e}),i&&i.call(this,t,e)},this)),!0},_load_nodes:function(e,t,i,r){var s,n,a=!0,d=function(){this._load_nodes(e,t,!0)},o=this._model.data,l=[];for(s=0,n=e.length;s<n;s++)o[e[s]]&&(!o[e[s]].state.loaded&&!o[e[s]].state.failed||!i&&r)&&(this.is_loading(e[s])||this.load_node(e[s],d),a=!1);if(a){for(s=0,n=e.length;s<n;s++)o[e[s]]&&o[e[s]].state.loaded&&l.push(e[s]);t&&!t.done&&(t.call(this,l),t.done=!0)}},load_all:function(t,i){if(t||(t=e.jstree.root),!(t=this.get_node(t)))return!1;var r,s,n=[],a=this._model.data,d=a[t.id].children_d;for(t.state&&!t.state.loaded&&n.push(t.id),r=0,s=d.length;r<s;r++)a[d[r]]&&a[d[r]].state&&!a[d[r]].state.loaded&&n.push(d[r]);n.length?this._load_nodes(n,function(){this.load_all(t,i)}):(i&&i.call(this,t),this.trigger("load_all",{node:t}))},_load_node:function(t,i){var r,s=this.settings.core.data,n=function(){return 3!==this.nodeType&&8!==this.nodeType};return s?e.isFunction(s)?s.call(this,t,e.proxy(function(r){!1===r?i.call(this,!1):this["string"==typeof r?"_append_html_data":"_append_json_data"](t,"string"==typeof r?e(e.parseHTML(r)).filter(n):r,function(e){i.call(this,e)})},this)):"object"==typeof s?s.url?(s=e.extend(!0,{},s),e.isFunction(s.url)&&(s.url=s.url.call(this,t)),e.isFunction(s.data)&&(s.data=s.data.call(this,t)),e.ajax(s).done(e.proxy(function(r,s,a){var d=a.getResponseHeader("Content-Type");return d&&-1!==d.indexOf("json")||"object"==typeof r?this._append_json_data(t,r,function(e){i.call(this,e)}):d&&-1!==d.indexOf("html")||"string"==typeof r?this._append_html_data(t,e(e.parseHTML(r)).filter(n),function(e){i.call(this,e)}):(this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:t.id,xhr:a})},this.settings.core.error.call(this,this._data.core.last_error),i.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:t.id,xhr:e})},i.call(this,!1),this.settings.core.error.call(this,this._data.core.last_error)},this))):(r=e.isArray(s)?e.extend(!0,[],s):e.isPlainObject(s)?e.extend(!0,{},s):s,t.id===e.jstree.root?this._append_json_data(t,r,function(e){i.call(this,e)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_05",reason:"Could not load node",data:JSON.stringify({id:t.id})},this.settings.core.error.call(this,this._data.core.last_error),i.call(this,!1))):"string"==typeof s?t.id===e.jstree.root?this._append_html_data(t,e(e.parseHTML(s)).filter(n),function(e){i.call(this,e)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_06",reason:"Could not load node",data:JSON.stringify({id:t.id})},this.settings.core.error.call(this,this._data.core.last_error),i.call(this,!1)):i.call(this,!1):t.id===e.jstree.root?this._append_html_data(t,this._data.core.original_container_html.clone(!0),function(e){i.call(this,e)}):i.call(this,!1)},_node_changed:function(t){(t=this.get_node(t))&&-1===e.inArray(t.id,this._model.changed)&&this._model.changed.push(t.id)},_append_html_data:function(t,i,r){(t=this.get_node(t)).children=[],t.children_d=[];var s,n,a,d=i.is("ul")?i.children():i,o=t.id,l=[],c=[],h=this._model.data,_=h[o],f=this._data.core.selected.length;for(d.each(e.proxy(function(t,i){(s=this._parse_model_from_html(e(i),o,_.parents.concat()))&&(l.push(s),c.push(s),h[s].children_d.length&&(c=c.concat(h[s].children_d)))},this)),_.children=l,_.children_d=c,n=0,a=_.parents.length;n<a;n++)h[_.parents[n]].children_d=h[_.parents[n]].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!==f&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),r.call(this,!0)},_append_json_data:function(t,i,r,s){if(null!==this.element){(t=this.get_node(t)).children=[],t.children_d=[],i.d&&"string"==typeof(i=i.d)&&(i=JSON.parse(i)),e.isArray(i)||(i=[i]);var n=null,a={df:this._model.default_state,dat:i,par:t.id,m:this._model.data,t_id:this._id,t_cnt:this._cnt,sel:this._data.core.selected},d=this,o=function(e,t){e.data&&(e=e.data);var i,r,s,n,a=e.dat,o=e.par,l=[],c=[],h=[],_=e.df,f=e.t_id,u=e.t_cnt,g=e.m,p=g[o],m=e.sel,j=function(e,i,r){r=r?r.concat():[],i&&r.unshift(i);var s,n,a,d,o=e.id.toString(),l={id:o,text:e.text||"",icon:e.icon===t||e.icon,parent:i,parents:r,children:e.children||[],children_d:e.children_d||[],data:e.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(s in _)_.hasOwnProperty(s)&&(l.state[s]=_[s]);if(e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(l.icon=e.data.jstree.icon),l.icon!==t&&null!==l.icon&&""!==l.icon||(l.icon=!0),e&&e.data&&(l.data=e.data,e.data.jstree))for(s in e.data.jstree)e.data.jstree.hasOwnProperty(s)&&(l.state[s]=e.data.jstree[s]);if(e&&"object"==typeof e.state)for(s in e.state)e.state.hasOwnProperty(s)&&(l.state[s]=e.state[s]);if(e&&"object"==typeof e.li_attr)for(s in e.li_attr)e.li_attr.hasOwnProperty(s)&&(l.li_attr[s]=e.li_attr[s]);if(l.li_attr.id||(l.li_attr.id=o),e&&"object"==typeof e.a_attr)for(s in e.a_attr)e.a_attr.hasOwnProperty(s)&&(l.a_attr[s]=e.a_attr[s]);for(e&&e.children&&!0===e.children&&(l.state.loaded=!1,l.children=[],l.children_d=[]),g[l.id]=l,s=0,n=l.children.length;s<n;s++)a=j(g[l.children[s]],l.id,r),d=g[a],l.children_d.push(a),d.children_d.length&&(l.children_d=l.children_d.concat(d.children_d));return delete e.data,delete e.children,g[l.id].original=e,l.state.selected&&h.push(l.id),l.id},y=function(e,i,r){r=r?r.concat():[],i&&r.unshift(i);var s,n,a,d,o,l=!1;do{l="j"+f+"_"+ ++u}while(g[l]);for(s in o={id:!1,text:"string"==typeof e?e:"",icon:"object"!=typeof e||e.icon===t||e.icon,parent:i,parents:r,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},_)_.hasOwnProperty(s)&&(o.state[s]=_[s]);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!==t&&null!==o.icon&&""!==o.icon||(o.icon=!0),e&&e.data&&(o.data=e.data,e.data.jstree))for(s in e.data.jstree)e.data.jstree.hasOwnProperty(s)&&(o.state[s]=e.data.jstree[s]);if(e&&"object"==typeof e.state)for(s in e.state)e.state.hasOwnProperty(s)&&(o.state[s]=e.state[s]);if(e&&"object"==typeof e.li_attr)for(s in e.li_attr)e.li_attr.hasOwnProperty(s)&&(o.li_attr[s]=e.li_attr[s]);if(o.li_attr.id&&!o.id&&(o.id=o.li_attr.id.toString()),o.id||(o.id=l),o.li_attr.id||(o.li_attr.id=o.id),e&&"object"==typeof e.a_attr)for(s in e.a_attr)e.a_attr.hasOwnProperty(s)&&(o.a_attr[s]=e.a_attr[s]);if(e&&e.children&&e.children.length){for(s=0,n=e.children.length;s<n;s++)a=y(e.children[s],o.id,r),d=g[a],o.children.push(a),d.children_d.length&&(o.children_d=o.children_d.concat(d.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,o.state.selected&&h.push(o.id),o.id};if(a.length&&a[0].id!==t&&a[0].parent!==t){for(r=0,s=a.length;r<s;r++)a[r].children||(a[r].children=[]),a[r].state||(a[r].state={}),g[a[r].id.toString()]=a[r];for(r=0,s=a.length;r<s;r++)g[a[r].parent.toString()]?(g[a[r].parent.toString()].children.push(a[r].id.toString()),p.children_d.push(a[r].id.toString())):void 0!==d&&(d._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()})},d.settings.core.error.call(d,d._data.core.last_error));for(r=0,s=p.children.length;r<s;r++)i=j(g[p.children[r]],o,p.parents.concat()),c.push(i),g[i].children_d.length&&(c=c.concat(g[i].children_d));for(r=0,s=p.parents.length;r<s;r++)g[p.parents[r]].children_d=g[p.parents[r]].children_d.concat(c);n={cnt:u,mod:g,sel:m,par:o,dpc:c,add:h}}else{for(r=0,s=a.length;r<s;r++)(i=y(a[r],o,p.parents.concat()))&&(l.push(i),c.push(i),g[i].children_d.length&&(c=c.concat(g[i].children_d)));for(p.children=l,p.children_d=c,r=0,s=p.parents.length;r<s;r++)g[p.parents[r]].children_d=g[p.parents[r]].children_d.concat(c);n={cnt:u,mod:g,sel:m,par:o,dpc:c,add:h}}if("undefined"!=typeof window&&void 0!==window.document)return n;postMessage(n)},c=function(t,i){if(null!==this.element){this._cnt=t.cnt;var s,n=this._model.data;for(s in n)n.hasOwnProperty(s)&&n[s].state&&n[s].state.loading&&t.mod[s]&&(t.mod[s].state.loading=!0);if(this._model.data=t.mod,i){var a,o=t.add,c=t.sel,h=this._data.core.selected.slice();if(n=this._model.data,c.length!==h.length||e.vakata.array_unique(c.concat(h)).length!==c.length){for(s=0,a=c.length;s<a;s++)-1===e.inArray(c[s],o)&&-1===e.inArray(c[s],h)&&(n[c[s]].state.selected=!1);for(s=0,a=h.length;s<a;s++)-1===e.inArray(h[s],c)&&(n[h[s]].state.selected=!0)}}t.add.length&&(this._data.core.selected=this._data.core.selected.concat(t.add)),this.trigger("model",{nodes:t.dpc,parent:t.par}),t.par!==e.jstree.root?(this._node_changed(t.par),this.redraw()):this.redraw(!0),t.add.length&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),!i&&l?l(function(){r.call(d,!0)}):r.call(d,!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 = "+o.toString()],{type:"text/javascript"}))),!this._data.core.working||s?(this._data.core.working=!0,(n=new window.Worker(this._wrk)).onmessage=e.proxy(function(e){c.call(this,e.data,!0);try{n.terminate(),n=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),a.par?n.postMessage(a):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([t,i,r,!0])}catch(e){c.call(this,o(a),!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 c.call(this,o(a),!1)}},_parse_model_from_html:function(i,r,s){s=s?[].concat(s):[],r&&s.unshift(r);var n,a,d,o,l,c=this._model.data,h={id:!1,text:!1,icon:!0,parent:r,parents:s,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(d in this._model.default_state)this._model.default_state.hasOwnProperty(d)&&(h.state[d]=this._model.default_state[d]);if(o=e.vakata.attributes(i,!0),e.each(o,function(t,i){if(!(i=e.trim(i)).length)return!0;h.li_attr[t]=i,"id"===t&&(h.id=i.toString())}),(o=i.children("a").first()).length&&(o=e.vakata.attributes(o,!0),e.each(o,function(t,i){(i=e.trim(i)).length&&(h.a_attr[t]=i)})),(o=i.children("a").first().length?i.children("a").first().clone():i.clone()).children("ins, i, ul").remove(),o=o.html(),o=e("<div />").html(o),h.text=this.settings.core.force_text?o.text():o.html(),o=i.data(),h.data=o?e.extend(!0,{},o):null,h.state.opened=i.hasClass("jstree-open"),h.state.selected=i.children("a").hasClass("jstree-clicked"),h.state.disabled=i.children("a").hasClass("jstree-disabled"),h.data&&h.data.jstree)for(d in h.data.jstree)h.data.jstree.hasOwnProperty(d)&&(h.state[d]=h.data.jstree[d]);(o=i.children("a").children(".jstree-themeicon")).length&&(h.icon=!o.hasClass("jstree-themeicon-hidden")&&o.attr("rel")),h.state.icon!==t&&(h.icon=h.state.icon),h.icon!==t&&null!==h.icon&&""!==h.icon||(h.icon=!0),o=i.children("ul").children("li");do{l="j"+this._id+"_"+ ++this._cnt}while(c[l]);return h.id=h.li_attr.id?h.li_attr.id.toString():l,o.length?(o.each(e.proxy(function(t,i){n=this._parse_model_from_html(e(i),h.id,s),a=this._model.data[n],h.children.push(n),a.children_d.length&&(h.children_d=h.children_d.concat(a.children_d))},this)),h.children_d=h.children_d.concat(h.children)):i.hasClass("jstree-closed")&&(h.state.loaded=!1),h.li_attr.class&&(h.li_attr.class=h.li_attr.class.replace("jstree-closed","").replace("jstree-open","")),h.a_attr.class&&(h.a_attr.class=h.a_attr.class.replace("jstree-clicked","").replace("jstree-disabled","")),c[h.id]=h,h.state.selected&&this._data.core.selected.push(h.id),h.id},_parse_model_from_flat_json:function(e,i,r){r=r?r.concat():[],i&&r.unshift(i);var s,n,a,d,o=e.id.toString(),l=this._model.data,c=this._model.default_state,h={id:o,text:e.text||"",icon:e.icon===t||e.icon,parent:i,parents:r,children:e.children||[],children_d:e.children_d||[],data:e.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(s in c)c.hasOwnProperty(s)&&(h.state[s]=c[s]);if(e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(h.icon=e.data.jstree.icon),h.icon!==t&&null!==h.icon&&""!==h.icon||(h.icon=!0),e&&e.data&&(h.data=e.data,e.data.jstree))for(s in e.data.jstree)e.data.jstree.hasOwnProperty(s)&&(h.state[s]=e.data.jstree[s]);if(e&&"object"==typeof e.state)for(s in e.state)e.state.hasOwnProperty(s)&&(h.state[s]=e.state[s]);if(e&&"object"==typeof e.li_attr)for(s in e.li_attr)e.li_attr.hasOwnProperty(s)&&(h.li_attr[s]=e.li_attr[s]);if(h.li_attr.id||(h.li_attr.id=o),e&&"object"==typeof e.a_attr)for(s in e.a_attr)e.a_attr.hasOwnProperty(s)&&(h.a_attr[s]=e.a_attr[s]);for(e&&e.children&&!0===e.children&&(h.state.loaded=!1,h.children=[],h.children_d=[]),l[h.id]=h,s=0,n=h.children.length;s<n;s++)d=l[a=this._parse_model_from_flat_json(l[h.children[s]],h.id,r)],h.children_d.push(a),d.children_d.length&&(h.children_d=h.children_d.concat(d.children_d));return delete e.data,delete e.children,l[h.id].original=e,h.state.selected&&this._data.core.selected.push(h.id),h.id},_parse_model_from_json:function(e,i,r){r=r?r.concat():[],i&&r.unshift(i);var s,n,a,d,o,l=!1,c=this._model.data,h=this._model.default_state;do{l="j"+this._id+"_"+ ++this._cnt}while(c[l]);for(s in o={id:!1,text:"string"==typeof e?e:"",icon:"object"!=typeof e||e.icon===t||e.icon,parent:i,parents:r,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},h)h.hasOwnProperty(s)&&(o.state[s]=h[s]);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!==t&&null!==o.icon&&""!==o.icon||(o.icon=!0),e&&e.data&&(o.data=e.data,e.data.jstree))for(s in e.data.jstree)e.data.jstree.hasOwnProperty(s)&&(o.state[s]=e.data.jstree[s]);if(e&&"object"==typeof e.state)for(s in e.state)e.state.hasOwnProperty(s)&&(o.state[s]=e.state[s]);if(e&&"object"==typeof e.li_attr)for(s in e.li_attr)e.li_attr.hasOwnProperty(s)&&(o.li_attr[s]=e.li_attr[s]);if(o.li_attr.id&&!o.id&&(o.id=o.li_attr.id.toString()),o.id||(o.id=l),o.li_attr.id||(o.li_attr.id=o.id),e&&"object"==typeof e.a_attr)for(s in e.a_attr)e.a_attr.hasOwnProperty(s)&&(o.a_attr[s]=e.a_attr[s]);if(e&&e.children&&e.children.length){for(s=0,n=e.children.length;s<n;s++)d=c[a=this._parse_model_from_json(e.children[s],o.id,r)],o.children.push(a),d.children_d.length&&(o.children_d=o.children_d.concat(d.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,o.state.selected&&this._data.core.selected.push(o.id),o.id},_redraw:function(){var t,i,r,s=this._model.force_full_redraw?this._model.data[e.jstree.root].children.concat([]):this._model.changed.concat([]),n=o.createElement("UL"),a=this._data.core.focused;for(i=0,r=s.length;i<r;i++)(t=this.redraw_node(s[i],!0,this._model.force_full_redraw))&&this._model.force_full_redraw&&n.appendChild(t);this._model.force_full_redraw&&(n.className=this.get_container_ul()[0].className,n.setAttribute("role","group"),this.element.empty().append(n)),null!==a&&this.settings.core.restore_focus&&((t=this.get_node(a,!0))&&t.length&&t.children(".jstree-anchor")[0]!==o.activeElement?t.children(".jstree-anchor").focus():this._data.core.focused=null),this._model.force_full_redraw=!1,this._model.changed=[],this.trigger("redraw",{nodes:s})},redraw:function(e){e&&(this._model.force_full_redraw=!0),this._redraw()},draw_children:function(t){var i=this.get_node(t),r=!1,s=!1,n=!1,a=o;if(!i)return!1;if(i.id===e.jstree.root)return this.redraw(!0);if(!(t=this.get_node(t,!0))||!t.length)return!1;if(t.children(".jstree-children").remove(),t=t[0],i.children.length&&i.state.loaded){for((n=a.createElement("UL")).setAttribute("role","group"),n.className="jstree-children",r=0,s=i.children.length;r<s;r++)n.appendChild(this.redraw_node(i.children[r],!0,!0));t.appendChild(n)}},redraw_node:function(t,i,r,s){var n=this.get_node(t),a=!1,d=!1,l=!1,c=!1,h=!1,_=!1,f="",u=o,g=this._model.data,p=!1,m=null,j=0,y=0,v=!1,w=!1;if(!n)return!1;if(n.id===e.jstree.root)return this.redraw(!0);if(i=i||0===n.children.length,t=o.querySelector?this.element[0].querySelector("#"+(-1!=="0123456789".indexOf(n.id[0])?"\\3"+n.id[0]+" "+n.id.substr(1).replace(e.jstree.idregex,"\\$&"):n.id.replace(e.jstree.idregex,"\\$&"))):o.getElementById(n.id))t=e(t),r||((a=t.parent().parent()[0])===this.element[0]&&(a=null),d=t.index()),i||!n.children.length||t.children(".jstree-children").length||(i=!0),i||(l=t.children(".jstree-children")[0]),p=t.children(".jstree-anchor")[0]===o.activeElement,t.remove();else if(i=!0,!r){if(!(null===(a=n.parent!==e.jstree.root?e("#"+n.parent.replace(e.jstree.idregex,"\\$&"),this.element)[0]:null)||a&&g[n.parent].state.opened))return!1;d=e.inArray(n.id,null===a?g[e.jstree.root].children:g[n.parent].children)}for(c in t=this._data.core.node.cloneNode(!0),f="jstree-node ",n.li_attr)if(n.li_attr.hasOwnProperty(c)){if("id"===c)continue;"class"!==c?t.setAttribute(c,n.li_attr[c]):f+=n.li_attr[c]}for(n.a_attr.id||(n.a_attr.id=n.id+"_anchor"),t.setAttribute("aria-selected",!!n.state.selected),t.setAttribute("aria-level",n.parents.length),t.setAttribute("aria-labelledby",n.a_attr.id),n.state.disabled&&t.setAttribute("aria-disabled",!0),c=0,h=n.children.length;c<h;c++)if(!g[n.children[c]].state.hidden){v=!0;break}if(null!==n.parent&&g[n.parent]&&!n.state.hidden&&(c=e.inArray(n.id,g[n.parent].children),w=n.id,-1!==c))for(c++,h=g[n.parent].children.length;c<h&&(g[g[n.parent].children[c]].state.hidden||(w=g[n.parent].children[c]),w===n.id);c++);for(h in n.state.hidden&&(f+=" jstree-hidden"),n.state.loading&&(f+=" jstree-loading"),n.state.loaded&&!v?f+=" jstree-leaf":(f+=n.state.opened&&n.state.loaded?" jstree-open":" jstree-closed",t.setAttribute("aria-expanded",n.state.opened&&n.state.loaded)),w===n.id&&(f+=" jstree-last"),t.id=n.id,t.className=f,f=(n.state.selected?" jstree-clicked":"")+(n.state.disabled?" jstree-disabled":""),n.a_attr)if(n.a_attr.hasOwnProperty(h)){if("href"===h&&"#"===n.a_attr[h])continue;"class"!==h?t.childNodes[1].setAttribute(h,n.a_attr[h]):f+=" "+n.a_attr[h]}if(f.length&&(t.childNodes[1].className="jstree-anchor "+f),(n.icon&&!0!==n.icon||!1===n.icon)&&(!1===n.icon?t.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":-1===n.icon.indexOf("/")&&-1===n.icon.indexOf(".")?t.childNodes[1].childNodes[0].className+=" "+n.icon+" jstree-themeicon-custom":(t.childNodes[1].childNodes[0].style.backgroundImage='url("'+n.icon+'")',t.childNodes[1].childNodes[0].style.backgroundPosition="center center",t.childNodes[1].childNodes[0].style.backgroundSize="auto",t.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),this.settings.core.force_text?t.childNodes[1].appendChild(u.createTextNode(n.text)):t.childNodes[1].innerHTML+=n.text,i&&n.children.length&&(n.state.opened||s)&&n.state.loaded){for((_=u.createElement("UL")).setAttribute("role","group"),_.className="jstree-children",c=0,h=n.children.length;c<h;c++)_.appendChild(this.redraw_node(n.children[c],i,!0));t.appendChild(_)}if(l&&t.appendChild(l),!r){for(a||(a=this.element[0]),c=0,h=a.childNodes.length;c<h;c++)if(a.childNodes[c]&&a.childNodes[c].className&&-1!==a.childNodes[c].className.indexOf("jstree-children")){m=a.childNodes[c];break}m||((m=u.createElement("UL")).setAttribute("role","group"),m.className="jstree-children",a.appendChild(m)),d<(a=m).childNodes.length?a.insertBefore(t,a.childNodes[d]):a.appendChild(t),p&&(j=this.element[0].scrollTop,y=this.element[0].scrollLeft,t.childNodes[1].focus(),this.element[0].scrollTop=j,this.element[0].scrollLeft=y)}return n.state.opened&&!n.state.loaded&&(n.state.opened=!1,setTimeout(e.proxy(function(){this.open_node(n.id,!1,0)},this),0)),t},open_node:function(i,r,s){var n,a,d,o;if(e.isArray(i)){for(n=0,a=(i=i.slice()).length;n<a;n++)this.open_node(i[n],r,s);return!0}return!(!(i=this.get_node(i))||i.id===e.jstree.root)&&(s=s===t?this.settings.core.animation:s,this.is_closed(i)?this.is_loaded(i)?(d=this.get_node(i,!0),o=this,d.length&&(s&&d.children(".jstree-children").length&&d.children(".jstree-children").stop(!0,!0),i.children.length&&!this._firstChild(d.children(".jstree-children")[0])&&this.draw_children(i),s?(this.trigger("before_open",{node:i}),d.children(".jstree-children").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",!0).children(".jstree-children").stop(!0,!0).slideDown(s,function(){this.style.display="",o.element&&o.trigger("after_open",{node:i})})):(this.trigger("before_open",{node:i}),d[0].className=d[0].className.replace("jstree-closed","jstree-open"),d[0].setAttribute("aria-expanded",!0))),i.state.opened=!0,r&&r.call(this,i,!0),d.length||this.trigger("before_open",{node:i}),this.trigger("open_node",{node:i}),s&&d.length||this.trigger("after_open",{node:i}),!0):this.is_loading(i)?setTimeout(e.proxy(function(){this.open_node(i,r,s)},this),500):void this.load_node(i,function(e,t){return t?this.open_node(e,r,s):!!r&&r.call(this,e,!1)}):(r&&r.call(this,i,!1),!1))},_open_to:function(t){if(!(t=this.get_node(t))||t.id===e.jstree.root)return!1;var i,r,s=t.parents;for(i=0,r=s.length;i<r;i+=1)i!==e.jstree.root&&this.open_node(s[i],!1,0);return e("#"+t.id.replace(e.jstree.idregex,"\\$&"),this.element)},close_node:function(i,r){var s,n,a,d;if(e.isArray(i)){for(s=0,n=(i=i.slice()).length;s<n;s++)this.close_node(i[s],r);return!0}return!(!(i=this.get_node(i))||i.id===e.jstree.root)&&(!this.is_closed(i)&&(r=r===t?this.settings.core.animation:r,a=this,d=this.get_node(i,!0),i.state.opened=!1,this.trigger("close_node",{node:i}),void(d.length?r?d.children(".jstree-children").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",!1).children(".jstree-children").stop(!0,!0).slideUp(r,function(){this.style.display="",d.children(".jstree-children").remove(),a.element&&a.trigger("after_close",{node:i})}):(d[0].className=d[0].className.replace("jstree-open","jstree-closed"),d.attr("aria-expanded",!1).children(".jstree-children").remove(),this.trigger("after_close",{node:i})):this.trigger("after_close",{node:i}))))},toggle_node:function(t){var i,r;if(e.isArray(t)){for(i=0,r=(t=t.slice()).length;i<r;i++)this.toggle_node(t[i]);return!0}return this.is_closed(t)?this.open_node(t):this.is_open(t)?this.close_node(t):void 0},open_all:function(t,i,r){if(t||(t=e.jstree.root),!(t=this.get_node(t)))return!1;var s,n,a,d=t.id===e.jstree.root?this.get_container_ul():this.get_node(t,!0);if(!d.length){for(s=0,n=t.children_d.length;s<n;s++)this.is_closed(this._model.data[t.children_d[s]])&&(this._model.data[t.children_d[s]].state.opened=!0);return this.trigger("open_all",{node:t})}r=r||d,a=this,(d=this.is_closed(t)?d.find(".jstree-closed").addBack():d.find(".jstree-closed")).each(function(){a.open_node(this,function(e,t){t&&this.is_parent(e)&&this.open_all(e,i,r)},i||0)}),0===r.find(".jstree-closed").length&&this.trigger("open_all",{node:this.get_node(r)})},close_all:function(t,i){if(t||(t=e.jstree.root),!(t=this.get_node(t)))return!1;var r,s,n=t.id===e.jstree.root?this.get_container_ul():this.get_node(t,!0),a=this;for(n.length&&(n=this.is_open(t)?n.find(".jstree-open").addBack():n.find(".jstree-open"),e(n.get().reverse()).each(function(){a.close_node(this,i||0)})),r=0,s=t.children_d.length;r<s;r++)this._model.data[t.children_d[r]].state.opened=!1;this.trigger("close_all",{node:t})},is_disabled:function(e){return(e=this.get_node(e))&&e.state&&e.state.disabled},enable_node:function(t){var i,r;if(e.isArray(t)){for(i=0,r=(t=t.slice()).length;i<r;i++)this.enable_node(t[i]);return!0}if(!(t=this.get_node(t))||t.id===e.jstree.root)return!1;t.state.disabled=!1,this.get_node(t,!0).children(".jstree-anchor").removeClass("jstree-disabled").attr("aria-disabled",!1),this.trigger("enable_node",{node:t})},disable_node:function(t){var i,r;if(e.isArray(t)){for(i=0,r=(t=t.slice()).length;i<r;i++)this.disable_node(t[i]);return!0}if(!(t=this.get_node(t))||t.id===e.jstree.root)return!1;t.state.disabled=!0,this.get_node(t,!0).children(".jstree-anchor").addClass("jstree-disabled").attr("aria-disabled",!0),this.trigger("disable_node",{node:t})},is_hidden:function(e){return!0===(e=this.get_node(e)).state.hidden},hide_node:function(t,i){var r,s;if(e.isArray(t)){for(r=0,s=(t=t.slice()).length;r<s;r++)this.hide_node(t[r],!0);return i||this.redraw(),!0}if(!(t=this.get_node(t))||t.id===e.jstree.root)return!1;t.state.hidden||(t.state.hidden=!0,this._node_changed(t.parent),i||this.redraw(),this.trigger("hide_node",{node:t}))},show_node:function(t,i){var r,s;if(e.isArray(t)){for(r=0,s=(t=t.slice()).length;r<s;r++)this.show_node(t[r],!0);return i||this.redraw(),!0}if(!(t=this.get_node(t))||t.id===e.jstree.root)return!1;t.state.hidden&&(t.state.hidden=!1,this._node_changed(t.parent),i||this.redraw(),this.trigger("show_node",{node:t}))},hide_all:function(t){var i,r=this._model.data,s=[];for(i in r)r.hasOwnProperty(i)&&i!==e.jstree.root&&!r[i].state.hidden&&(r[i].state.hidden=!0,s.push(i));return this._model.force_full_redraw=!0,t||this.redraw(),this.trigger("hide_all",{nodes:s}),s},show_all:function(t){var i,r=this._model.data,s=[];for(i in r)r.hasOwnProperty(i)&&i!==e.jstree.root&&r[i].state.hidden&&(r[i].state.hidden=!1,s.push(i));return this._model.force_full_redraw=!0,t||this.redraw(),this.trigger("show_all",{nodes:s}),s},activate_node:function(e,i){if(this.is_disabled(e))return!1;if(i&&"object"==typeof i||(i={}),this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==t?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&&(i.metaKey||i.ctrlKey||i.shiftKey)&&(!i.shiftKey||this._data.core.last_clicked&&this.get_parent(e)&&this.get_parent(e)===this._data.core.last_clicked.parent))if(i.shiftKey){var r,s,n=this.get_node(e).id,a=this._data.core.last_clicked.id,d=this.get_node(this._data.core.last_clicked.parent).children,o=!1;for(r=0,s=d.length;r<s;r+=1)d[r]===n&&(o=!o),d[r]===a&&(o=!o),this.is_disabled(d[r])||!o&&d[r]!==n&&d[r]!==a?this.deselect_node(d[r],!0,i):this.is_hidden(d[r])||this.select_node(d[r],!0,!1,i);this.trigger("changed",{action:"select_node",node:this.get_node(e),selected:this._data.core.selected,event:i})}else this.is_selected(e)?this.deselect_node(e,!1,i):this.select_node(e,!1,!1,i);else!this.settings.core.multiple&&(i.metaKey||i.ctrlKey||i.shiftKey)&&this.is_selected(e)?this.deselect_node(e,!1,i):(this.deselect_all(!0),this.select_node(e,!1,!1,i),this._data.core.last_clicked=this.get_node(e));this.trigger("activate_node",{node:this.get_node(e),event:i})},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"),i=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(){i.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(t,i,r,s){var n,a,d;if(e.isArray(t)){for(a=0,d=(t=t.slice()).length;a<d;a++)this.select_node(t[a],i,r,s);return!0}if(!(t=this.get_node(t))||t.id===e.jstree.root)return!1;n=this.get_node(t,!0),t.state.selected||(t.state.selected=!0,this._data.core.selected.push(t.id),r||(n=this._open_to(t)),n&&n.length&&n.attr("aria-selected",!0).children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("select_node",{node:t,selected:this._data.core.selected,event:s}),i||this.trigger("changed",{action:"select_node",node:t,selected:this._data.core.selected,event:s}))},deselect_node:function(t,i,r){var s,n,a;if(e.isArray(t)){for(s=0,n=(t=t.slice()).length;s<n;s++)this.deselect_node(t[s],i,r);return!0}if(!(t=this.get_node(t))||t.id===e.jstree.root)return!1;a=this.get_node(t,!0),t.state.selected&&(t.state.selected=!1,this._data.core.selected=e.vakata.array_remove_item(this._data.core.selected,t.id),a.length&&a.attr("aria-selected",!1).children(".jstree-anchor").removeClass("jstree-clicked"),this.trigger("deselect_node",{node:t,selected:this._data.core.selected,event:r}),i||this.trigger("changed",{action:"deselect_node",node:t,selected:this._data.core.selected,event:r}))},select_all:function(t){var i,r,s=this._data.core.selected.concat([]);for(this._data.core.selected=this._model.data[e.jstree.root].children_d.concat(),i=0,r=this._data.core.selected.length;i<r;i++)this._model.data[this._data.core.selected[i]]&&(this._model.data[this._data.core.selected[i]].state.selected=!0);this.redraw(!0),this.trigger("select_all",{selected:this._data.core.selected}),t||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:s})},deselect_all:function(e){var t,i,r=this._data.core.selected.concat([]);for(t=0,i=this._data.core.selected.length;t<i;t++)this._model.data[this._data.core.selected[t]]&&(this._model.data[this._data.core.selected[t]].state.selected=!1);this._data.core.selected=[],this.element.find(".jstree-clicked").removeClass("jstree-clicked").parent().attr("aria-selected",!1),this.trigger("deselect_all",{selected:this._data.core.selected,node:r}),e||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:r})},is_selected:function(t){return!(!(t=this.get_node(t))||t.id===e.jstree.root)&&t.state.selected},get_selected:function(t){return t?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(t){var i,r,s,n,a=this.get_selected(!0),d={};for(i=0,r=a.length;i<r;i++)d[a[i].id]=a[i];for(i=0,r=a.length;i<r;i++)for(s=0,n=a[i].children_d.length;s<n;s++)d[a[i].children_d[s]]&&delete d[a[i].children_d[s]];for(i in a=[],d)d.hasOwnProperty(i)&&a.push(i);return t?e.map(a,e.proxy(function(e){return this.get_node(e)},this)):a},get_bottom_selected:function(t){var i,r,s=this.get_selected(!0),n=[];for(i=0,r=s.length;i<r;i++)s[i].children.length||n.push(s[i].id);return t?e.map(n,e.proxy(function(e){return this.get_node(e)},this)):n},get_state:function(){var t,i={core:{open:[],loaded:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},selected:[]}};for(t in this._model.data)this._model.data.hasOwnProperty(t)&&t!==e.jstree.root&&(this._model.data[t].state.loaded&&this.settings.core.loaded_state&&i.core.loaded.push(t),this._model.data[t].state.opened&&i.core.open.push(t),this._model.data[t].state.selected&&i.core.selected.push(t));return i},set_state:function(i,r){if(i){if(i.core&&i.core.selected&&i.core.initial_selection===t&&(i.core.initial_selection=this._data.core.selected.concat([]).sort().join(",")),i.core){var s,n;if(i.core.loaded)return this.settings.core.loaded_state&&e.isArray(i.core.loaded)&&i.core.loaded.length?this._load_nodes(i.core.loaded,function(e){delete i.core.loaded,this.set_state(i,r)}):(delete i.core.loaded,this.set_state(i,r)),!1;if(i.core.open)return e.isArray(i.core.open)&&i.core.open.length?this._load_nodes(i.core.open,function(e){this.open_node(e,!1,0),delete i.core.open,this.set_state(i,r)}):(delete i.core.open,this.set_state(i,r)),!1;if(i.core.scroll)return i.core.scroll&&i.core.scroll.left!==t&&this.element.scrollLeft(i.core.scroll.left),i.core.scroll&&i.core.scroll.top!==t&&this.element.scrollTop(i.core.scroll.top),delete i.core.scroll,this.set_state(i,r),!1;if(i.core.selected)return s=this,i.core.initial_selection!==t&&i.core.initial_selection!==this._data.core.selected.concat([]).sort().join(",")||(this.deselect_all(),e.each(i.core.selected,function(e,t){s.select_node(t,!1,!0)})),delete i.core.initial_selection,delete i.core.selected,this.set_state(i,r),!1;for(n in i)i.hasOwnProperty(n)&&"core"!==n&&-1===e.inArray(n,this.settings.plugins)&&delete i[n];if(e.isEmptyObject(i.core))return delete i.core,this.set_state(i,r),!1}return!e.isEmptyObject(i)||(i=null,r&&r.call(this),this.trigger("set_state"),!1)}return!1},refresh:function(t,i){this._data.core.state=!0===i?{}:this.get_state(),i&&e.isFunction(i)&&(this._data.core.state=i.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;t||(this.element.html("<ul class='"+r+"' role='group'><li class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='treeitem' id='j"+this._id+"_loading'><i class='jstree-icon jstree-ocl'></i><a class='jstree-anchor' 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(t,i){i&&(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 i=[],r=[],s=this._data.core.selected.concat([]);r.push(t.id),!0===t.state.opened&&i.push(t.id),this.get_node(t,!0).find(".jstree-open").each(function(){r.push(this.id),i.push(this.id)}),this._load_nodes(r,e.proxy(function(e){this.open_node(i,!1,0),this.select_node(s),this.trigger("refresh_node",{node:t,nodes:e})},this),!1,!0)},set_id:function(t,i){if(!(t=this.get_node(t))||t.id===e.jstree.root)return!1;var r,s,n=this._model.data,a=t.id;for(i=i.toString(),n[t.parent].children[e.inArray(t.id,n[t.parent].children)]=i,r=0,s=t.parents.length;r<s;r++)n[t.parents[r]].children_d[e.inArray(t.id,n[t.parents[r]].children_d)]=i;for(r=0,s=t.children.length;r<s;r++)n[t.children[r]].parent=i;for(r=0,s=t.children_d.length;r<s;r++)n[t.children_d[r]].parents[e.inArray(t.id,n[t.children_d[r]].parents)]=i;return-1!==(r=e.inArray(t.id,this._data.core.selected))&&(this._data.core.selected[r]=i),(r=this.get_node(t.id,!0))&&(r.attr("id",i),this.element.attr("aria-activedescendant")===t.id&&this.element.attr("aria-activedescendant",i)),delete n[t.id],t.id=i,t.li_attr.id=i,n[i]=t,this.trigger("set_id",{node:t,new:t.id,old:a}),!0},get_text:function(t){return!(!(t=this.get_node(t))||t.id===e.jstree.root)&&t.text},set_text:function(t,i){var r,s;if(e.isArray(t)){for(r=0,s=(t=t.slice()).length;r<s;r++)this.set_text(t[r],i);return!0}return!(!(t=this.get_node(t))||t.id===e.jstree.root)&&(t.text=i,this.get_node(t,!0).length&&this.redraw_node(t.id),this.trigger("set_text",{obj:t,text:i}),!0)},get_json:function(t,i,r){if(!(t=this.get_node(t||e.jstree.root)))return!1;i&&i.flat&&!r&&(r=[]);var s,n,a={id:t.id,text:t.text,icon:this.get_icon(t),li_attr:e.extend(!0,{},t.li_attr),a_attr:e.extend(!0,{},t.a_attr),state:{},data:(!i||!i.no_data)&&e.extend(!0,e.isArray(t.data)?[]:{},t.data)};if(i&&i.flat?a.parent=t.parent:a.children=[],i&&i.no_state)delete a.state;else for(s in t.state)t.state.hasOwnProperty(s)&&(a.state[s]=t.state[s]);if(i&&i.no_li_attr&&delete a.li_attr,i&&i.no_a_attr&&delete a.a_attr,i&&i.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),i&&i.flat&&t.id!==e.jstree.root&&r.push(a),!i||!i.no_children)for(s=0,n=t.children.length;s<n;s++)i&&i.flat?this.get_json(t.children[s],i,r):a.children.push(this.get_json(t.children[s],i));return i&&i.flat?r:t.id===e.jstree.root?a.children:a},create_node:function(i,r,s,n,a){if(null===i&&(i=e.jstree.root),!(i=this.get_node(i)))return!1;if(!(s=s===t?"last":s).toString().match(/^(before|after)$/)&&!a&&!this.is_loaded(i))return this.load_node(i,function(){this.create_node(i,r,s,n,!0)});var d,o,l,c;switch(r||(r={text:this.get_string("New node")}),(r="string"==typeof r?{text:r}:e.extend(!0,{},r)).text===t&&(r.text=this.get_string("New node")),i.id===e.jstree.root&&("before"===s&&(s="first"),"after"===s&&(s="last")),s){case"before":d=this.get_node(i.parent),s=e.inArray(i.id,d.children),i=d;break;case"after":d=this.get_node(i.parent),s=e.inArray(i.id,d.children)+1,i=d;break;case"inside":case"first":s=0;break;case"last":s=i.children.length;break;default:s||(s=0)}if(s>i.children.length&&(s=i.children.length),r.id||(r.id=!0),!this.check("create_node",r,i,s))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(!0===r.id&&delete r.id,!(r=this._parse_model_from_json(r,i.id,i.parents.concat())))return!1;for(d=this.get_node(r),(o=[]).push(r),o=o.concat(d.children_d),this.trigger("model",{nodes:o,parent:i.id}),i.children_d=i.children_d.concat(o),l=0,c=i.parents.length;l<c;l++)this._model.data[i.parents[l]].children_d=this._model.data[i.parents[l]].children_d.concat(o);for(r=d,d=[],l=0,c=i.children.length;l<c;l++)d[l>=s?l+1:l]=i.children[l];return d[s]=r.id,i.children=d,this.redraw_node(i,!0),this.trigger("create_node",{node:this.get_node(r),parent:i.id,position:s}),n&&n.call(this,this.get_node(r)),r.id},rename_node:function(t,i){var r,s,n;if(e.isArray(t)){for(r=0,s=(t=t.slice()).length;r<s;r++)this.rename_node(t[r],i);return!0}return!(!(t=this.get_node(t))||t.id===e.jstree.root)&&(n=t.text,this.check("rename_node",t,this.get_parent(t),i)?(this.set_text(t,i),this.trigger("rename_node",{node:t,text:i,old:n}),!0):(this.settings.core.error.call(this,this._data.core.last_error),!1))},delete_node:function(t){var i,r,s,n,a,d,o,l,c,h,_,f;if(e.isArray(t)){for(i=0,r=(t=t.slice()).length;i<r;i++)this.delete_node(t[i]);return!0}if(!(t=this.get_node(t))||t.id===e.jstree.root)return!1;if(s=this.get_node(t.parent),n=e.inArray(t.id,s.children),h=!1,!this.check("delete_node",t,s,n))return this.settings.core.error.call(this,this._data.core.last_error),!1;for(-1!==n&&(s.children=e.vakata.array_remove(s.children,n)),(a=t.children_d.concat([])).push(t.id),d=0,o=t.parents.length;d<o;d++)this._model.data[t.parents[d]].children_d=e.vakata.array_filter(this._model.data[t.parents[d]].children_d,function(t){return-1===e.inArray(t,a)});for(l=0,c=a.length;l<c;l++)if(this._model.data[a[l]].state.selected){h=!0;break}for(h&&(this._data.core.selected=e.vakata.array_filter(this._data.core.selected,function(t){return-1===e.inArray(t,a)})),this.trigger("delete_node",{node:t,parent:s.id}),h&&this.trigger("changed",{action:"delete_node",node:t,selected:this._data.core.selected,parent:s.id}),l=0,c=a.length;l<c;l++)delete this._model.data[a[l]];return-1!==e.inArray(this._data.core.focused,a)&&(this._data.core.focused=null,_=this.element[0].scrollTop,f=this.element[0].scrollLeft,s.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(s,!0).children(".jstree-anchor").focus(),this.element[0].scrollTop=_,this.element[0].scrollLeft=f),this.redraw_node(s,!0),!0},check:function(t,i,r,s,n){i=i&&i.id?i:this.get_node(i),r=r&&r.id?r:this.get_node(r);var a=t.match(/^move_node|copy_node|create_node$/i)?r:i,d=this.settings.core.check_callback;if("move_node"===t||"copy_node"===t){if(!(n&&n.is_multi||"move_node"!==t||e.inArray(i.id,r.children)!==s))return this._data.core.last_error={error:"check",plugin:"core",id:"core_08",reason:"Moving node to its current position",data:JSON.stringify({chk:t,pos:s,obj:!(!i||!i.id)&&i.id,par:!(!r||!r.id)&&r.id})},!1;if(!(n&&n.is_multi||i.id!==r.id&&("move_node"!==t||e.inArray(i.id,r.children)!==s)&&-1===e.inArray(r.id,i.children_d)))return this._data.core.last_error={error:"check",plugin:"core",id:"core_01",reason:"Moving parent inside child",data:JSON.stringify({chk:t,pos:s,obj:!(!i||!i.id)&&i.id,par:!(!r||!r.id)&&r.id})},!1}return a&&a.data&&(a=a.data),a&&a.functions&&(!1===a.functions[t]||!0===a.functions[t])?(!1===a.functions[t]&&(this._data.core.last_error={error:"check",plugin:"core",id:"core_02",reason:"Node data prevents function: "+t,data:JSON.stringify({chk:t,pos:s,obj:!(!i||!i.id)&&i.id,par:!(!r||!r.id)&&r.id})}),a.functions[t]):!(!1===d||e.isFunction(d)&&!1===d.call(this,t,i,r,s,n)||d&&!1===d[t])||(this._data.core.last_error={error:"check",plugin:"core",id:"core_03",reason:"User config for core.check_callback prevents function: "+t,data:JSON.stringify({chk:t,pos:s,obj:!(!i||!i.id)&&i.id,par:!(!r||!r.id)&&r.id})},!1)},last_error:function(){return this._data.core.last_error},move_node:function(i,r,s,n,a,d,o){var l,c,h,_,f,u,g,p,m,j,y,v,w,b;if(r=this.get_node(r),s=s===t?0:s,!r)return!1;if(!s.toString().match(/^(before|after)$/)&&!a&&!this.is_loaded(r))return this.load_node(r,function(){this.move_node(i,r,s,n,!0,!1,o)});if(e.isArray(i)){if(1!==i.length){for(l=0,c=i.length;l<c;l++)(m=this.move_node(i[l],r,s,n,a,!1,o))&&(r=m,s="after");return this.redraw(),!0}i=i[0]}if(!(i=i&&i.id?i:this.get_node(i))||i.id===e.jstree.root)return!1;if(h=(i.parent||e.jstree.root).toString(),f=s.toString().match(/^(before|after)$/)&&r.id!==e.jstree.root?this.get_node(r.parent):r,g=!(u=o||(this._model.data[i.id]?this:e.jstree.reference(i.id)))||!u._id||this._id!==u._id,_=u&&u._id&&h&&u._model.data[h]&&u._model.data[h].children?e.inArray(i.id,u._model.data[h].children):-1,u&&u._id&&(i=u._model.data[i.id]),g)return!!(m=this.copy_node(i,r,s,n,a,!1,o))&&(u&&u.delete_node(i),m);switch(r.id===e.jstree.root&&("before"===s&&(s="first"),"after"===s&&(s="last")),s){case"before":s=e.inArray(r.id,f.children);break;case"after":s=e.inArray(r.id,f.children)+1;break;case"inside":case"first":s=0;break;case"last":s=f.children.length;break;default:s||(s=0)}if(s>f.children.length&&(s=f.children.length),!this.check("move_node",i,f,s,{core:!0,origin:o,is_multi:u&&u._id&&u._id!==this._id,is_foreign:!u||!u._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(i.parent===f.id){for(p=f.children.concat(),-1!==(m=e.inArray(i.id,p))&&(p=e.vakata.array_remove(p,m),s>m&&s--),m=[],j=0,y=p.length;j<y;j++)m[j>=s?j+1:j]=p[j];m[s]=i.id,f.children=m,this._node_changed(f.id),this.redraw(f.id===e.jstree.root)}else{for((m=i.children_d.concat()).push(i.id),j=0,y=i.parents.length;j<y;j++){for(p=[],v=0,w=(b=u._model.data[i.parents[j]].children_d).length;v<w;v++)-1===e.inArray(b[v],m)&&p.push(b[v]);u._model.data[i.parents[j]].children_d=p}for(u._model.data[h].children=e.vakata.array_remove_item(u._model.data[h].children,i.id),j=0,y=f.parents.length;j<y;j++)this._model.data[f.parents[j]].children_d=this._model.data[f.parents[j]].children_d.concat(m);for(p=[],j=0,y=f.children.length;j<y;j++)p[j>=s?j+1:j]=f.children[j];for(p[s]=i.id,f.children=p,f.children_d.push(i.id),f.children_d=f.children_d.concat(i.children_d),i.parent=f.id,(m=f.parents.concat()).unshift(f.id),b=i.parents.length,i.parents=m,m=m.concat(),j=0,y=i.children_d.length;j<y;j++)this._model.data[i.children_d[j]].parents=this._model.data[i.children_d[j]].parents.slice(0,-1*b),Array.prototype.push.apply(this._model.data[i.children_d[j]].parents,m);h!==e.jstree.root&&f.id!==e.jstree.root||(this._model.force_full_redraw=!0),this._model.force_full_redraw||(this._node_changed(h),this._node_changed(f.id)),d||this.redraw()}return n&&n.call(this,i,f,s),this.trigger("move_node",{node:i,parent:f.id,position:s,old_parent:h,old_position:_,is_multi:u&&u._id&&u._id!==this._id,is_foreign:!u||!u._id,old_instance:u,new_instance:this}),i.id},copy_node:function(i,r,s,n,a,d,o){var l,c,h,_,f,u,g,p,m,j;if(r=this.get_node(r),s=s===t?0:s,!r)return!1;if(!s.toString().match(/^(before|after)$/)&&!a&&!this.is_loaded(r))return this.load_node(r,function(){this.copy_node(i,r,s,n,!0,!1,o)});if(e.isArray(i)){if(1!==i.length){for(l=0,c=i.length;l<c;l++)(_=this.copy_node(i[l],r,s,n,a,!0,o))&&(r=_,s="after");return this.redraw(),!0}i=i[0]}if(!(i=i&&i.id?i:this.get_node(i))||i.id===e.jstree.root)return!1;switch(p=(i.parent||e.jstree.root).toString(),m=s.toString().match(/^(before|after)$/)&&r.id!==e.jstree.root?this.get_node(r.parent):r,!(j=o||(this._model.data[i.id]?this:e.jstree.reference(i.id)))||!j._id||this._id!==j._id,j&&j._id&&(i=j._model.data[i.id]),r.id===e.jstree.root&&("before"===s&&(s="first"),"after"===s&&(s="last")),s){case"before":s=e.inArray(r.id,m.children);break;case"after":s=e.inArray(r.id,m.children)+1;break;case"inside":case"first":s=0;break;case"last":s=m.children.length;break;default:s||(s=0)}if(s>m.children.length&&(s=m.children.length),!this.check("copy_node",i,m,s,{core:!0,origin:o,is_multi:j&&j._id&&j._id!==this._id,is_foreign:!j||!j._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(!(g=j?j.get_json(i,{no_id:!0,no_data:!0,no_state:!0}):i))return!1;if(!0===g.id&&delete g.id,!(g=this._parse_model_from_json(g,m.id,m.parents.concat())))return!1;for(_=this.get_node(g),i&&i.state&&!1===i.state.loaded&&(_.state.loaded=!1),(h=[]).push(g),h=h.concat(_.children_d),this.trigger("model",{nodes:h,parent:m.id}),f=0,u=m.parents.length;f<u;f++)this._model.data[m.parents[f]].children_d=this._model.data[m.parents[f]].children_d.concat(h);for(h=[],f=0,u=m.children.length;f<u;f++)h[f>=s?f+1:f]=m.children[f];return h[s]=_.id,m.children=h,m.children_d.push(_.id),m.children_d=m.children_d.concat(_.children_d),m.id===e.jstree.root&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||this._node_changed(m.id),d||this.redraw(m.id===e.jstree.root),n&&n.call(this,_,m,s),this.trigger("copy_node",{node:_,original:i,parent:m.id,position:s,old_parent:p,old_position:j&&j._id&&p&&j._model.data[p]&&j._model.data[p].children?e.inArray(i.id,j._model.data[p].children):-1,is_multi:j&&j._id&&j._id!==this._id,is_foreign:!j||!j._id,old_instance:j,new_instance:this}),_.id},cut:function(t){if(t||(t=this._data.core.selected.concat()),e.isArray(t)||(t=[t]),!t.length)return!1;var i,a,d,o=[];for(a=0,d=t.length;a<d;a++)(i=this.get_node(t[a]))&&i.id&&i.id!==e.jstree.root&&o.push(i);if(!o.length)return!1;r=o,n=this,s="move_node",this.trigger("cut",{node:t})},copy:function(t){if(t||(t=this._data.core.selected.concat()),e.isArray(t)||(t=[t]),!t.length)return!1;var i,a,d,o=[];for(a=0,d=t.length;a<d;a++)(i=this.get_node(t[a]))&&i.id&&i.id!==e.jstree.root&&o.push(i);if(!o.length)return!1;r=o,n=this,s="copy_node",this.trigger("copy",{node:t})},get_buffer:function(){return{mode:s,node:r,inst:n}},can_paste:function(){return!1!==s&&!1!==r},paste:function(e,t){if(!((e=this.get_node(e))&&s&&s.match(/^(copy_node|move_node)$/)&&r))return!1;this[s](r,e,t,!1,!1,!1,n)&&this.trigger("paste",{parent:e.id,node:r,mode:s}),r=!1,s=!1,n=!1},clear_buffer:function(){r=!1,s=!1,n=!1,this.trigger("clear_buffer")},edit:function(t,i,r){var s,n,a,d,l,c,h,_,f,u=!1;return!!(t=this.get_node(t))&&(this.check("edit",t,this.get_parent(t))?(f=t,i="string"==typeof i?i:t.text,this.set_text(t,""),t=this._open_to(t),f.text=i,s=this._data.core.rtl,n=this.element.width(),this._data.core.focused=f.id,a=t.children(".jstree-anchor").focus(),d=e("<span>"),l=i,c=e("<div />",{css:{position:"absolute",top:"-200px",left:s?"0px":"-1000px",visibility:"hidden"}}).appendTo(o.body),h=e("<input />",{value:l,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(i){i.stopImmediatePropagation(),i.preventDefault();var s,n=d.children(".jstree-rename-input").val(),o=this.settings.core.force_text;""===n&&(n=l),c.remove(),d.replaceWith(a),d.remove(),l=o?l:e("<div></div>").append(e.parseHTML(l)).html(),t=this.get_node(t),this.set_text(t,l),(s=!!this.rename_node(t,o?e("<div></div>").text(n).text():e("<div></div>").append(e.parseHTML(n)).html()))||this.set_text(t,l),this._data.core.focused=f.id,setTimeout(e.proxy(function(){var e=this.get_node(f.id,!0);e.length&&(this._data.core.focused=f.id,e.children(".jstree-anchor").focus())},this),0),r&&r.call(this,f,s,u),h=null},this),keydown:function(e){var t=e.which;27===t&&(u=!0,this.value=l),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){h.width(Math.min(c.text("pW"+this.value).width(),n))},keypress:function(e){if(13===e.which)return!1}}),_={fontFamily:a.css("fontFamily")||"",fontSize:a.css("fontSize")||"",fontWeight:a.css("fontWeight")||"",fontStyle:a.css("fontStyle")||"",fontStretch:a.css("fontStretch")||"",fontVariant:a.css("fontVariant")||"",letterSpacing:a.css("letterSpacing")||"",wordSpacing:a.css("wordSpacing")||""},d.attr("class",a.attr("class")).append(a.contents().clone()).append(h),a.replaceWith(d),c.css(_),h.css(_).width(Math.min(c.text("pW"+h[0].value).width(),n))[0].select(),void e(o).one("mousedown.jstree touchstart.jstree dnd_start.vakata",function(t){h&&t.target!==h&&e(h).blur()})):(this.settings.core.error.call(this,this._data.core.last_error),!1))},set_theme:function(t,i){if(!t)return!1;if(!0===i){var r=this.settings.core.themes.dir;r||(r=e.jstree.path+"/themes"),i=r+"/"+t+"/style.css"}i&&-1===e.inArray(i,a)&&(e("head").append('<link rel="stylesheet" href="'+i+'" type="text/css" />'),a.push(i)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=t,this.element.addClass("jstree-"+t),this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+t+"-responsive"),this.trigger("set_theme",{theme:t})},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,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(i,r){var s,n,a,d;if(e.isArray(i)){for(s=0,n=(i=i.slice()).length;s<n;s++)this.set_icon(i[s],r);return!0}return!(!(i=this.get_node(i))||i.id===e.jstree.root)&&(d=i.icon,i.icon=!0===r||null===r||r===t||""===r||r,a=this.get_node(i,!0).children(".jstree-anchor").children(".jstree-themeicon"),!1===r?(a.removeClass("jstree-themeicon-custom "+d).css("background","").removeAttr("rel"),this.hide_icon(i)):!0===r||null===r||r===t||""===r?(a.removeClass("jstree-themeicon-custom "+d).css("background","").removeAttr("rel"),!1===d&&this.show_icon(i)):-1===r.indexOf("/")&&-1===r.indexOf(".")?(a.removeClass(d).css("background",""),a.addClass(r+" jstree-themeicon-custom").attr("rel",r),!1===d&&this.show_icon(i)):(a.removeClass(d).css("background",""),a.addClass("jstree-themeicon-custom").css("background","url('"+r+"') center center no-repeat").attr("rel",r),!1===d&&this.show_icon(i)),!0)},get_icon:function(t){return!(!(t=this.get_node(t))||t.id===e.jstree.root)&&t.icon},hide_icon:function(t){var i,r;if(e.isArray(t)){for(i=0,r=(t=t.slice()).length;i<r;i++)this.hide_icon(t[i]);return!0}return!(!(t=this.get_node(t))||t===e.jstree.root)&&(t.icon=!1,this.get_node(t,!0).children(".jstree-anchor").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0)},show_icon:function(t){var i,r,s;if(e.isArray(t)){for(i=0,r=(t=t.slice()).length;i<r;i++)this.show_icon(t[i]);return!0}return!(!(t=this.get_node(t))||t===e.jstree.root)&&(s=this.get_node(t,!0),t.icon=!s.length||s.children(".jstree-anchor").children(".jstree-themeicon").attr("rel"),t.icon||(t.icon=!0),s.children(".jstree-anchor").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0)}},e.vakata={},e.vakata.attributes=function(t,i){t=e(t)[0];var r=i?{}:[];return t&&t.attributes&&e.each(t.attributes,function(t,s){-1===e.inArray(s.name.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])&&null!==s.value&&""!==e.trim(s.value)&&(i?r[s.name]=s.value:r.push(s.name))}),r},e.vakata.array_unique=function(e){var i,r,s=[],n={};for(i=0,r=e.length;i<r;i++)n[e[i]]===t&&(s.push(e[i]),n[e[i]]=!0);return s},e.vakata.array_remove=function(e,t){return e.splice(t,1),e},e.vakata.array_remove_item=function(t,i){var r=e.inArray(i,t);return-1!==r?e.vakata.array_remove(t,r):t},e.vakata.array_filter=function(e,t,i,r,s){if(e.filter)return e.filter(t,i);for(s in r=[],e)~~s+""==s+""&&s>=0&&t.call(i,e[s],+s,e)&&r.push(e[s]);return r}}});
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка