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