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