"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("react"),a=require("react/jsx-runtime"),o=require("@material-ui/lab"),l=require("classnames"),i=require("../Tooltip/Tooltip.js"),n=require("./ToggleButtons.scss.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(e),c=s(t),p=s(l),d=["label","testId","className","tooltip","disabled","value","type"];function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){u.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var m={primary:n.primary,secondary:n.secondary},y={large:n.large,medium:n.medium,small:n.small},j=function(e){var t=e.label,r=e.testId,l=e.className,s=e.tooltip,u=e.disabled,b=e.value,y=e.type,j=c.default(e,d),g=a.jsx(o.ToggleButton,f(f({disabled:u,"data-testid":r,className:p.default(n.button,m[y],l),value:b},j),{},{children:t}));return s?a.jsx(i.Tooltip,{title:s,children:g}):g};exports.ToggleButtons=function(e){var t=e.testId,l=e.className,i=e.options,s=e.size,u=void 0===s?"medium":s,c=e.value,d=e.onChange,b=e.type,m=void 0===b?"primary":b,g=r.useCallback((function(e,t){null!==t&&d&&d(t,e)}),[d]);return a.jsx(o.ToggleButtonGroup,{className:p.default(n.root,y[u],l),"data-testid":t,onChange:g,value:c,exclusive:!0,size:u,children:i.map((function(e){return r.createElement(j,f(f({},e),{},{key:e.value,type:m}))}))})};
//# sourceMappingURL=ToggleButtons.js.map
