%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/usr/share/webmin/authentic-theme/unauthenticated/js/
Upload File :
Create Path :
Current File : //proc/self/root/usr/share/webmin/authentic-theme/unauthenticated/js/jquery.fancytree.min.js

/*! jQuery UI - v1.12.1 - 2018-03-18
* http://jqueryui.com
* Includes: widget.js, unique-id.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){e.ui=e.ui||{},e.ui.version="1.12.1";var t,i,n=0,r=Array.prototype.slice;e.cleanData=e.cleanData||(t=e.cleanData,function(i){var n,r,o;for(o=0;null!=(r=i[o]);o++)try{(n=e._data(r,"events"))&&n.remove&&e(r).triggerHandler("remove")}catch(e){}t(i)}),e.widget=e.widget||function(t,i,n){var r,o,s,a={},l=t.split(".")[0],d=l+"-"+(t=t.split(".")[1]);return n||(n=i,i=e.Widget),e.isArray(n)&&(n=e.extend.apply(null,[{}].concat(n))),e.expr[":"][d.toLowerCase()]=function(t){return!!e.data(t,d)},e[l]=e[l]||{},r=e[l][t],o=e[l][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),(s=new i).options=e.widget.extend({},s.options),e.each(n,function(t,n){e.isFunction(n)?a[t]=function(){function e(){return i.prototype[t].apply(this,arguments)}function r(e){return i.prototype[t].apply(this,e)}return function(){var t,i=this._super,o=this._superApply;return this._super=e,this._superApply=r,t=n.apply(this,arguments),this._super=i,this._superApply=o,t}}():a[t]=n}),o.prototype=e.widget.extend(s,{widgetEventPrefix:r&&s.widgetEventPrefix||t},a,{constructor:o,namespace:l,widgetName:t,widgetFullName:d}),r?(e.each(r._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,o,i._proto)}),delete r._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,n,o=r.call(arguments,1),s=0,a=o.length;s<a;s++)for(i in o[s])n=o[s][i],o[s].hasOwnProperty(i)&&void 0!==n&&(e.isPlainObject(n)?t[i]=e.isPlainObject(t[i])?e.widget.extend({},t[i],n):e.widget.extend({},n):t[i]=n);return t},e.widget.bridge=function(t,i){var n=i.prototype.widgetFullName||t;e.fn[t]=function(o){var s="string"==typeof o,a=r.call(arguments,1),l=this;return s?this.length||"instance"!==o?this.each(function(){var i,r=e.data(this,n);return"instance"===o?(l=r,!1):r?e.isFunction(r[o])&&"_"!==o.charAt(0)?(i=r[o].apply(r,a))!==r&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0:e.error("no such method '"+o+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+o+"'")}):l=void 0:(a.length&&(o=e.widget.extend.apply(null,[o].concat(a))),this.each(function(){var t=e.data(this,n);t?(t.option(o||{}),t._init&&t._init()):e.data(this,n,new i(o,this))})),l}},e.Widget=e.Widget||function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),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,r,o,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(r=s[t]=e.widget.extend({},this.options[t]),o=0;o<n.length-1;o++)r[n[o]]=r[n[o]]||{},r=r[n[o]];if(t=n.pop(),1===arguments.length)return void 0===r[t]?null:r[t];r[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){var t;for(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,r;for(i in t)r=this.classesElementLookup[i],t[i]!==this.options.classes[i]&&r&&r.length&&(n=e(r.get()),this._removeClass(r,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 r(r,o){var s,a;for(a=0;a<r.length;a++)s=n.classesElementLookup[r[a]]||e(),s=t.add?e(e.unique(s.get().concat(t.element.get()))):e(s.not(t.element).get()),n.classesElementLookup[r[a]]=s,i.push(r[a]),o&&t.classes[r[a]]&&i.push(t.classes[r[a]])}return t=e.extend({element:this.element,classes:this.options.classes||{}},t),this._on(t.element,{remove:"_untrackClassesElement"}),t.keys&&r(t.keys.match(/\S+/g)||[],!0),t.extra&&r(t.extra.match(/\S+/g)||[]),i.join(" ")},_untrackClassesElement:function(t){var i=this;e.each(i.classesElementLookup,function(n,r){-1!==e.inArray(t.target,r)&&(i.classesElementLookup[n]=e(r.not(t.target).get()))})},_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){n="boolean"==typeof n?n:i;var r="string"==typeof e||null===e,o={extra:r?t:i,keys:r?e:t,element:r?this.element:e,add:n};return o.element.toggleClass(this._classes(o),n),this},_on:function(t,i,n){var r,o=this;"boolean"!=typeof t&&(n=i,i=t,t=!1),n?(i=r=e(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,r=this.widget()),e.each(n,function(n,s){function a(){if(t||!0!==o.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof s?o[s]:s).apply(o,arguments)}"string"!=typeof s&&(a.guid=s.guid=s.guid||a.guid||e.guid++);var l=n.match(/^([\w:-]*)\s*(.*)$/),d=l[1]+o.eventNamespace,c=l[2];c?r.on(d,c,a):i.on(d,a)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(i).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 r,o,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],o=i.originalEvent)for(r in o)r in i||(i[r]=o[r]);return this.element.trigger(i,n),!(e.isFunction(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,r,o){var s;"string"==typeof r&&(r={effect:r});var a=r?!0===r||"number"==typeof r?i:r.effect||i:t;"number"==typeof(r=r||{})&&(r={duration:r}),s=!e.isEmptyObject(r),r.complete=o,r.delay&&n.delay(r.delay),s&&e.effects&&e.effects.effect[a]?n[t](r):a!==t&&n[a]?n[a](r.duration,r.easing,o):n.queue(function(i){e(this)[t](),o&&o.call(n[0]),i()})}}),e.widget,function(){var t,i=Math.max,n=Math.abs,r=/left|center|right/,o=/top|center|bottom/,s=/[\+\-]\d+(\.[\d]+)?%?/,a=/^\w+/,l=/%$/,d=e.fn.position;function c(e,t,i){return[parseFloat(e[0])*(l.test(e[0])?t/100:1),parseFloat(e[1])*(l.test(e[1])?i/100:1)]}function h(t,i){return parseInt(e.css(t,i),10)||0}e.position=e.position||{scrollbarWidth:function(){if(void 0!==t)return t;var i,n,r=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=r.children()[0];return e("body").append(r),i=o.offsetWidth,r.css("overflow","scroll"),i===(n=o.offsetWidth)&&(n=r[0].clientWidth),r.remove(),t=i-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"),r="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:r?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),n=e.isWindow(i[0]),r=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:n,isDocument:r,offset:n||r?{left:0,top:0}:e(t).offset(),scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return d.apply(this,arguments);t=e.extend({},t);var l,u,f,p,g,v,y,m,b=e(t.of),x=e.position.getWithinInfo(t.within),_=e.position.getScrollInfo(x),w=(t.collision||"flip").split(" "),k={};return v=9===(m=(y=b)[0]).nodeType?{width:y.width(),height:y.height(),offset:{top:0,left:0}}:e.isWindow(m)?{width:y.width(),height:y.height(),offset:{top:y.scrollTop(),left:y.scrollLeft()}}:m.preventDefault?{width:0,height:0,offset:{top:m.pageY,left:m.pageX}}:{width:y.outerWidth(),height:y.outerHeight(),offset:y.offset()},b[0].preventDefault&&(t.at="left top"),u=v.width,f=v.height,p=v.offset,g=e.extend({},p),e.each(["my","at"],function(){var e,i,n=(t[this]||"").split(" ");1===n.length&&(n=r.test(n[0])?n.concat(["center"]):o.test(n[0])?["center"].concat(n):["center","center"]),n[0]=r.test(n[0])?n[0]:"center",n[1]=o.test(n[1])?n[1]:"center",e=s.exec(n[0]),i=s.exec(n[1]),k[this]=[e?e[0]:0,i?i[0]:0],t[this]=[a.exec(n[0])[0],a.exec(n[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===t.at[0]?g.left+=u:"center"===t.at[0]&&(g.left+=u/2),"bottom"===t.at[1]?g.top+=f:"center"===t.at[1]&&(g.top+=f/2),l=c(k.at,u,f),g.left+=l[0],g.top+=l[1],this.each(function(){var r,o,s=e(this),a=s.outerWidth(),d=s.outerHeight(),v=h(this,"marginLeft"),y=h(this,"marginTop"),m=a+v+h(this,"marginRight")+_.width,C=d+y+h(this,"marginBottom")+_.height,N=e.extend({},g),S=c(k.my,s.outerWidth(),s.outerHeight());"right"===t.my[0]?N.left-=a:"center"===t.my[0]&&(N.left-=a/2),"bottom"===t.my[1]?N.top-=d:"center"===t.my[1]&&(N.top-=d/2),N.left+=S[0],N.top+=S[1],r={marginLeft:v,marginTop:y},e.each(["left","top"],function(i,n){e.ui.position[w[i]]&&e.ui.position[w[i]][n](N,{targetWidth:u,targetHeight:f,elemWidth:a,elemHeight:d,collisionPosition:r,collisionWidth:m,collisionHeight:C,offset:[l[0]+S[0],l[1]+S[1]],my:t.my,at:t.at,within:x,elem:s})}),t.using&&(o=function(e){var r=p.left-N.left,o=r+u-a,l=p.top-N.top,c=l+f-d,h={target:{element:b,left:p.left,top:p.top,width:u,height:f},element:{element:s,left:N.left,top:N.top,width:a,height:d},horizontal:o<0?"left":r>0?"right":"center",vertical:c<0?"top":l>0?"bottom":"middle"};u<a&&n(r+o)<u&&(h.horizontal="center"),f<d&&n(l+c)<f&&(h.vertical="middle"),i(n(r),n(o))>i(n(l),n(c))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),s.offset(e.extend(N,{using:o}))})},e.ui.position={fit:{left:function(e,t){var n,r=t.within,o=r.isWindow?r.scrollLeft:r.offset.left,s=r.width,a=e.left-t.collisionPosition.marginLeft,l=o-a,d=a+t.collisionWidth-s-o;t.collisionWidth>s?l>0&&d<=0?(n=e.left+l+t.collisionWidth-s-o,e.left+=l-n):e.left=d>0&&l<=0?o:l>d?o+s-t.collisionWidth:o:l>0?e.left+=l:d>0?e.left-=d:e.left=i(e.left-a,e.left)},top:function(e,t){var n,r=t.within,o=r.isWindow?r.scrollTop:r.offset.top,s=t.within.height,a=e.top-t.collisionPosition.marginTop,l=o-a,d=a+t.collisionHeight-s-o;t.collisionHeight>s?l>0&&d<=0?(n=e.top+l+t.collisionHeight-s-o,e.top+=l-n):e.top=d>0&&l<=0?o:l>d?o+s-t.collisionHeight:o:l>0?e.top+=l:d>0?e.top-=d:e.top=i(e.top-a,e.top)}},flip:{left:function(e,t){var i,r,o=t.within,s=o.offset.left+o.scrollLeft,a=o.width,l=o.isWindow?o.scrollLeft:o.offset.left,d=e.left-t.collisionPosition.marginLeft,c=d-l,h=d+t.collisionWidth-a-l,u="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,f="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,p=-2*t.offset[0];c<0?((i=e.left+u+f+p+t.collisionWidth-a-s)<0||i<n(c))&&(e.left+=u+f+p):h>0&&((r=e.left-t.collisionPosition.marginLeft+u+f+p-l)>0||n(r)<h)&&(e.left+=u+f+p)},top:function(e,t){var i,r,o=t.within,s=o.offset.top+o.scrollTop,a=o.height,l=o.isWindow?o.scrollTop:o.offset.top,d=e.top-t.collisionPosition.marginTop,c=d-l,h=d+t.collisionHeight-a-l,u="top"===t.my[1]?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,p=-2*t.offset[1];c<0?((r=e.top+u+f+p+t.collisionHeight-a-s)<0||r<n(c))&&(e.top+=u+f+p):h>0&&((i=e.top-t.collisionPosition.marginTop+u+f+p-l)>0||n(i)<h)&&(e.top+=u+f+p)}},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)}}}}(),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,r=t?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var t=e(this);return(!n||"static"!==t.css("position"))&&r.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:e(this[0].ownerDocument||document)},e.fn.extend({uniqueId:(i=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++i)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}})}),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){var t,i,n=null,r=new RegExp(/\.|\//),o=/[&<>"'/]/g,s=/[<>"'/]/g,a="$recursive_request",l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},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:"'"},h={16:"shift",17:"ctrl",18:"alt",91:"meta",93:"meta"},u={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};for(t=0;t<f.length;t++)p[f[t]]=!0;for(t=0;t<v.length;t++)i=v[t],y[i]=!0,i!==i.toLowerCase()&&(m[i.toLowerCase()]=i);return x(e.ui,"Fancytree requires jQuery UI (http://jqueryui.com)"),Date.now||(Date.now=function(){return(new Date).getTime()}),A.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){x(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 A(this,e[t]));this.tree._callHook("treeStructureChanged",this.tree,"setChildren")},addChildren:function(t,i){var n,r,o,s,a=this.getFirstChild(),l=this.getLastChild(),d=[];for(e.isPlainObject(t)&&(t=[t]),this.children||(this.children=[]),n=0,r=t.length;n<r;n++)d.push(new A(this,t[n]));if(s=d[0],null==i?this.children=this.children.concat(d):(i=this._findDirectChild(i),x(0<=(o=e.inArray(i,this.children)),"insertBefore must be an existing child"),this.children.splice.apply(this.children,[o,0].concat(d))),a&&!i){for(n=0,r=d.length;n<r;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(void 0!==t&&"over"!==t||(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)}x(!1,"Invalid mode: "+t)},addPagingNode:function(t,i){var n,r;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"===(r=this.children[n]).statusNodeType&&this.removeChild(r);this.partload=!1},appendSibling:function(e){return this.addNode(e,"after")},applyPatch:function(t){if(null===t)return this.remove(),N(this);var i,n,r={children:!0,expanded:!0,parent:!0};for(i in t)t.hasOwnProperty(i)&&(n=t[i],r[i]||e.isFunction(n)||(y[i]?this[i]=n:this.data[i]=n));return t.hasOwnProperty("children")&&(this.removeChildren(),t.children&&this._setChildren(t.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),t.hasOwnProperty("expanded")?this.setExpanded(t.expanded):N(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,r=this.children;if(!r)return 0;if(n=r.length,!1!==e)for(t=0,i=n;t<i;t++)n+=r[t].countChildren();return n},debug:function(e){4<=this.tree.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),_("log",arguments))},discard:function(){return this.warn("FancytreeNode.discard() is deprecated since 2014-02-16. Use .resetLazy() instead."),this.resetLazy()},discardMarkup:function(e){var t=e?"nodeRemoveMarkup":"nodeRemoveChildMarkup";this.tree._callHook(t,this)},error:function(e){1<=this.tree.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),_("error",arguments))},findAll:function(t){t=e.isFunction(t)?t:H(t);var i=[];return this.visit(function(e){t(e)&&i.push(e)}),i},findFirst:function(t){t=e.isFunction(t)?t:H(t);var i=null;return this.visit(function(e){if(t(e))return i=e,!1}),i},findRelatedNode:function(e,t){return this.tree.findRelatedNode(this,e,t)},_changeSelectStatusAttrs:function(e){var t=!1,i=this.tree.options,r=n.evalOption("unselectable",this,this,i,!1),o=n.evalOption("unselectableStatus",this,this,i,void 0);switch(r&&null!=o&&(e=o),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:x(!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;x(3===t.selectMode,"expected selectMode 3"),function e(i){var r,o,s,a,l,d,c,h,u=i.children;if(u&&u.length){for(c=!(d=!0),r=0,o=u.length;r<o;r++)a=e(s=u[r]),n.evalOption("unselectableIgnore",s,s,t,!1)||(!1!==a&&(c=!0),!0!==a&&(d=!1));l=!!d||!!c&&void 0}else l=null==(h=n.evalOption("unselectableStatus",i,i,t,void 0))?!!i.selected:!!h;return i.partsel&&!i.selected&&i.lazy&&null==i.children&&(l=void 0),i._changeSelectStatusAttrs(l),l}(this),this.visitParents(function(e){var i,r,o,s,a,l=e.children,d=!0,c=!1;for(i=0,r=l.length;i<r;i++)o=l[i],n.evalOption("unselectableIgnore",o,o,t,!1)||(((s=null==(a=n.evalOption("unselectableStatus",o,o,t,void 0))?!!o.selected:!!a)||o.partsel)&&(c=!0),s||(d=!1));s=!!d||!!c&&void 0,e._changeSelectStatusAttrs(s)})},fromDict:function(t){for(var i in t)y[i]?this[i]=t[i]:"data"===i?e.extend(this.data,t.data):e.isFunction(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,r=[];return e.each(this.getParentList(!1,!0),function(e,t){n=""+(t.getIndex()+1),i&&(n=("0000000"+n).substr(-i)),r.push(n)}),r.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){var e,t,i=this.parent.children;for(e=0,t=i.length-1;e<t;e++)if(i[e]===this)return i[e+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(t,i,n){t=!1!==t,i=i||"title",n=n||"/";var r,o=[],s=e.isFunction(i);return this.visitParents(function(e){e.parent&&(r=s?i(e):e[i],o.unshift(r))},t),o.join(n)},getPrevSibling:function(){if(this.parent){var e,t,i=this.parent.children;for(e=1,t=i.length;e<t;e++)if(i[e]===this)return i[e-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(){if(this.lazy){if(null==this.children)return;if(0===this.children.length)return!1;if(1===this.children.length&&this.children[0].isStatusNode())return;return!0}return!(!this.children||!this.children.length)},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()),_("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 this.debug("isVisible: HIDDEN ("+i+", "+this.match+", "+this.match+")"),!1;for(e=0,t=n.length;e<t;e++)if(!n[e].expanded)return this.debug("isVisible: HIDDEN (parent collapsed)"),!1;return this.debug("isVisible: VISIBLE"),!0},lazyLoad:function(e){return this.warn("FancytreeNode.lazyLoad() is deprecated since 2014-02-16. Use .load() instead."),this.load(e)},load:function(e){var t,i,n=this,r=this.isExpanded();return x(this.isLazy(),"load() requires a lazy node"),e||this.isUndefined()?(this.isLoaded()&&this.resetLazy(),!1===(i=this.tree._triggerNodeEvent("lazyLoad",this))?N(this):(x("boolean"!=typeof i,"lazyLoad event must return source in data.result"),t=this.tree._callHook("nodeLoadChildren",this,i),r?(this.expanded=!0,t.always(function(){n.render()})):t.always(function(){n.renderStatus()}),t)):N(this)},makeVisible:function(t){var i,n=this,r=[],o=new e.Deferred,s=this.getParentList(!1,!1),a=s.length,l=!(t&&!0===t.noAnimation),d=!(t&&!1===t.scrollIntoView);for(i=a-1;0<=i;i--)r.push(s[i].setExpanded(!0,t));return e.when.apply(e,r).done(function(){d?n.scrollIntoView(l).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 r,o=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 x(0<=(r=e.inArray(this,this.parent.children)),"invalid source parent"),this.parent.children.splice(r,1);if((this.parent=a).hasChildren())switch(i){case"child":a.children.push(this);break;case"before":x(0<=(r=e.inArray(t,a.children)),"invalid target parent"),a.children.splice(r,0,this);break;case"after":x(0<=(r=e.inArray(t,a.children)),"invalid target parent"),a.children.splice(r+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),o!==t.tree&&(this.warn("Cross-tree moveTo is experimental!"),this.visit(function(e){e.tree=t.tree},!0)),o._callHook("treeStructureChanged",o,"moveTo"),s.isDescendantOf(a)||s.render(),a.isDescendantOf(s)||a===s||a.render()}},navigate:function(t,i){var n,r=e.ui.keyCode;switch(t){case"left":case r.LEFT:if(this.expanded)return this.setExpanded(!1);break;case"right":case r.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():n.setActive()}return this.warn("Could not find related node '"+t+"'."),N()},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(i){var n,r=this.parent,o=e.inArray(this,r.children),s=this;return x(this.isPagingNode(),"replaceWith() currently requires a paging status node"),(n=this.tree._callHook("nodeLoadChildren",this,i)).done(function(e){var i=s.children;for(t=0;t<i.length;t++)i[t].parent=r;r.children.splice.apply(r.children,[o+1,0].concat(i)),s.children=null,s.remove(),r.render()}).fail(function(){s.setExpanded()}),n},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&&(n=i).tree&&void 0!==n.statusNodeType)throw Error("scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead.");var n,r=e.extend({effects:!0===t?{duration:200,queue:!1}:t,scrollOfs:this.tree.options.scrollOfs,scrollParent:this.tree.options.scrollParent,topNode:null},i),o=r.scrollParent,s=this.tree.$container,a=s.css("overflow-y");o?o.jquery||(o=e(o)):o=this.tree.tbody?s.scrollParent():"scroll"===a||"auto"===a?s:s.scrollParent(),o[0]!==document&&o[0]!==document.body||(this.debug("scrollIntoView(): normalizing scrollParent to 'window':",o[0]),o=e(window));var l,d,c,h=new e.Deferred,u=this,f=e(this.span).height(),p=r.scrollOfs.top||0,g=r.scrollOfs.bottom||0,v=o.height(),y=o.scrollTop(),m=o,b=o[0]===window,_=r.topNode||null,w=null;return this.isVisible()?(b?(d=e(this.span).offset().top,l=_&&_.span?e(_.span).offset().top:0,m=e("html,body")):(x(o[0]!==document&&o[0]!==document.body,"scrollParent should be a simple element or `window`, not document or body."),c=o.offset().top,d=e(this.span).offset().top-c+y,l=_?e(_.span).offset().top-c+y:0,v-=Math.max(0,o.innerHeight()-o[0].clientHeight)),d<y+p?w=d-p:y+v-g<d+f&&(w=d+f-v+g,_&&(x(_.isRootNode()||_.isVisible(),"topNode must be visible"),l<w&&(w=l-p))),null===w?h.resolveWith(this):r.effects?(r.effects.complete=function(){h.resolveWith(u)},m.stop(!0).animate({scrollTop:w},r.effects)):(m[0].scrollTop=w,h.resolveWith(this)),h.promise()):(this.warn("scrollIntoView(): node is invisible."),N())},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,r=this.children;if(r){if(e=e||function(e,t){var i=e.title.toLowerCase(),n=t.title.toLowerCase();return i===n?0:n<i?1:-1},r.sort(e),t)for(i=0,n=r.length;i<n;i++)r[i].children&&r[i].sortChildren(e,"$norender$");"$norender$"!==t&&this.render(),this.triggerModifyChild("sort")}},toDict:function(t,i){var n,r,o,s={},a=this;if(e.each(v,function(e,t){(a[t]||!1===a[t])&&(s[t]=a[t])}),e.isEmptyObject(this.data)||(s.data=e.extend({},this.data),e.isEmptyObject(s.data)&&delete s.data),i&&i(s,a),t&&this.hasChildren())for(s.children=[],n=0,r=this.children.length;n<r;n++)(o=this.children[n]).isStatusNode()||s.children.push(o.toDict(!0,i));return s},toggleClass:function(t,i){var n,r,o=t.match(/\S+/g)||[],s=0,a=!1,l=this[this.tree.statusClassPropName],d=" "+(this.extraClasses||"")+" ";for(l&&e(l).toggleClass(t,i);n=o[s++];)if(r=0<=d.indexOf(" "+n+" "),i=void 0===i?!r:!!i)r||(d+=n+" ",a=!0);else for(;-1<d.indexOf(" "+n+" ");)d=d.replace(" "+n+" "," ");return this.extraClasses=e.trim(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 r,o=this.tree.options.modifyChild;o&&(i&&i.parent!==this&&e.error("childNode "+i+" is not a child of "+this),r={node:this,tree:this.tree,operation:t,childNode:i||null},n&&e.extend(r,n),o({type:"modifyChild"},r))},triggerModify:function(e,t){this.parent.triggerModifyChild(e,this,t)},visit:function(e,t){var i,n,r=!0,o=this.children;if(!0===t&&(!1===(r=e(this))||"skip"===r))return r;if(o)for(i=0,n=o.length;i<n&&!1!==(r=o[i].visit(e,!0));i++);return r},visitAndLoad:function(t,i,n){var r,o,s,a=this;return!t||!0!==i||!1!==(o=t(a))&&"skip"!==o?a.children||a.lazy?(r=new e.Deferred,s=[],a.load().done(function(){for(var i=0,n=a.children.length;i<n;i++){if(!1===(o=a.children[i].visitAndLoad(t,!0,!0))){r.reject();break}"skip"!==o&&s.push(o)}e.when.apply(this,s).then(function(){r.resolve()})}),r.promise()):N():n?o:N()},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){var i,n,r,o=this.parent.children;for(i=0,n=o.length;i<n;i++)if(r=o[i],(t||r!==this)&&!1===e(r))return!1;return!0},warn:function(e){2<=this.tree.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),_("warn",arguments))}},L.prototype={_makeHookContext:function(t,i,n){var r,o;return void 0!==t.node?(i&&t.originalEvent!==i&&e.error("invalid args"),r=t):t.tree?r={node:t,tree:o=t.tree,widget:o.widget,options:o.widget.options,originalEvent:i,typeInfo:o.types[t.type]||{}}:t.widget?r={node:null,tree:t,widget:t.widget,options:t.widget.options,originalEvent:i}:e.error("invalid args"),n&&e.extend(r,n),r},_callHook:function(t,i,n){var r=this._makeHookContext(i),o=this[t],s=Array.prototype.slice.call(arguments,2);return e.isFunction(o)||e.error("_callHook('"+t+"') is not a function"),s.unshift(r),o.apply(this,s)},_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)},_requireExtension:function(t,i,n,r){null!=n&&(n=!!n);var o=this._local.name,s=this.options.extensions,a=e.inArray(t,s)<e.inArray(o,s),l=i&&null==this.ext[t],d=!l&&null!=n&&n!==a;return x(o&&o!==t,"invalid or same name '"+o+"' (require yourself?)"),!l&&!d||(r||(l||i?(r="'"+o+"' extension requires '"+t+"'",d&&(r+=" to be registered "+(n?"before":"after")+" itself")):r="If used together, `"+t+"` must be registered "+(n?"before":"after")+" `"+o+"`"),e.error(r),!1)},activateKey:function(e,t){var i=this.getNodeByKey(e);return i?i.setActive(!0,t):this.activeNode&&this.activeNode.setActive(!1,t),i},addPagingNode:function(e,t){return this.rootNode.addPagingNode(e,t)},applyPatch:function(t){var i,n,r,o,s,a,l=t.length,d=[];for(n=0;n<l;n++)x(2===(r=t[n]).length,"patchList must be an array of length-2-arrays"),o=r[0],s=r[1],(a=null===o?this.rootNode:this.getNodeByKey(o))?(i=new e.Deferred,d.push(i),a.applyPatch(s).always(E(i,a))):this.warn("could not find node with key '"+o+"'");return e.when.apply(e,d).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()),_("log",arguments))},enable:function(e){!1===e?this.widget.disable():this.widget.enable()},enableUpdate:function(e){return e=!1!==e,!!this._enableUpdate==!!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()),_("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,r=this.getFirstChild();function o(i){if(e(i)&&(n=i),n||i===t)return!1}return e="string"==typeof e?(i=new RegExp("^"+e,"i"),function(e){return i.test(e.title)}):e,t=t||r,this.visitRows(o,{start:t,includeSelf:!1}),n||t===r||this.visitRows(o,{start:r,includeSelf:!0}),n},findRelatedNode:function(t,i,n){var r=null,o=e.ui.keyCode;switch(i){case"parent":case o.BACKSPACE:t.parent&&t.parent.parent&&(r=t.parent);break;case"first":case o.HOME:this.visit(function(e){if(e.isVisible())return r=e,!1});break;case"last":case o.END:this.visit(function(e){e.isVisible()&&(r=e)});break;case"left":case o.LEFT:t.expanded?t.setExpanded(!1):t.parent&&t.parent.parent&&(r=t.parent);break;case"right":case o.RIGHT:t.expanded||!t.children&&!t.lazy?t.children&&t.children.length&&(r=t.children[0]):(t.setExpanded(),r=t);break;case"up":case o.UP:this.visitRows(function(e){return r=e,!1},{start:t,reverse:!0,includeSelf:!1});break;case"down":case o.DOWN:this.visitRows(function(e){return r=e,!1},{start:t,includeSelf:!1});break;default:this.tree.warn("Unknown relation '"+i+"'.")}return r},generateFormElements:function(t,i,n){n=n||{};var r,o="string"==typeof t?t:"ft_"+this._id+"[]",s="string"==typeof i?i:"ft_"+this._id+"_active",a="fancytree_result_"+this._id,l=e("#"+a),d=3===this.options.selectMode&&!1!==n.stopOnParents;function c(t){l.append(e("<input>",{type:"checkbox",name:o,value:t.key,checked:!0}))}l.length?l.empty():l=e("<div>",{id:a}).hide().insertAfter(this.$container),!1!==i&&this.activeNode&&l.append(e("<input>",{type:"radio",name:s,value:this.activeNode.key,checked:!0})),n.filter?this.visit(function(e){var t=n.filter(e);if("skip"===t)return t;!1!==t&&c(e)}):!1!==t&&(r=this.getSelectedNodes(d),e.each(r,function(e,t){c(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?i.ftnode:null:(t=t||this.rootNode,n=null,t.visit(function(t){if(t.key===e)return n=t,!1},!0),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()),_("info",arguments))},loadKeyPath:function(t,i){var n,r,o,s=this,a=new e.Deferred,l=this.getRootNode(),d=this.options.keyPathSeparator,c=[],h=e.extend({},i);for("function"==typeof i?n=i:i&&i.callback&&(n=i.callback),h.callback=function(e,t,i){n&&n.call(e,t,i),a.notifyWith(e,[{node:t,status:i}])},null==h.matchKey&&(h.matchKey=function(e,t){return e.key===t}),e.isArray(t)||(t=[t]),r=0;r<t.length;r++)(o=t[r]).charAt(0)===d&&(o=o.substr(1)),c.push(o.split(d));return setTimeout(function(){s._loadKeyPathImpl(a,h,l,c).done(function(){a.resolve()})},0),a.promise()},_loadKeyPathImpl:function(t,i,n,r){var o,s,a,l,d,c,h,u,f,p,g=this;function v(e,t){var n,r,o=e.children;if(o)for(n=0,r=o.length;n<r;n++)if(i.matchKey(o[n],t))return o[n];return null}for(h={},s=0;s<r.length;s++)for(f=r[s],u=n;f.length;){if(a=f.shift(),!(l=v(u,a))){this.warn("loadKeyPath: key not found: "+a+" (parent: "+u+")"),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"),h[a=l.key]?h[a].pathSegList.push(f):h[a]={parent:l,pathSegList:[f]};break}i.callback(this,l,"loaded"),u=l}function y(e,t,n){i.callback(g,t,"loading"),t.load().done(function(){g._loadKeyPathImpl.call(g,e,i,t,n).always(E(e,g))}).fail(function(n){g.warn("loadKeyPath: error loading lazy "+t),i.callback(g,l,"error"),e.rejectWith(g)})}for(d in o=[],h)h.hasOwnProperty(d)&&(c=h[d],p=new e.Deferred,o.push(p),y(p,c.parent,c.pathSegList));return e.when.apply(e,o).promise()},reactivate:function(e){var t,i=this.activeNode;return i?(this.activeNode=null,t=i.setActive(!0,{noFocus:!0}),e&&i.setFocus(),t):N()},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)},toDict:function(e,t){var i=this.rootNode.toDict(!0,t);return e?i:i.children},toString:function(){return"Fancytree@"+this._id},_triggerNodeEvent:function(e,t,i,n){var r=this._makeHookContext(t,i,n),o=this.widget._trigger(e,i,r);return!1!==o&&void 0!==r.result?r.result:o},_triggerTreeEvent:function(e,t,i){var n=this._makeHookContext(this,t,i),r=this.widget._trigger(e,t,n);return!1!==r&&void 0!==n.result?n.result:r},visit:function(e){return this.rootNode.visit(e,!1)},visitRows:function(e,t){if(!this.rootNode.children)return!1;if(t&&t.reverse)return delete t.reverse,this._visitRowsUp(e,t);var i,n,r,o=0,s=!1===(t=t||{}).includeSelf,a=!!t.includeHidden,l=!a&&this.enableFilter,d=t.start||this.rootNode.children[0];for(n=d.parent;n;){for(i=(r=n.children).indexOf(d)+o;i<r.length;i++)if(d=r[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}n=(d=n).parent,o=1}return!0},_visitRowsUp:function(e,t){for(var i,n,r=!!t.includeHidden,o=t.start||this.rootNode.children[0];;){if((i=(n=o.parent).children)[0]===o){if(!(o=n).parent)break;i=n.children}else for(o=i[i.indexOf(o)-1];(r||o.expanded)&&o.children&&o.children.length;)o=(i=(n=o).children)[i.length-1];if((r||o.isVisible())&&!1===e(o))return!1}},warn:function(e){2<=this.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),_("warn",arguments))}},e.extend(L.prototype,{nodeClick:function(e){var t,i,n=e.targetType,r=e.node;if("expander"===n){if(r.isLoading())return void r.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),r.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,r,o=e.node;if(o.parent)for(n=0,r=(i=o.parent.children).length;n<r;n++)i[n]!==o&&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 i,r,o,s=t.originalEvent,a=t.node,l=t.tree,d=t.options,u=s.which,f=s.key||String.fromCharCode(u),p=!!(s.altKey||s.ctrlKey||s.metaKey),g=!h[u]&&!c[u]&&!p,v=e(s.target),y=!0,m=!(s.ctrlKey||!d.autoActivate);if(a||(o=this.getActiveNode()||this.getFirstChild())&&(o.setFocus(),(a=t.node=this.focusNode).debug("Keydown force focus on active node")),d.quicksearch&&g&&!v.is(":input:enabled"))return 500<(r=Date.now())-l.lastQuicksearchTime&&(l.lastQuicksearchTerm=""),l.lastQuicksearchTime=r,l.lastQuicksearchTerm+=f,(i=l.findNextNode(l.lastQuicksearchTerm,l.getActiveNode()))&&i.setActive(),void s.preventDefault();switch(n.eventToString(s)){case"+":case"=":l.nodeSetExpanded(t,!0);break;case"-":l.nodeSetExpanded(t,!1);break;case"space":a.isPagingNode()?l._triggerNodeEvent("clickPaging",t,s):n.evalOption("checkbox",a,a,d,!1)?l.nodeToggleSelected(t):l.nodeSetActive(t,!0);break;case"return":l.nodeSetActive(t,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":a.navigate(s.which,m);break;default:y=!1}y&&s.preventDefault()},nodeLoadChildren:function(t,i){var n,r,o,s,l=t.tree,d=t.node,c=Date.now();return e.isFunction(i)&&(i=i.call(l,{type:"source"},t),x(!e.isFunction(i),"source callback must not return another function")),i.url&&(d._requestId&&d.warn("Recursive load request #"+c+" while #"+d._requestId+" is pending."),n=e.extend({},t.options.ajax,i),d._requestId=c,o=n.debugDelay?(r=n.debugDelay,delete n.debugDelay,e.isArray(r)&&(r=r[0]+Math.random()*(r[1]-r[0])),d.warn("nodeLoadChildren waiting debugDelay "+Math.round(r)+" ms ..."),e.Deferred(function(t){setTimeout(function(){e.ajax(n).done(function(){t.resolveWith(this,arguments)}).fail(function(){t.rejectWith(this,arguments)})},r)})):e.ajax(n),i=new e.Deferred,o.done(function(n,r,o){var s,h;if("json"!==this.dataType&&"jsonp"!==this.dataType||"string"!=typeof n||e.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),d._requestId&&d._requestId>c)i.rejectWith(this,[a]);else{if(t.options.postProcess){try{h=l._triggerNodeEvent("postProcess",t,t.originalEvent,{response:n,error:null,dataType:this.dataType})}catch(n){h={error:n,message:""+n,details:"postProcess failed"}}if(h.error)return s=e.isPlainObject(h.error)?h.error:{message:h.error},s=l._makeHookContext(d,null,s),void i.rejectWith(this,[s]);(e.isArray(h)||e.isPlainObject(h)&&e.isArray(h.children))&&(n=h)}else n&&n.hasOwnProperty("d")&&t.options.enableAspx&&(n="string"==typeof n.d?e.parseJSON(n.d):n.d);i.resolveWith(this,[n])}}).fail(function(e,t,n){var r=l._makeHookContext(d,null,{error:e,args:Array.prototype.slice.call(arguments),message:n,details:e.status+": "+n});i.rejectWith(this,[r])})),e.isFunction(i.then)&&e.isFunction(i.catch)&&(o=i,i=new e.Deferred,o.then(function(e){i.resolve(e)},function(e){i.reject(e)})),e.isFunction(i.promise)?(l.nodeSetStatus(t,"loading"),i.done(function(e){l.nodeSetStatus(t,"ok"),d._requestId=null}).fail(function(e){var i;e!==a?(e.node&&e.error&&e.message?i=e:"[object Object]"===(i=l._makeHookContext(d,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""})).message&&(i.message=""),d.warn("Load children failed ("+i.message+")",i),!1!==l._triggerNodeEvent("loadError",i,null)&&l.nodeSetStatus(t,"error",i.message,i.details)):d.warn("Ignored response for obsolete load request #"+c+" (expected #"+d._requestId+")")})):t.options.postProcess&&(s=l._triggerNodeEvent("postProcess",t,t.originalEvent,{response:i,error:null,dataType:typeof i}),(e.isArray(s)||e.isPlainObject(s)&&e.isArray(s.children))&&(i=s)),e.when(i).done(function(i){var n,r;e.isPlainObject(i)&&(x(d.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),x(e.isArray(i.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),i=(n=i).children,delete n.children,e.each(g,function(e,t){void 0!==n[t]&&(l[t]=n[t],delete n[t])}),e.extend(l.data,n)),x(e.isArray(i),"expected array of children"),d._setChildren(i),l.options.nodata&&0===i.length&&(e.isFunction(l.options.nodata)?r=l.options.nodata.call(l,{type:"nodata"},t):!0===l.options.nodata&&d.isRootNode()?r=l.options.strings.nodata:"string"==typeof l.options.nodata&&d.isRootNode()&&(r=l.options.nodata),r&&d.setStatus("nodata",r)),l._triggerNodeEvent("loadChildren",d)})},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(t,i){var n,r=t.node,o=e.extend({},t,{node:i}),s=r.children;if(1===s.length)return x(i===s[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),x(0<=(n=e.inArray(i,s)),"invalid child"),r.triggerModifyChild("remove",i),i.visit(function(e){e.parent=null},!0),this._callHook("treeRegisterNode",this,!1,i),s.splice(n,1)},nodeRemoveChildMarkup:function(t){var i=t.node;i.ul&&(i.isRootNode()?e(i.ul).empty():(e(i.ul).remove(),i.ul=null),i.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,r,o){var s,a,l,d,c,h,u,f=t.node,p=t.tree,g=t.options,v=g.aria,y=!1,m=f.parent,b=!m,_=f.children,w=null;if(!1!==p._enableUpdate&&(b||m.ul)){if(x(b||m.ul,"parent UL must exist"),b||(f.li&&(i||f.li.parentNode!==f.parent.ul)&&(f.li.parentNode===f.parent.ul?w=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)),_){if(b||f.expanded||!0===n){for(f.ul||(f.ul=document.createElement("ul"),(!0!==r||o)&&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=_.length;d<c;d++)u=e.extend({},t,{node:_[d]}),this.nodeRender(u,i,n,!1,!0);for(s=f.ul.firstChild;s;)s=(l=s.ftnode)&&l.parent!==f?(f.debug("_fixParent: remove missing "+l,s),h=s.nextSibling,s.parentNode.removeChild(s),h):s.nextSibling;for(s=f.ul.firstChild,d=0,c=_.length-1;d<c;d++)(a=_[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,w)}},nodeRenderTitle:function(t,i){var o,s,a,l,d,c,h,u=t.node,f=t.tree,p=t.options,g=p.aria,v=u.getLevel(),y=[];void 0!==i&&(u.title=i),u.span&&!1!==f._enableUpdate&&(d=g&&!1!==u.hasChildren()?" role='button'":"",v<p.minExpandLevel?(u.lazy||(u.expanded=!0),1<v&&y.push("<span "+d+" class='fancytree-expander fancytree-expander-fixed'></span>")):y.push("<span "+d+" class='fancytree-expander'></span>"),(o=n.evalOption("checkbox",u,u,p,!1))&&!u.isStatusNode()&&(d=g?" role='checkbox'":"",s="fancytree-checkbox",("radio"===o||u.parent&&u.parent.radiogroup)&&(s+=" fancytree-radio"),y.push("<span "+d+" class='"+s+"'></span>")),void 0!==u.data.iconClass&&(u.icon?e.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(u.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),u.icon=u.data.iconClass)),!1!==(a=n.evalOption("icon",u,u,p,!0))&&(d=g?" role='presentation'":"",h=(h=n.evalOption("iconTooltip",u,u,p,null))?" title='"+F(h)+"'":"","string"==typeof a?r.test(a)?(a="/"===a.charAt(0)?a:(p.imagePath||"")+a,y.push("<img src='"+a+"' class='fancytree-icon'"+h+" alt='' />")):y.push("<span "+d+" class='fancytree-custom-icon "+a+"'"+h+"></span>"):a.text?y.push("<span "+d+" class='fancytree-custom-icon "+(a.addClass||"")+"'"+h+">"+n.escapeHtml(a.text)+"</span>"):a.html?y.push("<span "+d+" class='fancytree-custom-icon "+(a.addClass||"")+"'"+h+">"+a.html+"</span>"):y.push("<span "+d+" class='fancytree-icon'"+h+"></span>")),l="",p.renderTitle&&(l=p.renderTitle.call(f,{type:"renderTitle"},t)||""),l||(!0===(c=n.evalOption("tooltip",u,u,p,null))&&(c=u.title),l="<span class='fancytree-title'"+(c=c?" title='"+F(c)+"'":"")+(p.titlesTabbable?" tabindex='0'":"")+">"+(p.escapeTitles?n.escapeHtml(u.title):u.title)+"</span>"),y.push(l),u.span.innerHTML=y.join(""),this.nodeRenderStatus(t),p.enhanceTitle&&(t.$title=e(">span.fancytree-title",u.span),l=p.enhanceTitle.call(f,{type:"enhanceTitle"},t)||""))},nodeRenderStatus:function(t){var i,r=t.node,o=t.tree,s=t.options,a=r.hasChildren(),l=r.isLastSibling(),d=s.aria,c=s._classNames,h=[],u=r[o.statusClassPropName];u&&!1!==o._enableUpdate&&(d&&(i=e(r.tr||r.li)),h.push(c.node),o.activeNode===r&&h.push(c.active),o.focusNode===r&&h.push(c.focused),r.expanded&&h.push(c.expanded),d&&(!1===a?i.removeAttr("aria-expanded"):i.attr("aria-expanded",Boolean(r.expanded))),r.folder&&h.push(c.folder),!1!==a&&h.push(c.hasChildren),l&&h.push(c.lastsib),r.lazy&&null==r.children&&h.push(c.lazy),r.partload&&h.push(c.partload),r.partsel&&h.push(c.partsel),n.evalOption("unselectable",r,r,s,!1)&&h.push(c.unselectable),r._isLoading&&h.push(c.loading),r._error&&h.push(c.error),r.statusNodeType&&h.push(c.statusNodePrefix+r.statusNodeType),r.selected?(h.push(c.selected),d&&i.attr("aria-selected",!0)):d&&i.attr("aria-selected",!1),r.extraClasses&&h.push(r.extraClasses),!1===a?h.push(c.combinedExpanderPrefix+"n"+(l?"l":"")):h.push(c.combinedExpanderPrefix+(r.expanded?"e":"c")+(r.lazy&&null==r.children?"d":"")+(l?"l":"")),h.push(c.combinedIconPrefix+(r.expanded?"e":"c")+(r.folder?"f":"")),u.className=h.join(" "),r.li&&e(r.li).toggleClass(c.lastsib,l))},nodeSetActive:function(t,i,n){n=n||{};var r,o=t.node,s=t.tree,a=t.options,l=!0===n.noEvents,d=!0===n.noFocus,c=!1!==n.scrollIntoView;return o===s.activeNode==(i=!1!==i)?N(o):i&&!l&&!1===this._triggerNodeEvent("beforeActivate",o,t.originalEvent)?S(o,["rejected"]):(i?(s.activeNode&&(x(s.activeNode!==o,"node was active (inconsistency)"),r=e.extend({},t,{node:s.activeNode}),s.nodeSetActive(r,!1),x(null===s.activeNode,"deactivate was out of sync?")),a.activeVisible&&o.makeVisible({scrollIntoView:c}),s.activeNode=o,s.nodeRenderStatus(t),d||s.nodeSetFocus(t),l||s._triggerNodeEvent("activate",o,t.originalEvent)):(x(s.activeNode===o,"node was not active (inconsistency)"),s.activeNode=null,this.nodeRenderStatus(t),l||t.tree._triggerNodeEvent("deactivate",o,t.originalEvent)),N(o))},nodeSetExpanded:function(t,i,n){n=n||{};var r,o,s,a,l,d,c=t.node,h=t.tree,u=t.options,f=!0===n.noAnimation,p=!0===n.noEvents;if(i=!1!==i,c.expanded&&i||!c.expanded&&!i)return N(c);if(i&&!c.lazy&&!c.hasChildren())return N(c);if(!i&&c.getLevel()<u.minExpandLevel)return S(c,["locked"]);if(!p&&!1===this._triggerNodeEvent("beforeExpand",c,t.originalEvent))return S(c,["rejected"]);if(f||c.isVisible()||(f=n.noAnimation=!0),o=new e.Deferred,i&&!c.expanded&&u.autoCollapse){l=c.getParentList(!1,!0),d=u.autoCollapse;try{for(u.autoCollapse=!1,s=0,a=l.length;s<a;s++)this._callHook("nodeCollapseSiblings",l[s],n)}finally{u.autoCollapse=d}}return o.done(function(){var e=c.getLastChild();i&&u.autoScroll&&!f&&e?e.scrollIntoView(!0,{topNode:c}).always(function(){p||t.tree._triggerNodeEvent(i?"expand":"collapse",t)}):p||t.tree._triggerNodeEvent(i?"expand":"collapse",t)}),r=function(n){var r=u._classNames,o=u.toggleEffect;if(c.expanded=i,h._callHook("treeStructureChanged",t,i?"expand":"collapse"),h._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(o&&!f)return e(c.li).addClass(r.animating),void(e.isFunction(e(c.ul)[o.effect])?(h.debug("use jquery."+o.effect+" method"),e(c.ul)[o.effect]({duration:o.duration,always:function(){e(this).removeClass(r.animating),e(c.li).removeClass(r.animating),n()}})):(e(c.ul).stop(!0,!0),e(c.ul).parent().find(".ui-effects-placeholder").remove(),e(c.ul).toggle(o.effect,o.options,o.duration,function(){e(this).removeClass(r.animating),e(c.li).removeClass(r.animating),n()})));c.ul.style.display=c.expanded||!parent?"":"none"}n()},i&&c.lazy&&void 0===c.hasChildren()?c.load().done(function(){o.notifyWith&&o.notifyWith(c,["loaded"]),r(function(){o.resolveWith(c)})}).fail(function(e){r(function(){o.rejectWith(c,["load failed ("+e+")"])})}):r(function(){o.resolveWith(c)}),o.promise()},nodeSetFocus:function(t,i){var n,r=t.tree,o=t.node,s=r.options,a=!!t.originalEvent&&e(t.originalEvent.target).is(":input");if(i=!1!==i,r.focusNode){if(r.focusNode===o&&i)return;n=e.extend({},t,{node:r.focusNode}),r.focusNode=null,this._triggerNodeEvent("blur",n),this._callHook("nodeRenderStatus",n)}i&&(this.hasFocus()||(o.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",t,!0,{calledByNode:!0})),o.makeVisible({scrollIntoView:!1}),r.focusNode=o,s.titlesTabbable&&(a||e(o.span).find(".fancytree-title").focus()),s.aria&&e(r.$container).attr("aria-activedescendant",e(o.tr||o.li).uniqueId().attr("id")),this._triggerNodeEvent("focus",t),document.activeElement===r.$container.get(0)||1<=e(document.activeElement,r.$container).length||e(r.$container).focus(),s.autoScroll&&o.scrollIntoView(),this._callHook("nodeRenderStatus",t))},nodeSetSelected:function(e,t,i){i=i||{};var r=e.node,o=e.tree,s=e.options,a=!0===i.noEvents,l=r.parent;if(t=!1!==t,!n.evalOption("unselectable",r,r,s,!1)){if(r._lastSelectIntent=t,!!r.selected===t&&(3!==s.selectMode||!r.partsel||t))return t;if(!a&&!1===this._triggerNodeEvent("beforeSelect",r,e.originalEvent))return!!r.selected;t&&1===s.selectMode?(o.lastSelectedNode&&o.lastSelectedNode.setSelected(!1),r.selected=t):3!==s.selectMode||!l||l.radiogroup||r.radiogroup?l&&l.radiogroup?r.visitSiblings(function(e){e._changeSelectStatusAttrs(t&&e===r)},!0):r.selected=t:(r.selected=t,r.fixSelection3AfterClick(i)),this.nodeRenderStatus(e),o.lastSelectedNode=t?r:null,a||o._triggerNodeEvent("select",e)}},nodeSetStatus:function(t,i,n,r){var o=t.node,s=t.tree;function a(i,n){var r=o.children?o.children[0]:null;return r&&r.isStatusNode()?(e.extend(r,i),r.statusNodeType=n,s._callHook("nodeRenderTitle",r)):(o._setChildren([i]),s._callHook("treeStructureChanged",t,"setStatusNode"),o.children[0].statusNodeType=n,s.render()),o.children[0]}switch(i){case"ok":!function(){var e=o.children?o.children[0]:null;if(e&&e.isStatusNode()){try{o.ul&&(o.ul.removeChild(e.li),e.li=null)}catch(e){}1===o.children.length?o.children=[]:o.children.shift(),s._callHook("treeStructureChanged",t,"clearStatusNode")}}(),o._isLoading=!1,o._error=null,o.renderStatus();break;case"loading":o.parent||a({title:s.options.strings.loading+(n?" ("+n+")":""),checkbox:!1,tooltip:r},i),o._isLoading=!0,o._error=null,o.renderStatus();break;case"error":a({title:s.options.strings.loadError+(n?" ("+n+")":""),checkbox:!1,tooltip:r},i),o._isLoading=!1,o._error={message:n,details:r},o.renderStatus();break;case"nodata":a({title:n||s.options.strings.noData,checkbox:!1,tooltip:r},i),o._isLoading=!1,o._error=null,o.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&&(i=!1,t.selected=!0),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,i){var n,r,o,s=t.tree,a=t.widget.element,l=e.extend({},t,{node:this.rootNode});if(s.rootNode.children&&this.treeClear(t),i=i||this.options.source)"string"==typeof i&&e.error("Not implemented");else switch(r=a.data("type")||"html"){case"html":(o=a.find(">ul").first()).addClass("ui-fancytree-source fancytree-helper-hidden"),i=e.ui.fancytree.parseHtml(o),this.data=e.extend(this.data,T(o));break;case"json":i=e.parseJSON(a.text()),a.contents().filter(function(){return 3===this.nodeType}).remove(),e.isPlainObject(i)&&(x(e.isArray(i.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),i=(n=i).children,delete n.children,e.each(g,function(e,t){void 0!==n[t]&&(s[t]=n[t],delete n[t])}),e.extend(s.data,n));break;default:e.error("Invalid data-type: "+r)}return this.nodeLoadChildren(l,i).done(function(){s._callHook("treeStructureChanged",t,"loadChildren"),s.render(),3===t.options.selectMode&&s.rootNode.fixSelection3FromEndNodes(),s.activeNode&&s.options.activeVisible&&s.activeNode.makeVisible(),s._triggerTreeEvent("init",null,{status:!0})}).fail(function(){s.render(),s._triggerTreeEvent("init",null,{status:!1})})},treeRegisterNode:function(e,t,i){e.tree._callHook("treeStructureChanged",e,t?"addNode":"removeNode")},treeSetFocus:function(t,i,n){var r;(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&&(r=this._lastMousedownNode||this.getFirstChild())&&r.setFocus())},treeSetOption:function(t,i,n){var r=t.tree,o=!0,s=!1,a=!1;switch(i){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":a=s=!0;break;case"checkboxAutoHide":r.$container.toggleClass("fancytree-checkbox-auto-hide",!!n);break;case"escapeTitles":case"tooltip":a=!0;break;case"rtl":!1===n?r.$container.removeAttr("DIR").removeClass("fancytree-rtl"):r.$container.attr("DIR","RTL").addClass("fancytree-rtl"),a=!0;break;case"source":o=!1,r._callHook("treeLoad",r,n),a=!0}r.debug("set option "+i+"="+n+" <"+typeof n+">"),o&&(this.widget._super?this.widget._super.call(this.widget,i,n):e.Widget.prototype._setOption.call(this.widget,i,n)),s&&r._callHook("treeCreate",r),a&&r.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,debugLevel:null,disabled:!1,enableAspx:!0,escapeTitles:!1,extensions:[],toggleEffect:{effect:"slideToggle",duration:200},generateIds:!1,icon:!0,idPrefix:"ft_",focusOnSelect:!1,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,tooltip:!1,treeId:null,_classNames:{node:"fancytree-node",folder:"fancytree-folder",animating:"fancytree-animating",combinedExpanderPrefix:"fancytree-exp-",combinedIconPrefix:"fancytree-ico-",hasChildren:"fancytree-has-children",active:"fancytree-active",selected:"fancytree-selected",expanded:"fancytree-expanded",lazy:"fancytree-lazy",focused:"fancytree-focused",partload:"fancytree-partload",partsel:"fancytree-partsel",radio:"fancytree-radio",unselectable:"fancytree-unselectable",lastsib:"fancytree-lastsib",loading:"fancytree-loading",error:"fancytree-error",statusNodePrefix:"fancytree-statusnode-"},lazyLoad:null,postProcess:null},_create:function(){this.tree=new L(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul").first();var t,i,n,r=this.options,o=r.extensions;for(this.tree,n=0;n<o.length;n++)i=o[n],(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]=w({},t.options,this.tree.options[i]),x(void 0===this.tree.ext[i],"Extension name must not exist as Fancytree.ext attribute: '"+i+"'"),this.tree.ext[i]={},C(this.tree,0,t,i);void 0!==r.icons&&(!0===r.icon?(this.tree.warn("'icons' tree option is deprecated since v2.14.0: use 'icon' instead"),r.icon=r.icons):e.error("'icons' tree option is deprecated since v2.14.0: use 'icon' only instead")),void 0!==r.iconClass&&(r.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"),r.icon=r.iconClass)),void 0!==r.tabbable&&(r.tabindex=r.tabbable?"0":"-1",this.tree.warn("'tabbable' tree option is deprecated since v2.17.0: use 'tabindex='"+r.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),e.Widget.prototype.destroy.call(this)},_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,i=this.options,r=this.tree,o=r._ns;this._unbind(),r.$container.on("focusin"+o+" focusout"+o,function(t){var i=n.getNode(t),o="focusin"===t.type;if(!o&&i&&e(t.target).is("a"))i.debug("Ignored focusout on embedded <a> element.");else{if(o){if(r._getExpiringValue("focusin"))return void r.debug("Ignored double focusin.");r._setExpiringValue("focusin",!0,50),i||(i=r._getExpiringValue("mouseDownNode"))&&r.debug("Reconstruct mouse target for focusin from recent event.")}i?r._callHook("nodeSetFocus",r._makeHookContext(i,t),o):r.tbody&&e(t.target).parents("table.fancytree-container > thead").length?r.debug("Ignore focus event outside table body.",t):r._callHook("treeSetFocus",r,o)}}).on("selectstart"+o,"span.fancytree-title",function(e){e.preventDefault()}).on("keydown"+o,function(e){if(i.disabled||!1===i.keyboard)return!0;var t,n=r.focusNode,o=r._makeHookContext(n||r,e),s=r.phase;try{return r.phase="userEvent","preventNav"===(t=n?r._triggerNodeEvent("keydown",n,e):r._triggerTreeEvent("keydown",e))?t=!0:!1!==t&&(t=r._callHook("nodeKeydown",o)),t}finally{r.phase=s}}).on("mousedown"+o,function(e){var t=n.getEventTarget(e);r._lastMousedownNode=t?t.node:null,r._setExpiringValue("mouseDownNode",r._lastMousedownNode)}).on("click"+o+" dblclick"+o,function(e){if(i.disabled)return!0;var r,o=n.getEventTarget(e),s=o.node,a=t.tree,l=a.phase;if(!s)return!0;r=a._makeHookContext(s,e);try{switch(a.phase="userEvent",e.type){case"click":return r.targetType=o.type,s.isPagingNode()?!0===a._triggerNodeEvent("clickPaging",r,e):!1!==a._triggerNodeEvent("click",r,e)&&a._callHook("nodeClick",r);case"dblclick":return r.targetType=o.type,!1!==a._triggerNodeEvent("dblclick",r,e)&&a._callHook("nodeDblclick",r)}}finally{a.phase=l}})},getActiveNode:function(){return this.tree.activeNode},getNodeByKey:function(e){return this.tree.getNodeByKey(e)},getRootNode:function(){return this.tree.rootNode},getTree:function(){return this.tree}}),n=e.ui.fancytree,e.extend(e.ui.fancytree,{version:"2.31.0",buildType:"production",debugLevel:3,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:L,_FancytreeNodeClass:A,jquerySupports:{positionMyOfs:function(t,i,n,r){var o,s,a,l=e.map(e.trim(t).split("."),function(e){return parseInt(e,10)}),d=e.map(Array.prototype.slice.call(arguments,1),function(e){return parseInt(e,10)});for(o=0;o<d.length;o++)if((s=l[o]||0)!==(a=d[o]||0))return a<s;return!0}(e.ui.version,1,9)},assert:function(e,t){return x(e,t)},createTree:function(t,i){return e(t).fancytree(i).fancytree("getTree")},debounce:function(e,t,i,n){var r;return 3===arguments.length&&"boolean"!=typeof i&&(n=i,i=!1),function(){var o=arguments;n=n||this,i&&!r&&t.apply(n,o),clearTimeout(r),r=setTimeout(function(){i||t.apply(n,o),r=null},e)}},debug:function(t){4<=e.ui.fancytree.debugLevel&&_("log",arguments)},error:function(t){1<=e.ui.fancytree.debugLevel&&_("error",arguments)},escapeHtml:function(e){return(""+e).replace(o,function(e){return l[e]})},fixPositionOptions:function(t){if((t.offset||0<=(""+t.my+t.at).indexOf("%"))&&e.error("expected new position syntax (but '%' is not supported)"),!e.ui.fancytree.jquerySupports.positionMyOfs){var i=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.my),n=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(t.at),r=(i[2]?+i[2]:0)+(n[2]?+n[2]:0),o=(i[4]?+i[4]:0)+(n[4]?+n[4]:0);t=e.extend({},t,{my:i[1]+" "+i[3],at:n[1]+" "+n[3]}),(r||o)&&(t.offset=r+" "+o)}return t},getEventTarget:function(t){var i,r=t&&t.target?t.target.className:"",o={node:this.getNode(t.target),type:void 0};return/\bfancytree-title\b/.test(r)?o.type="title":/\bfancytree-expander\b/.test(r)?o.type=!1===o.node.hasChildren()?"prefix":"expander":/\bfancytree-checkbox\b/.test(r)?o.type="checkbox":/\bfancytree(-custom)?-icon\b/.test(r)?o.type="icon":/\bfancytree-node\b/.test(r)?o.type="title":t&&t.target&&((i=e(t.target)).is("ul[role=group]")?((o.node&&o.node.tree||n).debug("Ignoring click on outer UL."),o.node=null):i.closest(".fancytree-title").length?o.type="title":i.closest(".fancytree-checkbox").length?o.type="checkbox":i.closest(".fancytree-expander").length&&(o.type="expander")),o},getEventTargetType:function(e){return this.getEventTarget(e).type},getNode:function(t){if(t instanceof A)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,n=t;return t instanceof L?t:(void 0===t&&(t=0),"number"==typeof t?t=e(".fancytree-container").eq(t):"string"==typeof t?(t=e("#ft-id-"+n).eq(0)).length||(t=e(n).eq(0)):t instanceof e?t=t.eq(0):void 0!==t.originalEvent&&(t=e(t.target)),(i=(t=t.closest(":ui-fancytree")).data("ui-fancytree")||t.data("fancytree"))?i.tree:null)},evalOption:function(t,i,n,r,o){var s,a,l=i.tree,d=r[t],c=n[t];return e.isFunction(d)?(s={node:i,tree:l,widget:l.widget,options:l.widget.options,typeInfo:l.types[i.type]||{}},null==(a=d.call(l,{type:t},s))&&(a=c)):a=null==c?d:c,null==a&&(a=o),a},setSpanIcon:function(t,i,n){var r=e(t);"string"==typeof n?r.attr("class",i+" "+n):(n.text?r.text(""+n.text):n.html&&(t.innerHTML=n.html),r.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(u[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&&_("info",arguments)},keyEventToString:function(e){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(e)},overrideMethod:function(t,i,n,r){var o,s=t[i]||e.noop;t[i]=function(){var e=r||this;try{return o=e._super,e._super=s,n.apply(e,arguments)}finally{e._super=o}}},parseHtml:function(t){var i,n,r,o,s,a,l,d,c=[];return t.find(">li").each(function(){var h,u,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=e.trim(x.title),o=0,a=f.length;o<a;o++)x[f[o]]=void 0;for(i=this.className.split(" "),r=[],o=0,a=i.length;o<a;o++)n=i[o],p[n]?x[n]=!0:r.push(n);if(x.extraClasses=r.join(" "),(l=g.attr("title"))&&(x.tooltip=l),(l=g.attr("id"))&&(x.key=l),g.attr("hideCheckbox")&&(x.checkbox=!1),(h=T(g))&&!e.isEmptyObject(h)){for(u in m)h.hasOwnProperty(u)&&(h[m[u]]=h[u],delete h[u]);for(o=0,a=v.length;o<a;o++)l=v[o],null!=(d=h[l])&&(delete h[l],x[l]=d);e.extend(x.data,h)}(t=g.find(">ul").first()).length?x.children=e.ui.fancytree.parseHtml(t):x.children=x.lazy?void 0:null,c.push(x)}),c},registerExtension:function(t){x(null!=t.name,"extensions must have a `name` property."),x(null!=t.version,"extensions must have a `version` property."),e.ui.fancytree._extensions[t.name]=t},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&&_("warn",arguments)}}),e.ui.fancytree}function x(t,i){t||(i=i?": "+i:"",e.error("Fancytree assertion failed"+i))}function _(e,t){var i,n,r=window.console?window.console[e]:null;if(r)try{r.apply(window.console,t)}catch(e){for(n="",i=0;i<t.length;i++)n+=t[i];r(n)}}function w(){var t,i,n,r,o,s=arguments[0]||{},a=1,l=arguments.length;if("object"==typeof s||e.isFunction(s)||(s={}),a===l)throw Error("need at least two args");for(;a<l;a++)if(null!=(t=arguments[a]))for(i in t)if(t.hasOwnProperty(i)){if(n=s[i],s===(r=t[i]))continue;r&&e.isPlainObject(r)?(o=n&&e.isPlainObject(n)?n:{},s[i]=w(o,r)):void 0!==r&&(s[i]=r)}return s}function k(e,t,i,n,r){var o,s,a,l,d;return o=t[e],s=n[e],a=t.ext[r],l=function(){return o.apply(t,arguments)},d=function(e){return o.apply(t,e)},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 C(t,i,n,r){for(var o in n)"function"==typeof n[o]?"function"==typeof t[o]?t[o]=k(o,t,0,n,r):"_"===o.charAt(0)?t.ext[r][o]=k(o,t,0,n,r):e.error("Could not override tree."+o+". Use prefix '_' to create tree."+r+"._"+o):"options"!==o&&(t.ext[r][o]=n[o])}function N(t,i){return void 0===t?e.Deferred(function(){this.resolve()}).promise():e.Deferred(function(){this.resolveWith(t,i)}).promise()}function S(t,i){return void 0===t?e.Deferred(function(){this.reject()}).promise():e.Deferred(function(){this.rejectWith(t,i)}).promise()}function E(e,t){return function(){e.resolveWith(t)}}function T(t){var i=e.extend({},t.data()),n=i.json;return delete i.fancytree,delete i.uiFancytree,n&&(delete i.json,i=e.extend(i,n)),i}function F(e){return(""+e).replace(s,function(e){return l[e]})}function H(e){return e=e.toLowerCase(),function(t){return 0<=t.title.toLowerCase().indexOf(e)}}function A(t,i){var r,o,s,a;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={},r=0,o=v.length;r<o;r++)this[s=v[r]]=i[s];for(s in null==this.unselectableIgnore&&null==this.unselectableStatus||(this.unselectable=!0),i.hideCheckbox&&e.error("'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'"),i.data&&e.extend(this.data,i.data),i)y[s]||e.isFunction(i[s])||b[s]||(this.data[s]=i[s]);null==this.key?this.tree.options.defaultKey?(this.key=this.tree.options.defaultKey(this),x(this.key,"defaultKey() must return a unique key")):this.key="_"+n._nextNodeKey++:this.key=""+this.key,i.active&&(x(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),i.selected&&(this.tree.lastSelectedNode=this),(a=i.children)?a.length?this._setChildren(a):this.children=this.lazy?[]:null:this.children=null,this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function L(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=T(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();var i,r={tree:this};this.rootNode=new A(r,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,i=e("<ul>",{id:"ft-id-"+this._id,class:"ui-fancytree fancytree-container fancytree-plain"}).appendTo(this.$div),this.$container=i,this.rootNode.ul=i[0],null==this.options.debugLevel&&(this.options.debugLevel=n.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=e.ui.fancytree.escapeHtml;function i(e){return(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return e.ui.fancytree._FancytreeClass.prototype._applyFilterImpl=function(n,r,o){var s,a,l,d,c,h,u=0,f=this.options,p=f.escapeTitles,g=f.autoCollapse,v=e.extend({},f.filter,o),y="hide"===v.mode,m=!!v.leavesOnly&&!r;if("string"==typeof n){if(""===n)return this.warn("Fancytree passing an empty string as a filter is handled as clearFilter()."),void this.clearFilter();s=v.fuzzy?n.split("").reduce(function(e,t){return e+"[^"+t+"]*"+t}):i(n),l=new RegExp(".*"+s+".*","i"),d=new RegExp(i(n),"gi"),n=function(i){if(!i.title)return!1;var n,r=p?i.title:(n=i.title).indexOf(">")>=0?e("<div/>").html(n).text():n,o=!!l.test(r);return o&&v.highlight&&(p?(c=r.replace(d,function(e){return"￷"+e+"￸"}),i.titleWithHighlight=t(c).replace(/\uFFF7/g,"<mark>").replace(/\uFFF8/g,"</mark>")):i.titleWithHighlight=r.replace(d,function(e){return"<mark>"+e+"</mark>"})),o}}return this.enableFilter=!0,this.lastFilterArgs=arguments,h=this.enableUpdate(!1),this.$div.addClass("fancytree-ext-filter"),y?this.$div.addClass("fancytree-ext-filter-hide"):this.$div.addClass("fancytree-ext-filter-dimm"),this.$div.toggleClass("fancytree-ext-filter-hide-expanders",!!v.hideExpanders),this.visit(function(e){delete e.match,delete e.titleWithHighlight,e.subMatchCount=0}),(a=this.getRootNode()._findDirectChild("__not_found__"))&&a.remove(),f.autoCollapse=!1,this.visit(function(e){if(!m||null==e.children){var t=n(e),i=!1;if("skip"===t)return e.visit(function(e){e.match=!1},!0),"skip";t||!r&&"branch"!==t||!e.parent.match||(t=!0,i=!0),t&&(u++,e.match=!0,e.visitParents(function(e){e.subMatchCount+=1,!v.autoExpand||i||e.expanded||(e.setExpanded(!0,{noAnimation:!0,noEvents:!0,scrollIntoView:!1}),e._filterAutoExpanded=!0)}))}}),f.autoCollapse=g,0===u&&v.nodata&&y&&(a=v.nodata,e.isFunction(a)&&(a=a()),!0===a?a={}:"string"==typeof a&&(a={title:a}),a=e.extend({statusNodeType:"nodata",key:"__not_found__",title:this.options.strings.noData},a),this.getRootNode().addNode(a).match=!0),this._callHook("treeStructureChanged",this,"applyFilter"),this.enableUpdate(h),u},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.clearFilter=function(){var t,i=this.getRootNode()._findDirectChild("__not_found__"),n=this.options.escapeTitles,r=this.options.enhanceTitle,o=this.enableUpdate(!1);i&&i.remove(),this.visit(function(i){i.match&&i.span&&(t=e(i.span).find(">span.fancytree-title"),n?t.text(i.title):t.html(i.title),r&&r({type:"enhanceTitle"},{node:i,$title:t})),delete i.match,delete i.subMatchCount,delete i.titleWithHighlight,i.$subMatchBadge&&(i.$subMatchBadge.remove(),delete i.$subMatchBadge),i._filterAutoExpanded&&i.expanded&&i.setExpanded(!1,{noAnimation:!0,noEvents:!0,scrollIntoView:!1}),delete i._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(o)},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.31.0",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,r=t.tree,o=t.options.filter,s=e(n.span).find("span.fancytree-title"),a=e(n[r.statusClassPropName]),l=t.options.enhanceTitle,d=t.options.escapeTitles;return i=this._super(t),a.length&&r.enableFilter?(a.toggleClass("fancytree-match",!!n.match).toggleClass("fancytree-submatch",!!n.subMatchCount).toggleClass("fancytree-hide",!(n.match||n.subMatchCount)),!o.counter||!n.subMatchCount||n.isExpanded()&&o.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});

Zerion Mini Shell 1.0