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

var _chunkJFAIEIDRjs = require('./chunk-JFAIEIDR.js');


var _chunkIDXUKM3Gjs = require('./chunk-IDXUKM3G.js');


var _chunkHK5TUUP7js = require('./chunk-HK5TUUP7.js');

// tmp-babel/notifications/web/NotificationsList/NotificationItem/index.js
var _material = require('@mui/material');
var _reactrelay = require('react-relay');
var _jsxruntime = require('react/jsx-runtime');
function _slicedToArray(r, e) {
  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
}
function _nonIterableRest() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray(r, a);
    var t = {}.toString.call(r).slice(8, -1);
    return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
  }
}
function _arrayLikeToArray(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
  return n;
}
function _iterableToArrayLimit(r, l) {
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (null != t) {
    var e, n, i, u, a = [], f = true, o = false;
    try {
      if (i = (t = t.call(r)).next, 0 === l) {
        if (Object(t) !== t) return;
        f = false;
      } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
    } catch (r2) {
      o = true, n = r2;
    } finally {
      try {
        if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
      } finally {
        if (o) throw n;
      }
    }
    return a;
  }
}
function _arrayWithHoles(r) {
  if (Array.isArray(r)) return r;
}
var NotificationItem = function NotificationItem2(_ref) {
  var notificationRef = _ref.notification, _ref$NotificationItem = _ref.NotificationItemRenderer, NotificationItemRenderer = _ref$NotificationItem === void 0 ? _chunkJFAIEIDRjs.NotificationItemRenderer_default : _ref$NotificationItem;
  var notification = _reactrelay.useFragment.call(void 0, _chunkIDXUKM3Gjs.NotificationItemFragment, notificationRef);
  var _useNotificationsMark = _chunkHK5TUUP7js.useNotificationsMarkAsRead.call(void 0, ), _useNotificationsMark2 = _slicedToArray(_useNotificationsMark, 1), commitMutation = _useNotificationsMark2[0];
  var markAsRead = function markAsRead2() {
    if (notification.unread) {
      commitMutation({
        variables: {
          input: {
            read: true,
            notificationIds: [notification.id]
          }
        }
      });
    }
  };
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, {
    onClick: markAsRead,
    sx: {
      cursor: "pointer"
    },
    children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NotificationItemRenderer, {
      notification
    })
  });
};
var NotificationItem_default = NotificationItem;



exports.NotificationItem_default = NotificationItem_default;
//# sourceMappingURL=chunk-LOUC6I6A.js.map