import{q as g,h as f,X as N,r,w as _,v as x,x as R,y as w,E as m,aO as D,A as V,L as k}from"./en-1nw-8IF_.js";import{s as q,p as y}from"./main-BHh7EVqZ.js";const C=g({__name:"chat-rename-dialog",props:{chatName:{}},emits:["select","validate"],setup(d,{emit:u}){const{chatsNameMaxLength:o}=y,{$tr:s}=f(N),c=d,l=u,a=r({oldName:c.chatName,newName:c.chatName}),i=r(!1);function h(e){return!!e||s("validation.text.required")}function p(e){return q(e)<o||s("validation.text.length",{length:o.toString()})}function v(){l("select",a.value)}return l("select",a.value),_(()=>i.value,e=>l("validate",e),{immediate:!0}),(e,t)=>(x(),R("div",{class:V(e.$style.chatRenameDialog)},[w(m(D),{modelValue:a.value.newName,"onUpdate:modelValue":t[0]||(t[0]=n=>a.value.newName=n),rules:[h,p],placeholder:m(s)("chat.rename.dialog.input.placeholder"),onChange:v,"onUpdate:valid":t[1]||(t[1]=n=>i.value=n)},null,8,["modelValue","rules","placeholder"])],2))}}),$="_chatRenameDialog_ovbsh_1",L={chatRenameDialog:$},M={$style:L},E=k(C,[["__cssModules",M]]);export{E as default};
