!function(){var moduleFactory=function($){var module=this,jQuery=$;$.require().script("ui/core","ui/widget").stylesheet("ui/tabs").done(function(){var exports=function(){!function($,undefined){function getNextTabId(){return++tabId}function isLocal(anchor){return anchor=anchor.cloneNode(!1),anchor.hash.length>1&&anchor.href.replace(rhash,"")===location.href.replace(rhash,"")}var tabId=0,rhash=/#.*$/;$.widget("ui.tabs",{version:"1.9.0pre",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var that=this,options=this.options,active=options.active;
this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",options.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(event){$(this).is(".ui-state-disabled")&&event.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){$(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),null===active&&(location.hash&&this.anchors.each(function(i,anchor){return anchor.hash===location.hash?(active=i,!1):void 0
}),null===active&&(active=this.tabs.filter(".ui-tabs-active").index()),(null===active||-1===active)&&(active=this.tabs.length?0:!1)),active!==!1&&(active=this.tabs.index(this.tabs.eq(active)),-1===active&&(active=options.collapsible?!1:0)),options.active=active,!options.collapsible&&options.active===!1&&this.anchors.length&&(options.active=0),$.isArray(options.disabled)&&(options.disabled=$.unique(options.disabled.concat($.map(this.tabs.filter(".ui-state-disabled"),function(li){return that.tabs.index(li)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(this.options.active):$(),this._refresh(),this.active.length&&this.load(options.active)
},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):$()}},_tabKeydown:function(event){var focusedTab=$(this.document[0].activeElement).closest("li"),selectedIndex=this.tabs.index(focusedTab),goingForward=!0;if(!this._handlePageNav(event)){switch(event.keyCode){case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:selectedIndex++;break;case $.ui.keyCode.UP:case $.ui.keyCode.LEFT:goingForward=!1,selectedIndex--;break;case $.ui.keyCode.END:selectedIndex=this.anchors.length-1;
break;case $.ui.keyCode.HOME:selectedIndex=0;break;case $.ui.keyCode.SPACE:return event.preventDefault(),clearTimeout(this.activating),this._activate(selectedIndex),void 0;case $.ui.keyCode.ENTER:return event.preventDefault(),clearTimeout(this.activating),this._activate(selectedIndex===this.options.active?!1:selectedIndex),void 0;default:return}event.preventDefault(),clearTimeout(this.activating),selectedIndex=this._focusNextTab(selectedIndex,goingForward),event.ctrlKey||(focusedTab.attr("aria-selected","false"),this.tabs.eq(selectedIndex).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",selectedIndex)
},this.delay))}},_panelKeydown:function(event){this._handlePageNav(event)||event.ctrlKey&&event.keyCode===$.ui.keyCode.UP&&(event.preventDefault(),this.active.focus())},_handlePageNav:function(event){return event.altKey&&event.keyCode===$.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):event.altKey&&event.keyCode===$.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(index,goingForward){function constrain(){return index>lastTabIndex&&(index=0),0>index&&(index=lastTabIndex),index
}for(var lastTabIndex=this.tabs.length-1;-1!==$.inArray(constrain(),this.options.disabled);)index=goingForward?index+1:index-1;return index},_focusNextTab:function(index,goingForward){return index=this._findNextTab(index,goingForward),this.tabs.eq(index).focus(),index},_setOption:function(key,value){return"active"===key?(this._activate(value),void 0):"disabled"===key?(this._setupDisabled(value),void 0):(this._super(key,value),"collapsible"===key&&(this.element.toggleClass("ui-tabs-collapsible",value),value||this.options.active!==!1||this._activate(0)),"event"===key&&this._setupEvents(value),"heightStyle"===key&&this._setupHeightStyle(value),void 0)
},_tabId:function(tab){return tab.attr("aria-controls")||"ui-tabs-"+getNextTabId()},_sanitizeSelector:function(hash){return hash?hash.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var options=this.options,lis=this.tablist.children(":has(a[href])");options.disabled=$.map(lis.filter(".ui-state-disabled"),function(tab){return lis.index(tab)}),this._processTabs(),options.active!==!1&&this.anchors.length?this.active.length&&!$.contains(this.tablist[0],this.active[0])?this.tabs.length===options.disabled.length?(options.active=!1,this.active=$()):this._activate(this._findNextTab(Math.max(0,options.active-1),!1)):options.active=this.tabs.index(this.active):(options.active=!1,this.active=$()),this._refresh()
},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)
},_processTabs:function(){var that=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return $("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=$(),this.anchors.each(function(i,anchor){var selector,panel,panelId,anchorId=$(anchor).uniqueId().attr("id"),tab=$(anchor).closest("li"),originalAriaControls=tab.attr("aria-controls");
isLocal(anchor)?(selector=anchor.hash,panel=that.element.find(that._sanitizeSelector(selector))):(panelId=that._tabId(tab),selector="#"+panelId,panel=that.element.find(selector),panel.length||(panel=that._createPanel(panelId),panel.insertAfter(that.panels[i-1]||that.tablist)),panel.attr("aria-live","polite")),panel.length&&(that.panels=that.panels.add(panel)),originalAriaControls&&tab.data("ui-tabs-aria-controls",originalAriaControls),tab.attr({"aria-controls":selector.substring(1),"aria-labelledby":anchorId}),panel.attr("aria-labelledby",anchorId)
}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(id){return $("<div>").attr("id",id).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(disabled){$.isArray(disabled)&&(disabled.length?disabled.length===this.anchors.length&&(disabled=!0):disabled=!1);for(var li,i=0;li=this.tabs[i];i++)disabled===!0||-1!==$.inArray(i,disabled)?$(li).addClass("ui-state-disabled").attr("aria-disabled","true"):$(li).removeClass("ui-state-disabled").removeAttr("aria-disabled");
this.options.disabled=disabled},_setupEvents:function(event){var events={click:function(event){event.preventDefault()}};event&&$.each(event.split(" "),function(index,eventName){events[eventName]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,events),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(heightStyle){var maxHeight,overflow,parent=this.element.parent();
"fill"===heightStyle?($.support.minHeight||(overflow=parent.css("overflow"),parent.css("overflow","hidden")),maxHeight=parent.height(),this.element.siblings(":visible").each(function(){var elem=$(this),position=elem.css("position");"absolute"!==position&&"fixed"!==position&&(maxHeight-=elem.outerHeight(!0))}),overflow&&parent.css("overflow",overflow),this.element.children().not(this.panels).each(function(){maxHeight-=$(this).outerHeight(!0)}),this.panels.each(function(){$(this).height(Math.max(0,maxHeight-$(this).innerHeight()+$(this).height()))
}).css("overflow","auto")):"auto"===heightStyle&&(maxHeight=0,this.panels.each(function(){maxHeight=Math.max(maxHeight,$(this).height("").height())}).height(maxHeight))},_eventHandler:function(event){var options=this.options,active=this.active,anchor=$(event.currentTarget),tab=anchor.closest("li"),clickedIsActive=tab[0]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():this._getPanelForTab(tab),toHide=active.length?this._getPanelForTab(active):$(),eventData={oldTab:active,oldPanel:toHide,newTab:collapsing?$():tab,newPanel:toShow};
event.preventDefault(),tab.hasClass("ui-state-disabled")||tab.hasClass("ui-tabs-loading")||this.running||clickedIsActive&&!options.collapsible||this._trigger("beforeActivate",event,eventData)===!1||(options.active=collapsing?!1:this.tabs.index(tab),this.active=clickedIsActive?$():tab,this.xhr&&this.xhr.abort(),toHide.length||toShow.length||$.error("jQuery UI Tabs: Mismatching fragment identifier."),toShow.length&&this.load(this.tabs.index(tab),event),this._toggle(event,eventData))},_toggle:function(event,eventData){function complete(){that.running=!1,that._trigger("activate",event,eventData)
}function show(){eventData.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),toShow.length&&that.options.show?that._show(toShow,that.options.show,complete):(toShow.show(),complete())}var that=this,toShow=eventData.newPanel,toHide=eventData.oldPanel;this.running=!0,toHide.length&&this.options.hide?this._hide(toHide,this.options.hide,function(){eventData.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),show()}):(eventData.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),toHide.hide(),show()),toHide.attr({"aria-expanded":"false","aria-hidden":"true"}),eventData.oldTab.attr("aria-selected","false"),toShow.length&&toHide.length?eventData.oldTab.attr("tabIndex",-1):toShow.length&&this.tabs.filter(function(){return 0===$(this).attr("tabIndex")
}).attr("tabIndex",-1),toShow.attr({"aria-expanded":"true","aria-hidden":"false"}),eventData.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(index){var anchor,active=this._findActive(index);active[0]!==this.active[0]&&(active.length||(active=this.active),anchor=active.find(".ui-tabs-anchor")[0],this._eventHandler({target:anchor,currentTarget:anchor,preventDefault:$.noop}))},_findActive:function(index){return index===!1?$():this.tabs.eq(index)},_getIndex:function(index){return"string"==typeof index&&(index=this.anchors.index(this.anchors.filter("[href$='"+index+"']"))),index
},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){$.data(this,"ui-tabs-destroy")?$(this).remove():$(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")
}),this.tabs.each(function(){var li=$(this),prev=li.data("ui-tabs-aria-controls");prev?li.attr("aria-controls",prev):li.removeAttr("aria-controls")}),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(index){var disabled=this.options.disabled;disabled!==!1&&(index===undefined?disabled=!1:(index=this._getIndex(index),disabled=$.isArray(disabled)?$.map(disabled,function(num){return num!==index?num:null}):$.map(this.tabs,function(li,num){return num!==index?num:null})),this._setupDisabled(disabled))
},disable:function(index){var disabled=this.options.disabled;if(disabled!==!0){if(index===undefined)disabled=!0;else{if(index=this._getIndex(index),-1!==$.inArray(index,disabled))return;disabled=$.isArray(disabled)?$.merge([index],disabled).sort():[index]}this._setupDisabled(disabled)}},load:function(index,event){index=this._getIndex(index);var that=this,tab=this.tabs.eq(index),anchor=tab.find(".ui-tabs-anchor"),panel=this._getPanelForTab(tab),eventData={tab:tab,panel:panel};isLocal(anchor[0])||(this.xhr=$.ajax(this._ajaxSettings(anchor,event,eventData)),this.xhr&&"canceled"!==this.xhr.statusText&&(tab.addClass("ui-tabs-loading"),panel.attr("aria-busy","true"),this.xhr.success(function(response){setTimeout(function(){panel.html(response),that._trigger("load",event,eventData)
},1)}).complete(function(jqXHR,status){setTimeout(function(){"abort"===status&&that.panels.stop(!1,!0),tab.removeClass("ui-tabs-loading"),panel.removeAttr("aria-busy"),jqXHR===that.xhr&&delete that.xhr},1)})))},_ajaxSettings:function(anchor,event,eventData){var that=this;return{url:anchor.attr("href"),beforeSend:function(jqXHR,settings){return that._trigger("beforeLoad",event,$.extend({jqXHR:jqXHR,ajaxSettings:settings},eventData))}}},_getPanelForTab:function(tab){var id=$(tab).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+id))
}}),$.uiBackCompat!==!1&&($.ui.tabs.prototype._ui=function(tab,panel){return{tab:tab,panel:panel,index:this.anchors.index(tab)}},$.widget("ui.tabs",$.ui.tabs,{url:function(index,url){this.anchors.eq(index).attr("href",url)}}),$.widget("ui.tabs",$.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var that=this;this._on({tabsbeforeload:function(event,ui){return $.data(ui.tab[0],"cache.tabs")?(event.preventDefault(),void 0):(ui.jqXHR.success(function(){that.options.cache&&$.data(ui.tab[0],"cache.tabs",!0)
}),void 0)}})},_ajaxSettings:function(anchor,event,ui){var ajaxOptions=this.options.ajaxOptions;return $.extend({},ajaxOptions,{error:function(xhr,s){try{ajaxOptions.error(xhr,s,ui.tab.closest("li").index(),ui.tab[0])}catch(e){}}},this._superApply(arguments))},_setOption:function(key,value){"cache"===key&&value===!1&&this.anchors.removeData("cache.tabs"),this._super(key,value)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(index){this.anchors.eq(index).removeData("cache.tabs"),this._superApply(arguments)
}}),$.widget("ui.tabs",$.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),$.widget("ui.tabs",$.ui.tabs,{options:{spinner:"<em>Loading&#8230;</em>"},_create:function(){this._super(),this._on({tabsbeforeload:function(event,ui){if(event.target===this.element[0]&&this.options.spinner){var span=ui.tab.find("span"),html=span.html();span.html(this.options.spinner),ui.jqXHR.complete(function(){span.html(html)})}}})}}),$.widget("ui.tabs",$.ui.tabs,{options:{enable:null,disable:null},enable:function(index){var trigger,options=this.options;
(index&&options.disabled===!0||$.isArray(options.disabled)&&-1!==$.inArray(index,options.disabled))&&(trigger=!0),this._superApply(arguments),trigger&&this._trigger("enable",null,this._ui(this.anchors[index],this.panels[index]))},disable:function(index){var trigger,options=this.options;(index&&options.disabled===!1||$.isArray(options.disabled)&&-1===$.inArray(index,options.disabled))&&(trigger=!0),this._superApply(arguments),trigger&&this._trigger("disable",null,this._ui(this.anchors[index],this.panels[index]))
}}),$.widget("ui.tabs",$.ui.tabs,{options:{add:null,remove:null,tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},add:function(url,label,index){index===undefined&&(index=this.anchors.length);var doInsertAfter,panel,options=this.options,li=$(options.tabTemplate.replace(/#\{href\}/g,url).replace(/#\{label\}/g,label)),id=url.indexOf("#")?this._tabId(li):url.replace("#","");return li.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),li.attr("aria-controls",id),doInsertAfter=index>=this.tabs.length,panel=this.element.find("#"+id),panel.length||(panel=this._createPanel(id),doInsertAfter?index>0?panel.insertAfter(this.panels.eq(-1)):panel.appendTo(this.element):panel.insertBefore(this.panels[index])),panel.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),doInsertAfter?li.appendTo(this.tablist):li.insertBefore(this.tabs[index]),options.disabled=$.map(options.disabled,function(n){return n>=index?++n:n
}),this.refresh(),1===this.tabs.length&&options.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[index],this.panels[index])),this},remove:function(index){index=this._getIndex(index);var options=this.options,tab=this.tabs.eq(index).remove(),panel=this._getPanelForTab(tab).remove();return tab.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(index+(index+1<this.anchors.length?1:-1)),options.disabled=$.map($.grep(options.disabled,function(n){return n!==index}),function(n){return n>=index?--n:n
}),this.refresh(),this._trigger("remove",null,this._ui(tab.find("a")[0],panel[0])),this}}),$.widget("ui.tabs",$.ui.tabs,{length:function(){return this.anchors.length}}),$.widget("ui.tabs",$.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(tab){var a=tab.is("li")?tab.find("a[href]"):tab;return a=a[0],$(a).closest("li").attr("aria-controls")||a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+getNextTabId()}}),$.widget("ui.tabs",$.ui.tabs,{options:{panelTemplate:"<div></div>"},_createPanel:function(id){return $(this.options.panelTemplate).attr("id",id).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)
}}),$.widget("ui.tabs",$.ui.tabs,{_create:function(){var options=this.options;null===options.active&&options.selected!==undefined&&(options.active=-1===options.selected?!1:options.selected),this._super(),options.selected=options.active,options.selected===!1&&(options.selected=-1)},_setOption:function(key,value){if("selected"!==key)return this._super(key,value);var options=this.options;this._super("active",-1===value?!1:value),options.selected=options.active,options.selected===!1&&(options.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,this.options.selected===!1&&(this.options.selected=-1)
}}),$.widget("ui.tabs",$.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(type,event,data){var ret=this._superApply(arguments);return ret?("beforeActivate"===type&&data.newTab.length?ret=this._super("select",event,{tab:data.newTab.find(".ui-tabs-anchor")[0],panel:data.newPanel[0],index:data.newTab.closest("li").index()}):"activate"===type&&data.newTab.length&&(ret=this._super("show",event,{tab:data.newTab.find(".ui-tabs-anchor")[0],panel:data.newPanel[0],index:data.newTab.closest("li").index()})),ret):!1
}}),$.widget("ui.tabs",$.ui.tabs,{select:function(index){if(index=this._getIndex(index),-1===index){if(!this.options.collapsible||-1===this.options.selected)return;index=this.options.selected}this.anchors.eq(index).trigger(this.options.event+this.eventNamespace)}}),function(){var listId=0;$.widget("ui.tabs",$.ui.tabs,{options:{cookie:null},_create:function(){var active,options=this.options;null==options.active&&options.cookie&&(active=parseInt(this._cookie(),10),-1===active&&(active=!1),options.active=active),this._super()
},_cookie:function(active){var cookie=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++listId)];return arguments.length&&(cookie.push(active===!1?-1:active),cookie.push(this.options.cookie)),$.cookie.apply(null,cookie)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)
}})}(),$.widget("ui.tabs",$.ui.tabs,{_trigger:function(type,event,data){var _data=$.extend({},data);return"load"===type&&(_data.panel=_data.panel[0],_data.tab=_data.tab.find(".ui-tabs-anchor")[0]),this._super(type,event,_data)}}),$.widget("ui.tabs",$.ui.tabs,{options:{fx:null},_getFx:function(){var hide,show,fx=this.options.fx;return fx&&($.isArray(fx)?(hide=fx[0],show=fx[1]):hide=show=fx),fx?{show:show,hide:hide}:null},_toggle:function(event,eventData){function complete(){that.running=!1,that._trigger("activate",event,eventData)
}function show(){eventData.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),toShow.length&&fx.show?toShow.animate(fx.show,fx.show.duration,function(){complete()}):(toShow.show(),complete())}var that=this,toShow=eventData.newPanel,toHide=eventData.oldPanel,fx=this._getFx();return fx?(that.running=!0,toHide.length&&fx.hide?toHide.animate(fx.hide,fx.hide.duration,function(){eventData.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),show()}):(eventData.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),toHide.hide(),show()),void 0):this._super(event,eventData)
}}))}(jQuery)};exports(),module.resolveWith(exports)})};dispatch("ui/tabs").containing(moduleFactory).to("Foundry/2.1 Modules")}();