@rpcbase/ui 0.183.0 → 0.185.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.
- package/dist/index10.js +25 -24
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +107 -5
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +262 -4
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +9 -4
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +42 -6
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +4 -145
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +45 -38
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +52 -5
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +4 -7
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +3 -12
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +15 -13
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +34 -66
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +5 -7
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +7 -31
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +16 -10
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +4 -10
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +4 -8
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +5 -13
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +5 -101
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +5 -20
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +4 -53
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +6 -72
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +556 -525
- package/dist/index12.js.map +1 -1
- package/dist/index120.js +24 -9
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +6 -20
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +4 -16
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +6 -23
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +5 -6
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +4 -5
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +5 -23
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +5 -35
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +9 -16
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +5 -6
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +128 -118
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +4 -4
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +4 -4
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +6 -4
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +145 -4
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +39 -3
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +4 -6
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +8 -24
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +13 -7
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +13 -6
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +7 -5
- package/dist/index139.js.map +1 -1
- package/dist/index14.js +74 -74
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +31 -3
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +10 -3
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +10 -4
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +8 -3
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +13 -4
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +101 -3
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +20 -4
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +53 -3
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +71 -45
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +9 -205
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +763 -624
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +20 -21
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +16 -24
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +23 -399
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +6 -46
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +5 -605
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +23 -5
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +34 -68
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +16 -2
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +6 -363
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +4 -261
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +20 -22
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +4 -60
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +4 -46
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +4 -169
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +3 -109
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +6 -24
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +24 -8
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +7 -4
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +6 -5
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +5 -4
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +3 -466
- package/dist/index169.js.map +1 -1
- package/dist/index17.js +17 -17
- package/dist/index17.js.map +1 -1
- package/dist/index170.js +3 -185
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +4 -107
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +3 -262
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +4 -9
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +3 -42
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +3 -4
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +3 -58
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +46 -8
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +201 -62
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +22 -20
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +411 -341
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +24 -16
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +398 -4
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +604 -4
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +13 -6
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +154 -4
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +30 -7
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +9 -17
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +47 -5
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +11 -5
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +44 -13
- package/dist/index189.js.map +1 -1
- package/dist/index19.js +626 -660
- package/dist/index19.js.map +1 -1
- package/dist/index190.js +95 -10
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +86 -14
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +105 -14
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +52 -5
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +11 -6
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +37 -7
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +8 -6
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +116 -9
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +17 -5
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +15 -5
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +442 -634
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +3 -9
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +36 -5
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +20 -5
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +9 -4
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +8 -11
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +19 -10
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +28 -10
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +16 -11
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +58 -11
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +8 -10
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +254 -200
- package/dist/index21.js.map +1 -1
- package/dist/index210.js +66 -7
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +19 -6
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +16 -5
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +5 -6
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +5 -7
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +6 -6
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +4 -55
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +7 -16
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +17 -7
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +5 -10
- package/dist/index219.js.map +1 -1
- package/dist/index22.js +1 -1
- package/dist/index22.js.map +1 -1
- package/dist/index220.js +5 -10
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +13 -21
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +10 -10
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +14 -9
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +14 -9
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +5 -4
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +6 -5
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +7 -16
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +6 -9
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +9 -18
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +27 -34
- package/dist/index23.js.map +1 -1
- package/dist/index230.js +5 -15
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +5 -12
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +9 -29
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +5 -12
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +5 -25
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +4 -5
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +11 -24
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +10 -28
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +11 -5
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +11 -67
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +219 -222
- package/dist/index24.js.map +1 -1
- package/dist/index240.js +11 -180
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +10 -46
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +7 -13
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +6 -154
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +5 -30
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +6 -9
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +7 -47
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +6 -11
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +54 -43
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +13 -92
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +46 -50
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +7 -86
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +8 -103
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +9 -51
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +21 -11
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +10 -37
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +8 -7
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +9 -116
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +4 -17
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +5 -15
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +16 -3
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +9 -36
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +18 -20
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +15 -9
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +12 -8
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +28 -18
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +11 -27
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +23 -14
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +5 -4
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +24 -18
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +29 -13
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +5 -5
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +68 -3
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +179 -22
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +43 -109
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +20 -15
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +4 -524
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +18 -127
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +12 -133
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +5 -21
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +3 -6
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +3 -37
- package/dist/index28.js.map +1 -1
- package/dist/index280.js +23 -5
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +113 -4
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +15 -15
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +524 -8
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +127 -5
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +133 -4
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +5 -545
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +6 -47
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +4 -18
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +15 -6
- package/dist/index289.js.map +1 -1
- package/dist/index29.js +37 -3
- package/dist/index29.js.map +1 -1
- package/dist/index290.js +8 -8
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +5 -7
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +4 -8
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +545 -12
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +47 -10
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +17 -13
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +7 -69
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +9 -9
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +8 -14
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +9 -66
- package/dist/index299.js.map +1 -1
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +3 -125
- package/dist/index30.js.map +1 -1
- package/dist/index300.js +12 -64
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +9 -4
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +14 -56
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +65 -68
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +68 -30
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +9 -9
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +13 -152
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +65 -107
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +4 -3
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +56 -23
- package/dist/index309.js.map +1 -1
- package/dist/index31.js +120 -227
- package/dist/index31.js.map +1 -1
- package/dist/index310.js +68 -16
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +31 -29
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +9 -13
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +153 -7
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +107 -22
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +4 -13
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +22 -27
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +16 -5
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +32 -0
- package/dist/index318.js.map +1 -0
- package/dist/index319.js +16 -0
- package/dist/index319.js.map +1 -0
- package/dist/index32.js +229 -21
- package/dist/index32.js.map +1 -1
- package/dist/index320.js +10 -0
- package/dist/index320.js.map +1 -0
- package/dist/index321.js +26 -0
- package/dist/index321.js.map +1 -0
- package/dist/index322.js +16 -0
- package/dist/index322.js.map +1 -0
- package/dist/index323.js +31 -0
- package/dist/index323.js.map +1 -0
- package/dist/index324.js +8 -0
- package/dist/index324.js.map +1 -0
- package/dist/index33.js +23 -50
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +50 -2640
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +2598 -351
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +375 -214
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +230 -19
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +18 -138
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +113 -170
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +17 -15
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +209 -64
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +86 -94
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +118 -5
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +5 -843
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +832 -54
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +57 -8
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +8 -2
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +2 -24
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +11 -233
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +19 -205
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +34 -34
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +7 -3
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +2 -7
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +22 -46
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +232 -25
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +50 -47
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +2 -8
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +2 -15
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +5 -133
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +7 -10
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +5 -216
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +154 -120
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +2 -13
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +2 -34
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +6 -46
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +33 -7
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +24 -47
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +8 -4
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +11 -5
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +202 -25
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +4 -50
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +48 -9
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +29 -24
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +49 -10
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +7 -53
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +14 -5
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +133 -7
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +10 -5
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +217 -2
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +13 -2
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +47 -52
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +49 -4
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +4 -5
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +21 -24
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +5 -15
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +28 -6
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +50 -8
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +9 -17
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +5 -4
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +68 -4
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +2 -6
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +363 -5
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +261 -4
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +60 -4
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +138 -187
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +46 -6
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +169 -24
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +109 -6
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +24 -4
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +8 -7
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +4 -5
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +5 -4
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +4 -5
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +466 -4
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +185 -8
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index39.js
CHANGED
|
@@ -1,190 +1,133 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getCountryCallingCode as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return t.replace(/\D/g, "");
|
|
1
|
+
import { getCountryList as E } from "./index57.js";
|
|
2
|
+
import { getCountryCallingCode as s } from "./index43.js";
|
|
3
|
+
const c = "US", u = E(), f = /* @__PURE__ */ new Map(), m = "__default_locale__", _ = Array.from(new Set(u.map((e) => s(e)))).sort((e, t) => t.length - e.length), O = _.reduce((e, t) => Math.max(e, t.length), 0), y = ["0011", "001", "011", "00", "810"];
|
|
4
|
+
function R(e) {
|
|
5
|
+
return e && u.includes(e) ? e : c;
|
|
7
6
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
7
|
+
function C(e) {
|
|
8
|
+
if (typeof Intl > "u" || typeof Intl.DisplayNames > "u")
|
|
9
|
+
return null;
|
|
10
|
+
try {
|
|
11
|
+
const t = Array.isArray(e) ? e : e ? [e] : void 0;
|
|
12
|
+
return new Intl.DisplayNames(t, {
|
|
13
|
+
type: "region"
|
|
14
|
+
});
|
|
15
|
+
} catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
10
18
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return
|
|
19
|
+
function N(e) {
|
|
20
|
+
const t = C(e), r = C("en");
|
|
21
|
+
return u.map((n) => {
|
|
22
|
+
const a = s(n), o = t?.of(n) ?? r?.of(n) ?? n, i = r?.of(n) ?? o, g = D(n), l = Array.from(new Set([o, i, n.toUpperCase(), n.toLowerCase(), ...g].filter(Boolean)));
|
|
23
|
+
return {
|
|
24
|
+
value: n,
|
|
25
|
+
name: o,
|
|
26
|
+
dialCode: a,
|
|
27
|
+
label: `${o} (+${a})`,
|
|
28
|
+
flag: A(n),
|
|
29
|
+
searchableTokens: l,
|
|
30
|
+
normalizedSearchableTokens: l.map((p) => U(p))
|
|
31
|
+
};
|
|
32
|
+
}).sort((n, a) => {
|
|
33
|
+
const o = d(n.value), i = d(a.value);
|
|
34
|
+
return o !== i ? o - i : n.name.localeCompare(a.name);
|
|
35
|
+
});
|
|
14
36
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
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();
|
|
37
|
+
function d(e) {
|
|
38
|
+
return e === "US" ? 0 : e === "CA" ? 1 : s(e) === "1" ? 2 : 3;
|
|
26
39
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
JE: "GB",
|
|
30
|
-
IM: "GB"
|
|
31
|
-
};
|
|
32
|
-
function y(t) {
|
|
33
|
-
if (t)
|
|
34
|
-
return O[t] ?? t;
|
|
40
|
+
function b(e) {
|
|
41
|
+
return e ? Array.isArray(e) ? e.join("\0") : e : m;
|
|
35
42
|
}
|
|
36
|
-
function
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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);
|
|
43
|
+
function L(e) {
|
|
44
|
+
if (e !== m) {
|
|
45
|
+
if (e.includes("\0")) {
|
|
46
|
+
const t = e.split("\0").filter(Boolean);
|
|
47
|
+
return t.length === 0 ? void 0 : t.length === 1 ? t[0] ?? void 0 : t;
|
|
48
|
+
}
|
|
49
|
+
return e;
|
|
49
50
|
}
|
|
50
|
-
if (r.length !== 0)
|
|
51
|
-
return e && r.includes(e) ? e : r.includes(x) ? x : r[0];
|
|
52
51
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return !1;
|
|
60
|
-
const o = t.slice(s.length + 1), i = e.startsWith(s) ? e.slice(s.length) : e;
|
|
61
|
-
return o === i;
|
|
52
|
+
function v(e, t) {
|
|
53
|
+
const r = f.get(t);
|
|
54
|
+
if (r)
|
|
55
|
+
return r;
|
|
56
|
+
const n = N(e);
|
|
57
|
+
return f.set(t, n), n;
|
|
62
58
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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;
|
|
59
|
+
function F(e) {
|
|
60
|
+
return {
|
|
61
|
+
code: e.value,
|
|
62
|
+
name: e.name,
|
|
63
|
+
dialCode: e.dialCode,
|
|
64
|
+
flag: e.flag
|
|
65
|
+
};
|
|
107
66
|
}
|
|
108
|
-
function
|
|
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);
|
|
67
|
+
function M(e) {
|
|
124
68
|
return {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
detectedCountry: n,
|
|
130
|
-
inferredCountry: r,
|
|
131
|
-
hasExplicitInternationalPrefix: s
|
|
69
|
+
code: e,
|
|
70
|
+
name: e,
|
|
71
|
+
dialCode: s(e),
|
|
72
|
+
flag: A(e)
|
|
132
73
|
};
|
|
133
74
|
}
|
|
134
|
-
function
|
|
135
|
-
|
|
75
|
+
function A(e) {
|
|
76
|
+
const t = e?.toUpperCase();
|
|
77
|
+
if (!t || t.length !== 2 || /[^A-Z]/.test(t))
|
|
78
|
+
return "";
|
|
79
|
+
const r = 127397;
|
|
80
|
+
return String.fromCodePoint(t.charCodeAt(0) + r, t.charCodeAt(1) + r);
|
|
136
81
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
82
|
+
const S = /[\u0300-\u036f]/g;
|
|
83
|
+
function h(e) {
|
|
84
|
+
return e.normalize("NFD").replace(S, "");
|
|
85
|
+
}
|
|
86
|
+
function U(e) {
|
|
87
|
+
return h(e).toLowerCase();
|
|
145
88
|
}
|
|
146
|
-
function
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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: "" };
|
|
89
|
+
function B(e, t) {
|
|
90
|
+
let r = Number.MAX_SAFE_INTEGER;
|
|
91
|
+
for (const n of e) {
|
|
92
|
+
const a = n.indexOf(t);
|
|
93
|
+
a >= 0 && a < r && (r = a);
|
|
170
94
|
}
|
|
171
|
-
return r
|
|
95
|
+
return r === Number.MAX_SAFE_INTEGER ? Number.MAX_SAFE_INTEGER : r;
|
|
172
96
|
}
|
|
173
|
-
function
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
97
|
+
function D(e) {
|
|
98
|
+
switch (e) {
|
|
99
|
+
case "US":
|
|
100
|
+
return ["USA", "United States", "America", "United States of America"];
|
|
101
|
+
case "GB":
|
|
102
|
+
return ["UK", "United Kingdom", "Great Britain", "England"];
|
|
103
|
+
case "AE":
|
|
104
|
+
return ["UAE", "United Arab Emirates"];
|
|
105
|
+
case "KR":
|
|
106
|
+
return ["South Korea", "Korea"];
|
|
107
|
+
case "CN":
|
|
108
|
+
return ["China", "PRC"];
|
|
109
|
+
case "CD":
|
|
110
|
+
return ["DRC", "Congo-Kinshasa"];
|
|
111
|
+
case "CG":
|
|
112
|
+
return ["Congo-Brazzaville"];
|
|
113
|
+
case "BR":
|
|
114
|
+
return ["Brazil"];
|
|
115
|
+
default:
|
|
116
|
+
return [];
|
|
117
|
+
}
|
|
178
118
|
}
|
|
179
119
|
export {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
120
|
+
y as COMMON_IDD_PREFIXES,
|
|
121
|
+
_ as COUNTRY_DIAL_CODES,
|
|
122
|
+
c as DEFAULT_COUNTRY,
|
|
123
|
+
O as MAX_DIAL_CODE_LENGTH,
|
|
124
|
+
M as buildFallbackSelectedCountry,
|
|
125
|
+
v as getCachedCountryOptions,
|
|
126
|
+
b as getLocaleCacheKey,
|
|
127
|
+
R as getValidCountry,
|
|
128
|
+
U as normalizeSearchValue,
|
|
129
|
+
B as optionMatchIndex,
|
|
130
|
+
L as parseLocaleCacheKey,
|
|
131
|
+
F as toSelectedCountry
|
|
189
132
|
};
|
|
190
133
|
//# sourceMappingURL=index39.js.map
|
package/dist/index39.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index39.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;AAEO,SAASE,EACdC,GACAC,GACAC,IAA+B,CAAA,GAC/B;AAGA,QAAM,EAAE,OAAAC,IAAQ,GAAA,IAAUD,GACpBE,IAAS,IAAIH,CAAQ;AAM3B,MAJI,CAACD,EAAc,WAAWI,CAAM,KAIhC,CAACD;AACH,WAAOH;AAGT,QAAMK,IAAYL,EAAc,MAAMI,EAAO,MAAM,EAAE,UAAA;AAGrD,MAFwBC,EAAU,WAAW,GAAG;AAG9C,WAAOL;AAGT,MAAI,CAACK;AACH,WAAO,GAAGD,CAA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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;"}
|
|
1
|
+
{"version":3,"file":"index39.js","sources":["../src/components/PhoneNumberInput/country-options.ts"],"sourcesContent":["import type { CountryCode } from \"libphonenumber-js\"\nimport { getCountryCallingCode } from \"libphonenumber-js\"\n\nimport type { CountryOption, PhoneNumberSelectedCountry } from \"./types\"\nimport { getCountryList } from \"./countries\"\n\n\nexport const DEFAULT_COUNTRY: CountryCode = \"US\"\nconst COUNTRY_OPTIONS = getCountryList()\n\nconst COUNTRY_OPTIONS_CACHE = new Map<string, CountryOption[]>()\nconst DEFAULT_LOCALE_CACHE_KEY = \"__default_locale__\"\nexport const COUNTRY_DIAL_CODES = Array.from(\n new Set(COUNTRY_OPTIONS.map((code) => getCountryCallingCode(code)))\n).sort((a, b) => b.length - a.length)\nexport const MAX_DIAL_CODE_LENGTH = COUNTRY_DIAL_CODES.reduce(\n (max, dial) => Math.max(max, dial.length),\n 0\n)\nexport const COMMON_IDD_PREFIXES = [\"0011\", \"001\", \"011\", \"00\", \"810\"]\n\nexport function getValidCountry(input: CountryCode | undefined) {\n if (!input) {\n return DEFAULT_COUNTRY\n }\n\n return COUNTRY_OPTIONS.includes(input) ? input : DEFAULT_COUNTRY\n}\n\nfunction createDisplayNames(locale?: string | string[]) {\n if (typeof Intl === \"undefined\" || typeof Intl.DisplayNames === \"undefined\") {\n return null\n }\n\n try {\n const locales = Array.isArray(locale) ? locale : locale ? [locale] : undefined\n return new Intl.DisplayNames(locales, { type: \"region\" })\n } catch {\n return null\n }\n}\n\nfunction buildCountryOptions(locale?: string | string[]) {\n const displayNames = createDisplayNames(locale)\n const englishDisplayNames = createDisplayNames(\"en\")\n\n return COUNTRY_OPTIONS\n .map((country) => {\n const dialCode = getCountryCallingCode(country)\n const localizedName = displayNames?.of(country) ?? englishDisplayNames?.of(country) ?? country\n const englishName = englishDisplayNames?.of(country) ?? localizedName\n const aliasTokens = getCountryAliases(country)\n const searchableTokens = Array.from(\n new Set(\n [localizedName, englishName, country.toUpperCase(), country.toLowerCase(), ...aliasTokens].filter(\n Boolean\n )\n )\n ) as string[]\n return {\n value: country,\n name: localizedName,\n dialCode,\n label: `${localizedName} (+${dialCode})`,\n flag: countryCodeToFlagEmoji(country),\n searchableTokens,\n normalizedSearchableTokens: searchableTokens.map((token) => normalizeSearchValue(token)),\n }\n })\n .sort((a, b) => {\n const priorityA = getCountryPriority(a.value)\n const priorityB = getCountryPriority(b.value)\n if (priorityA !== priorityB) {\n return priorityA - priorityB\n }\n return a.name.localeCompare(b.name)\n })\n}\n\nfunction getCountryPriority(code: CountryCode) {\n if (code === \"US\") return 0\n if (code === \"CA\") return 1\n if (getCountryCallingCode(code) === \"1\") return 2\n return 3\n}\n\nexport function getLocaleCacheKey(locale?: string | string[]) {\n if (!locale) {\n return DEFAULT_LOCALE_CACHE_KEY\n }\n if (Array.isArray(locale)) {\n return locale.join(\"\\u0000\")\n }\n return locale\n}\n\nexport function parseLocaleCacheKey(cacheKey: string): string | string[] | undefined {\n if (cacheKey === DEFAULT_LOCALE_CACHE_KEY) {\n return undefined\n }\n\n if (cacheKey.includes(\"\\u0000\")) {\n const parts = cacheKey.split(\"\\u0000\").filter(Boolean)\n if (parts.length === 0) {\n return undefined\n }\n if (parts.length === 1) {\n return parts[0] ?? undefined\n }\n return parts\n }\n\n return cacheKey\n}\n\nexport function getCachedCountryOptions(locale: string | string[] | undefined, cacheKey: string) {\n const cached = COUNTRY_OPTIONS_CACHE.get(cacheKey)\n if (cached) {\n return cached\n }\n const built = buildCountryOptions(locale)\n COUNTRY_OPTIONS_CACHE.set(cacheKey, built)\n return built\n}\n\nexport function toSelectedCountry(option: CountryOption): PhoneNumberSelectedCountry {\n return {\n code: option.value,\n name: option.name,\n dialCode: option.dialCode,\n flag: option.flag,\n }\n}\n\nexport function buildFallbackSelectedCountry(country: CountryCode): PhoneNumberSelectedCountry {\n return {\n code: country,\n name: country,\n dialCode: getCountryCallingCode(country),\n flag: countryCodeToFlagEmoji(country),\n }\n}\n\nfunction countryCodeToFlagEmoji(country: CountryCode) {\n const upper = country?.toUpperCase()\n\n if (!upper || upper.length !== 2 || /[^A-Z]/.test(upper)) {\n return \"\"\n }\n\n const base = 127397\n return String.fromCodePoint(\n upper.charCodeAt(0) + base,\n upper.charCodeAt(1) + base\n )\n}\n\nconst DIACRITICS_REGEX = /[\\u0300-\\u036f]/g\n\nfunction stripDiacritics(value: string) {\n return value.normalize(\"NFD\").replace(DIACRITICS_REGEX, \"\")\n}\n\nexport function normalizeSearchValue(value: string) {\n return stripDiacritics(value).toLowerCase()\n}\n\nexport function optionMatchIndex(tokens: string[], query: string) {\n let best = Number.MAX_SAFE_INTEGER\n for (const token of tokens) {\n const index = token.indexOf(query)\n if (index >= 0 && index < best) {\n best = index\n }\n }\n return best === Number.MAX_SAFE_INTEGER ? Number.MAX_SAFE_INTEGER : best\n}\n\nfunction getCountryAliases(code: CountryCode): string[] {\n switch (code) {\n case \"US\":\n return [\"USA\", \"United States\", \"America\", \"United States of America\"]\n case \"GB\":\n return [\"UK\", \"United Kingdom\", \"Great Britain\", \"England\"]\n case \"AE\":\n return [\"UAE\", \"United Arab Emirates\"]\n case \"KR\":\n return [\"South Korea\", \"Korea\"]\n case \"CN\":\n return [\"China\", \"PRC\"]\n case \"CD\":\n return [\"DRC\", \"Congo-Kinshasa\"]\n case \"CG\":\n return [\"Congo-Brazzaville\"]\n case \"BR\":\n return [\"Brazil\"]\n default:\n return []\n }\n}\n\n"],"names":["DEFAULT_COUNTRY","COUNTRY_OPTIONS","getCountryList","COUNTRY_OPTIONS_CACHE","Map","DEFAULT_LOCALE_CACHE_KEY","COUNTRY_DIAL_CODES","Array","from","Set","map","code","getCountryCallingCode","sort","a","b","length","MAX_DIAL_CODE_LENGTH","reduce","max","dial","Math","COMMON_IDD_PREFIXES","getValidCountry","input","includes","createDisplayNames","locale","Intl","DisplayNames","locales","isArray","undefined","type","buildCountryOptions","displayNames","englishDisplayNames","country","dialCode","localizedName","of","englishName","aliasTokens","getCountryAliases","searchableTokens","toUpperCase","toLowerCase","filter","Boolean","value","name","label","flag","countryCodeToFlagEmoji","normalizedSearchableTokens","token","normalizeSearchValue","priorityA","getCountryPriority","priorityB","localeCompare","getLocaleCacheKey","join","parseLocaleCacheKey","cacheKey","parts","split","getCachedCountryOptions","cached","get","built","set","toSelectedCountry","option","buildFallbackSelectedCountry","upper","test","base","String","fromCodePoint","charCodeAt","DIACRITICS_REGEX","stripDiacritics","normalize","replace","optionMatchIndex","tokens","query","best","Number","MAX_SAFE_INTEGER","index","indexOf"],"mappings":";;AAOO,MAAMA,IAA+B,MACtCC,IAAkBC,EAAAA,GAElBC,wBAA4BC,IAAAA,GAC5BC,IAA2B,sBACpBC,IAAqBC,MAAMC,KACtC,IAAIC,IAAIR,EAAgBS,IAAKC,OAASC,EAAsBD,CAAI,CAAC,CAAC,CACpE,EAAEE,KAAK,CAACC,GAAGC,MAAMA,EAAEC,SAASF,EAAEE,MAAM,GACvBC,IAAuBX,EAAmBY,OACrD,CAACC,GAA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;AACH,aAAO,CAAC,mBAAmB;AAAA,IAC7B,KAAK;AACH,aAAO,CAAC,QAAQ;AAAA,IAClB;AACE,aAAO,CAAA;AAAA,EAAA;AAEb;"}
|
package/dist/index4.js
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { c as m } from "./index28.js";
|
|
2
|
+
import { useState as h, useEffect as p } from "react";
|
|
3
|
+
const v = "(pointer: coarse)";
|
|
4
|
+
function w() {
|
|
5
|
+
const t = m.c(2), [s, r] = h(!1);
|
|
6
|
+
let o, i;
|
|
7
|
+
return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = () => {
|
|
6
8
|
if (typeof window > "u")
|
|
7
9
|
return;
|
|
8
|
-
const e = typeof window.matchMedia == "function" ? window.matchMedia(
|
|
10
|
+
const e = typeof window.matchMedia == "function" ? window.matchMedia(v) : void 0, a = () => {
|
|
9
11
|
if (typeof window > "u")
|
|
10
12
|
return !1;
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
},
|
|
14
|
-
|
|
13
|
+
const u = e?.matches ?? !1, c = typeof navigator < "u" ? navigator : void 0, f = c?.maxTouchPoints ?? 0, d = c?.msMaxTouchPoints ?? 0;
|
|
14
|
+
return u || f > 0 || d > 0;
|
|
15
|
+
}, n = () => {
|
|
16
|
+
r(a());
|
|
15
17
|
};
|
|
16
|
-
if (
|
|
18
|
+
if (n(), !!e) {
|
|
17
19
|
if (typeof e.addEventListener == "function")
|
|
18
|
-
return e.addEventListener("change",
|
|
20
|
+
return e.addEventListener("change", n), () => e.removeEventListener("change", n);
|
|
19
21
|
if (typeof e.addListener == "function")
|
|
20
|
-
return e.addListener(
|
|
22
|
+
return e.addListener(n), () => e.removeListener(n);
|
|
21
23
|
}
|
|
22
|
-
}, []), o;
|
|
24
|
+
}, i = [], t[0] = o, t[1] = i) : (o = t[0], i = t[1]), p(o, i), s;
|
|
23
25
|
}
|
|
24
26
|
export {
|
|
25
|
-
|
|
27
|
+
w as useIsTouchDevice
|
|
26
28
|
};
|
|
27
29
|
//# sourceMappingURL=index4.js.map
|
package/dist/index4.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index4.js","sources":["../src/helpers/useIsTouchDevice.ts"],"sourcesContent":["import { useEffect, useState } from \"react\"\n\n\nconst TOUCH_MEDIA_QUERY = \"(pointer: coarse)\"\n\nexport function useIsTouchDevice() {\n const [isTouchDevice, setIsTouchDevice] = useState(false)\n\n // React Compiler rejects hook aliasing (useIsomorphicLayoutEffect pattern), so we keep\n // a direct hook call and guard browser-only logic inside the effect.\n useEffect(() => {\n if (typeof window === \"undefined\") {\n return\n }\n\n const mediaQuery =\n typeof window.matchMedia === \"function\" ? window.matchMedia(TOUCH_MEDIA_QUERY) : undefined\n\n const getHasTouchSupport = () => {\n if (typeof window === \"undefined\") {\n return false\n }\n\n const mqMatches = mediaQuery?.matches ?? false\n const nav = typeof navigator !== \"undefined\" ? navigator : undefined\n const maxTouchPoints = nav?.maxTouchPoints ?? 0\n const msMaxTouchPoints = (nav as unknown as { msMaxTouchPoints?: number })?.msMaxTouchPoints ?? 0\n\n return mqMatches || maxTouchPoints > 0 || msMaxTouchPoints > 0\n }\n\n const updateIsTouchDevice = () => {\n setIsTouchDevice(getHasTouchSupport())\n }\n\n updateIsTouchDevice()\n\n if (!mediaQuery) {\n return\n }\n\n if (typeof mediaQuery.addEventListener === \"function\") {\n mediaQuery.addEventListener(\"change\", updateIsTouchDevice)\n return () => mediaQuery.removeEventListener(\"change\", updateIsTouchDevice)\n }\n\n if (typeof mediaQuery.addListener === \"function\") {\n mediaQuery.addListener(updateIsTouchDevice)\n return () => mediaQuery.removeListener(updateIsTouchDevice)\n }\n }, [])\n\n return isTouchDevice\n}\n"],"names":["TOUCH_MEDIA_QUERY","useIsTouchDevice","isTouchDevice","setIsTouchDevice","useState","
|
|
1
|
+
{"version":3,"file":"index4.js","sources":["../src/helpers/useIsTouchDevice.ts"],"sourcesContent":["import { useEffect, useState } from \"react\"\n\n\nconst TOUCH_MEDIA_QUERY = \"(pointer: coarse)\"\n\nexport function useIsTouchDevice() {\n const [isTouchDevice, setIsTouchDevice] = useState(false)\n\n // React Compiler rejects hook aliasing (useIsomorphicLayoutEffect pattern), so we keep\n // a direct hook call and guard browser-only logic inside the effect.\n useEffect(() => {\n if (typeof window === \"undefined\") {\n return\n }\n\n const mediaQuery =\n typeof window.matchMedia === \"function\" ? window.matchMedia(TOUCH_MEDIA_QUERY) : undefined\n\n const getHasTouchSupport = () => {\n if (typeof window === \"undefined\") {\n return false\n }\n\n const mqMatches = mediaQuery?.matches ?? false\n const nav = typeof navigator !== \"undefined\" ? navigator : undefined\n const maxTouchPoints = nav?.maxTouchPoints ?? 0\n const msMaxTouchPoints = (nav as unknown as { msMaxTouchPoints?: number })?.msMaxTouchPoints ?? 0\n\n return mqMatches || maxTouchPoints > 0 || msMaxTouchPoints > 0\n }\n\n const updateIsTouchDevice = () => {\n setIsTouchDevice(getHasTouchSupport())\n }\n\n updateIsTouchDevice()\n\n if (!mediaQuery) {\n return\n }\n\n if (typeof mediaQuery.addEventListener === \"function\") {\n mediaQuery.addEventListener(\"change\", updateIsTouchDevice)\n return () => mediaQuery.removeEventListener(\"change\", updateIsTouchDevice)\n }\n\n if (typeof mediaQuery.addListener === \"function\") {\n mediaQuery.addListener(updateIsTouchDevice)\n return () => mediaQuery.removeListener(updateIsTouchDevice)\n }\n }, [])\n\n return isTouchDevice\n}\n"],"names":["TOUCH_MEDIA_QUERY","useIsTouchDevice","$","_c","isTouchDevice","setIsTouchDevice","useState","t0","t1","Symbol","for","window","mediaQuery","matchMedia","undefined","getHasTouchSupport","mqMatches","matches","nav","navigator","maxTouchPoints","msMaxTouchPoints","updateIsTouchDevice","addEventListener","removeEventListener","addListener","removeListener","useEffect"],"mappings":";;AAGA,MAAMA,IAAoB;AAEnB,SAAAC,IAAA;AAAA,QAAAC,IAAAC,EAAAA,EAAA,CAAA,GACL,CAAAC,GAAAC,CAAA,IAA0CC,EAAS,EAAK;AAAC,MAAAC,GAAAC;AAAA,SAAAN,EAAA,CAAA,MAAAO,uBAAAC,IAAA,2BAAA,KAI/CH,IAAAA,MAAA;AACR,QAAI,OAAOI,SAAW;AAAW;AAIjC,UAAAC,IACE,OAAOD,OAAME,cAAgB,aAAaF,OAAME,WAAYb,CAA6B,IAAzFc,QAEFC,IAA2BA,MAAA;AACzB,UAAI,OAAOJ,SAAW;AAAW,eACxB;AAGT,YAAAK,IAAkBJ,GAAUK,WAAV,IAClBC,IAAY,OAAOC,YAAc,MAArBA,YAAAL,QACZM,IAAuBF,GAAGE,kBAAH,GACvBC,IAA0BH,GAAkEG,oBAAnE;AAAwE,aAE1FL,KAAaI,IAAiB,KAAKC,IAAmB;AAAA,IAAC,GAGhEC,IAA4BA,MAAA;AAC1BjB,MAAAA,EAAiBU,GAAoB;AAAA,IAAC;AAKxC,QAFAO,EAAAA,GAEI,EAACV,GAIL;AAAA,UAAI,OAAOA,EAAUW,oBAAsB;AACzCX,eAAAA,EAAUW,iBAAkB,UAAUD,CAAmB,GAClD,MAAMV,EAAUY,oBAAqB,UAAUF,CAAmB;AAG3E,UAAI,OAAOV,EAAUa,eAAiB;AACpCb,eAAAA,EAAUa,YAAaH,CAAmB,GACnC,MAAMV,EAAUc,eAAgBJ,CAAmB;AAAA;AAAA,EAC3D,GACAd,IAAA,CAAA,GAAEN,OAAAK,GAAAL,OAAAM,MAAAD,IAAAL,EAAA,CAAA,GAAAM,IAAAN,EAAA,CAAA,IAxCLyB,EAAUpB,GAwCPC,CAAE,GAEEJ;AAAa;"}
|