Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),t=require(`../button/button.cjs`),n=require(`../popover/popover.cjs`);let r=require(`vue`);var i={name:`EditorToolbarPopoverButton`,components:{DtButton:t.default,DtPopover:n.default},props:{isActive:{type:Boolean,default:!1},tooltipMessage:{type:String,required:!0},dataQa:{type:String,default:``},popoverDataQa:{type:String,default:``},tabindex:{type:Number,default:-1},icon:{type:Object,required:!0}},emits:[`shift-focus-right`,`shift-focus-left`],data(){return{pendingCallback:null}},methods:{onPopoverOpened(e){!e&&typeof this.pendingCallback==`function`&&(this.pendingCallback(),this.pendingCallback=null)}}};function a(e,t,n,i,a,o){let s=(0,r.resolveComponent)(`dt-button`),c=(0,r.resolveComponent)(`dt-popover`),l=(0,r.resolveDirective)(`dt-tooltip`);return(0,r.openBlock)(),(0,r.createBlock)(c,{"data-qa":n.popoverDataQa||`${n.dataQa}-popover`,padding:`small`,"navigation-type":`arrow-keys`,placement:`bottom-start`,"open-with-arrow-keys":!0,onOpened:o.onPopoverOpened},{anchor:(0,r.withCtx)(({attrs:i})=>[(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)(s,(0,r.mergeProps)({ref:`buttonRef`},i,{active:n.isActive,"aria-label":n.tooltipMessage,"data-qa":n.dataQa,tabindex:n.tabindex,importance:`clear`,kind:`muted`,size:`xs`,onKeydown:[t[0]||(t[0]=(0,r.withKeys)((0,r.withModifiers)(t=>e.$emit(`shift-focus-right`),[`stop`]),[`right`])),t[1]||(t[1]=(0,r.withKeys)((0,r.withModifiers)(t=>e.$emit(`shift-focus-left`),[`stop`]),[`left`]))]}),{icon:(0,r.withCtx)(()=>[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(n.icon),{size:`200`}))]),_:1},16,[`active`,`aria-label`,`data-qa`,`tabindex`])),[[l,{message:n.tooltipMessage,placement:`top`,externalAnchorElement:e.$refs.buttonRef?.$el}]])]),content:(0,r.withCtx)(({close:t})=>[(0,r.renderSlot)(e.$slots,`content`,{close:e=>{a.pendingCallback=e,t()}})]),_:3},8,[`data-qa`,`onOpened`])}var o=e.t(i,[[`render`,a]]);exports.default=o;
//# sourceMappingURL=EditorToolbarPopoverButton.cjs.map