Loading
function(e,t,n){"use strict";n.d(t,{D:()=>l});var i=n(627968),r=n(64700),s=n(531142),a=n(187322),o=n(650583);class l extends r.Component{ref;static contextType=s.g;static defaultProps={tag:"div",role:"button",tabIndex:0};handleKeyPress=e=>{let{onClick:t,href:n,onKeyPress:i,ignoreKeyPress:r}=this.props;e.repeat||(r||null==t||null==this.ref||e.key!==o.dh.SPACE&&e.key!==o.dh.ENTER||(null==n&&e.preventDefault(),null==this.ref.click?t(e):this.ref.click()),null!=i&&i(e))};setRef=e=>{this.ref=e;let{innerRef:t}=this.props;null!=t&&("function"==typeof t?t(e):t.hasOwnProperty("current")&&(t.current=e))};renderNonInteractive(){let{tag:e,focusProps:t,innerRef:n,onClick:i,role:s,tabIndex:a,ignoreKeyPress:o,...l}=this.props;return r.createElement(e,{ref:this.setRef,...l})}renderInner(){let{tag:e,onClick:t,className:n,children:i,focusProps:s,innerRef:a,ignoreKeyPress:o,...l}=this.props;return null==t?r.createElement(e,{ref:this.setRef,className:n,...l},i):r.createElement(e,{onClick:t,ref:this.setRef,onKeyPress:this.handleKeyPress,className:n,...l},i)}render(){return this.context?this.renderNonInteractive():(0,i.jsx)(a.vN,{...this.props.focusProps,children:this.renderInner()})}}}