react-int-phone-input-accessibility
Version:
Telephone input component. Rewrite intl-tel-input in React.js.
1 lines • 64.3 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom"),require("libphonenumber-js-utils")):"function"==typeof define&&define.amd?define(["react","react-dom","libphonenumber-js-utils"],t):"object"==typeof exports?exports.IntlTelInput=t(require("react"),require("react-dom"),require("libphonenumber-js-utils")):e.IntlTelInput=t(e.React,e.ReactDOM,e.intlTelInputUtils)}(function(){return"undefined"!=typeof window&&window?window:"undefined"!=typeof self&&self?self:this}(),function(n,o,r){return function(l){function e(e){for(var t,n,o=e[0],r=e[1],a=0,i=[];a<o.length;a++)n=o[a],u[n]&&i.push(u[n][0]),u[n]=0;for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&(l[t]=r[t]);for(s&&s(e);i.length;)i.shift()()}var n={},u={0:0};function r(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return l[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}r.m=l,r.c=n,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r.oe=function(e){throw console.error(e),e};var t=function(){return"undefined"!=typeof window&&window?window:"undefined"!=typeof self&&self?self:this}().webpackJsonpIntlTelInput=function(){return"undefined"!=typeof window&&window?window:"undefined"!=typeof self&&self?self:this}().webpackJsonpIntlTelInput||[],o=t.push.bind(t);t.push=e,t=t.slice();for(var a=0;a<t.length;a++)e(t[a]);var s=o;return r(r.s=5)}([function(e,t){e.exports=n},function(e,t,n){var o;!function(){"use strict";var i={}.hasOwnProperty;function l(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)&&n.length){var r=l.apply(null,n);r&&e.push(r)}else if("object"===o)for(var a in n)i.call(n,a)&&n[a]&&e.push(a)}}return e.join(" ")}e.exports?(l.default=l,e.exports=l):void 0===(o=function(){return l}.apply(t,[]))||(e.exports=o)}()},function(s,e,t){!function(e){var i={},t=Array.prototype,n=Object.prototype,l=n.hasOwnProperty,o=n.toString,u=t.forEach,r=t.indexOf,d=t.slice,f=function(e,t,n){var o,r,a;if(e)if(u&&e.forEach===u)e.forEach(t,n);else if(e.length===+e.length){for(r=0,a=e.length;r<a;r++)if(r in e&&t.call(n,e[r],r,e)===i)return}else for(o in e)if(l.call(e,o)&&t.call(n,e[o],o,e)===i)return},c=function(e){return!!(e&&e.constructor&&e.call&&e.apply)},m=function(n){return f(d.call(arguments,1),function(e){var t;for(t in e)void 0!==e[t]&&(n[t]=e[t])}),n},h=function(e,t,n){var o;if(t){if(r)return r.call(t,e,n);for(o=t.length,n=n?n<0?Math.max(0,o+n):n:0;n<o;n++)if(n in t&&t[n]===e)return n}return-1},a={};f("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){a["[object "+e+"]"]=e.toLowerCase()});var y=function(e){return null==e?String(e):a[o.call(e)]||"object"},p={},g={};p.Callbacks=function(o){var e,t;o="string"==typeof o?g[o]||(t=g[e=o]={},f(e.split(/\s+/),function(e){t[e]=!0}),t):m({},o);var n,r,a,i,l,u,s=[],d=!o.once&&[],c=function(e){for(n=o.memory&&e,r=!0,u=i||0,i=0,l=s.length,a=!0;s&&u<l;u++)if(!1===s[u].apply(e[0],e[1])&&o.stopOnFalse){n=!1;break}a=!1,s&&(d?d.length&&c(d.shift()):n?s=[]:p.disable())},p={add:function(){if(s){var e=s.length;!function n(e){f(e,function(e){var t=y(e);"function"===t?o.unique&&p.has(e)||s.push(e):e&&e.length&&"string"!==t&&n(e)})}(arguments),a?l=s.length:n&&(i=e,c(n))}return this},remove:function(){return s&&f(arguments,function(e){for(var t;-1<(t=h(e,s,t));)s.splice(t,1),a&&(t<=l&&l--,t<=u&&u--)}),this},has:function(e){return-1<h(e,s)},empty:function(){return s=[],this},disable:function(){return s=d=n=void 0,this},disabled:function(){return!s},lock:function(){return d=void 0,n||p.disable(),this},locked:function(){return!d},fireWith:function(e,t){return t=[e,(t=t||[]).slice?t.slice():t],!s||r&&!d||(a?d.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!r}};return p},p.Deferred=function(e){var i=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],r="pending",a={state:function(){return r},always:function(){return l.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(r){f(i,function(e,t){var n=e[0],o=a[t];l[e[1]](c(o)?function(){var e;try{e=o.apply(this,arguments)}catch(e){return void r.reject(e)}e&&c(e.promise)?e.promise().done(r.resolve).fail(r.reject).progress(r.notify):r["notify"!==n?"resolveWith":n+"With"](this===l?r:this,[e])}:r[n])}),a=null}).promise()},promise:function(e){return null!=e?m(e,a):a}},l={};return a.pipe=a.then,f(i,function(e,t){var n=e[2],o=e[3];a[e[1]]=n.add,o&&n.add(function(){r=o},i[1^t][2].disable,i[2][2].lock),l[e[0]]=n.fire,l[e[0]+"With"]=n.fireWith}),a.promise(l),e&&e.call(l,l),l},p.when=function(e){var r,t,n,o=0,a="array"===y(e)&&1===arguments.length?e:d.call(arguments),i=a.length,l=1!==i||e&&c(e.promise)?i:0,u=1===l?e:p.Deferred(),s=function(t,n,o){return function(e){n[t]=this,o[t]=1<arguments.length?d.call(arguments):e,o===r?u.notifyWith(n,o):--l||u.resolveWith(n,o)}};if(1<i)for(r=new Array(i),t=new Array(i),n=new Array(i);o<i;o++)a[o]&&c(a[o].promise)?a[o].promise().done(s(o,n,a)).fail(u.reject).progress(s(o,t,r)):--l;return l||u.resolveWith(n,a),u.promise()},s.exports?s.exports=p:void 0!==e._?e._.mixin(p):e._=p}(this)},function(e,t){e.exports=o},function(e,t,n){},function(e,t,r){"use strict";r.r(t);var n,a=r(0),f=r.n(a),o=r(1),s=r.n(o),i=r(2),l=r.n(i),u=[["Afghanistan (افغانستان)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (الجزائر)","dz","213"],["American Samoa","as","1684"],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1264"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1242"],["Bahrain (البحرين)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1246"],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1441"],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1284"],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1],["Cayman Islands","ky","1345"],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2],["Cocos (Keeling) Islands","cc","61",1],["Colombia","co","57"],["Comoros (جزر القمر)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1767"],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (مصر)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1473"],["Guadeloupe","gp","590",0],["Guam","gu","1671"],["Guatemala","gt","502"],["Guernsey","gg","44",1],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (ایران)","ir","98"],["Iraq (العراق)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2],["Israel (ישראל)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1876"],["Japan (日本)","jp","81"],["Jersey","je","44",3],["Jordan (الأردن)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (الكويت)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (لبنان)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (ليبيا)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["Macedonia (FYROM) (Македонија)","mk","389"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (موريتانيا)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1664"],["Morocco (المغرب)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["Northern Mariana Islands","mp","1670"],["Norway (Norge)","no","47",0],["Oman (عُمان)","om","968"],["Pakistan (پاکستان)","pk","92"],["Palau","pw","680"],["Palestine (فلسطين)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (قطر)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy (Saint-Barthélemy)","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (المملكة العربية السعودية)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1721"],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (جنوب السودان)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්රී ලංකාව)","lk","94"],["Sudan (السودان)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1],["Swaziland","sz","268"],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (سوريا)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia (تونس)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1649"],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1340"],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (الإمارات العربية المتحدة)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna","wf","681"],["Western Sahara (الصحراء الغربية)","eh","212",1],["Yemen (اليمن)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1]];function d(e){n=(e||u).map(function(e){return{name:e[0],iso2:e[1],dialCode:e[2],priority:e[3]||0,areaCodes:e[4]||null}})}var c={initialize:d,getCountries:function(){return n||d(),n}};function p(e){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var m={arraysEqual:function(e,t){if(e===t)return!0;if(null===e||null===t)return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0},shallowEquals:function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n]){if(!Array.isArray(e[n])||!Array.isArray(t[n]))return!1;if(!this.arraysEqual(e[n],t[n]))return!1}for(var o in t)if(!1===e.hasOwnProperty(o))return!1;return!0},trim:function(e){return e?e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""):""},isNumeric:function(e){return 0<=e-parseFloat(e)},retrieveLiIndex:function(e){if(!e)return-1;for(var t=e.parentNode.childNodes,n=0,o=0,r=t.length;o<r;o++){if(t[o]===e)return n;1===t[o].nodeType&&"li"===t[o].tagName.toLowerCase()&&(n+=1)}return-1},getNumeric:function(e){return e.replace(/\D/g,"")},startsWith:function(e,t){return e.substr(0,t.length).toUpperCase()===t},isWindow:function(e){return null!==e&&e===e.window},getWindow:function(e){return this.isWindow(e)?e:9===e.nodeType&&e.defaultView},offset:function(e){var t,n,o={top:0,left:0},r=e&&e.ownerDocument;return t=r.documentElement,"undefined"!==p(e.getBoundingClientRect)&&(o=e.getBoundingClientRect()),n=this.getWindow(r),{top:o.top+n.pageYOffset-t.clientTop,left:o.left+n.pageXOffset-t.clientLeft}},getOuterHeight:function(e){return e.offsetHeight+parseFloat(window.getComputedStyle(e).getPropertyValue("margin-top"))+parseFloat(window.getComputedStyle(e).getPropertyValue("margin-bottom"))},getCountryData:function(e,t,n,o,r){for(var a=n?c.getCountries():e,i=0;i<a.length;i++)if(a[i].iso2===t)return a[i];return o?null:("function"==typeof r&&r(t),{})},hasClass:function(e,t){return e.classList?e.classList.contains(t):!!e.className.match(new RegExp("(\\s|^)".concat(t,"(\\s|$)")))},addClass:function(e,t){e.classList?e.classList.add(t):this.hasClass(e,t)||(e.className+=" ".concat(t))},removeClass:function(e,t){if(e.classList)e.classList.remove(t);else if(this.hasClass(e,t)){var n=new RegExp("(\\s|^)".concat(t,"(\\s|$)"));e.className=e.className.replace(n," ")}},findIndex:function(e,n){var o=-1;return e.some(function(e,t){if(n(e))return o=t,!0}),o},getCursorPositionAfterFormating:function(e,t,n){if(t===n)return e.length;var o=0;if(t.length>n.length)for(var r=0,a=0;r<e.length&&a<n.length;r+=1)e[r]!==n[a]?isNaN(n[a])&&!isNaN(e[r])?(r-=1,a+=1,o+=1):o-=1:a+=1;else for(var i=0,l=0;i<e.length&&l<n.length;l+=1)e[i]!==n[l]?isNaN(e[i])&&!isNaN(n[l])?(l-=1,i+=1,o-=1):o+=1:i+=1;return e.length+o}};function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function y(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=function(e){function i(){var e,u,t,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a];return t=this,n=(e=g(i)).call.apply(e,[this].concat(r)),w(C(C(u=!n||"object"!==h(n)&&"function"!=typeof n?C(t):n)),"setDropdownPosition",function(){m.removeClass(u.listElement,"hide");var e=u.props.inputTop,t=void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop,n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,o=u.props.inputOuterHeight,r=m.getOuterHeight(u.listElement),a=!(e+o+r<t+n)&&t<e-r?"-".concat(r-1,"px"):"";u.listElement.style.top=a,u.listElement.setAttribute("class","country-list")}),w(C(C(u)),"setFlag",function(e){u.props.setFlag(e)}),w(C(C(u)),"appendListItem",function(e){var i=1<arguments.length&&void 0!==arguments[1]&&arguments[1],l=u.props.preferredCountries.length;return e.map(function(e,t){var n=i?t:t+l,o={country:!0,highlight:u.props.highlightedCountry===n,preferred:i},r=s()(o),a=i?"pref-":"";return f.a.createElement("li",{key:"".concat(a).concat(e.iso2),id:"flag-".concat(e.iso2),className:r,role:"option",tabIndex:-1,"aria-selected":"flag-".concat(u.props.countryCode)==="flag-".concat(e.iso2),"data-dial-code":e.dialCode,"data-country-code":e.iso2,onMouseOver:u.props.isMobile?null:u.handleMouseOver,onClick:function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return e.bind.apply(e,[e].concat(n))}(u.setFlag,e.iso2)},f.a.createElement("div",{ref:function(e){u.selectedFlag=e},className:"flag-box"},f.a.createElement("div",{ref:function(e){u.selectedFlagInner=e},className:"iti-flag ".concat(e.iso2)})),f.a.createElement("span",{className:"country-name"},e.name),f.a.createElement("span",{className:"dial-code"},"+",e.dialCode))})}),w(C(C(u)),"handleMouseOver",function(e){if(-1<e.currentTarget.getAttribute("class").indexOf("country")){var t=m.retrieveLiIndex(e.currentTarget);u.props.changeHighlightCountry(!0,t)}}),u}var t,n,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(i,a["Component"]),t=i,(n=[{key:"shouldComponentUpdate",value:function(e){var t=!m.shallowEquals(this.props,e);return t&&e.showDropdown&&(this.listElement.setAttribute("class","country-list v-hide"),this.setDropdownPosition()),t}},{key:"render",value:function(){var e,t=this,n=this.props.preferredCountries,o=null,r=this.props.countries,a=s()({"country-list":!0,hide:!this.props.showDropdown}),i=null;return n.length&&(o=this.appendListItem(n,!0),i=f.a.createElement("div",{className:"divider"})),e=this.appendListItem(r),f.a.createElement("ul",{ref:function(e){t.listElement=e},className:a,tabIndex:"-1",role:"listbox","aria-activedescendant":"flag-".concat(this.props.countryCode)},o,i,e)}}])&&y(t.prototype,n),o&&y(t,o),i}();v.__docgenInfo={description:"",methods:[{name:"setDropdownPosition",docblock:null,modifiers:[],params:[],returns:null},{name:"setFlag",docblock:null,modifiers:[],params:[{name:"iso2",type:null}],returns:null},{name:"appendListItem",docblock:null,modifiers:[],params:[{name:"countries",type:null},{name:"isPreferred",type:null}],returns:null},{name:"handleMouseOver",docblock:null,modifiers:[],params:[{name:"e",type:null}],returns:null}],displayName:"CountryList",props:{setFlag:{type:{name:"func"},required:!1,description:""},countries:{type:{name:"arrayOf",value:{name:"object"}},required:!1,description:""},inputTop:{type:{name:"number"},required:!1,description:""},inputOuterHeight:{type:{name:"number"},required:!1,description:""},preferredCountries:{type:{name:"arrayOf",value:{name:"object"}},required:!1,description:""},highlightedCountry:{type:{name:"number"},required:!1,description:""},changeHighlightCountry:{type:{name:"func"},required:!1,description:""},showDropdown:{type:{name:"bool"},required:!1,description:""},isMobile:{type:{name:"bool"},required:!1,description:""},countryCode:{type:{name:"string"},required:!1,description:""}}};var D=r(3),k=r.n(D);function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function N(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function P(e,t){return!t||"object"!==S(t)&&"function"!=typeof t?function(e){if(void 0!==e)return e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function F(e,t){return(F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var I=function(e){function n(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(t=P(this,O(n).call(this,e))).modalTarget=document.createElement("div"),t.modalTarget.className="intl-tel-input iti-container",t}var t,o,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&F(e,t)}(n,a["Component"]),t=n,(o=[{key:"componentDidMount",value:function(){document.body.appendChild(this.modalTarget)}},{key:"componentWillUnmount",value:function(){document.body.removeChild(this.modalTarget)}},{key:"render",value:function(){return k.a.createPortal(f.a.createElement(a.Fragment,null,this.props.children),this.modalTarget)}}])&&N(t.prototype,o),r&&N(t,r),n}();function T(e){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function q(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function A(e,t){return(A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function M(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}I.__docgenInfo={description:"",methods:[],displayName:"RootModal",props:{children:{type:{name:"node"},required:!1,description:""}}};var x=function(e){function i(){var e,p,t,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var o=arguments.length,r=new Array(o),a=0;a<o;a++)r[a]=arguments[a];return t=this,n=(e=E(i)).call.apply(e,[this].concat(r)),M(j(j(p=!n||"object"!==T(n)&&"function"!=typeof n?j(t):n)),"genSelectedDialCode",function(){var e=p.props,t=e.separateDialCode,n=e.dialCode;return t?f.a.createElement("div",{className:"selected-dial-code"},n):""}),M(j(j(p)),"genArrow",function(){var e=p.props,t=e.allowDropdown,n=e.showDropdown,o=s()({"iti-arrow":!0,up:n});return t?f.a.createElement("div",{className:o}):""}),M(j(j(p)),"genFlagClassName",function(){var e=p.props.countryCode,t={"iti-flag":!0};return e&&(t[e]=!0),s()(t)}),M(j(j(p)),"genCountryList",function(){var e=p.props,t=e.dropdownContainer,n=e.showDropdown,o=e.isMobile,r=e.allowDropdown,a=e.setFlag,i=e.countries,l=e.inputTop,u=e.inputOuterHeight,s=e.preferredCountries,d=e.highlightedCountry,c=e.changeHighlightCountry;return f.a.createElement(v,{ref:function(e){p.countryList=e},dropdownContainer:t,isMobile:o,showDropdown:r&&n,setFlag:a,countries:i,inputTop:l,inputOuterHeight:u,preferredCountries:s,highlightedCountry:d,countryCode:p.props.countryCode,changeHighlightCountry:c})}),p}var t,n,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(i,a["Component"]),t=i,(n=[{key:"render",value:function(){var e=this.props,t=e.refCallback,n=e.allowDropdown,o=e.clickSelectedFlag,r=e.handleSelectedFlagKeydown,a=e.titleTip,i=e.dropdownContainer,l=e.showDropdown;return f.a.createElement("div",{ref:t,className:"flag-container"},f.a.createElement("button",{type:"button",className:"selected-flag",tabIndex:n?"0":"","aria-haspopup":"listbox","aria-expanded":this.props.showDropdown,onClick:o,onKeyDown:r,title:a},f.a.createElement("div",{className:this.genFlagClassName()}),this.genSelectedDialCode(),this.genArrow()),i&&l?f.a.createElement(I,null,this.genCountryList()):this.genCountryList())}}])&&q(t.prototype,n),o&&q(t,o),i}();function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V(){return(V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function _(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function U(e){return(U=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function B(e,t){return(B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function H(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}x.__docgenInfo={description:"",methods:[{name:"genSelectedDialCode",docblock:null,modifiers:[],params:[],returns:null},{name:"genArrow",docblock:null,modifiers:[],params:[],returns:null},{name:"genFlagClassName",docblock:null,modifiers:[],params:[],returns:null},{name:"genCountryList",docblock:null,modifiers:[],params:[],returns:null}],displayName:"FlagDropDown",props:{allowDropdown:{type:{name:"bool"},required:!1,description:""},dropdownContainer:{type:{name:"string"},required:!1,description:""},separateDialCode:{type:{name:"bool"},required:!1,description:""},dialCode:{type:{name:"string"},required:!1,description:""},countryCode:{type:{name:"string"},required:!1,description:""},showDropdown:{type:{name:"bool"},required:!1,description:""},clickSelectedFlag:{type:{name:"func"},required:!1,description:""},handleSelectedFlagKeydown:{type:{name:"func"},required:!1,description:""},isMobile:{type:{name:"bool"},required:!1,description:""},setFlag:{type:{name:"func"},required:!1,description:""},countries:{type:{name:"arrayOf",value:{name:"object"}},required:!1,description:""},inputTop:{type:{name:"number"},required:!1,description:""},inputOuterHeight:{type:{name:"number"},required:!1,description:""},preferredCountries:{type:{name:"arrayOf",value:{name:"object"}},required:!1,description:""},highlightedCountry:{type:{name:"number"},required:!1,description:""},changeHighlightCountry:{type:{name:"func"},required:!1,description:""},titleTip:{type:{name:"string"},required:!1,description:""},refCallback:{type:{name:"func"},required:!0,description:""}}};var K=function(e){function l(){var e,t,n,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=this,o=(e=U(l)).call.apply(e,[this].concat(a)),R(H(H(t=!o||"object"!==L(o)&&"function"!=typeof o?H(n):o)),"state",{hasFocus:!1}),R(H(H(t)),"refHandler",function(e){t.tel=e,t.props.refCallback(e)}),R(H(H(t)),"handleBlur",function(e){t.setState({hasFocus:!1}),"function"==typeof t.props.handleOnBlur&&t.props.handleOnBlur(e)}),R(H(H(t)),"handleFocus",function(){t.setState({hasFocus:!0})}),R(H(H(t)),"handlePaste",function(e){"function"==typeof t.props.handlePaste&&t.props.handlePaste(e)}),t}var t,n,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&B(e,t)}(l,a["Component"]),t=l,(n=[{key:"componentDidUpdate",value:function(){this.state.hasFocus&&this.tel.setSelectionRange(this.props.cursorPosition,this.props.cursorPosition)}},{key:"render",value:function(){return f.a.createElement("input",V({},this.props.inputProps,{ref:this.refHandler,type:"tel",autoComplete:this.props.autoComplete,className:this.props.className,disabled:!!this.props.disabled&&"disabled",readOnly:!!this.props.readonly&&"readonly",name:this.props.fieldName,id:this.props.fieldId,value:this.props.value,placeholder:this.props.placeholder,onChange:this.props.handleInputChange,onPaste:this.handlePaste,onBlur:this.handleBlur,onFocus:this.handleFocus,autoFocus:this.props.autoFocus}))}}])&&_(t.prototype,n),o&&_(t,o),l}();K.__docgenInfo={description:"",methods:[{name:"refHandler",docblock:null,modifiers:[],params:[{name:"element",type:null}],returns:null},{name:"handleBlur",docblock:null,modifiers:[],params:[{name:"e",type:null}],returns:null},{name:"handleFocus",docblock:null,modifiers:[],params:[],returns:null},{name:"handlePaste",docblock:null,modifiers:[],params:[{name:"e",type:null}],returns:null}],displayName:"TelInput",props:{className:{type:{name:"string"},required:!1,description:""},disabled:{type:{name:"bool"},required:!1,description:""},readonly:{type:{name:"bool"},required:!1,description:""},fieldName:{type:{name:"string"},required:!1,description:""},fieldId:{type:{name:"string"},required:!1,description:""},value:{type:{name:"string"},required:!1,description:""},placeholder:{type:{name:"string"},required:!1,description:""},handleInputChange:{type:{name:"func"},required:!1,description:""},handlePaste:{type:{name:"func"},required:!1,description:""},handleOnBlur:{type:{name:"func"},required:!1,description:""},autoFocus:{type:{name:"bool"},required:!1,description:""},autoComplete:{type:{name:"string"},required:!1,description:""},inputProps:{type:{name:"object"},required:!1,description:""},refCallback:{type:{name:"func"},required:!0,description:""},cursorPosition:{type:{name:"number"},required:!1,description:""}}};r(4);function z(e){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function W(e){return(W=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function G(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function J(e,t,n){return t&&G(e.prototype,t),n&&G(e,n),e}function Y(e,t){return(Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Z(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Q=/Android.+Mobile|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i,X=function(e){function o(e){var p,t,n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=this,n=W(o).call(this,e),$(Z(Z(p=!n||"object"!==z(n)&&"function"!=typeof n?Z(t):n)),"getTempCountry",function(e){if("auto"===e)return"auto";var t=m.getCountryData(p.countries,e);return t.iso2||(t=0<p.props.preferredCountries.length?m.getCountryData(p.countries,p.props.preferredCountries[0]):c.getCountries()[0]),t.iso2}),$(Z(Z(p)),"setNumber",function(e,t){p.updateFlagFromNumber(e),p.updateValFromNumber(e,!t)}),$(Z(Z(p)),"setFlagDropdownRef",function(e){p.flagDropDown=e}),$(Z(Z(p)),"setTelRef",function(e){p.tel=e}),$(Z(Z(p)),"setFlag",function(o,r){var e=2<arguments.length&&void 0!==arguments[2]&&arguments[2],a=p.selectedCountryData&&p.selectedCountryData.iso2?p.selectedCountryData:{};p.selectedCountryData=o?m.getCountryData(p.countries,o,!1,!1,p.props.noCountryDataHandler):{},p.selectedCountryData.iso2&&(p.defaultCountry=p.selectedCountryData.iso2);var t=o?"".concat(p.selectedCountryData.name,": +").concat(p.selectedCountryData.dialCode):"Unknown",n=p.state.dialCode;p.props.separateDialCode&&(n=p.selectedCountryData.dialCode?"+".concat(p.selectedCountryData.dialCode):"",a.dialCode&&delete p.wrapperClass["iti-sdc-".concat(a.dialCode.length+1)],n&&(p.wrapperClass["iti-sdc-".concat(n.length)]=!0));var i=0;o&&"auto"!==o&&-1===(i=m.findIndex(p.preferredCountries,function(e){return e.iso2===o}))&&(-1===(i=m.findIndex(p.countries,function(e){return e.iso2===o}))&&(i=0),i+=p.preferredCountries.length),p.tel&&!e&&p.tel.focus();var l=p.updateDialCode(p.selectedCountryData.dialCode,!r);p.setState({value:l,showDropdown:!1,highlightedCountry:i,countryCode:o,title:t,dialCode:n},function(){if(p.updatePlaceholder(p.props),p.wrapperClass.active=!1,!r&&a.iso2!==o&&"function"==typeof p.props.onSelectFlag){var e=p.state.value,t=p.formatFullNumber(e),n=p.isValidNumber(t);p.props.onSelectFlag(e,p.selectedCountryData,t,n)}})}),$(Z(Z(p)),"getExtension",function(e){return window.intlTelInputUtils?window.intlTelInputUtils.getExtension(p.getFullNumber(e),p.selectedCountryData.iso2):""}),$(Z(Z(p)),"getNumber",function(e,t){return window.intlTelInputUtils?window.intlTelInputUtils.formatNumber(p.getFullNumber(e),p.selectedCountryData.iso2,t):""}),$(Z(Z(p)),"getFullNumber",function(e){return(p.props.separateDialCode?"+".concat(p.selectedCountryData.dialCode):"")+e}),$(Z(Z(p)),"getDialCode",function(e){var t="";if("+"===e.charAt(0))for(var n="",o=0,r=e.length;o<r;o++){var a=e.charAt(o);if(m.isNumeric(a)&&(n+=a,p.countryCodes[n]&&(t=e.substr(0,o+1)),4===n.length))break}return t}),$(Z(Z(p)),"isUnknownNanp",function(e,t){return"+1"===t&&4<=m.getNumeric(e).length}),$(Z(Z(p)),"addCountryCode",function(e,t,n,o){n in e||(e[n]=[]);var r=o||0;return e[n][r]=t,e}),$(Z(Z(p)),"processAllCountries",function(){p.props.onlyCountries.length?p.filterCountries(p.props.onlyCountries,function(e){return-1!==e}):p.props.excludeCountries.length?p.filterCountries(p.props.excludeCountries,function(e){return-1===e}):p.countries=c.getCountries()}),$(Z(Z(p)),"processCountryCodes",function(){p.countryCodes={};for(var e=0;e<p.countries.length;e++){var t=p.countries[e];if(p.addCountryCode(p.countryCodes,t.iso2,t.dialCode,t.priority),t.areaCodes)for(var n=0;n<t.areaCodes.length;n++)p.addCountryCode(p.countryCodes,t.iso2,t.dialCode+t.areaCodes[n])}}),$(Z(Z(p)),"processPreferredCountries",function(){p.preferredCountries=[];for(var e=0,t=p.props.preferredCountries.length;e<t;e++){var n=p.props.preferredCountries[e].toLowerCase(),o=m.getCountryData(p.countries,n,!0);o&&p.preferredCountries.push(o)}}),$(Z(Z(p)),"setInitialState",function(){var e=p.props.value||p.props.defaultValue||"";p.getDialCode(e)?p.updateFlagFromNumber(e,!0):"auto"!==p.tempCountry&&(p.tempCountry?p.setFlag(p.tempCountry,!0,!0):(p.defaultCountry=p.preferredCountries.length?p.preferredCountries[0].iso2:p.countries[0].iso2,e||p.setFlag(p.defaultCountry,!0,!0)),e||p.nationalMode||p.autoHideDialCode||p.props.separateDialCode||p.setState({value:"+".concat(p.selectedCountryData.dialCode)}));e&&p.updateValFromNumber(e,p.props.formatOnInit,!0)}),$(Z(Z(p)),"initRequests",function(){Promise.resolve().then(r.t.bind(null,6,7)).then(function(){p.loadUtils(),p.utilsScriptDeferred.resolve()}).catch(function(){return"An error occurred while loading the component"}),"auto"===p.tempCountry?p.loadAutoCountry():p.autoCountryDeferred.resolve()}),$(Z(Z(p)),"loadAutoCountry",function(){var e=void 0!==window.localStorage?window.localStorage.getItem("itiAutoCountry"):"";e&&(p.autoCountry=e),p.autoCountry?p.autoCountryLoaded():p.startedLoadingAutoCountry||(p.startedLoadingAutoCountry=!0,"function"==typeof p.props.geoIpLookup&&p.props.geoIpLookup(function(e){p.autoCountry=e.toLowerCase(),void 0!==window.localStorage&&window.localStorage.setItem("itiAutoCountry",p.autoCountry),p.autoCountryLoaded()}))}),$(Z(Z(p)),"cap",function(e){var t=p.tel?p.tel.getAttribute("maxlength"):e;return t&&e.length>t?e.substr(0,t):e}),$(Z(Z(p)),"removeEmptyDialCode",function(){var e=p.state.value;if("+"===e.charAt(0)){var t=m.getNumeric(e);t&&p.selectedCountryData.dialCode!==t||p.setState({value:""})}}),$(Z(Z(p)),"handleUpDownKey",function(e){var t=p.flagDropDown.querySelectorAll(".highlight")[0],n=t?t.previousElementSibling:void 0,o=t?t.nextElementSibling:void 0,r=e===p.keys.UP?n:o;if(r){-1<r.getAttribute("class").indexOf("divider")&&(r=e===p.keys.UP?r.previousElementSibling:r.nextElementSibling),p.scrollTo(r);var a=m.retrieveLiIndex(r);r.focus(),p.setState({showDropdown:!0,highlightedCountry:a})}}),$(Z(Z(p)),"handleEnterKey",function(){var e=p.flagDropDown.querySelectorAll(".highlight")[0];if(e){var t=m.retrieveLiIndex(e),n=e.getAttribute("data-country-code");p.setState({showDropdown:!1,highlightedCountry:t,countryCode:n},function(){p.setFlag(p.state.countryCode),p.unbindDocumentClick()})}}),$(Z(Z(p)),"searchForCountry",function(e){for(var t=0,n=p.countries.length;t<n;t++)if(m.startsWith(p.countries[t].name,e)){var o=p.flagDropDown.querySelector('.country-list [data-country-code="'.concat(p.countries[t].iso2,'"]:not(.preferred)')),r=m.retrieveLiIndex(o);p.setState({showDropdown:!0,highlightedCountry:r}),p.scrollTo(o,!0);break}}),$(Z(Z(p)),"formatNumber",function(e){if(window.intlTelInputUtils&&p.selectedCountryData){var t=window.intlTelInputUtils.numberFormat.INTERNATIONAL;(!p.props.separateDialCode&&p.nationalMode||"+"!==e.charAt(0))&&(t=window.intlTelInputUtils.numberFormat.NATIONAL),e=window.intlTelInputUtils.formatNumber(e,p.selectedCountryData.iso2,t)}return e}),$(Z(Z(p)),"updateValFromNumber",function(e,t){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];if(t&&window.intlTelInputUtils&&p.selectedCountryData){var o=p.props.separateDialCode||!p.nationalMode&&"+"===e.charAt(0)?window.intlTelInputUtils.numberFormat.INTERNATIONAL:window.intlTelInputUtils.numberFormat.NATIONAL;e=window.intlTelInputUtils.formatNumber(e,p.selectedCountryData.iso2,o)}e=p.beforeSetNumber(e),p.setState({showDropdown:!1,value:e},function(){n&&p.notifyPhoneNumberChange(p.state.value),p.unbindDocumentClick()})}),$(Z(Z(p)),"updateFlagFromNumber",function(e,t){e&&p.nationalMode&&p.selectedCountryData&&"1"===p.selectedCountryData.dialCode&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1".concat(e)),e="+".concat(e));var n=p.getDialCode(e),o=null;if(n){var r=p.countryCodes[m.getNumeric(n)];if(!(p.selectedCountryData&&-1!==r.indexOf(p.selectedCountryData.iso2))||p.isUnknownNanp(e,n))for(var a=0;a<r.length;a++)if(r[a]){o=r[a];break}}else"+"===e.charAt(0)&&m.getNumeric(e).length&&(o=null);null!==o&&p.setFlag(o,t)}),$(Z(Z(p)),"filterCountries",function(e,t){var n;for(n=0;n<e.length;n++)e[n]=e[n].toLowerCase();for(p.countries=[],n=0;n<c.getCountries().length;n++)t(e.indexOf(c.getCountries()[n].iso2))&&p.countries.push(c.getCountries()[n])}),$(Z(Z(p)),"processCountryData",function(){c.initialize(p.props.countriesData),p.processAllCountries.call(Z(Z(p))),p.processCountryCodes.call(Z(Z(p))),p.processPreferredCountries.call(Z(Z(p)))}),$(Z(Z(p)),"handleOnBlur",function(e){if(p.removeEmptyDialCode(),"function"==typeof p.props.onPhoneNumberBlur){var t=p.state.value,n=p.formatFullNumber(t),o=p.isValidNumber(n);p.props.onPhoneNumberBlur(o,t,p.selectedCountryData,n,p.getExtension(t),e)}}),$(Z(Z(p)),"bindDocumentClick",function(){p.isOpening=!0;var e=document.querySelector("html");e.addEventListener("mousedown",p.handleDocumentClick),e.style.position="fixed",e.style.overflow="hidden"}),$(Z(Z(p)),"unbindDocumentClick",function(){var e=document.querySelector("html");e.removeEventListener("mousedown",p.handleDocumentClick),e.style.position="static",e.style.overflow="auto"}),$(Z(Z(p)),"clickSelectedFlag",function(e){var t=p.props,n=t.allowDropdown,o=t.onFlagClick,r=p.state,a=r.showDropdown,i=r.disabled,l=r.readonly;a||i||l||!n?a&&p.toggleDropdown(!1):p.setState({showDropdown:!0,offsetTop:m.offset(p.tel).top,outerHeight:m.getOuterHeight(p.tel)},function(){var e=p.flagDropDown.querySelector(".highlight");e&&p.scrollTo(e,!0)}),"function"==typeof o&&o(e)}),$(Z(Z(p)),"updatePlaceholder",function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:p.props;if(window.intlTelInputUtils&&e.autoPlaceholder&&p.selectedCountryData){var t=window.intlTelInputUtils.numberType[e.numberType],n=p.selectedCountryData.iso2?window.intlTelInputUtils.getExampleNumber(p.selectedCountryData.iso2,p.nationalMode,t):"";n=p.beforeSetNumber(n,e),"function"==typeof e.customPlaceholder&&(n=e.customPlaceholder(n,p.selectedCountryData)),p.setState({placeholder:n})}}),$(Z(Z(p)),"toggleDropdown",function(e){p.setState({showDropdown:!!e},function(){p.state.showDropdown||p.unbindDocumentClick()})}),$(Z(Z(p)),"scrollTo",function(e,t){try{var n=p.flagDropDown.querySelector(".country-list"),o=parseFloat(window.getComputedStyle(n).getPropertyValue("height")),r=m.offset(n).top,a=r+o,i=m.getOuterHeight(e),l=m.offset(e).top,u=l+i,s=o/2-i/2,d=l-r+n.scrollTop;if(l<r)t&&(d-=s),n.scrollTop=d;else if(a<u){t&&(d+=s);var c=o-i;n.scrollTop=d-c}}catch(e){}}),$(Z(Z(p)),"updateDialCode",function(e,t){var n=p.state.value;if(!e)return n;var o=n;if(e="+".concat(e),"+"===n.charAt(0)){var r=p.getDialCode(n);o=r?n.replace(r,e):e}else p.nationalMode||p.props.separateDialCode||(n?o=e+n:!t&&p.autoHideDialCode||(o=e));return o!==n&&p.notifyPhoneNumberChange(o),o}),$(Z(Z(p)),"generateMarkup",function(){p.wrapperClass["separate-dial-code"]=p.props.separateDialCode,p.isMobile&&p.props.useMobileFullscreenDropdown&&(m.addClass(document.querySelector("body"),"iti-mobile"),p.dropdownContainer="body",window.addEventListener("scroll",p.handleWindowScroll))}),$(Z(Z(p)),"handleSelectedFlagKeydown",function(e){p.state.showDropdown||e.which!==p.keys.UP&&e.which!==p.keys.DOWN&&e.which!==p.keys.SPACE&&e.which!==p.keys.ENTER||(e.preventDefault(),e.stopPropagation(),p.toggleDropdown(!0)),e.which===p.keys.TAB&&p.toggleDropdown(!1)}),$(Z(Z(p)),"isValidNumber",function(e){var t=m.trim(e),n=p.nationalMode||p.props.separateDialCode?p.selectedCountryData.iso2:"";return!!window.intlTelInputUtils&&window.intlTelInputUtils.isValidNumber(t,n)}),$(Z(Z(p)),"formatFullNumber",function(e){return window.intlTelInputUtils?p.getNumber(e,window.intlTelInputUtils.numberFormat.INTERNATIONAL):e}),$(Z(Z(p)),"notifyPhoneNumberChange",function(e){if("function"==typeof p.props.onPhoneNumberChange){var t=p.formatFullNumber(e),n=p.isValidNumber(t);p.props.onPhoneNumberChange(n,e,p.selectedCountryData,t,p.getExtension(e))}}),$(Z(Z(p)),"beforeSetNumber",function(e){if((1<arguments.length&&void 0!==arguments[1]?arguments[1]:p.props).separateDialCode){var t=p.getDialCode(e);if(t){null!==p.selectedCountryData.areaCodes&&(t="+".concat(p.selectedCountryData.dialCode));var n=" "===e[t.length]||"-"===e[t.length]?t.length+1:t.length;e=e.substr(n)}}return p.cap(e)}),$(Z(Z(p)),"handleWindowScroll",function(){p.setState({showDropdown:!1},function(){window.removeEventListener("scroll",p.handleWindowScroll)})}),$(Z(Z(p)),"handleDocumentKeyDown",function(e){var t;e.preventDefault(),e.which===p.keys.UP||e.which===p.keys.DOWN?p.handleUpDownKey(e.which):e.which===p.keys.ENTER?p.handleEnterKey():e.which===p.keys.ESC?p.setState({showDropdown:!1}):(e.which>=p.keys.A&&e.which<=p.keys.Z||e.which===p.keys.SPACE)&&(t&&clearTimeout(t),p.query||(p.query=""),p.query+=String.fromCharCode(e.which),p.searchForCountry(p.query),t=setTimeout(function(){p.query=""},1e3))}),$(Z(Z(p)),"handleDocumentClick",function(e){var t=e.target.getAttribute("class");(null===t||t&&-1===t.indexOf("country")&&-1===t.indexOf("selected-flag")&&-1===t.indexOf("iti-flag")&&-1===t.indexOf("iti-arrow"))&&(p.isOpening=!1),p.isOpening||p.toggleDropdown(!1),p.isOpening=!1}),$(Z(Z(p)),"handleInputChange",function(e){var t=e.target.selectionStart,n=e.target.value,o=""===n?n:n.substring(0,t),r=p.props.format?p.formatNumber(e.target.value):e.target.value;t=m.getCursorPositionAfterFormating(o,n,r),void 0!==p.props.value?p.setState({cursorPosition:t},function(){p.updateFlagFromNumber(r),p.notifyPhoneNumberChange(r)}):p.setState({value:r,cursorPosition:t},function(){p.updateFlagFromNumber(r),p.notifyPhoneNumberChange(r)})}),$(Z(Z(p)),"handlePaste",function(e){e.clipboardData&&p.updateFlagFromNumber(e.clipboardData.getData("Text"),!1)}),$(Z(Z(p)),"changeHighlightCountry",function(e,t){p.setState({showDropdown:e,highlightedCountry:t})}),$(Z(Z(p)),"loadUtils",function(){window.intlTelInputUtils&&p.utilsScriptDeferred.resolve()}),$(Z(Z(p)),"autoCountryLoaded",function(){"auto"===p.tempCountry&&(p.tempCountry=p.autoCountry,p.autoCountryDeferred.resolve())}),p.wrapperClass={},p.autoCountry="",p.tempCountry="",p.startedLoadingAutoCountry=!1,p.deferreds=[],p.autoCountryDeferred=new l.a.Deferred,p.utilsScriptDeferred=new l.a.Deferred,p.isOpening=!1,p.isMobile="undefined"!=typeof navigator&&Q.test(navigator.userAgent),p.preferredCountries=[],p.countries=[],p.countryCodes={},p.windowLoaded=!1,p.keys={UP:38,DOWN:40,ENTER:13,ESC:27,PLUS:43,A:65,Z:90,SPACE:32,TAB:9},p.query="",p.selectedCountryData={},p.state={showDropdown:!1,highlightedCountry:0,value:e.value||e.defaultValue,disabled:e.disabled,readonly:!1,offsetTop:0,outerHeight:0,placeholder:"",title:"",countryCode:"us",dialCode:"",cursorPosition:(e.value||e.defaultValue).length},p}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Y(e,t)}(o,a["Component"]),J(o,null,[{key:"getDerivedStateFromProps",value:function(e,t){var n=null;return void 0!==e.value&&t.value!==e.value&&(n={value:e.value}),t.disabled!==e.disabled&&(n={disabled:e.disabled}),n}}]),J(o,[{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()),l.a.when(this.deferreds).done(function(){e.setInitialState()}),document.addEventListener("keydown",this.handleDocumentKeyDown)}},{key:"shouldComponentUpdate",value:function(e,t){return t.showDropdown?(document.addEventListener("keydown",this.handleDocumentKeyDown),this.bindDocumentClick()):(document.removeEventListener("keydown",this.handleDocumentKeyDown),this.unbindDocumentClick()),!0}},{key:"componentDidUpdate",value:function(e,t){if(this.props.value!==e.value&&this.updateFlagFromNumber(this.props.value),this.state.showDropdown!==t.showDropdown&&!0===this.state.showDropdown){var n=document.querySelector(".country-list > .highlight");n&&n.focus()}"function"==typeof this.props.customPlaceholder&&e.customPlaceholder!==this.props.customPlaceholder&&this.updatePlaceholder(this.props),this.props.allowDropd