{"version":3,"file":"bloomreach-brie-snackbar.mjs","sources":["../../../../projects/brie/snackbar/components/snack-bar.component.ts","../../../../projects/brie/snackbar/components/snack-bar.component.html","../../../../projects/brie/snackbar/snackbar.module.ts","../../../../projects/brie/snackbar/models/snackbar.ts","../../../../projects/brie/snackbar/services/snack-bar.service.ts","../../../../projects/brie/snackbar/public-api.ts","../../../../projects/brie/snackbar/bloomreach-brie-snackbar.ts"],"sourcesContent":["/*\n * Copyright 2025-2026 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *  https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Component, HostBinding, Inject, ChangeDetectionStrategy } from '@angular/core';\nimport { MAT_SNACK_BAR_DATA, MatSnackBarModule, MatSnackBarRef } from '@angular/material/snack-bar';\n\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { BrieSnackBar } from '../models/snackbar';\n\n@Component({\n  selector: 'brie-snackbar',\n  templateUrl: './snack-bar.component.html',\n  styleUrls: ['./snack-bar.component.scss'],\n  changeDetection: ChangeDetectionStrategy.Eager,\n  imports: [\n    MatButtonModule,\n    MatIconModule,\n    MatSnackBarModule,\n  ],\n\n})\nexport class BrieSnackBarComponent {\n  @HostBinding('class.warning') warningClass = false;\n\n  constructor(\n    public snackBarRef: MatSnackBarRef<BrieSnackBarComponent>,\n    @Inject(MAT_SNACK_BAR_DATA) public data: BrieSnackBar,\n  ) {\n    this.warningClass = !!this.data.warning;\n  }\n}\n","<!--\nCopyright 2022-2023 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttps://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n\n<div class=\"brie-snackbar\">\n  <div class=\"brie-snackbar-message\">\n    @if (data.warning) {\n      <mat-icon>warning_amber</mat-icon>\n    }\n    <span>{{ data.message }}</span>\n  </div>\n  @if (data.dismiss) {\n    <button mat-icon-button\n      class=\"brie-snackbar-close\"\n      (click)=\"snackBarRef.dismiss()\">\n      <mat-icon>close</mat-icon>\n    </button>\n  }\n</div>\n","/*\n * Copyright 2025-2026 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *  https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatSnackBarModule } from '@angular/material/snack-bar';\n\nimport { BrieSnackBarComponent } from './components/snack-bar.component';\n\n@NgModule({\n  exports: [\n    BrieSnackBarComponent,\n  ],\n  imports: [\n    BrieSnackBarComponent,\n    CommonModule,\n    MatButtonModule,\n    MatIconModule,\n    MatSnackBarModule,\n  ],\n})\nexport class BrieSnackBarModule { }\n","/*\n * Copyright 2025-2026 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *  https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MatSnackBarHorizontalPosition, MatSnackBarVerticalPosition } from '@angular/material/snack-bar';\n\nexport interface BrieSnackBar {\n  dismiss?: boolean;\n  message: string;\n  warning?: boolean;\n}\n\nexport interface BrieSnackBarConfig {\n  duration?: number;\n  warning?: boolean;\n  dismiss?: boolean;\n  horizontalPosition?: MatSnackBarHorizontalPosition;\n  verticalPosition?: MatSnackBarVerticalPosition;\n}\n","/*\n * Copyright 2025-2026 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *  https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Injectable } from '@angular/core';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { BrieSnackBarComponent } from '../components/snack-bar.component';\nimport { BrieSnackBarConfig } from '../models/snackbar';\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class BrieSnackBarService {\n  constructor(\n    private readonly snackBar: MatSnackBar,\n  ) { }\n\n  open(message: string, config: BrieSnackBarConfig = {}): void {\n    const { dismiss, duration, warning, horizontalPosition, verticalPosition } = config;\n\n    this.snackBar.openFromComponent(BrieSnackBarComponent, {\n      data: {\n        message,\n        dismiss,\n        warning,\n      },\n      duration: 'duration' in config ? duration : 4000,\n      horizontalPosition,\n      verticalPosition,\n    });\n  }\n\n  warning(message: string, config: BrieSnackBarConfig = {}): void {\n    const snackBarConfig: BrieSnackBarConfig = {\n      dismiss: true,\n      duration: undefined,\n      warning: true,\n      ...config,\n    };\n\n    this.open(message, snackBarConfig);\n  }\n\n  dismiss(): void {\n    this.snackBar.dismiss();\n  }\n}\n","/*\n * Copyright 2025-2026 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *  https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './snackbar.module';\nexport * from './components/snack-bar.component';\nexport * from './models/snackbar';\nexport * from './services/snack-bar.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;MAqBU,qBAAqB,CAAA;IAGhC,WAAA,CACS,WAAkD,EACtB,IAAkB,EAAA;QAD9C,IAAA,CAAA,WAAW,GAAX,WAAW;QACiB,IAAA,CAAA,IAAI,GAAJ,IAAI;QAJX,IAAA,CAAA,YAAY,GAAG,KAAK;QAMhD,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO;IACzC;AARW,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,gDAKtB,kBAAkB,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AALjB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,U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