| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# automatically generated file, don't edit |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Copyright 2023 David Cantrell, derived from data from libphonenumber |
|
6
|
|
|
|
|
|
|
# http://code.google.com/p/libphonenumber/ |
|
7
|
|
|
|
|
|
|
# |
|
8
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); |
|
9
|
|
|
|
|
|
|
# you may not use this file except in compliance with the License. |
|
10
|
|
|
|
|
|
|
# You may obtain a copy of the License at |
|
11
|
|
|
|
|
|
|
# |
|
12
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
|
13
|
|
|
|
|
|
|
# |
|
14
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software |
|
15
|
|
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
|
16
|
|
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
17
|
|
|
|
|
|
|
# See the License for the specific language governing permissions and |
|
18
|
|
|
|
|
|
|
# limitations under the License. |
|
19
|
|
|
|
|
|
|
package Number::Phone::StubCountry::BA; |
|
20
|
2
|
|
|
2
|
|
1267
|
use base qw(Number::Phone::StubCountry); |
|
|
2
|
|
|
|
|
8
|
|
|
|
2
|
|
|
|
|
263
|
|
|
21
|
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
18
|
use strict; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
49
|
|
|
23
|
2
|
|
|
2
|
|
14
|
use warnings; |
|
|
2
|
|
|
|
|
9
|
|
|
|
2
|
|
|
|
|
68
|
|
|
24
|
2
|
|
|
2
|
|
11
|
use utf8; |
|
|
2
|
|
|
|
|
15
|
|
|
|
2
|
|
|
|
|
18
|
|
|
25
|
|
|
|
|
|
|
our $VERSION = 1.20230307181417; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $formatters = [ |
|
28
|
|
|
|
|
|
|
{ |
|
29
|
|
|
|
|
|
|
'format' => '$1-$2', |
|
30
|
|
|
|
|
|
|
'intl_format' => 'NA', |
|
31
|
|
|
|
|
|
|
'leading_digits' => '[2-9]', |
|
32
|
|
|
|
|
|
|
'pattern' => '(\\d{3})(\\d{3})' |
|
33
|
|
|
|
|
|
|
}, |
|
34
|
|
|
|
|
|
|
{ |
|
35
|
|
|
|
|
|
|
'format' => '$1 $2 $3', |
|
36
|
|
|
|
|
|
|
'leading_digits' => ' |
|
37
|
|
|
|
|
|
|
6[1-3]| |
|
38
|
|
|
|
|
|
|
[7-9] |
|
39
|
|
|
|
|
|
|
', |
|
40
|
|
|
|
|
|
|
'national_rule' => '0$1', |
|
41
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{3})' |
|
42
|
|
|
|
|
|
|
}, |
|
43
|
|
|
|
|
|
|
{ |
|
44
|
|
|
|
|
|
|
'format' => '$1 $2-$3', |
|
45
|
|
|
|
|
|
|
'leading_digits' => ' |
|
46
|
|
|
|
|
|
|
[3-5]| |
|
47
|
|
|
|
|
|
|
6[56] |
|
48
|
|
|
|
|
|
|
', |
|
49
|
|
|
|
|
|
|
'national_rule' => '0$1', |
|
50
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{3})(\\d{3})' |
|
51
|
|
|
|
|
|
|
}, |
|
52
|
|
|
|
|
|
|
{ |
|
53
|
|
|
|
|
|
|
'format' => '$1 $2 $3 $4', |
|
54
|
|
|
|
|
|
|
'leading_digits' => '6', |
|
55
|
|
|
|
|
|
|
'national_rule' => '0$1', |
|
56
|
|
|
|
|
|
|
'pattern' => '(\\d{2})(\\d{2})(\\d{2})(\\d{3})' |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
]; |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
my $validators = { |
|
61
|
|
|
|
|
|
|
'fixed_line' => ' |
|
62
|
|
|
|
|
|
|
(?: |
|
63
|
|
|
|
|
|
|
3(?: |
|
64
|
|
|
|
|
|
|
[05-79][2-9]| |
|
65
|
|
|
|
|
|
|
1[4579]| |
|
66
|
|
|
|
|
|
|
[23][24-9]| |
|
67
|
|
|
|
|
|
|
4[2-4689]| |
|
68
|
|
|
|
|
|
|
8[2457-9] |
|
69
|
|
|
|
|
|
|
)| |
|
70
|
|
|
|
|
|
|
49[2-579]| |
|
71
|
|
|
|
|
|
|
5(?: |
|
72
|
|
|
|
|
|
|
0[2-49]| |
|
73
|
|
|
|
|
|
|
[13][2-9]| |
|
74
|
|
|
|
|
|
|
[268][2-4679]| |
|
75
|
|
|
|
|
|
|
4[4689]| |
|
76
|
|
|
|
|
|
|
5[2-79]| |
|
77
|
|
|
|
|
|
|
7[2-69]| |
|
78
|
|
|
|
|
|
|
9[2-4689] |
|
79
|
|
|
|
|
|
|
) |
|
80
|
|
|
|
|
|
|
)\\d{5} |
|
81
|
|
|
|
|
|
|
', |
|
82
|
|
|
|
|
|
|
'geographic' => ' |
|
83
|
|
|
|
|
|
|
(?: |
|
84
|
|
|
|
|
|
|
3(?: |
|
85
|
|
|
|
|
|
|
[05-79][2-9]| |
|
86
|
|
|
|
|
|
|
1[4579]| |
|
87
|
|
|
|
|
|
|
[23][24-9]| |
|
88
|
|
|
|
|
|
|
4[2-4689]| |
|
89
|
|
|
|
|
|
|
8[2457-9] |
|
90
|
|
|
|
|
|
|
)| |
|
91
|
|
|
|
|
|
|
49[2-579]| |
|
92
|
|
|
|
|
|
|
5(?: |
|
93
|
|
|
|
|
|
|
0[2-49]| |
|
94
|
|
|
|
|
|
|
[13][2-9]| |
|
95
|
|
|
|
|
|
|
[268][2-4679]| |
|
96
|
|
|
|
|
|
|
4[4689]| |
|
97
|
|
|
|
|
|
|
5[2-79]| |
|
98
|
|
|
|
|
|
|
7[2-69]| |
|
99
|
|
|
|
|
|
|
9[2-4689] |
|
100
|
|
|
|
|
|
|
) |
|
101
|
|
|
|
|
|
|
)\\d{5} |
|
102
|
|
|
|
|
|
|
', |
|
103
|
|
|
|
|
|
|
'mobile' => ' |
|
104
|
|
|
|
|
|
|
6040\\d{5}| |
|
105
|
|
|
|
|
|
|
6(?: |
|
106
|
|
|
|
|
|
|
03| |
|
107
|
|
|
|
|
|
|
[1-356]| |
|
108
|
|
|
|
|
|
|
44| |
|
109
|
|
|
|
|
|
|
7\\d |
|
110
|
|
|
|
|
|
|
)\\d{6} |
|
111
|
|
|
|
|
|
|
', |
|
112
|
|
|
|
|
|
|
'pager' => '', |
|
113
|
|
|
|
|
|
|
'personal_number' => '', |
|
114
|
|
|
|
|
|
|
'specialrate' => '(8[12]\\d{6})|(9[0246]\\d{6})|( |
|
115
|
|
|
|
|
|
|
703[235]0\\d{3}| |
|
116
|
|
|
|
|
|
|
70(?: |
|
117
|
|
|
|
|
|
|
2[0-5]| |
|
118
|
|
|
|
|
|
|
3[0146]| |
|
119
|
|
|
|
|
|
|
[56]0 |
|
120
|
|
|
|
|
|
|
)\\d{4} |
|
121
|
|
|
|
|
|
|
)', |
|
122
|
|
|
|
|
|
|
'toll_free' => '8[08]\\d{6}', |
|
123
|
|
|
|
|
|
|
'voip' => '' |
|
124
|
|
|
|
|
|
|
}; |
|
125
|
|
|
|
|
|
|
my %areanames = (); |
|
126
|
|
|
|
|
|
|
$areanames{bs} = {"38757", "Istočno\ Sarajevo", |
|
127
|
|
|
|
|
|
|
"38730", "Srednjobosanski\ kanton", |
|
128
|
|
|
|
|
|
|
"38733", "Kanton\ Sarajevo", |
|
129
|
|
|
|
|
|
|
"38737", "Unsko\-sanski\ kanton", |
|
130
|
|
|
|
|
|
|
"3874", "Brčko\ Distrikt", |
|
131
|
|
|
|
|
|
|
"38736", "Hercegovačko\-neretvanski\ kanton", |
|
132
|
|
|
|
|
|
|
"38738", "Bosansko\-podrinjski\ kanton\ Goražde", |
|
133
|
|
|
|
|
|
|
"38732", "Zeničko\-dobojski\ kanton", |
|
134
|
|
|
|
|
|
|
"38731", "Posavski\ kanton", |
|
135
|
|
|
|
|
|
|
"38735", "Tuzlanski\ kanton", |
|
136
|
|
|
|
|
|
|
"38734", "kanton\ 10", |
|
137
|
|
|
|
|
|
|
"38739", "Zapadnohercegovački\ kanton",}; |
|
138
|
|
|
|
|
|
|
$areanames{en} = {"38753", "Doboj", |
|
139
|
|
|
|
|
|
|
"38757", "East\ Sarajevo", |
|
140
|
|
|
|
|
|
|
"38730", "Central\ Bosnia\ Canton", |
|
141
|
|
|
|
|
|
|
"38756", "Zvornik", |
|
142
|
|
|
|
|
|
|
"38737", "Una\-Sana\ Canton", |
|
143
|
|
|
|
|
|
|
"38733", "Sarajevo\ Canton", |
|
144
|
|
|
|
|
|
|
"38736", "Herzegovina\-Neretva\ Canton", |
|
145
|
|
|
|
|
|
|
"3874", "Brčko\ District", |
|
146
|
|
|
|
|
|
|
"38750", "Mrkonjić\ Grad", |
|
147
|
|
|
|
|
|
|
"38752", "Prijedor", |
|
148
|
|
|
|
|
|
|
"38751", "Banja\ Luka", |
|
149
|
|
|
|
|
|
|
"38754", "Šamac", |
|
150
|
|
|
|
|
|
|
"38755", "Bijeljina", |
|
151
|
|
|
|
|
|
|
"38738", "Bosnian\-Podrinje\ Canton\ Goražde", |
|
152
|
|
|
|
|
|
|
"38759", "Trebinje", |
|
153
|
|
|
|
|
|
|
"38735", "Tuzla\ Canton", |
|
154
|
|
|
|
|
|
|
"38734", "Canton\ 10", |
|
155
|
|
|
|
|
|
|
"38758", "Foča", |
|
156
|
|
|
|
|
|
|
"38732", "Zenica\-Doboj\ Canton", |
|
157
|
|
|
|
|
|
|
"38731", "Posavina\ Canton", |
|
158
|
|
|
|
|
|
|
"38739", "West\ Herzegovina\ Canton",}; |
|
159
|
|
|
|
|
|
|
$areanames{sr} = {"3874", "Брчко\ Дистрикт", |
|
160
|
|
|
|
|
|
|
"38750", "Мркоњић\ Град", |
|
161
|
|
|
|
|
|
|
"38733", "Сарајевски\ кантон", |
|
162
|
|
|
|
|
|
|
"38737", "Унско\-сански\ кантон", |
|
163
|
|
|
|
|
|
|
"38756", "Зворник", |
|
164
|
|
|
|
|
|
|
"38730", "Средњoбосански\ кантон", |
|
165
|
|
|
|
|
|
|
"38757", "Источно\ Сарајево", |
|
166
|
|
|
|
|
|
|
"38753", "Добој", |
|
167
|
|
|
|
|
|
|
"38732", "Зеничко\-добојски\ кантон", |
|
168
|
|
|
|
|
|
|
"38731", "Посавски\ кантон", |
|
169
|
|
|
|
|
|
|
"38735", "Тузлански\ кантон", |
|
170
|
|
|
|
|
|
|
"38734", "Кантон\ 10", |
|
171
|
|
|
|
|
|
|
"38758", "Фоча", |
|
172
|
|
|
|
|
|
|
"38759", "Требиње", |
|
173
|
|
|
|
|
|
|
"38754", "Шамац", |
|
174
|
|
|
|
|
|
|
"38755", "Бијељина", |
|
175
|
|
|
|
|
|
|
"38738", "Босанско\-подрињски\ кантон\ Горажде", |
|
176
|
|
|
|
|
|
|
"38752", "Приједор", |
|
177
|
|
|
|
|
|
|
"38751", "Бања\ Лука",}; |
|
178
|
|
|
|
|
|
|
$areanames{hr} = {"38738", "Bosansko\-podrinjska\ županija\ Goražde", |
|
179
|
|
|
|
|
|
|
"38730", "Županija\ Središnja\ Bosna", |
|
180
|
|
|
|
|
|
|
"38732", "Zeničko\-dobojska\ županija", |
|
181
|
|
|
|
|
|
|
"38731", "Županija\ Posavska", |
|
182
|
|
|
|
|
|
|
"38733", "Sarajevska\ županija", |
|
183
|
|
|
|
|
|
|
"38734", "Hercegbosanska\ županija", |
|
184
|
|
|
|
|
|
|
"38737", "Unsko\-sanska\ županija", |
|
185
|
|
|
|
|
|
|
"38735", "Tuzlanska\ županija", |
|
186
|
|
|
|
|
|
|
"38736", "Hercegovačko\-neretvanska\ županija", |
|
187
|
|
|
|
|
|
|
"38739", "Županija\ Zapadnohercegovačka",}; |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
sub new { |
|
190
|
19
|
|
|
19
|
1
|
47
|
my $class = shift; |
|
191
|
19
|
|
|
|
|
52
|
my $number = shift; |
|
192
|
19
|
|
|
|
|
114
|
$number =~ s/(^\+387|\D)//g; |
|
193
|
19
|
|
|
|
|
116
|
my $self = bless({ country_code => '387', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
|
194
|
19
|
100
|
|
|
|
84
|
return $self if ($self->is_valid()); |
|
195
|
1
|
|
|
|
|
17
|
$number =~ s/^(?:0)//; |
|
196
|
1
|
|
|
|
|
10
|
$self = bless({ country_code => '387', number => $number, formatters => $formatters, validators => $validators, areanames => \%areanames}, $class); |
|
197
|
1
|
50
|
|
|
|
4
|
return $self->is_valid() ? $self : undef; |
|
198
|
|
|
|
|
|
|
} |
|
199
|
|
|
|
|
|
|
1; |