(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1263],{5667:(e,t,n)=>{"use strict";n.d(t,{D:()=>N,a:()=>A,g:()=>b,h:()=>C});var o=n(37876),a=n(9789),r=n(14232),l=n(69241),i=n(42036),s=n(50698),c=n(94882),d=n(43509),u=n(73044),p=n(68086),f=n(68990),m=n(14595);n(20321);let h=r.useEffect;function v(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],window.matchMedia(e).matches}Object.freeze({divider:(0,a.g)("dropdown-divider")});let g=(0,a.g)("dropdown-group");Object.freeze({group:g,title:"".concat(g,"__title"),content:"".concat(g,"__content")});let w=(0,a.g)("dropdown-option"),x=Object.freeze({option:w,slot:"".concat(w,"__slot"),iconSlot:"".concat(w,"__slot--icon"),wrapper:"".concat(w,"__wrapper"),label:"".concat(w,"__label"),caption:"".concat(w,"__caption"),states:{danger:"".concat(w,"--danger"),success:"".concat(w,"--success"),focused:"".concat(w,"--focused"),disabled:"".concat(w,"--disabled")}});function b(e){let{as:t,label:n,caption:a,iconLeft:i,iconRight:s,prepend:c,append:d,variant:u="default",disabled:p=!1,focused:f=!1,className:m,onClick:h,...v}=e,g=(0,l.A)(m,x.option,{[x.states.focused]:f,[x.states.success]:"success"===u,[x.states.danger]:"danger"===u,[x.states.disabled]:!!p}),w=(0,r.useCallback)(e=>{e.preventDefault(),p||null==h||h(e)},[p,h]);return(0,o.jsxs)(t||"div",{...v,className:g,"aria-disabled":p,onClick:w,children:[c&&(0,o.jsx)("span",{className:x.slot,children:c}),i&&(0,o.jsx)("span",{className:(0,l.A)(x.slot,x.iconSlot),children:i}),(0,o.jsxs)("div",{className:x.wrapper,children:[(0,o.jsx)("span",{className:x.label,children:n}),a&&(0,o.jsx)("span",{className:x.caption,children:a})]}),s&&(0,o.jsx)("span",{className:(0,l.A)(x.slot,x.iconSlot),children:s}),d&&(0,o.jsx)("span",{className:x.slot,children:d})]})}let _=(0,r.createContext)(null),j=()=>{let e=(0,r.useContext)(_);if(null===e)throw Error("Dropdown components must be wrapped in <Dropdown />");return e},N=e=>{let{children:t,...n}=e,a=function(){let{placement:e="bottom",width:t="auto",desktopMaxHeight:n,mobileFullHeight:o=!1,title:a,description:l,opened:d,onToggle:u,heading:p,footer:f,dataQa:m,dataId:h}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[v,g]=(0,r.useState)(!1),w=null!=d?d:v,x=null!=u?u:g,b=(0,i.we)({open:w,onOpenChange:x,placement:e,whileElementsMounted:s.ll,middleware:[(0,c.cY)(8),(0,c.UU)({fallbackAxisSideDirection:"none"}),(0,c.BN)({crossAxis:!1,padding:8})]});return(0,r.useMemo)(()=>({open:w,setOpen:x,...b,width:t,desktopMaxHeight:n,title:a,description:l,heading:p,footer:f,mobileFullHeight:o,dataQa:m,dataId:h}),[w,x,b,t,n,a,l,p,f,o,m,h])}(n);return(0,o.jsx)(_.Provider,{value:a,children:t})};N.displayName="Dropdown";let y=(0,a.g)("dropdown"),E=Object.freeze({dropdown:y,overlay:"".concat(y,"__overlay"),mobileHeading:"".concat(y,"__mobile-heading"),heading:"".concat(y,"__heading"),title:"".concat(y,"__title"),description:"".concat(y,"__description"),content:"".concat(y,"__content"),contentInner:"".concat(y,"__content-inner"),footer:"".concat(y,"__footer"),close:"".concat(y,"__close"),closeIcon:"".concat(y,"__close-icon"),states:{auto:"".concat(y,"--auto"),fullHeight:"".concat(y,"--full-height")}}),D=e=>{let{footer:t,...n}=e;return t?(0,o.jsx)("div",{...n,className:E.footer,children:t}):null};D.displayName="DropdownFooter";let k=e=>{let{title:t,description:n,heading:a,isDesktop:l,setOpen:i,...s}=e,c=(0,r.useMemo)(()=>a||(l&&(t||n)?(0,o.jsxs)(o.Fragment,{children:[t&&(0,o.jsx)("div",{className:E.title,children:t}),n&&(0,o.jsx)("div",{className:E.description,children:n})]}):null),[n,a,l,t]);return(0,o.jsxs)(o.Fragment,{children:[!l&&(0,o.jsxs)("div",{...s,className:E.mobileHeading,children:[t&&(0,o.jsx)("div",{className:E.title,children:t}),n&&(0,o.jsx)("div",{className:E.description,children:n}),(0,o.jsx)("button",{className:E.close,type:"button",tabIndex:-1,"aria-label":"Закрыть окно",onClick:()=>i(!1),children:(0,o.jsx)(m.P,{"aria-hidden":"true",className:E.closeIcon,style:{display:"inline-flex"},children:(0,o.jsx)(f.S,{})})})]}),c&&(0,o.jsx)("div",{...s,className:E.heading,children:c})]})};k.displayName="DropdownHeader";let A=(0,r.forwardRef)((e,t)=>{var n,a;let{style:s,contentInnerRef:c,...f}=e,{open:m,context:g,width:w,floatingStyles:x,refs:b,heading:_,title:N,description:y,footer:A,desktopMaxHeight:C,mobileFullHeight:L,dataQa:R,dataId:S,setOpen:P}=j(),T=(0,i.SV)([b.setFloating,t]),F=(0,r.useRef)(null),M=function(e){let{minWidth:t}=u.a.s;return function(e){let{defaultValue:t=!1,initializeWithValue:n=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[o,a]=(0,r.useState)(()=>n?v(e,t):null!=t&&t);function l(){a(v(e))}return h(()=>{let t=window.matchMedia(e);return l(),"function"==typeof t.addListener?t.addListener(l):t.addEventListener("change",l),()=>{"function"==typeof t.removeListener?t.removeListener(l):t.removeEventListener("change",l)}},[e]),o}("screen and (min-width: ".concat(t,"px)"))}(0),{isMounted:z,styles:H}=(0,i.DL)(g,{initial:{opacity:.2,transform:M?"translate(0, 0)":"translate(0, 100%)"},open:{opacity:1,transform:"translate(0, 0)"},duration:{open:300,close:100}});if((0,r.useEffect)(()=>{let e=e=>{let{target:t}=e;m&&([F.current,b.reference.current].some(e=>e===t||e&&e.contains(t))||P(!1))};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[m,b.reference,P]),!z)return null;let I=(0,o.jsxs)("div",{ref:F,className:(0,l.A)(E.dropdown,{[E.states.fullHeight]:L}),role:M?"popup":"dialog","aria-modal":!M,"data-id":S,"data-qa":R,style:H,children:[(0,o.jsx)(k,{title:N,description:y,heading:_,isDesktop:M,setOpen:P,"data-qa":(0,p.g)("".concat(R,"-header"),!!R)}),(0,o.jsx)("div",{...f,className:E.content,"data-qa":(0,p.g)("".concat(R,"-content"),!!R),children:(0,o.jsx)("div",{className:E.contentInner,style:{maxHeight:M?C:void 0},ref:c,children:f.children})}),(0,o.jsx)(D,{"data-qa":(0,p.g)("".concat(R,"-header"),!!R),footer:A})]});if(M){let e;return"inherit"===w?e=null==(a=null==(n=null==b?void 0:b.reference)?void 0:n.current)?void 0:a.clientWidth:"auto"===w?e=void 0:"number"==typeof w&&(e=w),(0,o.jsx)("div",{className:(0,l.A)(E.overlay,{[E.states.auto]:"auto"===w}),style:{...s,...x,...void 0!==e&&{width:e}},ref:T,children:I})}return(0,o.jsx)(i.XF,{id:d.D,children:(0,o.jsx)(i.zR,{lockScroll:!0,className:(0,l.A)(E.overlay,{[E.states.auto]:"auto"===w}),style:s,ref:T,children:I})})});A.displayName="DropdownContent";let C=(0,r.forwardRef)(function(e,t){let{children:n,asChild:a=!1,disabled:l,...s}=e,{refs:c,open:d,setOpen:u}=j(),p=n.ref,f=(0,i.SV)([c.setReference,t,p]),m=(0,r.useCallback)(()=>{l||u(!d)},[l,d,u]);return a&&(0,r.isValidElement)(n)?(0,r.cloneElement)(n,{ref:f,disabled:l,onClick:m,...s,...n.props}):(0,o.jsx)("button",{ref:f,onClick:m,disabled:l,...s,type:"button",children:n})});C.displayName="DropdownTrigger"},20321:()=>{},43509:(e,t,n)=>{"use strict";n.d(t,{D:()=>r,M:()=>o,T:()=>a});let o="finkit-modals",a="finkit-tooltips",r="finkit-dropdown"},68990:(e,t,n)=>{"use strict";n.d(t,{S:()=>a});var o=n(14232);function a(e){return o.createElement("svg",{viewBox:"0 0 24 24",width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},o.createElement("path",{d:"M7.22 7.22a.743.743 0 0 1 1.06 0L12 10.94l3.72-3.72a.743.743 0 0 1 1.06 0 .742.742 0 0 1 0 1.06L13.061 12l3.72 3.72a.743.743 0 0 1 0 1.06.743.743 0 0 1-1.061 0L12 13.06l-3.72 3.72a.743.743 0 0 1-1.06 0 .743.743 0 0 1 0-1.06L10.94 12 7.22 8.28a.743.743 0 0 1 0-1.06Z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}))}},88913:(e,t,n)=>{"use strict";n.d(t,{EW:()=>g,F2:()=>v,Go:()=>p,O_:()=>f,Pg:()=>c,RS:()=>a,WZ:()=>x,YE:()=>h,YF:()=>s,gR:()=>r,jo:()=>w,nr:()=>d,tZ:()=>m,uo:()=>l});var o=n(84974);function a(e){let t=e.activeElement;for(;(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function r(e,t){if(!e||!t)return!1;let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&(0,o.Ng)(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function l(){let e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function i(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function s(e){return 0===e.mozInputSource&&!!e.isTrusted||(u()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function c(e){return!i().includes("jsdom/")&&(!u()&&0===e.width&&0===e.height||u()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function d(){return/apple/i.test(navigator.vendor)}function u(){let e=/android/i;return e.test(l())||e.test(i())}function p(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function f(e){return"nativeEvent"in e}function m(e){return e.matches("html,body")}function h(e){return(null==e?void 0:e.ownerDocument)||document}function v(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function g(e){return"composedPath"in e?e.composedPath()[0]:e.target}function w(e){e.preventDefault(),e.stopPropagation()}function x(e){return!!e&&"combobox"===e.getAttribute("role")&&(0,o.sb)(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}}}]);