UNPKG

@temboplus/frontend-core

Version:

A JavaScript/TypeScript package providing common utilities and logic shared across front-end TemboPlus projects.

1 lines 337 kB
"use strict";var e=require("zod"),t=require("uuid"),d={USD:{symbol:"$",name:"US Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"USD",name_plural:"US dollars"},CAD:{symbol:"CA$",name:"Canadian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"CAD",name_plural:"Canadian dollars"},EUR:{symbol:"€",name:"Euro",symbol_native:"€",decimal_digits:2,rounding:0,code:"EUR",name_plural:"euros"},AED:{symbol:"AED",name:"United Arab Emirates Dirham",symbol_native:"د.إ.‏",decimal_digits:2,rounding:0,code:"AED",name_plural:"UAE dirhams"},AFN:{symbol:"Af",name:"Afghan Afghani",symbol_native:"؋",decimal_digits:0,rounding:0,code:"AFN",name_plural:"Afghan Afghanis"},ALL:{symbol:"ALL",name:"Albanian Lek",symbol_native:"Lek",decimal_digits:0,rounding:0,code:"ALL",name_plural:"Albanian lekë"},AMD:{symbol:"AMD",name:"Armenian Dram",symbol_native:"դր.",decimal_digits:0,rounding:0,code:"AMD",name_plural:"Armenian drams"},ARS:{symbol:"AR$",name:"Argentine Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"ARS",name_plural:"Argentine pesos"},AUD:{symbol:"AU$",name:"Australian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"AUD",name_plural:"Australian dollars"},AZN:{symbol:"man.",name:"Azerbaijani Manat",symbol_native:"ман.",decimal_digits:2,rounding:0,code:"AZN",name_plural:"Azerbaijani manats"},BAM:{symbol:"KM",name:"Bosnia-Herzegovina Convertible Mark",symbol_native:"KM",decimal_digits:2,rounding:0,code:"BAM",name_plural:"Bosnia-Herzegovina convertible marks"},BDT:{symbol:"Tk",name:"Bangladeshi Taka",symbol_native:"৳",decimal_digits:2,rounding:0,code:"BDT",name_plural:"Bangladeshi takas"},BGN:{symbol:"BGN",name:"Bulgarian Lev",symbol_native:"лв.",decimal_digits:2,rounding:0,code:"BGN",name_plural:"Bulgarian leva"},BHD:{symbol:"BD",name:"Bahraini Dinar",symbol_native:"د.ب.‏",decimal_digits:3,rounding:0,code:"BHD",name_plural:"Bahraini dinars"},BIF:{symbol:"FBu",name:"Burundian Franc",symbol_native:"FBu",decimal_digits:0,rounding:0,code:"BIF",name_plural:"Burundian francs"},BND:{symbol:"BN$",name:"Brunei Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BND",name_plural:"Brunei dollars"},BOB:{symbol:"Bs",name:"Bolivian Boliviano",symbol_native:"Bs",decimal_digits:2,rounding:0,code:"BOB",name_plural:"Bolivian bolivianos"},BRL:{symbol:"R$",name:"Brazilian Real",symbol_native:"R$",decimal_digits:2,rounding:0,code:"BRL",name_plural:"Brazilian reals"},BWP:{symbol:"BWP",name:"Botswanan Pula",symbol_native:"P",decimal_digits:2,rounding:0,code:"BWP",name_plural:"Botswanan pulas"},BYN:{symbol:"Br",name:"Belarusian Ruble",symbol_native:"руб.",decimal_digits:2,rounding:0,code:"BYN",name_plural:"Belarusian rubles"},BZD:{symbol:"BZ$",name:"Belize Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BZD",name_plural:"Belize dollars"},CDF:{symbol:"CDF",name:"Congolese Franc",symbol_native:"FrCD",decimal_digits:2,rounding:0,code:"CDF",name_plural:"Congolese francs"},CHF:{symbol:"CHF",name:"Swiss Franc",symbol_native:"CHF",decimal_digits:2,rounding:.05,code:"CHF",name_plural:"Swiss francs"},CLP:{symbol:"CL$",name:"Chilean Peso",symbol_native:"$",decimal_digits:0,rounding:0,code:"CLP",name_plural:"Chilean pesos"},CNY:{symbol:"CN¥",name:"Chinese Yuan",symbol_native:"CN¥",decimal_digits:2,rounding:0,code:"CNY",name_plural:"Chinese yuan"},COP:{symbol:"CO$",name:"Colombian Peso",symbol_native:"$",decimal_digits:0,rounding:0,code:"COP",name_plural:"Colombian pesos"},CRC:{symbol:"₡",name:"Costa Rican Colón",symbol_native:"₡",decimal_digits:0,rounding:0,code:"CRC",name_plural:"Costa Rican colóns"},CVE:{symbol:"CV$",name:"Cape Verdean Escudo",symbol_native:"CV$",decimal_digits:2,rounding:0,code:"CVE",name_plural:"Cape Verdean escudos"},CZK:{symbol:"Kč",name:"Czech Republic Koruna",symbol_native:"Kč",decimal_digits:2,rounding:0,code:"CZK",name_plural:"Czech Republic korunas"},DJF:{symbol:"Fdj",name:"Djiboutian Franc",symbol_native:"Fdj",decimal_digits:0,rounding:0,code:"DJF",name_plural:"Djiboutian francs"},DKK:{symbol:"Dkr",name:"Danish Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"DKK",name_plural:"Danish kroner"},DOP:{symbol:"RD$",name:"Dominican Peso",symbol_native:"RD$",decimal_digits:2,rounding:0,code:"DOP",name_plural:"Dominican pesos"},DZD:{symbol:"DA",name:"Algerian Dinar",symbol_native:"د.ج.‏",decimal_digits:2,rounding:0,code:"DZD",name_plural:"Algerian dinars"},EGP:{symbol:"EGP",name:"Egyptian Pound",symbol_native:"ج.م.‏",decimal_digits:2,rounding:0,code:"EGP",name_plural:"Egyptian pounds"},ERN:{symbol:"Nfk",name:"Eritrean Nakfa",symbol_native:"Nfk",decimal_digits:2,rounding:0,code:"ERN",name_plural:"Eritrean nakfas"},ETB:{symbol:"Br",name:"Ethiopian Birr",symbol_native:"Br",decimal_digits:2,rounding:0,code:"ETB",name_plural:"Ethiopian birrs"},GBP:{symbol:"£",name:"British Pound Sterling",symbol_native:"£",decimal_digits:2,rounding:0,code:"GBP",name_plural:"British pounds sterling"},GEL:{symbol:"GEL",name:"Georgian Lari",symbol_native:"GEL",decimal_digits:2,rounding:0,code:"GEL",name_plural:"Georgian laris"},GHS:{symbol:"GH₵",name:"Ghanaian Cedi",symbol_native:"GH₵",decimal_digits:2,rounding:0,code:"GHS",name_plural:"Ghanaian cedis"},GNF:{symbol:"FG",name:"Guinean Franc",symbol_native:"FG",decimal_digits:0,rounding:0,code:"GNF",name_plural:"Guinean francs"},GTQ:{symbol:"GTQ",name:"Guatemalan Quetzal",symbol_native:"Q",decimal_digits:2,rounding:0,code:"GTQ",name_plural:"Guatemalan quetzals"},HKD:{symbol:"HK$",name:"Hong Kong Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"HKD",name_plural:"Hong Kong dollars"},HNL:{symbol:"HNL",name:"Honduran Lempira",symbol_native:"L",decimal_digits:2,rounding:0,code:"HNL",name_plural:"Honduran lempiras"},HRK:{symbol:"kn",name:"Croatian Kuna",symbol_native:"kn",decimal_digits:2,rounding:0,code:"HRK",name_plural:"Croatian kunas"},HUF:{symbol:"Ft",name:"Hungarian Forint",symbol_native:"Ft",decimal_digits:0,rounding:0,code:"HUF",name_plural:"Hungarian forints"},IDR:{symbol:"Rp",name:"Indonesian Rupiah",symbol_native:"Rp",decimal_digits:0,rounding:0,code:"IDR",name_plural:"Indonesian rupiahs"},ILS:{symbol:"₪",name:"Israeli New Sheqel",symbol_native:"₪",decimal_digits:2,rounding:0,code:"ILS",name_plural:"Israeli new sheqels"},INR:{symbol:"Rs",name:"Indian Rupee",symbol_native:"টকা",decimal_digits:2,rounding:0,code:"INR",name_plural:"Indian rupees"},IQD:{symbol:"IQD",name:"Iraqi Dinar",symbol_native:"د.ع.‏",decimal_digits:0,rounding:0,code:"IQD",name_plural:"Iraqi dinars"},IRR:{symbol:"IRR",name:"Iranian Rial",symbol_native:"﷼",decimal_digits:0,rounding:0,code:"IRR",name_plural:"Iranian rials"},ISK:{symbol:"Ikr",name:"Icelandic Króna",symbol_native:"kr",decimal_digits:0,rounding:0,code:"ISK",name_plural:"Icelandic krónur"},JMD:{symbol:"J$",name:"Jamaican Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"JMD",name_plural:"Jamaican dollars"},JOD:{symbol:"JD",name:"Jordanian Dinar",symbol_native:"د.أ.‏",decimal_digits:3,rounding:0,code:"JOD",name_plural:"Jordanian dinars"},JPY:{symbol:"¥",name:"Japanese Yen",symbol_native:"¥",decimal_digits:0,rounding:0,code:"JPY",name_plural:"Japanese yen"},KES:{symbol:"Ksh",name:"Kenyan Shilling",symbol_native:"Ksh",decimal_digits:2,rounding:0,code:"KES",name_plural:"Kenyan shillings"},KHR:{symbol:"KHR",name:"Cambodian Riel",symbol_native:"៛",decimal_digits:2,rounding:0,code:"KHR",name_plural:"Cambodian riels"},KMF:{symbol:"CF",name:"Comorian Franc",symbol_native:"FC",decimal_digits:0,rounding:0,code:"KMF",name_plural:"Comorian francs"},KRW:{symbol:"₩",name:"South Korean Won",symbol_native:"₩",decimal_digits:0,rounding:0,code:"KRW",name_plural:"South Korean won"},KWD:{symbol:"KD",name:"Kuwaiti Dinar",symbol_native:"د.ك.‏",decimal_digits:3,rounding:0,code:"KWD",name_plural:"Kuwaiti dinars"},KZT:{symbol:"KZT",name:"Kazakhstani Tenge",symbol_native:"тңг.",decimal_digits:2,rounding:0,code:"KZT",name_plural:"Kazakhstani tenges"},LBP:{symbol:"L.L.",name:"Lebanese Pound",symbol_native:"ل.ل.‏",decimal_digits:0,rounding:0,code:"LBP",name_plural:"Lebanese pounds"},LKR:{symbol:"SLRs",name:"Sri Lankan Rupee",symbol_native:"SL Re",decimal_digits:2,rounding:0,code:"LKR",name_plural:"Sri Lankan rupees"},LYD:{symbol:"LD",name:"Libyan Dinar",symbol_native:"د.ل.‏",decimal_digits:3,rounding:0,code:"LYD",name_plural:"Libyan dinars"},MAD:{symbol:"MAD",name:"Moroccan Dirham",symbol_native:"د.م.‏",decimal_digits:2,rounding:0,code:"MAD",name_plural:"Moroccan dirhams"},MDL:{symbol:"MDL",name:"Moldovan Leu",symbol_native:"MDL",decimal_digits:2,rounding:0,code:"MDL",name_plural:"Moldovan lei"},MGA:{symbol:"MGA",name:"Malagasy Ariary",symbol_native:"MGA",decimal_digits:0,rounding:0,code:"MGA",name_plural:"Malagasy Ariaries"},MKD:{symbol:"MKD",name:"Macedonian Denar",symbol_native:"MKD",decimal_digits:2,rounding:0,code:"MKD",name_plural:"Macedonian denari"},MMK:{symbol:"MMK",name:"Myanma Kyat",symbol_native:"K",decimal_digits:0,rounding:0,code:"MMK",name_plural:"Myanma kyats"},MOP:{symbol:"MOP$",name:"Macanese Pataca",symbol_native:"MOP$",decimal_digits:2,rounding:0,code:"MOP",name_plural:"Macanese patacas"},MUR:{symbol:"MURs",name:"Mauritian Rupee",symbol_native:"MURs",decimal_digits:0,rounding:0,code:"MUR",name_plural:"Mauritian rupees"},MXN:{symbol:"MX$",name:"Mexican Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"MXN",name_plural:"Mexican pesos"},MYR:{symbol:"RM",name:"Malaysian Ringgit",symbol_native:"RM",decimal_digits:2,rounding:0,code:"MYR",name_plural:"Malaysian ringgits"},MZN:{symbol:"MTn",name:"Mozambican Metical",symbol_native:"MTn",decimal_digits:2,rounding:0,code:"MZN",name_plural:"Mozambican meticals"},NAD:{symbol:"N$",name:"Namibian Dollar",symbol_native:"N$",decimal_digits:2,rounding:0,code:"NAD",name_plural:"Namibian dollars"},NGN:{symbol:"₦",name:"Nigerian Naira",symbol_native:"₦",decimal_digits:2,rounding:0,code:"NGN",name_plural:"Nigerian nairas"},NIO:{symbol:"C$",name:"Nicaraguan Córdoba",symbol_native:"C$",decimal_digits:2,rounding:0,code:"NIO",name_plural:"Nicaraguan córdobas"},NOK:{symbol:"Nkr",name:"Norwegian Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"NOK",name_plural:"Norwegian kroner"},NPR:{symbol:"NPRs",name:"Nepalese Rupee",symbol_native:"नेरू",decimal_digits:2,rounding:0,code:"NPR",name_plural:"Nepalese rupees"},NZD:{symbol:"NZ$",name:"New Zealand Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"NZD",name_plural:"New Zealand dollars"},OMR:{symbol:"OMR",name:"Omani Rial",symbol_native:"ر.ع.‏",decimal_digits:3,rounding:0,code:"OMR",name_plural:"Omani rials"},PAB:{symbol:"B/.",name:"Panamanian Balboa",symbol_native:"B/.",decimal_digits:2,rounding:0,code:"PAB",name_plural:"Panamanian balboas"},PEN:{symbol:"S/.",name:"Peruvian Nuevo Sol",symbol_native:"S/.",decimal_digits:2,rounding:0,code:"PEN",name_plural:"Peruvian nuevos soles"},PHP:{symbol:"₱",name:"Philippine Peso",symbol_native:"₱",decimal_digits:2,rounding:0,code:"PHP",name_plural:"Philippine pesos"},PKR:{symbol:"PKRs",name:"Pakistani Rupee",symbol_native:"₨",decimal_digits:0,rounding:0,code:"PKR",name_plural:"Pakistani rupees"},PLN:{symbol:"zł",name:"Polish Zloty",symbol_native:"zł",decimal_digits:2,rounding:0,code:"PLN",name_plural:"Polish zlotys"},PYG:{symbol:"₲",name:"Paraguayan Guarani",symbol_native:"₲",decimal_digits:0,rounding:0,code:"PYG",name_plural:"Paraguayan guaranis"},QAR:{symbol:"QR",name:"Qatari Rial",symbol_native:"ر.ق.‏",decimal_digits:2,rounding:0,code:"QAR",name_plural:"Qatari rials"},RON:{symbol:"RON",name:"Romanian Leu",symbol_native:"RON",decimal_digits:2,rounding:0,code:"RON",name_plural:"Romanian lei"},RSD:{symbol:"din.",name:"Serbian Dinar",symbol_native:"дин.",decimal_digits:0,rounding:0,code:"RSD",name_plural:"Serbian dinars"},RUB:{symbol:"RUB",name:"Russian Ruble",symbol_native:"₽.",decimal_digits:2,rounding:0,code:"RUB",name_plural:"Russian rubles"},RWF:{symbol:"RWF",name:"Rwandan Franc",symbol_native:"FR",decimal_digits:0,rounding:0,code:"RWF",name_plural:"Rwandan francs"},SAR:{symbol:"SR",name:"Saudi Riyal",symbol_native:"ر.س.‏",decimal_digits:2,rounding:0,code:"SAR",name_plural:"Saudi riyals"},SDG:{symbol:"SDG",name:"Sudanese Pound",symbol_native:"SDG",decimal_digits:2,rounding:0,code:"SDG",name_plural:"Sudanese pounds"},SEK:{symbol:"Skr",name:"Swedish Krona",symbol_native:"kr",decimal_digits:2,rounding:0,code:"SEK",name_plural:"Swedish kronor"},SGD:{symbol:"S$",name:"Singapore Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"SGD",name_plural:"Singapore dollars"},SOS:{symbol:"Ssh",name:"Somali Shilling",symbol_native:"Ssh",decimal_digits:0,rounding:0,code:"SOS",name_plural:"Somali shillings"},SYP:{symbol:"SY£",name:"Syrian Pound",symbol_native:"ل.س.‏",decimal_digits:0,rounding:0,code:"SYP",name_plural:"Syrian pounds"},THB:{symbol:"฿",name:"Thai Baht",symbol_native:"฿",decimal_digits:2,rounding:0,code:"THB",name_plural:"Thai baht"},TND:{symbol:"DT",name:"Tunisian Dinar",symbol_native:"د.ت.‏",decimal_digits:3,rounding:0,code:"TND",name_plural:"Tunisian dinars"},TOP:{symbol:"T$",name:"Tongan Paʻanga",symbol_native:"T$",decimal_digits:2,rounding:0,code:"TOP",name_plural:"Tongan paʻanga"},TRY:{symbol:"TL",name:"Turkish Lira",symbol_native:"TL",decimal_digits:2,rounding:0,code:"TRY",name_plural:"Turkish Lira"},TTD:{symbol:"TT$",name:"Trinidad and Tobago Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"TTD",name_plural:"Trinidad and Tobago dollars"},TWD:{symbol:"NT$",name:"New Taiwan Dollar",symbol_native:"NT$",decimal_digits:2,rounding:0,code:"TWD",name_plural:"New Taiwan dollars"},TZS:{symbol:"TSh",name:"Tanzanian Shilling",symbol_native:"TSh",decimal_digits:2,rounding:0,code:"TZS",name_plural:"Tanzanian shillings"},UAH:{symbol:"₴",name:"Ukrainian Hryvnia",symbol_native:"₴",decimal_digits:2,rounding:0,code:"UAH",name_plural:"Ukrainian hryvnias"},UGX:{symbol:"USh",name:"Ugandan Shilling",symbol_native:"USh",decimal_digits:0,rounding:0,code:"UGX",name_plural:"Ugandan shillings"},UYU:{symbol:"$U",name:"Uruguayan Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"UYU",name_plural:"Uruguayan pesos"},UZS:{symbol:"UZS",name:"Uzbekistan Som",symbol_native:"UZS",decimal_digits:0,rounding:0,code:"UZS",name_plural:"Uzbekistan som"},VND:{symbol:"₫",name:"Vietnamese Dong",symbol_native:"₫",decimal_digits:0,rounding:0,code:"VND",name_plural:"Vietnamese dong"},XAF:{symbol:"FCFA",name:"CFA Franc BEAC",symbol_native:"FCFA",decimal_digits:0,rounding:0,code:"XAF",name_plural:"CFA francs BEAC"},XOF:{symbol:"CFA",name:"CFA Franc BCEAO",symbol_native:"CFA",decimal_digits:0,rounding:0,code:"XOF",name_plural:"CFA francs BCEAO"},YER:{symbol:"YR",name:"Yemeni Rial",symbol_native:"ر.ي.‏",decimal_digits:0,rounding:0,code:"YER",name_plural:"Yemeni rials"},ZAR:{symbol:"R",name:"South African Rand",symbol_native:"R",decimal_digits:2,rounding:0,code:"ZAR",name_plural:"South African rand"},SSP:{symbol:"SS£",name:"South Sudanese Pound",symbol_native:"£",decimal_digits:2,rounding:0,code:"SSP",name_plural:"South Sudanese pounds"},VES:{symbol:"Bs.",name:"Venezuelan Bolívar Soberano",symbol_native:"Bs.",decimal_digits:2,rounding:0,code:"VES",name_plural:"Venezuelan bolívares soberanos"},ZMW:{symbol:"ZK",name:"Zambian Kwacha",symbol_native:"K",decimal_digits:2,rounding:0,code:"ZMW",name_plural:"Zambian kwachas"},MRU:{symbol:"UM",name:"Mauritanian Ouguiya",symbol_native:"أوقية",decimal_digits:2,rounding:0,code:"MRU",name_plural:"Mauritanian ouguiyas"},STN:{symbol:"Db",name:"São Tomé and Príncipe Dobra",symbol_native:"Db",decimal_digits:2,rounding:0,code:"STN",name_plural:"São Tomé and Príncipe dobras"},ZWG:{symbol:"ZiG",name:"Zimbabwe Gold (ZiG)",symbol_native:"ZiG",decimal_digits:2,rounding:0,code:"ZWG",name_plural:"Zimbabwe Gold"}};const i=new Set(["USD","CAD","EUR","AED","AFN","ALL","AMD","ARS","AUD","AZN","BAM","BDT","BGN","BHD","BIF","BND","BOB","BRL","BWP","BYN","BZD","CDF","CHF","CLP","CNY","COP","CRC","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","GBP","GEL","GHS","GNF","GTQ","HKD","HNL","HRK","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KHR","KMF","KRW","KWD","KZT","LBP","LKR","LYD","MAD","MDL","MGA","MKD","MMK","MOP","MUR","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SDG","SEK","SGD","SOS","SSP","SYP","THB","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","UYU","UZS","VES","VND","XAF","XOF","YER","ZAR","ZMW","STN","MRU","ZWG"]),n={isCurrencyCode:function(e){return i.has(e)}};const a=e.z.string().refine((e=>i.has(e)),{message:"Invalid ISO 4217 currency code"}),o=e.z.object({code:e.z.string().length(3),version:e.z.string().optional().default("1.0")}),r=Symbol("CurrencyToken");class s{_symbol;_name;_symbolNative;_decimalDigits;_rounding;_code;_namePlural;static USD;static CAD;static EUR;static AED;static AFN;static ALL;static AMD;static ARS;static AUD;static AZN;static BAM;static BDT;static BGN;static BHD;static BIF;static BND;static BOB;static BRL;static BWP;static BYN;static BZD;static CDF;static CHF;static CLP;static CNY;static COP;static CRC;static CVE;static CZK;static DJF;static DKK;static DOP;static DZD;static EEK;static EGP;static ERN;static ETB;static GBP;static GEL;static GHS;static GNF;static GTQ;static HKD;static HNL;static HRK;static HUF;static IDR;static ILS;static INR;static IQD;static IRR;static ISK;static JMD;static JOD;static JPY;static KES;static KHR;static KMF;static KRW;static KWD;static KZT;static LBP;static LKR;static LTL;static LVL;static LYD;static MAD;static MDL;static MGA;static MKD;static MMK;static MOP;static MUR;static MXN;static MYR;static MZN;static NAD;static NGN;static NIO;static NOK;static NPR;static NZD;static OMR;static PAB;static PEN;static PHP;static PKR;static PLN;static PYG;static QAR;static RON;static RSD;static RUB;static RWF;static SAR;static SDG;static SEK;static SGD;static SOS;static SYP;static THB;static TND;static TOP;static TRY;static TTD;static TWD;static TZS;static UAH;static UGX;static UYU;static UZS;static VEF;static VND;static XAF;static XOF;static YER;static ZAR;static ZMK;static ZWL;static ZIMBABWEAN_DOLLAR;static ZAMBIAN_KWACHA;static YEMENI_RIAL;static URUGUAYAN_PESO;static UZBEKISTAN_SOM;static VENEZUELAN_BOLIVAR;static VIETNAMESE_DONG;static UGANDAN_SHILLING;static UKRAINIAN_HRYVNIA;static TANZANIAN_SHILLING;static TAIWAN_NEW_DOLLAR;static TRINIDAD_AND_TOBAGO_DOLLAR;static TURKISH_LIRA;static TONGAN_PAANGA;static TUNISIAN_DINAR;static THAI_BAHT;static SYRIAN_POUND;static SOMALI_SHILLING;static SINGAPORE_DOLLAR;static SWEDISH_KRONA;static SUDANESE_POUND;static SAUDI_RIYAL;static RWANDAN_FRANC;static RUSSIAN_RUBLE;static SERBIAN_DINAR;static ROMANIAN_LEU;static QATARI_RIAL;static PARAGUAYAN_GUARANI;static POLISH_ZLOTY;static PAKISTANI_RUPEE;static PHILIPPINE_PESO;static PERUVIAN_NUEVO_SOL;static PANAMANIAN_BALBOA;static OMANI_RIAL;static NEW_ZEALAND_DOLLAR;static NEPALESE_RUPEE;static NORWEGIAN_KRONE;static NICARAGUAN_CORDOBA;static NIGERIAN_NAIRA;static NAMIBIAN_DOLLAR;static MOZAMBICAN_METICAL;static MALAYSIAN_RINGGIT;static MEXICAN_PESO;static MAURITIAN_RUPEE;static MACANESE_PATACA;static MYANMA_KYAT;static MACEDONIAN_DENAR;static MALAGASY_ARIARY;static MOLDOVAN_LEU;static MOROCCAN_DIRHAM;static LIBYAN_DINAR;static LATVIAN_LATS;static LITHUANIAN_LITAS;static SRI_LANKAN_RUPEE;static LEBANESE_POUND;static KAZAKHSTANI_TENGE;static KUWAITI_DINAR;static SOUTH_KOREAN_WON;static CAMBODIAN_RIEL;static KENYAN_SHILLING;static JORDANIAN_DINAR;static JAMAICAN_DOLLAR;static ICELANDIC_KRONA;static IRANIAN_RIAL;static IRAQI_DINAR;static INDIAN_RUPEE;static ISRAELI_NEW_SHEQEL;static INDONESIAN_RUPIAH;static HUNGARIAN_FORINT;static CROATIAN_KUNA;static HONDURAN_LEMPIRA;static HONG_KONG_DOLLAR;static GUATEMALAN_QUETZAL;static GUINEAN_FRANC;static GHANAIAN_CEDI;static GEORGIAN_LARI;static BRITISH_POUND_STERLING;static ETHIOPIAN_BIRR;static ERITREAN_NAKFA;static EGYPTIAN_POUND;static ESTONIAN_KROON;static ALGERIAN_DINAR;static DOMINICAN_PESO;static DANISH_KRONE;static DJIBOUTIAN_FRANC;static CZECH_REPUBLIC_KORUNA;static CAPE_VERDEAN_ESCUDO;static COSTA_RICAN_COLON;static COLOMBIAN_PESO;static CHINESE_YUAN;static CHILEAN_PESO;static SWISS_FRANC;static CONGOLESE_FRANC;static BELIZE_DOLLAR;static BELARUSIAN_RUBLE;static BOTSWANAN_PULA;static BRAZILIAN_REAL;static BOLIVIAN_BOLIVIANO;static BRUNEI_DOLLAR;static BURUNDIAN_FRANC;static BAHRAINI_DINAR;static BULGARIAN_LEV;static BANGLADESHI_TAKA;static BOSNIAN_CONVERTIBLE_MARK;static AZERBAIJANI_MANAT;static ARGENTINE_PESO;static ARMENIAN_DRAM;static ALBANIAN_LEK;static AFGHAN_AFGHANI;static UNITED_ARAB_EMIRATES_DIRHAM;static EURO;static CANADIAN_DOLLAR;static US_DOLLAR;static AUSTRALIAN_DOLLAR;static CFA_FRANC_BEAC;static CFA_FRANC_BCEAO;constructor(e,t,d,i,n,a,o,s){if(this._symbol=t,this._name=d,this._symbolNative=i,this._decimalDigits=n,this._rounding=a,this._code=o,this._namePlural=s,e!==r)throw new Error("Country can only be instantiated by CountryService.")}get symbol(){return this._symbol}get name(){return this._name}get symbolNative(){return this._symbolNative}get decimalDigits(){return this._decimalDigits}get rounding(){return this._rounding}get code(){return this._code}get namePlural(){return this._namePlural}toString(){return`${this.name} (${this.code})`}static fromCode(e){return c.getInstance().fromCode(e)}static fromName(e){return c.getInstance().fromName(e)}static getAll(){return c.getInstance().getAll()}static isValidCode(e){if(!e)return!1;return!!s.fromCode(e)}static isValidName(e){if(!e)return!1;return!!s.fromName(e)}static from(e){if(!e||"object"==typeof e)return;const t=e.trim();if(0===t.length)return;if(n.isCurrencyCode(t)){const e=s.fromCode(t);if(e)return e}const d=s.fromName(t);return d||void 0}static is(e){if(!e||"object"!=typeof e)return!1;const t=e;if("string"!=typeof t._code)return!1;if("string"!=typeof t._name)return!1;if("string"!=typeof t._symbol)return!1;if("string"!=typeof t._symbolNative)return!1;if("number"!=typeof t._decimalDigits)return!1;if("number"!=typeof t._rounding)return!1;if("string"!=typeof t._namePlural)return!1;const d=s.fromCode(t._code);return Boolean(d)}toJSON(){return{code:this.code,version:"1.0"}}toJSONString(){return JSON.stringify(this.toJSON())}static fromJSON(e){try{const t="string"==typeof e?JSON.parse(e):e,d=o.safeParse(t);if(!d.success)return void console.error("Invalid CurrencyJSON:",d.error.flatten());const i=d.data;if(!n.isCurrencyCode(i.code))return void console.warn(`Invalid CurrencyJSON: invalid currency code '${i.code}'`);const a=s.fromCode(i.code);return a||void console.warn(`Invalid CurrencyJSON: unknown currency code '${i.code}'`)}catch(e){return void console.error("Error parsing CurrencyJSON:",e)}}static fromJSONString(e){return s.fromJSON(e)}static isCurrencyJSON(e){return o.safeParse(e).success}}class c{static instance;currencyList=[];currencyRecord={};nameRecord={};staticReferences=new Map;constructor(){}static getInstance(){return c.instance||(c.instance=new c,c.instance.initialize()),c.instance}initialize(){try{const e=JSON.parse(JSON.stringify(d)),t=Object.values(e).map((function(e){let t;if(!n.isCurrencyCode(e.code))throw new Error(`Unknown currency code: ${e.code}`);return t=e.code,new s(r,e.symbol,e.name,e.symbol_native,e.decimal_digits,e.rounding,t,e.name_plural)})),i={},a={};t.forEach((e=>{i[e.code]=e,a[e.name.toUpperCase()]=e;const t=e.code.toUpperCase();this.staticReferences.set(t,e);const d=e.name.toUpperCase().replace(/\s+/g,"_").replace(/[-(),.']/g,"").replace(/&/g,"AND");this.staticReferences.set(d,e)})),this.currencyRecord=i,this.nameRecord=a,this.currencyList=t}catch(e){console.error("Failed to initialize CurrencyService:",e)}}getAll(){return this.currencyList}getAllAsRecord(){return this.currencyRecord}getStaticReferences(){return this.staticReferences}fromCode(e){return this.currencyRecord[e.trim().toUpperCase()]}fromName(e){const t=e.trim().toUpperCase(),d=this.nameRecord[t];if(d)return d;for(const[e,d]of Object.entries(this.nameRecord))if(e.toUpperCase()===t)return d;return this.currencyList.find((e=>e.name.toUpperCase()===t))}isValidCode(e){if(!e)return!1;return!!this.fromCode(e)}isValidName(e){if(!e)return!1;return!!this.fromName(e)}getCurrencySymbolPattern(){const e=new Set;return Object.values(this.currencyList).forEach((t=>{e.add(this.escapeRegExp(t.symbol)),e.add(this.escapeRegExp(t.symbolNative))})),Array.from(e).join("|")}escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}}!function(){try{c.getInstance().getStaticReferences().forEach(((e,t)=>{s[t]=e}))}catch(e){console.log("Failed to set up static references: ",e)}}();const l=/^-?(?:\d{1,3}(?:,\d{3})*|\d+)(?:\.\d+)?$/,u=[/^-([A-Z]{3})(\d+(?:,\d{3})*(?:\.\d+)?)$/i,/^([A-Z]{3})-(\d+(?:,\d{3})*(?:\.\d+)?)$/i,/^([A-Z]{3})(\d+(?:,\d{3})*(?:\.\d+)?)$/i,/^-(\d+(?:,\d{3})*(?:\.\d+)?)([A-Z]{3})$/i,/^(\d+(?:,\d{3})*(?:\.\d+)?)([A-Z]{3})$/i],m=["$","€","£","¥","₹","₦","₵","₨","฿","₱","₩","₴","₽","₪","₡","₲","₺","₼","₸","₹"],f=e.z.object({value:e.z.number().finite(),text:e.z.string().min(1),currencyCode:e.z.string().length(3),version:e.z.string().optional().default("1.0")});class _{value;text;currency;constructor(e,t,d="TZS"){const i=c.getInstance().fromCode(d);if(!i)throw new Error(`Invalid currency code: ${d}`);this.value=e,this.text=t,this.currency=i}static from(e,t){const d=t||"TZS";if("number"==typeof e)return _.fromNumericValue(e,d);try{if(m.some((t=>e.includes(t))))throw new Error('Invalid format: Currency symbols like $, €, £ are not allowed. Use currency codes instead (e.g., "TZS1000" or "1000USD")');const i=e.replace(/\s+/g,"");if(!i)return;const n=_.parseCurrencyAmount(i);if(n.currency&&n.amount){if(t&&n.currency!==t)throw new Error(`Currency code conflict: Found "${n.currency}" in input string "${e}" but "${t}" was specified as parameter. Please use either "Amount.from('${e}')" or "Amount.from('${n.amount}', '${t}')".`);return _.fromParsedValues(n.amount,n.currency)}return d?_.fromParsedValues(i,d):void 0}catch(e){return void(e instanceof Error&&console.error(`Amount.from() error: ${e.message}`))}}static parseCurrencyAmount(e){let t=e.match(u[0]);if(t){const[,e,d]=t,i=_.validateCurrencyCode(e);if(i)return{currency:i,amount:`-${d}`}}if(t=e.match(u[1]),t){const[,e,d]=t,i=_.validateCurrencyCode(e);if(i)return{currency:i,amount:`-${d}`}}if(t=e.match(u[2]),t){const[,e,d]=t,i=_.validateCurrencyCode(e);if(i)return{currency:i,amount:d}}if(t=e.match(u[3]),t){const[,e,d]=t,i=_.validateCurrencyCode(d);if(i)return{currency:i,amount:`-${e}`}}if(t=e.match(u[4]),t){const[,e,d]=t,i=_.validateCurrencyCode(d);if(i)return{currency:i,amount:e}}return{}}static validateCurrencyCode(e){const t=e.toUpperCase(),d=c.getInstance().fromCode(t);return d?.code}static fromNumericValue(e,t){const d=c.getInstance().fromCode(t);if(!d)return;if(!Number.isFinite(e))return;const i=d.decimalDigits,n=Number(e.toFixed(i));let a=Math.abs(n).toLocaleString("en-US",{minimumFractionDigits:i,maximumFractionDigits:i});return 0===i&&(a=a.replace(".00","")),new _(e,a,d.code)}static fromParsedValues(e,t){const d=c.getInstance().fromCode(t);if(!d)return;const i=e.replace(/,/g,"");if(!l.test(i))return;if(i.includes(".")){const e=i.split(".");if(e.length>2)throw new Error("Invalid format: Multiple decimal points not allowed");if(0===e[1].length)throw new Error("Invalid format: At least one digit required after decimal point")}const n=Number(i);if(!Number.isFinite(n))return;const a=d.decimalDigits,o=Number(n.toFixed(a));let r=Math.abs(o).toLocaleString("en-US",{minimumFractionDigits:a,maximumFractionDigits:a});return 0===a&&(r=r.replace(".00","")),new _(n,r,d.code)}get currencyCode(){return this.currency.code}get numericValue(){return this.value}get formattedNumericValue(){return this.toPlainNumber({minimumFractionDigits:this.currency.decimalDigits,maximumFractionDigits:this.currency.decimalDigits,useGrouping:!0})}add(e){if("number"==typeof e){const t=this.value+e;return _.from(t,this.currencyCode)}if(this.currencyCode!==e.currencyCode)throw new Error(`Cannot add amounts with different currencies: ${this.currencyCode} and ${e.currencyCode}`);const t=this.value+e.value;return _.from(t,this.currencyCode)}subtract(e){if("number"==typeof e){const t=this.value-e;return _.from(t,this.currencyCode)}if(this.currencyCode!==e.currencyCode)throw new Error(`Cannot subtract amounts with different currencies: ${this.currencyCode} and ${e.currencyCode}`);const t=this.value-e.value;return _.from(t,this.currencyCode)}multiply(e){const t=this.value*e;return _.from(t,this.currencyCode)}divide(e){if(0===e)throw new Error("Cannot divide by zero");const t=this.value/e;return _.from(t,this.currencyCode)}abs(){return _.from(Math.abs(this.value),this.currencyCode)}round(e){const t=e??this.currency.decimalDigits,d=Math.pow(10,t),i=Math.round(this.value*d)/d;return _.from(i,this.currencyCode)}min(e){const t="number"==typeof e?e:e.value,d=Math.min(this.value,t);return _.from(d,this.currencyCode)}max(e){const t="number"==typeof e?e:e.value,d=Math.max(this.value,t);return _.from(d,this.currencyCode)}equals(e){return"number"==typeof e?this.value===e:this.value===e.value&&this.currencyCode===e.currencyCode}greaterThan(e){const t="number"==typeof e?e:e.value;return this.value>t}lessThan(e){const t="number"==typeof e?e:e.value;return this.value<t}greaterThanOrEqual(e){const t="number"==typeof e?e:e.value;return this.value>=t}lessThanOrEqual(e){const t="number"==typeof e?e:e.value;return this.value<=t}convertTo(e,t){const d=this.value*t;return _.from(d,e)}percentage(e){const t=this.value*e/100;return _.from(t,this.currencyCode)}isZero(){return 0===this.value}isPositive(){return this.value>0}isNegative(){return this.value<0}getNativeLocaleForCurrency(){return{USD:"en-US",EUR:"de-DE",GBP:"en-GB",JPY:"ja-JP",CNY:"zh-CN",TZS:"sw-TZ",KES:"sw-KE",UGX:"lg-UG",RWF:"rw-RW",ETB:"am-ET",ZAR:"en-ZA",NGN:"en-NG",GHS:"en-GH",MAD:"ar-MA",EGP:"ar-EG",INR:"hi-IN",PKR:"ur-PK",BDT:"bn-BD",THB:"th-TH",VND:"vi-VN",IDR:"id-ID",MYR:"ms-MY",PHP:"fil-PH",KRW:"ko-KR",RUB:"ru-RU",PLN:"pl-PL",CZK:"cs-CZ",HUF:"hu-HU",SEK:"sv-SE",NOK:"nb-NO",DKK:"da-DK",CHF:"de-CH",CAD:"en-CA",AUD:"en-AU",NZD:"en-NZ",BRL:"pt-BR",MXN:"es-MX",ARS:"es-AR",CLP:"es-CL",COP:"es-CO",PEN:"es-PE",TRY:"tr-TR",SAR:"ar-SA",AED:"ar-AE",QAR:"ar-QA",KWD:"ar-KW",BHD:"ar-BH",OMR:"ar-OM",JOD:"ar-JO",LBP:"ar-LB",ILS:"he-IL"}[this.currency.code]||"en-US"}formatWithIntl(e){const{includeSymbol:t=!0,includeCurrency:d=!1,useGrouping:i=!0,minimumFractionDigits:n,maximumFractionDigits:a,showSign:o="negative",locale:r="en-US",useNativeLocale:s=!1}=e,{minimumFractionDigits:c,maximumFractionDigits:l}=$({minimumFractionDigits:n,maximumFractionDigits:a,currencyDigits:this.currency.decimalDigits}),u=s?this.getNativeLocaleForCurrency():r;try{const e={useGrouping:i,minimumFractionDigits:c,maximumFractionDigits:l};t?(e.style="currency",e.currency=this.currency.code,e.currencyDisplay="symbol"):e.style="decimal",e.signDisplay="always"===o?"always":"never"===o?"never":"auto";let n=new Intl.NumberFormat(u,e).format(this.value);return d&&(n=`${n} ${this.currency.code}`),n}catch(t){return console.warn(`Intl formatting failed for ${this.currency.code} with locale ${u}, falling back to manual formatting:`,t),this.formatManually(e)}}formatManually(e){const{includeSymbol:t=!0,includeCurrency:d=!1,symbolPosition:i="before",useGrouping:n=!0,minimumFractionDigits:a,maximumFractionDigits:o,showSign:r="negative",locale:s="en-US",thousandsSeparator:c,decimalSeparator:l,useNativeSymbol:u=!1}=e,{minimumFractionDigits:m,maximumFractionDigits:f}=$({minimumFractionDigits:a,maximumFractionDigits:o,currencyDigits:this.currency.decimalDigits}),_=this.value<0,A=Math.abs(this.value);let N;if(void 0!==c||void 0!==l){const e=A.toFixed(f),[t,d]=e.split(".");let i=t;n&&void 0!==c&&(i=t.replace(/\B(?=(\d{3})+(?!\d))/g,c)),N=d?`${i}${l||"."}${d.padEnd(m,"0").slice(0,f)}`:i}else N=A.toLocaleString(s,{useGrouping:n,minimumFractionDigits:m,maximumFractionDigits:f});let g="";"always"===r?g=_?"-":"+":"negative"===r&&_&&(g="-");let y=N;if(t){const e=u?this.currency.symbolNative:this.currency.symbol,t=this.shouldUseSpacing()?" ":"";y="after"===i?`${y}${t}${e}`:`${e}${t}${y}`}return y=`${g}${y}`,d&&(y=`${y} ${this.currency.code}`),y}shouldUseSpacing(){return new Set(["TZS","KES","UGX","RWF","ETB","ZAR","NGN","GHS","BWP","ZMW","AOA","XAF","XOF","MAD","DZD","EGP","SDG","LYD","TND","INR","PKR","LKR","NPR","BDT","THB","VND","KHR","LAK","MMK","RUB","UAH","BYN","KZT","UZS","IRR","AFN","IQD","SYP","LBP"]).has(this.currency.code)}format(e={}){const{useNativeFormatting:t=!1}=e;return t?this.formatWithIntl(e):this.formatManually(e)}formatNative(e={}){return this.format({...e,useNativeFormatting:!0,useNativeLocale:!0})}get label(){return this.formatNative({includeSymbol:!0,useGrouping:!0,maximumFractionDigits:this.currency.decimalDigits,minimumFractionDigits:this.currency.decimalDigits})}get internationalLabel(){return this.format({includeSymbol:!0,useGrouping:!0,locale:"en-US",maximumFractionDigits:this.currency.decimalDigits,minimumFractionDigits:this.currency.decimalDigits})}toPlainNumber(e={}){return this.format({...e,includeSymbol:!1,includeCurrency:!1})}toCompactFormat(e=1,t){const d=t?.includeSymbol??!0,i=Math.max(0,Math.min(20,Math.floor(e))),{alwaysShowDecimals:n=!1,roundingMode:a="round"}=t??{},o=Math.abs(this.value),r=this.value<0;let s,c,l;if(o>=1e12)s=o/1e12,c="T";else if(o>=1e9)s=o/1e9,c="B";else if(o>=1e6)s=o/1e6,c="M";else{if(!(o>=1e3))return this.format({includeSymbol:d,useGrouping:!1,minimumFractionDigits:n?i:0,maximumFractionDigits:i});s=o/1e3,c="K"}const u=Math.pow(10,i);switch(a){case"floor":l=Math.floor(s*u)/u;break;case"ceil":l=Math.ceil(s*u)/u;break;default:l=Math.round(s*u)/u}let m;n&&i>0?m=l.toFixed(i):i>0?(m=l.toFixed(i),m=m.replace(/\.?0+$/,"")):m=Math.round(l).toString();const f=parseFloat(m);if(f>=1e3){if("K"===c)return this.toCompactFormat(i,t);"M"===c?(s=f/1e3,c="B",m=n&&i>0?s.toFixed(i):s.toFixed(i).replace(/\.?0+$/,"")):"B"===c&&(s=f/1e3,c="T",m=n&&i>0?s.toFixed(i):s.toFixed(i).replace(/\.?0+$/,""))}return`${r?"-":""}${d?this.currency.symbol:""}${m}${c}`}toWholeNumber(e=!1,t=!0){const d=Math.round(this.value);return _.from(d,this.currencyCode).format({includeSymbol:e,useGrouping:t,minimumFractionDigits:0,maximumFractionDigits:0})}getWholeValue(){return Math.round(this.value)}toJSON(){return{value:this.value,text:this.text,currencyCode:this.currencyCode,version:"1.0"}}toJSONString(){return JSON.stringify(this.toJSON())}static fromJSON(e){try{const t="string"==typeof e?JSON.parse(e):e,d=f.safeParse(t);if(!d.success)return void console.error("Invalid AmountJSON:",d.error.flatten());const i=d.data,n=c.getInstance().fromCode(i.currencyCode);if(!n)return void console.warn(`Invalid AmountJSON: unknown currency code '${i.currencyCode}'`);const a=new _(i.value,i.text,i.currencyCode);if(!a.validate())return void console.warn("Invalid AmountJSON: reconstructed amount failed validation");const o=_.from(i.value,n.code);return o&&o.numericValue===a.numericValue?a:void console.warn("Invalid AmountJSON: value inconsistency detected")}catch(e){return void console.error("Error parsing AmountJSON:",e)}}static fromJSONString(e){return _.fromJSON(e)}static isAmountJSON(e){return f.safeParse(e).success}static sum(e){if(0===e.length)return _.from(0);const t=e[0].currencyCode;if(!e.every((e=>e.currencyCode===t)))throw new Error("Cannot sum amounts with different currencies");const d=e.reduce(((e,t)=>e+t.value),0);return _.from(d,t)}static average(e){if(0===e.length)throw new Error("Cannot calculate average of empty array");return _.sum(e).divide(e.length)}static min(e){if(0===e.length)throw new Error("Cannot find minimum of empty array");return e.reduce(((e,t)=>t.lessThan(e)?t:e))}static max(e){if(0===e.length)throw new Error("Cannot find maximum of empty array");return e.reduce(((e,t)=>t.greaterThan(e)?t:e))}static canConstruct(e,t="TZS"){if(null==e)return!1;return!!_.from(e,t)}static is(e){if(!e||"object"!=typeof e)return!1;const t=e;if("number"!=typeof t.value)return!1;if("string"!=typeof t.text)return!1;if(!t.currency||"object"!=typeof t.currency)return!1;const d=t.value,i=t.text,n=t.currency.code;if(!Number.isFinite(d))return!1;if(!_.canConstruct(d,n))return!1;const a=_.from(d,n);return null!=a&&a.value===d&&a.text===i&&a.currencyCode===n}validate(){try{return _.canConstruct(this.value,this.currencyCode)}catch(e){return!1}}static getTransactionLimits(e){const t=(e=>{switch(e){case"TZS":return{min:1e3,max:15e8};case"KES":return{min:100,max:2e8};default:return{min:1,max:1e6}}})(e);return{min:_.from(t.min,e),max:_.from(t.max,e)}}}function $({minimumFractionDigits:e,maximumFractionDigits:t,currencyDigits:d}){const i=e??(void 0!==t&&d>=t?0:d);return{minimumFractionDigits:i,maximumFractionDigits:t??Math.max(i,d)}}var A=[{fullName:"CRDB BANK PLC",shortName:"CRDB",swiftCode:"CORUTZTZ"},{fullName:"PEOPLE'S BANK OF ZANZIBAR LTD",shortName:"PBZ",swiftCode:"PBZATZTZ"},{fullName:"STANDARD CHARTERED BANK (T) LIMITED",shortName:"SCB",swiftCode:"SCBLTZTX"},{fullName:"STANBIC BANK TANZANIA LTD.",shortName:"STANBIC",swiftCode:"SBICTZTX"},{fullName:"CITIBANK TANZANIA LTD",shortName:"CITI",swiftCode:"CITITZTZ"},{fullName:"BANK OF AFRICA TANZANIA LIMITED",shortName:"BOA",swiftCode:"EUAFTZTZ"},{fullName:"DIAMOND TRUST BANK TANZANIA LTD",shortName:"DTB",swiftCode:"DTKETZTZ"},{fullName:"AKIBA COMMERCIAL BANK LTD",shortName:"AKIBA",swiftCode:"AKCOTZTZ"},{fullName:"EXIM BANK (TANZANIA) LTD",shortName:"EXIM",swiftCode:"EXTNTZTZ"},{fullName:"KILIMANJARO CO-OPERATIVE BANK LTD",shortName:"KILIMANJARO",swiftCode:"KLMJTZTZ"},{fullName:"NATIONAL BANK OF COMMERCE LTD",shortName:"NBC",swiftCode:"NLCBTZTX"},{fullName:"NATIONAL MICROFINANCE BANK LIMITED",shortName:"NMB",swiftCode:"NMIBTZTZ"},{fullName:"KCB BANK TANZANIA LIMITED",shortName:"KCB",swiftCode:"KCBLTZTZ"},{fullName:"HABIB AFRICAN BANK LIMITED",shortName:"HABIB",swiftCode:"HABLTZTZ"},{fullName:"INTERNATIONAL COMMERCIAL BANK (TANZANIA) LIMITED",shortName:"ICB",swiftCode:"BKMYTZTZ"},{fullName:"ABSA BANK TANZANIA LTD",shortName:"ABSA",swiftCode:"BARCTZTZ"},{fullName:"I&M BANK LIMITED",shortName:"IMBANK",swiftCode:"IMBLTZTZ"},{fullName:"NCBA BANK LIMITED",shortName:"NCBA",swiftCode:"CBAFTZTZ"},{fullName:"DAR ES SALAAM COMMUNITY BANK LTD",shortName:"DCB",swiftCode:"DASUTZTZ"},{fullName:"BANK OF BARODA (TANZANIA) LTD",shortName:"BARODA",swiftCode:"BARBTZTZ"},{fullName:"AZANIA BANK LIMITED",shortName:"AZANIA",swiftCode:"AZANTZTZ"},{fullName:"UCHUMI COMMERCIAL BANK (T) LTD",shortName:"UCHUMI",swiftCode:"UCCTTZTZ"},{fullName:"AFRICAN BANKING CORPORATION TANZANIA LIMITED",shortName:"BANCABC",swiftCode:"FMBZTZTX"},{fullName:"ACCESSBANK TANZANIA LTD",shortName:"ACCESS",swiftCode:"ACTZTZTZ"},{fullName:"BANK OF INDIA (TANZANIA) LIMITED",shortName:"BOI",swiftCode:"BKIDTZTZ"},{fullName:"UNITED BANK FOR AFRICA (T) LTD",shortName:"UBA",swiftCode:"UNAFTZTZ"},{fullName:"MKOMBOZI COMMERCIAL BANK",shortName:"MKOMBOZI",swiftCode:"MKCBTZTZ"},{fullName:"ECOBANK TANZANIA LIMITED",shortName:"ECOBANK",swiftCode:"ECOCTZTZ"},{fullName:"MWANGA HAKIKA MICROFINANCE BANK LIMITED",shortName:"MWANGA",swiftCode:"MWCBTZTZ"},{fullName:"FIRST NATIONAL BANK LIMITED",shortName:"FNB",swiftCode:"FIRNTZTX"},{fullName:"AMANA BANK LIMITED",shortName:"AMANA",swiftCode:"AMNNTZTZ"},{fullName:"EQUITY BANK TANZANIA LIMITED",shortName:"EQUITY",swiftCode:"EQBLTZTZ"},{fullName:"TANZANIA COMMERCIAL BANK PLC",shortName:"TCB",swiftCode:"TAPBTZTZ"},{fullName:"MAENDELEO BANK LTD",shortName:"MAENDELEO",swiftCode:"MBTLTZTZ"},{fullName:"CANARA BANK TANZANIA LTD",shortName:"CANARA",swiftCode:"CNRBTZTZ"},{fullName:"MWALIMU COMMERCIAL BANK PLC",shortName:"MWALIMU",swiftCode:"MWCOTZTZ"},{fullName:"GUARANTY TRUST BANK (T) LTD",shortName:"GT BANK",swiftCode:"GTBITZTZ"},{fullName:"YETU MICROFINANCE BANK PLC",shortName:"YETU",swiftCode:"YETMTZTZ"},{fullName:"CHINA DASHENG BANK LIMITED",shortName:"DASHENG",swiftCode:"CDSHTZTZ"}],N=[{fullName:"KENYA COMMERCIAL BANK LIMITED",shortName:"KCB",swiftCode:"KCBLKENX"},{fullName:"STANDARD CHARTERED BANK KENYA LTD",shortName:"Standard Chartered",swiftCode:"SCBLKENX"},{fullName:"ABSA BANK KENYA PLC",shortName:"Absa Bank Kenya",swiftCode:"BARCKENX"},{fullName:"BANK OF BARODA",shortName:"Bank of Baroda",swiftCode:"BARBKENA"},{fullName:"NCBA BANK KENYA PLC",shortName:"NCBA Bank",swiftCode:"CBAFKENX"},{fullName:"PRIME BANK LTD",shortName:"Prime Bank",swiftCode:"PRIEKENX"},{fullName:"CO-OPERATIVE BANK OF KENYA LTD",shortName:"Co-op Bank",swiftCode:"KCOOKENA"},{fullName:"NATIONAL BANK OF KENYA LTD",shortName:"National Bank",swiftCode:"NBKEKENX"},{fullName:"M-ORIENTAL BANK LTD",shortName:"M-Oriental Bank",swiftCode:"MORBKENA"},{fullName:"CITIBANK N.A. KENYA",shortName:"Citibank Kenya",swiftCode:"CITIKENA"},{fullName:"HABIB BANK A.G. ZURICH",shortName:"Habib Bank AG Zurich",swiftCode:"HBZUKENA"},{fullName:"MIDDLE EAST BANK KENYA LTD",shortName:"Middle East Bank",swiftCode:"MIEKKENA"},{fullName:"BANK OF AFRICA KENYA LTD",shortName:"Bank of Africa",swiftCode:"AFRIKENX"},{fullName:"CONSOLIDATED BANK OF KENYA LTD",shortName:"Consolidated Bank",swiftCode:"CONKKENA"},{fullName:"CREDIT BANK LTD",shortName:"Credit Bank",swiftCode:"CRBTKENA"},{fullName:"ACCESS BANK KENYA PLC",shortName:"Access Bank Kenya",swiftCode:"ABNGKENA"},{fullName:"STANBIC BANK KENYA LTD",shortName:"Stanbic Bank",swiftCode:"SBICKENX"},{fullName:"AFRICAN BANKING CORPORATION LTD",shortName:"ABC Bank",swiftCode:"ABCLKENA"},{fullName:"ECOBANK KENYA LTD",shortName:"Ecobank",swiftCode:"ECOCKENA"},{fullName:"CHOICE MICROFINANCE BANK",shortName:"Choice MFB",swiftCode:"CHFIKENX"},{fullName:"PARAMOUNT UNIVERSAL BANK LTD",shortName:"Paramount Universal Bank",swiftCode:"PAUTKENA"},{fullName:"KINGDOM BANK LTD",shortName:"Kingdom Bank",swiftCode:"CIFIKENA"},{fullName:"GUARANTY TRUST BANK KENYA LTD",shortName:"GTBank Kenya",swiftCode:"GTBIKENA"},{fullName:"VICTORIA COMMERCIAL BANK LTD",shortName:"Victoria Commercial Bank",swiftCode:"VICMKENA"},{fullName:"GUARDIAN BANK LTD",shortName:"Guardian Bank",swiftCode:"GUARKENA"},{fullName:"I&M BANK LTD",shortName:"I&M Bank",swiftCode:"IMBLKENA"},{fullName:"DEVELOPMENT BANK OF KENYA LTD",shortName:"Development Bank of Kenya",swiftCode:"DEVKKENA"},{fullName:"SBM BANK KENYA LTD",shortName:"SBM Bank Kenya",swiftCode:"SBMKKENA"},{fullName:"HOUSING FINANCE BANK",shortName:"HF Bank",swiftCode:"HFCOKENA"},{fullName:"DIAMOND TRUST BANK KENYA LTD",shortName:"DTB",swiftCode:"DTKEKENA"},{fullName:"SIDIAN BANK LTD",shortName:"Sidian Bank",swiftCode:"SIDNKENA"},{fullName:"EQUITY BANK LTD",shortName:"Equity Bank",swiftCode:"EQBLKENA"},{fullName:"FAMILY BANK LTD",shortName:"Family Bank",swiftCode:"FABLKENA"},{fullName:"GULF AFRICAN BANK LTD",shortName:"Gulf African Bank",swiftCode:"GAFRKENA"},{fullName:"DIB BANK KENYA LTD",shortName:"DIB Bank",swiftCode:"DUIBKENA"},{fullName:"UBA KENYA BANK LTD",shortName:"UBA Kenya",swiftCode:"UNAFKENA"},{fullName:"KENYA WOMEN MICROFINANCE BANK",shortName:"KWFT",swiftCode:"KWMIKENX"},{fullName:"FAULU MICROFINANCE BANK LTD",shortName:"Faulu MFB",swiftCode:"FAUMKENA"}];const g=["TZ"];const y=/^(?=.*\p{L}.*\p{L})[\p{L}]['\p{L}.-]*(?:\s+[\p{L}]['\p{L}.-]*)+$/u,p=/^[\p{L}\p{N}\s\-'.&()]+$/u;function h(e){if(!e||"string"!=typeof e)return!1;const t=e.trim();return!(t.length<2||t.length>100)&&(t===e&&y.test(e))}function E(e){if(!e||"string"!=typeof e)return!1;const t=e.trim();return!(t.length<2||t.length>150)&&(t===e&&p.test(e))}const C={capitalizeFirstLetter:function(e){return 0===e.length?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},getFullName:function(e,t){return`${e} ${t}`},generateSlug:function(e){return e.toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/\s+/g,"-").replace(/-+/g,"-")},abbreviateName:function(e){if(0===e.trim().length)return"";const t=e.trim().split(" ");return 1===t.length?e:`${t[0]} ${t[t.length-1].charAt(0)}.`},getInitialsFrom:function(e){let t="";const d=(e??"").trim().split(" ");if(0===d.length)return"";const i=d[0];if(t=i.charAt(0),d.length>1){const e=d[d.length-1];t=`${i.charAt(0)}${e.charAt(0)}`}return t.toUpperCase()},validatePersonalName:h,validateBusinessName:E,validateName:function(e){if(!e||"string"!=typeof e)return!1;const t=e.trim();return!(t.length<2||t.length>150)&&(t===e&&(h(e)||E(e)))}},S=new Set(N.map((e=>e.swiftCode))),R=new Set(A.map((e=>e.swiftCode))),I={validateAccountNumber:(e,t)=>"TZ"===t?function(e){if(!e)return!1;const t=e.trim();return t.length>8&&t.length<20}(e):"KE"===t&&function(e){if(!e)return!1;const t=e.trim(),d=t.length,i=10===d||12===d||15===d,n=/^[A-Z0-9]+$/i.test(t);return i&&n}(e),validateAccountNumberForAnyCountry:e=>g.some((t=>I.validateAccountNumber(e,t))),validateSwiftCode:(e,t)=>"TZ"===t?b(e):"KE"===t&&T(e),validateSwiftCodeForAnyCountry:e=>g.some((t=>I.validateSwiftCode(e,t))),validateAccountName:e=>!(!e||"string"!=typeof e)&&C.validateName(e),validateAccountNameForAnyCountry:e=>I.validateAccountName(e),validateAllBankDetails:(e,t,d,i)=>I.validateAccountNumber(e,i)&&I.validateSwiftCode(t,i)&&I.validateAccountName(d),validateAllBankDetailsForAnyCountry:(e,t,d)=>I.validateAccountNumberForAnyCountry(e)&&I.validateSwiftCodeForAnyCountry(t)&&I.validateAccountNameForAnyCountry(d),getCountryFromSwiftCode:e=>b(e)?"TZ":T(e)?"KE":void 0};function T(e){return!!e&&S.has(e)}function b(e){return!!e&&R.has(e)}const O=e.z.string().length(8,{message:"SWIFT code must be exactly 8 characters"}).refine((e=>R.has(e)),{message:"Invalid SWIFT code"}),M=e.z.string().length(8,{message:"SWIFT code must be exactly 8 characters"}).refine((e=>S.has(e)),{message:"Invalid SWIFT code"}),D=e.z.object({swiftCode:e.z.string().length(8),countryCode:e.z.string().length(2),version:e.z.string().optional().default("1.0")});class L{fullName;shortName;swiftCode;countryCode;constructor(e,t,d,i){this.fullName=e,this.shortName=t,this.swiftCode=d,this.countryCode=i}toString(){return`${this.fullName} (${this.shortName}) - SWIFT: ${this.swiftCode} [${this.countryCode}]`}static from(e,t){const d=v.getInstance().getBankBySwiftCode(t,e);if(!d)throw new Error(`Bank with SWIFT code ${e} not found in country ${t}.`);return d}toObject(){return{fullName:this.fullName,shortName:this.shortName,swiftCode:this.swiftCode,countryCode:this.countryCode}}static is(e){if("object"!=typeof e||null===e)return!1;const t=e;if(!("string"==typeof t.fullName&&"string"==typeof t.shortName&&"string"==typeof t.swiftCode&&"string"==typeof t.countryCode))return!1;const d=v.getInstance().getBankBySwiftCode(t.countryCode,t.swiftCode);return!!d&&(d.fullName===t.fullName&&d.shortName===t.shortName)}toJSON(){return{swiftCode:this.swiftCode,countryCode:this.countryCode,version:"1.0"}}toJSONString(){return JSON.stringify(this.toJSON())}static fromJSON(e){try{const t="string"==typeof e?JSON.parse(e):e,d=D.safeParse(t);if(!d.success)return void console.error("Invalid BankJSON:",d.error.flatten());const i=d.data;if(!I.validateSwiftCode(i.swiftCode,i.countryCode))return void console.warn(`Invalid BankJSON: invalid SWIFT code '${i.swiftCode}' for country '${i.countryCode}'`);const n=L.from(i.swiftCode,i.countryCode);return n||void console.warn(`Invalid BankJSON: bank with SWIFT code '${i.swiftCode}' not found in country '${i.countryCode}'`)}catch(e){return void console.error("Error parsing BankJSON:",e)}}static fromJSONString(e){return L.fromJSON(e)}static isBankJSON(e){return D.safeParse(e).success}}class v{static instance;loadedData=new Map;constructor(){}static getInstance(){return v.instance||(v.instance=new v,v.instance.initializeCountry("TZ"),v.instance.initializeCountry("KE")),v.instance}initializeCountry(e){const t=e.toUpperCase();if(this.loadedData.has(t))return!0;let d=null;switch(t){case"TZ":try{d=A}catch(e){return console.error("Failed to load/process data for TZ:",e),!1}break;case"KE":try{d=N}catch(e){return console.error("Failed to load/process data for KE:",e),!1}break;default:return console.error(`Bank data loading not implemented for country: ${t}`),!1}if(!d||0===d.length)return console.error(`No raw data or empty array for ${t}`),!1;const i=[],n=new Map;try{return d.forEach((d=>{if(!d.fullName||!d.shortName||!d.swiftCode)return void console.warn(`Skipping invalid bank data item in ${t}:`,d);const a=new L(d.fullName,d.shortName,d.swiftCode,e);i.push(a),n.set(a.swiftCode.toUpperCase(),a)})),this.loadedData.set(t,{list:i,swiftMap:n}),!0}catch(e){return console.error(`Error processing bank data for ${t}:`,e),this.loadedData.delete(t),!1}}getCountryData(e){const t=e.toUpperCase();return this.loadedData.has(t)||this.initializeCountry(e),this.loadedData.get(t)}getBankBySwiftCode(e,t){const d=this.getCountryData(e);return d?.swiftMap.get(t.toUpperCase())}getAllBanks(e){const t=this.getCountryData(e);return t?[...t.list]:[]}getAllSupportedBanks(){let e=[];for(const t of g){const d=this.getAllBanks(t);e.push(...d)}return e}detectBank(e){if(!I.validateSwiftCodeForAnyCountry(e))return;let t;for(const d of g){const i=this.getBankBySwiftCode(d,e);if(i){t=i;break}}return t}searchBanks(e,t,d=10){if(!t||"string"!=typeof t)return[];const i=this.getCountryData(e);if(!i)return[];const n=t.toLowerCase().trim();if(0===n.length)return[];return i.list.filter((e=>e.fullName.toLowerCase().includes(n)||e.shortName.toLowerCase().includes(n)||e.swiftCode.toLowerCase().includes(n))).slice(0,d)}}var B={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE