@rpcbase/ui 0.226.0 → 0.228.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 (758) hide show
  1. package/dist/components/PhoneNumberInput/index.d.ts +1 -1
  2. package/dist/components/PhoneNumberInput/index.d.ts.map +1 -1
  3. package/dist/components/PhoneNumberInput/normalization.d.ts +0 -28
  4. package/dist/components/PhoneNumberInput/normalization.d.ts.map +1 -1
  5. package/dist/components/PhoneNumberInput/types.d.ts +4 -4
  6. package/dist/components/PhoneNumberInput/types.d.ts.map +1 -1
  7. package/dist/index100.js +4 -11
  8. package/dist/index100.js.map +1 -1
  9. package/dist/index101.js +8 -68
  10. package/dist/index101.js.map +1 -1
  11. package/dist/index102.js +6 -38
  12. package/dist/index102.js.map +1 -1
  13. package/dist/index103.js +5 -14
  14. package/dist/index103.js.map +1 -1
  15. package/dist/index104.js +4 -23
  16. package/dist/index104.js.map +1 -1
  17. package/dist/index105.js +6 -110
  18. package/dist/index105.js.map +1 -1
  19. package/dist/index106.js +146 -13
  20. package/dist/index106.js.map +1 -1
  21. package/dist/index107.js +39 -4
  22. package/dist/index107.js.map +1 -1
  23. package/dist/index108.js +5 -4
  24. package/dist/index108.js.map +1 -1
  25. package/dist/index109.js +8 -5
  26. package/dist/index109.js.map +1 -1
  27. package/dist/index110.js +13 -11
  28. package/dist/index110.js.map +1 -1
  29. package/dist/index111.js +13 -19
  30. package/dist/index111.js.map +1 -1
  31. package/dist/index112.js +8 -13
  32. package/dist/index112.js.map +1 -1
  33. package/dist/index113.js +31 -261
  34. package/dist/index113.js.map +1 -1
  35. package/dist/index114.js +10 -4
  36. package/dist/index114.js.map +1 -1
  37. package/dist/index115.js +11 -28
  38. package/dist/index115.js.map +1 -1
  39. package/dist/index116.js +8 -126
  40. package/dist/index116.js.map +1 -1
  41. package/dist/index117.js +13 -5
  42. package/dist/index117.js.map +1 -1
  43. package/dist/index118.js +101 -78
  44. package/dist/index118.js.map +1 -1
  45. package/dist/index119.js +20 -67
  46. package/dist/index119.js.map +1 -1
  47. package/dist/index120.js +53 -8
  48. package/dist/index120.js.map +1 -1
  49. package/dist/index121.js +73 -16
  50. package/dist/index121.js.map +1 -1
  51. package/dist/index122.js +9 -92
  52. package/dist/index122.js.map +1 -1
  53. package/dist/index123.js +17 -62
  54. package/dist/index123.js.map +1 -1
  55. package/dist/index124.js +15 -44
  56. package/dist/index124.js.map +1 -1
  57. package/dist/index125.js +24 -52
  58. package/dist/index125.js.map +1 -1
  59. package/dist/index126.js +6 -4
  60. package/dist/index126.js.map +1 -1
  61. package/dist/index127.js +5 -4
  62. package/dist/index127.js.map +1 -1
  63. package/dist/index128.js +23 -15
  64. package/dist/index128.js.map +1 -1
  65. package/dist/index129.js +35 -6
  66. package/dist/index129.js.map +1 -1
  67. package/dist/index130.js +16 -8
  68. package/dist/index130.js.map +1 -1
  69. package/dist/index131.js +6 -16
  70. package/dist/index131.js.map +1 -1
  71. package/dist/index132.js +4 -4
  72. package/dist/index132.js.map +1 -1
  73. package/dist/index133.js +4 -4
  74. package/dist/index133.js.map +1 -1
  75. package/dist/index134.js +4 -5
  76. package/dist/index134.js.map +1 -1
  77. package/dist/index135.js +4 -5
  78. package/dist/index135.js.map +1 -1
  79. package/dist/index136.js +3 -4
  80. package/dist/index136.js.map +1 -1
  81. package/dist/index137.js +6 -4
  82. package/dist/index137.js.map +1 -1
  83. package/dist/index138.js +24 -7
  84. package/dist/index138.js.map +1 -1
  85. package/dist/index139.js +7 -24
  86. package/dist/index139.js.map +1 -1
  87. package/dist/index140.js +6 -6
  88. package/dist/index140.js.map +1 -1
  89. package/dist/index141.js +5 -4
  90. package/dist/index141.js.map +1 -1
  91. package/dist/index142.js +3 -6
  92. package/dist/index142.js.map +1 -1
  93. package/dist/index143.js +3 -5
  94. package/dist/index143.js.map +1 -1
  95. package/dist/index144.js +4 -4
  96. package/dist/index144.js.map +1 -1
  97. package/dist/index145.js +3 -5
  98. package/dist/index145.js.map +1 -1
  99. package/dist/index146.js +4 -4
  100. package/dist/index146.js.map +1 -1
  101. package/dist/index147.js +3 -8
  102. package/dist/index147.js.map +1 -1
  103. package/dist/index148.js +3 -5
  104. package/dist/index148.js.map +1 -1
  105. package/dist/index149.js +3 -4
  106. package/dist/index149.js.map +1 -1
  107. package/dist/index150.js +5 -4
  108. package/dist/index150.js.map +1 -1
  109. package/dist/index151.js +68 -6
  110. package/dist/index151.js.map +1 -1
  111. package/dist/index152.js +2 -146
  112. package/dist/index152.js.map +1 -1
  113. package/dist/index153.js +362 -38
  114. package/dist/index153.js.map +1 -1
  115. package/dist/index154.js +261 -4
  116. package/dist/index154.js.map +1 -1
  117. package/dist/index155.js +60 -7
  118. package/dist/index155.js.map +1 -1
  119. package/dist/index156.js +46 -13
  120. package/dist/index156.js.map +1 -1
  121. package/dist/index157.js +169 -13
  122. package/dist/index157.js.map +1 -1
  123. package/dist/index158.js +109 -7
  124. package/dist/index158.js.map +1 -1
  125. package/dist/index159.js +24 -31
  126. package/dist/index159.js.map +1 -1
  127. package/dist/index160.js +8 -11
  128. package/dist/index160.js.map +1 -1
  129. package/dist/index161.js +4 -10
  130. package/dist/index161.js.map +1 -1
  131. package/dist/index162.js +5 -8
  132. package/dist/index162.js.map +1 -1
  133. package/dist/index163.js +4 -13
  134. package/dist/index163.js.map +1 -1
  135. package/dist/index164.js +465 -100
  136. package/dist/index164.js.map +1 -1
  137. package/dist/index165.js +186 -20
  138. package/dist/index165.js.map +1 -1
  139. package/dist/index166.js +107 -53
  140. package/dist/index166.js.map +1 -1
  141. package/dist/index167.js +261 -71
  142. package/dist/index167.js.map +1 -1
  143. package/dist/index168.js +9 -9
  144. package/dist/index168.js.map +1 -1
  145. package/dist/index169.js +42 -20
  146. package/dist/index169.js.map +1 -1
  147. package/dist/index170.js +4 -16
  148. package/dist/index170.js.map +1 -1
  149. package/dist/index171.js +11 -23
  150. package/dist/index171.js.map +1 -1
  151. package/dist/index172.js +68 -6
  152. package/dist/index172.js.map +1 -1
  153. package/dist/index173.js +38 -6
  154. package/dist/index173.js.map +1 -1
  155. package/dist/index174.js +14 -24
  156. package/dist/index174.js.map +1 -1
  157. package/dist/index175.js +21 -32
  158. package/dist/index175.js.map +1 -1
  159. package/dist/index176.js +111 -16
  160. package/dist/index176.js.map +1 -1
  161. package/dist/index177.js +13 -7
  162. package/dist/index177.js.map +1 -1
  163. package/dist/index178.js +4 -4
  164. package/dist/index178.js.map +1 -1
  165. package/dist/index179.js +4 -5
  166. package/dist/index179.js.map +1 -1
  167. package/dist/index18.js +377 -414
  168. package/dist/index18.js.map +1 -1
  169. package/dist/index180.js +5 -5
  170. package/dist/index180.js.map +1 -1
  171. package/dist/index181.js +11 -4
  172. package/dist/index181.js.map +1 -1
  173. package/dist/index182.js +19 -3
  174. package/dist/index182.js.map +1 -1
  175. package/dist/index183.js +13 -7
  176. package/dist/index183.js.map +1 -1
  177. package/dist/index184.js +262 -24
  178. package/dist/index184.js.map +1 -1
  179. package/dist/index185.js +4 -7
  180. package/dist/index185.js.map +1 -1
  181. package/dist/index186.js +28 -7
  182. package/dist/index186.js.map +1 -1
  183. package/dist/index187.js +126 -5
  184. package/dist/index187.js.map +1 -1
  185. package/dist/index188.js +5 -3
  186. package/dist/index188.js.map +1 -1
  187. package/dist/index189.js +78 -3
  188. package/dist/index189.js.map +1 -1
  189. package/dist/index190.js +66 -4
  190. package/dist/index190.js.map +1 -1
  191. package/dist/index191.js +8 -3
  192. package/dist/index191.js.map +1 -1
  193. package/dist/index192.js +16 -5
  194. package/dist/index192.js.map +1 -1
  195. package/dist/index193.js +92 -3
  196. package/dist/index193.js.map +1 -1
  197. package/dist/index194.js +65 -3
  198. package/dist/index194.js.map +1 -1
  199. package/dist/index195.js +45 -3
  200. package/dist/index195.js.map +1 -1
  201. package/dist/index196.js +16 -13
  202. package/dist/index196.js.map +1 -1
  203. package/dist/index197.js +4 -153
  204. package/dist/index197.js.map +1 -1
  205. package/dist/index198.js +4 -29
  206. package/dist/index198.js.map +1 -1
  207. package/dist/index199.js +58 -9
  208. package/dist/index199.js.map +1 -1
  209. package/dist/index200.js +61 -43
  210. package/dist/index200.js.map +1 -1
  211. package/dist/index201.js +6 -11
  212. package/dist/index201.js.map +1 -1
  213. package/dist/index202.js +4 -44
  214. package/dist/index202.js.map +1 -1
  215. package/dist/index203.js +6 -95
  216. package/dist/index203.js.map +1 -1
  217. package/dist/index204.js +16 -86
  218. package/dist/index204.js.map +1 -1
  219. package/dist/index205.js +4 -105
  220. package/dist/index205.js.map +1 -1
  221. package/dist/index206.js +4 -52
  222. package/dist/index206.js.map +1 -1
  223. package/dist/index207.js +12 -11
  224. package/dist/index207.js.map +1 -1
  225. package/dist/index208.js +9 -37
  226. package/dist/index208.js.map +1 -1
  227. package/dist/index209.js +13 -8
  228. package/dist/index209.js.map +1 -1
  229. package/dist/index210.js +13 -116
  230. package/dist/index210.js.map +1 -1
  231. package/dist/index211.js +4 -17
  232. package/dist/index211.js.map +1 -1
  233. package/dist/index212.js +5 -15
  234. package/dist/index212.js.map +1 -1
  235. package/dist/index213.js +6 -3
  236. package/dist/index213.js.map +1 -1
  237. package/dist/index214.js +5 -36
  238. package/dist/index214.js.map +1 -1
  239. package/dist/index215.js +53 -19
  240. package/dist/index215.js.map +1 -1
  241. package/dist/index216.js +8 -9
  242. package/dist/index216.js.map +1 -1
  243. package/dist/index217.js +4 -8
  244. package/dist/index217.js.map +1 -1
  245. package/dist/index218.js +4 -19
  246. package/dist/index218.js.map +1 -1
  247. package/dist/index219.js +8 -28
  248. package/dist/index219.js.map +1 -1
  249. package/dist/index220.js +4 -16
  250. package/dist/index220.js.map +1 -1
  251. package/dist/index221.js +4 -66
  252. package/dist/index221.js.map +1 -1
  253. package/dist/index222.js +3 -8
  254. package/dist/index222.js.map +1 -1
  255. package/dist/index223.js +10 -11
  256. package/dist/index223.js.map +1 -1
  257. package/dist/index224.js +9 -8
  258. package/dist/index224.js.map +1 -1
  259. package/dist/index225.js +9 -5
  260. package/dist/index225.js.map +1 -1
  261. package/dist/index226.js +10 -13
  262. package/dist/index226.js.map +1 -1
  263. package/dist/index227.js +10 -3
  264. package/dist/index227.js.map +1 -1
  265. package/dist/index228.js +9 -3
  266. package/dist/index228.js.map +1 -1
  267. package/dist/index229.js +6 -99
  268. package/dist/index229.js.map +1 -1
  269. package/dist/index230.js +5 -29
  270. package/dist/index230.js.map +1 -1
  271. package/dist/index231.js +4 -51
  272. package/dist/index231.js.map +1 -1
  273. package/dist/index232.js +5 -17
  274. package/dist/index232.js.map +1 -1
  275. package/dist/index233.js +6 -5
  276. package/dist/index233.js.map +1 -1
  277. package/dist/index234.js +5 -122
  278. package/dist/index234.js.map +1 -1
  279. package/dist/index235.js +8 -27
  280. package/dist/index235.js.map +1 -1
  281. package/dist/index236.js +19 -32
  282. package/dist/index236.js.map +1 -1
  283. package/dist/index237.js +15 -72
  284. package/dist/index237.js.map +1 -1
  285. package/dist/index238.js +7 -262
  286. package/dist/index238.js.map +1 -1
  287. package/dist/index239.js +9 -27
  288. package/dist/index239.js.map +1 -1
  289. package/dist/index240.js +10 -6
  290. package/dist/index240.js.map +1 -1
  291. package/dist/index241.js +19 -140
  292. package/dist/index241.js.map +1 -1
  293. package/dist/index242.js +10 -61
  294. package/dist/index242.js.map +1 -1
  295. package/dist/index243.js +9 -49
  296. package/dist/index243.js.map +1 -1
  297. package/dist/index244.js +10 -15
  298. package/dist/index244.js.map +1 -1
  299. package/dist/index245.js +4 -133
  300. package/dist/index245.js.map +1 -1
  301. package/dist/index246.js +5 -8
  302. package/dist/index246.js.map +1 -1
  303. package/dist/index247.js +17 -5
  304. package/dist/index247.js.map +1 -1
  305. package/dist/index248.js +10 -4
  306. package/dist/index248.js.map +1 -1
  307. package/dist/index249.js +18 -11
  308. package/dist/index249.js.map +1 -1
  309. package/dist/index250.js +13 -19
  310. package/dist/index250.js.map +1 -1
  311. package/dist/index251.js +13 -20
  312. package/dist/index251.js.map +1 -1
  313. package/dist/index252.js +29 -11
  314. package/dist/index252.js.map +1 -1
  315. package/dist/index253.js +11 -49
  316. package/dist/index253.js.map +1 -1
  317. package/dist/index254.js +24 -15
  318. package/dist/index254.js.map +1 -1
  319. package/dist/index255.js +5 -21
  320. package/dist/index255.js.map +1 -1
  321. package/dist/index256.js +20 -52
  322. package/dist/index256.js.map +1 -1
  323. package/dist/index257.js +65 -24
  324. package/dist/index257.js.map +1 -1
  325. package/dist/index258.js +6 -41
  326. package/dist/index258.js.map +1 -1
  327. package/dist/index259.js +11 -39
  328. package/dist/index259.js.map +1 -1
  329. package/dist/index260.js +50 -44
  330. package/dist/index260.js.map +1 -1
  331. package/dist/index261.js +4 -21
  332. package/dist/index261.js.map +1 -1
  333. package/dist/index262.js +26 -67
  334. package/dist/index262.js.map +1 -1
  335. package/dist/index263.js +15 -16
  336. package/dist/index263.js.map +1 -1
  337. package/dist/index264.js +5 -11
  338. package/dist/index264.js.map +1 -1
  339. package/dist/index265.js +20 -12
  340. package/dist/index265.js.map +1 -1
  341. package/dist/index266.js +51 -18
  342. package/dist/index266.js.map +1 -1
  343. package/dist/index267.js +24 -35
  344. package/dist/index267.js.map +1 -1
  345. package/dist/index268.js +35 -272
  346. package/dist/index268.js.map +1 -1
  347. package/dist/index269.js +36 -65
  348. package/dist/index269.js.map +1 -1
  349. package/dist/index270.js +45 -84
  350. package/dist/index270.js.map +1 -1
  351. package/dist/index271.js +20 -3
  352. package/dist/index271.js.map +1 -1
  353. package/dist/index272.js +66 -25
  354. package/dist/index272.js.map +1 -1
  355. package/dist/index273.js +17 -16
  356. package/dist/index273.js.map +1 -1
  357. package/dist/index274.js +12 -35
  358. package/dist/index274.js.map +1 -1
  359. package/dist/index275.js +27 -16
  360. package/dist/index275.js.map +1 -1
  361. package/dist/index276.js +13 -3
  362. package/dist/index276.js.map +1 -1
  363. package/dist/index277.js +15 -23
  364. package/dist/index277.js.map +1 -1
  365. package/dist/index278.js +37 -4
  366. package/dist/index278.js.map +1 -1
  367. package/dist/index279.js +258 -74
  368. package/dist/index279.js.map +1 -1
  369. package/dist/index280.js +269 -260
  370. package/dist/index280.js.map +1 -1
  371. package/dist/index281.js +68 -11
  372. package/dist/index281.js.map +1 -1
  373. package/dist/index282.js +100 -11
  374. package/dist/index282.js.map +1 -1
  375. package/dist/index283.js +82 -24
  376. package/dist/index283.js.map +1 -1
  377. package/dist/index284.js +3 -16
  378. package/dist/index284.js.map +1 -1
  379. package/dist/index285.js +26 -122
  380. package/dist/index285.js.map +1 -1
  381. package/dist/index286.js +16 -5
  382. package/dist/index286.js.map +1 -1
  383. package/dist/index287.js +34 -40
  384. package/dist/index287.js.map +1 -1
  385. package/dist/index288.js +15 -64
  386. package/dist/index288.js.map +1 -1
  387. package/dist/index289.js +4 -14
  388. package/dist/index289.js.map +1 -1
  389. package/dist/index290.js +26 -7
  390. package/dist/index290.js.map +1 -1
  391. package/dist/index291.js +28 -5
  392. package/dist/index291.js.map +1 -1
  393. package/dist/index292.js +4 -4
  394. package/dist/index292.js.map +1 -1
  395. package/dist/index293.js +78 -10
  396. package/dist/index293.js.map +1 -1
  397. package/dist/index294.js +269 -7
  398. package/dist/index294.js.map +1 -1
  399. package/dist/index295.js +11 -399
  400. package/dist/index295.js.map +1 -1
  401. package/dist/index296.js +10 -52
  402. package/dist/index296.js.map +1 -1
  403. package/dist/index297.js +25 -11
  404. package/dist/index297.js.map +1 -1
  405. package/dist/index298.js +16 -11
  406. package/dist/index298.js.map +1 -1
  407. package/dist/index299.js +124 -57
  408. package/dist/index299.js.map +1 -1
  409. package/dist/index300.js +5 -8
  410. package/dist/index300.js.map +1 -1
  411. package/dist/index301.js +38 -64
  412. package/dist/index301.js.map +1 -1
  413. package/dist/index302.js +63 -17
  414. package/dist/index302.js.map +1 -1
  415. package/dist/index303.js +13 -16
  416. package/dist/index303.js.map +1 -1
  417. package/dist/index304.js +7 -5
  418. package/dist/index304.js.map +1 -1
  419. package/dist/index305.js +5 -5
  420. package/dist/index305.js.map +1 -1
  421. package/dist/index306.js +3 -6
  422. package/dist/index306.js.map +1 -1
  423. package/dist/index307.js +10 -4
  424. package/dist/index307.js.map +1 -1
  425. package/dist/index308.js +7 -6
  426. package/dist/index308.js.map +1 -1
  427. package/dist/index309.js +132 -15
  428. package/dist/index309.js.map +1 -1
  429. package/dist/index31.js +24 -24
  430. package/dist/index310.js +399 -4
  431. package/dist/index310.js.map +1 -1
  432. package/dist/index311.js +52 -4
  433. package/dist/index311.js.map +1 -1
  434. package/dist/index312.js +11 -12
  435. package/dist/index312.js.map +1 -1
  436. package/dist/index313.js +11 -9
  437. package/dist/index313.js.map +1 -1
  438. package/dist/index314.js +13 -13
  439. package/dist/index314.js.map +1 -1
  440. package/dist/index315.js +154 -13
  441. package/dist/index315.js.map +1 -1
  442. package/dist/index316.js +30 -4
  443. package/dist/index316.js.map +1 -1
  444. package/dist/index317.js +9 -5
  445. package/dist/index317.js.map +1 -1
  446. package/dist/index318.js +48 -6
  447. package/dist/index318.js.map +1 -1
  448. package/dist/index319.js +11 -5
  449. package/dist/index319.js.map +1 -1
  450. package/dist/index32.js +3 -3
  451. package/dist/index320.js +43 -53
  452. package/dist/index320.js.map +1 -1
  453. package/dist/index321.js +95 -8
  454. package/dist/index321.js.map +1 -1
  455. package/dist/index322.js +86 -4
  456. package/dist/index322.js.map +1 -1
  457. package/dist/index323.js +105 -4
  458. package/dist/index323.js.map +1 -1
  459. package/dist/index324.js +52 -8
  460. package/dist/index324.js.map +1 -1
  461. package/dist/index325.js +11 -4
  462. package/dist/index325.js.map +1 -1
  463. package/dist/index326.js +37 -4
  464. package/dist/index326.js.map +1 -1
  465. package/dist/index327.js +8 -3
  466. package/dist/index327.js.map +1 -1
  467. package/dist/index328.js +116 -10
  468. package/dist/index328.js.map +1 -1
  469. package/dist/index329.js +17 -9
  470. package/dist/index329.js.map +1 -1
  471. package/dist/index330.js +15 -9
  472. package/dist/index330.js.map +1 -1
  473. package/dist/index331.js +3 -10
  474. package/dist/index331.js.map +1 -1
  475. package/dist/index332.js +36 -10
  476. package/dist/index332.js.map +1 -1
  477. package/dist/index333.js +20 -9
  478. package/dist/index333.js.map +1 -1
  479. package/dist/index334.js +9 -6
  480. package/dist/index334.js.map +1 -1
  481. package/dist/index335.js +8 -5
  482. package/dist/index335.js.map +1 -1
  483. package/dist/index336.js +8 -4
  484. package/dist/index336.js.map +1 -1
  485. package/dist/index337.js +11 -5
  486. package/dist/index337.js.map +1 -1
  487. package/dist/index338.js +8 -6
  488. package/dist/index338.js.map +1 -1
  489. package/dist/index339.js +13 -5
  490. package/dist/index339.js.map +1 -1
  491. package/dist/index34.js +4 -4
  492. package/dist/index340.js +3 -16
  493. package/dist/index340.js.map +1 -1
  494. package/dist/index341.js +3 -7
  495. package/dist/index341.js.map +1 -1
  496. package/dist/index342.js +18 -9
  497. package/dist/index342.js.map +1 -1
  498. package/dist/index343.js +27 -9
  499. package/dist/index343.js.map +1 -1
  500. package/dist/index344.js +15 -20
  501. package/dist/index344.js.map +1 -1
  502. package/dist/index345.js +17 -10
  503. package/dist/index345.js.map +1 -1
  504. package/dist/index346.js +51 -9
  505. package/dist/index346.js.map +1 -1
  506. package/dist/index347.js +5 -9
  507. package/dist/index347.js.map +1 -1
  508. package/dist/index348.js +122 -4
  509. package/dist/index348.js.map +1 -1
  510. package/dist/index349.js +32 -5
  511. package/dist/index349.js.map +1 -1
  512. package/dist/index35.js +5 -5
  513. package/dist/index350.js +73 -16
  514. package/dist/index350.js.map +1 -1
  515. package/dist/index351.js +142 -9
  516. package/dist/index351.js.map +1 -1
  517. package/dist/index352.js +61 -18
  518. package/dist/index352.js.map +1 -1
  519. package/dist/index353.js +47 -13
  520. package/dist/index353.js.map +1 -1
  521. package/dist/index354.js +15 -13
  522. package/dist/index354.js.map +1 -1
  523. package/dist/index355.js +7 -28
  524. package/dist/index355.js.map +1 -1
  525. package/dist/index356.js +5 -13
  526. package/dist/index356.js.map +1 -1
  527. package/dist/index357.js +11 -25
  528. package/dist/index357.js.map +1 -1
  529. package/dist/index358.js +21 -5
  530. package/dist/index358.js.map +1 -1
  531. package/dist/index359.js +4 -20
  532. package/dist/index359.js.map +1 -1
  533. package/dist/index36.js +10 -10
  534. package/dist/index360.js +18 -9
  535. package/dist/index360.js.map +1 -1
  536. package/dist/index361.js +13 -26
  537. package/dist/index361.js.map +1 -1
  538. package/dist/index362.js +4 -27
  539. package/dist/index362.js.map +1 -1
  540. package/dist/index363.js +10 -136
  541. package/dist/index363.js.map +1 -1
  542. package/dist/index364.js +16 -12
  543. package/dist/index364.js.map +1 -1
  544. package/dist/index365.js +5 -226
  545. package/dist/index365.js.map +1 -1
  546. package/dist/index366.js +20 -3
  547. package/dist/index366.js.map +1 -1
  548. package/dist/index367.js +45 -20
  549. package/dist/index367.js.map +1 -1
  550. package/dist/index368.js +17 -77
  551. package/dist/index368.js.map +1 -1
  552. package/dist/index369.js +4 -11
  553. package/dist/index369.js.map +1 -1
  554. package/dist/index37.js +3 -3
  555. package/dist/index370.js +200 -3
  556. package/dist/index370.js.map +1 -1
  557. package/dist/index371.js +5 -5
  558. package/dist/index372.js +19 -199
  559. package/dist/index372.js.map +1 -1
  560. package/dist/index373.js +6 -69
  561. package/dist/index373.js.map +1 -1
  562. package/dist/index374.js +26 -9
  563. package/dist/index374.js.map +1 -1
  564. package/dist/index375.js +26 -16
  565. package/dist/index375.js.map +1 -1
  566. package/dist/index376.js +136 -14
  567. package/dist/index376.js.map +1 -1
  568. package/dist/index377.js +13 -4
  569. package/dist/index377.js.map +1 -1
  570. package/dist/index378.js +225 -10
  571. package/dist/index378.js.map +1 -1
  572. package/dist/index379.js +3 -5
  573. package/dist/index379.js.map +1 -1
  574. package/dist/index38.js +4 -4
  575. package/dist/index380.js +19 -20
  576. package/dist/index380.js.map +1 -1
  577. package/dist/index381.js +77 -44
  578. package/dist/index381.js.map +1 -1
  579. package/dist/index382.js +11 -17
  580. package/dist/index382.js.map +1 -1
  581. package/dist/index383.js +4 -5
  582. package/dist/index383.js.map +1 -1
  583. package/dist/index384.js +71 -4
  584. package/dist/index384.js.map +1 -1
  585. package/dist/index385.js +9 -18
  586. package/dist/index385.js.map +1 -1
  587. package/dist/index386.js +15 -12
  588. package/dist/index386.js.map +1 -1
  589. package/dist/index387.js +4 -14
  590. package/dist/index387.js.map +1 -1
  591. package/dist/index388.js +4 -491
  592. package/dist/index388.js.map +1 -1
  593. package/dist/index389.js +4 -3
  594. package/dist/index389.js.map +1 -1
  595. package/dist/index39.js +5 -5
  596. package/dist/index390.js +16 -3
  597. package/dist/index390.js.map +1 -1
  598. package/dist/index391.js +8 -4
  599. package/dist/index391.js.map +1 -1
  600. package/dist/index392.js +5 -4
  601. package/dist/index392.js.map +1 -1
  602. package/dist/index393.js +5 -4
  603. package/dist/index393.js.map +1 -1
  604. package/dist/index394.js +545 -15
  605. package/dist/index394.js.map +1 -1
  606. package/dist/index395.js +47 -9
  607. package/dist/index395.js.map +1 -1
  608. package/dist/index396.js +17 -5
  609. package/dist/index396.js.map +1 -1
  610. package/dist/index397.js +5 -4
  611. package/dist/index397.js.map +1 -1
  612. package/dist/index398.js +7 -545
  613. package/dist/index398.js.map +1 -1
  614. package/dist/index399.js +7 -47
  615. package/dist/index399.js.map +1 -1
  616. package/dist/index40.js +3 -3
  617. package/dist/index400.js +7 -17
  618. package/dist/index400.js.map +1 -1
  619. package/dist/index401.js +11 -5
  620. package/dist/index401.js.map +1 -1
  621. package/dist/index402.js +8 -7
  622. package/dist/index402.js.map +1 -1
  623. package/dist/index403.js +12 -6
  624. package/dist/index403.js.map +1 -1
  625. package/dist/index404.js +3 -8
  626. package/dist/index404.js.map +1 -1
  627. package/dist/index405.js +3 -12
  628. package/dist/index405.js.map +1 -1
  629. package/dist/index406.js +14 -8
  630. package/dist/index406.js.map +1 -1
  631. package/dist/index407.js +491 -12
  632. package/dist/index407.js.map +1 -1
  633. package/dist/index408.js +4 -7
  634. package/dist/index408.js.map +1 -1
  635. package/dist/index409.js +56 -2
  636. package/dist/index409.js.map +1 -1
  637. package/dist/index41.js +10 -10
  638. package/dist/index410.js +67 -43
  639. package/dist/index410.js.map +1 -1
  640. package/dist/index411.js +31 -56
  641. package/dist/index411.js.map +1 -1
  642. package/dist/index412.js +9 -8
  643. package/dist/index412.js.map +1 -1
  644. package/dist/index413.js +153 -2
  645. package/dist/index413.js.map +1 -1
  646. package/dist/index414.js +107 -54
  647. package/dist/index414.js.map +1 -1
  648. package/dist/index415.js +7 -55
  649. package/dist/index415.js.map +1 -1
  650. package/dist/index416.js +2 -5
  651. package/dist/index416.js.map +1 -1
  652. package/dist/index417.js +42 -54
  653. package/dist/index417.js.map +1 -1
  654. package/dist/index418.js +56 -68
  655. package/dist/index418.js.map +1 -1
  656. package/dist/index419.js +8 -31
  657. package/dist/index419.js.map +1 -1
  658. package/dist/index420.js +2 -9
  659. package/dist/index420.js.map +1 -1
  660. package/dist/index421.js +54 -152
  661. package/dist/index421.js.map +1 -1
  662. package/dist/index422.js +56 -108
  663. package/dist/index422.js.map +1 -1
  664. package/dist/index423.js +16 -2
  665. package/dist/index423.js.map +1 -1
  666. package/dist/index424.js +29 -2
  667. package/dist/index424.js.map +1 -1
  668. package/dist/index425.js +13 -2
  669. package/dist/index425.js.map +1 -1
  670. package/dist/index426.js +7 -2
  671. package/dist/index426.js.map +1 -1
  672. package/dist/index427.js +2 -16
  673. package/dist/index427.js.map +1 -1
  674. package/dist/index428.js +2 -29
  675. package/dist/index428.js.map +1 -1
  676. package/dist/index429.js +2 -13
  677. package/dist/index429.js.map +1 -1
  678. package/dist/index430.js +2 -7
  679. package/dist/index430.js.map +1 -1
  680. package/dist/index44.js +23 -22
  681. package/dist/index44.js.map +1 -1
  682. package/dist/index45.js +22 -196
  683. package/dist/index45.js.map +1 -1
  684. package/dist/index48.js +2 -2
  685. package/dist/index49.js +34 -34
  686. package/dist/index50.js +29 -29
  687. package/dist/index51.js +2 -2
  688. package/dist/index52.js +12 -12
  689. package/dist/index53.js +4 -4
  690. package/dist/index54.js +1 -1
  691. package/dist/index55.js +22 -22
  692. package/dist/index56.js +5 -5
  693. package/dist/index57.js +5 -5
  694. package/dist/index58.js +8 -8
  695. package/dist/index59.js +5 -5
  696. package/dist/index60.js +17 -17
  697. package/dist/index61.js +5 -5
  698. package/dist/index62.js +3 -3
  699. package/dist/index66.js +1 -1
  700. package/dist/index67.js +1 -1
  701. package/dist/index70.js +1 -1
  702. package/dist/index71.js +1 -1
  703. package/dist/index72.js +2 -6
  704. package/dist/index72.js.map +1 -1
  705. package/dist/index73.js +2 -8
  706. package/dist/index73.js.map +1 -1
  707. package/dist/index74.js +2 -6
  708. package/dist/index74.js.map +1 -1
  709. package/dist/index75.js +2 -2
  710. package/dist/index76.js +6 -2
  711. package/dist/index76.js.map +1 -1
  712. package/dist/index77.js +8 -2
  713. package/dist/index77.js.map +1 -1
  714. package/dist/index78.js +6 -2
  715. package/dist/index78.js.map +1 -1
  716. package/dist/index79.js +52 -6
  717. package/dist/index79.js.map +1 -1
  718. package/dist/index80.js +4 -68
  719. package/dist/index80.js.map +1 -1
  720. package/dist/index81.js +5 -2
  721. package/dist/index81.js.map +1 -1
  722. package/dist/index82.js +15 -363
  723. package/dist/index82.js.map +1 -1
  724. package/dist/index83.js +5 -261
  725. package/dist/index83.js.map +1 -1
  726. package/dist/index84.js +7 -60
  727. package/dist/index84.js.map +1 -1
  728. package/dist/index85.js +16 -46
  729. package/dist/index85.js.map +1 -1
  730. package/dist/index86.js +4 -169
  731. package/dist/index86.js.map +1 -1
  732. package/dist/index87.js +4 -109
  733. package/dist/index87.js.map +1 -1
  734. package/dist/index88.js +5 -24
  735. package/dist/index88.js.map +1 -1
  736. package/dist/index89.js +6 -8
  737. package/dist/index89.js.map +1 -1
  738. package/dist/index90.js +4 -4
  739. package/dist/index90.js.map +1 -1
  740. package/dist/index91.js +4 -5
  741. package/dist/index91.js.map +1 -1
  742. package/dist/index92.js +6 -4
  743. package/dist/index92.js.map +1 -1
  744. package/dist/index93.js +24 -466
  745. package/dist/index93.js.map +1 -1
  746. package/dist/index94.js +6 -185
  747. package/dist/index94.js.map +1 -1
  748. package/dist/index95.js +4 -107
  749. package/dist/index95.js.map +1 -1
  750. package/dist/index96.js +6 -262
  751. package/dist/index96.js.map +1 -1
  752. package/dist/index97.js +5 -9
  753. package/dist/index97.js.map +1 -1
  754. package/dist/index98.js +4 -42
  755. package/dist/index98.js.map +1 -1
  756. package/dist/index99.js +5 -4
  757. package/dist/index99.js.map +1 -1
  758. 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 DEFAULT_COUNTRY,\n COMMON_IDD_PREFIXES,\n buildFallbackSelectedCountry,\n getCachedCountryOptions,\n getLocaleCacheKey,\n getValidCountry,\n normalizeSearchValue,\n optionMatchIndex,\n parseLocaleCacheKey,\n toSelectedCountry,\n} from \"./country-options\"\nimport {\n detectNationalPrefixForDisplay,\n formatWithAsYouType,\n getLengthIssue,\n getSuggestionState,\n injectNationalPrefixDisplay,\n normalizeInputValue,\n sanitizeDigits,\n shouldDisplayExplicitCountrySelection,\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\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 hasConfiguredCountry =\n typeof defaultCountry === \"string\" || typeof countryProp === \"string\"\n\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 fallbackCountry = 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 hasResolvedCountryRef = React.useRef<boolean>(hasConfiguredCountry)\n\n const initialStateRef = React.useRef<{\n country: CountryCode\n inputValue: string\n normalizedValue: string\n hasExplicitCountrySelection: boolean\n } | null>(null)\n const lastNormalizedRef = React.useRef<string>(\"\")\n\n if (!initialStateRef.current) {\n if (!value) {\n initialStateRef.current = {\n country: fallbackCountry,\n inputValue: \"\",\n normalizedValue: \"\",\n hasExplicitCountrySelection: false,\n }\n lastNormalizedRef.current = \"\"\n } else {\n const baseCountryForInit = hasConfiguredCountry ? fallbackCountry : undefined\n const normalized = normalizeInputValue(value, baseCountryForInit, { allowJustPlus: true })\n if (!normalized) {\n initialStateRef.current = {\n country: fallbackCountry,\n inputValue: \"\",\n normalizedValue: \"\",\n hasExplicitCountrySelection: false,\n }\n lastNormalizedRef.current = \"\"\n } else {\n const {\n international,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n } = formatWithAsYouType(normalized, baseCountryForInit)\n const canonicalDetectedCountry = detectedCountry ?? undefined\n let resolvedCountry = canonicalDetectedCountry ?? fallbackCountry\n const rawDigits = sanitizeDigits(value ?? \"\")\n const hasExplicitPlus = typeof value === \"string\" ? /^\\s*\\+/.test(value) : false\n const internationalDigits = sanitizeDigits(international)\n const initialDialCode = getCountryCallingCode(resolvedCountry)\n const initialHasPrefix = detectNationalPrefixForDisplay(\n rawDigits,\n internationalDigits,\n initialDialCode,\n hasExplicitPlus\n )\n\n const suggestion = getSuggestionState(\n normalized,\n baseCountryForInit,\n phoneNumber ?? undefined,\n {\n hasRemovedNationalPrefix: initialHasPrefix,\n detectedCountry: canonicalDetectedCountry,\n hasExplicitInternationalPrefix,\n }\n )\n\n const inferredCountryToApply =\n !suggestion.shouldSuggest && !canonicalDetectedCountry ? inferredCountry : undefined\n\n\n if (inferredCountryToApply) {\n resolvedCountry = inferredCountryToApply\n }\n\n const resolvedFromValue =\n Boolean(canonicalDetectedCountry) || Boolean(inferredCountryToApply)\n if (resolvedFromValue) {\n hasResolvedCountryRef.current = true\n }\n\n const nextDialCode = getCountryCallingCode(resolvedCountry)\n const finalHasPrefix = inferredCountryToApply\n ? detectNationalPrefixForDisplay(\n rawDigits,\n internationalDigits,\n nextDialCode,\n hasExplicitPlus\n )\n : initialHasPrefix\n\n const displayValue = injectNationalPrefixDisplay(international, nextDialCode, {\n force: finalHasPrefix,\n })\n\n const displayDetectedCountry = canonicalDetectedCountry ?? undefined\n const allowInlineFlag = hasResolvedCountryRef.current\n initialStateRef.current = {\n country: resolvedCountry,\n inputValue: displayValue,\n normalizedValue: normalized,\n hasExplicitCountrySelection:\n allowInlineFlag &&\n shouldDisplayExplicitCountrySelection(suggestion, {\n detectedCountry: displayDetectedCountry,\n hasExplicitInternationalPrefix,\n }),\n }\n lastNormalizedRef.current = normalized\n }\n }\n }\n\n const initialState = initialStateRef.current\n\n const [uncontrolledCountry, setUncontrolledCountry] = React.useState(initialState.country)\n const [inputValueState, setInputValueState] = React.useState(initialState.inputValue)\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>(null)\n const [hasExplicitCountrySelection, setHasExplicitCountrySelection] = React.useState(\n initialState.hasExplicitCountrySelection\n )\n const manualSelectionCountryRef = React.useRef<CountryCode | null>(null)\n\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 consumeScrollBehavior = React.useCallback(() => {\n const behavior = scrollBehaviorRef.current\n scrollBehaviorRef.current = \"smooth\"\n return behavior\n }, [])\n\n const isCountryControlled = typeof countryProp === \"string\"\n const selectedCountry = isCountryControlled ? countryProp : uncontrolledCountry\n const activeCountry = selectedCountry ?? fallbackCountry\n\n const inputRef = React.useRef<HTMLInputElement | null>(null)\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 const hasAnnouncedCountryRef = React.useRef(false)\n\n const notifyCountryChange = React.useCallback(\n (country: CountryCode) => {\n hasAnnouncedCountryRef.current = true\n const selection = resolveSelectedCountry(country)\n onCountryChange?.(country, selection)\n return selection\n },\n [onCountryChange, resolveSelectedCountry]\n )\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 baseCountryForSync = hasResolvedCountryRef.current ? activeCountry : undefined\n const previousNormalized = lastNormalizedRef.current\n const normalized = normalizeInputValue(value, baseCountryForSync, {\n allowJustPlus: true,\n previousValue: previousNormalized,\n })\n lastNormalizedRef.current = normalized\n keyboardBufferRef.current = \"\"\n\n if (!normalized) {\n setInputValueState(\"\")\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n return\n }\n\n if (normalized === \"0\") {\n setInputValueState(\"0\")\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n return\n }\n\n if (normalized === \"+\") {\n setInputValueState(\"+\")\n setShowSuggestions(true)\n setCountryQuery(\"\")\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n return\n }\n\n const {\n international,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n } = formatWithAsYouType(normalized, baseCountryForSync)\n const canonicalDetectedCountry = detectedCountry ?? undefined\n let nextCountry = canonicalDetectedCountry ?? baseCountryForSync ?? activeCountry\n const rawDigits = sanitizeDigits(value ?? \"\")\n const hasExplicitPlus = typeof value === \"string\" ? /^\\s*\\+/.test(value) : false\n const internationalDigits = sanitizeDigits(international)\n const initialDialCode = getCountryCallingCode(nextCountry)\n const initialHasTypedTrunk = detectNationalPrefixForDisplay(\n rawDigits,\n internationalDigits,\n initialDialCode,\n hasExplicitPlus\n )\n\n const suggestion = getSuggestionState(\n normalized,\n baseCountryForSync,\n phoneNumber ?? undefined,\n {\n hasRemovedNationalPrefix: initialHasTypedTrunk,\n detectedCountry: canonicalDetectedCountry,\n hasExplicitInternationalPrefix,\n }\n )\n\n const inferredCountryToApply =\n !suggestion.shouldSuggest && !canonicalDetectedCountry ? inferredCountry : undefined\n const finalCountry = inferredCountryToApply ?? nextCountry\n\n const resolvedFromValue =\n Boolean(canonicalDetectedCountry) || Boolean(inferredCountryToApply)\n if (resolvedFromValue) {\n hasResolvedCountryRef.current = true\n }\n\n if (!isCountryControlled && finalCountry !== uncontrolledCountry) {\n setUncontrolledCountry(finalCountry)\n notifyCountryChange(finalCountry)\n }\n\n nextCountry = finalCountry\n\n if (\n manualSelectionCountryRef.current &&\n manualSelectionCountryRef.current !== nextCountry\n ) {\n manualSelectionCountryRef.current = null\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n const hasTypedTrunk = inferredCountryToApply\n ? detectNationalPrefixForDisplay(\n rawDigits,\n internationalDigits,\n nextDialCode,\n hasExplicitPlus\n )\n : initialHasTypedTrunk\n\n const displayValue = injectNationalPrefixDisplay(international, nextDialCode, {\n force: hasTypedTrunk,\n })\n const displayDetectedCountry = canonicalDetectedCountry ?? undefined\n const manualSelectionActive = manualSelectionCountryRef.current != null\n const shouldShowInlineFlag =\n manualSelectionActive ||\n shouldDisplayExplicitCountrySelection(suggestion, {\n detectedCountry: displayDetectedCountry,\n hasExplicitInternationalPrefix,\n })\n\n setInputValueState(displayValue)\n setShowSuggestions(suggestion.shouldSuggest)\n setCountryQuery(suggestion.query)\n setLengthIssue(hasResolvedCountryRef.current ? getLengthIssue(normalized, nextCountry) : null)\n setHasExplicitCountrySelection(hasResolvedCountryRef.current && shouldShowInlineFlag)\n }, [\n value,\n activeCountry,\n fallbackCountry,\n hasConfiguredCountry,\n isCountryControlled,\n notifyCountryChange,\n uncontrolledCountry,\n ])\n\n React.useEffect(() => {\n if (hasAnnouncedCountryRef.current) {\n return\n }\n if (!hasResolvedCountryRef.current) {\n return\n }\n const current = selectedCountry ?? fallbackCountry\n if (!current) {\n return\n }\n notifyCountryChange(current)\n }, [fallbackCountry, notifyCountryChange, selectedCountry])\n\n React.useEffect(() => {\n if (isCountryControlled && countryProp && countryProp !== uncontrolledCountry) {\n setUncontrolledCountry(countryProp)\n }\n }, [countryProp, isCountryControlled, uncontrolledCountry])\n\n const emitChange = React.useCallback(\n (details: Omit<PhoneNumberChangeDetails, \"selectedCountry\">) => {\n const selection = resolveSelectedCountry(details.country)\n onChange?.({\n ...details,\n selectedCountry: selection,\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 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 baseCountryForInput = hasResolvedCountryRef.current ? activeCountry : undefined\n const dialCode = baseCountryForInput ? getCountryCallingCode(baseCountryForInput) : \"\"\n const typedDigits = sanitizeDigits(raw)\n const hasExplicitPlus = raw.trim().startsWith(\"+\")\n const startsWithDialCode = dialCode ? typedDigits.startsWith(dialCode) : false\n const hasLeadingZero = typedDigits.startsWith(\"0\")\n const isIddPrefix = COMMON_IDD_PREFIXES.some((prefix) => typedDigits.startsWith(prefix))\n\n const shouldRemoveNationalPrefix =\n Boolean(baseCountryForInput) &&\n !isIddPrefix &&\n ((startsWithDialCode && typedDigits.slice(dialCode.length).startsWith(\"0\")) ||\n (!hasExplicitPlus && hasLeadingZero && typedDigits.length > 1) ||\n (hasExplicitPlus && hasLeadingZero && typedDigits.length > 1 && !startsWithDialCode))\n\n const previousNormalized = lastNormalizedRef.current\n const normalized = normalizeInputValue(raw, baseCountryForInput, {\n allowJustPlus: true,\n removeNationalPrefix: shouldRemoveNationalPrefix,\n previousValue: previousNormalized,\n })\n lastNormalizedRef.current = normalized\n\n if (!normalized) {\n setInputValueState(\"\")\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n pendingSelectionRef.current = resolveSelection(snapshot, \"\")\n\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n emitChange({\n formattedInternational: \"\",\n formattedNational: \"\",\n e164: null,\n country: nextCountry,\n countryCallingCode: nextDialCode,\n nationalNumber: \"\",\n rawInput: \"\",\n isValid: false,\n })\n return\n }\n\n if (normalized === \"0\") {\n setInputValueState(\"0\")\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n pendingSelectionRef.current = resolveSelection(snapshot, \"0\")\n\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n emitChange({\n formattedInternational: \"0\",\n formattedNational: \"0\",\n e164: null,\n country: nextCountry,\n countryCallingCode: nextDialCode,\n nationalNumber: \"0\",\n rawInput: \"0\",\n isValid: false,\n })\n return\n }\n\n if (normalized === \"+\") {\n setInputValueState(\"+\")\n setShowSuggestions(true)\n setCountryQuery(\"\")\n setHighlightedIndex(0)\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n pendingSelectionRef.current = resolveSelection(snapshot, \"+\")\n\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n emitChange({\n formattedInternational: \"+\",\n formattedNational: \"\",\n e164: null,\n country: nextCountry,\n countryCallingCode: nextDialCode,\n nationalNumber: \"\",\n rawInput: \"+\",\n isValid: false,\n })\n return\n }\n\n const {\n international,\n national,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n } = formatWithAsYouType(normalized, baseCountryForInput)\n const canonicalDetectedCountry = detectedCountry ?? undefined\n let nextCountry = canonicalDetectedCountry ?? baseCountryForInput ?? activeCountry\n\n const internationalDigits = sanitizeDigits(international)\n const initialDialCode = getCountryCallingCode(nextCountry)\n const initialHasTypedTrunk = detectNationalPrefixForDisplay(\n typedDigits,\n internationalDigits,\n initialDialCode,\n hasExplicitPlus\n )\n\n const suggestion = getSuggestionState(\n normalized,\n baseCountryForInput,\n phoneNumber ?? undefined,\n {\n hasRemovedNationalPrefix: initialHasTypedTrunk,\n detectedCountry: canonicalDetectedCountry,\n hasExplicitInternationalPrefix,\n }\n )\n\n const inferredCountryToApply =\n !suggestion.shouldSuggest && !canonicalDetectedCountry ? inferredCountry : undefined\n const finalCountry = inferredCountryToApply ?? nextCountry\n\n const resolvedFromInput =\n Boolean(canonicalDetectedCountry) || Boolean(inferredCountryToApply)\n if (resolvedFromInput) {\n hasResolvedCountryRef.current = true\n }\n\n if (!isCountryControlled && finalCountry !== uncontrolledCountry) {\n setUncontrolledCountry(finalCountry)\n notifyCountryChange(finalCountry)\n }\n\n nextCountry = finalCountry\n\n if (\n manualSelectionCountryRef.current &&\n manualSelectionCountryRef.current !== nextCountry\n ) {\n manualSelectionCountryRef.current = null\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n const normalizedDigits = sanitizeDigits(normalized)\n const nationalDigits = stripPrefix(normalizedDigits, nextDialCode)\n const hasTypedTrunk = inferredCountryToApply\n ? detectNationalPrefixForDisplay(\n typedDigits,\n internationalDigits,\n nextDialCode,\n hasExplicitPlus\n )\n : initialHasTypedTrunk\n\n const displayValue = injectNationalPrefixDisplay(international, nextDialCode, {\n force: hasTypedTrunk,\n })\n\n const displayDetectedCountry = canonicalDetectedCountry ?? undefined\n\n pendingSelectionRef.current = resolveSelection(snapshot, displayValue)\n setInputValueState(displayValue)\n setShowSuggestions(suggestion.shouldSuggest)\n setCountryQuery(suggestion.query)\n setHighlightedIndex(suggestion.shouldSuggest ? 0 : -1)\n setLengthIssue(hasResolvedCountryRef.current ? getLengthIssue(normalized, nextCountry) : null)\n const manualSelectionActive = manualSelectionCountryRef.current != null\n const shouldShowInlineFlag =\n manualSelectionActive ||\n shouldDisplayExplicitCountrySelection(suggestion, {\n detectedCountry: displayDetectedCountry,\n hasExplicitInternationalPrefix,\n })\n setHasExplicitCountrySelection(hasResolvedCountryRef.current && shouldShowInlineFlag)\n emitChange({\n formattedInternational: international,\n formattedNational: national,\n e164: phoneNumber?.number ?? null,\n country: nextCountry,\n countryCallingCode: nextDialCode,\n nationalNumber: nationalDigits,\n rawInput: normalized,\n isValid: phoneNumber?.isValid() ?? false,\n })\n },\n [\n activeCountry,\n emitChange,\n fallbackCountry,\n hasConfiguredCountry,\n isCountryControlled,\n notifyCountryChange,\n uncontrolledCountry,\n ]\n )\n\n const handleCountrySelect = React.useCallback(\n (option: SingleValue<CountryOption>) => {\n if (!option) {\n return\n }\n\n const previousDigits = sanitizeDigits(lastNormalizedRef.current || inputValueState)\n const currentDial = getCountryCallingCode(activeCountry)\n const digitsWithoutCurrentDial = previousDigits.startsWith(currentDial)\n ? previousDigits.slice(currentDial.length)\n : previousDigits\n let rebasedDigits = digitsWithoutCurrentDial\n if (!rebasedDigits) {\n rebasedDigits = option.dialCode\n } else if (!rebasedDigits.startsWith(option.dialCode)) {\n rebasedDigits = `${option.dialCode}${rebasedDigits}`\n }\n const normalized = `+${rebasedDigits}`\n lastNormalizedRef.current = normalized\n const { international, national, phoneNumber } = formatWithAsYouType(\n normalized,\n option.value\n )\n const nextCountry = option.value\n manualSelectionCountryRef.current = nextCountry\n hasResolvedCountryRef.current = true\n\n setInputValueState(international)\n pendingSelectionRef.current = {\n start: international.length,\n end: international.length,\n }\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(getLengthIssue(normalized, nextCountry))\n\n if (!isCountryControlled && nextCountry !== uncontrolledCountry) {\n setUncontrolledCountry(nextCountry)\n }\n\n notifyCountryChange(nextCountry)\n\n const normalizedDigits = sanitizeDigits(normalized)\n const dialCode = phoneNumber?.countryCallingCode ?? option.dialCode\n const nationalDigits = stripPrefix(normalizedDigits, dialCode)\n setHasExplicitCountrySelection(true)\n emitChange({\n formattedInternational: international,\n formattedNational: national,\n e164: phoneNumber?.number ?? null,\n country: nextCountry,\n countryCallingCode: dialCode,\n nationalNumber: nationalDigits,\n rawInput: normalized,\n isValid: phoneNumber?.isValid() ?? false,\n })\n\n requestAnimationFrame(() => {\n inputRef.current?.focus()\n })\n },\n [activeCountry, emitChange, inputValueState, isCountryControlled, notifyCountryChange, uncontrolledCountry]\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) => {\n if (!results.some((existing) => existing.value === option.value)) {\n results.push(option)\n }\n }\n\n const fallbackOption = countryOptions.find((option) => option.value === fallbackCountry)\n const currentOption = countryOptions.find((option) => option.value === activeCountry)\n const query = countryQuery.trim()\n const digitQuery = sanitizeDigits(query)\n const normalizedQuery = normalizeSearchValue(query)\n\n if (!digitQuery && !normalizedQuery) {\n if (fallbackOption) {\n pushUnique(fallbackOption)\n }\n if (currentOption) {\n pushUnique(currentOption)\n }\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 if (currentOption) {\n pushUnique(currentOption)\n }\n if (fallbackOption) {\n pushUnique(fallbackOption)\n }\n if (results.length === 0) {\n countryOptions.forEach(pushUnique)\n }\n\n return results\n }, [activeCountry, countryOptions, countryQuery, fallbackCountry, 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 React.useEffect(() => {\n if (highlightedIndex < 0) {\n scrollBehaviorRef.current = \"smooth\"\n }\n }, [highlightedIndex])\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 = countryOptions.find((option) => option.value === activeCountry)\n const activeFlag = activeOption?.flag ?? \"\"\n const inlineFlagLabel = hasExplicitCountrySelection\n ? resolvedMessages.selectedCountryLabel(activeOption?.name ?? activeCountry ?? null)\n : resolvedMessages.selectCountryLabel\n const hasInlineFlag = hasExplicitCountrySelection && Boolean(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 target = highlightedOption ?? filteredOptions[0]\n handleCountrySelect(target)\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":["PhoneNumberInput","React","forwardRef","props","forwardedRef","value","defaultCountry","country","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","hasConfiguredCountry","localeCacheKey","getLocaleCacheKey","localeForBuild","useMemo","parseLocaleCacheKey","resolvedMessages","resolveMessages","countryOptions","getCachedCountryOptions","resolveSelectedCountry","useCallback","match","find","candidate","toSelectedCountry","buildFallbackSelectedCountry","fallbackCountry","getValidCountry","DEFAULT_COUNTRY","some","option","hasResolvedCountryRef","useRef","initialStateRef","lastNormalizedRef","current","inputValue","normalizedValue","hasExplicitCountrySelection","baseCountryForInit","undefined","normalized","normalizeInputValue","allowJustPlus","international","phoneNumber","detectedCountry","inferredCountry","hasExplicitInternationalPrefix","formatWithAsYouType","canonicalDetectedCountry","resolvedCountry","rawDigits","sanitizeDigits","hasExplicitPlus","test","internationalDigits","initialDialCode","getCountryCallingCode","initialHasPrefix","detectNationalPrefixForDisplay","suggestion","getSuggestionState","hasRemovedNationalPrefix","inferredCountryToApply","shouldSuggest","nextDialCode","finalHasPrefix","displayValue","injectNationalPrefixDisplay","force","displayDetectedCountry","allowInlineFlag","shouldDisplayExplicitCountrySelection","initialState","uncontrolledCountry","setUncontrolledCountry","useState","inputValueState","setInputValueState","countryQuery","setCountryQuery","showSuggestions","setShowSuggestions","highlightedIndex","setHighlightedIndex","isFocused","setIsFocused","lengthIssue","setLengthIssue","setHasExplicitCountrySelection","manualSelectionCountryRef","keyboardBufferRef","bufferTimeoutRef","scrollBehaviorRef","pendingSelectionRef","consumeScrollBehavior","behavior","isCountryControlled","selectedCountry","activeCountry","inputRef","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","hasAnnouncedCountryRef","notifyCountryChange","useEffect","window","clearTimeout","baseCountryForSync","previousNormalized","previousValue","nextCountry","initialHasTypedTrunk","finalCountry","hasTypedTrunk","shouldShowInlineFlag","query","getLengthIssue","emitChange","details","scheduleBufferReset","setTimeout","handleInputChange","event","target","snapshot","captureSelectionSnapshot","raw","baseCountryForInput","dialCode","typedDigits","trim","startsWith","startsWithDialCode","hasLeadingZero","isIddPrefix","COMMON_IDD_PREFIXES","prefix","shouldRemoveNationalPrefix","Boolean","slice","length","removeNationalPrefix","resolveSelection","formattedInternational","formattedNational","e164","countryCallingCode","nationalNumber","rawInput","isValid","national","normalizedDigits","nationalDigits","stripPrefix","number","handleCountrySelect","previousDigits","currentDial","rebasedDigits","requestAnimationFrame","focus","filteredOptions","results","pushUnique","existing","push","fallbackOption","currentOption","digitQuery","normalizedQuery","normalizeSearchValue","forEach","filter","sort","a","b","aExact","bExact","normalizedSearchableTokens","token","includes","aIndex","optionMatchIndex","bIndex","localeCompare","suggestionMenuIsOpen","highlightedOption","updateHighlightedOption","index","findIndex","selectFormatOptionLabel","meta","formatCountryOption","optionLabelRenderer","context","selectValue","highlightContextValue","highlightedValue","setHighlightedOption","renderOptionLabel","activeOption","activeFlag","flag","inlineFlagLabel","selectedCountryLabel","selectCountryLabel","hasInlineFlag","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","toLowerCase","handleFocus","handleBlur","openCountryMenu","shimName","cn","jsxs","pointerEvents","width","SuggestionContext","Select","noMatches","displayName"],"mappings":";;;;;;;;;;AAoEO,MAAMA,KAAmBC,EAAMC,WACpC,SAA0BC,IAAOC,IAAc;AAC7C,QAAM;AAAA,IACJC,OAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,SAASC;AAAAA,IACTC,QAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,UAAAA;AAAAA,IAC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,aAAcjF,OAAUA,EAAM4G,eAAAA,GAC9B,SAASM,IACT,UAAU,IACV,UAAAxS,IAEA,UAAAkR,gBAAAA,EAAAA,IAAC,UAAK,eAAY,QACfR,UAAAA,KAAgBL,KAAa,KAChC,EAAA,CACF;AAAA,IAAA,GACF;AAAA,IAECoC,KACCvB,gBAAAA,EAAAA,IAAC,SAAA,EACC,UAAU,IACV,cAAa,OACb,MAAMuB,IACN,eAAY,QACZ,WAAU,+DAA6D,IAEvE;AAAA,IAEJvB,gBAAAA,EAAAA,IAAC,OAAA,EACC,WAAU,sCACV,OAAO;AAAA,MACL0B,eAAevD,IAAuB,SAAS;AAAA,MAC/CwD,OAAO;AAAA,IAAA,GAET,aAAcvH,CAAAA,MAAUA,EAAM4G,eAAAA,GAE9B,UAAAhB,gBAAAA,MAAC4B,GAAkB,UAAlB,EAA2B,OAAO9C,IACjC,UAAAkB,gBAAAA,EAAAA,IAAC6B,MACC,GAAIzK,IACJ,YAAY+G,GACZ,SAASxB,GACT,OAAO,MACP,YAAYvE,IACZ,QAAQZ,IACR,aAAa,IACb,cAAc,IACd,uBAAuB,IACvB,iBAAiB,IACjB,0BAA0B,IAC1B,kBAAAV,IACA,cAAcG,OAAqBH,KAAmB,UAAU,aAChE,UAAUuF,IACV,iBAAiB1F,MAAuB,4BACxC,aAAY,IACZ,mBAAmB6H,IACnB,kBACErH,OAAqB,MAAM5G,GAAiBuR,WAAAA,CAC7C,EAAA,CAEL,EAAA,CACF;AAAA,IAEClC;AAAAA,EAAAA,GACH;AAEJ,CACF;AAEA5R,GAAiB+T,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 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;AA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yL,gBAAAA,MAAC,UAAA,EACC,MAAK,UACL,WAAW0B,GACT,wOACAnC,KACI,uBACA,qDACJjM,IACI,kCACAC,IACE,mBACA,+BACR,GACA,cAAY6L,IACZ,aAAc5D,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;"}
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]}