intl-tel-input 27.3.0 → 27.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  /*
2
- * International Telephone Input v27.3.0
2
+ * International Telephone Input v27.3.1
3
3
  * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
6
- "use strict";var _factory=(()=>{var z=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var Dt=Object.getOwnPropertyNames;var _t=Object.prototype.hasOwnProperty;var Ot=(n,t)=>{for(var e in t)z(n,e,{get:t[e],enumerable:!0})},St=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Dt(t))!_t.call(n,s)&&s!==e&&z(n,s,{get:()=>t[s],enumerable:!(i=Nt(t,s))||i.enumerable});return n};var Rt=n=>St(z({},"__esModule",{value:!0}),n);var Gt={};Ot(Gt,{Iti:()=>x,default:()=>Vt});var Pt=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","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","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"],["pt","351"],["pr","1",3,["787","939"],"1"],["qa","974"],["re","262",0,null,"0"],["ro","40",0,null,"0"],["ru","7",0,["33"],"8"],["rw","250",0,null,"0"],["ws","685"],["sm","378"],["st","239"],["sa","966",0,null,"0"],["sn","221"],["rs","381",0,null,"0"],["sc","248"],["sl","232",0,null,"0"],["sg","65"],["sx","1",21,["721"],"1"],["sk","421",0,null,"0"],["si","386",0,null,"0"],["sb","677"],["so","252",0,null,"0"],["za","27",0,null,"0"],["kr","82",0,null,"0"],["ss","211",0,null,"0"],["es","34"],["lk","94",0,null,"0"],["bl","590",1,null,"0"],["sh","290"],["kn","1",18,["869"],"1"],["lc","1",19,["758"],"1"],["mf","590",2,null,"0"],["pm","508",0,null,"0"],["vc","1",20,["784"],"1"],["sd","249",0,null,"0"],["sr","597"],["sj","47",1,["4","79","9"]],["se","46",0,null,"0"],["ch","41",0,null,"0"],["sy","963",0,null,"0"],["tw","886",0,null,"0"],["tj","992"],["tz","255",0,null,"0"],["th","66",0,null,"0"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"],"1"],["tn","216"],["tr","90",0,null,"0"],["tm","993",0,null,"8"],["tc","1",23,["649"],"1"],["tv","688"],["vi","1",24,["340"],"1"],["ug","256",0,null,"0"],["ua","380",0,null,"0"],["ae","971",0,null,"0"],["gb","44",0,null,"0"],["us","1",0,null,"1"],["uy","598",0,null,"0"],["uz","998"],["vu","678"],["va","39",1,["06698","3"]],["ve","58",0,null,"0"],["vn","84",0,null,"0"],["wf","681"],["eh","212",1,["5288","5289","6","7"],"0"],["ye","967",0,null,"0"],["zm","260",0,null,"0"],["zw","263",0,null,"0"]],X=[];for(let n of Pt)X.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nationalPrefix:n[4]||null,normalisedName:"",initials:"",dialCodePlus:""});var Mt=new Set(X.map(n=>n.iso2)),N=n=>Mt.has(n),S=X;var b={OPEN_COUNTRY_DROPDOWN:"open:countrydropdown",CLOSE_COUNTRY_DROPDOWN:"close:countrydropdown",COUNTRY_CHANGE:"countrychange",INPUT:"input",STRICT_REJECT:"strict:reject"},d={HIDE:"iti__hide",V_HIDE:"iti__v-hide",ARROW_UP:"iti__arrow--up",GLOBE:"iti__globe",FLAG:"iti__flag",LOADING:"iti__loading",COUNTRY_ITEM:"iti__country",HIGHLIGHT:"iti__highlight"},C={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},q={PASTE:"insertFromPaste",DELETE_FORWARD:"deleteContentForward"},A={ALPHA_UNICODE:/\p{L}/u,NON_PLUS_NUMERIC:/[^+0-9]/,NON_PLUS_NUMERIC_GLOBAL:/[^+0-9]/g,HIDDEN_SEARCH_CHAR:/^[a-zA-ZÀ-ÿа-яА-Я ]$/},J={SEARCH_DEBOUNCE_MS:100,HIDDEN_SEARCH_RESET_MS:1e3,NEXT_TICK:0},Q={UNKNOWN_NUMBER_TYPE:-99,UNKNOWN_VALIDATION_ERROR:-99},L={NARROW_VIEWPORT_WIDTH:500,FALLBACK_SELECTED_WITH_DIAL_WIDTH:78,FALLBACK_SELECTED_NO_DIAL_WIDTH:42,INPUT_PADDING_EXTRA_LEFT:6,DROPDOWN_MARGIN:3,FALLBACK_DROPDOWN_HEIGHT:200},F={PLUS:"+",NANP:"1"},B={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},nt={ISO2:"us",DIAL_CODE:"1"},R={AGGRESSIVE:"aggressive",POLITE:"polite",OFF:"off"},k={AUTO:"auto"},xt=["FIXED_LINE","MOBILE","FIXED_LINE_OR_MOBILE","TOLL_FREE","PREMIUM_RATE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL","UNKNOWN"],U=new Set(xt),v={ISO2:"countryCode",DIAL_CODE:"dialCode",INSTANCE_ID:"intlTelInputId"},h={EXPANDED:"aria-expanded",LABEL:"aria-label",SELECTED:"aria-selected",ACTIVE_DESCENDANT:"aria-activedescendant",HASPOPUP:"aria-haspopup",CONTROLS:"aria-controls",HIDDEN:"aria-hidden",AUTOCOMPLETE:"aria-autocomplete",MODAL:"aria-modal"};var Ht={selectedCountryAriaLabel:"Change country for phone number, currently selected ${countryName} (${dialCode})",noCountrySelected:"Select country for phone number",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",searchEmptyState:"No results found",searchSummaryAria(n){return n===0?"No results found":n===1?"1 result found":`${n} results found`}},ot=Ht;var Z=n=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(n).matches,ut=()=>Z(`(max-width: ${L.NARROW_VIEWPORT_WIDTH}px)`),kt=()=>{if(typeof navigator<"u"&&typeof window<"u"){let n=Z("(max-height: 600px)"),t=Z("(pointer: coarse)");return ut()||t&&n}return!1},V={allowDropdown:!0,allowedNumberTypes:["MOBILE","FIXED_LINE"],allowNumberExtensions:!1,allowPhonewords:!1,autoPlaceholder:R.POLITE,containerClass:"",countryNameLocale:"en",countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownAlwaysOpen:!1,dropdownContainer:null,excludeCountries:null,fixDropdownWidth:!0,formatAsYouType:!0,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:null,i18n:{},initialCountry:"",loadUtils:null,nationalMode:!0,onlyCountries:null,placeholderNumberType:"MOBILE",searchInputClass:"",separateDialCode:!1,strictRejectAnimation:!1,showFlags:!0,strictMode:!1,useFullscreenPopup:kt()},ct=n=>JSON.stringify(n),rt=n=>!!n&&typeof n=="object"&&!Array.isArray(n),Ut=n=>typeof n=="function",Wt=n=>{if(!n||typeof n!="object")return!1;let t=n;return t.nodeType===1&&typeof t.tagName=="string"&&typeof t.appendChild=="function"},lt=new Set(Object.values(R)),j=n=>{console.warn(`[intl-tel-input] ${n}`)},E=(n,t,e)=>{j(`Option '${n}' must be ${t}; got ${ct(e)}. Ignoring.`)},at=(n,t)=>{let e="an array of iso2 country code strings";if(!Array.isArray(t))return E(n,e,t),!1;let i=[];for(let s of t){if(typeof s!="string")return E(n,e,t),!1;let o=s.toLowerCase();N(o)?i.push(s):j(`Invalid iso2 code in '${n}': '${s}'. Skipping.`)}return i},dt=n=>{if(n===void 0)return{};if(!rt(n)){let e=`The second argument must be an options object; got ${ct(n)}. Using defaults.`;return j(e),{}}let t={};for(let[e,i]of Object.entries(n)){if(!Object.hasOwn(V,e)){j(`Unknown option '${e}'. Ignoring.`);continue}switch(e){case"allowDropdown":case"allowNumberExtensions":case"allowPhonewords":case"countrySearch":case"dropdownAlwaysOpen":case"fixDropdownWidth":case"formatAsYouType":case"formatOnDisplay":case"nationalMode":case"showFlags":case"separateDialCode":case"strictMode":case"strictRejectAnimation":case"useFullscreenPopup":if(typeof i!="boolean"){E(e,"a boolean",i);break}t[e]=i;break;case"autoPlaceholder":if(typeof i!="string"||!lt.has(i)){let s=Array.from(lt).join(", ");E("autoPlaceholder",`one of ${s}`,i);break}t[e]=i;break;case"containerClass":case"searchInputClass":case"countryNameLocale":if(typeof i!="string"){E(e,"a string",i);break}t[e]=i;break;case"countryOrder":{if(i===null)t[e]=i;else{let s=at(e,i);s!==!1&&(t[e]=s)}break}case"customPlaceholder":case"geoIpLookup":case"hiddenInput":case"loadUtils":if(i!==null&&!Ut(i)){E(e,"a function or null",i);break}t[e]=i;break;case"dropdownContainer":if(i!==null&&!Wt(i)){E("dropdownContainer","an HTMLElement or null",i);break}t[e]=i;break;case"excludeCountries":case"onlyCountries":{if(i===null)t[e]=i;else{let s=at(e,i);s!==!1&&(t[e]=s)}break}case"i18n":if(i&&!rt(i)){E("i18n","an object",i);break}t[e]=i;break;case"initialCountry":{if(typeof i!="string"){E("initialCountry","a string",i);break}let s=i.toLowerCase();if(s&&s!==k.AUTO&&!N(s)){E("initialCountry","a valid iso2 country code or 'auto'",i);break}t[e]=i;break}case"placeholderNumberType":if(typeof i!="string"||!U.has(i)){let s=Array.from(U).join(", ");E("placeholderNumberType",`one of ${s}`,i);break}t[e]=i;break;case"allowedNumberTypes":if(i!==null){if(!Array.isArray(i)){E("allowedNumberTypes","an array of number types or null",i);break}let s=!0;for(let o of i)if(typeof o!="string"||!U.has(o)){let r=Array.from(U).join(", ");E("allowedNumberTypes",`an array of valid number types (${r})`,o),s=!1;break}s&&(t[e]=i)}else t[e]=null;break}}return t},ht=n=>{n.initialCountry&&(n.initialCountry=n.initialCountry.toLowerCase()),n.onlyCountries?.length&&(n.onlyCountries=n.onlyCountries.map(t=>t.toLowerCase())),n.excludeCountries?.length&&(n.excludeCountries=n.excludeCountries.map(t=>t.toLowerCase())),n.countryOrder&&(n.countryOrder=n.countryOrder.map(t=>t.toLowerCase()))},pt=n=>{n.dropdownAlwaysOpen&&(n.useFullscreenPopup=!1,n.allowDropdown=!0),n.useFullscreenPopup?n.fixDropdownWidth=!1:ut()&&(n.fixDropdownWidth=!0),n.onlyCountries?.length===1&&(n.initialCountry=n.onlyCountries[0]),n.separateDialCode&&(n.nationalMode=!1),n.allowDropdown&&!n.showFlags&&!n.separateDialCode&&(n.nationalMode=!1),n.useFullscreenPopup&&!n.dropdownContainer&&(n.dropdownContainer=document.body),n.i18n={...ot,...n.i18n}};var w=n=>n.replace(/\D/g,""),W=(n="")=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var G=n=>Object.keys(n).filter(t=>!!n[t]).join(" "),f=(n,t,e)=>{let i=document.createElement(n);return t&&Object.entries(t).forEach(([s,o])=>i.setAttribute(s,o)),e&&e.appendChild(i),i};var ft=()=>`
6
+ "use strict";var _factory=(()=>{var z=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var Dt=Object.getOwnPropertyNames;var St=Object.prototype.hasOwnProperty;var _t=(n,t)=>{for(var e in t)z(n,e,{get:t[e],enumerable:!0})},Ot=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Dt(t))!St.call(n,s)&&s!==e&&z(n,s,{get:()=>t[s],enumerable:!(i=Nt(t,s))||i.enumerable});return n};var Mt=n=>Ot(z({},"__esModule",{value:!0}),n);var Gt={};_t(Gt,{Iti:()=>H,default:()=>Vt});var Rt=[["af","93",0,null,"0"],["ax","358",1,["18","4"],"0"],["al","355",0,null,"0"],["dz","213",0,null,"0"],["as","1",5,["684"],"1"],["ad","376"],["ao","244"],["ai","1",6,["264"],"1"],["ag","1",7,["268"],"1"],["ar","54",0,null,"0"],["am","374",0,null,"0"],["aw","297"],["ac","247"],["au","61",0,["4"],"0"],["at","43",0,null,"0"],["az","994",0,null,"0"],["bs","1",8,["242"],"1"],["bh","973"],["bd","880",0,null,"0"],["bb","1",9,["246"],"1"],["by","375",0,null,"8"],["be","32",0,null,"0"],["bz","501"],["bj","229"],["bm","1",10,["441"],"1"],["bt","975"],["bo","591",0,null,"0"],["ba","387",0,null,"0"],["bw","267"],["br","55",0,null,"0"],["io","246"],["vg","1",11,["284"],"1"],["bn","673"],["bg","359",0,null,"0"],["bf","226"],["bi","257"],["kh","855",0,null,"0"],["cm","237"],["ca","1",1,["204","226","236","249","250","257","263","289","306","343","354","365","367","368","382","403","416","418","428","431","437","438","450","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","942"],"1"],["cv","238"],["bq","599",1,["3","4","7"]],["ky","1",12,["345"],"1"],["cf","236"],["td","235"],["cl","56"],["cn","86",0,null,"0"],["cx","61",2,["4","89164"],"0"],["cc","61",1,["4","89162"],"0"],["co","57",0,null,"0"],["km","269"],["cg","242"],["cd","243",0,null,"0"],["ck","682"],["cr","506"],["ci","225"],["hr","385",0,null,"0"],["cu","53",0,null,"0"],["cw","599",0],["cy","357"],["cz","420"],["dk","45"],["dj","253"],["dm","1",13,["767"],"1"],["do","1",2,["809","829","849"],"1"],["ec","593",0,null,"0"],["eg","20",0,null,"0"],["sv","503"],["gq","240"],["er","291",0,null,"0"],["ee","372"],["sz","268"],["et","251",0,null,"0"],["fk","500"],["fo","298"],["fj","679"],["fi","358",0,["4"],"0"],["fr","33",0,null,"0"],["gf","594",0,null,"0"],["pf","689"],["ga","241"],["gm","220"],["ge","995",0,null,"0"],["de","49",0,null,"0"],["gh","233",0,null,"0"],["gi","350"],["gr","30"],["gl","299"],["gd","1",14,["473"],"1"],["gp","590",0,null,"0"],["gu","1",15,["671"],"1"],["gt","502"],["gg","44",1,["1481","7781","7839","7911"],"0"],["gn","224"],["gw","245"],["gy","592"],["ht","509"],["hn","504"],["hk","852"],["hu","36",0,null,"06"],["is","354"],["in","91",0,null,"0"],["id","62",0,null,"0"],["ir","98",0,null,"0"],["iq","964",0,null,"0"],["ie","353",0,null,"0"],["im","44",2,["1624","74576","7524","7624","7924"],"0"],["il","972",0,null,"0"],["it","39",0,["3"]],["jm","1",4,["658","876"],"1"],["jp","81",0,null,"0"],["je","44",3,["1534","7509","7700","7797","7829","7937"],"0"],["jo","962",0,null,"0"],["kz","7",1,["33","7"],"8"],["ke","254",0,null,"0"],["ki","686",0,null,"0"],["xk","383",0,null,"0"],["kw","965"],["kg","996",0,null,"0"],["la","856",0,null,"0"],["lv","371"],["lb","961",0,null,"0"],["ls","266"],["lr","231",0,null,"0"],["ly","218",0,null,"0"],["li","423",0,null,"0"],["lt","370",0,null,"0"],["lu","352"],["mo","853"],["mg","261",0,null,"0"],["mw","265",0,null,"0"],["my","60",0,null,"0"],["mv","960"],["ml","223"],["mt","356"],["mh","692",0,null,"1"],["mq","596",0,null,"0"],["mr","222"],["mu","230"],["yt","262",1,["269","639"],"0"],["mx","52"],["fm","691"],["md","373",0,null,"0"],["mc","377",0,null,"0"],["mn","976",0,null,"0"],["me","382",0,null,"0"],["ms","1",16,["664"],"1"],["ma","212",0,["6","7"],"0"],["mz","258"],["mm","95",0,null,"0"],["na","264",0,null,"0"],["nr","674"],["np","977",0,null,"0"],["nl","31",0,null,"0"],["nc","687"],["nz","64",0,null,"0"],["ni","505"],["ne","227"],["ng","234",0,null,"0"],["nu","683"],["nf","672"],["kp","850",0,null,"0"],["mk","389",0,null,"0"],["mp","1",17,["670"],"1"],["no","47",0,["4","9"]],["om","968"],["pk","92",0,null,"0"],["pw","680"],["ps","970",0,null,"0"],["pa","507"],["pg","675"],["py","595",0,null,"0"],["pe","51",0,null,"0"],["ph","63",0,null,"0"],["pl","48"],["pt","351"],["pr","1",3,["787","939"],"1"],["qa","974"],["re","262",0,null,"0"],["ro","40",0,null,"0"],["ru","7",0,["33"],"8"],["rw","250",0,null,"0"],["ws","685"],["sm","378"],["st","239"],["sa","966",0,null,"0"],["sn","221"],["rs","381",0,null,"0"],["sc","248"],["sl","232",0,null,"0"],["sg","65"],["sx","1",21,["721"],"1"],["sk","421",0,null,"0"],["si","386",0,null,"0"],["sb","677"],["so","252",0,null,"0"],["za","27",0,null,"0"],["kr","82",0,null,"0"],["ss","211",0,null,"0"],["es","34"],["lk","94",0,null,"0"],["bl","590",1,null,"0"],["sh","290"],["kn","1",18,["869"],"1"],["lc","1",19,["758"],"1"],["mf","590",2,null,"0"],["pm","508",0,null,"0"],["vc","1",20,["784"],"1"],["sd","249",0,null,"0"],["sr","597"],["sj","47",1,["4","79","9"]],["se","46",0,null,"0"],["ch","41",0,null,"0"],["sy","963",0,null,"0"],["tw","886",0,null,"0"],["tj","992"],["tz","255",0,null,"0"],["th","66",0,null,"0"],["tl","670"],["tg","228"],["tk","690"],["to","676"],["tt","1",22,["868"],"1"],["tn","216"],["tr","90",0,null,"0"],["tm","993",0,null,"8"],["tc","1",23,["649"],"1"],["tv","688"],["vi","1",24,["340"],"1"],["ug","256",0,null,"0"],["ua","380",0,null,"0"],["ae","971",0,null,"0"],["gb","44",0,null,"0"],["us","1",0,null,"1"],["uy","598",0,null,"0"],["uz","998"],["vu","678"],["va","39",1,["06698","3"]],["ve","58",0,null,"0"],["vn","84",0,null,"0"],["wf","681"],["eh","212",1,["5288","5289","6","7"],"0"],["ye","967",0,null,"0"],["zm","260",0,null,"0"],["zw","263",0,null,"0"]],X=[];for(let n of Rt)X.push({name:"",iso2:n[0],dialCode:n[1],priority:n[2]||0,areaCodes:n[3]||null,nationalPrefix:n[4]||null});var Pt=new Set(X.map(n=>n.iso2)),N=n=>Pt.has(n),O=X;var g={OPEN_COUNTRY_DROPDOWN:"open:countrydropdown",CLOSE_COUNTRY_DROPDOWN:"close:countrydropdown",COUNTRY_CHANGE:"countrychange",INPUT:"input",STRICT_REJECT:"strict:reject"},c={HIDE:"iti__hide",V_HIDE:"iti__v-hide",ARROW_UP:"iti__arrow--up",GLOBE:"iti__globe",FLAG:"iti__flag",LOADING:"iti__loading",COUNTRY_ITEM:"iti__country",HIGHLIGHT:"iti__highlight"},y={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",SPACE:" ",ENTER:"Enter",ESC:"Escape",TAB:"Tab"},q={PASTE:"insertFromPaste",DELETE_FORWARD:"deleteContentForward"},T={ALPHA_UNICODE:/\p{L}/u,NON_PLUS_NUMERIC:/[^+0-9]/,NON_PLUS_NUMERIC_GLOBAL:/[^+0-9]/g,HIDDEN_SEARCH_CHAR:/^[a-zA-ZÀ-ÿа-яА-Я ]$/},J={SEARCH_DEBOUNCE_MS:100,HIDDEN_SEARCH_RESET_MS:1e3,NEXT_TICK:0},Q={UNKNOWN_NUMBER_TYPE:-99,UNKNOWN_VALIDATION_ERROR:-99},L={NARROW_VIEWPORT_WIDTH:500,FALLBACK_SELECTED_WITH_DIAL_WIDTH:78,FALLBACK_SELECTED_NO_DIAL_WIDTH:42,INPUT_PADDING_EXTRA_LEFT:6,DROPDOWN_MARGIN:3,FALLBACK_DROPDOWN_HEIGHT:200},B={PLUS:"+",NANP:"1"},F={ISO2:"gb",DIAL_CODE:"44",MOBILE_PREFIX:"7",MOBILE_CORE_LENGTH:10},nt={ISO2:"us",DIAL_CODE:"1"},M={AGGRESSIVE:"aggressive",POLITE:"polite",OFF:"off"},U={AUTO:"auto"},xt=["FIXED_LINE","MOBILE","FIXED_LINE_OR_MOBILE","TOLL_FREE","PREMIUM_RATE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL","UNKNOWN"],W=new Set(xt),A={ISO2:"countryCode",DIAL_CODE:"dialCode",INSTANCE_ID:"intlTelInputId"},h={EXPANDED:"aria-expanded",LABEL:"aria-label",SELECTED:"aria-selected",ACTIVE_DESCENDANT:"aria-activedescendant",HASPOPUP:"aria-haspopup",CONTROLS:"aria-controls",HIDDEN:"aria-hidden",AUTOCOMPLETE:"aria-autocomplete",MODAL:"aria-modal"};var Ht={selectedCountryAriaLabel:"Change country for phone number, currently selected ${countryName} (${dialCode})",noCountrySelected:"Select country for phone number",countryListAriaLabel:"List of countries",searchPlaceholder:"Search",clearSearchAriaLabel:"Clear search",searchEmptyState:"No results found",searchSummaryAria(n){return n===0?"No results found":n===1?"1 result found":`${n} results found`}},ot=Ht;var Z=n=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(n).matches,ut=()=>Z(`(max-width: ${L.NARROW_VIEWPORT_WIDTH}px)`),kt=()=>{if(typeof navigator<"u"&&typeof window<"u"){let n=Z("(max-height: 600px)"),t=Z("(pointer: coarse)");return ut()||t&&n}return!1},V={allowDropdown:!0,allowedNumberTypes:["MOBILE","FIXED_LINE"],allowNumberExtensions:!1,allowPhonewords:!1,autoPlaceholder:M.POLITE,containerClass:"",countryNameLocale:"en",countryOrder:null,countrySearch:!0,customPlaceholder:null,dropdownAlwaysOpen:!1,dropdownContainer:null,excludeCountries:null,fixDropdownWidth:!0,formatAsYouType:!0,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:null,i18n:{},initialCountry:"",loadUtils:null,nationalMode:!0,onlyCountries:null,placeholderNumberType:"MOBILE",searchInputClass:"",separateDialCode:!1,strictRejectAnimation:!1,showFlags:!0,strictMode:!1,useFullscreenPopup:kt()},ct=n=>JSON.stringify(n),rt=n=>!!n&&typeof n=="object"&&!Array.isArray(n),Ut=n=>typeof n=="function",Wt=n=>{if(!n||typeof n!="object")return!1;let t=n;return t.nodeType===1&&typeof t.tagName=="string"&&typeof t.appendChild=="function"},lt=new Set(Object.values(M)),j=n=>{console.warn(`[intl-tel-input] ${n}`)},b=(n,t,e)=>{j(`Option '${n}' must be ${t}; got ${ct(e)}. Ignoring.`)},at=(n,t)=>{let e="an array of iso2 country code strings";if(!Array.isArray(t))return b(n,e,t),!1;let i=[];for(let s of t){if(typeof s!="string")return b(n,e,t),!1;let o=s.toLowerCase();N(o)?i.push(s):j(`Invalid iso2 code in '${n}': '${s}'. Skipping.`)}return i},dt=n=>{if(n===void 0)return{};if(!rt(n)){let e=`The second argument must be an options object; got ${ct(n)}. Using defaults.`;return j(e),{}}let t={};for(let[e,i]of Object.entries(n)){if(!Object.hasOwn(V,e)){j(`Unknown option '${e}'. Ignoring.`);continue}switch(e){case"allowDropdown":case"allowNumberExtensions":case"allowPhonewords":case"countrySearch":case"dropdownAlwaysOpen":case"fixDropdownWidth":case"formatAsYouType":case"formatOnDisplay":case"nationalMode":case"showFlags":case"separateDialCode":case"strictMode":case"strictRejectAnimation":case"useFullscreenPopup":if(typeof i!="boolean"){b(e,"a boolean",i);break}t[e]=i;break;case"autoPlaceholder":if(typeof i!="string"||!lt.has(i)){let s=Array.from(lt).join(", ");b("autoPlaceholder",`one of ${s}`,i);break}t[e]=i;break;case"containerClass":case"searchInputClass":case"countryNameLocale":if(typeof i!="string"){b(e,"a string",i);break}t[e]=i;break;case"countryOrder":{if(i===null)t[e]=i;else{let s=at(e,i);s!==!1&&(t[e]=s)}break}case"customPlaceholder":case"geoIpLookup":case"hiddenInput":case"loadUtils":if(i!==null&&!Ut(i)){b(e,"a function or null",i);break}t[e]=i;break;case"dropdownContainer":if(i!==null&&!Wt(i)){b("dropdownContainer","an HTMLElement or null",i);break}t[e]=i;break;case"excludeCountries":case"onlyCountries":{if(i===null)t[e]=i;else{let s=at(e,i);s!==!1&&(t[e]=s)}break}case"i18n":if(i&&!rt(i)){b("i18n","an object",i);break}t[e]=i;break;case"initialCountry":{if(typeof i!="string"){b("initialCountry","a string",i);break}let s=i.toLowerCase();if(s&&s!==U.AUTO&&!N(s)){b("initialCountry","a valid iso2 country code or 'auto'",i);break}t[e]=i;break}case"placeholderNumberType":if(typeof i!="string"||!W.has(i)){let s=Array.from(W).join(", ");b("placeholderNumberType",`one of ${s}`,i);break}t[e]=i;break;case"allowedNumberTypes":if(i!==null){if(!Array.isArray(i)){b("allowedNumberTypes","an array of number types or null",i);break}let s=!0;for(let o of i)if(typeof o!="string"||!W.has(o)){let r=Array.from(W).join(", ");b("allowedNumberTypes",`an array of valid number types (${r})`,o),s=!1;break}s&&(t[e]=i)}else t[e]=null;break}}return t},ht=n=>{n.initialCountry&&(n.initialCountry=n.initialCountry.toLowerCase()),n.onlyCountries?.length&&(n.onlyCountries=n.onlyCountries.map(t=>t.toLowerCase())),n.excludeCountries?.length&&(n.excludeCountries=n.excludeCountries.map(t=>t.toLowerCase())),n.countryOrder&&(n.countryOrder=n.countryOrder.map(t=>t.toLowerCase()))},pt=n=>{n.dropdownAlwaysOpen&&(n.useFullscreenPopup=!1,n.allowDropdown=!0),n.useFullscreenPopup?n.fixDropdownWidth=!1:ut()&&(n.fixDropdownWidth=!0),n.onlyCountries?.length===1&&(n.initialCountry=n.onlyCountries[0]),n.separateDialCode&&(n.nationalMode=!1),n.allowDropdown&&!n.showFlags&&!n.separateDialCode&&(n.nationalMode=!1),n.useFullscreenPopup&&!n.dropdownContainer&&(n.dropdownContainer=document.body),n.i18n={...ot,...n.i18n}};var w=n=>n.replace(/\D/g,""),G=(n="")=>n.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase();var K=n=>Object.keys(n).filter(t=>!!n[t]).join(" "),f=(n,t,e)=>{let i=document.createElement(n);return t&&Object.entries(t).forEach(([s,o])=>i.setAttribute(s,o)),e&&e.appendChild(i),i};var ft=()=>`
7
7
  <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${h.HIDDEN}="true">
8
8
  <circle cx="11" cy="11" r="7" />
9
9
  <line x1="21" y1="21" x2="16.65" y2="16.65" />
@@ -21,5 +21,5 @@
21
21
  <svg width="256" height="256" viewBox="0 0 512 512" class="iti__globe-svg">
22
22
  <path d="M508 213a240 240 0 0 0-449-87l-2 5-2 5c-8 14-13 30-17 46a65 65 0 0 1 56 4c16-10 35-19 56-27l9-3c-6 23-10 48-10 74h-16l4 6c3 4 5 8 6 13h6c0 22 3 44 8 65l2 10-25-10-4 5 12 18 9 3 6 2 8 3 9 26 1 2 16-7h1l-5-13-1-2c24 6 49 9 75 10v26l11 10 7 7v-30l1-13c22 0 44-3 65-8l10-2-21 48-1 1a317 317 0 0 1-14 23l-21 5h-2c6 16 7 33 1 50a240 240 0 0 0 211-265m-401-56-11 6c19-44 54-79 98-98-11 20-21 44-29 69-21 6-40 15-58 23m154 182v4c-29-1-57-6-81-13-7-25-12-52-13-81h94zm0-109h-94c1-29 6-56 13-81 24-7 52-12 81-13zm0-112c-22 1-44 4-65 8l-10 2 12-30 9-17 1-2a332 332 0 0 1 13-23c13-4 26-6 40-7zm187 69 6 4c4 12 6 25 6 38v1h-68c-1-26-4-51-10-74l48 20 1 1 14 8zm-14-44 10 20c-20-11-43-21-68-29-8-25-18-49-29-69 37 16 67 44 87 78M279 49h1c13 1 27 3 39 7l14 23 1 2a343 343 0 0 1 12 26l2 5 6 16c-23-6-48-9-74-10h-1zm0 87h1c29 1 56 6 81 13 7 24 12 51 12 80v1h-94zm2 207h-2v-94h95c-1 29-6 56-13 81-24 7-51 12-80 13m86 60-20 10c11-20 21-43 29-68 25-8 48-18 68-29-16 37-43 67-77 87m87-115-7 5-16 9-2 1a337 337 0 0 1-47 21c6-24 9-49 10-75h68c0 13-2 27-6 39"/>
23
23
  <path d="m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"/>
24
- </svg>`;var yt=(n,t)=>{let e=W(t),i=[],s=[],o=[],r=[],l=[],a=[];for(let c of n)c.iso2===e?i.push(c):c.normalisedName.startsWith(e)?s.push(c):c.normalisedName.includes(e)?o.push(c):e===c.dialCode||e===c.dialCodePlus?r.push(c):c.dialCodePlus.includes(e)?l.push(c):c.initials.includes(e)&&a.push(c);let p=(c,m)=>c.priority-m.priority;return[...i,...s,...o,...r.sort(p),...l.sort(p),...a]},Et=(n,t)=>{let e=W(t);for(let i of n)if(i.normalisedName.startsWith(e))return i;return null};var P=class n{#t;#i;#A;#E="";#I;#v=null;#_;#C;#e;#c;#g;#o;#s;#m;#l;#u;#n;#a;#d;#T;#H;#r;#y=null;#h=null;#O=new Map;#N=null;telInputEl;hadInitialPlaceholder;constructor(t,e,i){t.dataset[v.INSTANCE_ID]=i.toString(),this.telInputEl=t,this.#t=e,this.#i=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#A=!!this.telInputEl.closest("[dir=rtl]"),this.#E=this.telInputEl.style.paddingLeft}static validateInput(t){let e=t?.tagName;if(!(!!t&&typeof t=="object"&&e==="INPUT"&&typeof t.setAttribute=="function")){let s=Object.prototype.toString.call(t);throw new TypeError(`The first argument must be an HTMLInputElement, not ${s}`)}}buildMarkup(t){this.#I=t,this.telInputEl.classList.add("iti__tel-input"),this.telInputEl.hasAttribute("type")||this.telInputEl.setAttribute("type","tel"),this.telInputEl.hasAttribute("autocomplete")||this.telInputEl.setAttribute("autocomplete","tel"),this.telInputEl.hasAttribute("inputmode")||this.telInputEl.setAttribute("inputmode","tel");let e=this.#k();this.#U(e),e.appendChild(this.telInputEl),this.#q(),this.#J(e),this.ensureDropdownWidthSet()}#k(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:s}=this.#t,o=G({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!s,[i]:!!i}),r=f("div",{class:o});return this.#A&&r.setAttribute("dir","ltr"),this.telInputEl.before(r),r}#U(t){let{allowDropdown:e,separateDialCode:i,showFlags:s}=this.#t;if(!e&&!s&&!i)return;this.#C=f("div",{class:`iti__country-container ${d.V_HIDE}`},t),e?(this.#e=f("button",{type:"button",class:"iti__selected-country",[h.EXPANDED]:"false",[h.LABEL]:this.#t.i18n.noCountrySelected,[h.HASPOPUP]:"dialog",[h.CONTROLS]:`iti-${this.#i}__dropdown-content`},this.#C),this.telInputEl.disabled&&this.#e.setAttribute("disabled","true")):this.#e=f("div",{class:"iti__selected-country"},this.#C);let o=f("div",{class:"iti__selected-country-primary"},this.#e);this.#c=f("div",{class:d.FLAG},o),e&&(this.#o=f("div",{class:"iti__arrow",[h.HIDDEN]:"true"},o)),i&&(this.#g=f("div",{class:"iti__selected-dial-code"},this.#e)),e&&this.#z()}ensureDropdownWidthSet(){let{fixDropdownWidth:t,allowDropdown:e}=this.#t;if(!e||!t||this.#s.style.width)return;let i=this.telInputEl.offsetWidth;i>0&&(this.#s.style.width=`${i}px`)}#z(){let{fixDropdownWidth:t,useFullscreenPopup:e,countrySearch:i,i18n:s,dropdownContainer:o,containerClass:r}=this.#t,l=t?"":"iti--flexible-dropdown-width";if(this.#s=f("div",{id:`iti-${this.#i}__dropdown-content`,class:`iti__dropdown-content ${d.HIDE} ${l}`,role:"dialog",[h.MODAL]:"true"}),this.#A&&this.#s.setAttribute("dir","rtl"),i&&this.#X(),this.#n=f("ul",{class:"iti__country-list",id:`iti-${this.#i}__country-listbox`,role:"listbox",[h.LABEL]:s.countryListAriaLabel},this.#s),this.#Q(),i&&this.#F(),e||(this.#_=this.#tt(),i&&(this.#s.style.height=`${this.#_}px`)),o){let a=G({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[r]:!!r});this.#r=f("div",{class:a}),this.#r.appendChild(this.#s)}else this.#C.appendChild(this.#s)}#X(){let{i18n:t,searchInputClass:e}=this.#t,i=f("div",{class:"iti__search-input-wrapper"},this.#s);this.#m=f("span",{class:"iti__search-icon",[h.HIDDEN]:"true"},i),this.#m.innerHTML=ft(),this.#l=f("input",{id:`iti-${this.#i}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[h.EXPANDED]:"true",[h.LABEL]:t.searchPlaceholder,[h.CONTROLS]:`iti-${this.#i}__country-listbox`,[h.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.#u=f("button",{type:"button",class:`iti__search-clear ${d.HIDE}`,[h.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.#u.innerHTML=mt(this.#i),this.#H=f("span",{class:"iti__a11y-text"},this.#s),this.#T=f("div",{class:`iti__no-results ${d.HIDE}`,[h.HIDDEN]:"true"},this.#s),this.#T.textContent=t.searchEmptyState??null}#q(){this.#C&&(this.#W(),this.#C.classList.remove(d.V_HIDE))}#J(t){let{hiddenInput:e}=this.#t;if(!e)return;let i=this.telInputEl.getAttribute("name")||"",s=e(i);if(s.phone){let o=this.telInputEl.form?.querySelector(`input[name="${s.phone}"]`);o?this.#a=o:(this.#a=f("input",{type:"hidden",name:s.phone}),t.appendChild(this.#a))}if(s.country){let o=this.telInputEl.form?.querySelector(`input[name="${s.country}"]`);o?this.#d=o:(this.#d=f("input",{type:"hidden",name:s.country}),t.appendChild(this.#d))}}#Q(){let t=document.createDocumentFragment();for(let e=0;e<this.#I.length;e++){let i=this.#I[e],s=G({[d.COUNTRY_ITEM]:!0}),o=f("li",{id:`iti-${this.#i}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[h.SELECTED]:"false"});o.dataset[v.DIAL_CODE]=i.dialCode,o.dataset[v.ISO2]=i.iso2,this.#O.set(i.iso2,o),this.#t.showFlags&&f("div",{class:`${d.FLAG} iti__${i.iso2}`},o);let r=f("span",{class:"iti__country-name"},o);r.textContent=`${i.name} `;let l=f("span",{class:"iti__dial-code"},r);this.#A&&l.setAttribute("dir","ltr"),l.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.#n.appendChild(t)}#W(){if(this.#e){let t=this.#t.separateDialCode?L.FALLBACK_SELECTED_WITH_DIAL_WIDTH:L.FALLBACK_SELECTED_NO_DIAL_WIDTH,i=(this.#e.offsetWidth||this.#Z()||t)+L.INPUT_PADDING_EXTRA_LEFT;this.telInputEl.style.paddingLeft=`${i}px`}}static#$(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#Z(){if(!this.telInputEl.parentNode)return 0;let t=n.#$(),e=this.telInputEl.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.#C.cloneNode();e.appendChild(i);let s=this.#e.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#tt(){let t=n.#$();this.#s.classList.remove(d.HIDE);let e=f("div",{class:"iti iti--inline-dropdown"});e.appendChild(this.#s),e.style.visibility="hidden",t.appendChild(e);let i=this.#s.offsetHeight;return t.removeChild(e),e.style.visibility="",this.#s.classList.add(d.HIDE),i>0?i:L.FALLBACK_DROPDOWN_HEIGHT}#F(){let{i18n:t}=this.#t,e=this.#n.childElementCount;this.#H.textContent=t.searchSummaryAria(e)}#B(t){let e;t===""?e=this.#I:e=yt(this.#I,t),this.#G(e)}prefillSearchWithPlus(){this.#l.value="+",this.#l.focus(),this.#B("")}#P(){let t=this.#l.value.trim();this.#B(t),this.#l.value?this.#u.classList.remove(d.HIDE):this.#u.classList.add(d.HIDE)}#D(){this.#v&&clearTimeout(this.#v),this.#v=setTimeout(()=>{this.#P(),this.#v=null},J.SEARCH_DEBOUNCE_MS)}#p(){this.#l.value="",this.#l.focus(),this.#P()}#S(t){let e=this.#n,i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=s.top-i.top+e.scrollTop;s.top<i.top?e.scrollTop=o:s.bottom>i.bottom&&(e.scrollTop=o-i.height+s.height)}#f(t,e=!0){if(this.#h?.classList.remove(d.HIGHLIGHT),t){if(t.classList.add(d.HIGHLIGHT),this.#t.countrySearch){let i=t.getAttribute("id")||"";this.#l.setAttribute(h.ACTIVE_DESCENDANT,i)}e&&this.#S(t),this.#h=t}else this.#h=null}bindHiddenInputSubmitListener(t,e,i){let s=this.telInputEl.form;!s||!this.#a&&!this.#d||s.addEventListener("submit",()=>{this.#a&&(this.#a.value=e()),this.#d&&(this.#d.value=i())},{signal:t})}bindAllInitialDropdownListeners(t,e,i){let s=this.telInputEl.closest("label");s&&s.addEventListener("click",o=>{this.isDropdownOpen()?o.preventDefault():this.telInputEl.focus()},{signal:t}),this.#e.addEventListener("click",()=>{!this.isDropdownOpen()&&!this.telInputEl.disabled&&!this.telInputEl.readOnly&&e()},{signal:t}),this.#C.addEventListener("keydown",o=>{let r=[C.ARROW_UP,C.ARROW_DOWN,C.SPACE,C.ENTER];!this.isDropdownOpen()&&r.includes(o.key)&&(o.preventDefault(),o.stopPropagation(),e()),o.key===C.TAB&&i()},{signal:t})}openDropdown(t,e){let{countrySearch:i,dropdownAlwaysOpen:s,dropdownContainer:o}=this.#t;if(this.#N=new AbortController,this.ensureDropdownWidthSet(),o)this.#K();else{let l=this.#w(),a=this.telInputEl.offsetHeight+L.DROPDOWN_MARGIN;l?this.#s.style.top=`${a}px`:this.#s.style.bottom=`${a}px`}this.#s.classList.remove(d.HIDE),this.#e.setAttribute(h.EXPANDED,"true");let r=this.#y??this.#n.firstElementChild;r&&this.#f(r),i&&!s&&this.#l.focus(),this.#t.useFullscreenPopup&&this.#r&&window.visualViewport&&window.visualViewport.addEventListener("resize",()=>{this.#L(),this.#h&&this.#S(this.#h)},{signal:this.#N.signal}),this.#o.classList.add(d.ARROW_UP),this.#M(t,e)}#M(t,e){let i=this.#N.signal;this.#et(i),this.#j(i,t),this.#t.dropdownAlwaysOpen||this.#it(i,e),this.#b(i,t,e),this.#t.countrySearch&&this.#V(i),!this.#t.useFullscreenPopup&&this.#t.dropdownContainer&&window.addEventListener("scroll",e,{signal:i})}#et(t){this.#n.addEventListener("mouseover",e=>{let i=e.target?.closest(`.${d.COUNTRY_ITEM}`);i&&this.#f(i,!1)},{signal:t})}#j(t,e){this.#n.addEventListener("click",i=>{let s=i.target?.closest(`.${d.COUNTRY_ITEM}`);s&&e(s)},{signal:t})}#it(t,e){setTimeout(()=>{document.documentElement.addEventListener("click",i=>{this.#s.contains(i.target)||e()},{signal:t})},0)}#b(t,e,i){let s="",o=null,r=l=>{[C.ARROW_UP,C.ARROW_DOWN,C.ENTER,C.ESC].includes(l.key)&&(l.preventDefault(),l.stopPropagation(),l.key===C.ARROW_UP||l.key===C.ARROW_DOWN?this.#st(l.key):l.key===C.ENTER&&!l.isComposing?e(this.#h):l.key===C.ESC&&(i(),this.#e.focus())),!this.#t.countrySearch&&l.target!==this.telInputEl&&A.HIDDEN_SEARCH_CHAR.test(l.key)&&(l.stopPropagation(),o&&clearTimeout(o),s+=l.key.toLowerCase(),this.#x(s),o=setTimeout(()=>{s=""},J.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",r,{signal:t})}#V(t){this.#l.addEventListener("input",()=>this.#D(),{signal:t}),this.#u.addEventListener("click",()=>this.#p(),{signal:t})}#x(t){let e=Et(this.#I,t);if(e){let i=this.#O.get(e.iso2);this.#f(i)}}#st(t){let e=t===C.ARROW_UP?this.#h?.previousElementSibling:this.#h?.nextElementSibling;!e&&this.#n.childElementCount>1&&(e=t===C.ARROW_UP?this.#n.lastElementChild:this.#n.firstElementChild),e&&this.#f(e)}#R(t){if(this.#y&&this.#y.dataset[v.ISO2]!==t&&(this.#y.setAttribute(h.SELECTED,"false"),this.#y.querySelector(".iti__country-check")?.remove(),this.#y=null),t&&!this.#y){let e=this.#n.querySelector(`[data-country-code="${t}"]`);if(e){e.setAttribute(h.SELECTED,"true");let i=f("span",{class:"iti__country-check",[h.HIDDEN]:"true"},e);i.innerHTML=Ct(),this.#y=e,this.#t.dropdownAlwaysOpen&&this.#f(e)}}}#G(t){this.#n.replaceChildren();let e=!0;for(let i of t){let s=this.#O.get(i.iso2);s&&(this.#n.appendChild(s),e&&(this.#f(s,!1),e=!1))}e?(this.#f(null),this.#T&&this.#T.classList.remove(d.HIDE)):this.#T&&this.#T.classList.add(d.HIDE),this.#n.scrollTop=0,this.#F()}closeDropdown(){let{countrySearch:t,dropdownContainer:e}=this.#t;this.#N.abort(),this.#N=null,this.#s.classList.add(d.HIDE),this.#e.setAttribute(h.EXPANDED,"false"),t&&(this.#l.removeAttribute(h.ACTIVE_DESCENDANT),this.#l.value="",this.#P(),this.#h&&(this.#h.classList.remove(d.HIGHLIGHT),this.#h=null)),this.#o.classList.remove(d.ARROW_UP),e?(this.#r.remove(),this.#r.style.top="",this.#r.style.bottom="",this.#r.style.paddingLeft="",this.#r.style.paddingRight=""):(this.#s.style.top="",this.#s.style.bottom="")}#w(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInputEl.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#_||i>=e}#K(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#t;if(e){if(window.innerWidth>=L.NARROW_VIEWPORT_WIDTH){let i=this.telInputEl.getBoundingClientRect();this.#r.style.paddingLeft=`${i.left}px`,this.#r.style.paddingRight=`${window.innerWidth-i.right}px`}}else{let i=this.telInputEl.getBoundingClientRect();this.#r.style.left=`${i.left}px`,this.#w()?this.#r.style.top=`${i.bottom+L.DROPDOWN_MARGIN}px`:(this.#r.style.top="unset",this.#r.style.bottom=`${window.innerHeight-i.top+L.DROPDOWN_MARGIN}px`)}t.appendChild(this.#r)}#L(){let t=window.visualViewport;if(!t||!this.#r)return;let e=window.innerHeight-t.height;this.#r.style.bottom=`${e}px`}isDropdownOpen(){return!this.#s.classList.contains(d.HIDE)}setLoading(t){this.#c.classList.toggle(d.LOADING,t)}isLoading(){return this.#c.classList.contains(d.LOADING)}setDisabled(t){this.telInputEl.disabled=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setReadonly(t){this.telInputEl.readOnly=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setCountry(t){let{allowDropdown:e,showFlags:i,separateDialCode:s,i18n:o}=this.#t,r=t?.name,l=t?.dialCode,a=t?.iso2??"";if(e&&this.#R(a),this.#e){let p=a&&i?`${d.FLAG} iti__${a}`:`${d.FLAG} ${d.GLOBE}`,c,m,y;a?(m=r,c=o.selectedCountryAriaLabel.replace("${countryName}",r).replace("${dialCode}",`+${l}`),y=i?"":tt()):(m=o.noCountrySelected,c=o.noCountrySelected,y=tt()),this.#c.className=p,this.#e.setAttribute("title",m),this.#e.setAttribute(h.LABEL,c),this.#c.innerHTML=y}if(s){let p=l?`+${l}`:"";this.#g.textContent=p,this.#W()}}destroy(){this.telInputEl.iti=void 0,delete this.telInputEl.dataset[v.INSTANCE_ID],this.telInputEl.style.paddingLeft=this.#E;let t=this.telInputEl.parentNode;t&&(t.before(this.telInputEl),t.remove()),this.#O.clear()}};var gt=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?S.filter(i=>t.includes(i.iso2)):e?.length?S.filter(i=>!e.includes(i.iso2)):[...S]},bt=(n,t)=>{let{countryNameLocale:e,i18n:i}=t,s;try{typeof Intl<"u"&&typeof Intl.DisplayNames=="function"?s=new Intl.DisplayNames(e,{type:"region"}):s=null}catch(o){console.error(o),s=null}for(let o of n)o.name=i[o.iso2]||s?.of(o.iso2.toUpperCase())||""},It=n=>{let t=new Set,e=0,i={},s=(r,l)=>{if(!r||!l)return;l.length>e&&(e=l.length),Object.hasOwn(i,l)||(i[l]=[]);let a=i[l];a.includes(r)||a.push(r)},o=[...n].sort((r,l)=>r.priority-l.priority);for(let r of o){t.has(r.dialCode)||t.add(r.dialCode);for(let l=1;l<r.dialCode.length;l++){let a=r.dialCode.substring(0,l);s(r.iso2,a)}if(s(r.iso2,r.dialCode),r.areaCodes){let l=i[r.dialCode][0];for(let a of r.areaCodes){for(let p=1;p<a.length;p++){let c=a.substring(0,p),m=r.dialCode+c;s(l,m),s(r.iso2,m)}s(r.iso2,r.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLength:e,dialCodeToIso2Map:i}},Lt=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),r=e.indexOf(s.iso2),l=o>-1,a=r>-1;if(l||a)return l&&a?o-r:l?-1:1}return i.name.localeCompare(s.name)})},At=n=>{for(let t of n)t.normalisedName=W(t.name),t.initials=t.normalisedName.split(/[^a-z]/).map(e=>e[0]).join(""),t.dialCodePlus=`+${t.dialCode}`};var $t=new Set(["800","808","870","881","882","883","888","979"]),et=n=>{let t=w(n).slice(0,3);return n.startsWith("+")&&$t.has(t)};var it=(n,t,e,i)=>{if(!e||!t)return n;let s=`+${i.dialCode}`,o=n[s.length]===" "||n[s.length]==="-"?s.length+1:s.length;return n.substring(o)},vt=(n,t,e,i,s)=>{let o=e?e.formatNumberAsYouType(n,i?.iso2):n,r=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${r}`)?(o.split(`+${r}`)[1]||"").trim():o};var Tt=(n,t,e,i)=>{if(e===0&&!i)return 0;let s=0;for(let o=0;o<t.length;o++){if(/[+0-9]/.test(t[o])&&s++,s===n&&!i)return o+1;if(i&&s===n+1)return o}return t.length};var Ft=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),st=n=>{let t=w(n);if(t.startsWith(F.NANP)&&t.length>=4){let e=t.substring(1,4);return Ft.has(e)}return!1};var K=class{#t;constructor(t){t&&this.#i(t)}#i(t){/[\u0660-\u0669]/.test(t)?this.#t="arabic-indic":/[\u06F0-\u06F9]/.test(t)?this.#t="persian":this.#t="ascii"}denormalise(t){if(!this.#t||this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776;return t.replace(/[0-9]/g,i=>String.fromCharCode(e+Number(i)))}normalise(t){if(!t)return"";if(this.#i(t),this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776,i=this.#t==="arabic-indic"?/[\u0660-\u0669]/g:/[\u06F0-\u06F9]/g;return t.replace(i,s=>String.fromCharCode(48+(s.charCodeAt(0)-e)))}isAscii(){return!this.#t||this.#t==="ascii"}};var Bt=0,M=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},wt=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},x=class n{id;promise;#t;#i;#A;#E;#I;#v;#_;#C;#e=null;#c=null;#g;#o=!0;#s;#m;#l=!1;#u;#n;constructor(t,e={}){this.id=Bt++,P.validateInput(t);let i=dt(e);this.#i={...V,...i},ht(this.#i),pt(this.#i),this.#t=new P(t,this.#i,this.id),this.#A=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),this.#m=new K(t.value),this.promise=this.#T(this.#i),this.#E=gt(this.#i);let{dialCodes:s,dialCodeMaxLength:o,dialCodeToIso2Map:r}=It(this.#E);this.#_=s,this.#I=o,this.#v=r,this.#C=new Map(this.#E.map(l=>[l.iso2,l])),this.#H()}#a(){let t=this.#t.telInputEl.value.trim();return this.#m.normalise(t)}#d(t){this.#t.telInputEl.value=this.#m.denormalise(t)}#T(t){let{initialCountry:e,geoIpLookup:i,loadUtils:s}=t,o=e===k.AUTO&&!!i,r=!!s&&!u.utils;return o&&(this.#u=wt()),r&&(this.#n=wt()),Promise.all([this.#u?.promise,this.#n?.promise]).then(()=>{})}#H(){this.#s=new AbortController,this.#r(),this.#t.buildMarkup(this.#E),this.#y(),this.#h(),this.#O(),this.#i.dropdownAlwaysOpen&&this.#S()}#r(){bt(this.#E,this.#i),Lt(this.#E,this.#i),At(this.#E)}#y(t=!1){let e=this.#t.telInputEl.getAttribute("value"),i=this.#m.normalise(e??""),s=this.#a(),r=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,l=this.#w(r),a=st(r),{initialCountry:p,geoIpLookup:c}=this.#i,m=p===k.AUTO&&c,y=m&&u.autoCountry?u.autoCountry:p,T=m&&!t&&!u.autoCountry,I=N(y);l?a?I?this.#b(y):T||this.#b(nt.ISO2):(I&&this.#b(y),this.#M(r)):I?this.#b(y):T||this.#b(""),r&&this.#f(r)}#h(){this.#z(),this.#i.allowDropdown&&this.#t.bindAllInitialDropdownListeners(this.#s.signal,()=>this.#S(),()=>this.#R()),this.#t.bindHiddenInputSubmitListener(this.#s.signal,()=>this.getNumber(),()=>this.#e?.iso2||"")}#O(){if(this.#n){let{loadUtils:t}=this.#i,e=()=>{u.attachUtils(t)?.catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#s.signal})}this.#u&&(this.#e?this.#u.resolve():this.#N())}#N(){if(u.autoCountry){this.#rt();return}if(this.#t.setLoading(!0),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#i.geoIpLookup=="function")){let t=(i="")=>{let s=i.toLowerCase();N(s)?(u.autoCountry=s,setTimeout(()=>n.forEachInstance("handleAutoCountryLoaded"))):n.forEachInstance("handleAutoCountryFailure")},e=()=>{n.forEachInstance("handleAutoCountryFailure")};this.#i.geoIpLookup(t,e)}}#k(){this.#S(),this.#t.prefillSearchWithPlus()}#U(t){let e=this.#t.telInputEl.selectionStart||0,i=t.substring(0,e-1),s=t.substring(e);return this.#d(i+s),e-1}#z(){this.#W(),this.#Z(),this.#F()}#X(t){this.#U(t),this.#k()}#q(t,e){let i=this.#U(t);this.#t.telInputEl.setSelectionRange(i,i),this.#D(),this.#p(b.STRICT_REJECT,{source:"key",rejectedInput:e,reason:"invalid"})}#J(t,e){let i=this.#t.telInputEl.selectionStart||0,o=t.substring(0,i).replace(A.NON_PLUS_NUMERIC_GLOBAL,"").length,r=this.#L(),l=vt(r,t,u.utils,this.#e,this.#i.separateDialCode),a=Tt(o,l,i,e);this.#d(l),this.#t.telInputEl.setSelectionRange(a,a)}#Q(t){if(t.startsWith("+")&&this.#e&&this.#w(t)){let e=it(t,!0,!0,this.#e);this.#d(e)}}#W(){this.#l=A.ALPHA_UNICODE.test(this.#a()),this.#t.telInputEl.addEventListener("input",this.#$,{signal:this.#s.signal})}#$=t=>{let{strictMode:e,formatAsYouType:i,separateDialCode:s,allowDropdown:o,countrySearch:r}=this.#i,l=t?.detail;if(l?.isCountryChange)return;let a=this.#a();if(this.#A&&t?.data==="+"&&s&&o&&r){this.#X(a);return}if(this.#A&&e&&(t?.data===" "||t?.data==="-"||t?.data===".")){this.#q(a,t.data);return}this.#M(a)&&this.#Y();let p=t?.data&&A.NON_PLUS_NUMERIC.test(t.data),c=t?.inputType===q.PASTE&&a;p||c&&!e?this.#l=!0:A.NON_PLUS_NUMERIC.test(a)||(this.#l=!1),i&&!this.#l&&!l?.isSetNumber&&this.#m.isAscii()&&this.#J(a,t?.inputType===q.DELETE_FORWARD),s&&this.#Q(a)};#Z(){let{strictMode:t,separateDialCode:e}=this.#i;!t&&!e||this.#t.telInputEl.addEventListener("keydown",this.#tt,{signal:this.#s.signal})}#tt=t=>{let{strictMode:e,separateDialCode:i,allowDropdown:s,countrySearch:o}=this.#i;if(!t.key||t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey)return;if(i&&s&&o&&t.key==="+"){t.preventDefault(),this.#k();return}if(!e)return;let r=this.#a(),a=!r.startsWith("+")&&this.#t.telInputEl.selectionStart===0&&t.key==="+",p=this.#m.normalise(t.key),c=/^[0-9]$/.test(p),m=i?c:a||c,y=this.#t.telInputEl,T=y.selectionStart,I=y.selectionEnd,$=r.slice(0,T??void 0),D=r.slice(I??void 0),g=$+p+D,_=this.#K(g),H=!1;u.utils&&this.#c&&(H=u.utils.getCoreNumber(_,this.#e?.iso2).length>this.#c);let Y=this.#j(_)!==null;(!m||H&&!Y&&!a)&&(this.#D(),this.#p(b.STRICT_REJECT,{source:"key",rejectedInput:t.key,reason:m?"max-length":"invalid"}),t.preventDefault())};#F(){this.#i.strictMode&&this.#t.telInputEl.addEventListener("paste",this.#B,{signal:this.#s.signal})}#B=t=>{t.preventDefault();let e=this.#t.telInputEl,i=e.selectionStart,s=e.selectionEnd,o=this.#a(),r=o.slice(0,i??void 0),l=o.slice(s??void 0),a=this.#e?.iso2,p=t.clipboardData.getData("text"),c=this.#m.normalise(p),m=i===0&&s>0,y=!o.startsWith("+")||m,T=c.replace(A.NON_PLUS_NUMERIC_GLOBAL,""),I=T.startsWith("+"),$=T.replace(/\+/g,""),D=I&&y?`+${$}`:$,g=r+D+l,_=D!==c?"invalid":null;if(g.length>5&&u.utils){let O=u.utils.getCoreNumber(g,a);for(;O.length===0&&g.length>0;)g=g.slice(0,-1),O=u.utils.getCoreNumber(g,a);if(!O){this.#D(),this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:"max-length"});return}if(this.#c&&O.length>this.#c)if(e.selectionEnd===o.length){let Y=O.length-this.#c;g=g.slice(0,g.length-Y),_="max-length"}else{this.#D(),this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:"max-length"});return}}this.#d(g);let H=i+D.length;e.setSelectionRange(H,H),e.dispatchEvent(new InputEvent("input",{bubbles:!0})),_&&(c.length>0&&D.length===0&&this.#D(),this.#p(b.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:_}))};#P(t){let e=Number(this.#t.telInputEl.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#D(){if(!this.#i.strictRejectAnimation)return;let t=this.#t.telInputEl.parentElement;t&&(t.classList.remove("iti__strict-reject-animation"),t.offsetWidth,t.classList.add("iti__strict-reject-animation"))}#p(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInputEl.dispatchEvent(i)}#S(){this.#t.openDropdown(t=>this.#st(t),()=>this.#R()),this.#p(b.OPEN_COUNTRY_DROPDOWN)}#f(t){let{formatOnDisplay:e,nationalMode:i,separateDialCode:s}=this.#i,o=t;if(e&&u.utils&&this.#e){let r=et(t),l=i&&!r||!o.startsWith("+")&&!s,{NATIONAL:a,INTERNATIONAL:p}=u.utils.numberFormat,c=l?a:p;o=u.utils.formatNumber(o,this.#e?.iso2,c)}o=this.#nt(o),this.#d(o)}#M(t){let e=this.#j(t);return e!==null?this.#b(e):!1}#et(t){let e=this.#e?.dialCode,i=this.#e?.nationalPrefix;if(t.startsWith("+")||!e)return t;let r=i&&t.startsWith(i)&&!this.#i.separateDialCode?t.substring(1):t;return`+${e}${r}`}#j(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#e?.iso2;i=this.#et(i);let o=this.#w(i,!0),r=w(i);if(o){let l=w(o),a=this.#v[l];return a.length===1?a[0]===s?null:a[0]:this.#it(a,l,r)}else if(i.startsWith("+")&&r.length){let l=this.#e?.dialCode||"";return l&&l.startsWith(r)?null:""}else if((!i||i==="+")&&!s&&this.#g)return this.#g;return null}#it(t,e,i){let s=this.#e?.iso2,o=this.#e?.dialCode;if(!s&&this.#g&&t.includes(this.#g))return this.#g;if(o===F.NANP&&st(i))return null;let l=this.#e?.areaCodes,a=this.#e?.priority;if(l){let T=l.map(I=>`${o}${I}`);for(let I of T)if(i.startsWith(I))return null}let c=l&&!(a===0)&&i.length>e.length,m=s&&t.includes(s)&&!c,y=s===t[0];return!m&&!y?t[0]:null}#b(t){let e=this.#e?.iso2||"";return this.#e=t?this.#C.get(t):null,this.#e&&(this.#g=this.#e.iso2),this.#t.setCountry(this.#e),this.#x(),this.#V(),e!==t}#V(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#i;if(!t||!u.utils)return;let s=this.#e?.iso2;if(!s){this.#c=null;return}let o=u.utils.numberType[e],r=u.utils.getExampleNumber(s,!1,o,!0),l=r;for(;u.utils.isPossibleNumber(r,s,i);)l=r,r+="0";let a=u.utils.getCoreNumber(l,s);this.#c=a.length,s==="by"&&(this.#c=a.length+1)}#x(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:s}=this.#i,o=t===R.AGGRESSIVE||!this.#t.hadInitialPlaceholder&&t===R.POLITE;if(!u.utils||!o)return;let r=u.utils.numberType[e],l=this.#e?u.utils.getExampleNumber(this.#e.iso2,i,r):"";l=this.#nt(l),typeof s=="function"&&(l=s(l,this.#e)),this.#t.telInputEl.setAttribute("placeholder",l)}#st(t){if(!t)return;let e=t.dataset[v.ISO2],i=this.#b(e);this.#R();let s=t.dataset[v.DIAL_CODE];if(this.#G(s),this.#i.formatOnDisplay){let o=this.#a();this.#f(o)}this.#t.telInputEl.focus(),i&&(this.#Y(),this.#p(b.INPUT,{isCountryChange:!0}))}#R(t){!this.#t.isDropdownOpen()||this.#i.dropdownAlwaysOpen&&!t||(this.#t.closeDropdown(),this.#p(b.CLOSE_COUNTRY_DROPDOWN))}#G(t){let e=this.#a();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#w(e),o;s?o=e.replace(s,i):o=i,this.#d(o)}#w(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let r=0;r<t.length;r++){let l=t.charAt(r);if(!/[0-9]/.test(l))continue;if(s+=l,!!!this.#v[s])break;if(this.#_.has(s)){if(i=t.substring(0,r+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,r+1));if(s.length===this.#I)break}return i}#K(t){let e=this.#e?.dialCode,i=w(t);return(this.#i.separateDialCode&&!t.startsWith("+")&&e&&i?`+${e}`:"")+t}#L(){let t=this.#a();return this.#K(t)}#nt(t){let e=!!this.#w(t),i=it(t,e,this.#i.separateDialCode,this.#e);return this.#P(i)}#ot(){let t=this.#e;if(!t)return null;let{iso2:e,dialCode:i,name:s}=t;return{iso2:e,dialCode:i,name:s}}#Y(){let t=this.#ot();this.#p(b.COUNTRY_CHANGE,t)}#rt(){if(!(!this.#u||!u.autoCountry)){if(!this.#o){this.#u.resolve();return}this.#t.isLoading()?this.setCountry(u.autoCountry):this.#g=u.autoCountry,this.#t.setLoading(!1),this.#u.resolve()}}#at(){if(!this.#o){this.#u?.reject();return}this.#y(!0),this.#t.setLoading(!1),this.#u?.reject()}#ut(){if(!this.#o){this.#n?.resolve();return}if(!u.utils){this.#n?.resolve();return}let t=this.#a();t&&this.#f(t),this.#e&&(this.#x(),this.#V()),this.#n?.resolve()}#ct(t){if(!this.#o){this.#n?.reject(t);return}this.#n?.reject(t)}destroy(){this.#o&&(this.#o=!1,this.#i.allowDropdown&&this.#R(!0),this.#s.abort(),this.#t.destroy(),u.instances.delete(String(this.id)))}isActive(){return this.#o}getExtension(){return this.#o?(M("getExtension"),u.utils.getExtension(this.#L(),this.#e?.iso2)):""}getNumber(t){if(!this.#o)return"";M("getNumber");let e=this.#e?.iso2,i=this.#L(),s=u.utils.formatNumber(i,e,t);return this.#m.denormalise(s)}getNumberType(){return this.#o?(M("getNumberType"),u.utils.getNumberType(this.#L(),this.#e?.iso2)):Q.UNKNOWN_NUMBER_TYPE}getSelectedCountryData(){return this.#ot()}getValidationError(){if(!this.#o)return Q.UNKNOWN_VALIDATION_ERROR;M("getValidationError");let t=this.#e?.iso2;return u.utils.getValidationError(this.#L(),t)}isValidNumber(){if(!this.#o)return null;M("isValidNumber");let t=this.#e?.dialCode,e=this.#e?.iso2,i=this.#L(),s=u.utils.getCoreNumber(i,e);if(s){if(t===B.DIAL_CODE&&s[0]===B.MOBILE_PREFIX&&s.length!==B.MOBILE_CORE_LENGTH)return!1;if(!A.ALPHA_UNICODE.test(i)&&t){let r=i.startsWith("+")?i.slice(1+t.length):i,l=w(r).length;if(s.length>l)return!1}}return this.#lt("possible")}isValidNumberPrecise(){return this.#o?(M("isValidNumberPrecise"),this.#lt("precise")):null}#lt(t){let{allowNumberExtensions:e,allowPhonewords:i,allowedNumberTypes:s}=this.#i,o=this.#e?.iso2,r=this.#L();return!this.#e&&!et(r)||!(t==="precise"?u.utils.isValidNumber:u.utils.isPossibleNumber)(r,o,s)?!1:A.ALPHA_UNICODE.test(r)?!!u.utils.getExtension(r,o)?e:i:!0}setCountry(t){if(!this.#o)return;let e=t?.toLowerCase();if(!N(e))throw new Error(`Invalid iso2 code: '${e}'`);let i=this.#e?.iso2;if(t&&e!==i||!t&&i){if(this.#b(e),this.#G(this.#e?.dialCode||""),this.#i.formatOnDisplay){let o=this.#a();this.#f(o)}this.#Y(),this.#p(b.INPUT,{isCountryChange:!0})}}setNumber(t){if(!this.#o)return;let e=this.#m.normalise(t),i=this.#M(e);this.#f(e),i&&this.#Y(),this.#p(b.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.#o&&(this.#i.placeholderNumberType=t,this.#x())}setDisabled(t){this.#o&&this.#t.setDisabled(t)}setReadonly(t){this.#o&&this.#t.setReadonly(t)}static forEachInstance(t,...e){let i=[...u.instances.values()],s=e[0];i.forEach(o=>{if(o instanceof n)switch(t){case"handleUtilsLoaded":o.#ut();break;case"handleUtilsFailure":o.#ct(s);break;case"handleAutoCountryLoaded":o.#rt();break;case"handleAutoCountryFailure":o.#at();break}})}},jt=n=>{if(!u.utils&&!u.startedLoadingUtils){let t;if(typeof n=="function")try{t=Promise.resolve(n())}catch(e){return Promise.reject(e)}else return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof n}`));return u.startedLoadingUtils=!0,t.then(e=>{let i=e?.default;if(!i||typeof i!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return u.utils=i,x.forEachInstance("handleUtilsLoaded"),!0}).catch(e=>{throw x.forEachInstance("handleUtilsFailure",e),e})}return null},u=Object.assign((n,t)=>{let e=new x(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:V,documentReady:()=>document.readyState==="complete",getCountryData:()=>S,getInstance:n=>{let t=n.dataset[v.INSTANCE_ID];return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:jt,startedLoadingUtils:!1,startedLoadingAutoCountry:!1,version:"27.3.0"}),Vt=u;return Rt(Gt);})();
24
+ </svg>`;var yt=n=>{let t=new Map;for(let e of n){let i=G(e.name),s=i.split(/[^a-z]/).map(o=>o[0]).join("");t.set(e.iso2,{normalisedName:i,initials:s,dialCodePlus:`+${e.dialCode}`})}return t},Et=(n,t,e)=>{let i=G(e),s=[],o=[],r=[],l=[],a=[],p=[];for(let d of n){let C=t.get(d.iso2);d.iso2===i?s.push(d):C.normalisedName.startsWith(i)?o.push(d):C.normalisedName.includes(i)?r.push(d):i===d.dialCode||i===C.dialCodePlus?l.push(d):C.dialCodePlus.includes(i)?a.push(d):C.initials.includes(i)&&p.push(d)}let m=(d,C)=>d.priority-C.priority;return[...s,...o,...r,...l.sort(m),...a.sort(m),...p]},gt=(n,t,e)=>{let i=G(e);for(let s of n){let{normalisedName:o}=t.get(s.iso2);if(o.startsWith(i))return s}return null};var R=class n{#t;static toAscii(t){return t?t.replace(/[٠-٩]/g,e=>String.fromCharCode(48+(e.charCodeAt(0)-1632))).replace(/[۰-۹]/g,e=>String.fromCharCode(48+(e.charCodeAt(0)-1776))):""}constructor(t){t&&this.#i(t)}#i(t){/[٠-٩]/.test(t)?this.#t="arabic-indic":/[۰-۹]/.test(t)?this.#t="persian":this.#t="ascii"}denormalise(t){if(!this.#t||this.#t==="ascii")return t;let e=this.#t==="arabic-indic"?1632:1776;return t.replace(/[0-9]/g,i=>String.fromCharCode(e+Number(i)))}normalise(t){return t?(this.#i(t),this.#t==="ascii"?t:n.toAscii(t)):""}isAscii(){return!this.#t||this.#t==="ascii"}};var P=class n{#t;#i;#T;#E="";#I;#N;#D=null;#_;#C;#e;#c;#g;#o;#s;#m;#l;#u;#n;#a;#h;#A;#k;#r;#y=null;#p=null;#O=new Map;#S=null;telInputEl;hadInitialPlaceholder;constructor(t,e,i){t.dataset[A.INSTANCE_ID]=i.toString(),this.telInputEl=t,this.#t=e,this.#i=i,this.hadInitialPlaceholder=!!t.getAttribute("placeholder"),this.#T=!!this.telInputEl.closest("[dir=rtl]"),this.#E=this.telInputEl.style.paddingLeft}static validateInput(t){let e=t?.tagName;if(!(!!t&&typeof t=="object"&&e==="INPUT"&&typeof t.setAttribute=="function")){let s=Object.prototype.toString.call(t);throw new TypeError(`The first argument must be an HTMLInputElement, not ${s}`)}}buildMarkup(t,e){this.#I=t,this.#N=e,this.telInputEl.classList.add("iti__tel-input"),this.telInputEl.hasAttribute("type")||this.telInputEl.setAttribute("type","tel"),this.telInputEl.hasAttribute("autocomplete")||this.telInputEl.setAttribute("autocomplete","tel"),this.telInputEl.hasAttribute("inputmode")||this.telInputEl.setAttribute("inputmode","tel");let i=this.#U();this.#W(i),i.appendChild(this.telInputEl),this.#J(),this.#Q(i),this.ensureDropdownWidthSet()}#U(){let{allowDropdown:t,showFlags:e,containerClass:i,useFullscreenPopup:s}=this.#t,o=K({iti:!0,"iti--allow-dropdown":t,"iti--show-flags":e,"iti--inline-dropdown":!s,[i]:!!i}),r=f("div",{class:o});return this.#T&&r.setAttribute("dir","ltr"),this.telInputEl.before(r),r}#W(t){let{allowDropdown:e,separateDialCode:i,showFlags:s}=this.#t;if(!e&&!s&&!i)return;this.#C=f("div",{class:`iti__country-container ${c.V_HIDE}`},t),e?(this.#e=f("button",{type:"button",class:"iti__selected-country",[h.EXPANDED]:"false",[h.LABEL]:this.#t.i18n.noCountrySelected,[h.HASPOPUP]:"dialog",[h.CONTROLS]:`iti-${this.#i}__dropdown-content`},this.#C),this.telInputEl.disabled&&this.#e.setAttribute("disabled","true")):this.#e=f("div",{class:"iti__selected-country"},this.#C);let o=f("div",{class:"iti__selected-country-primary"},this.#e);this.#c=f("div",{class:c.FLAG},o),e&&(this.#o=f("div",{class:"iti__arrow",[h.HIDDEN]:"true"},o)),i&&(this.#g=f("div",{class:"iti__selected-dial-code"},this.#e)),e&&this.#X()}ensureDropdownWidthSet(){let{fixDropdownWidth:t,allowDropdown:e}=this.#t;if(!e||!t||this.#s.style.width)return;let i=this.telInputEl.offsetWidth;i>0&&(this.#s.style.width=`${i}px`)}#X(){let{fixDropdownWidth:t,useFullscreenPopup:e,countrySearch:i,i18n:s,dropdownContainer:o,containerClass:r}=this.#t,l=t?"":"iti--flexible-dropdown-width";if(this.#s=f("div",{id:`iti-${this.#i}__dropdown-content`,class:`iti__dropdown-content ${c.HIDE} ${l}`,role:"dialog",[h.MODAL]:"true"}),this.#T&&this.#s.setAttribute("dir","rtl"),i&&this.#q(),this.#n=f("ul",{class:"iti__country-list",id:`iti-${this.#i}__country-listbox`,role:"listbox",[h.LABEL]:s.countryListAriaLabel},this.#s),this.#Z(),i&&this.#F(),e||(this.#_=this.#et(),i&&(this.#s.style.height=`${this.#_}px`)),o){let a=K({iti:!0,"iti--container":!0,"iti--fullscreen-popup":e,"iti--inline-dropdown":!e,[r]:!!r});this.#r=f("div",{class:a}),this.#r.appendChild(this.#s)}else this.#C.appendChild(this.#s)}#q(){let{i18n:t,searchInputClass:e}=this.#t,i=f("div",{class:"iti__search-input-wrapper"},this.#s);this.#m=f("span",{class:"iti__search-icon",[h.HIDDEN]:"true"},i),this.#m.innerHTML=ft(),this.#l=f("input",{id:`iti-${this.#i}__search-input`,type:"search",class:`iti__search-input ${e}`,placeholder:t.searchPlaceholder,role:"combobox",[h.EXPANDED]:"true",[h.LABEL]:t.searchPlaceholder,[h.CONTROLS]:`iti-${this.#i}__country-listbox`,[h.AUTOCOMPLETE]:"list",autocomplete:"off"},i),this.#u=f("button",{type:"button",class:`iti__search-clear ${c.HIDE}`,[h.LABEL]:t.clearSearchAriaLabel,tabindex:"-1"},i),this.#u.innerHTML=mt(this.#i),this.#k=f("span",{class:"iti__a11y-text"},this.#s),this.#A=f("div",{class:`iti__no-results ${c.HIDE}`,[h.HIDDEN]:"true"},this.#s),this.#A.textContent=t.searchEmptyState??null}#J(){this.#C&&(this.#$(),this.#C.classList.remove(c.V_HIDE))}#Q(t){let{hiddenInput:e}=this.#t;if(!e)return;let i=this.telInputEl.getAttribute("name")||"",s=e(i);if(s.phone){let o=this.telInputEl.form?.querySelector(`input[name="${s.phone}"]`);o?this.#a=o:(this.#a=f("input",{type:"hidden",name:s.phone}),t.appendChild(this.#a))}if(s.country){let o=this.telInputEl.form?.querySelector(`input[name="${s.country}"]`);o?this.#h=o:(this.#h=f("input",{type:"hidden",name:s.country}),t.appendChild(this.#h))}}#Z(){let t=document.createDocumentFragment();for(let e=0;e<this.#I.length;e++){let i=this.#I[e],s=K({[c.COUNTRY_ITEM]:!0}),o=f("li",{id:`iti-${this.#i}__item-${i.iso2}`,class:s,tabindex:"-1",role:"option",[h.SELECTED]:"false"});o.dataset[A.DIAL_CODE]=i.dialCode,o.dataset[A.ISO2]=i.iso2,this.#O.set(i.iso2,o),this.#t.showFlags&&f("div",{class:`${c.FLAG} iti__${i.iso2}`},o);let r=f("span",{class:"iti__country-name"},o);r.textContent=`${i.name} `;let l=f("span",{class:"iti__dial-code"},r);this.#T&&l.setAttribute("dir","ltr"),l.textContent=`(+${i.dialCode})`,t.appendChild(o)}this.#n.appendChild(t)}#$(){if(this.#e){let t=this.#t.separateDialCode?L.FALLBACK_SELECTED_WITH_DIAL_WIDTH:L.FALLBACK_SELECTED_NO_DIAL_WIDTH,i=(this.#e.offsetWidth||this.#tt()||t)+L.INPUT_PADDING_EXTRA_LEFT;this.telInputEl.style.paddingLeft=`${i}px`}}static#B(){let t;try{t=window.top.document.body}catch{t=document.body}return t}#tt(){if(!this.telInputEl.parentNode)return 0;let t=n.#B(),e=this.telInputEl.parentNode.cloneNode(!1);e.style.visibility="hidden",t.appendChild(e);let i=this.#C.cloneNode();e.appendChild(i);let s=this.#e.cloneNode(!0);i.appendChild(s);let o=s.offsetWidth;return t.removeChild(e),o}#et(){let t=n.#B();this.#s.classList.remove(c.HIDE);let e=f("div",{class:"iti iti--inline-dropdown"});e.appendChild(this.#s),e.style.visibility="hidden",t.appendChild(e);let i=this.#s.offsetHeight;return t.removeChild(e),e.style.visibility="",this.#s.classList.add(c.HIDE),i>0?i:L.FALLBACK_DROPDOWN_HEIGHT}#F(){let{i18n:t}=this.#t,e=this.#n.childElementCount;this.#k.textContent=t.searchSummaryAria(e)}#j(t){let e;if(t==="")e=this.#I;else{let i=R.toAscii(t);e=Et(this.#I,this.#N,i)}this.#K(e)}prefillSearchWithPlus(){this.#l.value="+",this.#l.focus(),this.#j("")}#P(){let t=this.#l.value.trim();this.#j(t),this.#l.value?this.#u.classList.remove(c.HIDE):this.#u.classList.add(c.HIDE)}#v(){this.#D&&clearTimeout(this.#D),this.#D=setTimeout(()=>{this.#P(),this.#D=null},J.SEARCH_DEBOUNCE_MS)}#d(){this.#l.value="",this.#l.focus(),this.#P()}#M(t){let e=this.#n,i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=s.top-i.top+e.scrollTop;s.top<i.top?e.scrollTop=o:s.bottom>i.bottom&&(e.scrollTop=o-i.height+s.height)}#f(t,e=!0){if(this.#p?.classList.remove(c.HIGHLIGHT),t){if(t.classList.add(c.HIGHLIGHT),this.#t.countrySearch){let i=t.getAttribute("id")||"";this.#l.setAttribute(h.ACTIVE_DESCENDANT,i)}e&&this.#M(t),this.#p=t}else this.#p=null}bindHiddenInputSubmitListener(t,e,i){let s=this.telInputEl.form;!s||!this.#a&&!this.#h||s.addEventListener("submit",()=>{this.#a&&(this.#a.value=e()),this.#h&&(this.#h.value=i())},{signal:t})}bindAllInitialDropdownListeners(t,e,i){let s=this.telInputEl.closest("label");s&&s.addEventListener("click",o=>{this.isDropdownOpen()?o.preventDefault():this.telInputEl.focus()},{signal:t}),this.#e.addEventListener("click",()=>{!this.isDropdownOpen()&&!this.telInputEl.disabled&&!this.telInputEl.readOnly&&e()},{signal:t}),this.#C.addEventListener("keydown",o=>{let r=[y.ARROW_UP,y.ARROW_DOWN,y.SPACE,y.ENTER];!this.isDropdownOpen()&&r.includes(o.key)&&(o.preventDefault(),o.stopPropagation(),e()),o.key===y.TAB&&i()},{signal:t})}openDropdown(t,e){let{countrySearch:i,dropdownAlwaysOpen:s,dropdownContainer:o}=this.#t;if(this.#S=new AbortController,this.ensureDropdownWidthSet(),o)this.#Y();else{let l=this.#w(),a=this.telInputEl.offsetHeight+L.DROPDOWN_MARGIN;l?this.#s.style.top=`${a}px`:this.#s.style.bottom=`${a}px`}this.#s.classList.remove(c.HIDE),this.#e.setAttribute(h.EXPANDED,"true");let r=this.#y??this.#n.firstElementChild;r&&this.#f(r),i&&!s&&this.#l.focus(),this.#t.useFullscreenPopup&&this.#r&&window.visualViewport&&window.visualViewport.addEventListener("resize",()=>{this.#L(),this.#p&&this.#M(this.#p)},{signal:this.#S.signal}),this.#o.classList.add(c.ARROW_UP),this.#x(t,e)}#x(t,e){let i=this.#S.signal;this.#it(i),this.#V(i,t),this.#t.dropdownAlwaysOpen||this.#st(i,e),this.#b(i,t,e),this.#t.countrySearch&&this.#G(i),!this.#t.useFullscreenPopup&&this.#t.dropdownContainer&&window.addEventListener("scroll",e,{signal:i})}#it(t){this.#n.addEventListener("mouseover",e=>{let i=e.target?.closest(`.${c.COUNTRY_ITEM}`);i&&this.#f(i,!1)},{signal:t})}#V(t,e){this.#n.addEventListener("click",i=>{let s=i.target?.closest(`.${c.COUNTRY_ITEM}`);s&&e(s)},{signal:t})}#st(t,e){setTimeout(()=>{document.documentElement.addEventListener("click",i=>{this.#s.contains(i.target)||e()},{signal:t})},0)}#b(t,e,i){let s="",o=null,r=l=>{[y.ARROW_UP,y.ARROW_DOWN,y.ENTER,y.ESC].includes(l.key)&&(l.preventDefault(),l.stopPropagation(),l.key===y.ARROW_UP||l.key===y.ARROW_DOWN?this.#nt(l.key):l.key===y.ENTER&&!l.isComposing?e(this.#p):l.key===y.ESC&&(i(),this.#e.focus())),!this.#t.countrySearch&&l.target!==this.telInputEl&&T.HIDDEN_SEARCH_CHAR.test(l.key)&&(l.stopPropagation(),o&&clearTimeout(o),s+=l.key.toLowerCase(),this.#H(s),o=setTimeout(()=>{s=""},J.HIDDEN_SEARCH_RESET_MS))};document.addEventListener("keydown",r,{signal:t})}#G(t){this.#l.addEventListener("input",()=>this.#v(),{signal:t}),this.#u.addEventListener("click",()=>this.#d(),{signal:t})}#H(t){let e=gt(this.#I,this.#N,t);if(e){let i=this.#O.get(e.iso2);this.#f(i)}}#nt(t){let e=t===y.ARROW_UP?this.#p?.previousElementSibling:this.#p?.nextElementSibling;!e&&this.#n.childElementCount>1&&(e=t===y.ARROW_UP?this.#n.lastElementChild:this.#n.firstElementChild),e&&this.#f(e)}#R(t){if(this.#y&&this.#y.dataset[A.ISO2]!==t&&(this.#y.setAttribute(h.SELECTED,"false"),this.#y.querySelector(".iti__country-check")?.remove(),this.#y=null),t&&!this.#y){let e=this.#n.querySelector(`[data-country-code="${t}"]`);if(e){e.setAttribute(h.SELECTED,"true");let i=f("span",{class:"iti__country-check",[h.HIDDEN]:"true"},e);i.innerHTML=Ct(),this.#y=e,this.#t.dropdownAlwaysOpen&&this.#f(e)}}}#K(t){this.#n.replaceChildren();let e=!0;for(let i of t){let s=this.#O.get(i.iso2);s&&(this.#n.appendChild(s),e&&(this.#f(s,!1),e=!1))}e?(this.#f(null),this.#A&&this.#A.classList.remove(c.HIDE)):this.#A&&this.#A.classList.add(c.HIDE),this.#n.scrollTop=0,this.#F()}closeDropdown(){let{countrySearch:t,dropdownContainer:e}=this.#t;this.#S.abort(),this.#S=null,this.#s.classList.add(c.HIDE),this.#e.setAttribute(h.EXPANDED,"false"),t&&(this.#l.removeAttribute(h.ACTIVE_DESCENDANT),this.#l.value="",this.#P(),this.#p&&(this.#p.classList.remove(c.HIGHLIGHT),this.#p=null)),this.#o.classList.remove(c.ARROW_UP),e?(this.#r.remove(),this.#r.style.top="",this.#r.style.bottom="",this.#r.style.paddingLeft="",this.#r.style.paddingRight=""):(this.#s.style.top="",this.#s.style.bottom="")}#w(){if(this.#t.dropdownAlwaysOpen)return!0;let t=this.telInputEl.getBoundingClientRect(),e=t.top,i=window.innerHeight-t.bottom;return i>=this.#_||i>=e}#Y(){let{dropdownContainer:t,useFullscreenPopup:e}=this.#t;if(e){if(window.innerWidth>=L.NARROW_VIEWPORT_WIDTH){let i=this.telInputEl.getBoundingClientRect();this.#r.style.paddingLeft=`${i.left}px`,this.#r.style.paddingRight=`${window.innerWidth-i.right}px`}}else{let i=this.telInputEl.getBoundingClientRect();this.#r.style.left=`${i.left}px`,this.#w()?this.#r.style.top=`${i.bottom+L.DROPDOWN_MARGIN}px`:(this.#r.style.top="unset",this.#r.style.bottom=`${window.innerHeight-i.top+L.DROPDOWN_MARGIN}px`)}t.appendChild(this.#r)}#L(){let t=window.visualViewport;if(!t||!this.#r)return;let e=window.innerHeight-t.height;this.#r.style.bottom=`${e}px`}isDropdownOpen(){return!this.#s.classList.contains(c.HIDE)}setLoading(t){this.#c.classList.toggle(c.LOADING,t)}isLoading(){return this.#c.classList.contains(c.LOADING)}setDisabled(t){this.telInputEl.disabled=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setReadonly(t){this.telInputEl.readOnly=t,this.#e&&(t?this.#e.setAttribute("disabled","true"):this.#e.removeAttribute("disabled"))}setCountry(t){let{allowDropdown:e,showFlags:i,separateDialCode:s,i18n:o}=this.#t,r=t?.name,l=t?.dialCode,a=t?.iso2??"";if(e&&this.#R(a),this.#e){let p=a&&i?`${c.FLAG} iti__${a}`:`${c.FLAG} ${c.GLOBE}`,m,d,C;a?(d=r,m=o.selectedCountryAriaLabel.replace("${countryName}",r).replace("${dialCode}",`+${l}`),C=i?"":tt()):(d=o.noCountrySelected,m=o.noCountrySelected,C=tt()),this.#c.className=p,this.#e.setAttribute("title",d),this.#e.setAttribute(h.LABEL,m),this.#c.innerHTML=C}if(s){let p=l?`+${l}`:"";this.#g.textContent=p,this.#$()}}destroy(){this.telInputEl.iti=void 0,delete this.telInputEl.dataset[A.INSTANCE_ID],this.telInputEl.style.paddingLeft=this.#E;let t=this.telInputEl.parentNode;t&&(t.before(this.telInputEl),t.remove()),this.#O.clear()}};var bt=n=>{let{onlyCountries:t,excludeCountries:e}=n;return t?.length?O.filter(i=>t.includes(i.iso2)):e?.length?O.filter(i=>!e.includes(i.iso2)):[...O]},It=(n,t)=>{let{countryNameLocale:e,i18n:i}=t,s;try{typeof Intl<"u"&&typeof Intl.DisplayNames=="function"?s=new Intl.DisplayNames(e,{type:"region"}):s=null}catch(o){console.error(o),s=null}for(let o of n)o.name=i[o.iso2]||s?.of(o.iso2.toUpperCase())||""},Lt=n=>{let t=new Set,e=0,i={},s=(r,l)=>{if(!r||!l)return;l.length>e&&(e=l.length),Object.hasOwn(i,l)||(i[l]=[]);let a=i[l];a.includes(r)||a.push(r)},o=[...n].sort((r,l)=>r.priority-l.priority);for(let r of o){t.has(r.dialCode)||t.add(r.dialCode);for(let l=1;l<r.dialCode.length;l++){let a=r.dialCode.substring(0,l);s(r.iso2,a)}if(s(r.iso2,r.dialCode),r.areaCodes){let l=i[r.dialCode][0];for(let a of r.areaCodes){for(let p=1;p<a.length;p++){let m=a.substring(0,p),d=r.dialCode+m;s(l,d),s(r.iso2,d)}s(r.iso2,r.dialCode+a)}}}return{dialCodes:t,dialCodeMaxLength:e,dialCodeToIso2Map:i}},Tt=(n,t)=>{let{countryOrder:e}=t;n.sort((i,s)=>{if(e){let o=e.indexOf(i.iso2),r=e.indexOf(s.iso2),l=o>-1,a=r>-1;if(l||a)return l&&a?o-r:l?-1:1}return i.name.localeCompare(s.name)})};var $t=new Set(["800","808","870","881","882","883","888","979"]),et=n=>{let t=w(n).slice(0,3);return n.startsWith("+")&&$t.has(t)};var it=(n,t,e,i)=>{if(!e||!t)return n;let s=`+${i.dialCode}`,o=n[s.length]===" "||n[s.length]==="-"?s.length+1:s.length;return n.substring(o)},At=(n,t,e,i,s)=>{let o=e?e.formatNumberAsYouType(n,i?.iso2):n,r=i?.dialCode;return s&&t.charAt(0)!=="+"&&o.includes(`+${r}`)?(o.split(`+${r}`)[1]||"").trim():o};var vt=(n,t,e,i)=>{if(e===0&&!i)return 0;let s=0;for(let o=0;o<t.length;o++){if(/[+0-9]/.test(t[o])&&s++,s===n&&!i)return o+1;if(i&&s===n+1)return o}return t.length};var Bt=new Set(["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"]),st=n=>{let t=w(n);if(t.startsWith(B.NANP)&&t.length>=4){let e=t.substring(1,4);return Bt.has(e)}return!1};var Ft=0,x=n=>{if(!u.utils)throw new Error(`intlTelInput.utils is required for ${n}(). See: https://intl-tel-input.com/docs/utils`)},wt=()=>{let n,t;return{promise:new Promise((i,s)=>{n=i,t=s}),resolve:n,reject:t}},H=class n{id;promise;#t;#i;#T;#E;#I;#N;#D;#_;#C;#e=null;#c=null;#g;#o=!0;#s;#m;#l=!1;#u;#n;constructor(t,e={}){this.id=Ft++,P.validateInput(t);let i=dt(e);this.#i={...V,...i},ht(this.#i),pt(this.#i),this.#t=new P(t,this.#i,this.id),this.#T=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),this.#m=new R(t.value),this.promise=this.#A(this.#i),this.#E=bt(this.#i);let{dialCodes:s,dialCodeMaxLength:o,dialCodeToIso2Map:r}=Lt(this.#E);this.#D=s,this.#I=o,this.#N=r,this.#_=new Map(this.#E.map(l=>[l.iso2,l])),this.#k()}#a(){let t=this.#t.telInputEl.value.trim();return this.#m.normalise(t)}#h(t){this.#t.telInputEl.value=this.#m.denormalise(t)}#A(t){let{initialCountry:e,geoIpLookup:i,loadUtils:s}=t,o=e===U.AUTO&&!!i,r=!!s&&!u.utils;return o&&(this.#u=wt()),r&&(this.#n=wt()),Promise.all([this.#u?.promise,this.#n?.promise]).then(()=>{})}#k(){this.#s=new AbortController,this.#r(),this.#t.buildMarkup(this.#E,this.#C),this.#y(),this.#p(),this.#O(),this.#i.dropdownAlwaysOpen&&this.#M()}#r(){It(this.#E,this.#i),Tt(this.#E,this.#i),this.#C=yt(this.#E)}#y(t=!1){let e=this.#t.telInputEl.getAttribute("value"),i=this.#m.normalise(e??""),s=this.#a(),r=i&&i.startsWith("+")&&(!s||!s.startsWith("+"))?i:s,l=this.#w(r),a=st(r),{initialCountry:p,geoIpLookup:m}=this.#i,d=p===U.AUTO&&m,C=d&&u.autoCountry?u.autoCountry:p,v=d&&!t&&!u.autoCountry,I=N(C);l?a?I?this.#b(C):v||this.#b(nt.ISO2):(I&&this.#b(C),this.#x(r)):I?this.#b(C):v||this.#b(""),r&&this.#f(r)}#p(){this.#X(),this.#i.allowDropdown&&this.#t.bindAllInitialDropdownListeners(this.#s.signal,()=>this.#M(),()=>this.#R()),this.#t.bindHiddenInputSubmitListener(this.#s.signal,()=>this.getNumber(),()=>this.#e?.iso2||"")}#O(){if(this.#n){let{loadUtils:t}=this.#i,e=()=>{u.attachUtils(t)?.catch(()=>{})};u.documentReady()?e():window.addEventListener("load",e,{signal:this.#s.signal})}this.#u&&(this.#e?this.#u.resolve():this.#S())}#S(){if(u.autoCountry){this.#lt();return}if(this.#t.setLoading(!0),!u.startedLoadingAutoCountry&&(u.startedLoadingAutoCountry=!0,typeof this.#i.geoIpLookup=="function")){let t=(i="")=>{let s=i.toLowerCase();N(s)?(u.autoCountry=s,setTimeout(()=>n.forEachInstance("handleAutoCountryLoaded"))):n.forEachInstance("handleAutoCountryFailure")},e=()=>{n.forEachInstance("handleAutoCountryFailure")};this.#i.geoIpLookup(t,e)}}#U(){this.#M(),this.#t.prefillSearchWithPlus()}#W(t){let e=this.#t.telInputEl.selectionStart||0,i=t.substring(0,e-1),s=t.substring(e);return this.#h(i+s),e-1}#X(){this.#$(),this.#tt(),this.#F()}#q(t){this.#W(t),this.#U()}#J(t,e){let i=this.#W(t);this.#t.telInputEl.setSelectionRange(i,i),this.#v(),this.#d(g.STRICT_REJECT,{source:"key",rejectedInput:e,reason:"invalid"})}#Q(t,e){let i=this.#t.telInputEl.selectionStart||0,o=t.substring(0,i).replace(T.NON_PLUS_NUMERIC_GLOBAL,"").length,r=this.#L(),l=At(r,t,u.utils,this.#e,this.#i.separateDialCode),a=vt(o,l,i,e);this.#h(l),this.#t.telInputEl.setSelectionRange(a,a)}#Z(t){if(t.startsWith("+")&&this.#e&&this.#w(t)){let e=it(t,!0,!0,this.#e);this.#h(e)}}#$(){this.#l=T.ALPHA_UNICODE.test(this.#a()),this.#t.telInputEl.addEventListener("input",this.#B,{signal:this.#s.signal})}#B=t=>{let{strictMode:e,formatAsYouType:i,separateDialCode:s,allowDropdown:o,countrySearch:r}=this.#i,l=t?.detail;if(l?.isCountryChange)return;let a=this.#a();if(this.#T&&t?.data==="+"&&s&&o&&r){this.#q(a);return}if(this.#T&&e&&(t?.data===" "||t?.data==="-"||t?.data===".")){this.#J(a,t.data);return}this.#x(a)&&this.#z();let p=t?.data&&T.NON_PLUS_NUMERIC.test(t.data),m=t?.inputType===q.PASTE&&a;p||m&&!e?this.#l=!0:T.NON_PLUS_NUMERIC.test(a)||(this.#l=!1),i&&!this.#l&&!l?.isSetNumber&&this.#m.isAscii()&&this.#Q(a,t?.inputType===q.DELETE_FORWARD),s&&this.#Z(a)};#tt(){let{strictMode:t,separateDialCode:e}=this.#i;!t&&!e||this.#t.telInputEl.addEventListener("keydown",this.#et,{signal:this.#s.signal})}#et=t=>{let{strictMode:e,separateDialCode:i,allowDropdown:s,countrySearch:o}=this.#i;if(!t.key||t.key.length!==1||t.altKey||t.ctrlKey||t.metaKey)return;if(i&&s&&o&&t.key==="+"){t.preventDefault(),this.#U();return}if(!e)return;let r=this.#a(),a=!r.startsWith("+")&&this.#t.telInputEl.selectionStart===0&&t.key==="+",p=this.#m.normalise(t.key),m=/^[0-9]$/.test(p),d=i?m:a||m,C=this.#t.telInputEl,v=C.selectionStart,I=C.selectionEnd,$=r.slice(0,v??void 0),D=r.slice(I??void 0),E=$+p+D,S=this.#Y(E),k=!1;u.utils&&this.#c&&(k=u.utils.getCoreNumber(S,this.#e?.iso2).length>this.#c);let Y=this.#V(S)!==null;(!d||k&&!Y&&!a)&&(this.#v(),this.#d(g.STRICT_REJECT,{source:"key",rejectedInput:t.key,reason:d?"max-length":"invalid"}),t.preventDefault())};#F(){this.#i.strictMode&&this.#t.telInputEl.addEventListener("paste",this.#j,{signal:this.#s.signal})}#j=t=>{t.preventDefault();let e=this.#t.telInputEl,i=e.selectionStart,s=e.selectionEnd,o=this.#a(),r=o.slice(0,i??void 0),l=o.slice(s??void 0),a=this.#e?.iso2,p=t.clipboardData.getData("text"),m=this.#m.normalise(p),d=i===0&&s>0,C=!o.startsWith("+")||d,v=m.replace(T.NON_PLUS_NUMERIC_GLOBAL,""),I=v.startsWith("+"),$=v.replace(/\+/g,""),D=I&&C?`+${$}`:$,E=r+D+l,S=D!==m?"invalid":null;if(E.length>30){this.#v(),this.#d(g.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:"max-length"});return}if(E.length>5&&u.utils){let _=u.utils.getCoreNumber(E,a);for(;_.length===0&&E.length>0;)E=E.slice(0,-1),_=u.utils.getCoreNumber(E,a);if(!_){this.#v(),this.#d(g.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:"max-length"});return}if(this.#c&&_.length>this.#c)if(e.selectionEnd===o.length){let Y=_.length-this.#c;E=E.slice(0,E.length-Y),S="max-length"}else{this.#v(),this.#d(g.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:"max-length"});return}}this.#h(E);let k=i+D.length;e.setSelectionRange(k,k),e.dispatchEvent(new InputEvent("input",{bubbles:!0})),S&&(m.length>0&&D.length===0&&this.#v(),this.#d(g.STRICT_REJECT,{source:"paste",rejectedInput:p,reason:S}))};#P(t){let e=Number(this.#t.telInputEl.getAttribute("maxlength"));return e&&t.length>e?t.substring(0,e):t}#v(){if(!this.#i.strictRejectAnimation)return;let t=this.#t.telInputEl.parentElement;t&&(t.classList.remove("iti__strict-reject-animation"),t.offsetWidth,t.classList.add("iti__strict-reject-animation"))}#d(t,e={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});this.#t.telInputEl.dispatchEvent(i)}#M(){this.#t.openDropdown(t=>this.#nt(t),()=>this.#R()),this.#d(g.OPEN_COUNTRY_DROPDOWN)}#f(t){let{formatOnDisplay:e,nationalMode:i,separateDialCode:s}=this.#i,o=t;if(e&&u.utils&&this.#e){let r=et(t),l=i&&!r||!o.startsWith("+")&&!s,{NATIONAL:a,INTERNATIONAL:p}=u.utils.numberFormat,m=l?a:p;o=u.utils.formatNumber(o,this.#e?.iso2,m)}o=this.#ot(o),this.#h(o)}#x(t){let e=this.#V(t);return e!==null?this.#b(e):!1}#it(t){let e=this.#e?.dialCode,i=this.#e?.nationalPrefix;if(t.startsWith("+")||!e)return t;let r=i&&t.startsWith(i)&&!this.#i.separateDialCode?t.substring(1):t;return`+${e}${r}`}#V(t){let e=t.indexOf("+"),i=e>0?t.substring(e):t,s=this.#e?.iso2;i=this.#it(i);let o=this.#w(i,!0),r=w(i);if(o){let l=w(o),a=this.#N[l];return a.length===1?a[0]===s?null:a[0]:this.#st(a,l,r)}else if(i.startsWith("+")&&r.length){let l=this.#e?.dialCode||"";return l&&l.startsWith(r)?null:""}else if((!i||i==="+")&&!s&&this.#g)return this.#g;return null}#st(t,e,i){let s=this.#e?.iso2,o=this.#e?.dialCode;if(!s&&this.#g&&t.includes(this.#g))return this.#g;if(o===B.NANP&&st(i))return null;let l=this.#e?.areaCodes,a=this.#e?.priority;if(l){let v=l.map(I=>`${o}${I}`);for(let I of v)if(i.startsWith(I))return null}let m=l&&!(a===0)&&i.length>e.length,d=s&&t.includes(s)&&!m,C=s===t[0];return!d&&!C?t[0]:null}#b(t){let e=this.#e?.iso2||"";return this.#e=t?this.#_.get(t):null,this.#e&&(this.#g=this.#e.iso2),this.#t.setCountry(this.#e),this.#H(),this.#G(),e!==t}#G(){let{strictMode:t,placeholderNumberType:e,allowedNumberTypes:i}=this.#i;if(!t||!u.utils)return;let s=this.#e?.iso2;if(!s){this.#c=null;return}let o=u.utils.numberType[e],r=u.utils.getExampleNumber(s,!1,o,!0),l=r;for(;u.utils.isPossibleNumber(r,s,i);)l=r,r+="0";let a=u.utils.getCoreNumber(l,s);this.#c=a.length,s==="by"&&(this.#c=a.length+1)}#H(){let{autoPlaceholder:t,placeholderNumberType:e,nationalMode:i,customPlaceholder:s}=this.#i,o=t===M.AGGRESSIVE||!this.#t.hadInitialPlaceholder&&t===M.POLITE;if(!u.utils||!o)return;let r=u.utils.numberType[e],l=this.#e?u.utils.getExampleNumber(this.#e.iso2,i,r):"";l=this.#ot(l),typeof s=="function"&&(l=s(l,this.#e)),this.#t.telInputEl.setAttribute("placeholder",l)}#nt(t){if(!t)return;let e=t.dataset[A.ISO2],i=this.#b(e);this.#R();let s=t.dataset[A.DIAL_CODE];if(this.#K(s),this.#i.formatOnDisplay){let o=this.#a();this.#f(o)}this.#t.telInputEl.focus(),i&&(this.#z(),this.#d(g.INPUT,{isCountryChange:!0}))}#R(t){!this.#t.isDropdownOpen()||this.#i.dropdownAlwaysOpen&&!t||(this.#t.closeDropdown(),this.#d(g.CLOSE_COUNTRY_DROPDOWN))}#K(t){let e=this.#a();if(!e.startsWith("+"))return;let i=`+${t}`,s=this.#w(e),o;s?o=e.replace(s,i):o=i,this.#h(o)}#w(t,e){if(!t.startsWith("+"))return"";let i="",s="",o=!1;for(let r=0;r<t.length;r++){let l=t.charAt(r);if(!/[0-9]/.test(l))continue;if(s+=l,!!!this.#N[s])break;if(this.#D.has(s)){if(i=t.substring(0,r+1),o=!0,!e)break}else e&&o&&(i=t.substring(0,r+1));if(s.length===this.#I)break}return i}#Y(t){let e=this.#e?.dialCode,i=w(t);return(this.#i.separateDialCode&&!t.startsWith("+")&&e&&i?`+${e}`:"")+t}#L(){let t=this.#a();return this.#Y(t)}#ot(t){let e=!!this.#w(t),i=it(t,e,this.#i.separateDialCode,this.#e);return this.#P(i)}#rt(){let t=this.#e;if(!t)return null;let{iso2:e,dialCode:i,name:s}=t;return{iso2:e,dialCode:i,name:s}}#z(){let t=this.#rt();this.#d(g.COUNTRY_CHANGE,t)}#lt(){if(!(!this.#u||!u.autoCountry)){if(!this.#o){this.#u.resolve();return}this.#t.isLoading()?this.setCountry(u.autoCountry):this.#g=u.autoCountry,this.#t.setLoading(!1),this.#u.resolve()}}#ut(){if(!this.#o){this.#u?.reject();return}this.#y(!0),this.#t.setLoading(!1),this.#u?.reject()}#ct(){if(!this.#o){this.#n?.resolve();return}if(!u.utils){this.#n?.resolve();return}let t=this.#a();t&&this.#f(t),this.#e&&(this.#H(),this.#G()),this.#n?.resolve()}#dt(t){if(!this.#o){this.#n?.reject(t);return}this.#n?.reject(t)}destroy(){this.#o&&(this.#o=!1,this.#i.allowDropdown&&this.#R(!0),this.#s.abort(),this.#t.destroy(),u.instances.delete(String(this.id)))}isActive(){return this.#o}getExtension(){return this.#o?(x("getExtension"),u.utils.getExtension(this.#L(),this.#e?.iso2)):""}getNumber(t){if(!this.#o)return"";x("getNumber");let e=this.#e?.iso2,i=this.#L(),s=u.utils.formatNumber(i,e,t);return this.#m.denormalise(s)}getNumberType(){return this.#o?(x("getNumberType"),u.utils.getNumberType(this.#L(),this.#e?.iso2)):Q.UNKNOWN_NUMBER_TYPE}getSelectedCountryData(){return this.#rt()}getValidationError(){if(!this.#o)return Q.UNKNOWN_VALIDATION_ERROR;x("getValidationError");let t=this.#e?.iso2;return u.utils.getValidationError(this.#L(),t)}isValidNumber(){if(!this.#o)return null;x("isValidNumber");let t=this.#e?.dialCode,e=this.#e?.iso2,i=this.#L(),s=u.utils.getCoreNumber(i,e);if(s){if(t===F.DIAL_CODE&&s[0]===F.MOBILE_PREFIX&&s.length!==F.MOBILE_CORE_LENGTH)return!1;if(!T.ALPHA_UNICODE.test(i)&&t){let r=i.startsWith("+")?i.slice(1+t.length):i,l=w(r).length;if(s.length>l)return!1}}return this.#at("possible")}isValidNumberPrecise(){return this.#o?(x("isValidNumberPrecise"),this.#at("precise")):null}#at(t){let{allowNumberExtensions:e,allowPhonewords:i,allowedNumberTypes:s}=this.#i,o=this.#e?.iso2,r=this.#L();return!this.#e&&!et(r)||!(t==="precise"?u.utils.isValidNumber:u.utils.isPossibleNumber)(r,o,s)?!1:T.ALPHA_UNICODE.test(r)?!!u.utils.getExtension(r,o)?e:i:!0}setCountry(t){if(!this.#o)return;let e=t?.toLowerCase();if(!N(e))throw new Error(`Invalid iso2 code: '${e}'`);let i=this.#e?.iso2;if(t&&e!==i||!t&&i){if(this.#b(e),this.#K(this.#e?.dialCode||""),this.#i.formatOnDisplay){let o=this.#a();this.#f(o)}this.#z(),this.#d(g.INPUT,{isCountryChange:!0})}}setNumber(t){if(!this.#o)return;let e=this.#m.normalise(t),i=this.#x(e);this.#f(e),i&&this.#z(),this.#d(g.INPUT,{isSetNumber:!0})}setPlaceholderNumberType(t){this.#o&&(this.#i.placeholderNumberType=t,this.#H())}setDisabled(t){this.#o&&this.#t.setDisabled(t)}setReadonly(t){this.#o&&this.#t.setReadonly(t)}static forEachInstance(t,...e){let i=[...u.instances.values()],s=e[0];i.forEach(o=>{if(o instanceof n)switch(t){case"handleUtilsLoaded":o.#ct();break;case"handleUtilsFailure":o.#dt(s);break;case"handleAutoCountryLoaded":o.#lt();break;case"handleAutoCountryFailure":o.#ut();break}})}},jt=n=>{if(!u.utils&&!u.startedLoadingUtils){let t;if(typeof n=="function")try{t=Promise.resolve(n())}catch(e){return Promise.reject(e)}else return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof n}`));return u.startedLoadingUtils=!0,t.then(e=>{let i=e?.default;if(!i||typeof i!="object")throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");return u.utils=i,H.forEachInstance("handleUtilsLoaded"),!0}).catch(e=>{throw H.forEachInstance("handleUtilsFailure",e),e})}return null},u=Object.assign((n,t)=>{let e=new H(n,t);return u.instances.set(String(e.id),e),n.iti=e,e},{defaults:V,documentReady:()=>document.readyState==="complete",getCountryData:()=>O,getInstance:n=>{let t=n.dataset[A.INSTANCE_ID];return t?u.instances.get(t)??null:null},instances:new Map,attachUtils:jt,startedLoadingUtils:!1,startedLoadingAutoCountry:!1,version:"27.3.1"}),Vt=u;return Mt(Gt);})();
25
25
  var intlTelInput = _factory.default;
@@ -1743,13 +1743,7 @@ for (const c of rawCountryData) {
1743
1743
  dialCode: c[1],
1744
1744
  priority: c[2] || 0,
1745
1745
  areaCodes: c[3] || null,
1746
- nationalPrefix: c[4] || null,
1747
- normalisedName: "",
1748
- // populated in the plugin
1749
- initials: "",
1750
- // populated in the plugin
1751
- dialCodePlus: ""
1752
- // populated in the plugin
1746
+ nationalPrefix: c[4] || null
1753
1747
  });
1754
1748
  }
1755
1749
  var iso2Set = new Set(allCountries.map((c) => c.iso2));
@@ -2262,7 +2256,20 @@ var buildGlobeIcon = () => `
2262
2256
  </svg>`;
2263
2257
 
2264
2258
  // src/js/core/countrySearch.ts
2265
- var getMatchedCountries = (countries, query) => {
2259
+ var buildSearchTokens = (countries) => {
2260
+ const tokens = /* @__PURE__ */ new Map();
2261
+ for (const c of countries) {
2262
+ const normalisedName = normaliseString(c.name);
2263
+ const initials = normalisedName.split(/[^a-z]/).map((word) => word[0]).join("");
2264
+ tokens.set(c.iso2, {
2265
+ normalisedName,
2266
+ initials,
2267
+ dialCodePlus: `+${c.dialCode}`
2268
+ });
2269
+ }
2270
+ return tokens;
2271
+ };
2272
+ var getMatchedCountries = (countries, searchTokens, query) => {
2266
2273
  const normalisedQuery = normaliseString(query);
2267
2274
  const iso2Matches = [];
2268
2275
  const nameStartsWith = [];
@@ -2271,17 +2278,18 @@ var getMatchedCountries = (countries, query) => {
2271
2278
  const dialCodeContains = [];
2272
2279
  const initialsMatches = [];
2273
2280
  for (const c of countries) {
2281
+ const t = searchTokens.get(c.iso2);
2274
2282
  if (c.iso2 === normalisedQuery) {
2275
2283
  iso2Matches.push(c);
2276
- } else if (c.normalisedName.startsWith(normalisedQuery)) {
2284
+ } else if (t.normalisedName.startsWith(normalisedQuery)) {
2277
2285
  nameStartsWith.push(c);
2278
- } else if (c.normalisedName.includes(normalisedQuery)) {
2286
+ } else if (t.normalisedName.includes(normalisedQuery)) {
2279
2287
  nameContains.push(c);
2280
- } else if (normalisedQuery === c.dialCode || normalisedQuery === c.dialCodePlus) {
2288
+ } else if (normalisedQuery === c.dialCode || normalisedQuery === t.dialCodePlus) {
2281
2289
  dialCodeMatches.push(c);
2282
- } else if (c.dialCodePlus.includes(normalisedQuery)) {
2290
+ } else if (t.dialCodePlus.includes(normalisedQuery)) {
2283
2291
  dialCodeContains.push(c);
2284
- } else if (c.initials.includes(normalisedQuery)) {
2292
+ } else if (t.initials.includes(normalisedQuery)) {
2285
2293
  initialsMatches.push(c);
2286
2294
  }
2287
2295
  }
@@ -2296,16 +2304,75 @@ var getMatchedCountries = (countries, query) => {
2296
2304
  ...initialsMatches
2297
2305
  ];
2298
2306
  };
2299
- var findFirstCountryStartingWith = (countries, query) => {
2307
+ var findFirstCountryStartingWith = (countries, searchTokens, query) => {
2300
2308
  const normalisedQuery = normaliseString(query);
2301
2309
  for (const c of countries) {
2302
- if (c.normalisedName.startsWith(normalisedQuery)) {
2310
+ const { normalisedName } = searchTokens.get(c.iso2);
2311
+ if (normalisedName.startsWith(normalisedQuery)) {
2303
2312
  return c;
2304
2313
  }
2305
2314
  }
2306
2315
  return null;
2307
2316
  };
2308
2317
 
2318
+ // src/js/core/numerals.ts
2319
+ var Numerals = class _Numerals {
2320
+ #userNumeralSet;
2321
+ //* Stateless conversion of any Arabic-Indic / Persian digits to ASCII 0-9.
2322
+ //* Use this when you need to normalise digits without affecting any instance's tracked numeral set (e.g. for the country-search query).
2323
+ static toAscii(str) {
2324
+ if (!str) {
2325
+ return "";
2326
+ }
2327
+ return str.replace(
2328
+ /[٠-٩]/g,
2329
+ (ch) => String.fromCharCode(48 + (ch.charCodeAt(0) - 1632))
2330
+ ).replace(
2331
+ /[۰-۹]/g,
2332
+ (ch) => String.fromCharCode(48 + (ch.charCodeAt(0) - 1776))
2333
+ );
2334
+ }
2335
+ constructor(initialValue) {
2336
+ if (initialValue) {
2337
+ this.#updateNumeralSet(initialValue);
2338
+ }
2339
+ }
2340
+ // If any Arabic-Indic digits, then label it as that set. Same for Persian. Otherwise assume ASCII.
2341
+ #updateNumeralSet(str) {
2342
+ if (/[٠-٩]/.test(str)) {
2343
+ this.#userNumeralSet = "arabic-indic";
2344
+ } else if (/[۰-۹]/.test(str)) {
2345
+ this.#userNumeralSet = "persian";
2346
+ } else {
2347
+ this.#userNumeralSet = "ascii";
2348
+ }
2349
+ }
2350
+ // Denormalise ASCII 0-9 to the user's numeral set. If not yet known, return as-is.
2351
+ // NOTE: normalise is always called before this, so it should be impossible for the numeral set to be unknown at this point.
2352
+ denormalise(str) {
2353
+ if (!this.#userNumeralSet || this.#userNumeralSet === "ascii") {
2354
+ return str;
2355
+ }
2356
+ const base = this.#userNumeralSet === "arabic-indic" ? 1632 : 1776;
2357
+ return str.replace(/[0-9]/g, (d) => String.fromCharCode(base + Number(d)));
2358
+ }
2359
+ // Normalize Eastern Arabic (U+0660-0669) and Persian/Extended Arabic-Indic (U+06F0-06F9) numerals to ASCII 0-9.
2360
+ // Tracks the user's numeral set as a side effect so denormalise can mirror it back.
2361
+ normalise(str) {
2362
+ if (!str) {
2363
+ return "";
2364
+ }
2365
+ this.#updateNumeralSet(str);
2366
+ if (this.#userNumeralSet === "ascii") {
2367
+ return str;
2368
+ }
2369
+ return _Numerals.toAscii(str);
2370
+ }
2371
+ isAscii() {
2372
+ return !this.#userNumeralSet || this.#userNumeralSet === "ascii";
2373
+ }
2374
+ };
2375
+
2309
2376
  // src/js/core/ui.ts
2310
2377
  var UI = class _UI {
2311
2378
  // private
@@ -2314,6 +2381,7 @@ var UI = class _UI {
2314
2381
  #isRTL;
2315
2382
  #originalPaddingLeft = "";
2316
2383
  #countries;
2384
+ #searchTokens;
2317
2385
  #searchDebounceTimer = null;
2318
2386
  #inlineDropdownHeight;
2319
2387
  #countryContainerEl;
@@ -2359,8 +2427,9 @@ var UI = class _UI {
2359
2427
  }
2360
2428
  }
2361
2429
  //* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
2362
- buildMarkup(countries) {
2430
+ buildMarkup(countries, searchTokens) {
2363
2431
  this.#countries = countries;
2432
+ this.#searchTokens = searchTokens;
2364
2433
  this.telInputEl.classList.add("iti__tel-input");
2365
2434
  if (!this.telInputEl.hasAttribute("type")) {
2366
2435
  this.telInputEl.setAttribute("type", "tel");
@@ -2728,7 +2797,12 @@ var UI = class _UI {
2728
2797
  if (query === "") {
2729
2798
  matchedCountries = this.#countries;
2730
2799
  } else {
2731
- matchedCountries = getMatchedCountries(this.#countries, query);
2800
+ const normalisedQuery = Numerals.toAscii(query);
2801
+ matchedCountries = getMatchedCountries(
2802
+ this.#countries,
2803
+ this.#searchTokens,
2804
+ normalisedQuery
2805
+ );
2732
2806
  }
2733
2807
  this.#showFilteredCountries(matchedCountries);
2734
2808
  }
@@ -3023,7 +3097,11 @@ var UI = class _UI {
3023
3097
  }
3024
3098
  //* Hidden search (countrySearch disabled): jump to the first list item whose name starts with the query.
3025
3099
  #searchForCountry(query) {
3026
- const match = findFirstCountryStartingWith(this.#countries, query);
3100
+ const match = findFirstCountryStartingWith(
3101
+ this.#countries,
3102
+ this.#searchTokens,
3103
+ query
3104
+ );
3027
3105
  if (match) {
3028
3106
  const listItem = this.#listItemByIso2.get(match.iso2);
3029
3107
  this.#highlightListItem(listItem);
@@ -3335,13 +3413,6 @@ var sortCountries = (countries, options) => {
3335
3413
  return a.name.localeCompare(b.name);
3336
3414
  });
3337
3415
  };
3338
- var cacheSearchTokens = (countries) => {
3339
- for (const c of countries) {
3340
- c.normalisedName = normaliseString(c.name);
3341
- c.initials = c.normalisedName.split(/[^a-z]/).map((word) => word[0]).join("");
3342
- c.dialCodePlus = `+${c.dialCode}`;
3343
- }
3344
- };
3345
3416
 
3346
3417
  // src/js/data/intl-regionless.ts
3347
3418
  var regionlessDialCodes = /* @__PURE__ */ new Set([
@@ -3427,54 +3498,6 @@ var isRegionlessNanp = (number) => {
3427
3498
  return false;
3428
3499
  };
3429
3500
 
3430
- // src/js/core/numerals.ts
3431
- var Numerals = class {
3432
- #userNumeralSet;
3433
- constructor(initialValue) {
3434
- if (initialValue) {
3435
- this.#updateNumeralSet(initialValue);
3436
- }
3437
- }
3438
- // If any Arabic-Indic digits, then label it as that set. Same for Persian. Otherwise assume ASCII.
3439
- #updateNumeralSet(str) {
3440
- if (/[\u0660-\u0669]/.test(str)) {
3441
- this.#userNumeralSet = "arabic-indic";
3442
- } else if (/[\u06F0-\u06F9]/.test(str)) {
3443
- this.#userNumeralSet = "persian";
3444
- } else {
3445
- this.#userNumeralSet = "ascii";
3446
- }
3447
- }
3448
- // Denormalise ASCII 0-9 to the user's numeral set. If not yet known, return as-is.
3449
- // NOTE: normalise is always called before this, so it should be impossible for the numeral set to be unknown at this point.
3450
- denormalise(str) {
3451
- if (!this.#userNumeralSet || this.#userNumeralSet === "ascii") {
3452
- return str;
3453
- }
3454
- const base = this.#userNumeralSet === "arabic-indic" ? 1632 : 1776;
3455
- return str.replace(/[0-9]/g, (d) => String.fromCharCode(base + Number(d)));
3456
- }
3457
- // Normalize Eastern Arabic (U+0660-0669) and Persian/Extended Arabic-Indic (U+06F0-06F9) numerals to ASCII 0-9
3458
- normalise(str) {
3459
- if (!str) {
3460
- return "";
3461
- }
3462
- this.#updateNumeralSet(str);
3463
- if (this.#userNumeralSet === "ascii") {
3464
- return str;
3465
- }
3466
- const base = this.#userNumeralSet === "arabic-indic" ? 1632 : 1776;
3467
- const regex = this.#userNumeralSet === "arabic-indic" ? /[\u0660-\u0669]/g : /[\u06F0-\u06F9]/g;
3468
- return str.replace(
3469
- regex,
3470
- (ch) => String.fromCharCode(48 + (ch.charCodeAt(0) - base))
3471
- );
3472
- }
3473
- isAscii() {
3474
- return !this.#userNumeralSet || this.#userNumeralSet === "ascii";
3475
- }
3476
- };
3477
-
3478
3501
  // src/js/intlTelInput.ts
3479
3502
  var nextId = 0;
3480
3503
  var ensureUtils = (methodName) => {
@@ -3509,6 +3532,7 @@ var Iti = class _Iti {
3509
3532
  #dialCodeToIso2Map;
3510
3533
  #dialCodes;
3511
3534
  #countryByIso2;
3535
+ #searchTokens;
3512
3536
  #selectedCountry = null;
3513
3537
  #maxCoreNumberLength = null;
3514
3538
  #fallbackCountryIso2;
@@ -3565,7 +3589,7 @@ var Iti = class _Iti {
3565
3589
  #init() {
3566
3590
  this.#abortController = new AbortController();
3567
3591
  this.#processCountryData();
3568
- this.#ui.buildMarkup(this.#countries);
3592
+ this.#ui.buildMarkup(this.#countries, this.#searchTokens);
3569
3593
  this.#setInitialState();
3570
3594
  this.#initListeners();
3571
3595
  this.#startAsyncLoads();
@@ -3580,7 +3604,7 @@ var Iti = class _Iti {
3580
3604
  #processCountryData() {
3581
3605
  generateCountryNames(this.#countries, this.#options);
3582
3606
  sortCountries(this.#countries, this.#options);
3583
- cacheSearchTokens(this.#countries);
3607
+ this.#searchTokens = buildSearchTokens(this.#countries);
3584
3608
  }
3585
3609
  //* Set the initial state of the input value and the selected country by:
3586
3610
  //* 1. Extracting a dial code from the given number
@@ -3703,7 +3727,7 @@ var Iti = class _Iti {
3703
3727
  #bindAllTelInputListeners() {
3704
3728
  this.#bindInputListener();
3705
3729
  this.#bindKeydownListener();
3706
- this.#bindPasteListener();
3730
+ this.#bindStrictPasteListener();
3707
3731
  }
3708
3732
  //* Android workaround for handling plus when separateDialCode enabled (as impossible to handle with keydown/keyup, for which e.key always returns "Unidentified", see https://stackoverflow.com/q/59584061/217866)
3709
3733
  #handleAndroidPlusKey(inputValue) {
@@ -3871,15 +3895,16 @@ var Iti = class _Iti {
3871
3895
  e.preventDefault();
3872
3896
  }
3873
3897
  };
3874
- #bindPasteListener() {
3898
+ #bindStrictPasteListener() {
3875
3899
  if (!this.#options.strictMode) {
3876
3900
  return;
3877
3901
  }
3878
- this.#ui.telInputEl.addEventListener("paste", this.#handlePasteEvent, {
3902
+ this.#ui.telInputEl.addEventListener("paste", this.#handleStrictPasteEvent, {
3879
3903
  signal: this.#abortController.signal
3880
3904
  });
3881
3905
  }
3882
- #handlePasteEvent = (e) => {
3906
+ // Handle paste events when strictMode is enabled by sanitising the pasted content before it's inserted into the input, and rejecting it entirely if it would result in an invalid number
3907
+ #handleStrictPasteEvent = (e) => {
3883
3908
  e.preventDefault();
3884
3909
  const input = this.#ui.telInputEl;
3885
3910
  const selStart = input.selectionStart;
@@ -3898,6 +3923,15 @@ var Iti = class _Iti {
3898
3923
  const sanitised = hasLeadingPlus && allowLeadingPlus ? `+${numerics}` : numerics;
3899
3924
  let newValue = before + sanitised + after;
3900
3925
  let rejectReason = sanitised !== pasted ? "invalid" : null;
3926
+ if (newValue.length > 30) {
3927
+ this.#playStrictRejectAnimation();
3928
+ this.#dispatchEvent(EVENTS.STRICT_REJECT, {
3929
+ source: "paste",
3930
+ rejectedInput: pastedRaw,
3931
+ reason: "max-length"
3932
+ });
3933
+ return;
3934
+ }
3901
3935
  if (newValue.length > 5 && intlTelInput.utils) {
3902
3936
  let coreNumber = intlTelInput.utils.getCoreNumber(newValue, iso2);
3903
3937
  while (coreNumber.length === 0 && newValue.length > 0) {
@@ -4600,7 +4634,7 @@ var intlTelInput = Object.assign(
4600
4634
  attachUtils,
4601
4635
  startedLoadingUtils: false,
4602
4636
  startedLoadingAutoCountry: false,
4603
- version: "27.3.0"
4637
+ version: "27.3.1"
4604
4638
  }
4605
4639
  );
4606
4640
  var intlTelInput_default = intlTelInput;