@rpcbase/ui 0.229.0 → 0.231.0

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 (733) hide show
  1. package/dist/components/PhoneNumberInput/index.d.ts.map +1 -1
  2. package/dist/index100.js +4 -11
  3. package/dist/index100.js.map +1 -1
  4. package/dist/index101.js +8 -68
  5. package/dist/index101.js.map +1 -1
  6. package/dist/index102.js +6 -38
  7. package/dist/index102.js.map +1 -1
  8. package/dist/index103.js +5 -14
  9. package/dist/index103.js.map +1 -1
  10. package/dist/index104.js +4 -23
  11. package/dist/index104.js.map +1 -1
  12. package/dist/index105.js +6 -110
  13. package/dist/index105.js.map +1 -1
  14. package/dist/index106.js +146 -13
  15. package/dist/index106.js.map +1 -1
  16. package/dist/index107.js +39 -4
  17. package/dist/index107.js.map +1 -1
  18. package/dist/index108.js +5 -4
  19. package/dist/index108.js.map +1 -1
  20. package/dist/index109.js +8 -5
  21. package/dist/index109.js.map +1 -1
  22. package/dist/index110.js +13 -11
  23. package/dist/index110.js.map +1 -1
  24. package/dist/index111.js +13 -19
  25. package/dist/index111.js.map +1 -1
  26. package/dist/index112.js +8 -13
  27. package/dist/index112.js.map +1 -1
  28. package/dist/index113.js +31 -261
  29. package/dist/index113.js.map +1 -1
  30. package/dist/index114.js +10 -4
  31. package/dist/index114.js.map +1 -1
  32. package/dist/index115.js +11 -28
  33. package/dist/index115.js.map +1 -1
  34. package/dist/index116.js +8 -126
  35. package/dist/index116.js.map +1 -1
  36. package/dist/index117.js +13 -5
  37. package/dist/index117.js.map +1 -1
  38. package/dist/index118.js +101 -78
  39. package/dist/index118.js.map +1 -1
  40. package/dist/index119.js +20 -67
  41. package/dist/index119.js.map +1 -1
  42. package/dist/index120.js +53 -8
  43. package/dist/index120.js.map +1 -1
  44. package/dist/index121.js +73 -16
  45. package/dist/index121.js.map +1 -1
  46. package/dist/index122.js +9 -92
  47. package/dist/index122.js.map +1 -1
  48. package/dist/index123.js +17 -62
  49. package/dist/index123.js.map +1 -1
  50. package/dist/index124.js +15 -44
  51. package/dist/index124.js.map +1 -1
  52. package/dist/index125.js +24 -52
  53. package/dist/index125.js.map +1 -1
  54. package/dist/index126.js +6 -4
  55. package/dist/index126.js.map +1 -1
  56. package/dist/index127.js +5 -4
  57. package/dist/index127.js.map +1 -1
  58. package/dist/index128.js +23 -15
  59. package/dist/index128.js.map +1 -1
  60. package/dist/index129.js +35 -6
  61. package/dist/index129.js.map +1 -1
  62. package/dist/index130.js +16 -8
  63. package/dist/index130.js.map +1 -1
  64. package/dist/index131.js +6 -16
  65. package/dist/index131.js.map +1 -1
  66. package/dist/index132.js +4 -4
  67. package/dist/index132.js.map +1 -1
  68. package/dist/index133.js +4 -4
  69. package/dist/index133.js.map +1 -1
  70. package/dist/index134.js +4 -5
  71. package/dist/index134.js.map +1 -1
  72. package/dist/index135.js +4 -5
  73. package/dist/index135.js.map +1 -1
  74. package/dist/index136.js +3 -4
  75. package/dist/index136.js.map +1 -1
  76. package/dist/index137.js +6 -4
  77. package/dist/index137.js.map +1 -1
  78. package/dist/index138.js +24 -7
  79. package/dist/index138.js.map +1 -1
  80. package/dist/index139.js +7 -24
  81. package/dist/index139.js.map +1 -1
  82. package/dist/index140.js +6 -6
  83. package/dist/index140.js.map +1 -1
  84. package/dist/index141.js +5 -4
  85. package/dist/index141.js.map +1 -1
  86. package/dist/index142.js +3 -6
  87. package/dist/index142.js.map +1 -1
  88. package/dist/index143.js +3 -5
  89. package/dist/index143.js.map +1 -1
  90. package/dist/index144.js +4 -4
  91. package/dist/index144.js.map +1 -1
  92. package/dist/index145.js +3 -5
  93. package/dist/index145.js.map +1 -1
  94. package/dist/index146.js +4 -4
  95. package/dist/index146.js.map +1 -1
  96. package/dist/index147.js +3 -8
  97. package/dist/index147.js.map +1 -1
  98. package/dist/index148.js +3 -5
  99. package/dist/index148.js.map +1 -1
  100. package/dist/index149.js +3 -4
  101. package/dist/index149.js.map +1 -1
  102. package/dist/index150.js +5 -4
  103. package/dist/index150.js.map +1 -1
  104. package/dist/index151.js +68 -6
  105. package/dist/index151.js.map +1 -1
  106. package/dist/index152.js +2 -146
  107. package/dist/index152.js.map +1 -1
  108. package/dist/index153.js +362 -38
  109. package/dist/index153.js.map +1 -1
  110. package/dist/index154.js +261 -4
  111. package/dist/index154.js.map +1 -1
  112. package/dist/index155.js +60 -7
  113. package/dist/index155.js.map +1 -1
  114. package/dist/index156.js +46 -13
  115. package/dist/index156.js.map +1 -1
  116. package/dist/index157.js +169 -13
  117. package/dist/index157.js.map +1 -1
  118. package/dist/index158.js +109 -7
  119. package/dist/index158.js.map +1 -1
  120. package/dist/index159.js +24 -31
  121. package/dist/index159.js.map +1 -1
  122. package/dist/index160.js +8 -11
  123. package/dist/index160.js.map +1 -1
  124. package/dist/index161.js +4 -10
  125. package/dist/index161.js.map +1 -1
  126. package/dist/index162.js +5 -8
  127. package/dist/index162.js.map +1 -1
  128. package/dist/index163.js +4 -13
  129. package/dist/index163.js.map +1 -1
  130. package/dist/index164.js +465 -100
  131. package/dist/index164.js.map +1 -1
  132. package/dist/index165.js +186 -20
  133. package/dist/index165.js.map +1 -1
  134. package/dist/index166.js +107 -53
  135. package/dist/index166.js.map +1 -1
  136. package/dist/index167.js +261 -71
  137. package/dist/index167.js.map +1 -1
  138. package/dist/index168.js +9 -9
  139. package/dist/index168.js.map +1 -1
  140. package/dist/index169.js +42 -20
  141. package/dist/index169.js.map +1 -1
  142. package/dist/index170.js +4 -16
  143. package/dist/index170.js.map +1 -1
  144. package/dist/index171.js +11 -23
  145. package/dist/index171.js.map +1 -1
  146. package/dist/index172.js +68 -6
  147. package/dist/index172.js.map +1 -1
  148. package/dist/index173.js +38 -6
  149. package/dist/index173.js.map +1 -1
  150. package/dist/index174.js +14 -24
  151. package/dist/index174.js.map +1 -1
  152. package/dist/index175.js +21 -32
  153. package/dist/index175.js.map +1 -1
  154. package/dist/index176.js +111 -16
  155. package/dist/index176.js.map +1 -1
  156. package/dist/index177.js +13 -7
  157. package/dist/index177.js.map +1 -1
  158. package/dist/index178.js +4 -4
  159. package/dist/index178.js.map +1 -1
  160. package/dist/index179.js +4 -5
  161. package/dist/index179.js.map +1 -1
  162. package/dist/index18.js +247 -240
  163. package/dist/index18.js.map +1 -1
  164. package/dist/index180.js +5 -5
  165. package/dist/index180.js.map +1 -1
  166. package/dist/index181.js +11 -4
  167. package/dist/index181.js.map +1 -1
  168. package/dist/index182.js +19 -3
  169. package/dist/index182.js.map +1 -1
  170. package/dist/index183.js +13 -7
  171. package/dist/index183.js.map +1 -1
  172. package/dist/index184.js +262 -24
  173. package/dist/index184.js.map +1 -1
  174. package/dist/index185.js +4 -7
  175. package/dist/index185.js.map +1 -1
  176. package/dist/index186.js +28 -7
  177. package/dist/index186.js.map +1 -1
  178. package/dist/index187.js +126 -5
  179. package/dist/index187.js.map +1 -1
  180. package/dist/index188.js +5 -3
  181. package/dist/index188.js.map +1 -1
  182. package/dist/index189.js +78 -3
  183. package/dist/index189.js.map +1 -1
  184. package/dist/index190.js +66 -4
  185. package/dist/index190.js.map +1 -1
  186. package/dist/index191.js +8 -3
  187. package/dist/index191.js.map +1 -1
  188. package/dist/index192.js +16 -5
  189. package/dist/index192.js.map +1 -1
  190. package/dist/index193.js +92 -3
  191. package/dist/index193.js.map +1 -1
  192. package/dist/index194.js +65 -3
  193. package/dist/index194.js.map +1 -1
  194. package/dist/index195.js +45 -3
  195. package/dist/index195.js.map +1 -1
  196. package/dist/index196.js +58 -13
  197. package/dist/index196.js.map +1 -1
  198. package/dist/index197.js +8 -154
  199. package/dist/index197.js.map +1 -1
  200. package/dist/index198.js +64 -28
  201. package/dist/index198.js.map +1 -1
  202. package/dist/index199.js +19 -9
  203. package/dist/index199.js.map +1 -1
  204. package/dist/index200.js +14 -46
  205. package/dist/index200.js.map +1 -1
  206. package/dist/index201.js +5 -11
  207. package/dist/index201.js.map +1 -1
  208. package/dist/index202.js +4 -43
  209. package/dist/index202.js.map +1 -1
  210. package/dist/index203.js +6 -95
  211. package/dist/index203.js.map +1 -1
  212. package/dist/index204.js +4 -86
  213. package/dist/index204.js.map +1 -1
  214. package/dist/index205.js +6 -105
  215. package/dist/index205.js.map +1 -1
  216. package/dist/index206.js +16 -52
  217. package/dist/index206.js.map +1 -1
  218. package/dist/index207.js +4 -11
  219. package/dist/index207.js.map +1 -1
  220. package/dist/index208.js +4 -37
  221. package/dist/index208.js.map +1 -1
  222. package/dist/index209.js +12 -8
  223. package/dist/index209.js.map +1 -1
  224. package/dist/index210.js +9 -3
  225. package/dist/index210.js.map +1 -1
  226. package/dist/index211.js +13 -9
  227. package/dist/index211.js.map +1 -1
  228. package/dist/index212.js +13 -116
  229. package/dist/index212.js.map +1 -1
  230. package/dist/index213.js +4 -17
  231. package/dist/index213.js.map +1 -1
  232. package/dist/index214.js +5 -15
  233. package/dist/index214.js.map +1 -1
  234. package/dist/index215.js +6 -36
  235. package/dist/index215.js.map +1 -1
  236. package/dist/index216.js +5 -20
  237. package/dist/index216.js.map +1 -1
  238. package/dist/index217.js +54 -8
  239. package/dist/index217.js.map +1 -1
  240. package/dist/index218.js +8 -19
  241. package/dist/index218.js.map +1 -1
  242. package/dist/index219.js +4 -28
  243. package/dist/index219.js.map +1 -1
  244. package/dist/index220.js +4 -16
  245. package/dist/index220.js.map +1 -1
  246. package/dist/index221.js +9 -20
  247. package/dist/index221.js.map +1 -1
  248. package/dist/index222.js +4 -66
  249. package/dist/index222.js.map +1 -1
  250. package/dist/index223.js +4 -6
  251. package/dist/index223.js.map +1 -1
  252. package/dist/index224.js +3 -11
  253. package/dist/index224.js.map +1 -1
  254. package/dist/index225.js +10 -50
  255. package/dist/index225.js.map +1 -1
  256. package/dist/index226.js +10 -4
  257. package/dist/index226.js.map +1 -1
  258. package/dist/index227.js +9 -29
  259. package/dist/index227.js.map +1 -1
  260. package/dist/index228.js +10 -16
  261. package/dist/index228.js.map +1 -1
  262. package/dist/index229.js +10 -5
  263. package/dist/index229.js.map +1 -1
  264. package/dist/index230.js +9 -21
  265. package/dist/index230.js.map +1 -1
  266. package/dist/index231.js +6 -51
  267. package/dist/index231.js.map +1 -1
  268. package/dist/index232.js +5 -25
  269. package/dist/index232.js.map +1 -1
  270. package/dist/index233.js +4 -41
  271. package/dist/index233.js.map +1 -1
  272. package/dist/index234.js +5 -39
  273. package/dist/index234.js.map +1 -1
  274. package/dist/index235.js +7 -45
  275. package/dist/index235.js.map +1 -1
  276. package/dist/index236.js +5 -20
  277. package/dist/index236.js.map +1 -1
  278. package/dist/index237.js +13 -67
  279. package/dist/index237.js.map +1 -1
  280. package/dist/index238.js +7 -17
  281. package/dist/index238.js.map +1 -1
  282. package/dist/index239.js +10 -11
  283. package/dist/index239.js.map +1 -1
  284. package/dist/index240.js +10 -27
  285. package/dist/index240.js.map +1 -1
  286. package/dist/index241.js +21 -13
  287. package/dist/index241.js.map +1 -1
  288. package/dist/index242.js +10 -18
  289. package/dist/index242.js.map +1 -1
  290. package/dist/index243.js +9 -36
  291. package/dist/index243.js.map +1 -1
  292. package/dist/index244.js +9 -262
  293. package/dist/index244.js.map +1 -1
  294. package/dist/index245.js +4 -278
  295. package/dist/index245.js.map +1 -1
  296. package/dist/index246.js +5 -68
  297. package/dist/index246.js.map +1 -1
  298. package/dist/index247.js +15 -98
  299. package/dist/index247.js.map +1 -1
  300. package/dist/index248.js +9 -83
  301. package/dist/index248.js.map +1 -1
  302. package/dist/index249.js +18 -3
  303. package/dist/index249.js.map +1 -1
  304. package/dist/index250.js +14 -28
  305. package/dist/index250.js.map +1 -1
  306. package/dist/index251.js +12 -16
  307. package/dist/index251.js.map +1 -1
  308. package/dist/index252.js +29 -34
  309. package/dist/index252.js.map +1 -1
  310. package/dist/index253.js +12 -16
  311. package/dist/index253.js.map +1 -1
  312. package/dist/index254.js +25 -3
  313. package/dist/index254.js.map +1 -1
  314. package/dist/index255.js +5 -26
  315. package/dist/index255.js.map +1 -1
  316. package/dist/index256.js +20 -29
  317. package/dist/index256.js.map +1 -1
  318. package/dist/index257.js +67 -4
  319. package/dist/index257.js.map +1 -1
  320. package/dist/index258.js +6 -78
  321. package/dist/index258.js.map +1 -1
  322. package/dist/index259.js +10 -268
  323. package/dist/index259.js.map +1 -1
  324. package/dist/index260.js +50 -11
  325. package/dist/index260.js.map +1 -1
  326. package/dist/index261.js +4 -11
  327. package/dist/index261.js.map +1 -1
  328. package/dist/index262.js +28 -24
  329. package/dist/index262.js.map +1 -1
  330. package/dist/index263.js +15 -15
  331. package/dist/index263.js.map +1 -1
  332. package/dist/index264.js +5 -125
  333. package/dist/index264.js.map +1 -1
  334. package/dist/index265.js +21 -5
  335. package/dist/index265.js.map +1 -1
  336. package/dist/index266.js +51 -40
  337. package/dist/index266.js.map +1 -1
  338. package/dist/index267.js +25 -65
  339. package/dist/index267.js.map +1 -1
  340. package/dist/index268.js +42 -14
  341. package/dist/index268.js.map +1 -1
  342. package/dist/index269.js +39 -7
  343. package/dist/index269.js.map +1 -1
  344. package/dist/index270.js +45 -6
  345. package/dist/index270.js.map +1 -1
  346. package/dist/index271.js +20 -3
  347. package/dist/index271.js.map +1 -1
  348. package/dist/index272.js +70 -10
  349. package/dist/index272.js.map +1 -1
  350. package/dist/index273.js +17 -7
  351. package/dist/index273.js.map +1 -1
  352. package/dist/index274.js +11 -133
  353. package/dist/index274.js.map +1 -1
  354. package/dist/index275.js +24 -396
  355. package/dist/index275.js.map +1 -1
  356. package/dist/index276.js +13 -52
  357. package/dist/index276.js.map +1 -1
  358. package/dist/index277.js +18 -11
  359. package/dist/index277.js.map +1 -1
  360. package/dist/index278.js +36 -11
  361. package/dist/index278.js.map +1 -1
  362. package/dist/index279.js +262 -8
  363. package/dist/index279.js.map +1 -1
  364. package/dist/index280.js +276 -9
  365. package/dist/index280.js.map +1 -1
  366. package/dist/index281.js +68 -8
  367. package/dist/index281.js.map +1 -1
  368. package/dist/index282.js +97 -11
  369. package/dist/index282.js.map +1 -1
  370. package/dist/index283.js +83 -3
  371. package/dist/index283.js.map +1 -1
  372. package/dist/index284.js +3 -3
  373. package/dist/index284.js.map +1 -1
  374. package/dist/index285.js +28 -16
  375. package/dist/index285.js.map +1 -1
  376. package/dist/index286.js +16 -51
  377. package/dist/index286.js.map +1 -1
  378. package/dist/index287.js +35 -6
  379. package/dist/index287.js.map +1 -1
  380. package/dist/index288.js +15 -121
  381. package/dist/index288.js.map +1 -1
  382. package/dist/index289.js +3 -32
  383. package/dist/index289.js.map +1 -1
  384. package/dist/index290.js +26 -73
  385. package/dist/index290.js.map +1 -1
  386. package/dist/index291.js +26 -140
  387. package/dist/index291.js.map +1 -1
  388. package/dist/index292.js +4 -62
  389. package/dist/index292.js.map +1 -1
  390. package/dist/index293.js +78 -49
  391. package/dist/index293.js.map +1 -1
  392. package/dist/index294.js +270 -15
  393. package/dist/index294.js.map +1 -1
  394. package/dist/index295.js +11 -8
  395. package/dist/index295.js.map +1 -1
  396. package/dist/index296.js +10 -4
  397. package/dist/index296.js.map +1 -1
  398. package/dist/index297.js +25 -11
  399. package/dist/index297.js.map +1 -1
  400. package/dist/index298.js +16 -21
  401. package/dist/index298.js.map +1 -1
  402. package/dist/index299.js +124 -57
  403. package/dist/index299.js.map +1 -1
  404. package/dist/index300.js +5 -8
  405. package/dist/index300.js.map +1 -1
  406. package/dist/index301.js +38 -64
  407. package/dist/index301.js.map +1 -1
  408. package/dist/index302.js +63 -17
  409. package/dist/index302.js.map +1 -1
  410. package/dist/index303.js +13 -16
  411. package/dist/index303.js.map +1 -1
  412. package/dist/index304.js +7 -5
  413. package/dist/index304.js.map +1 -1
  414. package/dist/index305.js +5 -5
  415. package/dist/index305.js.map +1 -1
  416. package/dist/index306.js +3 -6
  417. package/dist/index306.js.map +1 -1
  418. package/dist/index307.js +10 -4
  419. package/dist/index307.js.map +1 -1
  420. package/dist/index308.js +7 -6
  421. package/dist/index308.js.map +1 -1
  422. package/dist/index309.js +132 -15
  423. package/dist/index309.js.map +1 -1
  424. package/dist/index31.js +24 -24
  425. package/dist/index310.js +399 -4
  426. package/dist/index310.js.map +1 -1
  427. package/dist/index311.js +52 -4
  428. package/dist/index311.js.map +1 -1
  429. package/dist/index312.js +11 -12
  430. package/dist/index312.js.map +1 -1
  431. package/dist/index313.js +11 -9
  432. package/dist/index313.js.map +1 -1
  433. package/dist/index314.js +13 -13
  434. package/dist/index314.js.map +1 -1
  435. package/dist/index315.js +154 -13
  436. package/dist/index315.js.map +1 -1
  437. package/dist/index316.js +30 -4
  438. package/dist/index316.js.map +1 -1
  439. package/dist/index317.js +9 -5
  440. package/dist/index317.js.map +1 -1
  441. package/dist/index318.js +48 -6
  442. package/dist/index318.js.map +1 -1
  443. package/dist/index319.js +11 -5
  444. package/dist/index319.js.map +1 -1
  445. package/dist/index32.js +3 -3
  446. package/dist/index320.js +43 -53
  447. package/dist/index320.js.map +1 -1
  448. package/dist/index321.js +95 -8
  449. package/dist/index321.js.map +1 -1
  450. package/dist/index322.js +86 -4
  451. package/dist/index322.js.map +1 -1
  452. package/dist/index323.js +105 -4
  453. package/dist/index323.js.map +1 -1
  454. package/dist/index324.js +52 -8
  455. package/dist/index324.js.map +1 -1
  456. package/dist/index325.js +11 -4
  457. package/dist/index325.js.map +1 -1
  458. package/dist/index326.js +37 -4
  459. package/dist/index326.js.map +1 -1
  460. package/dist/index327.js +8 -3
  461. package/dist/index327.js.map +1 -1
  462. package/dist/index328.js +3 -10
  463. package/dist/index328.js.map +1 -1
  464. package/dist/index329.js +9 -9
  465. package/dist/index329.js.map +1 -1
  466. package/dist/index330.js +116 -9
  467. package/dist/index330.js.map +1 -1
  468. package/dist/index331.js +17 -10
  469. package/dist/index331.js.map +1 -1
  470. package/dist/index332.js +15 -10
  471. package/dist/index332.js.map +1 -1
  472. package/dist/index333.js +36 -9
  473. package/dist/index333.js.map +1 -1
  474. package/dist/index334.js +20 -6
  475. package/dist/index334.js.map +1 -1
  476. package/dist/index335.js +8 -5
  477. package/dist/index335.js.map +1 -1
  478. package/dist/index336.js +19 -4
  479. package/dist/index336.js.map +1 -1
  480. package/dist/index337.js +28 -5
  481. package/dist/index337.js.map +1 -1
  482. package/dist/index338.js +16 -6
  483. package/dist/index338.js.map +1 -1
  484. package/dist/index339.js +8 -5
  485. package/dist/index339.js.map +1 -1
  486. package/dist/index34.js +4 -4
  487. package/dist/index340.js +11 -16
  488. package/dist/index340.js.map +1 -1
  489. package/dist/index341.js +8 -7
  490. package/dist/index341.js.map +1 -1
  491. package/dist/index342.js +12 -9
  492. package/dist/index342.js.map +1 -1
  493. package/dist/index343.js +3 -10
  494. package/dist/index343.js.map +1 -1
  495. package/dist/index344.js +3 -21
  496. package/dist/index344.js.map +1 -1
  497. package/dist/index345.js +17 -10
  498. package/dist/index345.js.map +1 -1
  499. package/dist/index346.js +51 -9
  500. package/dist/index346.js.map +1 -1
  501. package/dist/index347.js +5 -9
  502. package/dist/index347.js.map +1 -1
  503. package/dist/index348.js +122 -4
  504. package/dist/index348.js.map +1 -1
  505. package/dist/index349.js +32 -5
  506. package/dist/index349.js.map +1 -1
  507. package/dist/index35.js +5 -5
  508. package/dist/index350.js +73 -16
  509. package/dist/index350.js.map +1 -1
  510. package/dist/index351.js +142 -9
  511. package/dist/index351.js.map +1 -1
  512. package/dist/index352.js +61 -18
  513. package/dist/index352.js.map +1 -1
  514. package/dist/index353.js +47 -13
  515. package/dist/index353.js.map +1 -1
  516. package/dist/index354.js +15 -13
  517. package/dist/index354.js.map +1 -1
  518. package/dist/index355.js +7 -28
  519. package/dist/index355.js.map +1 -1
  520. package/dist/index356.js +5 -13
  521. package/dist/index356.js.map +1 -1
  522. package/dist/index357.js +11 -25
  523. package/dist/index357.js.map +1 -1
  524. package/dist/index358.js +21 -5
  525. package/dist/index358.js.map +1 -1
  526. package/dist/index359.js +4 -20
  527. package/dist/index359.js.map +1 -1
  528. package/dist/index36.js +10 -10
  529. package/dist/index360.js +18 -4
  530. package/dist/index360.js.map +1 -1
  531. package/dist/index361.js +12 -11
  532. package/dist/index361.js.map +1 -1
  533. package/dist/index362.js +4 -17
  534. package/dist/index362.js.map +1 -1
  535. package/dist/index363.js +11 -5
  536. package/dist/index363.js.map +1 -1
  537. package/dist/index364.js +15 -19
  538. package/dist/index364.js.map +1 -1
  539. package/dist/index365.js +6 -45
  540. package/dist/index365.js.map +1 -1
  541. package/dist/index366.js +20 -17
  542. package/dist/index366.js.map +1 -1
  543. package/dist/index367.js +45 -5
  544. package/dist/index367.js.map +1 -1
  545. package/dist/index368.js +15 -198
  546. package/dist/index368.js.map +1 -1
  547. package/dist/index369.js +5 -78
  548. package/dist/index369.js.map +1 -1
  549. package/dist/index37.js +3 -3
  550. package/dist/index370.js +199 -7
  551. package/dist/index370.js.map +1 -1
  552. package/dist/index371.js +78 -26
  553. package/dist/index371.js.map +1 -1
  554. package/dist/index372.js +19 -25
  555. package/dist/index372.js.map +1 -1
  556. package/dist/index373.js +8 -137
  557. package/dist/index373.js.map +1 -1
  558. package/dist/index374.js +26 -13
  559. package/dist/index374.js.map +1 -1
  560. package/dist/index375.js +21 -221
  561. package/dist/index375.js.map +1 -1
  562. package/dist/index376.js +137 -3
  563. package/dist/index376.js.map +1 -1
  564. package/dist/index377.js +12 -19
  565. package/dist/index377.js.map +1 -1
  566. package/dist/index378.js +221 -72
  567. package/dist/index378.js.map +1 -1
  568. package/dist/index379.js +4 -12
  569. package/dist/index379.js.map +1 -1
  570. package/dist/index38.js +4 -4
  571. package/dist/index380.js +19 -3
  572. package/dist/index380.js.map +1 -1
  573. package/dist/index381.js +74 -68
  574. package/dist/index381.js.map +1 -1
  575. package/dist/index382.js +12 -9
  576. package/dist/index382.js.map +1 -1
  577. package/dist/index383.js +3 -15
  578. package/dist/index383.js.map +1 -1
  579. package/dist/index384.js +71 -4
  580. package/dist/index384.js.map +1 -1
  581. package/dist/index385.js +9 -18
  582. package/dist/index385.js.map +1 -1
  583. package/dist/index386.js +15 -12
  584. package/dist/index386.js.map +1 -1
  585. package/dist/index387.js +5 -3
  586. package/dist/index387.js.map +1 -1
  587. package/dist/index388.js +5 -3
  588. package/dist/index388.js.map +1 -1
  589. package/dist/index389.js +4 -15
  590. package/dist/index389.js.map +1 -1
  591. package/dist/index39.js +5 -5
  592. package/dist/index390.js +15 -491
  593. package/dist/index390.js.map +1 -1
  594. package/dist/index391.js +8 -4
  595. package/dist/index391.js.map +1 -1
  596. package/dist/index392.js +5 -4
  597. package/dist/index392.js.map +1 -1
  598. package/dist/index393.js +5 -4
  599. package/dist/index393.js.map +1 -1
  600. package/dist/index394.js +545 -15
  601. package/dist/index394.js.map +1 -1
  602. package/dist/index395.js +47 -9
  603. package/dist/index395.js.map +1 -1
  604. package/dist/index396.js +17 -5
  605. package/dist/index396.js.map +1 -1
  606. package/dist/index397.js +5 -4
  607. package/dist/index397.js.map +1 -1
  608. package/dist/index398.js +7 -545
  609. package/dist/index398.js.map +1 -1
  610. package/dist/index399.js +7 -47
  611. package/dist/index399.js.map +1 -1
  612. package/dist/index40.js +3 -3
  613. package/dist/index400.js +7 -17
  614. package/dist/index400.js.map +1 -1
  615. package/dist/index401.js +11 -5
  616. package/dist/index401.js.map +1 -1
  617. package/dist/index402.js +8 -7
  618. package/dist/index402.js.map +1 -1
  619. package/dist/index403.js +12 -6
  620. package/dist/index403.js.map +1 -1
  621. package/dist/index404.js +3 -8
  622. package/dist/index404.js.map +1 -1
  623. package/dist/index405.js +3 -12
  624. package/dist/index405.js.map +1 -1
  625. package/dist/index406.js +14 -8
  626. package/dist/index406.js.map +1 -1
  627. package/dist/index407.js +491 -12
  628. package/dist/index407.js.map +1 -1
  629. package/dist/index408.js +4 -7
  630. package/dist/index408.js.map +1 -1
  631. package/dist/index409.js +56 -2
  632. package/dist/index409.js.map +1 -1
  633. package/dist/index41.js +10 -10
  634. package/dist/index410.js +67 -43
  635. package/dist/index410.js.map +1 -1
  636. package/dist/index411.js +31 -56
  637. package/dist/index411.js.map +1 -1
  638. package/dist/index412.js +9 -8
  639. package/dist/index412.js.map +1 -1
  640. package/dist/index413.js +153 -2
  641. package/dist/index413.js.map +1 -1
  642. package/dist/index414.js +107 -54
  643. package/dist/index414.js.map +1 -1
  644. package/dist/index415.js +7 -55
  645. package/dist/index415.js.map +1 -1
  646. package/dist/index416.js +2 -5
  647. package/dist/index416.js.map +1 -1
  648. package/dist/index417.js +42 -54
  649. package/dist/index417.js.map +1 -1
  650. package/dist/index418.js +56 -68
  651. package/dist/index418.js.map +1 -1
  652. package/dist/index419.js +8 -31
  653. package/dist/index419.js.map +1 -1
  654. package/dist/index420.js +2 -9
  655. package/dist/index420.js.map +1 -1
  656. package/dist/index421.js +54 -152
  657. package/dist/index421.js.map +1 -1
  658. package/dist/index422.js +56 -108
  659. package/dist/index422.js.map +1 -1
  660. package/dist/index423.js +2 -2
  661. package/dist/index425.js +2 -2
  662. package/dist/index44.js +1 -1
  663. package/dist/index45.js +2 -2
  664. package/dist/index48.js +2 -2
  665. package/dist/index49.js +34 -34
  666. package/dist/index50.js +29 -29
  667. package/dist/index51.js +2 -2
  668. package/dist/index52.js +12 -12
  669. package/dist/index53.js +4 -4
  670. package/dist/index54.js +1 -1
  671. package/dist/index55.js +22 -22
  672. package/dist/index56.js +5 -5
  673. package/dist/index57.js +5 -5
  674. package/dist/index58.js +8 -8
  675. package/dist/index59.js +5 -5
  676. package/dist/index60.js +17 -17
  677. package/dist/index61.js +5 -5
  678. package/dist/index62.js +3 -3
  679. package/dist/index66.js +1 -1
  680. package/dist/index67.js +1 -1
  681. package/dist/index72.js +2 -6
  682. package/dist/index72.js.map +1 -1
  683. package/dist/index73.js +2 -8
  684. package/dist/index73.js.map +1 -1
  685. package/dist/index74.js +5 -5
  686. package/dist/index74.js.map +1 -1
  687. package/dist/index75.js +8 -2
  688. package/dist/index75.js.map +1 -1
  689. package/dist/index76.js +6 -2
  690. package/dist/index76.js.map +1 -1
  691. package/dist/index79.js +52 -6
  692. package/dist/index79.js.map +1 -1
  693. package/dist/index80.js +4 -68
  694. package/dist/index80.js.map +1 -1
  695. package/dist/index81.js +5 -2
  696. package/dist/index81.js.map +1 -1
  697. package/dist/index82.js +15 -363
  698. package/dist/index82.js.map +1 -1
  699. package/dist/index83.js +5 -261
  700. package/dist/index83.js.map +1 -1
  701. package/dist/index84.js +7 -60
  702. package/dist/index84.js.map +1 -1
  703. package/dist/index85.js +16 -46
  704. package/dist/index85.js.map +1 -1
  705. package/dist/index86.js +4 -169
  706. package/dist/index86.js.map +1 -1
  707. package/dist/index87.js +4 -109
  708. package/dist/index87.js.map +1 -1
  709. package/dist/index88.js +5 -24
  710. package/dist/index88.js.map +1 -1
  711. package/dist/index89.js +6 -8
  712. package/dist/index89.js.map +1 -1
  713. package/dist/index90.js +4 -4
  714. package/dist/index90.js.map +1 -1
  715. package/dist/index91.js +4 -5
  716. package/dist/index91.js.map +1 -1
  717. package/dist/index92.js +6 -4
  718. package/dist/index92.js.map +1 -1
  719. package/dist/index93.js +24 -466
  720. package/dist/index93.js.map +1 -1
  721. package/dist/index94.js +6 -185
  722. package/dist/index94.js.map +1 -1
  723. package/dist/index95.js +4 -107
  724. package/dist/index95.js.map +1 -1
  725. package/dist/index96.js +6 -262
  726. package/dist/index96.js.map +1 -1
  727. package/dist/index97.js +5 -9
  728. package/dist/index97.js.map +1 -1
  729. package/dist/index98.js +4 -42
  730. package/dist/index98.js.map +1 -1
  731. package/dist/index99.js +5 -4
  732. package/dist/index99.js.map +1 -1
  733. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index18.js","sources":["../src/components/PhoneNumberInput/index.tsx"],"sourcesContent":["import * as React from \"react\"\nimport type { CountryCode } from \"libphonenumber-js\"\nimport { getCountryCallingCode } from \"libphonenumber-js\"\nimport Select, {\n type Props as SelectProps,\n type SingleValue,\n type StylesConfig,\n} from \"react-select\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport type {\n CountryOption,\n PhoneNumberChangeDetails,\n PhoneNumberInputProps,\n PhoneNumberSelectedCountry,\n} from \"./types\"\nimport { resolveMessages } from \"./messages\"\nimport {\n COMMON_IDD_PREFIXES,\n DEFAULT_COUNTRY,\n buildFallbackSelectedCountry,\n getCachedCountryOptions,\n getLocaleCacheKey,\n getValidCountry,\n normalizeSearchValue,\n optionMatchIndex,\n parseLocaleCacheKey,\n toSelectedCountry,\n} from \"./country-options\"\nimport {\n formatWithAsYouType,\n getLengthIssue,\n sanitizeDigits,\n stripPrefix,\n type LengthIssue,\n} from \"./normalization\"\nimport {\n captureSelectionSnapshot,\n resolveSelection,\n skipFormattingCharactersLeft,\n skipFormattingCharactersRight,\n} from \"./selection\"\nimport {\n HiddenControl,\n NullComponent,\n SuggestionContext,\n SuggestionOption,\n formatCountryOption,\n suggestionSelectStyles,\n type SuggestionContextValue,\n} from \"./suggestions\"\n\n\nexport type {\n CountryOption,\n PhoneNumberChangeDetails,\n PhoneNumberInputMessages,\n PhoneNumberInputProps,\n PhoneNumberInputValidationCode,\n PhoneNumberSelectedCountry,\n} from \"./types\"\n\nconst INVISIBLE_FORMATTING_CHARACTERS =\n /[\\u061C\\u200B-\\u200F\\u202A-\\u202E\\u2066-\\u2069\\uFEFF]/g\n\ntype ParsedInput = Omit<PhoneNumberChangeDetails, \"selectedCountry\"> & {\n displayValue: string\n lengthIssue: LengthIssue | null\n}\n\nfunction stripInvisibleFormatting(value: string) {\n return value.replace(INVISIBLE_FORMATTING_CHARACTERS, \"\")\n}\n\nfunction stripIddPrefix(digits: string) {\n for (const prefix of COMMON_IDD_PREFIXES) {\n if (digits.startsWith(prefix)) {\n return digits.slice(prefix.length)\n }\n }\n return digits\n}\n\nfunction normalizeImplicitInternationalInput(digits: string) {\n const candidate = `+${digits}`\n const { phoneNumber, detectedCountry } = formatWithAsYouType(candidate)\n\n if (phoneNumber?.isValid() && detectedCountry) {\n return candidate\n }\n\n return null\n}\n\nfunction normalizeExplicitInternationalInput(value: string) {\n const cleaned = stripInvisibleFormatting(value).trim()\n if (!cleaned) {\n return null\n }\n\n if (cleaned.startsWith(\"+\")) {\n const digits = sanitizeDigits(cleaned)\n if (!digits) {\n return \"+\"\n }\n\n const digitsWithoutIdd = stripIddPrefix(digits)\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : \"+\"\n }\n\n const digits = sanitizeDigits(cleaned)\n if (!digits) {\n return null\n }\n\n const digitsWithoutIdd = stripIddPrefix(digits)\n if (digitsWithoutIdd !== digits) {\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : \"+\"\n }\n\n return null\n}\n\nfunction normalizeInternationalInput(value: string) {\n const explicitInternational = normalizeExplicitInternationalInput(value)\n if (explicitInternational != null) {\n return explicitInternational\n }\n\n const cleaned = stripInvisibleFormatting(value).trim()\n const digits = sanitizeDigits(cleaned)\n if (!digits) {\n return null\n }\n\n return normalizeImplicitInternationalInput(digits)\n}\n\nfunction getDialCode(country: CountryCode | null, parsedDialCode: string | undefined) {\n if (parsedDialCode) {\n return parsedDialCode\n }\n return country ? getCountryCallingCode(country) : null\n}\n\nfunction getInputValueForSelectedCountry(\n value: string,\n option: Pick<CountryOption, \"dialCode\" | \"value\">,\n options?: { allowImplicitInternational?: boolean }\n) {\n const cleaned = stripInvisibleFormatting(value).trim()\n const digits = sanitizeDigits(cleaned)\n\n if (!digits) {\n return `+${option.dialCode}`\n }\n\n const normalizedInternational =\n options?.allowImplicitInternational === false\n ? normalizeExplicitInternationalInput(cleaned)\n : normalizeInternationalInput(cleaned)\n if (normalizedInternational) {\n const normalizedDigits = sanitizeDigits(normalizedInternational)\n if (normalizedDigits.startsWith(option.dialCode)) {\n return normalizedInternational\n }\n\n const { phoneNumber } = formatWithAsYouType(normalizedInternational)\n const currentDialCode = phoneNumber?.countryCallingCode\n const nationalDigits =\n currentDialCode && normalizedDigits.startsWith(currentDialCode)\n ? normalizedDigits.slice(currentDialCode.length)\n : phoneNumber?.nationalNumber ?? normalizedDigits\n\n return `+${option.dialCode}${nationalDigits}`\n }\n\n const { phoneNumber } = formatWithAsYouType(cleaned, option.value)\n return `+${option.dialCode}${phoneNumber?.nationalNumber ?? digits}`\n}\n\nfunction preferSelectedCountry(\n parsed: ParsedInput,\n option: Pick<CountryOption, \"dialCode\" | \"value\">\n): ParsedInput {\n return {\n ...parsed,\n country: option.value,\n countryCallingCode: option.dialCode,\n lengthIssue: getLengthIssue(parsed.rawInput, option.value),\n }\n}\n\nfunction parsePhoneInput(rawValue: string | undefined, baseCountry?: CountryCode): ParsedInput {\n const cleaned = stripInvisibleFormatting(rawValue ?? \"\").trim()\n\n if (!cleaned) {\n const country = baseCountry ?? null\n const countryCallingCode = country ? getCountryCallingCode(country) : null\n\n return {\n displayValue: \"\",\n formattedInternational: \"\",\n formattedNational: \"\",\n e164: null,\n country,\n countryCallingCode,\n nationalNumber: \"\",\n rawInput: \"\",\n isValid: false,\n lengthIssue: null,\n }\n }\n\n const normalizedInternational = normalizeInternationalInput(cleaned)\n const shouldFormat = normalizedInternational != null || baseCountry != null\n\n if (!shouldFormat) {\n return {\n displayValue: cleaned,\n formattedInternational: cleaned,\n formattedNational: cleaned,\n e164: null,\n country: null,\n countryCallingCode: null,\n nationalNumber: sanitizeDigits(cleaned),\n rawInput: cleaned,\n isValid: false,\n lengthIssue: null,\n }\n }\n\n const normalized = normalizedInternational ?? cleaned\n const {\n international,\n national,\n formatted,\n phoneNumber,\n detectedCountry,\n } = formatWithAsYouType(normalized, baseCountry)\n const hasInternationalPrefix = normalizedInternational != null\n const country = hasInternationalPrefix\n ? detectedCountry ?? baseCountry ?? null\n : baseCountry ?? detectedCountry ?? null\n const countryCallingCode = getDialCode(country, phoneNumber?.countryCallingCode)\n const normalizedDigits = sanitizeDigits(normalized)\n const nationalNumber =\n phoneNumber?.nationalNumber ??\n (countryCallingCode && normalized.startsWith(\"+\")\n ? stripPrefix(normalizedDigits, countryCallingCode)\n : sanitizeDigits(cleaned))\n const displayValue = hasInternationalPrefix ? international : formatted\n\n return {\n displayValue,\n formattedInternational: phoneNumber?.formatInternational() ?? international,\n formattedNational: phoneNumber?.formatNational() ?? national,\n e164: phoneNumber?.number ?? null,\n country,\n countryCallingCode,\n nationalNumber,\n rawInput: normalized,\n isValid: phoneNumber?.isValid() ?? false,\n lengthIssue: country ? getLengthIssue(normalized, country) : null,\n }\n}\n\nexport const PhoneNumberInput = React.forwardRef<HTMLInputElement, PhoneNumberInputProps>(\n function PhoneNumberInput(props, forwardedRef) {\n const {\n value,\n defaultCountry,\n country: countryProp,\n locale,\n onChange,\n onCountryChange,\n className,\n inputClassName,\n disabled,\n readOnly,\n selectProps,\n autofillShimName,\n messages: messagesProp,\n renderValidationMessage,\n ...restProps\n } = props\n\n const {\n onFocus: onInputFocus,\n onBlur: onInputBlur,\n onKeyDown: onInputKeyDown,\n name: inputName,\n autoComplete: inputAutoComplete,\n ...restInputProps\n } = restProps\n\n const controlledCountry = typeof countryProp === \"string\" ? countryProp : null\n const localeCacheKey = getLocaleCacheKey(locale)\n const localeForBuild = React.useMemo(\n () => parseLocaleCacheKey(localeCacheKey),\n [localeCacheKey]\n )\n const resolvedMessages = React.useMemo(\n () => resolveMessages(localeForBuild, messagesProp),\n [localeForBuild, messagesProp]\n )\n const countryOptions = React.useMemo(\n () => getCachedCountryOptions(localeForBuild, localeCacheKey),\n [localeCacheKey, localeForBuild]\n )\n const resolveSelectedCountry = React.useCallback(\n (country: CountryCode): PhoneNumberSelectedCountry => {\n const match = countryOptions.find((candidate) => candidate.value === country)\n if (match) {\n return toSelectedCountry(match)\n }\n return buildFallbackSelectedCountry(country)\n },\n [countryOptions]\n )\n const menuPriorityCountry = React.useMemo(() => {\n const candidate = getValidCountry(defaultCountry ?? countryProp ?? DEFAULT_COUNTRY)\n if (countryOptions.some((option) => option.value === candidate)) {\n return candidate\n }\n return countryOptions[0]?.value ?? DEFAULT_COUNTRY\n }, [countryOptions, countryProp, defaultCountry])\n\n const initialStateRef = React.useRef<ParsedInput | null>(null)\n\n if (!initialStateRef.current) {\n const initialState = parsePhoneInput(value, controlledCountry ?? undefined)\n initialStateRef.current = initialState\n }\n\n const initialState = initialStateRef.current\n\n const [uncontrolledCountry, setUncontrolledCountry] = React.useState<CountryCode | null>(\n controlledCountry ? null : initialState.country\n )\n const [inputValueState, setInputValueState] = React.useState(initialState.displayValue)\n const [countryQuery, setCountryQuery] = React.useState(\"\")\n const [showSuggestions, setShowSuggestions] = React.useState(false)\n const [highlightedIndex, setHighlightedIndex] = React.useState<number>(-1)\n const [isFocused, setIsFocused] = React.useState(false)\n const [lengthIssue, setLengthIssue] = React.useState<LengthIssue | null>(\n initialState.lengthIssue\n )\n\n const manualSelectionCountryRef = React.useRef<CountryCode | null>(null)\n const keyboardBufferRef = React.useRef(\"\")\n const bufferTimeoutRef = React.useRef<number | null>(null)\n const scrollBehaviorRef = React.useRef<ScrollBehavior>(\"smooth\")\n const pendingSelectionRef = React.useRef<{ start: number; end: number } | null>(null)\n const hasNotifiedCountryRef = React.useRef(false)\n const lastNotifiedCountryRef = React.useRef<CountryCode | null>(null)\n const inputRef = React.useRef<HTMLInputElement | null>(null)\n\n const activeCountry = controlledCountry ?? uncontrolledCountry\n const explicitFormattingCountry = controlledCountry ?? manualSelectionCountryRef.current ?? undefined\n\n React.useImperativeHandle(forwardedRef, () => inputRef.current as HTMLInputElement, [])\n\n React.useLayoutEffect(() => {\n const selection = pendingSelectionRef.current\n if (!selection) {\n return\n }\n\n const input = inputRef.current\n pendingSelectionRef.current = null\n if (!input) {\n return\n }\n\n const { start, end } = selection\n input.setSelectionRange(start, end)\n }, [inputValueState])\n\n const selectOverrides = selectProps ?? {}\n const {\n styles: userSelectStyles,\n components: userSelectComponents,\n classNamePrefix: userClassNamePrefix,\n formatOptionLabel: userFormatOptionLabel,\n menuPortalTarget: userMenuPortalTarget,\n menuPosition: userMenuPosition,\n ...forwardedSelectProps\n } = selectOverrides\n const { noOptionsMessage, ...restForwardedSelectProps } = forwardedSelectProps\n const [defaultMenuPortalTarget, setDefaultMenuPortalTarget] =\n React.useState<HTMLElement | null>(null)\n const hasUserMenuPortalTarget = \"menuPortalTarget\" in selectOverrides\n const menuPortalTarget = hasUserMenuPortalTarget\n ? userMenuPortalTarget\n : defaultMenuPortalTarget\n\n const mergedSelectStyles = React.useMemo<StylesConfig<CountryOption, false>>(\n () => {\n const userMenuPortal = userSelectStyles?.menuPortal\n\n return {\n ...suggestionSelectStyles,\n ...(userSelectStyles ?? {}),\n menuPortal: (provided, state) => {\n const base = {\n ...provided,\n zIndex: 1300,\n }\n\n return userMenuPortal ? userMenuPortal(base, state) : base\n },\n }\n },\n [userSelectStyles]\n )\n\n React.useLayoutEffect(() => {\n if (hasUserMenuPortalTarget || typeof document === \"undefined\") {\n return\n }\n\n const portalTarget =\n inputRef.current?.closest<HTMLElement>(\n \"[data-slot='dialog-content'], [data-slot='sheet-content'], [role='dialog']\"\n ) ?? document.body\n setDefaultMenuPortalTarget(portalTarget)\n }, [hasUserMenuPortalTarget])\n\n const mergedSelectComponents = React.useMemo(() => {\n const baseComponents = {\n Control: HiddenControl,\n IndicatorsContainer: NullComponent,\n DropdownIndicator: NullComponent,\n IndicatorSeparator: NullComponent,\n ValueContainer: NullComponent,\n }\n\n const overrides = userSelectComponents ?? {}\n\n if (!overrides.Option) {\n return {\n ...baseComponents,\n ...overrides,\n Option: SuggestionOption,\n }\n }\n\n return {\n ...baseComponents,\n ...overrides,\n }\n }, [userSelectComponents])\n\n React.useEffect(() => () => {\n if (bufferTimeoutRef.current != null && typeof window !== \"undefined\") {\n window.clearTimeout(bufferTimeoutRef.current)\n }\n }, [])\n\n React.useEffect(() => {\n if (value == null) {\n return\n }\n\n const parsed = parsePhoneInput(value, explicitFormattingCountry)\n keyboardBufferRef.current = \"\"\n\n setInputValueState(parsed.displayValue)\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(parsed.lengthIssue)\n\n if (!controlledCountry && parsed.country !== uncontrolledCountry) {\n setUncontrolledCountry(parsed.country)\n }\n }, [controlledCountry, explicitFormattingCountry, uncontrolledCountry, value])\n\n React.useEffect(() => {\n const country = activeCountry ?? null\n if (!hasNotifiedCountryRef.current && country == null) {\n return\n }\n\n if (hasNotifiedCountryRef.current && lastNotifiedCountryRef.current === country) {\n return\n }\n\n hasNotifiedCountryRef.current = true\n lastNotifiedCountryRef.current = country\n onCountryChange?.(country, country ? resolveSelectedCountry(country) : null)\n }, [activeCountry, onCountryChange, resolveSelectedCountry])\n\n const emitChange = React.useCallback(\n (details: Omit<PhoneNumberChangeDetails, \"selectedCountry\">) => {\n onChange?.({\n ...details,\n selectedCountry: details.country ? resolveSelectedCountry(details.country) : null,\n })\n },\n [onChange, resolveSelectedCountry]\n )\n\n const scheduleBufferReset = React.useCallback(() => {\n if (typeof window === \"undefined\") {\n return\n }\n\n if (bufferTimeoutRef.current != null) {\n window.clearTimeout(bufferTimeoutRef.current)\n }\n\n bufferTimeoutRef.current = window.setTimeout(() => {\n keyboardBufferRef.current = \"\"\n bufferTimeoutRef.current = null\n }, 800)\n }, [])\n\n const applyParsedInput = React.useCallback(\n (parsed: ParsedInput, snapshot: ReturnType<typeof captureSelectionSnapshot> | null) => {\n setInputValueState(parsed.displayValue)\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(parsed.lengthIssue)\n\n if (!controlledCountry && parsed.country !== uncontrolledCountry) {\n setUncontrolledCountry(parsed.country)\n }\n\n if (snapshot) {\n pendingSelectionRef.current = resolveSelection(snapshot, parsed.displayValue)\n }\n\n emitChange({\n formattedInternational: parsed.formattedInternational,\n formattedNational: parsed.formattedNational,\n e164: parsed.e164,\n country: parsed.country,\n countryCallingCode: parsed.countryCallingCode,\n nationalNumber: parsed.nationalNumber,\n rawInput: parsed.rawInput,\n isValid: parsed.isValid,\n })\n },\n [controlledCountry, emitChange, uncontrolledCountry]\n )\n\n const handleInputChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const target = event.target\n const snapshot = captureSelectionSnapshot(target)\n const raw = target.value\n keyboardBufferRef.current = \"\"\n\n const normalizedExplicitInternational = normalizeExplicitInternationalInput(raw)\n const manualCountry = manualSelectionCountryRef.current\n if (normalizedExplicitInternational != null && manualCountry) {\n const manualDialCode = getCountryCallingCode(manualCountry)\n if (!sanitizeDigits(normalizedExplicitInternational).startsWith(manualDialCode)) {\n manualSelectionCountryRef.current = null\n }\n } else if (normalizedExplicitInternational != null) {\n manualSelectionCountryRef.current = null\n }\n\n const activeManualCountry = manualSelectionCountryRef.current\n const rawDigits = sanitizeDigits(raw)\n if (\n !controlledCountry &&\n activeManualCountry &&\n normalizedExplicitInternational == null &&\n rawDigits\n ) {\n const manualOption = {\n value: activeManualCountry,\n dialCode: getCountryCallingCode(activeManualCountry),\n }\n const parsed = preferSelectedCountry(\n parsePhoneInput(\n getInputValueForSelectedCountry(\n raw,\n {\n value: manualOption.value,\n dialCode: manualOption.dialCode,\n },\n { allowImplicitInternational: false }\n ),\n activeManualCountry\n ),\n manualOption\n )\n applyParsedInput(parsed, snapshot)\n return\n }\n\n const baseCountry = controlledCountry ?? activeManualCountry ?? undefined\n const parsed = parsePhoneInput(raw, baseCountry)\n applyParsedInput(parsed, snapshot)\n },\n [applyParsedInput, controlledCountry]\n )\n\n const handleCountrySelect = React.useCallback(\n (option: SingleValue<CountryOption>) => {\n if (!option) {\n return\n }\n\n manualSelectionCountryRef.current = option.value\n const nextInputValue = getInputValueForSelectedCountry(inputValueState, option)\n const parsed = preferSelectedCountry(\n parsePhoneInput(nextInputValue, option.value),\n option\n )\n\n setInputValueState(parsed.displayValue)\n pendingSelectionRef.current = {\n start: parsed.displayValue.length,\n end: parsed.displayValue.length,\n }\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(parsed.lengthIssue)\n\n if (!controlledCountry) {\n setUncontrolledCountry(option.value)\n }\n\n emitChange({\n formattedInternational: parsed.formattedInternational,\n formattedNational: parsed.formattedNational,\n e164: parsed.e164,\n country: parsed.country,\n countryCallingCode: parsed.countryCallingCode,\n nationalNumber: parsed.nationalNumber,\n rawInput: parsed.rawInput,\n isValid: parsed.isValid,\n })\n\n requestAnimationFrame(() => {\n inputRef.current?.focus()\n })\n },\n [controlledCountry, emitChange, inputValueState]\n )\n\n const filteredOptions = React.useMemo(() => {\n if (!showSuggestions) {\n return [] as CountryOption[]\n }\n\n const results: CountryOption[] = []\n\n const pushUnique = (option: CountryOption | undefined) => {\n if (option && !results.some((existing) => existing.value === option.value)) {\n results.push(option)\n }\n }\n\n const priorityOption = countryOptions.find((option) => option.value === menuPriorityCountry)\n const currentOption = activeCountry\n ? countryOptions.find((option) => option.value === activeCountry)\n : undefined\n const query = countryQuery.trim()\n const digitQuery = sanitizeDigits(query)\n const normalizedQuery = normalizeSearchValue(query)\n\n if (!digitQuery && !normalizedQuery) {\n pushUnique(currentOption)\n pushUnique(priorityOption)\n countryOptions.forEach(pushUnique)\n return results\n }\n\n if (digitQuery) {\n const dialMatches = countryOptions\n .filter((option) => option.dialCode.startsWith(digitQuery))\n .sort((a, b) => {\n const aExact = a.dialCode === digitQuery\n const bExact = b.dialCode === digitQuery\n if (aExact && !bExact) {\n return -1\n }\n if (!aExact && bExact) {\n return 1\n }\n return a.dialCode.length - b.dialCode.length\n })\n dialMatches.forEach(pushUnique)\n }\n\n if (normalizedQuery) {\n const nameMatches = countryOptions\n .filter((option) =>\n option.normalizedSearchableTokens.some((token) => token.includes(normalizedQuery))\n )\n .sort((a, b) => {\n const aIndex = optionMatchIndex(a.normalizedSearchableTokens, normalizedQuery)\n const bIndex = optionMatchIndex(b.normalizedSearchableTokens, normalizedQuery)\n if (aIndex !== bIndex) {\n return aIndex - bIndex\n }\n return a.name.localeCompare(b.name)\n })\n nameMatches.forEach(pushUnique)\n }\n\n pushUnique(currentOption)\n pushUnique(priorityOption)\n if (results.length === 0) {\n countryOptions.forEach(pushUnique)\n }\n\n return results\n }, [activeCountry, countryOptions, countryQuery, menuPriorityCountry, showSuggestions])\n\n const suggestionMenuIsOpen = isFocused && showSuggestions && filteredOptions.length > 0\n\n React.useEffect(() => {\n if (!suggestionMenuIsOpen) {\n scrollBehaviorRef.current = \"smooth\"\n }\n }, [suggestionMenuIsOpen])\n\n React.useEffect(() => {\n if (!suggestionMenuIsOpen) {\n setHighlightedIndex(-1)\n return\n }\n\n if (filteredOptions.length === 0) {\n setHighlightedIndex(-1)\n return\n }\n\n setHighlightedIndex((current) => {\n if (current < 0 || current >= filteredOptions.length) {\n return 0\n }\n return current\n })\n }, [filteredOptions, suggestionMenuIsOpen])\n\n const highlightedOption =\n highlightedIndex >= 0 ? filteredOptions[highlightedIndex] ?? null : null\n\n React.useEffect(() => {\n if (highlightedIndex < 0) {\n scrollBehaviorRef.current = \"smooth\"\n }\n }, [highlightedIndex])\n\n const consumeScrollBehavior = React.useCallback(() => {\n const behavior = scrollBehaviorRef.current\n scrollBehaviorRef.current = \"smooth\"\n return behavior\n }, [])\n\n const updateHighlightedOption = React.useCallback(\n (option: CountryOption) => {\n const index = filteredOptions.findIndex((candidate) => candidate.value === option.value)\n if (index !== -1) {\n setHighlightedIndex(index)\n }\n },\n [filteredOptions]\n )\n\n const selectFormatOptionLabel = React.useCallback<\n NonNullable<SelectProps<CountryOption, false>[\"formatOptionLabel\"]>\n >(\n (option, meta) => {\n if (userFormatOptionLabel) {\n return userFormatOptionLabel(option, meta)\n }\n return formatCountryOption(option)\n },\n [userFormatOptionLabel]\n )\n\n const optionLabelRenderer = React.useCallback(\n (option: CountryOption) =>\n selectFormatOptionLabel(option, {\n context: \"menu\",\n inputValue: countryQuery,\n selectValue: [],\n }),\n [countryQuery, selectFormatOptionLabel]\n )\n\n const highlightContextValue = React.useMemo<SuggestionContextValue>(\n () => ({\n highlightedValue: highlightedOption?.value ?? null,\n setHighlightedOption: updateHighlightedOption,\n renderOptionLabel: optionLabelRenderer,\n consumeScrollBehavior,\n }),\n [consumeScrollBehavior, highlightedOption, optionLabelRenderer, updateHighlightedOption]\n )\n\n const activeOption = activeCountry\n ? countryOptions.find((option) => option.value === activeCountry)\n : undefined\n const activeFlag = activeOption?.flag ?? \"\"\n const inlineFlagLabel = activeCountry\n ? resolvedMessages.selectedCountryLabel(activeOption?.name ?? activeCountry)\n : resolvedMessages.selectCountryLabel\n const hasInlineFlag = Boolean(activeCountry && activeFlag)\n const lengthHint =\n lengthIssue === \"TOO_LONG\"\n ? resolvedMessages.lengthTooLong(activeOption?.name ?? activeCountry ?? null)\n : null\n const countryName = activeOption?.name ?? activeCountry ?? null\n\n let validationNode: React.ReactNode = null\n if (lengthHint) {\n const rendered = renderValidationMessage?.({\n message: lengthHint,\n code: \"TOO_LONG\",\n countryName,\n })\n validationNode =\n rendered === undefined ? (\n <p className=\"mt-1 text-xs text-destructive\">\n <span>{lengthHint}</span>\n </p>\n ) : (\n rendered\n )\n }\n\n const appendToBuffer = React.useCallback(\n (char: string) => {\n keyboardBufferRef.current = `${keyboardBufferRef.current}${char}`.slice(-12)\n setCountryQuery(keyboardBufferRef.current)\n setShowSuggestions(true)\n scheduleBufferReset()\n },\n [scheduleBufferReset]\n )\n\n const popBuffer = React.useCallback(() => {\n const current = keyboardBufferRef.current\n if (!current) {\n return\n }\n keyboardBufferRef.current = current.slice(0, -1)\n setCountryQuery(keyboardBufferRef.current)\n if (keyboardBufferRef.current) {\n scheduleBufferReset()\n }\n }, [scheduleBufferReset])\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n onInputKeyDown?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n const key = event.key\n\n if (event.metaKey || event.ctrlKey || event.altKey) {\n return\n }\n\n const target = event.currentTarget\n const value = target.value\n const selectionStart = target.selectionStart ?? 0\n const selectionEnd = target.selectionEnd ?? selectionStart\n const isCollapsedSelection = selectionStart === selectionEnd\n\n if (key === \"Backspace\" && isCollapsedSelection) {\n const nextStart = skipFormattingCharactersLeft(value, selectionStart)\n if (nextStart !== selectionStart) {\n target.setSelectionRange(nextStart, nextStart)\n }\n } else if (key === \"ArrowLeft\" && isCollapsedSelection) {\n const nextStart = skipFormattingCharactersLeft(value, selectionStart)\n if (nextStart !== selectionStart) {\n event.preventDefault()\n target.setSelectionRange(nextStart, nextStart)\n return\n }\n } else if (key === \"ArrowRight\" && isCollapsedSelection) {\n const nextStart = skipFormattingCharactersRight(value, selectionEnd)\n if (nextStart !== selectionEnd) {\n event.preventDefault()\n target.setSelectionRange(nextStart, nextStart)\n return\n }\n }\n\n if (key === \"ArrowDown\") {\n scrollBehaviorRef.current = event.repeat ? \"auto\" : \"smooth\"\n event.preventDefault()\n if (!showSuggestions) {\n setShowSuggestions(true)\n setHighlightedIndex(filteredOptions.length > 0 ? 0 : -1)\n return\n }\n\n if (filteredOptions.length > 0) {\n setHighlightedIndex((current) => {\n const next = current < 0 ? 0 : (current + 1) % filteredOptions.length\n return next\n })\n }\n return\n }\n\n if (key === \"ArrowUp\") {\n scrollBehaviorRef.current = event.repeat ? \"auto\" : \"smooth\"\n event.preventDefault()\n if (!showSuggestions) {\n setShowSuggestions(true)\n setHighlightedIndex(filteredOptions.length > 0 ? filteredOptions.length - 1 : -1)\n return\n }\n\n if (filteredOptions.length > 0) {\n setHighlightedIndex((current) => {\n if (current < 0) {\n return filteredOptions.length - 1\n }\n return (current - 1 + filteredOptions.length) % filteredOptions.length\n })\n }\n return\n }\n\n if (/^[a-z]$/i.test(key)) {\n event.preventDefault()\n if (!showSuggestions) {\n setShowSuggestions(true)\n setHighlightedIndex(filteredOptions.length > 0 ? 0 : -1)\n }\n appendToBuffer(key.toLowerCase())\n return\n }\n\n if (suggestionMenuIsOpen) {\n if (key === \"Backspace\" && keyboardBufferRef.current) {\n event.preventDefault()\n popBuffer()\n return\n }\n\n if (key === \"Escape\") {\n event.preventDefault()\n keyboardBufferRef.current = \"\"\n setCountryQuery(\"\")\n setShowSuggestions(false)\n return\n }\n\n if (key === \"Enter\" && filteredOptions.length > 0) {\n event.preventDefault()\n const targetOption = highlightedOption ?? filteredOptions[0]\n handleCountrySelect(targetOption)\n return\n }\n }\n },\n [\n appendToBuffer,\n filteredOptions,\n handleCountrySelect,\n highlightedOption,\n onInputKeyDown,\n popBuffer,\n showSuggestions,\n suggestionMenuIsOpen,\n ]\n )\n\n const handleFocus = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(true)\n onInputFocus?.(event)\n },\n [onInputFocus]\n )\n\n const handleBlur = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(false)\n setShowSuggestions(false)\n keyboardBufferRef.current = \"\"\n setCountryQuery(\"\")\n onInputBlur?.(event)\n },\n [onInputBlur]\n )\n\n const openCountryMenu = React.useCallback(() => {\n if (disabled || readOnly) {\n return\n }\n\n keyboardBufferRef.current = \"\"\n setCountryQuery(\"\")\n setShowSuggestions(true)\n setHighlightedIndex((current) => (current < 0 ? 0 : current))\n\n requestAnimationFrame(() => {\n inputRef.current?.focus()\n })\n }, [disabled, readOnly])\n\n const shimName = autofillShimName ?? (inputName ? `${inputName}_shim` : undefined)\n\n return (\n <div className={cn(\"relative flex flex-col\", className)}>\n <div className=\"relative\">\n <input\n {...restInputProps}\n ref={inputRef}\n type=\"tel\"\n className={cn(\n \"flex h-10 w-full rounded-md border border-input bg-background py-2 text-base ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"pl-11 pr-3\",\n inputClassName\n )}\n name={inputName}\n value={inputValueState}\n onChange={handleInputChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n disabled={disabled}\n readOnly={readOnly}\n autoComplete={inputAutoComplete ?? \"off\"}\n />\n <button\n type=\"button\"\n className={cn(\n \"absolute left-3 top-1/2 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded border text-lg leading-none transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n hasInlineFlag\n ? \"border-transparent\"\n : \"border-dashed border-border text-muted-foreground\",\n disabled\n ? \"cursor-not-allowed opacity-50\"\n : readOnly\n ? \"cursor-default\"\n : \"cursor-pointer hover:bg-muted\"\n )}\n aria-label={inlineFlagLabel}\n onMouseDown={(event) => event.preventDefault()}\n onClick={openCountryMenu}\n tabIndex={-1}\n disabled={disabled}\n >\n <span aria-hidden=\"true\">\n {hasInlineFlag ? activeFlag : \"?\"}\n </span>\n </button>\n </div>\n\n {shimName ? (\n <input\n tabIndex={-1}\n autoComplete=\"tel\"\n name={shimName}\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute left-0 top-0 h-0 w-0 opacity-0\"\n />\n ) : null}\n\n <div\n className=\"absolute left-0 top-full z-30 mt-1\"\n style={{\n pointerEvents: suggestionMenuIsOpen ? \"auto\" : \"none\",\n width: \"min(260px, 100%)\",\n }}\n onMouseDown={(event) => event.preventDefault()}\n >\n <SuggestionContext.Provider value={highlightContextValue}>\n <Select<CountryOption, false>\n {...restForwardedSelectProps}\n menuIsOpen={suggestionMenuIsOpen}\n options={filteredOptions}\n value={null}\n components={mergedSelectComponents}\n styles={mergedSelectStyles}\n isClearable={false}\n isSearchable={false}\n backspaceRemovesValue={false}\n tabSelectsValue={false}\n menuShouldScrollIntoView={false}\n menuPortalTarget={menuPortalTarget}\n menuPosition={userMenuPosition ?? (menuPortalTarget ? \"fixed\" : \"absolute\")}\n onChange={handleCountrySelect}\n classNamePrefix={userClassNamePrefix ?? \"phone-number-suggestions\"}\n placeholder=\"\"\n formatOptionLabel={selectFormatOptionLabel}\n noOptionsMessage={\n noOptionsMessage ?? (() => resolvedMessages.noMatches)\n }\n />\n </SuggestionContext.Provider>\n </div>\n\n {validationNode}\n </div>\n )\n }\n)\n\nPhoneNumberInput.displayName = \"PhoneNumberInput\"\n"],"names":["INVISIBLE_FORMATTING_CHARACTERS","stripInvisibleFormatting","value","replace","stripIddPrefix","digits","prefix","COMMON_IDD_PREFIXES","startsWith","slice","length","normalizeImplicitInternationalInput","candidate","phoneNumber","detectedCountry","formatWithAsYouType","isValid","normalizeExplicitInternationalInput","cleaned","trim","sanitizeDigits","digitsWithoutIdd","normalizeInternationalInput","explicitInternational","getDialCode","country","parsedDialCode","getCountryCallingCode","getInputValueForSelectedCountry","option","options","dialCode","normalizedInternational","allowImplicitInternational","normalizedDigits","currentDialCode","countryCallingCode","nationalDigits","nationalNumber","preferSelectedCountry","parsed","lengthIssue","getLengthIssue","rawInput","parsePhoneInput","rawValue","baseCountry","displayValue","formattedInternational","formattedNational","e164","normalized","international","national","formatted","hasInternationalPrefix","stripPrefix","formatInternational","formatNational","number","PhoneNumberInput","React","forwardRef","props","forwardedRef","defaultCountry","countryProp","locale","onChange","onCountryChange","className","inputClassName","disabled","readOnly","selectProps","autofillShimName","messages","messagesProp","renderValidationMessage","restProps","onFocus","onInputFocus","onBlur","onInputBlur","onKeyDown","onInputKeyDown","name","inputName","autoComplete","inputAutoComplete","restInputProps","controlledCountry","localeCacheKey","getLocaleCacheKey","localeForBuild","useMemo","parseLocaleCacheKey","resolvedMessages","resolveMessages","countryOptions","getCachedCountryOptions","resolveSelectedCountry","useCallback","match","find","toSelectedCountry","buildFallbackSelectedCountry","menuPriorityCountry","getValidCountry","DEFAULT_COUNTRY","some","initialStateRef","useRef","current","initialState","undefined","uncontrolledCountry","setUncontrolledCountry","useState","inputValueState","setInputValueState","countryQuery","setCountryQuery","showSuggestions","setShowSuggestions","highlightedIndex","setHighlightedIndex","isFocused","setIsFocused","setLengthIssue","manualSelectionCountryRef","keyboardBufferRef","bufferTimeoutRef","scrollBehaviorRef","pendingSelectionRef","hasNotifiedCountryRef","lastNotifiedCountryRef","inputRef","activeCountry","explicitFormattingCountry","useImperativeHandle","useLayoutEffect","selection","input","start","end","setSelectionRange","selectOverrides","styles","userSelectStyles","components","userSelectComponents","classNamePrefix","userClassNamePrefix","formatOptionLabel","userFormatOptionLabel","menuPortalTarget","userMenuPortalTarget","menuPosition","userMenuPosition","forwardedSelectProps","noOptionsMessage","restForwardedSelectProps","defaultMenuPortalTarget","setDefaultMenuPortalTarget","hasUserMenuPortalTarget","mergedSelectStyles","userMenuPortal","menuPortal","suggestionSelectStyles","provided","state","base","zIndex","document","portalTarget","closest","body","mergedSelectComponents","baseComponents","Control","HiddenControl","IndicatorsContainer","NullComponent","DropdownIndicator","IndicatorSeparator","ValueContainer","overrides","Option","SuggestionOption","useEffect","window","clearTimeout","emitChange","details","selectedCountry","scheduleBufferReset","setTimeout","applyParsedInput","snapshot","resolveSelection","handleInputChange","event","target","captureSelectionSnapshot","raw","normalizedExplicitInternational","manualCountry","manualDialCode","activeManualCountry","rawDigits","manualOption","handleCountrySelect","nextInputValue","requestAnimationFrame","focus","filteredOptions","results","pushUnique","existing","push","priorityOption","currentOption","query","digitQuery","normalizedQuery","normalizeSearchValue","forEach","filter","sort","a","b","aExact","bExact","normalizedSearchableTokens","token","includes","aIndex","optionMatchIndex","bIndex","localeCompare","suggestionMenuIsOpen","highlightedOption","consumeScrollBehavior","behavior","updateHighlightedOption","index","findIndex","selectFormatOptionLabel","meta","formatCountryOption","optionLabelRenderer","context","inputValue","selectValue","highlightContextValue","highlightedValue","setHighlightedOption","renderOptionLabel","activeOption","activeFlag","flag","inlineFlagLabel","selectedCountryLabel","selectCountryLabel","hasInlineFlag","Boolean","lengthHint","lengthTooLong","countryName","validationNode","rendered","message","code","jsx","appendToBuffer","char","popBuffer","handleKeyDown","defaultPrevented","key","metaKey","ctrlKey","altKey","currentTarget","selectionStart","selectionEnd","isCollapsedSelection","nextStart","skipFormattingCharactersLeft","preventDefault","skipFormattingCharactersRight","repeat","test","toLowerCase","targetOption","handleFocus","handleBlur","openCountryMenu","shimName","cn","jsxs","pointerEvents","width","SuggestionContext","Select","noMatches","displayName"],"mappings":";;;;;;;;;;AA+DA,MAAMA,KACJ;AAOF,SAASC,GAAyBC,GAAe;AAC/C,SAAOA,EAAMC,QAAQH,IAAiC,EAAE;AAC1D;AAEA,SAASI,GAAeC,GAAgB;AACtC,aAAWC,KAAUC;AACnB,QAAIF,EAAOG,WAAWF,CAAM;AAC1B,aAAOD,EAAOI,MAAMH,EAAOI,MAAM;AAGr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c5D,OAAUA,EAAMwF,eAAAA,GAC9B,SAASQ,IACT,UAAU,IACV,UAAAlO,GAEA,UAAA0M,gBAAAA,EAAAA,IAAC,UAAK,eAAY,QACfT,UAAAA,KAAgBL,KAAa,KAChC,EAAA,CACF;AAAA,IAAA,GACF;AAAA,IAECuC,KACCzB,gBAAAA,EAAAA,IAAC,SAAA,EACC,UAAU,IACV,cAAa,OACb,MAAMyB,IACN,eAAY,QACZ,WAAU,+DAA6D,IAEvE;AAAA,IAEJzB,gBAAAA,EAAAA,IAAC,OAAA,EACC,WAAU,sCACV,OAAO;AAAA,MACL4B,eAAe7D,IAAuB,SAAS;AAAA,MAC/C8D,OAAO;AAAA,IAAA,GAET,aAAcrG,CAAAA,MAAUA,EAAMwF,eAAAA,GAE9B,UAAAhB,gBAAAA,MAAC8B,GAAkB,UAAlB,EAA2B,OAAOjD,IACjC,UAAAmB,gBAAAA,EAAAA,IAAC+B,MACC,GAAI/I,IACJ,YAAY+E,GACZ,SAASzB,GACT,OAAO,MACP,YAAYtC,IACZ,QAAQZ,IACR,aAAa,IACb,cAAc,IACd,uBAAuB,IACvB,iBAAiB,IACjB,0BAA0B,IAC1B,kBAAAV,IACA,cAAcG,OAAqBH,KAAmB,UAAU,aAChE,UAAUwD,IACV,iBAAiB3D,MAAuB,4BACxC,aAAY,IACZ,mBAAmB+F,IACnB,kBACEvF,OAAqB,MAAMhE,EAAiBiN,WAAAA,CAC7C,EAAA,CAEL,EAAA,CACF;AAAA,IAECpC;AAAAA,EAAAA,GACH;AAEJ,CACF;AAEAlN,GAAiBuP,cAAc;"}
