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,EAAOuP,WAAW,KAAOvP,EAAOtC,UAAU,GAAKsC,CACxD,CAcO,SAASyuB,EAAuBzuB,GACrC,GAAKA,UAAAA,EAAQuP,WAAW,KAAM,OAAOxO,EAAAA,EAAAA,MAErC,MAAMwtC,EAAgBvtC,EAAYhB,GAElC,OAAIk5B,EAAAA,EAAAA,SAAwBqV,EAAc3yC,eAAuBmF,EAAAA,EAAAA,OACpC,IAAzBwtC,EAAc73C,OAAqBqK,EAAAA,EAAAA,MAEhCA,EAAAA,EAAAA,OACT,CAKA,IAAIytC,EACG7qC,eAAe62B,IACpB,QAAqC,IAA1BjiC,OAAOK,eAAgC,CAChD,MAAM6hC,QAAiB,+BAGvB,OAFA+T,EAAyB/T,EAASiH,QAClCnpC,OAAOK,eAAiB41C,EACjBA,CACT,CACF,CAEO7qC,eAAe8qC,IACpB,OAAQvsC,UAAUwsC,aAAgBxsC,UAAUwsC,MAAMC,YAAe,CACnE,C","sources":["webpack://@finviz/website/./js/app/header/market-badge.tsx","webpack://@finviz/website/./js/app/header/time.tsx","webpack://@finviz/website/./js/app/header/utils.ts","webpack://@finviz/website/./js/app/queryString.ts","webpack://@finviz/website/./js/app/shared/cookie.ts","webpack://@finviz/website/./js/app/shared/hover-chart.ts","webpack://@finviz/website/./js/app/shared/isMobile.ts","webpack://@finviz/website/./js/app/shared/ticker-sanitizer.ts","webpack://@finviz/website/./js/app/shared/utils.ts","webpack://@finviz/website/./js/main/components/box.tsx","webpack://@finviz/website/./js/main/components/button-group/button-group.tsx","webpack://@finviz/website/./js/main/components/button.tsx","webpack://@finviz/website/./js/main/components/checkbox.tsx","webpack://@finviz/website/./js/main/components/color-picker/draggable.tsx","webpack://@finviz/website/./js/main/components/color-picker/pointer.tsx","webpack://@finviz/website/./js/main/components/color-picker/util.ts","webpack://@finviz/website/./js/main/components/color-picker/alpha.tsx","webpack://@finviz/website/./js/main/components/color-picker/color-palette.tsx","webpack://@finviz/website/./js/main/components/color-picker/hue-saturation.tsx","webpack://@finviz/website/./js/main/components/color-picker/lightness.tsx","webpack://@finviz/website/./js/main/components/color-picker/color-preview.tsx","webpack://@finviz/website/./js/main/components/color-picker/picker-input.tsx","webpack://@finviz/website/./js/main/components/color-picker/picker.tsx","webpack://@finviz/website/./js/main/components/color-picker/picker-button.tsx","webpack://@finviz/website/./js/main/components/constants.ts","webpack://@finviz/website/./js/main/components/copy-to-clipboard/copy-to-clipboard.tsx","webpack://@finviz/website/./js/main/components/date-picker/index.tsx","webpack://@finviz/website/./js/main/components/delayed.tsx","webpack://@finviz/website/./js/main/components/dialog/hooks.ts","webpack://@finviz/website/./js/main/components/dialog/dialog-box.tsx","webpack://@finviz/website/./js/main/components/dialog/dialog-overlay.tsx","webpack://@finviz/website/./js/main/components/dialog/utils.ts","webpack://@finviz/website/./js/main/components/dialog/dialog.tsx","webpack://@finviz/website/./js/main/components/dialog/dialog-body.tsx","webpack://@finviz/website/./js/main/components/dialog/confirmation-dialog.tsx","webpack://@finviz/website/./js/main/components/dialog/dialog-trigger.tsx","webpack://@finviz/website/./js/main/components/dialog/dialog-footer.tsx","webpack://@finviz/website/./js/main/components/dialog/dialog-header.tsx","webpack://@finviz/website/./js/main/components/dropdown/hooks.ts","webpack://@finviz/website/./js/main/components/dropdown/dropdown.tsx","webpack://@finviz/website/./js/main/components/dropdown/dropdown-bar.tsx","webpack://@finviz/website/./js/main/components/dropdown/dropdown-item.tsx","webpack://@finviz/website/./js/main/components/dropdown/dropdown-separator.tsx","webpack://@finviz/website/./js/main/components/dropdown/more-button.tsx","webpack://@finviz/website/./js/main/components/icon/icon.tsx","webpack://@finviz/website/./js/main/components/icon/index.tsx","webpack://@finviz/website/./js/main/components/icon/add.tsx","webpack://@finviz/website/./js/main/components/icon/calendar.tsx","webpack://@finviz/website/./js/main/components/icon/candle-bar-basic.tsx","webpack://@finviz/website/./js/main/components/icon/candle-bar-heikin-ashi.tsx","webpack://@finviz/website/./js/main/components/icon/candle-bar-hollow.tsx","webpack://@finviz/website/./js/main/components/icon/caret-down.tsx","webpack://@finviz/website/./js/main/components/icon/caret-right.tsx","webpack://@finviz/website/./js/main/components/icon/caretVertical.tsx","webpack://@finviz/website/./js/main/components/icon/chart-bar.tsx","webpack://@finviz/website/./js/main/components/icon/chart-bubble.tsx","webpack://@finviz/website/./js/main/components/icon/chart-pie.tsx","webpack://@finviz/website/./js/main/components/icon/chart-table.tsx","webpack://@finviz/website/./js/main/components/icon/chart-treemap.tsx","webpack://@finviz/website/./js/main/components/icon/chevron-down.tsx","webpack://@finviz/website/./js/main/components/icon/chevron-right.tsx","webpack://@finviz/website/./js/main/components/icon/menu-close.tsx","webpack://@finviz/website/./js/main/components/icon/dark-mode.tsx","webpack://@finviz/website/./js/main/components/icon/done.tsx","webpack://@finviz/website/./js/main/components/icon/draw.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-action-delete.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-autosave-off.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-autosave-on.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-autosave-saving.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-drawing-mode.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-drawing-mode-active.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-hide.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-lock.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-preserve-drawings.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-preserve-drawings-active.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-show.tsx","webpack://@finviz/website/./js/main/components/icon/drawing-setting-unlock.tsx","webpack://@finviz/website/./js/main/components/icon/exit-fullscreen.tsx","webpack://@finviz/website/./js/main/components/icon/flash.tsx","webpack://@finviz/website/./js/main/components/icon/fullscreen.tsx","webpack://@finviz/website/./js/main/components/icon/gift.tsx","webpack://@finviz/website/./js/main/components/icon/hamburger.tsx","webpack://@finviz/website/./js/main/components/icon/help.tsx","webpack://@finviz/website/./js/main/components/icon/idea.tsx","webpack://@finviz/website/./js/main/components/icon/idea-load.tsx","webpack://@finviz/website/./js/main/components/icon/idea-save.tsx","webpack://@finviz/website/./js/main/components/icon/interval.tsx","webpack://@finviz/website/./js/main/components/icon/layout-1h1v.tsx","webpack://@finviz/website/./js/main/components/icon/layout-1h2v.tsx","webpack://@finviz/website/./js/main/components/icon/layout-1h3v.tsx","webpack://@finviz/website/./js/main/components/icon/layout-1l2r.tsx","webpack://@finviz/website/./js/main/components/icon/layout-1t2b.tsx","webpack://@finviz/website/./js/main/components/icon/layout-2h1v.tsx","webpack://@finviz/website/./js/main/components/icon/layout-2h2v.tsx","webpack://@finviz/website/./js/main/components/icon/layout-3h1v.tsx","webpack://@finviz/website/./js/main/components/icon/layout-3h2v.tsx","webpack://@finviz/website/./js/main/components/icon/light-mode.tsx","webpack://@finviz/website/./js/main/components/icon/line-chart-type.tsx","webpack://@finviz/website/./js/main/components/icon/close.tsx","webpack://@finviz/website/./js/main/components/icon/more.tsx","webpack://@finviz/website/./js/main/components/icon/note.tsx","webpack://@finviz/website/./js/main/components/icon/ohlc-chart-type.tsx","webpack://@finviz/website/./js/main/components/icon/profile.tsx","webpack://@finviz/website/./js/main/components/icon/publish.tsx","webpack://@finviz/website/./js/main/components/icon/refresh.tsx","webpack://@finviz/website/./js/main/components/icon/remove.tsx","webpack://@finviz/website/./js/main/components/icon/restore.tsx","webpack://@finviz/website/./js/main/components/icon/settings-wheel.tsx","webpack://@finviz/website/./js/main/components/icon/gesture.tsx","webpack://@finviz/website/./js/main/components/icon/search.tsx","webpack://@finviz/website/./js/main/components/icon/settings.tsx","webpack://@finviz/website/./js/main/components/icon/share.tsx","webpack://@finviz/website/./js/main/components/icon/sign-out.tsx","webpack://@finviz/website/./js/main/components/icon/switch-horizontal.tsx","webpack://@finviz/website/./js/main/components/icon/switch-vertical.tsx","webpack://@finviz/website/./js/main/components/icon/tab-key.tsx","webpack://@finviz/website/./js/main/components/icon/template.tsx","webpack://@finviz/website/./js/main/components/icon/tool-arrow.tsx","webpack://@finviz/website/./js/main/components/icon/tool-brush.tsx","webpack://@finviz/website/./js/main/components/icon/tool-callout.tsx","webpack://@finviz/website/./js/main/components/icon/tool-curve.tsx","webpack://@finviz/website/./js/main/components/icon/tool-elliott-wave.tsx","webpack://@finviz/website/./js/main/components/icon/tool-ellipse.tsx","webpack://@finviz/website/./js/main/components/icon/tool-expand.tsx","webpack://@finviz/website/./js/main/components/icon/tool-fibonacci.tsx","webpack://@finviz/website/./js/main/components/icon/tool-line.tsx","webpack://@finviz/website/./js/main/components/icon/tool-measure.tsx","webpack://@finviz/website/./js/main/components/icon/tool-midline-h.tsx","webpack://@finviz/website/./js/main/components/icon/tool-midline-v.tsx","webpack://@finviz/website/./js/main/components/icon/tool-mouse.tsx","webpack://@finviz/website/./js/main/components/icon/tool-pitchfork.tsx","webpack://@finviz/website/./js/main/components/icon/tool-polygon.tsx","webpack://@finviz/website/./js/main/components/icon/tool-position.tsx","webpack://@finviz/website/./js/main/components/icon/tool-rect.tsx","webpack://@finviz/website/./js/main/components/icon/tool-rect-rotated.tsx","webpack://@finviz/website/./js/main/components/icon/tool-text.tsx","webpack://@finviz/website/./js/main/components/icon/tool-triangle.tsx","webpack://@finviz/website/./js/main/components/icon/tool-xabcd.tsx","webpack://@finviz/website/./js/main/components/icon/triangle.tsx","webpack://@finviz/website/./js/main/components/icon/warning.tsx","webpack://@finviz/website/./js/main/components/icon/palette.tsx","webpack://@finviz/website/./js/main/components/icon/arrow-forward.tsx","webpack://@finviz/website/./js/main/components/icon/trending-up.tsx","webpack://@finviz/website/./js/main/components/icon/trending-down.tsx","webpack://@finviz/website/./js/main/components/icon/trash-can.tsx","webpack://@finviz/website/./js/main/components/icon/star.tsx","webpack://@finviz/website/./js/main/components/icon/star-outlined.tsx","webpack://@finviz/website/./js/main/components/icon/svg.tsx","webpack://@finviz/website/./js/main/components/input.tsx","webpack://@finviz/website/./js/main/components/list/hooks.tsx","webpack://@finviz/website/./js/main/components/list/list-item.tsx","webpack://@finviz/website/./js/main/components/list/list.tsx","webpack://@finviz/website/./js/main/components/notification/hooks.ts","webpack://@finviz/website/./js/main/components/notification/notification-wrapper.tsx","webpack://@finviz/website/./js/main/components/notification/notification.tsx","webpack://@finviz/website/./js/main/components/notification/with-notification-context.tsx","webpack://@finviz/website/./js/main/components/popover/popover.tsx","webpack://@finviz/website/./js/main/hooks/use-window-size.tsx","webpack://@finviz/website/./js/main/components/popover/hooks.ts","webpack://@finviz/website/./js/main/components/popover/popover-trigger.tsx","webpack://@finviz/website/./js/main/components/combo-box/combo-box-item.tsx","webpack://@finviz/website/./js/main/components/combo-box/combo-box.tsx","webpack://@finviz/website/./js/main/components/search/constants.ts","webpack://@finviz/website/./js/main/components/centered.tsx","webpack://@finviz/website/./js/main/components/search/search-error.tsx","webpack://@finviz/website/./js/main/components/highlight.tsx","webpack://@finviz/website/./js/main/components/search/util.ts","webpack://@finviz/website/./js/main/components/search/search-item.tsx","webpack://@finviz/website/./js/main/components/search/search-list.tsx","webpack://@finviz/website/./js/main/components/search/search.tsx","webpack://@finviz/website/./js/main/components/combo-box/hooks.ts","webpack://@finviz/website/./js/main/components/select/hooks.ts","webpack://@finviz/website/./js/main/components/select/select-button.tsx","webpack://@finviz/website/./js/main/components/select/select.tsx","webpack://@finviz/website/./js/main/components/select/select-with-tooltip.tsx","webpack://@finviz/website/./js/main/components/select/native-select.tsx","webpack://@finviz/website/./js/main/components/select/select-list.tsx","webpack://@finviz/website/./js/main/components/spinner.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/daterange-select.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/label-with-delayed-spinner.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/timeframe-select.tsx","webpack://@finviz/website/./js/main/components/timeframe-bar/timeframe-bar.tsx","webpack://@finviz/website/./js/main/components/tooltip/tooltip-box.tsx","webpack://@finviz/website/./js/main/components/tooltip/tooltip.tsx","webpack://@finviz/website/./js/main/components/tooltip/tooltip-trigger.tsx","webpack://@finviz/website/./js/main/components/tooltip/hooks.ts","webpack://@finviz/website/./js/main/components/tooltip/tooltip-arrow.tsx","webpack://@finviz/website/./js/main/components/tooltip/types.ts","webpack://@finviz/website/./js/main/components/typography.tsx","webpack://@finviz/website/./js/main/constants.ts","webpack://@finviz/website/./js/main/hooks/use-is-mounted.ts","webpack://@finviz/website/./js/main/hooks/use-element-measure.ts","webpack://@finviz/website/./js/main/hooks/use-resize-observer.ts","webpack://@finviz/website/./js/main/components/context-menu/context-menu.tsx","webpack://@finviz/website/./js/main/components/grid/grid.tsx","webpack://@finviz/website/./js/main/components/inner-state/inner-state.tsx","webpack://@finviz/website/./js/main/components/range.tsx","webpack://@finviz/website/./js/main/components/toolbar/interfaces.ts","webpack://@finviz/website/./js/main/components/toolbar/hooks.ts","webpack://@finviz/website/./js/main/components/toolbar/toolbar.tsx","webpack://@finviz/website/./js/main/components/toolbar/toolbar-button.tsx","webpack://@finviz/website/./js/main/components/toolbar/toolbar-group.tsx","webpack://@finviz/website/./js/main/components/toolbar/toolbar-item.tsx","webpack://@finviz/website/./js/main/components/toolbar/toolbar-divider.tsx","webpack://@finviz/website/./js/main/components/tooltip-input.tsx","webpack://@finviz/website/./js/main/components/tour/step-content.tsx","webpack://@finviz/website/./js/main/components/tour/utils.ts","webpack://@finviz/website/./js/main/components/tour/hooks.tsx","webpack://@finviz/website/./js/main/components/index.ts","webpack://@finviz/website/./js/main/libs-init.ts","webpack://@finviz/website/./js/main/hooks/use-sync-local-storage.ts","webpack://@finviz/website/./js/main/services/api.ts","webpack://@finviz/website/./js/main/services/local-storage.ts","webpack://@finviz/website/./js/main/services/routing.ts","webpack://@finviz/website/./js/main/types.ts","webpack://@finviz/website/./js/main/util.ts"],"sourcesContent":["import classnames from 'classnames'\r\n\r\nimport { isAftermarket, isHoliday, isPremarket } from './utils'\r\n\r\nexport enum MarketBadgeType {\r\n None,\r\n Open,\r\n Closed,\r\n Premarket,\r\n Aftermarket,\r\n}\r\n\r\nexport function getMarketBadgeText(type: MarketBadgeType, _date?: Date) {\r\n switch (type) {\r\n case MarketBadgeType.Open:\r\n return {\r\n label: 'Markets Open',\r\n }\r\n case MarketBadgeType.Closed:\r\n // const holiday = getHoliday(date)\r\n\r\n return {\r\n label: 'Markets Closed',\r\n // description: holiday && (\r\n // <>\r\n // The markets observe U.S. holidays and are closed on\r\n //
\r\n // {holiday.label}\r\n // \r\n // ),\r\n }\r\n case MarketBadgeType.Premarket:\r\n return {\r\n label: 'Premarket',\r\n // description: (\r\n // <>\r\n // An additional time window when trading is possible.\r\n //
\r\n // We report it as the time between 8:00 AM and 9:30 AM\r\n // \r\n // ),\r\n }\r\n case MarketBadgeType.Aftermarket:\r\n return {\r\n label: 'Aftermarket',\r\n // description: (\r\n // <>\r\n // An additional time window when trading is still possible.\r\n //
\r\n // We report it as the time between 4:00 PM and 5:30 PM\r\n // \r\n // ),\r\n }\r\n }\r\n}\r\n\r\nexport function getMarketBadgeType(time: Date, hasUserPremium?: boolean) {\r\n if (isHoliday(time)) return MarketBadgeType.Closed\r\n if (isPremarket(time, hasUserPremium)) return MarketBadgeType.Premarket\r\n if (isAftermarket(time, hasUserPremium)) return MarketBadgeType.Aftermarket\r\n // if (isMarketOpen(time, hasUserPremium)) return MarketBadgeType.Open\r\n\r\n return MarketBadgeType.None\r\n}\r\n\r\nexport interface MarketBadgeProps {\r\n badge: MarketBadgeType\r\n className?: string\r\n}\r\n\r\nexport function MarketBadge({ badge, className }: MarketBadgeProps) {\r\n if (badge === MarketBadgeType.None) return null\r\n\r\n return (\r\n \r\n )\r\n}\r\n","import throttle from 'lodash.throttle'\r\nimport * as React from 'react'\r\n\r\nimport { Tooltip, TooltipTrigger, useTooltipState } from '../../main/components/tooltip'\r\nimport { Heading } from '../../main/components/typography'\r\nimport { useResizeObserver } from '../../main/hooks/use-resize-observer'\r\nimport { MarketBadge, MarketBadgeProps, getMarketBadgeText, getMarketBadgeType } from './market-badge'\r\nimport { TimeFormatType, getDate, getFormattedDateString } from './utils'\r\n\r\nconst UPDATE_INTERVAL = 10000\r\n\r\nenum TimeBreakpointMode {\r\n container,\r\n window,\r\n}\r\n\r\nexport interface TimeBreakpoint {\r\n minWidth: number\r\n marketBadgeText: boolean\r\n timeFormat: TimeFormatType\r\n}\r\n\r\nconst BREAKPOINTS: TimeBreakpoint[] = [\r\n { minWidth: -Infinity, marketBadgeText: false, timeFormat: 'timeOnly' },\r\n { minWidth: 140, marketBadgeText: false, timeFormat: 'short' },\r\n { minWidth: 180, marketBadgeText: false, timeFormat: 'long' },\r\n { minWidth: 255, marketBadgeText: true, timeFormat: 'long' },\r\n]\r\n\r\nfunction getTimeState(fixedTime?: string | Date, hasUserPremium: boolean = FinvizSettings.hasUserPremium) {\r\n const time = getDate(fixedTime)\r\n const badge = getMarketBadgeType(time, hasUserPremium)\r\n\r\n return { time, badge }\r\n}\r\n\r\nfunction TooltipBadge(props: MarketBadgeProps & { time: Date }) {\r\n const state = useTooltipState({ placement: 'bottom' })\r\n const badge = getMarketBadgeText(props.badge, props.time)\r\n\r\n if (!badge) return null\r\n\r\n return (\r\n <>\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n {badge.label}\r\n \r\n {/* {badge.description && {badge.description}} */}\r\n \r\n \r\n )\r\n}\r\n\r\nfunction StaticBadge(props: MarketBadgeProps & { time: Date }) {\r\n const badge = getMarketBadgeText(props.badge, props.time)\r\n\r\n if (!badge) return null\r\n\r\n return (\r\n <>\r\n \r\n {`${badge.label} · `}\r\n \r\n )\r\n}\r\n\r\n/**\r\n * Find matching breakpoint or return the last (largest) one\r\n */\r\nfunction findMatchingBreakpoint(compareWidth: number | undefined, breakpoints: TimeBreakpoint[]) {\r\n if (typeof compareWidth !== 'number') return breakpoints[breakpoints.length - 1]\r\n\r\n const matchingBreakpoints = breakpoints.filter((breakpoint) => compareWidth >= breakpoint.minWidth)\r\n\r\n return matchingBreakpoints.pop() ?? breakpoints[breakpoints.length - 1]\r\n}\r\n\r\nfunction getCurrentWidth(mode: TimeBreakpointMode, element: HTMLElement | null) {\r\n return mode === TimeBreakpointMode.window ? window.innerWidth : element?.clientWidth ?? 0\r\n}\r\n\r\ninterface TimeProps extends React.HTMLProps {\r\n /**\r\n * Set custom time to display\r\n */\r\n fixedTime?: string | Date\r\n\r\n /**\r\n * What to measure the breakpoints to\r\n * - `container` parent element\r\n * - `window` window\r\n *\r\n * @default \"container\"\r\n */\r\n breakpointMode?: keyof typeof TimeBreakpointMode\r\n\r\n /**\r\n * Defines what information is visible at which breakpoint. Local mode measures\r\n * the component wrapper div and global mode measures window width. The definitions\r\n * must be ascending in width\r\n */\r\n breakpoints?: TimeBreakpoint[]\r\n}\r\n\r\nexport function Time({\r\n className,\r\n fixedTime,\r\n breakpointMode = 'container',\r\n breakpoints = BREAKPOINTS,\r\n ...props\r\n}: TimeProps) {\r\n const ResizeObserver = useResizeObserver()\r\n const rootRef = React.useRef(null)\r\n const [state, setState] = React.useState(getTimeState(fixedTime))\r\n const [currentBreakpoint, setBreakpoint] = React.useState(null)\r\n\r\n React.useEffect(() => {\r\n const interval = setInterval(() => setState(getTimeState(fixedTime)), UPDATE_INTERVAL)\r\n return () => clearInterval(interval)\r\n }, [fixedTime])\r\n\r\n React.useEffect(() => {\r\n if (!ResizeObserver || !rootRef.current) return\r\n\r\n if (!currentBreakpoint) {\r\n const currentWidth = getCurrentWidth(TimeBreakpointMode[breakpointMode], rootRef.current)\r\n setBreakpoint(findMatchingBreakpoint(currentWidth, breakpoints))\r\n }\r\n\r\n const handleResize = throttle(() => {\r\n const currentWidth = getCurrentWidth(TimeBreakpointMode[breakpointMode], rootRef.current)\r\n const foundBreakpoint = findMatchingBreakpoint(currentWidth, breakpoints)\r\n\r\n if (foundBreakpoint !== currentBreakpoint) setBreakpoint(foundBreakpoint)\r\n }, 150)\r\n\r\n const observer = new ResizeObserver((entries) => {\r\n window.requestAnimationFrame(() => {\r\n if (Array.isArray(entries) && entries.length > 0) handleResize()\r\n })\r\n })\r\n\r\n observer.observe(rootRef.current)\r\n window.addEventListener('resize', handleResize)\r\n\r\n return () => {\r\n observer.disconnect()\r\n window.removeEventListener('resize', handleResize)\r\n }\r\n }, [ResizeObserver, currentBreakpoint, breakpoints, breakpointMode])\r\n\r\n return (\r\n
\r\n {currentBreakpoint && (\r\n
\r\n {currentBreakpoint.marketBadgeText ? (\r\n \r\n ) : (\r\n \r\n )}\r\n {getFormattedDateString(state.time, currentBreakpoint.timeFormat)}\r\n
\r\n )}\r\n
\r\n )\r\n}\r\n","/**\r\n * Check if a given date is DST in the US\r\n * - begins on the second Sunday in March\r\n * - ends on the first Sunday in November\r\n *\r\n * Keep in sync with https://github.com/finvizhq/charts/blob/master/app/utils.ts\r\n */\r\nexport function getIsDstInNy(date: Date) {\r\n const dayNumber = date.getDate()\r\n const monthIndex = date.getMonth()\r\n const dayOfWeek = date.getDay()\r\n const previousSunday = dayNumber - dayOfWeek\r\n if (monthIndex < 2 || monthIndex > 10) {\r\n return false\r\n }\r\n if (monthIndex > 2 && monthIndex < 10) {\r\n return true\r\n }\r\n return monthIndex === 2 ? previousSunday >= 8 : previousSunday <= 0\r\n}\r\n\r\nexport function getDate(seed?: string | number | Date) {\r\n var date = seed != null ? new Date(seed) : new Date()\r\n const dateAsNY = new Date(\r\n date.getUTCFullYear(),\r\n date.getUTCMonth(),\r\n date.getUTCDate(),\r\n date.getUTCHours() - 5,\r\n date.getUTCMinutes(),\r\n date.getUTCSeconds()\r\n )\r\n const isDst = getIsDstInNy(dateAsNY)\r\n\r\n if (isDst) {\r\n dateAsNY.setUTCHours(dateAsNY.getUTCHours() + 1)\r\n }\r\n\r\n return dateAsNY\r\n}\r\n\r\nfunction getWeekDay(date: Date) {\r\n return date.toLocaleDateString('en-US', { weekday: 'short' })\r\n}\r\n\r\nfunction getMonth(date: Date) {\r\n return date.toLocaleDateString('en-US', { month: 'short' }).toUpperCase()\r\n}\r\n\r\nfunction getDay(date: Date) {\r\n return date.getDate().toString().padStart(2, '0')\r\n}\r\n\r\nfunction getTime(date: Date) {\r\n return date.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', hour12: true })\r\n}\r\n\r\nenum TimeFormat {\r\n long,\r\n short,\r\n timeOnly,\r\n}\r\n\r\nexport type TimeFormatType = keyof typeof TimeFormat\r\n\r\nexport function getFormattedDateString(date: Date = getDate(), format: TimeFormatType = 'long') {\r\n switch (TimeFormat[format]) {\r\n case TimeFormat.long:\r\n return `${getWeekDay(date)} ${getMonth(date)} ${getDay(date)} ${date.getFullYear()} ${getTime(date)} ET`\r\n case TimeFormat.short:\r\n return `${getWeekDay(date)} ${getMonth(date)} ${getDay(date)} ${getTime(date)}`\r\n case TimeFormat.timeOnly:\r\n return getTime(date)\r\n }\r\n}\r\n\r\nexport function isPremarket(date: Date = getDate(), isPremium = FinvizSettings.hasUserPremium) {\r\n const dayOfWeek = date.getDay()\r\n const min = date.getMinutes()\r\n\r\n if (\r\n isPremium &&\r\n dayOfWeek !== 0 &&\r\n dayOfWeek !== 6 &&\r\n (date.getHours() === 8 || (date.getHours() === 9 && min < 30))\r\n ) {\r\n return true\r\n }\r\n return false\r\n}\r\n\r\nexport function isAftermarket(date: Date = getDate(), isPremium = FinvizSettings.hasUserPremium) {\r\n const dayOfWeek = date.getDay()\r\n const min = date.getMinutes()\r\n\r\n if (\r\n isPremium &&\r\n dayOfWeek !== 0 &&\r\n dayOfWeek !== 6 &&\r\n (date.getHours() === 16 || (date.getHours() === 17 && min < 30))\r\n ) {\r\n return true\r\n }\r\n return false\r\n}\r\n\r\n/**\r\n * https://www.nyse.com/markets/hours-calendars\r\n */\r\nconst HOLIDAY_DATES = [\r\n {\r\n label: \"New Year's Day\",\r\n test: (day: number, month: number) => month === 1 && day === 2,\r\n },\r\n {\r\n label: 'Martin Luther King, Jr. Day',\r\n test: (day: number, month: number) => month === 1 && day === 16,\r\n },\r\n {\r\n label: 'Presidents Day',\r\n test: (day: number, month: number) => month === 2 && day === 20,\r\n },\r\n {\r\n label: 'Good Friday',\r\n test: (day: number, month: number) => month === 4 && day === 7,\r\n },\r\n {\r\n label: 'Memorial Day',\r\n test: (day: number, month: number) => month === 5 && day === 29,\r\n },\r\n {\r\n label: 'Juneteenth Holiday',\r\n test: (day: number, month: number) => month === 6 && day === 19,\r\n },\r\n {\r\n label: 'Early Close',\r\n test: (day: number, month: number, hours: number) => month === 7 && day === 3 && hours >= 13,\r\n },\r\n {\r\n label: 'Independence Day',\r\n test: (day: number, month: number) => month === 7 && day === 4,\r\n },\r\n {\r\n label: 'Labor Day',\r\n test: (day: number, month: number) => month === 9 && day === 4,\r\n },\r\n {\r\n label: 'Thanksgiving Day',\r\n test: (day: number, month: number) => month === 11 && day === 23,\r\n },\r\n {\r\n label: 'Day after Thanksgiving (closed from 1 PM)',\r\n test: (day: number, month: number, hours: number) => month === 11 && day === 24 && hours >= 13,\r\n },\r\n {\r\n label: 'Christmas Day',\r\n test: (day: number, month: number) => month === 12 && day === 25,\r\n },\r\n]\r\n\r\nexport function getHoliday(date: Date = getDate()) {\r\n var day = date.getDate()\r\n var month = date.getMonth() + 1\r\n var hours = date.getHours()\r\n\r\n return HOLIDAY_DATES.find((holiday) => holiday.test(day, month, hours))\r\n}\r\n\r\nexport function isHoliday(date: Date = getDate()) {\r\n return !!getHoliday(date)\r\n}\r\n\r\nexport function isMarketOpen(date: Date = getDate(), isPremium = FinvizSettings.hasUserPremium) {\r\n if (isPremarket(date, isPremium) || isAftermarket(date, isPremium) || isHoliday(date)) {\r\n return false\r\n }\r\n\r\n const dayOfWeek = date.getDay()\r\n const hour = date.getHours()\r\n const minute = date.getMinutes()\r\n\r\n const isWeekend = dayOfWeek === 0 || dayOfWeek === 6\r\n // Day starts at 9:30\r\n const dayStarted = hour === 9 ? minute >= 30 : hour >= 10\r\n // Ends at 16:00\r\n const dayEnded = hour >= 16\r\n\r\n return !isWeekend && dayStarted && !dayEnded\r\n}\r\n","export type ObjectHash = Record\r\n\r\nexport const decodeQueryString = function = ObjectHash>(\r\n search = window.location.search\r\n): T {\r\n const vars = search.substring(1).split('&')\r\n const obj: ObjectHash = {}\r\n vars.forEach((pair) => {\r\n const delimiterPos = pair.indexOf('='),\r\n key = decodeURIComponent(pair.substring(0, delimiterPos)),\r\n value = decodeURIComponent(pair.substring(delimiterPos + 1))\r\n obj[key] = value\r\n })\r\n return obj as T\r\n}\r\n\r\nexport const encodeQueryString = function (values: ObjectHash, whitelistedValues: string[] = []) {\r\n return Object.keys(values).reduce((prev, key) => {\r\n const value = values[key]\r\n if (!['', null, undefined].includes(value) || whitelistedValues.includes(value)) {\r\n return prev + (prev.length > 0 ? '&' : '') + encodeURIComponent(key) + '=' + encodeURIComponent(value)\r\n }\r\n return prev\r\n }, '')\r\n}\r\n","export function getParsedCookies(cookieName: string) {\r\n const parseCookies = document.cookie\r\n .split(';')\r\n .map((cookieString) => cookieString.split('='))\r\n .reduce((acc, v) => {\r\n acc[decodeURIComponent(v[0].trim())] = decodeURIComponent(v[1].trim())\r\n return acc\r\n }, {} as Record)\r\n\r\n return cookieName ? parseCookies[cookieName] : parseCookies\r\n}\r\n\r\nexport function getCookie(name: string) {\r\n var re = new RegExp('(?:(?:^|.*;\\\\s*)' + name + '\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$')\r\n return document.cookie.replace(re, '$1')\r\n}\r\n\r\nexport function setCookie(name: string, value: string, expires: Date) {\r\n var cookie = name + '=' + value + '; expires=' + expires.toUTCString()\r\n if (/\\bfinviz\\b/.test(document.location.hostname)) {\r\n cookie += '; domain=.finviz.com'\r\n }\r\n document.cookie = cookie\r\n}\r\n","import { HTMLAttributeReferrerPolicy } from 'react'\r\n\r\nimport { Instrument } from '../../main/types'\r\nimport { cleanTicker } from '../../main/util'\r\n\r\nexport function getHoverChartUrl(\r\n ticker: string,\r\n escaped: boolean = false,\r\n timeframe = FinvizSettings.stocksHoverChartTimeframe\r\n): string {\r\n let imgUrl = `${FinvizSettings.nodeChartsDomain}/chart.ashx?cs=m&t=${ticker}&tf=${timeframe ?? 'd'}&ct=candle_stick`\r\n if (FinvizSettings.hasUserPremium && FinvizSettings.stocksHoverChartPatterns) {\r\n imgUrl +=\r\n '&o[0][ot]=sma&o[0][op]=50&o[0][oc]=FF8F33C6&o[1][ot]=sma&o[1][op]=200&o[1][oc]=DCB3326D&o[2][ot]=patterns&o[2][op]=&o[2][oc]=000'\r\n }\r\n if (document.documentElement.classList.contains('dark')) {\r\n imgUrl += '&tm=d'\r\n }\r\n if (escaped) {\r\n // \"Escaping\" [ and ] because of how boxover.js works\r\n imgUrl = imgUrl.replace(/\\[/g, '[[').replace(/]/g, ']]')\r\n }\r\n return imgUrl\r\n}\r\n\r\nfunction timeframeToDeprecatedTimeframe(timeframeString: string) {\r\n switch (timeframeString) {\r\n case 'i1':\r\n case 'i2':\r\n return 'm1'\r\n case 'i3':\r\n return 'm3'\r\n case 'i5':\r\n return 'm5'\r\n case 'i10':\r\n case 'i15':\r\n return 'm15'\r\n case 'i30':\r\n return 'm30'\r\n case 'h':\r\n case 'h2':\r\n case 'h4':\r\n return 'h1'\r\n case 'w':\r\n return 'w1'\r\n case 'm':\r\n return 'mo'\r\n default:\r\n case 'd':\r\n return 'd1'\r\n }\r\n}\r\n\r\nfunction getOldChartsUrl(ticker: string, timeframe: string = 'd1', instrument: Instrument) {\r\n const oldPeriod = timeframeToDeprecatedTimeframe(timeframe)\r\n\r\n switch (instrument) {\r\n case Instrument.crypto:\r\n case Instrument.forex:\r\n return `/fx_image.ashx?${cleanTicker(ticker).toLowerCase()}_${oldPeriod}_s.png`\r\n default:\r\n case Instrument.futures:\r\n return `/fut_image.ashx?${cleanTicker(ticker).toLowerCase()}_${oldPeriod}_s.png`\r\n }\r\n}\r\n\r\nexport function getHoverChartDimensions() {\r\n switch (FinvizSettings.stocksHoverChartTimeframe) {\r\n case 'i3':\r\n case 'i15':\r\n return { width: 584, height: 180 }\r\n case 'i5':\r\n return { width: 376, height: 180 }\r\n case 'd':\r\n if (FinvizSettings.stocksHoverChartPatterns) return { width: 464, height: 230 }\r\n return { width: 324, height: 180 }\r\n default:\r\n return { width: 324, height: 180 }\r\n }\r\n}\r\n\r\nexport function getReferrerPolicy(): HTMLAttributeReferrerPolicy {\r\n return 'no-referrer-when-downgrade'\r\n}\r\n\r\nexport function getHoverChartImg(\r\n ticker: string,\r\n escaped: boolean = false,\r\n timeframe = FinvizSettings.stocksHoverChartTimeframe,\r\n size?: { width: number; height: number },\r\n instrument: Instrument = Instrument.stock\r\n) {\r\n const useOldCharts = !FinvizSettings.hasForexFuturesCryptoNodeCharts && instrument !== Instrument.stock\r\n const chartSize = useOldCharts ? { width: 320, height: 180 } : getHoverChartDimensions()\r\n const referrerPolicy = getReferrerPolicy()\r\n const url = useOldCharts\r\n ? getOldChartsUrl(ticker, timeframe, instrument)\r\n : getHoverChartUrl(ticker, escaped, timeframe)\r\n const srcSet = useOldCharts ? '' : getSrcSet(url)\r\n const srcsetString = srcSet?.length ? ` srcset='${srcSet}'` : ''\r\n\r\n return {\r\n img: ``,\r\n ...chartSize,\r\n }\r\n}\r\n\r\nexport function getSrcSet(url: string) {\r\n return FinvizSettings.hasUserRetinaNodeCharts ? `${url} 1x, ${url}&sf=2 2x` : undefined\r\n}\r\n","const matchesAndroid = navigator.userAgent.match(/Android/i)\r\nconst matchesWebOS = navigator.userAgent.match(/webOS/i)\r\nconst matchesIPhone = navigator.userAgent.match(/iPhone/i)\r\nconst matchesiPad = navigator.userAgent.match(/iPad/i)\r\nconst matchesIPod = navigator.userAgent.match(/iPod/i)\r\nconst matchesBlackBerry = navigator.userAgent.match(/BlackBerry/i)\r\nconst matchesWindowsPhone = navigator.userAgent.match(/Windows Phone/i)\r\nconst matchesIOSLike = navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints > 0\r\n\r\nconst isMobileDevice =\r\n matchesAndroid ||\r\n matchesWebOS ||\r\n matchesIPhone ||\r\n matchesiPad ||\r\n matchesIPod ||\r\n matchesBlackBerry ||\r\n matchesWindowsPhone ||\r\n matchesIOSLike\r\n\r\nexport function isMobile() {\r\n return !!isMobileDevice\r\n}\r\n\r\nexport function isIphone() {\r\n return !!(matchesIPhone && !matchesiPad)\r\n}\r\n\r\nexport function isIpad() {\r\n return (matchesIOSLike && !matchesIPhone && !matchesIPod) || matchesiPad\r\n}\r\n\r\nexport function isSafariDesktop() {\r\n return /^((?!chrome|android).)*safari/i.test(navigator.userAgent) && navigator.maxTouchPoints === 0\r\n}\r\n","function getSanitizedSingleTicker(rawTicker: string) {\r\n return rawTicker\r\n .replace(/\\.+/gi, '-')\r\n .split('-')\r\n .map((x) => x.replace(/([^a-z0-9@-])+/gi, ''))\r\n .filter((x) => !!x)\r\n .join('-')\r\n .toUpperCase()\r\n}\r\n\r\nexport function getSanitizedTicker(rawTicker: string, isMulti = false) {\r\n if (isMulti) {\r\n return rawTicker\r\n .replace(/ /g, ',')\r\n .split(',')\r\n .map(getSanitizedSingleTicker)\r\n .filter((x) => !!x)\r\n .join(',')\r\n }\r\n\r\n return getSanitizedSingleTicker(rawTicker)\r\n}\r\n","import { decodeQueryString, encodeQueryString } from '../queryString'\r\nimport { getCookie, setCookie } from './cookie'\r\n\r\nexport const formatDateToStringUS = (date: Date) =>\r\n date.toLocaleDateString('en-US', {\r\n day: '2-digit',\r\n month: '2-digit',\r\n year: 'numeric',\r\n })\r\n\r\nconst DRAWING_QUOTE_PAGE_COOKIE_NAME = 'charts-draw'\r\nexport function getIsDrawingEnabledOnQuotePage() {\r\n return getCookie(DRAWING_QUOTE_PAGE_COOKIE_NAME) === 'on'\r\n}\r\n\r\nexport async function setIsDrawingEnabledOnQuotePage(isEnabled: boolean) {\r\n return fetch('/api/set_cookie.ashx?cookie=' + DRAWING_QUOTE_PAGE_COOKIE_NAME + '&value=' + (isEnabled ? 'on' : 'off'))\r\n .catch(() => {})\r\n .then((res) => {\r\n if (!res?.ok) {\r\n // fallback to JS otherwise draw toggle won't work if API don't work\r\n setIsDrawingEnabledOnQuotePageCookieViaJS(isEnabled)\r\n }\r\n\r\n const { i: idea, ...rest } = decodeQueryString()\r\n if (idea) {\r\n document.location = `quote.ashx?${encodeQueryString(rest)}`\r\n } else {\r\n document.location.reload()\r\n }\r\n })\r\n}\r\n\r\nfunction setIsDrawingEnabledOnQuotePageCookieViaJS(isEnabled: boolean) {\r\n const expires = new Date()\r\n expires.setMonth(expires.getMonth() + 1)\r\n setCookie(DRAWING_QUOTE_PAGE_COOKIE_NAME, isEnabled ? 'on' : 'off', expires)\r\n}\r\n\r\nexport function parseInitData(elementId: string): T | undefined {\r\n try {\r\n const initDataElement = document.getElementById(elementId)!\r\n return JSON.parse(initDataElement.textContent!)\r\n } catch (e) {\r\n Sentry.captureException(e)\r\n return\r\n }\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nexport enum BoxRounding {\r\n none = '',\r\n regular = 'rounded-md', // 6px\r\n}\r\n\r\nexport enum BoxTheme {\r\n none = '',\r\n light = 'bg-white dark:bg-gray-800 border border-gray-100 dark:border-gray-600',\r\n dark = 'bg-gray-800 border border-gray-600',\r\n}\r\n\r\nexport interface BoxProps extends Omit, 'ref'> {\r\n rounding?: keyof typeof BoxRounding\r\n theme?: keyof typeof BoxTheme\r\n}\r\n\r\nexport const Box = React.forwardRef(function Box(\r\n { rounding = 'regular', theme = 'light', ...props }: BoxProps,\r\n ref: React.ForwardedRef\r\n) {\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n})\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Button, ButtonRounding, ButtonRoundingType } from '../button'\r\n\r\nexport enum GroupTheme {\r\n light,\r\n dark,\r\n}\r\n\r\nexport interface ButtonGroupProps {\r\n children: React.ReactNode\r\n\r\n /**\r\n * Border radius of entire group wrapper\r\n *\r\n * @default \"regular\"\r\n */\r\n rounding?: ButtonRoundingType\r\n\r\n className?: string\r\n\r\n /**\r\n * If a pipe divider between buttons should be rendered\r\n *\r\n * @default true\r\n */\r\n hasDivider?: boolean\r\n\r\n /**\r\n * If group wrapper has a border\r\n *\r\n * @default true\r\n */\r\n hasBorder?: boolean\r\n\r\n /**\r\n * Group color theme\r\n *\r\n * @default \"light\"\r\n */\r\n theme?: keyof typeof GroupTheme\r\n\r\n /**\r\n * Custom button component which extends Button\r\n *\r\n * @default undefined\r\n */\r\n childComponent?: string | React.JSXElementConstructor\r\n}\r\n\r\nfunction getGroupTheme(theme: GroupTheme) {\r\n switch (theme) {\r\n case GroupTheme.dark:\r\n return {\r\n wrapper: 'bg-gray-800 border-gray-600',\r\n divider: 'bg-gray-600',\r\n }\r\n default:\r\n return {\r\n wrapper: 'bg-white dark:bg-gray-800 border-gray-100 dark:border-gray-600',\r\n divider: 'bg-gray-100 dark:bg-gray-600',\r\n }\r\n }\r\n}\r\n\r\nexport function ButtonGroup({\r\n className,\r\n children,\r\n theme = 'light',\r\n hasDivider = true,\r\n hasBorder = true,\r\n rounding = 'regular',\r\n childComponent,\r\n}: ButtonGroupProps) {\r\n const buttonRounding = ButtonRounding[rounding]\r\n const groupTheme = React.useMemo(() => getGroupTheme(GroupTheme[theme]), [theme])\r\n return (\r\n \r\n {React.Children.map(children, (child, index) => {\r\n if (!React.isValidElement(child) || ![Button, childComponent].filter(Boolean).includes(child.type)) {\r\n return child\r\n }\r\n\r\n return (\r\n \r\n {hasDivider && index > 0 &&
}\r\n {React.cloneElement(child as React.ReactElement>, {\r\n rounding: child.props.rounding ?? 'none',\r\n theme: child.props.theme ?? (GroupTheme[theme] === GroupTheme.dark ? 'menuItemDark' : 'menuItem'),\r\n })}\r\n \r\n )\r\n })}\r\n
\r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Icon, IconNameType, isValidIconName } from './icon'\r\nimport { PropsWithAs } from './types'\r\n\r\nexport const BUTTON_DEFAULT_ELEMENT = 'button'\r\n\r\nexport const BUTTON_BASE_CLASS = 'flex items-center font-medium whitespace-nowrap focus:outline-none'\r\nexport const BUTTON_SQUARE_BASE_CLASS = 'shrink-0 justify-center'\r\nexport const BUTTON_FOCUS_STYLES = 'focus-visible:ring-2 ring-gray-200 dark:ring-gray-500'\r\n\r\nexport enum ButtonSize {\r\n none = '', // Do not set fixed dimensions\r\n small = 'text-2xs h-6 px-2', // 24px height\r\n regular = 'text-2xs h-7 px-2', // 28px height\r\n medium = 'text-sm h-8 px-3', // 32px height\r\n large = 'text-sm h-9 px-4', // 36px height\r\n}\r\n\r\nexport type ButtonSizeType = keyof typeof ButtonSize\r\n\r\nexport enum ButtonSquareSize {\r\n none = '', // Do not set fixed dimensions\r\n small = 'h-6 w-6', // 24x24px\r\n regular = 'h-7 w-7', // 28x28px\r\n medium = 'h-8 w-8', // 32x32px\r\n large = 'h-9 w-9', // 36x36px\r\n}\r\n\r\nexport enum ButtonRounding {\r\n none = '',\r\n small = 'rounded', // 4px\r\n regular = 'rounded-md', // 6px\r\n full = 'rounded-full', // 9999px\r\n}\r\n\r\nexport type ButtonRoundingType = keyof typeof ButtonRounding\r\n\r\nexport enum ButtonTheme {\r\n transparent, // Only basic shape is rendered\r\n light,\r\n dark,\r\n blue,\r\n blueHover,\r\n red,\r\n headerItem,\r\n menuItem,\r\n menuItemDark,\r\n opacity,\r\n outline,\r\n chipTransparent,\r\n chip,\r\n}\r\n\r\nexport type ButtonThemeType = keyof typeof ButtonTheme\r\n\r\n/**\r\n * Get button theme\r\n */\r\nexport function getButtonTheme(theme: ButtonTheme, active = false) {\r\n switch (theme) {\r\n case ButtonTheme.light: {\r\n return {\r\n button: classnames(\r\n 'active:bg-gray-200 disabled:bg-gray-50 disabled:text-gray-400', // Light\r\n 'dark:active:bg-gray-500 dark:disabled:bg-gray-700 dark:disabled:text-gray-300', // Dark\r\n {\r\n 'bg-gray-50 hover:bg-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600': !active,\r\n 'bg-gray-200 dark:bg-gray-500': active,\r\n }\r\n ),\r\n }\r\n }\r\n case ButtonTheme.dark: {\r\n return {\r\n button: classnames('text-gray-50 active:bg-gray-500 disabled:bg-gray-700 disabled:text-gray-300', {\r\n 'bg-gray-700 hover:bg-gray-600': !active,\r\n 'bg-gray-500': active,\r\n }),\r\n }\r\n }\r\n case ButtonTheme.blue: {\r\n return {\r\n button: classnames(\r\n 'text-white hover:text-white active:bg-blue-600 disabled:bg-blue-200 dark:disabled:text-gray-300',\r\n {\r\n 'bg-blue-400 hover:bg-blue-500': !active,\r\n 'bg-blue-600': active,\r\n }\r\n ),\r\n }\r\n }\r\n case ButtonTheme.blueHover: {\r\n return {\r\n button: classnames(\r\n 'active:bg-blue-600 disabled:bg-blue-200 disabled:text-gray-400 dark:disabled:text-gray-300',\r\n {\r\n 'text-blue-600 hover:bg-blue-400 hover:text-white dark:text-blue-500 dark:hover:text-white': !active,\r\n 'bg-blue-400 text-white': active,\r\n }\r\n ),\r\n }\r\n }\r\n case ButtonTheme.red: {\r\n return {\r\n button: classnames('text-white active:bg-red-600 disabled:bg-red-200 disabled:text-gray-300', {\r\n 'bg-red-400 hover:bg-red-500': !active,\r\n 'bg-red-600': active,\r\n }),\r\n }\r\n }\r\n case ButtonTheme.headerItem: {\r\n return {\r\n button: classnames(\r\n 'bg-gray-800 text-gray-300 hover:bg-gray-900 hover:text-white disabled:bg-gray-700' // Base\r\n ),\r\n icon: 'text-white',\r\n }\r\n }\r\n case ButtonTheme.menuItem: {\r\n return {\r\n button: classnames({\r\n 'hover:bg-gray-50 disabled:text-gray-400 dark:hover:bg-gray-700': !active,\r\n 'bg-gray-50 dark:bg-gray-700': active,\r\n }),\r\n }\r\n }\r\n case ButtonTheme.menuItemDark: {\r\n return {\r\n button: classnames('text-white', {\r\n 'hover:bg-gray-700': !active,\r\n 'bg-gray-700': active,\r\n }),\r\n }\r\n }\r\n case ButtonTheme.opacity:\r\n return {\r\n button: classnames('disabled:opacity-50 dark:text-gray-400', {\r\n 'opacity-70 hover:opacity-100': !active,\r\n }),\r\n }\r\n case ButtonTheme.outline:\r\n return {\r\n button: classnames(\r\n // Base styles\r\n 'border border-gray-100 active:border-blue-400 disabled:border-gray-100 disabled:bg-gray-50 disabled:text-gray-500',\r\n // Dark styles\r\n 'dark:border-gray-600 dark:bg-gray-800 dark:text-gray-50 dark:active:border-blue-400 dark:disabled:border-transparent dark:disabled:bg-gray-700 dark:disabled:text-gray-400',\r\n {\r\n 'border-blue-400 dark:border-blue-400': active,\r\n 'hover:border-gray-300 dark:hover:border-gray-400': !active,\r\n }\r\n ),\r\n }\r\n case ButtonTheme.chip:\r\n return {\r\n button: classnames('border', {\r\n 'border-transparent bg-gray-50 hover:bg-gray-100 dark:bg-gray-700 dark:hover:bg-gray-600': !active,\r\n 'border-blue-500 bg-blue-50 text-gray-900 dark:bg-gray-700 dark:text-white': active,\r\n }),\r\n }\r\n case ButtonTheme.chipTransparent:\r\n return {\r\n button: classnames(\r\n 'border', // Base styles\r\n {\r\n 'border-transparent text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200':\r\n !active,\r\n 'border-blue-400 bg-blue-50 text-gray-900 dark:bg-gray-700 dark:text-white': active,\r\n }\r\n ),\r\n }\r\n default:\r\n return {}\r\n }\r\n}\r\n\r\n/**\r\n * Export Button html props type so we don’t always have to omit\r\n */\r\nexport type ButtonHTMLProps = Omit, 'ref' | 'type' | 'size' | 'content'>\r\n\r\nexport interface ButtonProps {\r\n /**\r\n * Visual appearance of the button\r\n */\r\n theme?: ButtonThemeType\r\n\r\n /**\r\n * Sets if button is square or normal.\r\n *\r\n * @default 'regular'\r\n */\r\n appearance?: 'regular' | 'square'\r\n\r\n /**\r\n * Size of the button\r\n *\r\n * @default \"regular\"\r\n */\r\n size?: ButtonSizeType\r\n\r\n /**\r\n * Render button in an active state (darker background, etc.)\r\n */\r\n active?: boolean\r\n\r\n /**\r\n * Sets if the button has focus ring\r\n *\r\n * @default true\r\n */\r\n focusRing?: boolean\r\n\r\n /**\r\n * Sets rounded corners for the button\r\n *\r\n * @default regular\r\n */\r\n rounding?: ButtonRoundingType\r\n\r\n /**\r\n * Class for the content wrapper\r\n */\r\n contentClass?: string\r\n\r\n /**\r\n * Name of left icon\r\n */\r\n leftContent?: JSX.Element | IconNameType\r\n\r\n /**\r\n * Name of right icon\r\n */\r\n rightContent?: JSX.Element | IconNameType\r\n}\r\n\r\nexport type ButtonComponentProps =\r\n PropsWithAs & ButtonProps\r\n\r\nfunction ButtonComponent(\r\n {\r\n as: asComponent,\r\n theme = 'light',\r\n size = 'regular',\r\n rounding = 'regular',\r\n focusRing = true,\r\n appearance = 'regular',\r\n active,\r\n contentClass,\r\n leftContent,\r\n rightContent,\r\n className,\r\n children,\r\n ...props\r\n }: ButtonComponentProps,\r\n ref: React.ForwardedRef\r\n) {\r\n const isSquare = appearance === 'square'\r\n const buttonTheme = React.useMemo(() => getButtonTheme(ButtonTheme[theme], active), [theme, active])\r\n const buttonSize = isSquare ? ButtonSquareSize[size] : ButtonSize[size]\r\n const buttonRounding = ButtonRounding[rounding]\r\n\r\n return React.createElement(\r\n asComponent ?? BUTTON_DEFAULT_ELEMENT,\r\n {\r\n ...props,\r\n ref,\r\n className: classnames(\r\n BUTTON_BASE_CLASS,\r\n buttonTheme.button,\r\n buttonSize,\r\n buttonRounding,\r\n {\r\n [BUTTON_SQUARE_BASE_CLASS]: isSquare,\r\n [BUTTON_FOCUS_STYLES]: focusRing,\r\n },\r\n className\r\n ),\r\n },\r\n <>\r\n {isValidIconName(leftContent) ? (\r\n \r\n ) : (\r\n leftContent\r\n )}\r\n {children && !isSquare ? (\r\n \r\n {children}\r\n \r\n ) : (\r\n children\r\n )}\r\n {isValidIconName(rightContent) ? (\r\n \r\n ) : (\r\n rightContent\r\n )}\r\n \r\n )\r\n}\r\n\r\n/**\r\n * We need to forward ref to the function, but typescript looses the type of the\r\n * props param so we need to typecast to get suggestions to work\r\n */\r\nexport const Button = React.forwardRef(ButtonComponent) as <\r\n TagType extends React.ElementType = typeof BUTTON_DEFAULT_ELEMENT\r\n>(\r\n props: PropsWithAs & ButtonProps & { ref?: React.ForwardedRef }\r\n) => ReturnType\r\n","import classnames from 'classnames'\r\nimport { ForwardedRef, HTMLProps, PropsWithChildren, ReactNode, forwardRef } from 'react'\r\n\r\nimport { Icon } from './icon'\r\n\r\ninterface CheckboxProps extends Omit, 'label'> {\r\n /**\r\n * Text that gets displayed on the right side of the checkbox\r\n */\r\n label?: ReactNode\r\n\r\n checked: boolean\r\n}\r\n\r\nfunction CheckboxComponent(\r\n { className, label, children, ...props }: PropsWithChildren,\r\n ref: ForwardedRef\r\n) {\r\n const checked = props.checked ?? props.defaultChecked\r\n\r\n return (\r\n \r\n
\r\n \r\n {checked && }\r\n
\r\n {label ?? children}\r\n \r\n )\r\n}\r\n\r\nexport const Checkbox = forwardRef(CheckboxComponent)\r\n","import classnames from 'classnames'\r\nimport { HTMLProps, PropsWithChildren, memo, useCallback, useLayoutEffect, useRef, useState } from 'react'\r\n\r\nexport interface Interaction {\r\n left: number\r\n top: number\r\n}\r\n\r\n/**\r\n * Clamp value between two bounds\r\n */\r\nfunction clamp(num: number, min = 0, max = 1) {\r\n return num > max ? max : num < min ? min : num\r\n}\r\n\r\n/**\r\n * Check if an event was triggered by touch\r\n */\r\nfunction isTouch(event: MouseEvent | TouchEvent): event is TouchEvent {\r\n return 'touches' in event\r\n}\r\n\r\n/**\r\n * Returns a relative position of the pointer inside the node's bounding box\r\n */\r\nfunction getRelativePosition(node: HTMLDivElement, event: MouseEvent | TouchEvent): Interaction {\r\n const rect = node.getBoundingClientRect()\r\n\r\n // Get user's pointer position from `touches` array if it's a `TouchEvent`\r\n const pointer = isTouch(event) ? event.touches[0] : (event as MouseEvent)\r\n\r\n return {\r\n left: clamp((pointer.pageX - (rect.left + window.pageXOffset)) / rect.width),\r\n top: clamp((pointer.pageY - (rect.top + window.pageYOffset)) / rect.height),\r\n }\r\n}\r\n\r\n/**\r\n * Browsers introduced an intervention, making touch events passive by default.\r\n * This workaround removes `preventDefault` call from the touch handlers.\r\n * @see https://github.com/facebook/react/issues/19651\r\n */\r\nfunction preventDefaultMove(event: MouseEvent | TouchEvent) {\r\n !isTouch(event) && event.preventDefault()\r\n}\r\n\r\ninterface Props {\r\n onMove: (interaction: Interaction) => void\r\n onKey: (offset: Interaction) => void\r\n}\r\n\r\nfunction DraggablePickerComponent({\r\n onMove,\r\n onKey,\r\n className,\r\n ...props\r\n}: PropsWithChildren & HTMLProps) {\r\n const container = useRef(null)\r\n const hasTouched = useRef(false)\r\n const [isDragging, setDragging] = useState(false)\r\n\r\n /**\r\n * Prevent mobile browsers from handling mouse events (conflicting with touch ones).\r\n * If we detected a touch interaction before, we prefer reacting to touch events only.\r\n */\r\n const isValid = useRef((event: MouseEvent | TouchEvent): boolean => {\r\n if (hasTouched.current && !isTouch(event)) return false\r\n if (!hasTouched.current) hasTouched.current = isTouch(event)\r\n return true\r\n })\r\n\r\n const handleMove = useCallback(\r\n (event: MouseEvent | TouchEvent) => {\r\n preventDefaultMove(event)\r\n\r\n // If user moves the pointer outside of the window or iframe bounds and release it there,\r\n // `mouseup`/`touchend` won't be fired. In order to stop the picker from following the cursor\r\n // after the user has moved the mouse/finger back to the document, we check `event.buttons`\r\n // and `event.touches`. It allows us to detect that the user is just moving his pointer\r\n // without pressing it down\r\n const isDown = isTouch(event) ? event.touches.length > 0 : event.buttons > 0\r\n\r\n if (isDown && container.current) {\r\n onMove(getRelativePosition(container.current, event))\r\n } else {\r\n setDragging(false)\r\n }\r\n },\r\n [onMove]\r\n )\r\n\r\n const handleMoveStart = useCallback(\r\n ({ nativeEvent }: React.MouseEvent | React.TouchEvent) => {\r\n preventDefaultMove(nativeEvent)\r\n\r\n if (!isValid.current(nativeEvent)) return\r\n\r\n // The node/ref must actually exist when user start an interaction.\r\n // We won't suppress the ESLint warning though, as it should probably be something to be aware of.\r\n onMove(getRelativePosition(container.current!, nativeEvent))\r\n setDragging(true)\r\n },\r\n [onMove]\r\n )\r\n\r\n const handleKeyDown = useCallback(\r\n (event: React.KeyboardEvent) => {\r\n const keyCode = event.which || event.keyCode\r\n\r\n // Ignore all keys except arrow ones\r\n if (keyCode < 37 || keyCode > 40) return\r\n // Do not scroll page by arrow keys when document is focused on the element\r\n event.preventDefault()\r\n // Send relative offset to the parent component.\r\n // We use codes (37←, 38↑, 39→, 40↓) instead of keys ('ArrowRight', 'ArrowDown', etc)\r\n // to reduce the size of the library\r\n onKey({\r\n left: keyCode === 39 ? 0.05 : keyCode === 37 ? -0.05 : 0,\r\n top: keyCode === 40 ? 0.05 : keyCode === 38 ? -0.05 : 0,\r\n })\r\n },\r\n [onKey]\r\n )\r\n\r\n const handleMoveEnd = useCallback(() => setDragging(false), [])\r\n\r\n const toggleDocumentEvents = useCallback(\r\n (state) => {\r\n // add or remove additional pointer event listeners\r\n const toggleEvent = state ? window.addEventListener : window.removeEventListener\r\n toggleEvent(hasTouched.current ? 'touchmove' : 'mousemove', handleMove)\r\n toggleEvent(hasTouched.current ? 'touchend' : 'mouseup', handleMoveEnd)\r\n },\r\n [handleMove, handleMoveEnd]\r\n )\r\n\r\n useLayoutEffect(() => {\r\n toggleDocumentEvents(isDragging)\r\n return () => {\r\n isDragging && toggleDocumentEvents(false)\r\n }\r\n }, [isDragging, toggleDocumentEvents])\r\n\r\n return (\r\n \r\n )\r\n}\r\n\r\nexport const DraggablePicker = memo(DraggablePickerComponent)\r\n","interface PointerProps {\r\n className?: string\r\n top?: number\r\n left: number\r\n color: string\r\n}\r\n\r\nexport function Pointer({ color, left, top = 0.5 }: PointerProps) {\r\n return (\r\n \r\n
\r\n
\r\n )\r\n}\r\n","/**\r\n * Keep this file in sync with `app/utils/colors.ts` in charts repo\r\n * */\r\n\r\nexport interface RGBA {\r\n r: number\r\n g: number\r\n b: number\r\n a: number\r\n}\r\n\r\nexport interface HSVA {\r\n h: number\r\n s: number\r\n v: number\r\n a: number\r\n}\r\n\r\nexport interface HSLA {\r\n h: number\r\n s: number\r\n l: number\r\n a: number\r\n}\r\n\r\n/**\r\n * Convert Hex string to RGBA object.\r\n * @see https://css-tricks.com/converting-color-spaces-in-javascript/\r\n *\r\n * Input: color in hex3, hex4, hex6 or hex8 format (#fff)\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hexStringToRGBA(hexString: string): RGBA {\r\n const hexColor = removeHashSymbol(hexString)\r\n let r: string | number = 0\r\n let g: string | number = 0\r\n let b: string | number = 0\r\n let a: string | number = 255\r\n\r\n // 3 digits\r\n if (hexColor.length === 3 || hexColor.length === 4) {\r\n r = '0x' + hexColor[0] + hexColor[0]\r\n g = '0x' + hexColor[1] + hexColor[1]\r\n b = '0x' + hexColor[2] + hexColor[2]\r\n // Get channel if defined\r\n a = hexColor.length === 4 ? '0x' + hexColor[3] + hexColor[3] : a\r\n\r\n // 6 digits\r\n } else if (hexColor.length === 6 || hexColor.length === 8) {\r\n r = '0x' + hexColor[0] + hexColor[1]\r\n g = '0x' + hexColor[2] + hexColor[3]\r\n b = '0x' + hexColor[4] + hexColor[5]\r\n // Get channel if defined\r\n a = hexColor.length === 8 ? '0x' + hexColor[6] + hexColor[7] : a\r\n }\r\n\r\n return { r: Number(r), g: Number(g), b: Number(b), a: Math.min(Math.round((Number(a) / 255) * 100) / 100, 1) }\r\n}\r\n\r\n/**\r\n * Convert HEX string to HSVA color representation.\r\n *\r\n * Input: color in hex3, hex4, hex6 or hex8 format (#fff)\r\n *\r\n * Output: { h: [0,360], s: [0,1], v: [0,1], a: [0,1]}\r\n */\r\nexport function hexStringToHSVA(hexString: string) {\r\n return rgbaToHSVA(hexStringToRGBA(hexString))\r\n}\r\n\r\n/**\r\n * Convert HEX string to HSLA color representation.\r\n *\r\n * Input: color in hex3, hex4, hex6 or hex8 format (#fff)\r\n *\r\n * Output: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n */\r\nexport function hexStringToHSLA(hexString: string) {\r\n return rgbaToHSLA(hexStringToRGBA(hexString))\r\n}\r\n\r\n/**\r\n * Convert alpha value to hex value\r\n *\r\n * Input: [0,1]\r\n *\r\n * Output: alpha in HEX format\r\n */\r\nexport function alphaToHex(alpha: number) {\r\n return Math.max(Math.min(Math.round(alpha * 255), 255), 0)\r\n .toString(16)\r\n .padStart(2, '0')\r\n}\r\n\r\n/**\r\n * Convert RGBA color to HEX string.\r\n *\r\n * Input: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n *\r\n * Output: color in hex6 or hex8 depending on whether or not alpha is enabled\r\n */\r\nexport function rgbaToHexString(color: RGBA, alpha = false) {\r\n const r = color.r.toString(16)\r\n const g = color.g.toString(16)\r\n const b = color.b.toString(16)\r\n const hexString = '#' + r.padStart(2, '0') + g.padStart(2, '0') + b.padStart(2, '0')\r\n\r\n if (!alpha || color.a === 1) {\r\n return hexString\r\n }\r\n\r\n return `${hexString}${alphaToHex(color.a)}`\r\n}\r\n\r\n/**\r\n * Convert HSVA object to HEX string\r\n *\r\n * @see https://css-tricks.com/converting-color-spaces-in-javascript/\r\n *\r\n * Input: { h: [0,360], s: [0,1], v: [0,1], a: [0,1]}\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hsvaToHEXString(color: HSVA, alpha = false) {\r\n const rgbaColor = hsvaToRGBA(color)\r\n\r\n return rgbaToHexString(rgbaColor, alpha)\r\n}\r\n\r\n/**\r\n * Convert HSLA object to HEX string\r\n *\r\n * @see https://css-tricks.com/converting-color-spaces-in-javascript/\r\n *\r\n * Input: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hslaToHexString(color: HSLA, alpha = false) {\r\n const rgbaColor = hslaToRGBA(color)\r\n\r\n return rgbaToHexString(rgbaColor, alpha)\r\n}\r\n\r\n/**\r\n * Convert RGBA color to HSVA\r\n * @see https://stackoverflow.com/a/54070620/6662683\r\n *\r\n * Input: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n *\r\n * Output: { h: [0,360], s: [0,1], v: [0,1], a: [0,1]}\r\n */\r\nexport function rgbaToHSVA(color: RGBA): HSVA {\r\n const r = color.r / 255\r\n const g = color.g / 255\r\n const b = color.b / 255\r\n\r\n const v = Math.max(r, g, b)\r\n const c = v - Math.min(r, g, b)\r\n const h = c && (v === r ? (g - b) / c : v === g ? 2 + (b - r) / c : 4 + (r - g) / c)\r\n\r\n return {\r\n h: 60 * (h < 0 ? h + 6 : h),\r\n s: v ? c / v : 0,\r\n v: v,\r\n a: color.a,\r\n }\r\n}\r\n\r\n/**\r\n * Convert RGBA to HSLA\r\n * @see https://stackoverflow.com/a/54071699/6662683\r\n *\r\n * Input: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n *\r\n * Output: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n */\r\nexport function rgbaToHSLA(color: RGBA): HSLA {\r\n const r = color.r / 255\r\n const g = color.g / 255\r\n const b = color.b / 255\r\n\r\n const v = Math.max(r, g, b)\r\n const c = v - Math.min(r, g, b)\r\n const f = 1 - Math.abs(v + v - c - 1)\r\n const h = c && (v === r ? (g - b) / c : v === g ? 2 + (b - r) / c : 4 + (r - g) / c)\r\n\r\n return {\r\n h: 60 * (h < 0 ? h + 6 : h),\r\n s: f ? c / f : 0,\r\n l: (v + v - c) / 2,\r\n a: color.a,\r\n }\r\n}\r\n\r\n/**\r\n * Convert HSVA color to RGBA\r\n * @see https://stackoverflow.com/a/54024653/6662683\r\n *\r\n * Input: { h: [0,360], s: [0,1], v: [0,1], a: [0,1]}\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hsvaToRGBA(color: HSVA): RGBA {\r\n const f = (n: number, k = (n + color.h / 60) % 6) => color.v - color.v * color.s * Math.max(Math.min(k, 4 - k, 1), 0)\r\n\r\n return {\r\n r: Math.round(f(5) * 255),\r\n g: Math.round(f(3) * 255),\r\n b: Math.round(f(1) * 255),\r\n a: Math.round(color.a * 100) / 100,\r\n }\r\n}\r\n\r\n/**\r\n * Convert HSLA color to RGBA\r\n * @see https://stackoverflow.com/a/54014428/6662683\r\n *\r\n * Input: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function hslaToRGBA(color: HSLA): RGBA {\r\n const a = color.s * Math.min(color.l, 1 - color.l)\r\n const f = (n: number, k = (n + color.h / 30) % 12) => color.l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1)\r\n\r\n return {\r\n r: Math.round(f(0) * 255),\r\n g: Math.round(f(8) * 255),\r\n b: Math.round(f(4) * 255),\r\n a: color.a,\r\n }\r\n}\r\n\r\n/**\r\n * Convert RGBA color to rgba() string\r\n *\r\n * Input: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n *\r\n * Output: rgba(r, g, b, a)\r\n */\r\nexport function rgbaToRGBAString(color: RGBA) {\r\n return `rgba(${color.r}, ${color.g}, ${color.b}, ${color.a})`\r\n}\r\n\r\n/**\r\n * Convert rgba() string to RGBA color\r\n *\r\n * Input: rgba(r, g, b, a)\r\n *\r\n * Output: { r: [0,255], g: [0,255], b: [0,255], a: [0,1]}\r\n */\r\nexport function rgbaStringToObject(color: string) {\r\n const colorParts = /^rgba?\\(([0-9]{1,3})[ ,]+([0-9]{1,3})[ ,]+([0-9]{1,3})[ ,]*([01].?[0-9]*)?\\)$/.exec(color)\r\n const [red, green, blue, alpha = '1'] = colorParts?.slice(1) || [0, 0, 0, 1].map(String)\r\n return {\r\n r: Number.parseInt(red),\r\n g: Number.parseInt(green),\r\n b: Number.parseInt(blue),\r\n a: Number.parseFloat(alpha),\r\n }\r\n}\r\n\r\n/**\r\n * Convert HSLA color to hsla() string\r\n *\r\n * Input: { h: [0,360], s: [0,1], l: [0,1], a: [0,1]}\r\n *\r\n * Output: hsla(h, s, l, a)\r\n */\r\nexport function hslaToHSLAString(color: HSLA) {\r\n return `hsla(${Math.round(color.h)}, ${Math.round(color.s * 10000) / 100}%, ${Math.round(color.l * 10000) / 100}%, ${\r\n color.a\r\n })`\r\n}\r\n\r\nexport function removeHashSymbol(strColor: string) {\r\n return strColor.replace(/#/g, '')\r\n}\r\n\r\n/**\r\n * Check if the param is a valid color by setting it as style\r\n */\r\nexport function isValidColor(strColor: string) {\r\n const isRgb = strColor.startsWith('rgba')\r\n const s = new Option().style\r\n\r\n s.color = isRgb ? strColor : `#${removeHashSymbol(strColor)}`\r\n\r\n return s.color !== ''\r\n}\r\n\r\n/**\r\n * Normalize color to be a hex value\r\n */\r\nexport function convertColorToHEX(strColor: string) {\r\n const isRgb = getIsRgb(strColor)\r\n\r\n if (isRgb) {\r\n return rgbaToHexString(rgbaStringToObject(strColor), true)\r\n }\r\n\r\n return strColor\r\n}\r\n\r\n/**\r\n * Returns true if color is rgb or rgba\r\n */\r\nexport function getIsRgb(strColor: string, isAlphaAllowed = true) {\r\n const rgbKeys = ['rgb']\r\n if (isAlphaAllowed) {\r\n rgbKeys.push('rgba')\r\n }\r\n return rgbKeys.some((startsWith) => strColor.startsWith(startsWith))\r\n}\r\n\r\n/**\r\n * Convert any color format to HSVA (internal color picker representation)\r\n */\r\nexport function getHSVAFromColor(strColor: string) {\r\n if (getIsRgb(strColor)) {\r\n return rgbaToHSVA(rgbaStringToObject(strColor))\r\n }\r\n\r\n return hexStringToHSVA(strColor)\r\n}\r\n\r\n/**\r\n * Stringify HSVA color representation into a output format\r\n */\r\nexport function stringifyHSVAColor(color: HSVA, output: 'rgba' | 'hex', canSelectAlpha?: boolean) {\r\n switch (output) {\r\n case 'rgba':\r\n return rgbaToRGBAString(hsvaToRGBA(color))\r\n default:\r\n return hsvaToHEXString(color, canSelectAlpha)\r\n }\r\n}\r\n\r\n/**\r\n * Get luma value from RGBA color using the Rec. 709 coefficients\r\n * @see https://en.wikipedia.org/wiki/Luma_%28video%29\r\n *\r\n * If luma is >= 165 the foreground color should be dark\r\n */\r\nexport function getLumaFromRGBA(color: RGBA) {\r\n return 0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b\r\n}\r\n\r\n/**\r\n * Checks if luma is >= 165 or alpha < 0.3\r\n */\r\nexport function getIsColorTooLightOrTransparent(color: RGBA) {\r\n return getLumaFromRGBA(color) >= 165 || color.a < 0.5\r\n}\r\n\r\n/**\r\n * Set specific alpha for a hex color\r\n */\r\nexport function getHEXWithSpecificAplha(color: string, alpha = 1) {\r\n const rgbaColor = hexStringToRGBA(color)\r\n return rgbaToHexString({ ...rgbaColor, a: alpha }, true)\r\n}\r\n\r\n/**\r\n * Get rgba from valid color string\r\n */\r\nexport function getRGBAValueFromValidColorString(value: string) {\r\n if (getIsRgb(value)) return rgbaToRGBAString(rgbaStringToObject(value))\r\n return rgbaToRGBAString(hexStringToRGBA(value))\r\n}\r\n","import { useCallback, useMemo } from 'react'\r\n\r\nimport { DraggablePicker, Interaction } from './draggable'\r\nimport { Pointer } from './pointer'\r\nimport { HSVA, hsvaToHEXString } from './util'\r\n\r\ninterface LightnessProps {\r\n color: HSVA\r\n onChange: (color: HSVA) => void\r\n}\r\n\r\nexport function Alpha({ color, onChange }: LightnessProps) {\r\n const changeLightness = useCallback((pos: Interaction) => onChange({ ...color, a: 1 - pos.left }), [onChange, color])\r\n\r\n const gradientPreview = useMemo(() => {\r\n const gradientFrom = hsvaToHEXString({ ...color, a: 1 })\r\n const gradientTo = hsvaToHEXString({ ...color, a: 0 }, true)\r\n\r\n return `linear-gradient(90deg, ${gradientFrom}, ${gradientTo})`\r\n // Don’t recalculate when alpha changes\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [color.h, color.s, color.v])\r\n\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n )\r\n}\r\n","import { Icon } from '../icon'\r\nimport { HSVA, hexStringToHSVA } from './util'\r\n\r\nconst DEFAULT_COLORS = [\r\n { title: 'Rose', value: '#f43f5e' },\r\n { title: 'Pink', value: '#db2777' },\r\n { title: 'Fuchsia', value: '#c026d3' },\r\n { title: 'Purple', value: '#9333ea' },\r\n { title: 'Violet', value: '#7c3aed' },\r\n { title: 'Indigo', value: '#4f46e5' },\r\n { title: 'Blue', value: '#2563eb' },\r\n { title: 'Light Blue', value: '#0284c7' },\r\n { title: 'Cyan', value: '#0891b2' },\r\n { title: 'Teal', value: '#0d9488' },\r\n { title: 'Emerald', value: '#059669' },\r\n { title: 'Green', value: '#16a34a' },\r\n { title: 'Lime', value: '#65a30d' },\r\n { title: 'Yellow', value: '#eab308' },\r\n { title: 'Amber', value: '#d97706' },\r\n { title: 'Red', value: '#dc2626' },\r\n]\r\n\r\ninterface ColorItem {\r\n /**\r\n * Name of the color\r\n */\r\n title: string\r\n\r\n /**\r\n * Hex value\r\n */\r\n value: string\r\n}\r\n\r\ninterface ColorPaletteProps {\r\n /**\r\n * Current selected color in HEX format (supports HEX8 for alpha)\r\n */\r\n color: string\r\n\r\n /**\r\n * List of colors to display in the palette\r\n *\r\n * @default DEFAULT_COLORS\r\n */\r\n colors?: ColorItem[]\r\n\r\n /**\r\n * Callback when user picks a color\r\n */\r\n onChange: (color: string, originalColor: HSVA) => void\r\n}\r\n\r\nexport function ColorPalette({ color, colors = DEFAULT_COLORS, onChange }: ColorPaletteProps) {\r\n const lowerCaseColor = color.toLowerCase()\r\n\r\n return (\r\n
\r\n {colors.map((colorObj) => {\r\n const isSelected = lowerCaseColor.startsWith(colorObj.value)\r\n return (\r\n onChange(colorObj.value, hexStringToHSVA(colorObj.value))}\r\n >\r\n {isSelected && }\r\n
\r\n )\r\n })}\r\n
\r\n )\r\n}\r\n","import { useCallback, useMemo } from 'react'\r\n\r\nimport { DraggablePicker, Interaction } from './draggable'\r\nimport { Pointer } from './pointer'\r\nimport { HSVA, hsvaToHEXString } from './util'\r\n\r\ninterface HueSaturationProps {\r\n color: HSVA\r\n onChange: (color: HSVA) => void\r\n}\r\n\r\nfunction getPositionFromHSLA(color: HSVA) {\r\n return {\r\n left: color.h / 360,\r\n top: 1 - color.s,\r\n }\r\n}\r\n\r\nexport function HueSaturation({ color, onChange }: HueSaturationProps) {\r\n const position = useMemo(() => getPositionFromHSLA(color), [color])\r\n\r\n const colorPreview = useMemo(() => hsvaToHEXString({ h: color.h, s: color.s, v: 1, a: 1 }), [color.h, color.s])\r\n\r\n const changeSaturation = useCallback(\r\n (pos: Interaction) =>\r\n onChange({\r\n h: Math.round(pos.left * 360),\r\n s: 1 - pos.top,\r\n v: 1,\r\n a: color.a,\r\n }),\r\n [color.a, onChange]\r\n )\r\n\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n )\r\n}\r\n","import { useCallback, useMemo } from 'react'\r\n\r\nimport { DraggablePicker, Interaction } from './draggable'\r\nimport { Pointer } from './pointer'\r\nimport { HSVA, hsvaToHEXString } from './util'\r\n\r\ninterface LightnessProps {\r\n color: HSVA\r\n onChange: (color: HSVA) => void\r\n}\r\n\r\nexport function Lightness({ color, onChange }: LightnessProps) {\r\n const changeLightness = useCallback((pos: Interaction) => onChange({ ...color, v: 1 - pos.left }), [onChange, color])\r\n\r\n const colorPreview = useMemo(\r\n () => hsvaToHEXString({ h: color.h, s: color.s, v: color.v, a: 1 }),\r\n [color.h, color.s, color.v]\r\n )\r\n\r\n const gradientPreview = useMemo(() => {\r\n const gradientFrom = hsvaToHEXString({ h: color.h, s: color.s, v: 1, a: 1 })\r\n const gradientTo = hsvaToHEXString({ h: color.h, s: color.s, v: 0, a: 1 })\r\n\r\n return `linear-gradient(90deg, ${gradientFrom}, ${gradientTo})`\r\n }, [color.h, color.s])\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport React from 'react'\r\n\r\nimport { Icon, IconNameType, isValidIconName } from '../icon'\r\nimport { getIsColorTooLightOrTransparent, hexStringToRGBA } from './util'\r\n\r\ninterface ColorPreviewProps {\r\n /**\r\n * Name of an icon or JSX.Element\r\n */\r\n icon?: JSX.Element | IconNameType\r\n\r\n /**\r\n * One or more colors to show in the preview\r\n */\r\n color: string | string[]\r\n\r\n /**\r\n * Wrapper classname\r\n */\r\n className?: string\r\n}\r\n\r\nexport function ColorPreview({ icon, color, className }: ColorPreviewProps) {\r\n const colors = Array.isArray(color) ? color : [color]\r\n const isTooLight = getIsColorTooLightOrTransparent(hexStringToRGBA(colors[0]))\r\n return (\r\n \r\n {icon && (\r\n
\r\n {isValidIconName(icon) ? (\r\n \r\n ) : (\r\n icon\r\n )}\r\n
\r\n )}\r\n {colors.map((color, index) => (\r\n //   has to be there because of a bug on safari which ignores h-full when empty element\r\n
\r\n  \r\n
\r\n ))}\r\n
\r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport React, { ForwardedRef, useCallback, useEffect, useState } from 'react'\r\n\r\nimport { Input, InputComponentProps } from '../input'\r\nimport { ColorPreview } from './color-preview'\r\nimport { ColorPickerProps } from './picker'\r\nimport * as colorUtil from './util'\r\n\r\ninterface PickerInputProps extends Omit {\r\n color: ColorPickerProps['color']\r\n onChange: ColorPickerProps['onChange']\r\n\r\n /*\r\n * Is color preview square visible\r\n *\r\n * @default true\r\n * */\r\n hasColorPreview?: boolean\r\n}\r\nexport const PickerInput = React.forwardRef(\r\n (\r\n { color, inputClass, hasColorPreview = true, onChange, ...props }: PickerInputProps,\r\n ref: ForwardedRef\r\n ) => {\r\n const [colorInput, setColorInput] = useState(colorUtil.removeHashSymbol(color))\r\n const isRgba = colorUtil.getIsRgb(colorInput)\r\n\r\n useEffect(() => {\r\n setColorInput(colorUtil.removeHashSymbol(color))\r\n }, [color])\r\n\r\n const handleColorInputChange = useCallback(\r\n (event) => {\r\n const value = colorUtil.removeHashSymbol(event.currentTarget.value)\r\n const isRgba = value.startsWith('rgba')\r\n const colorValue = isRgba ? value : `#${value}`\r\n\r\n setColorInput(value)\r\n if ((value.length >= 6 || (isRgba && value.length >= 16)) && colorUtil.isValidColor(colorValue)) {\r\n onChange(colorValue, colorUtil.hexStringToHSVA(colorValue))\r\n }\r\n },\r\n [onChange]\r\n )\r\n return (\r\n \r\n {hasColorPreview && }\r\n {!isRgba && #}\r\n
\r\n }\r\n onChange={handleColorInputChange}\r\n />\r\n )\r\n }\r\n)\r\n","import classnames from 'classnames'\r\nimport React, { ReactNode, useCallback, useEffect, useRef, useState } from 'react'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { Button } from '../button'\r\nimport { Popover, PopoverTrigger, usePopoverState } from '../popover'\r\nimport { Alpha } from './alpha'\r\nimport { ColorPalette } from './color-palette'\r\nimport { HueSaturation } from './hue-saturation'\r\nimport { Lightness } from './lightness'\r\nimport { PickerInput } from './picker-input'\r\nimport * as colorUtil from './util'\r\n\r\nexport interface ColorPickerProps {\r\n /**\r\n * The selected color in HEX format (supports HEX8 for alpha)\r\n */\r\n color: string\r\n\r\n /**\r\n * Whether or not the user is able to select custom color\r\n *\r\n * @default true\r\n */\r\n canSelectCustom?: boolean\r\n\r\n /**\r\n * Whether or not the user is able to change alpha channel. Only applicable\r\n * when `canSelectCustom` is true\r\n *\r\n * @default true\r\n */\r\n canSelectAlpha?: boolean\r\n\r\n /**\r\n * Sets the output format for the color picker\r\n *\r\n * @default 'hex'\r\n */\r\n outputFormat?: 'hex' | 'rgba'\r\n\r\n /**\r\n * Callback when user changes color. Use the second parameter to do color space\r\n * conversions otherwise the color could differ due to rounding\r\n */\r\n onChange: (color: string, originalColor: colorUtil.HSVA) => void\r\n\r\n /**\r\n * Callback when user clicks on a palette item. Used to close popover\r\n */\r\n onPaletteItemClick?: () => void\r\n}\r\n\r\nexport function ColorPicker({\r\n color,\r\n canSelectCustom = true,\r\n canSelectAlpha = true,\r\n outputFormat = 'hex',\r\n onChange,\r\n onPaletteItemClick,\r\n}: ColorPickerProps) {\r\n const cachedColor = useRef(color)\r\n const [hsvaColor, setColor] = useState(colorUtil.getHSVAFromColor(color))\r\n\r\n /**\r\n * Update state if the color from outside changed\r\n */\r\n useEffect(() => {\r\n const currentColor = colorUtil.removeHashSymbol(cachedColor.current)\r\n const newColor = colorUtil.removeHashSymbol(color)\r\n\r\n if (currentColor === newColor || !colorUtil.isValidColor(newColor)) return\r\n\r\n cachedColor.current = color\r\n setColor(colorUtil.getHSVAFromColor(color))\r\n }, [color])\r\n\r\n /**\r\n * Handle color change\r\n * 1. update cache so we can correctly check when outside color updates\r\n * 2. Update internal color representation\r\n * 3. call onChange with string color\r\n */\r\n const onChangeCallback = useCallback(\r\n (color: colorUtil.HSVA) => {\r\n const stringColor = colorUtil.stringifyHSVAColor(color, outputFormat, canSelectAlpha)\r\n cachedColor.current = stringColor\r\n onChange(stringColor, color)\r\n setColor(color)\r\n },\r\n [onChange, canSelectAlpha, outputFormat]\r\n )\r\n\r\n const onSetCustomCodeClick = useCallback(() => {\r\n const value = prompt('Enter a color code')?.trim()\r\n\r\n if (!value) return\r\n\r\n const isValid = colorUtil.isValidColor(value)\r\n\r\n if (!isValid) {\r\n return alert('The code is not a valid color')\r\n }\r\n\r\n onChangeCallback(colorUtil.getHSVAFromColor(value))\r\n }, [onChangeCallback])\r\n\r\n return (\r\n
\r\n {canSelectCustom && (\r\n <>\r\n {isMobile() && (\r\n \r\n )}\r\n \r\n \r\n\r\n {canSelectAlpha && }\r\n \r\n )}\r\n\r\n \r\n {\r\n onPaletteItemClick?.()\r\n onChangeCallback({ ...orignalColor, a: hsvaColor.a })\r\n }}\r\n />\r\n
\r\n \r\n )\r\n}\r\n\r\ninterface InputColorPickerProps extends ColorPickerProps {\r\n /**\r\n * Label for the input\r\n */\r\n label?: ReactNode\r\n inputDataTestId?: string\r\n}\r\n\r\nexport function InputColorPicker({ label, inputDataTestId, onChange, ...props }: InputColorPickerProps) {\r\n const popoverState = usePopoverState()\r\n const canSelectCustom = props.canSelectCustom !== false\r\n const isMobileDevice = isMobile()\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {\r\n if (canSelectCustom) return\r\n popoverState.hide()\r\n }}\r\n />\r\n \r\n \r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport React from 'react'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { Button, ButtonComponentProps, ButtonRounding, ButtonSizeType } from '../button'\r\nimport { ButtonGroup } from '../button-group'\r\nimport { IconNameType } from '../icon'\r\nimport { Popover, PopoverProps, PopoverTrigger, usePopoverState } from '../popover'\r\nimport { ColorPreview } from './color-preview'\r\nimport { ColorPicker, ColorPickerProps } from './picker'\r\nimport { PickerInput } from './picker-input'\r\nimport * as colorUtil from './util'\r\n\r\ninterface MultiColorPickerProps extends ColorPickerProps {\r\n /**\r\n * Label for color text input\r\n *\r\n * @default undefined\r\n */\r\n colorInputLabel?: string\r\n}\r\n\r\nexport function MultiColorPicker({\r\n colorInputLabel,\r\n onChange,\r\n canSelectCustom = true,\r\n ...props\r\n}: MultiColorPickerProps) {\r\n const isMobileDevice = isMobile()\r\n\r\n return (\r\n <>\r\n {canSelectCustom && !isMobileDevice && (\r\n
\r\n \r\n
\r\n )}\r\n \r\n {}} />\r\n \r\n \r\n )\r\n}\r\n\r\ninterface ColorTabButtonProps extends ButtonComponentProps {\r\n /*\r\n * Preview color\r\n * */\r\n color: string\r\n}\r\n\r\nexport function ColorTabButton({ color, children, ...props }: ColorTabButtonProps) {\r\n return (\r\n }\r\n {...props}\r\n >\r\n {children}\r\n \r\n )\r\n}\r\n\r\ntype ButtonColorProperties = { color: string; label: string }\r\n\r\ninterface ButtonColorPickerProps\r\n extends Omit {\r\n /**\r\n * Temporary prop to enable/disable multi picker funcionality,\r\n * in the future we'll only use secondaryColor prop to decide if the picker is multi picker or not\r\n *\r\n * @default undefined\r\n */\r\n isMultiPicker?: boolean\r\n\r\n /**\r\n * Button classname\r\n */\r\n className?: string\r\n\r\n /**\r\n * Array of objects with color and value\r\n */\r\n colors: ColorType[]\r\n\r\n /**\r\n * Color onchange callback\r\n */\r\n onChange: (colors: ColorType[], originalColor: colorUtil.HSVA) => void\r\n\r\n /**\r\n * Button size\r\n *\r\n * @default undefined\r\n */\r\n size?: ButtonSizeType\r\n /**\r\n * Label for color text input\r\n *\r\n * @default undefined\r\n */\r\n colorInputLabel?: string\r\n\r\n /**\r\n * Name of an icon or JSX.Element\r\n */\r\n icon?: JSX.Element | IconNameType\r\n\r\n /**\r\n * Hides color picker when clicked outside of popover,\r\n * works with changing focus from the trigger component to another one\r\n *\r\n * @default true\r\n */\r\n hideOnClickOutside: PopoverProps['hideOnClickOutside']\r\n\r\n /**\r\n * Popover overlay click callback, if nothing's provided it calls hide when clicked outside of popover on its overlay\r\n * If false is provided, overlay click calls hide func on popover state object\r\n *\r\n * @default undefined\r\n */\r\n onOverlayClick?: (() => void) | false\r\n\r\n /**\r\n * Identifier for e2e testing\r\n *\r\n * @default undefined\r\n */\r\n buttonPickerDataTestId?: string\r\n}\r\n\r\nexport function ButtonColorPicker({\r\n size,\r\n icon,\r\n colors,\r\n className,\r\n onChange,\r\n buttonPickerDataTestId,\r\n hideOnClickOutside = true,\r\n onOverlayClick,\r\n ...props\r\n}: ButtonColorPickerProps) {\r\n const popoverState = usePopoverState()\r\n const isMultiPicker = !!props.isMultiPicker && colors.length > 1\r\n const [activeColorIndex, setActiveColorIndex] = React.useState(0)\r\n const handleColorChange = React.useCallback(\r\n (color: string, originalColor: colorUtil.HSVA) => {\r\n onChange(\r\n colors.map((colorObject, index) => (index === activeColorIndex ? { ...colorObject, color } : colorObject)),\r\n originalColor\r\n )\r\n },\r\n [activeColorIndex, colors, onChange]\r\n )\r\n return (\r\n <>\r\n \r\n color)}\r\n className={classnames('h-full w-full', ButtonRounding.small)}\r\n />\r\n \r\n \r\n {isMultiPicker && (\r\n
\r\n \r\n {colors.map(({ color, label }, index) => (\r\n setActiveColorIndex(index)}\r\n >\r\n {label}\r\n \r\n ))}\r\n \r\n
\r\n )}\r\n \r\n \r\n \r\n )\r\n}\r\n","/**\r\n * Used for reakit as the duration of a open/close animation. The animation itself is done using css\r\n */\r\nexport const COMPONENT_ANIMATION_DURATION = 250\r\n","import copy from 'copy-to-clipboard'\r\nimport React from 'react'\r\n\r\nimport { Button } from '../button'\r\nimport { InputProps, Textarea } from '../input'\r\n\r\ninterface Props extends Pick {\r\n className?: string\r\n text: string\r\n bottomLeftContent?: React.ReactNode\r\n}\r\n\r\nexport const CopyToClipboard: React.FC = ({ className, label, text, bottomLeftContent }) => {\r\n const [isCopied, setIsCopied] = React.useState(false)\r\n\r\n const handleCopyToClipboard = React.useCallback(() => {\r\n setIsCopied(true)\r\n copy(text)\r\n }, [text])\r\n\r\n React.useEffect(() => {\r\n let timeout: NodeJS.Timeout\r\n const resetTimer = () => {\r\n if (!timeout) return\r\n clearTimeout(timeout)\r\n }\r\n if (isCopied) {\r\n resetTimer()\r\n timeout = setTimeout(() => {\r\n setIsCopied(false)\r\n }, 2000)\r\n }\r\n\r\n return () => {\r\n resetTimer()\r\n }\r\n }, [isCopied])\r\n\r\n return (\r\n
\r\n e.currentTarget.select()}\r\n inputClass=\"h-12\"\r\n data-testid=\"copy-to-clipboard-textarea\"\r\n value={text}\r\n />\r\n
\r\n {bottomLeftContent &&
{bottomLeftContent}
}\r\n \r\n {isCopied ? 'Copied' : 'Copy'}\r\n \r\n
\r\n
\r\n )\r\n}\r\n","import * as React from 'react'\r\nimport { CalendarProps } from 'react-calendar'\r\n\r\nimport { Box } from '../box'\r\nimport { ZIndexContext } from '../dialog'\r\nimport { Popover, PopoverTrigger, usePopoverState } from '../popover'\r\nimport { Spinner } from '../spinner'\r\n\r\nconst DatePickerComponent = React.lazy(() => import('./picker'))\r\n\r\ntype RangePickerCallback = (value: [Date, Date], ev: React.ChangeEvent) => void\r\ntype PickerCallback = (value: Date, ev: React.ChangeEvent) => void\r\n\r\ninterface DatePickerProps extends Omit {\r\n /**\r\n * Trigger element for the picker\r\n */\r\n children: JSX.Element\r\n\r\n onChange: PickerCallback | RangePickerCallback\r\n}\r\n\r\nexport function DatePicker({ children, ...props }: DatePickerProps) {\r\n const popover = usePopoverState()\r\n\r\n return (\r\n <>\r\n \r\n {(triggerProps: React.HTMLProps) =>\r\n React.Children.map(children, (child) => {\r\n if (React.isValidElement(child))\r\n return React.cloneElement(child, { ...triggerProps, ...(child.props as any) })\r\n })\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n >\r\n ) => {\r\n popover.hide()\r\n props.onChange?.(value, ev)\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nexport interface DelayedProps {\r\n /**\r\n * The delay in milliseconds before the component is rendered.\r\n *\r\n * @default 300\r\n */\r\n delay?: number\r\n\r\n /**\r\n * Delay in milliseconds before rendering timeout state.\r\n */\r\n timeout?: number\r\n\r\n /**\r\n * Throw on timeout (suspense)\r\n */\r\n throwOnTimeout?: boolean\r\n\r\n /**\r\n * Component visible during the delay.\r\n * If rendering text, wrap it in a `span` to prevent error — see PR#608\r\n */\r\n delayComponent?: React.ReactNode\r\n\r\n /**\r\n * Component visible when timeout is over.\r\n * If rendering text, wrap it in a `span` to prevent error — see PR#608\r\n */\r\n timeoutComponent?: React.ReactNode\r\n\r\n /**\r\n * Component visible when delay is over.\r\n * If rendering text, wrap it in a `span` to prevent error — see PR#608\r\n */\r\n children?: React.ReactNode\r\n}\r\n\r\nexport function Delayed({\r\n delay = 300,\r\n timeout = 0,\r\n throwOnTimeout = false,\r\n delayComponent,\r\n timeoutComponent,\r\n children,\r\n}: DelayedProps) {\r\n const [visible, setVisible] = React.useState(false)\r\n const [hasTimedOut, setHasTimedOut] = React.useState(false)\r\n\r\n React.useEffect(() => {\r\n const visibilityTimeout = window.setTimeout(() => setVisible(true), delay)\r\n\r\n let failedTimeout: number\r\n if (timeout > 0) {\r\n failedTimeout = window.setTimeout(() => {\r\n setHasTimedOut(true)\r\n if (throwOnTimeout) throw new Error()\r\n }, timeout)\r\n }\r\n\r\n return () => {\r\n clearTimeout(visibilityTimeout)\r\n clearTimeout(failedTimeout)\r\n }\r\n }, [delay, timeout, throwOnTimeout])\r\n\r\n if (!visible) return <>{delayComponent}\r\n\r\n if (hasTimedOut) {\r\n return <>{timeoutComponent}\r\n }\r\n\r\n return <>{children}\r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Dialog'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\n\r\nexport const ZIndexContext = React.createContext('z-50')\r\n\r\nexport function useZIndex() {\r\n return React.useContext(ZIndexContext)\r\n}\r\n\r\nexport type DialogStateReturn = ReturnType\r\n/**\r\n * Hook which provides state to dialogs\r\n */\r\nexport function useDialogState(settings?: Reakit.DialogInitialState) {\r\n return Reakit.useDialogState({ ...settings, animated: COMPONENT_ANIMATION_DURATION })\r\n}\r\n\r\nexport const DialogDragContext = React.createContext<{\r\n enabled?: boolean\r\n handleRef?: React.RefObject\r\n boxPosition: { x: number; y: number }\r\n resetBoxPosition: () => void\r\n setBoxPosition: React.Dispatch>\r\n}>({\r\n enabled: false,\r\n handleRef: undefined,\r\n boxPosition: { x: 0, y: 0 },\r\n resetBoxPosition: () => {},\r\n setBoxPosition: () => {},\r\n})\r\n\r\n/**\r\n * Hook which allows an element on the page to become draggable\r\n */\r\nexport function useDrag(enabled?: boolean) {\r\n const dragging = React.useRef(false)\r\n const handleRef = React.useRef(null)\r\n const handleElement = handleRef.current\r\n\r\n /**\r\n * Set box position in both state for the component to re-render and as a ref\r\n * so that we don’t have to re-run the whole effect on every change\r\n */\r\n const [boxPosition, setBoxPosition] = React.useState({ x: 0, y: 0 })\r\n const boxPositionRef = React.useRef({ x: 0, y: 0 })\r\n const dragDiff = React.useRef({ x: 0, y: 0 })\r\n\r\n const { current: resetBoxPosition } = React.useRef(() => {\r\n setBoxPosition({ x: 0, y: 0 })\r\n })\r\n\r\n React.useEffect(() => {\r\n boxPositionRef.current = { ...boxPosition }\r\n }, [boxPosition])\r\n\r\n React.useEffect(() => {\r\n if (!enabled || !handleElement || isMobile()) return\r\n\r\n const onMouseDown = (ev: MouseEvent) => {\r\n dragging.current = true\r\n\r\n dragDiff.current = {\r\n x: ev.pageX - boxPositionRef.current.x - window.scrollX,\r\n y: ev.pageY - boxPositionRef.current.y - window.scrollY,\r\n }\r\n }\r\n\r\n const onMouseUp = () => {\r\n dragging.current = false\r\n }\r\n\r\n const onMouseMove = (ev: MouseEvent) => {\r\n if (!dragging.current) return\r\n\r\n const x = ev.pageX - dragDiff.current.x - window.scrollX\r\n const y = ev.pageY - dragDiff.current.y - window.scrollY\r\n\r\n setBoxPosition({ x, y })\r\n }\r\n\r\n handleElement.addEventListener('pointerdown', onMouseDown)\r\n handleElement.addEventListener('dblclick', resetBoxPosition)\r\n window.addEventListener('pointerup', onMouseUp)\r\n document.body.addEventListener('pointermove', onMouseMove)\r\n\r\n return () => {\r\n handleElement.removeEventListener('pointerdown', onMouseDown)\r\n handleElement.removeEventListener('dblclick', resetBoxPosition)\r\n window.removeEventListener('pointerup', onMouseUp)\r\n document.body.removeEventListener('pointermove', onMouseMove)\r\n }\r\n }, [enabled, handleElement, resetBoxPosition])\r\n\r\n return {\r\n enabled,\r\n handleRef,\r\n boxPosition,\r\n setBoxPosition,\r\n resetBoxPosition,\r\n }\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { useElementMeasure } from '../../hooks/use-element-measure'\r\nimport { Box, BoxProps } from '../box'\r\nimport { DialogDragContext } from './hooks'\r\n\r\n/**\r\n * Public props for the component\r\n */\r\nexport type DialogBoxProps = BoxProps\r\n\r\ninterface DialogBoxOwnProps extends DialogBoxProps {\r\n /**\r\n * This callback serves as a way to account for the time between dialog close\r\n * and animation finish. The box isn’t rendered when the dialog closes but we still\r\n * want to display content when the dialog is closing\r\n */\r\n onUnmount?: () => void\r\n}\r\n\r\n/**\r\n * Dialog content container\r\n */\r\nexport function DialogBox({ onUnmount, style, ...props }: React.PropsWithChildren) {\r\n const wrapperRef = React.useRef(null)\r\n const { setElementRef, elementHeight } = useElementMeasure()\r\n const dialogDrag = React.useContext(DialogDragContext)\r\n\r\n React.useEffect(() => {\r\n const onResize = () => {\r\n const { top = 0, bottom = 0, left = 0, right = 0 } = dialogDrag.handleRef?.current?.getBoundingClientRect() ?? {}\r\n const { clientHeight, clientWidth } = window.document.documentElement\r\n if (top < 0 || bottom > clientHeight || left < 0 || right > clientWidth) {\r\n dialogDrag.resetBoxPosition()\r\n }\r\n }\r\n\r\n window.addEventListener('resize', onResize)\r\n onResize()\r\n\r\n return () => {\r\n window.removeEventListener('resize', onResize)\r\n onUnmount?.()\r\n }\r\n // Set up an effect which only calls resetBoxPosition which is ref fn with state setter call and the unmount callback\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [])\r\n\r\n React.useEffect(() => {\r\n setElementRef(wrapperRef.current)\r\n }, [setElementRef])\r\n\r\n React.useEffect(() => {\r\n dialogDrag.setBoxPosition((prevPosition) => {\r\n const { top = 0 } = dialogDrag.handleRef?.current?.getBoundingClientRect() ?? {}\r\n return { ...prevPosition, y: prevPosition.y - Math.min(top, 0) }\r\n })\r\n // We want to call it only on elementHeight change\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [elementHeight])\r\n\r\n const dialogBoxStyle = React.useMemo(() => {\r\n if (dialogDrag.enabled) {\r\n return { ...style, transform: `translate3d(${dialogDrag.boxPosition.x}px, ${dialogDrag.boxPosition.y}px, 0)` }\r\n }\r\n return style\r\n }, [style, dialogDrag])\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n}\r\n","/**\r\n * The backdrop of the dialog, closes the dialog on click\r\n */\r\nexport function DialogOverlay(props: { onClick: () => void }) {\r\n return
props.onClick()} />\r\n}\r\n","export function getExtendedDialogState(state: { visible: boolean; animating: boolean }) {\r\n return {\r\n isFullyOpened: state.visible && !state.animating,\r\n isFullyClosed: !state.visible && !state.animating,\r\n }\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Dialog'\r\nimport { Portal } from 'reakit/Portal'\r\n\r\nimport { DialogBox, DialogBoxProps } from './dialog-box'\r\nimport { DialogOverlay } from './dialog-overlay'\r\nimport { DialogDragContext, DialogStateReturn, ZIndexContext, useDrag } from './hooks'\r\nimport { getExtendedDialogState } from './utils'\r\n\r\nexport enum DialogType {\r\n modal,\r\n drawer,\r\n}\r\n\r\nexport interface DialogProps extends DialogBoxProps, Pick {\r\n /**\r\n * The returned object from `useDialogState`\r\n */\r\n state: DialogStateReturn\r\n\r\n /**\r\n * Any additional props to the Reakit Dialog component\r\n */\r\n finalFocusRef?: React.RefObject\r\n\r\n /**\r\n * Callback which is called when the dialog closes and all animations complete\r\n */\r\n onHide?: () => void\r\n\r\n /**\r\n * Callback which is called when the dialog overlay is clicked\r\n * default behavior (closing the dialog) will be overridden so it has to be called manually\r\n */\r\n onOverlayClick?: () => void\r\n\r\n /**\r\n * Sets if the dialog can be dragged across the screen\r\n *\r\n * @default false\r\n */\r\n isDraggable?: boolean\r\n\r\n /**\r\n * Type of dialog\r\n *\r\n * @default modal\r\n */\r\n type?: keyof typeof DialogType\r\n\r\n /**\r\n * Sets if backdrop overlay prevents interaction with rest of page, onOverlayClick will have no effect if isBackdropDisabled is true\r\n *\r\n * @default false\r\n */\r\n isBackdropDisabled?: boolean\r\n}\r\n\r\nconst DIALOG_BACKDROP_WIDTH_CSS_VAR = '--dialog-backgrop-width'\r\n\r\n/**\r\n * The actual dialog component which renders overlay, box and handles all the\r\n * functionality like focus trapping, etc.\r\n */\r\nexport function Dialog({\r\n state,\r\n finalFocusRef,\r\n onHide,\r\n onOverlayClick,\r\n children,\r\n hide,\r\n hideOnEsc,\r\n isDraggable = false,\r\n isBackdropDisabled = false,\r\n type = 'modal',\r\n 'aria-label': ariaLabel,\r\n ...props\r\n}: React.PropsWithChildren) {\r\n const dialogDrag = useDrag(isDraggable)\r\n const { isFullyClosed } = getExtendedDialogState(state)\r\n\r\n React.useEffect(() => {\r\n const onResize = () => {\r\n // Save to css var because it can change and that could make modal dialog jump on open\r\n document.body.style.setProperty(DIALOG_BACKDROP_WIDTH_CSS_VAR, `${document.documentElement.clientWidth}px`)\r\n }\r\n\r\n window.addEventListener('resize', onResize)\r\n onResize()\r\n\r\n return () => {\r\n window.removeEventListener('resize', onResize)\r\n }\r\n }, [])\r\n\r\n const DialogWrapper = state.modal ? React.Fragment : Portal\r\n\r\n return (\r\n \r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...innerProps }) => {\r\n if (isFullyClosed) return null\r\n\r\n return (\r\n \r\n \r\n {!isBackdropDisabled && }\r\n \r\n \r\n {\r\n onHide?.()\r\n dialogDrag.resetBoxPosition()\r\n }}\r\n >\r\n {children}\r\n \r\n \r\n \r\n
\r\n \r\n )\r\n }}\r\n \r\n \r\n )\r\n}\r\n","import { disableBodyScroll, enableBodyScroll } from 'body-scroll-lock'\r\nimport classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\n\r\ninterface DialogBodyProps extends React.HTMLProps {\r\n /**\r\n * Whether or not the dialog body will have padding\r\n *\r\n * @default true\r\n */\r\n hasPadding?: boolean\r\n}\r\n\r\n/**\r\n * Content wrapper which handles scrolling on mobile\r\n */\r\nexport function DialogBody({ hasPadding = true, ...props }: React.PropsWithChildren) {\r\n const scrollDivRef = React.useRef(null)\r\n\r\n React.useEffect(() => {\r\n const scrollBox = scrollDivRef.current\r\n\r\n if (isMobile() && scrollBox) {\r\n disableBodyScroll(scrollBox)\r\n\r\n return () => enableBodyScroll(scrollBox)\r\n }\r\n }, [])\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { Heading, Paragraph } from '../typography'\r\nimport { Dialog } from './dialog'\r\nimport { DialogBody } from './dialog-body'\r\nimport { DialogStateReturn } from './hooks'\r\n\r\ninterface ConfirmationDialogProps {\r\n state: DialogStateReturn\r\n title: React.ReactNode\r\n actions: React.ReactNode\r\n 'aria-label': string\r\n}\r\n\r\nexport function ConfirmationDialog(props: React.PropsWithChildren) {\r\n return (\r\n \r\n \r\n \r\n {props.title}\r\n \r\n {props.children}\r\n
{props.actions}
\r\n
\r\n
\r\n )\r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Dialog'\r\n\r\nimport { DropdownContext } from '../dropdown'\r\nimport { DialogStateReturn } from './hooks'\r\n\r\ninterface DialogButtonProps extends Reakit.DialogDisclosureHTMLProps {\r\n state: DialogStateReturn\r\n}\r\n/**\r\n * The trigger button component which handles ref & focus return, etc.\r\n */\r\nexport const DialogTrigger = React.forwardRef(\r\n ({ state, ...props }: DialogButtonProps, ref: React.ForwardedRef) => {\r\n const dropdownContext = React.useContext(DropdownContext)\r\n\r\n return (\r\n ) => {\r\n // Close dropdown if we’re inside one\r\n dropdownContext?.root.hide()\r\n props.onClick?.(ev)\r\n }}\r\n >\r\n {props.children}\r\n \r\n )\r\n }\r\n)\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\n/**\r\n * Footer container which renders border and aligns items to right\r\n */\r\nexport function DialogFooter(props: React.PropsWithChildren>) {\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Button } from '../button'\r\nimport { Icon } from '../icon'\r\nimport { Heading } from '../typography'\r\nimport { DialogDragContext } from './hooks'\r\n\r\ninterface DialogHeaderProps {\r\n /**\r\n * Callback when user clicks on close button. The button will be hidden if not set\r\n */\r\n onCloseClick?: () => void\r\n\r\n /**\r\n * Additional class names for the component\r\n */\r\n className?: string\r\n}\r\n\r\n/**\r\n * Component which renders title and a close button\r\n */\r\nexport function DialogHeader({ onCloseClick, children, className }: React.PropsWithChildren) {\r\n const dialogDrag = React.useContext(DialogDragContext)\r\n\r\n return (\r\n \r\n {children && (\r\n \r\n {children}\r\n \r\n )}\r\n {onCloseClick && (\r\n \r\n \r\n \r\n )}\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Menu'\r\n\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\n\r\nexport const DropdownContext = React.createContext<{\r\n parent: Reakit.MenuStateReturn\r\n root: Reakit.MenuStateReturn\r\n} | null>(null)\r\n\r\nexport function useDropdownState(settings?: Reakit.MenuInitialState) {\r\n const context = React.useContext(DropdownContext)\r\n\r\n return Reakit.useMenuState({\r\n ...settings,\r\n loop: true,\r\n animated: COMPONENT_ANIMATION_DURATION,\r\n unstable_virtual: true,\r\n unstable_offset: context?.root ? [-5, 4] : [0, 5],\r\n modal: false,\r\n })\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Menu'\r\nimport { Portal } from 'reakit/Portal'\r\n\r\nimport { Box, BoxProps, BoxRounding } from '../box'\r\nimport { useZIndex } from '../dialog'\r\nimport { DropdownContext, useDropdownState } from './hooks'\r\n\r\ninterface DropdownBaseProps extends Omit {\r\n /**\r\n * Trigger button for the dropdown\r\n */\r\n label: JSX.Element\r\n\r\n /**\r\n * @private\r\n * Any additional props to the trigger button. Used by nested dropdown wrapper\r\n */\r\n triggerProps?: Reakit.MenuButtonHTMLProps\r\n\r\n /**\r\n * Rounding of all trigger button, dropdown wrapper and dropdown items\r\n */\r\n rounding?: keyof typeof BoxRounding\r\n}\r\n\r\ninterface RootDropdownProps {\r\n /**\r\n * The returned object from `useDropdownState`. For nested dropdowns use the `isNested` prop\r\n */\r\n state: Reakit.MenuStateReturn\r\n isNested?: never\r\n /**\r\n * When set to true the dropdown will not render in Portal and will not use position absolute + transform.\r\n */\r\n isStatic?: boolean\r\n}\r\n\r\ninterface NestedDropdownProps {\r\n state?: never\r\n /**\r\n * When set to true the dropdown will compute its own state. Only usable with\r\n * nested dropdowns\r\n */\r\n isNested: true\r\n\r\n isStatic?: never\r\n}\r\n\r\ntype DropdownProps = DropdownBaseProps & (RootDropdownProps | NestedDropdownProps)\r\n\r\nfunction DropdownComponent(\r\n {\r\n label,\r\n triggerProps,\r\n state,\r\n 'aria-label': ariaLabel,\r\n children,\r\n isNested,\r\n rounding,\r\n isStatic,\r\n ...props\r\n }: React.PropsWithChildren,\r\n ref: React.ForwardedRef\r\n) {\r\n const zIndex = useZIndex()\r\n const context = React.useContext(DropdownContext)\r\n // Required due to the way conditional props work\r\n const dropdownState = state!\r\n if (!isNested && !dropdownState) {\r\n throw new Error('Dropdowns require either `state` or `isNested` prop defined!')\r\n }\r\n\r\n const ContainerElement = React.useRef(isNested || isStatic ? React.Fragment : Portal).current\r\n\r\n return (\r\n <>\r\n \r\n {(buttonProps) =>\r\n React.cloneElement(label, {\r\n ...buttonProps,\r\n ...label.props,\r\n rounding,\r\n active: label.props.active ?? dropdownState.visible,\r\n })\r\n }\r\n \r\n \r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...innerProps }) => (\r\n \r\n \r\n \r\n {React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) return child\r\n\r\n if (child.type === Dropdown) {\r\n return {child}\r\n }\r\n\r\n return React.cloneElement(child, {\r\n ...child.props,\r\n rounding,\r\n })\r\n })}\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport const Dropdown = React.forwardRef(DropdownComponent)\r\n\r\ninterface NestedDropdownWrapperProps {\r\n /**\r\n * State of parrent dropdown to be passed to MenuItem for correct navigation\r\n * handling\r\n */\r\n parentState: Reakit.MenuStateReturn\r\n\r\n /**\r\n * Nested dropdown element\r\n */\r\n children: JSX.Element\r\n}\r\n\r\n/**\r\n * The `useDropdownState` requires parent context to be defined in order to work\r\n * with nested Dropdowns. So we need to create a wrapper to be able to get to the\r\n * parent context\r\n */\r\nfunction NestedDropdownWrapper({ parentState, children }: NestedDropdownWrapperProps) {\r\n const state = useDropdownState()\r\n\r\n return (\r\n \r\n {(itemProps) => React.cloneElement(children, { ...children.props, triggerProps: itemProps, state })}\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Menu'\r\n\r\n/**\r\n * When rendering multiple dropdowns, wrap them in `DropdownBar` so they can be\r\n * navigated between\r\n */\r\nexport function DropdownBar({ children, ...props }: Partial) {\r\n const state = Reakit.useMenuBarState()\r\n\r\n return (\r\n \r\n {React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) return child\r\n\r\n return (\r\n \r\n {(itemProps) => React.cloneElement(child, itemProps)}\r\n \r\n )\r\n })}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Menu'\r\n\r\nimport { Button, ButtonProps } from '../button'\r\nimport { Icon, isValidIconName } from '../icon'\r\nimport { PropsWithAs } from '../types'\r\nimport { DropdownContext } from './hooks'\r\n\r\nconst DEFAULT_ELEMENT = 'button'\r\n\r\ninterface DropdownItemProps extends ButtonProps {\r\n subtitle?: React.ReactNode\r\n\r\n /**\r\n * Whether clicking the item should also close the dropdown. Only applies to\r\n * items without a submenu\r\n *\r\n * @default true\r\n */\r\n closeOnClick?: boolean\r\n}\r\n\r\nfunction DropdownItemComponent(\r\n {\r\n as: asComponent,\r\n state,\r\n subtitle,\r\n closeOnClick = true,\r\n children,\r\n rounding,\r\n ...props\r\n }: PropsWithAs & DropdownItemProps,\r\n ref: React.ForwardedRef\r\n) {\r\n const context = React.useContext(DropdownContext)\r\n\r\n return (\r\n \r\n {(itemProps) => {\r\n const active = itemProps['aria-selected'] && !context?.parent.animating\r\n const hasSubmenu = Boolean(itemProps['aria-haspopup'])\r\n\r\n const iconTheme = {\r\n 'text-gray-300': !active,\r\n 'text-gray-white dark:text-white': active,\r\n }\r\n\r\n return (\r\n \r\n ) : (\r\n props.leftContent\r\n )\r\n }\r\n rightContent={\r\n isValidIconName(props.rightContent) ? (\r\n \r\n ) : (\r\n props.rightContent\r\n )\r\n }\r\n onClick={(ev: React.MouseEvent) => {\r\n // Close if we clicked on an item which doesn’t have a submenu\r\n if (closeOnClick && !hasSubmenu) {\r\n context?.root.hide()\r\n }\r\n\r\n itemProps.onClick?.(ev)\r\n }}\r\n >\r\n {children}\r\n {subtitle &&
{subtitle}
}\r\n \r\n )\r\n }}\r\n
\r\n )\r\n}\r\n\r\n/**\r\n * We need to forward ref to the function, but typescript looses the type of the\r\n * props param so we need to typecast to get suggestions to work\r\n */\r\nexport const DropdownItem = React.forwardRef(DropdownItemComponent) as <\r\n TagType extends React.ElementType = typeof DEFAULT_ELEMENT\r\n>(\r\n props: PropsWithAs & DropdownItemProps & { ref?: React.ForwardedRef }\r\n) => ReturnType\r\n","import * as Reakit from 'reakit/Menu'\r\n\r\nimport { Paragraph } from '../typography'\r\n\r\nexport function DropdownSeparator(props: Partial) {\r\n return (\r\n \r\n
\r\n {props.children && (\r\n \r\n {props.children}\r\n \r\n )}\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { Button, ButtonProps } from '../button'\r\nimport { ButtonGroup } from '../button-group'\r\nimport { Icon } from '../icon'\r\nimport { Dropdown } from './dropdown'\r\nimport { useDropdownState } from './hooks'\r\n\r\ninterface MoreButtonDropdownProps extends ButtonProps {\r\n /**\r\n * Children of the button\r\n */\r\n label?: React.ReactNode\r\n\r\n /**\r\n * Additional handler when user clicks on the button\r\n */\r\n onClick?: (event: React.MouseEvent) => void\r\n\r\n /**\r\n * Accessibility label for the dropdown component\r\n */\r\n 'aria-label': string\r\n}\r\n\r\nexport function MoreButtonDropdown({\r\n label,\r\n children,\r\n onClick,\r\n 'aria-label': ariaLabel,\r\n ...props\r\n}: React.PropsWithChildren) {\r\n const state = useDropdownState({ placement: 'bottom-end' })\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n }\r\n >\r\n {children}\r\n \r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { IconNameType, iconList } from '.'\r\nimport { SVGProps } from './svg'\r\n\r\nexport interface IconProps extends SVGProps {\r\n /**\r\n * Icon name\r\n */\r\n name?: IconNameType\r\n\r\n /**\r\n * Alternative way to pass icon to render if you want to render a custom component\r\n * or use `iconList` object lookup\r\n */\r\n as?: React.FC\r\n}\r\n\r\nexport function Icon({ name, as: asComponent, ...props }: IconProps) {\r\n const Component = name && iconList[name] ? iconList[name] : asComponent\r\n\r\n if (name && asComponent) {\r\n throw new Error('Specifying both \"name\" and \"as\" on Icon component is not supported')\r\n }\r\n\r\n if (!Component) {\r\n throw new Error('No icon to render!')\r\n }\r\n\r\n return \r\n}\r\n","import { IconAdd } from './add'\r\nimport { IconArrowForward } from './arrow-forward'\r\nimport { IconCalendar } from './calendar'\r\nimport { IconCandleBarBasic } from './candle-bar-basic'\r\nimport { IconCandleBarHeikinAshi } from './candle-bar-heikin-ashi'\r\nimport { IconCandleBarHollow } from './candle-bar-hollow'\r\nimport { IconCaretDown } from './caret-down'\r\nimport { IconCaretRight } from './caret-right'\r\nimport { IconCaretVertical } from './caretVertical'\r\nimport { IconChartBar } from './chart-bar'\r\nimport { IconChartBubble } from './chart-bubble'\r\nimport { IconChartPie } from './chart-pie'\r\nimport { IconChartTable } from './chart-table'\r\nimport { IconChartTreemap } from './chart-treemap'\r\nimport { IconChevronDown } from './chevron-down'\r\nimport { IconChevronRight } from './chevron-right'\r\nimport { IconClose } from './close'\r\nimport { IconDarkMode } from './dark-mode'\r\nimport { IconDone } from './done'\r\nimport { IconDraw } from './draw'\r\nimport { IconDrawingActionDelete } from './drawing-action-delete'\r\nimport { IconDrawingSettingAutosaveOff } from './drawing-setting-autosave-off'\r\nimport { IconDrawingSettingAutosaveOn } from './drawing-setting-autosave-on'\r\nimport { IconDrawingSettingAutosaveSaving } from './drawing-setting-autosave-saving'\r\nimport { IconDrawingSettingDrawingMode } from './drawing-setting-drawing-mode'\r\nimport { IconDrawingSettingDrawingModeActive } from './drawing-setting-drawing-mode-active'\r\nimport { IconDrawingSettingHide } from './drawing-setting-hide'\r\nimport { IconDrawingSettingLock } from './drawing-setting-lock'\r\nimport { IconDrawingSettingPreserveDrawings } from './drawing-setting-preserve-drawings'\r\nimport { IconDrawingSettingPreserveDrawingsActive } from './drawing-setting-preserve-drawings-active'\r\nimport { IconDrawingSettingShow } from './drawing-setting-show'\r\nimport { IconDrawingSettingUnlock } from './drawing-setting-unlock'\r\nimport { IconExitFullscreen } from './exit-fullscreen'\r\nimport { IconFlash } from './flash'\r\nimport { IconFullscreen } from './fullscreen'\r\nimport { IconGesture } from './gesture'\r\nimport { IconGift } from './gift'\r\nimport { IconHamburger } from './hamburger'\r\nimport { IconHelp } from './help'\r\nimport { IconIdea } from './idea'\r\nimport { IconIdeaLoad } from './idea-load'\r\nimport { IconIdeaSave } from './idea-save'\r\nimport { IconInterval } from './interval'\r\nimport { IconLayout1h1v } from './layout-1h1v'\r\nimport { IconLayout1h2v } from './layout-1h2v'\r\nimport { IconLayout1h3v } from './layout-1h3v'\r\nimport { IconLayout1l2r } from './layout-1l2r'\r\nimport { IconLayout1t2b } from './layout-1t2b'\r\nimport { IconLayout2h1v } from './layout-2h1v'\r\nimport { IconLayout2h2v } from './layout-2h2v'\r\nimport { IconLayout3h1v } from './layout-3h1v'\r\nimport { IconLayout3h2v } from './layout-3h2v'\r\nimport { IconLightMode } from './light-mode'\r\nimport { IconLineChartType } from './line-chart-type'\r\nimport { IconMenuClose } from './menu-close'\r\nimport { IconMore } from './more'\r\nimport { IconNote } from './note'\r\nimport { IconOhlcChartType } from './ohlc-chart-type'\r\nimport { IconPalette } from './palette'\r\nimport { IconProfile } from './profile'\r\nimport { IconPublish } from './publish'\r\nimport { IconRefresh } from './refresh'\r\nimport { IconRemove } from './remove'\r\nimport { IconRestore } from './restore'\r\nimport { IconSearch } from './search'\r\nimport { IconSettings } from './settings'\r\nimport { IconSettingsWheel } from './settings-wheel'\r\nimport { IconShare } from './share'\r\nimport { IconSignOut } from './sign-out'\r\nimport { IconStar } from './star'\r\nimport { IconStarOutlined } from './star-outlined'\r\nimport { SVG, SVGProps } from './svg'\r\nimport { IconSwitchHorizontal } from './switch-horizontal'\r\nimport { IconSwitchVertical } from './switch-vertical'\r\nimport { IconTabKey } from './tab-key'\r\nimport { IconTemplate } from './template'\r\nimport { IconToolArrow } from './tool-arrow'\r\nimport { IconToolBrush } from './tool-brush'\r\nimport { IconToolCallout } from './tool-callout'\r\nimport { IconToolCurve } from './tool-curve'\r\nimport { IconToolElliottWave } from './tool-elliott-wave'\r\nimport { IconToolEllipse } from './tool-ellipse'\r\nimport { IconToolExpand } from './tool-expand'\r\nimport { IconToolFibonacci } from './tool-fibonacci'\r\nimport { IconToolLine } from './tool-line'\r\nimport { IconToolMeasure } from './tool-measure'\r\nimport { IconToolMidlineH } from './tool-midline-h'\r\nimport { IconToolMidlineV } from './tool-midline-v'\r\nimport { IconToolMouse } from './tool-mouse'\r\nimport { IconToolPitchFork } from './tool-pitchfork'\r\nimport { IconToolPolygon } from './tool-polygon'\r\nimport { IconToolPosition } from './tool-position'\r\nimport { IconToolRect } from './tool-rect'\r\nimport { IconToolRectRotated } from './tool-rect-rotated'\r\nimport { IconToolText } from './tool-text'\r\nimport { IconToolTriangle } from './tool-triangle'\r\nimport { IconToolXABCD } from './tool-xabcd'\r\nimport { IconTrashCan } from './trash-can'\r\nimport { IconTrendingDown } from './trending-down'\r\nimport { IconTrendingUp } from './trending-up'\r\nimport { IconTriangle } from './triangle'\r\nimport { IconWarning } from './warning'\r\n\r\n// Export the Icon component itself\r\nexport * from './icon'\r\n\r\nexport function isValidIconName(name?: unknown): name is IconNameType {\r\n if (!name || typeof name !== 'string') return false\r\n\r\n return !!iconList[name as IconNameType]\r\n}\r\n\r\nexport type IconNameType = keyof typeof iconList\r\n\r\n// Export list of icon components\r\nexport const iconList = {\r\n add: IconAdd,\r\n calendar: IconCalendar,\r\n candleBarBasic: IconCandleBarBasic,\r\n candleBarHeikinAshi: IconCandleBarHeikinAshi,\r\n candleBarHollow: IconCandleBarHollow,\r\n caretDown: IconCaretDown,\r\n caretRight: IconCaretRight,\r\n caretVertical: IconCaretVertical,\r\n chartBar: IconChartBar,\r\n chartBubble: IconChartBubble,\r\n chartPie: IconChartPie,\r\n chartTable: IconChartTable,\r\n chartTreemap: IconChartTreemap,\r\n chevronDown: IconChevronDown,\r\n chevronRight: IconChevronRight,\r\n close: IconMenuClose,\r\n darkMode: IconDarkMode,\r\n done: IconDone,\r\n draw: IconDraw,\r\n drawingActionDelete: IconDrawingActionDelete,\r\n drawingSettingAutosaveOff: IconDrawingSettingAutosaveOff,\r\n drawingSettingAutosaveOn: IconDrawingSettingAutosaveOn,\r\n drawingSettingAutosaveSaving: IconDrawingSettingAutosaveSaving,\r\n drawingSettingDrawingMode: IconDrawingSettingDrawingMode,\r\n drawingSettingDrawingModeActive: IconDrawingSettingDrawingModeActive,\r\n drawingSettingHide: IconDrawingSettingHide,\r\n drawingSettingLock: IconDrawingSettingLock,\r\n drawingSettingPreserveDrawings: IconDrawingSettingPreserveDrawings,\r\n drawingSettingPreserveDrawingsActive: IconDrawingSettingPreserveDrawingsActive,\r\n drawingSettingShow: IconDrawingSettingShow,\r\n drawingSettingUnlock: IconDrawingSettingUnlock,\r\n empty: (props: SVGProps) => ,\r\n exitFullscreen: IconExitFullscreen,\r\n flash: IconFlash,\r\n fullscreen: IconFullscreen,\r\n gift: IconGift,\r\n hamburger: IconHamburger,\r\n help: IconHelp,\r\n idea: IconIdea,\r\n ideaLoad: IconIdeaLoad,\r\n ideaSave: IconIdeaSave,\r\n interval: IconInterval,\r\n layout1h1v: IconLayout1h1v,\r\n layout1h2v: IconLayout1h2v,\r\n layout1h3v: IconLayout1h3v,\r\n layout1l2r: IconLayout1l2r,\r\n layout1t2b: IconLayout1t2b,\r\n layout2h1v: IconLayout2h1v,\r\n layout2h2v: IconLayout2h2v,\r\n layout3h1v: IconLayout3h1v,\r\n layout3h2v: IconLayout3h2v,\r\n lightMode: IconLightMode,\r\n lineChartType: IconLineChartType,\r\n menuClose: IconClose,\r\n more: IconMore,\r\n note: IconNote,\r\n ohlcChartType: IconOhlcChartType,\r\n profile: IconProfile,\r\n publish: IconPublish,\r\n refresh: IconRefresh,\r\n remove: IconRemove,\r\n restore: IconRestore,\r\n settingsWheel: IconSettingsWheel,\r\n gesture: IconGesture,\r\n search: IconSearch,\r\n settings: IconSettings,\r\n share: IconShare,\r\n signOut: IconSignOut,\r\n switchHorizontal: IconSwitchHorizontal,\r\n switchVertical: IconSwitchVertical,\r\n tabKey: IconTabKey,\r\n template: IconTemplate,\r\n toolArrow: IconToolArrow,\r\n toolBrush: IconToolBrush,\r\n toolCallout: IconToolCallout,\r\n toolCurve: IconToolCurve,\r\n toolElliottWave: IconToolElliottWave,\r\n toolEllipse: IconToolEllipse,\r\n toolExpand: IconToolExpand,\r\n toolFibonacci: IconToolFibonacci,\r\n toolLine: IconToolLine,\r\n toolMeasure: IconToolMeasure,\r\n toolMidLineH: IconToolMidlineH,\r\n toolMidLineV: IconToolMidlineV,\r\n toolMouse: IconToolMouse,\r\n toolPitchfork: IconToolPitchFork,\r\n toolPolygon: IconToolPolygon,\r\n toolPosition: IconToolPosition,\r\n toolRect: IconToolRect,\r\n toolRectRotated: IconToolRectRotated,\r\n toolText: IconToolText,\r\n toolTriangle: IconToolTriangle,\r\n toolXABCD: IconToolXABCD,\r\n triangle: IconTriangle,\r\n warning: IconWarning,\r\n palette: IconPalette,\r\n arrowForward: IconArrowForward,\r\n trendingUp: IconTrendingUp,\r\n trendingDown: IconTrendingDown,\r\n trashCan: IconTrashCan,\r\n star: IconStar,\r\n starOutlined: IconStarOutlined,\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconAdd(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCalendar(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCandleBarBasic(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCandleBarHeikinAshi(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCandleBarHollow(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCaretDown(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCaretRight(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconCaretVertical(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconChartBar(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconChartBubble(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconChartPie(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconChartTable(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconChartTreemap(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconChevronDown(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconChevronRight(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconMenuClose(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDarkMode(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDone(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDraw(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingActionDelete(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingAutosaveOff(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingAutosaveOn(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingAutosaveSaving(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingDrawingMode(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingDrawingModeActive(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingHide(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingLock(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingPreserveDrawings(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingPreserveDrawingsActive(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingShow(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconDrawingSettingUnlock(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconExitFullscreen(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconFlash(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconFullscreen(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconGift(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconHamburger(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconHelp(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconIdea(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconIdeaLoad(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconIdeaSave(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconInterval(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout1h1v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout1h2v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout1h3v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout1l2r(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout1t2b(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout2h1v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout2h2v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout3h1v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLayout3h2v(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLightMode(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconLineChartType(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconClose(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconMore(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconNote(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconOhlcChartType(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconProfile(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconPublish(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconRefresh(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconRemove(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconRestore(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconSettingsWheel(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconGesture(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconSearch(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconSettings(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconShare(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconSignOut(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconSwitchHorizontal(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconSwitchVertical(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconTabKey(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconTemplate(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolArrow(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolBrush(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolCallout(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolCurve(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolElliottWave(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolEllipse(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolExpand(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolFibonacci(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolLine(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolMeasure(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolMidlineH(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolMidlineV(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolMouse(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolPitchFork(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolPolygon(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolPosition(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolRect(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolRectRotated(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolText(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolTriangle(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconToolXABCD(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconTriangle(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconWarning(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconPalette(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconArrowForward(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconTrendingUp(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconTrendingDown(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconTrashCan(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconStar(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import { SVG, SVGProps } from './svg'\r\n\r\nexport function IconStarOutlined(props: SVGProps) {\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nexport type SVGProps = React.SVGProps\r\n\r\nexport function SVG({ className, width = 16, height = width, ...props }: SVGProps) {\r\n return (\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport { ForwardedRef, HTMLProps, PropsWithChildren, ReactNode, forwardRef, useMemo } from 'react'\r\n\r\nimport { Icon, IconNameType, isValidIconName } from './icon'\r\nimport { Label } from './typography'\r\n\r\nexport enum InputTheme {\r\n none,\r\n light,\r\n dark,\r\n}\r\n\r\nexport enum InputRounding {\r\n none = '',\r\n regular = 'rounded-md',\r\n}\r\n\r\n/**\r\n * Enum for input size. Only set size on larger viewports to avoid page zooming\r\n */\r\nexport enum InputSize {\r\n small = 'h-6 text-2xs', // 24px height\r\n regular = 'h-7 text-2xs', // 28px height\r\n medium = 'h-8 text-sm', // 32px height\r\n large = 'h-9 text-sm', // 36px height\r\n}\r\n\r\nfunction getInputTheme(theme: InputTheme, isError = false) {\r\n switch (theme) {\r\n case InputTheme.none:\r\n return {}\r\n case InputTheme.dark:\r\n return {\r\n input: classnames('border bg-gray-800 text-gray-50 disabled:bg-gray-700 disabled:text-gray-400', {\r\n 'border-gray-600 hover:border-gray-400 focus:border-blue-400 disabled:border-gray-700': !isError,\r\n 'border-red-400': isError,\r\n }),\r\n icon: classnames({\r\n 'text-gray-500 group-focus-within:text-blue-400': !isError,\r\n 'text-red-400': isError,\r\n }),\r\n }\r\n default:\r\n return {\r\n input: classnames(\r\n 'border', // Base styles\r\n 'bg-white disabled:bg-gray-50 disabled:text-gray-500', // Light\r\n 'dark:bg-gray-800 dark:disabled:bg-gray-700 dark:disabled:text-gray-400', // Dark\r\n {\r\n 'border-gray-100 hover:border-gray-300 focus:border-blue-400 disabled:hover:border-gray-100 dark:border-gray-600 dark:hover:border-gray-400 dark:focus:border-blue-400 dark:disabled:border-gray-700':\r\n !isError,\r\n 'border-red-400': isError,\r\n }\r\n ),\r\n icon: classnames({\r\n 'text-gray-300 group-focus-within:text-blue-400 dark:text-gray-500': !isError,\r\n 'text-red-400': isError,\r\n }),\r\n }\r\n }\r\n}\r\n\r\ntype OmitNativeProps = Omit, 'label' | 'size'>\r\n\r\nexport interface InputProps {\r\n /**\r\n * Label which is rendered above the input\r\n */\r\n label?: ReactNode\r\n\r\n /**\r\n * Theme for the input\r\n *\r\n * @default light\r\n */\r\n theme?: keyof typeof InputTheme\r\n\r\n /**\r\n * Input size. This setting is ignored on mobile to avoid zoom\r\n *\r\n * @default regular\r\n */\r\n size?: keyof typeof InputSize\r\n\r\n /**\r\n * Border radius of the input\r\n *\r\n * @default regular\r\n */\r\n rounding?: keyof typeof InputRounding\r\n\r\n /**\r\n * Element to display on left the side of the input or name of the icon\r\n */\r\n leftContent?: JSX.Element | IconNameType\r\n\r\n /**\r\n * Element to display on right the side of the input or name of the icon\r\n */\r\n rightContent?: JSX.Element | IconNameType\r\n\r\n /**\r\n * Additional class names for the input\r\n */\r\n inputClass?: string\r\n\r\n /**\r\n * Error label to display under the input\r\n */\r\n error?: ReactNode\r\n\r\n /**\r\n * Additional info to display under the input\r\n */\r\n caption?: ReactNode\r\n}\r\n\r\nexport type InputHTMLProps = OmitNativeProps\r\n\r\nexport type InputComponentProps = InputProps & InputHTMLProps\r\n\r\nfunction InputComponent(\r\n {\r\n label,\r\n size = 'regular',\r\n theme = 'light',\r\n rounding = 'regular',\r\n leftContent,\r\n rightContent,\r\n inputClass,\r\n error,\r\n caption,\r\n className,\r\n ...props\r\n }: InputComponentProps,\r\n ref: ForwardedRef\r\n) {\r\n const inputTheme = useMemo(() => getInputTheme(InputTheme[theme], !!error), [theme, error])\r\n const isLeftStringIcon = isValidIconName(leftContent)\r\n const isRightStringIcon = isValidIconName(rightContent)\r\n const inputSize = InputSize[size]\r\n\r\n const commonSideContentClassnames = useMemo(\r\n () => ({\r\n 'flex absolute justify-center items-center ml-px h-full': true,\r\n 'text-gray-500 dark:text-gray-600': theme === 'light',\r\n 'text-gray-600': theme === 'dark',\r\n }),\r\n [theme]\r\n )\r\n\r\n return (\r\n
\r\n
\r\n \r\n {caption && typeof caption !== 'boolean' && (\r\n {caption}\r\n )}\r\n {error && typeof error !== 'boolean' && {error}}\r\n
\r\n )\r\n}\r\n\r\ninterface InputCaptionProps extends Omit, 'size'> {\r\n size?: keyof typeof InputSize\r\n}\r\n\r\nfunction InputCaption({ size = 'regular', ...props }: PropsWithChildren) {\r\n return (\r\n \r\n )\r\n}\r\n\r\ntype TextareaProps = Omit & OmitNativeProps\r\n\r\nfunction TextareaComponent(\r\n { label, theme = 'light', rounding = 'regular', inputClass, error, caption, className, ...props }: TextareaProps,\r\n ref: ForwardedRef\r\n) {\r\n const textareaTheme = useMemo(() => getInputTheme(InputTheme[theme], !!error), [theme, error])\r\n\r\n return (\r\n
\r\n \r\n {caption && typeof caption !== 'boolean' && (\r\n {caption}\r\n )}\r\n {error && typeof error !== 'boolean' && {error}}\r\n
\r\n )\r\n}\r\n\r\nexport const Input = forwardRef(InputComponent)\r\nexport const Textarea = forwardRef(TextareaComponent)\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Composite'\r\n\r\nexport const ListContext = React.createContext(null)\r\n\r\nexport function useListState(options?: Reakit.CompositeInitialState) {\r\n return Reakit.useCompositeState({ ...options, loop: true, unstable_virtual: true })\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Composite'\r\n\r\nimport { BUTTON_DEFAULT_ELEMENT, Button, ButtonComponentProps, ButtonTheme } from '../button'\r\nimport { ListContext } from './hooks'\r\n\r\nexport interface ListItemProps {\r\n /**\r\n * Theme when the button is selected\r\n */\r\n activeTheme?: keyof typeof ButtonTheme\r\n\r\n /**\r\n * Close parent popover when the item is clicked\r\n */\r\n closeOnSelect?: boolean\r\n\r\n /**\r\n * OnChange callback when item is clicked or navigated to\r\n * @private\r\n */\r\n onSelectItem?: (item: string, closeOnSelect?: boolean) => void\r\n}\r\n\r\nexport function ListItem({\r\n as,\r\n activeTheme = 'blue',\r\n onSelectItem,\r\n onClick,\r\n onKeyPress,\r\n className,\r\n closeOnSelect = true,\r\n children,\r\n ...props\r\n}: React.PropsWithChildren & ButtonComponentProps) {\r\n const state = React.useContext(ListContext)\r\n\r\n return (\r\n {\r\n onClick?.(ev)\r\n onSelectItem?.(ev.currentTarget.id, closeOnSelect)\r\n }}\r\n onKeyPress={(ev) => {\r\n onKeyPress?.(ev)\r\n onSelectItem?.(ev.currentTarget.id, closeOnSelect)\r\n }}\r\n >\r\n {(itemProps: ButtonComponentProps) => {\r\n const active = Boolean(itemProps['aria-selected'])\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n }}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Composite'\r\n\r\nimport { ListContext } from './hooks'\r\nimport { ListItem } from './list-item'\r\n\r\ninterface ListProps extends Omit {\r\n /**\r\n * The returned object from `useListState`\r\n */\r\n state: Reakit.CompositeStateReturn\r\n\r\n /**\r\n * The selected option\r\n */\r\n selectedIndex?: number\r\n\r\n /**\r\n * Callback when selected option index changes\r\n */\r\n onChange?: (selectedIndex: number, closeParent?: boolean) => void\r\n\r\n /**\r\n * Whether or not default styles should be included for the list\r\n * @default true\r\n */\r\n includeBaseStyles?: boolean\r\n}\r\n\r\nexport function List({ state, selectedIndex, includeBaseStyles = true, onChange, children, ...props }: ListProps) {\r\n const prevSelected = React.useRef(null)\r\n\r\n // Select option when `selectedIndex` changes\r\n React.useEffect(() => {\r\n if (\r\n selectedIndex !== undefined &&\r\n selectedIndex >= 0 &&\r\n prevSelected.current !== selectedIndex &&\r\n state.items.length > selectedIndex\r\n ) {\r\n state.move(state.items[selectedIndex].id)\r\n prevSelected.current = selectedIndex\r\n }\r\n }, [selectedIndex, state, state.items.length])\r\n\r\n const onSelectItem = React.useCallback(\r\n (id: string, closeParent: boolean) => {\r\n onChange?.(\r\n state.items.findIndex((item) => item.id === id),\r\n closeParent\r\n )\r\n },\r\n [onChange, state.items]\r\n )\r\n\r\n return (\r\n \r\n \r\n {React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) return child\r\n\r\n if (child.type === ListItem) {\r\n return React.cloneElement(child, { ...child.props, onSelectItem: onSelectItem })\r\n }\r\n\r\n return child\r\n })}\r\n \r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nexport type NotificationContextType = ReturnType\r\n\r\nexport enum NotificationPosition {\r\n TopLeft,\r\n TopRight,\r\n BottomLeft,\r\n BottomRight,\r\n}\r\n\r\nexport interface NotificationOptions {\r\n position: NotificationPosition\r\n inline?: boolean\r\n}\r\n\r\nexport const NotificationContext = React.createContext<{\r\n show: (element: JSX.Element, options?: NotificationOptions) => void\r\n hide: () => void\r\n}>({\r\n show: () => {},\r\n hide: () => {},\r\n})\r\n\r\nexport function useNotification() {\r\n return React.useContext(NotificationContext)\r\n}\r\n","import classnames from 'classnames'\r\nimport throttle from 'lodash.throttle'\r\nimport * as React from 'react'\r\nimport { Dialog, useDialogState } from 'reakit/Dialog'\r\nimport { Portal } from 'reakit/Portal'\r\n\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\nimport { getExtendedDialogState } from '../dialog'\r\nimport { NotificationContext, NotificationOptions, NotificationPosition } from './hooks'\r\n\r\ninterface NotificationState {\r\n element: JSX.Element\r\n options: Partial\r\n}\r\n\r\nfunction getViewport(visualViewport: VisualViewport | null) {\r\n const width = visualViewport?.width ?? window.innerWidth\r\n const height = visualViewport?.height ?? window.innerHeight\r\n const scale = visualViewport?.scale ?? 1\r\n\r\n return {\r\n top: visualViewport?.offsetTop ?? 0,\r\n left: visualViewport?.offsetLeft ?? 0,\r\n scale: Math.round((1 / scale) * 100) / 100,\r\n width: Math.round(width * scale),\r\n height: Math.round(height * scale),\r\n }\r\n}\r\n\r\nexport function NotificationWrapper(props: React.PropsWithChildren) {\r\n const state = useDialogState({ modal: false, animated: COMPONENT_ANIMATION_DURATION })\r\n const [notification, setNotification] = React.useState(null)\r\n const { isFullyClosed, isFullyOpened } = getExtendedDialogState(state)\r\n const [viewport, setViewport] = React.useState(getViewport(window.visualViewport))\r\n\r\n React.useEffect(() => {\r\n if (!notification) return\r\n\r\n const handleResize = throttle((ev: Event) => {\r\n const viewport = ev.currentTarget as VisualViewport\r\n if (viewport) {\r\n setViewport(() => getViewport(viewport))\r\n }\r\n }, 50)\r\n\r\n window.visualViewport?.addEventListener('resize', handleResize)\r\n window.visualViewport?.addEventListener('scroll', handleResize)\r\n\r\n return () => {\r\n window.visualViewport?.removeEventListener('resize', handleResize)\r\n window.visualViewport?.removeEventListener('scroll', handleResize)\r\n }\r\n }, [notification])\r\n\r\n const context = React.useRef({\r\n show: (element: JSX.Element, options: Partial = {}) => {\r\n setViewport(() => getViewport(window.visualViewport))\r\n setNotification({ element, options })\r\n state.show()\r\n },\r\n hide: state.hide,\r\n })\r\n\r\n const positionClass = React.useMemo(() => {\r\n const { position = NotificationPosition.BottomLeft } = notification?.options ?? {}\r\n return {\r\n '[--inset-t:1rem] items-start pt-inset-top': [\r\n NotificationPosition.TopLeft,\r\n NotificationPosition.TopRight,\r\n ].includes(position),\r\n '[--inset-r:1rem] justify-end landscape-secondary:pr-inset-right': [\r\n NotificationPosition.TopRight,\r\n NotificationPosition.BottomRight,\r\n ].includes(position),\r\n '[--inset-b:1rem] items-end pb-inset-bottom': [\r\n NotificationPosition.BottomLeft,\r\n NotificationPosition.BottomRight,\r\n ].includes(position),\r\n '[--inset-l:1rem] justify-start landscape-primary:pl-inset-left': [\r\n NotificationPosition.TopLeft,\r\n NotificationPosition.BottomLeft,\r\n ].includes(position),\r\n }\r\n }, [notification?.options])\r\n\r\n const WrapperComponent = React.useMemo(\r\n () => (notification?.options.inline ? React.Fragment : Portal),\r\n [notification?.options.inline]\r\n )\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...innerProps }) => {\r\n if (isFullyClosed) return null\r\n\r\n return (\r\n \r\n \r\n {notification?.element}\r\n \r\n \r\n )\r\n }}\r\n \r\n \r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Button } from '../button'\r\nimport { useNotification } from './hooks'\r\n\r\ninterface NotificationProps {\r\n className?: string\r\n actions?: JSX.Element\r\n timeoutInMs?: number\r\n}\r\n\r\nexport function Notification(props: React.PropsWithChildren) {\r\n const notification = useNotification()\r\n\r\n React.useEffect(() => {\r\n let timeoutId: NodeJS.Timeout\r\n if (props.timeoutInMs) {\r\n timeoutId = setTimeout(() => {\r\n notification.hide()\r\n }, props.timeoutInMs)\r\n }\r\n\r\n return () => {\r\n if (timeoutId) {\r\n clearTimeout(timeoutId)\r\n }\r\n }\r\n }, [notification, props.timeoutInMs])\r\n\r\n return (\r\n \r\n
{props.children}
\r\n
{props.actions ?? }
\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { NotificationContextType, useNotification } from './hooks'\r\n\r\nexport function withNotificationContext(\r\n WrappedComponent: React.ComponentType\r\n) {\r\n const displayName = WrappedComponent.displayName ?? WrappedComponent.name ?? 'Component'\r\n const WithNotificationContext = (props: Omit) => {\r\n const notification = useNotification()\r\n return \r\n }\r\n\r\n WithNotificationContext.displayName = `withNotificationContext(${displayName})`\r\n\r\n return WithNotificationContext\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Popover'\r\nimport { Portal } from 'reakit/Portal'\r\n\r\nimport { useWindowSize } from '../../hooks/use-window-size'\r\nimport { Box, BoxProps, BoxTheme } from '../box'\r\nimport { getExtendedDialogState, useZIndex } from '../dialog'\r\nimport { TooltipArrow } from '../tooltip/tooltip-arrow'\r\nimport { PopoverStateReturn } from './hooks'\r\n\r\nconst POPOVER_HEIGHT_LIMIT_STYLE = {\r\n maxHeight: 'calc(var(--popover-max-height) - env(safe-area-inset-bottom))',\r\n}\r\n\r\nexport interface PopoverProps extends BoxProps, Pick {\r\n /**\r\n * The returned object from `usePopoverState`\r\n */\r\n state: PopoverStateReturn\r\n\r\n /**\r\n * Focus the popover when it opens\r\n *\r\n * @default true\r\n */\r\n focusOnShow?: Reakit.PopoverProps['unstable_autoFocusOnShow']\r\n\r\n /**\r\n * Focus the anchor element when it closes\r\n *\r\n * @default true\r\n */\r\n focusOnHide?: Reakit.PopoverProps['unstable_autoFocusOnHide']\r\n\r\n /**\r\n * Focus the anchor element when it closes\r\n *\r\n * @default undefined\r\n */\r\n finalFocusRef?: Reakit.PopoverProps['unstable_finalFocusRef']\r\n\r\n /**\r\n * Hides when clicked outside of popover, works with changing focus from the trigger component to another one\r\n *\r\n * @default true\r\n */\r\n hideOnClickOutside?: Reakit.PopoverProps['hideOnClickOutside']\r\n\r\n /**\r\n * Overlay click callback or if false is provided, overlay click calls hide func on popover state object\r\n *\r\n * @default undefined\r\n */\r\n onOverlayClick?: (() => void) | false\r\n\r\n /**\r\n * Popover wrapper css style object\r\n *\r\n * @default undefined\r\n */\r\n popoverWrapperStyle?: React.CSSProperties\r\n\r\n /**\r\n * Show popover arrow\r\n *\r\n * @default false\r\n */\r\n hasArrow?: boolean\r\n\r\n /**\r\n * Enable or disable backdrop click events\r\n *\r\n * @default true\r\n */\r\n hasBackdrop?: boolean\r\n\r\n /**\r\n * Set the popover to height to be limited by the viewport instead of having full height\r\n *\r\n * @default false\r\n */\r\n hasViewportHeightLimit?: boolean\r\n\r\n /**\r\n * Set the popover max-width to be limited by the trigger button\r\n */\r\n hasButtonWidthLimit?: boolean\r\n\r\n /**\r\n * Can be used together with `hasViewportHeightLimit` to limit the height of the popover\r\n *\r\n * @default undefined\r\n */\r\n popoverMaxHeight?: number\r\n}\r\n\r\nexport function Popover({\r\n state,\r\n children,\r\n focusOnShow = true,\r\n focusOnHide = true,\r\n finalFocusRef,\r\n 'aria-label': ariaLabel,\r\n hide,\r\n hideOnClickOutside = true,\r\n hasArrow = false,\r\n hasBackdrop = true,\r\n onOverlayClick,\r\n popoverWrapperStyle,\r\n popoverMaxHeight = Number.MAX_SAFE_INTEGER,\r\n theme = 'light',\r\n hasViewportHeightLimit = false,\r\n hasButtonWidthLimit = false,\r\n ...props\r\n}: PopoverProps) {\r\n const { innerHeight } = useWindowSize()\r\n const zIndex = useZIndex()\r\n const { isFullyClosed } = getExtendedDialogState(state)\r\n\r\n const buttonElement = state.unstable_referenceRef.current\r\n React.useEffect(() => {\r\n if (!buttonElement || !state.visible || !(hasViewportHeightLimit || hasButtonWidthLimit)) return\r\n\r\n const buttonRect = buttonElement.getBoundingClientRect()\r\n const popoverId = buttonElement.getAttribute('aria-controls')\r\n const popoverWrapper = popoverId ? document.getElementById(popoverId) : null\r\n\r\n // Limit popover max-width to be width of the trigger button\r\n if (hasButtonWidthLimit) {\r\n popoverWrapper?.style.setProperty('max-width', `${buttonRect.width}px`)\r\n }\r\n\r\n // Limit popover height to be always be in viewport if `hasViewportHeightLimit` set\r\n if (hasViewportHeightLimit) {\r\n const [, offsetY] = state.offsets\r\n\r\n let elementMaxHeight = 'auto'\r\n if (state.placement.startsWith('bottom')) {\r\n const height = innerHeight - buttonRect.bottom - offsetY * 2\r\n elementMaxHeight = `${Math.min(height, popoverMaxHeight)}px`\r\n } else {\r\n const height = buttonRect.top - offsetY * 2\r\n elementMaxHeight = `${Math.min(height, popoverMaxHeight)}px`\r\n }\r\n\r\n popoverWrapper?.style.setProperty('--popover-max-height', `${elementMaxHeight}`)\r\n }\r\n }, [\r\n state.visible,\r\n state.offsets,\r\n buttonElement,\r\n hasViewportHeightLimit,\r\n hasButtonWidthLimit,\r\n innerHeight,\r\n state.placement,\r\n popoverMaxHeight,\r\n ])\r\n\r\n return (\r\n \r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...innerProps }) => {\r\n if (isFullyClosed) return null\r\n\r\n return (\r\n <>\r\n {\r\n // prevents from page scroll when clicked outside of popover\r\n event.preventDefault()\r\n }}\r\n />\r\n \r\n \r\n {hasArrow && (\r\n \r\n \r\n \r\n )}\r\n {children}\r\n \r\n \r\n \r\n )\r\n }}\r\n \r\n \r\n )\r\n}\r\n","import throttle from 'lodash.throttle'\r\nimport * as React from 'react'\r\n\r\ninterface Props {\r\n throttleWaitInMs?: number\r\n}\r\n\r\nexport function useWindowSize({ throttleWaitInMs = 300 }: Props = {}) {\r\n const [size, setSize] = React.useState({\r\n innerWidth: window.innerWidth,\r\n innerHeight: window.innerHeight,\r\n })\r\n\r\n React.useEffect(() => {\r\n const handleResize = throttle(() => {\r\n setSize({\r\n innerWidth: window.innerWidth,\r\n innerHeight: window.innerHeight,\r\n })\r\n }, throttleWaitInMs)\r\n\r\n window.addEventListener('resize', handleResize)\r\n\r\n return () => {\r\n window.removeEventListener('resize', handleResize)\r\n }\r\n }, [throttleWaitInMs])\r\n\r\n return size\r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Popover'\r\n\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\n\r\nexport type PopoverStateReturn = ReturnType\r\n\r\nconst DEFAULT_OFFSET: [number, number] = [0, 5]\r\nconst HOVER_TIMEOUT = 150\r\n\r\nconst preventDefault = (ev: React.MouseEvent) => {\r\n ev.preventDefault()\r\n}\r\n\r\n/**\r\n * Hook which provides state to dialogs\r\n */\r\nexport function usePopoverState(settings?: Reakit.PopoverInitialState) {\r\n const offsets = (settings?.unstable_offset ?? DEFAULT_OFFSET) as [number, number]\r\n const popover = Reakit.usePopoverState({\r\n ...settings,\r\n placement: settings?.placement ?? 'bottom-start',\r\n unstable_offset: offsets,\r\n animated: COMPONENT_ANIMATION_DURATION,\r\n modal: false,\r\n })\r\n\r\n return { ...popover, offsets }\r\n}\r\n\r\nexport function useHoverPopover(settings?: Reakit.PopoverInitialState) {\r\n const popover = usePopoverState(settings)\r\n const showTimeout = React.useRef(null)\r\n const hideTimeout = React.useRef(null)\r\n\r\n const clearTimeouts = React.useRef(() => {\r\n if (showTimeout.current !== null) {\r\n window.clearTimeout(showTimeout.current)\r\n }\r\n if (hideTimeout.current !== null) {\r\n window.clearTimeout(hideTimeout.current)\r\n }\r\n })\r\n\r\n const showPopover = React.useRef(() => {\r\n clearTimeouts.current()\r\n showTimeout.current = window.setTimeout(() => {\r\n popover.show()\r\n }, HOVER_TIMEOUT)\r\n })\r\n\r\n const hidePopover = React.useRef(() => {\r\n clearTimeouts.current()\r\n hideTimeout.current = window.setTimeout(() => {\r\n popover.hide()\r\n }, HOVER_TIMEOUT)\r\n })\r\n\r\n // Unmount cleanup\r\n React.useEffect(() => () => clearTimeouts.current(), [])\r\n\r\n return {\r\n ...popover,\r\n show: showPopover.current,\r\n hide: hidePopover.current,\r\n onMouseOver: showPopover.current,\r\n onMouseOut: hidePopover.current,\r\n onMouseDown: preventDefault,\r\n }\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Popover'\r\n\r\nimport { useZIndex } from '../dialog'\r\n\r\ninterface PopoverButtonProps extends Reakit.PopoverDisclosureHTMLProps {\r\n state: Reakit.PopoverStateReturn\r\n}\r\n/**\r\n * The trigger button component which handles ref & focus return, etc.\r\n */\r\nexport const PopoverTrigger = React.forwardRef(\r\n ({ state, ...props }: PopoverButtonProps, ref: React.ForwardedRef) => {\r\n const zIndex = useZIndex()\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n }\r\n)\r\n","// Disable rule as the component is external\r\n\r\n/* eslint-disable react/jsx-pascal-case */\r\nimport classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Combobox'\r\n\r\nimport { Button, ButtonProps } from '../button'\r\nimport { PropsWithAs } from '../types'\r\n\r\nconst DEFAULT_ELEMENT = 'button'\r\n\r\nexport interface ComboBoxItemProps extends ButtonProps {\r\n /**\r\n * The returned object from `useComboBoxState`\r\n */\r\n state?: Reakit.unstable_ComboboxStateReturn\r\n\r\n /**\r\n * Value for the combo box item\r\n */\r\n value: string\r\n}\r\n\r\nexport function ComboBoxItem({\r\n as: asComponent,\r\n state,\r\n children,\r\n ...props\r\n}: PropsWithAs & ComboBoxItemProps) {\r\n return (\r\n \r\n {(itemProps) => {\r\n const selected = state?.currentId === itemProps.id\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n }}\r\n \r\n )\r\n}\r\n","// Disable rule as the component is external\r\n\r\n/* eslint-disable react/jsx-pascal-case */\r\nimport classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as Reakit from 'reakit/Combobox'\r\nimport { Portal } from 'reakit/Portal'\r\n\r\nimport { Box, BoxProps } from '../box'\r\nimport { useZIndex } from '../dialog'\r\nimport { Input, InputProps } from '../input'\r\nimport { ComboBoxItem } from './combo-box-item'\r\n\r\ninterface ComboBoxProps extends Omit {\r\n /**\r\n * The returned object from `useComboBoxState`\r\n */\r\n state: Reakit.unstable_ComboboxStateReturn\r\n\r\n /**\r\n * Additional props for the input\r\n */\r\n inputProps?: Partial & Partial\r\n\r\n /**\r\n * Additional props for the popover\r\n */\r\n popoverProps?: Partial\r\n\r\n /**\r\n * Callback when user presses enter\r\n */\r\n onChange: (value: string) => void\r\n}\r\n\r\nexport function ComboBox({\r\n state,\r\n children,\r\n inputProps,\r\n popoverProps,\r\n onChange,\r\n 'aria-label': ariaLabel,\r\n ...props\r\n}: React.PropsWithChildren) {\r\n const zIndex = useZIndex()\r\n\r\n return (\r\n <>\r\n {\r\n if (ev.key === 'Enter') {\r\n onChange(state.inputValue)\r\n }\r\n inputProps?.onKeyDown?.(ev)\r\n }}\r\n />\r\n \r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...innerProps }) => (\r\n
\r\n \r\n {React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) return child\r\n\r\n if (child.type === ComboBoxItem) {\r\n return React.cloneElement(child as React.ReactElement>, {\r\n state,\r\n onMouseUp: () => {\r\n onChange(child.props.value)\r\n },\r\n })\r\n }\r\n\r\n return child\r\n })}\r\n \r\n
\r\n )}\r\n
\r\n
\r\n \r\n )\r\n}\r\n","import { Instrument } from '../../types'\r\n\r\nexport const INSTRUMENT_CATEGORIES = [\r\n { name: 'All', instrument: undefined },\r\n { name: 'Stocks', instrument: Instrument.stock },\r\n { name: 'Futures', instrument: Instrument.futures },\r\n { name: 'Forex', instrument: Instrument.forex },\r\n { name: 'Crypto', instrument: Instrument.crypto },\r\n]\r\n","import classnames from 'classnames'\r\nimport { HTMLProps, PropsWithChildren } from 'react'\r\n\r\nexport function Centered(props: PropsWithChildren>) {\r\n return
\r\n}\r\n","import { FallbackProps } from 'react-error-boundary'\r\n\r\nimport { link } from '../../services/routing'\r\nimport { Button } from '../button'\r\nimport { Centered } from '../centered'\r\nimport { Icon } from '../icon'\r\nimport { Heading, Paragraph } from '../typography'\r\n\r\nexport function SearchError(props: FallbackProps) {\r\n return (\r\n \r\n \r\n \r\n Error fetching the results\r\n \r\n \r\n There’s been an error fetching your results. Please try again or{' '}\r\n \r\n contact support\r\n \r\n .\r\n \r\n \r\n \r\n )\r\n}\r\n","import { useMemo } from 'react'\r\n\r\ninterface HighlightProps {\r\n /**\r\n * Search string that will be highlighted\r\n */\r\n highlight: string\r\n /**\r\n * Text to be highlighted\r\n */\r\n text: string\r\n}\r\n\r\nexport function Highlight({ highlight, text }: HighlightProps) {\r\n const index = text.toLowerCase().indexOf(highlight.toLowerCase())\r\n\r\n const processedText = useMemo(\r\n () => ({\r\n before: text.substring(0, index),\r\n highlight: text.substring(index, index + highlight.length),\r\n after: text.substring(index + highlight.length),\r\n }),\r\n [highlight.length, index, text]\r\n )\r\n\r\n if (index < 0 || highlight.length < 1) return {text}\r\n\r\n return (\r\n <>\r\n {processedText.before}\r\n {!!processedText.highlight.length && (\r\n \r\n {processedText.highlight}\r\n \r\n )}\r\n {processedText.after}\r\n \r\n )\r\n}\r\n","import { getSanitizedTicker } from '../../../app/shared/ticker-sanitizer'\r\nimport { link } from '../../services/routing'\r\nimport { Instrument } from '../../types'\r\nimport { getInstrumentForTicker } from '../../util'\r\n\r\nexport function getRedirectForTicker(tickerRaw: string) {\r\n const ticker = getSanitizedTicker(tickerRaw, true)\r\n const type = getInstrumentForTicker(ticker)\r\n\r\n switch (Instrument[type]) {\r\n case Instrument.stock:\r\n return link.toQuote(ticker)\r\n case Instrument.forex:\r\n return link.toForexChartDetail(ticker)\r\n case Instrument.futures:\r\n return link.toFuturesChartDetail(ticker)\r\n case Instrument.crypto:\r\n return link.toCryptoChartDetail(ticker)\r\n default:\r\n // Not used right now, all instruments are `stock` by default\r\n return link.toSearch(ticker)\r\n }\r\n}\r\n","import { SearchApiResult } from '../../services/api'\r\nimport { ComboBoxItem, ComboBoxItemProps } from '../combo-box'\r\nimport { Highlight } from '../highlight'\r\nimport { getRedirectForTicker } from './util'\r\n\r\ninterface SearchItemProps extends Pick {\r\n item: SearchApiResult\r\n}\r\n\r\nexport function SearchItem(props: SearchItemProps) {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {props.item.exchange}\r\n \r\n )\r\n}\r\n","import { useQuery } from '@tanstack/react-query'\r\nimport * as Reakit from 'reakit/Combobox'\r\n\r\nimport { searchApiRequest } from '../../services/api'\r\nimport { link } from '../../services/routing'\r\nimport { InstrumentType } from '../../types'\r\nimport { Button } from '../button'\r\nimport { Centered } from '../centered'\r\nimport { Icon } from '../icon'\r\nimport { Spinner } from '../spinner'\r\nimport { Heading, Paragraph } from '../typography'\r\nimport { SearchItem } from './search-item'\r\n\r\ninterface SearchListProps {\r\n state: Reakit.unstable_ComboboxStateReturn\r\n instrument?: InstrumentType\r\n}\r\n\r\nexport function SearchList(props: SearchListProps) {\r\n const { data, isLoading } = useQuery(\r\n ['search', props.state.inputValue, props.instrument],\r\n () => searchApiRequest(props.state.inputValue, props.instrument),\r\n { enabled: props.state.inputValue.length > 0, keepPreviousData: true, cacheTime: Infinity, staleTime: Infinity }\r\n )\r\n\r\n if (isLoading) {\r\n return (\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n if (!data?.length) {\r\n return (\r\n \r\n \r\n \r\n We couldn’t find any results\r\n \r\n \r\n Try refining your search and try again.\r\n \r\n \r\n )\r\n }\r\n\r\n return (\r\n
\r\n
\r\n {data.map((item) => (\r\n \r\n ))}\r\n
\r\n \r\n Show all results\r\n \r\n
\r\n )\r\n}\r\n","import { useQueryErrorResetBoundary } from '@tanstack/react-query'\r\nimport * as React from 'react'\r\nimport { ErrorBoundary } from 'react-error-boundary'\r\n\r\nimport { ComboBox, useComboBoxState } from '../combo-box'\r\nimport { getExtendedDialogState } from '../dialog'\r\nimport { InputTheme } from '../input'\r\nimport { List, ListItem, useListState } from '../list'\r\nimport { INSTRUMENT_CATEGORIES } from './constants'\r\nimport { SearchError } from './search-error'\r\nimport { SearchList } from './search-list'\r\nimport { getRedirectForTicker } from './util'\r\n\r\ninterface SearchProps {\r\n autoFocus?: boolean\r\n defaultValue?: string\r\n theme?: keyof typeof InputTheme\r\n}\r\n\r\nexport function Search(props: SearchProps) {\r\n const { reset } = useQueryErrorResetBoundary()\r\n const state = useComboBoxState({ minValueLength: 1, inputValue: props.defaultValue, placement: 'bottom-end' })\r\n const { isFullyClosed } = getExtendedDialogState(state)\r\n const listState = useListState({ orientation: 'vertical' })\r\n const [category, setCategory] = React.useState(0)\r\n\r\n const changeCategory = React.useRef((ev: React.KeyboardEvent) => {\r\n switch (ev.key) {\r\n case 'ArrowRight':\r\n state.first()\r\n break\r\n case 'ArrowUp':\r\n setCategory((state) => (state - 1 + INSTRUMENT_CATEGORIES.length) % INSTRUMENT_CATEGORIES.length)\r\n break\r\n case 'ArrowDown':\r\n setCategory((state) => (state + 1) % INSTRUMENT_CATEGORIES.length)\r\n break\r\n }\r\n })\r\n\r\n /**\r\n * The search box can be child of a modal/dialog so we need to handle ESC\r\n * otherwise it would close both the combobox and the parent.\r\n */\r\n const onInputKeyDown = React.useCallback(\r\n (ev: React.KeyboardEvent) => {\r\n if (ev.key === 'Escape' && state.visible) {\r\n ev.stopPropagation()\r\n state.hide()\r\n }\r\n },\r\n // We only use `visible` and `hide` and don’t need the full state\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [state.visible, state.hide]\r\n )\r\n\r\n /**\r\n * Reset to category \"All\" when the combobox closes\r\n */\r\n React.useEffect(() => {\r\n if (isFullyClosed) {\r\n setCategory(0)\r\n }\r\n }, [isFullyClosed])\r\n\r\n return (\r\n {\r\n const redirectUri = getRedirectForTicker(value)\r\n window.location.href = redirectUri\r\n }}\r\n >\r\n
\r\n setCategory(index)}\r\n onKeyDown={changeCategory.current}\r\n >\r\n {INSTRUMENT_CATEGORIES.map((category) => (\r\n {category.name}\r\n ))}\r\n \r\n {(state.visible || state.animating) && (\r\n \r\n \r\n \r\n )}\r\n
\r\n \r\n )\r\n}\r\n","import * as Reakit from 'reakit/Combobox'\r\n\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\n\r\nexport function useComboBoxState(options?: Reakit.unstable_ComboboxInitialState) {\r\n return Reakit.unstable_useComboboxState({\r\n ...options,\r\n animated: COMPONENT_ANIMATION_DURATION,\r\n modal: false,\r\n inline: true,\r\n unstable_offset: [0, 5],\r\n })\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { PopoverStateReturn } from '../popover'\r\nimport { SelectItem } from './types'\r\n\r\nfunction getSelectedItemIndex(items: SelectItem[], value: unknown) {\r\n if (!value) return -1\r\n\r\n return items.findIndex((item) => item.value === value)\r\n}\r\n\r\n/**\r\n * Hook which handles select state and returns onChange handler\r\n */\r\nexport function useSelect>(\r\n state: PopoverStateReturn,\r\n defaultValue: ValueType | undefined,\r\n items: ItemType[],\r\n onChange: (item: ItemType) => void\r\n) {\r\n const [selectedIndex, setSelectedIndex] = React.useState(getSelectedItemIndex(items, defaultValue))\r\n const closePopover = React.useRef(() => state.hide())\r\n\r\n // Update select value on change from outside\r\n React.useEffect(() => {\r\n const newIndex = getSelectedItemIndex(items, defaultValue)\r\n setSelectedIndex(newIndex)\r\n }, [items, selectedIndex, defaultValue])\r\n\r\n const onItemChange = React.useCallback(\r\n (index: number, closeOnSelect = true) => {\r\n const selectedItem = items[index]\r\n setSelectedIndex(index)\r\n\r\n if (!selectedItem.href || !selectedItem.reloadDocument) {\r\n onChange(selectedItem)\r\n if (closeOnSelect) closePopover.current()\r\n return\r\n }\r\n\r\n if (typeof selectedItem.href === 'string') {\r\n window.location.href = selectedItem.href\r\n return\r\n }\r\n\r\n const newUrl = new URL(selectedItem.href.pathname!, window.location.href)\r\n newUrl.search = selectedItem.href.search ?? ''\r\n newUrl.hash = selectedItem.href.hash ?? ''\r\n\r\n window.location.href = newUrl.toString()\r\n },\r\n [items, onChange, setSelectedIndex]\r\n )\r\n\r\n return { selectedIndex, onItemChange }\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Button, ButtonHTMLProps, ButtonProps, ButtonTheme, ButtonThemeType } from '../button'\r\nimport { Icon } from '../icon'\r\nimport { PopoverStateReturn, PopoverTrigger } from '../popover'\r\n\r\nfunction getButtonProps(theme: ButtonTheme, active: boolean): ButtonProps & ButtonHTMLProps {\r\n switch (theme) {\r\n case ButtonTheme.light:\r\n return {\r\n theme: 'transparent',\r\n contentClass: 'font-normal truncate',\r\n className: classnames(\r\n 'border bg-white pr-1 disabled:border-gray-100 disabled:bg-gray-50 disabled:text-gray-500 dark:bg-gray-800',\r\n {\r\n 'border-gray-100 hover:border-gray-300 disabled:hover:border-gray-100 dark:border-gray-600 dark:hover:border-gray-400 dark:disabled:border-gray-700':\r\n !active,\r\n 'border-blue-400 dark:border-blue-400': active,\r\n }\r\n ),\r\n rightContent: (\r\n \r\n ),\r\n }\r\n case ButtonTheme.dark:\r\n return {\r\n theme: 'transparent',\r\n contentClass: 'font-normal truncate',\r\n className: classnames('border bg-gray-800 pr-1 text-gray-50 disabled:border-gray-700 disabled:text-gray-500', {\r\n 'border-gray-600 hover:border-gray-400': !active,\r\n 'border-blue-400': active,\r\n }),\r\n rightContent: (\r\n \r\n ),\r\n }\r\n default:\r\n return {}\r\n }\r\n}\r\n\r\ninterface SelectButtonProps extends ButtonProps, ButtonHTMLProps {\r\n /**\r\n * Theme for the button\r\n *\r\n * @default light\r\n */\r\n theme?: ButtonThemeType\r\n\r\n state: PopoverStateReturn\r\n}\r\n\r\nexport function SelectButton({ state, theme = 'light', ...props }: SelectButtonProps) {\r\n const themeProps = React.useMemo(() => getButtonProps(ButtonTheme[theme], state.visible), [theme, state.visible])\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport { useInRouterContext } from 'react-router-dom'\r\nimport * as Reakit from 'reakit/Popover'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { ButtonHTMLProps, ButtonProps } from '../button'\r\nimport { ListItem } from '../list'\r\nimport { PopoverStateReturn, usePopoverState } from '../popover'\r\nimport { Label } from '../typography'\r\nimport { useSelect } from './hooks'\r\nimport { NativeSelect, NativeSelectInRouterContext } from './native-select'\r\nimport { SelectButton } from './select-button'\r\nimport { SelectList, SelectListProps } from './select-list'\r\nimport { SelectItem } from './types'\r\n\r\n/**\r\n * All non-select props get passed to the button element, these are the supported props\r\n */\r\ntype ButtonPassthroughProps = Omit &\r\n Omit\r\n\r\nexport interface SelectProps extends ButtonPassthroughProps {\r\n /**\r\n * Optional popover state settings\r\n */\r\n popoverStateSettings?: Reakit.PopoverInitialState\r\n\r\n /**\r\n * Name of the select, will be included in `onChange` event\r\n */\r\n name?: Name\r\n\r\n /**\r\n * Current selected value\r\n */\r\n value?: ValueType\r\n\r\n /**\r\n * List of items to display in the select\r\n */\r\n items: ItemType[]\r\n\r\n /**\r\n * Callback when selected item changes\r\n */\r\n onChange?: (item: ItemType, name: Name) => void\r\n\r\n /**\r\n * Label to display above the select\r\n */\r\n label?: React.ReactNode\r\n\r\n /**\r\n * Text for the button (usually the selected value). Falls back to placeholder if not set\r\n */\r\n buttonContent?: React.ReactNode\r\n\r\n /**\r\n * Placeholder when no value is selected\r\n */\r\n placeholder?: string\r\n\r\n /**\r\n * Additional props to the popover list\r\n */\r\n listProps?: Omit\r\n\r\n /**\r\n * Optional label className override\r\n */\r\n labelClassName?: string\r\n\r\n /**\r\n * Should use native select element on mobile devices\r\n *\r\n * @default true\r\n */\r\n isNativeMobileSelect?: boolean\r\n\r\n /**\r\n * Set the popover to height to be limited by the viewport instead of having full height\r\n *\r\n * @default false\r\n */\r\n hasPopoverViewportHeightLimit?: boolean\r\n\r\n /**\r\n * Set the popover max-width to be limited by the trigger button\r\n */\r\n hasPopoverButtonWidthLimit?: boolean\r\n}\r\n\r\nexport function Select, Name = never>({\r\n children,\r\n popoverStateSettings,\r\n ...props\r\n}: SelectProps) {\r\n const popoverState = usePopoverState(popoverStateSettings)\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n\r\nexport interface StatelessSelectProps extends SelectProps {\r\n /**\r\n * Popover state for handling list in popover\r\n */\r\n popoverState: PopoverStateReturn\r\n}\r\n\r\nexport function StatelessSelect, Name = never>({\r\n // Select\r\n name,\r\n label,\r\n value,\r\n items = [],\r\n onChange,\r\n labelClassName,\r\n 'aria-label': ariaLabel,\r\n // Button\r\n theme,\r\n buttonContent,\r\n placeholder = 'Select value',\r\n // Popover\r\n popoverState,\r\n listProps,\r\n isNativeMobileSelect = true,\r\n hasPopoverViewportHeightLimit = false,\r\n hasPopoverButtonWidthLimit = true,\r\n children,\r\n ...props\r\n}: StatelessSelectProps) {\r\n const { selectedIndex, onItemChange } = useSelect(popoverState, value, items, (item) => onChange?.(item, name!))\r\n const showMobileSelect = isNativeMobileSelect && isMobile()\r\n\r\n /** Items can have `href` and be router Links. We need a way to account for this in native select */\r\n const isInRouterContext = useInRouterContext()\r\n const NativeSelectComponent = isInRouterContext ? NativeSelectInRouterContext : NativeSelect\r\n\r\n return (\r\n \r\n )\r\n}\r\n\r\nexport const SelectOption = ListItem\r\n","import * as React from 'react'\r\n\r\nimport { usePopoverState } from '../popover'\r\nimport { Tooltip, TooltipTrigger, useTooltipState } from '../tooltip'\r\nimport { Paragraph } from '../typography'\r\nimport { SelectProps, StatelessSelect } from './select'\r\nimport { SelectItem } from './types'\r\n\r\nexport interface SelectWithTooltipProps extends SelectProps {\r\n /**\r\n * Labels which renders in tooltip on hover\r\n */\r\n tooltipLabel?: string\r\n}\r\n\r\nexport function SelectWithTooltip, Name = never>({\r\n children,\r\n tooltipLabel,\r\n popoverStateSettings,\r\n isNativeMobileSelect = false,\r\n ...props\r\n}: SelectWithTooltipProps) {\r\n const popoverState = usePopoverState(popoverStateSettings)\r\n const tooltip = useTooltipState({ placement: 'bottom', unstable_timeout: 300 })\r\n const isTooltipIgnored = React.useRef(false)\r\n\r\n /**\r\n * Ignore focus re-trigger (do not show tooltip) when page visibility/focus state changes\r\n * - some browsers re-trigger focus on `activeElement` when document becomes visible\r\n */\r\n React.useEffect(() => {\r\n const onChange = () => {\r\n if (\r\n document.visibilityState === 'visible' &&\r\n document.activeElement === popoverState.unstable_referenceRef.current\r\n ) {\r\n isTooltipIgnored.current = true\r\n tooltip.hide()\r\n }\r\n }\r\n\r\n document.addEventListener('visibilitychange', onChange)\r\n window.addEventListener('blur', onChange)\r\n return () => {\r\n document.removeEventListener('visibilitychange', onChange)\r\n window.removeEventListener('blur', onChange)\r\n }\r\n // Changing this to `tooltip` dependency will run this effect on every render\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [popoverState.unstable_referenceRef, tooltip.hide])\r\n\r\n // hide tooltip when select dropdown opens\r\n React.useEffect(() => {\r\n if (popoverState.visible) {\r\n isTooltipIgnored.current = true\r\n tooltip.hide()\r\n }\r\n }, [popoverState.visible, tooltip])\r\n\r\n const onSelectFocus = React.useRef(() => {\r\n if (!isTooltipIgnored.current) tooltip.show()\r\n })\r\n\r\n // Make sure the tooltip doesn’t reopen when the select is closed until focused again\r\n const onSelectBlur = React.useRef(() => {\r\n isTooltipIgnored.current = popoverState.visible\r\n if (!isTooltipIgnored.current) tooltip.hide()\r\n })\r\n\r\n return (\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\nimport { useNavigate } from 'react-router-dom'\r\n\r\nimport { SelectItem } from './types'\r\n\r\ninterface NativeSelectProps extends Omit, 'onChange'> {\r\n items: ItemType[]\r\n onChange: (itemIndex: number) => void\r\n}\r\n\r\nexport function NativeSelect>({\r\n items,\r\n onChange,\r\n placeholder = 'Select value',\r\n ...props\r\n}: NativeSelectProps) {\r\n const showPlaceholder = props.value === -1\r\n const handleNativeSelectChange = React.useCallback(\r\n (e: React.ChangeEvent) => {\r\n const itemIndex = e.target.selectedIndex + (showPlaceholder ? -1 : 0)\r\n const selectedItem = items[itemIndex]\r\n\r\n if (!selectedItem.href || !selectedItem.reloadDocument) {\r\n onChange(itemIndex)\r\n return\r\n }\r\n\r\n if (typeof selectedItem.href === 'string') {\r\n window.location.href = selectedItem.href\r\n return\r\n }\r\n\r\n const newUrl = new URL(selectedItem.href.pathname!, window.location.href)\r\n newUrl.search = selectedItem.href.search ?? ''\r\n newUrl.hash = selectedItem.href.hash ?? ''\r\n\r\n window.location.href = newUrl.toString()\r\n },\r\n [items, onChange, showPlaceholder]\r\n )\r\n\r\n return (\r\n \r\n {showPlaceholder && }\r\n {items.map((item, i) => (\r\n \r\n ))}\r\n \r\n )\r\n}\r\n\r\nexport function NativeSelectInRouterContext>(props: NativeSelectProps) {\r\n const navigate = useNavigate()\r\n\r\n const onChangeWithNavigate = React.useCallback(\r\n (itemIndex: number) => {\r\n const selectedItem = props.items[itemIndex]\r\n props.onChange(itemIndex)\r\n\r\n if (selectedItem.href) navigate(selectedItem.href)\r\n },\r\n // We don’t need the whole props here, just onChange and items\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [navigate, props.onChange, props.items]\r\n )\r\n\r\n return \r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { List, useListState } from '../list'\r\nimport { Popover, PopoverProps } from '../popover'\r\n\r\nexport interface SelectListProps extends Omit {\r\n /**\r\n * The index of selected item\r\n */\r\n selectedIndex?: number\r\n\r\n /**\r\n * Handler called when selected item in list changes\r\n */\r\n onChange: (item: number) => void\r\n}\r\n\r\nexport function SelectList({\r\n selectedIndex,\r\n onChange,\r\n 'aria-label': ariaLabel,\r\n children,\r\n ...props\r\n}: React.PropsWithChildren) {\r\n const listState = useListState({ currentId: null })\r\n\r\n return (\r\n \r\n \r\n {children}\r\n \r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\n\r\ninterface SpinnerProps {\r\n /**\r\n * Spinner as progress bar\r\n * @default false\r\n */\r\n isProgressBar?: boolean\r\n\r\n /**\r\n * Progress number in percent\r\n * @default 0\r\n */\r\n progress?: number\r\n\r\n /**\r\n * Spinner box width\r\n *\r\n * @default 28\r\n */\r\n width?: number\r\n}\r\n\r\nexport function Spinner({ isProgressBar = false, progress = 0, width = 28 }: SpinnerProps) {\r\n const radius = (3 * width) / 7\r\n const strokeWidth = radius / 3\r\n const circleXY = radius + strokeWidth / 2\r\n const circumference = radius * 2 * Math.PI\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\nimport { Link, Path } from 'react-router-dom'\r\n\r\nimport { BoxRounding } from '../box'\r\nimport { ButtonHTMLProps, ButtonProps, ButtonSizeType } from '../button'\r\nimport { DropdownSeparator } from '../dropdown'\r\nimport { Icon } from '../icon'\r\nimport { SelectOption, SelectWithTooltip } from '../select'\r\nimport { SelectItem } from '../select/types'\r\n\r\nexport interface DateRangeBaseOption extends SelectItem {\r\n timeframe: string\r\n href?: Path\r\n}\r\n\r\ninterface Props {\r\n chartIndex: number\r\n dateRangeGroups: Array<{ label: string; dateRanges: DateRange[] }>\r\n selectedDateRange: string | null\r\n onDateRangeSelect: (value: DateRange) => void\r\n rounding: keyof typeof BoxRounding\r\n size?: ButtonSizeType\r\n}\r\n\r\nconst DATERANGE_TOOLTIP = 'Range'\r\n\r\nexport function DateRangeSelect({\r\n size,\r\n chartIndex,\r\n dateRangeGroups,\r\n selectedDateRange,\r\n onDateRangeSelect,\r\n rounding,\r\n}: Props) {\r\n const flatDateRanges = React.useMemo(() => dateRangeGroups.flatMap(({ dateRanges }) => dateRanges), [dateRangeGroups])\r\n\r\n const buttonProps = React.useMemo(\r\n () => ({\r\n size,\r\n rounding,\r\n className: '',\r\n rightContent: undefined,\r\n appearance: 'square',\r\n theme: 'chip',\r\n }),\r\n [size, rounding]\r\n )\r\n\r\n const selectWithTooltipListProps = React.useMemo(() => ({ rounding }), [rounding])\r\n\r\n return (\r\n }\r\n tooltipLabel={DATERANGE_TOOLTIP}\r\n active={!!selectedDateRange}\r\n hasPopoverViewportHeightLimit\r\n isNativeMobileSelect={false}\r\n hasPopoverButtonWidthLimit={false}\r\n listProps={selectWithTooltipListProps}\r\n >\r\n {dateRangeGroups.flatMap(({ label, dateRanges }, index) => [\r\n {label},\r\n ...dateRanges.map(({ href, value, label }) => (\r\n \r\n {label}\r\n \r\n )),\r\n ])}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Delayed } from '../delayed'\r\nimport { Spinner } from '../spinner'\r\n\r\ninterface Props {\r\n label: React.ReactNode\r\n isLoading: boolean\r\n}\r\n\r\nexport function LabelWithDelayedSpinner({ label, isLoading }: Props) {\r\n return (\r\n <>\r\n {label}\r\n {isLoading && (\r\n
\r\n {label}}>\r\n \r\n \r\n
\r\n )}\r\n \r\n )\r\n}\r\n","import classNames from 'classnames'\r\nimport * as React from 'react'\r\nimport { Link, To } from 'react-router-dom'\r\n\r\nimport { BoxRounding } from '../box'\r\nimport { Button, ButtonHTMLProps, ButtonProps, ButtonSizeType } from '../button'\r\nimport { DropdownSeparator } from '../dropdown'\r\nimport { Icon } from '../icon'\r\nimport { SelectItem, SelectOption, SelectWithTooltip } from '../select'\r\nimport { LabelWithDelayedSpinner } from './label-with-delayed-spinner'\r\n\r\nexport type TimeframeBaseOption = SelectItem & {\r\n labelShort: string\r\n labelPageTitle?: string\r\n href?: To\r\n}\r\n\r\ninterface Props {\r\n chartIndex: number\r\n isCompactView: boolean\r\n timeFrameGroups: Array<{ label: string; timeframes: TimeFrame[] }>\r\n selectedTimeframe: string\r\n onTimeframeSelect: (value: TimeFrame) => void\r\n favoriteTimeframes: string[]\r\n onFavoriteTimeframeToggle: (value: TimeFrame) => void\r\n rounding: keyof typeof BoxRounding\r\n size?: ButtonSizeType\r\n isLoading?: boolean\r\n}\r\n\r\nconst TIMEFRAME_TOOLTIP = 'Interval'\r\n\r\nexport function TimeframeSelect({\r\n size,\r\n chartIndex,\r\n timeFrameGroups,\r\n selectedTimeframe,\r\n favoriteTimeframes,\r\n isLoading = false,\r\n isCompactView,\r\n onTimeframeSelect,\r\n onFavoriteTimeframeToggle,\r\n rounding,\r\n}: Props) {\r\n const flatTimeframes = React.useMemo(() => timeFrameGroups.flatMap(({ timeframes }) => timeframes), [timeFrameGroups])\r\n\r\n const buttonProps = React.useMemo(\r\n () => ({\r\n size,\r\n rounding,\r\n rightContent: undefined,\r\n className: '',\r\n theme: 'chip',\r\n appearance: !isCompactView ? 'square' : undefined,\r\n }),\r\n [size, isCompactView, rounding]\r\n )\r\n\r\n const selectWithTooltipListProps = React.useMemo(() => ({ rounding }), [rounding])\r\n\r\n return (\r\n \r\n } isLoading={isLoading && isCompactView} />\r\n
\r\n }\r\n buttonContent={isCompactView ? flatTimeframes.find(({ value }) => value === selectedTimeframe)?.labelShort : ''}\r\n data-testid={`chart-${chartIndex}-timeframes-select`}\r\n hasPopoverViewportHeightLimit\r\n isNativeMobileSelect={false}\r\n hasPopoverButtonWidthLimit={false}\r\n listProps={selectWithTooltipListProps}\r\n >\r\n {timeFrameGroups.flatMap(({ timeframes }, groupIndex) => [\r\n ,\r\n ...timeframes.map((item) => {\r\n const isIconButtonActive = favoriteTimeframes.includes(item.value)\r\n return (\r\n ) => {\r\n ev.stopPropagation()\r\n ev.preventDefault()\r\n onFavoriteTimeframeToggle(item)\r\n }}\r\n className={classNames('group -mr-2', {\r\n 'text-gray-300': !isIconButtonActive,\r\n 'text-yellow-200': isIconButtonActive,\r\n })}\r\n >\r\n \r\n \r\n \r\n }\r\n >\r\n {item.label}\r\n \r\n )\r\n }),\r\n ])}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport { Link } from 'react-router-dom'\r\n\r\nimport { useElementMeasure } from '../../hooks/use-element-measure'\r\nimport { BoxRounding } from '../box'\r\nimport { Button, ButtonSizeType } from '../button'\r\nimport { DateRangeBaseOption, DateRangeSelect } from './daterange-select'\r\nimport { LabelWithDelayedSpinner } from './label-with-delayed-spinner'\r\nimport { TimeframeBaseOption, TimeframeSelect } from './timeframe-select'\r\n\r\ninterface Props {\r\n isPremium?: boolean\r\n chartIndex?: number\r\n compactViewMaxBreakpointPx?: number\r\n timeFrameGroups: Array<{ label: string; timeframes: TimeFrame[] }>\r\n dateRangeGroups: Array<{ label: string; dateRanges: DateRange[] }>\r\n selectedTimeframe: string\r\n selectedDateRange: string | null\r\n onTimeframeSelect: (value: TimeFrame) => void\r\n onDateRangeSelect: (value: DateRange) => void\r\n favoriteTimeframes: string[]\r\n onFavoriteTimeframeToggle: (value: TimeFrame) => void\r\n size?: ButtonSizeType\r\n loadingTimeframe?: string\r\n rounding?: keyof typeof BoxRounding\r\n isDateRangeAvailable?: boolean\r\n containerElement?: HTMLElement\r\n className?: string\r\n isFavoritesEnabled?: boolean\r\n isScrollIntoViewEnabled?: boolean\r\n}\r\n\r\nfunction getTimeframeChipElementId({ timeframe, chartIndex }: { timeframe: string; chartIndex: number }) {\r\n return `${chartIndex}-${timeframe}`\r\n}\r\n\r\nexport function TimeframeBar({\r\n isPremium = FinvizSettings.hasUserPremium,\r\n chartIndex = 0,\r\n compactViewMaxBreakpointPx = 400,\r\n timeFrameGroups,\r\n dateRangeGroups,\r\n selectedTimeframe,\r\n selectedDateRange,\r\n favoriteTimeframes,\r\n loadingTimeframe,\r\n onTimeframeSelect,\r\n onDateRangeSelect,\r\n onFavoriteTimeframeToggle,\r\n size,\r\n rounding = 'regular',\r\n isDateRangeAvailable = true,\r\n containerElement,\r\n className,\r\n isFavoritesEnabled = true,\r\n isScrollIntoViewEnabled = true,\r\n}: Props) {\r\n const [scrollWrapperElement, setScrollWrapperElement] = React.useState(null)\r\n const [timeframeButtonsScrollLocation, setTimeframeButtonsScrollLocation] = React.useState({\r\n isOnLeftEdge: true,\r\n isOnRightEdge: true,\r\n })\r\n const { setElementRef, elementWidth } = useElementMeasure(containerElement)\r\n const flatTimeframes = React.useMemo(() => timeFrameGroups.flatMap(({ timeframes }) => timeframes), [timeFrameGroups])\r\n const isStockDetailTimeframeBar = rounding === 'none' && size === 'regular'\r\n\r\n const timeframesInExpandedPanel = React.useMemo(\r\n () => flatTimeframes.filter(({ value }) => value === selectedTimeframe || favoriteTimeframes.includes(value)),\r\n [flatTimeframes, selectedTimeframe, favoriteTimeframes]\r\n )\r\n\r\n const isCompactView = elementWidth < compactViewMaxBreakpointPx || timeframesInExpandedPanel.length <= 1\r\n const checkTimeframeWrapperScrollPosition = React.useCallback(() => {\r\n if (scrollWrapperElement) {\r\n const isOnLeftEdge = scrollWrapperElement.scrollLeft === 0\r\n const isOnRightEdge =\r\n scrollWrapperElement.offsetWidth + scrollWrapperElement.scrollLeft >= scrollWrapperElement.scrollWidth\r\n\r\n if (\r\n timeframeButtonsScrollLocation.isOnLeftEdge !== isOnLeftEdge ||\r\n timeframeButtonsScrollLocation.isOnRightEdge !== isOnRightEdge\r\n ) {\r\n setTimeframeButtonsScrollLocation({ isOnLeftEdge, isOnRightEdge })\r\n }\r\n }\r\n }, [timeframeButtonsScrollLocation, scrollWrapperElement])\r\n\r\n React.useEffect(() => {\r\n checkTimeframeWrapperScrollPosition()\r\n }, [checkTimeframeWrapperScrollPosition, scrollWrapperElement, elementWidth])\r\n\r\n React.useEffect(() => {\r\n if (!isCompactView && isScrollIntoViewEnabled) {\r\n const timeframeElement = document.getElementById(\r\n getTimeframeChipElementId({ chartIndex, timeframe: selectedTimeframe })\r\n )\r\n timeframeElement?.scrollIntoView({ inline: 'center', block: 'nearest' })\r\n }\r\n }, [isCompactView, chartIndex, selectedTimeframe, elementWidth, isScrollIntoViewEnabled])\r\n\r\n return (\r\n \r\n {isFavoritesEnabled && (\r\n
\r\n \r\n
\r\n )}\r\n {!isCompactView && (\r\n
\r\n \r\n {\r\n /*\r\n * Vertical scrolling doesn't scroll horizontally by default (it's possible when holding shift)\r\n * When using touchpad we may get values in both delatX and deltaY, so if someone's scrolling horizontally we don't want to do anything\r\n * but if they are scrolling vertically (deltaY > deltaX) we want to scroll horizontally the value they would nativally scroll in vertical direction\r\n * */\r\n const absDx = Math.abs(event.deltaX)\r\n const absDy = Math.abs(event.deltaY)\r\n if (absDy > absDx) {\r\n event.currentTarget.scrollLeft += event.deltaY\r\n }\r\n }}\r\n >\r\n
\r\n {timeframesInExpandedPanel.map((timeframe) => (\r\n onTimeframeSelect(timeframe)}\r\n rounding={rounding}\r\n >\r\n \r\n \r\n ))}\r\n
\r\n
\r\n \r\n
\r\n )}\r\n {isDateRangeAvailable && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { TooltipColor } from './types'\r\n\r\nexport interface TooltipBoxProps extends Omit, 'ref'> {\r\n /**\r\n * Color of the tooltip. If se to `none`, the tooltip will have default color\r\n * based on light/dark theme\r\n *\r\n * @default 'none'\r\n */\r\n color?: keyof typeof TooltipColor\r\n}\r\n\r\nexport const TooltipBox = React.forwardRef(function TooltipBox(\r\n { color = 'none', ...props }: TooltipBoxProps,\r\n ref: React.ForwardedRef\r\n) {\r\n const tooltipColor = TooltipColor[color]\r\n\r\n return (\r\n \r\n {props.children}\r\n \r\n )\r\n})\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Tooltip'\r\n\r\nimport { TooltipArrow } from './tooltip-arrow'\r\nimport { TooltipBox, TooltipBoxProps } from './tooltip-box'\r\n\r\ninterface TooltipProps extends TooltipBoxProps {\r\n /**\r\n * The returned object from `useTooltipState`\r\n */\r\n state: Reakit.TooltipStateReturn\r\n}\r\n\r\nexport function Tooltip({ state, children, color = 'none', ...props }: React.PropsWithChildren) {\r\n return (\r\n \r\n {({ onTransitionEnd, onAnimationEnd, ...tooltipProps }) => (\r\n
\r\n \r\n \r\n \r\n \r\n {children}\r\n \r\n
\r\n )}\r\n
\r\n )\r\n}\r\n","import * as React from 'react'\r\nimport * as Reakit from 'reakit/Tooltip'\r\n\r\ninterface TooltipButtonProps extends Reakit.TooltipReferenceHTMLProps {\r\n state: Reakit.TooltipStateReturn\r\n}\r\n/**\r\n * The trigger button component which handles ref & focus return, etc.\r\n */\r\nexport const TooltipTrigger = React.forwardRef(\r\n ({ state, ...props }: TooltipButtonProps, ref: React.ForwardedRef) => (\r\n \r\n {props.children}\r\n \r\n )\r\n)\r\n","import * as Reakit from 'reakit/Tooltip'\r\n\r\nimport { COMPONENT_ANIMATION_DURATION } from '../constants'\r\n\r\n/**\r\n * Hook which provides state to tooltips\r\n */\r\nexport function useTooltipState(settings?: Reakit.TooltipInitialState) {\r\n return Reakit.useTooltipState({\r\n ...settings,\r\n animated: COMPONENT_ANIMATION_DURATION,\r\n })\r\n}\r\n","import classnames from 'classnames'\r\n\r\nimport { TooltipColor } from './types'\r\n\r\ntype PositionMain = 'auto' | 'top' | 'bottom' | 'left' | 'right'\r\ntype PositionSecondary = 'start' | 'end'\r\ntype Placement = PositionMain | `${PositionMain}-${PositionSecondary}`\r\n\r\nconst transformMap: Record = {\r\n auto: '',\r\n top: 'rotateZ(180deg)',\r\n right: 'rotateZ(-90deg)',\r\n bottom: 'rotateZ(360deg)',\r\n left: 'rotateZ(90deg)',\r\n}\r\n\r\ninterface TooltipArrowProps {\r\n color?: keyof typeof TooltipColor\r\n placement: Placement\r\n className?: string\r\n}\r\n\r\n/**\r\n * Custom arrow for the dropdown\r\n */\r\nexport function TooltipArrow({ placement, color = 'none', className }: TooltipArrowProps) {\r\n const positionMain = placement.split('-')[0] as PositionMain\r\n const arrowColor = TooltipColor[color]\r\n\r\n return (\r\n \r\n \r\n \r\n )\r\n}\r\n","export enum TooltipColor {\r\n none,\r\n green,\r\n red,\r\n orange,\r\n blue,\r\n dark,\r\n}\r\n","import classnames from 'classnames'\r\nimport React, { ComponentProps, ElementType, HTMLProps, PropsWithChildren, ReactNode } from 'react'\r\n\r\ntype HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6\r\n\r\ninterface HeadingProps extends HTMLProps {\r\n /**\r\n * Heading level\r\n */\r\n level: HeadingLevel\r\n}\r\n\r\nfunction getHeadingElement(level: HeadingLevel) {\r\n switch (level) {\r\n case 1:\r\n return 'h1'\r\n case 2:\r\n return 'h2'\r\n case 3:\r\n return 'h3'\r\n case 4:\r\n return 'h4'\r\n case 5:\r\n return 'h5'\r\n default:\r\n return 'h6'\r\n }\r\n}\r\n\r\nexport function Heading({ level, children, ...props }: PropsWithChildren) {\r\n return React.createElement(\r\n getHeadingElement(level),\r\n {\r\n ...props,\r\n className: classnames(props.className, 'font-bold', {\r\n 'text-3xl': level === 1,\r\n 'text-2xl': level === 2,\r\n 'text-xl': level === 3,\r\n 'text-sm': level === 5,\r\n 'text-2xs': level === 6,\r\n }),\r\n },\r\n children\r\n )\r\n}\r\n\r\ninterface ParagraphProps extends Omit>, 'size' | 'as'> {\r\n /**\r\n * Determines which element the text should render to\r\n *\r\n * @default p\r\n */\r\n as?: ElementType\r\n\r\n /**\r\n * Font size for the paragraph\r\n * - tiny - 10px\r\n * - small - 12px\r\n * - default - 14px\r\n * - medium - 16px\r\n * - large - 18px\r\n *\r\n * @default default\r\n */\r\n size?: 'tiny' | 'small' | 'default' | 'medium' | 'large'\r\n\r\n /**\r\n * Paragraph font weight\r\n */\r\n medium?: boolean\r\n}\r\n\r\nexport function Paragraph({\r\n as = 'p',\r\n size = 'default',\r\n medium,\r\n children,\r\n ...props\r\n}: PropsWithChildren>) {\r\n return React.createElement(\r\n as,\r\n {\r\n ...props,\r\n className: classnames(props.className, {\r\n 'font-medium': medium,\r\n 'text-lg': size === 'large',\r\n 'text-sm': size === 'default',\r\n 'text-2xs': size === 'small',\r\n 'text-3xs': size === 'tiny',\r\n }),\r\n },\r\n children\r\n )\r\n}\r\n\r\ninterface LabelProps extends Omit, 'title'> {\r\n title?: ReactNode\r\n}\r\n\r\nexport function Label({ title, children, ...props }: PropsWithChildren) {\r\n return (\r\n \r\n )\r\n}\r\n","export const CRYPTO_TICKERS = [\r\n 'BTCUSD',\r\n 'LTCUSD',\r\n 'ETHUSD',\r\n 'XRPUSD',\r\n 'BCHUSD',\r\n 'BTCEUR',\r\n 'LTCEUR',\r\n 'ETHEUR',\r\n 'XRPEUR',\r\n 'BCHEUR',\r\n 'LTCBTC',\r\n 'ETHBTC',\r\n 'XRPBTC',\r\n 'BCHBTC',\r\n]\r\n\r\n// Keep in sync with the copy in Charts repo - app/constants/common.ts\r\nexport enum TIMEFRAME {\r\n i1 = 'i1',\r\n i2 = 'i2',\r\n i3 = 'i3',\r\n i5 = 'i5',\r\n i10 = 'i10',\r\n i15 = 'i15',\r\n i30 = 'i30',\r\n h = 'h',\r\n h2 = 'h2',\r\n h4 = 'h4',\r\n d = 'd',\r\n w = 'w',\r\n m = 'm',\r\n}\r\n","// Copy if this file is in charts repo in app/utils/ folder\r\nimport * as React from 'react'\r\n\r\nexport function useIsMounted() {\r\n const isMountedRef = React.useRef(false)\r\n const getIsMounted = React.useCallback(() => isMountedRef.current, [])\r\n\r\n React.useEffect(() => {\r\n isMountedRef.current = true\r\n return () => {\r\n isMountedRef.current = false\r\n }\r\n }, [])\r\n\r\n return getIsMounted\r\n}\r\n","import debounce from 'lodash.debounce'\r\nimport * as React from 'react'\r\n\r\nimport { useIsMounted } from './use-is-mounted'\r\nimport { useResizeObserver } from './use-resize-observer'\r\n\r\nexport function useElementMeasure(elementOverride: HTMLElement | null = null) {\r\n const ResizeObserver = useResizeObserver()\r\n const getIsMounted = useIsMounted()\r\n const [elementRef, setElementRef] = React.useState(elementOverride)\r\n const [elementWidth, setElementWidth] = React.useState(elementRef?.offsetWidth ?? 0)\r\n const [elementHeight, setElementHeight] = React.useState(elementRef?.offsetHeight ?? 0)\r\n\r\n React.useEffect(() => {\r\n if (!ResizeObserver) {\r\n return\r\n }\r\n\r\n const measureElement = () => {\r\n if (!getIsMounted()) {\r\n return\r\n }\r\n const newElementWidth = elementRef?.offsetWidth\r\n const newElementHeight = elementRef?.offsetHeight\r\n if (newElementWidth !== elementWidth) {\r\n setElementWidth(newElementWidth ?? 0)\r\n }\r\n if (newElementHeight !== elementHeight) {\r\n setElementHeight(newElementHeight ?? 0)\r\n }\r\n }\r\n const measureElementDebounced = debounce(measureElement, 200)\r\n\r\n const resizeObserver = new ResizeObserver((entries) => {\r\n /**\r\n * the reason for requestAnimationFrame is described here https://github.com/quasarframework/quasar/issues/2233\r\n * their approach was mostly to intercept and silence the error but I managed to avoid the error using requestAnimationFrame\r\n * */\r\n window.requestAnimationFrame(() => {\r\n if (Array.isArray(entries) && entries.length > 0) {\r\n measureElementDebounced()\r\n }\r\n })\r\n })\r\n\r\n if (elementRef) {\r\n resizeObserver.observe(elementRef)\r\n }\r\n\r\n measureElement()\r\n\r\n return () => {\r\n measureElementDebounced.cancel()\r\n resizeObserver?.disconnect()\r\n }\r\n }, [ResizeObserver, elementWidth, elementRef, elementHeight, getIsMounted])\r\n\r\n return { setElementRef: elementOverride ? () => {} : setElementRef, elementWidth, elementHeight }\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { loadResizeObserverPolyfill } from '../util'\r\n\r\nexport function useResizeObserver() {\r\n const controller = React.useRef('AbortController' in window ? new AbortController() : undefined)\r\n const [ResizeObserver, setResizeObserver] = React.useState(\r\n () => window.ResizeObserver\r\n )\r\n\r\n React.useEffect(() => {\r\n if (typeof ResizeObserver === 'undefined') {\r\n loadResizeObserverPolyfill().then((polyfill) => {\r\n if (!controller.current?.signal.aborted) {\r\n setResizeObserver(() => polyfill)\r\n }\r\n })\r\n }\r\n }, [ResizeObserver])\r\n\r\n // Cleanup effect to abort the controller\r\n React.useEffect(() => () => controller.current?.abort(), [])\r\n\r\n return ResizeObserver\r\n}\r\n","import * as React from 'react'\r\nimport { usePopper } from 'react-popper'\r\n\r\nimport { Button } from '../button'\r\nimport { getExtendedDialogState } from '../dialog'\r\nimport { Dropdown, DropdownItem, DropdownSeparator, useDropdownState } from '../dropdown'\r\nimport { ObjectHash } from '../types'\r\n\r\nfunction getVirtualRef(top: number, left: number) {\r\n return {\r\n getBoundingClientRect(): DOMRect {\r\n const rect = {\r\n top: top - window.scrollY,\r\n x: top - window.scrollY,\r\n left: left - window.scrollX,\r\n y: left - window.scrollX,\r\n bottom: top,\r\n right: left,\r\n width: 0,\r\n height: 0,\r\n }\r\n\r\n return {\r\n ...rect,\r\n toJSON: () => rect,\r\n }\r\n },\r\n }\r\n}\r\n\r\nexport interface IContextMenuOption {\r\n type?: never\r\n id: string\r\n label: React.ReactNode\r\n onClick?: () => void\r\n options?: ContextMenuItem[]\r\n gtag?: ObjectHash\r\n}\r\n\r\ninterface IContextMenuDivider {\r\n type: 'divider'\r\n label?: React.ReactNode\r\n}\r\n\r\nexport type ContextMenuItem = IContextMenuOption | IContextMenuDivider\r\n\r\ninterface ContextMenuProps {\r\n /**\r\n * Top coordinate of the click\r\n */\r\n top: number\r\n\r\n /**\r\n * Left coordinate of the click\r\n */\r\n left: number\r\n\r\n /**\r\n * Items visible in the menu\r\n */\r\n items: ContextMenuItem[]\r\n\r\n /**\r\n * Callback to hide the menu\r\n */\r\n hide: () => void\r\n}\r\n\r\nexport function ContextMenu({ top, left, hide, items }: ContextMenuProps) {\r\n const [popperElement, setPopperElement] = React.useState(null)\r\n const virtualRef = React.useMemo(() => getVirtualRef(top, left), [left, top])\r\n const dropdownState = useDropdownState({ placement: 'bottom-start' })\r\n const { isFullyClosed } = getExtendedDialogState(dropdownState)\r\n const hasBeenOpen = React.useRef(false)\r\n\r\n const { styles, attributes } = usePopper(virtualRef, popperElement, {\r\n placement: 'auto-end',\r\n modifiers: [\r\n {\r\n name: 'offset',\r\n options: {\r\n offset: [5, 5],\r\n },\r\n },\r\n ],\r\n })\r\n\r\n /**\r\n * This effect handles closing the context menu (parent element) itself\r\n */\r\n React.useEffect(() => {\r\n if (isFullyClosed && hasBeenOpen.current) hide()\r\n }, [isFullyClosed, hide])\r\n\r\n /**\r\n * This effect handles opening/closing the inner dropdown\r\n */\r\n React.useEffect(() => {\r\n dropdownState.show()\r\n hasBeenOpen.current = true // This acts as a way to differentiate the first render\r\n\r\n return () => dropdownState.hide()\r\n // This needs to run only on mount/unmount for obvious reasons\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [])\r\n\r\n return (\r\n \r\n }\r\n state={dropdownState}\r\n items={items}\r\n isStatic\r\n />\r\n \r\n )\r\n}\r\n\r\ninterface ContextMenuInnerProps {\r\n label: JSX.Element\r\n items: ContextMenuItem[]\r\n state: ReturnType\r\n isStatic?: boolean\r\n}\r\n\r\nfunction ContextMenuInner(\r\n { label, items, state, isStatic }: ContextMenuInnerProps,\r\n ref: React.ForwardedRef\r\n) {\r\n const innerState = useDropdownState({ placement: 'right-start' })\r\n\r\n return (\r\n \r\n {items.map((item, index) => {\r\n if (item.type === 'divider') {\r\n return {item.label}\r\n }\r\n\r\n if (item?.options !== undefined) {\r\n return (\r\n \r\n {item.label}\r\n \r\n }\r\n items={item.options}\r\n />\r\n )\r\n }\r\n\r\n return (\r\n {\r\n item.onClick?.()\r\n window.gtag?.('event', 'context-menu', Object.assign({ menu_option: item.id }, item.gtag))\r\n }}\r\n data-testid={`dropdown-menu-${item.id}`}\r\n >\r\n {item.label}\r\n \r\n )\r\n })}\r\n \r\n )\r\n}\r\n\r\nconst ContextMenuDropdown = React.forwardRef(ContextMenuInner)\r\n","import classnames from 'classnames'\r\nimport React from 'react'\r\n\r\ninterface GridLayoutProps extends React.HTMLProps {\r\n /**\r\n * Number of columns\r\n */\r\n columns?: number\r\n\r\n /**\r\n * Number of rows\r\n */\r\n rows?: number\r\n\r\n /**\r\n * Whether or not a border is rendered between and around items. eg. charts\r\n * on HP won’t have a border\r\n *\r\n * @default false\r\n */\r\n border?: boolean\r\n}\r\n\r\nexport const ChartGridCell = React.forwardRef(\r\n ({ children, gridArea, className, ...props }, ref) => (\r\n \r\n {children}\r\n \r\n )\r\n)\r\n\r\ninterface ChartGridCellProps extends React.HTMLProps {\r\n /**\r\n * Css grid-area value\r\n */\r\n gridArea?: string\r\n}\r\n\r\nexport function GridLayout({ columns = 1, rows = 1, border = false, children, className, ...props }: GridLayoutProps) {\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n\r\ninterface ChartGridProps extends GridLayoutProps {\r\n isResizable?: boolean\r\n}\r\n\r\nexport const ChartGrid: React.FC = (props) => \r\n","import * as React from 'react'\r\n\r\nimport { PropsWithAs, RequireByKey } from '../types'\r\n\r\nconst defaultValueAccessor: ValueAccessor = (data) => data\r\n\r\nconst DEFAULT_VALUE_KEY = 'value'\r\nconst DEFAULT_CHANGE_KEY = 'onChange'\r\n\r\ntype ValueAccessor<\r\n TagType extends React.ElementType,\r\n ValueKey extends keyof React.ComponentProps = typeof DEFAULT_VALUE_KEY,\r\n ChangeKey extends keyof React.ComponentProps = typeof DEFAULT_CHANGE_KEY\r\n> = (...args: Parameters[ChangeKey]>) => React.ComponentProps[ValueKey]\r\n\r\nexport type InnerStateProps<\r\n TagType extends React.ElementType,\r\n ValueKey extends keyof React.ComponentProps,\r\n ChangeKey extends keyof React.ComponentProps\r\n> = RequireByKey, 'as'> & {\r\n valueKey?: ValueKey\r\n changeKey?: ChangeKey\r\n valueAccessor?: ValueAccessor\r\n}\r\n\r\nexport function InnerState<\r\n TagType extends React.ElementType,\r\n ValueKey extends keyof React.ComponentProps = typeof DEFAULT_VALUE_KEY,\r\n ChangeKey extends keyof React.ComponentProps = typeof DEFAULT_CHANGE_KEY\r\n>({\r\n as: asComponent,\r\n valueKey = 'value' as ValueKey,\r\n changeKey = 'onChange' as ChangeKey,\r\n valueAccessor = defaultValueAccessor,\r\n ...props\r\n}: InnerStateProps) {\r\n const { [valueKey]: value, [changeKey]: onChange } = props\r\n const [state, setState] = React.useState[ValueKey]>(value)\r\n\r\n const handleChange = React.useCallback>(\r\n (...args) => {\r\n setState(valueAccessor(...args))\r\n onChange(...args)\r\n },\r\n [onChange, valueAccessor]\r\n )\r\n\r\n return React.createElement(asComponent, {\r\n ...props,\r\n [valueKey]: state,\r\n [changeKey]: handleChange,\r\n })\r\n}\r\n","import classnames from 'classnames'\r\nimport { HTMLProps, ReactNode, useEffect, useMemo, useRef, useState } from 'react'\r\n\r\nimport { Label } from './typography'\r\n\r\nexport enum RangeSize {\r\n small = 'sm:h-6', // 24px height\r\n regular = 'sm:h-7', // 28px height\r\n medium = 'sm:h-8', // 32px height\r\n large = 'sm:h-9', // 36px height\r\n}\r\n\r\ntype InputProps = HTMLProps\r\n\r\ninterface RangeSliderProps extends Omit {\r\n /**\r\n * Label which is rendered above the select\r\n */\r\n label?: ReactNode\r\n\r\n /**\r\n * Range size. All inputs have forced height on mobile to avoid zoom\r\n *\r\n * @default regular\r\n */\r\n size?: keyof typeof RangeSize\r\n\r\n /**\r\n * Element which will be rendered on the left side of the slider\r\n */\r\n leftContent?: ReactNode\r\n\r\n /**\r\n * Element which will be rendered on the right side of the slider\r\n */\r\n rightContent?: ReactNode\r\n\r\n /**\r\n * Class name for the wrapper element\r\n */\r\n className?: string\r\n\r\n /**\r\n * Class name for the input element\r\n */\r\n inputClassName?: string\r\n\r\n /**\r\n * Min value for the input\r\n *\r\n * @default 0\r\n */\r\n min?: number\r\n\r\n /**\r\n * Max value for the input\r\n *\r\n * @default 100\r\n */\r\n max?: number\r\n\r\n /**\r\n * Step value for the input\r\n *\r\n * @default 1\r\n */\r\n step?: number\r\n\r\n /**\r\n * Current value\r\n */\r\n value: number\r\n\r\n /**\r\n * Callback when value changes\r\n */\r\n onChange: InputProps['onChange']\r\n}\r\n\r\nexport function RangeSlider({\r\n label,\r\n size = 'regular',\r\n leftContent,\r\n rightContent,\r\n min = 0,\r\n max = 100,\r\n step = 1,\r\n className,\r\n inputClassName,\r\n ...props\r\n}: RangeSliderProps) {\r\n const [hasTrack, setHasTrack] = useState(false)\r\n const trackRef = useRef(null)\r\n const thumbRef = useRef(null)\r\n\r\n useEffect(() => {\r\n setHasTrack(Boolean(trackRef.current && thumbRef.current))\r\n }, [])\r\n\r\n const thumbLeft = useMemo(() => {\r\n const track = trackRef.current\r\n const thumb = thumbRef.current\r\n const valuePercent = (props.value - min) / (max - min)\r\n\r\n if (!hasTrack || !track || !thumb) return\r\n\r\n const trackBox = track.getBoundingClientRect()\r\n const thumbBox = thumb.getBoundingClientRect()\r\n\r\n return ((valuePercent * (trackBox.width - thumbBox.width)) / trackBox.width) * 100\r\n }, [min, max, props.value, hasTrack])\r\n\r\n return (\r\n \r\n )\r\n}\r\n","import { ButtonRoundingType, ButtonThemeType } from '../button'\r\nimport { IconNameType } from '../icon'\r\n\r\nexport enum ToolbarTheme {\r\n chipTransparent, // (default)\r\n alternative,\r\n}\r\n\r\nexport enum ToolbarDirection {\r\n vertical,\r\n horizontal,\r\n}\r\n\r\nexport type ToolbarDirectionType = keyof typeof ToolbarDirection\r\n\r\nexport interface IButtonThemeSettings {\r\n className?: string\r\n theme: ButtonThemeType\r\n rounding: ButtonRoundingType\r\n}\r\n\r\nexport interface IToolbarItem {\r\n id: string\r\n icon: IconNameType\r\n iconActive?: IconNameType\r\n iconAction?: IconNameType\r\n title: string\r\n titleActive?: string\r\n titleAction?: string\r\n}\r\n\r\nexport type ToolbarThemeType = keyof typeof ToolbarTheme\r\n","import * as React from 'react'\r\n\r\nimport { ToolbarDirection, ToolbarTheme } from './interfaces'\r\n\r\nexport interface IToolbarContext {\r\n direction: ToolbarDirection\r\n theme: ToolbarTheme\r\n isWrapped: boolean\r\n isStretched: boolean\r\n}\r\n\r\nexport const ToolbarContext = React.createContext({\r\n direction: ToolbarDirection.vertical,\r\n theme: ToolbarTheme.chipTransparent,\r\n isWrapped: false,\r\n isStretched: false,\r\n})\r\n\r\nexport function useToolbarContext() {\r\n return React.useContext(ToolbarContext)\r\n}\r\n","import classnames from 'classnames'\r\nimport throttle from 'lodash.throttle'\r\nimport React from 'react'\r\n\r\nimport { isSafariDesktop } from '../../../app/shared/isMobile'\r\nimport { IToolbarContext, ToolbarContext } from './hooks'\r\nimport { ToolbarDirection, ToolbarDirectionType, ToolbarTheme, ToolbarThemeType } from './interfaces'\r\n\r\nconst getToolbarSettings = ({ direction, isWrapped, theme }: IToolbarContext): React.HTMLProps => {\r\n switch (isWrapped) {\r\n case true:\r\n return {\r\n className: classnames('flex shrink-0 items-center bg-white dark:bg-gray-800', {\r\n 'flex-wrap justify-between': direction === ToolbarDirection.vertical,\r\n 'border border-gray-100 dark:border-gray-700 p-1 gap-1 border-box rounded-md':\r\n FinvizSettings.hasRedesignEnabled,\r\n }),\r\n }\r\n\r\n default:\r\n return {\r\n className: classnames('flex shrink-0 items-center p-1.5 bg-white dark:bg-gray-800', {\r\n 'space-x-1.5': direction === ToolbarDirection.horizontal && FinvizSettings.hasRedesignEnabled,\r\n 'flex-col space-y-2 overflow-hidden overflow-y-auto [--inset-l:0.5rem] landscape-primary:pl-inset-left':\r\n direction === ToolbarDirection.vertical,\r\n 'pb-inset-bottom [--inset-b:0.5rem]': theme !== ToolbarTheme.alternative,\r\n 'w-screen space-x-2 overflow-hidden overflow-x-auto':\r\n direction === ToolbarDirection.horizontal && theme !== ToolbarTheme.alternative,\r\n 'overflow-x-hidden': theme === ToolbarTheme.alternative,\r\n }),\r\n }\r\n }\r\n}\r\n\r\nexport interface ToolbarProps {\r\n /**\r\n * Toolbar direction\r\n *\r\n * @default vertical\r\n */\r\n direction?: ToolbarDirectionType\r\n\r\n /**\r\n * Toolbar buttons theme\r\n *\r\n * @default light\r\n */\r\n theme?: ToolbarThemeType\r\n}\r\n\r\nexport function Toolbar({\r\n direction = 'vertical',\r\n theme = 'chipTransparent',\r\n children,\r\n}: React.PropsWithChildren) {\r\n const toolbarRef = React.useRef(null)\r\n const contextProviderValue = React.useMemo(\r\n () => ({\r\n direction: ToolbarDirection[direction],\r\n theme: ToolbarTheme[theme],\r\n isWrapped:\r\n ToolbarDirection[direction] === ToolbarDirection.vertical && ToolbarTheme[theme] === ToolbarTheme.alternative,\r\n isStretched:\r\n ToolbarDirection[direction] === ToolbarDirection.horizontal && ToolbarTheme[theme] === ToolbarTheme.alternative,\r\n }),\r\n [direction, theme]\r\n )\r\n const toolbarSettings = getToolbarSettings(contextProviderValue)\r\n\r\n React.useLayoutEffect(() => {\r\n // Workaround for Safari scrollbar bug https://github.com/finvizhq/charts/issues/1038\r\n // Safari injects scrollbar after layout render and doesn't trigger reflow\r\n if (ToolbarTheme[theme] !== ToolbarTheme.alternative && isSafariDesktop()) {\r\n const forceReflow = throttle(() => {\r\n if (toolbarRef.current !== null) {\r\n const originalWidth = toolbarRef.current.style.width\r\n toolbarRef.current.style.width = '0'\r\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\r\n toolbarRef.current.offsetWidth\r\n toolbarRef.current.style.width = originalWidth\r\n }\r\n }, 200)\r\n\r\n forceReflow()\r\n window.addEventListener('resize', forceReflow)\r\n\r\n return () => {\r\n window.removeEventListener('resize', forceReflow)\r\n }\r\n }\r\n }, [theme])\r\n\r\n // reason for key is that popover is sealing initial state, description in\r\n // https://github.com/finvizhq/Finviz-Website/pull/402\r\n return (\r\n
\r\n {children}\r\n
\r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { Button, ButtonHTMLProps, ButtonProps } from '../button'\r\nimport { Delayed } from '../delayed'\r\nimport { Icon } from '../icon'\r\nimport { PropsWithAs } from '../types'\r\nimport { useToolbarContext } from './hooks'\r\nimport { IToolbarItem, ToolbarTheme } from './interfaces'\r\n\r\nfunction getButtonThemeSettings({\r\n theme,\r\n isActive,\r\n isStretched,\r\n isInAction,\r\n}: {\r\n theme: ToolbarTheme\r\n isStretched: boolean\r\n isActive?: boolean\r\n isInAction?: boolean\r\n}): Omit & ButtonProps {\r\n const includeRedesign = FinvizSettings.hasRedesignEnabled\r\n switch (theme) {\r\n case ToolbarTheme.alternative:\r\n return {\r\n className: classnames(\r\n {\r\n grow: isStretched,\r\n 'h-10 w-10': !isStretched && !includeRedesign,\r\n 'animate-pulse': isInAction,\r\n },\r\n\r\n includeRedesign && {\r\n 'rounded disabled:bg-white dark:border-transparent disabled:text-gray-300 disabled:hover:text-gray-300 dark:disabled:bg-gray-800 dark:disabled:text-gray-500':\r\n true,\r\n 'border border-white text-gray-500 dark:text-gray-400 hover:border-gray-50 hover:bg-gray-50 hover:text-gray-900 dark:hover:text-gray-200 dark:hover:border-gray-700 dark:hover:bg-gray-700':\r\n !isActive,\r\n 'border text-gray-800 dark:border-blue-500 border-blue-400 bg-blue-50 dark:text-white dark:bg-gray-700':\r\n isActive,\r\n },\r\n\r\n !includeRedesign && {\r\n 'active:bg-white disabled:bg-white disabled:text-gray-300 disabled:hover:text-gray-300': true,\r\n 'border border-white text-gray-500 hover:border-gray-100 hover:text-gray-900': !isActive,\r\n 'border border-gray-900 text-gray-900': isActive,\r\n }\r\n ),\r\n theme: 'transparent',\r\n rounding: 'none',\r\n }\r\n default:\r\n return {\r\n className: classnames(\r\n 'dark:disabled:bg-gray-800 dark:disabled:text-gray-600 disabled:text-gray-300 disabled:bg-white',\r\n { 'animate-pulse': isInAction }\r\n ),\r\n theme: 'chipTransparent',\r\n rounding: 'small',\r\n }\r\n }\r\n}\r\n\r\nexport interface ToolbarButtonProps extends Omit {\r\n item: IToolbarItem\r\n disabledTooltip?: string\r\n isInAction?: boolean\r\n}\r\n\r\nexport function ToolbarButton({\r\n item,\r\n disabledTooltip,\r\n isInAction: isInActionProp,\r\n ...props\r\n}: PropsWithAs & ToolbarButtonProps) {\r\n const { theme, isStretched } = useToolbarContext()\r\n const isInAction = isInActionProp && item.iconAction !== undefined\r\n const buttonSettings = getButtonThemeSettings({\r\n theme,\r\n isStretched,\r\n isActive: props.active,\r\n isInAction: isInAction,\r\n })\r\n\r\n const getMainIcon = () => (\r\n \r\n )\r\n\r\n return (\r\n & ToolbarButtonProps)}\r\n appearance={props.appearance ?? 'square'}\r\n title={props.disabled && disabledTooltip ? disabledTooltip : (props.active && item.titleActive) || item.title}\r\n size={theme === ToolbarTheme.chipTransparent || FinvizSettings.hasRedesignEnabled ? 'medium' : 'large'}\r\n >\r\n {props.children ??\r\n (isInAction ? (\r\n \r\n \r\n \r\n ) : (\r\n getMainIcon()\r\n ))}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\n\r\nimport { isMobile } from '../../../app/shared/isMobile'\r\nimport { Icon } from '../icon'\r\nimport { PopoverTrigger, useHoverPopover } from '../popover'\r\nimport { SelectOption } from '../select'\r\nimport { useSelect } from '../select/hooks'\r\nimport { NativeSelect } from '../select/native-select'\r\nimport { SelectList } from '../select/select-list'\r\nimport { useToolbarContext } from './hooks'\r\nimport { IToolbarItem, ToolbarTheme } from './interfaces'\r\nimport { ToolbarButton } from './toolbar-button'\r\n\r\nexport interface ToolbarGroupProps {\r\n /**\r\n * Main button item\r\n */\r\n defaultItem: IToolbarItem\r\n\r\n /**\r\n * Current selected item id\r\n */\r\n isActive: boolean\r\n\r\n /**\r\n * Should indicate some action in progress\r\n */\r\n isInAction?: boolean\r\n\r\n /**\r\n * Array of items\r\n */\r\n groupItems: IToolbarItem[]\r\n\r\n /**\r\n * Expand group button label\r\n */\r\n groupTitle?: string\r\n\r\n /**\r\n * On item select callback\r\n */\r\n onChange: (id: string) => void\r\n\r\n /**\r\n * Is item disabled\r\n */\r\n disabled?: boolean\r\n\r\n /**\r\n * Tooltip message if item is disabled\r\n */\r\n disabledTooltip?: string\r\n}\r\n\r\nexport function ToolbarGroup({\r\n defaultItem,\r\n isActive,\r\n groupItems,\r\n groupTitle,\r\n onChange,\r\n disabled,\r\n disabledTooltip,\r\n}: ToolbarGroupProps) {\r\n const { theme, isStretched } = useToolbarContext()\r\n const [selectedItem, setSelectedItem] = React.useState(defaultItem)\r\n const groupId = groupTitle?.replace(/\\s/g, '-').toLocaleLowerCase()\r\n const useMobileNativeSelect = isMobile()\r\n const isAlternativeTheme = theme === ToolbarTheme.alternative\r\n const popoverState = useHoverPopover({\r\n placement: isAlternativeTheme && isStretched ? 'bottom' : 'right-start',\r\n })\r\n const select = useSelect(\r\n popoverState,\r\n selectedItem.id,\r\n groupItems?.map((i) => ({ value: i.id, label: i.title })) ?? [],\r\n (option) => {\r\n setSelectedItem(groupItems![groupItems!.findIndex((item) => item.id === option.value)])\r\n onChange(option.value)\r\n }\r\n )\r\n\r\n return (\r\n \r\n ) => {\r\n ev.preventDefault()\r\n ev.stopPropagation()\r\n onChange(selectedItem.id)\r\n }}\r\n >\r\n \r\n \r\n \r\n\r\n {useMobileNativeSelect ? (\r\n ({ value: item.id, label: item.title }))}\r\n onChange={select.onItemChange}\r\n onClick={() => onChange(selectedItem.id)}\r\n />\r\n ) : (\r\n \r\n {groupItems.map((item) => (\r\n }\r\n data-testid={`toolbar-group-${groupId}-${item.id}`}\r\n >\r\n {item.title}\r\n \r\n ))}\r\n \r\n )}\r\n \r\n )\r\n}\r\n","import { PartialBy } from '../../types'\r\nimport { ToolbarButton } from './toolbar-button'\r\nimport { ToolbarGroup, ToolbarGroupProps } from './toolbar-group'\r\n\r\nexport function ToolbarItem({\r\n defaultItem,\r\n isActive,\r\n isInAction,\r\n groupItems,\r\n groupTitle,\r\n onChange,\r\n disabled,\r\n disabledTooltip,\r\n}: PartialBy) {\r\n const isItemActive = isActive && !disabled\r\n\r\n if (!!groupItems?.length) {\r\n return (\r\n \r\n )\r\n }\r\n\r\n return (\r\n {\r\n onChange(defaultItem.id)\r\n }}\r\n />\r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport React from 'react'\r\n\r\nimport { useToolbarContext } from './hooks'\r\nimport { ToolbarDirection, ToolbarTheme } from './interfaces'\r\n\r\nexport function ToolbarDivider() {\r\n const { direction, theme } = useToolbarContext()\r\n\r\n return (\r\n \r\n )\r\n}\r\n","import * as React from 'react'\r\n\r\nimport { Input, InputHTMLProps, InputProps } from './input'\r\nimport { Tooltip, TooltipTrigger, useTooltipState } from './tooltip'\r\n\r\nexport interface TooltipInputProps {\r\n /**\r\n * Tooltip text content\r\n */\r\n tooltipContent?: React.ReactNode\r\n}\r\n\r\nfunction TooltipInputComponent(\r\n { tooltipContent, ...props }: TooltipInputProps & InputProps & InputHTMLProps,\r\n ref: React.ForwardedRef\r\n) {\r\n const tooltip = useTooltipState({ placement: 'bottom' })\r\n\r\n return (\r\n <>\r\n ev.preventDefault()}\r\n onMouseLeave={(ev) => ev.preventDefault()}\r\n >\r\n \r\n \r\n \r\n {tooltipContent}\r\n \r\n \r\n )\r\n}\r\n\r\nexport const TooltipInput = React.forwardRef(TooltipInputComponent)\r\n","import { Box } from '../box'\r\nimport { Heading, Paragraph } from '../typography'\r\nimport { TourStep } from './types'\r\n\r\nexport function StepContent({ step }: { step: TourStep }) {\r\n return (\r\n \r\n {step.title && (\r\n \r\n {step.title}\r\n \r\n )}\r\n {step.body && {step.body}}\r\n \r\n )\r\n}\r\n","import classnames from 'classnames'\r\nimport * as React from 'react'\r\nimport * as ReactDOM from 'react-dom/server'\r\nimport Shepherd from 'shepherd.js'\r\n\r\nimport {\r\n BUTTON_BASE_CLASS,\r\n BUTTON_FOCUS_STYLES,\r\n ButtonRounding,\r\n ButtonSize,\r\n ButtonTheme,\r\n getButtonTheme,\r\n} from '../button'\r\nimport { StepContent } from './step-content'\r\nimport { TourDefinition, TourStep } from './types'\r\n\r\ntype ExcludesFalse = (x: T | false) => x is T\r\n\r\n/**\r\n * Async load Shepherd module when we need it\r\n */\r\nlet shepherdLibrary: typeof Shepherd\r\nexport async function loadShepherdLibrary(setLoading: (state: boolean) => void) {\r\n if (shepherdLibrary) return shepherdLibrary\r\n\r\n try {\r\n setLoading(true)\r\n const shepherdPromise = await import('shepherd.js')\r\n shepherdLibrary = shepherdPromise.default\r\n setLoading(false)\r\n\r\n return shepherdLibrary\r\n } catch {}\r\n}\r\n\r\n/**\r\n * Get buttons based on index in the step array\r\n */\r\nconst buttonClasses = classnames(BUTTON_BASE_CLASS, BUTTON_FOCUS_STYLES, ButtonSize.regular, ButtonRounding.regular)\r\nfunction getStepButtons(tour: Shepherd.Tour, step: TourStep, index: number, arr: TourStep[]) {\r\n return [\r\n {\r\n action: tour.complete,\r\n classes: classnames(buttonClasses, 'mr-auto', getButtonTheme(ButtonTheme.light).button),\r\n text: 'Exit',\r\n },\r\n index > 0 && {\r\n action: tour.back,\r\n classes: classnames(buttonClasses, getButtonTheme(ButtonTheme.light).button),\r\n text: step.backButton ?? 'Back',\r\n },\r\n {\r\n classes: classnames(buttonClasses, getButtonTheme(ButtonTheme.blue).button),\r\n action: tour.next,\r\n text: step.nextButton ?? (index === arr.length - 1 ? 'Finish' : 'Next'),\r\n },\r\n ].filter(Boolean as unknown as ExcludesFalse)\r\n}\r\n\r\n/**\r\n * Convert tour steps to Shepherd steps\r\n */\r\nexport function processSteps(tour: Shepherd.Tour, steps: TourStep[]): Shepherd.Step.StepOptions[] {\r\n return steps.map((step, index) => ({\r\n attachTo: { element: step.target, on: step.placement ?? 'auto' },\r\n classes: 'z-dialog',\r\n // Add offset\r\n popperOptions: {\r\n modifiers: [\r\n {\r\n name: 'offset',\r\n options: {\r\n offset: step.offset ?? [0, 10],\r\n },\r\n },\r\n ],\r\n },\r\n // Render the body\r\n text: ReactDOM.renderToString(React.createElement(StepContent, { step })),\r\n // Add buttons\r\n buttons: getStepButtons(tour, step, index, steps),\r\n }))\r\n}\r\n\r\nexport function getTourKey() {\r\n return `tour${window.location.pathname.replace(/[/.]/g, '-')}`\r\n}\r\n\r\nexport function getStepsForUser(tours: TourDefinition[]) {\r\n const lastFinishedTour = localStorage.getItem(getTourKey())\r\n const lastTourIndex = tours.findIndex((tour) => tour.id === lastFinishedTour)\r\n const allToursViewed = lastTourIndex === tours.length - 1 || tours.slice(lastTourIndex + 1).every((item) => item.skip)\r\n const toursToView = allToursViewed ? tours : tours.slice(lastTourIndex + 1)\r\n const userTour = toursToView.reduce(\r\n (acc, current) =>\r\n current.skip\r\n ? acc\r\n : {\r\n ...acc,\r\n id: current.id,\r\n steps: [...acc.steps, ...current.steps],\r\n },\r\n { id: 'tour', steps: [], initialTour: toursToView[0].id }\r\n )\r\n\r\n return { hasNewTours: !allToursViewed, tour: userTour }\r\n}\r\n\r\nexport function completeTour(key: string) {\r\n localStorage.setItem(getTourKey(), key)\r\n}\r\n","import * as React from 'react'\r\nimport Shepherd from 'shepherd.js'\r\n\r\nimport { TourDefinition } from './types'\r\nimport * as tourUtils from './utils'\r\n\r\nexport const DEFAULT_OPTIONS = {\r\n exitOnEsc: true,\r\n useModalOverlay: true,\r\n}\r\n\r\n/**\r\n * Hook which controls shepherd.js. The library is lazy-loaded when the tour starts\r\n *\r\n * Returns:\r\n * - `isLoading`: state of the library loading\r\n * - `currentTour`: tour object, only defined after library has loaded\r\n * - `startTour`: load the library and start tour. Returns `currentTour`\r\n * - `getStepsForUser`: returns a list of tour steps based on tours the user finished\r\n * - `completeTour`: persists the last finished tour to local storage\r\n */\r\nexport function useTour(options?: Shepherd.Tour.TourOptions) {\r\n const [isLoading, setIsLoading] = React.useState(false)\r\n const [currentTour, setTour] = React.useState(null)\r\n\r\n /**\r\n * We’re loading shepherd asynchronously and want to have loading state so we use\r\n * AbortController to check if the component is still mounted.\r\n */\r\n const controller = React.useRef('AbortController' in window ? new AbortController() : undefined)\r\n const loadingSetter = React.useRef((state: boolean) => {\r\n if (controller.current?.signal.aborted) return\r\n\r\n setIsLoading(state)\r\n })\r\n // Cleanup effect to abort the controller\r\n React.useEffect(() => () => controller.current?.abort(), [])\r\n\r\n const startTour = React.useCallback(\r\n async (definition: TourDefinition, setComplete = true) => {\r\n const shepherdLibrary = await tourUtils.loadShepherdLibrary(loadingSetter.current)\r\n\r\n if (shepherdLibrary && !controller.current?.signal.aborted) {\r\n const tour = currentTour ?? new shepherdLibrary.Tour({ ...DEFAULT_OPTIONS, ...options })\r\n\r\n if (!currentTour) setTour(tour)\r\n\r\n // Reset the tour steps in case they were updated\r\n Array.from(tour.steps).forEach((step) => tour.removeStep(step.id))\r\n\r\n const processedSteps = tourUtils.processSteps(tour, definition.steps)\r\n tour.addSteps(processedSteps)\r\n\r\n if (setComplete) {\r\n tourUtils.completeTour(definition.id)\r\n }\r\n\r\n tour.start()\r\n window.gtag?.('event', 'tour-start', { event_label: definition.initialTour ?? definition.id })\r\n\r\n return tour\r\n }\r\n },\r\n [currentTour, options]\r\n )\r\n\r\n return {\r\n isLoading,\r\n currentTour,\r\n startTour,\r\n getStepsForUser: tourUtils.getStepsForUser,\r\n completeTour: tourUtils.completeTour,\r\n }\r\n}\r\n","import * as time from '../../app/header/time'\r\nimport * as button from './button'\r\nimport * as buttonGroup from './button-group'\r\nimport * as checkbox from './checkbox'\r\nimport * as colorPicker from './color-picker'\r\nimport * as contextMenu from './context-menu'\r\nimport * as copyToClipboard from './copy-to-clipboard'\r\nimport * as datePicker from './date-picker'\r\nimport * as delayed from './delayed'\r\nimport * as dialog from './dialog'\r\nimport * as dropdown from './dropdown'\r\nimport * as grid from './grid'\r\nimport * as icon from './icon'\r\nimport * as innerState from './inner-state'\r\nimport * as input from './input'\r\nimport * as list from './list'\r\nimport * as notification from './notification'\r\nimport * as popover from './popover'\r\nimport * as range from './range'\r\nimport * as search from './search'\r\nimport * as select from './select'\r\nimport * as spinner from './spinner'\r\nimport * as timeframeBar from './timeframe-bar'\r\nimport * as toolbar from './toolbar'\r\nimport * as tooltip from './tooltip'\r\nimport * as tooltipInput from './tooltip-input'\r\nimport * as tour from './tour'\r\nimport * as typography from './typography'\r\n\r\nfunction exportAsGlobal(win: any, key: string) {\r\n if (!(key in win)) win[key] = {}\r\n\r\n win[key].components = {\r\n ...button,\r\n ...buttonGroup,\r\n ...checkbox,\r\n ...colorPicker,\r\n ...contextMenu,\r\n ...copyToClipboard,\r\n ...delayed,\r\n ...dialog,\r\n ...datePicker,\r\n ...dropdown,\r\n ...grid,\r\n ...icon,\r\n ...innerState,\r\n ...input,\r\n ...list,\r\n ...notification,\r\n ...popover,\r\n ...range,\r\n ...search,\r\n ...select,\r\n ...spinner,\r\n ...time,\r\n ...timeframeBar,\r\n ...toolbar,\r\n ...tooltip,\r\n ...tooltipInput,\r\n ...tour,\r\n ...typography,\r\n }\r\n}\r\n\r\nexportAsGlobal(window, 'FLibs')\r\n","/**\r\n * Expose loader doesn’t map these to window.FLibs until we import them somewhere.\r\n * Until we figure out a better way, this file needs to be included on the charts page\r\n */\r\n// eslint-disable-next-line react/no-typos\r\nimport 'classnames'\r\nimport { max, nice, scaleLinear, scaleSymlog } from 'd3'\r\nimport {\r\n add,\r\n addBusinessDays,\r\n differenceInCalendarDays,\r\n eachDayOfInterval,\r\n endOfDay,\r\n intervalToDuration,\r\n isSameMonth,\r\n isSameWeek,\r\n isWeekend,\r\n isWithinInterval,\r\n startOfDay,\r\n startOfYear,\r\n sub,\r\n subMonths,\r\n subYears,\r\n} from 'date-fns'\r\nimport 'hammerjs'\r\n// eslint-disable-next-line react/no-typos\r\nimport 'react'\r\nimport 'react-dom'\r\nimport * as ReactRouterDOM from 'react-router-dom'\r\n\r\nimport { getFormattedDateString } from '../app/header/utils'\r\nimport { decodeQueryString, encodeQueryString } from '../app/queryString'\r\nimport logo from '../app/shared/assets/logo.png'\r\nimport { getHoverChartImg } from '../app/shared/hover-chart'\r\nimport { getSanitizedTicker } from '../app/shared/ticker-sanitizer'\r\nimport { formatDateToStringUS, getIsDrawingEnabledOnQuotePage } from '../app/shared/utils'\r\nimport './components/index'\r\nimport { useSyncLocalStorage } from './hooks/use-sync-local-storage'\r\n\r\ndeclare const FLibs: any\r\n\r\nFLibs.ReactRouterDOM = ReactRouterDOM\r\nFLibs.getHoverChartImg = getHoverChartImg\r\nFLibs.getSanitizedTicker = getSanitizedTicker\r\nFLibs.decodeQueryString = decodeQueryString\r\nFLibs.encodeQueryString = encodeQueryString\r\nFLibs.getFormattedDateString = getFormattedDateString\r\nFLibs.formatDateToStringUS = formatDateToStringUS\r\nFLibs.useSyncLocalStorage = useSyncLocalStorage\r\nFLibs.getIsDrawingEnabledOnQuotePage = getIsDrawingEnabledOnQuotePage\r\nFLibs.d3 = { max, nice, scaleLinear, scaleSymlog }\r\nFLibs.DateFns = {\r\n add,\r\n addBusinessDays,\r\n differenceInCalendarDays,\r\n eachDayOfInterval,\r\n endOfDay,\r\n intervalToDuration,\r\n isSameMonth,\r\n isSameWeek,\r\n isWeekend,\r\n isWithinInterval,\r\n startOfDay,\r\n startOfYear,\r\n sub,\r\n subMonths,\r\n subYears,\r\n}\r\nFLibs.assets = {\r\n logo,\r\n}\r\n","import * as React from 'react'\r\n\r\nimport * as storage from '../services/local-storage'\r\n\r\n/**\r\n * Hook to synchronize localStorage.setItem across all components on the page on all open tabs\r\n */\r\nexport function useSyncLocalStorage(storageKey: string, defaultValue: ValueType) {\r\n const [state, setState] = React.useState(storage.getValue(storageKey, defaultValue))\r\n\r\n React.useEffect(() => {\r\n const subscription = storage.subscribeToChanges(storageKey, defaultValue, setState)\r\n\r\n return () => {\r\n subscription.unsubscribe()\r\n }\r\n }, [storageKey, defaultValue])\r\n\r\n const setValue = React.useCallback(\r\n (valueGetter: React.SetStateAction) => storage.setValue(storageKey, valueGetter, defaultValue),\r\n [defaultValue, storageKey]\r\n )\r\n\r\n return {\r\n state,\r\n setState: setValue,\r\n }\r\n}\r\n","import * as Sentry from '@sentry/browser'\r\n\r\nimport { InstrumentType } from '../types'\r\n\r\nexport enum ContentType {\r\n ApplicationJson = 'application/json',\r\n FormUrlEncoded = 'application/x-www-form-urlencoded',\r\n Html = 'text/html; charset=utf-8',\r\n}\r\n\r\nfunction parseResponseForContentType(response: string, contentType: ContentType) {\r\n switch (contentType) {\r\n case ContentType.ApplicationJson:\r\n case ContentType.FormUrlEncoded:\r\n return JSON.parse(response)\r\n default:\r\n return response\r\n }\r\n}\r\n\r\nexport class ThrowableError extends Error {\r\n status: number\r\n isServerError = false\r\n extra: Record = {}\r\n\r\n constructor(status: number, message = 'ThrowableError', extra: Record = {}) {\r\n super(`${status} ${message}`)\r\n this.status = status\r\n this.isServerError = status >= 500\r\n this.extra = extra\r\n }\r\n}\r\n\r\nexport interface CancelablePromise extends Promise {\r\n cancel?: () => void\r\n}\r\n\r\n/**\r\n * General api fetch utility which returns a cancelable promise\r\n */\r\nexport function apiRequest(\r\n url: string,\r\n { query, headers = {}, ...options }: RequestInit & { query?: Record } = {},\r\n throwOnAllErrors = false\r\n): CancelablePromise {\r\n const controller = 'AbortController' in window ? new AbortController() : undefined\r\n const requestUrl = query ? `${url}?${new URLSearchParams(query)}` : url\r\n const contentType: ContentType = (headers as any)['Content-Type'] ?? ContentType.ApplicationJson\r\n\r\n const requestOptions = {\r\n ...options,\r\n headers: {\r\n 'Content-Type': contentType,\r\n ...headers,\r\n },\r\n }\r\n const request = fetch(requestUrl, { ...requestOptions, signal: controller?.signal })\r\n\r\n const cancelableRequest: CancelablePromise = request\r\n .then(async (response) => {\r\n const textResponse = await response.text()\r\n const reponseContentType: ContentType = (response.headers.get('Content-Type') as any) ?? ContentType.Html\r\n if (!response.ok || response.status >= 500) {\r\n throw new ThrowableError(response.status, response.statusText, { rayId: response.headers.get('cf-ray') })\r\n }\r\n try {\r\n return parseResponseForContentType(textResponse, reponseContentType)\r\n } catch (error: any) {\r\n throw new ThrowableError(500, error.message, { rayId: response.headers.get('cf-ray') })\r\n }\r\n })\r\n .catch((error: ThrowableError) => {\r\n if (error.status >= 500) {\r\n Sentry.withScope((scope) => {\r\n scope.setContext('Cloudflare', error.extra)\r\n\r\n if (error.status === 500) {\r\n Sentry.captureException(error)\r\n } else {\r\n Sentry.captureMessage(`${error.status} ${error.message}`)\r\n }\r\n })\r\n }\r\n if (throwOnAllErrors) {\r\n throw error\r\n }\r\n })\r\n\r\n if (controller) {\r\n cancelableRequest.cancel = () => controller.abort()\r\n }\r\n\r\n return cancelableRequest\r\n}\r\n\r\nexport interface SearchApiResult {\r\n ticker: string\r\n company: string\r\n exchange: string\r\n}\r\n\r\nexport function searchApiRequest(input = '', instrument?: InstrumentType) {\r\n return apiRequest('/api/suggestions.ashx', { query: { input, instrument } }, true)\r\n}\r\n","import { EventEmitter } from 'events'\r\nimport * as React from 'react'\r\n\r\nlet emitter: EventEmitter | undefined\r\n\r\n/**\r\n * Get the emitter which is used to sync components across the page, subscibe to\r\n * changes and attach event which handles changes across windows\r\n */\r\nexport function subscribeToChanges(\r\n key: string,\r\n defaultValue: ValueType,\r\n changeCallback?: (value: React.SetStateAction) => void\r\n) {\r\n if (!emitter) emitter = new EventEmitter()\r\n\r\n const onChange = (value: React.SetStateAction) => {\r\n const newValue = value ?? getValue(key, defaultValue)\r\n setValue(key, newValue, defaultValue, false)\r\n changeCallback?.(newValue)\r\n }\r\n\r\n const onStorageChange = (ev: StorageEvent) => {\r\n if (ev.key === key) {\r\n try {\r\n const value = ev.newValue ? JSON.parse(ev.newValue) : null\r\n onChange(value ?? defaultValue)\r\n } catch {\r\n onChange(defaultValue)\r\n }\r\n }\r\n }\r\n\r\n emitter.addListener(key, onChange)\r\n window.addEventListener('storage', onStorageChange)\r\n\r\n return {\r\n emitter,\r\n unsubscribe: () => {\r\n emitter?.removeListener(key, onChange)\r\n window.removeEventListener('storage', onStorageChange)\r\n },\r\n }\r\n}\r\n\r\n/**\r\n * Get value from local storage or fall back to `defaultValue`\r\n */\r\nexport function getValue(key: string, defaultValue: ValueType): ValueType {\r\n try {\r\n const value = localStorage.getItem(key)\r\n const parsedValue = value ? JSON.parse(value) : null\r\n return parsedValue ?? defaultValue\r\n } catch {\r\n return defaultValue\r\n }\r\n}\r\n\r\n/**\r\n * Set value to local storage. Optionally emits the change to all other components\r\n * which are subscribed with the same `key`\r\n */\r\nexport function setValue(\r\n key: string,\r\n valueGetter: React.SetStateAction,\r\n defaultValue: ValueType,\r\n emit = true\r\n) {\r\n try {\r\n const state = getValue(key, defaultValue)\r\n const valueToStore = valueGetter instanceof Function ? valueGetter(state) : valueGetter\r\n\r\n localStorage.setItem(key, JSON.stringify(valueToStore))\r\n if (emit) emitter?.emit(key, valueToStore)\r\n } catch {}\r\n}\r\n\r\n/**\r\n * Helper function to migrate old value type to new one (eg. boolean to object)\r\n */\r\nexport function migrateValue(\r\n key: string,\r\n /**\r\n * The migrate function might get called multiple times on the page, so `oldValue` in the callback\r\n * can actually be the already migrated value. Make sure to add a condition to only migrate once.\r\n */\r\n transformValue: NewValue | ((oldValue: PrevValue | NewValue) => NewValue),\r\n defaultValue: NewValue\r\n) {\r\n try {\r\n const oldValue = getValue(key, undefined)\r\n if (typeof oldValue === 'undefined') return\r\n const migratedValue = transformValue instanceof Function ? transformValue(oldValue) : transformValue\r\n setValue(key, migratedValue, defaultValue, false) // don’t emit to other components\r\n } catch {}\r\n}\r\n","import * as pathToRegexp from 'path-to-regexp'\r\n\r\nimport { cleanTicker } from '../util'\r\n\r\n/**\r\n * Compile route path by applying parameters to it\r\n *\r\n * @example\r\n * // Outputs /route/1?query=foo\r\n * compilePath('/route/:id?query=:query', { id: 1, query: 'foo' })\r\n */\r\nfunction compilePath(\r\n path: string,\r\n params?: Record,\r\n options?: pathToRegexp.ParseOptions & pathToRegexp.TokensToFunctionOptions\r\n) {\r\n return pathToRegexp.compile(path, options)(params)\r\n}\r\n\r\nexport const path = {\r\n home: '/',\r\n news: '/news.ashx',\r\n screener: '/screener.ashx',\r\n charts: '/charts',\r\n groups: '/groups.ashx',\r\n portfolio: '/portfolio.ashx',\r\n insider: '/insidertrading.ashx',\r\n elite: '/elite.ashx',\r\n search: '/search.ashx\\\\?p=:ticker?',\r\n quote: '/quote.ashx\\\\?t=:ticker',\r\n contact: '/contact.ashx',\r\n\r\n alerts: '/alerts.ashx',\r\n help: '/help/screener.ashx',\r\n account: '/myaccount.ashx',\r\n login: '/login.ashx',\r\n logout: '/logout.ashx',\r\n\r\n // Maps\r\n maps: '/map.ashx',\r\n bubbles: '/bubbles.ashx',\r\n\r\n // Futures\r\n futures: '/futures.ashx',\r\n futuresPerf: '/futures_performance.ashx',\r\n futuresCharts: '/futures_charts.ashx',\r\n futuresChartDetail: '/futures_charts.ashx\\\\?t=:ticker',\r\n\r\n // Forex\r\n forex: '/forex.ashx',\r\n forexPerf: '/forex_performance.ashx',\r\n forexCharts: '/forex_charts.ashx',\r\n forexChartDetail: '/forex_charts.ashx\\\\?t=:ticker',\r\n\r\n // Crypto\r\n crypto: '/crypto.ashx',\r\n cryptoPerf: '/crypto_performance.ashx',\r\n cryptoCharts: '/crypto_charts.ashx',\r\n cryptoChartDetail: '/crypto_charts.ashx\\\\?t=:ticker',\r\n\r\n // Backtsest\r\n backtests: '/backtests.ashx',\r\n backtestCreate: '/backtest_create.ashx',\r\n backtestDetail: '/backtest_detail.ashx\\\\?id=:backtestId',\r\n backtestPresets: 'backtests.ashx\\\\?presets=1',\r\n}\r\n\r\nexport const link = {\r\n toHome: () => path.home,\r\n toNews: () => path.news,\r\n toScreener: () => path.screener,\r\n toCharts: () => path.charts,\r\n toGroups: () => path.groups,\r\n toPortfolio: () => path.portfolio,\r\n toInsider: () => path.insider,\r\n toElite: () => path.elite,\r\n toSearch: (ticker: string) => compilePath(path.search, { ticker }, { validate: false }),\r\n toQuote: (ticker: string) => compilePath(path.quote, { ticker }),\r\n toContact: () => path.contact,\r\n\r\n toAlerts: () => path.alerts,\r\n toHelp: () => path.help,\r\n toAccount: () => path.account,\r\n toLogin: () => path.login,\r\n toLogout: () => path.logout,\r\n\r\n toMaps: () => path.maps,\r\n toBubbles: () => path.bubbles,\r\n\r\n toFutures: () => path.futures,\r\n toFuturesPerf: () => path.futuresPerf,\r\n toFuturesCharts: () => path.futuresCharts,\r\n toFuturesChartDetail: (ticker: string) => compilePath(path.futuresChartDetail, { ticker: cleanTicker(ticker) }),\r\n\r\n toForex: () => path.forex,\r\n toForexPerf: () => path.forexPerf,\r\n toForexCharts: () => path.forexCharts,\r\n toForexChartDetail: (ticker: string) => compilePath(path.forexChartDetail, { ticker: cleanTicker(ticker) }),\r\n\r\n toCrypto: () => path.crypto,\r\n toCryptoPerf: () => path.cryptoPerf,\r\n toCryptoCharts: () => path.cryptoCharts,\r\n toCryptoChartDetail: (ticker: string) => compilePath(path.cryptoChartDetail, { ticker: cleanTicker(ticker) }),\r\n\r\n toBacktests: () => path.backtests,\r\n toBacktestCreate: () => path.backtestCreate,\r\n toBacktestDetail: (backtestId: string | number) => compilePath(path.backtestDetail, { backtestId }),\r\n toBacktestPresets: () => path.backtestPresets,\r\n}\r\n","export enum Instrument {\r\n stock = 'stock',\r\n forex = 'forex',\r\n crypto = 'crypto',\r\n futures = 'futures',\r\n market_sentiment = 'market_sentiment',\r\n group = 'group',\r\n}\r\n\r\nexport type InstrumentType = keyof typeof Instrument\r\n\r\nexport type RecordType = Record\r\n\r\nexport type PartialBy = Omit & Partial>\r\n","import isPlainObject from 'lodash.isplainobject'\r\nimport { ComponentType, LazyExoticComponent, lazy } from 'react'\r\n\r\nimport { getCookie } from '../app/shared/cookie'\r\nimport { CRYPTO_TICKERS } from './constants'\r\nimport { Instrument, InstrumentType } from './types'\r\nimport { RecordType } from './types'\r\n\r\n/**\r\n * Function which wraps React.lazy and checks whether a chunk is preloaded\r\n * from async-manifest. If yes, kick in the promise resolve early so we can\r\n * instantly render the component\r\n */\r\nexport function lazyLoadComponent({\r\n chunkName,\r\n load,\r\n}: {\r\n chunkName: string\r\n load: () => Promise<{ default: ComponentType }>\r\n}): LazyExoticComponent> {\r\n // Resolve earlier if prefetch element is present\r\n const hasPreloadElement = document.querySelector(`[data-chunk-id=${chunkName}]`)\r\n\r\n if (hasPreloadElement) {\r\n const componentLoader = load()\r\n\r\n return lazy(() => componentLoader)\r\n }\r\n\r\n return lazy(load)\r\n}\r\n\r\nconst isObject = (value: any): value is RecordType => isPlainObject(value)\r\n\r\n/**\r\n * Parse text as JSON\r\n */\r\nexport function parseAsJSON(value: unknown | Shape): Shape | undefined {\r\n if (isObject(value)) {\r\n return value as Shape\r\n }\r\n\r\n let parsedValue\r\n try {\r\n if (typeof value === 'string') {\r\n parsedValue = JSON.parse(value)\r\n }\r\n } catch (e) {\r\n return\r\n }\r\n return parsedValue\r\n}\r\n\r\n/**\r\n * remove @ symbol from a ticker\r\n */\r\nexport function cleanTicker(ticker: string) {\r\n return ticker.startsWith('@') ? ticker.substring(1) : ticker\r\n}\r\n\r\n/**\r\n * Get instrument for a ticker.\r\n *\r\n * - If ticker doesn’t start with `@` - stock\r\n * - Otherwise\r\n * - one of `CRYPTO_TICKERS` - crypto\r\n * - has length of 6 - forex\r\n * - none of above - future\r\n *\r\n * NOTE: counterpart in charts 'charts/app/utils/chart.js'\r\n */\r\n\r\nexport function getInstrumentForTicker(ticker: string): InstrumentType {\r\n if (!ticker?.startsWith('@')) return Instrument.stock\r\n\r\n const cleanedTicker = cleanTicker(ticker)\r\n\r\n if (CRYPTO_TICKERS.includes(cleanedTicker.toUpperCase())) return Instrument.crypto\r\n if (cleanedTicker.length === 6) return Instrument.forex\r\n\r\n return Instrument.futures\r\n}\r\n\r\n/**\r\n * Async load Resize observer polyfill when we need it\r\n */\r\nlet resizeObserverPolyfill: typeof window.ResizeObserver\r\nexport async function loadResizeObserverPolyfill() {\r\n if (typeof window.ResizeObserver === 'undefined') {\r\n const polyfill = await import('resize-observer-polyfill')\r\n resizeObserverPolyfill = polyfill.default\r\n window.ResizeObserver = resizeObserverPolyfill\r\n return resizeObserverPolyfill as typeof window.ResizeObserver\r\n }\r\n}\r\n\r\nexport async function getIsBrave() {\r\n return (navigator.brave && (await navigator.brave.isBrave())) || false\r\n}\r\n\r\nexport function hasDarkModeFeature() {\r\n const ff = getCookie('featureFlags')\r\n return ff.includes('dark:1')\r\n}\r\n\r\nexport function hasRedesignFeature() {\r\n const ff = getCookie('featureFlags')\r\n return ff.includes('redesign:1')\r\n}\r\n\r\nexport function isRedesignFeatureEnabled() {\r\n return hasRedesignFeature() || hasDarkModeFeature()\r\n}\r\n\r\nexport function isDarkModeFeatureEnabled() {\r\n const theme = getCookie('chartsTheme')\r\n return isRedesignFeatureEnabled() && theme.includes('dark')\r\n}\r\n"],"names":["MarketBadgeType","getMarketBadgeText","type","_date","Open","label","Closed","Premarket","Aftermarket","getMarketBadgeType","time","hasUserPremium","isHoliday","isPremarket","isAftermarket","None","MarketBadge","_ref","badge","className","_jsx","classnames","includes","TimeBreakpointMode","BREAKPOINTS","minWidth","Infinity","marketBadgeText","timeFormat","getTimeState","fixedTime","arguments","length","undefined","FinvizSettings","getDate","TooltipBadge","props","state","useTooltipState","placement","_jsxs","_Fragment","children","TooltipTrigger","Tooltip","Heading","level","StaticBadge","concat","findMatchingBreakpoint","compareWidth","breakpoints","_matchingBreakpoints$","filter","breakpoint","pop","getCurrentWidth","mode","element","_element$clientWidth","window","innerWidth","clientWidth","Time","breakpointMode","ResizeObserver","useResizeObserver","rootRef","React","setState","currentBreakpoint","setBreakpoint","interval","setInterval","clearInterval","current","currentWidth","handleResize","throttle","foundBreakpoint","observer","entries","requestAnimationFrame","Array","isArray","observe","addEventListener","disconnect","removeEventListener","ref","getFormattedDateString","seed","date","Date","dateAsNY","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","isDst","dayNumber","monthIndex","getMonth","previousSunday","getDay","getIsDstInNy","setUTCHours","getWeekDay","toLocaleDateString","weekday","month","toUpperCase","toString","padStart","getTime","toLocaleString","hour","minute","hour12","TimeFormat","format","long","getFullYear","short","timeOnly","isPremium","dayOfWeek","min","getMinutes","getHours","HOLIDAY_DATES","test","day","hours","getHoliday","find","holiday","decodeQueryString","search","location","vars","substring","split","obj","forEach","pair","delimiterPos","indexOf","key","decodeURIComponent","value","encodeQueryString","values","whitelistedValues","Object","keys","reduce","prev","encodeURIComponent","getParsedCookies","cookieName","parseCookies","document","cookie","map","cookieString","acc","v","trim","getCookie","name","re","RegExp","replace","setCookie","expires","toUTCString","hostname","getHoverChartUrl","ticker","escaped","timeframe","stocksHoverChartTimeframe","imgUrl","nodeChartsDomain","stocksHoverChartPatterns","documentElement","classList","contains","timeframeToDeprecatedTimeframe","timeframeString","getOldChartsUrl","instrument","oldPeriod","Instrument","cleanTicker","toLowerCase","getHoverChartDimensions","width","height","getReferrerPolicy","getHoverChartImg","useOldCharts","hasForexFuturesCryptoNodeCharts","chartSize","referrerPolicy","url","srcSet","getSrcSet","srcsetString","img","hasUserRetinaNodeCharts","matchesAndroid","navigator","userAgent","match","matchesWebOS","matchesIPhone","matchesiPad","matchesIPod","matchesBlackBerry","matchesWindowsPhone","matchesIOSLike","maxTouchPoints","isMobileDevice","isMobile","isIpad","isSafariDesktop","getSanitizedSingleTicker","rawTicker","x","join","getSanitizedTicker","isMulti","formatDateToStringUS","year","DRAWING_QUOTE_PAGE_COOKIE_NAME","getIsDrawingEnabledOnQuotePage","async","setIsDrawingEnabledOnQuotePage","isEnabled","fetch","catch","then","res","ok","setMonth","setIsDrawingEnabledOnQuotePageCookieViaJS","i","idea","rest","reload","parseInitData","elementId","initDataElement","getElementById","JSON","parse","textContent","e","Sentry","captureException","BoxRounding","BoxTheme","Box","rounding","theme","GroupTheme","ButtonGroup","hasDivider","hasBorder","childComponent","buttonRounding","ButtonRounding","groupTheme","dark","wrapper","divider","getGroupTheme","role","border","child","index","_child$props$rounding","_child$props$theme","Button","Boolean","BUTTON_DEFAULT_ELEMENT","BUTTON_BASE_CLASS","BUTTON_SQUARE_BASE_CLASS","BUTTON_FOCUS_STYLES","ButtonSize","ButtonSquareSize","ButtonTheme","getButtonTheme","active","light","button","blue","blueHover","red","headerItem","icon","menuItem","menuItemDark","opacity","outline","chip","chipTransparent","ButtonComponent","as","asComponent","size","focusRing","appearance","contentClass","leftContent","rightContent","isSquare","buttonTheme","buttonSize","isValidIconName","Icon","CheckboxComponent","_props$checked","checked","defaultChecked","disabled","Checkbox","forwardRef","clamp","num","max","isTouch","event","getRelativePosition","node","rect","getBoundingClientRect","pointer","touches","left","pageX","pageXOffset","top","pageY","pageYOffset","preventDefaultMove","preventDefault","DraggablePickerComponent","onMove","onKey","container","useRef","hasTouched","isDragging","setDragging","useState","isValid","handleMove","useCallback","buttons","handleMoveStart","_ref2","nativeEvent","handleKeyDown","keyCode","which","handleMoveEnd","toggleDocumentEvents","toggleEvent","useLayoutEffect","onTouchStart","onMouseDown","onKeyDown","tabIndex","DraggablePicker","memo","Pointer","color","style","backgroundColor","hexStringToRGBA","hexString","hexColor","removeHashSymbol","r","g","b","a","Number","Math","round","hexStringToHSVA","rgbaToHSVA","hexStringToHSLA","rgbaToHSLA","alphaToHex","alpha","rgbaToHexString","hsvaToHEXString","rgbaColor","hsvaToRGBA","hslaToHexString","hslaToRGBA","c","h","s","f","abs","l","n","k","rgbaToRGBAString","rgbaStringToObject","colorParts","exec","green","slice","String","parseInt","parseFloat","hslaToHSLAString","strColor","isValidColor","isRgb","startsWith","Option","convertColorToHEX","getIsRgb","isAlphaAllowed","rgbKeys","push","some","getHSVAFromColor","stringifyHSVAColor","output","canSelectAlpha","getLumaFromRGBA","getIsColorTooLightOrTransparent","getHEXWithSpecificAplha","getRGBAValueFromValidColorString","Alpha","onChange","changeLightness","pos","gradientPreview","useMemo","gradientFrom","gradientTo","backgroundImage","DEFAULT_COLORS","title","ColorPalette","colors","lowerCaseColor","colorObj","isSelected","onClick","HueSaturation","position","getPositionFromHSLA","colorPreview","changeSaturation","Lightness","ColorPreview","isTooLight","PickerInput","inputClass","hasColorPreview","colorInput","setColorInput","colorUtil","isRgba","useEffect","handleColorInputChange","currentTarget","colorValue","Input","ColorPicker","canSelectCustom","outputFormat","onPaletteItemClick","cachedColor","hsvaColor","setColor","currentColor","newColor","onChangeCallback","stringColor","onSetCustomCodeClick","_prompt","prompt","alert","_hex","orignalColor","InputColorPicker","inputDataTestId","popoverState","usePopoverState","PopoverTrigger","Popover","focusOnShow","hide","MultiColorPicker","colorInputLabel","ColorTabButton","ButtonColorPicker","_ref3","buttonPickerDataTestId","hideOnClickOutside","onOverlayClick","isMultiPicker","activeColorIndex","setActiveColorIndex","handleColorChange","originalColor","colorObject","visible","_ref4","_ref5","COMPONENT_ANIMATION_DURATION","CopyToClipboard","text","bottomLeftContent","isCopied","setIsCopied","handleCopyToClipboard","copy","timeout","resetTimer","clearTimeout","setTimeout","Textarea","readOnly","select","DatePickerComponent","DatePicker","popover","triggerProps","ZIndexContext","fallback","Spinner","locale","minDetail","ev","_props$onChange","call","Delayed","delay","throwOnTimeout","delayComponent","timeoutComponent","setVisible","hasTimedOut","setHasTimedOut","visibilityTimeout","failedTimeout","Error","useZIndex","useDialogState","settings","Reakit","animated","DialogDragContext","enabled","handleRef","boxPosition","y","resetBoxPosition","setBoxPosition","useDrag","dragging","handleElement","boxPositionRef","dragDiff","scrollX","scrollY","onMouseUp","onMouseMove","body","DialogBox","onUnmount","wrapperRef","setElementRef","elementHeight","useElementMeasure","dialogDrag","onResize","_dialogDrag$handleRef","_dialogDrag$handleRef2","_dialogDrag$handleRef3","bottom","right","clientHeight","prevPosition","_dialogDrag$handleRef4","_dialogDrag$handleRef5","_dialogDrag$handleRef6","dialogBoxStyle","transform","DialogOverlay","getExtendedDialogState","isFullyOpened","animating","isFullyClosed","DialogType","DIALOG_BACKDROP_WIDTH_CSS_VAR","Dialog","finalFocusRef","onHide","hideOnEsc","isDraggable","isBackdropDisabled","ariaLabel","setProperty","DialogWrapper","modal","Portal","unstable_finalFocusRef","onTransitionEnd","onAnimationEnd","innerProps","drawer","Provider","DialogBody","hasPadding","scrollDivRef","scrollBox","disableBodyScroll","enableBodyScroll","ConfirmationDialog","Paragraph","actions","DialogTrigger","dropdownContext","DropdownContext","_props$onClick","root","DialogFooter","DialogHeader","onCloseClick","useDropdownState","context","loop","unstable_virtual","unstable_offset","DropdownComponent","isNested","isStatic","zIndex","dropdownState","ContainerElement","buttonProps","_label$props$active","_context$root","parent","orientation","Dropdown","NestedDropdownWrapper","parentState","itemProps","DropdownBar","DropdownItemComponent","subtitle","closeOnClick","hasSubmenu","iconTheme","_itemProps$onClick","DropdownItem","DropdownSeparator","MoreButtonDropdown","Component","iconList","add","SVG","viewBox","d","calendar","candleBarBasic","candleBarHeikinAshi","candleBarHollow","caretDown","caretRight","caretVertical","chartBar","chartBubble","cx","cy","chartPie","chartTable","fillRule","chartTreemap","chevronDown","_props$viewBox","chevronRight","close","darkMode","done","draw","clipRule","drawingActionDelete","drawingSettingAutosaveOff","drawingSettingAutosaveOn","drawingSettingAutosaveSaving","drawingSettingDrawingMode","drawingSettingDrawingModeActive","drawingSettingHide","drawingSettingLock","drawingSettingPreserveDrawings","drawingSettingPreserveDrawingsActive","drawingSettingShow","drawingSettingUnlock","empty","exitFullscreen","flash","fullscreen","gift","hamburger","help","ideaLoad","ideaSave","layout1h1v","layout1h2v","layout1h3v","layout1l2r","layout1t2b","layout2h1v","layout2h2v","layout3h1v","layout3h2v","lightMode","lineChartType","menuClose","more","note","ohlcChartType","profile","publish","refresh","remove","restore","settingsWheel","gesture","share","signOut","switchHorizontal","switchVertical","tabKey","template","toolArrow","toolBrush","toolCallout","toolCurve","toolElliottWave","toolEllipse","toolExpand","toolFibonacci","toolLine","fill","stroke","toolMeasure","toolMidLineH","toolMidLineV","toolMouse","toolPitchfork","toolPolygon","toolPosition","toolRect","toolRectRotated","toolText","toolTriangle","toolXABCD","triangle","warning","palette","arrowForward","trendingUp","trendingDown","trashCan","star","starOutlined","xmlns","InputTheme","InputRounding","InputSize","getInputTheme","isError","none","input","InputComponent","error","caption","inputTheme","isLeftStringIcon","isRightStringIcon","inputSize","commonSideContentClassnames","Label","small","regular","medium","large","InputCaption","TextareaComponent","textareaTheme","ListContext","useListState","options","ListItem","activeTheme","onSelectItem","onKeyPress","closeOnSelect","id","List","selectedIndex","includeBaseStyles","prevSelected","items","move","closeParent","findIndex","item","NotificationPosition","NotificationContext","show","useNotification","getViewport","visualViewport","_visualViewport$width","_visualViewport$heigh","_visualViewport$scale","_visualViewport$offse","_visualViewport$offse2","innerHeight","scale","offsetTop","offsetLeft","NotificationWrapper","notification","setNotification","viewport","setViewport","_window$visualViewpor","_window$visualViewpor2","_window$visualViewpor3","_window$visualViewpor4","positionClass","_notification$options","BottomLeft","TopLeft","TopRight","BottomRight","WrapperComponent","inline","unstable_autoFocusOnShow","willChange","Notification","_props$actions","timeoutId","timeoutInMs","withNotificationContext","WrappedComponent","_WrappedComponent$dis","displayName","WithNotificationContext","notificationContext","POPOVER_HEIGHT_LIMIT_STYLE","maxHeight","focusOnHide","hasArrow","hasBackdrop","popoverWrapperStyle","popoverMaxHeight","MAX_SAFE_INTEGER","hasViewportHeightLimit","hasButtonWidthLimit","throttleWaitInMs","setSize","useWindowSize","buttonElement","unstable_referenceRef","buttonRect","popoverId","getAttribute","popoverWrapper","offsetY","offsets","elementMaxHeight","unstable_autoFocusOnHide","TooltipArrow","DEFAULT_OFFSET","_settings$unstable_of","_settings$placement","useHoverPopover","showTimeout","hideTimeout","clearTimeouts","showPopover","hidePopover","onMouseOver","onMouseOut","ComboBoxItem","selected","currentId","ComboBox","inputProps","popoverProps","_inputProps$onKeyDown","inputValue","INSTRUMENT_CATEGORIES","Centered","SearchError","href","link","resetErrorBoundary","Highlight","highlight","processedText","before","after","getRedirectForTicker","tickerRaw","getInstrumentForTicker","SearchItem","company","exchange","SearchList","data","isLoading","useQuery","searchApiRequest","keepPreviousData","cacheTime","staleTime","Search","reset","useQueryErrorResetBoundary","minValueLength","defaultValue","listState","category","setCategory","changeCategory","first","onInputKeyDown","stopPropagation","autoFocus","placeholder","autoComplete","autoCorrect","autoCapitalize","redirectUri","ErrorBoundary","FallbackComponent","onReset","resetKeys","currentValue","getSelectedItemIndex","useSelect","setSelectedIndex","closePopover","newIndex","onItemChange","_selectedItem$href$se","_selectedItem$href$ha","selectedItem","reloadDocument","newUrl","URL","pathname","hash","SelectButton","_props$active","_themeProps$theme","themeProps","getButtonProps","Select","popoverStateSettings","StatelessSelect","_items","labelClassName","buttonContent","listProps","isNativeMobileSelect","hasPopoverViewportHeightLimit","hasPopoverButtonWidthLimit","showMobileSelect","NativeSelectComponent","useInRouterContext","NativeSelectInRouterContext","NativeSelect","relative","SelectList","SelectOption","SelectWithTooltip","tooltipLabel","tooltip","unstable_timeout","isTooltipIgnored","visibilityState","activeElement","onSelectFocus","onSelectBlur","onFocus","onBlur","showPlaceholder","handleNativeSelectChange","itemIndex","target","hidden","navigate","useNavigate","onChangeWithNavigate","isProgressBar","progress","radius","strokeWidth","circleXY","circumference","PI","strokeDasharray","strokeDashoffset","strokeLinecap","DATERANGE_TOOLTIP","DateRangeSelect","chartIndex","dateRangeGroups","selectedDateRange","onDateRangeSelect","flatDateRanges","flatMap","dateRanges","selectWithTooltipListProps","Link","to","LabelWithDelayedSpinner","invisible","TIMEFRAME_TOOLTIP","TimeframeSelect","_flatTimeframes$find","timeFrameGroups","selectedTimeframe","favoriteTimeframes","isCompactView","onTimeframeSelect","onFavoriteTimeframeToggle","flatTimeframes","timeframes","_createElement","labelShort","groupIndex","isIconButtonActive","classNames","getTimeframeChipElementId","TimeframeBar","compactViewMaxBreakpointPx","loadingTimeframe","isDateRangeAvailable","containerElement","isFavoritesEnabled","isScrollIntoViewEnabled","scrollWrapperElement","setScrollWrapperElement","timeframeButtonsScrollLocation","setTimeframeButtonsScrollLocation","isOnLeftEdge","isOnRightEdge","elementWidth","isStockDetailTimeframeBar","timeframesInExpandedPanel","checkTimeframeWrapperScrollPosition","scrollLeft","offsetWidth","scrollWidth","timeframeElement","scrollIntoView","block","onScroll","onWheel","absDx","deltaX","deltaY","TooltipBox","tooltipColor","TooltipColor","tooltipProps","transformMap","auto","positionMain","arrowColor","getHeadingElement","CRYPTO_TICKERS","TIMEFRAME","useIsMounted","isMountedRef","getIsMounted","_elementRef$offsetWid","_elementRef$offsetHei","elementOverride","elementRef","setElementWidth","setElementHeight","offsetHeight","measureElement","newElementWidth","newElementHeight","measureElementDebounced","debounce","resizeObserver","cancel","controller","AbortController","setResizeObserver","loadResizeObserverPolyfill","polyfill","_controller$current","signal","aborted","_controller$current2","abort","ContextMenu","popperElement","setPopperElement","virtualRef","toJSON","getVirtualRef","hasBeenOpen","styles","attributes","usePopper","modifiers","offset","popper","ContextMenuDropdown","ContextMenuInner","innerState","_item$onClick","_window$gtag","_window","gtag","assign","menu_option","ChartGridCell","gridArea","GridLayout","columns","rows","gridTemplateColumns","gridTemplateRows","ChartGrid","defaultValueAccessor","InnerState","valueKey","changeKey","valueAccessor","handleChange","RangeSize","RangeSlider","step","inputClassName","hasTrack","setHasTrack","trackRef","thumbRef","thumbLeft","track","thumb","valuePercent","trackBox","thumbBox","ToolbarTheme","ToolbarDirection","ToolbarContext","direction","vertical","isWrapped","isStretched","useToolbarContext","Toolbar","toolbarRef","contextProviderValue","alternative","horizontal","toolbarSettings","hasRedesignEnabled","getToolbarSettings","forceReflow","originalWidth","ToolbarButton","_props$appearance","_props$children","disabledTooltip","isInAction","isInActionProp","iconAction","buttonSettings","isActive","includeRedesign","grow","getButtonThemeSettings","getMainIcon","iconActive","titleActive","ToolbarGroup","_groupItems$map","defaultItem","groupItems","groupTitle","setSelectedItem","groupId","toLocaleLowerCase","useMobileNativeSelect","isAlternativeTheme","option","ToolbarItem","isItemActive","ToolbarDivider","TooltipInputComponent","tooltipContent","onMouseEnter","onMouseLeave","TooltipInput","StepContent","shepherdLibrary","loadShepherdLibrary","setLoading","shepherdPromise","default","buttonClasses","getStepButtons","tour","arr","_step$backButton","_step$nextButton","action","complete","classes","back","backButton","next","nextButton","processSteps","steps","_step$placement","_step$offset","attachTo","on","popperOptions","ReactDOM","getTourKey","getStepsForUser","tours","lastFinishedTour","localStorage","getItem","lastTourIndex","allToursViewed","every","skip","toursToView","hasNewTours","initialTour","completeTour","setItem","DEFAULT_OPTIONS","exitOnEsc","useModalOverlay","useTour","setIsLoading","currentTour","setTour","loadingSetter","startTour","definition","_controller$current3","setComplete","tourUtils","_definition$initialTo","Tour","from","removeStep","processedSteps","addSteps","start","event_label","win","components","buttonGroup","checkbox","colorPicker","contextMenu","copyToClipboard","delayed","dialog","datePicker","dropdown","grid","list","range","spinner","timeframeBar","toolbar","tooltipInput","typography","FLibs","ReactRouterDOM","useSyncLocalStorage","storageKey","storage","subscription","unsubscribe","valueGetter","d3","nice","scaleLinear","scaleSymlog","DateFns","addBusinessDays","differenceInCalendarDays","eachDayOfInterval","endOfDay","intervalToDuration","isSameMonth","isSameWeek","isWeekend","isWithinInterval","startOfDay","startOfYear","sub","subMonths","subYears","assets","logo","ContentType","parseResponseForContentType","response","contentType","ApplicationJson","FormUrlEncoded","ThrowableError","constructor","status","message","extra","super","_defineProperty","this","isServerError","apiRequest","_ContentType","query","headers","throwOnAllErrors","requestUrl","URLSearchParams","requestOptions","request","cancelableRequest","textResponse","reponseContentType","get","Html","statusText","rayId","scope","setContext","emitter","subscribeToChanges","changeCallback","EventEmitter","newValue","getValue","setValue","onStorageChange","addListener","_emitter","removeListener","parsedValue","emit","_emitter2","valueToStore","Function","stringify","migrateValue","transformValue","oldValue","compilePath","path","params","pathToRegexp","toHome","toNews","toScreener","toCharts","toGroups","toPortfolio","toInsider","toElite","toSearch","validate","toQuote","toContact","toAlerts","toHelp","toAccount","toLogin","toLogout","toMaps","toBubbles","toFutures","toFuturesPerf","toFuturesCharts","toFuturesChartDetail","toForex","toForexPerf","toForexCharts","toForexChartDetail","toCrypto","toCryptoPerf","toCryptoCharts","toCryptoChartDetail","toBacktests","toBacktestCreate","toBacktestDetail","backtestId","toBacktestPresets","lazyLoadComponent","chunkName","load","querySelector","componentLoader","lazy","cleanedTicker","resizeObserverPolyfill","getIsBrave","brave","isBrave"],"sourceRoot":""}