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,KAKjB,CAAEiL,IAFLA,GAFS,QAAUM,IACd,QAAMA,GAGIC,IADT,SAAUC,GAAQ,OAAOR,EAAMM,EAAON,IAAIQ,OALtC,IAAUzL,EACpBuL,EAGAN,GAsBGS,EAAS,WAEhB,OADUJ,IAAc,GAAGL,KAiBpBU,EAAa,WAEpB,OADUL,IAAc,GAAGE","sources":["webpack:///./node_modules/@atlaskit/analytics-next/dist/es2019/hooks/usePlatformLeafEventHandler.js","webpack:///./node_modules/@atlaskit/analytics-next/dist/es2019/hooks/useTrackedRef.js","webpack:///./node_modules/@atlaskit/ds-lib/dist/es2019/utils/noop.js","webpack:///./node_modules/@atlaskit/motion/dist/es2019/utils/use-force-render.js","webpack:///./node_modules/@atlaskit/motion/dist/es2019/entering/exiting-persistence.js","webpack:///./node_modules/@atlaskit/motion/dist/es2019/utils/timer-hooks.js","webpack:///./node_modules/@atlaskit/motion/dist/es2019/entering/staggered-entrance.js","webpack:///./node_modules/@atlaskit/motion/dist/es2019/entering/keyframes-motion.js","webpack:///./node_modules/@atlaskit/motion/dist/es2019/utils/use-unique-id.js","webpack:///./node_modules/@atlaskit/motion/dist/es2019/entering/fade-in.js","webpack:///./node_modules/@atlaskit/motion/dist/es2019/utils/accessibility.js","webpack:///./node_modules/@atlaskit/motion/dist/es2019/utils/curves.js","webpack:///./node_modules/@atlaskit/motion/dist/es2019/utils/durations.js","webpack:///./node_modules/@atlaskit/portal/dist/es2019/internal/constants.js","webpack:///./node_modules/@atlaskit/portal/dist/es2019/internal/utils/portal-dom-utils.js","webpack:///./node_modules/@atlaskit/portal/dist/es2019/internal/components/internal-portal.js","webpack:///./node_modules/@atlaskit/portal/dist/es2019/internal/hooks/use-is-subsequent-render.js","webpack:///./node_modules/@atlaskit/portal/dist/es2019/internal/utils/portal-custom-event.js","webpack:///./node_modules/@atlaskit/portal/dist/es2019/portal.js","webpack:///./node_modules/@atlaskit/portal/dist/es2019/internal/hooks/use-portal-event.js","webpack:///./node_modules/@atlaskit/portal/dist/es2019/constants.js","webpack:///./node_modules/react-uid/dist/es2015/context.js","webpack:///./node_modules/react-uid/dist/es2015/hooks.js"],"sourcesContent":["import { useCallback } from 'react';\nimport { useAnalyticsEvents } from './useAnalyticsEvents';\nimport { useTrackedRef } from './useTrackedRef';\n// WARNING: This hook will only function correctly for leaf node components - as in\n// no children inside the component will require analytics themselves.\n// Ignoring this warning will mean the analytics context of child components will not\n// include the context of this component, .e.g, lost data.\n// If you are going to have child components that require analytics use withAnalytics\n// or AnalyticsContext component instead.\nexport function usePlatformLeafEventHandler({\n fn,\n action,\n componentName,\n actionSubject,\n packageName,\n packageVersion,\n analyticsData\n}) {\n const {\n createAnalyticsEvent\n } = useAnalyticsEvents(); // We put analyticsData and fn in a ref so that we don't need to break\n // memoization.\n // Generally these could be defined by consumers inline\n // and so we do this to avoid breaking memoization of useCallback\n\n const dataRef = useTrackedRef(analyticsData);\n const fnRef = useTrackedRef(fn);\n const handler = useCallback(value => {\n const analyticsEvent = createAnalyticsEvent({\n action,\n actionSubject: actionSubject || componentName,\n attributes: {\n componentName,\n packageName,\n packageVersion\n }\n }); // To avoid wrapping this component in AnalyticsContext we manually\n // push the parent context's meta data into the context.\n // Note: this new 'context'\n\n const context = {\n componentName,\n packageName,\n packageVersion,\n ...dataRef.current\n };\n analyticsEvent.context.push(context); // fire an event on the atlaskit channel\n\n const clone = analyticsEvent.clone();\n\n if (clone) {\n clone.fire('atlaskit');\n }\n\n fnRef.current(value, analyticsEvent);\n }, [// These are strings and won't change\n action, componentName, actionSubject, packageName, packageVersion, // This function is memoized in the context\n createAnalyticsEvent, // these are a stable ref because of the useTrackedRef hook\n dataRef, fnRef]);\n return handler;\n}","import { useEffect, useRef } from 'react';\nexport const useTrackedRef = value => {\n const ref = useRef(value);\n useEffect(() => {\n ref.current = value;\n }, [value]);\n return ref;\n};","/**\n * An empty function which does nothing.\n */\nexport default function noop() {}","import { useCallback, useState } from 'react';\nexport const useForceRender = () => {\n const [, updateState] = useState({});\n const forceRender = useCallback(() => updateState({}), []);\n return forceRender;\n};","import React, { Children, createContext, memo, useContext, useMemo, useRef } from 'react';\nimport { isReducedMotion } from '../utils/accessibility';\nimport { useForceRender } from '../utils/use-force-render';\n/**\n * Internally we will be playing with an element that will always have a key defined.\n */\n\n// We define empty context here so the object doesn't change.\nconst emptyContext = {\n // Motions will always appear if not inside a exiting persistence component.\n appear: true,\n isExiting: false\n};\nconst ExitingContext = /*#__PURE__*/createContext(emptyContext);\n\nconst isAnyPreviousKeysMissingFromCurrent = (currentMap, previous) => {\n for (let i = 0; i < previous.length; i++) {\n const element = previous[i];\n const key = element.key;\n\n if (!currentMap[key]) {\n return true;\n }\n }\n\n return false;\n};\n/**\n * This method will wrap any React element with a context provider. We're using context (instead of\n * cloneElement) so we can communicate between multiple elements without the need of prop drilling\n * (results in a better API for consumers).\n */\n\n\nconst wrapChildWithContextProvider = (child, value = emptyContext) => {\n return /*#__PURE__*/React.createElement(ExitingContext.Provider, {\n key: `${child.key}-provider`,\n value: value\n }, child);\n};\n\nconst childrenToObj = children => {\n return children.reduce((acc, child) => {\n acc[child.key] = child;\n return acc;\n }, {});\n};\n\nconst spliceNewElementsIntoPrevious = (current, previous) => {\n const splicedChildren = previous.concat([]);\n const previousMap = childrenToObj(previous);\n\n for (let i = 0; i < current.length; i++) {\n const child = current[i];\n const childIsNew = !previousMap[child.key];\n\n if (childIsNew) {\n // This will insert the new element after the previous element.\n splicedChildren.splice(i + 1, 0, child);\n }\n }\n\n return splicedChildren;\n};\n/**\n * This function will convert all children types to an array while also filtering out non-valid React elements.\n */\n\n\nconst childrenToArray = children => {\n const childrenAsArray = []; // We convert children to an array using this helper method as it will add keys to children that do not\n // have them, such as when we have hardcoded children that are conditionally rendered.\n\n Children.toArray(children).forEach(child => {\n // We ignore any boolean children to make our code a little more simple later on,\n // and also filter out any falsies (empty strings, nulls, and undefined).\n if (typeof child !== 'boolean' && Boolean(child)) {\n // Children WILL have a key after being forced into an array using the React.Children helper.\n childrenAsArray.push(child);\n }\n });\n return childrenAsArray;\n};\n/**\n * This handles the case when a render updates during an exit motion.\n * If any child is mounted again we removed them from the exiting children object and return true.\n */\n\n\nconst hasAnyExitingChildMountedAgain = (exitingChildren, children) => {\n let exitingChildMountedAgain = false;\n children.forEach(child => {\n if (exitingChildren.current[child.key]) {\n exitingChildMountedAgain = true;\n delete exitingChildren.current[child.key];\n }\n });\n return exitingChildMountedAgain;\n};\n\nconst ExitingPersistence = /*#__PURE__*/memo(({\n appear: appearFromProp = false,\n children: childs,\n exitThenEnter\n}) => {\n const children = childrenToArray(childs);\n const childrenObj = childrenToObj(children);\n const previousChildren = useRef([]);\n const persistedChildren = useRef([]);\n const forceRender = useForceRender();\n const exitingChildren = useRef({});\n const appear = useRef(appearFromProp);\n const defaultContextValue = useMemo(() => ({\n appear: appear.current,\n isExiting: false\n }), // React rules of hooks says this isn't needed because mutating appear won't cause a re-render.\n // While technically true - it will trigger this to make a new object on the _next_ render which is what we want.\n // Remove this or use appear instead of appear.current and you will notice a test breaks.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [appear.current]);\n\n if (isReducedMotion()) {\n return children;\n }\n\n if (!appear.current) {\n // We always want child motions to appear after the initial mount.\n appear.current = true;\n } // This entire block can't be an effect because we need it to run synchronously during a render\n // else when elements are being removed they will be remounted instead of being updated.\n\n\n if (previousChildren.current.length && isAnyPreviousKeysMissingFromCurrent(childrenObj, previousChildren.current)) {\n if (persistedChildren.current.length === 0 || hasAnyExitingChildMountedAgain(exitingChildren, children)) {\n persistedChildren.current = previousChildren.current;\n } // We have persisted children now set from previous children.\n // Let's update previous children so we have it available next render.\n\n\n previousChildren.current = children;\n return (exitThenEnter ? persistedChildren.current : spliceNewElementsIntoPrevious(children, persistedChildren.current)).map(child => {\n const currentChild = childrenObj[child.key];\n\n if (!currentChild) {\n // We've found an exiting child - mark it!\n exitingChildren.current[child.key] = true;\n return wrapChildWithContextProvider(child, {\n isExiting: true,\n appear: true,\n onFinish: () => {\n delete exitingChildren.current[child.key]; // We will only remove the exiting elements when any subsequent exiting elements have also finished.\n // Think of removing many items from a todo list - when removing a few over a few clicks we don't\n // want the list jumping around when they exit.\n\n if (Object.keys(exitingChildren.current).length === 0) {\n // Set previous children to nothing.\n // This let's us skip the next render check as it's assumed children and previous will be the same.\n previousChildren.current = [];\n persistedChildren.current = []; // Re-render after the element(s) have animated away which will end up rendering the latest children.\n\n forceRender();\n }\n }\n });\n } // This element isn't exiting.\n // Wrap context and let's continue on our way.\n\n\n return wrapChildWithContextProvider(currentChild, defaultContextValue);\n });\n } else {\n previousChildren.current = children;\n }\n\n return children.map(child => wrapChildWithContextProvider(child, defaultContextValue));\n});\nexport const useExitingPersistence = () => {\n return useContext(ExitingContext);\n};\nExitingPersistence.displayName = 'ExitingPersistence';\nexport default ExitingPersistence;","import { useCallback, useEffect, useRef } from 'react';\n\nconst getHookDeps = opts => {\n switch (opts.cleanup) {\n case 'next-effect':\n return undefined;\n\n case 'unmount':\n default:\n return [];\n }\n};\n/**\n * Will return request animation frame as a function which will clean itself up.\n */\n\n\nexport const useRequestAnimationFrame = (opts = {\n cleanup: 'unmount'\n}) => {\n const frames = useRef([]);\n useEffect(() => {\n return () => {\n if (frames.current.length) {\n frames.current.forEach(id => cancelAnimationFrame(id));\n frames.current = [];\n }\n }; // We dynamically set this so we either clean up on the next effect - or on unmount.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, getHookDeps(opts));\n return useCallback(handler => {\n const id = requestAnimationFrame(time => {\n frames.current = frames.current.filter(frameId => frameId !== id);\n handler(time);\n });\n frames.current.push(id);\n }, []);\n};\n/**\n * Will return set timeout as a function which will clean itself up.\n */\n\nexport const useSetTimeout = (opts = {\n cleanup: 'unmount'\n}) => {\n const timeouts = useRef([]);\n useEffect(() => {\n return () => {\n if (timeouts.current.length) {\n timeouts.current.forEach(id => clearTimeout(id));\n timeouts.current = [];\n }\n }; // We dynamically set this so we either clean up on the next effect - or on unmount.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, getHookDeps(opts));\n return useCallback((handler, timeout, ...args) => {\n const id = setTimeout(() => {\n timeouts.current = timeouts.current.filter(timeoutId => timeoutId !== id);\n handler();\n }, timeout, ...args);\n timeouts.current.push(id);\n }, []);\n};","import React, { createContext, useContext, useRef, useState } from 'react';\nimport { useLayoutEffect } from '../utils/use-layout-effect';\nimport { useUniqueId } from '../utils/use-unique-id';\nconst StaggeredEntranceContext = /*#__PURE__*/createContext(() => ({\n isReady: true,\n delay: 0,\n ref: () => {}\n}));\nexport const useStaggeredEntrance = () => {\n const indentifier = useUniqueId();\n const context = useContext(StaggeredEntranceContext);\n return context(indentifier);\n};\n/**\n * For a list of elements that need to animate in,\n * this should be used in conjunction with entering components.\n * This does not need Javascript to execute so it will run immediately for any SSR rendered React apps before the JS has executed.\n *\n * Will dynamically add delay to each child entering component.\n * Unfortunately all entering components _NEED_ to be a direct descendant.\n */\n\nconst StaggeredEntrance = ({\n children,\n column,\n columns = 'responsive',\n delayStep = 50\n}) => {\n const elementRefs = useRef([]);\n const indexes = [];\n const [actualColumns, setActualColumns] = useState(() => {\n if (typeof columns === 'number') {\n // A hardcoded columns is set so bail out and set it to that!\n return columns;\n }\n\n if (typeof column === 'number') {\n // A hardcoded column is set so we will set actualColumns to be 1.\n return 1;\n } // We are in \"responsive\" mode.\n // So we will be calculating when the Javascript executes on the client how many columns there will be.\n\n\n return 0;\n });\n useLayoutEffect(() => {\n // We want to only run this code when we are in \"responsive\" mode.\n // It is assumed we are in responsive mode if `columns` is \"responsive\",\n // we have children element refs ready to be read (i.e. if there are no children this won't run as well)\n // and finally that `actualColumns` is `0` - this is because for the first render cycle `actualColumns` will be `0` (set above)\n // and then after this layout effect runs the value for `actualColumns` will then be calculated and set.\n if (columns === 'responsive' && elementRefs.current.length && actualColumns === 0) {\n let currentTop = 0;\n let numberColumns = 0;\n\n if (elementRefs.current.length <= 1) {\n setActualColumns(1);\n return;\n } // We set the current top to the first elements.\n // We will be comparing this and incrementing the column count\n // until we hit an element that has a different offset top (or we run out of elements).\n\n\n currentTop = elementRefs.current[0] ? elementRefs.current[0].offsetTop : 0;\n\n for (let i = 0; i < elementRefs.current.length; i++) {\n const child = elementRefs.current[i];\n\n if (!child) {\n break;\n }\n\n if (currentTop === child.offsetTop) {\n numberColumns += 1;\n\n if (elementRefs.current.length - 1 === i) {\n setActualColumns(numberColumns);\n }\n\n continue;\n }\n\n setActualColumns(numberColumns);\n break;\n }\n } // We only want this effect to run once - on initial mount.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, []);\n return /*#__PURE__*/React.createElement(StaggeredEntranceContext.Provider, {\n value: id => {\n if (!indexes.includes(id)) {\n indexes.push(id);\n }\n\n const isReady = actualColumns > 0;\n const index = indexes.indexOf(id);\n const currentColumn = column || index % actualColumns;\n const currentRow = Math.floor(index / actualColumns);\n const distanceFromTopLeftElement = currentRow + currentColumn; // We don't want loads of elements to have the same staggered delay as it ends up looking slow for users.\n // To get around that we calculate the logarithm using `distanceFromTopLeftElement` which ends making\n // elements appear faster the further away from the top left element.\n\n const delay = Math.ceil(Math.log(distanceFromTopLeftElement + 1) * delayStep * 1.5) || 0;\n return {\n delay,\n isReady,\n ref: element => elementRefs.current[index] = element\n };\n }\n }, children);\n};\n\nexport default StaggeredEntrance;","import React, { useEffect, useState } from 'react';\nimport { ClassNames, keyframes } from '@emotion/core';\nimport { prefersReducedMotion } from '../utils/accessibility';\nimport { largeDurationMs } from '../utils/durations';\nimport { useSetTimeout } from '../utils/timer-hooks';\nimport { useExitingPersistence } from './exiting-persistence';\nimport { useStaggeredEntrance } from './staggered-entrance';\n\n/**\n * Used to multiply the initial duration for exiting motions.\n */\nconst EXITING_MOTION_MULTIPLIER = 0.5;\n/**\n * This is the base INTERNAL component used for all other entering motions.\n * This does not need Javascript to execute on the client so it will run immediately\n * for any SSR rendered React apps before the JS has executed.\n */\n\nconst EnteringMotion = ({\n children,\n animationTimingFunction,\n enteringAnimation,\n exitingAnimation,\n isPaused,\n onFinish: onFinishMotion,\n duration = largeDurationMs\n}) => {\n const staggered = useStaggeredEntrance();\n const {\n isExiting,\n onFinish: onExitFinished,\n appear\n } = useExitingPersistence();\n const setTimeout = useSetTimeout();\n const paused = isPaused || !staggered.isReady;\n const delay = isExiting ? 0 : staggered.delay;\n const state = isExiting ? 'exiting' : 'entering';\n const [hasAnimationStyles, setHasAnimationStyles] = useState(appear);\n useEffect(() => {\n // Tracking this to prevent changing state on an unmounted component\n let isCancelled = false;\n\n if (paused) {\n return;\n } // On initial mount if elements aren't set to animate on appear, we return early and callback\n\n\n if (!appear) {\n onFinishMotion && onFinishMotion(state);\n return;\n } // Elements may need animation styles back after initial mount (they could animate out)\n\n\n setHasAnimationStyles(true);\n setTimeout(() => {\n if (state === 'exiting') {\n onExitFinished && onExitFinished();\n }\n\n if (!isCancelled) {\n setHasAnimationStyles(false);\n }\n\n onFinishMotion && onFinishMotion(state);\n }, isExiting ? duration * EXITING_MOTION_MULTIPLIER : duration + delay);\n return () => {\n isCancelled = true;\n }; // We ignore this for onFinishMotion as consumers could potentially inline the function\n // which would then trigger this effect every re-render.\n // We want to make it easier for consumers so we go down this path unfortunately.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [onExitFinished, state, isExiting, duration, delay, paused, setTimeout]);\n return /*#__PURE__*/React.createElement(ClassNames, null, ({\n css\n }) => children({\n ref: staggered.ref,\n className: hasAnimationStyles ? css({\n animationName: `${keyframes(isExiting ? exitingAnimation || enteringAnimation : enteringAnimation)}`,\n animationTimingFunction: animationTimingFunction(state),\n animationDelay: `${delay}ms`,\n animationFillMode: isExiting ? 'forwards' : 'backwards',\n animationDuration: `${isExiting ? duration * EXITING_MOTION_MULTIPLIER : duration}ms`,\n animationPlayState: paused ? 'paused' : 'running',\n ...prefersReducedMotion()\n }) : ''\n }, state));\n};\n\nexport default EnteringMotion;","import { useRef } from 'react';\n/**\n * Will return a unique id that does not change between renders.\n * Try not use this to render DOM markup (attributes or otherwise)\n * as you will probably not get the same result on the Server vs. Client.\n */\n\nexport function useUniqueId() {\n const identifier = useRef('');\n\n if (!identifier.current) {\n identifier.current = '_' + (Number(String(Math.random()).slice(2)) + Date.now() + Math.round(performance.now())).toString(36);\n }\n\n return identifier.current;\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport { easeInOut } from '../utils/curves';\nimport { largeDurationMs } from '../utils/durations';\nimport KeyframesMotion from './keyframes-motion';\nconst entranceMotions = {\n bottom: 'translate3d(0, calc(5% + 4px), 0)',\n left: 'translate3d(calc(-5% - 4px), 0, 0)',\n right: 'translate3d(calc(5% + 4px), 0, 0)',\n top: 'translate3d(0, calc(-5% - 4px), 0)'\n};\nconst exitMotions = {\n bottom: 'translate3d(0, calc(-5% - 4px), 0)',\n left: 'translate3d(calc(5% + 4px), 0, 0)',\n right: 'translate3d(calc(-5% - 4px), 0, 0)',\n top: 'translate3d(0, calc(5% + 4px), 0)'\n};\nexport const fadeInAnimation = movement => {\n return {\n from: {\n opacity: 0,\n ...(movement !== undefined && {\n transform: entranceMotions[movement]\n })\n },\n '50%': {\n opacity: 1\n },\n to: {\n transform: movement !== undefined ? 'none' : undefined\n }\n };\n};\nexport const fadeOutAnimation = movement => ({\n from: {\n opacity: 1,\n transform: movement !== undefined ? 'translate3d(0, 0, 0)' : undefined\n },\n to: {\n opacity: 0,\n ...(movement !== undefined && {\n transform: exitMotions[movement]\n })\n }\n});\n/**\n * Props for controlling the behaviour of the FadeIn animation\n */\n\nconst FadeIn = ({\n children,\n duration = largeDurationMs,\n entranceDirection: entranceSlideDirection,\n ...props\n}) => {\n return /*#__PURE__*/React.createElement(KeyframesMotion, _extends({\n duration: duration,\n enteringAnimation: fadeInAnimation(entranceSlideDirection),\n exitingAnimation: fadeOutAnimation(entranceSlideDirection),\n animationTimingFunction: () => easeInOut\n }, props), children);\n};\n\nexport default FadeIn;","import { useEffect, useState } from 'react';\nimport { bind } from 'bind-event-listener';\n\nconst isMatchMediaAvailable = () => typeof window !== 'undefined' && 'matchMedia' in window;\n/**\n * Use for any programatic motions needed at runtime.\n * Will return `true` if the current user prefers reduced motion.\n * This is generally set through OS preferences/settings.\n */\n\n\nexport const isReducedMotion = () => {\n if (!isMatchMediaAvailable()) {\n return false;\n }\n\n const {\n matches\n } = window.matchMedia('(prefers-reduced-motion: reduce)');\n return matches;\n};\n/**\n * A React hook version of {@link isReducedMotion}.\n * Useful for React components that need to re-render if the user's motion\n * preference changes at runtime.\n */\n\nexport const useIsReducedMotion = () => {\n const [prefersReducedMotion, setPrefersReducedMotion] = useState(isReducedMotion);\n useEffect(() => {\n if (!isMatchMediaAvailable()) {\n return;\n }\n\n const mediaQueryList = window.matchMedia('(prefers-reduced-motion: reduce)');\n\n const onChange = event => setPrefersReducedMotion(event.matches);\n\n return bind(mediaQueryList, {\n type: 'change',\n listener: onChange\n });\n }, []);\n return prefersReducedMotion;\n};\n/**\n * Use for any CSS based motion (animation or transition).\n * Always put at the end of your declaration for correct use of the cascade.\n * Reduced motion preference is generally set through OS preferences/settings.\n */\n\nexport const prefersReducedMotion = () => ({\n '@media (prefers-reduced-motion: reduce)': {\n animation: 'none',\n transition: 'none'\n }\n});","export const easeInOut = 'cubic-bezier(0.15,1,0.3,1)';\nexport const easeOut = 'cubic-bezier(0.2,0,0,1)';\nexport const easeIn = 'cubic-bezier(0.8,0,0,0.8)';","/**\n * Think of this as the motion equivalent of the @atlaskit/theme `grid()`.\n */\nexport const durationStep = 25;\nexport const smallDurationMs = durationStep * 4;\nexport const mediumDurationMs = durationStep * 14;\nexport const largeDurationMs = durationStep * 28;","export const portalParentClassName = 'atlaskit-portal-container';\nexport const portalParentSelector = 'body > .atlaskit-portal-container';\nexport const portalClassName = 'atlaskit-portal';","import { portalClassName, portalParentClassName, portalParentSelector } from '../constants';\n/**\n * Creates a new portal container element with provided z-index and class name 'atlaskit-portal',\n * it is not be attached to any DOM node at this stage.\n * @param {number | string} zIndex - the z-index value of the newly created portal container element\n * @return {number} - The newly created container element\n */\n\nexport const createContainer = zIndex => {\n const container = document.createElement('div');\n container.className = portalClassName;\n container.style.zIndex = `${zIndex}`;\n return container;\n};\n/**\n * Returns document body element\n * @return {number} - The document body element\n */\n\nconst getBody = () => {\n return document.body;\n};\n/**\n * Returns portal parent container. If no container exists already then it creates a new container with class name 'atlaskit-portal-container'\n * @return {Element} - The portal parent container div element\n */\n\n\nconst getPortalParent = () => {\n const parentElement = document.querySelector(portalParentSelector);\n\n if (!parentElement) {\n const parent = document.createElement('div');\n parent.className = portalParentClassName; // we are setting display to flex because we want each portal to create a new stacking context\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context\n\n parent.style.display = 'flex';\n getBody().appendChild(parent);\n return parent;\n }\n\n return parentElement;\n};\n/**\n * Removes portal container from portal parent container\n * @param {HTMLDivElement | undefined} container - portal container to be removed from portal parent container\n */\n\n\nexport const removePortalContainer = container => {\n getPortalParent().removeChild(container);\n};\n/**\n * Appends portal container to portal parent container if it hasn't already been done\n * @param {HTMLDivElement | undefined} container - portal container to be added to portal parent container\n */\n\nexport const appendPortalContainerIfNotAppended = container => {\n if (!container.parentElement) {\n getPortalParent().appendChild(container);\n }\n};","import { useEffect, useMemo } from 'react';\nimport { createPortal } from 'react-dom';\nimport { appendPortalContainerIfNotAppended, createContainer, removePortalContainer } from '../utils/portal-dom-utils';\nexport default function InternalPortal(props) {\n const {\n zIndex,\n children\n } = props;\n const container = useMemo(() => createContainer(zIndex), [zIndex]); // This is in the render method instead of useEffect so that\n // the portal will be added to the DOM before the children render.\n // For any further changes, ensure that the container does not have a\n // parent besides the portal parent.\n\n appendPortalContainerIfNotAppended(container);\n useEffect(() => {\n return () => {\n removePortalContainer(container);\n };\n }, [container]);\n return /*#__PURE__*/createPortal(children, container);\n}","import { useEffect, useState } from 'react';\n\nconst useIsSubsequentRender = () => {\n const [isSubsequentRender, setIsSubsequentRender] = useState(false);\n useEffect(() => {\n setIsSubsequentRender(true);\n }, []);\n return isSubsequentRender;\n};\n\nexport default useIsSubsequentRender;","const zIndexToName = {\n 100: 'card',\n 200: 'navigation',\n 300: 'dialog',\n 400: 'layer',\n 500: 'blanket',\n 510: 'modal',\n 600: 'flag',\n 700: 'spotlight',\n 800: 'tooltip'\n};\n/**\n * return layer name in Atlassian design system corresponding to given z-index\n * @param {number} zIndex - z-index value for which layer name is needed\n * @returns {LayerName | null} - The layer name for given z-index. If layer name is not found then null is returned\n */\n\nconst getLayerName = zIndex => {\n return zIndexToName.hasOwnProperty(zIndex) ? zIndexToName[zIndex] : null;\n};\n/**\n * Creates a PortalEvent object with given eventName, given zIndex and corresponding layer\n * @param {string} eventName - either of Mount or Unmount event name\n * @param {number} zIndex - z-index value which will be included in the event to be dispatched\n * @returns {PortalEvent} - The newly created PortalEvent object\n */\n\n\nconst getEvent = (eventName, zIndex) => {\n const detail = {\n layer: getLayerName(Number(zIndex)),\n zIndex\n };\n return new CustomEvent(eventName, {\n detail\n });\n};\n/**\n * Dispatches a custom event on window with given eventName, given zIndex and corresponding layer\n * @param {string} eventName - either of Mount or Unmount event name\n * @param {number} zIndex - z-index value which will be included in the event to be dispatched\n */\n\n\nexport default function firePortalEvent(eventName, zIndex) {\n const event = getEvent(eventName, zIndex);\n window.dispatchEvent(event);\n}","import React from 'react';\nimport InternalPortal from './internal/components/internal-portal';\nimport useIsSubsequentRender from './internal/hooks/use-is-subsequent-render';\nimport useFirePortalEvent from './internal/hooks/use-portal-event';\nexport default function Portal(props) {\n const {\n zIndex = 0,\n children\n } = props;\n const isSubsequentRender = useIsSubsequentRender();\n useFirePortalEvent(zIndex);\n return isSubsequentRender ? /*#__PURE__*/React.createElement(InternalPortal, {\n zIndex: zIndex\n }, children) : null;\n}","import { useEffect } from 'react';\nimport { PORTAL_MOUNT_EVENT, PORTAL_UNMOUNT_EVENT } from '../../constants';\nimport firePortalEvent from '../utils/portal-custom-event';\n\nconst useFirePortalEvent = zIndex => {\n const zIndexNumber = Number(zIndex);\n useEffect(() => {\n firePortalEvent(PORTAL_MOUNT_EVENT, zIndexNumber);\n return () => {\n firePortalEvent(PORTAL_UNMOUNT_EVENT, zIndexNumber);\n };\n }, [zIndexNumber]);\n};\n\nexport default useFirePortalEvent;","export const PORTAL_MOUNT_EVENT = 'akPortalMount';\nexport const PORTAL_UNMOUNT_EVENT = 'akPortalUnmount';","import * as React from 'react';\nimport { generateUID } from \"./uid\";\nexport var createSource = function (prefix) {\n if (prefix === void 0) { prefix = ''; }\n return ({\n value: 1,\n prefix: prefix,\n uid: generateUID()\n });\n};\nexport var counter = createSource();\nexport var source = React.createContext(createSource());\nexport var getId = function (source) { return source.value++; };\nexport var getPrefix = function (source) { return source ? source.prefix : ''; };\n","import * as React from \"react\";\nimport { counter, getId, getPrefix, source } from \"./context\";\nvar generateUID = function (context) {\n var quartz = context || counter;\n var prefix = getPrefix(quartz);\n var id = getId(quartz);\n var uid = prefix + id;\n var gen = function (item) { return uid + quartz.uid(item); };\n return { uid: uid, gen: gen };\n};\nvar useUIDState = function () {\n if (process.env.NODE_ENV !== \"production\") {\n if (!('useContext' in React)) {\n throw new Error('Hooks API requires React 16.8+');\n }\n }\n // @ts-ignore\n return React.useState(generateUID(React.useContext(source)));\n};\n/**\n * returns and unique id. SSR friendly\n * returns {String}\n * @see {@link UIDConsumer}\n * @see https://github.com/thearnica/react-uid#hooks-168\n * @example\n * const id = useUID();\n * id == 1; // for example\n */\nexport var useUID = function () {\n var uid = useUIDState()[0].uid;\n return uid;\n};\n/**\n * returns an uid generator\n * @see {@link UIDConsumer}\n * @see https://github.com/thearnica/react-uid#hooks-168\n * @example\n * const uid = useUIDSeed();\n * return (\n * <>\n * \n * \n * {data.map(item =>
...
\n * \n * )\n */\nexport var useUIDSeed = function () {\n var gen = useUIDState()[0].gen;\n return gen;\n};\n"],"names":["usePlatformLeafEventHandler","fn","action","componentName","actionSubject","packageName","packageVersion","analyticsData","createAnalyticsEvent","dataRef","fnRef","useCallback","value","analyticsEvent","attributes","context","current","push","clone","fire","useTrackedRef","ref","useRef","useEffect","noop","emptyContext","appear","isExiting","ExitingContext","createContext","wrapChildWithContextProvider","child","Provider","key","childrenToObj","children","reduce","acc","ExitingPersistence","memo","appearFromProp","childs","exitThenEnter","childrenAsArray","Children","forEach","Boolean","childrenToArray","childrenObj","previousChildren","persistedChildren","forceRender","updateState","useState","useForceRender","exitingChildren","defaultContextValue","useMemo","length","currentMap","previous","i","isAnyPreviousKeysMissingFromCurrent","exitingChildMountedAgain","hasAnyExitingChildMountedAgain","splicedChildren","concat","previousMap","splice","spliceNewElementsIntoPrevious","map","currentChild","onFinish","Object","keys","useExitingPersistence","useContext","displayName","useSetTimeout","opts","cleanup","timeouts","id","clearTimeout","getHookDeps","handler","timeout","args","setTimeout","filter","timeoutId","StaggeredEntranceContext","isReady","delay","animationTimingFunction","enteringAnimation","exitingAnimation","isPaused","onFinishMotion","duration","staggered","indentifier","identifier","Number","String","Math","random","slice","Date","now","round","performance","toString","useUniqueId","useStaggeredEntrance","onExitFinished","paused","state","hasAnimationStyles","setHasAnimationStyles","isCancelled","ClassNames","css","className","animationName","keyframes","animationDelay","animationFillMode","animationDuration","animationPlayState","entranceMotions","bottom","left","right","top","exitMotions","fadeOutAnimation","movement","from","opacity","transform","undefined","to","entranceDirection","entranceSlideDirection","props","isReducedMotion","window","matches","matchMedia","prefersReducedMotion","animation","transition","easeInOut","mediumDurationMs","durationStep","largeDurationMs","getPortalParent","parentElement","document","querySelector","parent","createElement","style","display","body","appendChild","InternalPortal","zIndex","container","createContainer","appendPortalContainerIfNotAppended","removeChild","removePortalContainer","createPortal","zIndexToName","getLayerName","hasOwnProperty","firePortalEvent","eventName","event","detail","layer","CustomEvent","getEvent","dispatchEvent","Portal","isSubsequentRender","setIsSubsequentRender","zIndexNumber","createSource","prefix","uid","counter","source","getId","getPrefix","useUIDState","quartz","gen","item","useUID","useUIDSeed"],"sourceRoot":""}