/* @oracle/oraclejet-preact: undefined */
'use strict';

var jsxRuntime = require('preact/jsx-runtime');
var preact = require('@testing-library/preact');
var userEvent = require('@testing-library/user-event');
var chai = require('chai');
var mockUseTextDimensionsDependencies = require('../../mockUseTextDimensionsDependencies-201c7c6f.js');
var matchTranslationBundle = require('../../matchTranslationBundle-99625a42.js');
require('../../LayerHost-8ec73638.js');
var EnvironmentProvider = require('../../EnvironmentProvider-753342f1.js');
require('../../TabbableModeContext-e99d527e.js');
require('preact/hooks');
var domUtil = require('../../domUtil-80d3d8b5.js');
var eventUtils = require('../../eventUtils-16a0d9b2.js');
var clientHints = require('../../clientHints-89c01238.js');
require('../../Menu-77687523.js');
var MenuItem = require('../../MenuItem-1878e08e.js');
require('preact');
require('../../logger-2b636482.js');


require('../../hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css.js');
require('../../tooltipUtils-d461919d.js');

require('../../SelectMenuGroupContext-bbb4f7e0.js');
require('../../UNSAFE_Separator/themes/SeparatorStyles.css.js');


require('../../UNSAFE_Menu/themes/redwood/MenuSeparatorVariants.css.js');
require('preact/compat');
var menuTestsUtils = require('../../menuTestsUtils-9d5d258a.js');
var dndUtils = require('../../dndUtils-f0693dd5.js');
var BarChart = require('../../BarChart-66dbe5be.js');
require('../../Common/themes/redwood/theme.js');
require('../../Common/themes/themeContract.css.js');
require('../../UNSAFE_Layer/themes/LayerHostStyles.css.js');

require('../../LayerManager-4857dbaf.js');
require('../../Dropdown-f12a07c1.js');
require('../../Floating-dd6667de.js');
require('../../useFloating-c64ecd7f.js');
require('../../useUser-c85f9587.js');
require('../../positionUtils-a780137e.js');
require('../../refUtils-915b985d.js');
require('../../useOutsideClick-8e9209c6.js');
require('../../arrayUtils-7d8dcfc3.js');
require('../../Layer-2352de5e.js');
require('../../classNames-c14c6ef3.js');
require('../../UNSAFE_Layer/themes/LayerStyles.css.js');

require('../../useThemeInterpolations-e3c7807c.js');
require('../../useColorScheme-b4de9e67.js');
require('../../useScale-779458a9.js');
require('../../theme-dfd6a9fe.js');
require('../../Theme-f06687af.js');
require('../../mergeInterpolations-6727b536.js');
require('../../mergeDeepWithKey-210b024d.js');
require('../../_curry3-18677bca.js');
require('../../_curry1-e8f0d7ea.js');
require('../../_curry2-c15d89cd.js');
require('../../_isObject-28636267.js');
require('../../useDensity-301606ec.js');
require('../../useModal-0739a528.js');
require('../../useComponentTheme-082fc8e4.js');
require('../../utils-606327d1.js');
require('../../colorUtils-fe6f2fbf.js');
require('../../UNSAFE_Floating/themes/redwood/FloatingTheme.js');
require('../../UNSAFE_Floating/themes/FloatingStyles.css.js');

require('../../UNSAFE_Floating/themes/redwood/FloatingBaseTheme.css.js');

require('../../UNSAFE_Floating/themes/redwood/FloatingVariants.css.js');
require('../../vanilla-extract-recipes-createRuntimeFn.esm-d1301b2d.js');
require('../../vanilla-extract-dynamic.esm-d5dffce7.js');
require('../../UNSAFE_Floating/themes/FloatingContract.css.js');
require('../../keyboardUtils-c071859a.js');
require('../../tabbableUtils-66ae6ba3.js');
require('../../head-68d0992f.js');
require('../../_arity-c228159c.js');
require('../../_isArray-73160ad5.js');
require('../../_isString-f4443c9e.js');
require('../../usePopupAnimation-be93af25.js');
require('../../useAnimationStatus-e55dfa64.js');
require('../../useAnimation-fb11e4cc.js');
require('../../popupAnimationUtils-dcace427.js');
require('../../CollectionInteractionContext-f84ff7a1.js');
require('../../UNSAFE_Dropdown/themes/dropdownStyles.css.js');

require('../../useOutsideMousedown-a8c09ad9.js');
require('../../animationUtils-54852d03.js');
require('../../mergeProps-e3da7237.js');
require('../../UNSAFE_Menu/themes/MenuStyles.css.js');

require('../../useTestId-32c35bff.js');
require('../../UNSAFE_Menu/themes/DropdownMenuStyles.css.js');

require('../../Sheet-78113d87.js');
require('../../Modal-64a0608b.js');
require('../../UNSAFE_Modal/themes/ModalStyles.css.js');

require('../../popupUtils-79b1d484.js');
require('../../WindowOverlay-7ef8a86f.js');
require('../../UNSAFE_WindowOverlay/themes/WindowOverlayStyles.css.js');

require('../../UNSAFE_WindowOverlay/themes/WindowOverlayContract.css.js');
require('../../UNSAFE_WindowOverlay/themes/redwood/WindowOverlayTheme.js');
require('../../UNSAFE_WindowOverlay/themes/redwood/WindowOverlayBaseTheme.css.js');

require('../../UNSAFE_WindowOverlay/themes/redwood/WindowOverlayVariants.css.js');
require('../../UNSAFE_Sheet/themes/SheetStyles.css.js');

require('../../UNSAFE_Menu/themes/SheetMenuStyles.css.js');

require('../../Text-15923d58.js');
require('../../UNSAFE_Text/themes/TextStyles.css.js');

require('../../useId-6c0eeb27.js');
require('../../usePress-886180e4.js');
require('../../flexitem-fee13e26.js');

require('../../vanilla-extract-sprinkles-createRuntimeSprinkles.esm-d68f3e0f.js');
require('../../useInteractionStyle-379ee8fa.js');
require('../../useHover-c099039f.js');
require('../../useToggle-3ebba7d8.js');
require('../../useActive-6770f917.js');
require('../../UNSAFE_Menu/themes/redwood/MenuItemTheme.js');
require('../../UNSAFE_Menu/themes/MenuItemStyles.css.js');

require('../../UNSAFE_Menu/themes/redwood/MenuItemBaseTheme.css.js');

require('../../UNSAFE_Menu/themes/redwood/MenuItemVariants.css.js');



require('../../BarGroup-022d6009.js');
require('../../PRIVATE_Chart/themes/ChartStyles.css.js');

