\r\n\r\n\r\n\r\n\r\n\r\n\r\n","import focusableEls from '../focusable-elements';\r\n\r\nexport default {\r\n\tmethods: {\r\n\t\ttrapFocus(e, el) {\r\n\t\t\tif (e.which === 9) {\r\n\t\t\t\tconst els = [...el.querySelectorAll(focusableEls)];\r\n\t\t\t\t// Handle shift-tabbing when on first element of the dialog,\r\n\t\t\t\t// then handle forward tabbing when on last element\r\n\t\t\t\tif (e.shiftKey && els[0] === document.activeElement) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\tels[els.length - 1].focus();\r\n\t\t\t\t}\r\n\t\t\t\telse if (!e.shiftKey && els[els.length - 1] === document.activeElement) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\tels[0].focus();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n","\r\n// Called when vue dialogs are shown/hidden for compatibility with admin modal overlays\r\nexport function handleDialogVisibility(isVisible) {\r\n\ttry {\r\n\t\tif (!window)\r\n\t\t\tconsole.warn('Window not defined');\r\n\t}\r\n\tcatch {\r\n\t\treturn;\r\n\t}\r\n\r\n\t// do not hide the overlay if a legacy modal is open underneath a vue dialog\r\n\tif (window.Cognito && window.Cognito.Messaging && (isVisible || !document.body.className.includes('c-modal-active'))) {\r\n\t\t// eslint-disable-next-line no-undef\r\n\t\tCognito.Messaging.trigger(isVisible ? 'showOverlay' : 'hideOverlay');\r\n\t}\r\n}\r\n\r\nexport function setupChromeOverlayClickHandler(handler) {\r\n\ttry {\r\n\t\tif (!window)\r\n\t\t\tconsole.warn('Window not defined');\r\n\t}\r\n\tcatch {\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (window.Cognito && window.Cognito.Messaging) {\r\n\t\t// eslint-disable-next-line no-undef\r\n\t\tCognito.Messaging.addHandler('overlayClicked', handler);\r\n\t}\r\n}","// style-loader: Adds some css to the DOM by adding a