import { getExtensionKey } from '../../../state/helpers';
import { getIsRovoChatEnabled } from '../../../utils/rovo';
var extractRovoChatAction = function extractRovoChatAction(response, rovoConfig, actionOptions) {
  // Experiment cleanup note: platform_sl_3p_auth_rovo_action
  // If action is available by default, we need to allow RovoChatAction to be configurable to opt-out
  // if (!canShowAction(CardAction.RovoChatAction, actionOptions)) {
  // 	return;
  // }

  var isRovoChatEnabled = getIsRovoChatEnabled(rovoConfig);
  if (!isRovoChatEnabled) {
    return;
  }

  // Experiment cleanup note: platform_sl_3p_auth_rovo_action
  // If feature isn't support all 3P, this value should come from meta.supportedFeature
  var isSupportedFeature = getExtensionKey(response) === 'google-object-provider';
  var isOptIn = (actionOptions === null || actionOptions === void 0 ? void 0 : actionOptions.rovoChatAction) === true;
  return isSupportedFeature && isOptIn ? true : undefined;
};
export default extractRovoChatAction;