diff --git a/dist/main.css b/dist/main.css index d3c864d2b..385473b0a 100644 --- a/dist/main.css +++ b/dist/main.css @@ -1 +1 @@ -.intl-tel-input{position:relative;display:inline-block}.intl-tel-input *{box-sizing:border-box;-moz-box-sizing:border-box}.intl-tel-input .hide{display:none}.intl-tel-input .v-hide{visibility:hidden}.intl-tel-input input,.intl-tel-input input[type=tel],.intl-tel-input input[type=text]{position:relative;z-index:0;margin-top:0!important;margin-bottom:0!important;padding-right:36px;margin-right:0}.intl-tel-input .flag-container{position:absolute;top:0;bottom:0;right:0;padding:1px}.intl-tel-input .selected-flag{z-index:1;position:relative;width:36px;height:100%;padding:0 0 0 8px}.intl-tel-input .selected-flag .iti-flag{position:absolute;top:0;bottom:0;margin:auto}.intl-tel-input .selected-flag .iti-arrow{position:absolute;top:50%;margin-top:-2px;right:6px;width:0;height:0;border-left:3px solid transparent;border-right:3px solid transparent;border-top:4px solid #555}.intl-tel-input .selected-flag .iti-arrow.up{border-top:none;border-bottom:4px solid #555}.intl-tel-input .country-list{position:absolute;z-index:2;list-style:none;text-align:left;padding:0;margin:0 0 0 -1px;box-shadow:1px 1px 4px rgba(0,0,0,.2);background-color:#fff;border:1px solid #ccc;white-space:nowrap;max-height:200px;overflow-y:scroll;-webkit-overflow-scrolling:touch}.intl-tel-input .country-list.dropup{bottom:100%;margin-bottom:-1px}.intl-tel-input .country-list .flag-box{display:inline-block;width:20px}@media (max-width:500px){.intl-tel-input .country-list{white-space:normal}}.intl-tel-input .country-list .divider{padding-bottom:5px;margin-bottom:5px;border-bottom:1px solid #ccc}.intl-tel-input .country-list .country{padding:5px 10px}.intl-tel-input .country-list .country .dial-code{color:#999}.intl-tel-input .country-list .country.highlight{background-color:rgba(0,0,0,.05)}.intl-tel-input .country-list .country-name,.intl-tel-input .country-list .dial-code,.intl-tel-input .country-list .flag-box{vertical-align:middle}.intl-tel-input .country-list .country-name,.intl-tel-input .country-list .flag-box{margin-right:6px}.intl-tel-input.allow-dropdown input,.intl-tel-input.allow-dropdown input[type=tel],.intl-tel-input.allow-dropdown input[type=text]{padding-right:6px;padding-left:52px;margin-left:0}.intl-tel-input.allow-dropdown .flag-container{right:auto;left:0;width:100%}.intl-tel-input.allow-dropdown .selected-flag{width:46px}.intl-tel-input.allow-dropdown .flag-container:hover{cursor:pointer}.intl-tel-input.allow-dropdown .flag-container:hover .selected-flag{background-color:rgba(0,0,0,.05)}.intl-tel-input.allow-dropdown input[disabled]+.flag-container:hover,.intl-tel-input.allow-dropdown input[readonly]+.flag-container:hover{cursor:default}.intl-tel-input.allow-dropdown input[disabled]+.flag-container:hover .selected-flag,.intl-tel-input.allow-dropdown input[readonly]+.flag-container:hover .selected-flag{background-color:transparent}.intl-tel-input.allow-dropdown.separate-dial-code .selected-flag{background-color:rgba(0,0,0,.05);display:table}.intl-tel-input.allow-dropdown.separate-dial-code .selected-dial-code{display:table-cell;vertical-align:middle;padding-left:28px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 input[type=text]{padding-left:76px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 .selected-flag{width:70px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 input[type=text]{padding-left:84px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 .selected-flag{width:78px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 input[type=text]{padding-left:92px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 .selected-flag{width:86px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 input[type=text]{padding-left:100px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 .selected-flag{width:94px}.intl-tel-input.iti-container{position:absolute;top:-1000px;left:-1000px;z-index:1060;padding:1px}.intl-tel-input.iti-container:hover{cursor:pointer}.iti-mobile .intl-tel-input.iti-container{top:30px;bottom:30px;left:30px;right:30px;position:fixed}.iti-mobile .intl-tel-input .country-list{max-height:100%;width:100%;-webkit-overflow-scrolling:touch}.iti-mobile .intl-tel-input .country-list .country{padding:10px;line-height:1.5em}.iti-flag.be{width:18px}.iti-flag.ch{width:15px}.iti-flag.mc{width:19px}.iti-flag.ne{width:18px}.iti-flag.np{width:13px}.iti-flag.va{width:15px}@media only screen and (-o-min-device-pixel-ratio:2/1),only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:2dppx),only screen and (min-resolution:192dpi){.iti-flag{background-size:5630px 15px}}.iti-flag.ac{height:10px;background-position:0 0}.iti-flag.ad{height:14px;background-position:-22px 0}.iti-flag.ae{height:10px;background-position:-44px 0}.iti-flag.af{height:14px;background-position:-66px 0}.iti-flag.ag{height:14px;background-position:-88px 0}.iti-flag.ai{height:10px;background-position:-110px 0}.iti-flag.al{height:15px;background-position:-132px 0}.iti-flag.am{height:10px;background-position:-154px 0}.iti-flag.ao{height:14px;background-position:-176px 0}.iti-flag.aq{height:14px;background-position:-198px 0}.iti-flag.ar{height:13px;background-position:-220px 0}.iti-flag.as{height:10px;background-position:-242px 0}.iti-flag.at{height:14px;background-position:-264px 0}.iti-flag.au{height:10px;background-position:-286px 0}.iti-flag.aw{height:14px;background-position:-308px 0}.iti-flag.ax{height:13px;background-position:-330px 0}.iti-flag.az{height:10px;background-position:-352px 0}.iti-flag.ba{height:10px;background-position:-374px 0}.iti-flag.bb{height:14px;background-position:-396px 0}.iti-flag.bd{height:12px;background-position:-418px 0}.iti-flag.be{height:15px;background-position:-440px 0}.iti-flag.bf{height:14px;background-position:-460px 0}.iti-flag.bg{height:12px;background-position:-482px 0}.iti-flag.bh{height:12px;background-position:-504px 0}.iti-flag.bi{height:12px;background-position:-526px 0}.iti-flag.bj{height:14px;background-position:-548px 0}.iti-flag.bl{height:14px;background-position:-570px 0}.iti-flag.bm{height:10px;background-position:-592px 0}.iti-flag.bn{height:10px;background-position:-614px 0}.iti-flag.bo{height:14px;background-position:-636px 0}.iti-flag.bq{height:14px;background-position:-658px 0}.iti-flag.br{height:14px;background-position:-680px 0}.iti-flag.bs{height:10px;background-position:-702px 0}.iti-flag.bt{height:14px;background-position:-724px 0}.iti-flag.bv{height:15px;background-position:-746px 0}.iti-flag.bw{height:14px;background-position:-768px 0}.iti-flag.by{height:10px;background-position:-790px 0}.iti-flag.bz{height:14px;background-position:-812px 0}.iti-flag.ca{height:10px;background-position:-834px 0}.iti-flag.cc{height:10px;background-position:-856px 0}.iti-flag.cd{height:15px;background-position:-878px 0}.iti-flag.cf{height:14px;background-position:-900px 0}.iti-flag.cg{height:14px;background-position:-922px 0}.iti-flag.ch{height:15px;background-position:-944px 0}.iti-flag.ci{height:14px;background-position:-961px 0}.iti-flag.ck{height:10px;background-position:-983px 0}.iti-flag.cl{height:14px;background-position:-1005px 0}.iti-flag.cm{height:14px;background-position:-1027px 0}.iti-flag.cn{height:14px;background-position:-1049px 0}.iti-flag.co{height:14px;background-position:-1071px 0}.iti-flag.cp{height:14px;background-position:-1093px 0}.iti-flag.cr{height:12px;background-position:-1115px 0}.iti-flag.cu{height:10px;background-position:-1137px 0}.iti-flag.cv{height:12px;background-position:-1159px 0}.iti-flag.cw{height:14px;background-position:-1181px 0}.iti-flag.cx{height:10px;background-position:-1203px 0}.iti-flag.cy{height:14px;background-position:-1225px 0}.iti-flag.cz{height:14px;background-position:-1247px 0}.iti-flag.de{height:12px;background-position:-1269px 0}.iti-flag.dg{height:10px;background-position:-1291px 0}.iti-flag.dj{height:14px;background-position:-1313px 0}.iti-flag.dk{height:15px;background-position:-1335px 0}.iti-flag.dm{height:10px;background-position:-1357px 0}.iti-flag.do{height:13px;background-position:-1379px 0}.iti-flag.dz{height:14px;background-position:-1401px 0}.iti-flag.ea{height:14px;background-position:-1423px 0}.iti-flag.ec{height:14px;background-position:-1445px 0}.iti-flag.ee{height:13px;background-position:-1467px 0}.iti-flag.eg{height:14px;background-position:-1489px 0}.iti-flag.eh{height:10px;background-position:-1511px 0}.iti-flag.er{height:10px;background-position:-1533px 0}.iti-flag.es{height:14px;background-position:-1555px 0}.iti-flag.et{height:10px;background-position:-1577px 0}.iti-flag.eu{height:14px;background-position:-1599px 0}.iti-flag.fi{height:12px;background-position:-1621px 0}.iti-flag.fj{height:10px;background-position:-1643px 0}.iti-flag.fk{height:10px;background-position:-1665px 0}.iti-flag.fm{height:11px;background-position:-1687px 0}.iti-flag.fo{height:15px;background-position:-1709px 0}.iti-flag.fr{height:14px;background-position:-1731px 0}.iti-flag.ga{height:15px;background-position:-1753px 0}.iti-flag.gb{height:10px;background-position:-1775px 0}.iti-flag.gd{height:12px;background-position:-1797px 0}.iti-flag.ge{height:14px;background-position:-1819px 0}.iti-flag.gf{height:14px;background-position:-1841px 0}.iti-flag.gg{height:14px;background-position:-1863px 0}.iti-flag.gh{height:14px;background-position:-1885px 0}.iti-flag.gi{height:10px;background-position:-1907px 0}.iti-flag.gl{height:14px;background-position:-1929px 0}.iti-flag.gm{height:14px;background-position:-1951px 0}.iti-flag.gn{height:14px;background-position:-1973px 0}.iti-flag.gp{height:14px;background-position:-1995px 0}.iti-flag.gq{height:14px;background-position:-2017px 0}.iti-flag.gr{height:14px;background-position:-2039px 0}.iti-flag.gs{height:10px;background-position:-2061px 0}.iti-flag.gt{height:13px;background-position:-2083px 0}.iti-flag.gu{height:11px;background-position:-2105px 0}.iti-flag.gw{height:10px;background-position:-2127px 0}.iti-flag.gy{height:12px;background-position:-2149px 0}.iti-flag.hk{height:14px;background-position:-2171px 0}.iti-flag.hm{height:10px;background-position:-2193px 0}.iti-flag.hn{height:10px;background-position:-2215px 0}.iti-flag.hr{height:10px;background-position:-2237px 0}.iti-flag.ht{height:12px;background-position:-2259px 0}.iti-flag.hu{height:10px;background-position:-2281px 0}.iti-flag.ic{height:14px;background-position:-2303px 0}.iti-flag.id{height:14px;background-position:-2325px 0}.iti-flag.ie{height:10px;background-position:-2347px 0}.iti-flag.il{height:15px;background-position:-2369px 0}.iti-flag.im{height:10px;background-position:-2391px 0}.iti-flag.in{height:14px;background-position:-2413px 0}.iti-flag.io{height:10px;background-position:-2435px 0}.iti-flag.iq{height:14px;background-position:-2457px 0}.iti-flag.ir{height:12px;background-position:-2479px 0}.iti-flag.is{height:15px;background-position:-2501px 0}.iti-flag.it{height:14px;background-position:-2523px 0}.iti-flag.je{height:12px;background-position:-2545px 0}.iti-flag.jm{height:10px;background-position:-2567px 0}.iti-flag.jo{height:10px;background-position:-2589px 0}.iti-flag.jp{height:14px;background-position:-2611px 0}.iti-flag.ke{height:14px;background-position:-2633px 0}.iti-flag.kg{height:12px;background-position:-2655px 0}.iti-flag.kh{height:13px;background-position:-2677px 0}.iti-flag.ki{height:10px;background-position:-2699px 0}.iti-flag.km{height:12px;background-position:-2721px 0}.iti-flag.kn{height:14px;background-position:-2743px 0}.iti-flag.kp{height:10px;background-position:-2765px 0}.iti-flag.kr{height:14px;background-position:-2787px 0}.iti-flag.kw{height:10px;background-position:-2809px 0}.iti-flag.ky{height:10px;background-position:-2831px 0}.iti-flag.kz{height:10px;background-position:-2853px 0}.iti-flag.la{height:14px;background-position:-2875px 0}.iti-flag.lb{height:14px;background-position:-2897px 0}.iti-flag.lc{height:10px;background-position:-2919px 0}.iti-flag.li{height:12px;background-position:-2941px 0}.iti-flag.lk{height:10px;background-position:-2963px 0}.iti-flag.lr{height:11px;background-position:-2985px 0}.iti-flag.ls{height:14px;background-position:-3007px 0}.iti-flag.lt{height:12px;background-position:-3029px 0}.iti-flag.lu{height:12px;background-position:-3051px 0}.iti-flag.lv{height:10px;background-position:-3073px 0}.iti-flag.ly{height:10px;background-position:-3095px 0}.iti-flag.ma{height:14px;background-position:-3117px 0}.iti-flag.mc{height:15px;background-position:-3139px 0}.iti-flag.md{height:10px;background-position:-3160px 0}.iti-flag.me{height:10px;background-position:-3182px 0}.iti-flag.mf{height:14px;background-position:-3204px 0}.iti-flag.mg{height:14px;background-position:-3226px 0}.iti-flag.mh{height:11px;background-position:-3248px 0}.iti-flag.mk{height:10px;background-position:-3270px 0}.iti-flag.ml{height:14px;background-position:-3292px 0}.iti-flag.mm{height:14px;background-position:-3314px 0}.iti-flag.mn{height:10px;background-position:-3336px 0}.iti-flag.mo{height:14px;background-position:-3358px 0}.iti-flag.mp{height:10px;background-position:-3380px 0}.iti-flag.mq{height:14px;background-position:-3402px 0}.iti-flag.mr{height:14px;background-position:-3424px 0}.iti-flag.ms{height:10px;background-position:-3446px 0}.iti-flag.mt{height:14px;background-position:-3468px 0}.iti-flag.mu{height:14px;background-position:-3490px 0}.iti-flag.mv{height:14px;background-position:-3512px 0}.iti-flag.mw{height:14px;background-position:-3534px 0}.iti-flag.mx{height:12px;background-position:-3556px 0}.iti-flag.my{height:10px;background-position:-3578px 0}.iti-flag.mz{height:14px;background-position:-3600px 0}.iti-flag.na{height:14px;background-position:-3622px 0}.iti-flag.nc{height:10px;background-position:-3644px 0}.iti-flag.ne{height:15px;background-position:-3666px 0}.iti-flag.nf{height:10px;background-position:-3686px 0}.iti-flag.ng{height:10px;background-position:-3708px 0}.iti-flag.ni{height:12px;background-position:-3730px 0}.iti-flag.nl{height:14px;background-position:-3752px 0}.iti-flag.no{height:15px;background-position:-3774px 0}.iti-flag.np{height:15px;background-position:-3796px 0}.iti-flag.nr{height:10px;background-position:-3811px 0}.iti-flag.nu{height:10px;background-position:-3833px 0}.iti-flag.nz{height:10px;background-position:-3855px 0}.iti-flag.om{height:10px;background-position:-3877px 0}.iti-flag.pa{height:14px;background-position:-3899px 0}.iti-flag.pe{height:14px;background-position:-3921px 0}.iti-flag.pf{height:14px;background-position:-3943px 0}.iti-flag.pg{height:15px;background-position:-3965px 0}.iti-flag.ph{height:10px;background-position:-3987px 0}.iti-flag.pk{height:14px;background-position:-4009px 0}.iti-flag.pl{height:13px;background-position:-4031px 0}.iti-flag.pm{height:14px;background-position:-4053px 0}.iti-flag.pn{height:10px;background-position:-4075px 0}.iti-flag.pr{height:14px;background-position:-4097px 0}.iti-flag.ps{height:10px;background-position:-4119px 0}.iti-flag.pt{height:14px;background-position:-4141px 0}.iti-flag.pw{height:13px;background-position:-4163px 0}.iti-flag.py{height:11px;background-position:-4185px 0}.iti-flag.qa{height:8px;background-position:-4207px 0}.iti-flag.re{height:14px;background-position:-4229px 0}.iti-flag.ro{height:14px;background-position:-4251px 0}.iti-flag.rs{height:14px;background-position:-4273px 0}.iti-flag.ru{height:14px;background-position:-4295px 0}.iti-flag.rw{height:14px;background-position:-4317px 0}.iti-flag.sa{height:14px;background-position:-4339px 0}.iti-flag.sb{height:10px;background-position:-4361px 0}.iti-flag.sc{height:10px;background-position:-4383px 0}.iti-flag.sd{height:10px;background-position:-4405px 0}.iti-flag.se{height:13px;background-position:-4427px 0}.iti-flag.sg{height:14px;background-position:-4449px 0}.iti-flag.sh{height:10px;background-position:-4471px 0}.iti-flag.si{height:10px;background-position:-4493px 0}.iti-flag.sj{height:15px;background-position:-4515px 0}.iti-flag.sk{height:14px;background-position:-4537px 0}.iti-flag.sl{height:14px;background-position:-4559px 0}.iti-flag.sm{height:15px;background-position:-4581px 0}.iti-flag.sn{height:14px;background-position:-4603px 0}.iti-flag.so{height:14px;background-position:-4625px 0}.iti-flag.sr{height:14px;background-position:-4647px 0}.iti-flag.ss{height:10px;background-position:-4669px 0}.iti-flag.st{height:10px;background-position:-4691px 0}.iti-flag.sv{height:12px;background-position:-4713px 0}.iti-flag.sx{height:14px;background-position:-4735px 0}.iti-flag.sy{height:14px;background-position:-4757px 0}.iti-flag.sz{height:14px;background-position:-4779px 0}.iti-flag.ta{height:10px;background-position:-4801px 0}.iti-flag.tc{height:10px;background-position:-4823px 0}.iti-flag.td{height:14px;background-position:-4845px 0}.iti-flag.tf{height:14px;background-position:-4867px 0}.iti-flag.tg{height:13px;background-position:-4889px 0}.iti-flag.th{height:14px;background-position:-4911px 0}.iti-flag.tj{height:10px;background-position:-4933px 0}.iti-flag.tk{height:10px;background-position:-4955px 0}.iti-flag.tl{height:10px;background-position:-4977px 0}.iti-flag.tm{height:14px;background-position:-4999px 0}.iti-flag.tn{height:14px;background-position:-5021px 0}.iti-flag.to{height:10px;background-position:-5043px 0}.iti-flag.tr{height:14px;background-position:-5065px 0}.iti-flag.tt{height:12px;background-position:-5087px 0}.iti-flag.tv{height:10px;background-position:-5109px 0}.iti-flag.tw{height:14px;background-position:-5131px 0}.iti-flag.tz{height:14px;background-position:-5153px 0}.iti-flag.ua{height:14px;background-position:-5175px 0}.iti-flag.ug{height:14px;background-position:-5197px 0}.iti-flag.um{height:11px;background-position:-5219px 0}.iti-flag.us{height:11px;background-position:-5241px 0}.iti-flag.uy{height:14px;background-position:-5263px 0}.iti-flag.uz{height:10px;background-position:-5285px 0}.iti-flag.va{height:15px;background-position:-5307px 0}.iti-flag.vc{height:14px;background-position:-5324px 0}.iti-flag.ve{height:14px;background-position:-5346px 0}.iti-flag.vg{height:10px;background-position:-5368px 0}.iti-flag.vi{height:14px;background-position:-5390px 0}.iti-flag.vn{height:14px;background-position:-5412px 0}.iti-flag.vu{height:12px;background-position:-5434px 0}.iti-flag.wf{height:14px;background-position:-5456px 0}.iti-flag.ws{height:10px;background-position:-5478px 0}.iti-flag.xk{height:15px;background-position:-5500px 0}.iti-flag.ye{height:14px;background-position:-5522px 0}.iti-flag.yt{height:14px;background-position:-5544px 0}.iti-flag.za{height:14px;background-position:-5566px 0}.iti-flag.zm{height:14px;background-position:-5588px 0}.iti-flag.zw{height:10px;background-position:-5610px 0}.iti-flag{width:20px;height:15px;box-shadow:0 0 1px 0 #888;background-image:url(flags.png);background-repeat:no-repeat;background-color:#dbdbdb;background-position:20px 0}@media only screen and (-o-min-device-pixel-ratio:2/1),only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:2dppx),only screen and (min-resolution:192dpi){.iti-flag{background-image:url(flags@2x.png)}}.iti-flag.np{background-color:transparent} \ No newline at end of file +.intl-tel-input{position:relative;display:inline-block}.intl-tel-input *{box-sizing:border-box;-moz-box-sizing:border-box}.intl-tel-input .hide{display:none}.intl-tel-input .v-hide{visibility:hidden}.intl-tel-input input,.intl-tel-input input[type=tel],.intl-tel-input input[type=text]{position:relative;z-index:0;margin-top:0!important;margin-bottom:0!important;padding-right:36px;margin-right:0}.intl-tel-input .flag-container{position:absolute;top:0;bottom:0;left:0;padding:1px}.intl-tel-input .selected-flag{z-index:1;position:relative;width:36px;height:100%;padding:0 0 0 8px}.intl-tel-input .selected-flag .iti-flag{position:absolute;top:0;bottom:0;margin:auto}.intl-tel-input .selected-flag .iti-arrow{position:absolute;top:50%;margin-top:-2px;right:6px;width:0;height:0;border-left:3px solid transparent;border-right:3px solid transparent;border-top:4px solid #555}.intl-tel-input .selected-flag .iti-arrow.up{border-top:none;border-bottom:4px solid #555}.intl-tel-input .country-list{position:absolute;z-index:2;list-style:none;text-align:left;padding:0;margin:0 0 0 -1px;box-shadow:1px 1px 4px rgba(0,0,0,.2);background-color:#fff;border:1px solid #ccc;white-space:nowrap;max-height:200px;overflow-y:scroll;-webkit-overflow-scrolling:touch}.intl-tel-input .country-list.dropup{bottom:100%;margin-bottom:-1px}.intl-tel-input .country-list .flag-box{display:inline-block;width:20px}@media (max-width:500px){.intl-tel-input .country-list{white-space:normal}}.intl-tel-input .country-list .divider{padding-bottom:5px;margin-bottom:5px;border-bottom:1px solid #ccc}.intl-tel-input .country-list .country{padding:5px 10px}.intl-tel-input .country-list .country .dial-code{color:#999}.intl-tel-input .country-list .country.highlight{background-color:rgba(0,0,0,.05)}.intl-tel-input .country-list .country-name,.intl-tel-input .country-list .dial-code,.intl-tel-input .country-list .flag-box{vertical-align:middle}.intl-tel-input .country-list .country-name,.intl-tel-input .country-list .flag-box{margin-right:6px}.intl-tel-input.allow-dropdown input,.intl-tel-input.allow-dropdown input[type=tel],.intl-tel-input.allow-dropdown input[type=text]{padding-right:6px;padding-left:52px;margin-left:0}.intl-tel-input.allow-dropdown .flag-container{right:auto;left:0;width:100%}.intl-tel-input.allow-dropdown .selected-flag{width:46px}.intl-tel-input.allow-dropdown .flag-container:hover{cursor:pointer}.intl-tel-input.allow-dropdown .flag-container:hover .selected-flag{background-color:rgba(0,0,0,.05)}.intl-tel-input.allow-dropdown input[disabled]+.flag-container:hover,.intl-tel-input.allow-dropdown input[readonly]+.flag-container:hover{cursor:default}.intl-tel-input.allow-dropdown input[disabled]+.flag-container:hover .selected-flag,.intl-tel-input.allow-dropdown input[readonly]+.flag-container:hover .selected-flag{background-color:transparent}.intl-tel-input.allow-dropdown.separate-dial-code .selected-flag{background-color:rgba(0,0,0,.05);display:table}.intl-tel-input.allow-dropdown.separate-dial-code .selected-dial-code{display:table-cell;vertical-align:middle;padding-left:28px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 input[type=text]{padding-left:76px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 .selected-flag{width:70px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 input[type=text]{padding-left:84px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 .selected-flag{width:78px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 input[type=text]{padding-left:92px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 .selected-flag{width:86px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 input[type=text]{padding-left:100px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 .selected-flag{width:94px}.intl-tel-input.iti-container{position:absolute;top:-1000px;left:-1000px;z-index:1060;padding:1px}.intl-tel-input.iti-container:hover{cursor:pointer}.iti-mobile .intl-tel-input.iti-container{top:30px;bottom:30px;left:30px;right:30px;position:fixed}.iti-mobile .intl-tel-input .country-list{max-height:100%;width:100%;-webkit-overflow-scrolling:touch}.iti-mobile .intl-tel-input .country-list .country{padding:10px;line-height:1.5em}.iti-flag.be{width:18px}.iti-flag.ch{width:15px}.iti-flag.mc{width:19px}.iti-flag.ne{width:18px}.iti-flag.np{width:13px}.iti-flag.va{width:15px}@media only screen and (-o-min-device-pixel-ratio:2/1),only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:2dppx),only screen and (min-resolution:192dpi){.iti-flag{background-size:5630px 15px}}.iti-flag.ac{height:10px;background-position:0 0}.iti-flag.ad{height:14px;background-position:-22px 0}.iti-flag.ae{height:10px;background-position:-44px 0}.iti-flag.af{height:14px;background-position:-66px 0}.iti-flag.ag{height:14px;background-position:-88px 0}.iti-flag.ai{height:10px;background-position:-110px 0}.iti-flag.al{height:15px;background-position:-132px 0}.iti-flag.am{height:10px;background-position:-154px 0}.iti-flag.ao{height:14px;background-position:-176px 0}.iti-flag.aq{height:14px;background-position:-198px 0}.iti-flag.ar{height:13px;background-position:-220px 0}.iti-flag.as{height:10px;background-position:-242px 0}.iti-flag.at{height:14px;background-position:-264px 0}.iti-flag.au{height:10px;background-position:-286px 0}.iti-flag.aw{height:14px;background-position:-308px 0}.iti-flag.ax{height:13px;background-position:-330px 0}.iti-flag.az{height:10px;background-position:-352px 0}.iti-flag.ba{height:10px;background-position:-374px 0}.iti-flag.bb{height:14px;background-position:-396px 0}.iti-flag.bd{height:12px;background-position:-418px 0}.iti-flag.be{height:15px;background-position:-440px 0}.iti-flag.bf{height:14px;background-position:-460px 0}.iti-flag.bg{height:12px;background-position:-482px 0}.iti-flag.bh{height:12px;background-position:-504px 0}.iti-flag.bi{height:12px;background-position:-526px 0}.iti-flag.bj{height:14px;background-position:-548px 0}.iti-flag.bl{height:14px;background-position:-570px 0}.iti-flag.bm{height:10px;background-position:-592px 0}.iti-flag.bn{height:10px;background-position:-614px 0}.iti-flag.bo{height:14px;background-position:-636px 0}.iti-flag.bq{height:14px;background-position:-658px 0}.iti-flag.br{height:14px;background-position:-680px 0}.iti-flag.bs{height:10px;background-position:-702px 0}.iti-flag.bt{height:14px;background-position:-724px 0}.iti-flag.bv{height:15px;background-position:-746px 0}.iti-flag.bw{height:14px;background-position:-768px 0}.iti-flag.by{height:10px;background-position:-790px 0}.iti-flag.bz{height:14px;background-position:-812px 0}.iti-flag.ca{height:10px;background-position:-834px 0}.iti-flag.cc{height:10px;background-position:-856px 0}.iti-flag.cd{height:15px;background-position:-878px 0}.iti-flag.cf{height:14px;background-position:-900px 0}.iti-flag.cg{height:14px;background-position:-922px 0}.iti-flag.ch{height:15px;background-position:-944px 0}.iti-flag.ci{height:14px;background-position:-961px 0}.iti-flag.ck{height:10px;background-position:-983px 0}.iti-flag.cl{height:14px;background-position:-1005px 0}.iti-flag.cm{height:14px;background-position:-1027px 0}.iti-flag.cn{height:14px;background-position:-1049px 0}.iti-flag.co{height:14px;background-position:-1071px 0}.iti-flag.cp{height:14px;background-position:-1093px 0}.iti-flag.cr{height:12px;background-position:-1115px 0}.iti-flag.cu{height:10px;background-position:-1137px 0}.iti-flag.cv{height:12px;background-position:-1159px 0}.iti-flag.cw{height:14px;background-position:-1181px 0}.iti-flag.cx{height:10px;background-position:-1203px 0}.iti-flag.cy{height:14px;background-position:-1225px 0}.iti-flag.cz{height:14px;background-position:-1247px 0}.iti-flag.de{height:12px;background-position:-1269px 0}.iti-flag.dg{height:10px;background-position:-1291px 0}.iti-flag.dj{height:14px;background-position:-1313px 0}.iti-flag.dk{height:15px;background-position:-1335px 0}.iti-flag.dm{height:10px;background-position:-1357px 0}.iti-flag.do{height:13px;background-position:-1379px 0}.iti-flag.dz{height:14px;background-position:-1401px 0}.iti-flag.ea{height:14px;background-position:-1423px 0}.iti-flag.ec{height:14px;background-position:-1445px 0}.iti-flag.ee{height:13px;background-position:-1467px 0}.iti-flag.eg{height:14px;background-position:-1489px 0}.iti-flag.eh{height:10px;background-position:-1511px 0}.iti-flag.er{height:10px;background-position:-1533px 0}.iti-flag.es{height:14px;background-position:-1555px 0}.iti-flag.et{height:10px;background-position:-1577px 0}.iti-flag.eu{height:14px;background-position:-1599px 0}.iti-flag.fi{height:12px;background-position:-1621px 0}.iti-flag.fj{height:10px;background-position:-1643px 0}.iti-flag.fk{height:10px;background-position:-1665px 0}.iti-flag.fm{height:11px;background-position:-1687px 0}.iti-flag.fo{height:15px;background-position:-1709px 0}.iti-flag.fr{height:14px;background-position:-1731px 0}.iti-flag.ga{height:15px;background-position:-1753px 0}.iti-flag.gb{height:10px;background-position:-1775px 0}.iti-flag.gd{height:12px;background-position:-1797px 0}.iti-flag.ge{height:14px;background-position:-1819px 0}.iti-flag.gf{height:14px;background-position:-1841px 0}.iti-flag.gg{height:14px;background-position:-1863px 0}.iti-flag.gh{height:14px;background-position:-1885px 0}.iti-flag.gi{height:10px;background-position:-1907px 0}.iti-flag.gl{height:14px;background-position:-1929px 0}.iti-flag.gm{height:14px;background-position:-1951px 0}.iti-flag.gn{height:14px;background-position:-1973px 0}.iti-flag.gp{height:14px;background-position:-1995px 0}.iti-flag.gq{height:14px;background-position:-2017px 0}.iti-flag.gr{height:14px;background-position:-2039px 0}.iti-flag.gs{height:10px;background-position:-2061px 0}.iti-flag.gt{height:13px;background-position:-2083px 0}.iti-flag.gu{height:11px;background-position:-2105px 0}.iti-flag.gw{height:10px;background-position:-2127px 0}.iti-flag.gy{height:12px;background-position:-2149px 0}.iti-flag.hk{height:14px;background-position:-2171px 0}.iti-flag.hm{height:10px;background-position:-2193px 0}.iti-flag.hn{height:10px;background-position:-2215px 0}.iti-flag.hr{height:10px;background-position:-2237px 0}.iti-flag.ht{height:12px;background-position:-2259px 0}.iti-flag.hu{height:10px;background-position:-2281px 0}.iti-flag.ic{height:14px;background-position:-2303px 0}.iti-flag.id{height:14px;background-position:-2325px 0}.iti-flag.ie{height:10px;background-position:-2347px 0}.iti-flag.il{height:15px;background-position:-2369px 0}.iti-flag.im{height:10px;background-position:-2391px 0}.iti-flag.in{height:14px;background-position:-2413px 0}.iti-flag.io{height:10px;background-position:-2435px 0}.iti-flag.iq{height:14px;background-position:-2457px 0}.iti-flag.ir{height:12px;background-position:-2479px 0}.iti-flag.is{height:15px;background-position:-2501px 0}.iti-flag.it{height:14px;background-position:-2523px 0}.iti-flag.je{height:12px;background-position:-2545px 0}.iti-flag.jm{height:10px;background-position:-2567px 0}.iti-flag.jo{height:10px;background-position:-2589px 0}.iti-flag.jp{height:14px;background-position:-2611px 0}.iti-flag.ke{height:14px;background-position:-2633px 0}.iti-flag.kg{height:12px;background-position:-2655px 0}.iti-flag.kh{height:13px;background-position:-2677px 0}.iti-flag.ki{height:10px;background-position:-2699px 0}.iti-flag.km{height:12px;background-position:-2721px 0}.iti-flag.kn{height:14px;background-position:-2743px 0}.iti-flag.kp{height:10px;background-position:-2765px 0}.iti-flag.kr{height:14px;background-position:-2787px 0}.iti-flag.kw{height:10px;background-position:-2809px 0}.iti-flag.ky{height:10px;background-position:-2831px 0}.iti-flag.kz{height:10px;background-position:-2853px 0}.iti-flag.la{height:14px;background-position:-2875px 0}.iti-flag.lb{height:14px;background-position:-2897px 0}.iti-flag.lc{height:10px;background-position:-2919px 0}.iti-flag.li{height:12px;background-position:-2941px 0}.iti-flag.lk{height:10px;background-position:-2963px 0}.iti-flag.lr{height:11px;background-position:-2985px 0}.iti-flag.ls{height:14px;background-position:-3007px 0}.iti-flag.lt{height:12px;background-position:-3029px 0}.iti-flag.lu{height:12px;background-position:-3051px 0}.iti-flag.lv{height:10px;background-position:-3073px 0}.iti-flag.ly{height:10px;background-position:-3095px 0}.iti-flag.ma{height:14px;background-position:-3117px 0}.iti-flag.mc{height:15px;background-position:-3139px 0}.iti-flag.md{height:10px;background-position:-3160px 0}.iti-flag.me{height:10px;background-position:-3182px 0}.iti-flag.mf{height:14px;background-position:-3204px 0}.iti-flag.mg{height:14px;background-position:-3226px 0}.iti-flag.mh{height:11px;background-position:-3248px 0}.iti-flag.mk{height:10px;background-position:-3270px 0}.iti-flag.ml{height:14px;background-position:-3292px 0}.iti-flag.mm{height:14px;background-position:-3314px 0}.iti-flag.mn{height:10px;background-position:-3336px 0}.iti-flag.mo{height:14px;background-position:-3358px 0}.iti-flag.mp{height:10px;background-position:-3380px 0}.iti-flag.mq{height:14px;background-position:-3402px 0}.iti-flag.mr{height:14px;background-position:-3424px 0}.iti-flag.ms{height:10px;background-position:-3446px 0}.iti-flag.mt{height:14px;background-position:-3468px 0}.iti-flag.mu{height:14px;background-position:-3490px 0}.iti-flag.mv{height:14px;background-position:-3512px 0}.iti-flag.mw{height:14px;background-position:-3534px 0}.iti-flag.mx{height:12px;background-position:-3556px 0}.iti-flag.my{height:10px;background-position:-3578px 0}.iti-flag.mz{height:14px;background-position:-3600px 0}.iti-flag.na{height:14px;background-position:-3622px 0}.iti-flag.nc{height:10px;background-position:-3644px 0}.iti-flag.ne{height:15px;background-position:-3666px 0}.iti-flag.nf{height:10px;background-position:-3686px 0}.iti-flag.ng{height:10px;background-position:-3708px 0}.iti-flag.ni{height:12px;background-position:-3730px 0}.iti-flag.nl{height:14px;background-position:-3752px 0}.iti-flag.no{height:15px;background-position:-3774px 0}.iti-flag.np{height:15px;background-position:-3796px 0}.iti-flag.nr{height:10px;background-position:-3811px 0}.iti-flag.nu{height:10px;background-position:-3833px 0}.iti-flag.nz{height:10px;background-position:-3855px 0}.iti-flag.om{height:10px;background-position:-3877px 0}.iti-flag.pa{height:14px;background-position:-3899px 0}.iti-flag.pe{height:14px;background-position:-3921px 0}.iti-flag.pf{height:14px;background-position:-3943px 0}.iti-flag.pg{height:15px;background-position:-3965px 0}.iti-flag.ph{height:10px;background-position:-3987px 0}.iti-flag.pk{height:14px;background-position:-4009px 0}.iti-flag.pl{height:13px;background-position:-4031px 0}.iti-flag.pm{height:14px;background-position:-4053px 0}.iti-flag.pn{height:10px;background-position:-4075px 0}.iti-flag.pr{height:14px;background-position:-4097px 0}.iti-flag.ps{height:10px;background-position:-4119px 0}.iti-flag.pt{height:14px;background-position:-4141px 0}.iti-flag.pw{height:13px;background-position:-4163px 0}.iti-flag.py{height:11px;background-position:-4185px 0}.iti-flag.qa{height:8px;background-position:-4207px 0}.iti-flag.re{height:14px;background-position:-4229px 0}.iti-flag.ro{height:14px;background-position:-4251px 0}.iti-flag.rs{height:14px;background-position:-4273px 0}.iti-flag.ru{height:14px;background-position:-4295px 0}.iti-flag.rw{height:14px;background-position:-4317px 0}.iti-flag.sa{height:14px;background-position:-4339px 0}.iti-flag.sb{height:10px;background-position:-4361px 0}.iti-flag.sc{height:10px;background-position:-4383px 0}.iti-flag.sd{height:10px;background-position:-4405px 0}.iti-flag.se{height:13px;background-position:-4427px 0}.iti-flag.sg{height:14px;background-position:-4449px 0}.iti-flag.sh{height:10px;background-position:-4471px 0}.iti-flag.si{height:10px;background-position:-4493px 0}.iti-flag.sj{height:15px;background-position:-4515px 0}.iti-flag.sk{height:14px;background-position:-4537px 0}.iti-flag.sl{height:14px;background-position:-4559px 0}.iti-flag.sm{height:15px;background-position:-4581px 0}.iti-flag.sn{height:14px;background-position:-4603px 0}.iti-flag.so{height:14px;background-position:-4625px 0}.iti-flag.sr{height:14px;background-position:-4647px 0}.iti-flag.ss{height:10px;background-position:-4669px 0}.iti-flag.st{height:10px;background-position:-4691px 0}.iti-flag.sv{height:12px;background-position:-4713px 0}.iti-flag.sx{height:14px;background-position:-4735px 0}.iti-flag.sy{height:14px;background-position:-4757px 0}.iti-flag.sz{height:14px;background-position:-4779px 0}.iti-flag.ta{height:10px;background-position:-4801px 0}.iti-flag.tc{height:10px;background-position:-4823px 0}.iti-flag.td{height:14px;background-position:-4845px 0}.iti-flag.tf{height:14px;background-position:-4867px 0}.iti-flag.tg{height:13px;background-position:-4889px 0}.iti-flag.th{height:14px;background-position:-4911px 0}.iti-flag.tj{height:10px;background-position:-4933px 0}.iti-flag.tk{height:10px;background-position:-4955px 0}.iti-flag.tl{height:10px;background-position:-4977px 0}.iti-flag.tm{height:14px;background-position:-4999px 0}.iti-flag.tn{height:14px;background-position:-5021px 0}.iti-flag.to{height:10px;background-position:-5043px 0}.iti-flag.tr{height:14px;background-position:-5065px 0}.iti-flag.tt{height:12px;background-position:-5087px 0}.iti-flag.tv{height:10px;background-position:-5109px 0}.iti-flag.tw{height:14px;background-position:-5131px 0}.iti-flag.tz{height:14px;background-position:-5153px 0}.iti-flag.ua{height:14px;background-position:-5175px 0}.iti-flag.ug{height:14px;background-position:-5197px 0}.iti-flag.um{height:11px;background-position:-5219px 0}.iti-flag.us{height:11px;background-position:-5241px 0}.iti-flag.uy{height:14px;background-position:-5263px 0}.iti-flag.uz{height:10px;background-position:-5285px 0}.iti-flag.va{height:15px;background-position:-5307px 0}.iti-flag.vc{height:14px;background-position:-5324px 0}.iti-flag.ve{height:14px;background-position:-5346px 0}.iti-flag.vg{height:10px;background-position:-5368px 0}.iti-flag.vi{height:14px;background-position:-5390px 0}.iti-flag.vn{height:14px;background-position:-5412px 0}.iti-flag.vu{height:12px;background-position:-5434px 0}.iti-flag.wf{height:14px;background-position:-5456px 0}.iti-flag.ws{height:10px;background-position:-5478px 0}.iti-flag.xk{height:15px;background-position:-5500px 0}.iti-flag.ye{height:14px;background-position:-5522px 0}.iti-flag.yt{height:14px;background-position:-5544px 0}.iti-flag.za{height:14px;background-position:-5566px 0}.iti-flag.zm{height:14px;background-position:-5588px 0}.iti-flag.zw{height:10px;background-position:-5610px 0}.iti-flag{width:20px;height:15px;box-shadow:0 0 1px 0 #888;background-image:url(flags.png);background-repeat:no-repeat;background-color:#dbdbdb;background-position:20px 0}@media only screen and (-o-min-device-pixel-ratio:2/1),only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:2dppx),only screen and (min-resolution:192dpi){.iti-flag{background-image:url(flags@2x.png)}}.iti-flag.np{background-color:transparent} \ No newline at end of file diff --git a/dist/main.js b/dist/main.js index 3795ebdf6..273dcf90b 100644 --- a/dist/main.js +++ b/dist/main.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prop-types"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["prop-types","react","react-dom"],t):"object"==typeof exports?exports.IntlTelInput=t(require("prop-types"),require("react"),require("react-dom")):e.IntlTelInput=t(e.PropTypes,e.React,e.ReactDOM)}(this,function(e,t,o){return function(e){function t(i){if(o[i])return o[i].exports;var n=o[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,i){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=14)}([function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t,o){var i,n;!function(){"use strict";function o(){for(var e=[],t=0;t=0},retrieveLiIndex:function(e){if(!e)return-1;for(var t=e.parentNode.childNodes,o=0,i=0,n=t.length;i-1;)s.splice(t,1),n&&(t<=a&&a--,t<=l&&l--)}),this},has:function(e){return g(e,s)>-1},empty:function(){return s=[],this},disable:function(){return s=d=t=void 0,this},disabled:function(){return!s},lock:function(){return d=void 0,t||p.disable(),this},locked:function(){return!d},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!s||i&&!d||(n?d.push(t):u(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},M.Deferred=function(e){var t=[["resolve","done",M.Callbacks("once memory"),"resolved"],["reject","fail",M.Callbacks("once memory"),"rejected"],["notify","progress",M.Callbacks("memory")]],o="pending",i={state:function(){return o},always:function(){return n.done(arguments).fail(arguments),this},then:function(){var e=arguments;return M.Deferred(function(o){c(t,function(t,i){var r=t[0],a=e[i];n[t[1]](p(a)?function(){var e;try{e=a.apply(this,arguments)}catch(e){return void o.reject(e)}e&&p(e.promise)?e.promise().done(o.resolve).fail(o.reject).progress(o.notify):o["notify"!==r?"resolveWith":r+"With"](this===n?o:this,[e])}:o[r])}),e=null}).promise()},promise:function(e){return null!=e?h(e,i):i}},n={};return i.pipe=i.then,c(t,function(e,r){var a=e[2],l=e[3];i[e[1]]=a.add,l&&a.add(function(){o=l},t[1^r][2].disable,t[2][2].lock),n[e[0]]=a.fire,n[e[0]+"With"]=a.fireWith}),i.promise(n),e&&e.call(n,n),n},M.when=function(e){var t,o,i,n=0,r="array"===f(e)&&1===arguments.length?e:u.call(arguments),a=r.length,l=1!==a||e&&p(e.promise)?a:0,s=1===l?e:M.Deferred(),d=function(e,o,i){return function(n){o[e]=this,i[e]=arguments.length>1?u.call(arguments):n,i===t?s.notifyWith(o,i):--l||s.resolveWith(o,i)}};if(a>1)for(t=new Array(a),o=new Array(a),i=new Array(a);n1?t-1:0),i=1;it,l=!r&&a?"-"+(n-1)+"px":"";this.listElement.style.top=l,this.listElement.setAttribute("class","country-list")}},{key:"setFlag",value:function(e){this.props.setFlag(e)}},{key:"appendListItem",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.props.preferredCountries.length;return e.map(function(e,n){var r=o?n:n+i,l={country:!0,highlight:t.props.highlightedCountry===r,preferred:o},d=c()(l),u=o?"pref-":"";return s.a.createElement("li",{key:""+u+e.iso2,className:d,"data-dial-code":e.dialCode,"data-country-code":e.iso2,onMouseOver:t.props.isMobile?null:t.handleMouseOver,onClick:a(t.setFlag,e.iso2)},s.a.createElement("div",{ref:function(e){t.selectedFlag=e},className:"flag-box"},s.a.createElement("div",{ref:function(e){t.selectedFlagInner=e},className:"iti-flag "+e.iso2})),s.a.createElement("span",{className:"country-name"},e.name),s.a.createElement("span",{className:"dial-code"},"+",e.dialCode))})}},{key:"handleMouseOver",value:function(e){if(e.currentTarget.getAttribute("class").indexOf("country")>-1){var t=p.a.retrieveLiIndex(e.currentTarget);this.props.changeHighlightCountry(!0,t)}}},{key:"render",value:function(){var e=this,t="",o=this.props.preferredCountries,i=null,n=this.props.countries,r=c()({"country-list":!0,hide:!this.props.showDropdown}),a=null;return o.length&&(i=this.appendListItem(o,!0),a=s.a.createElement("div",{className:"divider"})),t=this.appendListItem(n),s.a.createElement("ul",{ref:function(t){e.listElement=t},className:r},i,a,t)}}]),t}(l.Component);t.a=g},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=o(1),l=o.n(a),s=o(0),d=(o.n(s),o(5)),u=o.n(d),c=function(){function e(e,t){for(var o=0;o=4},o.wrapperClass={},o.autoCountry="",o.tempCountry="",o.startedLoadingAutoCountry=!1,o.deferreds=[],o.autoCountryDeferred=new p.a.Deferred,o.utilsScriptDeferred=new p.a.Deferred,o.isOpening=!1,o.isMobile="undefined"!=typeof navigator&&k.test(navigator.userAgent),o.preferredCountries=[],o.countries=[],o.countryCodes={},o.windowLoaded=!1,o.keys={UP:38,DOWN:40,ENTER:13,ESC:27,PLUS:43,A:65,Z:90,SPACE:32,TAB:9},o.query="",o.state={showDropdown:!1,highlightedCountry:0,value:e.value||e.defaultValue,disabled:e.disabled,readonly:!1,offsetTop:0,outerHeight:0,placeholder:"",title:"",countryCode:"us",dialCode:""},o.selectedCountryData={},o.addCountryCode=o.addCountryCode.bind(o),o.autoCountryLoaded=o.autoCountryLoaded.bind(o),o.getDialCode=o.getDialCode.bind(o),o.handleOnBlur=o.handleOnBlur.bind(o),o.handleSelectedFlagKeydown=o.handleSelectedFlagKeydown.bind(o),o.setInitialState=o.setInitialState.bind(o),o.setNumber=o.setNumber.bind(o),o.scrollTo=o.scrollTo.bind(o),o.updateDialCode=o.updateDialCode.bind(o),o.notifyPhoneNumberChange=o.notifyPhoneNumberChange.bind(o),o.isValidNumber=o.isValidNumber.bind(o),o.isUnknownNanp=o.isUnknownNanp.bind(o),o.initRequests=o.initRequests.bind(o),o.updateFlagFromNumber=o.updateFlagFromNumber.bind(o),o.updatePlaceholder=o.updatePlaceholder.bind(o),o.loadAutoCountry=o.loadAutoCountry.bind(o),o.loadUtils=o.loadUtils.bind(o),o.processCountryData=o.processCountryData.bind(o),o.getNumber=o.getNumber.bind(o),o.setFlag=o.setFlag.bind(o),o.clickSelectedFlag=o.clickSelectedFlag.bind(o),o.updateValFromNumber=o.updateValFromNumber.bind(o),o.handleWindowScroll=o.handleWindowScroll.bind(o),o.handleDocumentKeyDown=o.handleDocumentKeyDown.bind(o),o.handleDocumentClick=o.handleDocumentClick.bind(o),o.bindDocumentClick=o.bindDocumentClick.bind(o),o.unbindDocumentClick=o.unbindDocumentClick.bind(o),o.searchForCountry=o.searchForCountry.bind(o),o.handleEnterKey=o.handleEnterKey.bind(o),o.toggleDropdown=o.toggleDropdown.bind(o),o.handleUpDownKey=o.handleUpDownKey.bind(o),o.handleInputChange=o.handleInputChange.bind(o),o.changeHighlightCountry=o.changeHighlightCountry.bind(o),o.formatNumber=o.formatNumber.bind(o),o}return r(t,e),b(t,[{key:"componentDidMount",value:function(){var e=this;this.autoHideDialCode=this.props.autoHideDialCode,this.allowDropdown=this.props.allowDropdown,this.nationalMode=this.props.nationalMode,this.dropdownContainer="",this.nationalMode&&(this.autoHideDialCode=!1),this.props.separateDialCode&&(this.autoHideDialCode=!1,this.nationalMode=!1,this.allowDropdown=!0),this.processCountryData.call(this),this.tempCountry=this.getTempCountry(this.props.defaultCountry),"complete"===document.readyState?this.windowLoaded=!0:window.addEventListener("load",function(){e.windowLoaded=!0}),this.generateMarkup(),this.setInitialState(),this.initRequests(),this.deferreds.push(this.autoCountryDeferred.promise()),this.deferreds.push(this.utilsScriptDeferred.promise()),p.a.when(this.deferreds).done(function(){e.setInitialState()}),document.addEventListener("keydown",this.handleDocumentKeyDown)}},{key:"componentWillReceiveProps",value:function(e){this.props.value!==e.value&&this.setState({value:e.value}),this.props.disabled!==e.disabled&&this.setState({disabled:e.disabled}),"function"==typeof e.customPlaceholder&&this.props.customPlaceholder!==e.customPlaceholder&&this.updatePlaceholder(e)}},{key:"componentWillUpdate",value:function(e,t){t.showDropdown?(document.addEventListener("keydown",this.handleDocumentKeyDown),this.bindDocumentClick()):(document.removeEventListener("keydown",this.handleDocumentKeyDown),this.unbindDocumentClick())}},{key:"componentDidUpdate",value:function(e){this.props.value!==e.value&&this.updateFlagFromNumber(this.props.value)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleDocumentKeyDown),window.removeEventListener("scroll",this.handleWindowScroll),this.unbindDocumentClick()}},{key:"getTempCountry",value:function(e){if("auto"===e)return"auto";var t=M.a.getCountryData(this.countries,e);return t.iso2||(t=this.props.preferredCountries.length>0?M.a.getCountryData(this.countries,this.props.preferredCountries[0]):g.a.getCountries()[0]),t.iso2}},{key:"setNumber",value:function(e,t){this.updateFlagFromNumber(e),this.updateValFromNumber(e,!t)}},{key:"setFlag",value:function(e,t){var o=this,i=this.selectedCountryData&&this.selectedCountryData.iso2?this.selectedCountryData:{};this.selectedCountryData=e?M.a.getCountryData(this.countries,e,!1,!1,this.props.noCountryDataHandler):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2);var n=e?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown",r=this.state.dialCode;this.props.separateDialCode&&(r=this.selectedCountryData.dialCode?"+"+this.selectedCountryData.dialCode:"",i.dialCode&&delete this.wrapperClass["iti-sdc-"+(i.dialCode.length+1)],r&&(this.wrapperClass["iti-sdc-"+r.length]=!0));var a=0;e&&"auto"!==e&&(a=M.a.findIndex(this.preferredCountries,function(t){return t.iso2===e}),a===-1&&(a=M.a.findIndex(this.countries,function(t){return t.iso2===e}),a===-1&&(a=0),a+=this.preferredCountries.length)),this.tel&&this.state.showDropdown&&this.tel.focus();var l=this.updateDialCode(this.selectedCountryData.dialCode,!t);this.setState({value:l,showDropdown:!1,highlightedCountry:a,countryCode:e,title:n,dialCode:r},function(){if(o.updatePlaceholder(o.props),o.wrapperClass.active=!1,!t&&i.iso2!==e&&"function"==typeof o.props.onSelectFlag){var n=o.state.value;o.props.onSelectFlag(n,o.selectedCountryData)}})}},{key:"getExtension",value:function(e){return window.intlTelInputUtils?window.intlTelInputUtils.getExtension(this.getFullNumber(e),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(e,t){return window.intlTelInputUtils?window.intlTelInputUtils.formatNumber(this.getFullNumber(e),this.selectedCountryData.iso2,t):""}},{key:"getFullNumber",value:function(e){var t=this.props.separateDialCode?"+"+this.selectedCountryData.dialCode:"";return t+e}},{key:"getDialCode",value:function(e){var t="";if("+"===e.charAt(0))for(var o="",i=0,n=e.length;it?e.substr(0,t):e}},{key:"removeEmptyDialCode",value:function(){var e=this.state.value,t="+"===e.charAt(0);if(t){var o=M.a.getNumeric(e);o&&this.selectedCountryData.dialCode!==o||this.setState({value:""})}}},{key:"handleUpDownKey",value:function(e){var t=this.flagDropDown.querySelectorAll(".highlight")[0],o=t?t.previousElementSibling:void 0,i=t?t.nextElementSibling:void 0,n=e===this.keys.UP?o:i;if(n){n.getAttribute("class").indexOf("divider")>-1&&(n=e===this.keys.UP?n.previousElementSibling:n.nextElementSibling),this.scrollTo(n);var r=M.a.retrieveLiIndex(n);this.setState({showDropdown:!0,highlightedCountry:r})}}},{key:"handleEnterKey",value:function(){var e=this,t=this.flagDropDown.querySelectorAll(".highlight")[0];if(t){var o=M.a.retrieveLiIndex(t),i=t.getAttribute("data-country-code");this.setState({showDropdown:!1,highlightedCountry:o,countryCode:i},function(){e.setFlag(e.state.countryCode),e.unbindDocumentClick()})}}},{key:"searchForCountry",value:function(e){for(var t=0,o=this.countries.length;t2&&void 0!==arguments[2]&&arguments[2];if(t&&window.intlTelInputUtils&&this.selectedCountryData){var n=this.props.separateDialCode||!this.nationalMode&&"+"===e.charAt(0)?window.intlTelInputUtils.numberFormat.INTERNATIONAL:window.intlTelInputUtils.numberFormat.NATIONAL;e=window.intlTelInputUtils.formatNumber(e,this.selectedCountryData.iso2,n)}e=this.beforeSetNumber(e),this.setState({showDropdown:!1,value:e},function(){i&&o.notifyPhoneNumberChange(o.state.value),o.unbindDocumentClick()})}},{key:"updateFlagFromNumber",value:function(e,t){e&&this.nationalMode&&this.selectedCountryData&&"1"===this.selectedCountryData.dialCode&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1"+e),e="+"+e);var o=this.getDialCode(e),i=null;if(o){var n=this.countryCodes[M.a.getNumeric(o)],r=this.selectedCountryData&&n.indexOf(this.selectedCountryData.iso2)!==-1;if(!r||this.isUnknownNanp(e,o))for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:this.props;if(window.intlTelInputUtils&&e.autoPlaceholder&&this.selectedCountryData){var t=window.intlTelInputUtils.numberType[e.numberType],o=this.selectedCountryData.iso2?window.intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.nationalMode,t):"";o=this.beforeSetNumber(o,e),"function"==typeof e.customPlaceholder&&(o=e.customPlaceholder(o,this.selectedCountryData)),this.setState({placeholder:o})}}},{key:"toggleDropdown",value:function(e){var t=this;this.setState({showDropdown:!!e},function(){t.state.showDropdown||t.unbindDocumentClick()})}},{key:"scrollTo",value:function(e,t){try{var o=this.flagDropDown.querySelector(".country-list"),i=parseFloat(window.getComputedStyle(o).getPropertyValue("height"),10),n=M.a.offset(o).top,r=n+i,a=M.a.getOuterHeight(e),l=M.a.offset(e).top,s=l+a,d=i/2-a/2,u=l-n+o.scrollTop;if(lr){t&&(u+=d);var c=i-a;o.scrollTop=u-c}}catch(e){}}},{key:"updateDialCode",value:function(e,t){var o=this.state.value;if(!e)return o;var i=o;if(e="+"+e,"+"===o.charAt(0)){var n=this.getDialCode(o);i=n?o.replace(n,e):e}else this.nationalMode||this.props.separateDialCode||(o?i=e+o:!t&&this.autoHideDialCode||(i=e));return i!==o&&this.notifyPhoneNumberChange(i),i}},{key:"generateMarkup",value:function(){this.wrapperClass["allow-dropdown"]=this.allowDropdown,this.wrapperClass["separate-dial-code"]=this.props.separateDialCode,this.isMobile&&this.props.useMobileFullscreenDropdown&&(M.a.addClass(document.querySelector("body"),"iti-mobile"),this.dropdownContainer="body",window.addEventListener("scroll",this.handleWindowScroll))}},{key:"handleSelectedFlagKeydown",value:function(e){this.state.showDropdown||e.which!==this.keys.UP&&e.which!==this.keys.DOWN&&e.which!==this.keys.SPACE&&e.which!==this.keys.ENTER||(e.preventDefault(),e.stopPropagation(),this.toggleDropdown(!0)),e.which===this.keys.TAB&&this.toggleDropdown(!1)}},{key:"isValidNumber",value:function(e){var t=M.a.trim(e),o=this.nationalMode||this.props.separateDialCode?this.selectedCountryData.iso2:"";return!!window.intlTelInputUtils&&window.intlTelInputUtils.isValidNumber(t,o)}},{key:"formatFullNumber",value:function(e){return window.intlTelInputUtils?this.getNumber(e,window.intlTelInputUtils.numberFormat.INTERNATIONAL):e}},{key:"notifyPhoneNumberChange",value:function(e){if("function"==typeof this.props.onPhoneNumberChange){var t=this.formatFullNumber(e),o=this.isValidNumber(t);this.props.onPhoneNumberChange(o,e,this.selectedCountryData,t,this.getExtension(e))}}},{key:"beforeSetNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props;if(t.separateDialCode){var o=this.getDialCode(e);if(o){null!==this.selectedCountryData.areaCodes&&(o="+"+this.selectedCountryData.dialCode);var i=" "===e[o.length]||"-"===e[o.length]?o.length+1:o.length;e=e.substr(i)}}return this.cap(e)}},{key:"handleWindowScroll",value:function(){var e=this;this.setState({showDropdown:!1},function(){window.removeEventListener("scroll",e.handleWindowScroll)})}},{key:"handleDocumentKeyDown",value:function(e){var t=this,o=void 0;e.preventDefault(),e.which===this.keys.UP||e.which===this.keys.DOWN?this.handleUpDownKey(e.which):e.which===this.keys.ENTER?this.handleEnterKey():e.which===this.keys.ESC?this.setState({showDropdown:!1}):(e.which>=this.keys.A&&e.which<=this.keys.Z||e.which===this.keys.SPACE)&&(o&&clearTimeout(o),this.query||(this.query=""),this.query+=String.fromCharCode(e.which),this.searchForCountry(this.query),o=setTimeout(function(){t.query=""},1e3))}},{key:"handleDocumentClick",value:function(e){(null===e.target.getAttribute("class")||e.target.getAttribute("class")&&e.target.getAttribute("class").indexOf("country")===-1)&&(this.isOpening=!1),this.isOpening||this.toggleDropdown(!1),this.isOpening=!1}},{key:"handleInputChange",value:function(e){var t=this,o=this.props.format?this.formatNumber(e.target.value):e.target.value;void 0!==this.props.value?(this.updateFlagFromNumber(o),this.notifyPhoneNumberChange(o)):this.setState({value:o},function(){t.updateFlagFromNumber(o),t.notifyPhoneNumberChange(o)})}},{key:"changeHighlightCountry",value:function(e,t){this.setState({showDropdown:e,highlightedCountry:t})}},{key:"loadUtils",value:function(){var e=this;if(window.intlTelInputUtils)return void this.utilsScriptDeferred.resolve();var t=new XMLHttpRequest;t.open("GET",this.props.utilsScript,!0),t.onload=function(){if(t.status>=200&&t.status<400){var o=t.responseText;if(o&&!document.getElementById("intlTelInputUtils")){var i=document.getElementsByTagName("body")[0],n=document.createElement("script");n.id="intlTelInputUtils",n.text=o,i.appendChild(n)}e.utilsScriptDeferred.resolve()}},t.send()}},{key:"autoCountryLoaded",value:function(){"auto"===this.tempCountry&&(this.tempCountry=this.autoCountry,this.autoCountryDeferred.resolve())}},{key:"render",value:function(){this.wrapperClass[this.props.css[0]]=!0;var e=this.props.css[1],t=Object.assign({},this.props.style||{});this.wrapperClass.expanded=this.state.showDropdown;var o=u()(this.wrapperClass),i=this.selectedCountryData?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown",n=void 0!==this.props.value?this.props.value:this.state.value;return l.a.createElement("div",{className:o,style:t},l.a.createElement(m.a,{refCallback:this.setFlagDropdownRef,allowDropdown:this.allowDropdown,dropdownContainer:this.dropdownContainer,separateDialCode:this.props.separateDialCode,dialCode:this.state.dialCode,clickSelectedFlag:this.clickSelectedFlag,setFlag:this.setFlag,countryCode:this.state.countryCode,isMobile:this.isMobile,handleSelectedFlagKeydown:this.handleSelectedFlagKeydown,changeHighlightCountry:this.changeHighlightCountry,countries:this.countries,showDropdown:this.state.showDropdown,inputTop:this.state.offsetTop,inputOuterHeight:this.state.outerHeight,preferredCountries:this.preferredCountries,highlightedCountry:this.state.highlightedCountry,titleTip:i}),l.a.createElement(f.a,{refCallback:this.setTelRef,handleInputChange:this.handleInputChange,handleOnBlur:this.handleOnBlur,className:e,disabled:this.state.disabled,readonly:this.state.readonly,fieldName:this.props.fieldName,fieldId:this.props.fieldId,value:n,placeholder:void 0!==this.props.placeholder?this.props.placeholder:this.state.placeholder,autoFocus:this.props.autoFocus,autoComplete:this.props.autoComplete,inputProps:this.props.telInputProps}))}}]),t}(a.Component);y.defaultProps={css:["intl-tel-input",""],fieldName:"",fieldId:"",defaultValue:"",countriesData:null,allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:!0,customPlaceholder:null,excludeCountries:[],formatOnInit:!0,separateDialCode:!1,defaultCountry:"",geoIpLookup:null,nationalMode:!0,numberType:"MOBILE",noCountryDataHandler:null,onlyCountries:[],preferredCountries:["us","gb"],utilsScript:"",onPhoneNumberChange:null,onPhoneNumberBlur:null,onSelectFlag:null,disabled:!1,autoFocus:!1,useMobileFullscreenDropdown:!0,autoComplete:"off",telInputProps:{},format:!1},t.default=y}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prop-types"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["prop-types","react","react-dom"],t):"object"==typeof exports?exports.IntlTelInput=t(require("prop-types"),require("react"),require("react-dom")):e.IntlTelInput=t(e.PropTypes,e.React,e.ReactDOM)}(this,function(e,t,o){return function(e){function t(i){if(o[i])return o[i].exports;var n=o[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,i){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=14)}([function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t,o){var i,n;!function(){"use strict";function o(){for(var e=[],t=0;t=0},retrieveLiIndex:function(e){if(!e)return-1;for(var t=e.parentNode.childNodes,o=0,i=0,n=t.length;i-1;)s.splice(t,1),n&&(t<=a&&a--,t<=l&&l--)}),this},has:function(e){return g(e,s)>-1},empty:function(){return s=[],this},disable:function(){return s=d=t=void 0,this},disabled:function(){return!s},lock:function(){return d=void 0,t||p.disable(),this},locked:function(){return!d},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!s||i&&!d||(n?d.push(t):u(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},M.Deferred=function(e){var t=[["resolve","done",M.Callbacks("once memory"),"resolved"],["reject","fail",M.Callbacks("once memory"),"rejected"],["notify","progress",M.Callbacks("memory")]],o="pending",i={state:function(){return o},always:function(){return n.done(arguments).fail(arguments),this},then:function(){var e=arguments;return M.Deferred(function(o){c(t,function(t,i){var r=t[0],a=e[i];n[t[1]](p(a)?function(){var e;try{e=a.apply(this,arguments)}catch(e){return void o.reject(e)}e&&p(e.promise)?e.promise().done(o.resolve).fail(o.reject).progress(o.notify):o["notify"!==r?"resolveWith":r+"With"](this===n?o:this,[e])}:o[r])}),e=null}).promise()},promise:function(e){return null!=e?h(e,i):i}},n={};return i.pipe=i.then,c(t,function(e,r){var a=e[2],l=e[3];i[e[1]]=a.add,l&&a.add(function(){o=l},t[1^r][2].disable,t[2][2].lock),n[e[0]]=a.fire,n[e[0]+"With"]=a.fireWith}),i.promise(n),e&&e.call(n,n),n},M.when=function(e){var t,o,i,n=0,r="array"===f(e)&&1===arguments.length?e:u.call(arguments),a=r.length,l=1!==a||e&&p(e.promise)?a:0,s=1===l?e:M.Deferred(),d=function(e,o,i){return function(n){o[e]=this,i[e]=arguments.length>1?u.call(arguments):n,i===t?s.notifyWith(o,i):--l||s.resolveWith(o,i)}};if(a>1)for(t=new Array(a),o=new Array(a),i=new Array(a);n1?t-1:0),i=1;it,l=!r&&a?"-"+(n-1)+"px":"";this.listElement.style.top=l,this.listElement.setAttribute("class","country-list")}},{key:"setFlag",value:function(e){this.props.setFlag(e)}},{key:"appendListItem",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.props.preferredCountries.length;return e.map(function(e,n){var r=o?n:n+i,l={country:!0,highlight:t.props.highlightedCountry===r,preferred:o},d=c()(l),u=o?"pref-":"",p=t.props.selectedCountryCode===e.iso2;return s.a.createElement("li",{key:""+u+e.iso2,className:d,"data-dial-code":e.dialCode,"data-country-code":e.iso2,onMouseOver:t.props.isMobile?null:t.handleMouseOver,onClick:a(t.setFlag,e.iso2),role:"option","aria-selected":p,id:t.props.getItemId(r),tabIndex:"-1"},s.a.createElement("div",{ref:function(e){t.selectedFlag=e},className:"flag-box"},s.a.createElement("div",{ref:function(e){t.selectedFlagInner=e},className:"iti-flag "+e.iso2})),s.a.createElement("span",{className:"country-name"},e.name),s.a.createElement("span",{className:"dial-code"},"+",e.dialCode))})}},{key:"handleMouseOver",value:function(e){if(e.currentTarget.getAttribute("class").indexOf("country")>-1){var t=p.a.retrieveLiIndex(e.currentTarget);this.props.changeHighlightCountry(!0,t)}}},{key:"render",value:function(){var e=this,t="",o=this.props.preferredCountries,i=null,n=this.props.countries,r=c()({"country-list":!0,hide:!this.props.showDropdown}),a=null;return o.length&&(i=this.appendListItem(o,!0),a=s.a.createElement("div",{className:"divider"})),t=this.appendListItem(n),s.a.createElement("ul",{ref:function(t){e.listElement=t},className:r,id:this.props.countryListId,role:"listbox"},i,a,t)}}]),t}(l.Component);t.a=g},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=o(1),l=o.n(a),s=o(0),d=(o.n(s),o(5)),u=o.n(d),c=function(){function e(e,t){for(var o=0;o=4},o.wrapperClass={},o.autoCountry="",o.tempCountry="",o.startedLoadingAutoCountry=!1,o.deferreds=[],o.autoCountryDeferred=new p.a.Deferred,o.utilsScriptDeferred=new p.a.Deferred,o.isOpening=!1,o.isMobile="undefined"!=typeof navigator&&k.test(navigator.userAgent),o.preferredCountries=[],o.countries=[],o.countryCodes={},o.windowLoaded=!1,o.keys={UP:38,DOWN:40,ENTER:13,ESC:27,PLUS:43,A:65,Z:90,SPACE:32,TAB:9},o.query="",o.state={showDropdown:!1,highlightedCountry:0,value:e.value||e.defaultValue,disabled:e.disabled,readonly:!1,offsetTop:0,outerHeight:0,placeholder:"",title:"",countryCode:"us",dialCode:""},o.selectedCountryData={},o.addCountryCode=o.addCountryCode.bind(o),o.autoCountryLoaded=o.autoCountryLoaded.bind(o),o.getDialCode=o.getDialCode.bind(o),o.handleOnBlur=o.handleOnBlur.bind(o),o.handleSelectedFlagKeydown=o.handleSelectedFlagKeydown.bind(o),o.setInitialState=o.setInitialState.bind(o),o.setNumber=o.setNumber.bind(o),o.scrollTo=o.scrollTo.bind(o),o.updateDialCode=o.updateDialCode.bind(o),o.notifyPhoneNumberChange=o.notifyPhoneNumberChange.bind(o),o.isValidNumber=o.isValidNumber.bind(o),o.isUnknownNanp=o.isUnknownNanp.bind(o),o.initRequests=o.initRequests.bind(o),o.updateFlagFromNumber=o.updateFlagFromNumber.bind(o),o.updatePlaceholder=o.updatePlaceholder.bind(o),o.loadAutoCountry=o.loadAutoCountry.bind(o),o.loadUtils=o.loadUtils.bind(o),o.processCountryData=o.processCountryData.bind(o),o.getNumber=o.getNumber.bind(o),o.setFlag=o.setFlag.bind(o),o.clickSelectedFlag=o.clickSelectedFlag.bind(o),o.updateValFromNumber=o.updateValFromNumber.bind(o),o.handleWindowScroll=o.handleWindowScroll.bind(o),o.handleDocumentKeyDown=o.handleDocumentKeyDown.bind(o),o.handleDocumentClick=o.handleDocumentClick.bind(o),o.bindDocumentClick=o.bindDocumentClick.bind(o),o.unbindDocumentClick=o.unbindDocumentClick.bind(o),o.searchForCountry=o.searchForCountry.bind(o),o.handleEnterKey=o.handleEnterKey.bind(o),o.toggleDropdown=o.toggleDropdown.bind(o),o.handleUpDownKey=o.handleUpDownKey.bind(o),o.handleInputChange=o.handleInputChange.bind(o),o.changeHighlightCountry=o.changeHighlightCountry.bind(o),o.formatNumber=o.formatNumber.bind(o),o.uniqueId=Math.random().toString(36).substring(2),o}return r(t,e),b(t,[{key:"componentDidMount",value:function(){var e=this;this.autoHideDialCode=this.props.autoHideDialCode,this.allowDropdown=this.props.allowDropdown,this.nationalMode=this.props.nationalMode,this.dropdownContainer="",this.nationalMode&&(this.autoHideDialCode=!1),this.props.separateDialCode&&(this.autoHideDialCode=!1,this.nationalMode=!1,this.allowDropdown=!0),this.processCountryData.call(this),this.tempCountry=this.getTempCountry(this.props.defaultCountry),"complete"===document.readyState?this.windowLoaded=!0:window.addEventListener("load",function(){e.windowLoaded=!0}),this.generateMarkup(),this.setInitialState(),this.initRequests(),this.deferreds.push(this.autoCountryDeferred.promise()),this.deferreds.push(this.utilsScriptDeferred.promise()),p.a.when(this.deferreds).done(function(){e.setInitialState()}),document.addEventListener("keydown",this.handleDocumentKeyDown)}},{key:"componentWillReceiveProps",value:function(e){this.props.value!==e.value&&this.setState({value:e.value}),this.props.disabled!==e.disabled&&this.setState({disabled:e.disabled}),"function"==typeof e.customPlaceholder&&this.props.customPlaceholder!==e.customPlaceholder&&this.updatePlaceholder(e)}},{key:"componentWillUpdate",value:function(e,t){t.showDropdown?(document.addEventListener("keydown",this.handleDocumentKeyDown),this.bindDocumentClick()):(document.removeEventListener("keydown",this.handleDocumentKeyDown),this.unbindDocumentClick())}},{key:"componentDidUpdate",value:function(e){this.props.value!==e.value&&this.updateFlagFromNumber(this.props.value)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleDocumentKeyDown),window.removeEventListener("scroll",this.handleWindowScroll),this.unbindDocumentClick()}},{key:"getTempCountry",value:function(e){if("auto"===e)return"auto";var t=M.a.getCountryData(this.countries,e);return t.iso2||(t=this.props.preferredCountries.length>0?M.a.getCountryData(this.countries,this.props.preferredCountries[0]):g.a.getCountries()[0]),t.iso2}},{key:"setNumber",value:function(e,t){this.updateFlagFromNumber(e),this.updateValFromNumber(e,!t)}},{key:"setFlag",value:function(e,t){var o=this,i=this.selectedCountryData&&this.selectedCountryData.iso2?this.selectedCountryData:{};this.selectedCountryData=e?M.a.getCountryData(this.countries,e,!1,!1,this.props.noCountryDataHandler):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2);var n=e?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown",r=this.state.dialCode;this.props.separateDialCode&&(r=this.selectedCountryData.dialCode?"+"+this.selectedCountryData.dialCode:"",i.dialCode&&delete this.wrapperClass["iti-sdc-"+(i.dialCode.length+1)],r&&(this.wrapperClass["iti-sdc-"+r.length]=!0));var a=0;e&&"auto"!==e&&(a=M.a.findIndex(this.preferredCountries,function(t){return t.iso2===e}),a===-1&&(a=M.a.findIndex(this.countries,function(t){return t.iso2===e}),a===-1&&(a=0),a+=this.preferredCountries.length)),this.tel&&this.state.showDropdown&&this.tel.focus();var l=this.updateDialCode(this.selectedCountryData.dialCode,!t);this.setState({value:l,showDropdown:!1,highlightedCountry:a,countryCode:e,title:n,dialCode:r},function(){if(o.updatePlaceholder(o.props),o.wrapperClass.active=!1,!t&&i.iso2!==e&&"function"==typeof o.props.onSelectFlag){var n=o.state.value;o.props.onSelectFlag(n,o.selectedCountryData)}})}},{key:"getExtension",value:function(e){return window.intlTelInputUtils?window.intlTelInputUtils.getExtension(this.getFullNumber(e),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(e,t){return window.intlTelInputUtils?window.intlTelInputUtils.formatNumber(this.getFullNumber(e),this.selectedCountryData.iso2,t):""}},{key:"getFullNumber",value:function(e){var t=this.props.separateDialCode?"+"+this.selectedCountryData.dialCode:"";return t+e}},{key:"getDialCode",value:function(e){var t="";if("+"===e.charAt(0))for(var o="",i=0,n=e.length;it?e.substr(0,t):e}},{key:"removeEmptyDialCode",value:function(){var e=this.state.value,t="+"===e.charAt(0);if(t){var o=M.a.getNumeric(e);o&&this.selectedCountryData.dialCode!==o||this.setState({value:""})}}},{key:"handleUpDownKey",value:function(e){var t=this.flagDropDown.querySelectorAll(".highlight")[0],o=t?t.previousElementSibling:void 0,i=t?t.nextElementSibling:void 0,n=e===this.keys.UP?o:i;if(n){n.getAttribute("class").indexOf("divider")>-1&&(n=e===this.keys.UP?n.previousElementSibling:n.nextElementSibling),this.scrollTo(n);var r=M.a.retrieveLiIndex(n);this.setState({showDropdown:!0,highlightedCountry:r})}}},{key:"handleEnterKey",value:function(){var e=this,t=this.flagDropDown.querySelectorAll(".highlight")[0];if(t){var o=M.a.retrieveLiIndex(t),i=t.getAttribute("data-country-code");this.setState({showDropdown:!1,highlightedCountry:o,countryCode:i},function(){e.setFlag(e.state.countryCode),e.unbindDocumentClick()})}}},{key:"searchForCountry",value:function(e){for(var t=0,o=this.countries.length;t2&&void 0!==arguments[2]&&arguments[2];if(t&&window.intlTelInputUtils&&this.selectedCountryData){var n=this.props.separateDialCode||!this.nationalMode&&"+"===e.charAt(0)?window.intlTelInputUtils.numberFormat.INTERNATIONAL:window.intlTelInputUtils.numberFormat.NATIONAL;e=window.intlTelInputUtils.formatNumber(e,this.selectedCountryData.iso2,n)}e=this.beforeSetNumber(e),this.setState({showDropdown:!1,value:e},function(){i&&o.notifyPhoneNumberChange(o.state.value),o.unbindDocumentClick()})}},{key:"updateFlagFromNumber",value:function(e,t){e&&this.nationalMode&&this.selectedCountryData&&"1"===this.selectedCountryData.dialCode&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1"+e),e="+"+e);var o=this.getDialCode(e),i=null;if(o){var n=this.countryCodes[M.a.getNumeric(o)],r=this.selectedCountryData&&n.indexOf(this.selectedCountryData.iso2)!==-1;if(!r||this.isUnknownNanp(e,o))for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:this.props;if(window.intlTelInputUtils&&e.autoPlaceholder&&this.selectedCountryData){var t=window.intlTelInputUtils.numberType[e.numberType],o=this.selectedCountryData.iso2?window.intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.nationalMode,t):"";o=this.beforeSetNumber(o,e),"function"==typeof e.customPlaceholder&&(o=e.customPlaceholder(o,this.selectedCountryData)),this.setState({placeholder:o})}}},{key:"toggleDropdown",value:function(e){var t=this;this.setState({showDropdown:!!e},function(){t.state.showDropdown||t.unbindDocumentClick()})}},{key:"scrollTo",value:function(e,t){try{var o=this.flagDropDown.querySelector(".country-list"),i=parseFloat(window.getComputedStyle(o).getPropertyValue("height"),10),n=M.a.offset(o).top,r=n+i,a=M.a.getOuterHeight(e),l=M.a.offset(e).top,s=l+a,d=i/2-a/2,u=l-n+o.scrollTop;if(lr){t&&(u+=d);var c=i-a;o.scrollTop=u-c}}catch(e){}}},{key:"updateDialCode",value:function(e,t){var o=this.state.value;if(!e)return o;var i=o;if(e="+"+e,"+"===o.charAt(0)){var n=this.getDialCode(o);i=n?o.replace(n,e):e}else this.nationalMode||this.props.separateDialCode||(o?i=e+o:!t&&this.autoHideDialCode||(i=e));return i!==o&&this.notifyPhoneNumberChange(i),i}},{key:"generateMarkup",value:function(){this.wrapperClass["allow-dropdown"]=this.allowDropdown,this.wrapperClass["separate-dial-code"]=this.props.separateDialCode,this.isMobile&&this.props.useMobileFullscreenDropdown&&(M.a.addClass(document.querySelector("body"),"iti-mobile"),this.dropdownContainer="body",window.addEventListener("scroll",this.handleWindowScroll))}},{key:"handleSelectedFlagKeydown",value:function(e){this.state.showDropdown||e.which!==this.keys.UP&&e.which!==this.keys.DOWN&&e.which!==this.keys.SPACE&&e.which!==this.keys.ENTER||(e.preventDefault(),e.stopPropagation(),this.toggleDropdown(!0)),e.which===this.keys.TAB&&this.toggleDropdown(!1)}},{key:"isValidNumber",value:function(e){var t=M.a.trim(e),o=this.nationalMode||this.props.separateDialCode?this.selectedCountryData.iso2:"";return!!window.intlTelInputUtils&&window.intlTelInputUtils.isValidNumber(t,o)}},{key:"formatFullNumber",value:function(e){return window.intlTelInputUtils?this.getNumber(e,window.intlTelInputUtils.numberFormat.INTERNATIONAL):e}},{key:"notifyPhoneNumberChange",value:function(e){if("function"==typeof this.props.onPhoneNumberChange){var t=this.formatFullNumber(e),o=this.isValidNumber(t);this.props.onPhoneNumberChange(o,e,this.selectedCountryData,t,this.getExtension(e))}}},{key:"beforeSetNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props;if(t.separateDialCode){var o=this.getDialCode(e);if(o){null!==this.selectedCountryData.areaCodes&&(o="+"+this.selectedCountryData.dialCode);var i=" "===e[o.length]||"-"===e[o.length]?o.length+1:o.length;e=e.substr(i)}}return this.cap(e)}},{key:"handleWindowScroll",value:function(){var e=this;this.setState({showDropdown:!1},function(){window.removeEventListener("scroll",e.handleWindowScroll)})}},{key:"handleDocumentKeyDown",value:function(e){var t=this,o=void 0;e.preventDefault(),e.which===this.keys.UP||e.which===this.keys.DOWN?this.handleUpDownKey(e.which):e.which===this.keys.ENTER?this.handleEnterKey():e.which===this.keys.ESC?this.setState({showDropdown:!1}):(e.which>=this.keys.A&&e.which<=this.keys.Z||e.which===this.keys.SPACE)&&(o&&clearTimeout(o),this.query||(this.query=""),this.query+=String.fromCharCode(e.which),this.searchForCountry(this.query),o=setTimeout(function(){t.query=""},1e3))}},{key:"handleDocumentClick",value:function(e){(null===e.target.getAttribute("class")||e.target.getAttribute("class")&&e.target.getAttribute("class").indexOf("country")===-1)&&(this.isOpening=!1),this.isOpening||this.toggleDropdown(!1),this.isOpening=!1}},{key:"handleInputChange",value:function(e){var t=this,o=this.props.format?this.formatNumber(e.target.value):e.target.value;void 0!==this.props.value?(this.updateFlagFromNumber(o),this.notifyPhoneNumberChange(o)):this.setState({value:o},function(){t.updateFlagFromNumber(o),t.notifyPhoneNumberChange(o)})}},{key:"changeHighlightCountry",value:function(e,t){this.setState({showDropdown:e,highlightedCountry:t})}},{key:"loadUtils",value:function(){var e=this;if(window.intlTelInputUtils)return void this.utilsScriptDeferred.resolve();var t=new XMLHttpRequest;t.open("GET",this.props.utilsScript,!0),t.onload=function(){if(t.status>=200&&t.status<400){var o=t.responseText;if(o&&!document.getElementById("intlTelInputUtils")){var i=document.getElementsByTagName("body")[0],n=document.createElement("script");n.id="intlTelInputUtils",n.text=o,i.appendChild(n)}e.utilsScriptDeferred.resolve()}},t.send()}},{key:"autoCountryLoaded",value:function(){"auto"===this.tempCountry&&(this.tempCountry=this.autoCountry,this.autoCountryDeferred.resolve())}},{key:"render",value:function(){this.wrapperClass[this.props.css[0]]=!0;var e=this.props.css[1],t=Object.assign({},this.props.style||{});this.wrapperClass.expanded=this.state.showDropdown;var o=u()(this.wrapperClass),i=this.selectedCountryData?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown",n=void 0!==this.props.value?this.props.value:this.state.value;return l.a.createElement("div",{className:o,style:t},l.a.createElement(m.a,{refCallback:this.setFlagDropdownRef,allowDropdown:this.allowDropdown,dropdownContainer:this.dropdownContainer,separateDialCode:this.props.separateDialCode,dialCode:this.state.dialCode,clickSelectedFlag:this.clickSelectedFlag,setFlag:this.setFlag,countryCode:this.state.countryCode,isMobile:this.isMobile,handleSelectedFlagKeydown:this.handleSelectedFlagKeydown,changeHighlightCountry:this.changeHighlightCountry,countries:this.countries,showDropdown:this.state.showDropdown,inputTop:this.state.offsetTop,inputOuterHeight:this.state.outerHeight,preferredCountries:this.preferredCountries,highlightedCountry:this.state.highlightedCountry,titleTip:i,flagDropdownProps:this.props.flagDropdownProps,uniqueId:this.uniqueId}),l.a.createElement(f.a,{refCallback:this.setTelRef,handleInputChange:this.handleInputChange,handleOnBlur:this.handleOnBlur,className:e,disabled:this.state.disabled,readonly:this.state.readonly,fieldName:this.props.fieldName,fieldId:this.props.fieldId,value:n,placeholder:void 0!==this.props.placeholder?this.props.placeholder:this.state.placeholder,autoFocus:this.props.autoFocus,autoComplete:this.props.autoComplete,inputProps:this.props.telInputProps}))}}]),t}(a.Component);y.defaultProps={css:["intl-tel-input",""],fieldName:"",fieldId:"",defaultValue:"",countriesData:null,allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:!0,customPlaceholder:null,excludeCountries:[],formatOnInit:!0,separateDialCode:!1,defaultCountry:"",geoIpLookup:null,nationalMode:!0,numberType:"MOBILE",noCountryDataHandler:null,onlyCountries:[],preferredCountries:["us","gb"],utilsScript:"",onPhoneNumberChange:null,onPhoneNumberBlur:null,onSelectFlag:null,disabled:!1,autoFocus:!1,useMobileFullscreenDropdown:!0,autoComplete:"off",telInputProps:{},flagDropdownProps:{},format:!1},t.default=y}])}); \ No newline at end of file diff --git a/example/example.js b/example/example.js index 05bfdd0f8..1f1ee4ce3 100644 --- a/example/example.js +++ b/example/example.js @@ -1,3 +1,3 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prop-types"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["prop-types","react","react-dom"],t):"object"==typeof exports?exports.IntlTelInput=t(require("prop-types"),require("react"),require("react-dom")):e.IntlTelInput=t(e.PropTypes,e.React,e.ReactDOM)}(this,function(e,t,o){return function(e){function t(n){if(o[n])return o[n].exports;var i=o[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=28)}([function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t,o){var n,i;!function(){"use strict";function o(){for(var e=[],t=0;t=0},retrieveLiIndex:function(e){if(!e)return-1;for(var t=e.parentNode.childNodes,o=0,n=0,i=t.length;n-1;)s.splice(t,1),i&&(t<=a&&a--,t<=l&&l--)}),this},has:function(e){return f(e,s)>-1},empty:function(){return s=[],this},disable:function(){return s=u=t=void 0,this},disabled:function(){return!s},lock:function(){return u=void 0,t||h.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!s||n&&!u||(i?u.push(t):d(t)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h},b.Deferred=function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],o="pending",n={state:function(){return o},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(o){c(t,function(t,n){var r=t[0],a=e[n];i[t[1]](h(a)?function(){var e;try{e=a.apply(this,arguments)}catch(e){return void o.reject(e)}e&&h(e.promise)?e.promise().done(o.resolve).fail(o.reject).progress(o.notify):o["notify"!==r?"resolveWith":r+"With"](this===i?o:this,[e])}:o[r])}),e=null}).promise()},promise:function(e){return null!=e?p(e,n):n}},i={};return n.pipe=n.then,c(t,function(e,r){var a=e[2],l=e[3];n[e[1]]=a.add,l&&a.add(function(){o=l},t[1^r][2].disable,t[2][2].lock),i[e[0]]=a.fire,i[e[0]+"With"]=a.fireWith}),n.promise(i),e&&e.call(i,i),i},b.when=function(e){var t,o,n,i=0,r="array"===g(e)&&1===arguments.length?e:d.call(arguments),a=r.length,l=1!==a||e&&h(e.promise)?a:0,s=1===l?e:b.Deferred(),u=function(e,o,n){return function(i){o[e]=this,n[e]=arguments.length>1?d.call(arguments):i,n===t?s.notifyWith(o,n):--l||s.resolveWith(o,n)}};if(a>1)for(t=new Array(a),o=new Array(a),n=new Array(a);i1?t-1:0),n=1;nt,l=!r&&a?"-"+(i-1)+"px":"";this.listElement.style.top=l,this.listElement.setAttribute("class","country-list")}},{key:"setFlag",value:function(e){this.props.setFlag(e)}},{key:"appendListItem",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.props.preferredCountries.length;return e.map(function(e,i){var r=o?i:i+n,l={country:!0,highlight:t.props.highlightedCountry===r,preferred:o},u=c()(l),d=o?"pref-":"";return s.a.createElement("li",{key:""+d+e.iso2,className:u,"data-dial-code":e.dialCode,"data-country-code":e.iso2,onMouseOver:t.props.isMobile?null:t.handleMouseOver,onClick:a(t.setFlag,e.iso2)},s.a.createElement("div",{ref:function(e){t.selectedFlag=e},className:"flag-box"},s.a.createElement("div",{ref:function(e){t.selectedFlagInner=e},className:"iti-flag "+e.iso2})),s.a.createElement("span",{className:"country-name"},e.name),s.a.createElement("span",{className:"dial-code"},"+",e.dialCode))})}},{key:"handleMouseOver",value:function(e){if(e.currentTarget.getAttribute("class").indexOf("country")>-1){var t=h.a.retrieveLiIndex(e.currentTarget);this.props.changeHighlightCountry(!0,t)}}},{key:"render",value:function(){var e=this,t="",o=this.props.preferredCountries,n=null,i=this.props.countries,r=c()({"country-list":!0,hide:!this.props.showDropdown}),a=null;return o.length&&(n=this.appendListItem(o,!0),a=s.a.createElement("div",{className:"divider"})),t=this.appendListItem(i),s.a.createElement("ul",{ref:function(t){e.listElement=t},className:r},n,a,t)}}]),t}(l.Component);t.a=f},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=o(1),l=o.n(a),s=o(0),u=(o.n(s),o(5)),d=o.n(u),c=function(){function e(e,t){for(var o=0;o=4},o.wrapperClass={},o.autoCountry="",o.tempCountry="",o.startedLoadingAutoCountry=!1,o.deferreds=[],o.autoCountryDeferred=new h.a.Deferred,o.utilsScriptDeferred=new h.a.Deferred,o.isOpening=!1,o.isMobile="undefined"!=typeof navigator&&S.test(navigator.userAgent),o.preferredCountries=[],o.countries=[],o.countryCodes={},o.windowLoaded=!1,o.keys={UP:38,DOWN:40,ENTER:13,ESC:27,PLUS:43,A:65,Z:90,SPACE:32,TAB:9},o.query="",o.state={showDropdown:!1,highlightedCountry:0,value:e.value||e.defaultValue,disabled:e.disabled,readonly:!1,offsetTop:0,outerHeight:0,placeholder:"",title:"",countryCode:"us",dialCode:""},o.selectedCountryData={},o.addCountryCode=o.addCountryCode.bind(o),o.autoCountryLoaded=o.autoCountryLoaded.bind(o),o.getDialCode=o.getDialCode.bind(o),o.handleOnBlur=o.handleOnBlur.bind(o),o.handleSelectedFlagKeydown=o.handleSelectedFlagKeydown.bind(o),o.setInitialState=o.setInitialState.bind(o),o.setNumber=o.setNumber.bind(o),o.scrollTo=o.scrollTo.bind(o),o.updateDialCode=o.updateDialCode.bind(o),o.notifyPhoneNumberChange=o.notifyPhoneNumberChange.bind(o),o.isValidNumber=o.isValidNumber.bind(o),o.isUnknownNanp=o.isUnknownNanp.bind(o),o.initRequests=o.initRequests.bind(o),o.updateFlagFromNumber=o.updateFlagFromNumber.bind(o),o.updatePlaceholder=o.updatePlaceholder.bind(o),o.loadAutoCountry=o.loadAutoCountry.bind(o),o.loadUtils=o.loadUtils.bind(o),o.processCountryData=o.processCountryData.bind(o),o.getNumber=o.getNumber.bind(o),o.setFlag=o.setFlag.bind(o),o.clickSelectedFlag=o.clickSelectedFlag.bind(o),o.updateValFromNumber=o.updateValFromNumber.bind(o),o.handleWindowScroll=o.handleWindowScroll.bind(o),o.handleDocumentKeyDown=o.handleDocumentKeyDown.bind(o),o.handleDocumentClick=o.handleDocumentClick.bind(o),o.bindDocumentClick=o.bindDocumentClick.bind(o),o.unbindDocumentClick=o.unbindDocumentClick.bind(o),o.searchForCountry=o.searchForCountry.bind(o),o.handleEnterKey=o.handleEnterKey.bind(o),o.toggleDropdown=o.toggleDropdown.bind(o),o.handleUpDownKey=o.handleUpDownKey.bind(o),o.handleInputChange=o.handleInputChange.bind(o),o.changeHighlightCountry=o.changeHighlightCountry.bind(o),o.formatNumber=o.formatNumber.bind(o),o}return r(t,e),M(t,[{key:"componentDidMount",value:function(){var e=this;this.autoHideDialCode=this.props.autoHideDialCode,this.allowDropdown=this.props.allowDropdown,this.nationalMode=this.props.nationalMode,this.dropdownContainer="",this.nationalMode&&(this.autoHideDialCode=!1),this.props.separateDialCode&&(this.autoHideDialCode=!1,this.nationalMode=!1,this.allowDropdown=!0),this.processCountryData.call(this),this.tempCountry=this.getTempCountry(this.props.defaultCountry),"complete"===document.readyState?this.windowLoaded=!0:window.addEventListener("load",function(){e.windowLoaded=!0}),this.generateMarkup(),this.setInitialState(),this.initRequests(),this.deferreds.push(this.autoCountryDeferred.promise()),this.deferreds.push(this.utilsScriptDeferred.promise()),h.a.when(this.deferreds).done(function(){e.setInitialState()}),document.addEventListener("keydown",this.handleDocumentKeyDown)}},{key:"componentWillReceiveProps",value:function(e){this.props.value!==e.value&&this.setState({value:e.value}),this.props.disabled!==e.disabled&&this.setState({disabled:e.disabled}),"function"==typeof e.customPlaceholder&&this.props.customPlaceholder!==e.customPlaceholder&&this.updatePlaceholder(e)}},{key:"componentWillUpdate",value:function(e,t){t.showDropdown?(document.addEventListener("keydown",this.handleDocumentKeyDown),this.bindDocumentClick()):(document.removeEventListener("keydown",this.handleDocumentKeyDown),this.unbindDocumentClick())}},{key:"componentDidUpdate",value:function(e){this.props.value!==e.value&&this.updateFlagFromNumber(this.props.value)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleDocumentKeyDown),window.removeEventListener("scroll",this.handleWindowScroll),this.unbindDocumentClick()}},{key:"getTempCountry",value:function(e){if("auto"===e)return"auto";var t=b.a.getCountryData(this.countries,e);return t.iso2||(t=this.props.preferredCountries.length>0?b.a.getCountryData(this.countries,this.props.preferredCountries[0]):f.a.getCountries()[0]),t.iso2}},{key:"setNumber",value:function(e,t){this.updateFlagFromNumber(e),this.updateValFromNumber(e,!t)}},{key:"setFlag",value:function(e,t){var o=this,n=this.selectedCountryData&&this.selectedCountryData.iso2?this.selectedCountryData:{};this.selectedCountryData=e?b.a.getCountryData(this.countries,e,!1,!1,this.props.noCountryDataHandler):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2);var i=e?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown",r=this.state.dialCode;this.props.separateDialCode&&(r=this.selectedCountryData.dialCode?"+"+this.selectedCountryData.dialCode:"",n.dialCode&&delete this.wrapperClass["iti-sdc-"+(n.dialCode.length+1)],r&&(this.wrapperClass["iti-sdc-"+r.length]=!0));var a=0;e&&"auto"!==e&&(a=b.a.findIndex(this.preferredCountries,function(t){return t.iso2===e}),a===-1&&(a=b.a.findIndex(this.countries,function(t){return t.iso2===e}),a===-1&&(a=0),a+=this.preferredCountries.length)),this.tel&&this.state.showDropdown&&this.tel.focus();var l=this.updateDialCode(this.selectedCountryData.dialCode,!t);this.setState({value:l,showDropdown:!1,highlightedCountry:a,countryCode:e,title:i,dialCode:r},function(){if(o.updatePlaceholder(o.props),o.wrapperClass.active=!1,!t&&n.iso2!==e&&"function"==typeof o.props.onSelectFlag){var i=o.state.value;o.props.onSelectFlag(i,o.selectedCountryData)}})}},{key:"getExtension",value:function(e){return window.intlTelInputUtils?window.intlTelInputUtils.getExtension(this.getFullNumber(e),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(e,t){return window.intlTelInputUtils?window.intlTelInputUtils.formatNumber(this.getFullNumber(e),this.selectedCountryData.iso2,t):""}},{key:"getFullNumber",value:function(e){var t=this.props.separateDialCode?"+"+this.selectedCountryData.dialCode:"";return t+e}},{key:"getDialCode",value:function(e){var t="";if("+"===e.charAt(0))for(var o="",n=0,i=e.length;nt?e.substr(0,t):e}},{key:"removeEmptyDialCode",value:function(){var e=this.state.value,t="+"===e.charAt(0);if(t){var o=b.a.getNumeric(e);o&&this.selectedCountryData.dialCode!==o||this.setState({value:""})}}},{key:"handleUpDownKey",value:function(e){var t=this.flagDropDown.querySelectorAll(".highlight")[0],o=t?t.previousElementSibling:void 0,n=t?t.nextElementSibling:void 0,i=e===this.keys.UP?o:n;if(i){i.getAttribute("class").indexOf("divider")>-1&&(i=e===this.keys.UP?i.previousElementSibling:i.nextElementSibling),this.scrollTo(i);var r=b.a.retrieveLiIndex(i);this.setState({showDropdown:!0,highlightedCountry:r})}}},{key:"handleEnterKey",value:function(){var e=this,t=this.flagDropDown.querySelectorAll(".highlight")[0];if(t){var o=b.a.retrieveLiIndex(t),n=t.getAttribute("data-country-code");this.setState({showDropdown:!1,highlightedCountry:o,countryCode:n},function(){e.setFlag(e.state.countryCode),e.unbindDocumentClick()})}}},{key:"searchForCountry",value:function(e){for(var t=0,o=this.countries.length;t2&&void 0!==arguments[2]&&arguments[2];if(t&&window.intlTelInputUtils&&this.selectedCountryData){var i=this.props.separateDialCode||!this.nationalMode&&"+"===e.charAt(0)?window.intlTelInputUtils.numberFormat.INTERNATIONAL:window.intlTelInputUtils.numberFormat.NATIONAL;e=window.intlTelInputUtils.formatNumber(e,this.selectedCountryData.iso2,i)}e=this.beforeSetNumber(e),this.setState({showDropdown:!1,value:e},function(){n&&o.notifyPhoneNumberChange(o.state.value),o.unbindDocumentClick()})}},{key:"updateFlagFromNumber",value:function(e,t){e&&this.nationalMode&&this.selectedCountryData&&"1"===this.selectedCountryData.dialCode&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1"+e),e="+"+e);var o=this.getDialCode(e),n=null;if(o){var i=this.countryCodes[b.a.getNumeric(o)],r=this.selectedCountryData&&i.indexOf(this.selectedCountryData.iso2)!==-1;if(!r||this.isUnknownNanp(e,o))for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:this.props;if(window.intlTelInputUtils&&e.autoPlaceholder&&this.selectedCountryData){var t=window.intlTelInputUtils.numberType[e.numberType],o=this.selectedCountryData.iso2?window.intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.nationalMode,t):"";o=this.beforeSetNumber(o,e),"function"==typeof e.customPlaceholder&&(o=e.customPlaceholder(o,this.selectedCountryData)),this.setState({placeholder:o})}}},{key:"toggleDropdown",value:function(e){var t=this;this.setState({showDropdown:!!e},function(){t.state.showDropdown||t.unbindDocumentClick()})}},{key:"scrollTo",value:function(e,t){try{var o=this.flagDropDown.querySelector(".country-list"),n=parseFloat(window.getComputedStyle(o).getPropertyValue("height"),10),i=b.a.offset(o).top,r=i+n,a=b.a.getOuterHeight(e),l=b.a.offset(e).top,s=l+a,u=n/2-a/2,d=l-i+o.scrollTop;if(lr){t&&(d+=u);var c=n-a;o.scrollTop=d-c}}catch(e){}}},{key:"updateDialCode",value:function(e,t){var o=this.state.value;if(!e)return o;var n=o;if(e="+"+e,"+"===o.charAt(0)){var i=this.getDialCode(o);n=i?o.replace(i,e):e}else this.nationalMode||this.props.separateDialCode||(o?n=e+o:!t&&this.autoHideDialCode||(n=e));return n!==o&&this.notifyPhoneNumberChange(n),n}},{key:"generateMarkup",value:function(){this.wrapperClass["allow-dropdown"]=this.allowDropdown,this.wrapperClass["separate-dial-code"]=this.props.separateDialCode,this.isMobile&&this.props.useMobileFullscreenDropdown&&(b.a.addClass(document.querySelector("body"),"iti-mobile"),this.dropdownContainer="body",window.addEventListener("scroll",this.handleWindowScroll))}},{key:"handleSelectedFlagKeydown",value:function(e){this.state.showDropdown||e.which!==this.keys.UP&&e.which!==this.keys.DOWN&&e.which!==this.keys.SPACE&&e.which!==this.keys.ENTER||(e.preventDefault(),e.stopPropagation(),this.toggleDropdown(!0)),e.which===this.keys.TAB&&this.toggleDropdown(!1)}},{key:"isValidNumber",value:function(e){var t=b.a.trim(e),o=this.nationalMode||this.props.separateDialCode?this.selectedCountryData.iso2:"";return!!window.intlTelInputUtils&&window.intlTelInputUtils.isValidNumber(t,o)}},{key:"formatFullNumber",value:function(e){return window.intlTelInputUtils?this.getNumber(e,window.intlTelInputUtils.numberFormat.INTERNATIONAL):e}},{key:"notifyPhoneNumberChange",value:function(e){if("function"==typeof this.props.onPhoneNumberChange){var t=this.formatFullNumber(e),o=this.isValidNumber(t);this.props.onPhoneNumberChange(o,e,this.selectedCountryData,t,this.getExtension(e))}}},{key:"beforeSetNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props;if(t.separateDialCode){var o=this.getDialCode(e);if(o){null!==this.selectedCountryData.areaCodes&&(o="+"+this.selectedCountryData.dialCode);var n=" "===e[o.length]||"-"===e[o.length]?o.length+1:o.length;e=e.substr(n)}}return this.cap(e)}},{key:"handleWindowScroll",value:function(){var e=this;this.setState({showDropdown:!1},function(){window.removeEventListener("scroll",e.handleWindowScroll)})}},{key:"handleDocumentKeyDown",value:function(e){var t=this,o=void 0;e.preventDefault(),e.which===this.keys.UP||e.which===this.keys.DOWN?this.handleUpDownKey(e.which):e.which===this.keys.ENTER?this.handleEnterKey():e.which===this.keys.ESC?this.setState({showDropdown:!1}):(e.which>=this.keys.A&&e.which<=this.keys.Z||e.which===this.keys.SPACE)&&(o&&clearTimeout(o),this.query||(this.query=""),this.query+=String.fromCharCode(e.which),this.searchForCountry(this.query),o=setTimeout(function(){t.query=""},1e3))}},{key:"handleDocumentClick",value:function(e){(null===e.target.getAttribute("class")||e.target.getAttribute("class")&&e.target.getAttribute("class").indexOf("country")===-1)&&(this.isOpening=!1),this.isOpening||this.toggleDropdown(!1),this.isOpening=!1}},{key:"handleInputChange",value:function(e){var t=this,o=this.props.format?this.formatNumber(e.target.value):e.target.value;void 0!==this.props.value?(this.updateFlagFromNumber(o),this.notifyPhoneNumberChange(o)):this.setState({value:o},function(){t.updateFlagFromNumber(o),t.notifyPhoneNumberChange(o)})}},{key:"changeHighlightCountry",value:function(e,t){this.setState({showDropdown:e,highlightedCountry:t})}},{key:"loadUtils",value:function(){var e=this;if(window.intlTelInputUtils)return void this.utilsScriptDeferred.resolve();var t=new XMLHttpRequest;t.open("GET",this.props.utilsScript,!0),t.onload=function(){if(t.status>=200&&t.status<400){var o=t.responseText;if(o&&!document.getElementById("intlTelInputUtils")){var n=document.getElementsByTagName("body")[0],i=document.createElement("script");i.id="intlTelInputUtils",i.text=o,n.appendChild(i)}e.utilsScriptDeferred.resolve()}},t.send()}},{key:"autoCountryLoaded",value:function(){"auto"===this.tempCountry&&(this.tempCountry=this.autoCountry,this.autoCountryDeferred.resolve())}},{key:"render",value:function(){this.wrapperClass[this.props.css[0]]=!0;var e=this.props.css[1],t=Object.assign({},this.props.style||{});this.wrapperClass.expanded=this.state.showDropdown;var o=d()(this.wrapperClass),n=this.selectedCountryData?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown",i=void 0!==this.props.value?this.props.value:this.state.value;return l.a.createElement("div",{className:o,style:t},l.a.createElement(m.a,{refCallback:this.setFlagDropdownRef,allowDropdown:this.allowDropdown,dropdownContainer:this.dropdownContainer,separateDialCode:this.props.separateDialCode,dialCode:this.state.dialCode,clickSelectedFlag:this.clickSelectedFlag,setFlag:this.setFlag,countryCode:this.state.countryCode,isMobile:this.isMobile,handleSelectedFlagKeydown:this.handleSelectedFlagKeydown,changeHighlightCountry:this.changeHighlightCountry,countries:this.countries,showDropdown:this.state.showDropdown,inputTop:this.state.offsetTop,inputOuterHeight:this.state.outerHeight,preferredCountries:this.preferredCountries,highlightedCountry:this.state.highlightedCountry,titleTip:n}),l.a.createElement(g.a,{refCallback:this.setTelRef,handleInputChange:this.handleInputChange,handleOnBlur:this.handleOnBlur,className:e,disabled:this.state.disabled,readonly:this.state.readonly,fieldName:this.props.fieldName,fieldId:this.props.fieldId,value:i,placeholder:void 0!==this.props.placeholder?this.props.placeholder:this.state.placeholder,autoFocus:this.props.autoFocus,autoComplete:this.props.autoComplete,inputProps:this.props.telInputProps}))}}]),t}(a.Component);k.defaultProps={css:["intl-tel-input",""],fieldName:"",fieldId:"",defaultValue:"",countriesData:null,allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:!0,customPlaceholder:null,excludeCountries:[],formatOnInit:!0,separateDialCode:!1,defaultCountry:"",geoIpLookup:null,nationalMode:!0,numberType:"MOBILE",noCountryDataHandler:null,onlyCountries:[],preferredCountries:["us","gb"],utilsScript:"",onPhoneNumberChange:null,onPhoneNumberBlur:null,onSelectFlag:null,disabled:!1,autoFocus:!1,useMobileFullscreenDropdown:!0,autoComplete:"off",telInputProps:{},format:!1},t.default=k},function(e,t,o){"use strict";function n(){}function i(e){try{return e.then}catch(e){return b=e,y}}function r(e,t){try{return e(t)}catch(e){return b=e,y}}function a(e,t,o){try{e(t,o)}catch(e){return b=e,y}}function l(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._45=0,this._81=0,this._65=null,this._54=null,e!==n&&m(e,this)}function s(e,t,o){return new e.constructor(function(i,r){var a=new l(n);a.then(i,r),u(e,new f(t,o,a))})}function u(e,t){for(;3===e._81;)e=e._65;return l._10&&l._10(e),0===e._81?0===e._45?(e._45=1,void(e._54=t)):1===e._45?(e._45=2,void(e._54=[e._54,t])):void e._54.push(t):void d(e,t)}function d(e,t){g(function(){var o=1===e._81?t.onFulfilled:t.onRejected;if(null===o)return void(1===e._81?c(t.promise,e._65):h(t.promise,e._65));var n=r(o,e._65);n===y?h(t.promise,b):c(t.promise,n)})}function c(e,t){if(t===e)return h(e,new TypeError("A promise cannot be resolved with itself."));if(t&&("object"==typeof t||"function"==typeof t)){var o=i(t);if(o===y)return h(e,b);if(o===e.then&&t instanceof l)return e._81=3,e._65=t,void p(e);if("function"==typeof o)return void m(o.bind(t),e)}e._81=1,e._65=t,p(e)}function h(e,t){e._81=2,e._65=t,l._97&&l._97(e,t),p(e)}function p(e){if(1===e._45&&(u(e,e._54),e._54=null),2===e._45){for(var t=0;td){for(var t=0,o=l.length-u;t1)for(var o=1;o-1?t:e}function p(e,t){t=t||{};var o=t.body;if(e instanceof p){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=h(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var o=e.split("="),n=o.shift().replace(/\+/g," "),i=o.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function m(e){var t=new i;return e.split(/\r?\n/).forEach(function(e){var o=e.split(":"),n=o.shift().trim();if(n){var i=o.join(":").trim();t.append(n,i)}}),t}function g(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var b={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(b.arrayBuffer)var y=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],M=function(e){return e&&DataView.prototype.isPrototypeOf(e)},S=ArrayBuffer.isView||function(e){return e&&y.indexOf(Object.prototype.toString.call(e))>-1};i.prototype.append=function(e,n){e=t(e),n=o(n);var i=this.map[e];this.map[e]=i?i+","+n:n},i.prototype.delete=function(e){delete this.map[t(e)]},i.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},i.prototype.set=function(e,n){this.map[t(e)]=o(n)},i.prototype.forEach=function(e,t){for(var o in this.map)this.map.hasOwnProperty(o)&&e.call(t,this.map[o],o,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,o){e.push(o)}),n(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),n(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,o){e.push([o,t])}),n(e)},b.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var k=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];p.prototype.clone=function(){return new p(this,{body:this._bodyInit})},c.call(p.prototype),c.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},g.error=function(){var e=new g(null,{status:0,statusText:""});return e.type="error",e};var C=[301,302,303,307,308];g.redirect=function(e,t){if(C.indexOf(t)===-1)throw new RangeError("Invalid status code");return new g(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=p,e.Response=g,e.fetch=function(e,t){return new Promise(function(o,n){var i=new p(e,t),r=new XMLHttpRequest;r.onload=function(){var e={status:r.status,statusText:r.statusText,headers:m(r.getAllResponseHeaders()||"")};e.url="responseURL"in r?r.responseURL:e.headers.get("X-Request-URL");var t="response"in r?r.response:r.responseText;o(new g(t,e))},r.onerror=function(){n(new TypeError("Network request failed"))},r.ontimeout=function(){n(new TypeError("Network request failed"))},r.open(i.method,i.url,!0),"include"===i.credentials&&(r.withCredentials=!0),"responseType"in r&&b.blob&&(r.responseType="blob"),i.headers.forEach(function(e,t){r.setRequestHeader(t,e)}),r.send("undefined"==typeof i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t,o){o(17),e.exports=o(18)}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prop-types"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["prop-types","react","react-dom"],t):"object"==typeof exports?exports.IntlTelInput=t(require("prop-types"),require("react"),require("react-dom")):e.IntlTelInput=t(e.PropTypes,e.React,e.ReactDOM)}(this,function(e,t,o){return function(e){function t(n){if(o[n])return o[n].exports;var i=o[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=28)}([function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t,o){var n,i;!function(){"use strict";function o(){for(var e=[],t=0;t=0},retrieveLiIndex:function(e){if(!e)return-1;for(var t=e.parentNode.childNodes,o=0,n=0,i=t.length;n-1;)s.splice(t,1),i&&(t<=a&&a--,t<=l&&l--)}),this},has:function(e){return f(e,s)>-1},empty:function(){return s=[],this},disable:function(){return s=u=t=void 0,this},disabled:function(){return!s},lock:function(){return u=void 0,t||h.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!s||n&&!u||(i?u.push(t):d(t)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h},b.Deferred=function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],o="pending",n={state:function(){return o},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(o){c(t,function(t,n){var r=t[0],a=e[n];i[t[1]](h(a)?function(){var e;try{e=a.apply(this,arguments)}catch(e){return void o.reject(e)}e&&h(e.promise)?e.promise().done(o.resolve).fail(o.reject).progress(o.notify):o["notify"!==r?"resolveWith":r+"With"](this===i?o:this,[e])}:o[r])}),e=null}).promise()},promise:function(e){return null!=e?p(e,n):n}},i={};return n.pipe=n.then,c(t,function(e,r){var a=e[2],l=e[3];n[e[1]]=a.add,l&&a.add(function(){o=l},t[1^r][2].disable,t[2][2].lock),i[e[0]]=a.fire,i[e[0]+"With"]=a.fireWith}),n.promise(i),e&&e.call(i,i),i},b.when=function(e){var t,o,n,i=0,r="array"===g(e)&&1===arguments.length?e:d.call(arguments),a=r.length,l=1!==a||e&&h(e.promise)?a:0,s=1===l?e:b.Deferred(),u=function(e,o,n){return function(i){o[e]=this,n[e]=arguments.length>1?d.call(arguments):i,n===t?s.notifyWith(o,n):--l||s.resolveWith(o,n)}};if(a>1)for(t=new Array(a),o=new Array(a),n=new Array(a);i1?t-1:0),n=1;nt,l=!r&&a?"-"+(i-1)+"px":"";this.listElement.style.top=l,this.listElement.setAttribute("class","country-list")}},{key:"setFlag",value:function(e){this.props.setFlag(e)}},{key:"appendListItem",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.props.preferredCountries.length;return e.map(function(e,i){var r=o?i:i+n,l={country:!0,highlight:t.props.highlightedCountry===r,preferred:o},u=c()(l),d=o?"pref-":"",h=t.props.selectedCountryCode===e.iso2;return s.a.createElement("li",{key:""+d+e.iso2,className:u,"data-dial-code":e.dialCode,"data-country-code":e.iso2,onMouseOver:t.props.isMobile?null:t.handleMouseOver,onClick:a(t.setFlag,e.iso2),role:"option","aria-selected":h,id:t.props.getItemId(r),tabIndex:"-1"},s.a.createElement("div",{ref:function(e){t.selectedFlag=e},className:"flag-box"},s.a.createElement("div",{ref:function(e){t.selectedFlagInner=e},className:"iti-flag "+e.iso2})),s.a.createElement("span",{className:"country-name"},e.name),s.a.createElement("span",{className:"dial-code"},"+",e.dialCode))})}},{key:"handleMouseOver",value:function(e){if(e.currentTarget.getAttribute("class").indexOf("country")>-1){var t=h.a.retrieveLiIndex(e.currentTarget);this.props.changeHighlightCountry(!0,t)}}},{key:"render",value:function(){var e=this,t="",o=this.props.preferredCountries,n=null,i=this.props.countries,r=c()({"country-list":!0,hide:!this.props.showDropdown}),a=null;return o.length&&(n=this.appendListItem(o,!0),a=s.a.createElement("div",{className:"divider"})),t=this.appendListItem(i),s.a.createElement("ul",{ref:function(t){e.listElement=t},className:r,id:this.props.countryListId,role:"listbox"},n,a,t)}}]),t}(l.Component);t.a=f},function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=o(1),l=o.n(a),s=o(0),u=(o.n(s),o(5)),d=o.n(u),c=function(){function e(e,t){for(var o=0;o=4},o.wrapperClass={},o.autoCountry="",o.tempCountry="",o.startedLoadingAutoCountry=!1,o.deferreds=[],o.autoCountryDeferred=new h.a.Deferred,o.utilsScriptDeferred=new h.a.Deferred,o.isOpening=!1,o.isMobile="undefined"!=typeof navigator&&S.test(navigator.userAgent),o.preferredCountries=[],o.countries=[],o.countryCodes={},o.windowLoaded=!1,o.keys={UP:38,DOWN:40,ENTER:13,ESC:27,PLUS:43,A:65,Z:90,SPACE:32,TAB:9},o.query="",o.state={showDropdown:!1,highlightedCountry:0,value:e.value||e.defaultValue,disabled:e.disabled,readonly:!1,offsetTop:0,outerHeight:0,placeholder:"",title:"",countryCode:"us",dialCode:""},o.selectedCountryData={},o.addCountryCode=o.addCountryCode.bind(o),o.autoCountryLoaded=o.autoCountryLoaded.bind(o),o.getDialCode=o.getDialCode.bind(o),o.handleOnBlur=o.handleOnBlur.bind(o),o.handleSelectedFlagKeydown=o.handleSelectedFlagKeydown.bind(o),o.setInitialState=o.setInitialState.bind(o),o.setNumber=o.setNumber.bind(o),o.scrollTo=o.scrollTo.bind(o),o.updateDialCode=o.updateDialCode.bind(o),o.notifyPhoneNumberChange=o.notifyPhoneNumberChange.bind(o),o.isValidNumber=o.isValidNumber.bind(o),o.isUnknownNanp=o.isUnknownNanp.bind(o),o.initRequests=o.initRequests.bind(o),o.updateFlagFromNumber=o.updateFlagFromNumber.bind(o),o.updatePlaceholder=o.updatePlaceholder.bind(o),o.loadAutoCountry=o.loadAutoCountry.bind(o),o.loadUtils=o.loadUtils.bind(o),o.processCountryData=o.processCountryData.bind(o),o.getNumber=o.getNumber.bind(o),o.setFlag=o.setFlag.bind(o),o.clickSelectedFlag=o.clickSelectedFlag.bind(o),o.updateValFromNumber=o.updateValFromNumber.bind(o),o.handleWindowScroll=o.handleWindowScroll.bind(o),o.handleDocumentKeyDown=o.handleDocumentKeyDown.bind(o),o.handleDocumentClick=o.handleDocumentClick.bind(o),o.bindDocumentClick=o.bindDocumentClick.bind(o),o.unbindDocumentClick=o.unbindDocumentClick.bind(o),o.searchForCountry=o.searchForCountry.bind(o),o.handleEnterKey=o.handleEnterKey.bind(o),o.toggleDropdown=o.toggleDropdown.bind(o),o.handleUpDownKey=o.handleUpDownKey.bind(o),o.handleInputChange=o.handleInputChange.bind(o),o.changeHighlightCountry=o.changeHighlightCountry.bind(o),o.formatNumber=o.formatNumber.bind(o),o.uniqueId=Math.random().toString(36).substring(2),o}return r(t,e),M(t,[{key:"componentDidMount",value:function(){var e=this;this.autoHideDialCode=this.props.autoHideDialCode,this.allowDropdown=this.props.allowDropdown,this.nationalMode=this.props.nationalMode,this.dropdownContainer="",this.nationalMode&&(this.autoHideDialCode=!1),this.props.separateDialCode&&(this.autoHideDialCode=!1,this.nationalMode=!1,this.allowDropdown=!0),this.processCountryData.call(this),this.tempCountry=this.getTempCountry(this.props.defaultCountry),"complete"===document.readyState?this.windowLoaded=!0:window.addEventListener("load",function(){e.windowLoaded=!0}),this.generateMarkup(),this.setInitialState(),this.initRequests(),this.deferreds.push(this.autoCountryDeferred.promise()),this.deferreds.push(this.utilsScriptDeferred.promise()),h.a.when(this.deferreds).done(function(){e.setInitialState()}),document.addEventListener("keydown",this.handleDocumentKeyDown)}},{key:"componentWillReceiveProps",value:function(e){this.props.value!==e.value&&this.setState({value:e.value}),this.props.disabled!==e.disabled&&this.setState({disabled:e.disabled}),"function"==typeof e.customPlaceholder&&this.props.customPlaceholder!==e.customPlaceholder&&this.updatePlaceholder(e)}},{key:"componentWillUpdate",value:function(e,t){t.showDropdown?(document.addEventListener("keydown",this.handleDocumentKeyDown),this.bindDocumentClick()):(document.removeEventListener("keydown",this.handleDocumentKeyDown),this.unbindDocumentClick())}},{key:"componentDidUpdate",value:function(e){this.props.value!==e.value&&this.updateFlagFromNumber(this.props.value)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleDocumentKeyDown),window.removeEventListener("scroll",this.handleWindowScroll),this.unbindDocumentClick()}},{key:"getTempCountry",value:function(e){if("auto"===e)return"auto";var t=b.a.getCountryData(this.countries,e);return t.iso2||(t=this.props.preferredCountries.length>0?b.a.getCountryData(this.countries,this.props.preferredCountries[0]):f.a.getCountries()[0]),t.iso2}},{key:"setNumber",value:function(e,t){this.updateFlagFromNumber(e),this.updateValFromNumber(e,!t)}},{key:"setFlag",value:function(e,t){var o=this,n=this.selectedCountryData&&this.selectedCountryData.iso2?this.selectedCountryData:{};this.selectedCountryData=e?b.a.getCountryData(this.countries,e,!1,!1,this.props.noCountryDataHandler):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2);var i=e?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown",r=this.state.dialCode;this.props.separateDialCode&&(r=this.selectedCountryData.dialCode?"+"+this.selectedCountryData.dialCode:"",n.dialCode&&delete this.wrapperClass["iti-sdc-"+(n.dialCode.length+1)],r&&(this.wrapperClass["iti-sdc-"+r.length]=!0));var a=0;e&&"auto"!==e&&(a=b.a.findIndex(this.preferredCountries,function(t){return t.iso2===e}),a===-1&&(a=b.a.findIndex(this.countries,function(t){return t.iso2===e}),a===-1&&(a=0),a+=this.preferredCountries.length)),this.tel&&this.state.showDropdown&&this.tel.focus();var l=this.updateDialCode(this.selectedCountryData.dialCode,!t);this.setState({value:l,showDropdown:!1,highlightedCountry:a,countryCode:e,title:i,dialCode:r},function(){if(o.updatePlaceholder(o.props),o.wrapperClass.active=!1,!t&&n.iso2!==e&&"function"==typeof o.props.onSelectFlag){var i=o.state.value;o.props.onSelectFlag(i,o.selectedCountryData)}})}},{key:"getExtension",value:function(e){return window.intlTelInputUtils?window.intlTelInputUtils.getExtension(this.getFullNumber(e),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(e,t){return window.intlTelInputUtils?window.intlTelInputUtils.formatNumber(this.getFullNumber(e),this.selectedCountryData.iso2,t):""}},{key:"getFullNumber",value:function(e){var t=this.props.separateDialCode?"+"+this.selectedCountryData.dialCode:"";return t+e}},{key:"getDialCode",value:function(e){var t="";if("+"===e.charAt(0))for(var o="",n=0,i=e.length;nt?e.substr(0,t):e}},{key:"removeEmptyDialCode",value:function(){var e=this.state.value,t="+"===e.charAt(0);if(t){var o=b.a.getNumeric(e);o&&this.selectedCountryData.dialCode!==o||this.setState({value:""})}}},{key:"handleUpDownKey",value:function(e){var t=this.flagDropDown.querySelectorAll(".highlight")[0],o=t?t.previousElementSibling:void 0,n=t?t.nextElementSibling:void 0,i=e===this.keys.UP?o:n;if(i){i.getAttribute("class").indexOf("divider")>-1&&(i=e===this.keys.UP?i.previousElementSibling:i.nextElementSibling),this.scrollTo(i);var r=b.a.retrieveLiIndex(i);this.setState({showDropdown:!0,highlightedCountry:r})}}},{key:"handleEnterKey",value:function(){var e=this,t=this.flagDropDown.querySelectorAll(".highlight")[0];if(t){var o=b.a.retrieveLiIndex(t),n=t.getAttribute("data-country-code");this.setState({showDropdown:!1,highlightedCountry:o,countryCode:n},function(){e.setFlag(e.state.countryCode),e.unbindDocumentClick()})}}},{key:"searchForCountry",value:function(e){for(var t=0,o=this.countries.length;t2&&void 0!==arguments[2]&&arguments[2];if(t&&window.intlTelInputUtils&&this.selectedCountryData){var i=this.props.separateDialCode||!this.nationalMode&&"+"===e.charAt(0)?window.intlTelInputUtils.numberFormat.INTERNATIONAL:window.intlTelInputUtils.numberFormat.NATIONAL;e=window.intlTelInputUtils.formatNumber(e,this.selectedCountryData.iso2,i)}e=this.beforeSetNumber(e),this.setState({showDropdown:!1,value:e},function(){n&&o.notifyPhoneNumberChange(o.state.value),o.unbindDocumentClick()})}},{key:"updateFlagFromNumber",value:function(e,t){e&&this.nationalMode&&this.selectedCountryData&&"1"===this.selectedCountryData.dialCode&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1"+e),e="+"+e);var o=this.getDialCode(e),n=null;if(o){var i=this.countryCodes[b.a.getNumeric(o)],r=this.selectedCountryData&&i.indexOf(this.selectedCountryData.iso2)!==-1;if(!r||this.isUnknownNanp(e,o))for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:this.props;if(window.intlTelInputUtils&&e.autoPlaceholder&&this.selectedCountryData){var t=window.intlTelInputUtils.numberType[e.numberType],o=this.selectedCountryData.iso2?window.intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.nationalMode,t):"";o=this.beforeSetNumber(o,e),"function"==typeof e.customPlaceholder&&(o=e.customPlaceholder(o,this.selectedCountryData)),this.setState({placeholder:o})}}},{key:"toggleDropdown",value:function(e){var t=this;this.setState({showDropdown:!!e},function(){t.state.showDropdown||t.unbindDocumentClick()})}},{key:"scrollTo",value:function(e,t){try{var o=this.flagDropDown.querySelector(".country-list"),n=parseFloat(window.getComputedStyle(o).getPropertyValue("height"),10),i=b.a.offset(o).top,r=i+n,a=b.a.getOuterHeight(e),l=b.a.offset(e).top,s=l+a,u=n/2-a/2,d=l-i+o.scrollTop;if(lr){t&&(d+=u);var c=n-a;o.scrollTop=d-c}}catch(e){}}},{key:"updateDialCode",value:function(e,t){var o=this.state.value;if(!e)return o;var n=o;if(e="+"+e,"+"===o.charAt(0)){var i=this.getDialCode(o);n=i?o.replace(i,e):e}else this.nationalMode||this.props.separateDialCode||(o?n=e+o:!t&&this.autoHideDialCode||(n=e));return n!==o&&this.notifyPhoneNumberChange(n),n}},{key:"generateMarkup",value:function(){this.wrapperClass["allow-dropdown"]=this.allowDropdown,this.wrapperClass["separate-dial-code"]=this.props.separateDialCode,this.isMobile&&this.props.useMobileFullscreenDropdown&&(b.a.addClass(document.querySelector("body"),"iti-mobile"),this.dropdownContainer="body",window.addEventListener("scroll",this.handleWindowScroll))}},{key:"handleSelectedFlagKeydown",value:function(e){this.state.showDropdown||e.which!==this.keys.UP&&e.which!==this.keys.DOWN&&e.which!==this.keys.SPACE&&e.which!==this.keys.ENTER||(e.preventDefault(),e.stopPropagation(),this.toggleDropdown(!0)),e.which===this.keys.TAB&&this.toggleDropdown(!1)}},{key:"isValidNumber",value:function(e){var t=b.a.trim(e),o=this.nationalMode||this.props.separateDialCode?this.selectedCountryData.iso2:"";return!!window.intlTelInputUtils&&window.intlTelInputUtils.isValidNumber(t,o)}},{key:"formatFullNumber",value:function(e){return window.intlTelInputUtils?this.getNumber(e,window.intlTelInputUtils.numberFormat.INTERNATIONAL):e}},{key:"notifyPhoneNumberChange",value:function(e){if("function"==typeof this.props.onPhoneNumberChange){var t=this.formatFullNumber(e),o=this.isValidNumber(t);this.props.onPhoneNumberChange(o,e,this.selectedCountryData,t,this.getExtension(e))}}},{key:"beforeSetNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props;if(t.separateDialCode){var o=this.getDialCode(e);if(o){null!==this.selectedCountryData.areaCodes&&(o="+"+this.selectedCountryData.dialCode);var n=" "===e[o.length]||"-"===e[o.length]?o.length+1:o.length;e=e.substr(n)}}return this.cap(e)}},{key:"handleWindowScroll",value:function(){var e=this;this.setState({showDropdown:!1},function(){window.removeEventListener("scroll",e.handleWindowScroll)})}},{key:"handleDocumentKeyDown",value:function(e){var t=this,o=void 0;e.preventDefault(),e.which===this.keys.UP||e.which===this.keys.DOWN?this.handleUpDownKey(e.which):e.which===this.keys.ENTER?this.handleEnterKey():e.which===this.keys.ESC?this.setState({showDropdown:!1}):(e.which>=this.keys.A&&e.which<=this.keys.Z||e.which===this.keys.SPACE)&&(o&&clearTimeout(o),this.query||(this.query=""),this.query+=String.fromCharCode(e.which),this.searchForCountry(this.query),o=setTimeout(function(){t.query=""},1e3))}},{key:"handleDocumentClick",value:function(e){(null===e.target.getAttribute("class")||e.target.getAttribute("class")&&e.target.getAttribute("class").indexOf("country")===-1)&&(this.isOpening=!1),this.isOpening||this.toggleDropdown(!1),this.isOpening=!1}},{key:"handleInputChange",value:function(e){var t=this,o=this.props.format?this.formatNumber(e.target.value):e.target.value;void 0!==this.props.value?(this.updateFlagFromNumber(o),this.notifyPhoneNumberChange(o)):this.setState({value:o},function(){t.updateFlagFromNumber(o),t.notifyPhoneNumberChange(o)})}},{key:"changeHighlightCountry",value:function(e,t){this.setState({showDropdown:e,highlightedCountry:t})}},{key:"loadUtils",value:function(){var e=this;if(window.intlTelInputUtils)return void this.utilsScriptDeferred.resolve();var t=new XMLHttpRequest;t.open("GET",this.props.utilsScript,!0),t.onload=function(){if(t.status>=200&&t.status<400){var o=t.responseText;if(o&&!document.getElementById("intlTelInputUtils")){var n=document.getElementsByTagName("body")[0],i=document.createElement("script");i.id="intlTelInputUtils",i.text=o,n.appendChild(i)}e.utilsScriptDeferred.resolve()}},t.send()}},{key:"autoCountryLoaded",value:function(){"auto"===this.tempCountry&&(this.tempCountry=this.autoCountry,this.autoCountryDeferred.resolve())}},{key:"render",value:function(){this.wrapperClass[this.props.css[0]]=!0;var e=this.props.css[1],t=Object.assign({},this.props.style||{});this.wrapperClass.expanded=this.state.showDropdown;var o=d()(this.wrapperClass),n=this.selectedCountryData?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown",i=void 0!==this.props.value?this.props.value:this.state.value;return l.a.createElement("div",{className:o,style:t},l.a.createElement(m.a,{refCallback:this.setFlagDropdownRef,allowDropdown:this.allowDropdown,dropdownContainer:this.dropdownContainer,separateDialCode:this.props.separateDialCode,dialCode:this.state.dialCode,clickSelectedFlag:this.clickSelectedFlag,setFlag:this.setFlag,countryCode:this.state.countryCode,isMobile:this.isMobile,handleSelectedFlagKeydown:this.handleSelectedFlagKeydown,changeHighlightCountry:this.changeHighlightCountry,countries:this.countries,showDropdown:this.state.showDropdown,inputTop:this.state.offsetTop,inputOuterHeight:this.state.outerHeight,preferredCountries:this.preferredCountries,highlightedCountry:this.state.highlightedCountry,titleTip:n,flagDropdownProps:this.props.flagDropdownProps,uniqueId:this.uniqueId}),l.a.createElement(g.a,{refCallback:this.setTelRef,handleInputChange:this.handleInputChange,handleOnBlur:this.handleOnBlur,className:e,disabled:this.state.disabled,readonly:this.state.readonly,fieldName:this.props.fieldName,fieldId:this.props.fieldId,value:i,placeholder:void 0!==this.props.placeholder?this.props.placeholder:this.state.placeholder,autoFocus:this.props.autoFocus,autoComplete:this.props.autoComplete,inputProps:this.props.telInputProps}))}}]),t}(a.Component);k.defaultProps={css:["intl-tel-input",""],fieldName:"",fieldId:"",defaultValue:"",countriesData:null,allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:!0,customPlaceholder:null,excludeCountries:[],formatOnInit:!0,separateDialCode:!1,defaultCountry:"",geoIpLookup:null,nationalMode:!0,numberType:"MOBILE",noCountryDataHandler:null,onlyCountries:[],preferredCountries:["us","gb"],utilsScript:"",onPhoneNumberChange:null,onPhoneNumberBlur:null,onSelectFlag:null,disabled:!1,autoFocus:!1,useMobileFullscreenDropdown:!0,autoComplete:"off",telInputProps:{},flagDropdownProps:{},format:!1},t.default=k},function(e,t,o){"use strict";function n(){}function i(e){try{return e.then}catch(e){return b=e,y}}function r(e,t){try{return e(t)}catch(e){return b=e,y}}function a(e,t,o){try{e(t,o)}catch(e){return b=e,y}}function l(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._45=0,this._81=0,this._65=null,this._54=null,e!==n&&m(e,this)}function s(e,t,o){return new e.constructor(function(i,r){var a=new l(n);a.then(i,r),u(e,new f(t,o,a))})}function u(e,t){for(;3===e._81;)e=e._65;return l._10&&l._10(e),0===e._81?0===e._45?(e._45=1,void(e._54=t)):1===e._45?(e._45=2,void(e._54=[e._54,t])):void e._54.push(t):void d(e,t)}function d(e,t){g(function(){var o=1===e._81?t.onFulfilled:t.onRejected;if(null===o)return void(1===e._81?c(t.promise,e._65):h(t.promise,e._65));var n=r(o,e._65);n===y?h(t.promise,b):c(t.promise,n)})}function c(e,t){if(t===e)return h(e,new TypeError("A promise cannot be resolved with itself."));if(t&&("object"==typeof t||"function"==typeof t)){var o=i(t);if(o===y)return h(e,b);if(o===e.then&&t instanceof l)return e._81=3,e._65=t,void p(e);if("function"==typeof o)return void m(o.bind(t),e)}e._81=1,e._65=t,p(e)}function h(e,t){e._81=2,e._65=t,l._97&&l._97(e,t),p(e)}function p(e){if(1===e._45&&(u(e,e._54),e._54=null),2===e._45){for(var t=0;td){for(var t=0,o=l.length-u;t1)for(var o=1;o-1?t:e}function p(e,t){t=t||{};var o=t.body;if(e instanceof p){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new i(e.headers)),this.method=e.method,this.mode=e.mode,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new i(t.headers)),this.method=h(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var o=e.split("="),n=o.shift().replace(/\+/g," "),i=o.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function m(e){var t=new i;return e.split(/\r?\n/).forEach(function(e){var o=e.split(":"),n=o.shift().trim();if(n){var i=o.join(":").trim();t.append(n,i)}}),t}function g(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new i(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var b={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(b.arrayBuffer)var y=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],M=function(e){return e&&DataView.prototype.isPrototypeOf(e)},S=ArrayBuffer.isView||function(e){return e&&y.indexOf(Object.prototype.toString.call(e))>-1};i.prototype.append=function(e,n){e=t(e),n=o(n);var i=this.map[e];this.map[e]=i?i+","+n:n},i.prototype.delete=function(e){delete this.map[t(e)]},i.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},i.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},i.prototype.set=function(e,n){this.map[t(e)]=o(n)},i.prototype.forEach=function(e,t){for(var o in this.map)this.map.hasOwnProperty(o)&&e.call(t,this.map[o],o,this)},i.prototype.keys=function(){var e=[];return this.forEach(function(t,o){e.push(o)}),n(e)},i.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),n(e)},i.prototype.entries=function(){var e=[];return this.forEach(function(t,o){e.push([o,t])}),n(e)},b.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var k=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];p.prototype.clone=function(){return new p(this,{body:this._bodyInit})},c.call(p.prototype),c.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},g.error=function(){var e=new g(null,{status:0,statusText:""});return e.type="error",e};var C=[301,302,303,307,308];g.redirect=function(e,t){if(C.indexOf(t)===-1)throw new RangeError("Invalid status code");return new g(null,{status:t,headers:{location:e}})},e.Headers=i,e.Request=p,e.Response=g,e.fetch=function(e,t){return new Promise(function(o,n){var i=new p(e,t),r=new XMLHttpRequest;r.onload=function(){var e={status:r.status,statusText:r.statusText,headers:m(r.getAllResponseHeaders()||"")};e.url="responseURL"in r?r.responseURL:e.headers.get("X-Request-URL");var t="response"in r?r.response:r.responseText;o(new g(t,e))},r.onerror=function(){n(new TypeError("Network request failed"))},r.ontimeout=function(){n(new TypeError("Network request failed"))},r.open(i.method,i.url,!0),"include"===i.credentials&&(r.withCredentials=!0),"responseType"in r&&b.blob&&(r.responseType="blob"),i.headers.forEach(function(e,t){r.setRequestHeader(t,e)}),r.send("undefined"==typeof i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t,o){o(17),e.exports=o(18)}])}); \ No newline at end of file diff --git a/example/main.css b/example/main.css index d3c864d2b..385473b0a 100644 --- a/example/main.css +++ b/example/main.css @@ -1 +1 @@ -.intl-tel-input{position:relative;display:inline-block}.intl-tel-input *{box-sizing:border-box;-moz-box-sizing:border-box}.intl-tel-input .hide{display:none}.intl-tel-input .v-hide{visibility:hidden}.intl-tel-input input,.intl-tel-input input[type=tel],.intl-tel-input input[type=text]{position:relative;z-index:0;margin-top:0!important;margin-bottom:0!important;padding-right:36px;margin-right:0}.intl-tel-input .flag-container{position:absolute;top:0;bottom:0;right:0;padding:1px}.intl-tel-input .selected-flag{z-index:1;position:relative;width:36px;height:100%;padding:0 0 0 8px}.intl-tel-input .selected-flag .iti-flag{position:absolute;top:0;bottom:0;margin:auto}.intl-tel-input .selected-flag .iti-arrow{position:absolute;top:50%;margin-top:-2px;right:6px;width:0;height:0;border-left:3px solid transparent;border-right:3px solid transparent;border-top:4px solid #555}.intl-tel-input .selected-flag .iti-arrow.up{border-top:none;border-bottom:4px solid #555}.intl-tel-input .country-list{position:absolute;z-index:2;list-style:none;text-align:left;padding:0;margin:0 0 0 -1px;box-shadow:1px 1px 4px rgba(0,0,0,.2);background-color:#fff;border:1px solid #ccc;white-space:nowrap;max-height:200px;overflow-y:scroll;-webkit-overflow-scrolling:touch}.intl-tel-input .country-list.dropup{bottom:100%;margin-bottom:-1px}.intl-tel-input .country-list .flag-box{display:inline-block;width:20px}@media (max-width:500px){.intl-tel-input .country-list{white-space:normal}}.intl-tel-input .country-list .divider{padding-bottom:5px;margin-bottom:5px;border-bottom:1px solid #ccc}.intl-tel-input .country-list .country{padding:5px 10px}.intl-tel-input .country-list .country .dial-code{color:#999}.intl-tel-input .country-list .country.highlight{background-color:rgba(0,0,0,.05)}.intl-tel-input .country-list .country-name,.intl-tel-input .country-list .dial-code,.intl-tel-input .country-list .flag-box{vertical-align:middle}.intl-tel-input .country-list .country-name,.intl-tel-input .country-list .flag-box{margin-right:6px}.intl-tel-input.allow-dropdown input,.intl-tel-input.allow-dropdown input[type=tel],.intl-tel-input.allow-dropdown input[type=text]{padding-right:6px;padding-left:52px;margin-left:0}.intl-tel-input.allow-dropdown .flag-container{right:auto;left:0;width:100%}.intl-tel-input.allow-dropdown .selected-flag{width:46px}.intl-tel-input.allow-dropdown .flag-container:hover{cursor:pointer}.intl-tel-input.allow-dropdown .flag-container:hover .selected-flag{background-color:rgba(0,0,0,.05)}.intl-tel-input.allow-dropdown input[disabled]+.flag-container:hover,.intl-tel-input.allow-dropdown input[readonly]+.flag-container:hover{cursor:default}.intl-tel-input.allow-dropdown input[disabled]+.flag-container:hover .selected-flag,.intl-tel-input.allow-dropdown input[readonly]+.flag-container:hover .selected-flag{background-color:transparent}.intl-tel-input.allow-dropdown.separate-dial-code .selected-flag{background-color:rgba(0,0,0,.05);display:table}.intl-tel-input.allow-dropdown.separate-dial-code .selected-dial-code{display:table-cell;vertical-align:middle;padding-left:28px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 input[type=text]{padding-left:76px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 .selected-flag{width:70px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 input[type=text]{padding-left:84px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 .selected-flag{width:78px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 input[type=text]{padding-left:92px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 .selected-flag{width:86px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 input[type=text]{padding-left:100px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 .selected-flag{width:94px}.intl-tel-input.iti-container{position:absolute;top:-1000px;left:-1000px;z-index:1060;padding:1px}.intl-tel-input.iti-container:hover{cursor:pointer}.iti-mobile .intl-tel-input.iti-container{top:30px;bottom:30px;left:30px;right:30px;position:fixed}.iti-mobile .intl-tel-input .country-list{max-height:100%;width:100%;-webkit-overflow-scrolling:touch}.iti-mobile .intl-tel-input .country-list .country{padding:10px;line-height:1.5em}.iti-flag.be{width:18px}.iti-flag.ch{width:15px}.iti-flag.mc{width:19px}.iti-flag.ne{width:18px}.iti-flag.np{width:13px}.iti-flag.va{width:15px}@media only screen and (-o-min-device-pixel-ratio:2/1),only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:2dppx),only screen and (min-resolution:192dpi){.iti-flag{background-size:5630px 15px}}.iti-flag.ac{height:10px;background-position:0 0}.iti-flag.ad{height:14px;background-position:-22px 0}.iti-flag.ae{height:10px;background-position:-44px 0}.iti-flag.af{height:14px;background-position:-66px 0}.iti-flag.ag{height:14px;background-position:-88px 0}.iti-flag.ai{height:10px;background-position:-110px 0}.iti-flag.al{height:15px;background-position:-132px 0}.iti-flag.am{height:10px;background-position:-154px 0}.iti-flag.ao{height:14px;background-position:-176px 0}.iti-flag.aq{height:14px;background-position:-198px 0}.iti-flag.ar{height:13px;background-position:-220px 0}.iti-flag.as{height:10px;background-position:-242px 0}.iti-flag.at{height:14px;background-position:-264px 0}.iti-flag.au{height:10px;background-position:-286px 0}.iti-flag.aw{height:14px;background-position:-308px 0}.iti-flag.ax{height:13px;background-position:-330px 0}.iti-flag.az{height:10px;background-position:-352px 0}.iti-flag.ba{height:10px;background-position:-374px 0}.iti-flag.bb{height:14px;background-position:-396px 0}.iti-flag.bd{height:12px;background-position:-418px 0}.iti-flag.be{height:15px;background-position:-440px 0}.iti-flag.bf{height:14px;background-position:-460px 0}.iti-flag.bg{height:12px;background-position:-482px 0}.iti-flag.bh{height:12px;background-position:-504px 0}.iti-flag.bi{height:12px;background-position:-526px 0}.iti-flag.bj{height:14px;background-position:-548px 0}.iti-flag.bl{height:14px;background-position:-570px 0}.iti-flag.bm{height:10px;background-position:-592px 0}.iti-flag.bn{height:10px;background-position:-614px 0}.iti-flag.bo{height:14px;background-position:-636px 0}.iti-flag.bq{height:14px;background-position:-658px 0}.iti-flag.br{height:14px;background-position:-680px 0}.iti-flag.bs{height:10px;background-position:-702px 0}.iti-flag.bt{height:14px;background-position:-724px 0}.iti-flag.bv{height:15px;background-position:-746px 0}.iti-flag.bw{height:14px;background-position:-768px 0}.iti-flag.by{height:10px;background-position:-790px 0}.iti-flag.bz{height:14px;background-position:-812px 0}.iti-flag.ca{height:10px;background-position:-834px 0}.iti-flag.cc{height:10px;background-position:-856px 0}.iti-flag.cd{height:15px;background-position:-878px 0}.iti-flag.cf{height:14px;background-position:-900px 0}.iti-flag.cg{height:14px;background-position:-922px 0}.iti-flag.ch{height:15px;background-position:-944px 0}.iti-flag.ci{height:14px;background-position:-961px 0}.iti-flag.ck{height:10px;background-position:-983px 0}.iti-flag.cl{height:14px;background-position:-1005px 0}.iti-flag.cm{height:14px;background-position:-1027px 0}.iti-flag.cn{height:14px;background-position:-1049px 0}.iti-flag.co{height:14px;background-position:-1071px 0}.iti-flag.cp{height:14px;background-position:-1093px 0}.iti-flag.cr{height:12px;background-position:-1115px 0}.iti-flag.cu{height:10px;background-position:-1137px 0}.iti-flag.cv{height:12px;background-position:-1159px 0}.iti-flag.cw{height:14px;background-position:-1181px 0}.iti-flag.cx{height:10px;background-position:-1203px 0}.iti-flag.cy{height:14px;background-position:-1225px 0}.iti-flag.cz{height:14px;background-position:-1247px 0}.iti-flag.de{height:12px;background-position:-1269px 0}.iti-flag.dg{height:10px;background-position:-1291px 0}.iti-flag.dj{height:14px;background-position:-1313px 0}.iti-flag.dk{height:15px;background-position:-1335px 0}.iti-flag.dm{height:10px;background-position:-1357px 0}.iti-flag.do{height:13px;background-position:-1379px 0}.iti-flag.dz{height:14px;background-position:-1401px 0}.iti-flag.ea{height:14px;background-position:-1423px 0}.iti-flag.ec{height:14px;background-position:-1445px 0}.iti-flag.ee{height:13px;background-position:-1467px 0}.iti-flag.eg{height:14px;background-position:-1489px 0}.iti-flag.eh{height:10px;background-position:-1511px 0}.iti-flag.er{height:10px;background-position:-1533px 0}.iti-flag.es{height:14px;background-position:-1555px 0}.iti-flag.et{height:10px;background-position:-1577px 0}.iti-flag.eu{height:14px;background-position:-1599px 0}.iti-flag.fi{height:12px;background-position:-1621px 0}.iti-flag.fj{height:10px;background-position:-1643px 0}.iti-flag.fk{height:10px;background-position:-1665px 0}.iti-flag.fm{height:11px;background-position:-1687px 0}.iti-flag.fo{height:15px;background-position:-1709px 0}.iti-flag.fr{height:14px;background-position:-1731px 0}.iti-flag.ga{height:15px;background-position:-1753px 0}.iti-flag.gb{height:10px;background-position:-1775px 0}.iti-flag.gd{height:12px;background-position:-1797px 0}.iti-flag.ge{height:14px;background-position:-1819px 0}.iti-flag.gf{height:14px;background-position:-1841px 0}.iti-flag.gg{height:14px;background-position:-1863px 0}.iti-flag.gh{height:14px;background-position:-1885px 0}.iti-flag.gi{height:10px;background-position:-1907px 0}.iti-flag.gl{height:14px;background-position:-1929px 0}.iti-flag.gm{height:14px;background-position:-1951px 0}.iti-flag.gn{height:14px;background-position:-1973px 0}.iti-flag.gp{height:14px;background-position:-1995px 0}.iti-flag.gq{height:14px;background-position:-2017px 0}.iti-flag.gr{height:14px;background-position:-2039px 0}.iti-flag.gs{height:10px;background-position:-2061px 0}.iti-flag.gt{height:13px;background-position:-2083px 0}.iti-flag.gu{height:11px;background-position:-2105px 0}.iti-flag.gw{height:10px;background-position:-2127px 0}.iti-flag.gy{height:12px;background-position:-2149px 0}.iti-flag.hk{height:14px;background-position:-2171px 0}.iti-flag.hm{height:10px;background-position:-2193px 0}.iti-flag.hn{height:10px;background-position:-2215px 0}.iti-flag.hr{height:10px;background-position:-2237px 0}.iti-flag.ht{height:12px;background-position:-2259px 0}.iti-flag.hu{height:10px;background-position:-2281px 0}.iti-flag.ic{height:14px;background-position:-2303px 0}.iti-flag.id{height:14px;background-position:-2325px 0}.iti-flag.ie{height:10px;background-position:-2347px 0}.iti-flag.il{height:15px;background-position:-2369px 0}.iti-flag.im{height:10px;background-position:-2391px 0}.iti-flag.in{height:14px;background-position:-2413px 0}.iti-flag.io{height:10px;background-position:-2435px 0}.iti-flag.iq{height:14px;background-position:-2457px 0}.iti-flag.ir{height:12px;background-position:-2479px 0}.iti-flag.is{height:15px;background-position:-2501px 0}.iti-flag.it{height:14px;background-position:-2523px 0}.iti-flag.je{height:12px;background-position:-2545px 0}.iti-flag.jm{height:10px;background-position:-2567px 0}.iti-flag.jo{height:10px;background-position:-2589px 0}.iti-flag.jp{height:14px;background-position:-2611px 0}.iti-flag.ke{height:14px;background-position:-2633px 0}.iti-flag.kg{height:12px;background-position:-2655px 0}.iti-flag.kh{height:13px;background-position:-2677px 0}.iti-flag.ki{height:10px;background-position:-2699px 0}.iti-flag.km{height:12px;background-position:-2721px 0}.iti-flag.kn{height:14px;background-position:-2743px 0}.iti-flag.kp{height:10px;background-position:-2765px 0}.iti-flag.kr{height:14px;background-position:-2787px 0}.iti-flag.kw{height:10px;background-position:-2809px 0}.iti-flag.ky{height:10px;background-position:-2831px 0}.iti-flag.kz{height:10px;background-position:-2853px 0}.iti-flag.la{height:14px;background-position:-2875px 0}.iti-flag.lb{height:14px;background-position:-2897px 0}.iti-flag.lc{height:10px;background-position:-2919px 0}.iti-flag.li{height:12px;background-position:-2941px 0}.iti-flag.lk{height:10px;background-position:-2963px 0}.iti-flag.lr{height:11px;background-position:-2985px 0}.iti-flag.ls{height:14px;background-position:-3007px 0}.iti-flag.lt{height:12px;background-position:-3029px 0}.iti-flag.lu{height:12px;background-position:-3051px 0}.iti-flag.lv{height:10px;background-position:-3073px 0}.iti-flag.ly{height:10px;background-position:-3095px 0}.iti-flag.ma{height:14px;background-position:-3117px 0}.iti-flag.mc{height:15px;background-position:-3139px 0}.iti-flag.md{height:10px;background-position:-3160px 0}.iti-flag.me{height:10px;background-position:-3182px 0}.iti-flag.mf{height:14px;background-position:-3204px 0}.iti-flag.mg{height:14px;background-position:-3226px 0}.iti-flag.mh{height:11px;background-position:-3248px 0}.iti-flag.mk{height:10px;background-position:-3270px 0}.iti-flag.ml{height:14px;background-position:-3292px 0}.iti-flag.mm{height:14px;background-position:-3314px 0}.iti-flag.mn{height:10px;background-position:-3336px 0}.iti-flag.mo{height:14px;background-position:-3358px 0}.iti-flag.mp{height:10px;background-position:-3380px 0}.iti-flag.mq{height:14px;background-position:-3402px 0}.iti-flag.mr{height:14px;background-position:-3424px 0}.iti-flag.ms{height:10px;background-position:-3446px 0}.iti-flag.mt{height:14px;background-position:-3468px 0}.iti-flag.mu{height:14px;background-position:-3490px 0}.iti-flag.mv{height:14px;background-position:-3512px 0}.iti-flag.mw{height:14px;background-position:-3534px 0}.iti-flag.mx{height:12px;background-position:-3556px 0}.iti-flag.my{height:10px;background-position:-3578px 0}.iti-flag.mz{height:14px;background-position:-3600px 0}.iti-flag.na{height:14px;background-position:-3622px 0}.iti-flag.nc{height:10px;background-position:-3644px 0}.iti-flag.ne{height:15px;background-position:-3666px 0}.iti-flag.nf{height:10px;background-position:-3686px 0}.iti-flag.ng{height:10px;background-position:-3708px 0}.iti-flag.ni{height:12px;background-position:-3730px 0}.iti-flag.nl{height:14px;background-position:-3752px 0}.iti-flag.no{height:15px;background-position:-3774px 0}.iti-flag.np{height:15px;background-position:-3796px 0}.iti-flag.nr{height:10px;background-position:-3811px 0}.iti-flag.nu{height:10px;background-position:-3833px 0}.iti-flag.nz{height:10px;background-position:-3855px 0}.iti-flag.om{height:10px;background-position:-3877px 0}.iti-flag.pa{height:14px;background-position:-3899px 0}.iti-flag.pe{height:14px;background-position:-3921px 0}.iti-flag.pf{height:14px;background-position:-3943px 0}.iti-flag.pg{height:15px;background-position:-3965px 0}.iti-flag.ph{height:10px;background-position:-3987px 0}.iti-flag.pk{height:14px;background-position:-4009px 0}.iti-flag.pl{height:13px;background-position:-4031px 0}.iti-flag.pm{height:14px;background-position:-4053px 0}.iti-flag.pn{height:10px;background-position:-4075px 0}.iti-flag.pr{height:14px;background-position:-4097px 0}.iti-flag.ps{height:10px;background-position:-4119px 0}.iti-flag.pt{height:14px;background-position:-4141px 0}.iti-flag.pw{height:13px;background-position:-4163px 0}.iti-flag.py{height:11px;background-position:-4185px 0}.iti-flag.qa{height:8px;background-position:-4207px 0}.iti-flag.re{height:14px;background-position:-4229px 0}.iti-flag.ro{height:14px;background-position:-4251px 0}.iti-flag.rs{height:14px;background-position:-4273px 0}.iti-flag.ru{height:14px;background-position:-4295px 0}.iti-flag.rw{height:14px;background-position:-4317px 0}.iti-flag.sa{height:14px;background-position:-4339px 0}.iti-flag.sb{height:10px;background-position:-4361px 0}.iti-flag.sc{height:10px;background-position:-4383px 0}.iti-flag.sd{height:10px;background-position:-4405px 0}.iti-flag.se{height:13px;background-position:-4427px 0}.iti-flag.sg{height:14px;background-position:-4449px 0}.iti-flag.sh{height:10px;background-position:-4471px 0}.iti-flag.si{height:10px;background-position:-4493px 0}.iti-flag.sj{height:15px;background-position:-4515px 0}.iti-flag.sk{height:14px;background-position:-4537px 0}.iti-flag.sl{height:14px;background-position:-4559px 0}.iti-flag.sm{height:15px;background-position:-4581px 0}.iti-flag.sn{height:14px;background-position:-4603px 0}.iti-flag.so{height:14px;background-position:-4625px 0}.iti-flag.sr{height:14px;background-position:-4647px 0}.iti-flag.ss{height:10px;background-position:-4669px 0}.iti-flag.st{height:10px;background-position:-4691px 0}.iti-flag.sv{height:12px;background-position:-4713px 0}.iti-flag.sx{height:14px;background-position:-4735px 0}.iti-flag.sy{height:14px;background-position:-4757px 0}.iti-flag.sz{height:14px;background-position:-4779px 0}.iti-flag.ta{height:10px;background-position:-4801px 0}.iti-flag.tc{height:10px;background-position:-4823px 0}.iti-flag.td{height:14px;background-position:-4845px 0}.iti-flag.tf{height:14px;background-position:-4867px 0}.iti-flag.tg{height:13px;background-position:-4889px 0}.iti-flag.th{height:14px;background-position:-4911px 0}.iti-flag.tj{height:10px;background-position:-4933px 0}.iti-flag.tk{height:10px;background-position:-4955px 0}.iti-flag.tl{height:10px;background-position:-4977px 0}.iti-flag.tm{height:14px;background-position:-4999px 0}.iti-flag.tn{height:14px;background-position:-5021px 0}.iti-flag.to{height:10px;background-position:-5043px 0}.iti-flag.tr{height:14px;background-position:-5065px 0}.iti-flag.tt{height:12px;background-position:-5087px 0}.iti-flag.tv{height:10px;background-position:-5109px 0}.iti-flag.tw{height:14px;background-position:-5131px 0}.iti-flag.tz{height:14px;background-position:-5153px 0}.iti-flag.ua{height:14px;background-position:-5175px 0}.iti-flag.ug{height:14px;background-position:-5197px 0}.iti-flag.um{height:11px;background-position:-5219px 0}.iti-flag.us{height:11px;background-position:-5241px 0}.iti-flag.uy{height:14px;background-position:-5263px 0}.iti-flag.uz{height:10px;background-position:-5285px 0}.iti-flag.va{height:15px;background-position:-5307px 0}.iti-flag.vc{height:14px;background-position:-5324px 0}.iti-flag.ve{height:14px;background-position:-5346px 0}.iti-flag.vg{height:10px;background-position:-5368px 0}.iti-flag.vi{height:14px;background-position:-5390px 0}.iti-flag.vn{height:14px;background-position:-5412px 0}.iti-flag.vu{height:12px;background-position:-5434px 0}.iti-flag.wf{height:14px;background-position:-5456px 0}.iti-flag.ws{height:10px;background-position:-5478px 0}.iti-flag.xk{height:15px;background-position:-5500px 0}.iti-flag.ye{height:14px;background-position:-5522px 0}.iti-flag.yt{height:14px;background-position:-5544px 0}.iti-flag.za{height:14px;background-position:-5566px 0}.iti-flag.zm{height:14px;background-position:-5588px 0}.iti-flag.zw{height:10px;background-position:-5610px 0}.iti-flag{width:20px;height:15px;box-shadow:0 0 1px 0 #888;background-image:url(flags.png);background-repeat:no-repeat;background-color:#dbdbdb;background-position:20px 0}@media only screen and (-o-min-device-pixel-ratio:2/1),only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:2dppx),only screen and (min-resolution:192dpi){.iti-flag{background-image:url(flags@2x.png)}}.iti-flag.np{background-color:transparent} \ No newline at end of file +.intl-tel-input{position:relative;display:inline-block}.intl-tel-input *{box-sizing:border-box;-moz-box-sizing:border-box}.intl-tel-input .hide{display:none}.intl-tel-input .v-hide{visibility:hidden}.intl-tel-input input,.intl-tel-input input[type=tel],.intl-tel-input input[type=text]{position:relative;z-index:0;margin-top:0!important;margin-bottom:0!important;padding-right:36px;margin-right:0}.intl-tel-input .flag-container{position:absolute;top:0;bottom:0;left:0;padding:1px}.intl-tel-input .selected-flag{z-index:1;position:relative;width:36px;height:100%;padding:0 0 0 8px}.intl-tel-input .selected-flag .iti-flag{position:absolute;top:0;bottom:0;margin:auto}.intl-tel-input .selected-flag .iti-arrow{position:absolute;top:50%;margin-top:-2px;right:6px;width:0;height:0;border-left:3px solid transparent;border-right:3px solid transparent;border-top:4px solid #555}.intl-tel-input .selected-flag .iti-arrow.up{border-top:none;border-bottom:4px solid #555}.intl-tel-input .country-list{position:absolute;z-index:2;list-style:none;text-align:left;padding:0;margin:0 0 0 -1px;box-shadow:1px 1px 4px rgba(0,0,0,.2);background-color:#fff;border:1px solid #ccc;white-space:nowrap;max-height:200px;overflow-y:scroll;-webkit-overflow-scrolling:touch}.intl-tel-input .country-list.dropup{bottom:100%;margin-bottom:-1px}.intl-tel-input .country-list .flag-box{display:inline-block;width:20px}@media (max-width:500px){.intl-tel-input .country-list{white-space:normal}}.intl-tel-input .country-list .divider{padding-bottom:5px;margin-bottom:5px;border-bottom:1px solid #ccc}.intl-tel-input .country-list .country{padding:5px 10px}.intl-tel-input .country-list .country .dial-code{color:#999}.intl-tel-input .country-list .country.highlight{background-color:rgba(0,0,0,.05)}.intl-tel-input .country-list .country-name,.intl-tel-input .country-list .dial-code,.intl-tel-input .country-list .flag-box{vertical-align:middle}.intl-tel-input .country-list .country-name,.intl-tel-input .country-list .flag-box{margin-right:6px}.intl-tel-input.allow-dropdown input,.intl-tel-input.allow-dropdown input[type=tel],.intl-tel-input.allow-dropdown input[type=text]{padding-right:6px;padding-left:52px;margin-left:0}.intl-tel-input.allow-dropdown .flag-container{right:auto;left:0;width:100%}.intl-tel-input.allow-dropdown .selected-flag{width:46px}.intl-tel-input.allow-dropdown .flag-container:hover{cursor:pointer}.intl-tel-input.allow-dropdown .flag-container:hover .selected-flag{background-color:rgba(0,0,0,.05)}.intl-tel-input.allow-dropdown input[disabled]+.flag-container:hover,.intl-tel-input.allow-dropdown input[readonly]+.flag-container:hover{cursor:default}.intl-tel-input.allow-dropdown input[disabled]+.flag-container:hover .selected-flag,.intl-tel-input.allow-dropdown input[readonly]+.flag-container:hover .selected-flag{background-color:transparent}.intl-tel-input.allow-dropdown.separate-dial-code .selected-flag{background-color:rgba(0,0,0,.05);display:table}.intl-tel-input.allow-dropdown.separate-dial-code .selected-dial-code{display:table-cell;vertical-align:middle;padding-left:28px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 input[type=text]{padding-left:76px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-2 .selected-flag{width:70px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 input[type=text]{padding-left:84px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-3 .selected-flag{width:78px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 input[type=text]{padding-left:92px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-4 .selected-flag{width:86px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 input,.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 input[type=tel],.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 input[type=text]{padding-left:100px}.intl-tel-input.allow-dropdown.separate-dial-code.iti-sdc-5 .selected-flag{width:94px}.intl-tel-input.iti-container{position:absolute;top:-1000px;left:-1000px;z-index:1060;padding:1px}.intl-tel-input.iti-container:hover{cursor:pointer}.iti-mobile .intl-tel-input.iti-container{top:30px;bottom:30px;left:30px;right:30px;position:fixed}.iti-mobile .intl-tel-input .country-list{max-height:100%;width:100%;-webkit-overflow-scrolling:touch}.iti-mobile .intl-tel-input .country-list .country{padding:10px;line-height:1.5em}.iti-flag.be{width:18px}.iti-flag.ch{width:15px}.iti-flag.mc{width:19px}.iti-flag.ne{width:18px}.iti-flag.np{width:13px}.iti-flag.va{width:15px}@media only screen and (-o-min-device-pixel-ratio:2/1),only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:2dppx),only screen and (min-resolution:192dpi){.iti-flag{background-size:5630px 15px}}.iti-flag.ac{height:10px;background-position:0 0}.iti-flag.ad{height:14px;background-position:-22px 0}.iti-flag.ae{height:10px;background-position:-44px 0}.iti-flag.af{height:14px;background-position:-66px 0}.iti-flag.ag{height:14px;background-position:-88px 0}.iti-flag.ai{height:10px;background-position:-110px 0}.iti-flag.al{height:15px;background-position:-132px 0}.iti-flag.am{height:10px;background-position:-154px 0}.iti-flag.ao{height:14px;background-position:-176px 0}.iti-flag.aq{height:14px;background-position:-198px 0}.iti-flag.ar{height:13px;background-position:-220px 0}.iti-flag.as{height:10px;background-position:-242px 0}.iti-flag.at{height:14px;background-position:-264px 0}.iti-flag.au{height:10px;background-position:-286px 0}.iti-flag.aw{height:14px;background-position:-308px 0}.iti-flag.ax{height:13px;background-position:-330px 0}.iti-flag.az{height:10px;background-position:-352px 0}.iti-flag.ba{height:10px;background-position:-374px 0}.iti-flag.bb{height:14px;background-position:-396px 0}.iti-flag.bd{height:12px;background-position:-418px 0}.iti-flag.be{height:15px;background-position:-440px 0}.iti-flag.bf{height:14px;background-position:-460px 0}.iti-flag.bg{height:12px;background-position:-482px 0}.iti-flag.bh{height:12px;background-position:-504px 0}.iti-flag.bi{height:12px;background-position:-526px 0}.iti-flag.bj{height:14px;background-position:-548px 0}.iti-flag.bl{height:14px;background-position:-570px 0}.iti-flag.bm{height:10px;background-position:-592px 0}.iti-flag.bn{height:10px;background-position:-614px 0}.iti-flag.bo{height:14px;background-position:-636px 0}.iti-flag.bq{height:14px;background-position:-658px 0}.iti-flag.br{height:14px;background-position:-680px 0}.iti-flag.bs{height:10px;background-position:-702px 0}.iti-flag.bt{height:14px;background-position:-724px 0}.iti-flag.bv{height:15px;background-position:-746px 0}.iti-flag.bw{height:14px;background-position:-768px 0}.iti-flag.by{height:10px;background-position:-790px 0}.iti-flag.bz{height:14px;background-position:-812px 0}.iti-flag.ca{height:10px;background-position:-834px 0}.iti-flag.cc{height:10px;background-position:-856px 0}.iti-flag.cd{height:15px;background-position:-878px 0}.iti-flag.cf{height:14px;background-position:-900px 0}.iti-flag.cg{height:14px;background-position:-922px 0}.iti-flag.ch{height:15px;background-position:-944px 0}.iti-flag.ci{height:14px;background-position:-961px 0}.iti-flag.ck{height:10px;background-position:-983px 0}.iti-flag.cl{height:14px;background-position:-1005px 0}.iti-flag.cm{height:14px;background-position:-1027px 0}.iti-flag.cn{height:14px;background-position:-1049px 0}.iti-flag.co{height:14px;background-position:-1071px 0}.iti-flag.cp{height:14px;background-position:-1093px 0}.iti-flag.cr{height:12px;background-position:-1115px 0}.iti-flag.cu{height:10px;background-position:-1137px 0}.iti-flag.cv{height:12px;background-position:-1159px 0}.iti-flag.cw{height:14px;background-position:-1181px 0}.iti-flag.cx{height:10px;background-position:-1203px 0}.iti-flag.cy{height:14px;background-position:-1225px 0}.iti-flag.cz{height:14px;background-position:-1247px 0}.iti-flag.de{height:12px;background-position:-1269px 0}.iti-flag.dg{height:10px;background-position:-1291px 0}.iti-flag.dj{height:14px;background-position:-1313px 0}.iti-flag.dk{height:15px;background-position:-1335px 0}.iti-flag.dm{height:10px;background-position:-1357px 0}.iti-flag.do{height:13px;background-position:-1379px 0}.iti-flag.dz{height:14px;background-position:-1401px 0}.iti-flag.ea{height:14px;background-position:-1423px 0}.iti-flag.ec{height:14px;background-position:-1445px 0}.iti-flag.ee{height:13px;background-position:-1467px 0}.iti-flag.eg{height:14px;background-position:-1489px 0}.iti-flag.eh{height:10px;background-position:-1511px 0}.iti-flag.er{height:10px;background-position:-1533px 0}.iti-flag.es{height:14px;background-position:-1555px 0}.iti-flag.et{height:10px;background-position:-1577px 0}.iti-flag.eu{height:14px;background-position:-1599px 0}.iti-flag.fi{height:12px;background-position:-1621px 0}.iti-flag.fj{height:10px;background-position:-1643px 0}.iti-flag.fk{height:10px;background-position:-1665px 0}.iti-flag.fm{height:11px;background-position:-1687px 0}.iti-flag.fo{height:15px;background-position:-1709px 0}.iti-flag.fr{height:14px;background-position:-1731px 0}.iti-flag.ga{height:15px;background-position:-1753px 0}.iti-flag.gb{height:10px;background-position:-1775px 0}.iti-flag.gd{height:12px;background-position:-1797px 0}.iti-flag.ge{height:14px;background-position:-1819px 0}.iti-flag.gf{height:14px;background-position:-1841px 0}.iti-flag.gg{height:14px;background-position:-1863px 0}.iti-flag.gh{height:14px;background-position:-1885px 0}.iti-flag.gi{height:10px;background-position:-1907px 0}.iti-flag.gl{height:14px;background-position:-1929px 0}.iti-flag.gm{height:14px;background-position:-1951px 0}.iti-flag.gn{height:14px;background-position:-1973px 0}.iti-flag.gp{height:14px;background-position:-1995px 0}.iti-flag.gq{height:14px;background-position:-2017px 0}.iti-flag.gr{height:14px;background-position:-2039px 0}.iti-flag.gs{height:10px;background-position:-2061px 0}.iti-flag.gt{height:13px;background-position:-2083px 0}.iti-flag.gu{height:11px;background-position:-2105px 0}.iti-flag.gw{height:10px;background-position:-2127px 0}.iti-flag.gy{height:12px;background-position:-2149px 0}.iti-flag.hk{height:14px;background-position:-2171px 0}.iti-flag.hm{height:10px;background-position:-2193px 0}.iti-flag.hn{height:10px;background-position:-2215px 0}.iti-flag.hr{height:10px;background-position:-2237px 0}.iti-flag.ht{height:12px;background-position:-2259px 0}.iti-flag.hu{height:10px;background-position:-2281px 0}.iti-flag.ic{height:14px;background-position:-2303px 0}.iti-flag.id{height:14px;background-position:-2325px 0}.iti-flag.ie{height:10px;background-position:-2347px 0}.iti-flag.il{height:15px;background-position:-2369px 0}.iti-flag.im{height:10px;background-position:-2391px 0}.iti-flag.in{height:14px;background-position:-2413px 0}.iti-flag.io{height:10px;background-position:-2435px 0}.iti-flag.iq{height:14px;background-position:-2457px 0}.iti-flag.ir{height:12px;background-position:-2479px 0}.iti-flag.is{height:15px;background-position:-2501px 0}.iti-flag.it{height:14px;background-position:-2523px 0}.iti-flag.je{height:12px;background-position:-2545px 0}.iti-flag.jm{height:10px;background-position:-2567px 0}.iti-flag.jo{height:10px;background-position:-2589px 0}.iti-flag.jp{height:14px;background-position:-2611px 0}.iti-flag.ke{height:14px;background-position:-2633px 0}.iti-flag.kg{height:12px;background-position:-2655px 0}.iti-flag.kh{height:13px;background-position:-2677px 0}.iti-flag.ki{height:10px;background-position:-2699px 0}.iti-flag.km{height:12px;background-position:-2721px 0}.iti-flag.kn{height:14px;background-position:-2743px 0}.iti-flag.kp{height:10px;background-position:-2765px 0}.iti-flag.kr{height:14px;background-position:-2787px 0}.iti-flag.kw{height:10px;background-position:-2809px 0}.iti-flag.ky{height:10px;background-position:-2831px 0}.iti-flag.kz{height:10px;background-position:-2853px 0}.iti-flag.la{height:14px;background-position:-2875px 0}.iti-flag.lb{height:14px;background-position:-2897px 0}.iti-flag.lc{height:10px;background-position:-2919px 0}.iti-flag.li{height:12px;background-position:-2941px 0}.iti-flag.lk{height:10px;background-position:-2963px 0}.iti-flag.lr{height:11px;background-position:-2985px 0}.iti-flag.ls{height:14px;background-position:-3007px 0}.iti-flag.lt{height:12px;background-position:-3029px 0}.iti-flag.lu{height:12px;background-position:-3051px 0}.iti-flag.lv{height:10px;background-position:-3073px 0}.iti-flag.ly{height:10px;background-position:-3095px 0}.iti-flag.ma{height:14px;background-position:-3117px 0}.iti-flag.mc{height:15px;background-position:-3139px 0}.iti-flag.md{height:10px;background-position:-3160px 0}.iti-flag.me{height:10px;background-position:-3182px 0}.iti-flag.mf{height:14px;background-position:-3204px 0}.iti-flag.mg{height:14px;background-position:-3226px 0}.iti-flag.mh{height:11px;background-position:-3248px 0}.iti-flag.mk{height:10px;background-position:-3270px 0}.iti-flag.ml{height:14px;background-position:-3292px 0}.iti-flag.mm{height:14px;background-position:-3314px 0}.iti-flag.mn{height:10px;background-position:-3336px 0}.iti-flag.mo{height:14px;background-position:-3358px 0}.iti-flag.mp{height:10px;background-position:-3380px 0}.iti-flag.mq{height:14px;background-position:-3402px 0}.iti-flag.mr{height:14px;background-position:-3424px 0}.iti-flag.ms{height:10px;background-position:-3446px 0}.iti-flag.mt{height:14px;background-position:-3468px 0}.iti-flag.mu{height:14px;background-position:-3490px 0}.iti-flag.mv{height:14px;background-position:-3512px 0}.iti-flag.mw{height:14px;background-position:-3534px 0}.iti-flag.mx{height:12px;background-position:-3556px 0}.iti-flag.my{height:10px;background-position:-3578px 0}.iti-flag.mz{height:14px;background-position:-3600px 0}.iti-flag.na{height:14px;background-position:-3622px 0}.iti-flag.nc{height:10px;background-position:-3644px 0}.iti-flag.ne{height:15px;background-position:-3666px 0}.iti-flag.nf{height:10px;background-position:-3686px 0}.iti-flag.ng{height:10px;background-position:-3708px 0}.iti-flag.ni{height:12px;background-position:-3730px 0}.iti-flag.nl{height:14px;background-position:-3752px 0}.iti-flag.no{height:15px;background-position:-3774px 0}.iti-flag.np{height:15px;background-position:-3796px 0}.iti-flag.nr{height:10px;background-position:-3811px 0}.iti-flag.nu{height:10px;background-position:-3833px 0}.iti-flag.nz{height:10px;background-position:-3855px 0}.iti-flag.om{height:10px;background-position:-3877px 0}.iti-flag.pa{height:14px;background-position:-3899px 0}.iti-flag.pe{height:14px;background-position:-3921px 0}.iti-flag.pf{height:14px;background-position:-3943px 0}.iti-flag.pg{height:15px;background-position:-3965px 0}.iti-flag.ph{height:10px;background-position:-3987px 0}.iti-flag.pk{height:14px;background-position:-4009px 0}.iti-flag.pl{height:13px;background-position:-4031px 0}.iti-flag.pm{height:14px;background-position:-4053px 0}.iti-flag.pn{height:10px;background-position:-4075px 0}.iti-flag.pr{height:14px;background-position:-4097px 0}.iti-flag.ps{height:10px;background-position:-4119px 0}.iti-flag.pt{height:14px;background-position:-4141px 0}.iti-flag.pw{height:13px;background-position:-4163px 0}.iti-flag.py{height:11px;background-position:-4185px 0}.iti-flag.qa{height:8px;background-position:-4207px 0}.iti-flag.re{height:14px;background-position:-4229px 0}.iti-flag.ro{height:14px;background-position:-4251px 0}.iti-flag.rs{height:14px;background-position:-4273px 0}.iti-flag.ru{height:14px;background-position:-4295px 0}.iti-flag.rw{height:14px;background-position:-4317px 0}.iti-flag.sa{height:14px;background-position:-4339px 0}.iti-flag.sb{height:10px;background-position:-4361px 0}.iti-flag.sc{height:10px;background-position:-4383px 0}.iti-flag.sd{height:10px;background-position:-4405px 0}.iti-flag.se{height:13px;background-position:-4427px 0}.iti-flag.sg{height:14px;background-position:-4449px 0}.iti-flag.sh{height:10px;background-position:-4471px 0}.iti-flag.si{height:10px;background-position:-4493px 0}.iti-flag.sj{height:15px;background-position:-4515px 0}.iti-flag.sk{height:14px;background-position:-4537px 0}.iti-flag.sl{height:14px;background-position:-4559px 0}.iti-flag.sm{height:15px;background-position:-4581px 0}.iti-flag.sn{height:14px;background-position:-4603px 0}.iti-flag.so{height:14px;background-position:-4625px 0}.iti-flag.sr{height:14px;background-position:-4647px 0}.iti-flag.ss{height:10px;background-position:-4669px 0}.iti-flag.st{height:10px;background-position:-4691px 0}.iti-flag.sv{height:12px;background-position:-4713px 0}.iti-flag.sx{height:14px;background-position:-4735px 0}.iti-flag.sy{height:14px;background-position:-4757px 0}.iti-flag.sz{height:14px;background-position:-4779px 0}.iti-flag.ta{height:10px;background-position:-4801px 0}.iti-flag.tc{height:10px;background-position:-4823px 0}.iti-flag.td{height:14px;background-position:-4845px 0}.iti-flag.tf{height:14px;background-position:-4867px 0}.iti-flag.tg{height:13px;background-position:-4889px 0}.iti-flag.th{height:14px;background-position:-4911px 0}.iti-flag.tj{height:10px;background-position:-4933px 0}.iti-flag.tk{height:10px;background-position:-4955px 0}.iti-flag.tl{height:10px;background-position:-4977px 0}.iti-flag.tm{height:14px;background-position:-4999px 0}.iti-flag.tn{height:14px;background-position:-5021px 0}.iti-flag.to{height:10px;background-position:-5043px 0}.iti-flag.tr{height:14px;background-position:-5065px 0}.iti-flag.tt{height:12px;background-position:-5087px 0}.iti-flag.tv{height:10px;background-position:-5109px 0}.iti-flag.tw{height:14px;background-position:-5131px 0}.iti-flag.tz{height:14px;background-position:-5153px 0}.iti-flag.ua{height:14px;background-position:-5175px 0}.iti-flag.ug{height:14px;background-position:-5197px 0}.iti-flag.um{height:11px;background-position:-5219px 0}.iti-flag.us{height:11px;background-position:-5241px 0}.iti-flag.uy{height:14px;background-position:-5263px 0}.iti-flag.uz{height:10px;background-position:-5285px 0}.iti-flag.va{height:15px;background-position:-5307px 0}.iti-flag.vc{height:14px;background-position:-5324px 0}.iti-flag.ve{height:14px;background-position:-5346px 0}.iti-flag.vg{height:10px;background-position:-5368px 0}.iti-flag.vi{height:14px;background-position:-5390px 0}.iti-flag.vn{height:14px;background-position:-5412px 0}.iti-flag.vu{height:12px;background-position:-5434px 0}.iti-flag.wf{height:14px;background-position:-5456px 0}.iti-flag.ws{height:10px;background-position:-5478px 0}.iti-flag.xk{height:15px;background-position:-5500px 0}.iti-flag.ye{height:14px;background-position:-5522px 0}.iti-flag.yt{height:14px;background-position:-5544px 0}.iti-flag.za{height:14px;background-position:-5566px 0}.iti-flag.zm{height:14px;background-position:-5588px 0}.iti-flag.zw{height:10px;background-position:-5610px 0}.iti-flag{width:20px;height:15px;box-shadow:0 0 1px 0 #888;background-image:url(flags.png);background-repeat:no-repeat;background-color:#dbdbdb;background-position:20px 0}@media only screen and (-o-min-device-pixel-ratio:2/1),only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:2dppx),only screen and (min-resolution:192dpi){.iti-flag{background-image:url(flags@2x.png)}}.iti-flag.np{background-color:transparent} \ No newline at end of file diff --git a/example/main.js b/example/main.js index 3795ebdf6..273dcf90b 100644 --- a/example/main.js +++ b/example/main.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prop-types"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["prop-types","react","react-dom"],t):"object"==typeof exports?exports.IntlTelInput=t(require("prop-types"),require("react"),require("react-dom")):e.IntlTelInput=t(e.PropTypes,e.React,e.ReactDOM)}(this,function(e,t,o){return function(e){function t(i){if(o[i])return o[i].exports;var n=o[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,i){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=14)}([function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t,o){var i,n;!function(){"use strict";function o(){for(var e=[],t=0;t=0},retrieveLiIndex:function(e){if(!e)return-1;for(var t=e.parentNode.childNodes,o=0,i=0,n=t.length;i-1;)s.splice(t,1),n&&(t<=a&&a--,t<=l&&l--)}),this},has:function(e){return g(e,s)>-1},empty:function(){return s=[],this},disable:function(){return s=d=t=void 0,this},disabled:function(){return!s},lock:function(){return d=void 0,t||p.disable(),this},locked:function(){return!d},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!s||i&&!d||(n?d.push(t):u(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},M.Deferred=function(e){var t=[["resolve","done",M.Callbacks("once memory"),"resolved"],["reject","fail",M.Callbacks("once memory"),"rejected"],["notify","progress",M.Callbacks("memory")]],o="pending",i={state:function(){return o},always:function(){return n.done(arguments).fail(arguments),this},then:function(){var e=arguments;return M.Deferred(function(o){c(t,function(t,i){var r=t[0],a=e[i];n[t[1]](p(a)?function(){var e;try{e=a.apply(this,arguments)}catch(e){return void o.reject(e)}e&&p(e.promise)?e.promise().done(o.resolve).fail(o.reject).progress(o.notify):o["notify"!==r?"resolveWith":r+"With"](this===n?o:this,[e])}:o[r])}),e=null}).promise()},promise:function(e){return null!=e?h(e,i):i}},n={};return i.pipe=i.then,c(t,function(e,r){var a=e[2],l=e[3];i[e[1]]=a.add,l&&a.add(function(){o=l},t[1^r][2].disable,t[2][2].lock),n[e[0]]=a.fire,n[e[0]+"With"]=a.fireWith}),i.promise(n),e&&e.call(n,n),n},M.when=function(e){var t,o,i,n=0,r="array"===f(e)&&1===arguments.length?e:u.call(arguments),a=r.length,l=1!==a||e&&p(e.promise)?a:0,s=1===l?e:M.Deferred(),d=function(e,o,i){return function(n){o[e]=this,i[e]=arguments.length>1?u.call(arguments):n,i===t?s.notifyWith(o,i):--l||s.resolveWith(o,i)}};if(a>1)for(t=new Array(a),o=new Array(a),i=new Array(a);n1?t-1:0),i=1;it,l=!r&&a?"-"+(n-1)+"px":"";this.listElement.style.top=l,this.listElement.setAttribute("class","country-list")}},{key:"setFlag",value:function(e){this.props.setFlag(e)}},{key:"appendListItem",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.props.preferredCountries.length;return e.map(function(e,n){var r=o?n:n+i,l={country:!0,highlight:t.props.highlightedCountry===r,preferred:o},d=c()(l),u=o?"pref-":"";return s.a.createElement("li",{key:""+u+e.iso2,className:d,"data-dial-code":e.dialCode,"data-country-code":e.iso2,onMouseOver:t.props.isMobile?null:t.handleMouseOver,onClick:a(t.setFlag,e.iso2)},s.a.createElement("div",{ref:function(e){t.selectedFlag=e},className:"flag-box"},s.a.createElement("div",{ref:function(e){t.selectedFlagInner=e},className:"iti-flag "+e.iso2})),s.a.createElement("span",{className:"country-name"},e.name),s.a.createElement("span",{className:"dial-code"},"+",e.dialCode))})}},{key:"handleMouseOver",value:function(e){if(e.currentTarget.getAttribute("class").indexOf("country")>-1){var t=p.a.retrieveLiIndex(e.currentTarget);this.props.changeHighlightCountry(!0,t)}}},{key:"render",value:function(){var e=this,t="",o=this.props.preferredCountries,i=null,n=this.props.countries,r=c()({"country-list":!0,hide:!this.props.showDropdown}),a=null;return o.length&&(i=this.appendListItem(o,!0),a=s.a.createElement("div",{className:"divider"})),t=this.appendListItem(n),s.a.createElement("ul",{ref:function(t){e.listElement=t},className:r},i,a,t)}}]),t}(l.Component);t.a=g},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=o(1),l=o.n(a),s=o(0),d=(o.n(s),o(5)),u=o.n(d),c=function(){function e(e,t){for(var o=0;o=4},o.wrapperClass={},o.autoCountry="",o.tempCountry="",o.startedLoadingAutoCountry=!1,o.deferreds=[],o.autoCountryDeferred=new p.a.Deferred,o.utilsScriptDeferred=new p.a.Deferred,o.isOpening=!1,o.isMobile="undefined"!=typeof navigator&&k.test(navigator.userAgent),o.preferredCountries=[],o.countries=[],o.countryCodes={},o.windowLoaded=!1,o.keys={UP:38,DOWN:40,ENTER:13,ESC:27,PLUS:43,A:65,Z:90,SPACE:32,TAB:9},o.query="",o.state={showDropdown:!1,highlightedCountry:0,value:e.value||e.defaultValue,disabled:e.disabled,readonly:!1,offsetTop:0,outerHeight:0,placeholder:"",title:"",countryCode:"us",dialCode:""},o.selectedCountryData={},o.addCountryCode=o.addCountryCode.bind(o),o.autoCountryLoaded=o.autoCountryLoaded.bind(o),o.getDialCode=o.getDialCode.bind(o),o.handleOnBlur=o.handleOnBlur.bind(o),o.handleSelectedFlagKeydown=o.handleSelectedFlagKeydown.bind(o),o.setInitialState=o.setInitialState.bind(o),o.setNumber=o.setNumber.bind(o),o.scrollTo=o.scrollTo.bind(o),o.updateDialCode=o.updateDialCode.bind(o),o.notifyPhoneNumberChange=o.notifyPhoneNumberChange.bind(o),o.isValidNumber=o.isValidNumber.bind(o),o.isUnknownNanp=o.isUnknownNanp.bind(o),o.initRequests=o.initRequests.bind(o),o.updateFlagFromNumber=o.updateFlagFromNumber.bind(o),o.updatePlaceholder=o.updatePlaceholder.bind(o),o.loadAutoCountry=o.loadAutoCountry.bind(o),o.loadUtils=o.loadUtils.bind(o),o.processCountryData=o.processCountryData.bind(o),o.getNumber=o.getNumber.bind(o),o.setFlag=o.setFlag.bind(o),o.clickSelectedFlag=o.clickSelectedFlag.bind(o),o.updateValFromNumber=o.updateValFromNumber.bind(o),o.handleWindowScroll=o.handleWindowScroll.bind(o),o.handleDocumentKeyDown=o.handleDocumentKeyDown.bind(o),o.handleDocumentClick=o.handleDocumentClick.bind(o),o.bindDocumentClick=o.bindDocumentClick.bind(o),o.unbindDocumentClick=o.unbindDocumentClick.bind(o),o.searchForCountry=o.searchForCountry.bind(o),o.handleEnterKey=o.handleEnterKey.bind(o),o.toggleDropdown=o.toggleDropdown.bind(o),o.handleUpDownKey=o.handleUpDownKey.bind(o),o.handleInputChange=o.handleInputChange.bind(o),o.changeHighlightCountry=o.changeHighlightCountry.bind(o),o.formatNumber=o.formatNumber.bind(o),o}return r(t,e),b(t,[{key:"componentDidMount",value:function(){var e=this;this.autoHideDialCode=this.props.autoHideDialCode,this.allowDropdown=this.props.allowDropdown,this.nationalMode=this.props.nationalMode,this.dropdownContainer="",this.nationalMode&&(this.autoHideDialCode=!1),this.props.separateDialCode&&(this.autoHideDialCode=!1,this.nationalMode=!1,this.allowDropdown=!0),this.processCountryData.call(this),this.tempCountry=this.getTempCountry(this.props.defaultCountry),"complete"===document.readyState?this.windowLoaded=!0:window.addEventListener("load",function(){e.windowLoaded=!0}),this.generateMarkup(),this.setInitialState(),this.initRequests(),this.deferreds.push(this.autoCountryDeferred.promise()),this.deferreds.push(this.utilsScriptDeferred.promise()),p.a.when(this.deferreds).done(function(){e.setInitialState()}),document.addEventListener("keydown",this.handleDocumentKeyDown)}},{key:"componentWillReceiveProps",value:function(e){this.props.value!==e.value&&this.setState({value:e.value}),this.props.disabled!==e.disabled&&this.setState({disabled:e.disabled}),"function"==typeof e.customPlaceholder&&this.props.customPlaceholder!==e.customPlaceholder&&this.updatePlaceholder(e)}},{key:"componentWillUpdate",value:function(e,t){t.showDropdown?(document.addEventListener("keydown",this.handleDocumentKeyDown),this.bindDocumentClick()):(document.removeEventListener("keydown",this.handleDocumentKeyDown),this.unbindDocumentClick())}},{key:"componentDidUpdate",value:function(e){this.props.value!==e.value&&this.updateFlagFromNumber(this.props.value)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleDocumentKeyDown),window.removeEventListener("scroll",this.handleWindowScroll),this.unbindDocumentClick()}},{key:"getTempCountry",value:function(e){if("auto"===e)return"auto";var t=M.a.getCountryData(this.countries,e);return t.iso2||(t=this.props.preferredCountries.length>0?M.a.getCountryData(this.countries,this.props.preferredCountries[0]):g.a.getCountries()[0]),t.iso2}},{key:"setNumber",value:function(e,t){this.updateFlagFromNumber(e),this.updateValFromNumber(e,!t)}},{key:"setFlag",value:function(e,t){var o=this,i=this.selectedCountryData&&this.selectedCountryData.iso2?this.selectedCountryData:{};this.selectedCountryData=e?M.a.getCountryData(this.countries,e,!1,!1,this.props.noCountryDataHandler):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2);var n=e?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown",r=this.state.dialCode;this.props.separateDialCode&&(r=this.selectedCountryData.dialCode?"+"+this.selectedCountryData.dialCode:"",i.dialCode&&delete this.wrapperClass["iti-sdc-"+(i.dialCode.length+1)],r&&(this.wrapperClass["iti-sdc-"+r.length]=!0));var a=0;e&&"auto"!==e&&(a=M.a.findIndex(this.preferredCountries,function(t){return t.iso2===e}),a===-1&&(a=M.a.findIndex(this.countries,function(t){return t.iso2===e}),a===-1&&(a=0),a+=this.preferredCountries.length)),this.tel&&this.state.showDropdown&&this.tel.focus();var l=this.updateDialCode(this.selectedCountryData.dialCode,!t);this.setState({value:l,showDropdown:!1,highlightedCountry:a,countryCode:e,title:n,dialCode:r},function(){if(o.updatePlaceholder(o.props),o.wrapperClass.active=!1,!t&&i.iso2!==e&&"function"==typeof o.props.onSelectFlag){var n=o.state.value;o.props.onSelectFlag(n,o.selectedCountryData)}})}},{key:"getExtension",value:function(e){return window.intlTelInputUtils?window.intlTelInputUtils.getExtension(this.getFullNumber(e),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(e,t){return window.intlTelInputUtils?window.intlTelInputUtils.formatNumber(this.getFullNumber(e),this.selectedCountryData.iso2,t):""}},{key:"getFullNumber",value:function(e){var t=this.props.separateDialCode?"+"+this.selectedCountryData.dialCode:"";return t+e}},{key:"getDialCode",value:function(e){var t="";if("+"===e.charAt(0))for(var o="",i=0,n=e.length;it?e.substr(0,t):e}},{key:"removeEmptyDialCode",value:function(){var e=this.state.value,t="+"===e.charAt(0);if(t){var o=M.a.getNumeric(e);o&&this.selectedCountryData.dialCode!==o||this.setState({value:""})}}},{key:"handleUpDownKey",value:function(e){var t=this.flagDropDown.querySelectorAll(".highlight")[0],o=t?t.previousElementSibling:void 0,i=t?t.nextElementSibling:void 0,n=e===this.keys.UP?o:i;if(n){n.getAttribute("class").indexOf("divider")>-1&&(n=e===this.keys.UP?n.previousElementSibling:n.nextElementSibling),this.scrollTo(n);var r=M.a.retrieveLiIndex(n);this.setState({showDropdown:!0,highlightedCountry:r})}}},{key:"handleEnterKey",value:function(){var e=this,t=this.flagDropDown.querySelectorAll(".highlight")[0];if(t){var o=M.a.retrieveLiIndex(t),i=t.getAttribute("data-country-code");this.setState({showDropdown:!1,highlightedCountry:o,countryCode:i},function(){e.setFlag(e.state.countryCode),e.unbindDocumentClick()})}}},{key:"searchForCountry",value:function(e){for(var t=0,o=this.countries.length;t2&&void 0!==arguments[2]&&arguments[2];if(t&&window.intlTelInputUtils&&this.selectedCountryData){var n=this.props.separateDialCode||!this.nationalMode&&"+"===e.charAt(0)?window.intlTelInputUtils.numberFormat.INTERNATIONAL:window.intlTelInputUtils.numberFormat.NATIONAL;e=window.intlTelInputUtils.formatNumber(e,this.selectedCountryData.iso2,n)}e=this.beforeSetNumber(e),this.setState({showDropdown:!1,value:e},function(){i&&o.notifyPhoneNumberChange(o.state.value),o.unbindDocumentClick()})}},{key:"updateFlagFromNumber",value:function(e,t){e&&this.nationalMode&&this.selectedCountryData&&"1"===this.selectedCountryData.dialCode&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1"+e),e="+"+e);var o=this.getDialCode(e),i=null;if(o){var n=this.countryCodes[M.a.getNumeric(o)],r=this.selectedCountryData&&n.indexOf(this.selectedCountryData.iso2)!==-1;if(!r||this.isUnknownNanp(e,o))for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:this.props;if(window.intlTelInputUtils&&e.autoPlaceholder&&this.selectedCountryData){var t=window.intlTelInputUtils.numberType[e.numberType],o=this.selectedCountryData.iso2?window.intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.nationalMode,t):"";o=this.beforeSetNumber(o,e),"function"==typeof e.customPlaceholder&&(o=e.customPlaceholder(o,this.selectedCountryData)),this.setState({placeholder:o})}}},{key:"toggleDropdown",value:function(e){var t=this;this.setState({showDropdown:!!e},function(){t.state.showDropdown||t.unbindDocumentClick()})}},{key:"scrollTo",value:function(e,t){try{var o=this.flagDropDown.querySelector(".country-list"),i=parseFloat(window.getComputedStyle(o).getPropertyValue("height"),10),n=M.a.offset(o).top,r=n+i,a=M.a.getOuterHeight(e),l=M.a.offset(e).top,s=l+a,d=i/2-a/2,u=l-n+o.scrollTop;if(lr){t&&(u+=d);var c=i-a;o.scrollTop=u-c}}catch(e){}}},{key:"updateDialCode",value:function(e,t){var o=this.state.value;if(!e)return o;var i=o;if(e="+"+e,"+"===o.charAt(0)){var n=this.getDialCode(o);i=n?o.replace(n,e):e}else this.nationalMode||this.props.separateDialCode||(o?i=e+o:!t&&this.autoHideDialCode||(i=e));return i!==o&&this.notifyPhoneNumberChange(i),i}},{key:"generateMarkup",value:function(){this.wrapperClass["allow-dropdown"]=this.allowDropdown,this.wrapperClass["separate-dial-code"]=this.props.separateDialCode,this.isMobile&&this.props.useMobileFullscreenDropdown&&(M.a.addClass(document.querySelector("body"),"iti-mobile"),this.dropdownContainer="body",window.addEventListener("scroll",this.handleWindowScroll))}},{key:"handleSelectedFlagKeydown",value:function(e){this.state.showDropdown||e.which!==this.keys.UP&&e.which!==this.keys.DOWN&&e.which!==this.keys.SPACE&&e.which!==this.keys.ENTER||(e.preventDefault(),e.stopPropagation(),this.toggleDropdown(!0)),e.which===this.keys.TAB&&this.toggleDropdown(!1)}},{key:"isValidNumber",value:function(e){var t=M.a.trim(e),o=this.nationalMode||this.props.separateDialCode?this.selectedCountryData.iso2:"";return!!window.intlTelInputUtils&&window.intlTelInputUtils.isValidNumber(t,o)}},{key:"formatFullNumber",value:function(e){return window.intlTelInputUtils?this.getNumber(e,window.intlTelInputUtils.numberFormat.INTERNATIONAL):e}},{key:"notifyPhoneNumberChange",value:function(e){if("function"==typeof this.props.onPhoneNumberChange){var t=this.formatFullNumber(e),o=this.isValidNumber(t);this.props.onPhoneNumberChange(o,e,this.selectedCountryData,t,this.getExtension(e))}}},{key:"beforeSetNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props;if(t.separateDialCode){var o=this.getDialCode(e);if(o){null!==this.selectedCountryData.areaCodes&&(o="+"+this.selectedCountryData.dialCode);var i=" "===e[o.length]||"-"===e[o.length]?o.length+1:o.length;e=e.substr(i)}}return this.cap(e)}},{key:"handleWindowScroll",value:function(){var e=this;this.setState({showDropdown:!1},function(){window.removeEventListener("scroll",e.handleWindowScroll)})}},{key:"handleDocumentKeyDown",value:function(e){var t=this,o=void 0;e.preventDefault(),e.which===this.keys.UP||e.which===this.keys.DOWN?this.handleUpDownKey(e.which):e.which===this.keys.ENTER?this.handleEnterKey():e.which===this.keys.ESC?this.setState({showDropdown:!1}):(e.which>=this.keys.A&&e.which<=this.keys.Z||e.which===this.keys.SPACE)&&(o&&clearTimeout(o),this.query||(this.query=""),this.query+=String.fromCharCode(e.which),this.searchForCountry(this.query),o=setTimeout(function(){t.query=""},1e3))}},{key:"handleDocumentClick",value:function(e){(null===e.target.getAttribute("class")||e.target.getAttribute("class")&&e.target.getAttribute("class").indexOf("country")===-1)&&(this.isOpening=!1),this.isOpening||this.toggleDropdown(!1),this.isOpening=!1}},{key:"handleInputChange",value:function(e){var t=this,o=this.props.format?this.formatNumber(e.target.value):e.target.value;void 0!==this.props.value?(this.updateFlagFromNumber(o),this.notifyPhoneNumberChange(o)):this.setState({value:o},function(){t.updateFlagFromNumber(o),t.notifyPhoneNumberChange(o)})}},{key:"changeHighlightCountry",value:function(e,t){this.setState({showDropdown:e,highlightedCountry:t})}},{key:"loadUtils",value:function(){var e=this;if(window.intlTelInputUtils)return void this.utilsScriptDeferred.resolve();var t=new XMLHttpRequest;t.open("GET",this.props.utilsScript,!0),t.onload=function(){if(t.status>=200&&t.status<400){var o=t.responseText;if(o&&!document.getElementById("intlTelInputUtils")){var i=document.getElementsByTagName("body")[0],n=document.createElement("script");n.id="intlTelInputUtils",n.text=o,i.appendChild(n)}e.utilsScriptDeferred.resolve()}},t.send()}},{key:"autoCountryLoaded",value:function(){"auto"===this.tempCountry&&(this.tempCountry=this.autoCountry,this.autoCountryDeferred.resolve())}},{key:"render",value:function(){this.wrapperClass[this.props.css[0]]=!0;var e=this.props.css[1],t=Object.assign({},this.props.style||{});this.wrapperClass.expanded=this.state.showDropdown;var o=u()(this.wrapperClass),i=this.selectedCountryData?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown",n=void 0!==this.props.value?this.props.value:this.state.value;return l.a.createElement("div",{className:o,style:t},l.a.createElement(m.a,{refCallback:this.setFlagDropdownRef,allowDropdown:this.allowDropdown,dropdownContainer:this.dropdownContainer,separateDialCode:this.props.separateDialCode,dialCode:this.state.dialCode,clickSelectedFlag:this.clickSelectedFlag,setFlag:this.setFlag,countryCode:this.state.countryCode,isMobile:this.isMobile,handleSelectedFlagKeydown:this.handleSelectedFlagKeydown,changeHighlightCountry:this.changeHighlightCountry,countries:this.countries,showDropdown:this.state.showDropdown,inputTop:this.state.offsetTop,inputOuterHeight:this.state.outerHeight,preferredCountries:this.preferredCountries,highlightedCountry:this.state.highlightedCountry,titleTip:i}),l.a.createElement(f.a,{refCallback:this.setTelRef,handleInputChange:this.handleInputChange,handleOnBlur:this.handleOnBlur,className:e,disabled:this.state.disabled,readonly:this.state.readonly,fieldName:this.props.fieldName,fieldId:this.props.fieldId,value:n,placeholder:void 0!==this.props.placeholder?this.props.placeholder:this.state.placeholder,autoFocus:this.props.autoFocus,autoComplete:this.props.autoComplete,inputProps:this.props.telInputProps}))}}]),t}(a.Component);y.defaultProps={css:["intl-tel-input",""],fieldName:"",fieldId:"",defaultValue:"",countriesData:null,allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:!0,customPlaceholder:null,excludeCountries:[],formatOnInit:!0,separateDialCode:!1,defaultCountry:"",geoIpLookup:null,nationalMode:!0,numberType:"MOBILE",noCountryDataHandler:null,onlyCountries:[],preferredCountries:["us","gb"],utilsScript:"",onPhoneNumberChange:null,onPhoneNumberBlur:null,onSelectFlag:null,disabled:!1,autoFocus:!1,useMobileFullscreenDropdown:!0,autoComplete:"off",telInputProps:{},format:!1},t.default=y}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prop-types"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["prop-types","react","react-dom"],t):"object"==typeof exports?exports.IntlTelInput=t(require("prop-types"),require("react"),require("react-dom")):e.IntlTelInput=t(e.PropTypes,e.React,e.ReactDOM)}(this,function(e,t,o){return function(e){function t(i){if(o[i])return o[i].exports;var n=o[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,i){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=14)}([function(t,o){t.exports=e},function(e,o){e.exports=t},function(e,t,o){var i,n;!function(){"use strict";function o(){for(var e=[],t=0;t=0},retrieveLiIndex:function(e){if(!e)return-1;for(var t=e.parentNode.childNodes,o=0,i=0,n=t.length;i-1;)s.splice(t,1),n&&(t<=a&&a--,t<=l&&l--)}),this},has:function(e){return g(e,s)>-1},empty:function(){return s=[],this},disable:function(){return s=d=t=void 0,this},disabled:function(){return!s},lock:function(){return d=void 0,t||p.disable(),this},locked:function(){return!d},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!s||i&&!d||(n?d.push(t):u(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},M.Deferred=function(e){var t=[["resolve","done",M.Callbacks("once memory"),"resolved"],["reject","fail",M.Callbacks("once memory"),"rejected"],["notify","progress",M.Callbacks("memory")]],o="pending",i={state:function(){return o},always:function(){return n.done(arguments).fail(arguments),this},then:function(){var e=arguments;return M.Deferred(function(o){c(t,function(t,i){var r=t[0],a=e[i];n[t[1]](p(a)?function(){var e;try{e=a.apply(this,arguments)}catch(e){return void o.reject(e)}e&&p(e.promise)?e.promise().done(o.resolve).fail(o.reject).progress(o.notify):o["notify"!==r?"resolveWith":r+"With"](this===n?o:this,[e])}:o[r])}),e=null}).promise()},promise:function(e){return null!=e?h(e,i):i}},n={};return i.pipe=i.then,c(t,function(e,r){var a=e[2],l=e[3];i[e[1]]=a.add,l&&a.add(function(){o=l},t[1^r][2].disable,t[2][2].lock),n[e[0]]=a.fire,n[e[0]+"With"]=a.fireWith}),i.promise(n),e&&e.call(n,n),n},M.when=function(e){var t,o,i,n=0,r="array"===f(e)&&1===arguments.length?e:u.call(arguments),a=r.length,l=1!==a||e&&p(e.promise)?a:0,s=1===l?e:M.Deferred(),d=function(e,o,i){return function(n){o[e]=this,i[e]=arguments.length>1?u.call(arguments):n,i===t?s.notifyWith(o,i):--l||s.resolveWith(o,i)}};if(a>1)for(t=new Array(a),o=new Array(a),i=new Array(a);n1?t-1:0),i=1;it,l=!r&&a?"-"+(n-1)+"px":"";this.listElement.style.top=l,this.listElement.setAttribute("class","country-list")}},{key:"setFlag",value:function(e){this.props.setFlag(e)}},{key:"appendListItem",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.props.preferredCountries.length;return e.map(function(e,n){var r=o?n:n+i,l={country:!0,highlight:t.props.highlightedCountry===r,preferred:o},d=c()(l),u=o?"pref-":"",p=t.props.selectedCountryCode===e.iso2;return s.a.createElement("li",{key:""+u+e.iso2,className:d,"data-dial-code":e.dialCode,"data-country-code":e.iso2,onMouseOver:t.props.isMobile?null:t.handleMouseOver,onClick:a(t.setFlag,e.iso2),role:"option","aria-selected":p,id:t.props.getItemId(r),tabIndex:"-1"},s.a.createElement("div",{ref:function(e){t.selectedFlag=e},className:"flag-box"},s.a.createElement("div",{ref:function(e){t.selectedFlagInner=e},className:"iti-flag "+e.iso2})),s.a.createElement("span",{className:"country-name"},e.name),s.a.createElement("span",{className:"dial-code"},"+",e.dialCode))})}},{key:"handleMouseOver",value:function(e){if(e.currentTarget.getAttribute("class").indexOf("country")>-1){var t=p.a.retrieveLiIndex(e.currentTarget);this.props.changeHighlightCountry(!0,t)}}},{key:"render",value:function(){var e=this,t="",o=this.props.preferredCountries,i=null,n=this.props.countries,r=c()({"country-list":!0,hide:!this.props.showDropdown}),a=null;return o.length&&(i=this.appendListItem(o,!0),a=s.a.createElement("div",{className:"divider"})),t=this.appendListItem(n),s.a.createElement("ul",{ref:function(t){e.listElement=t},className:r,id:this.props.countryListId,role:"listbox"},i,a,t)}}]),t}(l.Component);t.a=g},function(e,t,o){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=o(1),l=o.n(a),s=o(0),d=(o.n(s),o(5)),u=o.n(d),c=function(){function e(e,t){for(var o=0;o=4},o.wrapperClass={},o.autoCountry="",o.tempCountry="",o.startedLoadingAutoCountry=!1,o.deferreds=[],o.autoCountryDeferred=new p.a.Deferred,o.utilsScriptDeferred=new p.a.Deferred,o.isOpening=!1,o.isMobile="undefined"!=typeof navigator&&k.test(navigator.userAgent),o.preferredCountries=[],o.countries=[],o.countryCodes={},o.windowLoaded=!1,o.keys={UP:38,DOWN:40,ENTER:13,ESC:27,PLUS:43,A:65,Z:90,SPACE:32,TAB:9},o.query="",o.state={showDropdown:!1,highlightedCountry:0,value:e.value||e.defaultValue,disabled:e.disabled,readonly:!1,offsetTop:0,outerHeight:0,placeholder:"",title:"",countryCode:"us",dialCode:""},o.selectedCountryData={},o.addCountryCode=o.addCountryCode.bind(o),o.autoCountryLoaded=o.autoCountryLoaded.bind(o),o.getDialCode=o.getDialCode.bind(o),o.handleOnBlur=o.handleOnBlur.bind(o),o.handleSelectedFlagKeydown=o.handleSelectedFlagKeydown.bind(o),o.setInitialState=o.setInitialState.bind(o),o.setNumber=o.setNumber.bind(o),o.scrollTo=o.scrollTo.bind(o),o.updateDialCode=o.updateDialCode.bind(o),o.notifyPhoneNumberChange=o.notifyPhoneNumberChange.bind(o),o.isValidNumber=o.isValidNumber.bind(o),o.isUnknownNanp=o.isUnknownNanp.bind(o),o.initRequests=o.initRequests.bind(o),o.updateFlagFromNumber=o.updateFlagFromNumber.bind(o),o.updatePlaceholder=o.updatePlaceholder.bind(o),o.loadAutoCountry=o.loadAutoCountry.bind(o),o.loadUtils=o.loadUtils.bind(o),o.processCountryData=o.processCountryData.bind(o),o.getNumber=o.getNumber.bind(o),o.setFlag=o.setFlag.bind(o),o.clickSelectedFlag=o.clickSelectedFlag.bind(o),o.updateValFromNumber=o.updateValFromNumber.bind(o),o.handleWindowScroll=o.handleWindowScroll.bind(o),o.handleDocumentKeyDown=o.handleDocumentKeyDown.bind(o),o.handleDocumentClick=o.handleDocumentClick.bind(o),o.bindDocumentClick=o.bindDocumentClick.bind(o),o.unbindDocumentClick=o.unbindDocumentClick.bind(o),o.searchForCountry=o.searchForCountry.bind(o),o.handleEnterKey=o.handleEnterKey.bind(o),o.toggleDropdown=o.toggleDropdown.bind(o),o.handleUpDownKey=o.handleUpDownKey.bind(o),o.handleInputChange=o.handleInputChange.bind(o),o.changeHighlightCountry=o.changeHighlightCountry.bind(o),o.formatNumber=o.formatNumber.bind(o),o.uniqueId=Math.random().toString(36).substring(2),o}return r(t,e),b(t,[{key:"componentDidMount",value:function(){var e=this;this.autoHideDialCode=this.props.autoHideDialCode,this.allowDropdown=this.props.allowDropdown,this.nationalMode=this.props.nationalMode,this.dropdownContainer="",this.nationalMode&&(this.autoHideDialCode=!1),this.props.separateDialCode&&(this.autoHideDialCode=!1,this.nationalMode=!1,this.allowDropdown=!0),this.processCountryData.call(this),this.tempCountry=this.getTempCountry(this.props.defaultCountry),"complete"===document.readyState?this.windowLoaded=!0:window.addEventListener("load",function(){e.windowLoaded=!0}),this.generateMarkup(),this.setInitialState(),this.initRequests(),this.deferreds.push(this.autoCountryDeferred.promise()),this.deferreds.push(this.utilsScriptDeferred.promise()),p.a.when(this.deferreds).done(function(){e.setInitialState()}),document.addEventListener("keydown",this.handleDocumentKeyDown)}},{key:"componentWillReceiveProps",value:function(e){this.props.value!==e.value&&this.setState({value:e.value}),this.props.disabled!==e.disabled&&this.setState({disabled:e.disabled}),"function"==typeof e.customPlaceholder&&this.props.customPlaceholder!==e.customPlaceholder&&this.updatePlaceholder(e)}},{key:"componentWillUpdate",value:function(e,t){t.showDropdown?(document.addEventListener("keydown",this.handleDocumentKeyDown),this.bindDocumentClick()):(document.removeEventListener("keydown",this.handleDocumentKeyDown),this.unbindDocumentClick())}},{key:"componentDidUpdate",value:function(e){this.props.value!==e.value&&this.updateFlagFromNumber(this.props.value)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleDocumentKeyDown),window.removeEventListener("scroll",this.handleWindowScroll),this.unbindDocumentClick()}},{key:"getTempCountry",value:function(e){if("auto"===e)return"auto";var t=M.a.getCountryData(this.countries,e);return t.iso2||(t=this.props.preferredCountries.length>0?M.a.getCountryData(this.countries,this.props.preferredCountries[0]):g.a.getCountries()[0]),t.iso2}},{key:"setNumber",value:function(e,t){this.updateFlagFromNumber(e),this.updateValFromNumber(e,!t)}},{key:"setFlag",value:function(e,t){var o=this,i=this.selectedCountryData&&this.selectedCountryData.iso2?this.selectedCountryData:{};this.selectedCountryData=e?M.a.getCountryData(this.countries,e,!1,!1,this.props.noCountryDataHandler):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2);var n=e?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown",r=this.state.dialCode;this.props.separateDialCode&&(r=this.selectedCountryData.dialCode?"+"+this.selectedCountryData.dialCode:"",i.dialCode&&delete this.wrapperClass["iti-sdc-"+(i.dialCode.length+1)],r&&(this.wrapperClass["iti-sdc-"+r.length]=!0));var a=0;e&&"auto"!==e&&(a=M.a.findIndex(this.preferredCountries,function(t){return t.iso2===e}),a===-1&&(a=M.a.findIndex(this.countries,function(t){return t.iso2===e}),a===-1&&(a=0),a+=this.preferredCountries.length)),this.tel&&this.state.showDropdown&&this.tel.focus();var l=this.updateDialCode(this.selectedCountryData.dialCode,!t);this.setState({value:l,showDropdown:!1,highlightedCountry:a,countryCode:e,title:n,dialCode:r},function(){if(o.updatePlaceholder(o.props),o.wrapperClass.active=!1,!t&&i.iso2!==e&&"function"==typeof o.props.onSelectFlag){var n=o.state.value;o.props.onSelectFlag(n,o.selectedCountryData)}})}},{key:"getExtension",value:function(e){return window.intlTelInputUtils?window.intlTelInputUtils.getExtension(this.getFullNumber(e),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(e,t){return window.intlTelInputUtils?window.intlTelInputUtils.formatNumber(this.getFullNumber(e),this.selectedCountryData.iso2,t):""}},{key:"getFullNumber",value:function(e){var t=this.props.separateDialCode?"+"+this.selectedCountryData.dialCode:"";return t+e}},{key:"getDialCode",value:function(e){var t="";if("+"===e.charAt(0))for(var o="",i=0,n=e.length;it?e.substr(0,t):e}},{key:"removeEmptyDialCode",value:function(){var e=this.state.value,t="+"===e.charAt(0);if(t){var o=M.a.getNumeric(e);o&&this.selectedCountryData.dialCode!==o||this.setState({value:""})}}},{key:"handleUpDownKey",value:function(e){var t=this.flagDropDown.querySelectorAll(".highlight")[0],o=t?t.previousElementSibling:void 0,i=t?t.nextElementSibling:void 0,n=e===this.keys.UP?o:i;if(n){n.getAttribute("class").indexOf("divider")>-1&&(n=e===this.keys.UP?n.previousElementSibling:n.nextElementSibling),this.scrollTo(n);var r=M.a.retrieveLiIndex(n);this.setState({showDropdown:!0,highlightedCountry:r})}}},{key:"handleEnterKey",value:function(){var e=this,t=this.flagDropDown.querySelectorAll(".highlight")[0];if(t){var o=M.a.retrieveLiIndex(t),i=t.getAttribute("data-country-code");this.setState({showDropdown:!1,highlightedCountry:o,countryCode:i},function(){e.setFlag(e.state.countryCode),e.unbindDocumentClick()})}}},{key:"searchForCountry",value:function(e){for(var t=0,o=this.countries.length;t2&&void 0!==arguments[2]&&arguments[2];if(t&&window.intlTelInputUtils&&this.selectedCountryData){var n=this.props.separateDialCode||!this.nationalMode&&"+"===e.charAt(0)?window.intlTelInputUtils.numberFormat.INTERNATIONAL:window.intlTelInputUtils.numberFormat.NATIONAL;e=window.intlTelInputUtils.formatNumber(e,this.selectedCountryData.iso2,n)}e=this.beforeSetNumber(e),this.setState({showDropdown:!1,value:e},function(){i&&o.notifyPhoneNumberChange(o.state.value),o.unbindDocumentClick()})}},{key:"updateFlagFromNumber",value:function(e,t){e&&this.nationalMode&&this.selectedCountryData&&"1"===this.selectedCountryData.dialCode&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1"+e),e="+"+e);var o=this.getDialCode(e),i=null;if(o){var n=this.countryCodes[M.a.getNumeric(o)],r=this.selectedCountryData&&n.indexOf(this.selectedCountryData.iso2)!==-1;if(!r||this.isUnknownNanp(e,o))for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:this.props;if(window.intlTelInputUtils&&e.autoPlaceholder&&this.selectedCountryData){var t=window.intlTelInputUtils.numberType[e.numberType],o=this.selectedCountryData.iso2?window.intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.nationalMode,t):"";o=this.beforeSetNumber(o,e),"function"==typeof e.customPlaceholder&&(o=e.customPlaceholder(o,this.selectedCountryData)),this.setState({placeholder:o})}}},{key:"toggleDropdown",value:function(e){var t=this;this.setState({showDropdown:!!e},function(){t.state.showDropdown||t.unbindDocumentClick()})}},{key:"scrollTo",value:function(e,t){try{var o=this.flagDropDown.querySelector(".country-list"),i=parseFloat(window.getComputedStyle(o).getPropertyValue("height"),10),n=M.a.offset(o).top,r=n+i,a=M.a.getOuterHeight(e),l=M.a.offset(e).top,s=l+a,d=i/2-a/2,u=l-n+o.scrollTop;if(lr){t&&(u+=d);var c=i-a;o.scrollTop=u-c}}catch(e){}}},{key:"updateDialCode",value:function(e,t){var o=this.state.value;if(!e)return o;var i=o;if(e="+"+e,"+"===o.charAt(0)){var n=this.getDialCode(o);i=n?o.replace(n,e):e}else this.nationalMode||this.props.separateDialCode||(o?i=e+o:!t&&this.autoHideDialCode||(i=e));return i!==o&&this.notifyPhoneNumberChange(i),i}},{key:"generateMarkup",value:function(){this.wrapperClass["allow-dropdown"]=this.allowDropdown,this.wrapperClass["separate-dial-code"]=this.props.separateDialCode,this.isMobile&&this.props.useMobileFullscreenDropdown&&(M.a.addClass(document.querySelector("body"),"iti-mobile"),this.dropdownContainer="body",window.addEventListener("scroll",this.handleWindowScroll))}},{key:"handleSelectedFlagKeydown",value:function(e){this.state.showDropdown||e.which!==this.keys.UP&&e.which!==this.keys.DOWN&&e.which!==this.keys.SPACE&&e.which!==this.keys.ENTER||(e.preventDefault(),e.stopPropagation(),this.toggleDropdown(!0)),e.which===this.keys.TAB&&this.toggleDropdown(!1)}},{key:"isValidNumber",value:function(e){var t=M.a.trim(e),o=this.nationalMode||this.props.separateDialCode?this.selectedCountryData.iso2:"";return!!window.intlTelInputUtils&&window.intlTelInputUtils.isValidNumber(t,o)}},{key:"formatFullNumber",value:function(e){return window.intlTelInputUtils?this.getNumber(e,window.intlTelInputUtils.numberFormat.INTERNATIONAL):e}},{key:"notifyPhoneNumberChange",value:function(e){if("function"==typeof this.props.onPhoneNumberChange){var t=this.formatFullNumber(e),o=this.isValidNumber(t);this.props.onPhoneNumberChange(o,e,this.selectedCountryData,t,this.getExtension(e))}}},{key:"beforeSetNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props;if(t.separateDialCode){var o=this.getDialCode(e);if(o){null!==this.selectedCountryData.areaCodes&&(o="+"+this.selectedCountryData.dialCode);var i=" "===e[o.length]||"-"===e[o.length]?o.length+1:o.length;e=e.substr(i)}}return this.cap(e)}},{key:"handleWindowScroll",value:function(){var e=this;this.setState({showDropdown:!1},function(){window.removeEventListener("scroll",e.handleWindowScroll)})}},{key:"handleDocumentKeyDown",value:function(e){var t=this,o=void 0;e.preventDefault(),e.which===this.keys.UP||e.which===this.keys.DOWN?this.handleUpDownKey(e.which):e.which===this.keys.ENTER?this.handleEnterKey():e.which===this.keys.ESC?this.setState({showDropdown:!1}):(e.which>=this.keys.A&&e.which<=this.keys.Z||e.which===this.keys.SPACE)&&(o&&clearTimeout(o),this.query||(this.query=""),this.query+=String.fromCharCode(e.which),this.searchForCountry(this.query),o=setTimeout(function(){t.query=""},1e3))}},{key:"handleDocumentClick",value:function(e){(null===e.target.getAttribute("class")||e.target.getAttribute("class")&&e.target.getAttribute("class").indexOf("country")===-1)&&(this.isOpening=!1),this.isOpening||this.toggleDropdown(!1),this.isOpening=!1}},{key:"handleInputChange",value:function(e){var t=this,o=this.props.format?this.formatNumber(e.target.value):e.target.value;void 0!==this.props.value?(this.updateFlagFromNumber(o),this.notifyPhoneNumberChange(o)):this.setState({value:o},function(){t.updateFlagFromNumber(o),t.notifyPhoneNumberChange(o)})}},{key:"changeHighlightCountry",value:function(e,t){this.setState({showDropdown:e,highlightedCountry:t})}},{key:"loadUtils",value:function(){var e=this;if(window.intlTelInputUtils)return void this.utilsScriptDeferred.resolve();var t=new XMLHttpRequest;t.open("GET",this.props.utilsScript,!0),t.onload=function(){if(t.status>=200&&t.status<400){var o=t.responseText;if(o&&!document.getElementById("intlTelInputUtils")){var i=document.getElementsByTagName("body")[0],n=document.createElement("script");n.id="intlTelInputUtils",n.text=o,i.appendChild(n)}e.utilsScriptDeferred.resolve()}},t.send()}},{key:"autoCountryLoaded",value:function(){"auto"===this.tempCountry&&(this.tempCountry=this.autoCountry,this.autoCountryDeferred.resolve())}},{key:"render",value:function(){this.wrapperClass[this.props.css[0]]=!0;var e=this.props.css[1],t=Object.assign({},this.props.style||{});this.wrapperClass.expanded=this.state.showDropdown;var o=u()(this.wrapperClass),i=this.selectedCountryData?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown",n=void 0!==this.props.value?this.props.value:this.state.value;return l.a.createElement("div",{className:o,style:t},l.a.createElement(m.a,{refCallback:this.setFlagDropdownRef,allowDropdown:this.allowDropdown,dropdownContainer:this.dropdownContainer,separateDialCode:this.props.separateDialCode,dialCode:this.state.dialCode,clickSelectedFlag:this.clickSelectedFlag,setFlag:this.setFlag,countryCode:this.state.countryCode,isMobile:this.isMobile,handleSelectedFlagKeydown:this.handleSelectedFlagKeydown,changeHighlightCountry:this.changeHighlightCountry,countries:this.countries,showDropdown:this.state.showDropdown,inputTop:this.state.offsetTop,inputOuterHeight:this.state.outerHeight,preferredCountries:this.preferredCountries,highlightedCountry:this.state.highlightedCountry,titleTip:i,flagDropdownProps:this.props.flagDropdownProps,uniqueId:this.uniqueId}),l.a.createElement(f.a,{refCallback:this.setTelRef,handleInputChange:this.handleInputChange,handleOnBlur:this.handleOnBlur,className:e,disabled:this.state.disabled,readonly:this.state.readonly,fieldName:this.props.fieldName,fieldId:this.props.fieldId,value:n,placeholder:void 0!==this.props.placeholder?this.props.placeholder:this.state.placeholder,autoFocus:this.props.autoFocus,autoComplete:this.props.autoComplete,inputProps:this.props.telInputProps}))}}]),t}(a.Component);y.defaultProps={css:["intl-tel-input",""],fieldName:"",fieldId:"",defaultValue:"",countriesData:null,allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:!0,customPlaceholder:null,excludeCountries:[],formatOnInit:!0,separateDialCode:!1,defaultCountry:"",geoIpLookup:null,nationalMode:!0,numberType:"MOBILE",noCountryDataHandler:null,onlyCountries:[],preferredCountries:["us","gb"],utilsScript:"",onPhoneNumberChange:null,onPhoneNumberBlur:null,onSelectFlag:null,disabled:!1,autoFocus:!1,useMobileFullscreenDropdown:!0,autoComplete:"off",telInputProps:{},flagDropdownProps:{},format:!1},t.default=y}])}); \ No newline at end of file diff --git a/src/components/CountryList.js b/src/components/CountryList.js index c0cab7d63..8d93f143b 100644 --- a/src/components/CountryList.js +++ b/src/components/CountryList.js @@ -66,6 +66,7 @@ class CountryList extends Component { }; const countryClass = classNames(countryClassObj); const keyPrefix = isPreferred ? 'pref-' : ''; + const isSelected = this.props.selectedCountryCode === country.iso2; return (
  • { this.selectedFlag = selectedFlag; } } @@ -125,6 +130,8 @@ class CountryList extends Component {
      { this.listElement = listElement; } } className={ className } + id={ this.props.countryListId } + role="listbox" > { preferredOptions } { divider } @@ -144,6 +151,9 @@ CountryList.propTypes = { changeHighlightCountry: PropTypes.func, showDropdown: PropTypes.bool, isMobile: PropTypes.bool, + selectedCountryCode: PropTypes.string.isRequired, + countryListId: PropTypes.string.isRequired, + getItemId: PropTypes.func.isRequired, }; export default CountryList; diff --git a/src/components/FlagDropDown.js b/src/components/FlagDropDown.js index 16ec53d83..ba738a004 100644 --- a/src/components/FlagDropDown.js +++ b/src/components/FlagDropDown.js @@ -5,6 +5,8 @@ import CountryList from './CountryList'; import RootModal from './RootModal'; class FlagDropDown extends Component { + getItemId = (id) => `intl-tel-item-${this.props.uniqueId}-${id}` + render() { const flagClassObj = { 'iti-flag': true, @@ -35,6 +37,8 @@ class FlagDropDown extends Component { let genCountryList = () => ''; + const countryListId = `intl-tel-countries-list-${this.props.uniqueId}`; + if (this.props.dropdownContainer) { if (this.props.showDropdown) { genCountryList = () => @@ -51,6 +55,9 @@ class FlagDropDown extends Component { preferredCountries={ this.props.preferredCountries } highlightedCountry={ this.props.highlightedCountry } changeHighlightCountry={ this.props.changeHighlightCountry } + selectedCountryCode={ this.props.countryCode } + countryListId={ countryListId } + getItemId={ this.getItemId } /> ; } @@ -68,6 +75,9 @@ class FlagDropDown extends Component { preferredCountries={ this.props.preferredCountries } highlightedCountry={ this.props.highlightedCountry } changeHighlightCountry={ this.props.changeHighlightCountry } + selectedCountryCode={ this.props.countryCode } + countryListId={ countryListId } + getItemId={ this.getItemId } />; } @@ -77,11 +87,17 @@ class FlagDropDown extends Component { className="flag-container" >
      { genSelectedDialCode() } @@ -112,6 +128,8 @@ FlagDropDown.propTypes = { changeHighlightCountry: PropTypes.func, titleTip: PropTypes.string, refCallback: PropTypes.func.isRequired, + uniqueId: PropTypes.string.isRequired, + flagDropdownProps: PropTypes.object, // eslint-disable-line react/forbid-prop-types }; export default FlagDropDown; diff --git a/src/components/IntlTelInputApp.js b/src/components/IntlTelInputApp.js index ad0e893f3..5b8781ffb 100644 --- a/src/components/IntlTelInputApp.js +++ b/src/components/IntlTelInputApp.js @@ -100,6 +100,8 @@ class IntlTelInputApp extends Component { this.handleInputChange = this.handleInputChange.bind(this); this.changeHighlightCountry = this.changeHighlightCountry.bind(this); this.formatNumber = this.formatNumber.bind(this); + // using a unique Id not to interfere with other instances of the tel input + this.uniqueId = Math.random().toString(36).substring(2); } componentDidMount() { @@ -1151,6 +1153,8 @@ class IntlTelInputApp extends Component { preferredCountries={ this.preferredCountries } highlightedCountry={ this.state.highlightedCountry } titleTip={ titleTip } + flagDropdownProps={ this.props.flagDropdownProps } + uniqueId={ this.uniqueId } />