@formatjs/intl-relativetimeformat 12.2.4 → 12.3.2

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.
Files changed (601) hide show
  1. package/index.d.ts +46 -14
  2. package/index.js +358 -52
  3. package/index.js.map +1 -0
  4. package/locale-data/af-NA.js +309 -0
  5. package/locale-data/af.js +309 -0
  6. package/locale-data/agq.js +255 -0
  7. package/locale-data/ak.js +303 -0
  8. package/locale-data/am.js +309 -0
  9. package/locale-data/ar-AE.js +501 -0
  10. package/locale-data/ar-BH.js +501 -0
  11. package/locale-data/ar-DJ.js +501 -0
  12. package/locale-data/ar-DZ.js +501 -0
  13. package/locale-data/ar-EG.js +501 -0
  14. package/locale-data/ar-EH.js +501 -0
  15. package/locale-data/ar-ER.js +501 -0
  16. package/locale-data/ar-IL.js +501 -0
  17. package/locale-data/ar-IQ.js +501 -0
  18. package/locale-data/ar-JO.js +501 -0
  19. package/locale-data/ar-KM.js +501 -0
  20. package/locale-data/ar-KW.js +501 -0
  21. package/locale-data/ar-LB.js +501 -0
  22. package/locale-data/ar-LY.js +501 -0
  23. package/locale-data/ar-MA.js +501 -0
  24. package/locale-data/ar-MR.js +501 -0
  25. package/locale-data/ar-OM.js +501 -0
  26. package/locale-data/ar-PS.js +501 -0
  27. package/locale-data/ar-QA.js +501 -0
  28. package/locale-data/ar-SA.js +501 -0
  29. package/locale-data/ar-SD.js +501 -0
  30. package/locale-data/ar-SO.js +501 -0
  31. package/locale-data/ar-SS.js +501 -0
  32. package/locale-data/ar-SY.js +501 -0
  33. package/locale-data/ar-TD.js +501 -0
  34. package/locale-data/ar-TN.js +501 -0
  35. package/locale-data/ar-YE.js +501 -0
  36. package/locale-data/ar.js +501 -0
  37. package/locale-data/as.js +309 -0
  38. package/locale-data/asa.js +255 -0
  39. package/locale-data/ast.js +309 -0
  40. package/locale-data/az-Cyrl.js +255 -0
  41. package/locale-data/az-Latn.js +303 -0
  42. package/locale-data/az.js +303 -0
  43. package/locale-data/bas.js +255 -0
  44. package/locale-data/be-tarask.js +405 -0
  45. package/locale-data/be.js +405 -0
  46. package/locale-data/bem.js +255 -0
  47. package/locale-data/bez.js +255 -0
  48. package/locale-data/bg.js +309 -0
  49. package/locale-data/bm.js +255 -0
  50. package/locale-data/bn-IN.js +309 -0
  51. package/locale-data/bn.js +309 -0
  52. package/locale-data/bo-IN.js +261 -0
  53. package/locale-data/bo.js +261 -0
  54. package/locale-data/br.js +450 -0
  55. package/locale-data/brx.js +303 -0
  56. package/locale-data/bs-Cyrl.js +345 -0
  57. package/locale-data/bs-Latn.js +357 -0
  58. package/locale-data/bs.js +357 -0
  59. package/locale-data/ca-AD.js +309 -0
  60. package/locale-data/ca-ES-valencia.js +309 -0
  61. package/locale-data/ca-FR.js +309 -0
  62. package/locale-data/ca-IT.js +309 -0
  63. package/locale-data/ca.js +309 -0
  64. package/locale-data/ccp-IN.js +268 -0
  65. package/locale-data/ccp.js +268 -0
  66. package/locale-data/ce.js +303 -0
  67. package/locale-data/ceb.js +255 -0
  68. package/locale-data/cgg.js +255 -0
  69. package/locale-data/chr.js +303 -0
  70. package/locale-data/ckb-IR.js +255 -0
  71. package/locale-data/ckb.js +255 -0
  72. package/locale-data/cs.js +405 -0
  73. package/locale-data/cy.js +501 -0
  74. package/locale-data/da-GL.js +309 -0
  75. package/locale-data/da.js +309 -0
  76. package/locale-data/dav.js +255 -0
  77. package/locale-data/de-AT.js +309 -0
  78. package/locale-data/de-BE.js +309 -0
  79. package/locale-data/de-CH.js +309 -0
  80. package/locale-data/de-IT.js +309 -0
  81. package/locale-data/de-LI.js +309 -0
  82. package/locale-data/de-LU.js +309 -0
  83. package/locale-data/de.js +309 -0
  84. package/locale-data/dje.js +255 -0
  85. package/locale-data/doi.js +255 -0
  86. package/locale-data/dsb.js +399 -0
  87. package/locale-data/dua.js +255 -0
  88. package/locale-data/dyo.js +255 -0
  89. package/locale-data/dz.js +261 -0
  90. package/locale-data/ebu.js +255 -0
  91. package/locale-data/ee-TG.js +309 -0
  92. package/locale-data/ee.js +309 -0
  93. package/locale-data/el-CY.js +309 -0
  94. package/locale-data/el.js +309 -0
  95. package/locale-data/en-001.js +303 -0
  96. package/locale-data/en-150.js +303 -0
  97. package/locale-data/en-AE.js +303 -0
  98. package/locale-data/en-AG.js +303 -0
  99. package/locale-data/en-AI.js +303 -0
  100. package/locale-data/en-AS.js +303 -0
  101. package/locale-data/en-AT.js +303 -0
  102. package/locale-data/en-AU.js +303 -0
  103. package/locale-data/en-BB.js +303 -0
  104. package/locale-data/en-BE.js +303 -0
  105. package/locale-data/en-BI.js +303 -0
  106. package/locale-data/en-BM.js +303 -0
  107. package/locale-data/en-BS.js +303 -0
  108. package/locale-data/en-BW.js +303 -0
  109. package/locale-data/en-BZ.js +303 -0
  110. package/locale-data/en-CA.js +303 -0
  111. package/locale-data/en-CC.js +303 -0
  112. package/locale-data/en-CH.js +303 -0
  113. package/locale-data/en-CK.js +303 -0
  114. package/locale-data/en-CM.js +303 -0
  115. package/locale-data/en-CX.js +303 -0
  116. package/locale-data/en-CY.js +303 -0
  117. package/locale-data/en-DE.js +303 -0
  118. package/locale-data/en-DG.js +303 -0
  119. package/locale-data/en-DK.js +303 -0
  120. package/locale-data/en-DM.js +303 -0
  121. package/locale-data/en-ER.js +303 -0
  122. package/locale-data/en-FI.js +303 -0
  123. package/locale-data/en-FJ.js +303 -0
  124. package/locale-data/en-FK.js +303 -0
  125. package/locale-data/en-FM.js +303 -0
  126. package/locale-data/en-GB.js +303 -0
  127. package/locale-data/en-GD.js +303 -0
  128. package/locale-data/en-GG.js +303 -0
  129. package/locale-data/en-GH.js +303 -0
  130. package/locale-data/en-GI.js +303 -0
  131. package/locale-data/en-GM.js +303 -0
  132. package/locale-data/en-GU.js +303 -0
  133. package/locale-data/en-GY.js +303 -0
  134. package/locale-data/en-HK.js +303 -0
  135. package/locale-data/en-IE.js +303 -0
  136. package/locale-data/en-IL.js +303 -0
  137. package/locale-data/en-IM.js +303 -0
  138. package/locale-data/en-IN.js +303 -0
  139. package/locale-data/en-IO.js +303 -0
  140. package/locale-data/en-JE.js +303 -0
  141. package/locale-data/en-JM.js +303 -0
  142. package/locale-data/en-KE.js +303 -0
  143. package/locale-data/en-KI.js +303 -0
  144. package/locale-data/en-KN.js +303 -0
  145. package/locale-data/en-KY.js +303 -0
  146. package/locale-data/en-LC.js +303 -0
  147. package/locale-data/en-LR.js +303 -0
  148. package/locale-data/en-LS.js +303 -0
  149. package/locale-data/en-MG.js +303 -0
  150. package/locale-data/en-MH.js +303 -0
  151. package/locale-data/en-MO.js +303 -0
  152. package/locale-data/en-MP.js +303 -0
  153. package/locale-data/en-MS.js +303 -0
  154. package/locale-data/en-MT.js +303 -0
  155. package/locale-data/en-MU.js +303 -0
  156. package/locale-data/en-MW.js +303 -0
  157. package/locale-data/en-MY.js +303 -0
  158. package/locale-data/en-NA.js +303 -0
  159. package/locale-data/en-NF.js +303 -0
  160. package/locale-data/en-NG.js +303 -0
  161. package/locale-data/en-NL.js +303 -0
  162. package/locale-data/en-NR.js +303 -0
  163. package/locale-data/en-NU.js +303 -0
  164. package/locale-data/en-NZ.js +303 -0
  165. package/locale-data/en-PG.js +303 -0
  166. package/locale-data/en-PH.js +303 -0
  167. package/locale-data/en-PK.js +303 -0
  168. package/locale-data/en-PN.js +303 -0
  169. package/locale-data/en-PR.js +303 -0
  170. package/locale-data/en-PW.js +303 -0
  171. package/locale-data/en-RW.js +303 -0
  172. package/locale-data/en-SB.js +303 -0
  173. package/locale-data/en-SC.js +303 -0
  174. package/locale-data/en-SD.js +303 -0
  175. package/locale-data/en-SE.js +303 -0
  176. package/locale-data/en-SG.js +303 -0
  177. package/locale-data/en-SH.js +303 -0
  178. package/locale-data/en-SI.js +303 -0
  179. package/locale-data/en-SL.js +303 -0
  180. package/locale-data/en-SS.js +303 -0
  181. package/locale-data/en-SX.js +303 -0
  182. package/locale-data/en-SZ.js +303 -0
  183. package/locale-data/en-TC.js +303 -0
  184. package/locale-data/en-TK.js +303 -0
  185. package/locale-data/en-TO.js +303 -0
  186. package/locale-data/en-TT.js +303 -0
  187. package/locale-data/en-TV.js +303 -0
  188. package/locale-data/en-TZ.js +303 -0
  189. package/locale-data/en-UG.js +303 -0
  190. package/locale-data/en-UM.js +303 -0
  191. package/locale-data/en-VC.js +303 -0
  192. package/locale-data/en-VG.js +303 -0
  193. package/locale-data/en-VI.js +303 -0
  194. package/locale-data/en-VU.js +303 -0
  195. package/locale-data/en-WS.js +303 -0
  196. package/locale-data/en-ZA.js +303 -0
  197. package/locale-data/en-ZM.js +303 -0
  198. package/locale-data/en-ZW.js +303 -0
  199. package/locale-data/en.js +303 -0
  200. package/locale-data/eo.js +303 -0
  201. package/locale-data/es-419.js +309 -0
  202. package/locale-data/es-AR.js +309 -0
  203. package/locale-data/es-BO.js +309 -0
  204. package/locale-data/es-BR.js +309 -0
  205. package/locale-data/es-BZ.js +309 -0
  206. package/locale-data/es-CL.js +309 -0
  207. package/locale-data/es-CO.js +309 -0
  208. package/locale-data/es-CR.js +309 -0
  209. package/locale-data/es-CU.js +309 -0
  210. package/locale-data/es-DO.js +309 -0
  211. package/locale-data/es-EA.js +309 -0
  212. package/locale-data/es-EC.js +309 -0
  213. package/locale-data/es-GQ.js +309 -0
  214. package/locale-data/es-GT.js +309 -0
  215. package/locale-data/es-HN.js +309 -0
  216. package/locale-data/es-IC.js +309 -0
  217. package/locale-data/es-MX.js +309 -0
  218. package/locale-data/es-NI.js +309 -0
  219. package/locale-data/es-PA.js +309 -0
  220. package/locale-data/es-PE.js +309 -0
  221. package/locale-data/es-PH.js +309 -0
  222. package/locale-data/es-PR.js +309 -0
  223. package/locale-data/es-PY.js +309 -0
  224. package/locale-data/es-SV.js +309 -0
  225. package/locale-data/es-US.js +309 -0
  226. package/locale-data/es-UY.js +309 -0
  227. package/locale-data/es-VE.js +309 -0
  228. package/locale-data/es.js +309 -0
  229. package/locale-data/et.js +309 -0
  230. package/locale-data/eu.js +309 -0
  231. package/locale-data/ewo.js +255 -0
  232. package/locale-data/fa-AF.js +309 -0
  233. package/locale-data/fa.js +309 -0
  234. package/locale-data/ff-Adlm-BF.js +303 -0
  235. package/locale-data/ff-Adlm-CM.js +303 -0
  236. package/locale-data/ff-Adlm-GH.js +303 -0
  237. package/locale-data/ff-Adlm-GM.js +303 -0
  238. package/locale-data/ff-Adlm-GW.js +303 -0
  239. package/locale-data/ff-Adlm-LR.js +303 -0
  240. package/locale-data/ff-Adlm-MR.js +303 -0
  241. package/locale-data/ff-Adlm-NE.js +303 -0
  242. package/locale-data/ff-Adlm-NG.js +303 -0
  243. package/locale-data/ff-Adlm-SL.js +303 -0
  244. package/locale-data/ff-Adlm-SN.js +303 -0
  245. package/locale-data/ff-Adlm.js +303 -0
  246. package/locale-data/ff-Latn-BF.js +255 -0
  247. package/locale-data/ff-Latn-CM.js +255 -0
  248. package/locale-data/ff-Latn-GH.js +255 -0
  249. package/locale-data/ff-Latn-GM.js +255 -0
  250. package/locale-data/ff-Latn-GN.js +255 -0
  251. package/locale-data/ff-Latn-GW.js +255 -0
  252. package/locale-data/ff-Latn-LR.js +255 -0
  253. package/locale-data/ff-Latn-MR.js +255 -0
  254. package/locale-data/ff-Latn-NE.js +255 -0
  255. package/locale-data/ff-Latn-NG.js +255 -0
  256. package/locale-data/ff-Latn-SL.js +255 -0
  257. package/locale-data/ff-Latn.js +255 -0
  258. package/locale-data/ff.js +255 -0
  259. package/locale-data/fi.js +309 -0
  260. package/locale-data/fil.js +309 -0
  261. package/locale-data/fo-DK.js +309 -0
  262. package/locale-data/fo.js +309 -0
  263. package/locale-data/fr-BE.js +309 -0
  264. package/locale-data/fr-BF.js +309 -0
  265. package/locale-data/fr-BI.js +309 -0
  266. package/locale-data/fr-BJ.js +309 -0
  267. package/locale-data/fr-BL.js +309 -0
  268. package/locale-data/fr-CA.js +309 -0
  269. package/locale-data/fr-CD.js +309 -0
  270. package/locale-data/fr-CF.js +309 -0
  271. package/locale-data/fr-CG.js +309 -0
  272. package/locale-data/fr-CH.js +309 -0
  273. package/locale-data/fr-CI.js +309 -0
  274. package/locale-data/fr-CM.js +309 -0
  275. package/locale-data/fr-DJ.js +309 -0
  276. package/locale-data/fr-DZ.js +309 -0
  277. package/locale-data/fr-GA.js +309 -0
  278. package/locale-data/fr-GF.js +309 -0
  279. package/locale-data/fr-GN.js +309 -0
  280. package/locale-data/fr-GP.js +309 -0
  281. package/locale-data/fr-GQ.js +309 -0
  282. package/locale-data/fr-HT.js +309 -0
  283. package/locale-data/fr-KM.js +309 -0
  284. package/locale-data/fr-LU.js +309 -0
  285. package/locale-data/fr-MA.js +309 -0
  286. package/locale-data/fr-MC.js +309 -0
  287. package/locale-data/fr-MF.js +309 -0
  288. package/locale-data/fr-MG.js +309 -0
  289. package/locale-data/fr-ML.js +309 -0
  290. package/locale-data/fr-MQ.js +309 -0
  291. package/locale-data/fr-MR.js +309 -0
  292. package/locale-data/fr-MU.js +309 -0
  293. package/locale-data/fr-NC.js +309 -0
  294. package/locale-data/fr-NE.js +309 -0
  295. package/locale-data/fr-PF.js +309 -0
  296. package/locale-data/fr-PM.js +309 -0
  297. package/locale-data/fr-RE.js +309 -0
  298. package/locale-data/fr-RW.js +309 -0
  299. package/locale-data/fr-SC.js +309 -0
  300. package/locale-data/fr-SN.js +309 -0
  301. package/locale-data/fr-SY.js +309 -0
  302. package/locale-data/fr-TD.js +309 -0
  303. package/locale-data/fr-TG.js +309 -0
  304. package/locale-data/fr-TN.js +309 -0
  305. package/locale-data/fr-VU.js +309 -0
  306. package/locale-data/fr-WF.js +309 -0
  307. package/locale-data/fr-YT.js +309 -0
  308. package/locale-data/fr.js +309 -0
  309. package/locale-data/fur.js +303 -0
  310. package/locale-data/fy.js +303 -0
  311. package/locale-data/ga-GB.js +453 -0
  312. package/locale-data/ga.js +453 -0
  313. package/locale-data/gd.js +411 -0
  314. package/locale-data/gl.js +309 -0
  315. package/locale-data/gsw-FR.js +261 -0
  316. package/locale-data/gsw-LI.js +261 -0
  317. package/locale-data/gsw.js +261 -0
  318. package/locale-data/gu.js +309 -0
  319. package/locale-data/guz.js +255 -0
  320. package/locale-data/gv.js +255 -0
  321. package/locale-data/ha-GH.js +303 -0
  322. package/locale-data/ha-NE.js +303 -0
  323. package/locale-data/ha.js +303 -0
  324. package/locale-data/haw.js +255 -0
  325. package/locale-data/he.js +379 -0
  326. package/locale-data/hi.js +309 -0
  327. package/locale-data/hr-BA.js +357 -0
  328. package/locale-data/hr.js +357 -0
  329. package/locale-data/hsb.js +399 -0
  330. package/locale-data/hu.js +309 -0
  331. package/locale-data/hy.js +309 -0
  332. package/locale-data/ia.js +303 -0
  333. package/locale-data/id.js +261 -0
  334. package/locale-data/ig.js +255 -0
  335. package/locale-data/ii.js +261 -0
  336. package/locale-data/is.js +309 -0
  337. package/locale-data/it-CH.js +309 -0
  338. package/locale-data/it-SM.js +309 -0
  339. package/locale-data/it-VA.js +309 -0
  340. package/locale-data/it.js +309 -0
  341. package/locale-data/ja.js +261 -0
  342. package/locale-data/jgo.js +291 -0
  343. package/locale-data/jmc.js +255 -0
  344. package/locale-data/jv.js +255 -0
  345. package/locale-data/ka.js +309 -0
  346. package/locale-data/kab.js +255 -0
  347. package/locale-data/kam.js +255 -0
  348. package/locale-data/kde.js +255 -0
  349. package/locale-data/kea.js +255 -0
  350. package/locale-data/kgp.js +277 -0
  351. package/locale-data/khq.js +255 -0
  352. package/locale-data/ki.js +255 -0
  353. package/locale-data/kk.js +309 -0
  354. package/locale-data/kkj.js +255 -0
  355. package/locale-data/kl.js +297 -0
  356. package/locale-data/kln.js +255 -0
  357. package/locale-data/km.js +261 -0
  358. package/locale-data/kn.js +309 -0
  359. package/locale-data/ko-KP.js +261 -0
  360. package/locale-data/ko.js +261 -0
  361. package/locale-data/kok.js +303 -0
  362. package/locale-data/ks-Arab.js +255 -0
  363. package/locale-data/ks.js +255 -0
  364. package/locale-data/ksb.js +255 -0
  365. package/locale-data/ksf.js +255 -0
  366. package/locale-data/ksh.js +273 -0
  367. package/locale-data/ku.js +303 -0
  368. package/locale-data/kw.js +255 -0
  369. package/locale-data/ky.js +309 -0
  370. package/locale-data/lag.js +255 -0
  371. package/locale-data/lb.js +303 -0
  372. package/locale-data/lg.js +255 -0
  373. package/locale-data/lkt.js +255 -0
  374. package/locale-data/ln-AO.js +255 -0
  375. package/locale-data/ln-CF.js +255 -0
  376. package/locale-data/ln-CG.js +255 -0
  377. package/locale-data/ln.js +255 -0
  378. package/locale-data/lo.js +261 -0
  379. package/locale-data/lrc-IQ.js +255 -0
  380. package/locale-data/lrc.js +255 -0
  381. package/locale-data/lt.js +405 -0
  382. package/locale-data/lu.js +255 -0
  383. package/locale-data/luo.js +255 -0
  384. package/locale-data/luy.js +255 -0
  385. package/locale-data/lv.js +357 -0
  386. package/locale-data/mai.js +255 -0
  387. package/locale-data/mas-TZ.js +255 -0
  388. package/locale-data/mas.js +255 -0
  389. package/locale-data/mer.js +255 -0
  390. package/locale-data/mfe.js +255 -0
  391. package/locale-data/mg.js +255 -0
  392. package/locale-data/mgh.js +255 -0
  393. package/locale-data/mgo.js +258 -0
  394. package/locale-data/mi.js +255 -0
  395. package/locale-data/mk.js +309 -0
  396. package/locale-data/ml.js +309 -0
  397. package/locale-data/mn.js +309 -0
  398. package/locale-data/mni-Beng.js +255 -0
  399. package/locale-data/mni.js +255 -0
  400. package/locale-data/mr.js +303 -0
  401. package/locale-data/ms-BN.js +261 -0
  402. package/locale-data/ms-ID.js +261 -0
  403. package/locale-data/ms-SG.js +261 -0
  404. package/locale-data/ms.js +261 -0
  405. package/locale-data/mt.js +447 -0
  406. package/locale-data/mua.js +255 -0
  407. package/locale-data/my.js +261 -0
  408. package/locale-data/mzn.js +255 -0
  409. package/locale-data/naq.js +255 -0
  410. package/locale-data/nb-SJ.js +309 -0
  411. package/locale-data/nb.js +309 -0
  412. package/locale-data/nd.js +255 -0
  413. package/locale-data/nds-NL.js +255 -0
  414. package/locale-data/nds.js +255 -0
  415. package/locale-data/ne-IN.js +309 -0
  416. package/locale-data/ne.js +309 -0
  417. package/locale-data/nl-AW.js +309 -0
  418. package/locale-data/nl-BE.js +309 -0
  419. package/locale-data/nl-BQ.js +309 -0
  420. package/locale-data/nl-CW.js +309 -0
  421. package/locale-data/nl-SR.js +309 -0
  422. package/locale-data/nl-SX.js +309 -0
  423. package/locale-data/nl.js +309 -0
  424. package/locale-data/nmg.js +255 -0
  425. package/locale-data/nn.js +309 -0
  426. package/locale-data/nnh.js +255 -0
  427. package/locale-data/no.js +309 -0
  428. package/locale-data/nus.js +255 -0
  429. package/locale-data/nyn.js +255 -0
  430. package/locale-data/om-KE.js +303 -0
  431. package/locale-data/om.js +303 -0
  432. package/locale-data/or.js +303 -0
  433. package/locale-data/os-RU.js +273 -0
  434. package/locale-data/os.js +273 -0
  435. package/locale-data/pa-Arab.js +255 -0
  436. package/locale-data/pa-Guru.js +303 -0
  437. package/locale-data/pa.js +303 -0
  438. package/locale-data/pcm.js +303 -0
  439. package/locale-data/pl.js +405 -0
  440. package/locale-data/ps-PK.js +303 -0
  441. package/locale-data/ps.js +303 -0
  442. package/locale-data/pt-AO.js +309 -0
  443. package/locale-data/pt-CH.js +309 -0
  444. package/locale-data/pt-CV.js +309 -0
  445. package/locale-data/pt-GQ.js +309 -0
  446. package/locale-data/pt-GW.js +309 -0
  447. package/locale-data/pt-LU.js +309 -0
  448. package/locale-data/pt-MO.js +309 -0
  449. package/locale-data/pt-MZ.js +309 -0
  450. package/locale-data/pt-PT.js +309 -0
  451. package/locale-data/pt-ST.js +309 -0
  452. package/locale-data/pt-TL.js +309 -0
  453. package/locale-data/pt.js +309 -0
  454. package/locale-data/qu-BO.js +255 -0
  455. package/locale-data/qu-EC.js +255 -0
  456. package/locale-data/qu.js +255 -0
  457. package/locale-data/rm.js +309 -0
  458. package/locale-data/rn.js +255 -0
  459. package/locale-data/ro-MD.js +357 -0
  460. package/locale-data/ro.js +357 -0
  461. package/locale-data/rof.js +255 -0
  462. package/locale-data/ru-BY.js +405 -0
  463. package/locale-data/ru-KG.js +405 -0
  464. package/locale-data/ru-KZ.js +405 -0
  465. package/locale-data/ru-MD.js +405 -0
  466. package/locale-data/ru-UA.js +405 -0
  467. package/locale-data/ru.js +405 -0
  468. package/locale-data/rw.js +255 -0
  469. package/locale-data/rwk.js +255 -0
  470. package/locale-data/sa.js +255 -0
  471. package/locale-data/sah.js +261 -0
  472. package/locale-data/saq.js +255 -0
  473. package/locale-data/sat-Olck.js +255 -0
  474. package/locale-data/sat.js +255 -0
  475. package/locale-data/sbp.js +255 -0
  476. package/locale-data/sc.js +303 -0
  477. package/locale-data/sd-Arab.js +303 -0
  478. package/locale-data/sd-Deva.js +255 -0
  479. package/locale-data/sd.js +303 -0
  480. package/locale-data/se-FI.js +357 -0
  481. package/locale-data/se-SE.js +345 -0
  482. package/locale-data/se.js +345 -0
  483. package/locale-data/seh.js +255 -0
  484. package/locale-data/ses.js +255 -0
  485. package/locale-data/sg.js +255 -0
  486. package/locale-data/shi-Latn.js +255 -0
  487. package/locale-data/shi-Tfng.js +255 -0
  488. package/locale-data/shi.js +255 -0
  489. package/locale-data/si.js +309 -0
  490. package/locale-data/sk.js +405 -0
  491. package/locale-data/sl.js +405 -0
  492. package/locale-data/smn.js +255 -0
  493. package/locale-data/sn.js +255 -0
  494. package/locale-data/so-DJ.js +303 -0
  495. package/locale-data/so-ET.js +303 -0
  496. package/locale-data/so-KE.js +303 -0
  497. package/locale-data/so.js +303 -0
  498. package/locale-data/sq-MK.js +303 -0
  499. package/locale-data/sq-XK.js +303 -0
  500. package/locale-data/sq.js +303 -0
  501. package/locale-data/sr-Cyrl-BA.js +357 -0
  502. package/locale-data/sr-Cyrl-ME.js +357 -0
  503. package/locale-data/sr-Cyrl-XK.js +357 -0
  504. package/locale-data/sr-Cyrl.js +357 -0
  505. package/locale-data/sr-Latn-BA.js +357 -0
  506. package/locale-data/sr-Latn-ME.js +357 -0
  507. package/locale-data/sr-Latn-XK.js +357 -0
  508. package/locale-data/sr-Latn.js +357 -0
  509. package/locale-data/sr.js +357 -0
  510. package/locale-data/su-Latn.js +255 -0
  511. package/locale-data/su.js +255 -0
  512. package/locale-data/sv-AX.js +309 -0
  513. package/locale-data/sv-FI.js +309 -0
  514. package/locale-data/sv.js +309 -0
  515. package/locale-data/sw-CD.js +309 -0
  516. package/locale-data/sw-KE.js +309 -0
  517. package/locale-data/sw-UG.js +309 -0
  518. package/locale-data/sw.js +309 -0
  519. package/locale-data/ta-LK.js +309 -0
  520. package/locale-data/ta-MY.js +309 -0
  521. package/locale-data/ta-SG.js +309 -0
  522. package/locale-data/ta.js +309 -0
  523. package/locale-data/te.js +309 -0
  524. package/locale-data/teo-KE.js +255 -0
  525. package/locale-data/teo.js +255 -0
  526. package/locale-data/tg.js +255 -0
  527. package/locale-data/th.js +261 -0
  528. package/locale-data/ti-ER.js +303 -0
  529. package/locale-data/ti.js +303 -0
  530. package/locale-data/tk.js +303 -0
  531. package/locale-data/to.js +261 -0
  532. package/locale-data/tr-CY.js +309 -0
  533. package/locale-data/tr.js +309 -0
  534. package/locale-data/tt.js +255 -0
  535. package/locale-data/twq.js +255 -0
  536. package/locale-data/tzm.js +255 -0
  537. package/locale-data/ug.js +297 -0
  538. package/locale-data/uk.js +405 -0
  539. package/locale-data/und.js +255 -0
  540. package/locale-data/ur-IN.js +309 -0
  541. package/locale-data/ur.js +309 -0
  542. package/locale-data/uz-Arab.js +255 -0
  543. package/locale-data/uz-Cyrl.js +297 -0
  544. package/locale-data/uz-Latn.js +303 -0
  545. package/locale-data/uz.js +303 -0
  546. package/locale-data/vai-Latn.js +255 -0
  547. package/locale-data/vai-Vaii.js +255 -0
  548. package/locale-data/vai.js +255 -0
  549. package/locale-data/vi.js +261 -0
  550. package/locale-data/vun.js +255 -0
  551. package/locale-data/wae.js +303 -0
  552. package/locale-data/wo.js +255 -0
  553. package/locale-data/xh.js +255 -0
  554. package/locale-data/xog.js +255 -0
  555. package/locale-data/yav.js +255 -0
  556. package/locale-data/yi.js +270 -0
  557. package/locale-data/yo-BJ.js +261 -0
  558. package/locale-data/yo.js +261 -0
  559. package/locale-data/yrl-CO.js +309 -0
  560. package/locale-data/yrl-VE.js +309 -0
  561. package/locale-data/yrl.js +309 -0
  562. package/locale-data/yue-Hans.js +261 -0
  563. package/locale-data/yue-Hant.js +261 -0
  564. package/locale-data/yue.js +261 -0
  565. package/locale-data/zgh.js +255 -0
  566. package/locale-data/zh-Hans-HK.js +261 -0
  567. package/locale-data/zh-Hans-MO.js +261 -0
  568. package/locale-data/zh-Hans-SG.js +261 -0
  569. package/locale-data/zh-Hans.js +261 -0
  570. package/locale-data/zh-Hant-HK.js +261 -0
  571. package/locale-data/zh-Hant-MO.js +261 -0
  572. package/locale-data/zh-Hant.js +261 -0
  573. package/locale-data/zh.js +261 -0
  574. package/locale-data/zu.js +309 -0
  575. package/package.json +5 -6
  576. package/polyfill-force.d.ts +1 -1
  577. package/polyfill-force.js +416 -1
  578. package/polyfill-force.js.map +1 -0
  579. package/polyfill.d.ts +1 -1
  580. package/polyfill.iife.js +4708 -7257
  581. package/polyfill.js +1008 -2
  582. package/polyfill.js.map +1 -0
  583. package/should-polyfill.d.ts +5 -1
  584. package/should-polyfill.js +583 -8
  585. package/should-polyfill.js.map +1 -0
  586. package/abstract/FormatRelativeTime.d.ts +0 -4
  587. package/abstract/FormatRelativeTime.js +0 -10
  588. package/abstract/FormatRelativeTimeToParts.d.ts +0 -4
  589. package/abstract/FormatRelativeTimeToParts.js +0 -5
  590. package/abstract/InitializeRelativeTimeFormat.d.ts +0 -8
  591. package/abstract/InitializeRelativeTimeFormat.js +0 -42
  592. package/abstract/MakePartsList.d.ts +0 -1
  593. package/abstract/MakePartsList.js +0 -23
  594. package/abstract/PartitionRelativeTimePattern.d.ts +0 -4
  595. package/abstract/PartitionRelativeTimePattern.js +0 -43
  596. package/abstract/SingularRelativeTimeUnit.d.ts +0 -6
  597. package/abstract/SingularRelativeTimeUnit.js +0 -20
  598. package/get_internal_slots.d.ts +0 -2
  599. package/get_internal_slots.js +0 -12
  600. package/supported-locales.generated.d.ts +0 -1
  601. package/supported-locales.generated.js +0 -573
