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AAUF","sources":["webpack://StravaModern/./node_modules/@reach/portal/dist/portal.esm.js","webpack://StravaModern/./node_modules/@reach/utils/dist/utils.esm.js","webpack://StravaModern/./node_modules/warning/warning.js"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { useIsomorphicLayoutEffect } from '@reach/utils';\nimport { createPortal } from 'react-dom';\n\n/**\r\n * Welcome to @reach/portal!\r\n *\r\n * Creates and appends a DOM node to the end of `document.body` and renders a\r\n * React tree into it. Useful for rendering a natural React element hierarchy\r\n * with a different DOM hierarchy to prevent parent styles from clipping or\r\n * hiding content (for popovers, dropdowns, and modals).\r\n *\r\n * @see Docs https://reacttraining.com/reach-ui/portal\r\n * @see Source https://github.com/reach/reach-ui/tree/main/packages/portal\r\n * @see React https://reactjs.org/docs/portals.html\r\n */\n/**\r\n * Portal\r\n *\r\n * @see Docs https://reacttraining.com/reach-ui/portal#portal\r\n */\n\nvar Portal = function Portal(_ref) {\n var children = _ref.children,\n _ref$type = _ref.type,\n type = _ref$type === void 0 ? \"reach-portal\" : _ref$type;\n var mountNode = useRef(null);\n var portalNode = useRef(null);\n\n var _useState = useState(),\n forceUpdate = _useState[1];\n\n useIsomorphicLayoutEffect(function () {\n // This ref may be null when a hot-loader replaces components on the page\n if (!mountNode.current) return; // It's possible that the content of the portal has, itself, been portaled.\n // In that case, it's important to append to the correct document element.\n\n var ownerDocument = mountNode.current.ownerDocument;\n portalNode.current = ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.createElement(type);\n ownerDocument.body.appendChild(portalNode.current);\n forceUpdate({});\n return function () {\n if (portalNode.current && portalNode.current.ownerDocument) {\n portalNode.current.ownerDocument.body.removeChild(portalNode.current);\n }\n };\n }, [type]);\n return portalNode.current ? createPortal(children, portalNode.current) : React.createElement(\"span\", {\n ref: mountNode\n });\n};\n\nif (process.env.NODE_ENV !== \"production\") {\n Portal.displayName = \"Portal\";\n}\n\nexport default Portal;\n//# sourceMappingURL=portal.esm.js.map\n","import React, { isValidElement, cloneElement, createContext, useRef, useState, useCallback, useEffect, useMemo } from 'react';\nexport { default as warning } from 'warning';\n\n/* eslint-disable no-restricted-globals, eqeqeq */\n/**\r\n * React currently throws a warning when using useLayoutEffect on the server.\r\n * To get around it, we can conditionally useEffect on the server (no-op) and\r\n * useLayoutEffect in the browser. We occasionally need useLayoutEffect to\r\n * ensure we don't get a render flash for certain operations, but we may also\r\n * need affected components to render on the server. One example is when setting\r\n * a component's descendants to retrieve their index values.\r\n *\r\n * Important to note that using this hook as an escape hatch will break the\r\n * eslint dependency warnings unless you rename the import to `useLayoutEffect`.\r\n * Use sparingly only when the effect won't effect the rendered HTML to avoid\r\n * any server/client mismatch.\r\n *\r\n * If a useLayoutEffect is needed and the result would create a mismatch, it's\r\n * likely that the component in question shouldn't be rendered on the server at\r\n * all, so a better approach would be to lazily render those in a parent\r\n * component after client-side hydration.\r\n *\r\n * TODO: We are calling useLayoutEffect in a couple of places that will likely\r\n * cause some issues for SSR users, whether the warning shows or not. Audit and\r\n * fix these.\r\n *\r\n * https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\r\n * https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.js\r\n *\r\n * @param effect\r\n * @param deps\r\n */\n\nvar useIsomorphicLayoutEffect = /*#__PURE__*/canUseDOM() ? React.useLayoutEffect : React.useEffect;\nvar checkedPkgs = {};\n/**\r\n * When in dev mode, checks that styles for a given @reach package are loaded.\r\n *\r\n * @param packageName Name of the package to check.\r\n * @example checkStyles(\"dialog\") will check for styles for @reach/dialog\r\n */\n// @ts-ignore\n\nvar checkStyles = noop;\n\nif (process.env.NODE_ENV !== \"production\") {\n // In CJS files, process.env.NODE_ENV is stripped from our build, but we need\n // it to prevent style checks from clogging up user logs while testing.\n // This is a workaround until we can tweak the build a bit to accommodate.\n var _ref = typeof process !== \"undefined\" ? process : {\n env: {\n NODE_ENV: \"development\"\n }\n },\n env = _ref.env;\n\n checkStyles = function checkStyles(packageName) {\n // only check once per package\n if (checkedPkgs[packageName]) return;\n checkedPkgs[packageName] = true;\n\n if (env.NODE_ENV !== \"test\" && parseInt(window.getComputedStyle(document.body).getPropertyValue(\"--reach-\" + packageName), 10) !== 1) {\n console.warn(\"@reach/\" + packageName + \" styles not found. If you are using a bundler like webpack or parcel include this in the entry file of your app before any of your own styles:\\n\\n import \\\"@reach/\" + packageName + \"/styles.css\\\";\\n\\n Otherwise you'll need to include them some other way:\\n\\n \\n\\n For more information visit https://ui.reach.tech/styling.\\n \");\n }\n };\n}\n/**\r\n * Ponyfill for the global object in some environments.\r\n *\r\n * @link https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\r\n */\n\nvar ponyfillGlobal = typeof window != \"undefined\" && window.Math == Math ? window : typeof self != \"undefined\" && self.Math == Math ? self :\n/*#__PURE__*/\n// eslint-disable-next-line no-new-func\nFunction(\"return this\")();\n/**\r\n * Passes or assigns an arbitrary value to a ref function or object.\r\n *\r\n * @param ref\r\n * @param value\r\n */\n\nfunction assignRef(ref, value) {\n if (ref == null) return;\n\n if (isFunction(ref)) {\n ref(value);\n } else {\n try {\n ref.current = value;\n } catch (error) {\n throw new Error(\"Cannot assign value \\\"\" + value + \"\\\" to ref \\\"\" + ref + \"\\\"\");\n }\n }\n}\n/**\r\n * Checks true|\"true\" vs false|\"false\"\r\n *\r\n * @param value\r\n */\n\nfunction boolOrBoolString(value) {\n return value === \"true\" ? true : isBoolean(value) ? value : false;\n}\nfunction canUseDOM() {\n return !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\n}\n/**\r\n * Type-safe clone element\r\n *\r\n * @param element\r\n * @param props\r\n * @param children\r\n */\n\nfunction cloneValidElement(element, props) {\n for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n children[_key - 2] = arguments[_key];\n }\n\n return isValidElement(element) ? cloneElement.apply(void 0, [element, props].concat(children)) : element;\n}\nfunction createNamedContext(name, defaultValue) {\n var Ctx = createContext(defaultValue);\n Ctx.displayName = name;\n return Ctx;\n}\n/**\r\n * This is a hack for sure. The thing is, getting a component to intelligently\r\n * infer props based on a component or JSX string passed into an `as` prop is\r\n * kind of a huge pain. Getting it to work and satisfy the constraints of\r\n * `forwardRef` seems dang near impossible. To avoid needing to do this awkward\r\n * type song-and-dance every time we want to forward a ref into a component\r\n * that accepts an `as` prop, we abstract all of that mess to this function for\r\n * the time time being.\r\n */\n\nfunction forwardRefWithAs(render) {\n return React.forwardRef(render);\n}\nfunction memoWithAs(Component, propsAreEqual) {\n return React.memo(Component, propsAreEqual);\n}\n/**\r\n * Get the size of the working document minus the scrollbar offset.\r\n *\r\n * @param element\r\n */\n\nfunction getDocumentDimensions(element) {\n if (!canUseDOM()) return {\n width: 0,\n height: 0\n };\n var doc = element ? getOwnerDocument(element) : document;\n var win = element ? getOwnerWindow(element) : window;\n return {\n width: doc.documentElement.clientWidth || win.innerWidth,\n height: doc.documentElement.clientHeight || win.innerHeight\n };\n}\n/**\r\n * Get the scoll position of the global window object relative to a given node.\r\n *\r\n * @param element\r\n */\n\nfunction getScrollPosition(element) {\n if (!canUseDOM()) return {\n scrollX: 0,\n scrollY: 0\n };\n var win = element ? getOwnerWindow(element) : window;\n return {\n scrollX: win.scrollX,\n scrollY: win.scrollY\n };\n}\n/**\r\n * Get a computed style value by property, backwards compatible with IE\r\n * @param element\r\n * @param styleProp\r\n */\n\nfunction getElementComputedStyle(element, styleProp) {\n var y = null;\n var doc = getOwnerDocument(element);\n\n if (element.currentStyle) {\n y = element.currentStyle[styleProp];\n } else if (doc && doc.defaultView && isFunction(doc.defaultView.getComputedStyle)) {\n y = doc.defaultView.getComputedStyle(element, null).getPropertyValue(styleProp);\n }\n\n return y;\n}\n/**\r\n * Get an element's owner document. Useful when components are used in iframes\r\n * or other environments like dev tools.\r\n *\r\n * @param element\r\n */\n\nfunction getOwnerDocument(element) {\n return element && element.ownerDocument ? element.ownerDocument : canUseDOM() ? document : null;\n}\nfunction getOwnerWindow(element) {\n var doc = element ? getOwnerDocument(element) : null;\n return doc ? doc.defaultView || window : null;\n}\n/**\r\n * Get the scrollbar offset distance.\r\n *\r\n * TODO: Remove in 1.0 (we used this in public examples)\r\n */\n\nfunction getScrollbarOffset() {\n try {\n if (window.innerWidth > document.documentElement.clientWidth) {\n return window.innerWidth - document.documentElement.clientWidth;\n }\n } catch (err) {}\n\n return 0;\n}\n/**\r\n * Checks whether or not a value is a boolean.\r\n *\r\n * @param value\r\n */\n\nfunction isBoolean(value) {\n return typeof value === \"boolean\";\n}\n/**\r\n * Checks whether or not a value is a function.\r\n *\r\n * @param value\r\n */\n\nfunction isFunction(value) {\n return !!(value && {}.toString.call(value) == \"[object Function]\");\n}\n/**\r\n * Checks whether or not a value is a number.\r\n *\r\n * @param value\r\n */\n\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\n/**\r\n * Detects right clicks\r\n *\r\n * @param nativeEvent\r\n */\n\nfunction isRightClick(nativeEvent) {\n return nativeEvent.which === 3 || nativeEvent.button === 2;\n}\n/**\r\n * Checks whether or not a value is a string.\r\n *\r\n * @param value\r\n */\n\nfunction isString(value) {\n return typeof value === \"string\";\n}\n/**\r\n * Joins strings to format IDs for compound components.\r\n *\r\n * @param args\r\n */\n\nfunction makeId() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return args.filter(function (val) {\n return val != null;\n }).join(\"--\");\n}\n/**\r\n * No-op function.\r\n */\n\nfunction noop() {}\n/**\r\n * Convert our state strings for HTML data attributes.\r\n * No need for a fancy kebab-caser here, we know what our state strings are!\r\n *\r\n * @param state\r\n */\n\nfunction stateToAttributeString(state) {\n return String(state).replace(/([\\s_]+)/g, \"-\").toLowerCase();\n}\n/**\r\n * Check if a component is controlled or uncontrolled and return the correct\r\n * state value and setter accordingly. If the component state is controlled by\r\n * the app, the setter is a noop.\r\n *\r\n * @param controlledValue\r\n * @param defaultValue\r\n */\n\nfunction useControlledState(controlledValue, defaultValue) {\n var controlledRef = useRef(controlledValue != null);\n\n var _useState = useState(defaultValue),\n valueState = _useState[0],\n setValue = _useState[1];\n\n var set = useCallback(function (n) {\n if (!controlledRef.current) {\n setValue(n);\n }\n }, []);\n return [controlledRef.current ? controlledValue : valueState, set];\n}\n/**\r\n * Logs a warning in dev mode when a component switches from controlled to\r\n * uncontrolled, or vice versa\r\n *\r\n * A single prop should typically be used to determine whether or not a\r\n * component is controlled or not.\r\n *\r\n * @param controlledValue\r\n * @param controlledPropName\r\n * @param componentName\r\n */\n\nvar useControlledSwitchWarning = noop;\n\nif (process.env.NODE_ENV !== \"production\") {\n useControlledSwitchWarning = function useControlledSwitchWarning(controlledValue, controlledPropName, componentName) {\n var controlledRef = useRef(controlledValue != null);\n var nameCache = useRef({\n componentName: componentName,\n controlledPropName: controlledPropName\n });\n useEffect(function () {\n nameCache.current = {\n componentName: componentName,\n controlledPropName: controlledPropName\n };\n }, [componentName, controlledPropName]);\n useEffect(function () {\n var wasControlled = controlledRef.current;\n var _nameCache$current = nameCache.current,\n componentName = _nameCache$current.componentName,\n controlledPropName = _nameCache$current.controlledPropName;\n var isControlled = controlledValue != null;\n\n if (wasControlled !== isControlled) {\n console.error(\"A component is changing an \" + (wasControlled ? \"\" : \"un\") + \"controlled `\" + controlledPropName + \"` state of \" + componentName + \" to be \" + (wasControlled ? \"un\" : \"\") + \"controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled \" + componentName + \" element for the lifetime of the component.\\nMore info: https://fb.me/react-controlled-components\");\n }\n }, [controlledValue]);\n };\n}\nvar useCheckStyles = noop;\n\nif (process.env.NODE_ENV !== \"production\") {\n useCheckStyles = function useCheckStyles(pkg) {\n var name = useRef(pkg);\n useEffect(function () {\n return void (name.current = pkg);\n }, [pkg]);\n useEffect(function () {\n return checkStyles(name.current);\n }, []);\n };\n}\n/**\r\n * React hook for creating a value exactly once.\r\n * @see https://github.com/Andarist/use-constant\r\n */\n\nfunction useConstant(fn) {\n var ref = React.useRef();\n\n if (!ref.current) {\n ref.current = {\n v: fn()\n };\n }\n\n return ref.current.v;\n}\n/**\r\n * @param callback\r\n */\n\nfunction useEventCallback(callback) {\n var ref = useRef(callback);\n useIsomorphicLayoutEffect(function () {\n ref.current = callback;\n });\n return useCallback(function (event) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n\n return ref.current.apply(ref, [event].concat(args));\n }, []);\n}\n/**\r\n * @param callback\r\n */\n\nfunction useCallbackProp(callback) {\n var ref = useRef(callback);\n useEffect(function () {\n ref.current = callback;\n });\n return useCallback(function () {\n return ref.current && ref.current.apply(ref, arguments);\n }, []);\n}\n/**\r\n * Adds a DOM event listener\r\n *\r\n * @param eventName\r\n * @param listener\r\n * @param element\r\n */\n\nfunction useEventListener(eventName, listener, element) {\n if (element === void 0) {\n element = window;\n }\n\n var savedHandler = useRef(listener);\n useEffect(function () {\n savedHandler.current = listener;\n }, [listener]);\n useEffect(function () {\n var isSupported = element && element.addEventListener;\n\n if (!isSupported) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\"Event listener not supported on the element provided\");\n }\n\n return;\n }\n\n function eventListener(event) {\n savedHandler.current(event);\n }\n\n element.addEventListener(eventName, eventListener);\n return function () {\n element.removeEventListener(eventName, eventListener);\n };\n }, [eventName, element]);\n}\n/**\r\n * Detect when focus changes in our document.\r\n *\r\n * @param handleChange\r\n * @param when\r\n * @param ownerDocument\r\n */\n\nfunction useFocusChange(handleChange, when, ownerDocument) {\n if (handleChange === void 0) {\n handleChange = console.log;\n }\n\n if (when === void 0) {\n when = \"focus\";\n }\n\n if (ownerDocument === void 0) {\n ownerDocument = document;\n }\n\n var lastActiveElement = useRef(ownerDocument.activeElement);\n useEffect(function () {\n lastActiveElement.current = ownerDocument.activeElement;\n\n function onChange(event) {\n if (lastActiveElement.current !== ownerDocument.activeElement) {\n handleChange(ownerDocument.activeElement, lastActiveElement.current, event);\n lastActiveElement.current = ownerDocument.activeElement;\n }\n }\n\n ownerDocument.addEventListener(when, onChange, true);\n return function () {\n ownerDocument.removeEventListener(when, onChange);\n };\n }, [when, handleChange, ownerDocument]);\n}\n/**\r\n * Passes or assigns a value to multiple refs (typically a DOM node). Useful for\r\n * dealing with components that need an explicit ref for DOM calculations but\r\n * also forwards refs assigned by an app.\r\n *\r\n * @param refs Refs to fork\r\n */\n\nfunction useForkedRef() {\n for (var _len4 = arguments.length, refs = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n refs[_key4] = arguments[_key4];\n }\n\n return useMemo(function () {\n if (refs.every(function (ref) {\n return ref == null;\n })) {\n return null;\n }\n\n return function (node) {\n refs.forEach(function (ref) {\n assignRef(ref, node);\n });\n }; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [].concat(refs));\n}\n/**\r\n * Returns the previous value of a reference after a component update.\r\n *\r\n * @param value\r\n */\n\nfunction usePrevious(value) {\n var ref = useRef(null);\n useEffect(function () {\n ref.current = value;\n }, [value]);\n return ref.current;\n}\n/**\r\n * Call an effect after a component update, skipping the initial mount.\r\n *\r\n * @param effect Effect to call\r\n * @param deps Effect dependency list\r\n */\n\nfunction useUpdateEffect(effect, deps) {\n var mounted = useRef(false);\n useEffect(function () {\n if (mounted.current) {\n effect();\n } else {\n mounted.current = true;\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, deps);\n}\n/**\r\n * Just a lil state logger\r\n *\r\n * @param state\r\n * @param DEBUG\r\n */\n\nvar useStateLogger = noop;\n\nif (process.env.NODE_ENV !== \"production\") {\n useStateLogger = function useStateLogger(state, DEBUG) {\n if (DEBUG === void 0) {\n DEBUG = false;\n }\n\n var debugRef = useRef(DEBUG);\n useEffect(function () {\n debugRef.current = DEBUG;\n }, [DEBUG]);\n useEffect(function () {\n if (debugRef.current) {\n console.group(\"State Updated\");\n console.log(\"%c\" + state, \"font-weight: normal; font-size: 120%; font-style: italic;\");\n console.groupEnd();\n }\n }, [state]);\n };\n}\n/**\r\n * Wraps a lib-defined event handler and a user-defined event handler, returning\r\n * a single handler that allows a user to prevent lib-defined handlers from\r\n * firing.\r\n *\r\n * @param theirHandler User-supplied event handler\r\n * @param ourHandler Library-supplied event handler\r\n */\n\nfunction wrapEvent(theirHandler, ourHandler) {\n return function (event) {\n theirHandler && theirHandler(event);\n\n if (!event.defaultPrevented) {\n return ourHandler(event);\n }\n };\n}\n\nexport { assignRef, boolOrBoolString, canUseDOM, checkStyles, cloneValidElement, createNamedContext, forwardRefWithAs, getDocumentDimensions, getElementComputedStyle, getOwnerDocument, getOwnerWindow, getScrollPosition, getScrollbarOffset, isBoolean, isFunction, isNumber, isRightClick, isString, makeId, memoWithAs, noop, ponyfillGlobal, stateToAttributeString, useCallbackProp, useCheckStyles, useConstant, useControlledState, useControlledSwitchWarning, useEventCallback, useEventListener, useFocusChange, useForkedRef, useIsomorphicLayoutEffect, usePrevious, useStateLogger, useUpdateEffect, wrapEvent };\n//# sourceMappingURL=utils.esm.js.map\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n"],"names":["_ref","children","_ref$type","type","mountNode","useRef","portalNode","forceUpdate","useState","current","ownerDocument","createElement","body","appendChild","removeChild","createPortal","ref","useIsomorphicLayoutEffect","canUseDOM","checkStyles","noop","window","Math","self","assignRef","value","isFunction","error","Error","boolOrBoolString","isBoolean","document","cloneValidElement","element","props","_len","arguments","length","Array","_key","isValidElement","cloneElement","concat","createNamedContext","name","defaultValue","Ctx","createContext","displayName","forwardRefWithAs","render","memoWithAs","Component","propsAreEqual","getElementComputedStyle","styleProp","y","doc","getOwnerDocument","currentStyle","defaultView","getComputedStyle","getPropertyValue","toString","call","makeId","_len2","args","_key2","filter","val","join","useControlledState","controlledValue","controlledRef","_useState","valueState","setValue","set","useCallback","n","useControlledSwitchWarning","useEventCallback","callback","event","_len3","_key3","apply","useForkedRef","_len4","refs","_key4","useMemo","every","node","forEach","usePrevious","useEffect","useUpdateEffect","effect","deps","mounted","wrapEvent","theirHandler","ourHandler","defaultPrevented","warning","module","exports"],"sourceRoot":""}