"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[9],{56:(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"}})}},115:(e,n,t)=>{t.d(n,{a:()=>c});var r=t(0),o=t(26),a=t(2);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,o.forwardRef)((({children:e,disabled:n=!1,isActive:t,autoFocus:o=!0,restoreFocus:c=!0,as:l="div",className:u,style:s,"aria-label":d,"aria-labelledby":f,"aria-modal":m,role:p,id:b,"data-testid":v,onTransitionEnd:y,onAnimationEnd:h},g)=>{const k=(0,a.useRef)(null),x=(0,a.useRef)(null),E=(0,a.useRef)(null),w=(0,a.useRef)(null),C=(0,a.useCallback)((()=>void 0!==t?t():!n),[t,n]),j=(0,a.useCallback)((e=>{k.current=e,"function"==typeof g?g(e):g&&(g.current=e)}),[g]),R=(0,a.useCallback)((()=>{const e=k.current;if(!e)return null;const n=Array.from(e.querySelectorAll(i));for(const e of n)if(e!==x.current&&e!==E.current)return e;return null}),[]),A=(0,a.useCallback)((()=>{const e=k.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!==x.current&&t!==E.current)return t}return null}),[]),F=(0,a.useCallback)((()=>{var e;if(!C())return;const n=A();n?n.focus():null===(e=k.current)||void 0===e||e.focus()}),[C,A]),S=(0,a.useCallback)((()=>{var e;if(!C())return;const n=R();n?n.focus():null===(e=k.current)||void 0===e||e.focus()}),[C,R]);(0,a.useEffect)((()=>{var e;if("undefined"!=typeof document&&!n)return c&&(w.current=document.activeElement),o&&(null===(e=k.current)||void 0===e||e.focus({preventScroll:!0})),()=>{c&&w.current instanceof HTMLElement&&(w.current.focus(),w.current=null)}}),[n,o,c]),(0,a.useEffect)((()=>{if("undefined"==typeof document)return;const e=k.current,n=n=>{if(C()&&"Tab"===n.key&&e&&document.activeElement===e)if(n.preventDefault(),n.shiftKey){const e=A();null==e||e.focus()}else{const e=R();null==e||e.focus()}},t=n=>{if(!C()||!e)return;const t=n.target;if(t!==x.current&&t!==E.current&&!e.contains(t)){n.stopPropagation();const t=R();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)}}),[C,R,A]);const L={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"},O=void 0!==t?0:n?-1:0;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{ref:x,style:L,tabIndex:O,onFocus:F,"aria-hidden":"true"}),(0,r.jsx)(l,{ref:j,id:b,tabIndex:-1,className:u,style:s,role:p,"aria-label":d,"aria-labelledby":f,"aria-modal":m,"data-testid":v,onTransitionEnd:y,onAnimationEnd:h,children:e}),(0,r.jsx)("div",{ref:E,style:L,tabIndex:O,onFocus:S,"aria-hidden":"true"})]})}));c.displayName="FocusLock"},79:(e,n,t)=>{t.d(n,{a:()=>l});var r=t(0),o=t(2),a=t(26),i=t(115);let c=[];function l({isOpen:e,children:n,keepMounted:t=!1,onEscape:l}){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 c.push(n),s(!0),()=>{c=c.filter((e=>e!==n))}}),[e]),(0,o.useEffect)((()=>{if("undefined"==typeof document||!e||!l)return;const n=e=>{"Escape"===e.key&&c[c.length-1]===d.current&&(e.stopPropagation(),e.preventDefault(),l())};return document.addEventListener("keydown",n,!0),()=>document.removeEventListener("keydown",n,!0)}),[e,l]);const p=(0,o.useCallback)((()=>!!e&&c[c.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)(i.a,{ref:f,disabled:b,isActive:p,autoFocus:e&&u,restoreFocus:!1,children:n}),document.body)}},37:(e,n,t)=>{t.d(n,{a:()=>l});var r=t(0),o=t(9),a=t(56),i=t(79),c=t(116);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]}))]})})}},116:(e,n,t)=>{t.d(n,{a:()=>a});var r=t(2),o=t(117);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])}}},117:(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])}}}]);