"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[9],{54:(e,n,t)=>{t.d(n,{a:()=>o});var r=t(0);function o({size:e,iconClass:n}){return(0,r.jsx)("div",{"aria-hidden":"true",role:"presentation",class:n,style:{width:e||"",height:e||"",backgroundImage:"var(--icon-close)",backgroundSize:"contain",cursor:"pointer",backgroundRepeat:"no-repeat",backgroundOrigin:"content-box"}})}},77:(e,n,t)=>{t.d(n,{a:()=>u});var r=t(0),o=t(2),a=t(26);const i='\n a[href],\n area[href],\n input:not([type="hidden"]):not([disabled]):not([tabindex="-1"]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]):not([tabindex="-1"]),\n iframe,\n object,\n embed,\n [tabindex]:not([tabindex="-1"]),\n [contenteditable]:not([contenteditable="false"]),\n audio[controls],\n video[controls],\n summary',c=(0,a.forwardRef)((({children:e,disabled:n=!1,isActive:t,autoFocus:a=!0,restoreFocus:c=!0,as:l="div",className:u,style:s,"aria-label":d,"aria-labelledby":f,"aria-modal":m,role:p,"data-testid":b,onTransitionEnd:v,onAnimationEnd:y},h)=>{const g=(0,o.useRef)(null),k=(0,o.useRef)(null),x=(0,o.useRef)(null),E=(0,o.useRef)(null),w=(0,o.useCallback)((()=>void 0!==t?t():!n),[t,n]),C=(0,o.useCallback)((e=>{g.current=e,"function"==typeof h?h(e):h&&(h.current=e)}),[h]),j=(0,o.useCallback)((()=>{const e=g.current;if(!e)return null;const n=Array.from(e.querySelectorAll(i));for(const e of n)if(e!==k.current&&e!==x.current)return e;return null}),[]),R=(0,o.useCallback)((()=>{const e=g.current;if(!e)return null;const n=Array.from(e.querySelectorAll(i));for(let e=n.length-1;e>=0;e--){const t=n[e];if(t!==k.current&&t!==x.current)return t}return null}),[]),A=(0,o.useCallback)((()=>{var e;if(!w())return;const n=R();n?n.focus():null===(e=g.current)||void 0===e||e.focus()}),[w,R]),F=(0,o.useCallback)((()=>{var e;if(!w())return;const n=j();n?n.focus():null===(e=g.current)||void 0===e||e.focus()}),[w,j]);(0,o.useEffect)((()=>{var e;if("undefined"!=typeof document&&!n)return c&&(E.current=document.activeElement),a&&(null===(e=g.current)||void 0===e||e.focus({preventScroll:!0})),()=>{c&&E.current instanceof HTMLElement&&(E.current.focus(),E.current=null)}}),[n,a,c]),(0,o.useEffect)((()=>{if("undefined"==typeof document)return;const e=g.current,n=n=>{if(w()&&"Tab"===n.key&&e&&document.activeElement===e)if(n.preventDefault(),n.shiftKey){const e=R();null==e||e.focus()}else{const e=j();null==e||e.focus()}},t=n=>{if(!w()||!e)return;const t=n.target;if(t!==k.current&&t!==x.current&&!e.contains(t)){n.stopPropagation();const t=j();t?t.focus():e.focus()}};return document.addEventListener("keydown",n,!0),document.addEventListener("focusin",t,!0),()=>{document.removeEventListener("keydown",n,!0),document.removeEventListener("focusin",t,!0)}}),[w,j,R]);const S={position:"fixed",top:0,left:0,width:"1px",height:"1px",margin:"-1px",padding:"0",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"},L=void 0!==t?0:n?-1:0;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{ref:k,style:S,tabIndex:L,onFocus:A,"aria-hidden":"true"}),(0,r.jsx)(l,{ref:C,tabIndex:-1,className:u,style:s,role:p,"aria-label":d,"aria-labelledby":f,"aria-modal":m,"data-testid":b,onTransitionEnd:v,onAnimationEnd:y,children:e}),(0,r.jsx)("div",{ref:x,style:S,tabIndex:L,onFocus:F,"aria-hidden":"true"})]})}));c.displayName="FocusLock";let l=[];function u({isOpen:e,children:n,keepMounted:t=!1,onEscape:i}){const[u,s]=(0,o.useState)(!1),d=(0,o.useRef)(Symbol("focus-portal")),f=(0,o.useRef)(null);!function(e){const n=(0,o.useRef)(null);(0,o.useEffect)((()=>{if("undefined"!=typeof document&&e)return n.current=document.activeElement,()=>{n.current instanceof HTMLElement&&(n.current.focus(),n.current=null)}}),[e])}(e);const m=function(e,n){const[t,r]=(0,o.useState)("inactive"),a=(0,o.useRef)(e);return a.current=e,(0,o.useEffect)((()=>{if(!e)return void r("inactive");r("waiting");let t=!1;const o=requestAnimationFrame((()=>{if(t||!a.current)return;const e=n.current;if(!e)return void r("complete");const o=e.querySelector("[data-animate]")||e.firstElementChild;if(!o)return void r("complete");const i=o.getAnimations({subtree:!1});0!==i.length?Promise.all(i.map((e=>e.finished))).then((()=>{!t&&a.current&&r("complete")})).catch((()=>{!t&&a.current&&r("complete")})):r("complete")}));return()=>{t=!0,cancelAnimationFrame(o)}}),[e,n]),t}(e,f);(0,o.useEffect)((()=>{if(!e)return void s(!1);const n=d.current;return l.push(n),s(!0),()=>{l=l.filter((e=>e!==n))}}),[e]),(0,o.useEffect)((()=>{if("undefined"==typeof document||!e||!i)return;const n=e=>{"Escape"===e.key&&l[l.length-1]===d.current&&(e.stopPropagation(),e.preventDefault(),i())};return document.addEventListener("keydown",n,!0),()=>document.removeEventListener("keydown",n,!0)}),[e,i]);const p=(0,o.useCallback)((()=>!!e&&l[l.length-1]===d.current),[e]);if("undefined"==typeof document)return null;if(!e&&!t)return null;const b="complete"!==m||!u;return(0,a.createPortal)((0,r.jsx)(c,{ref:f,disabled:b,isActive:p,autoFocus:e&&u,restoreFocus:!1,children:n}),document.body)}},39:(e,n,t)=>{t.d(n,{a:()=>l});var r=t(0),o=t(9),a=t(54),i=t(77),c=t(111);function l({isOpen:e,onClose:n,children:t,title:l,fitContent:u=!1,keepMounted:s=!1}){const{dialogProps:d}=(0,c.a)({isOpen:e,label:l}),f=e?o.a.modalOverlay:o.a.modalOverlayHidden;return(0,r.jsx)(i.a,{isOpen:e,keepMounted:s,onEscape:n,children:(0,r.jsxs)("div",{className:f,"aria-hidden":!e,children:[(0,r.jsx)("div",{className:o.a.modalBackground,onClick:n,role:"presentation"}),(0,r.jsxs)("div",Object.assign({},d,{className:[o.a.modal,u?o.a.fitContent:""].join(" "),children:[(0,r.jsx)("button",{className:o.a.closeBtn,onClick:n,"aria-label":"Close dialog",children:(0,r.jsx)(a.a,{size:"14px",iconClass:o.a.closeIconSVG})}),t]}))]})})}},111:(e,n,t)=>{t.d(n,{a:()=>a});var r=t(2),o=t(112);function a({isOpen:e,label:n,labelledBy:t}){return(0,o.a)(e),{dialogProps:(0,r.useMemo)((()=>({role:"dialog","aria-modal":!0,"aria-label":t?void 0:n,"aria-labelledby":t,tabIndex:-1})),[n,t])}}},112:(e,n,t)=>{t.d(n,{a:()=>i});var r=t(2);let o=0,a=null;function i(e){(0,r.useEffect)((()=>{if("undefined"!=typeof document&&e){if(0===o){a={overflow:document.body.style.overflow,paddingRight:document.body.style.paddingRight};const e=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=`${e}px`}return o++,()=>{o--,o<0&&(o=0),0===o&&a&&(document.body.style.overflow=a.overflow,document.body.style.paddingRight=a.paddingRight,a=null)}}}),[e])}}}]);