!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"; /*! * jsTree 3.3.12 * http://jstree.com/ * * Copyright (c) 2014 Ivan Bozhanov (http://vakata.com) * * Licensed same as jquery - under the terms of the MIT License * http://www.opensource.org/licenses/mit-license.php */ /*! * if using jslint please allow for the jQuery global and use following options: * jslint: loopfunc: true, browser: true, ass: true, bitwise: true, continue: true, nomen: true, plusplus: true, regexp: true, unparam: true, todo: true, white: true */if(!e.jstree){var i=0,r=!1,s=!1,a=!1,n=[],o=e("script:last").attr("src"),d=window.document,c=window.setImmediate,l=window.Promise;!c&&l&&(c=function(e,t){l.resolve(t).then(e)}),e.jstree={version:"3.3.12",defaults:{plugins:[]},plugins:{},path:o&&-1!==o.indexOf("/")?o.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g,root:"#"},e.jstree.create=function(t,r){var s=new e.jstree.core(++i),a=r;return r=e.extend(!0,{},e.jstree.defaults,r),a&&a.plugins&&(r.plugins=a.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(d).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),a=null;return!(!0===i&&!this.length)&&(this.each((function(){var n=e.jstree.reference(this),o=r&&n?n[i]:null;if(a=r&&o?o.apply(n,s):null,n||r||i!==t&&!e.isPlainObject(i)||e.jstree.create(this,i),(n&&!r||!0===i)&&(a=n||!1),null!==a&&a!==t)return!1})),null!==a&&a!==t?a: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,compute_elements_positions:!1,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").trigger("focus")}},up:function(e){e.preventDefault();var t=this.get_prev_dom(e.currentTarget);t&&t.length&&t.children(".jstree-anchor").trigger("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").trigger("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").trigger("focus")}},down:function(e){e.preventDefault();var t=this.get_next_dom(e.currentTarget);t&&t.length&&t.children(".jstree-anchor").trigger("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").trigger("focus")},end:function(e){e.preventDefault(),this.element.find(".jstree-anchor").filter(":visible").last().trigger("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(""),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=d.createElement("LI");return i.setAttribute("role","none"),(e=d.createElement("I")).className="jstree-icon jstree-ocl",e.setAttribute("role","presentation"),i.appendChild(e),(e=d.createElement("A")).className="jstree-anchor",e.setAttribute("href","#"),e.setAttribute("tabindex","-1"),e.setAttribute("role","treeitem"),(t=d.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(d.selection&&d.selection.empty)d.selection.empty();else if(window.getSelection){var t=window.getSelection();try{t.removeAllRanges(),t.collapse()}catch(e){}}})).on("mousedown.jstree",function(e){e.target===this.element[0]&&(e.preventDefault(),r=+new Date)}.bind(this)).on("mousedown.jstree",".jstree-ocl",(function(e){e.preventDefault()})).on("click.jstree",".jstree-ocl",function(e){this.toggle_node(e.target)}.bind(this)).on("dblclick.jstree",".jstree-anchor",function(e){if(e.target.tagName&&"input"===e.target.tagName.toLowerCase())return!0;this.settings.core.dblclick_toggle&&this.toggle_node(e.target)}.bind(this)).on("click.jstree",".jstree-anchor",function(t){t.preventDefault(),t.currentTarget!==d.activeElement&&e(t.currentTarget).trigger("focus"),this.activate_node(t.currentTarget,t)}.bind(this)).on("keydown.jstree",".jstree-anchor",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}}.bind(this)).on("load_node.jstree",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(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;t1){if(a.slice(n).each(function(i,r){if(0===e(r).text().toLowerCase().indexOf(t))return e(r).trigger("focus"),o=!0,!1}.bind(this)),o)return;if(a.slice(0,n).each(function(i,r){if(0===e(r).text().toLowerCase().indexOf(t))return e(r).trigger("focus"),o=!0,!1}.bind(this)),o)return}if(new RegExp("^"+s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"+$").test(t)){if(a.slice(n+1).each(function(t,i){if(e(i).text().toLowerCase().charAt(0)===s)return e(i).trigger("focus"),o=!0,!1}.bind(this)),o)return;if(a.slice(0,n+1).each(function(t,i){if(e(i).text().toLowerCase().charAt(0)===s)return e(i).trigger("focus"),o=!0,!1}.bind(this)),o)return}}.bind(this)).on("init.jstree",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)}.bind(this)).on("loading.jstree",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"]()}.bind(this)).on("blur.jstree",".jstree-anchor",function(t){this._data.core.focused=null,e(t.currentTarget).filter(".jstree-hovered").trigger("mouseleave"),this.element.attr("tabindex","0")}.bind(this)).on("focus.jstree",".jstree-anchor",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")}.bind(this)).on("focus.jstree",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").trigger("focus")}}.bind(this)).on("mouseenter.jstree",".jstree-anchor",function(e){this.hover_node(e.currentTarget)}.bind(this)).on("mouseleave.jstree",".jstree-anchor",function(e){this.dehover_node(e.currentTarget)}.bind(this))},unbind:function(){this.element.off(".jstree"),e(d).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.vakata.is_function(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,a,n=[];for(n.push(r?t.id:t.text),s=0,a=t.parents.length;s0)},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,a,n,o;if(e.vakata.is_array(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,a=0,n=t.parents.length;a").html(d),h.text=this.settings.core.force_text?d.text():d.html(),d=i.data(),h.data=d?e.extend(!0,{},d):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(o in h.data.jstree)h.data.jstree.hasOwnProperty(o)&&(h.state[o]=h.data.jstree[o]);(d=i.children("a").children(".jstree-themeicon")).length&&(h.icon=!d.hasClass("jstree-themeicon-hidden")&&d.attr("rel")),h.state.icon!==t&&(h.icon=h.state.icon),h.icon!==t&&null!==h.icon&&""!==h.icon||(h.icon=!0),d=i.children("ul").children("li");do{c="j"+this._id+"_"+ ++this._cnt}while(l[c]);return h.id=h.li_attr.id?h.li_attr.id.toString():c,d.length?(d.each(function(t,i){a=this._parse_model_from_html(e(i),h.id,s),n=this._model.data[a],h.children.push(a),n.children_d.length&&(h.children_d=h.children_d.concat(n.children_d))}.bind(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","")),l[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,a,n,o,d=e.id.toString(),c=this._model.data,l=this._model.default_state,h={id:d,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 l)l.hasOwnProperty(s)&&(h.state[s]=l[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=d),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=[]),c[h.id]=h,s=0,a=h.children.length;s
  • "+this.get_string("Loading ...")+"
  • "),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,function(e){this.open_node(i,!1,0),this.select_node(s),this.trigger("refresh_node",{node:t,nodes:e})}.bind(this),!1,!0)},set_id:function(t,i){if(!(t=this.get_node(t))||t.id===e.jstree.root)return!1;var r,s,a=this._model.data,n=t.id;for(i=i.toString(),a[t.parent].children[e.inArray(t.id,a[t.parent].children)]=i,r=0,s=t.parents.length;ri.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(o=this.get_node(r),(d=[]).push(r),d=d.concat(o.children_d),this.trigger("model",{nodes:d,parent:i.id}),i.children_d=i.children_d.concat(d),c=0,l=i.parents.length;c=s?c+1:c]=i.children[c];return o[s]=r.id,i.children=o,this.redraw_node(i,!0),this.trigger("create_node",{node:this.get_node(r),parent:i.id,position:s}),a&&a.call(this,this.get_node(r)),r.id},rename_node:function(t,i){var r,s,a;if(e.vakata.is_array(t)){for(r=0,s=(t=t.slice()).length;rg.children.length&&(s=g.children.length),!this.check("move_node",i,g,s,{core:!0,origin:d,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===g.id){for(p=g.children.concat(),-1!==(m=e.inArray(i.id,p))&&(p=e.vakata.array_remove(p,m),s>m&&s--),m=[],v=0,j=p.length;v=s?v+1:v]=p[v];m[s]=i.id,g.children=m,this._node_changed(g.id),this.redraw(g.id===e.jstree.root)}else{for((m=i.children_d.concat()).push(i.id),v=0,j=i.parents.length;v=s?v+1:v]=g.children[v];for(p[s]=i.id,g.children=p,g.children_d.push(i.id),g.children_d=g.children_d.concat(i.children_d),i.parent=g.id,(m=g.parents.concat()).unshift(g.id),y=i.parents.length,i.parents=m,m=m.concat(),v=0,j=i.children_d.length;vm.children.length&&(s=m.children.length),!this.check("copy_node",i,m,s,{core:!0,origin:d,is_multi:v&&v._id&&v._id!==this._id,is_foreign:!v||!v._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(!(f=v?v.get_json(i,{no_id:!0,no_data:!0,no_state:!0}):i))return!1;if(!0===f.id&&delete f.id,!(f=this._parse_model_from_json(f,m.id,m.parents.concat())))return!1;for(_=this.get_node(f),i&&i.state&&!1===i.state.loaded&&(_.state.loaded=!1),(h=[]).push(f),h=h.concat(_.children_d),this.trigger("model",{nodes:h,parent:m.id}),g=0,u=m.parents.length;g=s?g+1:g]=m.children[g];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),o||this.redraw(m.id===e.jstree.root),a&&a.call(this,_,m,s),this.trigger("copy_node",{node:_,original:i,parent:m.id,position:s,old_parent:p,old_position:v&&v._id&&p&&v._model.data[p]&&v._model.data[p].children?e.inArray(i.id,v._model.data[p].children):-1,is_multi:v&&v._id&&v._id!==this._id,is_foreign:!v||!v._id,old_instance:v,new_instance:this}),_.id},cut:function(t){if(t||(t=this._data.core.selected.concat()),e.vakata.is_array(t)||(t=[t]),!t.length)return!1;var i,n,o,d=[];for(n=0,o=t.length;n"), /*! oi = obj.children("i:visible"), ai = a.children("i:visible"), w1 = oi.width() * oi.length, w2 = ai.width() * ai.length, */ c=i,l=e("
    ",{css:{position:"absolute",top:"-200px",left:s?"0px":"-1000px",visibility:"hidden"}}).appendTo(d.body),h=e("",{value:c,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:function(i){i.stopImmediatePropagation(),i.preventDefault();var s,a=o.children(".jstree-rename-input").val(),d=this.settings.core.force_text;""===a&&(a=c),l.remove(),o.replaceWith(n),o.remove(),c=d?c:e("
    ").append(e.parseHTML(c)).html(),t=this.get_node(t),this.set_text(t,c),(s=!!this.rename_node(t,d?e("
    ").text(a).text():e("
    ").append(e.parseHTML(a)).html()))||this.set_text(t,c),this._data.core.focused=g.id,setTimeout(function(){var e=this.get_node(g.id,!0);e.length&&(this._data.core.focused=g.id,e.children(".jstree-anchor").trigger("focus"))}.bind(this),0),r&&r.call(this,g,s,u,a),h=null}.bind(this),keydown:function(e){var t=e.which;27===t&&(u=!0,this.value=c),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(l.text("pW"+this.value).width(),a))},keypress:function(e){if(13===e.which)return!1}}),_={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(h),n.replaceWith(o),l.css(_),h.css(_).width(Math.min(l.text("pW"+h[0].value).width(),a))[0].select(),void e(d).one("mousedown.jstree touchstart.jstree dnd_start.vakata",(function(t){h&&t.target!==h&&e(h).trigger("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,n)&&(e("head").append(''),n.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,a,n,o;if(e.vakata.is_array(i)){for(s=0,a=(i=i.slice()).length;s=0&&t.call(i,e[s],+s,e)&&r.push(e[s]);return r},e.vakata.trim=function(e){return String.prototype.trim?String.prototype.trim.call(e.toString()):e.toString().replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},e.vakata.is_function=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},e.vakata.is_array=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Function.prototype.bind||(Function.prototype.bind=function(){var e=this,t=arguments[0],i=Array.prototype.slice.call(arguments,1);if("function"!=typeof e)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");return function(){var r=i.concat(Array.prototype.slice.call(arguments));return e.apply(t,r)}}),e.jstree.plugins.changed=function(e,t){var i=[];this.trigger=function(e,r){var s,a;if(r||(r={}),"changed"===e.replace(".jstree","")){r.changed={selected:[],deselected:[]};var n={};for(s=0,a=i.length;s-1?_[f[r]]=!0:delete _[f[r]]}if(-1!==l.indexOf("up"))for(;c&&c.id!==e.jstree.root;){for(a=0,r=0,s=c.children.length;r-1}))}if(-1!==o.indexOf("up")&&-1===c.indexOf(n.id)){for(r=0,s=n.parents.length;r0&&a===s))break;o.state[c?"selected":"checked"]=!0,this._data[c?"core":"checkbox"].selected.push(o.id),(n=this.get_node(o,!0))&&n.length&&n.attr("aria-selected",!0).children(".jstree-anchor").addClass(c?"jstree-clicked":"jstree-checked"),o=this.get_node(o.parent)}}.bind(this)).on("move_node.jstree",function(t,i){var r,s,a,n,o,d=i.is_multi,c=i.old_parent,l=this.get_node(i.parent),h=this._model.data,_=this.settings.checkbox.tie_selection;if(!d)for(r=this.get_node(c);r&&r.id!==e.jstree.root&&!r.state[_?"selected":"checked"];){for(s=0,a=0,n=r.children.length;a0&&s===n))break;r.state[_?"selected":"checked"]=!0,this._data[_?"core":"checkbox"].selected.push(r.id),(o=this.get_node(r,!0))&&o.length&&o.attr("aria-selected",!0).children(".jstree-anchor").addClass(_?"jstree-clicked":"jstree-checked"),r=this.get_node(r.parent)}for(r=l;r&&r.id!==e.jstree.root;){for(s=0,a=0,n=r.children.length;a-1&&d.push(c)}var l=this.get_node(n,!0),h=d.length>0&&d.length250)&&e.vakata.context.hide(),s=0}.bind(this)).on("touchstart.jstree",".jstree-anchor",(function(r){r.originalEvent&&r.originalEvent.changedTouches&&r.originalEvent.changedTouches[0]&&(t=r.originalEvent.changedTouches[0].clientX,i=r.originalEvent.changedTouches[0].clientY,a=setTimeout((function(){e(r.currentTarget).trigger("contextmenu",!0)}),750))})).on("touchmove.vakata.jstree",(function(r){a&&r.originalEvent&&r.originalEvent.changedTouches&&r.originalEvent.changedTouches[0]&&(Math.abs(t-r.originalEvent.changedTouches[0].clientX)>10||Math.abs(i-r.originalEvent.changedTouches[0].clientY)>10)&&(clearTimeout(a),e.vakata.context.hide())})).on("touchend.vakata.jstree",(function(e){a&&clearTimeout(a)})), /*! if(!('oncontextmenu' in document.body) && ('ontouchstart' in document.body)) { var el = null, tm = null; this.element .on("touchstart", ".jstree-anchor", function (e) { el = e.currentTarget; tm = +new Date(); $(document).one("touchend", function (e) { e.target = document.elementFromPoint(e.originalEvent.targetTouches[0].pageX - window.pageXOffset, e.originalEvent.targetTouches[0].pageY - window.pageYOffset); e.currentTarget = e.target; tm = ((+(new Date())) - tm); if(e.target === el && tm > 600 && tm < 1000) { e.preventDefault(); $(el).trigger('contextmenu', e); } el = null; tm = null; }); }); } */ e(d).on("context_hide.vakata.jstree",function(t,i){this._data.contextmenu.visible=!1,e(i.reference).removeClass("jstree-context")}.bind(this))},this.teardown=function(){this._data.contextmenu.visible&&e.vakata.context.hide(),e(d).off("context_hide.vakata.jstree"),r.teardown.call(this)},this.show_contextmenu=function(i,r,s,a){if(!(i=this.get_node(i))||i.id===e.jstree.root)return!1;var n=this.settings.contextmenu,o=this.get_node(i,!0).children(".jstree-anchor"),d=!1,c=!1;(n.show_at_node||r===t||s===t)&&(d=o.offset(),r=d.left,s=d.top+this._data.core.li_height),this.settings.contextmenu.select_node&&!this.is_selected(i)&&this.activate_node(i,a),c=n.items,e.vakata.is_function(c)&&(c=c.call(this,i,function(e){this._show_contextmenu(i,r,s,e)}.bind(this))),e.isPlainObject(c)&&this._show_contextmenu(i,r,s,c)},this._show_contextmenu=function(t,i,r,s){var a=this.get_node(t,!0).children(".jstree-anchor");e(d).one("context_show.vakata.jstree",function(t,i){var r="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";e(i.element).addClass(r),a.addClass("jstree-context")}.bind(this)),this._data.contextmenu.visible=!0,e.vakata.context.show(a,{x:i,y:r},s),this.trigger("show_contextmenu",{node:t,x:i,y:r})}},function(e){var t=!1,i={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};e.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(t){e(d).triggerHandler("context_"+t+".vakata",{reference:i.reference,element:i.element,position:{x:i.position_x,y:i.position_y}})},_execute:function(t){return!(!(t=i.items[t])||t._disabled&&(!e.vakata.is_function(t._disabled)||t._disabled({item:t,reference:i.reference,element:i.element}))||!t.action)&&t.action.call(null,{item:t,reference:i.reference,element:i.element,position:{x:i.position_x,y:i.position_y}})},_parse:function(t,r){if(!t)return!1;r||(i.html="",i.items=[]);var s,a="",n=!1;return r&&(a+=""),r||(i.html=a,e.vakata.context._trigger("parse")),a.length>10&&a},_show_submenu:function(i){if((i=e(i)).length&&i.children("ul").length){var r=i.children("ul"),s=i.offset().left,a=s+i.outerWidth(),n=i.offset().top,o=r.width(),d=r.height(),c=e(window).width()+e(window).scrollLeft(),l=e(window).height()+e(window).scrollTop();t?i[a-(o+10+i.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):i[a+o>c&&s>c-a?"addClass":"removeClass"]("vakata-context-right"),n+d+10>l&&r.css("bottom","-1px"),i.hasClass("vakata-context-right")?sg&&(c=g-(h+20)),l+_+20>u&&(l=u-(_+20)),i.element.css({left:c,top:l}).show().find("a").first().trigger("focus").parent().addClass("vakata-context-hover"),i.is_visible=!0,e.vakata.context._trigger("show"))},hide:function(){i.is_visible&&(i.element.hide().find("ul").hide().end().find(":focus").trigger("blur").end().detach(),i.is_visible=!1,e.vakata.context._trigger("hide"))}},e((function(){t="rtl"===e(d.body).css("direction");var r=!1;i.element=e("
      "),i.element.on("mouseenter","li",(function(t){t.stopImmediatePropagation(),e.contains(this,t.relatedTarget)||(r&&clearTimeout(r),i.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),e(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),e.vakata.context._show_submenu(this))})).on("mouseleave","li",(function(t){e.contains(this,t.relatedTarget)||e(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")})).on("mouseleave",(function(t){e(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),e.vakata.context.settings.hide_onmouseleave&&(r=setTimeout((function(){e.vakata.context.hide()}),e.vakata.context.settings.hide_onmouseleave))})).on("click","a",(function(t){t.preventDefault(),e(this).trigger("blur").parent().hasClass("vakata-context-disabled")||!1===e.vakata.context._execute(e(this).attr("rel"))||e.vakata.context.hide()})).on("keydown","a",(function(t){var r=null;switch(t.which){case 13:case 32:t.type="click",t.preventDefault(),e(t.currentTarget).trigger(t);break;case 37:i.is_visible&&(i.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").trigger("focus"),t.stopImmediatePropagation(),t.preventDefault());break;case 38:i.is_visible&&((r=i.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first()).length||(r=i.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),r.addClass("vakata-context-hover").children("a").trigger("focus"),t.stopImmediatePropagation(),t.preventDefault());break;case 39:i.is_visible&&(i.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").trigger("focus"),t.stopImmediatePropagation(),t.preventDefault());break;case 40:i.is_visible&&((r=i.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first()).length||(r=i.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),r.addClass("vakata-context-hover").children("a").trigger("focus"),t.stopImmediatePropagation(),t.preventDefault());break;case 27:e.vakata.context.hide(),t.preventDefault()}})).on("keydown",(function(e){e.preventDefault();var t=i.element.find(".vakata-contextmenu-shortcut-"+e.which).parent();t.parent().not(".vakata-context-disabled")&&t.trigger("click")})),e(d).on("mousedown.vakata.jstree",(function(t){i.is_visible&&i.element[0]!==t.target&&!e.contains(i.element[0],t.target)&&e.vakata.context.hide()})).on("context_show.vakata.jstree",(function(e,r){i.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),t&&i.element.addClass("vakata-context-rtl").css("direction","rtl"),i.element.find("ul").hide().end()}))}))}(e),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(t,i){this.init=function(e,t){i.init.call(this,e,t),this.settings.dnd.use_html5=this.settings.dnd.use_html5&&"draggable"in d.createElement("span")},this.bind=function(){i.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",function(t){if(this.settings.dnd.large_drag_target&&e(t.target).closest(".jstree-node")[0]!==t.currentTarget)return!0;if("touchstart"===t.type&&(!this.settings.dnd.touch||"selected"===this.settings.dnd.touch&&!e(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").hasClass("jstree-clicked")))return!0;var i=this.get_node(t.target),r=this.is_selected(i)&&this.settings.dnd.drag_selection?this.get_top_selected().length:1,s=r>1?r+" "+this.get_string("nodes"):this.get_text(t.currentTarget);if(this.settings.core.force_text&&(s=e.vakata.html.escape(s)),i&&i.id&&i.id!==e.jstree.root&&(1===t.which||"touchstart"===t.type||"dragstart"===t.type)&&(!0===this.settings.dnd.is_draggable||e.vakata.is_function(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,r>1?this.get_top_selected(!0):[i],t))){if(h={jstree:!0,origin:this,obj:this.get_node(i,!0),nodes:r>1?this.get_top_selected():[i.id]},_=t.currentTarget,!this.settings.dnd.use_html5)return this.element.trigger("mousedown.jstree"),e.vakata.dnd.start(t,h,'
      '+s+'+
      ');e.vakata.dnd._trigger("start",t,{helper:e(),element:_,data:h})}}.bind(this)),this.settings.dnd.use_html5&&this.element.on("dragover.jstree",(function(t){return t.preventDefault(),e.vakata.dnd._trigger("move",t,{helper:e(),element:_,data:h}),!1})).on("drop.jstree",function(t){return t.preventDefault(),e.vakata.dnd._trigger("stop",t,{helper:e(),element:_,data:h}),!1}.bind(this))},this.redraw_node=function(e,t,r,s){if((e=i.redraw_node.apply(this,arguments))&&this.settings.dnd.use_html5)if(this.settings.dnd.large_drag_target)e.setAttribute("draggable",!0);else{var a,n,o=null;for(a=0,n=e.childNodes.length;a ').hide();e(d).on("dragover.vakata.jstree",(function(t){_&&e.vakata.dnd._trigger("move",t,{helper:e(),element:_,data:h})})).on("drop.vakata.jstree",(function(t){_&&(e.vakata.dnd._trigger("stop",t,{helper:e(),element:_,data:h}),_=null,h=null)})).on("dnd_start.vakata.jstree",(function(e,t){i=!1,s=!1,t&&t.data&&t.data.jstree&&n.appendTo(d.body)})).on("dnd_move.vakata.jstree",(function(o,d){var c=d.event.target!==s.target;if(a&&(d.event&&"dragover"===d.event.type&&!c||clearTimeout(a)),d&&d.data&&d.data.jstree&&(!d.event.target.id||"jstree-marker"!==d.event.target.id)){s=d.event;var l,h,_,g,u,f,p,m,v,j,k,b,y,x,w,C,N,T=e.jstree.reference(d.event.target),O=!1,A=!1,S=!1;if(T&&T._data&&T._data.dnd)if(n.attr("class","jstree-"+T.get_theme()+(T.settings.core.themes.responsive?" jstree-dnd-responsive":"")),w=d.data.origin&&(d.data.origin.settings.dnd.always_copy||d.data.origin.settings.dnd.copy&&(d.event.metaKey||d.event.ctrlKey)),d.helper.children().attr("class","jstree-"+T.get_theme()+" jstree-"+T.get_theme()+"-"+T.get_theme_variant()+" "+(T.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[w?"show":"hide"](),d.event.target!==T.element[0]&&d.event.target!==T.get_container_ul()[0]||0!==T.get_container_ul().children().length){if((O=T.settings.dnd.large_drop_target?e(d.event.target).closest(".jstree-node").children(".jstree-anchor"):e(d.event.target).closest(".jstree-anchor"))&&O.length&&O.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(A=O.offset(),S=(d.event.pageY!==t?d.event.pageY:d.event.originalEvent.pageY)-A.top,_=O.outerHeight(),f=S<_/3?["b","i","a"]:S>_-_/3?["a","i","b"]:S>_/2?["i","a","b"]:["i","b","a"],e.each(f,(function(t,s){switch(s){case"b":l=A.left-6,h=A.top,g=T.get_parent(O),u=O.parent().index(),N="jstree-below";break;case"i":y=T.settings.dnd.inside_pos,x=T.get_node(O.parent()),l=A.left-2,h=A.top+_/2+1,g=x.id,u="first"===y?0:"last"===y?x.children.length:Math.min(y,x.children.length),N="jstree-inside";break;case"a":l=A.left-6,h=A.top+_,g=T.get_parent(O),u=O.parent().index()+1,N="jstree-above"}for(p=!0,m=0,v=d.data.nodes.length;me.inArray(d.data.nodes[m],b.children)&&(k-=1)),!(p=p&&(T&&T.settings&&T.settings.dnd&&!1===T.settings.dnd.check_while_dragging||T.check(j,d.data.origin&&d.data.origin!==T?d.data.origin.get_node(d.data.nodes[m]):d.data.nodes[m],g,k,{dnd:!0,ref:T.get_node(O.parent()),pos:s,origin:d.data.origin,is_multi:d.data.origin&&d.data.origin!==T,is_foreign:!d.data.origin})))){T&&T.last_error&&(r=T.last_error());break}var o,S;if("i"===s&&O.parent().is(".jstree-closed")&&T.settings.dnd.open_timeout&&(d.event&&"dragover"===d.event.type&&!c||(a&&clearTimeout(a),a=setTimeout((o=T,S=O,function(){o.open_node(S)}),T.settings.dnd.open_timeout))),p)return(C=T.get_node(g,!0)).hasClass(".jstree-dnd-parent")||(e(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),C.addClass("jstree-dnd-parent")),i={ins:T,par:g,pos:"i"!==s||"last"!==y||0!==u||T.is_loaded(x)?u:"last"},n.css({left:l+"px",top:h+"px"}).show(),n.removeClass("jstree-above jstree-inside jstree-below").addClass(N),d.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),d.event.originalEvent&&d.event.originalEvent.dataTransfer&&(d.event.originalEvent.dataTransfer.dropEffect=w?"copy":"move"),r={},f=!0,!1})),!0===f))return}else{for(p=!0,m=0,v=d.data.nodes.length;m"),escape:function(t){return e.vakata.html.div.text(t).html()},strip:function(t){return e.vakata.html.div.empty().append(e.parseHTML(t)).text()}};var i={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};e.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:10},_trigger:function(i,r,s){s===t&&(s=e.vakata.dnd._get()),s.event=r,e(d).triggerHandler("dnd_"+i+".vakata",s)},_get:function(){return{data:i.data,element:i.element,helper:i.helper}},_clean:function(){i.helper&&i.helper.remove(),i.scroll_i&&(clearInterval(i.scroll_i),i.scroll_i=!1),i={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},_=null,e(d).off("mousemove.vakata.jstree touchmove.vakata.jstree",e.vakata.dnd.drag),e(d).off("mouseup.vakata.jstree touchend.vakata.jstree",e.vakata.dnd.stop)},_scroll:function(t){if(!i.scroll_e||!i.scroll_l&&!i.scroll_t)return i.scroll_i&&(clearInterval(i.scroll_i),i.scroll_i=!1),!1;if(!i.scroll_i)return i.scroll_i=setInterval(e.vakata.dnd._scroll,100),!1;if(!0===t)return!1;var r=i.scroll_e.scrollTop(),s=i.scroll_e.scrollLeft();i.scroll_e.scrollTop(r+i.scroll_t*e.vakata.dnd.settings.scroll_speed),i.scroll_e.scrollLeft(s+i.scroll_l*e.vakata.dnd.settings.scroll_speed),r===i.scroll_e.scrollTop()&&s===i.scroll_e.scrollLeft()||e.vakata.dnd._trigger("scroll",i.scroll_e)},start:function(t,r,s){"touchstart"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=d.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),i.is_drag&&e.vakata.dnd.stop({});try{t.currentTarget.unselectable="on",t.currentTarget.onselectstart=function(){return!1},t.currentTarget.style&&(t.currentTarget.style.touchAction="none",t.currentTarget.style.msTouchAction="none",t.currentTarget.style.MozUserSelect="none")}catch(e){}return i.init_x=t.pageX,i.init_y=t.pageY,i.data=r,i.is_down=!0,i.element=t.currentTarget,i.target=t.target,i.is_touch="touchstart"===t.type,!1!==s&&(i.helper=e("
      ").html(s).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),e(d).on("mousemove.vakata.jstree touchmove.vakata.jstree",e.vakata.dnd.drag),e(d).on("mouseup.vakata.jstree touchend.vakata.jstree",e.vakata.dnd.stop),!1},drag:function(t){if("touchmove"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=d.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),i.is_down){if(!i.is_drag){if(!(Math.abs(t.pageX-i.init_x)>(i.is_touch?e.vakata.dnd.settings.threshold_touch:e.vakata.dnd.settings.threshold)||Math.abs(t.pageY-i.init_y)>(i.is_touch?e.vakata.dnd.settings.threshold_touch:e.vakata.dnd.settings.threshold)))return;i.helper&&(i.helper.appendTo(d.body),i.helper_w=i.helper.outerWidth()),i.is_drag=!0,e(i.target).one("click.vakata",!1),e.vakata.dnd._trigger("start",t)}var r=!1,s=!1,a=!1,n=!1,o=!1,c=!1,l=!1,h=!1,_=!1,g=!1;return i.scroll_t=0,i.scroll_l=0,i.scroll_e=!1,e(e(t.target).parentsUntil("body").addBack().get().reverse()).filter((function(){return/^auto|scroll$/.test(e(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)})).each((function(){var r=e(this),s=r.offset();if(this.scrollHeight>this.offsetHeight&&(s.top+r.height()-t.pageYthis.offsetWidth&&(s.left+r.width()-t.pageXn&&t.pageY-ln&&n-(t.pageY-l)c&&t.pageX-hc&&c-(t.pageX-h)a&&(_=a-50),o&&g+i.helper_w>o&&(g=o-(i.helper_w+2)),i.helper.css({left:g+"px",top:_+"px"})),e.vakata.dnd._trigger("move",t),!1}},stop:function(t){if("touchend"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=d.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),i.is_drag)t.target!==i.target&&e(i.target).off("click.vakata"),e.vakata.dnd._trigger("stop",t);else if("touchend"===t.type&&t.target===i.target){var r=setTimeout((function(){e(t.target).trigger("click")}),100);e(t.target).one("click",(function(){r&&clearTimeout(r)}))}return e.vakata.dnd._clean(),!1}}}(e),e.jstree.defaults.massload=null,e.jstree.plugins.massload=function(t,i){this.init=function(e,t){this._data.massload={},i.init.call(this,e,t)},this._load_nodes=function(t,r,s,a){var n,o,d,c=this.settings.massload,l=[],h=this._model.data;if(!s){for(n=0,o=t.length;n32&&(r.fuzzy=!1),r.fuzzy&&(s=1<=u;o--)if(m=a[e.charAt(o-1)],p[o]=0===i?(p[o+1]<<1|1)&m:(p[o+1]<<1|1)&m|(g[o+1]|g[o])<<1|1|g[o+1],p[o]&s&&(y=n(i,o-1))<=j){if(j=y,k=o-1,x.push(k),!(k>d))break;u=Math.max(1,2*d-k)}if(n(i+1,d)>j)break;g=p}return{isMatch:k>=0,score:y}},!0===i?{search:o}:o(i)},e.vakata.search.defaults={location:0,distance:100,threshold:.6,fuzzy:!1,caseSensitive:!1}}(e),e.jstree.defaults.sort=function(e,t){return this.get_text(e)>this.get_text(t)?1:-1},e.jstree.plugins.sort=function(e,t){this.bind=function(){t.bind.call(this),this.element.on("model.jstree",function(e,t){this.sort(t.parent,!0)}.bind(this)).on("rename_node.jstree create_node.jstree",function(e,t){this.sort(t.parent||t.node.parent,!1),this.redraw_node(t.parent||t.node.parent,!0)}.bind(this)).on("move_node.jstree copy_node.jstree",function(e,t){this.sort(t.parent,!1),this.redraw_node(t.parent,!0)}.bind(this))},this.sort=function(e,t){var i,r;if((e=this.get_node(e))&&e.children&&e.children.length&&(e.children.sort(this.settings.sort.bind(this)),t))for(i=0,r=e.children_d.length;it.ttl)&&(t&&t.state&&(t=t.state),t&&e.vakata.is_function(this.settings.state.filter)&&(t=this.settings.state.filter.call(this,t)),!!t&&(this.settings.state.preserve_loaded||delete t.core.loaded,this.element.one("set_state.jstree",(function(i,r){r.instance.trigger("restore_state",{state:e.extend(!0,{},t)})})),this.set_state(t),!0))},this.clear_state=function(){return e.vakata.storage.del(this.settings.state.key)}},function(e,t){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),e.jstree.defaults.types={default:{}},e.jstree.defaults.types[e.jstree.root]={},e.jstree.plugins.types=function(i,r){this.init=function(i,s){var a,n;if(s&&s.types&&s.types.default)for(a in s.types)if("default"!==a&&a!==e.jstree.root&&s.types.hasOwnProperty(a))for(n in s.types.default)s.types.default.hasOwnProperty(n)&&s.types[a][n]===t&&(s.types[a][n]=s.types.default[n]);r.init.call(this,i,s),this._model.data[e.jstree.root].type=e.jstree.root},this.refresh=function(t,i){r.refresh.call(this,t,i),this._model.data[e.jstree.root].type=e.jstree.root},this.bind=function(){this.element.on("model.jstree",function(i,r){var s,a,n,o=this._model.data,d=r.nodes,c=this.settings.types,l="default";for(s=0,a=d.length;s .jstree-ocl",function(t){t.stopImmediatePropagation();var i=e.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});e(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(i).trigger("focus")}.bind(this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",function(e){return e.stopImmediatePropagation(),this.is_disabled(e.currentTarget)||this.hover_node(e.currentTarget),!1}.bind(this)).on("mouseleave.jstree",".jstree-node",function(e){this.dehover_node(e.currentTarget)}.bind(this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),i.teardown.call(this)},this.redraw_node=function(t,r,s,a){if(t=i.redraw_node.apply(this,arguments)){var n=f.cloneNode(!0);-1!==e.inArray(t.id,this._data.core.selected)&&(n.className+=" jstree-wholerow-clicked"),this._data.core.focused&&this._data.core.focused===t.id&&(n.className+=" jstree-wholerow-hovered"),t.insertBefore(n,t.childNodes[0])}return t}},window.customElements&&Object&&Object.create){var p=Object.create(HTMLElement.prototype);p.createdCallback=function(){var t,i={core:{},plugins:[]};for(t in e.jstree.plugins)e.jstree.plugins.hasOwnProperty(t)&&this.attributes[t]&&(i.plugins.push(t),this.getAttribute(t)&&JSON.parse(this.getAttribute(t))&&(i[t]=JSON.parse(this.getAttribute(t))));for(t in e.jstree.defaults.core)e.jstree.defaults.core.hasOwnProperty(t)&&this.attributes[t]&&(i.core[t]=JSON.parse(this.getAttribute(t))||this.getAttribute(t));e(this).jstree(i)};try{window.customElements.define("vakata-jstree",(function(){}),{prototype:p})}catch(e){}}}}));