{"ast":null,"code":"import * as i0 from '@angular/core';\nimport { EventEmitter, forwardRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Inject, Input, Output, ContentChildren, NgModule } from '@angular/core';\nimport { trigger, state, style, transition, animate } from '@angular/animations';\nimport * as i1 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport { Header, PrimeTemplate, SharedModule } from 'primeng/api';\n\nfunction AccordionTab_span_4_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"span\", 9);\n i0.ɵɵtext(1);\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext();\n i0.ɵɵadvance(1);\n i0.ɵɵtextInterpolate1(\" \", ctx_r0.header, \" \");\n }\n}\n\nfunction AccordionTab_ng_container_5_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\n\nfunction AccordionTab_ng_content_6_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵprojection(0, 1, [\"*ngIf\", \"hasHeaderFacet\"]);\n }\n}\n\nfunction AccordionTab_ng_container_10_ng_container_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\n\nfunction AccordionTab_ng_container_10_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵtemplate(1, AccordionTab_ng_container_10_ng_container_1_Template, 1, 0, \"ng-container\", 5);\n i0.ɵɵelementContainerEnd();\n }\n\n if (rf & 2) {\n const ctx_r3 = i0.ɵɵnextContext();\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngTemplateOutlet\", ctx_r3.contentTemplate);\n }\n}\n\nconst _c0 = [\"*\", [[\"p-header\"]]];\n\nconst _c1 = function (a0) {\n return {\n \"p-accordion-tab-active\": a0\n };\n};\n\nconst _c2 = function (a0, a1) {\n return {\n \"p-highlight\": a0,\n \"p-disabled\": a1\n };\n};\n\nconst _c3 = function (a0) {\n return {\n transitionParams: a0\n };\n};\n\nconst _c4 = function (a1) {\n return {\n value: \"visible\",\n params: a1\n };\n};\n\nconst _c5 = function (a1) {\n return {\n value: \"hidden\",\n params: a1\n };\n};\n\nconst _c6 = [\"*\", \"p-header\"];\nconst _c7 = [\"*\"];\nlet idx = 0;\n\nclass AccordionTab {\n constructor(accordion, changeDetector) {\n this.changeDetector = changeDetector;\n this.cache = true;\n this.selectedChange = new EventEmitter();\n this.transitionOptions = '400ms cubic-bezier(0.86, 0, 0.07, 1)';\n this.id = `p-accordiontab-${idx++}`;\n this.accordion = accordion;\n }\n\n get selected() {\n return this._selected;\n }\n\n set selected(val) {\n this._selected = val;\n\n if (!this.loaded) {\n if (this._selected && this.cache) {\n this.loaded = true;\n }\n\n this.changeDetector.detectChanges();\n }\n }\n\n ngAfterContentInit() {\n this.templates.forEach(item => {\n switch (item.getType()) {\n case 'content':\n this.contentTemplate = item.template;\n break;\n\n case 'header':\n this.headerTemplate = item.template;\n break;\n\n default:\n this.contentTemplate = item.template;\n break;\n }\n });\n }\n\n toggle(event) {\n if (this.disabled) {\n return false;\n }\n\n let index = this.findTabIndex();\n\n if (this.selected) {\n this.selected = false;\n this.accordion.onClose.emit({\n originalEvent: event,\n index: index\n });\n } else {\n if (!this.accordion.multiple) {\n for (var i = 0; i < this.accordion.tabs.length; i++) {\n this.accordion.tabs[i].selected = false;\n this.accordion.tabs[i].selectedChange.emit(false);\n this.accordion.tabs[i].changeDetector.markForCheck();\n }\n }\n\n this.selected = true;\n this.loaded = true;\n this.accordion.onOpen.emit({\n originalEvent: event,\n index: index\n });\n }\n\n this.selectedChange.emit(this.selected);\n this.accordion.updateActiveIndex();\n this.changeDetector.markForCheck();\n event.preventDefault();\n }\n\n findTabIndex() {\n let index = -1;\n\n for (var i = 0; i < this.accordion.tabs.length; i++) {\n if (this.accordion.tabs[i] == this) {\n index = i;\n break;\n }\n }\n\n return index;\n }\n\n get hasHeaderFacet() {\n return this.headerFacet && this.headerFacet.length > 0;\n }\n\n onKeydown(event) {\n if (event.which === 32 || event.which === 13) {\n this.toggle(event);\n event.preventDefault();\n }\n }\n\n ngOnDestroy() {\n this.accordion.tabs.splice(this.findTabIndex(), 1);\n }\n\n}\n\nAccordionTab.ɵfac = function AccordionTab_Factory(t) {\n return new (t || AccordionTab)(i0.ɵɵdirectiveInject(forwardRef(() => Accordion)), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef));\n};\n\nAccordionTab.ɵcmp = /* @__PURE__ */i0.ɵɵdefineComponent({\n type: AccordionTab,\n selectors: [[\"p-accordionTab\"]],\n contentQueries: function AccordionTab_ContentQueries(rf, ctx, dirIndex) {\n if (rf & 1) {\n i0.ɵɵcontentQuery(dirIndex, Header, 4);\n i0.ɵɵcontentQuery(dirIndex, PrimeTemplate, 4);\n }\n\n if (rf & 2) {\n let _t;\n\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.headerFacet = _t);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.templates = _t);\n }\n },\n hostAttrs: [1, \"p-element\"],\n inputs: {\n header: \"header\",\n disabled: \"disabled\",\n cache: \"cache\",\n transitionOptions: \"transitionOptions\",\n selected: \"selected\"\n },\n outputs: {\n selectedChange: \"selectedChange\"\n },\n ngContentSelectors: _c6,\n decls: 11,\n vars: 28,\n consts: [[1, \"p-accordion-tab\", 3, \"ngClass\"], [1, \"p-accordion-header\", 3, \"ngClass\"], [\"role\", \"tab\", 1, \"p-accordion-header-link\", 3, \"click\", \"keydown\"], [1, \"p-accordion-toggle-icon\", 3, \"ngClass\"], [\"class\", \"p-accordion-header-text\", 4, \"ngIf\"], [4, \"ngTemplateOutlet\"], [4, \"ngIf\"], [\"role\", \"region\", 1, \"p-toggleable-content\"], [1, \"p-accordion-content\"], [1, \"p-accordion-header-text\"]],\n template: function AccordionTab_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵprojectionDef(_c0);\n i0.ɵɵelementStart(0, \"div\", 0);\n i0.ɵɵelementStart(1, \"div\", 1);\n i0.ɵɵelementStart(2, \"a\", 2);\n i0.ɵɵlistener(\"click\", function AccordionTab_Template_a_click_2_listener($event) {\n return ctx.toggle($event);\n })(\"keydown\", function AccordionTab_Template_a_keydown_2_listener($event) {\n return ctx.onKeydown($event);\n });\n i0.ɵɵelement(3, \"span\", 3);\n i0.ɵɵtemplate(4, AccordionTab_span_4_Template, 2, 1, \"span\", 4);\n i0.ɵɵtemplate(5, AccordionTab_ng_container_5_Template, 1, 0, \"ng-container\", 5);\n i0.ɵɵtemplate(6, AccordionTab_ng_content_6_Template, 1, 0, \"ng-content\", 6);\n i0.ɵɵelementEnd();\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(7, \"div\", 7);\n i0.ɵɵelementStart(8, \"div\", 8);\n i0.ɵɵprojection(9);\n i0.ɵɵtemplate(10, AccordionTab_ng_container_10_Template, 2, 1, \"ng-container\", 6);\n i0.ɵɵelementEnd();\n i0.ɵɵelementEnd();\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n i0.ɵɵproperty(\"ngClass\", i0.ɵɵpureFunction1(15, _c1, ctx.selected));\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngClass\", i0.ɵɵpureFunction2(17, _c2, ctx.selected, ctx.disabled));\n i0.ɵɵadvance(1);\n i0.ɵɵattribute(\"tabindex\", ctx.disabled ? null : 0)(\"id\", ctx.id)(\"aria-controls\", ctx.id + \"-content\")(\"aria-expanded\", ctx.selected);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngClass\", ctx.selected ? ctx.accordion.collapseIcon : ctx.accordion.expandIcon);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", !ctx.hasHeaderFacet);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngTemplateOutlet\", ctx.headerTemplate);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", ctx.hasHeaderFacet);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"@tabContent\", ctx.selected ? i0.ɵɵpureFunction1(22, _c4, i0.ɵɵpureFunction1(20, _c3, ctx.transitionOptions)) : i0.ɵɵpureFunction1(26, _c5, i0.ɵɵpureFunction1(24, _c3, ctx.transitionOptions)));\n i0.ɵɵattribute(\"id\", ctx.id + \"-content\")(\"aria-hidden\", !ctx.selected)(\"aria-labelledby\", ctx.id);\n i0.ɵɵadvance(3);\n i0.ɵɵproperty(\"ngIf\", ctx.contentTemplate && (ctx.cache ? ctx.loaded : ctx.selected));\n }\n },\n directives: [i1.NgClass, i1.NgIf, i1.NgTemplateOutlet],\n styles: [\".p-accordion-header-link{cursor:pointer;display:flex;align-items:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;position:relative;text-decoration:none}.p-accordion-header-link:focus{z-index:1}.p-accordion-header-text{line-height:1}\\n\"],\n encapsulation: 2,\n data: {\n animation: [trigger('tabContent', [state('hidden', style({\n height: '0',\n overflow: 'hidden'\n })), state('visible', style({\n height: '*'\n })), transition('visible <=> hidden', [style({\n overflow: 'hidden'\n }), animate('{{transitionParams}}')]), transition('void => *', animate(0))])]\n },\n changeDetection: 0\n});\n\n(function () {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(AccordionTab, [{\n type: Component,\n args: [{\n selector: 'p-accordionTab',\n template: `\n