@rpcbase/ui 0.164.0 → 0.166.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 (690) hide show
  1. package/dist/index10.js +1 -1
  2. package/dist/index100.js +9 -24
  3. package/dist/index100.js.map +1 -1
  4. package/dist/index101.js +42 -6
  5. package/dist/index101.js.map +1 -1
  6. package/dist/index102.js +4 -4
  7. package/dist/index102.js.map +1 -1
  8. package/dist/index103.js +52 -7
  9. package/dist/index103.js.map +1 -1
  10. package/dist/index104.js +4 -5
  11. package/dist/index104.js.map +1 -1
  12. package/dist/index105.js +3 -3
  13. package/dist/index105.js.map +1 -1
  14. package/dist/index106.js +15 -5
  15. package/dist/index106.js.map +1 -1
  16. package/dist/index107.js +5 -4
  17. package/dist/index107.js.map +1 -1
  18. package/dist/index108.js +6 -7
  19. package/dist/index108.js.map +1 -1
  20. package/dist/index109.js +16 -5
  21. package/dist/index109.js.map +1 -1
  22. package/dist/index11.js +6 -15
  23. package/dist/index11.js.map +1 -1
  24. package/dist/index110.js +3 -3
  25. package/dist/index110.js.map +1 -1
  26. package/dist/index111.js +2 -2
  27. package/dist/index111.js.map +1 -1
  28. package/dist/index112.js +5 -6
  29. package/dist/index112.js.map +1 -1
  30. package/dist/index113.js +5 -145
  31. package/dist/index113.js.map +1 -1
  32. package/dist/index114.js +4 -39
  33. package/dist/index114.js.map +1 -1
  34. package/dist/index115.js +4 -4
  35. package/dist/index115.js.map +1 -1
  36. package/dist/index116.js +6 -7
  37. package/dist/index116.js.map +1 -1
  38. package/dist/index117.js +24 -13
  39. package/dist/index117.js.map +1 -1
  40. package/dist/index118.js +6 -13
  41. package/dist/index118.js.map +1 -1
  42. package/dist/index119.js +4 -7
  43. package/dist/index119.js.map +1 -1
  44. package/dist/index12.js +1 -1
  45. package/dist/index120.js +6 -31
  46. package/dist/index120.js.map +1 -1
  47. package/dist/index121.js +5 -10
  48. package/dist/index121.js.map +1 -1
  49. package/dist/index122.js +4 -10
  50. package/dist/index122.js.map +1 -1
  51. package/dist/index123.js +5 -8
  52. package/dist/index123.js.map +1 -1
  53. package/dist/index124.js +4 -13
  54. package/dist/index124.js.map +1 -1
  55. package/dist/index125.js +8 -101
  56. package/dist/index125.js.map +1 -1
  57. package/dist/index126.js +6 -20
  58. package/dist/index126.js.map +1 -1
  59. package/dist/index127.js +4 -53
  60. package/dist/index127.js.map +1 -1
  61. package/dist/index128.js +4 -72
  62. package/dist/index128.js.map +1 -1
  63. package/dist/index129.js +6 -9
  64. package/dist/index129.js.map +1 -1
  65. package/dist/index13.js +2 -2
  66. package/dist/index130.js +145 -20
  67. package/dist/index130.js.map +1 -1
  68. package/dist/index131.js +38 -15
  69. package/dist/index131.js.map +1 -1
  70. package/dist/index132.js +4 -23
  71. package/dist/index132.js.map +1 -1
  72. package/dist/index133.js +7 -6
  73. package/dist/index133.js.map +1 -1
  74. package/dist/index134.js +13 -5
  75. package/dist/index134.js.map +1 -1
  76. package/dist/index135.js +13 -23
  77. package/dist/index135.js.map +1 -1
  78. package/dist/index136.js +8 -35
  79. package/dist/index136.js.map +1 -1
  80. package/dist/index137.js +32 -16
  81. package/dist/index137.js.map +1 -1
  82. package/dist/index138.js +10 -6
  83. package/dist/index138.js.map +1 -1
  84. package/dist/index139.js +10 -4
  85. package/dist/index139.js.map +1 -1
  86. package/dist/index14.js +4 -4
  87. package/dist/index140.js +8 -4
  88. package/dist/index140.js.map +1 -1
  89. package/dist/index141.js +13 -4
  90. package/dist/index141.js.map +1 -1
  91. package/dist/index142.js +101 -4
  92. package/dist/index142.js.map +1 -1
  93. package/dist/index143.js +20 -4
  94. package/dist/index143.js.map +1 -1
  95. package/dist/index144.js +53 -6
  96. package/dist/index144.js.map +1 -1
  97. package/dist/index145.js +73 -24
  98. package/dist/index145.js.map +1 -1
  99. package/dist/index146.js +9 -7
  100. package/dist/index146.js.map +1 -1
  101. package/dist/index147.js +20 -6
  102. package/dist/index147.js.map +1 -1
  103. package/dist/index148.js +16 -5
  104. package/dist/index148.js.map +1 -1
  105. package/dist/index149.js +23 -3
  106. package/dist/index149.js.map +1 -1
  107. package/dist/index15.js +1 -1
  108. package/dist/index150.js +6 -3
  109. package/dist/index150.js.map +1 -1
  110. package/dist/index151.js +5 -4
  111. package/dist/index151.js.map +1 -1
  112. package/dist/index152.js +23 -3
  113. package/dist/index152.js.map +1 -1
  114. package/dist/index153.js +35 -5
  115. package/dist/index153.js.map +1 -1
  116. package/dist/index154.js +16 -4
  117. package/dist/index154.js.map +1 -1
  118. package/dist/index155.js +6 -3
  119. package/dist/index155.js.map +1 -1
  120. package/dist/index156.js +4 -3
  121. package/dist/index156.js.map +1 -1
  122. package/dist/index157.js +4 -3
  123. package/dist/index157.js.map +1 -1
  124. package/dist/index158.js +4 -33
  125. package/dist/index158.js.map +1 -1
  126. package/dist/index159.js +4 -249
  127. package/dist/index159.js.map +1 -1
  128. package/dist/index16.js +1 -1
  129. package/dist/index160.js +3 -114
  130. package/dist/index160.js.map +1 -1
  131. package/dist/index161.js +6 -219
  132. package/dist/index161.js.map +1 -1
  133. package/dist/index162.js +24 -67
  134. package/dist/index162.js.map +1 -1
  135. package/dist/index163.js +7 -20
  136. package/dist/index163.js.map +1 -1
  137. package/dist/index164.js +6 -209
  138. package/dist/index164.js.map +1 -1
  139. package/dist/index165.js +5 -319
  140. package/dist/index165.js.map +1 -1
  141. package/dist/index166.js +3 -130
  142. package/dist/index166.js.map +1 -1
  143. package/dist/index167.js +3 -20
  144. package/dist/index167.js.map +1 -1
  145. package/dist/index168.js +4 -75
  146. package/dist/index168.js.map +1 -1
  147. package/dist/index169.js +3 -18
  148. package/dist/index169.js.map +1 -1
  149. package/dist/index17.js +1 -1
  150. package/dist/index170.js +4 -101
  151. package/dist/index170.js.map +1 -1
  152. package/dist/index171.js +4 -5
  153. package/dist/index171.js.map +1 -1
  154. package/dist/index172.js +3 -14
  155. package/dist/index172.js.map +1 -1
  156. package/dist/index173.js +4 -2
  157. package/dist/index173.js.map +1 -1
  158. package/dist/index174.js +24 -7
  159. package/dist/index174.js.map +1 -1
  160. package/dist/index175.js +29 -327
  161. package/dist/index175.js.map +1 -1
  162. package/dist/index176.js +5 -50
  163. package/dist/index176.js.map +1 -1
  164. package/dist/index177.js +62 -41
  165. package/dist/index177.js.map +1 -1
  166. package/dist/index178.js +176 -42
  167. package/dist/index178.js.map +1 -1
  168. package/dist/index179.js +41 -200
  169. package/dist/index179.js.map +1 -1
  170. package/dist/index18.js +3 -12
  171. package/dist/index18.js.map +1 -1
  172. package/dist/index180.js +14 -22
  173. package/dist/index180.js.map +1 -1
  174. package/dist/index181.js +153 -23
  175. package/dist/index181.js.map +1 -1
  176. package/dist/index182.js +27 -396
  177. package/dist/index182.js.map +1 -1
  178. package/dist/index183.js +9 -3
  179. package/dist/index183.js.map +1 -1
  180. package/dist/index184.js +47 -5
  181. package/dist/index184.js.map +1 -1
  182. package/dist/index185.js +10 -67
  183. package/dist/index185.js.map +1 -1
  184. package/dist/index186.js +45 -2
  185. package/dist/index186.js.map +1 -1
  186. package/dist/index187.js +86 -354
  187. package/dist/index187.js.map +1 -1
  188. package/dist/index188.js +75 -250
  189. package/dist/index188.js.map +1 -1
  190. package/dist/index189.js +92 -47
  191. package/dist/index189.js.map +1 -1
  192. package/dist/index19.js +7 -7
  193. package/dist/index190.js +46 -40
  194. package/dist/index190.js.map +1 -1
  195. package/dist/index191.js +10 -168
  196. package/dist/index191.js.map +1 -1
  197. package/dist/index192.js +26 -98
  198. package/dist/index192.js.map +1 -1
  199. package/dist/index193.js +8 -24
  200. package/dist/index193.js.map +1 -1
  201. package/dist/index194.js +117 -8
  202. package/dist/index194.js.map +1 -1
  203. package/dist/index195.js +17 -4
  204. package/dist/index195.js.map +1 -1
  205. package/dist/index196.js +15 -5
  206. package/dist/index196.js.map +1 -1
  207. package/dist/index197.js +3 -4
  208. package/dist/index197.js.map +1 -1
  209. package/dist/index198.js +34 -464
  210. package/dist/index198.js.map +1 -1
  211. package/dist/index199.js +19 -184
  212. package/dist/index199.js.map +1 -1
  213. package/dist/index20.js +2 -2
  214. package/dist/index200.js +9 -107
  215. package/dist/index200.js.map +1 -1
  216. package/dist/index201.js +8 -262
  217. package/dist/index201.js.map +1 -1
  218. package/dist/index202.js +19 -9
  219. package/dist/index202.js.map +1 -1
  220. package/dist/index203.js +27 -41
  221. package/dist/index203.js.map +1 -1
  222. package/dist/index204.js +16 -4
  223. package/dist/index204.js.map +1 -1
  224. package/dist/index205.js +59 -2
  225. package/dist/index205.js.map +1 -1
  226. package/dist/index206.js +8 -67
  227. package/dist/index206.js.map +1 -1
  228. package/dist/index207.js +66 -84
  229. package/dist/index207.js.map +1 -1
  230. package/dist/index208.js +18 -45
  231. package/dist/index208.js.map +1 -1
  232. package/dist/index209.js +16 -7
  233. package/dist/index209.js.map +1 -1
  234. package/dist/index21.js +1 -1
  235. package/dist/index210.js +5 -4
  236. package/dist/index210.js.map +1 -1
  237. package/dist/index211.js +4 -50
  238. package/dist/index211.js.map +1 -1
  239. package/dist/index212.js +6 -67
  240. package/dist/index212.js.map +1 -1
  241. package/dist/index213.js +4 -180
  242. package/dist/index213.js.map +1 -1
  243. package/dist/index214.js +7 -46
  244. package/dist/index214.js.map +1 -1
  245. package/dist/index215.js +17 -58
  246. package/dist/index215.js.map +1 -1
  247. package/dist/index216.js +5 -8
  248. package/dist/index216.js.map +1 -1
  249. package/dist/index217.js +5 -66
  250. package/dist/index217.js.map +1 -1
  251. package/dist/index218.js +13 -19
  252. package/dist/index218.js.map +1 -1
  253. package/dist/index219.js +10 -16
  254. package/dist/index219.js.map +1 -1
  255. package/dist/index22.js +1 -1
  256. package/dist/index220.js +14 -5
  257. package/dist/index220.js.map +1 -1
  258. package/dist/index221.js +14 -5
  259. package/dist/index221.js.map +1 -1
  260. package/dist/index222.js +5 -6
  261. package/dist/index222.js.map +1 -1
  262. package/dist/index223.js +6 -4
  263. package/dist/index223.js.map +1 -1
  264. package/dist/index224.js +7 -7
  265. package/dist/index224.js.map +1 -1
  266. package/dist/index225.js +6 -17
  267. package/dist/index225.js.map +1 -1
  268. package/dist/index226.js +9 -5
  269. package/dist/index226.js.map +1 -1
  270. package/dist/index227.js +5 -5
  271. package/dist/index227.js.map +1 -1
  272. package/dist/index228.js +5 -13
  273. package/dist/index228.js.map +1 -1
  274. package/dist/index229.js +9 -10
  275. package/dist/index229.js.map +1 -1
  276. package/dist/index23.js +2 -2
  277. package/dist/index230.js +5 -14
  278. package/dist/index230.js.map +1 -1
  279. package/dist/index231.js +4 -13
  280. package/dist/index231.js.map +1 -1
  281. package/dist/index232.js +4 -5
  282. package/dist/index232.js.map +1 -1
  283. package/dist/index233.js +10 -5
  284. package/dist/index233.js.map +1 -1
  285. package/dist/index234.js +10 -7
  286. package/dist/index234.js.map +1 -1
  287. package/dist/index235.js +10 -6
  288. package/dist/index235.js.map +1 -1
  289. package/dist/index236.js +11 -9
  290. package/dist/index236.js.map +1 -1
  291. package/dist/index237.js +11 -5
  292. package/dist/index237.js.map +1 -1
  293. package/dist/index238.js +10 -5
  294. package/dist/index238.js.map +1 -1
  295. package/dist/index239.js +7 -9
  296. package/dist/index239.js.map +1 -1
  297. package/dist/index24.js +1 -1
  298. package/dist/index240.js +6 -5
  299. package/dist/index240.js.map +1 -1
  300. package/dist/index241.js +4 -4
  301. package/dist/index241.js.map +1 -1
  302. package/dist/index242.js +6 -4
  303. package/dist/index242.js.map +1 -1
  304. package/dist/index243.js +7 -11
  305. package/dist/index243.js.map +1 -1
  306. package/dist/index244.js +6 -10
  307. package/dist/index244.js.map +1 -1
  308. package/dist/index245.js +55 -10
  309. package/dist/index245.js.map +1 -1
  310. package/dist/index246.js +23 -11
  311. package/dist/index246.js.map +1 -1
  312. package/dist/index247.js +16 -11
  313. package/dist/index247.js.map +1 -1
  314. package/dist/index248.js +7 -10
  315. package/dist/index248.js.map +1 -1
  316. package/dist/index249.js +10 -7
  317. package/dist/index249.js.map +1 -1
  318. package/dist/index250.js +10 -6
  319. package/dist/index250.js.map +1 -1
  320. package/dist/index251.js +21 -5
  321. package/dist/index251.js.map +1 -1
  322. package/dist/index252.js +10 -6
  323. package/dist/index252.js.map +1 -1
  324. package/dist/index253.js +9 -7
  325. package/dist/index253.js.map +1 -1
  326. package/dist/index254.js +9 -6
  327. package/dist/index254.js.map +1 -1
  328. package/dist/index255.js +4 -55
  329. package/dist/index255.js.map +1 -1
  330. package/dist/index256.js +5 -23
  331. package/dist/index256.js.map +1 -1
  332. package/dist/index257.js +15 -15
  333. package/dist/index257.js.map +1 -1
  334. package/dist/index258.js +9 -7
  335. package/dist/index258.js.map +1 -1
  336. package/dist/index259.js +18 -10
  337. package/dist/index259.js.map +1 -1
  338. package/dist/index260.js +15 -10
  339. package/dist/index260.js.map +1 -1
  340. package/dist/index261.js +12 -21
  341. package/dist/index261.js.map +1 -1
  342. package/dist/index262.js +29 -10
  343. package/dist/index262.js.map +1 -1
  344. package/dist/index263.js +12 -9
  345. package/dist/index263.js.map +1 -1
  346. package/dist/index264.js +25 -9
  347. package/dist/index264.js.map +1 -1
  348. package/dist/index265.js +5 -4
  349. package/dist/index265.js.map +1 -1
  350. package/dist/index266.js +5 -6
  351. package/dist/index266.js.map +1 -1
  352. package/dist/index267.js +3 -17
  353. package/dist/index267.js.map +1 -1
  354. package/dist/index268.js +23 -9
  355. package/dist/index268.js.map +1 -1
  356. package/dist/index269.js +112 -18
  357. package/dist/index269.js.map +1 -1
  358. package/dist/index27.js +37 -3
  359. package/dist/index27.js.map +1 -1
  360. package/dist/index270.js +15 -15
  361. package/dist/index270.js.map +1 -1
  362. package/dist/index271.js +522 -10
  363. package/dist/index271.js.map +1 -1
  364. package/dist/index272.js +126 -28
  365. package/dist/index272.js.map +1 -1
  366. package/dist/index273.js +132 -11
  367. package/dist/index273.js.map +1 -1
  368. package/dist/index274.js +20 -25
  369. package/dist/index274.js.map +1 -1
  370. package/dist/index275.js +4 -5
  371. package/dist/index275.js.map +1 -1
  372. package/dist/index276.js +18 -64
  373. package/dist/index276.js.map +1 -1
  374. package/dist/index277.js +12 -48
  375. package/dist/index277.js.map +1 -1
  376. package/dist/index278.js +62 -33
  377. package/dist/index278.js.map +1 -1
  378. package/dist/index279.js +9 -101
  379. package/dist/index279.js.map +1 -1
  380. package/dist/index28.js +3 -125
  381. package/dist/index28.js.map +1 -1
  382. package/dist/index280.js +11 -95
  383. package/dist/index280.js.map +1 -1
  384. package/dist/index281.js +65 -99
  385. package/dist/index281.js.map +1 -1
  386. package/dist/index282.js +62 -22
  387. package/dist/index282.js.map +1 -1
  388. package/dist/index283.js +6 -29
  389. package/dist/index283.js.map +1 -1
  390. package/dist/index284.js +6 -5
  391. package/dist/index284.js.map +1 -1
  392. package/dist/index285.js +4 -2
  393. package/dist/index285.js.map +1 -1
  394. package/dist/index286.js +16 -2
  395. package/dist/index286.js.map +1 -1
  396. package/dist/index287.js +8 -13
  397. package/dist/index287.js.map +1 -1
  398. package/dist/index288.js +5 -154
  399. package/dist/index288.js.map +1 -1
  400. package/dist/index289.js +4 -30
  401. package/dist/index289.js.map +1 -1
  402. package/dist/index29.js +124 -47
  403. package/dist/index29.js.map +1 -1
  404. package/dist/index290.js +545 -9
  405. package/dist/index290.js.map +1 -1
  406. package/dist/index291.js +44 -45
  407. package/dist/index291.js.map +1 -1
  408. package/dist/index292.js +16 -10
  409. package/dist/index292.js.map +1 -1
  410. package/dist/index293.js +6 -44
  411. package/dist/index293.js.map +1 -1
  412. package/dist/index294.js +8 -95
  413. package/dist/index294.js.map +1 -1
  414. package/dist/index295.js +7 -86
  415. package/dist/index295.js.map +1 -1
  416. package/dist/index296.js +8 -105
  417. package/dist/index296.js.map +1 -1
  418. package/dist/index297.js +12 -52
  419. package/dist/index297.js.map +1 -1
  420. package/dist/index298.js +9 -11
  421. package/dist/index298.js.map +1 -1
  422. package/dist/index299.js +13 -37
  423. package/dist/index299.js.map +1 -1
  424. package/dist/index30.js +230 -218
  425. package/dist/index30.js.map +1 -1
  426. package/dist/index300.js +3 -8
  427. package/dist/index300.js.map +1 -1
  428. package/dist/index301.js +20 -114
  429. package/dist/index301.js.map +1 -1
  430. package/dist/index302.js +4 -17
  431. package/dist/index302.js.map +1 -1
  432. package/dist/index303.js +55 -15
  433. package/dist/index303.js.map +1 -1
  434. package/dist/index304.js +68 -4
  435. package/dist/index304.js.map +1 -1
  436. package/dist/index305.js +31 -37
  437. package/dist/index305.js.map +1 -1
  438. package/dist/index306.js +9 -21
  439. package/dist/index306.js.map +1 -1
  440. package/dist/index307.js +153 -10
  441. package/dist/index307.js.map +1 -1
  442. package/dist/index308.js +107 -8
  443. package/dist/index308.js.map +1 -1
  444. package/dist/index309.js +21 -18
  445. package/dist/index309.js.map +1 -1
  446. package/dist/index31.js +49 -42
  447. package/dist/index31.js.map +1 -1
  448. package/dist/index310.js +11 -27
  449. package/dist/index310.js.map +1 -1
  450. package/dist/index311.js +27 -16
  451. package/dist/index311.js.map +1 -1
  452. package/dist/index312.js +5 -5
  453. package/dist/index312.js.map +1 -1
  454. package/dist/index313.js +16 -19
  455. package/dist/index313.js.map +1 -1
  456. package/dist/index314.js +28 -12
  457. package/dist/index314.js.map +1 -1
  458. package/dist/index315.js +13 -5
  459. package/dist/index315.js.map +1 -1
  460. package/dist/index316.js +7 -3
  461. package/dist/index316.js.map +1 -1
  462. package/dist/index32.js +2638 -38
  463. package/dist/index32.js.map +1 -1
  464. package/dist/index33.js +390 -25
  465. package/dist/index33.js.map +1 -1
  466. package/dist/index34.js +230 -43
  467. package/dist/index34.js.map +1 -1
  468. package/dist/index35.js +20 -30
  469. package/dist/index35.js.map +1 -1
  470. package/dist/index36.js +137 -23
  471. package/dist/index36.js.map +1 -1
  472. package/dist/index37.js +187 -23
  473. package/dist/index37.js.map +1 -1
  474. package/dist/index38.js +75 -127
  475. package/dist/index38.js.map +1 -1
  476. package/dist/index39.js +87 -228
  477. package/dist/index39.js.map +1 -1
  478. package/dist/index40.js +6 -51
  479. package/dist/index40.js.map +1 -1
  480. package/dist/index41.js +804 -2601
  481. package/dist/index41.js.map +1 -1
  482. package/dist/index42.js +63 -391
  483. package/dist/index42.js.map +1 -1
  484. package/dist/index43.js +7 -232
  485. package/dist/index43.js.map +1 -1
  486. package/dist/index44.js +2 -22
  487. package/dist/index44.js.map +1 -1
  488. package/dist/index45.js +21 -139
  489. package/dist/index45.js.map +1 -1
  490. package/dist/index46.js +230 -183
  491. package/dist/index46.js.map +1 -1
  492. package/dist/index47.js +202 -74
  493. package/dist/index47.js.map +1 -1
  494. package/dist/index48.js +3 -90
  495. package/dist/index48.js.map +1 -1
  496. package/dist/index49.js +6 -5
  497. package/dist/index49.js.map +1 -1
  498. package/dist/index5.js +1 -1
  499. package/dist/index50.js +41 -837
  500. package/dist/index50.js.map +1 -1
  501. package/dist/index51.js +26 -65
  502. package/dist/index51.js.map +1 -1
  503. package/dist/index52.js +48 -34
  504. package/dist/index52.js.map +1 -1
  505. package/dist/index53.js +7 -7
  506. package/dist/index53.js.map +1 -1
  507. package/dist/index54.js +15 -2
  508. package/dist/index54.js.map +1 -1
  509. package/dist/index55.js +132 -22
  510. package/dist/index55.js.map +1 -1
  511. package/dist/index56.js +10 -233
  512. package/dist/index56.js.map +1 -1
  513. package/dist/index57.js +203 -191
  514. package/dist/index57.js.map +1 -1
  515. package/dist/index58.js +13 -7
  516. package/dist/index58.js.map +1 -1
  517. package/dist/index59.js +2 -2
  518. package/dist/index60.js +44 -24
  519. package/dist/index60.js.map +1 -1
  520. package/dist/index62.js +49 -11
  521. package/dist/index62.js.map +1 -1
  522. package/dist/index63.js +4 -4
  523. package/dist/index63.js.map +1 -1
  524. package/dist/index64.js +5 -47
  525. package/dist/index64.js.map +1 -1
  526. package/dist/index65.js +27 -50
  527. package/dist/index65.js.map +1 -1
  528. package/dist/index66.js +50 -8
  529. package/dist/index66.js.map +1 -1
  530. package/dist/index67.js +8 -14
  531. package/dist/index67.js.map +1 -1
  532. package/dist/index68.js +2 -134
  533. package/dist/index68.js.map +1 -1
  534. package/dist/index69.js +2 -11
  535. package/dist/index69.js.map +1 -1
  536. package/dist/index70.js +11 -216
  537. package/dist/index70.js.map +1 -1
  538. package/dist/index71.js +54 -13
  539. package/dist/index71.js.map +1 -1
  540. package/dist/index72.js +5 -46
  541. package/dist/index72.js.map +1 -1
  542. package/dist/index73.js +7 -49
  543. package/dist/index73.js.map +1 -1
  544. package/dist/index74.js +6 -4
  545. package/dist/index74.js.map +1 -1
  546. package/dist/index75.js +46 -5
  547. package/dist/index75.js.map +1 -1
  548. package/dist/index76.js +205 -27
  549. package/dist/index76.js.map +1 -1
  550. package/dist/index77.js +22 -50
  551. package/dist/index77.js.map +1 -1
  552. package/dist/index78.js +25 -9
  553. package/dist/index78.js.map +1 -1
  554. package/dist/index79.js +400 -2
  555. package/dist/index79.js.map +1 -1
  556. package/dist/index8.js +1 -1
  557. package/dist/index80.js +47 -2
  558. package/dist/index80.js.map +1 -1
  559. package/dist/index81.js +604 -52
  560. package/dist/index81.js.map +1 -1
  561. package/dist/index82.js +5 -5
  562. package/dist/index82.js.map +1 -1
  563. package/dist/index83.js +68 -7
  564. package/dist/index83.js.map +1 -1
  565. package/dist/index84.js +2 -6
  566. package/dist/index84.js.map +1 -1
  567. package/dist/index85.js +352 -594
  568. package/dist/index85.js.map +1 -1
  569. package/dist/index86.js +262 -52
  570. package/dist/index86.js.map +1 -1
  571. package/dist/index87.js +60 -4
  572. package/dist/index87.js.map +1 -1
  573. package/dist/index88.js +46 -4
  574. package/dist/index88.js.map +1 -1
  575. package/dist/index89.js +169 -15
  576. package/dist/index89.js.map +1 -1
  577. package/dist/index9.js +1 -1
  578. package/dist/index90.js +109 -5
  579. package/dist/index90.js.map +1 -1
  580. package/dist/index91.js +24 -7
  581. package/dist/index91.js.map +1 -1
  582. package/dist/index92.js +8 -17
  583. package/dist/index92.js.map +1 -1
  584. package/dist/index93.js +4 -4
  585. package/dist/index93.js.map +1 -1
  586. package/dist/index94.js +5 -4
  587. package/dist/index94.js.map +1 -1
  588. package/dist/index95.js +4 -5
  589. package/dist/index95.js.map +1 -1
  590. package/dist/index96.js +466 -5
  591. package/dist/index96.js.map +1 -1
  592. package/dist/index97.js +185 -4
  593. package/dist/index97.js.map +1 -1
  594. package/dist/index98.js +107 -4
  595. package/dist/index98.js.map +1 -1
  596. package/dist/index99.js +262 -6
  597. package/dist/index99.js.map +1 -1
  598. package/package.json +1 -1
  599. package/dist/index317.js +0 -27
  600. package/dist/index317.js.map +0 -1
  601. package/dist/index318.js +0 -116
  602. package/dist/index318.js.map +0 -1
  603. package/dist/index319.js +0 -19
  604. package/dist/index319.js.map +0 -1
  605. package/dist/index320.js +0 -528
  606. package/dist/index320.js.map +0 -1
  607. package/dist/index321.js +0 -131
  608. package/dist/index321.js.map +0 -1
  609. package/dist/index322.js +0 -137
  610. package/dist/index322.js.map +0 -1
  611. package/dist/index323.js +0 -24
  612. package/dist/index323.js.map +0 -1
  613. package/dist/index324.js +0 -9
  614. package/dist/index324.js.map +0 -1
  615. package/dist/index325.js +0 -9
  616. package/dist/index325.js.map +0 -1
  617. package/dist/index326.js +0 -7
  618. package/dist/index326.js.map +0 -1
  619. package/dist/index327.js +0 -19
  620. package/dist/index327.js.map +0 -1
  621. package/dist/index328.js +0 -12
  622. package/dist/index328.js.map +0 -1
  623. package/dist/index329.js +0 -9
  624. package/dist/index329.js.map +0 -1
  625. package/dist/index330.js +0 -8
  626. package/dist/index330.js.map +0 -1
  627. package/dist/index331.js +0 -549
  628. package/dist/index331.js.map +0 -1
  629. package/dist/index332.js +0 -50
  630. package/dist/index332.js.map +0 -1
  631. package/dist/index333.js +0 -21
  632. package/dist/index333.js.map +0 -1
  633. package/dist/index334.js +0 -10
  634. package/dist/index334.js.map +0 -1
  635. package/dist/index335.js +0 -12
  636. package/dist/index335.js.map +0 -1
  637. package/dist/index336.js +0 -11
  638. package/dist/index336.js.map +0 -1
  639. package/dist/index337.js +0 -12
  640. package/dist/index337.js.map +0 -1
  641. package/dist/index338.js +0 -16
  642. package/dist/index338.js.map +0 -1
  643. package/dist/index339.js +0 -13
  644. package/dist/index339.js.map +0 -1
  645. package/dist/index340.js +0 -17
  646. package/dist/index340.js.map +0 -1
  647. package/dist/index341.js +0 -68
  648. package/dist/index341.js.map +0 -1
  649. package/dist/index342.js +0 -72
  650. package/dist/index342.js.map +0 -1
  651. package/dist/index343.js +0 -12
  652. package/dist/index343.js.map +0 -1
  653. package/dist/index344.js +0 -17
  654. package/dist/index344.js.map +0 -1
  655. package/dist/index345.js +0 -69
  656. package/dist/index345.js.map +0 -1
  657. package/dist/index346.js +0 -71
  658. package/dist/index346.js.map +0 -1
  659. package/dist/index347.js +0 -34
  660. package/dist/index347.js.map +0 -1
  661. package/dist/index348.js +0 -12
  662. package/dist/index348.js.map +0 -1
  663. package/dist/index349.js +0 -156
  664. package/dist/index349.js.map +0 -1
  665. package/dist/index350.js +0 -111
  666. package/dist/index350.js.map +0 -1
  667. package/dist/index351.js +0 -8
  668. package/dist/index351.js.map +0 -1
  669. package/dist/index352.js +0 -59
  670. package/dist/index352.js.map +0 -1
  671. package/dist/index353.js +0 -7
  672. package/dist/index353.js.map +0 -1
  673. package/dist/index354.js +0 -26
  674. package/dist/index354.js.map +0 -1
  675. package/dist/index355.js +0 -19
  676. package/dist/index355.js.map +0 -1
  677. package/dist/index356.js +0 -32
  678. package/dist/index356.js.map +0 -1
  679. package/dist/index357.js +0 -16
  680. package/dist/index357.js.map +0 -1
  681. package/dist/index358.js +0 -10
  682. package/dist/index358.js.map +0 -1
  683. package/dist/index359.js +0 -26
  684. package/dist/index359.js.map +0 -1
  685. package/dist/index360.js +0 -16
  686. package/dist/index360.js.map +0 -1
  687. package/dist/index361.js +0 -31
  688. package/dist/index361.js.map +0 -1
  689. package/dist/index362.js +0 -8
  690. package/dist/index362.js.map +0 -1
package/dist/index37.js CHANGED
@@ -1,26 +1,190 @@
1
- import e from "react";
2
- import p from "./index38.js";
3
- import "./index30.js";
4
- import "./index31.js";
5
- import "./index32.js";
6
- import "./index33.js";
7
- import "./index34.js";
8
- import "./index35.js";
9
- import "./index36.js";
10
- const i = p((t) => {
11
- let {
12
- inputRef: r,
13
- ...o
14
- } = t;
15
- return e.createElement("input", {
16
- ...o,
17
- ref: r
18
- });
19
- }), m = (t, r) => e.createElement(i, {
20
- ...t,
21
- ref: r
22
- }), k = e.forwardRef(m);
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 "./index73.js";
4
+ import { validatePhoneNumberLength as D } from "./index74.js";
5
+ function g(t) {
6
+ return t.replace(/\D/g, "");
7
+ }
8
+ function P(t) {
9
+ return t ? t.length > W ? !1 : C.some((e) => e.startsWith(t)) : !0;
10
+ }
11
+ const N = /[\u061C\u200B-\u200F\u202A-\u202E\u2066-\u2069\uFEFF]/g;
12
+ function T(t) {
13
+ return t.replace(N, "");
14
+ }
15
+ function q(t, e, s = {}) {
16
+ const { force: u = !1 } = s, o = `+${e}`;
17
+ if (!t.startsWith(o) || !u)
18
+ return t;
19
+ const i = t.slice(o.length).trimStart();
20
+ if (i.startsWith("0"))
21
+ return t;
22
+ if (!i)
23
+ return `${o} 0`;
24
+ const [n, ...r] = i.split(" "), f = `0${n ?? ""}`, l = r.length > 0 ? ` ${r.join(" ")}` : "";
25
+ return `${o} ${f}${l}`.replace(/\s\s+/g, " ").trimEnd();
26
+ }
27
+ const O = {
28
+ GG: "GB",
29
+ JE: "GB",
30
+ IM: "GB"
31
+ };
32
+ function y(t) {
33
+ if (t)
34
+ return O[t] ?? t;
35
+ }
36
+ function _(t, e, s) {
37
+ if (!t || !s || (t.nationalNumber ?? "").length < 4)
38
+ return;
39
+ const o = t.countryCallingCode;
40
+ if (!o)
41
+ return;
42
+ const i = t.getMetadata, n = (typeof i == "function" ? i() : null)?.country_calling_codes?.[o];
43
+ if (!n || n.length === 0)
44
+ return;
45
+ const r = [];
46
+ for (const f of n) {
47
+ const l = y(f);
48
+ l && !r.includes(l) && r.push(l);
49
+ }
50
+ if (r.length !== 0)
51
+ return e && r.includes(e) ? e : r.includes(x) ? x : r[0];
52
+ }
53
+ function B(t, e, s, u) {
54
+ if (!t)
55
+ return !1;
56
+ if (!u)
57
+ return t.startsWith("0");
58
+ if (!s || !t.startsWith(s) || !t.slice(s.length).startsWith("0"))
59
+ return !1;
60
+ const o = t.slice(s.length + 1), i = e.startsWith(s) ? e.slice(s.length) : e;
61
+ return o === i;
62
+ }
63
+ function S(t) {
64
+ for (const e of $)
65
+ if (t.startsWith(e))
66
+ return t.slice(e.length);
67
+ return t;
68
+ }
69
+ function M(t, e, s = {}) {
70
+ const { allowJustPlus: u = !1, removeNationalPrefix: o = !0, previousValue: i } = s, n = T(t).trim();
71
+ if (!n)
72
+ return "";
73
+ if (n === "+")
74
+ return u ? "+" : "";
75
+ if (n.startsWith("+")) {
76
+ const a = g(n);
77
+ if (!a)
78
+ return u ? "+" : "";
79
+ const d = S(a);
80
+ if (d !== a)
81
+ return d ? `+${d}` : u ? "+" : "";
82
+ if (o && e) {
83
+ const h = p(e);
84
+ if (a.startsWith(h) && a.slice(h.length).startsWith("0")) {
85
+ const E = a.slice(h.length + 1);
86
+ return E ? `+${h}${E}` : `+${h}`;
87
+ }
88
+ }
89
+ return `+${a}`;
90
+ }
91
+ const r = g(n);
92
+ if (!r)
93
+ return "";
94
+ const f = S(r);
95
+ if (f !== r)
96
+ return f ? `+${f}` : u ? "+" : "";
97
+ const l = typeof i == "string" ? i : "", m = l && l.startsWith("+") ? g(l) : "";
98
+ if (m && m.length > r.length && m.endsWith(r) && m.length - r.length <= W)
99
+ return `+${r}`;
100
+ if (r === "0")
101
+ return "0";
102
+ if (o && e && r.length > 1 && r.startsWith("0") && !r.startsWith("00")) {
103
+ const a = p(e), d = r.slice(1);
104
+ return d ? `+${a}${d}` : `+${a}`;
105
+ }
106
+ return e ? r.length <= 4 ? `+${r}` : `+${p(e)}${r}` : r;
107
+ }
108
+ function Y(t, e) {
109
+ if (t === "+")
110
+ return {
111
+ international: "+",
112
+ national: "",
113
+ formatted: "+",
114
+ phoneNumber: null,
115
+ detectedCountry: void 0,
116
+ inferredCountry: void 0,
117
+ hasExplicitInternationalPrefix: !0
118
+ };
119
+ const s = /^\s*\+/.test(t), u = e ? new I(e) : new I(), o = u.input(t), i = u.getNumber(), c = g(t), n = y(
120
+ i?.country ?? u.country ?? void 0
121
+ ), r = n ?? !i ? void 0 : y(
122
+ _(i, e, c)
123
+ ), f = i?.formatInternational() ?? o, l = i?.formatNational() ?? g(f);
124
+ return {
125
+ international: f,
126
+ national: l,
127
+ formatted: o,
128
+ phoneNumber: i,
129
+ detectedCountry: n,
130
+ inferredCountry: r,
131
+ hasExplicitInternationalPrefix: s
132
+ };
133
+ }
134
+ function v(t, e) {
135
+ return t.startsWith(e) ? t.slice(e.length) : t;
136
+ }
137
+ function H(t, e) {
138
+ if (!e || !t)
139
+ return null;
140
+ try {
141
+ return D(t, e) === "TOO_LONG" ? "TOO_LONG" : null;
142
+ } catch {
143
+ return null;
144
+ }
145
+ }
146
+ function U(t, e, s, u = {}) {
147
+ const {
148
+ hasRemovedNationalPrefix: o = !1,
149
+ detectedCountry: i,
150
+ hasExplicitInternationalPrefix: c = !1
151
+ } = u;
152
+ if (!t)
153
+ return { shouldSuggest: !1, query: "" };
154
+ if (t === "+")
155
+ return { shouldSuggest: !0, query: "" };
156
+ const n = g(t);
157
+ if (!n)
158
+ return { shouldSuggest: !0, query: "" };
159
+ if (o)
160
+ return { shouldSuggest: !1, query: "" };
161
+ if (c && !i)
162
+ return P(n) ? { shouldSuggest: !0, query: n } : { shouldSuggest: !1, query: "" };
163
+ let r = s?.countryCallingCode ?? null;
164
+ if (!r) {
165
+ if (e) {
166
+ const l = p(e);
167
+ n.startsWith(l) && (r = l);
168
+ } else if (!c)
169
+ return { shouldSuggest: !1, query: "" };
170
+ }
171
+ return r ? v(n, r).length === 0 ? { shouldSuggest: !0, query: n } : { shouldSuggest: !1, query: "" } : { shouldSuggest: !0, query: n };
172
+ }
173
+ function V(t, e) {
174
+ if (t.shouldSuggest)
175
+ return !1;
176
+ const { hasExplicitInternationalPrefix: s = !1, detectedCountry: u } = e;
177
+ return s ? !!u : !0;
178
+ }
23
179
  export {
24
- k as default
180
+ B as detectNationalPrefixForDisplay,
181
+ Y as formatWithAsYouType,
182
+ H as getLengthIssue,
183
+ U as getSuggestionState,
184
+ q as injectNationalPrefixDisplay,
185
+ M as normalizeInputValue,
186
+ g as sanitizeDigits,
187
+ V as shouldDisplayExplicitCountrySelection,
188
+ v as stripPrefix
25
189
  };
26
190
  //# sourceMappingURL=index37.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index37.js","sources":["../../../node_modules/react-imask/esm/input.js"],"sourcesContent":["import React from 'react';\nimport IMaskMixin from './mixin.js';\nimport 'prop-types';\nimport 'imask/esm/imask';\n\nconst IMaskInputClass = IMaskMixin(_ref => {\n let {\n inputRef,\n ...props\n } = _ref;\n return React.createElement('input', {\n ...props,\n ref: inputRef\n });\n});\nconst IMaskInputFn = (props, ref) => React.createElement(IMaskInputClass, {\n ...props,\n ref\n}) // TODO fix no idea\n;\nconst IMaskInput = React.forwardRef(IMaskInputFn);\n\nexport { IMaskInput as default };\n"],"names":["IMaskInputClass","IMaskMixin","_ref","inputRef","props","React","IMaskInputFn","ref","IMaskInput"],"mappings":";;;;;;;;;AAKA,MAAMA,IAAkBC,EAAW,CAAAC,MAAQ;AACzC,MAAI;AAAA,IACF,UAAAC;AAAA,IACA,GAAGC;AAAA,EACP,IAAMF;AACJ,SAAOG,EAAM,cAAc,SAAS;AAAA,IAClC,GAAGD;AAAA,IACH,KAAKD;AAAA,EACT,CAAG;AACH,CAAC,GACKG,IAAe,CAACF,GAAOG,MAAQF,EAAM,cAAcL,GAAiB;AAAA,EACxE,GAAGI;AAAA,EACH,KAAAG;AACF,CAAC,GAEKC,IAAaH,EAAM,WAAWC,CAAY;","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","isDialCodeProgress","digits","MAX_DIAL_CODE_LENGTH","COUNTRY_DIAL_CODES","dial","INVISIBLE_FORMATTING_CHARACTERS","stripInvisibleFormatting","injectNationalPrefixDisplay","international","dialCode","options","force","prefix","remainder","firstGroup","restGroups","rebuiltFirstGroup","rebuiltRemainder","DETECTED_COUNTRY_OVERRIDES","canonicalizeDetectedCountry","candidate","inferCountryFromDialCode","phoneNumber","baseCountry","normalizedDigits","metadataGetter","candidates","canonicalCandidates","canonical","DEFAULT_COUNTRY","detectNationalPrefixForDisplay","rawDigits","internationalDigits","hasExplicitInternationalPrefix","rawAfterTrunk","internationalAfterDial","stripIddPrefix","COMMON_IDD_PREFIXES","normalizeInputValue","rawValue","country","allowJustPlus","removeNationalPrefix","previousValue","trimmed","digitsWithoutIdd","getCountryCallingCode","withoutPrefix","digitsOnly","previousNormalized","previousDigits","formatWithAsYouType","formatter","AsYouType","formatted","detectedCountry","inferredCountry","national","stripPrefix","getLengthIssue","validatePhoneNumberLength","getSuggestionState","normalized","hasRemovedNationalPrefix","baseDial","shouldDisplayExplicitCountrySelection","suggestion"],"mappings":";;;;AAaO,SAASA,EAAeC,GAAe;AAC5C,SAAOA,EAAM,QAAQ,OAAO,EAAE;AAChC;AAEA,SAASC,EAAmBC,GAAgB;AAC1C,SAAKA,IAIDA,EAAO,SAASC,IACX,KAGFC,EAAmB,KAAK,CAACC,MAASA,EAAK,WAAWH,CAAM,CAAC,IAPvD;AAQX;AAEA,MAAMI,IACJ;AAEF,SAASC,EAAyBP,GAAe;AAC/C,SAAOA,EAAM,QAAQM,GAAiC,EAAE;AAC1D;AAE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AAe,IAAO,OAAO,GAAA;AAGxC,MAAIA,MAAe;AACjB,WAAO,EAAE,eAAe,IAAM,OAAO,GAAA;AAGvC,QAAM7D,IAASH,EAAegE,CAAU;AACxC,MAAI,CAAC7D;AACH,WAAO,EAAE,eAAe,IAAM,OAAO,GAAA;AAGvC,MAAI8D;AACF,WAAO,EAAE,eAAe,IAAO,OAAO,GAAA;AAGxC,MAAI9B,KAAkC,CAACsB;AACrC,WAAKvD,EAAmBC,CAAM,IAGvB,EAAE,eAAe,IAAM,OAAOA,EAAA,IAF5B,EAAE,eAAe,IAAO,OAAO,GAAA;AAK1C,MAAIG,IAAOkB,GAAa,sBAAsB;AAC9C,MAAI,CAAClB;AACH,QAAImB,GAAa;AACf,YAAMyC,IAAWlB,EAAsBvB,CAAW;AAClD,MAAItB,EAAO,WAAW+D,CAAQ,MAC5B5D,IAAO4D;AAAA,IAEX,WAAW,CAAC/B;AACV,aAAO,EAAE,eAAe,IAAO,OAAO,GAAA;AAAA;AAI1C,SAAK7B,IAIkBsD,EAAYzD,GAAQG,CAAI,EAC5B,WAAW,IACrB,EAAE,eAAe,IAAM,OAAOH,EAAA,IAGhC,EAAE,eAAe,IAAO,OAAO,GAAA,IAR7B,EAAE,eAAe,IAAM,OAAOA,EAAA;AASzC;AAEO,SAASgE,EACdC,GACAxD,GACA;AACA,MAAIwD,EAAW;AACb,WAAO;AAGT,QAAM,EAAE,gCAAAjC,IAAiC,IAAO,iBAAAsB,EAAA,IAAoB7C;AAEpE,SAAKuB,IAIE,EAAQsB,IAHN;AAIX;"}
package/dist/index38.js CHANGED
@@ -1,132 +1,80 @@
1
- import o from "react";
2
- import e from "./index171.js";
3
- import "./index30.js";
4
- import p from "./index157.js";
5
- import "./index31.js";
6
- import "./index32.js";
7
- import "./index33.js";
8
- import "./index34.js";
9
- import "./index35.js";
10
- import "./index36.js";
11
- const m = {
12
- // common
13
- mask: e.oneOfType([e.array, e.func, e.string, e.instanceOf(RegExp), e.oneOf([Date, Number, p.Masked]), e.instanceOf(p.Masked)]),
14
- value: e.any,
15
- unmask: e.oneOfType([e.bool, e.oneOf(["typed"])]),
16
- prepare: e.func,
17
- prepareChar: e.func,
18
- validate: e.func,
19
- commit: e.func,
20
- overwrite: e.oneOfType([e.bool, e.oneOf(["shift"])]),
21
- eager: e.oneOfType([e.bool, e.oneOf(["append", "remove"])]),
22
- skipInvalid: e.bool,
23
- // events
24
- onAccept: e.func,
25
- onComplete: e.func,
26
- // pattern
27
- placeholderChar: e.string,
28
- displayChar: e.string,
29
- lazy: e.bool,
30
- definitions: e.object,
31
- blocks: e.object,
32
- // enum
33
- enum: e.arrayOf(e.string),
34
- // range
35
- maxLength: e.number,
36
- from: e.number,
37
- to: e.number,
38
- // date
39
- pattern: e.string,
40
- format: e.func,
41
- parse: e.func,
42
- autofix: e.oneOfType([e.bool, e.oneOf(["pad"])]),
43
- // number
44
- radix: e.string,
45
- thousandsSeparator: e.string,
46
- mapToRadix: e.arrayOf(e.string),
47
- scale: e.number,
48
- normalizeZeros: e.bool,
49
- padFractionalZeros: e.bool,
50
- min: e.oneOfType([e.number, e.instanceOf(Date)]),
51
- max: e.oneOfType([e.number, e.instanceOf(Date)]),
52
- // dynamic
53
- dispatch: e.func,
54
- // ref
55
- inputRef: e.oneOfType([e.func, e.shape({
56
- current: e.object
57
- })])
58
- }, u = Object.keys(m).filter((i) => i !== "value"), h = ["value", "unmask", "onAccept", "onComplete", "inputRef"], c = u.filter((i) => h.indexOf(i) < 0);
59
- function T(i) {
60
- var a;
61
- const r = (a = class extends o.Component {
62
- constructor(t) {
63
- super(t), this._inputRef = this._inputRef.bind(this);
64
- }
65
- componentDidMount() {
66
- this.props.mask && this.initMask();
67
- }
68
- componentDidUpdate() {
69
- const t = this.props, s = this._extractMaskOptionsFromProps(t);
70
- if (s.mask)
71
- this.maskRef ? (this.maskRef.updateOptions(s), "value" in t && t.value !== void 0 && (this.maskValue = t.value)) : this.initMask(s);
72
- else if (this.destroyMask(), "value" in t && t.value !== void 0) {
73
- var n;
74
- (n = this.element) != null && n.isContentEditable && this.element.tagName !== "INPUT" && this.element.tagName !== "TEXTAREA" ? this.element.textContent = t.value : this.element.value = t.value;
75
- }
76
- }
77
- componentWillUnmount() {
78
- this.destroyMask();
79
- }
80
- _inputRef(t) {
81
- this.element = t, this.props.inputRef && (Object.prototype.hasOwnProperty.call(this.props.inputRef, "current") ? this.props.inputRef.current = t : this.props.inputRef(t));
82
- }
83
- initMask(t) {
84
- t === void 0 && (t = this._extractMaskOptionsFromProps(this.props)), this.maskRef = p(this.element, t).on("accept", this._onAccept.bind(this)).on("complete", this._onComplete.bind(this)), "value" in this.props && this.props.value !== void 0 && (this.maskValue = this.props.value);
85
- }
86
- destroyMask() {
87
- this.maskRef && (this.maskRef.destroy(), delete this.maskRef);
88
- }
89
- _extractMaskOptionsFromProps(t) {
90
- const {
91
- ...s
92
- } = t;
93
- return Object.keys(s).filter((n) => c.indexOf(n) < 0).forEach((n) => {
94
- delete s[n];
95
- }), s;
96
- }
97
- _extractNonMaskProps(t) {
98
- const {
99
- ...s
100
- } = t;
101
- return u.forEach((n) => {
102
- n !== "maxLength" && delete s[n];
103
- }), "defaultValue" in s || (s.defaultValue = t.mask ? "" : s.value), delete s.value, s;
104
- }
105
- get maskValue() {
106
- return this.maskRef ? this.props.unmask === "typed" ? this.maskRef.typedValue : this.props.unmask ? this.maskRef.unmaskedValue : this.maskRef.value : "";
107
- }
108
- set maskValue(t) {
109
- this.maskRef && (t = t == null && this.props.unmask !== "typed" ? "" : t, this.props.unmask === "typed" ? this.maskRef.typedValue = t : this.props.unmask ? this.maskRef.unmaskedValue = t : this.maskRef.value = t);
110
- }
111
- _onAccept(t) {
112
- this.props.onAccept && this.maskRef && this.props.onAccept(this.maskValue, this.maskRef, t);
113
- }
114
- _onComplete(t) {
115
- this.props.onComplete && this.maskRef && this.props.onComplete(this.maskValue, this.maskRef, t);
116
- }
117
- render() {
118
- return o.createElement(i, {
119
- ...this._extractNonMaskProps(this.props),
120
- inputRef: this._inputRef
121
- });
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;
33
+ }
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 { value: e } = t, n = t.selectionStart ?? e.length, r = t.selectionEnd ?? n, i = n <= 1 && e.startsWith("+"), o = r <= 1 && e.startsWith("+");
48
+ return {
49
+ selectionStart: n,
50
+ selectionEnd: r,
51
+ startDigits: l(e, n),
52
+ endDigits: l(e, r),
53
+ preserveStartIndex: i,
54
+ preserveEndIndex: o,
55
+ wasAtStart: n === 0,
56
+ wasAtEnd: r === e.length
57
+ };
58
+ }
59
+ function u(t, e) {
60
+ if (t.selectionStart === t.selectionEnd) {
61
+ if (t.wasAtEnd) {
62
+ const f = e.length;
63
+ return { start: f, end: f };
122
64
  }
123
- }, a.displayName = void 0, a.propTypes = void 0, a), l = i.displayName || i.name || "Component";
124
- return r.displayName = "IMask(" + l + ")", r.propTypes = m, o.forwardRef((f, t) => o.createElement(r, {
125
- ...f,
126
- ref: t
127
- }));
65
+ if (t.wasAtStart)
66
+ return { start: 0, end: 0 };
67
+ }
68
+ 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);
69
+ let i = n, o = r;
70
+ t.wasAtStart && (i = 0), t.wasAtEnd && (o = e.length), t.selectionStart === t.selectionEnd && (i = o);
71
+ const d = Math.min(Math.max(i, 0), e.length), s = Math.min(Math.max(o, 0), e.length);
72
+ return d > s ? { start: s, end: s } : { start: d, end: s };
128
73
  }
129
74
  export {
130
- T as default
75
+ m as captureSelectionSnapshot,
76
+ u as resolveSelection,
77
+ h as skipFormattingCharactersLeft,
78
+ S as skipFormattingCharactersRight
131
79
  };
132
80
  //# sourceMappingURL=index38.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index38.js","sources":["../../../node_modules/react-imask/esm/mixin.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport IMask from 'imask/esm/imask';\n\nconst MASK_PROPS = {\n // common\n mask: PropTypes.oneOfType([PropTypes.array, PropTypes.func, PropTypes.string, PropTypes.instanceOf(RegExp), PropTypes.oneOf([Date, Number, IMask.Masked]), PropTypes.instanceOf(IMask.Masked)]),\n value: PropTypes.any,\n unmask: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['typed'])]),\n prepare: PropTypes.func,\n prepareChar: PropTypes.func,\n validate: PropTypes.func,\n commit: PropTypes.func,\n overwrite: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['shift'])]),\n eager: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['append', 'remove'])]),\n skipInvalid: PropTypes.bool,\n // events\n onAccept: PropTypes.func,\n onComplete: PropTypes.func,\n // pattern\n placeholderChar: PropTypes.string,\n displayChar: PropTypes.string,\n lazy: PropTypes.bool,\n definitions: PropTypes.object,\n blocks: PropTypes.object,\n // enum\n enum: PropTypes.arrayOf(PropTypes.string),\n // range\n maxLength: PropTypes.number,\n from: PropTypes.number,\n to: PropTypes.number,\n // date\n pattern: PropTypes.string,\n format: PropTypes.func,\n parse: PropTypes.func,\n autofix: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['pad'])]),\n // number\n radix: PropTypes.string,\n thousandsSeparator: PropTypes.string,\n mapToRadix: PropTypes.arrayOf(PropTypes.string),\n scale: PropTypes.number,\n normalizeZeros: PropTypes.bool,\n padFractionalZeros: PropTypes.bool,\n min: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),\n max: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),\n // dynamic\n dispatch: PropTypes.func,\n // ref\n inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({\n current: PropTypes.object\n })])\n};\nconst MASK_PROPS_NAMES = Object.keys(MASK_PROPS).filter(p => p !== 'value');\nconst NON_MASK_OPTIONS_NAMES = ['value', 'unmask', 'onAccept', 'onComplete', 'inputRef'];\nconst MASK_OPTIONS_NAMES = MASK_PROPS_NAMES.filter(pName => NON_MASK_OPTIONS_NAMES.indexOf(pName) < 0);\nfunction IMaskMixin(ComposedComponent) {\n var _Class;\n const MaskedComponent = (_Class = class MaskedComponent extends React.Component {\n constructor(props) {\n super(props);\n this._inputRef = this._inputRef.bind(this);\n }\n componentDidMount() {\n if (!this.props.mask) return;\n this.initMask();\n }\n componentDidUpdate() {\n const props = this.props;\n const maskOptions = this._extractMaskOptionsFromProps(props);\n if (maskOptions.mask) {\n if (this.maskRef) {\n this.maskRef.updateOptions(maskOptions); // TODO fix\n if ('value' in props && props.value !== undefined) this.maskValue = props.value;\n } else {\n this.initMask(maskOptions);\n }\n } else {\n this.destroyMask();\n if ('value' in props && props.value !== undefined) {\n var _this$element;\n if ((_this$element = this.element) != null && _this$element.isContentEditable && this.element.tagName !== 'INPUT' && this.element.tagName !== 'TEXTAREA') this.element.textContent = props.value;else this.element.value = props.value;\n }\n }\n }\n componentWillUnmount() {\n this.destroyMask();\n }\n _inputRef(el) {\n this.element = el;\n if (this.props.inputRef) {\n if (Object.prototype.hasOwnProperty.call(this.props.inputRef, 'current')) this.props.inputRef.current = el;else this.props.inputRef(el);\n }\n }\n initMask(maskOptions) {\n if (maskOptions === void 0) {\n maskOptions = this._extractMaskOptionsFromProps(this.props);\n }\n this.maskRef = IMask(this.element, maskOptions).on('accept', this._onAccept.bind(this)).on('complete', this._onComplete.bind(this));\n if ('value' in this.props && this.props.value !== undefined) this.maskValue = this.props.value;\n }\n destroyMask() {\n if (this.maskRef) {\n this.maskRef.destroy();\n delete this.maskRef;\n }\n }\n _extractMaskOptionsFromProps(props) {\n const {\n ...cloneProps\n } = props;\n\n // keep only mask options\n Object.keys(cloneProps).filter(prop => MASK_OPTIONS_NAMES.indexOf(prop) < 0).forEach(nonMaskProp => {\n delete cloneProps[nonMaskProp];\n });\n return cloneProps;\n }\n _extractNonMaskProps(props) {\n const {\n ...cloneProps\n } = props;\n MASK_PROPS_NAMES.forEach(maskProp => {\n if (maskProp !== 'maxLength') delete cloneProps[maskProp];\n });\n if (!('defaultValue' in cloneProps)) cloneProps.defaultValue = props.mask ? '' : cloneProps.value;\n delete cloneProps.value;\n return cloneProps;\n }\n get maskValue() {\n if (!this.maskRef) return '';\n if (this.props.unmask === 'typed') return this.maskRef.typedValue;\n if (this.props.unmask) return this.maskRef.unmaskedValue;\n return this.maskRef.value;\n }\n set maskValue(value) {\n if (!this.maskRef) return;\n value = value == null && this.props.unmask !== 'typed' ? '' : value;\n if (this.props.unmask === 'typed') this.maskRef.typedValue = value;else if (this.props.unmask) this.maskRef.unmaskedValue = value;else this.maskRef.value = value;\n }\n _onAccept(e) {\n if (this.props.onAccept && this.maskRef) this.props.onAccept(this.maskValue, this.maskRef, e);\n }\n _onComplete(e) {\n if (this.props.onComplete && this.maskRef) this.props.onComplete(this.maskValue, this.maskRef, e);\n }\n render() {\n return React.createElement(ComposedComponent, {\n ...this._extractNonMaskProps(this.props),\n inputRef: this._inputRef\n });\n }\n }, _Class.displayName = void 0, _Class.propTypes = void 0, _Class);\n const nestedComponentName = ComposedComponent.displayName || ComposedComponent.name || 'Component';\n MaskedComponent.displayName = \"IMask(\" + nestedComponentName + \")\";\n MaskedComponent.propTypes = MASK_PROPS;\n return React.forwardRef((props, ref) => React.createElement(MaskedComponent, {\n ...props,\n ref\n }));\n}\n\nexport { IMaskMixin as default };\n"],"names":["MASK_PROPS","PropTypes","IMask","MASK_PROPS_NAMES","p","NON_MASK_OPTIONS_NAMES","MASK_OPTIONS_NAMES","pName","IMaskMixin","ComposedComponent","_Class","MaskedComponent","React","props","maskOptions","_this$element","el","cloneProps","prop","nonMaskProp","maskProp","value","e","nestedComponentName","ref"],"mappings":";;;;;;;;;;AAIA,MAAMA,IAAa;AAAA;AAAA,EAEjB,MAAMC,EAAU,UAAU,CAACA,EAAU,OAAOA,EAAU,MAAMA,EAAU,QAAQA,EAAU,WAAW,MAAM,GAAGA,EAAU,MAAM,CAAC,MAAM,QAAQC,EAAM,MAAM,CAAC,GAAGD,EAAU,WAAWC,EAAM,MAAM,CAAC,CAAC;AAAA,EAC9L,OAAOD,EAAU;AAAA,EACjB,QAAQA,EAAU,UAAU,CAACA,EAAU,MAAMA,EAAU,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AAAA,EACxE,SAASA,EAAU;AAAA,EACnB,aAAaA,EAAU;AAAA,EACvB,UAAUA,EAAU;AAAA,EACpB,QAAQA,EAAU;AAAA,EAClB,WAAWA,EAAU,UAAU,CAACA,EAAU,MAAMA,EAAU,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;AAAA,EAC3E,OAAOA,EAAU,UAAU,CAACA,EAAU,MAAMA,EAAU,MAAM,CAAC,UAAU,QAAQ,CAAC,CAAC,CAAC;AAAA,EAClF,aAAaA,EAAU;AAAA;AAAA,EAEvB,UAAUA,EAAU;AAAA,EACpB,YAAYA,EAAU;AAAA;AAAA,EAEtB,iBAAiBA,E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AAC;AAAA,IAClG;AAAA,IACA,SAAS;AACP,aAAOV,EAAM,cAAcH,GAAmB;AAAA,QAC5C,GAAG,KAAK,qBAAqB,KAAK,KAAK;AAAA,QACvC,UAAU,KAAK;AAAA,MACvB,CAAO;AAAA,IACH;AAAA,EACJ,GAAKC,EAAO,cAAc,QAAQA,EAAO,YAAY,QAAQA,IACrDa,IAAsBd,EAAkB,eAAeA,EAAkB,QAAQ;AACvF,SAAAE,EAAgB,cAAc,WAAWY,IAAsB,KAC/DZ,EAAgB,YAAYX,GACrBY,EAAM,WAAW,CAACC,GAAOW,MAAQZ,EAAM,cAAcD,GAAiB;AAAA,IAC3E,GAAGE;AAAA,IACH,KAAAW;AAAA,EACJ,CAAG,CAAC;AACJ;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index38.js","sources":["../src/components/PhoneNumberInput/selection.ts"],"sourcesContent":["function isDigitCharacter(char: string) {\n if (!char) {\n return false\n }\n const code = char.charCodeAt(0)\n return code >= 48 && code <= 57\n}\n\nfunction countDigitsBefore(value: string, index: number) {\n let count = 0\n const limit = Math.min(index, value.length)\n for (let position = 0; position < limit; position += 1) {\n if (isDigitCharacter(value[position] ?? \"\")) {\n count += 1\n }\n }\n return count\n}\n\nfunction findIndexForDigitCount(value: string, digitCount: number) {\n if (digitCount <= 0) {\n return value.startsWith(\"+\") ? Math.min(1, value.length) : 0\n }\n\n let seen = 0\n for (let index = 0; index < value.length; index += 1) {\n if (isDigitCharacter(value[index] ?? \"\")) {\n seen += 1\n if (seen === digitCount) {\n return index + 1\n }\n }\n }\n\n return value.length\n}\n\nfunction isFormattingCharacter(char: string) {\n if (!char) {\n return false\n }\n if (isDigitCharacter(char)) {\n return false\n }\n return char !== \"+\"\n}\n\nexport function skipFormattingCharactersLeft(value: string, index: number) {\n let position = index\n while (position > 0) {\n const next = value[position - 1] ?? \"\"\n if (!isFormattingCharacter(next)) {\n break\n }\n position -= 1\n }\n return position\n}\n\nexport function skipFormattingCharactersRight(value: string, index: number) {\n let position = index\n while (position < value.length) {\n const next = value[position] ?? \"\"\n if (!isFormattingCharacter(next)) {\n break\n }\n position += 1\n }\n return position\n}\n\ntype SelectionSnapshot = {\n selectionStart: number\n selectionEnd: number\n startDigits: number\n endDigits: number\n preserveStartIndex: boolean\n preserveEndIndex: boolean\n wasAtStart: boolean\n wasAtEnd: boolean\n}\n\nexport function captureSelectionSnapshot(input: HTMLInputElement): SelectionSnapshot {\n const { value } = input\n const selectionStart = input.selectionStart ?? value.length\n const selectionEnd = input.selectionEnd ?? selectionStart\n const preserveStartIndex = selectionStart <= 1 && value.startsWith(\"+\")\n const preserveEndIndex = selectionEnd <= 1 && value.startsWith(\"+\")\n\n return {\n selectionStart,\n selectionEnd,\n startDigits: countDigitsBefore(value, selectionStart),\n endDigits: countDigitsBefore(value, selectionEnd),\n preserveStartIndex,\n preserveEndIndex,\n wasAtStart: selectionStart === 0,\n wasAtEnd: selectionEnd === value.length,\n }\n}\n\nexport function resolveSelection(snapshot: SelectionSnapshot, value: string) {\n if (snapshot.selectionStart === snapshot.selectionEnd) {\n if (snapshot.wasAtEnd) {\n const end = value.length\n return { start: end, end }\n }\n if (snapshot.wasAtStart) {\n return { start: 0, end: 0 }\n }\n }\n\n const start = snapshot.preserveStartIndex\n ? Math.min(snapshot.selectionStart, value.length)\n : findIndexForDigitCount(value, snapshot.startDigits)\n const end = snapshot.preserveEndIndex\n ? Math.min(snapshot.selectionEnd, value.length)\n : findIndexForDigitCount(value, snapshot.endDigits)\n\n let resolvedStart = start\n let resolvedEnd = end\n\n if (snapshot.wasAtStart) {\n resolvedStart = 0\n }\n\n if (snapshot.wasAtEnd) {\n resolvedEnd = value.length\n }\n\n if (snapshot.selectionStart === snapshot.selectionEnd) {\n resolvedStart = resolvedEnd\n }\n\n const clampedStart = Math.min(Math.max(resolvedStart, 0), value.length)\n const clampedEnd = Math.min(Math.max(resolvedEnd, 0), value.length)\n\n if (clampedStart > clampedEnd) {\n return { start: clampedEnd, end: clampedEnd }\n }\n\n return { start: clampedStart, end: clampedEnd }\n}\n\n"],"names":["isDigitCharacter","char","code","countDigitsBefore","value","index","count","limit","position","findIndexForDigitCount","digitCount","seen","isFormattingCharacter","skipFormattingCharactersLeft","next","skipFormattingCharactersRight","captureSelectionSnapshot","input","selectionStart","selectionEnd","preserveStartIndex","preserveEndIndex","resolveSelection","snapshot","end","start","resolvedStart","resolvedEnd","clampedStart","clampedEnd"],"mappings":"AAAA,SAASA,EAAiBC,GAAc;AACtC,MAAI,CAACA;AACH,WAAO;AAET,QAAMC,IAAOD,EAAK,WAAW,CAAC;AAC9B,SAAOC,KAAQ,MAAMA,KAAQ;AAC/B;AAEA,SAASC,EAAkBC,GAAeC,GAAe;AACvD,MAAIC,IAAQ;AACZ,QAAMC,IAAQ,KAAK,IAAIF,GAAOD,EAAM,MAAM;AAC1C,WAASI,IAAW,GAAGA,IAAWD,GAAOC,KAAY;AACnD,IAAIR,EAAiBI,EAAMI,CAAQ,KAAK,EAAE,MACxCF,KAAS;AAGb,SAAOA;AACT;AAEA,SAASG,EAAuBL,GAAeM,GAAoB;AACjE,MAAIA,KAAc;AAChB,WAAON,EAAM,WAAW,GAAG,IAAI,KAAK,IAAI,GAAGA,EAAM,MAAM,IAAI;AAG7D,MAAIO,IAAO;AACX,WAASN,IAAQ,GAAGA,IAAQD,EAAM,QAAQC,KAAS;AACjD,QAAIL,EAAiBI,EAAMC,CAAK,KAAK,EAAE,MACrCM,KAAQ,GACJA,MAASD;AACX,aAAOL,IAAQ;AAKrB,SAAOD,EAAM;AACf;AAEA,SAASQ,EAAsBX,GAAc;AAI3C,SAHI,CAACA,KAGDD,EAAiBC,CAAI,IAChB,KAEFA,MAAS;AAClB;AAEO,SAASY,EAA6BT,GAAeC,GAAe;AACzE,MAAIG,IAAWH;AACf,SAAOG,IAAW,KAAG;AACnB,UAAMM,IAAOV,EAAMI,IAAW,CAAC,KAAK;AACpC,QAAI,CAACI,EAAsBE,CAAI;AAC7B;AAEF,IAAAN,KA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