const e=require("../_util/type.js"),t=require("../_util/classNames.js"),n=require("../_util/omit.js"),r=require("../config-provider/DisabledContext.js"),i=require("../config-provider/hooks/useConfigInject.js"),a=require("../_util/vue-types/index.js"),o=require("../form/FormItemContext.js"),s=require("../vc-checkbox/Checkbox.js"),c=require("./context.js"),l=require("./style/index.js");let u=require("vue");var d=()=>({prefixCls:String,checked:e.booleanType(),disabled:e.booleanType(),isGroup:e.booleanType(),value:a.default.any,name:String,id:String,autofocus:e.booleanType(),onChange:e.functionType(),onFocus:e.functionType(),onBlur:e.functionType(),onClick:e.functionType(),"onUpdate:checked":e.functionType(),"onUpdate:value":e.functionType()}),f=(0,u.defineComponent)({compatConfig:{MODE:3},name:`ARadio`,inheritAttrs:!1,props:d(),setup(e,{emit:a,expose:d,slots:f,attrs:p}){let m=o.useInjectFormItemContext(),h=o.FormItemInputContext.useInject(),g=c.useInjectRadioOptionTypeContext(),_=c.useInjectRadioGroupContext(),v=r.useInjectDisabled(),y=(0,u.computed)(()=>C.value??v.value),b=(0,u.ref)(),{prefixCls:x,direction:S,disabled:C}=i.default(`radio`,e),w=(0,u.computed)(()=>_?.optionType.value===`button`||g===`button`?`${x.value}-button`:x.value),T=r.useInjectDisabled(),[E,D]=l.default(x);d({focus:()=>{b.value.focus()},blur:()=>{b.value.blur()}});let O=e=>{let t=e.target.checked;a(`update:checked`,t),a(`update:value`,t),a(`change`,e),m.onFieldChange()},k=e=>{a(`change`,e),_&&_.onChange&&_.onChange(e)};return()=>{let r=_,{prefixCls:i,id:a=m.id.value,...o}=e,c={prefixCls:w.value,id:a,...n.default(o,[`onUpdate:checked`,`onUpdate:value`]),disabled:C.value??T.value};r?(c.name=r.name.value,c.onChange=k,c.checked=e.value===r.value.value,c.disabled=y.value||r.disabled.value):c.onChange=O;let l=t.default({[`${w.value}-wrapper`]:!0,[`${w.value}-wrapper-checked`]:c.checked,[`${w.value}-wrapper-disabled`]:c.disabled,[`${w.value}-wrapper-rtl`]:S.value===`rtl`,[`${w.value}-wrapper-in-form-item`]:h.isFormItemInput},p.class,D.value);return E((0,u.createVNode)(`label`,{...p,class:l},[(0,u.createVNode)(s.default,{...c,type:`radio`,ref:b},null),f.default&&(0,u.createVNode)(`span`,null,[f.default()])]))}}});exports.default=f,exports.radioProps=d;