react-international-phone
Advanced tools
Comparing version 2.3.1 to 2.3.2
@@ -1,1 +0,1 @@ | ||
!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a(require("react")):"function"==typeof define&&define.amd?define(["react"],a):"object"==typeof exports?exports["react-international-phone"]=a(require("react")):e["react-international-phone"]=a(e.react)}(this,(e=>(()=>{"use strict";var a={0:(e,a,t)=>{t.r(a)},374:(e,a,t)=>{t.r(a)},840:(e,a,t)=>{t.r(a)},481:(e,a,t)=>{t.r(a)},549:(e,a,t)=>{t.r(a)},153:function(e,a,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var n in a=arguments[t])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},r.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&n(a,e,t);return o(a,e),a},u=this&&this.__rest||function(e,a){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]])}return t};Object.defineProperty(a,"__esModule",{value:!0}),a.CountrySelector=void 0,t(0);var l=i(t(156)),c=t(946),s=t(515),d=t(332),f=t(425),p=t(60);a.CountrySelector=function(e){var a,t,n=e.selectedCountry,o=e.onSelect,i=e.disabled,v=e.hideDropdown,y=e.countries,m=void 0===y?c.defaultCountries:y,h=e.renderButtonWrapper,b=u(e,["selectedCountry","onSelect","disabled","hideDropdown","countries","renderButtonWrapper"]),C=(0,l.useState)(!1),g=C[0],P=C[1],_=(0,l.useMemo)((function(){if(n)return(0,d.getCountry)({value:n,field:"iso2",countries:m})}),[m,n]),w=(0,l.useRef)(null);return l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector"],rawClassNames:[b.className]}),style:b.style,ref:w},(a={title:null==_?void 0:_.name,onClick:function(){return P((function(e){return!e}))},onMouseDown:function(e){return e.preventDefault()},onKeyDown:function(e){e.key&&["ArrowUp","ArrowDown"].includes(e.key)&&(e.preventDefault(),P(!0))},disabled:v||i,role:"combobox","aria-label":"Country selector","aria-haspopup":"listbox","aria-expanded":g},t=l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector-button__button-content"],rawClassNames:[b.buttonContentWrapperClassName]}),style:b.buttonContentWrapperStyle},l.default.createElement(f.FlagEmoji,{iso2:n,className:(0,s.buildClassNames)({addPrefix:["country-selector-button__flag-emoji",i&&"country-selector-button__flag-emoji--disabled"],rawClassNames:[b.flagClassName]}),style:r({visibility:n?"visible":"hidden"},b.flagStyle)}),!v&&l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector-button__dropdown-arrow",i&&"country-selector-button__dropdown-arrow--disabled",g&&"country-selector-button__dropdown-arrow--active"],rawClassNames:[b.dropdownArrowClassName]}),style:b.dropdownArrowStyle})),h?h({children:t,rootProps:a}):l.default.createElement("button",r({},a,{type:"button",className:(0,s.buildClassNames)({addPrefix:["country-selector-button",g&&"country-selector-button--active",i&&"country-selector-button--disabled",v&&"country-selector-button--hide-dropdown"],rawClassNames:[b.buttonClassName]}),"data-country":n,style:b.buttonStyle}),t)),l.default.createElement(p.CountrySelectorDropdown,r({show:g,countries:m,onSelect:function(e){P(!1),null==o||o(e)},selectedCountry:n,onClose:function(){P(!1)}},b.dropdownStyleProps)))}},60:function(e,a,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var n in a=arguments[t])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},r.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&n(a,e,t);return o(a,e),a},u=this&&this.__rest||function(e,a){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]])}return t};Object.defineProperty(a,"__esModule",{value:!0}),a.CountrySelectorDropdown=void 0,t(374);var l=i(t(156)),c=t(946),s=t(515),d=t(332),f=t(425);a.CountrySelectorDropdown=function(e){var a=e.show,t=e.dialCodePrefix,n=void 0===t?"+":t,o=e.selectedCountry,i=e.countries,p=void 0===i?c.defaultCountries:i,v=e.onSelect,y=e.onClose,m=u(e,["show","dialCodePrefix","selectedCountry","countries","onSelect","onClose"]),h=(0,l.useRef)(null),b=(0,l.useRef)(),C=(0,l.useRef)({updatedAt:void 0,value:""}),g=(0,l.useCallback)((function(e){return p.findIndex((function(a){return(0,d.parseCountry)(a).iso2===e}))}),[p]),P=(0,l.useState)(g(o)),_=P[0],w=P[1],O=function(){b.current!==o&&w(g(o))},D=(0,l.useCallback)((function(e){w(g(e.iso2)),null==v||v(e)}),[v,g]),j=function(e){var a=p.length-1;w((function(t){var r,n=(r=t,"prev"===e?r-1:"next"===e?r+1:"last"===e?a:0);return n<0?0:n>a?a:n}))},M=(0,l.useCallback)((function(){if(h.current&&void 0!==_){var e=(0,d.parseCountry)(p[_]).iso2;if(e!==b.current){var a=h.current.querySelector('[data-country="'.concat(e,'"]'));a&&((0,d.scrollToChild)(h.current,a),b.current=e)}}}),[_,p]);return(0,l.useEffect)((function(){M()}),[_,M]),(0,l.useEffect)((function(){h.current&&(a?h.current.focus():O())}),[a]),(0,l.useEffect)((function(){O()}),[o]),l.default.createElement("ul",{ref:h,role:"listbox",className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown"],rawClassNames:[m.className]}),style:r({display:a?"block":"none"},m.style),onKeyDown:function(e){if(e.stopPropagation(),"Enter"!==e.key)if("Escape"!==e.key){if("ArrowUp"===e.key)return e.preventDefault(),void j("prev");if("ArrowDown"===e.key)return e.preventDefault(),void j("next");if("PageUp"===e.key)return e.preventDefault(),void j("first");if("PageDown"===e.key)return e.preventDefault(),void j("last");" "===e.key&&e.preventDefault(),1!==e.key.length||e.altKey||e.ctrlKey||e.metaKey||function(e){var a=C.current.updatedAt&&(new Date).getTime()-C.current.updatedAt.getTime()>1e3;C.current={value:a?e:"".concat(C.current.value).concat(e),updatedAt:new Date};var t=p.findIndex((function(e){return(0,d.parseCountry)(e).name.toLowerCase().startsWith(C.current.value)}));-1!==t&&w(t)}(e.key.toLocaleLowerCase())}else null==y||y();else{var a=(0,d.parseCountry)(p[_]);D(a)}},onBlur:y,tabIndex:-1,"aria-activedescendant":"".concat((0,d.parseCountry)(p[_]).iso2,"-option")},p.map((function(e,a){var t=(0,d.parseCountry)(e),r=t.iso2===o,i=a===_;return l.default.createElement("li",{key:t.iso2,"data-country":t.iso2,role:"option","aria-selected":r,"aria-label":"".concat(t.name," ").concat(n).concat(t.dialCode),id:"".concat(t.iso2,"-option"),className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item",r&&"country-selector-dropdown__list-item--selected",i&&"country-selector-dropdown__list-item--focused"],rawClassNames:[m.listItemClassName]}),onClick:function(){return D(t)},style:m.listItemStyle},l.default.createElement(f.FlagEmoji,{iso2:t.iso2,className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-flag-emoji"],rawClassNames:[m.listItemFlagClassName]}),style:m.listItemFlagStyle}),l.default.createElement("span",{className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-country-name"],rawClassNames:[m.listItemCountryNameClassName]}),style:m.listItemCountryNameStyle},t.name),l.default.createElement("span",{className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-dial-code"],rawClassNames:[m.listItemDialCodeClassName]}),style:m.listItemDialCodeStyle},n,t.dialCode))})))}},7:function(e,a,t){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.DialCodePreview=void 0,t(840);var n=r(t(156)),o=t(515);a.DialCodePreview=function(e){var a=e.dialCode,t=e.prefix,r=e.disabled,i=e.style,u=e.className;return n.default.createElement("div",{className:(0,o.buildClassNames)({addPrefix:["dial-code-preview",r&&"dial-code-preview--disabled"],rawClassNames:[u]}),style:i},"".concat(t).concat(a))}},425:function(e,a,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var n in a=arguments[t])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},r.apply(this,arguments)},n=this&&this.__rest||function(e,a){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]])}return t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.FlagEmoji=void 0,t(481);var i=o(t(156)),u=t(515),l="abcdefghijklmnopqrstuvwxyz".split("").reduce((function(e,a,t){var n,o,i;return r(r({},e),((n={})[a]=(o=t,i=parseInt("1f1e6",16),Number(i+o).toString(16)),n))}),{});a.FlagEmoji=function(e){var a=e.iso2,t=e.size,o=void 0===t?"24px":t,c=e.protocol,s=void 0===c?"https":c,d=e.disableLazyLoading,f=e.className,p=n(e,["iso2","size","protocol","disableLazyLoading","className"]);if(!a)return i.default.createElement("img",r({width:o,height:o},p));var v=function(e){return[l[e[0]],l[e[1]]].join("-")}(a),y="".concat(s,"://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/").concat(v,".svg");return i.default.createElement("img",r({className:(0,u.buildClassNames)({addPrefix:["flag-emoji"],rawClassNames:[f]}),src:y,width:o,height:o,draggable:!1,"data-country":a,loading:d?void 0:"lazy"},p))}},28:function(e,a,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var n in a=arguments[t])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},r.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&n(a,e,t);return o(a,e),a},u=this&&this.__rest||function(e,a){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]])}return t};Object.defineProperty(a,"__esModule",{value:!0}),a.PhoneInput=void 0,t(549);var l=i(t(156)),c=t(946),s=t(882),d=t(515),f=t(332),p=t(153),v=t(7);a.PhoneInput=function(e){var a,t=e.hideDropdown,n=e.placeholder,o=e.disabled,i=e.showDisabledDialCodeAndPrefix,y=e.inputProps,m=e.onChange,h=e.style,b=e.className,C=e.inputStyle,g=e.inputClassName,P=e.countrySelectorStyleProps,_=e.dialCodePreviewStyleProps,w=e.value,O=e.countries,D=void 0===O?c.defaultCountries:O,j=u(e,["hideDropdown","placeholder","disabled","showDisabledDialCodeAndPrefix","inputProps","onChange","style","className","inputStyle","inputClassName","countrySelectorStyleProps","dialCodePreviewStyleProps","value","countries"]),M=(0,s.usePhoneInput)(r(r({value:w,countries:D},j),{onChange:function(e){null==m||m(e.phone,e.country)}})),S=M.phone,x=M.inputRef,N=M.country,k=M.setCountry,A=M.handlePhoneValueChange,E=(0,l.useMemo)((function(){if(N)return(0,f.getCountry)({value:N,field:"iso2",countries:D})}),[D,N]),I=j.disableDialCodeAndPrefix&&i&&(null==E?void 0:E.dialCode);return l.default.createElement("div",{className:(0,d.buildClassNames)({addPrefix:["input-container"],rawClassNames:[b]}),style:h},l.default.createElement(p.CountrySelector,r({onSelect:function(e){return k(e.iso2)},selectedCountry:N,countries:D,disabled:o,hideDropdown:t},P)),I&&l.default.createElement(v.DialCodePreview,r({dialCode:E.dialCode,prefix:null!==(a=j.prefix)&&void 0!==a?a:"+",disabled:o},_)),l.default.createElement("input",r({onChange:A,value:S,type:"tel",ref:x,className:(0,d.buildClassNames)({addPrefix:["input",o&&"input--disabled"],rawClassNames:[g]}),placeholder:n,disabled:o,style:C},y)))}},946:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.defaultCountries=void 0,a.defaultCountries=[["Afghanistan",["asia"],"af","93"],["Albania",["europe"],"al","355"],["Algeria",["africa","north-africa"],"dz","213"],["Andorra",["europe"],"ad","376"],["Angola",["africa"],"ao","244"],["Antigua and Barbuda",["america","carribean"],"ag","1268"],["Argentina",["america","south-america"],"ar","54","(..) ........",0,["11","221","223","261","264","2652","280","2905","291","2920","2966","299","341","342","343","351","376","379","381","3833","385","387","388"]],["Armenia",["asia","ex-ussr"],"am","374",".. ......"],["Aruba",["america","carribean"],"aw","297"],["Australia",["oceania"],"au","61",". .... ....",0,["2","3","4","7","8"]],["Austria",["europe","eu-union"],"at","43"],["Azerbaijan",["asia","ex-ussr"],"az","994","(..) ... .. .."],["Bahamas",["america","carribean"],"bs","1242"],["Bahrain",["middle-east"],"bh","973"],["Bangladesh",["asia"],"bd","880"],["Barbados",["america","carribean"],"bb","1246"],["Belarus",["europe","ex-ussr"],"by","375","(..) ... .. .."],["Belgium",["europe","eu-union"],"be","32","... .. .. .."],["Belize",["america","central-america"],"bz","501"],["Benin",["africa"],"bj","229"],["Bhutan",["asia"],"bt","975"],["Bolivia",["america","south-america"],"bo","591"],["Bosnia and Herzegovina",["europe","ex-yugos"],"ba","387"],["Botswana",["africa"],"bw","267"],["Brazil",["america","south-america"],"br","55","(..) ........."],["British Indian Ocean Territory",["asia"],"io","246"],["Brunei",["asia"],"bn","673"],["Bulgaria",["europe","eu-union"],"bg","359"],["Burkina Faso",["africa"],"bf","226"],["Burundi",["africa"],"bi","257"],["Cambodia",["asia"],"kh","855"],["Cameroon",["africa"],"cm","237"],["Canada",["america","north-america"],"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",["africa"],"cv","238"],["Caribbean Netherlands",["america","carribean"],"bq","599","",1],["Central African Republic",["africa"],"cf","236"],["Chad",["africa"],"td","235"],["Chile",["america","south-america"],"cl","56"],["China",["asia"],"cn","86","... .... ...."],["Colombia",["america","south-america"],"co","57","... ... ...."],["Comoros",["africa"],"km","269"],["Congo",["africa"],"cd","243"],["Congo",["africa"],"cg","242"],["Costa Rica",["america","central-america"],"cr","506","....-...."],["Côte d'Ivoire",["africa"],"ci","225",".. .. .. .."],["Croatia",["europe","eu-union","ex-yugos"],"hr","385"],["Cuba",["america","carribean"],"cu","53"],["Curaçao",["america","carribean"],"cw","599","",0],["Cyprus",["europe","eu-union"],"cy","357",".. ......"],["Czech Republic",["europe","eu-union"],"cz","420","... ... ..."],["Denmark",["europe","eu-union","baltic"],"dk","45",".. .. .. .."],["Djibouti",["africa"],"dj","253"],["Dominica",["america","carribean"],"dm","1767"],["Dominican Republic",["america","carribean"],"do","1","",2],["Ecuador",["america","south-america"],"ec","593"],["Egypt",["africa","north-africa"],"eg","20"],["El Salvador",["america","central-america"],"sv","503","....-...."],["Equatorial Guinea",["africa"],"gq","240"],["Eritrea",["africa"],"er","291"],["Estonia",["europe","eu-union","ex-ussr","baltic"],"ee","372",".... ......"],["Ethiopia",["africa"],"et","251"],["Fiji",["oceania"],"fj","679"],["Finland",["europe","eu-union","baltic"],"fi","358",".. ... .. .."],["France",["europe","eu-union"],"fr","33",". .. .. .. .."],["French Guiana",["america","south-america"],"gf","594"],["French Polynesia",["oceania"],"pf","689"],["Gabon",["africa"],"ga","241"],["Gambia",["africa"],"gm","220"],["Georgia",["asia","ex-ussr"],"ge","995"],["Germany",["europe","eu-union","baltic"],"de","49",".... ........"],["Ghana",["africa"],"gh","233"],["Greece",["europe","eu-union"],"gr","30"],["Grenada",["america","carribean"],"gd","1473"],["Guadeloupe",["america","carribean"],"gp","590","",0],["Guam",["oceania"],"gu","1671"],["Guatemala",["america","central-america"],"gt","502","....-...."],["Guinea",["africa"],"gn","224"],["Guinea-Bissau",["africa"],"gw","245"],["Guyana",["america","south-america"],"gy","592"],["Haiti",["america","carribean"],"ht","509","....-...."],["Honduras",["america","central-america"],"hn","504"],["Hong Kong",["asia"],"hk","852",".... ...."],["Hungary",["europe","eu-union"],"hu","36"],["Iceland",["europe"],"is","354","... ...."],["India",["asia"],"in","91",".....-....."],["Indonesia",["asia"],"id","62"],["Iran",["middle-east"],"ir","98","... ... ...."],["Iraq",["middle-east"],"iq","964"],["Ireland",["europe","eu-union"],"ie","353",".. ......."],["Israel",["middle-east"],"il","972","... ... ...."],["Italy",["europe","eu-union"],"it","39","... .......",0],["Jamaica",["america","carribean"],"jm","1876"],["Japan",["asia"],"jp","81",".. .... ...."],["Jordan",["middle-east"],"jo","962"],["Kazakhstan",["asia","ex-ussr"],"kz","7","... ...-..-..",0,["310","311","312","313","315","318","321","324","325","326","327","336","7172","73622"]],["Kenya",["africa"],"ke","254"],["Kiribati",["oceania"],"ki","686"],["Kosovo",["europe","ex-yugos"],"xk","383"],["Kuwait",["middle-east"],"kw","965"],["Kyrgyzstan",["asia","ex-ussr"],"kg","996","... ... ..."],["Laos",["asia"],"la","856"],["Latvia",["europe","eu-union","ex-ussr","baltic"],"lv","371",".. ... ..."],["Lebanon",["middle-east"],"lb","961"],["Lesotho",["africa"],"ls","266"],["Liberia",["africa"],"lr","231"],["Libya",["africa","north-africa"],"ly","218"],["Liechtenstein",["europe"],"li","423"],["Lithuania",["europe","eu-union","ex-ussr","baltic"],"lt","370"],["Luxembourg",["europe","eu-union"],"lu","352"],["Macau",["asia"],"mo","853"],["Macedonia",["europe","ex-yugos"],"mk","389"],["Madagascar",["africa"],"mg","261"],["Malawi",["africa"],"mw","265"],["Malaysia",["asia"],"my","60","..-....-...."],["Maldives",["asia"],"mv","960"],["Mali",["africa"],"ml","223"],["Malta",["europe","eu-union"],"mt","356"],["Marshall Islands",["oceania"],"mh","692"],["Martinique",["america","carribean"],"mq","596"],["Mauritania",["africa"],"mr","222"],["Mauritius",["africa"],"mu","230"],["Mexico",["america","central-america"],"mx","52","... ... ....",0,["33","55","81","229","656","664","774","998"]],["Micronesia",["oceania"],"fm","691"],["Moldova",["europe"],"md","373","(..) ..-..-.."],["Monaco",["europe"],"mc","377"],["Mongolia",["asia"],"mn","976"],["Montenegro",["europe","ex-yugos"],"me","382"],["Morocco",["africa","north-africa"],"ma","212"],["Mozambique",["africa"],"mz","258"],["Myanmar",["asia"],"mm","95"],["Namibia",["africa"],"na","264"],["Nauru",["africa"],"nr","674"],["Nepal",["asia"],"np","977"],["Netherlands",["europe","eu-union"],"nl","31",".. ........"],["New Caledonia",["oceania"],"nc","687"],["New Zealand",["oceania"],"nz","64","...-...-...."],["Nicaragua",["america","central-america"],"ni","505"],["Niger",["africa"],"ne","227"],["Nigeria",["africa"],"ng","234"],["North Korea",["asia"],"kp","850"],["Norway",["europe","baltic"],"no","47","... .. ..."],["Oman",["middle-east"],"om","968"],["Pakistan",["asia"],"pk","92","...-......."],["Palau",["oceania"],"pw","680"],["Palestine",["middle-east"],"ps","970"],["Panama",["america","central-america"],"pa","507"],["Papua New Guinea",["oceania"],"pg","675"],["Paraguay",["america","south-america"],"py","595"],["Peru",["america","south-america"],"pe","51"],["Philippines",["asia"],"ph","63",".... ......."],["Poland",["europe","eu-union","baltic"],"pl","48","...-...-..."],["Portugal",["europe","eu-union"],"pt","351"],["Puerto Rico",["america","carribean"],"pr","1","",3],["Qatar",["middle-east"],"qa","974"],["Réunion",["africa"],"re","262"],["Romania",["europe","eu-union"],"ro","40"],["Russia",["europe","asia","ex-ussr","baltic"],"ru","7","(...) ...-..-..",1],["Rwanda",["africa"],"rw","250"],["Saint Kitts and Nevis",["america","carribean"],"kn","1869"],["Saint Lucia",["america","carribean"],"lc","1758"],["Saint Vincent and the Grenadines",["america","carribean"],"vc","1784"],["Samoa",["oceania"],"ws","685"],["San Marino",["europe"],"sm","378"],["São Tomé and Príncipe",["africa"],"st","239"],["Saudi Arabia",["middle-east"],"sa","966"],["Senegal",["africa"],"sn","221"],["Serbia",["europe","ex-yugos"],"rs","381"],["Seychelles",["africa"],"sc","248"],["Sierra Leone",["africa"],"sl","232"],["Singapore",["asia"],"sg","65","....-...."],["Slovakia",["europe","eu-union"],"sk","421"],["Slovenia",["europe","eu-union","ex-yugos"],"si","386"],["Solomon Islands",["oceania"],"sb","677"],["Somalia",["africa"],"so","252"],["South Africa",["africa"],"za","27"],["South Korea",["asia"],"kr","82","... .... ...."],["South Sudan",["africa","north-africa"],"ss","211"],["Spain",["europe","eu-union"],"es","34","... ... ..."],["Sri Lanka",["asia"],"lk","94"],["Sudan",["africa"],"sd","249"],["Suriname",["america","south-america"],"sr","597"],["Swaziland",["africa"],"sz","268"],["Sweden",["europe","eu-union","baltic"],"se","46","(...) ...-..."],["Switzerland",["europe"],"ch","41",".. ... .. .."],["Syria",["middle-east"],"sy","963"],["Taiwan",["asia"],"tw","886"],["Tajikistan",["asia","ex-ussr"],"tj","992"],["Tanzania",["africa"],"tz","255"],["Thailand",["asia"],"th","66"],["Timor-Leste",["asia"],"tl","670"],["Togo",["africa"],"tg","228"],["Tonga",["oceania"],"to","676"],["Trinidad and Tobago",["america","carribean"],"tt","1868"],["Tunisia",["africa","north-africa"],"tn","216"],["Turkey",["europe"],"tr","90","... ... .. .."],["Turkmenistan",["asia","ex-ussr"],"tm","993"],["Tuvalu",["asia"],"tv","688"],["Uganda",["africa"],"ug","256"],["Ukraine",["europe","ex-ussr"],"ua","380","(..) ... .. .."],["United Arab Emirates",["middle-east"],"ae","971"],["United Kingdom",["europe","eu-union"],"gb","44",".... ......"],["United States",["america","north-america"],"us","1","(...) ...-....",0,["201","202","203","205","206","207","208","209","210","212","213","214","215","216","217","218","219","224","225","228","229","231","234","239","240","248","251","252","253","254","256","260","262","267","269","270","276","281","301","302","303","304","305","307","308","309","310","312","313","314","315","316","317","318","319","320","321","323","325","330","334","336","337","339","347","351","352","360","361","386","401","402","404","405","406","407","408","409","410","412","413","414","415","417","419","423","424","425","430","432","434","435","440","443","447","469","478","479","480","484","501","502","503","504","505","507","508","509","510","512","513","515","516","517","518","520","530","540","541","551","559","561","562","563","567","570","571","573","574","575","580","585","586","601","602","603","605","606","607","608","609","610","612","614","615","616","617","618","619","620","623","626","630","631","636","641","646","650","651","660","661","662","678","681","682","689","701","702","703","704","706","707","708","712","713","714","715","716","717","718","719","720","724","727","731","732","734","740","754","757","760","762","763","765","769","770","772","773","774","775","779","781","785","786","801","802","803","804","805","806","808","810","812","813","814","815","816","817","818","828","830","831","832","843","845","847","848","850","856","857","858","859","860","862","863","864","865","870","878","901","903","904","906","907","908","909","910","912","913","914","915","916","917","918","919","920","925","928","931","936","937","940","941","947","949","951","952","954","956","970","971","972","973","978","979","980","985","989"]],["Uruguay",["america","south-america"],"uy","598"],["Uzbekistan",["asia","ex-ussr"],"uz","998",".. ... .. .."],["Vanuatu",["oceania"],"vu","678"],["Vatican City",["europe"],"va","39",".. .... ....",1],["Venezuela",["america","south-america"],"ve","58"],["Vietnam",["asia"],"vn","84"],["Yemen",["middle-east"],"ye","967"],["Zambia",["africa"],"zm","260"],["Zimbabwe",["africa"],"zw","263"]]},11:function(e,a,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var n in a=arguments[t])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},r.apply(this,arguments)},n=this&&this.__spreadArray||function(e,a,t){if(t||2===arguments.length)for(var r,n=0,o=a.length;n<o;n++)!r&&n in a||(r||(r=Array.prototype.slice.call(a,0,n)),r[n]=a[n]);return e.concat(r||Array.prototype.slice.call(a))};Object.defineProperty(a,"__esModule",{value:!0}),a.useHistoryState=void 0;var o=t(156),i=t(795),u={size:20,overrideLastItemDebounceMS:-1};a.useHistoryState=function(e,a){var t=r(r({},u),a),l=t.size,c=t.overrideLastItemDebounceMS,s=t.onChange,d=(0,o.useState)(e),f=d[0],p=d[1],v=(0,o.useState)([f]),y=v[0],m=v[1],h=(0,o.useState)(0),b=h[0],C=h[1],g=(0,i.useTimer)();return[f,function(e,a){if(("object"!=typeof e||Object.entries(e).toString()!==Object.entries(f).toString())&&e!==f){var t=c>0,r=g.check(),o=!t||void 0===r||r>c;if(void 0!==(null==a?void 0:a.overrideLastItem)?a.overrideLastItem:!o)m((function(a){return n(n([],a.slice(0,b),!0),[e],!1)}));else{var i=y.length>=l;m((function(a){return n(n([],a.slice(i?1:0,b+1),!0),[e],!1)})),i||C((function(e){return e+1}))}p(e),null==s||s(e)}},function(){if(b<=0)return{success:!1};var e=y[b-1];return p(e),C((function(e){return e-1})),null==s||s(e),{success:!0,value:e}},function(){if(b+1>=y.length)return{success:!1};var e=y[b+1];return p(e),C((function(e){return e+1})),null==s||s(e),{success:!0,value:e}}]}},882:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.usePhoneInput=a.defaultConfig=a.MASK_CHAR=void 0;var r=t(156),n=t(946),o=t(332),i=t(11);a.MASK_CHAR=".",a.defaultConfig={defaultCountry:"us",value:"",prefix:"+",defaultMask:"............",charAfterDialCode:" ",historySaveDebounceMS:200,disableCountryGuess:!1,disableDialCodePrefill:!1,forceDialCode:!1,disableDialCodeAndPrefix:!1,countries:n.defaultCountries},a.usePhoneInput=function(e){var t=e.defaultCountry,n=void 0===t?a.defaultConfig.defaultCountry:t,u=e.value,l=void 0===u?a.defaultConfig.value:u,c=e.countries,s=void 0===c?a.defaultConfig.countries:c,d=e.prefix,f=void 0===d?a.defaultConfig.prefix:d,p=e.defaultMask,v=void 0===p?a.defaultConfig.defaultMask:p,y=e.charAfterDialCode,m=void 0===y?a.defaultConfig.charAfterDialCode:y,h=e.historySaveDebounceMS,b=void 0===h?a.defaultConfig.historySaveDebounceMS:h,C=e.disableCountryGuess,g=void 0===C?a.defaultConfig.disableCountryGuess:C,P=e.disableDialCodePrefill,_=void 0===P?a.defaultConfig.disableDialCodePrefill:P,w=e.forceDialCode,O=void 0===w?a.defaultConfig.forceDialCode:w,D=e.disableDialCodeAndPrefix,j=void 0===D?a.defaultConfig.disableDialCodeAndPrefix:D,M=e.onChange,S=!j&&!g,x=(0,r.useRef)(null),N=function(e){var t,r=e.value,n=e.country,i=e.trimNonDigitsEnd,u=e.insertDialCodeOnEmpty,l=!e.forceDisableCountryGuess&&S?(0,o.guessCountryByPartialNumber)({phone:r,countries:s,currentCountryIso2:n.iso2}):void 0,c=null!==(t=null==l?void 0:l.country)&&void 0!==t?t:n;return{phone:c?(0,o.formatPhone)(r,{prefix:f,mask:c.format||v,maskChar:a.MASK_CHAR,dialCode:c.dialCode,trimNonDigitsEnd:i,charAfterDialCode:m,forceDialCode:O,insertDialCodeOnEmpty:u,disableDialCodeAndPrefix:j}):r,countryGuessResult:l,formatCountry:c}},k=function(e){Promise.resolve().then((function(){var a;null===(a=x.current)||void 0===a||a.setSelectionRange(e,e)}))},A=(0,i.useHistoryState)((function(){var e=(0,o.guessCountryByPartialNumber)({phone:l,countries:s,currentCountryIso2:n}).country||(0,o.getCountry)({value:n,field:"iso2",countries:s});e||console.error('[react-international-phone]: can not find a country with "'.concat(n,'" iso2 code'));var a=e||(0,o.parseCountry)(s.find((function(e){return"us"===(0,o.parseCountry)(e).iso2}))),t=N({value:l,country:a,insertDialCodeOnEmpty:!_}).phone;return k(t.length),{phone:t,country:a.iso2}}),{overrideLastItemDebounceMS:b,onChange:M}),E=A[0],I=E.phone,B=E.country,L=A[1],z=A[2],R=A[3],T=(0,r.useMemo)((function(){return(0,o.getCountry)({value:B,field:"iso2",countries:s})}),[s,B]),G=function(e,a){var t,r,n=void 0===a?{}:a,i=n.deletion,u=n.cursorPosition,l=n.insertDialCodeOnEmpty,c=n.inserted,s=e,d=u;O&&!j&&T&&!(0,o.removeNonDigits)(e).startsWith(T.dialCode)&&e&&(c&&e.startsWith(f)&&e.length-(null!=u?u:0)==0?s=e:(s=I,d=0));var p=N({value:s,country:T,trimNonDigitsEnd:"backward"===i,insertDialCodeOnEmpty:l,forceDisableCountryGuess:O&&!!i&&(0,o.removeNonDigits)(s).length<T.dialCode.length}),v=p.phone,y=p.countryGuessResult,h=T;S&&(null==y?void 0:y.country)&&y.country.name!==B&&y.fullDialCodeMatch&&(h=y.country);var b=(0,o.getCursorPosition)({cursorPositionAfterInput:null!=d?d:0,phoneBeforeInput:I,phoneAfterInput:e,phoneAfterFormatted:v,leftOffset:O?f.length+(null!==(r=null===(t=null==T?void 0:T.dialCode)||void 0===t?void 0:t.length)&&void 0!==r?r:0)+m.length:0,deletion:i});return L({phone:v,country:h.iso2}),k(b),v};(0,r.useEffect)((function(){var e=x.current;if(e){var a=function(e){if(e.key){var a=e.ctrlKey,t=e.shiftKey,r="z"===e.key.toLowerCase();a&&r&&(t?R():z())}};return e.addEventListener("keydown",a),function(){e.removeEventListener("keydown",a)}}}),[x,z,R]);var K=(0,r.useState)(!1),F=K[0],W=K[1];return(0,r.useEffect)((function(){if(!F)return W(!0),void(l!==I&&(null==M||M({phone:I,country:B})));l!==I&&G(l)}),[l]),{phone:I,country:B,setCountry:function(e){var a=(0,o.getCountry)({value:e,field:"iso2",countries:s});if(a){var t=j?"":"".concat(f).concat(a.dialCode).concat(m);L({phone:t,country:a.iso2}),Promise.resolve().then((function(){var e;null===(e=x.current)||void 0===e||e.focus()}))}},handlePhoneValueChange:function(e){var a;e.preventDefault();var t=e.nativeEvent.inputType,r=null==t?void 0:t.startsWith("insertFrom"),n=G(e.target.value,{deletion:function(){var e;if(null!==(e=null==t?void 0:t.toLocaleLowerCase().includes("delete"))&&void 0!==e&&e)return(null==t?void 0:t.toLocaleLowerCase().includes("forward"))?"forward":"backward"}(),inserted:r,cursorPosition:null!==(a=e.target.selectionStart)&&void 0!==a?a:0});return j&&T?(0,o.addDialCode)({phone:n,dialCode:T.dialCode,charAfterDialCode:m,prefix:f}):n},inputRef:x}}},393:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.usePhoneValidation=void 0;var r=t(332);a.usePhoneValidation=function(e,a){return(0,r.validatePhone)(e,a)}},795:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.useTimer=void 0;var r=t(156);a.useTimer=function(){var e=(0,r.useRef)(),a=(0,r.useRef)(Date.now());return{check:function(){var t=Date.now(),r=e.current?t-a.current:void 0;return e.current=a.current,a.current=t,r}}}},515:function(e,a){var t=this&&this.__spreadArray||function(e,a,t){if(t||2===arguments.length)for(var r,n=0,o=a.length;n<o;n++)!r&&n in a||(r||(r=Array.prototype.slice.call(a,0,n)),r[n]=a[n]);return e.concat(r||Array.prototype.slice.call(a))};Object.defineProperty(a,"__esModule",{value:!0}),a.buildClassNames=a.classNamesWithPrefix=a.joinClasses=a.classPrefix=void 0,a.classPrefix="react-international-phone-",a.joinClasses=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return e.filter((function(e){return!!e})).join(" ").trim()},a.classNamesWithPrefix=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a.joinClasses.apply(void 0,e).split(" ").map((function(e){return"".concat(a.classPrefix).concat(e)})).join(" ")},a.buildClassNames=function(e){var r=e.addPrefix,n=e.rawClassNames;return a.joinClasses.apply(void 0,t([a.classNamesWithPrefix.apply(void 0,r)],n,!1))}},62:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.applyMask=void 0,a.applyMask=function(e){var a=e.value,t=e.mask,r=e.maskSymbol,n=e.offset,o=void 0===n?0:n,i=e.trimNonMaskCharsLeftover,u=void 0!==i&&i;if(a.length<o)return a;for(var l=a.slice(0,o),c=a.slice(o),s=l,d=0,f=0,p=t.split("");f<p.length;f++){var v=p[f];if(d>=c.length){if(!u&&v!==r){s+=v;continue}break}v===r?(s+=c[d],d+=1):s+=v}return s}},239:function(e,a,t){var r=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),n=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||r(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),n(t(62),a),n(t(939),a),n(t(222),a)},939:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeNonDigits=void 0,a.removeNonDigits=function(e){return e.replace(/\D/g,"")}},222:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.scrollToChild=void 0,a.scrollToChild=function(e,a){var t=e.style.display;"block"!==t&&(e.style.display="block");var r=e.getBoundingClientRect(),n=a.getBoundingClientRect(),o=n.top-r.top,i=r.bottom-n.bottom;o>=0&&i>=0||(Math.abs(o)<Math.abs(i)?e.scrollTop+=o:e.scrollTop-=i),e.style.display=t}},298:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.buildCountryData=void 0,a.buildCountryData=function(e){for(var a=[e.name,e.regions,e.iso2,e.dialCode,e.format,e.priority,e.areaCodes],t=0;t<a.length;t+=1)if(0!==t){var r=a[t-1],n=a[t];if(void 0===r&&void 0!==n){var o=JSON.stringify(a,(function(e,a){return void 0===a?"__undefined":a})).replace(/"__undefined"/g,"undefined");throw new Error("[react-international-phone] invalid country values passed to buildCountryData. Check ".concat(r," in: ").concat(o))}}return a.filter((function(e){return void 0!==e}))}},891:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getCountry=void 0;var r=t(300);a.getCountry=function(e){var a=e.value,t=e.field,n=e.countries;if(["regions","priority"].includes(t))throw new Error(function(e){return'Field "'.concat(e,'" is not supported')}(t));var o=n.find((function(e){var n=(0,r.parseCountry)(e);return a===n[t]}));if(o)return(0,r.parseCountry)(o)}},4:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.guessCountryByPartialNumber=void 0;var r=t(239),n=t(891),o=t(300);a.guessCountryByPartialNumber=function(e){var a,t=e.phone,i=e.countries,u=e.currentCountryIso2,l={country:void 0,fullDialCodeMatch:!1,areaCodeMatch:void 0};if(!t)return l;var c=(0,r.removeNonDigits)(t);if(!c)return l;for(var s=l,d=function(e){var a,t,r,n,o=e.country,i=e.fullDialCodeMatch,u=e.areaCodeMatch,l=o.dialCode===(null===(a=s.country)||void 0===a?void 0:a.dialCode),c=(null!==(t=o.priority)&&void 0!==t?t:0)<(null!==(n=null===(r=s.country)||void 0===r?void 0:r.priority)&&void 0!==n?n:0);l&&!c||(s={country:o,fullDialCodeMatch:i,areaCodeMatch:u})},f=0,p=i;f<p.length;f++){var v=p[f],y=(0,o.parseCountry)(v),m=y.dialCode,h=y.areaCodes;if(c.startsWith(m)){var b=!s.country||Number(m)>=Number(s.country.dialCode);if(h)for(var C=c.substring(m.length),g=0,P=h;g<P.length;g++){var _=P[g];if(C.startsWith(_))return{country:y,fullDialCodeMatch:!0,areaCodeMatch:!0}}!b&&m!==c&&s.fullDialCodeMatch||d({country:y,fullDialCodeMatch:!0,areaCodeMatch:h?!h:void 0})}s.fullDialCodeMatch||c.length<m.length&&m.startsWith(c)&&(!s.country||Number(m)<=Number(s.country.dialCode))&&d({country:y,fullDialCodeMatch:!1})}if(u){var w=(0,n.getCountry)({value:u,field:"iso2",countries:i});s&&w&&(null===(a=s.country)||void 0===a?void 0:a.dialCode)===w.dialCode&&s.country!==w&&s.fullDialCodeMatch&&!s.areaCodeMatch&&(s={country:w,areaCodeMatch:!(null==w?void 0:w.areaCodes)&&void 0,fullDialCodeMatch:!0})}return s}},88:function(e,a,t){var r=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),n=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||r(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),n(t(298),a),n(t(891),a),n(t(4),a),n(t(300),a)},300:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.parseCountry=void 0,a.parseCountry=function(e){return{name:e[0],regions:e[1],iso2:e[2],dialCode:e[3],format:e[4],priority:e[5],areaCodes:e[6]}}},332:function(e,a,t){var r=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),n=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||r(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),n(t(239),a),n(t(88),a),n(t(165),a)},820:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDialCode=void 0;var r=t(214);a.addDialCode=function(e){var a=e.phone,t=e.dialCode,n=e.prefix,o=void 0===n?"+":n,i=e.charAfterDialCode,u=void 0===i?" ":i;return"".concat(o).concat(t).concat(u).concat((0,r.removeDialCode)({phone:a,dialCode:t,charAfterDialCode:u,prefix:o}))}},380:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.formatPhone=void 0;var r=t(239);a.formatPhone=function(e,a){var t=!a.disableDialCodeAndPrefix&&a.forceDialCode,n=!a.disableDialCodeAndPrefix&&a.insertDialCodeOnEmpty,o=e,i=function(e){return a.trimNonDigitsEnd?e.trim():e};if(!o)return n&&!o.length||t?i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode)):i(o);if((o=(0,r.removeNonDigits)(o))===a.dialCode&&!a.disableDialCodeAndPrefix)return i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode));if(a.dialCode.startsWith(o)&&!a.disableDialCodeAndPrefix)return i(t?"".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode):"".concat(a.prefix).concat(o));if(!o.startsWith(a.dialCode)&&!a.disableDialCodeAndPrefix){if(t)return i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode));if(o.length<a.dialCode.length)return i("".concat(a.prefix).concat(o))}var u,l=(u=a.dialCode.length,a.disableDialCodeAndPrefix&&(u=0),{phoneLeftSide:o.slice(0,u),phoneRightSide:o.slice(u)}),c=l.phoneLeftSide,s=l.phoneRightSide;return c="".concat(a.prefix).concat(c).concat(a.charAfterDialCode),s=(0,r.applyMask)({value:s,mask:a.mask,maskSymbol:a.maskChar,trimNonMaskCharsLeftover:a.trimNonDigitsEnd}),a.disableDialCodeAndPrefix&&(c=""),i("".concat(c).concat(s))}},775:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getCursorPosition=void 0;var t=function(e){return/\d/.test(e)};a.getCursorPosition=function(e){var a=e.phoneBeforeInput,r=e.phoneAfterInput,n=e.phoneAfterFormatted,o=e.cursorPositionAfterInput,i=e.leftOffset,u=void 0===i?0:i,l=e.deletion;if(o<u)return u;if(!a)return n.length;var c="backward"===l;if(0===o&&r.length>0&&n.length>0){if(c)return 0;for(var s=0;s<n.length;s+=1)if(t(n[s]))return s;return n.length}if(r.length<a.length&&1===r.length)return n.length;var d=null;for(s=o-1;s>=0;s-=1)if(t(r[s])){d=s;break}if(null===d)return 0!==o?o:n.length;var f=0;for(s=0;s<d;s+=1)t(r[s])&&(f+=1);c&&(f-=1);var p=0,v=0;for(s=0;s<n.length&&(p+=1,t(n[s])&&(v+=1),v!==f+1);s+=1);for(;!t(n[p])&&p<n.length;)p+=1;return c&&(p+=1),p}},165:function(e,a,t){var r=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),n=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||r(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),n(t(820),a),n(t(380),a),n(t(775),a),n(t(214),a),n(t(684),a)},214:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeDialCode=void 0,a.removeDialCode=function(e){var a=e.phone,t=e.dialCode,r=e.prefix,n=void 0===r?"+":r,o=e.charAfterDialCode,i=void 0===o?" ":o;if(!a||!t)return a;var u=a;return u.startsWith(n)&&(u=u.replace(n,"")),u.startsWith(t)?((u=u.replace(t,"")).startsWith(i)&&(u=u.replace(i,"")),u):a}},684:function(e,a,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var n in a=arguments[t])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},r.apply(this,arguments)};Object.defineProperty(a,"__esModule",{value:!0}),a.validatePhone=void 0;var n=t(882),o=t(239),i=t(88);a.validatePhone=function(e,a){var t,u=r(r({},n.defaultConfig),a),l=u.countries,c=u.defaultMask,s=u.defaultMaskMinPhoneLength,d=void 0===s?10:s,f=u.prefix,p=u.charAfterDialCode,v=(null==a?void 0:a.country)?(0,i.getCountry)({value:a.country,field:"iso2",countries:l}):null,y=(0,i.guessCountryByPartialNumber)({phone:e,countries:l,currentCountryIso2:null==a?void 0:a.country}),m=(null===(t=y.country)||void 0===t?void 0:t.iso2)===(null==v?void 0:v.iso2),h=!v||m?y:{country:v,fullDialCodeMatch:!1,areaCodeMatch:!(null==v?void 0:v.areaCodes)&&void 0},b=h.country,C=h.fullDialCodeMatch,g=h.areaCodeMatch;if(!b)return{country:b,lengthMatch:!1,dialCodeMatch:C,areaCodeMatch:g,formatMatch:!1,isValid:!1};var P=b.format||c,_=!b.format,w=_?d-b.dialCode.length:P.length-P.replaceAll(n.MASK_CHAR,"").length,O=_?P.slice(0,w):P,D="".concat(f).concat(b.dialCode).concat(p).concat(O).split("").every((function(a,t){var r=e[t]===a,o=a===n.MASK_CHAR&&Number.isFinite(+e[t]);return r||o})),j=(0,o.removeNonDigits)(e),M=b.dialCode.length+w;return j.length<M?{country:b,lengthMatch:!1,dialCodeMatch:C,areaCodeMatch:g,formatMatch:D,isValid:!1}:{country:b,lengthMatch:!0,dialCodeMatch:C,areaCodeMatch:g,formatMatch:D,isValid:j.startsWith(b.dialCode)}}},156:a=>{a.exports=e}},t={};function r(e){var n=t[e];if(void 0!==n)return n.exports;var o=t[e]={exports:{}};return a[e].call(o.exports,o,o.exports,r),o.exports}r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.validatePhone=e.parseCountry=e.buildCountryData=e.usePhoneValidation=e.usePhoneInput=e.defaultCountries=e.PhoneInput=e.FlagEmoji=e.DialCodePreview=e.CountrySelectorDropdown=e.CountrySelector=void 0;var a=r(153);Object.defineProperty(e,"CountrySelector",{enumerable:!0,get:function(){return a.CountrySelector}});var t=r(60);Object.defineProperty(e,"CountrySelectorDropdown",{enumerable:!0,get:function(){return t.CountrySelectorDropdown}});var o=r(7);Object.defineProperty(e,"DialCodePreview",{enumerable:!0,get:function(){return o.DialCodePreview}});var i=r(425);Object.defineProperty(e,"FlagEmoji",{enumerable:!0,get:function(){return i.FlagEmoji}});var u=r(28);Object.defineProperty(e,"PhoneInput",{enumerable:!0,get:function(){return u.PhoneInput}});var l=r(946);Object.defineProperty(e,"defaultCountries",{enumerable:!0,get:function(){return l.defaultCountries}});var c=r(882);Object.defineProperty(e,"usePhoneInput",{enumerable:!0,get:function(){return c.usePhoneInput}});var s=r(393);Object.defineProperty(e,"usePhoneValidation",{enumerable:!0,get:function(){return s.usePhoneValidation}});var d=r(332);Object.defineProperty(e,"buildCountryData",{enumerable:!0,get:function(){return d.buildCountryData}}),Object.defineProperty(e,"parseCountry",{enumerable:!0,get:function(){return d.parseCountry}}),Object.defineProperty(e,"validatePhone",{enumerable:!0,get:function(){return d.validatePhone}})})(),n})())); | ||
!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a(require("react")):"function"==typeof define&&define.amd?define(["react"],a):"object"==typeof exports?exports["react-international-phone"]=a(require("react")):e["react-international-phone"]=a(e.react)}(this,(e=>(()=>{"use strict";var a={0:(e,a,t)=>{t.r(a)},374:(e,a,t)=>{t.r(a)},840:(e,a,t)=>{t.r(a)},481:(e,a,t)=>{t.r(a)},549:(e,a,t)=>{t.r(a)},153:function(e,a,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var n in a=arguments[t])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},r.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&n(a,e,t);return o(a,e),a},u=this&&this.__rest||function(e,a){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]])}return t};Object.defineProperty(a,"__esModule",{value:!0}),a.CountrySelector=void 0,t(0);var l=i(t(156)),c=t(946),s=t(515),d=t(332),f=t(425),p=t(60);a.CountrySelector=function(e){var a,t,n=e.selectedCountry,o=e.onSelect,i=e.disabled,v=e.hideDropdown,y=e.countries,m=void 0===y?c.defaultCountries:y,h=e.renderButtonWrapper,b=u(e,["selectedCountry","onSelect","disabled","hideDropdown","countries","renderButtonWrapper"]),C=(0,l.useState)(!1),g=C[0],P=C[1],_=(0,l.useMemo)((function(){if(n)return(0,d.getCountry)({value:n,field:"iso2",countries:m})}),[m,n]),w=(0,l.useRef)(null);return l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector"],rawClassNames:[b.className]}),style:b.style,ref:w},(a={title:null==_?void 0:_.name,onClick:function(){return P((function(e){return!e}))},onMouseDown:function(e){return e.preventDefault()},onKeyDown:function(e){e.key&&["ArrowUp","ArrowDown"].includes(e.key)&&(e.preventDefault(),P(!0))},disabled:v||i,role:"combobox","aria-label":"Country selector","aria-haspopup":"listbox","aria-expanded":g},t=l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector-button__button-content"],rawClassNames:[b.buttonContentWrapperClassName]}),style:b.buttonContentWrapperStyle},l.default.createElement(f.FlagEmoji,{iso2:n,className:(0,s.buildClassNames)({addPrefix:["country-selector-button__flag-emoji",i&&"country-selector-button__flag-emoji--disabled"],rawClassNames:[b.flagClassName]}),style:r({visibility:n?"visible":"hidden"},b.flagStyle)}),!v&&l.default.createElement("div",{className:(0,s.buildClassNames)({addPrefix:["country-selector-button__dropdown-arrow",i&&"country-selector-button__dropdown-arrow--disabled",g&&"country-selector-button__dropdown-arrow--active"],rawClassNames:[b.dropdownArrowClassName]}),style:b.dropdownArrowStyle})),h?h({children:t,rootProps:a}):l.default.createElement("button",r({},a,{type:"button",className:(0,s.buildClassNames)({addPrefix:["country-selector-button",g&&"country-selector-button--active",i&&"country-selector-button--disabled",v&&"country-selector-button--hide-dropdown"],rawClassNames:[b.buttonClassName]}),"data-country":n,style:b.buttonStyle}),t)),l.default.createElement(p.CountrySelectorDropdown,r({show:g,countries:m,onSelect:function(e){P(!1),null==o||o(e)},selectedCountry:n,onClose:function(){P(!1)}},b.dropdownStyleProps)))}},60:function(e,a,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var n in a=arguments[t])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},r.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&n(a,e,t);return o(a,e),a},u=this&&this.__rest||function(e,a){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]])}return t};Object.defineProperty(a,"__esModule",{value:!0}),a.CountrySelectorDropdown=void 0,t(374);var l=i(t(156)),c=t(946),s=t(515),d=t(332),f=t(425);a.CountrySelectorDropdown=function(e){var a=e.show,t=e.dialCodePrefix,n=void 0===t?"+":t,o=e.selectedCountry,i=e.countries,p=void 0===i?c.defaultCountries:i,v=e.onSelect,y=e.onClose,m=u(e,["show","dialCodePrefix","selectedCountry","countries","onSelect","onClose"]),h=(0,l.useRef)(null),b=(0,l.useRef)(),C=(0,l.useRef)({updatedAt:void 0,value:""}),g=(0,l.useCallback)((function(e){return p.findIndex((function(a){return(0,d.parseCountry)(a).iso2===e}))}),[p]),P=(0,l.useState)(g(o)),_=P[0],w=P[1],O=function(){b.current!==o&&w(g(o))},D=(0,l.useCallback)((function(e){w(g(e.iso2)),null==v||v(e)}),[v,g]),j=function(e){var a=p.length-1;w((function(t){var r,n=(r=t,"prev"===e?r-1:"next"===e?r+1:"last"===e?a:0);return n<0?0:n>a?a:n}))},M=(0,l.useCallback)((function(){if(h.current&&void 0!==_){var e=(0,d.parseCountry)(p[_]).iso2;if(e!==b.current){var a=h.current.querySelector('[data-country="'.concat(e,'"]'));a&&((0,d.scrollToChild)(h.current,a),b.current=e)}}}),[_,p]);return(0,l.useEffect)((function(){M()}),[_,M]),(0,l.useEffect)((function(){h.current&&(a?h.current.focus():O())}),[a]),(0,l.useEffect)((function(){O()}),[o]),l.default.createElement("ul",{ref:h,role:"listbox",className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown"],rawClassNames:[m.className]}),style:r({display:a?"block":"none"},m.style),onKeyDown:function(e){if(e.stopPropagation(),"Enter"!==e.key)if("Escape"!==e.key){if("ArrowUp"===e.key)return e.preventDefault(),void j("prev");if("ArrowDown"===e.key)return e.preventDefault(),void j("next");if("PageUp"===e.key)return e.preventDefault(),void j("first");if("PageDown"===e.key)return e.preventDefault(),void j("last");" "===e.key&&e.preventDefault(),1!==e.key.length||e.altKey||e.ctrlKey||e.metaKey||function(e){var a=C.current.updatedAt&&(new Date).getTime()-C.current.updatedAt.getTime()>1e3;C.current={value:a?e:"".concat(C.current.value).concat(e),updatedAt:new Date};var t=p.findIndex((function(e){return(0,d.parseCountry)(e).name.toLowerCase().startsWith(C.current.value)}));-1!==t&&w(t)}(e.key.toLocaleLowerCase())}else null==y||y();else{var a=(0,d.parseCountry)(p[_]);D(a)}},onBlur:y,tabIndex:-1,"aria-activedescendant":"".concat((0,d.parseCountry)(p[_]).iso2,"-option")},p.map((function(e,a){var t=(0,d.parseCountry)(e),r=t.iso2===o,i=a===_;return l.default.createElement("li",{key:t.iso2,"data-country":t.iso2,role:"option","aria-selected":r,"aria-label":"".concat(t.name," ").concat(n).concat(t.dialCode),id:"".concat(t.iso2,"-option"),className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item",r&&"country-selector-dropdown__list-item--selected",i&&"country-selector-dropdown__list-item--focused"],rawClassNames:[m.listItemClassName]}),onClick:function(){return D(t)},style:m.listItemStyle},l.default.createElement(f.FlagEmoji,{iso2:t.iso2,className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-flag-emoji"],rawClassNames:[m.listItemFlagClassName]}),style:m.listItemFlagStyle}),l.default.createElement("span",{className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-country-name"],rawClassNames:[m.listItemCountryNameClassName]}),style:m.listItemCountryNameStyle},t.name),l.default.createElement("span",{className:(0,s.buildClassNames)({addPrefix:["country-selector-dropdown__list-item-dial-code"],rawClassNames:[m.listItemDialCodeClassName]}),style:m.listItemDialCodeStyle},n,t.dialCode))})))}},7:function(e,a,t){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.DialCodePreview=void 0,t(840);var n=r(t(156)),o=t(515);a.DialCodePreview=function(e){var a=e.dialCode,t=e.prefix,r=e.disabled,i=e.style,u=e.className;return n.default.createElement("div",{className:(0,o.buildClassNames)({addPrefix:["dial-code-preview",r&&"dial-code-preview--disabled"],rawClassNames:[u]}),style:i},"".concat(t).concat(a))}},425:function(e,a,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var n in a=arguments[t])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},r.apply(this,arguments)},n=this&&this.__rest||function(e,a){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]])}return t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(a,"__esModule",{value:!0}),a.FlagEmoji=void 0,t(481);var i=o(t(156)),u=t(515),l="abcdefghijklmnopqrstuvwxyz".split("").reduce((function(e,a,t){var n,o,i;return r(r({},e),((n={})[a]=(o=t,i=parseInt("1f1e6",16),Number(i+o).toString(16)),n))}),{});a.FlagEmoji=function(e){var a=e.iso2,t=e.size,o=void 0===t?"24px":t,c=e.protocol,s=void 0===c?"https":c,d=e.disableLazyLoading,f=e.className,p=n(e,["iso2","size","protocol","disableLazyLoading","className"]);if(!a)return i.default.createElement("img",r({width:o,height:o},p));var v=function(e){return[l[e[0]],l[e[1]]].join("-")}(a),y="".concat(s,"://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/").concat(v,".svg");return i.default.createElement("img",r({className:(0,u.buildClassNames)({addPrefix:["flag-emoji"],rawClassNames:[f]}),src:y,width:o,height:o,draggable:!1,"data-country":a,loading:d?void 0:"lazy"},p))}},28:function(e,a,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var n in a=arguments[t])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},r.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),o=this&&this.__setModuleDefault||(Object.create?function(e,a){Object.defineProperty(e,"default",{enumerable:!0,value:a})}:function(e,a){e.default=a}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var a={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&n(a,e,t);return o(a,e),a},u=this&&this.__rest||function(e,a){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&a.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]])}return t};Object.defineProperty(a,"__esModule",{value:!0}),a.PhoneInput=void 0,t(549);var l=i(t(156)),c=t(946),s=t(882),d=t(515),f=t(332),p=t(153),v=t(7);a.PhoneInput=function(e){var a,t=e.hideDropdown,n=e.placeholder,o=e.disabled,i=e.showDisabledDialCodeAndPrefix,y=e.inputProps,m=e.onChange,h=e.style,b=e.className,C=e.inputStyle,g=e.inputClassName,P=e.countrySelectorStyleProps,_=e.dialCodePreviewStyleProps,w=e.value,O=e.countries,D=void 0===O?c.defaultCountries:O,j=u(e,["hideDropdown","placeholder","disabled","showDisabledDialCodeAndPrefix","inputProps","onChange","style","className","inputStyle","inputClassName","countrySelectorStyleProps","dialCodePreviewStyleProps","value","countries"]),M=(0,s.usePhoneInput)(r(r({value:w,countries:D},j),{onChange:function(e){null==m||m(e.phone,e.country)}})),S=M.phone,x=M.inputRef,N=M.country,k=M.setCountry,A=M.handlePhoneValueChange,E=(0,l.useMemo)((function(){if(N)return(0,f.getCountry)({value:N,field:"iso2",countries:D})}),[D,N]),I=j.disableDialCodeAndPrefix&&i&&(null==E?void 0:E.dialCode);return l.default.createElement("div",{className:(0,d.buildClassNames)({addPrefix:["input-container"],rawClassNames:[b]}),style:h},l.default.createElement(p.CountrySelector,r({onSelect:function(e){return k(e.iso2)},selectedCountry:N,countries:D,disabled:o,hideDropdown:t},P)),I&&l.default.createElement(v.DialCodePreview,r({dialCode:E.dialCode,prefix:null!==(a=j.prefix)&&void 0!==a?a:"+",disabled:o},_)),l.default.createElement("input",r({onChange:A,value:S,type:"tel",ref:x,className:(0,d.buildClassNames)({addPrefix:["input",o&&"input--disabled"],rawClassNames:[g]}),placeholder:n,disabled:o,style:C},y)))}},946:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.defaultCountries=void 0,a.defaultCountries=[["Afghanistan",["asia"],"af","93"],["Albania",["europe"],"al","355"],["Algeria",["africa","north-africa"],"dz","213"],["Andorra",["europe"],"ad","376"],["Angola",["africa"],"ao","244"],["Antigua and Barbuda",["america","carribean"],"ag","1268"],["Argentina",["america","south-america"],"ar","54","(..) ........",0,["11","221","223","261","264","2652","280","2905","291","2920","2966","299","341","342","343","351","376","379","381","3833","385","387","388"]],["Armenia",["asia","ex-ussr"],"am","374",".. ......"],["Aruba",["america","carribean"],"aw","297"],["Australia",["oceania"],"au","61",". .... ....",0,["2","3","4","7","8"]],["Austria",["europe","eu-union"],"at","43"],["Azerbaijan",["asia","ex-ussr"],"az","994","(..) ... .. .."],["Bahamas",["america","carribean"],"bs","1242"],["Bahrain",["middle-east"],"bh","973"],["Bangladesh",["asia"],"bd","880"],["Barbados",["america","carribean"],"bb","1246"],["Belarus",["europe","ex-ussr"],"by","375","(..) ... .. .."],["Belgium",["europe","eu-union"],"be","32","... .. .. .."],["Belize",["america","central-america"],"bz","501"],["Benin",["africa"],"bj","229"],["Bhutan",["asia"],"bt","975"],["Bolivia",["america","south-america"],"bo","591"],["Bosnia and Herzegovina",["europe","ex-yugos"],"ba","387"],["Botswana",["africa"],"bw","267"],["Brazil",["america","south-america"],"br","55","(..) ........."],["British Indian Ocean Territory",["asia"],"io","246"],["Brunei",["asia"],"bn","673"],["Bulgaria",["europe","eu-union"],"bg","359"],["Burkina Faso",["africa"],"bf","226"],["Burundi",["africa"],"bi","257"],["Cambodia",["asia"],"kh","855"],["Cameroon",["africa"],"cm","237"],["Canada",["america","north-america"],"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",["africa"],"cv","238"],["Caribbean Netherlands",["america","carribean"],"bq","599","",1],["Central African Republic",["africa"],"cf","236"],["Chad",["africa"],"td","235"],["Chile",["america","south-america"],"cl","56"],["China",["asia"],"cn","86","... .... ...."],["Colombia",["america","south-america"],"co","57","... ... ...."],["Comoros",["africa"],"km","269"],["Congo",["africa"],"cd","243"],["Congo",["africa"],"cg","242"],["Costa Rica",["america","central-america"],"cr","506","....-...."],["Côte d'Ivoire",["africa"],"ci","225",".. .. .. .. .."],["Croatia",["europe","eu-union","ex-yugos"],"hr","385"],["Cuba",["america","carribean"],"cu","53"],["Curaçao",["america","carribean"],"cw","599","",0],["Cyprus",["europe","eu-union"],"cy","357",".. ......"],["Czech Republic",["europe","eu-union"],"cz","420","... ... ..."],["Denmark",["europe","eu-union","baltic"],"dk","45",".. .. .. .."],["Djibouti",["africa"],"dj","253"],["Dominica",["america","carribean"],"dm","1767"],["Dominican Republic",["america","carribean"],"do","1","",2],["Ecuador",["america","south-america"],"ec","593"],["Egypt",["africa","north-africa"],"eg","20"],["El Salvador",["america","central-america"],"sv","503","....-...."],["Equatorial Guinea",["africa"],"gq","240"],["Eritrea",["africa"],"er","291"],["Estonia",["europe","eu-union","ex-ussr","baltic"],"ee","372",".... ......"],["Ethiopia",["africa"],"et","251"],["Fiji",["oceania"],"fj","679"],["Finland",["europe","eu-union","baltic"],"fi","358",".. ... .. .."],["France",["europe","eu-union"],"fr","33",". .. .. .. .."],["French Guiana",["america","south-america"],"gf","594"],["French Polynesia",["oceania"],"pf","689"],["Gabon",["africa"],"ga","241"],["Gambia",["africa"],"gm","220"],["Georgia",["asia","ex-ussr"],"ge","995"],["Germany",["europe","eu-union","baltic"],"de","49",".... ........"],["Ghana",["africa"],"gh","233"],["Greece",["europe","eu-union"],"gr","30"],["Grenada",["america","carribean"],"gd","1473"],["Guadeloupe",["america","carribean"],"gp","590","",0],["Guam",["oceania"],"gu","1671"],["Guatemala",["america","central-america"],"gt","502","....-...."],["Guinea",["africa"],"gn","224"],["Guinea-Bissau",["africa"],"gw","245"],["Guyana",["america","south-america"],"gy","592"],["Haiti",["america","carribean"],"ht","509","....-...."],["Honduras",["america","central-america"],"hn","504"],["Hong Kong",["asia"],"hk","852",".... ...."],["Hungary",["europe","eu-union"],"hu","36"],["Iceland",["europe"],"is","354","... ...."],["India",["asia"],"in","91",".....-....."],["Indonesia",["asia"],"id","62"],["Iran",["middle-east"],"ir","98","... ... ...."],["Iraq",["middle-east"],"iq","964"],["Ireland",["europe","eu-union"],"ie","353",".. ......."],["Israel",["middle-east"],"il","972","... ... ...."],["Italy",["europe","eu-union"],"it","39","... .......",0],["Jamaica",["america","carribean"],"jm","1876"],["Japan",["asia"],"jp","81",".. .... ...."],["Jordan",["middle-east"],"jo","962"],["Kazakhstan",["asia","ex-ussr"],"kz","7","... ...-..-..",0,["310","311","312","313","315","318","321","324","325","326","327","336","7172","73622"]],["Kenya",["africa"],"ke","254"],["Kiribati",["oceania"],"ki","686"],["Kosovo",["europe","ex-yugos"],"xk","383"],["Kuwait",["middle-east"],"kw","965"],["Kyrgyzstan",["asia","ex-ussr"],"kg","996","... ... ..."],["Laos",["asia"],"la","856"],["Latvia",["europe","eu-union","ex-ussr","baltic"],"lv","371",".. ... ..."],["Lebanon",["middle-east"],"lb","961"],["Lesotho",["africa"],"ls","266"],["Liberia",["africa"],"lr","231"],["Libya",["africa","north-africa"],"ly","218"],["Liechtenstein",["europe"],"li","423"],["Lithuania",["europe","eu-union","ex-ussr","baltic"],"lt","370"],["Luxembourg",["europe","eu-union"],"lu","352"],["Macau",["asia"],"mo","853"],["Macedonia",["europe","ex-yugos"],"mk","389"],["Madagascar",["africa"],"mg","261"],["Malawi",["africa"],"mw","265"],["Malaysia",["asia"],"my","60","..-....-...."],["Maldives",["asia"],"mv","960"],["Mali",["africa"],"ml","223"],["Malta",["europe","eu-union"],"mt","356"],["Marshall Islands",["oceania"],"mh","692"],["Martinique",["america","carribean"],"mq","596"],["Mauritania",["africa"],"mr","222"],["Mauritius",["africa"],"mu","230"],["Mexico",["america","central-america"],"mx","52","... ... ....",0,["33","55","81","229","656","664","774","998"]],["Micronesia",["oceania"],"fm","691"],["Moldova",["europe"],"md","373","(..) ..-..-.."],["Monaco",["europe"],"mc","377"],["Mongolia",["asia"],"mn","976"],["Montenegro",["europe","ex-yugos"],"me","382"],["Morocco",["africa","north-africa"],"ma","212"],["Mozambique",["africa"],"mz","258"],["Myanmar",["asia"],"mm","95"],["Namibia",["africa"],"na","264"],["Nauru",["africa"],"nr","674"],["Nepal",["asia"],"np","977"],["Netherlands",["europe","eu-union"],"nl","31",".. ........"],["New Caledonia",["oceania"],"nc","687"],["New Zealand",["oceania"],"nz","64","...-...-...."],["Nicaragua",["america","central-america"],"ni","505"],["Niger",["africa"],"ne","227"],["Nigeria",["africa"],"ng","234"],["North Korea",["asia"],"kp","850"],["Norway",["europe","baltic"],"no","47","... .. ..."],["Oman",["middle-east"],"om","968"],["Pakistan",["asia"],"pk","92","...-......."],["Palau",["oceania"],"pw","680"],["Palestine",["middle-east"],"ps","970"],["Panama",["america","central-america"],"pa","507"],["Papua New Guinea",["oceania"],"pg","675"],["Paraguay",["america","south-america"],"py","595"],["Peru",["america","south-america"],"pe","51"],["Philippines",["asia"],"ph","63",".... ......."],["Poland",["europe","eu-union","baltic"],"pl","48","...-...-..."],["Portugal",["europe","eu-union"],"pt","351"],["Puerto Rico",["america","carribean"],"pr","1","",3],["Qatar",["middle-east"],"qa","974"],["Réunion",["africa"],"re","262"],["Romania",["europe","eu-union"],"ro","40"],["Russia",["europe","asia","ex-ussr","baltic"],"ru","7","(...) ...-..-..",1],["Rwanda",["africa"],"rw","250"],["Saint Kitts and Nevis",["america","carribean"],"kn","1869"],["Saint Lucia",["america","carribean"],"lc","1758"],["Saint Vincent and the Grenadines",["america","carribean"],"vc","1784"],["Samoa",["oceania"],"ws","685"],["San Marino",["europe"],"sm","378"],["São Tomé and Príncipe",["africa"],"st","239"],["Saudi Arabia",["middle-east"],"sa","966"],["Senegal",["africa"],"sn","221"],["Serbia",["europe","ex-yugos"],"rs","381"],["Seychelles",["africa"],"sc","248"],["Sierra Leone",["africa"],"sl","232"],["Singapore",["asia"],"sg","65","....-...."],["Slovakia",["europe","eu-union"],"sk","421"],["Slovenia",["europe","eu-union","ex-yugos"],"si","386"],["Solomon Islands",["oceania"],"sb","677"],["Somalia",["africa"],"so","252"],["South Africa",["africa"],"za","27"],["South Korea",["asia"],"kr","82","... .... ...."],["South Sudan",["africa","north-africa"],"ss","211"],["Spain",["europe","eu-union"],"es","34","... ... ..."],["Sri Lanka",["asia"],"lk","94"],["Sudan",["africa"],"sd","249"],["Suriname",["america","south-america"],"sr","597"],["Swaziland",["africa"],"sz","268"],["Sweden",["europe","eu-union","baltic"],"se","46","(...) ...-..."],["Switzerland",["europe"],"ch","41",".. ... .. .."],["Syria",["middle-east"],"sy","963"],["Taiwan",["asia"],"tw","886"],["Tajikistan",["asia","ex-ussr"],"tj","992"],["Tanzania",["africa"],"tz","255"],["Thailand",["asia"],"th","66"],["Timor-Leste",["asia"],"tl","670"],["Togo",["africa"],"tg","228"],["Tonga",["oceania"],"to","676"],["Trinidad and Tobago",["america","carribean"],"tt","1868"],["Tunisia",["africa","north-africa"],"tn","216"],["Turkey",["europe"],"tr","90","... ... .. .."],["Turkmenistan",["asia","ex-ussr"],"tm","993"],["Tuvalu",["asia"],"tv","688"],["Uganda",["africa"],"ug","256"],["Ukraine",["europe","ex-ussr"],"ua","380","(..) ... .. .."],["United Arab Emirates",["middle-east"],"ae","971"],["United Kingdom",["europe","eu-union"],"gb","44",".... ......"],["United States",["america","north-america"],"us","1","(...) ...-....",0,["201","202","203","205","206","207","208","209","210","212","213","214","215","216","217","218","219","224","225","228","229","231","234","239","240","248","251","252","253","254","256","260","262","267","269","270","276","281","301","302","303","304","305","307","308","309","310","312","313","314","315","316","317","318","319","320","321","323","325","330","334","336","337","339","347","351","352","360","361","386","401","402","404","405","406","407","408","409","410","412","413","414","415","417","419","423","424","425","430","432","434","435","440","443","447","469","478","479","480","484","501","502","503","504","505","507","508","509","510","512","513","515","516","517","518","520","530","540","541","551","559","561","562","563","567","570","571","573","574","575","580","585","586","601","602","603","605","606","607","608","609","610","612","614","615","616","617","618","619","620","623","626","630","631","636","641","646","650","651","660","661","662","678","681","682","689","701","702","703","704","706","707","708","712","713","714","715","716","717","718","719","720","724","727","731","732","734","740","754","757","760","762","763","765","769","770","772","773","774","775","779","781","785","786","801","802","803","804","805","806","808","810","812","813","814","815","816","817","818","828","830","831","832","843","845","847","848","850","856","857","858","859","860","862","863","864","865","870","878","901","903","904","906","907","908","909","910","912","913","914","915","916","917","918","919","920","925","928","931","936","937","940","941","947","949","951","952","954","956","970","971","972","973","978","979","980","985","989"]],["Uruguay",["america","south-america"],"uy","598"],["Uzbekistan",["asia","ex-ussr"],"uz","998",".. ... .. .."],["Vanuatu",["oceania"],"vu","678"],["Vatican City",["europe"],"va","39",".. .... ....",1],["Venezuela",["america","south-america"],"ve","58"],["Vietnam",["asia"],"vn","84"],["Yemen",["middle-east"],"ye","967"],["Zambia",["africa"],"zm","260"],["Zimbabwe",["africa"],"zw","263"]]},11:function(e,a,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var n in a=arguments[t])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},r.apply(this,arguments)},n=this&&this.__spreadArray||function(e,a,t){if(t||2===arguments.length)for(var r,n=0,o=a.length;n<o;n++)!r&&n in a||(r||(r=Array.prototype.slice.call(a,0,n)),r[n]=a[n]);return e.concat(r||Array.prototype.slice.call(a))};Object.defineProperty(a,"__esModule",{value:!0}),a.useHistoryState=void 0;var o=t(156),i=t(795),u={size:20,overrideLastItemDebounceMS:-1};a.useHistoryState=function(e,a){var t=r(r({},u),a),l=t.size,c=t.overrideLastItemDebounceMS,s=t.onChange,d=(0,o.useState)(e),f=d[0],p=d[1],v=(0,o.useState)([f]),y=v[0],m=v[1],h=(0,o.useState)(0),b=h[0],C=h[1],g=(0,i.useTimer)();return[f,function(e,a){if(("object"!=typeof e||Object.entries(e).toString()!==Object.entries(f).toString())&&e!==f){var t=c>0,r=g.check(),o=!t||void 0===r||r>c;if(void 0!==(null==a?void 0:a.overrideLastItem)?a.overrideLastItem:!o)m((function(a){return n(n([],a.slice(0,b),!0),[e],!1)}));else{var i=y.length>=l;m((function(a){return n(n([],a.slice(i?1:0,b+1),!0),[e],!1)})),i||C((function(e){return e+1}))}p(e),null==s||s(e)}},function(){if(b<=0)return{success:!1};var e=y[b-1];return p(e),C((function(e){return e-1})),null==s||s(e),{success:!0,value:e}},function(){if(b+1>=y.length)return{success:!1};var e=y[b+1];return p(e),C((function(e){return e+1})),null==s||s(e),{success:!0,value:e}}]}},882:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.usePhoneInput=a.defaultConfig=a.MASK_CHAR=void 0;var r=t(156),n=t(946),o=t(332),i=t(11);a.MASK_CHAR=".",a.defaultConfig={defaultCountry:"us",value:"",prefix:"+",defaultMask:"............",charAfterDialCode:" ",historySaveDebounceMS:200,disableCountryGuess:!1,disableDialCodePrefill:!1,forceDialCode:!1,disableDialCodeAndPrefix:!1,countries:n.defaultCountries},a.usePhoneInput=function(e){var t=e.defaultCountry,n=void 0===t?a.defaultConfig.defaultCountry:t,u=e.value,l=void 0===u?a.defaultConfig.value:u,c=e.countries,s=void 0===c?a.defaultConfig.countries:c,d=e.prefix,f=void 0===d?a.defaultConfig.prefix:d,p=e.defaultMask,v=void 0===p?a.defaultConfig.defaultMask:p,y=e.charAfterDialCode,m=void 0===y?a.defaultConfig.charAfterDialCode:y,h=e.historySaveDebounceMS,b=void 0===h?a.defaultConfig.historySaveDebounceMS:h,C=e.disableCountryGuess,g=void 0===C?a.defaultConfig.disableCountryGuess:C,P=e.disableDialCodePrefill,_=void 0===P?a.defaultConfig.disableDialCodePrefill:P,w=e.forceDialCode,O=void 0===w?a.defaultConfig.forceDialCode:w,D=e.disableDialCodeAndPrefix,j=void 0===D?a.defaultConfig.disableDialCodeAndPrefix:D,M=e.onChange,S=!j&&!g,x=(0,r.useRef)(null),N=function(e){var t,r=e.value,n=e.country,i=e.trimNonDigitsEnd,u=e.insertDialCodeOnEmpty,l=!e.forceDisableCountryGuess&&S?(0,o.guessCountryByPartialNumber)({phone:r,countries:s,currentCountryIso2:n.iso2}):void 0,c=null!==(t=null==l?void 0:l.country)&&void 0!==t?t:n;return{phone:c?(0,o.formatPhone)(r,{prefix:f,mask:c.format||v,maskChar:a.MASK_CHAR,dialCode:c.dialCode,trimNonDigitsEnd:i,charAfterDialCode:m,forceDialCode:O,insertDialCodeOnEmpty:u,disableDialCodeAndPrefix:j}):r,countryGuessResult:l,formatCountry:c}},k=function(e){Promise.resolve().then((function(){var a;null===(a=x.current)||void 0===a||a.setSelectionRange(e,e)}))},A=(0,i.useHistoryState)((function(){var e=(0,o.guessCountryByPartialNumber)({phone:l,countries:s,currentCountryIso2:n}).country||(0,o.getCountry)({value:n,field:"iso2",countries:s});e||console.error('[react-international-phone]: can not find a country with "'.concat(n,'" iso2 code'));var a=e||(0,o.parseCountry)(s.find((function(e){return"us"===(0,o.parseCountry)(e).iso2}))),t=N({value:l,country:a,insertDialCodeOnEmpty:!_}).phone;return k(t.length),{phone:t,country:a.iso2}}),{overrideLastItemDebounceMS:b,onChange:M}),E=A[0],I=E.phone,B=E.country,L=A[1],z=A[2],R=A[3],T=(0,r.useMemo)((function(){return(0,o.getCountry)({value:B,field:"iso2",countries:s})}),[s,B]),G=function(e,a){var t,r,n=void 0===a?{}:a,i=n.deletion,u=n.cursorPosition,l=n.insertDialCodeOnEmpty,c=n.inserted,s=e,d=u;O&&!j&&T&&!(0,o.removeNonDigits)(e).startsWith(T.dialCode)&&e&&(c&&e.startsWith(f)&&e.length-(null!=u?u:0)==0?s=e:(s=I,d=0));var p=N({value:s,country:T,trimNonDigitsEnd:"backward"===i,insertDialCodeOnEmpty:l,forceDisableCountryGuess:O&&!!i&&(0,o.removeNonDigits)(s).length<T.dialCode.length}),v=p.phone,y=p.countryGuessResult,h=T;S&&(null==y?void 0:y.country)&&y.country.name!==B&&y.fullDialCodeMatch&&(h=y.country);var b=(0,o.getCursorPosition)({cursorPositionAfterInput:null!=d?d:0,phoneBeforeInput:I,phoneAfterInput:e,phoneAfterFormatted:v,leftOffset:O?f.length+(null!==(r=null===(t=null==T?void 0:T.dialCode)||void 0===t?void 0:t.length)&&void 0!==r?r:0)+m.length:0,deletion:i});return L({phone:v,country:h.iso2}),k(b),v};(0,r.useEffect)((function(){var e=x.current;if(e){var a=function(e){if(e.key){var a=e.ctrlKey,t=e.shiftKey,r="z"===e.key.toLowerCase();a&&r&&(t?R():z())}};return e.addEventListener("keydown",a),function(){e.removeEventListener("keydown",a)}}}),[x,z,R]);var K=(0,r.useState)(!1),F=K[0],W=K[1];return(0,r.useEffect)((function(){if(!F)return W(!0),void(l!==I&&(null==M||M({phone:I,country:B})));l!==I&&G(l)}),[l]),{phone:I,country:B,setCountry:function(e){var a=(0,o.getCountry)({value:e,field:"iso2",countries:s});if(a){var t=j?"":"".concat(f).concat(a.dialCode).concat(m);L({phone:t,country:a.iso2}),Promise.resolve().then((function(){var e;null===(e=x.current)||void 0===e||e.focus()}))}},handlePhoneValueChange:function(e){var a;e.preventDefault();var t=e.nativeEvent.inputType,r=null==t?void 0:t.startsWith("insertFrom"),n=G(e.target.value,{deletion:function(){var e;if(null!==(e=null==t?void 0:t.toLocaleLowerCase().includes("delete"))&&void 0!==e&&e)return(null==t?void 0:t.toLocaleLowerCase().includes("forward"))?"forward":"backward"}(),inserted:r,cursorPosition:null!==(a=e.target.selectionStart)&&void 0!==a?a:0});return j&&T?(0,o.addDialCode)({phone:n,dialCode:T.dialCode,charAfterDialCode:m,prefix:f}):n},inputRef:x}}},393:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.usePhoneValidation=void 0;var r=t(332);a.usePhoneValidation=function(e,a){return(0,r.validatePhone)(e,a)}},795:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.useTimer=void 0;var r=t(156);a.useTimer=function(){var e=(0,r.useRef)(),a=(0,r.useRef)(Date.now());return{check:function(){var t=Date.now(),r=e.current?t-a.current:void 0;return e.current=a.current,a.current=t,r}}}},515:function(e,a){var t=this&&this.__spreadArray||function(e,a,t){if(t||2===arguments.length)for(var r,n=0,o=a.length;n<o;n++)!r&&n in a||(r||(r=Array.prototype.slice.call(a,0,n)),r[n]=a[n]);return e.concat(r||Array.prototype.slice.call(a))};Object.defineProperty(a,"__esModule",{value:!0}),a.buildClassNames=a.classNamesWithPrefix=a.joinClasses=a.classPrefix=void 0,a.classPrefix="react-international-phone-",a.joinClasses=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];return e.filter((function(e){return!!e})).join(" ").trim()},a.classNamesWithPrefix=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a.joinClasses.apply(void 0,e).split(" ").map((function(e){return"".concat(a.classPrefix).concat(e)})).join(" ")},a.buildClassNames=function(e){var r=e.addPrefix,n=e.rawClassNames;return a.joinClasses.apply(void 0,t([a.classNamesWithPrefix.apply(void 0,r)],n,!1))}},62:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.applyMask=void 0,a.applyMask=function(e){var a=e.value,t=e.mask,r=e.maskSymbol,n=e.offset,o=void 0===n?0:n,i=e.trimNonMaskCharsLeftover,u=void 0!==i&&i;if(a.length<o)return a;for(var l=a.slice(0,o),c=a.slice(o),s=l,d=0,f=0,p=t.split("");f<p.length;f++){var v=p[f];if(d>=c.length){if(!u&&v!==r){s+=v;continue}break}v===r?(s+=c[d],d+=1):s+=v}return s}},239:function(e,a,t){var r=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),n=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||r(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),n(t(62),a),n(t(939),a),n(t(222),a)},939:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeNonDigits=void 0,a.removeNonDigits=function(e){return e.replace(/\D/g,"")}},222:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.scrollToChild=void 0,a.scrollToChild=function(e,a){var t=e.style.display;"block"!==t&&(e.style.display="block");var r=e.getBoundingClientRect(),n=a.getBoundingClientRect(),o=n.top-r.top,i=r.bottom-n.bottom;o>=0&&i>=0||(Math.abs(o)<Math.abs(i)?e.scrollTop+=o:e.scrollTop-=i),e.style.display=t}},298:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.buildCountryData=void 0,a.buildCountryData=function(e){for(var a=[e.name,e.regions,e.iso2,e.dialCode,e.format,e.priority,e.areaCodes],t=0;t<a.length;t+=1)if(0!==t){var r=a[t-1],n=a[t];if(void 0===r&&void 0!==n){var o=JSON.stringify(a,(function(e,a){return void 0===a?"__undefined":a})).replace(/"__undefined"/g,"undefined");throw new Error("[react-international-phone] invalid country values passed to buildCountryData. Check ".concat(r," in: ").concat(o))}}return a.filter((function(e){return void 0!==e}))}},891:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getCountry=void 0;var r=t(300);a.getCountry=function(e){var a=e.value,t=e.field,n=e.countries;if(["regions","priority"].includes(t))throw new Error(function(e){return'Field "'.concat(e,'" is not supported')}(t));var o=n.find((function(e){var n=(0,r.parseCountry)(e);return a===n[t]}));if(o)return(0,r.parseCountry)(o)}},4:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.guessCountryByPartialNumber=void 0;var r=t(239),n=t(891),o=t(300);a.guessCountryByPartialNumber=function(e){var a,t=e.phone,i=e.countries,u=e.currentCountryIso2,l={country:void 0,fullDialCodeMatch:!1,areaCodeMatch:void 0};if(!t)return l;var c=(0,r.removeNonDigits)(t);if(!c)return l;for(var s=l,d=function(e){var a,t,r,n,o=e.country,i=e.fullDialCodeMatch,u=e.areaCodeMatch,l=o.dialCode===(null===(a=s.country)||void 0===a?void 0:a.dialCode),c=(null!==(t=o.priority)&&void 0!==t?t:0)<(null!==(n=null===(r=s.country)||void 0===r?void 0:r.priority)&&void 0!==n?n:0);l&&!c||(s={country:o,fullDialCodeMatch:i,areaCodeMatch:u})},f=0,p=i;f<p.length;f++){var v=p[f],y=(0,o.parseCountry)(v),m=y.dialCode,h=y.areaCodes;if(c.startsWith(m)){var b=!s.country||Number(m)>=Number(s.country.dialCode);if(h)for(var C=c.substring(m.length),g=0,P=h;g<P.length;g++){var _=P[g];if(C.startsWith(_))return{country:y,fullDialCodeMatch:!0,areaCodeMatch:!0}}!b&&m!==c&&s.fullDialCodeMatch||d({country:y,fullDialCodeMatch:!0,areaCodeMatch:h?!h:void 0})}s.fullDialCodeMatch||c.length<m.length&&m.startsWith(c)&&(!s.country||Number(m)<=Number(s.country.dialCode))&&d({country:y,fullDialCodeMatch:!1})}if(u){var w=(0,n.getCountry)({value:u,field:"iso2",countries:i});s&&w&&(null===(a=s.country)||void 0===a?void 0:a.dialCode)===w.dialCode&&s.country!==w&&s.fullDialCodeMatch&&!s.areaCodeMatch&&(s={country:w,areaCodeMatch:!(null==w?void 0:w.areaCodes)&&void 0,fullDialCodeMatch:!0})}return s}},88:function(e,a,t){var r=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),n=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||r(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),n(t(298),a),n(t(891),a),n(t(4),a),n(t(300),a)},300:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.parseCountry=void 0,a.parseCountry=function(e){return{name:e[0],regions:e[1],iso2:e[2],dialCode:e[3],format:e[4],priority:e[5],areaCodes:e[6]}}},332:function(e,a,t){var r=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),n=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||r(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),n(t(239),a),n(t(88),a),n(t(165),a)},820:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDialCode=void 0;var r=t(214);a.addDialCode=function(e){var a=e.phone,t=e.dialCode,n=e.prefix,o=void 0===n?"+":n,i=e.charAfterDialCode,u=void 0===i?" ":i;return"".concat(o).concat(t).concat(u).concat((0,r.removeDialCode)({phone:a,dialCode:t,charAfterDialCode:u,prefix:o}))}},380:(e,a,t)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.formatPhone=void 0;var r=t(239);a.formatPhone=function(e,a){var t=!a.disableDialCodeAndPrefix&&a.forceDialCode,n=!a.disableDialCodeAndPrefix&&a.insertDialCodeOnEmpty,o=e,i=function(e){return a.trimNonDigitsEnd?e.trim():e};if(!o)return n&&!o.length||t?i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode)):i(o);if((o=(0,r.removeNonDigits)(o))===a.dialCode&&!a.disableDialCodeAndPrefix)return i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode));if(a.dialCode.startsWith(o)&&!a.disableDialCodeAndPrefix)return i(t?"".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode):"".concat(a.prefix).concat(o));if(!o.startsWith(a.dialCode)&&!a.disableDialCodeAndPrefix){if(t)return i("".concat(a.prefix).concat(a.dialCode).concat(a.charAfterDialCode));if(o.length<a.dialCode.length)return i("".concat(a.prefix).concat(o))}var u,l=(u=a.dialCode.length,a.disableDialCodeAndPrefix&&(u=0),{phoneLeftSide:o.slice(0,u),phoneRightSide:o.slice(u)}),c=l.phoneLeftSide,s=l.phoneRightSide;return c="".concat(a.prefix).concat(c).concat(a.charAfterDialCode),s=(0,r.applyMask)({value:s,mask:a.mask,maskSymbol:a.maskChar,trimNonMaskCharsLeftover:a.trimNonDigitsEnd}),a.disableDialCodeAndPrefix&&(c=""),i("".concat(c).concat(s))}},775:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getCursorPosition=void 0;var t=function(e){return/\d/.test(e)};a.getCursorPosition=function(e){var a=e.phoneBeforeInput,r=e.phoneAfterInput,n=e.phoneAfterFormatted,o=e.cursorPositionAfterInput,i=e.leftOffset,u=void 0===i?0:i,l=e.deletion;if(o<u)return u;if(!a)return n.length;var c="backward"===l;if(0===o&&r.length>0&&n.length>0){if(c)return 0;for(var s=0;s<n.length;s+=1)if(t(n[s]))return s;return n.length}if(r.length<a.length&&1===r.length)return n.length;var d=null;for(s=o-1;s>=0;s-=1)if(t(r[s])){d=s;break}if(null===d)return 0!==o?o:n.length;var f=0;for(s=0;s<d;s+=1)t(r[s])&&(f+=1);c&&(f-=1);var p=0,v=0;for(s=0;s<n.length&&(p+=1,t(n[s])&&(v+=1),v!==f+1);s+=1);for(;!t(n[p])&&p<n.length;)p+=1;return c&&(p+=1),p}},165:function(e,a,t){var r=this&&this.__createBinding||(Object.create?function(e,a,t,r){void 0===r&&(r=t);var n=Object.getOwnPropertyDescriptor(a,t);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[t]}}),Object.defineProperty(e,r,n)}:function(e,a,t,r){void 0===r&&(r=t),e[r]=a[t]}),n=this&&this.__exportStar||function(e,a){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(a,t)||r(a,e,t)};Object.defineProperty(a,"__esModule",{value:!0}),n(t(820),a),n(t(380),a),n(t(775),a),n(t(214),a),n(t(684),a)},214:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeDialCode=void 0,a.removeDialCode=function(e){var a=e.phone,t=e.dialCode,r=e.prefix,n=void 0===r?"+":r,o=e.charAfterDialCode,i=void 0===o?" ":o;if(!a||!t)return a;var u=a;return u.startsWith(n)&&(u=u.replace(n,"")),u.startsWith(t)?((u=u.replace(t,"")).startsWith(i)&&(u=u.replace(i,"")),u):a}},684:function(e,a,t){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var n in a=arguments[t])Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);return e},r.apply(this,arguments)};Object.defineProperty(a,"__esModule",{value:!0}),a.validatePhone=void 0;var n=t(882),o=t(239),i=t(88);a.validatePhone=function(e,a){var t,u=r(r({},n.defaultConfig),a),l=u.countries,c=u.defaultMask,s=u.defaultMaskMinPhoneLength,d=void 0===s?10:s,f=u.prefix,p=u.charAfterDialCode,v=(null==a?void 0:a.country)?(0,i.getCountry)({value:a.country,field:"iso2",countries:l}):null,y=(0,i.guessCountryByPartialNumber)({phone:e,countries:l,currentCountryIso2:null==a?void 0:a.country}),m=(null===(t=y.country)||void 0===t?void 0:t.iso2)===(null==v?void 0:v.iso2),h=!v||m?y:{country:v,fullDialCodeMatch:!1,areaCodeMatch:!(null==v?void 0:v.areaCodes)&&void 0},b=h.country,C=h.fullDialCodeMatch,g=h.areaCodeMatch;if(!b)return{country:b,lengthMatch:!1,dialCodeMatch:C,areaCodeMatch:g,formatMatch:!1,isValid:!1};var P=b.format||c,_=!b.format,w=_?d-b.dialCode.length:P.length-P.replaceAll(n.MASK_CHAR,"").length,O=_?P.slice(0,w):P,D="".concat(f).concat(b.dialCode).concat(p).concat(O).split("").every((function(a,t){var r=e[t]===a,o=a===n.MASK_CHAR&&Number.isFinite(+e[t]);return r||o})),j=(0,o.removeNonDigits)(e),M=b.dialCode.length+w;return j.length<M?{country:b,lengthMatch:!1,dialCodeMatch:C,areaCodeMatch:g,formatMatch:D,isValid:!1}:{country:b,lengthMatch:!0,dialCodeMatch:C,areaCodeMatch:g,formatMatch:D,isValid:j.startsWith(b.dialCode)}}},156:a=>{a.exports=e}},t={};function r(e){var n=t[e];if(void 0!==n)return n.exports;var o=t[e]={exports:{}};return a[e].call(o.exports,o,o.exports,r),o.exports}r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.validatePhone=e.parseCountry=e.buildCountryData=e.usePhoneValidation=e.usePhoneInput=e.defaultCountries=e.PhoneInput=e.FlagEmoji=e.DialCodePreview=e.CountrySelectorDropdown=e.CountrySelector=void 0;var a=r(153);Object.defineProperty(e,"CountrySelector",{enumerable:!0,get:function(){return a.CountrySelector}});var t=r(60);Object.defineProperty(e,"CountrySelectorDropdown",{enumerable:!0,get:function(){return t.CountrySelectorDropdown}});var o=r(7);Object.defineProperty(e,"DialCodePreview",{enumerable:!0,get:function(){return o.DialCodePreview}});var i=r(425);Object.defineProperty(e,"FlagEmoji",{enumerable:!0,get:function(){return i.FlagEmoji}});var u=r(28);Object.defineProperty(e,"PhoneInput",{enumerable:!0,get:function(){return u.PhoneInput}});var l=r(946);Object.defineProperty(e,"defaultCountries",{enumerable:!0,get:function(){return l.defaultCountries}});var c=r(882);Object.defineProperty(e,"usePhoneInput",{enumerable:!0,get:function(){return c.usePhoneInput}});var s=r(393);Object.defineProperty(e,"usePhoneValidation",{enumerable:!0,get:function(){return s.usePhoneValidation}});var d=r(332);Object.defineProperty(e,"buildCountryData",{enumerable:!0,get:function(){return d.buildCountryData}}),Object.defineProperty(e,"parseCountry",{enumerable:!0,get:function(){return d.parseCountry}}),Object.defineProperty(e,"validatePhone",{enumerable:!0,get:function(){return d.validatePhone}})})(),n})())); |
{ | ||
"name": "react-international-phone", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "☎️ International phone input component for React", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80480