import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{forwardRef}from"react";import classNames from"classnames";import{Action,Handle,Remove}from"../Item/components";import styles from"./TreeItem.module.scss";export const TreeItem=forwardRef((({childCount:s,clone:e,depth:l,disableSelection:t,disableInteraction:o,ghost:a,handleProps:i,highlighted:c,indentationWidth:n,indicator:r,collapsed:m,onClickName:d,onCollapse:p,onRemove:h,style:x,value:C,wrapperRef:y,...j},f)=>_jsx("li",{className:classNames(styles.Wrapper,e&&styles.clone,a&&styles.ghost,r&&styles.indicator,t&&styles.disableSelection,o&&styles.disableInteraction,c&&styles.highlighted),ref:y,style:{"--spacing":n*l+"px"},...j,children:_jsxs("div",{className:styles.TreeItem,ref:f,style:x,children:[_jsx(Handle,{...i}),p&&_jsx(Action,{onClick:p,className:classNames(styles.Collapse,m&&styles.collapsed),children:collapseIcon}),_jsx("span",{onClick:!c&&d?s=>{d(j?.id??"",s)}:void 0,className:classNames(styles.Text,!c&&d&&styles.TextClickable),children:C}),!e&&h&&_jsx(Remove,{onClick:h}),e&&s&&s>1?_jsx("span",{className:styles.Count,children:s}):null]})})));const collapseIcon=_jsx("svg",{width:"10",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 70 41",children:_jsx("path",{d:"M30.76 39.2402C31.885 40.3638 33.41 40.995 35 40.995C36.59 40.995 38.115 40.3638 39.24 39.2402L68.24 10.2402C69.2998 9.10284 69.8768 7.59846 69.8494 6.04406C69.822 4.48965 69.1923 3.00657 68.093 1.90726C66.9937 0.807959 65.5106 0.178263 63.9562 0.150837C62.4018 0.123411 60.8974 0.700397 59.76 1.76024L35 26.5102L10.24 1.76024C9.10259 0.700397 7.59822 0.123411 6.04381 0.150837C4.4894 0.178263 3.00632 0.807959 1.90702 1.90726C0.807714 3.00657 0.178019 4.48965 0.150593 6.04406C0.123167 7.59846 0.700153 9.10284 1.75999 10.2402L30.76 39.2402Z"})});