@cruk/cruk-react-components 6.0.2 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/lib/node_modules/@babel/runtime/helpers/esm/toPrimitive.js.map +1 -1
  2. package/lib/node_modules/focus-lock/dist/es2015/focusInside.js.map +1 -1
  3. package/lib/node_modules/focus-lock/dist/es2015/focusIsHidden.js.map +1 -1
  4. package/lib/node_modules/focus-lock/dist/es2015/moveFocusInside.js.map +1 -1
  5. package/lib/node_modules/focus-lock/dist/es2015/return-focus.js.map +1 -1
  6. package/lib/node_modules/focus-lock/dist/es2015/sibling.js.map +1 -1
  7. package/lib/node_modules/focus-lock/dist/es2015/utils/DOMutils.js.map +1 -1
  8. package/lib/node_modules/focus-lock/dist/es2015/utils/auto-focus.js.map +1 -1
  9. package/lib/node_modules/focus-lock/dist/es2015/utils/getActiveElement.js.map +1 -1
  10. package/lib/node_modules/focus-lock/dist/es2015/utils/is.js.map +1 -1
  11. package/lib/node_modules/focus-lock/dist/es2015/utils/parenting.js.map +1 -1
  12. package/lib/node_modules/focus-lock/dist/es2015/utils/tabUtils.js.map +1 -1
  13. package/lib/node_modules/react-focus-lock/dist/es2015/Lock.js.map +1 -1
  14. package/lib/node_modules/react-intersection-observer/dist/index.js.map +1 -1
  15. package/lib/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -1
  16. package/lib/src/components/AddressLookup/index.js.map +1 -1
  17. package/lib/src/components/Avatar/index.js.map +1 -1
  18. package/lib/src/components/Badge/index.js.map +1 -1
  19. package/lib/src/components/Button/index.js.map +1 -1
  20. package/lib/src/components/Carousel/index.js.map +1 -1
  21. package/lib/src/components/Collapse/index.js.map +1 -1
  22. package/lib/src/components/DateField/index.js.map +1 -1
  23. package/lib/src/components/ErrorText/index.js.map +1 -1
  24. package/lib/src/components/Fontface.js.map +1 -1
  25. package/lib/src/components/GlobalStyle.js.map +1 -1
  26. package/lib/src/components/IconFa/index.js.map +1 -1
  27. package/lib/src/components/LabelWrapper/index.js.map +1 -1
  28. package/lib/src/components/Modal/index.js.map +1 -1
  29. package/lib/src/components/Modal/styles.js +1 -1
  30. package/lib/src/components/Modal/styles.js.map +1 -1
  31. package/lib/src/components/Pagination/index.js.map +1 -1
  32. package/lib/src/components/PopOver/index.js.map +1 -1
  33. package/lib/src/components/ProgressBar/index.js.map +1 -1
  34. package/lib/src/components/RadioConsent/index.js.map +1 -1
  35. package/lib/src/components/Select/styles.js +1 -1
  36. package/lib/src/components/Select/styles.js.map +1 -1
  37. package/lib/src/components/Step/index.js.map +1 -1
  38. package/lib/src/components/TextAreaField/index.js.map +1 -1
  39. package/lib/src/components/Totaliser/index.js.map +1 -1
  40. package/lib/src/components/Totaliser/styles.js +1 -1
  41. package/lib/src/components/Totaliser/styles.js.map +1 -1
  42. package/lib/src/components/UserBlock/index.js.map +1 -1
  43. package/lib/src/hooks/useKey.js.map +1 -1
  44. package/lib/src/themes/bowelbabe.js +1 -1
  45. package/lib/src/themes/bowelbabe.js.map +1 -1
  46. package/lib/src/themes/rfl.js +1 -1
  47. package/lib/src/themes/rfl.js.map +1 -1
  48. package/lib/src/themes/su2c.js +1 -1
  49. package/lib/src/themes/su2c.js.map +1 -1
  50. package/lib/src/utils/debounce.js.map +1 -1
  51. package/package.json +20 -21