1
+ {"version":3,"file":"index18.js","sources":["../src/components/PhoneNumberInput/index.tsx"],"sourcesContent":["import * as React from \"react\"\nimport type { CountryCode } from \"libphonenumber-js\"\nimport { getCountryCallingCode } from \"libphonenumber-js\"\nimport Select, {\n type Props as SelectProps,\n type SingleValue,\n type StylesConfig,\n} from \"react-select\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport type {\n CountryOption,\n PhoneNumberChangeDetails,\n PhoneNumberInputProps,\n PhoneNumberSelectedCountry,\n} from \"./types\"\nimport { resolveMessages } from \"./messages\"\nimport {\n COMMON_IDD_PREFIXES,\n DEFAULT_COUNTRY,\n buildFallbackSelectedCountry,\n getCachedCountryOptions,\n getLocaleCacheKey,\n getValidCountry,\n normalizeSearchValue,\n optionMatchIndex,\n parseLocaleCacheKey,\n toSelectedCountry,\n} from \"./country-options\"\nimport {\n formatWithAsYouType,\n getLengthIssue,\n sanitizeDigits,\n stripPrefix,\n type LengthIssue,\n} from \"./normalization\"\nimport {\n captureSelectionSnapshot,\n resolveSelection,\n skipFormattingCharactersLeft,\n skipFormattingCharactersRight,\n} from \"./selection\"\nimport {\n HiddenControl,\n NullComponent,\n SuggestionContext,\n SuggestionOption,\n formatCountryOption,\n suggestionSelectStyles,\n type SuggestionContextValue,\n} from \"./suggestions\"\n\n\nexport type {\n CountryOption,\n PhoneNumberChangeDetails,\n PhoneNumberInputMessages,\n PhoneNumberInputProps,\n PhoneNumberInputValidationCode,\n PhoneNumberSelectedCountry,\n} from \"./types\"\n\nconst INVISIBLE_FORMATTING_CHARACTERS =\n /[\\u061C\\u200B-\\u200F\\u202A-\\u202E\\u2066-\\u2069\\uFEFF]/g\n\ntype ParsedInput = Omit<PhoneNumberChangeDetails, \"selectedCountry\"> & {\n displayValue: string\n lengthIssue: LengthIssue | null\n}\n\nfunction stripInvisibleFormatting(value: string) {\n return value.replace(INVISIBLE_FORMATTING_CHARACTERS, \"\")\n}\n\nfunction stripIddPrefix(digits: string) {\n for (const prefix of COMMON_IDD_PREFIXES) {\n if (digits.startsWith(prefix)) {\n return digits.slice(prefix.length)\n }\n }\n return digits\n}\n\nfunction normalizeImplicitInternationalInput(digits: string) {\n const candidate = `+${digits}`\n const { phoneNumber, detectedCountry } = formatWithAsYouType(candidate)\n\n if (phoneNumber?.isValid() && detectedCountry) {\n return candidate\n }\n\n return null\n}\n\nfunction normalizeExplicitInternationalInput(value: string) {\n const cleaned = stripInvisibleFormatting(value).trim()\n if (!cleaned) {\n return null\n }\n\n if (cleaned.startsWith(\"+\")) {\n const digits = sanitizeDigits(cleaned)\n if (!digits) {\n return \"+\"\n }\n\n const digitsWithoutIdd = stripIddPrefix(digits)\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : \"+\"\n }\n\n const digits = sanitizeDigits(cleaned)\n if (!digits) {\n return null\n }\n\n const digitsWithoutIdd = stripIddPrefix(digits)\n if (digitsWithoutIdd !== digits) {\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : \"+\"\n }\n\n return null\n}\n\nfunction normalizeInternationalInput(value: string) {\n const explicitInternational = normalizeExplicitInternationalInput(value)\n if (explicitInternational != null) {\n return explicitInternational\n }\n\n const cleaned = stripInvisibleFormatting(value).trim()\n const digits = sanitizeDigits(cleaned)\n if (!digits) {\n return null\n }\n\n return normalizeImplicitInternationalInput(digits)\n}\n\nfunction getDialCode(country: CountryCode | null, parsedDialCode: string | undefined) {\n if (parsedDialCode) {\n return parsedDialCode\n }\n return country ? getCountryCallingCode(country) : null\n}\n\nfunction getInputValueForSelectedCountry(\n value: string,\n option: Pick<CountryOption, \"dialCode\" | \"value\">,\n options?: { allowImplicitInternational?: boolean }\n) {\n const cleaned = stripInvisibleFormatting(value).trim()\n const digits = sanitizeDigits(cleaned)\n\n if (!digits) {\n return `+${option.dialCode}`\n }\n\n const normalizedInternational =\n options?.allowImplicitInternational === false\n ? normalizeExplicitInternationalInput(cleaned)\n : normalizeInternationalInput(cleaned)\n if (normalizedInternational) {\n const normalizedDigits = sanitizeDigits(normalizedInternational)\n if (normalizedDigits.startsWith(option.dialCode)) {\n return normalizedInternational\n }\n\n const { phoneNumber } = formatWithAsYouType(normalizedInternational)\n const currentDialCode = phoneNumber?.countryCallingCode\n const nationalDigits =\n currentDialCode && normalizedDigits.startsWith(currentDialCode)\n ? normalizedDigits.slice(currentDialCode.length)\n : phoneNumber?.nationalNumber ?? normalizedDigits\n\n return `+${option.dialCode}${nationalDigits}`\n }\n\n const { phoneNumber } = formatWithAsYouType(cleaned, option.value)\n return `+${option.dialCode}${phoneNumber?.nationalNumber ?? digits}`\n}\n\nfunction preferSelectedCountry(\n parsed: ParsedInput,\n option: Pick<CountryOption, \"dialCode\" | \"value\">\n): ParsedInput {\n return {\n ...parsed,\n country: option.value,\n countryCallingCode: option.dialCode,\n lengthIssue: getLengthIssue(parsed.rawInput, option.value),\n }\n}\n\nfunction parsePhoneInput(rawValue: string | undefined, baseCountry?: CountryCode): ParsedInput {\n const cleaned = stripInvisibleFormatting(rawValue ?? \"\").trim()\n\n if (!cleaned) {\n const country = baseCountry ?? null\n const countryCallingCode = country ? getCountryCallingCode(country) : null\n\n return {\n displayValue: \"\",\n formattedInternational: \"\",\n formattedNational: \"\",\n e164: null,\n country,\n countryCallingCode,\n nationalNumber: \"\",\n rawInput: \"\",\n isValid: false,\n lengthIssue: null,\n }\n }\n\n const normalizedInternational = normalizeInternationalInput(cleaned)\n const shouldFormat = normalizedInternational != null || baseCountry != null\n\n if (!shouldFormat) {\n return {\n displayValue: cleaned,\n formattedInternational: cleaned,\n formattedNational: cleaned,\n e164: null,\n country: null,\n countryCallingCode: null,\n nationalNumber: sanitizeDigits(cleaned),\n rawInput: cleaned,\n isValid: false,\n lengthIssue: null,\n }\n }\n\n const normalized = normalizedInternational ?? cleaned\n const {\n international,\n national,\n formatted,\n phoneNumber,\n detectedCountry,\n } = formatWithAsYouType(normalized, baseCountry)\n const hasInternationalPrefix = normalizedInternational != null\n const country = hasInternationalPrefix\n ? detectedCountry ?? baseCountry ?? null\n : baseCountry ?? detectedCountry ?? null\n const countryCallingCode = getDialCode(country, phoneNumber?.countryCallingCode)\n const normalizedDigits = sanitizeDigits(normalized)\n const nationalNumber =\n phoneNumber?.nationalNumber ??\n (countryCallingCode && normalized.startsWith(\"+\")\n ? stripPrefix(normalizedDigits, countryCallingCode)\n : sanitizeDigits(cleaned))\n const displayValue = hasInternationalPrefix ? international : formatted\n\n return {\n displayValue,\n formattedInternational: phoneNumber?.formatInternational() ?? international,\n formattedNational: phoneNumber?.formatNational() ?? national,\n e164: phoneNumber?.number ?? null,\n country,\n countryCallingCode,\n nationalNumber,\n rawInput: normalized,\n isValid: phoneNumber?.isValid() ?? false,\n lengthIssue: country ? getLengthIssue(normalized, country) : null,\n }\n}\n\nexport const PhoneNumberInput = React.forwardRef<HTMLInputElement, PhoneNumberInputProps>(\n function PhoneNumberInput(props, forwardedRef) {\n const {\n value,\n defaultCountry,\n country: countryProp,\n locale,\n onChange,\n onCountryChange,\n className,\n inputClassName,\n disabled,\n readOnly,\n selectProps,\n autofillShimName,\n messages: messagesProp,\n renderValidationMessage,\n ...restProps\n } = props\n\n const {\n onFocus: onInputFocus,\n onBlur: onInputBlur,\n onKeyDown: onInputKeyDown,\n name: inputName,\n autoComplete: inputAutoComplete,\n ...restInputProps\n } = restProps\n\n const controlledCountry = typeof countryProp === \"string\" ? countryProp : null\n const localeCacheKey = getLocaleCacheKey(locale)\n const localeForBuild = React.useMemo(\n () => parseLocaleCacheKey(localeCacheKey),\n [localeCacheKey]\n )\n const resolvedMessages = React.useMemo(\n () => resolveMessages(localeForBuild, messagesProp),\n [localeForBuild, messagesProp]\n )\n const countryOptions = React.useMemo(\n () => getCachedCountryOptions(localeForBuild, localeCacheKey),\n [localeCacheKey, localeForBuild]\n )\n const resolveSelectedCountry = React.useCallback(\n (country: CountryCode): PhoneNumberSelectedCountry => {\n const match = countryOptions.find((candidate) => candidate.value === country)\n if (match) {\n return toSelectedCountry(match)\n }\n return buildFallbackSelectedCountry(country)\n },\n [countryOptions]\n )\n const menuPriorityCountry = React.useMemo(() => {\n const candidate = getValidCountry(defaultCountry ?? countryProp ?? DEFAULT_COUNTRY)\n if (countryOptions.some((option) => option.value === candidate)) {\n return candidate\n }\n return countryOptions[0]?.value ?? DEFAULT_COUNTRY\n }, [countryOptions, countryProp, defaultCountry])\n\n const initialStateRef = React.useRef<ParsedInput | null>(null)\n\n if (!initialStateRef.current) {\n const initialState = parsePhoneInput(value, controlledCountry ?? undefined)\n initialStateRef.current = initialState\n }\n\n const initialState = initialStateRef.current\n\n const [uncontrolledCountry, setUncontrolledCountry] = React.useState<CountryCode | null>(\n controlledCountry ? null : initialState.country\n )\n const [inputValueState, setInputValueState] = React.useState(initialState.displayValue)\n const [countryQuery, setCountryQuery] = React.useState(\"\")\n const [showSuggestions, setShowSuggestions] = React.useState(false)\n const [highlightedIndex, setHighlightedIndex] = React.useState<number>(-1)\n const [isFocused, setIsFocused] = React.useState(false)\n const [lengthIssue, setLengthIssue] = React.useState<LengthIssue | null>(\n initialState.lengthIssue\n )\n\n const manualSelectionCountryRef = React.useRef<CountryCode | null>(null)\n const keyboardBufferRef = React.useRef(\"\")\n const bufferTimeoutRef = React.useRef<number | null>(null)\n const scrollBehaviorRef = React.useRef<ScrollBehavior>(\"smooth\")\n const pendingSelectionRef = React.useRef<{ start: number; end: number } | null>(null)\n const hasNotifiedCountryRef = React.useRef(false)\n const lastNotifiedCountryRef = React.useRef<CountryCode | null>(null)\n const inputRef = React.useRef<HTMLInputElement | null>(null)\n\n const activeCountry = controlledCountry ?? uncontrolledCountry\n const explicitFormattingCountry = controlledCountry ?? manualSelectionCountryRef.current ?? undefined\n\n React.useImperativeHandle(forwardedRef, () => inputRef.current as HTMLInputElement, [])\n\n React.useLayoutEffect(() => {\n const selection = pendingSelectionRef.current\n if (!selection) {\n return\n }\n\n const input = inputRef.current\n pendingSelectionRef.current = null\n if (!input) {\n return\n }\n\n const { start, end } = selection\n input.setSelectionRange(start, end)\n }, [inputValueState])\n\n const selectOverrides = selectProps ?? {}\n const {\n styles: userSelectStyles,\n components: userSelectComponents,\n classNamePrefix: userClassNamePrefix,\n formatOptionLabel: userFormatOptionLabel,\n menuPortalTarget: userMenuPortalTarget,\n menuPosition: userMenuPosition,\n ...forwardedSelectProps\n } = selectOverrides\n const { noOptionsMessage, ...restForwardedSelectProps } = forwardedSelectProps\n const [defaultMenuPortalTarget, setDefaultMenuPortalTarget] =\n React.useState<HTMLElement | null>(null)\n const hasUserMenuPortalTarget = \"menuPortalTarget\" in selectOverrides\n const menuPortalTarget = hasUserMenuPortalTarget\n ? userMenuPortalTarget\n : defaultMenuPortalTarget\n\n const mergedSelectStyles = React.useMemo<StylesConfig<CountryOption, false>>(\n () => {\n const userMenuPortal = userSelectStyles?.menuPortal\n\n return {\n ...suggestionSelectStyles,\n ...(userSelectStyles ?? {}),\n menuPortal: (provided, state) => {\n const baseWithZIndex = {\n ...provided,\n zIndex: 1300,\n }\n const base = userMenuPortal ? userMenuPortal(baseWithZIndex, state) : baseWithZIndex\n\n if (typeof document === \"undefined\" || !menuPortalTarget || menuPortalTarget === document.body) {\n return base\n }\n\n const portalRect = menuPortalTarget.getBoundingClientRect()\n return {\n ...base,\n left: typeof base.left === \"number\" ? base.left - portalRect.left : base.left,\n top: typeof base.top === \"number\" ? base.top - portalRect.top : base.top,\n }\n },\n }\n },\n [menuPortalTarget, userSelectStyles]\n )\n\n React.useLayoutEffect(() => {\n if (hasUserMenuPortalTarget || typeof document === \"undefined\") {\n return\n }\n\n const portalTarget =\n inputRef.current?.closest<HTMLElement>(\n \"[data-slot='dialog-content'], [data-slot='sheet-content'], [role='dialog']\"\n ) ?? document.body\n setDefaultMenuPortalTarget(portalTarget)\n }, [hasUserMenuPortalTarget])\n\n const mergedSelectComponents = React.useMemo(() => {\n const baseComponents = {\n Control: HiddenControl,\n IndicatorsContainer: NullComponent,\n DropdownIndicator: NullComponent,\n IndicatorSeparator: NullComponent,\n ValueContainer: NullComponent,\n }\n\n const overrides = userSelectComponents ?? {}\n\n if (!overrides.Option) {\n return {\n ...baseComponents,\n ...overrides,\n Option: SuggestionOption,\n }\n }\n\n return {\n ...baseComponents,\n ...overrides,\n }\n }, [userSelectComponents])\n\n React.useEffect(() => () => {\n if (bufferTimeoutRef.current != null && typeof window !== \"undefined\") {\n window.clearTimeout(bufferTimeoutRef.current)\n }\n }, [])\n\n React.useEffect(() => {\n if (value == null) {\n return\n }\n\n const parsed = parsePhoneInput(value, explicitFormattingCountry)\n keyboardBufferRef.current = \"\"\n\n setInputValueState(parsed.displayValue)\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(parsed.lengthIssue)\n\n if (!controlledCountry && parsed.country !== uncontrolledCountry) {\n setUncontrolledCountry(parsed.country)\n }\n }, [controlledCountry, explicitFormattingCountry, uncontrolledCountry, value])\n\n React.useEffect(() => {\n const country = activeCountry ?? null\n if (!hasNotifiedCountryRef.current && country == null) {\n return\n }\n\n if (hasNotifiedCountryRef.current && lastNotifiedCountryRef.current === country) {\n return\n }\n\n hasNotifiedCountryRef.current = true\n lastNotifiedCountryRef.current = country\n onCountryChange?.(country, country ? resolveSelectedCountry(country) : null)\n }, [activeCountry, onCountryChange, resolveSelectedCountry])\n\n const emitChange = React.useCallback(\n (details: Omit<PhoneNumberChangeDetails, \"selectedCountry\">) => {\n onChange?.({\n ...details,\n selectedCountry: details.country ? resolveSelectedCountry(details.country) : null,\n })\n },\n [onChange, resolveSelectedCountry]\n )\n\n const scheduleBufferReset = React.useCallback(() => {\n if (typeof window === \"undefined\") {\n return\n }\n\n if (bufferTimeoutRef.current != null) {\n window.clearTimeout(bufferTimeoutRef.current)\n }\n\n bufferTimeoutRef.current = window.setTimeout(() => {\n keyboardBufferRef.current = \"\"\n bufferTimeoutRef.current = null\n }, 800)\n }, [])\n\n const applyParsedInput = React.useCallback(\n (parsed: ParsedInput, snapshot: ReturnType<typeof captureSelectionSnapshot> | null) => {\n setInputValueState(parsed.displayValue)\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(parsed.lengthIssue)\n\n if (!controlledCountry && parsed.country !== uncontrolledCountry) {\n setUncontrolledCountry(parsed.country)\n }\n\n if (snapshot) {\n pendingSelectionRef.current = resolveSelection(snapshot, parsed.displayValue)\n }\n\n emitChange({\n formattedInternational: parsed.formattedInternational,\n formattedNational: parsed.formattedNational,\n e164: parsed.e164,\n country: parsed.country,\n countryCallingCode: parsed.countryCallingCode,\n nationalNumber: parsed.nationalNumber,\n rawInput: parsed.rawInput,\n isValid: parsed.isValid,\n })\n },\n [controlledCountry, emitChange, uncontrolledCountry]\n )\n\n const handleInputChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const target = event.target\n const snapshot = captureSelectionSnapshot(target)\n const raw = target.value\n keyboardBufferRef.current = \"\"\n\n const normalizedExplicitInternational = normalizeExplicitInternationalInput(raw)\n const manualCountry = manualSelectionCountryRef.current\n if (normalizedExplicitInternational != null && manualCountry) {\n const manualDialCode = getCountryCallingCode(manualCountry)\n if (!sanitizeDigits(normalizedExplicitInternational).startsWith(manualDialCode)) {\n manualSelectionCountryRef.current = null\n }\n } else if (normalizedExplicitInternational != null) {\n manualSelectionCountryRef.current = null\n }\n\n const activeManualCountry = manualSelectionCountryRef.current\n const rawDigits = sanitizeDigits(raw)\n if (\n !controlledCountry &&\n activeManualCountry &&\n normalizedExplicitInternational == null &&\n rawDigits\n ) {\n const manualOption = {\n value: activeManualCountry,\n dialCode: getCountryCallingCode(activeManualCountry),\n }\n const parsed = preferSelectedCountry(\n parsePhoneInput(\n getInputValueForSelectedCountry(\n raw,\n {\n value: manualOption.value,\n dialCode: manualOption.dialCode,\n },\n { allowImplicitInternational: false }\n ),\n activeManualCountry\n ),\n manualOption\n )\n applyParsedInput(parsed, snapshot)\n return\n }\n\n const baseCountry = controlledCountry ?? activeManualCountry ?? undefined\n const parsed = parsePhoneInput(raw, baseCountry)\n applyParsedInput(parsed, snapshot)\n },\n [applyParsedInput, controlledCountry]\n )\n\n const handleCountrySelect = React.useCallback(\n (option: SingleValue<CountryOption>) => {\n if (!option) {\n return\n }\n\n manualSelectionCountryRef.current = option.value\n const nextInputValue = getInputValueForSelectedCountry(inputValueState, option)\n const parsed = preferSelectedCountry(\n parsePhoneInput(nextInputValue, option.value),\n option\n )\n\n setInputValueState(parsed.displayValue)\n pendingSelectionRef.current = {\n start: parsed.displayValue.length,\n end: parsed.displayValue.length,\n }\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(parsed.lengthIssue)\n\n if (!controlledCountry) {\n setUncontrolledCountry(option.value)\n }\n\n emitChange({\n formattedInternational: parsed.formattedInternational,\n formattedNational: parsed.formattedNational,\n e164: parsed.e164,\n country: parsed.country,\n countryCallingCode: parsed.countryCallingCode,\n nationalNumber: parsed.nationalNumber,\n rawInput: parsed.rawInput,\n isValid: parsed.isValid,\n })\n\n requestAnimationFrame(() => {\n inputRef.current?.focus()\n })\n },\n [controlledCountry, emitChange, inputValueState]\n )\n\n const filteredOptions = React.useMemo(() => {\n if (!showSuggestions) {\n return [] as CountryOption[]\n }\n\n const results: CountryOption[] = []\n\n const pushUnique = (option: CountryOption | undefined) => {\n if (option && !results.some((existing) => existing.value === option.value)) {\n results.push(option)\n }\n }\n\n const priorityOption = countryOptions.find((option) => option.value === menuPriorityCountry)\n const currentOption = activeCountry\n ? countryOptions.find((option) => option.value === activeCountry)\n : undefined\n const query = countryQuery.trim()\n const digitQuery = sanitizeDigits(query)\n const normalizedQuery = normalizeSearchValue(query)\n\n if (!digitQuery && !normalizedQuery) {\n pushUnique(currentOption)\n pushUnique(priorityOption)\n countryOptions.forEach(pushUnique)\n return results\n }\n\n if (digitQuery) {\n const dialMatches = countryOptions\n .filter((option) => option.dialCode.startsWith(digitQuery))\n .sort((a, b) => {\n const aExact = a.dialCode === digitQuery\n const bExact = b.dialCode === digitQuery\n if (aExact && !bExact) {\n return -1\n }\n if (!aExact && bExact) {\n return 1\n }\n return a.dialCode.length - b.dialCode.length\n })\n dialMatches.forEach(pushUnique)\n }\n\n if (normalizedQuery) {\n const nameMatches = countryOptions\n .filter((option) =>\n option.normalizedSearchableTokens.some((token) => token.includes(normalizedQuery))\n )\n .sort((a, b) => {\n const aIndex = optionMatchIndex(a.normalizedSearchableTokens, normalizedQuery)\n const bIndex = optionMatchIndex(b.normalizedSearchableTokens, normalizedQuery)\n if (aIndex !== bIndex) {\n return aIndex - bIndex\n }\n return a.name.localeCompare(b.name)\n })\n nameMatches.forEach(pushUnique)\n }\n\n pushUnique(currentOption)\n pushUnique(priorityOption)\n if (results.length === 0) {\n countryOptions.forEach(pushUnique)\n }\n\n return results\n }, [activeCountry, countryOptions, countryQuery, menuPriorityCountry, showSuggestions])\n\n const suggestionMenuIsOpen = isFocused && showSuggestions && filteredOptions.length > 0\n\n React.useEffect(() => {\n if (!suggestionMenuIsOpen) {\n scrollBehaviorRef.current = \"smooth\"\n }\n }, [suggestionMenuIsOpen])\n\n React.useEffect(() => {\n if (!suggestionMenuIsOpen) {\n setHighlightedIndex(-1)\n return\n }\n\n if (filteredOptions.length === 0) {\n setHighlightedIndex(-1)\n return\n }\n\n setHighlightedIndex((current) => {\n if (current < 0 || current >= filteredOptions.length) {\n return 0\n }\n return current\n })\n }, [filteredOptions, suggestionMenuIsOpen])\n\n const highlightedOption =\n highlightedIndex >= 0 ? filteredOptions[highlightedIndex] ?? null : null\n\n React.useEffect(() => {\n if (highlightedIndex < 0) {\n scrollBehaviorRef.current = \"smooth\"\n }\n }, [highlightedIndex])\n\n const consumeScrollBehavior = React.useCallback(() => {\n const behavior = scrollBehaviorRef.current\n scrollBehaviorRef.current = \"smooth\"\n return behavior\n }, [])\n\n const updateHighlightedOption = React.useCallback(\n (option: CountryOption) => {\n const index = filteredOptions.findIndex((candidate) => candidate.value === option.value)\n if (index !== -1) {\n setHighlightedIndex(index)\n }\n },\n [filteredOptions]\n )\n\n const selectFormatOptionLabel = React.useCallback<\n NonNullable<SelectProps<CountryOption, false>[\"formatOptionLabel\"]>\n >(\n (option, meta) => {\n if (userFormatOptionLabel) {\n return userFormatOptionLabel(option, meta)\n }\n return formatCountryOption(option)\n },\n [userFormatOptionLabel]\n )\n\n const optionLabelRenderer = React.useCallback(\n (option: CountryOption) =>\n selectFormatOptionLabel(option, {\n context: \"menu\",\n inputValue: countryQuery,\n selectValue: [],\n }),\n [countryQuery, selectFormatOptionLabel]\n )\n\n const highlightContextValue = React.useMemo<SuggestionContextValue>(\n () => ({\n highlightedValue: highlightedOption?.value ?? null,\n setHighlightedOption: updateHighlightedOption,\n renderOptionLabel: optionLabelRenderer,\n consumeScrollBehavior,\n }),\n [consumeScrollBehavior, highlightedOption, optionLabelRenderer, updateHighlightedOption]\n )\n\n const activeOption = activeCountry\n ? countryOptions.find((option) => option.value === activeCountry)\n : undefined\n const activeFlag = activeOption?.flag ?? \"\"\n const inlineFlagLabel = activeCountry\n ? resolvedMessages.selectedCountryLabel(activeOption?.name ?? activeCountry)\n : resolvedMessages.selectCountryLabel\n const hasInlineFlag = Boolean(activeCountry && activeFlag)\n const lengthHint =\n lengthIssue === \"TOO_LONG\"\n ? resolvedMessages.lengthTooLong(activeOption?.name ?? activeCountry ?? null)\n : null\n const countryName = activeOption?.name ?? activeCountry ?? null\n\n let validationNode: React.ReactNode = null\n if (lengthHint) {\n const rendered = renderValidationMessage?.({\n message: lengthHint,\n code: \"TOO_LONG\",\n countryName,\n })\n validationNode =\n rendered === undefined ? (\n <p className=\"mt-1 text-xs text-destructive\">\n <span>{lengthHint}</span>\n </p>\n ) : (\n rendered\n )\n }\n\n const appendToBuffer = React.useCallback(\n (char: string) => {\n keyboardBufferRef.current = `${keyboardBufferRef.current}${char}`.slice(-12)\n setCountryQuery(keyboardBufferRef.current)\n setShowSuggestions(true)\n scheduleBufferReset()\n },\n [scheduleBufferReset]\n )\n\n const popBuffer = React.useCallback(() => {\n const current = keyboardBufferRef.current\n if (!current) {\n return\n }\n keyboardBufferRef.current = current.slice(0, -1)\n setCountryQuery(keyboardBufferRef.current)\n if (keyboardBufferRef.current) {\n scheduleBufferReset()\n }\n }, [scheduleBufferReset])\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n onInputKeyDown?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n const key = event.key\n\n if (event.metaKey || event.ctrlKey || event.altKey) {\n return\n }\n\n const target = event.currentTarget\n const value = target.value\n const selectionStart = target.selectionStart ?? 0\n const selectionEnd = target.selectionEnd ?? selectionStart\n const isCollapsedSelection = selectionStart === selectionEnd\n\n if (key === \"Backspace\" && isCollapsedSelection) {\n const nextStart = skipFormattingCharactersLeft(value, selectionStart)\n if (nextStart !== selectionStart) {\n target.setSelectionRange(nextStart, nextStart)\n }\n } else if (key === \"ArrowLeft\" && isCollapsedSelection) {\n const nextStart = skipFormattingCharactersLeft(value, selectionStart)\n if (nextStart !== selectionStart) {\n event.preventDefault()\n target.setSelectionRange(nextStart, nextStart)\n return\n }\n } else if (key === \"ArrowRight\" && isCollapsedSelection) {\n const nextStart = skipFormattingCharactersRight(value, selectionEnd)\n if (nextStart !== selectionEnd) {\n event.preventDefault()\n target.setSelectionRange(nextStart, nextStart)\n return\n }\n }\n\n if (key === \"ArrowDown\") {\n scrollBehaviorRef.current = event.repeat ? \"auto\" : \"smooth\"\n event.preventDefault()\n if (!showSuggestions) {\n setShowSuggestions(true)\n setHighlightedIndex(filteredOptions.length > 0 ? 0 : -1)\n return\n }\n\n if (filteredOptions.length > 0) {\n setHighlightedIndex((current) => {\n const next = current < 0 ? 0 : (current + 1) % filteredOptions.length\n return next\n })\n }\n return\n }\n\n if (key === \"ArrowUp\") {\n scrollBehaviorRef.current = event.repeat ? \"auto\" : \"smooth\"\n event.preventDefault()\n if (!showSuggestions) {\n setShowSuggestions(true)\n setHighlightedIndex(filteredOptions.length > 0 ? filteredOptions.length - 1 : -1)\n return\n }\n\n if (filteredOptions.length > 0) {\n setHighlightedIndex((current) => {\n if (current < 0) {\n return filteredOptions.length - 1\n }\n return (current - 1 + filteredOptions.length) % filteredOptions.length\n })\n }\n return\n }\n\n if (/^[a-z]$/i.test(key)) {\n event.preventDefault()\n if (!showSuggestions) {\n setShowSuggestions(true)\n setHighlightedIndex(filteredOptions.length > 0 ? 0 : -1)\n }\n appendToBuffer(key.toLowerCase())\n return\n }\n\n if (suggestionMenuIsOpen) {\n if (key === \"Backspace\" && keyboardBufferRef.current) {\n event.preventDefault()\n popBuffer()\n return\n }\n\n if (key === \"Escape\") {\n event.preventDefault()\n keyboardBufferRef.current = \"\"\n setCountryQuery(\"\")\n setShowSuggestions(false)\n return\n }\n\n if (key === \"Enter\" && filteredOptions.length > 0) {\n event.preventDefault()\n const targetOption = highlightedOption ?? filteredOptions[0]\n handleCountrySelect(targetOption)\n return\n }\n }\n },\n [\n appendToBuffer,\n filteredOptions,\n handleCountrySelect,\n highlightedOption,\n onInputKeyDown,\n popBuffer,\n showSuggestions,\n suggestionMenuIsOpen,\n ]\n )\n\n const handleFocus = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(true)\n onInputFocus?.(event)\n },\n [onInputFocus]\n )\n\n const handleBlur = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(false)\n setShowSuggestions(false)\n keyboardBufferRef.current = \"\"\n setCountryQuery(\"\")\n onInputBlur?.(event)\n },\n [onInputBlur]\n )\n\n const openCountryMenu = React.useCallback(() => {\n if (disabled || readOnly) {\n return\n }\n\n keyboardBufferRef.current = \"\"\n setCountryQuery(\"\")\n setShowSuggestions(true)\n setHighlightedIndex((current) => (current < 0 ? 0 : current))\n\n requestAnimationFrame(() => {\n inputRef.current?.focus()\n })\n }, [disabled, readOnly])\n\n const shimName = autofillShimName ?? (inputName ? `${inputName}_shim` : undefined)\n\n return (\n <div className={cn(\"relative flex flex-col\", className)}>\n <div className=\"relative\">\n <input\n {...restInputProps}\n ref={inputRef}\n type=\"tel\"\n className={cn(\n \"flex h-10 w-full rounded-md border border-input bg-background py-2 text-base ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"pl-11 pr-3\",\n inputClassName\n )}\n name={inputName}\n value={inputValueState}\n onChange={handleInputChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n disabled={disabled}\n readOnly={readOnly}\n autoComplete={inputAutoComplete ?? \"off\"}\n />\n <button\n type=\"button\"\n className={cn(\n \"absolute left-3 top-1/2 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded border text-lg leading-none transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n hasInlineFlag\n ? \"border-transparent\"\n : \"border-dashed border-border text-muted-foreground\",\n disabled\n ? \"cursor-not-allowed opacity-50\"\n : readOnly\n ? \"cursor-default\"\n : \"cursor-pointer hover:bg-muted\"\n )}\n aria-label={inlineFlagLabel}\n onMouseDown={(event) => event.preventDefault()}\n onClick={openCountryMenu}\n tabIndex={-1}\n disabled={disabled}\n >\n <span aria-hidden=\"true\">\n {hasInlineFlag ? activeFlag : \"?\"}\n </span>\n </button>\n </div>\n\n {shimName ? (\n <input\n tabIndex={-1}\n autoComplete=\"tel\"\n name={shimName}\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute left-0 top-0 h-0 w-0 opacity-0\"\n />\n ) : null}\n\n <div\n className=\"absolute left-0 top-full z-30 mt-1\"\n style={{\n pointerEvents: suggestionMenuIsOpen ? \"auto\" : \"none\",\n width: \"min(260px, 100%)\",\n }}\n onMouseDown={(event) => event.preventDefault()}\n >\n <SuggestionContext.Provider value={highlightContextValue}>\n <Select<CountryOption, false>\n {...restForwardedSelectProps}\n menuIsOpen={suggestionMenuIsOpen}\n options={filteredOptions}\n value={null}\n components={mergedSelectComponents}\n styles={mergedSelectStyles}\n isClearable={false}\n isSearchable={false}\n backspaceRemovesValue={false}\n tabSelectsValue={false}\n menuShouldScrollIntoView={false}\n menuPortalTarget={menuPortalTarget}\n menuPosition={userMenuPosition ?? (menuPortalTarget ? \"fixed\" : \"absolute\")}\n onChange={handleCountrySelect}\n classNamePrefix={userClassNamePrefix ?? \"phone-number-suggestions\"}\n placeholder=\"\"\n formatOptionLabel={selectFormatOptionLabel}\n noOptionsMessage={\n noOptionsMessage ?? (() => resolvedMessages.noMatches)\n }\n />\n </SuggestionContext.Provider>\n </div>\n\n {validationNode}\n </div>\n )\n }\n)\n\nPhoneNumberInput.displayName = \"PhoneNumberInput\"\n"],"names":["INVISIBLE_FORMATTING_CHARACTERS","stripInvisibleFormatting","value","replace","stripIddPrefix","digits","prefix","COMMON_IDD_PREFIXES","startsWith","slice","length","normalizeImplicitInternationalInput","candidate","phoneNumber","detectedCountry","formatWithAsYouType","isValid","normalizeExplicitInternationalInput","cleaned","trim","sanitizeDigits","digitsWithoutIdd","normalizeInternationalInput","explicitInternational","getDialCode","country","parsedDialCode","getCountryCallingCode","getInputValueForSelectedCountry","option","options","dialCode","normalizedInternational","allowImplicitInternational","normalizedDigits","currentDialCode","countryCallingCode","nationalDigits","nationalNumber","preferSelectedCountry","parsed","lengthIssue","getLengthIssue","rawInput","parsePhoneInput","rawValue","baseCountry","displayValue","formattedInternational","formattedNational","e164","normalized","international","national","formatted","hasInternationalPrefix","stripPrefix","formatInternational","formatNational","number","PhoneNumberInput","React","forwardRef","props","forwardedRef","defaultCountry","countryProp","locale","onChange","onCountryChange","className","inputClassName","disabled","readOnly","selectProps","autofillShimName","messages","messagesProp","renderValidationMessage","restProps","onFocus","onInputFocus","onBlur","onInputBlur","onKeyDown","onInputKeyDown","name","inputName","autoComplete","inputAutoComplete","restInputProps","controlledCountry","localeCacheKey","getLocaleCacheKey","localeForBuild","useMemo","parseLocaleCacheKey","resolvedMessages","resolveMessages","countryOptions","getCachedCountryOptions","resolveSelectedCountry","useCallback","match","find","toSelectedCountry","buildFallbackSelectedCountry","menuPriorityCountry","getValidCountry","DEFAULT_COUNTRY","some","initialStateRef","useRef","current","initialState","undefined","uncontrolledCountry","setUncontrolledCountry","useState","inputValueState","setInputValueState","countryQuery","setCountryQuery","showSuggestions","setShowSuggestions","highlightedIndex","setHighlightedIndex","isFocused","setIsFocused","setLengthIssue","manualSelectionCountryRef","keyboardBufferRef","bufferTimeoutRef","scrollBehaviorRef","pendingSelectionRef","hasNotifiedCountryRef","lastNotifiedCountryRef","inputRef","activeCountry","explicitFormattingCountry","useImperativeHandle","useLayoutEffect","selection","input","start","end","setSelectionRange","selectOverrides","styles","userSelectStyles","components","userSelectComponents","classNamePrefix","userClassNamePrefix","formatOptionLabel","userFormatOptionLabel","menuPortalTarget","userMenuPortalTarget","menuPosition","userMenuPosition","forwardedSelectProps","noOptionsMessage","restForwardedSelectProps","defaultMenuPortalTarget","setDefaultMenuPortalTarget","hasUserMenuPortalTarget","mergedSelectStyles","userMenuPortal","menuPortal","suggestionSelectStyles","provided","state","baseWithZIndex","zIndex","base","document","body","portalRect","getBoundingClientRect","left","top","portalTarget","closest","mergedSelectComponents","baseComponents","Control","HiddenControl","IndicatorsContainer","NullComponent","DropdownIndicator","IndicatorSeparator","ValueContainer","overrides","Option","SuggestionOption","useEffect","window","clearTimeout","emitChange","details","selectedCountry","scheduleBufferReset","setTimeout","applyParsedInput","snapshot","resolveSelection","handleInputChange","event","target","captureSelectionSnapshot","raw","normalizedExplicitInternational","manualCountry","manualDialCode","activeManualCountry","rawDigits","manualOption","handleCountrySelect","nextInputValue","requestAnimationFrame","focus","filteredOptions","results","pushUnique","existing","push","priorityOption","currentOption","query","digitQuery","normalizedQuery","normalizeSearchValue","forEach","filter","sort","a","b","aExact","bExact","normalizedSearchableTokens","token","includes","aIndex","optionMatchIndex","bIndex","localeCompare","suggestionMenuIsOpen","highlightedOption","consumeScrollBehavior","behavior","updateHighlightedOption","index","findIndex","selectFormatOptionLabel","meta","formatCountryOption","optionLabelRenderer","context","inputValue","selectValue","highlightContextValue","highlightedValue","setHighlightedOption","renderOptionLabel","activeOption","activeFlag","flag","inlineFlagLabel","selectedCountryLabel","selectCountryLabel","hasInlineFlag","Boolean","lengthHint","lengthTooLong","countryName","validationNode","rendered","message","code","jsx","appendToBuffer","char","popBuffer","handleKeyDown","defaultPrevented","key","metaKey","ctrlKey","altKey","currentTarget","selectionStart","selectionEnd","isCollapsedSelection","nextStart","skipFormattingCharactersLeft","preventDefault","skipFormattingCharactersRight","repeat","test","toLowerCase","targetOption","handleFocus","handleBlur","openCountryMenu","shimName","cn","jsxs","pointerEvents","width","SuggestionContext","Select","noMatches","displayName"],"mappings":";;;;;;;;;;AA+DA,MAAMA,KACJ;AAOF,SAASC,GAAyBC,GAAe;AAC/C,SAAOA,EAAMC,QAAQH,IAAiC,EAAE;AAC1D;AAEA,SAASI,GAAeC,GAAgB;AACtC,aAAWC,KAAUC;AACnB,QAAIF,EAAOG,WAAWF,CAAM;AAC1B,aAAOD,EAAOI,MAAMH,EAAOI,MAAM;AAGrC,SAAOL;AACT;AAEA,SAASM,GAAoCN,GAAgB;AAC3D,QAAMO,IAAY,IAAIP,CAAM,IACtB;AAAA,IAAEQ,aAAAA;AAAAA,IAAaC,iBAAAA;AAAAA,EAAAA,IAAoBC,GAAoBH,CAAS;AAEtE,SAAIC,GAAaG,QAAAA,KAAaF,IACrBF,IAGF;AACT;AAEA,SAASK,GAAoCf,GAAe;AAC1D,QAAMgB,IAAUjB,GAAyBC,CAAK,EAAEiB,KAAAA;AAChD,MAAI,CAACD;AACH,WAAO;AAGT,MAAIA,EAAQV,WAAW,GAAG,GAAG;AAC3B,UAAMH,IAASe,EAAeF,CAAO;AACrC,QAAI,CAACb;AACH,aAAO;AAGT,UAAMgB,IAAmBjB,GAAeC,CAAM;AAC9C,WAAOgB,IAAmB,IAAIA,CAAgB,KAAK;AAAA,EACrD;AAEA,QAAMhB,IAASe,EAAeF,CAAO;AACrC,MAAI,CAACb;AACH,WAAO;AAGT,QAAMgB,IAAmBjB,GAAeC,CAAM;AAC9C,SAAIgB,MAAqBhB,IAChBgB,IAAmB,IAAIA,CAAgB,KAAK,MAG9C;AACT;AAEA,SAASC,GAA4BpB,GAAe;AAClD,QAAMqB,IAAwBN,GAAoCf,CAAK;AACvE,MAAIqB,KAAyB;AAC3B,WAAOA;AAGT,QAAML,IAAUjB,GAAyBC,CAAK,EAAEiB,KA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AAA,MAAC8B,GAAkB,UAAlB,EAA2B,OAAOjD,IACjC,UAAAmB,gBAAAA,EAAAA,IAAC+B,MACC,GAAIpJ,IACJ,YAAYoF,GACZ,SAASzB,GACT,OAAO,MACP,YAAYtC,IACZ,QAAQjB,IACR,aAAa,IACb,cAAc,IACd,uBAAuB,IACvB,iBAAiB,IACjB,0BAA0B,IAC1B,kBAAAV,GACA,cAAcG,OAAqBH,IAAmB,UAAU,aAChE,UAAU6D,IACV,iBAAiBhE,MAAuB,4BACxC,aAAY,IACZ,mBAAmBoG,IACnB,kBACE5F,OAAqB,MAAMhE,EAAiBsN,WAAAA,CAC7C,EAAA,CAEL,EAAA,CACF;AAAA,IAECpC;AAAAA,EAAAA,GACH;AAEJ,CACF;AAEAvN,GAAiB4P,cAAc;"}
package/dist/index180.js CHANGED
@@ -1,8 +1,8 @@
1
- import { DateLib as t } from "./index152.js";
2
- function a(c, e, r) {
3
- return (r ?? new t(e)).format(c, "cccccc");
4
- }
1
+ import { CommonPopupDataAttributes as e } from "./index173.js";
2
+ let y = (function(n) {
3
+ return n[n.open = e.open] = "open", n[n.closed = e.closed] = "closed", n[n.startingStyle = e.startingStyle] = "startingStyle", n[n.endingStyle = e.endingStyle] = "endingStyle", n.nested = "data-nested", n.nestedDialogOpen = "data-nested-dialog-open", n;
4
+ })({});
5
5
  export {
6
- a as formatWeekdayName
6
+ y as DialogPopupDataAttributes
7
7
  };
