import{a as g,C as b,b as n,m as c,g as o,p as l,f as q,q as d,M as x,L as k,D as F,u as a,U as S,I as T}from"./convert-case-to-camel-case.utils-DDUpNI96.js";import{a as V,w}from"./widget-BUAABBRb.js";import{u as y}from"./translationsStore-DBJu9sBR.js";import{_ as B}from"./RequiredHint.vue_vue_type_style_index_0_lang-R4Bqx90z.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";const C={class:"ccb-order-field__wrapper"},R={class:"ccb-order-field__label"},D={key:0,class:"ccb-order-required-mark"},N=["placeholder"],$=g({__name:"OrderPhone",props:{field:{}},setup(u){const p=u,{field:t}=b(p);t.value.value===void 0&&(t.value.value="");const{checkFieldRequired:f}=w(),m=y(),v=V(),_=n(()=>{var s,r;return((r=(s=v.getWarningTexts)==null?void 0:s.formFields)==null?void 0:r.phoneField)||m.getTranslations.requiredField}),h=s=>{let e=s.target.value;e=e.replace(/[^0-9+]/g,""),e.includes("+")&&(e.indexOf("+")!==0&&(e=e.replace(/\+/g,"")),(e.match(/\+/g)||[]).length>1&&(e="+"+e.replace(/\+/g,""))),t.value.value=e},i=n(()=>t.value.required?f(t.value):!1);return(s,r)=>(o(),c("div",{class:T(["ccb-order-field ccb-order-phone",{[`ccb-col-${a(t).fieldWidth}`]:!0,"ccb-order-field--required":i.value}])},[l("div",C,[i.value?(o(),q(B,{key:0,text:_.value},null,8,["text"])):d("",!0),l("label",R,[k(F(a(t).label)+" ",1),a(t).required?(o(),c("span",D,"*")):d("",!0)]),x(l("input",{type:"tel",placeholder:a(t).placeholder,"onUpdate:modelValue":r[0]||(r[0]=e=>a(t).value=e),onInput:h,pattern:"[0-9+]*"},null,40,N),[[S,a(t).value]])])],2))}});export{$ as default};
//# sourceMappingURL=OrderPhone-D1loC-8C.js.map
