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