{"version":3,"file":"ng-bootstrap-icons.mjs","sources":["../../src/lib/bootstrap-icons/icons.provider.ts","../../src/lib/bootstrap-icons/utils.ts","../../src/lib/bootstrap-icons/ng-bootstrap-icons.component.ts","../../src/lib/bootstrap-icons/ng-bootstrap-icons.component.html","../../src/lib/bootstrap-icons/ng-bootstrap-icons.module.ts","../../src/lib/ng-bootstrap-icons.ts"],"sourcesContent":["\nexport class Icons {\n  constructor(private icons: Object) {}\n}\n","\nexport function uppercamelcase (str: string) {\n  return str.toLowerCase().replace(/(?:^\\w|[A-Z]|\\b\\w)/g, (firstLetter) => {\n    return firstLetter.toUpperCase();\n  }).replace(/[-_]/g, '');\n}\n","import {\n  Component,\n  ElementRef,\n  Input,\n  Inject,\n  ChangeDetectorRef,\n  OnChanges,\n  SimpleChanges,\n} from \"@angular/core\";\nimport { Icons } from \"./icons.provider\";\nimport { uppercamelcase } from \"./utils\";\n\n@Component({\n  // tslint:disable-next-line:component-selector\n  selector: \"bt-icon, bootstrap-icon, bi\",\n  templateUrl: \"./ng-bootstrap-icons.component.html\",\n  styleUrls: [\"./ng-bootstrap-icons.component.scss\"],\n})\nexport class BootstrapIcons implements OnChanges {\n  @Input() name!: string;\n\n  constructor(\n    private elem: ElementRef,\n    private changeDetector: ChangeDetectorRef,\n    @Inject(Icons) private icons: Icons\n  ) {}\n\n  ngOnChanges(changes: SimpleChanges) {\n    // icons are provided as an array of objects because of \"multi: true\"\n    const icons = Object.assign({}, ...(this.icons as any as object[]));\n    const svg = icons[uppercamelcase(changes.name.currentValue)] || \"\";\n\n    if (!svg) {\n      console.warn(\n        `Icon not found: ${changes.name.currentValue}\\n` +\n          `Refer to documentation on https://github.com/biutas/ng-bootstrap-icons/issues`\n      );\n    }\n\n    this.elem.nativeElement.innerHTML = svg;\n    this.changeDetector.markForCheck();\n  }\n}\n","<ng-content></ng-content>\n","import { NgModule, ModuleWithProviders, Optional } from \"@angular/core\";\nimport { BootstrapIcons } from \"./ng-bootstrap-icons.component\";\nimport { Icons } from \"./icons.provider\";\n\n@NgModule({\n  declarations: [BootstrapIcons],\n  exports: [BootstrapIcons],\n})\nexport class BootstrapIconsModule {\n  constructor(@Optional() private icons: Icons) {\n    if (!this.icons) {\n      throw new Error(\n        `No icon provided. Make sure to use 'BootstrapIconsModule.pick({ ... })' when importing the module\\n` +\n          `Refer to documentation on https://github.com/biutas/ng-bootstrap-icons/issues`\n      );\n    }\n  }\n\n  static pick(icons: {\n    [key: string]: string;\n  }): ModuleWithProviders<BootstrapIconsModule> {\n    return {\n      ngModule: BootstrapIconsModule,\n      providers: [{ provide: Icons, multi: true, useValue: icons }],\n    };\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MACa,KAAK;IAChB,YAAoB,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;KAAI;;;SCDvB,cAAc,CAAE,GAAW;IACzC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,WAAW;QAClE,OAAO,WAAW,CAAC,WAAW,EAAE,CAAC;KAClC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAC1B;;MCaa,cAAc;IAGzB,YACU,IAAgB,EAChB,cAAiC,EAClB,KAAY;QAF3B,SAAI,GAAJ,IAAI,CAAY;QAChB,mBAAc,GAAd,cAAc,CAAmB;QAClB,UAAK,GAAL,KAAK,CAAO;KACjC;IAEJ,WAAW,CAAC,OAAsB;;QAEhC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAI,IAAI,CAAC,KAAyB,CAAC,CAAC;QACpE,MAAM,GAAG,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC;QAEnE,IAAI,CAAC,GAAG,EAAE;YACR,OAAO,CAAC,IAAI,CACV,mBAAmB,OAAO,CAAC,IAAI,CAAC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