!function(e,t,a,n){"use strict";t=void0!==t&&t.Math==Math?t:"undefined"!=typeofself&&self.Math==Math?self:Function("return this")(),e.fn.tab=function(i){varo,r=e.isFunction(this)?e(t):e(this),s=r.selector||"",c=(newDate).getTime(),l=[],d=arguments[0],u="string"==typeofd,b=[].slice.call(arguments,1),g=!1;returnr.each(function(){varf,h,p,m,v,y,T=e.isPlainObject(i)?e.extend(!0,{},e.fn.tab.settings,i):e.extend({},e.fn.tab.settings),L=T.className,x=T.metadata,A=T.selector,P=T.error,C="."+T.namespace,F="module-"+T.namespace,S=e(this),j={},E=!0,O=0,w=this,k=S.data(F);v={initialize:function(){v.debug("Initializing tab menu item",S),v.fix.callbacks(),v.determineTabs(),v.debug("Determining tabs",T.context,h),T.auto&&v.set.auto(),v.bind.events(),T.history&&!g&&(v.initializeHistory(),g=!0),v.instantiate()},instantiate:function(){v.verbose("Storing instance of module",v),k=v,S.data(F,v)},destroy:function(){v.debug("Destroying tabs",S),S.removeData(F).off(C)},bind:{events:function(){e.isWindow(w)||(v.debug("Attaching tab activation events to element",S),S.on("click"+C,v.event.click))}},determineTabs:function(){vart;"parent"===T.context?(S.closest(A.ui).length>0?(t=S.closest(A.ui),v.verbose("Using closest UI element as parent",t)):t=S,f=t.parent(),v.verbose("Determined parent element for creating context",f)):T.context?(f=e(T.context),v.verbose("Using selector for tab context",T.context,f)):f=e("body"),T.childrenOnly?(h=f.children(A.tabs),v.debug("Searching tab context children for tabs",f,h)):(h=f.find(A.tabs),v.debug("Searching tab context for tabs",f,h))},fix:{callbacks:function(){e.isPlainObject(i)&&(i.onTabLoad||i.onTabInit)&&(i.onTabLoad&&(i.onLoad=i.onTabLoad,deletei.onTabLoad,v.error(P.legacyLoad,i.onLoad)),i.onTabInit&&(i.onFirstLoad=i.onTabInit,deletei.onTabInit,v.error(P.legacyInit,i.onFirstLoad)),T=e.extend(!0,{},e.fn.tab.settings,i))}},initializeHistory:function(){if(v.debug("Initializing page state"),e.address===n)returnv.error(P.state),!1;if("state"==T.historyType){if(v.debug("Using HTML5 to manage state"),!1===T.path)returnv.error(P.path),!1;e.address.history(!0).state(T.path)}e.address.bind("change",v.event.history.change)},event:{click:function(t){vara=e(this).data(x.tab);a!==n?(T.history?(v.verbose("Updating page state",t),e.address.value(a)):(v.verbose("Changing tab",t),v.changeTab(a)),t.preventDefault()):v.debug("No tab specified")},history:{change:function(t){vara=t.pathNames.join("/")||v.get.initialPath(),i=T.templates.determineTitle(a)||!1;v.performance.display(),v.debug("History change event",a,t),y=t,a!==n&&v.changeTab(a),i&&e.address.title(i)}}},refresh:function(){p&&(v.debug("Refreshing tab",p),v.changeTab(p))},cache:{read:function(e){returne!==n&&j[e]},add:function(e,t){e=e||p,v.debug("Adding cached content for",e),j[e]=t},remove:function(e){e=e||p,v.debug("Removing cached content for",e),deletej[e]}},set:{auto:function(){vart="string"==typeofT.path?T.path.replace(/\/$/,"")+"/{$tab}":"/{$tab}";v.verbose("Setting up automatic tab retrieval from server",t),e.isPlainObject(T.apiSettings)?T.apiSettings.url=t:T.apiSettings={url:t}},loading:function(e){vart=v.get.tabElement(e);t.hasClass(L.loading)||(v.verbose("Setting loading state for",t),t.addClass(L.loading).siblings(h).removeClass(L.active+" "+L.loading),t.length>0&&T.onRequest.call(t[0],e))},state:function(t){e.address.value(t)}},changeTab:function(a){varn=t.history&&t.history.pushState&&T.ignoreFirstLoad&&E,i=T.auto||e.isPlainObject(T.apiSettings),o=i&&!n?v.utilities.pathToArray(a):v.get.defaultPathArray(a);a=v.utilities.arrayToPath(o),e.each(o,function(t,r){vars,c,l,d,u=o.slice(0,t+1),b=v.utilities.arrayToPath(u),g=v.is.tab(b),h=t+1==o.length,A=v.get.tabElement(b);if(v.verbose("Looking for tab",r),g){if(v.verbose("Tab was found",r),p=b,m=v.utilities.filterArray(o,u),h?d=!0:(c=o.slice(0,t+2),l=v.utilities.arrayToPath(c),(d=!v.is.tab(l))&&v.verbose("Tab parameters found",c)),d&&i)returnn?(v.debug("Ignoring remote content on first tab load",b),E=!1,v.cache.add(a,A.html()),v.activate.all(b),T.onFirstLoad.call(A[0],b,m,y),T.onLoad.call(A