"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3776],{3776:function(e,t,r){r.r(t),r.d(t,{default:function(){return h}});var n=r(22696),a=r.n(n),i=r(24468),s=r(46782),o=r(99891),d=r(8566),l=r(70267),u=r(5898),c=r(82885),m=r(76942);function h(e,t,r){var n=this;function h(){var e=v(),r=g[e];return r||((r=g[e]={query:{SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"Movie",Recursive:!0,EnableTotalRecordCount:!1},view:c.getSavedView(e)||"Poster"}).query.ParentId=t.topParentId,c.loadQuerySettings(e,r.query)),r}function p(){return h().query}function v(){return t.topParentId+"-moviegenres"}function b(){return!s.A.desktop}var f,y=function(e,a){if(e.isIntersecting){var s=e.target;a.unobserve(s);var o=s.getAttribute("data-id"),d=n.getCurrentViewStyle(),l="Thumb"==d||"ThumbCard"==d?5:9;b()&&(l=10);var u={SortBy:"Random",SortOrder:"Ascending",IncludeItemTypes:"Movie",Recursive:!0,Fields:"PrimaryImageAspectRatio,MediaSourceCount",ImageTypeLimit:1,EnableImageTypes:"Thumb"==d||"ThumbCard"==d?"Primary,Backdrop,Thumb":"Primary",Limit:l,GenreIds:o,EnableTotalRecordCount:!1,ParentId:t.topParentId};ApiClient.getItems(ApiClient.getCurrentUserId(),u).then((function(e){"Thumb"==d?i.default.buildCards(e.Items,{itemsContainer:s,shape:(0,m.UI)(b()),preferThumb:!0,showTitle:!0,scalable:!0,centerText:!0,overlayMoreButton:!0,allowBottomPadding:!1}):"ThumbCard"==d?i.default.buildCards(e.Items,{itemsContainer:s,shape:(0,m.UI)(b()),preferThumb:!0,showTitle:!0,scalable:!0,centerText:!1,cardLayout:!0,showYear:!0}):"PosterCard"==d?i.default.buildCards(e.Items,{itemsContainer:s,shape:(0,m.xK)(b()),showTitle:!0,scalable:!0,centerText:!1,cardLayout:!0,showYear:!0}):"Poster"==d&&i.default.buildCards(e.Items,{itemsContainer:s,shape:(0,m.xK)(b()),scalable:!0,overlayMoreButton:!0,allowBottomPadding:!0,showTitle:!0,centerText:!0,showYear:!0}),e.Items.length>=u.Limit&&r.querySelector(".btnMoreFromGenre"+o+" .material-icons").classList.remove("hide")}))}},g={};this.getViewStyles=function(){return"Poster,PosterCard,Thumb,ThumbCard".split(",")},this.getCurrentViewStyle=function(){return h().view},this.setCurrentViewStyle=function(e){h().view=e,c.saveViewSetting(v(),e),n.preRender(),n.renderTab()},this.enableViewSelection=!0,this.preRender=function(){f=function(){d.Ay.show();var e=p();return ApiClient.getGenres(ApiClient.getCurrentUserId(),e)}()},this.renderTab=function(){!function(e,r){var n=p();r.then((function(r){for(var i=e.querySelector("#items"),m="",h=r.Items,p=0,f=h.length;p<f;p++){var g=h[p];if(m+='<div class="verticalSection">',m+='<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">',m+='<a is="emby-linkbutton" href="'+l.appRouter.getRouteUrl(g,{context:"movies",parentId:t.topParentId})+'" class="more button-flat button-flat-mini sectionTitleTextButton btnMoreFromGenre'+g.Id+'">',m+='<h2 class="sectionTitle sectionTitle-cards">',m+=a()(g.Name),m+="</h2>",m+='<span class="material-icons hide chevron_right" aria-hidden="true"></span>',m+="</a>",m+="</div>",b()){var T="scrollX hiddenScrollX";s.A.tv&&(T+="smoothScrollX padded-top-focusscale padded-bottom-focusscale"),m+='<div is="emby-itemscontainer" class="itemsContainer '+T+' lazy padded-left padded-right" data-id="'+g.Id+'">'}else m+='<div is="emby-itemscontainer" class="itemsContainer vertical-wrap lazy padded-left padded-right" data-id="'+g.Id+'">';m+="</div>",m+="</div>"}r.Items.length||(m="",m+='<div class="noItemsMessage centerMessage">',m+="<h1>"+u.Ay.translate("MessageNothingHere")+"</h1>",m+="<p>"+u.Ay.translate("MessageNoGenresAvailable")+"</p>",m+="</div>"),i.innerHTML=m,o.Ay.lazyChildren(i,y),c.saveQuerySettings(v(),n),d.Ay.hide()}))}(r,f)}}r(10353)}}]);