import{n as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-C21x__mS.js";import{n}from"./iframe-GrlyTB2d.js";import{n as r,t as i}from"./FlexContainer-LmZIdhq2.js";import{r as a,t as o}from"./DateInput-B7WxAsa1.js";import{a as s,c,l,n as u,o as d,r as f,s as p,t as m}from"./DateRangePresetSelect-CmXwIBMW.js";function h(e){return e??`__empty__`}function g({value:e,onChange:t,presetId:n,onPresetIdChange:r,referenceDate:a,presetIds:s,presetOptions:u,presetLabel:g,presetDescription:y,presetPlaceholder:b=`Выберите пресет диапазона`,presetDisabled:x,...S}){let[C]=(0,_.useState)(()=>new Date),w=a??C,T=(0,_.useMemo)(()=>u??c(d(s,f)),[s,u]),E=e??null,D=(0,_.useMemo)(()=>p(E,w,T),[E,T,w]),O=n??D??void 0,k=(0,_.useRef)(``),A=(0,_.useCallback)(e=>{if(!r)return;let t=h(e);t!==k.current&&(k.current=t,r(e))},[r]),j=e=>{let n=l(e,w,T);if(!n){A(null);return}A(n.id),t(n.range)},M=e=>{t(e),A(p(e,w,T))};return(0,v.jsxs)(i,{gap:`sm`,align:`end`,children:[(0,v.jsx)(m,{size:S.size,label:g,description:y,placeholder:b,disabled:x??S.disabled,value:O,onChange:j,options:T,referenceDate:w}),(0,v.jsx)(o,{...S,value:E,onChange:M})]})}var _,v;function y(){return(y=e((()=>{_=t(),a(),u(),s(),r(),v=n(),g.__docgenInfo={description:`Составной компонент выбора диапазона дат через пресет или ручной ввод.`,methods:[],displayName:`PresetRangeDateInput`,props:{presetId:{required:!1,tsType:{name:`union`,raw:`DateRangePresetOption["id"] | null`,elements:[{name:`DateRangePresetOption["id"]`,raw:`DateRangePresetOption["id"]`},{name:`null`}]},description:``},onPresetIdChange:{required:!1,tsType:{name:`signature`,type:`function`,raw:`(presetId: DateRangePresetOption["id"] | null) => void`,signature:{arguments:[{type:{name:`union`,raw:`DateRangePresetOption["id"] | null`,elements:[{name:`DateRangePresetOption["id"]`,raw:`DateRangePresetOption["id"]`},{name:`null`}]},name:`presetId`}],return:{name:`void`}}},description:``},referenceDate:{required:!1,tsType:{name:`Date`},description:``},presetIds:{required:!1,tsType:{name:`unknown`},description:``},presetOptions:{required:!1,tsType:{name:`unknown`},description:``},presetLabel:{required:!1,tsType:{name:`ReactNode`},description:``},presetDescription:{required:!1,tsType:{name:`string`},description:``},presetPlaceholder:{required:!1,tsType:{name:`string`},description:``,defaultValue:{value:`"Выберите пресет диапазона"`,computed:!1}},presetDisabled:{required:!1,tsType:{name:`boolean`},description:``}},composes:[`Omit`]}})))()}export{y as n,g as t};