@rpcbase/ui 0.189.0 → 0.191.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/components/FilesUploadField/index.d.ts.map +1 -1
- package/dist/index100.js +420 -139
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +149 -71
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +74 -229
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +262 -9
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +9 -42
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +42 -4
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +4 -46
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +597 -197
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +52 -22
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +4 -24
- package/dist/index109.js.map +1 -1
- package/dist/index110.js +4 -399
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +15 -46
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +6 -52
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +6 -3
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +16 -4
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +4 -15
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +4 -5
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +5 -7
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +5 -16
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +4 -4
- package/dist/index119.js.map +1 -1
- package/dist/index120.js +4 -4
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +6 -5
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +24 -5
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +6 -4
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +2 -2
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +5 -5
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +5 -24
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +4 -6
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +5 -4
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +4 -6
- package/dist/index129.js.map +1 -1
- package/dist/index130.js +8 -5
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +4 -3
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +4 -5
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +3 -3
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +6 -8
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +145 -5
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +39 -4
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +4 -4
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +7 -6
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +13 -145
- package/dist/index139.js.map +1 -1
- package/dist/index140.js +13 -39
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +7 -4
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +29 -5
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +10 -13
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +10 -13
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +8 -7
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +13 -31
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +101 -10
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +20 -11
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +53 -8
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +55 -54
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +70 -11
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +9 -101
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +21 -20
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +15 -52
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +23 -72
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +6 -9
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +5 -20
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +23 -16
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +35 -24
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +16 -7
- package/dist/index159.js.map +1 -1
- package/dist/index160.js +6 -5
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +4 -23
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +5 -35
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +5 -16
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +4 -6
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +3 -4
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +6 -4
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +24 -5
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +7 -4
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +6 -3
- package/dist/index169.js.map +1 -1
- package/dist/index170.js +5 -6
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +4 -24
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +3 -7
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +4 -6
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +3 -5
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +4 -3
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +3 -3
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +3 -4
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +3 -3
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +24 -4
- package/dist/index179.js.map +1 -1
- package/dist/index180.js +29 -4
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +5 -4
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +13 -3
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +148 -61
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +27 -177
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +9 -46
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +46 -12
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +10 -153
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +42 -28
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +95 -9
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +82 -43
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +104 -10
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +50 -42
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +10 -94
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +33 -82
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +8 -105
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +110 -46
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +17 -11
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +13 -35
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +3 -8
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +6 -6
- package/dist/index200.js +32 -112
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +20 -17
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +9 -15
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +8 -3
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +14 -31
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +27 -19
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +15 -8
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +66 -7
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +179 -18
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +44 -26
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +1 -1
- package/dist/index210.js +15 -15
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +5 -24
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +6 -29
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +59 -5
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +64 -14
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +6 -5
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +4 -5
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +7 -58
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +17 -66
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +5 -6
- package/dist/index219.js.map +1 -1
- package/dist/index22.js +1 -1
- package/dist/index220.js +5 -4
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +13 -7
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +9 -16
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +14 -5
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +14 -5
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +5 -13
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +5 -9
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +7 -14
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +6 -14
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +9 -5
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +5 -6
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +5 -7
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +9 -6
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +5 -9
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +5 -5
- 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 -9
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +10 -5
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +10 -5
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +11 -4
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +1 -1
- package/dist/index240.js +11 -11
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +10 -10
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +7 -10
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +6 -11
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +5 -11
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +6 -10
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +7 -7
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +6 -6
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +55 -5
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +8 -6
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +19 -7
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +29 -6
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +12 -55
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +25 -8
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +5 -19
- package/dist/index254.js.map +1 -1
- package/dist/index259.js +3 -3
- package/dist/index265.js +1 -1
- package/dist/index266.js +2 -2
- package/dist/index268.js +3 -3
- package/dist/index270.js +5 -30
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +3 -13
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +22 -24
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +112 -5
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +15 -20
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +525 -5
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +128 -3
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +132 -22
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +19 -111
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +4 -15
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +1 -1
- package/dist/index280.js +17 -523
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +12 -127
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +61 -130
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +69 -5
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +8 -18
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +14 -13
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +65 -64
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +6 -69
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +6 -9
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +4 -14
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +15 -65
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +8 -5
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +5 -5
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +5 -4
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +545 -15
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +47 -9
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +17 -5
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +6 -4
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +8 -545
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +8 -47
- package/dist/index299.js.map +1 -1
- package/dist/index30.js +1 -1
- package/dist/index300.js +8 -17
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +12 -6
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +9 -8
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +13 -7
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +3 -8
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +22 -12
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +4 -9
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +56 -14
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +68 -4
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +31 -23
- package/dist/index309.js.map +1 -1
- package/dist/index31.js +5 -5
- package/dist/index310.js +9 -5
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +147 -50
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +106 -66
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +12 -30
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +28 -9
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +4 -152
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +22 -107
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +15 -22
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +28 -12
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +12 -27
- package/dist/index319.js.map +1 -1
- package/dist/index32.js +24 -24
- package/dist/index320.js +7 -5
- package/dist/index320.js.map +1 -1
- package/dist/index33.js +3 -3
- package/dist/index35.js +16 -2635
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +113 -377
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +204 -215
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +87 -18
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +115 -126
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +5 -221
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +836 -83
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +53 -115
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +7 -5
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +2 -844
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +12 -57
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +18 -7
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +8 -2
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +2 -12
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +22 -17
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +233 -7
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +4 -2
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +6 -23
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +46 -232
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +26 -204
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +51 -2
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +8 -2
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +14 -5
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +133 -7
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +10 -5
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +214 -51
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +13 -2
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +34 -2
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +46 -3
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +7 -6
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +48 -46
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +4 -27
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +4 -49
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +28 -8
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +50 -15
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +8 -133
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +205 -11
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +2 -217
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +2 -13
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +5 -33
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +7 -46
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +5 -7
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +2 -50
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +2 -4
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +11 -5
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +46 -27
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +204 -48
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +21 -8
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +24 -11
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +383 -589
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +46 -5
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +5 -68
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +69 -2
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +2 -364
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +303 -201
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +247 -46
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +56 -42
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +46 -169
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +156 -96
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +109 -24
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +25 -8
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +8 -5
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +4 -5
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +5 -4
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +4 -466
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
- package/dist/index321.js +0 -19
- package/dist/index321.js.map +0 -1
- package/dist/index322.js +0 -32
- package/dist/index322.js.map +0 -1
- package/dist/index323.js +0 -16
- package/dist/index323.js.map +0 -1
- package/dist/index324.js +0 -10
- package/dist/index324.js.map +0 -1
package/dist/index37.js
CHANGED
|
@@ -1,236 +1,225 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
t.forEach((r) => r(u));
|
|
8
|
-
},
|
|
9
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10
|
-
t
|
|
11
|
-
);
|
|
1
|
+
import { MAX_DIAL_CODE_LENGTH as W, COMMON_IDD_PREFIXES as $, DEFAULT_COUNTRY as x, COUNTRY_DIAL_CODES as C } from "./index36.js";
|
|
2
|
+
import { getCountryCallingCode as p } from "./index40.js";
|
|
3
|
+
import { AsYouType as I } from "./index75.js";
|
|
4
|
+
import { validatePhoneNumberLength as D } from "./index76.js";
|
|
5
|
+
function g(t) {
|
|
6
|
+
return t.replace(/\D/g, "");
|
|
12
7
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const t = Object.prototype.toString.call(n);
|
|
16
|
-
return t === "[object Window]" || // In Electron context the Window object serializes to [object global]
|
|
17
|
-
t === "[object global]";
|
|
8
|
+
function P(t) {
|
|
9
|
+
return t ? t.length > W ? !1 : C.some((e) => e.startsWith(t)) : !0;
|
|
18
10
|
}
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
const N = /[\u061C\u200B-\u200F\u202A-\u202E\u2066-\u2069\uFEFF]/g;
|
|
12
|
+
function T(t) {
|
|
13
|
+
return t.replace(N, "");
|
|
21
14
|
}
|
|
22
|
-
function
|
|
23
|
-
var t, e;
|
|
24
|
-
return n ? a(n) ? n : b(n) && (t = (e = n.ownerDocument) == null ? void 0 : e.defaultView) != null ? t : window : window;
|
|
25
|
-
}
|
|
26
|
-
function j(n) {
|
|
15
|
+
function q(t, e, s = {}) {
|
|
27
16
|
const {
|
|
28
|
-
|
|
29
|
-
} =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
e.
|
|
65
|
-
}, t), e;
|
|
66
|
-
}
|
|
67
|
-
function v(n, t) {
|
|
68
|
-
const e = o();
|
|
69
|
-
return l(
|
|
70
|
-
() => {
|
|
71
|
-
const u = n(e.current);
|
|
72
|
-
return e.current = u, u;
|
|
73
|
-
},
|
|
74
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
75
|
-
[...t]
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
function N(n) {
|
|
79
|
-
const t = M(n), e = o(null), u = i(
|
|
80
|
-
(r) => {
|
|
81
|
-
r !== e.current && t?.(r, e.current), e.current = r;
|
|
82
|
-
},
|
|
83
|
-
//eslint-disable-next-line
|
|
84
|
-
[]
|
|
85
|
-
);
|
|
86
|
-
return [e, u];
|
|
17
|
+
force: u = !1
|
|
18
|
+
} = s, o = `+${e}`;
|
|
19
|
+
if (!t.startsWith(o) || !u)
|
|
20
|
+
return t;
|
|
21
|
+
const i = t.slice(o.length).trimStart();
|
|
22
|
+
if (i.startsWith("0"))
|
|
23
|
+
return t;
|
|
24
|
+
if (!i)
|
|
25
|
+
return `${o} 0`;
|
|
26
|
+
const [n, ...r] = i.split(" "), f = `0${n ?? ""}`, l = r.length > 0 ? ` ${r.join(" ")}` : "";
|
|
27
|
+
return `${o} ${f}${l}`.replace(/\s\s+/g, " ").trimEnd();
|
|
28
|
+
}
|
|
29
|
+
const O = {
|
|
30
|
+
GG: "GB",
|
|
31
|
+
JE: "GB",
|
|
32
|
+
IM: "GB"
|
|
33
|
+
};
|
|
34
|
+
function y(t) {
|
|
35
|
+
if (t)
|
|
36
|
+
return O[t] ?? t;
|
|
37
|
+
}
|
|
38
|
+
function _(t, e, s) {
|
|
39
|
+
if (!t || !s || (t.nationalNumber ?? "").length < 4)
|
|
40
|
+
return;
|
|
41
|
+
const o = t.countryCallingCode;
|
|
42
|
+
if (!o)
|
|
43
|
+
return;
|
|
44
|
+
const i = t.getMetadata, n = (typeof i == "function" ? i() : null)?.country_calling_codes?.[o];
|
|
45
|
+
if (!n || n.length === 0)
|
|
46
|
+
return;
|
|
47
|
+
const r = [];
|
|
48
|
+
for (const f of n) {
|
|
49
|
+
const l = y(f);
|
|
50
|
+
l && !r.includes(l) && r.push(l);
|
|
51
|
+
}
|
|
52
|
+
if (r.length !== 0)
|
|
53
|
+
return e && r.includes(e) ? e : r.includes(x) ? x : r[0];
|
|
87
54
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
55
|
+
function B(t, e, s, u) {
|
|
56
|
+
if (!t)
|
|
57
|
+
return !1;
|
|
58
|
+
if (!u)
|
|
59
|
+
return t.startsWith("0");
|
|
60
|
+
if (!s || !t.startsWith(s) || !t.slice(s.length).startsWith("0"))
|
|
61
|
+
return !1;
|
|
62
|
+
const o = t.slice(s.length + 1), i = e.startsWith(s) ? e.slice(s.length) : e;
|
|
63
|
+
return o === i;
|
|
93
64
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const e = f[n] == null ? 0 : f[n] + 1;
|
|
100
|
-
return f[n] = e, n + "-" + e;
|
|
101
|
-
}, [n, t]);
|
|
65
|
+
function S(t) {
|
|
66
|
+
for (const e of $)
|
|
67
|
+
if (t.startsWith(e))
|
|
68
|
+
return t.slice(e.length);
|
|
69
|
+
return t;
|
|
102
70
|
}
|
|
103
|
-
function
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
71
|
+
function M(t, e, s = {}) {
|
|
72
|
+
const {
|
|
73
|
+
allowJustPlus: u = !1,
|
|
74
|
+
removeNationalPrefix: o = !0,
|
|
75
|
+
previousValue: i
|
|
76
|
+
} = s, n = T(t).trim();
|
|
77
|
+
if (!n)
|
|
78
|
+
return "";
|
|
79
|
+
if (n === "+")
|
|
80
|
+
return u ? "+" : "";
|
|
81
|
+
if (n.startsWith("+")) {
|
|
82
|
+
const a = g(n);
|
|
83
|
+
if (!a)
|
|
84
|
+
return u ? "+" : "";
|
|
85
|
+
const d = S(a);
|
|
86
|
+
if (d !== a)
|
|
87
|
+
return d ? `+${d}` : u ? "+" : "";
|
|
88
|
+
if (o && e) {
|
|
89
|
+
const h = p(e);
|
|
90
|
+
if (a.startsWith(h) && a.slice(h.length).startsWith("0")) {
|
|
91
|
+
const E = a.slice(h.length + 1);
|
|
92
|
+
return E ? `+${h}${E}` : `+${h}`;
|
|
112
93
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
94
|
+
}
|
|
95
|
+
return `+${a}`;
|
|
96
|
+
}
|
|
97
|
+
const r = g(n);
|
|
98
|
+
if (!r)
|
|
99
|
+
return "";
|
|
100
|
+
const f = S(r);
|
|
101
|
+
if (f !== r)
|
|
102
|
+
return f ? `+${f}` : u ? "+" : "";
|
|
103
|
+
const l = typeof i == "string" ? i : "", m = l && l.startsWith("+") ? g(l) : "";
|
|
104
|
+
if (m && m.length > r.length && m.endsWith(r) && m.length - r.length <= W)
|
|
105
|
+
return `+${r}`;
|
|
106
|
+
if (r === "0")
|
|
107
|
+
return "0";
|
|
108
|
+
if (o && e && r.length > 1 && r.startsWith("0") && !r.startsWith("00")) {
|
|
109
|
+
const a = p(e), d = r.slice(1);
|
|
110
|
+
return d ? `+${a}${d}` : `+${a}`;
|
|
111
|
+
}
|
|
112
|
+
return e ? r.length <= 4 ? `+${r}` : `+${p(e)}${r}` : r;
|
|
113
|
+
}
|
|
114
|
+
function Y(t, e) {
|
|
115
|
+
if (t === "+")
|
|
116
|
+
return {
|
|
117
|
+
international: "+",
|
|
118
|
+
national: "",
|
|
119
|
+
formatted: "+",
|
|
120
|
+
phoneNumber: null,
|
|
121
|
+
detectedCountry: void 0,
|
|
122
|
+
inferredCountry: void 0,
|
|
123
|
+
hasExplicitInternationalPrefix: !0
|
|
124
|
+
};
|
|
125
|
+
const s = /^\s*\+/.test(t), u = e ? new I(e) : new I(), o = u.input(t), i = u.getNumber(), c = g(t), n = y(i?.country ?? u.country ?? void 0), r = n ?? !i ? void 0 : y(_(i, e, c)), f = i?.formatInternational() ?? o, l = i?.formatNational() ?? g(f);
|
|
126
|
+
return {
|
|
127
|
+
international: f,
|
|
128
|
+
national: l,
|
|
129
|
+
formatted: o,
|
|
130
|
+
phoneNumber: i,
|
|
131
|
+
detectedCountry: n,
|
|
132
|
+
inferredCountry: r,
|
|
133
|
+
hasExplicitInternationalPrefix: s
|
|
117
134
|
};
|
|
118
135
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return "clientX" in n && "clientY" in n;
|
|
136
|
+
function v(t, e) {
|
|
137
|
+
return t.startsWith(e) ? t.slice(e.length) : t;
|
|
122
138
|
}
|
|
123
|
-
function
|
|
124
|
-
if (!
|
|
125
|
-
return
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
139
|
+
function H(t, e) {
|
|
140
|
+
if (!e || !t)
|
|
141
|
+
return null;
|
|
142
|
+
try {
|
|
143
|
+
return D(t, e) === "TOO_LONG" ? "TOO_LONG" : null;
|
|
144
|
+
} catch {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
130
147
|
}
|
|
131
|
-
function
|
|
132
|
-
if (!n)
|
|
133
|
-
return !1;
|
|
148
|
+
function U(t, e, s, u = {}) {
|
|
134
149
|
const {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
hasRemovedNationalPrefix: o = !1,
|
|
151
|
+
detectedCountry: i,
|
|
152
|
+
hasExplicitInternationalPrefix: c = !1
|
|
153
|
+
} = u;
|
|
154
|
+
if (!t)
|
|
155
|
+
return {
|
|
156
|
+
shouldSuggest: !1,
|
|
157
|
+
query: ""
|
|
158
|
+
};
|
|
159
|
+
if (t === "+")
|
|
160
|
+
return {
|
|
161
|
+
shouldSuggest: !0,
|
|
162
|
+
query: ""
|
|
163
|
+
};
|
|
164
|
+
const n = g(t);
|
|
165
|
+
if (!n)
|
|
166
|
+
return {
|
|
167
|
+
shouldSuggest: !0,
|
|
168
|
+
query: ""
|
|
169
|
+
};
|
|
170
|
+
if (o)
|
|
171
|
+
return {
|
|
172
|
+
shouldSuggest: !1,
|
|
173
|
+
query: ""
|
|
174
|
+
};
|
|
175
|
+
if (c && !i)
|
|
176
|
+
return P(n) ? {
|
|
177
|
+
shouldSuggest: !0,
|
|
178
|
+
query: n
|
|
179
|
+
} : {
|
|
180
|
+
shouldSuggest: !1,
|
|
181
|
+
query: ""
|
|
182
|
+
};
|
|
183
|
+
let r = s?.countryCallingCode ?? null;
|
|
184
|
+
if (!r) {
|
|
185
|
+
if (e) {
|
|
186
|
+
const l = p(e);
|
|
187
|
+
n.startsWith(l) && (r = l);
|
|
188
|
+
} else if (!c)
|
|
155
189
|
return {
|
|
156
|
-
|
|
157
|
-
|
|
190
|
+
shouldSuggest: !1,
|
|
191
|
+
query: ""
|
|
158
192
|
};
|
|
159
|
-
}
|
|
160
193
|
}
|
|
161
|
-
return
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
} :
|
|
194
|
+
return r ? v(n, r).length === 0 ? {
|
|
195
|
+
shouldSuggest: !0,
|
|
196
|
+
query: n
|
|
197
|
+
} : {
|
|
198
|
+
shouldSuggest: !1,
|
|
199
|
+
query: ""
|
|
200
|
+
} : {
|
|
201
|
+
shouldSuggest: !0,
|
|
202
|
+
query: n
|
|
203
|
+
};
|
|
165
204
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
} = n;
|
|
175
|
-
return "translate3d(" + (t ? Math.round(t) : 0) + "px, " + (e ? Math.round(e) : 0) + "px, 0)";
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
Scale: {
|
|
179
|
-
toString(n) {
|
|
180
|
-
if (!n)
|
|
181
|
-
return;
|
|
182
|
-
const {
|
|
183
|
-
scaleX: t,
|
|
184
|
-
scaleY: e
|
|
185
|
-
} = n;
|
|
186
|
-
return "scaleX(" + t + ") scaleY(" + e + ")";
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
Transform: {
|
|
190
|
-
toString(n) {
|
|
191
|
-
if (n)
|
|
192
|
-
return [w.Translate.toString(n), w.Scale.toString(n)].join(" ");
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
Transition: {
|
|
196
|
-
toString(n) {
|
|
197
|
-
let {
|
|
198
|
-
property: t,
|
|
199
|
-
duration: e,
|
|
200
|
-
easing: u
|
|
201
|
-
} = n;
|
|
202
|
-
return t + " " + e + "ms " + u;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}), h = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
|
|
206
|
-
function K(n) {
|
|
207
|
-
return n.matches(h) ? n : n.querySelector(h);
|
|
205
|
+
function V(t, e) {
|
|
206
|
+
if (t.shouldSuggest)
|
|
207
|
+
return !1;
|
|
208
|
+
const {
|
|
209
|
+
hasExplicitInternationalPrefix: s = !1,
|
|
210
|
+
detectedCountry: u
|
|
211
|
+
} = e;
|
|
212
|
+
return s ? !!u : !0;
|
|
208
213
|
}
|
|
209
214
|
export {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
C as isHTMLElement,
|
|
220
|
-
z as isKeyboardEvent,
|
|
221
|
-
b as isNode,
|
|
222
|
-
L as isSVGElement,
|
|
223
|
-
V as isTouchEvent,
|
|
224
|
-
a as isWindow,
|
|
225
|
-
q as subtract,
|
|
226
|
-
Y as useCombinedRefs,
|
|
227
|
-
M as useEvent,
|
|
228
|
-
A as useInterval,
|
|
229
|
-
E as useIsomorphicLayoutEffect,
|
|
230
|
-
I as useLatestValue,
|
|
231
|
-
v as useLazyMemo,
|
|
232
|
-
N as useNodeRef,
|
|
233
|
-
F as usePrevious,
|
|
234
|
-
H as useUniqueId
|
|
215
|
+
B as detectNationalPrefixForDisplay,
|
|
216
|
+
Y as formatWithAsYouType,
|
|
217
|
+
H as getLengthIssue,
|
|
218
|
+
U as getSuggestionState,
|
|
219
|
+
q as injectNationalPrefixDisplay,
|
|
220
|
+
M as normalizeInputValue,
|
|
221
|
+
g as sanitizeDigits,
|
|
222
|
+
V as shouldDisplayExplicitCountrySelection,
|
|
223
|
+
v as stripPrefix
|
|
235
224
|
};
|
|
236
225
|
//# sourceMappingURL=index37.js.map
|
package/dist/index37.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index37.js","sources":["../../../node_modules/@dnd-kit/utilities/dist/utilities.esm.js"],"sourcesContent":["import { useMemo, useLayoutEffect, useEffect, useRef, useCallback } from 'react';\n\nfunction useCombinedRefs() {\n for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {\n refs[_key] = arguments[_key];\n }\n\n return useMemo(() => node => {\n refs.forEach(ref => ref(node));\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n refs);\n}\n\n// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js\nconst canUseDOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';\n\nfunction isWindow(element) {\n const elementString = Object.prototype.toString.call(element);\n return elementString === '[object Window]' || // In Electron context the Window object serializes to [object global]\n elementString === '[object global]';\n}\n\nfunction isNode(node) {\n return 'nodeType' in node;\n}\n\nfunction getWindow(target) {\n var _target$ownerDocument, _target$ownerDocument2;\n\n if (!target) {\n return window;\n }\n\n if (isWindow(target)) {\n return target;\n }\n\n if (!isNode(target)) {\n return window;\n }\n\n return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window;\n}\n\nfunction isDocument(node) {\n const {\n Document\n } = getWindow(node);\n return node instanceof Document;\n}\n\nfunction isHTMLElement(node) {\n if (isWindow(node)) {\n return false;\n }\n\n return node instanceof getWindow(node).HTMLElement;\n}\n\nfunction isSVGElement(node) {\n return node instanceof getWindow(node).SVGElement;\n}\n\nfunction getOwnerDocument(target) {\n if (!target) {\n return document;\n }\n\n if (isWindow(target)) {\n return target.document;\n }\n\n if (!isNode(target)) {\n return document;\n }\n\n if (isDocument(target)) {\n return target;\n }\n\n if (isHTMLElement(target) || isSVGElement(target)) {\n return target.ownerDocument;\n }\n\n return document;\n}\n\n/**\r\n * A hook that resolves to useEffect on the server and useLayoutEffect on the client\r\n * @param callback {function} Callback function that is invoked when the dependencies of the hook change\r\n */\n\nconst useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;\n\nfunction useEvent(handler) {\n const handlerRef = useRef(handler);\n useIsomorphicLayoutEffect(() => {\n handlerRef.current = handler;\n });\n return useCallback(function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return handlerRef.current == null ? void 0 : handlerRef.current(...args);\n }, []);\n}\n\nfunction useInterval() {\n const intervalRef = useRef(null);\n const set = useCallback((listener, duration) => {\n intervalRef.current = setInterval(listener, duration);\n }, []);\n const clear = useCallback(() => {\n if (intervalRef.current !== null) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n }, []);\n return [set, clear];\n}\n\nfunction useLatestValue(value, dependencies) {\n if (dependencies === void 0) {\n dependencies = [value];\n }\n\n const valueRef = useRef(value);\n useIsomorphicLayoutEffect(() => {\n if (valueRef.current !== value) {\n valueRef.current = value;\n }\n }, dependencies);\n return valueRef;\n}\n\nfunction useLazyMemo(callback, dependencies) {\n const valueRef = useRef();\n return useMemo(() => {\n const newValue = callback(valueRef.current);\n valueRef.current = newValue;\n return newValue;\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n [...dependencies]);\n}\n\nfunction useNodeRef(onChange) {\n const onChangeHandler = useEvent(onChange);\n const node = useRef(null);\n const setNodeRef = useCallback(element => {\n if (element !== node.current) {\n onChangeHandler == null ? void 0 : onChangeHandler(element, node.current);\n }\n\n node.current = element;\n }, //eslint-disable-next-line\n []);\n return [node, setNodeRef];\n}\n\nfunction usePrevious(value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n }, [value]);\n return ref.current;\n}\n\nlet ids = {};\nfunction useUniqueId(prefix, value) {\n return useMemo(() => {\n if (value) {\n return value;\n }\n\n const id = ids[prefix] == null ? 0 : ids[prefix] + 1;\n ids[prefix] = id;\n return prefix + \"-\" + id;\n }, [prefix, value]);\n}\n\nfunction createAdjustmentFn(modifier) {\n return function (object) {\n for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n adjustments[_key - 1] = arguments[_key];\n }\n\n return adjustments.reduce((accumulator, adjustment) => {\n const entries = Object.entries(adjustment);\n\n for (const [key, valueAdjustment] of entries) {\n const value = accumulator[key];\n\n if (value != null) {\n accumulator[key] = value + modifier * valueAdjustment;\n }\n }\n\n return accumulator;\n }, { ...object\n });\n };\n}\n\nconst add = /*#__PURE__*/createAdjustmentFn(1);\nconst subtract = /*#__PURE__*/createAdjustmentFn(-1);\n\nfunction hasViewportRelativeCoordinates(event) {\n return 'clientX' in event && 'clientY' in event;\n}\n\nfunction isKeyboardEvent(event) {\n if (!event) {\n return false;\n }\n\n const {\n KeyboardEvent\n } = getWindow(event.target);\n return KeyboardEvent && event instanceof KeyboardEvent;\n}\n\nfunction isTouchEvent(event) {\n if (!event) {\n return false;\n }\n\n const {\n TouchEvent\n } = getWindow(event.target);\n return TouchEvent && event instanceof TouchEvent;\n}\n\n/**\r\n * Returns the normalized x and y coordinates for mouse and touch events.\r\n */\n\nfunction getEventCoordinates(event) {\n if (isTouchEvent(event)) {\n if (event.touches && event.touches.length) {\n const {\n clientX: x,\n clientY: y\n } = event.touches[0];\n return {\n x,\n y\n };\n } else if (event.changedTouches && event.changedTouches.length) {\n const {\n clientX: x,\n clientY: y\n } = event.changedTouches[0];\n return {\n x,\n y\n };\n }\n }\n\n if (hasViewportRelativeCoordinates(event)) {\n return {\n x: event.clientX,\n y: event.clientY\n };\n }\n\n return null;\n}\n\nconst CSS = /*#__PURE__*/Object.freeze({\n Translate: {\n toString(transform) {\n if (!transform) {\n return;\n }\n\n const {\n x,\n y\n } = transform;\n return \"translate3d(\" + (x ? Math.round(x) : 0) + \"px, \" + (y ? Math.round(y) : 0) + \"px, 0)\";\n }\n\n },\n Scale: {\n toString(transform) {\n if (!transform) {\n return;\n }\n\n const {\n scaleX,\n scaleY\n } = transform;\n return \"scaleX(\" + scaleX + \") scaleY(\" + scaleY + \")\";\n }\n\n },\n Transform: {\n toString(transform) {\n if (!transform) {\n return;\n }\n\n return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' ');\n }\n\n },\n Transition: {\n toString(_ref) {\n let {\n property,\n duration,\n easing\n } = _ref;\n return property + \" \" + duration + \"ms \" + easing;\n }\n\n }\n});\n\nconst SELECTOR = 'a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]';\nfunction findFirstFocusableNode(element) {\n if (element.matches(SELECTOR)) {\n return element;\n }\n\n return element.querySelector(SELECTOR);\n}\n\nexport { CSS, add, canUseDOM, findFirstFocusableNode, getEventCoordinates, getOwnerDocument, getWindow, hasViewportRelativeCoordinates, isDocument, isHTMLElement, isKeyboardEvent, isNode, isSVGElement, isTouchEvent, isWindow, subtract, useCombinedRefs, useEvent, useInterval, useIsomorphicLayoutEffect, useLatestValue, useLazyMemo, useNodeRef, usePrevious, useUniqueId };\n//# sourceMappingURL=utilities.esm.js.map\n"],"names":["useCombinedRefs","_len","refs","_key","useMemo","node","ref","canUseDOM","isWindow","element","elementString","isNode","getWindow","target","_target$ownerDocument","_target$ownerDocument2","isDocument","Document","isHTMLElement","isSVGElement","getOwnerDocument","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","useEvent","handler","handlerRef","useRef","useCallback","args","useInterval","intervalRef","set","listener","duration","clear","useLatestValue","value","dependencies","valueRef","useLazyMemo","callback","newValue","useNodeRef","onChange","onChangeHandler","setNodeRef","usePrevious","ids","useUniqueId","prefix","id","createAdjustmentFn","modifier","object","adjustments","accumulator","adjustment","entries","key","valueAdjustment","add","subtract","hasViewportRelativeCoordinates","event","isKeyboardEvent","KeyboardEvent","isTouchEvent","TouchEvent","getEventCoordinates","x","y","CSS","transform","scaleX","scaleY","_ref","property","easing","SELECTOR","findFirstFocusableNode"],"mappings":";AAEA,SAASA,IAAkB;AACzB,WAASC,IAAO,UAAU,QAAQC,IAAO,IAAI,MAAMD,CAAI,GAAGE,IAAO,GAAGA,IAAOF,GAAME;AAC/E,IAAAD,EAAKC,CAAI,IAAI,UAAUA,CAAI;AAG7B,SAAOC;AAAA,IAAQ,MAAM,CAAAC,MAAQ;AAC3B,MAAAH,EAAK,QAAQ,CAAAI,MAAOA,EAAID,CAAI,CAAC;AAAA,IAC/B;AAAA;AAAA,IACAH;AAAA,EAAI;AACN;AAGK,MAACK,IAAY,OAAO,SAAW,OAAe,OAAO,OAAO,WAAa,OAAe,OAAO,OAAO,SAAS,gBAAkB;AAEtI,SAASC,EAASC,GAAS;AACzB,QAAMC,IAAgB,OAAO,UAAU,SAAS,KAAKD,CAAO;AAC5D,SAAOC,MAAkB;AAAA,EACzBA,MAAkB;AACpB;AAEA,SAASC,EAAON,GAAM;AACpB,SAAO,cAAcA;AACvB;AAEA,SAASO,EAAUC,GAAQ;AACzB,MAAIC,GAAuBC;AAE3B,SAAKF,IAIDL,EAASK,CAAM,IACVA,IAGJF,EAAOE,CAAM,MAIVC,KAAyBC,IAAyBF,EAAO,kBAAkB,OAAO,SAASE,EAAuB,gBAAgB,OAAOD,IAHxI,SARA;AAYX;AAEA,SAASE,EAAWX,GAAM;AACxB,QAAM;AAAA,IACJ,UAAAY;AAAA,EACJ,IAAML,EAAUP,CAAI;AAClB,SAAOA,aAAgBY;AACzB;AAEA,SAASC,EAAcb,GAAM;AAC3B,SAA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1
|
+
{"version":3,"file":"index37.js","sources":["../src/components/PhoneNumberInput/normalization.ts"],"sourcesContent":["import type { CountryCode } from \"libphonenumber-js\"\nimport { AsYouType, getCountryCallingCode, validatePhoneNumberLength } from \"libphonenumber-js\"\n\nimport {\n COMMON_IDD_PREFIXES,\n COUNTRY_DIAL_CODES,\n DEFAULT_COUNTRY,\n MAX_DIAL_CODE_LENGTH,\n} from \"./country-options\"\n\n\nexport type LengthIssue = \"TOO_LONG\"\n\nexport function sanitizeDigits(value: string) {\n return value.replace(/\\D/g, \"\")\n}\n\nfunction isDialCodeProgress(digits: string) {\n if (!digits) {\n return true\n }\n\n if (digits.length > MAX_DIAL_CODE_LENGTH) {\n return false\n }\n\n return COUNTRY_DIAL_CODES.some((dial) => dial.startsWith(digits))\n}\n\nconst INVISIBLE_FORMATTING_CHARACTERS =\n /[\\u061C\\u200B-\\u200F\\u202A-\\u202E\\u2066-\\u2069\\uFEFF]/g\n\nfunction stripInvisibleFormatting(value: string) {\n return value.replace(INVISIBLE_FORMATTING_CHARACTERS, \"\")\n}\n\nexport function injectNationalPrefixDisplay(\n international: string,\n dialCode: string,\n options: { force?: boolean } = {}\n) {\n // Preserve a user-typed national trunk (e.g. the French \"0\") purely for display\n // so validation can continue to use the canonical E.164 representation internally.\n const { force = false } = options\n const prefix = `+${dialCode}`\n\n if (!international.startsWith(prefix)) {\n return international\n }\n\n if (!force) {\n return international\n }\n\n const remainder = international.slice(prefix.length).trimStart()\n const alreadyHasTrunk = remainder.startsWith(\"0\")\n\n if (alreadyHasTrunk) {\n return international\n }\n\n if (!remainder) {\n return `${prefix} 0`\n }\n\n const [firstGroup, ...restGroups] = remainder.split(\" \")\n const rebuiltFirstGroup = `0${firstGroup ?? \"\"}`\n const rebuiltRemainder = restGroups.length > 0 ? ` ${restGroups.join(\" \")}` : \"\"\n\n return `${prefix} ${rebuiltFirstGroup}${rebuiltRemainder}`.replace(/\\s\\s+/g, \" \").trimEnd()\n}\n\nconst DETECTED_COUNTRY_OVERRIDES: Partial<Record<CountryCode, CountryCode>> = {\n GG: \"GB\",\n JE: \"GB\",\n IM: \"GB\",\n}\n\nfunction canonicalizeDetectedCountry(candidate: CountryCode | undefined): CountryCode | undefined {\n if (!candidate) {\n return undefined\n }\n return DETECTED_COUNTRY_OVERRIDES[candidate] ?? candidate\n}\n\ntype AsYouTypeNumber = ReturnType<AsYouType[\"getNumber\"]>\n\nfunction inferCountryFromDialCode(\n phoneNumber: AsYouTypeNumber,\n baseCountry: CountryCode | undefined,\n normalizedDigits: string\n): CountryCode | undefined {\n if (!phoneNumber) {\n return undefined\n }\n\n if (!normalizedDigits) {\n return undefined\n }\n\n const nationalDigits = phoneNumber.nationalNumber ?? \"\"\n if (nationalDigits.length < 4) {\n return undefined\n }\n\n const dial = phoneNumber.countryCallingCode\n if (!dial) {\n return undefined\n }\n\n const metadataGetter = (phoneNumber as unknown as { getMetadata?: () => unknown }).getMetadata\n const metadata =\n typeof metadataGetter === \"function\"\n ? (metadataGetter() as {\n country_calling_codes?: Record<string, string[]>\n } | null)\n : null\n\n const candidates = metadata?.country_calling_codes?.[dial]\n if (!candidates || candidates.length === 0) {\n return undefined\n }\n\n const canonicalCandidates: CountryCode[] = []\n for (const candidate of candidates) {\n const canonical = canonicalizeDetectedCountry(candidate as CountryCode)\n if (canonical && !canonicalCandidates.includes(canonical)) {\n canonicalCandidates.push(canonical)\n }\n }\n\n if (canonicalCandidates.length === 0) {\n return undefined\n }\n\n if (baseCountry && canonicalCandidates.includes(baseCountry)) {\n return baseCountry\n }\n\n if (canonicalCandidates.includes(DEFAULT_COUNTRY)) {\n return DEFAULT_COUNTRY\n }\n\n return canonicalCandidates[0]\n}\n\nexport function detectNationalPrefixForDisplay(\n rawDigits: string,\n internationalDigits: string,\n dialCode: string,\n hasExplicitInternationalPrefix: boolean\n) {\n if (!rawDigits) {\n return false\n }\n\n if (!hasExplicitInternationalPrefix) {\n return rawDigits.startsWith(\"0\")\n }\n\n if (!dialCode) {\n return false\n }\n\n if (!rawDigits.startsWith(dialCode)) {\n return false\n }\n\n if (!rawDigits.slice(dialCode.length).startsWith(\"0\")) {\n return false\n }\n\n const rawAfterTrunk = rawDigits.slice(dialCode.length + 1)\n const internationalAfterDial = internationalDigits.startsWith(dialCode)\n ? internationalDigits.slice(dialCode.length)\n : internationalDigits\n\n return rawAfterTrunk === internationalAfterDial\n}\n\nfunction stripIddPrefix(digits: string) {\n for (const prefix of COMMON_IDD_PREFIXES) {\n if (digits.startsWith(prefix)) {\n return digits.slice(prefix.length)\n }\n }\n return digits\n}\n\nexport function normalizeInputValue(\n rawValue: string,\n country: CountryCode | undefined,\n options: {\n allowJustPlus?: boolean\n removeNationalPrefix?: boolean\n previousValue?: string\n } = {}\n) {\n const { allowJustPlus = false, removeNationalPrefix = true, previousValue } = options\n const cleaned = stripInvisibleFormatting(rawValue)\n const trimmed = cleaned.trim()\n\n if (!trimmed) {\n return \"\"\n }\n\n if (trimmed === \"+\") {\n return allowJustPlus ? \"+\" : \"\"\n }\n\n if (trimmed.startsWith(\"+\")) {\n const digits = sanitizeDigits(trimmed)\n if (!digits) {\n return allowJustPlus ? \"+\" : \"\"\n }\n const digitsWithoutIdd = stripIddPrefix(digits)\n if (digitsWithoutIdd !== digits) {\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : allowJustPlus ? \"+\" : \"\"\n }\n if (removeNationalPrefix && country) {\n const dial = getCountryCallingCode(country)\n if (digits.startsWith(dial) && digits.slice(dial.length).startsWith(\"0\")) {\n const withoutPrefix = digits.slice(dial.length + 1)\n return withoutPrefix ? `+${dial}${withoutPrefix}` : `+${dial}`\n }\n }\n return `+${digits}`\n }\n\n const digitsOnly = sanitizeDigits(trimmed)\n if (!digitsOnly) {\n return \"\"\n }\n\n const digitsWithoutIdd = stripIddPrefix(digitsOnly)\n if (digitsWithoutIdd !== digitsOnly) {\n return digitsWithoutIdd ? `+${digitsWithoutIdd}` : allowJustPlus ? \"+\" : \"\"\n }\n\n const previousNormalized = typeof previousValue === \"string\" ? previousValue : \"\"\n const previousDigits =\n previousNormalized && previousNormalized.startsWith(\"+\")\n ? sanitizeDigits(previousNormalized)\n : \"\"\n\n if (previousDigits && previousDigits.length > digitsOnly.length) {\n if (previousDigits.endsWith(digitsOnly)) {\n const removedPrefixLength = previousDigits.length - digitsOnly.length\n if (removedPrefixLength <= MAX_DIAL_CODE_LENGTH) {\n return `+${digitsOnly}`\n }\n }\n }\n\n if (digitsOnly === \"0\") {\n return \"0\"\n }\n\n if (\n removeNationalPrefix &&\n country &&\n digitsOnly.length > 1 &&\n digitsOnly.startsWith(\"0\") &&\n !digitsOnly.startsWith(\"00\")\n ) {\n const dial = getCountryCallingCode(country)\n const withoutPrefix = digitsOnly.slice(1)\n return withoutPrefix ? `+${dial}${withoutPrefix}` : `+${dial}`\n }\n\n if (!country) {\n return digitsOnly\n }\n\n if (digitsOnly.length <= 4) {\n return `+${digitsOnly}`\n }\n\n const dial = getCountryCallingCode(country)\n return `+${dial}${digitsOnly}`\n}\n\nexport function formatWithAsYouType(value: string, baseCountry?: CountryCode) {\n if (value === \"+\") {\n return {\n international: \"+\",\n national: \"\",\n formatted: \"+\",\n phoneNumber: null,\n detectedCountry: undefined,\n inferredCountry: undefined,\n hasExplicitInternationalPrefix: true,\n }\n }\n\n const hasExplicitInternationalPrefix = /^\\s*\\+/.test(value)\n const formatter = baseCountry ? new AsYouType(baseCountry) : new AsYouType()\n const formatted = formatter.input(value)\n const phoneNumber = formatter.getNumber()\n const digits = sanitizeDigits(value)\n const detectedCountry = canonicalizeDetectedCountry(\n (phoneNumber?.country ?? formatter.country ?? undefined) as CountryCode | undefined\n )\n const inferredCountry =\n detectedCountry ?? !phoneNumber\n ? undefined\n : canonicalizeDetectedCountry(\n inferCountryFromDialCode(phoneNumber, baseCountry, digits)\n )\n\n const international = phoneNumber?.formatInternational() ?? formatted\n const national = phoneNumber?.formatNational() ?? sanitizeDigits(international)\n\n return {\n international,\n national,\n formatted,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n }\n}\n\nexport function stripPrefix(value: string, prefix: string) {\n return value.startsWith(prefix) ? value.slice(prefix.length) : value\n}\n\nexport function getLengthIssue(value: string, country: CountryCode | undefined): LengthIssue | null {\n if (!country || !value) {\n return null\n }\n\n try {\n const result = validatePhoneNumberLength(value, country)\n return result === \"TOO_LONG\" ? \"TOO_LONG\" : null\n } catch {\n return null\n }\n}\n\ntype SuggestionState = {\n shouldSuggest: boolean\n query: string\n}\n\nexport function getSuggestionState(\n normalized: string,\n baseCountry: CountryCode | undefined,\n phoneNumber: ReturnType<AsYouType[\"getNumber\"]>,\n options: {\n hasRemovedNationalPrefix?: boolean\n detectedCountry?: CountryCode\n hasExplicitInternationalPrefix?: boolean\n } = {}\n): SuggestionState {\n const {\n hasRemovedNationalPrefix = false,\n detectedCountry,\n hasExplicitInternationalPrefix = false,\n } = options\n\n if (!normalized) {\n return { shouldSuggest: false, query: \"\" }\n }\n\n if (normalized === \"+\") {\n return { shouldSuggest: true, query: \"\" }\n }\n\n const digits = sanitizeDigits(normalized)\n if (!digits) {\n return { shouldSuggest: true, query: \"\" }\n }\n\n if (hasRemovedNationalPrefix) {\n return { shouldSuggest: false, query: \"\" }\n }\n\n if (hasExplicitInternationalPrefix && !detectedCountry) {\n if (!isDialCodeProgress(digits)) {\n return { shouldSuggest: false, query: \"\" }\n }\n return { shouldSuggest: true, query: digits }\n }\n\n let dial = phoneNumber?.countryCallingCode ?? null\n if (!dial) {\n if (baseCountry) {\n const baseDial = getCountryCallingCode(baseCountry)\n if (digits.startsWith(baseDial)) {\n dial = baseDial\n }\n } else if (!hasExplicitInternationalPrefix) {\n return { shouldSuggest: false, query: \"\" }\n }\n }\n\n if (!dial) {\n return { shouldSuggest: true, query: digits }\n }\n\n const nationalDigits = stripPrefix(digits, dial)\n if (nationalDigits.length === 0) {\n return { shouldSuggest: true, query: digits }\n }\n\n return { shouldSuggest: false, query: \"\" }\n}\n\nexport function shouldDisplayExplicitCountrySelection(\n suggestion: SuggestionState,\n options: { detectedCountry?: CountryCode; hasExplicitInternationalPrefix?: boolean }\n) {\n if (suggestion.shouldSuggest) {\n return false\n }\n\n const { hasExplicitInternationalPrefix = false, detectedCountry } = options\n\n if (!hasExplicitInternationalPrefix) {\n return true\n }\n\n return Boolean(detectedCountry)\n}\n"],"names":["sanitizeDigits","value","replace","isDialCodeProgress","digits","length","MAX_DIAL_CODE_LENGTH","COUNTRY_DIAL_CODES","some","dial","startsWith","INVISIBLE_FORMATTING_CHARACTERS","stripInvisibleFormatting","injectNationalPrefixDisplay","international","dialCode","options","force","prefix","remainder","slice","trimStart","firstGroup","restGroups","split","rebuiltFirstGroup","rebuiltRemainder","join","trimEnd","DETECTED_COUNTRY_OVERRIDES","GG","JE","IM","canonicalizeDetectedCountry","candidate","inferCountryFromDialCode","phoneNumber","baseCountry","normalizedDigits","nationalNumber","countryCallingCode","metadataGetter","getMetadata","candidates","country_calling_codes","canonicalCandidates","canonical","includes","push","DEFAULT_COUNTRY","detectNationalPrefixForDisplay","rawDigits","internationalDigits","hasExplicitInternationalPrefix","rawAfterTrunk","internationalAfterDial","stripIddPrefix","COMMON_IDD_PREFIXES","normalizeInputValue","rawValue","country","allowJustPlus","removeNationalPrefix","previousValue","trimmed","trim","digitsWithoutIdd","getCountryCallingCode","withoutPrefix","digitsOnly","previousNormalized","previousDigits","endsWith","formatWithAsYouType","national","formatted","detectedCountry","undefined","inferredCountry","test","formatter","AsYouType","input","getNumber","formatInternational","formatNational","stripPrefix","getLengthIssue","validatePhoneNumberLength","getSuggestionState","normalized","hasRemovedNationalPrefix","shouldSuggest","query","baseDial","shouldDisplayExplicitCountrySelection","suggestion","Boolean"],"mappings":";;;;AAaO,SAASA,EAAeC,GAAe;AAC5C,SAAOA,EAAMC,QAAQ,OAAO,EAAE;AAChC;AAEA,SAASC,EAAmBC,GAAgB;AAC1C,SAAKA,IAIDA,EAAOC,SAASC,IACX,KAGFC,EAAmBC,KAAMC,CAA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A,IAGhC;AAAA,IAAEwF,eAAe;AAAA,IAAOC,OAAO;AAAA,EAAA,IAR7B;AAAA,IAAED,eAAe;AAAA,IAAMC,OAAOzF;AAAAA,EAAAA;AASzC;AAEO,SAAS2F,EACdC,GACAhF,GACA;AACA,MAAIgF,EAAWJ;AACb,WAAO;AAGT,QAAM;AAAA,IAAEvC,gCAAAA,IAAiC;AAAA,IAAOuB,iBAAAA;AAAAA,EAAAA,IAAoB5D;AAEpE,SAAKqC,IAIE4C,EAAQrB,IAHN;AAIX;"}
|
package/dist/index38.js
CHANGED
|
@@ -1,25 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
function c(t) {
|
|
2
|
+
if (!t)
|
|
3
|
+
return !1;
|
|
4
|
+
const e = t.charCodeAt(0);
|
|
5
|
+
return e >= 48 && e <= 57;
|
|
6
|
+
}
|
|
7
|
+
function l(t, e) {
|
|
8
|
+
let n = 0;
|
|
9
|
+
const r = Math.min(e, t.length);
|
|
10
|
+
for (let i = 0; i < r; i += 1)
|
|
11
|
+
c(t[i] ?? "") && (n += 1);
|
|
12
|
+
return n;
|
|
13
|
+
}
|
|
14
|
+
function a(t, e) {
|
|
15
|
+
if (e <= 0)
|
|
16
|
+
return t.startsWith("+") ? Math.min(1, t.length) : 0;
|
|
17
|
+
let n = 0;
|
|
18
|
+
for (let r = 0; r < t.length; r += 1)
|
|
19
|
+
if (c(t[r] ?? "") && (n += 1, n === e))
|
|
20
|
+
return r + 1;
|
|
21
|
+
return t.length;
|
|
22
|
+
}
|
|
23
|
+
function g(t) {
|
|
24
|
+
return !t || c(t) ? !1 : t !== "+";
|
|
25
|
+
}
|
|
26
|
+
function h(t, e) {
|
|
27
|
+
let n = e;
|
|
28
|
+
for (; n > 0; ) {
|
|
29
|
+
const r = t[n - 1] ?? "";
|
|
30
|
+
if (!g(r))
|
|
31
|
+
break;
|
|
32
|
+
n -= 1;
|
|
13
33
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
34
|
+
return n;
|
|
35
|
+
}
|
|
36
|
+
function S(t, e) {
|
|
37
|
+
let n = e;
|
|
38
|
+
for (; n < t.length; ) {
|
|
39
|
+
const r = t[n] ?? "";
|
|
40
|
+
if (!g(r))
|
|
41
|
+
break;
|
|
42
|
+
n += 1;
|
|
43
|
+
}
|
|
44
|
+
return n;
|
|
45
|
+
}
|
|
46
|
+
function m(t) {
|
|
47
|
+
const {
|
|
48
|
+
value: e
|
|
49
|
+
} = t, n = t.selectionStart ?? e.length, r = t.selectionEnd ?? n, i = n <= 1 && e.startsWith("+"), o = r <= 1 && e.startsWith("+");
|
|
17
50
|
return {
|
|
18
|
-
|
|
19
|
-
|
|
51
|
+
selectionStart: n,
|
|
52
|
+
selectionEnd: r,
|
|
53
|
+
startDigits: l(e, n),
|
|
54
|
+
endDigits: l(e, r),
|
|
55
|
+
preserveStartIndex: i,
|
|
56
|
+
preserveEndIndex: o,
|
|
57
|
+
wasAtStart: n === 0,
|
|
58
|
+
wasAtEnd: r === e.length
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function u(t, e) {
|
|
62
|
+
if (t.selectionStart === t.selectionEnd) {
|
|
63
|
+
if (t.wasAtEnd) {
|
|
64
|
+
const f = e.length;
|
|
65
|
+
return {
|
|
66
|
+
start: f,
|
|
67
|
+
end: f
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (t.wasAtStart)
|
|
71
|
+
return {
|
|
72
|
+
start: 0,
|
|
73
|
+
end: 0
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const n = t.preserveStartIndex ? Math.min(t.selectionStart, e.length) : a(e, t.startDigits), r = t.preserveEndIndex ? Math.min(t.selectionEnd, e.length) : a(e, t.endDigits);
|
|
77
|
+
let i = n, o = r;
|
|
78
|
+
t.wasAtStart && (i = 0), t.wasAtEnd && (o = e.length), t.selectionStart === t.selectionEnd && (i = o);
|
|
79
|
+
const d = Math.min(Math.max(i, 0), e.length), s = Math.min(Math.max(o, 0), e.length);
|
|
80
|
+
return d > s ? {
|
|
81
|
+
start: s,
|
|
82
|
+
end: s
|
|
83
|
+
} : {
|
|
84
|
+
start: d,
|
|
85
|
+
end: s
|
|
20
86
|
};
|
|
21
87
|
}
|
|
22
88
|
export {
|
|
23
|
-
|
|
89
|
+
m as captureSelectionSnapshot,
|
|
90
|
+
u as resolveSelection,
|
|
91
|
+
h as skipFormattingCharactersLeft,
|
|
92
|
+
S as skipFormattingCharactersRight
|
|
24
93
|
};
|
|
25
94
|
//# sourceMappingURL=index38.js.map
|