import{d as e,i as t,l as n,s as r,t as i}from"./hooks.module-BrXTvcfS.js";import{Kt as a,qt as o,zt as s}from"./content_renderer-DOj8g78V.js";import{r as c}from"./bootstrap.esm-DbsKxb7T.js";import{k as l}from"./i18n-BaLR3UdQ.js";import{t as u}from"./jsxRuntime.module-Cao1NCKs.js";import{U as d}from"./hooks-ClTXKdUl.js";e();var f=l();function p({text:e,icon:l,className:p,triggerCommand:m,titlePosition:h,tooltipClass:g,tooltipHtml:_,noIconActionClass:v,frame:y,active:b,disabled:x,...S}){let C=i(null),[w,T]=r(),E=w?.length?`${e} (${w.map(e=>o(a(e))).join(`, `)})`:e,D=i(E);D.current=E;let O=!!E&&E.length>0;return d(C,t(()=>({title:O?()=>D.current??``:void 0,placement:h??`bottom`,fallbackPlacements:[h??`bottom`],customClass:g??``,html:_??!1,trigger:f?`focus`:`hover focus`,animation:!1}),[h,g,_,O])),n(()=>{C.current&&c.getInstance(C.current)?.setContent({".tooltip-inner":E??``})},[E]),n(()=>{m&&s.getAction(m,!0).then(e=>T(e?.effectiveShortcuts))},[m]),u(`button`,{ref:C,type:`button`,class:`${p??``} ${v?`btn`:`icon-action`} ${l} ${y?`btn btn-primary`:``} ${x?`disabled`:``} ${b?`active`:``}`,"data-trigger-command":m,disabled:x,...S})}export{p as t};