require('../../layoutUtils-0615d614.js');
require('../../scale-22a7b539.js');
require('../../labelUtils-552aaaff.js');
require('../../textUtils-e779c845.js');
require('../../accUtils-dcffb3de.js');
require('../../utils-58341a2f.js');
require('../../datatipUtils-1f747b7f.js');
require('../../clientUtils-c5a6872f.js');
require('../../dimensionUtils-3919753d.js');
require('../../getLocale-8e17dc46.js');
require('../../stringUtils-4e4a6b2b.js');
require('../../useTranslationBundle-38c0edae.js');
require('../../dataStyleUtils-e5ab11d0.js');
require('../../colorUtils-d762d81b.js');
require('../../useChartDnd-765ad341.js');
require('../../eventsUtils-1abb6028.js');
require('../../utils-6f32ac40.js');
require('../../pathUtils-ba10ce25.js');
require('../../useDnd-a7d9b60c.js');
require('../../Chart-13ccd345.js');
require('../../TrackResizeContainer-96619aba.js');
require('../../useSize-e66dc3a5.js');
require('../../useResizeObserver-1597395f.js');
require('../../useVisAddBusyState-1564f647.js');
require('../../VisBusyStateContext-223f53dd.js');
require('../../useVisBusyStateContext-090a1870.js');
require('../../size-0056ef1a.js');
require('../../useTextDimensions-b94e8899.js');
require('../../useCssVars-99ce6e96.js');
require('../../useTheme-b256f71f.js');
require('../../Gridlines-a64f52a4.js');
require('../../PRIVATE_PlotArea/themes/PlotAreaStyles.css.js');

require('../../hooks/PRIVATE_useVisDnd/themes/VisDndStyles.css.js');

require('../../Axis-6d1bb36a.js');
require('../../PRIVATE_Axis/themes/AxisStyles.css.js');

require('../../MultilineText-e0d1d42b.js');
require('../../PRIVATE_Axis/themes/redwood/AxisTheme.js');
require('../../PRIVATE_Axis/themes/redwood/AxisBaseTheme.css.js');

require('../../PRIVATE_Axis/themes/redwood/AxisVariants.css.js');
require('../../useChartViewport-f23f2397.js');
require('../../usePinch-741e9343.js');
require('../../usePointerGesture-0b9cc1b7.js');
require('../../useChartNav-03cfc71a.js');
require('../../layoutUtils-c2c02501.js');
require('../../useVisHover-ad36112d.js');
require('../../ScrollBar-dc5cf205.js');
require('../../PRIVATE_ChartScrollBar/themes/ScrollBarStyles.css.js');

require('../../useSelectDrill-7a60b9e6.js');
require('../../useChartDataCursor-16040d3a.js');
require('../../hooks/PRIVATE_useChartDataCursor/themes/DataCursorStyles.css.js');

require('../../Marker-fd400f9a.js');

require('../../useChartDatatip-8ac215db.js');
require('../../useDatatip-14e6aeb0.js');
require('../../hooks/PRIVATE_useDatatip/themes/useDatatip.css.js');

require('../../VisTabularDatatip-275aecb1.js');
require('../../PRIVATE_VisTabularDatatip/themes/VisTabularDatatipStyles.css.js');

require('../../useChartDrill-7a54e300.js');
require('../../useVisDrill-1cc07434.js');
require('../../useDoubleTap-d3937fb6.js');
require('../../useSelection-64ee26f0.js');
require('../../BaseButton-590432e4.js');
require('../../usePressClick-7a34624a.js');
require('../../useTabbableMode-5c8fd9e5.js');
require('../../dimensions-b4be9793.js');
require('../../UNSAFE_BaseButton/themes/redwood/BaseButtonTheme.js');
require('../../UNSAFE_BaseButton/themes/BaseButtonStyles.css.js');

require('../../UNSAFE_BaseButton/themes/redwood/BaseButtonVariants.css.js');

require('../../hooks/PRIVATE_useVisSelection/themes/ClearSelection.css.js');

require('../../cssUtils-dd39857c.js');
require('../../useChartContextMenu-deb506be.js');
require('../../useContextMenu-24530094.js');
require('../../useContextMenuGesture-fb7f7df5.js');
require('../../textSelectionUtils-432ab66b.js');
require('../../useTooltip-cf4a15f3.js');
require('../../useFocus-1b288fb9.js');
require('../../useTouch-4dec8729.js');
require('../../hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentTheme.js');
require('../../hooks/UNSAFE_useTooltip/themes/TooltipContentStyles.css.js');
require('../../hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentBaseTheme.css.js');
require('../../useChartMarquee-7ffcda9e.js');
require('../../useVisDragModeControls-d3a7aa57.js');
require('../../Button-8f024aee.js');
require('../../Icon-6baa1a6f.js');
require('../../UNSAFE_Icon/themes/IconStyle.css.js');
require('../../Move-3cacd058.js');
require('../../hooks/PRIVATE_useVisDragModeControls/themes/useVisDragModeControls.css.js');

require('../../ZoomAlt-48876095.js');
require('../../ButtonSetSingle-0f398b7b.js');
require('../../useButtonSetContext-a2f31c8e.js');
require('../../ButtonSet-9ba7b760.js');
require('../../UNSAFE_ButtonSet/themes/ButtonSetStyles.css.js');

require('../../ButtonSetPositionContext-6a358667.js');
require('../../toggleButtonUtils-245111a7.js');
require('../../useRovingTabIndexContainer-a94dee6f.js');
require('../../buttonUtils-1f339a8e.js');
require('../../id-86356250.js');
require('../../ButtonSetItem-b260b6a5.js');
require('../../ButtonSetButton-a23b6b7d.js');
require('../../ToggleButtonLabel-6ff96ee4.js');
require('../../ButtonLabelLayout-b421d34a.js');
require('../../useButtonLabelLayoutTheme-b7b3bdb6.js');
require('../../UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutTheme.js');
require('../../UNSAFE_ButtonLabelLayout/themes/ButtonLabelLayoutStyles.css.js');

require('../../UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutBaseTheme.css.js');

require('../../UNSAFE_ButtonLabelLayout/themes/redwood/ButtonLabelLayoutVariants.css.js');

require('../../HiddenAccessible-087eb49a.js');

require('../../ButtonSetIconButton-c632a294.js');
require('../../useButtonSetPositionContext-409e4cd6.js');
require('../../IconToggleButton-493cf27c.js');
require('../../useToggleAction-e4f15550.js');
require('../../hooks/PRIVATE_useChartMarquee/themes/useChartMarquee.css.js');

require('../../useVisTouchResponse-376e11d5.js');
require('../../useOverviewContext-1732a3f1.js');
require('../../OverviewSlidingWindow-7719ad86.js');
require('../../PRIVATE_VisOverview/themes/VisOverview.css.js');

