"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[80161],{80161:(e,t,n)=>{n.d(t,{K:()=>p});var a=n(19130);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n0){var n=e[e.length-1];n!==t&&n._setPausedState(!0)}var a=e.indexOf(t);-1===a||e.splice(a,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&!e[e.length-1]._isManuallyPaused()&&e[e.length-1]._setPausedState(!1)}},s=function(e){return(null==e?void 0:e.key)==="Tab"||(null==e?void 0:e.keyCode)===9},c=function(e){return s(e)&&!e.shiftKey},l=function(e){return s(e)&&e.shiftKey},d=function(e){return setTimeout(e,0)},f=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a1&&void 0!==arguments[1]?arguments[1]:{},a=n.hasFallback,i=n.params,u=y[e];if("function"==typeof u&&(u=u.apply(void 0,function(e){if(Array.isArray(e))return o(e)}(t=void 0===i?[]:i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return o(e,void 0);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),!0===u&&(u=void 0),!u){if(void 0===u||!1===u)return u;throw Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var s=u;if("string"==typeof u){try{s=r.querySelector(u)}catch(t){throw Error("`".concat(e,'` appears to be an invalid selector; error="').concat(t.message,'"'))}if(!s&&!(void 0!==a&&a))throw Error("`".concat(e,"` as selector refers to no known node"))}return s},O=function(){var e=w("initialFocus",{hasFallback:!0});if(!1===e)return!1;if(void 0===e||e&&!(0,a.tp)(e,y.tabbableOptions))if(g(r.activeElement)>=0)e=r.activeElement;else{var t=m.tabbableGroups[0];e=t&&t.firstTabbableNode||w("fallbackFocus")}else null===e&&(e=w("fallbackFocus"));if(!e)throw Error("Your focus-trap needs to have at least one focusable element");return e},N=function(){if(m.containerGroups=m.containers.map(function(e){var t=(0,a.Kr)(e,y.tabbableOptions),n=(0,a.nq)(e,y.tabbableOptions),o=t.length>0?t[0]:void 0,r=t.length>0?t[t.length-1]:void 0,i=n.find(function(e){return(0,a.AO)(e)}),u=n.slice().reverse().find(function(e){return(0,a.AO)(e)}),s=!!t.find(function(e){return(0,a.yT)(e)>0});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:s,firstTabbableNode:o,lastTabbableNode:r,firstDomTabbableNode:i,lastDomTabbableNode:u,nextTabbableNode:function(e){var o=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=t.indexOf(e);return r<0?o?n.slice(n.indexOf(e)+1).find(function(e){return(0,a.AO)(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return(0,a.AO)(e)}):(0,t[r+(o?1:-1)])}}}),m.tabbableGroups=m.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),m.tabbableGroups.length<=0&&!w("fallbackFocus"))throw Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(m.containerGroups.find(function(e){return e.posTabIndexesFound})&&m.containerGroups.length>1)throw Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},F=function(e){var t=e.activeElement;if(t)return t.shadowRoot&&null!==t.shadowRoot.activeElement?F(t.shadowRoot):t},k=function(e){if(!1!==e&&e!==F(document)){if(!e||!e.focus){k(O());return}e.focus({preventScroll:!!y.preventScroll}),m.mostRecentlyFocusedNode=e,e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select&&e.select()}},T=function(e){var t=w("setReturnFocus",{params:[e]});return t||!1!==t&&e},E=function(e){var t=e.target,n=e.event,o=e.isBackward,r=void 0!==o&&o;t=t||b(n),N();var i=null;if(m.tabbableGroups.length>0){var u=g(t,n),c=u>=0?m.containerGroups[u]:void 0;if(u<0)i=r?m.tabbableGroups[m.tabbableGroups.length-1].lastTabbableNode:m.tabbableGroups[0].firstTabbableNode;else if(r){var l=m.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(l<0&&(c.container===t||(0,a.tp)(t,y.tabbableOptions)&&!(0,a.AO)(t,y.tabbableOptions)&&!c.nextTabbableNode(t,!1))&&(l=u),l>=0){var d=0===l?m.tabbableGroups.length-1:l-1,f=m.tabbableGroups[d];i=(0,a.yT)(t)>=0?f.lastTabbableNode:f.lastDomTabbableNode}else s(n)||(i=c.nextTabbableNode(t,!1))}else{var v=m.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(v<0&&(c.container===t||(0,a.tp)(t,y.tabbableOptions)&&!(0,a.AO)(t,y.tabbableOptions)&&!c.nextTabbableNode(t))&&(v=u),v>=0){var p=v===m.tabbableGroups.length-1?0:v+1,h=m.tabbableGroups[p];i=(0,a.yT)(t)>=0?h.firstTabbableNode:h.firstDomTabbableNode}else s(n)||(i=c.nextTabbableNode(t))}}else i=w("fallbackFocus");return i},P=function(e){if(!(g(b(e),e)>=0)){if(f(y.clickOutsideDeactivates,e)){n.deactivate({returnFocus:y.returnFocusOnDeactivate});return}f(y.allowOutsideClick,e)||e.preventDefault()}},D=function(e){var t=b(e),n=g(t,e)>=0;if(n||t instanceof Document)n&&(m.mostRecentlyFocusedNode=t);else{e.stopImmediatePropagation();var o,r=!0;if(m.mostRecentlyFocusedNode)if((0,a.yT)(m.mostRecentlyFocusedNode)>0){var i=g(m.mostRecentlyFocusedNode),u=m.containerGroups[i].tabbableNodes;if(u.length>0){var s=u.findIndex(function(e){return e===m.mostRecentlyFocusedNode});s>=0&&(y.isKeyForward(m.recentNavEvent)?s+1=0&&(o=u[s-1],r=!1))}}else m.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return(0,a.yT)(e)>0})})||(r=!1);else r=!1;r&&(o=E({target:m.mostRecentlyFocusedNode,isBackward:y.isKeyBackward(m.recentNavEvent)})),o?k(o):k(m.mostRecentlyFocusedNode||O())}m.recentNavEvent=void 0},G=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];m.recentNavEvent=e;var n=E({event:e,isBackward:t});n&&(s(e)&&e.preventDefault(),k(n))},A=function(e){(y.isKeyForward(e)||y.isKeyBackward(e))&&G(e,y.isKeyBackward(e))},S=function(e){((null==e?void 0:e.key)==="Escape"||(null==e?void 0:e.key)==="Esc"||(null==e?void 0:e.keyCode)===27)&&!1!==f(y.escapeDeactivates,e)&&(e.preventDefault(),n.deactivate())},x=function(e){!(g(b(e),e)>=0||f(y.clickOutsideDeactivates,e))&&(f(y.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation()))},R=function(){if(m.active)return u.activateTrap(p,n),m.delayInitialFocusTimer=y.delayInitialFocus?d(function(){k(O())}):k(O()),r.addEventListener("focusin",D,!0),r.addEventListener("mousedown",P,{capture:!0,passive:!1}),r.addEventListener("touchstart",P,{capture:!0,passive:!1}),r.addEventListener("click",x,{capture:!0,passive:!1}),r.addEventListener("keydown",A,{capture:!0,passive:!1}),r.addEventListener("keydown",S),n},j=function(){if(m.active)return r.removeEventListener("focusin",D,!0),r.removeEventListener("mousedown",P,!0),r.removeEventListener("touchstart",P,!0),r.removeEventListener("click",x,!0),r.removeEventListener("keydown",A,!0),r.removeEventListener("keydown",S),n},I="MutationObserver"in window?new MutationObserver(function(e){e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===m.mostRecentlyFocusedNode})})&&k(O())}):void 0,C=function(){I&&(I.disconnect(),m.active&&!m.paused&&m.containers.map(function(e){I.observe(e,{subtree:!0,childList:!0})}))};return Object.defineProperties(n={get active(){return m.active},get paused(){return m.paused},activate:function(e){if(m.active)return this;var t=h(e,"onActivate"),n=h(e,"onPostActivate"),a=h(e,"checkCanFocusTrap");a||N(),m.active=!0,m.paused=!1,m.nodeFocusedBeforeActivation=r.activeElement,null==t||t();var o=function(){a&&N(),R(),C(),null==n||n()};return a?a(m.containers.concat()).then(o,o):o(),this},deactivate:function(e){if(!m.active)return this;var t=i({onDeactivate:y.onDeactivate,onPostDeactivate:y.onPostDeactivate,checkCanReturnFocus:y.checkCanReturnFocus},e);clearTimeout(m.delayInitialFocusTimer),m.delayInitialFocusTimer=void 0,j(),m.active=!1,m.paused=!1,C(),u.deactivateTrap(p,n);var a=h(t,"onDeactivate"),o=h(t,"onPostDeactivate"),r=h(t,"checkCanReturnFocus"),s=h(t,"returnFocus","returnFocusOnDeactivate");null==a||a();var c=function(){d(function(){s&&k(T(m.nodeFocusedBeforeActivation)),null==o||o()})};return s&&r?r(T(m.nodeFocusedBeforeActivation)).then(c,c):c(),this},pause:function(e){return m.active?(m.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return m.active?(m.manuallyPaused=!1,p[p.length-1]!==this)?this:this._setPausedState(!1,e):this},updateContainerElements:function(e){return m.containers=[].concat(e).filter(Boolean).map(function(e){return"string"==typeof e?r.querySelector(e):e}),m.active&&N(),C(),this}},{_isManuallyPaused:{value:function(){return m.manuallyPaused}},_setPausedState:{value:function(e,t){if(m.paused===e)return this;if(m.paused=e,e){var n=h(t,"onPause"),a=h(t,"onPostPause");null==n||n(),j(),C(),null==a||a()}else{var o=h(t,"onUnpause"),r=h(t,"onPostUnpause");null==o||o(),N(),R(),C(),null==r||r()}return this}}}),n.updateContainerElements(e),n}}}]);