UNPKG

vue3-country-intl

Version:

A vue3-based mobile phone area code selection, nationality selection component(一个基于vue3的手机区号选择、国籍选择组件)

1 lines 62.6 kB
import{reactive as e,ref as t,computed as n,watch as o,onMounted as a,onUnmounted as l,resolveComponent as i,openBlock as r,createElementBlock as s,normalizeStyle as u,createElementVNode as d,Fragment as c,renderList as f,normalizeClass as h,createVNode as p,withCtx as m,toDisplayString as v,withDirectives as y,vShow as g,createTextVNode as b,defineComponent as w,onBeforeMount as C,createBlock as S,Transition as T,renderSlot as x,vModelText as I,withModifiers as z,createCommentVNode as M,Teleport as P,resolveDynamicComponent as V,onBeforeUnmount as B,mergeProps as E}from"vue";function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function L(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){return function(e){if(Array.isArray(e))return H(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return H(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}for(var A=["阿富汗","阿尔巴尼亚","阿尔及利亚","美属萨摩亚群岛","安道尔","安哥拉共和国","安圭拉","安提瓜岛","阿根廷","亚美尼亚","阿鲁巴","澳大利亚","奥地利共和国","阿塞拜疆共和国","巴哈马国","巴林王国","孟加拉人民共和国","巴巴多斯","白俄罗斯共和国","比利时王国 (België)","伯利兹","贝宁共和国 (Bénin)","百慕大群岛","不丹王国","玻利维亚国","波斯尼亚和黑塞哥维那","博茨瓦纳","巴西联邦共和国","英属印度洋领地","英属维尔京群岛","文莱达鲁萨兰国","保加利亚共和国","布基纳法索","布隆迪共和国","柬埔寨王国","喀麦隆共和国","加拿大","佛得角共和国","荷兰王国","开曼群岛","中非共和国","乍得共和国","智利共和国","中国","圣诞岛","科科斯群岛","哥伦比亚共和国","科摩罗联盟","刚果民主共和国","刚果共和国","库克群岛","哥斯达黎加共和国","科特迪瓦","克罗地亚共和国","古巴共和国","库拉索","塞浦路斯","捷克共和国","丹麦","吉布提共和国","多米尼克国","多米尼加共和国","厄瓜多尔","埃及","萨尔瓦","赤道几内亚","厄立特里亚","爱沙尼亚共和国","埃塞俄比亚","马尔维纳斯群岛","法罗群岛","斐济共和国","芬兰","法国","法属圭亚那","法属波利尼西亚","加蓬","冈比亚","格鲁吉亚","德国","加纳","直布罗陀","希腊","格陵兰","格林纳达","瓜德罗普岛","关岛","危地马拉","根西","几内亚","几内亚比绍共和国","圭亚那","海地","洪都拉斯","中国香港","匈牙利","冰岛","印度","印度尼西亚","地拉那","伊拉克共和国","爱尔兰","马恩岛","以色列国","意大利","牙买加","日本","泽西","约旦哈希姆王国","哈萨克斯坦共和国","肯尼亚","基里巴斯","科索沃","科威特国","吉尔吉斯共和国","老挝人民民主共和国","拉脱维亚共和国","黎巴嫩共和国","莱索托","利比里亚","利比亚","列支敦士登","立陶宛共和国","卢森堡","中國澳門","马其顿","马达加斯加共和国","马拉维","马来西亚","马尔代夫","马里","马耳他","马绍尔群岛共和国","马提尼克岛","毛里塔尼亚","毛里求斯","马约特","墨西哥","密克罗尼西亚","摩尔多瓦共和国","摩纳哥","蒙古","黑山共和国","蒙特塞拉特岛","摩洛哥","莫桑比克","缅甸联邦共和国","纳米比亚","瑙鲁","尼泊尔","荷兰","新喀里多尼亚","新西兰","尼加拉瓜","尼日尔","尼日利亚","纽埃","诺福克岛","朝鲜 (조선 민주주의 인민 공화국)","北马里亚纳群岛","挪威","阿曼苏丹国","巴基斯坦","帕劳共和国","巴勒斯坦国","巴拿马","巴布亚新几内亚独立国","巴拉圭","秘鲁","菲律宾共和国","波兰","葡萄牙","波多黎各岛","卡塔尔国","留尼旺岛","罗马尼亚","俄罗斯","卢旺达","圣巴托洛缪岛","圣海伦娜岛","圣基茨和尼维斯联邦","圣卢西亚","圣马丁岛","圣皮埃尔岛和密克隆岛","圣文森特和格林纳丁斯","西萨摩亚","圣马利诺","圣多美和普林西比民主共和国 (São Tomé e Príncipe)","沙特阿拉伯王国","塞内加尔","塞尔维亚共和国","塞舌尔","塞拉利昂共和国","新加坡","圣马丁岛","斯洛伐克共和国","斯洛文尼亚","所罗门群岛","索马里","南非","韩国","南苏丹共和国","西班牙","斯里兰卡","苏丹","苏里南","斯瓦尔巴群岛","斯威士兰","瑞典","瑞士","阿拉伯叙利亚共和国","中国台灣","塔吉克斯坦共和国","坦桑尼亚","泰国","东帝汶民主共和国","多哥","托克劳群岛","汤加","特立尼达和多巴哥共和国","突尼斯","土耳其","土库曼斯坦","特克斯和凯科斯群岛","图瓦卢","美属维尔京群岛","乌干达共和国","乌克兰","阿拉伯联合酋长国","大不列颠联合王国","美国","乌拉圭","乌兹别克斯坦共和国","瓦努阿图","梵蒂冈","委内瑞拉","越南","瓦利斯群岛和富图纳群岛","阿拉伯撒哈拉民主共和国","也门共和国","赞比亚","津巴布韦","奥兰群岛","南极洲","布维岛","南乔治亚和南桑威奇群岛","赫德岛和麦克唐纳群岛","皮特凯恩群岛","法属南部和南极领地","美国本土外小岛屿"],W=[["Afghanistan (‫افغانستان‬‎)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (‫الجزائر‬‎)","dz","213"],["American Samoa","as","1684"],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1264"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1242"],["Bahrain (‫البحرين‬‎)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1246"],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1441"],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1284"],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1],["Cayman Islands","ky","1345"],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2],["Cocos (Keeling) Islands","cc","61",1],["Colombia","co","57"],["Comoros (‫جزر القمر‬‎)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1767"],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (‫مصر‬‎)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1473"],["Guadeloupe","gp","590",0],["Guam","gu","1671"],["Guatemala","gt","502"],["Guernsey","gg","44",1],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (中国香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (‫ایران‬‎)","ir","98"],["Iraq (‫العراق‬‎)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2],["Israel (‫ישראל‬‎)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan (日本)","jp","81"],["Jersey","je","44",3],["Jordan (‫الأردن‬‎)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (‫الكويت‬‎)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (‫لبنان‬‎)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (‫ليبيا‬‎)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (中國澳門)","mo","853"],["Macedonia (FYROM) (Македонија)","mk","389"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (‫موريتانيا‬‎)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1664"],["Morocco (‫المغرب‬‎)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["Northern Mariana Islands","mp","1670"],["Norway (Norge)","no","47",0],["Oman (‫عُمان‬‎)","om","968"],["Pakistan (‫پاکستان‬‎)","pk","92"],["Palau","pw","680"],["Palestine (‫فلسطين‬‎)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (‫قطر‬‎)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (‫المملكة العربية السعودية‬‎)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1721"],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (‫جنوب السودان‬‎)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්‍රී ලංකාව)","lk","94"],["Sudan (‫السودان‬‎)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1],["Swaziland","sz","268"],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (‫سوريا‬‎)","sy","963"],["Taiwan (中国台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia (‫تونس‬‎)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1649"],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1340"],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (‫الصحراء الغربية‬‎)","eh","212",1],["Yemen (‫اليمن‬‎)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1],["Antarctica","aq","672"],["Bouvet Island","bv","47"],["South Georgia and the South Sandwich Islands","gs","500"],["Heard Island and McDonald Islands","hm","672"],["Pitcairn","pn","64"],["French Southern Territories","tf","262"],["United States Minor Outlying Islands","um","1"]],F=0;F<W.length;F++){var j=W[F];W[F]={name:j[0],nameCN:A[F],iso2:j[1],dialCode:j[2],priority:j[3]||0,areaCodes:j[4]||null}}var R=W,D={modelValue:{type:[String,Number],default:""},type:{type:String,default:"phone"},iso2:{type:String,default:""},listZIndex:{type:Number,default:0},maxHeight:{type:Number,default:0},searchText:{type:[String,Number],default:""},showAreaCode:{type:Boolean,default:!0},selectedText:{type:String,default:"Selected"},showSelectedText:{type:Boolean,default:!0},searchAble:{type:Boolean,default:!0},disableCountry:{type:[String,Array],default:function(){return[]}},onlyCountry:{type:[String,Array],default:function(){return[]}},noDataText:{type:String,default:"未找到任何数据!"},useChinese:{type:Boolean,default:!1},sort:{type:Function,default:null},filter:{type:Function,default:null},transform:{type:Function,default:null},name:{type:String}};function U(e,t){var n=t.slots.default,o=e.outSlots,a=e.slotData,l=(o=o||{})[e.slotName];return l?l(a):n?n(a):void 0}U.props=["outSlots","slotData","slotName"];var $="update:modelValue",G="update:visible",_="onChange";function K(e,t){if(e===t)return!1;if(!e)return!1;if("function"==typeof e.contains)return e.contains(t);for(;;){if(!t)return!1;if(t===e)return!0;t=t.parentNode}return!1}function q(e,t,n,o){var a=e;if(0==(a+"").length)return{};var l="phone"===t.toLowerCase();"+"===(a+"").charAt(0)&&(a=a.substr(1));var i=o.filter((function(e){return l?n?e.iso2==n:e.dialCode==a||(1==e.dialCode&&e.areaCodes?e.areaCodes.some((function(e){return e==a})):void 0):e.iso2==a}));return i=i&&0!==i.length&&i[0]||{}}function Z(e,t){if(!e||0==e.length||!t||"function"!=typeof t)return-1;if(e.findIndex)return e.findIndex(t);for(var n=e.length,o=0,a=-1;o<n;o++){if(!0===t(e[o],a,e)){a=o;break}}return a}function Y(e,t){if(e&&e.nodeName){if(t){var n="";window.getComputedStyle?n=window.getComputedStyle(e,null)[t]:e.currentStyle&&(n=e.currentStyle[t]);var o=parseFloat(n);return isNaN(o)?n:o}console.error("cssAttribute 必须是一个字符串")}else console.error("ele 必须是一个dom元素")}function X(e){return e&&1==e.nodeType?function(e){var t={vertical:!1,horizontal:!1};if(!(e instanceof HTMLElement))return t;var n=["hidden","visible"];if(e.scrollTop>0)t.vertical=!0;else{var o=Y(e,"overflow-y");t.vertical=!n.includes(o)&&e.scrollHeight>e.clientHeight}if(e.scrollLeft>0)t.horizontal=!0;else{var a=Y(e,"overflow-x");t.horizontal=!n.includes(a)&&e.scrollWidth>e.clientWidth}return t}(e):{vertical:document.body.scrollHeight>window.innerHeight,horizontal:document.body.scrollWidth>window.innerWidth}}var J={name:"CountryList",props:O(O({},D),{},{rootSlots:{type:Object,default:function(){return{}}}}),components:{SlotRender:U},emits:[$,_],setup:function(i,r){var s=e({item:{}}),u=t(""),d=n((function(){var e=i.searchText||"",t=N(R),n="string"==typeof i.disableCountry?i.disableCountry.split(","):i.disableCountry,o="string"==typeof i.onlyCountry?i.onlyCountry.split(","):i.onlyCountry,a=i.sort,l=i.filter,r=i.transform;if(o.length>0&&(t=t.filter((function(e){return Z(o,(function(t){var n=t+"";return"+"===n.charAt(0)&&(n=n.replace("+","")),e.name===t||e.nameCN===t||e.dialCode===n||e.iso2===t}))>-1}))),n.length>0&&(t=t.filter((function(e){return-1===Z(n,(function(t){var n=t+"";return"+"===n.charAt(0)&&(n=n.replace("+","")),e.name===t||e.nameCN===t||e.dialCode===n||e.iso2===t}))}))),"function"==typeof l&&(t=t.filter(l)),"function"==typeof a&&t.sort(a),"function"==typeof r&&(t=r(t)),!i.searchAble||0===e.length)return t;return e=(e=e.replace("+","\\+")).replace("台湾","台灣").replace("臺灣","台灣").replace("澳门","澳門"),t=t.filter((function(t){var n=new RegExp(e,"gi"),o=n.test(t.name),a=n.test(t.nameCN);return!(!o&&!a)||(!!n.test(t.dialCode)||(!!n.test(t.iso2)||t.areaCodes&&t.areaCodes.some((function(t){return e.search(t)>-1}))))}))})),c=o((function(){return i.modelValue}),(function(){if(u.value!=i.modelValue){var e=q(i.modelValue,i.type,i.iso2,d.value);if(e&&e!==s.item){s.item=e,u.value=i.modelValue;var t="";t="phone"===i.type.toLowerCase()?1==e.dialCode&&e.areaCodes?e.areaCodes[0]:e.dialCode||"":e.iso2||"",r.emit("onChange",e,t)}}}),{immediate:!0});return a((function(){"phone"==i.type&&0==(i.iso2+"").length&&console.warn("当type=phone时最好传递iso2属性,否则当区号代码为212或358时会出现选择不正确问题!")})),l((function(){c()})),{selected:s,countryList:d,clear:function(){r.emit("update:modelValue",""),r.emit("onChange",{},"")},areaCodeView:function(e,t){if(1==e&&t.areaCodes){var n=t.areaCodes.slice(0,5);return t.areaCodes[0]+" [".concat(n.join(", "),"]")}return e},countryItemClickEvt:function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!0;var t,n=e.target;if(!i.justRead){for(;n&&"LI"!==n.nodeName;)n=n.parentElement;if(n){e.currentTarget;for(var o=n.getAttribute("data-iso"),a=0,l=d.value.length;a<l;a++)if(d.value[a].iso2==o){t=d.value[a];break}if(t){s.item=t;var c="";c="phone"===i.type.toLowerCase()?1==t.dialCode&&t.areaCodes?t.areaCodes[0]:t.dialCode||"":t.iso2||"",u.value=c,r.emit("update:modelValue",c),r.emit("onChange",t,c)}}}}}}},Q=["data-index","data-iso"],ee={class:"vue-country-name"},te={class:"selected-text"},ne={class:"vue-country-no-data"};J.render=function(e,t,n,o,a,l){var w=i("SlotRender");return r(),s("div",{class:"vue-country-list-wrap",style:u({"z-index":0!=e.listZIndex?e.listZIndex:"","max-height":e.maxHeight>0?e.maxHeight+"px":""})},[d("ul",{class:"vue-country-list",onMousedown:t[0]||(t[0]=function(){return o.countryItemClickEvt&&o.countryItemClickEvt.apply(o,arguments)})},[(r(!0),s(c,null,f(o.countryList,(function(t,a){return r(),s("li",{class:h(["vue-country-item",{selected:t.iso2===o.selected.item.iso2}]),key:t.iso2+a,"data-index":a,"data-iso":t.iso2},[p(w,{"slot-name":"countryItem","out-slots":n.rootSlots,"slot-data":t},{default:m((function(){return[d("span",{class:h(["iti-flag",t.iso2])},null,2),d("span",ee,v(e.useChinese?t.nameCN:t.name),1),y(d("span",{class:"vue-country-areaCode"}," +"+v(o.areaCodeView(t.dialCode,t)),513),[[g,e.showAreaCode]]),y(d("span",te,[p(w,{"slot-name":"selected","out-slots":n.rootSlots,"slot-data":t},{default:m((function(){return[b(v(e.selectedText),1)]})),_:2},1032,["out-slots","slot-data"])],512),[[g,e.showSelectedText]])]})),_:2},1032,["out-slots","slot-data"])],10,Q)})),128)),y(d("li",ne,[p(w,{"slot-name":"emptyData","out-slots":n.rootSlots},{default:m((function(){return[b(v(e.noDataText),1)]})),_:1},8,["out-slots"])],512),[[g,0===o.countryList.length]])],32)],4)},J.__file="src/components/country-list/CountryList.vue";const oe=()=>{},ae=e=>null!==e&&"object"==typeof e;var le=Object.defineProperty,ie=Object.defineProperties,re=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,ue=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable,ce=(e,t,n)=>t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fe=(e,t)=>{for(var n in t||(t={}))ue.call(t,n)&&ce(e,n,t[n]);if(se)for(var n of se(t))de.call(t,n)&&ce(e,n,t[n]);return e},he=(e,t)=>ie(e,re(t));function pe(e){return"function"==typeof e}function me(e){return"string"==typeof e}function ve(e){return me(e)?e.replace(/-(.)/g,(function(e,t){return t.toUpperCase()})):e}function ye(e){return me(e)?e.replace(/(\w)([A-Z])/g,(function(e,t,n){return t+"-"+n.toLowerCase()})):e}function ge(){var e=navigator.userAgent,t=e.indexOf("Android")>-1||e.indexOf("Linux")>-1,n=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return{android:t,ios:n,pc:!n&&!t}}function be(e){var t={top:0,left:0};if(!e||1!=e.nodeType)return t;var n=e.offsetParent;for(t.top=e.offsetTop,t.left=e.offsetLeft;null!=n;)t.top+=n.offsetTop,t.left+=n.offsetLeft,n=n.offsetParent;return t}function we(e){var t={vertical:!1,horizontal:!1};if(!(e instanceof HTMLElement))return t;var n=["hidden","visible"];if(e.scrollTop>0)t.vertical=!0;else{var o=Ce(e,"overflow-y");t.vertical=!n.includes(o)&&e.scrollHeight>e.clientHeight}if(e.scrollLeft>0)t.horizontal=!0;else{var a=Ce(e,"overflow-x");t.horizontal=!n.includes(a)&&e.scrollWidth>e.clientWidth}return t}function Ce(e,t){if(!e||!e.nodeName||!t)return;var n="";window.getComputedStyle?n=window.getComputedStyle(e,null)[t]:e.currentStyle&&(n=e.currentStyle[t]);let o=parseFloat(n);return isNaN(o)?n:o}function Se(e){if(e)for(var t=e.parentElement;null!=t;){var n=we(t);if(n.vertical||n.horizontal)return t;t=t.parentElement}}function Te(e){var t={x:0,y:0,z:0,rotate:0,scaleX:1,scaleY:1};if(!e||"none"==e)return t;var n=e.substring(6),o=n.match(/\(([^)]*)\)/),a=function(e){var t=Math.round(180*Math.asin(e[0])/Math.PI),n=Math.round(180*Math.acos(e[1])/Math.PI),o=Math.round(180*Math.asin(e[2])/Math.PI),a=Math.round(180*Math.acos(e[3])/Math.PI),l=0;return t==n||-t==n?l=a:-t+n==180?l=180+o:t+n==180&&(l=360-o||360-a),l>=360?0:l},l=o?o[1].split(","):n.split(",");return t.x=l.length>6?parseFloat(l[12]):parseFloat(l[4]),t.y=l.length>6?parseFloat(l[13]):parseFloat(l[5]),t.z=l.length>6?parseFloat(l[14]):0,t.rotate=l.length>6?a([parseFloat(l[0]),parseFloat(l[1]),parseFloat(l[4]),parseFloat(l[5])]):a(l),t.scaleX=parseFloat(l[0]),t.scaleY=parseFloat(l[3]),t}function xe(e){return e&&1==e.nodeType?we(e):{vertical:document.body.scrollHeight>window.innerHeight,horizontal:document.body.scrollWidth>window.innerWidth}}function Ie(e){if(!e||1!=e.nodeType)return!1;for(var t=e.offsetParent,n=!1;null!=t&&!n;){if("fixed"===Ce(t,"position")){n=!0;break}t=t.offsetParent}return n}function ze(e){return e&&1==e.nodeType?e.scrollTop:window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}function Me(e){return e&&1==e.nodeType?e.scrollLeft:window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0}function Pe(e){var t,n=document.createElement("div"),o={vertical:0,horizontal:0};return n.style.cssText="width: 200px;height: 200px",e&&1==e.nodeType?((t=e.cloneNode(!0)).style.cssText="width: 100px;height: 100px;opacity: 0;position:absolute;left: -100px;overflow:auto;",t.appendChild(n),document.body.appendChild(t),o.vertical=t.offsetWidth-t.clientWidth,o.horizontal=t.offsetHeight-t.clientHeight,document.body.removeChild(t),t=n=null,o):(o.vertical=window.innerWidth-document.documentElement.offsetWidth,o.horizontal=window.innerHeight-document.documentElement.clientHeight,o)}const Ve=/(\w+)End$/,Be=/(\w+)Center$/,Ee=["HTML","BODY"];function ke(e){let{ele:t,top:n,left:o,needSubtractScrollOffset:a,documentHasScroll:l,documentScrollInfo:i,bodyScrollVisible:r,referenceIsInFixedPosition:s,scrollParent:u,windowWH:d,targetIsInFixedPosition:c,targetIsInBody:f}=e,h=0,p=0,m=!0,v=!0;if(u&&!Ee.includes(u.nodeName)){h=ze(u),p=Me(u);let e=n,d=o;s&&f&&(l.vertical&&!r.vertical&&(e-=i.top),l.horizontal&&!r.horizontal&&(d-=i.left));let c=function(e,t,n=0,o=0,a=!0){var l={horizontal:!0,vertical:!0};if(!e||!t)return l;var i=be(t),r=ze(t),s=Me(t),u=xe(t),d=Pe(t),c={top:n,left:o};if(!n||!o){var f=be(e);n||(c.top=f.top),o||(c.left=f.left)}if(c.top-=r,c.left-=s,a){var h=ze(),p=Me();c.top-=h,c.left-=p,i.top-=h,i.left-=p}var m=i.left+t.offsetWidth-(u.vertical?d.vertical:0),v=i.top+t.offsetHeight-(u.horizontal?d.horizontal:0),y=c.left+e.offsetWidth,g=c.top+e.offsetHeight,b=c.left>=i.left&&c.left<m,w=y>i.left&&y<m,C=c.top>=i.top&&c.top<v,S=g>i.top&&g<v;return l.horizontal=b&&w,l.vertical=C&&S,l}(t,u,e,d,a);v=c.horizontal,m=c.vertical}if(!n||!o){var y=be(t);n||(n=y.top),o||(o=y.left)}c||(l.vertical&&(n-=i.top),l.horizontal&&(o-=i.left)),n-=h,o-=p;let g=t.offsetHeight+n,b=t.offsetWidth+o;l.vertical&&(d.width=d.width-Pe().vertical),l.horizontal&&(d.height=d.height-Pe().horizontal);let w=n>0&&n<d.height&&g>0&&g<=d.height,C=o>0&&o<d.width&&b>0&&b<=d.width,S=-1,T=-1;return w||(n<0?S=t.offsetHeight+n:g>d.height&&(S=g-d.height)),C||(o<0?T=t.offsetWidth+o:b>d.width&&(T=b-d.width)),{scrollParentHorizontal:v,scrollParentVertical:m,horizontalVisibleWidth:T,verticalVisibleHeight:S,vertical:w,horizontal:C}}function Oe(e,t,n,o=!1,a=!0,l){if(!e||!t||!n)throw new Error("One of the parameters of referenceEl, targetEl, direction is missing!");let i=n=ve(n),r=!1,s=!1;Ve.test(n)&&(n=RegExp.$1,r=!0),Be.test(n)&&(n=RegExp.$1,s=!0);let u={top:ze(),left:Me()};var d=be(e),c=Ie(e),f=Ie(t),h=e.getBoundingClientRect(),p=t.style.display,m=t.style.opacity,v=Ce(t,"display"),y="fixed"===Ce(t,"position");"none"===v&&(t.style.opacity="0",t.style.display="block");var g=!0;let b=t.offsetParent||document.body,w=!b||Ee.includes(b.nodeName),C={top:0,left:0};w||(C=be(b));var S=Ce(document.body,"overflow-y"),T=Ce(document.body,"overflow-x");c&&(!y&&w&&("hidden"!=S&&(d.top=d.top+ze()),"hidden"!=T&&(d.left=d.left+Me())),!y&&!w&&(g=!0));let x=Se(e),I=0,z=0;x&&!Ee.includes(x.nodeName)&&(I=ze(x),z=Me(x));let M=Ee.includes(b.nodeName),P=xe(),V={vertical:!1,horizontal:!1};M&&(V={vertical:"hidden"!=S,horizontal:"hidden"!=T});let B=Pe(),E=ge(),k={width:E.pc?window.innerWidth:Math.min(document.documentElement.clientWidth,window.innerWidth),height:E.pc?window.innerHeight:Math.min(document.documentElement.clientHeight,window.innerHeight)};var O=t.getBoundingClientRect(),L=Te(Ce(t,"transform"));O.width=Math.round(O.width/Math.abs(L.scaleX)),O.height=Math.round(O.height/Math.abs(L.scaleY));var N=(null==l?void 0:l.top)||0,H=(null==l?void 0:l.left)||0,A=null,W=[],F=function(e,n){var o=d.top+h.height,a=e?Math.floor(d.left-(O.width-h.width)):d.left;!e&&n&&(a-=(O.width-h.width)/2);var l=null;o+=N,a+=H,M&&(P.vertical&&!V.vertical&&(o+=u.top),P.horizontal&&!V.horizontal&&(a+=u.left));var i=ke({ele:t,top:o,left:a,needSubtractScrollOffset:g,bodyScrollVisible:V,targetIsInBody:M,referenceIsInFixedPosition:c,documentHasScroll:P,documentScrollInfo:u,scrollParent:x,windowWH:fe({},k),targetIsInFixedPosition:f});o-=M?I:0,a-=M?z:0,M?(l=k.width-d.left+z-h.width,P.vertical&&V.vertical&&(l-=B.vertical),P.horizontal&&!V.horizontal&&(l-=u.left)):l=b.clientWidth-(d.left-C.left)-h.width;let r=o-C.top,s=a-C.left;return r-=N,s-=H,he(fe({},i),{direction:!e&&n?"bottomCenter":e?"bottomEnd":"bottom",top:r,left:s,bottom:null,right:e?l:null})};let j=function(e,n){var o=d.top-O.height,a=e?Math.floor(d.left-(O.width-h.width)):d.left;!e&&n&&(a-=(O.width-h.width)/2),o+=N,a+=H,M&&(P.vertical&&!V.vertical&&(o+=u.top),P.horizontal&&!V.horizontal&&(a+=u.left));var l=ke({ele:t,top:o,left:a,needSubtractScrollOffset:g,bodyScrollVisible:V,targetIsInBody:M,referenceIsInFixedPosition:c,documentHasScroll:P,documentScrollInfo:u,scrollParent:x,windowWH:fe({},k),targetIsInFixedPosition:f});o-=M?I:0,a-=M?z:0;var i=null,r=null;M?(i=k.height-d.top+I,r=k.width-d.left+z-h.width,P.vertical&&V.vertical&&(r-=B.vertical),P.horizontal&&!V.horizontal&&(r-=u.left),P.horizontal&&V.horizontal&&(i-=B.horizontal),P.vertical&&!V.vertical&&(i-=u.top)):(i=b.clientHeight-(d.top-C.top),r=b.clientWidth-(d.left-C.left)-h.width);let s=o-C.top,p=a-C.left;return s-=N,p-=H,he(fe({},l),{direction:!e&&n?"topCenter":e?"topEnd":"top",bottom:i,right:e?r:null,top:s,left:p})},R=function(e,n){var o=e?Math.floor(d.top-(O.height-h.height)):d.top,a=d.left-O.width;!e&&n&&(o-=(O.height-h.height)/2);var l=null,i=null;o+=N,a+=H,M?(P.vertical&&!V.vertical&&(o+=u.top),P.horizontal&&!V.horizontal&&(a+=u.left),e&&(l=k.height-(d.top+h.height)+I)):e&&(l=b.clientHeight-(d.top+h.height-C.top));var r=ke({ele:t,top:o,left:a,needSubtractScrollOffset:g,bodyScrollVisible:V,targetIsInBody:M,referenceIsInFixedPosition:c,documentHasScroll:P,documentScrollInfo:u,scrollParent:x,windowWH:fe({},k),targetIsInFixedPosition:f});o-=M?I:0,a-=M?z:0,M?(i=k.width-d.left+z,P.vertical&&V.vertical&&(i-=B.vertical),P.horizontal&&!V.horizontal&&(i-=u.left),e&&(P.horizontal&&V.horizontal&&(l-=B.horizontal),P.vertical&&!V.vertical&&(l-=u.top))):i=b.clientWidth-(d.left-C.left);let s=o-C.top,p=a-C.left;return s-=N,p-=H,he(fe({},r),{right:i,bottom:l,direction:!e&&n?"leftCenter":e?"leftEnd":"left",top:s,left:p})},D=function(e,n){var o=e?Math.floor(d.top-(O.height-h.height)):d.top,a=d.left+h.width;!e&&n&&(o-=(O.height-h.height)/2),o+=N,a+=H,M&&(P.vertical&&!V.vertical&&(o+=u.top),P.horizontal&&!V.horizontal&&(a+=u.left));var l=null;e&&(l=M?k.height-(d.top+h.height)+I:b.clientHeight-(d.top+h.height-C.top));var i=ke({ele:t,top:o,left:a,bodyScrollVisible:V,needSubtractScrollOffset:g,targetIsInBody:M,referenceIsInFixedPosition:c,documentHasScroll:P,documentScrollInfo:u,scrollParent:x,windowWH:fe({},k),targetIsInFixedPosition:f});a-=M?z:0;let r=(o-=M?I:0)-C.top,s=a-C.left;return M&&e&&(P.vertical&&!V.vertical&&(l-=u.top),P.horizontal&&V.horizontal&&(l-=B.horizontal)),r-=N,s-=H,he(fe({},i),{right:null,bottom:l,direction:!e&&n?"rightCenter":e?"rightEnd":"right",top:r,left:s})};switch(n){case"bottom":s&&W.push({isTail:!1,isCenter:!0,handler:F}),W.push({isTail:r,handler:F}),s&&W.push({isTail:!1,isCenter:!0,handler:j}),W.push({isTail:r,handler:j}),o&&(W.push({isTail:!1,handler:R}),W.push({isTail:!1,handler:D}));break;case"top":s&&W.push({isTail:!1,isCenter:!0,handler:j}),W.push({isTail:r,handler:j}),s&&W.push({isTail:!1,isCenter:!0,handler:F}),W.push({isTail:r,handler:F}),o&&(W.push({isTail:!1,handler:R}),W.push({isTail:!1,handler:D}));break;case"left":s&&W.push({isTail:!1,isCenter:!0,handler:R}),W.push({isTail:r,handler:R}),s&&W.push({isTail:!1,isCenter:!0,handler:D}),W.push({isTail:r,handler:D}),o&&(W.push({isTail:!1,handler:F}),W.push({isTail:!1,handler:j}));break;case"right":s&&W.push({isTail:!1,isCenter:!0,handler:D}),W.push({isTail:r,handler:D}),s&&W.push({isTail:!1,isCenter:!0,handler:R}),W.push({isTail:r,handler:R}),o&&(W.push({isTail:!1,handler:F}),W.push({isTail:!1,handler:j}))}let U=[],$={},G=function(e=!1,t){let n=t.handler(a?!t.isTail:t.isTail,t.isCenter),o=n.vertical&&n.horizontal,l=n.scrollParentVertical&&n.scrollParentHorizontal,r=e?o&&l:o||l;return n.direction===i&&($=n),U.push(n),!!r&&(A=n,!0)};if(W.some((function(e){let t=e.handler(e.isTail,e.isCenter),n=t.vertical&&t.horizontal,o=t.scrollParentVertical&&t.scrollParentHorizontal;return t.direction===i&&($=t),U.push(t),n?o?(A=t,!0):e.isCenter?void 0:!!G(!0,e):e.isCenter?void 0:G(!0,e)})),!A){let e=null,t=null;U.forEach((n=>{!e&&n.horizontal&&n.vertical&&(e=n),!t&&n.scrollParentHorizontal&&n.scrollParentVertical&&(t=n)})),t?A=t:e?A=e:(A=$).isRollback=!0}return t.style.opacity=m||"",t.style.display=p||"",A}function Le(e,t,n,o=!1,a=!0,l){if(!e||!t||!n)throw new Error("One of the parameters of virtualMouseEvt, targetEl, direction is missing!");let i=n=ve(n),r=!1,s=!1;Ve.test(n)&&(n=RegExp.$1,r=!0),Be.test(n)&&(n=RegExp.$1,s=!0);let u={top:ze(),left:Me()};var d=e.clientX,c=e.clientY,f=e.contextElement,h=!!f&&1==f.nodeType&&!Ee.includes(f.nodeName),p=be(f),m={top:p.top,left:p.left,bottom:p.top+(h?f.offsetHeight:0),right:p.left+(h?f.offsetWidth:0)},v=Ie(t),y=t.style.display,g=t.style.opacity;"none"===Ce(t,"display")&&(t.style.opacity="0",t.style.display="block");var b=!v;let w=t.offsetParent||document.body,C=!w||Ee.includes(w.nodeName),S={top:0,left:0},T=w.getBoundingClientRect(),x={left:0,top:0};C||(S=be(w),x.top=w.scrollTop,x.left=w.scrollLeft);let I=Ee.includes(w.nodeName),z=xe(),M={vertical:!1,horizontal:!1};I&&(M={vertical:"hidden"!=Ce(document.body,"overflow-y"),horizontal:"hidden"!=Ce(document.body,"overflow-x")});let P=Pe(),V=ge(),B={width:V.pc?window.innerWidth:Math.min(document.documentElement.clientWidth,window.innerWidth),height:V.pc?window.innerHeight:Math.min(document.documentElement.clientHeight,window.innerHeight)};var E=t.getBoundingClientRect(),k=Te(Ce(t,"transform"));E.width=Math.round(E.width/Math.abs(k.scaleX)),E.height=Math.round(E.height/Math.abs(k.scaleY));var O=(null==l?void 0:l.top)||0,L=(null==l?void 0:l.left)||0,N=null,H=[],A=function(e,n){var o=c,a=d;e&&(a-=E.width),n&&(o-=E.height/2);var l=null;v||(o+=u.top,a+=u.left),h&&I&&(o>=m.bottom||o+E.height>=m.bottom?o=m.bottom-E.height:o<m.top&&(o=m.top),e&&a+E.width>m.right||!e&&a>m.right?a=m.right-E.width:a<m.left&&(a=m.left)),o+=O,a+=L,I||(o+=x.top,a+=x.left);var i=ke({ele:t,top:o,left:a,needSubtractScrollOffset:b,bodyScrollVisible:M,targetIsInBody:I,referenceIsInFixedPosition:!1,documentHasScroll:z,documentScrollInfo:u,scrollParent:h?f:w,windowWH:fe({},B),targetIsInFixedPosition:v});let r=o,s=a;return v?(r-=T.top,s-=T.left):(r-=S.top,s-=S.left),I?(l=B.width-a,z.vertical&&M.vertical&&(l-=P.vertical),z.horizontal&&!M.horizontal&&(l-=u.left)):l=w.clientWidth-s,null!==l&&e&&(l-=E.width),r-=O,s-=L,he(fe({},i),{direction:!e&&n?"bottomCenter":e?"bottomEnd":"bottom",top:r,left:s,bottom:null,right:e?l:null})};let W=function(e,n){var o=c-E.height,a=d;e&&(a-=E.width),n&&(o+=E.height/2),v||(o+=u.top,a+=u.left),h&&I&&(o+E.height>m.bottom?o=m.bottom-E.height:o<m.top&&(o=m.top),e&&a+E.width>m.right||!e&&a>m.right?a=m.right-E.width:a<m.left&&(a=m.left)),o+=O,a+=L,I||v||(o+=x.top,a+=x.left);var l=ke({ele:t,top:o,left:a,needSubtractScrollOffset:b,bodyScrollVisible:M,targetIsInBody:I,referenceIsInFixedPosition:!1,documentHasScroll:z,documentScrollInfo:u,scrollParent:h?f:w,windowWH:fe({},B),targetIsInFixedPosition:v}),i=null,r=null;let s=o,p=a;return v?(s-=T.top,p-=T.left):(s-=S.top,p-=S.left),I?(i=B.height-o-E.height,r=B.width-a,z.vertical&&M.vertical&&(r-=P.vertical),z.horizontal&&!M.horizontal&&(r-=u.left),z.horizontal&&M.horizontal&&(i-=P.horizontal),z.vertical&&!M.vertical&&(i-=u.top)):(i=w.clientHeight-s-E.height,r=w.clientWidth-p),null!==r&&e&&(r-=E.width),s-=O,p-=L,he(fe({},l),{direction:!e&&n?"topCenter":e?"topEnd":"top",bottom:i,right:e?r:null,top:s,left:p})};switch(n){case"bottom":s&&H.push({isTail:!1,isCenter:!0,handler:A}),H.push({isTail:r,handler:A}),!s&&o&&H.push({isTail:!1,isCenter:!0,handler:A}),s&&H.push({isTail:!1,isCenter:!0,handler:W}),H.push({isTail:r,handler:W}),!s&&o&&H.push({isTail:!1,isCenter:!0,handler:W});break;case"top":s&&H.push({isTail:!1,isCenter:!0,handler:W}),H.push({isTail:r,handler:W}),!s&&o&&H.push({isTail:!1,isCenter:!0,handler:W}),s&&H.push({isTail:!1,isCenter:!0,handler:A}),H.push({isTail:r,handler:A}),!s&&o&&H.push({isTail:!1,isCenter:!0,handler:A})}let F=[],j={},R=function(e=!1,t){let n=t.handler(a?!t.isTail:t.isTail,t.isCenter),o=n.vertical&&n.horizontal,l=n.scrollParentVertical&&n.scrollParentHorizontal,r=e?o&&l:o||l;return n.direction===i&&(j=n),F.push(n),!!r&&(N=n,!0)};if(H.some((function(e){let t=e.handler(e.isTail,e.isCenter),n=t.vertical&&t.horizontal,o=t.scrollParentVertical&&t.scrollParentHorizontal;return t.direction===i&&(j=t),F.push(t),n?o?(N=t,!0):e.isCenter?void 0:!!R(!0,e):e.isCenter?void 0:R(!0,e)})),!N){let e=null,t=null;F.forEach((n=>{!e&&n.horizontal&&n.vertical&&(e=n),!t&&n.scrollParentHorizontal&&n.scrollParentVertical&&(t=n)})),t?N=t:e?N=e:(N=j).isRollback=!0}return t.style.opacity=g||"",t.style.display=y||"",N}let Ne={document:{},window:{}};const He=function(e,t,n){if(!e||"document"!=e&&"window"!=e)throw new Error("target只支持document、window");if(!t)throw new Error("缺少事件名称");if(!n)throw new Error("缺少事件函数");let o=Ne[e][t],a="document"===e?document:window;o||(o=Ne[e][t]=[],a.addEventListener(t,(function(e){let t=[];o.slice(0).forEach((n=>{try{n.call(this,e)}catch(e){t.push(e)}})),t.length>0&&t.forEach((e=>{setTimeout((function(){throw e}),0)}))}),!1)),o.includes(n)||o.push(n)},Ae=function(e,t,n){let o=Ne[e][t];if(!o)return;let a=o.indexOf(n);a>-1&&o.splice(a,1)},We={referenceRef:{type:Object,default:()=>({})},virtualMouseEvent:{type:Object,default:()=>({})},placement:{type:String,default:"bottom"},willVisible:{type:Boolean,default:!1},useZoomTransition:{type:Boolean,default:!1},tryAllPlacement:{type:Boolean,default:!0},tryEndPlacement:{type:Boolean,default:!0},position:{type:String,default:"absolute"},setWidth:{type:Boolean,default:!1},setMinWidth:{type:Boolean,default:!1},customTransitionName:{type:Function,default:null},customStyle:{type:Function,default:null},offset:{type:Object,default:null},contextMenu:{type:Boolean,default:!1}},Fe=["HTML","BODY"],je={top:"0 100%",topEnd:"100% 100%",topCenter:"0 50%",bottom:"0 0",bottomEnd:"100% 0",bottomCenter:"0 50%",left:"100% 0",leftEnd:"100% 100%",leftCenter:"right center",right:"0 0",rightEnd:"0 100%",rightCenter:"0 center"},Re="easyest-zoom",De="easyest-slide-up",Ue="easyest-slide-down",$e=["top","topCenter","topEnd"],Ge=["bottom","bottomCenter","bottomEnd"],_e=w({name:"EasyestDropdownTransition",props:We,emits:["before-enter","enter","after-enter","before-leave","leave","after-leave","position-change"],setup(a,l){let i,r=e({direction:"bottom",width:0,left:0,top:0,bottom:null,right:null,horizontalFullInview:!1,verticalFullInview:!1}),s=null,u=t(!1),d=t(null),c=t({}),f=function(){let e,{referenceRef:t,contextMenu:n,virtualMouseEvent:o}=a,i=null,u=null;if(!s)return;if(n)e=Le(o,s,a.placement,a.tryAllPlacement,a.tryEndPlacement,a.offset);else{if(t.nodeName?i=t:ae(t)&&t.$el&&(i=t.$el),!i)return;u=i.getBoundingClientRect(),e=Oe(i,s,a.placement,a.tryAllPlacement,a.tryEndPlacement,a.offset)}let d=e.bottom,f=e.right,v=e.direction;if(p(e),h.value==Re){let e=je[v];m.value={"transform-origin":e,"-ms-transform-origin":e,"-webkit-transform-origin":e}}else m.value={};let y=a.customStyle;if(pe(y)){let t=y(e);t&&ae(t)?c.value=t:c.value={}}r.horizontalFullInview=e.horizontal,r.verticalFullInview=e.vertical,r.direction=v,n||(r.width=u.width),r.top=e.top,r.left=e.left,r.bottom=null===d?null:e.bottom,r.right=null===f?null:e.right,l.emit("position-change",fe({},r))},h=t(""),p=function(e){let t=e.direction,n=a.customTransitionName;a.useZoomTransition?h.value=Re:pe(n)?h.value=n(e):$e.includes(t)?h.value=De:Ge.includes(t)?h.value=Ue:h.value=Re},m=t({});o((()=>a.willVisible),(function(e){if(a.useZoomTransition)return void(h.value=Re);if(!e)return;let t,{referenceRef:n,virtualMouseEvent:o,contextMenu:l}=a,i=null;if(l)t=Le(o,d.value,a.placement,a.tryAllPlacement);else{if(!n)return;n.nodeName?i=n:ae(n)&&n.$el&&(i=n.$el),t=Oe(i,d.value,a.placement,a.tryAllPlacement)}p(t)})),o((()=>a.virtualMouseEvent),(function(){!a.contextMenu||!u.value||f()}),{deep:!0});let v=0,y="orientationchange"in window?"orientationchange":"resize",g=function(){if(!u.value)return;let e=(new Date).getTime();(0==v||e-v>=10)&&(f(),v=e)},b=0,w=function(e){if(!u.value||!s)return;let t=(new Date).getTime();if(0==b||t-b>=10){if("fixed"==Ce(s,"position"))return;let n=e.currentTarget;n===window||n===document?ze():n.scrollTop,f(),b=t}},S=n((function(){let e=r.direction;return a.contextMenu?`easyest-contextmenu-placement-${ye(e)}`:`easyest-placement-${ye(e)}`}));return C((function(){Ae("window",y,g),Ae("window","scroll",w),s=null,i=void 0})),{dropdownStyle:r,transitionName:h,transitionOrigin:m,targetRef:d,styleCustom:c,isVisible:u,dynamicClassname:S,onEnter:function(e,t){let{referenceRef:n,virtualMouseEvent:o,contextMenu:r}=a,d=null;if(!((r||n&&(n.nodeName?d=n:ae(n)&&n.$el&&(d=n.$el),d))&&e))return;u.value=!0,s=e,f();let c=function(){t(),e.removeEventListener("transitionend",c,!1),e.removeEventListener("transitioncancel",c,!1)};if(e.addEventListener("transitionend",c,!1),e.addEventListener("transitioncancel",c,!1),l.emit("enter",e,oe),!r){i=Se(d);let e=(null==i?void 0:i.nodeName)||"";i&&!Fe.includes(e)&&i.addEventListener("scroll",w,!1)}He("window","scroll",w),He("window",y,g)},onLeave:function(e){u.value=!1;let t=(null==i?void 0:i.nodeName)||"";i&&!Fe.includes(t)&&i.removeEventListener("scroll",w,!1),Ae("window","scroll",w),Ae("window",y,g),i=void 0,l.emit("after-leave",e)},refresh:f,camelCase2KebabCase:ye}}});const Ke=((e,t)=>{const n=e.__vccOpts||e;for(const[e,o]of t)n[e]=o;return n})(_e,[["render",function(e,t,n,o,a,l){return r(),S(T,{ref:"targetRef",name:e.transitionName,onBeforeEnter:t[0]||(t[0]=t=>e.$emit("before-enter",t)),onEnter:e.onEnter,onAfterEnter:t[1]||(t[1]=t=>e.$emit("after-enter",t)),onBeforeLeave:t[2]||(t[2]=t=>e.$emit("before-leave",t)),onLeave:t[3]||(t[3]=t=>e.$emit("leave",t)),onAfterLeave:e.onLeave,class:h(["easyest-dropdown-transition",[e.dynamicClassname,{"use-bottom-position":null!=e.dropdownStyle.bottom,"use-right-position":null!=e.dropdownStyle.right}]]),style:u(fe(he(fe(fe(fe({position:e.position},e.setWidth&&!e.contextMenu?{width:e.dropdownStyle.width+"px"}:{}),e.setMinWidth&&!e.contextMenu?{minWidth:e.dropdownStyle.width+"px"}:{}),e.transitionOrigin),{left:null==e.dropdownStyle.right?e.dropdownStyle.left+"px":"auto",right:null!=e.dropdownStyle.right?e.dropdownStyle.right+"px":"",top:null==e.dropdownStyle.bottom?e.dropdownStyle.top+"px":"auto",bottom:null!=e.dropdownStyle.bottom?e.dropdownStyle.bottom+"px":""}),e.styleCustom)),"data-horizontal-fullinview":e.isVisible?e.dropdownStyle.horizontalFullInview:null,"data-vertical-fullinview":e.isVisible?e.dropdownStyle.verticalFullInview:null},{default:m((()=>[x(e.$slots,"default")])),_:3},8,["name","onEnter","onAfterLeave","class","style","data-horizontal-fullinview","data-vertical-fullinview"])}]]);Ke.install=function(e){return e.component(Ke.name,Ke),e};var qe={name:"SchemaInput",components:{"country-list":J,EasyestDropdownTransition:Ke,SlotRender:U},inheritAttrs:!1,props:O(O({},D),{},{placeholder:{type:String,default:"请选择国家"},showLabelImg:{type:Boolean,default:!0},onlyValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},iosMobileReadonly:{type:Boolean,default:!0},static:{type:Boolean,default:!1},transitionName:{type:String},rootSlots:{type:Object,default:function(){return{}}},appendToBody:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1}}),emits:[$,_],setup:function(l,i){var r=e({item:{}}),s=t(null),u=t(null),d=n((function(){var e=r.item,t=l.useChinese?e.nameCN:e.name,n="+"==(l.modelValue+"").charAt(0)?l.modelValue.substr(1):l.modelValue;if("phone"===l.type.toLowerCase()){var o=e.dialCode;return l.onlyValue?1==o&&e.areaCodes?"+"+(n||e.areaCodes[0]):"+"+e.dialCode:l.showAreaCode?1==o&&e.areaCodes?"".concat(e.name,"(+").concat(n||e.areaCodes[0],")"):t+"(+"+e.dialCode+")":t}return l.onlyValue?e.iso2:t})),c=t(""),f=t(!1),h=t(!0),p=t(!1),m=t(window.innerWidth),v=t(null),y=t(null),g=t(!1),b=t(!1),w=t(!1),C=n((function(){return l.static||b.value})),S=function(e){e.iso2,r.item.iso2,e.iso2!==r.item.iso2&&(r.item=e,i.emit("onChange",e))},T=function(e){i.emit("update:modelValue",e)};o((function(){return l.modelValue}),(function(e){g.value||(r.item=q(l.modelValue,l.type,l.iso2,R))}),{immediate:!0});return a((function(){l.static&&(g.value=!0)})),{searchText:c,countryListDisplay:g,countryListVisible:C,inputFocused:f,listOnBottom:h,isIos:p,deviceWidth:m,inputWrap:s,countryList:u,viewText:d,selected:r,searchInput:v,vueCountryIntlWrapper:y,countryListWillShow:w,onCountryChange:S,onModelValue:T,hide:function(){if(C.value&&!l.disabled&&!l.readonly)var e=setTimeout((function(){clearTimeout(e),c.value="",f.value=!1,w.value=!1,b.value=!1}),100)},show:function(){if(!l.disabled&&!l.readonly){if(l.static)return f.value=!0,void(c.value="");var e=function(){w.value=!0;var e=setTimeout((function(){if(clearTimeout(e),f.value=!0,b.value=!0,c.value="",!l.readonly)var t=setTimeout((function(){clearTimeout(t),v.value.focus()}),0)}),60)};if(g.value)e();else{g.value=!0;var t=setTimeout((function(){clearTimeout(t),e()}),0)}}},clear:function(){l.clearable&&!l.disabled&&(S({}),T(""))},getCountryInfo:function(e){var t=q(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"phone",arguments.length>2?arguments[2]:void 0,R);return t.iso2?O({},t):null},onPositionChange:function(e){h.value="bottom"==e.direction}}}},Ze=["name","aria-readonly","aria-disabled","placeholder","readonly"],Ye={class:"country-intl-label"},Xe={class:"country-intl-label-text"},Je=d("label",{class:"dropdown-flag"},null,-1),Qe=d("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",ariaHidden:"true",focusable:"false"},[d("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),d("path",{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"})],-1),et=d("div",{class:"prevent-click"},null,-1);qe.render=function(e,t,n,o,a,l){var u=i("SlotRender"),c=i("country-list");return r(),s("div",{class:h(["vue-country-intl-inputer",{"is-focused":e.inputFocused,"dropdown-list-on-bottom":e.listOnBottom,"dropdown-list-on-top":!e.listOnBottom,"vue-country-disabled":e.disabled,"vue-country-readonly":e.readonly,"is-static":e.static}]),ref:"vueCountryIntlWrapper"},[d("div",{ref:"inputWrap",class:h(["country-intl-input-wrap",{"no-data":!e.selected.item.name,"has-selected":e.selected.item.name}]),onClick:t[3]||(t[3]=function(){return e.show&&e.show.apply(e,arguments)})},[y(d("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.searchText=t}),class:"country-intl-input",autocomplete:"off",ref:"searchInput",onBlur:t[1]||(t[1]=function(){return e.hide&&e.hide.apply(e,arguments)}),name:e.name,"aria-readonly":e.readonly,"aria-disabled":e.disabled,placeholder:e.placeholder,readonly:e.isIos&&e.deviceWidth<992&&e.iosMobileReadonly},null,40,Ze),[[I,e.searchText]]),d("label",Ye,[y(d("span",{class:h(["iti-flag",e.selected.item.iso2])},null,2),[[g,e.showLabelImg]]),p(u,{"slot-name":"customInputLabel","out-slots":e.rootSlots,"slot-data":Object.assign({},e.selected.item)},{default:m((function(){return[d("span",Xe,v(e.viewText),1)]})),_:1},8,["out-slots","slot-data"])]),Je,!e.disabled&&e.modelValue&&e.clearable?(r(),s("span",{key:0,class:"clear-button",onClick:t[2]||(t[2]=z((function(){return e.clear&&e.clear.apply(e,arguments)}),["stop"]))},[p(u,{"slot-name":"clear","out-slots":e.rootSlots},{default:m((function(){return[Qe]})),_:1},8,["out-slots"])])):M("v-if",!0),et],2),(r(),S(P,{to:"body",disabled:e.static||!e.appendToBody},[(r(),S(V(e.static?"div":"EasyestDropdownTransition"),{"will-visible":e.countryListWillShow,"reference-ref":e.inputWrap,"try-end-placement":!1,"try-all-placement":!1,"set-width":!0,customTransitionName:e.transitionName?function(){return e.transitionName}:void 0,onPositionChange:e.onPositionChange},{default:m((function(){return[e.countryListDisplay?y((r(),S(c,{key:0,class:"vue-country-intl-inputer-dropdown",ref:"countryList","model-value":e.modelValue,"search-text":e.searchText,selectedText:e.selectedText,"show-selected-text":e.showSelectedText,"show-area-code":e.showAreaCode,"list-z-index":e.listZIndex,type:e.type,iso2:e.iso2,"search-able":e.searchAble,"disable-country":e.disableCountry,"only-country":e.onlyCountry,"no-data-text":e.noDataText,"use-chinese":e.useChinese,"root-slots":e.rootSlots,sort:e.sort,filter:e.filter,transform:e.transform,onOnChange:e.onCountryChange,"onUpdate:modelValue":e.onModelValue},null,8,["model-value","search-text","selectedText","show-selected-text","show-area-code","list-z-index","type","iso2","search-able","disable-country","only-country","no-data-text","use-chinese","root-slots","sort","filter","transform","onOnChange","onUpdate:modelValue"])),[[g,e.countryListVisible]]):M("v-if",!0)]})),_:1},40,["will-visible","reference-ref","customTransitionName","onPositionChange"]))],8,["disabled"]))],2)},qe.__file="src/components/schema-input/SchemaInput.vue";var tt={name:"SchemaPopover",components:{"country-list":J,EasyestDropdownTransition:Ke},inheritAttrs:!1,props:O(O({},D),{},{visible:{type:Boolean,default:!1},showLabelImg:{type:Boolean,default:!0},onlyValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},searchInputPlaceholder:{type:String,default:"输入国家名称、区号搜索"},popoverClass:{type:String,default:""},offset:{type:Array,default:function(){return[0,10]}},rightOffset:{type:Number,default:20},rootSlots:{type:Object,default:function(){return{}}},appendToBody:{type:Boolean,default:!0},transitionName:{type:String,default:"easyest-zoom"}}),emits:[G,$,_],setup:function(n,i){var r,s=e({item:{}}),u=t(""),d=t(!0),c=t(null),f=t(null),h=t(!1),p=t(!1),m=t(!1),v=function(){p.value=!1,h.value=!1,i.emit("update:visible",!1)};o((function(){return n.visible}),(function(e){var t=function(){p.value=!0,r=setTimeout((function(){clearTimeout(r),h.value=!0}),60)};if(e)if(m.value)clearTimeout(r),t();else{m.value=!0,s.item=q(n.modelValue,n.type,n.iso2,R),s.item;var o=setTimeout((function(){clearTimeout(o),clearTimeout(r),t()}),20)}else p.value=!1,h.value=!1}));var y=function(e){var t=(e=e||window.event).target;n.visible&&(K(c.value,t)||K(f.value,t)||v())};return a((function(){document.documentElement.addEventListener("click",y,!1)})),l((function(){document.documentElement.removeEventListener("click",y,!1)})),{selected:s,searchText:u,listOnBottom:d,popoverDisplay:m,popoverContainer:c,popover:f,popoverVisible:h,popoverWillVisible:p,onCountryChange:function(e){if(e.iso2!==s.item.iso2){s.item=e,i.emit("onChange",e);var t=setTimeout((function(){clearTimeout(t),v()}),150)}},onModelValueChange:function(e){i.emit("update:modelValue",e)},hide:v,getCountryInfo:function(e){var t=q(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"phone",arguments.length>2?arguments[2]:void 0,R);return t.iso2?O({},t):null}}}},nt={class:"vue-country-intl-schema-popover",ref:"popoverContainer"},ot={class:"search-input-box"},at=["placeholder"],lt=d("div",{class:"vue-country-intl-popover-arrow"},null,-1);function it(){var e,t,n,o,a=document.body,l=a.style.overflow,i=a.style.paddingRight,r=a.style.paddingBottom,s=a.classList.contains("lock-scroll"),u=X(),d=(n=document.createElement("div"),o={vertical:0,horizontal:0},n.style.cssText="width: 200px;height: 200px",e&&1==e.nodeType?((t=e.cloneNode(!0)).style.cssText="width: 100px;height: 100px;opacity: 0;position:abs