nd.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. package nd
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type nd struct {
  10. locale string
  11. pluralsCardinal []locales.PluralRule
  12. pluralsOrdinal []locales.PluralRule
  13. pluralsRange []locales.PluralRule
  14. decimal string
  15. group string
  16. minus string
  17. percent string
  18. perMille string
  19. timeSeparator string
  20. inifinity string
  21. currencies []string // idx = enum of currency code
  22. currencyNegativePrefix string
  23. currencyNegativeSuffix string
  24. monthsAbbreviated []string
  25. monthsNarrow []string
  26. monthsWide []string
  27. daysAbbreviated []string
  28. daysNarrow []string
  29. daysShort []string
  30. daysWide []string
  31. periodsAbbreviated []string
  32. periodsNarrow []string
  33. periodsShort []string
  34. periodsWide []string
  35. erasAbbreviated []string
  36. erasNarrow []string
  37. erasWide []string
  38. timezones map[string]string
  39. }
  40. // New returns a new instance of translator for the 'nd' locale
  41. func New() locales.Translator {
  42. return &nd{
  43. locale: "nd",
  44. pluralsCardinal: []locales.PluralRule{2, 6},
  45. pluralsOrdinal: nil,
  46. pluralsRange: nil,
  47. timeSeparator: ":",
  48. currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
  49. currencyNegativePrefix: "(",
  50. currencyNegativeSuffix: ")",
  51. monthsAbbreviated: []string{"", "Zib", "Nhlo", "Mbi", "Mab", "Nkw", "Nhla", "Ntu", "Ncw", "Mpan", "Mfu", "Lwe", "Mpal"},
  52. monthsNarrow: []string{"", "Z", "N", "M", "M", "N", "N", "N", "N", "M", "M", "L", "M"},
  53. monthsWide: []string{"", "Zibandlela", "Nhlolanja", "Mbimbitho", "Mabasa", "Nkwenkwezi", "Nhlangula", "Ntulikazi", "Ncwabakazi", "Mpandula", "Mfumfu", "Lwezi", "Mpalakazi"},
  54. daysAbbreviated: []string{"Son", "Mvu", "Sib", "Sit", "Sin", "Sih", "Mgq"},
  55. daysNarrow: []string{"S", "M", "S", "S", "S", "S", "M"},
  56. daysWide: []string{"Sonto", "Mvulo", "Sibili", "Sithathu", "Sine", "Sihlanu", "Mgqibelo"},
  57. erasAbbreviated: []string{"BC", "AD"},
  58. erasNarrow: []string{"", ""},
  59. erasWide: []string{"UKristo angakabuyi", "Ukristo ebuyile"},
  60. timezones: map[string]string{"MDT": "MDT", "COST": "COST", "HEEG": "HEEG", "LHST": "LHST", "HNNOMX": "HNNOMX", "SRT": "SRT", "ADT": "ADT", "NZDT": "NZDT", "AKDT": "AKDT", "WART": "WART", "WARST": "WARST", "WITA": "WITA", "AWDT": "AWDT", "NZST": "NZST", "ACDT": "ACDT", "HNOG": "HNOG", "HNPM": "HNPM", "CHADT": "CHADT", "PST": "PST", "AEDT": "AEDT", "JDT": "JDT", "TMT": "TMT", "AKST": "AKST", "HKST": "HKST", "∅∅∅": "∅∅∅", "GMT": "GMT", "CDT": "CDT", "AEST": "AEST", "CST": "CST", "AST": "AST", "BOT": "BOT", "ACST": "ACST", "WIT": "WIT", "OEZ": "OEZ", "COT": "COT", "ChST": "ChST", "ART": "ART", "GYT": "GYT", "AWST": "AWST", "EDT": "EDT", "HAT": "HAT", "HEPM": "HEPM", "WAST": "WAST", "WEZ": "WEZ", "ECT": "ECT", "HNT": "HNT", "MST": "MST", "EAT": "EAT", "PDT": "PDT", "WESZ": "WESZ", "JST": "JST", "BT": "BT", "SGT": "SGT", "VET": "VET", "TMST": "TMST", "ARST": "ARST", "UYT": "UYT", "WIB": "WIB", "UYST": "UYST", "ACWST": "ACWST", "HNEG": "HNEG", "HEOG": "HEOG", "CLT": "CLT", "OESZ": "OESZ", "HAST": "HAST", "HADT": "HADT", "HENOMX": "HENOMX", "EST": "EST", "HKT": "HKT", "LHDT": "LHDT", "CAT": "CAT", "WAT": "WAT", "ACWDT": "ACWDT", "MEZ": "MEZ", "HNPMX": "HNPMX", "HEPMX": "HEPMX", "SAST": "SAST", "GFT": "GFT", "MYT": "MYT", "MESZ": "MESZ", "IST": "IST", "CLST": "CLST", "CHAST": "CHAST", "HNCU": "HNCU", "HECU": "HECU"},
  61. }
  62. }
  63. // Locale returns the current translators string locale
  64. func (nd *nd) Locale() string {
  65. return nd.locale
  66. }
  67. // PluralsCardinal returns the list of cardinal plural rules associated with 'nd'
  68. func (nd *nd) PluralsCardinal() []locales.PluralRule {
  69. return nd.pluralsCardinal
  70. }
  71. // PluralsOrdinal returns the list of ordinal plural rules associated with 'nd'
  72. func (nd *nd) PluralsOrdinal() []locales.PluralRule {
  73. return nd.pluralsOrdinal
  74. }
  75. // PluralsRange returns the list of range plural rules associated with 'nd'
  76. func (nd *nd) PluralsRange() []locales.PluralRule {
  77. return nd.pluralsRange
  78. }
  79. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'nd'
  80. func (nd *nd) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  81. n := math.Abs(num)
  82. if n == 1 {
  83. return locales.PluralRuleOne
  84. }
  85. return locales.PluralRuleOther
  86. }
  87. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'nd'
  88. func (nd *nd) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  89. return locales.PluralRuleUnknown
  90. }
  91. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'nd'
  92. func (nd *nd) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  93. return locales.PluralRuleUnknown
  94. }
  95. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  96. func (nd *nd) MonthAbbreviated(month time.Month) string {
  97. return nd.monthsAbbreviated[month]
  98. }
  99. // MonthsAbbreviated returns the locales abbreviated months
  100. func (nd *nd) MonthsAbbreviated() []string {
  101. return nd.monthsAbbreviated[1:]
  102. }
  103. // MonthNarrow returns the locales narrow month given the 'month' provided
  104. func (nd *nd) MonthNarrow(month time.Month) string {
  105. return nd.monthsNarrow[month]
  106. }
  107. // MonthsNarrow returns the locales narrow months
  108. func (nd *nd) MonthsNarrow() []string {
  109. return nd.monthsNarrow[1:]
  110. }
  111. // MonthWide returns the locales wide month given the 'month' provided
  112. func (nd *nd) MonthWide(month time.Month) string {
  113. return nd.monthsWide[month]
  114. }
  115. // MonthsWide returns the locales wide months
  116. func (nd *nd) MonthsWide() []string {
  117. return nd.monthsWide[1:]
  118. }
  119. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  120. func (nd *nd) WeekdayAbbreviated(weekday time.Weekday) string {
  121. return nd.daysAbbreviated[weekday]
  122. }
  123. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  124. func (nd *nd) WeekdaysAbbreviated() []string {
  125. return nd.daysAbbreviated
  126. }
  127. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  128. func (nd *nd) WeekdayNarrow(weekday time.Weekday) string {
  129. return nd.daysNarrow[weekday]
  130. }
  131. // WeekdaysNarrow returns the locales narrow weekdays
  132. func (nd *nd) WeekdaysNarrow() []string {
  133. return nd.daysNarrow
  134. }
  135. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  136. func (nd *nd) WeekdayShort(weekday time.Weekday) string {
  137. return nd.daysShort[weekday]
  138. }
  139. // WeekdaysShort returns the locales short weekdays
  140. func (nd *nd) WeekdaysShort() []string {
  141. return nd.daysShort
  142. }
  143. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  144. func (nd *nd) WeekdayWide(weekday time.Weekday) string {
  145. return nd.daysWide[weekday]
  146. }
  147. // WeekdaysWide returns the locales wide weekdays
  148. func (nd *nd) WeekdaysWide() []string {
  149. return nd.daysWide
  150. }
  151. // Decimal returns the decimal point of number
  152. func (nd *nd) Decimal() string {
  153. return nd.decimal
  154. }
  155. // Group returns the group of number
  156. func (nd *nd) Group() string {
  157. return nd.group
  158. }
  159. // Group returns the minus sign of number
  160. func (nd *nd) Minus() string {
  161. return nd.minus
  162. }
  163. // FmtNumber returns 'num' with digits/precision of 'v' for 'nd' and handles both Whole and Real numbers based on 'v'
  164. func (nd *nd) FmtNumber(num float64, v uint64) string {
  165. return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  166. }
  167. // FmtPercent returns 'num' with digits/precision of 'v' for 'nd' and handles both Whole and Real numbers based on 'v'
  168. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  169. func (nd *nd) FmtPercent(num float64, v uint64) string {
  170. return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  171. }
  172. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'nd'
  173. func (nd *nd) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  174. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  175. symbol := nd.currencies[currency]
  176. l := len(s) + len(symbol) + 0
  177. count := 0
  178. inWhole := v == 0
  179. b := make([]byte, 0, l)
  180. for i := len(s) - 1; i >= 0; i-- {
  181. if s[i] == '.' {
  182. b = append(b, nd.decimal[0])
  183. inWhole = true
  184. continue
  185. }
  186. if inWhole {
  187. if count == 3 {
  188. b = append(b, nd.group[0])
  189. count = 1
  190. } else {
  191. count++
  192. }
  193. }
  194. b = append(b, s[i])
  195. }
  196. for j := len(symbol) - 1; j >= 0; j-- {
  197. b = append(b, symbol[j])
  198. }
  199. if num < 0 {
  200. b = append(b, nd.minus[0])
  201. }
  202. // reverse
  203. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  204. b[i], b[j] = b[j], b[i]
  205. }
  206. if int(v) < 2 {
  207. if v == 0 {
  208. b = append(b, nd.decimal...)
  209. }
  210. for i := 0; i < 2-int(v); i++ {
  211. b = append(b, '0')
  212. }
  213. }
  214. return string(b)
  215. }
  216. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'nd'
  217. // in accounting notation.
  218. func (nd *nd) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  219. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  220. symbol := nd.currencies[currency]
  221. l := len(s) + len(symbol) + 2
  222. count := 0
  223. inWhole := v == 0
  224. b := make([]byte, 0, l)
  225. for i := len(s) - 1; i >= 0; i-- {
  226. if s[i] == '.' {
  227. b = append(b, nd.decimal[0])
  228. inWhole = true
  229. continue
  230. }
  231. if inWhole {
  232. if count == 3 {
  233. b = append(b, nd.group[0])
  234. count = 1
  235. } else {
  236. count++
  237. }
  238. }
  239. b = append(b, s[i])
  240. }
  241. if num < 0 {
  242. for j := len(symbol) - 1; j >= 0; j-- {
  243. b = append(b, symbol[j])
  244. }
  245. b = append(b, nd.currencyNegativePrefix[0])
  246. } else {
  247. for j := len(symbol) - 1; j >= 0; j-- {
  248. b = append(b, symbol[j])
  249. }
  250. }
  251. // reverse
  252. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  253. b[i], b[j] = b[j], b[i]
  254. }
  255. if int(v) < 2 {
  256. if v == 0 {
  257. b = append(b, nd.decimal...)
  258. }
  259. for i := 0; i < 2-int(v); i++ {
  260. b = append(b, '0')
  261. }
  262. }
  263. if num < 0 {
  264. b = append(b, nd.currencyNegativeSuffix...)
  265. }
  266. return string(b)
  267. }
  268. // FmtDateShort returns the short date representation of 't' for 'nd'
  269. func (nd *nd) FmtDateShort(t time.Time) string {
  270. b := make([]byte, 0, 32)
  271. if t.Day() < 10 {
  272. b = append(b, '0')
  273. }
  274. b = strconv.AppendInt(b, int64(t.Day()), 10)
  275. b = append(b, []byte{0x2f}...)
  276. if t.Month() < 10 {
  277. b = append(b, '0')
  278. }
  279. b = strconv.AppendInt(b, int64(t.Month()), 10)
  280. b = append(b, []byte{0x2f}...)
  281. if t.Year() > 0 {
  282. b = strconv.AppendInt(b, int64(t.Year()), 10)
  283. } else {
  284. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  285. }
  286. return string(b)
  287. }
  288. // FmtDateMedium returns the medium date representation of 't' for 'nd'
  289. func (nd *nd) FmtDateMedium(t time.Time) string {
  290. b := make([]byte, 0, 32)
  291. b = strconv.AppendInt(b, int64(t.Day()), 10)
  292. b = append(b, []byte{0x20}...)
  293. b = append(b, nd.monthsAbbreviated[t.Month()]...)
  294. b = append(b, []byte{0x20}...)
  295. if t.Year() > 0 {
  296. b = strconv.AppendInt(b, int64(t.Year()), 10)
  297. } else {
  298. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  299. }
  300. return string(b)
  301. }
  302. // FmtDateLong returns the long date representation of 't' for 'nd'
  303. func (nd *nd) FmtDateLong(t time.Time) string {
  304. b := make([]byte, 0, 32)
  305. b = strconv.AppendInt(b, int64(t.Day()), 10)
  306. b = append(b, []byte{0x20}...)
  307. b = append(b, nd.monthsWide[t.Month()]...)
  308. b = append(b, []byte{0x20}...)
  309. if t.Year() > 0 {
  310. b = strconv.AppendInt(b, int64(t.Year()), 10)
  311. } else {
  312. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  313. }
  314. return string(b)
  315. }
  316. // FmtDateFull returns the full date representation of 't' for 'nd'
  317. func (nd *nd) FmtDateFull(t time.Time) string {
  318. b := make([]byte, 0, 32)
  319. b = append(b, nd.daysWide[t.Weekday()]...)
  320. b = append(b, []byte{0x2c, 0x20}...)
  321. b = strconv.AppendInt(b, int64(t.Day()), 10)
  322. b = append(b, []byte{0x20}...)
  323. b = append(b, nd.monthsWide[t.Month()]...)
  324. b = append(b, []byte{0x20}...)
  325. if t.Year() > 0 {
  326. b = strconv.AppendInt(b, int64(t.Year()), 10)
  327. } else {
  328. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  329. }
  330. return string(b)
  331. }
  332. // FmtTimeShort returns the short time representation of 't' for 'nd'
  333. func (nd *nd) FmtTimeShort(t time.Time) string {
  334. b := make([]byte, 0, 32)
  335. if t.Hour() < 10 {
  336. b = append(b, '0')
  337. }
  338. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  339. b = append(b, nd.timeSeparator...)
  340. if t.Minute() < 10 {
  341. b = append(b, '0')
  342. }
  343. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  344. return string(b)
  345. }
  346. // FmtTimeMedium returns the medium time representation of 't' for 'nd'
  347. func (nd *nd) FmtTimeMedium(t time.Time) string {
  348. b := make([]byte, 0, 32)
  349. if t.Hour() < 10 {
  350. b = append(b, '0')
  351. }
  352. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  353. b = append(b, nd.timeSeparator...)
  354. if t.Minute() < 10 {
  355. b = append(b, '0')
  356. }
  357. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  358. b = append(b, nd.timeSeparator...)
  359. if t.Second() < 10 {
  360. b = append(b, '0')
  361. }
  362. b = strconv.AppendInt(b, int64(t.Second()), 10)
  363. return string(b)
  364. }
  365. // FmtTimeLong returns the long time representation of 't' for 'nd'
  366. func (nd *nd) FmtTimeLong(t time.Time) string {
  367. b := make([]byte, 0, 32)
  368. if t.Hour() < 10 {
  369. b = append(b, '0')
  370. }
  371. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  372. b = append(b, nd.timeSeparator...)
  373. if t.Minute() < 10 {
  374. b = append(b, '0')
  375. }
  376. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  377. b = append(b, nd.timeSeparator...)
  378. if t.Second() < 10 {
  379. b = append(b, '0')
  380. }
  381. b = strconv.AppendInt(b, int64(t.Second()), 10)
  382. b = append(b, []byte{0x20}...)
  383. tz, _ := t.Zone()
  384. b = append(b, tz...)
  385. return string(b)
  386. }
  387. // FmtTimeFull returns the full time representation of 't' for 'nd'
  388. func (nd *nd) FmtTimeFull(t time.Time) string {
  389. b := make([]byte, 0, 32)
  390. if t.Hour() < 10 {
  391. b = append(b, '0')
  392. }
  393. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  394. b = append(b, nd.timeSeparator...)
  395. if t.Minute() < 10 {
  396. b = append(b, '0')
  397. }
  398. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  399. b = append(b, nd.timeSeparator...)
  400. if t.Second() < 10 {
  401. b = append(b, '0')
  402. }
  403. b = strconv.AppendInt(b, int64(t.Second()), 10)
  404. b = append(b, []byte{0x20}...)
  405. tz, _ := t.Zone()
  406. if btz, ok := nd.timezones[tz]; ok {
  407. b = append(b, btz...)
  408. } else {
  409. b = append(b, tz...)
  410. }
  411. return string(b)
  412. }