package/index.d.ts CHANGED
@@ -1,15 +1,47 @@
1
- import { type LocaleFieldsData, type RelativeTimeLocaleData } from "@formatjs/ecma402-abstract";
2
- export default class RelativeTimeFormat {
3
- constructor(locales?: string | string[], options?: Intl.RelativeTimeFormatOptions);
4
- format(value: number, unit: Intl.RelativeTimeFormatUnit): string;
5
- formatToParts(value: number, unit: Intl.RelativeTimeFormatUnit): Intl.RelativeTimeFormatPart[];
6
- resolvedOptions(): Intl.ResolvedRelativeTimeFormatOptions;
7
- static supportedLocalesOf(locales: string | string[], options?: Pick<Intl.RelativeTimeFormatOptions, "localeMatcher">): string[];
8
- static __addLocaleData(...data: RelativeTimeLocaleData[]): void;
9
- static localeData: Record<string, LocaleFieldsData>;
10
- private static availableLocales;
11
- private static __defaultLocale;
12
- private static getDefaultLocale;
13
- private static relevantExtensionKeys;
14
- static polyfilled: boolean;
1
+ //#region packages/ecma402-abstract/types/core.d.ts
2
+ type Locale = string;
3
+ interface LocaleData<T> {
4
+ data: T;
5
+ locale: Locale;
15
6
  }
7
+ //#endregion
8
+ //#region packages/ecma402-abstract/types/plural-rules.d.ts
9
+ type LDMLPluralRule = "zero" | "one" | "two" | "few" | "many" | "other";
10
+ //#endregion
11
+ //#region packages/ecma402-abstract/types/relative-time.d.ts
12
+ interface FieldData {
13
+ "0"?: string;
14
+ "1"?: string;
15
+ "-1"?: string;
16
+ "2"?: string;
17
+ "-2"?: string;
18
+ "3"?: string;
19
+ "-3"?: string;
20
+ future: RelativeTimeData;
21
+ past: RelativeTimeData;
22
+ }
23
+ type RelativeTimeData = { [u in LDMLPluralRule]?: string };
24
+ type LocaleFieldsData = { [f in RelativeTimeField]?: FieldData } & {
25
+ nu?: Array<string | null>;
26
+ };
27
+ type RelativeTimeField = "second" | "second-short" | "second-narrow" | "minute" | "minute-short" | "minute-narrow" | "hour" | "hour-short" | "hour-narrow" | "day" | "day-short" | "day-narrow" | "week" | "week-short" | "week-narrow" | "month" | "month-short" | "month-narrow" | "quarter" | "quarter-short" | "quarter-narrow" | "year" | "year-short" | "year-narrow";
28
+ type RelativeTimeLocaleData = LocaleData<LocaleFieldsData>;
29
+ //#endregion
30
+ //#region packages/intl-relativetimeformat/index.d.ts
31
+ declare class RelativeTimeFormat {
32
+ constructor(locales?: string | string[], options?: Intl.RelativeTimeFormatOptions);
33
+ format(value: number, unit: Intl.RelativeTimeFormatUnit): string;
34
+ formatToParts(value: number, unit: Intl.RelativeTimeFormatUnit): Intl.RelativeTimeFormatPart[];
35
+ resolvedOptions(): Intl.ResolvedRelativeTimeFormatOptions;
36
+ static supportedLocalesOf(locales: string | string[], options?: Pick<Intl.RelativeTimeFormatOptions, "localeMatcher">): string[];
37
+ static __addLocaleData(...data: RelativeTimeLocaleData[]): void;
38
+ static localeData: Record<string, LocaleFieldsData>;
39
+ private static availableLocales;
40
+ private static __defaultLocale;
41
+ private static getDefaultLocale;
42
+ private static relevantExtensionKeys;
43
+ static polyfilled: boolean;
44
+ }
45
+ //#endregion
46
+ export { RelativeTimeFormat as default };
47
+ //# sourceMappingURL=index.d.ts.map
package/index.js CHANGED
@@ -1,15 +1,329 @@
1
- import { CanonicalizeLocaleList, SupportedLocales, ToString } from "@formatjs/ecma402-abstract";
2
- import { InitializeRelativeTimeFormat } from "./abstract/InitializeRelativeTimeFormat.js";
3
- import { PartitionRelativeTimePattern } from "./abstract/PartitionRelativeTimePattern.js";
4
- import getInternalSlots from "./get_internal_slots.js";
5
- export default class RelativeTimeFormat {
1
+ import { LookupSupportedLocales, ResolveLocale } from "@formatjs/intl-localematcher";
2
+ //#region packages/ecma262-abstract/ToString.js
3
+ /**
4
+ * https://tc39.es/ecma262/#sec-tostring
5
+ */
6
+ function ToString(o) {
7
+ if (typeof o === "symbol") throw TypeError("Cannot convert a Symbol value to a string");
8
+ return String(o);
9
+ }
10
+ //#endregion
11
+ //#region packages/ecma402-abstract/CanonicalizeLocaleList.js
12
+ /**
13
+ * http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist
14
+ * @param locales
15
+ */
16
+ function CanonicalizeLocaleList(locales) {
17
+ return Intl.getCanonicalLocales(locales);
18
+ }
19
+ //#endregion
20
+ //#region packages/ecma262-abstract/ToObject.js
21
+ /**
22
+ * https://tc39.es/ecma262/#sec-toobject
23
+ */
24
+ function ToObject(arg) {
25
+ if (arg == null) throw new TypeError("undefined/null cannot be converted to object");
26
+ return Object(arg);
27
+ }
28
+ //#endregion
29
+ //#region packages/ecma402-abstract/GetOption.js
30
+ /**
31
+ * https://tc39.es/ecma402/#sec-getoption
32
+ * @param opts
33
+ * @param prop
34
+ * @param type
35
+ * @param values
36
+ * @param fallback
37
+ */
38
+ function GetOption(opts, prop, type, values, fallback) {
39
+ if (typeof opts !== "object") throw new TypeError("Options must be an object");
40
+ let value = opts[prop];
41
+ if (value !== void 0) {
42
+ if (type !== "boolean" && type !== "string") throw new TypeError("invalid type");
43
+ if (type === "boolean") value = Boolean(value);
44
+ if (type === "string") value = ToString(value);
45
+ if (values !== void 0 && !values.filter((val) => val == value).length) throw new RangeError(`${value} is not within ${values.join(", ")}`);
46
+ return value;
47
+ }
48
+ return fallback;
49
+ }
50
+ //#endregion
51
+ //#region packages/ecma402-abstract/SupportedLocales.js
52
+ /**
53
+ * https://tc39.es/ecma402/#sec-supportedlocales
54
+ * @param availableLocales
55
+ * @param requestedLocales
56
+ * @param options
57
+ */
58
+ function SupportedLocales(availableLocales, requestedLocales, options) {
59
+ let matcher = "best fit";
60
+ if (options !== void 0) {
61
+ options = ToObject(options);
62
+ matcher = GetOption(options, "localeMatcher", "string", ["lookup", "best fit"], "best fit");
63
+ }
64
+ if (matcher === "best fit") return LookupSupportedLocales(Array.from(availableLocales), requestedLocales);
65
+ return LookupSupportedLocales(Array.from(availableLocales), requestedLocales);
66
+ }
67
+ //#endregion
68
+ //#region packages/ecma402-abstract/CoerceOptionsToObject.js
69
+ /**
70
+ * https://tc39.es/ecma402/#sec-coerceoptionstoobject
71
+ * @param options
72
+ * @returns
73
+ */
74
+ function CoerceOptionsToObject(options) {
75
+ if (typeof options === "undefined") return Object.create(null);
76
+ return ToObject(options);
77
+ }
78
+ //#endregion
79
+ //#region node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/index.js
80
+ function memoize(fn, options) {
81
+ const cache = options && options.cache ? options.cache : cacheDefault;
82
+ const serializer = options && options.serializer ? options.serializer : serializerDefault;
83
+ return (options && options.strategy ? options.strategy : strategyDefault)(fn, {
84
+ cache,
85
+ serializer
86
+ });
87
+ }
88
+ function isPrimitive(value) {
89
+ return value == null || typeof value === "number" || typeof value === "boolean";
90
+ }
91
+ function monadic(fn, cache, serializer, arg) {
92
+ const cacheKey = isPrimitive(arg) ? arg : serializer(arg);
93
+ let computedValue = cache.get(cacheKey);
94
+ if (typeof computedValue === "undefined") {
95
+ computedValue = fn.call(this, arg);
96
+ cache.set(cacheKey, computedValue);
97
+ }
98
+ return computedValue;
99
+ }
100
+ function variadic(fn, cache, serializer) {
101
+ const args = Array.prototype.slice.call(arguments, 3);
102
+ const cacheKey = serializer(args);
103
+ let computedValue = cache.get(cacheKey);
104
+ if (typeof computedValue === "undefined") {
105
+ computedValue = fn.apply(this, args);
106
+ cache.set(cacheKey, computedValue);
107
+ }
108
+ return computedValue;
109
+ }
110
+ function assemble(fn, context, strategy, cache, serialize) {
111
+ return strategy.bind(context, fn, cache, serialize);
112
+ }
113
+ function strategyDefault(fn, options) {
114
+ const strategy = fn.length === 1 ? monadic : variadic;
115
+ return assemble(fn, this, strategy, options.cache.create(), options.serializer);
116
+ }
117
+ function strategyVariadic(fn, options) {
118
+ return assemble(fn, this, variadic, options.cache.create(), options.serializer);
119
+ }
120
+ function strategyMonadic(fn, options) {
121
+ return assemble(fn, this, monadic, options.cache.create(), options.serializer);
122
+ }
123
+ const serializerDefault = function() {
124
+ return JSON.stringify(arguments);
125
+ };
126
+ var ObjectWithoutPrototypeCache = class {
127
+ constructor() {
128
+ this.cache = Object.create(null);
129
+ }
130
+ get(key) {
131
+ return this.cache[key];
132
+ }
133
+ set(key, value) {
134
+ this.cache[key] = value;
135
+ }
136
+ };
137
+ const cacheDefault = { create: function create() {
138
+ return new ObjectWithoutPrototypeCache();
139
+ } };
140
+ const strategies = {
141
+ variadic: strategyVariadic,
142
+ monadic: strategyMonadic
143
+ };
144
+ //#endregion
145
+ //#region packages/ecma402-abstract/utils.js
146
+ function invariant(condition, message, Err = Error) {
147
+ if (!condition) throw new Err(message);
148
+ }
149
+ const createMemoizedNumberFormat = memoize((...args) => new Intl.NumberFormat(...args), { strategy: strategies.variadic });
150
+ const createMemoizedPluralRules = memoize((...args) => new Intl.PluralRules(...args), { strategy: strategies.variadic });
151
+ memoize((...args) => new Intl.Locale(...args), { strategy: strategies.variadic });
152
+ memoize((...args) => new Intl.ListFormat(...args), { strategy: strategies.variadic });
153
+ //#endregion
154
+ //#region packages/ecma402-abstract/RelativeTimeFormat/InitializeRelativeTimeFormat.js
155
+ const NUMBERING_SYSTEM_REGEX = /^[a-z0-9]{3,8}(-[a-z0-9]{3,8})*$/i;
156
+ function InitializeRelativeTimeFormat(rtf, locales, options, { getInternalSlots, availableLocales, relevantExtensionKeys, localeData, getDefaultLocale }) {
157
+ const internalSlots = getInternalSlots(rtf);
158
+ internalSlots.initializedRelativeTimeFormat = true;
159
+ const requestedLocales = CanonicalizeLocaleList(locales);
160
+ const opt = Object.create(null);
161
+ const opts = CoerceOptionsToObject(options);
162
+ opt.localeMatcher = GetOption(opts, "localeMatcher", "string", ["best fit", "lookup"], "best fit");
163
+ const numberingSystem = GetOption(opts, "numberingSystem", "string", void 0, void 0);
164
+ if (numberingSystem !== void 0) {
165
+ if (!NUMBERING_SYSTEM_REGEX.test(numberingSystem)) throw new RangeError(`Invalid numbering system ${numberingSystem}`);
166
+ }
167
+ opt.nu = numberingSystem;
168
+ const r = ResolveLocale(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);
169
+ const { locale, nu } = r;
170
+ internalSlots.locale = locale;
171
+ internalSlots.style = GetOption(opts, "style", "string", [
172
+ "long",
173
+ "narrow",
174
+ "short"
175
+ ], "long");
176
+ internalSlots.numeric = GetOption(opts, "numeric", "string", ["always", "auto"], "always");
177
+ const fields = localeData[r.dataLocale];
178
+ invariant(!!fields, `Missing locale data for ${r.dataLocale}`);
179
+ internalSlots.fields = fields;
180
+ internalSlots.numberFormat = createMemoizedNumberFormat(locales);
181
+ internalSlots.pluralRules = createMemoizedPluralRules(locales);
182
+ internalSlots.numberingSystem = nu;
183
+ return rtf;
184
+ }
185
+ //#endregion
186
+ //#region packages/ecma262-abstract/SameValue.js
187
+ /**
188
+ * https://www.ecma-international.org/ecma-262/11.0/index.html#sec-samevalue
189
+ */
190
+ function SameValue(x, y) {
191
+ if (Object.is) return Object.is(x, y);
192
+ if (x === y) return x !== 0 || 1 / x === 1 / y;
193
+ return x !== x && y !== y;
194
+ }
195
+ //#endregion
196
+ //#region packages/ecma262-abstract/Type.js
197
+ /**
198
+ * https://www.ecma-international.org/ecma-262/11.0/index.html#sec-type
199
+ */
200
+ function Type(x) {
201
+ if (x === null) return "Null";
202
+ if (typeof x === "undefined") return "Undefined";
203
+ if (typeof x === "function" || typeof x === "object") return "Object";
204
+ if (typeof x === "number") return "Number";
205
+ if (typeof x === "boolean") return "Boolean";
206
+ if (typeof x === "string") return "String";
207
+ if (typeof x === "symbol") return "Symbol";
208
+ if (typeof x === "bigint") return "BigInt";
209
+ }
210
+ //#endregion
211
+ //#region packages/ecma402-abstract/RelativeTimeFormat/SingularRelativeTimeUnit.js
212
+ /**
213
+ * https://tc39.es/proposal-intl-relative-time/#sec-singularrelativetimeunit
214
+ * @param unit
215
+ */
216
+ function SingularRelativeTimeUnit(unit) {
217
+ invariant(Type(unit) === "String", "unit must be a string");
218
+ if (unit === "seconds") return "second";
219
+ if (unit === "minutes") return "minute";
220
+ if (unit === "hours") return "hour";
221
+ if (unit === "days") return "day";
222
+ if (unit === "weeks") return "week";
223
+ if (unit === "months") return "month";
224
+ if (unit === "quarters") return "quarter";
225
+ if (unit === "years") return "year";
226
+ if (unit !== "second" && unit !== "minute" && unit !== "hour" && unit !== "day" && unit !== "week" && unit !== "month" && unit !== "quarter" && unit !== "year") throw new RangeError("invalid unit");
227
+ return unit;
228
+ }
229
+ //#endregion
230
+ //#region packages/ecma402-abstract/PartitionPattern.js
231
+ /**
232
+ * Partition a pattern into a list of literals and placeholders
233
+ * https://tc39.es/ecma402/#sec-partitionpattern
234
+ * @param pattern
235
+ */
236
+ function PartitionPattern(pattern) {
237
+ const result = [];
238
+ let beginIndex = pattern.indexOf("{");
239
+ let endIndex = 0;
240
+ let nextIndex = 0;
241
+ const length = pattern.length;
242
+ while (beginIndex < pattern.length && beginIndex > -1) {
243
+ endIndex = pattern.indexOf("}", beginIndex);
244
+ invariant(endIndex > beginIndex, `Invalid pattern ${pattern}`);
245
+ if (beginIndex > nextIndex) result.push({
246
+ type: "literal",
247
+ value: pattern.substring(nextIndex, beginIndex)
248
+ });
249
+ result.push({
250
+ type: pattern.substring(beginIndex + 1, endIndex),
251
+ value: void 0
252
+ });
253
+ nextIndex = endIndex + 1;
254
+ beginIndex = pattern.indexOf("{", nextIndex);
255
+ }
256
+ if (nextIndex < length) result.push({
257
+ type: "literal",
258
+ value: pattern.substring(nextIndex, length)
259
+ });
260
+ return result;
261
+ }
262
+ //#endregion
263
+ //#region packages/ecma402-abstract/RelativeTimeFormat/MakePartsList.js
264
+ function MakePartsList(pattern, unit, parts) {
265
+ const patternParts = PartitionPattern(pattern);
266
+ const result = [];
267
+ for (const patternPart of patternParts) if (patternPart.type === "literal") result.push({
268
+ type: "literal",
269
+ value: patternPart.value
270
+ });
271
+ else {
272
+ invariant(patternPart.type === "0", `Malformed pattern ${pattern}`);
273
+ for (const part of parts) result.push({
274
+ type: part.type,
275
+ value: part.value,
276
+ unit
277
+ });
278
+ }
279
+ return result;
280
+ }
281
+ //#endregion
282
+ //#region packages/ecma402-abstract/RelativeTimeFormat/PartitionRelativeTimePattern.js
283
+ function PartitionRelativeTimePattern(rtf, value, unit, { getInternalSlots }) {
284
+ invariant(Type(value) === "Number", `value must be number, instead got ${typeof value}`, TypeError);
285
+ invariant(Type(unit) === "String", `unit must be number, instead got ${typeof value}`, TypeError);
286
+ if (isNaN(value) || !isFinite(value)) throw new RangeError(`Invalid value ${value}`);
287
+ const resolvedUnit = SingularRelativeTimeUnit(unit);
288
+ const { fields, style, numeric, pluralRules, numberFormat } = getInternalSlots(rtf);
289
+ let entry = resolvedUnit;
290
+ if (style === "short") entry = `${resolvedUnit}-short`;
291
+ else if (style === "narrow") entry = `${resolvedUnit}-narrow`;
292
+ if (!(entry in fields)) entry = resolvedUnit;
293
+ const patterns = fields[entry];
294
+ if (numeric === "auto") {
295
+ if (ToString(value) in patterns) return [{
296
+ type: "literal",
297
+ value: patterns[ToString(value)]
298
+ }];
299
+ }
300
+ let tl = "future";
301
+ if (SameValue(value, -0) || value < 0) tl = "past";
302
+ const po = patterns[tl];
303
+ const fv = typeof numberFormat.formatToParts === "function" ? numberFormat.formatToParts(Math.abs(value)) : [{
304
+ type: "literal",
305
+ value: numberFormat.format(Math.abs(value)),
306
+ unit
307
+ }];
308
+ const pattern = po[pluralRules.select(value)];
309
+ return MakePartsList(pattern, resolvedUnit, fv);
310
+ }
311
+ //#endregion
312
+ //#region packages/intl-relativetimeformat/get_internal_slots.ts
313
+ const internalSlotMap = /* @__PURE__ */ new WeakMap();
314
+ function getInternalSlots(x) {
315
+ let internalSlots = internalSlotMap.get(x);
316
+ if (!internalSlots) {
317
+ internalSlots = Object.create(null);
318
+ internalSlotMap.set(x, internalSlots);
319
+ }
320
+ return internalSlots;
321
+ }
322
+ //#endregion
323
+ //#region packages/intl-relativetimeformat/index.ts
324
+ var RelativeTimeFormat = class RelativeTimeFormat {
6
325
  constructor(locales, options) {
7
- // test262/test/intl402/RelativeTimeFormat/constructor/constructor/newtarget-undefined.js
8
- // Cannot use `new.target` bc of IE11 & TS transpiles it to something else
9
- const newTarget = this && this instanceof RelativeTimeFormat ? this.constructor : void 0;
10
- if (!newTarget) {
11
- throw new TypeError("Intl.RelativeTimeFormat must be called with 'new'");
12
- }
326
+ if (!(this && this instanceof RelativeTimeFormat ? this.constructor : void 0)) throw new TypeError("Intl.RelativeTimeFormat must be called with 'new'");
13
327
  return InitializeRelativeTimeFormat(this, locales, options, {
14
328
  getInternalSlots,
15
329
  availableLocales: RelativeTimeFormat.availableLocales,
@@ -19,34 +333,19 @@ export default class RelativeTimeFormat {
19
333
  });
20
334
  }
21
335
  format(value, unit) {
22
- if (typeof this !== "object") {
23
- throw new TypeError("format was called on a non-object");
24
- }
25
- const internalSlots = getInternalSlots(this);
26
- if (!internalSlots.initializedRelativeTimeFormat) {
27
- throw new TypeError("format was called on a invalid context");
28
- }
336
+ if (typeof this !== "object") throw new TypeError("format was called on a non-object");
337
+ if (!getInternalSlots(this).initializedRelativeTimeFormat) throw new TypeError("format was called on a invalid context");
29
338
  return PartitionRelativeTimePattern(this, Number(value), ToString(unit), { getInternalSlots }).map((el) => el.value).join("");
30
339
  }
31
340
  formatToParts(value, unit) {
32
- if (typeof this !== "object") {
33
- throw new TypeError("formatToParts was called on a non-object");
34
- }
35
- const internalSlots = getInternalSlots(this);
36
- if (!internalSlots.initializedRelativeTimeFormat) {
37
- throw new TypeError("formatToParts was called on a invalid context");
38
- }
341
+ if (typeof this !== "object") throw new TypeError("formatToParts was called on a non-object");
342
+ if (!getInternalSlots(this).initializedRelativeTimeFormat) throw new TypeError("formatToParts was called on a invalid context");
39
343
  return PartitionRelativeTimePattern(this, Number(value), ToString(unit), { getInternalSlots });
40
344
  }
41
345
  resolvedOptions() {
42
- if (typeof this !== "object") {
43
- throw new TypeError("resolvedOptions was called on a non-object");
44
- }
346
+ if (typeof this !== "object") throw new TypeError("resolvedOptions was called on a non-object");
45
347
  const internalSlots = getInternalSlots(this);
46
- if (!internalSlots.initializedRelativeTimeFormat) {
47
- throw new TypeError("resolvedOptions was called on a invalid context");
48
- }
49
- // test262/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/type.js
348
+ if (!internalSlots.initializedRelativeTimeFormat) throw new TypeError("resolvedOptions was called on a invalid context");
50
349
  return {
51
350
  locale: internalSlots.locale,
52
351
  style: internalSlots.style,
@@ -63,38 +362,41 @@ export default class RelativeTimeFormat {
63
362
  RelativeTimeFormat.localeData[locale] = RelativeTimeFormat.localeData[minimizedLocale] = d;
64
363
  RelativeTimeFormat.availableLocales.add(minimizedLocale);
65
364
  RelativeTimeFormat.availableLocales.add(locale);
66
- if (!RelativeTimeFormat.__defaultLocale) {
67
- RelativeTimeFormat.__defaultLocale = minimizedLocale;
68
- }
365
+ if (!RelativeTimeFormat.__defaultLocale) RelativeTimeFormat.__defaultLocale = minimizedLocale;
69
366
  }
70
367
  }
71
- static localeData = {};
72
- static availableLocales = new Set();
73
- static __defaultLocale = "";
368
+ static {
369
+ this.localeData = {};
370
+ }
371
+ static {
372
+ this.availableLocales = /* @__PURE__ */ new Set();
373
+ }
374
+ static {
375
+ this.__defaultLocale = "";
376
+ }
74
377
  static getDefaultLocale() {
75
378
  return RelativeTimeFormat.__defaultLocale;
76
379
  }
77
- static relevantExtensionKeys = ["nu"];
78
- static polyfilled = true;
79
- }
80
- try {
81
- // IE11 does not have Symbol
82
- if (typeof Symbol !== "undefined") {
83
- Object.defineProperty(RelativeTimeFormat.prototype, Symbol.toStringTag, {
84
- value: "Intl.RelativeTimeFormat",
85
- writable: false,
86
- enumerable: false,
87
- configurable: true
88
- });
380
+ static {
381
+ this.relevantExtensionKeys = ["nu"];
382
+ }
383
+ static {
384
+ this.polyfilled = true;
89
385
  }
90
- // https://github.com/tc39/test262/blob/master/test/intl402/RelativeTimeFormat/constructor/length.js
386
+ };
387
+ try {
388
+ if (typeof Symbol !== "undefined") Object.defineProperty(RelativeTimeFormat.prototype, Symbol.toStringTag, {
389
+ value: "Intl.RelativeTimeFormat",
390
+ writable: false,
391
+ enumerable: false,
392
+ configurable: true
393
+ });
91
394
  Object.defineProperty(RelativeTimeFormat.prototype.constructor, "length", {
92
395
  value: 0,
93
396
  writable: false,
94
397
  enumerable: false,
95
398
  configurable: true
96
399
  });
97
- // https://github.com/tc39/test262/blob/master/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/length.js
98
400
  Object.defineProperty(RelativeTimeFormat.supportedLocalesOf, "length", {
99
401
  value: 1,
100
402
  writable: false,
@@ -102,3 +404,7 @@ try {
102
404
  configurable: true
103
405
  });
104
406
  } catch {}
407
+ //#endregion
408
+ export { RelativeTimeFormat as default };
409
+
410
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../ecma262-abstract/ToString.js","../../ecma402-abstract/CanonicalizeLocaleList.js","../../ecma262-abstract/ToObject.js","../../ecma402-abstract/GetOption.js","../../ecma402-abstract/SupportedLocales.js","../../ecma402-abstract/CoerceOptionsToObject.js","../../../node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/index.js","../../ecma402-abstract/utils.js","../../ecma402-abstract/RelativeTimeFormat/InitializeRelativeTimeFormat.js","../../ecma262-abstract/SameValue.js","../../ecma262-abstract/Type.js","../../ecma402-abstract/RelativeTimeFormat/SingularRelativeTimeUnit.js","../../ecma402-abstract/PartitionPattern.js","../../ecma402-abstract/RelativeTimeFormat/MakePartsList.js","../../ecma402-abstract/RelativeTimeFormat/PartitionRelativeTimePattern.js","../get_internal_slots.ts","../index.ts"],"sourcesContent":["/**\n* https://tc39.es/ecma262/#sec-tostring\n*/\nexport function ToString(o) {\n\tif (typeof o === \"symbol\") {\n\t\tthrow TypeError(\"Cannot convert a Symbol value to a string\");\n\t}\n\treturn String(o);\n}\n","/**\n* http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist\n* @param locales\n*/\nexport function CanonicalizeLocaleList(locales) {\n\t// TODO\n\treturn Intl.getCanonicalLocales(locales);\n}\n","/**\n* https://tc39.es/ecma262/#sec-toobject\n*/\nexport function ToObject(arg) {\n\tif (arg == null) {\n\t\tthrow new TypeError(\"undefined/null cannot be converted to object\");\n\t}\n\treturn Object(arg);\n}\n","import { ToString } from \"#packages/ecma262-abstract/ToString.js\";\n/**\n* https://tc39.es/ecma402/#sec-getoption\n* @param opts\n* @param prop\n* @param type\n* @param values\n* @param fallback\n*/\nexport function GetOption(opts, prop, type, values, fallback) {\n\tif (typeof opts !== \"object\") {\n\t\tthrow new TypeError(\"Options must be an object\");\n\t}\n\tlet value = opts[prop];\n\tif (value !== undefined) {\n\t\tif (type !== \"boolean\" && type !== \"string\") {\n\t\t\tthrow new TypeError(\"invalid type\");\n\t\t}\n\t\tif (type === \"boolean\") {\n\t\t\tvalue = Boolean(value);\n\t\t}\n\t\tif (type === \"string\") {\n\t\t\tvalue = ToString(value);\n\t\t}\n\t\tif (values !== undefined && !values.filter((val) => val == value).length) {\n\t\t\tthrow new RangeError(`${value} is not within ${values.join(\", \")}`);\n\t\t}\n\t\treturn value;\n\t}\n\treturn fallback;\n}\n","import { LookupSupportedLocales } from \"@formatjs/intl-localematcher\";\nimport { ToObject } from \"#packages/ecma262-abstract/ToObject.js\";\nimport { GetOption } from \"#packages/ecma402-abstract/GetOption.js\";\n/**\n* https://tc39.es/ecma402/#sec-supportedlocales\n* @param availableLocales\n* @param requestedLocales\n* @param options\n*/\nexport function SupportedLocales(availableLocales, requestedLocales, options) {\n\tlet matcher = \"best fit\";\n\tif (options !== undefined) {\n\t\toptions = ToObject(options);\n\t\tmatcher = GetOption(options, \"localeMatcher\", \"string\", [\"lookup\", \"best fit\"], \"best fit\");\n\t}\n\tif (matcher === \"best fit\") {\n\t\treturn LookupSupportedLocales(Array.from(availableLocales), requestedLocales);\n\t}\n\treturn LookupSupportedLocales(Array.from(availableLocales), requestedLocales);\n}\n","import { ToObject } from \"#packages/ecma262-abstract/ToObject.js\";\n/**\n* https://tc39.es/ecma402/#sec-coerceoptionstoobject\n* @param options\n* @returns\n*/\nexport function CoerceOptionsToObject(options) {\n\tif (typeof options === \"undefined\") {\n\t\treturn Object.create(null);\n\t}\n\treturn ToObject(options);\n}\n","//#region packages/fast-memoize/index.ts\nfunction memoize(fn, options) {\n\tconst cache = options && options.cache ? options.cache : cacheDefault;\n\tconst serializer = options && options.serializer ? options.serializer : serializerDefault;\n\treturn (options && options.strategy ? options.strategy : strategyDefault)(fn, {\n\t\tcache,\n\t\tserializer\n\t});\n}\nfunction isPrimitive(value) {\n\treturn value == null || typeof value === \"number\" || typeof value === \"boolean\";\n}\nfunction monadic(fn, cache, serializer, arg) {\n\tconst cacheKey = isPrimitive(arg) ? arg : serializer(arg);\n\tlet computedValue = cache.get(cacheKey);\n\tif (typeof computedValue === \"undefined\") {\n\t\tcomputedValue = fn.call(this, arg);\n\t\tcache.set(cacheKey, computedValue);\n\t}\n\treturn computedValue;\n}\nfunction variadic(fn, cache, serializer) {\n\tconst args = Array.prototype.slice.call(arguments, 3);\n\tconst cacheKey = serializer(args);\n\tlet computedValue = cache.get(cacheKey);\n\tif (typeof computedValue === \"undefined\") {\n\t\tcomputedValue = fn.apply(this, args);\n\t\tcache.set(cacheKey, computedValue);\n\t}\n\treturn computedValue;\n}\nfunction assemble(fn, context, strategy, cache, serialize) {\n\treturn strategy.bind(context, fn, cache, serialize);\n}\nfunction strategyDefault(fn, options) {\n\tconst strategy = fn.length === 1 ? monadic : variadic;\n\treturn assemble(fn, this, strategy, options.cache.create(), options.serializer);\n}\nfunction strategyVariadic(fn, options) {\n\treturn assemble(fn, this, variadic, options.cache.create(), options.serializer);\n}\nfunction strategyMonadic(fn, options) {\n\treturn assemble(fn, this, monadic, options.cache.create(), options.serializer);\n}\nconst serializerDefault = function() {\n\treturn JSON.stringify(arguments);\n};\nvar ObjectWithoutPrototypeCache = class {\n\tconstructor() {\n\t\tthis.cache = Object.create(null);\n\t}\n\tget(key) {\n\t\treturn this.cache[key];\n\t}\n\tset(key, value) {\n\t\tthis.cache[key] = value;\n\t}\n};\nconst cacheDefault = { create: function create() {\n\treturn new ObjectWithoutPrototypeCache();\n} };\nconst strategies = {\n\tvariadic: strategyVariadic,\n\tmonadic: strategyMonadic\n};\n//#endregion\nexport { memoize, strategies };\n\n//# sourceMappingURL=index.js.map","import { memoize, strategies } from \"@formatjs/fast-memoize\";\nexport function repeat(s, times) {\n\tif (typeof s.repeat === \"function\") {\n\t\treturn s.repeat(times);\n\t}\n\tconst arr = Array.from({ length: times });\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tarr[i] = s;\n\t}\n\treturn arr.join(\"\");\n}\nexport function setInternalSlot(map, pl, field, value) {\n\tif (!map.get(pl)) {\n\t\tmap.set(pl, Object.create(null));\n\t}\n\tconst slots = map.get(pl);\n\tslots[field] = value;\n}\nexport function setMultiInternalSlots(map, pl, props) {\n\tfor (const k of Object.keys(props)) {\n\t\tsetInternalSlot(map, pl, k, props[k]);\n\t}\n}\nexport function getInternalSlot(map, pl, field) {\n\treturn getMultiInternalSlots(map, pl, field)[field];\n}\nexport function getMultiInternalSlots(map, pl, ...fields) {\n\tconst slots = map.get(pl);\n\tif (!slots) {\n\t\tthrow new TypeError(`${pl} InternalSlot has not been initialized`);\n\t}\n\treturn fields.reduce((all, f) => {\n\t\tall[f] = slots[f];\n\t\treturn all;\n\t}, Object.create(null));\n}\nexport function isLiteralPart(patternPart) {\n\treturn patternPart.type === \"literal\";\n}\n/*\n17 ECMAScript Standard Built-in Objects:\nEvery built-in Function object, including constructors, that is not\nidentified as an anonymous function has a name property whose value\nis a String.\n\nUnless otherwise specified, the name property of a built-in Function\nobject, if it exists, has the attributes { [[Writable]]: false,\n[[Enumerable]]: false, [[Configurable]]: true }.\n*/\nexport function defineProperty(target, name, { value }) {\n\tObject.defineProperty(target, name, {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\twritable: true,\n\t\tvalue\n\t});\n}\n/**\n* 7.3.5 CreateDataProperty\n* @param target\n* @param name\n* @param value\n*/\nexport function createDataProperty(target, name, value) {\n\tObject.defineProperty(target, name, {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\twritable: true,\n\t\tvalue\n\t});\n}\nexport const UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;\nexport function invariant(condition, message, Err = Error) {\n\tif (!condition) {\n\t\tthrow new Err(message);\n\t}\n}\nexport const createMemoizedNumberFormat = memoize((...args) => new Intl.NumberFormat(...args), { strategy: strategies.variadic });\nexport const createMemoizedPluralRules = memoize((...args) => new Intl.PluralRules(...args), { strategy: strategies.variadic });\nexport const createMemoizedLocale = memoize((...args) => new Intl.Locale(...args), { strategy: strategies.variadic });\nexport const createMemoizedListFormat = memoize((...args) => new Intl.ListFormat(...args), { strategy: strategies.variadic });\n","import { CanonicalizeLocaleList } from \"#packages/ecma402-abstract/CanonicalizeLocaleList.js\";\nimport { CoerceOptionsToObject } from \"#packages/ecma402-abstract/CoerceOptionsToObject.js\";\nimport { GetOption } from \"#packages/ecma402-abstract/GetOption.js\";\nimport \"#packages/ecma402-abstract/types/relative-time.js\";\nimport { createMemoizedNumberFormat, createMemoizedPluralRules, invariant } from \"#packages/ecma402-abstract/utils.js\";\nimport { ResolveLocale } from \"@formatjs/intl-localematcher\";\nconst NUMBERING_SYSTEM_REGEX = /^[a-z0-9]{3,8}(-[a-z0-9]{3,8})*$/i;\nexport function InitializeRelativeTimeFormat(rtf, locales, options, { getInternalSlots, availableLocales, relevantExtensionKeys, localeData, getDefaultLocale }) {\n\tconst internalSlots = getInternalSlots(rtf);\n\tinternalSlots.initializedRelativeTimeFormat = true;\n\tconst requestedLocales = CanonicalizeLocaleList(locales);\n\tconst opt = Object.create(null);\n\tconst opts = CoerceOptionsToObject(options);\n\tconst matcher = GetOption(opts, \"localeMatcher\", \"string\", [\"best fit\", \"lookup\"], \"best fit\");\n\topt.localeMatcher = matcher;\n\tconst numberingSystem = GetOption(\n\t\topts,\n\t\t// @ts-expect-error TS option is wack\n\t\t\"numberingSystem\",\n\t\t\"string\",\n\t\tundefined,\n\t\tundefined\n\t);\n\tif (numberingSystem !== undefined) {\n\t\tif (!NUMBERING_SYSTEM_REGEX.test(numberingSystem)) {\n\t\t\tthrow new RangeError(`Invalid numbering system ${numberingSystem}`);\n\t\t}\n\t}\n\topt.nu = numberingSystem;\n\tconst r = ResolveLocale(availableLocales, requestedLocales, opt, relevantExtensionKeys, localeData, getDefaultLocale);\n\tconst { locale, nu } = r;\n\tinternalSlots.locale = locale;\n\tinternalSlots.style = GetOption(opts, \"style\", \"string\", [\n\t\t\"long\",\n\t\t\"narrow\",\n\t\t\"short\"\n\t], \"long\");\n\tinternalSlots.numeric = GetOption(opts, \"numeric\", \"string\", [\"always\", \"auto\"], \"always\");\n\tconst fields = localeData[r.dataLocale];\n\tinvariant(!!fields, `Missing locale data for ${r.dataLocale}`);\n\tinternalSlots.fields = fields;\n\tinternalSlots.numberFormat = createMemoizedNumberFormat(locales);\n\tinternalSlots.pluralRules = createMemoizedPluralRules(locales);\n\tinternalSlots.numberingSystem = nu;\n\treturn rtf;\n}\n","/**\n* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-samevalue\n*/\nexport function SameValue(x, y) {\n\tif (Object.is) {\n\t\treturn Object.is(x, y);\n\t}\n\tif (x === y) {\n\t\treturn x !== 0 || 1 / x === 1 / y;\n\t}\n\treturn x !== x && y !== y;\n}\n","/**\n* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-type\n*/\nexport function Type(x) {\n\tif (x === null) {\n\t\treturn \"Null\";\n\t}\n\tif (typeof x === \"undefined\") {\n\t\treturn \"Undefined\";\n\t}\n\tif (typeof x === \"function\" || typeof x === \"object\") {\n\t\treturn \"Object\";\n\t}\n\tif (typeof x === \"number\") {\n\t\treturn \"Number\";\n\t}\n\tif (typeof x === \"boolean\") {\n\t\treturn \"Boolean\";\n\t}\n\tif (typeof x === \"string\") {\n\t\treturn \"String\";\n\t}\n\tif (typeof x === \"symbol\") {\n\t\treturn \"Symbol\";\n\t}\n\tif (typeof x === \"bigint\") {\n\t\treturn \"BigInt\";\n\t}\n}\n","import { Type } from \"#packages/ecma262-abstract/Type.js\";\nimport \"#packages/ecma402-abstract/types/relative-time.js\";\nimport { invariant } from \"#packages/ecma402-abstract/utils.js\";\n/**\n* https://tc39.es/proposal-intl-relative-time/#sec-singularrelativetimeunit\n* @param unit\n*/\nexport function SingularRelativeTimeUnit(unit) {\n\tinvariant(Type(unit) === \"String\", \"unit must be a string\");\n\tif (unit === \"seconds\") return \"second\";\n\tif (unit === \"minutes\") return \"minute\";\n\tif (unit === \"hours\") return \"hour\";\n\tif (unit === \"days\") return \"day\";\n\tif (unit === \"weeks\") return \"week\";\n\tif (unit === \"months\") return \"month\";\n\tif (unit === \"quarters\") return \"quarter\";\n\tif (unit === \"years\") return \"year\";\n\tif (unit !== \"second\" && unit !== \"minute\" && unit !== \"hour\" && unit !== \"day\" && unit !== \"week\" && unit !== \"month\" && unit !== \"quarter\" && unit !== \"year\") {\n\t\tthrow new RangeError(\"invalid unit\");\n\t}\n\treturn unit;\n}\n","import { invariant } from \"#packages/ecma402-abstract/utils.js\";\n/**\n* Partition a pattern into a list of literals and placeholders\n* https://tc39.es/ecma402/#sec-partitionpattern\n* @param pattern\n*/\nexport function PartitionPattern(pattern) {\n\tconst result = [];\n\tlet beginIndex = pattern.indexOf(\"{\");\n\tlet endIndex = 0;\n\tlet nextIndex = 0;\n\tconst length = pattern.length;\n\twhile (beginIndex < pattern.length && beginIndex > -1) {\n\t\tendIndex = pattern.indexOf(\"}\", beginIndex);\n\t\tinvariant(endIndex > beginIndex, `Invalid pattern ${pattern}`);\n\t\tif (beginIndex > nextIndex) {\n\t\t\tresult.push({\n\t\t\t\ttype: \"literal\",\n\t\t\t\tvalue: pattern.substring(nextIndex, beginIndex)\n\t\t\t});\n\t\t}\n\t\tresult.push({\n\t\t\ttype: pattern.substring(beginIndex + 1, endIndex),\n\t\t\tvalue: undefined\n\t\t});\n\t\tnextIndex = endIndex + 1;\n\t\tbeginIndex = pattern.indexOf(\"{\", nextIndex);\n\t}\n\tif (nextIndex < length) {\n\t\tresult.push({\n\t\t\ttype: \"literal\",\n\t\t\tvalue: pattern.substring(nextIndex, length)\n\t\t});\n\t}\n\treturn result;\n}\n","import { PartitionPattern } from \"#packages/ecma402-abstract/PartitionPattern.js\";\nimport { invariant } from \"#packages/ecma402-abstract/utils.js\";\nexport function MakePartsList(pattern, unit, parts) {\n\tconst patternParts = PartitionPattern(pattern);\n\tconst result = [];\n\tfor (const patternPart of patternParts) {\n\t\tif (patternPart.type === \"literal\") {\n\t\t\tresult.push({\n\t\t\t\ttype: \"literal\",\n\t\t\t\tvalue: patternPart.value\n\t\t\t});\n\t\t} else {\n\t\t\tinvariant(patternPart.type === \"0\", `Malformed pattern ${pattern}`);\n\t\t\tfor (const part of parts) {\n\t\t\t\tresult.push({\n\t\t\t\t\ttype: part.type,\n\t\t\t\t\tvalue: part.value,\n\t\t\t\t\tunit\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}\n","import { SameValue } from \"#packages/ecma262-abstract/SameValue.js\";\nimport { ToString } from \"#packages/ecma262-abstract/ToString.js\";\nimport { Type } from \"#packages/ecma262-abstract/Type.js\";\nimport \"#packages/ecma402-abstract/types/plural-rules.js\";\nimport \"#packages/ecma402-abstract/types/relative-time.js\";\nimport { invariant } from \"#packages/ecma402-abstract/utils.js\";\nimport { SingularRelativeTimeUnit } from \"#packages/ecma402-abstract/RelativeTimeFormat/SingularRelativeTimeUnit.js\";\nimport { MakePartsList } from \"#packages/ecma402-abstract/RelativeTimeFormat/MakePartsList.js\";\nexport function PartitionRelativeTimePattern(rtf, value, unit, { getInternalSlots }) {\n\tinvariant(Type(value) === \"Number\", `value must be number, instead got ${typeof value}`, TypeError);\n\tinvariant(Type(unit) === \"String\", `unit must be number, instead got ${typeof value}`, TypeError);\n\tif (isNaN(value) || !isFinite(value)) {\n\t\tthrow new RangeError(`Invalid value ${value}`);\n\t}\n\tconst resolvedUnit = SingularRelativeTimeUnit(unit);\n\tconst { fields, style, numeric, pluralRules, numberFormat } = getInternalSlots(rtf);\n\tlet entry = resolvedUnit;\n\tif (style === \"short\") {\n\t\tentry = `${resolvedUnit}-short`;\n\t} else if (style === \"narrow\") {\n\t\tentry = `${resolvedUnit}-narrow`;\n\t}\n\tif (!(entry in fields)) {\n\t\tentry = resolvedUnit;\n\t}\n\tconst patterns = fields[entry];\n\tif (numeric === \"auto\") {\n\t\tif (ToString(value) in patterns) {\n\t\t\treturn [{\n\t\t\t\ttype: \"literal\",\n\t\t\t\tvalue: patterns[ToString(value)]\n\t\t\t}];\n\t\t}\n\t}\n\tlet tl = \"future\";\n\tif (SameValue(value, -0) || value < 0) {\n\t\ttl = \"past\";\n\t}\n\tconst po = patterns[tl];\n\tconst fv = typeof numberFormat.formatToParts === \"function\" ? numberFormat.formatToParts(Math.abs(value)) : \n\t// number is a part\n[{\n\t\ttype: \"literal\",\n\t\tvalue: numberFormat.format(Math.abs(value)),\n\t\tunit\n\t}];\n\tconst pr = pluralRules.select(value);\n\tconst pattern = po[pr];\n\treturn MakePartsList(pattern, resolvedUnit, fv);\n}\n","// Type-only circular import\n// eslint-disable-next-line import/no-cycle\n\nimport {type RelativeTimeFormatInternal} from '#packages/ecma402-abstract/types/relative-time.js'\n\nconst internalSlotMap = new WeakMap<\n Intl.RelativeTimeFormat,\n RelativeTimeFormatInternal\n>()\n\nexport default function getInternalSlots(\n x: Intl.RelativeTimeFormat\n): RelativeTimeFormatInternal {\n let internalSlots = internalSlotMap.get(x)\n if (!internalSlots) {\n internalSlots = Object.create(null) as RelativeTimeFormatInternal\n internalSlotMap.set(x, internalSlots)\n }\n return internalSlots\n}\n","import {ToString} from '#packages/ecma262-abstract/ToString.js'\nimport {CanonicalizeLocaleList} from '#packages/ecma402-abstract/CanonicalizeLocaleList.js'\nimport {SupportedLocales} from '#packages/ecma402-abstract/SupportedLocales.js'\nimport {\n type LocaleFieldsData,\n type RelativeTimeLocaleData,\n} from '#packages/ecma402-abstract/types/relative-time.js'\nimport {InitializeRelativeTimeFormat} from '#packages/ecma402-abstract/RelativeTimeFormat/InitializeRelativeTimeFormat.js'\nimport {PartitionRelativeTimePattern} from '#packages/ecma402-abstract/RelativeTimeFormat/PartitionRelativeTimePattern.js'\nimport getInternalSlots from '#packages/intl-relativetimeformat/get_internal_slots.js'\n\nexport default class RelativeTimeFormat {\n constructor(\n locales?: string | string[],\n options?: Intl.RelativeTimeFormatOptions\n ) {\n // test262/test/intl402/RelativeTimeFormat/constructor/constructor/newtarget-undefined.js\n // Cannot use `new.target` bc of IE11 & TS transpiles it to something else\n const newTarget =\n this && this instanceof RelativeTimeFormat ? this.constructor : void 0\n if (!newTarget) {\n throw new TypeError(\"Intl.RelativeTimeFormat must be called with 'new'\")\n }\n return InitializeRelativeTimeFormat(this, locales, options, {\n getInternalSlots,\n availableLocales: RelativeTimeFormat.availableLocales,\n relevantExtensionKeys: RelativeTimeFormat.relevantExtensionKeys,\n localeData: RelativeTimeFormat.localeData,\n getDefaultLocale: RelativeTimeFormat.getDefaultLocale,\n })\n }\n format(value: number, unit: Intl.RelativeTimeFormatUnit): string {\n if (typeof this !== 'object') {\n throw new TypeError('format was called on a non-object')\n }\n const internalSlots = getInternalSlots(this)\n if (!internalSlots.initializedRelativeTimeFormat) {\n throw new TypeError('format was called on a invalid context')\n }\n return PartitionRelativeTimePattern(\n this,\n Number(value),\n ToString(unit) as Intl.RelativeTimeFormatUnit,\n {\n getInternalSlots,\n }\n )\n .map(el => el.value)\n .join('')\n }\n formatToParts(\n value: number,\n unit: Intl.RelativeTimeFormatUnit\n ): Intl.RelativeTimeFormatPart[] {\n if (typeof this !== 'object') {\n throw new TypeError('formatToParts was called on a non-object')\n }\n const internalSlots = getInternalSlots(this)\n if (!internalSlots.initializedRelativeTimeFormat) {\n throw new TypeError('formatToParts was called on a invalid context')\n }\n return PartitionRelativeTimePattern(\n this,\n Number(value),\n ToString(unit) as Intl.RelativeTimeFormatUnit,\n {getInternalSlots}\n )\n }\n\n resolvedOptions(): Intl.ResolvedRelativeTimeFormatOptions {\n if (typeof this !== 'object') {\n throw new TypeError('resolvedOptions was called on a non-object')\n }\n const internalSlots = getInternalSlots(this)\n if (!internalSlots.initializedRelativeTimeFormat) {\n throw new TypeError('resolvedOptions was called on a invalid context')\n }\n\n // test262/test/intl402/RelativeTimeFormat/prototype/resolvedOptions/type.js\n return {\n locale: internalSlots.locale,\n style: internalSlots.style,\n numeric: internalSlots.numeric,\n numberingSystem: internalSlots.numberingSystem,\n }\n }\n\n public static supportedLocalesOf(\n locales: string | string[],\n options?: Pick<Intl.RelativeTimeFormatOptions, 'localeMatcher'>\n ): string[] {\n return SupportedLocales(\n RelativeTimeFormat.availableLocales,\n CanonicalizeLocaleList(locales),\n options\n )\n }\n\n public static __addLocaleData(...data: RelativeTimeLocaleData[]): void {\n for (const {data: d, locale} of data) {\n const minimizedLocale = new (Intl as any).Locale(locale)\n .minimize()\n .toString()\n RelativeTimeFormat.localeData[locale] = RelativeTimeFormat.localeData[\n minimizedLocale\n ] = d\n RelativeTimeFormat.availableLocales.add(minimizedLocale)\n RelativeTimeFormat.availableLocales.add(locale)\n if (!RelativeTimeFormat.__defaultLocale) {\n RelativeTimeFormat.__defaultLocale = minimizedLocale\n }\n }\n }\n static localeData: Record<string, LocaleFieldsData> = {}\n private static availableLocales = new Set<string>()\n private static __defaultLocale = ''\n private static getDefaultLocale() {\n return RelativeTimeFormat.__defaultLocale\n }\n private static relevantExtensionKeys = ['nu']\n public static polyfilled = true\n}\n\ntry {\n // IE11 does not have Symbol\n if (typeof Symbol !== 'undefined') {\n Object.defineProperty(RelativeTimeFormat.prototype, Symbol.toStringTag, {\n value: 'Intl.RelativeTimeFormat',\n writable: false,\n enumerable: false,\n configurable: true,\n })\n }\n\n // https://github.com/tc39/test262/blob/master/test/intl402/RelativeTimeFormat/constructor/length.js\n Object.defineProperty(RelativeTimeFormat.prototype.constructor, 'length', {\n value: 0,\n writable: false,\n enumerable: false,\n configurable: true,\n })\n // https://github.com/tc39/test262/blob/master/test/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/length.js\n Object.defineProperty(RelativeTimeFormat.supportedLocalesOf, 'length', {\n value: 1,\n writable: false,\n enumerable: false,\n configurable: true,\n })\n} catch {\n // Meta fix so we're test262-compliant, not important\n}\n"],"x_google_ignoreList":[6],"mappings":";;;;;AAGA,SAAgB,SAAS,GAAG;AAC3B,KAAI,OAAO,MAAM,SAChB,OAAM,UAAU,4CAA4C;AAE7D,QAAO,OAAO,EAAE;;;;;;;;ACHjB,SAAgB,uBAAuB,SAAS;AAE/C,QAAO,KAAK,oBAAoB,QAAQ;;;;;;;ACHzC,SAAgB,SAAS,KAAK;AAC7B,KAAI,OAAO,KACV,OAAM,IAAI,UAAU,+CAA+C;AAEpE,QAAO,OAAO,IAAI;;;;;;;;;;;;ACEnB,SAAgB,UAAU,MAAM,MAAM,MAAM,QAAQ,UAAU;AAC7D,KAAI,OAAO,SAAS,SACnB,OAAM,IAAI,UAAU,4BAA4B;CAEjD,IAAI,QAAQ,KAAK;AACjB,KAAI,UAAU,KAAA,GAAW;AACxB,MAAI,SAAS,aAAa,SAAS,SAClC,OAAM,IAAI,UAAU,eAAe;AAEpC,MAAI,SAAS,UACZ,SAAQ,QAAQ,MAAM;AAEvB,MAAI,SAAS,SACZ,SAAQ,SAAS,MAAM;AAExB,MAAI,WAAW,KAAA,KAAa,CAAC,OAAO,QAAQ,QAAQ,OAAO,MAAM,CAAC,OACjE,OAAM,IAAI,WAAW,GAAG,MAAM,iBAAiB,OAAO,KAAK,KAAK,GAAG;AAEpE,SAAO;;AAER,QAAO;;;;;;;;;;ACpBR,SAAgB,iBAAiB,kBAAkB,kBAAkB,SAAS;CAC7E,IAAI,UAAU;AACd,KAAI,YAAY,KAAA,GAAW;AAC1B,YAAU,SAAS,QAAQ;AAC3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