1var X=Object.defineProperty;var T=Object.getOwnPropertySymbols;var Y=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable;var j=(a,n,l)=>n in a?X(a,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[n]=l,q=(a,n)=>{for(var l in n||(n={}))Y.call(n,l)&&j(a,l,n[l]);if(T)for(var l of T(n))ee.call(n,l)&&j(a,l,n[l]);return a};import{_ as te}from"./BmDyyt69.js";import{a as ae,L as ne,n as oe,an as h,ao as S,o as se,A as g,al as le,ap as re,_ as ue}from"./-5ZCIy-h.js";import{_ as ce}from"./BrDmgsUl.js";import{_ as ie}from"./mhkG1V6g.js";import{u as de,_ as me,a as pe,v as ve}from"./C4ulIB4A.js";import{A as _e,k,w as fe,af as he,aj as ge,V as C,H as I,Z as m,O as V,b as M,z as u,a2 as N,N as ke,a5 as Ce,U as Ve,ae as xe,a3 as R,a6 as be,ar as ye,W as U,a7 as Pe,_ as y,$ as W,j as p}from"./BLhakNzR.js";const Be={class:"v-phone-select__codes"},we={class:"v-phone-select__codes_list"},Fe=["onClick"],Ie={class:"ml-2 text-t2 text-line-normal"},Me={class:"ml-2 text-t1"},Ne=["placeholder","disabled"],Re=_e({__name:"VPhoneInput",props:{name:{},placeholder:{default:""},bgColorPrompt:{default:void 0},required:{type:Boolean},disabled:{type:Boolean},noPlaceholder:{type:Boolean},rules:{default:()=>[]},hideError:{type:Boolean},hideDetails:{type:Boolean}},setup(a){const n=a,{t:l}=ae(),{locale:P}=ne(),v=k(""),z=p(()=>{const t=[...n.rules];return t.push(e=>{var b;const o=e;if(!v.value||!o||!((b=v.value.match(/[\d]+/))==null?void 0:b[0]))return!0;const d=v.value.replace(/#/g,"0"),f=d.replace(/\D/g,"");return o.length>=f.length||l("invalidPhone",{format:d.replace(/(\?+)/g,F=>`(${F.replace(/\?/g,"0")}?)`)})}),n.required&&t.push(ve.required),t}),{value:c,errorMessage:$}=de(()=>n.name,"",z),A=oe(),r=k((()=>{const t=(()=>{var i,d;const o=(d=(i=A.guess)==null?void 0:i.iso_code)==null?void 0:d.toLocaleLowerCase();return c.value||!o?null:h.find(f=>f.name===o)})();return(c.value?S(c.value):null)||t||h[h.length-1]||h[0]})()),H=t=>{r.value=t,c.value=g(t.code)};fe(r,()=>{v.value=r.value.maska},{immediate:!0,flush:"sync"});const D=p(()=>new le(q({mask:`${v.value}`},re))),Z={postProcess:t=>{const e=g(t);return e.length<=g(r.value.code).length?r.value.code:D.value.masked(e)}},B=p({get:()=>D.value.masked(c.value||r.value.code),set:t=>{const e=g(t);if(e.length<=g(r.value.code).length){c.value="";return}if(r.value.name!=="other"){const o=S(e);o&&(r.value.name==="kaz"&&o.name==="rus"||(r.value=o))}c.value=e}}),x=k(!1),w=k(!1),L=p(()=>x.value||w.value),E=he("input"),G=()=>{var t;(t=E.value)==null||t.focus()},_=k(""),O=p(()=>h.sort((t,e)=>t.name==="other"?1:t.i18n[P.value].localeCompare(e.i18n[P.value]))),J=p(()=>_.value?O.value.filter(t=>{const e=_.value;if(e.includes("+")||Number(e))return t.code.startsWith(e)||t.code.startsWith(`+${e}`);const o=new RegExp(e,"i");return[t.name,...Object.values(t.i18n)].some(i=>i.match(o))}):O.value);return(t,e)=>{const o=te,i=se,d=ce,f=ie,b=me,F=pe,K=ge("maska");return C(),I("div",null,[m("div",{class:R(["v-phone-select",{"v-phone-select__actived":u(L),error:!!u($)}]),onClick:e[5]||(e[5]=()=>G())},[V(f,{modelValue:u(x),"onUpdate:modelValue":e[1]||(e[1]=s=>M(x)?x.value=s:null),disabled:a.disabled,"close-on-content-click":""},{activator:N(({on:s,isActive:Q})=>[m("div",Ve({class:["v-phone-select__code text-t4 d-flex-center pointer",{"no-events":a.disabled}]},xe(s,!0)),[V(o,{code:u(r).name},null,8,["code"]),V(i,{name:"arrow-select",class:R(["rotated-transition",{rotated:Q}])},null,8,["class"])],16)]),default:N(()=>[m("div",Be,[V(d,{modelValue:u(_),"onUpdate:modelValue":e[0]||(e[0]=s=>M(_)?_.value=s:null),type:"search",outlined:"",class:"v-phone-select__codes-search"},null,8,["modelValue"]),m("ul",we,[(C(!0),I(ke,null,Ce(u(J),s=>(C(),I("li",{key:s.name,class:R(["v-phone-select__codes_list_item",{"v-phone-select__codes_list_item-selected":u(r).name===s.name}]),onClick:()=>H(s)},[V(o,{code:s.name},null,8,["code"]),m("span",Ie,y(s.code),1),m("span",Me,y(s.i18n[u(P)]),1)],10,Fe))),128))])])]),_:1},8,["modelValue","disabled"]),be(m("input",{ref_key:"input",ref:E,"onUpdate:modelValue":e[2]||(e[2]=s=>M(B)?B.value=s:null),type:"tel",placeholder:a.placeholder,disabled:a.disabled,class:"v-phone-select__input text-t4",onFocus:e[3]||(e[3]=()=>w.value=!0),onBlur:e[4]||(e[4]=()=>w.value=!1)},null,40,Ne),[[ye,u(B)],[K,Z]]),a.noPlaceholder?W("",!0):(C(),U(b,{key:0,focus:u(L),"bg-color":a.bgColorPrompt},{default:N(()=>[Pe(y(a.placeholder?a.placeholder:u(l)("phone"))+" "+y(a.required?"*":""),1)]),_:1},8,["focus","bg-color"]))],2),a.hideError?W("",!0):(C(),U(F,{key:0,error:u($),"hide-details":a.hideDetails},null,8,["error","hide-details"]))])}}}),qe=Object.assign(ue(Re,[["__scopeId","data-v-f09840c8"]]),{__name:"VPhoneInput"});export{qe as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.