3 lines
107 KiB
JavaScript
3 lines
107 KiB
JavaScript
!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(C){"use strict";if(!C.ui||!C.ui.fancytree){var o,e,g=null,y=new RegExp(/\.|\//),t=/[&<>"'\/]/g,n=/[<>"'\/]/g,c="$recursive_request",r={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},i={16:!0,17:!0,18:!0},f={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:"'"},a={0:"",1:"left",2:"middle",3:"right"},v="active expanded focus folder lazy radiogroup selected unselectable unselectableIgnore".split(" "),m={},u="columns types".split(" "),x="checkbox expanded extraClasses folder icon iconTooltip key lazy radiogroup refKey selected statusNodeType title tooltip type unselectable unselectableIgnore unselectableStatus".split(" "),s={},b={},l={active:!0,children:!0,data:!0,focus:!0};for(o=0;o<v.length;o++)m[v[o]]=!0;for(o=0;o<x.length;o++)e=x[o],s[e]=!0,e!==e.toLowerCase()&&(b[e.toLowerCase()]=e);return k(C.ui,"Fancytree requires jQuery UI (http://jqueryui.com)"),A.prototype={_findDirectChild:function(e){var t,n,r=this.children;if(r)if("string"==typeof e){for(t=0,n=r.length;t<n;t++)if(r[t].key===e)return r[t]}else{if("number"==typeof e)return this.children[e];if(e.parent===this)return e}return null},_setChildren:function(e){k(e&&(!this.children||0===this.children.length),"only init supported"),this.children=[];for(var t=0,n=e.length;t<n;t++)this.children.push(new A(this,e[t]))},addChildren:function(e,t){var n,r,i,o,a=this.getFirstChild(),s=this.getLastChild(),l=[];for(C.isPlainObject(e)&&(e=[e]),this.children||(this.children=[]),n=0,r=e.length;n<r;n++)l.push(new A(this,e[n]));if(o=l[0],null==t?this.children=this.children.concat(l):(t=this._findDirectChild(t),k(0<=(i=C.inArray(t,this.children)),"insertBefore must be an existing child"),this.children.splice.apply(this.children,[i,0].concat(l))),a&&!t){for(n=0,r=l.length;n<r;n++)l[n].render();a!==this.getFirstChild()&&a.renderStatus(),s!==this.getLastChild()&&s.renderStatus()}else(!this.parent||this.parent.ul||this.tr)&&this.render();return 3===this.tree.options.selectMode&&this.fixSelection3FromEndNodes(),this.triggerModifyChild("add",1===l.length?l[0]:null),o},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 n=this.children?this.children[0]:null;return this.addChildren(e,n);case"child":case"over":return this.addChildren(e)}k(!1,"Invalid mode: "+t)},addPagingNode:function(e,t){var n,r;if(t=t||"child",!1!==e)return e=C.extend({title:this.tree.options.strings.moreData,statusNodeType:"paging",icon:!1},e),this.partload=!0,this.addNode(e,t);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(e){if(null===e)return this.remove(),_(this);var t,n,r={children:!0,expanded:!0,parent:!0};for(t in e)n=e[t],r[t]||C.isFunction(n)||(s[t]?this[t]=n:this.data[t]=n);return e.hasOwnProperty("children")&&(this.removeChildren(),e.children&&this._setChildren(e.children)),this.isVisible()&&(this.renderTitle(),this.renderStatus()),e.hasOwnProperty("expanded")?this.setExpanded(e.expanded):_(this)},collapseSiblings:function(){return this.tree._callHook("nodeCollapseSiblings",this)},copyTo:function(e,t,n){return e.addNode(this.toDict(!0,n),t)},countChildren:function(e){var t,n,r,i=this.children;if(!i)return 0;if(r=i.length,!1!==e)for(t=0,n=r;t<n;t++)r+=i[t].countChildren();return r},debug:function(e){2<=this.tree.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),d("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)},findAll:function(t){t=C.isFunction(t)?t:T(t);var n=[];return this.visit(function(e){t(e)&&n.push(e)}),n},findFirst:function(t){t=C.isFunction(t)?t:T(t);var n=null;return this.visit(function(e){if(t(e))return n=e,!1}),n},_changeSelectStatusAttrs:function(e){var t=!1,n=this.tree.options,r=g.evalOption("unselectable",this,this,n,!1),i=g.evalOption("unselectableStatus",this,this,n,void 0);switch(r&&null!=i&&(e=i),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:k(!1,"invalid state: "+e)}return t&&this.renderStatus(),t},fixSelection3AfterClick:function(e){var t=this.isSelected();this.visit(function(e){e._changeSelectStatusAttrs(t)}),this.fixSelection3FromEndNodes(e)},fixSelection3FromEndNodes:function(e){var u=this.tree.options;k(3===u.selectMode,"expected selectMode 3"),function e(t){var n,r,i,o,a,s,l,d,c=t.children;if(c&&c.length){for(l=!(s=!0),n=0,r=c.length;n<r;n++)o=e(i=c[n]),g.evalOption("unselectableIgnore",i,i,u,!1)||(!1!==o&&(l=!0),!0!==o&&(s=!1));a=!!s||!!l&&void 0}else a=null==(d=g.evalOption("unselectableStatus",t,t,u,void 0))?!!t.selected:!!d;return t._changeSelectStatusAttrs(a),a}(this),this.visitParents(function(e){var t,n,r,i,o,a=e.children,s=!0,l=!1;for(t=0,n=a.length;t<n;t++)r=a[t],g.evalOption("unselectableIgnore",r,r,u,!1)||(((i=null==(o=g.evalOption("unselectableStatus",r,r,u,void 0))?!!r.selected:!!o)||r.partsel)&&(l=!0),i||(s=!1));i=!!s||!!l&&void 0,e._changeSelectStatusAttrs(i)})},fromDict:function(e){for(var t in e)s[t]?this[t]=e[t]:"data"===t?C.extend(this.data,e.data):C.isFunction(e[t])||l[t]||(this.data[t]=e[t]);e.children&&(this.removeChildren(),this.addChildren(e.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 C.inArray(this,this.parent.children)},getIndexHier:function(e,n){e=e||".";var r,i=[];return C.each(this.getParentList(!1,!0),function(e,t){r=""+(t.getIndex()+1),n&&(r=("0000000"+r).substr(-n)),i.push(r)}),i.join(e)},getKeyPath:function(e){var t=[],n=this.tree.options.keyPathSeparator;return this.visitParents(function(e){e.parent&&t.unshift(e.key)},!e),n+t.join(n)},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,n=this.parent.children;for(e=0,t=n.length-1;e<t;e++)if(n[e]===this)return n[e+1]}return null},getParent:function(){return this.parent},getParentList:function(e,t){for(var n=[],r=t?this:this.parent;r;)(e||r.parent)&&n.unshift(r),r=r.parent;return n},getPrevSibling:function(){if(this.parent){var e,t,n=this.parent.children;for(e=1,t=n.length;e<t;e++)if(n[e]===this)return n[e-1]}return null},getSelectedNodes:function(t){var n=[];return this.visit(function(e){if(e.selected&&(n.push(e),!0===t))return"skip"}),n},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){1<=this.tree.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),d("info",arguments))},isActive:function(){return this.tree.activeNode===this},isChildOf:function(e){return this.parent&&this.parent===e},isDescendantOf:function(e){if(!e||e.tree!==this.tree)return!1;for(var t=this.parent;t;){if(t===e)return!0;t===t.parent&&C.error("Recursive parent link: "+t),t=t.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,n=this.getParentList(!1,!1);for(e=0,t=n.length;e<t;e++)if(!n[e].expanded)return!1;return!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,n,r=this,i=this.isExpanded();return k(this.isLazy(),"load() requires a lazy node"),e||this.isUndefined()?(this.isLoaded()&&this.resetLazy(),!1===(n=this.tree._triggerNodeEvent("lazyLoad",this))?_(this):(k("boolean"!=typeof n,"lazyLoad event must return source in data.result"),t=this.tree._callHook("nodeLoadChildren",this,n),i?(this.expanded=!0,t.always(function(){r.render()})):t.always(function(){r.renderStatus()}),t)):_(this)},makeVisible:function(e){var t,n=this,r=[],i=new C.Deferred,o=this.getParentList(!1,!1),a=o.length,s=!(e&&!0===e.noAnimation),l=!(e&&!1===e.scrollIntoView);for(t=a-1;0<=t;t--)r.push(o[t].setExpanded(!0,e));return C.when.apply(C,r).done(function(){l?n.scrollIntoView(s).done(function(){i.resolve()}):i.resolve()}),i.promise()},moveTo:function(t,e,n){void 0===e||"over"===e?e="child":"firstChild"===e&&(t.children&&t.children.length?(e="before",t=t.children[0]):e="child");var r,i=this.parent,o="child"===e?t:t.parent;if(this!==t){if(this.parent?o.isDescendantOf(this)&&C.error("Cannot move a node to its own descendant"):C.error("Cannot move system root"),o!==i&&i.triggerModifyChild("remove",this),1===this.parent.children.length){if(this.parent===o)return;this.parent.children=this.parent.lazy?[]:null,this.parent.expanded=!1}else k(0<=(r=C.inArray(this,this.parent.children)),"invalid source parent"),this.parent.children.splice(r,1);if((this.parent=o).hasChildren())switch(e){case"child":o.children.push(this);break;case"before":k(0<=(r=C.inArray(t,o.children)),"invalid target parent"),o.children.splice(r,0,this);break;case"after":k(0<=(r=C.inArray(t,o.children)),"invalid target parent"),o.children.splice(r+1,0,this);break;default:C.error("Invalid mode "+e)}else o.children=[this];n&&t.visit(n,!0),o===i?o.triggerModifyChild("move",this):o.triggerModifyChild("add",this),this.tree!==t.tree&&(this.warn("Cross-tree moveTo is experimantal!"),this.visit(function(e){e.tree=t.tree},!0)),i.isDescendantOf(o)||i.render(),o.isDescendantOf(i)||o===i||o.render()}},navigate:function(t,n){var e,r,i,o=C.ui.keyCode,a=null;function s(e){if(e){try{e.makeVisible({scrollIntoView:!1})}catch(e){}return C(e.span).is(":visible")?!1===n?e.setFocus():e.setActive():(e.debug("Navigate: skipping hidden node"),void e.navigate(t,n))}}switch(t){case o.BACKSPACE:this.parent&&this.parent.parent&&(i=s(this.parent));break;case o.HOME:this.tree.visit(function(e){if(C(e.span).is(":visible"))return i=s(e),!1});break;case o.END:this.tree.visit(function(e){C(e.span).is(":visible")&&(i=e)}),i&&(i=s(i));break;case o.LEFT:this.expanded?(this.setExpanded(!1),i=s(this)):this.parent&&this.parent.parent&&(i=s(this.parent));break;case o.RIGHT:this.expanded||!this.children&&!this.lazy?this.children&&this.children.length&&(i=s(this.children[0])):(this.setExpanded(),i=s(this));break;case o.UP:for(a=this.getPrevSibling();a&&!C(a.span).is(":visible");)a=a.getPrevSibling();for(;a&&a.expanded&&a.children&&a.children.length;)a=a.children[a.children.length-1];!a&&this.parent&&this.parent.parent&&(a=this.parent),i=s(a);break;case o.DOWN:if(this.expanded&&this.children&&this.children.length)a=this.children[0];else for(e=(r=this.getParentList(!1,!0)).length-1;0<=e;e--){for(a=r[e].getNextSibling();a&&!C(a.span).is(":visible");)a=a.getNextSibling();if(a)break}i=s(a);break;default:!1}return i||_()},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(e){var t,n=this.parent,r=C.inArray(this,n.children),i=this;return k(this.isPagingNode(),"replaceWith() currently requires a paging status node"),(t=this.tree._callHook("nodeLoadChildren",this,e)).done(function(e){var t=i.children;for(o=0;o<t.length;o++)t[o].parent=n;n.children.splice.apply(n.children,[r+1,0].concat(t)),i.children=null,i.remove(),n.render()}).fail(function(){i.setExpanded()}),t},resetLazy:function(){this.removeChildren(),this.expanded=!1,this.lazy=!0,this.children=void 0,this.renderStatus()},scheduleAction:function(e,t){this.tree.timer&&clearTimeout(this.tree.timer),this.tree.timer=null;var n=this;switch(e){case"cancel":break;case"expand":this.tree.timer=setTimeout(function(){n.tree.debug("setTimeout: trigger expand"),n.setExpanded(!0)},t);break;case"activate":this.tree.timer=setTimeout(function(){n.tree.debug("setTimeout: trigger activate"),n.setActive(!0)},t);break;default:C.error("Invalid mode "+e)}},scrollIntoView:function(e,t){var n;void 0!==t&&((n=t).tree&&void 0!==n.statusNodeType)&&(this.warn("scrollIntoView() with 'topNode' option is deprecated since 2014-05-08. Use 'options.topNode' instead."),t={topNode:t});var r,i,o,a=C.extend({effects:!0===e?{duration:200,queue:!1}:e,scrollOfs:this.tree.options.scrollOfs,scrollParent:this.tree.options.scrollParent||this.tree.$container,topNode:null},t),s=new C.Deferred,l=this,d=C(this.span).height(),c=C(a.scrollParent),u=a.scrollOfs.top||0,p=a.scrollOfs.bottom||0,h=c.height(),f=c.scrollTop(),g=c,y=c[0]===window,v=a.topNode||null,m=null;return C(this.span).is(":visible")?(y?(i=C(this.span).offset().top,r=v&&v.span?C(v.span).offset().top:0,g=C("html,body")):(k(c[0]!==document&&c[0]!==document.body,"scrollParent should be a simple element or `window`, not document or body."),o=c.offset().top,i=C(this.span).offset().top-o+f,r=v?C(v.span).offset().top-o+f:0,h-=Math.max(0,c.innerHeight()-c[0].clientHeight)),i<f+u?m=i-u:f+h-p<i+d&&(m=i+d-h+p,v&&(k(v.isRootNode()||C(v.span).is(":visible"),"topNode must be visible"),r<m&&(m=r-u))),null!==m?a.effects?(a.effects.complete=function(){s.resolveWith(l)},g.stop(!0).animate({scrollTop:m},a.effects)):(g[0].scrollTop=m,s.resolveWith(this)):s.resolveWith(this),s.promise()):(this.warn("scrollIntoView(): node is invisible."),_())},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,n){return this.tree._callHook("nodeSetStatus",this,e,t,n)},setTitle:function(e){this.title=e,this.renderTitle(),this.triggerModify("rename")},sortChildren:function(e,t){var n,r,i=this.children;if(i){if(e=e||function(e,t){var n=e.title.toLowerCase(),r=t.title.toLowerCase();return n===r?0:r<n?1:-1},i.sort(e),t)for(n=0,r=i.length;n<r;n++)i[n].children&&i[n].sortChildren(e,"$norender$");"$norender$"!==t&&this.render(),this.triggerModifyChild("sort")}},toDict:function(e,t){var n,r,i,o={},a=this;if(C.each(x,function(e,t){(a[t]||!1===a[t])&&(o[t]=a[t])}),C.isEmptyObject(this.data)||(o.data=C.extend({},this.data),C.isEmptyObject(o.data)&&delete o.data),t&&t(o,a),e&&this.hasChildren())for(o.children=[],n=0,r=this.children.length;n<r;n++)(i=this.children[n]).isStatusNode()||o.children.push(i.toDict(!0,t));return o},toggleClass:function(e,t){var n,r,i=e.match(/\S+/g)||[],o=0,a=!1,s=this[this.tree.statusClassPropName],l=" "+(this.extraClasses||"")+" ";for(s&&C(s).toggleClass(e,t);n=i[o++];)if(r=0<=l.indexOf(" "+n+" "),t=void 0===t?!r:!!t)r||(l+=n+" ",a=!0);else for(;-1<l.indexOf(" "+n+" ");)l=l.replace(" "+n+" "," ");return this.extraClasses=C.trim(l),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(e,t,n){var r,i=this.tree.options.modifyChild;i&&(t&&t.parent!==this&&C.error("childNode "+t+" is not a child of "+this),r={node:this,tree:this.tree,operation:e,childNode:t||null},n&&C.extend(r,n),i({type:"modifyChild"},r))},triggerModify:function(e,t){this.parent.triggerModifyChild(e,this,t)},visit:function(e,t){var n,r,i=!0,o=this.children;if(!0===t&&(!1===(i=e(this))||"skip"===i))return i;if(o)for(n=0,r=o.length;n<r&&!1!==(i=o[n].visit(e,!0));n++);return i},visitAndLoad:function(n,e,t){var r,i,o,a=this;return!n||!0!==e||!1!==(i=n(a))&&"skip"!==i?a.children||a.lazy?(r=new C.Deferred,o=[],a.load().done(function(){for(var e=0,t=a.children.length;e<t;e++){if(!1===(i=a.children[e].visitAndLoad(n,!0,!0))){r.reject();break}"skip"!==i&&o.push(i)}C.when.apply(this,o).then(function(){r.resolve()})}),r.promise()):_():t?i:_()},visitParents:function(e,t){if(t&&!1===e(this))return!1;for(var n=this.parent;n;){if(!1===e(n))return!1;n=n.parent}return!0},visitSiblings:function(e,t){var n,r,i,o=this.parent.children;for(n=0,r=o.length;n<r;n++)if(i=o[n],(t||i!==this)&&!1===e(i))return!1;return!0},warn:function(e){Array.prototype.unshift.call(arguments,this.toString()),d("warn",arguments)}},F.prototype={_makeHookContext:function(e,t,n){var r,i;return void 0!==e.node?(t&&e.originalEvent!==t&&C.error("invalid args"),r=e):e.tree?r={node:e,tree:i=e.tree,widget:i.widget,options:i.widget.options,originalEvent:t,typeInfo:i.types[e.type]||{}}:e.widget?r={node:null,tree:e,widget:e.widget,options:e.widget.options,originalEvent:t}:C.error("invalid args"),n&&C.extend(r,n),r},_callHook:function(e,t,n){var r=this._makeHookContext(t),i=this[e],o=Array.prototype.slice.call(arguments,2);return C.isFunction(i)||C.error("_callHook('"+e+"') is not a function"),o.unshift(r),i.apply(this,o)},_setExpiringValue:function(e,t,n){this._tempCache[e]={value:t,expire:Date.now()+(+n||50)}},_getExpiringValue:function(e){var t=this._tempCache[e];return t&&t.expire>Date.now()?t.value:(delete this._tempCache[e],null)},_requireExtension:function(e,t,n,r){n=!!n;var i=this._local.name,o=this.options.extensions,a=C.inArray(e,o)<C.inArray(i,o),s=t&&null==this.ext[e],l=!s&&null!=n&&n!==a;return k(i&&i!==e,"invalid or same name"),!s&&!l||(r||(s||t?(r="'"+i+"' extension requires '"+e+"'",l&&(r+=" to be registered "+(n?"before":"after")+" itself")):r="If used together, `"+e+"` must be registered "+(n?"before":"after")+" `"+i+"`"),C.error(r),!1)},activateKey:function(e){var t=this.getNodeByKey(e);return t?t.setActive():this.activeNode&&this.activeNode.setActive(!1),t},addPagingNode:function(e,t){return this.rootNode.addPagingNode(e,t)},applyPatch:function(e){var t,n,r,i,o,a,s=e.length,l=[];for(n=0;n<s;n++)k(2===(r=e[n]).length,"patchList must be an array of length-2-arrays"),i=r[0],o=r[1],(a=null===i?this.rootNode:this.getNodeByKey(i))?(t=new C.Deferred,l.push(t),a.applyPatch(o).always(S(t,a))):this.warn("could not find node with key '"+i+"'");return C.when.apply(C,l).promise()},clear:function(e){this._callHook("treeClear",this)},count:function(){return this.rootNode.countChildren()},debug:function(e){2<=this.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),d("log",arguments))},enableUpdate:function(e){return e=!1!==e,!!this._enableUpdate==!!e?e:((this._enableUpdate=e)?(this.debug("enableUpdate(true): redraw "),this.render()):this.debug("enableUpdate(false)..."),!e)},error:function(e){Array.prototype.unshift.call(arguments,this.toString()),d("error",arguments)},findAll:function(e){return this.rootNode.findAll(e)},findFirst:function(e){return this.rootNode.findFirst(e)},findNextNode:function(t,n,e){var r;t="string"==typeof t?(r=new RegExp("^"+t,"i"),function(e){return r.test(e.title)}):t,n=n||this.getFirstChild();var i=null,o=n.parent.children,a=null,l=function(e,t,n){var r,i,o=e.children,a=o.length,s=o[t];if(s&&!1===n(s))return!1;if(s&&s.children&&s.expanded&&!1===l(s,0,n))return!1;for(r=t+1;r<a;r++)if(!1===l(e,r,n))return!1;return(i=e.parent)?l(i,i.children.indexOf(e)+1,n):l(e,0,n)};return l(n.parent,o.indexOf(n),function(e){return e!==i&&(i=i||e,C(e.span).is(":visible")?(!t(e)||(a=e)===n)&&void 0:void e.debug("quicksearch: skipping hidden node"))}),a},generateFormElements:function(e,t,n){n=n||{};var r,i="string"==typeof e?e:"ft_"+this._id+"[]",o="string"==typeof t?t:"ft_"+this._id+"_active",a="fancytree_result_"+this._id,s=C("#"+a),l=3===this.options.selectMode&&!1!==n.stopOnParents;function d(e){s.append(C("<input>",{type:"checkbox",name:i,value:e.key,checked:!0}))}s.length?s.empty():s=C("<div>",{id:a}).hide().insertAfter(this.$container),!1!==t&&this.activeNode&&s.append(C("<input>",{type:"radio",name:o,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!==e&&(r=this.getSelectedNodes(l),C.each(r,function(e,t){d(t)}))},getActiveNode:function(){return this.activeNode},getFirstChild:function(){return this.rootNode.getFirstChild()},getFocusNode:function(){return this.focusNode},getNodeByKey:function(t,e){var n,r;return!e&&(n=document.getElementById(this.options.idPrefix+t))?n.ftnode?n.ftnode:null:(e=e||this.rootNode,r=null,e.visit(function(e){if(e.key===t)return r=e,!1},!0),r)},getRootNode:function(){return this.rootNode},getSelectedNodes:function(e){return this.rootNode.getSelectedNodes(e)},hasFocus:function(){return!!this._hasFocus},info:function(e){1<=this.options.debugLevel&&(Array.prototype.unshift.call(arguments,this.toString()),d("info",arguments))},loadKeyPath:function(e,t){var r,n,i,o=this,a=new C.Deferred,s=this.getRootNode(),l=this.options.keyPathSeparator,d=[],c=C.extend({},t);for("function"==typeof t?r=t:t&&t.callback&&(r=t.callback),c.callback=function(e,t,n){r&&r.call(e,t,n),a.notifyWith(e,[{node:t,status:n}])},null==c.matchKey&&(c.matchKey=function(e,t){return e.key===t}),C.isArray(e)||(e=[e]),n=0;n<e.length;n++)(i=e[n]).charAt(0)===l&&(i=i.substr(1)),d.push(i.split(l));return setTimeout(function(){o._loadKeyPathImpl(a,c,s,d).done(function(){a.resolve()})},0),a.promise()},_loadKeyPathImpl:function(e,o,t,n){var r,i,a,s,l,d,c,u,p=this;function h(e,t){var n,r,i=e.children;if(i)for(n=0,r=i.length;n<r;n++)if(o.matchKey(i[n],t))return i[n];return null}for(l={},i=0;i<n.length;i++)for(c=n[i],d=t;c.length;){if(a=c.shift(),!(s=h(d,a))){this.warn("loadKeyPath: key not found: "+a+" (parent: "+d+")"),o.callback(this,a,"error");break}if(0===c.length){o.callback(this,s,"ok");break}if(s.lazy&&void 0===s.hasChildren()){o.callback(this,s,"loaded"),l[a=s.key]?l[a].pathSegList.push(c):l[a]={parent:s,pathSegList:[c]};break}o.callback(this,s,"loaded"),d=s}function f(t,n,e){o.callback(p,n,"loading"),n.load().done(function(){p._loadKeyPathImpl.call(p,t,o,n,e).always(S(t,p))}).fail(function(e){p.warn("loadKeyPath: error loading lazy "+n),o.callback(p,s,"error"),t.rejectWith(p)})}for(var g in r=[],l){var y=l[g];u=new C.Deferred,r.push(u),f(u,y.parent,y.pathSegList)}return C.when.apply(C,r).promise()},reactivate:function(e){var t,n=this.activeNode;return n?(this.activeNode=null,t=n.setActive(!0,{noFocus:!0}),e&&n.setFocus(),t):_()},reload:function(e){return this._callHook("treeClear",this),this._callHook("treeLoad",this,e)},render:function(e,t){return this.rootNode.render(e,t)},setFocus:function(e){return this._callHook("treeSetFocus",this,e)},toDict:function(e,t){var n=this.rootNode.toDict(!0,t);return e?n:n.children},toString:function(){return"Fancytree@"+this._id},_triggerNodeEvent:function(e,t,n,r){var i=this._makeHookContext(t,n,r),o=this.widget._trigger(e,n,i);return!1!==o&&void 0!==i.result?i.result:o},_triggerTreeEvent:function(e,t,n){var r=this._makeHookContext(this,t,n),i=this.widget._trigger(e,t,r);return!1!==i&&void 0!==r.result?r.result:i},visit:function(e){return this.rootNode.visit(e,!1)},warn:function(e){Array.prototype.unshift.call(arguments,this.toString()),d("warn",arguments)}},C.extend(F.prototype,{nodeClick:function(e){var t,n,r=e.targetType,i=e.node;if("expander"===r){if(i.isLoading())return void i.debug("Got 2nd click while loading: ignored");this._callHook("nodeToggleExpanded",e)}else if("checkbox"===r)this._callHook("nodeToggleSelected",e),e.options.focusOnSelect&&this._callHook("nodeSetFocus",e,!0);else{if(t=!(n=!1),i.folder)switch(e.options.clickFolderMode){case 2:t=!(n=!0);break;case 3:n=t=!0}t&&(this.nodeSetFocus(e),this._callHook("nodeSetActive",e,!0)),n&&this._callHook("nodeToggleExpanded",e)}},nodeCollapseSiblings:function(e,t){var n,r,i,o=e.node;if(o.parent)for(r=0,i=(n=o.parent.children).length;r<i;r++)n[r]!==o&&n[r].expanded&&this._callHook("nodeSetExpanded",n[r],!1,t)},nodeDblclick:function(e){"title"===e.targetType&&4===e.options.clickFolderMode&&this._callHook("nodeToggleExpanded",e),"title"===e.targetType&&e.originalEvent.preventDefault()},nodeKeydown:function(e){var t,n,r,i=e.originalEvent,o=e.node,a=e.tree,s=e.options,l=i.which,d=String.fromCharCode(l),c=!(i.altKey||i.ctrlKey||i.metaKey||i.shiftKey),u=C(i.target),p=!0,h=!(i.ctrlKey||!s.autoActivate);if(o||(r=this.getActiveNode()||this.getFirstChild())&&(r.setFocus(),(o=e.node=this.focusNode).debug("Keydown force focus on active node")),s.quicksearch&&c&&/\w/.test(d)&&!f[l]&&!u.is(":input:enabled"))return 500<(n=(new Date).getTime())-a.lastQuicksearchTime&&(a.lastQuicksearchTerm=""),a.lastQuicksearchTime=n,a.lastQuicksearchTerm+=d,(t=a.findNextNode(a.lastQuicksearchTerm,a.getActiveNode()))&&t.setActive(),void i.preventDefault();switch(g.eventToString(i)){case"+":case"=":a.nodeSetExpanded(e,!0);break;case"-":a.nodeSetExpanded(e,!1);break;case"space":o.isPagingNode()?a._triggerNodeEvent("clickPaging",e,i):g.evalOption("checkbox",o,o,s,!1)?a.nodeToggleSelected(e):a.nodeSetActive(e,!0);break;case"return":a.nodeSetActive(e,!0);break;case"home":case"end":case"backspace":case"left":case"right":case"up":case"down":o.navigate(i.which,h,!0);break;default:p=!1}p&&i.preventDefault()},nodeLoadChildren:function(o,a){var t,n,e,s=o.tree,l=o.node,d=(new Date).getTime();if(C.isFunction(a)&&(a=a.call(s,{type:"source"},o),k(!C.isFunction(a),"source callback must not return another function")),a.url&&(l._requestId&&l.warn("Recursive load request #"+d+" while #"+l._requestId+" is pending."),t=C.extend({},o.options.ajax,a),l._requestId=d,e=t.debugDelay?(n=t.debugDelay,C.isArray(n)&&(n=n[0]+Math.random()*(n[1]-n[0])),l.warn("nodeLoadChildren waiting debugDelay "+Math.round(n)+" ms ..."),t.debugDelay=!1,C.Deferred(function(e){setTimeout(function(){C.ajax(t).done(function(){e.resolveWith(this,arguments)}).fail(function(){e.rejectWith(this,arguments)})},n)})):C.ajax(t),a=new C.Deferred,e.done(function(e,t,n){var r,i;if("json"!==this.dataType&&"jsonp"!==this.dataType||"string"!=typeof e||C.error("Ajax request returned a string (did you get the JSON dataType wrong?)."),l._requestId&&l._requestId>d)a.rejectWith(this,[c]);else{if(o.options.postProcess){try{i=s._triggerNodeEvent("postProcess",o,o.originalEvent,{response:e,error:null,dataType:this.dataType})}catch(e){i={error:e,message:""+e,details:"postProcess failed"}}if(i.error)return r=C.isPlainObject(i.error)?i.error:{message:i.error},r=s._makeHookContext(l,null,r),void a.rejectWith(this,[r]);e=C.isArray(i)?i:e}else e&&e.hasOwnProperty("d")&&o.options.enableAspx&&(e="string"==typeof e.d?C.parseJSON(e.d):e.d);a.resolveWith(this,[e])}}).fail(function(e,t,n){var r=s._makeHookContext(l,null,{error:e,args:Array.prototype.slice.call(arguments),message:n,details:e.status+": "+n});a.rejectWith(this,[r])})),C.isFunction(a.then)&&C.isFunction(a.catch)&&(e=a,a=new C.Deferred,e.then(function(e){a.resolve(e)},function(e){a.reject(e)})),C.isFunction(a.promise))s.nodeSetStatus(o,"loading"),a.done(function(e){s.nodeSetStatus(o,"ok"),l._requestId=null}).fail(function(e){var t;e!==c?(e.node&&e.error&&e.message?t=e:"[object Object]"===(t=s._makeHookContext(l,null,{error:e,args:Array.prototype.slice.call(arguments),message:e?e.message||e.toString():""})).message&&(t.message=""),l.warn("Load children failed ("+t.message+")",t),!1!==s._triggerNodeEvent("loadError",t,null)&&s.nodeSetStatus(o,"error",t.message,t.details)):l.warn("Ignored response for obsolete load request #"+d+" (expected #"+l._requestId+")")});else if(o.options.postProcess){var r=s._triggerNodeEvent("postProcess",o,o.originalEvent,{response:a,error:null,dataType:typeof a});a=C.isArray(r)?r:a}return C.when(a).done(function(e){var n;C.isPlainObject(e)&&(k(l.isRootNode(),"source may only be an object for root nodes (expecting an array of child objects otherwise)"),k(C.isArray(e.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),e=(n=e).children,delete n.children,C.each(u,function(e,t){void 0!==n[t]&&(s[t]=n[t],delete n[t])}),C.extend(s.data,n)),k(C.isArray(e),"expected array of children"),l._setChildren(e),s._triggerNodeEvent("loadChildren",l)})},nodeLoadKeyPath:function(e,t){},nodeRemoveChild:function(e,t){var n,r=e.node,i=C.extend({},e,{node:t}),o=r.children;if(1===o.length)return k(t===o[0],"invalid single child"),this.nodeRemoveChildren(e);this.activeNode&&(t===this.activeNode||this.activeNode.isDescendantOf(t))&&this.activeNode.setActive(!1),this.focusNode&&(t===this.focusNode||this.focusNode.isDescendantOf(t))&&(this.focusNode=null),this.nodeRemoveMarkup(i),this.nodeRemoveChildren(i),k(0<=(n=C.inArray(t,o)),"invalid child"),r.triggerModifyChild("remove",t),t.visit(function(e){e.parent=null},!0),this._callHook("treeRegisterNode",this,!1,t),o.splice(n,1)},nodeRemoveChildMarkup:function(e){var t=e.node;t.ul&&(t.isRootNode()?C(t.ul).empty():(C(t.ul).remove(),t.ul=null),t.visit(function(e){e.li=e.ul=null}))},nodeRemoveChildren:function(e){var t=e.tree,n=e.node;n.children&&(this.activeNode&&this.activeNode.isDescendantOf(n)&&this.activeNode.setActive(!1),this.focusNode&&this.focusNode.isDescendantOf(n)&&(this.focusNode=null),this.nodeRemoveChildMarkup(e),C.extend({},e),n.triggerModifyChild("remove",null),n.visit(function(e){e.parent=null,t._callHook("treeRegisterNode",t,!1,e)}),n.lazy?n.children=[]:n.children=null,n.isRootNode()||(n.expanded=!1),this.nodeRenderStatus(e))},nodeRemoveMarkup:function(e){var t=e.node;t.li&&(C(t.li).remove(),t.li=null),this.nodeRemoveChildMarkup(e)},nodeRender:function(e,t,n,r,i){var o,a,s,l,d,c,u,p=e.node,h=e.tree,f=e.options,g=f.aria,y=!1,v=p.parent,m=!v,x=p.children,b=null;if(!1!==h._enableUpdate&&(m||v.ul)){if(k(m||v.ul,"parent UL must exist"),m||(p.li&&(t||p.li.parentNode!==p.parent.ul)&&(p.li.parentNode===p.parent.ul?b=p.li.nextSibling:this.debug("Unlinking "+p+" (must be child of "+p.parent+")"),this.nodeRemoveMarkup(e)),p.li?this.nodeRenderStatus(e):(y=!0,p.li=document.createElement("li"),(p.li.ftnode=p).key&&f.generateIds&&(p.li.id=f.idPrefix+p.key),p.span=document.createElement("span"),p.span.className="fancytree-node",g&&!p.tr&&C(p.li).attr("role","treeitem"),p.li.appendChild(p.span),this.nodeRenderTitle(e),f.createNode&&f.createNode.call(h,{type:"createNode"},e)),f.renderNode&&f.renderNode.call(h,{type:"renderNode"},e)),x){if(m||p.expanded||!0===n){for(p.ul||(p.ul=document.createElement("ul"),(!0!==r||i)&&p.expanded||(p.ul.style.display="none"),g&&C(p.ul).attr("role","group"),p.li?p.li.appendChild(p.ul):p.tree.$div.append(p.ul)),l=0,d=x.length;l<d;l++)u=C.extend({},e,{node:x[l]}),this.nodeRender(u,t,n,!1,!0);for(o=p.ul.firstChild;o;)o=(s=o.ftnode)&&s.parent!==p?(p.debug("_fixParent: remove missing "+s,o),c=o.nextSibling,o.parentNode.removeChild(o),c):o.nextSibling;for(o=p.ul.firstChild,l=0,d=x.length-1;l<d;l++)(a=x[l])!==(s=o.ftnode)?p.ul.insertBefore(a.li,s.li):o=o.nextSibling}}else p.ul&&(this.warn("remove child markup for "+p),this.nodeRemoveChildMarkup(e));m||y&&v.ul.insertBefore(p.li,b)}},nodeRenderTitle:function(e,t){var n,r,i,o,a,s,l,d=e.node,c=e.tree,u=e.options,p=u.aria,h=d.getLevel(),f=[];void 0!==t&&(d.title=t),d.span&&!1!==c._enableUpdate&&(a=p&&!1!==d.hasChildren()?" role='button'":"",h<u.minExpandLevel?(d.lazy||(d.expanded=!0),1<h&&f.push("<span "+a+" class='fancytree-expander fancytree-expander-fixed'></span>")):f.push("<span "+a+" class='fancytree-expander'></span>"),(n=g.evalOption("checkbox",d,d,u,!1))&&!d.isStatusNode()&&(a=p?" role='checkbox'":"",r="fancytree-checkbox",("radio"===n||d.parent&&d.parent.radiogroup)&&(r+=" fancytree-radio"),f.push("<span "+a+" class='"+r+"'></span>")),void 0!==d.data.iconClass&&(d.icon?C.error("'iconClass' node option is deprecated since v2.14.0: use 'icon' only instead"):(d.warn("'iconClass' node option is deprecated since v2.14.0: use 'icon' instead"),d.icon=d.data.iconClass)),!1!==(i=g.evalOption("icon",d,d,u,!0))&&(a=p?" role='presentation'":"",l=(l=g.evalOption("iconTooltip",d,d,u,null))?" title='"+E(l)+"'":"","string"==typeof i?y.test(i)?(i="/"===i.charAt(0)?i:(u.imagePath||"")+i,f.push("<img src='"+i+"' class='fancytree-icon'"+l+" alt='' />")):f.push("<span "+a+" class='fancytree-custom-icon "+i+"'"+l+"></span>"):i.text?f.push("<span "+a+" class='fancytree-custom-icon "+(i.addClass||"")+"'"+l+">"+i.text+"</span>"):f.push("<span "+a+" class='fancytree-icon'"+l+"></span>")),o="",u.renderTitle&&(o=u.renderTitle.call(c,{type:"renderTitle"},e)||""),o||(!0===(s=g.evalOption("tooltip",d,d,u,null))&&(s=d.title),o="<span class='fancytree-title'"+(s=s?" title='"+E(s)+"'":"")+(u.titlesTabbable?" tabindex='0'":"")+">"+(u.escapeTitles?g.escapeHtml(d.title):d.title)+"</span>"),f.push(o),d.span.innerHTML=f.join(""),this.nodeRenderStatus(e),u.enhanceTitle&&(e.$title=C(">span.fancytree-title",d.span),o=u.enhanceTitle.call(c,{type:"enhanceTitle"},e)||""))},nodeRenderStatus:function(e){var t,n=e.node,r=e.tree,i=e.options,o=n.hasChildren(),a=n.isLastSibling(),s=i.aria,l=i._classNames,d=[],c=n[r.statusClassPropName];c&&!1!==r._enableUpdate&&(s&&(t=C(n.tr||n.li)),d.push(l.node),r.activeNode===n&&d.push(l.active),r.focusNode===n&&d.push(l.focused),n.expanded&&d.push(l.expanded),s&&(!1!==o?t.attr("aria-expanded",Boolean(n.expanded)):t.removeAttr("aria-expanded")),n.folder&&d.push(l.folder),!1!==o&&d.push(l.hasChildren),a&&d.push(l.lastsib),n.lazy&&null==n.children&&d.push(l.lazy),n.partload&&d.push(l.partload),n.partsel&&d.push(l.partsel),g.evalOption("unselectable",n,n,i,!1)&&d.push(l.unselectable),n._isLoading&&d.push(l.loading),n._error&&d.push(l.error),n.statusNodeType&&d.push(l.statusNodePrefix+n.statusNodeType),n.selected?(d.push(l.selected),s&&t.attr("aria-selected",!0)):s&&t.attr("aria-selected",!1),n.extraClasses&&d.push(n.extraClasses),!1===o?d.push(l.combinedExpanderPrefix+"n"+(a?"l":"")):d.push(l.combinedExpanderPrefix+(n.expanded?"e":"c")+(n.lazy&&null==n.children?"d":"")+(a?"l":"")),d.push(l.combinedIconPrefix+(n.expanded?"e":"c")+(n.folder?"f":"")),c.className=d.join(" "),n.li&&C(n.li).toggleClass(l.lastsib,a))},nodeSetActive:function(e,t,n){n=n||{};var r,i=e.node,o=e.tree,a=e.options,s=!0===n.noEvents,l=!0===n.noFocus;return i===o.activeNode===(t=!1!==t)?_(i):t&&!s&&!1===this._triggerNodeEvent("beforeActivate",i,e.originalEvent)?N(i,["rejected"]):(t?(o.activeNode&&(k(o.activeNode!==i,"node was active (inconsistency)"),r=C.extend({},e,{node:o.activeNode}),o.nodeSetActive(r,!1),k(null===o.activeNode,"deactivate was out of sync?")),a.activeVisible&&i.makeVisible({scrollIntoView:l&&null==o.focusNode}),o.activeNode=i,o.nodeRenderStatus(e),l||o.nodeSetFocus(e),s||o._triggerNodeEvent("activate",i,e.originalEvent)):(k(o.activeNode===i,"node was not active (inconsistency)"),o.activeNode=null,this.nodeRenderStatus(e),s||e.tree._triggerNodeEvent("deactivate",i,e.originalEvent)),_(i))},nodeSetExpanded:function(r,i,e){e=e||{};var t,n,o,a,s,l,d=r.node,c=r.tree,u=r.options,p=!0===e.noAnimation,h=!0===e.noEvents;if(i=!1!==i,d.expanded&&i||!d.expanded&&!i)return _(d);if(i&&!d.lazy&&!d.hasChildren())return _(d);if(!i&&d.getLevel()<u.minExpandLevel)return N(d,["locked"]);if(!1===this._triggerNodeEvent("beforeExpand",d,r.originalEvent))return N(d,["rejected"]);if(p||d.isVisible()||(p=e.noAnimation=!0),n=new C.Deferred,i&&!d.expanded&&u.autoCollapse){s=d.getParentList(!1,!0),l=u.autoCollapse;try{for(u.autoCollapse=!1,o=0,a=s.length;o<a;o++)this._callHook("nodeCollapseSiblings",s[o],e)}finally{u.autoCollapse=l}}return n.done(function(){var e=d.getLastChild();i&&u.autoScroll&&!p&&e?e.scrollIntoView(!0,{topNode:d}).always(function(){h||r.tree._triggerNodeEvent(i?"expand":"collapse",r)}):h||r.tree._triggerNodeEvent(i?"expand":"collapse",r)}),t=function(e){var t=u._classNames,n=u.toggleEffect;if(d.expanded=i,c._callHook("nodeRender",r,!1,!1,!0),d.ul)if("none"!==d.ul.style.display===!!d.expanded)d.warn("nodeSetExpanded: UL.style.display already set");else{if(n&&!p)return C(d.li).addClass(t.animating),void C(d.ul).addClass(t.animating).toggle(n.effect,n.options,n.duration,function(){C(this).removeClass(t.animating),C(d.li).removeClass(t.animating),e()});d.ul.style.display=d.expanded||!parent?"":"none"}e()},i&&d.lazy&&void 0===d.hasChildren()?d.load().done(function(){n.notifyWith&&n.notifyWith(d,["loaded"]),t(function(){n.resolveWith(d)})}).fail(function(e){t(function(){n.rejectWith(d,["load failed ("+e+")"])})}):t(function(){n.resolveWith(d)}),n.promise()},nodeSetFocus:function(e,t){var n,r=e.tree,i=e.node,o=r.options,a=!!e.originalEvent&&C(e.originalEvent.target).is(":input");if(t=!1!==t,r.focusNode){if(r.focusNode===i&&t)return;n=C.extend({},e,{node:r.focusNode}),r.focusNode=null,this._triggerNodeEvent("blur",n),this._callHook("nodeRenderStatus",n)}t&&(this.hasFocus()||(i.debug("nodeSetFocus: forcing container focus"),this._callHook("treeSetFocus",e,!0,{calledByNode:!0})),i.makeVisible({scrollIntoView:!1}),r.focusNode=i,o.titlesTabbable?a||C(i.span).find(".fancytree-title").focus():0===C(document.activeElement).closest(".fancytree-container").length&&C(r.$container).focus(),o.aria&&C(r.$container).attr("aria-activedescendant",C(i.tr||i.li).uniqueId().attr("id")),this._triggerNodeEvent("focus",e),o.autoScroll&&i.scrollIntoView(),this._callHook("nodeRenderStatus",e))},nodeSetSelected:function(e,t,n){n=n||{};var r=e.node,i=e.tree,o=e.options,a=!0===n.noEvents,s=r.parent;if(t=!1!==t,!g.evalOption("unselectable",r,r,o,!1)){if(r._lastSelectIntent=t,!!r.selected===t&&(3!==o.selectMode||!r.partsel||t))return t;if(!a&&!1===this._triggerNodeEvent("beforeSelect",r,e.originalEvent))return!!r.selected;t&&1===o.selectMode?(i.lastSelectedNode&&i.lastSelectedNode.setSelected(!1),r.selected=t):3!==o.selectMode||!s||s.radiogroup||r.radiogroup?s&&s.radiogroup?r.visitSiblings(function(e){e._changeSelectStatusAttrs(t&&e===r)},!0):r.selected=t:(r.selected=t,r.fixSelection3AfterClick(n)),this.nodeRenderStatus(e),i.lastSelectedNode=t?r:null,a||i._triggerNodeEvent("select",e)}},nodeSetStatus:function(e,t,n,r){var i=e.node,o=e.tree;function a(e,t){var n=i.children?i.children[0]:null;return n&&n.isStatusNode()?(C.extend(n,e),n.statusNodeType=t,o._callHook("nodeRenderTitle",n)):(i._setChildren([e]),i.children[0].statusNodeType=t,o.render()),i.children[0]}switch(t){case"ok":!function(){var e=i.children?i.children[0]:null;if(e&&e.isStatusNode()){try{i.ul&&(i.ul.removeChild(e.li),e.li=null)}catch(e){}1===i.children.length?i.children=[]:i.children.shift()}}(),i._isLoading=!1,i._error=null,i.renderStatus();break;case"loading":i.parent||a({title:o.options.strings.loading+(n?" ("+n+")":""),checkbox:!1,tooltip:r},t),i._isLoading=!0,i._error=null,i.renderStatus();break;case"error":a({title:o.options.strings.loadError+(n?" ("+n+")":""),checkbox:!1,tooltip:r},t),i._isLoading=!1,i._error={message:n,details:r},i.renderStatus();break;case"nodata":a({title:o.options.strings.noData,checkbox:!1,tooltip:r},t),i._isLoading=!1,i._error=null,i.renderStatus();break;default:C.error("invalid node status "+t)}},nodeToggleExpanded:function(e){return this.nodeSetExpanded(e,!e.node.expanded)},nodeToggleSelected:function(e){var t=e.node,n=!t.selected;return t.partsel&&!t.selected&&!0===t._lastSelectIntent&&(n=!1,t.selected=!0),t._lastSelectIntent=n,this.nodeSetSelected(e,n)},treeClear:function(e){var t=e.tree;t.activeNode=null,t.focusNode=null,t.$div.find(">ul.fancytree-container").empty(),t.rootNode.children=null},treeCreate:function(e){},treeDestroy:function(e){this.$div.find(">ul.fancytree-container").remove(),this.$source&&this.$source.removeClass("ui-helper-hidden")},treeInit:function(e){var n=e.tree,r=n.options;n.$container.attr("tabindex",r.tabindex),C.each(u,function(e,t){void 0!==r[t]&&(n.info("Move option "+t+" to tree"),n[t]=r[t],delete r[t])}),r.rtl?n.$container.attr("DIR","RTL").addClass("fancytree-rtl"):n.$container.removeAttr("DIR").removeClass("fancytree-rtl"),r.aria&&(n.$container.attr("role","tree"),1!==r.selectMode&&n.$container.attr("aria-multiselectable",!0)),this.treeLoad(e)},treeLoad:function(e,t){var n,r,i,o=e.tree,a=e.widget.element,s=C.extend({},e,{node:this.rootNode});if(o.rootNode.children&&this.treeClear(e),t=t||this.options.source)"string"==typeof t&&C.error("Not implemented");else switch(r=a.data("type")||"html"){case"html":(i=a.find(">ul:first")).addClass("ui-fancytree-source ui-helper-hidden"),t=C.ui.fancytree.parseHtml(i),this.data=C.extend(this.data,w(i));break;case"json":t=C.parseJSON(a.text()),a.contents().filter(function(){return 3===this.nodeType}).remove(),C.isPlainObject(t)&&(k(C.isArray(t.children),"if an object is passed as source, it must contain a 'children' array (all other properties are added to 'tree.data')"),t=(n=t).children,delete n.children,C.each(u,function(e,t){void 0!==n[t]&&(o[t]=n[t],delete n[t])}),C.extend(o.data,n));break;default:C.error("Invalid data-type: "+r)}return this.nodeLoadChildren(s,t).done(function(){o.render(),3===e.options.selectMode&&o.rootNode.fixSelection3FromEndNodes(),o.activeNode&&o.options.activeVisible&&o.activeNode.makeVisible(),o._triggerTreeEvent("init",null,{status:!0})}).fail(function(){o.render(),o._triggerTreeEvent("init",null,{status:!1})})},treeRegisterNode:function(e,t,n){},treeSetFocus:function(e,t,n){var r;(t=!1!==t)!==this.hasFocus()&&(!(this._hasFocus=t)&&this.focusNode?this.focusNode.setFocus(!1):!t||n&&n.calledByNode||C(this.$container).focus(),this.$container.toggleClass("fancytree-treefocus",t),this._triggerTreeEvent(t?"focusTree":"blurTree"),t&&!this.activeNode&&(r=this._lastMousedownNode||this.getFirstChild())&&r.setFocus())},treeSetOption:function(e,t,n){var r=e.tree,i=!0,o=!1,a=!1;switch(t){case"aria":case"checkbox":case"icon":case"minExpandLevel":case"tabindex":a=o=!0;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":i=!1,r._callHook("treeLoad",r,n),a=!0}r.debug("set option "+t+"="+n+" <"+typeof n+">"),i&&(this.widget._super?this.widget._super.call(this.widget,t,n):C.Widget.prototype._setOption.call(this.widget,t,n)),o&&r._callHook("treeCreate",r),a&&r.render(!0,!1)}}),C.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:"blind",options:{direction:"vertical",scale:"box"},duration:200},generateIds:!1,icon:!0,idPrefix:"ft_",focusOnSelect:!1,keyboard:!0,keyPathSeparator:"/",minExpandLevel:1,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,_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 F(this),this.$source=this.source||"json"===this.element.data("type")?this.element:this.element.find(">ul:first");var e,t,n,r=this.options,i=r.extensions;this.tree;for(n=0;n<i.length;n++)t=i[n],(e=C.ui.fancytree._extensions[t])||C.error("Could not apply extension '"+t+"' (it is not registered, did you forget to include it?)"),this.tree.options[t]=C.extend(!0,{},e.options,this.tree.options[t]),k(void 0===this.tree.ext[t],"Extension name must not exist as Fancytree.ext attribute: '"+t+"'"),this.tree.ext[t]={},h(this.tree,0,e,t),e;void 0!==r.icons&&(!0!==r.icon?C.error("'icons' tree option is deprecated since v2.14.0: use 'icon' only instead"):(this.tree.warn("'icons' tree option is deprecated since v2.14.0: use 'icon' instead"),r.icon=r.icons)),void 0!==r.iconClass&&(r.icon?C.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),C.Widget.prototype.destroy.call(this)},_unbind:function(){var e=this.tree._ns;this.element.off(e),this.tree.$container.off(e),C(document).off(e)},_bind:function(){var a=this,s=this.options,o=this.tree,e=o._ns;this._unbind(),o.$container.on("focusin"+e+" focusout"+e,function(e){var t=g.getNode(e),n="focusin"===e.type;n&&o._getExpiringValue("focusin")?g.info("Ignored double focusin."):(o._setExpiringValue("focusin",!0,50),n&&!t&&(t=o._getExpiringValue("mouseDownNode"))&&g.info("Reconstruct mouse target for focusin from recent event."),t?o._callHook("nodeSetFocus",o._makeHookContext(t,e),n):o.tbody&&C(e.target).parents("table.fancytree-container > thead").length?o.debug("Ignore focus event outside table body.",e):o._callHook("treeSetFocus",o,n))}).on("selectstart"+e,"span.fancytree-title",function(e){e.preventDefault()}).on("keydown"+e,function(e){if(s.disabled||!1===s.keyboard)return!0;var t,n=o.focusNode,r=o._makeHookContext(n||o,e),i=o.phase;try{return o.phase="userEvent","preventNav"===(t=n?o._triggerNodeEvent("keydown",n,e):o._triggerTreeEvent("keydown",e))?t=!0:!1!==t&&(t=o._callHook("nodeKeydown",r)),t}finally{o.phase=i}}).on("mousedown"+e,function(e){var t=g.getEventTarget(e);o._lastMousedownNode=t?t.node:null,o._setExpiringValue("mouseDownNode",o._lastMousedownNode)}).on("click"+e+" dblclick"+e,function(e){if(s.disabled)return!0;var t,n=g.getEventTarget(e),r=n.node,i=a.tree,o=i.phase;if(!r)return!0;t=i._makeHookContext(r,e);try{switch(i.phase="userEvent",e.type){case"click":return t.targetType=n.type,r.isPagingNode()?!0===i._triggerNodeEvent("clickPaging",t,e):!1!==i._triggerNodeEvent("click",t,e)&&i._callHook("nodeClick",t);case"dblclick":return t.targetType=n.type,!1!==i._triggerNodeEvent("dblclick",t,e)&&i._callHook("nodeDblclick",t)}}finally{i.phase=o}})},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}}),g=C.ui.fancytree,C.extend(C.ui.fancytree,{version:"2.27.0",buildType:"production",debugLevel:1,_nextId:1,_nextNodeKey:1,_extensions:{},_FancytreeClass:F,_FancytreeNodeClass:A,jquerySupports:{positionMyOfs:function(e,t,n,r){var i,o,a,s=C.map(C.trim(e).split("."),function(e){return parseInt(e,10)}),l=C.map(Array.prototype.slice.call(arguments,1),function(e){return parseInt(e,10)});for(i=0;i<l.length;i++)if((o=s[i]||0)!==(a=l[i]||0))return a<o;return!0}(C.ui.version,1,9)},assert:function(e,t){return k(e,t)},createTree:function(e,t){return C(e).fancytree(t).fancytree("getTree")},debounce:function(t,n,r,i){var o;return 3===arguments.length&&"boolean"!=typeof r&&(i=r,r=!1),function(){var e=arguments;i=i||this,r&&!o&&n.apply(i,e),clearTimeout(o),o=setTimeout(function(){r||n.apply(i,e),o=null},t)}},debug:function(e){2<=C.ui.fancytree.debugLevel&&d("log",arguments)},error:function(e){d("error",arguments)},escapeHtml:function(e){return(""+e).replace(t,function(e){return r[e]})},fixPositionOptions:function(e){if((e.offset||0<=(""+e.my+e.at).indexOf("%"))&&C.error("expected new position syntax (but '%' is not supported)"),!C.ui.fancytree.jquerySupports.positionMyOfs){var t=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(e.my),n=/(\w+)([+-]?\d+)?\s+(\w+)([+-]?\d+)?/.exec(e.at),r=(t[2]?+t[2]:0)+(n[2]?+n[2]:0),i=(t[4]?+t[4]:0)+(n[4]?+n[4]:0);e=C.extend({},e,{my:t[1]+" "+t[3],at:n[1]+" "+n[3]}),(r||i)&&(e.offset=r+" "+i)}return e},getEventTarget:function(e){var t=e&&e.target?e.target.className:"",n={node:this.getNode(e.target),type:void 0};return/\bfancytree-title\b/.test(t)?n.type="title":/\bfancytree-expander\b/.test(t)?n.type=!1===n.node.hasChildren()?"prefix":"expander":/\bfancytree-checkbox\b/.test(t)?n.type="checkbox":/\bfancytree(-custom)?-icon\b/.test(t)?n.type="icon":/\bfancytree-node\b/.test(t)?n.type="title":e&&C(e.target).is("ul[role=group]")?(g.info("Ignoring click on outer UL."),n.node=null):e&&e.target&&C(e.target).closest(".fancytree-title").length&&(n.type="title"),n},getEventTargetType:function(e){return this.getEventTarget(e).type},getNode:function(e){if(e instanceof A)return e;for(e instanceof C?e=e[0]:void 0!==e.originalEvent&&(e=e.target);e;){if(e.ftnode)return e.ftnode;e=e.parentNode}return null},getTree:function(e){var t;return e instanceof F?e:(void 0===e&&(e=0),"number"==typeof e?e=C(".fancytree-container").eq(e):"string"==typeof e?e=C(e).eq(0):void 0!==e.selector?e=e.eq(0):void 0!==e.originalEvent&&(e=C(e.target)),(t=(e=e.closest(":ui-fancytree")).data("ui-fancytree")||e.data("fancytree"))?t.tree:null)},evalOption:function(e,t,n,r,i){var o,a,s=t.tree,l=r[e],d=n[e];return C.isFunction(l)?(o={node:t,tree:s,widget:s.widget,options:s.widget.options,typeInfo:s.types[t.type]||{}},null==(a=l.call(s,{type:e},o))&&(a=d)):a=null!=d?d:l,null==a&&(a=i),a},setSpanIcon:function(e,t,n){var r=C(e);"string"==typeof n?r.attr("class",t+" "+n):(n.text&&r.text(""+n.text),r.attr("class",t+" "+(n.addClass||"")))},eventToString:function(e){var t=e.which,n=e.type,r=[];return e.altKey&&r.push("alt"),e.ctrlKey&&r.push("ctrl"),e.metaKey&&r.push("meta"),e.shiftKey&&r.push("shift"),"click"===n||"dblclick"===n?r.push(a[e.button]+n):i[t]||r.push(f[t]||String.fromCharCode(t).toLowerCase()),r.join("+")},info:function(e){1<=C.ui.fancytree.debugLevel&&d("info",arguments)},keyEventToString:function(e){return this.warn("keyEventToString() is deprecated: use eventToString()"),this.eventToString(e)},overrideMethod:function(e,t,n){var r,i=e[t]||C.noop;e[t]=function(){try{return r=this._super,this._super=i,n.apply(this,arguments)}finally{this._super=r}}},parseHtml:function(a){var s,l,d,c,u,p,h,f,e=a.find(">li"),g=[];return e.each(function(){var e,t,n=C(this),r=n.find(">span:first",this),i=r.length?null:n.find(">a:first"),o={tooltip:null,data:{}};for(r.length?o.title=r.html():i&&i.length?(o.title=i.html(),o.data.href=i.attr("href"),o.data.target=i.attr("target"),o.tooltip=i.attr("title")):(o.title=n.html(),0<=(u=o.title.search(/<ul/i))&&(o.title=o.title.substring(0,u))),o.title=C.trim(o.title),c=0,p=v.length;c<p;c++)o[v[c]]=void 0;for(s=this.className.split(" "),d=[],c=0,p=s.length;c<p;c++)l=s[c],m[l]?o[l]=!0:d.push(l);if(o.extraClasses=d.join(" "),(h=n.attr("title"))&&(o.tooltip=h),(h=n.attr("id"))&&(o.key=h),n.attr("hideCheckbox")&&(o.checkbox=!1),(e=w(n))&&!C.isEmptyObject(e)){for(t in b)e.hasOwnProperty(t)&&(e[b[t]]=e[t],delete e[t]);for(c=0,p=x.length;c<p;c++)h=x[c],null!=(f=e[h])&&(delete e[h],o[h]=f);C.extend(o.data,e)}(a=n.find(">ul:first")).length?o.children=C.ui.fancytree.parseHtml(a):o.children=o.lazy?void 0:null,g.push(o)}),g},registerExtension:function(e){k(null!=e.name,"extensions must have a `name` property."),k(null!=e.version,"extensions must have a `version` property."),C.ui.fancytree._extensions[e.name]=e},unescapeHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue},warn:function(e){d("warn",arguments)}}),C.ui.fancytree}function k(e,t){e||(t=t?": "+t:"",C.error("Fancytree assertion failed"+t))}function d(e,t){var n,r,i=window.console?window.console[e]:null;if(i)try{i.apply(window.console,t)}catch(e){for(r="",n=0;n<t.length;n++)r+=t[n];i(r)}}function p(e,r,t,n,i){var o,a,s,l,d;return o=r[e],a=n[e],s=r.ext[i],l=function(){return o.apply(r,arguments)},d=function(e){return o.apply(r,e)},function(){var e=r._local,t=r._super,n=r._superApply;try{return r._local=s,r._super=l,r._superApply=d,a.apply(r,arguments)}finally{r._local=e,r._super=t,r._superApply=n}}}function h(e,t,n,r){for(var i in n)"function"==typeof n[i]?"function"==typeof e[i]?e[i]=p(i,e,0,n,r):"_"===i.charAt(0)?e.ext[r][i]=p(i,e,0,n,r):C.error("Could not override tree."+i+". Use prefix '_' to create tree."+r+"._"+i):"options"!==i&&(e.ext[r][i]=n[i])}function _(e,t){return void 0===e?C.Deferred(function(){this.resolve()}).promise():C.Deferred(function(){this.resolveWith(e,t)}).promise()}function N(e,t){return void 0===e?C.Deferred(function(){this.reject()}).promise():C.Deferred(function(){this.rejectWith(e,t)}).promise()}function S(e,t){return function(){e.resolveWith(t)}}function w(e){var t=C.extend({},e.data()),n=t.json;return delete t.fancytree,delete t.uiFancytree,n&&(delete t.json,t=C.extend(t,n)),t}function E(e){return(""+e).replace(n,function(e){return r[e]})}function T(t){return t=t.toLowerCase(),function(e){return 0<=e.title.toLowerCase().indexOf(t)}}function A(e,t){var n,r,i,o;for(this.parent=e,this.tree=e.tree,this.ul=null,this.li=null,this.statusNodeType=null,this._isLoading=!1,this._error=null,this.data={},n=0,r=x.length;n<r;n++)this[i=x[n]]=t[i];for(i in null==this.unselectableIgnore&&null==this.unselectableStatus||(this.unselectable=!0),t.hideCheckbox&&C.error("'hideCheckbox' node option was removed in v2.23.0: use 'checkbox: false'"),t.data&&C.extend(this.data,t.data),t)s[i]||C.isFunction(t[i])||l[i]||(this.data[i]=t[i]);null==this.key?this.tree.options.defaultKey?(this.key=this.tree.options.defaultKey(this),k(this.key,"defaultKey() must return a unique key")):this.key="_"+g._nextNodeKey++:this.key=""+this.key,t.active&&(k(null===this.tree.activeNode,"only one active node allowed"),this.tree.activeNode=this),t.selected&&(this.tree.lastSelectedNode=this),(o=t.children)?o.length?this._setChildren(o):this.children=this.lazy?[]:null:this.children=null,this.tree._callHook("treeRegisterNode",this.tree,!0,this)}function F(e){this.widget=e,this.$div=e.element,this.options=e.options,this.options&&(C.isFunction(this.options.lazyload)&&!C.isFunction(this.options.lazyLoad)&&(this.options.lazyLoad=function(){return g.warn("The 'lazyload' event is deprecated since 2014-02-25. Use 'lazyLoad' (with uppercase L) instead."),e.options.lazyload.apply(this,arguments)}),C.isFunction(this.options.loaderror)&&C.error("The 'loaderror' event was renamed since 2014-07-03. Use 'loadError' (with uppercase E) instead."),void 0!==this.options.fx&&g.warn("The 'fx' option was replaced by 'toggleEffect' since 2014-11-30."),void 0!==this.options.removeNode&&C.error("The 'removeNode' event was replaced by 'modifyChild' since 2.20 (2016-09-10).")),this.ext={},this.types={},this.columns={},this.data=w(this.$div),this._id=C.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.statusClassPropName="span",this.ariaPropName="li",this.nodeContainerAttrName="li",this.$div.find(">ul.fancytree-container").remove();var t,n={tree:this};this.rootNode=new A(n,{title:"root",key:"root_"+this._id,children:null,expanded:!0}),this.rootNode.parent=null,t=C("<ul>",{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=g.debugLevel)}C.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(o){"use strict";return o.ui.fancytree._FancytreeClass.prototype.countSelected=function(e){this.options;return this.getSelectedNodes(e).length},o.ui.fancytree._FancytreeNodeClass.prototype.updateCounters=function(){var e=this,t=o("span.fancytree-childcounter",e.span),n=e.tree.options.childcounter,r=e.countChildren(n.deep);!(e.data.childCounter=r)&&n.hideZeros||e.isExpanded()&&n.hideExpanded?t.remove():(t.length||(t=o("<span class='fancytree-childcounter'/>").appendTo(o("span.fancytree-icon",e.span))),t.text(r)),!n.deep||e.isTopLevel()||e.isRoot()||e.parent.updateCounters()},o.ui.fancytree.prototype.widgetMethod1=function(e){this.tree;return e},o.ui.fancytree.registerExtension({name:"childcounter",version:"2.27.0",options:{deep:!0,hideZeros:!0,hideExpanded:!1},foo:42,_appendCounter:function(e){},treeInit:function(e){e.options,e.options.childcounter;this._superApply(arguments),this.$container.addClass("fancytree-ext-childcounter")},treeDestroy:function(e){this._superApply(arguments)},nodeRenderTitle:function(e,t){var n=e.node,r=e.options.childcounter,i=null==n.data.childCounter?n.countChildren(r.deep):+n.data.childCounter;this._super(e,t),!i&&r.hideZeros||n.isExpanded()&&r.hideExpanded||o("span.fancytree-icon",n.span).append(o("<span class='fancytree-childcounter'/>").text(i))},nodeSetExpanded:function(e,t,n){var r=e.tree;e.node;return this._superApply(arguments).always(function(){r.nodeRenderTitle(e)})}}),o.ui.fancytree}),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(c){"use strict";function u(e,t){e||(t=t?": "+t:"",c.error("Assertion failed"+t))}return c.ui.fancytree._FancytreeNodeClass.prototype.getCloneList=function(e){var t,n=this.tree,r=n.refMap[this.refKey]||null,i=n.keyMap;return r&&(t=this.key,e?r=c.map(r,function(e){return i[e]}):(r=c.map(r,function(e){return e===t?null:i[e]})).length<1&&(r=null)),r},c.ui.fancytree._FancytreeNodeClass.prototype.isClone=function(){var e=this.refKey||null,t=e&&this.tree.refMap[e]||null;return!!(t&&1<t.length)},c.ui.fancytree._FancytreeNodeClass.prototype.reRegister=function(t,e){t=null==t?null:""+t,e=null==e?null:""+e;var n=this.tree,r=this.key,i=this.refKey,o=n.keyMap,a=n.refMap,s=a[i]||null,l=!1;return null!=t&&t!==this.key&&(o[t]&&c.error("[ext-clones] reRegister("+t+"): already exists: "+this),delete o[r],o[t]=this,s&&(a[i]=c.map(s,function(e){return e===r?t:e})),this.key=t,l=!0),null!=e&&e!==this.refKey&&(s&&(1===s.length?delete a[i]:a[i]=c.map(s,function(e){return e===r?null:e})),a[e]?a[e].append(t):a[e]=[this.key],this.refKey=e,l=!0),l},c.ui.fancytree._FancytreeNodeClass.prototype.setRefKey=function(e){return this.reRegister(null,e)},c.ui.fancytree._FancytreeClass.prototype.getNodesByRef=function(e,n){var r=this.keyMap,t=this.refMap[e]||null;return t&&(t=n?c.map(t,function(e){var t=r[e];return t.isDescendantOf(n)?t:null}):c.map(t,function(e){return r[e]})).length<1&&(t=null),t},c.ui.fancytree._FancytreeClass.prototype.changeRefKey=function(e,t){var n,r=this.keyMap,i=this.refMap[e]||null;if(i){for(n=0;n<i.length;n++)r[i[n]].refKey=t;delete this.refMap[e],this.refMap[t]=i}},c.ui.fancytree.registerExtension({name:"clones",version:"2.27.0",options:{highlightActiveClones:!0,highlightClones:!1},treeCreate:function(e){this._superApply(arguments),e.tree.refMap={},e.tree.keyMap={}},treeInit:function(e){this.$container.addClass("fancytree-ext-clones"),u(null==e.options.defaultKey),e.options.defaultKey=function(e){return t=e,"id_"+function(e,t,n){for(var r,i,o=3&e.length,a=e.length-o,s=n,l=3432918353,d=461845907,c=0;c<a;)i=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,s=27492+(65535&(r=5*(65535&(s=(s^=i=(65535&(i=(i=(65535&i)*l+(((i>>>16)*l&65535)<<16)&4294967295)<<15|i>>>17))*d+(((i>>>16)*d&65535)<<16)&4294967295)<<13|s>>>19))+((5*(s>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(i=0,o){case 3:i^=(255&e.charCodeAt(c+2))<<16;case 2:i^=(255&e.charCodeAt(c+1))<<8;case 1:s^=i=(65535&(i=(i=(65535&(i^=255&e.charCodeAt(c)))*l+(((i>>>16)*l&65535)<<16)&4294967295)<<15|i>>>17))*d+(((i>>>16)*d&65535)<<16)&4294967295}return s^=e.length,s=2246822507*(65535&(s^=s>>>16))+((2246822507*(s>>>16)&65535)<<16)&4294967295,s=3266489909*(65535&(s^=s>>>13))+((3266489909*(s>>>16)&65535)<<16)&4294967295,s^=s>>>16,t?("0000000"+(s>>>0).toString(16)).substr(-8):s>>>0}(c.map(t.getParentList(!1,!0),function(e){return e.refKey||e.key}).join("/"),!0);var t},this._superApply(arguments)},treeClear:function(e){return e.tree.refMap={},e.tree.keyMap={},this._superApply(arguments)},treeRegisterNode:function(e,t,n){var r,i,o=e.tree,a=o.keyMap,s=o.refMap,l=n.key,d=n&&null!=n.refKey?""+n.refKey:null;return n.isStatusNode()||(t?(null!=a[n.key]&&c.error("clones.treeRegisterNode: node.key already exists: "+n),a[l]=n,d&&((r=s[d])?(r.push(l),2===r.length&&e.options.clones.highlightClones&&a[r[0]].renderStatus()):s[d]=[l])):(null==a[l]&&c.error("clones.treeRegisterNode: node.key not registered: "+n.key),delete a[l],d&&(r=s[d])&&((i=r.length)<=1?(u(1===i),u(r[0]===l),delete s[d]):(!function(e,t){var n;for(n=e.length-1;0<=n;n--)if(e[n]===t)return e.splice(n,1)}(r,l),2===i&&e.options.clones.highlightClones&&a[r[0]].renderStatus())))),this._super(e,t,n)},nodeRenderStatus:function(e){var t,n,r=e.node;return n=this._super(e),e.options.clones.highlightClones&&(t=c(r[e.tree.statusClassPropName])).length&&r.isClone()&&t.addClass("fancytree-clone"),n},nodeSetActive:function(e,n,t){var r,i=e.tree.statusClassPropName,o=e.node;return r=this._superApply(arguments),e.options.clones.highlightActiveClones&&o.isClone()&&c.each(o.getCloneList(!0),function(e,t){c(t[i]).toggleClass("fancytree-active-clone",!1!==n)}),r}}),c.ui.fancytree}),function(e){"function"==typeof define&&define.amd?define(["jquery","jquery-ui/ui/widgets/draggable","jquery-ui/ui/widgets/droppable","./jquery.fancytree"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree"),module.exports=e(require("jquery"))):e(jQuery)}(function(b){"use strict";var n=!1,f="fancytree-drop-accept",g="fancytree-drop-after",y="fancytree-drop-before",v="fancytree-drop-reject";function t(e){var t=e.options.dnd||null,o=e.options.glyph||null;t&&(n||(b.ui.plugin.add("draggable","connectToFancytree",{start:function(e,t){var n=b(this).data("ui-draggable")||b(this).data("draggable"),r=t.helper.data("ftSourceNode")||null;if(r)return n.offset.click.top=-2,n.offset.click.left=16,r.tree.ext.dnd._onDragEvent("start",r,null,e,t,n)},drag:function(e,t){var n,r=b(this).data("ui-draggable")||b(this).data("draggable"),i=t.helper.data("ftSourceNode")||null,o=t.helper.data("ftTargetNode")||null,a=b.ui.fancytree.getNode(e.target),s=i&&i.tree.options.dnd;e.target&&!a&&0<b(e.target).closest("div.fancytree-drag-helper,#fancytree-drop-marker").length?(i||o||b.ui.fancytree).debug("Drag event over helper: ignored."):(t.helper.data("ftTargetNode",a),s&&s.updateHelper&&(n=i.tree._makeHookContext(i,e,{otherNode:a,ui:t,draggable:r,dropMarker:b("#fancytree-drop-marker")}),s.updateHelper.call(i.tree,i,n)),o&&o!==a&&o.tree.ext.dnd._onDragEvent("leave",o,i,e,t,r),a&&a.tree.options.dnd.dragDrop&&(a===o||a.tree.ext.dnd._onDragEvent("enter",a,i,e,t,r),a.tree.ext.dnd._onDragEvent("over",a,i,e,t,r)))},stop:function(e,t){var n=b(this).data("ui-draggable")||b(this).data("draggable"),r=t.helper.data("ftSourceNode")||null,i=t.helper.data("ftTargetNode")||null,o="mouseup"===e.type&&1===e.which;o||(r||i||b.ui.fancytree).debug("Drag was cancelled"),i&&(o&&i.tree.ext.dnd._onDragEvent("drop",i,r,e,t,n),i.tree.ext.dnd._onDragEvent("leave",i,r,e,t,n)),r&&r.tree.ext.dnd._onDragEvent("stop",r,null,e,t,n)}}),n=!0)),t&&t.dragStart&&e.widget.element.draggable(b.extend({addClasses:!1,appendTo:e.$container,containment:!1,delay:0,distance:4,revert:!1,scroll:!0,scrollSpeed:7,scrollSensitivity:10,connectToFancytree:!0,helper:function(e){var t,n,r,i=b.ui.fancytree.getNode(e.target);return i?(r=i.tree.options.dnd,n=b(i.span),(t=b("<div class='fancytree-drag-helper'><span class='fancytree-drag-helper-img' /></div>").css({zIndex:3,position:"relative"}).append(n.find("span.fancytree-title").clone())).data("ftSourceNode",i),o&&t.find(".fancytree-drag-helper-img").addClass(o.map._addClass+" "+o.map.dragHelper),r.initHelper&&r.initHelper.call(i.tree,i,{node:i,tree:i.tree,originalEvent:e,ui:{helper:t}}),t):"<div>ERROR?: helper requested but sourceNode not found</div>"},start:function(e,t){return!!t.helper.data("ftSourceNode")}},e.options.dnd.draggable)),t&&t.dragDrop&&e.widget.element.droppable(b.extend({addClasses:!1,tolerance:"intersect",greedy:!1},e.options.dnd.droppable))}return b.ui.fancytree.registerExtension({name:"dnd",version:"2.27.0",options:{autoExpandMS:1e3,draggable:null,droppable:null,focusOnClick:!1,preventVoidMoves:!0,preventRecursiveMoves:!0,smartRevert:!0,dropMarkerOffsetX:-24,dropMarkerInsertOffsetX:-16,dragStart:null,dragStop:null,initHelper:null,updateHelper:null,dragEnter:null,dragOver:null,dragExpand:null,dragDrop:null,dragLeave:null},treeInit:function(n){var e=n.tree;this._superApply(arguments),e.options.dnd.dragStart&&e.$container.on("mousedown",function(e){if(n.options.dnd.focusOnClick){var t=b.ui.fancytree.getNode(e);t&&t.debug("Re-enable focus that was prevented by jQuery UI draggable."),setTimeout(function(){b(e.target).closest(":tabbable").focus()},10)}}),t(e)},_setDndStatus:function(e,t,n,r,i){var o,a,s="center",l=this._local,d=this.options.dnd,c=this.options.glyph,u=e?b(e.span):null,p=b(t.span),h=p.find("span.fancytree-title");if(l.$dropMarker||(l.$dropMarker=b("<div id='fancytree-drop-marker'></div>").hide().css({"z-index":1e3}).prependTo(b(this.$div).parent()),c&&l.$dropMarker.addClass(c.map._addClass+" "+c.map.dropMarker)),"after"===r||"before"===r||"over"===r){switch(o=d.dropMarkerOffsetX||0,r){case"before":s="top",o+=d.dropMarkerInsertOffsetX||0;break;case"after":s="bottom",o+=d.dropMarkerInsertOffsetX||0}l.$dropMarker.toggleClass(g,"after"===r).toggleClass("fancytree-drop-over","over"===r).toggleClass(y,"before"===r).show().position(b.ui.fancytree.fixPositionOptions({my:"left"+(a=o,0===a?"":0<a?"+"+a:""+a)+" center",at:"left "+s,of:h}))}else l.$dropMarker.hide();u&&u.toggleClass(f,!0===i).toggleClass(v,!1===i),p.toggleClass("fancytree-drop-target","after"===r||"before"===r||"over"===r).toggleClass(g,"after"===r).toggleClass(y,"before"===r).toggleClass(f,!0===i).toggleClass(v,!1===i),n.toggleClass(f,!0===i).toggleClass(v,!1===i)},_onDragEvent:function(e,t,n,r,i,o){var a,s,l,d,c,u,p,h,f,g=this.options.dnd,y=this._makeHookContext(t,r,{otherNode:n,ui:i,draggable:o}),v=null,m=this,x=b(t.span);switch(g.smartRevert&&(o.options.revert="invalid"),e){case"start":t.isStatusNode()?v=!1:g.dragStart&&(v=g.dragStart(t,y)),!1===v?(this.debug("tree.dragStart() cancelled"),i.helper.trigger("mouseup").hide()):(g.smartRevert&&(d=t[y.tree.nodeContainerAttrName].getBoundingClientRect(),l=b(o.options.appendTo)[0].getBoundingClientRect(),o.originalPosition.left=Math.max(0,d.left-l.left),o.originalPosition.top=Math.max(0,d.top-l.top)),x.addClass("fancytree-drag-source"),b(document).on("keydown.fancytree-dnd,mousedown.fancytree-dnd",function(e){"keydown"===e.type&&e.which===b.ui.keyCode.ESCAPE?m.ext.dnd._cancelDrag():"mousedown"===e.type&&m.ext.dnd._cancelDrag()}));break;case"enter":v=!!(f=(!g.preventRecursiveMoves||!t.isDescendantOf(n))&&(g.dragEnter?g.dragEnter(t,y):null))&&(b.isArray(f)?{over:0<=b.inArray("over",f),before:0<=b.inArray("before",f),after:0<=b.inArray("after",f)}:{over:!0===f||"over"===f,before:!0===f||"before"===f,after:!0===f||"after"===f}),i.helper.data("enterResponse",v);break;case"over":h=null,!1===(p=i.helper.data("enterResponse"))||("string"==typeof p?h=p:(s=x.offset(),u={x:(c={x:r.pageX-s.left,y:r.pageY-s.top}).x/x.width(),y:c.y/x.height()},p.after&&.75<u.y?h="after":!p.over&&p.after&&.5<u.y?h="after":p.before&&u.y<=.25?h="before":!p.over&&p.before&&u.y<=.5?h="before":p.over&&(h="over"),g.preventVoidMoves&&(t===n?(this.debug(" drop over source node prevented"),h=null):"before"===h&&n&&t===n.getNextSibling()?(this.debug(" drop after source node prevented"),h=null):"after"===h&&n&&t===n.getPrevSibling()?(this.debug(" drop before source node prevented"),h=null):"over"===h&&n&&n.parent===t&&n.isLastSibling()&&(this.debug(" drop last child over own parent prevented"),h=null)),i.helper.data("hitMode",h))),"before"===h||"after"===h||!g.autoExpandMS||!1===t.hasChildren()||t.expanded||g.dragExpand&&!1===g.dragExpand(t,y)||t.scheduleAction("expand",g.autoExpandMS),h&&g.dragOver&&(y.hitMode=h,v=g.dragOver(t,y)),a=!1!==v&&null!==h,g.smartRevert&&(o.options.revert=!a),this._local._setDndStatus(n,t,i.helper,h,a);break;case"drop":(h=i.helper.data("hitMode"))&&g.dragDrop&&(y.hitMode=h,g.dragDrop(t,y));break;case"leave":t.scheduleAction("cancel"),i.helper.data("enterResponse",null),i.helper.data("hitMode",null),this._local._setDndStatus(n,t,i.helper,"out",void 0),g.dragLeave&&g.dragLeave(t,y);break;case"stop":x.removeClass("fancytree-drag-source"),b(document).off(".fancytree-dnd"),g.dragStop&&g.dragStop(t,y);break;default:b.error("Unsupported drag event: "+e)}return v},_cancelDrag:function(){var e=b.ui.ddmanager.current;e&&e.cancel()}}),b.ui.fancytree}),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(_){"use strict";var N=_.ui.fancytree,s="fancytree-drag-source",l="fancytree-drag-remove",S="fancytree-drop-accept",w="fancytree-drop-after",E="fancytree-drop-before",T="fancytree-drop-over",A="fancytree-drop-reject",f="application/x-fancytree-node",F=null,g=null,j=null,D=null;function y(e,t){var n,r,i,o,a,s,l,d,c;if(t.options.dnd5.scroll&&(n=t.tree,r=e,a=n.options.dnd5,s=n.$scrollParent[0],l=a.scrollSensitivity,d=a.scrollSpeed,c=0,s!==document&&"HTML"!==s.tagName?(i=n.$scrollParent.offset(),o=s.scrollTop,i.top+s.offsetHeight-r.pageY<l?0<s.scrollHeight-n.$scrollParent.innerHeight()-o&&(s.scrollTop=c=o+d):0<o&&r.pageY-i.top<l&&(s.scrollTop=c=o-d)):0<(o=_(document).scrollTop())&&r.pageY-o<l?(c=o-d,_(document).scrollTop(c)):_(window).height()-(r.pageY-o)<l&&(c=o+d,_(document).scrollTop(c)),c&&n.debug("autoScroll: "+c+"px")),!t.node)return t.tree.warn("Ignore dragover for non-node"),D;var u,p,h,f,g=null,y=t.tree,v=y.options.dnd5,m=t.node,x=t.otherNode,b="center",C=_(m.span),k=C.find("span.fancytree-title");if(!1===j)return y.info("Ignore dragover, since dragenter returned false"),!1;if("string"==typeof j?_.error("assert failed: dragenter returned string"):(p=C.offset(),h=(e.pageY-p.top)/C.height(),j.after&&.75<h?g="after":!j.over&&j.after&&.5<h?g="after":j.before&&h<=.25?g="before":!j.over&&j.before&&h<=.5?g="before":j.over&&(g="over"),v.preventVoidMoves&&(m===x?(m.debug("drop over source node prevented"),g=null):"before"===g&&x&&m===x.getNextSibling()?(m.debug("drop after source node prevented"),g=null):"after"===g&&x&&m===x.getPrevSibling()?(m.debug("drop before source node prevented"),g=null):"over"===g&&x&&x.parent===m&&x.isLastSibling()&&(m.debug("drop last child over own parent prevented"),g=null))),(t.hitMode=g)&&v.dragOver&&(v.dragOver(m,t),g=t.hitMode),"after"===(D=g)||"before"===g||"over"===g){switch(u=v.dropMarkerOffsetX||0,g){case"before":b="top",u+=v.dropMarkerInsertOffsetX||0;break;case"after":b="bottom",u+=v.dropMarkerInsertOffsetX||0}F.toggleClass(w,"after"===g).toggleClass(T,"over"===g).toggleClass(E,"before"===g).show().position(N.fixPositionOptions({my:"left"+(f=u,0===f?"":0<f?"+"+f:""+f)+" center",at:"left "+b,of:k}))}else F.hide();return _(m.span).toggleClass("fancytree-drop-target","after"===g||"before"===g||"over"===g).toggleClass(w,"after"===g).toggleClass(E,"before"===g).toggleClass(S,"over"===g).toggleClass(A,!1===g),g}return _.ui.fancytree.registerExtension({name:"dnd5",version:"2.27.0",options:{autoExpandMS:1500,setTextTypeJson:!1,preventForeignNodes:!1,preventNonNodes:!1,preventRecursiveMoves:!0,preventVoidMoves:!0,scroll:!0,scrollSensitivity:20,scrollSpeed:5,dropMarkerOffsetX:-24,dropMarkerInsertOffsetX:-16,dragStart:null,dragDrag:_.noop,dragEnd:_.noop,dragEnter:null,dragOver:_.noop,dragExpand:_.noop,dragDrop:_.noop,dragLeave:_.noop},treeInit:function(e){var t,u=e.tree,n=e.options,r=n.glyph||null,p=n.dnd5,h=N.getNode;0<=_.inArray("dnd",n.extensions)&&_.error("Extensions 'dnd' and 'dnd5' are mutually exclusive."),p.dragStop&&_.error("dragStop is not used by ext-dnd5. Use dragEnd instead."),p.dragStart&&N.overrideMethod(e.options,"createNode",function(e,t){this._super.apply(this,arguments),t.node.span.draggable=!0}),this._superApply(arguments),this.$container.addClass("fancytree-ext-dnd5"),t=_("<span>").appendTo(this.$container),this.$scrollParent=t.scrollParent(),t.remove(),(F=_("#fancytree-drop-marker")).length||(F=_("<div id='fancytree-drop-marker'></div>").hide().css({"z-index":1e3,"pointer-events":"none"}).prependTo("body"),r&&N.setSpanIcon(F[0],r.map._addClass,r.map.dropMarker)),p.dragStart&&u.$container.on("dragstart drag dragend",function(e){var t,n=h(e),r=e.dataTransfer||e.originalEvent.dataTransfer,i="move"===r.dropEffect,o=n?_(n.span):null,a={node:n,tree:u,options:u.options,originalEvent:e,dataTransfer:r,isCancelled:void 0};switch(e.type){case"dragstart":_(n.span).addClass(s),g=n,t=JSON.stringify(n.toDict());try{r.setData(f,t),r.setData("text/html",_(n.span).html()),r.setData("text/plain",n.title)}catch(e){u.warn("Could not set data (IE only accepts 'text') - "+e)}return p.setTextTypeJson?r.setData("text",t):r.setData("text",n.title),r.effectAllowed="all",r.setDragImage&&r.setDragImage(_(n.span).find(".fancytree-title")[0],-10,-10),!1!==p.dragStart(n,a);case"drag":o.toggleClass(l,i),p.dragDrag(n,a);break;case"dragend":_(n.span).removeClass(s+" "+l),j=g=null,a.isCancelled="none"===r.dropEffect,F.hide(),p.dragEnd(n,a)}}),p.dragEnter&&u.$container.on("dragenter dragover dragleave drop",function(e){var t,n,r,i,o,a,s=null,l=h(e),d=e.dataTransfer||e.originalEvent.dataTransfer,c={node:l,tree:u,options:u.options,hitMode:j,originalEvent:e,dataTransfer:d,otherNode:g||null,otherNodeData:null,dropEffect:void 0,isCancelled:void 0};switch(e.type){case"dragenter":if(!l){u.debug("Ignore non-node "+e.type+": "+e.target.tagName+"."+e.target.className),j=!1;break}if(_(l.span).addClass(T).removeClass(S+" "+A),p.preventNonNodes&&!n){l.debug("Reject dropping a non-node"),j=!1;break}if(p.preventForeignNodes&&(!g||g.tree!==l.tree)){l.debug("Reject dropping a foreign node"),j=!1;break}setTimeout(function(){!p.autoExpandMS||!1===l.hasChildren()||l.expanded||p.dragExpand&&!1===p.dragExpand(l,c)||l.scheduleAction("expand",p.autoExpandMS)},0),F.show(),i=(!p.preventRecursiveMoves||!l.isDescendantOf(c.otherNode))&&(r=p.dragEnter(l,c),!!(o=r)&&(a=_.isPlainObject(o)?{over:!!o.over,before:!!o.before,after:!!o.after}:_.isArray(o)?{over:0<=_.inArray("over",o),before:0<=_.inArray("before",o),after:0<=_.inArray("after",o)}:{over:!0===o||"over"===o,before:!0===o||"before"===o,after:!0===o||"after"===o},0!==Object.keys(a).length&&a)),s=(j=i)&&(i.over||i.before||i.after);break;case"dragover":s=!!(D=y(e,c));break;case"dragleave":if(!l){u.debug("Ignore non-node "+e.type+": "+e.target.tagName+"."+e.target.className);break}if(!_(l.span).hasClass(T)){l.debug("Ignore dragleave (multi)");break}_(l.span).removeClass(T+" "+S+" "+A),l.scheduleAction("cancel"),p.dragLeave(l,c),F.hide();break;case"drop":if(0<=_.inArray(f,d.types)&&(n=d.getData(f),u.info(e.type+": getData('application/x-fancytree-node'): '"+n+"'")),n||(n=d.getData("text"),u.info(e.type+": getData('text'): '"+n+"'")),n)try{void 0!==(t=JSON.parse(n)).title&&(c.otherNodeData=t)}catch(e){}u.debug(e.type+": nodeData: '"+n+"', otherNodeData: ",c.otherNodeData),_(l.span).removeClass(T+" "+S+" "+A),F.hide(),c.hitMode=D,c.dropEffect=d.dropEffect,c.isCancelled="none"===c.dropEffect,p.dragDrop(l,c),e.preventDefault()}if(s)return e.preventDefault(),!1})}}),_.ui.fancytree}),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(d){"use strict";var t=/Mac/.test(navigator.platform),c=d.ui.fancytree.escapeHtml,s=d.ui.fancytree.unescapeHtml;return d.ui.fancytree._FancytreeNodeClass.prototype.editStart=function(){var t,n=this,e=this.tree,r=e.ext.edit,i=e.options.edit,o=d(".fancytree-title",n.span),a={node:n,tree:e,options:e.options,isNew:d(n[e.statusClassPropName]).hasClass("fancytree-edit-new"),orgTitle:n.title,input:null,dirty:!1};if(!1===i.beforeEdit.call(n,{type:"beforeEdit"},a))return!1;d.ui.fancytree.assert(!r.currentNode,"recursive edit"),r.currentNode=this,r.eventData=a,e.widget._unbind(),d(document).on("mousedown.fancytree-edit",function(e){d(e.target).hasClass("fancytree-edit-input")||n.editEnd(!0,e)}),t=d("<input />",{class:"fancytree-edit-input",type:"text",value:e.options.escapeTitles?a.orgTitle:s(a.orgTitle)}),r.eventData.input=t,null!=i.adjustWidthOfs&&t.width(o.width()+i.adjustWidthOfs),null!=i.inputCss&&t.css(i.inputCss),o.html(t),t.focus().change(function(e){t.addClass("fancytree-edit-dirty")}).keydown(function(e){switch(e.which){case d.ui.keyCode.ESCAPE:n.editEnd(!1,e);break;case d.ui.keyCode.ENTER:return n.editEnd(!0,e),!1}e.stopPropagation()}).blur(function(e){return n.editEnd(!0,e)}),i.edit.call(n,{type:"edit"},a)},d.ui.fancytree._FancytreeNodeClass.prototype.editEnd=function(e,t){var n,r=this,i=this.tree,o=i.ext.edit,a=o.eventData,s=i.options.edit,l=d(".fancytree-title",r.span).find("input.fancytree-edit-input");return s.trim&&l.val(d.trim(l.val())),n=l.val(),a.dirty=n!==r.title,a.originalEvent=t,!1===e?a.save=!1:a.isNew?a.save=""!==n:a.save=a.dirty&&""!==n,!1!==s.beforeClose.call(r,{type:"beforeClose"},a)&&((!a.save||!1!==s.save.call(r,{type:"save"},a))&&(l.removeClass("fancytree-edit-dirty").off(),d(document).off(".fancytree-edit"),a.save?(r.setTitle(i.options.escapeTitles?n:c(n)),r.setFocus()):a.isNew?(r.remove(),r=a.node=null,o.relatedNode.setFocus()):(r.renderTitle(),r.setFocus()),o.eventData=null,o.currentNode=null,o.relatedNode=null,i.widget._bind(),d(i.$container).focus(),a.input=null,s.close.call(r,{type:"close"},a),!0))},d.ui.fancytree._FancytreeNodeClass.prototype.editCreateNode=function(e,t){var n,r=this.tree,i=this;e=e||"child",null==t?t={title:""}:"string"==typeof t?t={title:t}:d.ui.fancytree.assert(d.isPlainObject(t)),"child"!==e||this.isExpanded()||!1===this.hasChildren()?((n=this.addNode(t,e)).match=!0,d(n[r.statusClassPropName]).removeClass("fancytree-hide").addClass("fancytree-match"),n.makeVisible().done(function(){d(n[r.statusClassPropName]).addClass("fancytree-edit-new"),i.tree.ext.edit.relatedNode=i,n.editStart()})):this.setExpanded().done(function(){i.editCreateNode(e,t)})},d.ui.fancytree._FancytreeClass.prototype.isEditing=function(){return this.ext.edit?this.ext.edit.currentNode:null},d.ui.fancytree._FancytreeNodeClass.prototype.isEditing=function(){return!!this.tree.ext.edit&&this.tree.ext.edit.currentNode===this},d.ui.fancytree.registerExtension({name:"edit",version:"2.27.0",options:{adjustWidthOfs:4,allowEmpty:!1,inputCss:{minWidth:"3em"},triggerStart:["f2","mac+enter","shift+click"],trim:!0,beforeClose:d.noop,beforeEdit:d.noop,close:d.noop,edit:d.noop,save:d.noop},currentNode:null,treeInit:function(e){this._superApply(arguments),this.$container.addClass("fancytree-ext-edit")},nodeClick:function(e){return 0<=d.inArray("shift+click",e.options.edit.triggerStart)&&e.originalEvent.shiftKey?(e.node.editStart(),!1):0<=d.inArray("clickActive",e.options.edit.triggerStart)&&e.node.isActive()&&!e.node.isEditing()&&d(e.originalEvent.target).hasClass("fancytree-title")?(e.node.editStart(),!1):this._superApply(arguments)},nodeDblclick:function(e){return 0<=d.inArray("dblclick",e.options.edit.triggerStart)?(e.node.editStart(),!1):this._superApply(arguments)},nodeKeydown:function(e){switch(e.originalEvent.which){case 113:if(0<=d.inArray("f2",e.options.edit.triggerStart))return e.node.editStart(),!1;break;case d.ui.keyCode.ENTER:if(0<=d.inArray("mac+enter",e.options.edit.triggerStart)&&t)return e.node.editStart(),!1}return this._superApply(arguments)}}),d.ui.fancytree}),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(g){"use strict";var y="__not_found__",v=g.ui.fancytree.escapeHtml;function m(e){return(e+"").replace(/([.?*+\^\$\[\]\\(){}|-])/g,"\\$1")}return g.ui.fancytree._FancytreeClass.prototype._applyFilterImpl=function(r,i,e){var t,n,o,a,s,l=0,d=this.options,c=d.escapeTitles,u=d.autoCollapse,p=g.extend({},d.filter,e),h="hide"===p.mode,f=!!p.leavesOnly&&!i;if("string"==typeof r){if(""===r)return this.warn("Fancytree passing an empty string as a filter is handled as clearFilter()."),void this.clearFilter();t=p.fuzzy?r.split("").reduce(function(e,t){return e+"[^"+t+"]*"+t}):m(r),o=new RegExp(".*"+t+".*","i"),a=new RegExp(m(r),"gi"),r=function(e){var t,n=c?e.title:0<=(t=e.title).indexOf(">")?g("<div/>").html(t).text():t,r=!!o.test(n);return r&&p.highlight&&(e.titleWithHighlight=c?(s=n.replace(a,function(e){return""+e+""}),v(s).replace(/\uFFF7/g,"<mark>").replace(/\uFFF8/g,"</mark>")):n.replace(a,function(e){return"<mark>"+e+"</mark>"})),r}}return this.enableFilter=!0,this.lastFilterArgs=arguments,this.$div.addClass("fancytree-ext-filter"),h?this.$div.addClass("fancytree-ext-filter-hide"):this.$div.addClass("fancytree-ext-filter-dimm"),this.$div.toggleClass("fancytree-ext-filter-hide-expanders",!!p.hideExpanders),this.visit(function(e){delete e.match,delete e.titleWithHighlight,e.subMatchCount=0}),(n=this.getRootNode()._findDirectChild(y))&&n.remove(),d.autoCollapse=!1,this.visit(function(e){if(!f||null==e.children){var t=r(e),n=!1;if("skip"===t)return e.visit(function(e){e.match=!1},!0),"skip";t||!i&&"branch"!==t||!e.parent.match||(n=t=!0),t&&(l++,e.match=!0,e.visitParents(function(e){e.subMatchCount+=1,!p.autoExpand||n||e.expanded||(e.setExpanded(!0,{noAnimation:!0,noEvents:!0,scrollIntoView:!1}),e._filterAutoExpanded=!0)}))}}),d.autoCollapse=u,0===l&&p.nodata&&h&&(n=p.nodata,g.isFunction(n)&&(n=n()),!0===n?n={}:"string"==typeof n&&(n={title:n}),n=g.extend({statusNodeType:"nodata",key:y,title:this.options.strings.noData},n),this.getRootNode().addNode(n).match=!0),this.render(),l},g.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)},g.ui.fancytree._FancytreeClass.prototype.applyFilter=function(e){return this.warn("Fancytree.applyFilter() is deprecated since 2.1.0 / 2014-05-29. Use .filterNodes() instead."),this.filterNodes.apply(this,arguments)},g.ui.fancytree._FancytreeClass.prototype.filterBranches=function(e,t){return this._applyFilterImpl(e,!0,t)},g.ui.fancytree._FancytreeClass.prototype.clearFilter=function(){var t,e=this.getRootNode()._findDirectChild(y),n=this.options.escapeTitles,r=this.options.enhanceTitle;e&&e.remove(),this.visit(function(e){e.match&&e.span&&(t=g(e.span).find(">span.fancytree-title"),n?t.text(e.title):t.html(e.title),r&&r({type:"enhanceTitle"},{node:e,$title:t})),delete e.match,delete e.subMatchCount,delete e.titleWithHighlight,e.$subMatchBadge&&(e.$subMatchBadge.remove(),delete e.$subMatchBadge),e._filterAutoExpanded&&e.expanded&&e.setExpanded(!1,{noAnimation:!0,noEvents:!0,scrollIntoView:!1}),delete e._filterAutoExpanded}),this.enableFilter=!1,this.lastFilterArgs=null,this.$div.removeClass("fancytree-ext-filter fancytree-ext-filter-dimm fancytree-ext-filter-hide"),this.render()},g.ui.fancytree._FancytreeClass.prototype.isFilterActive=function(){return!!this.enableFilter},g.ui.fancytree._FancytreeNodeClass.prototype.isMatched=function(){return!(this.tree.enableFilter&&!this.match)},g.ui.fancytree.registerExtension({name:"filter",version:"2.27.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){return this._superApply(arguments).done(function(){e.tree.enableFilter&&e.tree.lastFilterArgs&&e.options.filter.autoApply&&e.tree._applyFilterImpl.apply(e.tree,e.tree.lastFilterArgs)})},nodeSetExpanded:function(e,t,n){return delete e.node._filterAutoExpanded,!t&&e.options.filter.hideExpandedCounter&&e.node.$subMatchBadge&&e.node.$subMatchBadge.show(),this._superApply(arguments)},nodeRenderStatus:function(e){var t,n=e.node,r=e.tree,i=e.options.filter,o=g(n.span).find("span.fancytree-title"),a=g(n[r.statusClassPropName]),s=e.options.enhanceTitle,l=e.options.escapeTitles;return t=this._super(e),a.length&&r.enableFilter&&(a.toggleClass("fancytree-match",!!n.match).toggleClass("fancytree-submatch",!!n.subMatchCount).toggleClass("fancytree-hide",!(n.match||n.subMatchCount)),!i.counter||!n.subMatchCount||n.isExpanded()&&i.hideExpandedCounter?n.$subMatchBadge&&n.$subMatchBadge.hide():(n.$subMatchBadge||(n.$subMatchBadge=g("<span class='fancytree-childcounter'/>"),g("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?o.html(n.titleWithHighlight):l?o.text(n.title):o.html(n.title),s&&s({type:"enhanceTitle"},{node:n,$title:o}))),t}}),g.ui.fancytree}),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(l){"use strict";var s=l.ui.fancytree,r={awesome3:{_addClass:"",checkbox:"icon-check-empty",checkboxSelected:"icon-check",checkboxUnknown:"icon-check icon-muted",dragHelper:"icon-caret-right",dropMarker:"icon-caret-right",error:"icon-exclamation-sign",expanderClosed:"icon-caret-right",expanderLazy:"icon-angle-right",expanderOpen:"icon-caret-down",loading:"icon-refresh icon-spin",nodata:"icon-meh",noExpander:"",radio:"icon-circle-blank",radioSelected:"icon-circle",doc:"icon-file-alt",docOpen:"icon-file-alt",folder:"icon-folder-close-alt",folderOpen:"icon-folder-open-alt"},awesome4:{_addClass:"fa",checkbox:"fa-square-o",checkboxSelected:"fa-check-square-o",checkboxUnknown:"fa-square",dragHelper:"fa-arrow-right",dropMarker:"fa-long-arrow-right",error:"fa-warning",expanderClosed:"fa-caret-right",expanderLazy:"fa-angle-right",expanderOpen:"fa-caret-down",loading:"fa-spinner fa-pulse",nodata:"fa-meh-o",noExpander:"",radio:"fa-circle-thin",radioSelected:"fa-circle",doc:"fa-file-o",docOpen:"fa-file-o",folder:"fa-folder-o",folderOpen:"fa-folder-open-o"},bootstrap3:{_addClass:"glyphicon",checkbox:"glyphicon-unchecked",checkboxSelected:"glyphicon-check",checkboxUnknown:"glyphicon-expand",dragHelper:"glyphicon-play",dropMarker:"glyphicon-arrow-right",error:"glyphicon-warning-sign",expanderClosed:"glyphicon-menu-right",expanderLazy:"glyphicon-menu-right",expanderOpen:"glyphicon-menu-down",loading:"glyphicon-refresh glyphicon-spin",nodata:"glyphicon-info-sign",noExpander:"",radio:"glyphicon-remove-circle",radioSelected:"glyphicon-ok-circle",doc:"glyphicon-file",docOpen:"glyphicon-file",folder:"glyphicon-folder-close",folderOpen:"glyphicon-folder-open"},material:{_addClass:"material-icons",checkbox:{text:"check_box_outline_blank"},checkboxSelected:{text:"check_box"},checkboxUnknown:{text:"indeterminate_check_box"},dragHelper:{text:"play_arrow"},dropMarker:{text:"arrow-forward"},error:{text:"warning"},expanderClosed:{text:"chevron_right"},expanderLazy:{text:"last_page"},expanderOpen:{text:"expand_more"},loading:{text:"autorenew",addClass:"glyphicon-spin"},nodata:{text:"info"},noExpander:{text:""},radio:{text:"radio_button_unchecked"},radioSelected:{text:"radio_button_checked"},doc:{text:"insert_drive_file"},docOpen:{text:"insert_drive_file"},folder:{text:"folder"},folderOpen:{text:"folder_open"}}};function d(e,t,n,r){var i=n.map,o=i[r],a=l(e),s=t+" "+(i._addClass||"");"string"==typeof o?a.attr("class",s+" "+o):(o.text&&a.text(""+o.text),a.attr("class",s+" "+(o.addClass||"")))}return l.ui.fancytree.registerExtension({name:"glyph",version:"2.27.0",options:{preset:null,map:{}},treeInit:function(e){var t=e.tree,n=e.options.glyph;n.preset?(s.assert(!!r[n.preset],"Invalid value for `options.glyph.preset`: "+n.preset),n.map=l.extend({},r[n.preset],n.map)):t.warn("ext-glyph: missing `preset` option."),this._superApply(arguments),t.$container.addClass("fancytree-ext-glyph")},nodeRenderStatus:function(e){var t,n,r,i=e.node,o=l(i.span),a=e.options.glyph;return n=this._super(e),i.isRoot()||((r=o.children("span.fancytree-expander").get(0))&&d(r,"fancytree-expander",a,i.expanded&&i.hasChildren()?"expanderOpen":i.isUndefined()?"expanderLazy":i.hasChildren()?"expanderClosed":"noExpander"),(r=i.tr?l("td",i.tr).find("span.fancytree-checkbox").get(0):o.children("span.fancytree-checkbox").get(0))&&(t=s.evalOption("checkbox",i,i,a,!1),i.parent&&i.parent.radiogroup||"radio"===t?d(r,"fancytree-checkbox fancytree-radio",a,i.selected?"radioSelected":"radio"):d(r,"fancytree-checkbox",a,i.selected?"checkboxSelected":i.partsel?"checkboxUnknown":"checkbox")),(r=o.children("span.fancytree-icon").get(0))&&d(r,"fancytree-icon",a,i.statusNodeType?i.statusNodeType:i.folder?i.expanded&&i.hasChildren()?"folderOpen":"folder":i.expanded?"docOpen":"doc")),n},nodeSetStatus:function(e,t,n,r){var i,o,a=e.options.glyph,s=e.node;return i=this._superApply(arguments),"error"!==t&&"loading"!==t&&"nodata"!==t||(s.parent?(o=l("span.fancytree-expander",s.span).get(0))&&d(o,"fancytree-expander",a,t):(o=l(".fancytree-statusnode-"+t,s[this.nodeContainerAttrName]).find("span.fancytree-icon").get(0))&&d(o,"fancytree-icon",a,t)),i}}),l.ui.fancytree}),function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.fancytree","./jquery.fancytree.table"],e):"object"==typeof module&&module.exports?(require("./jquery.fancytree.table"),module.exports=e(require("jquery"))):e(jQuery)}(function(c){"use strict";var u=c.ui.keyCode,s={text:[u.UP,u.DOWN],checkbox:[u.UP,u.DOWN,u.LEFT,u.RIGHT],link:[u.UP,u.DOWN,u.LEFT,u.RIGHT],radiobutton:[u.UP,u.DOWN,u.LEFT,u.RIGHT],"select-one":[u.LEFT,u.RIGHT],"select-multiple":[u.LEFT,u.RIGHT]};function p(e,t){var n,r=null,i=0;return e.children().each(function(){if(t<=i)return r=c(this),!1;n=c(this).prop("colspan"),i+=n||1}),r}function l(e,t){var n,r,i,o,a,s,l=e.closest("td"),d=null;switch(t){case u.LEFT:d=l.prev();break;case u.RIGHT:d=l.next();break;case u.UP:case u.DOWN:for(n=l.parent(),i=n,a=l.get(0),s=0,i.children().each(function(){if(this===a)return!1;o=c(this).prop("colspan"),s+=o||1}),r=s;(n=t===u.UP?n.prev():n.next()).length&&(n.is(":hidden")||!(d=p(n,r))||!d.find(":input,a").length););}return d}return c.ui.fancytree.registerExtension({name:"gridnav",version:"2.27.0",options:{autofocusInput:!1,handleCursorKeys:!0},treeInit:function(r){this._requireExtension("table",!0,!0),this._superApply(arguments),this.$container.addClass("fancytree-ext-gridnav"),this.$container.on("focusin",function(e){var t,n=c.ui.fancytree.getNode(e.target);n&&!n.isActive()&&(t=r.tree._makeHookContext(n,e),r.tree._callHook("nodeSetActive",t,!0))})},nodeSetActive:function(e,t,n){var r=e.options.gridnav,i=e.node,o=e.originalEvent||{},a=c(o.target).is(":input");t=!1!==t,this._superApply(arguments),t&&(e.options.titlesTabbable?(a||(c(i.span).find("span.fancytree-title").focus(),i.setFocus()),e.tree.$container.attr("tabindex","-1")):r.autofocusInput&&!a&&c(i.tr||i.span).find(":input:enabled:first").focus())},nodeKeydown:function(e){var t,n,r,i=e.options.gridnav,o=e.originalEvent,a=c(o.target);return a.is(":input:enabled")?t=a.prop("type"):a.is("a")&&(t="link"),t&&i.handleCursorKeys?!((n=s[t])&&0<=c.inArray(o.which,n)&&(r=l(a,o.which))&&r.length)||(r.find(":input:enabled,a").focus(),!1):this._superApply(arguments)}}),c.ui.fancytree}),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(f){"use strict";var t=null,n=window.localStorage?{get:function(e){return window.localStorage.getItem(e)},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)}}:null,r=window.sessionStorage?{get:function(e){return window.sessionStorage.getItem(e)},set:function(e,t){window.sessionStorage.setItem(e,t)},remove:function(e){window.sessionStorage.removeItem(e)}}:null,i=f.ui.fancytree.assert,u="active",g="expanded",p="focus",h="selected";return"function"==typeof Cookies?t={get:Cookies.get,set:function(e,t){Cookies.set(e,t,this.options.persist.cookie)},remove:Cookies.remove}:f&&"function"==typeof f.cookie&&(t={get:f.cookie,set:function(e,t){f.cookie.set(e,t,this.options.persist.cookie)},remove:f.removeCookie}),f.ui.fancytree._FancytreeClass.prototype.clearData=function(e){var t=this.ext.persist,n=t.cookiePrefix;0<=(e=e||"active expanded focus selected").indexOf(u)&&t._data(n+u,null),0<=e.indexOf(g)&&t._data(n+g,null),0<=e.indexOf(p)&&t._data(n+p,null),0<=e.indexOf(h)&&t._data(n+h,null)},f.ui.fancytree._FancytreeClass.prototype.clearCookies=function(e){return this.warn("'tree.clearCookies()' is deprecated since v2.27.0: use 'clearData()' instead."),this.clearData(e)},f.ui.fancytree._FancytreeClass.prototype.getPersistData=function(){var e=this.ext.persist,t=e.cookiePrefix,n=e.cookieDelimiter,r={};return r[u]=e._data(t+u),r[g]=(e._data(t+g)||"").split(n),r[h]=(e._data(t+h)||"").split(n),r[p]=e._data(t+p),r},f.ui.fancytree.registerExtension({name:"persist",version:"2.27.0",options:{cookieDelimiter:"~",cookiePrefix:void 0,cookie:{raw:!1,expires:"",path:"",domain:"",secure:!1},expandLazy:!1,expandOpts:void 0,fireActivate:!0,overrideSource:!0,store:"auto",types:"active expanded focus selected"},_data:function(e,t){var n=this._local.store;if(void 0===t)return n.get.call(this,e);null===t?n.remove.call(this,e):n.set.call(this,e,t)},_appendKey:function(e,t,n){t=""+t;var r=this._local,i=this.options.persist.cookieDelimiter,o=r.cookiePrefix+e,a=r._data(o),s=a?a.split(i):[],l=f.inArray(t,s);0<=l&&s.splice(l,1),n&&s.push(t),r._data(o,s.join(i))},treeInit:function(e){var s=e.tree,l=e.options,d=this._local,c=this.options.persist;return d.cookiePrefix=c.cookiePrefix||"fancytree-"+s._id+"-",d.storeActive=0<=c.types.indexOf(u),d.storeExpanded=0<=c.types.indexOf(g),d.storeSelected=0<=c.types.indexOf(h),d.storeFocus=0<=c.types.indexOf(p),d.store=null,"auto"===c.store&&(c.store=n?"local":"cookie"),f.isPlainObject(c.store)?d.store=c.store:"cookie"===c.store?d.store=t:"local"===c.store?d.store="local"===c.store?n:r:"session"===c.store&&(d.store="local"===c.store?n:r),i(d.store,"Need a valid store."),s.$div.on("fancytreeinit",function(e){if(!1!==s._triggerTreeEvent("beforeRestore",null,{})){var t,n,r,i,o=d._data(d.cookiePrefix+p),a=!1===c.fireActivate;t=d._data(d.cookiePrefix+g),r=t&&t.split(c.cookieDelimiter),(d.storeExpanded?function e(t,n,r,i,o){var a,s,l,d,c=!1,u=t.options.persist.expandOpts,p=[],h=[];for(r=r||[],o=o||f.Deferred(),a=0,l=r.length;a<l;a++)s=r[a],(d=t.getNodeByKey(s))?i&&d.isUndefined()?(c=!0,t.debug("_loadLazyNodes: "+d+" is lazy: loading..."),"expand"===i?p.push(d.setExpanded(!0,u)):p.push(d.load())):(t.debug("_loadLazyNodes: "+d+" already loaded."),d.setExpanded(!0,u)):(h.push(s),t.debug("_loadLazyNodes: "+d+" was not yet found."));return f.when.apply(f,p).always(function(){if(c&&0<h.length)e(t,n,h,i,o);else{if(h.length)for(t.warn("_loadLazyNodes: could not load those keys: ",h),a=0,l=h.length;a<l;a++)s=r[a],n._appendKey(g,r[a],!1);o.resolve()}}),o}(s,d,r,!!c.expandLazy&&"expand",null):(new f.Deferred).resolve()).done(function(){if(d.storeSelected){if(t=d._data(d.cookiePrefix+h))for(r=t.split(c.cookieDelimiter),n=0;n<r.length;n++)(i=s.getNodeByKey(r[n]))?(void 0===i.selected||c.overrideSource&&!1===i.selected)&&(i.selected=!0,i.renderStatus()):d._appendKey(h,r[n],!1);3===s.options.selectMode&&s.visit(function(e){if(e.selected)return e.fixSelection3AfterClick(),"skip"})}d.storeActive&&(!(t=d._data(d.cookiePrefix+u))||!l.persist.overrideSource&&s.activeNode||(i=s.getNodeByKey(t))&&(i.debug("persist: set active",t),i.setActive(!0,{noFocus:!0,noEvents:a}))),d.storeFocus&&o&&(i=s.getNodeByKey(o))&&(s.options.titlesTabbable?f(i.span).find(".fancytree-title").focus():f(s.$container).focus()),s._triggerTreeEvent("restore",null,{})})}}),this._superApply(arguments)},nodeSetActive:function(e,t,n){var r,i=this._local;return t=!1!==t,r=this._superApply(arguments),i.storeActive&&i._data(i.cookiePrefix+u,this.activeNode?this.activeNode.key:null),r},nodeSetExpanded:function(e,t,n){var r,i=e.node,o=this._local;return t=!1!==t,r=this._superApply(arguments),o.storeExpanded&&o._appendKey(g,i.key,t),r},nodeSetFocus:function(e,t){var n,r=this._local;return t=!1!==t,n=this._superApply(arguments),r.storeFocus&&r._data(r.cookiePrefix+p,this.focusNode?this.focusNode.key:null),n},nodeSetSelected:function(e,t,n){var r,i,o=e.tree,a=e.node,s=this._local;return t=!1!==t,r=this._superApply(arguments),s.storeSelected&&(3===o.options.selectMode?(i=(i=f.map(o.getSelectedNodes(!0),function(e){return e.key})).join(e.options.persist.cookieDelimiter),s._data(s.cookiePrefix+h,i)):s._appendKey(h,a.key,a.selected)),r}}),f.ui.fancytree}),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(C){"use strict";function k(e,t){t=t||"",e||C.error("Assertion failed "+t)}function _(e,n){e.visit(function(e){var t=e.tr;if(t&&(t.style.display=e.hide||!n?"none":""),!e.expanded)return"skip"})}return C.ui.fancytree.registerExtension({name:"table",version:"2.27.0",options:{checkboxColumnIdx:null,indentation:16,nodeColumnIdx:0},treeInit:function(e){var t,n,r,i,o,a=e.tree,s=e.options,l=s.table,d=a.widget.element;if(null!=l.customStatus&&(null!=s.renderStatusColumns?C.error("The 'customStatus' option is deprecated since v2.15.0. Use 'renderStatusColumns' only instead."):(a.warn("The 'customStatus' option is deprecated since v2.15.0. Use 'renderStatusColumns' instead."),s.renderStatusColumns=l.customStatus)),s.renderStatusColumns&&!0===s.renderStatusColumns&&(s.renderStatusColumns=s.renderColumns),d.addClass("fancytree-container fancytree-ext-table"),(o=d.find(">tbody")).length||(d.find(">tr").length&&C.error("Expected table > tbody > tr. If you see this please open an issue."),o=C("<tbody>").appendTo(d)),a.tbody=o[0],n=C("thead >tr:last >th",d).length,(i=o.children("tr:first")).length)r=i.children("td").length,n&&r!==n&&(a.warn("Column count mismatch between thead ("+n+") and tbody ("+r+"): using tbody."),n=r),i=i.clone();else for(k(1<=n,"Need either <thead> or <tbody> with <td> elements to determine column count."),i=C("<tr />"),t=0;t<n;t++)i.append("<td />");i.find(">td").eq(l.nodeColumnIdx).html("<span class='fancytree-node' />"),s.aria&&(i.attr("role","row"),i.find("td").attr("role","gridcell")),a.rowFragment=document.createDocumentFragment(),a.rowFragment.appendChild(i.get(0)),o.empty(),a.statusClassPropName="tr",a.ariaPropName="tr",this.nodeContainerAttrName="tr",a.$container=d,this._superApply(arguments),C(a.rootNode.ul).remove(),a.rootNode.ul=null,this.$container.attr("tabindex",s.tabindex),s.aria&&a.$container.attr("role","treegrid").attr("aria-readonly",!0)},nodeRemoveChildMarkup:function(e){e.node.visit(function(e){e.tr&&(C(e.tr).remove(),e.tr=null)})},nodeRemoveMarkup:function(e){var t=e.node;t.tr&&(C(t.tr).remove(),t.tr=null),this.nodeRemoveChildMarkup(e)},nodeRender:function(e,t,n,r,i){var o,a,s,l,d,c,u,p,h=e.tree,f=e.node,g=e.options,y=!f.parent;if(!1!==h._enableUpdate){if(i||(e.hasCollapsedParents=f.parent&&!f.parent.expanded),!y)if(f.tr&&t&&this.nodeRemoveMarkup(e),f.tr)t?this.nodeRenderTitle(e):this.nodeRenderStatus(e);else{if(e.hasCollapsedParents&&!n)return;d=h.rowFragment.firstChild.cloneNode(!0),k(c=function(e){var t,n,r=e.parent,i=r?r.children:null;if(i&&1<i.length&&i[0]!==e)for(k((n=i[C.inArray(e,i)-1]).tr);n.children&&n.children.length&&(t=n.children[n.children.length-1]).tr;)n=t;else n=r;return n}(f)),!0===r&&i?d.style.display="none":n&&e.hasCollapsedParents&&(d.style.display="none"),c.tr?(v=c.tr,m=d,v.parentNode.insertBefore(m,v.nextSibling)):(k(!c.parent,"prev. row must have a tr, or be system root"),x=h.tbody,b=d,x.insertBefore(b,x.firstChild)),f.tr=d,f.key&&g.generateIds&&(f.tr.id=g.idPrefix+f.key),(f.tr.ftnode=f).span=C("span.fancytree-node",f.tr).get(0),this.nodeRenderTitle(e),g.createNode&&g.createNode.call(h,{type:"createNode"},e)}var v,m,x,b;if(g.renderNode&&g.renderNode.call(h,{type:"renderNode"},e),(o=f.children)&&(y||n||f.expanded))for(s=0,l=o.length;s<l;s++)(p=C.extend({},e,{node:o[s]})).hasCollapsedParents=p.hasCollapsedParents||!f.expanded,this.nodeRender(p,t,n,r,!0);o&&!i&&(u=f.tr||null,a=h.tbody.firstChild,f.visit(function(e){if(e.tr){if(e.parent.expanded||"none"===e.tr.style.display||(e.tr.style.display="none",_(e,!1)),e.tr.previousSibling!==u){f.debug("_fixOrder: mismatch at node: "+e);var t=u?u.nextSibling:a;h.tbody.insertBefore(e.tr,t)}u=e.tr}}))}},nodeRenderTitle:function(e,t){var n,r,i=e.node,o=e.options,a=i.isStatusNode();return r=this._super(e,t),i.isRootNode()||(o.checkbox&&!a&&null!=o.table.checkboxColumnIdx&&(n=C("span.fancytree-checkbox",i.span),C(i.tr).find("td").eq(+o.table.checkboxColumnIdx).html(n)),this.nodeRenderStatus(e),a?o.renderStatusColumns&&o.renderStatusColumns.call(e.tree,{type:"renderStatusColumns"},e):o.renderColumns&&o.renderColumns.call(e.tree,{type:"renderColumns"},e)),r},nodeRenderStatus:function(e){var t,n=e.node,r=e.options;this._super(e),C(n.tr).removeClass("fancytree-node"),t=(n.getLevel()-1)*r.table.indentation,C(n.span).css({paddingLeft:t+"px"})},nodeSetExpanded:function(t,n,r){if(n=!1!==n,t.node.expanded&&n||!t.node.expanded&&!n)return this._superApply(arguments);var i=new C.Deferred,e=C.extend({},r,{noEvents:!0,noAnimation:!0});function o(e){_(t.node,n),e?n&&t.options.autoScroll&&!r.noAnimation&&t.node.hasChildren()?t.node.getLastChild().scrollIntoView(!0,{topNode:t.node}).always(function(){r.noEvents||t.tree._triggerNodeEvent(n?"expand":"collapse",t),i.resolveWith(t.node)}):(r.noEvents||t.tree._triggerNodeEvent(n?"expand":"collapse",t),i.resolveWith(t.node)):(r.noEvents||t.tree._triggerNodeEvent(n?"expand":"collapse",t),i.rejectWith(t.node))}return r=r||{},this._super(t,n,e).done(function(){o(!0)}).fail(function(){o(!1)}),i.promise()},nodeSetStatus:function(e,t,n,r){if("ok"===t){var i=e.node,o=i.children?i.children[0]:null;o&&o.isStatusNode()&&C(o.tr).remove()}return this._superApply(arguments)},treeClear:function(e){return this.nodeRemoveChildMarkup(this._makeHookContext(this.rootNode)),this._superApply(arguments)},treeDestroy:function(e){return this.$container.find("tbody").empty(),this.$source&&this.$source.removeClass("ui-helper-hidden"),this._superApply(arguments)}}),C.ui.fancytree}),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(o){"use strict";return o.ui.fancytree.registerExtension({name:"themeroller",version:"2.27.0",options:{activeClass:"ui-state-active",addClass:"ui-corner-all",focusClass:"ui-state-focus",hoverClass:"ui-state-hover",selectedClass:"ui-state-highlight"},treeInit:function(e){var t=e.widget.element,r=e.options.themeroller;this._superApply(arguments),"TABLE"===t[0].nodeName?(t.addClass("ui-widget ui-corner-all"),t.find(">thead tr").addClass("ui-widget-header"),t.find(">tbody").addClass("ui-widget-conent")):t.addClass("ui-widget ui-widget-content ui-corner-all"),t.delegate(".fancytree-node","mouseenter mouseleave",function(e){var t=o.ui.fancytree.getNode(e.target),n="mouseenter"===e.type;o(t.tr?t.tr:t.span).toggleClass(r.hoverClass+" "+r.addClass,n)})},treeDestroy:function(e){this._superApply(arguments),e.widget.element.removeClass("ui-widget ui-widget-content ui-corner-all")},nodeRenderStatus:function(e){var t={},n=e.node,r=o(n.tr?n.tr:n.span),i=e.options.themeroller;this._super(e),t[i.activeClass]=!1,t[i.focusClass]=!1,t[i.selectedClass]=!1,n.isActive()&&(t[i.activeClass]=!0),n.hasFocus()&&(t[i.focusClass]=!0),n.isSelected()&&!n.isActive()&&(t[i.selectedClass]=!0),r.toggleClass(i.activeClass,t[i.activeClass]),r.toggleClass(i.focusClass,t[i.focusClass]),r.toggleClass(i.selectedClass,t[i.selectedClass]),r.addClass(i.addClass)}}),o.ui.fancytree}),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(f){"use strict";var g=/^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;function y(e,t){var n=f("#"+(e="fancytree-style-"+e));if(!t)return n.remove(),null;n.length||(n=f("<style />").attr("id",e).addClass("fancytree-style").prop("type","text/css").appendTo("head"));try{n.html(t)}catch(e){n[0].styleSheet.cssText=t}return n}function v(e,t,n,r,i,o){var a,s="#"+e+" span.fancytree-level-",l=[];for(a=0;a<t;a++)l.push(s+(a+1)+" span.fancytree-title { padding-left: "+(a*n+r)+o+"; }");return l.push("#"+e+" div.ui-effects-wrapper ul li span.fancytree-title, #"+e+" li.fancytree-animating span.fancytree-title { padding-left: "+i+o+"; position: static; width: auto; }"),l.join("\n")}return f.ui.fancytree.registerExtension({name:"wide",version:"2.27.0",options:{iconWidth:null,iconSpacing:null,labelSpacing:null,levelOfs:null},treeCreate:function(e){this._superApply(arguments),this.$container.addClass("fancytree-ext-wide");var t,n,r,i,o,a=e.options.wide,s=f("<li id='fancytreeTemp'><span class='fancytree-node'><span class='fancytree-icon' /><span class='fancytree-title' /></span><ul />").appendTo(e.tree.$container),l=s.find(".fancytree-icon"),d=s.find("ul"),c=a.iconSpacing||l.css("margin-left"),u=a.iconWidth||l.css("width"),p=a.labelSpacing||"3px",h=a.levelOfs||d.css("padding-left");s.remove(),n=c.match(g)[2],c=parseFloat(c,10),r=p.match(g)[2],p=parseFloat(p,10),i=u.match(g)[2],u=parseFloat(u,10),o=h.match(g)[2],n===i&&o===i&&r===i||f.error("iconWidth, iconSpacing, and levelOfs must have the same css measure unit"),this._local.measureUnit=i,this._local.levelOfs=parseFloat(h),this._local.lineOfs=(1+(e.options.checkbox?1:0)+(!1===e.options.icon?0:1))*(u+c)+c,this._local.labelOfs=p,this._local.maxDepth=10,y(t=this.$container.uniqueId().attr("id"),v(t,this._local.maxDepth,this._local.levelOfs,this._local.lineOfs,this._local.labelOfs,this._local.measureUnit))},treeDestroy:function(e){return y(this.$container.attr("id"),null),this._superApply(arguments)},nodeRenderStatus:function(e){var t,n,r=e.node,i=r.getLevel();return n=this._super(e),i>this._local.maxDepth&&(t=this.$container.attr("id"),this._local.maxDepth*=2,r.debug("Define global ext-wide css up to level "+this._local.maxDepth),y(t,v(t,this._local.maxDepth,this._local.levelOfs,this._local.lineOfs,this._local.labelSpacing,this._local.measureUnit))),f(r.span).addClass("fancytree-level-"+i),n}}),f.ui.fancytree});
|
||
//# sourceMappingURL=jquery.fancytree-all.min.js.map
|