@@ -1 +1 @@
1
- {"version":3,"file":"toPrimitive.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"],"sourcesContent":["import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };"],"names":["toPrimitive","t","r","_typeof","e","Symbol","undefined","i","call","TypeError","String","Number"],"mappings":"2BACA,SAASA,EAAYC,EAAGC,GACtB,GAAI,UAAYC,EAAQF,KAAOA,EAAG,OAAOA,EACzC,IAAIG,EAAIH,EAAEI,OAAOL,aACjB,QAAIM,IAAWF,EAAG,CAChB,IAAIG,EAAIH,EAAEI,KAAKP,EAAGC,GAClB,GAAI,UAAYC,EAAQI,GAAI,OAAOA,EACnC,MAAM,IAAIE,UAAU,+CACxB,CACE,OAAQ,WAAaP,EAAIQ,OAASC,QAAQV,EAC5C","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"toPrimitive.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"],"sourcesContent":["import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };"],"names":["toPrimitive","t","r","_typeof","e","Symbol","i","call","TypeError","String","Number"],"mappings":"2BACA,SAASA,EAAYC,EAAGC,GACtB,GAAI,UAAYC,EAAQF,KAAOA,EAAG,OAAOA,EACzC,IAAIG,EAAIH,EAAEI,OAAOL,aACjB,QAAI,IAAWI,EAAG,CAChB,IAAIE,EAAIF,EAAEG,KAAKN,EAAGC,GAClB,GAAI,UAAYC,EAAQG,GAAI,OAAOA,EACnC,MAAM,IAAIE,UAAU,+CACxB,CACE,OAAQ,WAAaN,EAAIO,OAASC,QAAQT,EAC5C","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"focusInside.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/focusInside.js"],"sourcesContent":["import { contains } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { getFirst, toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\nvar focusInFrame = function (frame, activeElement) { return frame === activeElement; };\nvar focusInsideIframe = function (topNode, activeElement) {\n return Boolean(toArray(topNode.querySelectorAll('iframe')).some(function (node) { return focusInFrame(node, activeElement); }));\n};\n/**\n * @returns {Boolean} true, if the current focus is inside given node or nodes.\n * Supports nodes hidden inside shadowDom\n */\nexport var focusInside = function (topNode, activeElement) {\n // const activeElement = document && getActiveElement();\n if (activeElement === void 0) { activeElement = getActiveElement(getFirst(topNode).ownerDocument); }\n if (!activeElement || (activeElement.dataset && activeElement.dataset.focusGuard)) {\n return false;\n }\n return getAllAffectedNodes(topNode).some(function (node) {\n return contains(node, activeElement) || focusInsideIframe(node, activeElement);\n });\n};\n"],"names":["focusInside","topNode","activeElement","undefined","getActiveElement","getFirst","ownerDocument","dataset","focusGuard","getAllAffectedNodes","some","node","contains","Boolean","toArray","querySelectorAll","frame","focusInFrame","focusInsideIframe"],"mappings":"qOAIA,IAQWA,EAAc,SAAUC,EAASC,GAGxC,YADsBC,IAAlBD,IAA4BA,EAAgBE,EAAiBC,EAASJ,GAASK,mBAC9EJ,GAAkBA,EAAcK,SAAWL,EAAcK,QAAQC,aAG/DC,EAAoBR,GAASS,MAAK,SAAUC,GAC/C,OAAOC,EAASD,EAAMT,IAdN,SAAUD,EAASC,GACvC,OAAOW,QAAQC,EAAQb,EAAQc,iBAAiB,WAAWL,MAAK,SAAUC,GAAQ,OAFnE,SAAUK,EAAOd,GAAiB,OAAOc,IAAUd,CAAgB,CAEOe,CAAaN,EAAMT,EAAe,IAC/H,CAYgDgB,CAAkBP,EAAMT,EACxE,GACA","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"focusInside.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/focusInside.js"],"sourcesContent":["import { contains } from './utils/DOMutils';\nimport { getAllAffectedNodes } from './utils/all-affected';\nimport { getFirst, toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\nvar focusInFrame = function (frame, activeElement) { return frame === activeElement; };\nvar focusInsideIframe = function (topNode, activeElement) {\n return Boolean(toArray(topNode.querySelectorAll('iframe')).some(function (node) { return focusInFrame(node, activeElement); }));\n};\n/**\n * @returns {Boolean} true, if the current focus is inside given node or nodes.\n * Supports nodes hidden inside shadowDom\n */\nexport var focusInside = function (topNode, activeElement) {\n // const activeElement = document && getActiveElement();\n if (activeElement === void 0) { activeElement = getActiveElement(getFirst(topNode).ownerDocument); }\n if (!activeElement || (activeElement.dataset && activeElement.dataset.focusGuard)) {\n return false;\n }\n return getAllAffectedNodes(topNode).some(function (node) {\n return contains(node, activeElement) || focusInsideIframe(node, activeElement);\n });\n};\n"],"names":["focusInside","topNode","activeElement","getActiveElement","getFirst","ownerDocument","dataset","focusGuard","getAllAffectedNodes","some","node","contains","Boolean","toArray","querySelectorAll","frame","focusInFrame","focusInsideIframe"],"mappings":"qOAIA,IAQWA,EAAc,SAAUC,EAASC,GAGxC,YADsB,IAAlBA,IAA4BA,EAAgBC,EAAiBC,EAASH,GAASI,mBAC9EH,GAAkBA,EAAcI,SAAWJ,EAAcI,QAAQC,aAG/DC,EAAoBP,GAASQ,MAAK,SAAUC,GAC/C,OAAOC,EAASD,EAAMR,IAdN,SAAUD,EAASC,GACvC,OAAOU,QAAQC,EAAQZ,EAAQa,iBAAiB,WAAWL,MAAK,SAAUC,GAAQ,OAFnE,SAAUK,EAAOb,GAAiB,OAAOa,IAAUb,CAAgB,CAEOc,CAAaN,EAAMR,EAAe,IAC/H,CAYgDe,CAAkBP,EAAMR,EACxE,GACA","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"focusIsHidden.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/focusIsHidden.js"],"sourcesContent":["import { FOCUS_ALLOW } from './constants';\nimport { contains } from './utils/DOMutils';\nimport { toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\n/**\n * checks if focus is hidden FROM the focus-lock\n * ie contained inside a node focus-lock shall ignore\n *\n * This is a utility function coupled with {@link FOCUS_ALLOW} constant\n *\n * @returns {boolean} focus is currently is in \"allow\" area\n */\nexport var focusIsHidden = function (inDocument) {\n if (inDocument === void 0) { inDocument = document; }\n var activeElement = getActiveElement(inDocument);\n if (!activeElement) {\n return false;\n }\n // this does not support setting FOCUS_ALLOW within shadow dom\n return toArray(inDocument.querySelectorAll(\"[\".concat(FOCUS_ALLOW, \"]\"))).some(function (node) { return contains(node, activeElement); });\n};\n"],"names":["focusIsHidden","inDocument","undefined","document","activeElement","getActiveElement","toArray","querySelectorAll","concat","FOCUS_ALLOW","some","node","contains"],"mappings":"sMAYU,IAACA,EAAgB,SAAUC,QACdC,IAAfD,IAAyBA,EAAaE,UAC1C,IAAIC,EAAgBC,EAAiBJ,GACrC,QAAKG,GAIEE,EAAQL,EAAWM,iBAAiB,IAAIC,OAAOC,EAAa,OAAOC,MAAK,SAAUC,GAAQ,OAAOC,EAASD,EAAMP,KAC3H","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"focusIsHidden.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/focusIsHidden.js"],"sourcesContent":["import { FOCUS_ALLOW } from './constants';\nimport { contains } from './utils/DOMutils';\nimport { toArray } from './utils/array';\nimport { getActiveElement } from './utils/getActiveElement';\n/**\n * checks if focus is hidden FROM the focus-lock\n * ie contained inside a node focus-lock shall ignore\n *\n * This is a utility function coupled with {@link FOCUS_ALLOW} constant\n *\n * @returns {boolean} focus is currently is in \"allow\" area\n */\nexport var focusIsHidden = function (inDocument) {\n if (inDocument === void 0) { inDocument = document; }\n var activeElement = getActiveElement(inDocument);\n if (!activeElement) {\n return false;\n }\n // this does not support setting FOCUS_ALLOW within shadow dom\n return toArray(inDocument.querySelectorAll(\"[\".concat(FOCUS_ALLOW, \"]\"))).some(function (node) { return contains(node, activeElement); });\n};\n"],"names":["focusIsHidden","inDocument","document","activeElement","getActiveElement","toArray","querySelectorAll","concat","FOCUS_ALLOW","some","node","contains"],"mappings":"sMAYU,IAACA,EAAgB,SAAUC,QACd,IAAfA,IAAyBA,EAAaC,UAC1C,IAAIC,EAAgBC,EAAiBH,GACrC,QAAKE,GAIEE,EAAQJ,EAAWK,iBAAiB,IAAIC,OAAOC,EAAa,OAAOC,MAAK,SAAUC,GAAQ,OAAOC,EAASD,EAAMP,KAC3H","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"moveFocusInside.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/moveFocusInside.js"],"sourcesContent":["import { focusOn } from './commands';\nimport { focusSolver } from './focusSolver';\nvar guardCount = 0;\nvar lockDisabled = false;\n/**\n * The main functionality of the focus-lock package\n *\n * Contains focus at a given node.\n * The last focused element will help to determine which element(first or last) should be focused.\n * The found element will be focused.\n *\n * This is one time action (move), not a persistent focus-lock\n *\n * HTML markers (see {@link import('./constants').FOCUS_AUTO} constants) can control autofocus\n * @see {@link focusSolver} for the same functionality without autofocus\n */\nexport var moveFocusInside = function (topNode, lastNode, options) {\n if (options === void 0) { options = {}; }\n var focusable = focusSolver(topNode, lastNode);\n // global local side effect to countain recursive lock activation and resolve focus-fighting\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n /** +FOCUS-FIGHTING prevention **/\n if (guardCount > 2) {\n // we have recursive entered back the lock activation\n console.error('FocusLock: focus-fighting detected. Only one focus management system could be active. ' +\n 'See https://github.com/theKashey/focus-lock/#focus-fighting');\n lockDisabled = true;\n setTimeout(function () {\n lockDisabled = false;\n }, 1);\n return;\n }\n guardCount++;\n focusOn(focusable.node, options.focusOptions);\n guardCount--;\n }\n};\n"],"names":["guardCount","lockDisabled","moveFocusInside","topNode","lastNode","options","undefined","focusable","focusSolver","console","error","setTimeout","focusOn","node","focusOptions"],"mappings":"uFAEA,IAAIA,EAAa,EACbC,GAAe,EAaRC,EAAkB,SAAUC,EAASC,EAAUC,QACtCC,IAAZD,IAAsBA,EAAU,CAAA,GACpC,IAAIE,EAAYC,EAAYL,EAASC,GAErC,IAAIH,GAGAM,EAAW,CAEX,GAAIP,EAAa,EAQb,OANAS,QAAQC,MAAM,qJAEdT,GAAe,OACfU,YAAW,WACPV,GAAe,CAClB,GAAE,GAGPD,IACAY,EAAQL,EAAUM,KAAMR,EAAQS,cAChCd,GACR,CACA","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"moveFocusInside.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/moveFocusInside.js"],"sourcesContent":["import { focusOn } from './commands';\nimport { focusSolver } from './focusSolver';\nvar guardCount = 0;\nvar lockDisabled = false;\n/**\n * The main functionality of the focus-lock package\n *\n * Contains focus at a given node.\n * The last focused element will help to determine which element(first or last) should be focused.\n * The found element will be focused.\n *\n * This is one time action (move), not a persistent focus-lock\n *\n * HTML markers (see {@link import('./constants').FOCUS_AUTO} constants) can control autofocus\n * @see {@link focusSolver} for the same functionality without autofocus\n */\nexport var moveFocusInside = function (topNode, lastNode, options) {\n if (options === void 0) { options = {}; }\n var focusable = focusSolver(topNode, lastNode);\n // global local side effect to countain recursive lock activation and resolve focus-fighting\n if (lockDisabled) {\n return;\n }\n if (focusable) {\n /** +FOCUS-FIGHTING prevention **/\n if (guardCount > 2) {\n // we have recursive entered back the lock activation\n console.error('FocusLock: focus-fighting detected. Only one focus management system could be active. ' +\n 'See https://github.com/theKashey/focus-lock/#focus-fighting');\n lockDisabled = true;\n setTimeout(function () {\n lockDisabled = false;\n }, 1);\n return;\n }\n guardCount++;\n focusOn(focusable.node, options.focusOptions);\n guardCount--;\n }\n};\n"],"names":["guardCount","lockDisabled","moveFocusInside","topNode","lastNode","options","focusable","focusSolver","console","error","setTimeout","focusOn","node","focusOptions"],"mappings":"uFAEA,IAAIA,EAAa,EACbC,GAAe,EAaRC,EAAkB,SAAUC,EAASC,EAAUC,QACtC,IAAZA,IAAsBA,EAAU,CAAA,GACpC,IAAIC,EAAYC,EAAYJ,EAASC,GAErC,IAAIH,GAGAK,EAAW,CAEX,GAAIN,EAAa,EAQb,OANAQ,QAAQC,MAAM,qJAEdR,GAAe,OACfS,YAAW,WACPT,GAAe,CAClB,GAAE,GAGPD,IACAW,EAAQL,EAAUM,KAAMP,EAAQQ,cAChCb,GACR,CACA","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"return-focus.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/return-focus.js"],"sourcesContent":["import { getTabbableNodes } from './utils/DOMutils';\nfunction weakRef(value) {\n if (!value)\n return null;\n // #68 Safari 14.1 dont have it yet\n // FIXME: remove in 2025\n if (typeof WeakRef === 'undefined') {\n return function () { return value || null; };\n }\n var w = value ? new WeakRef(value) : null;\n return function () { return (w === null || w === void 0 ? void 0 : w.deref()) || null; };\n}\nexport var recordElementLocation = function (element) {\n if (!element) {\n return null;\n }\n var stack = [];\n var currentElement = element;\n while (currentElement && currentElement !== document.body) {\n stack.push({\n current: weakRef(currentElement),\n parent: weakRef(currentElement.parentElement),\n left: weakRef(currentElement.previousElementSibling),\n right: weakRef(currentElement.nextElementSibling),\n });\n currentElement = currentElement.parentElement;\n }\n return {\n element: weakRef(element),\n stack: stack,\n ownerDocument: element.ownerDocument,\n };\n};\nvar restoreFocusTo = function (location) {\n var _a, _b, _c, _d, _e;\n if (!location) {\n return undefined;\n }\n var stack = location.stack, ownerDocument = location.ownerDocument;\n var visibilityCache = new Map();\n for (var _i = 0, stack_1 = stack; _i < stack_1.length; _i++) {\n var line = stack_1[_i];\n var parent_1 = (_a = line.parent) === null || _a === void 0 ? void 0 : _a.call(line);\n // is it still here?\n if (parent_1 && ownerDocument.contains(parent_1)) {\n var left = (_b = line.left) === null || _b === void 0 ? void 0 : _b.call(line);\n var savedCurrent = line.current();\n var current = parent_1.contains(savedCurrent) ? savedCurrent : undefined;\n var right = (_c = line.right) === null || _c === void 0 ? void 0 : _c.call(line);\n var focusables = getTabbableNodes([parent_1], visibilityCache);\n var aim = \n // that is element itself\n (_e = (_d = current !== null && current !== void 0 ? current : \n // or something in it's place\n left === null || left === void 0 ? void 0 : left.nextElementSibling) !== null && _d !== void 0 ? _d : \n // or somebody to the right, still close enough\n right) !== null && _e !== void 0 ? _e : \n // or somebody to the left, something?\n left;\n while (aim) {\n for (var _f = 0, focusables_1 = focusables; _f < focusables_1.length; _f++) {\n var focusable = focusables_1[_f];\n if (aim === null || aim === void 0 ? void 0 : aim.contains(focusable.node)) {\n return focusable.node;\n }\n }\n aim = aim.nextElementSibling;\n }\n if (focusables.length) {\n // if parent contains a focusable - move there\n return focusables[0].node;\n }\n }\n }\n // nothing matched\n return undefined;\n};\n/**\n * Captures the current focused element to restore focus as close as possible in the future\n * Handles situations where the focused element is removed from the DOM or no longer focusable\n * moving focus to the closest focusable element\n * @param targetElement - element where focus should be restored\n * @returns a function returning a new element to focus\n */\nexport var captureFocusRestore = function (targetElement) {\n var location = recordElementLocation(targetElement);\n return function () {\n return restoreFocusTo(location);\n };\n};\n"],"names":["weakRef","value","WeakRef","w","undefined","deref","recordElementLocation","element","stack","currentElement","document","body","push","current","parent","parentElement","left","previousElementSibling","right","nextElementSibling","ownerDocument","captureFocusRestore","targetElement","location","_a","_b","_c","_d","_e","visibilityCache","Map","_i","stack_1","length","line","parent_1","call","contains","savedCurrent","focusables","getTabbableNodes","aim","_f","focusables_1","focusable","node","restoreFocusTo"],"mappings":"uDACA,SAASA,EAAQC,GACb,IAAKA,EACD,OAAO,KAGX,GAAuB,oBAAZC,QACP,OAAO,WAAc,OAAOD,GAAS,IAAO,EAEhD,IAAIE,EAAIF,EAAQ,IAAIC,QAAQD,GAAS,KACrC,OAAO,WAAc,OAAQE,aAA6BC,EAASD,EAAEE,UAAY,IAAO,CAC5F,CACU,IAACC,EAAwB,SAAUC,GACzC,IAAKA,EACD,OAAO,KAIX,IAFA,IAAIC,EAAQ,GACRC,EAAiBF,EACdE,GAAkBA,IAAmBC,SAASC,MACjDH,EAAMI,KAAK,CACPC,QAASb,EAAQS,GACjBK,OAAQd,EAAQS,EAAeM,eAC/BC,KAAMhB,EAAQS,EAAeQ,wBAC7BC,MAAOlB,EAAQS,EAAeU,sBAElCV,EAAiBA,EAAe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,IAErC,CACA,CAGA,CAWeC,CAAevB,EACzB,CACL","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"return-focus.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/return-focus.js"],"sourcesContent":["import { getTabbableNodes } from './utils/DOMutils';\nfunction weakRef(value) {\n if (!value)\n return null;\n // #68 Safari 14.1 dont have it yet\n // FIXME: remove in 2025\n if (typeof WeakRef === 'undefined') {\n return function () { return value || null; };\n }\n var w = value ? new WeakRef(value) : null;\n return function () { return (w === null || w === void 0 ? void 0 : w.deref()) || null; };\n}\nexport var recordElementLocation = function (element) {\n if (!element) {\n return null;\n }\n var stack = [];\n var currentElement = element;\n while (currentElement && currentElement !== document.body) {\n stack.push({\n current: weakRef(currentElement),\n parent: weakRef(currentElement.parentElement),\n left: weakRef(currentElement.previousElementSibling),\n right: weakRef(currentElement.nextElementSibling),\n });\n currentElement = currentElement.parentElement;\n }\n return {\n element: weakRef(element),\n stack: stack,\n ownerDocument: element.ownerDocument,\n };\n};\nvar restoreFocusTo = function (location) {\n var _a, _b, _c, _d, _e;\n if (!location) {\n return undefined;\n }\n var stack = location.stack, ownerDocument = location.ownerDocument;\n var visibilityCache = new Map();\n for (var _i = 0, stack_1 = stack; _i < stack_1.length; _i++) {\n var line = stack_1[_i];\n var parent_1 = (_a = line.parent) === null || _a === void 0 ? void 0 : _a.call(line);\n // is it still here?\n if (parent_1 && ownerDocument.contains(parent_1)) {\n var left = (_b = line.left) === null || _b === void 0 ? void 0 : _b.call(line);\n var savedCurrent = line.current();\n var current = parent_1.contains(savedCurrent) ? savedCurrent : undefined;\n var right = (_c = line.right) === null || _c === void 0 ? void 0 : _c.call(line);\n var focusables = getTabbableNodes([parent_1], visibilityCache);\n var aim = \n // that is element itself\n (_e = (_d = current !== null && current !== void 0 ? current : \n // or something in it's place\n left === null || left === void 0 ? void 0 : left.nextElementSibling) !== null && _d !== void 0 ? _d : \n // or somebody to the right, still close enough\n right) !== null && _e !== void 0 ? _e : \n // or somebody to the left, something?\n left;\n while (aim) {\n for (var _f = 0, focusables_1 = focusables; _f < focusables_1.length; _f++) {\n var focusable = focusables_1[_f];\n if (aim === null || aim === void 0 ? void 0 : aim.contains(focusable.node)) {\n return focusable.node;\n }\n }\n aim = aim.nextElementSibling;\n }\n if (focusables.length) {\n // if parent contains a focusable - move there\n return focusables[0].node;\n }\n }\n }\n // nothing matched\n return undefined;\n};\n/**\n * Captures the current focused element to restore focus as close as possible in the future\n * Handles situations where the focused element is removed from the DOM or no longer focusable\n * moving focus to the closest focusable element\n * @param targetElement - element where focus should be restored\n * @returns a function returning a new element to focus\n */\nexport var captureFocusRestore = function (targetElement) {\n var location = recordElementLocation(targetElement);\n return function () {\n return restoreFocusTo(location);\n };\n};\n"],"names":["weakRef","value","WeakRef","w","deref","recordElementLocation","element","stack","currentElement","document","body","push","current","parent","parentElement","left","previousElementSibling","right","nextElementSibling","ownerDocument","captureFocusRestore","targetElement","location","_a","_b","_c","_d","_e","visibilityCache","Map","_i","stack_1","length","line","parent_1","call","contains","savedCurrent","undefined","focusables","getTabbableNodes","aim","_f","focusables_1","focusable","node","restoreFocusTo"],"mappings":"uDACA,SAASA,EAAQC,GACb,IAAKA,EACD,OAAO,KAGX,GAAuB,oBAAZC,QACP,OAAO,WAAc,OAAOD,GAAS,IAAO,EAEhD,IAAIE,EAAIF,EAAQ,IAAIC,QAAQD,GAAS,KACrC,OAAO,WAAc,OAAQE,aAA6B,EAASA,EAAEC,UAAY,IAAO,CAC5F,CACU,IAACC,EAAwB,SAAUC,GACzC,IAAKA,EACD,OAAO,KAIX,IAFA,IAAIC,EAAQ,GACRC,EAAiBF,EACdE,GAAkBA,IAAmBC,SAASC,MACjDH,EAAMI,KAAK,CACPC,QAASZ,EAAQQ,GACjBK,OAAQb,EAAQQ,EAAeM,eAC/BC,KAAMf,EAAQQ,EAAeQ,wBAC7BC,MAAOjB,EAAQQ,EAAeU,sBAElCV,EAAiBA,EAAeM,cAEpC,MAAO,CACHR,QAASN,EA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]}
@@ -1 +1 @@
1
- {"version":3,"file":"sibling.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/sibling.js"],"sourcesContent":["import { focusOn } from './commands';\nimport { getTabbableNodes, contains, getFocusableNodes } from './utils/DOMutils';\nimport { asArray } from './utils/array';\n/**\n * for a given `element` in a given `scope` returns focusable siblings\n * @param element - base element\n * @param scope - common parent. Can be document, but better to narrow it down for performance reasons\n * @returns {prev,next} - references to a focusable element before and after\n * @returns undefined - if operation is not applicable\n */\nexport var getRelativeFocusable = function (element, scope, useTabbables) {\n if (!element || !scope) {\n console.error('no element or scope given');\n return {};\n }\n var shards = asArray(scope);\n if (shards.every(function (shard) { return !contains(shard, element); })) {\n console.error('Active element is not contained in the scope');\n return {};\n }\n var focusables = useTabbables\n ? getTabbableNodes(shards, new Map())\n : getFocusableNodes(shards, new Map());\n var current = focusables.findIndex(function (_a) {\n var node = _a.node;\n return node === element;\n });\n if (current === -1) {\n // an edge case, when anchor element is not found\n return undefined;\n }\n return {\n prev: focusables[current - 1],\n next: focusables[current + 1],\n first: focusables[0],\n last: focusables[focusables.length - 1],\n };\n};\nvar getBoundary = function (shards, useTabbables) {\n var set = useTabbables\n ? getTabbableNodes(asArray(shards), new Map())\n : getFocusableNodes(asArray(shards), new Map());\n return {\n first: set[0],\n last: set[set.length - 1],\n };\n};\nvar defaultOptions = function (options) {\n return Object.assign({\n scope: document.body,\n cycle: true,\n onlyTabbable: true,\n }, options);\n};\nvar moveFocus = function (fromElement, options, cb) {\n if (options === void 0) { options = {}; }\n var newOptions = defaultOptions(options);\n var solution = getRelativeFocusable(fromElement, newOptions.scope, newOptions.onlyTabbable);\n if (!solution) {\n return;\n }\n var target = cb(solution, newOptions.cycle);\n if (target) {\n focusOn(target.node, newOptions.focusOptions);\n }\n};\n/**\n * focuses next element in the tab-order\n * @param fromElement - common parent to scope active element search or tab cycle order\n * @param {FocusNextOptions} [options] - focus options\n */\nexport var focusNextElement = function (fromElement, options) {\n if (options === void 0) { options = {}; }\n moveFocus(fromElement, options, function (_a, cycle) {\n var next = _a.next, first = _a.first;\n return next || (cycle && first);\n });\n};\n/**\n * focuses prev element in the tab order\n * @param fromElement - common parent to scope active element search or tab cycle order\n * @param {FocusNextOptions} [options] - focus options\n */\nexport var focusPrevElement = function (fromElement, options) {\n if (options === void 0) { options = {}; }\n moveFocus(fromElement, options, function (_a, cycle) {\n var prev = _a.prev, last = _a.last;\n return prev || (cycle && last);\n });\n};\nvar pickBoundary = function (scope, options, what) {\n var _a;\n var boundary = getBoundary(scope, (_a = options.onlyTabbable) !== null && _a !== void 0 ? _a : true);\n var node = boundary[what];\n if (node) {\n focusOn(node.node, options.focusOptions);\n }\n};\n/**\n * focuses first element in the tab-order\n * @param {FocusNextOptions} options - focus options\n */\nexport var focusFirstElement = function (scope, options) {\n if (options === void 0) { options = {}; }\n pickBoundary(scope, options, 'first');\n};\n/**\n * focuses last element in the tab order\n * @param {FocusNextOptions} options - focus options\n */\nexport var focusLastElement = function (scope, options) {\n if (options === void 0) { options = {}; }\n pickBoundary(scope, options, 'last');\n};\n"],"names":["getRelativeFocusable","element","scope","useTabbables","console","error","shards","asArray","every","shard","contains","focusables","getTabbableNodes","Map","getFocusableNodes","current","findIndex","_a","node","prev","next","first","last","length","moveFocus","fromElement","options","cb","undefined","newOptions","Object","assign","document","body","cycle","onlyTabbable","defaultOptions","solution","target","focusOn","focusOptions","focusNextElement","focusPrevElement","pickBoundary","what","set","focusFirstElement","focusLastElement"],"mappings":"+KAUU,IAACA,EAAuB,SAAUC,EAASC,EAAOC,GACxD,IAAKF,IAAYC,EAEb,OADAE,QAAQC,MAAM,6BACP,CAAE,EAEb,IAAIC,EAASC,EAAQL,GACrB,GAAII,EAAOE,OAAM,SAAUC,GAAS,OAAQC,EAASD,EAAOR,EAAS,IAEjE,OADAG,QAAQC,MAAM,gDACP,CAAE,EAEb,IAAIM,EAAaR,EACXS,EAAiBN,EAAQ,IAAIO,KAC7BC,EAAkBR,EAAQ,IAAIO,KACh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AAkBP,EAAQD,GAAS,IAAIO,MAE9B,GACXS,KAAMuB,EAAIA,EAAItB,OAAS,KAiDPqB,GAChB1B,GACAqB,EAAQrB,EAAKA,KAAMQ,EAAQc,aAEnC,EAKWM,EAAoB,SAAU5C,EAAOwB,QAC5BE,IAAZF,IAAsBA,EAAU,CAAA,GACpCiB,EAAazC,EAAOwB,EAAS,QACjC,EAKWqB,EAAmB,SAAU7C,EAAOwB,QAC3BE,IAAZF,IAAsBA,EAAU,CAAA,GACpCiB,EAAazC,EAAOwB,EAAS,OACjC","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"sibling.js","sources":["../../../../../node_modules/focus-lock/dist/es2015/sibling.js"],"sourcesContent":["import { focusOn } from './commands';\nimport { getTabbableNodes, contains, getFocusableNodes } from './utils/DOMutils';\nimport { asArray } from './utils/array';\n/**\n * for a given `element` in a given `scope` returns focusable siblings\n * @param element - base element\n * @param scope - common parent. Can be document, but better to narrow it down for performance reasons\n * @returns {prev,next} - references to a focusable element before and after\n * @returns undefined - if operation is not applicable\n */\nexport var getRelativeFocusable = function (element, scope, useTabbables) {\n if (!element || !scope) {\n console.error('no element or scope given');\n return {};\n }\n var shards = asArray(scope);\n if (shards.every(function (shard) { return !contains(shard, element); })) {\n console.error('Active element is not contained in the scope');\n return {};\n }\n var focusables = useTabbables\n ? getTabbableNodes(shards, new Map())\n : getFocusableNodes(shards, new Map());\n var current = focusables.findIndex(function (_a) {\n var node = _a.node;\n return node === element;\n });\n if (current === -1) {\n // an edge case, when anchor element is not found\n return undefined;\n }\n return {\n prev: focusables[current - 1],\n next: focusables[current + 1],\n first: focusables[0],\n last: focusables[focusables.length - 1],\n };\n};\nvar getBoundary = function (shards, useTabbables) {\n var set = useTabbables\n ? getTabbableNodes(asArray(shards), new Map())\n : getFocusableNodes(asArray(shards), new Map());\n return {\n first: set[0],\n last: set[set.length - 1],\n };\n};\nvar defaultOptions = function (options) {\n return Object.assign({\n scope: document.body,\n cycle: true,\n onlyTabbable: true,\n }, options);\n};\nvar moveFocus = function (fromElement, options, cb) {\n if (options === void 0) { options = {}; }\n var newOptions = defaultOptions(options);\n var solution = getRelativeFocusable(fromElement, newOptions.scope, newOptions.onlyTabbable);\n if (!solution) {\n return;\n }\n var target = cb(solution, newOptions.cycle);\n if (target) {\n focusOn(target.node, newOptions.focusOptions);\n }\n};\n/**\n * focuses next element in the tab-order\n * @param fromElement - common parent to scope active element search or tab cycle order\n * @param {FocusNextOptions} [options] - focus options\n */\nexport var focusNextElement = function (fromElement, options) {\n if (options === void 0) { options = {}; }\n moveFocus(fromElement, options, function (_a, cycle) {\n var next = _a.next, first = _a.first;\n return next || (cycle && first);\n });\n};\n/**\n * focuses prev element in the tab order\n * @param fromElement - common parent to scope active element search or tab cycle order\n * @param {FocusNextOptions} [options] - focus options\n */\nexport var focusPrevElement = function (fromElement, options) {\n if (options === void 0) { options = {}; }\n moveFocus(fromElement, options, function (_a, cycle) {\n var prev = _a.prev, last = _a.last;\n return prev || (cycle && last);\n });\n};\nvar pickBoundary = function (scope, options, what) {\n var _a;\n var boundary = getBoundary(scope, (_a = options.onlyTabbable) !== null && _a !== void 0 ? _a : true);\n var node = boundary[what];\n if (node) {\n focusOn(node.node, options.focusOptions);\n }\n};\n/**\n * focuses first element in the tab-order\n * @param {FocusNextOptions} options - focus options\n */\nexport var focusFirstElement = function (scope, options) {\n if (options === void 0) { options = {}; }\n pickBoundary(scope, options, 'first');\n};\n/**\n * focuses last element in the tab order\n * @param {FocusNextOptions} options - focus options\n */\nexport var focusLastElement = function (scope, options) {\n if (options === void 0) { options = {}; }\n pickBoundary(scope, options, 'last');\n};\n"],"names":["getRelativeFocusable","element","scope","useTabbables","console","error","shards","asArray","every","shard","contains","focusables","getTabbableNodes","Map","getFocusableNodes","current","findIndex","_a","node","prev","next","first","last","length","moveFocus","fromElement","options","cb","newOptions","Object","assign","document","body","cycle","onlyTabbable","defaultOptions","solution","target","focusOn","focusOptions","focusNextElement","focusPrevElement","pickBoundary","what","set","foc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AC1C,IAAId,EAAOF,EAAGE,KAAMG,EAAOL,EAAGK,KAC9B,OAAOH,GAASc,GAASX,CACjC,GACA,EACIoB,EAAe,SAAUxC,EAAOwB,EAASiB,GACzC,IAAI1B,EArDoBX,EAAQH,EAC5ByC,EAsDA1B,GAvDoBZ,EAsDGJ,EAtDKC,EAsDkC,QAA/Bc,EAAKS,EAAQQ,oBAAiC,IAAPjB,GAAgBA,EAlDnF,CACHI,OAJAuB,EAAMzC,EACJS,EAAiBL,EAAQD,GAAS,IAAIO,KACtCC,EAAkBP,EAAQD,GAAS,IAAIO,MAE9B,GACXS,KAAMsB,EAAIA,EAAIrB,OAAS,KAiDPoB,GAChBzB,GACAoB,EAAQpB,EAAKA,KAAMQ,EAAQa,aAEnC,EAKWM,EAAoB,SAAU3C,EAAOwB,QAC5B,IAAZA,IAAsBA,EAAU,CAAA,GACpCgB,EAAaxC,EAAOwB,EAAS,QACjC,EAKWoB,EAAmB,SAAU5C,EAAOwB,QAC3B,IAAZA,IAAsBA,EAAU,CAAA,GACpCgB,EAAaxC,EAAOwB,EAAS,OACjC","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"DOMutils.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/DOMutils.js"],"sourcesContent":["import { toArray } from './array';\nimport { isAutoFocusAllowedCached, isVisibleCached, notHiddenInput } from './is';\nimport { orderByTabIndex } from './tabOrder';\nimport { getFocusables, getParentAutofocusables } from './tabUtils';\n/**\n * given list of focusable elements keeps the ones user can interact with\n * @param nodes\n * @param visibilityCache\n */\nexport var filterFocusable = function (nodes, visibilityCache) {\n return toArray(nodes)\n .filter(function (node) { return isVisibleCached(visibilityCache, node); })\n .filter(function (node) { return notHiddenInput(node); });\n};\nexport var filterAutoFocusable = function (nodes, cache) {\n if (cache === void 0) { cache = new Map(); }\n return toArray(nodes).filter(function (node) { return isAutoFocusAllowedCached(cache, node); });\n};\n/**\n * !__WARNING__! Low level API.\n * @returns all tabbable nodes\n *\n * @see {@link getFocusableNodes} to get any focusable element\n *\n * @param topNodes - array of top level HTMLElements to search inside\n * @param visibilityCache - an cache to store intermediate measurements. Expected to be a fresh `new Map` on every call\n */\nexport var getTabbableNodes = function (topNodes, visibilityCache, withGuards) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes, withGuards), visibilityCache), true, withGuards);\n};\n/**\n * !__WARNING__! Low level API.\n *\n * @returns anything \"focusable\", not only tabbable. The difference is in `tabIndex=-1`\n * (without guards, as long as they are not expected to be ever focused)\n *\n * @see {@link getTabbableNodes} to get only tabble nodes element\n *\n * @param topNodes - array of top level HTMLElements to search inside\n * @param visibilityCache - an cache to store intermediate measurements. Expected to be a fresh `new Map` on every call\n */\nexport var getFocusableNodes = function (topNodes, visibilityCache) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes), visibilityCache), false);\n};\n/**\n * return list of nodes which are expected to be auto-focused\n * @param topNode\n * @param visibilityCache\n */\nexport var parentAutofocusables = function (topNode, visibilityCache) {\n return filterFocusable(getParentAutofocusables(topNode), visibilityCache);\n};\n/*\n * Determines if element is contained in scope, including nested shadow DOMs\n */\nexport var contains = function (scope, element) {\n if (scope.shadowRoot) {\n return contains(scope.shadowRoot, element);\n }\n else {\n if (Object.getPrototypeOf(scope).contains !== undefined &&\n Object.getPrototypeOf(scope).contains.call(scope, element)) {\n return true;\n }\n return toArray(scope.children).some(function (child) {\n var _a;\n if (child instanceof HTMLIFrameElement) {\n var iframeBody = (_a = child.contentDocument) === null || _a === void 0 ? void 0 : _a.body;\n if (iframeBody) {\n return contains(iframeBody, element);\n }\n return false;\n }\n return contains(child, element);\n });\n }\n};\n"],"names":["filterFocusable","nodes","visibilityCache","toArray","filter","node","isVisibleCached","notHiddenInput","filterAutoFocusable","cache","undefined","Map","isAutoFocusAllowedCached","getTabbableNodes","topNodes","withGuards","orderByTabIndex","getFocusables","getFocusableNodes","parentAutofocusables","topNode","getParentAutofocusables","contains","scope","element","shadowRoot","Object","getPrototypeOf","call","children","some","child","_a","HTMLIFrameElement","iframeBody","contentDocument","body"],"mappings":"4PASU,IAACA,EAAkB,SAAUC,EAAOC,GAC1C,OAAOC,EAAQF,GACVG,QAAO,SAAUC,GAAQ,OAAOC,EAAgBJ,EAAiBG,EAAQ,IACzED,QAAO,SAAUC,GAAQ,OAAOE,EAAeF,KACxD,EACWG,EAAsB,SAAUP,EAAOQ,GAE9C,YADcC,IAAVD,IAAoBA,EAAQ,IAAIE,KAC7BR,EAAQF,GAAOG,QAAO,SAAUC,GAAQ,OAAOO,EAAyBH,EAAOJ,EAAM,GAChG,EAUWQ,EAAmB,SAAUC,EAAUZ,EAAiBa,GAC/D,OAAOC,EAAgBhB,EAAgBiB,EAAcH,EAAUC,GAAab,IAAkB,EAAMa,EACxG,EAYWG,EAAoB,SAAUJ,EAAUZ,GAC/C,OAAOc,EAAgBhB,EAAgBiB,EAAcH,GAAWZ,IAAkB,EACtF,EAMWiB,EAAuB,SAAUC,EAASlB,GACjD,OAAOF,EAAgBqB,EAAwBD,GAAUlB,EAC7D,EAIWoB,EAAW,SAAUC,EAAOC,GACnC,OAAID,EAAME,WACCH,EAASC,EAAME,WAAYD,UAGYd,IAA1CgB,OAAOC,eAAeJ,GAAOD,WAC7BI,OAAOC,eAAeJ,GAAOD,SAASM,KAAKL,EAAOC,KAG/CrB,EAAQoB,EAAMM,UAAUC,MAAK,SAAUC,GAC1C,IAAIC,EACJ,GAAID,aAAiBE,kBAAmB,CACpC,IAAIC,EAA8C,QAAhCF,EAAKD,EAAMI,uBAAoCzB,IAAPsB,OAAgBtB,EAASsB,EAAGI,KACtF,QAAIF,GACOZ,EAASY,EAAYV,EAGhD,CACY,OAAOF,EAASS,EAAOP,EACnC,GAEA","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"DOMutils.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/DOMutils.js"],"sourcesContent":["import { toArray } from './array';\nimport { isAutoFocusAllowedCached, isVisibleCached, notHiddenInput } from './is';\nimport { orderByTabIndex } from './tabOrder';\nimport { getFocusables, getParentAutofocusables } from './tabUtils';\n/**\n * given list of focusable elements keeps the ones user can interact with\n * @param nodes\n * @param visibilityCache\n */\nexport var filterFocusable = function (nodes, visibilityCache) {\n return toArray(nodes)\n .filter(function (node) { return isVisibleCached(visibilityCache, node); })\n .filter(function (node) { return notHiddenInput(node); });\n};\nexport var filterAutoFocusable = function (nodes, cache) {\n if (cache === void 0) { cache = new Map(); }\n return toArray(nodes).filter(function (node) { return isAutoFocusAllowedCached(cache, node); });\n};\n/**\n * !__WARNING__! Low level API.\n * @returns all tabbable nodes\n *\n * @see {@link getFocusableNodes} to get any focusable element\n *\n * @param topNodes - array of top level HTMLElements to search inside\n * @param visibilityCache - an cache to store intermediate measurements. Expected to be a fresh `new Map` on every call\n */\nexport var getTabbableNodes = function (topNodes, visibilityCache, withGuards) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes, withGuards), visibilityCache), true, withGuards);\n};\n/**\n * !__WARNING__! Low level API.\n *\n * @returns anything \"focusable\", not only tabbable. The difference is in `tabIndex=-1`\n * (without guards, as long as they are not expected to be ever focused)\n *\n * @see {@link getTabbableNodes} to get only tabble nodes element\n *\n * @param topNodes - array of top level HTMLElements to search inside\n * @param visibilityCache - an cache to store intermediate measurements. Expected to be a fresh `new Map` on every call\n */\nexport var getFocusableNodes = function (topNodes, visibilityCache) {\n return orderByTabIndex(filterFocusable(getFocusables(topNodes), visibilityCache), false);\n};\n/**\n * return list of nodes which are expected to be auto-focused\n * @param topNode\n * @param visibilityCache\n */\nexport var parentAutofocusables = function (topNode, visibilityCache) {\n return filterFocusable(getParentAutofocusables(topNode), visibilityCache);\n};\n/*\n * Determines if element is contained in scope, including nested shadow DOMs\n */\nexport var contains = function (scope, element) {\n if (scope.shadowRoot) {\n return contains(scope.shadowRoot, element);\n }\n else {\n if (Object.getPrototypeOf(scope).contains !== undefined &&\n Object.getPrototypeOf(scope).contains.call(scope, element)) {\n return true;\n }\n return toArray(scope.children).some(function (child) {\n var _a;\n if (child instanceof HTMLIFrameElement) {\n var iframeBody = (_a = child.contentDocument) === null || _a === void 0 ? void 0 : _a.body;\n if (iframeBody) {\n return contains(iframeBody, element);\n }\n return false;\n }\n return contains(child, element);\n });\n }\n};\n"],"names":["filterFocusable","nodes","visibilityCache","toArray","filter","node","isVisibleCached","notHiddenInput","filterAutoFocusable","cache","Map","isAutoFocusAllowedCached","getTabbableNodes","topNodes","withGuards","orderByTabIndex","getFocusables","getFocusableNodes","parentAutofocusables","topNode","getParentAutofocusables","contains","scope","element","shadowRoot","undefined","Object","getPrototypeOf","call","children","some","child","_a","HTMLIFrameElement","iframeBody","contentDocument","body"],"mappings":"4PASU,IAACA,EAAkB,SAAUC,EAAOC,GAC1C,OAAOC,EAAQF,GACVG,QAAO,SAAUC,GAAQ,OAAOC,EAAgBJ,EAAiBG,EAAQ,IACzED,QAAO,SAAUC,GAAQ,OAAOE,EAAeF,KACxD,EACWG,EAAsB,SAAUP,EAAOQ,GAE9C,YADc,IAAVA,IAAoBA,EAAQ,IAAIC,KAC7BP,EAAQF,GAAOG,QAAO,SAAUC,GAAQ,OAAOM,EAAyBF,EAAOJ,EAAM,GAChG,EAUWO,EAAmB,SAAUC,EAAUX,EAAiBY,GAC/D,OAAOC,EAAgBf,EAAgBgB,EAAcH,EAAUC,GAAaZ,IAAkB,EAAMY,EACxG,EAYWG,EAAoB,SAAUJ,EAAUX,GAC/C,OAAOa,EAAgBf,EAAgBgB,EAAcH,GAAWX,IAAkB,EACtF,EAMWgB,EAAuB,SAAUC,EAASjB,GACjD,OAAOF,EAAgBoB,EAAwBD,GAAUjB,EAC7D,EAIWmB,EAAW,SAAUC,EAAOC,GACnC,OAAID,EAAME,WACCH,EAASC,EAAME,WAAYD,UAGYE,IAA1CC,OAAOC,eAAeL,GAAOD,WAC7BK,OAAOC,eAAeL,GAAOD,SAASO,KAAKN,EAAOC,KAG/CpB,EAAQmB,EAAMO,UAAUC,MAAK,SAAUC,GAC1C,IAAIC,EACJ,GAAID,aAAiBE,kBAAmB,CACpC,IAAIC,EAA8C,QAAhCF,EAAKD,EAAMI,uBAAoC,IAAPH,OAAgB,EAASA,EAAGI,KACtF,QAAIF,GACOb,EAASa,EAAYX,EAGhD,CACY,OAAOF,EAASU,EAAOR,EACnC,GAEA","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"auto-focus.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/auto-focus.js"],"sourcesContent":["import { filterAutoFocusable } from './DOMutils';\nimport { pickFirstFocus } from './firstFocus';\nimport { getDataset } from './is';\nvar findAutoFocused = function (autoFocusables) {\n return function (node) {\n var _a;\n var autofocus = (_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.autofocus;\n return (\n // @ts-expect-error\n node.autofocus ||\n //\n (autofocus !== undefined && autofocus !== 'false') ||\n //\n autoFocusables.indexOf(node) >= 0);\n };\n};\nexport var pickAutofocus = function (nodesIndexes, orderedNodes, groups) {\n var nodes = nodesIndexes.map(function (_a) {\n var node = _a.node;\n return node;\n });\n var autoFocusable = filterAutoFocusable(nodes.filter(findAutoFocused(groups)));\n if (autoFocusable && autoFocusable.length) {\n return pickFirstFocus(autoFocusable);\n }\n return pickFirstFocus(filterAutoFocusable(orderedNodes));\n};\n"],"names":["pickAutofocus","nodesIndexes","orderedNodes","groups","autoFocusables","nodes","map","_a","node","autoFocusable","filterAutoFocusable","filter","autofocus","getDataset","undefined","indexOf","length","pickFirstFocus"],"mappings":"0IAGA,IAaWA,EAAgB,SAAUC,EAAcC,EAAcC,GAC7D,IAd4BC,EAcxBC,EAAQJ,EAAaK,KAAI,SAAUC,GAEnC,OADWA,EAAGC,IAEtB,IACQC,EAAgBC,EAAoBL,EAAMM,QAlBlBP,EAkByCD,EAjB9D,SAAUK,GACb,IAAID,EACAK,EAAwC,QAA3BL,EAAKM,EAAWL,UAA0BM,IAAPP,OAAgBO,EAASP,EAAGK,UAChF,OAEAJ,EAAKI,gBAEcE,IAAdF,GAAyC,UAAdA,GAE5BR,EAAeW,QAAQP,IAAS,CACvC,KAQD,OAAIC,GAAiBA,EAAcO,OACxBC,EAAeR,GAEnBQ,EAAeP,EAAoBR,GAC9C","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"auto-focus.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/auto-focus.js"],"sourcesContent":["import { filterAutoFocusable } from './DOMutils';\nimport { pickFirstFocus } from './firstFocus';\nimport { getDataset } from './is';\nvar findAutoFocused = function (autoFocusables) {\n return function (node) {\n var _a;\n var autofocus = (_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.autofocus;\n return (\n // @ts-expect-error\n node.autofocus ||\n //\n (autofocus !== undefined && autofocus !== 'false') ||\n //\n autoFocusables.indexOf(node) >= 0);\n };\n};\nexport var pickAutofocus = function (nodesIndexes, orderedNodes, groups) {\n var nodes = nodesIndexes.map(function (_a) {\n var node = _a.node;\n return node;\n });\n var autoFocusable = filterAutoFocusable(nodes.filter(findAutoFocused(groups)));\n if (autoFocusable && autoFocusable.length) {\n return pickFirstFocus(autoFocusable);\n }\n return pickFirstFocus(filterAutoFocusable(orderedNodes));\n};\n"],"names":["pickAutofocus","nodesIndexes","orderedNodes","groups","autoFocusables","nodes","map","_a","node","autoFocusable","filterAutoFocusable","filter","autofocus","getDataset","undefined","indexOf","length","pickFirstFocus"],"mappings":"0IAGA,IAaWA,EAAgB,SAAUC,EAAcC,EAAcC,GAC7D,IAd4BC,EAcxBC,EAAQJ,EAAaK,KAAI,SAAUC,GAEnC,OADWA,EAAGC,IAEtB,IACQC,EAAgBC,EAAoBL,EAAMM,QAlBlBP,EAkByCD,EAjB9D,SAAUK,GACb,IAAID,EACAK,EAAwC,QAA3BL,EAAKM,EAAWL,UAA0B,IAAPD,OAAgB,EAASA,EAAGK,UAChF,OAEAJ,EAAKI,gBAEcE,IAAdF,GAAyC,UAAdA,GAE5BR,EAAeW,QAAQP,IAAS,CACvC,KAQD,OAAIC,GAAiBA,EAAcO,OACxBC,EAAeR,GAEnBQ,EAAeP,EAAoBR,GAC9C","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"getActiveElement.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/getActiveElement.js"],"sourcesContent":["/**\n * returns active element from document or from nested shadowdoms\n */\nimport { safeProbe } from './safe';\n/**\n * returns current active element. If the active element is a \"container\" itself(shadowRoot or iframe) returns active element inside it\n * @param [inDocument]\n */\nexport var getActiveElement = function (inDocument) {\n if (inDocument === void 0) { inDocument = document; }\n if (!inDocument || !inDocument.activeElement) {\n return undefined;\n }\n var activeElement = inDocument.activeElement;\n return (activeElement.shadowRoot\n ? getActiveElement(activeElement.shadowRoot)\n : activeElement instanceof HTMLIFrameElement && safeProbe(function () { return activeElement.contentWindow.document; })\n ? getActiveElement(activeElement.contentWindow.document)\n : activeElement);\n};\n"],"names":["getActiveElement","inDocument","undefined","document","activeElement","shadowRoot","HTMLIFrameElement","safeProbe","contentWindow"],"mappings":"sCAQU,IAACA,EAAmB,SAAUC,GAEpC,QADmBC,IAAfD,IAAyBA,EAAaE,UACrCF,GAAeA,EAAWG,cAA/B,CAGA,IAAIA,EAAgBH,EAAWG,cAC/B,OAAQA,EAAcC,WAChBL,EAAiBI,EAAcC,YAC/BD,aAAyBE,mBAAqBC,GAAU,WAAc,OAAOH,EAAcI,cAAcL,QAAW,IAChHH,EAAiBI,EAAcI,cAAcL,UAC7CC,CANd,CAOA","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"getActiveElement.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/getActiveElement.js"],"sourcesContent":["/**\n * returns active element from document or from nested shadowdoms\n */\nimport { safeProbe } from './safe';\n/**\n * returns current active element. If the active element is a \"container\" itself(shadowRoot or iframe) returns active element inside it\n * @param [inDocument]\n */\nexport var getActiveElement = function (inDocument) {\n if (inDocument === void 0) { inDocument = document; }\n if (!inDocument || !inDocument.activeElement) {\n return undefined;\n }\n var activeElement = inDocument.activeElement;\n return (activeElement.shadowRoot\n ? getActiveElement(activeElement.shadowRoot)\n : activeElement instanceof HTMLIFrameElement && safeProbe(function () { return activeElement.contentWindow.document; })\n ? getActiveElement(activeElement.contentWindow.document)\n : activeElement);\n};\n"],"names":["getActiveElement","inDocument","document","activeElement","shadowRoot","HTMLIFrameElement","safeProbe","contentWindow"],"mappings":"sCAQU,IAACA,EAAmB,SAAUC,GAEpC,QADmB,IAAfA,IAAyBA,EAAaC,UACrCD,GAAeA,EAAWE,cAA/B,CAGA,IAAIA,EAAgBF,EAAWE,cAC/B,OAAQA,EAAcC,WAChBJ,EAAiBG,EAAcC,YAC/BD,aAAyBE,mBAAqBC,GAAU,WAAc,OAAOH,EAAcI,cAAcL,QAAW,IAChHF,EAAiBG,EAAcI,cAAcL,UAC7CC,CANd,CAOA","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"is.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/is.js"],"sourcesContent":["import { FOCUS_NO_AUTOFOCUS } from '../constants';\nvar isElementHidden = function (node) {\n // we can measure only \"elements\"\n // consider others as \"visible\"\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n var computedStyle = window.getComputedStyle(node, null);\n if (!computedStyle || !computedStyle.getPropertyValue) {\n return false;\n }\n return (computedStyle.getPropertyValue('display') === 'none' || computedStyle.getPropertyValue('visibility') === 'hidden');\n};\nvar getParentNode = function (node) {\n // DOCUMENT_FRAGMENT_NODE can also point on ShadowRoot. In this case .host will point on the next node\n return node.parentNode && node.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node.parentNode.host\n : node.parentNode;\n};\nvar isTopNode = function (node) {\n // @ts-ignore\n return node === document || (node && node.nodeType === Node.DOCUMENT_NODE);\n};\nvar isInert = function (node) { return node.hasAttribute('inert'); };\n/**\n * @see https://github.com/testing-library/jest-dom/blob/main/src/to-be-visible.js\n */\nvar isVisibleUncached = function (node, checkParent) {\n return !node || isTopNode(node) || (!isElementHidden(node) && !isInert(node) && checkParent(getParentNode(node)));\n};\nexport var isVisibleCached = function (visibilityCache, node) {\n var cached = visibilityCache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isVisibleUncached(node, isVisibleCached.bind(undefined, visibilityCache));\n visibilityCache.set(node, result);\n return result;\n};\nvar isAutoFocusAllowedUncached = function (node, checkParent) {\n return node && !isTopNode(node) ? (isAutoFocusAllowed(node) ? checkParent(getParentNode(node)) : false) : true;\n};\nexport var isAutoFocusAllowedCached = function (cache, node) {\n var cached = cache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isAutoFocusAllowedUncached(node, isAutoFocusAllowedCached.bind(undefined, cache));\n cache.set(node, result);\n return result;\n};\nexport var getDataset = function (node) {\n // @ts-ignore\n return node.dataset;\n};\nexport var isHTMLButtonElement = function (node) { return node.tagName === 'BUTTON'; };\nexport var isHTMLInputElement = function (node) { return node.tagName === 'INPUT'; };\nexport var isRadioElement = function (node) {\n return isHTMLInputElement(node) && node.type === 'radio';\n};\nexport var notHiddenInput = function (node) {\n return !((isHTMLInputElement(node) || isHTMLButtonElement(node)) && (node.type === 'hidden' || node.disabled));\n};\nexport var isAutoFocusAllowed = function (node) {\n var attribute = node.getAttribute(FOCUS_NO_AUTOFOCUS);\n return ![true, 'true', ''].includes(attribute);\n};\nexport var isGuard = function (node) { var _a; return Boolean(node && ((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.focusGuard)); };\nexport var isNotAGuard = function (node) { return !isGuard(node); };\nexport var isDefined = function (x) { return Boolean(x); };\n"],"names":["getParentNode","node","parentNode","nodeType","Node","DOCUMENT_FRAGMENT_NODE","host","isTopNode","document","DOCUMENT_NODE","isVisibleUncached","checkParent","ELEMENT_NODE","computedStyle","window","getComputedStyle","getPropertyValue","isElementHidden","hasAttribute","isInert","isVisibleCached","visibilityCache","cached","get","undefined","result","bind","set","isAutoFocusAllowedCached","cache","isAutoFocusAllowed","isAutoFocusAllowedUncached","getDataset","dataset","isHTMLButtonElement","tagName","isHTMLInputElement","isRadioElement","type","notHiddenInput","disabled","attribute","getAttribute","FOCUS_NO_AUTOFOCUS","includes","isGuard","_a","Boolean","focusGuard","isNotAGuard","isDefined","x"],"mappings":"qDACA,IAYIA,EAAgB,SAAUC,GAE1B,OAAOA,EAAKC,YAAcD,EAAKC,WAAWC,WAAaC,KAAKC,uBAEpDJ,EAAKC,WAAWI,KAClBL,EAAKC,UACf,EACIK,EAAY,SAAUN,GAEtB,OAAOA,IAASO,UAAaP,GAAQA,EAAKE,WAAaC,KAAKK,aAChE,EAKIC,EAAoB,SAAUT,EAAMU,GACpC,OAAQV,GAAQM,EAAUN,KA5BR,SAAUA,GAG5B,GAAIA,EAAKE,WAAaC,KAAKQ,aACvB,OAAO,EAEX,IAAIC,EAAgBC,OAAOC,iBAAiBd,EAAM,MAClD,SAAKY,IAAkBA,EAAcG,kBAGiB,SAA9CH,EAAcG,iBAAiB,YAA0E,WAAjDH,EAAcG,iBAAiB,cACnG,CAiByCC,CAAgBhB,KAL3C,SAAUA,GAAQ,OAAOA,EAAKiB,aAAa,QAAW,CAKDC,CAAQlB,IAASU,EAAYX,EAAcC,GAC9G,EACWmB,EAAkB,SAAUC,EAAiBpB,GACpD,IAAIqB,EAASD,EAAgBE,IAAItB,GACjC,QAAeuB,IAAXF,EACA,OAAOA,EAEX,IAAIG,EAASf,EAAkBT,EAAMmB,EAAgBM,UAAKF,EAAWH,IAErE,OADAA,EAAgBM,IAAI1B,EAAMwB,GACnBA,CACX,EAIWG,EAA2B,SAAUC,EAAO5B,GACnD,IAAIqB,EAASO,EAAMN,IAAItB,GACvB,QAAeuB,IAAXF,EACA,OAAOA,EAEX,IAAIG,EARyB,SAAUxB,EAAMU,GAC7C,QAAOV,IAASM,EAAUN,OAAS6B,EAAmB7B,IAAQU,EAAYX,EAAcC,GAC5F,CAMiB8B,CAA2B9B,EAAM2B,EAAyBF,UAAKF,EAAWK,IAEvF,OADAA,EAAMF,IAAI1B,EAAMwB,GACTA,CACX,EACWO,EAAa,SAAU/B,GAE9B,OAAOA,EAAKgC,OAChB,EACWC,EAAsB,SAAUjC,GAAQ,MAAwB,WAAjBA,EAAKkC,OAAqB,EACzEC,EAAqB,SAAUnC,GAAQ,MAAwB,UAAjBA,EAAKkC,OAAoB,EACvEE,EAAiB,SAAUpC,GAClC,OAAOmC,EAAmBnC,IAAuB,UAAdA,EAAKqC,IAC5C,EACWC,EAAiB,SAAUtC,GAClC,SAAUmC,EAAmBnC,IAASiC,EAAoBjC,MAAyB,WAAdA,EAAKqC,MAAqBrC,EAAKuC,UACxG,EACWV,EAAqB,SAAU7B,GACtC,IAAIwC,EAAYxC,EAAKyC,aAAaC,GAClC,OAAQ,EAAC,EAAM,OAAQ,IAAIC,SAASH,EACxC,EACWI,EAAU,SAAU5C,GAAQ,IAAI6C,EAAI,OAAOC,QAAQ9C,IAAqC,QAA3B6C,EAAKd,EAAW/B,UAA0BuB,IAAPsB,OAAgBtB,EAASsB,EAAGE,YAAa,EACzIC,EAAc,SAAUhD,GAAQ,OAAQ4C,EAAQ5C,EAAM,EACtDiD,EAAY,SAAUC,GAAK,OAAOJ,QAAQI,EAAG","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"is.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/is.js"],"sourcesContent":["import { FOCUS_NO_AUTOFOCUS } from '../constants';\nvar isElementHidden = function (node) {\n // we can measure only \"elements\"\n // consider others as \"visible\"\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n var computedStyle = window.getComputedStyle(node, null);\n if (!computedStyle || !computedStyle.getPropertyValue) {\n return false;\n }\n return (computedStyle.getPropertyValue('display') === 'none' || computedStyle.getPropertyValue('visibility') === 'hidden');\n};\nvar getParentNode = function (node) {\n // DOCUMENT_FRAGMENT_NODE can also point on ShadowRoot. In this case .host will point on the next node\n return node.parentNode && node.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node.parentNode.host\n : node.parentNode;\n};\nvar isTopNode = function (node) {\n // @ts-ignore\n return node === document || (node && node.nodeType === Node.DOCUMENT_NODE);\n};\nvar isInert = function (node) { return node.hasAttribute('inert'); };\n/**\n * @see https://github.com/testing-library/jest-dom/blob/main/src/to-be-visible.js\n */\nvar isVisibleUncached = function (node, checkParent) {\n return !node || isTopNode(node) || (!isElementHidden(node) && !isInert(node) && checkParent(getParentNode(node)));\n};\nexport var isVisibleCached = function (visibilityCache, node) {\n var cached = visibilityCache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isVisibleUncached(node, isVisibleCached.bind(undefined, visibilityCache));\n visibilityCache.set(node, result);\n return result;\n};\nvar isAutoFocusAllowedUncached = function (node, checkParent) {\n return node && !isTopNode(node) ? (isAutoFocusAllowed(node) ? checkParent(getParentNode(node)) : false) : true;\n};\nexport var isAutoFocusAllowedCached = function (cache, node) {\n var cached = cache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isAutoFocusAllowedUncached(node, isAutoFocusAllowedCached.bind(undefined, cache));\n cache.set(node, result);\n return result;\n};\nexport var getDataset = function (node) {\n // @ts-ignore\n return node.dataset;\n};\nexport var isHTMLButtonElement = function (node) { return node.tagName === 'BUTTON'; };\nexport var isHTMLInputElement = function (node) { return node.tagName === 'INPUT'; };\nexport var isRadioElement = function (node) {\n return isHTMLInputElement(node) && node.type === 'radio';\n};\nexport var notHiddenInput = function (node) {\n return !((isHTMLInputElement(node) || isHTMLButtonElement(node)) && (node.type === 'hidden' || node.disabled));\n};\nexport var isAutoFocusAllowed = function (node) {\n var attribute = node.getAttribute(FOCUS_NO_AUTOFOCUS);\n return ![true, 'true', ''].includes(attribute);\n};\nexport var isGuard = function (node) { var _a; return Boolean(node && ((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.focusGuard)); };\nexport var isNotAGuard = function (node) { return !isGuard(node); };\nexport var isDefined = function (x) { return Boolean(x); };\n"],"names":["getParentNode","node","parentNode","nodeType","Node","DOCUMENT_FRAGMENT_NODE","host","isTopNode","document","DOCUMENT_NODE","isVisibleUncached","checkParent","ELEMENT_NODE","computedStyle","window","getComputedStyle","getPropertyValue","isElementHidden","hasAttribute","isInert","isVisibleCached","visibilityCache","cached","get","undefined","result","bind","set","isAutoFocusAllowedCached","cache","isAutoFocusAllowed","isAutoFocusAllowedUncached","getDataset","dataset","isHTMLButtonElement","tagName","isHTMLInputElement","isRadioElement","type","notHiddenInput","disabled","attribute","getAttribute","FOCUS_NO_AUTOFOCUS","includes","isGuard","_a","Boolean","focusGuard","isNotAGuard","isDefined","x"],"mappings":"qDACA,IAYIA,EAAgB,SAAUC,GAE1B,OAAOA,EAAKC,YAAcD,EAAKC,WAAWC,WAAaC,KAAKC,uBAEpDJ,EAAKC,WAAWI,KAClBL,EAAKC,UACf,EACIK,EAAY,SAAUN,GAEtB,OAAOA,IAASO,UAAaP,GAAQA,EAAKE,WAAaC,KAAKK,aAChE,EAKIC,EAAoB,SAAUT,EAAMU,GACpC,OAAQV,GAAQM,EAAUN,KA5BR,SAAUA,GAG5B,GAAIA,EAAKE,WAAaC,KAAKQ,aACvB,OAAO,EAEX,IAAIC,EAAgBC,OAAOC,iBAAiBd,EAAM,MAClD,SAAKY,IAAkBA,EAAcG,kBAGiB,SAA9CH,EAAcG,iBAAiB,YAA0E,WAAjDH,EAAcG,iBAAiB,cACnG,CAiByCC,CAAgBhB,KAL3C,SAAUA,GAAQ,OAAOA,EAAKiB,aAAa,QAAW,CAKDC,CAAQlB,IAASU,EAAYX,EAAcC,GAC9G,EACWmB,EAAkB,SAAUC,EAAiBpB,GACpD,IAAIqB,EAASD,EAAgBE,IAAItB,GACjC,QAAeuB,IAAXF,EACA,OAAOA,EAEX,IAAIG,EAASf,EAAkBT,EAAMmB,EAAgBM,UAAKF,EAAWH,IAErE,OADAA,EAAgBM,IAAI1B,EAAMwB,GACnBA,CACX,EAIWG,EAA2B,SAAUC,EAAO5B,GACnD,IAAIqB,EAASO,EAAMN,IAAItB,GACvB,QAAeuB,IAAXF,EACA,OAAOA,EAEX,IAAIG,EARyB,SAAUxB,EAAMU,GAC7C,QAAOV,IAASM,EAAUN,OAAS6B,EAAmB7B,IAAQU,EAAYX,EAAcC,GAC5F,CAMiB8B,CAA2B9B,EAAM2B,EAAyBF,UAAKF,EAAWK,IAEvF,OADAA,EAAMF,IAAI1B,EAAMwB,GACTA,CACX,EACWO,EAAa,SAAU/B,GAE9B,OAAOA,EAAKgC,OAChB,EACWC,EAAsB,SAAUjC,GAAQ,MAAwB,WAAjBA,EAAKkC,OAAqB,EACzEC,EAAqB,SAAUnC,GAAQ,MAAwB,UAAjBA,EAAKkC,OAAoB,EACvEE,EAAiB,SAAUpC,GAClC,OAAOmC,EAAmBnC,IAAuB,UAAdA,EAAKqC,IAC5C,EACWC,EAAiB,SAAUtC,GAClC,SAAUmC,EAAmBnC,IAASiC,EAAoBjC,MAAyB,WAAdA,EAAKqC,MAAqBrC,EAAKuC,UACxG,EACWV,EAAqB,SAAU7B,GACtC,IAAIwC,EAAYxC,EAAKyC,aAAaC,GAClC,OAAQ,EAAC,EAAM,OAAQ,IAAIC,SAASH,EACxC,EACWI,EAAU,SAAU5C,GAAQ,IAAI6C,EAAI,OAAOC,QAAQ9C,IAAqC,QAA3B6C,EAAKd,EAAW/B,UAA0B,IAAP6C,OAAgB,EAASA,EAAGE,YAAa,EACzIC,EAAc,SAAUhD,GAAQ,OAAQ4C,EAAQ5C,EAAM,EACtDiD,EAAY,SAAUC,GAAK,OAAOJ,QAAQI,EAAG","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"parenting.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/parenting.js"],"sourcesContent":["import { parentAutofocusables } from './DOMutils';\nimport { contains } from './DOMutils';\nimport { asArray } from './array';\nvar getParents = function (node, parents) {\n if (parents === void 0) { parents = []; }\n parents.push(node);\n if (node.parentNode) {\n getParents(node.parentNode.host || node.parentNode, parents);\n }\n return parents;\n};\n/**\n * finds a parent for both nodeA and nodeB\n * @param nodeA\n * @param nodeB\n * @returns {boolean|*}\n */\nexport var getCommonParent = function (nodeA, nodeB) {\n var parentsA = getParents(nodeA);\n var parentsB = getParents(nodeB);\n // tslint:disable-next-line:prefer-for-of\n for (var i = 0; i < parentsA.length; i += 1) {\n var currentParent = parentsA[i];\n if (parentsB.indexOf(currentParent) >= 0) {\n return currentParent;\n }\n }\n return false;\n};\nexport var getTopCommonParent = function (baseActiveElement, leftEntry, rightEntries) {\n var activeElements = asArray(baseActiveElement);\n var leftEntries = asArray(leftEntry);\n var activeElement = activeElements[0];\n var topCommon = false;\n leftEntries.filter(Boolean).forEach(function (entry) {\n topCommon = getCommonParent(topCommon || entry, entry) || topCommon;\n rightEntries.filter(Boolean).forEach(function (subEntry) {\n var common = getCommonParent(activeElement, subEntry);\n if (common) {\n if (!topCommon || contains(common, topCommon)) {\n topCommon = common;\n }\n else {\n topCommon = getCommonParent(common, topCommon);\n }\n }\n });\n });\n // TODO: add assert here?\n return topCommon;\n};\n/**\n * return list of nodes which are expected to be autofocused inside a given top nodes\n * @param entries\n * @param visibilityCache\n */\nexport var allParentAutofocusables = function (entries, visibilityCache) {\n return entries.reduce(function (acc, node) { return acc.concat(parentAutofocusables(node, visibilityCache)); }, []);\n};\n"],"names":["getParents","node","parents","undefined","push","parentNode","host","getCommonParent","nodeA","nodeB","parentsA","parentsB","i","length","currentParent","indexOf","getTopCommonParent","baseActiveElement","leftEntry","rightEntries","activeElements","asArray","leftEntries","activeElement","topCommon","filter","Boolean","forEach","entry","subEntry","common","contains","allParentAutofocusables","entries","visibilityCache","reduce","acc","concat","parentAutofocusables"],"mappings":"wGAGA,IAAIA,EAAa,SAAUC,EAAMC,GAM7B,YALgBC,IAAZD,IAAsBA,EAAU,IACpCA,EAAQE,KAAKH,GACTA,EAAKI,YACLL,EAAWC,EAAKI,WAAWC,MAAQL,EAAKI,WAAYH,GAEjDA,CACX,EAOWK,EAAkB,SAAUC,EAAOC,GAI1C,IAHA,IAAIC,EAAWV,EAAWQ,GACtBG,EAAWX,EAAWS,GAEjBG,EAAI,EAAGA,EAAIF,EAASG,OAAQD,GAAK,EAAG,CACzC,IAAIE,EAAgBJ,EAASE,GAC7B,GAAID,EAASI,QAAQD,IAAkB,EACnC,OAAOA,CAEnB,CACI,OAAO,CACX,EACWE,EAAqB,SAAUC,EAAmBC,EAAWC,GACpE,IAAIC,EAAiBC,EAAQJ,GACzBK,EAAcD,EAAQH,GACtBK,EAAgBH,EAAe,GAC/BI,GAAY,EAgBhB,OAfAF,EAAYG,OAAOC,SAASC,SAAQ,SAAUC,GAC1CJ,EAAYjB,EAAgBiB,GAAaI,EAAOA,IAAUJ,EAC1DL,EAAaM,OAAOC,SAASC,SAAQ,SAAUE,GAC3C,IAAIC,EAASvB,EAAgBgB,EAAeM,GACxCC,IAEIN,GADCA,GAAaO,EAASD,EAAQN,GACnBM,EAGAvB,EAAgBuB,EAAQN,GAGxD,GACA,IAEWA,CACX,EAMWQ,EAA0B,SAAUC,EAASC,GACpD,OAAOD,EAAQE,QAAO,SAAUC,EAAKnC,GAAQ,OAAOmC,EAAIC,OAAOC,EAAqBrC,EAAMiC,GAAkB,GAAI,GACpH","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"parenting.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/parenting.js"],"sourcesContent":["import { parentAutofocusables } from './DOMutils';\nimport { contains } from './DOMutils';\nimport { asArray } from './array';\nvar getParents = function (node, parents) {\n if (parents === void 0) { parents = []; }\n parents.push(node);\n if (node.parentNode) {\n getParents(node.parentNode.host || node.parentNode, parents);\n }\n return parents;\n};\n/**\n * finds a parent for both nodeA and nodeB\n * @param nodeA\n * @param nodeB\n * @returns {boolean|*}\n */\nexport var getCommonParent = function (nodeA, nodeB) {\n var parentsA = getParents(nodeA);\n var parentsB = getParents(nodeB);\n // tslint:disable-next-line:prefer-for-of\n for (var i = 0; i < parentsA.length; i += 1) {\n var currentParent = parentsA[i];\n if (parentsB.indexOf(currentParent) >= 0) {\n return currentParent;\n }\n }\n return false;\n};\nexport var getTopCommonParent = function (baseActiveElement, leftEntry, rightEntries) {\n var activeElements = asArray(baseActiveElement);\n var leftEntries = asArray(leftEntry);\n var activeElement = activeElements[0];\n var topCommon = false;\n leftEntries.filter(Boolean).forEach(function (entry) {\n topCommon = getCommonParent(topCommon || entry, entry) || topCommon;\n rightEntries.filter(Boolean).forEach(function (subEntry) {\n var common = getCommonParent(activeElement, subEntry);\n if (common) {\n if (!topCommon || contains(common, topCommon)) {\n topCommon = common;\n }\n else {\n topCommon = getCommonParent(common, topCommon);\n }\n }\n });\n });\n // TODO: add assert here?\n return topCommon;\n};\n/**\n * return list of nodes which are expected to be autofocused inside a given top nodes\n * @param entries\n * @param visibilityCache\n */\nexport var allParentAutofocusables = function (entries, visibilityCache) {\n return entries.reduce(function (acc, node) { return acc.concat(parentAutofocusables(node, visibilityCache)); }, []);\n};\n"],"names":["getParents","node","parents","push","parentNode","host","getCommonParent","nodeA","nodeB","parentsA","parentsB","i","length","currentParent","indexOf","getTopCommonParent","baseActiveElement","leftEntry","rightEntries","activeElements","asArray","leftEntries","activeElement","topCommon","filter","Boolean","forEach","entry","subEntry","common","contains","allParentAutofocusables","entries","visibilityCache","reduce","acc","concat","parentAutofocusables"],"mappings":"wGAGA,IAAIA,EAAa,SAAUC,EAAMC,GAM7B,YALgB,IAAZA,IAAsBA,EAAU,IACpCA,EAAQC,KAAKF,GACTA,EAAKG,YACLJ,EAAWC,EAAKG,WAAWC,MAAQJ,EAAKG,WAAYF,GAEjDA,CACX,EAOWI,EAAkB,SAAUC,EAAOC,GAI1C,IAHA,IAAIC,EAAWT,EAAWO,GACtBG,EAAWV,EAAWQ,GAEjBG,EAAI,EAAGA,EAAIF,EAASG,OAAQD,GAAK,EAAG,CACzC,IAAIE,EAAgBJ,EAASE,GAC7B,GAAID,EAASI,QAAQD,IAAkB,EACnC,OAAOA,CAEnB,CACI,OAAO,CACX,EACWE,EAAqB,SAAUC,EAAmBC,EAAWC,GACpE,IAAIC,EAAiBC,EAAQJ,GACzBK,EAAcD,EAAQH,GACtBK,EAAgBH,EAAe,GAC/BI,GAAY,EAgBhB,OAfAF,EAAYG,OAAOC,SAASC,SAAQ,SAAUC,GAC1CJ,EAAYjB,EAAgBiB,GAAaI,EAAOA,IAAUJ,EAC1DL,EAAaM,OAAOC,SAASC,SAAQ,SAAUE,GAC3C,IAAIC,EAASvB,EAAgBgB,EAAeM,GACxCC,IAEIN,GADCA,GAAaO,EAASD,EAAQN,GACnBM,EAGAvB,EAAgBuB,EAAQN,GAGxD,GACA,IAEWA,CACX,EAMWQ,EAA0B,SAAUC,EAASC,GACpD,OAAOD,EAAQE,QAAO,SAAUC,EAAKlC,GAAQ,OAAOkC,EAAIC,OAAOC,EAAqBpC,EAAMgC,GAAkB,GAAI,GACpH","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"tabUtils.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/tabUtils.js"],"sourcesContent":["import { FOCUS_AUTO } from '../constants';\nimport { toArray } from './array';\nimport { tabbables } from './tabbables';\nvar queryTabbables = tabbables.join(',');\nvar queryGuardTabbables = \"\".concat(queryTabbables, \", [data-focus-guard]\");\nvar getFocusablesWithShadowDom = function (parent, withGuards) {\n return toArray((parent.shadowRoot || parent).children).reduce(function (acc, child) {\n return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], getFocusablesWithShadowDom(child));\n }, []);\n};\nvar getFocusablesWithIFrame = function (parent, withGuards) {\n var _a;\n // contentDocument of iframe will be null if current origin cannot access it\n if (parent instanceof HTMLIFrameElement && ((_a = parent.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) {\n return getFocusables([parent.contentDocument.body], withGuards);\n }\n return [parent];\n};\nexport var getFocusables = function (parents, withGuards) {\n return parents.reduce(function (acc, parent) {\n var _a;\n var focusableWithShadowDom = getFocusablesWithShadowDom(parent, withGuards);\n var focusableWithIframes = (_a = []).concat.apply(_a, focusableWithShadowDom.map(function (node) { return getFocusablesWithIFrame(node, withGuards); }));\n return acc.concat(\n // add all tabbables inside and within shadow DOMs in DOM order\n focusableWithIframes, \n // add if node is tabbable itself\n parent.parentNode\n ? toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function (node) { return node === parent; })\n : []);\n }, []);\n};\n/**\n * return a list of focusable nodes within an area marked as \"auto-focusable\"\n * @param parent\n */\nexport var getParentAutofocusables = function (parent) {\n var parentFocus = parent.querySelectorAll(\"[\".concat(FOCUS_AUTO, \"]\"));\n return toArray(parentFocus)\n .map(function (node) { return getFocusables([node]); })\n .reduce(function (acc, nodes) { return acc.concat(nodes); }, []);\n};\n"],"names":["queryTabbables","tabbables","join","queryGuardTabbables","concat","getFocusablesWithShadowDom","parent","withGuards","toArray","shadowRoot","children","reduce","acc","child","matches","getFocusables","parents","_a","focusableWithShadowDom","focusableWithIframes","apply","map","node","HTMLIFrameElement","contentDocument","undefined","body","getFocusablesWithIFrame","parentNode","querySelectorAll","filter","getParentAutofocusables","parentFocus","FOCUS_AUTO","nodes"],"mappings":"6HAGA,IAAIA,EAAiBC,EAAUC,KAAK,KAChCC,EAAsB,GAAGC,OAAOJ,EAAgB,wBAChDK,EAA6B,SAAUC,EAAQC,GAC/C,OAAOC,GAASF,EAAOG,YAAcH,GAAQI,UAAUC,QAAO,SAAUC,EAAKC,GACzE,OAAOD,EAAIR,OAAOS,EAAMC,QAAQP,EAAaJ,EAAsBH,GAAkB,CAACa,GAAS,GAAIR,EAA2BQ,GACjI,GAAE,GACP,EASWE,EAAgB,SAAUC,EAAST,GAC1C,OAAOS,EAAQL,QAAO,SAAUC,EAAKN,GACjC,IAAIW,EACAC,EAAyBb,EAA2BC,EAAQC,GAC5DY,GAAwBF,EAAK,IAAIb,OAAOgB,MAAMH,EAAIC,EAAuBG,KAAI,SAAUC,GAAQ,OAZ7E,SAAUhB,EAAQC,GAC5C,IAAIU,EAEJ,OAAIX,aAAkBiB,oBAAwD,QAAjCN,EAAKX,EAAOkB,uBAAoCC,IAAPR,OAAgBQ,EAASR,EAAGS,MACvGX,EAAc,CAACT,EAAOkB,gBAAgBE,MAAOnB,GAEjD,CAACD,EACZ,CAKkHqB,CAAwBL,EAAMf,EAAY,KACpJ,OAAOK,EAAIR,OAEXe,EAEAb,EAAOsB,WACDpB,EAAQF,EAAOsB,WAAWC,iBAAiB7B,IAAiB8B,QAAO,SAAUR,GAAQ,OAAOA,IAAShB,CAAS,IAC9G,GACT,GAAE,GACP,EAKWyB,EAA0B,SAAUzB,GAC3C,IAAI0B,EAAc1B,EAAOuB,iBAAiB,IAAIzB,OAAO6B,EAAY,MACjE,OAAOzB,EAAQwB,GACVX,KAAI,SAAUC,GAAQ,OAAOP,EAAc,CAACO,GAAS,IACrDX,QAAO,SAAUC,EAAKsB,GAAS,OAAOtB,EAAIR,OAAO8B,EAAS,GAAE,GACrE","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"tabUtils.js","sources":["../../../../../../node_modules/focus-lock/dist/es2015/utils/tabUtils.js"],"sourcesContent":["import { FOCUS_AUTO } from '../constants';\nimport { toArray } from './array';\nimport { tabbables } from './tabbables';\nvar queryTabbables = tabbables.join(',');\nvar queryGuardTabbables = \"\".concat(queryTabbables, \", [data-focus-guard]\");\nvar getFocusablesWithShadowDom = function (parent, withGuards) {\n return toArray((parent.shadowRoot || parent).children).reduce(function (acc, child) {\n return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [child] : [], getFocusablesWithShadowDom(child));\n }, []);\n};\nvar getFocusablesWithIFrame = function (parent, withGuards) {\n var _a;\n // contentDocument of iframe will be null if current origin cannot access it\n if (parent instanceof HTMLIFrameElement && ((_a = parent.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) {\n return getFocusables([parent.contentDocument.body], withGuards);\n }\n return [parent];\n};\nexport var getFocusables = function (parents, withGuards) {\n return parents.reduce(function (acc, parent) {\n var _a;\n var focusableWithShadowDom = getFocusablesWithShadowDom(parent, withGuards);\n var focusableWithIframes = (_a = []).concat.apply(_a, focusableWithShadowDom.map(function (node) { return getFocusablesWithIFrame(node, withGuards); }));\n return acc.concat(\n // add all tabbables inside and within shadow DOMs in DOM order\n focusableWithIframes, \n // add if node is tabbable itself\n parent.parentNode\n ? toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function (node) { return node === parent; })\n : []);\n }, []);\n};\n/**\n * return a list of focusable nodes within an area marked as \"auto-focusable\"\n * @param parent\n */\nexport var getParentAutofocusables = function (parent) {\n var parentFocus = parent.querySelectorAll(\"[\".concat(FOCUS_AUTO, \"]\"));\n return toArray(parentFocus)\n .map(function (node) { return getFocusables([node]); })\n .reduce(function (acc, nodes) { return acc.concat(nodes); }, []);\n};\n"],"names":["queryTabbables","tabbables","join","queryGuardTabbables","concat","getFocusablesWithShadowDom","parent","withGuards","toArray","shadowRoot","children","reduce","acc","child","matches","getFocusables","parents","_a","focusableWithShadowDom","focusableWithIframes","apply","map","node","HTMLIFrameElement","contentDocument","body","getFocusablesWithIFrame","parentNode","querySelectorAll","filter","getParentAutofocusables","parentFocus","FOCUS_AUTO","nodes"],"mappings":"6HAGA,IAAIA,EAAiBC,EAAUC,KAAK,KAChCC,EAAsB,GAAGC,OAAOJ,EAAgB,wBAChDK,EAA6B,SAAUC,EAAQC,GAC/C,OAAOC,GAASF,EAAOG,YAAcH,GAAQI,UAAUC,QAAO,SAAUC,EAAKC,GACzE,OAAOD,EAAIR,OAAOS,EAAMC,QAAQP,EAAaJ,EAAsBH,GAAkB,CAACa,GAAS,GAAIR,EAA2BQ,GACjI,GAAE,GACP,EASWE,EAAgB,SAAUC,EAAST,GAC1C,OAAOS,EAAQL,QAAO,SAAUC,EAAKN,GACjC,IAAIW,EACAC,EAAyBb,EAA2BC,EAAQC,GAC5DY,GAAwBF,EAAK,IAAIb,OAAOgB,MAAMH,EAAIC,EAAuBG,KAAI,SAAUC,GAAQ,OAZ7E,SAAUhB,EAAQC,GAC5C,IAAIU,EAEJ,OAAIX,aAAkBiB,oBAAwD,QAAjCN,EAAKX,EAAOkB,uBAAoC,IAAPP,OAAgB,EAASA,EAAGQ,MACvGV,EAAc,CAACT,EAAOkB,gBAAgBC,MAAOlB,GAEjD,CAACD,EACZ,CAKkHoB,CAAwBJ,EAAMf,EAAY,KACpJ,OAAOK,EAAIR,OAEXe,EAEAb,EAAOqB,WACDnB,EAAQF,EAAOqB,WAAWC,iBAAiB5B,IAAiB6B,QAAO,SAAUP,GAAQ,OAAOA,IAAShB,CAAS,IAC9G,GACT,GAAE,GACP,EAKWwB,EAA0B,SAAUxB,GAC3C,IAAIyB,EAAczB,EAAOsB,iBAAiB,IAAIxB,OAAO4B,EAAY,MACjE,OAAOxB,EAAQuB,GACVV,KAAI,SAAUC,GAAQ,OAAOP,EAAc,CAACO,GAAS,IACrDX,QAAO,SAAUC,EAAKqB,GAAS,OAAOrB,EAAIR,OAAO6B,EAAS,GAAE,GACrE","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"Lock.js","sources":["../../../../../node_modules/react-focus-lock/dist/es2015/Lock.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React, { forwardRef, useRef, useState, useCallback, useEffect, useMemo, Fragment } from 'react';\nimport { node, bool, string, any, arrayOf, oneOfType, object, func } from 'prop-types';\nimport { FOCUS_DISABLED, FOCUS_GROUP } from 'focus-lock/constants';\nimport { useMergeRefs } from 'use-callback-ref';\nimport { hiddenGuard } from './FocusGuard';\nimport { mediumFocus, mediumBlur, mediumSidecar } from './medium';\nimport { focusScope } from './scope';\nvar emptyArray = [];\nvar FocusLock = /*#__PURE__*/forwardRef(function FocusLockUI(props, parentRef) {\n var _extends2;\n var _useState = useState(),\n realObserved = _useState[0],\n setObserved = _useState[1];\n var observed = useRef();\n var isActive = useRef(false);\n var originalFocusedElement = useRef(null);\n var _useState2 = useState({}),\n update = _useState2[1];\n var children = props.children,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$noFocusGuards = props.noFocusGuards,\n noFocusGuards = _props$noFocusGuards === void 0 ? false : _props$noFocusGuards,\n _props$persistentFocu = props.persistentFocus,\n persistentFocus = _props$persistentFocu === void 0 ? false : _props$persistentFocu,\n _props$crossFrame = props.crossFrame,\n crossFrame = _props$crossFrame === void 0 ? true : _props$crossFrame,\n _props$autoFocus = props.autoFocus,\n autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,\n allowTextSelection = props.allowTextSelection,\n group = props.group,\n className = props.className,\n whiteList = props.whiteList,\n hasPositiveIndices = props.hasPositiveIndices,\n _props$shards = props.shards,\n shards = _props$shards === void 0 ? emptyArray : _props$shards,\n _props$as = props.as,\n Container = _props$as === void 0 ? 'div' : _props$as,\n _props$lockProps = props.lockProps,\n containerProps = _props$lockProps === void 0 ? {} : _props$lockProps,\n SideCar = props.sideCar,\n _props$returnFocus = props.returnFocus,\n shouldReturnFocus = _props$returnFocus === void 0 ? false : _props$returnFocus,\n focusOptions = props.focusOptions,\n onActivationCallback = props.onActivation,\n onDeactivationCallback = props.onDeactivation;\n var _useState3 = useState({}),\n id = _useState3[0];\n var onActivation = useCallback(function (_ref) {\n var captureFocusRestore = _ref.captureFocusRestore;\n if (!originalFocusedElement.current) {\n var _document;\n var activeElement = (_document = document) == null ? void 0 : _document.activeElement;\n originalFocusedElement.current = activeElement;\n if (activeElement !== document.body) {\n originalFocusedElement.current = captureFocusRestore(activeElement);\n }\n }\n if (observed.current && onActivationCallback) {\n onActivationCallback(observed.current);\n }\n isActive.current = true;\n update();\n }, [onActivationCallback]);\n var onDeactivation = useCallback(function () {\n isActive.current = false;\n if (onDeactivationCallback) {\n onDeactivationCallback(observed.current);\n }\n update();\n }, [onDeactivationCallback]);\n var returnFocus = useCallback(function (allowDefer) {\n var focusRestore = originalFocusedElement.current;\n if (focusRestore) {\n var returnFocusTo = (typeof focusRestore === 'function' ? focusRestore() : focusRestore) || document.body;\n var howToReturnFocus = typeof shouldReturnFocus === 'function' ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus;\n if (howToReturnFocus) {\n var returnFocusOptions = typeof howToReturnFocus === 'object' ? howToReturnFocus : undefined;\n originalFocusedElement.current = null;\n if (allowDefer) {\n Promise.resolve().then(function () {\n return returnFocusTo.focus(returnFocusOptions);\n });\n } else {\n returnFocusTo.focus(returnFocusOptions);\n }\n }\n }\n }, [shouldReturnFocus]);\n var onFocus = useCallback(function (event) {\n if (isActive.current) {\n mediumFocus.useMedium(event);\n }\n }, []);\n var onBlur = mediumBlur.useMedium;\n var setObserveNode = useCallback(function (newObserved) {\n if (observed.current !== newObserved) {\n observed.current = newObserved;\n setObserved(newObserved);\n }\n }, []);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof allowTextSelection !== 'undefined') {\n console.warn('React-Focus-Lock: allowTextSelection is deprecated and enabled by default');\n }\n useEffect(function () {\n if (!observed.current && typeof Container !== 'string') {\n console.error('FocusLock: could not obtain ref to internal node');\n }\n }, []);\n }\n var lockProps = _extends((_extends2 = {}, _extends2[FOCUS_DISABLED] = disabled && 'disabled', _extends2[FOCUS_GROUP] = group, _extends2), containerProps);\n var hasLeadingGuards = noFocusGuards !== true;\n var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';\n var mergedRef = useMergeRefs([parentRef, setObserveNode]);\n var focusScopeValue = useMemo(function () {\n return {\n observed: observed,\n shards: shards,\n enabled: !disabled,\n active: isActive.current\n };\n }, [disabled, isActive.current, shards, realObserved]);\n return /*#__PURE__*/React.createElement(Fragment, null, hasLeadingGuards && [\n /*#__PURE__*/\n React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }), hasPositiveIndices ? /*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-nearest\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 1,\n style: hiddenGuard\n }) : null], !disabled && /*#__PURE__*/React.createElement(SideCar, {\n id: id,\n sideCar: mediumSidecar,\n observed: realObserved,\n disabled: disabled,\n persistentFocus: persistentFocus,\n crossFrame: crossFrame,\n autoFocus: autoFocus,\n whiteList: whiteList,\n shards: shards,\n onActivation: onActivation,\n onDeactivation: onDeactivation,\n returnFocus: returnFocus,\n focusOptions: focusOptions,\n noFocusGuards: noFocusGuards\n }), /*#__PURE__*/React.createElement(Container, _extends({\n ref: mergedRef\n }, lockProps, {\n className: className,\n onBlur: onBlur,\n onFocus: onFocus\n }), /*#__PURE__*/React.createElement(focusScope.Provider, {\n value: focusScopeValue\n }, children)), hasTailingGuards && /*#__PURE__*/React.createElement(\"div\", {\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }));\n});\nFocusLock.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: node,\n disabled: bool,\n returnFocus: oneOfType([bool, object, func]),\n focusOptions: object,\n noFocusGuards: bool,\n hasPositiveIndices: bool,\n allowTextSelection: bool,\n autoFocus: bool,\n persistentFocus: bool,\n crossFrame: bool,\n group: string,\n className: string,\n whiteList: func,\n shards: arrayOf(any),\n as: oneOfType([string, func, object]),\n lockProps: object,\n onActivation: func,\n onDeactivation: func,\n sideCar: any.isRequired\n} : {};\nexport default FocusLock;"],"names":["emptyArray","FocusLock","forwardRef","props","parentRef","_extends2","_useState","useState","realObserved","setObserved","observed","useRef","isActive","originalFocusedElement","update","children","_props$disabled","disabled","undefined","_props$noFocusGuards","noFocusGuards","_props$persistentFocu","persistentFocus","_props$crossFrame","crossFrame","_props$autoFocus","autoFocus","allowTextSelection","group","className","whiteList","hasPositiveIndices","_props$shards","shards","_props$as","as","Container","_props$lockProps","lockProps","containerProps","SideCar","sideCar","_props$returnFocus","returnFocus","shouldReturnFocus","focusOptions","onActivationCallback","onActivation","onDeactivationCallback","onDeactivation","id","useCallback","_ref","captureFocusRestore","current","_document","activeElement","document","body","allowDefer","focusRestore","returnFocusTo","howToReturnFocus","returnFocusOptions","Promise","resolve","then","focus","onFocus","event","mediumFocus","useMedium","onBlur","mediumBlur","setObserveNode","newObserved","process","env","NODE_ENV","console","warn","useEffect","error","_extends","FOCUS_DISABLED","FOCUS_GROUP","hasLeadingGuards","hasTailingGuards","mergedRef","useMergeRefs","focusScopeValue","useMemo","enabled","active","React","createElement","Fragment","key","tabIndex","style","hiddenGuard","mediumSidecar","ref","focusScope","Provider","value","propTypes","node","bool","oneOfType","object","func","string","arrayOf","any","isRequired"],"mappings":"koBAQA,IAAIA,EAAa,GACbC,EAAyBC,GAAW,SAAqBC,EAAOC,GAClE,IAAIC,EACAC,EAAYC,IACdC,EAAeF,EAAU,GACzBG,EAAcH,EAAU,GACtBI,EAAWC,IACXC,EAAWD,GAAO,GAClBE,EAAyBF,EAAO,MAElCG,EADeP,EAAS,IACJ,GAClBQ,EAAWZ,EAAMY,SACnBC,EAAkBb,EAAMc,SACxBA,OAA+BC,IAApBF,GAAqCA,EAChDG,EAAuBhB,EAAMiB,cAC7BA,OAAyCF,IAAzBC,GAA0CA,EAC1DE,EAAwBlB,EAAMmB,gBAC9BA,OAA4CJ,IAA1BG,GAA2CA,EAC7DE,EAAoBpB,EAAMqB,WAC1BA,OAAmCN,IAAtBK,GAAsCA,EACnDE,EAAmBtB,EAAMuB,UACzBA,OAAiCR,IAArBO,GAAqCA,EACjDE,EAAqBxB,EAAMwB,mBAC3BC,EAAQzB,EAAMyB,MACdC,EAAY1B,EAAM0B,UAClBC,EAAY3B,EAAM2B,UAClBC,EAAqB5B,EAAM4B,mBAC3BC,EAAgB7B,EAAM8B,OACtBA,OAA2Bf,IAAlBc,EAA2BhC,EAAagC,EACjDE,EAAY/B,EAAMgC,GAClBC,OAA0BlB,IAAdgB,EAAuB,MAAQA,EAC3CG,EAAmBlC,EAAMmC,UACzBC,OAAsCrB,IAArBmB,EAA8B,CAAA,EAAKA,EACpDG,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zE,oBAAoB,EACpBG,SAAUjF,GAAW,EAAK,EAC1BkF,MAAOC,IAEX,IACAnG,EAAUyG,UAAqC,eAAzB9B,QAAQC,IAAIC,SAA4B,CAC5D/D,SAAU4F,EACV1F,SAAU2F,EACVjE,YAAakE,EAAU,CAACD,EAAME,EAAQC,IACtClE,aAAciE,EACd1F,cAAewF,EACf7E,mBAAoB6E,EACpBjF,mBAAoBiF,EACpBlF,UAAWkF,EACXtF,gBAAiBsF,EACjBpF,WAAYoF,EACZhF,MAAOoF,EACPnF,UAAWmF,EACXlF,UAAWiF,EACX9E,OAAQgF,EAAQC,GAChB/E,GAAI0E,EAAU,CAACG,EAAQD,EAAMD,IAC7BxE,UAAWwE,EACX/D,aAAcgE,EACd9D,eAAgB8D,EAChBtE,QAASyE,EAAIC,YACX,CAAE","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"Lock.js","sources":["../../../../../node_modules/react-focus-lock/dist/es2015/Lock.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React, { forwardRef, useRef, useState, useCallback, useEffect, useMemo, Fragment } from 'react';\nimport { node, bool, string, any, arrayOf, oneOfType, object, func } from 'prop-types';\nimport { FOCUS_DISABLED, FOCUS_GROUP } from 'focus-lock/constants';\nimport { useMergeRefs } from 'use-callback-ref';\nimport { hiddenGuard } from './FocusGuard';\nimport { mediumFocus, mediumBlur, mediumSidecar } from './medium';\nimport { focusScope } from './scope';\nvar emptyArray = [];\nvar FocusLock = /*#__PURE__*/forwardRef(function FocusLockUI(props, parentRef) {\n var _extends2;\n var _useState = useState(),\n realObserved = _useState[0],\n setObserved = _useState[1];\n var observed = useRef();\n var isActive = useRef(false);\n var originalFocusedElement = useRef(null);\n var _useState2 = useState({}),\n update = _useState2[1];\n var children = props.children,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$noFocusGuards = props.noFocusGuards,\n noFocusGuards = _props$noFocusGuards === void 0 ? false : _props$noFocusGuards,\n _props$persistentFocu = props.persistentFocus,\n persistentFocus = _props$persistentFocu === void 0 ? false : _props$persistentFocu,\n _props$crossFrame = props.crossFrame,\n crossFrame = _props$crossFrame === void 0 ? true : _props$crossFrame,\n _props$autoFocus = props.autoFocus,\n autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,\n allowTextSelection = props.allowTextSelection,\n group = props.group,\n className = props.className,\n whiteList = props.whiteList,\n hasPositiveIndices = props.hasPositiveIndices,\n _props$shards = props.shards,\n shards = _props$shards === void 0 ? emptyArray : _props$shards,\n _props$as = props.as,\n Container = _props$as === void 0 ? 'div' : _props$as,\n _props$lockProps = props.lockProps,\n containerProps = _props$lockProps === void 0 ? {} : _props$lockProps,\n SideCar = props.sideCar,\n _props$returnFocus = props.returnFocus,\n shouldReturnFocus = _props$returnFocus === void 0 ? false : _props$returnFocus,\n focusOptions = props.focusOptions,\n onActivationCallback = props.onActivation,\n onDeactivationCallback = props.onDeactivation;\n var _useState3 = useState({}),\n id = _useState3[0];\n var onActivation = useCallback(function (_ref) {\n var captureFocusRestore = _ref.captureFocusRestore;\n if (!originalFocusedElement.current) {\n var _document;\n var activeElement = (_document = document) == null ? void 0 : _document.activeElement;\n originalFocusedElement.current = activeElement;\n if (activeElement !== document.body) {\n originalFocusedElement.current = captureFocusRestore(activeElement);\n }\n }\n if (observed.current && onActivationCallback) {\n onActivationCallback(observed.current);\n }\n isActive.current = true;\n update();\n }, [onActivationCallback]);\n var onDeactivation = useCallback(function () {\n isActive.current = false;\n if (onDeactivationCallback) {\n onDeactivationCallback(observed.current);\n }\n update();\n }, [onDeactivationCallback]);\n var returnFocus = useCallback(function (allowDefer) {\n var focusRestore = originalFocusedElement.current;\n if (focusRestore) {\n var returnFocusTo = (typeof focusRestore === 'function' ? focusRestore() : focusRestore) || document.body;\n var howToReturnFocus = typeof shouldReturnFocus === 'function' ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus;\n if (howToReturnFocus) {\n var returnFocusOptions = typeof howToReturnFocus === 'object' ? howToReturnFocus : undefined;\n originalFocusedElement.current = null;\n if (allowDefer) {\n Promise.resolve().then(function () {\n return returnFocusTo.focus(returnFocusOptions);\n });\n } else {\n returnFocusTo.focus(returnFocusOptions);\n }\n }\n }\n }, [shouldReturnFocus]);\n var onFocus = useCallback(function (event) {\n if (isActive.current) {\n mediumFocus.useMedium(event);\n }\n }, []);\n var onBlur = mediumBlur.useMedium;\n var setObserveNode = useCallback(function (newObserved) {\n if (observed.current !== newObserved) {\n observed.current = newObserved;\n setObserved(newObserved);\n }\n }, []);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof allowTextSelection !== 'undefined') {\n console.warn('React-Focus-Lock: allowTextSelection is deprecated and enabled by default');\n }\n useEffect(function () {\n if (!observed.current && typeof Container !== 'string') {\n console.error('FocusLock: could not obtain ref to internal node');\n }\n }, []);\n }\n var lockProps = _extends((_extends2 = {}, _extends2[FOCUS_DISABLED] = disabled && 'disabled', _extends2[FOCUS_GROUP] = group, _extends2), containerProps);\n var hasLeadingGuards = noFocusGuards !== true;\n var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';\n var mergedRef = useMergeRefs([parentRef, setObserveNode]);\n var focusScopeValue = useMemo(function () {\n return {\n observed: observed,\n shards: shards,\n enabled: !disabled,\n active: isActive.current\n };\n }, [disabled, isActive.current, shards, realObserved]);\n return /*#__PURE__*/React.createElement(Fragment, null, hasLeadingGuards && [\n /*#__PURE__*/\n React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }), hasPositiveIndices ? /*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-nearest\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 1,\n style: hiddenGuard\n }) : null], !disabled && /*#__PURE__*/React.createElement(SideCar, {\n id: id,\n sideCar: mediumSidecar,\n observed: realObserved,\n disabled: disabled,\n persistentFocus: persistentFocus,\n crossFrame: crossFrame,\n autoFocus: autoFocus,\n whiteList: whiteList,\n shards: shards,\n onActivation: onActivation,\n onDeactivation: onDeactivation,\n returnFocus: returnFocus,\n focusOptions: focusOptions,\n noFocusGuards: noFocusGuards\n }), /*#__PURE__*/React.createElement(Container, _extends({\n ref: mergedRef\n }, lockProps, {\n className: className,\n onBlur: onBlur,\n onFocus: onFocus\n }), /*#__PURE__*/React.createElement(focusScope.Provider, {\n value: focusScopeValue\n }, children)), hasTailingGuards && /*#__PURE__*/React.createElement(\"div\", {\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }));\n});\nFocusLock.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: node,\n disabled: bool,\n returnFocus: oneOfType([bool, object, func]),\n focusOptions: object,\n noFocusGuards: bool,\n hasPositiveIndices: bool,\n allowTextSelection: bool,\n autoFocus: bool,\n persistentFocus: bool,\n crossFrame: bool,\n group: string,\n className: string,\n whiteList: func,\n shards: arrayOf(any),\n as: oneOfType([string, func, object]),\n lockProps: object,\n onActivation: func,\n onDeactivation: func,\n sideCar: any.isRequired\n} : {};\nexport default FocusLock;"],"names":["emptyArray","FocusLock","forwardRef","props","parentRef","_extends2","_useState","useState","realObserved","setObserved","observed","useRef","isActive","originalFocusedElement","update","children","_props$disabled","disabled","_props$noFocusGuards","noFocusGuards","_props$persistentFocu","persistentFocus","_props$crossFrame","crossFrame","_props$autoFocus","autoFocus","allowTextSelection","group","className","whiteList","hasPositiveIndices","_props$shards","shards","_props$as","as","Container","_props$lockProps","lockProps","containerProps","SideCar","sideCar","_props$returnFocus","returnFocus","shouldReturnFocus","focusOptions","onActivationCallback","onActivation","onDeactivationCallback","onDeactivation","id","useCallback","_ref","captureFocusRestore","current","_document","activeElement","document","body","allowDefer","focusRestore","returnFocusTo","howToReturnFocus","returnFocusOptions","undefined","Promise","resolve","then","focus","onFocus","event","mediumFocus","useMedium","onBlur","mediumBlur","setObserveNode","newObserved","process","env","NODE_ENV","console","warn","useEffect","error","_extends","FOCUS_DISABLED","FOCUS_GROUP","hasLeadingGuards","hasTailingGuards","mergedRef","useMergeRefs","focusScopeValue","useMemo","enabled","active","React","createElement","Fragment","key","tabIndex","style","hiddenGuard","mediumSidecar","ref","focusScope","Provider","value","propTypes","node","bool","oneOfType","object","func","string","arrayOf","any","isRequired"],"mappings":"koBAQA,IAAIA,EAAa,GACbC,EAAyBC,GAAW,SAAqBC,EAAOC,GAClE,IAAIC,EACAC,EAAYC,IACdC,EAAeF,EAAU,GACzBG,EAAcH,EAAU,GACtBI,EAAWC,IACXC,EAAWD,GAAO,GAClBE,EAAyBF,EAAO,MAElCG,EADeP,EAAS,IACJ,GAClBQ,EAAWZ,EAAMY,SACnBC,EAAkBb,EAAMc,SACxBA,OAA+B,IAApBD,GAAqCA,EAChDE,EAAuBf,EAAMgB,cAC7BA,OAAyC,IAAzBD,GAA0CA,EAC1DE,EAAwBjB,EAAMkB,gBAC9BA,OAA4C,IAA1BD,GAA2CA,EAC7DE,EAAoBnB,EAAMoB,WAC1BA,OAAmC,IAAtBD,GAAsCA,EACnDE,EAAmBrB,EAAMsB,UACzBA,OAAiC,IAArBD,GAAqCA,EACjDE,EAAqBvB,EAAMuB,mBAC3BC,EAAQxB,EAAMwB,MACdC,EAAYzB,EAAMyB,UAClBC,EAAY1B,EAAM0B,UAClBC,EAAqB3B,EAAM2B,mBAC3BC,EAAgB5B,EAAM6B,OACtBA,OAA2B,IAAlBD,EAA2B/B,EAAa+B,EACjDE,EAAY9B,EAAM+B,GAClBC,OAA0B,IAAdF,EAAuB,MAAQA,EAC3CG,EAAmBjC,EAAMkC,UACzBC,OAAsC,IAArBF,EAA8B,CAAA,EAAKA,EACpDG,EAAUpC,EAAMqC,QAChBC,EAAqBtC,EAAMuC,YAC3BC,OAA2C,IAAvBF,GAAwCA,EAC5DG,EAAezC,EAAMyC,aACrBC,EAAuB1C,EAAM2C,aAC7BC,GAAyB5C,EAAM6C,eAE/BC,GADe1C,EAAS,IACR,GACduC,GAAeI,GAAY,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d3F,cAAeyF,EACf9E,mBAAoB8E,EACpBlF,mBAAoBkF,EACpBnF,UAAWmF,EACXvF,gBAAiBuF,EACjBrF,WAAYqF,EACZjF,MAAOqF,EACPpF,UAAWoF,EACXnF,UAAWkF,EACX/E,OAAQiF,EAAQC,GAChBhF,GAAI2E,EAAU,CAACG,EAAQD,EAAMD,IAC7BzE,UAAWyE,EACXhE,aAAciE,EACd/D,eAAgB+D,EAChBvE,QAAS0E,EAAIC,YACX,CAAE","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../node_modules/react-intersection-observer/dist/index.mjs"],"sourcesContent":["\"use client\";\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n\n// src/InView.tsx\nimport * as React from \"react\";\n\n// src/observe.ts\nvar observerMap = /* @__PURE__ */ new Map();\nvar RootIds = /* @__PURE__ */ new WeakMap();\nvar rootId = 0;\nvar unsupportedValue = void 0;\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\nfunction getRootId(root) {\n if (!root) return \"0\";\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(\n (key) => options[key] !== void 0\n ).map((key) => {\n return `${key}_${key === \"root\" ? getRootId(options.root) : options[key]}`;\n }).toString();\n}\nfunction createObserver(options) {\n const id = optionsToId(options);\n let instance = observerMap.get(id);\n if (!instance) {\n const elements = /* @__PURE__ */ new Map();\n let thresholds;\n const observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n var _a;\n const inView = entry.isIntersecting && thresholds.some((threshold) => entry.intersectionRatio >= threshold);\n if (options.trackVisibility && typeof entry.isVisible === \"undefined\") {\n entry.isVisible = inView;\n }\n (_a = elements.get(entry.target)) == null ? void 0 : _a.forEach((callback) => {\n callback(inView, entry);\n });\n });\n }, options);\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id,\n observer,\n elements\n };\n observerMap.set(id, instance);\n }\n return instance;\n}\nfunction observe(element, callback, options = {}, fallbackInView = unsupportedValue) {\n if (typeof window.IntersectionObserver === \"undefined\" && fallbackInView !== void 0) {\n const bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === \"number\" ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return () => {\n };\n }\n const { id, observer, elements } = createObserver(options);\n const callbacks = elements.get(element) || [];\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n callbacks.splice(callbacks.indexOf(callback), 1);\n if (callbacks.length === 0) {\n elements.delete(element);\n observer.unobserve(element);\n }\n if (elements.size === 0) {\n observer.disconnect();\n observerMap.delete(id);\n }\n };\n}\n\n// src/InView.tsx\nfunction isPlainChildren(props) {\n return typeof props.children !== \"function\";\n}\nvar InView = class extends React.Component {\n constructor(props) {\n super(props);\n __publicField(this, \"node\", null);\n __publicField(this, \"_unobserveCb\", null);\n __publicField(this, \"handleNode\", (node) => {\n if (this.node) {\n this.unobserve();\n if (!node && !this.props.triggerOnce && !this.props.skip) {\n this.setState({ inView: !!this.props.initialInView, entry: void 0 });\n }\n }\n this.node = node ? node : null;\n this.observeNode();\n });\n __publicField(this, \"handleChange\", (inView, entry) => {\n if (inView && this.props.triggerOnce) {\n this.unobserve();\n }\n if (!isPlainChildren(this.props)) {\n this.setState({ inView, entry });\n }\n if (this.props.onChange) {\n this.props.onChange(inView, entry);\n }\n });\n this.state = {\n inView: !!props.initialInView,\n entry: void 0\n };\n }\n componentDidMount() {\n this.unobserve();\n this.observeNode();\n }\n componentDidUpdate(prevProps) {\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n }\n componentWillUnmount() {\n this.unobserve();\n }\n observeNode() {\n if (!this.node || this.props.skip) return;\n const {\n threshold,\n root,\n rootMargin,\n trackVisibility,\n delay,\n fallbackInView\n } = this.props;\n this._unobserveCb = observe(\n this.node,\n this.handleChange,\n {\n threshold,\n root,\n rootMargin,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n }\n unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n this._unobserveCb = null;\n }\n }\n render() {\n const { children } = this.props;\n if (typeof children === \"function\") {\n const { inView, entry } = this.state;\n return children({ inView, entry, ref: this.handleNode });\n }\n const {\n as,\n triggerOnce,\n threshold,\n root,\n rootMargin,\n onChange,\n skip,\n trackVisibility,\n delay,\n initialInView,\n fallbackInView,\n ...props\n } = this.props;\n return React.createElement(\n as || \"div\",\n { ref: this.handleNode, ...props },\n children\n );\n }\n};\n\n// src/useInView.tsx\nimport * as React2 from \"react\";\nfunction useInView({\n threshold,\n delay,\n trackVisibility,\n rootMargin,\n root,\n triggerOnce,\n skip,\n initialInView,\n fallbackInView,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = React2.useState(null);\n const callback = React2.useRef(onChange);\n const [state, setState] = React2.useState({\n inView: !!initialInView,\n entry: void 0\n });\n callback.current = onChange;\n React2.useEffect(\n () => {\n if (skip || !ref) return;\n let unobserve;\n unobserve = observe(\n ref,\n (inView, entry) => {\n setState({\n inView,\n entry\n });\n if (callback.current) callback.current(inView, entry);\n if (entry.isIntersecting && triggerOnce && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n },\n {\n root,\n rootMargin,\n threshold,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n return () => {\n if (unobserve) {\n unobserve();\n }\n };\n },\n // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n // If the threshold is an array, convert it to a string, so it won't change between renders.\n Array.isArray(threshold) ? threshold.toString() : threshold,\n ref,\n root,\n rootMargin,\n triggerOnce,\n skip,\n trackVisibility,\n fallbackInView,\n delay\n ]\n );\n const entryTarget = (_a = state.entry) == null ? void 0 : _a.target;\n const previousEntryTarget = React2.useRef(void 0);\n if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) {\n previousEntryTarget.current = entryTarget;\n setState({\n inView: !!initialInView,\n entry: void 0\n });\n }\n const result = [setRef, state.inView, state.entry];\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\nexport {\n InView,\n defaultFallbackInView,\n observe,\n useInView\n};\n//# sourceMappingURL=index.mjs.map"],"names":["__defProp","Object","defineProperty","__publicField","obj","key","value","enumerable","configurable","writable","__defNormalProp","observerMap","Map","RootIds","WeakMap","rootId","optionsToId","options","keys","sort","filter","undefined","map","root","has","set","toString","get","observe","element","callback","fallbackInView","window","IntersectionObserver","bounds","getBoundingClientRect","isIntersecting","target","intersectionRatio","threshold","time","boundingClientRect","intersectionRect","rootBounds","id","observer","elements","instance","thresholds","entries","forEach","entry","_a","inView","some","trackVisibility","isVisible","Array","isArray","createObserver","callbacks","push","splice","indexOf","length","delete","unobserve","size","disconnect","InView","React","Component","constructor","props","super","this","node","triggerOnce","skip","setState","initialInView","observeNode","children","isPlainChildren","onChange","state","componentDidMount","componentDidUpdate","prevProps","rootMargin","delay","componentWillUnmount","_unobserveCb","handleChange","render","ref","handleNode","as","createElement"],"mappings":"wBACA,IAAIA,EAAYC,OAAOC,eAEnBC,EAAgB,CAACC,EAAKC,EAAKC,IADT,EAACF,EAAKC,EAAKC,IAAUD,KAAOD,EAAMJ,EAAUI,EAAK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T,OAAOH,EAAM4B,cACXD,GAAM,MACN,CAAEF,IAAKpB,KAAKqB,cAAevB,GAC3BS,EAEN","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../../../../node_modules/react-intersection-observer/dist/index.mjs"],"sourcesContent":["\"use client\";\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n\n// src/InView.tsx\nimport * as React from \"react\";\n\n// src/observe.ts\nvar observerMap = /* @__PURE__ */ new Map();\nvar RootIds = /* @__PURE__ */ new WeakMap();\nvar rootId = 0;\nvar unsupportedValue = void 0;\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\nfunction getRootId(root) {\n if (!root) return \"0\";\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(\n (key) => options[key] !== void 0\n ).map((key) => {\n return `${key}_${key === \"root\" ? getRootId(options.root) : options[key]}`;\n }).toString();\n}\nfunction createObserver(options) {\n const id = optionsToId(options);\n let instance = observerMap.get(id);\n if (!instance) {\n const elements = /* @__PURE__ */ new Map();\n let thresholds;\n const observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n var _a;\n const inView = entry.isIntersecting && thresholds.some((threshold) => entry.intersectionRatio >= threshold);\n if (options.trackVisibility && typeof entry.isVisible === \"undefined\") {\n entry.isVisible = inView;\n }\n (_a = elements.get(entry.target)) == null ? void 0 : _a.forEach((callback) => {\n callback(inView, entry);\n });\n });\n }, options);\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id,\n observer,\n elements\n };\n observerMap.set(id, instance);\n }\n return instance;\n}\nfunction observe(element, callback, options = {}, fallbackInView = unsupportedValue) {\n if (typeof window.IntersectionObserver === \"undefined\" && fallbackInView !== void 0) {\n const bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === \"number\" ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return () => {\n };\n }\n const { id, observer, elements } = createObserver(options);\n const callbacks = elements.get(element) || [];\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n callbacks.splice(callbacks.indexOf(callback), 1);\n if (callbacks.length === 0) {\n elements.delete(element);\n observer.unobserve(element);\n }\n if (elements.size === 0) {\n observer.disconnect();\n observerMap.delete(id);\n }\n };\n}\n\n// src/InView.tsx\nfunction isPlainChildren(props) {\n return typeof props.children !== \"function\";\n}\nvar InView = class extends React.Component {\n constructor(props) {\n super(props);\n __publicField(this, \"node\", null);\n __publicField(this, \"_unobserveCb\", null);\n __publicField(this, \"handleNode\", (node) => {\n if (this.node) {\n this.unobserve();\n if (!node && !this.props.triggerOnce && !this.props.skip) {\n this.setState({ inView: !!this.props.initialInView, entry: void 0 });\n }\n }\n this.node = node ? node : null;\n this.observeNode();\n });\n __publicField(this, \"handleChange\", (inView, entry) => {\n if (inView && this.props.triggerOnce) {\n this.unobserve();\n }\n if (!isPlainChildren(this.props)) {\n this.setState({ inView, entry });\n }\n if (this.props.onChange) {\n this.props.onChange(inView, entry);\n }\n });\n this.state = {\n inView: !!props.initialInView,\n entry: void 0\n };\n }\n componentDidMount() {\n this.unobserve();\n this.observeNode();\n }\n componentDidUpdate(prevProps) {\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n }\n componentWillUnmount() {\n this.unobserve();\n }\n observeNode() {\n if (!this.node || this.props.skip) return;\n const {\n threshold,\n root,\n rootMargin,\n trackVisibility,\n delay,\n fallbackInView\n } = this.props;\n this._unobserveCb = observe(\n this.node,\n this.handleChange,\n {\n threshold,\n root,\n rootMargin,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n }\n unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n this._unobserveCb = null;\n }\n }\n render() {\n const { children } = this.props;\n if (typeof children === \"function\") {\n const { inView, entry } = this.state;\n return children({ inView, entry, ref: this.handleNode });\n }\n const {\n as,\n triggerOnce,\n threshold,\n root,\n rootMargin,\n onChange,\n skip,\n trackVisibility,\n delay,\n initialInView,\n fallbackInView,\n ...props\n } = this.props;\n return React.createElement(\n as || \"div\",\n { ref: this.handleNode, ...props },\n children\n );\n }\n};\n\n// src/useInView.tsx\nimport * as React2 from \"react\";\nfunction useInView({\n threshold,\n delay,\n trackVisibility,\n rootMargin,\n root,\n triggerOnce,\n skip,\n initialInView,\n fallbackInView,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = React2.useState(null);\n const callback = React2.useRef(onChange);\n const [state, setState] = React2.useState({\n inView: !!initialInView,\n entry: void 0\n });\n callback.current = onChange;\n React2.useEffect(\n () => {\n if (skip || !ref) return;\n let unobserve;\n unobserve = observe(\n ref,\n (inView, entry) => {\n setState({\n inView,\n entry\n });\n if (callback.current) callback.current(inView, entry);\n if (entry.isIntersecting && triggerOnce && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n },\n {\n root,\n rootMargin,\n threshold,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n return () => {\n if (unobserve) {\n unobserve();\n }\n };\n },\n // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n // If the threshold is an array, convert it to a string, so it won't change between renders.\n Array.isArray(threshold) ? threshold.toString() : threshold,\n ref,\n root,\n rootMargin,\n triggerOnce,\n skip,\n trackVisibility,\n fallbackInView,\n delay\n ]\n );\n const entryTarget = (_a = state.entry) == null ? void 0 : _a.target;\n const previousEntryTarget = React2.useRef(void 0);\n if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) {\n previousEntryTarget.current = entryTarget;\n setState({\n inView: !!initialInView,\n entry: void 0\n });\n }\n const result = [setRef, state.inView, state.entry];\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\nexport {\n InView,\n defaultFallbackInView,\n observe,\n useInView\n};\n//# sourceMappingURL=index.mjs.map"],"names":["__defProp","Object","defineProperty","__publicField","obj","key","value","enumerable","configurable","writable","__defNormalProp","observerMap","Map","RootIds","WeakMap","rootId","optionsToId","options","keys","sort","filter","map","root","has","set","toString","get","observe","element","callback","fallbackInView","window","IntersectionObserver","bounds","getBoundingClientRect","isIntersecting","target","intersectionRatio","threshold","time","boundingClientRect","intersectionRect","rootBounds","id","observer","elements","instance","thresholds","entries","forEach","entry","_a","inView","some","trackVisibility","isVisible","Array","isArray","createObserver","callbacks","push","splice","indexOf","length","delete","unobserve","size","disconnect","InView","React","Component","constructor","props","super","this","node","triggerOnce","skip","setState","initialInView","observeNode","children","isPlainChildren","onChange","state","componentDidMount","componentDidUpdate","prevProps","rootMargin","delay","componentWillUnmount","_unobserveCb","handleChange","render","ref","handleNode","as","createElement"],"mappings":"wBACA,IAAIA,EAAYC,OAAOC,eAEnBC,EAAgB,CAACC,EAAKC,EAAKC,IADT,EAACF,EAAKC,EAAKC,IAAUD,KAAOD,EAAMJ,EAAUI,EAAKC,EAAK,CAAEE,YAAY,EAAMC,cAAc,EAAMC,UAAU,EAAMH,UAAWF,EAAIC,GAAOC,EACjHI,CAAgBN,EAAoB,iBAARC,EAAmBA,EAAM,GAAKA,EAAKC,GAMpGK,EAA8B,IAAIC,IAClCC,EAA0B,IAAIC,QAC9BC,EAAS,EAYb,SAASC,EAAYC,GACnB,OAAOhB,OAAOiB,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AAUjE,OAASoD,KAAKF,MAAMlD,MAAQiE,EAAUjD,YAAcoC,KAAKF,MAAMlC,WAAaiD,EAAUV,OAASH,KAAKF,MAAMK,MAAQU,EAAUjC,kBAAoBoB,KAAKF,MAAMlB,iBAAmBiC,EAAUE,QAAUf,KAAKF,MAAMiB,QAC3Qf,KAAKT,YACLS,KAAKM,cAEX,CACE,oBAAAU,GACEhB,KAAKT,WACT,CACE,WAAAe,GACE,IAAKN,KAAKC,MAAQD,KAAKF,MAAMK,KAAM,OACnC,MAAMvC,UACJA,EAAShB,KACTA,EAAIkE,WACJA,EAAUlC,gBACVA,EAAemC,MACfA,EAAK3D,eACLA,GACE4C,KAAKF,MACTE,KAAKiB,aAAehE,EAClB+C,KAAKC,KACLD,KAAKkB,aACL,CACEtD,YACAhB,OACAkE,aAEAlC,kBAEAmC,SAEF3D,EAEN,CACE,SAAAmC,GACMS,KAAKiB,eACPjB,KAAKiB,eACLjB,KAAKiB,aAAe,KAE1B,CACE,MAAAE,GACE,MAAMZ,SAAEA,GAAaP,KAAKF,MAC1B,GAAwB,mBAAbS,EAAyB,CAClC,MAAM7B,OAAEA,EAAMF,MAAEA,GAAUwB,KAAKU,MAC/B,OAAOH,EAAS,CAAE7B,SAAQF,QAAO4C,IAAKpB,KAAKqB,YACjD,CACI,MAAMC,GACJA,EAAEpB,YACFA,EAAWtC,UACXA,EAAShB,KACTA,EAAIkE,WACJA,EAAUL,SACVA,EAAQN,KACRA,EAAIvB,gBACJA,EAAemC,MACfA,EAAKV,cACLA,EAAajD,eACbA,KACG0C,GACDE,KAAKF,MACT,OAAOH,EAAM4B,cACXD,GAAM,MACN,CAAEF,IAAKpB,KAAKqB,cAAevB,GAC3BS,EAEN","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"medium.js","sources":["../../../../../node_modules/use-sidecar/dist/es2015/medium.js"],"sourcesContent":["import { __assign } from \"tslib\";\nfunction ItoI(a) {\n return a;\n}\nfunction innerCreateMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n var buffer = [];\n var assigned = false;\n var medium = {\n read: function () {\n if (assigned) {\n throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');\n }\n if (buffer.length) {\n return buffer[buffer.length - 1];\n }\n return defaults;\n },\n useMedium: function (data) {\n var item = middleware(data, assigned);\n buffer.push(item);\n return function () {\n buffer = buffer.filter(function (x) { return x !== item; });\n };\n },\n assignSyncMedium: function (cb) {\n assigned = true;\n while (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n }\n buffer = {\n push: function (x) { return cb(x); },\n filter: function () { return buffer; },\n };\n },\n assignMedium: function (cb) {\n assigned = true;\n var pendingQueue = [];\n if (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n pendingQueue = buffer;\n }\n var executeQueue = function () {\n var cbs = pendingQueue;\n pendingQueue = [];\n cbs.forEach(cb);\n };\n var cycle = function () { return Promise.resolve().then(executeQueue); };\n cycle();\n buffer = {\n push: function (x) {\n pendingQueue.push(x);\n cycle();\n },\n filter: function (filter) {\n pendingQueue = pendingQueue.filter(filter);\n return buffer;\n },\n };\n },\n };\n return medium;\n}\nexport function createMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n return innerCreateMedium(defaults, middleware);\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function createSidecarMedium(options) {\n if (options === void 0) { options = {}; }\n var medium = innerCreateMedium(null);\n medium.options = __assign({ async: true, ssr: false }, options);\n return medium;\n}\n"],"names":["ItoI","a","innerCreateMedium","defaults","middleware","undefined","buffer","assigned","read","Error","length","useMedium","data","item","push","filter","x","assignSyncMedium","cb","cbs","forEach","assignMedium","pendingQueue","executeQueue","cycle","Promise","resolve","then","createMedium","createSidecarMedium","options","medium","__assign","async","ssr"],"mappings":"uDACA,SAASA,EAAKC,GACV,OAAOA,CACX,CACA,SAASC,EAAkBC,EAAUC,QACdC,IAAfD,IAAyB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GAChDC,CACX","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"medium.js","sources":["../../../../../node_modules/use-sidecar/dist/es2015/medium.js"],"sourcesContent":["import { __assign } from \"tslib\";\nfunction ItoI(a) {\n return a;\n}\nfunction innerCreateMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n var buffer = [];\n var assigned = false;\n var medium = {\n read: function () {\n if (assigned) {\n throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');\n }\n if (buffer.length) {\n return buffer[buffer.length - 1];\n }\n return defaults;\n },\n useMedium: function (data) {\n var item = middleware(data, assigned);\n buffer.push(item);\n return function () {\n buffer = buffer.filter(function (x) { return x !== item; });\n };\n },\n assignSyncMedium: function (cb) {\n assigned = true;\n while (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n }\n buffer = {\n push: function (x) { return cb(x); },\n filter: function () { return buffer; },\n };\n },\n assignMedium: function (cb) {\n assigned = true;\n var pendingQueue = [];\n if (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n pendingQueue = buffer;\n }\n var executeQueue = function () {\n var cbs = pendingQueue;\n pendingQueue = [];\n cbs.forEach(cb);\n };\n var cycle = function () { return Promise.resolve().then(executeQueue); };\n cycle();\n buffer = {\n push: function (x) {\n pendingQueue.push(x);\n cycle();\n },\n filter: function (filter) {\n pendingQueue = pendingQueue.filter(filter);\n return buffer;\n },\n };\n },\n };\n return medium;\n}\nexport function createMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n return innerCreateMedium(defaults, middleware);\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function createSidecarMedium(options) {\n if (options === void 0) { options = {}; }\n var medium = innerCreateMedium(null);\n medium.options = __assign({ async: true, ssr: false }, options);\n return medium;\n}\n"],"names":["ItoI","a","innerCreateMedium","defaults","middleware","buffer","assigned","read","Error","length","useMedium","data","item","push","filter","x","assignSyncMedium","cb","cbs","forEach","assignMedium","pendingQueue","executeQueue","cycle","Promise","resolve","then","createMedium","createSidecarMedium","options","medium","__assign","async","ssr"],"mappings":"uDACA,SAASA,EAAKC,GACV,OAAOA,CACX,CACA,SAASC,EAAkBC,EAAUC,QACd,IAAfA,IAAyBA,EAAaJ,GAC1C,IAAIK,EAAS,GACTC,GAAW,EA0Df,MAzDa,CACTC,KAAM,WACF,GAAID,EACA,MAAM,IAAIE,MAAM,oGAEpB,OAAIH,EAAOI,OACAJ,EAAOA,EAAOI,OAAS,GAE3BN,CACV,EACDO,UAAW,SAAUC,GACjB,IAAIC,EAAOR,EAAWO,EAAML,GAE5B,OADAD,EAAOQ,KAAKD,GACL,WACHP,EAASA,EAAOS,QAAO,SAAUC,GAAK,OAAOA,IAAMH,IACtD,CACJ,EACDI,iBAAkB,SAAUC,GAExB,IADAX,GAAW,EACJD,EAAOI,QAAQ,CAClB,IAAIS,EAAMb,EACVA,EAAS,GACTa,EAAIC,QAAQF,EAC5B,CACYZ,EAAS,CACLQ,KAAM,SAAUE,GAAK,OAAOE,EAAGF,EAAK,EACpCD,OAAQ,WAAc,OAAOT,CAAS,EAE7C,EACDe,aAAc,SAAUH,GACpBX,GAAW,EACX,IAAIe,EAAe,GACnB,GAAIhB,EAAOI,OAAQ,CACf,IAAIS,EAAMb,EACVA,EAAS,GACTa,EAAIC,QAAQF,GACZI,EAAehB,CAC/B,CACY,IAAIiB,EAAe,WACf,IAAIJ,EAAMG,EACVA,EAAe,GACfH,EAAIC,QAAQF,EACf,EACGM,EAAQ,WAAc,OAAOC,QAAQC,UAAUC,KAAKJ,EAAgB,EACxEC,IACAlB,EAAS,CACLQ,KAAM,SAAUE,GACZM,EAAaR,KAAKE,GAClBQ,GACH,EACDT,OAAQ,SAAUA,GAEd,OADAO,EAAeA,EAAaP,OAAOA,GAC5BT,CACV,EAER,EAGT,CACO,SAASsB,EAAaxB,EAAUC,GAEnC,YADmB,IAAfA,IAAyBA,EAAaJ,GACnCE,EAAkBC,EAAUC,EACvC,CAEO,SAASwB,EAAoBC,QAChB,IAAZA,IAAsBA,EAAU,CAAA,GACpC,IAAIC,EAAS5B,EAAkB,MAE/B,OADA4B,EAAOD,QAAUE,EAAS,CAAEC,OAAO,EAAMC,KAAK,GAASJ,GAChDC,CACX","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/AddressLookup/index.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n useState,\n useRef,\n type InputHTMLAttributes,\n type Ref,\n type FocusEvent,\n type ChangeEvent,\n type KeyboardEvent,\n type ReactNode,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\nimport { faChevronRight } from \"@fortawesome/free-solid-svg-icons\";\n\nimport { type AddressDataType, type AddressOptionsType } from \"../../types\";\nimport { useKey } from \"../../hooks/useKey\";\n\nimport { debounce } from \"../../utils/debounce\";\nimport { removeCommasFromObjectStringValues } from \"../../utils/Helper\";\nimport { Text } from \"../Text\";\nimport { TextField } from \"../TextField\";\nimport { IconFa } from \"../IconFa\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { ListWrapper, ListItem, ScreenReaderOnly, List } from \"./styles\";\n\nconst FIND_URL =\n \"https://api.addressy.com/Capture/Interactive/Find/v1.1/json3.ws\";\nconst RETRIEVE_URL =\n \"https://api.addressy.com/Capture/Interactive/Retrieve/v1/json3.ws\";\n\nexport type AddressLookupProps = InputHTMLAttributes<HTMLInputElement> & {\n /** api key for loqate */\n apiKey: string;\n /** list of countries codes you want the address look up to search within */\n countries?: string[];\n /** callback function which is passed the selected address data */\n onAddressSelected: (address: AddressDataType) => void;\n /** error message */\n errorMessage?: string;\n /** when true a input has a red border */\n hasError?: boolean;\n /** flag which effects the check or cross icons to the right of the input */\n isValid?: boolean;\n /** flag to hide or show the check icon when valid */\n isValidVisible?: boolean;\n /** flag to hide or show the cross icon when invalid */\n isInvalidVisible?: boolean;\n /** label text */\n label?: string;\n /** hint text text */\n hintText?: ReactNode;\n /** callback function which is passed the error */\n onAddressError?: (error: Error) => void;\n /** onBlur handler */\n onBlur?: (e: FocusEvent) => void;\n /** attach a DOM reference variable to your component */\n ref?: Ref<HTMLInputElement>;\n};\n\n/**\n * This component creates a combobox for a user to type in a post code or partial address and be presented with a of verified addresses.\n * We use Loqate (formerly Addressy and Postcode Anywhere) API v3, we have looked at v4 but it is more expensive without many benefits for our use case.\n * You will need a Loqate api key, the examples below use \"MG17-ZD93-FF33-KF13\" our development key.\n * This component is generally only used for country codes including \"GBR\", \"GGY\", \"IMN\", \"JEY\". An example of this behavior is included bellow.\n */\nexport const AddressLookup = ({\n apiKey,\n countries,\n errorMessage,\n hasError,\n isValid,\n isValidVisible,\n isInvalidVisible,\n label,\n hintText,\n ref,\n onAddressError = (error: Error) => {\n console.log(error);\n },\n onAddressSelected,\n onChange,\n onBlur,\n ...props\n}: AddressLookupProps) => {\n const [addressOptions, setAddressOptions] = useState<AddressOptionsType[]>(\n [],\n );\n const [activeOption, setActiveOption] = useState(-1);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const clearOptions = () => {\n setActiveOption(-1);\n setAddressOptions([]);\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const searchDebounced = useCallback(\n debounce(500, (query: string) => {\n search(query);\n }),\n [],\n );\n\n const search = (query: string, id = \"\") => {\n if (query.length === 0) return setAddressOptions([]);\n let searchUrl = `${FIND_URL}?Key=${apiKey}&Text=${query}&Container=${id}`;\n if (countries !== undefined) {\n searchUrl = `${searchUrl}&Countries=${countries.join(\",\")}`;\n }\n fetch(searchUrl)\n .then((res: Response) => {\n if (!res.ok) throw new Error(\"Something went wrong please try again\");\n return res.json();\n })\n .then((data: { Items: AddressOptionsType[] }) => {\n // Occasionally get the error \"The query didn't respond fast enough, it may be too complex.\"\n // returned with a 200 response. Example query \"n17 6t\"\n if (data.Items[0].Error)\n throw new Error(\"Something went wrong please try again\");\n setAddressOptions(data.Items || []);\n return null;\n })\n .catch((err) => onAddressError(err as Error));\n return null;\n };\n\n const getAddress = (id: string) => {\n fetch(`${RETRIEVE_URL}?Key=${apiKey}&Id=${id}`)\n .then((res: Response) => {\n if (!res.ok) throw new Error(\"Something went wrong please try again\");\n return res.json();\n })\n .then((data: { Items: AddressDataType[] }) => {\n const selectedAddress = data.Items[0];\n const selectedAddressWithoutCommas =\n removeCommasFromObjectStringValues<AddressDataType>(selectedAddress);\n onAddressSelected(selectedAddressWithoutCommas);\n clearOptions();\n return null;\n })\n .catch((err) => onAddressError(err as Error));\n };\n\n const selectAddress = (address: AddressOptionsType) => {\n if (address.Type === \"Address\") return getAddress(address.Id);\n search(address.Text, address.Id);\n return null;\n };\n\n const handleKeyDown = (e: KeyboardEvent): void => {\n if (e.key === \"Enter\" && addressOptions[activeOption]) {\n e.preventDefault();\n if (addressOptions[activeOption].Type === \"Address\")\n getAddress(addressOptions[activeOption].Id);\n search(\n addressOptions[activeOption].Text,\n addressOptions[activeOption].Id,\n );\n setActiveOption(-1);\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (activeOption <= -1) setActiveOption(addressOptions.length - 1);\n setActiveOption(activeOption - 1);\n } else if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (activeOption + 1 >= addressOptions.length) setActiveOption(0);\n setActiveOption(activeOption + 1);\n } else {\n setActiveOption(-1);\n }\n };\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n searchDebounced(e.target.value);\n if (onChange) onChange(e);\n };\n\n const handleBlur = (e: FocusEvent) => {\n const isOptionsOpen = !!addressOptions.length;\n if (onBlur && !isOptionsOpen) onBlur(e);\n };\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n wrapperRef.current &&\n event.target instanceof HTMLElement &&\n !wrapperRef.current.contains(event.target)\n )\n clearOptions();\n };\n\n useEffect(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n });\n\n useKey(\n () => {\n clearOptions();\n },\n {\n detectKeys: [\"Escape\", \"Tab\"],\n },\n [],\n );\n\n return (\n <>\n <TextField\n aria-activedescendant={\n addressOptions.length ? `addressOptions-${activeOption}` : \"\"\n }\n aria-owns=\"found_addresses\"\n aria-autocomplete=\"both\"\n aria-expanded={addressOptions.length ? \"true\" : \"false\"}\n autoComplete=\"off\"\n hasError={hasError || !!errorMessage}\n errorMessage={errorMessage}\n hintText={hintText ?? \"Start typing your address or postcode\"}\n isValid={isValid}\n isValidVisible={isValidVisible}\n isInvalidVisible={isInvalidVisible}\n label={label ?? \"Home address\"}\n ref={ref}\n required\n role=\"combobox\"\n type=\"search\"\n {...props}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n onBlur={handleBlur}\n />\n\n {!!addressOptions.length && (\n <>\n <ScreenReaderOnly role=\"status\" aria-live=\"assertive\">\n {!!addressOptions.length &&\n `We have found ${addressOptions.length} result${\n addressOptions.length !== 1 ? \"s\" : \"\"\n } matching your search. Use up and down arrow keys to navigate`}\n </ScreenReaderOnly>\n <ListWrapper ref={wrapperRef}>\n <List\n aria-label=\"found addresses\"\n id=\"found_addresses\"\n role=\"listbox\"\n theme={theme}\n >\n {addressOptions.map((address, index) => (\n <ListItem\n tabIndex={0}\n id={`addressOptions-${index}`}\n $isActive={index === activeOption}\n key={address.Id}\n onClick={() => {\n selectAddress(address);\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n selectAddress(address);\n }\n }}\n role=\"option\"\n data-hj-suppress\n theme={theme}\n >\n <Text as=\"span\" data-hj-suppress>\n {address.Text} {address.Description}\n </Text>\n {address.Type !== \"Address\" && (\n <>\n <ScreenReaderOnly>\n press enter for these addresses\n </ScreenReaderOnly>\n <IconFa faIcon={faChevronRight} />\n </>\n )}\n </ListItem>\n ))}\n </List>\n </ListWrapper>\n </>\n )}\n </>\n );\n};\n\nexport default AddressLookup;\n"],"names":["AddressLookup","_a","apiKey","countries","errorMessage","hasError","isValid","isValidVisible","isInvalidVisible","label","hintText","ref","_b","onAddressError","undefined","error","console","log","onAddressSelected","onChange","onBlur","props","__rest","_c","useState","addressOptions","setAddressOptions","_d","activeOption","setActiveOption","wrapperRef","useRef","foundTheme","useTheme","theme","__assign","defaultTheme","clearOptions","searchDebounced","useCallback","debounce","query","search","id","length","searchUrl","concat","join","fetch","then","res","ok","Error","json","data","Items","catch","err","getAddress","selectedAddress","selectedAddressWithoutCommas","removeCommasFromObjectStringValues","selectAddress","address","Type","Id","Text","handleClickOutside","event","current","target","HTMLElement","contains","useEffect","document","addEventListener","removeEventListener","useKey","detectKeys","React","createElement","Fragment","TextField","autoComplete","required","role","type","onKeyDown","e","key","preventDefault","value","isOptionsOpen","ScreenReaderOnly","ListWrapper","List","map","index","ListItem","tabIndex","onClick","as","Description","IconFa","faIcon","faChevronRight"],"mappings":"2uBA2BA,IAwCaA,EAAgB,SAACC,GAC5B,IAAAC,EAAMD,EAAAC,OACNC,cACAC,EAAYH,EAAAG,aACZC,EAAQJ,EAAAI,SACRC,EAAOL,EAAAK,QACPC,EAAcN,EAAAM,eACdC,qBACAC,EAAKR,EAAAQ,MACLC,EAAQT,EAAAS,SACRC,EAAGV,EAAAU,IACHC,EAECX,EAAAY,eAFDA,OAAcC,IAAAF,EAAG,SAACG,GAChBC,QAAQC,IAAIF,EACb,EAAAH,EACDM,EAAiBjB,EAAAiB,kBACjBC,EAAQlB,EAAAkB,SACRC,EAAMnB,EAAAmB,OACHC,EAAKC,EAAArB,EAjBoB,kLAmBtBsB,EAAsCC,EAC1C,IADKC,EAAcF,EAAA,GAAEG,EAAiBH,EAAA,GAGlCI,EAAkCH,GAAW,GAA5CI,EAAYD,EAAA,GAAEE,EAAeF,EAAA,GAC9BG,EAAaC,EAAuB,MACpCC,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,EAAe,WACnBR,GAAgB,GAChBH,EAAkB,GACnB,EAGKY,EAAkBC,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,YAAW,eACrC5D,EAAemB,QAChB,iBAAAE,OAAiBrB,EAAemB,yBACJ,IAA1BnB,EAAemB,OAAe,IAAM,qEAG1CmC,EAAAC,cAACc,EAAW,CAACnF,IAAKmB,GAChBiD,EAACC,cAAAe,gBACY,kBACXpD,GAAG,kBACH0C,KAAK,UACLnD,MAAOA,GAENT,EAAeuE,KAAI,SAACjC,EAASkC,GAAU,OACtClB,EAAAC,cAACkB,EAAQ,CACPC,SAAU,EACVxD,GAAI,kBAAAG,OAAkBmD,aACXA,IAAUrE,EACrB6D,IAAK1B,EAAQE,GACbmC,QAAS,WACPtC,EAAcC,EAChB,EACAwB,UAAW,SAACC,GACI,UAAVA,EAAEC,KACJ3B,EAAcC,EAElB,EACAsB,KAAK,SAEL,oBAAA,EAAAnD,MAAOA,GAEP6C,EAAAC,cAACd,EAAI,CAACmC,GAAG,OAAM,oBAAA,GACZtC,EAAQG,SAAOH,EAAQuC,aAER,YAAjBvC,EAAQC,MACPe,EAAAC,cAAAD,EAAAE,SAAA,KACEF,EAAAC,cAACa,EAEkB,KAAA,mCACnBd,EAAAC,cAACuB,EAAO,CAAAC,OAAQC,KA1BgB,OAqCtD"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/AddressLookup/index.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n useState,\n useRef,\n type InputHTMLAttributes,\n type Ref,\n type FocusEvent,\n type ChangeEvent,\n type KeyboardEvent,\n type ReactNode,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\nimport { faChevronRight } from \"@fortawesome/free-solid-svg-icons\";\n\nimport { type AddressDataType, type AddressOptionsType } from \"../../types\";\nimport { useKey } from \"../../hooks/useKey\";\n\nimport { debounce } from \"../../utils/debounce\";\nimport { removeCommasFromObjectStringValues } from \"../../utils/Helper\";\nimport { Text } from \"../Text\";\nimport { TextField } from \"../TextField\";\nimport { IconFa } from \"../IconFa\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { ListWrapper, ListItem, ScreenReaderOnly, List } from \"./styles\";\n\nconst FIND_URL =\n \"https://api.addressy.com/Capture/Interactive/Find/v1.1/json3.ws\";\nconst RETRIEVE_URL =\n \"https://api.addressy.com/Capture/Interactive/Retrieve/v1/json3.ws\";\n\nexport type AddressLookupProps = InputHTMLAttributes<HTMLInputElement> & {\n /** api key for loqate */\n apiKey: string;\n /** list of countries codes you want the address look up to search within */\n countries?: string[];\n /** callback function which is passed the selected address data */\n onAddressSelected: (address: AddressDataType) => void;\n /** error message */\n errorMessage?: string;\n /** when true a input has a red border */\n hasError?: boolean;\n /** flag which effects the check or cross icons to the right of the input */\n isValid?: boolean;\n /** flag to hide or show the check icon when valid */\n isValidVisible?: boolean;\n /** flag to hide or show the cross icon when invalid */\n isInvalidVisible?: boolean;\n /** label text */\n label?: string;\n /** hint text text */\n hintText?: ReactNode;\n /** callback function which is passed the error */\n onAddressError?: (error: Error) => void;\n /** onBlur handler */\n onBlur?: (e: FocusEvent) => void;\n /** attach a DOM reference variable to your component */\n ref?: Ref<HTMLInputElement>;\n};\n\n/**\n * This component creates a combobox for a user to type in a post code or partial address and be presented with a of verified addresses.\n * We use Loqate (formerly Addressy and Postcode Anywhere) API v3, we have looked at v4 but it is more expensive without many benefits for our use case.\n * You will need a Loqate api key, the examples below use \"MG17-ZD93-FF33-KF13\" our development key.\n * This component is generally only used for country codes including \"GBR\", \"GGY\", \"IMN\", \"JEY\". An example of this behavior is included bellow.\n */\nexport const AddressLookup = ({\n apiKey,\n countries,\n errorMessage,\n hasError,\n isValid,\n isValidVisible,\n isInvalidVisible,\n label,\n hintText,\n ref,\n onAddressError = (error: Error) => {\n console.log(error);\n },\n onAddressSelected,\n onChange,\n onBlur,\n ...props\n}: AddressLookupProps) => {\n const [addressOptions, setAddressOptions] = useState<AddressOptionsType[]>(\n [],\n );\n const [activeOption, setActiveOption] = useState(-1);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const clearOptions = () => {\n setActiveOption(-1);\n setAddressOptions([]);\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const searchDebounced = useCallback(\n debounce(500, (query: string) => {\n search(query);\n }),\n [],\n );\n\n const search = (query: string, id = \"\") => {\n if (query.length === 0) return setAddressOptions([]);\n let searchUrl = `${FIND_URL}?Key=${apiKey}&Text=${query}&Container=${id}`;\n if (countries !== undefined) {\n searchUrl = `${searchUrl}&Countries=${countries.join(\",\")}`;\n }\n fetch(searchUrl)\n .then((res: Response) => {\n if (!res.ok) throw new Error(\"Something went wrong please try again\");\n return res.json();\n })\n .then((data: { Items: AddressOptionsType[] }) => {\n // Occasionally get the error \"The query didn't respond fast enough, it may be too complex.\"\n // returned with a 200 response. Example query \"n17 6t\"\n if (data.Items[0].Error)\n throw new Error(\"Something went wrong please try again\");\n setAddressOptions(data.Items || []);\n return null;\n })\n .catch((err) => onAddressError(err as Error));\n return null;\n };\n\n const getAddress = (id: string) => {\n fetch(`${RETRIEVE_URL}?Key=${apiKey}&Id=${id}`)\n .then((res: Response) => {\n if (!res.ok) throw new Error(\"Something went wrong please try again\");\n return res.json();\n })\n .then((data: { Items: AddressDataType[] }) => {\n const selectedAddress = data.Items[0];\n const selectedAddressWithoutCommas =\n removeCommasFromObjectStringValues<AddressDataType>(selectedAddress);\n onAddressSelected(selectedAddressWithoutCommas);\n clearOptions();\n return null;\n })\n .catch((err) => onAddressError(err as Error));\n };\n\n const selectAddress = (address: AddressOptionsType) => {\n if (address.Type === \"Address\") return getAddress(address.Id);\n search(address.Text, address.Id);\n return null;\n };\n\n const handleKeyDown = (e: KeyboardEvent): void => {\n if (e.key === \"Enter\" && addressOptions[activeOption]) {\n e.preventDefault();\n if (addressOptions[activeOption].Type === \"Address\")\n getAddress(addressOptions[activeOption].Id);\n search(\n addressOptions[activeOption].Text,\n addressOptions[activeOption].Id,\n );\n setActiveOption(-1);\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (activeOption <= -1) setActiveOption(addressOptions.length - 1);\n setActiveOption(activeOption - 1);\n } else if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (activeOption + 1 >= addressOptions.length) setActiveOption(0);\n setActiveOption(activeOption + 1);\n } else {\n setActiveOption(-1);\n }\n };\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n searchDebounced(e.target.value);\n if (onChange) onChange(e);\n };\n\n const handleBlur = (e: FocusEvent) => {\n const isOptionsOpen = !!addressOptions.length;\n if (onBlur && !isOptionsOpen) onBlur(e);\n };\n\n const handleClickOutside = (event: MouseEvent) => {\n if (\n wrapperRef.current &&\n event.target instanceof HTMLElement &&\n !wrapperRef.current.contains(event.target)\n )\n clearOptions();\n };\n\n useEffect(() => {\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n });\n\n useKey(\n () => {\n clearOptions();\n },\n {\n detectKeys: [\"Escape\", \"Tab\"],\n },\n [],\n );\n\n return (\n <>\n <TextField\n aria-activedescendant={\n addressOptions.length ? `addressOptions-${activeOption}` : \"\"\n }\n aria-owns=\"found_addresses\"\n aria-autocomplete=\"both\"\n aria-expanded={addressOptions.length ? \"true\" : \"false\"}\n autoComplete=\"off\"\n hasError={hasError || !!errorMessage}\n errorMessage={errorMessage}\n hintText={hintText ?? \"Start typing your address or postcode\"}\n isValid={isValid}\n isValidVisible={isValidVisible}\n isInvalidVisible={isInvalidVisible}\n label={label ?? \"Home address\"}\n ref={ref}\n required\n role=\"combobox\"\n type=\"search\"\n {...props}\n onKeyDown={handleKeyDown}\n onChange={handleChange}\n onBlur={handleBlur}\n />\n\n {!!addressOptions.length && (\n <>\n <ScreenReaderOnly role=\"status\" aria-live=\"assertive\">\n {!!addressOptions.length &&\n `We have found ${addressOptions.length} result${\n addressOptions.length !== 1 ? \"s\" : \"\"\n } matching your search. Use up and down arrow keys to navigate`}\n </ScreenReaderOnly>\n <ListWrapper ref={wrapperRef}>\n <List\n aria-label=\"found addresses\"\n id=\"found_addresses\"\n role=\"listbox\"\n theme={theme}\n >\n {addressOptions.map((address, index) => (\n <ListItem\n tabIndex={0}\n id={`addressOptions-${index}`}\n $isActive={index === activeOption}\n key={address.Id}\n onClick={() => {\n selectAddress(address);\n }}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n selectAddress(address);\n }\n }}\n role=\"option\"\n data-hj-suppress\n theme={theme}\n >\n <Text as=\"span\" data-hj-suppress>\n {address.Text} {address.Description}\n </Text>\n {address.Type !== \"Address\" && (\n <>\n <ScreenReaderOnly>\n press enter for these addresses\n </ScreenReaderOnly>\n <IconFa faIcon={faChevronRight} />\n </>\n )}\n </ListItem>\n ))}\n </List>\n </ListWrapper>\n </>\n )}\n </>\n );\n};\n\nexport default AddressLookup;\n"],"names":["AddressLookup","_a","apiKey","countries","errorMessage","hasError","isValid","isValidVisible","isInvalidVisible","label","hintText","ref","_b","onAddressError","error","console","log","onAddressSelected","onChange","onBlur","props","__rest","_c","useState","addressOptions","setAddressOptions","_d","activeOption","setActiveOption","wrapperRef","useRef","foundTheme","useTheme","theme","__assign","defaultTheme","clearOptions","searchDebounced","useCallback","debounce","query","search","id","length","searchUrl","concat","undefined","join","fetch","then","res","ok","Error","json","data","Items","catch","err","getAddress","selectedAddress","selectedAddressWithoutCommas","removeCommasFromObjectStringValues","selectAddress","address","Type","Id","Text","handleClickOutside","event","current","target","HTMLElement","contains","useEffect","document","addEventListener","removeEventListener","useKey","detectKeys","React","createElement","Fragment","TextField","autoComplete","required","role","type","onKeyDown","e","key","preventDefault","value","isOptionsOpen","ScreenReaderOnly","ListWrapper","List","map","index","ListItem","tabIndex","onClick","as","Description","IconFa","faIcon","faChevronRight"],"mappings":"2uBA2BA,IAwCaA,EAAgB,SAACC,GAC5B,IAAAC,EAAMD,EAAAC,OACNC,cACAC,EAAYH,EAAAG,aACZC,EAAQJ,EAAAI,SACRC,EAAOL,EAAAK,QACPC,EAAcN,EAAAM,eACdC,q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QC,KA1BgB,OAqCtD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Avatar/index.tsx"],"sourcesContent":["import React, { type ImgHTMLAttributes } from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledAvatar } from \"./styles\";\n\nexport type AvatarProps = ImgHTMLAttributes<HTMLElement> & {\n /** name of user/entity */\n name?: string;\n /** image url */\n url?: string;\n /** image size */\n size?: \"s\" | \"m\" | \"l\" | \"xl\";\n};\n\n/**\n *\n * You can use an avatar to display ownership of an item of content. If you pass a URL of an image that will be displayed otherwise the first letter of the name will be used to display a branded avatar.\n */\nexport function Avatar({\n url,\n name,\n size = \"m\",\n alt = \"\",\n ...rest\n}: AvatarProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const avatarUrl = () => {\n if (url) return url;\n const fileName =\n name &&\n typeof name === \"string\" &&\n name !== \"Anonymous\" &&\n /[a-z]/i.exec(name[0].trim())\n ? `icon-avatar-${name[0].trim().toUpperCase()}.png`\n : \"icon-avatar-Anonymous.png\";\n\n return `${theme.avatar.path}${fileName}`;\n };\n\n return (\n <StyledAvatar\n {...rest}\n $size={theme.avatar[size || \"m\"]}\n src={avatarUrl()}\n alt={alt}\n />\n );\n}\n\nexport default Avatar;\n"],"names":["Avatar","_a","url","name","_b","size","undefined","_c","alt","rest","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","React","createElement","StyledAvatar","avatar","src","fileName","exec","trim","concat","toUpperCase","path","avatarUrl"],"mappings":"8OAoBM,SAAUA,EAAOC,GACrB,IAAAC,QACAC,SACAC,EAAAH,EAAAI,KAAAA,OAAOC,IAAAF,EAAA,MACPG,EAAAN,EAAAO,IAAAA,OAAMF,IAAAC,EAAA,KACHE,EALkBC,EAAAT,EAAA,CAAA,MAAA,OAAA,OAAA,QAOfU,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAgBL,OACEK,EAACC,cAAAC,EACKJ,EAAA,GAAAL,SACGI,EAAMM,OAAOd,GAAQ,KAC5Be,IAjBc,WAChB,GAAIlB,EAAK,OAAOA,EAChB,IAAMmB,EACJlB,GACgB,iBAATA,GACE,cAATA,GACA,SAASmB,KAAKnB,EAAK,GAAGoB,QAClB,eAAAC,OAAerB,EAAK,GAAGoB,OAAOE,cAAmB,QACjD,4BAEN,MAAO,GAAAD,OAAGX,EAAMM,OAAOO,MAAIF,OAAGH,EAC/B,CAMQM,GACLnB,IAAKA,IAGX"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Avatar/index.tsx"],"sourcesContent":["import React, { type ImgHTMLAttributes } from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledAvatar } from \"./styles\";\n\nexport type AvatarProps = ImgHTMLAttributes<HTMLElement> & {\n /** name of user/entity */\n name?: string;\n /** image url */\n url?: string;\n /** image size */\n size?: \"s\" | \"m\" | \"l\" | \"xl\";\n};\n\n/**\n *\n * You can use an avatar to display ownership of an item of content. If you pass a URL of an image that will be displayed otherwise the first letter of the name will be used to display a branded avatar.\n */\nexport function Avatar({\n url,\n name,\n size = \"m\",\n alt = \"\",\n ...rest\n}: AvatarProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const avatarUrl = () => {\n if (url) return url;\n const fileName =\n name &&\n typeof name === \"string\" &&\n name !== \"Anonymous\" &&\n /[a-z]/i.exec(name[0].trim())\n ? `icon-avatar-${name[0].trim().toUpperCase()}.png`\n : \"icon-avatar-Anonymous.png\";\n\n return `${theme.avatar.path}${fileName}`;\n };\n\n return (\n <StyledAvatar\n {...rest}\n $size={theme.avatar[size || \"m\"]}\n src={avatarUrl()}\n alt={alt}\n />\n );\n}\n\nexport default Avatar;\n"],"names":["Avatar","_a","url","name","_b","size","_c","alt","rest","__rest","foundTheme","useTheme","theme","__assign","defaultTheme","React","createElement","StyledAvatar","avatar","src","fileName","exec","trim","concat","toUpperCase","path","avatarUrl"],"mappings":"8OAoBM,SAAUA,EAAOC,GACrB,IAAAC,QACAC,SACAC,EAAAH,EAAAI,KAAAA,OAAO,IAAAD,EAAA,MACPE,EAAAL,EAAAM,IAAAA,OAAM,IAAAD,EAAA,KACHE,EALkBC,EAAAR,EAAA,CAAA,MAAA,OAAA,OAAA,QAOfS,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAgBL,OACEK,EAACC,cAAAC,EACKJ,EAAA,GAAAL,SACGI,EAAMM,OAAOb,GAAQ,KAC5Bc,IAjBc,WAChB,GAAIjB,EAAK,OAAOA,EAChB,IAAMkB,EACJjB,GACgB,iBAATA,GACE,cAATA,GACA,SAASkB,KAAKlB,EAAK,GAAGmB,QAClB,eAAAC,OAAepB,EAAK,GAAGmB,OAAOE,cAAmB,QACjD,4BAEN,MAAO,GAAAD,OAAGX,EAAMM,OAAOO,MAAIF,OAAGH,EAC/B,CAMQM,GACLnB,IAAKA,IAGX"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/Badge/index.tsx"],"sourcesContent":["import React, { type ReactNode } from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { type SpaceType } from \"../../types\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledBadge } from \"./styles\";\nimport { themeColorOrString } from \"../../utils/themeUtils\";\n\nexport type BadgeProps = {\n /** background colour of badge */\n backgroundColor?: string;\n /** border colour of badge */\n borderColor?: string;\n /** text colour of badge */\n textColor?: string;\n /** size of badge */\n size?: SpaceType;\n /** contents of badge */\n children?: ReactNode;\n /** forces shape to have equal width and height set by size attribute */\n isSquare?: boolean;\n};\n\n/**\n * Displays a numeric or icon indicator. You can use the icon prop to\nindicate the importance of the badge to the user.\n\nNote that depending on how they are used, badges may be confusing for users\nof screen readers and similar assistive technologies. While the styling of\nbadges provides a visual cue as to their purpose, these users will simply\nbe presented with the content of the badge. Depending on the specific\nsituation, these badges may seem like random additional words or numbers\nat the end of a sentence, link, or button. Unless the context is clear,\nconsider including additional context with a visually hidden piece of\nadditional text.\n */\nexport function Badge({\n children,\n size = \"xs\",\n backgroundColor = \"primary\",\n borderColor = \"transparent\",\n textColor = \"textOnPrimary\",\n isSquare,\n}: BadgeProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const isSquareCalculated = isSquare ?? !(typeof children === \"string\");\n\n return (\n <StyledBadge\n theme={theme}\n $isSquare={isSquareCalculated}\n $size={size}\n $backgroundColor={themeColorOrString(backgroundColor, theme)}\n $borderColor={themeColorOrString(borderColor, theme)}\n $textColor={themeColorOrString(textColor, theme)}\n >\n {children}\n </StyledBadge>\n );\n}\n\nexport default Badge;\n"],"names":["Badge","_a","children","_b","size","undefined","_c","backgroundColor","_d","borderColor","_e","textColor","isSquare","foundTheme","useTheme","theme","__assign","defaultTheme","isSquareCalculated","React","createElement","StyledBadge","$isSquare","$size","$backgroundColor","themeColorOrString","$borderColor"],"mappings":"gSAqCM,SAAUA,EAAMC,GACpB,IAAAC,EAAQD,EAAAC,SACRC,EAAWF,EAAAG,KAAXA,OAAIC,IAAAF,EAAG,KAAIA,EACXG,EAAAL,EAAAM,gBAAAA,aAAkB,UAASD,EAC3BE,EAAAP,EAAAQ,YAAAA,OAAcJ,IAAAG,EAAA,gBACdE,EAAAT,EAAAU,UAAAA,OAAYN,IAAAK,EAAA,gBAAeA,EAC3BE,EAAQX,EAAAW,SAEFC,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,EAAqBN,QAAAA,IAAkC,iBAAbV,GAEhD,OACEiB,EAACC,cAAAC,EACC,CAAAN,MAAOA,EAAKO,UACDJ,EAAkBK,MACtBnB,EACWoB,iBAAAC,EAAmBlB,EAAiBQ,GACxCW,aAAAD,EAAmBhB,EAAaM,cAClCU,EAAmBd,EAAWI,IAEzCb,EAGP"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/Badge/index.tsx"],"sourcesContent":["import React, { type ReactNode } from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { type SpaceType } from \"../../types\";\nimport { crukTheme as defaultTheme } from \"../../themes/cruk\";\n\nimport { StyledBadge } from \"./styles\";\nimport { themeColorOrString } from \"../../utils/themeUtils\";\n\nexport type BadgeProps = {\n /** background colour of badge */\n backgroundColor?: string;\n /** border colour of badge */\n borderColor?: string;\n /** text colour of badge */\n textColor?: string;\n /** size of badge */\n size?: SpaceType;\n /** contents of badge */\n children?: ReactNode;\n /** forces shape to have equal width and height set by size attribute */\n isSquare?: boolean;\n};\n\n/**\n * Displays a numeric or icon indicator. You can use the icon prop to\nindicate the importance of the badge to the user.\n\nNote that depending on how they are used, badges may be confusing for users\nof screen readers and similar assistive technologies. While the styling of\nbadges provides a visual cue as to their purpose, these users will simply\nbe presented with the content of the badge. Depending on the specific\nsituation, these badges may seem like random additional words or numbers\nat the end of a sentence, link, or button. Unless the context is clear,\nconsider including additional context with a visually hidden piece of\nadditional text.\n */\nexport function Badge({\n children,\n size = \"xs\",\n backgroundColor = \"primary\",\n borderColor = \"transparent\",\n textColor = \"textOnPrimary\",\n isSquare,\n}: BadgeProps) {\n const foundTheme = useTheme();\n const theme = {\n ...defaultTheme,\n ...foundTheme,\n };\n\n const isSquareCalculated = isSquare ?? !(typeof children === \"string\");\n\n return (\n <StyledBadge\n theme={theme}\n $isSquare={isSquareCalculated}\n $size={size}\n $backgroundColor={themeColorOrString(backgroundColor, theme)}\n $borderColor={themeColorOrString(borderColor, theme)}\n $textColor={themeColorOrString(textColor, theme)}\n >\n {children}\n </StyledBadge>\n );\n}\n\nexport default Badge;\n"],"names":["Badge","_a","children","_b","size","_c","backgroundColor","_d","borderColor","_e","textColor","isSquare","foundTheme","useTheme","theme","__assign","defaultTheme","isSquareCalculated","React","createElement","StyledBadge","$isSquare","$size","$backgroundColor","themeColorOrString","$borderColor"],"mappings":"gSAqCM,SAAUA,EAAMC,GACpB,IAAAC,EAAQD,EAAAC,SACRC,EAAWF,EAAAG,KAAXA,OAAI,IAAAD,EAAG,KAAIA,EACXE,EAAAJ,EAAAK,gBAAAA,aAAkB,UAASD,EAC3BE,EAAAN,EAAAO,YAAAA,OAAc,IAAAD,EAAA,gBACdE,EAAAR,EAAAS,UAAAA,OAAY,IAAAD,EAAA,gBAAeA,EAC3BE,EAAQV,EAAAU,SAEFC,EAAaC,IACbC,EACDC,EAAAA,EAAA,CAAA,EAAAC,GACAJ,GAGCK,EAAqBN,QAAAA,IAAkC,iBAAbT,GAEhD,OACEgB,EAACC,cAAAC,EACC,CAAAN,MAAOA,EAAKO,UACDJ,EAAkBK,MACtBlB,EACWmB,iBAAAC,EAAmBlB,EAAiBQ,GACxCW,aAAAD,EAAmBhB,EAAaM,cAClCU,EAAmBd,EAAWI,IAEzCZ,EAGP"}