import{a as F,z as O,r as P,D as R,C as _,_ as S,bY as I,L as B,M as b,j as u,N as g,y as E}from"./index.0d073eaa.js";import{V as G}from"./Checkbox.476f6e92.js";var N=globalThis&&globalThis.__rest||function(t,e){var d={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(d[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(d[r[n]]=t[r[n]]);return d},U=function(){return{prefixCls:String,checked:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},isGroup:{type:Boolean,default:void 0},value:E.any,name:String,id:String,autofocus:{type:Boolean,default:void 0},onChange:Function,onFocus:Function,onBlur:Function,onClick:Function,"onUpdate:checked":Function,"onUpdate:value":Function}},A=F({name:"ARadio",props:U(),setup:function(e,d){var r=d.emit,n=d.expose,f=d.slots,h=O(),s=P(),c=R("radioGroupContext",void 0),w=_("radio",e),p=w.prefixCls,x=w.direction,v=function(){s.value.focus()},k=function(){s.value.blur()};n({focus:v,blur:k});var m=function(a){var l=a.target.checked;r("update:checked",l),r("update:value",l),r("change",a),h.onFieldChange()},y=function(a){r("change",a),c&&c.onRadioChange&&c.onRadioChange(a)};return function(){var o,a=c;e.prefixCls;var l=e.id,C=l===void 0?h.id.value:l,z=N(e,["prefixCls","id"]),i=S({prefixCls:p.value,id:C},I(z,["onUpdate:checked","onUpdate:value"]));a?(i.name=a.props.name,i.onChange=y,i.checked=e.value===a.stateValue.value,i.disabled=e.disabled||a.props.disabled):i.onChange=m;var j=B((o={},b(o,"".concat(p.value,"-wrapper"),!0),b(o,"".concat(p.value,"-wrapper-checked"),i.checked),b(o,"".concat(p.value,"-wrapper-disabled"),i.disabled),b(o,"".concat(p.value,"-wrapper-rtl"),x.value==="rtl"),o));return u("label",{class:j},[u(G,g(g({},i),{},{type:"radio",ref:s}),null),f.default&&u("span",null,[f.default()])])}}});export{A as R,U as r};
