{ "version": 3, "sources": ["libs/sales-common/src/lib/currency/format-currency.pipe.ts", "libs/sales-common/src/lib/currency/preferred-currency.module.ts"], "sourcesContent": ["import { CurrencyPipe, getLocaleCurrencySymbol } from '@angular/common';\nimport { Pipe, PipeTransform } from '@angular/core';\nimport { locale } from 'moment';\n\nconst PHONE_WIDTH = 660;\n\n@Pipe({ name: 'formatCurrency' })\nexport class FormatCurrencyPipe implements PipeTransform {\n constructor(private readonly currency: CurrencyPipe) {}\n\n transform(amountInPennies: number, currency?: string): string {\n const minFractionDigits = screen.width < PHONE_WIDTH ? 0 : 2;\n const digitsInfo = `1.${minFractionDigits}-2`;\n return this.currency.transform(\n amountInPennies / 100,\n currency || getLocaleCurrencySymbol(locale()),\n 'symbol-narrow',\n digitsInfo,\n );\n }\n\n formatCurrencySymbol(currency: string): string {\n return this.currency.transform(0, currency, 'symbol-narrow').charAt(0);\n }\n}\n", "import { NgModule } from '@angular/core';\nimport { FormatCurrencyPipe } from './format-currency.pipe';\nimport { CurrencyPipe } from '@angular/common';\n\n@NgModule({\n imports: [],\n providers: [CurrencyPipe, FormatCurrencyPipe],\n declarations: [FormatCurrencyPipe],\n exports: [FormatCurrencyPipe],\n})\nexport class PreferredCurrencyModule {}\n"], "mappings": "iKAEA,IAAAA,EAAuB,OAEvB,IAAMC,EAAc,IAGPC,GAAkB,IAAA,CAAzB,IAAOA,EAAP,MAAOA,CAAkB,CAC7BC,YAA6BC,EAAsB,CAAtB,KAAAA,SAAAA,CAAyB,CAEtDC,UAAUC,EAAyBF,EAAiB,CAElD,IAAMG,EAAa,KADOC,OAAOC,MAAQR,EAAc,EAAI,CAClB,KACzC,OAAO,KAAKG,SAASC,UACnBC,EAAkB,IAClBF,GAAYM,KAAwBC,UAAM,CAAE,EAC5C,gBACAJ,CAAU,CAEd,CAEAK,qBAAqBR,EAAgB,CACnC,OAAO,KAAKA,SAASC,UAAU,EAAGD,EAAU,eAAe,EAAES,OAAO,CAAC,CACvE,yCAhBWX,GAAkBY,EAAAC,EAAA,EAAA,CAAA,CAAA,6CAAlBb,EAAkBc,KAAA,EAAA,CAAA,EAAzB,IAAOd,EAAPe,SAAOf,CAAkB,GAAA,ECG/B,IAAagB,GAAuB,IAAA,CAA9B,IAAOA,EAAP,MAAOA,CAAuB,yCAAvBA,EAAuB,sBAAvBA,CAAuB,CAAA,2BAJvB,CAACC,EAAcC,CAAkB,CAAC,CAAA,EAIzC,IAAOF,EAAPG,SAAOH,CAAuB,GAAA", "names": ["import_moment", "PHONE_WIDTH", "FormatCurrencyPipe", "constructor", "currency", "transform", "amountInPennies", "digitsInfo", "screen", "width", "getLocaleCurrencySymbol", "locale", "formatCurrencySymbol", "charAt", "\u0275\u0275directiveInject", "CurrencyPipe", "pure", "_FormatCurrencyPipe", "PreferredCurrencyModule", "CurrencyPipe", "FormatCurrencyPipe", "_PreferredCurrencyModule"] }