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

var _chunkTVIJNNPGjs = require('./chunk-TVIJNNPG.js');


var _chunkOTX6AHJGjs = require('./chunk-OTX6AHJG.js');


var _chunkIRF4AGBWjs = require('./chunk-IRF4AGBW.js');


var _chunkT333JKJGjs = require('./chunk-T333JKJG.js');


var _chunkHQVVRUP3js = require('./chunk-HQVVRUP3.js');

// tmp-babel/comments/web/Comments/index.js
var _react = require('react');
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 Comments = function Comments2(_ref) {
  var targetRef = _ref.target, _ref$subscriptionsEna = _ref.subscriptionsEnabled, subscriptionsEnabled = _ref$subscriptionsEna === void 0 ? true : _ref$subscriptionsEna, _ref$CommentsList = _ref.CommentsList, CommentsList = _ref$CommentsList === void 0 ? _chunkTVIJNNPGjs.CommentsList_default : _ref$CommentsList, CommentsListProps = _ref.CommentsListProps, _ref$CommentCreate = _ref.CommentCreate, CommentCreate = _ref$CommentCreate === void 0 ? _chunkOTX6AHJGjs.CommentCreate_default : _ref$CommentCreate, CommentCreateProps = _ref.CommentCreateProps, onCommentCreateFocus = _ref.onCommentCreateFocus;
  var _useCommentReply = _chunkIRF4AGBWjs.useCommentReply_default.call(void 0, ), resetCommentReply = _useCommentReply.resetCommentReply;
  var commentCreateRef = _react.useRef.call(void 0, null);
  var target = _reactrelay.useFragment.call(void 0, _chunkHQVVRUP3js.CommentsFragmentQuery, targetRef);
  var subscriptionsEnabledBoolean = typeof subscriptionsEnabled === "boolean" ? subscriptionsEnabled : true;
  var handleCommentCreateFocus = function handleCommentCreateFocus2() {
    if (commentCreateRef.current) {
      commentCreateRef.current.focus({
        preventScroll: true
      });
      onCommentCreateFocus === null || onCommentCreateFocus === void 0 || onCommentCreateFocus(commentCreateRef.current);
    }
  };
  _react.useEffect.call(void 0, function() {
    return function() {
      resetCommentReply();
    };
  }, []);
  if (!target.isCommentsEnabled) {
    return null;
  }
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", {
    className: "grid",
    children: [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommentsList, _objectSpread({
      target,
      subscriptionsEnabled: subscriptionsEnabledBoolean,
      onReplyClick: handleCommentCreateFocus
    }, CommentsListProps)), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommentCreate, _objectSpread({
      ref: commentCreateRef,
      targetObjectId: target.id
    }, CommentCreateProps))]
  });
};
var Comments_default = _chunkT333JKJGjs.withCommentReplyProvider_default.call(void 0, Comments);



exports.Comments_default = Comments_default;
//# sourceMappingURL=chunk-BQO22K3Q.js.map