"use strict";const $=require("./tslib.es6-C4EgNkz1.js"),r=require("react"),q=require("classnames"),N=require("./icon-I30uh1Ov.js"),D=require("./badge-BWhBKWCu.js"),R=require("./forwardRef-DBQKIlPy.js");require("./array.polyfill.flat-5BAolFdk.js");const h=s=>{var{href:t,icon:a,badgeNumber:o,badgeAriaLabel:u,transparent:m,className:f,forwardedRef:c,priority:p="none",size:i,onEscape:E=()=>{},onKeyDown:g=()=>{}}=s,y=$.__rest(s,["href","icon","badgeNumber","badgeAriaLabel","transparent","className","forwardedRef","priority","size","onEscape","onKeyDown"]);const e=t?"icon-link":"icon-btn",w={primary:`${e}--primary`,secondary:`${e}--secondary`,tertiary:`${e}--tertiary`,none:""},b=q(f,e,i&&`${e}--${i}`,{[`${e}--badged`]:o,[`${e}--transparent`]:m},w[p]),l=r.createElement(r.Fragment,null,typeof a=="string"?r.createElement(N.EbayIcon,{name:a}):a,o&&r.createElement(D.EbayBadge,{type:"icon",number:o,"aria-label":u})),d=n=>{(n.key==="Escape"||n.key==="Esc")&&E(n),g(n)};return t?r.createElement("a",Object.assign({ref:c,className:b,href:t,onKeyDown:d},y),l):r.createElement("button",Object.assign({ref:c,type:"button",className:b,onKeyDown:d},y),l)},k=R.withForwardRef(h);exports.EbayIconButton=k;
