(self.webpackChunk_studyhub_co_react_comments_django_client=self.webpackChunk_studyhub_co_react_comments_django_client||[]).push([[3967],{73967:(t,e,n)=>{"use strict";n.r(e),n.d(e,{TopicsList:()=>G,default:()=>W,mapDispatchToProps:()=>Q});var o,r,i,a=n(67294),c=(n(45697),n(15482)),l=n(99095),s=n(37424),u=n(246),d=n.n(u),f=n(49656),p=n(35281),m=n(22222),v=n(18350),y=n.n(v),h=n(85809),b=n(28269),g=n.n(b),S=n(1266),_=n.n(S),w=n(70448),A=n.n(w),C=n(71893);function L(t,e,n,o){i||(i="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var r=t&&t.defaultProps,a=arguments.length-3;if(e||0===a||(e={children:void 0}),1===a)e.children=o;else if(a>1){for(var c=new Array(a),l=0;l<a;l++)c[l]=arguments[l+3];e.children=c}if(e&&r)for(var s in r)void 0===e[s]&&(e[s]=r[s]);else e||(e=r||{});return{$$typeof:i,type:t,key:void 0===n?null:""+n,ref:null,props:e,_owner:null}}var k=C.ZP.div.withConfig({displayName:"TopicListItem__CounterText",componentId:"sc-9of5q8-0"})(["font-size:0.7rem;"]);const T=function(t){return L(y().Item,{action:!0,onClick:t.onClick},void 0,L(A(),{},void 0,L(g(),{},void 0,o||(o=L(_(),{md:1},void 0,L(h.OdJ,{size:32}))),L(_(),{md:10},void 0,L("h4",{},void 0,t.item.title),t.item.description),L(_(),{md:1},void 0,L(k,{},void 0,t.item.threads_counter),r||(r=L(k,{},void 0,"Threads"))))))};var I=n(41293),P=n(92148),j=n(29473),Z=n(4828);const $=C.ZP.section.withConfig({displayName:"Section",componentId:"glq6sp-0"})(["margin:3em auto;&:first-child{margin-top:0;}"]);const x=(0,C.ZP)($).withConfig({displayName:"CenteredSection",componentId:"sc-1hnw32i-0"})(["text-align:center;"]);const E=(0,l.vU)({topicsList:{id:"".concat("boilerplate.containers.HomePage",".topics"),defaultMessage:"Topics"}});var B,M,N=n(75010),q=n(41867),z=n(60207),O=n(63963);function D(t,e,n,o){M||(M="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var r=t&&t.defaultProps,i=arguments.length-3;if(e||0===i||(e={children:void 0}),1===i)e.children=o;else if(i>1){for(var a=new Array(i),c=0;c<i;c++)a[c]=arguments[c+3];e.children=a}if(e&&r)for(var l in r)void 0===e[l]&&(e[l]=r[l]);else e||(e=r||{});return{$$typeof:M,type:t,key:void 0===n?null:""+n,ref:null,props:e,_owner:null}}function H(t){return function(t){if(Array.isArray(t))return R(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||J(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=t&&("undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null==n)return;var o,r,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(o=n.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(t){c=!0,r=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw r}}return i}(t,e)||J(t,e)||function(){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 J(t,e){if(t){if("string"===typeof t)return R(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(t,e):void 0}}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var F="topics";function G(t){var e=t.topicListActions,n=t.topicsList,o=t.history;(0,P.v)({key:F,reducer:q.Z}),(0,j.h)({key:F,saga:z.ZP});var r=(0,f.$B)(),i=U((0,a.useState)([]),2),s=i[0],u=i[1],p=U((0,a.useState)(!1),2),m=p[0],v=p[1],h=U((0,a.useState)(null),2),b=h[0],g=h[1];(0,a.useEffect)((function(){return e.loadTopics(),function(){e.topicsListLoaded(!1)}}),[]);(0,a.useEffect)((function(){n&&(u([].concat(H(s),H(n.results))),v(Boolean(n.next)),g(n.next))}),[n]);var S=[];return s&&(S=s.map((function(t){return D(T,{onClick:function(e){var n;n=t.slug,O.Z.push("".concat(r.path,"/").concat(n)),o&&o.push({pathname:"".concat(r.path,"/").concat(n)})},item:t},t.slug)}))),D("article",{},void 0,B||(B=D(c.ql,{},void 0,D("title",{},void 0,"Topics List"),D("meta",{name:"description",content:"React comments Django topics List"}))),D("div",{},void 0,D(x,{},void 0,D(I.Z,{},void 0,a.createElement(l._H,E.topicsList))),D($,{},void 0,D(d(),{pageStart:0,loadMore:function(){m&&(v(Boolean(!1)),e.loadTopics(b))},hasMore:m},void 0,D(y(),{},void 0,S)))))}var K=(0,m.zB)({topicsList:(0,Z.fN)()});function Q(t){return{topicListActions:(0,p.bindActionCreators)(N,t)}}var V=(0,s.connect)(K,Q);const W=(0,p.compose)(V,a.memo)(G)}}]);