@roomstay/frontend 2.6.63 → 2.6.65
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.
- package/dist/279.bundle.js +1 -1
- package/dist/288.bundle.js +1 -1
- package/dist/370.bundle.js +1 -1
- package/dist/449.bundle.js +1 -1
- package/dist/537.bundle.js +1 -1
- package/dist/839.bundle.js +1 -1
- package/dist/873.bundle.js +1 -1
- package/dist/903.bundle.js +1 -1
- package/dist/950.bundle.js +1 -1
- package/dist/972.bundle.js +1 -1
- package/dist/978.bundle.js +1 -1
- package/dist/main.bundle.js +1 -1
- package/dist/src/api/BaseAPI.js +5 -10
- package/dist/src/api/BaseAPI.js.map +1 -1
- package/dist/src/components/User/Forms/SignUpForm.d.ts +2 -0
- package/dist/src/components/User/Forms/SignUpForm.js +14 -6
- package/dist/src/components/User/Forms/SignUpForm.js.map +1 -1
- package/dist/src/components/generic/InputGroup/InputGroup.d.ts +1 -0
- package/dist/src/components/generic/InputGroup/InputGroup.js +1 -0
- package/dist/src/components/generic/InputGroup/InputGroup.js.map +1 -1
- package/dist/src/components/generic/modal/SigninModal/FormContent/SignUpFormContent.js.map +1 -1
- package/dist/src/components/members/SignInModal/MemberPortalSignInModal.d.ts +8 -0
- package/dist/src/components/members/SignInModal/MemberPortalSignInModal.js +150 -0
- package/dist/src/components/members/SignInModal/MemberPortalSignInModal.js.map +1 -0
- package/dist/src/components/members/SignInModal/MemberSignInModal.js +2 -2
- package/dist/src/components/members/SignInModal/MemberSignInModal.js.map +1 -1
- package/dist/src/components/steps/room/LargeRoomCard.js +7 -0
- package/dist/src/components/steps/room/LargeRoomCard.js.map +1 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetails.js +1 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetails.js.map +1 -1
- package/dist/src/components/steps/room/roomDetails/RoomDetailsBedsBlock.js +12 -7
- package/dist/src/components/steps/room/roomDetails/RoomDetailsBedsBlock.js.map +1 -1
- package/dist/src/components/summary/BEMapWidget.js +1 -1
- package/dist/src/components/summary/BEMapWidget.js.map +1 -1
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextTypes.d.ts +5 -4
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextTypes.js.map +1 -1
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js +32 -14
- package/dist/src/contexts/FullPageEngineContext/FullPageEngineContextWrapper.js.map +1 -1
- package/dist/src/contexts/Members/AuthenticationContext/AuthenticationContextProvider.js +1 -0
- package/dist/src/contexts/Members/AuthenticationContext/AuthenticationContextProvider.js.map +1 -1
- package/dist/src/models/Api/HotelDTO.d.ts +1 -0
- package/dist/src/models/Api/HotelDTO.js.map +1 -1
- package/dist/src/models/AppQueryParameters.d.ts +2 -1
- package/dist/src/models/AppQueryParameters.js +1 -0
- package/dist/src/models/AppQueryParameters.js.map +1 -1
- package/dist/src/models/Client/Hotel/Hotel.d.ts +1 -0
- package/dist/src/models/Client/Hotel/Hotel.js.map +1 -1
- package/dist/src/providers/CurrencyProvider.js +1 -1
- package/dist/src/providers/CurrencyProvider.js.map +1 -1
- package/dist/src/translations/Translation.d.ts +1 -0
- package/dist/src/translations/Translation.js +1 -0
- package/dist/src/translations/Translation.js.map +1 -1
- package/dist/src/translations/languages/en-gb.js +1 -0
- package/dist/src/translations/languages/en-gb.js.map +1 -1
- package/dist/src/util/CurrencyHelper.js +1 -1
- package/dist/src/util/CurrencyHelper.js.map +1 -1
- package/dist/test.bundle.js +1 -1
- package/dist/vendors.bundle.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyHelper.js","sourceRoot":"/","sources":["src/util/CurrencyHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kEAAmC;AACnC,2HAAwH;AACxH,gDAA6C;AAE7C,MAAM,UAAU,GAAiC;IAC7C,GAAG,EAAE,IAAI,mBAAQ,CAAC,KAAK,EAAE,kBAAkB,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/BookingAPI';\nimport { FullPageBookingEngineElementEvents } from '@/engines/FullPageBookingEngine/FullPageBookingEngineElementEvents';\nimport { Currency } from '@/models/Currency';\n\nconst 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\nconst labelOverrides: { [code: string]: { short: string; long: string } } = {};\n\nexport const convertPrice = (price: number, includeDecimalPlaces: boolean, to: string, from: string): number => {\n const amount = _convertPrice(price, to, from);\n return includeDecimalPlaces ? preciseRound(amount, 2) : Math.round(amount);\n};\n\nconst 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\nconst _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 (!currencies[from]?.rates) {\n loadExchangeRates(from);\n }\n\n return price * (currencies[from]?.rates?.[to] ?? 1);\n};\n\nexport const loadExchangeRates = async (currencyCode: string) => {\n const currency = 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\nexport const getRatesForCurrencyCode = (code: string) => {\n return currencies[code]?.rates;\n};\n\nexport const getCurrencyItems = () => {\n const currencyItems: { text: string; value: string }[] = Object.keys(currencies).map((code) => ({\n text: code + ' - ' + currencies[code].name,\n value: code,\n }));\n\n return currencyItems.sort((a, b) => a.value.localeCompare(b.value));\n};\n\nexport const getCurrencySymbol = (currencyCode: string) => {\n if (labelOverrides[currencyCode]?.long) {\n return labelOverrides[currencyCode]?.long;\n }\n\n return currencies[currencyCode]?.symbol ?? '';\n};\n\nexport const getCurrencyShortSymbol = (currencyCode: string) => {\n if (labelOverrides[currencyCode]?.short) {\n return labelOverrides[currencyCode]?.short;\n }\n\n return currencies[currencyCode]?.shortSymbol ?? '';\n};\n"]}
|
|
1
|
+
{"version":3,"file":"CurrencyHelper.js","sourceRoot":"/","sources":["src/util/CurrencyHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kEAAmC;AACnC,2HAAwH;AACxH,gDAA6C;AAE7C,MAAM,UAAU,GAAiC;IAC7C,GAAG,EAAE,IAAI,mBAAQ,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,CAAC;IACjD,GAAG,EAAE,IAAI,mBAAQ,CAAC,KAAK,EAAE,mBAAmB,EAAE,GAAG,EAAE;QAC/C,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,cAAc;QACnB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,UAAU;QACf,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,Y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O3B;AAEK,MAAM,iBAAiB,GAAG,CAAC,YAAoB,EAAE,EAAE;;IACtD,IAAI,MAAA,cAAc,CAAC,YAAY,CAAC,0CAAE,IAAI,EAAE;QACpC,OAAO,MAAA,cAAc,CAAC,YAAY,CAAC,0CAAE,IAAI,CAAC;KAC7C;IAED,OAAO,MAAA,MAAA,UAAU,CAAC,YAAY,CAAC,0CAAE,MAAM,mCAAI,EAAE,CAAC;AAClD,CAAC,CAAC;AANW,QAAA,iBAAiB,qBAM5B;AAEK,MAAM,sBAAsB,GAAG,CAAC,YAAoB,EAAE,EAAE;;IAC3D,IAAI,MAAA,cAAc,CAAC,YAAY,CAAC,0CAAE,KAAK,EAAE;QACrC,OAAO,MAAA,cAAc,CAAC,YAAY,CAAC,0CAAE,KAAK,CAAC;KAC9C;IAED,OAAO,MAAA,MAAA,UAAU,CAAC,YAAY,CAAC,0CAAE,WAAW,mCAAI,EAAE,CAAC;AACvD,CAAC,CAAC;AANW,QAAA,sBAAsB,0BAMjC","sourcesContent":["import API from '@/api/BookingAPI';\nimport { FullPageBookingEngineElementEvents } from '@/engines/FullPageBookingEngine/FullPageBookingEngineElementEvents';\nimport { Currency } from '@/models/Currency';\n\nconst 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 FJD: new Currency('FJ$', 'Fiji Dollar', '$'),\n\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 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\nconst labelOverrides: { [code: string]: { short: string; long: string } } = {};\n\nexport const convertPrice = (price: number, includeDecimalPlaces: boolean, to: string, from: string): number => {\n const amount = _convertPrice(price, to, from);\n return includeDecimalPlaces ? preciseRound(amount, 2) : Math.round(amount);\n};\n\nconst 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\nconst _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 (!currencies[from]?.rates) {\n loadExchangeRates(from);\n }\n\n return price * (currencies[from]?.rates?.[to] ?? 1);\n};\n\nexport const loadExchangeRates = async (currencyCode: string) => {\n const currency = 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\nexport const getRatesForCurrencyCode = (code: string) => {\n return currencies[code]?.rates;\n};\n\nexport const getCurrencyItems = () => {\n const currencyItems: { text: string; value: string }[] = Object.keys(currencies).map((code) => ({\n text: code + ' - ' + currencies[code].name,\n value: code,\n }));\n\n return currencyItems.sort((a, b) => a.value.localeCompare(b.value));\n};\n\nexport const getCurrencySymbol = (currencyCode: string) => {\n if (labelOverrides[currencyCode]?.long) {\n return labelOverrides[currencyCode]?.long;\n }\n\n return currencies[currencyCode]?.symbol ?? '';\n};\n\nexport const getCurrencyShortSymbol = (currencyCode: string) => {\n if (labelOverrides[currencyCode]?.short) {\n return labelOverrides[currencyCode]?.short;\n }\n\n return currencies[currencyCode]?.shortSymbol ?? '';\n};\n"]}
|