import{i as e}from"./preload-helper-B45gAKPr.js";import{t}from"./iframe-GmIo3IOR.js";import{o as n}from"./DateInput-CvJvdtwa.js";import{t as r}from"./ui-Dlg5NgOB.js";import{t as i}from"./Select-BrRZA3Up.js";import{t as a}from"./select-CjW1dQXg.js";var o=e((()=>{n(),r()}));function s(e,t,n=[]){if(!Array.isArray(e))return[...n];let r=[];for(let n of e)!t(n)||r.includes(n)||r.push(n);return r}function c(e,t){let n=new Map(t.map(e=>[e.id,e])),r=[],i=new Set;for(let t of e){if(i.has(t))continue;let e=n.get(t);e&&(r.push(e),i.add(t))}return r}function l(e,t){return e?t.find(t=>t.id===e)??null:null}var u=e((()=>{}));function d({options:e,value:t,onChange:n,getOptionDisabled:r,getOptionCode:a,getOptionAriaLabel:o,renderOption:s,renderValue:c,className:u,buttonClassName:d,optionsClassName:p,clearable:m,...h}){let g=l(t,e)??void 0;return(0,f.jsx)(i,{...h,options:e,value:g,onChange:e=>n(e?.id),getOptionKey:e=>e.id,getOptionLabel:e=>e.label,getOptionCode:a,getOptionDisabled:r,getOptionAriaLabel:o,renderOption:s,renderValue:c,className:u,buttonClassName:d,optionsClassName:p,clearable:m})}var f,p=e((()=>{u(),a(),f=t(),d.__docgenInfo={description:"Базовый Select для пресетов с контрактом `id/label`.",methods:[],displayName:`PresetSelect`,props:{label:{required:!1,tsType:{name:`ReactNode`},description:``},description:{required:!1,tsType:{name:`string`},description:``},placeholder:{required:!1,tsType:{name:`string`},description:``},disabled:{required:!1,tsType:{name:`boolean`},description:``},size:{required:!1,tsType:{name:`union`,raw:`"xs" | "sm" | "md" | "lg" | "xl"`,elements:[{name:`literal`,value:`"xs"`},{name:`literal`,value:`"sm"`},{name:`literal`,value:`"md"`},{name:`literal`,value:`"lg"`},{name:`literal`,value:`"xl"`}]},description:``},value:{required:!0,tsType:{name:`V`},description:"Если начальное состояние может быть `null | undefined`\nзначит `onChange` тоже должен ументь сбрасывать.\nПоэтому такой контрол явно должен передавать `UiBaseProps<AnyType | undefined>`"},onChange:{required:!0,tsType:{name:`signature`,type:`function`,raw:`(value: T) => void`,signature:{arguments:[{type:{name:`C`},name:`value`}],return:{name:`void`}}},description:``},options:{required:!0,tsType:{name:`unknown`},description:``},getOptionDisabled:{required:!1,tsType:{name:`signature`,type:`function`,raw:`(option: TOption) => boolean`,signature:{arguments:[{type:{name:`TOption`},name:`option`}],return:{name:`boolean`}}},description:``},getOptionCode:{required:!1,tsType:{name:`signature`,type:`function`,raw:`(option: TOption) => ReactNode`,signature:{arguments:[{type:{name:`TOption`},name:`option`}],return:{name:`ReactNode`}}},description:``},getOptionAriaLabel:{required:!1,tsType:{name:`signature`,type:`function`,raw:`(option: TOption) => string`,signature:{arguments:[{type:{name:`TOption`},name:`option`}],return:{name:`string`}}},description:``},renderOption:{required:!1,tsType:{name:`signature`,type:`function`,raw:`(option: TOption, state: SelectOptionState) => ReactNode`,signature:{arguments:[{type:{name:`TOption`},name:`option`},{type:{name:`signature`,type:`object`,raw:`{
	active: boolean;
	selected: boolean;
	disabled: boolean;
}`,signature:{properties:[{key:`active`,value:{name:`boolean`,required:!0}},{key:`selected`,value:{name:`boolean`,required:!0}},{key:`disabled`,value:{name:`boolean`,required:!0}}]}},name:`state`}],return:{name:`ReactNode`}}},description:``},renderValue:{required:!1,tsType:{name:`signature`,type:`function`,raw:`(option: TOption) => ReactNode`,signature:{arguments:[{type:{name:`TOption`},name:`option`}],return:{name:`ReactNode`}}},description:``},className:{required:!1,tsType:{name:`string`},description:``},buttonClassName:{required:!1,tsType:{name:`string`},description:``},optionsClassName:{required:!1,tsType:{name:`string`},description:``},clearable:{required:!1,tsType:{name:`boolean`},description:``}}}})),m=e((()=>{p()}));export{u as a,o as c,s as i,d as n,l as o,p as r,c as s,m as t};