@rpcbase/ui 0.189.0 → 0.190.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 (583) hide show
  1. package/dist/index100.js +5 -185
  2. package/dist/index100.js.map +1 -1
  3. package/dist/index101.js +3 -106
  4. package/dist/index101.js.map +1 -1
  5. package/dist/index102.js +8 -262
  6. package/dist/index102.js.map +1 -1
  7. package/dist/index103.js +5 -9
  8. package/dist/index103.js.map +1 -1
  9. package/dist/index104.js +4 -42
  10. package/dist/index104.js.map +1 -1
  11. package/dist/index105.js +4 -4
  12. package/dist/index105.js.map +1 -1
  13. package/dist/index106.js +6 -46
  14. package/dist/index106.js.map +1 -1
  15. package/dist/index107.js +143 -203
  16. package/dist/index107.js.map +1 -1
  17. package/dist/index108.js +39 -21
  18. package/dist/index108.js.map +1 -1
  19. package/dist/index109.js +4 -24
  20. package/dist/index109.js.map +1 -1
  21. package/dist/index110.js +5 -397
  22. package/dist/index110.js.map +1 -1
  23. package/dist/index111.js +13 -46
  24. package/dist/index111.js.map +1 -1
  25. package/dist/index112.js +14 -52
  26. package/dist/index112.js.map +1 -1
  27. package/dist/index113.js +7 -4
  28. package/dist/index113.js.map +1 -1
  29. package/dist/index114.js +31 -4
  30. package/dist/index114.js.map +1 -1
  31. package/dist/index115.js +10 -15
  32. package/dist/index115.js.map +1 -1
  33. package/dist/index116.js +10 -5
  34. package/dist/index116.js.map +1 -1
  35. package/dist/index117.js +8 -7
  36. package/dist/index117.js.map +1 -1
  37. package/dist/index118.js +13 -16
  38. package/dist/index118.js.map +1 -1
  39. package/dist/index119.js +101 -4
  40. package/dist/index119.js.map +1 -1
  41. package/dist/index120.js +20 -5
  42. package/dist/index120.js.map +1 -1
  43. package/dist/index121.js +53 -5
  44. package/dist/index121.js.map +1 -1
  45. package/dist/index122.js +72 -5
  46. package/dist/index122.js.map +1 -1
  47. package/dist/index123.js +9 -4
  48. package/dist/index123.js.map +1 -1
  49. package/dist/index124.js +20 -4
  50. package/dist/index124.js.map +1 -1
  51. package/dist/index125.js +16 -6
  52. package/dist/index125.js.map +1 -1
  53. package/dist/index126.js +23 -24
  54. package/dist/index126.js.map +1 -1
  55. package/dist/index127.js +6 -6
  56. package/dist/index127.js.map +1 -1
  57. package/dist/index128.js +5 -4
  58. package/dist/index128.js.map +1 -1
  59. package/dist/index129.js +23 -6
  60. package/dist/index129.js.map +1 -1
  61. package/dist/index130.js +35 -6
  62. package/dist/index130.js.map +1 -1
  63. package/dist/index131.js +16 -5
  64. package/dist/index131.js.map +1 -1
  65. package/dist/index132.js +6 -5
  66. package/dist/index132.js.map +1 -1
  67. package/dist/index133.js +4 -4
  68. package/dist/index133.js.map +1 -1
  69. package/dist/index134.js +4 -8
  70. package/dist/index134.js.map +1 -1
  71. package/dist/index135.js +4 -5
  72. package/dist/index135.js.map +1 -1
  73. package/dist/index136.js +4 -4
  74. package/dist/index136.js.map +1 -1
  75. package/dist/index137.js +3 -4
  76. package/dist/index137.js.map +1 -1
  77. package/dist/index138.js +6 -6
  78. package/dist/index138.js.map +1 -1
  79. package/dist/index139.js +24 -146
  80. package/dist/index139.js.map +1 -1
  81. package/dist/index140.js +7 -39
  82. package/dist/index140.js.map +1 -1
  83. package/dist/index141.js +6 -4
  84. package/dist/index141.js.map +1 -1
  85. package/dist/index142.js +5 -7
  86. package/dist/index142.js.map +1 -1
  87. package/dist/index143.js +3 -13
  88. package/dist/index143.js.map +1 -1
  89. package/dist/index144.js +3 -13
  90. package/dist/index144.js.map +1 -1
  91. package/dist/index145.js +4 -7
  92. package/dist/index145.js.map +1 -1
  93. package/dist/index146.js +3 -31
  94. package/dist/index146.js.map +1 -1
  95. package/dist/index147.js +4 -10
  96. package/dist/index147.js.map +1 -1
  97. package/dist/index148.js +3 -10
  98. package/dist/index148.js.map +1 -1
  99. package/dist/index149.js +3 -8
  100. package/dist/index149.js.map +1 -1
  101. package/dist/index15.js +4 -4
  102. package/dist/index150.js +3 -13
  103. package/dist/index150.js.map +1 -1
  104. package/dist/index151.js +45 -100
  105. package/dist/index151.js.map +1 -1
  106. package/dist/index152.js +47 -20
  107. package/dist/index152.js.map +1 -1
  108. package/dist/index153.js +203 -51
  109. package/dist/index153.js.map +1 -1
  110. package/dist/index154.js +21 -72
  111. package/dist/index154.js.map +1 -1
  112. package/dist/index155.js +24 -9
  113. package/dist/index155.js.map +1 -1
  114. package/dist/index156.js +397 -18
  115. package/dist/index156.js.map +1 -1
  116. package/dist/index157.js +604 -15
  117. package/dist/index157.js.map +1 -1
  118. package/dist/index158.js +5 -23
  119. package/dist/index158.js.map +1 -1
  120. package/dist/index159.js +68 -6
  121. package/dist/index159.js.map +1 -1
  122. package/dist/index160.js +2 -6
  123. package/dist/index160.js.map +1 -1
  124. package/dist/index161.js +358 -18
  125. package/dist/index161.js.map +1 -1
  126. package/dist/index162.js +261 -34
  127. package/dist/index162.js.map +1 -1
  128. package/dist/index163.js +61 -16
  129. package/dist/index163.js.map +1 -1
  130. package/dist/index164.js +46 -6
  131. package/dist/index164.js.map +1 -1
  132. package/dist/index165.js +169 -4
  133. package/dist/index165.js.map +1 -1
  134. package/dist/index166.js +109 -4
  135. package/dist/index166.js.map +1 -1
  136. package/dist/index167.js +24 -4
  137. package/dist/index167.js.map +1 -1
  138. package/dist/index168.js +8 -5
  139. package/dist/index168.js.map +1 -1
  140. package/dist/index169.js +4 -3
  141. package/dist/index169.js.map +1 -1
  142. package/dist/index170.js +5 -6
  143. package/dist/index170.js.map +1 -1
  144. package/dist/index171.js +5 -24
  145. package/dist/index171.js.map +1 -1
  146. package/dist/index172.js +466 -7
  147. package/dist/index172.js.map +1 -1
  148. package/dist/index173.js +185 -6
  149. package/dist/index173.js.map +1 -1
  150. package/dist/index174.js +107 -5
  151. package/dist/index174.js.map +1 -1
  152. package/dist/index175.js +262 -3
  153. package/dist/index175.js.map +1 -1
  154. package/dist/index176.js +9 -3
  155. package/dist/index176.js.map +1 -1
  156. package/dist/index177.js +42 -4
  157. package/dist/index177.js.map +1 -1
  158. package/dist/index178.js +4 -3
  159. package/dist/index178.js.map +1 -1
  160. package/dist/index179.js +16 -4
  161. package/dist/index179.js.map +1 -1
  162. package/dist/index180.js +5 -3
  163. package/dist/index180.js.map +1 -1
  164. package/dist/index181.js +5 -3
  165. package/dist/index181.js.map +1 -1
  166. package/dist/index182.js +58 -3
  167. package/dist/index182.js.map +1 -1
  168. package/dist/index183.js +63 -64
  169. package/dist/index183.js.map +1 -1
  170. package/dist/index184.js +6 -180
  171. package/dist/index184.js.map +1 -1
  172. package/dist/index185.js +4 -46
  173. package/dist/index185.js.map +1 -1
  174. package/dist/index186.js +7 -13
  175. package/dist/index186.js.map +1 -1
  176. package/dist/index187.js +17 -154
  177. package/dist/index187.js.map +1 -1
  178. package/dist/index188.js +5 -30
  179. package/dist/index188.js.map +1 -1
  180. package/dist/index189.js +5 -9
  181. package/dist/index189.js.map +1 -1
  182. package/dist/index190.js +13 -47
  183. package/dist/index190.js.map +1 -1
  184. package/dist/index191.js +10 -11
  185. package/dist/index191.js.map +1 -1
  186. package/dist/index192.js +14 -44
  187. package/dist/index192.js.map +1 -1
  188. package/dist/index193.js +14 -95
  189. package/dist/index193.js.map +1 -1
  190. package/dist/index194.js +5 -86
  191. package/dist/index194.js.map +1 -1
  192. package/dist/index195.js +6 -105
  193. package/dist/index195.js.map +1 -1
  194. package/dist/index196.js +7 -52
  195. package/dist/index196.js.map +1 -1
  196. package/dist/index197.js +6 -11
  197. package/dist/index197.js.map +1 -1
  198. package/dist/index198.js +9 -37
  199. package/dist/index198.js.map +1 -1
  200. package/dist/index199.js +5 -8
  201. package/dist/index199.js.map +1 -1
  202. package/dist/index20.js +6 -6
  203. package/dist/index200.js +5 -116
  204. package/dist/index200.js.map +1 -1
  205. package/dist/index201.js +9 -17
  206. package/dist/index201.js.map +1 -1
  207. package/dist/index202.js +5 -15
  208. package/dist/index202.js.map +1 -1
  209. package/dist/index203.js +5 -3
  210. package/dist/index203.js.map +1 -1
  211. package/dist/index204.js +4 -36
  212. package/dist/index204.js.map +1 -1
  213. package/dist/index205.js +11 -20
  214. package/dist/index205.js.map +1 -1
  215. package/dist/index206.js +10 -9
  216. package/dist/index206.js.map +1 -1
  217. package/dist/index207.js +10 -8
  218. package/dist/index207.js.map +1 -1
  219. package/dist/index208.js +11 -19
  220. package/dist/index208.js.map +1 -1
  221. package/dist/index209.js +11 -28
  222. package/dist/index209.js.map +1 -1
  223. package/dist/index21.js +1 -1
  224. package/dist/index210.js +10 -16
  225. package/dist/index210.js.map +1 -1
  226. package/dist/index211.js +7 -24
  227. package/dist/index211.js.map +1 -1
  228. package/dist/index212.js +7 -29
  229. package/dist/index212.js.map +1 -1
  230. package/dist/index213.js +6 -5
  231. package/dist/index213.js.map +1 -1
  232. package/dist/index214.js +6 -16
  233. package/dist/index214.js.map +1 -1
  234. package/dist/index215.js +7 -5
  235. package/dist/index215.js.map +1 -1
  236. package/dist/index216.js +6 -5
  237. package/dist/index216.js.map +1 -1
  238. package/dist/index217.js +55 -58
  239. package/dist/index217.js.map +1 -1
  240. package/dist/index218.js +8 -66
  241. package/dist/index218.js.map +1 -1
  242. package/dist/index219.js +19 -6
  243. package/dist/index219.js.map +1 -1
  244. package/dist/index22.js +1 -1
  245. package/dist/index220.js +16 -4
  246. package/dist/index220.js.map +1 -1
  247. package/dist/index221.js +7 -7
  248. package/dist/index221.js.map +1 -1
  249. package/dist/index222.js +10 -17
  250. package/dist/index222.js.map +1 -1
  251. package/dist/index223.js +10 -5
  252. package/dist/index223.js.map +1 -1
  253. package/dist/index224.js +21 -5
  254. package/dist/index224.js.map +1 -1
  255. package/dist/index225.js +10 -13
  256. package/dist/index225.js.map +1 -1
  257. package/dist/index226.js +9 -10
  258. package/dist/index226.js.map +1 -1
  259. package/dist/index227.js +9 -14
  260. package/dist/index227.js.map +1 -1
  261. package/dist/index228.js +4 -14
  262. package/dist/index228.js.map +1 -1
  263. package/dist/index229.js +5 -5
  264. package/dist/index229.js.map +1 -1
  265. package/dist/index230.js +16 -6
  266. package/dist/index230.js.map +1 -1
  267. package/dist/index231.js +9 -7
  268. package/dist/index231.js.map +1 -1
  269. package/dist/index232.js +18 -6
  270. package/dist/index232.js.map +1 -1
  271. package/dist/index233.js +15 -9
  272. package/dist/index233.js.map +1 -1
  273. package/dist/index234.js +12 -5
  274. package/dist/index234.js.map +1 -1
  275. package/dist/index235.js +29 -5
  276. package/dist/index235.js.map +1 -1
  277. package/dist/index236.js +12 -9
  278. package/dist/index236.js.map +1 -1
  279. package/dist/index237.js +25 -5
  280. package/dist/index237.js.map +1 -1
  281. package/dist/index238.js +5 -5
  282. package/dist/index238.js.map +1 -1
  283. package/dist/index239.js +24 -4
  284. package/dist/index239.js.map +1 -1
  285. package/dist/index24.js +1 -1
  286. package/dist/index240.js +28 -11
  287. package/dist/index240.js.map +1 -1
  288. package/dist/index241.js +5 -11
  289. package/dist/index241.js.map +1 -1
  290. package/dist/index242.js +67 -10
  291. package/dist/index242.js.map +1 -1
  292. package/dist/index243.js +180 -11
  293. package/dist/index243.js.map +1 -1
  294. package/dist/index244.js +46 -11
  295. package/dist/index244.js.map +1 -1
  296. package/dist/index245.js +13 -10
  297. package/dist/index245.js.map +1 -1
  298. package/dist/index246.js +154 -7
  299. package/dist/index246.js.map +1 -1
  300. package/dist/index247.js +30 -6
  301. package/dist/index247.js.map +1 -1
  302. package/dist/index248.js +9 -5
  303. package/dist/index248.js.map +1 -1
  304. package/dist/index249.js +47 -6
  305. package/dist/index249.js.map +1 -1
  306. package/dist/index250.js +11 -7
  307. package/dist/index250.js.map +1 -1
  308. package/dist/index251.js +44 -6
  309. package/dist/index251.js.map +1 -1
  310. package/dist/index252.js +92 -52
  311. package/dist/index252.js.map +1 -1
  312. package/dist/index253.js +86 -8
  313. package/dist/index253.js.map +1 -1
  314. package/dist/index254.js +103 -17
  315. package/dist/index254.js.map +1 -1
  316. package/dist/index255.js +50 -14
  317. package/dist/index255.js.map +1 -1
  318. package/dist/index256.js +11 -7
  319. package/dist/index256.js.map +1 -1
  320. package/dist/index257.js +35 -8
  321. package/dist/index257.js.map +1 -1
  322. package/dist/index258.js +8 -10
  323. package/dist/index258.js.map +1 -1
  324. package/dist/index259.js +115 -20
  325. package/dist/index259.js.map +1 -1
  326. package/dist/index260.js +17 -10
  327. package/dist/index260.js.map +1 -1
  328. package/dist/index261.js +15 -9
  329. package/dist/index261.js.map +1 -1
  330. package/dist/index262.js +3 -9
  331. package/dist/index262.js.map +1 -1
  332. package/dist/index263.js +36 -4
  333. package/dist/index263.js.map +1 -1
  334. package/dist/index264.js +20 -5
  335. package/dist/index264.js.map +1 -1
  336. package/dist/index265.js +9 -16
  337. package/dist/index265.js.map +1 -1
  338. package/dist/index266.js +8 -9
  339. package/dist/index266.js.map +1 -1
  340. package/dist/index267.js +17 -16
  341. package/dist/index267.js.map +1 -1
  342. package/dist/index268.js +26 -13
  343. package/dist/index268.js.map +1 -1
  344. package/dist/index269.js +16 -12
  345. package/dist/index269.js.map +1 -1
  346. package/dist/index270.js +4 -29
  347. package/dist/index270.js.map +1 -1
  348. package/dist/index271.js +18 -12
  349. package/dist/index271.js.map +1 -1
  350. package/dist/index272.js +12 -25
  351. package/dist/index272.js.map +1 -1
  352. package/dist/index273.js +5 -6
  353. package/dist/index273.js.map +1 -1
  354. package/dist/index274.js +3 -21
  355. package/dist/index274.js.map +1 -1
  356. package/dist/index275.js +24 -5
  357. package/dist/index275.js.map +1 -1
  358. package/dist/index276.js +113 -3
  359. package/dist/index276.js.map +1 -1
  360. package/dist/index277.js +15 -23
  361. package/dist/index277.js.map +1 -1
  362. package/dist/index278.js +519 -107
  363. package/dist/index278.js.map +1 -1
  364. package/dist/index279.js +126 -14
  365. package/dist/index279.js.map +1 -1
  366. package/dist/index28.js +1 -1
  367. package/dist/index280.js +125 -516
  368. package/dist/index280.js.map +1 -1
  369. package/dist/index281.js +20 -127
  370. package/dist/index281.js.map +1 -1
  371. package/dist/index282.js +5 -133
  372. package/dist/index282.js.map +1 -1
  373. package/dist/index283.js +5 -4
  374. package/dist/index283.js.map +1 -1
  375. package/dist/index284.js +4 -19
  376. package/dist/index284.js.map +1 -1
  377. package/dist/index285.js +15 -12
  378. package/dist/index285.js.map +1 -1
  379. package/dist/index286.js +8 -64
  380. package/dist/index286.js.map +1 -1
  381. package/dist/index287.js +6 -69
  382. package/dist/index287.js.map +1 -1
  383. package/dist/index288.js +5 -9
  384. package/dist/index288.js.map +1 -1
  385. package/dist/index289.js +545 -13
  386. package/dist/index289.js.map +1 -1
  387. package/dist/index290.js +45 -64
  388. package/dist/index290.js.map +1 -1
  389. package/dist/index291.js +17 -5
  390. package/dist/index291.js.map +1 -1
  391. package/dist/index292.js +6 -5
  392. package/dist/index292.js.map +1 -1
  393. package/dist/index293.js +9 -4
  394. package/dist/index293.js.map +1 -1
  395. package/dist/index294.js +7 -15
  396. package/dist/index294.js.map +1 -1
  397. package/dist/index295.js +8 -8
  398. package/dist/index295.js.map +1 -1
  399. package/dist/index296.js +12 -5
  400. package/dist/index296.js.map +1 -1
  401. package/dist/index297.js +9 -4
  402. package/dist/index297.js.map +1 -1
  403. package/dist/index298.js +13 -545
  404. package/dist/index298.js.map +1 -1
  405. package/dist/index299.js +65 -47
  406. package/dist/index299.js.map +1 -1
  407. package/dist/index30.js +1 -1
  408. package/dist/index300.js +69 -18
  409. package/dist/index300.js.map +1 -1
  410. package/dist/index301.js +9 -7
  411. package/dist/index301.js.map +1 -1
  412. package/dist/index302.js +14 -9
  413. package/dist/index302.js.map +1 -1
  414. package/dist/index303.js +66 -8
  415. package/dist/index303.js.map +1 -1
  416. package/dist/index304.js +4 -8
  417. package/dist/index304.js.map +1 -1
  418. package/dist/index305.js +56 -13
  419. package/dist/index305.js.map +1 -1
  420. package/dist/index306.js +68 -10
  421. package/dist/index306.js.map +1 -1
  422. package/dist/index307.js +31 -14
  423. package/dist/index307.js.map +1 -1
  424. package/dist/index308.js +9 -4
  425. package/dist/index308.js.map +1 -1
  426. package/dist/index309.js +153 -23
  427. package/dist/index309.js.map +1 -1
  428. package/dist/index31.js +5 -5
  429. package/dist/index310.js +108 -5
  430. package/dist/index310.js.map +1 -1
  431. package/dist/index311.js +4 -56
  432. package/dist/index311.js.map +1 -1
  433. package/dist/index312.js +23 -68
  434. package/dist/index312.js.map +1 -1
  435. package/dist/index313.js +16 -31
  436. package/dist/index313.js.map +1 -1
  437. package/dist/index314.js +29 -9
  438. package/dist/index314.js.map +1 -1
  439. package/dist/index315.js +13 -153
  440. package/dist/index315.js.map +1 -1
  441. package/dist/index316.js +7 -108
  442. package/dist/index316.js.map +1 -1
  443. package/dist/index32.js +24 -24
  444. package/dist/index33.js +3 -3
  445. package/dist/index35.js +16 -2635
  446. package/dist/index35.js.map +1 -1
  447. package/dist/index36.js +113 -377
  448. package/dist/index36.js.map +1 -1
  449. package/dist/index37.js +204 -215
  450. package/dist/index37.js.map +1 -1
  451. package/dist/index38.js +87 -18
  452. package/dist/index38.js.map +1 -1
  453. package/dist/index39.js +115 -126
  454. package/dist/index39.js.map +1 -1
  455. package/dist/index40.js +5 -221
  456. package/dist/index40.js.map +1 -1
  457. package/dist/index41.js +836 -83
  458. package/dist/index41.js.map +1 -1
  459. package/dist/index42.js +53 -115
  460. package/dist/index42.js.map +1 -1
  461. package/dist/index43.js +7 -5
  462. package/dist/index43.js.map +1 -1
  463. package/dist/index44.js +2 -844
  464. package/dist/index44.js.map +1 -1
  465. package/dist/index45.js +12 -57
  466. package/dist/index45.js.map +1 -1
  467. package/dist/index46.js +18 -7
  468. package/dist/index46.js.map +1 -1
  469. package/dist/index47.js +8 -2
  470. package/dist/index47.js.map +1 -1
  471. package/dist/index48.js +2 -12
  472. package/dist/index48.js.map +1 -1
  473. package/dist/index49.js +22 -17
  474. package/dist/index49.js.map +1 -1
  475. package/dist/index50.js +233 -7
  476. package/dist/index50.js.map +1 -1
  477. package/dist/index51.js +205 -2
  478. package/dist/index51.js.map +1 -1
  479. package/dist/index52.js +3 -23
  480. package/dist/index52.js.map +1 -1
  481. package/dist/index53.js +6 -233
  482. package/dist/index53.js.map +1 -1
  483. package/dist/index54.js +44 -201
  484. package/dist/index54.js.map +1 -1
  485. package/dist/index55.js +27 -2
  486. package/dist/index55.js.map +1 -1
  487. package/dist/index56.js +51 -2
  488. package/dist/index56.js.map +1 -1
  489. package/dist/index57.js +7 -5
  490. package/dist/index57.js.map +1 -1
  491. package/dist/index58.js +14 -7
  492. package/dist/index58.js.map +1 -1
  493. package/dist/index59.js +133 -5
  494. package/dist/index59.js.map +1 -1
  495. package/dist/index60.js +10 -53
  496. package/dist/index60.js.map +1 -1
  497. package/dist/index61.js +217 -2
  498. package/dist/index61.js.map +1 -1
  499. package/dist/index62.js +13 -2
  500. package/dist/index62.js.map +1 -1
  501. package/dist/index63.js +33 -3
  502. package/dist/index63.js.map +1 -1
  503. package/dist/index64.js +46 -6
  504. package/dist/index64.js.map +1 -1
  505. package/dist/index65.js +7 -47
  506. package/dist/index65.js.map +1 -1
  507. package/dist/index66.js +47 -24
  508. package/dist/index66.js.map +1 -1
  509. package/dist/index67.js +4 -51
  510. package/dist/index67.js.map +1 -1
  511. package/dist/index68.js +5 -7
  512. package/dist/index68.js.map +1 -1
  513. package/dist/index69.js +28 -15
  514. package/dist/index69.js.map +1 -1
  515. package/dist/index70.js +48 -132
  516. package/dist/index70.js.map +1 -1
  517. package/dist/index71.js +9 -11
  518. package/dist/index71.js.map +1 -1
  519. package/dist/index72.js +11 -216
  520. package/dist/index72.js.map +1 -1
  521. package/dist/index73.js +2 -13
  522. package/dist/index73.js.map +1 -1
  523. package/dist/index74.js +2 -34
  524. package/dist/index74.js.map +1 -1
  525. package/dist/index75.js +2 -47
  526. package/dist/index75.js.map +1 -1
  527. package/dist/index76.js +2 -8
  528. package/dist/index76.js.map +1 -1
  529. package/dist/index77.js +5 -49
  530. package/dist/index77.js.map +1 -1
  531. package/dist/index78.js +8 -4
  532. package/dist/index78.js.map +1 -1
  533. package/dist/index79.js +5 -5
  534. package/dist/index79.js.map +1 -1
  535. package/dist/index80.js +52 -28
  536. package/dist/index80.js.map +1 -1
  537. package/dist/index81.js +5 -50
  538. package/dist/index81.js.map +1 -1
  539. package/dist/index82.js +5 -9
  540. package/dist/index82.js.map +1 -1
  541. package/dist/index83.js +15 -11
  542. package/dist/index83.js.map +1 -1
  543. package/dist/index84.js +5 -605
  544. package/dist/index84.js.map +1 -1
  545. package/dist/index85.js +7 -5
  546. package/dist/index85.js.map +1 -1
  547. package/dist/index86.js +16 -68
  548. package/dist/index86.js.map +1 -1
  549. package/dist/index87.js +5 -2
  550. package/dist/index87.js.map +1 -1
  551. package/dist/index88.js +4 -363
  552. package/dist/index88.js.map +1 -1
  553. package/dist/index89.js +5 -261
  554. package/dist/index89.js.map +1 -1
  555. package/dist/index90.js +5 -60
  556. package/dist/index90.js.map +1 -1
  557. package/dist/index91.js +4 -46
  558. package/dist/index91.js.map +1 -1
  559. package/dist/index92.js +4 -169
  560. package/dist/index92.js.map +1 -1
  561. package/dist/index93.js +6 -109
  562. package/dist/index93.js.map +1 -1
  563. package/dist/index94.js +24 -24
  564. package/dist/index94.js.map +1 -1
  565. package/dist/index95.js +7 -8
  566. package/dist/index95.js.map +1 -1
  567. package/dist/index96.js +4 -4
  568. package/dist/index96.js.map +1 -1
  569. package/dist/index97.js +6 -5
  570. package/dist/index97.js.map +1 -1
  571. package/dist/index98.js +4 -3
  572. package/dist/index98.js.map +1 -1
  573. package/dist/index99.js +4 -466
  574. package/dist/index99.js.map +1 -1
  575. package/package.json +1 -1
  576. package/dist/index321.js +0 -19
  577. package/dist/index321.js.map +0 -1
  578. package/dist/index322.js +0 -32
  579. package/dist/index322.js.map +0 -1
  580. package/dist/index323.js +0 -16
  581. package/dist/index323.js.map +0 -1
  582. package/dist/index324.js +0 -10
  583. package/dist/index324.js.map +0 -1