require('../../DragH-03bc7b1f.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var userEvent__default = /*#__PURE__*/_interopDefaultLegacy(userEvent);

const gdpData = [
    {
        id: 1,
        gdp: 15684750000000,
        country: 'United States'
    },
    {
        id: 2,
        gdp: 8227037000000,
        country: 'China'
    },
    {
        id: 3,
        gdp: 5963969000000,
        country: 'Japan '
    },
    {
        id: 4,
        gdp: 3400579000000,
        country: 'Germany '
    },
    {
        id: 5,
        gdp: 2608699000000,
        country: 'France'
    },
    {
        id: 6,
        gdp: 2440505000000,
        country: 'United Kingdom'
    },
    {
        id: 7,
        gdp: 2395968000000,
        country: 'Brazil '
    },
    {
        id: 8,
        gdp: 2021960000000,
        country: 'Russia'
    },
    {
        id: 9,
        gdp: 2014079000000,
        country: 'Italy'
    },
    {
        id: 10,
        gdp: 1824832000000,
        country: 'India'
    },
    {
        id: 11,
        gdp: 1819081000000,
        country: 'Canada'
    },
    {
        id: 12,
        gdp: 1541797000000,
        country: 'Australia'
    },
    {
        id: 13,
        gdp: 1352057000000,
        country: 'Spain'
    },
    {
        id: 14,
        gdp: 1177116000000,
        country: 'Mexico'
    },
    {
        id: 15,
        gdp: 1155872000000,
        country: 'South Korea'
    },
    {
        id: 16,
        gdp: 878198000000,
        country: 'Indonesia'
    },
    {
        id: 17,
        gdp: 794468000000,
        country: 'Turkey'
    },
    {
        id: 18,
        gdp: 773116000000,
        country: 'Netherlands'
    },
    {
        id: 19,
        gdp: 727307000000,
        country: 'Saudi Arabia'
    },
    {
        id: 20,
        gdp: 632400000000,
        country: 'Switzerland'
    },
    {
        id: 21,
        gdp: 548895000000,
        country: 'Iran'
    },
    {
        id: 22,
        gdp: 526192000000,
        country: 'Sweden'
    },
    {
        id: 23,
        gdp: 501101000000,
        country: 'Norway'
    },
    {
        id: 24,
        gdp: 487674000000,
        country: 'Poland'
    },
    {
        id: 25,
        gdp: 484692000000,
        country: 'Belgium'
    },
    {
        id: 26,
        gdp: 474954000000,
        country: 'Argentina'
    },
    {
        id: 27,
        gdp: 473971000000,
        country: 'Taiwan'
    },
    {
        id: 28,
        gdp: 398594000000,
        country: 'Austria'
    },
    {
        id: 29,
        gdp: 384315000000,
        country: 'South Africa'
    },
    {
        id: 30,
        gdp: 382424000000,
        country: 'Venezuela'
    },
    {
        id: 31,
        gdp: 366020000000,
        country: 'Colombia'
    },
    {
        id: 32,
        gdp: 365564000000,
        country: 'Thailand'
    },
    {
        id: 33,
        gdp: 358940000000,
        country: 'United Arab Emirates'
    },
    {
        id: 34,
        gdp: 313637000000,
        country: 'Denmark'
    },
    {
        id: 35,
        gdp: 303527000000,
        country: 'Malaysia'
    },
    {
        id: 36,
        gdp: 276520000000,
        country: 'Singapore'
    },
    {
        id: 37,
        gdp: 268708000000,
        country: 'Nigeria'
    },
    {
        id: 38,
        gdp: 268177000000,
        country: 'Chile'
    },
    {
        id: 39,
        gdp: 263021000000,
        country: 'Hong Kong'
    },
    {
        id: 40,
        gdp: 256729000000,
        country: 'Egypt'
    },
    {
        id: 41,
        gdp: 250436000000,
        country: 'Philippines'
    },
    {
        id: 42,
        gdp: 250126000000,
        country: 'Finland'
    },
    {
        id: 43,
        gdp: 249201000000,
        country: 'Greece'
    },
    {
        id: 44,
        gdp: 240894000000,
        country: 'Israel'
    },
    {
        id: 45,
        gdp: 231879000000,
        country: 'Pakistan'
    },
    {
        id: 46,
        gdp: 212720000000,
        country: 'Portugal'
    },
    {
        id: 47,
        gdp: 212501000000,
        country: 'Iraq'
    },
    {
        id: 48,
        gdp: 210416000000,
        country: 'Ireland'
    },
    {
        id: 49,
        gdp: 207794000000,
        country: 'Algeria'
    },
    {
        id: 50,
        gdp: 199003000000,
        country: 'Paraguay'
    },
    {
        id: 51,
        gdp: 199003000000,
        country: 'Peru'
    },
    {
        id: 52,
        gdp: 196419000000,
        country: 'Kazakhstan'
    },
    {
        id: 53,
        gdp: 196072000000,
        country: 'Czech Republic'
    },
    {
        id: 54,
        gdp: 183378000000,
        country: 'Qatar'
    },
    {
        id: 55,
        gdp: 176235000000,
        country: 'Ukraine'
    },
    {
        id: 56,
        gdp: 173424000000,
        country: 'Kuwait'
    },
    {
        id: 57,
        gdp: 169680000000,
        country: 'New Zealand'
    },
    {
        id: 58,
        gdp: 169680000000,
        country: 'Romania'
    },
    {
        id: 59,
        gdp: 138071000000,
        country: 'Vietnam'
    },
    {
        id: 60,
        gdp: 126873000000,
        country: 'Hungary'
    },
    {
        id: 61,
        gdp: 122724000000,
        country: 'Bangladesh'
    },
    {
        id: 62,
        gdp: 118719000000,
        country: 'Angola'
    },
    {
        id: 63,
        gdp: 97530000000,
        country: 'Morocco'
    },
    {
        id: 64,
        gdp: 91916000000,
        country: 'Slovakia'
    },
    {
        id: 65,
        gdp: 81915000000,
        country: 'Libya'
    },
    {
        id: 66,
        gdp: 80927000000,
        country: 'Ecuador'
    },
    {
        id: 67,
        gdp: 76464000000,
        country: 'Oman'
    },
    {
        id: 68,
        gdp: 68804000000,
        country: 'Azerbaijan'
    },
    {
        id: 69,
        gdp: 63259000000,
        country: 'Belarus'
    },
    {
        id: 70,
        gdp: 59941000000,
        country: 'Sudan'
    },
    {
        id: 71,
        gdp: 59408000000,
        country: 'Sri Lanka'
    },
    {
        id: 72,
        gdp: 58996000000,
        country: 'Dominican Republic'
    },
    {
        id: 73,
        gdp: 57102000000,
        country: 'Croatia'
    },
    {
        id: 74,
        gdp: 56738000000,
        country: 'Luxembourg'
    },
    {
        id: 75,
        gdp: 53140000000,
        country: 'Burma'
    },
    {
        id: 76,
        gdp: 51168000000,
        country: 'Uzbekistan'
    },
    {
        id: 77,
        gdp: 51020000000,
        country: 'Bulgaria'
    },
    {
        id: 78,
        gdp: 49880000000,
        country: 'Guatemala'
    },
    {
        id: 79,
        gdp: 49404000000,
        country: 'Uruguay'
    },
    {
        id: 80,
        gdp: 45617000000,
        country: 'Slovenia'
    },
    {
        id: 81,
        gdp: 45611000000,
        country: 'Tunisia'
    },
    {
        id: 82,
        gdp: 45134000000,
        country: 'Costa Rica'
    },
    {
        id: 83,
        gdp: 42164000000,
        country: 'Lithuania'
    },
    {
        id: 84,
        gdp: 41906000000,
        country: 'Ethiopia'
    },
    {
        id: 85,
        gdp: 41345000000,
        country: 'Lebanon'
    },
    {
        id: 86,
        gdp: 41117000000,
        country: 'Kenya'
    },
    {
        id: 87,
        gdp: 38939000000,
        country: 'Ghana'
    },
    {
        id: 88,
        gdp: 37399000000,
        country: 'Serbia'
    },
    {
        id: 89,
        gdp: 36253000000,
        country: 'Panama'
    },
    {
        id: 90,
        gdp: 35641000000,
        country: 'Yemen'
    },
    {
        id: 91,
        gdp: 33679000000,
        country: 'Turkmenistan'
    },
    {
        id: 92,
        gdp: 31209000000,
        country: 'Jordan'
    },
    {
        id: 93,
        gdp: 28380000000,
        country: 'Latvia'
    },
    {
        id: 94,
        gdp: 28247000000,
        country: 'Tanzania'
    },
    {
        id: 95,
        gdp: 27429000000,
        country: 'Bolivia'
    },
    {
        id: 96,
        gdp: 27026000000,
        country: 'Bahrain'
    },
    {
        id: 97,
        gdp: 25277000000,
        country: 'Trinidad and Tobago'
    },
    {
        id: 98,
        gdp: 25005000000,
        country: 'Cameroon'
    },
    {
        id: 99,
        gdp: 24627000000,
        country: "Cote d'Ivoire"
    },
    {
        id: 100,
        gdp: 23816000000,
        country: 'El Salvador'
    },
    {
        id: 101,
        gdp: 23006000000,
        country: 'Cyprus'
    },
    {
        id: 102,
        gdp: 21863000000,
        country: 'Estonia'
    },
    {
        id: 103,
        gdp: 21002000000,
        country: 'Uganda'
    },
    {
        id: 104,
        gdp: 20517000000,
        country: 'Zambia'
    },
    {
        id: 105,
        gdp: 19906000000,
        country: 'Afghanistan'
    },
    {
        id: 106,
        gdp: 19415000000,
        country: 'Nepal'
    },
    {
        id: 107,
        gdp: 18388000000,
        country: 'Honduras'
    },
    {
        id: 108,
        gdp: 18376000000,
        country: 'Gabon'
    },
    {
        id: 109,
        gdp: 17703000000,
        country: 'Congo, Democratic Republic of the'
    },
    {
        id: 110,
        gdp: 17624000000,
        country: 'Botswana'
    },
    {
        id: 111,
        gdp: 17326000000,
        country: 'Bosnia and Herzegovina'
    },
    {
        id: 112,
        gdp: 17206000000,
        country: 'Equatorial Guinea'
    },
    {
        id: 113,
        gdp: 16628000000,
        country: 'Brunei'
    },
    {
        id: 114,
        gdp: 15934000000,
        country: 'Georgia'
    },
    {
        id: 115,
        gdp: 15786000000,
        country: 'Papua New Guinea'
    },
    {
        id: 116,
        gdp: 15249000000,
        country: 'Jamaica'
    },
    {
        id: 117,
        gdp: 14600000000,
        country: 'Mozambique'
    },
    {
        id: 118,
        gdp: 14241000000,
        country: 'Cambodia'
    },
    {
        id: 119,
        gdp: 13864000000,
        country: 'Senegal'
    },
    {
        id: 120,
        gdp: 13692000000,
        country: 'Congo, Republic of the'
    },
    {
        id: 121,
        gdp: 13654000000,
        country: 'Iceland'
    },
    {
        id: 122,
        gdp: 12688000000,
        country: 'Albania'
    },
    {
        id: 123,
        gdp: 12299000000,
        country: 'Namibia'
    },
    {
        id: 124,
        gdp: 12202000000,
        country: 'South Sudan'
    },
    {
        id: 125,
        gdp: 11466000000,
        country: 'Mauritius'
    },
    {
        id: 126,
        gdp: 10806000000,
        country: 'Chad'
    },
    {
        id: 127,
        gdp: 10646000000,
        country: 'Burkina Faso'
    },
    {
        id: 128,
        gdp: 10506000000,
        country: 'Nicaragua'
    },
    {
        id: 129,
        gdp: 10319000000,
        country: 'Mali'
    },
    {
        id: 130,
        gdp: 10258000000,
        country: 'Mongolia'
    },
    {
        id: 131,
        gdp: 10117000000,
        country: 'Madagascar'
    },
    {
        id: 132,
        gdp: 10066000000,
        country: 'Armenia'
    },
    {
        id: 133,
        gdp: 9802000000,
        country: 'Zimbabwe'
    },
    {
        id: 134,
        gdp: 9676000000,
        country: 'Macedonia, Republic of'
    },
    {
        id: 135,
        gdp: 9217000000,
        country: 'Laos'
    },
    {
        id: 136,
        gdp: 8689000000,
        country: 'Malta'
    },
    {
        id: 137,
        gdp: 8043000000,
        country: 'Bahamas, The'
    },
    {
        id: 138,
        gdp: 7902000000,
        country: 'Haiti'
    },
    {
        id: 139,
        gdp: 7592000000,
        country: 'Tajikistan'
    },
    {
        id: 140,
        gdp: 7429000000,
        country: 'Benin'
    },
    {
        id: 141,
        gdp: 7252000000,
        country: 'Moldova'
    },
    {
        id: 142,
        gdp: 7223000000,
        country: 'Rwanda'
    },
    {
        id: 143,
        gdp: 6575000000,
        country: 'Niger'
    },
    {
        id: 144,
        gdp: 6473000000,
        country: 'Kyrgyzstan'
    },
    {
        id: 145,
        gdp: 5632000000,
        country: 'Guinea'
    },
    {
        id: 146,
        gdp: 4738000000,
        country: 'Suriname'
    },
    {
        id: 147,
        gdp: 4490000000,
        country: 'Barbados'
    },
    {
        id: 148,
        gdp: 4280000000,
        country: 'Montenegro'
    },
    {
        id: 149,
        gdp: 4212000000,
        country: 'Malawi'
    },
    {
        id: 150,
        gdp: 4199000000,
        country: 'Mauritania'
    },
    {
        id: 151,
        gdp: 4173000000,
        country: 'Timor-Leste'
    },
    {
        id: 152,
        gdp: 3996000000,
        country: 'Fiji'
    },
    {
        id: 153,
        gdp: 3777000000,
        country: 'Sierra Leone'
    },
    {
        id: 154,
        gdp: 3751000000,
        country: 'Swaziland'
    },
    {
        id: 155,
        gdp: 3685000000,
        country: 'Togo'
    },
    {
        id: 156,
        gdp: 3092000000,
        country: 'Eritrea'
    },
    {
        id: 157,
        gdp: 2788000000,
        country: 'Guyana'
    },
    {
        id: 158,
        gdp: 2475000000,
        country: 'Burundi'
    },
    {
        id: 159,
        gdp: 2439000000,
        country: 'Lesotho'
    },
    {
        id: 160,
        gdp: 2209000000,
        country: 'Maldives'
    },
    {
        id: 161,
        gdp: 2196000000,
        country: 'Bhutan'
    },
    {
        id: 162,
        gdp: 2172000000,
        country: 'Central African Republic'
    },
    {
        id: 163,
        gdp: 1899000000,
        country: 'Cape Verde'
    },
    {
        id: 164,
        gdp: 1855000000,
        country: 'San Marino'
    },
    {
        id: 165,
        gdp: 1735000000,
        country: 'Liberia'
    },
    {
        id: 166,
        gdp: 1554000000,
        country: 'Belize'
    },
    {
        id: 167,
        gdp: 1354000000,
        country: 'Djibouti'
    },
    {
        id: 168,
        gdp: 1220000000,
        country: 'Saint Lucia'
    },
    {
        id: 169,
        gdp: 1176000000,
        country: 'Antigua and Barbuda'
    },
    {
        id: 170,
        gdp: 1031000000,
        country: 'Seychelles'
    },
    {
        id: 171,
        gdp: 1010000000,
        country: 'Solomon Islands'
    },
    {
        id: 172,
        gdp: 918000000,
        country: 'Gambia, The'
    },
    {
        id: 173,
        gdp: 870000000,
        country: 'Guinea-Bissau'
    },
    {
        id: 174,
        gdp: 790000000,
        country: 'Grenada'
    },
    {
        id: 175,
        gdp: 783000000,
        country: 'Vanuatu'
    },
    {
        id: 176,
        gdp: 734000000,
        country: 'Saint Kitts and Nevis'
    },
    {
        id: 177,
        gdp: 712000000,
        country: 'Saint Vincent and the Grenadines'
    },
    {
        id: 178,
        gdp: 683000000,
        country: 'Samoa'
    },
    {
        id: 179,
        gdp: 600000000,
        country: 'Comoros'
    },
    {
        id: 180,
        gdp: 497000000,
        country: 'Dominica'
    },
    {
        id: 181,
        gdp: 476000000,
        country: 'Tonga'
    },
    {
        id: 182,
        gdp: 264000000,
        country: 'Sao Tome and Principe'
    },
    {
        id: 183,
        gdp: 173000000,
        country: 'Kiribati'
    },
    {
        id: 0,
        gdp: 37000000,
        country: 'Tuvalu'
    }
];

function __variableDynamicImportRuntime0__(path) {
  switch (path) {
    case '../../resources/nls/ar/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/ar/bundle.js'); });
    case '../../resources/nls/ar-XB/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/ar-XB/bundle.js'); });
    case '../../resources/nls/bg/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/bg/bundle.js'); });
    case '../../resources/nls/bs/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/bs/bundle.js'); });
    case '../../resources/nls/bs-Cyrl/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/bs-Cyrl/bundle.js'); });
    case '../../resources/nls/cs/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/cs/bundle.js'); });
    case '../../resources/nls/da/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/da/bundle.js'); });
    case '../../resources/nls/de/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/de/bundle.js'); });
    case '../../resources/nls/el/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/el/bundle.js'); });
    case '../../resources/nls/en/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/en/bundle.js'); });
    case '../../resources/nls/en-XA/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/en-XA/bundle.js'); });
    case '../../resources/nls/en-XC/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/en-XC/bundle.js'); });
    case '../../resources/nls/es/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/es/bundle.js'); });
    case '../../resources/nls/et/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/et/bundle.js'); });
    case '../../resources/nls/fi/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/fi/bundle.js'); });
    case '../../resources/nls/fr/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/fr/bundle.js'); });
    case '../../resources/nls/fr-CA/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/fr-CA/bundle.js'); });
    case '../../resources/nls/he/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/he/bundle.js'); });
    case '../../resources/nls/hr/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/hr/bundle.js'); });
    case '../../resources/nls/hu/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/hu/bundle.js'); });
    case '../../resources/nls/is/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/is/bundle.js'); });
    case '../../resources/nls/it/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/it/bundle.js'); });
    case '../../resources/nls/ja/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/ja/bundle.js'); });
    case '../../resources/nls/ko/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/ko/bundle.js'); });
    case '../../resources/nls/lt/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/lt/bundle.js'); });
    case '../../resources/nls/lv/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/lv/bundle.js'); });
    case '../../resources/nls/ms/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/ms/bundle.js'); });
    case '../../resources/nls/nl/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/nl/bundle.js'); });
    case '../../resources/nls/no/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/no/bundle.js'); });
    case '../../resources/nls/pl/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/pl/bundle.js'); });
    case '../../resources/nls/pt/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/pt/bundle.js'); });
    case '../../resources/nls/pt-PT/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/pt-PT/bundle.js'); });
    case '../../resources/nls/ro/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/ro/bundle.js'); });
    case '../../resources/nls/ru/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/ru/bundle.js'); });
    case '../../resources/nls/sk/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/sk/bundle.js'); });
    case '../../resources/nls/sl/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/sl/bundle.js'); });
    case '../../resources/nls/sr/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/sr/bundle.js'); });
    case '../../resources/nls/sr-Latn/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/sr-Latn/bundle.js'); });
    case '../../resources/nls/sv/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/sv/bundle.js'); });
    case '../../resources/nls/th/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/th/bundle.js'); });
    case '../../resources/nls/tr/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/tr/bundle.js'); });
    case '../../resources/nls/uk/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/uk/bundle.js'); });
    case '../../resources/nls/vi/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/vi/bundle.js'); });
    case '../../resources/nls/zh-Hans/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/zh-Hans/bundle.js'); });
    case '../../resources/nls/zh-Hant/bundle.ts': return Promise.resolve().then(function () { return require('../../resources/nls/zh-Hant/bundle.js'); });
    default: return new Promise(function(resolve, reject) {
      (typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(
        reject.bind(null, new Error("Unknown variable dynamic import: " + path))
      );
    })
   }
 }
