{"version":3,"sources":["node_modules/primeng/fesm2022/primeng-button.mjs"],"sourcesContent":["import * as i1 from '@angular/common';\nimport { DOCUMENT, CommonModule } from '@angular/common';\nimport * as i0 from '@angular/core';\nimport { Directive, Inject, Input, EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Output, ContentChildren, NgModule } from '@angular/core';\nimport { PrimeTemplate, SharedModule } from 'primeng/api';\nimport { DomHandler } from 'primeng/dom';\nimport { SpinnerIcon } from 'primeng/icons/spinner';\nimport * as i2 from 'primeng/ripple';\nimport { RippleModule } from 'primeng/ripple';\nimport { ObjectUtils } from 'primeng/utils';\nconst _c0 = [\"*\"];\nfunction Button_ng_container_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainer(0);\n }\n}\nfunction Button_ng_container_3_ng_container_1_span_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 8);\n }\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext(3);\n i0.ɵɵclassMap(\"p-button-loading-icon pi-spin \" + ctx_r0.loadingIcon);\n i0.ɵɵproperty(\"ngClass\", ctx_r0.iconClass());\n i0.ɵɵattribute(\"aria-hidden\", true)(\"data-pc-section\", \"loadingicon\");\n }\n}\nfunction Button_ng_container_3_ng_container_1_SpinnerIcon_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"SpinnerIcon\", 9);\n }\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext(3);\n i0.ɵɵproperty(\"styleClass\", ctx_r0.spinnerIconClass())(\"spin\", true);\n i0.ɵɵattribute(\"aria-hidden\", true)(\"data-pc-section\", \"loadingicon\");\n }\n}\nfunction Button_ng_container_3_ng_container_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵtemplate(1, Button_ng_container_3_ng_container_1_span_1_Template, 1, 5, \"span\", 6)(2, Button_ng_container_3_ng_container_1_SpinnerIcon_2_Template, 1, 4, \"SpinnerIcon\", 7);\n i0.ɵɵelementContainerEnd();\n }\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext(2);\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", ctx_r0.loadingIcon);\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", !ctx_r0.loadingIcon);\n }\n}\nfunction Button_ng_container_3_span_2_1_ng_template_0_Template(rf, ctx) {}\nfunction Button_ng_container_3_span_2_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Button_ng_container_3_span_2_1_ng_template_0_Template, 0, 0, \"ng-template\");\n }\n}\nfunction Button_ng_container_3_span_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"span\", 10);\n i0.ɵɵtemplate(1, Button_ng_container_3_span_2_1_Template, 1, 0, null, 1);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext(2);\n i0.ɵɵproperty(\"ngClass\", ctx_r0.iconClass());\n i0.ɵɵattribute(\"aria-hidden\", true)(\"data-pc-section\", \"loadingicon\");\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngTemplateOutlet\", ctx_r0.loadingIconTemplate);\n }\n}\nfunction Button_ng_container_3_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵtemplate(1, Button_ng_container_3_ng_container_1_Template, 3, 2, \"ng-container\", 2)(2, Button_ng_container_3_span_2_Template, 2, 4, \"span\", 5);\n i0.ɵɵelementContainerEnd();\n }\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext();\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", !ctx_r0.loadingIconTemplate);\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", ctx_r0.loadingIconTemplate);\n }\n}\nfunction Button_ng_container_4_span_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 8);\n }\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext(2);\n i0.ɵɵclassMap(ctx_r0.icon);\n i0.ɵɵproperty(\"ngClass\", ctx_r0.iconClass());\n i0.ɵɵattribute(\"data-pc-section\", \"icon\");\n }\n}\nfunction Button_ng_container_4_span_2_1_ng_template_0_Template(rf, ctx) {}\nfunction Button_ng_container_4_span_2_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵtemplate(0, Button_ng_container_4_span_2_1_ng_template_0_Template, 0, 0, \"ng-template\", 12);\n }\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext(3);\n i0.ɵɵproperty(\"ngIf\", !ctx_r0.icon);\n }\n}\nfunction Button_ng_container_4_span_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"span\", 8);\n i0.ɵɵtemplate(1, Button_ng_container_4_span_2_1_Template, 1, 1, null, 1);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext(2);\n i0.ɵɵproperty(\"ngClass\", ctx_r0.iconClass());\n i0.ɵɵattribute(\"data-pc-section\", \"icon\");\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngTemplateOutlet\", ctx_r0.iconTemplate);\n }\n}\nfunction Button_ng_container_4_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵtemplate(1, Button_ng_container_4_span_1_Template, 1, 4, \"span\", 6)(2, Button_ng_container_4_span_2_Template, 2, 3, \"span\", 11);\n i0.ɵɵelementContainerEnd();\n }\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext();\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", ctx_r0.icon && !ctx_r0.iconTemplate);\n i0.ɵɵadvance();\n i0.ɵɵproperty(\"ngIf\", !ctx_r0.icon && ctx_r0.iconTemplate);\n }\n}\nfunction Button_span_5_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"span\", 13);\n i0.ɵɵtext(1);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext();\n i0.ɵɵattribute(\"aria-hidden\", ctx_r0.icon && !ctx_r0.label)(\"data-pc-section\", \"label\");\n i0.ɵɵadvance();\n i0.ɵɵtextInterpolate(ctx_r0.label);\n }\n}\nfunction Button_span_6_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"span\", 8);\n i0.ɵɵtext(1);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext();\n i0.ɵɵclassMap(ctx_r0.badgeClass);\n i0.ɵɵproperty(\"ngClass\", ctx_r0.badgeStyleClass());\n i0.ɵɵattribute(\"data-pc-section\", \"badge\");\n i0.ɵɵadvance();\n i0.ɵɵtextInterpolate(ctx_r0.badge);\n }\n}\nconst INTERNAL_BUTTON_CLASSES = {\n button: 'p-button',\n component: 'p-component',\n iconOnly: 'p-button-icon-only',\n disabled: 'p-disabled',\n loading: 'p-button-loading',\n labelOnly: 'p-button-loading-label-only'\n};\n/**\n * Button directive is an extension to button component.\n * @group Components\n */\nlet ButtonDirective = /*#__PURE__*/(() => {\n class ButtonDirective {\n el;\n document;\n /**\n * Position of the icon.\n * @group Props\n */\n iconPos = 'left';\n /**\n * Uses to pass attributes to the loading icon's DOM element.\n * @group Props\n */\n loadingIcon;\n /**\n * Text of the button.\n * @group Props\n */\n get label() {\n return this._label;\n }\n set label(val) {\n this._label = val;\n if (this.initialized) {\n this.updateLabel();\n this.updateIcon();\n this.setStyleClass();\n }\n }\n /**\n * Name of the icon.\n * @group Props\n */\n get icon() {\n return this._icon;\n }\n set icon(val) {\n this._icon = val;\n if (this.initialized) {\n this.updateIcon();\n this.setStyleClass();\n }\n }\n /**\n * Whether the button is in loading state.\n * @group Props\n */\n get loading() {\n return this._loading;\n }\n set loading(val) {\n this._loading = val;\n if (this.initialized) {\n this.updateIcon();\n this.setStyleClass();\n }\n }\n _label;\n _icon;\n _loading = false;\n initialized;\n get htmlElement() {\n return this.el.nativeElement;\n }\n _internalClasses = Object.values(INTERNAL_BUTTON_CLASSES);\n spinnerIcon = `\n \n \n \n \n \n \n \n \n `;\n constructor(el, document) {\n this.el = el;\n this.document = document;\n }\n ngAfterViewInit() {\n DomHandler.addMultipleClasses(this.htmlElement, this.getStyleClass().join(' '));\n this.createIcon();\n this.createLabel();\n this.initialized = true;\n }\n getStyleClass() {\n const styleClass = [INTERNAL_BUTTON_CLASSES.button, INTERNAL_BUTTON_CLASSES.component];\n if (this.icon && !this.label && ObjectUtils.isEmpty(this.htmlElement.textContent)) {\n styleClass.push(INTERNAL_BUTTON_CLASSES.iconOnly);\n }\n if (this.loading) {\n styleClass.push(INTERNAL_BUTTON_CLASSES.disabled, INTERNAL_BUTTON_CLASSES.loading);\n if (!this.icon && this.label) {\n styleClass.push(INTERNAL_BUTTON_CLASSES.labelOnly);\n }\n if (this.icon && !this.label && !ObjectUtils.isEmpty(this.htmlElement.textContent)) {\n styleClass.push(INTERNAL_BUTTON_CLASSES.iconOnly);\n }\n }\n return styleClass;\n }\n setStyleClass() {\n const styleClass = this.getStyleClass();\n this.htmlElement.classList.remove(...this._internalClasses);\n this.htmlElement.classList.add(...styleClass);\n }\n createLabel() {\n const created = DomHandler.findSingle(this.htmlElement, '.p-button-label');\n if (!created && this.label) {\n let labelElement = this.document.createElement('span');\n if (this.icon && !this.label) {\n labelElement.setAttribute('aria-hidden', 'true');\n }\n labelElement.className = 'p-button-label';\n labelElement.appendChild(this.document.createTextNode(this.label));\n this.htmlElement.appendChild(labelElement);\n }\n }\n createIcon() {\n const created = DomHandler.findSingle(this.htmlElement, '.p-button-icon');\n if (!created && (this.icon || this.loading)) {\n let iconElement = this.document.createElement('span');\n iconElement.className = 'p-button-icon';\n iconElement.setAttribute('aria-hidden', 'true');\n let iconPosClass = this.label ? 'p-button-icon-' + this.iconPos : null;\n if (iconPosClass) {\n DomHandler.addClass(iconElement, iconPosClass);\n }\n let iconClass = this.getIconClass();\n if (iconClass) {\n DomHandler.addMultipleClasses(iconElement, iconClass);\n }\n if (!this.loadingIcon && this.loading) {\n iconElement.innerHTML = this.spinnerIcon;\n }\n this.htmlElement.insertBefore(iconElement, this.htmlElement.firstChild);\n }\n }\n updateLabel() {\n let labelElement = DomHandler.findSingle(this.htmlElement, '.p-button-label');\n if (!this.label) {\n labelElement && this.htmlElement.removeChild(labelElement);\n return;\n }\n labelElement ? labelElement.textContent = this.label : this.createLabel();\n }\n updateIcon() {\n let iconElement = DomHandler.findSingle(this.htmlElement, '.p-button-icon');\n let labelElement = DomHandler.findSingle(this.htmlElement, '.p-button-label');\n if (this.loading && !this.loadingIcon && iconElement) {\n iconElement.innerHTML = this.spinnerIcon;\n } else if (iconElement?.innerHTML) {\n iconElement.innerHTML = '';\n }\n if (iconElement) {\n if (this.iconPos) {\n iconElement.className = 'p-button-icon ' + (labelElement ? 'p-button-icon-' + this.iconPos : '') + ' ' + this.getIconClass();\n } else {\n iconElement.className = 'p-button-icon ' + this.getIconClass();\n }\n } else {\n this.createIcon();\n }\n }\n getIconClass() {\n return this.loading ? 'p-button-loading-icon ' + (this.loadingIcon ? this.loadingIcon : 'p-icon') : this.icon || 'p-hidden';\n }\n ngOnDestroy() {\n this.initialized = false;\n }\n static ɵfac = function ButtonDirective_Factory(t) {\n return new (t || ButtonDirective)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(DOCUMENT));\n };\n static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: ButtonDirective,\n selectors: [[\"\", \"pButton\", \"\"]],\n hostAttrs: [1, \"p-element\"],\n inputs: {\n iconPos: \"iconPos\",\n loadingIcon: \"loadingIcon\",\n label: \"label\",\n icon: \"icon\",\n loading: \"loading\"\n }\n });\n }\n return ButtonDirective;\n})();\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n/**\n * Button is an extension to standard button element with icons and theming.\n * @group Components\n */\nlet Button = /*#__PURE__*/(() => {\n class Button {\n el;\n /**\n * Type of the button.\n * @group Props\n */\n type = 'button';\n /**\n * Position of the icon.\n * @group Props\n */\n iconPos = 'left';\n /**\n * Name of the icon.\n * @group Props\n */\n icon;\n /**\n * Value of the badge.\n * @group Props\n */\n badge;\n /**\n * Uses to pass attributes to the label's DOM element.\n * @group Props\n */\n label;\n /**\n * When present, it specifies that the component should be disabled.\n * @group Props\n */\n disabled;\n /**\n * Whether the button is in loading state.\n * @group Props\n */\n loading = false;\n /**\n * Icon to display in loading state.\n * @group Props\n */\n loadingIcon;\n /**\n * Add a shadow to indicate elevation.\n * @group Props\n */\n raised = false;\n /**\n * Add a circular border radius to the button.\n * @group Props\n */\n rounded = false;\n /**\n * Add a textual class to the button without a background initially.\n * @group Props\n */\n text = false;\n /**\n * Add a plain textual class to the button without a background initially.\n * @group Props\n */\n plain = false;\n /**\n * Defines the style of the button.\n * @group Props\n */\n severity;\n /**\n * Add a border class without a background initially.\n * @group Props\n */\n outlined = false;\n /**\n * Add a link style to the button.\n * @group Props\n */\n link = false;\n /**\n * Defines the size of the button.\n * @group Props\n */\n size;\n /**\n * Inline style of the element.\n * @group Props\n */\n style;\n /**\n * Class of the element.\n * @group Props\n */\n styleClass;\n /**\n * Style class of the badge.\n * @group Props\n */\n badgeClass;\n /**\n * Used to define a string that autocomplete attribute the current element.\n * @group Props\n */\n ariaLabel;\n /**\n * Callback to execute when button is clicked.\n * This event is intended to be used with the component. Using a regular