diff --git a/Gruntfile.js b/Gruntfile.js index aeabdf7a8..69724376e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -19,9 +19,9 @@ module.exports = function(grunt) { // just images grunt.registerTask('img', ['responsive_images:retina', 'exec:evenizer', 'responsive_images:regular', 'sprite', 'imagemin', 'generate-scss-metadata']); // just javascript - grunt.registerTask('js', ['shell:eslint', 'shell:genTsDeclaration', 'shell:genReactTsDeclaration', 'shell:buildJs', 'replace', 'react_with_utils', 'shell:buildReact']); + grunt.registerTask('js', ['shell:eslint', 'shell:genTsDeclaration', 'shell:genReactTsDeclaration', 'shell:buildJs', 'replace', 'shell:buildReact', 'replace:removeImport']); // just react - grunt.registerTask('react', ['react_with_utils', 'shell:buildReact']); + grunt.registerTask('react', ['replace:reactWithUtils', 'shell:buildReact', 'replace:removeImport']); // Travis CI grunt.registerTask('travis', ['jasmine']); diff --git a/build/js/intlTelInputWithUtils.js b/build/js/intlTelInputWithUtils.js index aa2f4e5cc..9e4f83baa 100644 --- a/build/js/intlTelInputWithUtils.js +++ b/build/js/intlTelInputWithUtils.js @@ -2719,7 +2719,7 @@ var factoryOutput = (() => { if (!intlTelInput.utils && !intlTelInput.startedLoadingUtilsScript) { intlTelInput.startedLoadingUtilsScript = true; return new Promise((resolve, reject) => { - import( + import_INTENTIONALLY_BROKEN( /* webpackIgnore: true */ path ).then(({ default: utils2 }) => { diff --git a/build/js/intlTelInputWithUtils.min.js b/build/js/intlTelInputWithUtils.min.js index 22256da8f..532a2eacf 100644 --- a/build/js/intlTelInputWithUtils.min.js +++ b/build/js/intlTelInputWithUtils.min.js @@ -13,7 +13,7 @@ } }(() => { -var factoryOutput=(()=>{var m1=Object.defineProperty;var D2=Object.getOwnPropertyDescriptor;var x2=Object.getOwnPropertyNames;var P2=Object.prototype.hasOwnProperty;var k2=(C,$)=>{for(var n in $)m1(C,n,{get:$[n],enumerable:!0})},R2=(C,$,n,r)=>{if($&&typeof $=="object"||typeof $=="function")for(let u of x2($))!P2.call(C,u)&&u!==n&&m1(C,u,{get:()=>$[u],enumerable:!(r=D2($,u))||r.enumerable});return C};var O2=C=>R2(m1({},"__esModule",{value:!0}),C);var j2={};k2(j2,{default:()=>F2});var $2=[["af","93"],["al","355"],["dz","213"],["as","1",5,["684"]],["ad","376"],["ao","244"],["ai","1",6,["264"]],["ag","1",7,["268"]],["ar","54"],["am","374"],["aw","297"],["ac","247"],["au","61",0],["at","43"],["az","994"],["bs","1",8,["242"]],["bh","973"],["bd","880"],["bb","1",9,["246"]],["by","375"],["be","32"],["bz","501"],["bj","229"],["bm","1",10,["441"]],["bt","975"],["bo","591"],["ba","387"],["bw","267"],["br","55"],["io","246"],["vg","1",11,["284"]],["bn","673"],["bg","359"],["bf","226"],["bi","257"],["kh","855"],["cm","237"],["ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905"]],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"]],["cf","236"],["td","235"],["cl","56"],["cn","86"],["cx","61",2,["89164"]],["cc","61",1,["89162"]],["co","57"],["km","269"],["cg","242"],["cd","243"],["ck","682"],["cr","506"],["ci","225"],["hr","385"],["cu","53"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"]],["do","1",2,["809","829","849"]],["ec","593"],["eg","20"],["sv","503"],["gq","240"],["er","291"],["ee","372"],["sz","268"],["et","251"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0],["fr","33"],["gf","594"],["pf","689"],["ga","241"],["gm","220"],["ge","995"],["de","49"],["gh","233"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"]],["gp","590",0],["gu","1",15,["671"]],["gt","502"],["gg","44",1,["1481","7781","7839","7911"]],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36"],["is","354"],["in","91"],["id","62"],["ir","98"],["iq","964"],["ie","353"],["im","44",2,["1624","74576","7524","7924","7624"]],["il","972"],["it","39",0],["jm","1",4,["876","658"]],["jp","81"],["je","44",3,["1534","7509","7700","7797","7829","7937"]],["jo","962"],["kz","7",1,["33","7"]],["ke","254"],["ki","686"],["xk","383"],["kw","965"],["kg","996"],["la","856"],["lv","371"],["lb","961"],["ls","266"],["lr","231"],["ly","218"],["li","423"],["lt","370"],["lu","352"],["mo","853"],["mg","261"],["mw","265"],["my","60"],["mv","960"],["ml","223"],["mt","356"],["mh","692"],["mq","596"],["mr","222"],["mu","230"],["yt","262",1,["269","639"]],["mx","52"],["fm","691"],["md","373"],["mc","377"],["mn","976"],["me","382"],["ms","1",16,["664"]],["ma","212",0],["mz","258"],["mm","95"],["na","264"],["nr","674"],["np","977"],["nl","31"],["nc","687"],["nz","64"],["ni","505"],["ne","227"],["ng","234"],["nu","683"],["nf","672"],["kp","850"],["mk","389"],["mp","1",17,["670"]],["no","47",0],["om","968"],["pk","92"],["pw","680"],["ps","970"],["pa","507"],["pg","675"],["py","595"],["pe","51"],["ph","63"],["pl","48"],["pt","351"],["pr","1",3,["787","939"]],["qa","974"],["re","262",0],["ro","40"],["ru","7",0],["rw","250"],["ws","685"],["sm","378"],["st","239"],["sa","966"],["sn","221"],["rs","381"],["sc","248"],["sl","232"],["sg","65"],["sx","1",21,["721"]],["sk","421"],["si","386"],["sb","677"],["so","252"],["za","27"],["kr","82"],["ss","211"],["es","34"],["lk","94"],["bl","590",1],["sh","290"],["kn","1",18,["869"]],["lc","1",19,["758"]],["mf","590",2],["pm","508"],["vc","1",20,["784"]],["sd","249"],["sr","597"],["sj","47",1,["79"]],["se","46"],["ch","41"],["sy","963"],["tw","886"],["tj","992"],["tz","255"],["th","66"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"]],["tn","216"],["tr","90"],["tm","993"],["tc","1",23,["649"]],["tv","688"],["ug","256"],["ua","380"],["ae","971"],["gb","44",0],["us","1",0],["uy","598"],["vi","1",24,["340"]],["uz","998"],["vu","678"],["va","39",1,["06698"]],["ve","58"],["vn","84"],["wf","681"],["eh","212",1,["5288","5289"]],["ye","967"],["zm","260"],["zw","263"],["ax","358",1,["18"]]],n2=[];for(let C=0;C<$2.length;C++){let $=$2[C];n2[C]={name:"",iso2:$[0],dialCode:$[1],priority:$[2]||0,areaCodes:$[3]||null,nodeById:{}}}var K=n2;var i2={ad:"Andorra",ae:"United Arab Emirates",af:"Afghanistan",ag:"Antigua & Barbuda",ai:"Anguilla",al:"Albania",am:"Armenia",ao:"Angola",aq:"Antarctica",ar:"Argentina",as:"American Samoa",at:"Austria",au:"Australia",aw:"Aruba",ax:"\xC5land Islands",az:"Azerbaijan",ba:"Bosnia & Herzegovina",bb:"Barbados",bd:"Bangladesh",be:"Belgium",bf:"Burkina Faso",bg:"Bulgaria",bh:"Bahrain",bi:"Burundi",bj:"Benin",bl:"St. Barth\xE9lemy",bm:"Bermuda",bn:"Brunei",bo:"Bolivia",bq:"Caribbean Netherlands",br:"Brazil",bs:"Bahamas",bt:"Bhutan",bv:"Bouvet Island",bw:"Botswana",by:"Belarus",bz:"Belize",ca:"Canada",cc:"Cocos (Keeling) Islands",cd:"Congo - Kinshasa",cf:"Central African Republic",cg:"Congo - Brazzaville",ch:"Switzerland",ci:"C\xF4te d\u2019Ivoire",ck:"Cook Islands",cl:"Chile",cm:"Cameroon",cn:"China",co:"Colombia",cr:"Costa Rica",cu:"Cuba",cv:"Cape Verde",cw:"Cura\xE7ao",cx:"Christmas Island",cy:"Cyprus",cz:"Czechia",de:"Germany",dj:"Djibouti",dk:"Denmark",dm:"Dominica",do:"Dominican Republic",dz:"Algeria",ec:"Ecuador",ee:"Estonia",eg:"Egypt",eh:"Western Sahara",er:"Eritrea",es:"Spain",et:"Ethiopia",fi:"Finland",fj:"Fiji",fk:"Falkland Islands",fm:"Micronesia",fo:"Faroe Islands",fr:"France",ga:"Gabon",gb:"United Kingdom",gd:"Grenada",ge:"Georgia",gf:"French Guiana",gg:"Guernsey",gh:"Ghana",gi:"Gibraltar",gl:"Greenland",gm:"Gambia",gn:"Guinea",gp:"Guadeloupe",gq:"Equatorial Guinea",gr:"Greece",gs:"South Georgia & South Sandwich Islands",gt:"Guatemala",gu:"Guam",gw:"Guinea-Bissau",gy:"Guyana",hk:"Hong Kong SAR China",hm:"Heard & McDonald Islands",hn:"Honduras",hr:"Croatia",ht:"Haiti",hu:"Hungary",id:"Indonesia",ie:"Ireland",il:"Israel",im:"Isle of Man",in:"India",io:"British Indian Ocean Territory",iq:"Iraq",ir:"Iran",is:"Iceland",it:"Italy",je:"Jersey",jm:"Jamaica",jo:"Jordan",jp:"Japan",ke:"Kenya",kg:"Kyrgyzstan",kh:"Cambodia",ki:"Kiribati",km:"Comoros",kn:"St. Kitts & Nevis",kp:"North Korea",kr:"South Korea",kw:"Kuwait",ky:"Cayman Islands",kz:"Kazakhstan",la:"Laos",lb:"Lebanon",lc:"St. Lucia",li:"Liechtenstein",lk:"Sri Lanka",lr:"Liberia",ls:"Lesotho",lt:"Lithuania",lu:"Luxembourg",lv:"Latvia",ly:"Libya",ma:"Morocco",mc:"Monaco",md:"Moldova",me:"Montenegro",mf:"St. Martin",mg:"Madagascar",mh:"Marshall Islands",mk:"North Macedonia",ml:"Mali",mm:"Myanmar (Burma)",mn:"Mongolia",mo:"Macao SAR China",mp:"Northern Mariana Islands",mq:"Martinique",mr:"Mauritania",ms:"Montserrat",mt:"Malta",mu:"Mauritius",mv:"Maldives",mw:"Malawi",mx:"Mexico",my:"Malaysia",mz:"Mozambique",na:"Namibia",nc:"New Caledonia",ne:"Niger",nf:"Norfolk Island",ng:"Nigeria",ni:"Nicaragua",nl:"Netherlands",no:"Norway",np:"Nepal",nr:"Nauru",nu:"Niue",nz:"New Zealand",om:"Oman",pa:"Panama",pe:"Peru",pf:"French Polynesia",pg:"Papua New Guinea",ph:"Philippines",pk:"Pakistan",pl:"Poland",pm:"St. Pierre & Miquelon",pn:"Pitcairn Islands",pr:"Puerto Rico",ps:"Palestinian Territories",pt:"Portugal",pw:"Palau",py:"Paraguay",qa:"Qatar",re:"R\xE9union",ro:"Romania",rs:"Serbia",ru:"Russia",rw:"Rwanda",sa:"Saudi Arabia",sb:"Solomon Islands",sc:"Seychelles",sd:"Sudan",se:"Sweden",sg:"Singapore",sh:"St. Helena",si:"Slovenia",sj:"Svalbard & Jan Mayen",sk:"Slovakia",sl:"Sierra Leone",sm:"San Marino",sn:"Senegal",so:"Somalia",sr:"Suriname",ss:"South Sudan",st:"S\xE3o Tom\xE9 & Pr\xEDncipe",sv:"El Salvador",sx:"Sint Maarten",sy:"Syria",sz:"Eswatini",tc:"Turks & Caicos Islands",td:"Chad",tf:"French Southern Territories",tg:"Togo",th:"Thailand",tj:"Tajikistan",tk:"Tokelau",tl:"Timor-Leste",tm:"Turkmenistan",tn:"Tunisia",to:"Tonga",tr:"Turkey",tt:"Trinidad & Tobago",tv:"Tuvalu",tw:"Taiwan",tz:"Tanzania",ua:"Ukraine",ug:"Uganda",um:"U.S. Outlying Islands",us:"United States",uy:"Uruguay",uz:"Uzbekistan",va:"Vatican City",vc:"St. Vincent & Grenadines",ve:"Venezuela",vg:"British Virgin Islands",vi:"U.S. Virgin Islands",vn:"Vietnam",vu:"Vanuatu",wf:"Wallis & Futuna",ws:"Samoa",ye:"Yemen",yt:"Mayotte",za:"South Africa",zm:"Zambia",zw:"Zimbabwe"};var r2={selectedCountryAriaLabel:"Selected country",noCountrySelected:"No country selected",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",zeroSearchResults:"No results found",oneSearchResult:"1 result found",multipleSearchResults:"${count} results found",ac:"Ascension Island",xk:"Kosovo"};var C1={...i2,...r2};for(let C=0;CC.replace(/\D/g,""),s2=(C="")=>C.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),o2=C=>{let $=l1(C);if($.charAt(0)==="1"){let n=$.substr(1,3);return G2.indexOf(n)!==-1}return!1},H2=(C,$,n,r)=>{if(n===0&&!r)return 0;let u=0;for(let h=0;h<$.length;h++){if(/[+0-9]/.test($[h])&&u++,u===C&&!r)return h+1;if(r&&u===C+1)return h}return $.length},A=(C,$,n)=>{let r=document.createElement(C);return $&&Object.entries($).forEach(([u,h])=>r.setAttribute(u,h)),n&&n.appendChild(r),r},d1=C=>{let{instances:$}=m;Object.values($).forEach(n=>n[C]())},y1=class{constructor($,n={}){this.id=B2++,this.telInput=$,this.highlightedItem=null,this.options=Object.assign({},u2,n),this.hadInitialPlaceholder=!!$.getAttribute("placeholder")}_init(){this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!1),this.options.separateDialCode&&(this.options.allowDropdown=!0,this.options.nationalMode=!1),!this.options.showFlags&&!this.options.separateDialCode&&(this.options.nationalMode=!1),this.options.useFullscreenPopup&&!this.options.dropdownContainer&&(this.options.dropdownContainer=document.body),this.isAndroid=typeof navigator<"u"?/Android/i.test(navigator.userAgent):!1,this.isRTL=!!this.telInput.closest("[dir=rtl]"),this.options.i18n={...C1,...this.options.i18n};let $=new Promise((r,u)=>{this.resolveAutoCountryPromise=r,this.rejectAutoCountryPromise=u}),n=new Promise((r,u)=>{this.resolveUtilsScriptPromise=r,this.rejectUtilsScriptPromise=u});this.promise=Promise.all([$,n]),this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}_processCountryData(){this._processAllCountries(),this._processDialCodes(),this._translateCountryNames(),this.options.countryOrder&&(this.options.countryOrder=this.options.countryOrder.map($=>$.toLowerCase())),this._sortCountries()}_sortCountries(){this.countries.sort(($,n)=>{let{countryOrder:r}=this.options;if(r){let u=r.indexOf($.iso2),h=r.indexOf(n.iso2),g=u>-1,p=h>-1;if(g||p)return g&&p?u-h:g?-1:1}return $.namen.name?1:0})}_addToDialCodeMap($,n,r){n.length>this.dialCodeMaxLen&&(this.dialCodeMaxLen=n.length),this.dialCodeToIso2Map.hasOwnProperty(n)||(this.dialCodeToIso2Map[n]=[]);for(let h=0;hu.toLowerCase());this.countries=K.filter(u=>r.indexOf(u.iso2)>-1)}else if(n.length){let r=n.map(u=>u.toLowerCase());this.countries=K.filter(u=>r.indexOf(u.iso2)===-1)}else this.countries=K}_translateCountryNames(){for(let $=0;$
`),g+=`${u.name}`,g+=`+${u.dialCode}`,h.insertAdjacentHTML("beforeend",g)}}_setInitialState($=!1){let n=this.telInput.getAttribute("value"),r=this.telInput.value,h=n&&n.charAt(0)==="+"&&(!r||r.charAt(0)!=="+")?n:r,g=this._getDialCode(h),p=o2(h),{initialCountry:y,geoIpLookup:I}=this.options,S=y==="auto"&&I;if(g&&!p)this._updateCountryFromNumber(h);else if(!S||$){let b=y?y.toLowerCase():"";b&&this._getCountryData(b,!0)?this._setCountry(b):g&&p?this._setCountry("us"):this._setCountry()}h&&this._updateValFromNumber(h)}_initListeners(){this._initTelInputListeners(),this.options.allowDropdown&&this._initDropdownListeners(),(this.hiddenInput||this.hiddenInputCountry)&&this.telInput.form&&this._initHiddenInputListener()}_initHiddenInputListener(){this._handleHiddenInputSubmit=()=>{this.hiddenInput&&(this.hiddenInput.value=this.getNumber()),this.hiddenInputCountry&&(this.hiddenInputCountry.value=this.getSelectedCountryData().iso2||"")},this.telInput.form?.addEventListener("submit",this._handleHiddenInputSubmit)}_initDropdownListeners(){this._handleLabelClick=n=>{this.dropdownContent.classList.contains("iti__hide")?this.telInput.focus():n.preventDefault()};let $=this.telInput.closest("label");$&&$.addEventListener("click",this._handleLabelClick),this._handleClickSelectedCountry=()=>{this.dropdownContent.classList.contains("iti__hide")&&!this.telInput.disabled&&!this.telInput.readOnly&&this._openDropdown()},this.selectedCountry.addEventListener("click",this._handleClickSelectedCountry),this._handleCountryContainerKeydown=n=>{this.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(n.key)&&(n.preventDefault(),n.stopPropagation(),this._openDropdown()),n.key==="Tab"&&this._closeDropdown()},this.countryContainer.addEventListener("keydown",this._handleCountryContainerKeydown)}_initRequests(){let{utilsScript:$,initialCountry:n,geoIpLookup:r}=this.options;$&&!m.utils?m.documentReady()?m.loadUtils($):window.addEventListener("load",()=>{m.loadUtils($)}):this.resolveUtilsScriptPromise(),n==="auto"&&r&&!this.selectedCountryData.iso2?this._loadAutoCountry():this.resolveAutoCountryPromise()}_loadAutoCountry(){m.autoCountry?this.handleAutoCountry():m.startedLoadingAutoCountry||(m.startedLoadingAutoCountry=!0,typeof this.options.geoIpLookup=="function"&&this.options.geoIpLookup(($="")=>{let n=$.toLowerCase();n&&this._getCountryData(n,!0)?(m.autoCountry=n,setTimeout(()=>d1("handleAutoCountry"))):(this._setInitialState(!0),d1("rejectAutoCountryPromise"))},()=>{this._setInitialState(!0),d1("rejectAutoCountryPromise")}))}_initTelInputListeners(){let{strictMode:$,formatAsYouType:n,separateDialCode:r,formatOnDisplay:u}=this.options,h=!1,g=()=>{this._openDropdown(),this.searchInput.value="+",this._filterCountries("",!0)};this._handleInputEvent=p=>{if(this.isAndroid&&p?.data==="+"&&r){let b=this.telInput.selectionStart||0,w=this.telInput.value.substring(0,b-1),M=this.telInput.value.substring(b);this.telInput.value=w+M,g();return}this._updateCountryFromNumber(this.telInput.value)&&this._triggerCountryChange();let y=p?.data&&/[^+0-9]/.test(p.data),I=p?.inputType==="insertFromPaste"&&this.telInput.value;y||I&&!$?h=!0:/[^+0-9]/.test(this.telInput.value)||(h=!1);let S=p?.detail&&p.detail.isSetNumber&&!u;if(n&&!h&&!S){let b=this.telInput.selectionStart||0,M=this.telInput.value.substring(0,b).replace(/[^+0-9]/g,"").length,R=p?.inputType==="deleteContentForward",z=this._formatNumberAsYouType(),t1=H2(M,z,b,R);this.telInput.value=z,this.telInput.setSelectionRange(t1,t1)}},this.telInput.addEventListener("input",this._handleInputEvent),($||r)&&(this._handleKeydownEvent=p=>{if(p.key&&p.key.length===1&&!p.altKey&&!p.ctrlKey&&!p.metaKey){if(r&&p.key==="+"){p.preventDefault(),g();return}if($){let y=this.telInput.selectionStart===0&&p.key==="+",I=/^[0-9]$/.test(p.key),S=y||I,b=this._getFullNumber(),w=m.utils.getCoreNumber(b,this.selectedCountryData.iso2),M=this.maxCoreNumberLength&&w.length>=this.maxCoreNumberLength,R=this.telInput.value.substring(this.telInput.selectionStart,this.telInput.selectionEnd),z=/\d/.test(R);(!S||M&&!z)&&p.preventDefault()}}},this.telInput.addEventListener("keydown",this._handleKeydownEvent))}_cap($){let n=parseInt(this.telInput.getAttribute("maxlength")||"",10);return n&&$.length>n?$.substr(0,n):$}_trigger($,n={}){let r=new CustomEvent($,{bubbles:!0,cancelable:!0,detail:n});this.telInput.dispatchEvent(r)}_openDropdown(){let{fixDropdownWidth:$}=this.options;$&&(this.dropdownContent.style.width=`${this.telInput.offsetWidth}px`),this.dropdownContent.classList.remove("iti__hide"),this.selectedCountry.setAttribute("aria-expanded","true"),this._setDropdownPosition();let n=this.countryList.firstElementChild;n&&(this._highlightListItem(n,!1),this.countryList.scrollTop=0),this.searchInput.focus(),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}_setDropdownPosition(){if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){let $=this.telInput.getBoundingClientRect(),n=this.telInput.offsetHeight;this.options.dropdownContainer&&(this.dropdown.style.top=`${$.top+n}px`,this.dropdown.style.left=`${$.left}px`,this._handleWindowScroll=()=>this._closeDropdown(),window.addEventListener("scroll",this._handleWindowScroll))}}_bindDropdownListeners(){this._handleMouseoverCountryList=u=>{let h=u.target?.closest(".iti__country");h&&this._highlightListItem(h,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=u=>{let h=u.target?.closest(".iti__country");h&&this._selectListItem(h)},this.countryList.addEventListener("click",this._handleClickCountryList);let $=!0;this._handleClickOffToClose=()=>{$||this._closeDropdown(),$=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose),this._handleKeydownOnDropdown=u=>{["ArrowUp","ArrowDown","Enter","Escape"].includes(u.key)&&(u.preventDefault(),u.stopPropagation(),u.key==="ArrowUp"||u.key==="ArrowDown"?this._handleUpDownKey(u.key):u.key==="Enter"?this._handleEnterKey():u.key==="Escape"&&this._closeDropdown())},document.addEventListener("keydown",this._handleKeydownOnDropdown);let n=()=>{let u=this.searchInput.value.trim();u?this._filterCountries(u):this._filterCountries("",!0)},r=null;this._handleSearchChange=()=>{r&&clearTimeout(r),r=setTimeout(()=>{n(),r=null},100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",u=>u.stopPropagation())}_filterCountries($,n=!1){let r=!0;this.countryList.innerHTML="";let u=s2($);for(let h=0;h1&&(n=$==="ArrowUp"?this.countryList.lastElementChild:this.countryList.firstElementChild),n&&(this._scrollTo(n),this._highlightListItem(n,!1))}_handleEnterKey(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}_updateValFromNumber($){let n=$;if(this.options.formatOnDisplay&&m.utils&&this.selectedCountryData){let r=this.options.nationalMode||n.charAt(0)!=="+"&&!this.options.separateDialCode,{NATIONAL:u,INTERNATIONAL:h}=m.utils.numberFormat,g=r?u:h;n=m.utils.formatNumber(n,this.selectedCountryData.iso2,g)}n=this._beforeSetNumber(n),this.telInput.value=n}_updateCountryFromNumber($){let n=$.indexOf("+"),r=n?$.substring(n):$,u=this.selectedCountryData.dialCode;r&&u==="1"&&r.charAt(0)!=="+"&&(r.charAt(0)!=="1"&&(r=`1${r}`),r=`+${r}`),this.options.separateDialCode&&u&&r.charAt(0)!=="+"&&(r=`+${u}${r}`);let g=this._getDialCode(r,!0),p=l1(r),y=null;if(g){let I=this.dialCodeToIso2Map[l1(g)],S=I.indexOf(this.selectedCountryData.iso2)!==-1&&p.length<=g.length-1;if(!(u==="1"&&o2(p))&&!S){for(let w=0;wg){let b=u-p;n.scrollTop=S-b}}_updateDialCode($){let n=this.telInput.value,r=`+${$}`,u;if(n.charAt(0)==="+"){let h=this._getDialCode(n);h?u=n.replace(h,r):u=r,this.telInput.value=u}}_getDialCode($,n){let r="";if($.charAt(0)==="+"){let u="";for(let h=0;h<$.length;h++){let g=$.charAt(h);if(!isNaN(parseInt(g,10))){if(u+=g,n)this.dialCodeToIso2Map[u]&&(r=$.substr(0,h+1));else if(this.dialCodes[u]){r=$.substr(0,h+1);break}if(u.length===this.dialCodeMaxLen)break}}}return r}_getFullNumber(){let $=this.telInput.value.trim(),{dialCode:n}=this.selectedCountryData,r,u=l1($);return this.options.separateDialCode&&$.charAt(0)!=="+"&&n&&u?r=`+${n}`:r="",r+$}_beforeSetNumber($){let n=$;if(this.options.separateDialCode){let r=this._getDialCode(n);if(r){r=`+${this.selectedCountryData.dialCode}`;let u=n[r.length]===" "||n[r.length]==="-"?r.length+1:r.length;n=n.substr(u)}}return this._cap(n)}_triggerCountryChange(){this._trigger("countrychange")}_formatNumberAsYouType(){let $=this._getFullNumber(),n=m.utils?m.utils.formatNumberAsYouType($,this.selectedCountryData.iso2):$,{dialCode:r}=this.selectedCountryData;return this.options.separateDialCode&&this.telInput.value.charAt(0)!=="+"&&n.includes(`+${r}`)?(n.split(`+${r}`)[1]||"").trim():n}handleAutoCountry(){this.options.initialCountry==="auto"&&m.autoCountry&&(this.defaultCountry=m.autoCountry,this.selectedCountryData.iso2||this.selectedCountryInner.classList.contains("iti__globe")||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}handleUtils(){m.utils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this.selectedCountryData.iso2&&(this._updatePlaceholder(),this._updateMaxLength())),this.resolveUtilsScriptPromise()}destroy(){if(this.options.allowDropdown){this._closeDropdown(),this.selectedCountry.removeEventListener("click",this._handleClickSelectedCountry),this.countryContainer.removeEventListener("keydown",this._handleCountryContainerKeydown);let r=this.telInput.closest("label");r&&r.removeEventListener("click",this._handleLabelClick)}let{form:$}=this.telInput;this._handleHiddenInputSubmit&&$&&$.removeEventListener("submit",this._handleHiddenInputSubmit),this.telInput.removeEventListener("input",this._handleInputEvent),this._handleKeydownEvent&&this.telInput.removeEventListener("keydown",this._handleKeydownEvent),this.telInput.removeAttribute("data-intl-tel-input-id");let n=this.telInput.parentNode;n?.parentNode?.insertBefore(this.telInput,n),n?.parentNode?.removeChild(n),delete m.instances[this.id]}getExtension(){return m.utils?m.utils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}getNumber($){if(m.utils){let{iso2:n}=this.selectedCountryData;return m.utils.formatNumber(this._getFullNumber(),n,$)}return""}getNumberType(){return m.utils?m.utils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}getSelectedCountryData(){return this.selectedCountryData}getValidationError(){if(m.utils){let{iso2:$}=this.selectedCountryData;return m.utils.getValidationError(this._getFullNumber(),$)}return-99}isValidNumber(){let $=this._getFullNumber();return/\p{L}/u.test($)?!1:m.utils?m.utils.isPossibleNumber($,this.selectedCountryData.iso2,this.options.validationNumberType):null}isValidNumberPrecise(){let $=this._getFullNumber();return/\p{L}/u.test($)?!1:m.utils?m.utils.isValidNumber($,this.selectedCountryData.iso2):null}setCountry($){let n=$?.toLowerCase(),r=this.selectedCountryData.iso2;($&&n!==r||!$&&r)&&(this._setCountry(n),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}setNumber($){let n=this._updateCountryFromNumber($);this._updateValFromNumber($),n&&this._triggerCountryChange(),this._trigger("input",{isSetNumber:!0})}setPlaceholderNumberType($){this.options.placeholderNumberType=$,this._updatePlaceholder()}},U2=C=>!m.utils&&!m.startedLoadingUtilsScript?(m.startedLoadingUtilsScript=!0,new Promise(($,n)=>{import(/* webpackIgnore: true */ C).then(({default:r})=>{m.utils=r,d1("handleUtils"),$(!0)}).catch(()=>{d1("rejectUtilsScriptPromise"),n()})})):null,m=Object.assign((C,$)=>{let n=new y1(C,$);return n._init(),C.setAttribute("data-intl-tel-input-id",n.id.toString()),m.instances[n.id]=n,n},{defaults:u2,documentReady:()=>document.readyState==="complete",getCountryData:()=>K,getInstance:C=>{let $=C.getAttribute("data-intl-tel-input-id");return $?m.instances[$]:null},instances:{},loadUtils:U2,version:"23.1.1"}),v1=m;(function(){var C=this||self;function $(d,t){d=d.split(".");var e=C;d[0]in e||typeof e.execScript>"u"||e.execScript("var "+d[0]);for(var i;d.length&&(i=d.shift());)d.length||t===void 0?e[i]&&e[i]!==Object.prototype[i]?e=e[i]:e=e[i]={}:e[i]=t}function n(d,t){function e(){}e.prototype=t.prototype,d.ma=t.prototype,d.prototype=new e,d.prototype.constructor=d,d.sa=function(i,s,o){for(var a=Array(arguments.length-2),l=2;ld.length?!1:O(T2,d)}function x1(d){return O(_2,d)?i1(d,C2):i1(d,c1)}function P1(d){var t=x1(d.toString());P(d),d.g(t)}function k1(d){return d!=null&&(G(d,9)!=1||N(d,9)[0]!=-1)}function i1(d,t){for(var e=new T,i,s=d.length,o=0;ot?2:o[o.length-1]=s&&s<=i;++s)if(e=parseInt(d.substring(0,s),10),e in Y)return t.g(d.substring(s)),e;return 0}function U1(d,t,e,i,s,o){if(t.length==0)return 0;t=new T(t);var a;e!=null&&(a=c(e,11)),a==null&&(a="NonMatch");var l=t.toString();if(l.length==0)a=20;else if(J.test(l))l=l.replace(J,""),P(t),t.g(x1(l)),a=1;else{if(l=new RegExp(a),P1(t),a=t.toString(),a.search(l)==0){l=a.match(l)[0].length;var f=a.substring(l).match(A1);f&&f[1]!=null&&0=t.h.length)throw Error("Phone number too short after IDD");if(d=H1(t,i),d!=0)return L(o,1,d),d;throw Error("Invalid country calling code")}return e!=null&&(a=v(e,10),l=""+a,f=t.toString(),f.lastIndexOf(l,0)==0&&(l=new T(f.substring(l.length)),f=c(e,1),f=new RegExp(v(f,2)),K1(l,e,null),l=l.toString(),!O(f,t.toString())&&O(f,l)||o1(d,t.toString(),e,-1)==3))?(i.g(l),s&&L(o,6,10),L(o,1,a),a):(L(o,1,0),0)}function K1(d,t,e){var i=d.toString(),s=i.length,o=c(t,15);if(s!=0&&o!=null&&o.length!=0){var a=new RegExp("^(?:"+o+")");if(s=a.exec(i)){o=new RegExp(v(c(t,1),2));var l=O(o,i),f=s.length-1;t=c(t,16),t==null||t.length==0||s[f]==null||s[f].length==0?(!l||O(o,i.substring(s[0].length)))&&(e!=null&&0=t.length)o="";else{var a=t.indexOf(";",o);o=a!==-1?t.substring(o,a):t.substring(o)}var l=o;if(l==null?a=!0:l.length===0?a=!1:(a=S2.exec(l),l=w2.exec(l),a=a!==null||l!==null),!a||(o!=null?(o.charAt(0)==="+"&&s.g(o),o=t.indexOf("tel:"),s.g(t.substring(0<=o?o+4:0,t.indexOf(";phone-context=")))):(o=s.g,a=t??"",l=a.search(v2),0<=l?(a=a.substring(l),a=a.replace(b2,""),l=a.search(I2),0<=l&&(a=a.substring(0,l))):a="",o.call(s,a)),o=s.toString(),a=o.indexOf(";isub="),0t.h.length||(a!=null&&(e=new T,s=new T(t.toString()),K1(s,a,e),d=o1(d,s.toString(),a,-1),d!=2&&d!=4&&d!=5&&(t=s,i&&0d))throw Error("The string supplied is too short to be a phone number");if(17{try{let e=d.replace(/[^+0-9]/g,""),i=new A2(t);t="";for(let s=0;s{try{let s=E.g(),o=V(s,d,t);var i=u1(s,o,-1);return i==0||i==4?s.format(o,typeof e>"u"?0:e):d}catch{return d}}),$("intlTelInputUtilsTemp.getExampleNumber",(d,t,e,i)=>{try{let f=E.g();d:{var s=f;if(r1(d)){var o=s1(U(s,d),e);try{if(x(o,6)){var a=c(o,6),l=F1(s,a,d,!1);break d}}catch{}}l=null}return f.format(l,i?0:t?2:1)}catch{return""}}),$("intlTelInputUtilsTemp.getExtension",(d,t)=>{try{return c(V(E.g(),d,t),3)}catch{return""}}),$("intlTelInputUtilsTemp.getNumberType",(d,t)=>{try{let a=E.g(),l=V(a,d,t);var e=B1(a,l),i=q(a,v(l,1),e);if(i==null)var s=-1;else{var o=X(l);s=p1(o,i)}return s}catch{return-99}}),$("intlTelInputUtilsTemp.getValidationError",(d,t)=>{try{let e=E.g(),i=V(e,d,t);return u1(e,i,-1)}catch(e){return e.message==="Invalid country calling code"?1:3>=d.length||e.message==="Phone number too short after IDD"||e.message==="The string supplied is too short to be a phone number"?2:e.message==="The string supplied is too long to be a phone number"?3:-99}}),$("intlTelInputUtilsTemp.isValidNumber",(d,t)=>{try{let f=E.g();var e=V(f,d,t),i=B1(f,e);d=f;var s=v(e,1),o=q(d,s,i);if(o==null||i!="001"&&s!=G1(d,i))var a=!1;else{var l=X(e);a=p1(l,o)!=-1}return a}catch{return!1}}),$("intlTelInputUtilsTemp.isPossibleNumber",(d,t,e)=>{try{let i=E.g(),s=V(i,d,t);return e?u1(i,s,e2[e])===0:u1(i,s,-1)===0}catch{return!1}}),$("intlTelInputUtilsTemp.getCoreNumber",(d,t)=>{try{return c(V(E.g(),d,t),2).toString()}catch{return""}}),$("intlTelInputUtilsTemp.numberFormat",{E164:0,INTERNATIONAL:1,NATIONAL:2,RFC3966:3}),$("intlTelInputUtilsTemp.numberType",e2),$("intlTelInputUtilsTemp.validationError",{IS_POSSIBLE:0,INVALID_COUNTRY_CODE:1,TOO_SHORT:2,TOO_LONG:3,IS_POSSIBLE_LOCAL_ONLY:4,INVALID_LENGTH:5})})();var K2=window.intlTelInputUtilsTemp;delete window.intlTelInputUtilsTemp;var a2=K2;v1.utils=a2;var F2=v1;return O2(j2);})(); +var factoryOutput=(()=>{var m1=Object.defineProperty;var D2=Object.getOwnPropertyDescriptor;var x2=Object.getOwnPropertyNames;var P2=Object.prototype.hasOwnProperty;var k2=(C,$)=>{for(var n in $)m1(C,n,{get:$[n],enumerable:!0})},R2=(C,$,n,r)=>{if($&&typeof $=="object"||typeof $=="function")for(let u of x2($))!P2.call(C,u)&&u!==n&&m1(C,u,{get:()=>$[u],enumerable:!(r=D2($,u))||r.enumerable});return C};var O2=C=>R2(m1({},"__esModule",{value:!0}),C);var j2={};k2(j2,{default:()=>F2});var $2=[["af","93"],["al","355"],["dz","213"],["as","1",5,["684"]],["ad","376"],["ao","244"],["ai","1",6,["264"]],["ag","1",7,["268"]],["ar","54"],["am","374"],["aw","297"],["ac","247"],["au","61",0],["at","43"],["az","994"],["bs","1",8,["242"]],["bh","973"],["bd","880"],["bb","1",9,["246"]],["by","375"],["be","32"],["bz","501"],["bj","229"],["bm","1",10,["441"]],["bt","975"],["bo","591"],["ba","387"],["bw","267"],["br","55"],["io","246"],["vg","1",11,["284"]],["bn","673"],["bg","359"],["bf","226"],["bi","257"],["kh","855"],["cm","237"],["ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","879","902","905"]],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"]],["cf","236"],["td","235"],["cl","56"],["cn","86"],["cx","61",2,["89164"]],["cc","61",1,["89162"]],["co","57"],["km","269"],["cg","242"],["cd","243"],["ck","682"],["cr","506"],["ci","225"],["hr","385"],["cu","53"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"]],["do","1",2,["809","829","849"]],["ec","593"],["eg","20"],["sv","503"],["gq","240"],["er","291"],["ee","372"],["sz","268"],["et","251"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0],["fr","33"],["gf","594"],["pf","689"],["ga","241"],["gm","220"],["ge","995"],["de","49"],["gh","233"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"]],["gp","590",0],["gu","1",15,["671"]],["gt","502"],["gg","44",1,["1481","7781","7839","7911"]],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36"],["is","354"],["in","91"],["id","62"],["ir","98"],["iq","964"],["ie","353"],["im","44",2,["1624","74576","7524","7924","7624"]],["il","972"],["it","39",0],["jm","1",4,["876","658"]],["jp","81"],["je","44",3,["1534","7509","7700","7797","7829","7937"]],["jo","962"],["kz","7",1,["33","7"]],["ke","254"],["ki","686"],["xk","383"],["kw","965"],["kg","996"],["la","856"],["lv","371"],["lb","961"],["ls","266"],["lr","231"],["ly","218"],["li","423"],["lt","370"],["lu","352"],["mo","853"],["mg","261"],["mw","265"],["my","60"],["mv","960"],["ml","223"],["mt","356"],["mh","692"],["mq","596"],["mr","222"],["mu","230"],["yt","262",1,["269","639"]],["mx","52"],["fm","691"],["md","373"],["mc","377"],["mn","976"],["me","382"],["ms","1",16,["664"]],["ma","212",0],["mz","258"],["mm","95"],["na","264"],["nr","674"],["np","977"],["nl","31"],["nc","687"],["nz","64"],["ni","505"],["ne","227"],["ng","234"],["nu","683"],["nf","672"],["kp","850"],["mk","389"],["mp","1",17,["670"]],["no","47",0],["om","968"],["pk","92"],["pw","680"],["ps","970"],["pa","507"],["pg","675"],["py","595"],["pe","51"],["ph","63"],["pl","48"],["pt","351"],["pr","1",3,["787","939"]],["qa","974"],["re","262",0],["ro","40"],["ru","7",0],["rw","250"],["ws","685"],["sm","378"],["st","239"],["sa","966"],["sn","221"],["rs","381"],["sc","248"],["sl","232"],["sg","65"],["sx","1",21,["721"]],["sk","421"],["si","386"],["sb","677"],["so","252"],["za","27"],["kr","82"],["ss","211"],["es","34"],["lk","94"],["bl","590",1],["sh","290"],["kn","1",18,["869"]],["lc","1",19,["758"]],["mf","590",2],["pm","508"],["vc","1",20,["784"]],["sd","249"],["sr","597"],["sj","47",1,["79"]],["se","46"],["ch","41"],["sy","963"],["tw","886"],["tj","992"],["tz","255"],["th","66"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"]],["tn","216"],["tr","90"],["tm","993"],["tc","1",23,["649"]],["tv","688"],["ug","256"],["ua","380"],["ae","971"],["gb","44",0],["us","1",0],["uy","598"],["vi","1",24,["340"]],["uz","998"],["vu","678"],["va","39",1,["06698"]],["ve","58"],["vn","84"],["wf","681"],["eh","212",1,["5288","5289"]],["ye","967"],["zm","260"],["zw","263"],["ax","358",1,["18"]]],n2=[];for(let C=0;C<$2.length;C++){let $=$2[C];n2[C]={name:"",iso2:$[0],dialCode:$[1],priority:$[2]||0,areaCodes:$[3]||null,nodeById:{}}}var K=n2;var i2={ad:"Andorra",ae:"United Arab Emirates",af:"Afghanistan",ag:"Antigua & Barbuda",ai:"Anguilla",al:"Albania",am:"Armenia",ao:"Angola",aq:"Antarctica",ar:"Argentina",as:"American Samoa",at:"Austria",au:"Australia",aw:"Aruba",ax:"\xC5land Islands",az:"Azerbaijan",ba:"Bosnia & Herzegovina",bb:"Barbados",bd:"Bangladesh",be:"Belgium",bf:"Burkina Faso",bg:"Bulgaria",bh:"Bahrain",bi:"Burundi",bj:"Benin",bl:"St. Barth\xE9lemy",bm:"Bermuda",bn:"Brunei",bo:"Bolivia",bq:"Caribbean Netherlands",br:"Brazil",bs:"Bahamas",bt:"Bhutan",bv:"Bouvet Island",bw:"Botswana",by:"Belarus",bz:"Belize",ca:"Canada",cc:"Cocos (Keeling) Islands",cd:"Congo - Kinshasa",cf:"Central African Republic",cg:"Congo - Brazzaville",ch:"Switzerland",ci:"C\xF4te d\u2019Ivoire",ck:"Cook Islands",cl:"Chile",cm:"Cameroon",cn:"China",co:"Colombia",cr:"Costa Rica",cu:"Cuba",cv:"Cape Verde",cw:"Cura\xE7ao",cx:"Christmas Island",cy:"Cyprus",cz:"Czechia",de:"Germany",dj:"Djibouti",dk:"Denmark",dm:"Dominica",do:"Dominican Republic",dz:"Algeria",ec:"Ecuador",ee:"Estonia",eg:"Egypt",eh:"Western Sahara",er:"Eritrea",es:"Spain",et:"Ethiopia",fi:"Finland",fj:"Fiji",fk:"Falkland Islands",fm:"Micronesia",fo:"Faroe Islands",fr:"France",ga:"Gabon",gb:"United Kingdom",gd:"Grenada",ge:"Georgia",gf:"French Guiana",gg:"Guernsey",gh:"Ghana",gi:"Gibraltar",gl:"Greenland",gm:"Gambia",gn:"Guinea",gp:"Guadeloupe",gq:"Equatorial Guinea",gr:"Greece",gs:"South Georgia & South Sandwich Islands",gt:"Guatemala",gu:"Guam",gw:"Guinea-Bissau",gy:"Guyana",hk:"Hong Kong SAR China",hm:"Heard & McDonald Islands",hn:"Honduras",hr:"Croatia",ht:"Haiti",hu:"Hungary",id:"Indonesia",ie:"Ireland",il:"Israel",im:"Isle of Man",in:"India",io:"British Indian Ocean Territory",iq:"Iraq",ir:"Iran",is:"Iceland",it:"Italy",je:"Jersey",jm:"Jamaica",jo:"Jordan",jp:"Japan",ke:"Kenya",kg:"Kyrgyzstan",kh:"Cambodia",ki:"Kiribati",km:"Comoros",kn:"St. Kitts & Nevis",kp:"North Korea",kr:"South Korea",kw:"Kuwait",ky:"Cayman Islands",kz:"Kazakhstan",la:"Laos",lb:"Lebanon",lc:"St. Lucia",li:"Liechtenstein",lk:"Sri Lanka",lr:"Liberia",ls:"Lesotho",lt:"Lithuania",lu:"Luxembourg",lv:"Latvia",ly:"Libya",ma:"Morocco",mc:"Monaco",md:"Moldova",me:"Montenegro",mf:"St. Martin",mg:"Madagascar",mh:"Marshall Islands",mk:"North Macedonia",ml:"Mali",mm:"Myanmar (Burma)",mn:"Mongolia",mo:"Macao SAR China",mp:"Northern Mariana Islands",mq:"Martinique",mr:"Mauritania",ms:"Montserrat",mt:"Malta",mu:"Mauritius",mv:"Maldives",mw:"Malawi",mx:"Mexico",my:"Malaysia",mz:"Mozambique",na:"Namibia",nc:"New Caledonia",ne:"Niger",nf:"Norfolk Island",ng:"Nigeria",ni:"Nicaragua",nl:"Netherlands",no:"Norway",np:"Nepal",nr:"Nauru",nu:"Niue",nz:"New Zealand",om:"Oman",pa:"Panama",pe:"Peru",pf:"French Polynesia",pg:"Papua New Guinea",ph:"Philippines",pk:"Pakistan",pl:"Poland",pm:"St. Pierre & Miquelon",pn:"Pitcairn Islands",pr:"Puerto Rico",ps:"Palestinian Territories",pt:"Portugal",pw:"Palau",py:"Paraguay",qa:"Qatar",re:"R\xE9union",ro:"Romania",rs:"Serbia",ru:"Russia",rw:"Rwanda",sa:"Saudi Arabia",sb:"Solomon Islands",sc:"Seychelles",sd:"Sudan",se:"Sweden",sg:"Singapore",sh:"St. Helena",si:"Slovenia",sj:"Svalbard & Jan Mayen",sk:"Slovakia",sl:"Sierra Leone",sm:"San Marino",sn:"Senegal",so:"Somalia",sr:"Suriname",ss:"South Sudan",st:"S\xE3o Tom\xE9 & Pr\xEDncipe",sv:"El Salvador",sx:"Sint Maarten",sy:"Syria",sz:"Eswatini",tc:"Turks & Caicos Islands",td:"Chad",tf:"French Southern Territories",tg:"Togo",th:"Thailand",tj:"Tajikistan",tk:"Tokelau",tl:"Timor-Leste",tm:"Turkmenistan",tn:"Tunisia",to:"Tonga",tr:"Turkey",tt:"Trinidad & Tobago",tv:"Tuvalu",tw:"Taiwan",tz:"Tanzania",ua:"Ukraine",ug:"Uganda",um:"U.S. Outlying Islands",us:"United States",uy:"Uruguay",uz:"Uzbekistan",va:"Vatican City",vc:"St. Vincent & Grenadines",ve:"Venezuela",vg:"British Virgin Islands",vi:"U.S. Virgin Islands",vn:"Vietnam",vu:"Vanuatu",wf:"Wallis & Futuna",ws:"Samoa",ye:"Yemen",yt:"Mayotte",za:"South Africa",zm:"Zambia",zw:"Zimbabwe"};var r2={selectedCountryAriaLabel:"Selected country",noCountrySelected:"No country selected",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",zeroSearchResults:"No results found",oneSearchResult:"1 result found",multipleSearchResults:"${count} results found",ac:"Ascension Island",xk:"Kosovo"};var C1={...i2,...r2};for(let C=0;CC.replace(/\D/g,""),s2=(C="")=>C.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),o2=C=>{let $=l1(C);if($.charAt(0)==="1"){let n=$.substr(1,3);return G2.indexOf(n)!==-1}return!1},H2=(C,$,n,r)=>{if(n===0&&!r)return 0;let u=0;for(let h=0;h<$.length;h++){if(/[+0-9]/.test($[h])&&u++,u===C&&!r)return h+1;if(r&&u===C+1)return h}return $.length},A=(C,$,n)=>{let r=document.createElement(C);return $&&Object.entries($).forEach(([u,h])=>r.setAttribute(u,h)),n&&n.appendChild(r),r},d1=C=>{let{instances:$}=m;Object.values($).forEach(n=>n[C]())},y1=class{constructor($,n={}){this.id=B2++,this.telInput=$,this.highlightedItem=null,this.options=Object.assign({},u2,n),this.hadInitialPlaceholder=!!$.getAttribute("placeholder")}_init(){this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!1),this.options.separateDialCode&&(this.options.allowDropdown=!0,this.options.nationalMode=!1),!this.options.showFlags&&!this.options.separateDialCode&&(this.options.nationalMode=!1),this.options.useFullscreenPopup&&!this.options.dropdownContainer&&(this.options.dropdownContainer=document.body),this.isAndroid=typeof navigator<"u"?/Android/i.test(navigator.userAgent):!1,this.isRTL=!!this.telInput.closest("[dir=rtl]"),this.options.i18n={...C1,...this.options.i18n};let $=new Promise((r,u)=>{this.resolveAutoCountryPromise=r,this.rejectAutoCountryPromise=u}),n=new Promise((r,u)=>{this.resolveUtilsScriptPromise=r,this.rejectUtilsScriptPromise=u});this.promise=Promise.all([$,n]),this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}_processCountryData(){this._processAllCountries(),this._processDialCodes(),this._translateCountryNames(),this.options.countryOrder&&(this.options.countryOrder=this.options.countryOrder.map($=>$.toLowerCase())),this._sortCountries()}_sortCountries(){this.countries.sort(($,n)=>{let{countryOrder:r}=this.options;if(r){let u=r.indexOf($.iso2),h=r.indexOf(n.iso2),g=u>-1,p=h>-1;if(g||p)return g&&p?u-h:g?-1:1}return $.namen.name?1:0})}_addToDialCodeMap($,n,r){n.length>this.dialCodeMaxLen&&(this.dialCodeMaxLen=n.length),this.dialCodeToIso2Map.hasOwnProperty(n)||(this.dialCodeToIso2Map[n]=[]);for(let h=0;hu.toLowerCase());this.countries=K.filter(u=>r.indexOf(u.iso2)>-1)}else if(n.length){let r=n.map(u=>u.toLowerCase());this.countries=K.filter(u=>r.indexOf(u.iso2)===-1)}else this.countries=K}_translateCountryNames(){for(let $=0;$
`),g+=`${u.name}`,g+=`+${u.dialCode}`,h.insertAdjacentHTML("beforeend",g)}}_setInitialState($=!1){let n=this.telInput.getAttribute("value"),r=this.telInput.value,h=n&&n.charAt(0)==="+"&&(!r||r.charAt(0)!=="+")?n:r,g=this._getDialCode(h),p=o2(h),{initialCountry:y,geoIpLookup:I}=this.options,S=y==="auto"&&I;if(g&&!p)this._updateCountryFromNumber(h);else if(!S||$){let b=y?y.toLowerCase():"";b&&this._getCountryData(b,!0)?this._setCountry(b):g&&p?this._setCountry("us"):this._setCountry()}h&&this._updateValFromNumber(h)}_initListeners(){this._initTelInputListeners(),this.options.allowDropdown&&this._initDropdownListeners(),(this.hiddenInput||this.hiddenInputCountry)&&this.telInput.form&&this._initHiddenInputListener()}_initHiddenInputListener(){this._handleHiddenInputSubmit=()=>{this.hiddenInput&&(this.hiddenInput.value=this.getNumber()),this.hiddenInputCountry&&(this.hiddenInputCountry.value=this.getSelectedCountryData().iso2||"")},this.telInput.form?.addEventListener("submit",this._handleHiddenInputSubmit)}_initDropdownListeners(){this._handleLabelClick=n=>{this.dropdownContent.classList.contains("iti__hide")?this.telInput.focus():n.preventDefault()};let $=this.telInput.closest("label");$&&$.addEventListener("click",this._handleLabelClick),this._handleClickSelectedCountry=()=>{this.dropdownContent.classList.contains("iti__hide")&&!this.telInput.disabled&&!this.telInput.readOnly&&this._openDropdown()},this.selectedCountry.addEventListener("click",this._handleClickSelectedCountry),this._handleCountryContainerKeydown=n=>{this.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(n.key)&&(n.preventDefault(),n.stopPropagation(),this._openDropdown()),n.key==="Tab"&&this._closeDropdown()},this.countryContainer.addEventListener("keydown",this._handleCountryContainerKeydown)}_initRequests(){let{utilsScript:$,initialCountry:n,geoIpLookup:r}=this.options;$&&!m.utils?m.documentReady()?m.loadUtils($):window.addEventListener("load",()=>{m.loadUtils($)}):this.resolveUtilsScriptPromise(),n==="auto"&&r&&!this.selectedCountryData.iso2?this._loadAutoCountry():this.resolveAutoCountryPromise()}_loadAutoCountry(){m.autoCountry?this.handleAutoCountry():m.startedLoadingAutoCountry||(m.startedLoadingAutoCountry=!0,typeof this.options.geoIpLookup=="function"&&this.options.geoIpLookup(($="")=>{let n=$.toLowerCase();n&&this._getCountryData(n,!0)?(m.autoCountry=n,setTimeout(()=>d1("handleAutoCountry"))):(this._setInitialState(!0),d1("rejectAutoCountryPromise"))},()=>{this._setInitialState(!0),d1("rejectAutoCountryPromise")}))}_initTelInputListeners(){let{strictMode:$,formatAsYouType:n,separateDialCode:r,formatOnDisplay:u}=this.options,h=!1,g=()=>{this._openDropdown(),this.searchInput.value="+",this._filterCountries("",!0)};this._handleInputEvent=p=>{if(this.isAndroid&&p?.data==="+"&&r){let b=this.telInput.selectionStart||0,w=this.telInput.value.substring(0,b-1),M=this.telInput.value.substring(b);this.telInput.value=w+M,g();return}this._updateCountryFromNumber(this.telInput.value)&&this._triggerCountryChange();let y=p?.data&&/[^+0-9]/.test(p.data),I=p?.inputType==="insertFromPaste"&&this.telInput.value;y||I&&!$?h=!0:/[^+0-9]/.test(this.telInput.value)||(h=!1);let S=p?.detail&&p.detail.isSetNumber&&!u;if(n&&!h&&!S){let b=this.telInput.selectionStart||0,M=this.telInput.value.substring(0,b).replace(/[^+0-9]/g,"").length,R=p?.inputType==="deleteContentForward",z=this._formatNumberAsYouType(),t1=H2(M,z,b,R);this.telInput.value=z,this.telInput.setSelectionRange(t1,t1)}},this.telInput.addEventListener("input",this._handleInputEvent),($||r)&&(this._handleKeydownEvent=p=>{if(p.key&&p.key.length===1&&!p.altKey&&!p.ctrlKey&&!p.metaKey){if(r&&p.key==="+"){p.preventDefault(),g();return}if($){let y=this.telInput.selectionStart===0&&p.key==="+",I=/^[0-9]$/.test(p.key),S=y||I,b=this._getFullNumber(),w=m.utils.getCoreNumber(b,this.selectedCountryData.iso2),M=this.maxCoreNumberLength&&w.length>=this.maxCoreNumberLength,R=this.telInput.value.substring(this.telInput.selectionStart,this.telInput.selectionEnd),z=/\d/.test(R);(!S||M&&!z)&&p.preventDefault()}}},this.telInput.addEventListener("keydown",this._handleKeydownEvent))}_cap($){let n=parseInt(this.telInput.getAttribute("maxlength")||"",10);return n&&$.length>n?$.substr(0,n):$}_trigger($,n={}){let r=new CustomEvent($,{bubbles:!0,cancelable:!0,detail:n});this.telInput.dispatchEvent(r)}_openDropdown(){let{fixDropdownWidth:$}=this.options;$&&(this.dropdownContent.style.width=`${this.telInput.offsetWidth}px`),this.dropdownContent.classList.remove("iti__hide"),this.selectedCountry.setAttribute("aria-expanded","true"),this._setDropdownPosition();let n=this.countryList.firstElementChild;n&&(this._highlightListItem(n,!1),this.countryList.scrollTop=0),this.searchInput.focus(),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}_setDropdownPosition(){if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){let $=this.telInput.getBoundingClientRect(),n=this.telInput.offsetHeight;this.options.dropdownContainer&&(this.dropdown.style.top=`${$.top+n}px`,this.dropdown.style.left=`${$.left}px`,this._handleWindowScroll=()=>this._closeDropdown(),window.addEventListener("scroll",this._handleWindowScroll))}}_bindDropdownListeners(){this._handleMouseoverCountryList=u=>{let h=u.target?.closest(".iti__country");h&&this._highlightListItem(h,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=u=>{let h=u.target?.closest(".iti__country");h&&this._selectListItem(h)},this.countryList.addEventListener("click",this._handleClickCountryList);let $=!0;this._handleClickOffToClose=()=>{$||this._closeDropdown(),$=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose),this._handleKeydownOnDropdown=u=>{["ArrowUp","ArrowDown","Enter","Escape"].includes(u.key)&&(u.preventDefault(),u.stopPropagation(),u.key==="ArrowUp"||u.key==="ArrowDown"?this._handleUpDownKey(u.key):u.key==="Enter"?this._handleEnterKey():u.key==="Escape"&&this._closeDropdown())},document.addEventListener("keydown",this._handleKeydownOnDropdown);let n=()=>{let u=this.searchInput.value.trim();u?this._filterCountries(u):this._filterCountries("",!0)},r=null;this._handleSearchChange=()=>{r&&clearTimeout(r),r=setTimeout(()=>{n(),r=null},100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",u=>u.stopPropagation())}_filterCountries($,n=!1){let r=!0;this.countryList.innerHTML="";let u=s2($);for(let h=0;h1&&(n=$==="ArrowUp"?this.countryList.lastElementChild:this.countryList.firstElementChild),n&&(this._scrollTo(n),this._highlightListItem(n,!1))}_handleEnterKey(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}_updateValFromNumber($){let n=$;if(this.options.formatOnDisplay&&m.utils&&this.selectedCountryData){let r=this.options.nationalMode||n.charAt(0)!=="+"&&!this.options.separateDialCode,{NATIONAL:u,INTERNATIONAL:h}=m.utils.numberFormat,g=r?u:h;n=m.utils.formatNumber(n,this.selectedCountryData.iso2,g)}n=this._beforeSetNumber(n),this.telInput.value=n}_updateCountryFromNumber($){let n=$.indexOf("+"),r=n?$.substring(n):$,u=this.selectedCountryData.dialCode;r&&u==="1"&&r.charAt(0)!=="+"&&(r.charAt(0)!=="1"&&(r=`1${r}`),r=`+${r}`),this.options.separateDialCode&&u&&r.charAt(0)!=="+"&&(r=`+${u}${r}`);let g=this._getDialCode(r,!0),p=l1(r),y=null;if(g){let I=this.dialCodeToIso2Map[l1(g)],S=I.indexOf(this.selectedCountryData.iso2)!==-1&&p.length<=g.length-1;if(!(u==="1"&&o2(p))&&!S){for(let w=0;wg){let b=u-p;n.scrollTop=S-b}}_updateDialCode($){let n=this.telInput.value,r=`+${$}`,u;if(n.charAt(0)==="+"){let h=this._getDialCode(n);h?u=n.replace(h,r):u=r,this.telInput.value=u}}_getDialCode($,n){let r="";if($.charAt(0)==="+"){let u="";for(let h=0;h<$.length;h++){let g=$.charAt(h);if(!isNaN(parseInt(g,10))){if(u+=g,n)this.dialCodeToIso2Map[u]&&(r=$.substr(0,h+1));else if(this.dialCodes[u]){r=$.substr(0,h+1);break}if(u.length===this.dialCodeMaxLen)break}}}return r}_getFullNumber(){let $=this.telInput.value.trim(),{dialCode:n}=this.selectedCountryData,r,u=l1($);return this.options.separateDialCode&&$.charAt(0)!=="+"&&n&&u?r=`+${n}`:r="",r+$}_beforeSetNumber($){let n=$;if(this.options.separateDialCode){let r=this._getDialCode(n);if(r){r=`+${this.selectedCountryData.dialCode}`;let u=n[r.length]===" "||n[r.length]==="-"?r.length+1:r.length;n=n.substr(u)}}return this._cap(n)}_triggerCountryChange(){this._trigger("countrychange")}_formatNumberAsYouType(){let $=this._getFullNumber(),n=m.utils?m.utils.formatNumberAsYouType($,this.selectedCountryData.iso2):$,{dialCode:r}=this.selectedCountryData;return this.options.separateDialCode&&this.telInput.value.charAt(0)!=="+"&&n.includes(`+${r}`)?(n.split(`+${r}`)[1]||"").trim():n}handleAutoCountry(){this.options.initialCountry==="auto"&&m.autoCountry&&(this.defaultCountry=m.autoCountry,this.selectedCountryData.iso2||this.selectedCountryInner.classList.contains("iti__globe")||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}handleUtils(){m.utils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this.selectedCountryData.iso2&&(this._updatePlaceholder(),this._updateMaxLength())),this.resolveUtilsScriptPromise()}destroy(){if(this.options.allowDropdown){this._closeDropdown(),this.selectedCountry.removeEventListener("click",this._handleClickSelectedCountry),this.countryContainer.removeEventListener("keydown",this._handleCountryContainerKeydown);let r=this.telInput.closest("label");r&&r.removeEventListener("click",this._handleLabelClick)}let{form:$}=this.telInput;this._handleHiddenInputSubmit&&$&&$.removeEventListener("submit",this._handleHiddenInputSubmit),this.telInput.removeEventListener("input",this._handleInputEvent),this._handleKeydownEvent&&this.telInput.removeEventListener("keydown",this._handleKeydownEvent),this.telInput.removeAttribute("data-intl-tel-input-id");let n=this.telInput.parentNode;n?.parentNode?.insertBefore(this.telInput,n),n?.parentNode?.removeChild(n),delete m.instances[this.id]}getExtension(){return m.utils?m.utils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}getNumber($){if(m.utils){let{iso2:n}=this.selectedCountryData;return m.utils.formatNumber(this._getFullNumber(),n,$)}return""}getNumberType(){return m.utils?m.utils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}getSelectedCountryData(){return this.selectedCountryData}getValidationError(){if(m.utils){let{iso2:$}=this.selectedCountryData;return m.utils.getValidationError(this._getFullNumber(),$)}return-99}isValidNumber(){let $=this._getFullNumber();return/\p{L}/u.test($)?!1:m.utils?m.utils.isPossibleNumber($,this.selectedCountryData.iso2,this.options.validationNumberType):null}isValidNumberPrecise(){let $=this._getFullNumber();return/\p{L}/u.test($)?!1:m.utils?m.utils.isValidNumber($,this.selectedCountryData.iso2):null}setCountry($){let n=$?.toLowerCase(),r=this.selectedCountryData.iso2;($&&n!==r||!$&&r)&&(this._setCountry(n),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}setNumber($){let n=this._updateCountryFromNumber($);this._updateValFromNumber($),n&&this._triggerCountryChange(),this._trigger("input",{isSetNumber:!0})}setPlaceholderNumberType($){this.options.placeholderNumberType=$,this._updatePlaceholder()}},U2=C=>!m.utils&&!m.startedLoadingUtilsScript?(m.startedLoadingUtilsScript=!0,new Promise(($,n)=>{import_INTENTIONALLY_BROKEN(/* webpackIgnore: true */ C).then(({default:r})=>{m.utils=r,d1("handleUtils"),$(!0)}).catch(()=>{d1("rejectUtilsScriptPromise"),n()})})):null,m=Object.assign((C,$)=>{let n=new y1(C,$);return n._init(),C.setAttribute("data-intl-tel-input-id",n.id.toString()),m.instances[n.id]=n,n},{defaults:u2,documentReady:()=>document.readyState==="complete",getCountryData:()=>K,getInstance:C=>{let $=C.getAttribute("data-intl-tel-input-id");return $?m.instances[$]:null},instances:{},loadUtils:U2,version:"23.1.1"}),v1=m;(function(){var C=this||self;function $(d,t){d=d.split(".");var e=C;d[0]in e||typeof e.execScript>"u"||e.execScript("var "+d[0]);for(var i;d.length&&(i=d.shift());)d.length||t===void 0?e[i]&&e[i]!==Object.prototype[i]?e=e[i]:e=e[i]={}:e[i]=t}function n(d,t){function e(){}e.prototype=t.prototype,d.ma=t.prototype,d.prototype=new e,d.prototype.constructor=d,d.sa=function(i,s,o){for(var a=Array(arguments.length-2),l=2;ld.length?!1:O(T2,d)}function x1(d){return O(_2,d)?i1(d,C2):i1(d,c1)}function P1(d){var t=x1(d.toString());P(d),d.g(t)}function k1(d){return d!=null&&(G(d,9)!=1||N(d,9)[0]!=-1)}function i1(d,t){for(var e=new T,i,s=d.length,o=0;ot?2:o[o.length-1]=s&&s<=i;++s)if(e=parseInt(d.substring(0,s),10),e in Y)return t.g(d.substring(s)),e;return 0}function U1(d,t,e,i,s,o){if(t.length==0)return 0;t=new T(t);var a;e!=null&&(a=c(e,11)),a==null&&(a="NonMatch");var l=t.toString();if(l.length==0)a=20;else if(J.test(l))l=l.replace(J,""),P(t),t.g(x1(l)),a=1;else{if(l=new RegExp(a),P1(t),a=t.toString(),a.search(l)==0){l=a.match(l)[0].length;var f=a.substring(l).match(A1);f&&f[1]!=null&&0=t.h.length)throw Error("Phone number too short after IDD");if(d=H1(t,i),d!=0)return L(o,1,d),d;throw Error("Invalid country calling code")}return e!=null&&(a=v(e,10),l=""+a,f=t.toString(),f.lastIndexOf(l,0)==0&&(l=new T(f.substring(l.length)),f=c(e,1),f=new RegExp(v(f,2)),K1(l,e,null),l=l.toString(),!O(f,t.toString())&&O(f,l)||o1(d,t.toString(),e,-1)==3))?(i.g(l),s&&L(o,6,10),L(o,1,a),a):(L(o,1,0),0)}function K1(d,t,e){var i=d.toString(),s=i.length,o=c(t,15);if(s!=0&&o!=null&&o.length!=0){var a=new RegExp("^(?:"+o+")");if(s=a.exec(i)){o=new RegExp(v(c(t,1),2));var l=O(o,i),f=s.length-1;t=c(t,16),t==null||t.length==0||s[f]==null||s[f].length==0?(!l||O(o,i.substring(s[0].length)))&&(e!=null&&0=t.length)o="";else{var a=t.indexOf(";",o);o=a!==-1?t.substring(o,a):t.substring(o)}var l=o;if(l==null?a=!0:l.length===0?a=!1:(a=S2.exec(l),l=w2.exec(l),a=a!==null||l!==null),!a||(o!=null?(o.charAt(0)==="+"&&s.g(o),o=t.indexOf("tel:"),s.g(t.substring(0<=o?o+4:0,t.indexOf(";phone-context=")))):(o=s.g,a=t??"",l=a.search(v2),0<=l?(a=a.substring(l),a=a.replace(b2,""),l=a.search(I2),0<=l&&(a=a.substring(0,l))):a="",o.call(s,a)),o=s.toString(),a=o.indexOf(";isub="),0t.h.length||(a!=null&&(e=new T,s=new T(t.toString()),K1(s,a,e),d=o1(d,s.toString(),a,-1),d!=2&&d!=4&&d!=5&&(t=s,i&&0d))throw Error("The string supplied is too short to be a phone number");if(17{try{let e=d.replace(/[^+0-9]/g,""),i=new A2(t);t="";for(let s=0;s{try{let s=E.g(),o=V(s,d,t);var i=u1(s,o,-1);return i==0||i==4?s.format(o,typeof e>"u"?0:e):d}catch{return d}}),$("intlTelInputUtilsTemp.getExampleNumber",(d,t,e,i)=>{try{let f=E.g();d:{var s=f;if(r1(d)){var o=s1(U(s,d),e);try{if(x(o,6)){var a=c(o,6),l=F1(s,a,d,!1);break d}}catch{}}l=null}return f.format(l,i?0:t?2:1)}catch{return""}}),$("intlTelInputUtilsTemp.getExtension",(d,t)=>{try{return c(V(E.g(),d,t),3)}catch{return""}}),$("intlTelInputUtilsTemp.getNumberType",(d,t)=>{try{let a=E.g(),l=V(a,d,t);var e=B1(a,l),i=q(a,v(l,1),e);if(i==null)var s=-1;else{var o=X(l);s=p1(o,i)}return s}catch{return-99}}),$("intlTelInputUtilsTemp.getValidationError",(d,t)=>{try{let e=E.g(),i=V(e,d,t);return u1(e,i,-1)}catch(e){return e.message==="Invalid country calling code"?1:3>=d.length||e.message==="Phone number too short after IDD"||e.message==="The string supplied is too short to be a phone number"?2:e.message==="The string supplied is too long to be a phone number"?3:-99}}),$("intlTelInputUtilsTemp.isValidNumber",(d,t)=>{try{let f=E.g();var e=V(f,d,t),i=B1(f,e);d=f;var s=v(e,1),o=q(d,s,i);if(o==null||i!="001"&&s!=G1(d,i))var a=!1;else{var l=X(e);a=p1(l,o)!=-1}return a}catch{return!1}}),$("intlTelInputUtilsTemp.isPossibleNumber",(d,t,e)=>{try{let i=E.g(),s=V(i,d,t);return e?u1(i,s,e2[e])===0:u1(i,s,-1)===0}catch{return!1}}),$("intlTelInputUtilsTemp.getCoreNumber",(d,t)=>{try{return c(V(E.g(),d,t),2).toString()}catch{return""}}),$("intlTelInputUtilsTemp.numberFormat",{E164:0,INTERNATIONAL:1,NATIONAL:2,RFC3966:3}),$("intlTelInputUtilsTemp.numberType",e2),$("intlTelInputUtilsTemp.validationError",{IS_POSSIBLE:0,INVALID_COUNTRY_CODE:1,TOO_SHORT:2,TOO_LONG:3,IS_POSSIBLE_LOCAL_ONLY:4,INVALID_LENGTH:5})})();var K2=window.intlTelInputUtilsTemp;delete window.intlTelInputUtilsTemp;var a2=K2;v1.utils=a2;var F2=v1;return O2(j2);})(); // UMD return factoryOutput.default; diff --git a/grunt/react_with_utils.js b/grunt/react_with_utils.js deleted file mode 100644 index 3463f17d1..000000000 --- a/grunt/react_with_utils.js +++ /dev/null @@ -1,9 +0,0 @@ -const fs = require('fs'); - -module.exports = function(grunt) { - grunt.registerTask('react_with_utils', 'Generate react/src/intl-tel-input/reactWithUtils.tsx', function() { - const reactContents = fs.readFileSync('react/src/intl-tel-input/react.tsx', 'utf8'); - const reactWithUtilsContents = reactContents.replace('import intlTelInput from "../intl-tel-input";', '//* THIS FILE IS AUTO-GENERATED. DO NOT EDIT.\nimport intlTelInput from "./intlTelInputWithUtils";'); - fs.writeFileSync('react/src/intl-tel-input/reactWithUtils.tsx', reactWithUtilsContents); - }); -}; diff --git a/grunt/replace.js b/grunt/replace.js index 99944cd71..17d67824a 100644 --- a/grunt/replace.js +++ b/grunt/replace.js @@ -298,6 +298,46 @@ module.exports = function(grunt) { files: { '.github/ISSUE_TEMPLATE.md': '.github/ISSUE_TEMPLATE.md' } + }, + + + /************** + * Generate reactWithUtils.tsx + **************/ + reactWithUtils: { + options: { + patterns: [ + { + match: /import intlTelInput from \"\.\.\/intl\-tel\-input\"\;/, + replacement: '//* THIS FILE IS AUTO-GENERATED. DO NOT EDIT.\nimport intlTelInput from "./intlTelInputWithUtils";' + } + ] + }, + files: { + 'react/src/intl-tel-input/reactWithUtils.tsx': 'react/src/intl-tel-input/react.tsx', + } + }, + + + /************** + * Remove (break) the dynamic import statement + * in the 4 bundles that already include utils as it will never be used, and sometimes causes problems with bundlers + **************/ + removeImport: { + options: { + patterns: [ + { + match: /import\(/, + replacement: 'import_INTENTIONALLY_BROKEN(' + } + ] + }, + files: { + 'build/js/intlTelInputWithUtils.js': 'build/js/intlTelInputWithUtils.js', + 'build/js/intlTelInputWithUtils.min.js': 'build/js/intlTelInputWithUtils.min.js', + 'react/build/IntlTelInputWithUtils.js': 'react/build/IntlTelInputWithUtils.js', + 'react/build/IntlTelInputWithUtils.cjs': 'react/build/IntlTelInputWithUtils.cjs', + } } }; }; diff --git a/react/build/IntlTelInputWithUtils.cjs b/react/build/IntlTelInputWithUtils.cjs index be5311766..6db12cfc3 100644 --- a/react/build/IntlTelInputWithUtils.cjs +++ b/react/build/IntlTelInputWithUtils.cjs @@ -2715,7 +2715,7 @@ var loadUtils = (path) => { if (!intlTelInput.utils && !intlTelInput.startedLoadingUtilsScript) { intlTelInput.startedLoadingUtilsScript = true; return new Promise((resolve, reject) => { - import( + import_INTENTIONALLY_BROKEN( /* webpackIgnore: true */ path ).then(({ default: utils2 }) => { diff --git a/react/build/IntlTelInputWithUtils.js b/react/build/IntlTelInputWithUtils.js index e61060e7c..fc6224a46 100644 --- a/react/build/IntlTelInputWithUtils.js +++ b/react/build/IntlTelInputWithUtils.js @@ -2679,7 +2679,7 @@ var loadUtils = (path) => { if (!intlTelInput.utils && !intlTelInput.startedLoadingUtilsScript) { intlTelInput.startedLoadingUtilsScript = true; return new Promise((resolve, reject) => { - import( + import_INTENTIONALLY_BROKEN( /* webpackIgnore: true */ path ).then(({ default: utils2 }) => {