parsePhoneNumber

Parses an international number into its country and national form.

The country is resolved with libphonenumber's getRegionCodeForNumber, which inspects the whole number, rather than by matching the calling code against the country list. Matching by calling code is ambiguous: +1 belongs to 20+ NANP territories and +44 to four, so a dial-code lookup returns whichever of them happens to come first — and the expanded dataset now contains all of them. Region inference gets it right for cases like +44 7911 …, which is a Guernsey range rather than a UK one.