{"ast":null,"code":"import * as i0 from '@angular/core';\nimport { forwardRef, EventEmitter, TemplateRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, ContentChild, NgModule } from '@angular/core';\nimport * as i1 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport { ObjectUtils } from 'primeng/utils';\nimport * as i2 from 'primeng/ripple';\nimport { RippleModule } from 'primeng/ripple';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\nfunction SelectButton_div_1_ng_container_2_span_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 8);\n }\n\n if (rf & 2) {\n const option_r1 = i0.ɵɵnextContext(2).$implicit;\n i0.ɵɵclassMap(option_r1.icon);\n i0.ɵɵproperty(\"ngClass\", \"p-button-icon p-button-icon-left\");\n }\n}\n\nfunction SelectButton_div_1_ng_container_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵtemplate(1, SelectButton_div_1_ng_container_2_span_1_Template, 1, 3, \"span\", 6);\n i0.ɵɵelementStart(2, \"span\", 7);\n i0.ɵɵtext(3);\n i0.ɵɵelementEnd();\n i0.ɵɵelementContainerEnd();\n }\n\n if (rf & 2) {\n const option_r1 = i0.ɵɵnextContext().$implicit;\n const ctx_r4 = i0.ɵɵnextContext();\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", option_r1.icon);\n i0.ɵɵadvance(2);\n i0.ɵɵtextInterpolate(ctx_r4.getOptionLabel(option_r1));\n }\n}\n\nfunction SelectButton_div_1_ng_template_3_ng_container_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\n\nconst _c0 = function (a0, a1) {\n return {\n $implicit: a0,\n index: a1\n };\n};\n\nfunction SelectButton_div_1_ng_template_3_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, SelectButton_div_1_ng_template_3_ng_container_0_Template, 1, 0, \"ng-container\", 9);\n }\n\n if (rf & 2) {\n const ctx_r11 = i0.ɵɵnextContext();\n const option_r1 = ctx_r11.$implicit;\n const i_r2 = ctx_r11.index;\n const ctx_r6 = i0.ɵɵnextContext();\n i0.ɵɵproperty(\"ngTemplateOutlet\", ctx_r6.itemTemplate)(\"ngTemplateOutletContext\", i0.ɵɵpureFunction2(2, _c0, option_r1, i_r2));\n }\n}\n\nconst _c1 = function (a0, a1, a2) {\n return {\n \"p-highlight\": a0,\n \"p-disabled\": a1,\n \"p-button-icon-only\": a2\n };\n};\n\nfunction SelectButton_div_1_Template(rf, ctx) {\n if (rf & 1) {\n const _r13 = i0.ɵɵgetCurrentView();\n\n i0.ɵɵelementStart(0, \"div\", 2, 3);\n i0.ɵɵlistener(\"click\", function SelectButton_div_1_Template_div_click_0_listener($event) {\n const restoredCtx = i0.ɵɵrestoreView(_r13);\n const option_r1 = restoredCtx.$implicit;\n const i_r2 = restoredCtx.index;\n const ctx_r12 = i0.ɵɵnextContext();\n return ctx_r12.onItemClick($event, option_r1, i_r2);\n })(\"keydown.enter\", function SelectButton_div_1_Template_div_keydown_enter_0_listener($event) {\n const restoredCtx = i0.ɵɵrestoreView(_r13);\n const option_r1 = restoredCtx.$implicit;\n const i_r2 = restoredCtx.index;\n const ctx_r14 = i0.ɵɵnextContext();\n return ctx_r14.onItemClick($event, option_r1, i_r2);\n })(\"blur\", function SelectButton_div_1_Template_div_blur_0_listener() {\n i0.ɵɵrestoreView(_r13);\n const ctx_r15 = i0.ɵɵnextContext();\n return ctx_r15.onBlur();\n });\n i0.ɵɵtemplate(2, SelectButton_div_1_ng_container_2_Template, 4, 2, \"ng-container\", 4);\n i0.ɵɵtemplate(3, SelectButton_div_1_ng_template_3_Template, 1, 5, \"ng-template\", null, 5, i0.ɵɵtemplateRefExtractor);\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n const option_r1 = ctx.$implicit;\n\n const _r5 = i0.ɵɵreference(4);\n\n const ctx_r0 = i0.ɵɵnextContext();\n i0.ɵɵclassMap(option_r1.styleClass);\n i0.ɵɵproperty(\"ngClass\", i0.ɵɵpureFunction3(10, _c1, ctx_r0.isSelected(option_r1), ctx_r0.disabled || ctx_r0.isOptionDisabled(option_r1), option_r1.icon && !ctx_r0.getOptionLabel(option_r1)));\n i0.ɵɵattribute(\"aria-pressed\", ctx_r0.isSelected(option_r1))(\"title\", option_r1.title)(\"aria-label\", option_r1.label)(\"tabindex\", ctx_r0.disabled ? null : ctx_r0.tabindex)(\"aria-labelledby\", ctx_r0.getOptionLabel(option_r1));\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"ngIf\", !ctx_r0.itemTemplate)(\"ngIfElse\", _r5);\n }\n}\n\nconst SELECTBUTTON_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SelectButton),\n multi: true\n};\n\nclass SelectButton {\n constructor(cd) {\n this.cd = cd;\n this.tabindex = 0;\n this.onOptionClick = new EventEmitter();\n this.onChange = new EventEmitter();\n\n this.onModelChange = () => {};\n\n this.onModelTouched = () => {};\n }\n\n getOptionLabel(option) {\n return this.optionLabel ? ObjectUtils.resolveFieldData(option, this.optionLabel) : option.label != undefined ? option.label : option;\n }\n\n getOptionValue(option) {\n return this.optionValue ? ObjectUtils.resolveFieldData(option, this.optionValue) : this.optionLabel || option.value === undefined ? option : option.value;\n }\n\n isOptionDisabled(option) {\n return this.optionDisabled ? ObjectUtils.resolveFieldData(option, this.optionDisabled) : option.disabled !== undefined ? option.disabled : false;\n }\n\n writeValue(value) {\n this.value = value;\n this.cd.markForCheck();\n }\n\n registerOnChange(fn) {\n this.onModelChange = fn;\n }\n\n registerOnTouched(fn) {\n this.onModelTouched = fn;\n }\n\n setDisabledState(val) {\n this.disabled = val;\n this.cd.markForCheck();\n }\n\n onItemClick(event, option, index) {\n if (this.disabled || this.isOptionDisabled(option)) {\n return;\n }\n\n if (this.multiple) {\n if (this.isSelected(option)) this.removeOption(option);else this.value = [...(this.value || []), this.getOptionValue(option)];\n } else {\n this.value = this.getOptionValue(option);\n }\n\n this.onOptionClick.emit({\n originalEvent: event,\n option: option,\n index: index\n });\n this.onModelChange(this.value);\n this.onChange.emit({\n originalEvent: event,\n value: this.value\n });\n }\n\n onBlur() {\n this.onModelTouched();\n }\n\n removeOption(option) {\n this.value = this.value.filter(val => !ObjectUtils.equals(val, this.getOptionValue(option), this.dataKey));\n }\n\n isSelected(option) {\n let selected = false;\n let optionValue = this.getOptionValue(option);\n\n if (this.multiple) {\n if (this.value) {\n for (let val of this.value) {\n if (ObjectUtils.equals(val, optionValue, this.dataKey)) {\n selected = true;\n break;\n }\n }\n }\n } else {\n selected = ObjectUtils.equals(this.getOptionValue(option), this.value, this.dataKey);\n }\n\n return selected;\n }\n\n}\n\nSelectButton.ɵfac = function SelectButton_Factory(t) {\n return new (t || SelectButton)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef));\n};\n\nSelectButton.ɵcmp = /* @__PURE__ */i0.ɵɵdefineComponent({\n type: SelectButton,\n selectors: [[\"p-selectButton\"]],\n contentQueries: function SelectButton_ContentQueries(rf, ctx, dirIndex) {\n if (rf & 1) {\n i0.ɵɵcontentQuery(dirIndex, TemplateRef, 5);\n }\n\n if (rf & 2) {\n let _t;\n\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.itemTemplate = _t.first);\n }\n },\n hostAttrs: [1, \"p-element\"],\n inputs: {\n options: \"options\",\n optionLabel: \"optionLabel\",\n optionValue: \"optionValue\",\n optionDisabled: \"optionDisabled\",\n tabindex: \"tabindex\",\n multiple: \"multiple\",\n style: \"style\",\n styleClass: \"styleClass\",\n ariaLabelledBy: \"ariaLabelledBy\",\n disabled: \"disabled\",\n dataKey: \"dataKey\"\n },\n outputs: {\n onOptionClick: \"onOptionClick\",\n onChange: \"onChange\"\n },\n features: [i0.ɵɵProvidersFeature([SELECTBUTTON_VALUE_ACCESSOR])],\n decls: 2,\n vars: 5,\n consts: [[\"role\", \"group\", 3, \"ngClass\", \"ngStyle\"], [\"class\", \"p-button p-component\", \"role\", \"button\", \"pRipple\", \"\", 3, \"class\", \"ngClass\", \"click\", \"keydown.enter\", \"blur\", 4, \"ngFor\", \"ngForOf\"], [\"role\", \"button\", \"pRipple\", \"\", 1, \"p-button\", \"p-component\", 3, \"ngClass\", \"click\", \"keydown.enter\", \"blur\"], [\"btn\", \"\"], [4, \"ngIf\", \"ngIfElse\"], [\"customcontent\", \"\"], [3, \"ngClass\", \"class\", 4, \"ngIf\"], [1, \"p-button-label\"], [3, \"ngClass\"], [4, \"ngTemplateOutlet\", \"ngTemplateOutletContext\"]],\n template: function SelectButton_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"div\", 0);\n i0.ɵɵtemplate(1, SelectButton_div_1_Template, 5, 14, \"div\", 1);\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n i0.ɵɵclassMap(ctx.styleClass);\n i0.ɵɵproperty(\"ngClass\", \"p-selectbutton p-buttonset p-component\")(\"ngStyle\", ctx.style);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngForOf\", ctx.options);\n }\n },\n directives: [i1.NgClass, i1.NgStyle, i1.NgForOf, i2.Ripple, i1.NgIf, i1.NgTemplateOutlet],\n styles: [\".p-button{margin:0;display:inline-flex;cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none;align-items:center;vertical-align:bottom;text-align:center;overflow:hidden;position:relative}.p-button-label{flex:1 1 auto}.p-button-icon-right{order:1}.p-button:disabled{cursor:default}.p-button-icon-only{justify-content:center}.p-button-icon-only .p-button-label{visibility:hidden;width:0;flex:0 0 auto}.p-button-vertical{flex-direction:column}.p-button-icon-bottom{order:2}.p-buttonset .p-button{margin:0}.p-buttonset .p-button:not(:last-child){border-right:0 none}.p-buttonset .p-button:not(:first-of-type):not(:last-of-type){border-radius:0}.p-buttonset .p-button:first-of-type{border-top-right-radius:0;border-bottom-right-radius:0}.p-buttonset .p-button:last-of-type{border-top-left-radius:0;border-bottom-left-radius:0}.p-buttonset .p-button:focus{position:relative;z-index:1}.p-button-label{transition:all .2s}\\n\"],\n encapsulation: 2,\n changeDetection: 0\n});\n\n(function () {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(SelectButton, [{\n type: Component,\n args: [{\n selector: 'p-selectButton',\n template: `\n