import{o as e}from"./rolldown-runtime.C0FnF6B9.js";import{r as t}from"./emotion-is-prop-valid.esm.CuYlOKOk.js";import{i as n}from"./emotion-styled.browser.esm.Dj5rZcu_.js";import{i as r}from"./Tooltip.bbzhtE2V.js";import{n as i,t as a}from"./styled-components.CMq9oZJa.js";import{t as o}from"./BaseButton.DiyA9nY7.js";import{G as s,J as c,K as l,q as u}from"./index.ByR4Z2EF.js";import{t as d}from"./iconPosition.BjGBOrz5.js";var f=e(t(),1);function p(e){let{disabled:t,element:p,widgetMgr:m,fragmentId:h}=e,g=p.shortcut?p.shortcut:void 0,_=s(p.wrap),v=!_&&!p.help,y=a.SECONDARY;p.type===`primary`?y=a.PRIMARY:p.type===`tertiary`&&(y=a.TERTIARY);let b=(0,f.useCallback)(()=>{t||m.setTriggerValue(p.id,{formId:p.formId,fragmentId:h,fromUser:!0})},[t,m,p,h]);return u({shortcut:g,disabled:t,onActivate:b}),n(r,{className:`stButton`,"data-testid":`stButton`,children:n(c,{help:p.help,containerWidth:!0,children:n(o,{kind:y,size:i.SMALL,disabled:t,containerWidth:!0,onClick:b,children:n(l,{icon:p.icon,iconPosition:d(p.iconPosition),label:p.label,shortcut:g,wrap:_,addTitleTooltip:v})})})})}var m=(0,f.memo)(p);export{m as default};