const IS_CHROME_HEADLESS = navigator?.userAgent?.includes('HeadlessChrome');
const TOOLTIP_TEST_TIMEOUT = 5000;
const series = [
    {
        name: 'Series 1',
        id: 'Series 1',
        items: [
            {
                id: '1',
                value: 1
            },
            {
                id: '2',
                value: 2
            }
        ]
    }
];
const setupBarChart = async (options) => {
    const defaultProps = {
        width: '500px',
        height: '500px',
        series,
        groups: [{ id: 'Group1' }, { id: 'GroupB' }],
        getDataItem: (i, j) => series[i].items[j],
        'aria-label': 'ariaText'
    };
    const locale = matchTranslationBundle.matchTranslationBundle(['en'], new Set(['en-US', 'en']));
    const { default: translations } = await __variableDynamicImportRuntime0__(`../../resources/nls/${locale}/bundle.ts`);
    const env = {
        translations: { '@oracle/oraclejet-preact': translations }
    };
    const barChartProps = { ...defaultProps, ...options };
    const barChart = jsxRuntime.jsx(BarChart.BarChart, { ...barChartProps });
    const view = preact.render(jsxRuntime.jsx(EnvironmentProvider.RootEnvironmentProvider, { environment: env, children: barChart }));
    await preact.waitFor(() => {
        const chart = preact.screen.getByRole('application');
        chai.expect(chart).to.be.not.null;
    }, {
        timeout: 5000
    });
    return view;
};
describe('Test BarChart component', () => {
    beforeEach(() => {
        mockUseTextDimensionsDependencies.setupUseTextDimensionsDependenciesMock(window);
    });
    it('render', async function () {
        await setupBarChart();
        const ariaRole = preact.screen.getByRole('application');
        chai.expect(ariaRole).not.null;
    });
    const clientHints$1 = clientHints.getClientHints();
    if (typeof jest === 'undefined') {
        if (clientHints$1.browser === 'chrome') {
            mocha.timeout(TOOLTIP_TEST_TIMEOUT);
            if (!IS_CHROME_HEADLESS) {
                it('handles text rotation and truncation', async function () {
                    const items = gdpData.map((i, index) => ({
                        id: index,
                        value: i.gdp
                    }));
                    await setupBarChart({
                        width: '1000px',
                        height: '300px',
                        series: [
                            {
                                id: 0,
                                name: 'GDP',
                                items
                            }
                        ],
                        getDataItem: (_, gIndex) => items[gIndex],
                        groups: gdpData.map((i) => ({
                            id: i.country
                        }))
                    });
                    // TODO:JET-65258
                    // workaround for test issue JET-65258
                    // some dom are missing from chart if we do not add
                    // this await userEvent.tab() and hence tests to check
                    // dom will fail; maybe it's a delay issue.
                    await userEvent__default["default"].tab();
                    await userEvent__default["default"].tab();
                    const chart = preact.screen.getByRole('application');
                    const queryAllByDataObject = domUtil.queryAllBy('data-oj-text');
                    const text = queryAllByDataObject(chart, 'Bosnia and Herzegovina');
                    chai.expect(text[0].textContent).equals('Bosnia and H…');
                    await userEvent__default["default"].hover(text[0]);
                    await preact.waitFor(() => domUtil.checkTooltipText('Bosnia and Herzegovina'), {
                        timeout: 5000
                    });
                });
            }
        }
        it('drag mode buttons', async function () {
            await setupBarChart({
                dragMode: 'user',
                zoomAndScroll: 'live',
                selectionMode: 'multiple',
                width: '500px',
                height: '500px',
                series,
                groups: [{ id: 'Group1' }, { id: 'GroupB' }],
                getDataItem: (i, j) => series[i].items[j],
                'aria-label': 'ariaText'
            });
            const chart = preact.screen.getByRole('application');
            chai.expect(chart).not.null;
            const queryAllByGroupIndex = domUtil.queryAllBy('data-oj-group-index');
            const firstBar = queryAllByGroupIndex(chart, '0')[0];
            await userEvent__default["default"].hover(firstBar);
            await preact.waitFor(() => {
                const buttons = preact.screen.getByRole('toolbar');
                chai.expect(buttons).not.null;
                // eslint-disable-next-line
                chai.expect(buttons.children.length).to.equal(2);
                if (clientHints$1.platform === 'mac' || clientHints$1.platform === 'windows') {
                    chai.expect(preact.screen.getByText('Marquee zoom')).not.null;
                    chai.expect(preact.screen.getByText('Marquee select')).not.null;
                }
                else if (clientHints$1.deviceType === 'phone') {
                    chai.expect(preact.screen.getByText('Pan')).not.null;
                    chai.expect(preact.screen.getByText('Marquee select')).not.null;
                }
            });
        });
        it('drag mode buttons when selection mode is multiple', async function () {
            await setupBarChart({
                selectionMode: 'multiple',
                width: '500px',
                height: '500px',
                series,
                groups: [{ id: 'Group1' }, { id: 'GroupB' }],
                getDataItem: (i, j) => series[i].items[j],
                'aria-label': 'ariaText'
            });
            const chart = preact.screen.getByRole('application');
            chai.expect(chart).not.null;
            const queryAllByGroupIndex = domUtil.queryAllBy('data-oj-group-index');
            const firstBar = queryAllByGroupIndex(chart, '0')[0];
            await userEvent__default["default"].hover(firstBar);
            await preact.waitFor(() => {
                if (clientHints$1.platform === 'mac' || clientHints$1.platform === 'windows') {
                    chai.expect(preact.screen.queryByText('Marquee select')).to.be.null;
                }
                else if (clientHints$1.deviceType === 'phone') {
                    const button = preact.screen.getByRole('toolbar');
                    chai.expect(button).not.null;
                    chai.expect(button.children.length).to.equal(1);
                    chai.expect(preact.screen.getByText('Marquee select')).not.null;
                }
            });
        });
    }
    it('Renders data label', async function () {
        await setupBarChart({
            width: '500px',
            height: '500px',
            getDataItem: (i, j) => ({
                ...series[i].items[j],
                labelPosition: 'center',
                label: series[i].items[j].value.toString()
            }),
            series,
            groups: [{ id: 'Group1' }, { id: 'GroupB' }]
        });
        // TODO:JET-65258
        // workaround for test issue JET-65258
        // some dom are missing from chart if we do not add
        // this await userEvent.tab() and hence tests to check
        // dom will fail; maybe it's a delay issue.
        await userEvent__default["default"].tab();
        await userEvent__default["default"].tab();
        const label1 = preact.screen.getByText('2');
        const label2 = preact.screen.getByText('1');
        chai.expect(label1).to.be.not.null;
        chai.expect(label2).to.be.not.null;
    });
    if (typeof jest === 'undefined') {
        it('trigger contextMenu on right click', async () => {
            const { container } = await setupBarChart({
                contextMenuConfig: {
                    itemsRenderer: () => {
                        return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuItem.MenuItem, { label: "MenuItem1" }), jsxRuntime.jsx(MenuItem.MenuItem, { label: "MenuItem2" }), jsxRuntime.jsx(MenuItem.MenuItem, { label: "MenuItem3" })] }));
                    }
                }
            });
            const barItem = 
            // eslint-disable-next-line
            container.firstElementChild?.firstElementChild?.firstElementChild?.firstElementChild;
            // eslint-disable-next-line
            const baChart = // eslint-disable-next-line
             container.firstElementChild?.firstElementChild?.firstElementChild;
            //We do the necessary to have firstItem as current item
            preact.fireEvent.contextMenu(baChart, {
                clientX: 50,
                clientY: 50,
                currentTarget: barItem
            });
            const menu = menuTestsUtils.getMenuItemByRole('menu');
            const menuItems = menuTestsUtils.getAllMenuItemsByRole('menuitem');
            //With this we check context menu context was set correctly
            const menuItemGotByLabel = menuTestsUtils.getLabel('MenuItem1');
            chai.expect(menu).not.null;
            chai.expect(menuItems.length).equals(3);
            chai.expect(menuItemGotByLabel).not.null;
        });
        it('trigger contextMenu from keyboard', async () => {
            const { container } = await setupBarChart({
                contextMenuConfig: {
                    itemsRenderer: () => {
                        return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuItem.MenuItem, { label: "MenuItem1" }), jsxRuntime.jsx(MenuItem.MenuItem, { label: "MenuItem2" }), jsxRuntime.jsx(MenuItem.MenuItem, { label: "MenuItem3" })] }));
                    }
                }
            });
            // eslint-disable-next-line
            const root = container.firstElementChild?.firstElementChild;
            await userEvent__default["default"].tab();
            await userEvent__default["default"].keyboard('[ENTER]');
            preact.fireEvent.keyDown(root, { key: 'F10', shiftKey: true });
            const menu = menuTestsUtils.getMenuItemByRole('menu');
            const menuItems = menuTestsUtils.getAllMenuItemsByRole('menuitem');
            //With this we check context menu context was set correctly
            const menuItemGotByLabel = menuTestsUtils.getLabel('MenuItem1');
            chai.expect(menu).not.null;
            chai.expect(menuItems.length).equals(3);
            chai.expect(menuItemGotByLabel).not.null;
        });
        it('renders overview content', async () => {
            const { container } = await setupBarChart({
                overview: 'on',
                series: [
                    {
                        name: 'Series 1',
                        id: 'Series 1',
                        items: [
                            {
                                id: '1',
                                value: 1
                            },
                            {
                                id: '2',
                                value: 2
                            },
                            {
                                id: '3',
                                value: 1
                            },
                            {
                                id: '4',
                                value: 2
                            }
                        ]
                    }
                ],
                groups: [{ id: 'GroupA' }, { id: 'GroupB' }, { id: 'GroupC' }, { id: 'GroupD' }],
                xAxis: {
                    viewportMax: 2,
                    viewportMin: 1
                }
            });
            // eslint-disable-next-line
            const svgs = container.querySelectorAll('svg');
            chai.expect(svgs.length).to.equal(6);
            // eslint-disable-next-line
            chai.expect(svgs[0].parentElement?.getAttribute('tabIndex')).to.equal('0');
            // eslint-disable-next-line
            chai.expect(svgs[1].parentElement?.getAttribute('tabIndex')).is.null;
            const chartStyles = getComputedStyle(svgs[0]);
            const overviewStyles = getComputedStyle(svgs[1]);
            chai.expect(chartStyles.width).to.equal(overviewStyles.width);
            chai.expect(parseInt(overviewStyles.height)).to.lessThanOrEqual(parseInt(chartStyles.height));
            const queryAllByDataObject = domUtil.queryAllBy('data-oj-object');
            const chart = preact.screen.getByRole('application');
            const window = queryAllByDataObject(chart, 'window');
            // eslint-disable-next-line
            const background = window[0].parentElement?.children[0];
            // @ts-ignore
            const windowWidth = window[0].getBBox().width;
            // @ts-ignore
            const backgroundWidth = background.getBBox().width;
            chai.expect(windowWidth / backgroundWidth).to.closeTo(0.25, 0.05);
        });
    }
});
if (typeof jest === 'undefined') {
    describe('Drag and Drop', () => {
        let originalMouseDescriptors;
        beforeEach(() => {
            originalMouseDescriptors = eventUtils.mockMouseEventPageXYOffsetXY();
            mockUseTextDimensionsDependencies.setupUseTextDimensionsDependenciesMock(window);
        });
        afterEach(() => eventUtils.restoreMouseEventPageXYOffsetXY(originalMouseDescriptors));
        it('Drag item and Drop on y axis Accept', async () => {
            const callbacks = {
                startCalled: false,
                enterCalled: false,
                overCalled: false,
                dropCalled: false,
                dragDetailCorrect: false,
                dropDetailCorrect: false
            };
            const dragStartCallback = (detail) => {
                if (detail?.type === 'items') {
                    callbacks.dragDetailCorrect = true;
                    chai.expect(detail.items[0].seriesIndex === 0 && detail.items[0].groupIndex === 0).to.be.true;
                }
            };
            const dropCallback = (detail) => {
                if (detail?.type === 'yAxis') {
                    callbacks.dropDetailCorrect = true;
                    chai.expect(detail.y).to.not.null;
                    return true;
                }
                return false;
            };
            const dndCallbacks = dndUtils.getDndCallbacks(callbacks, dragStartCallback, dropCallback);
            const itemsDraggable = () => {
                return 'on';
            };
            await setupBarChart({
                ...dndCallbacks,
                itemsDraggable
            });
            const chart = preact.screen.getByRole('application');
            await userEvent__default["default"].tab();
            // eslint-disable-next-line
            const item = chart.querySelector('[data-oj-series-index="0"][data-oj-group-index="0"]');
            chai.expect(item.getAttribute('data-oj-series-index')).to.equal('0');
            const dropOptions = {
                clientX: 20,
                clientY: 20
            };
            // eslint-disable-next-line
            const dropRect = chart.firstElementChild?.children[4];
            dndUtils.testDnd(item, chart, dropRect, callbacks, true, dropOptions);
        });
        it('Drag item and Drop on x axis Accept', async () => {
            const callbacks = {
                startCalled: false,
                enterCalled: false,
                overCalled: false,
                dropCalled: false,
                dragDetailCorrect: false,
                dropDetailCorrect: false
            };
            const dragStartCallback = (detail) => {
                if (detail?.type === 'items') {
                    callbacks.dragDetailCorrect = true;
                    chai.expect(detail.items[0].seriesIndex === 0 && detail.items[0].groupIndex === 0).to.be.true;
                }
            };
            const dropCallback = (detail) => {
                if (detail?.type === 'xAxis') {
                    callbacks.dropDetailCorrect = true;
                    chai.expect(detail.x).to.not.null;
                    return true;
                }
                return false;
            };
            const dndCallbacks = dndUtils.getDndCallbacks(callbacks, dragStartCallback, dropCallback);
            const itemsDraggable = () => {
                return 'on';
            };
            await setupBarChart({
                ...dndCallbacks,
                itemsDraggable
            });
            const chart = preact.screen.getByRole('application');
            await userEvent__default["default"].tab();
            // eslint-disable-next-line
            const item = chart.querySelector('[data-oj-series-index="0"][data-oj-group-index="0"]');
            chai.expect(item.getAttribute('data-oj-series-index')).to.equal('0');
            const dropOptions = {
                clientX: 40,
                clientY: 480
            };
            // eslint-disable-next-line
            const dropRect = chart.firstElementChild?.children[5];
            dndUtils.testDnd(item, chart, dropRect, callbacks, true, dropOptions);
        });
        it('Drag group and Drop on plot area Accept', async () => {
            const callbacks = {
                startCalled: false,
                enterCalled: false,
                overCalled: false,
                dropCalled: false,
                dragDetailCorrect: false,
                dropDetailCorrect: false
            };
            const dragStartCallback = (detail) => {
                if (detail?.type === 'xAxisTickLabel') {
                    callbacks.dragDetailCorrect = true;
                    chai.expect(detail.groupIndex === 0).to.be.true;
                }
            };
            const dropCallback = (detail) => {
                if (detail?.type === 'plotArea') {
                    callbacks.dropDetailCorrect = true;
                    chai.expect(detail.x).to.not.null;
                    chai.expect(detail.y).to.not.null;
                    return true;
                }
                return false;
            };
            const dndCallbacks = dndUtils.getDndCallbacks(callbacks, dragStartCallback, dropCallback);
            const groupDraggable = () => {
                return 'on';
            };
            await setupBarChart({
                ...dndCallbacks,
                groupDraggable
            });
            const chart = preact.screen.getByRole('application');
            await userEvent__default["default"].tab();
            // eslint-disable-next-line
            const group = chart.querySelector('[data-oj-object="group"][data-oj-group-index="0"]');
            chai.expect(group.getAttribute('data-oj-object')).to.equal('group');
            const dropOptions = {
                clientX: 40,
                clientY: 40
            };
            // eslint-disable-next-line
            const dropRect = chart.firstElementChild?.children[1];
            dndUtils.testDnd(group, chart, dropRect, callbacks, true, dropOptions);
        });
        it('Drag item and Drop on y axis Reject', async () => {
            const callbacks = {
                startCalled: false,
                enterCalled: false,
                overCalled: false,
                dropCalled: false,
                dragDetailCorrect: false,
                dropDetailCorrect: false
            };
            const dragStartCallback = (detail) => {
                if (detail?.type === 'items') {
                    callbacks.dragDetailCorrect = true;
                    chai.expect(detail.items[0].seriesIndex === 0 && detail.items[0].groupIndex === 0).to.be.true;
                }
            };
            const dropCallback = () => {
                return false;
            };
            const dndCallbacks = dndUtils.getDndCallbacks(callbacks, dragStartCallback, dropCallback);
            const itemsDraggable = () => {
                return 'on';
            };
            await setupBarChart({
                ...dndCallbacks,
                itemsDraggable
            });
            const chart = preact.screen.getByRole('application');
            await userEvent__default["default"].tab();
            // eslint-disable-next-line
            const item = chart.querySelector('[data-oj-series-index="0"][data-oj-group-index="0"]');
            chai.expect(item.getAttribute('data-oj-series-index')).to.equal('0');
            const dropOptions = {
                clientX: 20,
                clientY: 20
            };
            // eslint-disable-next-line
            const dropRect = chart.firstElementChild?.children[4];
            dndUtils.testDnd(item, chart, dropRect, callbacks, true, dropOptions, true);
        });
        it('Drag item and Drop on x axis Reject', async () => {
            const callbacks = {
                startCalled: false,
                enterCalled: false,
                overCalled: false,
                dropCalled: false,
                dragDetailCorrect: false,
                dropDetailCorrect: false
            };
            const dragStartCallback = (detail) => {
                if (detail?.type === 'items') {
                    callbacks.dragDetailCorrect = true;
                    chai.expect(detail.items[0].seriesIndex === 0 && detail.items[0].groupIndex === 0).to.be.true;
                }
            };
            const dropCallback = () => {
                return false;
            };
            const dndCallbacks = dndUtils.getDndCallbacks(callbacks, dragStartCallback, dropCallback);
            const itemsDraggable = () => {
                return 'on';
            };
            await setupBarChart({
                ...dndCallbacks,
                itemsDraggable
            });
            const chart = preact.screen.getByRole('application');
            await userEvent__default["default"].tab();
            // eslint-disable-next-line
            const item = chart.querySelector('[data-oj-series-index="0"][data-oj-group-index="0"]');
            chai.expect(item.getAttribute('data-oj-series-index')).to.equal('0');
            const dropOptions = {
                clientX: 40,
                clientY: 480
            };
            // eslint-disable-next-line
            const dropRect = chart.firstElementChild?.children[5];
            dndUtils.testDnd(item, chart, dropRect, callbacks, true, dropOptions, true);
        });
        it('Drag group and Drop on plot area Reject', async () => {
            const callbacks = {
                startCalled: false,
                enterCalled: false,
                overCalled: false,
                dropCalled: false,
                dragDetailCorrect: false,
                dropDetailCorrect: false
            };
            const dragStartCallback = (detail) => {
                if (detail?.type === 'xAxisTickLabel') {
                    callbacks.dragDetailCorrect = true;
                    chai.expect(detail.groupIndex === 0).to.be.true;
                }
            };
            const dropCallback = () => {
                return false;
            };
            const dndCallbacks = dndUtils.getDndCallbacks(callbacks, dragStartCallback, dropCallback);
            const groupDraggable = () => {
                return 'on';
            };
            await setupBarChart({
                ...dndCallbacks,
                groupDraggable
            });
            const chart = preact.screen.getByRole('application');
            await userEvent__default["default"].tab();
            // eslint-disable-next-line
            const group = chart.querySelector('[data-oj-object="group"][data-oj-group-index="0"]');
            chai.expect(group.getAttribute('data-oj-object')).to.equal('group');
            const dropOptions = {
                clientX: 40,
                clientY: 40
            };
            // eslint-disable-next-line
            const dropRect = chart.firstElementChild?.children[1];
            dndUtils.testDnd(group, chart, dropRect, callbacks, true, dropOptions, true);
        });
    });
}
describe('Test BarChart component with no data', () => {
    if (typeof jest === 'undefined') {
        it('should not trigger context menu when there is no data', async () => {
            const { container } = await setupBarChart({
                series: [], // Empty series, no data
                groups: [],
                getDataItem: () => undefined,
                contextMenuConfig: {
                    itemsRenderer: () => {
                        return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuItem.MenuItem, { label: "MenuItem1" }), jsxRuntime.jsx(MenuItem.MenuItem, { label: "MenuItem2" }), jsxRuntime.jsx(MenuItem.MenuItem, { label: "MenuItem3" })] }));
                    }
                }
            });
            const root = container.firstElementChild?.firstElementChild;
            await userEvent__default["default"].tab();
            await userEvent__default["default"].keyboard('[ENTER]');
            preact.fireEvent.keyDown(root, { key: 'F10', shiftKey: true });
            const menu = preact.screen.queryByRole('menu');
            chai.expect(menu).to.be.null;
        });
    }
});
//# sourceMappingURL=BarChart.spec.js.map