package/dist/index37.js CHANGED
@@ -1,236 +1,225 @@
1
- import { useLayoutEffect as R, useEffect as g, useMemo as l, useRef as o, useCallback as i } from "react";
2
- function Y() {
3
- for (var n = arguments.length, t = new Array(n), e = 0; e < n; e++)
4
- t[e] = arguments[e];
5
- return l(
6
- () => (u) => {
7
- t.forEach((r) => r(u));
8
- },
9
- // eslint-disable-next-line react-hooks/exhaustive-deps
10
- t
11
- );
1
+ import { MAX_DIAL_CODE_LENGTH as W, COMMON_IDD_PREFIXES as $, DEFAULT_COUNTRY as x, COUNTRY_DIAL_CODES as C } from "./index36.js";
2
+ import { getCountryCallingCode as p } from "./index40.js";
3
+ import { AsYouType as I } from "./index78.js";
4
+ import { validatePhoneNumberLength as D } from "./index79.js";
5
+ function g(t) {
6
+ return t.replace(/\D/g, "");
12
7
  }
13
- const D = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
14
- function a(n) {
15
- const t = Object.prototype.toString.call(n);
16
- return t === "[object Window]" || // In Electron context the Window object serializes to [object global]
17
- t === "[object global]";
8
+ function P(t) {
9
+ return t ? t.length > W ? !1 : C.some((e) => e.startsWith(t)) : !0;
18
10
  }
19
- function b(n) {
20
- return "nodeType" in n;
11
+ const N = /[\u061C\u200B-\u200F\u202A-\u202E\u2066-\u2069\uFEFF]/g;
12
+ function T(t) {
13
+ return t.replace(N, "");
21
14
  }
22
- function c(n) {
23
- var t, e;
24
- return n ? a(n) ? n : b(n) && (t = (e = n.ownerDocument) == null ? void 0 : e.defaultView) != null ? t : window : window;
25
- }
26
- function j(n) {
15
+ function q(t, e, s = {}) {
27
16
  const {
28
- Document: t
29
- } = c(n);
30
- return n instanceof t;
31
- }
32
- function C(n) {
33
- return a(n) ? !1 : n instanceof c(n).HTMLElement;
34
- }
35
- function L(n) {
36
- return n instanceof c(n).SVGElement;
37
- }
38
- function x(n) {
39
- return n ? a(n) ? n.document : b(n) ? j(n) ? n : C(n) || L(n) ? n.ownerDocument : document : document : document;
40
- }
41
- const E = D ? R : g;
42
- function M(n) {
43
- const t = o(n);
44
- return E(() => {
45
- t.current = n;
46
- }), i(function() {
47
- for (var e = arguments.length, u = new Array(e), r = 0; r < e; r++)
48
- u[r] = arguments[r];
49
- return t.current == null ? void 0 : t.current(...u);
50
- }, []);
51
- }
52
- function A() {
53
- const n = o(null), t = i((u, r) => {
54
- n.current = setInterval(u, r);
55
- }, []), e = i(() => {
56
- n.current !== null && (clearInterval(n.current), n.current = null);
57
- }, []);
58
- return [t, e];
59
- }
60
- function I(n, t) {
61
- t === void 0 && (t = [n]);
62
- const e = o(n);
63
- return E(() => {
64
- e.current !== n && (e.current = n);
65
- }, t), e;
66
- }
67
- function v(n, t) {
68
- const e = o();
69
- return l(
70
- () => {
71
- const u = n(e.current);
72
- return e.current = u, u;
73
- },
74
- // eslint-disable-next-line react-hooks/exhaustive-deps
75
- [...t]
76
- );
77
- }
78
- function N(n) {
79
- const t = M(n), e = o(null), u = i(
80
- (r) => {
81
- r !== e.current && t?.(r, e.current), e.current = r;
82
- },
83
- //eslint-disable-next-line
84
- []
85
- );
86
- return [e, u];
17
+ force: u = !1
18
+ } = s, o = `+${e}`;
19
+ if (!t.startsWith(o) || !u)
20
+ return t;
21
+ const i = t.slice(o.length).trimStart();
22
+ if (i.startsWith("0"))
23
+ return t;
24
+ if (!i)
25
+ return `${o} 0`;
26
+ const [n, ...r] = i.split(" "), f = `0${n ?? ""}`, l = r.length > 0 ? ` ${r.join(" ")}` : "";
27
+ return `${o} ${f}${l}`.replace(/\s\s+/g, " ").trimEnd();
28
+ }
29
+ const O = {
30
+ GG: "GB",
31
+ JE: "GB",
32
+ IM: "GB"
33
+ };
34
+ function y(t) {
35
+ if (t)
36
+ return O[t] ?? t;
37
+ }
38
+ function _(t, e, s) {
39
+ if (!t || !s || (t.nationalNumber ?? "").length < 4)
40
+ return;
41
+ const o = t.countryCallingCode;
42
+ if (!o)
43
+ return;
44
+ const i = t.getMetadata, n = (typeof i == "function" ? i() : null)?.country_calling_codes?.[o];
45
+ if (!n || n.length === 0)
46
+ return;
47
+ const r = [];
48
+ for (const f of n) {
49
+ const l = y(f);
50
+ l && !r.includes(l) && r.push(l);
51
+ }
52
+ if (r.length !== 0)
53
+ return e && r.includes(e) ? e : r.includes(x) ? x : r[0];
87
54
  }
88
- function F(n) {
89
- const t = o();
90
- return g(() => {
91
- t.current = n;
92
- }, [n]), t.current;
55
+ function B(t, e, s, u) {
56
+ if (!t)
57
+ return !1;
58
+ if (!u)
59
+ return t.startsWith("0");
60
+ if (!s || !t.startsWith(s) || !t.slice(s.length).startsWith("0"))
61
+ return !1;
62
+ const o = t.slice(s.length + 1), i = e.startsWith(s) ? e.slice(s.length) : e;
63
+ return o === i;
93
64
  }
94
- let f = {};
95
- function H(n, t) {
96
- return l(() => {
97
- if (t)
98
- return t;
99
- const e = f[n] == null ? 0 : f[n] + 1;
100
- return f[n] = e, n + "-" + e;
101
- }, [n, t]);
65
+ function S(t) {
66
+ for (const e of $)
67
+ if (t.startsWith(e))
68
+ return t.slice(e.length);
69
+ return t;
102
70
  }
103
- function S(n) {
104
- return function(t) {
105
- for (var e = arguments.length, u = new Array(e > 1 ? e - 1 : 0), r = 1; r < e; r++)
106
- u[r - 1] = arguments[r];
107
- return u.reduce((s, T) => {
108
- const y = Object.entries(T);
109
- for (const [d, p] of y) {
110
- const m = s[d];
111
- m != null && (s[d] = m + n * p);
71
+ function M(t, e, s = {}) {
72
+ const {
73
+ allowJustPlus: u = !1,
74
+ removeNationalPrefix: o = !0,
75
+ previousValue: i
76
+ } = s, n = T(t).trim();
77
+ if (!n)
78
+ return "";
79
+ if (n === "+")
80
+ return u ? "+" : "";
81
+ if (n.startsWith("+")) {
82
+ const a = g(n);
83
+ if (!a)
84
+ return u ? "+" : "";
85
+ const d = S(a);
86
+ if (d !== a)
87
+ return d ? `+${d}` : u ? "+" : "";
88
+ if (o && e) {
89
+ const h = p(e);
90
+ if (a.startsWith(h) && a.slice(h.length).startsWith("0")) {
91
+ const E = a.slice(h.length + 1);
92
+ return E ? `+${h}${E}` : `+${h}`;
112
93
  }
113
- return s;
114
- }, {
115
- ...t
116
- });
94
+ }
95
+ return `+${a}`;
96
+ }
97
+ const r = g(n);
98
+ if (!r)
99
+ return "";
100
+ const f = S(r);
101
+ if (f !== r)
102
+ return f ? `+${f}` : u ? "+" : "";
103
+ const l = typeof i == "string" ? i : "", m = l && l.startsWith("+") ? g(l) : "";
104
+ if (m && m.length > r.length && m.endsWith(r) && m.length - r.length <= W)
105
+ return `+${r}`;
106
+ if (r === "0")
107
+ return "0";
108
+ if (o && e && r.length > 1 && r.startsWith("0") && !r.startsWith("00")) {
109
+ const a = p(e), d = r.slice(1);
110
+ return d ? `+${a}${d}` : `+${a}`;
111
+ }
112
+ return e ? r.length <= 4 ? `+${r}` : `+${p(e)}${r}` : r;
113
+ }
114
+ function Y(t, e) {
115
+ if (t === "+")
116
+ return {
117
+ international: "+",
118
+ national: "",
119
+ formatted: "+",
120
+ phoneNumber: null,
121
+ detectedCountry: void 0,
122
+ inferredCountry: void 0,
123
+ hasExplicitInternationalPrefix: !0
124
+ };
125
+ const s = /^\s*\+/.test(t), u = e ? new I(e) : new I(), o = u.input(t), i = u.getNumber(), c = g(t), n = y(i?.country ?? u.country ?? void 0), r = n ?? !i ? void 0 : y(_(i, e, c)), f = i?.formatInternational() ?? o, l = i?.formatNational() ?? g(f);
126
+ return {
127
+ international: f,
128
+ national: l,
129
+ formatted: o,
130
+ phoneNumber: i,
131
+ detectedCountry: n,
132
+ inferredCountry: r,
133
+ hasExplicitInternationalPrefix: s
117
134
  };
118
135
  }
119
- const W = /* @__PURE__ */ S(1), q = /* @__PURE__ */ S(-1);
120
- function O(n) {
121
- return "clientX" in n && "clientY" in n;
136
+ function v(t, e) {
137
+ return t.startsWith(e) ? t.slice(e.length) : t;
122
138
  }
123
- function z(n) {
124
- if (!n)
125
- return !1;
126
- const {
127
- KeyboardEvent: t
128
- } = c(n.target);
129
- return t && n instanceof t;
139
+ function H(t, e) {
140
+ if (!e || !t)
141
+ return null;
142
+ try {
143
+ return D(t, e) === "TOO_LONG" ? "TOO_LONG" : null;
144
+ } catch {
145
+ return null;
146
+ }
130
147
  }
131
- function V(n) {
132
- if (!n)
133
- return !1;
148
+ function U(t, e, s, u = {}) {
134
149
  const {
135
- TouchEvent: t
136
- } = c(n.target);
137
- return t && n instanceof t;
138
- }
139
- function G(n) {
140
- if (V(n)) {
141
- if (n.touches && n.touches.length) {
142
- const {
143
- clientX: t,
144
- clientY: e
145
- } = n.touches[0];
146
- return {
147
- x: t,
148
- y: e
149
- };
150
- } else if (n.changedTouches && n.changedTouches.length) {
151
- const {
152
- clientX: t,
153
- clientY: e
154
- } = n.changedTouches[0];
150
+ hasRemovedNationalPrefix: o = !1,
151
+ detectedCountry: i,
152
+ hasExplicitInternationalPrefix: c = !1
153
+ } = u;
154
+ if (!t)
155
+ return {
156
+ shouldSuggest: !1,
157
+ query: ""
158
+ };
159
+ if (t === "+")
160
+ return {
161
+ shouldSuggest: !0,
162
+ query: ""
163
+ };
164
+ const n = g(t);
165
+ if (!n)
166
+ return {
167
+ shouldSuggest: !0,
168
+ query: ""
169
+ };
170
+ if (o)
171
+ return {
172
+ shouldSuggest: !1,
173
+ query: ""
174
+ };
175
+ if (c && !i)
176
+ return P(n) ? {
177
+ shouldSuggest: !0,
178
+ query: n
179
+ } : {
180
+ shouldSuggest: !1,
181
+ query: ""
182
+ };
183
+ let r = s?.countryCallingCode ?? null;
184
+ if (!r) {
185
+ if (e) {
186
+ const l = p(e);
187
+ n.startsWith(l) && (r = l);
188
+ } else if (!c)
155
189
  return {
156
- x: t,
157
- y: e
190
+ shouldSuggest: !1,
191
+ query: ""
158
192
  };
159
- }
160
193
  }
161
- return O(n) ? {
162
- x: n.clientX,
163
- y: n.clientY
164
- } : null;
194
+ return r ? v(n, r).length === 0 ? {
195
+ shouldSuggest: !0,
196
+ query: n
197
+ } : {
198
+ shouldSuggest: !1,
199
+ query: ""
200
+ } : {
201
+ shouldSuggest: !0,
202
+ query: n
203
+ };
165
204
  }
166
- const w = /* @__PURE__ */ Object.freeze({
167
- Translate: {
168
- toString(n) {
169
- if (!n)
170
- return;
171
- const {
172
- x: t,
173
- y: e
174
- } = n;
175
- return "translate3d(" + (t ? Math.round(t) : 0) + "px, " + (e ? Math.round(e) : 0) + "px, 0)";
176
- }
177
- },
178
- Scale: {
179
- toString(n) {
180
- if (!n)
181
- return;
182
- const {
183
- scaleX: t,
184
- scaleY: e
185
- } = n;
186
- return "scaleX(" + t + ") scaleY(" + e + ")";
187
- }
188
- },
189
- Transform: {
190
- toString(n) {
191
- if (n)
192
- return [w.Translate.toString(n), w.Scale.toString(n)].join(" ");
193
- }
194
- },
195
- Transition: {
196
- toString(n) {
197
- let {
198
- property: t,
199
- duration: e,
200
- easing: u
201
- } = n;
202
- return t + " " + e + "ms " + u;
203
- }
204
- }
205
- }), h = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
206
- function K(n) {
207
- return n.matches(h) ? n : n.querySelector(h);
205
+ function V(t, e) {
206
+ if (t.shouldSuggest)
207
+ return !1;
208
+ const {
209
+ hasExplicitInternationalPrefix: s = !1,
210
+ detectedCountry: u
211
+ } = e;
212
+ return s ? !!u : !0;
208
213
  }
209
214
  export {
210
- w as CSS,
211
- W as add,
212
- D as canUseDOM,
213
- K as findFirstFocusableNode,
214
- G as getEventCoordinates,
215
- x as getOwnerDocument,
216
- c as getWindow,
217
- O as hasViewportRelativeCoordinates,
218
- j as isDocument,
219
- C as isHTMLElement,
220
- z as isKeyboardEvent,
221
- b as isNode,
222
- L as isSVGElement,
223
- V as isTouchEvent,
224
- a as isWindow,
225
- q as subtract,
226
- Y as useCombinedRefs,
227
- M as useEvent,
228
- A as useInterval,
229
- E as useIsomorphicLayoutEffect,
230
- I as useLatestValue,
231
- v as useLazyMemo,
232
- N as useNodeRef,
233
- F as usePrevious,
234
- H as useUniqueId
215
+ B as detectNationalPrefixForDisplay,
216
+ Y as formatWithAsYouType,
217
+ H as getLengthIssue,
218
+ U as getSuggestionState,
219
+ q as injectNationalPrefixDisplay,
220
+ M as normalizeInputValue,
221
+ g as sanitizeDigits,
222
+ V as shouldDisplayExplicitCountrySelection,
223
+ v as stripPrefix
235
224
  };
236
225
  //# sourceMappingURL=index37.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index37.js","sources":["../../../node_modules/@dnd-kit/utilities/dist/utilities.esm.js"],"sourcesContent":["import { useMemo, useLayoutEffect, useEffect, useRef, useCallback } from 'react';\n\nfunction useCombinedRefs() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return useMemo(() => node => {\n refs.forEach(ref => ref(node));\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n refs);\n}\n\n// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js\nconst canUseDOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';\n\nfunction isWindow(element) {\n const elementString = Object.prototype.toString.call(element);\n return elementString === '[object Window]' || // In Electron context the Window object serializes to [object global]\n elementString === '[object global]';\n}\n\nfunction isNode(node) {\n return 'nodeType' in node;\n}\n\nfunction getWindow(target) {\n var _target$ownerDocument, _target$ownerDocument2;\n\n if (!target) {\n return window;\n }\n\n if (isWindow(target)) {\n return target;\n }\n\n if (!isNode(target)) {\n return window;\n }\n\n return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window;\n}\n\nfunction isDocument(node) {\n const {\n Document\n } = getWindow(node);\n return node instanceof Document;\n}\n\nfunction isHTMLElement(node) {\n if (isWindow(node)) {\n return false;\n }\n\n return node instanceof getWindow(node).HTMLElement;\n}\n\nfunction isSVGElement(node) {\n return node instanceof getWindow(node).SVGElement;\n}\n\nfunction getOwnerDocument(target) {\n if (!target) {\n return document;\n }\n\n if (isWindow(target)) {\n return target.document;\n }\n\n if (!isNode(target)) {\n return document;\n }\n\n if (isDocument(target)) {\n return target;\n }\n\n if (isHTMLElement(target) || isSVGElement(target)) {\n return target.ownerDocument;\n }\n\n return document;\n}\n\n/**\r\n * A hook that resolves to useEffect on the server and useLayoutEffect on the client\r\n * @param callback {function} Callback function that is invoked when the dependencies of the hook change\r\n */\n\nconst useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;\n\nfunction useEvent(handler) {\n const handlerRef = useRef(handler);\n useIsomorphicLayoutEffect(() => {\n handlerRef.current = handler;\n });\n return useCallback(function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return handlerRef.current == null ? void 0 : handlerRef.current(...args);\n }, []);\n}\n\nfunction useInterval() {\n const intervalRef = useRef(null);\n const set = useCallback((listener, duration) => {\n intervalRef.current = setInterval(listener, duration);\n }, []);\n const clear = useCallback(() => {\n if (intervalRef.current !== null) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n }, []);\n return [set, clear];\n}\n\nfunction useLatestValue(value, dependencies) {\n if (dependencies === void 0) {\n dependencies = [value];\n }\n\n const valueRef = useRef(value);\n useIsomorphicLayoutEffect(() => {\n if (valueRef.current !== value) {\n valueRef.current = value;\n }\n }, dependencies);\n return valueRef;\n}\n\nfunction useLazyMemo(callback, dependencies) {\n const valueRef = useRef();\n return useMemo(() => {\n const newValue = callback(valueRef.current);\n valueRef.current = newValue;\n return newValue;\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n [...dependencies]);\n}\n\nfunction useNodeRef(onChange) {\n const onChangeHandler = useEvent(onChange);\n const node = useRef(null);\n const setNodeRef = useCallback(element => {\n if (element !== node.current) {\n onChangeHandler == null ? void 0 : onChangeHandler(element, node.current);\n }\n\n node.current = element;\n }, //eslint-disable-next-line\n []);\n return [node, setNodeRef];\n}\n\nfunction usePrevious(value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n }, [value]);\n return ref.current;\n}\n\nlet ids = {};\nfunction useUniqueId(prefix, value) {\n return useMemo(() => {\n if (value) {\n return value;\n }\n\n const id = ids[prefix] == null ? 0 : ids[prefix] + 1;\n ids[prefix] = id;\n return prefix + \"-\" + id;\n }, [prefix, value]);\n}\n\nfunction createAdjustmentFn(modifier) {\n return function (object) {\n for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n adjustments[_key - 1] = arguments[_key];\n }\n\n return adjustments.reduce((accumulator, adjustment) => {\n const entries = Object.entries(adjustment);\n\n for (const [key, valueAdjustment] of entries) {\n const value = accumulator[key];\n\n if (value != null) {\n accumulator[key] = value + modifier * valueAdjustment;\n }\n }\n\n return accumulator;\n }, { ...object\n });\n };\n}\n\nconst add = /*#__PURE__*/createAdjustmentFn(1);\nconst subtract = /*#__PURE__*/createAdjustmentFn(-1);\n\nfunction hasViewportRelativeCoordinates(event) {\n return 'clientX' in event && 'clientY' in event;\n}\n\nfunction isKeyboardEvent(event) {\n if (!event) {\n return false;\n }\n\n const {\n KeyboardEvent\n } = getWindow(event.target);\n return KeyboardEvent && event instanceof KeyboardEvent;\n}\n\nfunction isTouchEvent(event) {\n if (!event) {\n return false;\n }\n\n const {\n TouchEvent\n } = getWindow(event.target);\n return TouchEvent && event instanceof TouchEvent;\n}\n\n/**\r\n * Returns the normalized x and y coordinates for mouse and touch events.\r\n */\n\nfunction getEventCoordinates(event) {\n if (isTouchEvent(event)) {\n if (event.touches && event.touches.length) {\n const {\n clientX: x,\n clientY: y\n } = event.touches[0];\n return {\n x,\n y\n };\n } else if (event.changedTouches && event.changedTouches.length) {\n const {\n clientX: x,\n clientY: y\n } = event.changedTouches[0];\n return {\n x,\n y\n };\n }\n }\n\n if (hasViewportRelativeCoordinates(event)) {\n return {\n x: event.clientX,\n y: event.clientY\n };\n }\n\n return null;\n}\n\nconst CSS = /*#__PURE__*/Object.freeze({\n Translate: {\n toString(transform) {\n if (!transform) {\n return;\n }\n\n const {\n x,\n y\n } = transform;\n return \"translate3d(\" + (x ? Math.round(x) : 0) + \"px, \" + (y ? Math.round(y) : 0) + \"px, 0)\";\n }\n\n },\n Scale: {\n toString(transform) {\n if (!transform) {\n return;\n }\n\n const {\n scaleX,\n scaleY\n } = transform;\n return \"scaleX(\" + scaleX + \") scaleY(\" + scaleY + \")\";\n }\n\n },\n Transform: {\n toString(transform) {\n if (!transform) {\n return;\n }\n\n return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' ');\n }\n\n },\n Transition: {\n toString(_ref) {\n let {\n property,\n duration,\n easing\n } = _ref;\n return property + \" \" + duration + \"ms \" + easing;\n }\n\n }\n});\n\nconst SELECTOR = 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]';\nfunction findFirstFocusableNode(element) {\n if (element.matches(SELECTOR)) {\n return element;\n }\n\n return element.querySelector(SELECTOR);\n}\n\nexport { CSS, add, canUseDOM, findFirstFocusableNode, getEventCoordinates, getOwnerDocument, getWindow, hasViewportRelativeCoordinates, isDocument, isHTMLElement, isKeyboardEvent, isNode, isSVGElement, isTouchEvent, isWindow, subtract, useCombinedRefs, useEvent, useInterval, useIsomorphicLayoutEffect, useLatestValue, useLazyMemo, useNodeRef, usePrevious, useUniqueId };\n//# sourceMappingURL=utilities.esm.js.map\n"],"names":["useCombinedRefs","_len","refs","_key","useMemo","node","ref","canUseDOM","isWindow","element","elementString","isNode","getWindow","target","_target$ownerDocument","_target$ownerDocument2","isDocument","Document","isHTMLElement","isSVGElement","getOwnerDocument","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","useEvent","handler","handlerRef","useRef","useCallback","args","useInterval","intervalRef","set","listener","duration","clear","useLatestValue","value","dependencies","valueRef","useLazyMemo","callback","newValue","useNodeRef","onChange","onChangeHandler","setNodeRef","usePrevious","ids","useUniqueId","prefix","id","createAdjustmentFn","modifier","object","adjustments","accumulator","adjustment","entries","key","valueAdjustment","add","subtract","hasViewportRelativeCoordinates","event","isKeyboardEvent","KeyboardEvent","isTouchEvent","TouchEvent","getEventCoordinates","x","y","CSS","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;AAAA,EACrC,WAAW;AAAA,IACT,SAASC,GAAW;AAClB,UAAI,CAACA;AACH;AAGF,YAAM;AAAA,QACJ,GAAAH;AAAA,QACA,GAAAC;AAAA,MACR,IAAUE;AACJ,aAAO,kBAAkBH,IAAI,KAAK,MAAMA,CAAC,IAAI,KAAK,UAAUC,IAAI,KAAK,MAAMA,CAAC,IAAI,KAAK;AAAA,IACvF;AAAA,EAEJ;AAAA,EACE,OAAO;AAAA,IACL,SAASE,GAAW;AAClB,UAAI,CAACA;AACH;AAGF,YAAM;AAAA,QACJ,QAAAC;AAAA,QACA,QAAAC;AAAA,MACR,IAAUF;AACJ,aAAO,YAAYC,IAAS,cAAcC,IAAS;AAAA,IACrD;AAAA,EAEJ;AAAA,EACE,WAAW;AAAA,IACT,SAASF,GAAW;AAClB,UAAKA;AAIL,eAAO,CAACD,EAAI,UAAU,SAASC,CAAS,GAAGD,EAAI,MAAM,SAASC,CAAS,CAAC,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EAEJ;AAAA,EACE,YAAY;AAAA,IACV,SAASG,GAAM;AACb,UAAI;AAAA,QACF,UAAAC;AAAA,QACA,UAAA3C;AAAA,QACA,QAAA4C;AAAA,MACR,IAAUF;AACJ,aAAOC,IAAW,MAAM3C,IAAW,QAAQ4C;AAAA,IAC7C;AAAA,EAEJ;AACA,CAAC,GAEKC,IAAW;AACjB,SAASC,EAAuBvE,GAAS;AACvC,SAAIA,EAAQ,QAAQsE,CAAQ,IACnBtE,IAGFA,EAAQ,cAAcsE,CAAQ;AACvC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index37.js","sources":["../src/components/PhoneNumberInput/normalization.ts"],"sourcesContent":["import type { CountryCode } from \"libphonenumber-js\"\nimport { AsYouType, getCountryCallingCode, validatePhoneNumberLength } from \"libphonenumber-js\"\n\nimport {\n COMMON_IDD_PREFIXES,\n COUNTRY_DIAL_CODES,\n DEFAULT_COUNTRY,\n MAX_DIAL_CODE_LENGTH,\n} from \"./country-options\"\n\n\nexport type LengthIssue = \"TOO_LONG\"\n\nexport function sanitizeDigits(value: string) {\n return value.replace(/\\D/g, \"\")\n}\n\nfunction isDialCodeProgress(digits: string) {\n if (!digits) {\n return true\n }\n\n if (digits.length > MAX_DIAL_CODE_LENGTH) {\n return false\n }\n\n return COUNTRY_DIAL_CODES.some((dial) => dial.startsWith(digits))\n}\n\nconst INVISIBLE_FORMATTING_CHARACTERS =\n /[\\u061C\\u200B-\\u200F\\u202A-\\u202E\\u2066-\\u2069\\uFEFF]/g\n\nfunction stripInvisibleFormatting(value: string) {\n return value.replace(INVISIBLE_FORMATTING_CHARACTERS, \"\")\n}\n\nexport function injectNationalPrefixDisplay(\n international: string,\n dialCode: string,\n options: { force?: boolean } = {}\n) {\n // Preserve a user-typed national trunk (e.g. the French \"0\") purely for display\n // so validation can continue to use the canonical E.164 representation internally.\n const { force = false } = options\n const prefix = `+${dialCode}`\n\n if (!international.startsWith(prefix)) {\n return international\n }\n\n if (!force) {\n return international\n }\n\n const remainder = international.slice(prefix.length).trimStart()\n const alreadyHasTrunk = remainder.startsWith(\"0\")\n\n if (alreadyHasTrunk) {\n return international\n }\n\n if (!remainder) {\n return `${prefix} 0`\n }\n\n const [firstGroup, ...restGroups] = remainder.split(\" \")\n const rebuiltFirstGroup = `0${firstGroup ?? \"\"}`\n const rebuiltRemainder = restGroups.length > 0 ? ` ${restGroups.join(\" \")}` : \"\"\n\n return `${prefix} ${rebuiltFirstGroup}${rebuiltRemainder}`.replace(/\\s\\s+/g, \" \").trimEnd()\n}\n\nconst DETECTED_COUNTRY_OVERRIDES: Partial<Record<CountryCode, CountryCode>> = {\n GG: \"GB\",\n JE: \"GB\",\n IM: \"GB\",\n}\n\nfunction canonicalizeDetectedCountry(candidate: CountryCode | undefined): CountryCode | undefined {\n if (!candidate) {\n return undefined\n }\n return DETECTED_COUNTRY_OVERRIDES[candidate] ?? candidate\n}\n\ntype AsYouTypeNumber = ReturnType<AsYouType[\"getNumber\"]>\n\nfunction inferCountryFromDialCode(\n phoneNumber: AsYouTypeNumber,\n baseCountry: CountryCode | undefined,\n normalizedDigits: string\n): CountryCode | undefined {\n if (!phoneNumber) {\n return undefined\n }\n\n if (!normalizedDigits) {\n return undefined\n }\n\n const nationalDigits = phoneNumber.nationalNumber ?? \"\"\n if (nationalDigits.length < 4) {\n return undefined\n }\n\n const dial = phoneNumber.countryCallingCode\n if (!dial) {\n return undefined\n }\n\n const metadataGetter = (phoneNumber as unknown as { getMetadata?: () => unknown }).getMetadata\n const metadata =\n typeof metadataGetter === \"function\"\n ? (metadataGetter() as {\n country_calling_codes?: Record<string, string[]>\n } | null)\n : null\n\n const candidates = metadata?.country_calling_codes?.[dial]\n if (!candidates || candidates.length === 0) {\n return undefined\n }\n\n const canonicalCandidates: CountryCode[] = []\n for (const candidate of candidates) {\n const canonical = canonicalizeDetectedCountry(candidate as CountryCode)\n if (canonical && !canonicalCandidates.includes(canonical)) {\n canonicalCandidates.push(canonical)\n }\n }\n\n if (canonicalCandidates.length === 0) {\n return undefined\n }\n\n if (baseCountry && canonicalCandidates.includes(baseCountry)) {\n return baseCountry\n }\n\n if (canonicalCandidates.includes(DEFAULT_COUNTRY)) {\n return DEFAULT_COUNTRY\n }\n\n return canonicalCandidates[0]\n}\n\nexport function detectNationalPrefixForDisplay(\n rawDigits: string,\n internationalDigits: string,\n dialCode: string,\n hasExplicitInternationalPrefix: boolean\n) {\n if (!rawDigits) {\n return false\n }\n\n if (!hasExplicitInternationalPrefix) {\n return rawDigits.startsWith(\"0\")\n }\n\n if (!dialCode) {\n return false\n }\n\n if (!rawDigits.startsWith(dialCode)) {\n return false\n }\n\n if (!rawDigits.slice(dialCode.length).startsWith(\"0\")) {\n return false\n }\n\n const rawAfterTrunk = rawDigits.slice(dialCode.length + 1)\n const internationalAfterDial = internationalDigits.startsWith(dialCode)\n ? internationalDigits.slice(dialCode.length)\n : internationalDigits\n\n return rawAfterTrunk === internationalAfterDial\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\nexport function normalizeInputValue(\n rawValue: string,\n country: CountryCode | undefined,\n options: {\n allowJustPlus?: boolean\n removeNationalPrefix?: boolean\n previousValue?: string\n } = {}\n) {\n const { allowJustPlus = false, removeNationalPrefix = true, previousValue } = options\n const cleaned = stripInvisibleFormatting(rawValue)\n const trimmed = cleaned.trim()\n\n if (!trimmed) {\n return \"\"\n }\n\n if (trimmed === \"+\") {\n return allowJustPlus ? \"+\" : \"\"\n }\n\n if (trimmed.startsWith(\"+\")) {\n const digits = sanitizeDigits(trimmed)\n if (!digits) {\n return allowJustPlus ? \"+\" : \"\"\n }\n const digitsWithoutIdd = stripIddPrefix(digits)\n if (digitsWithoutIdd !== digits) {\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : allowJustPlus ? \"+\" : \"\"\n }\n if (removeNationalPrefix && country) {\n const dial = getCountryCallingCode(country)\n if (digits.startsWith(dial) && digits.slice(dial.length).startsWith(\"0\")) {\n const withoutPrefix = digits.slice(dial.length + 1)\n return withoutPrefix ? `+${dial}${withoutPrefix}` : `+${dial}`\n }\n }\n return `+${digits}`\n }\n\n const digitsOnly = sanitizeDigits(trimmed)\n if (!digitsOnly) {\n return \"\"\n }\n\n const digitsWithoutIdd = stripIddPrefix(digitsOnly)\n if (digitsWithoutIdd !== digitsOnly) {\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : allowJustPlus ? \"+\" : \"\"\n }\n\n const previousNormalized = typeof previousValue === \"string\" ? previousValue : \"\"\n const previousDigits =\n previousNormalized && previousNormalized.startsWith(\"+\")\n ? sanitizeDigits(previousNormalized)\n : \"\"\n\n if (previousDigits && previousDigits.length > digitsOnly.length) {\n if (previousDigits.endsWith(digitsOnly)) {\n const removedPrefixLength = previousDigits.length - digitsOnly.length\n if (removedPrefixLength <= MAX_DIAL_CODE_LENGTH) {\n return `+${digitsOnly}`\n }\n }\n }\n\n if (digitsOnly === \"0\") {\n return \"0\"\n }\n\n if (\n removeNationalPrefix &&\n country &&\n digitsOnly.length > 1 &&\n digitsOnly.startsWith(\"0\") &&\n !digitsOnly.startsWith(\"00\")\n ) {\n const dial = getCountryCallingCode(country)\n const withoutPrefix = digitsOnly.slice(1)\n return withoutPrefix ? `+${dial}${withoutPrefix}` : `+${dial}`\n }\n\n if (!country) {\n return digitsOnly\n }\n\n if (digitsOnly.length <= 4) {\n return `+${digitsOnly}`\n }\n\n const dial = getCountryCallingCode(country)\n return `+${dial}${digitsOnly}`\n}\n\nexport function formatWithAsYouType(value: string, baseCountry?: CountryCode) {\n if (value === \"+\") {\n return {\n international: \"+\",\n national: \"\",\n formatted: \"+\",\n phoneNumber: null,\n detectedCountry: undefined,\n inferredCountry: undefined,\n hasExplicitInternationalPrefix: true,\n }\n }\n\n const hasExplicitInternationalPrefix = /^\\s*\\+/.test(value)\n const formatter = baseCountry ? new AsYouType(baseCountry) : new AsYouType()\n const formatted = formatter.input(value)\n const phoneNumber = formatter.getNumber()\n const digits = sanitizeDigits(value)\n const detectedCountry = canonicalizeDetectedCountry(\n (phoneNumber?.country ?? formatter.country ?? undefined) as CountryCode | undefined\n )\n const inferredCountry =\n detectedCountry ?? !phoneNumber\n ? undefined\n : canonicalizeDetectedCountry(\n inferCountryFromDialCode(phoneNumber, baseCountry, digits)\n )\n\n const international = phoneNumber?.formatInternational() ?? formatted\n const national = phoneNumber?.formatNational() ?? sanitizeDigits(international)\n\n return {\n international,\n national,\n formatted,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n }\n}\n\nexport function stripPrefix(value: string, prefix: string) {\n return value.startsWith(prefix) ? value.slice(prefix.length) : value\n}\n\nexport function getLengthIssue(value: string, country: CountryCode | undefined): LengthIssue | null {\n if (!country || !value) {\n return null\n }\n\n try {\n const result = validatePhoneNumberLength(value, country)\n return result === \"TOO_LONG\" ? \"TOO_LONG\" : null\n } catch {\n return null\n }\n}\n\ntype SuggestionState = {\n shouldSuggest: boolean\n query: string\n}\n\nexport function getSuggestionState(\n normalized: string,\n baseCountry: CountryCode | undefined,\n phoneNumber: ReturnType<AsYouType[\"getNumber\"]>,\n options: {\n hasRemovedNationalPrefix?: boolean\n detectedCountry?: CountryCode\n hasExplicitInternationalPrefix?: boolean\n } = {}\n): SuggestionState {\n const {\n hasRemovedNationalPrefix = false,\n detectedCountry,\n hasExplicitInternationalPrefix = false,\n } = options\n\n if (!normalized) {\n return { shouldSuggest: false, query: \"\" }\n }\n\n if (normalized === \"+\") {\n return { shouldSuggest: true, query: \"\" }\n }\n\n const digits = sanitizeDigits(normalized)\n if (!digits) {\n return { shouldSuggest: true, query: \"\" }\n }\n\n if (hasRemovedNationalPrefix) {\n return { shouldSuggest: false, query: \"\" }\n }\n\n if (hasExplicitInternationalPrefix && !detectedCountry) {\n if (!isDialCodeProgress(digits)) {\n return { shouldSuggest: false, query: \"\" }\n }\n return { shouldSuggest: true, query: digits }\n }\n\n let dial = phoneNumber?.countryCallingCode ?? null\n if (!dial) {\n if (baseCountry) {\n const baseDial = getCountryCallingCode(baseCountry)\n if (digits.startsWith(baseDial)) {\n dial = baseDial\n }\n } else if (!hasExplicitInternationalPrefix) {\n return { shouldSuggest: false, query: \"\" }\n }\n }\n\n if (!dial) {\n return { shouldSuggest: true, query: digits }\n }\n\n const nationalDigits = stripPrefix(digits, dial)\n if (nationalDigits.length === 0) {\n return { shouldSuggest: true, query: digits }\n }\n\n return { shouldSuggest: false, query: \"\" }\n}\n\nexport function shouldDisplayExplicitCountrySelection(\n suggestion: SuggestionState,\n options: { detectedCountry?: CountryCode; hasExplicitInternationalPrefix?: boolean }\n) {\n if (suggestion.shouldSuggest) {\n return false\n }\n\n const { hasExplicitInternationalPrefix = false, detectedCountry } = options\n\n if (!hasExplicitInternationalPrefix) {\n return true\n }\n\n return Boolean(detectedCountry)\n}\n"],"names":["sanitizeDigits","value","replace","isDialCodeProgress","digits","length","MAX_DIAL_CODE_LENGTH","COUNTRY_DIAL_CODES","some","dial","startsWith","INVISIBLE_FORMATTING_CHARACTERS","stripInvisibleFormatting","injectNationalPrefixDisplay","international","dialCode","options","force","prefix","remainder","slice","trimStart","firstGroup","restGroups","split","rebuiltFirstGroup","rebuiltRemainder","join","trimEnd","DETECTED_COUNTRY_OVERRIDES","GG","JE","IM","canonicalizeDetectedCountry","candidate","inferCountryFromDialCode","phoneNumber","baseCountry","normalizedDigits","nationalNumber","countryCallingCode","metadataGetter","getMetadata","candidates","country_calling_codes","canonicalCandidates","canonical","includes","push","DEFAULT_COUNTRY","detectNationalPrefixForDisplay","rawDigits","internationalDigits","hasExplicitInternationalPrefix","rawAfterTrunk","internationalAfterDial","stripIddPrefix","COMMON_IDD_PREFIXES","normalizeInputValue","rawValue","country","allowJustPlus","removeNationalPrefix","previousValue","trimmed","trim","digitsWithoutIdd","getCountryCallingCode","withoutPrefix","digitsOnly","previousNormalized","previousDigits","endsWith","formatWithAsYouType","national","formatted","detectedCountry","undefined","inferredCountry","test","formatter","AsYouType","input","getNumber","formatInternational","formatNational","stripPrefix","getLengthIssue","validatePhoneNumberLength","getSuggestionState","normalized","hasRemovedNationalPrefix","shouldSuggest","query","baseDial","shouldDisplayExplicitCountrySelection","suggestion","Boolean"],"mappings":";;;;AAaO,SAASA,EAAeC,GAAe;AAC5C,SAAOA,EAAMC,QAAQ,OAAO,EAAE;AAChC;AAEA,SAASC,EAAmBC,GAAgB;AAC1C,SAAKA,IAIDA,EAAOC,SAASC,IACX,KAGFC,EAAmBC,KAAMC,CAAAA,MAASA,EAAKC,WAAWN,CAAM,CAAC,IAPvD;AAQX;AAEA,MAAMO,IACJ;AAEF,SAASC,EAAyBX,GAAe;AAC/C,SAAOA,EAAMC,QAAQS,GAAiC,EAAE;AAC1D;AAEO,SAASE,EACdC,GACAC,GACAC,IAA+B,CAAA,GAC/B;AAGA,QAAM;AAAA,IAAEC,OAAAA,IAAQ;AAAA,EAAA,IAAUD,GACp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;AAAAA,EAAAA,IAAoB5D;AAEpE,SAAKqC,IAIE4C,EAAQrB,IAHN;AAIX;"}
package/dist/index38.js CHANGED
@@ -1,25 +1,94 @@
1
- const n = {
2
- en: {
3
- lengthTooLong: (e) => e ? `This number looks too long for ${e}.` : "This number looks too long.",
4
- noMatches: "No matching countries",
5
- selectCountryLabel: "Select a country",
6
- selectedCountryLabel: (e) => e ? `${e} flag` : "Selected country"
7
- },
8
- fr: {
9
- lengthTooLong: (e) => e ? `This number looks too long for ${e}.` : "This number looks too long.",
10
- noMatches: "Aucun pays correspondant",
11
- selectCountryLabel: "Select a country",
12
- selectedCountryLabel: (e) => e ? `${e} flag` : "Selected country"
1
+ function c(t) {
2
+ if (!t)
3
+ return !1;
4
+ const e = t.charCodeAt(0);
5
+ return e >= 48 && e <= 57;
6
+ }
7
+ function l(t, e) {
8
+ let n = 0;
9
+ const r = Math.min(e, t.length);
10
+ for (let i = 0; i < r; i += 1)
11
+ c(t[i] ?? "") && (n += 1);
12
+ return n;
13
+ }
14
+ function a(t, e) {
15
+ if (e <= 0)
16
+ return t.startsWith("+") ? Math.min(1, t.length) : 0;
17
+ let n = 0;
18
+ for (let r = 0; r < t.length; r += 1)
19
+ if (c(t[r] ?? "") && (n += 1, n === e))
20
+ return r + 1;
21
+ return t.length;
22
+ }
23
+ function g(t) {
24
+ return !t || c(t) ? !1 : t !== "+";
25
+ }
26
+ function h(t, e) {
27
+ let n = e;
28
+ for (; n > 0; ) {
29
+ const r = t[n - 1] ?? "";
30
+ if (!g(r))
31
+ break;
32
+ n -= 1;
13
33
  }
14
- };
15
- function a(e, s) {
16
- const t = (Array.isArray(e) ? e : e ? [e] : []).map((o) => o.split("-")[0]?.toLowerCase()).find((o) => o && n[o]);
34
+ return n;
35
+ }
36
+ function S(t, e) {
37
+ let n = e;
38
+ for (; n < t.length; ) {
39
+ const r = t[n] ?? "";
40
+ if (!g(r))
41
+ break;
42
+ n += 1;
43
+ }
44
+ return n;
45
+ }
46
+ function m(t) {
47
+ const {
48
+ value: e
49
+ } = t, n = t.selectionStart ?? e.length, r = t.selectionEnd ?? n, i = n <= 1 && e.startsWith("+"), o = r <= 1 && e.startsWith("+");
17
50
  return {
18
- ...n[t ?? "en"] ?? n.en,
19
- ...s ?? {}
51
+ selectionStart: n,
52
+ selectionEnd: r,
53
+ startDigits: l(e, n),
54
+ endDigits: l(e, r),
55
+ preserveStartIndex: i,
56
+ preserveEndIndex: o,
57
+ wasAtStart: n === 0,
58
+ wasAtEnd: r === e.length
59
+ };
60
+ }
61
+ function u(t, e) {
62
+ if (t.selectionStart === t.selectionEnd) {
63
+ if (t.wasAtEnd) {
64
+ const f = e.length;
65
+ return {
66
+ start: f,
67
+ end: f
68
+ };
69
+ }
70
+ if (t.wasAtStart)
71
+ return {
72
+ start: 0,
73
+ end: 0
74
+ };
75
+ }
76
+ const n = t.preserveStartIndex ? Math.min(t.selectionStart, e.length) : a(e, t.startDigits), r = t.preserveEndIndex ? Math.min(t.selectionEnd, e.length) : a(e, t.endDigits);
77
+ let i = n, o = r;
78
+ t.wasAtStart && (i = 0), t.wasAtEnd && (o = e.length), t.selectionStart === t.selectionEnd && (i = o);
79
+ const d = Math.min(Math.max(i, 0), e.length), s = Math.min(Math.max(o, 0), e.length);
80
+ return d > s ? {
81
+ start: s,
82
+ end: s
83
+ } : {
84
+ start: d,
85
+ end: s
20
86
  };
21
87
  }
22
88
  export {
23
- a as resolveMessages
89
+ m as captureSelectionSnapshot,
90
+ u as resolveSelection,
91
+ h as skipFormattingCharactersLeft,
92
+ S as skipFormattingCharactersRight
24
93
  };
25
94
  //# sourceMappingURL=index38.js.map