(function(c){"function"===typeof define&&define.amd?define(["jquery","./core","./widget"],c):c(jQuery)})(function(c){return c.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},
showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var a=this.options;this.prevShow=this.prevHide=c();this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist");a.collapsible||!1!==a.active&&null!=a.active||(a.active=0);this._processPanels();0>a.active&&(a.active+=this.headers.length);this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():
c()}},_createIcons:function(){var a=this.options.icons;a&&(c("<span>").addClass("ui-accordion-header-icon ui-icon "+a.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(a.header).addClass(a.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var a;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");
this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId();this._destroyIcons();a=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId();
"content"!==this.options.heightStyle&&a.css("height","")},_setOption:function(a,b){"active"===a?this._activate(b):("event"===a&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(b)),this._super(a,b),"collapsible"!==a||b||!1!==this.options.active||this._activate(0),"icons"===a&&(this._destroyIcons(),b&&this._createIcons()),"disabled"===a&&(this.element.toggleClass("ui-state-disabled",!!b).attr("aria-disabled",b),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",
!!b)))},_keydown:function(a){if(!a.altKey&&!a.ctrlKey){var b=c.ui.keyCode,d=this.headers.length,f=this.headers.index(a.target),e=!1;switch(a.keyCode){case b.RIGHT:case b.DOWN:e=this.headers[(f+1)%d];break;case b.LEFT:case b.UP:e=this.headers[(f-1+d)%d];break;case b.SPACE:case b.ENTER:this._eventHandler(a);break;case b.HOME:e=this.headers[0];break;case b.END:e=this.headers[d-1]}e&&(c(a.target).attr("tabIndex",-1),c(e).attr("tabIndex",0),e.focus(),a.preventDefault())}},_panelKeyDown:function(a){a.keyCode===
c.ui.keyCode.UP&&a.ctrlKey&&c(a.currentTarget).prev().focus()},refresh:function(){var a=this.options;this._processPanels();!1===a.active&&!0===a.collapsible||!this.headers.length?(a.active=!1,this.active=c()):!1===a.active?this._activate(0):this.active.length&&!c.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(a.active=!1,this.active=c()):this._activate(Math.max(0,a.active-1)):a.active=this.headers.index(this.active);this._destroyIcons();
this._refresh()},_processPanels:function(){var a=this.headers,b=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all");this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide();b&&(this._off(a.not(this.headers)),this._off(b.not(this.panels)))},_refresh:function(){var a,b=this.options,d=b.heightStyle,f=this.element.parent();
this.active=this._findActive(b.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all");this.active.next().addClass("ui-accordion-content-active").show();this.headers.attr("role","tab").each(function(){var a=c(this),b=a.uniqueId().attr("id"),d=a.next(),f=d.uniqueId().attr("id");a.attr("aria-controls",f);d.attr("aria-labelledby",b)}).next().attr("role","tabpanel");this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide();
this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0);this._createIcons();this._setupEvents(b.event);"fill"===d?(a=f.height(),this.element.siblings(":visible").each(function(){var b=c(this),d=b.css("position");"absolute"!==d&&"fixed"!==d&&(a-=b.outerHeight(!0))}),this.headers.each(function(){a-=c(this).outerHeight(!0)}),this.headers.next().each(function(){c(this).height(Math.max(0,
a-c(this).innerHeight()+c(this).height()))}).css("overflow","auto")):"auto"===d&&(a=0,this.headers.next().each(function(){a=Math.max(a,c(this).css("height","").height())}).height(a))},_activate:function(a){a=this._findActive(a)[0];a!==this.active[0]&&(a=a||this.active[0],this._eventHandler({target:a,currentTarget:a,preventDefault:c.noop}))},_findActive:function(a){return"number"===typeof a?this.headers.eq(a):c()},_setupEvents:function(a){var b={keydown:"_keydown"};a&&c.each(a.split(" "),function(a,
c){b[c]="_eventHandler"});this._off(this.headers.add(this.headers.next()));this._on(this.headers,b);this._on(this.headers.next(),{keydown:"_panelKeyDown"});this._hoverable(this.headers);this._focusable(this.headers)},_eventHandler:function(a){var b=this.options,d=this.active,f=c(a.currentTarget),e=f[0]===d[0],g=e&&b.collapsible,k=g?c():f.next(),l=d.next(),k={oldHeader:d,oldPanel:l,newHeader:g?c():f,newPanel:k};a.preventDefault();e&&!b.collapsible||!1===this._trigger("beforeActivate",a,k)||(b.active=
g?!1:this.headers.index(f),this.active=e?c():f,this._toggle(k),d.removeClass("ui-accordion-header-active ui-state-active"),b.icons&&d.children(".ui-accordion-header-icon").removeClass(b.icons.activeHeader).addClass(b.icons.header),e||(f.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),b.icons&&f.children(".ui-accordion-header-icon").removeClass(b.icons.header).addClass(b.icons.activeHeader),f.next().addClass("ui-accordion-content-active")))},_toggle:function(a){var b=
a.newPanel,d=this.prevShow.length?this.prevShow:a.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0);this.prevShow=b;this.prevHide=d;this.options.animate?this._animate(b,d,a):(d.hide(),b.show(),this._toggleComplete(a));d.attr({"aria-hidden":"true"});d.prev().attr({"aria-selected":"false","aria-expanded":"false"});b.length&&d.length?d.prev().attr({tabIndex:-1,"aria-expanded":"false"}):b.length&&this.headers.filter(function(){return 0===parseInt(c(this).attr("tabIndex"),10)}).attr("tabIndex",-1);
b.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(a,b,c){var f,e,g,k=this,l=0,p=a.css("box-sizing"),h=a.length&&(!b.length||a.index()<b.index()),m=this.options.animate||{},h=h&&m.down||m,n=function(){k._toggleComplete(c)};"number"===typeof h&&(g=h);"string"===typeof h&&(e=h);e=e||h.easing||m.easing;g=g||h.duration||m.duration;if(!b.length)return a.animate(this.showProps,g,e,n);if(!a.length)return b.animate(this.hideProps,g,e,n);
f=a.show().outerHeight();b.animate(this.hideProps,{duration:g,easing:e,step:function(a,b){b.now=Math.round(a)}});a.hide().animate(this.showProps,{duration:g,easing:e,complete:n,step:function(a,c){c.now=Math.round(a);"height"!==c.prop?"content-box"===p&&(l+=c.now):"content"!==k.options.heightStyle&&(c.now=Math.round(f-b.outerHeight()-l),l=0)}})},_toggleComplete:function(a){var b=a.oldPanel;b.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all");b.length&&
(b.parent()[0].className=b.parent()[0].className);this._trigger("activate",null,a)}})});