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