@roomstay/frontend 2.6.9 → 2.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -83,41 +83,7 @@ exports.default = CurrencyProvider;
83
83
  CurrencyProvider.labelOverrides = {};
84
84
  CurrencyProvider.currencies = {
85
85
  CAD: new Currency_1.Currency('CA$', 'Canadian Dollars', '$'),
86
- HKD: new Currency_1.Currency('HK$', 'Hong Kong Dollars', '$', {
87
- CAD: 0.176960404,
88
- HKD: 1,
89
- ISK: 17.4644168298,
90
- PHP: 6.5122123525,
91
- DKK: 0.8632841905,
92
- HUF: 40.3870429778,
93
- CZK: 3.1177690018,
94
- GBP: 0.1043325188,
95
- RON: 0.5616060778,
96
- SEK: 1.2145181651,
97
- IDR: 1884.222960844,
98
- INR: 9.7400604538,
99
- BRL: 0.6908636085,
100
- RUB: 9.0844615331,
101
- HRK: 0.8786639953,
102
- JPY: 13.8151875572,
103
- THB: 4.10251659,
104
- CHF: 0.124150231,
105
- EUR: 0.1158117827,
106
- MYR: 0.5606911647,
107
- BGN: 0.2265046846,
108
- TRY: 0.8813392475,
109
- CNY: 0.9201941005,
110
- NOK: 1.2493775117,
111
- NZD: 0.2068745874,
112
- ZAR: 2.2495164858,
113
- USD: 0.1289680012,
114
- MXN: 2.8454955007,
115
- SGD: 0.181963473,
116
- AUD: 0.1931856347,
117
- ILS: 0.4524187291,
118
- KRW: 159.3813334569,
119
- PLN: 0.5153045271,
120
- }),
86
+ HKD: new Currency_1.Currency('HK$', 'Hong Kong Dollars', '$'),
121
87
  // ISK: new Currency("Kr", "Iceland Kronur"),
122
88
  // PHP: new Currency("₱", "Philippine Pesos"),
123
89
  // DKK: new Currency("kr", "Danish Kroner"),
@@ -144,41 +110,7 @@ CurrencyProvider.currencies = {
144
110
  USD: new Currency_1.Currency('$', 'US Dollars'),
145
111
  // MXN: new Currency("MX$", "Mexican Pesos", "$"),
146
112
  SGD: new Currency_1.Currency('S$', 'Singapore Dollars', '$'),
147
- AUD: new Currency_1.Currency('A$', 'Australian Dollars', '$', {
148
- CAD: 0.923580786,
149
- HKD: 5.2259218826,
150
- ISK: 91.5817564289,
151
- PHP: 33.9319505095,
152
- DKK: 4.5214095099,
153
- HUF: 209.5160116448,
154
- CZK: 16.2900291121,
155
- GBP: 0.5438682678,
156
- RON: 2.9377122756,
157
- SEK: 6.3461305192,
158
- IDR: 9849.8786996604,
159
- INR: 50.9085395439,
160
- BRL: 3.5950994663,
161
- RUB: 46.9661572052,
162
- HRK: 4.6030446385,
163
- JPY: 72.62857836,
164
- THB: 21.3512857836,
165
- CHF: 0.6481077147,
166
- EUR: 0.6065016982,
167
- MYR: 2.9114507521,
168
- BGN: 1.1861960213,
169
- TRY: 4.5938258127,
170
- CNY: 4.8111960213,
171
- NOK: 6.5435468219,
172
- NZD: 1.0810286269,
173
- ZAR: 11.765708394,
174
- USD: 0.6741872877,
175
- MXN: 14.8301795245,
176
- SGD: 0.9503275109,
177
- AUD: 1,
178
- ILS: 2.362142164,
179
- KRW: 827.5351770985,
180
- PLN: 2.6854682193,
181
- }),
113
+ AUD: new Currency_1.Currency('A$', 'Australian Dollars', '$'),
182
114
  // ILS: new Currency("₪", "New Israeli Shekels"),
183
115
  // KRW: new Currency("₩", "South Korean Won"),
184
116
  // PLN: new Currency("zł", "Polish Złoty"),
@@ -1 +1 @@
1
- {"version":3,"file":"CurrencyProvider.js","sourceRoot":"/","sources":["src/providers/CurrencyProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kEAAmC;AACnC,2HAAwH;AACxH,gDAA6C;AAE7C,MAAqB,gBAAgB;IAmO1B,MAAM,CAAC,YAAY,CAAC,KAAa,EAAE,oBAA6B,EAAE,EAAU,EAAE,IAAY;QAC7F,MAAM,MAAM,GAAG,gBAAgB,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QAC/D,OAAO,oBAAoB,CAAC,CAAC,CAAC,gBAAgB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YAAY;QACjB,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,cAAc;QACnB,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,eAAe;QACpB,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,cAAc;QACnB,GAAG,EAAE,YAAY;KACpB,CAAC;IACF,iDAAiD;IACjD,8CAA8C;IAC9C,2CAA2C;IAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyHD;CACF,CAAC","sourcesContent":["import API from '@/api/BookingAPI';\nimport { FullPageBookingEngineElementEvents } from '@/engines/FullPageBookingEngine/FullPageBookingEngineElementEvents';\nimport { Currency } from '@/models/Currency';\n\nexport default class CurrencyProvider {\n public static labelOverrides: { [code: string]: { short: string; long: string } } = {};\n private static currencies: { [code: string]: Currency } = {\n CAD: new Currency('CA$', 'Canadian Dollars', '$'),\n HKD: new Currency('HK$', 'Hong Kong Dollars', '$', {\n CAD: 0.176960404,\n HKD: 1,\n ISK: 17.4644168298,\n PHP: 6.5122123525,\n DKK: 0.8632841905,\n HUF: 40.3870429778,\n CZK: 3.1177690018,\n GBP: 0.1043325188,\n RON: 0.5616060778,\n SEK: 1.2145181651,\n IDR: 1884.222960844,\n INR: 9.7400604538,\n BRL: 0.6908636085,\n RUB: 9.0844615331,\n HRK: 0.8786639953,\n JPY: 13.8151875572,\n THB: 4.10251659,\n CHF: 0.124150231,\n EUR: 0.1158117827,\n MYR: 0.5606911647,\n BGN: 0.2265046846,\n TRY: 0.8813392475,\n CNY: 0.9201941005,\n NOK: 1.2493775117,\n NZD: 0.2068745874,\n ZAR: 2.2495164858,\n USD: 0.1289680012,\n MXN: 2.8454955007,\n SGD: 0.181963473,\n AUD: 0.1931856347,\n ILS: 0.4524187291,\n KRW: 159.3813334569,\n PLN: 0.5153045271,\n }),\n // ISK: new Currency(\"Kr\", \"Iceland Kronur\"),\n // PHP: new Currency(\"₱\", \"Philippine Pesos\"),\n // DKK: new Currency(\"kr\", \"Danish Kroner\"),\n // HUF: new Currency(\"Ft\", \"Hungarian Forint\"),\n // CZK: new Currency(\"Kč\", \"Czech Koruna\"),\n GBP: new Currency('£', 'British Pounds'),\n // RON: new Currency(\"L\", \"Romania New Lei\"),\n // SEK: new Currency(\"kr\", \"Swedish Kronor\"),\n IDR: new Currency('Rp', 'Indonesian Rupiahs'),\n INR: new Currency('₹', 'Indian Rupees'),\n // BRL: new Currency(\"R$\", \"Brazilian Reals\"),\n // RUB: new Currency(\"р.\", \"Russian Rubles\"),\n // HRK: new Currency(\"Kn\", \"Croatian Kuna\"),\n JPY: new Currency('¥', 'Japanese Yen'),\n // THB: new Currency(\"฿\", \"Thai Baht\"),\n // CHF: new Currency(\"₣\", \"Swiss Francs\"),\n EUR: new Currency('€', 'Euros'),\n // BGN: new Currency(\"Лв\", \"Bulgarian Leva\"),\n // TRY: new Currency(\"₺\", \"Turkish Lira\"),\n CNY: new Currency('¥', 'Chinese Yuan'),\n // NOK: new Currency(\"kr\", \"Norwegian Kroner\"),\n NZD: new Currency('NZ$', 'New Zealand Dollars', '$'),\n // ZAR: new Currency(\"R\", \"South African Rand\"),\n USD: new Currency('$', 'US Dollars'),\n // MXN: new Currency(\"MX$\", \"Mexican Pesos\", \"$\"),\n SGD: new Currency('S$', 'Singapore Dollars', '$'),\n AUD: new Currency('A$', 'Australian Dollars', '$', {\n CAD: 0.923580786,\n HKD: 5.2259218826,\n ISK: 91.5817564289,\n PHP: 33.9319505095,\n DKK: 4.5214095099,\n HUF: 209.5160116448,\n CZK: 16.2900291121,\n GBP: 0.5438682678,\n RON: 2.9377122756,\n SEK: 6.3461305192,\n IDR: 9849.8786996604,\n INR: 50.9085395439,\n BRL: 3.5950994663,\n RUB: 46.9661572052,\n HRK: 4.6030446385,\n JPY: 72.62857836,\n THB: 21.3512857836,\n CHF: 0.6481077147,\n EUR: 0.6065016982,\n MYR: 2.9114507521,\n BGN: 1.1861960213,\n TRY: 4.5938258127,\n CNY: 4.8111960213,\n NOK: 6.5435468219,\n NZD: 1.0810286269,\n ZAR: 11.765708394,\n USD: 0.6741872877,\n MXN: 14.8301795245,\n SGD: 0.9503275109,\n AUD: 1,\n ILS: 2.362142164,\n KRW: 827.5351770985,\n PLN: 2.6854682193,\n }),\n // ILS: new Currency(\"₪\", \"New Israeli Shekels\"),\n // KRW: new Currency(\"₩\", \"South Korean Won\"),\n // PLN: new Currency(\"zł\", \"Polish Złoty\"),\n /*\n * The following currencies are currently excluded as the exchange rate API doesn't return them\n AED: new Currency(\"د.إ\", \"UAE Dirham\"),\n AFN: new Currency(\"Af\", \"Afghani\"),\n ALL: new Currency(\"L\", \"Lek\"),\n AMD: new Currency(\"Դ\", \"Armenian Dram\"),\n AOA: new Currency(\"Kz\", \"Kwanza\"),\n ARS: new Currency(\"$\", \"Argentine Peso\"),\n AWG: new Currency(\"ƒ\", \"Aruban Guilder/Florin\"),\n AZN: new Currency(\"ман\", \"Azerbaijanian Manat\"),\n BAM: new Currency(\"КМ\", \"Konvertibilna Marka\"),\n BBD: new Currency(\"$\", \"Barbados Dollar\"),\n BDT: new Currency(\"৳\", \"Taka\"),\n BHD: new Currency(\"ب.د\", \"Bahraini Dinar\"),\n BIF: new Currency(\"₣\", \"Burundi Franc\"),\n BMD: new Currency(\"$\", \"Bermudian Dollar\"),\n BND: new Currency(\"$\", \"Brunei Dollar\"),\n BOB: new Currency(\"Bs.\", \"Boliviano\"),\n BSD: new Currency(\"$\", \"Bahamian Dollar\"),\n BTN: new Currency(\"\", \"Ngultrum\"),\n BWP: new Currency(\"P\", \"Pula\"),\n BYN: new Currency(\"Br\", \"Belarusian Ruble\"),\n BZD: new Currency(\"$\", \"Belize Dollar\"),\n CDF: new Currency(\"₣\", \"Congolese Franc\"),\n CLP: new Currency(\"$\", \"Chilean Peso\"),\n COP: new Currency(\"$\", \"Colombian Peso\"),\n CRC: new Currency(\"₡\", \"Costa Rican Colon\"),\n CUP: new Currency(\"$\", \"Cuban Peso\"),\n CVE: new Currency(\"$\", \"Cape Verde Escudo\"),\n DJF: new Currency(\"₣\", \"Djibouti Franc\"),\n DOP: new Currency(\"$\", \"Dominican Peso\"),\n DZD: new Currency(\"د.ج\", \"Algerian Dinar\"),\n EGP: new Currency(\"£\", \"Egyptian Pound\"),\n ERN: new Currency(\"Nfk\", \"Nakfa\"),\n ETB: new Currency(\"\", \"Ethiopian Birr\"),\n FJD: new Currency(\"$\", \"Fiji Dollar\"),\n FKP: new Currency(\"£\", \"Falkland Islands Pound\"),\n GEL: new Currency(\"ლ\", \"Lari\"),\n GHS: new Currency(\"₵\", \"Cedi\"),\n GIP: new Currency(\"£\", \"Gibraltar Pound\"),\n GMD: new Currency(\"D\", \"Dalasi\"),\n GNF: new Currency(\"₣\", \"Guinea Franc\"),\n GTQ: new Currency(\"Q\", \"Quetzal\"),\n GYD: new Currency(\"$\", \"Guyana Dollar\"),\n HNL: new Currency(\"L\", \"Lempira\"),\n HTG: new Currency(\"G\", \"Gourde\"),\n IQD: new Currency(\"ع.د\", \"Iraqi Dinar\"),\n IRR: new Currency(\"﷼\", \"Iranian Rial\"),\n JMD: new Currency(\"$\", \"Jamaican Dollar\"),\n JOD: new Currency(\"د.ا\", \"Jordanian Dinar\"),\n KES: new Currency(\"Sh\", \"Kenyan Shilling\"),\n KGS: new Currency(\"\", \"Som\"),\n KHR: new Currency(\"៛\", \"Riel\"),\n KPW: new Currency(\"₩\", \"North Korean Won\"),\n KWD: new Currency(\"د.ك\", \"Kuwaiti Dinar\"),\n KYD: new Currency(\"$\", \"Cayman Islands Dollar\"),\n KZT: new Currency(\"〒\", \"Tenge\"),\n LAK: new Currency(\"₭\", \"Kip\"),\n LBP: new Currency(\"ل.ل\", \"Lebanese Pound\"),\n LKR: new Currency(\"Rs\", \"Sri Lanka Rupee\"),\n LRD: new Currency(\"$\", \"Liberian Dollar\"),\n LSL: new Currency(\"L\", \"Loti\"),\n LYD: new Currency(\"ل.د\", \"Libyan Dinar\"),\n MAD: new Currency(\"د.م.\", \"Moroccan Dirham\"),\n MDL: new Currency(\"L\", \"Moldovan Leu\"),\n MGA: new Currency(\"\", \"Malagasy Ariary\"),\n MKD: new Currency(\"ден\", \"Denar\"),\n MMK: new Currency(\"K\", \"Kyat\"),\n MNT: new Currency(\"₮\", \"Tugrik\"),\n MOP: new Currency(\"P\", \"Pataca\"),\n MRU: new Currency(\"UM\", \"Ouguiya\"),\n MUR: new Currency(\"₨\", \"Mauritius Rupee\"),\n MVR: new Currency(\"ރ.\", \"Rufiyaa\"),\n MWK: new Currency(\"MK\", \"Kwacha\"),\n MYR: new Currency(\"RM\", \"Malaysian Ringgit\"),\n MZN: new Currency(\"MTn\", \"Metical\"),\n NAD: new Currency(\"$\", \"Namibia Dollar\"),\n NGN: new Currency(\"₦\", \"Naira\"),\n NIO: new Currency(\"C$\", \"Cordoba Oro\"),\n NPR: new Currency(\"₨\", \"Nepalese Rupee\"),\n OMR: new Currency(\"ر.ع.\", \"Rial Omani\"),\n PAB: new Currency(\"B/.\", \"Balboa\"),\n PEN: new Currency(\"S/.\", \"Nuevo Sol\"),\n PGK: new Currency(\"K\", \"Kina\"),\n PKR: new Currency(\"₨\", \"Pakistan Rupee\"),\n PYG: new Currency(\"₲\", \"Guarani\"),\n QAR: new Currency(\"ر.ق\", \"Qatari Rial\"),\n RSD: new Currency(\"din\", \"Serbian Dinar\"),\n RWF: new Currency(\"₣\", \"Rwanda Franc\"),\n SAR: new Currency(\"ر.س\", \"Saudi Riyal\"),\n SBD: new Currency(\"$\", \"Solomon Islands Dollar\"),\n SCR: new Currency(\"₨\", \"Seychelles Rupee\"),\n SDG: new Currency(\"£\", \"Sudanese Pound\"),\n SHP: new Currency(\"£\", \"Saint Helena Pound\"),\n SLL: new Currency(\"Le\", \"Leone\"),\n SOS: new Currency(\"Sh\", \"Somali Shilling\"),\n SRD: new Currency(\"$\", \"Suriname Dollar\"),\n STN: new Currency(\"Db\", \"Dobra\"),\n SYP: new Currency(\"ل.س\", \"Syrian Pound\"),\n SZL: new Currency(\"L\", \"Lilangeni\"),\n TJS: new Currency(\"ЅМ\", \"Somoni\"),\n TMT: new Currency(\"m\", \"Manat\"),\n TND: new Currency(\"د.ت\", \"Tunisian Dinar\"),\n TOP: new Currency(\"T$\", \"Pa’anga\"),\n TTD: new Currency(\"$\", \"Trinidad and Tobago Dollar\"),\n TWD: new Currency(\"$\", \"Taiwan Dollar\"),\n TZS: new Currency(\"Sh\", \"Tanzanian Shilling\"),\n UAH: new Currency(\"₴\", \"Hryvnia\"),\n UGX: new Currency(\"Sh\", \"Uganda Shilling\"),\n UYU: new Currency(\"$\", \"Peso Uruguayo\"),\n UZS: new Currency(\"\", \"Uzbekistan Sum\"),\n VEF: new Currency(\"Bs F\", \"Bolivar Fuerte\"),\n VND: new Currency(\"₫\", \"Dong\"),\n VUV: new Currency(\"Vt\", \"Vatu\"),\n WST: new Currency(\"T\", \"Tala\"),\n XAF: new Currency(\"₣\", \"CFA Franc BCEAO\"),\n XCD: new Currency(\"$\", \"East Caribbean Dollar\"),\n XPF: new Currency(\"₣\", \"CFP Franc\"),\n YER: new Currency(\"﷼\", \"Yemeni Rial\"),\n ZMW: new Currency(\"ZK\", \"Zambian Kwacha\"),\n ZWL: new Currency(\"$\", \"Zimbabwe Dollar\"),\n */\n };\n\n public static convertPrice(price: number, includeDecimalPlaces: boolean, to: string, from: string): number {\n const amount = CurrencyProvider._convertPrice(price, to, from);\n return includeDecimalPlaces ? CurrencyProvider.preciseRound(amount, 2) : Math.round(amount);\n }\n\n static async loadExchangeRates(currencyCode: string) {\n const currency = CurrencyProvider.currencies[currencyCode];\n if (!currency) {\n throw new Error(currencyCode + ' is not a supported currency code');\n }\n if (currency.rates) {\n return;\n }\n\n await API.ExchangeRate.fetchData(currencyCode).then((rates) => {\n currency.rates = rates;\n });\n\n FullPageBookingEngineElementEvents.reload(); // HMM\n }\n\n static getRatesForCurrencyCode(code: string) {\n return CurrencyProvider.currencies[code]?.rates;\n }\n\n static getCurrencyItems() {\n const currencies: { text: string; value: string }[] = Object.keys(CurrencyProvider.currencies).map((code) => ({\n text: code + ' - ' + CurrencyProvider.currencies[code].name,\n value: code,\n }));\n\n return currencies.sort((a, b) => a.value.localeCompare(b.value));\n }\n\n static getSymbol(currencyCode: string) {\n if (CurrencyProvider.labelOverrides[currencyCode]?.long) {\n return CurrencyProvider.labelOverrides[currencyCode]?.long;\n }\n\n return CurrencyProvider.currencies[currencyCode]?.symbol ?? '';\n }\n\n static getShortSymbol(currencyCode: string) {\n if (CurrencyProvider.labelOverrides[currencyCode]?.short) {\n return CurrencyProvider.labelOverrides[currencyCode]?.short;\n }\n\n return CurrencyProvider.currencies[currencyCode]?.shortSymbol ?? '';\n }\n\n private static preciseRound(num: number, decimals: number): number {\n const factor = Math.pow(10, decimals);\n const sign = num < 0 ? -1 : num > 0 ? 1 : 0;\n return Math.round(num * factor + (decimals > 0 ? 1 : 0) * (sign * (10 / Math.pow(100, decimals)))) / factor;\n }\n\n private static _convertPrice(price: number, to: string, from: string) {\n if (typeof price !== 'number') {\n price = parseFloat(price);\n }\n\n if (to === from) {\n return price;\n }\n\n if (!CurrencyProvider.currencies[from]?.rates) {\n this.loadExchangeRates(from);\n }\n\n return price * (CurrencyProvider.currencies[from]?.rates?.[to] ?? 1);\n }\n}\n"]}
1
+ {"version":3,"file":"CurrencyProvider.js","sourceRoot":"/","sources":["src/providers/CurrencyProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kEAAmC;AACnC,2HAAwH;AACxH,gDAA6C;AAE7C,MAAqB,gBAAgB;IA+J1B,MAAM,CAAC,YAAY,CAAC,KAAa,EAAE,oBAA6B,EAAE,EAAU,EAAE,IAAY;QAC7F,MAAM,MAAM,GAAG,gBAAgB,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QAC/D,OAAO,oBAAoB,CAAC,CAAC,CAAC,gBAAgB,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChG,CAAC;IAED,MAAM,CAAO,iBAAiB,CAAC,YAAoB;;YAC/C,MAAM,QAAQ,GAAG,gBAAgB,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;YAC3D,IAAI,CAAC,QAAQ,EAAE;gBACX,MAAM,IAAI,KAAK,CAAC,YAAY,GAAG,mCAAmC,CAAC,CAAC;aACvE;YACD,IAAI,QAAQ,CAAC,KAAK,EAAE;gBAChB,OAAO;aACV;YAED,MAAM,oBAAG,CAAC,YAAY,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC1D,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;YAC3B,CAAC,CAAC,CAAC;YAEH,uEAAkC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM;QACvD,CAAC;KAAA;IAED,MAAM,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ageBookingEngineElementEvents } from '@/engines/FullPageBookingEngine/FullPageBookingEngineElementEvents';\nimport { Currency } from '@/models/Currency';\n\nexport default class CurrencyProvider {\n public static labelOverrides: { [code: string]: { short: string; long: string } } = {};\n private static currencies: { [code: string]: Currency } = {\n CAD: new Currency('CA$', 'Canadian Dollars', '$'),\n HKD: new Currency('HK$', 'Hong Kong Dollars', '$'),\n // ISK: new Currency(\"Kr\", \"Iceland Kronur\"),\n // PHP: new Currency(\"₱\", \"Philippine Pesos\"),\n // DKK: new Currency(\"kr\", \"Danish Kroner\"),\n // HUF: new Currency(\"Ft\", \"Hungarian Forint\"),\n // CZK: new Currency(\"Kč\", \"Czech Koruna\"),\n GBP: new Currency('£', 'British Pounds'),\n // RON: new Currency(\"L\", \"Romania New Lei\"),\n // SEK: new Currency(\"kr\", \"Swedish Kronor\"),\n IDR: new Currency('Rp', 'Indonesian Rupiahs'),\n INR: new Currency('₹', 'Indian Rupees'),\n // BRL: new Currency(\"R$\", \"Brazilian Reals\"),\n // RUB: new Currency(\"р.\", \"Russian Rubles\"),\n // HRK: new Currency(\"Kn\", \"Croatian Kuna\"),\n JPY: new Currency('¥', 'Japanese Yen'),\n // THB: new Currency(\"฿\", \"Thai Baht\"),\n // CHF: new Currency(\"₣\", \"Swiss Francs\"),\n EUR: new Currency('€', 'Euros'),\n // BGN: new Currency(\"Лв\", \"Bulgarian Leva\"),\n // TRY: new Currency(\"₺\", \"Turkish Lira\"),\n CNY: new Currency('¥', 'Chinese Yuan'),\n // NOK: new Currency(\"kr\", \"Norwegian Kroner\"),\n NZD: new Currency('NZ$', 'New Zealand Dollars', '$'),\n // ZAR: new Currency(\"R\", \"South African Rand\"),\n USD: new Currency('$', 'US Dollars'),\n // MXN: new Currency(\"MX$\", \"Mexican Pesos\", \"$\"),\n SGD: new Currency('S$', 'Singapore Dollars', '$'),\n AUD: new Currency('A$', 'Australian Dollars', '$'),\n // ILS: new Currency(\"₪\", \"New Israeli Shekels\"),\n // KRW: new Currency(\"₩\", \"South Korean Won\"),\n // PLN: new Currency(\"zł\", \"Polish Złoty\"),\n /*\n * The following currencies are currently excluded as the exchange rate API doesn't return them\n AED: new Currency(\"د.إ\", \"UAE Dirham\"),\n AFN: new Currency(\"Af\", \"Afghani\"),\n ALL: new Currency(\"L\", \"Lek\"),\n AMD: new Currency(\"Դ\", \"Armenian Dram\"),\n AOA: new Currency(\"Kz\", \"Kwanza\"),\n ARS: new Currency(\"$\", \"Argentine Peso\"),\n AWG: new Currency(\"ƒ\", \"Aruban Guilder/Florin\"),\n AZN: new Currency(\"ман\", \"Azerbaijanian Manat\"),\n BAM: new Currency(\"КМ\", \"Konvertibilna Marka\"),\n BBD: new Currency(\"$\", \"Barbados Dollar\"),\n BDT: new Currency(\"৳\", \"Taka\"),\n BHD: new Currency(\"ب.د\", \"Bahraini Dinar\"),\n BIF: new Currency(\"₣\", \"Burundi Franc\"),\n BMD: new Currency(\"$\", \"Bermudian Dollar\"),\n BND: new Currency(\"$\", \"Brunei Dollar\"),\n BOB: new Currency(\"Bs.\", \"Boliviano\"),\n BSD: new Currency(\"$\", \"Bahamian Dollar\"),\n BTN: new Currency(\"\", \"Ngultrum\"),\n BWP: new Currency(\"P\", \"Pula\"),\n BYN: new Currency(\"Br\", \"Belarusian Ruble\"),\n BZD: new Currency(\"$\", \"Belize Dollar\"),\n CDF: new Currency(\"₣\", \"Congolese Franc\"),\n CLP: new Currency(\"$\", \"Chilean Peso\"),\n COP: new Currency(\"$\", \"Colombian Peso\"),\n CRC: new Currency(\"₡\", \"Costa Rican Colon\"),\n CUP: new Currency(\"$\", \"Cuban Peso\"),\n CVE: new Currency(\"$\", \"Cape Verde Escudo\"),\n DJF: new Currency(\"₣\", \"Djibouti Franc\"),\n DOP: new Currency(\"$\", \"Dominican Peso\"),\n DZD: new Currency(\"د.ج\", \"Algerian Dinar\"),\n EGP: new Currency(\"£\", \"Egyptian Pound\"),\n ERN: new Currency(\"Nfk\", \"Nakfa\"),\n ETB: new Currency(\"\", \"Ethiopian Birr\"),\n FJD: new Currency(\"$\", \"Fiji Dollar\"),\n FKP: new Currency(\"£\", \"Falkland Islands Pound\"),\n GEL: new Currency(\"ლ\", \"Lari\"),\n GHS: new Currency(\"₵\", \"Cedi\"),\n GIP: new Currency(\"£\", \"Gibraltar Pound\"),\n GMD: new Currency(\"D\", \"Dalasi\"),\n GNF: new Currency(\"₣\", \"Guinea Franc\"),\n GTQ: new Currency(\"Q\", \"Quetzal\"),\n GYD: new Currency(\"$\", \"Guyana Dollar\"),\n HNL: new Currency(\"L\", \"Lempira\"),\n HTG: new Currency(\"G\", \"Gourde\"),\n IQD: new Currency(\"ع.د\", \"Iraqi Dinar\"),\n IRR: new Currency(\"﷼\", \"Iranian Rial\"),\n JMD: new Currency(\"$\", \"Jamaican Dollar\"),\n JOD: new Currency(\"د.ا\", \"Jordanian Dinar\"),\n KES: new Currency(\"Sh\", \"Kenyan Shilling\"),\n KGS: new Currency(\"\", \"Som\"),\n KHR: new Currency(\"៛\", \"Riel\"),\n KPW: new Currency(\"₩\", \"North Korean Won\"),\n KWD: new Currency(\"د.ك\", \"Kuwaiti Dinar\"),\n KYD: new Currency(\"$\", \"Cayman Islands Dollar\"),\n KZT: new Currency(\"〒\", \"Tenge\"),\n LAK: new Currency(\"₭\", \"Kip\"),\n LBP: new Currency(\"ل.ل\", \"Lebanese Pound\"),\n LKR: new Currency(\"Rs\", \"Sri Lanka Rupee\"),\n LRD: new Currency(\"$\", \"Liberian Dollar\"),\n LSL: new Currency(\"L\", \"Loti\"),\n LYD: new Currency(\"ل.د\", \"Libyan Dinar\"),\n MAD: new Currency(\"د.م.\", \"Moroccan Dirham\"),\n MDL: new Currency(\"L\", \"Moldovan Leu\"),\n MGA: new Currency(\"\", \"Malagasy Ariary\"),\n MKD: new Currency(\"ден\", \"Denar\"),\n MMK: new Currency(\"K\", \"Kyat\"),\n MNT: new Currency(\"₮\", \"Tugrik\"),\n MOP: new Currency(\"P\", \"Pataca\"),\n MRU: new Currency(\"UM\", \"Ouguiya\"),\n MUR: new Currency(\"₨\", \"Mauritius Rupee\"),\n MVR: new Currency(\"ރ.\", \"Rufiyaa\"),\n MWK: new Currency(\"MK\", \"Kwacha\"),\n MYR: new Currency(\"RM\", \"Malaysian Ringgit\"),\n MZN: new Currency(\"MTn\", \"Metical\"),\n NAD: new Currency(\"$\", \"Namibia Dollar\"),\n NGN: new Currency(\"₦\", \"Naira\"),\n NIO: new Currency(\"C$\", \"Cordoba Oro\"),\n NPR: new Currency(\"₨\", \"Nepalese Rupee\"),\n OMR: new Currency(\"ر.ع.\", \"Rial Omani\"),\n PAB: new Currency(\"B/.\", \"Balboa\"),\n PEN: new Currency(\"S/.\", \"Nuevo Sol\"),\n PGK: new Currency(\"K\", \"Kina\"),\n PKR: new Currency(\"₨\", \"Pakistan Rupee\"),\n PYG: new Currency(\"₲\", \"Guarani\"),\n QAR: new Currency(\"ر.ق\", \"Qatari Rial\"),\n RSD: new Currency(\"din\", \"Serbian Dinar\"),\n RWF: new Currency(\"₣\", \"Rwanda Franc\"),\n SAR: new Currency(\"ر.س\", \"Saudi Riyal\"),\n SBD: new Currency(\"$\", \"Solomon Islands Dollar\"),\n SCR: new Currency(\"₨\", \"Seychelles Rupee\"),\n SDG: new Currency(\"£\", \"Sudanese Pound\"),\n SHP: new Currency(\"£\", \"Saint Helena Pound\"),\n SLL: new Currency(\"Le\", \"Leone\"),\n SOS: new Currency(\"Sh\", \"Somali Shilling\"),\n SRD: new Currency(\"$\", \"Suriname Dollar\"),\n STN: new Currency(\"Db\", \"Dobra\"),\n SYP: new Currency(\"ل.س\", \"Syrian Pound\"),\n SZL: new Currency(\"L\", \"Lilangeni\"),\n TJS: new Currency(\"ЅМ\", \"Somoni\"),\n TMT: new Currency(\"m\", \"Manat\"),\n TND: new Currency(\"د.ت\", \"Tunisian Dinar\"),\n TOP: new Currency(\"T$\", \"Pa’anga\"),\n TTD: new Currency(\"$\", \"Trinidad and Tobago Dollar\"),\n TWD: new Currency(\"$\", \"Taiwan Dollar\"),\n TZS: new Currency(\"Sh\", \"Tanzanian Shilling\"),\n UAH: new Currency(\"₴\", \"Hryvnia\"),\n UGX: new Currency(\"Sh\", \"Uganda Shilling\"),\n UYU: new Currency(\"$\", \"Peso Uruguayo\"),\n UZS: new Currency(\"\", \"Uzbekistan Sum\"),\n VEF: new Currency(\"Bs F\", \"Bolivar Fuerte\"),\n VND: new Currency(\"₫\", \"Dong\"),\n VUV: new Currency(\"Vt\", \"Vatu\"),\n WST: new Currency(\"T\", \"Tala\"),\n XAF: new Currency(\"₣\", \"CFA Franc BCEAO\"),\n XCD: new Currency(\"$\", \"East Caribbean Dollar\"),\n XPF: new Currency(\"₣\", \"CFP Franc\"),\n YER: new Currency(\"﷼\", \"Yemeni Rial\"),\n ZMW: new Currency(\"ZK\", \"Zambian Kwacha\"),\n ZWL: new Currency(\"$\", \"Zimbabwe Dollar\"),\n */\n };\n\n public static convertPrice(price: number, includeDecimalPlaces: boolean, to: string, from: string): number {\n const amount = CurrencyProvider._convertPrice(price, to, from);\n return includeDecimalPlaces ? CurrencyProvider.preciseRound(amount, 2) : Math.round(amount);\n }\n\n static async loadExchangeRates(currencyCode: string) {\n const currency = CurrencyProvider.currencies[currencyCode];\n if (!currency) {\n throw new Error(currencyCode + ' is not a supported currency code');\n }\n if (currency.rates) {\n return;\n }\n\n await API.ExchangeRate.fetchData(currencyCode).then((rates) => {\n currency.rates = rates;\n });\n\n FullPageBookingEngineElementEvents.reload(); // HMM\n }\n\n static getRatesForCurrencyCode(code: string) {\n return CurrencyProvider.currencies[code]?.rates;\n }\n\n static getCurrencyItems() {\n const currencies: { text: string; value: string }[] = Object.keys(CurrencyProvider.currencies).map((code) => ({\n text: code + ' - ' + CurrencyProvider.currencies[code].name,\n value: code,\n }));\n\n return currencies.sort((a, b) => a.value.localeCompare(b.value));\n }\n\n static getSymbol(currencyCode: string) {\n if (CurrencyProvider.labelOverrides[currencyCode]?.long) {\n return CurrencyProvider.labelOverrides[currencyCode]?.long;\n }\n\n return CurrencyProvider.currencies[currencyCode]?.symbol ?? '';\n }\n\n static getShortSymbol(currencyCode: string) {\n if (CurrencyProvider.labelOverrides[currencyCode]?.short) {\n return CurrencyProvider.labelOverrides[currencyCode]?.short;\n }\n\n return CurrencyProvider.currencies[currencyCode]?.shortSymbol ?? '';\n }\n\n private static preciseRound(num: number, decimals: number): number {\n const factor = Math.pow(10, decimals);\n const sign = num < 0 ? -1 : num > 0 ? 1 : 0;\n return Math.round(num * factor + (decimals > 0 ? 1 : 0) * (sign * (10 / Math.pow(100, decimals)))) / factor;\n }\n\n private static _convertPrice(price: number, to: string, from: string) {\n if (typeof price !== 'number') {\n price = parseFloat(price);\n }\n\n if (to === from) {\n return price;\n }\n\n if (!CurrencyProvider.currencies[from]?.rates) {\n this.loadExchangeRates(from);\n }\n\n return price * (CurrencyProvider.currencies[from]?.rates?.[to] ?? 1);\n }\n}\n"]}