'use client';
"use strict";var e=require("tslib"),t=require("react"),l=require("tailwind-merge");require("../../../contexts/BaseColorContext.cjs");var o=require("../../../contexts/HoveredValueContext.cjs");require("../../../contexts/RootStylesContext.cjs");var r=require("../../../contexts/SelectedValueContext.cjs"),a=require("../../../lib/constants.cjs"),s=require("../../../lib/colorClassNames.cjs"),c=require("../../../lib/shape.cjs"),n=require("../../../lib/spacing.cjs"),i=require("../../../lib/font.cjs"),u=require("../../../lib/theme.cjs"),C=require("../../../lib/utils.cjs");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=g(t);const d=C.makeClassName("MultiSelectBoxItem"),x=m.default.forwardRef(((g,x)=>{const{value:f,text:O,className:b,onClick:L}=g,N=e.__rest(g,["value","text","className","onClick"]),{selectedValue:p,handleValueChange:h}=t.useContext(r),{hoveredValue:R}=t.useContext(o),j=C.isValueInArray(f,p),k=R===f,q=j?C.getColorClassNames(u.DEFAULT_COLOR,u.colorPalette.lightBackground).bgColor:k?C.getColorClassNames(u.DEFAULT_COLOR,u.colorPalette.canvasBackground).bgColor:C.getColorClassNames(u.DEFAULT_COLOR,u.colorPalette.canvasBackground).hoverBgColor,v=j?C.getColorClassNames(u.DEFAULT_COLOR,u.colorPalette.darkestText).textColor:C.getColorClassNames(u.DEFAULT_COLOR,u.colorPalette.darkText).textColor;return m.default.createElement("button",Object.assign({ref:x,type:"button",onClick:e=>{null==h||h(f),null==L||L(e)},className:l.twMerge(d("root"),"flex items-center justify-start w-full",n.spacing.twoXl.paddingX,n.spacing.md.paddingY,i.fontSize.sm,C.getColorClassNames(u.DEFAULT_COLOR,u.colorPalette.lightBackground).hoverBgColor,C.getColorClassNames(u.DEFAULT_COLOR,u.colorPalette.darkText).textColor,q,v,b)},N),m.default.createElement("input",{type:"checkbox",className:l.twMerge(d("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer",C.getColorClassNames(u.DEFAULT_COLOR,u.colorPalette.lightRing).focusRingColor,s.colorClassNames[a.BaseColors.Blue][u.colorPalette.text].textColor,C.getColorClassNames(u.DEFAULT_COLOR,u.colorPalette.ring).borderColor,n.spacing.lg.marginRight,c.borderRadius.sm.all,c.border.sm.all),checked:j,readOnly:!0}),m.default.createElement("p",{className:l.twMerge(d("text"),"text-sm whitespace-nowrap truncate")},null!=O?O:f))}));x.displayName="MultiSelectBoxItem",module.exports=x;
