@rzl-zone/utils-js 3.12.1-beta.0 → 3.12.1-beta.1

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 (239) hide show
  1. package/README.md +7 -7
  2. package/dist/.references/index.d.cts +1 -1
  3. package/dist/.references/index.d.ts +1 -1
  4. package/dist/{assertIsArray-BChqwPiP.cjs → assertIsArray-DJXkjHZs.cjs} +3 -3
  5. package/dist/{assertIsArray-BChqwPiP.cjs.map → assertIsArray-DJXkjHZs.cjs.map} +1 -1
  6. package/dist/{assertIsArray-BfAbIUfa.js → assertIsArray-bTA3XLjq.js} +3 -3
  7. package/dist/{assertIsArray-BfAbIUfa.js.map → assertIsArray-bTA3XLjq.js.map} +1 -1
  8. package/dist/{assertIsBoolean-DozdtbNi.cjs → assertIsBoolean-C8WEXVr2.cjs} +8 -8
  9. package/dist/assertIsBoolean-C8WEXVr2.cjs.map +1 -0
  10. package/dist/{assertIsBoolean-BlBct0Fc.js → assertIsBoolean-DR1SaXPD.js} +8 -8
  11. package/dist/assertIsBoolean-DR1SaXPD.js.map +1 -0
  12. package/dist/{assertIsString-Bvk7bUL7.cjs → assertIsString-BiHQSrB2.cjs} +3 -3
  13. package/dist/{assertIsString-Bvk7bUL7.cjs.map → assertIsString-BiHQSrB2.cjs.map} +1 -1
  14. package/dist/{assertIsString-DqV9NwbI.js → assertIsString-CEB07_83.js} +3 -3
  15. package/dist/{assertIsString-DqV9NwbI.js.map → assertIsString-CEB07_83.js.map} +1 -1
  16. package/dist/assertions/index.cjs +5 -5
  17. package/dist/assertions/index.d.cts +2 -2
  18. package/dist/assertions/index.d.ts +2 -2
  19. package/dist/assertions/index.js +5 -5
  20. package/dist/conversions/index.cjs +6 -6
  21. package/dist/conversions/index.d.cts +2 -2
  22. package/dist/conversions/index.d.ts +2 -2
  23. package/dist/conversions/index.js +6 -6
  24. package/dist/{conversions-EMJa3g-D.js → conversions-BNIh_tCH.js} +16 -18
  25. package/dist/conversions-BNIh_tCH.js.map +1 -0
  26. package/dist/{conversions-CBs8-REq.cjs → conversions-D_Kh0a_C.cjs} +16 -18
  27. package/dist/conversions-D_Kh0a_C.cjs.map +1 -0
  28. package/dist/events/index.cjs +4 -4
  29. package/dist/events/index.cjs.map +1 -1
  30. package/dist/events/index.d.cts +153 -151
  31. package/dist/events/index.d.ts +153 -151
  32. package/dist/events/index.js +4 -4
  33. package/dist/events/index.js.map +1 -1
  34. package/dist/{formatEnvPort-hHNvOim-.cjs → formatEnvPort-B3OLxQk9.cjs} +9 -9
  35. package/dist/formatEnvPort-B3OLxQk9.cjs.map +1 -0
  36. package/dist/{formatEnvPort-DpIXzPAZ.js → formatEnvPort-ByFVLjSV.js} +9 -9
  37. package/dist/formatEnvPort-ByFVLjSV.js.map +1 -0
  38. package/dist/formatters/index.cjs +2 -2
  39. package/dist/formatters/index.d.cts +2 -2
  40. package/dist/formatters/index.d.ts +2 -2
  41. package/dist/formatters/index.js +2 -2
  42. package/dist/{formatters-QcZO_Cpx.js → formatters--1m_vpE8.js} +17 -15
  43. package/dist/formatters--1m_vpE8.js.map +1 -0
  44. package/dist/{formatters-lAYgA11L.cjs → formatters-Cbij0XLU.cjs} +17 -15
  45. package/dist/formatters-Cbij0XLU.cjs.map +1 -0
  46. package/dist/generators/index.cjs +12 -8
  47. package/dist/generators/index.cjs.map +1 -1
  48. package/dist/generators/index.d.cts +2 -2
  49. package/dist/generators/index.d.ts +2 -2
  50. package/dist/generators/index.js +12 -8
  51. package/dist/generators/index.js.map +1 -1
  52. package/dist/index-59zbLcPr.d.ts +340 -0
  53. package/dist/index-B6tawc8L.d.cts +1716 -0
  54. package/dist/index-C267akkJ.d.ts +2158 -0
  55. package/dist/index-CeBC2Vvl.d.cts +2361 -0
  56. package/dist/index-CgRDTI6f.d.ts +822 -0
  57. package/dist/index-CoiUBVmr.d.ts +720 -0
  58. package/dist/index-D4fcasfZ.d.cts +720 -0
  59. package/dist/index-DDrSQKIc.d.ts +1716 -0
  60. package/dist/index-DsGxO31H.d.cts +765 -0
  61. package/dist/index-Hg1qJkjl.d.ts +765 -0
  62. package/dist/index-Qm3iFwd0.d.cts +2158 -0
  63. package/dist/index-UPp94Agr.d.ts +2361 -0
  64. package/dist/index-gBA_8SuF.d.cts +340 -0
  65. package/dist/index-jyDqzicx.d.cts +822 -0
  66. package/dist/{isBigInt-B1cijjqm.cjs → isBigInt-C4krUeAw.cjs} +2 -2
  67. package/dist/{isBigInt-B1cijjqm.cjs.map → isBigInt-C4krUeAw.cjs.map} +1 -1
  68. package/dist/{isBigInt-C0bN0Rhu.js → isBigInt-DKe0M6hp.js} +2 -2
  69. package/dist/{isBigInt-C0bN0Rhu.js.map → isBigInt-DKe0M6hp.js.map} +1 -1
  70. package/dist/{isEmptyObject-DeLVIJpl.js → isEmptyObject-DCipFwxJ.js} +3 -3
  71. package/dist/{isEmptyObject-DeLVIJpl.js.map → isEmptyObject-DCipFwxJ.js.map} +1 -1
  72. package/dist/{isEmptyObject-DI42NEo0.cjs → isEmptyObject-ZkSwRC_D.cjs} +3 -3
  73. package/dist/{isEmptyObject-DI42NEo0.cjs.map → isEmptyObject-ZkSwRC_D.cjs.map} +1 -1
  74. package/dist/{isEmptyString-BTUWYTbw.js → isEmptyString-BXzKAC2j.js} +3 -3
  75. package/dist/{isEmptyString-BTUWYTbw.js.map → isEmptyString-BXzKAC2j.js.map} +1 -1
  76. package/dist/{isEmptyString-CCK3bP74.cjs → isEmptyString-UiiUsSQj.cjs} +3 -3
  77. package/dist/{isEmptyString-CCK3bP74.cjs.map → isEmptyString-UiiUsSQj.cjs.map} +1 -1
  78. package/dist/{isEmptyValue-DMSMFTU8.cjs → isEmptyValue-BQzcjVaL.cjs} +5 -5
  79. package/dist/{isEmptyValue-DMSMFTU8.cjs.map → isEmptyValue-BQzcjVaL.cjs.map} +1 -1
  80. package/dist/{isEmptyValue-fjnfQnt5.js → isEmptyValue-jqOr7OHD.js} +5 -5
  81. package/dist/{isEmptyValue-fjnfQnt5.js.map → isEmptyValue-jqOr7OHD.js.map} +1 -1
  82. package/dist/{isEqual-DhyP8fB_.js → isEqual-BX49cF9m.js} +4 -4
  83. package/dist/{isEqual-DhyP8fB_.js.map → isEqual-BX49cF9m.js.map} +1 -1
  84. package/dist/{isEqual-B1fRgEuU.cjs → isEqual-BvumA3RA.cjs} +4 -4
  85. package/dist/{isEqual-B1fRgEuU.cjs.map → isEqual-BvumA3RA.cjs.map} +1 -1
  86. package/dist/{isFinite-BYMOo0os.js → isFinite-BCnaDpod.js} +3 -3
  87. package/dist/{isFinite-BYMOo0os.js.map → isFinite-BCnaDpod.js.map} +1 -1
  88. package/dist/{isFinite-sFkps2TY.cjs → isFinite-D24ZaE6c.cjs} +3 -3
  89. package/dist/{isFinite-sFkps2TY.cjs.map → isFinite-D24ZaE6c.cjs.map} +1 -1
  90. package/dist/{isInteger-FTCthMre.cjs → isInteger-Caeuz0rB.cjs} +2 -2
  91. package/dist/{isInteger-FTCthMre.cjs.map → isInteger-Caeuz0rB.cjs.map} +1 -1
  92. package/dist/{isInteger-DS9V7l_f.js → isInteger-naMbJsxJ.js} +2 -2
  93. package/dist/{isInteger-DS9V7l_f.js.map → isInteger-naMbJsxJ.js.map} +1 -1
  94. package/dist/isPlainObject-BF-2-phb.d.cts +339 -0
  95. package/dist/isPlainObject-DxNDL8XU.d.ts +339 -0
  96. package/dist/{isServer-q-QLFCqE.cjs → isServer-BJHVnixd.cjs} +2 -2
  97. package/dist/{isServer-q-QLFCqE.cjs.map → isServer-BJHVnixd.cjs.map} +1 -1
  98. package/dist/{isServer-D1TXfOs3.js → isServer-Da3o3XSs.js} +2 -2
  99. package/dist/{isServer-D1TXfOs3.js.map → isServer-Da3o3XSs.js.map} +1 -1
  100. package/dist/{isTypedArray-47R0wdrc.js → isTypedArray-DuNA8tK6.js} +3 -3
  101. package/dist/{isTypedArray-47R0wdrc.js.map → isTypedArray-DuNA8tK6.js.map} +1 -1
  102. package/dist/{isTypedArray-DiCoqffZ.cjs → isTypedArray-TJptiw2b.cjs} +3 -3
  103. package/dist/{isTypedArray-DiCoqffZ.cjs.map → isTypedArray-TJptiw2b.cjs.map} +1 -1
  104. package/dist/{isURL-CQiowFq2.js → isURL-C-kSk6KJ.js} +2 -2
  105. package/dist/{isURL-CQiowFq2.js.map → isURL-C-kSk6KJ.js.map} +1 -1
  106. package/dist/{isURL-WZypXsax.cjs → isURL-DeUPO_oR.cjs} +2 -2
  107. package/dist/{isURL-WZypXsax.cjs.map → isURL-DeUPO_oR.cjs.map} +1 -1
  108. package/dist/{isValidDomain-BSXshgkC.cjs → isValidDomain-BB9IGhJs.cjs} +65 -8
  109. package/dist/isValidDomain-BB9IGhJs.cjs.map +1 -0
  110. package/dist/{isValidDomain-DwA2EN79.js → isValidDomain-DoE98yhJ.js} +54 -9
  111. package/dist/isValidDomain-DoE98yhJ.js.map +1 -0
  112. package/dist/next/index.cjs +7 -7
  113. package/dist/next/index.cjs.map +1 -1
  114. package/dist/next/index.d.cts +185 -191
  115. package/dist/next/index.d.ts +185 -191
  116. package/dist/next/index.js +7 -7
  117. package/dist/next/index.js.map +1 -1
  118. package/dist/next/server/index.cjs +2 -2
  119. package/dist/next/server/index.d.cts +26 -26
  120. package/dist/next/server/index.d.ts +26 -26
  121. package/dist/next/server/index.js +2 -2
  122. package/dist/{noop-B2mTBhW-.cjs → noop-B13_ii35.cjs} +2 -2
  123. package/dist/{noop-B2mTBhW-.cjs.map → noop-B13_ii35.cjs.map} +1 -1
  124. package/dist/{noop-BzktGBVz.js → noop-ubqAIbHD.js} +2 -2
  125. package/dist/{noop-BzktGBVz.js.map → noop-ubqAIbHD.js.map} +1 -1
  126. package/dist/{normalizeSpaces-WS_iERJk.js → normalizeSpaces-Bg2IZW7W.js} +3 -3
  127. package/dist/{normalizeSpaces-WS_iERJk.js.map → normalizeSpaces-Bg2IZW7W.js.map} +1 -1
  128. package/dist/{normalizeSpaces-DQHR3Tlr.cjs → normalizeSpaces-ZXnR4Qzp.cjs} +3 -3
  129. package/dist/{normalizeSpaces-DQHR3Tlr.cjs.map → normalizeSpaces-ZXnR4Qzp.cjs.map} +1 -1
  130. package/dist/{normalizeString-2WLth_Gj.js → normalizeString-BDdkaXui.js} +3 -3
  131. package/dist/{normalizeString-2WLth_Gj.js.map → normalizeString-BDdkaXui.js.map} +1 -1
  132. package/dist/{normalizeString-D8euBcRD.cjs → normalizeString-BE6ELqEb.cjs} +3 -3
  133. package/dist/{normalizeString-D8euBcRD.cjs.map → normalizeString-BE6ELqEb.cjs.map} +1 -1
  134. package/dist/operations/index.cjs +10 -10
  135. package/dist/operations/index.cjs.map +1 -1
  136. package/dist/operations/index.d.cts +120 -120
  137. package/dist/operations/index.d.ts +120 -120
  138. package/dist/operations/index.js +10 -10
  139. package/dist/operations/index.js.map +1 -1
  140. package/dist/parsers/index.cjs +2 -2
  141. package/dist/parsers/index.d.cts +222 -222
  142. package/dist/parsers/index.d.ts +222 -222
  143. package/dist/parsers/index.js +2 -2
  144. package/dist/{parsers-Dpuq-V4u.js → parsers-BSBPgvsq.js} +4 -4
  145. package/dist/{parsers-Dpuq-V4u.js.map → parsers-BSBPgvsq.js.map} +1 -1
  146. package/dist/{parsers-DXtpsDyj.cjs → parsers-OqDeffqc.cjs} +4 -4
  147. package/dist/{parsers-DXtpsDyj.cjs.map → parsers-OqDeffqc.cjs.map} +1 -1
  148. package/dist/{parsing-B43x1sxn.js → parsing-Cao8b358.js} +3 -3
  149. package/dist/{parsing-B43x1sxn.js.map → parsing-Cao8b358.js.map} +1 -1
  150. package/dist/{parsing-lRoxn1Nz.cjs → parsing-DOGSCH6N.cjs} +3 -3
  151. package/dist/{parsing-lRoxn1Nz.cjs.map → parsing-DOGSCH6N.cjs.map} +1 -1
  152. package/dist/predicates/index.cjs +15 -15
  153. package/dist/predicates/index.d.cts +3 -3
  154. package/dist/predicates/index.d.ts +3 -3
  155. package/dist/predicates/index.js +15 -15
  156. package/dist/{predicates-gNepszvo.js → predicates-Bj6meyXV.js} +13 -14
  157. package/dist/{predicates-gNepszvo.js.map → predicates-Bj6meyXV.js.map} +1 -1
  158. package/dist/{predicates-DiaYA7Ps.cjs → predicates-D0ubqgqy.cjs} +13 -14
  159. package/dist/{predicates-DiaYA7Ps.cjs.map → predicates-D0ubqgqy.cjs.map} +1 -1
  160. package/dist/promises/index.cjs +4 -4
  161. package/dist/promises/index.d.cts +101 -101
  162. package/dist/promises/index.d.ts +101 -101
  163. package/dist/promises/index.js +4 -4
  164. package/dist/{punyCode-hmiFzLWT.js → punyCode-8SrbMWfM.js} +6 -6
  165. package/dist/punyCode-8SrbMWfM.js.map +1 -0
  166. package/dist/{punyCode-CTWXVVFo.cjs → punyCode-D-Qu6nj6.cjs} +6 -6
  167. package/dist/punyCode-D-Qu6nj6.cjs.map +1 -0
  168. package/dist/{removeSpaces-BE8lfh-4.js → removeSpaces-Bmc5DX4F.js} +3 -3
  169. package/dist/removeSpaces-Bmc5DX4F.js.map +1 -0
  170. package/dist/{removeSpaces-DRRxNWlb.cjs → removeSpaces-CWIvhZHg.cjs} +3 -3
  171. package/dist/removeSpaces-CWIvhZHg.cjs.map +1 -0
  172. package/dist/rzl-utils.global.js +21 -0
  173. package/dist/{safeJsonParse-CXruaP0p.js → safeJsonParse-BP38mwlj.js} +9 -9
  174. package/dist/safeJsonParse-BP38mwlj.js.map +1 -0
  175. package/dist/{safeJsonParse-BBnQElk8.cjs → safeJsonParse-Sms2CJf4.cjs} +9 -9
  176. package/dist/safeJsonParse-Sms2CJf4.cjs.map +1 -0
  177. package/dist/{safeStableStringify-Cc62pfRp.cjs → safeStableStringify-CJtP89qn.cjs} +4 -4
  178. package/dist/{safeStableStringify-Cc62pfRp.cjs.map → safeStableStringify-CJtP89qn.cjs.map} +1 -1
  179. package/dist/{safeStableStringify-BNh3D0K0.js → safeStableStringify-CXOZ9Ub8.js} +4 -4
  180. package/dist/{safeStableStringify-BNh3D0K0.js.map → safeStableStringify-CXOZ9Ub8.js.map} +1 -1
  181. package/dist/strings/index.cjs +12 -9
  182. package/dist/strings/index.cjs.map +1 -1
  183. package/dist/strings/index.d.cts +2 -2
  184. package/dist/strings/index.d.ts +2 -2
  185. package/dist/strings/index.js +12 -9
  186. package/dist/strings/index.js.map +1 -1
  187. package/dist/tailwind/index.cjs +2 -2
  188. package/dist/tailwind/index.d.cts +2 -2
  189. package/dist/tailwind/index.d.ts +2 -2
  190. package/dist/tailwind/index.js +2 -2
  191. package/dist/{tailwind-IJvOdkZp.js → tailwind-B2ssevxq.js} +5 -5
  192. package/dist/tailwind-B2ssevxq.js.map +1 -0
  193. package/dist/{tailwind-DJ4cmLUw.cjs → tailwind-CHIx9uxu.cjs} +5 -5
  194. package/dist/tailwind-CHIx9uxu.cjs.map +1 -0
  195. package/dist/{toStringArrayUnRecursive-xUaU8Ot9.cjs → toStringArrayUnRecursive-C4zYCja7.cjs} +6 -6
  196. package/dist/{toStringArrayUnRecursive-xUaU8Ot9.cjs.map → toStringArrayUnRecursive-C4zYCja7.cjs.map} +1 -1
  197. package/dist/{toStringArrayUnRecursive-CFs0jTEg.js → toStringArrayUnRecursive-DJGtPsFb.js} +6 -6
  198. package/dist/{toStringArrayUnRecursive-CFs0jTEg.js.map → toStringArrayUnRecursive-DJGtPsFb.js.map} +1 -1
  199. package/dist/urls/index.cjs +15 -14
  200. package/dist/urls/index.cjs.map +1 -1
  201. package/dist/urls/index.d.cts +656 -659
  202. package/dist/urls/index.d.ts +656 -659
  203. package/dist/urls/index.js +15 -14
  204. package/dist/urls/index.js.map +1 -1
  205. package/package.json +2 -2
  206. package/dist/assertIsBoolean-BlBct0Fc.js.map +0 -1
  207. package/dist/assertIsBoolean-DozdtbNi.cjs.map +0 -1
  208. package/dist/conversions-CBs8-REq.cjs.map +0 -1
  209. package/dist/conversions-EMJa3g-D.js.map +0 -1
  210. package/dist/formatEnvPort-DpIXzPAZ.js.map +0 -1
  211. package/dist/formatEnvPort-hHNvOim-.cjs.map +0 -1
  212. package/dist/formatters-QcZO_Cpx.js.map +0 -1
  213. package/dist/formatters-lAYgA11L.cjs.map +0 -1
  214. package/dist/index-26W7ItWx.d.ts +0 -760
  215. package/dist/index-BPPQjAfs.d.cts +0 -2359
  216. package/dist/index-BXjlgBLz.d.cts +0 -2139
  217. package/dist/index-B_Wwo91H.d.ts +0 -2359
  218. package/dist/index-CpufydcI.d.cts +0 -704
  219. package/dist/index-Czc4O526.d.ts +0 -333
  220. package/dist/index-DPs1_p5G.d.cts +0 -760
  221. package/dist/index-DRpOyBSC.d.ts +0 -1703
  222. package/dist/index-DWWvtHUn.d.cts +0 -822
  223. package/dist/index-DnM0LD0n.d.cts +0 -333
  224. package/dist/index-GUZ9fK6T.d.ts +0 -2139
  225. package/dist/index-I4fAzwXV.d.ts +0 -704
  226. package/dist/index-JDrOl_19.d.ts +0 -822
  227. package/dist/index-b66P49Qe.d.cts +0 -1703
  228. package/dist/isPlainObject-DcFGh3_5.d.ts +0 -530
  229. package/dist/isPlainObject-doTI11Ib.d.cts +0 -530
  230. package/dist/isValidDomain-BSXshgkC.cjs.map +0 -1
  231. package/dist/isValidDomain-DwA2EN79.js.map +0 -1
  232. package/dist/punyCode-CTWXVVFo.cjs.map +0 -1
  233. package/dist/punyCode-hmiFzLWT.js.map +0 -1
  234. package/dist/removeSpaces-BE8lfh-4.js.map +0 -1
  235. package/dist/removeSpaces-DRRxNWlb.cjs.map +0 -1
  236. package/dist/safeJsonParse-BBnQElk8.cjs.map +0 -1
  237. package/dist/safeJsonParse-CXruaP0p.js.map +0 -1
  238. package/dist/tailwind-DJ4cmLUw.cjs.map +0 -1
  239. package/dist/tailwind-IJvOdkZp.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatters-QcZO_Cpx.js","names":["format","formatDns"],"sources":["../src/formatters/currencies/formatCurrency.ts","../src/formatters/numbers/formatNumber.ts","../src/formatters/phones/_private/formatPhoneNumber.utils.ts","../src/formatters/phones/formatPhoneNumber.ts","../src/formatters/strings/_private/censorEmail.utils.ts","../src/formatters/strings/censorEmail.ts","../src/formatters/strings/chunkString.ts","../src/formatters/strings/truncateString.ts","../src/formatters/times/formatDateFns.ts","../src/formatters/times/formatDateIntl.ts","../src/formatters/times/formatDateTime.ts","../src/formatters/times/getGMTOffset.ts"],"sourcesContent":["import type { FormatCurrencyOptions } from \"@/formatters/currencies/formatCurrency.types\";\n\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isFinite } from \"@/predicates/is/isFinite\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isInteger } from \"@/predicates/is/isInteger\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { isFunction } from \"@/predicates/is/isFunction\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isUndefined } from \"@/predicates/is/isUndefined\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\n\nimport { assertIsString } from \"@/assertions/strings/assertIsString\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\nimport { parseCurrencyString } from \"@/conversions/currency/parsing\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\n/** @private ***Util helper for {@link formatCurrency}.*** */\nconst formatIndianNumber = ({\n numStr,\n separator\n}: {\n numStr?: string;\n separator: string;\n}) => {\n const lastThree = numStr?.slice(-3);\n const rest = numStr?.slice(0, -3);\n if (!rest) return lastThree;\n return (\n rest.replace(/\\B(?=(\\d{2})+(?!\\d))/g, separator) + separator + lastThree\n );\n};\n\n/** -------------------------------------------------------\n * * ***Utility: `formatCurrency`.***\n * -------------------------------------------------------\n * **Formats a number or messy currency string into a\n * beautifully formatted currency string, with highly\n * customizable separators, decimal control, rounding,\n * currency symbols, and negative styling.**\n * - **✅ Highlights:**\n * - ***Accepts:***\n * - Pure numbers: `15300.95`.\n * - Messy currency strings from **any locale**:\n * - `\"Rp 15.000,21\"` ***(Indonesian / Euro)***.\n * - `\"$12,345.60\"` ***(US)***.\n * - `\"CHF 12'345.60\"` ***(Swiss)***.\n * - `\"1,23,456.78\"` ***(Indian)***.\n * - Auto extracts numeric value with smart multi-locale parsing\n * via ***`parseCurrencyString` utility function***.\n * - Strong type checks & clear errors for misconfigured options.\n * - **Handles:**\n * - Thousands separators: `.`, `,`, `'`, ` `.\n * - Decimal separators: `,`, `.`.\n * - Decimal suffix (eg. `\".-\"`, `\" USD\"`).\n * - Currency prefix (eg. `\"Rp \"`, `\"$ \"`).\n * - Rounding: `\"round\"`, `\"ceil\"`, `\"floor\"`, or truncate.\n * - Negative styling: dash `-`, brackets `( )`, absolute, or custom.\n * - **✅ How input is parsed:**\n * - Removes all non-digit except `.`, `,`, `'` and spaces.\n * - Detects bracket negatives: `\"(15.000,10)\"` ➔ `-15000.10`.\n * - Uses last `,` or `.` as decimal separator (others are thousands).\n * - Ignores currency symbols like `Rp`, `$` (must re-apply with `suffixCurrency`).\n * - **ℹ️ Note:**\n * - Always re-apply symbols via `suffixCurrency`.\n * - `parseCurrencyString` smartly detects last decimal,\n * so `\"1.121.234,56\"` and `\"1,121,234.56\"` both parsed correctly.\n * @param {string|number} value\n * ***The input value to format, examples:***\n * - `\"Rp 15.000,21\"`.\n * - `\"$12,345.60\"`.\n * - `\"CHF 12'345.60\"`.\n * - `15300.95`.\n * @param {FormatCurrencyOptions} [options] ***Optional configuration object.***\n * @param {FormatCurrencyOptions[\"separator\"]} [options.separator]\n * ***Thousands separator:***\n * - `{ separator: \".\" }` ➔ `1.000.000`.\n * - *DefaultValue: `\".\"`.*\n * @param {FormatCurrencyOptions[\"separatorDecimals\"]} [options.separatorDecimals]\n * ***Decimal separator:***\n * - `{ separatorDecimals: \",\" }` ➔ `1.000,10`.\n * - *DefaultValue: `\",\"`.*\n * @param {FormatCurrencyOptions[\"suffixCurrency\"]} [options.suffixCurrency]\n * ***Prefix currency string:***\n * - Does **not auto-keep input symbols**.\n * - Must set manually e.g: `{ suffixCurrency: \"Rp \" }`.\n * - `{ suffixCurrency: \"Rp \" }` ➔ `Rp 1.000`.\n * - *DefaultValue: `\"\"`.*\n * @param {FormatCurrencyOptions[\"decimal\"]} [options.decimal]\n * ***Whether to show decimals. If `false`, decimals are truncated:***\n * - If `false`, cut the decimal.\n * - *DefaultValue: `false`.*\n * @param {FormatCurrencyOptions[\"totalDecimal\"]} [options.totalDecimal]\n * ***Total decimal digits:***\n * - If `decimal: true` & `roundedDecimal: false`, simply cuts.\n * - *DefaultValue: `2`.*\n * @param {FormatCurrencyOptions[\"separatorDecimals\"]} [options.suffixDecimal]\n * ***Text appended after decimals:***\n * - E.g: (`\".-\"`, `\" USD\"`).\n * - Example 1: `\".-\"` ➔ `1.000,00.-`.\n * - Example 2: `\" USD\"` ➔ `1.000,00 USD`.\n * - *DefaultValue: `\"\"`.*\n * @param {FormatCurrencyOptions[\"endDecimal\"]} [options.endDecimal]\n * ***Actually append `suffixDecimal`:***\n * - *DefaultValue: `true`.*\n * @param {FormatCurrencyOptions[\"roundedDecimal\"]} [options.roundedDecimal]\n * ***Rounding mode:***\n * - `\"round\"` ➔ nearest.\n * - `\"ceil\"` ➔ always up.\n * - `\"floor\"` ➔ always down.\n * - `false` ➔ truncate.\n * - *DefaultValue: `\"round\"`.*\n * @param {FormatCurrencyOptions[\"negativeFormat\"]} [options.negativeFormat]\n * ***How to format negatives:***\n * - `\"dash\"` ➔ `-15.000`.\n * - `\"brackets\"` ➔ `(15.000)`.\n * - `\"abs\"` ➔ `15.000` (always positive).\n * - Or object: `{ style: \"dash\" | \"brackets\" | \"abs\", space: true | false, custom: (formatted) => string }`.\n * - *DefaultValue: `\"dash\"`.*\n * @param {FormatCurrencyOptions[\"indianFormat\"]} [options.indianFormat]\n * ***Applies Indian Format:***\n * - If `true`, formats as Indian: `12,34,567`.\n * - Also forces `separator: \",\"`, `separatorDecimals: \".\"`.\n * @returns {string}\n * ***Nicely formatted currency string, examples:***\n * - `\"15.000,10\"`.\n * - `\"Rp 15.000,10.-\"`.\n * - `\"15'000.10 USD\"`.\n * - `\"12,34,567.89\"`.\n * @throws **{@link TypeError | `TypeError`}** ***If:***\n * - The `value` is not string or number.\n * - Cannot parse to valid number.\n * - Options have invalid types.\n * @example\n * // --- Number input (default, decimals off) ---\n * formatCurrency(1234567.89);\n * // ➔ \"1.234.567\"\n *\n * // --- Decimals enabled ---\n * formatCurrency(1234567.89, { decimal: true });\n * // ➔ \"1.234.567,89\"\n *\n * // --- Indian format ---\n * formatCurrency(1234567.89, { decimal: true, indianFormat: true });\n * // ➔ \"12,34,567.89\"\n *\n * // --- String input (Indonesian style) ---\n * formatCurrency(\"Rp 15.000,21\", { decimal: true });\n * // ➔ \"15.000,21\"\n *\n * // --- String input (US style) ---\n * formatCurrency(\"$12,345.60\", { decimal: true });\n * // ➔ \"12.345,60\"\n *\n * // --- String input (Swiss style) ---\n * formatCurrency(\"CHF 12'345.60\", { decimal: true });\n * // ➔ \"12'345,60\"\n *\n * // --- String input (Indian style) ---\n * formatCurrency(\"1,23,456.78\", { decimal: true, indianFormat: true });\n * // ➔ \"12,34,567.78\"\n *\n * // --- Negative numbers (dash) ---\n * formatCurrency(-1234.56, { decimal: true });\n * // ➔ \"-1.234,56\"\n *\n * // --- Negative numbers (brackets) ---\n * formatCurrency(-1234.56, {\n * decimal: true,\n * negativeFormat: \"brackets\"\n * });\n * // ➔ \"(1.234,56)\"\n *\n * // --- Negative numbers (custom object style) ---\n * formatCurrency(-1234.56, {\n * decimal: true,\n * negativeFormat: { style: \"brackets\", space: true }\n * });\n * // ➔ \"( 1.234,56 )\"\n *\n * // --- Negative numbers (custom function) ---\n * formatCurrency(-1234.56, {\n * decimal: true,\n * negativeFormat: { custom: (val) => `NEGATIVE[${val}]` }\n * });\n * // ➔ \"NEGATIVE[1.234,56]\"\n *\n * // --- With prefix currency ---\n * formatCurrency(1234.56, {\n * decimal: true,\n * suffixCurrency: \"Rp \"\n * });\n * // ➔ \"Rp 1.234,56\"\n *\n * // --- With suffix decimal ---\n * formatCurrency(1234.56, {\n * decimal: true,\n * suffixDecimal: \".-\"\n * });\n * // ➔ \"1.234,56.-\"\n *\n * // --- With suffix currency + suffix decimal ---\n * formatCurrency(1234.56, {\n * decimal: true,\n * suffixCurrency: \"Rp \",\n * suffixDecimal: \".-\"\n * });\n * // ➔ \"Rp 1.234,56.-\"\n *\n * // --- Custom separators ---\n * formatCurrency(1234567.89, {\n * decimal: true,\n * separator: \"'\",\n * separatorDecimals: \".\"\n * });\n * // ➔ \"1'234'567.89\"\n *\n * // --- Rounding: ceil ---\n * formatCurrency(1234.561, {\n * decimal: true,\n * roundedDecimal: \"ceil\"\n * });\n * // ➔ \"1.234,57\"\n *\n * // --- Rounding: floor ---\n * formatCurrency(1234.569, {\n * decimal: true,\n * roundedDecimal: \"floor\"\n * });\n * // ➔ \"1.234,56\"\n *\n * // --- Rounding: truncate (false) ---\n * formatCurrency(1234.569, {\n * decimal: true,\n * roundedDecimal: false\n * });\n * // ➔ \"1.234,56\"\n *\n * // --- Force no decimals (decimal: false) ---\n * formatCurrency(1234.567, { decimal: false });\n * // ➔ \"1.235\"\n *\n * // --- Edge case: messy input with dots & commas ---\n * formatCurrency(\"1.121.234,561\", {\n * decimal: true,\n * totalDecimal: 2,\n * roundedDecimal: \"ceil\",\n * suffixCurrency: \"Rp \",\n * negativeFormat: { style: \"brackets\" }\n * });\n * // ➔ \"(Rp 1.121.234,57)\"\n *\n * // --- Edge case: integer string input ---\n * formatCurrency(\"1.121.234\", {\n * decimal: true,\n * suffixCurrency: \"Rp \",\n * roundedDecimal: \"ceil\"\n * });\n * // ➔ \"Rp 1.121.234,00\"\n */\nexport const formatCurrency = (\n value: string | number,\n options: FormatCurrencyOptions = {}\n): string => {\n if (!isString(value) && !isFinite(value)) {\n throw new TypeError(\n `First parameter (\\`value\\`) must be of type \\`string\\` or \\`primitive-number\\`, but received: \\`${getPreciseType(\n value\n )}\\`, with value: \\`${safeStableStringify(value, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const decimal = hasOwnProp(options, \"decimal\") ? options.decimal : false;\n const totalDecimal = hasOwnProp(options, \"totalDecimal\")\n ? options.totalDecimal\n : 2;\n const endDecimal = hasOwnProp(options, \"endDecimal\")\n ? options.endDecimal\n : true;\n const indianFormat = hasOwnProp(options, \"indianFormat\")\n ? options.indianFormat\n : false;\n const suffixCurrency = hasOwnProp(options, \"suffixCurrency\")\n ? options.suffixCurrency\n : \"\";\n const suffixDecimal = hasOwnProp(options, \"suffixDecimal\")\n ? options.suffixDecimal\n : \"\";\n const roundedDecimal = hasOwnProp(options, \"roundedDecimal\")\n ? options.roundedDecimal\n : \"round\";\n const negativeFormat = hasOwnProp(options, \"negativeFormat\")\n ? options.negativeFormat\n : \"dash\";\n let separatorDecimals = hasOwnProp(options, \"separatorDecimals\")\n ? options.separatorDecimals\n : \",\";\n let separator = hasOwnProp(options, \"separator\") ? options.separator : \".\";\n\n // validations\n if (\n !isString(separator) ||\n !isString(separatorDecimals) ||\n !isString(suffixCurrency) ||\n !isString(suffixDecimal)\n ) {\n throw new TypeError(\n `Parameter \\`separator\\`, \\`separatorDecimals\\`, \\`suffixCurrency\\` and \\`suffixDecimal\\` property of the \\`options\\` (second parameter) must be of type \\`string\\`, but received: ['separator': \\`${getPreciseType(\n separator\n )}\\`, 'separatorDecimals': \\`${getPreciseType(\n separatorDecimals\n )}\\`, 'suffixCurrency': \\`${getPreciseType(\n suffixCurrency\n )}\\`, 'suffixDecimal': \\`${getPreciseType(suffixDecimal)}\\`].`\n );\n }\n\n if (\n !isBoolean(decimal) ||\n !isBoolean(endDecimal) ||\n !isBoolean(indianFormat)\n ) {\n throw new TypeError(\n `Parameter \\`decimal\\`, \\`endDecimal\\` and \\`indianFormat\\` property of the \\`options\\` (second parameter) must be of type \\`boolean\\`, but received: ['decimal': \\`${getPreciseType(\n decimal\n )}\\`, 'endDecimal': \\`${getPreciseType(\n endDecimal\n )}\\`, 'indianFormat': \\`${getPreciseType(indianFormat)}\\`].`\n );\n }\n\n if (!isInteger(totalDecimal)) {\n throw new TypeError(\n `Parameter \\`totalDecimal\\` property of the \\`options\\` (second parameter) must be of type \\`integer-number\\`, but received: \\`${getPreciseType(\n totalDecimal\n )}\\`, with value: \\`${safeStableStringify(length, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n if (\n !(\n roundedDecimal === false ||\n roundedDecimal === \"round\" ||\n roundedDecimal === \"ceil\" ||\n roundedDecimal === \"floor\"\n )\n ) {\n throw new TypeError(\n `Parameter \\`roundedDecimal\\` property of the \\`options\\` (second parameter) must be of type \\`false\\` or \\`string\\` must be one of \"round\" | \"ceil\" | \"floor\", but received: \\`${getPreciseType(\n roundedDecimal\n )}\\`, with value: \\`${safeStableStringify(roundedDecimal, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n if (\n !(\n negativeFormat === \"abs\" ||\n negativeFormat === \"brackets\" ||\n negativeFormat === \"dash\" ||\n isPlainObject(negativeFormat)\n )\n ) {\n throw new TypeError(\n `Parameter \\`negativeFormat\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` must be one of \"abs\" | \"brackets\" | \"dash\" or \\`plain-object\\` type, but received: \\`${getPreciseType(\n negativeFormat\n )}\\`, with value: \\`${safeStableStringify(negativeFormat, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n // parse number\n const rawNum = isString(value) ? parseCurrencyString(value) : value;\n if (isNaN(rawNum)) {\n throw new TypeError(\n \"First parameter (`value`) could not be parsed into a valid `number`.\"\n );\n }\n\n let integerPart: string | undefined;\n let decimalPartRaw: string | undefined;\n let num = Math.abs(rawNum);\n const factor = Math.pow(10, totalDecimal);\n\n if (roundedDecimal) {\n const scaled = num * factor;\n switch (roundedDecimal) {\n case \"round\":\n num = Math.round(scaled) / factor;\n break;\n case \"ceil\":\n num = Math.ceil(scaled) / factor;\n break;\n case \"floor\":\n num = Math.floor(scaled) / factor;\n break;\n }\n }\n\n if (roundedDecimal) {\n [integerPart, decimalPartRaw] = num.toFixed(totalDecimal).split(\".\");\n decimalPartRaw = decimalPartRaw ?? \"\".padEnd(totalDecimal, \"0\");\n } else {\n // cut decimal manually\n const split = String(num).split(\".\");\n integerPart = split[0];\n decimalPartRaw = (split[1] || \"\")\n .slice(0, totalDecimal)\n .padEnd(totalDecimal, \"0\");\n }\n\n let formattedInteger: string;\n\n if (indianFormat) {\n separator = \",\";\n separatorDecimals = \".\";\n formattedInteger =\n (suffixCurrency.trim().length ? suffixCurrency : \"\") +\n formatIndianNumber({ numStr: integerPart, separator });\n } else {\n formattedInteger =\n (suffixCurrency.trim().length ? suffixCurrency : \"\") +\n integerPart?.replace(/\\B(?=(\\d{3})+(?!\\d))/g, separator);\n }\n\n if (decimal && !isUndefined(decimalPartRaw) && totalDecimal > 0) {\n let formattedDecimal = separatorDecimals + decimalPartRaw;\n if (endDecimal) formattedDecimal += suffixDecimal;\n formattedInteger += formattedDecimal;\n }\n\n // negative format\n if (rawNum < 0) {\n if (negativeFormat === \"dash\") {\n formattedInteger = \"-\" + formattedInteger;\n } else if (negativeFormat === \"brackets\") {\n formattedInteger = \"(\" + formattedInteger + \")\";\n } else if (negativeFormat === \"abs\") {\n // no sign\n } else if (isPlainObject(negativeFormat)) {\n if (hasOwnProp(negativeFormat, \"custom\")) {\n const formatCustomNegative = negativeFormat.custom;\n\n if (!isFunction(formatCustomNegative)) {\n throw new TypeError(\n `Parameter \\`negativeFormat.custom\\` property of the \\`options\\` (second parameter) must be of type function: \\`(formatted: string) => string\\`, but received: \\`${getPreciseType(\n formatCustomNegative\n )}\\`.`\n );\n }\n\n const result = formatCustomNegative(formattedInteger);\n\n assertIsString(result, {\n message: ({ currentType, validType }) =>\n `Parameter \\`negativeFormat.custom\\` property of the \\`options\\` (second parameter) expected return a \\`${validType}\\` type value, but received: \\`${currentType}\\`.`\n });\n\n formattedInteger = result;\n } else {\n const formatStyleNegative = negativeFormat.style || \"dash\";\n const formatSpaceNegative = !isUndefined(negativeFormat.space)\n ? negativeFormat.space\n : false;\n\n assertIsBoolean(formatSpaceNegative, {\n message: ({ currentType, validType }) =>\n `Parameter \\`negativeFormat.space\\` property of the \\`options\\` (second parameter) must be of type \\`${validType} or undefined\\`, but received: \\`${currentType}\\`.`\n });\n\n if (\n !(\n formatStyleNegative === \"abs\" ||\n formatStyleNegative === \"brackets\" ||\n formatStyleNegative === \"dash\"\n )\n ) {\n throw new TypeError(\n `Parameter \\`negativeFormat.style\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` must be of type \"abs\" | \"brackets\" | \"dash\", but received: \\`${getPreciseType(\n formatStyleNegative\n )}\\`, with value: \\`${safeStableStringify(formatStyleNegative, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n switch (formatStyleNegative) {\n case \"dash\":\n formattedInteger =\n \"-\" + (formatSpaceNegative ? \" \" : \"\") + formattedInteger;\n break;\n case \"brackets\":\n formattedInteger = formatSpaceNegative\n ? `( ${formattedInteger} )`\n : `(${formattedInteger})`;\n break;\n case \"abs\":\n // no sign\n break;\n }\n }\n }\n }\n\n return formattedInteger;\n};\n","import { isFinite } from \"@/predicates/is/isFinite\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `formatNumber`.***\n * ----------------------------------------------------------\n * **Formats a number or numeric string by adding a custom separator\n * every three digits (thousands separator), and intelligently flips\n * the decimal separator according to the chosen separator.**\n * - **Features:**\n * - Converts a number to string before formatting.\n * - Defaults to using `,` as the thousands separator.\n * - If `.` is used as the separator, the decimal will automatically\n * become `,`, and vice versa.\n * - Handles input with existing formatting (e.g. \"1,234,567.89\") and normalizes it.\n * - Supports custom separators, including spaces.\n * - Preserves decimals even if more than 2 digits.\n * @param {string | number} value - The numeric value or string to format, can be plain numbers, or already formatted strings like `\"1,234,567.89\"`.\n * @param {string} [separator=\",\"] - The thousands separator to use, examples: `\",\"` ***(default)***, `\".\"`, `\" \"`, etc.\n * @returns {string} The formatted string with thousands separators and\n * appropriate decimal separator.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not a string or number, or `separator` is not a string.\n * @example\n * formatNumber(1000000);\n * // ➔ \"1,000,000\"\n * formatNumber(\"987654321\");\n * // ➔ \"987,654,321\"\n * formatNumber(1234567.89);\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"1234567,89\");\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"1234567.892\");\n * // ➔ \"1,234,567.892\"\n * formatNumber(\"1234567.89\", \".\");\n * // ➔ \"1.234.567,89\"\n * formatNumber(\"1234567,89\", \",\");\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"987654321\", \" \");\n * // ➔ \"987 654 321\"\n * formatNumber(\"1,234,567.89\");\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"1.234.567,89\", \",\");\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"1.234.567,893\", \".\");\n * // ➔ \"1.234.567,893\"\n * formatNumber(\"1234.56\", \".\");\n * // ➔ \"1.234,56\"\n * formatNumber(\"1234,56\", \",\");\n * // ➔ \"1,234.56\"\n */\nexport const formatNumber = (\n value: string | number,\n separator: string = \",\"\n): string => {\n if (!isString(value) && !isFinite(value)) {\n throw new TypeError(\n `First parameter (\\`value\\`) must be of type \\`string\\` or \\`primitive number\\`, but received: \\`${getPreciseType(\n value\n )}\\`.`\n );\n }\n\n if (!isString(separator)) {\n throw new TypeError(\n `Second parameter (\\`separator\\`) must be of type \\`string\\` or empty as \\`undefined\\`, but received: \\`${getPreciseType(\n separator\n )}\\`.`\n );\n }\n\n separator = isString(separator) ? separator : \",\";\n const decimalSeparator =\n separator === \".\" ? \",\" : separator === \",\" ? \".\" : \".\";\n\n // Convert value to string\n const stringValue = value.toString().trim();\n\n // --- Normalize input ---\n // Find the last decimal separator from the end\n const lastDot = stringValue.lastIndexOf(\".\");\n const lastComma = stringValue.lastIndexOf(\",\");\n\n let actualDecimal = \"\";\n if (lastDot > lastComma) {\n actualDecimal = \".\";\n } else if (lastComma > lastDot) {\n actualDecimal = \",\";\n }\n\n // Split into integer and decimal parts\n let integerPart = stringValue;\n let decimalPart = \"\";\n if (actualDecimal) {\n const parts = stringValue.split(actualDecimal);\n integerPart = parts.slice(0, -1).join(actualDecimal); // merge if more than one\n decimalPart = parts.slice(-1)[0];\n }\n\n // Remove all non-digit characters from the integer part\n integerPart = integerPart.replace(/[^\\d]/g, \"\");\n\n // Format integer part with thousands separator\n const formattedInteger = integerPart.replace(\n /\\B(?=(\\d{3})+(?!\\d))/g,\n separator\n );\n\n // Combine with decimal part if exists\n return decimalPart\n ? `${formattedInteger}${decimalSeparator}${decimalPart}`\n : formattedInteger;\n};\n","import type { OmitStrict, Prettify } from \"@rzl-zone/ts-types-plus\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { formatPhoneNumber } from \"../formatPhoneNumber\";\nimport {\n AsYouType,\n type PhoneNumber,\n type CountryCode\n} from \"libphonenumber-js/max\";\n\n/** @private ***Util constants `country code for special leading zero rule` for {@link formatPhoneNumber}.*** */\nexport const trunkZeroCountries: Record<string, string> = {\n \"7\": \"Russia, Kazakhstan\",\n \"20\": \"Egypt\",\n \"27\": \"South Africa\",\n \"30\": \"Greece\",\n \"31\": \"Netherlands\",\n \"32\": \"Belgium\",\n \"33\": \"France\",\n \"34\": \"Spain\",\n \"36\": \"Hungary\",\n \"39\": \"Italy, San Marino, Vatican\",\n \"41\": \"Switzerland\",\n \"43\": \"Austria\",\n \"44\": \"United Kingdom\",\n \"45\": \"Denmark\",\n \"46\": \"Sweden\",\n \"47\": \"Norway\",\n \"48\": \"Poland\",\n \"49\": \"Germany\",\n \"51\": \"Peru\",\n \"52\": \"Mexico\",\n \"53\": \"Cuba\",\n \"54\": \"Argentina\",\n \"55\": \"Brazil\",\n \"56\": \"Chile\",\n \"57\": \"Colombia\",\n \"58\": \"Venezuela\",\n \"60\": \"Malaysia\",\n \"61\": \"Australia\",\n \"62\": \"Indonesia\",\n \"63\": \"Philippines\",\n \"64\": \"New Zealand\",\n \"65\": \"Singapore\",\n \"66\": \"Thailand\",\n \"81\": \"Japan\",\n \"82\": \"South Korea\",\n \"84\": \"Vietnam\",\n \"86\": \"China\",\n \"90\": \"Turkey\",\n \"91\": \"India\",\n \"92\": \"Pakistan\",\n \"351\": \"Portugal\",\n \"352\": \"Luxembourg\",\n \"355\": \"Albania\",\n \"356\": \"Malta\",\n \"358\": \"Finland\",\n \"359\": \"Bulgaria\",\n \"370\": \"Lithuania\",\n \"371\": \"Latvia\",\n \"372\": \"Estonia\",\n \"373\": \"Moldova\",\n \"374\": \"Armenia\",\n \"375\": \"Belarus\",\n \"376\": \"Andorra\",\n \"377\": \"Monaco\",\n \"378\": \"San Marino\",\n \"379\": \"Vatican\",\n \"971\": \"UAE\"\n};\n/** @private ***Util helper for {@link formatPhoneNumber}.*** */\nexport const isValidPhoneE164 = (value: unknown) => {\n if (!isNonEmptyString(value)) return false;\n return (\n /^(\\+)?[0-9\\s().-]+$/.test(value) && value.replace(/\\D/g, \"\").length <= 15\n );\n};\n\n/** @private ***Util parsing `phone-number` for {@link formatPhoneNumber}.*** */\nexport const parsingAsYouType = (\n value: string,\n defaultCountry?: CountryCode\n) => {\n let parsed;\n try {\n parsed = new AsYouType(defaultCountry);\n parsed.input(value);\n return parsed;\n } catch {\n parsed?.reset();\n return undefined;\n }\n};\n\ntype ValidParseAsYouType = Prettify<\n OmitStrict<AsYouType, \"getNumber\"> & {\n getNumber(): PhoneNumber; // override agar tidak nullable\n }\n>;\n\n/** @private ***Util validation parsing `phone-number` when using `AsYouType` for {@link formatPhoneNumber}.*** */\nexport const isValidParseAsYouType = (\n parsedAsYouType?: AsYouType\n): parsedAsYouType is ValidParseAsYouType => {\n const parsed = !!parsedAsYouType?.isValid() && !!parsedAsYouType.getNumber();\n return parsed;\n};\n","import type {\n FormatPhoneNumberMain,\n FormatPhoneNumberTakeNumberOnly,\n FormatPhoneNumberCheckValidOnly,\n FormatPhoneNumberTransform,\n ValueFormatPhoneNumber,\n FormatPhoneNumberAllPassing,\n FormatPhoneNumberAllPassingValidOnly,\n FormatPhoneNumberAllPassingTakeOnly,\n OutputFormat\n} from \"./_private/formatPhoneNumber.types\";\n\nimport { isSupportedCountry } from \"libphonenumber-js/max\";\n\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isNumber } from \"@/predicates/is/isNumber\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isUndefined } from \"@/predicates/is/isUndefined\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\nimport {\n parsingAsYouType,\n isValidParseAsYouType\n} from \"./_private/formatPhoneNumber.utils\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***`Formatting Number`.***\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`):\n * - Return empty-string (\"\"), if invalid number phone.\n * - Return boolean when **validity-check mode** (`checkValidOnly`):\n * - ***Return `true` if:***\n * - A phone number is \"valid\" when it has valid length, and the actual phone number digits match the\n * regular expressions for its country (parameter options `defaultCountry`).\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * ***Phone number to format, accepts:***\n * - `string` (recommended to preserve leading zeros).\n * - `number` (leading zeros will be lost).\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberMain} [options]\n * ***Main options object controlling:***\n * - `separator` (**string**): Group separator, default `\" \"`.\n * - `plusNumberCountry` (**string**): Country code with optional leading `+`.\n * - `openingNumberCountry` (**string**): Characters before the country code, e.g. `\"(\"`.\n * - `closingNumberCountry` (**string**): Characters after the country code, e.g. `\")\"`.\n * - `checkValidOnly` (**boolean**): Return only validity.\n * - `takeNumberOnly` (**boolean**): Return digits only.\n * - `defaultCountry` (**string** - **`<ISO-3166-1 alpha-2>`**): Used to interpret numbers without an explicit `+<countryCode>`.\n * @returns {string|boolean} Formatted phone number string, digits-only string, or boolean.\n * @overload\n * @param {ValueFormatPhoneNumber} value The phone number input (string or number).\n * @param {FormatPhoneNumberCheckValidOnly} [options] With `checkValidOnly: true`.\n * Return a **validity-check mode** when `checkValidOnly: true`.\n * @returns {boolean} A boolean indicating whether the input is a valid phone number.\n * @overload\n * @param {ValueFormatPhoneNumber} value The phone number input (string or number).\n * @param {FormatPhoneNumberTransform} [options] With `takeNumberOnly: true`.\n * Return **digits-only mode** when `takeNumberOnly: true`.\n * @returns {string} A string of digits only.\n * @overload\n * @param {ValueFormatPhoneNumber} value The phone number input (string or number).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * Return a **formatted phone number string** with custom formatting and (`checkValidOnly: false`, `takeNumberOnly: false`).\n * @returns {string} Formatting number. return a string of digits only with formatter.\n * @example\n * 1. ***Formatting Phone Number String:***\n * ```ts\n * formatPhoneNumber(\"081234567890\");\n * // ➔ \"0812 3456 7890\"\n * formatPhoneNumber(\"081234567890\", {\n * separator: \"-\",\n * plusNumberCountry: \"+44\",\n * openingNumberCountry: \"(\",\n * closingNumberCountry: \")\"\n * });\n * // ➔ \"(+44) 8123-4567-890\"\n * ```\n * 2. ***Digits-Only Mode:***\n * ```ts\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * takeNumberOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ \"081234567890\"\n * formatPhoneNumber(\"(0812) 3456-7890\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"(63) 917 123 4567\", {\n * takeNumberOnly: true,\n * defaultCountry: \"PH\"\n * });\n * // ➔ \"0917 123 4567\"\n * formatPhoneNumber(\"(63) 4567-8901\", {\n * takeNumberOnly: true,\n * defaultCountry: \"PH\"\n * });\n * // ➔ \"\" // is not valid number from PH.\n * formatPhoneNumber(\"(63) 917 123 4567\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", {\n * takeNumberOnly: true,\n * defaultCountry: \"DE\"\n * });\n * // ➔ \"015123456789\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", { takeNumberOnly: true });\n * // ➔ \"\"\n * ```\n * 3. ***Validity-Check Mode:***\n * ```ts\n * formatPhoneNumber(\"+6281234567890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"0812-3456-7890\", {\n * checkValidOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812 3456 7890\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * checkValidOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ true\n * formatPhoneNumber(\"(0812) 3456-7890\", { checkValidOnly: true});\n * // ➔ false\n * formatPhoneNumber(\"+44 20 7946 0958\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+1 (800) 123-4567\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62.812.3456.7890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62(812)3456-7890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62abc123\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"invalid@@@\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"0812-3456-hello\", { checkValidOnly: true });\n * // ➔ false\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberTransform\n): string;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***`Digits-only Mode`.***\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros)\n * - `number` (leading zeros will be lost)\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {string} Digits-only mode, return string a digits-only.\n * @example\n * ```ts\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * takeNumberOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ \"081234567890\"\n * formatPhoneNumber(\"(0812) 3456-7890\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"(63) 917 123 4567\", {\n * takeNumberOnly: true,\n * defaultCountry: \"PH\"\n * });\n * // ➔ \"0917 123 4567\"\n * formatPhoneNumber(\"(63) 4567-8901\", {\n * takeNumberOnly: true,\n * defaultCountry: \"PH\"\n * });\n * // ➔ \"\" // is not valid number from PH.\n * formatPhoneNumber(\"(63) 917 123 4567\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", {\n * takeNumberOnly: true,\n * defaultCountry: \"DE\"\n * });\n * // ➔ \"015123456789\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", { takeNumberOnly: true });\n * // ➔ \"\"\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberTakeNumberOnly\n): string;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***`Validity-check Mode`.***\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros).\n * - `number` (leading zeros will be lost).\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {boolean} Validity-check mode, return a boolean.\n * @example\n * ```ts\n * formatPhoneNumber(\"+6281234567890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"0812-3456-7890\", {\n * checkValidOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812 3456 7890\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * checkValidOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ true\n * formatPhoneNumber(\"(0812) 3456-7890\", { checkValidOnly: true});\n * // ➔ false\n * formatPhoneNumber(\"+44 20 7946 0958\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+1 (800) 123-4567\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62.812.3456.7890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62(812)3456-7890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62abc123\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"invalid@@@\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"0812-3456-hello\", { checkValidOnly: true });\n * // ➔ false\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberCheckValidOnly\n): boolean;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***Forced to `Validity-check Mode`***, because `checkValidOnly` has set to `true`.\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros).\n * - `number` (leading zeros will be lost).\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {boolean} Validity-check mode, return a boolean.\n * @example\n * ```ts\n * formatPhoneNumber(\"+6281234567890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812-3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812 3456 7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ false\n * formatPhoneNumber(\"+44 20 7946 0958\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ true\n * formatPhoneNumber(\"+1 (800) 123-4567\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62.812.3456.7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62(812)3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62abc123\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ false\n * formatPhoneNumber(\"invalid@@@\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ false\n * formatPhoneNumber(\"0812-3456-hello\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ false\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberAllPassingValidOnly\n): boolean;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***Forced to `Digits-only Mode`***, because `takeNumberOnly` has set to `true`.\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros)\n * - `number` (leading zeros will be lost)\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {string} Digits-only mode, return string a digits-only.\n * @example\n * ```ts\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"081234567890\"\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"\"\n * formatPhoneNumber(\"(63) 917 123 4567\", {\n * defaultCountry: \"PH\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"0917 123 4567\"\n * formatPhoneNumber(\"(63) 4567-8901\", {\n * defaultCountry: \"PH\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"\" // is not valid number from PH.\n * formatPhoneNumber(\"(63) 917 123 4567\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", {\n * defaultCountry: \"DE\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"015123456789\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"\"\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberAllPassingTakeOnly\n): string;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***Forced to `Validity-check Mode`***, because `checkValidOnly` and `takeNumberOnly` has set to `true`,\n * but `checkValidOnly` will prioritize one.\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros).\n * - `number` (leading zeros will be lost).\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {boolean} Validity-check mode, return a boolean.\n * @example\n * ```ts\n * formatPhoneNumber(\"+6281234567890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812-3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812 3456 7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"+44 20 7946 0958\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"+1 (800) 123-4567\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62.812.3456.7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62(812)3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62abc123\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"invalid@@@\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"0812-3456-hello\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberAllPassing\n): boolean;\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options: FormatPhoneNumberMain = {}\n): string | boolean {\n if (isNil(value)) return \"\";\n\n if (!isString(value) && !isNumber(value)) {\n throw new TypeError(\n `First parameter (\\`value\\`) must be of type \\`string\\`, \\`number\\`, \\`null\\` or \\`undefined\\`, but received: \\`${getPreciseType(\n value\n )}\\`.`\n );\n }\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const takeNumberOnly = hasOwnProp(options, \"takeNumberOnly\")\n ? options.takeNumberOnly\n : false;\n const checkValidOnly = hasOwnProp(options, \"checkValidOnly\")\n ? options.checkValidOnly\n : false;\n const defaultCountry: typeof options.defaultCountry = hasOwnProp(\n options,\n \"defaultCountry\"\n )\n ? options.defaultCountry\n : undefined;\n\n const separator = hasOwnProp(options, \"separator\") ? options.separator : \" \";\n const prependPlusCountryCode = hasOwnProp(options, \"prependPlusCountryCode\")\n ? options.prependPlusCountryCode\n : true;\n const outputFormat: OutputFormat = hasOwnProp(options, \"outputFormat\")\n ? options.outputFormat\n : \"INTERNATIONAL\";\n const openingNumberCountry = hasOwnProp(options, \"openingNumberCountry\")\n ? options.openingNumberCountry\n : \"\";\n const closingNumberCountry = hasOwnProp(options, \"closingNumberCountry\")\n ? options.closingNumberCountry\n : \"\";\n\n if (\n !isBoolean(takeNumberOnly) ||\n !isBoolean(checkValidOnly) ||\n !isBoolean(prependPlusCountryCode)\n ) {\n throw new TypeError(\n `Parameter \\`takeNumberOnly\\`, \\`checkValidOnly\\` and \\`prependPlusCountryCode\\` property of the \\`options\\` (second parameter) must be of type \\`boolean\\` or unset as \\`undefined\\` value, but received: ['takeNumberOnly': \\`${getPreciseType(\n takeNumberOnly\n )}\\`, 'checkValidOnly': \\`${getPreciseType(\n checkValidOnly\n )}\\`, 'prependPlusCountryCode': \\`${getPreciseType(prependPlusCountryCode)}\\`].`\n );\n }\n\n if (!isUndefined(defaultCountry) && !isSupportedCountry(defaultCountry)) {\n throw new TypeError(\n `Parameter \\`defaultCountry\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` as \\`CountryCode\\` (ISO-3166-1 alpha-2) or unset as \\`undefined\\` value, but received: \\`${getPreciseType(\n defaultCountry\n )}\\`, with value: \\`${safeStableStringify(defaultCountry, {\n keepUndefined: true\n })}\\`.\\n\\nSee: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements, for all ISO 3166-1 alpha-2 code.`\n );\n }\n\n if (\n ![\"INTERNATIONAL\", \"NATIONAL\", \"RFC3966\", \"E.164\"].includes(outputFormat)\n ) {\n throw new TypeError(\n `Parameter \\`outputFormat\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` as \\`OutputFormat\\` (\"NATIONAL\" | \"INTERNATIONAL\" | \"E.164\" | \"RFC3966\") or unset as \\`undefined\\` (default value to: \\`INTERNATIONAL\\`) value, but received: \\`${getPreciseType(\n outputFormat\n )}\\`, with value: ${safeStableStringify(outputFormat, { keepUndefined: true })}.`\n );\n }\n\n if (\n !isString(separator) ||\n !isString(openingNumberCountry) ||\n !isString(closingNumberCountry)\n ) {\n throw new TypeError(\n `Parameter \\`separator\\`, \\`plusNumberCountry\\`, \\`openingNumberCountry\\` and \\`closingNumberCountry\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` or unset as \\`undefined\\` value, but received: ['separator': \\`${getPreciseType(\n separator\n )}\\`,'openingNumberCountry': \\`${getPreciseType(\n openingNumberCountry\n )}\\`, 'closingNumberCountry': \\`${getPreciseType(closingNumberCountry)}\\`].`\n );\n }\n\n if (!isString(value)) value = String(value);\n\n const parsedPhoneNumber = parsingAsYouType(value, defaultCountry);\n const validPhoneNumber = isValidParseAsYouType(parsedPhoneNumber);\n\n if (checkValidOnly) return validPhoneNumber;\n\n // todo: return empty-string is invalid phone-number input.\n if (!validPhoneNumber) return \"\";\n\n if (takeNumberOnly) {\n return parsedPhoneNumber.getNumber().formatNational().replace(/\\D/g, \"\");\n }\n\n const num = parsedPhoneNumber.getNumber();\n // Result example: \"+49 1512 3456789\"\n const intlNumb = num.format(outputFormat);\n\n if (outputFormat === \"INTERNATIONAL\") {\n // Split to: [\"+49\", \"1512\", \"3456789\"]\n const [cc, ...rest] = intlNumb.split(\" \");\n const countryCode = prependPlusCountryCode ? cc : cc.replace(/^\\++/, \"\");\n const restWithSeparator = rest.join(separator);\n\n if (\n isNonEmptyString(openingNumberCountry) &&\n isNonEmptyString(closingNumberCountry)\n ) {\n return `${openingNumberCountry}${countryCode}${closingNumberCountry} ${restWithSeparator}`;\n }\n\n return `${countryCode} ${restWithSeparator}`;\n }\n\n if (outputFormat === \"NATIONAL\") {\n const restWithSeparator = intlNumb.split(\" \").join(separator);\n\n return `${restWithSeparator}`;\n }\n\n return intlNumb;\n}\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { censorEmail } from \"../censorEmail\";\nimport { isUndefined } from \"@/predicates/is/isUndefined\";\n\n/** @private ***Util helper for {@link censorEmail}.*** */\nexport const hashSeedGenerate = (mode: \"random\" | \"fixed\", email: string) => {\n const generateSeed = () => {\n let hash = 0;\n for (let i = 0; i < email.length; i++) {\n hash = (hash << 5) - hash + email.charCodeAt(i);\n hash |= 0; // Convert to 32bit int\n }\n return Math.abs(hash);\n };\n\n return mode === \"fixed\" ? generateSeed() : undefined;\n};\n\n/** ----------------------------------------------------------\n * * ***Internal Randomly replaces characters in a string with \"\\*\".***\n * ----------------------------------------------------------\n *\n * @param {string} str - The string to censor.\n * @param {number} minCensor - Minimum number of characters to censor.\n * @param {number} maxPercentage - Maximum percentage of characters to censor.\n * @returns {string} - Censored string.\n *\n * @private ***Util helper for {@link censorEmail}.***\n */\nexport const _censor = (\n str: string,\n minCensor: number,\n maxPercentage: number,\n hashSeed: number | undefined\n): string => {\n if (str.length <= minCensor) return \"*\".repeat(str.length);\n\n const strArr = str.split(\"\");\n const totalCensor = Math.max(\n minCensor,\n Math.ceil(str.length * maxPercentage)\n );\n const indexes = new Set<number>();\n\n let i = 0;\n while (indexes.size < totalCensor) {\n const idx = !isUndefined(hashSeed)\n ? (hashSeed + str.length + i * 31) % str.length\n : Math.floor(Math.random() * str.length);\n indexes.add(idx);\n i++;\n }\n\n for (const index of indexes) {\n strArr[index] = \"*\";\n }\n\n return strArr.join(\"\");\n};\n","import { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\nimport { _censor, hashSeedGenerate } from \"./_private/censorEmail.utils\";\n\ntype CensorEmailOptions = {\n /** ----------------------------------------------------------\n * * ***Censorship Mode.***\n * ----------------------------------------------------------\n * - **Valid value:**\n * - `\"fixed\"` (default) – Deterministic censorship based on a hash of the email, same input always produces the same output.\n * - `\"random\"` – Each character is randomly replaced every time the function is called.\n */\n mode?: \"random\" | \"fixed\";\n};\n\n/** ----------------------------------------------------------\n * * ***Utility: `censorEmail`.***\n * ----------------------------------------------------------\n * **Censors an email by replacing characters with `\"*\"` while supporting random or fixed mode.**\n * - **This function replaces parts of an email with asterisks to protect privacy.**\n * - **Modes:**\n * - `\"fixed\"` (default) – Deterministic censorship based on a hash of the email, same input always produces the same output.\n * - `\"random\"` – Each character is randomly replaced every time the function is called.\n * - **ℹ️ Note:**\n * - Invalid emails or non-string input will return an empty-string (`\"\"`).\n * @param {string | null | undefined} email - The email address to censor.\n * @param {CensorEmailOptions} [options={}] - Options object for mode.\n * @returns {string} The censored email, or an empty string if input is invalid.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not a plain object or `mode` is invalid.\n * @example\n * // Fixed mode (default, deterministic)\n * censorEmail(\"john.doe@gmail.com\");\n * // ➔ \"j**n.**e@g***l.com\"\n *\n * // Fixed mode explicitly\n * censorEmail(\"john.doe@gmail.com\", { mode: \"fixed\" });\n * // ➔ \"j**n.**e@g***l.com\"\n *\n * // Random mode (output may vary each time)\n * censorEmail(\"john.doe@gmail.com\", { mode: \"random\" });\n * // ➔ \"j*hn.***e@g***l.com\" (random)\n *\n * // Invalid email returns empty string\n * censorEmail(\"invalid-email\");\n * // ➔ \"\"\n */\nexport const censorEmail = (\n email: string | null | undefined,\n options: CensorEmailOptions = {}\n): string => {\n if (!isNonEmptyString(email)) return \"\";\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const mode = hasOwnProp(options, \"mode\") ? options.mode : \"fixed\";\n\n // Ensure mode is either \"random\" or \"fixed\"\n if (mode !== \"random\" && mode !== \"fixed\") {\n throw new TypeError(\n `Parameter \\`mode\\` property of the \\`options\\` (second parameter) must be one of \"fixed\" or \"random\", but received: \\`${getPreciseType(\n mode\n )}\\`, with value: \\`${safeStableStringify(mode, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n // Strict email validation regex\n const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n if (!emailRegex.test(email)) return \"\";\n\n const [local, domain] = email.split(\"@\");\n const domainParts = domain.split(\".\"); // Handle multi-level domain (e.g., example.co.uk)\n if (domainParts.length < 2) return \"\"; // Invalid domain structure\n\n const [domainName, ...tldParts] = domainParts;\n const tld = tldParts.join(\".\");\n\n const hashSeed = hashSeedGenerate(mode, email);\n\n const localMinCensor = local.length < 4 ? 1 : 2;\n const domainMinCensor = domainName.length < 4 ? 1 : 2;\n\n const censoredLocal = _censor(local, localMinCensor, 0.6, hashSeed);\n const censoredDomain = _censor(domainName, domainMinCensor, 0.5, hashSeed);\n const censoredTLD = tld.length <= 2 ? tld : _censor(tld, 1, 0.4, hashSeed);\n\n return `${censoredLocal}@${censoredDomain}.${censoredTLD}`;\n};\n","import { isNil } from \"@/predicates/is/isNil\";\nimport { isInteger } from \"@/predicates/is/isInteger\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\n\nimport { assertIsString } from \"@/assertions/strings/assertIsString\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\nimport { normalizeSpaces } from \"@/strings/sanitizations/normalizeSpaces\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\ntype ChunkStringOptions = {\n /** ***The separator string to insert between characters or words.***\n *\n * - Used when inserting separators every `limiter` characters.\n * - Default is a single space `\" \"`.\n *\n * @default \" \"\n */\n separator?: string;\n\n /** ***Determines whether counting for `limiter` resets after each space.***\n *\n * - If `true`, the string is treated as words separated by spaces,\n * and separators are applied within words, then words are grouped.\n * - If `false` ***(default)***, counting is continuous across the whole string,\n * treating spaces as normal characters.\n *\n * @default false\n */\n reCountAfterSpace?: boolean;\n};\n\n/** ----------------------------------------------\n * * ***Utility: `chunkString`.***\n * ----------------------------------------------\n * **Chunks a string by inserting a separator every `limiter` characters.**\n * - **This function handles two main behaviors based on `reCountAfterSpace`:**\n * 1. ***If `reCountAfterSpace` is `false` (default):***\n * - The separator is inserted strictly every `limiter` characters throughout the entire string, regardless of spaces, spaces are treated as regular characters in the count.\n * - Example: `chunkString(\"1234567890\", 3, \"-\")` ➔ `\"123-456-789-0\"`.\n * - Example: `chunkString(\"Hello World\", 3, \"-\")` ➔ `\"Hel-lo -Wor-ld\"`.\n * 2. ***If `reCountAfterSpace` is `true`:***\n * - The function first processes the input string to replace any multiple consecutive spaces with a\n * single space (e.g., \"A B\" becomes \"A B\").\n * Then, it treats the string as a sequence of \"words\" (segments separated by single spaces).\n * - Each word is processed independently:\n * - if a word's length exceeds the `limiter`, separators are inserted internally within that word.\n * - Words are then grouped. Each group will contain `limiter` number of words.\n * - Words within the same group are joined by the specified `separator`.\n * - Finally, these groups are joined by a single space, preserving the original word separation\n * structure between groups.\n * @param {string} subject - ***The target string to chunk.****\n * @param {number} limiter\n * ***The interval (number of characters) for inserting separators, behavior:***\n * - If `reCountAfterSpace = false`, it counts characters.\n * - If `reCountAfterSpace = true`, it counts both characters within words and words per group.\n * @param {ChunkStringOptions} [options={}] - ***Optional settings for separator and counting behavior.***\n * @returns {string} Return the formatted string with separators.\n * @example\n * // Basic usage\n * chunkString(\"1234567890\", 3);\n * // ➔ \"123 456 789 0\"\n *\n * // Basic usage `reCountAfterSpace = false` (default)\n * chunkString(\"1234567890\", 3, { separator: \"-\");\n * // ➔ \"123-456-789-0\"\n * chunkString(\"HelloWorld\", 2, { separator: \"_\", reCountAfterSpace: false });\n * // ➔ \"He_ll_oW_or_ld\"\n *\n * // Usage with reCountAfterSpace = true:\n * // Multiple spaces are normalized to single spaces before processing.\n * chunkString(\"AB CD EF GH\", 2, { separator: \"-\", reCountAfterSpace: true });\n * // ➔ \"AB-CD EF-GH\" (after normalization to \"AB CD EF GH\")\n * // Words \"AB\" and \"CD\" form a group and are joined by \"-\", \"EF\" and \"GH\" form another group.\n * // The groups \"AB-CD\" and \"EF-GH\" are then joined by a space.\n *\n * // Another usage with reCountAfterSpace = true:\n * chunkString(\"ABC DEF GHI JKL\", 3, { separator: \"-\", reCountAfterSpace: true });\n * // ➔ \"ABC-DEF-GHI JKL\"\n * // Words \"ABC\", \"DEF\", \"GHI\" form a group and are joined by \"-\".\n * // The word \"JKL\" forms its own group (as it's the last word and completes no other group).\n * // The groups \"ABC-DEF-GHI\" and \"JKL\" are then joined by a space.\n */\nexport function chunkString(\n subject: string,\n limiter: number,\n options: ChunkStringOptions = {}\n): string {\n if (isNil(subject) || limiter <= 0) return subject;\n\n assertIsString(subject, {\n message: ({ currentType, validType }) =>\n `First parameter (\\`subject\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n if (!isInteger(limiter)) {\n throw new TypeError(\n `Second parameter (\\`limiter\\`) must be of type \\`integer-number\\`, but received: \\`${getPreciseType(\n limiter\n )}\\`, with value: \\`${safeStableStringify(limiter, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Third parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const separator = hasOwnProp(options, \"separator\") ? options.separator : \" \";\n const reCountAfterSpace = hasOwnProp(options, \"reCountAfterSpace\")\n ? options.reCountAfterSpace\n : false;\n\n assertIsString(separator, {\n message: ({ currentType, validType }) =>\n `Parameter \\`separator\\` property of the \\`options\\` (third parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n assertIsBoolean(reCountAfterSpace, {\n message: ({ currentType, validType }) =>\n `Parameter \\`reCountAfterSpace\\` property of the \\`options\\` (third parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n subject = normalizeSpaces(subject);\n\n // Handle reCountAfterSpace = false (assumed correct from previous iterations)\n if (!reCountAfterSpace) {\n let result = \"\";\n let currentCount = 0;\n\n for (let i = 0; i < subject.length; i++) {\n const char = subject[i];\n if (currentCount === limiter) {\n result += separator;\n currentCount = 0;\n }\n result += char;\n currentCount++;\n }\n return result;\n }\n\n // --- Dynamic Logic for reCountAfterSpace = true ---\n const words = subject.split(\" \"); // Split the string into individual words by spaces\n const finalSegments: string[] = [];\n\n let currentGroup: string[] = [];\n let wordsInCurrentGroupCount = 0; // This counts how many words are in the current group\n\n for (let i = 0; i < words.length; i++) {\n const word = words[i];\n\n // Check if the current word itself needs internal separators (e.g., \"HelloWorld\" with limiter 2)\n // For the given test cases (\"AB\", \"CD\", \"ABC\"), this inner loop doesn't add separators,\n // as the words themselves are shorter than or equal to the limiter.\n let processedWord = \"\";\n let charCountInWord = 0;\n for (let j = 0; j < word.length; j++) {\n processedWord += word[j];\n charCountInWord++;\n if (charCountInWord === limiter && j < word.length - 1) {\n processedWord += separator;\n charCountInWord = 0;\n }\n }\n\n currentGroup.push(processedWord);\n wordsInCurrentGroupCount++;\n\n // If the current group has reached the limiter (e.g., 2 words for limiter=2, or 3 words for limiter=3)\n // OR if it's the last word in the entire subject, finalize the group.\n if (wordsInCurrentGroupCount === limiter || i === words.length - 1) {\n finalSegments.push(currentGroup.join(separator)); // Join words within the group by separator\n currentGroup = []; // Reset group for the next set of words\n wordsInCurrentGroupCount = 0; // Reset group word count\n }\n }\n\n // Finally, join the main segments (groups) with spaces\n return finalSegments.join(\" \");\n}\n","import { isInteger } from \"@/predicates/is/isInteger\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isEmptyString } from \"@/predicates/is/isEmptyString\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\nimport { assertIsString } from \"@/assertions/strings/assertIsString\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\ntype TruncateStringOptions = {\n /** ***Maximum length of the truncated string **(default: `10`)**.***\n *\n * @default 10\n */\n length?: number;\n\n /** ***String to append if truncation occurs.***\n *\n * - Will be trimmed first; defaults to `\"...\"` if empty.\n *\n * @default \"...\"\n */\n ending?: string;\n\n /** ***Whether to trim the input string before truncation ***(default: `true`)***.***\n *\n * @default true\n */\n trim?: boolean;\n};\n\n/** ----------------------------------------------------------\n * * ***Utility: `truncateString`.***\n * ----------------------------------------------------------\n * **Features:**\n * - Truncates a string to a specified length and optionally appends an ending.\n * - Supports trimming the input before truncation.\n * - If truncation occurs, trailing spaces before the ending are removed.\n * - The `ending` parameter is always trimmed first; if empty, it defaults to `\"...\"`.\n * @param {string|null|undefined} text\n * ***The input string to truncate, behavior:***\n * - If `null`, `undefined`, or empty after trim, returns `\"\"`.\n * @param {TruncateStringOptions} [options]\n * ***Optional settings:***\n * - `length` (number, default 10): Maximum length of the truncated string.\n * - `ending` (string, default `\"...\"`): String to append if truncation occurs.\n * - `trim` (boolean, default `true`): Whether to trim the input before truncation.\n * @returns {string} The truncated string with optional trimming and ending, returns `\"\"` if input is empty or length < 1.\n * @throws **{@link TypeError | `TypeError`}** if `options.length` is not a finite number, or if `options.ending` is not a string, or if `options.trim` is not a boolean.\n * @example\n * truncateString(\"hello world\", { length: 5 });\n * // ➔ \"hello...\"\n * truncateString(\"hello world\", { length: 5, ending: \"---\" });\n * // ➔ \"hello---\"\n * truncateString(\"hello world\", { length: 5, ending: \" \" });\n * // ➔ \"hello...\" (ending trimmed to default)\n * truncateString(\"hello world\", { length: 5, ending: \" !!! \" });\n * // ➔ \"hello!!!\" (ending trimmed)\n * truncateString(\" long data string \", { length: 8, ending: \"...\", trim: true });\n * // ➔ \"long dat...\"\n * truncateString(\" long data string \", { length: 8, ending: \"...\", trim: false });\n * // ➔ \" long ...\"\n * truncateString(null, { length: 5 });\n * // ➔ \"\"\n */\nexport const truncateString = (\n text: string | null | undefined,\n options: TruncateStringOptions = {}\n): string => {\n if (!isNonEmptyString(text)) return \"\";\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Seconds parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const trim = hasOwnProp(options, \"trim\") ? options.trim : true;\n const length = hasOwnProp(options, \"length\") ? options.length : 10;\n let ending = hasOwnProp(options, \"ending\") ? options.ending : \"...\";\n\n if (!isInteger(length)) {\n throw new TypeError(\n `Parameter \\`length\\` property of the \\`options\\` (second parameter) must be of type \\`integer-number\\`, but received: \\`${getPreciseType(\n length\n )}\\`, with value: \\`${safeStableStringify(length, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n if (length < 1) return \"\";\n\n assertIsString(ending, {\n message: ({ currentType, validType }) =>\n `Parameter \\`ending\\` property of the \\`options\\` (second parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n assertIsBoolean(trim, {\n message: ({ currentType, validType }) =>\n `Parameter \\`trim\\` property of the \\`options\\` (second parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n if (isEmptyString(ending)) {\n ending = \"...\";\n } else {\n ending = ending.trim();\n }\n\n const original = trim ? text.trim() : text;\n const originalTrimmedLength = original.length;\n\n if (originalTrimmedLength <= length) return original;\n\n const sliced = original.slice(0, length);\n const cleanSliced = trim ? sliced : sliced.trimEnd();\n\n return cleanSliced + ending;\n};\n","import type { FormatDateFnsOptions } from \"./_private/formatDateFns.types\";\n\nimport { id, enUS } from \"date-fns/locale\";\nimport { format as formatDns, parse } from \"date-fns\";\n\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `formatDateFns`.***\n * ----------------------------------------------------------\n * **Formats a date into a human-readable string using `date-fns`.**\n * - **Features:**\n * - Supports custom output formats using `date-fns/format`.\n * - Can parse localized non-ISO strings via `inputFormat` & `inputLocale`.\n * - Supports `locale` as `\"id\"`, `\"en\"` or `date-fns` `Locale` objects (like `id` or `enUS`).\n * - Returns `null` if the date is invalid, not provided, or parsing fails.\n * @param {string | Date | null | undefined} date\n * ***The date input to format, can be:***\n * - A `Date` object.\n * - An ISO string (e.g. `\"2024-01-01T12:00:00Z\"`).\n * - A localized string (requires `inputFormat` + `inputLocale`).\n * @param {FormatDateFnsOptions} [options] ***Options for formatting and parsing.***\n * @param {FormatDateFnsOptions[\"format\"]} [options.format=\"dd MMM yyyy - HH:mm:ss\"]\n * ***The output format string (passed to `date-fns/format`), e.g:***\n * - `\"dd MMMM yyyy, HH:mm:ss\" ➔ \"14 Juli 2025, 17:25:42\"`.\n * @param {FormatDateFnsOptions[\"locale\"]} [options.locale=\"id\"]\n * The output locale. If string, only `\"id\"` (Indonesian) or `\"en\"` (English)\n * is recognized. Or you can pass a `date-fns` `Locale` object.\n * - Example:\n * ```ts\n * import { ar } from \"date-fns/locale\";\n * formatDateFns(new Date(), { locale: ar, format: \"PPPppp\" });\n * ```\n * @param {FormatDateFnsOptions[\"inputLocale\"]} [options.inputLocale]\n * Required if `date` is a localized non-ISO string. Used with `inputFormat`.\n * - Example for Indonesian string:\n * ```ts\n * formatDateFns(\"14 Juli 2025 10:25:42\", { inputFormat: \"dd MMMM yyyy HH:mm:ss\", inputLocale: \"id\" });\n * ```\n * @param {FormatDateFnsOptions[\"inputFormat\"]} [options.inputFormat]\n * The format string to parse `date` if it is a non-ISO string.\n * Required together with `inputLocale`.\n * @returns {string | null} A formatted date string or `null` if input is invalid.\n * @example\n * formatDateFns(new Date());\n * // ➔ \"14 Jul 2025 - 17:25:42\"\n * formatDateFns(\"2025-07-14T10:25:42Z\", { format: \"dd/MM/yyyy\", locale: \"en\" });\n * // ➔ \"14/07/2025\"\n * formatDateFns(\"14 Juli 2025 10:25:42\", {\n * inputFormat: \"dd MMMM yyyy HH:mm:ss\",\n * inputLocale: \"id\",\n * format: \"yyyy-MM-dd\"\n * });\n * // ➔ \"2025-07-14\"\n * formatDateFns(null);\n * // ➔ null\n */\nexport const formatDateFns = (\n date: string | Date | null | undefined,\n options: FormatDateFnsOptions = {}\n): string | null => {\n if (isNil(date) || !(isDate(date) || isNonEmptyString(date))) return null;\n\n // Ensure options is an object and Defensive options check\n if (!isPlainObject(options)) {\n options = {};\n }\n\n const {\n inputFormat,\n locale = \"en\",\n inputLocale = \"en\",\n ...restOptions\n } = options;\n\n const format =\n hasOwnProp(options, \"format\") && isNonEmptyString(options.format)\n ? options.format\n : \"dd MMM yyyy - HH:mm:ss\";\n\n let parsedDate: Date;\n\n try {\n if (isNonEmptyString(date) && inputFormat && inputLocale) {\n const valueOfInputLocale = isNonEmptyString(inputLocale)\n ? inputLocale === \"id\"\n ? id\n : enUS\n : inputLocale;\n\n parsedDate = parse(date, inputFormat, new Date(), {\n locale: valueOfInputLocale\n });\n } else {\n parsedDate = new Date(date);\n }\n\n if (isNaN(parsedDate.getTime())) return null;\n\n const valueOfLocale = isNonEmptyString(locale)\n ? locale === \"id\"\n ? id\n : enUS\n : locale;\n\n return formatDns(parsedDate, format, {\n ...restOptions,\n locale: valueOfLocale\n });\n } catch {\n return null;\n }\n};\n","import type { FormatDateIntlOptions } from \"./_private/formatDateIntl.types\";\n\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `formatDateIntl`.***\n * ----------------------------------------------------------\n * **Formats a date using the `Intl.DateTimeFormat` API.**\n * - **Features:**\n * - Supports custom locales (type-safe `SupportedLocales`).\n * - Accepts additional `Intl.DateTimeFormatOptions` like `timeZone`, `hour12`, etc.\n * - Defaults to `\"en-US\"` if `locale` is not provided or is an empty string.\n * - Returns `null` if the date is invalid, not provided, or options are invalid.\n * @param {string | Date | null | undefined} date\n * ***The date to format.***\n * - Can be a `Date` object or an ISO string.\n * - If invalid or not provided, returns `null`.\n * @param {FormatDateIntlOptions} [options] ***Optional formatting options for `Intl.DateTimeFormat`, use `locale` to specify the language & region format.***\n * @returns {string | null}\n * - Formatted date string.\n * - Returns `null` if date is invalid or options are of wrong type.\n * @example\n * formatDateIntl(new Date());\n * // ➔ \"7/14/2025\"\n * formatDateIntl(\"2025-07-14T00:00:00Z\", { locale: \"fr-FR\", dateStyle: \"long\" });\n * // ➔ \"14 juillet 2025\"\n * formatDateIntl(null);\n * // ➔ null\n * formatDateIntl(new Date(), { timeZone: \"UTC\", hour: \"2-digit\", minute: \"2-digit\" });\n * // ➔ \"01:30 AM\"\n */\nexport const formatDateIntl = (\n date: string | Date | null | undefined,\n options?: FormatDateIntlOptions\n): string | null => {\n if (isNil(date) || !(isDate(date) || isNonEmptyString(date))) return null;\n\n const parsedDate = new Date(date);\n if (isNaN(parsedDate.getTime())) return null; // Handle invalid dates\n\n // Ensure options is an object and Defensive options check\n if (!isPlainObject(options)) {\n options = {};\n }\n\n const { locale = \"en-US\", ...restProps } = options;\n\n try {\n return new Intl.DateTimeFormat(\n isNonEmptyString(locale) ? locale.trim() : \"en-US\",\n restProps\n ).format(parsedDate);\n } catch {\n return null;\n }\n};\n","import { isNaN } from \"@/predicates/is/isNaN\";\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `formatDateTime`.***\n * ----------------------------------------------------------\n * **Formats a date and time into a custom string format.**\n * - **Features:**\n * - Supports only `YYYY`, `MM`, `DD`, `hh`, `mm`, and `ss` as placeholders.\n * - Uses a simple string replace (no locale).\n * - Returns `null` if the date is invalid or not provided.\n * - Defaults to `\"YYYY-MM-DD hh:mm:ss\"` format if none is specified.\n * @param {string | Date | null| undefined} date - The date to format.\n * @param {string} [format=\"YYYY-MM-DD hh:mm:ss\"] - The desired date format, if format is `null` or `undefined` will force to defaultValue, defaultValue is: `\"YYYY-MM-DD hh:mm:ss\"`.\n * @returns {string | null} The formatted date string or `null` if invalid.\n * @example\n * formatDateTime(new Date());\n * // ➔ \"2024-02-09 14:30:45\" (example output with current time)\n * formatDateTime(\"2023-07-01T14:30:45\");\n * // ➔ \"2023-07-01 14:30:45\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"DD/MM/YYYY\");\n * // ➔ \"01/07/2023\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"YYYY/MM/DD hh-mm-ss\");\n * // ➔ \"2023/07/01 14-30-45\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"hh:mm\");\n * // ➔ \"14:30\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"DATE: YYYY.MM.DD\");\n * // ➔ \"DATE: 2023.07.01\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"Year: YYYY, Time: hh:mm:ss\");\n * // ➔ \"Year: 2023, Time: 14:30:45\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"YYYY-MM\");\n * // ➔ \"2023-07\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"YYYYYYYY\");\n * // ➔ \"20232023\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"hh:mm:ss:ss\");\n * // ➔ \"14:30:45:45\"\n * formatDateTime(\"invalid-date\");\n * // ➔ null\n * formatDateTime(null);\n * // ➔ null\n * formatDateTime(undefined);\n * // ➔ null\n */\nexport const formatDateTime = (\n date: string | Date | null | undefined,\n format?: string\n): string | null => {\n if (isNil(format)) {\n format = \"YYYY-MM-DD hh:mm:ss\";\n }\n\n if (!isString(format)) return null;\n\n // Handle missing or invalid date input type\n if (isNil(date) || !(isDate(date) || isNonEmptyString(date))) {\n return null;\n }\n\n try {\n const parsedDate = new Date(date);\n if (isNaN(parsedDate.getTime())) return null; // Handle invalid dates\n\n const pad2 = (n: number) => n.toString().padStart(2, \"0\");\n\n const map: Record<string, string> = {\n YYYY: parsedDate.getFullYear().toString(),\n MM: pad2(parsedDate.getMonth() + 1),\n DD: pad2(parsedDate.getDate()),\n hh: pad2(parsedDate.getHours()),\n mm: pad2(parsedDate.getMinutes()),\n ss: pad2(parsedDate.getSeconds())\n };\n\n const result = Object.entries(map).reduce(\n (prev, [key, value]) => prev.split(key).join(value),\n format\n );\n\n return !result.includes(\"NaN\") ? result : null;\n } catch {\n return null;\n }\n};\n","import { isNil } from \"@/predicates/is/isNil\";\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isEmptyString } from \"@/predicates/is/isEmptyString\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `getGMTOffset`.***\n * ----------------------------------------------------------\n * **Returns the formatted GMT offset (e.g., `+0700`, `-0500`) for a given date.**\n * - **Features:**\n * - If `date` is **not provided** or empty string, it defaults to the current date/time.\n * - If `date` is **invalid** or of wrong type (like object or number), it returns `\"0\"`.\n * - The returned string follows the **GMT offset format** (`±HHMM`), where:\n * - `±` is `+` if ahead of UTC, `-` if behind.\n * - `HH` is two-digit hours.\n * - `MM` is two-digit minutes.\n * @param {string | Date | null} [date]\n * ***The date to get the GMT offset from.***\n * - Accepts `Date` object or ISO date string (e.g., `\"2024-01-01T12:00:00Z\"`).\n * - If `null`, `undefined`, or empty string, uses current system date.\n * - If invalid date or wrong type (like `123` or `{}`), returns `\"0\"`.\n * @returns {string} The GMT offset string in format `±HHMM`,\n * e.g. `\"+0700\"`, `\"-0530\"`, or `\"0\"` if invalid.\n * @example\n * getGMTOffset();\n * // ➔ \"+0700\" (depends on your system timezone)\n * getGMTOffset(new Date(\"2024-02-09T12:00:00Z\"));\n * // ➔ \"+0000\"\n * getGMTOffset(\"2024-02-09\");\n * // ➔ \"+0700\" (depends on your system timezone)\n * getGMTOffset(\"invalid-date\");\n * // ➔ \"0\"\n * getGMTOffset(123);\n * // ➔ \"0\"\n */\nexport const getGMTOffset = (date?: string | Date | null): string => {\n try {\n if (isNil(date) || (isString(date) && isEmptyString(date))) {\n date = new Date(); // Default to current date\n } else if (!(isDate(date) || isNonEmptyString(date))) {\n return \"0\"; // Invalid type\n }\n\n const parsedDate = new Date(date);\n if (isNaN(parsedDate.getTime())) return \"0\"; // Handle invalid dates\n\n const padZero = (num: number) => num.toString().padStart(2, \"0\");\n\n let offset = parsedDate.getTimezoneOffset();\n const sign = offset < 0 ? \"+\" : \"-\";\n offset = Math.abs(offset);\n\n return `${sign}${padZero(Math.floor(offset / 60))}${padZero(offset % 60)}`;\n } catch {\n return \"0\";\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,sBAAsB,EAC1B,QACA,gBAII;CACJ,MAAM,YAAY,QAAQ,MAAM,GAAG;CACnC,MAAM,OAAO,QAAQ,MAAM,GAAG,GAAG;CACjC,IAAI,CAAC,MAAM,OAAO;CAClB,OACE,KAAK,QAAQ,yBAAyB,UAAU,GAAG,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC/B,IAAI,KAAK,WAAW,YAAY,CAAC;GACjC,IAAI,KAAK,WAAW,YAAY,CAAC;GAClC;EAED,MAAM,SAAS,OAAO,QAAQ,IAAI,CAAC,QAChC,MAAM,CAAC,KAAK,WAAW,KAAK,MAAM,IAAI,CAAC,KAAK,MAAM,EACnD,OACD;EAED,OAAO,CAAC,OAAO,SAAS,MAAM,GAAG,SAAS;SACpC;EACN,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9CX,MAAa,gBAAgB,SAAwC;CACnE,IAAI;EACF,IAAI,MAAM,KAAK,IAAK,SAAS,KAAK,IAAI,cAAc,KAAK,EACvD,uBAAO,IAAI,MAAM;OACZ,IAAI,EAAE,OAAO,KAAK,IAAI,iBAAiB,KAAK,GACjD,OAAO;EAGT,MAAM,aAAa,IAAI,KAAK,KAAK;EACjC,IAAI,MAAM,WAAW,SAAS,CAAC,EAAE,OAAO;EAExC,MAAM,WAAW,QAAgB,IAAI,UAAU,CAAC,SAAS,GAAG,IAAI;EAEhE,IAAI,SAAS,WAAW,mBAAmB;EAC3C,MAAM,OAAO,SAAS,IAAI,MAAM;EAChC,SAAS,KAAK,IAAI,OAAO;EAEzB,OAAO,GAAG,OAAO,QAAQ,KAAK,MAAM,SAAS,GAAG,CAAC,GAAG,QAAQ,SAAS,GAAG;SAClE;EACN,OAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatters-lAYgA11L.cjs","names":["isString","isFinite","getPreciseType","safeStableStringify","hasOwnProp","isBoolean","isInteger","isPlainObject","parseCurrencyString","isNaN","isUndefined","isFunction","isString","isFinite","getPreciseType","AsYouType","isNil","isString","isNumber","getPreciseType","hasOwnProp","isBoolean","isUndefined","safeStableStringify","isNonEmptyString","isUndefined","isNonEmptyString","hasOwnProp","getPreciseType","safeStableStringify","isNil","isInteger","getPreciseType","safeStableStringify","hasOwnProp","normalizeSpaces","isNonEmptyString","hasOwnProp","isInteger","getPreciseType","safeStableStringify","isEmptyString","isNil","isDate","isNonEmptyString","isPlainObject","hasOwnProp","id","enUS","isNaN","isNil","isDate","isNonEmptyString","isNaN","isPlainObject","isNil","isString","isDate","isNonEmptyString","isNaN","isNil","isString","isEmptyString","isDate","isNonEmptyString","isNaN"],"sources":["../src/formatters/currencies/formatCurrency.ts","../src/formatters/numbers/formatNumber.ts","../src/formatters/phones/_private/formatPhoneNumber.utils.ts","../src/formatters/phones/formatPhoneNumber.ts","../src/formatters/strings/_private/censorEmail.utils.ts","../src/formatters/strings/censorEmail.ts","../src/formatters/strings/chunkString.ts","../src/formatters/strings/truncateString.ts","../src/formatters/times/formatDateFns.ts","../src/formatters/times/formatDateIntl.ts","../src/formatters/times/formatDateTime.ts","../src/formatters/times/getGMTOffset.ts"],"sourcesContent":["import type { FormatCurrencyOptions } from \"@/formatters/currencies/formatCurrency.types\";\n\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isFinite } from \"@/predicates/is/isFinite\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isInteger } from \"@/predicates/is/isInteger\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { isFunction } from \"@/predicates/is/isFunction\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isUndefined } from \"@/predicates/is/isUndefined\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\n\nimport { assertIsString } from \"@/assertions/strings/assertIsString\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\nimport { parseCurrencyString } from \"@/conversions/currency/parsing\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\n/** @private ***Util helper for {@link formatCurrency}.*** */\nconst formatIndianNumber = ({\n numStr,\n separator\n}: {\n numStr?: string;\n separator: string;\n}) => {\n const lastThree = numStr?.slice(-3);\n const rest = numStr?.slice(0, -3);\n if (!rest) return lastThree;\n return (\n rest.replace(/\\B(?=(\\d{2})+(?!\\d))/g, separator) + separator + lastThree\n );\n};\n\n/** -------------------------------------------------------\n * * ***Utility: `formatCurrency`.***\n * -------------------------------------------------------\n * **Formats a number or messy currency string into a\n * beautifully formatted currency string, with highly\n * customizable separators, decimal control, rounding,\n * currency symbols, and negative styling.**\n * - **✅ Highlights:**\n * - ***Accepts:***\n * - Pure numbers: `15300.95`.\n * - Messy currency strings from **any locale**:\n * - `\"Rp 15.000,21\"` ***(Indonesian / Euro)***.\n * - `\"$12,345.60\"` ***(US)***.\n * - `\"CHF 12'345.60\"` ***(Swiss)***.\n * - `\"1,23,456.78\"` ***(Indian)***.\n * - Auto extracts numeric value with smart multi-locale parsing\n * via ***`parseCurrencyString` utility function***.\n * - Strong type checks & clear errors for misconfigured options.\n * - **Handles:**\n * - Thousands separators: `.`, `,`, `'`, ` `.\n * - Decimal separators: `,`, `.`.\n * - Decimal suffix (eg. `\".-\"`, `\" USD\"`).\n * - Currency prefix (eg. `\"Rp \"`, `\"$ \"`).\n * - Rounding: `\"round\"`, `\"ceil\"`, `\"floor\"`, or truncate.\n * - Negative styling: dash `-`, brackets `( )`, absolute, or custom.\n * - **✅ How input is parsed:**\n * - Removes all non-digit except `.`, `,`, `'` and spaces.\n * - Detects bracket negatives: `\"(15.000,10)\"` ➔ `-15000.10`.\n * - Uses last `,` or `.` as decimal separator (others are thousands).\n * - Ignores currency symbols like `Rp`, `$` (must re-apply with `suffixCurrency`).\n * - **ℹ️ Note:**\n * - Always re-apply symbols via `suffixCurrency`.\n * - `parseCurrencyString` smartly detects last decimal,\n * so `\"1.121.234,56\"` and `\"1,121,234.56\"` both parsed correctly.\n * @param {string|number} value\n * ***The input value to format, examples:***\n * - `\"Rp 15.000,21\"`.\n * - `\"$12,345.60\"`.\n * - `\"CHF 12'345.60\"`.\n * - `15300.95`.\n * @param {FormatCurrencyOptions} [options] ***Optional configuration object.***\n * @param {FormatCurrencyOptions[\"separator\"]} [options.separator]\n * ***Thousands separator:***\n * - `{ separator: \".\" }` ➔ `1.000.000`.\n * - *DefaultValue: `\".\"`.*\n * @param {FormatCurrencyOptions[\"separatorDecimals\"]} [options.separatorDecimals]\n * ***Decimal separator:***\n * - `{ separatorDecimals: \",\" }` ➔ `1.000,10`.\n * - *DefaultValue: `\",\"`.*\n * @param {FormatCurrencyOptions[\"suffixCurrency\"]} [options.suffixCurrency]\n * ***Prefix currency string:***\n * - Does **not auto-keep input symbols**.\n * - Must set manually e.g: `{ suffixCurrency: \"Rp \" }`.\n * - `{ suffixCurrency: \"Rp \" }` ➔ `Rp 1.000`.\n * - *DefaultValue: `\"\"`.*\n * @param {FormatCurrencyOptions[\"decimal\"]} [options.decimal]\n * ***Whether to show decimals. If `false`, decimals are truncated:***\n * - If `false`, cut the decimal.\n * - *DefaultValue: `false`.*\n * @param {FormatCurrencyOptions[\"totalDecimal\"]} [options.totalDecimal]\n * ***Total decimal digits:***\n * - If `decimal: true` & `roundedDecimal: false`, simply cuts.\n * - *DefaultValue: `2`.*\n * @param {FormatCurrencyOptions[\"separatorDecimals\"]} [options.suffixDecimal]\n * ***Text appended after decimals:***\n * - E.g: (`\".-\"`, `\" USD\"`).\n * - Example 1: `\".-\"` ➔ `1.000,00.-`.\n * - Example 2: `\" USD\"` ➔ `1.000,00 USD`.\n * - *DefaultValue: `\"\"`.*\n * @param {FormatCurrencyOptions[\"endDecimal\"]} [options.endDecimal]\n * ***Actually append `suffixDecimal`:***\n * - *DefaultValue: `true`.*\n * @param {FormatCurrencyOptions[\"roundedDecimal\"]} [options.roundedDecimal]\n * ***Rounding mode:***\n * - `\"round\"` ➔ nearest.\n * - `\"ceil\"` ➔ always up.\n * - `\"floor\"` ➔ always down.\n * - `false` ➔ truncate.\n * - *DefaultValue: `\"round\"`.*\n * @param {FormatCurrencyOptions[\"negativeFormat\"]} [options.negativeFormat]\n * ***How to format negatives:***\n * - `\"dash\"` ➔ `-15.000`.\n * - `\"brackets\"` ➔ `(15.000)`.\n * - `\"abs\"` ➔ `15.000` (always positive).\n * - Or object: `{ style: \"dash\" | \"brackets\" | \"abs\", space: true | false, custom: (formatted) => string }`.\n * - *DefaultValue: `\"dash\"`.*\n * @param {FormatCurrencyOptions[\"indianFormat\"]} [options.indianFormat]\n * ***Applies Indian Format:***\n * - If `true`, formats as Indian: `12,34,567`.\n * - Also forces `separator: \",\"`, `separatorDecimals: \".\"`.\n * @returns {string}\n * ***Nicely formatted currency string, examples:***\n * - `\"15.000,10\"`.\n * - `\"Rp 15.000,10.-\"`.\n * - `\"15'000.10 USD\"`.\n * - `\"12,34,567.89\"`.\n * @throws **{@link TypeError | `TypeError`}** ***If:***\n * - The `value` is not string or number.\n * - Cannot parse to valid number.\n * - Options have invalid types.\n * @example\n * // --- Number input (default, decimals off) ---\n * formatCurrency(1234567.89);\n * // ➔ \"1.234.567\"\n *\n * // --- Decimals enabled ---\n * formatCurrency(1234567.89, { decimal: true });\n * // ➔ \"1.234.567,89\"\n *\n * // --- Indian format ---\n * formatCurrency(1234567.89, { decimal: true, indianFormat: true });\n * // ➔ \"12,34,567.89\"\n *\n * // --- String input (Indonesian style) ---\n * formatCurrency(\"Rp 15.000,21\", { decimal: true });\n * // ➔ \"15.000,21\"\n *\n * // --- String input (US style) ---\n * formatCurrency(\"$12,345.60\", { decimal: true });\n * // ➔ \"12.345,60\"\n *\n * // --- String input (Swiss style) ---\n * formatCurrency(\"CHF 12'345.60\", { decimal: true });\n * // ➔ \"12'345,60\"\n *\n * // --- String input (Indian style) ---\n * formatCurrency(\"1,23,456.78\", { decimal: true, indianFormat: true });\n * // ➔ \"12,34,567.78\"\n *\n * // --- Negative numbers (dash) ---\n * formatCurrency(-1234.56, { decimal: true });\n * // ➔ \"-1.234,56\"\n *\n * // --- Negative numbers (brackets) ---\n * formatCurrency(-1234.56, {\n * decimal: true,\n * negativeFormat: \"brackets\"\n * });\n * // ➔ \"(1.234,56)\"\n *\n * // --- Negative numbers (custom object style) ---\n * formatCurrency(-1234.56, {\n * decimal: true,\n * negativeFormat: { style: \"brackets\", space: true }\n * });\n * // ➔ \"( 1.234,56 )\"\n *\n * // --- Negative numbers (custom function) ---\n * formatCurrency(-1234.56, {\n * decimal: true,\n * negativeFormat: { custom: (val) => `NEGATIVE[${val}]` }\n * });\n * // ➔ \"NEGATIVE[1.234,56]\"\n *\n * // --- With prefix currency ---\n * formatCurrency(1234.56, {\n * decimal: true,\n * suffixCurrency: \"Rp \"\n * });\n * // ➔ \"Rp 1.234,56\"\n *\n * // --- With suffix decimal ---\n * formatCurrency(1234.56, {\n * decimal: true,\n * suffixDecimal: \".-\"\n * });\n * // ➔ \"1.234,56.-\"\n *\n * // --- With suffix currency + suffix decimal ---\n * formatCurrency(1234.56, {\n * decimal: true,\n * suffixCurrency: \"Rp \",\n * suffixDecimal: \".-\"\n * });\n * // ➔ \"Rp 1.234,56.-\"\n *\n * // --- Custom separators ---\n * formatCurrency(1234567.89, {\n * decimal: true,\n * separator: \"'\",\n * separatorDecimals: \".\"\n * });\n * // ➔ \"1'234'567.89\"\n *\n * // --- Rounding: ceil ---\n * formatCurrency(1234.561, {\n * decimal: true,\n * roundedDecimal: \"ceil\"\n * });\n * // ➔ \"1.234,57\"\n *\n * // --- Rounding: floor ---\n * formatCurrency(1234.569, {\n * decimal: true,\n * roundedDecimal: \"floor\"\n * });\n * // ➔ \"1.234,56\"\n *\n * // --- Rounding: truncate (false) ---\n * formatCurrency(1234.569, {\n * decimal: true,\n * roundedDecimal: false\n * });\n * // ➔ \"1.234,56\"\n *\n * // --- Force no decimals (decimal: false) ---\n * formatCurrency(1234.567, { decimal: false });\n * // ➔ \"1.235\"\n *\n * // --- Edge case: messy input with dots & commas ---\n * formatCurrency(\"1.121.234,561\", {\n * decimal: true,\n * totalDecimal: 2,\n * roundedDecimal: \"ceil\",\n * suffixCurrency: \"Rp \",\n * negativeFormat: { style: \"brackets\" }\n * });\n * // ➔ \"(Rp 1.121.234,57)\"\n *\n * // --- Edge case: integer string input ---\n * formatCurrency(\"1.121.234\", {\n * decimal: true,\n * suffixCurrency: \"Rp \",\n * roundedDecimal: \"ceil\"\n * });\n * // ➔ \"Rp 1.121.234,00\"\n */\nexport const formatCurrency = (\n value: string | number,\n options: FormatCurrencyOptions = {}\n): string => {\n if (!isString(value) && !isFinite(value)) {\n throw new TypeError(\n `First parameter (\\`value\\`) must be of type \\`string\\` or \\`primitive-number\\`, but received: \\`${getPreciseType(\n value\n )}\\`, with value: \\`${safeStableStringify(value, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const decimal = hasOwnProp(options, \"decimal\") ? options.decimal : false;\n const totalDecimal = hasOwnProp(options, \"totalDecimal\")\n ? options.totalDecimal\n : 2;\n const endDecimal = hasOwnProp(options, \"endDecimal\")\n ? options.endDecimal\n : true;\n const indianFormat = hasOwnProp(options, \"indianFormat\")\n ? options.indianFormat\n : false;\n const suffixCurrency = hasOwnProp(options, \"suffixCurrency\")\n ? options.suffixCurrency\n : \"\";\n const suffixDecimal = hasOwnProp(options, \"suffixDecimal\")\n ? options.suffixDecimal\n : \"\";\n const roundedDecimal = hasOwnProp(options, \"roundedDecimal\")\n ? options.roundedDecimal\n : \"round\";\n const negativeFormat = hasOwnProp(options, \"negativeFormat\")\n ? options.negativeFormat\n : \"dash\";\n let separatorDecimals = hasOwnProp(options, \"separatorDecimals\")\n ? options.separatorDecimals\n : \",\";\n let separator = hasOwnProp(options, \"separator\") ? options.separator : \".\";\n\n // validations\n if (\n !isString(separator) ||\n !isString(separatorDecimals) ||\n !isString(suffixCurrency) ||\n !isString(suffixDecimal)\n ) {\n throw new TypeError(\n `Parameter \\`separator\\`, \\`separatorDecimals\\`, \\`suffixCurrency\\` and \\`suffixDecimal\\` property of the \\`options\\` (second parameter) must be of type \\`string\\`, but received: ['separator': \\`${getPreciseType(\n separator\n )}\\`, 'separatorDecimals': \\`${getPreciseType(\n separatorDecimals\n )}\\`, 'suffixCurrency': \\`${getPreciseType(\n suffixCurrency\n )}\\`, 'suffixDecimal': \\`${getPreciseType(suffixDecimal)}\\`].`\n );\n }\n\n if (\n !isBoolean(decimal) ||\n !isBoolean(endDecimal) ||\n !isBoolean(indianFormat)\n ) {\n throw new TypeError(\n `Parameter \\`decimal\\`, \\`endDecimal\\` and \\`indianFormat\\` property of the \\`options\\` (second parameter) must be of type \\`boolean\\`, but received: ['decimal': \\`${getPreciseType(\n decimal\n )}\\`, 'endDecimal': \\`${getPreciseType(\n endDecimal\n )}\\`, 'indianFormat': \\`${getPreciseType(indianFormat)}\\`].`\n );\n }\n\n if (!isInteger(totalDecimal)) {\n throw new TypeError(\n `Parameter \\`totalDecimal\\` property of the \\`options\\` (second parameter) must be of type \\`integer-number\\`, but received: \\`${getPreciseType(\n totalDecimal\n )}\\`, with value: \\`${safeStableStringify(length, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n if (\n !(\n roundedDecimal === false ||\n roundedDecimal === \"round\" ||\n roundedDecimal === \"ceil\" ||\n roundedDecimal === \"floor\"\n )\n ) {\n throw new TypeError(\n `Parameter \\`roundedDecimal\\` property of the \\`options\\` (second parameter) must be of type \\`false\\` or \\`string\\` must be one of \"round\" | \"ceil\" | \"floor\", but received: \\`${getPreciseType(\n roundedDecimal\n )}\\`, with value: \\`${safeStableStringify(roundedDecimal, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n if (\n !(\n negativeFormat === \"abs\" ||\n negativeFormat === \"brackets\" ||\n negativeFormat === \"dash\" ||\n isPlainObject(negativeFormat)\n )\n ) {\n throw new TypeError(\n `Parameter \\`negativeFormat\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` must be one of \"abs\" | \"brackets\" | \"dash\" or \\`plain-object\\` type, but received: \\`${getPreciseType(\n negativeFormat\n )}\\`, with value: \\`${safeStableStringify(negativeFormat, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n // parse number\n const rawNum = isString(value) ? parseCurrencyString(value) : value;\n if (isNaN(rawNum)) {\n throw new TypeError(\n \"First parameter (`value`) could not be parsed into a valid `number`.\"\n );\n }\n\n let integerPart: string | undefined;\n let decimalPartRaw: string | undefined;\n let num = Math.abs(rawNum);\n const factor = Math.pow(10, totalDecimal);\n\n if (roundedDecimal) {\n const scaled = num * factor;\n switch (roundedDecimal) {\n case \"round\":\n num = Math.round(scaled) / factor;\n break;\n case \"ceil\":\n num = Math.ceil(scaled) / factor;\n break;\n case \"floor\":\n num = Math.floor(scaled) / factor;\n break;\n }\n }\n\n if (roundedDecimal) {\n [integerPart, decimalPartRaw] = num.toFixed(totalDecimal).split(\".\");\n decimalPartRaw = decimalPartRaw ?? \"\".padEnd(totalDecimal, \"0\");\n } else {\n // cut decimal manually\n const split = String(num).split(\".\");\n integerPart = split[0];\n decimalPartRaw = (split[1] || \"\")\n .slice(0, totalDecimal)\n .padEnd(totalDecimal, \"0\");\n }\n\n let formattedInteger: string;\n\n if (indianFormat) {\n separator = \",\";\n separatorDecimals = \".\";\n formattedInteger =\n (suffixCurrency.trim().length ? suffixCurrency : \"\") +\n formatIndianNumber({ numStr: integerPart, separator });\n } else {\n formattedInteger =\n (suffixCurrency.trim().length ? suffixCurrency : \"\") +\n integerPart?.replace(/\\B(?=(\\d{3})+(?!\\d))/g, separator);\n }\n\n if (decimal && !isUndefined(decimalPartRaw) && totalDecimal > 0) {\n let formattedDecimal = separatorDecimals + decimalPartRaw;\n if (endDecimal) formattedDecimal += suffixDecimal;\n formattedInteger += formattedDecimal;\n }\n\n // negative format\n if (rawNum < 0) {\n if (negativeFormat === \"dash\") {\n formattedInteger = \"-\" + formattedInteger;\n } else if (negativeFormat === \"brackets\") {\n formattedInteger = \"(\" + formattedInteger + \")\";\n } else if (negativeFormat === \"abs\") {\n // no sign\n } else if (isPlainObject(negativeFormat)) {\n if (hasOwnProp(negativeFormat, \"custom\")) {\n const formatCustomNegative = negativeFormat.custom;\n\n if (!isFunction(formatCustomNegative)) {\n throw new TypeError(\n `Parameter \\`negativeFormat.custom\\` property of the \\`options\\` (second parameter) must be of type function: \\`(formatted: string) => string\\`, but received: \\`${getPreciseType(\n formatCustomNegative\n )}\\`.`\n );\n }\n\n const result = formatCustomNegative(formattedInteger);\n\n assertIsString(result, {\n message: ({ currentType, validType }) =>\n `Parameter \\`negativeFormat.custom\\` property of the \\`options\\` (second parameter) expected return a \\`${validType}\\` type value, but received: \\`${currentType}\\`.`\n });\n\n formattedInteger = result;\n } else {\n const formatStyleNegative = negativeFormat.style || \"dash\";\n const formatSpaceNegative = !isUndefined(negativeFormat.space)\n ? negativeFormat.space\n : false;\n\n assertIsBoolean(formatSpaceNegative, {\n message: ({ currentType, validType }) =>\n `Parameter \\`negativeFormat.space\\` property of the \\`options\\` (second parameter) must be of type \\`${validType} or undefined\\`, but received: \\`${currentType}\\`.`\n });\n\n if (\n !(\n formatStyleNegative === \"abs\" ||\n formatStyleNegative === \"brackets\" ||\n formatStyleNegative === \"dash\"\n )\n ) {\n throw new TypeError(\n `Parameter \\`negativeFormat.style\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` must be of type \"abs\" | \"brackets\" | \"dash\", but received: \\`${getPreciseType(\n formatStyleNegative\n )}\\`, with value: \\`${safeStableStringify(formatStyleNegative, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n switch (formatStyleNegative) {\n case \"dash\":\n formattedInteger =\n \"-\" + (formatSpaceNegative ? \" \" : \"\") + formattedInteger;\n break;\n case \"brackets\":\n formattedInteger = formatSpaceNegative\n ? `( ${formattedInteger} )`\n : `(${formattedInteger})`;\n break;\n case \"abs\":\n // no sign\n break;\n }\n }\n }\n }\n\n return formattedInteger;\n};\n","import { isFinite } from \"@/predicates/is/isFinite\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `formatNumber`.***\n * ----------------------------------------------------------\n * **Formats a number or numeric string by adding a custom separator\n * every three digits (thousands separator), and intelligently flips\n * the decimal separator according to the chosen separator.**\n * - **Features:**\n * - Converts a number to string before formatting.\n * - Defaults to using `,` as the thousands separator.\n * - If `.` is used as the separator, the decimal will automatically\n * become `,`, and vice versa.\n * - Handles input with existing formatting (e.g. \"1,234,567.89\") and normalizes it.\n * - Supports custom separators, including spaces.\n * - Preserves decimals even if more than 2 digits.\n * @param {string | number} value - The numeric value or string to format, can be plain numbers, or already formatted strings like `\"1,234,567.89\"`.\n * @param {string} [separator=\",\"] - The thousands separator to use, examples: `\",\"` ***(default)***, `\".\"`, `\" \"`, etc.\n * @returns {string} The formatted string with thousands separators and\n * appropriate decimal separator.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not a string or number, or `separator` is not a string.\n * @example\n * formatNumber(1000000);\n * // ➔ \"1,000,000\"\n * formatNumber(\"987654321\");\n * // ➔ \"987,654,321\"\n * formatNumber(1234567.89);\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"1234567,89\");\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"1234567.892\");\n * // ➔ \"1,234,567.892\"\n * formatNumber(\"1234567.89\", \".\");\n * // ➔ \"1.234.567,89\"\n * formatNumber(\"1234567,89\", \",\");\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"987654321\", \" \");\n * // ➔ \"987 654 321\"\n * formatNumber(\"1,234,567.89\");\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"1.234.567,89\", \",\");\n * // ➔ \"1,234,567.89\"\n * formatNumber(\"1.234.567,893\", \".\");\n * // ➔ \"1.234.567,893\"\n * formatNumber(\"1234.56\", \".\");\n * // ➔ \"1.234,56\"\n * formatNumber(\"1234,56\", \",\");\n * // ➔ \"1,234.56\"\n */\nexport const formatNumber = (\n value: string | number,\n separator: string = \",\"\n): string => {\n if (!isString(value) && !isFinite(value)) {\n throw new TypeError(\n `First parameter (\\`value\\`) must be of type \\`string\\` or \\`primitive number\\`, but received: \\`${getPreciseType(\n value\n )}\\`.`\n );\n }\n\n if (!isString(separator)) {\n throw new TypeError(\n `Second parameter (\\`separator\\`) must be of type \\`string\\` or empty as \\`undefined\\`, but received: \\`${getPreciseType(\n separator\n )}\\`.`\n );\n }\n\n separator = isString(separator) ? separator : \",\";\n const decimalSeparator =\n separator === \".\" ? \",\" : separator === \",\" ? \".\" : \".\";\n\n // Convert value to string\n const stringValue = value.toString().trim();\n\n // --- Normalize input ---\n // Find the last decimal separator from the end\n const lastDot = stringValue.lastIndexOf(\".\");\n const lastComma = stringValue.lastIndexOf(\",\");\n\n let actualDecimal = \"\";\n if (lastDot > lastComma) {\n actualDecimal = \".\";\n } else if (lastComma > lastDot) {\n actualDecimal = \",\";\n }\n\n // Split into integer and decimal parts\n let integerPart = stringValue;\n let decimalPart = \"\";\n if (actualDecimal) {\n const parts = stringValue.split(actualDecimal);\n integerPart = parts.slice(0, -1).join(actualDecimal); // merge if more than one\n decimalPart = parts.slice(-1)[0];\n }\n\n // Remove all non-digit characters from the integer part\n integerPart = integerPart.replace(/[^\\d]/g, \"\");\n\n // Format integer part with thousands separator\n const formattedInteger = integerPart.replace(\n /\\B(?=(\\d{3})+(?!\\d))/g,\n separator\n );\n\n // Combine with decimal part if exists\n return decimalPart\n ? `${formattedInteger}${decimalSeparator}${decimalPart}`\n : formattedInteger;\n};\n","import type { OmitStrict, Prettify } from \"@rzl-zone/ts-types-plus\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { formatPhoneNumber } from \"../formatPhoneNumber\";\nimport {\n AsYouType,\n type PhoneNumber,\n type CountryCode\n} from \"libphonenumber-js/max\";\n\n/** @private ***Util constants `country code for special leading zero rule` for {@link formatPhoneNumber}.*** */\nexport const trunkZeroCountries: Record<string, string> = {\n \"7\": \"Russia, Kazakhstan\",\n \"20\": \"Egypt\",\n \"27\": \"South Africa\",\n \"30\": \"Greece\",\n \"31\": \"Netherlands\",\n \"32\": \"Belgium\",\n \"33\": \"France\",\n \"34\": \"Spain\",\n \"36\": \"Hungary\",\n \"39\": \"Italy, San Marino, Vatican\",\n \"41\": \"Switzerland\",\n \"43\": \"Austria\",\n \"44\": \"United Kingdom\",\n \"45\": \"Denmark\",\n \"46\": \"Sweden\",\n \"47\": \"Norway\",\n \"48\": \"Poland\",\n \"49\": \"Germany\",\n \"51\": \"Peru\",\n \"52\": \"Mexico\",\n \"53\": \"Cuba\",\n \"54\": \"Argentina\",\n \"55\": \"Brazil\",\n \"56\": \"Chile\",\n \"57\": \"Colombia\",\n \"58\": \"Venezuela\",\n \"60\": \"Malaysia\",\n \"61\": \"Australia\",\n \"62\": \"Indonesia\",\n \"63\": \"Philippines\",\n \"64\": \"New Zealand\",\n \"65\": \"Singapore\",\n \"66\": \"Thailand\",\n \"81\": \"Japan\",\n \"82\": \"South Korea\",\n \"84\": \"Vietnam\",\n \"86\": \"China\",\n \"90\": \"Turkey\",\n \"91\": \"India\",\n \"92\": \"Pakistan\",\n \"351\": \"Portugal\",\n \"352\": \"Luxembourg\",\n \"355\": \"Albania\",\n \"356\": \"Malta\",\n \"358\": \"Finland\",\n \"359\": \"Bulgaria\",\n \"370\": \"Lithuania\",\n \"371\": \"Latvia\",\n \"372\": \"Estonia\",\n \"373\": \"Moldova\",\n \"374\": \"Armenia\",\n \"375\": \"Belarus\",\n \"376\": \"Andorra\",\n \"377\": \"Monaco\",\n \"378\": \"San Marino\",\n \"379\": \"Vatican\",\n \"971\": \"UAE\"\n};\n/** @private ***Util helper for {@link formatPhoneNumber}.*** */\nexport const isValidPhoneE164 = (value: unknown) => {\n if (!isNonEmptyString(value)) return false;\n return (\n /^(\\+)?[0-9\\s().-]+$/.test(value) && value.replace(/\\D/g, \"\").length <= 15\n );\n};\n\n/** @private ***Util parsing `phone-number` for {@link formatPhoneNumber}.*** */\nexport const parsingAsYouType = (\n value: string,\n defaultCountry?: CountryCode\n) => {\n let parsed;\n try {\n parsed = new AsYouType(defaultCountry);\n parsed.input(value);\n return parsed;\n } catch {\n parsed?.reset();\n return undefined;\n }\n};\n\ntype ValidParseAsYouType = Prettify<\n OmitStrict<AsYouType, \"getNumber\"> & {\n getNumber(): PhoneNumber; // override agar tidak nullable\n }\n>;\n\n/** @private ***Util validation parsing `phone-number` when using `AsYouType` for {@link formatPhoneNumber}.*** */\nexport const isValidParseAsYouType = (\n parsedAsYouType?: AsYouType\n): parsedAsYouType is ValidParseAsYouType => {\n const parsed = !!parsedAsYouType?.isValid() && !!parsedAsYouType.getNumber();\n return parsed;\n};\n","import type {\n FormatPhoneNumberMain,\n FormatPhoneNumberTakeNumberOnly,\n FormatPhoneNumberCheckValidOnly,\n FormatPhoneNumberTransform,\n ValueFormatPhoneNumber,\n FormatPhoneNumberAllPassing,\n FormatPhoneNumberAllPassingValidOnly,\n FormatPhoneNumberAllPassingTakeOnly,\n OutputFormat\n} from \"./_private/formatPhoneNumber.types\";\n\nimport { isSupportedCountry } from \"libphonenumber-js/max\";\n\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isNumber } from \"@/predicates/is/isNumber\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isBoolean } from \"@/predicates/is/isBoolean\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isUndefined } from \"@/predicates/is/isUndefined\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\nimport {\n parsingAsYouType,\n isValidParseAsYouType\n} from \"./_private/formatPhoneNumber.utils\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***`Formatting Number`.***\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`):\n * - Return empty-string (\"\"), if invalid number phone.\n * - Return boolean when **validity-check mode** (`checkValidOnly`):\n * - ***Return `true` if:***\n * - A phone number is \"valid\" when it has valid length, and the actual phone number digits match the\n * regular expressions for its country (parameter options `defaultCountry`).\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * ***Phone number to format, accepts:***\n * - `string` (recommended to preserve leading zeros).\n * - `number` (leading zeros will be lost).\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberMain} [options]\n * ***Main options object controlling:***\n * - `separator` (**string**): Group separator, default `\" \"`.\n * - `plusNumberCountry` (**string**): Country code with optional leading `+`.\n * - `openingNumberCountry` (**string**): Characters before the country code, e.g. `\"(\"`.\n * - `closingNumberCountry` (**string**): Characters after the country code, e.g. `\")\"`.\n * - `checkValidOnly` (**boolean**): Return only validity.\n * - `takeNumberOnly` (**boolean**): Return digits only.\n * - `defaultCountry` (**string** - **`<ISO-3166-1 alpha-2>`**): Used to interpret numbers without an explicit `+<countryCode>`.\n * @returns {string|boolean} Formatted phone number string, digits-only string, or boolean.\n * @overload\n * @param {ValueFormatPhoneNumber} value The phone number input (string or number).\n * @param {FormatPhoneNumberCheckValidOnly} [options] With `checkValidOnly: true`.\n * Return a **validity-check mode** when `checkValidOnly: true`.\n * @returns {boolean} A boolean indicating whether the input is a valid phone number.\n * @overload\n * @param {ValueFormatPhoneNumber} value The phone number input (string or number).\n * @param {FormatPhoneNumberTransform} [options] With `takeNumberOnly: true`.\n * Return **digits-only mode** when `takeNumberOnly: true`.\n * @returns {string} A string of digits only.\n * @overload\n * @param {ValueFormatPhoneNumber} value The phone number input (string or number).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * Return a **formatted phone number string** with custom formatting and (`checkValidOnly: false`, `takeNumberOnly: false`).\n * @returns {string} Formatting number. return a string of digits only with formatter.\n * @example\n * 1. ***Formatting Phone Number String:***\n * ```ts\n * formatPhoneNumber(\"081234567890\");\n * // ➔ \"0812 3456 7890\"\n * formatPhoneNumber(\"081234567890\", {\n * separator: \"-\",\n * plusNumberCountry: \"+44\",\n * openingNumberCountry: \"(\",\n * closingNumberCountry: \")\"\n * });\n * // ➔ \"(+44) 8123-4567-890\"\n * ```\n * 2. ***Digits-Only Mode:***\n * ```ts\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * takeNumberOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ \"081234567890\"\n * formatPhoneNumber(\"(0812) 3456-7890\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"(63) 917 123 4567\", {\n * takeNumberOnly: true,\n * defaultCountry: \"PH\"\n * });\n * // ➔ \"0917 123 4567\"\n * formatPhoneNumber(\"(63) 4567-8901\", {\n * takeNumberOnly: true,\n * defaultCountry: \"PH\"\n * });\n * // ➔ \"\" // is not valid number from PH.\n * formatPhoneNumber(\"(63) 917 123 4567\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", {\n * takeNumberOnly: true,\n * defaultCountry: \"DE\"\n * });\n * // ➔ \"015123456789\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", { takeNumberOnly: true });\n * // ➔ \"\"\n * ```\n * 3. ***Validity-Check Mode:***\n * ```ts\n * formatPhoneNumber(\"+6281234567890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"0812-3456-7890\", {\n * checkValidOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812 3456 7890\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * checkValidOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ true\n * formatPhoneNumber(\"(0812) 3456-7890\", { checkValidOnly: true});\n * // ➔ false\n * formatPhoneNumber(\"+44 20 7946 0958\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+1 (800) 123-4567\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62.812.3456.7890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62(812)3456-7890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62abc123\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"invalid@@@\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"0812-3456-hello\", { checkValidOnly: true });\n * // ➔ false\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberTransform\n): string;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***`Digits-only Mode`.***\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros)\n * - `number` (leading zeros will be lost)\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {string} Digits-only mode, return string a digits-only.\n * @example\n * ```ts\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * takeNumberOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ \"081234567890\"\n * formatPhoneNumber(\"(0812) 3456-7890\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"(63) 917 123 4567\", {\n * takeNumberOnly: true,\n * defaultCountry: \"PH\"\n * });\n * // ➔ \"0917 123 4567\"\n * formatPhoneNumber(\"(63) 4567-8901\", {\n * takeNumberOnly: true,\n * defaultCountry: \"PH\"\n * });\n * // ➔ \"\" // is not valid number from PH.\n * formatPhoneNumber(\"(63) 917 123 4567\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", {\n * takeNumberOnly: true,\n * defaultCountry: \"DE\"\n * });\n * // ➔ \"015123456789\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", { takeNumberOnly: true });\n * // ➔ \"\"\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberTakeNumberOnly\n): string;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***`Validity-check Mode`.***\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros).\n * - `number` (leading zeros will be lost).\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {boolean} Validity-check mode, return a boolean.\n * @example\n * ```ts\n * formatPhoneNumber(\"+6281234567890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"0812-3456-7890\", {\n * checkValidOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812 3456 7890\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * checkValidOnly: true,\n * defaultCountry: \"ID\"\n * });\n * // ➔ true\n * formatPhoneNumber(\"(0812) 3456-7890\", { checkValidOnly: true});\n * // ➔ false\n * formatPhoneNumber(\"+44 20 7946 0958\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+1 (800) 123-4567\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62.812.3456.7890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62(812)3456-7890\", { checkValidOnly: true });\n * // ➔ true\n * formatPhoneNumber(\"+62abc123\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"invalid@@@\", { checkValidOnly: true });\n * // ➔ false\n * formatPhoneNumber(\"0812-3456-hello\", { checkValidOnly: true });\n * // ➔ false\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberCheckValidOnly\n): boolean;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***Forced to `Validity-check Mode`***, because `checkValidOnly` has set to `true`.\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros).\n * - `number` (leading zeros will be lost).\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {boolean} Validity-check mode, return a boolean.\n * @example\n * ```ts\n * formatPhoneNumber(\"+6281234567890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812-3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812 3456 7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ false\n * formatPhoneNumber(\"+44 20 7946 0958\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ true\n * formatPhoneNumber(\"+1 (800) 123-4567\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62.812.3456.7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62(812)3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62abc123\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ false\n * formatPhoneNumber(\"invalid@@@\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ false\n * formatPhoneNumber(\"0812-3456-hello\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true\n * });\n * // ➔ false\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberAllPassingValidOnly\n): boolean;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***Forced to `Digits-only Mode`***, because `takeNumberOnly` has set to `true`.\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros)\n * - `number` (leading zeros will be lost)\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {string} Digits-only mode, return string a digits-only.\n * @example\n * ```ts\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"081234567890\"\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"\"\n * formatPhoneNumber(\"(63) 917 123 4567\", {\n * defaultCountry: \"PH\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"0917 123 4567\"\n * formatPhoneNumber(\"(63) 4567-8901\", {\n * defaultCountry: \"PH\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"\" // is not valid number from PH.\n * formatPhoneNumber(\"(63) 917 123 4567\", { takeNumberOnly: true });\n * // ➔ \"\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", {\n * defaultCountry: \"DE\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"015123456789\"\n * formatPhoneNumber(\"49 (151) 2345 6789\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ \"\"\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberAllPassingTakeOnly\n): string;\n/** -------------------------------------------------------\n * * ***Utility: `formatPhoneNumber`.***\n * -------------------------------------------------------\n * **Formats a phone number into a customizable local or international style.**\n * - **Type:** ***Forced to `Validity-check Mode`***, because `checkValidOnly` and `takeNumberOnly` has set to `true`,\n * but `checkValidOnly` will prioritize one.\n * - **Can also:**\n * - Return only digits string when **digits-only mode** (`takeNumberOnly`).\n * - Return boolean when **validity-check mode** (`checkValidOnly`) using a\n * regex for international-style phone numbers:\n * - ***Valid if:***\n * - Only contains digits, optional leading `+`, spaces, parentheses `()`,\n * hyphens `-`, or dots `.`.\n * - Digits-only length < 16.\n * - **E.164 compliance:**\n * - Optional leading `+` is recommended but **not required**.\n * - If Without leading `+`, you must passing `defaultCountry`.\n * @throws **{@link TypeError | `TypeError`}** if `value` is not string, number, null or undefined.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not an object or contains wrong types.\n * @param {ValueFormatPhoneNumber} value\n * Phone number to format. Accepts:\n * - `string` (recommended to preserve leading zeros).\n * - `number` (leading zeros will be lost).\n * - `null` or `undefined` (returns empty string).\n * @param {FormatPhoneNumberTakeNumberOnly} [options] Options to customize format output (country code, separator, etc).\n * @returns {boolean} Validity-check mode, return a boolean.\n * @example\n * ```ts\n * formatPhoneNumber(\"+6281234567890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812-3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"0812 3456 7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * defaultCountry: \"ID\",\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"(0812) 3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"+44 20 7946 0958\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"+1 (800) 123-4567\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62.812.3456.7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62(812)3456-7890\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ true\n * formatPhoneNumber(\"+62abc123\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"invalid@@@\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * formatPhoneNumber(\"0812-3456-hello\", {\n * // Formatting Phone Number Options\n * separator: \"-\",\n * // Validity-check Mode\n * checkValidOnly: true,\n * // Digits-only Mode\n * takeNumberOnly: true,\n * });\n * // ➔ false\n * ```\n */\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options?: FormatPhoneNumberAllPassing\n): boolean;\nexport function formatPhoneNumber(\n value: ValueFormatPhoneNumber,\n options: FormatPhoneNumberMain = {}\n): string | boolean {\n if (isNil(value)) return \"\";\n\n if (!isString(value) && !isNumber(value)) {\n throw new TypeError(\n `First parameter (\\`value\\`) must be of type \\`string\\`, \\`number\\`, \\`null\\` or \\`undefined\\`, but received: \\`${getPreciseType(\n value\n )}\\`.`\n );\n }\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const takeNumberOnly = hasOwnProp(options, \"takeNumberOnly\")\n ? options.takeNumberOnly\n : false;\n const checkValidOnly = hasOwnProp(options, \"checkValidOnly\")\n ? options.checkValidOnly\n : false;\n const defaultCountry: typeof options.defaultCountry = hasOwnProp(\n options,\n \"defaultCountry\"\n )\n ? options.defaultCountry\n : undefined;\n\n const separator = hasOwnProp(options, \"separator\") ? options.separator : \" \";\n const prependPlusCountryCode = hasOwnProp(options, \"prependPlusCountryCode\")\n ? options.prependPlusCountryCode\n : true;\n const outputFormat: OutputFormat = hasOwnProp(options, \"outputFormat\")\n ? options.outputFormat\n : \"INTERNATIONAL\";\n const openingNumberCountry = hasOwnProp(options, \"openingNumberCountry\")\n ? options.openingNumberCountry\n : \"\";\n const closingNumberCountry = hasOwnProp(options, \"closingNumberCountry\")\n ? options.closingNumberCountry\n : \"\";\n\n if (\n !isBoolean(takeNumberOnly) ||\n !isBoolean(checkValidOnly) ||\n !isBoolean(prependPlusCountryCode)\n ) {\n throw new TypeError(\n `Parameter \\`takeNumberOnly\\`, \\`checkValidOnly\\` and \\`prependPlusCountryCode\\` property of the \\`options\\` (second parameter) must be of type \\`boolean\\` or unset as \\`undefined\\` value, but received: ['takeNumberOnly': \\`${getPreciseType(\n takeNumberOnly\n )}\\`, 'checkValidOnly': \\`${getPreciseType(\n checkValidOnly\n )}\\`, 'prependPlusCountryCode': \\`${getPreciseType(prependPlusCountryCode)}\\`].`\n );\n }\n\n if (!isUndefined(defaultCountry) && !isSupportedCountry(defaultCountry)) {\n throw new TypeError(\n `Parameter \\`defaultCountry\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` as \\`CountryCode\\` (ISO-3166-1 alpha-2) or unset as \\`undefined\\` value, but received: \\`${getPreciseType(\n defaultCountry\n )}\\`, with value: \\`${safeStableStringify(defaultCountry, {\n keepUndefined: true\n })}\\`.\\n\\nSee: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements, for all ISO 3166-1 alpha-2 code.`\n );\n }\n\n if (\n ![\"INTERNATIONAL\", \"NATIONAL\", \"RFC3966\", \"E.164\"].includes(outputFormat)\n ) {\n throw new TypeError(\n `Parameter \\`outputFormat\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` as \\`OutputFormat\\` (\"NATIONAL\" | \"INTERNATIONAL\" | \"E.164\" | \"RFC3966\") or unset as \\`undefined\\` (default value to: \\`INTERNATIONAL\\`) value, but received: \\`${getPreciseType(\n outputFormat\n )}\\`, with value: ${safeStableStringify(outputFormat, { keepUndefined: true })}.`\n );\n }\n\n if (\n !isString(separator) ||\n !isString(openingNumberCountry) ||\n !isString(closingNumberCountry)\n ) {\n throw new TypeError(\n `Parameter \\`separator\\`, \\`plusNumberCountry\\`, \\`openingNumberCountry\\` and \\`closingNumberCountry\\` property of the \\`options\\` (second parameter) must be of type \\`string\\` or unset as \\`undefined\\` value, but received: ['separator': \\`${getPreciseType(\n separator\n )}\\`,'openingNumberCountry': \\`${getPreciseType(\n openingNumberCountry\n )}\\`, 'closingNumberCountry': \\`${getPreciseType(closingNumberCountry)}\\`].`\n );\n }\n\n if (!isString(value)) value = String(value);\n\n const parsedPhoneNumber = parsingAsYouType(value, defaultCountry);\n const validPhoneNumber = isValidParseAsYouType(parsedPhoneNumber);\n\n if (checkValidOnly) return validPhoneNumber;\n\n // todo: return empty-string is invalid phone-number input.\n if (!validPhoneNumber) return \"\";\n\n if (takeNumberOnly) {\n return parsedPhoneNumber.getNumber().formatNational().replace(/\\D/g, \"\");\n }\n\n const num = parsedPhoneNumber.getNumber();\n // Result example: \"+49 1512 3456789\"\n const intlNumb = num.format(outputFormat);\n\n if (outputFormat === \"INTERNATIONAL\") {\n // Split to: [\"+49\", \"1512\", \"3456789\"]\n const [cc, ...rest] = intlNumb.split(\" \");\n const countryCode = prependPlusCountryCode ? cc : cc.replace(/^\\++/, \"\");\n const restWithSeparator = rest.join(separator);\n\n if (\n isNonEmptyString(openingNumberCountry) &&\n isNonEmptyString(closingNumberCountry)\n ) {\n return `${openingNumberCountry}${countryCode}${closingNumberCountry} ${restWithSeparator}`;\n }\n\n return `${countryCode} ${restWithSeparator}`;\n }\n\n if (outputFormat === \"NATIONAL\") {\n const restWithSeparator = intlNumb.split(\" \").join(separator);\n\n return `${restWithSeparator}`;\n }\n\n return intlNumb;\n}\n","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { censorEmail } from \"../censorEmail\";\nimport { isUndefined } from \"@/predicates/is/isUndefined\";\n\n/** @private ***Util helper for {@link censorEmail}.*** */\nexport const hashSeedGenerate = (mode: \"random\" | \"fixed\", email: string) => {\n const generateSeed = () => {\n let hash = 0;\n for (let i = 0; i < email.length; i++) {\n hash = (hash << 5) - hash + email.charCodeAt(i);\n hash |= 0; // Convert to 32bit int\n }\n return Math.abs(hash);\n };\n\n return mode === \"fixed\" ? generateSeed() : undefined;\n};\n\n/** ----------------------------------------------------------\n * * ***Internal Randomly replaces characters in a string with \"\\*\".***\n * ----------------------------------------------------------\n *\n * @param {string} str - The string to censor.\n * @param {number} minCensor - Minimum number of characters to censor.\n * @param {number} maxPercentage - Maximum percentage of characters to censor.\n * @returns {string} - Censored string.\n *\n * @private ***Util helper for {@link censorEmail}.***\n */\nexport const _censor = (\n str: string,\n minCensor: number,\n maxPercentage: number,\n hashSeed: number | undefined\n): string => {\n if (str.length <= minCensor) return \"*\".repeat(str.length);\n\n const strArr = str.split(\"\");\n const totalCensor = Math.max(\n minCensor,\n Math.ceil(str.length * maxPercentage)\n );\n const indexes = new Set<number>();\n\n let i = 0;\n while (indexes.size < totalCensor) {\n const idx = !isUndefined(hashSeed)\n ? (hashSeed + str.length + i * 31) % str.length\n : Math.floor(Math.random() * str.length);\n indexes.add(idx);\n i++;\n }\n\n for (const index of indexes) {\n strArr[index] = \"*\";\n }\n\n return strArr.join(\"\");\n};\n","import { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\nimport { _censor, hashSeedGenerate } from \"./_private/censorEmail.utils\";\n\ntype CensorEmailOptions = {\n /** ----------------------------------------------------------\n * * ***Censorship Mode.***\n * ----------------------------------------------------------\n * - **Valid value:**\n * - `\"fixed\"` (default) – Deterministic censorship based on a hash of the email, same input always produces the same output.\n * - `\"random\"` – Each character is randomly replaced every time the function is called.\n */\n mode?: \"random\" | \"fixed\";\n};\n\n/** ----------------------------------------------------------\n * * ***Utility: `censorEmail`.***\n * ----------------------------------------------------------\n * **Censors an email by replacing characters with `\"*\"` while supporting random or fixed mode.**\n * - **This function replaces parts of an email with asterisks to protect privacy.**\n * - **Modes:**\n * - `\"fixed\"` (default) – Deterministic censorship based on a hash of the email, same input always produces the same output.\n * - `\"random\"` – Each character is randomly replaced every time the function is called.\n * - **ℹ️ Note:**\n * - Invalid emails or non-string input will return an empty-string (`\"\"`).\n * @param {string | null | undefined} email - The email address to censor.\n * @param {CensorEmailOptions} [options={}] - Options object for mode.\n * @returns {string} The censored email, or an empty string if input is invalid.\n * @throws **{@link TypeError | `TypeError`}** if `options` is not a plain object or `mode` is invalid.\n * @example\n * // Fixed mode (default, deterministic)\n * censorEmail(\"john.doe@gmail.com\");\n * // ➔ \"j**n.**e@g***l.com\"\n *\n * // Fixed mode explicitly\n * censorEmail(\"john.doe@gmail.com\", { mode: \"fixed\" });\n * // ➔ \"j**n.**e@g***l.com\"\n *\n * // Random mode (output may vary each time)\n * censorEmail(\"john.doe@gmail.com\", { mode: \"random\" });\n * // ➔ \"j*hn.***e@g***l.com\" (random)\n *\n * // Invalid email returns empty string\n * censorEmail(\"invalid-email\");\n * // ➔ \"\"\n */\nexport const censorEmail = (\n email: string | null | undefined,\n options: CensorEmailOptions = {}\n): string => {\n if (!isNonEmptyString(email)) return \"\";\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Second parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const mode = hasOwnProp(options, \"mode\") ? options.mode : \"fixed\";\n\n // Ensure mode is either \"random\" or \"fixed\"\n if (mode !== \"random\" && mode !== \"fixed\") {\n throw new TypeError(\n `Parameter \\`mode\\` property of the \\`options\\` (second parameter) must be one of \"fixed\" or \"random\", but received: \\`${getPreciseType(\n mode\n )}\\`, with value: \\`${safeStableStringify(mode, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n // Strict email validation regex\n const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n if (!emailRegex.test(email)) return \"\";\n\n const [local, domain] = email.split(\"@\");\n const domainParts = domain.split(\".\"); // Handle multi-level domain (e.g., example.co.uk)\n if (domainParts.length < 2) return \"\"; // Invalid domain structure\n\n const [domainName, ...tldParts] = domainParts;\n const tld = tldParts.join(\".\");\n\n const hashSeed = hashSeedGenerate(mode, email);\n\n const localMinCensor = local.length < 4 ? 1 : 2;\n const domainMinCensor = domainName.length < 4 ? 1 : 2;\n\n const censoredLocal = _censor(local, localMinCensor, 0.6, hashSeed);\n const censoredDomain = _censor(domainName, domainMinCensor, 0.5, hashSeed);\n const censoredTLD = tld.length <= 2 ? tld : _censor(tld, 1, 0.4, hashSeed);\n\n return `${censoredLocal}@${censoredDomain}.${censoredTLD}`;\n};\n","import { isNil } from \"@/predicates/is/isNil\";\nimport { isInteger } from \"@/predicates/is/isInteger\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\n\nimport { assertIsString } from \"@/assertions/strings/assertIsString\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\nimport { normalizeSpaces } from \"@/strings/sanitizations/normalizeSpaces\";\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\ntype ChunkStringOptions = {\n /** ***The separator string to insert between characters or words.***\n *\n * - Used when inserting separators every `limiter` characters.\n * - Default is a single space `\" \"`.\n *\n * @default \" \"\n */\n separator?: string;\n\n /** ***Determines whether counting for `limiter` resets after each space.***\n *\n * - If `true`, the string is treated as words separated by spaces,\n * and separators are applied within words, then words are grouped.\n * - If `false` ***(default)***, counting is continuous across the whole string,\n * treating spaces as normal characters.\n *\n * @default false\n */\n reCountAfterSpace?: boolean;\n};\n\n/** ----------------------------------------------\n * * ***Utility: `chunkString`.***\n * ----------------------------------------------\n * **Chunks a string by inserting a separator every `limiter` characters.**\n * - **This function handles two main behaviors based on `reCountAfterSpace`:**\n * 1. ***If `reCountAfterSpace` is `false` (default):***\n * - The separator is inserted strictly every `limiter` characters throughout the entire string, regardless of spaces, spaces are treated as regular characters in the count.\n * - Example: `chunkString(\"1234567890\", 3, \"-\")` ➔ `\"123-456-789-0\"`.\n * - Example: `chunkString(\"Hello World\", 3, \"-\")` ➔ `\"Hel-lo -Wor-ld\"`.\n * 2. ***If `reCountAfterSpace` is `true`:***\n * - The function first processes the input string to replace any multiple consecutive spaces with a\n * single space (e.g., \"A B\" becomes \"A B\").\n * Then, it treats the string as a sequence of \"words\" (segments separated by single spaces).\n * - Each word is processed independently:\n * - if a word's length exceeds the `limiter`, separators are inserted internally within that word.\n * - Words are then grouped. Each group will contain `limiter` number of words.\n * - Words within the same group are joined by the specified `separator`.\n * - Finally, these groups are joined by a single space, preserving the original word separation\n * structure between groups.\n * @param {string} subject - ***The target string to chunk.****\n * @param {number} limiter\n * ***The interval (number of characters) for inserting separators, behavior:***\n * - If `reCountAfterSpace = false`, it counts characters.\n * - If `reCountAfterSpace = true`, it counts both characters within words and words per group.\n * @param {ChunkStringOptions} [options={}] - ***Optional settings for separator and counting behavior.***\n * @returns {string} Return the formatted string with separators.\n * @example\n * // Basic usage\n * chunkString(\"1234567890\", 3);\n * // ➔ \"123 456 789 0\"\n *\n * // Basic usage `reCountAfterSpace = false` (default)\n * chunkString(\"1234567890\", 3, { separator: \"-\");\n * // ➔ \"123-456-789-0\"\n * chunkString(\"HelloWorld\", 2, { separator: \"_\", reCountAfterSpace: false });\n * // ➔ \"He_ll_oW_or_ld\"\n *\n * // Usage with reCountAfterSpace = true:\n * // Multiple spaces are normalized to single spaces before processing.\n * chunkString(\"AB CD EF GH\", 2, { separator: \"-\", reCountAfterSpace: true });\n * // ➔ \"AB-CD EF-GH\" (after normalization to \"AB CD EF GH\")\n * // Words \"AB\" and \"CD\" form a group and are joined by \"-\", \"EF\" and \"GH\" form another group.\n * // The groups \"AB-CD\" and \"EF-GH\" are then joined by a space.\n *\n * // Another usage with reCountAfterSpace = true:\n * chunkString(\"ABC DEF GHI JKL\", 3, { separator: \"-\", reCountAfterSpace: true });\n * // ➔ \"ABC-DEF-GHI JKL\"\n * // Words \"ABC\", \"DEF\", \"GHI\" form a group and are joined by \"-\".\n * // The word \"JKL\" forms its own group (as it's the last word and completes no other group).\n * // The groups \"ABC-DEF-GHI\" and \"JKL\" are then joined by a space.\n */\nexport function chunkString(\n subject: string,\n limiter: number,\n options: ChunkStringOptions = {}\n): string {\n if (isNil(subject) || limiter <= 0) return subject;\n\n assertIsString(subject, {\n message: ({ currentType, validType }) =>\n `First parameter (\\`subject\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n if (!isInteger(limiter)) {\n throw new TypeError(\n `Second parameter (\\`limiter\\`) must be of type \\`integer-number\\`, but received: \\`${getPreciseType(\n limiter\n )}\\`, with value: \\`${safeStableStringify(limiter, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Third parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const separator = hasOwnProp(options, \"separator\") ? options.separator : \" \";\n const reCountAfterSpace = hasOwnProp(options, \"reCountAfterSpace\")\n ? options.reCountAfterSpace\n : false;\n\n assertIsString(separator, {\n message: ({ currentType, validType }) =>\n `Parameter \\`separator\\` property of the \\`options\\` (third parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n assertIsBoolean(reCountAfterSpace, {\n message: ({ currentType, validType }) =>\n `Parameter \\`reCountAfterSpace\\` property of the \\`options\\` (third parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n subject = normalizeSpaces(subject);\n\n // Handle reCountAfterSpace = false (assumed correct from previous iterations)\n if (!reCountAfterSpace) {\n let result = \"\";\n let currentCount = 0;\n\n for (let i = 0; i < subject.length; i++) {\n const char = subject[i];\n if (currentCount === limiter) {\n result += separator;\n currentCount = 0;\n }\n result += char;\n currentCount++;\n }\n return result;\n }\n\n // --- Dynamic Logic for reCountAfterSpace = true ---\n const words = subject.split(\" \"); // Split the string into individual words by spaces\n const finalSegments: string[] = [];\n\n let currentGroup: string[] = [];\n let wordsInCurrentGroupCount = 0; // This counts how many words are in the current group\n\n for (let i = 0; i < words.length; i++) {\n const word = words[i];\n\n // Check if the current word itself needs internal separators (e.g., \"HelloWorld\" with limiter 2)\n // For the given test cases (\"AB\", \"CD\", \"ABC\"), this inner loop doesn't add separators,\n // as the words themselves are shorter than or equal to the limiter.\n let processedWord = \"\";\n let charCountInWord = 0;\n for (let j = 0; j < word.length; j++) {\n processedWord += word[j];\n charCountInWord++;\n if (charCountInWord === limiter && j < word.length - 1) {\n processedWord += separator;\n charCountInWord = 0;\n }\n }\n\n currentGroup.push(processedWord);\n wordsInCurrentGroupCount++;\n\n // If the current group has reached the limiter (e.g., 2 words for limiter=2, or 3 words for limiter=3)\n // OR if it's the last word in the entire subject, finalize the group.\n if (wordsInCurrentGroupCount === limiter || i === words.length - 1) {\n finalSegments.push(currentGroup.join(separator)); // Join words within the group by separator\n currentGroup = []; // Reset group for the next set of words\n wordsInCurrentGroupCount = 0; // Reset group word count\n }\n }\n\n // Finally, join the main segments (groups) with spaces\n return finalSegments.join(\" \");\n}\n","import { isInteger } from \"@/predicates/is/isInteger\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isEmptyString } from \"@/predicates/is/isEmptyString\";\nimport { getPreciseType } from \"@/predicates/type/getPreciseType\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\nimport { safeStableStringify } from \"@/conversions/stringify/safeStableStringify\";\n\nimport { assertIsString } from \"@/assertions/strings/assertIsString\";\nimport { assertIsBoolean } from \"@/assertions/booleans/assertIsBoolean\";\nimport { assertIsPlainObject } from \"@/assertions/objects/assertIsPlainObject\";\n\ntype TruncateStringOptions = {\n /** ***Maximum length of the truncated string **(default: `10`)**.***\n *\n * @default 10\n */\n length?: number;\n\n /** ***String to append if truncation occurs.***\n *\n * - Will be trimmed first; defaults to `\"...\"` if empty.\n *\n * @default \"...\"\n */\n ending?: string;\n\n /** ***Whether to trim the input string before truncation ***(default: `true`)***.***\n *\n * @default true\n */\n trim?: boolean;\n};\n\n/** ----------------------------------------------------------\n * * ***Utility: `truncateString`.***\n * ----------------------------------------------------------\n * **Features:**\n * - Truncates a string to a specified length and optionally appends an ending.\n * - Supports trimming the input before truncation.\n * - If truncation occurs, trailing spaces before the ending are removed.\n * - The `ending` parameter is always trimmed first; if empty, it defaults to `\"...\"`.\n * @param {string|null|undefined} text\n * ***The input string to truncate, behavior:***\n * - If `null`, `undefined`, or empty after trim, returns `\"\"`.\n * @param {TruncateStringOptions} [options]\n * ***Optional settings:***\n * - `length` (number, default 10): Maximum length of the truncated string.\n * - `ending` (string, default `\"...\"`): String to append if truncation occurs.\n * - `trim` (boolean, default `true`): Whether to trim the input before truncation.\n * @returns {string} The truncated string with optional trimming and ending, returns `\"\"` if input is empty or length < 1.\n * @throws **{@link TypeError | `TypeError`}** if `options.length` is not a finite number, or if `options.ending` is not a string, or if `options.trim` is not a boolean.\n * @example\n * truncateString(\"hello world\", { length: 5 });\n * // ➔ \"hello...\"\n * truncateString(\"hello world\", { length: 5, ending: \"---\" });\n * // ➔ \"hello---\"\n * truncateString(\"hello world\", { length: 5, ending: \" \" });\n * // ➔ \"hello...\" (ending trimmed to default)\n * truncateString(\"hello world\", { length: 5, ending: \" !!! \" });\n * // ➔ \"hello!!!\" (ending trimmed)\n * truncateString(\" long data string \", { length: 8, ending: \"...\", trim: true });\n * // ➔ \"long dat...\"\n * truncateString(\" long data string \", { length: 8, ending: \"...\", trim: false });\n * // ➔ \" long ...\"\n * truncateString(null, { length: 5 });\n * // ➔ \"\"\n */\nexport const truncateString = (\n text: string | null | undefined,\n options: TruncateStringOptions = {}\n): string => {\n if (!isNonEmptyString(text)) return \"\";\n\n assertIsPlainObject(options, {\n message: ({ currentType, validType }) =>\n `Seconds parameter (\\`options\\`) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n const trim = hasOwnProp(options, \"trim\") ? options.trim : true;\n const length = hasOwnProp(options, \"length\") ? options.length : 10;\n let ending = hasOwnProp(options, \"ending\") ? options.ending : \"...\";\n\n if (!isInteger(length)) {\n throw new TypeError(\n `Parameter \\`length\\` property of the \\`options\\` (second parameter) must be of type \\`integer-number\\`, but received: \\`${getPreciseType(\n length\n )}\\`, with value: \\`${safeStableStringify(length, {\n keepUndefined: true\n })}\\`.`\n );\n }\n\n if (length < 1) return \"\";\n\n assertIsString(ending, {\n message: ({ currentType, validType }) =>\n `Parameter \\`ending\\` property of the \\`options\\` (second parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n assertIsBoolean(trim, {\n message: ({ currentType, validType }) =>\n `Parameter \\`trim\\` property of the \\`options\\` (second parameter) must be of type \\`${validType}\\`, but received: \\`${currentType}\\`.`\n });\n\n if (isEmptyString(ending)) {\n ending = \"...\";\n } else {\n ending = ending.trim();\n }\n\n const original = trim ? text.trim() : text;\n const originalTrimmedLength = original.length;\n\n if (originalTrimmedLength <= length) return original;\n\n const sliced = original.slice(0, length);\n const cleanSliced = trim ? sliced : sliced.trimEnd();\n\n return cleanSliced + ending;\n};\n","import type { FormatDateFnsOptions } from \"./_private/formatDateFns.types\";\n\nimport { id, enUS } from \"date-fns/locale\";\nimport { format as formatDns, parse } from \"date-fns\";\n\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { hasOwnProp } from \"@/predicates/has/hasOwnProp\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `formatDateFns`.***\n * ----------------------------------------------------------\n * **Formats a date into a human-readable string using `date-fns`.**\n * - **Features:**\n * - Supports custom output formats using `date-fns/format`.\n * - Can parse localized non-ISO strings via `inputFormat` & `inputLocale`.\n * - Supports `locale` as `\"id\"`, `\"en\"` or `date-fns` `Locale` objects (like `id` or `enUS`).\n * - Returns `null` if the date is invalid, not provided, or parsing fails.\n * @param {string | Date | null | undefined} date\n * ***The date input to format, can be:***\n * - A `Date` object.\n * - An ISO string (e.g. `\"2024-01-01T12:00:00Z\"`).\n * - A localized string (requires `inputFormat` + `inputLocale`).\n * @param {FormatDateFnsOptions} [options] ***Options for formatting and parsing.***\n * @param {FormatDateFnsOptions[\"format\"]} [options.format=\"dd MMM yyyy - HH:mm:ss\"]\n * ***The output format string (passed to `date-fns/format`), e.g:***\n * - `\"dd MMMM yyyy, HH:mm:ss\" ➔ \"14 Juli 2025, 17:25:42\"`.\n * @param {FormatDateFnsOptions[\"locale\"]} [options.locale=\"id\"]\n * The output locale. If string, only `\"id\"` (Indonesian) or `\"en\"` (English)\n * is recognized. Or you can pass a `date-fns` `Locale` object.\n * - Example:\n * ```ts\n * import { ar } from \"date-fns/locale\";\n * formatDateFns(new Date(), { locale: ar, format: \"PPPppp\" });\n * ```\n * @param {FormatDateFnsOptions[\"inputLocale\"]} [options.inputLocale]\n * Required if `date` is a localized non-ISO string. Used with `inputFormat`.\n * - Example for Indonesian string:\n * ```ts\n * formatDateFns(\"14 Juli 2025 10:25:42\", { inputFormat: \"dd MMMM yyyy HH:mm:ss\", inputLocale: \"id\" });\n * ```\n * @param {FormatDateFnsOptions[\"inputFormat\"]} [options.inputFormat]\n * The format string to parse `date` if it is a non-ISO string.\n * Required together with `inputLocale`.\n * @returns {string | null} A formatted date string or `null` if input is invalid.\n * @example\n * formatDateFns(new Date());\n * // ➔ \"14 Jul 2025 - 17:25:42\"\n * formatDateFns(\"2025-07-14T10:25:42Z\", { format: \"dd/MM/yyyy\", locale: \"en\" });\n * // ➔ \"14/07/2025\"\n * formatDateFns(\"14 Juli 2025 10:25:42\", {\n * inputFormat: \"dd MMMM yyyy HH:mm:ss\",\n * inputLocale: \"id\",\n * format: \"yyyy-MM-dd\"\n * });\n * // ➔ \"2025-07-14\"\n * formatDateFns(null);\n * // ➔ null\n */\nexport const formatDateFns = (\n date: string | Date | null | undefined,\n options: FormatDateFnsOptions = {}\n): string | null => {\n if (isNil(date) || !(isDate(date) || isNonEmptyString(date))) return null;\n\n // Ensure options is an object and Defensive options check\n if (!isPlainObject(options)) {\n options = {};\n }\n\n const {\n inputFormat,\n locale = \"en\",\n inputLocale = \"en\",\n ...restOptions\n } = options;\n\n const format =\n hasOwnProp(options, \"format\") && isNonEmptyString(options.format)\n ? options.format\n : \"dd MMM yyyy - HH:mm:ss\";\n\n let parsedDate: Date;\n\n try {\n if (isNonEmptyString(date) && inputFormat && inputLocale) {\n const valueOfInputLocale = isNonEmptyString(inputLocale)\n ? inputLocale === \"id\"\n ? id\n : enUS\n : inputLocale;\n\n parsedDate = parse(date, inputFormat, new Date(), {\n locale: valueOfInputLocale\n });\n } else {\n parsedDate = new Date(date);\n }\n\n if (isNaN(parsedDate.getTime())) return null;\n\n const valueOfLocale = isNonEmptyString(locale)\n ? locale === \"id\"\n ? id\n : enUS\n : locale;\n\n return formatDns(parsedDate, format, {\n ...restOptions,\n locale: valueOfLocale\n });\n } catch {\n return null;\n }\n};\n","import type { FormatDateIntlOptions } from \"./_private/formatDateIntl.types\";\n\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { isPlainObject } from \"@/predicates/is/isPlainObject\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `formatDateIntl`.***\n * ----------------------------------------------------------\n * **Formats a date using the `Intl.DateTimeFormat` API.**\n * - **Features:**\n * - Supports custom locales (type-safe `SupportedLocales`).\n * - Accepts additional `Intl.DateTimeFormatOptions` like `timeZone`, `hour12`, etc.\n * - Defaults to `\"en-US\"` if `locale` is not provided or is an empty string.\n * - Returns `null` if the date is invalid, not provided, or options are invalid.\n * @param {string | Date | null | undefined} date\n * ***The date to format.***\n * - Can be a `Date` object or an ISO string.\n * - If invalid or not provided, returns `null`.\n * @param {FormatDateIntlOptions} [options] ***Optional formatting options for `Intl.DateTimeFormat`, use `locale` to specify the language & region format.***\n * @returns {string | null}\n * - Formatted date string.\n * - Returns `null` if date is invalid or options are of wrong type.\n * @example\n * formatDateIntl(new Date());\n * // ➔ \"7/14/2025\"\n * formatDateIntl(\"2025-07-14T00:00:00Z\", { locale: \"fr-FR\", dateStyle: \"long\" });\n * // ➔ \"14 juillet 2025\"\n * formatDateIntl(null);\n * // ➔ null\n * formatDateIntl(new Date(), { timeZone: \"UTC\", hour: \"2-digit\", minute: \"2-digit\" });\n * // ➔ \"01:30 AM\"\n */\nexport const formatDateIntl = (\n date: string | Date | null | undefined,\n options?: FormatDateIntlOptions\n): string | null => {\n if (isNil(date) || !(isDate(date) || isNonEmptyString(date))) return null;\n\n const parsedDate = new Date(date);\n if (isNaN(parsedDate.getTime())) return null; // Handle invalid dates\n\n // Ensure options is an object and Defensive options check\n if (!isPlainObject(options)) {\n options = {};\n }\n\n const { locale = \"en-US\", ...restProps } = options;\n\n try {\n return new Intl.DateTimeFormat(\n isNonEmptyString(locale) ? locale.trim() : \"en-US\",\n restProps\n ).format(parsedDate);\n } catch {\n return null;\n }\n};\n","import { isNaN } from \"@/predicates/is/isNaN\";\nimport { isNil } from \"@/predicates/is/isNil\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `formatDateTime`.***\n * ----------------------------------------------------------\n * **Formats a date and time into a custom string format.**\n * - **Features:**\n * - Supports only `YYYY`, `MM`, `DD`, `hh`, `mm`, and `ss` as placeholders.\n * - Uses a simple string replace (no locale).\n * - Returns `null` if the date is invalid or not provided.\n * - Defaults to `\"YYYY-MM-DD hh:mm:ss\"` format if none is specified.\n * @param {string | Date | null| undefined} date - The date to format.\n * @param {string} [format=\"YYYY-MM-DD hh:mm:ss\"] - The desired date format, if format is `null` or `undefined` will force to defaultValue, defaultValue is: `\"YYYY-MM-DD hh:mm:ss\"`.\n * @returns {string | null} The formatted date string or `null` if invalid.\n * @example\n * formatDateTime(new Date());\n * // ➔ \"2024-02-09 14:30:45\" (example output with current time)\n * formatDateTime(\"2023-07-01T14:30:45\");\n * // ➔ \"2023-07-01 14:30:45\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"DD/MM/YYYY\");\n * // ➔ \"01/07/2023\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"YYYY/MM/DD hh-mm-ss\");\n * // ➔ \"2023/07/01 14-30-45\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"hh:mm\");\n * // ➔ \"14:30\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"DATE: YYYY.MM.DD\");\n * // ➔ \"DATE: 2023.07.01\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"Year: YYYY, Time: hh:mm:ss\");\n * // ➔ \"Year: 2023, Time: 14:30:45\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"YYYY-MM\");\n * // ➔ \"2023-07\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"YYYYYYYY\");\n * // ➔ \"20232023\"\n * formatDateTime(\"2023-07-01T14:30:45\", \"hh:mm:ss:ss\");\n * // ➔ \"14:30:45:45\"\n * formatDateTime(\"invalid-date\");\n * // ➔ null\n * formatDateTime(null);\n * // ➔ null\n * formatDateTime(undefined);\n * // ➔ null\n */\nexport const formatDateTime = (\n date: string | Date | null | undefined,\n format?: string\n): string | null => {\n if (isNil(format)) {\n format = \"YYYY-MM-DD hh:mm:ss\";\n }\n\n if (!isString(format)) return null;\n\n // Handle missing or invalid date input type\n if (isNil(date) || !(isDate(date) || isNonEmptyString(date))) {\n return null;\n }\n\n try {\n const parsedDate = new Date(date);\n if (isNaN(parsedDate.getTime())) return null; // Handle invalid dates\n\n const pad2 = (n: number) => n.toString().padStart(2, \"0\");\n\n const map: Record<string, string> = {\n YYYY: parsedDate.getFullYear().toString(),\n MM: pad2(parsedDate.getMonth() + 1),\n DD: pad2(parsedDate.getDate()),\n hh: pad2(parsedDate.getHours()),\n mm: pad2(parsedDate.getMinutes()),\n ss: pad2(parsedDate.getSeconds())\n };\n\n const result = Object.entries(map).reduce(\n (prev, [key, value]) => prev.split(key).join(value),\n format\n );\n\n return !result.includes(\"NaN\") ? result : null;\n } catch {\n return null;\n }\n};\n","import { isNil } from \"@/predicates/is/isNil\";\nimport { isNaN } from \"@/predicates/is/isNaN\";\nimport { isDate } from \"@/predicates/is/isDate\";\nimport { isString } from \"@/predicates/is/isString\";\nimport { isEmptyString } from \"@/predicates/is/isEmptyString\";\nimport { isNonEmptyString } from \"@/predicates/is/isNonEmptyString\";\n\n/** ----------------------------------------------------------\n * * ***Utility: `getGMTOffset`.***\n * ----------------------------------------------------------\n * **Returns the formatted GMT offset (e.g., `+0700`, `-0500`) for a given date.**\n * - **Features:**\n * - If `date` is **not provided** or empty string, it defaults to the current date/time.\n * - If `date` is **invalid** or of wrong type (like object or number), it returns `\"0\"`.\n * - The returned string follows the **GMT offset format** (`±HHMM`), where:\n * - `±` is `+` if ahead of UTC, `-` if behind.\n * - `HH` is two-digit hours.\n * - `MM` is two-digit minutes.\n * @param {string | Date | null} [date]\n * ***The date to get the GMT offset from.***\n * - Accepts `Date` object or ISO date string (e.g., `\"2024-01-01T12:00:00Z\"`).\n * - If `null`, `undefined`, or empty string, uses current system date.\n * - If invalid date or wrong type (like `123` or `{}`), returns `\"0\"`.\n * @returns {string} The GMT offset string in format `±HHMM`,\n * e.g. `\"+0700\"`, `\"-0530\"`, or `\"0\"` if invalid.\n * @example\n * getGMTOffset();\n * // ➔ \"+0700\" (depends on your system timezone)\n * getGMTOffset(new Date(\"2024-02-09T12:00:00Z\"));\n * // ➔ \"+0000\"\n * getGMTOffset(\"2024-02-09\");\n * // ➔ \"+0700\" (depends on your system timezone)\n * getGMTOffset(\"invalid-date\");\n * // ➔ \"0\"\n * getGMTOffset(123);\n * // ➔ \"0\"\n */\nexport const getGMTOffset = (date?: string | Date | null): string => {\n try {\n if (isNil(date) || (isString(date) && isEmptyString(date))) {\n date = new Date(); // Default to current date\n } else if (!(isDate(date) || isNonEmptyString(date))) {\n return \"0\"; // Invalid type\n }\n\n const parsedDate = new Date(date);\n if (isNaN(parsedDate.getTime())) return \"0\"; // Handle invalid dates\n\n const padZero = (num: number) => num.toString().padStart(2, \"0\");\n\n let offset = parsedDate.getTimezoneOffset();\n const sign = offset < 0 ? \"+\" : \"-\";\n offset = Math.abs(offset);\n\n return `${sign}${padZero(Math.floor(offset / 60))}${padZero(offset % 60)}`;\n } catch {\n return \"0\";\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,sBAAsB,EAC1B,QACA,gBAII;CACJ,MAAM,YAAY,QAAQ,MAAM,GAAG;CACnC,MAAM,OAA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