8
8
  //# sourceMappingURL=index180.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index180.js","sources":["../../../node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js"],"sourcesContent":["import { DateLib } from \"../classes/DateLib.js\";\n/**\n * Formats the name of a weekday to be displayed in the weekdays header.\n *\n * @defaultValue `cccccc` (e.g., \"Mo\" for Monday).\n * @param weekday The date representing the weekday.\n * @param options Configuration options for the date library.\n * @param dateLib The date library to use for formatting. If not provided, a new\n * instance is created.\n * @returns The formatted weekday name as a string.\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatWeekdayName(weekday, options, dateLib) {\n return (dateLib ?? new DateLib(options)).format(weekday, \"cccccc\");\n}\n"],"names":["formatWeekdayName","weekday","options","dateLib","DateLib"],"mappings":";AAaO,SAASA,EAAkBC,GAASC,GAASC,GAAS;AACzD,UAAQA,KAAW,IAAIC,EAAQF,CAAO,GAAG,OAAOD,GAAS,QAAQ;AACrE;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index180.js","sources":["../../../node_modules/@base-ui/react/esm/dialog/popup/DialogPopupDataAttributes.js"],"sourcesContent":["import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.js\";\nexport let DialogPopupDataAttributes = function (DialogPopupDataAttributes) {\n /**\n * Present when the dialog is open.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"open\"] = CommonPopupDataAttributes.open] = \"open\";\n /**\n * Present when the dialog is closed.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"closed\"] = CommonPopupDataAttributes.closed] = \"closed\";\n /**\n * Present when the dialog is animating in.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"startingStyle\"] = CommonPopupDataAttributes.startingStyle] = \"startingStyle\";\n /**\n * Present when the dialog is animating out.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"endingStyle\"] = CommonPopupDataAttributes.endingStyle] = \"endingStyle\";\n /**\n * Present when the dialog is nested within another dialog.\n */\n DialogPopupDataAttributes[\"nested\"] = \"data-nested\";\n /**\n * Present when the dialog has other open dialogs nested within it.\n */\n DialogPopupDataAttributes[\"nestedDialogOpen\"] = \"data-nested-dialog-open\";\n return DialogPopupDataAttributes;\n}({});"],"names":["DialogPopupDataAttributes","CommonPopupDataAttributes"],"mappings":";AACU,IAACA,KAA4B,SAAUA,GAA2B;AAI1E,SAAAA,EAA0BA,EAA0B,OAAUC,EAA0B,IAAI,IAAI,QAIhGD,EAA0BA,EAA0B,SAAYC,EAA0B,MAAM,IAAI,UAIpGD,EAA0BA,EAA0B,gBAAmBC,EAA0B,aAAa,IAAI,iBAIlHD,EAA0BA,EAA0B,cAAiBC,EAA0B,WAAW,IAAI,eAI9GD,EAA0B,SAAY,eAItCA,EAA0B,mBAAsB,2BACzCA;AACT,GAAE,CAAA,CAAE;","x_google_ignoreList":[0]}
