import{G as f,H as Y,d as w,R as L,J,K as Q,L as q,M as Z,e as C,f as E,N as x,O as ee,P as ae,D as re,Q as c,S as le,T as y,U as G,o as V,h as D,i as _,V as oe,y as t,W as ne,X as p,m,Y as se,k as H,w as ie,j as de,A as ce}from"./index-0f460360.js";var te={modelValue:{type:[String,Number,Boolean,Object,Array],default:!1},checkedValue:{type:[String,Number,Boolean,Object,Array],default:!0},uncheckedValue:{type:[String,Number,Boolean,Object,Array],default:!1},checkedColor:{type:String},uncheckedColor:{type:String},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},iconSize:{type:[String,Number]},ripple:{type:Boolean,default:!0},validateTrigger:{type:Array,default:["onChange"]},rules:{type:Array},onClick:f(),onChange:f(),"onUpdate:modelValue":f()},ue=Symbol("CHECKBOX_GROUP_BIND_CHECKBOX_KEY");function ve(){var{bindParent:e,parentProvider:l,index:o}=Y(ue);return{index:o,checkboxGroup:l,bindCheckboxGroup:e}}var{n:he,classes:me}=le("checkbox");function ke(e,l){var o=y("var-icon"),u=y("var-hover-overlay"),s=y("var-form-details"),a=G("hover"),v=G("ripple");return V(),D("div",{class:t(e.n("wrap")),onClick:l[0]||(l[0]=function(){return e.handleClick&&e.handleClick(...arguments)})},[_("div",{class:t(e.n())},[oe((V(),D("div",{class:t(e.classes(e.n("action"),[e.checked,e.n("--checked"),e.n("--unchecked")],[e.errorMessage||e.checkboxGroupErrorMessage,e.n("--error")],[e.formDisabled||e.disabled,e.n("--disabled")])),style:ne({color:e.checked?e.checkedColor:e.uncheckedColor})},[e.checked?p(e.$slots,"checked-icon",{key:0},()=>[m(o,{class:t(e.classes(e.n("icon"),[e.withAnimation,e.n("--with-animation")])),name:"checkbox-marked",size:e.iconSize,"var-checkbox-cover":""},null,8,["class","size"])]):p(e.$slots,"unchecked-icon",{key:1},()=>[m(o,{class:t(e.classes(e.n("icon"),[e.withAnimation,e.n("--with-animation")])),name:"checkbox-blank-outline",size:e.iconSize,"var-checkbox-cover":""},null,8,["class","size"])]),m(u,{hovering:!e.disabled&&!e.formDisabled&&e.hovering},null,8,["hovering"])],6)),[[a,e.handleHovering,"desktop"],[v,{disabled:e.formReadonly||e.readonly||e.formDisabled||e.disabled||!e.ripple}]]),_("div",{class:t(e.classes(e.n("text"),[e.errorMessage||e.checkboxGroupErrorMessage,e.n("--error")],[e.formDisabled||e.disabled,e.n("--disabled")]))},[p(e.$slots,"default")],2)],2),m(s,{"error-message":e.errorMessage},null,8,["error-message"])],2)}var A=w({name:"VarCheckbox",directives:{Ripple:L,Hover:J},components:{VarIcon:Q,VarFormDetails:q,VarHoverOverlay:Z},props:te,setup(e){var l=C(!1),o=E(()=>l.value===e.checkedValue),u=E(()=>e.checkedValue),s=C(!1),{checkboxGroup:a,bindCheckboxGroup:v}=ve(),{hovering:g,handleHovering:z}=x(),{form:d,bindForm:M}=ee(),{errorMessage:P,validateWithTrigger:U,validate:K,resetValidation:b}=ae(),R=r=>{se(()=>{var{validateTrigger:n,rules:i,modelValue:h}=e;U(n,r,i,h)})},B=r=>{l.value=r;var{checkedValue:n,onChange:i}=e;c(e["onUpdate:modelValue"],l.value),c(i,l.value),R("onChange"),r===n?a==null||a.onChecked(n):a==null||a.onUnchecked(n)},T=r=>{var{disabled:n,readonly:i,checkedValue:h,uncheckedValue:$,onClick:j}=e;if(!(d!=null&&d.disabled.value||n)&&(c(j,r),!(d!=null&&d.readonly.value||i))){s.value=!0;var W=a?a.checkedCount.value>=Number(a.max.value):!1;!o.value&&W||B(o.value?$:h)}},F=r=>{var{checkedValue:n,uncheckedValue:i}=e;l.value=r.includes(n)?n:i},I=()=>{s.value=!1},S=()=>{c(e["onUpdate:modelValue"],e.uncheckedValue),b()},X=r=>{var{checkedValue:n,uncheckedValue:i}=e,h=![n,i].includes(r);h&&(r=o.value?i:n),B(r)},O=()=>K(e.rules,e.modelValue);re(()=>e.modelValue,r=>{l.value=r},{immediate:!0});var N={checkedValue:u,checked:o,sync:F,validate:O,resetValidation:b,reset:S,resetWithAnimation:I};return c(v,N),c(M,N),{withAnimation:s,checked:o,errorMessage:P,checkboxGroupErrorMessage:a==null?void 0:a.errorMessage,formDisabled:d==null?void 0:d.disabled,formReadonly:d==null?void 0:d.readonly,hovering:g,handleHovering:z,n:he,classes:me,handleClick:T,toggle:X,reset:S,validate:O,resetValidation:b}}});A.render=ke;const k=A;k.install=function(e){e.component(k.name,k)};var ge=k;const be={class:"message-delete-dialog"},fe={class:"message-delete-dialog__text"},ye=w({__name:"message-delete-dialog",emits:["select"],setup(e,{emit:l}){const o=C(!1),u=s=>l("select",s);return(s,a)=>{const v=ge;return V(),D("div",be,[_("div",fe,H(s.$tr("chat.message.delete.dialog.text")),1),m(v,{modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=g=>o.value=g),class:"message-delete-dialog__checkbox",onChange:u},{default:ie(()=>[de(H(s.$tr("chat.message.delete.dialog.additional")),1)]),_:1},8,["modelValue"])])}}});const Ce=ce(ye,[["__scopeId","data-v-1f59ee33"]]);export{Ce as default};
