"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk4VVZAYGNjs = require('./chunk-4VVZAYGN.js');var _chunkGZNRYBLLjs = require('./chunk-GZNRYBLL.js');var _chunkDMSSQ5DSjs = require('./chunk-DMSSQ5DS.js');var _chunkJEUQIVMMjs = require('./chunk-JEUQIVMM.js');var _react = require('react');var _material = require('@mui/material');var _reactvirtuoso = require('react-virtuoso');var _jsxruntime = require('react/jsx-runtime');function p(t){"@babel/helpers - typeof";return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(t)}function _(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_(Object(r),!0).forEach(function(n){D(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function D(t,e,r){return(e=M(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function M(t){var e=k(t,"string");return p(e)=="symbol"?e:e+""}function k(t,e){if(p(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(p(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function B(t,e){return V(t)||$(t,e)||H(t,e)||F()}function F(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function H(t,e){if(t){if(typeof t=="string")return C(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(t,e):void 0}}function C(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function $(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,l,c,m,d=[],s=!0,u=!1;try{if(c=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=c.call(r)).done)&&(d.push(n.value),d.length!==e);s=!0);}catch(i){u=!0,l=i}finally{try{if(!s&&r.return!=null&&(m=r.return(),Object(m)!==m))return}finally{if(u)throw l}}return d}}function V(t){if(Array.isArray(t))return t}var q=function(e){var r,n=e.target,l=e.currentThreadDepth,c=e.subscriptionsEnabled,m=e.onReplyClick,d=e.CommentItem,s=e.VirtuosoProps,u=_chunkDMSSQ5DSjs.b.call(void 0, n),i=u.data,P=u.loadNext,T=u.isLoadingNext,x=u.hasNext,w=_react.useTransition.call(void 0, ),v=B(w,2),N=v[0],A=v[1],y=_react.useMemo.call(void 0, function(){var a;return(i==null||(a=i.comments)===null||a===void 0?void 0:a.edges.filter(function(o){return _optionalChain([o, 'optionalAccess', _2 => _2.node])}).map(function(o){return _optionalChain([o, 'optionalAccess', _3 => _3.node])}))||[]},[i==null||(r=i.comments)===null||r===void 0?void 0:r.edges]),E=function(o){return o?_jsxruntime.jsx.call(void 0, d,{target:i,comment:o,currentThreadDepth:l,subscriptionsEnabled:c,onReplyClick:m},"comment-reply-".concat(o.id)):null},L=function(){return y.length===0?null:_jsxruntime.jsx.call(void 0, "div",{className:"h-2"})},I=function(){var o;if(!x)return null;var b=Number(i==null||(o=i.commentsCount)===null||o===void 0?void 0:o.total)-y.length;return _jsxruntime.jsx.call(void 0, _material.Box,{sx:{paddingTop:1},children:_jsxruntime.jsxs.call(void 0, _chunk4VVZAYGNjs.a,{variant:"text",size:"small",disableElevation:!0,disableRipple:!0,disabled:N||T,onClick:function(){A(function(){P(_chunkJEUQIVMMjs.a)})},children:["Show more replies (",b,")"]})})};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[c&&_jsxruntime.jsx.call(void 0, _chunkGZNRYBLLjs.c,{targetObjectId:i.id}),_jsxruntime.jsx.call(void 0, _reactvirtuoso.Virtuoso,R({useWindowScroll:!0,data:y,itemContent:function(o,b){return E(b)},components:{Header:L,Footer:I}},s))]})},rt= exports.a =q;exports.a = rt;
//# sourceMappingURL=chunk-EJEWFBJL.js.map