/*! jQuery UI - v1.13.2 - 2022-12-29
* http://jqueryui.com
* Includes: widget.js, position.js, keycode.js, scroll-parent.js, unique-id.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){"use strict";e.ui=e.ui||{};e.ui.version="1.13.2";var t,i=0,n=Array.prototype.hasOwnProperty,o=Array.prototype.slice;e.cleanData=(t=e.cleanData,function(i){for(var n,o,r=0;null!=(o=i[r]);r++)(n=e._data(o,"events"))&&n.remove&&e(o).triggerHandler("remove");t(i)}),e.widget=function(t,i,n){var o,r,s,a={},l=t.split(".")[0],d=l+"-"+(t=t.split(".")[1]);return n||(n=i,i=e.Widget),Array.isArray(n)&&(n=e.extend.apply(null,[{}].concat(n))),e.expr.pseudos[d.toLowerCase()]=function(t){return!!e.data(t,d)},e[l]=e[l]||{},o=e[l][t],r=e[l][t]=function(e,t){if(!this||!this._createWidget)return new r(e,t);arguments.length&&this._createWidget(e,t)},e.extend(r,o,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),(s=new i).options=e.widget.extend({},s.options),e.each(n,function(e,t){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}a[e]="function"==typeof t?function(){var e,i=this._super,r=this._superApply;return this._super=n,this._superApply=o,e=t.apply(this,arguments),this._super=i,this._superApply=r,e}:t}),r.prototype=e.widget.extend(s,{widgetEventPrefix:o&&s.widgetEventPrefix||t},a,{constructor:r,namespace:l,widgetName:t,widgetFullName:d}),o?(e.each(o._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,r,i._proto)}),delete o._childConstructors):i._childConstructors.push(r),e.widget.bridge(t,r),r},e.widget.extend=function(t){for(var i,r,s=o.call(arguments,1),a=0,l=s.length;a<l;a++)for(i in s[a])r=s[a][i],n.call(s[a],i)&&void 0!==r&&(e.isPlainObject(r)?t[i]=e.isPlainObject(t[i])?e.widget.extend({},t[i],r):e.widget.extend({},r):t[i]=r);return t},e.widget.bridge=function(t,i){var n=i.prototype.widgetFullName||t;e.fn[t]=function(r){var s="string"==typeof r,a=o.call(arguments,1),l=this;return s?this.length||"instance"!==r?this.each(function(){var i,o=e.data(this,n);return"instance"===r?(l=o,!1):o?"function"!=typeof o[r]||"_"===r.charAt(0)?e.error("no such method '"+r+"' for "+t+" widget instance"):(i=o[r].apply(o,a))!==o&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0:e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+r+"'")}):l=void 0:(a.length&&(r=e.widget.extend.apply(null,[r].concat(a))),this.each(function(){var t=e.data(this,n);t?(t.option(r||{}),t._init&&t._init()):e.data(this,n,new i(r,this))})),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,function(e,i){t._removeClass(i,e)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var n,o,r,s=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(s={},t=(n=t.split(".")).shift(),n.length){for(o=s[t]=e.widget.extend({},this.options[t]),r=0;r<n.length-1;r++)o[n[r]]=o[n[r]]||{},o=o[n[r]];if(t=n.pop(),1===arguments.length)return void 0===o[t]?null:o[t];o[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];s[t]=i}return this._setOptions(s),this},_setOptions:function(e){for(var t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var i,n,o;for(i in t)o=this.classesElementLookup[i],t[i]!==this.options.classes[i]&&o&&o.length&&(n=e(o.get()),this._removeClass(o,i),n.addClass(this._classes({element:n,keys:i,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){var i=[],n=this;function o(o,r){for(var s,a=0;a<o.length;a++)s=n.classesElementLookup[o[a]]||e(),s=t.add?(function(){var i=[];t.element.each(function(t,o){e.map(n.classesElementLookup,function(e){return e}).some(function(e){return e.is(o)})||i.push(o)}),n._on(e(i),{remove:"_untrackClassesElement"})}(),e(e.uniqueSort(s.get().concat(t.element.get())))):e(s.not(t.element).get()),n.classesElementLookup[o[a]]=s,i.push(o[a]),r&&t.classes[o[a]]&&i.push(t.classes[o[a]])}return(t=e.extend({element:this.element,classes:this.options.classes||{}},t)).keys&&o(t.keys.match(/\S+/g)||[],!0),t.extra&&o(t.extra.match(/\S+/g)||[]),i.join(" ")},_untrackClassesElement:function(t){var i=this;e.each(i.classesElementLookup,function(n,o){-1!==e.inArray(t.target,o)&&(i.classesElementLookup[n]=e(o.not(t.target).get()))}),this._off(e(t.target))},_removeClass:function(e,t,i){return this._toggleClass(e,t,i,!1)},_addClass:function(e,t,i){return this._toggleClass(e,t,i,!0)},_toggleClass:function(e,t,i,n){var o="string"==typeof e||null===e,i={extra:o?t:i,keys:o?e:t,element:o?this.element:e,add:n="boolean"==typeof n?n:i};return i.element.toggleClass(this._classes(i),n),this},_on:function(t,i,n){var o,r=this;"boolean"!=typeof t&&(n=i,i=t,t=!1),n?(i=o=e(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,o=this.widget()),e.each(n,function(n,s){function a(){if(t||!0!==r.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof s?r[s]:s).apply(r,arguments)}"string"!=typeof s&&(a.guid=s.guid=s.guid||a.guid||e.guid++);var l=n.match(/^([\w:-]*)\s*(.*)$/),n=l[1]+r.eventNamespace,l=l[2];l?o.on(n,l,a):i.on(n,a)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){var i=this;return setTimeout(function(){return("string"==typeof e?i[e]:e).apply(i,arguments)},t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,i,n){var o,r,s=this.options[t];if(n=n||{},(i=e.Event(i)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],r=i.originalEvent)for(o in r)o in i||(i[o]=r[o]);return this.element.trigger(i,n),!("function"==typeof s&&!1===s.apply(this.element[0],[i].concat(n))||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(n,o,r){var s,a=(o="string"==typeof o?{effect:o}:o)?!0!==o&&"number"!=typeof o&&o.effect||i:t;"number"==typeof(o=o||{})?o={duration:o}:!0===o&&(o={}),s=!e.isEmptyObject(o),o.complete=r,o.delay&&n.delay(o.delay),s&&e.effects&&e.effects.effect[a]?n[t](o):a!==t&&n[a]?n[a](o.duration,o.easing,r):n.queue(function(i){e(this)[t](),r&&r.call(n[0]),i()})}});var r,s,a,l,d,c,u,h,f;e.widget;function p(e,t,i){return[parseFloat(e[0])*(h.test(e[0])?t/100:1),parseFloat(e[1])*(h.test(e[1])?i/100:1)]}function g(t,i){return parseInt(e.css(t,i),10)||0}function v(e){return null!=e&&e===e.window}s=Math.max,a=Math.abs,l=/left|center|right/,d=/top|center|bottom/,c=/[\+\-]\d+(\.[\d]+)?%?/,u=/^\w+/,h=/%$/,f=e.fn.position,e.position={scrollbarWidth:function(){if(void 0!==r)return r;var t,i=e("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),n=i.children()[0];return e("body").append(i),t=n.offsetWidth,i.css("overflow","scroll"),t===(n=n.offsetWidth)&&(n=i[0].clientWidth),i.remove(),r=t-n},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),n=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),i="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth;return{width:"scroll"===n||"auto"===n&&t.height<t.element[0].scrollHeight?e.position.scrollbarWidth():0,height:i?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),n=v(i[0]),o=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:n,isDocument:o,offset:!n&&!o?e(t).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return f.apply(this,arguments);var i,n,o,r,h,y,m="string"==typeof(t=e.extend({},t)).of?e(document).find(t.of):e(t.of),b=e.position.getWithinInfo(t.within),x=e.position.getScrollInfo(b),_=(t.collision||"flip").split(" "),w={},k=9===(y=(k=m)[0]).nodeType?{width:k.width(),height:k.height(),offset:{top:0,left:0}}:v(y)?{width:k.width(),height:k.height(),offset:{top:k.scrollTop(),left:k.scrollLeft()}}:y.preventDefault?{width:0,height:0,offset:{top:y.pageY,left:y.pageX}}:{width:k.outerWidth(),height:k.outerHeight(),offset:k.offset()};return m[0].preventDefault&&(t.at="left top"),n=k.width,o=k.height,h=e.extend({},r=k.offset),e.each(["my","at"],function(){var e,i,n=(t[this]||"").split(" ");(n=1===n.length?l.test(n[0])?n.concat(["center"]):d.test(n[0])?["center"].concat(n):["center","center"]:n)[0]=l.test(n[0])?n[0]:"center",n[1]=d.test(n[1])?n[1]:"center",e=c.exec(n[0]),i=c.exec(n[1]),w[this]=[e?e[0]:0,i?i[0]:0],t[this]=[u.exec(n[0])[0],u.exec(n[1])[0]]}),1===_.length&&(_[1]=_[0]),"right"===t.at[0]?h.left+=n:"center"===t.at[0]&&(h.left+=n/2),"bottom"===t.at[1]?h.top+=o:"center"===t.at[1]&&(h.top+=o/2),i=p(w.at,n,o),h.left+=i[0],h.top+=i[1],this.each(function(){var l,d,c=e(this),u=c.outerWidth(),f=c.outerHeight(),v=g(this,"marginLeft"),y=g(this,"marginTop"),k=u+v+g(this,"marginRight")+x.width,C=f+y+g(this,"marginBottom")+x.height,N=e.extend({},h),S=p(w.my,c.outerWidth(),c.outerHeight());"right"===t.my[0]?N.left-=u:"center"===t.my[0]&&(N.left-=u/2),"bottom"===t.my[1]?N.top-=f:"center"===t.my[1]&&(N.top-=f/2),N.left+=S[0],N.top+=S[1],l={marginLeft:v,marginTop:y},e.each(["left","top"],function(r,s){e.ui.position[_[r]]&&e.ui.position[_[r]][s](N,{targetWidth:n,targetHeight:o,elemWidth:u,elemHeight:f,collisionPosition:l,collisionWidth:k,collisionHeight:C,offset:[i[0]+S[0],i[1]+S[1]],my:t.my,at:t.at,within:b,elem:c})}),t.using&&(d=function(e){var i=r.left-N.left,l=i+n-u,d=r.top-N.top,h=d+o-f,p={target:{element:m,left:r.left,top:r.top,width:n,height:o},element:{element:c,left:N.left,top:N.top,width:u,height:f},horizontal:l<0?"left":0<i?"right":"center",vertical:h<0?"top":0<d?"bottom":"middle"};n<u&&a(i+l)<n&&(p.horizontal="center"),o<f&&a(d+h)<o&&(p.vertical="middle"),s(a(i),a(l))>s(a(d),a(h))?p.important="horizontal":p.important="vertical",t.using.call(this,e,p)}),c.offset(e.extend(N,{using:d}))})},e.ui.position={fit:{left:function(e,t){var i=t.within,n=i.isWindow?i.scrollLeft:i.offset.left,o=i.width,r=e.left-t.collisionPosition.marginLeft,a=n-r,l=r+t.collisionWidth-o-n;t.collisionWidth>o?0<a&&l<=0?(i=e.left+a+t.collisionWidth-o-n,e.left+=a-i):e.left=!(0<l&&a<=0)&&l<a?n+o-t.collisionWidth:n:0<a?e.left+=a:0<l?e.left-=l:e.left=s(e.left-r,e.left)},top:function(e,t){var i=t.within,n=i.isWindow?i.scrollTop:i.offset.top,o=t.within.height,r=e.top-t.collisionPosition.marginTop,a=n-r,l=r+t.collisionHeight-o-n;t.collisionHeight>o?0<a&&l<=0?(i=e.top+a+t.collisionHeight-o-n,e.top+=a-i):e.top=!(0<l&&a<=0)&&l<a?n+o-t.collisionHeight:n:0<a?e.top+=a:0<l?e.top-=l:e.top=s(e.top-r,e.top)}},flip:{left:function(e,t){var i=t.within,n=i.offset.left+i.scrollLeft,o=i.width,r=i.isWindow?i.scrollLeft:i.offset.left,s=e.left-t.collisionPosition.marginLeft,l=s-r,d=s+t.collisionWidth-o-r,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,i="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,s=-2*t.offset[0];l<0?((n=e.left+c+i+s+t.collisionWidth-o-n)<0||n<a(l))&&(e.left+=c+i+s):0<d&&(0<(r=e.left-t.collisionPosition.marginLeft+c+i+s-r)||a(r)<d)&&(e.left+=c+i+s)},top:function(e,t){var i=t.within,n=i.offset.top+i.scrollTop,o=i.height,r=i.isWindow?i.scrollTop:i.offset.top,s=e.top-t.collisionPosition.marginTop,l=s-r,d=s+t.collisionHeight-o-r,c="top"===t.my[1]?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,i="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,s=-2*t.offset[1];l<0?((n=e.top+c+i+s+t.collisionHeight-o-n)<0||n<a(l))&&(e.top+=c+i+s):0<d&&(0<(r=e.top-t.collisionPosition.marginTop+c+i+s-r)||a(r)<d)&&(e.top+=c+i+s)}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}};var y;e.ui.position,e.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},e.fn.scrollParent=function(t){var i=this.css("position"),n="absolute"===i,o=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=e(this);return(!n||"static"!==t.css("position"))&&o.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&t.length?t:e(this[0].ownerDocument||document)},e.fn.extend({uniqueId:(y=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++y)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}})});
/*! jQuery Fancytree Plugin - 2.38.2 - 2022-06-30T18:24:06Z
* https://github.com/mar10/fancytree 'jquery.fancytree.min.js'
* Copyright (c) 2022 Martin Wendt; Licensed MIT
*/!function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree.ui-deps"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree.ui-deps"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";if(!e.ui||!e.ui.fancytree){for(var t,i=null,n=new RegExp(/\.|\//),o=/[&<>"'/]/g,r=/[<>"'/]/g,s="$recursive_request",a="$request_target_invalid",l={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},d={16:!0,17:!0,18:!0},c={8:"backspace",9:"tab",10:"return",13:"return",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",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:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},u={16:"shift",17:"ctrl",18:"alt",91:"meta",93:"meta"},h={0:"",1:"left",2:"middle",3:"right"},f="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),p={},g="columns types".split(" "),v="checkbox expanded extraClasses folder icon iconTooltip key lazy partsel radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),y={},m={},b={active:!0,children:!0,data:!0,focus:!0},x=0;x<f.length;x++)p[f[x]]=!0;for(x=0;x<v.length;x++)t=v[x],y[t]=!0,t!==t.toLowerCase()&&(m[t.toLowerCase()]=t);var _=Array.isArray;return w(e.ui,"Fancytree requires jQuery UI (http://jqueryui.com)"),Date.now||(Date.now=function(){return(new Date).getTime()}),O.prototype={_findDirectChild:function(e){var t,i,n=this.children;if(n)if("string"==typeof e){for(t=0,i=n.length;t<i;t++)if(n[t].key===e)return n[t]}else{if("number"==typeof e)return this.children[e];if(e.parent===this)return e}return null},_setChildren:function(e){w(e&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var t=0,i=e.length;t<i;t++)this.children.push(new O(this,e[t]));this.tree._callHook("treeStructureChanged",this.tree,"setChildren")},addChildren:function(t,i){var n,o,r,s,a=this.getFirstChild(),l=this.getLastChild(),d=[];for(e.isPlainObject(t)&&(t=[t]),this.children||(this.children=[]),n=0,o=t.length;n<o;n++)d.push(new O(this,t[n]));if(s=d[0],null==i?this.children=this.children.concat(d):(i=this._findDirectChild(i),w(0<=(r=e.inArray(i,this.children)),"insertBefore must be an existing child"),this.children.splice.apply(this.children,[r,0].concat(d))),a&&!i){for(n=0,o=d.length;n<o;n++)d[n].render();a!==this.getFirstChild()&&a.renderStatus(),l!==this.getLastChild()&&l.renderStatus()}else this.parent&&!this.parent.ul&&!this.tr||this.render();return 3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),this.triggerModifyChild("add",1===d.length?d[0]:null),s},addClass:function(e){return this.toggleClass(e,!0)},addNode:function(e,t){switch(t=void 0===t||"over"===t?"child":t){case"after":return this.getParent().addChildren(e,this.getNextSibling());case"before":return this.getParent().addChildren(e,this);case"firstChild":var i=this.children?this.children[0]:null;return this.addChildren(e,i);case"child":case"over":return this.addChildren(e)}w(!1,"Invalid mode: "+t)},addPagingNode:function(t,i){var n,o;if(i=i||"child",!1!==t)return t=e.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},t),this.partload=!0,this.addNode(t,i);for(n=this.children.length-1;0<=n;n--)"paging"===(o=this.children[n]).statusNodeType&&this.removeChild(o);this.partload=!1},appendSibling:function(e){return this.addNode(e,"after")},applyCommand:function(e,t){return this.tree.applyCommand(e,this,t)},applyPatch:function(e){if(null===e)return this.remove(),T(this);var t,i,n={children:!0,expanded:!0,parent:!0};for(t in e)k(e,t)&&(i=e[t],n[t]||C(i)||(y[t]?this[t]=i:this.data[t]=i));return k(e,"children")&&(this.removeChildren(),e.children&&this._setChildren(e.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),k(e,"expanded")?this.setExpanded(e.expanded):T(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(e,t,i){return e.addNode(this.toDict(!0,i),t)},countChildren:function(e){var t,i,n,o=this.children;if(!o)return 0;if(n=o.length,!1!==e)for(t=0,i=n;t<i;t++)n+=o[t].countChildren();return n},debug:function(e){4<=this.tree.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),S("log",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},discardMarkup:function(e){this.tree._callHook(e?"nodeRemoveMarkup":"nodeRemoveChildMarkup",this)},error:function(e){1<=this.tree.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),S("error",arguments))},findAll:function(e){e=C(e)?e:F(e);var t=[];return this.visit(function(i){e(i)&&t.push(i)}),t},findFirst:function(e){e=C(e)?e:F(e);var t=null;return this.visit(function(i){if(e(i))return t=i,!1}),t},findRelatedNode:function(e,t){return this.tree.findRelatedNode(this,e,t)},_changeSelectStatusAttrs:function(e){var t=!1,n=this.tree.options,o=i.evalOption("unselectable",this,this,n,!1),n=i.evalOption("unselectableStatus",this,this,n,void 0);switch(e=o&&null!=n?n:e){case!1:t=this.selected||this.partsel,this.selected=!1,this.partsel=!1;break;case!0:t=!this.selected||!this.partsel,this.selected=!0,this.partsel=!0;break;case void 0:t=this.selected||!this.partsel,this.selected=!1,this.partsel=!0;break;default:w(!1,"invalid state: "+e)}return t&&this.renderStatus(),t},fixSelection3AfterClick:function(e){var t=this.isSelected();this.visit(function(e){if(e._changeSelectStatusAttrs(t),e.radiogroup)return"skip"}),this.fixSelection3FromEndNodes(e)},fixSelection3FromEndNodes:function(e){var t=this.tree.options;w(3===t.selectMode,"expected selectMode 3"),function e(n){var o,r,s,a,l,d,c,u,h=n.children;if(h&&h.length){for(c=!(d=!0),o=0,r=h.length;o<r;o++)a=e(s=h[o]),i.evalOption("unselectableIgnore",s,s,t,!1)||(!1!==a&&(c=!0),!0!==a&&(d=!1));l=!!d||!!c&&void 0}else l=null==(u=i.evalOption("unselectableStatus",n,n,t,void 0))?!!n.selected:!!u;return n.partsel&&!n.selected&&n.lazy&&null==n.children&&(l=void 0),n._changeSelectStatusAttrs(l),l}(this),this.visitParents(function(e){for(var n,o,r,s=e.children,a=!0,l=!1,d=0,c=s.length;d<c;d++)n=s[d],i.evalOption("unselectableIgnore",n,n,t,!1)||(((o=null==(r=i.evalOption("unselectableStatus",n,n,t,void 0))?!!n.selected:!!r)||n.partsel)&&(l=!0),o||(a=!1));e._changeSelectStatusAttrs(o=!!a||!!l&&void 0)})},fromDict:function(t){for(var i in t)y[i]?this[i]=t[i]:"data"===i?e.extend(this.data,t.data):C(t[i])||b[i]||(this.data[i]=t[i]);t.children&&(this.removeChildren(),this.addChildren(t.children)),this.renderTitle()},getChildren:function(){if(void 0!==this.hasChildren())return this.children},getFirstChild:function(){return this.children?this.children[0]:null},getIndex:function(){return e.inArray(this,this.parent.children)},getIndexHier:function(t,i){t=t||".";var n,o=[];return e.each(this.getParentList(!1,!0),function(e,t){n=""+(t.getIndex()+1),i&&(n=("0000000"+n).substr(-i)),o.push(n)}),o.join(t)},getKeyPath:function(e){var t=this.tree.options.keyPathSeparator;return t+this.getPath(!e,"key",t)},getLastChild:function(){return this.children?this.children[this.children.length-1]:null},getLevel:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e},getNextSibling:function(){if(this.parent)for(var e=this.parent.children,t=0,i=e.length-1;t<i;t++)if(e[t]===this)return e[t+1];return null},getParent:function(){return this.parent},getParentList:function(e,t){for(var i=[],n=t?this:this.parent;n;)(e||n.parent)&&i.unshift(n),n=n.parent;return i},getPath:function(e,t,i){i=i||"/";var n,o=[],r=C(t=t||"title");return this.visitParents(function(e){e.parent&&(n=r?t(e):e[t],o.unshift(n))},e=!1!==e),o.join(i)},getPrevSibling:function(){if(this.parent)for(var e=this.parent.children,t=1,i=e.length;t<i;t++)if(e[t]===this)return e[t-1];return null},getSelectedNodes:function(e){var t=[];return this.visit(function(i){if(i.selected&&(t.push(i),!0===e))return"skip"}),t},hasChildren:function(){return this.lazy?null==this.children?void 0:0!==this.children.length&&(1!==this.children.length||!this.children[0].isStatusNode()||void 0):!(!this.children||!this.children.length)},hasClass:function(e){return 0<=(" "+(this.extraClasses||"")+" ").indexOf(" "+e+" ")},hasFocus:function(){return this.tree.hasFocus()&&this.tree.focusNode===this},info:function(e){3<=this.tree.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),S("info",arguments))},isActive:function(){return this.tree.activeNode===this},isBelowOf:function(e){return this.getIndexHier(".",5)>e.getIndexHier(".",5)},isChildOf:function(e){return this.parent&&this.parent===e},isDescendantOf:function(t){if(!t||t.tree!==this.tree)return!1;for(var i=this.parent;i;){if(i===t)return!0;i===i.parent&&e.error("Recursive parent link: "+i),i=i.parent}return!1},isExpanded:function(){return!!this.expanded},isFirstSibling:function(){var e=this.parent;return!e||e.children[0]===this},isFolder:function(){return!!this.folder},isLastSibling:function(){var e=this.parent;return!e||e.children[e.children.length-1]===this},isLazy:function(){return!!this.lazy},isLoaded:function(){return!this.lazy||void 0!==this.hasChildren()},isLoading:function(){return!!this._isLoading},isRoot:function(){return this.isRootNode()},isPartsel:function(){return!this.selected&&!!this.partsel},isPartload:function(){return!!this.partload},isRootNode:function(){return this.tree.rootNode===this},isSelected:function(){return!!this.selected},isStatusNode:function(){return!!this.statusNodeType},isPagingNode:function(){return"paging"===this.statusNodeType},isTopLevel:function(){return this.tree.rootNode===this.parent},isUndefined:function(){return void 0===this.hasChildren()},isVisible:function(){var e,t,i=this.tree.enableFilter,n=this.getParentList(!1,!1);if(i&&!this.match&&!this.subMatchCount)return!1;for(e=0,t=n.length;e<t;e++)if(!n[e].expanded)return!1;return!0},lazyLoad:function(t){e.error("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead.")},load:function(e){var t=this,i=this.isExpanded();return w(this.isLazy(),"load() requires a lazy node"),e||this.isUndefined()?(this.isLoaded()&&this.resetLazy(),!1===(e=this.tree._triggerNodeEvent("lazyLoad",this))?T(this):(w("boolean"!=typeof e,"lazyLoad event must return source in data.result"),e=this.tree._callHook("nodeLoadChildren",this,e),i?(this.expanded=!0,e.always(function(){t.render()})):e.always(function(){t.renderStatus()}),e)):T(this)},makeVisible:function(t){for(var i=this,n=[],o=new e.Deferred,r=this.getParentList(!1,!1),s=r.length,a=!(t&&!0===t.noAnimation),l=!(t&&!1===t.scrollIntoView),d=s-1;0<=d;d--)n.push(r[d].setExpanded(!0,t));return e.when.apply(e,n).done(function(){l?i.scrollIntoView(a).done(function(){o.resolve()}):o.resolve()}),o.promise()},moveTo:function(t,i,n){void 0===i||"over"===i?i="child":"firstChild"===i&&(t.children&&t.children.length?(i="before",t=t.children[0]):i="child");var o,r=this.tree,s=this.parent,a="child"===i?t:t.parent;if(this!==t){if(this.parent?a.isDescendantOf(this)&&e.error("Cannot move a node to its own descendant"):e.error("Cannot move system root"),a!==s&&s.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===a)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else w(0<=(o=e.inArray(this,this.parent.children)),"invalid source parent"),this.parent.children.splice(o,1);if((this.parent=a).hasChildren())switch(i){case"child":a.children.push(this);break;case"before":w(0<=(o=e.inArray(t,a.children)),"invalid target parent"),a.children.splice(o,0,this);break;case"after":w(0<=(o=e.inArray(t,a.children)),"invalid target parent"),a.children.splice(o+1,0,this);break;default:e.error("Invalid mode "+i)}else a.children=[this];n&&t.visit(n,!0),a===s?a.triggerModifyChild("move",this):a.triggerModifyChild("add",this),r!==t.tree&&(this.warn("Cross-tree moveTo is experimental!"),this.visit(function(e){e.tree=t.tree},!0)),r._callHook("treeStructureChanged",r,"moveTo"),s.isDescendantOf(a)||s.render(),a.isDescendantOf(s)||a===s||a.render()}},navigate:function(t,i){var n=e.ui.keyCode;switch(t){case"left":case n.LEFT:if(this.expanded)return this.setExpanded(!1);break;case"right":case n.RIGHT:if(!this.expanded&&(this.children||this.lazy))return this.setExpanded()}if(n=this.findRelatedNode(t)){try{n.makeVisible({scrollIntoView:!1})}catch(t){}return!1===i?(n.setFocus(),T()):n.setActive()}return this.warn("Could not find related node '"+t+"'."),T()},remove:function(){return this.parent.removeChild(this)},removeChild:function(e){return this.tree._callHook("nodeRemoveChild",this,e)},removeChildren:function(){return this.tree._callHook("nodeRemoveChildren",this)},removeClass:function(e){return this.toggleClass(e,!1)},render:function(e,t){return this.tree._callHook("nodeRender",this,e,t)},renderTitle:function(){return this.tree._callHook("nodeRenderTitle",this)},renderStatus:function(){return this.tree._callHook("nodeRenderStatus",this)},replaceWith:function(t){var i=this.parent,n=e.inArray(this,i.children),o=this;return w(this.isPagingNode(),"replaceWith() currently requires a paging status node"),(t=this.tree._callHook("nodeLoadChildren",this,t)).done(function(e){var t=o.children;for(x=0;x<t.length;x++)t[x].parent=i;i.children.splice.apply(i.children,[n+1,0].concat(t)),o.children=null,o.remove(),i.render()}).fail(function(){o.setExpanded()}),t},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=void 0,this.renderStatus()},scheduleAction:function(t,i){this.tree.timer&&(clearTimeout(this.tree.timer),this.tree.debug("clearTimeout(%o)",this.tree.timer)),this.tree.timer=null;var n=this;switch(t){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){n.tree.debug("setTimeout: trigger expand"),n.setExpanded(!0)},i);break;case"activate":this.tree.timer=setTimeout(function(){n.tree.debug("setTimeout: trigger activate"),n.setActive(!0)},i);break;default:e.error("Invalid mode "+t)}},scrollIntoView:function(t,i){if(void 0!==i&&((g=i).tree&&void 0!==g.statusNodeType))throw Error("scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.");var n=e.extend({effects:!0===t?{duration:200,queue:!1}:t,scrollOfs:this.tree.options.scrollOfs,scrollParent:this.tree.options.scrollParent,topNode:null},i),o=n.scrollParent,r=this.tree.$container,s=r.css("overflow-y");o?o.jquery||(o=e(o)):o=!this.tree.tbody&&("scroll"===s||"auto"===s)?r:r.scrollParent(),o[0]!==document&&o[0]!==document.body||(this.debug("scrollIntoView(): normalizing scrollParent to 'window':",o[0]),o=e(window));var a,l,d=new e.Deferred,c=this,u=e(this.span).height(),h=n.scrollOfs.top||0,f=n.scrollOfs.bottom||0,p=o.height(),g=o.scrollTop(),t=o,i=o[0]===window,s=n.topNode||null,r=null;return this.isRootNode()||!this.isVisible()?(this.info("scrollIntoView(): node is invisible."),T()):(i?(l=e(this.span).offset().top,a=s&&s.span?e(s.span).offset().top:0,t=e("html,body")):(w(o[0]!==document&&o[0]!==document.body,"scrollParent should be a simple element or `window`, not document or body."),i=o.offset().top,l=e(this.span).offset().top-i+g,a=s?e(s.span).offset().top-i+g:0,p-=Math.max(0,o.innerHeight()-o[0].clientHeight)),l<g+h?r=l-h:g+p-f<l+u&&(r=l+u-p+f,s&&(w(s.isRootNode()||s.isVisible(),"topNode must be visible"),a<r&&(r=a-h))),null===r?d.resolveWith(this):n.effects?(n.effects.complete=function(){d.resolveWith(c)},t.stop(!0).animate({scrollTop:r},n.effects)):(t[0].scrollTop=r,d.resolveWith(this)),d.promise())},setActive:function(e,t){return this.tree._callHook("nodeSetActive",this,e,t)},setExpanded:function(e,t){return this.tree._callHook("nodeSetExpanded",this,e,t)},setFocus:function(e){return this.tree._callHook("nodeSetFocus",this,e)},setSelected:function(e,t){return this.tree._callHook("nodeSetSelected",this,e,t)},setStatus:function(e,t,i){return this.tree._callHook("nodeSetStatus",this,e,t,i)},setTitle:function(e){this.title=e,this.renderTitle(),this.triggerModify("rename")},sortChildren:function(e,t){var i,n,o=this.children;if(o){if(o.sort(e=e||function(e,t){e=e.title.toLowerCase(),t=t.title.toLowerCase();return e===t?0:t<e?1:-1}),t)for(i=0,n=o.length;i<n;i++)o[i].children&&o[i].sortChildren(e,"$norender$");"$norender$"!==t&&this.render(),this.triggerModifyChild("sort")}},toDict:function(t,i){var n,o,r,s,a={},l=this;if(e.each(v,function(e,t){!l[t]&&!1!==l[t]||(a[t]=l[t])}),e.isEmptyObject(this.data)||(a.data=e.extend({},this.data),e.isEmptyObject(a.data)&&delete a.data),i){if(!1===(s=i(a,l)))return!1;"skip"===s&&(t=!1)}if(t&&_(this.children))for(a.children=[],n=0,o=this.children.length;n<o;n++)(r=this.children[n]).isStatusNode()||!1!==(s=r.toDict(!0,i))&&a.children.push(s);return a},toggleClass:function(t,i){var n,o,r=t.match(/\S+/g)||[],s=0,a=!1,l=this[this.tree.statusClassPropName],d=" "+(this.extraClasses||"")+" ";for(l&&e(l).toggleClass(t,i);n=r[s++];)if(o=0<=d.indexOf(" "+n+" "),i=void 0===i?!o:!!i)o||(d+=n+" ",a=!0);else for(;-1<d.indexOf(" "+n+" ");)d=d.replace(" "+n+" "," ");return this.extraClasses=N(d),a},toggleExpanded:function(){return this.tree._callHook("nodeToggleExpanded",this)},toggleSelected:function(){return this.tree._callHook("nodeToggleSelected",this)},toString:function(){return"FancytreeNode@"+this.key+"[title='"+this.title+"']"},triggerModifyChild:function(t,i,n){var o=this.tree.options.modifyChild;o&&(i&&i.parent!==this&&e.error("childNode "+i+" is not a child of "+this),i={node:this,tree:this.tree,operation:t,childNode:i||null},n&&e.extend(i,n),o({type:"modifyChild"},i))},triggerModify:function(e,t){this.parent.triggerModifyChild(e,this,t)},visit:function(e,t){var i,n,o=!0,r=this.children;if(!0===t&&(!1===(o=e(this))||"skip"===o))return o;if(r)for(i=0,n=r.length;i<n&&!1!==(o=r[i].visit(e,!0));i++);return o},visitAndLoad:function(t,i,n){var o,r,s,a=this;return!t||!0!==i||!1!==(r=t(a))&&"skip"!==r?a.children||a.lazy?(o=new e.Deferred,s=[],a.load().done(function(){for(var i=0,n=a.children.length;i<n;i++){if(!1===(r=a.children[i].visitAndLoad(t,!0,!0))){o.reject();break}"skip"!==r&&s.push(r)}e.when.apply(this,s).then(function(){o.resolve()})}),o.promise()):T():n?r:T()},visitParents:function(e,t){if(t&&!1===e(this))return!1;for(var i=this.parent;i;){if(!1===e(i))return!1;i=i.parent}return!0},visitSiblings:function(e,t){for(var i,n=this.parent.children,o=0,r=n.length;o<r;o++)if(i=n[o],(t||i!==this)&&!1===e(i))return!1;return!0},warn:function(e){2<=this.tree.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),S("warn",arguments))}},D.prototype={_makeHookContext:function(t,i,n){var o,r;return void 0!==t.node?(i&&t.originalEvent!==i&&e.error("invalid args"),o=t):t.tree?o={node:t,tree:r=t.tree,widget:r.widget,options:r.widget.options,originalEvent:i,typeInfo:r.types[t.type]||{}}:t.widget?o={node:null,tree:t,widget:t.widget,options:t.widget.options,originalEvent:i}:e.error("invalid args"),n&&e.extend(o,n),o},_callHook:function(t,i,n){var o=this._makeHookContext(i),r=this[t],i=Array.prototype.slice.call(arguments,2);return C(r)||e.error("_callHook('"+t+"') is not a function"),i.unshift(o),r.apply(this,i)},_setExpiringValue:function(e,t,i){this._tempCache[e]={value:t,expire:Date.now()+(+i||50)}},_getExpiringValue:function(e){var t=this._tempCache[e];return t&&t.expire>Date.now()?t.value:(delete this._tempCache[e],null)},_usesExtension:function(t){return 0<=e.inArray(t,this.options.extensions)},_requireExtension:function(t,i,n,o){null!=n&&(n=!!n);var r=this._local.name,s=this.options.extensions,a=e.inArray(t,s)<e.inArray(r,s),s=i&&null==this.ext[t],a=!s&&null!=n&&n!==a;return w(r&&r!==t,"invalid or same name '"+r+"' (require yourself?)"),!s&&!a||(o||(s||i?(o="'"+r+"' extension requires '"+t+"'",a&&(o+=" to be registered "+(n?"before":"after")+" itself")):o="If used together, `"+t+"` must be registered "+(n?"before":"after")+" `"+r+"`"),e.error(o),!1)},activateKey:function(e,t){e=this.getNodeByKey(e);return e?e.setActive(!0,t):this.activeNode&&this.activeNode.setActive(!1,t),e},addPagingNode:function(e,t){return this.rootNode.addPagingNode(e,t)},applyCommand:function(t,i,n){var o;switch(i=i||this.getActiveNode(),t){case"moveUp":(o=i.getPrevSibling())&&(i.moveTo(o,"before"),i.setActive());break;case"moveDown":(o=i.getNextSibling())&&(i.moveTo(o,"after"),i.setActive());break;case"indent":(o=i.getPrevSibling())&&(i.moveTo(o,"child"),o.setExpanded(),i.setActive());break;case"outdent":i.isTopLevel()||(i.moveTo(i.getParent(),"after"),i.setActive());break;case"remove":o=i.getPrevSibling()||i.getParent(),i.remove(),o&&o.setActive();break;case"addChild":i.editCreateNode("child","");break;case"addSibling":i.editCreateNode("after","");break;case"rename":i.editStart();break;case"down":case"first":case"last":case"left":case"parent":case"right":case"up":return i.navigate(t);default:e.error("Unhandled command: '"+t+"'")}},applyPatch:function(t){for(var i,n,o,r,s=t.length,a=[],l=0;l<s;l++)w(2===(i=t[l]).length,"patchList must be an array of length-2-arrays"),n=i[0],o=i[1],(r=null===n?this.rootNode:this.getNodeByKey(n))?(i=new e.Deferred,a.push(i),r.applyPatch(o).always(L(i,r))):this.warn("could not find node with key '"+n+"'");return e.when.apply(e,a).promise()},clear:function(e){this._callHook("treeClear",this)},count:function(){return this.rootNode.countChildren()},debug:function(e){4<=this.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),S("log",arguments))},destroy:function(){this.widget.destroy()},enable:function(e){!1===e?this.widget.disable():this.widget.enable()},enableUpdate:function(e){return!!this._enableUpdate==!!(e=!1!==e)?e:((this._enableUpdate=e)?(this.debug("enableUpdate(true): redraw "),this._callHook("treeStructureChanged",this,"enableUpdate"),this.render()):this.debug("enableUpdate(false)..."),!e)},error:function(e){1<=this.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),S("error",arguments))},expandAll:function(e,t){var i=this.enableUpdate(!1);e=!1!==e,this.visit(function(i){!1!==i.hasChildren()&&i.isExpanded()!==e&&i.setExpanded(e,t)}),this.enableUpdate(i)},findAll:function(e){return this.rootNode.findAll(e)},findFirst:function(e){return this.rootNode.findFirst(e)},findNextNode:function(e,t){var i,n=null,o=this.getFirstChild();function r(i){if((n=e(i)?i:n)||i===t)return!1}return e="string"==typeof e?(i=new RegExp("^"+e,"i"),function(e){return i.test(e.title)}):e,this.visitRows(r,{start:t=t||o,includeSelf:!1}),n||t===o||this.visitRows(r,{start:o,includeSelf:!0}),n},findRelatedNode:function(t,i,n){var o=null,r=e.ui.keyCode;switch(i){case"parent":case r.BACKSPACE:t.parent&&t.parent.parent&&(o=t.parent);break;case"first":case r.HOME:this.visit(function(e){if(e.isVisible())return o=e,!1});break;case"last":case r.END:this.visit(function(e){e.isVisible()&&(o=e)});break;case"left":case r.LEFT:t.expanded?t.setExpanded(!1):t.parent&&t.parent.parent&&(o=t.parent);break;case"right":case r.RIGHT:t.expanded||!t.children&&!t.lazy?t.children&&t.children.length&&(o=t.children[0]):(t.setExpanded(),o=t);break;case"up":case r.UP:this.visitRows(function(e){return o=e,!1},{start:t,reverse:!0,includeSelf:!1});break;case"down":case r.DOWN:this.visitRows(function(e){return o=e,!1},{start:t,includeSelf:!1});break;default:this.tree.warn("Unknown relation '"+i+"'.")}return o},generateFormElements:function(t,i,n){n=n||{};var o="string"==typeof t?t:"ft_"+this._id+"[]",r="string"==typeof i?i:"ft_"+this._id+"_active",s="fancytree_result_"+this._id,a=e("#"+s),l=3===this.options.selectMode&&!1!==n.stopOnParents;function d(t){a.append(e("<input>",{type:"checkbox",name:o,value:t.key,checked:!0}))}a.length?a.empty():a=e("<div>",{id:s}).hide().insertAfter(this.$container),!1!==i&&this.activeNode&&a.append(e("<input>",{type:"radio",name:r,value:this.activeNode.key,checked:!0})),n.filter?this.visit(function(e){var t=n.filter(e);if("skip"===t)return t;!1!==t&&d(e)}):!1!==t&&(l=this.getSelectedNodes(l),e.each(l,function(e,t){d(t)}))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getOption:function(e){return this.widget.option(e)},getNodeByKey:function(e,t){var i,n;return!t&&(i=document.getElementById(this.options.idPrefix+e))?i.ftnode||null:(t=t||this.rootNode,e=""+e,t.visit(function(t){if(t.key===e)return n=t,!1},!(n=null)),n)},getRootNode:function(){return this.rootNode},getSelectedNodes:function(e){return this.rootNode.getSelectedNodes(e)},hasFocus:function(){return!!this._hasFocus},info:function(e){3<=this.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),S("info",arguments))},isLoading:function(){var e=!1;return this.rootNode.visit(function(t){if(t._isLoading||t._requestId)return!(e=!0)},!0),e},loadKeyPath:function(t,i){var n,o,r,s=this,a=new e.Deferred,l=this.getRootNode(),d=this.options.keyPathSeparator,c=[],u=e.extend({},i);for("function"==typeof i?n=i:i&&i.callback&&(n=i.callback),u.callback=function(e,t,i){n&&n.call(e,t,i),a.notifyWith(e,[{node:t,status:i}])},null==u.matchKey&&(u.matchKey=function(e,t){return e.key===t}),_(t)||(t=[t]),o=0;o<t.length;o++)(r=t[o]).charAt(0)===d&&(r=r.substr(1)),c.push(r.split(d));return setTimeout(function(){s._loadKeyPathImpl(a,u,l,c).done(function(){a.resolve()})},0),a.promise()},_loadKeyPathImpl:function(t,i,n,o){var r,s,a,l,d,c,u,h,f,p,g=this;for(u={},s=0;s<o.length;s++)for(f=o[s],h=n;f.length;){if(a=f.shift(),!(l=function(e,t){var n,o,r=e.children;if(r)for(n=0,o=r.length;n<o;n++)if(i.matchKey(r[n],t))return r[n];return null}(h,a))){this.warn("loadKeyPath: key not found: "+a+" (parent: "+h+")"),i.callback(this,a,"error");break}if(0===f.length){i.callback(this,l,"ok");break}if(l.lazy&&void 0===l.hasChildren()){i.callback(this,l,"loaded"),u[a=l.key]?u[a].pathSegList.push(f):u[a]={parent:l,pathSegList:[f]};break}i.callback(this,l,"loaded"),h=l}for(d in r=[],u)k(u,d)&&(c=u[d],p=new e.Deferred,r.push(p),function(e,t,n){i.callback(g,t,"loading"),t.load().done(function(){g._loadKeyPathImpl.call(g,e,i,t,n).always(L(e,g))}).fail(function(n){g.warn("loadKeyPath: error loading lazy "+t),i.callback(g,l,"error"),e.rejectWith(g)})}(p,c.parent,c.pathSegList));return e.when.apply(e,r).promise()},reactivate:function(e){var t,i=this.activeNode;return i?(this.activeNode=null,t=i.setActive(!0,{noFocus:!0}),e&&i.setFocus(),t):T()},reload:function(e){return this._callHook("treeClear",this),this._callHook("treeLoad",this,e)},render:function(e,t){return this.rootNode.render(e,t)},selectAll:function(e){this.visit(function(t){t.setSelected(e)})},setFocus:function(e){return this._callHook("treeSetFocus",this,e)},setOption:function(e,t){return this.widget.option(e,t)},debugTime:function(e){4<=this.options.debugLevel&&window.console.time(this+" - "+e)},debugTimeEnd:function(e){4<=this.options.debugLevel&&window.console.timeEnd(this+" - "+e)},toDict:function(e,t){t=this.rootNode.toDict(!0,t);return e?t:t.children},toString:function(){return"Fancytree@"+this._id},_triggerNodeEvent:function(e,t,i,n){n=this._makeHookContext(t,i,n),i=this.widget._trigger(e,i,n);return!1!==i&&void 0!==n.result?n.result:i},_triggerTreeEvent:function(e,t,i){i=this._makeHookContext(this,t,i),t=this.widget._trigger(e,t,i);return!1!==t&&void 0!==i.result?i.result:t},visit:function(e){return this.rootNode.visit(e,!1)},visitRows:function(e,t){if(!this.rootNode.hasChildren())return!1;if(t&&t.reverse)return delete t.reverse,this._visitRowsUp(e,t);for(var i,n,o,r=0,s=!1===(t=t||{}).includeSelf,a=!!t.includeHidden,l=!a&&this.enableFilter,d=t.start||this.rootNode.children[0],c=d.parent;c;){for(w(0<=(n=(o=c.children).indexOf(d)+r),"Could not find "+d+" in parent's children: "+c),i=n;i<o.length;i++)if(d=o[i],!l||d.match||d.subMatchCount){if(!s&&!1===e(d))return!1;if(s=!1,d.children&&d.children.length&&(a||d.expanded)&&!1===d.visit(function(t){return!l||t.match||t.subMatchCount?!1!==e(t)&&(a||!t.children||t.expanded?void 0:"skip"):"skip"},!1))return!1}c=(d=c).parent,r=1}return!0},_visitRowsUp:function(e,t){for(var i,n,o,r=!!t.includeHidden,s=t.start||this.rootNode.children[0];;){if((i=(o=s.parent).children)[0]===s){if(!(s=o).parent)break;i=o.children}else for(n=i.indexOf(s),s=i[n-1];(r||s.expanded)&&s.children&&s.children.length;)s=(i=(o=s).children)[i.length-1];if((r||s.isVisible())&&!1===e(s))return!1}},warn:function(e){2<=this.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),S("warn",arguments))}},e.extend(D.prototype,{nodeClick:function(e){var t,i,n=e.targetType,o=e.node;if("expander"===n)o.isLoading()?o.debug("Got 2nd click while loading: ignored"):this._callHook("nodeToggleExpanded",e);else if("checkbox"===n)this._callHook("nodeToggleSelected",e),e.options.focusOnSelect&&this._callHook("nodeSetFocus",e,!0);else{if(t=!(i=!1),o.folder)switch(e.options.clickFolderMode){case 2:t=!(i=!0);break;case 3:i=t=!0}t&&(this.nodeSetFocus(e),this._callHook("nodeSetActive",e,!0)),i&&this._callHook("nodeToggleExpanded",e)}},nodeCollapseSiblings:function(e,t){var i,n,o,r=e.node;if(r.parent)for(n=0,o=(i=r.parent.children).length;n<o;n++)i[n]!==r&&i[n].expanded&&this._callHook("nodeSetExpanded",i[n],!1,t)},nodeDblclick:function(e){"title"===e.targetType&&4===e.options.clickFolderMode&&this._callHook("nodeToggleExpanded",e),"title"===e.targetType&&e.originalEvent.preventDefault()},nodeKeydown:function(t){var n=t.originalEvent,o=t.node,r=t.tree,s=t.options,a=n.which,l=n.key||String.fromCharCode(a),d=!!(n.altKey||n.ctrlKey||n.metaKey),h=!u[a]&&!c[a]&&!d,a=e(n.target),f=!0,p=!(n.ctrlKey||!s.autoActivate);if(o||(d=this.getActiveNode()||this.getFirstChild())&&(d.setFocus(),(o=t.node=this.focusNode).debug("Keydown force focus on active node")),s.quicksearch&&h&&!a.is(":input:enabled"))return 500<(a=Date.now())-r.lastQuicksearchTime&&(r.lastQuicksearchTerm=""),r.lastQuicksearchTime=a,r.lastQuicksearchTerm+=l,(l=r.findNextNode(r.lastQuicksearchTerm,r.getActiveNode()))&&l.setActive(),void n.preventDefault();switch(i.eventToString(n)){case"+":case"=":r.nodeSetExpanded(t,!0);break;case"-":r.nodeSetExpanded(t,!1);break;case"space":o.isPagingNode()?r._triggerNodeEvent("clickPaging",t,n):i.evalOption("checkbox",o,o,s,!1)?r.nodeToggleSelected(t):r.nodeSetActive(t,!0);break;case"return":r.nodeSetActive(t,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":o.navigate(n.which,p);break;default:f=!1}f&&n.preventDefault()},nodeLoadChildren:function(t,i){var n,o,r,l=null,d=!0,c=t.tree,u=t.node,h=u.parent,f="nodeLoadChildren",p=Date.now();return C(i)&&w(!C(i=i.call(c,{type:"source"},t)),"source callback must not return another function"),C(i.then)?l=i:i.url?l=(n=e.extend({},t.options.ajax,i)).debugDelay?(o=n.debugDelay,delete n.debugDelay,_(o)&&(o=o[0]+Math.random()*(o[1]-o[0])),u.warn("nodeLoadChildren waiting debugDelay "+Math.round(o)+" ms ..."),e.Deferred(function(t){setTimeout(function(){e.ajax(n).done(function(){t.resolveWith(this,arguments)}).fail(function(){t.rejectWith(this,arguments)})},o)})):e.ajax(n):e.isPlainObject(i)||_(i)?d=!(l={then:function(e,t){e(i,null,null)}}):e.error("Invalid source type: "+i),u._requestId&&(u.warn("Recursive load request #"+p+" while #"+u._requestId+" is pending."),u._requestId=p),d&&(c.debugTime(f),c.nodeSetStatus(t,"loading")),r=new e.Deferred,l.then(function(n,o,l){var d,f;if("json"!==i.dataType&&"jsonp"!==i.dataType||"string"!=typeof n||e.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),u._requestId&&u._requestId>p)r.rejectWith(this,[s]);else if(null!==u.parent||null===h){if(t.options.postProcess){try{(f=c._triggerNodeEvent("postProcess",t,t.originalEvent,{response:n,error:null,dataType:i.dataType})).error&&c.warn("postProcess returned error:",f)}catch(n){f={error:n,message:""+n,details:"postProcess failed"}}if(f.error)return d=e.isPlainObject(f.error)?f.error:{message:f.error},d=c._makeHookContext(u,null,d),void r.rejectWith(this,[d]);(_(f)||e.isPlainObject(f)&&_(f.children))&&(n=f)}else n&&k(n,"d")&&t.options.enableAspx&&(42===t.options.enableAspx&&c.warn("The default for enableAspx will change to `false` in the fututure. Pass `enableAspx: true` or implement postProcess to silence this warning."),n="string"==typeof n.d?e.parseJSON(n.d):n.d);r.resolveWith(this,[n])}else r.rejectWith(this,[a])},function(e,t,i){i=c._makeHookContext(u,null,{error:e,args:Array.prototype.slice.call(arguments),message:i,details:e.status+": "+i});r.rejectWith(this,[i])}),r.done(function(i){var n,o,r;c.nodeSetStatus(t,"ok"),e.isPlainObject(i)?(w(u.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),w(_(i.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),n=(o=i).children,delete o.children,e.each(g,function(e,t){void 0!==o[t]&&(c[t]=o[t],delete o[t])}),e.extend(c.data,o)):n=i,w(_(n),"expected array of children"),u._setChildren(n),c.options.nodata&&0===n.length&&(C(c.options.nodata)?r=c.options.nodata.call(c,{type:"nodata"},t):!0===c.options.nodata&&u.isRootNode()?r=c.options.strings.noData:"string"==typeof c.options.nodata&&u.isRootNode()&&(r=c.options.nodata),r&&u.setStatus("nodata",r)),c._triggerNodeEvent("loadChildren",u)}).fail(function(e){var i;e!==s?e!==a?(e.node&&e.error&&e.message?i=e:"[object Object]"===(i=c._makeHookContext(u,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""})).message&&(i.message=""),u.warn("Load children failed ("+i.message+")",i),!1!==c._triggerNodeEvent("loadError",i,null)&&c.nodeSetStatus(t,"error",i.message,i.details)):u.warn("Lazy parent node was removed while loading: discarding response."):u.warn("Ignored response for obsolete load request #"+p+" (expected #"+u._requestId+")")}).always(function(){u._requestId=null,d&&c.debugTimeEnd(f)}),r.promise()},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(t,i){var n=t.node,o=e.extend({},t,{node:i}),r=n.children;if(1===r.length)return w(i===r[0],"invalid single child"),this.nodeRemoveChildren(t);this.activeNode&&(i===this.activeNode||this.activeNode.isDescendantOf(i))&&this.activeNode.setActive(!1),this.focusNode&&(i===this.focusNode||this.focusNode.isDescendantOf(i))&&(this.focusNode=null),this.nodeRemoveMarkup(o),this.nodeRemoveChildren(o),w(0<=(o=e.inArray(i,r)),"invalid child"),n.triggerModifyChild("remove",i),i.visit(function(e){e.parent=null},!0),this._callHook("treeRegisterNode",this,!1,i),r.splice(o,1)},nodeRemoveChildMarkup:function(t){t=t.node;t.ul&&(t.isRootNode()?e(t.ul).empty():(e(t.ul).remove(),t.ul=null),t.visit(function(e){e.li=e.ul=null}))},nodeRemoveChildren:function(e){var t=e.tree,i=e.node;i.children&&(this.activeNode&&this.activeNode.isDescendantOf(i)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(i)&&(this.focusNode=null),this.nodeRemoveChildMarkup(e),i.triggerModifyChild("remove",null),i.visit(function(e){e.parent=null,t._callHook("treeRegisterNode",t,!1,e)}),i.lazy?i.children=[]:i.children=null,i.isRootNode()||(i.expanded=!1),this.nodeRenderStatus(e))},nodeRemoveMarkup:function(t){var i=t.node;i.li&&(e(i.li).remove(),i.li=null),this.nodeRemoveChildMarkup(t)},nodeRender:function(t,i,n,o,r){var s,a,l,d,c,u,h,f=t.node,p=t.tree,g=t.options,v=g.aria,y=!1,m=f.parent,b=!m,x=f.children,_=null;if(!1!==p._enableUpdate&&(b||m.ul)){if(w(b||m.ul,"parent UL must exist"),b||(f.li&&(i||f.li.parentNode!==f.parent.ul)&&(f.li.parentNode===f.parent.ul?_=f.li.nextSibling:this.debug("Unlinking "+f+" (must be child of "+f.parent+")"),this.nodeRemoveMarkup(t)),f.li?this.nodeRenderStatus(t):(y=!0,f.li=document.createElement("li"),(f.li.ftnode=f).key&&g.generateIds&&(f.li.id=g.idPrefix+f.key),f.span=document.createElement("span"),f.span.className="fancytree-node",v&&!f.tr&&e(f.li).attr("role","treeitem"),f.li.appendChild(f.span),this.nodeRenderTitle(t),g.createNode&&g.createNode.call(p,{type:"createNode"},t)),g.renderNode&&g.renderNode.call(p,{type:"renderNode"},t)),x){if(b||f.expanded||!0===n){for(f.ul||(f.ul=document.createElement("ul"),(!0!==o||r)&&f.expanded||(f.ul.style.display="none"),v&&e(f.ul).attr("role","group"),f.li?f.li.appendChild(f.ul):f.tree.$div.append(f.ul)),d=0,c=x.length;d<c;d++)h=e.extend({},t,{node:x[d]}),this.nodeRender(h,i,n,!1,!0);for(s=f.ul.firstChild;s;)s=(l=s.ftnode)&&l.parent!==f?(f.debug("_fixParent: remove missing "+l,s),u=s.nextSibling,s.parentNode.removeChild(s),u):s.nextSibling;for(s=f.ul.firstChild,d=0,c=x.length-1;d<c;d++)(a=x[d])===(l=s.ftnode)?s=s.nextSibling:f.ul.insertBefore(a.li,l.li)}}else f.ul&&(this.warn("remove child markup for "+f),this.nodeRemoveChildMarkup(t));b||y&&m.ul.insertBefore(f.li,_)}},nodeRenderTitle:function(t,o){var r,s,a=t.node,l=t.tree,d=t.options,c=d.aria,u=a.getLevel(),h=[];void 0!==o&&(a.title=o),a.span&&!1!==l._enableUpdate&&(o=c&&!1!==a.hasChildren()?" role='button'":"",u<d.minExpandLevel?(a.lazy||(a.expanded=!0),1<u&&h.push("<span "+o+" class='fancytree-expander fancytree-expander-fixed'></span>")):h.push("<span "+o+" class='fancytree-expander'></span>"),(u=i.evalOption("checkbox",a,a,d,!1))&&!a.isStatusNode()&&(r="fancytree-checkbox",("radio"===u||a.parent&&a.parent.radiogroup)&&(r+=" fancytree-radio"),h.push("<span "+(o=c?" role='checkbox'":"")+" class='"+r+"'></span>")),void 0!==a.data.iconClass&&(a.icon?e.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(a.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),a.icon=a.data.iconClass)),!1!==(r=i.evalOption("icon",a,a,d,!0))&&(o=c?" role='presentation'":"",s=(s=i.evalOption("iconTooltip",a,a,d,null))?" title='"+P(s)+"'":"","string"==typeof r?n.test(r)?(r="/"===r.charAt(0)?r:(d.imagePath||"")+r,h.push("<img src='"+r+"' class='fancytree-icon'"+s+" alt='' />")):h.push("<span "+o+" class='fancytree-custom-icon "+r+"'"+s+"></span>"):r.text?h.push("<span "+o+" class='fancytree-custom-icon "+(r.addClass||"")+"'"+s+">"+i.escapeHtml(r.text)+"</span>"):r.html?h.push("<span "+o+" class='fancytree-custom-icon "+(r.addClass||"")+"'"+s+">"+r.html+"</span>"):h.push("<span "+o+" class='fancytree-icon'"+s+"></span>")),o="",o=(o=d.renderTitle?d.renderTitle.call(l,{type:"renderTitle"},t)||"":o)||"<span class='fancytree-title'"+(s=(s=!0===(s=i.evalOption("tooltip",a,a,d,null))?a.title:s)?" title='"+P(s)+"'":"")+(d.titlesTabbable?" tabindex='0'":"")+">"+(d.escapeTitles?i.escapeHtml(a.title):a.title)+"</span>",h.push(o),a.span.innerHTML=h.join(""),this.nodeRenderStatus(t),d.enhanceTitle&&(t.$title=e(">span.fancytree-title",a.span),o=d.enhanceTitle.call(l,{type:"enhanceTitle"},t)||""))},nodeRenderStatus:function(t){var n,o=t.node,r=t.tree,s=t.options,a=o.hasChildren(),l=o.isLastSibling(),d=s.aria,c=s._classNames,u=[],t=o[r.statusClassPropName];t&&!1!==r._enableUpdate&&(d&&(n=e(o.tr||o.li)),u.push(c.node),r.activeNode===o&&u.push(c.active),r.focusNode===o&&u.push(c.focused),o.expanded&&u.push(c.expanded),d&&(!1===a?n.removeAttr("aria-expanded"):n.attr("aria-expanded",Boolean(o.expanded))),o.folder&&u.push(c.folder),!1!==a&&u.push(c.hasChildren),l&&u.push(c.lastsib),o.lazy&&null==o.children&&u.push(c.lazy),o.partload&&u.push(c.partload),o.partsel&&u.push(c.partsel),i.evalOption("unselectable",o,o,s,!1)&&u.push(c.unselectable),o._isLoading&&u.push(c.loading),o._error&&u.push(c.error),o.statusNodeType&&u.push(c.statusNodePrefix+o.statusNodeType),o.selected?(u.push(c.selected),d&&n.attr("aria-selected",!0)):d&&n.attr("aria-selected",!1),o.extraClasses&&u.push(o.extraClasses),!1===a?u.push(c.combinedExpanderPrefix+"n"+(l?"l":"")):u.push(c.combinedExpanderPrefix+(o.expanded?"e":"c")+(o.lazy&&null==o.children?"d":"")+(l?"l":"")),u.push(c.combinedIconPrefix+(o.expanded?"e":"c")+(o.folder?"f":"")),t.className=u.join(" "),o.li&&e(o.li).toggleClass(c.lastsib,l))},nodeSetActive:function(t,i,n){var o=t.node,r=t.tree,s=t.options,a=!0===(n=n||{}).noEvents,l=!0===n.noFocus,n=!1!==n.scrollIntoView;return o===r.activeNode===(i=!1!==i)?T(o):(n&&t.originalEvent&&e(t.originalEvent.target).is("a,:checkbox")&&(o.info("Not scrolling while clicking an embedded link."),n=!1),i&&!a&&!1===this._triggerNodeEvent("beforeActivate",o,t.originalEvent)?A(o,["rejected"]):(i?(r.activeNode&&(w(r.activeNode!==o,"node was active (inconsistency)"),i=e.extend({},t,{node:r.activeNode}),r.nodeSetActive(i,!1),w(null===r.activeNode,"deactivate was out of sync?")),s.activeVisible&&o.makeVisible({scrollIntoView:n}),r.activeNode=o,r.nodeRenderStatus(t),l||r.nodeSetFocus(t),a||r._triggerNodeEvent("activate",o,t.originalEvent)):(w(r.activeNode===o,"node was not active (inconsistency)"),r.activeNode=null,this.nodeRenderStatus(t),a||t.tree._triggerNodeEvent("deactivate",o,t.originalEvent)),T(o)))},nodeSetExpanded:function(t,i,n){var o,r,s,a,l,d,c=t.node,u=t.tree,h=t.options,f=!0===(n=n||{}).noAnimation,p=!0===n.noEvents;if(i=!1!==i,e(c.li).hasClass(h._classNames.animating))return c.warn("setExpanded("+i+") while animating: ignored."),A(c,["recursion"]);if(c.expanded&&i||!c.expanded&&!i)return T(c);if(i&&!c.lazy&&!c.hasChildren())return T(c);if(!i&&c.getLevel()<h.minExpandLevel)return A(c,["locked"]);if(!p&&!1===this._triggerNodeEvent("beforeExpand",c,t.originalEvent))return A(c,["rejected"]);if(f||c.isVisible()||(f=n.noAnimation=!0),r=new e.Deferred,i&&!c.expanded&&h.autoCollapse){l=c.getParentList(!1,!0),d=h.autoCollapse;try{for(h.autoCollapse=!1,s=0,a=l.length;s<a;s++)this._callHook("nodeCollapseSiblings",l[s],n)}finally{h.autoCollapse=d}}return r.done(function(){var e=c.getLastChild();i&&h.autoScroll&&!f&&e&&u._enableUpdate?e.scrollIntoView(!0,{topNode:c}).always(function(){p||t.tree._triggerNodeEvent(i?"expand":"collapse",t)}):p||t.tree._triggerNodeEvent(i?"expand":"collapse",t)}),o=function(n){var o=h._classNames,r=h.toggleEffect;if(c.expanded=i,u._callHook("treeStructureChanged",t,i?"expand":"collapse"),u._callHook("nodeRender",t,!1,!1,!0),c.ul)if("none"!==c.ul.style.display==!!c.expanded)c.warn("nodeSetExpanded: UL.style.display already set");else{if(r&&!f)return e(c.li).addClass(o.animating),void(C(e(c.ul)[r.effect])?e(c.ul)[r.effect]({duration:r.duration,always:function(){e(this).removeClass(o.animating),e(c.li).removeClass(o.animating),n()}}):(e(c.ul).stop(!0,!0),e(c.ul).parent().find(".ui-effects-placeholder").remove(),e(c.ul).toggle(r.effect,r.options,r.duration,function(){e(this).removeClass(o.animating),e(c.li).removeClass(o.animating),n()})));c.ul.style.display=c.expanded||!parent?"":"none"}n()},i&&c.lazy&&void 0===c.hasChildren()?c.load().done(function(){r.notifyWith&&r.notifyWith(c,["loaded"]),o(function(){r.resolveWith(c)})}).fail(function(e){o(function(){r.rejectWith(c,["load failed ("+e+")"])})}):o(function(){r.resolveWith(c)}),r.promise()},nodeSetFocus:function(t,i){var n,o=t.tree,r=t.node,s=o.options,a=!!t.originalEvent&&e(t.originalEvent.target).is(":input");if(i=!1!==i,o.focusNode){if(o.focusNode===r&&i)return;n=e.extend({},t,{node:o.focusNode}),o.focusNode=null,this._triggerNodeEvent("blur",n),this._callHook("nodeRenderStatus",n)}i&&(this.hasFocus()||(r.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",t,!0,{calledByNode:!0})),r.makeVisible({scrollIntoView:!1}),o.focusNode=r,s.titlesTabbable&&(a||e(r.span).find(".fancytree-title").focus()),s.aria&&e(o.$container).attr("aria-activedescendant",e(r.tr||r.li).uniqueId().attr("id")),this._triggerNodeEvent("focus",t),document.activeElement===o.$container.get(0)||1<=e(document.activeElement,o.$container).length||e(o.$container).focus(),s.autoScroll&&r.scrollIntoView(),this._callHook("nodeRenderStatus",t))},nodeSetSelected:function(e,t,n){var o=e.node,r=e.tree,s=e.options,a=!0===(n=n||{}).noEvents,l=o.parent;if(t=!1!==t,!i.evalOption("unselectable",o,o,s,!1))return o._lastSelectIntent=t,!!o.selected!==t||3===s.selectMode&&o.partsel&&!t?a||!1!==this._triggerNodeEvent("beforeSelect",o,e.originalEvent)?(t&&1===s.selectMode?(r.lastSelectedNode&&r.lastSelectedNode.setSelected(!1),o.selected=t):3!==s.selectMode||!l||l.radiogroup||o.radiogroup?l&&l.radiogroup?o.visitSiblings(function(e){e._changeSelectStatusAttrs(t&&e===o)},!0):o.selected=t:(o.selected=t,o.fixSelection3AfterClick(n)),this.nodeRenderStatus(e),r.lastSelectedNode=t?o:null,void(a||r._triggerNodeEvent("select",e))):!!o.selected:t},nodeSetStatus:function(t,i,n,o){var r=t.node,s=t.tree;function a(i,n){var o=r.children?r.children[0]:null;return o&&o.isStatusNode()?(e.extend(o,i),o.statusNodeType=n,s._callHook("nodeRenderTitle",o)):(r._setChildren([i]),s._callHook("treeStructureChanged",t,"setStatusNode"),r.children[0].statusNodeType=n,s.render()),r.children[0]}switch(i){case"ok":!function(){var e=r.children?r.children[0]:null;if(e&&e.isStatusNode()){try{r.ul&&(r.ul.removeChild(e.li),e.li=null)}catch(e){}1===r.children.length?r.children=[]:r.children.shift(),s._callHook("treeStructureChanged",t,"clearStatusNode")}}(),r._isLoading=!1,r._error=null,r.renderStatus();break;case"loading":r.parent||a({title:s.options.strings.loading+(n?" ("+n+")":""),checkbox:!1,tooltip:o},i),r._isLoading=!0,r._error=null,r.renderStatus();break;case"error":a({title:s.options.strings.loadError+(n?" ("+n+")":""),checkbox:!1,tooltip:o},i),r._isLoading=!1,r._error={message:n,details:o},r.renderStatus();break;case"nodata":a({title:n||s.options.strings.noData,checkbox:!1,tooltip:o},i),r._isLoading=!1,r._error=null,r.renderStatus();break;default:e.error("invalid node status "+i)}},nodeToggleExpanded:function(e){return this.nodeSetExpanded(e,!e.node.expanded)},nodeToggleSelected:function(e){var t=e.node,i=!t.selected;return t.partsel&&!t.selected&&!0===t._lastSelectIntent&&(t.selected=!(i=!1)),t._lastSelectIntent=i,this.nodeSetSelected(e,i)},treeClear:function(e){var t=e.tree;t.activeNode=null,t.focusNode=null,t.$div.find(">ul.fancytree-container").empty(),t.rootNode.children=null,t._callHook("treeStructureChanged",e,"clear")},treeCreate:function(e){},treeDestroy:function(e){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("fancytree-helper-hidden")},treeInit:function(t){var i=t.tree,n=i.options;i.$container.attr("tabindex",n.tabindex),e.each(g,function(e,t){void 0!==n[t]&&(i.info("Move option "+t+" to tree"),i[t]=n[t],delete n[t])}),n.checkboxAutoHide&&i.$container.addClass("fancytree-checkbox-auto-hide"),n.rtl?i.$container.attr("DIR","RTL").addClass("fancytree-rtl"):i.$container.removeAttr("DIR").removeClass("fancytree-rtl"),n.aria&&(i.$container.attr("role","tree"),1!==n.selectMode&&i.$container.attr("aria-multiselectable",!0)),this.treeLoad(t)},treeLoad:function(t,n){var o,r,s,a=t.tree,l=t.widget.element,d=e.extend({},t,{node:this.rootNode});if(a.rootNode.children&&this.treeClear(t),n=n||this.options.source)"string"==typeof n&&e.error("Not implemented");else switch(r=l.data("type")||"html"){case"html":(s=l.find(">ul").not(".fancytree-container").first()).length?(s.addClass("ui-fancytree-source fancytree-helper-hidden"),n=e.ui.fancytree.parseHtml(s),this.data=e.extend(this.data,H(s))):(i.warn("No `source` option was passed and container does not contain `<ul>`: assuming `source: []`."),n=[]);break;case"json":n=e.parseJSON(l.text()),l.contents().filter(function(){return 3===this.nodeType}).remove(),e.isPlainObject(n)&&(w(_(n.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),n=(o=n).children,delete o.children,e.each(g,function(e,t){void 0!==o[t]&&(a[t]=o[t],delete o[t])}),e.extend(a.data,o));break;default:e.error("Invalid data-type: "+r)}return a._triggerTreeEvent("preInit",null),this.nodeLoadChildren(d,n).done(function(){a._callHook("treeStructureChanged",t,"loadChildren"),a.render(),3===t.options.selectMode&&a.rootNode.fixSelection3FromEndNodes(),a.activeNode&&a.options.activeVisible&&a.activeNode.makeVisible(),a._triggerTreeEvent("init",null,{status:!0})}).fail(function(){a.render(),a._triggerTreeEvent("init",null,{status:!1})})},treeRegisterNode:function(e,t,i){e.tree._callHook("treeStructureChanged",e,t?"addNode":"removeNode")},treeSetFocus:function(t,i,n){var o;(i=!1!==i)!==this.hasFocus()&&(!(this._hasFocus=i)&&this.focusNode?this.focusNode.setFocus(!1):!i||n&&n.calledByNode||e(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",i),this._triggerTreeEvent(i?"focusTree":"blurTree"),i&&!this.activeNode&&(o=this._lastMousedownNode||this.getFirstChild())&&o.setFocus())},treeSetOption:function(t,i,n){var o=t.tree,r=!0,s=!1,a=!1;switch(i){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":a=s=!0;break;case"checkboxAutoHide":o.$container.toggleClass("fancytree-checkbox-auto-hide",!!n);break;case"escapeTitles":case"tooltip":a=!0;break;case"rtl":!1===n?o.$container.removeAttr("DIR").removeClass("fancytree-rtl"):o.$container.attr("DIR","RTL").addClass("fancytree-rtl"),a=!0;break;case"source":r=!1,o._callHook("treeLoad",o,n),a=!0}o.debug("set option "+i+"="+n+" <"+typeof n+">"),r&&(this.widget._super||e.Widget.prototype._setOption).call(this.widget,i,n),s&&o._callHook("treeCreate",o),a&&o.render(!0,!1)},treeStructureChanged:function(e,t){}}),e.widget("ui.fancytree",{options:{activeVisible:!0,ajax:{type:"GET",cache:!1,dataType:"json"},aria:!0,autoActivate:!0,autoCollapse:!1,autoScroll:!1,checkbox:!1,clickFolderMode:4,copyFunctionsToData:!1,debugLevel:null,disabled:!1,enableAspx:42,escapeTitles:!1,extensions:[],focusOnSelect:!1,generateIds:!1,icon:!0,idPrefix:"ft_",keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,nodata:!0,quicksearch:!1,rtl:!1,scrollOfs:{top:0,bottom:0},scrollParent:null,selectMode:2,strings:{loading:"Loading...",loadError:"Load error!",moreData:"More...",noData:"No data."},tabindex:"0",titlesTabbable:!1,toggleEffect:{effect:"slideToggle",duration:200},tooltip:!1,treeId:null,_classNames:{active:"fancytree-active",animating:"fancytree-animating",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",error:"fancytree-error",expanded:"fancytree-expanded",focused:"fancytree-focused",folder:"fancytree-folder",hasChildren:"fancytree-has-children",lastsib:"fancytree-lastsib",lazy:"fancytree-lazy",loading:"fancytree-loading",node:"fancytree-node",partload:"fancytree-partload",partsel:"fancytree-partsel",radio:"fancytree-radio",selected:"fancytree-selected",statusNodePrefix:"fancytree-statusnode-",unselectable:"fancytree-unselectable"},lazyLoad:null,postProcess:null},_deprecationWarning:function(e){var t=this.tree;t&&3<=t.options.debugLevel&&t.warn("$().fancytree('"+e+"') is deprecated (see https://wwwendt.de/tech/fancytree/doc/jsdoc/Fancytree_Widget.html")},_create:function(){this.tree=new D(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul").first();for(var t,i,n=this.options,o=n.extensions,r=(this.tree,0);r<o.length;r++)i=o[r],(t=e.ui.fancytree._extensions[i])||e.error("Could not apply extension '"+i+"' (it is not registered, did you forget to include it?)"),this.tree.options[i]=function t(i){var n,o,r,s,a=i||{},l=1,d=arguments.length;if("object"==typeof a||C(a)||(a={}),l===d)throw Error("need at least two args");for(;l<d;l++)if(null!=(n=arguments[l]))for(o in n)k(n,o)&&(s=a[o],a!==(r=n[o])&&(r&&e.isPlainObject(r)?(s=s&&e.isPlainObject(s)?s:{},a[o]=t(s,r)):void 0!==r&&(a[o]=r)));return a}({},t.options,this.tree.options[i]),w(void 0===this.tree.ext[i],"Extension name must not exist as Fancytree.ext attribute: '"+i+"'"),this.tree.ext[i]={},function(t,i,n){for(var o in i)"function"==typeof i[o]?"function"==typeof t[o]?t[o]=E(o,t,0,i,n):"_"===o.charAt(0)?t.ext[n][o]=E(o,t,0,i,n):e.error("Could not override tree."+o+". Use prefix '_' to create tree."+n+"._"+o):"options"!==o&&(t.ext[n][o]=i[o])}(this.tree,t,i),0;void 0!==n.icons&&(!0===n.icon?(this.tree.warn("'icons' tree option is deprecated since v2.14.0: use 'icon' instead"),n.icon=n.icons):e.error("'icons' tree option is deprecated since v2.14.0: use 'icon' only instead")),void 0!==n.iconClass&&(n.icon?e.error("'iconClass' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'iconClass' tree option is deprecated since v2.14.0: use 'icon' instead"),n.icon=n.iconClass)),void 0!==n.tabbable&&(n.tabindex=n.tabbable?"0":"-1",this.tree.warn("'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='"+n.tabindex+"' instead")),this.tree._callHook("treeCreate",this.tree)},_init:function(){this.tree._callHook("treeInit",this.tree),this._bind()},_setOption:function(e,t){return this.tree._callHook("treeSetOption",this.tree,e,t)},_destroy:function(){this._unbind(),this.tree._callHook("treeDestroy",this.tree)},_unbind:function(){var t=this.tree._ns;this.element.off(t),this.tree.$container.off(t),e(document).off(t)},_bind:function(){var t=this,n=this.options,o=this.tree,r=o._ns;this._unbind(),o.$container.on("focusin"+r+" focusout"+r,function(t){var n=i.getNode(t),r="focusin"===t.type;if(!r&&n&&e(t.target).is("a"))n.debug("Ignored focusout on embedded <a> element.");else{if(r){if(o._getExpiringValue("focusin"))return void o.debug("Ignored double focusin.");o._setExpiringValue("focusin",!0,50),n||(n=o._getExpiringValue("mouseDownNode"))&&o.debug("Reconstruct mouse target for focusin from recent event.")}n?o._callHook("nodeSetFocus",o._makeHookContext(n,t),r):o.tbody&&e(t.target).parents("table.fancytree-container > thead").length?o.debug("Ignore focus event outside table body.",t):o._callHook("treeSetFocus",o,r)}}).on("selectstart"+r,"span.fancytree-title",function(e){e.preventDefault()}).on("keydown"+r,function(e){if(n.disabled||!1===n.keyboard)return!0;var t,i=o.focusNode,r=o._makeHookContext(i||o,e),s=o.phase;try{return o.phase="userEvent","preventNav"===(t=i?o._triggerNodeEvent("keydown",i,e):o._triggerTreeEvent("keydown",e))?t=!0:!1!==t&&(t=o._callHook("nodeKeydown",r)),t}finally{o.phase=s}}).on("mousedown"+r,function(e){e=i.getEventTarget(e);o._lastMousedownNode=e?e.node:null,o._setExpiringValue("mouseDownNode",o._lastMousedownNode)}).on("click"+r+" dblclick"+r,function(e){if(n.disabled)return!0;var o,r=i.getEventTarget(e),s=r.node,a=t.tree,l=a.phase;if(!s)return!0;o=a._makeHookContext(s,e);try{switch(a.phase="userEvent",e.type){case"click":return o.targetType=r.type,s.isPagingNode()?!0===a._triggerNodeEvent("clickPaging",o,e):!1!==a._triggerNodeEvent("click",o,e)&&a._callHook("nodeClick",o);case"dblclick":return o.targetType=r.type,!1!==a._triggerNodeEvent("dblclick",o,e)&&a._callHook("nodeDblclick",o)}}finally{a.phase=l}})},getActiveNode:function(){return this._deprecationWarning("getActiveNode"),this.tree.activeNode},getNodeByKey:function(e){return this._deprecationWarning("getNodeByKey"),this.tree.getNodeByKey(e)},getRootNode:function(){return this._deprecationWarning("getRootNode"),this.tree.rootNode},getTree:function(){return this._deprecationWarning("getTree"),this.tree}}),i=e.ui.fancytree,e.extend(e.ui.fancytree,{version:"2.38.2",buildType:"production",debugLevel:3,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:D,_FancytreeNodeClass:O,jquerySupports:{positionMyOfs:function(t){for(var i,n,o=e.map(N(t).split("."),function(e){return parseInt(e,10)}),r=e.map(Array.prototype.slice.call(arguments,1),function(e){return parseInt(e,10)}),s=0;s<r.length;s++)if((i=o[s]||0)!==(n=r[s]||0))return n<i;return!0}(e.ui.version,1,9)},assert:w,createTree:function(t,n){n=e(t).fancytree(n);return i.getTree(n)},debounce:function(e,t,i,n){var o;return 3===arguments.length&&"boolean"!=typeof i&&(n=i,i=!1),function(){var r=arguments;n=n||this,i&&!o&&t.apply(n,r),clearTimeout(o),o=setTimeout(function(){i||t.apply(n,r),o=null},e)}},debug:function(t){4<=e.ui.fancytree.debugLevel&&S("log",arguments)},error:function(t){1<=e.ui.fancytree.debugLevel&&S("error",arguments)},escapeHtml:function(e){return(""+e).replace(o,function(e){return l[e]})},fixPositionOptions:function(t){var i,n,o,r;return(t.offset||0<=(""+t.my+t.at).indexOf("%"))&&e.error("expected new position syntax (but '%' is not supported)"),e.ui.fancytree.jquerySupports.positionMyOfs||(i=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.my),n=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.at),o=(i[2]?+i[2]:0)+(n[2]?+n[2]:0),r=(i[4]?+i[4]:0)+(n[4]?+n[4]:0),t=e.extend({},t,{my:i[1]+" "+i[3],at:n[1]+" "+n[3]}),(o||r)&&(t.offset=o+" "+r)),t},getEventTarget:function(t){var n=t&&t.target?t.target.className:"",o={node:this.getNode(t.target),type:void 0};return/\bfancytree-title\b/.test(n)?o.type="title":/\bfancytree-expander\b/.test(n)?o.type=!1===o.node.hasChildren()?"prefix":"expander":/\bfancytree-checkbox\b/.test(n)?o.type="checkbox":/\bfancytree(-custom)?-icon\b/.test(n)?o.type="icon":/\bfancytree-node\b/.test(n)?o.type="title":t&&t.target&&((t=e(t.target)).is("ul[role=group]")?((o.node&&o.node.tree||i).debug("Ignoring click on outer UL."),o.node=null):t.closest(".fancytree-title").length?o.type="title":t.closest(".fancytree-checkbox").length?o.type="checkbox":t.closest(".fancytree-expander").length&&(o.type="expander")),o},getEventTargetType:function(e){return this.getEventTarget(e).type},getNode:function(t){if(t instanceof O)return t;for(t instanceof e?t=t[0]:void 0!==t.originalEvent&&(t=t.target);t;){if(t.ftnode)return t.ftnode;t=t.parentNode}return null},getTree:function(t){var i=t;return t instanceof D?t:("number"==typeof(t=void 0===t?0:t)?t=e(".fancytree-container").eq(t):"string"==typeof t?(t=e("#ft-id-"+i).eq(0)).length||(t=e(i).eq(0)):t instanceof Element||t instanceof HTMLDocument?t=e(t):t instanceof e?t=t.eq(0):void 0!==t.originalEvent&&(t=e(t.target)),(t=(t=t.closest(":ui-fancytree")).data("ui-fancytree")||t.data("fancytree"))?t.tree:null)},evalOption:function(e,t,i,n,o){var r,s=t.tree,n=n[e],i=i[e];return C(n)?(r={node:t,tree:s,widget:s.widget,options:s.widget.options,typeInfo:s.types[t.type]||{}},null==(r=n.call(s,{type:e},r))&&(r=i)):r=null==i?n:i,r=null==r?o:r},setSpanIcon:function(t,i,n){var o=e(t);"string"==typeof n?o.attr("class",i+" "+n):(n.text?o.text(""+n.text):n.html&&(t.innerHTML=n.html),o.attr("class",i+" "+(n.addClass||"")))},eventToString:function(e){var t=e.which,i=e.type,n=[];return e.altKey&&n.push("alt"),e.ctrlKey&&n.push("ctrl"),e.metaKey&&n.push("meta"),e.shiftKey&&n.push("shift"),"click"===i||"dblclick"===i?n.push(h[e.button]+i):"wheel"===i?n.push(i):d[t]||n.push(c[t]||String.fromCharCode(t).toLowerCase()),n.join("+")},info:function(t){3<=e.ui.fancytree.debugLevel&&S("info",arguments)},keyEventToString:function(e){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(e)},overrideMethod:function(t,i,n,o){var r,s=t[i]||e.noop;t[i]=function(){var e=o||this;try{return r=e._super,e._super=s,n.apply(e,arguments)}finally{e._super=r}}},parseHtml:function(t){var i,n,o,r,s,a,l,d,c=t.find(">li"),u=[];return c.each(function(){var c,h,g=e(this),y=g.find(">span",this).first(),b=y.length?null:g.find(">a").first(),x={tooltip:null,data:{}};for(y.length?x.title=y.html():b&&b.length?(x.title=b.html(),x.data.href=b.attr("href"),x.data.target=b.attr("target"),x.tooltip=b.attr("title")):(x.title=g.html(),0<=(s=x.title.search(/<ul/i))&&(x.title=x.title.substring(0,s))),x.title=N(x.title),r=0,a=f.length;r<a;r++)x[f[r]]=void 0;for(i=this.className.split(" "),o=[],r=0,a=i.length;r<a;r++)n=i[r],p[n]?x[n]=!0:o.push(n);if(x.extraClasses=o.join(" "),(l=g.attr("title"))&&(x.tooltip=l),(l=g.attr("id"))&&(x.key=l),g.attr("hideCheckbox")&&(x.checkbox=!1),(c=H(g))&&!e.isEmptyObject(c)){for(h in m)k(c,h)&&(c[m[h]]=c[h],delete c[h]);for(r=0,a=v.length;r<a;r++)l=v[r],null!=(d=c[l])&&(delete c[l],x[l]=d);e.extend(x.data,c)}(t=g.find(">ul").first()).length?x.children=e.ui.fancytree.parseHtml(t):x.children=x.lazy?void 0:null,u.push(x)}),u},registerExtension:function(t){w(null!=t.name,"extensions must have a `name` property."),w(null!=t.version,"extensions must have a `version` property."),e.ui.fancytree._extensions[t.name]=t},trim:N,unescapeHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue},warn:function(t){2<=e.ui.fancytree.debugLevel&&S("warn",arguments)}}),e.ui.fancytree}function w(t,i){t||(e.ui.fancytree.error(i="Fancytree assertion failed"+(i=i?": "+i:"")),e.error(i))}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function C(e){return"function"==typeof e}function N(e){return null==e?"":e.trim()}function S(e,t){var i,n,e=window.console?window.console[e]:null;if(e)try{e.apply(window.console,t)}catch(o){for(n="",i=0;i<t.length;i++)n+=t[i];e(n)}}function E(e,t,i,n,o){var r,s,a;function l(){return r.apply(t,arguments)}function d(e){return r.apply(t,e)}return r=t[e],s=n[e],a=t.ext[o],function(){var e=t._local,i=t._super,n=t._superApply;try{return t._local=a,t._super=l,t._superApply=d,s.apply(t,arguments)}finally{t._local=e,t._super=i,t._superApply=n}}}function T(t,i){return(void 0===t?e.Deferred(function(){this.resolve()}):e.Deferred(function(){this.resolveWith(t,i)})).promise()}function A(t,i){return(void 0===t?e.Deferred(function(){this.reject()}):e.Deferred(function(){this.rejectWith(t,i)})).promise()}function L(e,t){return function(){e.resolveWith(t)}}function H(t){var i=e.extend({},t.data()),t=i.json;return delete i.fancytree,delete i.uiFancytree,t&&(delete i.json,i=e.extend(i,t)),i}function P(e){return(""+e).replace(r,function(e){return l[e]})}function F(e){return e=e.toLowerCase(),function(t){return 0<=t.title.toLowerCase().indexOf(e)}}function O(t,n){var o,r,s;for(this.parent=t,this.tree=t.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},o=0,r=v.length;o<r;o++)this[s=v[o]]=n[s];for(s in null==this.unselectableIgnore&&null==this.unselectableStatus||(this.unselectable=!0),n.hideCheckbox&&e.error("'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'"),n.data&&e.extend(this.data,n.data),n)y[s]||!this.tree.options.copyFunctionsToData&&C(n[s])||b[s]||(this.data[s]=n[s]);null==this.key?this.tree.options.defaultKey?(this.key=""+this.tree.options.defaultKey(this),w(this.key,"defaultKey() must return a unique key")):this.key="_"+i._nextNodeKey++:this.key=""+this.key,n.active&&(w(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),n.selected&&(this.tree.lastSelectedNode=this),(t=n.children)?t.length?this._setChildren(t):this.children=this.lazy?[]:null:this.children=null,this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function D(t){this.widget=t,this.$div=t.element,this.options=t.options,this.options&&(void 0!==this.options.lazyload&&e.error("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),void 0!==this.options.loaderror&&e.error("The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."),void 0!==this.options.fx&&e.error("The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."),void 0!==this.options.removeNode&&e.error("The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).")),this.ext={},this.types={},this.columns={},this.data=H(this.$div),this._id=""+(this.options.treeId||e.ui.fancytree._nextId++),this._ns=".fancytree-"+this._id,this.activeNode=null,this.focusNode=null,this._hasFocus=null,this._tempCache={},this._lastMousedownNode=null,this._enableUpdate=!0,this.lastSelectedNode=null,this.systemFocusElement=null,this.lastQuicksearchTerm="",this.lastQuicksearchTime=0,this.viewport=null,this.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove(),this.rootNode=new O({tree:this},{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,t=e("<ul>",{id:"ft-id-"+this._id,class:"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=t,this.rootNode.ul=t[0],null==this.options.debugLevel&&(this.options.debugLevel=i.debugLevel)}e.ui.fancytree.warn("Fancytree: ignored duplicate include")});!function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=e(require("jquery"))):e(jQuery)}(function(e){"use strict";var t="__not_found__",i=e.ui.fancytree.escapeHtml,n="",o="";function r(e){return(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function s(t){return t.indexOf(">")>=0?e("<div/>").html(t).text():t}function a(e,t,i){for(var r=[],s=1;s<t.length;s++){var a=t[s].length+(1===s?0:1)+(r[r.length-1]||0);r.push(a)}var l=e.split("");return i?r.forEach(function(e){l[e]=n+l[e]+o}):r.forEach(function(e){l[e]="<mark>"+l[e]+"</mark>"}),l.join("")}return e.ui.fancytree._FancytreeClass.prototype._applyFilterImpl=function(l,d,c){var u,h,f,p,g,v,y,m,b=0,x=this.options,_=x.escapeTitles,w=x.autoCollapse,k=e.extend({},x.filter,c),C="hide"===k.mode,N=!!k.leavesOnly&&!d;if("string"==typeof l){if(""===l)return this.warn("Fancytree passing an empty string as a filter is handled as clearFilter()."),void this.clearFilter();u=k.fuzzy?l.split("").map(r).reduce(function(e,t){return e+"([^"+t+"]*)"+t},""):r(l),f=new RegExp(u,"i"),p=new RegExp(r(l),"gi"),_&&(g=new RegExp(r(n),"g"),v=new RegExp(r(o),"g")),l=function(e){if(!e.title)return!1;var t=_?e.title:s(e.title),r=t.match(f);return r&&k.highlight&&(_?(y=k.fuzzy?a(t,r,_):t.replace(p,function(e){return n+e+o}),e.titleWithHighlight=i(y).replace(g,"<mark>").replace(v,"</mark>")):k.fuzzy?e.titleWithHighlight=a(t,r):e.titleWithHighlight=t.replace(p,function(e){return"<mark>"+e+"</mark>"})),!!r}}return this.enableFilter=!0,this.lastFilterArgs=arguments,m=this.enableUpdate(!1),this.$div.addClass("fancytree-ext-filter"),C?this.$div.addClass("fancytree-ext-filter-hide"):this.$div.addClass("fancytree-ext-filter-dimm"),this.$div.toggleClass("fancytree-ext-filter-hide-expanders",!!k.hideExpanders),this.rootNode.subMatchCount=0,this.visit(function(e){delete e.match,delete e.titleWithHighlight,e.subMatchCount=0}),(h=this.getRootNode()._findDirectChild(t))&&h.remove(),x.autoCollapse=!1,this.visit(function(e){if(!N||null==e.children){var t=l(e),i=!1;if("skip"===t)return e.visit(function(e){e.match=!1},!0),"skip";t||!d&&"branch"!==t||!e.parent.match||(t=!0,i=!0),t&&(b++,e.match=!0,e.visitParents(function(t){t!==e&&(t.subMatchCount+=1),!k.autoExpand||i||t.expanded||(t.setExpanded(!0,{noAnimation:!0,noEvents:!0,scrollIntoView:!1}),t._filterAutoExpanded=!0)},!0))}}),x.autoCollapse=w,0===b&&k.nodata&&C&&("function"==typeof(h=k.nodata)&&(h=h()),!0===h?h={}:"string"==typeof h&&(h={title:h}),h=e.extend({statusNodeType:"nodata",key:t,title:this.options.strings.noData},h),this.getRootNode().addNode(h).match=!0),this._callHook("treeStructureChanged",this,"applyFilter"),this.enableUpdate(m),b},e.ui.fancytree._FancytreeClass.prototype.filterNodes=function(e,t){return"boolean"==typeof t&&(t={leavesOnly:t},this.warn("Fancytree.filterNodes() leavesOnly option is deprecated since 2.9.0 / 2015-04-19. Use opts.leavesOnly instead.")),this._applyFilterImpl(e,!1,t)},e.ui.fancytree._FancytreeClass.prototype.filterBranches=function(e,t){return this._applyFilterImpl(e,!0,t)},e.ui.fancytree._FancytreeClass.prototype.updateFilter=function(){this.enableFilter&&this.lastFilterArgs&&this.options.filter.autoApply?this._applyFilterImpl.apply(this,this.lastFilterArgs):this.warn("updateFilter(): no filter active.")},e.ui.fancytree._FancytreeClass.prototype.clearFilter=function(){var i,n=this.getRootNode()._findDirectChild(t),o=this.options.escapeTitles,r=this.options.enhanceTitle,s=this.enableUpdate(!1);n&&n.remove(),delete this.rootNode.match,delete this.rootNode.subMatchCount,this.visit(function(t){t.match&&t.span&&(i=e(t.span).find(">span.fancytree-title"),o?i.text(t.title):i.html(t.title),r&&r({type:"enhanceTitle"},{node:t,$title:i})),delete t.match,delete t.subMatchCount,delete t.titleWithHighlight,t.$subMatchBadge&&(t.$subMatchBadge.remove(),delete t.$subMatchBadge),t._filterAutoExpanded&&t.expanded&&t.setExpanded(!1,{noAnimation:!0,noEvents:!0,scrollIntoView:!1}),delete t._filterAutoExpanded}),this.enableFilter=!1,this.lastFilterArgs=null,this.$div.removeClass("fancytree-ext-filter fancytree-ext-filter-dimm fancytree-ext-filter-hide"),this._callHook("treeStructureChanged",this,"clearFilter"),this.enableUpdate(s)},e.ui.fancytree._FancytreeClass.prototype.isFilterActive=function(){return!!this.enableFilter},e.ui.fancytree._FancytreeNodeClass.prototype.isMatched=function(){return!(this.tree.enableFilter&&!this.match)},e.ui.fancytree.registerExtension({name:"filter",version:"2.38.2",options:{autoApply:!0,autoExpand:!1,counter:!0,fuzzy:!1,hideExpandedCounter:!0,hideExpanders:!1,highlight:!0,leavesOnly:!1,nodata:!0,mode:"dimm"},nodeLoadChildren:function(e,t){var i=e.tree;return this._superApply(arguments).done(function(){i.enableFilter&&i.lastFilterArgs&&e.options.filter.autoApply&&i._applyFilterImpl.apply(i,i.lastFilterArgs)})},nodeSetExpanded:function(e,t,i){var n=e.node;return delete n._filterAutoExpanded,!t&&e.options.filter.hideExpandedCounter&&n.$subMatchBadge&&n.$subMatchBadge.show(),this._superApply(arguments)},nodeRenderStatus:function(t){var i,n=t.node,o=t.tree,r=t.options.filter,s=e(n.span).find("span.fancytree-title"),a=e(n[o.statusClassPropName]),l=t.options.enhanceTitle,d=t.options.escapeTitles;return i=this._super(t),a.length&&o.enableFilter?(a.toggleClass("fancytree-match",!!n.match).toggleClass("fancytree-submatch",!!n.subMatchCount).toggleClass("fancytree-hide",!(n.match||n.subMatchCount)),!r.counter||!n.subMatchCount||n.isExpanded()&&r.hideExpandedCounter?n.$subMatchBadge&&n.$subMatchBadge.hide():(n.$subMatchBadge||(n.$subMatchBadge=e("<span class='fancytree-childcounter'/>"),e("span.fancytree-icon, span.fancytree-custom-icon",n.span).append(n.$subMatchBadge)),n.$subMatchBadge.show().text(n.subMatchCount)),!n.span||n.isEditing&&n.isEditing.call(n)||(n.titleWithHighlight?s.html(n.titleWithHighlight):d?s.text(n.title):s.html(n.title),l&&l({type:"enhanceTitle"},{node:n,$title:s})),i):i}}),e.ui.fancytree});