"use strict";Object.defineProperty(exports, "__esModule", {value: true});

var _chunkOKMJEWJPjs = require('./chunk-OKMJEWJP.js');


var _chunkSP2GVPV5js = require('./chunk-SP2GVPV5.js');


var _chunkGFUIJZCXjs = require('./chunk-GFUIJZCX.js');

// tmp-babel/notifications/native/NotificationBellWithBadge/index.js
var _react = require('react');
var _badges = require('@baseapp-frontend/design-system/components/native/badges');
var _icons = require('@baseapp-frontend/design-system/components/native/icons');
var _views = require('@baseapp-frontend/design-system/components/native/views');
var _reactrelay = require('react-relay');
var _jsxruntime = require('react/jsx-runtime');
function _typeof(o) {
  "@babel/helpers - typeof";
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
    return typeof o2;
  } : function(o2) {
    return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
  }, _typeof(o);
}
function ownKeys(e, r) {
  var t = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    r && (o = o.filter(function(r2) {
      return Object.getOwnPropertyDescriptor(e, r2).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), true).forEach(function(r2) {
      _defineProperty(e, r2, t[r2]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
      Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
    });
  }
  return e;
}
function _defineProperty(e, r, t) {
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : 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);
}
var NotificationBellWithBadge = function NotificationBellWithBadge2(_ref) {
  var _ref$isActive = _ref.isActive, isActive = _ref$isActive === void 0 ? false : _ref$isActive;
  var _useLazyLoadQuery = _reactrelay.useLazyLoadQuery.call(void 0, _chunkSP2GVPV5js.NotificationsPopoverQuery, {}, {
    fetchPolicy: "store-and-network"
  }), me = _useLazyLoadQuery.me;
  var user = _reactrelay.useFragment.call(void 0, _chunkOKMJEWJPjs.NotificationUserMenuFragment, me);
  _chunkGFUIJZCXjs.useNotificationsSubscription.call(void 0, user === null || user === void 0 ? void 0 : user.id);
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _views.View, {
    children: [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _icons.BellIcon, {
      width: "24",
      height: "24",
      isActive
    }), !!(user !== null && user !== void 0 && user.notificationsUnreadCount) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _badges.Badge, {
      children: user.notificationsUnreadCount > 99 ? "99+" : user.notificationsUnreadCount
    })]
  });
};
var SuspendedNotificationBellWithBadge = function SuspendedNotificationBellWithBadge2(props) {
  var isActive = props.isActive;
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Suspense, {
    fallback: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _icons.BellIcon, {
      width: "24",
      height: "24",
      isActive
    }),
    children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NotificationBellWithBadge, _objectSpread({}, props))
  });
};
var NotificationBellWithBadge_default = SuspendedNotificationBellWithBadge;



exports.NotificationBellWithBadge_default = NotificationBellWithBadge_default;
//# sourceMappingURL=chunk-2K3FPMCM.js.map