(function(l,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("awesome-phonenumber"),require("vuetify/components")):typeof define=="function"&&define.amd?define(["exports","vue","awesome-phonenumber","vuetify/components"],t):(l=typeof globalThis<"u"?globalThis:l||self,t(l.VPhoneInput={},l.Vue,l.PhoneNumber,l.components))})(this,function(l,t,E,R){"use strict";function H(){return{country:{required:!0,type:Object},decorative:{type:Boolean,default:!1}}}function Z({props:n}){const o=t.computed(()=>n.decorative?void 0:"img"),e=t.computed(()=>n.decorative?void 0:n.country.name);return{role:o,title:e}}const W=t.defineComponent({props:H(),setup(n){const{role:o,title:e}=Z({props:n});return()=>t.h("span",{role:o.value,title:e.value,class:["v-phone-input__country__icon","f32"]},t.h("span",{class:["flag",n.country.iso2.toLowerCase()]}))}}),k=t.defineComponent({props:H(),setup(n){const{role:o,title:e}=Z({props:n});return()=>t.h("span",{role:o.value,title:e.value,class:["v-phone-input__country__icon","fi",`fi-${n.country.iso2.toLowerCase()}`]})}});function en(n){return"setPreference"in n}function f(n){return n&&typeof n=="object"?n.iso2:(n||"").toUpperCase()}function an({props:n}){const o=E.getSupportedRegionCodes(),e=t.ref({}),s=t.ref(0),$=t.ref([]),S=t.ref([]),M=t.computed(()=>n.preferCountries.map(f)),c=t.computed(()=>n.includeCountries.map(f)),y=t.computed(()=>n.excludeCountries.map(f));t.watchEffect(()=>{const C={},T=[],B=[];n.allCountries.forEach(I=>{const r=f(I.iso2);if(o.indexOf(r)===-1||c.value.length&&c.value.indexOf(r)===-1||y.value.indexOf(r)!==-1)return;const d={...I,iso2:r};C[d.iso2]=d,M.value.indexOf(r)!==-1?T.push(d):B.push(d)}),T.sort((I,r)=>M.value.indexOf(I.iso2)-M.value.indexOf(r.iso2)),e.value=C,$.value=T,S.value=B,s.value=T.length+B.length,s.value||console.error('[v-phone-input] resulting countries from "allCountries", "includeCountries" and "excludeCountries" must be a non-empty list')});const m=t.computed(()=>{const C=$.value[0]??S.value[0];return C?e.value[C.iso2]:void 0}),g=C=>e.value[f(C)],G=t.ref(!1),h=t.computed(()=>!n.disableGuessLoading&&G.value);return{countriesCount:s,preferredCountries:$,otherCountries:S,guessingCountry:h,findCountry:g,firstCountry:m,setCountryPreference:C=>{G.value=!1,en(n.countryGuesser)&&n.countryGuesser.setPreference(C)},guessCountry:async()=>{if(!n.guessCountry)return;G.value=!0;const C=g(await n.countryGuesser.guess());return G.value=!1,C==null?void 0:C.iso2}}}function sn({props:n}){return{countryIconComponent:t.computed(()=>{switch(n.countryIconMode){case"svg":return k;case"sprite":return W;case"text":return;default:return n.countryIconMode}})}}function cn({props:n}){return{countrySelectComponent:t.computed(()=>n.enableSearchingCountry?{type:"VAutocomplete",props:{autocomplete:"new-password","aria-autocomplete":"off"}}:{type:"VSelect",props:{}})}}function rn({props:n,country:o,example:e}){const s=(A,K)=>typeof A=="function"?A(K):A,$=t.computed(()=>({country:o.value,example:e.value})),S=t.computed(()=>s(n.label,$.value)),M=t.computed(()=>s(n.ariaLabel,$.value)),c=t.computed(()=>({...$.value,label:S.value||M.value})),y=t.computed(()=>s(n.countryLabel,c.value)),m=t.computed(()=>s(n.countryAriaLabel,c.value)),g=t.computed(()=>s(n.placeholder,c.value)),G=t.computed(()=>s(n.hint,c.value)),h=t.computed(()=>s(n.invalidMessage,c.value));return{label:S,ariaLabel:M,countryLabel:y,countryAriaLabel:m,placeholder:g,hint:G,invalidMessage:h,messageOptions:$}}function ln(n,o){const e=t.ref({}),s=()=>{const $={};Object.keys(n).forEach(S=>{const[M,...c]=S.split(":");!c.length||o.indexOf(M)===-1?$.default={...$.default||{},[S]:S}:$[M]={...$[M]||{},[c.join(":")]:S}}),e.value=$};return t.onBeforeMount(s),t.onBeforeUpdate(s),{namespacedSlots:e}}const un={AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Aland",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthelemy",BM:"Bermuda",BN:"Brunei",BO:"Bolivia",BQ:"Bonaire",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"Democratic Republic of the Congo",CF:"Central African Republic",CG:"Republic of the Congo",CH:"Switzerland",CI:"Ivory Coast",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cape Verde",CW:"Curacao",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FM:"Micronesia",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MF:"Saint Martin",MG:"Madagascar",MH:"Marshall Islands",MK:"North Macedonia",ML:"Mali",MM:"Myanmar (Burma)",MN:"Mongolia",MO:"Macao",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn Islands",PR:"Puerto Rico",PS:"Palestine",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Reunion",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SX:"Sint Maarten",SY:"Syria",SZ:"Eswatini",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"East Timor",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",UM:"U.S. Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Vatican City",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"British Virgin Islands",VI:"U.S. Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",XK:"Kosovo",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},V={AD:"Andorra",AE:"دولة الإمارات العربية المتحدة",AF:"افغانستان",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Shqipëria",AM:"Հայաստան",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Österreich",AU:"Australia",AW:"Aruba",AX:"Åland",AZ:"Azərbaycan",BA:"Bosna i Hercegovina",BB:"Barbados",BD:"Bangladesh",BE:"België",BF:"Burkina Faso",BG:"България",BH:"‏البحرين",BI:"Burundi",BJ:"Bénin",BL:"Saint-Barthélemy",BM:"Bermuda",BN:"Negara Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire",BR:"Brasil",BS:"Bahamas",BT:"ʼbrug-yul",BV:"Bouvetøya",BW:"Botswana",BY:"Белару́сь",BZ:"Belize",CA:"Canada",CC:"Cocos (Keeling) Islands",CD:"République démocratique du Congo",CF:"Ködörösêse tî Bêafrîka",CG:"République du Congo",CH:"Schweiz",CI:"Côte d'Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"中国",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Κύπρος",CZ:"Česká republika",DE:"Deutschland",DJ:"Djibouti",DK:"Danmark",DM:"Dominica",DO:"República Dominicana",DZ:"الجزائر",EC:"Ecuador",EE:"Eesti",EG:"مصر‎",EH:"الصحراء الغربية",ER:"ኤርትራ",ES:"España",ET:"ኢትዮጵያ",FI:"Suomi",FJ:"Fiji",FK:"Falkland Islands",FM:"Micronesia",FO:"Føroyar",FR:"France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"საქართველო",GF:"Guyane française",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Kalaallit Nunaat",GM:"Gambia",GN:"Guinée",GP:"Guadeloupe",GQ:"Guinea Ecuatorial",GR:"Ελλάδα",GS:"South Georgia",GT:"Guatemala",GU:"Guam",GW:"Guiné-Bissau",GY:"Guyana",HK:"香港",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Hrvatska",HT:"Haïti",HU:"Magyarország",ID:"Indonesia",IE:"Éire",IL:"יִשְׂרָאֵל",IM:"Isle of Man",IN:"भारत",IO:"British Indian Ocean Territory",IQ:"العراق",IR:"ایران",IS:"Ísland",IT:"Italia",JE:"Jersey",JM:"Jamaica",JO:"الأردن",JP:"日本",KE:"Kenya",KG:"Кыргызстан",KH:"Kâmpŭchéa",KI:"Kiribati",KM:"Komori",KN:"Saint Kitts and Nevis",KP:"북한",KR:"대한민국",KW:"الكويت",KY:"Cayman Islands",KZ:"Қазақстан",LA:"ສປປລາວ",LB:"لبنان",LC:"Saint Lucia",LI:"Liechtenstein",LK:"śrī laṃkāva",LR:"Liberia",LS:"Lesotho",LT:"Lietuva",LU:"Luxembourg",LV:"Latvija",LY:"‏ليبيا",MA:"المغرب",MC:"Monaco",MD:"Moldova",ME:"Црна Гора",MF:"Saint-Martin",MG:"Madagasikara",MH:"M̧ajeļ",MK:"Северна Македонија",ML:"Mali",MM:"မြန်မာ",MN:"Монгол улс",MO:"澳門",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"موريتانيا",MS:"Montserrat",MT:"Malta",MU:"Maurice",MV:"Maldives",MW:"Malawi",MX:"México",MY:"Malaysia",MZ:"Moçambique",NA:"Namibia",NC:"Nouvelle-Calédonie",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Nederland",NO:"Norge",NP:"नेपाल",NR:"Nauru",NU:"Niuē",NZ:"New Zealand",OM:"عمان",PA:"Panamá",PE:"Perú",PF:"Polynésie française",PG:"Papua Niugini",PH:"Pilipinas",PK:"Pakistan",PL:"Polska",PM:"Saint-Pierre-et-Miquelon",PN:"Pitcairn Islands",PR:"Puerto Rico",PS:"فلسطين",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"قطر",RE:"La Réunion",RO:"România",RS:"Србија",RU:"Россия",RW:"Rwanda",SA:"العربية السعودية",SB:"Solomon Islands",SC:"Seychelles",SD:"السودان",SE:"Sverige",SG:"Singapore",SH:"Saint Helena",SI:"Slovenija",SJ:"Svalbard og Jan Mayen",SK:"Slovensko",SL:"Sierra Leone",SM:"San Marino",SN:"Sénégal",SO:"Soomaaliya",SR:"Suriname",SS:"South Sudan",ST:"São Tomé e Príncipe",SV:"El Salvador",SX:"Sint Maarten",SY:"سوريا",SZ:"Eswatini",TC:"Turks and Caicos Islands",TD:"Tchad",TF:"Territoire des Terres australes et antarctiques fr",TG:"Togo",TH:"ประเทศไทย",TJ:"Тоҷикистон",TK:"Tokelau",TL:"Timor-Leste",TM:"Türkmenistan",TN:"تونس",TO:"Tonga",TR:"Türkiye",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"臺灣",TZ:"Tanzania",UA:"Україна",UG:"Uganda",UM:"United States Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"O'zbekiston",VA:"Vaticano",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"British Virgin Islands",VI:"United States Virgin Islands",VN:"Việt Nam",VU:"Vanuatu",WF:"Wallis et Futuna",WS:"Samoa",XK:"Republika e Kosovës",YE:"اليَمَن",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},Y=Object.entries(un).sort(([n,o],[e,s])=>o.localeCompare(s)).map(([n,o])=>({name:o!==V[n]?`${V[n]} (${o})`:V[n],iso2:f(n),dialCode:`${E.getCountryCodeForRegionCode(n)}`})),w=class on{async guess(){let o,e;try{o=await fetch(on.IP2C_URL),e=await o.text()}catch{return}const s=e.toString().split(";");if(!(!s||s[0]!=="1"))return s[1]}};w.IP2C_URL="https://ip2c.org/s";let b=w;class J extends b{constructor(){super(...arguments),this.memoCountry=void 0}async guess(){return this.memoCountry||(this.memoCountry=await super.guess()),this.memoCountry}setPreference(o){this.memoCountry=o}}const z={label:"Phone",ariaLabel:void 0,countryLabel:"Country",countryAriaLabel:n=>`Country for ${n.label}`,placeholder:void 0,hint:void 0,invalidMessage:n=>`The "${n.label}" field is not a valid phone number (example: ${n.example}).`,example:void 0,persistentPlaceholder:void 0,persistentHint:void 0,countryIconMode:void 0,allCountries:Y,preferCountries:[],includeCountries:[],excludeCountries:[],defaultCountry:void 0,countryGuesser:new J,guessCountry:!1,disableGuessLoading:!1,enableSearchingCountry:!1,displayFormat:"national"},Q={...z};function X(n){Object.assign(Q,n)}function u(n){return Q[n]}function j(n,o){var e,s;return((e=n.number)==null?void 0:e[o])||((s=n.number)==null?void 0:s.input)||""}function _(n){return E.getExample(n)}function F(n,o){return E.parsePhoneNumber((n||"").trim(),{regionCode:o})}const v=["id","class","style"],$n=["variant","flat","tile","density","singleLine","hideDetails","direction","reverse","color","bgColor","theme","disabled","readonly","rounded"],dn=t.defineComponent({components:{VListItem:R.VListItem,VSelect:R.VSelect,VTextField:R.VTextField},inheritAttrs:!1,props:{label:{type:[String,Function],default:()=>u("label")},ariaLabel:{type:[String,Function],default:()=>u("ariaLabel")},countryLabel:{type:[String,Function],default:()=>u("countryLabel")},countryAriaLabel:{type:[String,Function],default:()=>u("countryAriaLabel")},placeholder:{type:[String,Function],default:()=>u("placeholder")},hint:{type:[String,Function],default:()=>u("hint")},invalidMessage:{type:[String,Function],default:()=>u("invalidMessage")},example:{type:[String,Function],default:()=>u("example")},appendIcon:{type:String,default:void 0},appendInnerIcon:{type:String,default:void 0},prependIcon:{type:String,default:void 0},prependInnerIcon:{type:String,default:void 0},rules:{type:Array,default:()=>[]},validateOn:{type:String,default:void 0},countryIconMode:{type:[String,Object],default:()=>u("countryIconMode")},allCountries:{type:Array,default:()=>u("allCountries")},preferCountries:{type:Array,default:()=>u("preferCountries")},includeCountries:{type:Array,default:()=>u("includeCountries")},excludeCountries:{type:Array,default:()=>u("excludeCountries")},defaultCountry:{type:String,default:()=>u("defaultCountry")},countryGuesser:{type:Object,default:()=>u("countryGuesser")},guessCountry:{type:Boolean,default:()=>u("guessCountry")},disableGuessLoading:{type:Boolean,default:()=>u("disableGuessLoading")},enableSearchingCountry:{type:Boolean,default:()=>u("enableSearchingCountry")},displayFormat:{type:String,default:()=>u("displayFormat")},country:{type:String,default:""},modelValue:{type:String,default:""},wrapperProps:{type:Object,default:()=>({})},countryProps:{type:Object,default:()=>({})},phoneProps:{type:Object,default:()=>({})}},emits:{"update:modelValue":n=>!0,"update:country":n=>!0},setup(n,{attrs:o,emit:e,slots:s}){const{countriesCount:$,preferredCountries:S,otherCountries:M,guessingCountry:c,findCountry:y,firstCountry:m,setCountryPreference:g,guessCountry:G}=an({props:n}),h=t.ref(null),A=t.ref(null),{namespacedSlots:K}=ln(s,["country"]),{countryIconComponent:C}=sn({props:n}),{countrySelectComponent:T}=cn({props:n}),B=t.ref(!1),I=t.ref([]),r=t.ref(n.country),d=t.ref(n.modelValue||""),p=t.ref({number:{input:""}}),O=a=>Object.keys(o).reduce((i,P)=>a(P)?{...i,[P]:o[P]}:i,{}),In=t.computed(()=>({...O(a=>v.indexOf(a)!==-1),...n.wrapperProps})),An=t.computed(()=>({...T.value.props,...O(a=>v.indexOf(a)===-1&&$n.indexOf(a)!==-1),...n.countryProps,menuProps:{maxHeight:300,contentClass:"v-phone-input__country__menu",closeOnContentClick:!0,...(n.countryProps?n.countryProps.menuProps:void 0)||{}}})),Tn=t.computed(()=>({...O(a=>v.indexOf(a)===-1),...n.phoneProps})),Bn=t.computed(()=>y(n.defaultCountry)||m.value),L=t.computed(()=>y(r.value)||Bn.value),fn=t.computed(()=>[...S.value.map(i=>({...i,preferred:!0})),...M.value]),U=a=>j(a,n.displayFormat),gn=t.computed(()=>n.example!==void 0?typeof n.example=="function"?n.example(L.value):n.example:U(_(L.value.iso2))),Pn=t.computed(()=>{var i;const a=new Set(((i=n.validateOn)==null?void 0:i.split(""))||[]);return a.size===0||a.has("input")}),N=rn({props:n,country:L,example:gn}),x=()=>{var a;Pn.value&&((a=A.value)==null||a.validate())},D=()=>{const a=n.rules.map(i=>typeof i=="function"?()=>i(d.value??"",p.value,N.messageOptions.value):i);N.invalidMessage.value?I.value=[...a,()=>!d.value||p.value.valid||N.invalidMessage.value]:I.value=a},hn=()=>{p.value.valid&&(d.value=U(p.value))},Ln=()=>{var a,i;n.modelValue!==(((a=p.value.number)==null?void 0:a.input)??"")&&n.modelValue!==(((i=p.value.number)==null?void 0:i.e164)??"")&&(d.value=n.modelValue||"")},Nn=()=>{n.country&&n.country!==r.value&&(r.value=n.country)};t.watch(()=>n.rules,D,{deep:!0,immediate:!0}),t.watch(()=>n.displayFormat,hn),t.watch(()=>n.modelValue,Ln),t.watch(()=>n.country,Nn);const En=()=>{D(),(d.value??"")!==""&&x()};t.watch(N.invalidMessage,En);const Rn=()=>{B.value=!0},Kn=()=>{B.value=!1},nn=()=>{p.value=F(d.value,r.value),p.value.valid&&(d.value=U(p.value))},Vn=(a,i)=>{r.value?(e("update:country",r.value),g(r.value)):t.nextTick(()=>{r.value||(r.value=i)}),nn(),(d.value??"")!==""&&x()},tn=()=>{if((d.value||"").startsWith("+")){const i=F(d.value).regionCode;i&&r.value!==i&&y(i)&&(r.value=i)}nn()},bn=()=>{var i,P;const a=((i=p.value.number)==null?void 0:i.e164)||((P=p.value.number)==null?void 0:P.input)||"";a!==n.modelValue&&e("update:modelValue",a)};t.watch(r,Vn),t.watch(d,tn),t.watch(p,bn,{deep:!0});const Fn=async()=>{if(r.value)return;if($.value===1){r.value=m.value.iso2;return}const a=await G();!r.value&&a&&(r.value=a),r.value=r.value||L.value.iso2};return t.onMounted(()=>{tn(),t.nextTick(()=>{Fn()})}),{wrapperAttrs:In,VTextField:R.VTextField,countryInput:h,phoneInput:A,namespacedSlots:K,countrySelectComponent:T,countryIconComponent:C,countryAttrs:An,phoneAttrs:Tn,countryFocused:B,guessingCountry:c,mergeRules:D,lazyCountry:r,lazyValue:d,mergedRules:I,activeCountry:L,labels:N,countriesItems:fn,onCountryFocus:Rn,onCountryBlur:Kn}}}),Cn=(n,o)=>{const e=n.__vccOpts||n;for(const[s,$]of o)e[s]=$;return e},Sn={key:1},Mn={class:"v-phone-input__country__title"},yn={class:"v-phone-input__country__append text-body-2"};function pn(n,o,e,s,$,S){const M=t.resolveComponent("v-list-item");return t.openBlock(),t.createElementBlock("div",t.mergeProps({class:[{"v-phone-input--prepend-inner-icon":n.prependInnerIcon},"v-phone-input"]},n.wrapperAttrs),[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.countrySelectComponent.type),t.mergeProps({ref:"countryInput",modelValue:n.lazyCountry,"onUpdate:modelValue":o[0]||(o[0]=c=>n.lazyCountry=c),label:n.labels.countryLabel.value,"aria-label":n.labels.countryAriaLabel.value,items:n.countriesItems,"item-title":"name","item-value":"iso2",loading:n.guessingCountry,"prepend-icon":n.prependIcon,"prepend-inner-icon":n.prependInnerIcon,class:[{"v-phone-input--focused":n.countryFocused},"v-phone-input__country__input"]},n.countryAttrs,{onFocus:n.onCountryFocus,onBlur:n.onCountryBlur}),t.createSlots({selection:t.withCtx(()=>[t.renderSlot(n.$slots,"country-selection",{country:n.activeCountry},()=>[t.renderSlot(n.$slots,"country-icon",{country:n.activeCountry,decorative:!1},()=>[n.countryIconComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.countryIconComponent),{key:0,country:n.activeCountry,decorative:!1},null,8,["country"])):(t.openBlock(),t.createElementBlock("span",Sn,t.toDisplayString(`+${n.activeCountry.dialCode}`),1))])])]),item:t.withCtx(c=>[t.createVNode(M,t.normalizeProps(t.guardReactiveProps(c.props)),{prepend:t.withCtx(()=>[t.renderSlot(n.$slots,"country-icon",{country:c.item.raw,decorative:!0},()=>[n.countryIconComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.countryIconComponent),{key:0,country:c.item.raw,decorative:!0},null,8,["country"])):t.createCommentVNode("",!0)])]),title:t.withCtx(()=>[t.renderSlot(n.$slots,"country-title",{country:c.item.raw},()=>[t.createElementVNode("span",Mn,t.toDisplayString(c.item.raw.name),1)])]),append:t.withCtx(()=>[t.renderSlot(n.$slots,"country-append",{country:c.item.raw},()=>[t.createElementVNode("span",yn," +"+t.toDisplayString(c.item.raw.dialCode),1)])]),_:2},1040)]),_:2},[t.renderList(n.namespacedSlots.country,(c,y)=>({name:y,fn:t.withCtx(m=>[t.renderSlot(n.$slots,c,t.normalizeProps(t.guardReactiveProps(m)))])}))]),1040,["modelValue","label","aria-label","items","loading","prepend-icon","prepend-inner-icon","class","onFocus","onBlur"])),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.VTextField),t.mergeProps({ref:"phoneInput",modelValue:n.lazyValue,"onUpdate:modelValue":o[1]||(o[1]=c=>n.lazyValue=c),label:n.labels.label.value,"aria-label":n.labels.ariaLabel.value,placeholder:n.labels.placeholder.value,hint:n.labels.hint.value,rules:n.mergedRules,"append-icon":n.appendIcon,"append-inner-icon":n.appendInnerIcon,"validate-on":n.validateOn,class:"v-phone-input__phone__input",type:"tel"},n.phoneAttrs),t.createSlots({_:2},[t.renderList(n.namespacedSlots.default,(c,y)=>({name:y,fn:t.withCtx(m=>[t.renderSlot(n.$slots,y,t.normalizeProps(t.guardReactiveProps(m)))])}))]),1040,["modelValue","label","aria-label","placeholder","hint","rules","append-icon","append-inner-icon","validate-on"]))],16)}const q=Cn(dn,[["render",pn]]);function mn(n){return(o,e)=>{e&&console.warn("[v-phone-input] options must be passed as first argument of createVPhoneInput()"),X(n||{}),o.component("VPhoneInput",q)}}const _l="";class Gn extends b{constructor(o={}){super(),this.storage=o.storage||localStorage,this.key=o.key||"v_phone_input_country"}async guess(){const o=this.retrieveStoredCountry();if(o)return o;const e=await super.guess();return e&&this.saveStoredCountry(e),e}setPreference(o){this.saveStoredCountry(o)}retrieveStoredCountry(){return this.storage.getItem(this.key)||void 0}saveStoredCountry(o){this.storage.setItem(this.key,o)}getStorage(){return this.storage}getKey(){return this.key}}l.DEFAULT_OPTIONS=z,l.Ip2cCountryGuesser=b,l.MemoIp2cCountryGuesser=J,l.StorageMemoIp2cCountryGuesser=Gn,l.VCountryIconSprite=W,l.VCountryIconSvg=k,l.VPhoneInput=q,l.countries=Y,l.createVPhoneInput=mn,l.formatPhone=j,l.getOption=u,l.makeExample=_,l.makePhone=F,l.mergeOptions=X,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});