function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import React from 'react';
import { expect, within, waitFor } from 'storybook/test';
import ContentSidebarComponent from '../../ContentSidebar';
const MockCustomPanel = /*#__PURE__*/React.forwardRef(({
  title
}, ref) => /*#__PURE__*/React.createElement("div", {
  ref: ref,
  style: {
    padding: '20px'
  }
}, /*#__PURE__*/React.createElement("h2", null, title), /*#__PURE__*/React.createElement("p", null, "This is a custom sidebar panel content.")));
MockCustomPanel.displayName = 'MockCustomPanel';
const MockCustomBoxAIPanel = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement("div", {
  ref: ref,
  style: {
    padding: '20px'
  },
  "data-testid": "custom-boxai-panel"
}, /*#__PURE__*/React.createElement("h2", null, "Custom Box AI Panel"), /*#__PURE__*/React.createElement("p", null, "This is a custom Box AI implementation provided by the consumer.")));
MockCustomBoxAIPanel.displayName = 'MockCustomBoxAIPanel';
const MockIcon = () => /*#__PURE__*/React.createElement("span", null, "\uD83D\uDCCB");
const MockBoxAIIcon = () => /*#__PURE__*/React.createElement("span", null, "\uD83E\uDD16");
const DISABLED_TOOLTIP = 'Box AI is not available for this file type';
const customPanelConfig = {
  id: 'customPanel',
  path: 'customPanel',
  component: MockCustomPanel,
  title: 'Custom Panel',
  icon: MockIcon
};
const customBoxAIPanelConfig = {
  id: 'boxai',
  path: 'boxai',
  component: MockCustomBoxAIPanel,
  title: 'Custom Box AI',
  icon: MockBoxAIIcon
};
const defaultFeatures = _objectSpread(_objectSpread({}, global.FEATURE_FLAGS), {}, {
  metadata: {
    redesign: {
      enabled: true
    }
  },
  boxai: {
    sidebar: {
      enabled: true
    }
  }
});
export default {
  title: 'Elements/ContentSidebar/tests/visual-regression-tests',
  component: ContentSidebarComponent,
  args: {
    detailsSidebarProps: {
      hasProperties: true,
      hasNotices: true,
      hasAccessStats: true,
      hasClassification: true,
      hasRetentionPolicy: true
    },
    features: global.FEATURE_FLAGS,
    fileId: global.FILE_ID,
    hasActivityFeed: true,
    hasMetadata: true,
    hasSkills: true,
    hasVersions: true,
    token: global.TOKEN
  }
};

// Basic
export const ContentSidebar = {
  args: {
    features: defaultFeatures
  }
};
export const withModernization = {
  args: {
    enableModernizedComponents: true
  }
};
export const ContentSidebarDetailsTab = {
  args: {
    hasActivityFeed: false,
    hasMetadata: false
  }
};

// Custom Panels
export const WithMultipleCustomPanels = {
  args: {
    features: defaultFeatures,
    customSidebarPanels: [customPanelConfig, {
      id: 'anotherCustomPanel',
      path: 'anotherCustomPanel',
      component: MockCustomPanel,
      title: 'Another Panel',
      icon: () => /*#__PURE__*/React.createElement("span", null, "\uD83D\uDCDD")
    }]
  }
};

// Native Box AI
export const NativeBoxAIDisabled = {
  args: {
    features: _objectSpread(_objectSpread({}, defaultFeatures), {}, {
      boxai: {
        sidebar: {
          enabled: true,
          showOnlyNavButton: true,
          disabledTooltip: DISABLED_TOOLTIP
        }
      }
    })
  },
  play: async ({
    canvasElement
  }) => {
    const canvas = within(canvasElement);
    await waitFor(() => {
      const boxAiButton = canvas.getByTestId('sidebarboxai');
      expect(boxAiButton).toHaveAttribute('aria-disabled', 'true');
      expect(boxAiButton).toHaveClass('bdl-is-disabled');
      expect(boxAiButton).toHaveAttribute('aria-selected', 'false');
    }, {
      timeout: 5000
    });
  }
};

// Custom Box AI Panel
export const WithCustomBoxAIPanel = {
  args: {
    features: _objectSpread(_objectSpread({}, defaultFeatures), {}, {
      boxai: {
        sidebar: {
          enabled: false
        }
      }
    }),
    customSidebarPanels: [customBoxAIPanelConfig]
  },
  play: async ({
    canvasElement
  }) => {
    const canvas = within(canvasElement);
    await waitFor(() => {
      const boxAiButton = canvas.getByTestId('sidebarboxai');
      expect(boxAiButton).toHaveAttribute('aria-selected', 'true');
      expect(canvas.getByTestId('custom-boxai-panel')).toBeInTheDocument();
    }, {
      timeout: 5000
    });
  }
};
//# sourceMappingURL=ContentSidebar-visual.stories.js.map