import{J as n,j as r,C as o,L as e,k as a,l,m as t,n as i,o as c,t as u,u as s,f}from"../../vendor.js";import{forwardRef as d,useRef as v,useImperativeHandle as p,useMemo as m}from"react";import{u as h}from"../../hooks.js";import{I as j}from"../Icon/index.js";var k=["className","option","renderIcon","draggable","name","onClick"];function x(n,r){var o=u(n);if(s){var e=s(n);r&&(e=f(e).call(e,(function(r){return c(n,r).enumerable}))),o.push.apply(o,e)}return o}function b(n){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?x(Object(o),!0).forEach((function(r){a(n,r,o[r])})):l?t(n,l(o)):x(Object(o)).forEach((function(r){i(n,r,c(o,r))}))}return n}var g=d((function(a,l){var t,i=a.className,c=a.option,u=a.renderIcon,s=a.draggable,f=a.name,d=a.onClick,x=n(a,k),g=h().oakRef,O=v(),C=v();p(l,(function(){return{isOak:!0,innerRef:O,tooltipRef:C}}),[O.current]);var I=m((function(){return{modifiers:[{name:"preventOverflow",enabled:!0,options:{boundary:null==g?void 0:g.current}}]}}),[]),R=r.exports.jsx("a",b(b({},x),{},{onClick:function(n){var r;null===(r=C.current)||void 0===r||r.close(),null==d||d(n)},ref:O,href:"#",draggable:null!=s&&s,className:o("oak-option",i),children:u?null==u?void 0:u():"function"==typeof(null==c?void 0:c.icon)?null==c||null===(t=c.icon)||void 0===t?void 0:t.call(c):r.exports.jsx(j,{children:null==c?void 0:c.icon})}));return f?r.exports.jsx(e,{container:(null==g?void 0:g.current)||".oak",ref:function(n){var r;C.current=n,O.current=null==n||null===(r=n.innerRef)||void 0===r?void 0:r.current},popperOptions:I,text:f,children:R}):R}));export{g as O};
//# sourceMappingURL=index.js.map
