@efficiency-point/design-system 0.1.16 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import { DSDropDownSize, DropDownOption } from '../DSDropDown/DSDropDown';
2
+ export type DSSearchDropDownSize = DSDropDownSize;
2
3
  export type DSSearchDropDownProps = {
3
4
  options: DropDownOption[];
4
5
  value: string;
@@ -11,7 +12,7 @@ export type DSSearchDropDownProps = {
11
12
  label?: string;
12
13
  error?: string;
13
14
  hint?: string;
14
- size?: DSDropDownSize;
15
+ size?: DSSearchDropDownSize;
15
16
  required?: boolean;
16
17
  className?: string;
17
18
  name?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"DSSearchDropDown.d.ts","sourceRoot":"","sources":["../../../src/components/DSSearchDropDown/DSSearchDropDown.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAS/E,MAAM,MAAM,qBAAqB,GAAG;IAChC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAcF,eAAO,MAAM,gBAAgB,GAAI,uKAkB9B,qBAAqB,gCAqQvB,CAAC"}
1
+ {"version":3,"file":"DSSearchDropDown.d.ts","sourceRoot":"","sources":["../../../src/components/DSSearchDropDown/DSSearchDropDown.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAS/E,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAElD,MAAM,MAAM,qBAAqB,GAAG;IAChC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAeF,eAAO,MAAM,gBAAgB,GAAI,uKAkB9B,qBAAqB,gCAqQvB,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),r=require("@tanstack/react-table"),i=require("zustand");var a={badge:`_badge_q710w_1`,sm:`_sm_q710w_3`,md:`_md_q710w_5`,neutral:`_neutral_q710w_7`,info:`_info_q710w_9`,success:`_success_q710w_11`,warning:`_warning_q710w_13`,error:`_error_q710w_15`,dot:`_dot_q710w_17`,icon:`_icon_q710w_19`,label:`_label_q710w_21`},o=({children:t,variant:n=`neutral`,size:r=`md`,dot:i=!1,icon:o,className:s=``})=>(0,e.jsxs)(`span`,{className:`${a.badge} ${a[n]} ${a[r]} ${s}`,children:[i&&(0,e.jsx)(`span`,{className:a.dot,"aria-hidden":`true`}),o&&(0,e.jsx)(`span`,{className:a.icon,"aria-hidden":`true`,children:o}),(0,e.jsx)(`span`,{className:a.label,children:t})]}),s={container:`_container_1h2c4_1`,inner:`_inner_1h2c4_21`,line:`_line_1h2c4_39`,primary:`_primary_1h2c4_57`,secondary:`_secondary_1h2c4_65`,outline:`_outline_1h2c4_73`,ghost:`_ghost_1h2c4_81`,empty:`_empty_1h2c4_89`,destructive:`_destructive_1h2c4_97`,destructiveOutline:`_destructiveOutline_1h2c4_105`,grow:`_grow_1h2c4_1`},c=({variant:t=`primary`})=>(0,e.jsx)(`div`,{className:`${s.container} ${s[t]}`,children:(0,e.jsxs)(`div`,{className:`${s.inner} ${s[t]}`,children:[(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`}),(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`}),(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`}),(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`})]})}),l={button:`_button_15zz4_1`,sm:`_sm_15zz4_47`,md:`_md_15zz4_61`,lg:`_lg_15zz4_75`,primary:`_primary_15zz4_89`,secondary:`_secondary_15zz4_103`,outline:`_outline_15zz4_117`,ghost:`_ghost_15zz4_131`,empty:`_empty_15zz4_145`,destructive:`_destructive_15zz4_159`,destructiveOutline:`_destructiveOutline_15zz4_169`},u=(0,t.forwardRef)(({children:t,variant:n=`primary`,size:r=`md`,isLoading:i=!1,disabled:a,type:o=`button`,className:s=``,...u},d)=>(0,e.jsx)(`button`,{ref:d,className:`${l.button} ${l[n]} ${l[r]} ${s}`,disabled:a||i,"aria-busy":i||void 0,...u,type:o,children:i?(0,e.jsx)(c,{variant:n}):t}));u.displayName=`DSButton`;var d={label:`_label_1uvpq_1`,required:`_required_1uvpq_23`,error:`_error_1uvpq_25`,optional:`_optional_1uvpq_33`,hint:`_hint_1uvpq_35`,disabled:`_disabled_1uvpq_47`,message:`_message_1uvpq_55`,success:`_success_1uvpq_71`},f=({children:t,required:n=!1,optionalText:r,disabled:i=!1,className:a=``,...o})=>(0,e.jsxs)(`label`,{className:`${d.label} ${i?d.disabled:``} ${a}`,...o,children:[(0,e.jsx)(`span`,{children:t}),n&&(0,e.jsx)(`span`,{className:d.required,"aria-hidden":`true`,children:`*`}),r&&(0,e.jsx)(`span`,{className:d.optional,children:r})]}),p=({children:t,variant:n=`hint`,id:r,live:i=!1,className:a=``})=>(0,e.jsx)(`span`,{id:r,className:`${d.message} ${d[n]} ${a}`,role:i&&n===`error`?`alert`:void 0,"aria-live":i&&n!==`error`?`polite`:void 0,children:t}),m=({width:t=24,height:n=24,color:r,title:i,style:a,children:o,...s})=>(0,e.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:t,height:n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,role:i?`img`:void 0,"aria-hidden":!i||void 0,focusable:`false`,style:r?{...a,color:r}:a,...s,children:[i&&(0,e.jsx)(`title`,{children:i}),o]}),h={IconBasket:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 7h16l-1 13H5L4 7zm3 0V4h10v3`})}),IconCheck:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`m5 12 4 4L19 6`})}),IconChevron:t=>(0,e.jsx)(m,{viewBox:`0 0 20 20`,...t,children:(0,e.jsx)(`path`,{d:`M5 7.5L10 12.5L15 7.5`})}),IconCross:({strokeWidth:t=2,...n})=>(0,e.jsx)(m,{strokeWidth:t,...n,children:(0,e.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})}),IconEdit:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 20h4L19 9l-4-4L4 16v4z`})}),IconErrorCircle:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`m15 9-6 6M9 9l6 6`})]}),IconEye:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`path`,{d:`M3 12s3.5-5 9-5 9 5 9 5-3.5 5-9 5-9-5-9-5Z`}),(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2.5`})]}),IconEyeOff:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M3 3l18 18M10.6 10.7a2 2 0 0 0 2.7 2.7M9.9 4.2A10.7 10.7 0 0 1 12 4c5.5 0 9 5.3 9 5.3a14 14 0 0 1-2.3 2.8M6.6 6.6C4.3 8.1 3 10 3 10s3.5 5 9 5c1 0 2-.2 2.8-.5`})}),IconInfo:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 10v7m0-10v.01`})}),IconInfoCircle:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`M12 16v-4M12 8v.01`})]}),IconMinus:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M5 12h14`})}),IconPause:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M8 5v14M16 5v14`,strokeWidth:`3`})}),IconPictureInPicture:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M3 5h18v14H3V5Zm10 7h6v5h-6v-5Z`})}),IconPlay:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`m8 5 11 7-11 7V5Z`,fill:`currentColor`,stroke:`none`})}),IconReplay:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 7v5h5M5.5 11a7 7 0 1 1 1.3 6.3`})}),IconSettings:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 8.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm7.4 5.2.1-1.7-.1-1.7 2-1.5-2-3.4-2.4 1a8 8 0 0 0-2.9-1.7L13.8 2h-3.9l-.4 2.7a8 8 0 0 0-2.8 1.7l-2.5-1-2 3.4 2.1 1.5-.1 1.7.1 1.7-2.1 1.5 2 3.4 2.5-1a8 8 0 0 0 2.8 1.7l.4 2.7h3.9l.3-2.7a8 8 0 0 0 2.9-1.7l2.4 1 2-3.4-2-1.5Z`})}),IconFullscreen:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M9 4H4v5m11-5h5v5M9 20H4v-5m11 5h5v-5`})}),IconFullscreenExit:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 9h5V4m6 5h5V4M4 15h5v5m6-5h5v5`})}),IconCaptions:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 6h16v12H4V6Zm7 4a2 2 0 1 0 0 4m7-4a2 2 0 1 0 0 4`})}),IconVolume:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M5 10v4h4l5 4V6l-5 4H5Zm12-1c1.3 1.5 1.3 4.5 0 6m2.5-8.5c3 3 3 8 0 11`})}),IconVolumeMuted:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M5 10v4h4l5 4V6l-5 4H5Zm12 0 4 4m0-4-4 4`})}),IconSort:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M8 17V5m-3 3 3-3 3 3M16 7v12m-3-3 3 3 3-3`})}),IconSortAscending:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 19V5m-5 5 5-5 5 5`})}),IconSortDescending:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 5v14m-5-5 5 5 5-5`})}),IconSuccessCircle:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),IconUpload:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 19V5m-5 5 5-5 5 5`})}),IconWarning:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`path`,{d:`M12 3.5L21 19H3L12 3.5Z`}),(0,e.jsx)(`path`,{d:`M12 9v4.5M12 16.5v.01`})]})},g=({name:t,...n})=>{let r=h[t];return(0,e.jsx)(r,{...n})},_={wrapper:`_wrapper_zhpug_1`,label:`_label_zhpug_3`,input:`_input_zhpug_5`,control:`_control_zhpug_7`,disabled:`_disabled_zhpug_21`,controlError:`_controlError_zhpug_27`},v=({checked:n,onChange:r,label:i,hint:a,error:o,disabled:s=!1,readOnly:c=!1,className:l=``,name:u,id:d,indeterminate:f=!1,...m})=>{let h=(0,t.useId)(),v=d??`ds-checkbox-${u??h}`,y=(0,t.useRef)(null),b=a?`${v}-hint`:void 0,x=o?`${v}-error`:void 0;return(0,t.useEffect)(()=>{y.current&&(y.current.indeterminate=f&&!n)},[n,f]),(0,e.jsxs)(`div`,{className:`${_.wrapper} ${l}`,children:[(0,e.jsxs)(`label`,{className:`${_.label} ${s?_.disabled:``}`,htmlFor:v,children:[(0,e.jsx)(`input`,{ref:y,id:v,name:u,type:`checkbox`,checked:n,disabled:s,"aria-readonly":c||void 0,"aria-invalid":!!o,"aria-describedby":[b,x].filter(Boolean).join(` `)||void 0,className:_.input,onChange:e=>{c||r?.(e.target.checked,e)},...m}),(0,e.jsxs)(`span`,{className:`${_.control} ${o?_.controlError:``}`,"aria-hidden":`true`,children:[f&&!n&&(0,e.jsx)(g,{name:`IconMinus`,width:16,height:16}),n&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]}),i&&(0,e.jsx)(`span`,{children:i})]}),a&&!o&&(0,e.jsx)(p,{id:b,children:a}),o&&(0,e.jsx)(p,{id:x,variant:`error`,children:o})]})},y={wrapper:`_wrapper_1dsog_1`,trigger:`_trigger_1dsog_17`,sm:`_sm_1dsog_53`,md:`_md_1dsog_65`,lg:`_lg_1dsog_75`,chevron:`_chevron_1dsog_89`,chevronOpen:`_chevronOpen_1dsog_115`,nav:`_nav_1dsog_127`,day:`_day_1dsog_129`,monthSelect:`_monthSelect_1dsog_131`,yearInput:`_yearInput_1dsog_133`,timeInput:`_timeInput_1dsog_135`,dateInput:`_dateInput_1dsog_147`,timeValue:`_timeValue_1dsog_189`,chevronButton:`_chevronButton_1dsog_201`,disabled:`_disabled_1dsog_235`,validationTooltip:`_validationTooltip_1dsog_249`,"validation-tooltip-lifetime":`_validation-tooltip-lifetime_1dsog_1`,value:`_value_1dsog_319`,placeholder:`_placeholder_1dsog_335`,error:`_error_1dsog_343`,panel:`_panel_1dsog_351`,calendarHeader:`_calendarHeader_1dsog_377`,weekdays:`_weekdays_1dsog_467`,days:`_days_1dsog_469`,outside:`_outside_1dsog_505`,selected:`_selected_1dsog_513`,timeLabel:`_timeLabel_1dsog_533`,previousMonth:`_previousMonth_1dsog_593`,nextMonth:`_nextMonth_1dsog_601`},b=[`Пн`,`Вт`,`Ср`,`Чт`,`Пт`,`Сб`,`Вс`],x=[`Январь`,`Февраль`,`Март`,`Апрель`,`Май`,`Июнь`,`Июль`,`Август`,`Сентябрь`,`Октябрь`,`Ноябрь`,`Декабрь`],S=e=>String(e).padStart(2,`0`),C=8,w=`Некорректная дата`,T=e=>e?`${S(e.getDate())}.${S(e.getMonth()+1)}.${e.getFullYear()}`:``,E=e=>{let t=e.replace(/\D/g,``).slice(0,C);return[t.slice(0,2),t.slice(2,4),t.slice(4,8)].filter(Boolean).join(`.`)},D=e=>{if(!e)return!0;let t=Number(e.padEnd(4,`0`));return Number(e.padEnd(4,`9`))>=1800&&t<=2500},O=e=>{if(!/^\d{0,8}$/.test(e))return!1;let t=e.slice(0,2),n=e.slice(2,4),r=e.slice(4,8);return t.length===1&&Number(t)>3||t.length===2&&(Number(t)<1||Number(t)>31)||n.length===1&&Number(n)>1||n.length===2&&(Number(n)<1||Number(n)>12)?!1:D(r)},k=e=>{let t=/^(\d{2})\.(\d{2})\.(\d{4})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2])-1,i=Number(t[3]);if(i<1800||i>2500)return null;let a=new Date(i,r,n,12);return a.getFullYear()!==i||a.getMonth()!==r||a.getDate()!==n?null:a},A=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),j=(e,t)=>{if(!e)return``;let n=`${e.getFullYear()}-${S(e.getMonth()+1)}-${S(e.getDate())}`,r=`${S(e.getHours())}:${S(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n}T${r}`},M=(e,t)=>{if(!e)return null;if(t===`time`){let t=/^(\d{2}):(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);if(n>23||r>59)return null;let i=new Date;return i.setHours(n,r,0,0),i}if(t===`date`){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2])-1,i=Number(t[3]),a=new Date(n,r,i,12);return a.getFullYear()!==n||a.getMonth()!==r||a.getDate()!==i?null:a}let n=new Date(e);return Number.isNaN(n.getTime())?null:n},N=(e,t)=>{if(!e)return``;let n=`${S(e.getDate())}.${S(e.getMonth()+1)}.${e.getFullYear()}`,r=`${S(e.getHours())}:${S(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n} ${r}`},P=e=>{let t=new Date(e.getFullYear(),e.getMonth(),1),n=(t.getDay()+6)%7,r=new Date(t);return r.setDate(t.getDate()-n),Array.from({length:42},(e,t)=>{let n=new Date(r);return n.setDate(r.getDate()+t),n})},F=(e,t)=>!!(e&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()),I=(e,t,n)=>{let r=A(e).getTime();return!!(t&&r<A(t).getTime()||n&&r>A(n).getTime())},L=8,R=6,z=({value:r,onChange:i,mode:a=`date`,label:o,placeholder:s,hint:c,error:l,disabled:u=!1,readOnly:d=!1,required:m=!1,min:h,max:_,size:v=`md`,id:S,name:D,className:A=``})=>{let z=(0,t.useId)(),B=S??`ds-date-time-${D??z}`,ee=c?`${B}-hint`:void 0,V=l?`${B}-error`:void 0,te=(0,t.useRef)(null),H=(0,t.useRef)(null),U=(0,t.useRef)(null),W=(0,t.useRef)(null),[G,K]=(0,t.useState)(!1),[q,J]=(0,t.useState)(r??new Date),[ne,re]=(0,t.useState)(j(r,`time`)),[ie,Y]=(0,t.useState)(T(r)),[ae,oe]=(0,t.useState)(``),[se,ce]=(0,t.useState)(0),[le,ue]=(0,t.useState)(null),de=(0,t.useMemo)(()=>P(q),[q]),fe=a!==`time`,pe=a!==`date`;(0,t.useEffect)(()=>{r&&J(r),re(j(r,`time`)),Y(T(r))},[r]),(0,t.useEffect)(()=>()=>{W.current&&clearTimeout(W.current)},[]);let me=(0,t.useCallback)(()=>{let e=H.current,t=U.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight-n.bottom-L,o=n.top-L,s=a<r.height&&o>a,c=Math.max(120,s?o:a),l=s?Math.max(L,n.top-r.height-R):n.bottom+R,u=n.left,d=i-r.width-L;ue({top:l,left:Math.max(L,Math.min(u,d)),maxHeight:c})},[]);(0,t.useLayoutEffect)(()=>{if(!G){ue(null);return}return me(),window.addEventListener(`resize`,me),window.addEventListener(`scroll`,me,!0),()=>{window.removeEventListener(`resize`,me),window.removeEventListener(`scroll`,me,!0)}},[G,me,q,ne]),(0,t.useEffect)(()=>{if(!G)return;let e=e=>{let t=e.target,n=te.current?.contains(t),r=U.current?.contains(t);!n&&!r&&K(!1)},t=e=>{e.key===`Escape`&&(K(!1),H.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[G]);let he=e=>{if(I(e,h,_))return;let t=a===`date`?M(j(e,`date`),`date`):new Date(e);t&&(a!==`date`&&t.setHours(r?.getHours()??0,r?.getMinutes()??0,0,0),i?.(t),Y(T(t)),a===`date`&&K(!1))},ge=()=>{oe(w),ce(e=>e+1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{oe(``),W.current=null},3e3)},_e=e=>{let t=e.replace(/\D/g,``).slice(0,C);if(!O(t)){ge();return}let n=E(t);if(Y(n),!t){i?.(null);return}if(t.length<C)return;let o=k(n);if(!o||I(o,h,_)){ge();return}a===`datetime`&&o.setHours(r?.getHours()??0,r?.getMinutes()??0,0,0),i?.(o),J(o),K(!1),requestAnimationFrame(()=>H.current?.blur())},ve=e=>{if(re(e),!e){i?.(null);return}let t=M(e,`time`);if(!t)return;let n=new Date(a===`datetime`?r??q:new Date);n.setHours(t.getHours(),t.getMinutes(),0,0),!(h&&n<h||_&&n>_)&&i?.(n)},ye=s??(a===`date`?`ДД.ММ.ГГГГ`:a===`time`?`ЧЧ:ММ`:`ДД.ММ.ГГГГ ЧЧ:ММ`),be=ae?`${B}-validation`:void 0,xe=[ee,V,be].filter(Boolean).join(` `)||void 0,Se=G&&!d?(0,e.jsxs)(`div`,{ref:U,className:y.panel,role:`dialog`,"aria-label":o??ye,style:le?{top:le.top,left:le.left,maxHeight:le.maxHeight}:{visibility:`hidden`,top:0,left:0},children:[fe&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(`div`,{className:y.calendarHeader,children:[(0,e.jsx)(`button`,{type:`button`,className:y.nav,"aria-label":`Предыдущий месяц`,onClick:()=>J(new Date(q.getFullYear(),q.getMonth()-1,1)),children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20,className:y.previousMonth})}),(0,e.jsx)(`select`,{className:y.monthSelect,"aria-label":`Месяц`,value:q.getMonth(),onChange:e=>J(new Date(q.getFullYear(),Number(e.target.value),1)),children:x.map((t,n)=>(0,e.jsx)(`option`,{value:n,children:t},t))}),(0,e.jsx)(`input`,{className:y.yearInput,type:`number`,"aria-label":`Год`,value:q.getFullYear(),onChange:e=>J(new Date(Number(e.target.value),q.getMonth(),1))}),(0,e.jsx)(`button`,{type:`button`,className:y.nav,"aria-label":`Следующий месяц`,onClick:()=>J(new Date(q.getFullYear(),q.getMonth()+1,1)),children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20,className:y.nextMonth})})]}),(0,e.jsx)(`div`,{className:y.weekdays,children:b.map(t=>(0,e.jsx)(`span`,{children:t},t))}),(0,e.jsx)(`div`,{className:y.days,children:de.map(t=>{let n=F(r,t);return(0,e.jsx)(`button`,{type:`button`,className:`${y.day} ${t.getMonth()===q.getMonth()?``:y.outside} ${n?y.selected:``}`,disabled:I(t,h,_),"aria-pressed":n,onClick:()=>he(t),children:t.getDate()},t.toISOString())})})]}),pe&&(0,e.jsxs)(`label`,{className:y.timeLabel,children:[(0,e.jsx)(`span`,{children:`Время`}),(0,e.jsx)(`input`,{className:y.timeInput,type:`time`,value:ne,onChange:e=>ve(e.target.value)})]})]}):null;return(0,e.jsxs)(`div`,{ref:te,className:`${y.wrapper} ${A}`,children:[o&&(0,e.jsx)(f,{htmlFor:B,required:m,disabled:u,children:o}),fe?(0,e.jsxs)(`div`,{className:`${y.trigger} ${y[v]} ${l?y.error:``} ${u?y.disabled:``}`,children:[(0,e.jsx)(`input`,{ref:H,id:B,name:D,className:y.dateInput,value:ie,placeholder:ye.split(` `)[0],inputMode:`numeric`,autoComplete:`off`,maxLength:10,disabled:u,readOnly:d,"aria-expanded":G,"aria-haspopup":`dialog`,"aria-describedby":xe,"aria-invalid":!!(l||ae)||void 0,onFocus:()=>{d||K(!0)},onClick:()=>{d||K(!0)},onChange:e=>_e(e.target.value)}),a===`datetime`&&ne&&(0,e.jsx)(`span`,{className:y.timeValue,children:ne}),(0,e.jsx)(`button`,{type:`button`,className:y.chevronButton,disabled:u||d,"aria-label":G?`Закрыть календарь`:`Открыть календарь`,tabIndex:-1,onMouseDown:e=>e.preventDefault(),onClick:()=>{K(e=>!e),H.current?.focus()},children:(0,e.jsx)(`span`,{className:`${y.chevron} ${Se?y.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})})]}):(0,e.jsxs)(`button`,{ref:H,id:B,name:D,type:`button`,className:`${y.trigger} ${y[v]} ${l?y.error:``}`,disabled:u,"aria-readonly":d||void 0,"aria-expanded":G,"aria-haspopup":`dialog`,"aria-describedby":xe,onClick:()=>{d||K(e=>!e)},children:[(0,e.jsx)(`span`,{className:r?y.value:y.placeholder,children:N(r,a)||ye}),(0,e.jsx)(`span`,{className:`${y.chevron} ${Se?y.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]}),ae&&(0,e.jsx)(`span`,{id:be,className:y.validationTooltip,role:`status`,"aria-live":`polite`,children:ae},se),Se&&(0,n.createPortal)(Se,document.body),c&&!l&&(0,e.jsx)(p,{id:ee,children:c}),l&&(0,e.jsx)(p,{id:V,variant:`error`,children:l})]})},B={root:`_root_q0cvp_1`,range:`_range_q0cvp_3`},ee=e=>!!(e.from&&e.to&&e.from.getTime()<=e.to.getTime()),V=({value:t,onChange:n,onDraftChange:r,mode:i=`date`,fromLabel:a=`От`,toLabel:o=`До`,hint:s,error:c,min:l,max:u,disabled:d=!1,readOnly:f=!1,required:m=!1,className:h=``})=>{let g=c??(t.from&&t.to&&t.from>t.to?`Дата «От» не может быть позже даты «До»`:void 0),_=e=>{r?.(e),ee(e)&&n?.(e)};return(0,e.jsxs)(`fieldset`,{className:`${B.root} ${h}`,disabled:d,children:[(0,e.jsxs)(`div`,{className:B.range,children:[(0,e.jsx)(z,{value:t.from,mode:i===`datetime`?`datetime`:i,label:a,min:l,max:t.to??u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,from:e})}),(0,e.jsx)(z,{value:t.to,mode:i===`datetime`?`datetime`:i,label:o,min:t.from??l,max:u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,to:e})})]}),s&&!g&&(0,e.jsx)(p,{children:s})]})},te={group:`_group_1fs9e_1`,skeleton:`_skeleton_1fs9e_3`,text:`_text_1fs9e_5`,rectangular:`_rectangular_1fs9e_7`,circular:`_circular_1fs9e_9`,animated:`_animated_1fs9e_11`,"ds-skeleton":`_ds-skeleton_1fs9e_1`},H=({variant:t=`text`,width:n=`100%`,height:r,lines:i=1,animated:a=!0,className:o=``})=>(0,e.jsx)(`span`,{className:`${te.group} ${o}`,"aria-hidden":`true`,children:Array.from({length:Math.max(1,i)},(o,s)=>(0,e.jsx)(`span`,{className:`${te.skeleton} ${te[t]} ${a?te.animated:``}`,style:{width:s===i-1&&i>1?`70%`:n,height:r}},s))}),U={wrapper:`_wrapper_c47na_1`,container:`_container_c47na_17`,trigger:`_trigger_c47na_25`,disabledText:`_disabledText_c47na_27`,sm:`_sm_c47na_53`,md:`_md_c47na_67`,lg:`_lg_c47na_81`,value:`_value_c47na_147`,placeholder:`_placeholder_c47na_149`,chevron:`_chevron_c47na_205`,chevronOpen:`_chevronOpen_c47na_231`,menu:`_menu_c47na_239`,option:`_option_c47na_269`,selected:`_selected_c47na_339`,message:`_message_c47na_359`,error:`_error_c47na_361`,errorState:`_errorState_c47na_387`},W=8,G=6,K=120,q=(e,t,n)=>{if(!e.length)return-1;for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},J=e=>{if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e);if(Number.isFinite(t))return t}return 1/0},ne=({options:r,value:i,onChange:a,placeholder:o=`Выберите опцию`,disabled:s=!1,stringWhileDisabled:c=!1,label:l,error:u,size:d=`md`,hint:p,className:m=``,required:h=!1,name:_,id:v,needMark:y=!0,maxMenuHeight:b})=>{let x=(0,t.useId)(),S=v??`ds-dropdown-${_??x}`,C=`${S}-listbox`,[w,T]=(0,t.useState)(!1),[E,D]=(0,t.useState)(null),O=(0,t.useRef)(null),k=(0,t.useRef)(null),A=(0,t.useRef)(null),j=(0,t.useRef)([]),M=(0,t.useMemo)(()=>r.find(e=>e.value===i),[r,i]),N=p?`${S}-hint`:void 0,P=u?`${S}-error`:void 0,F=[N,P].filter(Boolean).join(` `)||void 0,I=s&&c,L=(0,t.useCallback)(()=>{let e=k.current,t=A.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight-n.bottom-W,o=n.top-W,s=a<r.height&&o>a,c=Math.max(K,s?o:a),l=J(b),u=Math.min(c,l),d=n.left,f=i-n.width-W,p=Math.max(W,Math.min(d,f)),m=s?Math.max(W,n.top-r.height-G):n.bottom+G;D({top:m,left:p,width:n.width,maxHeight:u})},[b]);(0,t.useLayoutEffect)(()=>{if(!w){D(null);return}return L(),window.addEventListener(`resize`,L),window.addEventListener(`scroll`,L,!0),()=>{window.removeEventListener(`resize`,L),window.removeEventListener(`scroll`,L,!0)}},[w,L,r.length]),(0,t.useEffect)(()=>{if(!w)return;let e=e=>{let t=e.target,n=O.current?.contains(t),r=A.current?.contains(t);!n&&!r&&T(!1)},t=e=>{e.key===`Escape`&&(T(!1),k.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[w]);let R=(e,t)=>{let n=q(r,e,t);if(n===-1)return;let i=j.current[n];i?.focus(),i?.scrollIntoView({block:`nearest`})},z=e=>{e.disabled||(a?.(e.value,e),T(!1),k.current?.focus())},B=w?(0,e.jsx)(`ul`,{ref:A,id:C,className:U.menu,role:`listbox`,"aria-label":l,style:E?{position:`fixed`,top:E.top,left:E.left,width:E.width,maxHeight:E.maxHeight}:{position:`fixed`,top:0,left:0,visibility:`hidden`,maxHeight:0},children:r.map((t,n)=>{let a=t.value===i;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{j.current[n]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:[U[d],U.option,a?U.selected:``].filter(Boolean).join(` `),onClick:()=>z(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;R(n+t,t)}if(e.key===`Tab`&&T(!1),e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;R(e.key===`Home`?0:r.length-1,t)}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),z(t))},children:[(0,e.jsx)(`span`,{children:t.label}),a&&y&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:O,className:[U.wrapper,u?U.errorState:``,m].filter(Boolean).join(` `),children:[l&&(0,e.jsx)(f,{required:h,disabled:s,htmlFor:I?void 0:S,children:l}),(0,e.jsx)(`div`,{className:U.container,children:I?(0,e.jsx)(`div`,{id:S,className:U.disabledText,"aria-describedby":F,children:M?.label??o}):(0,e.jsxs)(`button`,{ref:k,id:S,type:`button`,name:_,className:`${U.trigger} ${U[d]}`,disabled:s,"aria-haspopup":`listbox`,"aria-expanded":w,"aria-controls":C,"aria-describedby":F,"aria-invalid":!!u,onClick:()=>T(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),T(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>{R(e.key===`ArrowDown`?0:r.length-1,t)})}if(e.key===`Enter`&&w){e.preventDefault();let t=r.findIndex(e=>e.value===i);R(t>=0?t:0,1)}},children:[(0,e.jsx)(`span`,{className:`${M?U.value:U.placeholder}
2
- ${U[d]}`,children:M?.label??o}),(0,e.jsx)(`span`,{className:[U.chevron,w?U.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]})}),w&&(0,n.createPortal)(B,document.body),p&&!u&&(0,e.jsx)(`span`,{id:N,className:U.message,children:p}),u&&(0,e.jsx)(`span`,{id:P,className:U.error,children:u})]})},re=e=>`${e.id}:${e.direction}`,ie=({options:t,value:n,onChange:r,label:i=`Сортировка`,placeholder:a=`Выберите сортировку`,disabled:o=!1,className:s})=>{let c=t.flatMap(e=>[{value:re({id:e.id,direction:`asc`}),label:e.ascLabel??`${e.label} · по возрастанию`,disabled:e.disabled},{value:re({id:e.id,direction:`desc`}),label:e.descLabel??`${e.label} · по убыванию`,disabled:e.disabled}]);return(0,e.jsx)(ne,{options:c,value:n?re(n):``,label:i,placeholder:a,disabled:o,className:s,onChange:e=>{let t=e.lastIndexOf(`:`);r?.({id:e.slice(0,t),direction:e.slice(t+1)})}})},Y={root:`_root_l2civ_1`,tableWrap:`_tableWrap_l2civ_3`,table:`_table_l2civ_3`,sticky:`_sticky_l2civ_15`,sortButton:`_sortButton_l2civ_17`,state:`_state_l2civ_21`,cards:`_cards_l2civ_23`,mobileSort:`_mobileSort_l2civ_23`,card:`_card_l2civ_23`,spanTwo:`_spanTwo_l2civ_37`,clickableRow:`_clickableRow_l2civ_41`,pagination:`_pagination_l2civ_49`,paginationRange:`_paginationRange_l2civ_75`,paginationControls:`_paginationControls_l2civ_87`,pageNumbers:`_pageNumbers_l2civ_89`,pageButton:`_pageButton_l2civ_101`,ellipsis:`_ellipsis_l2civ_111`,previousIcon:`_previousIcon_l2civ_123`,nextIcon:`_nextIcon_l2civ_131`,default:`_default_l2civ_169`,tableOnMobile:`_tableOnMobile_l2civ_169`,wide:`_wide_l2civ_173`},ae=(0,r.tableFeatures)({rowSortingFeature:r.rowSortingFeature,sortedRowModel:(0,r.createSortedRowModel)()}),oe=e=>{if(!(!e||e.width===void 0&&e.minWidth===void 0&&e.maxWidth===void 0))return{width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth}},se=(e,t)=>t<=7?Array.from({length:t},(e,t)=>t):e<=3?[0,1,2,3,4,`ellipsis-end`,t-1]:e>=t-4?[0,`ellipsis-start`,t-5,t-4,t-3,t-2,t-1]:[0,`ellipsis-start`,e-1,e,e+1,`ellipsis-end`,t-1],ce=(e,t)=>{let n=new Set;for(let t of e){if(!t.id.trim())return`Идентификатор колонки не может быть пустым`;if(n.has(t.id))return`Идентификатор колонки «${t.id}» повторяется`;n.add(t.id)}for(let n=0;n<t.length;n+=1){let r=t[n];for(let t of e)if(typeof t.accessor==`string`&&!(t.accessor in r))return`В строке ${n+1} отсутствует колонка «${t.id}»`}return null},le=(e,t)=>typeof e==`function`?e(t):t[e],ue=e=>{if(e==null||e===``)return null;let t=Date.parse(String(e));return Number.isNaN(t)?null:t},de=(e,t,n)=>{let r=ue(e.getValue(n)),i=ue(t.getValue(n));return r===null&&i===null?0:r===null?-1:i===null?1:r-i},fe=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r==null&&i==null?0:r==null?-1:i==null?1:Number(r)-Number(i)},pe=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r==null&&i==null?0:r==null?-1:i==null?1:Number(!!r)-Number(!!i)},me=(e,t,n)=>{let r=String(e.getValue(n)??``),i=String(t.getValue(n)??``);return r.localeCompare(i,void 0,{numeric:!0,sensitivity:`base`})},he=e=>{switch(e){case`date`:return de;case`number`:return fe;case`boolean`:return pe;case`text`:case void 0:return me;case`custom`:return}},ge=e=>{let t=t=>le(e.accessor,t),n=e.sortFn??he(e.dataType),r=e.enableSorting??(e.dataType!==`custom`&&n!==void 0),i={id:e.id,accessorFn:t,header:()=>e.header,cell:t=>{let n=t.getValue();return e.cell?.(t.row.original,n)??String(n??``)},enableSorting:r,sortDescFirst:e.sortDescFirst};return n!==void 0&&(i.sortFn=n),i},_e=({columns:n,data:i,tableOnMobile:a=!1,breakpoint:o=`default`,sorting:s,onSortingChange:c,renderMobileCard:l,getRowId:d,caption:f,ariaLabel:p,loading:m=!1,error:h,emptyState:_=`Нет данных`,stickyHeader:v=!1,maxHeight:y,className:b=``,onRowClick:x,pagination:S=!1,pageSize:C=30,visibleColumnIds:w})=>{let[T,E]=(0,t.useState)([]),[D,O]=(0,t.useState)(0),k=s??T,A=k.map(e=>`${e.id}:${e.desc?`desc`:`asc`}`).join(`|`),j=Number.isFinite(C)&&C>0?Math.floor(C):30,M=(0,t.useMemo)(()=>{if(w===void 0)return n;let e=new Set(w);return n.filter(t=>e.has(t.id))},[n,w]),N=(0,t.useMemo)(()=>M.length===0?`Должна быть видима хотя бы одна колонка`:ce(M,i),[i,M]),P=(0,t.useMemo)(()=>M.map(ge),[M]),F=M.some(e=>oe(e)!==void 0),I=(0,r.useTable)({features:ae,columns:P,data:i,state:{sorting:k},onSortingChange:e=>{let t=typeof e==`function`?e(k):e;s===void 0&&E(t),O(0),c?.(t)},getRowId:d}),L=I.getRowModel().rows,R=S?Math.max(1,Math.ceil(L.length/j)):1,z=Math.min(D,R-1),B=(0,t.useMemo)(()=>S?L.slice(z*j,(z+1)*j):L,[j,S,z,L]),ee=(0,t.useMemo)(()=>M.filter(e=>e.enableSorting??e.dataType!==`custom`).map(e=>({id:e.id,label:typeof e.header==`string`?e.header:e.id})),[M]),V=(0,t.useMemo)(()=>se(z,R),[R,z]),te=[Y.root,o===`wide`?Y.wide:Y.default,a?Y.tableOnMobile:``,b].filter(Boolean).join(` `),U=N??h,W=S&&!m&&!U&&L.length>j,G=z*j+1,K=Math.min((z+1)*j,L.length);return(0,t.useEffect)(()=>{O(0)},[i,j,S,A]),(0,t.useEffect)(()=>{D>=R&&O(R-1)},[R,D]),(0,e.jsxs)(`section`,{className:te,"aria-busy":m,children:[!a&&!m&&!U&&B.length>0&&ee.length>0&&(0,e.jsx)(ie,{className:Y.mobileSort,options:ee,value:k[0]?{id:k[0].id,direction:k[0].desc?`desc`:`asc`}:null,onChange:e=>I.setSorting([{id:e.id,desc:e.direction===`desc`}])}),(0,e.jsx)(`div`,{className:Y.tableWrap,style:{maxHeight:y},children:(0,e.jsxs)(`table`,{className:Y.table,"aria-label":p,children:[f&&(0,e.jsx)(`caption`,{children:f}),F&&(0,e.jsx)(`colgroup`,{children:M.map(t=>(0,e.jsx)(`col`,{style:oe(t)},t.id))}),(0,e.jsx)(`thead`,{className:v?Y.sticky:``,children:I.getHeaderGroups().map(t=>(0,e.jsx)(`tr`,{children:t.headers.map(t=>{let n=t.column.getIsSorted(),r=t.column.getCanSort(),i=t.column.getToggleSortingHandler();return(0,e.jsx)(`th`,{scope:`col`,"aria-sort":n===`asc`?`ascending`:n===`desc`?`descending`:`none`,style:oe(M.find(e=>e.id===t.column.id)),children:(0,e.jsxs)(`button`,{type:`button`,className:Y.sortButton,disabled:!r,onClick:i,children:[(0,e.jsx)(I.FlexRender,{header:t}),(0,e.jsx)(g,{name:n===`asc`?`IconSortAscending`:n===`desc`?`IconSortDescending`:`IconSort`,width:16,height:16})]})},t.id)})},t.id))}),(0,e.jsx)(`tbody`,{children:m?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{colSpan:M.length,children:(0,e.jsx)(H,{lines:3})})}):U?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:Y.state,colSpan:M.length,children:U})}):B.length===0?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:Y.state,colSpan:M.length,children:_})}):B.map(t=>(0,e.jsx)(`tr`,{className:x?Y.clickableRow:void 0,onClick:()=>x?.(t.original),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),x?.(t.original))},tabIndex:x?0:void 0,role:x?`button`:void 0,children:t.getAllCells().map(t=>(0,e.jsx)(`td`,{style:oe(M.find(e=>e.id===t.column.id)),children:(0,e.jsx)(I.FlexRender,{cell:t})},t.id))},t.id))})]})}),!a&&(0,e.jsx)(`div`,{className:Y.cards,role:`list`,"aria-label":p??f,children:m?(0,e.jsx)(H,{lines:4}):U?(0,e.jsx)(`div`,{className:Y.state,children:U}):B.length===0?(0,e.jsx)(`div`,{className:Y.state,children:_}):B.map(t=>{if(l)return(0,e.jsx)(`div`,{role:`listitem`,children:l({row:t.original,columns:M})},t.id);let n=M.filter(e=>!e.mobile?.hideOnMobile).sort((e,t)=>(e.mobile?.mobileOrder??0)-(t.mobile?.mobileOrder??0)),r=n.find(e=>e.mobile?.primary)??n.find(e=>e.mobile?.mobileVariant!==`actions`),i=e=>le(e.accessor,t.original),a=e=>e.mobile?.renderMobile?.(t.original,i(e))??e.cell?.(t.original,i(e))??String(i(e)??``);return(0,e.jsxs)(`article`,{role:`listitem`,className:Y.card,children:[(0,e.jsx)(`h3`,{children:r?a(r):`Строка ${t.index+1}`}),(0,e.jsx)(`dl`,{children:n.filter(e=>e!==r&&e.mobile?.mobileVariant!==`actions`).map(t=>(0,e.jsxs)(`div`,{className:t.mobile?.mobileSpan===2?Y.spanTwo:``,children:[(0,e.jsx)(`dt`,{children:t.mobile?.mobileLabel??t.header}),(0,e.jsx)(`dd`,{children:a(t)})]},t.id))}),n.filter(e=>e.mobile?.mobileVariant===`actions`).map(t=>(0,e.jsx)(`footer`,{children:a(t)},t.id))]},t.id)})}),W&&(0,e.jsxs)(`nav`,{className:Y.pagination,"aria-label":`Пагинация таблицы`,children:[(0,e.jsxs)(`span`,{className:Y.paginationRange,"aria-live":`polite`,children:[G,`–`,K,` из `,L.length]}),(0,e.jsxs)(`div`,{className:Y.paginationControls,children:[(0,e.jsxs)(u,{variant:`empty`,size:`md`,disabled:z===0,"aria-label":`Предыдущая страница`,onClick:()=>{O(e=>Math.max(0,e-1))},children:[(0,e.jsx)(g,{name:`IconChevron`,width:18,height:18,className:Y.previousIcon}),(0,e.jsx)(`span`,{className:Y.paginationButtonLabel,children:`Назад`})]}),(0,e.jsx)(`div`,{className:Y.pageNumbers,children:V.map(t=>typeof t==`number`?(0,e.jsx)(u,{variant:t===z?`secondary`:`empty`,size:`md`,className:Y.pageButton,"aria-label":`Перейти на страницу ${t+1}`,"aria-current":t===z?`page`:void 0,onClick:()=>{O(t)},children:t+1},t):(0,e.jsx)(`span`,{className:Y.ellipsis,"aria-hidden":`true`,children:`…`},t))}),(0,e.jsxs)(u,{variant:`empty`,size:`md`,disabled:z===R-1,"aria-label":`Следующая страница`,onClick:()=>{O(e=>Math.min(R-1,e+1))},children:[(0,e.jsx)(`span`,{className:Y.paginationButtonLabel,children:`Вперёд`}),(0,e.jsx)(g,{name:`IconChevron`,width:18,height:18,className:Y.nextIcon})]})]})]})]})},ve=8,ye=6,be=120,xe=e=>{if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e);if(Number.isFinite(t))return t}return 1/0},Se=({options:r,value:i,onChange:a,placeholder:o=`Выберите опции`,disabled:s=!1,stringWhileDisabled:c=!1,label:l,error:u,size:d=`md`,required:p=!1,hint:m,className:h=``,name:_,id:v,closeOnSelect:y=!1,needMark:b=!0,maxMenuHeight:x})=>{let S=(0,t.useId)(),C=v??`ds-dropdown-multiple-${_??S}`,w=`${C}-listbox`,[T,E]=(0,t.useState)(!1),[D,O]=(0,t.useState)(null),k=(0,t.useRef)(null),A=(0,t.useRef)(null),j=(0,t.useRef)(null),M=(0,t.useRef)([]),N=(0,t.useMemo)(()=>r.filter(e=>i.includes(e.value)),[r,i]).map(e=>e.label).join(`, `),P=m?`${C}-hint`:void 0,F=u?`${C}-error`:void 0,I=[P,F].filter(Boolean).join(` `)||void 0,L=s&&c,R=(0,t.useCallback)(()=>{let e=A.current,t=j.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerHeight-n.bottom-ve,a=n.top-ve,o=i<r.height&&a>i,s=Math.max(be,o?a:i),c=window.innerWidth-n.width-ve;O({top:o?Math.max(ve,n.top-r.height-ye):n.bottom+ye,left:Math.max(ve,Math.min(n.left,c)),width:n.width,maxHeight:Math.min(s,xe(x))})},[x]);(0,t.useLayoutEffect)(()=>{if(!T){O(null);return}return R(),window.addEventListener(`resize`,R),window.addEventListener(`scroll`,R,!0),()=>{window.removeEventListener(`resize`,R),window.removeEventListener(`scroll`,R,!0)}},[T,r.length,R]),(0,t.useEffect)(()=>{if(!T)return;let e=e=>{let t=e.target;!k.current?.contains(t)&&!j.current?.contains(t)&&E(!1)},t=e=>{e.key===`Escape`&&(E(!1),A.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[T]);let z=(e,t)=>{let n=q(r,e,t);n!==-1&&(M.current[n]?.focus(),M.current[n]?.scrollIntoView({block:`nearest`}))},B=e=>{if(e.disabled)return;let t=i.includes(e.value)?i.filter(t=>t!==e.value):[...i,e.value];a?.(t,r.filter(e=>t.includes(e.value))),y&&(E(!1),A.current?.focus())},ee=T?(0,e.jsx)(`ul`,{ref:j,id:w,className:U.menu,role:`listbox`,"aria-label":l,"aria-multiselectable":`true`,style:D?{position:`fixed`,top:D.top,left:D.left,width:D.width,maxHeight:D.maxHeight}:{position:`fixed`,top:0,left:0,visibility:`hidden`,maxHeight:0},children:r.map((t,n)=>{let a=i.includes(t.value);return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{M.current[n]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:[U[d],U.option,a?U.selected:``].filter(Boolean).join(` `),onClick:()=>B(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;z(n+t,t)}if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;z(e.key===`Home`?0:r.length-1,t)}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),B(t)),e.key===`Tab`&&E(!1)},children:[(0,e.jsx)(`span`,{children:t.label}),a&&b&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:k,className:[U.wrapper,u?U.errorState:``,h].filter(Boolean).join(` `),children:[l&&(0,e.jsx)(f,{htmlFor:L?void 0:C,required:p,disabled:s,children:l}),(0,e.jsx)(`div`,{className:U.container,children:L?(0,e.jsx)(`div`,{id:C,className:`${U.disabledText} ${U[d]}`,"aria-describedby":I,children:N||o}):(0,e.jsxs)(`button`,{ref:A,id:C,type:`button`,name:_,className:`${U.trigger} ${U[d]}`,disabled:s,"aria-haspopup":`listbox`,"aria-expanded":T,"aria-controls":w,"aria-describedby":I,"aria-invalid":!!u,onClick:()=>E(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),E(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>z(e.key===`ArrowDown`?0:r.length-1,t))}},children:[(0,e.jsx)(`span`,{className:`${N?U.value:U.placeholder} ${U[d]}`,children:N||o}),(0,e.jsx)(`span`,{className:[U.chevron,T?U.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]})}),T&&(0,n.createPortal)(ee,document.body),m&&!u&&(0,e.jsx)(`span`,{id:P,className:U.message,children:m}),u&&(0,e.jsx)(`span`,{id:F,className:U.error,children:u})]})},Ce={wrapper:`_wrapper_nptih_1`,control:`_control_nptih_3`,input:`_input_nptih_7`,disabledText:`_disabledText_nptih_7`,sm:`_sm_nptih_51`,md:`_md_nptih_67`,lg:`_lg_nptih_83`,inputError:`_inputError_nptih_99`,trailingAction:`_trailingAction_nptih_101`},we=({value:n,onChange:r,type:i=`text`,placeholder:a=``,disabled:o=!1,readOnly:s=!1,stringWhileDisabled:c=!1,label:l,error:u,hint:d,className:m=``,name:h,id:_,size:v=`md`,clearable:y=!0,required:b=!1,selectTextOnFocus:x=!1,isPassword:S=!1,passwordVisibleLabel:C=`Скрыть пароль`,passwordHiddenLabel:w=`Показать пароль`,onFocus:T,...E})=>{let D=(0,t.useId)(),O=_??`ds-input-${h??D}`,k=(0,t.useRef)(null),[A,j]=(0,t.useState)(!1),M=d?`${O}-hint`:void 0,N=u?`${O}-error`:void 0,P=String(n??``),F=[M,N].filter(Boolean).join(` `)||void 0,I=S?A?`text`:`password`:i;return(0,t.useEffect)(()=>{S||j(!1)},[S]),(0,e.jsxs)(`div`,{className:`${Ce.wrapper} ${m}`,children:[l&&(0,e.jsx)(f,{htmlFor:O,required:b,disabled:o,children:l}),o&&c?(0,e.jsx)(`div`,{id:O,className:Ce.disabledText,"aria-describedby":F,children:P||a}):(0,e.jsxs)(`div`,{className:Ce.control,children:[(0,e.jsx)(`input`,{ref:k,id:O,name:h,type:I,value:P,placeholder:a,disabled:o,readOnly:s,required:b,"aria-invalid":!!u,"aria-describedby":F,className:`${Ce.input} ${Ce[v]} ${u?Ce.inputError:``}`,onChange:e=>{if(i===`number`&&!S){let t=e.target.value===``?``:Number(e.target.value);r?.(t,e);return}r?.(e.target.value,e)},onFocus:e=>{x&&e.currentTarget.value&&e.currentTarget.select(),T?.(e)},...E}),S&&(0,e.jsx)(`button`,{type:`button`,className:Ce.trailingAction,disabled:o,"aria-label":A?C:w,"aria-pressed":A,onClick:()=>j(e=>!e),children:(0,e.jsx)(g,{name:A?`IconEyeOff`:`IconEye`,width:20,height:20})}),!S&&y&&P&&!o&&!s&&(0,e.jsx)(`button`,{type:`button`,className:Ce.trailingAction,"aria-label":`Очистить поле`,onClick:()=>{let e=k.current;e&&((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus())},children:(0,e.jsx)(g,{name:`IconCross`,width:20,height:20})})]}),d&&!u&&(0,e.jsx)(p,{id:M,children:d}),u&&(0,e.jsx)(p,{id:N,variant:`error`,children:u})]})},Te=(e,t)=>{let n=t.trim().toLocaleLowerCase();return n?e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.value.toLocaleLowerCase().includes(n)):e},Ee=(e,t,n)=>{if(!e.length)return-1;for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},X={wrapper:`_wrapper_13nh5_1`,control:`_control_13nh5_5`,inputHost:`_inputHost_13nh5_9`,sm:`_sm_13nh5_25`,md:`_md_13nh5_41`,lg:`_lg_13nh5_55`,errorState:`_errorState_13nh5_69`,disabledText:`_disabledText_13nh5_77`,chevron:`_chevron_13nh5_119`,chevronOpen:`_chevronOpen_13nh5_143`,menu:`_menu_13nh5_147`,option:`_option_13nh5_175`,empty:`_empty_13nh5_175`,selected:`_selected_13nh5_219`,active:`_active_13nh5_219`,visuallyHidden:`_visuallyHidden_13nh5_231`},De=8,Oe=6,ke=5,Ae={sm:20,md:30,lg:40},je=({options:r,value:i,onChange:a,placeholder:o=`Начните вводить`,noResultsText:s=`Ничего не найдено`,disabled:c=!1,readOnly:l=!1,stringWhileDisabled:u=!1,label:d,error:m,hint:h,size:_=`md`,required:v=!1,className:y=``,name:b,id:x,needMark:S=!0})=>{let C=(0,t.useId)(),w=x??`ds-search-dropdown-${b??C}`,T=`${w}-listbox`,E=`${w}-status`,D=h?`${w}-hint`:void 0,O=m?`${w}-error`:void 0,k=[E,D,O].filter(Boolean).join(` `),A=(0,t.useRef)(null),j=(0,t.useRef)(null),M=(0,t.useRef)([]),[N,P]=(0,t.useState)(!1),[F,I]=(0,t.useState)(``),[L,R]=(0,t.useState)(-1),[z,B]=(0,t.useState)(null),ee=(0,t.useMemo)(()=>r.find(e=>e.value===i),[r,i]),V=(0,t.useMemo)(()=>Te(r,F),[r,F]),te=c&&u,H=L>=0?V[L]:void 0;(0,t.useEffect)(()=>I(ee?.label??``),[ee?.label,i]);let U=(0,t.useCallback)(()=>A.current?.querySelector(`input`)??null,[]),W=(0,t.useCallback)((e,t)=>Ee(V,e,t),[V]),G=(0,t.useCallback)(e=>{R(e),!(e<0)&&requestAnimationFrame(()=>M.current[e]?.scrollIntoView({block:`nearest`}))},[]),K=(0,t.useCallback)(()=>{let e=U();if(!e)return;let t=e.getBoundingClientRect(),n=Math.max(1,Math.min(V.length,ke))*Ae[_]+2,r=window.innerHeight-t.bottom-De,i=t.top-De,a=r<n&&i>r,o=a?i:r,s=Math.max(Ae[_]+2,Math.min(n,o)),c=window.innerWidth-t.width-De,l=Math.max(De,Math.min(t.left,c)),u=a?Math.max(De,t.top-s-Oe):t.bottom+Oe;B({top:u,left:l,width:t.width,maxHeight:s})},[V.length,U,_]);(0,t.useLayoutEffect)(()=>{if(!N){B(null);return}return K(),window.addEventListener(`resize`,K),window.addEventListener(`scroll`,K,!0),()=>{window.removeEventListener(`resize`,K),window.removeEventListener(`scroll`,K,!0)}},[N,K]),(0,t.useEffect)(()=>{if(!N)return;let e=e=>{let t=e.target;!A.current?.contains(t)&&!j.current?.contains(t)&&(P(!1),R(-1))};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[N]);let q=()=>{c||l||(P(!0),R(W(0,1)))},J=e=>{e.disabled||(I(e.label),P(!1),R(-1),a?.(e.value,e),U()?.focus())},ne=N?(0,e.jsx)(`ul`,{ref:j,id:T,className:X.menu,role:`listbox`,"aria-label":d,style:z?{top:z.top,left:z.left,width:z.width,maxHeight:z.maxHeight}:{top:0,left:0,visibility:`hidden`,maxHeight:0},children:V.length===0?(0,e.jsx)(`li`,{className:`${X.empty} ${X[_]}`,children:s}):V.map((t,n)=>{let r=t.value===i,a=n===L;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{M.current[n]=e},id:`${w}-option-${n}`,type:`button`,role:`option`,tabIndex:-1,disabled:t.disabled,"aria-disabled":t.disabled,"aria-selected":r,className:[X.option,X[_],r?X.selected:``,a?X.active:``].filter(Boolean).join(` `),onPointerMove:()=>{t.disabled||R(n)},onClick:()=>J(t),children:[(0,e.jsx)(`span`,{children:t.label}),r&&S&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:A,className:[X.wrapper,m?X.errorState:``,y].filter(Boolean).join(` `),children:[d&&(0,e.jsx)(f,{htmlFor:te?void 0:w,required:v,disabled:c,children:d}),te?(0,e.jsx)(`div`,{className:`${X.disabledText} ${X[_]}`,children:ee?.label??o}):(0,e.jsxs)(`div`,{className:X.control,children:[(0,e.jsx)(we,{id:w,name:b,value:F,placeholder:o,disabled:c,readOnly:l,required:v,size:_,clearable:!1,autoComplete:`off`,className:`${X.inputHost} ${X[_]}`,onFocus:q,onChange:e=>{let t=String(e),n=Te(r,t);I(t),P(!0),R(Ee(n,0,1))},role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":N,"aria-controls":T,"aria-activedescendant":H?`${w}-option-${L}`:void 0,"aria-invalid":!!m,"aria-describedby":k,onClick:q,onKeyDown:e=>{if(!(c||l)){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1,n=L>=0?L+t:t===1?0:V.length-1;P(!0),G(W(n,t))}else if(e.key===`Home`||e.key===`End`){if(!N)return;e.preventDefault();let t=e.key===`Home`?1:-1;G(W(e.key===`Home`?0:V.length-1,t))}else e.key===`Enter`&&N&&H?(e.preventDefault(),J(H)):e.key===`Escape`&&N?(e.preventDefault(),P(!1),R(-1)):e.key===`Tab`&&(P(!1),R(-1))}}}),(0,e.jsx)(`span`,{className:`${X.chevron} ${N?X.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]}),N&&typeof document<`u`&&(0,n.createPortal)(ne,document.body),(0,e.jsxs)(`span`,{id:E,className:X.visuallyHidden,"aria-live":`polite`,children:[`Найдено вариантов: `,V.length]}),h&&!m&&(0,e.jsx)(p,{id:D,children:h}),m&&(0,e.jsx)(p,{id:O,variant:`error`,children:m})]})},Me={root:`_root_1gjqg_1`,header:`_header_1gjqg_21`,title:`_title_1gjqg_41`,dismiss:`_dismiss_1gjqg_55`,content:`_content_1gjqg_65`},Ne=({title:n,children:r,dismissible:i=!1,onDismiss:a,dismissLabel:o=`Закрыть информационный блок`,headingAs:s=`h3`,className:c=``})=>{let l=`ds-info-block-${(0,t.useId)()}`;return(0,e.jsxs)(`section`,{className:`${Me.root} ${c}`,"aria-labelledby":l,children:[(0,e.jsxs)(`header`,{className:Me.header,children:[(0,e.jsx)(s,{id:l,className:Me.title,children:n}),i&&(0,e.jsx)(u,{className:Me.dismiss,variant:`empty`,onClick:a,"aria-label":o,children:(0,e.jsx)(g,{name:`IconCross`,width:20,height:20})})]}),(0,e.jsx)(`div`,{className:Me.content,children:r})]})},Pe={wrapper:`_wrapper_1o3hg_1`,input:`_input_1o3hg_21`,switch:`_switch_1o3hg_35`,thumb:`_thumb_1o3hg_67`,label:`_label_1o3hg_113`,disabled:`_disabled_1o3hg_125`},Fe=({checked:n,onChange:r,label:i,disabled:a=!1,readOnly:o=!1,className:s=``,name:c,id:l,value:u})=>{let d=(0,t.useId)(),f=l??`ds-radio-button-${c??d}`;return(0,e.jsxs)(`label`,{htmlFor:f,className:`${Pe.wrapper} ${a?Pe.disabled:``} ${s}`,children:[(0,e.jsx)(`input`,{id:f,className:Pe.input,type:`checkbox`,role:`switch`,name:c,value:u,checked:n,disabled:a,"aria-readonly":o||void 0,onChange:e=>{o||r?.(e.target.checked,e)}}),(0,e.jsx)(`span`,{className:Pe.switch,"aria-hidden":`true`,children:(0,e.jsx)(`span`,{className:Pe.thumb})}),i&&(0,e.jsx)(`span`,{className:Pe.label,children:i})]})},Ie={root:`_root_1vmtf_1`,grid:`_grid_1vmtf_3`,actions:`_actions_1vmtf_5`},Le=({filters:t,values:n,onChange:r,onApply:i,onReset:a,applyMode:o=`instant`,loading:s=!1,disabled:c=!1,className:l=``})=>{let d=(e,t)=>{let a={...n,[e]:t};r?.(a,e),o===`instant`&&i?.(a)};return(0,e.jsxs)(`section`,{className:`${Ie.root} ${l}`,"aria-label":`Фильтры`,"aria-busy":s,children:[(0,e.jsx)(`div`,{className:Ie.grid,children:t.filter(e=>!e.hidden).map(t=>{let r=c||s||t.disabled,i=n[t.id];if(t.type===`input`){let n={label:t.label,hint:t.hint,placeholder:t.placeholder,disabled:r};return t.inputType===`number`?(0,e.jsx)(we,{...n,type:`number`,value:i??``,onChange:e=>d(t.id,e)},t.id):(0,e.jsx)(we,{...n,type:`text`,value:String(i??``),onChange:e=>d(t.id,e)},t.id)}if(t.type===`dropdown`)return(0,e.jsx)(ne,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:String(i??``),disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`multiple`)return(0,e.jsx)(Se,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:Array.isArray(i)?i:[],disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`checkbox`)return(0,e.jsx)(v,{label:t.label,hint:t.hint,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`radio`)return(0,e.jsx)(Fe,{label:t.label,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);let a=i&&typeof i==`object`&&!Array.isArray(i)?i:{from:null,to:null};return(0,e.jsx)(V,{hint:t.hint,mode:t.mode,min:t.min,max:t.max,value:a,disabled:r,onDraftChange:e=>d(t.id,e)},t.id)})}),(a||o===`manual`)&&(0,e.jsxs)(`div`,{className:Ie.actions,children:[a&&(0,e.jsx)(u,{variant:`destructiveOutline`,disabled:c||s,onClick:a,children:`Сбросить`}),o===`manual`&&(0,e.jsx)(u,{isLoading:s,disabled:c,onClick:()=>i?.(n),children:`Применить`})]})]})},Z={wrapper:`_wrapper_8w6xl_1`,dropzone:`_dropzone_8w6xl_3`,dragActive:`_dragActive_8w6xl_5`,disabled:`_disabled_8w6xl_7`,error:`_error_8w6xl_9`,nativeInput:`_nativeInput_8w6xl_11`,empty:`_empty_8w6xl_13`,uploadIcon:`_uploadIcon_8w6xl_15`,files:`_files_8w6xl_17`,file:`_file_8w6xl_17`,fileName:`_fileName_8w6xl_21`,fileSize:`_fileSize_8w6xl_23`},Re=e=>`${e.name}:${e.size}:${e.lastModified}`,ze=e=>e<1024?`${e} Б`:e<1048576?`${(e/1024).toFixed(1)} КБ`:`${(e/1024/1024).toFixed(1)} МБ`,Be=(e,t)=>!t||t.split(`,`).map(e=>e.trim().toLowerCase()).some(t=>t.startsWith(`.`)?e.name.toLowerCase().endsWith(t):t.endsWith(`/*`)?e.type.startsWith(t.slice(0,-1)):e.type.toLowerCase()===t),Ve=({value:n,onChange:r,multiple:i=!1,accept:a,maxSize:o,maxFiles:s,label:c,hint:l,error:d,required:m=!1,disabled:h=!1,readOnly:_=!1,name:v,id:y,className:b=``,dropLabel:x=`Перетащите файлы в эту область`,browseLabel:S=`Выбрать файлы`,addMoreLabel:C=`Добавить ещё`,onReject:w})=>{let T=(0,t.useId)(),E=y??`ds-file-input-${v??T}`,D=(0,t.useRef)(null),O=(0,t.useRef)(0),[k,A]=(0,t.useState)(!1),j=l?`${E}-hint`:void 0,M=d?`${E}-error`:void 0,N=[j,M].filter(Boolean).join(` `)||void 0,P=!h&&!_,F=e=>{let t=[],c=new Set(n.map(Re)),l=e.filter(e=>Be(e,a)?o!==void 0&&e.size>o?(t.push({file:e,reason:`maxSize`}),!1):!c.has(Re(e))&&(c.add(Re(e)),!0):(t.push({file:e,reason:`accept`}),!1)),u=i?s:1,d=i?[...n,...l]:l.slice(-1);u!==void 0&&d.length>u&&(d.slice(u).forEach(e=>t.push({file:e,reason:`maxFiles`})),d=d.slice(0,u)),t.length&&w?.(t),l.length&&r?.(d),D.current&&(D.current.value=``)};return(0,e.jsxs)(`div`,{className:`${Z.wrapper} ${b}`,children:[c&&(0,e.jsx)(f,{htmlFor:E,required:m,disabled:h,children:c}),(0,e.jsxs)(`div`,{className:`${Z.dropzone} ${k?Z.dragActive:``} ${h?Z.disabled:``} ${d?Z.error:``}`,onDragEnter:e=>{e.preventDefault(),P&&++O.current===1&&A(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:e=>{e.preventDefault(),--O.current<=0&&(O.current=0,A(!1))},onDrop:e=>{e.preventDefault(),O.current=0,A(!1),P&&F(Array.from(e.dataTransfer.files))},children:[(0,e.jsx)(`input`,{ref:D,id:E,name:v,className:Z.nativeInput,type:`file`,multiple:i,accept:a,required:m&&n.length===0,disabled:!P,"aria-describedby":N,"aria-invalid":!!d,onChange:e=>F(Array.from(e.target.files??[]))}),n.length?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`ul`,{className:Z.files,"aria-live":`polite`,children:n.map((t,i)=>(0,e.jsxs)(`li`,{className:Z.file,children:[(0,e.jsx)(`span`,{className:Z.fileName,title:t.name,children:t.name}),(0,e.jsx)(`span`,{className:Z.fileSize,children:ze(t.size)}),P&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,"aria-label":`Удалить файл ${t.name}`,onClick:()=>r?.(n.filter((e,t)=>t!==i)),children:(0,e.jsx)(g,{name:`IconCross`,width:16,height:16})})]},Re(t)))}),P&&(i||n.length===0)&&(0,e.jsx)(u,{className:Z.browseButton,size:`sm`,onClick:()=>D.current?.click(),children:C}),P&&!i&&(0,e.jsx)(u,{className:Z.browseButton,size:`sm`,onClick:()=>D.current?.click(),children:S})]}):(0,e.jsxs)(`div`,{className:Z.empty,children:[(0,e.jsx)(`span`,{className:Z.uploadIcon,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconUpload`,width:24,height:24})}),(0,e.jsx)(`strong`,{children:k?`Отпустите файлы здесь`:x}),!k&&P&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`span`,{children:`или`}),(0,e.jsx)(u,{onClick:()=>D.current?.click(),children:S})]})]})]}),l&&!d&&(0,e.jsx)(p,{id:j,children:l}),d&&(0,e.jsx)(p,{id:M,variant:`error`,live:!0,children:d})]})},He={wrapper:`_wrapper_1bwdq_1`,control:`_control_1bwdq_15`,textarea:`_textarea_1bwdq_25`,disabledText:`_disabledText_1bwdq_27`,sm:`_sm_1bwdq_103`,md:`_md_1bwdq_117`,lg:`_lg_1bwdq_131`,autoResize:`_autoResize_1bwdq_145`,manualResize:`_manualResize_1bwdq_155`,textareaError:`_textareaError_1bwdq_163`,clearAction:`_clearAction_1bwdq_171`,messages:`_messages_1bwdq_251`,counter:`_counter_1bwdq_265`},Ue=2;function We(e){let t=window.getComputedStyle(e),n=Number.parseFloat(t.lineHeight);return Number.isFinite(n)?n:Number.parseFloat(t.fontSize)*1.4}function Ge({value:n,onChange:r,placeholder:i=``,disabled:a=!1,readOnly:o=!1,stringWhileDisabled:s=!1,label:c,error:l,hint:u,className:d=``,name:m,id:h,size:_=`md`,clearable:v=!1,required:y=!1,maxLength:b,showCount:x=!1,minRows:S=Ue,maxRows:C,autoResize:w=!0,...T}){let E=(0,t.useId)(),D=h??`ds-textarea-${m??E}`,O=(0,t.useRef)(null),k=u?`${D}-hint`:void 0,A=l?`${D}-error`:void 0,j=x&&b?`${D}-count`:void 0,M=[k,A,j].filter(Boolean).join(` `)||void 0,N=Math.max(1,S),P=C===void 0?void 0:Math.max(N,C),F=(0,t.useCallback)(()=>{let e=O.current;if(!e||!w)return;let t=window.getComputedStyle(e),n=We(e),r=Number.parseFloat(t.paddingTop)+Number.parseFloat(t.paddingBottom)+Number.parseFloat(t.borderTopWidth)+Number.parseFloat(t.borderBottomWidth),i=n*N+r,a=P===void 0?1/0:n*P+r;e.style.height=`auto`;let o=Math.min(Math.max(e.scrollHeight,i),a);e.style.height=`${o}px`,e.style.overflowY=e.scrollHeight>a?`auto`:`hidden`},[w,P,N]);(0,t.useEffect)(()=>{F()},[F,n]),(0,t.useEffect)(()=>{if(!w)return;window.addEventListener(`resize`,F);let e=O.current?.parentElement,t;if(e&&typeof ResizeObserver<`u`){let n=e.getBoundingClientRect().width;t=new ResizeObserver(([e])=>{!e||e.contentRect.width===n||(n=e.contentRect.width,F())}),t.observe(e)}return()=>{window.removeEventListener(`resize`,F),t?.disconnect()}},[w,F]);let I=e=>{r?.(e.target.value,e),F()},L=()=>{let e=O.current;e&&((Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus(),F())},R={"--ds-textarea-min-rows":N};return(0,e.jsxs)(`div`,{className:`${He.wrapper} ${d}`,children:[c&&(0,e.jsx)(f,{htmlFor:D,required:y,disabled:a,children:c}),a&&s?(0,e.jsx)(`div`,{id:D,className:`${He.disabledText} ${He[_]}`,style:R,"aria-describedby":M,children:n||i}):(0,e.jsxs)(`div`,{className:He.control,children:[(0,e.jsx)(`textarea`,{ref:O,id:D,name:m,value:n,placeholder:i,disabled:a,readOnly:o,required:y,maxLength:b,rows:N,style:R,"aria-invalid":!!l,"aria-describedby":M,className:`${He.textarea} ${He[_]} ${w?He.autoResize:He.manualResize} ${l?He.textareaError:``}`,onChange:I,...T}),v&&n&&!a&&!o&&(0,e.jsx)(`button`,{type:`button`,className:He.clearAction,"aria-label":`Очистить поле`,onClick:L,children:(0,e.jsx)(g,{name:`IconCross`,width:20,height:20})})]}),(u||l||j)&&(0,e.jsxs)(`div`,{className:He.messages,children:[u&&!l&&(0,e.jsx)(p,{id:k,children:u}),l&&(0,e.jsx)(p,{id:A,variant:`error`,children:l}),j&&(0,e.jsxs)(`span`,{id:j,className:He.counter,children:[n.length,` / `,b]})]})]})}var Ke=0,Q=(0,i.create)((e,t)=>({modals:[],openModal:(t,n={},r={})=>{Ke+=1;let i=`ds-modal-${Ke}`;return e(e=>({modals:[...e.modals,{id:i,name:t,payload:n,title:r.title,description:r.description,closeOnEscape:r.closeOnEscape??!0,closeOnBackdrop:r.closeOnBackdrop??!0,onClose:r.onClose}]})),i},closeModal:n=>{let r=t().modals.find(e=>e.id===n);r&&(e(e=>({modals:e.modals.filter(e=>e.id!==n)})),r.onClose?.())},closeTopModal:()=>{let n=t().modals.at(-1);n&&(e(e=>({modals:e.modals.slice(0,-1)})),n.onClose?.())},closeAllModals:()=>{let n=t().modals;n.length&&(e({modals:[]}),n.forEach(e=>e.onClose?.()))}})),qe=()=>{Q.getState().closeAllModals(),Ke=0},Je={layer:`_layer_d4mga_1`,backdrop:`_backdrop_d4mga_3`,panel:`_panel_d4mga_5`,header:`_header_d4mga_9`,title:`_title_d4mga_11`,description:`_description_d4mga_13`,content:`_content_d4mga_15`,close:`_close_d4mga_19`},Ye=`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,Xe=(0,t.createContext)({});function Ze(e){if(e.key!==`Tab`)return;let t=Array.from(e.currentTarget.querySelectorAll(Ye));if(!t.length){e.preventDefault();return}let n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}var Qe=({children:n,title:r,description:i,modalId:a,closeLabel:o=`Закрыть модальное окно`,className:s=``,role:c=`dialog`})=>{let l=(0,t.useContext)(Xe),d=r??l.title,f=i??l.description,p=(0,t.useId)(),m=(0,t.useId)(),h=(0,t.useRef)(null),_=Q(e=>e.closeModal),v=d!=null,y=f!=null;return(0,t.useEffect)(()=>{let e=document.activeElement,t=h.current;return(t?.querySelector(Ye)??t)?.focus(),()=>e?.focus()},[]),(0,e.jsxs)(`div`,{ref:h,className:`${Je.panel} ${s}`,role:c,"aria-modal":`true`,"aria-labelledby":v?p:void 0,"aria-describedby":y?m:void 0,tabIndex:-1,onKeyDown:Ze,children:[(v||o)&&(0,e.jsxs)(`header`,{className:Je.header,children:[v&&(0,e.jsx)(`h2`,{id:p,className:Je.title,children:d}),(0,e.jsx)(u,{className:Je.close,variant:`empty`,size:`sm`,"aria-label":o,onClick:()=>_(a),children:(0,e.jsx)(g,{name:`IconCross`,width:24,height:24})})]}),y&&(0,e.jsx)(`p`,{id:m,className:Je.description,children:f}),(0,e.jsx)(`div`,{className:Je.content,children:n})]})},$e=({registry:r})=>{let i=Q(e=>e.modals),a=Q(e=>e.closeModal),o=Q(e=>e.closeAllModals);return(0,t.useEffect)(()=>{let e=e=>{if(e.key!==`Escape`)return;let t=Q.getState().modals.at(-1);t?.closeOnEscape&&a(t.id)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),(0,t.useEffect)(()=>{i.forEach(e=>{r[e.name]||a(e.id)})},[a,i,r]),!i.length||typeof document>`u`?null:(0,n.createPortal)((0,e.jsx)(`div`,{className:Je.layer,"aria-label":`Модальные окна`,children:i.map((t,n)=>{let s=r[t.name];return s?(0,e.jsx)(`div`,{className:Je.backdrop,"aria-hidden":n!==i.length-1||void 0,inert:n!==i.length-1||void 0,onMouseDown:e=>{e.target===e.currentTarget&&t.closeOnBackdrop&&a(t.id)},children:(0,e.jsx)(Xe.Provider,{value:{title:t.title??t.payload.title,description:t.description??t.payload.description},children:(0,e.jsx)(s,{...t.payload,modalId:t.id,close:()=>a(t.id),closeAll:o})})},t.id):null})}),document.body)},et=({registry:n,children:r,lockBodyScroll:i=!0})=>{let a=Q(e=>e.modals.length);return(0,t.useEffect)(()=>{if(!i||a===0)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[i,a]),(0,e.jsxs)(e.Fragment,{children:[r,(0,e.jsx)($e,{registry:n})]})},tt=e=>e,nt={message:`_message_1vtru_1`,actions:`_actions_1vtru_3`},rt=new Map,it=0,at=({modalId:t,close:n,title:r=`Подтверждение`,message:i=`Продолжить действие?`,confirmLabel:a=`Подтвердить`,cancelLabel:o=`Отмена`,tone:s=`default`,requestId:c})=>{let l=e=>{rt.get(c)?.(e),rt.delete(c),n()};return(0,e.jsxs)(Qe,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:nt.message,children:i}),(0,e.jsxs)(`div`,{className:nt.actions,children:[(0,e.jsx)(u,{variant:`outline`,onClick:()=>l(!1),children:o}),(0,e.jsx)(u,{variant:s===`danger`?`destructive`:`primary`,onClick:()=>l(!0),children:a})]})]})},ot=({modalId:t,close:n,title:r=`Ошибка`,message:i,closeLabel:a=`Закрыть`})=>(0,e.jsxs)(Qe,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:nt.message,children:i}),(0,e.jsx)(`div`,{className:nt.actions,children:(0,e.jsx)(u,{onClick:n,children:a})})]}),st=tt({ConfirmModal:at,ErrorModal:ot}),ct=()=>{let e=Q(e=>e.openModal);return(t={})=>new Promise(n=>{it+=1;let r=`confirm-${it}`;rt.set(r,n),e(`ConfirmModal`,{...t,requestId:r},{closeOnEscape:!1,onClose:()=>{rt.get(r)?.(!1),rt.delete(r)}})})},lt=e=>e instanceof Error?e.message:typeof e==`string`?e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`?e.message:`Произошла неизвестная ошибка`,ut=()=>{let e=Q(e=>e.openModal);return{showError:(t,n)=>e(`ErrorModal`,{title:n,message:lt(t)})}},dt=(0,i.create)(()=>({})),ft=(0,i.create)(()=>({})),pt=()=>{let e=Q(e=>e.modals),n=Q(e=>e.openModal),r=Q(e=>e.closeModal),i=Q(e=>e.closeTopModal),a=Q(e=>e.closeAllModals),o=(0,t.useCallback)((e,t={},r)=>n(e,t,r),[n]),s=(0,t.useCallback)(t=>e.some(e=>e.name===t),[e]);return(0,t.useMemo)(()=>({openModal:o,closeModal:r,closeTopModal:i,closeAllModals:a,isOpen:s,count:e.length}),[a,r,i,s,e.length,o])},mt={wrapper:`_wrapper_1qbyz_1`,container:`_container_1qbyz_15`,inner:`_inner_1qbyz_35`,cube:`_cube_1qbyz_53`,jump:`_jump_1qbyz_1`,cube__inner:`_cube__inner_1qbyz_67`,morph:`_morph_1qbyz_1`},ht=()=>(0,e.jsx)(`div`,{className:mt.wrapper,children:(0,e.jsx)(`div`,{className:mt.container,children:(0,e.jsxs)(`div`,{className:mt.inner,children:[(0,e.jsx)(`div`,{className:mt.cube,children:(0,e.jsx)(`div`,{className:mt.cube__inner})}),(0,e.jsx)(`div`,{className:mt.cube,children:(0,e.jsx)(`div`,{className:mt.cube__inner})}),(0,e.jsx)(`div`,{className:mt.cube,children:(0,e.jsx)(`div`,{className:mt.cube__inner})})]})})}),gt={viewport:`_viewport_joq18_1`,"top-right":`_top-right_joq18_3`,"top-left":`_top-left_joq18_5`,"bottom-right":`_bottom-right_joq18_7`,"bottom-left":`_bottom-left_joq18_9`,toast:`_toast_joq18_11`,body:`_body_joq18_13`,info:`_info_joq18_15`,success:`_success_joq18_17`,warning:`_warning_joq18_19`,error:`_error_joq18_21`},_t={info:{name:`IconInfoCircle`,color:`var(--color-primary)`},success:{name:`IconSuccessCircle`,color:`var(--color-success)`},warning:{name:`IconWarning`,color:`var(--color-warning)`},error:{name:`IconWarning`,color:`var(--color-error)`}},vt=({toast:n,onClose:r})=>{let[i,a]=(0,t.useState)(!1),o=(0,t.useRef)(n.duration),s=(0,t.useRef)(Date.now());return(0,t.useEffect)(()=>{if(i||n.duration<=0)return;s.current=Date.now();let e=setTimeout(()=>r(n.id),o.current);return()=>{clearTimeout(e),o.current=Math.max(0,o.current-(Date.now()-s.current))}},[r,i,n.duration,n.id]),(0,e.jsxs)(`article`,{className:`${gt.toast} ${gt[n.variant]}`,role:n.variant===`error`?`alert`:`status`,"aria-live":n.variant===`error`?`assertive`:`polite`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),children:[(0,e.jsx)(`div`,{children:(0,e.jsx)(g,{..._t[n.variant],width:24,height:24})}),(0,e.jsxs)(`div`,{className:gt.body,children:[n.title&&(0,e.jsx)(`strong`,{children:n.title}),(0,e.jsx)(`div`,{children:n.message}),n.action&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,onClick:()=>{n.action?.onClick(),(n.action?.dismissOnClick??!0)&&r(n.id)},children:n.action.label})]}),n.closable&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,"aria-label":`Закрыть уведомление`,onClick:()=>r(n.id),children:(0,e.jsx)(g,{name:`IconCross`,width:24,height:24})})]})},yt=0,bt=(0,i.create)(e=>({toasts:[],showToast:t=>{yt+=1;let n=`ds-toast-${yt}`;return e(e=>({toasts:[...e.toasts,{variant:`info`,duration:5e3,closable:!0,...t,id:n}]})),n},removeToast:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)})),clearToasts:()=>e({toasts:[]})})),xt=()=>bt.setState({toasts:[]}),St=({position:t=`top-right`})=>{let n=bt(e=>e.toasts),r=bt(e=>e.removeToast);return(0,e.jsx)(`div`,{className:`${gt.viewport} ${gt[t]}`,"aria-label":`Уведомления`,children:n.map(t=>(0,e.jsx)(vt,{toast:t,onClose:r},t.id))})},Ct=()=>{let e=bt(e=>e.showToast),n=bt(e=>e.removeToast),r=bt(e=>e.clearToasts),i=(0,t.useCallback)(t=>e({...t,variant:`info`}),[e]),a=(0,t.useCallback)(t=>e({...t,variant:`success`}),[e]),o=(0,t.useCallback)(t=>e({...t,variant:`warning`}),[e]),s=(0,t.useCallback)(t=>e({...t,variant:`error`}),[e]);return(0,t.useMemo)(()=>({showToast:e,infoToast:i,successToast:a,warningToast:o,errorToast:s,removeToast:n,clearToasts:r}),[r,s,i,n,e,a,o])},wt={root:`_root_s9o0g_1`,tooltip:`_tooltip_s9o0g_3`,"ds-tooltip-in":`_ds-tooltip-in_s9o0g_1`,top:`_top_s9o0g_5`,bottom:`_bottom_s9o0g_7`,left:`_left_s9o0g_9`,right:`_right_s9o0g_11`},Tt=({content:n,children:r,placement:i=`top`,delay:a=450,disabled:o=!1,maxWidth:s=280,className:c=``})=>{let l=(0,t.useId)(),[u,d]=(0,t.useState)(!1),f=(0,t.useRef)(null),p=()=>{o||!n||(f.current=setTimeout(()=>d(!0),a))},m=()=>{f.current&&clearTimeout(f.current),d(!1)};if((0,t.useEffect)(()=>{let e=e=>{e.key===`Escape`&&m()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),f.current&&clearTimeout(f.current)}},[]),!(0,t.isValidElement)(r))return r;let h=(0,t.cloneElement)(r,{"aria-describedby":u?l:void 0,onMouseEnter:p,onMouseLeave:m,onFocus:p,onBlur:m});return(0,e.jsxs)(`span`,{className:`${wt.root} ${c}`,onPointerDown:u?m:p,children:[h,u&&(0,e.jsx)(`span`,{id:l,role:`tooltip`,className:`${wt.tooltip} ${wt[i]}`,style:{maxWidth:s},children:n})]})},Et=e=>{if(!Number.isFinite(e)||e<0)return`00:00`;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=`${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`;return n?`${n}:${a}`:a},$={root:`_root_1oxvl_1`,frame:`_frame_1oxvl_35`,video:`_video_1oxvl_65`,overlay:`_overlay_1oxvl_79`,state:`_state_1oxvl_81`,buffering:`_buffering_1oxvl_83`,loaderViewport:`_loaderViewport_1oxvl_143`,loaderScale:`_loaderScale_1oxvl_155`,stateIcon:`_stateIcon_1oxvl_169`,empty:`_empty_1oxvl_201`,error:`_error_1oxvl_211`,replay:`_replay_1oxvl_223`,controlsLayer:`_controlsLayer_1oxvl_259`,controlsVisible:`_controlsVisible_1oxvl_285`,controls:`_controls_1oxvl_259`,controlGroup:`_controlGroup_1oxvl_309`,controlButton:`_controlButton_1oxvl_335`,settingsAction:`_settingsAction_1oxvl_367`,timeline:`_timeline_1oxvl_385`,volume:`_volume_1oxvl_387`,settings:`_settings_1oxvl_367`,playButton:`_playButton_1oxvl_401`,volumeGroup:`_volumeGroup_1oxvl_415`,timelineGroup:`_timelineGroup_1oxvl_439`,time:`_time_1oxvl_385`,settingsActionLabel:`_settingsActionLabel_1oxvl_677`,caption:`_caption_1oxvl_689`,fullscreen:`_fullscreen_1oxvl_703`},Dt=2500,Ot=5,kt=.05,At=[.5,.75,1,1.25,1.5,2],jt=({sources:n,tracks:r=[],title:i,aspectRatio:a=`16 / 9`,objectFit:o=`contain`,loading:s=!1,error:l,fallback:d,className:f=``,controls:p=!0,playsInline:m=!0,...h})=>{let _=(0,t.useRef)(null),v=(0,t.useRef)(null),y=(0,t.useRef)(null),b=(0,t.useRef)(void 0),[x,S]=(0,t.useState)(!1),[C,w]=(0,t.useState)(n.length>0),[T,E]=(0,t.useState)(!1),[D,O]=(0,t.useState)(!1),[k,A]=(0,t.useState)(!1),[j,M]=(0,t.useState)(0),[N,P]=(0,t.useState)(0),[F,I]=(0,t.useState)(0),[L,R]=(0,t.useState)(1),[z,B]=(0,t.useState)(!!h.muted),[ee,V]=(0,t.useState)(1),[te,H]=(0,t.useState)(!!h.loop),[U,W]=(0,t.useState)(-1),[G,K]=(0,t.useState)(!1),[q,J]=(0,t.useState)(!0),[ne,re]=(0,t.useState)(!1),[ie,Y]=(0,t.useState)(!1),ae=n.map(({src:e,type:t})=>`${e}:${t??``}`).join(`|`),oe=r.map((e,t)=>({track:e,index:t})).filter(({track:e})=>e.kind===`captions`||e.kind===`subtitles`),se=l??(x?`Не удалось воспроизвести видео`:void 0),ce=s||C&&!se&&n.length>0,le=!ce&&!se&&n.length===0,ue=typeof document<`u`&&`pictureInPictureEnabled`in document&&document.pictureInPictureEnabled,de=(0,t.useCallback)(()=>{J(!0),window.clearTimeout(b.current),D&&!G&&(b.current=window.setTimeout(()=>J(!1),Dt))},[D,G]);(0,t.useEffect)(()=>{S(!1),w(n.length>0),E(!1),O(!1),A(!1),M(0),P(0),I(0)},[ae,n.length]),(0,t.useEffect)(()=>(de(),()=>window.clearTimeout(b.current)),[de]),(0,t.useEffect)(()=>{let e=()=>re(document.fullscreenElement===v.current),t=()=>Y(document.pictureInPictureElement===y.current);return document.addEventListener(`fullscreenchange`,e),document.addEventListener(`enterpictureinpicture`,t),document.addEventListener(`leavepictureinpicture`,t),()=>{document.removeEventListener(`fullscreenchange`,e),document.removeEventListener(`enterpictureinpicture`,t),document.removeEventListener(`leavepictureinpicture`,t)}},[]),(0,t.useEffect)(()=>{if(!G)return;let e=e=>{_.current?.contains(e.target)||K(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[G]);let fe=async()=>{let e=y.current;if(!(!e||se||ce)){if(e.paused||e.ended){e.ended&&(e.currentTime=0);try{await e.play()}catch{S(!0)}}else e.pause()}},pe=()=>{let e=y.current;e&&(e.muted=!e.muted)},me=e=>{let t=y.current;t&&(t.volume=Math.min(1,Math.max(0,e)),t.muted=t.volume===0)},he=e=>{let t=y.current;!t||!N||(t.currentTime=Math.min(N,Math.max(0,e)),M(t.currentTime))},ge=async()=>{if(v.current)try{document.fullscreenElement?await document.exitFullscreen():await v.current.requestFullscreen()}catch{re(!1)}},_e=async()=>{let e=y.current;if(!(!e||!ue))try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{Y(!1)}},ve=e=>{let t=y.current;t&&(Array.from(t.textTracks).forEach((t,n)=>{t.mode=n===e?`showing`:`disabled`}),W(e))},ye=e=>{let t=e.target;if(/^(INPUT|SELECT|BUTTON)$/.test(t.tagName))return;let n=e.key.toLowerCase();n===` `||n===`k`?(e.preventDefault(),fe()):n===`m`?(e.preventDefault(),pe()):n===`f`?(e.preventDefault(),ge()):n===`c`&&oe.length?(e.preventDefault(),ve(U===-1?oe[0].index:-1)):e.key===`ArrowLeft`||e.key===`ArrowRight`?(e.preventDefault(),he(j+(e.key===`ArrowRight`?Ot:-5))):e.key===`ArrowUp`||e.key===`ArrowDown`?(e.preventDefault(),me(L+(e.key===`ArrowUp`?kt:-.05))):e.key===`Escape`&&K(!1),de()},be=()=>{let e=y.current;S(!1),w(!0),e?.load()},xe={"--video-progress":`${N?j/N*100:0}%`,"--video-buffered":`${F*100}%`};return(0,e.jsxs)(`figure`,{ref:_,className:`${$.root} ${f}`,onKeyDown:ye,children:[(0,e.jsxs)(`div`,{ref:v,className:`${$.frame} ${ne?$.fullscreen:``}`,style:{aspectRatio:a},"aria-busy":ce||void 0,tabIndex:p&&n.length?0:void 0,onPointerMove:de,onPointerDown:de,onFocusCapture:de,onMouseLeave:()=>{D&&!G&&J(!1)},children:[n.length>0&&(0,e.jsxs)(`video`,{...h,ref:y,"aria-label":i,controls:!1,playsInline:m,loop:te,className:$.video,style:{objectFit:o},onClick:e=>{h.onClick?.(e),fe()},onDoubleClick:e=>{h.onDoubleClick?.(e),ge()},onLoadStart:e=>{w(!0),h.onLoadStart?.(e)},onLoadedMetadata:e=>{P(e.currentTarget.duration||0);let t=oe.find(({track:e})=>e.default);ve(t?.index??-1),h.onLoadedMetadata?.(e)},onDurationChange:e=>{P(e.currentTarget.duration||0),h.onDurationChange?.(e)},onTimeUpdate:e=>{M(e.currentTarget.currentTime),h.onTimeUpdate?.(e)},onProgress:e=>{let t=e.currentTarget;t.duration&&t.buffered.length&&I(t.buffered.end(t.buffered.length-1)/t.duration),h.onProgress?.(e)},onLoadedData:e=>{w(!1),E(!1),h.onLoadedData?.(e)},onCanPlay:e=>{w(!1),E(!1),h.onCanPlay?.(e)},onWaiting:e=>{E(!0),h.onWaiting?.(e)},onPlaying:e=>{O(!0),A(!1),E(!1),h.onPlaying?.(e)},onPlay:e=>{O(!0),h.onPlay?.(e)},onPause:e=>{O(!1),h.onPause?.(e)},onEnded:e=>{O(!1),A(!0),J(!0),h.onEnded?.(e)},onVolumeChange:e=>{R(e.currentTarget.volume),B(e.currentTarget.muted),h.onVolumeChange?.(e)},onRateChange:e=>{V(e.currentTarget.playbackRate),h.onRateChange?.(e)},onError:e=>{w(!1),E(!1),S(!0),h.onError?.(e)},children:[n.map(t=>(0,e.jsx)(`source`,{...t},`${t.src}-${t.type}`)),r.map(t=>(0,e.jsx)(`track`,{...t},`${t.src}-${t.srcLang}`))]}),ce&&(0,e.jsxs)(`div`,{className:$.overlay,role:`status`,"aria-live":`polite`,children:[(0,e.jsx)(`div`,{className:$.loaderViewport,"aria-hidden":`true`,children:(0,e.jsx)(`div`,{className:$.loaderScale,children:(0,e.jsx)(ht,{})})}),(0,e.jsx)(`span`,{children:`Загрузка видео`})]}),!ce&&T&&!se&&(0,e.jsx)(`div`,{className:$.buffering,role:`status`,"aria-label":`Буферизация видео`,children:(0,e.jsx)(c,{variant:`empty`})}),le&&(0,e.jsxs)(`div`,{className:`${$.state} ${$.empty}`,role:`status`,children:[(0,e.jsx)(g,{name:`IconInfoCircle`,className:$.stateIcon,width:40,height:40}),(0,e.jsx)(`strong`,{children:`Видео отсутствует`}),d??(0,e.jsx)(`span`,{children:`Источник видео не указан`})]}),!ce&&se&&(0,e.jsxs)(`div`,{className:`${$.state} ${$.error}`,role:`alert`,children:[(0,e.jsx)(g,{name:`IconWarning`,className:$.stateIcon,width:40,height:40}),d??(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`strong`,{children:`Видео недоступно`}),(0,e.jsx)(`span`,{children:se})]}),n.length>0&&(0,e.jsx)(u,{size:`sm`,variant:`secondary`,onClick:be,children:`Повторить`})]}),!ce&&!se&&k&&(0,e.jsx)(`button`,{type:`button`,className:$.replay,"aria-label":`Воспроизвести заново`,onClick:()=>void fe(),children:(0,e.jsx)(g,{name:`IconReplay`,width:28,height:28})}),p&&n.length>0&&!ce&&!se&&(0,e.jsxs)(`div`,{className:`${$.controlsLayer} ${q||!D?$.controlsVisible:``}`,onClick:e=>e.stopPropagation(),children:[G&&(0,e.jsxs)(`div`,{className:$.settings,role:`dialog`,"aria-label":`Настройки видео`,children:[(0,e.jsxs)(`label`,{children:[(0,e.jsx)(`span`,{children:`Скорость`}),(0,e.jsx)(`select`,{value:ee,onChange:e=>{let t=Number(e.target.value);y.current&&(y.current.playbackRate=t)},children:At.map(t=>(0,e.jsxs)(`option`,{value:t,children:[t,`×`]},t))})]}),oe.length>0&&(0,e.jsxs)(`label`,{children:[(0,e.jsx)(`span`,{children:`Субтитры`}),(0,e.jsxs)(`select`,{value:U,onChange:e=>ve(Number(e.target.value)),children:[(0,e.jsx)(`option`,{value:-1,children:`Выключены`}),oe.map(({track:t,index:n})=>(0,e.jsx)(`option`,{value:n,children:t.label},`${t.srcLang}-${t.label}`))]})]}),(0,e.jsxs)(`button`,{type:`button`,className:$.settingsAction,"aria-pressed":te,onClick:()=>H(e=>!e),children:[(0,e.jsx)(`span`,{children:`Повтор`}),(0,e.jsx)(`span`,{children:te?`Вкл.`:`Выкл.`})]}),ue&&(0,e.jsx)(`button`,{type:`button`,className:$.settingsAction,"aria-pressed":ie,onClick:()=>void _e(),children:(0,e.jsxs)(`span`,{className:$.settingsActionLabel,children:[(0,e.jsx)(g,{name:`IconPictureInPicture`,width:18,height:18}),`Картинка в картинке`]})})]}),(0,e.jsxs)(`div`,{className:$.controls,children:[(0,e.jsx)(`div`,{className:$.controlGroup,children:(0,e.jsx)(`button`,{type:`button`,className:`${$.controlButton} ${$.playButton}`,"aria-label":D?`Пауза`:`Воспроизвести`,title:D?`Пауза (K)`:`Воспроизвести (K)`,onClick:()=>void fe(),children:(0,e.jsx)(g,{name:D?`IconPause`:`IconPlay`,width:24,height:24})})}),(0,e.jsxs)(`div`,{className:`${$.controlGroup} ${$.volumeGroup}`,children:[(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":z?`Включить звук`:`Выключить звук`,"aria-pressed":z,title:`Звук (M)`,onClick:pe,children:(0,e.jsx)(g,{name:z||L===0?`IconVolumeMuted`:`IconVolume`,width:22,height:22})}),(0,e.jsx)(`input`,{className:$.volume,type:`range`,min:0,max:1,step:.05,value:z?0:L,"aria-label":`Громкость`,"aria-valuetext":`${Math.round((z?0:L)*100)}%`,onChange:e=>me(Number(e.target.value))})]}),(0,e.jsxs)(`div`,{className:`${$.controlGroup} ${$.timelineGroup}`,children:[(0,e.jsx)(`span`,{className:$.time,children:Et(j)}),(0,e.jsx)(`input`,{className:$.timeline,style:xe,type:`range`,min:0,max:N||0,step:.01,value:Math.min(j,N||0),"aria-label":`Позиция воспроизведения`,"aria-valuetext":`${Et(j)} из ${Et(N)}`,onChange:e=>he(Number(e.target.value))}),(0,e.jsx)(`span`,{className:$.time,children:Et(N)})]}),(0,e.jsxs)(`div`,{className:$.controlGroup,children:[(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":`Настройки`,"aria-expanded":G,title:`Настройки`,onClick:()=>K(e=>!e),children:(0,e.jsx)(g,{name:`IconSettings`,width:22,height:22})}),(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":ne?`Выйти из полноэкранного режима`:`Полноэкранный режим`,title:`Полноэкранный режим (F)`,onClick:()=>void ge(),children:(0,e.jsx)(g,{name:ne?`IconFullscreenExit`:`IconFullscreen`,width:22,height:22})})]})]})]})]}),(0,e.jsx)(`figcaption`,{className:$.caption,children:i})]})},Mt={root:`_root_1tdda_1`,trigger:`_trigger_1tdda_15`,heading:`_heading_1tdda_41`,title:`_title_1tdda_51`,subtitle:`_subtitle_1tdda_59`,icon:`_icon_1tdda_69`,open:`_open_1tdda_91`,content:`_content_1tdda_99`,contentInner:`_contentInner_1tdda_119`},Nt=(e,t,n,r=16)=>{if(t>Math.max(0,n-r*2)){let t=e-r;return Math.abs(t)<=1?{alignment:`none`,delta:0}:{alignment:`start`,delta:t}}let i=e+t,a=n-r;return i>a?{alignment:`end`,delta:i-a}:e<r?{alignment:`start`,delta:e-r}:{alignment:`none`,delta:0}},Pt=({title:n,subtitle:r,children:i,defaultOpen:a=!1,open:o,onOpenChange:s,autoScrollOnOpen:c=!0,scrollOffset:l=16,className:u=``})=>{let d=(0,t.useId)(),[f,p]=(0,t.useState)(a),m=o??f,h=(0,t.useRef)(null),_=(0,t.useRef)(null),v=(0,t.useRef)(m);return(0,t.useEffect)(()=>{let e=v.current;if(v.current=m,!m||e||!c)return;let t=h.current,n=_.current;if(!t||!n||typeof window>`u`)return;let r=!1,i=()=>{if(r)return;r=!0;let e=t.getBoundingClientRect(),n=Nt(e.top,e.height,window.innerHeight,l);if(n.alignment===`none`)return;let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;window.scrollBy({top:n.delta,behavior:i?`auto`:`smooth`})},a=e=>{e.target===n&&e.propertyName===`grid-template-rows`&&i()};n.addEventListener(`transitionend`,a);let o=window.setTimeout(i,280);return()=>{n.removeEventListener(`transitionend`,a),window.clearTimeout(o)}},[c,m,l]),(0,e.jsxs)(`section`,{ref:h,className:`${Mt.root} ${m?Mt.open:``} ${u}`,children:[(0,e.jsxs)(`button`,{type:`button`,className:Mt.trigger,"aria-expanded":m,"aria-controls":d,onClick:()=>{let e=!m;o===void 0&&p(e),s?.(e)},children:[(0,e.jsxs)(`span`,{className:Mt.heading,children:[(0,e.jsx)(`span`,{className:Mt.title,children:n}),r&&(0,e.jsx)(`span`,{className:Mt.subtitle,children:r})]}),(0,e.jsx)(`span`,{className:Mt.icon,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]}),(0,e.jsx)(`div`,{ref:_,id:d,className:Mt.content,"aria-hidden":!m,children:(0,e.jsx)(`div`,{className:Mt.contentInner,children:i})})]})},Ft=({children:e,containerId:r=`overlay-root`})=>{let[i,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let e=document.getElementById(r);if(e){a(e);return}let t=document.createElement(`div`);return t.id=r,document.body.appendChild(t),a(t),()=>{t.childElementCount===0&&t.parentElement&&t.remove()}},[r]),i?(0,n.createPortal)(e,i):null};exports.ConfirmModal=at,exports.DSAccordion=Pt,exports.DSBadge=o,exports.DSButton=u,exports.DSCheckbox=v,exports.DSDataTable=_e,exports.DSDateRange=V,exports.DSDateTimePicker=z,exports.DSDropDown=ne,exports.DSDropDownMultiple=Se,exports.DSFieldLabel=f,exports.DSFieldMessage=p,exports.DSFileInput=Ve,exports.DSFilters=Le,exports.DSIcon=g,exports.DSInfoBlock=Ne,exports.DSInput=we,exports.DSLoader=c,exports.DSModal=$e,exports.DSModalFrame=Qe,exports.DSPageLoader=ht,exports.DSPortal=Ft,exports.DSRadioButton=Fe,exports.DSSearchDropDown=je,exports.DSSkeleton=H,exports.DSSort=ie,exports.DSTextarea=Ge,exports.DSToast=vt,exports.DSToastProvider=St,exports.DSTooltip=Tt,exports.DSVideoPlayerFrame=jt,exports.ErrorModal=ot,exports.ModalSystemProvider=et,exports.builtInModalRegistry=st,exports.defineModalRegistry=tt,exports.formatDateInputValue=T,exports.formatDateTimeLocalValue=j,exports.getDSAccordionScrollTarget=Nt,exports.getDSDataTableColumnStyle=oe,exports.getDSDataTablePaginationItems=se,exports.getErrorMessage=lt,exports.getNextEnabledOptionIndex=q,exports.isValidDateInputPrefix=O,exports.isValidDateRange=ee,exports.maskDateInputValue=E,exports.parseDateInputValue=k,exports.parseDateTimeLocalValue=M,exports.resetModalStore=qe,exports.resetToastStore=xt,exports.useConfirmModal=ct,exports.useConfirmModalStore=dt,exports.useErrorModal=ut,exports.useErrorModalStore=ft,exports.useModals=pt,exports.useModalsStore=Q,exports.useToast=Ct,exports.useToastStore=bt,exports.validateDSDataTableData=ce;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),r=require("@tanstack/react-table"),i=require("zustand");var a={badge:`_badge_1xyff_1`,sm:`_sm_1xyff_29`,md:`_md_1xyff_39`,neutral:`_neutral_1xyff_49`,info:`_info_1xyff_61`,success:`_success_1xyff_73`,warning:`_warning_1xyff_85`,error:`_error_1xyff_97`,dot:`_dot_1xyff_109`,icon:`_icon_1xyff_125`,label:`_label_1xyff_135`},o=({children:t,variant:n=`neutral`,size:r=`md`,dot:i=!1,icon:o,className:s=``})=>(0,e.jsxs)(`span`,{className:`${a.badge} ${a[n]} ${a[r]} ${s}`,children:[i&&(0,e.jsx)(`span`,{className:a.dot,"aria-hidden":`true`}),o&&(0,e.jsx)(`span`,{className:a.icon,"aria-hidden":`true`,children:o}),(0,e.jsx)(`span`,{className:a.label,children:t})]}),s={container:`_container_18tg4_1`,inner:`_inner_18tg4_21`,line:`_line_18tg4_39`,primary:`_primary_18tg4_57`,secondary:`_secondary_18tg4_65`,outline:`_outline_18tg4_73`,ghost:`_ghost_18tg4_81`,empty:`_empty_18tg4_89`,destructive:`_destructive_18tg4_97`,destructiveOutline:`_destructiveOutline_18tg4_105`,grow:`_grow_18tg4_1`},c=({variant:t=`primary`})=>(0,e.jsx)(`div`,{className:`${s.container} ${s[t]}`,children:(0,e.jsxs)(`div`,{className:`${s.inner} ${s[t]}`,children:[(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`}),(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`}),(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`}),(0,e.jsx)(`div`,{className:`${s.line} ${s[t]}`})]})}),l={button:`_button_cfuv9_1`,sm:`_sm_cfuv9_59`,md:`_md_cfuv9_73`,lg:`_lg_cfuv9_87`,primary:`_primary_cfuv9_101`,secondary:`_secondary_cfuv9_115`,outline:`_outline_cfuv9_129`,ghost:`_ghost_cfuv9_143`,empty:`_empty_cfuv9_157`,destructive:`_destructive_cfuv9_171`,destructiveOutline:`_destructiveOutline_cfuv9_183`},u=(0,t.forwardRef)(({children:t,variant:n=`primary`,size:r=`md`,isLoading:i=!1,disabled:a,type:o=`button`,className:s=``,...u},d)=>(0,e.jsx)(`button`,{ref:d,className:`${l.button} ${l[n]} ${l[r]} ${s}`,disabled:a||i,"aria-busy":i||void 0,...u,type:o,children:i?(0,e.jsx)(c,{variant:n}):t}));u.displayName=`DSButton`;var d={label:`_label_1o819_1`,required:`_required_1o819_23`,error:`_error_1o819_25`,optional:`_optional_1o819_33`,hint:`_hint_1o819_35`,disabled:`_disabled_1o819_47`,message:`_message_1o819_55`,success:`_success_1o819_71`},f=({children:t,required:n=!1,optionalText:r,disabled:i=!1,className:a=``,...o})=>(0,e.jsxs)(`label`,{className:`${d.label} ${i?d.disabled:``} ${a}`,...o,children:[(0,e.jsx)(`span`,{children:t}),n&&(0,e.jsx)(`span`,{className:d.required,"aria-hidden":`true`,children:`*`}),r&&(0,e.jsx)(`span`,{className:d.optional,children:r})]}),p=({children:t,variant:n=`hint`,id:r,live:i=!1,className:a=``})=>(0,e.jsx)(`span`,{id:r,className:`${d.message} ${d[n]} ${a}`,role:i&&n===`error`?`alert`:void 0,"aria-live":i&&n!==`error`?`polite`:void 0,children:t}),m=({width:t=24,height:n=24,color:r,title:i,style:a,children:o,...s})=>(0,e.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:t,height:n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,role:i?`img`:void 0,"aria-hidden":!i||void 0,focusable:`false`,style:r?{...a,color:r}:a,...s,children:[i&&(0,e.jsx)(`title`,{children:i}),o]}),h={IconBasket:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 7h16l-1 13H5L4 7zm3 0V4h10v3`})}),IconCheck:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`m5 12 4 4L19 6`})}),IconChevron:t=>(0,e.jsx)(m,{viewBox:`0 0 20 20`,...t,children:(0,e.jsx)(`path`,{d:`M5 7.5L10 12.5L15 7.5`})}),IconCross:({strokeWidth:t=2,...n})=>(0,e.jsx)(m,{strokeWidth:t,...n,children:(0,e.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})}),IconEdit:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 20h4L19 9l-4-4L4 16v4z`})}),IconErrorCircle:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`m15 9-6 6M9 9l6 6`})]}),IconEye:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`path`,{d:`M3 12s3.5-5 9-5 9 5 9 5-3.5 5-9 5-9-5-9-5Z`}),(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2.5`})]}),IconEyeOff:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M3 3l18 18M10.6 10.7a2 2 0 0 0 2.7 2.7M9.9 4.2A10.7 10.7 0 0 1 12 4c5.5 0 9 5.3 9 5.3a14 14 0 0 1-2.3 2.8M6.6 6.6C4.3 8.1 3 10 3 10s3.5 5 9 5c1 0 2-.2 2.8-.5`})}),IconInfo:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 10v7m0-10v.01`})}),IconInfoCircle:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`M12 16v-4M12 8v.01`})]}),IconMinus:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M5 12h14`})}),IconPause:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M8 5v14M16 5v14`,strokeWidth:`3`})}),IconPictureInPicture:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M3 5h18v14H3V5Zm10 7h6v5h-6v-5Z`})}),IconPlay:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`m8 5 11 7-11 7V5Z`,fill:`currentColor`,stroke:`none`})}),IconReplay:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 7v5h5M5.5 11a7 7 0 1 1 1.3 6.3`})}),IconSettings:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 8.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Zm7.4 5.2.1-1.7-.1-1.7 2-1.5-2-3.4-2.4 1a8 8 0 0 0-2.9-1.7L13.8 2h-3.9l-.4 2.7a8 8 0 0 0-2.8 1.7l-2.5-1-2 3.4 2.1 1.5-.1 1.7.1 1.7-2.1 1.5 2 3.4 2.5-1a8 8 0 0 0 2.8 1.7l.4 2.7h3.9l.3-2.7a8 8 0 0 0 2.9-1.7l2.4 1 2-3.4-2-1.5Z`})}),IconFullscreen:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M9 4H4v5m11-5h5v5M9 20H4v-5m11 5h5v-5`})}),IconFullscreenExit:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 9h5V4m6 5h5V4M4 15h5v5m6-5h5v5`})}),IconCaptions:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M4 6h16v12H4V6Zm7 4a2 2 0 1 0 0 4m7-4a2 2 0 1 0 0 4`})}),IconVolume:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M5 10v4h4l5 4V6l-5 4H5Zm12-1c1.3 1.5 1.3 4.5 0 6m2.5-8.5c3 3 3 8 0 11`})}),IconVolumeMuted:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M5 10v4h4l5 4V6l-5 4H5Zm12 0 4 4m0-4-4 4`})}),IconSort:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M8 17V5m-3 3 3-3 3 3M16 7v12m-3-3 3 3 3-3`})}),IconSortAscending:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 19V5m-5 5 5-5 5 5`})}),IconSortDescending:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 5v14m-5-5 5 5 5-5`})}),IconSuccessCircle:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,e.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),IconUpload:t=>(0,e.jsx)(m,{...t,children:(0,e.jsx)(`path`,{d:`M12 19V5m-5 5 5-5 5 5`})}),IconWarning:t=>(0,e.jsxs)(m,{...t,children:[(0,e.jsx)(`path`,{d:`M12 3.5L21 19H3L12 3.5Z`}),(0,e.jsx)(`path`,{d:`M12 9v4.5M12 16.5v.01`})]})},g=({name:t,...n})=>{let r=h[t];return(0,e.jsx)(r,{...n})},_={wrapper:`_wrapper_1seon_1`,label:`_label_1seon_13`,input:`_input_1seon_35`,control:`_control_1seon_49`,disabled:`_disabled_1seon_95`,controlError:`_controlError_1seon_121`},v=({checked:n,onChange:r,label:i,hint:a,error:o,disabled:s=!1,readOnly:c=!1,className:l=``,name:u,id:d,indeterminate:f=!1,...m})=>{let h=(0,t.useId)(),v=d??`ds-checkbox-${u??h}`,y=(0,t.useRef)(null),b=a?`${v}-hint`:void 0,x=o?`${v}-error`:void 0;return(0,t.useEffect)(()=>{y.current&&(y.current.indeterminate=f&&!n)},[n,f]),(0,e.jsxs)(`div`,{className:`${_.wrapper} ${l}`,children:[(0,e.jsxs)(`label`,{className:`${_.label} ${s?_.disabled:``}`,htmlFor:v,children:[(0,e.jsx)(`input`,{ref:y,id:v,name:u,type:`checkbox`,checked:n,disabled:s,"aria-readonly":c||void 0,"aria-invalid":!!o,"aria-describedby":[b,x].filter(Boolean).join(` `)||void 0,className:_.input,onChange:e=>{c||r?.(e.target.checked,e)},...m}),(0,e.jsxs)(`span`,{className:`${_.control} ${o?_.controlError:``}`,"aria-hidden":`true`,children:[f&&!n&&(0,e.jsx)(g,{name:`IconMinus`,width:16,height:16}),n&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]}),i&&(0,e.jsx)(`span`,{children:i})]}),a&&!o&&(0,e.jsx)(p,{id:b,children:a}),o&&(0,e.jsx)(p,{id:x,variant:`error`,children:o})]})},y={wrapper:`_wrapper_su17c_1`,trigger:`_trigger_su17c_17`,sm:`_sm_su17c_53`,md:`_md_su17c_65`,lg:`_lg_su17c_75`,chevron:`_chevron_su17c_89`,chevronOpen:`_chevronOpen_su17c_115`,nav:`_nav_su17c_127`,day:`_day_su17c_129`,monthSelect:`_monthSelect_su17c_131`,yearInput:`_yearInput_su17c_133`,timeInput:`_timeInput_su17c_135`,dateInput:`_dateInput_su17c_147`,timeValue:`_timeValue_su17c_189`,chevronButton:`_chevronButton_su17c_201`,disabled:`_disabled_su17c_235`,validationTooltip:`_validationTooltip_su17c_249`,"validation-tooltip-lifetime":`_validation-tooltip-lifetime_su17c_1`,value:`_value_su17c_319`,placeholder:`_placeholder_su17c_335`,error:`_error_su17c_343`,panel:`_panel_su17c_351`,calendarHeader:`_calendarHeader_su17c_377`,weekdays:`_weekdays_su17c_467`,days:`_days_su17c_469`,outside:`_outside_su17c_505`,selected:`_selected_su17c_513`,timeLabel:`_timeLabel_su17c_533`,previousMonth:`_previousMonth_su17c_593`,nextMonth:`_nextMonth_su17c_601`},b=[`Пн`,`Вт`,`Ср`,`Чт`,`Пт`,`Сб`,`Вс`],x=[`Январь`,`Февраль`,`Март`,`Апрель`,`Май`,`Июнь`,`Июль`,`Август`,`Сентябрь`,`Октябрь`,`Ноябрь`,`Декабрь`],S=e=>String(e).padStart(2,`0`),C=8,w=`Некорректная дата`,T=e=>e?`${S(e.getDate())}.${S(e.getMonth()+1)}.${e.getFullYear()}`:``,E=e=>{let t=e.replace(/\D/g,``).slice(0,C);return[t.slice(0,2),t.slice(2,4),t.slice(4,8)].filter(Boolean).join(`.`)},D=e=>{if(!e)return!0;let t=Number(e.padEnd(4,`0`));return Number(e.padEnd(4,`9`))>=1800&&t<=2500},O=e=>{if(!/^\d{0,8}$/.test(e))return!1;let t=e.slice(0,2),n=e.slice(2,4),r=e.slice(4,8);return t.length===1&&Number(t)>3||t.length===2&&(Number(t)<1||Number(t)>31)||n.length===1&&Number(n)>1||n.length===2&&(Number(n)<1||Number(n)>12)?!1:D(r)},k=e=>{let t=/^(\d{2})\.(\d{2})\.(\d{4})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2])-1,i=Number(t[3]);if(i<1800||i>2500)return null;let a=new Date(i,r,n,12);return a.getFullYear()!==i||a.getMonth()!==r||a.getDate()!==n?null:a},A=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),j=(e,t)=>{if(!e)return``;let n=`${e.getFullYear()}-${S(e.getMonth()+1)}-${S(e.getDate())}`,r=`${S(e.getHours())}:${S(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n}T${r}`},M=(e,t)=>{if(!e)return null;if(t===`time`){let t=/^(\d{2}):(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]);if(n>23||r>59)return null;let i=new Date;return i.setHours(n,r,0,0),i}if(t===`date`){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2])-1,i=Number(t[3]),a=new Date(n,r,i,12);return a.getFullYear()!==n||a.getMonth()!==r||a.getDate()!==i?null:a}let n=new Date(e);return Number.isNaN(n.getTime())?null:n},N=(e,t)=>{if(!e)return``;let n=`${S(e.getDate())}.${S(e.getMonth()+1)}.${e.getFullYear()}`,r=`${S(e.getHours())}:${S(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n} ${r}`},P=e=>{let t=new Date(e.getFullYear(),e.getMonth(),1),n=(t.getDay()+6)%7,r=new Date(t);return r.setDate(t.getDate()-n),Array.from({length:42},(e,t)=>{let n=new Date(r);return n.setDate(r.getDate()+t),n})},F=(e,t)=>!!(e&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()),I=(e,t,n)=>{let r=A(e).getTime();return!!(t&&r<A(t).getTime()||n&&r>A(n).getTime())},L=8,R=6,z=({value:r,onChange:i,mode:a=`date`,label:o,placeholder:s,hint:c,error:l,disabled:u=!1,readOnly:d=!1,required:m=!1,min:h,max:_,size:v=`md`,id:S,name:D,className:A=``})=>{let z=(0,t.useId)(),B=S??`ds-date-time-${D??z}`,ee=c?`${B}-hint`:void 0,V=l?`${B}-error`:void 0,te=(0,t.useRef)(null),H=(0,t.useRef)(null),U=(0,t.useRef)(null),W=(0,t.useRef)(null),[G,K]=(0,t.useState)(!1),[q,J]=(0,t.useState)(r??new Date),[ne,re]=(0,t.useState)(j(r,`time`)),[ie,Y]=(0,t.useState)(T(r)),[ae,oe]=(0,t.useState)(``),[se,ce]=(0,t.useState)(0),[le,ue]=(0,t.useState)(null),de=(0,t.useMemo)(()=>P(q),[q]),fe=a!==`time`,pe=a!==`date`;(0,t.useEffect)(()=>{r&&J(r),re(j(r,`time`)),Y(T(r))},[r]),(0,t.useEffect)(()=>()=>{W.current&&clearTimeout(W.current)},[]);let me=(0,t.useCallback)(()=>{let e=H.current,t=U.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight-n.bottom-L,o=n.top-L,s=a<r.height&&o>a,c=Math.max(120,s?o:a),l=s?Math.max(L,n.top-r.height-R):n.bottom+R,u=n.left,d=i-r.width-L;ue({top:l,left:Math.max(L,Math.min(u,d)),maxHeight:c})},[]);(0,t.useLayoutEffect)(()=>{if(!G){ue(null);return}return me(),window.addEventListener(`resize`,me),window.addEventListener(`scroll`,me,!0),()=>{window.removeEventListener(`resize`,me),window.removeEventListener(`scroll`,me,!0)}},[G,me,q,ne]),(0,t.useEffect)(()=>{if(!G)return;let e=e=>{let t=e.target,n=te.current?.contains(t),r=U.current?.contains(t);!n&&!r&&K(!1)},t=e=>{e.key===`Escape`&&(K(!1),H.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[G]);let he=e=>{if(I(e,h,_))return;let t=a===`date`?M(j(e,`date`),`date`):new Date(e);t&&(a!==`date`&&t.setHours(r?.getHours()??0,r?.getMinutes()??0,0,0),i?.(t),Y(T(t)),a===`date`&&K(!1))},ge=()=>{oe(w),ce(e=>e+1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{oe(``),W.current=null},3e3)},_e=e=>{let t=e.replace(/\D/g,``).slice(0,C);if(!O(t)){ge();return}let n=E(t);if(Y(n),!t){i?.(null);return}if(t.length<C)return;let o=k(n);if(!o||I(o,h,_)){ge();return}a===`datetime`&&o.setHours(r?.getHours()??0,r?.getMinutes()??0,0,0),i?.(o),J(o),K(!1),requestAnimationFrame(()=>H.current?.blur())},ve=e=>{if(re(e),!e){i?.(null);return}let t=M(e,`time`);if(!t)return;let n=new Date(a===`datetime`?r??q:new Date);n.setHours(t.getHours(),t.getMinutes(),0,0),!(h&&n<h||_&&n>_)&&i?.(n)},ye=s??(a===`date`?`ДД.ММ.ГГГГ`:a===`time`?`ЧЧ:ММ`:`ДД.ММ.ГГГГ ЧЧ:ММ`),be=ae?`${B}-validation`:void 0,xe=[ee,V,be].filter(Boolean).join(` `)||void 0,Se=G&&!d?(0,e.jsxs)(`div`,{ref:U,className:y.panel,role:`dialog`,"aria-label":o??ye,style:le?{top:le.top,left:le.left,maxHeight:le.maxHeight}:{visibility:`hidden`,top:0,left:0},children:[fe&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(`div`,{className:y.calendarHeader,children:[(0,e.jsx)(`button`,{type:`button`,className:y.nav,"aria-label":`Предыдущий месяц`,onClick:()=>J(new Date(q.getFullYear(),q.getMonth()-1,1)),children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20,className:y.previousMonth})}),(0,e.jsx)(`select`,{className:y.monthSelect,"aria-label":`Месяц`,value:q.getMonth(),onChange:e=>J(new Date(q.getFullYear(),Number(e.target.value),1)),children:x.map((t,n)=>(0,e.jsx)(`option`,{value:n,children:t},t))}),(0,e.jsx)(`input`,{className:y.yearInput,type:`number`,"aria-label":`Год`,value:q.getFullYear(),onChange:e=>J(new Date(Number(e.target.value),q.getMonth(),1))}),(0,e.jsx)(`button`,{type:`button`,className:y.nav,"aria-label":`Следующий месяц`,onClick:()=>J(new Date(q.getFullYear(),q.getMonth()+1,1)),children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20,className:y.nextMonth})})]}),(0,e.jsx)(`div`,{className:y.weekdays,children:b.map(t=>(0,e.jsx)(`span`,{children:t},t))}),(0,e.jsx)(`div`,{className:y.days,children:de.map(t=>{let n=F(r,t);return(0,e.jsx)(`button`,{type:`button`,className:`${y.day} ${t.getMonth()===q.getMonth()?``:y.outside} ${n?y.selected:``}`,disabled:I(t,h,_),"aria-pressed":n,onClick:()=>he(t),children:t.getDate()},t.toISOString())})})]}),pe&&(0,e.jsxs)(`label`,{className:y.timeLabel,children:[(0,e.jsx)(`span`,{children:`Время`}),(0,e.jsx)(`input`,{className:y.timeInput,type:`time`,value:ne,onChange:e=>ve(e.target.value)})]})]}):null;return(0,e.jsxs)(`div`,{ref:te,className:`${y.wrapper} ${A}`,children:[o&&(0,e.jsx)(f,{htmlFor:B,required:m,disabled:u,children:o}),fe?(0,e.jsxs)(`div`,{className:`${y.trigger} ${y[v]} ${l?y.error:``} ${u?y.disabled:``}`,children:[(0,e.jsx)(`input`,{ref:H,id:B,name:D,className:y.dateInput,value:ie,placeholder:ye.split(` `)[0],inputMode:`numeric`,autoComplete:`off`,maxLength:10,disabled:u,readOnly:d,"aria-expanded":G,"aria-haspopup":`dialog`,"aria-describedby":xe,"aria-invalid":!!(l||ae)||void 0,onFocus:()=>{d||K(!0)},onClick:()=>{d||K(!0)},onChange:e=>_e(e.target.value)}),a===`datetime`&&ne&&(0,e.jsx)(`span`,{className:y.timeValue,children:ne}),(0,e.jsx)(`button`,{type:`button`,className:y.chevronButton,disabled:u||d,"aria-label":G?`Закрыть календарь`:`Открыть календарь`,tabIndex:-1,onMouseDown:e=>e.preventDefault(),onClick:()=>{K(e=>!e),H.current?.focus()},children:(0,e.jsx)(`span`,{className:`${y.chevron} ${Se?y.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})})]}):(0,e.jsxs)(`button`,{ref:H,id:B,name:D,type:`button`,className:`${y.trigger} ${y[v]} ${l?y.error:``}`,disabled:u,"aria-readonly":d||void 0,"aria-expanded":G,"aria-haspopup":`dialog`,"aria-describedby":xe,onClick:()=>{d||K(e=>!e)},children:[(0,e.jsx)(`span`,{className:r?y.value:y.placeholder,children:N(r,a)||ye}),(0,e.jsx)(`span`,{className:`${y.chevron} ${Se?y.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]}),ae&&(0,e.jsx)(`span`,{id:be,className:y.validationTooltip,role:`status`,"aria-live":`polite`,children:ae},se),Se&&(0,n.createPortal)(Se,document.body),c&&!l&&(0,e.jsx)(p,{id:ee,children:c}),l&&(0,e.jsx)(p,{id:V,variant:`error`,children:l})]})},B={root:`_root_19vq2_1`,range:`_range_19vq2_21`},ee=e=>!!(e.from&&e.to&&e.from.getTime()<=e.to.getTime()),V=({value:t,onChange:n,onDraftChange:r,mode:i=`date`,fromLabel:a=`От`,toLabel:o=`До`,hint:s,error:c,min:l,max:u,disabled:d=!1,readOnly:f=!1,required:m=!1,className:h=``})=>{let g=c??(t.from&&t.to&&t.from>t.to?`Дата «От» не может быть позже даты «До»`:void 0),_=e=>{r?.(e),ee(e)&&n?.(e)};return(0,e.jsxs)(`fieldset`,{className:`${B.root} ${h}`,disabled:d,children:[(0,e.jsxs)(`div`,{className:B.range,children:[(0,e.jsx)(z,{value:t.from,mode:i===`datetime`?`datetime`:i,label:a,min:l,max:t.to??u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,from:e})}),(0,e.jsx)(z,{value:t.to,mode:i===`datetime`?`datetime`:i,label:o,min:t.from??l,max:u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,to:e})})]}),s&&!g&&(0,e.jsx)(p,{children:s})]})},te={group:`_group_10ug0_1`,skeleton:`_skeleton_10ug0_15`,text:`_text_10ug0_27`,rectangular:`_rectangular_10ug0_37`,circular:`_circular_10ug0_47`,animated:`_animated_10ug0_59`,"ds-skeleton":`_ds-skeleton_10ug0_1`},H=({variant:t=`text`,width:n=`100%`,height:r,lines:i=1,animated:a=!0,className:o=``})=>(0,e.jsx)(`span`,{className:`${te.group} ${o}`,"aria-hidden":`true`,children:Array.from({length:Math.max(1,i)},(o,s)=>(0,e.jsx)(`span`,{className:`${te.skeleton} ${te[t]} ${a?te.animated:``}`,style:{width:s===i-1&&i>1?`70%`:n,height:r}},s))}),U={wrapper:`_wrapper_6g3qd_1`,container:`_container_6g3qd_17`,trigger:`_trigger_6g3qd_25`,disabledText:`_disabledText_6g3qd_27`,sm:`_sm_6g3qd_53`,md:`_md_6g3qd_67`,lg:`_lg_6g3qd_81`,value:`_value_6g3qd_147`,placeholder:`_placeholder_6g3qd_149`,chevron:`_chevron_6g3qd_205`,chevronOpen:`_chevronOpen_6g3qd_231`,menu:`_menu_6g3qd_239`,option:`_option_6g3qd_269`,selected:`_selected_6g3qd_339`,message:`_message_6g3qd_359`,error:`_error_6g3qd_361`,errorState:`_errorState_6g3qd_387`},W=8,G=6,K=120,q=(e,t,n)=>{if(!e.length)return-1;for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},J=e=>{if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e);if(Number.isFinite(t))return t}return 1/0},ne=({options:r,value:i,onChange:a,placeholder:o=`Выберите опцию`,disabled:s=!1,stringWhileDisabled:c=!1,label:l,error:u,size:d=`md`,hint:p,className:m=``,required:h=!1,name:_,id:v,needMark:y=!0,maxMenuHeight:b})=>{let x=(0,t.useId)(),S=v??`ds-dropdown-${_??x}`,C=`${S}-listbox`,[w,T]=(0,t.useState)(!1),[E,D]=(0,t.useState)(null),O=(0,t.useRef)(null),k=(0,t.useRef)(null),A=(0,t.useRef)(null),j=(0,t.useRef)([]),M=(0,t.useMemo)(()=>r.find(e=>e.value===i),[r,i]),N=p?`${S}-hint`:void 0,P=u?`${S}-error`:void 0,F=[N,P].filter(Boolean).join(` `)||void 0,I=s&&c,L=(0,t.useCallback)(()=>{let e=k.current,t=A.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight-n.bottom-W,o=n.top-W,s=a<r.height&&o>a,c=Math.max(K,s?o:a),l=J(b),u=Math.min(c,l),d=n.left,f=i-n.width-W,p=Math.max(W,Math.min(d,f)),m=s?Math.max(W,n.top-r.height-G):n.bottom+G;D({top:m,left:p,width:n.width,maxHeight:u})},[b]);(0,t.useLayoutEffect)(()=>{if(!w){D(null);return}return L(),window.addEventListener(`resize`,L),window.addEventListener(`scroll`,L,!0),()=>{window.removeEventListener(`resize`,L),window.removeEventListener(`scroll`,L,!0)}},[w,L,r.length]),(0,t.useEffect)(()=>{if(!w)return;let e=e=>{let t=e.target,n=O.current?.contains(t),r=A.current?.contains(t);!n&&!r&&T(!1)},t=e=>{e.key===`Escape`&&(T(!1),k.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[w]);let R=(e,t)=>{let n=q(r,e,t);if(n===-1)return;let i=j.current[n];i?.focus(),i?.scrollIntoView({block:`nearest`})},z=e=>{e.disabled||(a?.(e.value,e),T(!1),k.current?.focus())},B=w?(0,e.jsx)(`ul`,{ref:A,id:C,className:U.menu,role:`listbox`,"aria-label":l,style:E?{position:`fixed`,top:E.top,left:E.left,width:E.width,maxHeight:E.maxHeight}:{position:`fixed`,top:0,left:0,visibility:`hidden`,maxHeight:0},children:r.map((t,n)=>{let a=t.value===i;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{j.current[n]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:[U[d],U.option,a?U.selected:``].filter(Boolean).join(` `),onClick:()=>z(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;R(n+t,t)}if(e.key===`Tab`&&T(!1),e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;R(e.key===`Home`?0:r.length-1,t)}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),z(t))},children:[(0,e.jsx)(`span`,{children:t.label}),a&&y&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:O,className:[U.wrapper,u?U.errorState:``,m].filter(Boolean).join(` `),children:[l&&(0,e.jsx)(f,{required:h,disabled:s,htmlFor:I?void 0:S,children:l}),(0,e.jsx)(`div`,{className:U.container,children:I?(0,e.jsx)(`div`,{id:S,className:U.disabledText,"aria-describedby":F,children:M?.label??o}):(0,e.jsxs)(`button`,{ref:k,id:S,type:`button`,name:_,className:`${U.trigger} ${U[d]}`,disabled:s,"aria-haspopup":`listbox`,"aria-expanded":w,"aria-controls":C,"aria-describedby":F,"aria-invalid":!!u,onClick:()=>T(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),T(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>{R(e.key===`ArrowDown`?0:r.length-1,t)})}if(e.key===`Enter`&&w){e.preventDefault();let t=r.findIndex(e=>e.value===i);R(t>=0?t:0,1)}},children:[(0,e.jsx)(`span`,{className:`${M?U.value:U.placeholder}
2
+ ${U[d]}`,children:M?.label??o}),(0,e.jsx)(`span`,{className:[U.chevron,w?U.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]})}),w&&(0,n.createPortal)(B,document.body),p&&!u&&(0,e.jsx)(`span`,{id:N,className:U.message,children:p}),u&&(0,e.jsx)(`span`,{id:P,className:U.error,children:u})]})},re=e=>`${e.id}:${e.direction}`,ie=({options:t,value:n,onChange:r,label:i=`Сортировка`,placeholder:a=`Выберите сортировку`,disabled:o=!1,className:s})=>{let c=t.flatMap(e=>[{value:re({id:e.id,direction:`asc`}),label:e.ascLabel??`${e.label} · по возрастанию`,disabled:e.disabled},{value:re({id:e.id,direction:`desc`}),label:e.descLabel??`${e.label} · по убыванию`,disabled:e.disabled}]);return(0,e.jsx)(ne,{options:c,value:n?re(n):``,label:i,placeholder:a,disabled:o,className:s,onChange:e=>{let t=e.lastIndexOf(`:`);r?.({id:e.slice(0,t),direction:e.slice(t+1)})}})},Y={root:`_root_1jtuu_1`,tableWrap:`_tableWrap_1jtuu_15`,table:`_table_1jtuu_15`,sticky:`_sticky_1jtuu_81`,sortButton:`_sortButton_1jtuu_95`,state:`_state_1jtuu_133`,cards:`_cards_1jtuu_145`,mobileSort:`_mobileSort_1jtuu_145`,card:`_card_1jtuu_145`,spanTwo:`_spanTwo_1jtuu_233`,clickableRow:`_clickableRow_1jtuu_241`,pagination:`_pagination_1jtuu_249`,paginationRange:`_paginationRange_1jtuu_275`,paginationControls:`_paginationControls_1jtuu_287`,pageNumbers:`_pageNumbers_1jtuu_289`,pageButton:`_pageButton_1jtuu_301`,ellipsis:`_ellipsis_1jtuu_311`,previousIcon:`_previousIcon_1jtuu_323`,nextIcon:`_nextIcon_1jtuu_331`,default:`_default_1jtuu_371`,tableOnMobile:`_tableOnMobile_1jtuu_371`,wide:`_wide_1jtuu_401`},ae=(0,r.tableFeatures)({rowSortingFeature:r.rowSortingFeature,sortedRowModel:(0,r.createSortedRowModel)()}),oe=e=>{if(!(!e||e.width===void 0&&e.minWidth===void 0&&e.maxWidth===void 0))return{width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth}},se=(e,t)=>t<=7?Array.from({length:t},(e,t)=>t):e<=3?[0,1,2,3,4,`ellipsis-end`,t-1]:e>=t-4?[0,`ellipsis-start`,t-5,t-4,t-3,t-2,t-1]:[0,`ellipsis-start`,e-1,e,e+1,`ellipsis-end`,t-1],ce=(e,t)=>{let n=new Set;for(let t of e){if(!t.id.trim())return`Идентификатор колонки не может быть пустым`;if(n.has(t.id))return`Идентификатор колонки «${t.id}» повторяется`;n.add(t.id)}for(let n=0;n<t.length;n+=1){let r=t[n];for(let t of e)if(typeof t.accessor==`string`&&!(t.accessor in r))return`В строке ${n+1} отсутствует колонка «${t.id}»`}return null},le=(e,t)=>typeof e==`function`?e(t):t[e],ue=e=>{if(e==null||e===``)return null;let t=Date.parse(String(e));return Number.isNaN(t)?null:t},de=(e,t,n)=>{let r=ue(e.getValue(n)),i=ue(t.getValue(n));return r===null&&i===null?0:r===null?-1:i===null?1:r-i},fe=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r==null&&i==null?0:r==null?-1:i==null?1:Number(r)-Number(i)},pe=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r==null&&i==null?0:r==null?-1:i==null?1:Number(!!r)-Number(!!i)},me=(e,t,n)=>{let r=String(e.getValue(n)??``),i=String(t.getValue(n)??``);return r.localeCompare(i,void 0,{numeric:!0,sensitivity:`base`})},he=e=>{switch(e){case`date`:return de;case`number`:return fe;case`boolean`:return pe;case`text`:case void 0:return me;case`custom`:return}},ge=e=>{let t=t=>le(e.accessor,t),n=e.sortFn??he(e.dataType),r=e.enableSorting??(e.dataType!==`custom`&&n!==void 0),i={id:e.id,accessorFn:t,header:()=>e.header,cell:t=>{let n=t.getValue();return e.cell?.(t.row.original,n)??String(n??``)},enableSorting:r,sortDescFirst:e.sortDescFirst};return n!==void 0&&(i.sortFn=n),i},_e=({columns:n,data:i,tableOnMobile:a=!1,breakpoint:o=`default`,sorting:s,onSortingChange:c,renderMobileCard:l,getRowId:d,caption:f,ariaLabel:p,loading:m=!1,error:h,emptyState:_=`Нет данных`,stickyHeader:v=!1,maxHeight:y,className:b=``,onRowClick:x,pagination:S=!1,pageSize:C=30,visibleColumnIds:w})=>{let[T,E]=(0,t.useState)([]),[D,O]=(0,t.useState)(0),k=s??T,A=k.map(e=>`${e.id}:${e.desc?`desc`:`asc`}`).join(`|`),j=Number.isFinite(C)&&C>0?Math.floor(C):30,M=(0,t.useMemo)(()=>{if(w===void 0)return n;let e=new Set(w);return n.filter(t=>e.has(t.id))},[n,w]),N=(0,t.useMemo)(()=>M.length===0?`Должна быть видима хотя бы одна колонка`:ce(M,i),[i,M]),P=(0,t.useMemo)(()=>M.map(ge),[M]),F=M.some(e=>oe(e)!==void 0),I=(0,r.useTable)({features:ae,columns:P,data:i,state:{sorting:k},onSortingChange:e=>{let t=typeof e==`function`?e(k):e;s===void 0&&E(t),O(0),c?.(t)},getRowId:d}),L=I.getRowModel().rows,R=S?Math.max(1,Math.ceil(L.length/j)):1,z=Math.min(D,R-1),B=(0,t.useMemo)(()=>S?L.slice(z*j,(z+1)*j):L,[j,S,z,L]),ee=(0,t.useMemo)(()=>M.filter(e=>e.enableSorting??e.dataType!==`custom`).map(e=>({id:e.id,label:typeof e.header==`string`?e.header:e.id})),[M]),V=(0,t.useMemo)(()=>se(z,R),[R,z]),te=[Y.root,o===`wide`?Y.wide:Y.default,a?Y.tableOnMobile:``,b].filter(Boolean).join(` `),U=N??h,W=S&&!m&&!U&&L.length>j,G=z*j+1,K=Math.min((z+1)*j,L.length);return(0,t.useEffect)(()=>{O(0)},[i,j,S,A]),(0,t.useEffect)(()=>{D>=R&&O(R-1)},[R,D]),(0,e.jsxs)(`section`,{className:te,"aria-busy":m,children:[!a&&!m&&!U&&B.length>0&&ee.length>0&&(0,e.jsx)(ie,{className:Y.mobileSort,options:ee,value:k[0]?{id:k[0].id,direction:k[0].desc?`desc`:`asc`}:null,onChange:e=>I.setSorting([{id:e.id,desc:e.direction===`desc`}])}),(0,e.jsx)(`div`,{className:Y.tableWrap,style:{maxHeight:y},children:(0,e.jsxs)(`table`,{className:Y.table,"aria-label":p,children:[f&&(0,e.jsx)(`caption`,{children:f}),F&&(0,e.jsx)(`colgroup`,{children:M.map(t=>(0,e.jsx)(`col`,{style:oe(t)},t.id))}),(0,e.jsx)(`thead`,{className:v?Y.sticky:``,children:I.getHeaderGroups().map(t=>(0,e.jsx)(`tr`,{children:t.headers.map(t=>{let n=t.column.getIsSorted(),r=t.column.getCanSort(),i=t.column.getToggleSortingHandler();return(0,e.jsx)(`th`,{scope:`col`,"aria-sort":n===`asc`?`ascending`:n===`desc`?`descending`:`none`,style:oe(M.find(e=>e.id===t.column.id)),children:(0,e.jsxs)(`button`,{type:`button`,className:Y.sortButton,disabled:!r,onClick:i,children:[(0,e.jsx)(I.FlexRender,{header:t}),(0,e.jsx)(g,{name:n===`asc`?`IconSortAscending`:n===`desc`?`IconSortDescending`:`IconSort`,width:16,height:16})]})},t.id)})},t.id))}),(0,e.jsx)(`tbody`,{children:m?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{colSpan:M.length,children:(0,e.jsx)(H,{lines:3})})}):U?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:Y.state,colSpan:M.length,children:U})}):B.length===0?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:Y.state,colSpan:M.length,children:_})}):B.map(t=>(0,e.jsx)(`tr`,{className:x?Y.clickableRow:void 0,onClick:()=>x?.(t.original),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),x?.(t.original))},tabIndex:x?0:void 0,role:x?`button`:void 0,children:t.getAllCells().map(t=>(0,e.jsx)(`td`,{style:oe(M.find(e=>e.id===t.column.id)),children:(0,e.jsx)(I.FlexRender,{cell:t})},t.id))},t.id))})]})}),!a&&(0,e.jsx)(`div`,{className:Y.cards,role:`list`,"aria-label":p??f,children:m?(0,e.jsx)(H,{lines:4}):U?(0,e.jsx)(`div`,{className:Y.state,children:U}):B.length===0?(0,e.jsx)(`div`,{className:Y.state,children:_}):B.map(t=>{if(l)return(0,e.jsx)(`div`,{role:`listitem`,children:l({row:t.original,columns:M})},t.id);let n=M.filter(e=>!e.mobile?.hideOnMobile).sort((e,t)=>(e.mobile?.mobileOrder??0)-(t.mobile?.mobileOrder??0)),r=n.find(e=>e.mobile?.primary)??n.find(e=>e.mobile?.mobileVariant!==`actions`),i=e=>le(e.accessor,t.original),a=e=>e.mobile?.renderMobile?.(t.original,i(e))??e.cell?.(t.original,i(e))??String(i(e)??``);return(0,e.jsxs)(`article`,{role:`listitem`,className:Y.card,children:[(0,e.jsx)(`h3`,{children:r?a(r):`Строка ${t.index+1}`}),(0,e.jsx)(`dl`,{children:n.filter(e=>e!==r&&e.mobile?.mobileVariant!==`actions`).map(t=>(0,e.jsxs)(`div`,{className:t.mobile?.mobileSpan===2?Y.spanTwo:``,children:[(0,e.jsx)(`dt`,{children:t.mobile?.mobileLabel??t.header}),(0,e.jsx)(`dd`,{children:a(t)})]},t.id))}),n.filter(e=>e.mobile?.mobileVariant===`actions`).map(t=>(0,e.jsx)(`footer`,{children:a(t)},t.id))]},t.id)})}),W&&(0,e.jsxs)(`nav`,{className:Y.pagination,"aria-label":`Пагинация таблицы`,children:[(0,e.jsxs)(`span`,{className:Y.paginationRange,"aria-live":`polite`,children:[G,`–`,K,` из `,L.length]}),(0,e.jsxs)(`div`,{className:Y.paginationControls,children:[(0,e.jsxs)(u,{variant:`empty`,size:`md`,disabled:z===0,"aria-label":`Предыдущая страница`,onClick:()=>{O(e=>Math.max(0,e-1))},children:[(0,e.jsx)(g,{name:`IconChevron`,width:18,height:18,className:Y.previousIcon}),(0,e.jsx)(`span`,{className:Y.paginationButtonLabel,children:`Назад`})]}),(0,e.jsx)(`div`,{className:Y.pageNumbers,children:V.map(t=>typeof t==`number`?(0,e.jsx)(u,{variant:t===z?`secondary`:`empty`,size:`md`,className:Y.pageButton,"aria-label":`Перейти на страницу ${t+1}`,"aria-current":t===z?`page`:void 0,onClick:()=>{O(t)},children:t+1},t):(0,e.jsx)(`span`,{className:Y.ellipsis,"aria-hidden":`true`,children:`…`},t))}),(0,e.jsxs)(u,{variant:`empty`,size:`md`,disabled:z===R-1,"aria-label":`Следующая страница`,onClick:()=>{O(e=>Math.min(R-1,e+1))},children:[(0,e.jsx)(`span`,{className:Y.paginationButtonLabel,children:`Вперёд`}),(0,e.jsx)(g,{name:`IconChevron`,width:18,height:18,className:Y.nextIcon})]})]})]})]})},ve=8,ye=6,be=120,xe=e=>{if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e);if(Number.isFinite(t))return t}return 1/0},Se=({options:r,value:i,onChange:a,placeholder:o=`Выберите опции`,disabled:s=!1,stringWhileDisabled:c=!1,label:l,error:u,size:d=`md`,required:p=!1,hint:m,className:h=``,name:_,id:v,closeOnSelect:y=!1,needMark:b=!0,maxMenuHeight:x})=>{let S=(0,t.useId)(),C=v??`ds-dropdown-multiple-${_??S}`,w=`${C}-listbox`,[T,E]=(0,t.useState)(!1),[D,O]=(0,t.useState)(null),k=(0,t.useRef)(null),A=(0,t.useRef)(null),j=(0,t.useRef)(null),M=(0,t.useRef)([]),N=(0,t.useMemo)(()=>r.filter(e=>i.includes(e.value)),[r,i]).map(e=>e.label).join(`, `),P=m?`${C}-hint`:void 0,F=u?`${C}-error`:void 0,I=[P,F].filter(Boolean).join(` `)||void 0,L=s&&c,R=(0,t.useCallback)(()=>{let e=A.current,t=j.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerHeight-n.bottom-ve,a=n.top-ve,o=i<r.height&&a>i,s=Math.max(be,o?a:i),c=window.innerWidth-n.width-ve;O({top:o?Math.max(ve,n.top-r.height-ye):n.bottom+ye,left:Math.max(ve,Math.min(n.left,c)),width:n.width,maxHeight:Math.min(s,xe(x))})},[x]);(0,t.useLayoutEffect)(()=>{if(!T){O(null);return}return R(),window.addEventListener(`resize`,R),window.addEventListener(`scroll`,R,!0),()=>{window.removeEventListener(`resize`,R),window.removeEventListener(`scroll`,R,!0)}},[T,r.length,R]),(0,t.useEffect)(()=>{if(!T)return;let e=e=>{let t=e.target;!k.current?.contains(t)&&!j.current?.contains(t)&&E(!1)},t=e=>{e.key===`Escape`&&(E(!1),A.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[T]);let z=(e,t)=>{let n=q(r,e,t);n!==-1&&(M.current[n]?.focus(),M.current[n]?.scrollIntoView({block:`nearest`}))},B=e=>{if(e.disabled)return;let t=i.includes(e.value)?i.filter(t=>t!==e.value):[...i,e.value];a?.(t,r.filter(e=>t.includes(e.value))),y&&(E(!1),A.current?.focus())},ee=T?(0,e.jsx)(`ul`,{ref:j,id:w,className:U.menu,role:`listbox`,"aria-label":l,"aria-multiselectable":`true`,style:D?{position:`fixed`,top:D.top,left:D.left,width:D.width,maxHeight:D.maxHeight}:{position:`fixed`,top:0,left:0,visibility:`hidden`,maxHeight:0},children:r.map((t,n)=>{let a=i.includes(t.value);return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{M.current[n]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:[U[d],U.option,a?U.selected:``].filter(Boolean).join(` `),onClick:()=>B(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;z(n+t,t)}if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;z(e.key===`Home`?0:r.length-1,t)}(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),B(t)),e.key===`Tab`&&E(!1)},children:[(0,e.jsx)(`span`,{children:t.label}),a&&b&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:k,className:[U.wrapper,u?U.errorState:``,h].filter(Boolean).join(` `),children:[l&&(0,e.jsx)(f,{htmlFor:L?void 0:C,required:p,disabled:s,children:l}),(0,e.jsx)(`div`,{className:U.container,children:L?(0,e.jsx)(`div`,{id:C,className:`${U.disabledText} ${U[d]}`,"aria-describedby":I,children:N||o}):(0,e.jsxs)(`button`,{ref:A,id:C,type:`button`,name:_,className:`${U.trigger} ${U[d]}`,disabled:s,"aria-haspopup":`listbox`,"aria-expanded":T,"aria-controls":w,"aria-describedby":I,"aria-invalid":!!u,onClick:()=>E(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),E(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>z(e.key===`ArrowDown`?0:r.length-1,t))}},children:[(0,e.jsx)(`span`,{className:`${N?U.value:U.placeholder} ${U[d]}`,children:N||o}),(0,e.jsx)(`span`,{className:[U.chevron,T?U.chevronOpen:``].filter(Boolean).join(` `),"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]})}),T&&(0,n.createPortal)(ee,document.body),m&&!u&&(0,e.jsx)(`span`,{id:P,className:U.message,children:m}),u&&(0,e.jsx)(`span`,{id:F,className:U.error,children:u})]})},Ce={wrapper:`_wrapper_1izp1_1`,control:`_control_1izp1_15`,input:`_input_1izp1_25`,disabledText:`_disabledText_1izp1_25`,sm:`_sm_1izp1_107`,md:`_md_1izp1_123`,lg:`_lg_1izp1_139`,inputError:`_inputError_1izp1_155`,trailingAction:`_trailingAction_1izp1_163`},we=({value:n,onChange:r,type:i=`text`,placeholder:a=``,disabled:o=!1,readOnly:s=!1,stringWhileDisabled:c=!1,label:l,error:u,hint:d,className:m=``,name:h,id:_,size:v=`md`,clearable:y=!0,required:b=!1,selectTextOnFocus:x=!1,isPassword:S=!1,passwordVisibleLabel:C=`Скрыть пароль`,passwordHiddenLabel:w=`Показать пароль`,onFocus:T,...E})=>{let D=(0,t.useId)(),O=_??`ds-input-${h??D}`,k=(0,t.useRef)(null),[A,j]=(0,t.useState)(!1),M=d?`${O}-hint`:void 0,N=u?`${O}-error`:void 0,P=String(n??``),F=[M,N].filter(Boolean).join(` `)||void 0,I=S?A?`text`:`password`:i;return(0,t.useEffect)(()=>{S||j(!1)},[S]),(0,e.jsxs)(`div`,{className:`${Ce.wrapper} ${m}`,children:[l&&(0,e.jsx)(f,{htmlFor:O,required:b,disabled:o,children:l}),o&&c?(0,e.jsx)(`div`,{id:O,className:Ce.disabledText,"aria-describedby":F,children:P||a}):(0,e.jsxs)(`div`,{className:Ce.control,children:[(0,e.jsx)(`input`,{ref:k,id:O,name:h,type:I,value:P,placeholder:a,disabled:o,readOnly:s,required:b,"aria-invalid":!!u,"aria-describedby":F,className:`${Ce.input} ${Ce[v]} ${u?Ce.inputError:``}`,onChange:e=>{if(i===`number`&&!S){let t=e.target.value===``?``:Number(e.target.value);r?.(t,e);return}r?.(e.target.value,e)},onFocus:e=>{x&&e.currentTarget.value&&e.currentTarget.select(),T?.(e)},...E}),S&&(0,e.jsx)(`button`,{type:`button`,className:Ce.trailingAction,disabled:o,"aria-label":A?C:w,"aria-pressed":A,onClick:()=>j(e=>!e),children:(0,e.jsx)(g,{name:A?`IconEyeOff`:`IconEye`,width:20,height:20})}),!S&&y&&P&&!o&&!s&&(0,e.jsx)(`button`,{type:`button`,className:Ce.trailingAction,"aria-label":`Очистить поле`,onClick:()=>{let e=k.current;e&&((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus())},children:(0,e.jsx)(g,{name:`IconCross`,width:20,height:20})})]}),d&&!u&&(0,e.jsx)(p,{id:M,children:d}),u&&(0,e.jsx)(p,{id:N,variant:`error`,children:u})]})},Te=(e,t)=>{let n=t.trim().toLocaleLowerCase();return n?e.filter(e=>e.label.toLocaleLowerCase().includes(n)||e.value.toLocaleLowerCase().includes(n)):e},Ee=(e,t,n)=>{if(!e.length)return-1;for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},X={wrapper:`_wrapper_1v2s8_1`,control:`_control_1v2s8_17`,inputHost:`_inputHost_1v2s8_25`,sm:`_sm_1v2s8_41`,md:`_md_1v2s8_57`,lg:`_lg_1v2s8_71`,errorState:`_errorState_1v2s8_85`,disabledText:`_disabledText_1v2s8_93`,chevron:`_chevron_1v2s8_163`,chevronOpen:`_chevronOpen_1v2s8_197`,menu:`_menu_1v2s8_205`,menuEmpty:`_menuEmpty_1v2s8_233`,option:`_option_1v2s8_241`,empty:`_empty_1v2s8_241`,selected:`_selected_1v2s8_321`,active:`_active_1v2s8_321`,visuallyHidden:`_visuallyHidden_1v2s8_341`},De=8,Oe=6,ke=5,Ae=10,je={sm:30,md:40,lg:50},Me=({options:r,value:i,onChange:a,placeholder:o=`Начните вводить`,noResultsText:s=`Ничего не найдено`,disabled:c=!1,readOnly:l=!1,stringWhileDisabled:u=!1,label:d,error:m,hint:h,size:_=`md`,required:v=!1,className:y=``,name:b,id:x,needMark:S=!0})=>{let C=(0,t.useId)(),w=x??`ds-search-dropdown-${b??C}`,T=`${w}-listbox`,E=`${w}-status`,D=h?`${w}-hint`:void 0,O=m?`${w}-error`:void 0,k=[E,D,O].filter(Boolean).join(` `),A=(0,t.useRef)(null),j=(0,t.useRef)(null),M=(0,t.useRef)([]),[N,P]=(0,t.useState)(!1),[F,I]=(0,t.useState)(``),[L,R]=(0,t.useState)(-1),[z,B]=(0,t.useState)(null),ee=(0,t.useMemo)(()=>r.find(e=>e.value===i),[r,i]),V=(0,t.useMemo)(()=>Te(r,F),[r,F]),te=c&&u,H=L>=0?V[L]:void 0;(0,t.useEffect)(()=>I(ee?.label??``),[ee?.label,i]);let U=(0,t.useCallback)(()=>A.current?.querySelector(`input`)??null,[]),W=(0,t.useCallback)((e,t)=>Ee(V,e,t),[V]),G=(0,t.useCallback)(e=>{R(e),!(e<0)&&requestAnimationFrame(()=>M.current[e]?.scrollIntoView({block:`nearest`}))},[]),K=(0,t.useCallback)(()=>{let e=U();if(!e)return;let t=e.getBoundingClientRect(),n=Math.max(1,Math.min(V.length,ke))*je[_]+Ae,r=window.innerHeight-t.bottom-De,i=t.top-De,a=r<n&&i>r,o=a?i:r,s=Math.max(je[_]+Ae,Math.min(n,o)),c=window.innerWidth-t.width-De,l=Math.max(De,Math.min(t.left,c)),u=a?Math.max(De,t.top-s-Oe):t.bottom+Oe;B({top:u,left:l,width:t.width,maxHeight:s})},[V.length,U,_]);(0,t.useLayoutEffect)(()=>{if(!N){B(null);return}return K(),window.addEventListener(`resize`,K),window.addEventListener(`scroll`,K,!0),()=>{window.removeEventListener(`resize`,K),window.removeEventListener(`scroll`,K,!0)}},[N,K]),(0,t.useEffect)(()=>{if(!N)return;let e=e=>{let t=e.target;!A.current?.contains(t)&&!j.current?.contains(t)&&(P(!1),R(-1))};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[N]);let q=()=>{c||l||(P(!0),R(W(0,1)))},J=e=>{e.disabled||(I(e.label),P(!1),R(-1),a?.(e.value,e),U()?.focus())},ne=N?(0,e.jsx)(`ul`,{ref:j,id:T,className:`${X.menu} ${V.length===0?X.menuEmpty:``}`,role:`listbox`,"aria-label":d,style:z?{top:z.top,left:z.left,width:z.width,maxHeight:z.maxHeight}:{top:0,left:0,visibility:`hidden`,maxHeight:0},children:V.length===0?(0,e.jsx)(`li`,{className:`${X.empty} ${X[_]}`,children:s}):V.map((t,n)=>{let r=t.value===i,a=n===L;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{M.current[n]=e},id:`${w}-option-${n}`,type:`button`,role:`option`,tabIndex:-1,disabled:t.disabled,"aria-disabled":t.disabled,"aria-selected":r,className:[X.option,X[_],r?X.selected:``,a?X.active:``].filter(Boolean).join(` `),onPointerMove:()=>{t.disabled||R(n)},onClick:()=>J(t),children:[(0,e.jsx)(`span`,{children:t.label}),r&&S&&(0,e.jsx)(g,{name:`IconCheck`,width:16,height:16})]})},t.value)})}):null;return(0,e.jsxs)(`div`,{ref:A,className:[X.wrapper,m?X.errorState:``,y].filter(Boolean).join(` `),children:[d&&(0,e.jsx)(f,{htmlFor:te?void 0:w,required:v,disabled:c,children:d}),te?(0,e.jsx)(`div`,{className:`${X.disabledText} ${X[_]}`,children:ee?.label??o}):(0,e.jsxs)(`div`,{className:X.control,children:[(0,e.jsx)(we,{id:w,name:b,value:F,placeholder:o,disabled:c,readOnly:l,required:v,size:_,clearable:!1,autoComplete:`off`,className:`${X.inputHost} ${X[_]}`,onFocus:q,onChange:e=>{let t=String(e),n=Te(r,t);I(t),P(!0),R(Ee(n,0,1))},role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":N,"aria-controls":T,"aria-activedescendant":H?`${w}-option-${L}`:void 0,"aria-invalid":!!m,"aria-describedby":k,onClick:q,onKeyDown:e=>{if(!(c||l)){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1,n=L>=0?L+t:t===1?0:V.length-1;P(!0),G(W(n,t))}else if(e.key===`Home`||e.key===`End`){if(!N)return;e.preventDefault();let t=e.key===`Home`?1:-1;G(W(e.key===`Home`?0:V.length-1,t))}else e.key===`Enter`&&N&&H?(e.preventDefault(),J(H)):e.key===`Escape`&&N?(e.preventDefault(),P(!1),R(-1)):e.key===`Tab`&&(P(!1),R(-1))}}}),(0,e.jsx)(`span`,{className:`${X.chevron} ${N?X.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]}),N&&typeof document<`u`&&(0,n.createPortal)(ne,document.body),(0,e.jsxs)(`span`,{id:E,className:X.visuallyHidden,"aria-live":`polite`,children:[`Найдено вариантов: `,V.length]}),h&&!m&&(0,e.jsx)(p,{id:D,children:h}),m&&(0,e.jsx)(p,{id:O,variant:`error`,children:m})]})},Ne={root:`_root_11adi_1`,header:`_header_11adi_21`,title:`_title_11adi_41`,dismiss:`_dismiss_11adi_55`,content:`_content_11adi_65`},Pe=({title:n,children:r,dismissible:i=!1,onDismiss:a,dismissLabel:o=`Закрыть информационный блок`,headingAs:s=`h3`,className:c=``})=>{let l=`ds-info-block-${(0,t.useId)()}`;return(0,e.jsxs)(`section`,{className:`${Ne.root} ${c}`,"aria-labelledby":l,children:[(0,e.jsxs)(`header`,{className:Ne.header,children:[(0,e.jsx)(s,{id:l,className:Ne.title,children:n}),i&&(0,e.jsx)(u,{className:Ne.dismiss,variant:`empty`,onClick:a,"aria-label":o,children:(0,e.jsx)(g,{name:`IconCross`,width:20,height:20})})]}),(0,e.jsx)(`div`,{className:Ne.content,children:r})]})},Fe={wrapper:`_wrapper_1np4e_1`,input:`_input_1np4e_21`,switch:`_switch_1np4e_35`,thumb:`_thumb_1np4e_67`,label:`_label_1np4e_113`,disabled:`_disabled_1np4e_125`},Ie=({checked:n,onChange:r,label:i,disabled:a=!1,readOnly:o=!1,className:s=``,name:c,id:l,value:u})=>{let d=(0,t.useId)(),f=l??`ds-radio-button-${c??d}`;return(0,e.jsxs)(`label`,{htmlFor:f,className:`${Fe.wrapper} ${a?Fe.disabled:``} ${s}`,children:[(0,e.jsx)(`input`,{id:f,className:Fe.input,type:`checkbox`,role:`switch`,name:c,value:u,checked:n,disabled:a,"aria-readonly":o||void 0,onChange:e=>{o||r?.(e.target.checked,e)}}),(0,e.jsx)(`span`,{className:Fe.switch,"aria-hidden":`true`,children:(0,e.jsx)(`span`,{className:Fe.thumb})}),i&&(0,e.jsx)(`span`,{className:Fe.label,children:i})]})},Le={root:`_root_1ecm3_1`,grid:`_grid_1ecm3_13`,actions:`_actions_1ecm3_27`},Re=({filters:t,values:n,onChange:r,onApply:i,onReset:a,applyMode:o=`instant`,loading:s=!1,disabled:c=!1,className:l=``})=>{let d=(e,t)=>{let a={...n,[e]:t};r?.(a,e),o===`instant`&&i?.(a)};return(0,e.jsxs)(`section`,{className:`${Le.root} ${l}`,"aria-label":`Фильтры`,"aria-busy":s,children:[(0,e.jsx)(`div`,{className:Le.grid,children:t.filter(e=>!e.hidden).map(t=>{let r=c||s||t.disabled,i=n[t.id];if(t.type===`input`){let n={label:t.label,hint:t.hint,placeholder:t.placeholder,disabled:r};return t.inputType===`number`?(0,e.jsx)(we,{...n,type:`number`,value:i??``,onChange:e=>d(t.id,e)},t.id):(0,e.jsx)(we,{...n,type:`text`,value:String(i??``),onChange:e=>d(t.id,e)},t.id)}if(t.type===`dropdown`)return(0,e.jsx)(ne,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:String(i??``),disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`multiple`)return(0,e.jsx)(Se,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:Array.isArray(i)?i:[],disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`checkbox`)return(0,e.jsx)(v,{label:t.label,hint:t.hint,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`radio`)return(0,e.jsx)(Ie,{label:t.label,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);let a=i&&typeof i==`object`&&!Array.isArray(i)?i:{from:null,to:null};return(0,e.jsx)(V,{hint:t.hint,mode:t.mode,min:t.min,max:t.max,value:a,disabled:r,onDraftChange:e=>d(t.id,e)},t.id)})}),(a||o===`manual`)&&(0,e.jsxs)(`div`,{className:Le.actions,children:[a&&(0,e.jsx)(u,{variant:`destructiveOutline`,disabled:c||s,onClick:a,children:`Сбросить`}),o===`manual`&&(0,e.jsx)(u,{isLoading:s,disabled:c,onClick:()=>i?.(n),children:`Применить`})]})]})},Z={wrapper:`_wrapper_i20hz_1`,dropzone:`_dropzone_i20hz_15`,dragActive:`_dragActive_i20hz_45`,disabled:`_disabled_i20hz_59`,error:`_error_i20hz_69`,nativeInput:`_nativeInput_i20hz_77`,empty:`_empty_i20hz_95`,uploadIcon:`_uploadIcon_i20hz_111`,files:`_files_i20hz_133`,file:`_file_i20hz_133`,fileName:`_fileName_i20hz_175`,fileSize:`_fileSize_i20hz_187`},ze=e=>`${e.name}:${e.size}:${e.lastModified}`,Be=e=>e<1024?`${e} Б`:e<1048576?`${(e/1024).toFixed(1)} КБ`:`${(e/1024/1024).toFixed(1)} МБ`,Ve=(e,t)=>!t||t.split(`,`).map(e=>e.trim().toLowerCase()).some(t=>t.startsWith(`.`)?e.name.toLowerCase().endsWith(t):t.endsWith(`/*`)?e.type.startsWith(t.slice(0,-1)):e.type.toLowerCase()===t),He=({value:n,onChange:r,multiple:i=!1,accept:a,maxSize:o,maxFiles:s,label:c,hint:l,error:d,required:m=!1,disabled:h=!1,readOnly:_=!1,name:v,id:y,className:b=``,dropLabel:x=`Перетащите файлы в эту область`,browseLabel:S=`Выбрать файлы`,addMoreLabel:C=`Добавить ещё`,onReject:w})=>{let T=(0,t.useId)(),E=y??`ds-file-input-${v??T}`,D=(0,t.useRef)(null),O=(0,t.useRef)(0),[k,A]=(0,t.useState)(!1),j=l?`${E}-hint`:void 0,M=d?`${E}-error`:void 0,N=[j,M].filter(Boolean).join(` `)||void 0,P=!h&&!_,F=e=>{let t=[],c=new Set(n.map(ze)),l=e.filter(e=>Ve(e,a)?o!==void 0&&e.size>o?(t.push({file:e,reason:`maxSize`}),!1):!c.has(ze(e))&&(c.add(ze(e)),!0):(t.push({file:e,reason:`accept`}),!1)),u=i?s:1,d=i?[...n,...l]:l.slice(-1);u!==void 0&&d.length>u&&(d.slice(u).forEach(e=>t.push({file:e,reason:`maxFiles`})),d=d.slice(0,u)),t.length&&w?.(t),l.length&&r?.(d),D.current&&(D.current.value=``)};return(0,e.jsxs)(`div`,{className:`${Z.wrapper} ${b}`,children:[c&&(0,e.jsx)(f,{htmlFor:E,required:m,disabled:h,children:c}),(0,e.jsxs)(`div`,{className:`${Z.dropzone} ${k?Z.dragActive:``} ${h?Z.disabled:``} ${d?Z.error:``}`,onDragEnter:e=>{e.preventDefault(),P&&++O.current===1&&A(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:e=>{e.preventDefault(),--O.current<=0&&(O.current=0,A(!1))},onDrop:e=>{e.preventDefault(),O.current=0,A(!1),P&&F(Array.from(e.dataTransfer.files))},children:[(0,e.jsx)(`input`,{ref:D,id:E,name:v,className:Z.nativeInput,type:`file`,multiple:i,accept:a,required:m&&n.length===0,disabled:!P,"aria-describedby":N,"aria-invalid":!!d,onChange:e=>F(Array.from(e.target.files??[]))}),n.length?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`ul`,{className:Z.files,"aria-live":`polite`,children:n.map((t,i)=>(0,e.jsxs)(`li`,{className:Z.file,children:[(0,e.jsx)(`span`,{className:Z.fileName,title:t.name,children:t.name}),(0,e.jsx)(`span`,{className:Z.fileSize,children:Be(t.size)}),P&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,"aria-label":`Удалить файл ${t.name}`,onClick:()=>r?.(n.filter((e,t)=>t!==i)),children:(0,e.jsx)(g,{name:`IconCross`,width:16,height:16})})]},ze(t)))}),P&&(i||n.length===0)&&(0,e.jsx)(u,{className:Z.browseButton,size:`sm`,onClick:()=>D.current?.click(),children:C}),P&&!i&&(0,e.jsx)(u,{className:Z.browseButton,size:`sm`,onClick:()=>D.current?.click(),children:S})]}):(0,e.jsxs)(`div`,{className:Z.empty,children:[(0,e.jsx)(`span`,{className:Z.uploadIcon,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconUpload`,width:24,height:24})}),(0,e.jsx)(`strong`,{children:k?`Отпустите файлы здесь`:x}),!k&&P&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`span`,{children:`или`}),(0,e.jsx)(u,{onClick:()=>D.current?.click(),children:S})]})]})]}),l&&!d&&(0,e.jsx)(p,{id:j,children:l}),d&&(0,e.jsx)(p,{id:M,variant:`error`,live:!0,children:d})]})},Ue={wrapper:`_wrapper_x2gki_1`,control:`_control_x2gki_15`,textarea:`_textarea_x2gki_25`,disabledText:`_disabledText_x2gki_27`,sm:`_sm_x2gki_103`,md:`_md_x2gki_117`,lg:`_lg_x2gki_131`,autoResize:`_autoResize_x2gki_145`,manualResize:`_manualResize_x2gki_155`,textareaError:`_textareaError_x2gki_163`,clearAction:`_clearAction_x2gki_171`,messages:`_messages_x2gki_251`,counter:`_counter_x2gki_265`},We=2;function Ge(e){let t=window.getComputedStyle(e),n=Number.parseFloat(t.lineHeight);return Number.isFinite(n)?n:Number.parseFloat(t.fontSize)*1.4}function Ke({value:n,onChange:r,placeholder:i=``,disabled:a=!1,readOnly:o=!1,stringWhileDisabled:s=!1,label:c,error:l,hint:u,className:d=``,name:m,id:h,size:_=`md`,clearable:v=!1,required:y=!1,maxLength:b,showCount:x=!1,minRows:S=We,maxRows:C,autoResize:w=!0,...T}){let E=(0,t.useId)(),D=h??`ds-textarea-${m??E}`,O=(0,t.useRef)(null),k=u?`${D}-hint`:void 0,A=l?`${D}-error`:void 0,j=x&&b?`${D}-count`:void 0,M=[k,A,j].filter(Boolean).join(` `)||void 0,N=Math.max(1,S),P=C===void 0?void 0:Math.max(N,C),F=(0,t.useCallback)(()=>{let e=O.current;if(!e||!w)return;let t=window.getComputedStyle(e),n=Ge(e),r=Number.parseFloat(t.paddingTop)+Number.parseFloat(t.paddingBottom)+Number.parseFloat(t.borderTopWidth)+Number.parseFloat(t.borderBottomWidth),i=n*N+r,a=P===void 0?1/0:n*P+r;e.style.height=`auto`;let o=Math.min(Math.max(e.scrollHeight,i),a);e.style.height=`${o}px`,e.style.overflowY=e.scrollHeight>a?`auto`:`hidden`},[w,P,N]);(0,t.useEffect)(()=>{F()},[F,n]),(0,t.useEffect)(()=>{if(!w)return;window.addEventListener(`resize`,F);let e=O.current?.parentElement,t;if(e&&typeof ResizeObserver<`u`){let n=e.getBoundingClientRect().width;t=new ResizeObserver(([e])=>{!e||e.contentRect.width===n||(n=e.contentRect.width,F())}),t.observe(e)}return()=>{window.removeEventListener(`resize`,F),t?.disconnect()}},[w,F]);let I=e=>{r?.(e.target.value,e),F()},L=()=>{let e=O.current;e&&((Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus(),F())},R={"--ds-textarea-min-rows":N};return(0,e.jsxs)(`div`,{className:`${Ue.wrapper} ${d}`,children:[c&&(0,e.jsx)(f,{htmlFor:D,required:y,disabled:a,children:c}),a&&s?(0,e.jsx)(`div`,{id:D,className:`${Ue.disabledText} ${Ue[_]}`,style:R,"aria-describedby":M,children:n||i}):(0,e.jsxs)(`div`,{className:Ue.control,children:[(0,e.jsx)(`textarea`,{ref:O,id:D,name:m,value:n,placeholder:i,disabled:a,readOnly:o,required:y,maxLength:b,rows:N,style:R,"aria-invalid":!!l,"aria-describedby":M,className:`${Ue.textarea} ${Ue[_]} ${w?Ue.autoResize:Ue.manualResize} ${l?Ue.textareaError:``}`,onChange:I,...T}),v&&n&&!a&&!o&&(0,e.jsx)(`button`,{type:`button`,className:Ue.clearAction,"aria-label":`Очистить поле`,onClick:L,children:(0,e.jsx)(g,{name:`IconCross`,width:20,height:20})})]}),(u||l||j)&&(0,e.jsxs)(`div`,{className:Ue.messages,children:[u&&!l&&(0,e.jsx)(p,{id:k,children:u}),l&&(0,e.jsx)(p,{id:A,variant:`error`,children:l}),j&&(0,e.jsxs)(`span`,{id:j,className:Ue.counter,children:[n.length,` / `,b]})]})]})}var qe=0,Q=(0,i.create)((e,t)=>({modals:[],openModal:(t,n={},r={})=>{qe+=1;let i=`ds-modal-${qe}`;return e(e=>({modals:[...e.modals,{id:i,name:t,payload:n,title:r.title,description:r.description,closeOnEscape:r.closeOnEscape??!0,closeOnBackdrop:r.closeOnBackdrop??!0,onClose:r.onClose}]})),i},closeModal:n=>{let r=t().modals.find(e=>e.id===n);r&&(e(e=>({modals:e.modals.filter(e=>e.id!==n)})),r.onClose?.())},closeTopModal:()=>{let n=t().modals.at(-1);n&&(e(e=>({modals:e.modals.slice(0,-1)})),n.onClose?.())},closeAllModals:()=>{let n=t().modals;n.length&&(e({modals:[]}),n.forEach(e=>e.onClose?.()))}})),Je=()=>{Q.getState().closeAllModals(),qe=0},Ye={layer:`_layer_1mvch_1`,backdrop:`_backdrop_1mvch_15`,panel:`_panel_1mvch_35`,header:`_header_1mvch_63`,title:`_title_1mvch_81`,description:`_description_1mvch_93`,content:`_content_1mvch_107`,close:`_close_1mvch_115`},Xe=`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,Ze=(0,t.createContext)({});function Qe(e){if(e.key!==`Tab`)return;let t=Array.from(e.currentTarget.querySelectorAll(Xe));if(!t.length){e.preventDefault();return}let n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}var $e=({children:n,title:r,description:i,modalId:a,closeLabel:o=`Закрыть модальное окно`,className:s=``,role:c=`dialog`})=>{let l=(0,t.useContext)(Ze),d=r??l.title,f=i??l.description,p=(0,t.useId)(),m=(0,t.useId)(),h=(0,t.useRef)(null),_=Q(e=>e.closeModal),v=d!=null,y=f!=null;return(0,t.useEffect)(()=>{let e=document.activeElement,t=h.current;return(t?.querySelector(Xe)??t)?.focus(),()=>e?.focus()},[]),(0,e.jsxs)(`div`,{ref:h,className:`${Ye.panel} ${s}`,role:c,"aria-modal":`true`,"aria-labelledby":v?p:void 0,"aria-describedby":y?m:void 0,tabIndex:-1,onKeyDown:Qe,children:[(v||o)&&(0,e.jsxs)(`header`,{className:Ye.header,children:[v&&(0,e.jsx)(`h2`,{id:p,className:Ye.title,children:d}),(0,e.jsx)(u,{className:Ye.close,variant:`empty`,size:`sm`,"aria-label":o,onClick:()=>_(a),children:(0,e.jsx)(g,{name:`IconCross`,width:24,height:24})})]}),y&&(0,e.jsx)(`p`,{id:m,className:Ye.description,children:f}),(0,e.jsx)(`div`,{className:Ye.content,children:n})]})},et=({registry:r})=>{let i=Q(e=>e.modals),a=Q(e=>e.closeModal),o=Q(e=>e.closeAllModals);return(0,t.useEffect)(()=>{let e=e=>{if(e.key!==`Escape`)return;let t=Q.getState().modals.at(-1);t?.closeOnEscape&&a(t.id)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),(0,t.useEffect)(()=>{i.forEach(e=>{r[e.name]||a(e.id)})},[a,i,r]),!i.length||typeof document>`u`?null:(0,n.createPortal)((0,e.jsx)(`div`,{className:Ye.layer,"aria-label":`Модальные окна`,children:i.map((t,n)=>{let s=r[t.name];return s?(0,e.jsx)(`div`,{className:Ye.backdrop,"aria-hidden":n!==i.length-1||void 0,inert:n!==i.length-1||void 0,onMouseDown:e=>{e.target===e.currentTarget&&t.closeOnBackdrop&&a(t.id)},children:(0,e.jsx)(Ze.Provider,{value:{title:t.title??t.payload.title,description:t.description??t.payload.description},children:(0,e.jsx)(s,{...t.payload,modalId:t.id,close:()=>a(t.id),closeAll:o})})},t.id):null})}),document.body)},tt=({registry:n,children:r,lockBodyScroll:i=!0})=>{let a=Q(e=>e.modals.length);return(0,t.useEffect)(()=>{if(!i||a===0)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[i,a]),(0,e.jsxs)(e.Fragment,{children:[r,(0,e.jsx)(et,{registry:n})]})},nt=e=>e,rt={message:`_message_c23ie_1`,actions:`_actions_c23ie_13`},it=new Map,at=0,ot=({modalId:t,close:n,title:r=`Подтверждение`,message:i=`Продолжить действие?`,confirmLabel:a=`Подтвердить`,cancelLabel:o=`Отмена`,tone:s=`default`,requestId:c})=>{let l=e=>{it.get(c)?.(e),it.delete(c),n()};return(0,e.jsxs)($e,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:rt.message,children:i}),(0,e.jsxs)(`div`,{className:rt.actions,children:[(0,e.jsx)(u,{variant:`outline`,onClick:()=>l(!1),children:o}),(0,e.jsx)(u,{variant:s===`danger`?`destructive`:`primary`,onClick:()=>l(!0),children:a})]})]})},st=({modalId:t,close:n,title:r=`Ошибка`,message:i,closeLabel:a=`Закрыть`})=>(0,e.jsxs)($e,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:rt.message,children:i}),(0,e.jsx)(`div`,{className:rt.actions,children:(0,e.jsx)(u,{onClick:n,children:a})})]}),ct=nt({ConfirmModal:ot,ErrorModal:st}),lt=()=>{let e=Q(e=>e.openModal);return(t={})=>new Promise(n=>{at+=1;let r=`confirm-${at}`;it.set(r,n),e(`ConfirmModal`,{...t,requestId:r},{closeOnEscape:!1,onClose:()=>{it.get(r)?.(!1),it.delete(r)}})})},ut=e=>e instanceof Error?e.message:typeof e==`string`?e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`?e.message:`Произошла неизвестная ошибка`,dt=()=>{let e=Q(e=>e.openModal);return{showError:(t,n)=>e(`ErrorModal`,{title:n,message:ut(t)})}},ft=(0,i.create)(()=>({})),pt=(0,i.create)(()=>({})),mt=()=>{let e=Q(e=>e.modals),n=Q(e=>e.openModal),r=Q(e=>e.closeModal),i=Q(e=>e.closeTopModal),a=Q(e=>e.closeAllModals),o=(0,t.useCallback)((e,t={},r)=>n(e,t,r),[n]),s=(0,t.useCallback)(t=>e.some(e=>e.name===t),[e]);return(0,t.useMemo)(()=>({openModal:o,closeModal:r,closeTopModal:i,closeAllModals:a,isOpen:s,count:e.length}),[a,r,i,s,e.length,o])},ht={wrapper:`_wrapper_71h8n_1`,container:`_container_71h8n_15`,inner:`_inner_71h8n_35`,cube:`_cube_71h8n_53`,jump:`_jump_71h8n_1`,cube__inner:`_cube__inner_71h8n_67`,morph:`_morph_71h8n_1`},gt=()=>(0,e.jsx)(`div`,{className:ht.wrapper,children:(0,e.jsx)(`div`,{className:ht.container,children:(0,e.jsxs)(`div`,{className:ht.inner,children:[(0,e.jsx)(`div`,{className:ht.cube,children:(0,e.jsx)(`div`,{className:ht.cube__inner})}),(0,e.jsx)(`div`,{className:ht.cube,children:(0,e.jsx)(`div`,{className:ht.cube__inner})}),(0,e.jsx)(`div`,{className:ht.cube,children:(0,e.jsx)(`div`,{className:ht.cube__inner})})]})})}),_t={viewport:`_viewport_3qpmj_1`,"top-right":`_top-right_3qpmj_21`,"top-left":`_top-left_3qpmj_31`,"bottom-right":`_bottom-right_3qpmj_41`,"bottom-left":`_bottom-left_3qpmj_51`,toast:`_toast_3qpmj_61`,body:`_body_3qpmj_89`,info:`_info_3qpmj_109`,success:`_success_3qpmj_117`,warning:`_warning_3qpmj_125`,error:`_error_3qpmj_133`},vt={info:{name:`IconInfoCircle`,color:`var(--color-primary)`},success:{name:`IconSuccessCircle`,color:`var(--color-success)`},warning:{name:`IconWarning`,color:`var(--color-warning)`},error:{name:`IconWarning`,color:`var(--color-error)`}},yt=({toast:n,onClose:r})=>{let[i,a]=(0,t.useState)(!1),o=(0,t.useRef)(n.duration),s=(0,t.useRef)(Date.now());return(0,t.useEffect)(()=>{if(i||n.duration<=0)return;s.current=Date.now();let e=setTimeout(()=>r(n.id),o.current);return()=>{clearTimeout(e),o.current=Math.max(0,o.current-(Date.now()-s.current))}},[r,i,n.duration,n.id]),(0,e.jsxs)(`article`,{className:`${_t.toast} ${_t[n.variant]}`,role:n.variant===`error`?`alert`:`status`,"aria-live":n.variant===`error`?`assertive`:`polite`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),children:[(0,e.jsx)(`div`,{children:(0,e.jsx)(g,{...vt[n.variant],width:24,height:24})}),(0,e.jsxs)(`div`,{className:_t.body,children:[n.title&&(0,e.jsx)(`strong`,{children:n.title}),(0,e.jsx)(`div`,{children:n.message}),n.action&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,onClick:()=>{n.action?.onClick(),(n.action?.dismissOnClick??!0)&&r(n.id)},children:n.action.label})]}),n.closable&&(0,e.jsx)(u,{variant:`empty`,size:`sm`,"aria-label":`Закрыть уведомление`,onClick:()=>r(n.id),children:(0,e.jsx)(g,{name:`IconCross`,width:24,height:24})})]})},bt=0,xt=(0,i.create)(e=>({toasts:[],showToast:t=>{bt+=1;let n=`ds-toast-${bt}`;return e(e=>({toasts:[...e.toasts,{variant:`info`,duration:5e3,closable:!0,...t,id:n}]})),n},removeToast:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)})),clearToasts:()=>e({toasts:[]})})),St=()=>xt.setState({toasts:[]}),Ct=({position:t=`top-right`})=>{let n=xt(e=>e.toasts),r=xt(e=>e.removeToast);return(0,e.jsx)(`div`,{className:`${_t.viewport} ${_t[t]}`,"aria-label":`Уведомления`,children:n.map(t=>(0,e.jsx)(yt,{toast:t,onClose:r},t.id))})},wt=()=>{let e=xt(e=>e.showToast),n=xt(e=>e.removeToast),r=xt(e=>e.clearToasts),i=(0,t.useCallback)(t=>e({...t,variant:`info`}),[e]),a=(0,t.useCallback)(t=>e({...t,variant:`success`}),[e]),o=(0,t.useCallback)(t=>e({...t,variant:`warning`}),[e]),s=(0,t.useCallback)(t=>e({...t,variant:`error`}),[e]);return(0,t.useMemo)(()=>({showToast:e,infoToast:i,successToast:a,warningToast:o,errorToast:s,removeToast:n,clearToasts:r}),[r,s,i,n,e,a,o])},Tt={root:`_root_8dm5q_1`,tooltip:`_tooltip_8dm5q_11`,"ds-tooltip-in":`_ds-tooltip-in_8dm5q_1`,top:`_top_8dm5q_43`,bottom:`_bottom_8dm5q_55`,left:`_left_8dm5q_67`,right:`_right_8dm5q_79`},Et=({content:n,children:r,placement:i=`top`,delay:a=450,disabled:o=!1,maxWidth:s=280,className:c=``})=>{let l=(0,t.useId)(),[u,d]=(0,t.useState)(!1),f=(0,t.useRef)(null),p=()=>{o||!n||(f.current=setTimeout(()=>d(!0),a))},m=()=>{f.current&&clearTimeout(f.current),d(!1)};if((0,t.useEffect)(()=>{let e=e=>{e.key===`Escape`&&m()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),f.current&&clearTimeout(f.current)}},[]),!(0,t.isValidElement)(r))return r;let h=(0,t.cloneElement)(r,{"aria-describedby":u?l:void 0,onMouseEnter:p,onMouseLeave:m,onFocus:p,onBlur:m});return(0,e.jsxs)(`span`,{className:`${Tt.root} ${c}`,onPointerDown:u?m:p,children:[h,u&&(0,e.jsx)(`span`,{id:l,role:`tooltip`,className:`${Tt.tooltip} ${Tt[i]}`,style:{maxWidth:s},children:n})]})},Dt=e=>{if(!Number.isFinite(e)||e<0)return`00:00`;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=`${String(r).padStart(2,`0`)}:${String(i).padStart(2,`0`)}`;return n?`${n}:${a}`:a},$={root:`_root_1h73w_1`,frame:`_frame_1h73w_35`,video:`_video_1h73w_65`,overlay:`_overlay_1h73w_81`,state:`_state_1h73w_83`,buffering:`_buffering_1h73w_85`,loaderViewport:`_loaderViewport_1h73w_145`,loaderScale:`_loaderScale_1h73w_157`,stateIcon:`_stateIcon_1h73w_171`,empty:`_empty_1h73w_203`,error:`_error_1h73w_213`,replay:`_replay_1h73w_225`,controlsLayer:`_controlsLayer_1h73w_261`,controlsVisible:`_controlsVisible_1h73w_287`,controls:`_controls_1h73w_261`,controlGroup:`_controlGroup_1h73w_311`,controlButton:`_controlButton_1h73w_337`,settingsAction:`_settingsAction_1h73w_369`,timeline:`_timeline_1h73w_401`,volume:`_volume_1h73w_403`,settings:`_settings_1h73w_369`,playButton:`_playButton_1h73w_417`,volumeGroup:`_volumeGroup_1h73w_431`,timelineGroup:`_timelineGroup_1h73w_455`,time:`_time_1h73w_401`,settingsActionLabel:`_settingsActionLabel_1h73w_693`,caption:`_caption_1h73w_705`,fullscreen:`_fullscreen_1h73w_719`},Ot=2500,kt=5,At=.05,jt=[.5,.75,1,1.25,1.5,2],Mt=({sources:n,tracks:r=[],title:i,aspectRatio:a=`16 / 9`,objectFit:o=`contain`,loading:s=!1,error:l,fallback:d,className:f=``,controls:p=!0,playsInline:m=!0,...h})=>{let _=(0,t.useRef)(null),v=(0,t.useRef)(null),y=(0,t.useRef)(null),b=(0,t.useRef)(void 0),[x,S]=(0,t.useState)(!1),[C,w]=(0,t.useState)(n.length>0),[T,E]=(0,t.useState)(!1),[D,O]=(0,t.useState)(!1),[k,A]=(0,t.useState)(!1),[j,M]=(0,t.useState)(0),[N,P]=(0,t.useState)(0),[F,I]=(0,t.useState)(0),[L,R]=(0,t.useState)(1),[z,B]=(0,t.useState)(!!h.muted),[ee,V]=(0,t.useState)(1),[te,H]=(0,t.useState)(!!h.loop),[U,W]=(0,t.useState)(-1),[G,K]=(0,t.useState)(!1),[q,J]=(0,t.useState)(!0),[ne,re]=(0,t.useState)(!1),[ie,Y]=(0,t.useState)(!1),ae=n.map(({src:e,type:t})=>`${e}:${t??``}`).join(`|`),oe=r.map((e,t)=>({track:e,index:t})).filter(({track:e})=>e.kind===`captions`||e.kind===`subtitles`),se=l??(x?`Не удалось воспроизвести видео`:void 0),ce=s||C&&!se&&n.length>0,le=!ce&&!se&&n.length===0,ue=typeof document<`u`&&`pictureInPictureEnabled`in document&&document.pictureInPictureEnabled,de=(0,t.useCallback)(()=>{J(!0),window.clearTimeout(b.current),D&&!G&&(b.current=window.setTimeout(()=>J(!1),Ot))},[D,G]);(0,t.useEffect)(()=>{S(!1),w(n.length>0),E(!1),O(!1),A(!1),M(0),P(0),I(0)},[ae,n.length]),(0,t.useEffect)(()=>(de(),()=>window.clearTimeout(b.current)),[de]),(0,t.useEffect)(()=>{let e=()=>re(document.fullscreenElement===v.current),t=()=>Y(document.pictureInPictureElement===y.current);return document.addEventListener(`fullscreenchange`,e),document.addEventListener(`enterpictureinpicture`,t),document.addEventListener(`leavepictureinpicture`,t),()=>{document.removeEventListener(`fullscreenchange`,e),document.removeEventListener(`enterpictureinpicture`,t),document.removeEventListener(`leavepictureinpicture`,t)}},[]),(0,t.useEffect)(()=>{if(!G)return;let e=e=>{_.current?.contains(e.target)||K(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[G]);let fe=async()=>{let e=y.current;if(!(!e||se||ce)){if(e.paused||e.ended){e.ended&&(e.currentTime=0);try{await e.play()}catch{S(!0)}}else e.pause()}},pe=()=>{let e=y.current;e&&(e.muted=!e.muted)},me=e=>{let t=y.current;t&&(t.volume=Math.min(1,Math.max(0,e)),t.muted=t.volume===0)},he=e=>{let t=y.current;!t||!N||(t.currentTime=Math.min(N,Math.max(0,e)),M(t.currentTime))},ge=async()=>{if(v.current)try{document.fullscreenElement?await document.exitFullscreen():await v.current.requestFullscreen()}catch{re(!1)}},_e=async()=>{let e=y.current;if(!(!e||!ue))try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{Y(!1)}},ve=e=>{let t=y.current;t&&(Array.from(t.textTracks).forEach((t,n)=>{t.mode=n===e?`showing`:`disabled`}),W(e))},ye=e=>{let t=e.target;if(/^(INPUT|SELECT|BUTTON)$/.test(t.tagName))return;let n=e.key.toLowerCase();n===` `||n===`k`?(e.preventDefault(),fe()):n===`m`?(e.preventDefault(),pe()):n===`f`?(e.preventDefault(),ge()):n===`c`&&oe.length?(e.preventDefault(),ve(U===-1?oe[0].index:-1)):e.key===`ArrowLeft`||e.key===`ArrowRight`?(e.preventDefault(),he(j+(e.key===`ArrowRight`?kt:-5))):e.key===`ArrowUp`||e.key===`ArrowDown`?(e.preventDefault(),me(L+(e.key===`ArrowUp`?At:-.05))):e.key===`Escape`&&K(!1),de()},be=()=>{let e=y.current;S(!1),w(!0),e?.load()},xe={"--video-progress":`${N?j/N*100:0}%`,"--video-buffered":`${F*100}%`};return(0,e.jsxs)(`figure`,{ref:_,className:`${$.root} ${f}`,onKeyDown:ye,children:[(0,e.jsxs)(`div`,{ref:v,className:`${$.frame} ${ne?$.fullscreen:``}`,style:{aspectRatio:a},"aria-busy":ce||void 0,tabIndex:p&&n.length?0:void 0,onPointerMove:de,onPointerDown:de,onFocusCapture:de,onMouseLeave:()=>{D&&!G&&J(!1)},children:[n.length>0&&(0,e.jsxs)(`video`,{...h,ref:y,"aria-label":i,controls:!1,playsInline:m,loop:te,className:$.video,style:{objectFit:o},onClick:e=>{h.onClick?.(e),fe()},onDoubleClick:e=>{h.onDoubleClick?.(e),ge()},onLoadStart:e=>{w(!0),h.onLoadStart?.(e)},onLoadedMetadata:e=>{P(e.currentTarget.duration||0);let t=oe.find(({track:e})=>e.default);ve(t?.index??-1),h.onLoadedMetadata?.(e)},onDurationChange:e=>{P(e.currentTarget.duration||0),h.onDurationChange?.(e)},onTimeUpdate:e=>{M(e.currentTarget.currentTime),h.onTimeUpdate?.(e)},onProgress:e=>{let t=e.currentTarget;t.duration&&t.buffered.length&&I(t.buffered.end(t.buffered.length-1)/t.duration),h.onProgress?.(e)},onLoadedData:e=>{w(!1),E(!1),h.onLoadedData?.(e)},onCanPlay:e=>{w(!1),E(!1),h.onCanPlay?.(e)},onWaiting:e=>{E(!0),h.onWaiting?.(e)},onPlaying:e=>{O(!0),A(!1),E(!1),h.onPlaying?.(e)},onPlay:e=>{O(!0),h.onPlay?.(e)},onPause:e=>{O(!1),h.onPause?.(e)},onEnded:e=>{O(!1),A(!0),J(!0),h.onEnded?.(e)},onVolumeChange:e=>{R(e.currentTarget.volume),B(e.currentTarget.muted),h.onVolumeChange?.(e)},onRateChange:e=>{V(e.currentTarget.playbackRate),h.onRateChange?.(e)},onError:e=>{w(!1),E(!1),S(!0),h.onError?.(e)},children:[n.map(t=>(0,e.jsx)(`source`,{...t},`${t.src}-${t.type}`)),r.map(t=>(0,e.jsx)(`track`,{...t},`${t.src}-${t.srcLang}`))]}),ce&&(0,e.jsxs)(`div`,{className:$.overlay,role:`status`,"aria-live":`polite`,children:[(0,e.jsx)(`div`,{className:$.loaderViewport,"aria-hidden":`true`,children:(0,e.jsx)(`div`,{className:$.loaderScale,children:(0,e.jsx)(gt,{})})}),(0,e.jsx)(`span`,{children:`Загрузка видео`})]}),!ce&&T&&!se&&(0,e.jsx)(`div`,{className:$.buffering,role:`status`,"aria-label":`Буферизация видео`,children:(0,e.jsx)(c,{variant:`empty`})}),le&&(0,e.jsxs)(`div`,{className:`${$.state} ${$.empty}`,role:`status`,children:[(0,e.jsx)(g,{name:`IconInfoCircle`,className:$.stateIcon,width:40,height:40}),(0,e.jsx)(`strong`,{children:`Видео отсутствует`}),d??(0,e.jsx)(`span`,{children:`Источник видео не указан`})]}),!ce&&se&&(0,e.jsxs)(`div`,{className:`${$.state} ${$.error}`,role:`alert`,children:[(0,e.jsx)(g,{name:`IconWarning`,className:$.stateIcon,width:40,height:40}),d??(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(`strong`,{children:`Видео недоступно`}),(0,e.jsx)(`span`,{children:se})]}),n.length>0&&(0,e.jsx)(u,{size:`sm`,variant:`secondary`,onClick:be,children:`Повторить`})]}),!ce&&!se&&k&&(0,e.jsx)(`button`,{type:`button`,className:$.replay,"aria-label":`Воспроизвести заново`,onClick:()=>void fe(),children:(0,e.jsx)(g,{name:`IconReplay`,width:28,height:28})}),p&&n.length>0&&!ce&&!se&&(0,e.jsxs)(`div`,{className:`${$.controlsLayer} ${q||!D?$.controlsVisible:``}`,onClick:e=>e.stopPropagation(),children:[G&&(0,e.jsxs)(`div`,{className:$.settings,role:`dialog`,"aria-label":`Настройки видео`,children:[(0,e.jsxs)(`label`,{children:[(0,e.jsx)(`span`,{children:`Скорость`}),(0,e.jsx)(`select`,{value:ee,onChange:e=>{let t=Number(e.target.value);y.current&&(y.current.playbackRate=t)},children:jt.map(t=>(0,e.jsxs)(`option`,{value:t,children:[t,`×`]},t))})]}),oe.length>0&&(0,e.jsxs)(`label`,{children:[(0,e.jsx)(`span`,{children:`Субтитры`}),(0,e.jsxs)(`select`,{value:U,onChange:e=>ve(Number(e.target.value)),children:[(0,e.jsx)(`option`,{value:-1,children:`Выключены`}),oe.map(({track:t,index:n})=>(0,e.jsx)(`option`,{value:n,children:t.label},`${t.srcLang}-${t.label}`))]})]}),(0,e.jsxs)(`button`,{type:`button`,className:$.settingsAction,"aria-pressed":te,onClick:()=>H(e=>!e),children:[(0,e.jsx)(`span`,{children:`Повтор`}),(0,e.jsx)(`span`,{children:te?`Вкл.`:`Выкл.`})]}),ue&&(0,e.jsx)(`button`,{type:`button`,className:$.settingsAction,"aria-pressed":ie,onClick:()=>void _e(),children:(0,e.jsxs)(`span`,{className:$.settingsActionLabel,children:[(0,e.jsx)(g,{name:`IconPictureInPicture`,width:18,height:18}),`Картинка в картинке`]})})]}),(0,e.jsxs)(`div`,{className:$.controls,children:[(0,e.jsx)(`div`,{className:$.controlGroup,children:(0,e.jsx)(`button`,{type:`button`,className:`${$.controlButton} ${$.playButton}`,"aria-label":D?`Пауза`:`Воспроизвести`,title:D?`Пауза (K)`:`Воспроизвести (K)`,onClick:()=>void fe(),children:(0,e.jsx)(g,{name:D?`IconPause`:`IconPlay`,width:24,height:24})})}),(0,e.jsxs)(`div`,{className:`${$.controlGroup} ${$.volumeGroup}`,children:[(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":z?`Включить звук`:`Выключить звук`,"aria-pressed":z,title:`Звук (M)`,onClick:pe,children:(0,e.jsx)(g,{name:z||L===0?`IconVolumeMuted`:`IconVolume`,width:22,height:22})}),(0,e.jsx)(`input`,{className:$.volume,type:`range`,min:0,max:1,step:.05,value:z?0:L,"aria-label":`Громкость`,"aria-valuetext":`${Math.round((z?0:L)*100)}%`,onChange:e=>me(Number(e.target.value))})]}),(0,e.jsxs)(`div`,{className:`${$.controlGroup} ${$.timelineGroup}`,children:[(0,e.jsx)(`span`,{className:$.time,children:Dt(j)}),(0,e.jsx)(`input`,{className:$.timeline,style:xe,type:`range`,min:0,max:N||0,step:.01,value:Math.min(j,N||0),"aria-label":`Позиция воспроизведения`,"aria-valuetext":`${Dt(j)} из ${Dt(N)}`,onChange:e=>he(Number(e.target.value))}),(0,e.jsx)(`span`,{className:$.time,children:Dt(N)})]}),(0,e.jsxs)(`div`,{className:$.controlGroup,children:[(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":`Настройки`,"aria-expanded":G,title:`Настройки`,onClick:()=>K(e=>!e),children:(0,e.jsx)(g,{name:`IconSettings`,width:22,height:22})}),(0,e.jsx)(`button`,{type:`button`,className:$.controlButton,"aria-label":ne?`Выйти из полноэкранного режима`:`Полноэкранный режим`,title:`Полноэкранный режим (F)`,onClick:()=>void ge(),children:(0,e.jsx)(g,{name:ne?`IconFullscreenExit`:`IconFullscreen`,width:22,height:22})})]})]})]})]}),(0,e.jsx)(`figcaption`,{className:$.caption,children:i})]})},Nt={root:`_root_ymidq_1`,trigger:`_trigger_ymidq_15`,heading:`_heading_ymidq_41`,title:`_title_ymidq_51`,subtitle:`_subtitle_ymidq_59`,icon:`_icon_ymidq_69`,open:`_open_ymidq_91`,content:`_content_ymidq_99`,contentInner:`_contentInner_ymidq_119`},Pt=(e,t,n,r=16)=>{if(t>Math.max(0,n-r*2)){let t=e-r;return Math.abs(t)<=1?{alignment:`none`,delta:0}:{alignment:`start`,delta:t}}let i=e+t,a=n-r;return i>a?{alignment:`end`,delta:i-a}:e<r?{alignment:`start`,delta:e-r}:{alignment:`none`,delta:0}},Ft=({title:n,subtitle:r,children:i,defaultOpen:a=!1,open:o,onOpenChange:s,autoScrollOnOpen:c=!0,scrollOffset:l=16,className:u=``})=>{let d=(0,t.useId)(),[f,p]=(0,t.useState)(a),m=o??f,h=(0,t.useRef)(null),_=(0,t.useRef)(null),v=(0,t.useRef)(m);return(0,t.useEffect)(()=>{let e=v.current;if(v.current=m,!m||e||!c)return;let t=h.current,n=_.current;if(!t||!n||typeof window>`u`)return;let r=!1,i=()=>{if(r)return;r=!0;let e=t.getBoundingClientRect(),n=Pt(e.top,e.height,window.innerHeight,l);if(n.alignment===`none`)return;let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;window.scrollBy({top:n.delta,behavior:i?`auto`:`smooth`})},a=e=>{e.target===n&&e.propertyName===`grid-template-rows`&&i()};n.addEventListener(`transitionend`,a);let o=window.setTimeout(i,280);return()=>{n.removeEventListener(`transitionend`,a),window.clearTimeout(o)}},[c,m,l]),(0,e.jsxs)(`section`,{ref:h,className:`${Nt.root} ${m?Nt.open:``} ${u}`,children:[(0,e.jsxs)(`button`,{type:`button`,className:Nt.trigger,"aria-expanded":m,"aria-controls":d,onClick:()=>{let e=!m;o===void 0&&p(e),s?.(e)},children:[(0,e.jsxs)(`span`,{className:Nt.heading,children:[(0,e.jsx)(`span`,{className:Nt.title,children:n}),r&&(0,e.jsx)(`span`,{className:Nt.subtitle,children:r})]}),(0,e.jsx)(`span`,{className:Nt.icon,"aria-hidden":`true`,children:(0,e.jsx)(g,{name:`IconChevron`,width:20,height:20})})]}),(0,e.jsx)(`div`,{ref:_,id:d,className:Nt.content,"aria-hidden":!m,children:(0,e.jsx)(`div`,{className:Nt.contentInner,children:i})})]})},It=({children:e,containerId:r=`overlay-root`})=>{let[i,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let e=document.getElementById(r);if(e){a(e);return}let t=document.createElement(`div`);return t.id=r,document.body.appendChild(t),a(t),()=>{t.childElementCount===0&&t.parentElement&&t.remove()}},[r]),i?(0,n.createPortal)(e,i):null};exports.ConfirmModal=ot,exports.DSAccordion=Ft,exports.DSBadge=o,exports.DSButton=u,exports.DSCheckbox=v,exports.DSDataTable=_e,exports.DSDateRange=V,exports.DSDateTimePicker=z,exports.DSDropDown=ne,exports.DSDropDownMultiple=Se,exports.DSFieldLabel=f,exports.DSFieldMessage=p,exports.DSFileInput=He,exports.DSFilters=Re,exports.DSIcon=g,exports.DSInfoBlock=Pe,exports.DSInput=we,exports.DSLoader=c,exports.DSModal=et,exports.DSModalFrame=$e,exports.DSPageLoader=gt,exports.DSPortal=It,exports.DSRadioButton=Ie,exports.DSSearchDropDown=Me,exports.DSSkeleton=H,exports.DSSort=ie,exports.DSTextarea=Ke,exports.DSToast=yt,exports.DSToastProvider=Ct,exports.DSTooltip=Et,exports.DSVideoPlayerFrame=Mt,exports.ErrorModal=st,exports.ModalSystemProvider=tt,exports.builtInModalRegistry=ct,exports.defineModalRegistry=nt,exports.formatDateInputValue=T,exports.formatDateTimeLocalValue=j,exports.getDSAccordionScrollTarget=Pt,exports.getDSDataTableColumnStyle=oe,exports.getDSDataTablePaginationItems=se,exports.getErrorMessage=ut,exports.getNextEnabledOptionIndex=q,exports.isValidDateInputPrefix=O,exports.isValidDateRange=ee,exports.maskDateInputValue=E,exports.parseDateInputValue=k,exports.parseDateTimeLocalValue=M,exports.resetModalStore=Je,exports.resetToastStore=St,exports.useConfirmModal=lt,exports.useConfirmModalStore=ft,exports.useErrorModal=dt,exports.useErrorModalStore=pt,exports.useModals=mt,exports.useModalsStore=Q,exports.useToast=wt,exports.useToastStore=xt,exports.validateDSDataTableData=ce;