import{c as e,i as t}from"./preload-helper-B45gAKPr.js";import{C as n}from"./iframe-SfMJGCsn.js";import{t as r}from"./jsx-runtime-BBQGix-2.js";import{a as i,i as a,n as o,o as s,r as c,s as l,t as u}from"./TreePickerBase-Md6Mt9qF.js";function d(e,t){if(e.size!==0){if(e.size===1){let n=t.nodeById.get([...e][0]);return n?n.code&&n.code!==n.label?`${n.label} · ${n.code}`:n.label:void 0}return`Выбрано ${e.size} узл.`}}function f({label:e,description:t,disabled:n,placeholder:r=`Выберите значения`,size:i,nodes:o,value:f,onChange:h,query:g,defaultQuery:_,onQuery:v,isLoading:y,error:b}){let x=(0,p.useMemo)(()=>c(o),[o]),S=(0,p.useMemo)(()=>l(f,x),[x,f]),C=(0,p.useMemo)(()=>a(S,x),[S,x]),w=(0,p.useMemo)(()=>d(S,x),[S,x]);return(0,m.jsx)(u,{label:e,description:t,disabled:n,placeholder:r,size:i,nodes:o,selectedIds:C.selectedIds,partialIds:C.partialIds,selectionMode:`multi`,triggerMode:`search`,selectedSummary:w,query:g,defaultQuery:_,onQuery:v,onNodeActivate:e=>h(s(f,e.id,x)),onClearSelection:()=>h({}),isLoading:y,error:b})}var p,m,h=t((()=>{p=e(n(),1),i(),o(),m=r(),f.__docgenInfo={description:``,methods:[],displayName:`TreeMultiSelect`,props:{nodes:{required:!0,tsType:{name:`unknown`},description:``},placeholder:{required:!1,tsType:{name:`string`},description:``,defaultValue:{value:`"Выберите значения"`,computed:!1}},query:{required:!1,tsType:{name:`string`},description:``},defaultQuery:{required:!1,tsType:{name:`string`},description:``},onQuery:{required:!1,tsType:{name:`signature`,type:`function`,raw:`(value: string) => void`,signature:{arguments:[{type:{name:`string`},name:`value`}],return:{name:`void`}}},description:``},isLoading:{required:!1,tsType:{name:`boolean`},description:``},error:{required:!1,tsType:{name:`string`},description:``}},composes:[`Omit`]}}));export{h as n,f as t};