-
Notifications
You must be signed in to change notification settings - Fork 18
/
kalikocms.admin.core.min.js
55 lines (55 loc) · 224 KB
/
kalikocms.admin.core.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*!
* Bootstrap v3.2.0 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
function warnBeforeLeavingIfChangesBeenMade(){$("input").change(function(){window.warningRegistered!==!0&&(window.onbeforeunload=function(){return"There might be changes that will be lost!"},window.warningRegistered=!0)});$(".form-actions a").click(function(){window.onbeforeunload=null});$(".form-actions button").click(function(){window.onbeforeunload=null});$(".form-actions input").click(function(){window.onbeforeunload=null})}function initHtmlEditor(n){tinymce.init({skin_url:n+"vendors/tinymce/skins/lightgray",selector:"textarea.html-editor",plugins:["advlist autolink lists link image charmap anchor","searchreplace visualblocks code hr","media table contextmenu paste"],resize:!0,height:300,menu:{edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},insert:{title:"Insert",items:"link image media | charmap anchor hr"},view:{title:"View",items:"visualaid visualblocks"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript | formats | removeformat"},table:{title:"Table",items:"inserttable tableprops deletetable | cell row column"},tools:{title:"Tools",items:"code"}},paste_data_images:!0,extended_valid_elements:"i[class],span,span[class]",convert_urls:!1,relative_urls:!1,toolbar:"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | code",file_picker_callback:function(n,t,i){i.filetype==="file"&&(top.registerCallback(function(t){n(t)}),top.propertyEditor.dialogs.openSelectLinkDialog(t,0));i.filetype==="image"&&(top.registerCallback(function(t,i,r,u,f,e,o){n(t,{alt:o})}),top.propertyEditor.dialogs.openEditImageDialog(t,t,"","","","","","",""))}})}function initMarkdownEditor(){$(".markdown-editor").markdown({savable:!1,iconlibrary:"fa-3",reorderButtonGroups:["groupHeaders","groupFont","groupLink","groupMisc","groupExtras","groupUtil","groupHelp"],onPreview:function(n){var t="";return jQuery.ajax({type:"POST",url:"Handlers/MarkdownHandler.ashx",data:{markdown:n.getContent()},success:function(n){t=n},error:function(){alert("Could not preview the Markdown, please check the syntax.")},async:!1}),t}})}function initDropDowns(){$("select.selectbox").each(function(){var n=$(this),t;t=n.hasClass("dropdown--enhanced")?renderEnhancedOption:n.hasClass("dropdown--full")?renderFullOption:renderSimpleOption;n.selectric({optionsItemBuilder:function(n,i){var r=i.attr("data-description"),u=i.attr("data-image");return t(n.text,r,u)},labelBuilder:function(n){var i=n.element.attr("data-description"),r=n.element.attr("data-image");return t(n.text,i,r)}})})}function renderSimpleOption(n){return n}function renderEnhancedOption(n,t){return'<div><div class="dropdown__title">'+n+'<\/div><div class="dropdown__description">'+t+"<\/div><\/div>"}function renderFullOption(n,t,i){return'<div class="dropdown__item"><div><img src="'+i+'" class="dropdown__image" /><\/div><div class="dropdown__block"><div class="dropdown__title">'+n+'<\/div><div class="dropdown__description">'+t+"<\/div><\/div><\/div>"}if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(n){"use strict";function t(){var i=document.createElement("bootstrap"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(void 0!==i.style[t])return{end:n[t]};return!1}n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one("bsTransitionEnd",function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){n.support.transition=t();n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery);+function(n){"use strict";function u(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));"string"==typeof i&&u[i].call(r)})}var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.VERSION="3.2.0";t.prototype.close=function(t){function f(){i.detach().trigger("closed.bs.alert").remove()}var u=n(this),r=u.attr("data-target"),i;r||(r=u.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));i=n(r);t&&t.preventDefault();i.length||(i=u.hasClass("alert")?u:u.parent());i.trigger(t=n.Event("close.bs.alert"));t.isDefaultPrevented()||(i.removeClass("in"),n.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",f).emulateTransitionEnd(150):f())};r=n.fn.alert;n.fn.alert=u;n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f="object"==typeof i&&i;r||u.data("bs.button",r=new t(this,f));"toggle"==i?r.toggle():i&&r.setState(i)})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.isLoading=!1},r;t.VERSION="3.2.0";t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(t){var r="disabled",i=this.$element,f=i.is("input")?"val":"html",u=i.data();t+="Text";null==u.resetText&&i.data("resetText",i[f]());i[f](null==u[t]?this.options[t]:u[t]);setTimeout(n.proxy(function(){"loadingText"==t?(this.isLoading=!0,i.addClass(r).attr(r,r)):this.isLoading&&(this.isLoading=!1,i.removeClass(r).removeAttr(r))},this),0)};t.prototype.toggle=function(){var t=!0,i=this.$element.closest('[data-toggle="buttons"]'),n;i.length&&(n=this.$element.find("input"),"radio"==n.prop("type")&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:i.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change"));t&&this.$element.toggleClass("active")};r=n.fn.button;n.fn.button=i;n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=r,this};n(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var r=n(t.target);r.hasClass("btn")||(r=r.closest(".btn"));i.call(r,"toggle");t.preventDefault()})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i),e="string"==typeof i?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));"number"==typeof i?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})}var t=function(t,i){this.$element=n(t).on("keydown.bs.carousel",n.proxy(this.keydown,this));this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=this.sliding=this.interval=this.$active=this.$items=null;"hover"==this.options.pause&&this.$element.on("mouseenter.bs.carousel",n.proxy(this.pause,this)).on("mouseleave.bs.carousel",n.proxy(this.cycle,this))},r;t.VERSION="3.2.0";t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0};t.prototype.keydown=function(n){switch(n.which){case 37:this.prev();break;case 39:this.next();break;default:return}n.preventDefault()};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getItemIndex=function(n){return this.$items=n.parent().children(".item"),this.$items.index(n||this.$active)};t.prototype.to=function(t){var r=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1)&&!(0>t))return this.sliding?this.$element.one("slid.bs.carousel",function(){r.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",n(this.$items[t]))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(t,i){var u=this.$element.find(".item.active"),r=i||u[t](),c=this.interval,f="next"==t?"left":"right",a="next"==t?"first":"last",l=this,e,o,s,h;if(!r.length){if(!this.options.wrap)return;r=this.$element.find(".item")[a]()}return r.hasClass("active")?this.sliding=!1:(e=r[0],o=n.Event("slide.bs.carousel",{relatedTarget:e,direction:f}),(this.$element.trigger(o),!o.isDefaultPrevented())?((this.sliding=!0,c&&this.pause(),this.$indicators.length)&&(this.$indicators.find(".active").removeClass("active"),s=n(this.$indicators.children()[this.getItemIndex(r)]),s&&s.addClass("active")),h=n.Event("slid.bs.carousel",{relatedTarget:e,direction:f}),n.support.transition&&this.$element.hasClass("slide")?(r.addClass(t),r[0].offsetWidth,u.addClass(f),r.addClass(f),u.one("bsTransitionEnd",function(){r.removeClass([t,f].join(" ")).addClass("active");u.removeClass(["active",f].join(" "));l.sliding=!1;setTimeout(function(){l.$element.trigger(h)},0)}).emulateTransitionEnd(1e3*u.css("transition-duration").slice(0,-1))):(u.removeClass("active"),r.addClass("active"),this.sliding=!1,this.$element.trigger(h)),c&&this.cycle(),this):void 0)};r=n.fn.carousel;n.fn.carousel=i;n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=r,this};n(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(t){var o,r=n(this),u=n(r.attr("data-target")||(o=r.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,"")),e,f;u.hasClass("carousel")&&(e=n.extend({},u.data(),r.data()),f=r.attr("data-slide-to"),f&&(e.interval=!1),i.call(u,e),f&&u.data("bs.carousel").to(f),t.preventDefault())});n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i);!r&&f.toggle&&"show"==i&&(i=!i);r||u.data("bs.collapse",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.transitioning=null;this.options.parent&&(this.$parent=n(this.options.parent));this.options.toggle&&this.toggle()},r;t.VERSION="3.2.0";t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){var n=this.$element.hasClass("width");return n?"width":"height"};t.prototype.show=function(){var f,t,u,r,e,o;if(!this.transitioning&&!this.$element.hasClass("in")&&(f=n.Event("show.bs.collapse"),this.$element.trigger(f),!f.isDefaultPrevented())){if(t=this.$parent&&this.$parent.find("> .panel > .in"),t&&t.length){if(u=t.data("bs.collapse"),u&&u.transitioning)return;i.call(t,"hide");u||t.data("bs.collapse",null)}if(r=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[r](0),this.transitioning=1,e=function(){this.$element.removeClass("collapsing").addClass("collapse in")[r]("");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return e.call(this);o=n.camelCase(["scroll",r].join("-"));this.$element.one("bsTransitionEnd",n.proxy(e,this)).emulateTransitionEnd(350)[r](this.$element[0][o])}};t.prototype.hide=function(){var i,t,r;if(!this.transitioning&&this.$element.hasClass("in")&&(i=n.Event("hide.bs.collapse"),this.$element.trigger(i),!i.isDefaultPrevented()))return t=this.dimension(),this.$element[t](this.$element[t]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1,r=function(){this.transitioning=0;this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")},n.support.transition?void this.$element[t](0).one("bsTransitionEnd",n.proxy(r,this)).emulateTransitionEnd(350):r.call(this)};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};r=n.fn.collapse;n.fn.collapse=i;n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=r,this};n(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var o,r=n(this),h=r.attr("data-target")||t.preventDefault()||(o=r.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""),u=n(h),f=u.data("bs.collapse"),c=f?"toggle":r.data(),e=r.attr("data-parent"),s=e&&n(e);f&&f.transitioning||(s&&s.find('[data-toggle="collapse"][data-parent="'+e+'"]').not(r).addClass("collapsed"),r[u.hasClass("in")?"addClass":"removeClass"]("collapsed"));i.call(u,c)})}(jQuery);+function(n){"use strict";function r(t){t&&3===t.which||(n(o).remove(),n(i).each(function(){var i=u(n(this)),r={relatedTarget:this};i.hasClass("open")&&(i.trigger(t=n.Event("hide.bs.dropdown",r)),t.isDefaultPrevented()||i.removeClass("open").trigger("hidden.bs.dropdown",r))}))}function u(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}function e(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));"string"==typeof i&&u[i].call(r)})}var o=".dropdown-backdrop",i='[data-toggle="dropdown"]',t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.VERSION="3.2.0";t.prototype.toggle=function(t){var f=n(this),i,o,e;if(!f.is(".disabled, :disabled")){if(i=u(f),o=i.hasClass("open"),r(),!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&n('<div class="dropdown-backdrop"/>').insertAfter(n(this)).on("click",r),e={relatedTarget:this},i.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;f.trigger("focus");i.toggleClass("open").trigger("shown.bs.dropdown",e)}return!1}};t.prototype.keydown=function(t){var e,o,s,h,f,r;if(/(38|40|27)/.test(t.keyCode)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=u(e),s=o.hasClass("open"),!s||s&&27==t.keyCode)return 27==t.which&&o.find(i).trigger("focus"),e.trigger("click");h=" li:not(.divider):visible a";f=o.find('[role="menu"]'+h+', [role="listbox"]'+h);f.length&&(r=f.index(f.filter(":focus")),38==t.keyCode&&r>0&&r--,40==t.keyCode&&r<f.length-1&&r++,~r||(r=0),f.eq(r).trigger("focus"))}};f=n.fn.dropdown;n.fn.dropdown=e;n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",r).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i+', [role="menu"], [role="listbox"]',t.prototype.keydown)}(jQuery);+function(n){"use strict";function i(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),"object"==typeof i&&i);u||f.data("bs.modal",u=new t(this,e));"string"==typeof i?u[i](r):e.show&&u.show(r)})}var t=function(t,i){this.options=i;this.$body=n(document.body);this.$element=n(t);this.$backdrop=this.isShown=null;this.scrollbarWidth=0;this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,n.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))},r;t.VERSION="3.2.0";t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this.isShown?this.hide():this.show(n)};t.prototype.show=function(t){var i=this,r=n.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r);this.isShown||r.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.$body.addClass("modal-open"),this.setScrollbar(),this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this)),this.backdrop(function(){var u=n.support.transition&&i.$element.hasClass("fade"),r;i.$element.parent().length||i.$element.appendTo(i.$body);i.$element.show().scrollTop(0);u&&i.$element[0].offsetWidth;i.$element.addClass("in").attr("aria-hidden",!1);i.enforceFocus();r=n.Event("shown.bs.modal",{relatedTarget:t});u?i.$element.find(".modal-dialog").one("bsTransitionEnd",function(){i.$element.trigger("focus").trigger(r)}).emulateTransitionEnd(300):i.$element.trigger("focus").trigger(r)}))};t.prototype.hide=function(t){t&&t.preventDefault();t=n.Event("hide.bs.modal");this.$element.trigger(t);this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",n.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.trigger("focus")},this))};t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",n.proxy(function(n){27==n.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(t){var f=this,u=this.$element.hasClass("fade")?"fade":"",i,r;if(this.isShown&&this.options.backdrop){if(i=n.support.transition&&u,this.$backdrop=n('<div class="modal-backdrop '+u+'" />').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){n.target===n.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;i?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),r=function(){f.removeBackdrop();t&&t()},n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",r).emulateTransitionEnd(150):r()):t&&t()};t.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())};t.prototype.setScrollbar=function(){var n=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",n+this.scrollbarWidth)};t.prototype.resetScrollbar=function(){this.$body.css("padding-right","")};t.prototype.measureScrollbar=function(){var n=document.createElement("div"),t;return n.className="modal-scrollbar-measure",this.$body.append(n),t=n.offsetWidth-n.clientWidth,this.$body[0].removeChild(n),t};r=n.fn.modal;n.fn.modal=i;n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=r,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var r=n(this),f=r.attr("href"),u=n(r.attr("data-target")||f&&f.replace(/.*(?=#[^\s]+$)/,"")),e=u.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(f)&&f},u.data(),r.data());r.is("a")&&t.preventDefault();u.one("show.bs.modal",function(n){n.isDefaultPrevented()||u.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})});i.call(u,e,this)})}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f="object"==typeof i&&i;(r||"destroy"!=i)&&(r||u.data("bs.tooltip",r=new t(this,f)),"string"==typeof i&&r[i]())})}var t=function(n,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null;this.init("tooltip",n,t)},i;t.VERSION="3.2.0";t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}};t.prototype.init=function(t,i,r){var f,e,u,o,s;for(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(this.options.viewport.selector||this.options.viewport),f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],"click"==u)this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else"manual"!=u&&(o="hover"==u?"mouseenter":"focusin",s="hover"==u?"mouseleave":"focusout",this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this)));this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()};t.prototype.show=function(){var h=n.Event("show.bs."+this.type),c,y,s;if(this.hasContent()&&this.enabled){if(this.$element.trigger(h),c=n.contains(document.documentElement,this.$element[0]),h.isDefaultPrevented()||!c)return;var f=this,i=this.tip(),l=this.getUID(this.type);this.setContent();i.attr("id",l);this.$element.attr("aria-describedby",l);this.options.animation&&i.addClass("fade");var t="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,v=a.test(t);v&&(t=t.replace(a,"")||"top");i.detach().css({top:0,left:0,display:"block"}).addClass(t).data("bs."+this.type,this);this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var r=this.getPosition(),e=i[0].offsetWidth,o=i[0].offsetHeight;if(v){var p=t,w=this.$element.parent(),u=this.getPosition(w);t="bottom"==t&&r.top+r.height+o-u.scroll>u.height?"top":"top"==t&&r.top-u.scroll-o<0?"bottom":"right"==t&&r.right+e>u.width?"left":"left"==t&&r.left-e<u.left?"right":t;i.removeClass(p).addClass(t)}y=this.getCalculatedOffset(t,r,e,o);this.applyPlacement(y,t);s=function(){f.$element.trigger("shown.bs."+f.type);f.hoverState=null};n.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",s).emulateTransitionEnd(150):s()}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),c=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),h,f,u;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top=t.top+o;t.left=t.left+s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");h=r[0].offsetWidth;f=r[0].offsetHeight;"top"==i&&f!=e&&(t.top=t.top+e-f);u=this.getViewportAdjustedDelta(i,t,h,f);u.left?t.left+=u.left:t.top+=u.top;var l=u.left?2*u.left-c+h:2*u.top-e+f,a=u.left?"left":"top",v=u.left?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(l,r[0][v],a)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i,n?50*(1-n/t)+"%":"")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(){function r(){"in"!=t.hoverState&&i.detach();t.$element.trigger("hidden.bs."+t.type)}var t=this,i=this.tip(),u=n.Event("hide.bs."+this.type);return this.$element.removeAttr("aria-describedby"),this.$element.trigger(u),u.isDefaultPrevented()?void 0:(i.removeClass("in"),n.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",r).emulateTransitionEnd(150):r(),this.hoverState=null,this)};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||"string"!=typeof n.attr("data-original-title"))&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(t){t=t||this.$element;var r=t[0],i="BODY"==r.tagName;return n.extend({},"function"==typeof r.getBoundingClientRect?r.getBoundingClientRect():null,{scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop(),width:i?n(window).width():t.outerWidth(),height:i?n(window).height():t.outerHeight()},i?{top:0,left:0}:t.offset())};t.prototype.getCalculatedOffset=function(n,t,i,r){return"bottom"==n?{top:t.top+t.height,left:t.left+t.width/2-i/2}:"top"==n?{top:t.top-r,left:t.left+t.width/2-i/2}:"left"==n?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getViewportAdjustedDelta=function(n,t,i,r){var f={top:0,left:0},e,u,o,s,h,c;return this.$viewport?(e=this.options.viewport&&this.options.viewport.padding||0,u=this.getPosition(this.$viewport),/right|left/.test(n)?(o=t.top-e-u.scroll,s=t.top+e-u.scroll+r,o<u.top?f.top=u.top-o:s>u.top+u.height&&(f.top=u.top+u.height-s)):(h=t.left-e,c=t.left+e+i,h<u.left?f.left=u.left-h:c>u.width&&(f.left=u.left+u.width-c)),f):f};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){do n+=~~(1e6*Math.random());while(document.getElementById(n));return n};t.prototype.tip=function(){return this.$tip=this.$tip||n(this.options.template)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=this;t&&(i=n(t.currentTarget).data("bs."+this.type),i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)));i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){clearTimeout(this.timeout);this.hide().$element.off("."+this.type).removeData("bs."+this.type)};i=n.fn.tooltip;n.fn.tooltip=r;n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f="object"==typeof i&&i;(r||"destroy"!=i)&&(r||u.data("bs.popover",r=new t(this,f)),"string"==typeof i&&r[i]())})}var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.2.0";t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](i);n.find(".popover-content").empty()[this.options.html?"string"==typeof t?"html":"append":"text"](t);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||("function"==typeof n.content?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};t.prototype.tip=function(){return this.$tip||(this.$tip=n(this.options.template)),this.$tip};i=n.fn.popover;n.fn.popover=r;n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery);+function(n){"use strict";function t(i,r){var u=n.proxy(this.process,this);this.$body=n("body");this.$scrollElement=n(n(i).is("body")?window:i);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||"")+" .nav li > a";this.offsets=[];this.targets=[];this.activeTarget=null;this.scrollHeight=0;this.$scrollElement.on("scroll.bs.scrollspy",u);this.refresh();this.process()}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f="object"==typeof i&&i;r||u.data("bs.scrollspy",r=new t(this,f));"string"==typeof i&&r[i]()})}t.VERSION="3.2.0";t.DEFAULTS={offset:10};t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)};t.prototype.refresh=function(){var i="offset",r=0,t;n.isWindow(this.$scrollElement[0])||(i="position",r=this.$scrollElement.scrollTop());this.offsets=[];this.targets=[];this.scrollHeight=this.getScrollHeight();t=this;this.$body.find(this.selector).map(function(){var f=n(this),u=f.data("target")||f.attr("href"),t=/^#./.test(u)&&n(u);return t&&t.length&&t.is(":visible")&&[[t[i]().top+r,u]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var n,r=this.$scrollElement.scrollTop()+this.options.offset,f=this.getScrollHeight(),e=this.options.offset+f-this.$scrollElement.height(),t=this.offsets,i=this.targets,u=this.activeTarget;if(this.scrollHeight!=f&&this.refresh(),r>=e)return u!=(n=i[i.length-1])&&this.activate(n);if(u&&r<=t[0])return u!=(n=i[0])&&this.activate(n);for(n=t.length;n--;)u!=i[n]&&r>=t[n]&&(!t[n+1]||r<=t[n+1])&&this.activate(i[n])};t.prototype.activate=function(t){this.activeTarget=t;n(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};var r=n.fn.scrollspy;n.fn.scrollspy=i;n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=r,this};n(window).on("load.bs.scrollspy.data-api",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));"string"==typeof i&&r[i]()})}var t=function(t){this.element=n(t)},r;t.VERSION="3.2.0";t.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),r,u,f;(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),t.parent("li").hasClass("active"))||(r=e.find(".active:last a")[0],u=n.Event("show.bs.tab",{relatedTarget:r}),(t.trigger(u),u.isDefaultPrevented())||(f=n(i),this.activate(t.closest("li"),e),this.activate(f,f.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:r})})))};t.prototype.activate=function(t,i,r){function f(){u.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");t.addClass("active");e?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade");t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active");r&&r()}var u=i.find("> .active"),e=r&&n.support.transition&&u.hasClass("fade");e?u.one("bsTransitionEnd",f).emulateTransitionEnd(150):f();u.removeClass("in")};r=n.fn.tab;n.fn.tab=i;n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=r,this};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault();i.call(n(this),"show")})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f="object"==typeof i&&i;r||u.data("bs.affix",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);this.$target=n(this.options.target).on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=this.unpin=this.pinnedOffset=null;this.checkPosition()},r;t.VERSION="3.2.0";t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0,target:window};t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var n=this.$target.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-n};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i,e,o;if(this.$element.is(":visible")){var s=n(document).height(),h=this.$target.scrollTop(),c=this.$element.offset(),r=this.options.offset,f=r.top,u=r.bottom;"object"!=typeof r&&(u=f=r);"function"==typeof f&&(f=r.top(this.$element));"function"==typeof u&&(u=r.bottom(this.$element));i=null!=this.unpin&&h+this.unpin<=c.top?!1:null!=u&&c.top+this.$element.height()>=s-u?"bottom":null!=f&&f>=h?"top":!1;this.affixed!==i&&(null!=this.unpin&&this.$element.css("top",""),e="affix"+(i?"-"+i:""),o=n.Event(e+".bs.affix"),this.$element.trigger(o),o.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(e).trigger(n.Event(e.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:s-this.$element.height()-u})))}};r=n.fn.affix;n.fn.affix=i;n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=r,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var r=n(this),t=r.data();t.offset=t.offset||{};t.offsetBottom&&(t.offset.bottom=t.offsetBottom);t.offsetTop&&(t.offset.top=t.offsetTop);i.call(r,t)})})}(jQuery);!function(n){"use strict";var t=function(n,t){this.init(n,t)};t.prototype={constructor:t,init:function(t,i){var u=this,r;this.options=i;this.$element=n(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",n.proxy(this.hide,this));this.options.remote&&this.$element.find(".modal-body").load(this.options.remote,function(){var t=n.Event("loaded");u.$element.trigger(t)});r=typeof this.options.manager=="function"?this.options.manager.call(this):this.options.manager;r=r.appendModal?r:n(r).modalmanager().data("modalmanager");r.appendModal(this)},toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=n.Event("show");this.isShown||(this.$element.trigger(t),t.isDefaultPrevented())||(this.escape(),this.tab(),this.options.loading&&this.loading())},hide:function(t){(t&&t.preventDefault(),t=n.Event("hide"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented())&&(this.isShown=!1,this.escape(),this.tab(),this.isLoading&&this.loading(),n(document).off("focusin.modal"),this.$element.removeClass("in").removeClass("animated").removeClass(this.options.attentionAnimation).removeClass("modal-overflow").attr("aria-hidden",!0),n.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},layout:function(){var i=this.options.height?"height":"max-height",r=this.options.height||this.options.maxHeight,t,u;this.options.width?(this.$element.css("width",this.options.width),t=this,this.$element.css("margin-left",function(){return/%/ig.test(t.options.width)?-(parseInt(t.options.width)/2)+"%":-(n(this).width()/2)+"px"})):(this.$element.css("width",""),this.$element.css("margin-left",""));this.$element.find(".modal-body").css("overflow","").css(i,"");r&&this.$element.find(".modal-body").css("overflow","auto").css(i,r);u=n(window).height()-10<this.$element.height();u||this.options.modalOverflow?this.$element.css("margin-top",0).addClass("modal-overflow"):this.$element.css("margin-top",0-this.$element.height()/2).removeClass("modal-overflow")},tab:function(){var t=this;if(this.isShown&&this.options.consumeTab)this.$element.on("keydown.tabindex.modal","[data-tabindex]",function(i){var r,f,u;i.keyCode&&i.keyCode==9&&(r=[],f=Number(n(this).data("tabindex")),t.$element.find("[data-tabindex]:enabled:visible:not([readonly])").each(function(){r.push(Number(n(this).data("tabindex")))}),r.sort(function(n,t){return n-t}),u=n.inArray(f,r),i.shiftKey?u==0?t.$element.find("[data-tabindex="+r[r.length-1]+"]").focus():t.$element.find("[data-tabindex="+r[u-1]+"]").focus():u<r.length-1?t.$element.find("[data-tabindex="+r[u+1]+"]").focus():t.$element.find("[data-tabindex="+r[0]+"]").focus(),i.preventDefault())});else this.isShown||this.$element.off("keydown.tabindex.modal")},escape:function(){var n=this;if(this.isShown&&this.options.keyboard){this.$element.attr("tabindex")||this.$element.attr("tabindex",-1);this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&n.hide()})}else this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,i=setTimeout(function(){t.$element.off(n.support.transition.end);t.hideModal()},500);this.$element.one(n.support.transition.end,function(){clearTimeout(i);t.hideModal()})},hideModal:function(){var n=this.options.height?"height":"max-height",t=this.options.height||this.options.maxHeight;t&&this.$element.find(".modal-body").css("overflow","").css(n,"");this.$element.hide().trigger("hidden")},removeLoading:function(){this.$loading.remove();this.$loading=null;this.isLoading=!1},loading:function(t){var i,r,u;t=t||function(){};i=this.$element.hasClass("fade")?"fade":"";this.isLoading?this.isLoading&&this.$loading?(this.$loading.removeClass("in"),u=this,n.support.transition&&this.$element.hasClass("fade")?this.$loading.one(n.support.transition.end,function(){u.removeLoading()}):u.removeLoading()):t&&t(this.isLoading):(r=n.support.transition&&i,this.$loading=n('<div class="loading-mask '+i+'">').append(this.options.spinner).appendTo(this.$element),r&&this.$loading[0].offsetWidth,this.$loading.addClass("in"),this.isLoading=!0,r?this.$loading.one(n.support.transition.end,t):t())},focus:function(){var n=this.$element.find(this.options.focusOn);n=n.length?n:this.$element;n.focus()},attention:function(){if(this.options.attentionAnimation){this.$element.removeClass("animated").removeClass(this.options.attentionAnimation);var n=this;setTimeout(function(){n.$element.addClass("animated").addClass(n.options.attentionAnimation)},0)}this.focus()},destroy:function(){var t=n.Event("destroy");(this.$element.trigger(t),t.isDefaultPrevented())||(this.$element.off(".modal").removeData("modal").removeClass("in").attr("aria-hidden",!0),this.$parent!==this.$element.parent()?this.$element.appendTo(this.$parent):this.$parent.length||(this.$element.remove(),this.$element=null),this.$element.trigger("destroyed"))}};n.fn.modal=function(i,r){return this.each(function(){var f=n(this),u=f.data("modal"),e=n.extend({},n.fn.modal.defaults,f.data(),typeof i=="object"&&i);u||f.data("modal",u=new t(this,e));typeof i=="string"?u[i].apply(u,[].concat(r)):e.show&&u.show()})};n.fn.modal.defaults={keyboard:!0,backdrop:!0,loading:!1,show:!0,width:null,height:null,maxHeight:null,modalOverflow:!1,consumeTab:!0,focusOn:null,replace:!1,resize:!1,attentionAnimation:"shake",manager:"body",spinner:'<div class="loading-spinner" style="width: 200px; margin-left: -100px;"><div class="progress progress-striped active"><div class="bar" style="width: 100%;"><\/div><\/div><\/div>',backdropTemplate:'<div class="modal-backdrop" />'};n.fn.modal.Constructor=t;n(function(){n(document).off("click.modal").on("click.modal.data-api",'[data-toggle="modal"]',function(t){var i=n(this),r=i.attr("href"),u=n(i.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),f=u.data("modal")?"toggle":n.extend({remote:!/#/.test(r)&&r},u.data(),i.data());t.preventDefault();u.modal(f).one("hide",function(){i.focus()})})})}(window.jQuery);!function(n){"use strict";function t(n){return function(t){if(t&&this===t.target)return n.apply(this,arguments)}}var r=function(n,t){this.init(n,t)},i;r.prototype={constructor:r,init:function(t,i){if(this.$element=n(t),this.options=n.extend({},n.fn.modalmanager.defaults,this.$element.data(),typeof i=="object"&&i),this.stack=[],this.backdropCount=0,this.options.resize){var r,u=this;n(window).on("resize.modal",function(){r&&clearTimeout(r);r=setTimeout(function(){for(var n=0;n<u.stack.length;n++)u.stack[n].isShown&&u.stack[n].layout()},10)})}},createModal:function(t,i){n(t).modal(n.extend({manager:this},i))},appendModal:function(i){this.stack.push(i);var r=this;i.$element.on("show.modalmanager",t(function(){var t=function(){i.isShown=!0;var t=n.support.transition&&i.$element.hasClass("fade");r.$element.toggleClass("modal-open",r.hasOpenModal()).toggleClass("page-overflow",n(window).height()<r.$element.height());i.$parent=i.$element.parent();i.$container=r.createContainer(i);i.$element.appendTo(i.$container);r.backdrop(i,function(){i.$element.show();t&&i.$element[0].offsetWidth;i.layout();i.$element.addClass("in").attr("aria-hidden",!1);var u=function(){r.setFocus();i.$element.trigger("shown")};t?i.$element.one(n.support.transition.end,u):u()})};i.options.replace?r.replace(t):t()}));i.$element.on("hidden.modalmanager",t(function(){if(r.backdrop(i),i.$element.parent().length)if(i.$backdrop){var t=n.support.transition&&i.$element.hasClass("fade");t&&i.$element[0].offsetWidth;n.support.transition&&i.$element.hasClass("fade")?i.$backdrop.one(n.support.transition.end,function(){i.destroy()}):i.destroy()}else i.destroy();else r.destroyModal(i)}));i.$element.on("destroyed.modalmanager",t(function(){r.destroyModal(i)}))},getOpenModals:function(){for(var t=[],n=0;n<this.stack.length;n++)this.stack[n].isShown&&t.push(this.stack[n]);return t},hasOpenModal:function(){return this.getOpenModals().length>0},setFocus:function(){for(var t,n=0;n<this.stack.length;n++)this.stack[n].isShown&&(t=this.stack[n]);t&&t.focus()},destroyModal:function(n){n.$element.off(".modalmanager");n.$backdrop&&this.removeBackdrop(n);this.stack.splice(this.getIndexOfModal(n),1);var t=this.hasOpenModal();this.$element.toggleClass("modal-open",t);t||this.$element.removeClass("page-overflow");this.removeContainer(n);this.setFocus()},getModalAt:function(n){return this.stack[n]},getIndexOfModal:function(n){for(var t=0;t<this.stack.length;t++)if(n===this.stack[t])return t},replace:function(i){for(var r,u=0;u<this.stack.length;u++)this.stack[u].isShown&&(r=this.stack[u]);r?(this.$backdropHandle=r.$backdrop,r.$backdrop=null,i&&r.$element.one("hidden",t(n.proxy(i,this))),r.hide()):i&&i()},removeBackdrop:function(n){n.$backdrop.remove();n.$backdrop=null},createBackdrop:function(t,i){var r;return this.$backdropHandle?(r=this.$backdropHandle,r.off(".modalmanager"),this.$backdropHandle=null,this.isLoading&&this.removeSpinner()):r=n(i).addClass(t).appendTo(this.$element),r},removeContainer:function(n){n.$container.remove();n.$container=null},createContainer:function(r){var u;if(u=n('<div class="modal-scrollable">').css("z-index",i("modal",this.getOpenModals().length)).appendTo(this.$element),r&&r.options.backdrop!="static")u.on("click.modal",t(function(){r.hide()}));else if(r)u.on("click.modal",t(function(){r.attention()}));return u},backdrop:function(t,r){var e=t.$element.hasClass("fade")?"fade":"",o=t.options.backdrop&&this.backdropCount<this.options.backdropLimit,u,f;t.isShown&&o?(u=n.support.transition&&e&&!this.$backdropHandle,t.$backdrop=this.createBackdrop(e,t.options.backdropTemplate),t.$backdrop.css("z-index",i("backdrop",this.getOpenModals().length)),u&&t.$backdrop[0].offsetWidth,t.$backdrop.addClass("in"),this.backdropCount+=1,u?t.$backdrop.one(n.support.transition.end,r):r()):!t.isShown&&t.$backdrop?(t.$backdrop.removeClass("in"),this.backdropCount-=1,f=this,n.support.transition&&t.$element.hasClass("fade")?t.$backdrop.one(n.support.transition.end,function(){f.removeBackdrop(t)}):f.removeBackdrop(t)):r&&r()},removeSpinner:function(){this.$spinner&&this.$spinner.remove();this.$spinner=null;this.isLoading=!1},removeLoading:function(){this.$backdropHandle&&this.$backdropHandle.remove();this.$backdropHandle=null;this.removeSpinner()},loading:function(t){var r,f,u;t=t||function(){};this.$element.toggleClass("modal-open",!this.isLoading||this.hasOpenModal()).toggleClass("page-overflow",n(window).height()<this.$element.height());this.isLoading?this.isLoading&&this.$backdropHandle?(this.$backdropHandle.removeClass("in"),u=this,n.support.transition?this.$backdropHandle.one(n.support.transition.end,function(){u.removeLoading()}):u.removeLoading()):t&&t(this.isLoading):(this.$backdropHandle=this.createBackdrop("fade",this.options.backdropTemplate),this.$backdropHandle[0].offsetWidth,r=this.getOpenModals(),this.$backdropHandle.css("z-index",i("backdrop",r.length+1)).addClass("in"),f=n(this.options.spinner).css("z-index",i("modal",r.length+1)).appendTo(this.$element).addClass("in"),this.$spinner=n(this.createContainer()).append(f).on("click.modalmanager",n.proxy(this.loading,this)),this.isLoading=!0,n.support.transition?this.$backdropHandle.one(n.support.transition.end,t):t())}};i=function(){var i,t={};return function(r,u){if(typeof i=="undefined"){var f=n('<div class="modal hide" />').appendTo("body"),e=n('<div class="modal-backdrop hide" />').appendTo("body");t.modal=+f.css("z-index");t.backdrop=+e.css("z-index");i=t.modal-t.backdrop;f.remove();e.remove();e=f=null}return t[r]+i*u}}();n.fn.modalmanager=function(t,i){return this.each(function(){var f=n(this),u=f.data("modalmanager");u||f.data("modalmanager",u=new r(this,t));typeof t=="string"&&u[t].apply(u,[].concat(i))})};n.fn.modalmanager.defaults={backdropLimit:999,resize:!0,spinner:'<div class="loading-spinner fade" style="width: 200px; margin-left: -100px;"><div class="progress progress-striped active"><div class="bar" style="width: 100%;"><\/div><\/div><\/div>',backdropTemplate:'<div class="modal-backdrop" />'};n.fn.modalmanager.Constructor=r;n(function(){n(document).off("show.bs.modal").off("hidden.bs.modal")})}(jQuery),function(n){var t=function(i,r){return this.$element=n(i),this.$note=n('<div class="alert"><\/div>'),this.options=n.extend(!0,{},n.fn.notify.defaults,r),this._link=null,this.options.transition?this.options.transition==="fade"?this.$note.addClass("in").addClass(this.options.transition):this.$note.addClass(this.options.transition):this.$note.addClass("fade").addClass("in"),this.options.type?this.$note.addClass("alert-"+this.options.type):this.$note.addClass("alert-success"),this.options.message&&(typeof this.options.message=="string"?this.$note.html(this.options.message):typeof this.options.message=="object"&&(this.options.message.html?this.$note.html(this.options.message.html):this.options.message.text&&this.$note.text(this.options.message.text))),this.options.closable&&(this._link=n('<a class="close pull-right">×<\/a>'),n(this._link).on("click",n.proxy(t.onClose,this)),this.$note.prepend(this._link)),this};t.onClose=function(){this.options.onClose();n(this.$note).remove();this.options.onClosed()};t.prototype.show=function(){this.options.fadeOut.enabled&&this.$note.delay(this.options.fadeOut.delay||3e3).fadeOut("slow",n.proxy(t.onClose,this));this.$element.append(this.$note);this.$note.alert()};t.prototype.hide=function(){this.options.fadeOut.enabled?this.$note.delay(this.options.fadeOut.delay||3e3).fadeOut("slow",n.proxy(t.onClose,this)):t.onClose.call(this)};n.fn.notify=function(n){return new t(this,n)};n.fn.notify.defaults={type:"success",closable:!0,transition:"fade",fadeOut:{enabled:!0,delay:3e3},message:null,onClose:function(){},onClosed:function(){}}}(window.jQuery);var bootbox=window.bootbox||function(n,t){function e(n,t){return"undefined"==typeof t&&(t=s),"string"==typeof f[t][n]?f[t][n]:t!=h?e(n,h):n}var s="en",h="en",c=!0,o="static",l="javascript:;",a="",r={},u={},i={},f;return i.setLocale=function(n){for(var t in f)if(t==n)return s=n,void 0;throw new Error("Invalid locale: "+n);},i.addLocale=function(n,t){"undefined"==typeof f[n]&&(f[n]={});for(var i in t)f[n][i]=t[i]},i.setIcons=function(n){u=n;("object"!=typeof u||null===u)&&(u={})},i.setBtnClasses=function(n){r=n;("object"!=typeof r||null===r)&&(r={})},i.alert=function(){var n="",f=e("OK"),t=null;switch(arguments.length){case 1:n=arguments[0];break;case 2:n=arguments[0];"function"==typeof arguments[1]?t=arguments[1]:f=arguments[1];break;case 3:n=arguments[0];f=arguments[1];t=arguments[2];break;default:throw new Error("Incorrect number of arguments: expected 1-3");}return i.dialog(n,{label:f,icon:u.OK,"class":r.OK,callback:t},{onEscape:t||!0})},i.confirm=function(){var t="",f=e("CANCEL"),o=e("CONFIRM"),n=null,s,h;switch(arguments.length){case 1:t=arguments[0];break;case 2:t=arguments[0];"function"==typeof arguments[1]?n=arguments[1]:f=arguments[1];break;case 3:t=arguments[0];f=arguments[1];"function"==typeof arguments[2]?n=arguments[2]:o=arguments[2];break;case 4:t=arguments[0];f=arguments[1];o=arguments[2];n=arguments[3];break;default:throw new Error("Incorrect number of arguments: expected 1-4");}return s=function(){if("function"==typeof n)return n(!1)},h=function(){if("function"==typeof n)return n(!0)},i.dialog(t,[{label:f,icon:u.CANCEL,"class":r.CANCEL,callback:s},{label:o,icon:u.CONFIRM,"class":r.CONFIRM,callback:h}],{onEscape:s})},i.prompt=function(){var f="",s=e("CANCEL"),h=e("CONFIRM"),n=null,l="",a,o;switch(arguments.length){case 1:f=arguments[0];break;case 2:f=arguments[0];"function"==typeof arguments[1]?n=arguments[1]:s=arguments[1];break;case 3:f=arguments[0];s=arguments[1];"function"==typeof arguments[2]?n=arguments[2]:h=arguments[2];break;case 4:f=arguments[0];s=arguments[1];h=arguments[2];n=arguments[3];break;case 5:f=arguments[0];s=arguments[1];h=arguments[2];n=arguments[3];l=arguments[4];break;default:throw new Error("Incorrect number of arguments: expected 1-5");}a=f;o=t("<form><\/form>");o.append("<input class='input-block-level' autocomplete=off type=text value='"+l+"' />");var v=function(){if("function"==typeof n)return n(null)},y=function(){if("function"==typeof n)return n(o.find("input[type=text]").val())},c=i.dialog(o,[{label:s,icon:u.CANCEL,"class":r.CANCEL,callback:v},{label:h,icon:u.CONFIRM,"class":r.CONFIRM,callback:y}],{header:a,show:!1,onEscape:v});return c.on("shown",function(){o.find("input[type=text]").focus();o.on("submit",function(n){n.preventDefault();c.find(".btn-primary").click()})}),c.modal("show"),c},i.dialog=function(i,r,u){function d(){var n=null;"function"==typeof u.onEscape&&(n=u.onEscape());n!==!1&&e.modal("hide")}var v="",g=[],f,p,w,y,s,b,e,ut,k;for(u||(u={}),"undefined"==typeof r?r=[]:"undefined"==typeof r.length&&(r=[r]),f=r.length;f--;){var nt=null,tt=null,h=null,it="",rt=null;if("undefined"==typeof r[f].label&&"undefined"==typeof r[f]["class"]&&"undefined"==typeof r[f].callback){p=0;w=null;for(y in r[f])if(w=y,++p>1)break;1==p&&"function"==typeof r[f][y]&&(r[f].label=w,r[f].callback=r[f][y])}"function"==typeof r[f].callback&&(rt=r[f].callback);r[f]["class"]?h=r[f]["class"]:f==r.length-1&&r.length<=2&&(h="btn-primary");r[f].link!==!0&&(h="btn "+h);nt=r[f].label?r[f].label:"Option "+(f+1);r[f].icon&&(it="<i class='"+r[f].icon+"'><\/i> ");tt=r[f].href?r[f].href:l;v="<a data-handler='"+f+"' class='"+h+"' href='"+tt+"'>"+it+nt+"<\/a>"+v;g[f]=rt}return s=["<div class='bootbox modal' tabindex='-1' style='overflow:hidden;'>"],u.header&&(b="",("undefined"==typeof u.headerCloseButton||u.headerCloseButton)&&(b="<a href='"+l+"' class='close'>×<\/a>"),s.push("<div class='modal-header'>"+b+"<h3>"+u.header+"<\/h3><\/div>")),s.push("<div class='modal-body'><\/div>"),v&&s.push("<div class='modal-footer'>"+v+"<\/div>"),s.push("<\/div>"),e=t(s.join("\n")),ut="undefined"==typeof u.animate?c:u.animate,ut&&e.addClass("fade"),k="undefined"==typeof u.classes?a:u.classes,k&&e.addClass(k),e.find(".modal-body").html(i),e.on("keyup.dismiss.modal",function(n){27===n.which&&u.onEscape&&d("escape")}),e.on("click","a.close",function(n){n.preventDefault();d("close")}),e.on("shown",function(){e.find("a.btn-primary:first").focus()}),e.on("hidden",function(n){n.target===this&&e.remove()}),e.on("click",".modal-footer a",function(n){var i=t(this).data("handler"),u=g[i],f=null;("undefined"==typeof i||"undefined"==typeof r[i].href)&&(n.preventDefault(),"function"==typeof u&&(f=u(n)),f!==!1&&e.modal("hide"))}),t("body").append(e),e.modal({backdrop:"undefined"==typeof u.backdrop?o:u.backdrop,keyboard:!1,show:!1}),e.on("show",function(){t(n).off("focusin.modal")}),("undefined"==typeof u.show||u.show===!0)&&e.modal("show"),e},i.modal=function(){var r,u,n,f={onEscape:null,keyboard:!0,backdrop:o};switch(arguments.length){case 1:r=arguments[0];break;case 2:r=arguments[0];"object"==typeof arguments[1]?n=arguments[1]:u=arguments[1];break;case 3:r=arguments[0];u=arguments[1];n=arguments[2];break;default:throw new Error("Incorrect number of arguments: expected 1-3");}return f.header=u,n="object"==typeof n?t.extend(f,n):f,i.dialog(r,[],n)},i.hideAll=function(){t(".bootbox").modal("hide")},i.animate=function(n){c=n},i.backdrop=function(n){o=n},i.classes=function(n){a=n},f={br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},da:{OK:"OK",CANCEL:"Annuller",CONFIRM:"Accepter"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},pl:{OK:"OK",CANCEL:"Anuluj",CONFIRM:"Potwierdź"},ru:{OK:"OK",CANCEL:"Отмена",CONFIRM:"Применить"},zh_CN:{OK:"OK",CANCEL:"取消",CONFIRM:"确认"},zh_TW:{OK:"OK",CANCEL:"取消",CONFIRM:"確認"}},i}(document,window.jQuery);window.bootbox=bootbox;jQuery.cookie=function(n,t,i){var f,r,e,o,u,s;if(typeof t!="undefined"){i=i||{};t===null&&(t="",i.expires=-1);f="";i.expires&&(typeof i.expires=="number"||i.expires.toUTCString)&&(typeof i.expires=="number"?(r=new Date,r.setTime(r.getTime()+i.expires*864e5)):r=i.expires,f="; expires="+r.toUTCString());var h=i.path?"; path="+i.path:"",c=i.domain?"; domain="+i.domain:"",l=i.secure?"; secure":"";document.cookie=[n,"=",encodeURIComponent(t),f,h,c,l].join("")}else{if(e=null,document.cookie&&document.cookie!="")for(o=document.cookie.split(";"),u=0;u<o.length;u++)if(s=jQuery.trim(o[u]),s.substring(0,n.length+1)==n+"="){e=decodeURIComponent(s.substring(n.length+1));break}return e}},function(n){function t(t){if(typeof t.data=="string"){var r=t.handler,i=t.data.toLowerCase().split(" ");t.handler=function(t){var o,h;if(this===t.target||!/textarea|select/i.test(t.target.nodeName)&&t.target.type!=="text"){var f=t.type!=="keypress"&&n.hotkeys.specialKeys[t.which],s=String.fromCharCode(t.which).toLowerCase(),u="",e={};for(t.altKey&&f!=="alt"&&(u+="alt+"),t.ctrlKey&&f!=="ctrl"&&(u+="ctrl+"),t.metaKey&&!t.ctrlKey&&f!=="meta"&&(u+="meta+"),t.shiftKey&&f!=="shift"&&(u+="shift+"),f?e[u+f]=!0:(e[u+s]=!0,e[u+n.hotkeys.shiftNums[s]]=!0,u==="shift+"&&(e[n.hotkeys.shiftNums[s]]=!0)),o=0,h=i.length;o<h;o++)if(e[i[o]])return r.apply(this,arguments)}}}}n.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",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",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",191:"/",224:"meta"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};n.each(["keydown","keyup","keypress"],function(){n.event.special[this]={add:t}})}(jQuery),function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery"],n):typeof module!="undefined"&&module.exports?module.exports=n(require("jquery")):n(jQuery)}(function(n,t){"use strict";
/*!
* jsTree 3.3.8
* http://jstree.com/
*
* Copyright (c) 2014 Ivan Bozhanov (http://vakata.com)
*
* Licensed same as jquery - under the terms of the MIT License
* http://www.opensource.org/licenses/mit-license.php
*/
/*!
* if using jslint please allow for the jQuery global and use following options:
* jslint: loopfunc: true, browser: true, ass: true, bitwise: true, continue: true, nomen: true, plusplus: true, regexp: true, unparam: true, todo: true, white: true
*/
var h,e,f,c,s,a;if(!n.jstree){var y=0,u=!1,r=!1,o=!1,v=[],l=n("script:last").attr("src"),i=window.document;if(n.jstree={version:"3.3.8",defaults:{plugins:[]},plugins:{},path:l&&l.indexOf("/")!==-1?l.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g,root:"#"},n.jstree.create=function(t,i){var r=new n.jstree.core(++y),u=i;return i=n.extend(!0,{},n.jstree.defaults,i),u&&u.plugins&&(i.plugins=u.plugins),n.each(i.plugins,function(n,t){n!=="core"&&(r=r.plugin(t,i[t]))}),n(t).data("jstree",r),r.init(t,i),r},n.jstree.destroy=function(){n(".jstree:jstree").jstree("destroy");n(i).off(".jstree")},n.jstree.core=function(n){this._id=n;this._cnt=0;this._wrk=null;this._data={core:{themes:{name:!1,dots:!1,icons:!1,ellipsis:!1},selected:[],last_error:{},working:!1,worker_queue:[],focused:null}}},n.jstree.reference=function(t){var r=null,i=null;if(t&&t.id&&(!t.tagName||!t.nodeType)&&(t=t.id),!i||!i.length)try{i=n(t)}catch(u){}if(!i||!i.length)try{i=n("#"+t.replace(n.jstree.idregex,"\\$&"))}catch(u){}return i&&i.length&&(i=i.closest(".jstree")).length&&(i=i.data("jstree"))?r=i:n(".jstree").each(function(){var i=n(this).data("jstree");if(i&&i._model.data[t])return r=i,!1}),r},n.fn.jstree=function(i){var u=typeof i=="string",f=Array.prototype.slice.call(arguments,1),r=null;return i===!0&&!this.length?!1:(this.each(function(){var e=n.jstree.reference(this),o=u&&e?e[i]:null;return r=u&&o?o.apply(e,f):null,e||u||i!==t&&!n.isPlainObject(i)||n.jstree.create(this,i),(e&&!u||i===!0)&&(r=e||!1),r!==null&&r!==t?!1:void 0}),r!==null&&r!==t?r:this)},n.expr.pseudos.jstree=n.expr.createPseudo(function(){return function(i){return n(i).hasClass("jstree")&&n(i).data("jstree")!==t}}),n.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:n.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,ellipsis:!1,stripes:!1,variant:!1,responsive:!1},expand_selected_onload:!0,worker:!0,force_text:!1,dblclick_toggle:!0,loaded_state:!1,restore_focus:!0,keyboard:{"ctrl-space":function(t){t.type="click";n(t.currentTarget).trigger(t)},enter:function(t){t.type="click";n(t.currentTarget).trigger(t)},left:function(t){if(t.preventDefault(),this.is_open(t.currentTarget))this.close_node(t.currentTarget);else{var i=this.get_parent(t.currentTarget);i&&i.id!==n.jstree.root&&this.get_node(i,!0).children(".jstree-anchor").focus()}},up:function(n){n.preventDefault();var t=this.get_prev_dom(n.currentTarget);t&&t.length&&t.children(".jstree-anchor").focus()},right:function(t){if(t.preventDefault(),this.is_closed(t.currentTarget))this.open_node(t.currentTarget,function(n){this.get_node(n,!0).children(".jstree-anchor").focus()});else if(this.is_open(t.currentTarget)){var i=this.get_node(t.currentTarget,!0).children(".jstree-children")[0];i&&n(this._firstChild(i)).children(".jstree-anchor").focus()}},down:function(n){n.preventDefault();var t=this.get_next_dom(n.currentTarget);t&&t.length&&t.children(".jstree-anchor").focus()},"*":function(){this.open_all()},home:function(t){t.preventDefault();var i=this._firstChild(this.get_container_ul()[0]);i&&n(i).children(".jstree-anchor").filter(":visible").focus()},end:function(n){n.preventDefault();this.element.find(".jstree-anchor").filter(":visible").last().focus()},f2:function(n){n.preventDefault();this.edit(n.currentTarget)}}},n.jstree.core.prototype={plugin:function(t,i){var r=n.jstree.plugins[t];return r?(this._data[t]={},r.prototype=this,new r(i,this)):this},init:function(t,i){this._model={data:{},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}};this._model.data[n.jstree.root]={id:n.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}};this.element=n(t).addClass("jstree jstree-"+this._id);this.settings=i;this._data.core.ready=!1;this._data.core.loaded=!1;this._data.core.rtl=this.element.css("direction")==="rtl";this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl");this.element.attr("role","tree");this.settings.core.multiple&&this.element.attr("aria-multiselectable",!0);this.element.attr("tabindex")||this.element.attr("tabindex","0");this.bind();this.trigger("init");this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0);this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return this.nodeType===3&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove();this.element.html("<ul class='jstree-container-ul jstree-children' role='group'><li id='j"+this._id+"_loading' class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='tree-item'><i class='jstree-icon jstree-ocl'><\/i><a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'><\/i>"+this.get_string("Loading ...")+"<\/a><\/li><\/ul>");this.element.attr("aria-activedescendant","j"+this._id+"_loading");this._data.core.li_height=this.get_container_ul().children("li").first().outerHeight()||24;this._data.core.node=this._create_prototype_node();this.trigger("loading");this.load_node(n.jstree.root)},destroy:function(n){if(this.trigger("destroy"),this._wrk)try{window.URL.revokeObjectURL(this._wrk);this._wrk=null}catch(t){}n||this.element.empty();this.teardown()},_create_prototype_node:function(){var r=i.createElement("LI"),n,t;return r.setAttribute("role","treeitem"),n=i.createElement("I"),n.className="jstree-icon jstree-ocl",n.setAttribute("role","presentation"),r.appendChild(n),n=i.createElement("A"),n.className="jstree-anchor",n.setAttribute("href","#"),n.setAttribute("tabindex","-1"),t=i.createElement("I"),t.className="jstree-icon jstree-themeicon",t.setAttribute("role","presentation"),n.appendChild(t),r.appendChild(n),n=t=null,r},_kbevent_to_func:function(n){var i=[],r,u,t;n.ctrlKey&&i.push("ctrl");n.altKey&&i.push("alt");n.shiftKey&&i.push("shift");i.push({8:"Backspace",9:"Tab",13:"Enter",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock",16:"Shift",17:"Ctrl",18:"Alt",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*",173:"-"}[n.which]||n.which);i=i.sort().join("-").toLowerCase();r=this.settings.core.keyboard;for(u in r)if(r.hasOwnProperty(u)&&(t=u,t!=="-"&&t!=="+"&&(t=t.replace("--","-MINUS").replace("+-","-MINUS").replace("++","-PLUS").replace("-+","-PLUS"),t=t.split(/-|\+/).sort().join("-").replace("MINUS","-").replace("PLUS","+").toLowerCase()),t===i))return r[u];return null},teardown:function(){this.unbind();this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")});this.element=null},bind:function(){var t="",r=null,u=0;this.element.on("dblclick.jstree",function(n){if(n.target.tagName&&n.target.tagName.toLowerCase()==="input")return!0;if(i.selection&&i.selection.empty)i.selection.empty();else if(window.getSelection){var t=window.getSelection();try{t.removeAllRanges();t.collapse()}catch(r){}}}).on("mousedown.jstree",n.proxy(function(n){n.target===this.element[0]&&(n.preventDefault(),u=+new Date)},this)).on("mousedown.jstree",".jstree-ocl",function(n){n.preventDefault()}).on("click.jstree",".jstree-ocl",n.proxy(function(n){this.toggle_node(n.target)},this)).on("dblclick.jstree",".jstree-anchor",n.proxy(function(n){if(n.target.tagName&&n.target.tagName.toLowerCase()==="input")return!0;this.settings.core.dblclick_toggle&&this.toggle_node(n.target)},this)).on("click.jstree",".jstree-anchor",n.proxy(function(t){t.preventDefault();t.currentTarget!==i.activeElement&&n(t.currentTarget).focus();this.activate_node(t.currentTarget,t)},this)).on("keydown.jstree",".jstree-anchor",n.proxy(function(n){var i,t;return n.target.tagName&&n.target.tagName.toLowerCase()==="input"?!0:(this._data.core.rtl&&(n.which===37?n.which=39:n.which===39&&(n.which=37)),i=this._kbevent_to_func(n),i&&(t=i.call(this,n),t===!1||t===!0)?t:void 0)},this)).on("load_node.jstree",n.proxy(function(t,i){i.status&&(i.node.id!==n.jstree.root||this._data.core.loaded||(this._data.core.loaded=!0,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.trigger("loaded")),this._data.core.ready||setTimeout(n.proxy(function(){if(this.element&&!this.get_container_ul().find(".jstree-loading").length){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){for(var i=[],t=0,r=this._data.core.selected.length;t<r;t++)i=i.concat(this._model.data[this._data.core.selected[t]].parents);for(i=n.vakata.array_unique(i),t=0,r=i.length;t<r;t++)this.open_node(i[t],!1,0)}this.trigger("changed",{action:"ready",selected:this._data.core.selected})}this.trigger("ready")}},this),0))},this)).on("keypress.jstree",n.proxy(function(u){if(u.target.tagName&&u.target.tagName.toLowerCase()==="input")return!0;r&&clearTimeout(r);r=setTimeout(function(){t=""},500);var o=String.fromCharCode(u.which).toLowerCase(),e=this.element.find(".jstree-anchor").filter(":visible"),s=e.index(i.activeElement)||0,f=!1;if(t+=o,t.length>1){if(e.slice(s).each(n.proxy(function(i,r){if(n(r).text().toLowerCase().indexOf(t)===0)return n(r).focus(),f=!0,!1},this)),f)return;if(e.slice(0,s).each(n.proxy(function(i,r){if(n(r).text().toLowerCase().indexOf(t)===0)return n(r).focus(),f=!0,!1},this)),f)return}if(new RegExp("^"+o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"+$").test(t)){if(e.slice(s+1).each(n.proxy(function(t,i){if(n(i).text().toLowerCase().charAt(0)===o)return n(i).focus(),f=!0,!1},this)),f)return;if(e.slice(0,s+1).each(n.proxy(function(t,i){if(n(i).text().toLowerCase().charAt(0)===o)return n(i).focus(),f=!0,!1},this)),f)return}},this)).on("init.jstree",n.proxy(function(){var n=this.settings.core.themes;this._data.core.themes.dots=n.dots;this._data.core.themes.stripes=n.stripes;this._data.core.themes.icons=n.icons;this._data.core.themes.ellipsis=n.ellipsis;this.set_theme(n.name||"default",n.url);this.set_theme_variant(n.variant)},this)).on("loading.jstree",n.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"]();this[this._data.core.themes.icons?"show_icons":"hide_icons"]();this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"]();this[this._data.core.themes.ellipsis?"show_ellipsis":"hide_ellipsis"]()},this)).on("blur.jstree",".jstree-anchor",n.proxy(function(t){this._data.core.focused=null;n(t.currentTarget).filter(".jstree-hovered").trigger("mouseleave");this.element.attr("tabindex","0")},this)).on("focus.jstree",".jstree-anchor",n.proxy(function(t){var i=this.get_node(t.currentTarget);i&&i.id&&(this._data.core.focused=i.id);this.element.find(".jstree-hovered").not(t.currentTarget).trigger("mouseleave");n(t.currentTarget).trigger("mouseenter");this.element.attr("tabindex","-1")},this)).on("focus.jstree",n.proxy(function(){if(+new Date-u>500&&!this._data.core.focused&&this.settings.core.restore_focus){u=0;var n=this.get_node(this.element.attr("aria-activedescendant"),!0);n&&n.find("> .jstree-anchor").focus()}},this)).on("mouseenter.jstree",".jstree-anchor",n.proxy(function(n){this.hover_node(n.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",n.proxy(function(n){this.dehover_node(n.currentTarget)},this))},unbind:function(){this.element.off(".jstree");n(i).off(".jstree-"+this._id)},trigger:function(n,t){t||(t={});t.instance=this;this.element.triggerHandler(n.replace(".jstree","")+".jstree",t)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children(".jstree-children").first()},get_string:function(t){var i=this.settings.core.strings;return n.isFunction(i)?i.call(this,t):i&&i[t]?i[t]:t},_firstChild:function(n){for(n=n?n.firstChild:null;n!==null&&n.nodeType!==1;)n=n.nextSibling;return n},_nextSibling:function(n){for(n=n?n.nextSibling:null;n!==null&&n.nodeType!==1;)n=n.nextSibling;return n},_previousSibling:function(n){for(n=n?n.previousSibling:null;n!==null&&n.nodeType!==1;)n=n.previousSibling;return n},get_node:function(t,i){t&&t.id&&(t=t.id);t instanceof n&&t.length&&t[0].id&&(t=t[0].id);var r;try{if(this._model.data[t])t=this._model.data[t];else if(typeof t=="string"&&this._model.data[t.replace(/^#/,"")])t=this._model.data[t.replace(/^#/,"")];else if(typeof t=="string"&&(r=n("#"+t.replace(n.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[r.closest(".jstree-node").attr("id")])t=this._model.data[r.closest(".jstree-node").attr("id")];else if((r=this.element.find(t)).length&&this._model.data[r.closest(".jstree-node").attr("id")])t=this._model.data[r.closest(".jstree-node").attr("id")];else if((r=this.element.find(t)).length&&r.hasClass("jstree"))t=this._model.data[n.jstree.root];else return!1;return i&&(t=t.id===n.jstree.root?this.element:n("#"+t.id.replace(n.jstree.idregex,"\\$&"),this.element)),t}catch(u){return!1}},get_path:function(t,i,r){if(t=t.parents?t:this.get_node(t),!t||t.id===n.jstree.root||!t.parents)return!1;var f,e,u=[];for(u.push(r?t.id:t.text),f=0,e=t.parents.length;f<e;f++)u.push(r?t.parents[f]:this.get_text(t.parents[f]));return u=u.reverse().slice(1),i?u.join(i):u},get_next_dom:function(t,i){var r;if(t=this.get_node(t,!0),t[0]===this.element[0]){for(r=this._firstChild(this.get_container_ul()[0]);r&&r.offsetHeight===0;)r=this._nextSibling(r);return r?n(r):!1}if(!t||!t.length)return!1;if(i){r=t[0];do r=this._nextSibling(r);while(r&&r.offsetHeight===0);return r?n(r):!1}if(t.hasClass("jstree-open")){for(r=this._firstChild(t.children(".jstree-children")[0]);r&&r.offsetHeight===0;)r=this._nextSibling(r);if(r!==null)return n(r)}r=t[0];do r=this._nextSibling(r);while(r&&r.offsetHeight===0);return r!==null?n(r):t.parentsUntil(".jstree",".jstree-node").nextAll(".jstree-node:visible").first()},get_prev_dom:function(t,i){var r;if(t=this.get_node(t,!0),t[0]===this.element[0]){for(r=this.get_container_ul()[0].lastChild;r&&r.offsetHeight===0;)r=this._previousSibling(r);return r?n(r):!1}if(!t||!t.length)return!1;if(i){r=t[0];do r=this._previousSibling(r);while(r&&r.offsetHeight===0);return r?n(r):!1}r=t[0];do r=this._previousSibling(r);while(r&&r.offsetHeight===0);if(r!==null){for(t=n(r);t.hasClass("jstree-open");)t=t.children(".jstree-children").first().children(".jstree-node:visible:last");return t}return r=t[0].parentNode.parentNode,r&&r.className&&r.className.indexOf("jstree-node")!==-1?n(r):!1},get_parent:function(t){return(t=this.get_node(t),!t||t.id===n.jstree.root)?!1:t.parent},get_children_dom:function(n){return(n=this.get_node(n,!0),n[0]===this.element[0])?this.get_container_ul().children(".jstree-node"):!n||!n.length?!1:n.children(".jstree-children").children(".jstree-node")},is_parent:function(n){return n=this.get_node(n),n&&(n.state.loaded===!1||n.children.length>0)},is_loaded:function(n){return n=this.get_node(n),n&&n.state.loaded},is_loading:function(n){return n=this.get_node(n),n&&n.state&&n.state.loading},is_open:function(n){return n=this.get_node(n),n&&n.state.opened},is_closed:function(n){return n=this.get_node(n),n&&this.is_parent(n)&&!n.state.opened},is_leaf:function(n){return!this.is_parent(n)},load_node:function(t,i){var r,e,u,o,f;if(n.isArray(t))return this._load_nodes(t.slice(),i),!0;if(t=this.get_node(t),!t)return i&&i.call(this,t,!1),!1;if(t.state.loaded){for(t.state.loaded=!1,u=0,o=t.parents.length;u<o;u++)this._model.data[t.parents[u]].children_d=n.vakata.array_filter(this._model.data[t.parents[u]].children_d,function(i){return n.inArray(i,t.children_d)===-1});for(r=0,e=t.children_d.length;r<e;r++)this._model.data[t.children_d[r]].state.selected&&(f=!0),delete this._model.data[t.children_d[r]];f&&(this._data.core.selected=n.vakata.array_filter(this._data.core.selected,function(i){return n.inArray(i,t.children_d)===-1}));t.children=[];t.children_d=[];f&&this.trigger("changed",{action:"load_node",node:t,selected:this._data.core.selected})}return t.state.failed=!1,t.state.loading=!0,this.get_node(t,!0).addClass("jstree-loading").attr("aria-busy",!0),this._load_node(t,n.proxy(function(n){t=this._model.data[t.id];t.state.loading=!1;t.state.loaded=n;t.state.failed=!t.state.loaded;for(var r=this.get_node(t,!0),u=0,f=0,e=this._model.data,o=!1,u=0,f=t.children.length;u<f;u++)if(e[t.children[u]]&&!e[t.children[u]].state.hidden){o=!0;break}t.state.loaded&&r&&r.length&&(r.removeClass("jstree-closed jstree-open jstree-leaf"),o?t.id!=="#"&&r.addClass(t.state.opened?"jstree-open":"jstree-closed"):r.addClass("jstree-leaf"));r.removeClass("jstree-loading").attr("aria-busy",!1);this.trigger("load_node",{node:t,status:n});i&&i.call(this,t,n)},this)),!0},_load_nodes:function(n,t,i,r){for(var o=!0,h=function(){this._load_nodes(n,t,!0)},f=this._model.data,s=[],u=0,e=n.length;u<e;u++)!f[n[u]]||(f[n[u]].state.loaded||f[n[u]].state.failed)&&(i||!r)||(this.is_loading(n[u])||this.load_node(n[u],h),o=!1);if(o){for(u=0,e=n.length;u<e;u++)f[n[u]]&&f[n[u]].state.loaded&&s.push(n[u]);t&&!t.done&&(t.call(this,s),t.done=!0)}},load_all:function(t,i){if(t||(t=n.jstree.root),t=this.get_node(t),!t)return!1;var f=[],e=this._model.data,u=e[t.id].children_d,r,o;for(t.state&&!t.state.loaded&&f.push(t.id),r=0,o=u.length;r<o;r++)e[u[r]]&&e[u[r]].state&&!e[u[r]].state.loaded&&f.push(u[r]);f.length?this._load_nodes(f,function(){this.load_all(t,i)}):(i&&i.call(this,t),this.trigger("load_all",{node:t}))},_load_node:function(t,i){var r=this.settings.core.data,f,u=function(){return this.nodeType!==3&&this.nodeType!==8};return r?n.isFunction(r)?r.call(this,t,n.proxy(function(r){r===!1?i.call(this,!1):this[typeof r=="string"?"_append_html_data":"_append_json_data"](t,typeof r=="string"?n(n.parseHTML(r)).filter(u):r,function(n){i.call(this,n)})},this)):typeof r=="object"?r.url?(r=n.extend(!0,{},r),n.isFunction(r.url)&&(r.url=r.url.call(this,t)),n.isFunction(r.data)&&(r.data=r.data.call(this,t)),n.ajax(r).done(n.proxy(function(r,f,e){var o=e.getResponseHeader("Content-Type");return o&&o.indexOf("json")!==-1||typeof r=="object"?this._append_json_data(t,r,function(n){i.call(this,n)}):o&&o.indexOf("html")!==-1||typeof r=="string"?this._append_html_data(t,n(n.parseHTML(r)).filter(u),function(n){i.call(this,n)}):(this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:t.id,xhr:e})},this.settings.core.error.call(this,this._data.core.last_error),i.call(this,!1))},this)).fail(n.proxy(function(n){this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:t.id,xhr:n})};i.call(this,!1);this.settings.core.error.call(this,this._data.core.last_error)},this))):(f=n.isArray(r)?n.extend(!0,[],r):n.isPlainObject(r)?n.extend(!0,{},r):r,t.id===n.jstree.root?this._append_json_data(t,f,function(n){i.call(this,n)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_05",reason:"Could not load node",data:JSON.stringify({id:t.id})},this.settings.core.error.call(this,this._data.core.last_error),i.call(this,!1))):typeof r=="string"?t.id===n.jstree.root?this._append_html_data(t,n(n.parseHTML(r)).filter(u),function(n){i.call(this,n)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_06",reason:"Could not load node",data:JSON.stringify({id:t.id})},this.settings.core.error.call(this,this._data.core.last_error),i.call(this,!1)):i.call(this,!1):t.id===n.jstree.root?this._append_html_data(t,this._data.core.original_container_html.clone(!0),function(n){i.call(this,n)}):i.call(this,!1)},_node_changed:function(t){t=this.get_node(t);t&&n.inArray(t.id,this._model.changed)===-1&&this._model.changed.push(t.id)},_append_html_data:function(t,i,r){t=this.get_node(t);t.children=[];t.children_d=[];var a=i.is("ul")?i.children():i,o=t.id,c=[],u=[],s=this._model.data,f=s[o],v=this._data.core.selected.length,e,h,l;for(a.each(n.proxy(function(t,i){e=this._parse_model_from_html(n(i),o,f.parents.concat());e&&(c.push(e),u.push(e),s[e].children_d.length&&(u=u.concat(s[e].children_d)))},this)),f.children=c,f.children_d=u,h=0,l=f.parents.length;h<l;h++)s[f.parents[h]].children_d=s[f.parents[h]].children_d.concat(u);this.trigger("model",{nodes:u,parent:o});o!==n.jstree.root?(this._node_changed(o),this.redraw()):(this.get_container_ul().children(".jstree-initial-node").remove(),this.redraw(!0));this._data.core.selected.length!==v&&this.trigger("changed",{action:"model",selected:this._data.core.selected});r.call(this,!0)},_append_json_data:function(t,i,r,u){if(this.element!==null){t=this.get_node(t);t.children=[];t.children_d=[];i.d&&(i=i.d,typeof i=="string"&&(i=JSON.parse(i)));n.isArray(i)||(i=[i]);var f=null,o={df:this._model.default_state,dat:i,par:t.id,m:this._model.data,t_id:this._id,t_cnt:this._cnt,sel:this._data.core.selected},e=this,s=function(n,t){n.data&&(n=n.data);var u=n.dat,l=n.par,p=[],s=[],a=[],c=n.df,d=n.t_id,y=n.t_cnt,r=n.m,f=r[l],w=n.sel,h,i,o,v,b=function(n,i,u){u=u?u.concat():[];i&&u.unshift(i);var h=n.id.toString(),e,l,o,s,f={id:h,text:n.text||"",icon:n.icon!==t?n.icon:!0,parent:i,parents:u,children:n.children||[],children_d:n.children_d||[],data:n.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(e in c)c.hasOwnProperty(e)&&(f.state[e]=c[e]);if(n&&n.data&&n.data.jstree&&n.data.jstree.icon&&(f.icon=n.data.jstree.icon),(f.icon===t||f.icon===null||f.icon==="")&&(f.icon=!0),n&&n.data&&(f.data=n.data,n.data.jstree))for(e in n.data.jstree)n.data.jstree.hasOwnProperty(e)&&(f.state[e]=n.data.jstree[e]);if(n&&typeof n.state=="object")for(e in n.state)n.state.hasOwnProperty(e)&&(f.state[e]=n.state[e]);if(n&&typeof n.li_attr=="object")for(e in n.li_attr)n.li_attr.hasOwnProperty(e)&&(f.li_attr[e]=n.li_attr[e]);if(f.li_attr.id||(f.li_attr.id=h),n&&typeof n.a_attr=="object")for(e in n.a_attr)n.a_attr.hasOwnProperty(e)&&(f.a_attr[e]=n.a_attr[e]);for(n&&n.children&&n.children===!0&&(f.state.loaded=!1,f.children=[],f.children_d=[]),r[f.id]=f,e=0,l=f.children.length;e<l;e++)o=b(r[f.children[e]],f.id,u),s=r[o],f.children_d.push(o),s.children_d.length&&(f.children_d=f.children_d.concat(s.children_d));return delete n.data,delete n.children,r[f.id].original=n,f.state.selected&&a.push(f.id),f.id},k=function(n,i,u){u=u?u.concat():[];i&&u.unshift(i);var o=!1,e,l,s,h,f;do o="j"+d+"_"+ ++y;while(r[o]);f={id:!1,text:typeof n=="string"?n:"",icon:typeof n=="object"&&n.icon!==t?n.icon:!0,parent:i,parents:u,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(e in c)c.hasOwnProperty(e)&&(f.state[e]=c[e]);if(n&&n.id&&(f.id=n.id.toString()),n&&n.text&&(f.text=n.text),n&&n.data&&n.data.jstree&&n.data.jstree.icon&&(f.icon=n.data.jstree.icon),(f.icon===t||f.icon===null||f.icon==="")&&(f.icon=!0),n&&n.data&&(f.data=n.data,n.data.jstree))for(e in n.data.jstree)n.data.jstree.hasOwnProperty(e)&&(f.state[e]=n.data.jstree[e]);if(n&&typeof n.state=="object")for(e in n.state)n.state.hasOwnProperty(e)&&(f.state[e]=n.state[e]);if(n&&typeof n.li_attr=="object")for(e in n.li_attr)n.li_attr.hasOwnProperty(e)&&(f.li_attr[e]=n.li_attr[e]);if(f.li_attr.id&&!f.id&&(f.id=f.li_attr.id.toString()),f.id||(f.id=o),f.li_attr.id||(f.li_attr.id=f.id),n&&typeof n.a_attr=="object")for(e in n.a_attr)n.a_attr.hasOwnProperty(e)&&(f.a_attr[e]=n.a_attr[e]);if(n&&n.children&&n.children.length){for(e=0,l=n.children.length;e<l;e++)s=k(n.children[e],f.id,u),h=r[s],f.children.push(s),h.children_d.length&&(f.children_d=f.children_d.concat(h.children_d));f.children_d=f.children_d.concat(f.children)}return n&&n.children&&n.children===!0&&(f.state.loaded=!1,f.children=[],f.children_d=[]),delete n.data,delete n.children,f.original=n,r[f.id]=f,f.state.selected&&a.push(f.id),f.id};if(u.length&&u[0].id!==t&&u[0].parent!==t){for(i=0,o=u.length;i<o;i++)u[i].children||(u[i].children=[]),u[i].state||(u[i].state={}),r[u[i].id.toString()]=u[i];for(i=0,o=u.length;i<o;i++){if(!r[u[i].parent.toString()]){typeof e!="undefined"&&(e._data.core.last_error={error:"parse",plugin:"core",id:"core_07",reason:"Node with invalid parent",data:JSON.stringify({id:u[i].id.toString(),parent:u[i].parent.toString()})},e.settings.core.error.call(e,e._data.core.last_error));continue}r[u[i].parent.toString()].children.push(u[i].id.toString());f.children_d.push(u[i].id.toString())}for(i=0,o=f.children.length;i<o;i++)h=b(r[f.children[i]],l,f.parents.concat()),s.push(h),r[h].children_d.length&&(s=s.concat(r[h].children_d));for(i=0,o=f.parents.length;i<o;i++)r[f.parents[i]].children_d=r[f.parents[i]].children_d.concat(s);v={cnt:y,mod:r,sel:w,par:l,dpc:s,add:a}}else{for(i=0,o=u.length;i<o;i++)h=k(u[i],l,f.parents.concat()),h&&(p.push(h),s.push(h),r[h].children_d.length&&(s=s.concat(r[h].children_d)));for(f.children=p,f.children_d=s,i=0,o=f.parents.length;i<o;i++)r[f.parents[i]].children_d=r[f.parents[i]].children_d.concat(s);v={cnt:y,mod:r,sel:w,par:l,dpc:s,add:a}}if(typeof window=="undefined"||typeof window.document=="undefined")postMessage(v);else return v},h=function(t,i){var u,f;if(this.element!==null){this._cnt=t.cnt;f=this._model.data;for(u in f)f.hasOwnProperty(u)&&f[u].state&&f[u].state.loading&&t.mod[u]&&(t.mod[u].state.loading=!0);if(this._model.data=t.mod,i){var s,h=t.add,e=t.sel,o=this._data.core.selected.slice();if(f=this._model.data,e.length!==o.length||n.vakata.array_unique(e.concat(o)).length!==e.length){for(u=0,s=e.length;u<s;u++)n.inArray(e[u],h)===-1&&n.inArray(e[u],o)===-1&&(f[e[u]].state.selected=!1);for(u=0,s=o.length;u<s;u++)n.inArray(o[u],e)===-1&&(f[o[u]].state.selected=!0)}}t.add.length&&(this._data.core.selected=this._data.core.selected.concat(t.add));this.trigger("model",{nodes:t.dpc,parent:t.par});t.par!==n.jstree.root?(this._node_changed(t.par),this.redraw()):this.redraw(!0);t.add.length&&this.trigger("changed",{action:"model",selected:this._data.core.selected});r.call(this,!0)}};if(this.settings.core.worker&&window.Blob&&window.URL&&window.Worker)try{this._wrk===null&&(this._wrk=window.URL.createObjectURL(new window.Blob(["self.onmessage = "+s.toString()],{type:"text/javascript"})));!this._data.core.working||u?(this._data.core.working=!0,f=new window.Worker(this._wrk),f.onmessage=n.proxy(function(n){h.call(this,n.data,!0);try{f.terminate();f=null}catch(t){}this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1},this),o.par?f.postMessage(o):this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1):this._data.core.worker_queue.push([t,i,r,!0])}catch(c){h.call(this,s(o),!1);this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1}else h.call(this,s(o),!1)}},_parse_model_from_html:function(i,r,u){u=u?[].concat(u):[];r&&u.unshift(r);var s,h,l=this._model.data,f={id:!1,text:!1,icon:!0,parent:r,parents:u,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},o,e,c;for(o in this._model.default_state)this._model.default_state.hasOwnProperty(o)&&(f.state[o]=this._model.default_state[o]);if(e=n.vakata.attributes(i,!0),n.each(e,function(t,i){if(i=n.trim(i),!i.length)return!0;f.li_attr[t]=i;t==="id"&&(f.id=i.toString())}),e=i.children("a").first(),e.length&&(e=n.vakata.attributes(e,!0),n.each(e,function(t,i){i=n.trim(i);i.length&&(f.a_attr[t]=i)})),e=i.children("a").first().length?i.children("a").first().clone():i.clone(),e.children("ins, i, ul").remove(),e=e.html(),e=n("<div />").html(e),f.text=this.settings.core.force_text?e.text():e.html(),e=i.data(),f.data=e?n.extend(!0,{},e):null,f.state.opened=i.hasClass("jstree-open"),f.state.selected=i.children("a").hasClass("jstree-clicked"),f.state.disabled=i.children("a").hasClass("jstree-disabled"),f.data&&f.data.jstree)for(o in f.data.jstree)f.data.jstree.hasOwnProperty(o)&&(f.state[o]=f.data.jstree[o]);e=i.children("a").children(".jstree-themeicon");e.length&&(f.icon=e.hasClass("jstree-themeicon-hidden")?!1:e.attr("rel"));f.state.icon!==t&&(f.icon=f.state.icon);(f.icon===t||f.icon===null||f.icon==="")&&(f.icon=!0);e=i.children("ul").children("li");do c="j"+this._id+"_"+ ++this._cnt;while(l[c]);return f.id=f.li_attr.id?f.li_attr.id.toString():c,e.length?(e.each(n.proxy(function(t,i){s=this._parse_model_from_html(n(i),f.id,u);h=this._model.data[s];f.children.push(s);h.children_d.length&&(f.children_d=f.children_d.concat(h.children_d))},this)),f.children_d=f.children_d.concat(f.children)):i.hasClass("jstree-closed")&&(f.state.loaded=!1),f.li_attr["class"]&&(f.li_attr["class"]=f.li_attr["class"].replace("jstree-closed","").replace("jstree-open","")),f.a_attr["class"]&&(f.a_attr["class"]=f.a_attr["class"].replace("jstree-clicked","").replace("jstree-disabled","")),l[f.id]=f,f.state.selected&&this._data.core.selected.push(f.id),f.id},_parse_model_from_flat_json:function(n,i,r){r=r?r.concat():[];i&&r.unshift(i);var c=n.id.toString(),e=this._model.data,o=this._model.default_state,f,l,s,h,u={id:c,text:n.text||"",icon:n.icon!==t?n.icon:!0,parent:i,parents:r,children:n.children||[],children_d:n.children_d||[],data:n.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in o)o.hasOwnProperty(f)&&(u.state[f]=o[f]);if(n&&n.data&&n.data.jstree&&n.data.jstree.icon&&(u.icon=n.data.jstree.icon),(u.icon===t||u.icon===null||u.icon==="")&&(u.icon=!0),n&&n.data&&(u.data=n.data,n.data.jstree))for(f in n.data.jstree)n.data.jstree.hasOwnProperty(f)&&(u.state[f]=n.data.jstree[f]);if(n&&typeof n.state=="object")for(f in n.state)n.state.hasOwnProperty(f)&&(u.state[f]=n.state[f]);if(n&&typeof n.li_attr=="object")for(f in n.li_attr)n.li_attr.hasOwnProperty(f)&&(u.li_attr[f]=n.li_attr[f]);if(u.li_attr.id||(u.li_attr.id=c),n&&typeof n.a_attr=="object")for(f in n.a_attr)n.a_attr.hasOwnProperty(f)&&(u.a_attr[f]=n.a_attr[f]);for(n&&n.children&&n.children===!0&&(u.state.loaded=!1,u.children=[],u.children_d=[]),e[u.id]=u,f=0,l=u.children.length;f<l;f++)s=this._parse_model_from_flat_json(e[u.children[f]],u.id,r),h=e[s],u.children_d.push(s),h.children_d.length&&(u.children_d=u.children_d.concat(h.children_d));return delete n.data,delete n.children,e[u.id].original=n,u.state.selected&&this._data.core.selected.push(u.id),u.id},_parse_model_from_json:function(n,i,r){r=r?r.concat():[];i&&r.unshift(i);var e=!1,f,l,o,s,h=this._model.data,c=this._model.default_state,u;do e="j"+this._id+"_"+ ++this._cnt;while(h[e]);u={id:!1,text:typeof n=="string"?n:"",icon:typeof n=="object"&&n.icon!==t?n.icon:!0,parent:i,parents:r,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in c)c.hasOwnProperty(f)&&(u.state[f]=c[f]);if(n&&n.id&&(u.id=n.id.toString()),n&&n.text&&(u.text=n.text),n&&n.data&&n.data.jstree&&n.data.jstree.icon&&(u.icon=n.data.jstree.icon),(u.icon===t||u.icon===null||u.icon==="")&&(u.icon=!0),n&&n.data&&(u.data=n.data,n.data.jstree))for(f in n.data.jstree)n.data.jstree.hasOwnProperty(f)&&(u.state[f]=n.data.jstree[f]);if(n&&typeof n.state=="object")for(f in n.state)n.state.hasOwnProperty(f)&&(u.state[f]=n.state[f]);if(n&&typeof n.li_attr=="object")for(f in n.li_attr)n.li_attr.hasOwnProperty(f)&&(u.li_attr[f]=n.li_attr[f]);if(u.li_attr.id&&!u.id&&(u.id=u.li_attr.id.toString()),u.id||(u.id=e),u.li_attr.id||(u.li_attr.id=u.id),n&&typeof n.a_attr=="object")for(f in n.a_attr)n.a_attr.hasOwnProperty(f)&&(u.a_attr[f]=n.a_attr[f]);if(n&&n.children&&n.children.length){for(f=0,l=n.children.length;f<l;f++)o=this._parse_model_from_json(n.children[f],u.id,r),s=h[o],u.children.push(o),s.children_d.length&&(u.children_d=u.children_d.concat(s.children_d));u.children_d=u.children.concat(u.children_d)}return n&&n.children&&n.children===!0&&(u.state.loaded=!1,u.children=[],u.children_d=[]),delete n.data,delete n.children,u.original=n,h[u.id]=u,u.state.selected&&this._data.core.selected.push(u.id),u.id},_redraw:function(){for(var f=this._model.force_full_redraw?this._model.data[n.jstree.root].children.concat([]):this._model.changed.concat([]),r=i.createElement("UL"),t,o=this._data.core.focused,u=0,e=f.length;u<e;u++)t=this.redraw_node(f[u],!0,this._model.force_full_redraw),t&&this._model.force_full_redraw&&r.appendChild(t);this._model.force_full_redraw&&(r.className=this.get_container_ul()[0].className,r.setAttribute("role","group"),this.element.empty().append(r));o!==null&&this.settings.core.restore_focus&&(t=this.get_node(o,!0),t&&t.length&&t.children(".jstree-anchor")[0]!==i.activeElement?t.children(".jstree-anchor").focus():this._data.core.focused=null);this._model.force_full_redraw=!1;this._model.changed=[];this.trigger("redraw",{nodes:f})},redraw:function(n){n&&(this._model.force_full_redraw=!0);this._redraw()},draw_children:function(t){var r=this.get_node(t),f=!1,e=!1,u=!1,o=i;if(!r)return!1;if(r.id===n.jstree.root)return this.redraw(!0);if(t=this.get_node(t,!0),!t||!t.length)return!1;if(t.children(".jstree-children").remove(),t=t[0],r.children.length&&r.state.loaded){for(u=o.createElement("UL"),u.setAttribute("role","group"),u.className="jstree-children",f=0,e=r.children.length;f<e;f++)u.appendChild(this.redraw_node(r.children[f],!0,!0));t.appendChild(u)}},redraw_node:function(t,r,u,f){var e=this.get_node(t),s=!1,y=!1,w=!1,o=!1,h=!1,v=!1,c="",b=i,l=this._model.data,k=!1,a=null,d=0,g=0,nt=!1,p=!1;if(!e)return!1;if(e.id===n.jstree.root)return this.redraw(!0);if(r=r||e.children.length===0,t=i.querySelector?this.element[0].querySelector("#"+("0123456789".indexOf(e.id[0])!==-1?"\\3"+e.id[0]+" "+e.id.substr(1).replace(n.jstree.idregex,"\\$&"):e.id.replace(n.jstree.idregex,"\\$&"))):i.getElementById(e.id),t)t=n(t),u||(s=t.parent().parent()[0],s===this.element[0]&&(s=null),y=t.index()),r||!e.children.length||t.children(".jstree-children").length||(r=!0),r||(w=t.children(".jstree-children")[0]),k=t.children(".jstree-anchor")[0]===i.activeElement,t.remove();else if(r=!0,!u){if(s=e.parent!==n.jstree.root?n("#"+e.parent.replace(n.jstree.idregex,"\\$&"),this.element)[0]:null,s!==null&&(!s||!l[e.parent].state.opened))return!1;y=n.inArray(e.id,s===null?l[n.jstree.root].children:l[e.parent].children)}t=this._data.core.node.cloneNode(!0);c="jstree-node ";for(o in e.li_attr)if(e.li_attr.hasOwnProperty(o)){if(o==="id")continue;o!=="class"?t.setAttribute(o,e.li_attr[o]):c+=e.li_attr[o]}for(e.a_attr.id||(e.a_attr.id=e.id+"_anchor"),t.setAttribute("aria-selected",!!e.state.selected),t.setAttribute("aria-level",e.parents.length),t.setAttribute("aria-labelledby",e.a_attr.id),e.state.disabled&&t.setAttribute("aria-disabled",!0),o=0,h=e.children.length;o<h;o++)if(!l[e.children[o]].state.hidden){nt=!0;break}if(e.parent!==null&&l[e.parent]&&!e.state.hidden&&(o=n.inArray(e.id,l[e.parent].children),p=e.id,o!==-1))for(o++,h=l[e.parent].children.length;o<h;o++)if(l[l[e.parent].children[o]].state.hidden||(p=l[e.parent].children[o]),p!==e.id)break;e.state.hidden&&(c+=" jstree-hidden");e.state.loading&&(c+=" jstree-loading");e.state.loaded&&!nt?c+=" jstree-leaf":(c+=e.state.opened&&e.state.loaded?" jstree-open":" jstree-closed",t.setAttribute("aria-expanded",e.state.opened&&e.state.loaded));p===e.id&&(c+=" jstree-last");t.id=e.id;t.className=c;c=(e.state.selected?" jstree-clicked":"")+(e.state.disabled?" jstree-disabled":"");for(h in e.a_attr)if(e.a_attr.hasOwnProperty(h)){if(h==="href"&&e.a_attr[h]==="#")continue;h!=="class"?t.childNodes[1].setAttribute(h,e.a_attr[h]):c+=" "+e.a_attr[h]}if(c.length&&(t.childNodes[1].className="jstree-anchor "+c),(e.icon&&e.icon!==!0||e.icon===!1)&&(e.icon===!1?t.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":e.icon.indexOf("/")===-1&&e.icon.indexOf(".")===-1?t.childNodes[1].childNodes[0].className+=" "+e.icon+" jstree-themeicon-custom":(t.childNodes[1].childNodes[0].style.backgroundImage='url("'+e.icon+'")',t.childNodes[1].childNodes[0].style.backgroundPosition="center center",t.childNodes[1].childNodes[0].style.backgroundSize="auto",t.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),this.settings.core.force_text?t.childNodes[1].appendChild(b.createTextNode(e.text)):t.childNodes[1].innerHTML+=e.text,r&&e.children.length&&(e.state.opened||f)&&e.state.loaded){for(v=b.createElement("UL"),v.setAttribute("role","group"),v.className="jstree-children",o=0,h=e.children.length;o<h;o++)v.appendChild(this.redraw_node(e.children[o],r,!0));t.appendChild(v)}if(w&&t.appendChild(w),!u){for(s||(s=this.element[0]),o=0,h=s.childNodes.length;o<h;o++)if(s.childNodes[o]&&s.childNodes[o].className&&s.childNodes[o].className.indexOf("jstree-children")!==-1){a=s.childNodes[o];break}a||(a=b.createElement("UL"),a.setAttribute("role","group"),a.className="jstree-children",s.appendChild(a));s=a;y<s.childNodes.length?s.insertBefore(t,s.childNodes[y]):s.appendChild(t);k&&(d=this.element[0].scrollTop,g=this.element[0].scrollLeft,t.childNodes[1].focus(),this.element[0].scrollTop=d,this.element[0].scrollLeft=g)}return e.state.opened&&!e.state.loaded&&(e.state.opened=!1,setTimeout(n.proxy(function(){this.open_node(e.id,!1,0)},this),0)),t},open_node:function(i,r,u){var e,s,f,o;if(n.isArray(i)){for(i=i.slice(),e=0,s=i.length;e<s;e++)this.open_node(i[e],r,u);return!0}if(i=this.get_node(i),!i||i.id===n.jstree.root)return!1;if(u=u===t?this.settings.core.animation:u,!this.is_closed(i))return r&&r.call(this,i,!1),!1;if(this.is_loaded(i))return f=this.get_node(i,!0),o=this,f.length&&(u&&f.children(".jstree-children").length&&f.children(".jstree-children").stop(!0,!0),i.children.length&&!this._firstChild(f.children(".jstree-children")[0])&&this.draw_children(i),u?(this.trigger("before_open",{node:i}),f.children(".jstree-children").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",!0).children(".jstree-children").stop(!0,!0).slideDown(u,function(){this.style.display="";o.element&&o.trigger("after_open",{node:i})})):(this.trigger("before_open",{node:i}),f[0].className=f[0].className.replace("jstree-closed","jstree-open"),f[0].setAttribute("aria-expanded",!0))),i.state.opened=!0,r&&r.call(this,i,!0),f.length||this.trigger("before_open",{node:i}),this.trigger("open_node",{node:i}),u&&f.length||this.trigger("after_open",{node:i}),!0;if(this.is_loading(i))return setTimeout(n.proxy(function(){this.open_node(i,r,u)},this),500);this.load_node(i,function(n,t){return t?this.open_node(n,r,u):r?r.call(this,n,!1):!1})},_open_to:function(t){if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;for(var u=t.parents,i=0,r=u.length;i<r;i+=1)i!==n.jstree.root&&this.open_node(u[i],!1,0);return n("#"+t.id.replace(n.jstree.idregex,"\\$&"),this.element)},close_node:function(i,r){var f,o,e,u;if(n.isArray(i)){for(i=i.slice(),f=0,o=i.length;f<o;f++)this.close_node(i[f],r);return!0}if((i=this.get_node(i),!i||i.id===n.jstree.root)||this.is_closed(i))return!1;r=r===t?this.settings.core.animation:r;e=this;u=this.get_node(i,!0);i.state.opened=!1;this.trigger("close_node",{node:i});u.length?r?u.children(".jstree-children").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",!1).children(".jstree-children").stop(!0,!0).slideUp(r,function(){this.style.display="";u.children(".jstree-children").remove();e.element&&e.trigger("after_close",{node:i})}):(u[0].className=u[0].className.replace("jstree-open","jstree-closed"),u.attr("aria-expanded",!1).children(".jstree-children").remove(),this.trigger("after_close",{node:i})):this.trigger("after_close",{node:i})},toggle_node:function(t){var i,r;if(n.isArray(t)){for(t=t.slice(),i=0,r=t.length;i<r;i++)this.toggle_node(t[i]);return!0}return this.is_closed(t)?this.open_node(t):this.is_open(t)?this.close_node(t):void 0},open_all:function(t,i,r){if(t||(t=n.jstree.root),t=this.get_node(t),!t)return!1;var u=t.id===n.jstree.root?this.get_container_ul():this.get_node(t,!0),f,e,o;if(!u.length){for(f=0,e=t.children_d.length;f<e;f++)this.is_closed(this._model.data[t.children_d[f]])&&(this._model.data[t.children_d[f]].state.opened=!0);return this.trigger("open_all",{node:t})}r=r||u;o=this;u=this.is_closed(t)?u.find(".jstree-closed").addBack():u.find(".jstree-closed");u.each(function(){o.open_node(this,function(n,t){t&&this.is_parent(n)&&this.open_all(n,i,r)},i||0)});r.find(".jstree-closed").length===0&&this.trigger("open_all",{node:this.get_node(r)})},close_all:function(t,i){if(t||(t=n.jstree.root),t=this.get_node(t),!t)return!1;var r=t.id===n.jstree.root?this.get_container_ul():this.get_node(t,!0),e=this,u,f;for(r.length&&(r=this.is_open(t)?r.find(".jstree-open").addBack():r.find(".jstree-open"),n(r.get().reverse()).each(function(){e.close_node(this,i||0)})),u=0,f=t.children_d.length;u<f;u++)this._model.data[t.children_d[u]].state.opened=!1;this.trigger("close_all",{node:t})},is_disabled:function(n){return n=this.get_node(n),n&&n.state&&n.state.disabled},enable_node:function(t){var i,r;if(n.isArray(t)){for(t=t.slice(),i=0,r=t.length;i<r;i++)this.enable_node(t[i]);return!0}if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;t.state.disabled=!1;this.get_node(t,!0).children(".jstree-anchor").removeClass("jstree-disabled").attr("aria-disabled",!1);this.trigger("enable_node",{node:t})},disable_node:function(t){var i,r;if(n.isArray(t)){for(t=t.slice(),i=0,r=t.length;i<r;i++)this.disable_node(t[i]);return!0}if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;t.state.disabled=!0;this.get_node(t,!0).children(".jstree-anchor").addClass("jstree-disabled").attr("aria-disabled",!0);this.trigger("disable_node",{node:t})},is_hidden:function(n){return n=this.get_node(n),n.state.hidden===!0},hide_node:function(t,i){var r,u;if(n.isArray(t)){for(t=t.slice(),r=0,u=t.length;r<u;r++)this.hide_node(t[r],!0);return i||this.redraw(),!0}if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;t.state.hidden||(t.state.hidden=!0,this._node_changed(t.parent),i||this.redraw(),this.trigger("hide_node",{node:t}))},show_node:function(t,i){var r,u;if(n.isArray(t)){for(t=t.slice(),r=0,u=t.length;r<u;r++)this.show_node(t[r],!0);return i||this.redraw(),!0}if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;t.state.hidden&&(t.state.hidden=!1,this._node_changed(t.parent),i||this.redraw(),this.trigger("show_node",{node:t}))},hide_all:function(t){var i,r=this._model.data,u=[];for(i in r)r.hasOwnProperty(i)&&i!==n.jstree.root&&!r[i].state.hidden&&(r[i].state.hidden=!0,u.push(i));return this._model.force_full_redraw=!0,t||this.redraw(),this.trigger("hide_all",{nodes:u}),u},show_all:function(t){var i,r=this._model.data,u=[];for(i in r)r.hasOwnProperty(i)&&i!==n.jstree.root&&r[i].state.hidden&&(r[i].state.hidden=!1,u.push(i));return this._model.force_full_redraw=!0,t||this.redraw(),this.trigger("show_all",{nodes:u}),u},activate_node:function(n,i){if(this.is_disabled(n))return!1;if(i&&typeof i=="object"||(i={}),this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==t?this.get_node(this._data.core.last_clicked.id):null,this._data.core.last_clicked&&!this._data.core.last_clicked.state.selected&&(this._data.core.last_clicked=null),!this._data.core.last_clicked&&this._data.core.selected.length&&(this._data.core.last_clicked=this.get_node(this._data.core.selected[this._data.core.selected.length-1])),this.settings.core.multiple&&(i.metaKey||i.ctrlKey||i.shiftKey)&&(!i.shiftKey||this._data.core.last_clicked&&this.get_parent(n)&&this.get_parent(n)===this._data.core.last_clicked.parent))if(i.shiftKey){for(var e=this.get_node(n).id,o=this._data.core.last_clicked.id,u=this.get_node(this._data.core.last_clicked.parent).children,f=!1,r=0,s=u.length;r<s;r+=1)u[r]===e&&(f=!f),u[r]===o&&(f=!f),!this.is_disabled(u[r])&&(f||u[r]===e||u[r]===o)?this.is_hidden(u[r])||this.select_node(u[r],!0,!1,i):this.deselect_node(u[r],!0,i);this.trigger("changed",{action:"select_node",node:this.get_node(n),selected:this._data.core.selected,event:i})}else this.is_selected(n)?this.deselect_node(n,!1,i):this.select_node(n,!1,!1,i);else!this.settings.core.multiple&&(i.metaKey||i.ctrlKey||i.shiftKey)&&this.is_selected(n)?this.deselect_node(n,!1,i):(this.deselect_all(!0),this.select_node(n,!1,!1,i),this._data.core.last_clicked=this.get_node(n));this.trigger("activate_node",{node:this.get_node(n),event:i})},hover_node:function(n){if(n=this.get_node(n,!0),!n||!n.length||n.children(".jstree-hovered").length)return!1;var t=this.element.find(".jstree-hovered"),i=this.element;t&&t.length&&this.dehover_node(t);n.children(".jstree-anchor").addClass("jstree-hovered");this.trigger("hover_node",{node:this.get_node(n)});setTimeout(function(){i.attr("aria-activedescendant",n[0].id)},0)},dehover_node:function(n){if(n=this.get_node(n,!0),!n||!n.length||!n.children(".jstree-hovered").length)return!1;n.children(".jstree-anchor").removeClass("jstree-hovered");this.trigger("dehover_node",{node:this.get_node(n)})},select_node:function(t,i,r,u){var f,e,o;if(n.isArray(t)){for(t=t.slice(),e=0,o=t.length;e<o;e++)this.select_node(t[e],i,r,u);return!0}if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;f=this.get_node(t,!0);t.state.selected||(t.state.selected=!0,this._data.core.selected.push(t.id),r||(f=this._open_to(t)),f&&f.length&&f.attr("aria-selected",!0).children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("select_node",{node:t,selected:this._data.core.selected,event:u}),i||this.trigger("changed",{action:"select_node",node:t,selected:this._data.core.selected,event:u}))},deselect_node:function(t,i,r){var u,e,f;if(n.isArray(t)){for(t=t.slice(),u=0,e=t.length;u<e;u++)this.deselect_node(t[u],i,r);return!0}if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;f=this.get_node(t,!0);t.state.selected&&(t.state.selected=!1,this._data.core.selected=n.vakata.array_remove_item(this._data.core.selected,t.id),f.length&&f.attr("aria-selected",!1).children(".jstree-anchor").removeClass("jstree-clicked"),this.trigger("deselect_node",{node:t,selected:this._data.core.selected,event:r}),i||this.trigger("changed",{action:"deselect_node",node:t,selected:this._data.core.selected,event:r}))},select_all:function(t){var u=this._data.core.selected.concat([]),i,r;for(this._data.core.selected=this._model.data[n.jstree.root].children_d.concat(),i=0,r=this._data.core.selected.length;i<r;i++)this._model.data[this._data.core.selected[i]]&&(this._model.data[this._data.core.selected[i]].state.selected=!0);this.redraw(!0);this.trigger("select_all",{selected:this._data.core.selected});t||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:u})},deselect_all:function(n){for(var i=this._data.core.selected.concat([]),t=0,r=this._data.core.selected.length;t<r;t++)this._model.data[this._data.core.selected[t]]&&(this._model.data[this._data.core.selected[t]].state.selected=!1);this._data.core.selected=[];this.element.find(".jstree-clicked").removeClass("jstree-clicked").parent().attr("aria-selected",!1);this.trigger("deselect_all",{selected:this._data.core.selected,node:i});n||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:i})},is_selected:function(t){return(t=this.get_node(t),!t||t.id===n.jstree.root)?!1:t.state.selected},get_selected:function(t){return t?n.map(this._data.core.selected,n.proxy(function(n){return this.get_node(n)},this)):this._data.core.selected.slice()},get_top_selected:function(t){for(var r=this.get_selected(!0),u={},f,o,i=0,e=r.length;i<e;i++)u[r[i].id]=r[i];for(i=0,e=r.length;i<e;i++)for(f=0,o=r[i].children_d.length;f<o;f++)u[r[i].children_d[f]]&&delete u[r[i].children_d[f]];r=[];for(i in u)u.hasOwnProperty(i)&&r.push(i);return t?n.map(r,n.proxy(function(n){return this.get_node(n)},this)):r},get_bottom_selected:function(t){for(var r=this.get_selected(!0),u=[],i=0,f=r.length;i<f;i++)r[i].children.length||u.push(r[i].id);return t?n.map(u,n.proxy(function(n){return this.get_node(n)},this)):u},get_state:function(){var i={core:{open:[],loaded:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},selected:[]}};for(var t in this._model.data)this._model.data.hasOwnProperty(t)&&t!==n.jstree.root&&(this._model.data[t].state.loaded&&this.settings.core.loaded_state&&i.core.loaded.push(t),this._model.data[t].state.opened&&i.core.open.push(t),this._model.data[t].state.selected&&i.core.selected.push(t));return i},set_state:function(i,r){if(i){if(i.core&&i.core.selected&&i.core.initial_selection===t&&(i.core.initial_selection=this._data.core.selected.concat([]).sort().join(",")),i.core){var f,u;if(i.core.loaded)return this.settings.core.loaded_state&&n.isArray(i.core.loaded)&&i.core.loaded.length?this._load_nodes(i.core.loaded,function(){delete i.core.loaded;this.set_state(i,r)}):(delete i.core.loaded,this.set_state(i,r)),!1;if(i.core.open)return n.isArray(i.core.open)&&i.core.open.length?this._load_nodes(i.core.open,function(n){this.open_node(n,!1,0);delete i.core.open;this.set_state(i,r)}):(delete i.core.open,this.set_state(i,r)),!1;if(i.core.scroll)return i.core.scroll&&i.core.scroll.left!==t&&this.element.scrollLeft(i.core.scroll.left),i.core.scroll&&i.core.scroll.top!==t&&this.element.scrollTop(i.core.scroll.top),delete i.core.scroll,this.set_state(i,r),!1;if(i.core.selected)return f=this,(i.core.initial_selection===t||i.core.initial_selection===this._data.core.selected.concat([]).sort().join(","))&&(this.deselect_all(),n.each(i.core.selected,function(n,t){f.select_node(t,!1,!0)})),delete i.core.initial_selection,delete i.core.selected,this.set_state(i,r),!1;for(u in i)i.hasOwnProperty(u)&&u!=="core"&&n.inArray(u,this.settings.plugins)===-1&&delete i[u];if(n.isEmptyObject(i.core))return delete i.core,this.set_state(i,r),!1}return n.isEmptyObject(i)?(i=null,r&&r.call(this),this.trigger("set_state"),!1):!0}return!1},refresh:function(t,i){this._data.core.state=i===!0?{}:this.get_state();i&&n.isFunction(i)&&(this._data.core.state=i.call(this,this._data.core.state));this._cnt=0;this._model.data={};this._model.data[n.jstree.root]={id:n.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}};this._data.core.selected=[];this._data.core.last_clicked=null;this._data.core.focused=null;var r=this.get_container_ul()[0].className;t||(this.element.html("<ul class='"+r+"' role='group'><li class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='treeitem' id='j"+this._id+"_loading'><i class='jstree-icon jstree-ocl'><\/i><a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'><\/i>"+this.get_string("Loading ...")+"<\/a><\/li><\/ul>"),this.element.attr("aria-activedescendant","j"+this._id+"_loading"));this.load_node(n.jstree.root,function(t,i){i&&(this.get_container_ul()[0].className=r,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.set_state(n.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")}));this._data.core.state=null})},refresh_node:function(t){if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;var i=[],r=[],u=this._data.core.selected.concat([]);r.push(t.id);t.state.opened===!0&&i.push(t.id);this.get_node(t,!0).find(".jstree-open").each(function(){r.push(this.id);i.push(this.id)});this._load_nodes(r,n.proxy(function(n){this.open_node(i,!1,0);this.select_node(u);this.trigger("refresh_node",{node:t,nodes:n})},this),!1,!0)},set_id:function(t,i){if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;var r,f,u=this._model.data,e=t.id;for(i=i.toString(),u[t.parent].children[n.inArray(t.id,u[t.parent].children)]=i,r=0,f=t.parents.length;r<f;r++)u[t.parents[r]].children_d[n.inArray(t.id,u[t.parents[r]].children_d)]=i;for(r=0,f=t.children.length;r<f;r++)u[t.children[r]].parent=i;for(r=0,f=t.children_d.length;r<f;r++)u[t.children_d[r]].parents[n.inArray(t.id,u[t.children_d[r]].parents)]=i;return r=n.inArray(t.id,this._data.core.selected),r!==-1&&(this._data.core.selected[r]=i),r=this.get_node(t.id,!0),r&&(r.attr("id",i),this.element.attr("aria-activedescendant")===t.id&&this.element.attr("aria-activedescendant",i)),delete u[t.id],t.id=i,t.li_attr.id=i,u[i]=t,this.trigger("set_id",{node:t,"new":t.id,old:e}),!0},get_text:function(t){return t=this.get_node(t),!t||t.id===n.jstree.root?!1:t.text},set_text:function(t,i){var r,u;if(n.isArray(t)){for(t=t.slice(),r=0,u=t.length;r<u;r++)this.set_text(t[r],i);return!0}return(t=this.get_node(t),!t||t.id===n.jstree.root)?!1:(t.text=i,this.get_node(t,!0).length&&this.redraw_node(t.id),this.trigger("set_text",{obj:t,text:i}),!0)},get_json:function(t,i,r){if(t=this.get_node(t||n.jstree.root),!t)return!1;i&&i.flat&&!r&&(r=[]);var u={id:t.id,text:t.text,icon:this.get_icon(t),li_attr:n.extend(!0,{},t.li_attr),a_attr:n.extend(!0,{},t.a_attr),state:{},data:i&&i.no_data?!1:n.extend(!0,n.isArray(t.data)?[]:{},t.data)},f,e;if(i&&i.flat?u.parent=t.parent:u.children=[],i&&i.no_state)delete u.state;else for(f in t.state)t.state.hasOwnProperty(f)&&(u.state[f]=t.state[f]);if(i&&i.no_li_attr&&delete u.li_attr,i&&i.no_a_attr&&delete u.a_attr,i&&i.no_id&&(delete u.id,u.li_attr&&u.li_attr.id&&delete u.li_attr.id,u.a_attr&&u.a_attr.id&&delete u.a_attr.id),i&&i.flat&&t.id!==n.jstree.root&&r.push(u),!i||!i.no_children)for(f=0,e=t.children.length;f<e;f++)i&&i.flat?this.get_json(t.children[f],i,r):u.children.push(this.get_json(t.children[f],i));return i&&i.flat?r:t.id===n.jstree.root?u.children:u},create_node:function(i,r,u,f,e){if(i===null&&(i=n.jstree.root),i=this.get_node(i),!i)return!1;if(u=u===t?"last":u,!u.toString().match(/^(before|after)$/)&&!e&&!this.is_loaded(i))return this.load_node(i,function(){this.create_node(i,r,u,f,!0)});r||(r={text:this.get_string("New node")});r=typeof r=="string"?{text:r}:n.extend(!0,{},r);r.text===t&&(r.text=this.get_string("New node"));var o,h,s,c;i.id===n.jstree.root&&(u==="before"&&(u="first"),u==="after"&&(u="last"));switch(u){case"before":o=this.get_node(i.parent);u=n.inArray(i.id,o.children);i=o;break;case"after":o=this.get_node(i.parent);u=n.inArray(i.id,o.children)+1;i=o;break;case"inside":case"first":u=0;break;case"last":u=i.children.length;break;default:u||(u=0)}if(u>i.children.length&&(u=i.children.length),r.id||(r.id=!0),!this.check("create_node",r,i,u))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(r.id===!0&&delete r.id,r=this._parse_model_from_json(r,i.id,i.parents.concat()),!r)return!1;for(o=this.get_node(r),h=[],h.push(r),h=h.concat(o.children_d),this.trigger("model",{nodes:h,parent:i.id}),i.children_d=i.children_d.concat(h),s=0,c=i.parents.length;s<c;s++)this._model.data[i.parents[s]].children_d=this._model.data[i.parents[s]].children_d.concat(h);for(r=o,o=[],s=0,c=i.children.length;s<c;s++)o[s>=u?s+1:s]=i.children[s];return o[u]=r.id,i.children=o,this.redraw_node(i,!0),this.trigger("create_node",{node:this.get_node(r),parent:i.id,position:u}),f&&f.call(this,this.get_node(r)),r.id},rename_node:function(t,i){var r,u,f;if(n.isArray(t)){for(t=t.slice(),r=0,u=t.length;r<u;r++)this.rename_node(t[r],i);return!0}return(t=this.get_node(t),!t||t.id===n.jstree.root)?!1:(f=t.text,!this.check("rename_node",t,this.get_parent(t),i))?(this.settings.core.error.call(this,this._data.core.last_error),!1):(this.set_text(t,i),this.trigger("rename_node",{node:t,text:i,old:f}),!0)},delete_node:function(t){var e,c,i,o,r,f,l,u,s,h,a,v;if(n.isArray(t)){for(t=t.slice(),e=0,c=t.length;e<c;e++)this.delete_node(t[e]);return!0}if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;if(i=this.get_node(t.parent),o=n.inArray(t.id,i.children),h=!1,!this.check("delete_node",t,i,o))return this.settings.core.error.call(this,this._data.core.last_error),!1;for(o!==-1&&(i.children=n.vakata.array_remove(i.children,o)),r=t.children_d.concat([]),r.push(t.id),f=0,l=t.parents.length;f<l;f++)this._model.data[t.parents[f]].children_d=n.vakata.array_filter(this._model.data[t.parents[f]].children_d,function(t){return n.inArray(t,r)===-1});for(u=0,s=r.length;u<s;u++)if(this._model.data[r[u]].state.selected){h=!0;break}for(h&&(this._data.core.selected=n.vakata.array_filter(this._data.core.selected,function(t){return n.inArray(t,r)===-1})),this.trigger("delete_node",{node:t,parent:i.id}),h&&this.trigger("changed",{action:"delete_node",node:t,selected:this._data.core.selected,parent:i.id}),u=0,s=r.length;u<s;u++)delete this._model.data[r[u]];return n.inArray(this._data.core.focused,r)!==-1&&(this._data.core.focused=null,a=this.element[0].scrollTop,v=this.element[0].scrollLeft,i.id===n.jstree.root?this._model.data[n.jstree.root].children[0]&&this.get_node(this._model.data[n.jstree.root].children[0],!0).children(".jstree-anchor").focus():this.get_node(i,!0).children(".jstree-anchor").focus(),this.element[0].scrollTop=a,this.element[0].scrollLeft=v),this.redraw_node(i,!0),!0},check:function(t,i,r,u,f){i=i&&i.id?i:this.get_node(i);r=r&&r.id?r:this.get_node(r);var e=t.match(/^move_node|copy_node|create_node$/i)?r:i,o=this.settings.core.check_callback;if(t==="move_node"||t==="copy_node"){if((!f||!f.is_multi)&&t==="move_node"&&n.inArray(i.id,r.children)===u)return this._data.core.last_error={error:"check",plugin:"core",id:"core_08",reason:"Moving node to its current position",data:JSON.stringify({chk:t,pos:u,obj:i&&i.id?i.id:!1,par:r&&r.id?r.id:!1})},!1;if((!f||!f.is_multi)&&(i.id===r.id||t==="move_node"&&n.inArray(i.id,r.children)===u||n.inArray(r.id,i.children_d)!==-1))return this._data.core.last_error={error:"check",plugin:"core",id:"core_01",reason:"Moving parent inside child",data:JSON.stringify({chk:t,pos:u,obj:i&&i.id?i.id:!1,par:r&&r.id?r.id:!1})},!1}return(e&&e.data&&(e=e.data),e&&e.functions&&(e.functions[t]===!1||e.functions[t]===!0))?(e.functions[t]===!1&&(this._data.core.last_error={error:"check",plugin:"core",id:"core_02",reason:"Node data prevents function: "+t,data:JSON.stringify({chk:t,pos:u,obj:i&&i.id?i.id:!1,par:r&&r.id?r.id:!1})}),e.functions[t]):o===!1||n.isFunction(o)&&o.call(this,t,i,r,u,f)===!1||o&&o[t]===!1?(this._data.core.last_error={error:"check",plugin:"core",id:"core_03",reason:"User config for core.check_callback prevents function: "+t,data:JSON.stringify({chk:t,pos:u,obj:i&&i.id?i.id:!1,par:r&&r.id?r.id:!1})},!1):!0},last_error:function(){return this._data.core.last_error},move_node:function(i,r,u,f,e,o,s){var k,d,y,g,l,c,nt,v,a,h,p,b,tt,w;if(r=this.get_node(r),u=u===t?0:u,!r)return!1;if(!u.toString().match(/^(before|after)$/)&&!e&&!this.is_loaded(r))return this.load_node(r,function(){this.move_node(i,r,u,f,!0,!1,s)});if(n.isArray(i))if(i.length===1)i=i[0];else{for(k=0,d=i.length;k<d;k++)(a=this.move_node(i[k],r,u,f,e,!1,s))&&(r=a,u="after");return this.redraw(),!0}if(i=i&&i.id?i:this.get_node(i),!i||i.id===n.jstree.root)return!1;if(y=(i.parent||n.jstree.root).toString(),l=!u.toString().match(/^(before|after)$/)||r.id===n.jstree.root?r:this.get_node(r.parent),c=s?s:this._model.data[i.id]?this:n.jstree.reference(i.id),nt=!c||!c._id||this._id!==c._id,g=c&&c._id&&y&&c._model.data[y]&&c._model.data[y].children?n.inArray(i.id,c._model.data[y].children):-1,c&&c._id&&(i=c._model.data[i.id]),nt)return(a=this.copy_node(i,r,u,f,e,!1,s))?(c&&c.delete_node(i),a):!1;r.id===n.jstree.root&&(u==="before"&&(u="first"),u==="after"&&(u="last"));switch(u){case"before":u=n.inArray(r.id,l.children);break;case"after":u=n.inArray(r.id,l.children)+1;break;case"inside":case"first":u=0;break;case"last":u=l.children.length;break;default:u||(u=0)}if(u>l.children.length&&(u=l.children.length),!this.check("move_node",i,l,u,{core:!0,origin:s,is_multi:c&&c._id&&c._id!==this._id,is_foreign:!c||!c._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(i.parent===l.id){for(v=l.children.concat(),a=n.inArray(i.id,v),a!==-1&&(v=n.vakata.array_remove(v,a),u>a&&u--),a=[],h=0,p=v.length;h<p;h++)a[h>=u?h+1:h]=v[h];a[u]=i.id;l.children=a;this._node_changed(l.id);this.redraw(l.id===n.jstree.root)}else{for(a=i.children_d.concat(),a.push(i.id),h=0,p=i.parents.length;h<p;h++){for(v=[],w=c._model.data[i.parents[h]].children_d,b=0,tt=w.length;b<tt;b++)n.inArray(w[b],a)===-1&&v.push(w[b]);c._model.data[i.parents[h]].children_d=v}for(c._model.data[y].children=n.vakata.array_remove_item(c._model.data[y].children,i.id),h=0,p=l.parents.length;h<p;h++)this._model.data[l.parents[h]].children_d=this._model.data[l.parents[h]].children_d.concat(a);for(v=[],h=0,p=l.children.length;h<p;h++)v[h>=u?h+1:h]=l.children[h];for(v[u]=i.id,l.children=v,l.children_d.push(i.id),l.children_d=l.children_d.concat(i.children_d),i.parent=l.id,a=l.parents.concat(),a.unshift(l.id),w=i.parents.length,i.parents=a,a=a.concat(),h=0,p=i.children_d.length;h<p;h++)this._model.data[i.children_d[h]].parents=this._model.data[i.children_d[h]].parents.slice(0,w*-1),Array.prototype.push.apply(this._model.data[i.children_d[h]].parents,a);(y===n.jstree.root||l.id===n.jstree.root)&&(this._model.force_full_redraw=!0);this._model.force_full_redraw||(this._node_changed(y),this._node_changed(l.id));o||this.redraw()}return f&&f.call(this,i,l,u),this.trigger("move_node",{node:i,parent:l.id,position:u,old_parent:y,old_position:g,is_multi:c&&c._id&&c._id!==this._id,is_foreign:!c||!c._id,old_instance:c,new_instance:this}),i.id},copy_node:function(i,r,u,f,e,o,s){var w,k,v,a,l,b,y,p,c,h,d;if(r=this.get_node(r),u=u===t?0:u,!r)return!1;if(!u.toString().match(/^(before|after)$/)&&!e&&!this.is_loaded(r))return this.load_node(r,function(){this.copy_node(i,r,u,f,!0,!1,s)});if(n.isArray(i))if(i.length===1)i=i[0];else{for(w=0,k=i.length;w<k;w++)(a=this.copy_node(i[w],r,u,f,e,!0,s))&&(r=a,u="after");return this.redraw(),!0}if(i=i&&i.id?i:this.get_node(i),!i||i.id===n.jstree.root)return!1;p=(i.parent||n.jstree.root).toString();c=!u.toString().match(/^(before|after)$/)||r.id===n.jstree.root?r:this.get_node(r.parent);h=s?s:this._model.data[i.id]?this:n.jstree.reference(i.id);d=!h||!h._id||this._id!==h._id;h&&h._id&&(i=h._model.data[i.id]);r.id===n.jstree.root&&(u==="before"&&(u="first"),u==="after"&&(u="last"));switch(u){case"before":u=n.inArray(r.id,c.children);break;case"after":u=n.inArray(r.id,c.children)+1;break;case"inside":case"first":u=0;break;case"last":u=c.children.length;break;default:u||(u=0)}if(u>c.children.length&&(u=c.children.length),!this.check("copy_node",i,c,u,{core:!0,origin:s,is_multi:h&&h._id&&h._id!==this._id,is_foreign:!h||!h._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if((y=h?h.get_json(i,{no_id:!0,no_data:!0,no_state:!0}):i,!y)||(y.id===!0&&delete y.id,y=this._parse_model_from_json(y,c.id,c.parents.concat()),!y))return!1;for(a=this.get_node(y),i&&i.state&&i.state.loaded===!1&&(a.state.loaded=!1),v=[],v.push(y),v=v.concat(a.children_d),this.trigger("model",{nodes:v,parent:c.id}),l=0,b=c.parents.length;l<b;l++)this._model.data[c.parents[l]].children_d=this._model.data[c.parents[l]].children_d.concat(v);for(v=[],l=0,b=c.children.length;l<b;l++)v[l>=u?l+1:l]=c.children[l];return v[u]=a.id,c.children=v,c.children_d.push(a.id),c.children_d=c.children_d.concat(a.children_d),c.id===n.jstree.root&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||this._node_changed(c.id),o||this.redraw(c.id===n.jstree.root),f&&f.call(this,a,c,u),this.trigger("copy_node",{node:a,original:i,parent:c.id,position:u,old_parent:p,old_position:h&&h._id&&p&&h._model.data[p]&&h._model.data[p].children?n.inArray(i.id,h._model.data[p].children):-1,is_multi:h&&h._id&&h._id!==this._id,is_foreign:!h||!h._id,old_instance:h,new_instance:this}),a.id},cut:function(t){if(t||(t=this._data.core.selected.concat()),n.isArray(t)||(t=[t]),!t.length)return!1;for(var e=[],i,f=0,s=t.length;f<s;f++)i=this.get_node(t[f]),i&&i.id&&i.id!==n.jstree.root&&e.push(i);if(!e.length)return!1;u=e;o=this;r="move_node";this.trigger("cut",{node:t})},copy:function(t){if(t||(t=this._data.core.selected.concat()),n.isArray(t)||(t=[t]),!t.length)return!1;for(var e=[],i,f=0,s=t.length;f<s;f++)i=this.get_node(t[f]),i&&i.id&&i.id!==n.jstree.root&&e.push(i);if(!e.length)return!1;u=e;o=this;r="copy_node";this.trigger("copy",{node:t})},get_buffer:function(){return{mode:r,node:u,inst:o}},can_paste:function(){return r!==!1&&u!==!1},paste:function(n,t){if(n=this.get_node(n),!n||!r||!r.match(/^(copy_node|move_node)$/)||!u)return!1;this[r](u,n,t,!1,!1,!1,o)&&this.trigger("paste",{parent:n.id,node:u,mode:r});u=!1;r=!1;o=!1},clear_buffer:function(){u=!1;r=!1;o=!1;this.trigger("clear_buffer")},edit:function(t,r,u){var v,l,f,h,e,c,o,a,s,y=!1;if(t=this.get_node(t),!t)return!1;if(!this.check("edit",t,this.get_parent(t)))return this.settings.core.error.call(this,this._data.core.last_error),!1;s=t;r=typeof r=="string"?r:t.text;this.set_text(t,"");t=this._open_to(t);s.text=r;v=this._data.core.rtl;l=this.element.width();this._data.core.focused=s.id;f=t.children(".jstree-anchor").focus();h=n("<span>");
/*!
oi = obj.children("i:visible"),
ai = a.children("i:visible"),
w1 = oi.width() * oi.length,
w2 = ai.width() * ai.length,
*/
e=r;c=n("<div />",{css:{position:"absolute",top:"-200px",left:v?"0px":"-1000px",visibility:"hidden"}}).appendTo(i.body);o=n("<input />",{value:e,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:n.proxy(function(i){i.stopImmediatePropagation();i.preventDefault();var v=h.children(".jstree-rename-input"),r=v.val(),a=this.settings.core.force_text,l;r===""&&(r=e);c.remove();h.replaceWith(f);h.remove();e=a?e:n("<div><\/div>").append(n.parseHTML(e)).html();t=this.get_node(t);this.set_text(t,e);l=!!this.rename_node(t,a?n("<div><\/div>").text(r).text():n("<div><\/div>").append(n.parseHTML(r)).html());l||this.set_text(t,e);this._data.core.focused=s.id;setTimeout(n.proxy(function(){var n=this.get_node(s.id,!0);n.length&&(this._data.core.focused=s.id,n.children(".jstree-anchor").focus())},this),0);u&&u.call(this,s,l,y);o=null},this),keydown:function(n){var t=n.which;t===27&&(y=!0,this.value=e);(t===27||t===13||t===37||t===38||t===39||t===40||t===32)&&n.stopImmediatePropagation();(t===27||t===13)&&(n.preventDefault(),this.blur())},click:function(n){n.stopImmediatePropagation()},mousedown:function(n){n.stopImmediatePropagation()},keyup:function(){o.width(Math.min(c.text("pW"+this.value).width(),l))},keypress:function(n){if(n.which===13)return!1}});a={fontFamily:f.css("fontFamily")||"",fontSize:f.css("fontSize")||"",fontWeight:f.css("fontWeight")||"",fontStyle:f.css("fontStyle")||"",fontStretch:f.css("fontStretch")||"",fontVariant:f.css("fontVariant")||"",letterSpacing:f.css("letterSpacing")||"",wordSpacing:f.css("wordSpacing")||""};h.attr("class",f.attr("class")).append(f.contents().clone()).append(o);f.replaceWith(h);c.css(a);o.css(a).width(Math.min(c.text("pW"+o[0].value).width(),l))[0].select();n(i).one("mousedown.jstree touchstart.jstree dnd_start.vakata",function(t){o&&t.target!==o&&n(o).blur()})},set_theme:function(t,i){if(!t)return!1;if(i===!0){var r=this.settings.core.themes.dir;r||(r=n.jstree.path+"/themes");i=r+"/"+t+"/style.css"}i&&n.inArray(i,v)===-1&&(n("head").append('<link rel="stylesheet" href="'+i+'" type="text/css" />'),v.push(i));this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name);this._data.core.themes.name=t;this.element.addClass("jstree-"+t);this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+t+"-responsive");this.trigger("set_theme",{theme:t})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(n){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant);this._data.core.themes.variant=n;n&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0;this.get_container_ul().addClass("jstree-striped");this.trigger("show_stripes")},hide_stripes:function(){this._data.core.themes.stripes=!1;this.get_container_ul().removeClass("jstree-striped");this.trigger("hide_stripes")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0;this.get_container_ul().removeClass("jstree-no-dots");this.trigger("show_dots")},hide_dots:function(){this._data.core.themes.dots=!1;this.get_container_ul().addClass("jstree-no-dots");this.trigger("hide_dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0;this.get_container_ul().removeClass("jstree-no-icons");this.trigger("show_icons")},hide_icons:function(){this._data.core.themes.icons=!1;this.get_container_ul().addClass("jstree-no-icons");this.trigger("hide_icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},show_ellipsis:function(){this._data.core.themes.ellipsis=!0;this.get_container_ul().addClass("jstree-ellipsis");this.trigger("show_ellipsis")},hide_ellipsis:function(){this._data.core.themes.ellipsis=!1;this.get_container_ul().removeClass("jstree-ellipsis");this.trigger("hide_ellipsis")},toggle_ellipsis:function(){this._data.core.themes.ellipsis?this.hide_ellipsis():this.show_ellipsis()},set_icon:function(i,r){var e,o,f,u;if(n.isArray(i)){for(i=i.slice(),e=0,o=i.length;e<o;e++)this.set_icon(i[e],r);return!0}return(i=this.get_node(i),!i||i.id===n.jstree.root)?!1:(u=i.icon,i.icon=r===!0||r===null||r===t||r===""?!0:r,f=this.get_node(i,!0).children(".jstree-anchor").children(".jstree-themeicon"),r===!1?(f.removeClass("jstree-themeicon-custom "+u).css("background","").removeAttr("rel"),this.hide_icon(i)):r===!0||r===null||r===t||r===""?(f.removeClass("jstree-themeicon-custom "+u).css("background","").removeAttr("rel"),u===!1&&this.show_icon(i)):r.indexOf("/")===-1&&r.indexOf(".")===-1?(f.removeClass(u).css("background",""),f.addClass(r+" jstree-themeicon-custom").attr("rel",r),u===!1&&this.show_icon(i)):(f.removeClass(u).css("background",""),f.addClass("jstree-themeicon-custom").css("background","url('"+r+"') center center no-repeat").attr("rel",r),u===!1&&this.show_icon(i)),!0)},get_icon:function(t){return t=this.get_node(t),!t||t.id===n.jstree.root?!1:t.icon},hide_icon:function(t){var i,r;if(n.isArray(t)){for(t=t.slice(),i=0,r=t.length;i<r;i++)this.hide_icon(t[i]);return!0}return(t=this.get_node(t),!t||t===n.jstree.root)?!1:(t.icon=!1,this.get_node(t,!0).children(".jstree-anchor").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0)},show_icon:function(t){var i,u,r;if(n.isArray(t)){for(t=t.slice(),i=0,u=t.length;i<u;i++)this.show_icon(t[i]);return!0}return(t=this.get_node(t),!t||t===n.jstree.root)?!1:(r=this.get_node(t,!0),t.icon=r.length?r.children(".jstree-anchor").children(".jstree-themeicon").attr("rel"):!0,t.icon||(t.icon=!0),r.children(".jstree-anchor").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0)}},n.vakata={},n.vakata.attributes=function(t,i){t=n(t)[0];var r=i?{}:[];return t&&t.attributes&&n.each(t.attributes,function(t,u){n.inArray(u.name.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])===-1&&u.value!==null&&n.trim(u.value)!==""&&(i?r[u.name]=u.value:r.push(u.name))}),r},n.vakata.array_unique=function(n){for(var r=[],f={},i=0,u=n.length;i<u;i++)f[n[i]]===t&&(r.push(n[i]),f[n[i]]=!0);return r},n.vakata.array_remove=function(n,t){return n.splice(t,1),n},n.vakata.array_remove_item=function(t,i){var r=n.inArray(i,t);return r!==-1?n.vakata.array_remove(t,r):t},n.vakata.array_filter=function(n,t,i,r,u){if(n.filter)return n.filter(t,i);r=[];for(u in n)~~u+""==u+""&&u>=0&&t.call(i,n[u],+u,n)&&r.push(n[u]);return r},n.jstree.plugins.changed=function(n,t){var i=[];this.trigger=function(n,r){var u,f,e;if(r||(r={}),n.replace(".jstree","")==="changed"){for(r.changed={selected:[],deselected:[]},e={},u=0,f=i.length;u<f;u++)e[i[u]]=1;for(u=0,f=r.selected.length;u<f;u++)e[r.selected[u]]?e[r.selected[u]]=2:r.changed.selected.push(r.selected[u]);for(u=0,f=i.length;u<f;u++)e[i[u]]===1&&r.changed.deselected.push(i[u]);i=r.selected.slice()}t.trigger.call(this,n,r)};this.refresh=function(){return i=[],t.refresh.apply(this,arguments)}},h=i.createElement("I"),h.className="jstree-icon jstree-checkbox",h.setAttribute("role","presentation"),n.jstree.defaults.checkbox={visible:!0,three_state:!0,whole_node:!0,keep_selected_style:!0,cascade:"",tie_selection:!0,cascade_to_disabled:!0,cascade_to_hidden:!0},n.jstree.plugins.checkbox=function(i,r){this.bind=function(){r.bind.call(this);this._data.checkbox.uto=!1;this._data.checkbox.selected=[];this.settings.checkbox.three_state&&(this.settings.checkbox.cascade="up+down+undetermined");this.element.on("init.jstree",n.proxy(function(){this._data.checkbox.visible=this.settings.checkbox.visible;this.settings.checkbox.keep_selected_style||this.element.addClass("jstree-checkbox-no-clicked");this.settings.checkbox.tie_selection&&this.element.addClass("jstree-checkbox-selection")},this)).on("loading.jstree",n.proxy(function(){this[this._data.checkbox.visible?"show_checkboxes":"hide_checkboxes"]()},this));if(this.settings.checkbox.cascade.indexOf("undetermined")!==-1)this.element.on("changed.jstree uncheck_node.jstree check_node.jstree uncheck_all.jstree check_all.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree",n.proxy(function(){this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto);this._data.checkbox.uto=setTimeout(n.proxy(this._undetermined,this),50)},this));if(!this.settings.checkbox.tie_selection)this.element.on("model.jstree",n.proxy(function(n,t){for(var u=this._model.data,e=u[t.parent],r=t.nodes,i=0,f=r.length;i<f;i++)u[r[i]].state.checked=u[r[i]].state.checked||u[r[i]].original&&u[r[i]].original.state&&u[r[i]].original.state.checked,u[r[i]].state.checked&&this._data.checkbox.selected.push(r[i])},this));if(this.settings.checkbox.cascade.indexOf("up")!==-1||this.settings.checkbox.cascade.indexOf("down")!==-1)this.element.on("model.jstree",n.proxy(function(t,i){var e=this._model.data,u=e[i.parent],s=i.nodes,c=[],v,r,o,h,l,a,y=this.settings.checkbox.cascade,f=this.settings.checkbox.tie_selection;if(y.indexOf("down")!==-1)if(u.state[f?"selected":"checked"]){for(r=0,o=s.length;r<o;r++)e[s[r]].state[f?"selected":"checked"]=!0;this._data[f?"core":"checkbox"].selected=this._data[f?"core":"checkbox"].selected.concat(s)}else for(r=0,o=s.length;r<o;r++)if(e[s[r]].state[f?"selected":"checked"]){for(h=0,l=e[s[r]].children_d.length;h<l;h++)e[e[s[r]].children_d[h]].state[f?"selected":"checked"]=!0;this._data[f?"core":"checkbox"].selected=this._data[f?"core":"checkbox"].selected.concat(e[s[r]].children_d)}if(y.indexOf("up")!==-1){for(r=0,o=u.children_d.length;r<o;r++)e[u.children_d[r]].children.length||c.push(e[u.children_d[r]].parent);for(c=n.vakata.array_unique(c),h=0,l=c.length;h<l;h++)for(u=e[c[h]];u&&u.id!==n.jstree.root;){for(v=0,r=0,o=u.children.length;r<o;r++)v+=e[u.children[r]].state[f?"selected":"checked"];if(v===o)u.state[f?"selected":"checked"]=!0,this._data[f?"core":"checkbox"].selected.push(u.id),a=this.get_node(u,!0),a&&a.length&&a.attr("aria-selected",!0).children(".jstree-anchor").addClass(f?"jstree-clicked":"jstree-checked");else break;u=this.get_node(u.parent)}}this._data[f?"core":"checkbox"].selected=n.vakata.array_unique(this._data[f?"core":"checkbox"].selected)},this)).on(this.settings.checkbox.tie_selection?"select_node.jstree":"check_node.jstree",n.proxy(function(t,i){for(var w=this,c=i.node,p=this._model.data,u=this.get_node(c.parent),a,l,v=this.settings.checkbox.cascade,o=this.settings.checkbox.tie_selection,e={},s=this._data[o?"core":"checkbox"].selected,y,h,r=0,f=s.length;r<f;r++)e[s[r]]=!0;if(v.indexOf("down")!==-1)for(y=this._cascade_new_checked_state(c.id,!0),h=c.children_d.concat(c.id),r=0,f=h.length;r<f;r++)y.indexOf(h[r])>-1?e[h[r]]=!0:delete e[h[r]];if(v.indexOf("up")!==-1)while(u&&u.id!==n.jstree.root){for(a=0,r=0,f=u.children.length;r<f;r++)a+=p[u.children[r]].state[o?"selected":"checked"];if(a===f)u.state[o?"selected":"checked"]=!0,e[u.id]=!0,l=this.get_node(u,!0),l&&l.length&&l.attr("aria-selected",!0).children(".jstree-anchor").addClass(o?"jstree-clicked":"jstree-checked");else break;u=this.get_node(u.parent)}s=[];for(r in e)e.hasOwnProperty(r)&&s.push(r);this._data[o?"core":"checkbox"].selected=s},this)).on(this.settings.checkbox.tie_selection?"deselect_all.jstree":"uncheck_all.jstree",n.proxy(function(){for(var r=this.get_node(n.jstree.root),f=this._model.data,t,i=0,u=r.children_d.length;i<u;i++)t=f[r.children_d[i]],t&&t.original&&t.original.state&&t.original.state.undetermined&&(t.original.state.undetermined=!1)},this)).on(this.settings.checkbox.tie_selection?"deselect_node.jstree":"uncheck_node.jstree",n.proxy(function(t,i){var a=this,u=i.node,v=this.get_node(u,!0),e,s,r,h=this.settings.checkbox.cascade,o=this.settings.checkbox.tie_selection,f=this._data[o?"core":"checkbox"].selected,l=u.children_d.concat(u.id),c;if(h.indexOf("down")!==-1&&(c=this._cascade_new_checked_state(u.id,!1),f=n.vakata.array_filter(f,function(n){return l.indexOf(n)===-1||c.indexOf(n)>-1})),h.indexOf("up")!==-1&&f.indexOf(u.id)===-1){for(e=0,s=u.parents.length;e<s;e++)r=this._model.data[u.parents[e]],r.state[o?"selected":"checked"]=!1,r&&r.original&&r.original.state&&r.original.state.undetermined&&(r.original.state.undetermined=!1),r=this.get_node(u.parents[e],!0),r&&r.length&&r.attr("aria-selected",!1).children(".jstree-anchor").removeClass(o?"jstree-clicked":"jstree-checked");f=n.vakata.array_filter(f,function(n){return u.parents.indexOf(n)===-1})}this._data[o?"core":"checkbox"].selected=f},this));if(this.settings.checkbox.cascade.indexOf("up")!==-1)this.element.on("delete_node.jstree",n.proxy(function(t,i){for(var r=this.get_node(i.parent),h=this._model.data,f,e,s,o,u=this.settings.checkbox.tie_selection;r&&r.id!==n.jstree.root&&!r.state[u?"selected":"checked"];){for(s=0,f=0,e=r.children.length;f<e;f++)s+=h[r.children[f]].state[u?"selected":"checked"];if(e>0&&s===e)r.state[u?"selected":"checked"]=!0,this._data[u?"core":"checkbox"].selected.push(r.id),o=this.get_node(r,!0),o&&o.length&&o.attr("aria-selected",!0).children(".jstree-anchor").addClass(u?"jstree-clicked":"jstree-checked");else break;r=this.get_node(r.parent)}},this)).on("move_node.jstree",n.proxy(function(t,i){var c=i.is_multi,l=i.old_parent,a=this.get_node(i.parent),h=this._model.data,r,s,e,o,f,u=this.settings.checkbox.tie_selection;if(!c)for(r=this.get_node(l);r&&r.id!==n.jstree.root&&!r.state[u?"selected":"checked"];){for(s=0,e=0,o=r.children.length;e<o;e++)s+=h[r.children[e]].state[u?"selected":"checked"];if(o>0&&s===o)r.state[u?"selected":"checked"]=!0,this._data[u?"core":"checkbox"].selected.push(r.id),f=this.get_node(r,!0),f&&f.length&&f.attr("aria-selected",!0).children(".jstree-anchor").addClass(u?"jstree-clicked":"jstree-checked");else break;r=this.get_node(r.parent)}for(r=a;r&&r.id!==n.jstree.root;){for(s=0,e=0,o=r.children.length;e<o;e++)s+=h[r.children[e]].state[u?"selected":"checked"];if(s===o)r.state[u?"selected":"checked"]||(r.state[u?"selected":"checked"]=!0,this._data[u?"core":"checkbox"].selected.push(r.id),f=this.get_node(r,!0),f&&f.length&&f.attr("aria-selected",!0).children(".jstree-anchor").addClass(u?"jstree-clicked":"jstree-checked"));else if(r.state[u?"selected":"checked"])r.state[u?"selected":"checked"]=!1,this._data[u?"core":"checkbox"].selected=n.vakata.array_remove_item(this._data[u?"core":"checkbox"].selected,r.id),f=this.get_node(r,!0),f&&f.length&&f.attr("aria-selected",!1).children(".jstree-anchor").removeClass(u?"jstree-clicked":"jstree-checked");else break;r=this.get_node(r.parent)}},this))};this.get_undetermined=function(i){if(this.settings.checkbox.cascade.indexOf("undetermined")===-1)return[];for(var r,c,f={},e=this._model.data,l=this.settings.checkbox.tie_selection,s=this._data[l?"core":"checkbox"].selected,o=[],v=this,a=[],u=0,h=s.length;u<h;u++)if(e[s[u]]&&e[s[u]].parents)for(r=0,c=e[s[u]].parents.length;r<c;r++){if(f[e[s[u]].parents[r]]!==t)break;e[s[u]].parents[r]!==n.jstree.root&&(f[e[s[u]].parents[r]]=!0,o.push(e[s[u]].parents[r]))}for(this.element.find(".jstree-closed").not(":has(.jstree-children)").each(function(){var i=v.get_node(this),s;if(i)if(i.state.loaded){for(u=0,h=i.children_d.length;u<h;u++)if(s=e[i.children_d[u]],!s.state.loaded&&s.original&&s.original.state&&s.original.state.undetermined&&s.original.state.undetermined===!0)for(f[s.id]===t&&s.id!==n.jstree.root&&(f[s.id]=!0,o.push(s.id)),r=0,c=s.parents.length;r<c;r++)f[s.parents[r]]===t&&s.parents[r]!==n.jstree.root&&(f[s.parents[r]]=!0,o.push(s.parents[r]))}else if(i.original&&i.original.state&&i.original.state.undetermined&&i.original.state.undetermined===!0)for(f[i.id]===t&&i.id!==n.jstree.root&&(f[i.id]=!0,o.push(i.id)),r=0,c=i.parents.length;r<c;r++)f[i.parents[r]]===t&&i.parents[r]!==n.jstree.root&&(f[i.parents[r]]=!0,o.push(i.parents[r]))}),u=0,h=o.length;u<h;u++)e[o[u]].state[l?"selected":"checked"]||a.push(i?e[o[u]]:o[u]);return a};this._undetermined=function(){if(this.element!==null){var i=this.get_undetermined(!1),n,r,t;for(this.element.find(".jstree-undetermined").removeClass("jstree-undetermined"),n=0,r=i.length;n<r;n++)t=this.get_node(i[n],!0),t&&t.length&&t.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-undetermined")}};this.redraw_node=function(t,i,u){if(t=r.redraw_node.apply(this,arguments),t){for(var e=null,o=null,f=0,s=t.childNodes.length;f<s;f++)if(t.childNodes[f]&&t.childNodes[f].className&&t.childNodes[f].className.indexOf("jstree-anchor")!==-1){e=t.childNodes[f];break}e&&(!this.settings.checkbox.tie_selection&&this._model.data[t.id].state.checked&&(e.className+=" jstree-checked"),o=h.cloneNode(!1),this._model.data[t.id].state.checkbox_disabled&&(o.className+=" jstree-checkbox-disabled"),e.insertBefore(o,e.childNodes[0]))}return u||this.settings.checkbox.cascade.indexOf("undetermined")===-1||(this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(n.proxy(this._undetermined,this),50)),t};this.show_checkboxes=function(){this._data.core.themes.checkboxes=!0;this.get_container_ul().removeClass("jstree-no-checkboxes")};this.hide_checkboxes=function(){this._data.core.themes.checkboxes=!1;this.get_container_ul().addClass("jstree-no-checkboxes")};this.toggle_checkboxes=function(){this._data.core.themes.checkboxes?this.hide_checkboxes():this.show_checkboxes()};this.is_undetermined=function(t){t=this.get_node(t);var r=this.settings.checkbox.cascade,i,u,f=this.settings.checkbox.tie_selection,o=this._data[f?"core":"checkbox"].selected,e=this._model.data;if(!t||t.state[f?"selected":"checked"]===!0||r.indexOf("undetermined")===-1||r.indexOf("down")===-1&&r.indexOf("up")===-1)return!1;if(!t.state.loaded&&t.original.state.undetermined===!0)return!0;for(i=0,u=t.children_d.length;i<u;i++)if(n.inArray(t.children_d[i],o)!==-1||!e[t.children_d[i]].state.loaded&&e[t.children_d[i]].original.state.undetermined)return!0;return!1};this.disable_checkbox=function(t){var i,u,r;if(n.isArray(t)){for(t=t.slice(),i=0,u=t.length;i<u;i++)this.disable_checkbox(t[i]);return!0}if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;r=this.get_node(t,!0);t.state.checkbox_disabled||(t.state.checkbox_disabled=!0,r&&r.length&&r.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-checkbox-disabled"),this.trigger("disable_checkbox",{node:t}))};this.enable_checkbox=function(t){var i,u,r;if(n.isArray(t)){for(t=t.slice(),i=0,u=t.length;i<u;i++)this.enable_checkbox(t[i]);return!0}if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;r=this.get_node(t,!0);t.state.checkbox_disabled&&(t.state.checkbox_disabled=!1,r&&r.length&&r.children(".jstree-anchor").children(".jstree-checkbox").removeClass("jstree-checkbox-disabled"),this.trigger("enable_checkbox",{node:t}))};this.activate_node=function(t,i){if(n(i.target).hasClass("jstree-checkbox-disabled"))return!1;if(this.settings.checkbox.tie_selection&&(this.settings.checkbox.whole_node||n(i.target).hasClass("jstree-checkbox"))&&(i.ctrlKey=!0),this.settings.checkbox.tie_selection||!this.settings.checkbox.whole_node&&!n(i.target).hasClass("jstree-checkbox"))return r.activate_node.call(this,t,i);if(this.is_disabled(t))return!1;this.is_checked(t)?this.uncheck_node(t,i):this.check_node(t,i);this.trigger("activate_node",{node:this.get_node(t)})};this._cascade_new_checked_state=function(n,t){var l=this,r=this.settings.checkbox.tie_selection,i=this._model.data[n],u=[],e=[],o,a,f,s,h,c;if((this.settings.checkbox.cascade_to_disabled||!i.state.disabled)&&(this.settings.checkbox.cascade_to_hidden||!i.state.hidden)){if(i.children)for(o=0,a=i.children.length;o<a;o++)s=i.children[o],f=l._cascade_new_checked_state(s,t),u=u.concat(f),f.indexOf(s)>-1&&e.push(s);h=l.get_node(i,!0);c=e.length>0&&e.length<i.children.length;i.original&&i.original.state&&i.original.state.undetermined&&(i.original.state.undetermined=c);c?(i.state[r?"selected":"checked"]=!1,h.attr("aria-selected",!1).children(".jstree-anchor").removeClass(r?"jstree-clicked":"jstree-checked")):t&&e.length===i.children.length?(i.state[r?"selected":"checked"]=t,u.push(i.id),h.attr("aria-selected",!0).children(".jstree-anchor").addClass(r?"jstree-clicked":"jstree-checked")):(i.state[r?"selected":"checked"]=!1,h.attr("aria-selected",!1).children(".jstree-anchor").removeClass(r?"jstree-clicked":"jstree-checked"))}else f=this.get_checked_descendants(n),i.state[r?"selected":"checked"]&&f.push(i.id),u=u.concat(f);return u};this.get_checked_descendants=function(t){var i=this,r=i.settings.checkbox.tie_selection,u=i._model.data[t];return n.vakata.array_filter(u.children_d,function(n){return i._model.data[n].state[r?"selected":"checked"]})};this.check_node=function(t,i){if(this.settings.checkbox.tie_selection)return this.select_node(t,!1,!0,i);var r,u,f;if(n.isArray(t)){for(t=t.slice(),u=0,f=t.length;u<f;u++)this.check_node(t[u],i);return!0}if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;r=this.get_node(t,!0);t.state.checked||(t.state.checked=!0,this._data.checkbox.selected.push(t.id),r&&r.length&&r.children(".jstree-anchor").addClass("jstree-checked"),this.trigger("check_node",{node:t,selected:this._data.checkbox.selected,event:i}))};this.uncheck_node=function(t,i){if(this.settings.checkbox.tie_selection)return this.deselect_node(t,!1,i);var r,f,u;if(n.isArray(t)){for(t=t.slice(),r=0,f=t.length;r<f;r++)this.uncheck_node(t[r],i);return!0}if(t=this.get_node(t),!t||t.id===n.jstree.root)return!1;u=this.get_node(t,!0);t.state.checked&&(t.state.checked=!1,this._data.checkbox.selected=n.vakata.array_remove_item(this._data.checkbox.selected,t.id),u.length&&u.children(".jstree-anchor").removeClass("jstree-checked"),this.trigger("uncheck_node",{node:t,selected:this._data.checkbox.selected,event:i}))};this.check_all=function(){if(this.settings.checkbox.tie_selection)return this.select_all();var r=this._data.checkbox.selected.concat([]),t,i;for(this._data.checkbox.selected=this._model.data[n.jstree.root].children_d.concat(),t=0,i=this._data.checkbox.selected.length;t<i;t++)this._model.data[this._data.checkbox.selected[t]]&&(this._model.data[this._data.checkbox.selected[t]].state.checked=!0);this.redraw(!0);this.trigger("check_all",{selected:this._data.checkbox.selected})};this.uncheck_all=function(){if(this.settings.checkbox.tie_selection)return this.deselect_all();for(var i=this._data.checkbox.selected.concat([]),n=0,t=this._data.checkbox.selected.length;n<t;n++)this._model.data[this._data.checkbox.selected[n]]&&(this._model.data[this._data.checkbox.selected[n]].state.checked=!1);this._data.checkbox.selected=[];this.element.find(".jstree-checked").removeClass("jstree-checked");this.trigger("uncheck_all",{selected:this._data.checkbox.selected,node:i})};this.is_checked=function(t){return this.settings.checkbox.tie_selection?this.is_selected(t):(t=this.get_node(t),!t||t.id===n.jstree.root)?!1:t.state.checked};this.get_checked=function(t){return this.settings.checkbox.tie_selection?this.get_selected(t):t?n.map(this._data.checkbox.selected,n.proxy(function(n){return this.get_node(n)},this)):this._data.checkbox.selected.slice()};this.get_top_checked=function(t){if(this.settings.checkbox.tie_selection)return this.get_top_selected(t);for(var r=this.get_checked(!0),u={},f,o,i=0,e=r.length;i<e;i++)u[r[i].id]=r[i];for(i=0,e=r.length;i<e;i++)for(f=0,o=r[i].children_d.length;f<o;f++)u[r[i].children_d[f]]&&delete u[r[i].children_d[f]];r=[];for(i in u)u.hasOwnProperty(i)&&r.push(i);return t?n.map(r,n.proxy(function(n){return this.get_node(n)},this)):r};this.get_bottom_checked=function(t){if(this.settings.checkbox.tie_selection)return this.get_bottom_selected(t);for(var r=this.get_checked(!0),u=[],i=0,f=r.length;i<f;i++)r[i].children.length||u.push(r[i].id);return t?n.map(u,n.proxy(function(n){return this.get_node(n)},this)):u};this.load_node=function(t){var u,f,e,i;if(!n.isArray(t)&&!this.settings.checkbox.tie_selection&&(i=this.get_node(t),i&&i.state.loaded))for(u=0,f=i.children_d.length;u<f;u++)this._model.data[i.children_d[u]].state.checked&&(e=!0,this._data.checkbox.selected=n.vakata.array_remove_item(this._data.checkbox.selected,i.children_d[u]));return r.load_node.apply(this,arguments)};this.get_state=function(){var n=r.get_state.apply(this,arguments);return this.settings.checkbox.tie_selection?n:(n.checkbox=this._data.checkbox.selected.slice(),n)};this.set_state=function(t,i){var u=r.set_state.apply(this,arguments),f;return u&&t.checkbox?(this.settings.checkbox.tie_selection||(this.uncheck_all(),f=this,n.each(t.checkbox,function(n,t){f.check_node(t)})),delete t.checkbox,this.set_state(t,i),!1):u};this.refresh=function(){return this.settings.checkbox.tie_selection&&(this._data.checkbox.selected=[]),r.refresh.apply(this,arguments)}},n.jstree.defaults.conditionalselect=function(){return!0},n.jstree.plugins.conditionalselect=function(n,t){this.activate_node=function(n,i){if(this.settings.conditionalselect.call(this,this.get_node(n),i))return t.activate_node.call(this,n,i)}},n.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(){return{create:{separator_before:!1,separator_after:!0,_disabled:!1,label:"Create",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.create_node(r,{},"last",function(n){try{i.edit(n)}catch(t){setTimeout(function(){i.edit(n)},0)}})}},rename:{separator_before:!1,separator_after:!1,_disabled:!1,label:"Rename",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.edit(r)}},remove:{separator_before:!1,icon:!1,separator_after:!1,_disabled:!1,label:"Delete",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.is_selected(r)?i.delete_node(i.get_selected()):i.delete_node(r)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.is_selected(r)?i.cut(i.get_top_selected()):i.cut(r)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.is_selected(r)?i.copy(i.get_top_selected()):i.copy(r)}},paste:{separator_before:!1,icon:!1,_disabled:function(t){return!n.jstree.reference(t.reference).can_paste()},separator_after:!1,label:"Paste",action:function(t){var i=n.jstree.reference(t.reference),r=i.get_node(t.reference);i.paste(r)}}}}}}},n.jstree.plugins.contextmenu=function(r,u){this.bind=function(){u.bind.call(this);var r=0,t=null,f,e;this.element.on("init.jstree loading.jstree ready.jstree",n.proxy(function(){this.get_container_ul().addClass("jstree-contextmenu")},this)).on("contextmenu.jstree",".jstree-anchor",n.proxy(function(n,i){n.target.tagName.toLowerCase()!=="input"&&(n.preventDefault(),r=n.ctrlKey?+new Date:0,(i||t)&&(r=+new Date+1e4),t&&clearTimeout(t),this.is_loading(n.currentTarget)||this.show_contextmenu(n.currentTarget,n.pageX,n.pageY,n))},this)).on("click.jstree",".jstree-anchor",n.proxy(function(){this._data.contextmenu.visible&&(!r||+new Date-r>250)&&n.vakata.context.hide();r=0},this)).on("touchstart.jstree",".jstree-anchor",function(i){i.originalEvent&&i.originalEvent.changedTouches&&i.originalEvent.changedTouches[0]&&(f=i.originalEvent.changedTouches[0].clientX,e=i.originalEvent.changedTouches[0].clientY,t=setTimeout(function(){n(i.currentTarget).trigger("contextmenu",!0)},750))}).on("touchmove.vakata.jstree",function(i){t&&i.originalEvent&&i.originalEvent.changedTouches&&i.originalEvent.changedTouches[0]&&(Math.abs(f-i.originalEvent.changedTouches[0].clientX)>10||Math.abs(e-i.originalEvent.changedTouches[0].clientY)>10)&&(clearTimeout(t),n.vakata.context.hide())}).on("touchend.vakata.jstree",function(){t&&clearTimeout(t)});
/*!
if(!('oncontextmenu' in document.body) && ('ontouchstart' in document.body)) {
var el = null, tm = null;
this.element
.on("touchstart", ".jstree-anchor", function (e) {
el = e.currentTarget;
tm = +new Date();
$(document).one("touchend", function (e) {
e.target = document.elementFromPoint(e.originalEvent.targetTouches[0].pageX - window.pageXOffset, e.originalEvent.targetTouches[0].pageY - window.pageYOffset);
e.currentTarget = e.target;
tm = ((+(new Date())) - tm);
if(e.target === el && tm > 600 && tm < 1000) {
e.preventDefault();
$(el).trigger('contextmenu', e);
}
el = null;
tm = null;
});
});
}
*/
n(i).on("context_hide.vakata.jstree",n.proxy(function(t,i){this._data.contextmenu.visible=!1;n(i.reference).removeClass("jstree-context")},this))};this.teardown=function(){this._data.contextmenu.visible&&n.vakata.context.hide();u.teardown.call(this)};this.show_contextmenu=function(i,r,u,f){if(i=this.get_node(i),!i||i.id===n.jstree.root)return!1;var s=this.settings.contextmenu,h=this.get_node(i,!0),c=h.children(".jstree-anchor"),o=!1,e=!1;(s.show_at_node||r===t||u===t)&&(o=c.offset(),r=o.left,u=o.top+this._data.core.li_height);this.settings.contextmenu.select_node&&!this.is_selected(i)&&this.activate_node(i,f);e=s.items;n.isFunction(e)&&(e=e.call(this,i,n.proxy(function(n){this._show_contextmenu(i,r,u,n)},this)));n.isPlainObject(e)&&this._show_contextmenu(i,r,u,e)};this._show_contextmenu=function(t,r,u,f){var o=this.get_node(t,!0),e=o.children(".jstree-anchor");n(i).one("context_show.vakata.jstree",n.proxy(function(t,i){var r="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";n(i.element).addClass(r);e.addClass("jstree-context")},this));this._data.contextmenu.visible=!0;n.vakata.context.show(e,{x:r,y:u},f);this.trigger("show_contextmenu",{node:t,x:r,y:u})}},function(n){var r=!1,t={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};n.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(r){n(i).triggerHandler("context_"+r+".vakata",{reference:t.reference,element:t.element,position:{x:t.position_x,y:t.position_y}})},_execute:function(i){return i=t.items[i],i&&(!i._disabled||n.isFunction(i._disabled)&&!i._disabled({item:i,reference:t.reference,element:t.element}))&&i.action?i.action.call(null,{item:i,reference:t.reference,element:t.element,position:{x:t.position_x,y:t.position_y}}):!1},_parse:function(i,r){if(!i)return!1;r||(t.html="",t.items=[]);var u="",f=!1,e;return r&&(u+="<ul>"),n.each(i,function(i,r){if(!r)return!0;t.items.push(r);!f&&r.separator_before&&(u+="<li class='vakata-context-separator'><a href='#' "+(n.vakata.context.settings.icons?"":'style="margin-left:0px;"')+"> <\/a><\/li>");f=!1;u+="<li class='"+(r._class||"")+(r._disabled===!0||n.isFunction(r._disabled)&&r._disabled({item:r,reference:t.reference,element:t.element})?" vakata-contextmenu-disabled ":"")+"' "+(r.shortcut?" data-shortcut='"+r.shortcut+"' ":"")+">";u+="<a href='#' rel='"+(t.items.length-1)+"' "+(r.title?"title='"+r.title+"'":"")+">";n.vakata.context.settings.icons&&(u+="<i ",r.icon&&(u+=r.icon.indexOf("/")!==-1||r.icon.indexOf(".")!==-1?" style='background:url(\""+r.icon+"\") center center no-repeat' ":" class='"+r.icon+"' "),u+="><\/i><span class='vakata-contextmenu-sep'> <\/span>");u+=(n.isFunction(r.label)?r.label({item:i,reference:t.reference,element:t.element}):r.label)+(r.shortcut?' <span class="vakata-contextmenu-shortcut vakata-contextmenu-shortcut-'+r.shortcut+'">'+(r.shortcut_label||"")+"<\/span>":"")+"<\/a>";r.submenu&&(e=n.vakata.context._parse(r.submenu,!0),e&&(u+=e));u+="<\/li>";r.separator_after&&(u+="<li class='vakata-context-separator'><a href='#' "+(n.vakata.context.settings.icons?"":'style="margin-left:0px;"')+"> <\/a><\/li>",f=!0)}),u=u.replace(/<li class\='vakata-context-separator'\><\/li\>$/,""),r&&(u+="<\/ul>"),r||(t.html=u,n.vakata.context._trigger("parse")),u.length>10?u:!1},_show_submenu:function(t){if(t=n(t),t.length&&t.children("ul").length){var i=t.children("ul"),e=t.offset().left,f=e+t.outerWidth(),s=t.offset().top,u=i.width(),h=i.height(),o=n(window).width()+n(window).scrollLeft(),c=n(window).height()+n(window).scrollTop();r?t[f-(u+10+t.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):t[f+u>o&&e>o-f?"addClass":"removeClass"]("vakata-context-right");s+h+10>c&&i.css("bottom","-1px");t.hasClass("vakata-context-right")?e<u&&i.css("margin-right",e-u):o-f<u&&i.css("margin-left",o-f-u);i.show()}},show:function(u,f,e){var c,s,o,h,l,a,v,y;t.element&&t.element.length&&t.element.width("");switch(!0){case!f&&!u:return!1;case!!f&&!!u:t.reference=u;t.position_x=f.x;t.position_y=f.y;break;case!f&&!!u:t.reference=u;c=u.offset();t.position_x=c.left+u.outerHeight();t.position_y=c.top;break;case!!f&&!u:t.position_x=f.x;t.position_y=f.y}!u||e||!n(u).data("vakata_contextmenu")||(e=n(u).data("vakata_contextmenu"));n.vakata.context._parse(e)&&t.element.html(t.html);t.items.length&&(t.element.appendTo(i.body),s=t.element,o=t.position_x,h=t.position_y,l=s.width(),a=s.height(),v=n(window).width()+n(window).scrollLeft(),y=n(window).height()+n(window).scrollTop(),r&&(o-=s.outerWidth()-n(u).outerWidth(),o<n(window).scrollLeft()+20&&(o=n(window).scrollLeft()+20)),o+l+20>v&&(o=v-(l+20)),h+a+20>y&&(h=y-(a+20)),t.element.css({left:o,top:h}).show().find("a").first().focus().parent().addClass("vakata-context-hover"),t.is_visible=!0,n.vakata.context._trigger("show"))},hide:function(){t.is_visible&&(t.element.hide().find("ul").hide().end().find(":focus").blur().end().detach(),t.is_visible=!1,n.vakata.context._trigger("hide"))}};n(function(){r=n(i.body).css("direction")==="rtl";var u=!1;t.element=n("<ul class='vakata-context'><\/ul>");t.element.on("mouseenter","li",function(i){(i.stopImmediatePropagation(),n.contains(this,i.relatedTarget))||(u&&clearTimeout(u),t.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),n(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),n.vakata.context._show_submenu(this))}).on("mouseleave","li",function(t){n.contains(this,t.relatedTarget)||n(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(){n(this).find(".vakata-context-hover").removeClass("vakata-context-hover");n.vakata.context.settings.hide_onmouseleave&&(u=setTimeout(function(){return function(){n.vakata.context.hide()}}(this),n.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(t){t.preventDefault();n(this).blur().parent().hasClass("vakata-context-disabled")||n.vakata.context._execute(n(this).attr("rel"))===!1||n.vakata.context.hide()}).on("keydown","a",function(i){var r=null;switch(i.which){case 13:case 32:i.type="click";i.preventDefault();n(i.currentTarget).trigger(i);break;case 37:t.is_visible&&(t.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),i.stopImmediatePropagation(),i.preventDefault());break;case 38:t.is_visible&&(r=t.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),r.length||(r=t.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),r.addClass("vakata-context-hover").children("a").focus(),i.stopImmediatePropagation(),i.preventDefault());break;case 39:t.is_visible&&(t.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),i.stopImmediatePropagation(),i.preventDefault());break;case 40:t.is_visible&&(r=t.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),r.length||(r=t.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),r.addClass("vakata-context-hover").children("a").focus(),i.stopImmediatePropagation(),i.preventDefault());break;case 27:n.vakata.context.hide();i.preventDefault()}}).on("keydown",function(n){n.preventDefault();var i=t.element.find(".vakata-contextmenu-shortcut-"+n.which).parent();i.parent().not(".vakata-context-disabled")&&i.click()});n(i).on("mousedown.vakata.jstree",function(i){t.is_visible&&t.element[0]!==i.target&&!n.contains(t.element[0],i.target)&&n.vakata.context.hide()}).on("context_show.vakata.jstree",function(){t.element.find("li:has(ul)").children("a").addClass("vakata-context-parent");r&&t.element.addClass("vakata-context-rtl").css("direction","rtl");t.element.find("ul").hide().end()})})}(n),n.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0,check_while_dragging:!0,always_copy:!1,inside_pos:0,drag_selection:!0,touch:!0,large_drop_target:!1,large_drag_target:!1,use_html5:!1},n.jstree.plugins.dnd=function(t,r){this.init=function(n,t){r.init.call(this,n,t);this.settings.dnd.use_html5=this.settings.dnd.use_html5&&"draggable"in i.createElement("span")};this.bind=function(){r.bind.call(this);this.element.on(this.settings.dnd.use_html5?"dragstart.jstree":"mousedown.jstree touchstart.jstree",this.settings.dnd.large_drag_target?".jstree-node":".jstree-anchor",n.proxy(function(t){if(this.settings.dnd.large_drag_target&&n(t.target).closest(".jstree-node")[0]!==t.currentTarget||t.type==="touchstart"&&(!this.settings.dnd.touch||this.settings.dnd.touch==="selected"&&!n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").hasClass("jstree-clicked")))return!0;var i=this.get_node(t.target),r=this.is_selected(i)&&this.settings.dnd.drag_selection?this.get_top_selected().length:1,u=r>1?r+" "+this.get_string("nodes"):this.get_text(t.currentTarget);if(this.settings.core.force_text&&(u=n.vakata.html.escape(u)),i&&i.id&&i.id!==n.jstree.root&&(t.which===1||t.type==="touchstart"||t.type==="dragstart")&&(this.settings.dnd.is_draggable===!0||n.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,r>1?this.get_top_selected(!0):[i],t)))if(e={jstree:!0,origin:this,obj:this.get_node(i,!0),nodes:r>1?this.get_top_selected():[i.id]},f=t.currentTarget,this.settings.dnd.use_html5)n.vakata.dnd._trigger("start",t,{helper:n(),element:f,data:e});else return this.element.trigger("mousedown.jstree"),n.vakata.dnd.start(t,e,'<div id="jstree-dnd" class="jstree-'+this.get_theme()+" jstree-"+this.get_theme()+"-"+this.get_theme_variant()+" "+(this.settings.core.themes.responsive?" jstree-dnd-responsive":"")+'"><i class="jstree-icon jstree-er"><\/i>'+u+'<ins class="jstree-copy" style="display:none;">+<\/ins><\/div>')},this));if(this.settings.dnd.use_html5)this.element.on("dragover.jstree",function(t){return t.preventDefault(),n.vakata.dnd._trigger("move",t,{helper:n(),element:f,data:e}),!1}).on("drop.jstree",n.proxy(function(t){return t.preventDefault(),n.vakata.dnd._trigger("stop",t,{helper:n(),element:f,data:e}),!1},this))};this.redraw_node=function(n){if(n=r.redraw_node.apply(this,arguments),n&&this.settings.dnd.use_html5)if(this.settings.dnd.large_drag_target)n.setAttribute("draggable",!0);else{for(var i=null,t=0,u=n.childNodes.length;t<u;t++)if(n.childNodes[t]&&n.childNodes[t].className&&n.childNodes[t].className.indexOf("jstree-anchor")!==-1){i=n.childNodes[t];break}i&&i.setAttribute("draggable",!0)}return n}},n(function(){var r=!1,h=!1,u=!1,o=!1,s=n('<div id="jstree-marker"> <\/div>').hide();n(i).on("dragover.vakata.jstree",function(t){f&&n.vakata.dnd._trigger("move",t,{helper:n(),element:f,data:e})}).on("drop.vakata.jstree",function(t){f&&(n.vakata.dnd._trigger("stop",t,{helper:n(),element:f,data:e}),f=null,e=null)}).on("dnd_start.vakata.jstree",function(n,t){(r=!1,u=!1,t&&t.data&&t.data.jstree)&&s.appendTo(i.body)}).on("dnd_move.vakata.jstree",function(i,f){var ot=f.event.target!==u.target;if((o&&(!f.event||f.event.type!=="dragover"||ot)&&clearTimeout(o),f&&f.data&&f.data.jstree)&&(!f.event.target.id||f.event.target.id!=="jstree-marker")){u=f.event;var e=n.jstree.reference(f.event.target),c=!1,v=!1,d=!1,g,nt,p,y,w,tt,a,l,it,ft,rt,st,b,k,ut,et;if(e&&e._data&&e._data.dnd)if(s.attr("class","jstree-"+e.get_theme()+(e.settings.core.themes.responsive?" jstree-dnd-responsive":"")),ut=f.data.origin&&(f.data.origin.settings.dnd.always_copy||f.data.origin.settings.dnd.copy&&(f.event.metaKey||f.event.ctrlKey)),f.helper.children().attr("class","jstree-"+e.get_theme()+" jstree-"+e.get_theme()+"-"+e.get_theme_variant()+" "+(e.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[ut?"show":"hide"](),(f.event.target===e.element[0]||f.event.target===e.get_container_ul()[0])&&e.get_container_ul().children().length===0){for(a=!0,l=0,it=f.data.nodes.length;l<it;l++)if(a=a&&e.check(f.data.origin&&(f.data.origin.settings.dnd.always_copy||f.data.origin.settings.dnd.copy&&(f.event.metaKey||f.event.ctrlKey))?"copy_node":"move_node",f.data.origin&&f.data.origin!==e?f.data.origin.get_node(f.data.nodes[l]):f.data.nodes[l],n.jstree.root,"last",{dnd:!0,ref:e.get_node(n.jstree.root),pos:"i",origin:f.data.origin,is_multi:f.data.origin&&f.data.origin!==e,is_foreign:!f.data.origin}),!a)break;if(a){r={ins:e,par:n.jstree.root,pos:"last"};s.hide();f.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok");f.event.originalEvent&&f.event.originalEvent.dataTransfer&&(f.event.originalEvent.dataTransfer.dropEffect=ut?"copy":"move");return}}else if(c=e.settings.dnd.large_drop_target?n(f.event.target).closest(".jstree-node").children(".jstree-anchor"):n(f.event.target).closest(".jstree-anchor"),c&&c.length&&c.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(v=c.offset(),d=(f.event.pageY!==t?f.event.pageY:f.event.originalEvent.pageY)-v.top,p=c.outerHeight(),tt=d<p/3?["b","i","a"]:d>p-p/3?["a","i","b"]:d>p/2?["i","a","b"]:["i","b","a"],n.each(tt,function(t,i){switch(i){case"b":g=v.left-6;nt=v.top;y=e.get_parent(c);w=c.parent().index();break;case"i":b=e.settings.dnd.inside_pos;k=e.get_node(c.parent());g=v.left-2;nt=v.top+p/2+1;y=k.id;w=b==="first"?0:b==="last"?k.children.length:Math.min(b,k.children.length);break;case"a":g=v.left-6;nt=v.top+p;y=e.get_parent(c);w=c.parent().index()+1}for(a=!0,l=0,it=f.data.nodes.length;l<it;l++)if(ft=f.data.origin&&(f.data.origin.settings.dnd.always_copy||f.data.origin.settings.dnd.copy&&(f.event.metaKey||f.event.ctrlKey))?"copy_node":"move_node",rt=w,ft==="move_node"&&i==="a"&&f.data.origin&&f.data.origin===e&&y===e.get_parent(f.data.nodes[l])&&(st=e.get_node(y),rt>n.inArray(f.data.nodes[l],st.children)&&(rt-=1)),a=a&&(e&&e.settings&&e.settings.dnd&&e.settings.dnd.check_while_dragging===!1||e.check(ft,f.data.origin&&f.data.origin!==e?f.data.origin.get_node(f.data.nodes[l]):f.data.nodes[l],y,rt,{dnd:!0,ref:e.get_node(c.parent()),pos:i,origin:f.data.origin,is_multi:f.data.origin&&f.data.origin!==e,is_foreign:!f.data.origin})),!a){e&&e.last_error&&(h=e.last_error());break}return i==="i"&&c.parent().is(".jstree-closed")&&e.settings.dnd.open_timeout&&(!f.event||f.event.type!=="dragover"||ot)&&(o&&clearTimeout(o),o=setTimeout(function(n,t){return function(){n.open_node(t)}}(e,c),e.settings.dnd.open_timeout)),a?(et=e.get_node(y,!0),et.hasClass(".jstree-dnd-parent")||(n(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),et.addClass("jstree-dnd-parent")),r={ins:e,par:y,pos:i==="i"&&b==="last"&&w===0&&!e.is_loaded(k)?"last":w},s.css({left:g+"px",top:nt+"px"}).show(),f.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),f.event.originalEvent&&f.event.originalEvent.dataTransfer&&(f.event.originalEvent.dataTransfer.dropEffect=ut?"copy":"move"),h={},tt=!0,!1):void 0}),tt===!0))return;n(".jstree-dnd-parent").removeClass("jstree-dnd-parent");r=!1;f.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er");f.event.originalEvent&&f.event.originalEvent.dataTransfer;s.hide()}}).on("dnd_scroll.vakata.jstree",function(n,t){t&&t.data&&t.data.jstree&&(s.hide(),r=!1,u=!1,t.helper.find(".jstree-icon").first().removeClass("jstree-ok").addClass("jstree-er"))}).on("dnd_stop.vakata.jstree",function(t,i){if(n(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),o&&clearTimeout(o),i&&i.data&&i.data.jstree){s.hide().detach();var f,e,c=[];if(r){for(f=0,e=i.data.nodes.length;f<e;f++)c[f]=i.data.origin?i.data.origin.get_node(i.data.nodes[f]):i.data.nodes[f];r.ins[i.data.origin&&(i.data.origin.settings.dnd.always_copy||i.data.origin.settings.dnd.copy&&(i.event.metaKey||i.event.ctrlKey))?"copy_node":"move_node"](c,r.par,r.pos,!1,!1,!1,i.data.origin)}else f=n(i.event.target).closest(".jstree"),f.length&&h&&h.error&&h.error==="check"&&(f=f.jstree(!0),f&&f.settings.core.error.call(this,h));u=!1;r=!1}}).on("keyup.jstree keydown.jstree",function(t,i){i=n.vakata.dnd._get();i&&i.data&&i.data.jstree&&(t.type==="keyup"&&t.which===27?(o&&clearTimeout(o),r=!1,h=!1,u=!1,o=!1,s.hide().detach(),n.vakata.dnd._clean()):(i.helper.find(".jstree-copy").first()[i.data.origin&&(i.data.origin.settings.dnd.always_copy||i.data.origin.settings.dnd.copy&&(t.metaKey||t.ctrlKey))?"show":"hide"](),u&&(u.metaKey=t.metaKey,u.ctrlKey=t.ctrlKey,n.vakata.dnd._trigger("move",u))))})}),function(n){n.vakata.html={div:n("<div />"),escape:function(t){return n.vakata.html.div.text(t).html()},strip:function(t){return n.vakata.html.div.empty().append(n.parseHTML(t)).text()}};var r={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1};n.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:10},_trigger:function(r,u,f){f===t&&(f=n.vakata.dnd._get());f.event=u;n(i).triggerHandler("dnd_"+r+".vakata",f)},_get:function(){return{data:r.data,element:r.element,helper:r.helper}},_clean:function(){r.helper&&r.helper.remove();r.scroll_i&&(clearInterval(r.scroll_i),r.scroll_i=!1);r={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1};n(i).off("mousemove.vakata.jstree touchmove.vakata.jstree",n.vakata.dnd.drag);n(i).off("mouseup.vakata.jstree touchend.vakata.jstree",n.vakata.dnd.stop)},_scroll:function(t){if(!r.scroll_e||!r.scroll_l&&!r.scroll_t)return r.scroll_i&&(clearInterval(r.scroll_i),r.scroll_i=!1),!1;if(!r.scroll_i)return r.scroll_i=setInterval(n.vakata.dnd._scroll,100),!1;if(t===!0)return!1;var i=r.scroll_e.scrollTop(),u=r.scroll_e.scrollLeft();r.scroll_e.scrollTop(i+r.scroll_t*n.vakata.dnd.settings.scroll_speed);r.scroll_e.scrollLeft(u+r.scroll_l*n.vakata.dnd.settings.scroll_speed);(i!==r.scroll_e.scrollTop()||u!==r.scroll_e.scrollLeft())&&n.vakata.dnd._trigger("scroll",r.scroll_e)},start:function(t,u,f){t.type==="touchstart"&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=i.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset));r.is_drag&&n.vakata.dnd.stop({});try{t.currentTarget.unselectable="on";t.currentTarget.onselectstart=function(){return!1};t.currentTarget.style&&(t.currentTarget.style.touchAction="none",t.currentTarget.style.msTouchAction="none",t.currentTarget.style.MozUserSelect="none")}catch(e){}r.init_x=t.pageX;r.init_y=t.pageY;r.data=u;r.is_down=!0;r.element=t.currentTarget;r.target=t.target;r.is_touch=t.type==="touchstart";f!==!1&&(r.helper=n("<div id='vakata-dnd'><\/div>").html(f).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"}));n(i).on("mousemove.vakata.jstree touchmove.vakata.jstree",n.vakata.dnd.drag);n(i).on("mouseup.vakata.jstree touchend.vakata.jstree",n.vakata.dnd.stop);return!1},drag:function(t){if(t.type==="touchmove"&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=i.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),r.is_down){if(!r.is_drag)if(Math.abs(t.pageX-r.init_x)>(r.is_touch?n.vakata.dnd.settings.threshold_touch:n.vakata.dnd.settings.threshold)||Math.abs(t.pageY-r.init_y)>(r.is_touch?n.vakata.dnd.settings.threshold_touch:n.vakata.dnd.settings.threshold)){r.helper&&(r.helper.appendTo(i.body),r.helper_w=r.helper.outerWidth());r.is_drag=!0;n(r.target).one("click.vakata",!1);n.vakata.dnd._trigger("start",t)}else return;var u=!1,l=!1,f=!1,o=!1,e=!1,s=!1,a=!1,v=!1,h=!1,c=!1;return r.scroll_t=0,r.scroll_l=0,r.scroll_e=!1,n(n(t.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(n(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var u=n(this),i=u.offset();return this.scrollHeight>this.offsetHeight&&(i.top+u.height()-t.pageY<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_t=1),t.pageY-i.top<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_t=-1)),this.scrollWidth>this.offsetWidth&&(i.left+u.width()-t.pageX<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_l=1),t.pageX-i.left<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_l=-1)),r.scroll_t||r.scroll_l?(r.scroll_e=n(this),!1):void 0}),r.scroll_e||(u=n(i),l=n(window),f=u.height(),o=l.height(),e=u.width(),s=l.width(),a=u.scrollTop(),v=u.scrollLeft(),f>o&&t.pageY-a<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_t=-1),f>o&&o-(t.pageY-a)<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_t=1),e>s&&t.pageX-v<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_l=-1),e>s&&s-(t.pageX-v)<n.vakata.dnd.settings.scroll_proximity&&(r.scroll_l=1),(r.scroll_t||r.scroll_l)&&(r.scroll_e=u)),r.scroll_e&&n.vakata.dnd._scroll(!0),r.helper&&(h=parseInt(t.pageY+n.vakata.dnd.settings.helper_top,10),c=parseInt(t.pageX+n.vakata.dnd.settings.helper_left,10),f&&h+25>f&&(h=f-50),e&&c+r.helper_w>e&&(c=e-(r.helper_w+2)),r.helper.css({left:c+"px",top:h+"px"})),n.vakata.dnd._trigger("move",t),!1}},stop:function(t){if(t.type==="touchend"&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=i.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),r.is_drag)t.target!==r.target&&n(r.target).off("click.vakata"),n.vakata.dnd._trigger("stop",t);else if(t.type==="touchend"&&t.target===r.target){var u=setTimeout(function(){n(t.target).click()},100);n(t.target).one("click",function(){u&&clearTimeout(u)})}return n.vakata.dnd._clean(),!1}}}(n),n.jstree.defaults.massload=null,n.jstree.plugins.massload=function(t,i){this.init=function(n,t){this._data.massload={};i.init.call(this,n,t)};this._load_nodes=function(t,r,u,f){var e=this.settings.massload,a=JSON.stringify(t),h=[],c=this._model.data,s,l,o;if(!u){for(s=0,l=t.length;s<l;s++)c[t[s]]&&(c[t[s]].state.loaded||c[t[s]].state.failed)&&!f||(h.push(t[s]),o=this.get_node(t[s],!0),o&&o.length&&o.addClass("jstree-loading").attr("aria-busy",!0));if(this._data.massload={},h.length){if(n.isFunction(e))return e.call(this,h,n.proxy(function(n){var e,s;if(n)for(e in n)n.hasOwnProperty(e)&&(this._data.massload[e]=n[e]);for(e=0,s=t.length;e<s;e++)o=this.get_node(t[e],!0),o&&o.length&&o.removeClass("jstree-loading").attr("aria-busy",!1);i._load_nodes.call(this,t,r,u,f)},this));if(typeof e=="object"&&e&&e.url)return e=n.extend(!0,{},e),n.isFunction(e.url)&&(e.url=e.url.call(this,h)),n.isFunction(e.data)&&(e.data=e.data.call(this,h)),n.ajax(e).done(n.proxy(function(n){var e,s;if(n)for(e in n)n.hasOwnProperty(e)&&(this._data.massload[e]=n[e]);for(e=0,s=t.length;e<s;e++)o=this.get_node(t[e],!0),o&&o.length&&o.removeClass("jstree-loading").attr("aria-busy",!1);i._load_nodes.call(this,t,r,u,f)},this)).fail(n.proxy(function(){i._load_nodes.call(this,t,r,u,f)},this))}}return i._load_nodes.call(this,t,r,u,f)};this._load_node=function(t,r){var u=this._data.massload[t.id],e=null,f;return u?(e=this[typeof u=="string"?"_append_html_data":"_append_json_data"](t,typeof u=="string"?n(n.parseHTML(u)).filter(function(){return this.nodeType!==3}):u,function(n){r.call(this,n)}),f=this.get_node(t.id,!0),f&&f.length&&f.removeClass("jstree-loading").attr("aria-busy",!1),delete this._data.massload[t.id],e):i._load_node.call(this,t,r)}},n.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,show_only_matches_children:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},n.jstree.plugins.search=function(i,r){this.bind=function(){r.bind.call(this);this._data.search.str="";this._data.search.dom=n();this._data.search.res=[];this._data.search.opn=[];this._data.search.som=!1;this._data.search.smc=!1;this._data.search.hdn=[];this.element.on("search.jstree",n.proxy(function(t,i){if(this._data.search.som&&i.res.length){for(var u=this._model.data,f=[],e,s,r=0,o=i.res.length;r<o;r++)if(u[i.res[r]]&&!u[i.res[r]].state.hidden&&(f.push(i.res[r]),f=f.concat(u[i.res[r]].parents),this._data.search.smc))for(e=0,s=u[i.res[r]].children_d.length;e<s;e++)u[u[i.res[r]].children_d[e]]&&!u[u[i.res[r]].children_d[e]].state.hidden&&f.push(u[i.res[r]].children_d[e]);f=n.vakata.array_remove_item(n.vakata.array_unique(f),n.jstree.root);this._data.search.hdn=this.hide_all(!0);this.show_node(f,!0);this.redraw(!0)}},this)).on("clear_search.jstree",n.proxy(function(n,t){this._data.search.som&&t.res.length&&(this.show_node(this._data.search.hdn,!0),this.redraw(!0))},this))};this.search=function(i,r,u,f,e,o){if(i===!1||n.trim(i.toString())==="")return this.clear_search();f=this.get_node(f);f=f&&f.id?f.id:null;i=i.toString();var h=this.settings.search,s=h.ajax?h.ajax:!1,v=this._model.data,y=null,a=[],c=[],l,p;if(this._data.search.res.length&&!e&&this.clear_search(),u===t&&(u=h.show_only_matches),o===t&&(o=h.show_only_matches_children),!r&&s!==!1)return n.isFunction(s)?s.call(this,i,n.proxy(function(t){t&&t.d&&(t=t.d);this._load_nodes(n.isArray(t)?n.vakata.array_unique(t):[],function(){this.search(i,!0,u,f,e,o)})},this),f):(s=n.extend({},s),s.data||(s.data={}),s.data.str=i,f&&(s.data.inside=f),this._data.search.lastRequest&&this._data.search.lastRequest.abort(),this._data.search.lastRequest=n.ajax(s).fail(n.proxy(function(){this._data.core.last_error={error:"ajax",plugin:"search",id:"search_01",reason:"Could not load search parents",data:JSON.stringify(s)};this.settings.core.error.call(this,this._data.core.last_error)},this)).done(n.proxy(function(t){t&&t.d&&(t=t.d);this._load_nodes(n.isArray(t)?n.vakata.array_unique(t):[],function(){this.search(i,!0,u,f,e,o)})},this)),this._data.search.lastRequest);if(e||(this._data.search.str=i,this._data.search.dom=n(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=u,this._data.search.smc=o),y=new n.vakata.search(i,!0,{caseSensitive:h.case_sensitive,fuzzy:h.fuzzy}),n.each(v[f?f:n.jstree.root].children_d,function(n,t){var r=v[t];r.text&&!r.state.hidden&&(!h.search_leaves_only||r.state.loaded&&r.children.length===0)&&(h.search_callback&&h.search_callback.call(this,i,r)||!h.search_callback&&y.search(r.text).isMatch)&&(a.push(t),c=c.concat(r.parents))}),a.length){for(c=n.vakata.array_unique(c),l=0,p=c.length;l<p;l++)c[l]!==n.jstree.root&&v[c[l]]&&this.open_node(c[l],null,0)===!0&&this._data.search.opn.push(c[l]);e?(this._data.search.dom=this._data.search.dom.add(n(this.element[0].querySelectorAll("#"+n.map(a,function(t){return"0123456789".indexOf(t[0])!==-1?"\\3"+t[0]+" "+t.substr(1).replace(n.jstree.idregex,"\\$&"):t.replace(n.jstree.idregex,"\\$&")}).join(", #")))),this._data.search.res=n.vakata.array_unique(this._data.search.res.concat(a))):(this._data.search.dom=n(this.element[0].querySelectorAll("#"+n.map(a,function(t){return"0123456789".indexOf(t[0])!==-1?"\\3"+t[0]+" "+t.substr(1).replace(n.jstree.idregex,"\\$&"):t.replace(n.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.res=a);this._data.search.dom.children(".jstree-anchor").addClass("jstree-search")}this.trigger("search",{nodes:this._data.search.dom,str:i,res:this._data.search.res,show_only_matches:u})};this.clear_search=function(){this.settings.search.close_opened_onclear&&this.close_node(this._data.search.opn,0);this.trigger("clear_search",{nodes:this._data.search.dom,str:this._data.search.str,res:this._data.search.res});this._data.search.res.length&&(this._data.search.dom=n(this.element[0].querySelectorAll("#"+n.map(this._data.search.res,function(t){return"0123456789".indexOf(t[0])!==-1?"\\3"+t[0]+" "+t.substr(1).replace(n.jstree.idregex,"\\$&"):t.replace(n.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search"));this._data.search.str="";this._data.search.res=[];this._data.search.opn=[];this._data.search.dom=n()};this.redraw_node=function(t){if(t=r.redraw_node.apply(this,arguments),t&&n.inArray(t.id,this._data.search.res)!==-1){for(var u=null,i=0,f=t.childNodes.length;i<f;i++)if(t.childNodes[i]&&t.childNodes[i].className&&t.childNodes[i].className.indexOf("jstree-anchor")!==-1){u=t.childNodes[i];break}u&&(u.className+=" jstree-search")}return t}},function(n){n.vakata.search=function(t,i,r){r=r||{};r=n.extend({},n.vakata.search.defaults,r);r.fuzzy!==!1&&(r.fuzzy=!0);t=r.caseSensitive?t:t.toLowerCase();var f=r.location,s=r.distance,l=r.threshold,u=t.length,h,c,e,o;return u>32&&(r.fuzzy=!1),r.fuzzy&&(h=1<<u-1,c=function(){for(var i={},n=0,n=0;n<u;n++)i[t.charAt(n)]=0;for(n=0;n<u;n++)i[t.charAt(n)]|=1<<u-n-1;return i}(),e=function(n,t){var i=n/u,r=Math.abs(f-t);return s?i+r/s:r?1:i}),o=function(n){if(n=r.caseSensitive?n:n.toLowerCase(),t===n||n.indexOf(t)!==-1)return{isMatch:!0,score:0};if(!r.fuzzy)return{isMatch:!1,score:1};var a,i,tt=n.length,v=l,o=n.indexOf(t,f),p,s,w=u+tt,b,g,k,y,nt,d=1,it=[];for(o!==-1&&(v=Math.min(e(0,o),v),o=n.lastIndexOf(t,f+u),o!==-1&&(v=Math.min(e(0,o),v))),o=-1,a=0;a<u;a++){for(p=0,s=w;p<s;)e(a,f+s)<=v?p=s:w=s,s=Math.floor((w-p)/2+p);for(w=s,g=Math.max(1,f-s+1),k=Math.min(f+s,tt)+u,y=new Array(k+2),y[k+1]=(1<<a)-1,i=k;i>=g;i--)if(nt=c[n.charAt(i-1)],y[i]=a===0?(y[i+1]<<1|1)&nt:(y[i+1]<<1|1)&nt|(b[i+1]|b[i])<<1|1|b[i+1],y[i]&h&&(d=e(a,i-1),d<=v))if(v=d,o=i-1,it.push(o),o>f)g=Math.max(1,2*f-o);else break;if(e(a+1,f)>v)break;b=y}return{isMatch:o>=0,score:d}},i===!0?{search:o}:o(i)};n.vakata.search.defaults={location:0,distance:100,threshold:.6,fuzzy:!1,caseSensitive:!1}}(n),n.jstree.defaults.sort=function(n,t){return this.get_text(n)>this.get_text(t)?1:-1},n.jstree.plugins.sort=function(t,i){this.bind=function(){i.bind.call(this);this.element.on("model.jstree",n.proxy(function(n,t){this.sort(t.parent,!0)},this)).on("rename_node.jstree create_node.jstree",n.proxy(function(n,t){this.sort(t.parent||t.node.parent,!1);this.redraw_node(t.parent||t.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",n.proxy(function(n,t){this.sort(t.parent,!1);this.redraw_node(t.parent,!0)},this))};this.sort=function(t,i){var r,u;if(t=this.get_node(t),t&&t.children&&t.children.length&&(t.children.sort(n.proxy(this.settings.sort,this)),i))for(r=0,u=t.children_d.length;r<u;r++)this.sort(t.children_d[r],!1)}},c=!1,n.jstree.defaults.state={key:"jstree",events:"changed.jstree open_node.jstree close_node.jstree check_node.jstree uncheck_node.jstree",ttl:!1,filter:!1,preserve_loaded:!1},n.jstree.plugins.state=function(t,i){this.bind=function(){i.bind.call(this);var t=n.proxy(function(){this.element.on(this.settings.state.events,n.proxy(function(){c&&clearTimeout(c);c=setTimeout(n.proxy(function(){this.save_state()},this),100)},this));this.trigger("state_ready")},this);this.element.on("ready.jstree",n.proxy(function(){this.element.one("restore_state.jstree",t);this.restore_state()||t()},this))};this.save_state=function(){var t=this.get_state(),i;this.settings.state.preserve_loaded||delete t.core.loaded;i={state:t,ttl:this.settings.state.ttl,sec:+new Date};n.vakata.storage.set(this.settings.state.key,JSON.stringify(i))};this.restore_state=function(){var t=n.vakata.storage.get(this.settings.state.key);if(!!t)try{t=JSON.parse(t)}catch(i){return!1}if(!!t&&t.ttl&&t.sec&&+new Date-t.sec>t.ttl)return!1;if(!!t&&t.state&&(t=t.state),!!t&&n.isFunction(this.settings.state.filter)&&(t=this.settings.state.filter.call(this,t)),!!t){this.settings.state.preserve_loaded||delete t.core.loaded;this.element.one("set_state.jstree",function(i,r){r.instance.trigger("restore_state",{state:n.extend(!0,{},t)})});return this.set_state(t),!0}return!1};this.clear_state=function(){return n.vakata.storage.del(this.settings.state.key)}},function(n){n.vakata.storage={set:function(n,t){return window.localStorage.setItem(n,t)},get:function(n){return window.localStorage.getItem(n)},del:function(n){return window.localStorage.removeItem(n)}}}(n),n.jstree.defaults.types={"default":{}},n.jstree.defaults.types[n.jstree.root]={},n.jstree.plugins.types=function(i,r){this.init=function(i,u){var f,e;if(u&&u.types&&u.types["default"])for(f in u.types)if(f!=="default"&&f!==n.jstree.root&&u.types.hasOwnProperty(f))for(e in u.types["default"])u.types["default"].hasOwnProperty(e)&&u.types[f][e]===t&&(u.types[f][e]=u.types["default"][e]);r.init.call(this,i,u);this._model.data[n.jstree.root].type=n.jstree.root};this.refresh=function(t,i){r.refresh.call(this,t,i);this._model.data[n.jstree.root].type=n.jstree.root};this.bind=function(){this.element.on("model.jstree",n.proxy(function(i,r){for(var f=this._model.data,e=r.nodes,s=this.settings.types,o="default",h,u=0,c=e.length;u<c;u++){if(o="default",f[e[u]].original&&f[e[u]].original.type&&s[f[e[u]].original.type]&&(o=f[e[u]].original.type),f[e[u]].data&&f[e[u]].data.jstree&&f[e[u]].data.jstree.type&&s[f[e[u]].data.jstree.type]&&(o=f[e[u]].data.jstree.type),f[e[u]].type=o,f[e[u]].icon===!0&&s[o].icon!==t&&(f[e[u]].icon=s[o].icon),s[o].li_attr!==t&&typeof s[o].li_attr=="object")for(h in s[o].li_attr)if(s[o].li_attr.hasOwnProperty(h))if(h==="id")continue;else f[e[u]].li_attr[h]===t?f[e[u]].li_attr[h]=s[o].li_attr[h]:h==="class"&&(f[e[u]].li_attr["class"]=s[o].li_attr["class"]+" "+f[e[u]].li_attr["class"]);if(s[o].a_attr!==t&&typeof s[o].a_attr=="object")for(h in s[o].a_attr)if(s[o].a_attr.hasOwnProperty(h))if(h==="id")continue;else f[e[u]].a_attr[h]===t?f[e[u]].a_attr[h]=s[o].a_attr[h]:h==="href"&&f[e[u]].a_attr[h]==="#"?f[e[u]].a_attr.href=s[o].a_attr.href:h==="class"&&(f[e[u]].a_attr["class"]=s[o].a_attr["class"]+" "+f[e[u]].a_attr["class"])}f[n.jstree.root].type=n.jstree.root},this));r.bind.call(this)};this.get_json=function(t,i,u){var e,s,o=this._model.data,h=i?n.extend(!0,{},i,{no_id:!1}):{},f=r.get_json.call(this,t,h,u);if(f===!1)return!1;if(n.isArray(f))for(e=0,s=f.length;e<s;e++)f[e].type=f[e].id&&o[f[e].id]&&o[f[e].id].type?o[f[e].id].type:"default",i&&i.no_id&&(delete f[e].id,f[e].li_attr&&f[e].li_attr.id&&delete f[e].li_attr.id,f[e].a_attr&&f[e].a_attr.id&&delete f[e].a_attr.id);else f.type=f.id&&o[f.id]&&o[f.id].type?o[f.id].type:"default",i&&i.no_id&&(f=this._delete_ids(f));return f};this._delete_ids=function(t){if(n.isArray(t)){for(var i=0,r=t.length;i<r;i++)t[i]=this._delete_ids(t[i]);return t}return delete t.id,t.li_attr&&t.li_attr.id&&delete t.li_attr.id,t.a_attr&&t.a_attr.id&&delete t.a_attr.id,t.children&&n.isArray(t.children)&&(t.children=this._delete_ids(t.children)),t};this.check=function(i,u,f,e,o){if(r.check.call(this,i,u,f,e,o)===!1)return!1;u=u&&u.id?u:this.get_node(u);f=f&&f.id?f:this.get_node(f);var c=u&&u.id?o&&o.origin?o.origin:n.jstree.reference(u.id):null,s,h,l,a;c=c&&c._model&&c._model.data?c._model.data:null;switch(i){case"create_node":case"move_node":case"copy_node":if(i!=="move_node"||n.inArray(u.id,f.children)===-1){if(s=this.get_rules(f),s.max_children!==t&&s.max_children!==-1&&s.max_children===f.children.length)return this._data.core.last_error={error:"check",plugin:"types",id:"types_01",reason:"max_children prevents function: "+i,data:JSON.stringify({chk:i,pos:e,obj:u&&u.id?u.id:!1,par:f&&f.id?f.id:!1})},!1;if(s.valid_children!==t&&s.valid_children!==-1&&n.inArray(u.type||"default",s.valid_children)===-1)return this._data.core.last_error={error:"check",plugin:"types",id:"types_02",reason:"valid_children prevents function: "+i,data:JSON.stringify({chk:i,pos:e,obj:u&&u.id?u.id:!1,par:f&&f.id?f.id:!1})},!1;if(c&&u.children_d&&u.parents){for(h=0,l=0,a=u.children_d.length;l<a;l++)h=Math.max(h,c[u.children_d[l]].parents.length);h=h-u.parents.length+1}(h<=0||h===t)&&(h=1);do{if(s.max_depth!==t&&s.max_depth!==-1&&s.max_depth<h)return this._data.core.last_error={error:"check",plugin:"types",id:"types_03",reason:"max_depth prevents function: "+i,data:JSON.stringify({chk:i,pos:e,obj:u&&u.id?u.id:!1,par:f&&f.id?f.id:!1})},!1;f=this.get_node(f.parent);s=this.get_rules(f);h++}while(f)}}return!0};this.get_rules=function(n){if(n=this.get_node(n),!n)return!1;var i=this.get_type(n,!0);return i.max_depth===t&&(i.max_depth=-1),i.max_children===t&&(i.max_children=-1),i.valid_children===t&&(i.valid_children=-1),i};this.get_type=function(t,i){return t=this.get_node(t),t?i?n.extend({type:t.type},this.settings.types[t.type]):t.type:!1};this.set_type=function(i,r){var o=this._model.data,f,c,a,e,l,u,h,s;if(n.isArray(i)){for(i=i.slice(),c=0,a=i.length;c<a;c++)this.set_type(i[c],r);return!0}if(f=this.settings.types,i=this.get_node(i),!f[r]||!i)return!1;if(h=this.get_node(i,!0),h&&h.length&&(s=h.children(".jstree-anchor")),e=i.type,l=this.get_icon(i),i.type=r,l!==!0&&f[e]&&(f[e].icon===t||l!==f[e].icon)||this.set_icon(i,f[r].icon!==t?f[r].icon:!0),f[e]&&f[e].li_attr!==t&&typeof f[e].li_attr=="object")for(u in f[e].li_attr)if(f[e].li_attr.hasOwnProperty(u))if(u==="id")continue;else u==="class"?(o[i.id].li_attr["class"]=(o[i.id].li_attr["class"]||"").replace(f[e].li_attr[u],""),h&&h.removeClass(f[e].li_attr[u])):o[i.id].li_attr[u]===f[e].li_attr[u]&&(o[i.id].li_attr[u]=null,h&&h.removeAttr(u));if(f[e]&&f[e].a_attr!==t&&typeof f[e].a_attr=="object")for(u in f[e].a_attr)if(f[e].a_attr.hasOwnProperty(u))if(u==="id")continue;else u==="class"?(o[i.id].a_attr["class"]=(o[i.id].a_attr["class"]||"").replace(f[e].a_attr[u],""),s&&s.removeClass(f[e].a_attr[u])):o[i.id].a_attr[u]===f[e].a_attr[u]&&(u==="href"?(o[i.id].a_attr[u]="#",s&&s.attr("href","#")):(delete o[i.id].a_attr[u],s&&s.removeAttr(u)));if(f[r].li_attr!==t&&typeof f[r].li_attr=="object")for(u in f[r].li_attr)if(f[r].li_attr.hasOwnProperty(u))if(u==="id")continue;else o[i.id].li_attr[u]===t?(o[i.id].li_attr[u]=f[r].li_attr[u],h&&(u==="class"?h.addClass(f[r].li_attr[u]):h.attr(u,f[r].li_attr[u]))):u==="class"&&(o[i.id].li_attr["class"]=f[r].li_attr[u]+" "+o[i.id].li_attr["class"],h&&h.addClass(f[r].li_attr[u]));if(f[r].a_attr!==t&&typeof f[r].a_attr=="object")for(u in f[r].a_attr)if(f[r].a_attr.hasOwnProperty(u))if(u==="id")continue;else o[i.id].a_attr[u]===t?(o[i.id].a_attr[u]=f[r].a_attr[u],s&&(u==="class"?s.addClass(f[r].a_attr[u]):s.attr(u,f[r].a_attr[u]))):u==="href"&&o[i.id].a_attr[u]==="#"?(o[i.id].a_attr.href=f[r].a_attr.href,s&&s.attr("href",f[r].a_attr.href)):u==="class"&&(o[i.id].a_attr["class"]=f[r].a_attr["class"]+" "+o[i.id].a_attr["class"],s&&s.addClass(f[r].a_attr[u]));return!0}},n.jstree.defaults.unique={case_sensitive:!1,trim_whitespace:!1,duplicate:function(n,t){return n+" ("+t+")"}},n.jstree.plugins.unique=function(i,r){this.check=function(t,i,u,f,e){if(r.check.call(this,t,i,u,f,e)===!1)return!1;if(i=i&&i.id?i:this.get_node(i),u=u&&u.id?u:this.get_node(u),!u||!u.children)return!0;for(var s=t==="rename_node"?f:i.text,c=[],l=this.settings.unique.case_sensitive,a=this.settings.unique.trim_whitespace,y=this._model.data,h,o=0,v=u.children.length;o<v;o++)h=y[u.children[o]].text,l||(h=h.toLowerCase()),a&&(h=h.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),c.push(h);l||(s=s.toLowerCase());a&&(s=s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""));switch(t){case"delete_node":return!0;case"rename_node":return h=i.text||"",l||(h=h.toLowerCase()),a&&(h=h.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),o=n.inArray(s,c)===-1||i.text&&h===s,o||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_01",reason:"Child with name "+s+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:f,obj:i&&i.id?i.id:!1,par:u&&u.id?u.id:!1})}),o;case"create_node":return o=n.inArray(s,c)===-1,o||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_04",reason:"Child with name "+s+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:f,obj:i&&i.id?i.id:!1,par:u&&u.id?u.id:!1})}),o;case"copy_node":return o=n.inArray(s,c)===-1,o||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_02",reason:"Child with name "+s+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:f,obj:i&&i.id?i.id:!1,par:u&&u.id?u.id:!1})}),o;case"move_node":return o=i.parent===u.id&&(!e||!e.is_multi)||n.inArray(s,c)===-1,o||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_03",reason:"Child with name "+s+" already exists. Preventing: "+t,data:JSON.stringify({chk:t,pos:f,obj:i&&i.id?i.id:!1,par:u&&u.id?u.id:!1})}),o}return!0};this.create_node=function(i,u,f,e,o){if(!u||u.text===t){if((i===null&&(i=n.jstree.root),i=this.get_node(i),!i)||(f=f===t?"last":f,!f.toString().match(/^(before|after)$/)&&!o&&!this.is_loaded(i)))return r.create_node.call(this,i,u,f,e,o);u||(u={});var y,c,l,h,p,w=this._model.data,a=this.settings.unique.case_sensitive,v=this.settings.unique.trim_whitespace,b=this.settings.unique.duplicate,s;for(c=y=this.get_string("New node"),l=[],h=0,p=i.children.length;h<p;h++)s=w[i.children[h]].text,a||(s=s.toLowerCase()),v&&(s=s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")),l.push(s);for(h=1,s=c,a||(s=s.toLowerCase()),v&&(s=s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""));n.inArray(s,l)!==-1;)c=b.call(this,y,++h).toString(),s=c,a||(s=s.toLowerCase()),v&&(s=s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""));u.text=c}return r.create_node.call(this,i,u,f,e,o)}},s=i.createElement("DIV"),s.setAttribute("unselectable","on"),s.setAttribute("role","presentation"),s.className="jstree-wholerow",s.innerHTML=" ",n.jstree.plugins.wholerow=function(t,i){this.bind=function(){i.bind.call(this);this.element.on("ready.jstree set_state.jstree",n.proxy(function(){this.hide_dots()},this)).on("init.jstree loading.jstree ready.jstree",n.proxy(function(){this.get_container_ul().addClass("jstree-wholerow-ul")},this)).on("deselect_all.jstree",n.proxy(function(){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).on("changed.jstree",n.proxy(function(n,t){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked");for(var i=!1,r=0,u=t.selected.length;r<u;r++)i=this.get_node(t.selected[r],!0),i&&i.length&&i.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("open_node.jstree",n.proxy(function(n,t){this.get_node(t.node,!0).find(".jstree-clicked").parent().children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("hover_node.jstree dehover_node.jstree",n.proxy(function(n,t){n.type==="hover_node"&&this.is_disabled(t.node)||this.get_node(t.node,!0).children(".jstree-wholerow")[n.type==="hover_node"?"addClass":"removeClass"]("jstree-wholerow-hovered")},this)).on("contextmenu.jstree",".jstree-wholerow",n.proxy(function(t){if(this._data.contextmenu){t.preventDefault();var i=n.Event("contextmenu",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,pageX:t.pageX,pageY:t.pageY});n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(i)}},this)).on("click.jstree",".jstree-wholerow",function(t){t.stopImmediatePropagation();var i=n.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(i).focus()}).on("dblclick.jstree",".jstree-wholerow",function(t){t.stopImmediatePropagation();var i=n.Event("dblclick",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(i).focus()}).on("click.jstree",".jstree-leaf > .jstree-ocl",n.proxy(function(t){t.stopImmediatePropagation();var i=n.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});n(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(i).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",n.proxy(function(n){return n.stopImmediatePropagation(),this.is_disabled(n.currentTarget)||this.hover_node(n.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",n.proxy(function(n){this.dehover_node(n.currentTarget)},this))};this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove();i.teardown.call(this)};this.redraw_node=function(t){if(t=i.redraw_node.apply(this,arguments),t){var r=s.cloneNode(!0);n.inArray(t.id,this._data.core.selected)!==-1&&(r.className+=" jstree-wholerow-clicked");this._data.core.focused&&this._data.core.focused===t.id&&(r.className+=" jstree-wholerow-hovered");t.insertBefore(r,t.childNodes[0])}return t}},window.customElements&&Object&&Object.create){a=Object.create(HTMLElement.prototype);a.createdCallback=function(){var i={core:{},plugins:[]};for(var t in n.jstree.plugins)n.jstree.plugins.hasOwnProperty(t)&&this.attributes[t]&&(i.plugins.push(t),this.getAttribute(t)&&JSON.parse(this.getAttribute(t))&&(i[t]=JSON.parse(this.getAttribute(t))));for(t in n.jstree.defaults.core)n.jstree.defaults.core.hasOwnProperty(t)&&this.attributes[t]&&(i.core[t]=JSON.parse(this.getAttribute(t))||this.getAttribute(t));n(this).jstree(i)};try{window.customElements.define("vakata-jstree",function(){},{prototype:a})}catch(p){}}}});
//! moment.js
//! version : 2.8.3
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
(function(n){function g(n,t,i){switch(arguments.length){case 2:return n!=null?n:t;case 3:return n!=null?n:t!=null?t:i;default:throw new Error("Implement me");}}function b(n,t){return br.call(n,t)}function vt(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function ai(n){t.suppressDeprecationWarnings===!1&&typeof console!="undefined"&&console.warn&&console.warn("Deprecation warning: "+n)}function o(n,t){var i=!0;return k(function(){return i&&(ai(n),i=!1),t.apply(this,arguments)},t)}function pu(n,t){ci[n]||(ai(t),ci[n]=!0)}function vi(n,t){return function(i){return r(n.call(this,i),t)}}function wu(n,t){return function(i){return this.localeData().ordinal(n.call(this,i),t)}}function yi(){}function et(n,t){t!==!1&&rr(n);pi(this,n);this._d=new Date(+n._d)}function yt(n){var i=gi(n),r=i.year||0,u=i.quarter||0,f=i.month||0,e=i.week||0,o=i.day||0,s=i.hour||0,h=i.minute||0,c=i.second||0,l=i.millisecond||0;this._milliseconds=+l+c*1e3+h*6e4+s*36e5;this._days=+o+e*7;this._months=+f+u*3+r*12;this._data={};this._locale=t.localeData();this._bubble()}function k(n,t){for(var i in t)b(t,i)&&(n[i]=t[i]);return b(t,"toString")&&(n.toString=t.toString),b(t,"valueOf")&&(n.valueOf=t.valueOf),n}function pi(n,t){var u,i,r;if(typeof t._isAMomentObject!="undefined"&&(n._isAMomentObject=t._isAMomentObject),typeof t._i!="undefined"&&(n._i=t._i),typeof t._f!="undefined"&&(n._f=t._f),typeof t._l!="undefined"&&(n._l=t._l),typeof t._strict!="undefined"&&(n._strict=t._strict),typeof t._tzm!="undefined"&&(n._tzm=t._tzm),typeof t._isUTC!="undefined"&&(n._isUTC=t._isUTC),typeof t._offset!="undefined"&&(n._offset=t._offset),typeof t._pf!="undefined"&&(n._pf=t._pf),typeof t._locale!="undefined"&&(n._locale=t._locale),ut.length>0)for(u in ut)i=ut[u],r=t[i],typeof r!="undefined"&&(n[i]=r);return n}function s(n){return n<0?Math.ceil(n):Math.floor(n)}function r(n,t,i){for(var r=""+Math.abs(n),u=n>=0;r.length<t;)r="0"+r;return(u?i?"+":"":"-")+r}function wi(n,t){var i={milliseconds:0,months:0};return i.months=t.month()-n.month()+(t.year()-n.year())*12,n.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+n.clone().add(i.months,"M"),i}function bu(n,t){var i;return t=st(t,n),n.isBefore(t)?i=wi(n,t):(i=wi(t,n),i.milliseconds=-i.milliseconds,i.months=-i.months),i}function bi(n,i){return function(r,u){var f,e;return u===null||isNaN(+u)||(pu(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period)."),e=r,r=u,u=e),r=typeof r=="string"?+r:r,f=t.duration(r,u),ki(this,f,n),this}}function ki(n,i,r,u){var o=i._milliseconds,f=i._days,e=i._months;u=u==null?!0:u;o&&n._d.setTime(+n._d+o*r);f&&vr(n,"Date",gt(n,"Date")+f*r);e&&ar(n,gt(n,"Month")+e*r);u&&t.updateOffset(n,f||e)}function ot(n){return Object.prototype.toString.call(n)==="[object Array]"}function ku(n){return Object.prototype.toString.call(n)==="[object Date]"||n instanceof Date}function di(n,t,r){for(var e=Math.min(n.length,t.length),o=Math.abs(n.length-t.length),f=0,u=0;u<e;u++)(r&&n[u]!==t[u]||!r&&i(n[u])!==i(t[u]))&&f++;return f+o}function f(n){if(n){var t=n.toLowerCase().replace(/(.)s$/,"$1");n=vu[n]||yu[t]||t}return n}function gi(n){var r={},t;for(var i in n)b(n,i)&&(t=f(i),t&&(r[t]=n[i]));return r}function du(i){var r,u;if(i.indexOf("week")===0)r=7,u="day";else if(i.indexOf("month")===0)r=12,u="month";else return;t[i]=function(f,e){var o,s,c=t._locale[i],h=[];if(typeof f=="number"&&(e=f,f=n),s=function(n){var i=t().utc().set(u,n);return c.call(t._locale,i,f||"")},e!=null)return s(e);for(o=0;o<r;o++)h.push(s(o));return h}}function i(n){var t=+n,i=0;return t!==0&&isFinite(t)&&(i=t>=0?Math.floor(t):Math.ceil(t)),i}function pt(n,t){return new Date(Date.UTC(n,t+1,0)).getUTCDate()}function nr(n,i,r){return d(t([n,11,31+i-r]),i,r).week}function tr(n){return ir(n)?366:365}function ir(n){return n%4==0&&n%100!=0||n%400==0}function rr(n){var t;n._a&&n._pf.overflow===-2&&(t=n._a[c]<0||n._a[c]>11?c:n._a[e]<1||n._a[e]>pt(n._a[h],n._a[c])?e:n._a[l]<0||n._a[l]>23?l:n._a[nt]<0||n._a[nt]>59?nt:n._a[tt]<0||n._a[tt]>59?tt:n._a[it]<0||n._a[it]>999?it:-1,n._pf._overflowDayOfYear&&(t<h||t>e)&&(t=e),n._pf.overflow=t)}function ur(n){return n._isValid==null&&(n._isValid=!isNaN(n._d.getTime())&&n._pf.overflow<0&&!n._pf.empty&&!n._pf.invalidMonth&&!n._pf.nullInput&&!n._pf.invalidFormat&&!n._pf.userInvalidated,n._strict&&(n._isValid=n._isValid&&n._pf.charsLeftOver===0&&n._pf.unusedTokens.length===0)),n._isValid}function fr(n){return n?n.toLowerCase().replace("_","-"):n}function gu(n){for(var r=0,i,t,f,u;r<n.length;){for(u=fr(n[r]).split("-"),i=u.length,t=fr(n[r+1]),t=t?t.split("-"):null;i>0;){if(f=er(u.slice(0,i).join("-")),f)return f;if(t&&t.length>=i&&di(u,t,!0)>=i-1)break;i--}r++}return null}function er(n){var i=null;if(!w[n]&&ti)try{i=t.locale();require("./locale/"+n);t.locale(i)}catch(r){}return w[n]}function st(n,i){return i._isUTC?t(n).zone(i._offset||0):t(n).local()}function nf(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function tf(n){for(var i=n.match(ii),t=0,r=i.length;t<r;t++)i[t]=a[i[t]]?a[i[t]]:nf(i[t]);return function(u){var f="";for(t=0;t<r;t++)f+=i[t]instanceof Function?i[t].call(u,n):i[t];return f}}function wt(n,t){return n.isValid()?(t=or(t,n.localeData()),at[t]||(at[t]=tf(t)),at[t](n)):n.localeData().invalidDate()}function or(n,t){function r(n){return t.longDateFormat(n)||n}var i=5;for(ft.lastIndex=0;i>=0&&ft.test(n);)n=n.replace(ft,r),ft.lastIndex=0,i-=1;return n}function rf(n,t){var i=t._strict;switch(n){case"Q":return ui;case"DDDD":return ei;case"YYYY":case"GGGG":case"gggg":return i?su:tu;case"Y":case"G":case"g":return cu;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return i?hu:iu;case"S":if(i)return ui;case"SS":if(i)return fi;case"SSS":if(i)return ei;case"DDD":return nu;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return uu;case"a":case"A":return t._locale._meridiemParse;case"X":return eu;case"Z":case"ZZ":return ht;case"T":return fu;case"SSSS":return ru;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return i?fi:ri;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return ri;case"Do":return ou;default:return new RegExp(hf(sf(n.replace("\\","")),"i"))}}function sr(n){n=n||"";var r=n.match(ht)||[],f=r[r.length-1]||[],t=(f+"").match(au)||["-",0,0],u=+(t[1]*60)+i(t[2]);return t[0]==="+"?-u:u}function uf(n,r,u){var o,f=u._a;switch(n){case"Q":r!=null&&(f[c]=(i(r)-1)*3);break;case"M":case"MM":r!=null&&(f[c]=i(r)-1);break;case"MMM":case"MMMM":o=u._locale.monthsParse(r);o!=null?f[c]=o:u._pf.invalidMonth=r;break;case"D":case"DD":r!=null&&(f[e]=i(r));break;case"Do":r!=null&&(f[e]=i(parseInt(r,10)));break;case"DDD":case"DDDD":r!=null&&(u._dayOfYear=i(r));break;case"YY":f[h]=t.parseTwoDigitYear(r);break;case"YYYY":case"YYYYY":case"YYYYYY":f[h]=i(r);break;case"a":case"A":u._isPm=u._locale.isPM(r);break;case"H":case"HH":case"h":case"hh":f[l]=i(r);break;case"m":case"mm":f[nt]=i(r);break;case"s":case"ss":f[tt]=i(r);break;case"S":case"SS":case"SSS":case"SSSS":f[it]=i(("0."+r)*1e3);break;case"X":u._d=new Date(parseFloat(r)*1e3);break;case"Z":case"ZZ":u._useUTC=!0;u._tzm=sr(r);break;case"dd":case"ddd":case"dddd":o=u._locale.weekdaysParse(r);o!=null?(u._w=u._w||{},u._w.d=o):u._pf.invalidWeekday=r;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":n=n.substr(0,1);case"gggg":case"GGGG":case"GGGGG":n=n.substr(0,2);r&&(u._w=u._w||{},u._w[n]=i(r));break;case"gg":case"GG":u._w=u._w||{};u._w[n]=t.parseTwoDigitYear(r)}}function ff(n){var i,o,f,u,r,e,s;i=n._w;i.GG!=null||i.W!=null||i.E!=null?(r=1,e=4,o=g(i.GG,n._a[h],d(t(),1,4).year),f=g(i.W,1),u=g(i.E,1)):(r=n._locale._week.dow,e=n._locale._week.doy,o=g(i.gg,n._a[h],d(t(),r,e).year),f=g(i.w,1),i.d!=null?(u=i.d,u<r&&++f):u=i.e!=null?i.e+r:r);s=kf(o,f,u,e,r);n._a[h]=s.year;n._dayOfYear=s.dayOfYear}function bt(n){var t,i,r=[],u,f;if(!n._d){for(u=of(n),n._w&&n._a[e]==null&&n._a[c]==null&&ff(n),n._dayOfYear&&(f=g(n._a[h],u[h]),n._dayOfYear>tr(f)&&(n._pf._overflowDayOfYear=!0),i=dt(f,0,n._dayOfYear),n._a[c]=i.getUTCMonth(),n._a[e]=i.getUTCDate()),t=0;t<3&&n._a[t]==null;++t)n._a[t]=r[t]=u[t];for(;t<7;t++)n._a[t]=r[t]=n._a[t]==null?t===2?1:0:n._a[t];n._d=(n._useUTC?dt:yf).apply(null,r);n._tzm!=null&&n._d.setUTCMinutes(n._d.getUTCMinutes()+n._tzm)}}function ef(n){var t;n._d||(t=gi(n._i),n._a=[t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond],bt(n))}function of(n){var t=new Date;return n._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function kt(n){if(n._f===t.ISO_8601){hr(n);return}n._a=[];n._pf.empty=!0;for(var i=""+n._i,r,u,o,h=i.length,s=0,e=or(n._f,n._locale).match(ii)||[],f=0;f<e.length;f++)u=e[f],r=(i.match(rf(u,n))||[])[0],r&&(o=i.substr(0,i.indexOf(r)),o.length>0&&n._pf.unusedInput.push(o),i=i.slice(i.indexOf(r)+r.length),s+=r.length),a[u]?(r?n._pf.empty=!1:n._pf.unusedTokens.push(u),uf(u,r,n)):n._strict&&!r&&n._pf.unusedTokens.push(u);n._pf.charsLeftOver=h-s;i.length>0&&n._pf.unusedInput.push(i);n._isPm&&n._a[l]<12&&(n._a[l]+=12);n._isPm===!1&&n._a[l]===12&&(n._a[l]=0);bt(n);rr(n)}function sf(n){return n.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(n,t,i,r,u){return t||i||r||u})}function hf(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function cf(n){var t,f,u,r,i;if(n._f.length===0){n._pf.invalidFormat=!0;n._d=new Date(NaN);return}for(r=0;r<n._f.length;r++)(i=0,t=pi({},n),n._useUTC!=null&&(t._useUTC=n._useUTC),t._pf=vt(),t._f=n._f[r],kt(t),ur(t))&&(i+=t._pf.charsLeftOver,i+=t._pf.unusedTokens.length*10,t._pf.score=i,(u==null||i<u)&&(u=i,f=t));k(n,f||t)}function hr(n){var t,i,r=n._i,u=lu.exec(r);if(u){for(n._pf.iso=!0,t=0,i=ct.length;t<i;t++)if(ct[t][1].exec(r)){n._f=ct[t][0]+(u[6]||" ");break}for(t=0,i=lt.length;t<i;t++)if(lt[t][1].exec(r)){n._f+=lt[t][0];break}r.match(ht)&&(n._f+="Z");kt(n)}else n._isValid=!1}function lf(n){hr(n);n._isValid===!1&&(delete n._isValid,t.createFromInputFallback(n))}function af(n,t){for(var r=[],i=0;i<n.length;++i)r.push(t(n[i],i));return r}function vf(i){var r=i._i,u;r===n?i._d=new Date:ku(r)?i._d=new Date(+r):(u=kr.exec(r))!==null?i._d=new Date(+u[1]):typeof r=="string"?lf(i):ot(r)?(i._a=af(r.slice(0),function(n){return parseInt(n,10)}),bt(i)):typeof r=="object"?ef(i):typeof r=="number"?i._d=new Date(r):t.createFromInputFallback(i)}function yf(n,t,i,r,u,f,e){var o=new Date(n,t,i,r,u,f,e);return n<1970&&o.setFullYear(n),o}function dt(n){var t=new Date(Date.UTC.apply(null,arguments));return n<1970&&t.setUTCFullYear(n),t}function pf(n,t){if(typeof n=="string")if(isNaN(n)){if(n=t.weekdaysParse(n),typeof n!="number")return null}else n=parseInt(n,10);return n}function wf(n,t,i,r,u){return u.relativeTime(t||1,!!i,n,r)}function bf(n,i,r){var u=t.duration(n).abs(),c=p(u.as("s")),e=p(u.as("m")),o=p(u.as("h")),s=p(u.as("d")),h=p(u.as("M")),l=p(u.as("y")),f=c<y.s&&["s",c]||e===1&&["m"]||e<y.m&&["mm",e]||o===1&&["h"]||o<y.h&&["hh",o]||s===1&&["d"]||s<y.d&&["dd",s]||h===1&&["M"]||h<y.M&&["MM",h]||l===1&&["y"]||["yy",l];return f[2]=i,f[3]=+n>0,f[4]=r,wf.apply({},f)}function d(n,i,r){var e=r-i,u=r-n.day(),f;return u>e&&(u-=7),u<e-7&&(u+=7),f=t(n).add(u,"d"),{week:Math.ceil(f.dayOfYear()/7),year:f.year()}}function kf(n,t,i,r,u){var f=dt(n,0,1).getUTCDay(),o,e;return f=f===0?7:f,i=i!=null?i:u,o=u-f+(f>r?7:0)-(f<u?7:0),e=7*(t-1)+(i-u)+o+1,{year:e>0?n:n-1,dayOfYear:e>0?e:tr(n-1)+e}}function cr(i){var r=i._i,u=i._f;return(i._locale=i._locale||t.localeData(i._l),r===null||u===n&&r==="")?t.invalid({nullInput:!0}):(typeof r=="string"&&(i._i=r=i._locale.preparse(r)),t.isMoment(r))?new et(r,!0):(u?ot(u)?cf(i):kt(i):vf(i),new et(i))}function lr(n,i){var u,r;if(i.length===1&&ot(i[0])&&(i=i[0]),!i.length)return t();for(u=i[0],r=1;r<i.length;++r)i[r][n](u)&&(u=i[r]);return u}function ar(n,t){var i;return typeof t=="string"&&(t=n.localeData().monthsParse(t),typeof t!="number")?n:(i=Math.min(n.date(),pt(n.year(),t)),n._d["set"+(n._isUTC?"UTC":"")+"Month"](t,i),n)}function gt(n,t){return n._d["get"+(n._isUTC?"UTC":"")+t]()}function vr(n,t,i){return t==="Month"?ar(n,i):n._d["set"+(n._isUTC?"UTC":"")+t](i)}function v(n,i){return function(r){return r!=null?(vr(this,n,r),t.updateOffset(this,i),this):gt(this,n)}}function yr(n){return n*400/146097}function pr(n){return n*146097/400}function df(n){t.duration.fn[n]=function(){return this._data[n]}}function wr(n){typeof ender=="undefined"&&(ni=rt.moment,rt.moment=n?o("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",t):t)}for(var t,rt=typeof global!="undefined"?global:this,ni,p=Math.round,br=Object.prototype.hasOwnProperty,u,h=0,c=1,e=2,l=3,nt=4,tt=5,it=6,w={},ut=[],ti=typeof module!="undefined"&&module.exports,kr=/^\/?Date\((\-?\d+)/i,dr=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,gr=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,ii=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,ft=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,ri=/\d\d?/,nu=/\d{1,3}/,tu=/\d{1,4}/,iu=/[+\-]?\d{1,6}/,ru=/\d+/,uu=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ht=/Z|[\+\-]\d\d:?\d\d/gi,fu=/T/i,eu=/[\+\-]?\d+(\.\d{1,3})?/,ou=/\d{1,2}/,ui=/\d/,fi=/\d\d/,ei=/\d{3}/,su=/\d{4}/,hu=/[+-]?\d{6}/,cu=/[+-]?\d+/,lu=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ct=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],lt=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],au=/([\+\-]|\d\d)/gi,gf="Date|Hours|Minutes|Seconds|Milliseconds".split("|"),oi={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},vu={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},yu={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},at={},y={s:45,m:45,h:22,d:26,M:11},si="DDD w W M D d".split(" "),hi="M D H h m s w W".split(" "),a={M:function(){return this.month()+1},MMM:function(n){return this.localeData().monthsShort(this,n)},MMMM:function(n){return this.localeData().months(this,n)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(n){return this.localeData().weekdaysMin(this,n)},ddd:function(n){return this.localeData().weekdaysShort(this,n)},dddd:function(n){return this.localeData().weekdays(this,n)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return r(this.year()%100,2)},YYYY:function(){return r(this.year(),4)},YYYYY:function(){return r(this.year(),5)},YYYYYY:function(){var n=this.year(),t=n>=0?"+":"-";return t+r(Math.abs(n),6)},gg:function(){return r(this.weekYear()%100,2)},gggg:function(){return r(this.weekYear(),4)},ggggg:function(){return r(this.weekYear(),5)},GG:function(){return r(this.isoWeekYear()%100,2)},GGGG:function(){return r(this.isoWeekYear(),4)},GGGGG:function(){return r(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return i(this.milliseconds()/100)},SS:function(){return r(i(this.milliseconds()/10),2)},SSS:function(){return r(this.milliseconds(),3)},SSSS:function(){return r(this.milliseconds(),3)},Z:function(){var n=-this.zone(),t="+";return n<0&&(n=-n,t="-"),t+r(i(n/60),2)+":"+r(i(n)%60,2)},ZZ:function(){var n=-this.zone(),t="+";return n<0&&(n=-n,t="-"),t+r(i(n/60),2)+r(i(n)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},ci={},li=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];si.length;)u=si.pop(),a[u+"o"]=wu(a[u],u);while(hi.length)u=hi.pop(),a[u+u]=vi(a[u],2);for(a.DDDD=vi(a.DDD,3),k(yi.prototype,{set:function(n){var t;for(var i in n)t=n[i],typeof t=="function"?this[i]=t:this["_"+i]=t},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(n){return this._months[n.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(n){return this._monthsShort[n.month()]},monthsParse:function(n){var i,r,u;for(this._monthsParse||(this._monthsParse=[]),i=0;i<12;i++)if(this._monthsParse[i]||(r=t.utc([2e3,i]),u="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(u.replace(".",""),"i")),this._monthsParse[i].test(n))return i},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(n){return this._weekdays[n.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(n){return this._weekdaysShort[n.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(n){return this._weekdaysMin[n.day()]},weekdaysParse:function(n){var i,r,u;for(this._weekdaysParse||(this._weekdaysParse=[]),i=0;i<7;i++)if(this._weekdaysParse[i]||(r=t([2e3,1]).day(i),u="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(u.replace(".",""),"i")),this._weekdaysParse[i].test(n))return i},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(n){var t=this._longDateFormat[n];return!t&&this._longDateFormat[n.toUpperCase()]&&(t=this._longDateFormat[n.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(n){return n.slice(1)}),this._longDateFormat[n]=t),t},isPM:function(n){return(n+"").toLowerCase().charAt(0)==="p"},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(n,t,i){return n>11?i?"pm":"PM":i?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(n,t){var i=this._calendar[n];return typeof i=="function"?i.apply(t):i},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(n,t,i,r){var u=this._relativeTime[i];return typeof u=="function"?u(n,t,i,r):u.replace(/%d/i,n)},pastFuture:function(n,t){var i=this._relativeTime[n>0?"future":"past"];return typeof i=="function"?i(t):i.replace(/%s/i,t)},ordinal:function(n){return this._ordinal.replace("%d",n)},_ordinal:"%d",preparse:function(n){return n},postformat:function(n){return n},week:function(n){return d(n,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),t=function(t,i,r,u){var f;return typeof r=="boolean"&&(u=r,r=n),f={},f._isAMomentObject=!0,f._i=t,f._f=i,f._l=r,f._strict=u,f._isUTC=!1,f._pf=vt(),cr(f)},t.suppressDeprecationWarnings=!1,t.createFromInputFallback=o("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(n){n._d=new Date(n._i)}),t.min=function(){var n=[].slice.call(arguments,0);return lr("isBefore",n)},t.max=function(){var n=[].slice.call(arguments,0);return lr("isAfter",n)},t.utc=function(t,i,r,u){var f;return typeof r=="boolean"&&(u=r,r=n),f={},f._isAMomentObject=!0,f._useUTC=!0,f._isUTC=!0,f._l=r,f._i=t,f._f=i,f._strict=u,f._pf=vt(),cr(f).utc()},t.unix=function(n){return t(n*1e3)},t.duration=function(n,r){var f=n,u=null,o,h,s,c;return t.isDuration(n)?f={ms:n._milliseconds,d:n._days,M:n._months}:typeof n=="number"?(f={},r?f[r]=n:f.milliseconds=n):(u=dr.exec(n))?(o=u[1]==="-"?-1:1,f={y:0,d:i(u[e])*o,h:i(u[l])*o,m:i(u[nt])*o,s:i(u[tt])*o,ms:i(u[it])*o}):(u=gr.exec(n))?(o=u[1]==="-"?-1:1,s=function(n){var t=n&&parseFloat(n.replace(",","."));return(isNaN(t)?0:t)*o},f={y:s(u[2]),M:s(u[3]),d:s(u[4]),h:s(u[5]),m:s(u[6]),s:s(u[7]),w:s(u[8])}):typeof f=="object"&&("from"in f||"to"in f)&&(c=bu(t(f.from),t(f.to)),f={},f.ms=c.milliseconds,f.M=c.months),h=new yt(f),t.isDuration(n)&&b(n,"_locale")&&(h._locale=n._locale),h},t.version="2.8.3",t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.ISO_8601=function(){},t.momentProperties=ut,t.updateOffset=function(){},t.relativeTimeThreshold=function(t,i){return y[t]===n?!1:i===n?y[t]:(y[t]=i,!0)},t.lang=o("moment.lang is deprecated. Use moment.locale instead.",function(n,i){return t.locale(n,i)}),t.locale=function(n,i){var r;return n&&(r=typeof i!="undefined"?t.defineLocale(n,i):t.localeData(n),r&&(t.duration._locale=t._locale=r)),t._locale._abbr},t.defineLocale=function(n,i){return i!==null?(i.abbr=n,w[n]||(w[n]=new yi),w[n].set(i),t.locale(n),w[n]):(delete w[n],null)},t.langData=o("moment.langData is deprecated. Use moment.localeData instead.",function(n){return t.localeData(n)}),t.localeData=function(n){var i;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return t._locale;if(!ot(n)){if(i=er(n),i)return i;n=[n]}return gu(n)},t.isMoment=function(n){return n instanceof et||n!=null&&b(n,"_isAMomentObject")},t.isDuration=function(n){return n instanceof yt},u=li.length-1;u>=0;--u)du(li[u]);t.normalizeUnits=function(n){return f(n)};t.invalid=function(n){var i=t.utc(NaN);return n!=null?k(i._pf,n):i._pf.userInvalidated=!0,i};t.parseZone=function(){return t.apply(null,arguments).parseZone()};t.parseTwoDigitYear=function(n){return i(n)+(i(n)>68?1900:2e3)};k(t.fn=et.prototype,{clone:function(){return t(this)},valueOf:function(){return+this._d+(this._offset||0)*6e4},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var n=t(this).utc();return 0<n.year()&&n.year()<=9999?wt(n,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):wt(n,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var n=this;return[n.year(),n.month(),n.date(),n.hours(),n.minutes(),n.seconds(),n.milliseconds()]},isValid:function(){return ur(this)},isDSTShifted:function(){return this._a?this.isValid()&&di(this._a,(this._isUTC?t.utc(this._a):t(this._a)).toArray())>0:!1},parsingFlags:function(){return k({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(n){return this.zone(0,n)},local:function(n){return this._isUTC&&(this.zone(0,n),this._isUTC=!1,n&&this.add(this._dateTzOffset(),"m")),this},format:function(n){var i=wt(this,n||t.defaultFormat);return this.localeData().postformat(i)},add:bi(1,"add"),subtract:bi(-1,"subtract"),diff:function(n,i,r){var u=st(n,this),c=(this.zone()-u.zone())*6e4,e,o,h;return i=f(i),i==="year"||i==="month"?(e=(this.daysInMonth()+u.daysInMonth())*432e5,o=(this.year()-u.year())*12+(this.month()-u.month()),h=this-t(this).startOf("month")-(u-t(u).startOf("month")),h-=(this.zone()-t(this).startOf("month").zone()-(u.zone()-t(u).startOf("month").zone()))*6e4,o+=h/e,i==="year"&&(o=o/12)):(e=this-u,o=i==="second"?e/1e3:i==="minute"?e/6e4:i==="hour"?e/36e5:i==="day"?(e-c)/864e5:i==="week"?(e-c)/6048e5:e),r?o:s(o)},from:function(n,i){return t.duration({to:this,from:n}).locale(this.locale()).humanize(!i)},fromNow:function(n){return this.from(t(),n)},calendar:function(n){var r=n||t(),u=st(r,this).startOf("day"),i=this.diff(u,"days",!0),f=i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse";return this.format(this.localeData().calendar(f,this))},isLeapYear:function(){return ir(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(n){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return n!=null?(n=pf(n,this.localeData()),this.add(n-t,"d")):t},month:v("Month",!0),startOf:function(n){n=f(n);switch(n){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return n==="week"?this.weekday(0):n==="isoWeek"&&this.isoWeekday(1),n==="quarter"&&this.month(Math.floor(this.month()/3)*3),this},endOf:function(n){return n=f(n),this.startOf(n).add(1,n==="isoWeek"?"week":n).subtract(1,"ms")},isAfter:function(n,i){return i=f(typeof i!="undefined"?i:"millisecond"),i==="millisecond"?(n=t.isMoment(n)?n:t(n),+this>+n):+this.clone().startOf(i)>+t(n).startOf(i)},isBefore:function(n,i){return i=f(typeof i!="undefined"?i:"millisecond"),i==="millisecond"?(n=t.isMoment(n)?n:t(n),+this<+n):+this.clone().startOf(i)<+t(n).startOf(i)},isSame:function(n,i){return i=f(i||"millisecond"),i==="millisecond"?(n=t.isMoment(n)?n:t(n),+this==+n):+this.clone().startOf(i)==+st(n,this).startOf(i)},min:o("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(n){return n=t.apply(null,arguments),n<this?this:n}),max:o("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(n){return n=t.apply(null,arguments),n>this?this:n}),zone:function(n,i){var r=this._offset||0,u;if(n!=null)typeof n=="string"&&(n=sr(n)),Math.abs(n)<16&&(n=n*60),!this._isUTC&&i&&(u=this._dateTzOffset()),this._offset=n,this._isUTC=!0,u!=null&&this.subtract(u,"m"),r!==n&&(!i||this._changeInProgress?ki(this,t.duration(r-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null));else return this._isUTC?r:this._dateTzOffset();return this},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):typeof this._i=="string"&&this.zone(this._i),this},hasAlignedHourOffset:function(n){return n=n?t(n).zone():0,(this.zone()-n)%60==0},daysInMonth:function(){return pt(this.year(),this.month())},dayOfYear:function(n){var i=p((t(this).startOf("day")-t(this).startOf("year"))/864e5)+1;return n==null?i:this.add(n-i,"d")},quarter:function(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)},weekYear:function(n){var t=d(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return n==null?t:this.add(n-t,"y")},isoWeekYear:function(n){var t=d(this,1,4).year;return n==null?t:this.add(n-t,"y")},week:function(n){var t=this.localeData().week(this);return n==null?t:this.add((n-t)*7,"d")},isoWeek:function(n){var t=d(this,1,4).week;return n==null?t:this.add((n-t)*7,"d")},weekday:function(n){var t=(this.day()+7-this.localeData()._week.dow)%7;return n==null?t:this.add(n-t,"d")},isoWeekday:function(n){return n==null?this.day()||7:this.day(this.day()%7?n:n-7)},isoWeeksInYear:function(){return nr(this.year(),1,4)},weeksInYear:function(){var n=this.localeData()._week;return nr(this.year(),n.dow,n.doy)},get:function(n){return n=f(n),this[n]()},set:function(n,t){return n=f(n),typeof this[n]=="function"&&this[n](t),this},locale:function(i){var r;return i===n?this._locale._abbr:(r=t.localeData(i),r!=null&&(this._locale=r),this)},lang:o("moment().lang() is deprecated. Use moment().localeData() instead.",function(t){return t===n?this.localeData():this.locale(t)}),localeData:function(){return this._locale},_dateTzOffset:function(){return Math.round(this._d.getTimezoneOffset()/15)*15}});t.fn.millisecond=t.fn.milliseconds=v("Milliseconds",!1);t.fn.second=t.fn.seconds=v("Seconds",!1);t.fn.minute=t.fn.minutes=v("Minutes",!1);t.fn.hour=t.fn.hours=v("Hours",!0);t.fn.date=v("Date",!0);t.fn.dates=o("dates accessor is deprecated. Use date instead.",v("Date",!0));t.fn.year=v("FullYear",!0);t.fn.years=o("years accessor is deprecated. Use year instead.",v("FullYear",!0));t.fn.days=t.fn.day;t.fn.months=t.fn.month;t.fn.weeks=t.fn.week;t.fn.isoWeeks=t.fn.isoWeek;t.fn.quarters=t.fn.quarter;t.fn.toJSON=t.fn.toISOString;k(t.duration.fn=yt.prototype,{_bubble:function(){var o=this._milliseconds,t=this._days,i=this._months,n=this._data,u,f,e,r=0;n.milliseconds=o%1e3;u=s(o/1e3);n.seconds=u%60;f=s(u/60);n.minutes=f%60;e=s(f/60);n.hours=e%24;t+=s(e/24);r=s(yr(t));t-=s(pr(r));i+=s(t/30);t%=30;r+=s(i/12);i%=12;n.days=t;n.months=i;n.years=r},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return s(this.days()/7)},valueOf:function(){return this._milliseconds+this._days*864e5+this._months%12*2592e6+i(this._months/12)*31536e6},humanize:function(n){var t=bf(this,!n,this.localeData());return n&&(t=this.localeData().pastFuture(+this,t)),this.localeData().postformat(t)},add:function(n,i){var r=t.duration(n,i);return this._milliseconds+=r._milliseconds,this._days+=r._days,this._months+=r._months,this._bubble(),this},subtract:function(n,i){var r=t.duration(n,i);return this._milliseconds-=r._milliseconds,this._days-=r._days,this._months-=r._months,this._bubble(),this},get:function(n){return n=f(n),this[n.toLowerCase()+"s"]()},as:function(n){var t,i;if(n=f(n),n==="month"||n==="year")return t=this._days+this._milliseconds/864e5,i=this._months+yr(t)*12,n==="month"?i:i/12;t=this._days+pr(this._months/12);switch(n){case"week":return t/7+this._milliseconds/6048e5;case"day":return t+this._milliseconds/864e5;case"hour":return t*24+this._milliseconds/36e5;case"minute":return t*1440+this._milliseconds/6e4;case"second":return t*86400+this._milliseconds/1e3;case"millisecond":return Math.floor(t*864e5)+this._milliseconds;default:throw new Error("Unknown unit "+n);}},lang:t.fn.lang,locale:t.fn.locale,toIsoString:o("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var r=Math.abs(this.years()),u=Math.abs(this.months()),f=Math.abs(this.days()),n=Math.abs(this.hours()),t=Math.abs(this.minutes()),i=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(r?r+"Y":"")+(u?u+"M":"")+(f?f+"D":"")+(n||t||i?"T":"")+(n?n+"H":"")+(t?t+"M":"")+(i?i+"S":""):"P0D"},localeData:function(){return this._locale}});t.duration.fn.toString=t.duration.fn.toISOString;for(u in oi)b(oi,u)&&df(u.toLowerCase());t.duration.fn.asMilliseconds=function(){return this.as("ms")};t.duration.fn.asSeconds=function(){return this.as("s")};t.duration.fn.asMinutes=function(){return this.as("m")};t.duration.fn.asHours=function(){return this.as("h")};t.duration.fn.asDays=function(){return this.as("d")};t.duration.fn.asWeeks=function(){return this.as("weeks")};t.duration.fn.asMonths=function(){return this.as("M")};t.duration.fn.asYears=function(){return this.as("y")};t.locale("en",{ordinal:function(n){var t=n%10,r=i(n%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return n+r}});ti?module.exports=t:typeof define=="function"&&define.amd?(define("moment",function(n,i,r){return r.config&&r.config()&&r.config().noGlobal===!0&&(rt.moment=ni),t}),wr(!0)):wr()}).call(this);