package/dist/index181.js CHANGED
@@ -1,8 +1,15 @@
1
- import { defaultDateLib as o } from "./index152.js";
2
- function a(r, t = o) {
3
- return r < 10 ? t.formatNumber(`0${r.toLocaleString()}`) : t.formatNumber(`${r.toLocaleString()}`);
1
+ import r from "./index191.js";
2
+ import * as t from "react";
3
+ const e = /* @__PURE__ */ t.createContext(void 0);
4
+ process.env.NODE_ENV !== "production" && (e.displayName = "DialogPortalContext");
5
+ function a() {
6
+ const o = t.useContext(e);
7
+ if (o === void 0)
8
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Dialog.Portal> is missing." : r(26));
9
+ return o;
4
10
  }
5
11
  export {
6
- a as formatWeekNumber
12
+ e as DialogPortalContext,
13
+ a as useDialogPortalContext
7
14
  };
8
15
  //# sourceMappingURL=index181.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index181.js","sources":["../../../node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js"],"sourcesContent":["import { defaultDateLib } from \"../classes/DateLib.js\";\n/**\n * Formats the week number.\n *\n * @defaultValue The week number as a string, with a leading zero for single-digit numbers.\n * @param weekNumber The week number to format.\n * @param dateLib The date library to use for formatting. Defaults to\n * `defaultDateLib`.\n * @returns The formatted week number as a string.\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatWeekNumber(weekNumber, dateLib = defaultDateLib) {\n if (weekNumber < 10) {\n return dateLib.formatNumber(`0${weekNumber.toLocaleString()}`);\n }\n return dateLib.formatNumber(`${weekNumber.toLocaleString()}`);\n}\n"],"names":["formatWeekNumber","weekNumber","dateLib","defaultDateLib"],"mappings":";AAYO,SAASA,EAAiBC,GAAYC,IAAUC,GAAgB;AACnE,SAAIF,IAAa,KACNC,EAAQ,aAAa,IAAID,EAAW,eAAc,CAAE,EAAE,IAE1DC,EAAQ,aAAa,GAAGD,EAAW,eAAc,CAAE,EAAE;AAChE;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index181.js","sources":["../../../node_modules/@base-ui/react/esm/dialog/portal/DialogPortalContext.js"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DialogPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogPortalContext.displayName = \"DialogPortalContext\";\nexport function useDialogPortalContext() {\n const value = React.useContext(DialogPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Dialog.Portal> is missing.' : _formatErrorMessage(26));\n }\n return value;\n}"],"names":["DialogPortalContext","React","useDialogPortalContext","value","_formatErrorMessage"],"mappings":";;AAIY,MAACA,IAAmC,gBAAAC,EAAM,cAAc,MAAS;AACzE,QAAQ,IAAI,aAAa,iBAAcD,EAAoB,cAAc;AACtE,SAASE,IAAyB;AACvC,QAAMC,IAAQF,EAAM,WAAWD,CAAmB;AAClD,MAAIG,MAAU;AACZ,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,yCAAyCC,EAAoB,EAAE,CAAC;AAE1H,SAAOD;AACT;","x_google_ignoreList":[0]}
package/dist/index182.js CHANGED
@@ -1,7 +1,23 @@
1
- function e() {
2
- return "";
1
+ import * as l from "react";
2
+ import { useStableCallback as m } from "./index262.js";
3
+ import { useAnimationsFinished as f } from "./index346.js";
4
+ function c(a) {
5
+ const {
6
+ enabled: e = !0,
7
+ open: n,
8
+ ref: i,
9
+ onComplete: s
10
+ } = a, o = m(s), t = f(i, n, !1);
11
+ l.useEffect(() => {
12
+ if (!e)
13
+ return;
14
+ const r = new AbortController();
15
+ return t(o, r.signal), () => {
16
+ r.abort();
17
+ };
18
+ }, [e, n, o, t]);
3
19
  }
4
20
  export {
5
- e as formatWeekNumberHeader
21
+ c as useOpenChangeComplete
6
22
  };
7
23
  //# sourceMappingURL=index182.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index182.js","sources":["../../../node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js"],"sourcesContent":["/**\n * Formats the header for the week number column.\n *\n * @defaultValue An empty string `\"\"`.\n * @returns The formatted week number header as a string.\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatWeekNumberHeader() {\n return ``;\n}\n"],"names":["formatWeekNumberHeader"],"mappings":"AAQO,SAASA,IAAyB;AACrC,SAAO;AACX;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index182.js","sources":["../../../node_modules/@base-ui/react/esm/internals/useOpenChangeComplete.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useAnimationsFinished } from \"./useAnimationsFinished.js\";\n\n/**\n * Calls the provided function when the CSS open/close animation or transition completes.\n */\nexport function useOpenChangeComplete(parameters) {\n const {\n enabled = true,\n open,\n ref,\n onComplete: onCompleteParam\n } = parameters;\n const onComplete = useStableCallback(onCompleteParam);\n const runOnceAnimationsFinish = useAnimationsFinished(ref, open, false);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n const abortController = new AbortController();\n runOnceAnimationsFinish(onComplete, abortController.signal);\n return () => {\n abortController.abort();\n };\n }, [enabled, open, onComplete, runOnceAnimationsFinish]);\n}"],"names":["useOpenChangeComplete","parameters","enabled","open","ref","onCompleteParam","onComplete","useStableCallback","runOnceAnimationsFinish","useAnimationsFinished","React","abortController"],"mappings":";;;AASO,SAASA,EAAsBC,GAAY;AAChD,QAAM;AAAA,IACJ,SAAAC,IAAU;AAAA,IACV,MAAAC;AAAA,IACA,KAAAC;AAAA,IACA,YAAYC;AAAA,EAChB,IAAMJ,GACEK,IAAaC,EAAkBF,CAAe,GAC9CG,IAA0BC,EAAsBL,GAAKD,GAAM,EAAK;AACtE,EAAAO,EAAM,UAAU,MAAM;AACpB,QAAI,CAACR;AACH;AAEF,UAAMS,IAAkB,IAAI,gBAAe;AAC3C,WAAAH,EAAwBF,GAAYK,EAAgB,MAAM,GACnD,MAAM;AACX,MAAAA,EAAgB,MAAK;AAAA,IACvB;AAAA,EACF,GAAG,CAACT,GAASC,GAAMG,GAAYE,CAAuB,CAAC;AACzD;","x_google_ignoreList":[0]}
package/dist/index183.js CHANGED
@@ -1,10 +1,16 @@
1
- import { defaultDateLib as t } from "./index152.js";
2
- function a(o, r = t) {
3
- return r.format(o, "yyyy");
4
- }
5
- const f = a;
1
+ const t = "ArrowUp", n = "ArrowDown", o = "ArrowLeft", R = "ArrowRight", e = "Home", c = "End", E = /* @__PURE__ */ new Set([o, R]), A = /* @__PURE__ */ new Set([t, n]), O = /* @__PURE__ */ new Set([...E, ...A]);
2
+ [...O];
3
+ const s = /* @__PURE__ */ new Set([t, n, o, R, e, "End"]);
6
4
  export {
7
- f as formatYearCaption,
8
- a as formatYearDropdown
5
+ n as ARROW_DOWN,
6
+ O as ARROW_KEYS,
7
+ o as ARROW_LEFT,
8
+ R as ARROW_RIGHT,
9
+ t as ARROW_UP,
10
+ s as COMPOSITE_KEYS,
11
+ c as END,
12
+ e as HOME,
13
+ E as HORIZONTAL_KEYS,
14
+ A as VERTICAL_KEYS
9
15
  };
10
16
  //# sourceMappingURL=index183.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index183.js","sources":["../../../node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js"],"sourcesContent":["import { defaultDateLib } from \"../classes/DateLib.js\";\n/**\n * Formats the year for the dropdown option label.\n *\n * @param year The year to format.\n * @param dateLib The date library to use for formatting. Defaults to\n * `defaultDateLib`.\n * @returns The formatted year as a string.\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatYearDropdown(year, dateLib = defaultDateLib) {\n return dateLib.format(year, \"yyyy\");\n}\n/**\n * @private\n * @deprecated Use `formatYearDropdown` instead.\n * @group Formatters\n */\nexport const formatYearCaption = formatYearDropdown;\n"],"names":["formatYearDropdown","year","dateLib","defaultDateLib","formatYearCaption"],"mappings":";AAWO,SAASA,EAAmBC,GAAMC,IAAUC,GAAgB;AAC/D,SAAOD,EAAQ,OAAOD,GAAM,MAAM;AACtC;AAMY,MAACG,IAAoBJ;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index183.js","sources":["../../../node_modules/@base-ui/react/esm/internals/composite/composite.js"],"sourcesContent":["import { isHTMLElement } from '@floating-ui/utils/dom';\nexport { stopEvent, isIndexOutOfListBounds, isListIndexDisabled, createGridCellMap, findNonDisabledListIndex, getGridCellIndexOfCorner, getGridCellIndices, getGridNavigatedIndex, getMaxListIndex, getMinListIndex } from \"../../floating-ui-react/utils.js\";\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';\nexport const ARROW_LEFT = 'ArrowLeft';\nexport const ARROW_RIGHT = 'ArrowRight';\nexport const HOME = 'Home';\nexport const END = 'End';\nexport const PAGE_UP = 'PageUp';\nexport const PAGE_DOWN = 'PageDown';\nexport const HORIZONTAL_KEYS = new Set([ARROW_LEFT, ARROW_RIGHT]);\nexport const HORIZONTAL_KEYS_WITH_EXTRA_KEYS = new Set([ARROW_LEFT, ARROW_RIGHT, HOME, END]);\nexport const VERTICAL_KEYS = new Set([ARROW_UP, ARROW_DOWN]);\nexport const VERTICAL_KEYS_WITH_EXTRA_KEYS = new Set([ARROW_UP, ARROW_DOWN, HOME, END]);\nexport const ARROW_KEYS = new Set([...HORIZONTAL_KEYS, ...VERTICAL_KEYS]);\nexport const ALL_KEYS = new Set([...ARROW_KEYS, HOME, END]);\nexport const COMPOSITE_KEYS = new Set([ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, HOME, END]);\nexport const SHIFT = 'Shift';\nexport const CONTROL = 'Control';\nexport const ALT = 'Alt';\nexport const META = 'Meta';\nexport const MODIFIER_KEYS = new Set([SHIFT, CONTROL, ALT, META]);\nfunction isInputElement(element) {\n return isHTMLElement(element) && element.tagName === 'INPUT';\n}\nexport function isNativeInput(element) {\n if (isInputElement(element) && element.selectionStart != null) {\n return true;\n }\n if (isHTMLElement(element) && element.tagName === 'TEXTAREA') {\n return true;\n }\n return false;\n}\nexport function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) {\n if (!scrollContainer || !element || !element.scrollTo) {\n return;\n }\n let targetX = scrollContainer.scrollLeft;\n let targetY = scrollContainer.scrollTop;\n const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth;\n const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight;\n if (isOverflowingX && orientation !== 'vertical') {\n const elementOffsetLeft = getOffset(scrollContainer, element, 'left');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (direction === 'ltr') {\n if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n }\n }\n if (direction === 'rtl') {\n if (elementOffsetLeft - elementStyles.scrollMarginRight < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n }\n }\n }\n if (isOverflowingY && orientation !== 'horizontal') {\n const elementOffsetTop = getOffset(scrollContainer, element, 'top');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) {\n // overflow upwards, align top edges\n targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop;\n } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) {\n // overflow downwards, align bottom edges\n targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom;\n }\n }\n scrollContainer.scrollTo({\n left: targetX,\n top: targetY,\n behavior: 'auto'\n });\n}\nfunction getOffset(ancestor, element, side) {\n const propName = side === 'left' ? 'offsetLeft' : 'offsetTop';\n let result = 0;\n while (element.offsetParent) {\n result += element[propName];\n if (element.offsetParent === ancestor) {\n break;\n }\n element = element.offsetParent;\n }\n return result;\n}\nfunction getStyles(element) {\n const styles = getComputedStyle(element);\n return {\n scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0,\n scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0,\n scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0,\n scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0,\n scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0,\n scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0,\n scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0,\n scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0\n };\n}"],"names":["ARROW_UP","ARROW_DOWN","ARROW_LEFT","ARROW_RIGHT","HOME","END","HORIZONTAL_KEYS","VERTICAL_KEYS","ARROW_KEYS","COMPOSITE_KEYS"],"mappings":"AAEY,MAACA,IAAW,WACXC,IAAa,aACbC,IAAa,aACbC,IAAc,cACdC,IAAO,QACPC,IAAM,OAGNC,IAAkB,oBAAI,IAAI,CAACJ,GAAYC,CAAW,CAAC,GAEnDI,IAAgB,oBAAI,IAAI,CAACP,GAAUC,CAAU,CAAC,GAE9CO,IAAa,oBAAI,IAAI,CAAC,GAAGF,GAAiB,GAAGC,CAAa,CAAC;AACxC,CAAC,GAAGC,CAAqB;AAC7C,MAACC,IAAiB,oBAAI,IAAI,CAACT,GAAUC,GAAYC,GAAYC,GAAaC,GAAM,KAAG,CAAC;","x_google_ignoreList":[0]}