import{kt as e,yt as t}from"./StreamlitMarkdown.CwaSe4JX.js";import{n}from"./useFocusRing.zFrRvmtr.js";import{t as r}from"./usePress.BxFb7OC7.js";function i(i,a){let{elementType:o=`button`,isDisabled:s,onPress:c,onPressStart:l,onPressEnd:u,onPressUp:d,onPressChange:f,preventFocusOnPress:p,allowFocusWhenDisabled:m,onClick:h,href:g,target:_,rel:v,type:y=`button`}=i,b;b=o===`button`?{type:y,disabled:s,form:i.form,formAction:i.formAction,formEncType:i.formEncType,formMethod:i.formMethod,formNoValidate:i.formNoValidate,formTarget:i.formTarget,name:i.name,value:i.value}:{role:`button`,href:o===`a`&&!s?g:void 0,target:o===`a`?_:void 0,type:o===`input`?y:void 0,disabled:o===`input`?s:void 0,"aria-disabled":!s||o===`input`?void 0:s,rel:o===`a`?v:void 0};let{pressProps:x,isPressed:S}=r({onPressStart:l,onPressEnd:u,onPressChange:f,onPress:c,onPressUp:d,onClick:h,isDisabled:s,preventFocusOnPress:p,ref:a}),{focusableProps:C}=n(i,a);m&&(C.tabIndex=s?-1:C.tabIndex);let w=e(C,x,t(i,{labelable:!0}));return{isPressed:S,buttonProps:e(b,w,{"aria-haspopup":i[`aria-haspopup`],"aria-expanded":i[`aria-expanded`],"aria-controls":i[`aria-controls`],"aria-pressed":i[`aria-pressed`],"aria-current":i[`aria-current`],"aria-disabled":i[`aria-disabled`]})}}export{i as t};