import{z as g,v as f,X as N,a1 as r,w as _,B as D,C as R,D as w,K as m,aO as x,G as C,Q as V}from"./en-BDDSqdif.js";import{s as k,t as $}from"./main-CsST54g-.js";const q=g({__name:"chat-rename-dialog",props:{chatName:{}},emits:["select","validate"],setup(d,{emit:u}){const{chatsNameMaxLength:o}=$,{$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 k(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)=>(D(),R("div",{class:C(e.$style.chatRenameDialog)},[w(m(x),{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))}}),y="_chatRenameDialog_ovbsh_1",z={chatRenameDialog:y},B={$style:z},U=V(q,[["__cssModules",B]]);export{U as default};
