PageSourceSearch

https://www.getepic.com/default-src_app_web-app_components_search_…ch-results_component_ts.3eec86a909a9f8f3.js

js getepic.com collected 2026-09-24 08:40:42 UTC 70,426 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkng_up=self.webpackChunkng_up||[]).push([["default-src_app_web-app_components_search_search-results_search-results_component_ts"],{18898:(Y,R,l)=>{l.d(R,{Gr:()=>p,KC:()=>b,NO:()=>T,Wd:()=>d,fC:()=>v,nv:()=>e,ux:()=>h,x1:()=>f});var p=(()=>{return(a=p||(p={})).LAND="landing_originals",a.BACK_ARROW_CLICK="originals_back_arrow_click",p;var a})(),e=(()=>{return(a=e||(e={})).CAME_FROM="clicked_on",a.EO_TITLE="eo_title",a.SERIES_IDS="seriesmodel_ids",a.WIDGET_CTA_ACTION="cta_button",e;var a})(),T=(()=>{return(a=T||(T={})).EPIC_ORIGINALS_ROW="epic_originals_row",a.FRONT_OF_BOOK="front_of_book",a.END_OF_BOOK="end_of_book",a.BANNER="banner",T;var a})();const h="epic_originals_landing_page";var b=(()=>((b||(b={})).CTA_CLICK="originals_read_cta_click",b))(),f=(()=>{return(a=f||(f={})).EO_TITLE="eo_title",a.BOOK_TITLE="book_title",a.BOOK_ID="book_id",a.WIDGET_CTA_ACTION="cta_button",a.PAGES_REMAINING="num_pages_remaining",a.PROGRESS="read_progress",f;var a})(),d=(()=>{return(a=d||(d={})).START="start_reading",a.CONTINUE="continue_reading",a.READ_AGAIN="read_again",d;var a})(),v=(()=>{return(a=v||(v={})).EO_TITLE="eo_title",a.ROW_TITLE="row_title",a.ROW_POSITION="row_position",a.BOOK_POSITION="book_position",v;var a})()},77198:(Y,R,l)=>{l.d(R,{d:()=>F});var p=l(15527),e=l(18898),T=l(69636),h=l(3184),b=l(52220),f=l(5485),d=l(41752),v=l(84449),a=l(43445),k=l(31503),I=l(36362);const P=function(S,A,g){return{section_swap_variant:S,image_scale_center:A,unset_width:g}};let F=(()=>{class S extends T.C{constructor(g,m,C,y,D,L){super(g,m,C),this.assetService=y,this.routingService=D,this._envService=L,this.collectionThumbnails={},this.section_swap_variant=!1,this.searchSection=!1,this.viewListType=!1}ngOnInit(){this._initThumbnails()}showOriginalsCollection(g){var m;let C=this.onClick(g,(null===(m=this.collection)||void 0===m?void 0:m.recommendation_uuid4)||"");this.collection&&this.routingService.goToWebAppRoute({route:p.Pm.CONTENT_TITLE,pathParams:[this.collection.modelId],extras:{state:{clickUuid4:C[0],cameFromSource:e.NO.EPIC_ORIGINALS_ROW}}})}onKeyDown(g){if("Enter"===g.key||" "===g.key){g.preventDefault();const C=g.target.getBoundingClientRect();this.showOriginalsCollection({clientX:C.left+C.width/2,clientY:C.top+C.height/2})}}getAriaLabel(){var g;return(null===(g=this.collection)||void 0===g?void 0:g.title)||"Originals collection"}getItemRecommendationUuid(){var g;return(null===(g=this.collection)||void 0===g?void 0:g.recommendation_uuid4)||""}_initThumbnails(){var g,m,C,y;let L={url:this.section_swap_variant?null===(g=this.collection)||void 0===g?void 0:g.cardImageUrl:(null===(m=this.collection)||void 0===m?void 0:m.cardImageExtraSmallUrl)?this.collection.cardImageExtraSmallUrl:(null===(C=this.collection)||void 0===C?void 0:C.cardImageUrl)?this.collection.cardImageUrl:`${this._envService.cdnBase}${null===(y=this.collection)||void 0===y?void 0:y.cardImageExtraSmall}.png`};const E=this.section_swap_variant?250:420;this.searchSection||(L=Object.assign(Object.assign({},L),{width:E})),this.collectionThumbnails=this.assetService.getImageVersions(L,["png","webp"])}}return S.\u0275fac=function(g){return new(g||S)(h.Y36(b.Z),h.Y36(v.f),h.Y36(a.W),h.Y36(f.d),h.Y36(k.Zn),h.Y36(d.DJ))},S.\u0275cmp=h.Xpm({type:S,selectors:[["new-epic-originals-collection-item"]],inputs:{collection:"collection",section_swap_variant:"section_swap_variant",searchSection:"searchSection",viewListType:"viewListType"},features:[h.qOj],decls:5,vars:11,consts:[["tabindex","0","role","button",1,"epic-original-container",3,"click","keydown"],["type","image/webp",3,"srcset"],[1,"epic-originals-collection-image","pointer",2,"border-radius","7px","height","100%",3,"ngClass","src","title","alt"],["_elementForImpressionLogging",""]],template:function(g,m){1&g&&(h.TgZ(0,"div",0),h.NdJ("click",function(y){return m.showOriginalsCollection(y)})("keydown",function(y){return m.onKeyDown(y)}),h.TgZ(1,"picture"),h._UZ(2,"source",1)(3,"img",2,3),h.qZA()()),2&g&&(h.uIk("aria-label",m.getAriaLabel()),h.xp6(2),h.Q6J("srcset",m.collectionThumbnails.webp,h.LSH),h.xp6(1),h.Q6J("ngClass",h.kEZ(7,P,m.section_swap_variant,m.searchSection,m.viewListType))("src",m.collectionThumbnails.png,h.LSH)("title",(null==m.collection?null:m.collection.title)||"")("alt",(null==m.collection?null:m.collection.title)||"Originals collection image"),h.uIk("r-id",null==m.collection?null:m.collection.recommendation_uuid4))},directives:[I.mk],styles:[".epic-original-container[_ngcontent-%COMP%]{position:relative;display:inline-block;width:100%;height:auto;margin:0;outline:none}.epic-original-container[_ngcontent-%COMP%]:focus-visible{outline:3px solid #0a96e6;outline-offset:2px;border-radius:7px;z-index:10}.epic-original-container[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}img.epic-originals-collection-image[_ngcontent-%COMP%]{transform-origin:center left;transition:transform .25s;max-height:249px;margin:0 -10px;filter:drop-shadow(0px 2px 14px rgba(44,59,86,.2))}img.epic-originals-collection-image.image_scale_center[_ngcontent-%COMP%]{transform-origin:center center;width:100%}img.epic-originals-collection-image.unset_width[_ngcontent-%COMP%]{width:355px}img.epic-originals-collection-image[_ngcontent-%COMP%]:hover{transform:scale(1.1)}img.section_swap_variant[_ngcontent-%COMP%]{width:186px;margin:0;max-height:none}"]}),S})()},15639:(Y,R,l)=>{l.d(R,{G:()=>Ot});var p=l(36362),e=l(3184),T=l(65758),h=l(11877),b=l(50857),f=l(31950),d=l(53415),v=l(73398),a=l(15076),k=l(98476),I=l(11105),P=l(52220),F=l(64617),S=l(44687),A=l(57912),g=l(42948),m=l(1771),C=l(31543);const y=["contentTabs"];function D(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"a",3),e.NdJ("click",function(){const i=e.CHM(t),s=i.$implicit,r=i.index;return e.oxw().selectTab(s,r)})("keydown.enter",function(i){const s=e.CHM(t),r=s.$implicit,_=s.index;return e.oxw().onTabKeydown(i,r,_)})("keydown.space",function(i){const s=e.CHM(t),r=s.$implicit,_=s.index;return e.oxw().onTabKeydown(i,r,_)}),e._uU(1),e.qZA()}if(2&o){const t=c.$implicit,n=c.index,i=e.oxw();e.Q6J("active",n===i.tabIndex),e.uIk("aria-label",t.name+" tab")("aria-selected",n===i.tabIndex),e.xp6(1),e.hij(" ",t.name," ")}}let L=(()=>{class o{constructor(){this.tabsList=[],this.selectedTabType=f.TG.SEARCH_TAB_TYPE_ALL,this.tabSelected=new e.vpe,this.tabIndex=0}ngOnInit(){}ngOnChanges(t){var n,i;(null===(n=null==t?void 0:t.selectedTabType)||void 0===n?void 0:n.currentValue)!==(null===(i=null==t?void 0:t.selectedTabType)||void 0===i?void 0:i.previousValue)&&(this.tabIndex=this.tabsList.findIndex(s=>s.tabType===t.selectedTabType.currentValue))}selectTab(t,n){n!==this.tabIndex&&(this.tabIndex=n,this.selectedTabType=t.tabType,this.tabSelected.emit(t))}onTabKeydown(t,n,i){t.preventDefault(),t.stopPropagation(),this.selectTab(n,i)}setTabToActive(t){let n=this.tabsList.findIndex(i=>i.id===t);-1!==n&&this.selectTab(this.tabsList[n],n)}}return o.\u0275fac=function(t){return new(t||o)}
1,o.\u0275cmp=e.Xpm({type:o,selectors:[["epic-search-content-type-tabs"]],viewQuery:function(t,n){if(1&t&&e.Gf(y,5),2&t){let i;e.iGM(i=e.CRH())&&(n.contentTabs=i.first)}},inputs:{tabsList:"tabsList",selectedTabType:"selectedTabType"},outputs:{tabSelected:"tabSelected"},features:[e.TTD],decls:3,vars:2,consts:[["mat-tab-nav-bar","",1,"epic-nav-bar","search-content-nav-bar",3,"disableRipple"],["contentTabs",""],["mat-tab-link","",3,"active","click","keydown.enter","keydown.space",4,"ngFor","ngForOf"],["mat-tab-link","",3,"active","click","keydown.enter","keydown.space"]],template:function(t,n){1&t&&(e.TgZ(0,"nav",0,1),e.YNc(2,D,2,4,"a",2),e.qZA()),2&t&&(e.Q6J("disableRipple",!0),e.xp6(2),e.Q6J("ngForOf",n.tabsList))},directives:[C.BU,p.sg,C.Nj],styles:["[_nghost-%COMP%]{background:#ffffff;display:block}.search-content-nav-bar[_ngcontent-%COMP%]{max-width:1256px;margin:auto}"]}),o})();var E=l(12477),J=l(50736),ee=l(50253),te=l(71989),B=l(88582),U=l(78494);const ne=["searchFilters"],ie=function(o){return{"hidden-filter":o}};function oe(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"epic-filter-dropdown",3,4),e.NdJ("filterSelected",function(i){return e.CHM(t).$implicit.onFilterChange(i.filter,i.emitEvent,i.changedOption,i.isSelected)})("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onFilterClick(s.filterObject.filterId)}),e.qZA()}if(2&o){const t=c.$implicit,n=c.index,i=e.oxw();e.Q6J("ngClass",e.VKq(4,ie,i.collapsedFilters.isCollapsed&&n>=3))("filter",t.filterObject)("isDisabled",t.isReadingLevelFilter&&i.disableReadingLevelFilter)("showParentLabelWhenChildFilterNotSelected",t.isReadingLevelFilter)}}function se(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"a",5),e.NdJ("click",function(){return e.CHM(t),e.oxw().toggleSeeMoreFilters()})("keydown.enter",function(i){return e.CHM(t),e.oxw().toggleSeeMoreFilters(),i.preventDefault()})("keydown.space",function(i){return e.CHM(t),e.oxw().toggleSeeMoreFilters(),i.preventDefault()}),e._uU(1),e.qZA()}if(2&o){const t=e.oxw();e.uIk("aria-label",t.collapsedFilters.isCollapsed?"See More Filters":"See Fewer Filters"),e.xp6(1),e.hij(" ",t.collapsedFilters.isCollapsed?"See More Filters":"See Fewer Filters","\n")}}let ce=(()=>{class o{constructor(t,n,i,s,r,_){this.bigQueryService=t,this.changeDetectorRef=n,this.collectionsMakerService=i,this.element=s,this.readingLevelService=r,this.searchService=_,this.disableReadingLevelFilter=!1,this.filterChanged=new e.vpe,this.filtersList=[],this.hasAppliedFilters=!1,this.collapsedFilters={shouldShow:!1,isCollapsed:!1},this.filterChangedDebouncer=new ee.x,this.subs=[],this.subs.push(this.readingLevelService.getAccountReadingLevelSystem().subscribe(u=>{u.defaulted&&(this.accountsDefaultRlSystem=u.defaulted)}))}onResize(){this.checkShouldCollapseFilters()}ngOnInit(){this.subs.push(this.searchService.getSearchFilterData().subscribe(t=>{this.createFilters(t)})),this.subs.push(this.filterChangedDebouncer.pipe((0,te.b)(500)).subscribe(()=>this.filterChanged.emit())),this.subs.push(this.collectionsMakerService.openedObservable.subscribe(t=>{setTimeout(()=>{this.checkShouldCollapseFilters()},0)}))}ngAfterViewInit(){this.checkShouldCollapseFilters(),this.changeDetectorRef.detectChanges()}ngOnDestroy(){this.subs.forEach(t=>t.unsubscribe())}createFilters(t){let i,n=["non_fiction","level_type"];t.forEach(s=>{let r=this.createEpicFilter(s);r&&(i={searchFilterData:s,filterObject:r,onFilterChange:(_,u,O,M)=>{let x=_.model,w=_.filterId;Array.isArray(x)||n.includes(w)?this.appliedFilters.setFilterInModel(w,x):this.appliedFilters.setFilterInModel(w,x?[x]:[]),O&&this.bigQueryService.log(M?a.WI:a.Zz,{filter:w,value:O.label}),u&&this.onFilterChange()}},"level_type"===s.model&&(i.isReadingLevelFilter=!0),this.filtersList.push(i))}),this.hasAppliedFilters=this.appliedFilters.hasAppliedFilters()}createEpicFilter(t){let n=this.appliedFilters.getModel()[t.model],i={filterId:t.model,label:t.name,description:t.description,model:Array.isArray(n)&&0===n.length||void 0===n?null:n,options:t.values.map(r=>{var _;let u={label:r.name,key:r.id};return r.model&&(u.subFilter=this.createEpicFilter(r),(null===(_=u.subFilter)||void 0===_?void 0:_.filterId)===this.accountsDefaultRlSystem&&(this.defaultRlSystemFilterOption=u)),u}),labelShowFilterName:t.titleContainsFilterName,closeMenuOnClick:!1,canClear:!!t.resetText,clearFilterText:t.resetText};switch(function s(r){return r&&r.id}(t)&&(i.description=t.name),t.inputType){case E.k.RADIO:return new b.FX(i);case E.k.TOGGLE:return i.onOption={label:t.values[0].activeName,key:t.values[0].id},i.offOption={label:t.values[0].inactiveName,key:null},i.options=[],new b.$n(i);case E.k.CHECKBOX:return new b.lt(i);case E.k.LIST:return new b.Hk(i)}}clearFilters(){var t;const n=this.appliedFilters.getAppliedFiltersDetail();null===(t=this.searchFilterComponentRefs)||void 0===t||t.forEach(i=>
1{i.clearFilter(void 0,!0),i.filter.filterId===d.Y.READING_LEVEL_FILTER_KEY&&this.defaultRlSystemFilterOption&&i.onFilterSelect(this.defaultRlSystemFilterOption)}),this.onFilterChange(),this.bigQueryService.log(a.zP,n)}onFilterChange(){var t;this.emitFilterChange(),this.hasAppliedFilters=null===(t=this.appliedFilters)||void 0===t?void 0:t.hasAppliedFilters()}emitFilterChange(){this.filterChangedDebouncer.next()}toggleSeeMoreFilters(){this.collapsedFilters.isCollapsed=!this.collapsedFilters.isCollapsed}checkShouldCollapseFilters(){var t;if((null===(t=this.element)||void 0===t?void 0:t.nativeElement.offsetWidth)&&this.element.nativeElement.offsetWidth<948)return this.collapsedFilters.shouldShow=!0,void(this.collapsedFilters.isCollapsed=!0);this.collapsedFilters.shouldShow=!1,this.collapsedFilters.isCollapsed=!1}applyQuizFilter(){const t=this.filtersList.find(i=>i.searchFilterData.model===d.Y.QUIZ_FILTER_KEY);if(!t)return;const n=t.filterObject;n.type===E.k.TOGGLE&&n.selectFilterByKey(n.onOption.key),t.onFilterChange(n,!1),this.hasAppliedFilters=this.appliedFilters.hasAppliedFilters()}onFilterClick(t){const n=this.appliedFilters.getAppliedFiltersDetail();let i={filter:t||"",value:n[t||""]||""};t===d.Y.READING_LEVEL_FILTER_KEY&&[...Object.keys(J.a),"grade"].forEach(r=>{if(void 0!==n[r]){const _=r||"",u=n[r||""]||"";i=Object.assign(Object.assign({},i),{sub_filter:_,sub_filter_value:u})}}),this.bigQueryService.log(a.$X,i)}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(k.p),e.Y36(e.sBO),e.Y36(g.f),e.Y36(e.SBq),e.Y36(B.S),e.Y36(d.oD))},o.\u0275cmp=e.Xpm({type:o,selectors:[["epic-search-filters"]],viewQuery:function(t,n){if(1&t&&e.Gf(ne,5),2&t){let i;e.iGM(i=e.CRH())&&(n.searchFilterComponentRefs=i)}},hostBindings:function(t,n){1&t&&e.NdJ("resize",function(s){return n.onResize(s)},!1,e.Jf7)},inputs:{appliedFilters:"appliedFilters",disableReadingLevelFilter:"disableReadingLevelFilter"},outputs:{filterChanged:"filterChanged"},decls:4,vars:3,consts:[[3,"ngClass","filter","isDisabled","showParentLabelWhenChildFilterNotSelected","filterSelected","click",4,"ngFor","ngForOf"],["role","button","tabindex","0","class","epic-body-text--s marginRight-xs accessible-link",3,"click","keydown.enter","keydown.space",4,"ngIf"],["role","button","tabindex","0","aria-label","Clear Filters",1,"epic-body-text--s","accessible-link",3,"hidden","click","keydown.enter","keydown.space"],[3,"ngClass","filter","isDisabled","showParentLabelWhenChildFilterNotSelected","filterSelected","click"],["searchFilters",""],["role","button","tabindex","0",1,"epic-body-text--s","marginRight-xs","accessible-link",3,"click","keydown.enter","keydown.space"]],template:function(t,n){1&t&&(e.YNc(0,oe,2,6,"epic-filter-dropdown",0),e.YNc(1,se,2,2,"a",1),e.TgZ(2,"a",2),e.NdJ("click",function(){return n.clearFilters()})("keydown.enter",function(s){return n.clearFilters(),s.preventDefault()})("keydown.space",function(s){return n.clearFilters(),s.preventDefault()}),e._uU(3,"Clear Filters"),e.qZA()),2&t&&(e.Q6J("ngForOf",n.filtersList),e.xp6(1),e.Q6J("ngIf",n.collapsedFilters.shouldShow),e.xp6(1),e.Q6J("hidden",!n.hasAppliedFilters))},directives:[p.sg,U.c,p.mk,p.O5],styles:["[_nghost-%COMP%]{display:inline-block;width:100%}epic-filter-dropdown[_ngcontent-%COMP%]:not(:last-child){margin-right:8px;padding:4px 0}epic-filter-dropdown[_ngcontent-%COMP%]:not(:last-child).hidden-filter{display:none}.accessible-link[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.accessible-link[_ngcontent-%COMP%]:focus-visible{outline:2px solid currentColor;outline-offset:2px;border-radius:2px}"]}),o})();var V=l(78096),re=l(55617),G=l(16447),K=l(14029),H=l(52098);function le(o,c){if(1&o&&e._UZ(0,"new-epic-book-item",6),2&o){const t=e.oxw();e.Q6J("content",t.book)("shouldLogImpression",!0)}}function ae(o,c){if(1&o&&e._UZ(0,"new-epic-video-item",6),2&o){const t=e.oxw();e.Q6J("content",t.book)("shouldLogImpression",!0)}}function pe(o,c){if(1&o&&(e.TgZ(0,"div",7)(1,"h3",8),e._uU(2),e.qZA(),e.TgZ(3,"label"),e._uU(4),e.qZA()()),2&o){const t=c.$implicit;e.xp6(2),e.hij(" ",t.value," "),e.xp6(2),e.Oqu(t.label)}}let _e=(()=>{class o{constructor(t,n){this.bookService=t,this.searchService=n,this.bookMeta=[]}ngOnInit(){this.bookMeta=this.bookService.getBookStats(this.book,this.rlSystemKey)}onClickAuthor(t){this.searchService.runSearchByUser({term:t},f.I2.AUTHOR)}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(G.Z),e.Y36(d.oD))},o.\u0275cmp=e.Xpm({type:o,selectors:[["epic-search-featured-result"]],inputs:{book:"book",rlSystemKey:"rlSystemKey"},decls:13,vars:6,consts:[[3,"content","shouldLogImpression",4,"ngIf"],[1,"book-info"],[1,"book-title"],[3,"click"],["class","epic-stat",4,"ngFor","ngForOf"],[1,"book-description"],[3,"content","shouldLogImpression"],[1,"epic-stat"],[1,"epic-stat-value"]],template:function(t,n){1&t&&(e.YNc(0,le,1,2,"new-epic-book-item",0),e.YNc(1,ae,1,2,"new-epic-video-item",0),e.TgZ(2,"div",1)(3,"h3",2),e._uU(4),e.qZA(),e.TgZ(5,"div"),e._uU(6," By: "),e.TgZ(7,"a",3),e.NdJ("click",function(){return n.onClickAuthor(n.book.author||"")}),e._uU(8),e.qZA()(),e.TgZ(9,"div"),e.YNc(10,pe,5,2,"div",4),e.qZA(),e.TgZ(11,"div",5),e._uU(12),e.qZA()()),2&t&&(e.Q6J("ngIf",4!==n.book.type),e.xp6(1),e.Q6J("ngIf",4===n.book.type),e.xp6(3),e.Oqu(n.book.title),e.xp6(4),e.Oqu(n.book.author),e.xp6(2),e.Q6J("ngForOf",n.bookMeta),e.xp6(2),e.Oqu(n.book.bookDescription))},directives:[p.O5,K.p,H.y,p.sg],styles:["[_nghost-%COMP%]{display:flex}[_nghost-%COMP%]   .book-info[_ngcontent-%COMP%]{margin-left:24px}[_nghost-%COMP%]   .book-info[_ngcontent-%COMP%]   h3.book-title[_ngcontent-%COMP%]{margin:0}[_nghost-%COMP%]   .book-info[_ngcontent-%COMP%]   .book-description[_ngcontent-%COMP%]{margin-top:20px}"]}),o})();var Q=l(34929),de=l(57478),ue=l(42307),$=l(85437),N=l(1983),j=l(30048),z=l(77198),he=l(70683),W=l(75811),ge=l(15122),me=l(41752),fe=l(8296),Ce=l(84449),ve=l(43445),Te=l(93450),q=l(90441);function be(o,c){1&o&&e._UZ(0,"img",18)}function ye(o,c){if(1&o&&(e.ynx(0),e.TgZ(1,"span",21),e._uU(2),e.qZA(),e.TgZ(3,"span",22),e._uU(4),e.qZA(),e.BQk()),2&o){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(t.label),e.xp6(2),e.Oqu(t.value)}}function xe(o,c){if(1&o&&(e.TgZ(0,"div",19),e.YNc(1,ye,5,2,"ng-container",20),e.qZA()),2&o){const t=c.$implicit;e.xp6(1),e.Q6J("ngIf",!t.showOnHoverOnly)}}function we(o,c){if(1&o&&(e.TgZ(0,"div",19)(1,"span",21),e._uU(2),e.qZA(),e.TgZ(3,"span",22),e._uU(4),e.qZA()()),2&o){const t=c.$implicit;e.xp6(2),e.Oqu(t.label),e.xp6(2),e.Oqu(t.value)}}const Se=function(o,c){return{"epic-book-thumbnail":o,"epic-video-thumbnail":c}},Oe=function(o){return{"hover-version-showing":o}};let ke=(()=>{class o extends $.Q{constructor(t,n,i,s,r,_,u,O,M,x,w){super(u,O,M,i,s,r,_,x,w),this.assignFlowsService=t,this.readingLevelService=n,this.rlSystemKey=J.a.accelerated_level,this.actionsDisabled=!1,this.assignText="Assign",this.icons=T.L,this.contentDetails=[],this.isHovering=!1,this.bookDescription="",this.subs=[],this.subs.push(this.readingLevelService.getAccountReadingLevelSystem().subscribe(Z=>{Z.defaulted&&(this.accountsDefaultRlSystem=Z.defaulted)}))}ngOnInit(){super.ngOnInit(),this.assignText=this.assignFlowsService.getAssignText(),this._checkDisabledActions()}ngOnChanges(t){var n,i,s,r,_;super.ngOnChanges(t),((null===(n=t.content)||void 0===n?void 0:n.firstChange)||(null===(s=null===(i=t.content)||void 0===i?void 0:i.currentValue)||void 0===s?void 0:s.id)&&(null===(_=null===(r=t.content)||void 0===r?void 0:r.previousValue)||void 0===_?void 0:_.id))&&this.setBookInfo()}
1ngOnDestroy(){super.ngOnDestroy(),this.subs.forEach(t=>t.unsubscribe())}toggleHover(t){this.isHovering=t}assignContent(){var t;this.content&&!this.actionsDisabled&&this.assignFlowsService.startAssignFlow({contentId:this.content.id,contentType:this.assignFlowsService.ASSIGNMENT_CONTENT_TYPE.BOOK,title:this.content.title,type:(null===(t=this.content)||void 0===t?void 0:t.type)||-1})}openContent(t,n,i){const s=Object.create(null,{openContent:{get:()=>super.openContent}});return(0,Q.mG)(this,void 0,void 0,function*(){s.openContent.call(this,t,n,i)})}handleKeydown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.openContent({clientX:0,clientY:0}))}handleAssignKeydown(t){("Enter"===t.key||" "===t.key)&&!this.actionsDisabled&&(t.preventDefault(),this.assignContent())}getContentAriaLabel(){if(!this.content)return"";const t=this.content.title||"",n=this.contentDetails.filter(i=>!i.showOnHoverOnly).map(i=>`${i.label}: ${i.value}`).join(", ");return n?`${t}. ${n}. Click to open ${t}.`:`${t}. Click to open ${t}.`}getAssignAriaLabel(){if(!this.content)return"";const t=this.content.title||"";return this.actionsDisabled?`${this.assignText} ${t} (disabled)`:`${this.assignText} ${t}`}setBookInfo(){this.content&&(this.bookDescription=this.content.bookDescription||"",this.contentDetails=this.bookService.getBookStats(this.content,this.rlSystemKey||this.accountsDefaultRlSystem),this.searchResult&&this.contentDetails.push({label:"Quiz",value:this.searchResult.numQuizzes?"Yes":"No",showOnHoverOnly:!0}),this.contentDetails.push({label:"Author",value:this.content.author||"-",showOnHoverOnly:!0}))}_checkDisabledActions(){this.actionsDisabled=this.shouldShowLock||this.actionsDisabled}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(ge.a),e.Y36(B.S),e.Y36(W.y),e.Y36(G.Z),e.Y36(fe.s6),e.Y36(me.DJ),e.Y36(P.Z),e.Y36(Ce.f),e.Y36(ve.W),e.Y36(Te.jn),e.Y36(h.m9))},o.\u0275cmp=e.Xpm({type:o,selectors:[["epic-content-card-item"]],inputs:{searchResult:"searchResult",rlSystemKey:"rlSystemKey",actionsDisabled:"actionsDisabled"},features:[e.qOj,e.TTD],decls:26,vars:29,consts:[[1,"epic-card","epic-content-card-item-container",3,"mouseenter","mouseleave"],["role","button",1,"epic-content-card-item-main",3,"click","keydown.enter","keydown.space","focusin","focusout"],[3,"ngClass"],["class","video-play-icon","src","/assets/app/read/read-controls/play-icon-white.svg","alt","","aria-hidden","true",4,"ngIf"],["type","image/webp",3,"srcset"],[1,"epic-content-image",3,"src","alt","title","load"],["_elementForImpressionLogging",""],[1,"epic-content-card-item-details"],[1,"book-title"],[1,"book-info-wrapper"],["class","book-info-row",4,"ngFor","ngForOf"],[1,"epic-content-card-item-details","hover-version",3,"ngClass"],[1,"book-description"],[1,"epic-content-card-item-actions"],[3,"book","disabled"],["role","button",1,"epic-link","epic-link--icon","action-container","collection-action",3,"click","keydown.enter","keydown.space"],[3,"icon"],[1,"epic-body-text--s"],["src","/assets/app/read/read-controls/play-icon-white.svg","alt","","aria-hidden","true",1,"video-play-icon"],[1,"book-info-row"],[4,"ngIf"],[1,"book-info-label"],[1,"book-info-value"]],template:function(t,n){1&t&&(e.TgZ(0,"div",0),e.NdJ("mouseenter",function(){return n.toggleHover(!0)})("mouseleave",function(){return n.toggleHover(!1)}),e.TgZ(1,"div",1),e.NdJ("click",function(s){return n.openContent(s)})("keydown.enter",function(s){return n.handleKeydown(s)})("keydown.space",function(s){return n.handleKeydown(s)})("focusin",function(){return n.toggleHover(!0)})("focusout",function(){return n.toggleHover(!1)}),e.TgZ(2,"div",2),e.YNc(3,be,1,0,"img",3),e.TgZ(4,"picture"),e._UZ(5,"source",4),e.TgZ(6,"img",5,6),e.NdJ("load",function(){return n.onImageLoad()}),e.qZA()()(),e.TgZ(8,"div",7)(9,"div",8),e._uU(10),e.qZA(),e.TgZ(11,"div",9),e.YNc(12,xe,2,1,"div",10),e.qZA()(),e.TgZ(13,"div",11)(14,"div",8),e._uU(15),e.qZA(),e.TgZ(16,"div",9),e.YNc(17,we,5,2,"div",10),e.TgZ(18,"div",12),e._uU(19),e.qZA()()()(),e.TgZ(20,"div",13),e._UZ(21,"epic-favorite-button",14),e.TgZ(22,"a",15),e.NdJ("click",function(){return n.assignContent()})("keydown.enter",function(s){return n.handleAssignKeydown(s)})("keydown.space",function(s){return n.handleAssignKeydown(s)}),e._UZ(23,"epic-icon",16),e.TgZ(24,"span",17),e._uU(25),e.qZA()()()()),2&t&&(e.xp6(1),e.uIk("tabindex",n.content?0:-1)("aria-label",n.getContentAriaLabel()),e.xp6(1),e.Q6J("ngClass",e.WLB(24,Se,!n.isVideo,n.isVideo)),e.xp6(1),e.Q6J("ngIf",n.isVideo),e.xp6(2),e.Q6J("srcset",n.thumbPaths.webp,e.LSH),e.xp6(1),e.Q6J("src",n.thumbPaths.jpg,e.LSH)("alt",(null==n.content?null:n.content.title)||"Book cover")("title",(null==n.content?null:n.content.title)||"Book cover"),e.uIk("r-id",n.content?n.content.recommendation_uuid4:null),e.xp6(4),e.Oqu(null==n.content?null:n.content.title),e.xp6(2),e.Q6J("ngForOf",n.contentDetails),e.xp6(1),e.Q6J("ngClass",e.VKq(27,Oe,n.isHovering)),e.xp6(2),e.Oqu(null==n.content?null:n.content.title),e.xp6(2),e.Q6J("ngForOf",n.contentDetails),e.xp6(2),e.hij(" ",n.bookDescription," "),e.xp6(2),e.Q6J("book",n.content)("disabled",n.actionsDisabled),e.xp6(1),e.ekj("epic-link--disabled",n.actionsDisabled),e.uIk("tabindex",n.actionsDisabled?-1:0)("aria-label",n.getAssignAriaLabel())("aria-disabled",n.actionsDisabled),e.xp6(1),e.Q6J("icon",n.icons.ASSIGN),e.xp6(2),e.Oqu(n.assignText))},directives:[p.mk,p.O5,p.sg,q.t,V.A],styles:[".epic-content-card-item-container[_ngcontent-%COMP%]{width:100%;max-width:300px;display:flex;flex-direction:column;box-shadow:0 2px 14px #2c3b5633;border-radius:24px}.epic-content-card-item-container[_ngcontent-%COMP%]:hover   .epic-content-card-item-details[_ngcontent-%COMP%]{position:relative}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;padding:12px;overflow:hidden;cursor:pointer;outline:none}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]:focus-visible{outline:3px solid #0a96e6;outline-offset:2px;border-radius:24px;z-index:10}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .details-wrapper[_ngcontent-%COMP%]{position:relative;padding-bottom:12px}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]{text-align:left}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details.hover-version[_ngcontent-%COMP%]{background:#ffffff;opacity:.95;transform:translateY(100%);transition:transform .2s ease-in-out;transition-delay:.15s;position:absolute;bottom:0;left:0px;right:0px;padding:0 12px 12px}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details.hover-version-showing[_ngcontent-%COMP%]{background:#fff;opacity:.95;transform-origin:bottom;transform:translateY(0)}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .book-title[_ngcontent-%COMP%]{color:#0a96e6;margin:4px 0 8px;font-weight:700;height:54px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .book-info-wrapper[_ngcontent-%COMP%]{font-size:14px;line-height:20px}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .book-info-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .book-info-row[_ngcontent-%COMP%]   .book-info-label[_ngcontent-%COMP%]{font-weight:700}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .book-info-row[_ngcontent-%COMP%]   .book-info-value[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:4px}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .book-description[_ngcontent-%COMP%]{max-height:100px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;margin-top:8px}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details.hover-version[_ngcontent-%COMP%]   .detail-section.detail-header[_ngcontent-%COMP%]{height:auto}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details.hover-version-hidden[_ngcontent-%COMP%]{transform:translateY(100%);transition:transform .325s ease-in-out;position:absolute;bottom:0}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details.hover-version-showing[_ngcontent-%COMP%]{position:absolute;bottom:0;background:#fff;opacity:.95;left:0;right:0;transform-origin:bottom;transform:translateY(0)}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details.blank-
1placeholder[_ngcontent-%COMP%]{visibility:hidden}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .detail-section[_ngcontent-%COMP%]:not(:last-child){margin-bottom:8px}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .detail-section.detail-header[_ngcontent-%COMP%]{height:45px}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .detail-section.detail-header[_ngcontent-%COMP%]   .detail-title[_ngcontent-%COMP%]{height:auto;max-height:44px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .detail-section.detail-header[_ngcontent-%COMP%]   .detail-author[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .detail-section.detail-desc[_ngcontent-%COMP%]{height:90px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .detail-section.detail-desc.detail-desc-hover[_ngcontent-%COMP%]{height:auto}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .detail-section.detail-desc-video[_ngcontent-%COMP%]{height:54px;-webkit-line-clamp:3}.epic-content-card-item-container[_ngcontent-%COMP%]   .epic-content-card-item-main[_ngcontent-%COMP%]   .epic-content-card-item-details[_ngcontent-%COMP%]   .detail-value[_ngcontent-%COMP%]{font-weight:700}.epic-content-card-item-container[_ngcontent-%COMP%]     .epic-content-card-item-actions{display:flex;justify-content:space-between;padding:4px 12px}.epic-content-card-item-container[_ngcontent-%COMP%]     .epic-content-card-item-actions epic-icon svg{margin-right:4px}.epic-content-card-item-container[_ngcontent-%COMP%]     .epic-content-card-item-actions .collection-action{outline:none}.epic-content-card-item-container[_ngcontent-%COMP%]     .epic-content-card-item-actions .collection-action:focus-visible{outline:3px solid #0a96e6;outline-offset:2px;border-radius:4px;z-index:10}.epic-content-card-item-container[_ngcontent-%COMP%]     .epic-content-card-item-actions .collection-action:focus:not(:focus-visible){outline:none}.epic-content-card-item-container[_ngcontent-%COMP%]     .epic-content-card-item-actions .collection-action[aria-disabled=true]{cursor:not-allowed;opacity:.6}"]}),o})();const Pe=["searchResultsGrid"],Me=["listContentItems"];function Ie(o,c){if(1&o&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&o){const t=e.oxw();e.xp6(1),e.hij("(",t.resultsGroup.numResultsLabel,")")}}const X=function(o,c){return{index:o,rowIndex:c}};function Re(o,c){if(1&o&&e._UZ(0,"new-epic-originals-collection-item",7),2&o){const t=c.$implicit,n=c.index,i=e.oxw(3);e.Q6J("collection",t.contentData)("searchSection",!0)("shouldLogImpression",!0)("sourceData",e.WLB(4,X,n,i.rowIndex))}}function Fe(o,c){if(1&o&&(e.ynx(0),e.YNc(1,Re,1,7,"new-epic-originals-collection-item",6),e.BQk()),2&o){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.displayedItemsList)("ngForTrackBy",t.trackByFn)}}function Le(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"epic-collection-item",9),e.NdJ("contentOpenComplete",function(i){const s=e.CHM(t),r=s.$implicit,_=s.index;return e.oxw(3).onContentOpenComplete(i,r,_)}),e.qZA()}2&o&&e.Q6J("collection",c.$implicit.contentData)("shouldLogImpression",!0)}function Ee(o,c){if(1&o&&(e.ynx(0),e.YNc(1,Le,1,2,"epic-collection-item",8),e.BQk()),2&o){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.displayedItemsList)("ngForTrackBy",t.trackByFn)}}function Ae(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"new-epic-video-item",11),e.NdJ("contentOpenComplete",function(i){const s=e.CHM(t),r=s.$implicit,_=s.index;return e.oxw(3).onContentOpenComplete(i,r,_)}),e.qZA()}if(2&o){const t=c.$implicit,n=e.oxw(3);e.Q6J("content",t.contentData)("sizeType",n.bookSize)("showBookShareButtons",n.showBookShareButtons)("shouldLogImpression",!0)}}function De(o,c){if(1&o&&(e.ynx(0),e.YNc(1,Ae,1,4,"new-epic-video-item",10),e.BQk()),2&o){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.displayedItemsList)("ngForTrackBy",t.trackByFn)}}function Ze(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"new-epic-book-item",13),e.NdJ("contentOpenComplete",function(i){const s=e.CHM(t),r=s.$implicit,_=s.index;return e.oxw(3).onContentOpenComplete(i,r,_)}),e.qZA()}if(2&o){const t=c.$implicit,n=e.oxw(3);e.Q6J("content",t.contentData)("showBookShareButtons",n.showBookShareButtons)("shouldLogImpression",!0)("enableBookPreview",n.enableBookPreview)}}function Ye(o,c){if(1&o&&(e.ynx(0),e.YNc(1,Ze,1,4,"new-epic-book-item",12),e.BQk()),2&o){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.displayedItemsList)("ngForTrackBy",t.trackByFn)}}function Be(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"epic-content-card-item",15),e.NdJ("contentOpenComplete",function(i){const s=e.CHM(t),r=s.$implicit,_=s.index;return e.oxw(3).onContentOpenComplete(i,r,_)}),e.qZA()}if(2&o){const t=c.$implicit,n=e.oxw(3);e.Q6J("content",t.contentData)("searchResult",t)("rlSystemKey",n.rlSystemKey)("shouldLogImpression",!0)}}function Ge(o,c){if(1&o&&(e.ynx(0),e.YNc(1,Be,1,4,"epic-content-card-item",14),e.BQk()),2&o){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.displayedItemsList)("ngForTrackBy",t.trackByFn)}}const Qe=function(o,c,t){return{"wide-grid":o,"collection-grid":c,"series-grid":t}};function Ne(o,c){if(1&o&&(e.TgZ(0,"div",4,5),e.YNc(2,Fe,2,2,"ng-container",1),e.YNc(3,Ee,2,2,"ng-container",1),e.YNc(4,De,2,2,"ng-container",1),e.YNc(5,Ye,2,2,"ng-container",1),e.YNc(6,Ge,2,2,"ng-container",1),e.qZA()),2&o){const t=e.oxw();e.Q6J("ngClass",e.kEZ(6,Qe,t.resultsGroup.groupType===t.searchGroupTypes.GROUP_TYPE_VIDEO,t.resultsGroup.groupType===t.searchGroupTypes.GROUP_TYPE_PLAYLIST,t.resultsGroup.groupType===t.searchGroupTypes.GROUP_TYPE_SERIES)),e.xp6(2),e.Q6J("ngIf",t.resultsGroup.groupType===t.searchGroupTypes.GROUP_TYPE_SERIES),e.xp6(1),e.Q6J("ngIf",t.resultsGroup.groupType===t.searchGroupTypes.GROUP_TYPE_PLAYLIST),e.xp6(1),e.Q6J("ngIf",t.resultsGroup.groupType===t.searchGroupTypes.GROUP_TYPE_VIDEO&&!t.isShowingContentCardVersion),e.xp6(1),e.Q6J("ngIf",t.resultsGroup.groupType!==t.searchGroupTypes.GROUP_TYPE_VIDEO&&t.resultsGroup.groupType!==t.searchGroupTypes.GROUP_TYPE_PLAYLIST&&t.resultsGroup.groupType!==t.searchGroupTypes.GROUP_TYPE_SERIES&&!t.isShowingContentCardVersion),e.xp6(1),e.Q6J("ngIf",t.resultsGroup.groupType!==t.searchGroupTypes.GROUP_TYPE_PLAYLIST&&t.resultsGroup.groupType!==t.searchGroupTypes.GROUP_TYPE_SERIES&&t.isShowingContentCardVersion)}}function Je(o,c){if(1&o&&(e.ynx(0),e._UZ(1,"new-epic-originals-collection-item",21,22),e.BQk()),2&o){const t=e.oxw(),n=t.$
1implicit,i=t.index,s=e.oxw(2);e.xp6(1),e.Q6J("collection",n.contentData)("searchSection",!0)("shouldLogImpression",!0)("sourceData",e.WLB(5,X,i,s.rowIndex))("viewListType",!0)}}function Ue(o,c){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"epic-collection-item",23,22),e.NdJ("contentOpenComplete",function(i){e.CHM(t);const s=e.oxw(),r=s.$implicit,_=s.index;return e.oxw(2).onContentOpenComplete(i,r,_)}),e.qZA(),e.BQk()}if(2&o){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("collection",t.contentData)}}function Ve(o,c){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"new-epic-video-item",24,22),e.NdJ("contentOpenComplete",function(i){e.CHM(t);const s=e.oxw(),r=s.$implicit,_=s.index;return e.oxw(2).onContentOpenComplete(i,r,_)}),e.qZA(),e.BQk()}if(2&o){const t=e.oxw().$implicit,n=e.oxw(2);e.xp6(1),e.Q6J("content",t.contentData)("sizeType",n.videoSizeList)("shouldLogImpression",!0)}}function Ke(o,c){if(1&o){const t=e.EpF();e.ynx(0),e.TgZ(1,"new-epic-book-item",25,22),e.NdJ("contentOpenComplete",function(i){e.CHM(t);const s=e.oxw(),r=s.$implicit,_=s.index;return e.oxw(2).onContentOpenComplete(i,r,_)}),e.qZA(),e.BQk()}if(2&o){const t=e.oxw().$implicit,n=e.oxw(2);e.xp6(1),e.Q6J("content",t.contentData)("sizeType",n.bookSizeList)("shouldLogImpression",!0)("enableBookPreview",n.enableBookPreview)}}function He(o,c){if(1&o&&(e.TgZ(0,"span",27),e._uU(1),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.hij("",t.label,":")}}function $e(o,c){if(1&o&&(e.TgZ(0,"div"),e.YNc(1,He,2,1,"span",26),e._uU(2),e.qZA()),2&o){const t=c.$implicit;e.xp6(1),e.Q6J("ngIf",t.label),e.xp6(1),e.hij(" ",t.value," ")}}function je(o,c){if(1&o&&e._UZ(0,"epic-favorite-button",31),2&o){const t=e.oxw(2).$implicit;e.Q6J("collection",t.contentData)}}function ze(o,c){if(1&o&&e._UZ(0,"epic-favorite-button",32),2&o){const t=e.oxw(2).$implicit;e.Q6J("book",t.contentData)}}function We(o,c){if(1&o&&(e.ynx(0)(1,28),e.YNc(2,je,1,1,"epic-favorite-button",29),e.YNc(3,ze,1,1,"epic-favorite-button",30),e.BQk()()),2&o){const t=e.oxw(3);e.xp6(1),e.Q6J("ngSwitch",null==t.resultsGroup?null:t.resultsGroup.groupType),e.xp6(1),e.Q6J("ngSwitchCase",t.searchGroupTypes.GROUP_TYPE_PLAYLIST)}}const qe=function(o){return{"margin-top-less":o}},Xe=function(o){return{"margin-top":o}};function et(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"div",17)(1,"div"),e.YNc(2,Je,3,8,"ng-container",1),e.YNc(3,Ue,3,1,"ng-container",1),e.YNc(4,Ve,3,3,"ng-container",1),e.YNc(5,Ke,3,4,"ng-container",1),e.qZA(),e.TgZ(6,"div",18)(7,"h3")(8,"a",19),e.NdJ("click",function(i){const s=e.CHM(t),r=s.$implicit,_=s.index;return e.oxw(2).onClickContentTitle(r,_,i),i.preventDefault()})("keydown.enter",function(i){const s=e.CHM(t),r=s.$implicit,_=s.index;return e.oxw(2).onClickContentTitle(r,_,i),i.preventDefault()})("keydown.space",function(i){const s=e.CHM(t),r=s.$implicit,_=s.index;return e.oxw(2).onClickContentTitle(r,_,i),i.preventDefault()}),e._uU(9),e.qZA()(),e.TgZ(10,"div"),e.YNc(11,$e,3,2,"div",20),e.qZA()(),e.TgZ(12,"div"),e.YNc(13,We,4,2,"ng-container",1),e.qZA()()}if(2&o){const t=c.$implicit,n=c.index,i=e.oxw(2);e.Q6J("ngClass",e.VKq(10,qe,0===n&&i.resultsGroup.groupType===i.searchGroupTypes.GROUP_TYPE_SERIES)),e.xp6(2),e.Q6J("ngIf",i.resultsGroup.groupType===i.searchGroupTypes.GROUP_TYPE_SERIES),e.xp6(1),e.Q6J("ngIf",(null==i.resultsGroup?null:i.resultsGroup.groupType)===i.searchGroupTypes.GROUP_TYPE_PLAYLIST),e.xp6(1),e.Q6J("ngIf",(null==i.resultsGroup?null:i.resultsGroup.groupType)===i.searchGroupTypes.GROUP_TYPE_VIDEO),e.xp6(1),e.Q6J("ngIf",(null==i.resultsGroup?null:i.resultsGroup.groupType)!==i.searchGroupTypes.GROUP_TYPE_VIDEO&&(null==i.resultsGroup?null:i.resultsGroup.groupType)!==i.searchGroupTypes.GROUP_TYPE_PLAYLIST&&(null==i.resultsGroup?null:i.resultsGroup.groupType)!==i.searchGroupTypes.GROUP_TYPE_SERIES),e.xp6(1),e.Q6J("ngClass",e.VKq(12,Xe,i.resultsGroup.groupType===i.searchGroupTypes.GROUP_TYPE_SERIES)),e.xp6(2),e.uIk("aria-label","Open "+t.contentData.title),e.xp6(1),e.Oqu(t.contentData.title),e.xp6(2),e.Q6J("ngForOf",i.bookInfoMap[t.objectId||t.id]),e.xp6(2),e.Q6J("ngIf",i.resultsGroup.groupType!==i.searchGroupTypes.GROUP_TYPE_SERIES)}}function tt(o,c){if(1&o&&(e.ynx(0),e.YNc(1,et,14,14,"div",16),e.BQk()),2&o){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.displayedItemsList)("ngForTrackBy",t.trackByFn)}}function nt(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"div",33)(1,"button",34),e.NdJ("click",function(){return e.CHM(t),e.oxw().onClickShowMore()}),e._uU(2,"Show More"),e.qZA()()}}const it=function(o){return{"series-layout-header":o}};let ot=(()=>{class o{constructor(t,n,i,s,r,_){this.bookService=t,this.bookPreviewService=n,this.experienceService=i,this.profileService=s,this.readingLevelService=r,this.window=_,this.showAllResults=!1,this.showNumResultsLabel=!0,this.viewT
1ype=d.ik.GRID,this.sortBy=d.kV.RELEVANCE,this.showMoreClicked=new e.vpe,this.contentOpened=new e.vpe,this.searchGroupTypes=f.M2,this.searchViewTypes=d.ik,this.isShowingContentCardVersion=!1,this.bookSize=N.t.FLEX,this.displayedItemsList=[],this.isShowingMoreButton=!1,this.showBookShareButtons=!1,this.bookSizeList=N.t.LARGE,this.videoSizeList=N.t.MEDIUM,this.bookInfoMap={},this.enableBookPreview=!1,this.subs=[],this.isShowingContentCardVersion=this.profileService.currentProfile.isParent,this.subs.push(this.readingLevelService.getAccountReadingLevelSystem().subscribe(u=>{u.defaulted&&(this.accountsDefaultRlSystem=u.defaulted)}))}onResize(t){this.setDisplayedContentList()}ngOnInit(){return(0,Q.mG)(this,void 0,void 0,function*(){this.showBookShareButtons=this.experienceService.isFFAFree(),this.subs.push(this.bookPreviewService.shouldShowBookPreview$.subscribe(t=>{this.enableBookPreview=t}))})}ngOnChanges(t){var n,i,s,r,_,u,O,M,x,w;((null===(n=t.resultsGroup)||void 0===n?void 0:n.currentValue)!==(null===(i=t.resultsGroup)||void 0===i?void 0:i.previousValue)||(null===(s=t.showAllResults)||void 0===s?void 0:s.currentValue)!==(null===(r=t.showAllResults)||void 0===r?void 0:r.previousValue))&&this.setDisplayedContentList(),!(null===(_=t.sortBy)||void 0===_?void 0:_.firstChange)&&(null===(u=t.sortBy)||void 0===u?void 0:u.previousValue)!==(null===(O=t.sortBy)||void 0===O?void 0:O.currentValue)&&this.sortDisplayedList(),(null===(M=t.viewType)||void 0===M?void 0:M.currentValue)===d.ik.LIST&&((null===(x=t.viewType)||void 0===x?void 0:x.firstChange)||(null===(w=t.viewType)||void 0===w?void 0:w.previousValue)!==d.ik.LIST)&&this.setBookInfo()}ngOnDestroy(){this.subs.forEach(t=>t.unsubscribe())}onClickShowMore(){this.showMoreClicked.next(this.resultsGroup.groupType)}trackByFn(t){return t.objectId||t.id}onContentOpenComplete(t,n,i){t&&this._emitContentOpened(n,i)}onClickContentTitle(t,n,i){var s;return(0,Q.mG)(this,void 0,void 0,function*(){i instanceof KeyboardEvent&&i.preventDefault();const r=null===(s=this.listContentComponents)||void 0===s?void 0:s.toArray()[n];r&&(r instanceof z.d?r.showOriginalsCollection(i):r instanceof j.d?r.openCollection(i):r instanceof $.Q&&(yield r.openContent(i)),this._emitContentOpened(t,n))})}setDisplayedContentList(){if(this.showAllResults)this.displayedItemsList=this.resultsGroup.searchResultsData,this.isShowingMoreButton=!1;else{let t=12;this.resultsGridElement&&(t=2*this.window.getComputedStyle(this.resultsGridElement.nativeElement).getPropertyValue("grid-template-columns").split(" ").length),this.displayedItemsList=this.resultsGroup.searchResultsData.slice(0,t),this.isShowingMoreButton=this.resultsGroup.getNumResults()>t}this.sortBy!==d.kV.RELEVANCE&&this.sortDisplayedList()}sortDisplayedList(){if(this.showAllResults)switch(this.sortBy){case d.kV.RELEVANCE:this.displayedItemsList.sort((n,i)=>n.relevance>i.relevance?1:-1);break;case d.kV.READING_AGE:this.displayedItemsList.sort((n,i)=>n.readingAge>i.readingAge?1:-1);break;case d.kV.READING_LEVEL:const t=this.rlSystemKey||this.accountsDefaultRlSystem;t&&this.displayedItemsList.sort((n,i)=>n.readingLevels[t]>i.readingLevels[t]?1:-1);break;case d.kV.LENGTH:this.displayedItemsList.sort((n,i)=>n.contentData.getSearchLength()>i.contentData.getSearchLength()?1:-1);break;case d.kV.TITLE:this.displayedItemsList.sort((n,i)=>n.title>i.title?1:-1)}}setBookInfo(){var t;if(this.viewType!==d.ik.LIST)return;let n;null===(t=this.resultsGroup)||void 0===t||t.searchResultsData.forEach(i=>{n=i.contentData,n instanceof he.z?(null==i?void 0:i.id)&&(this.bookInfoMap[i.id]=[{label:"Age Range",value:n.getAgeMinToMax()}],(null==n?void 0:n.numberOfBooks)>0&&this.bookInfoMap[i.id].push({label:"Number of books",value:null==n?void 0:n.numberOfBooks}),n.numberOfVideos>0&&this.bookInfoMap[i.id].push({label:"Number of videos",value:null==n?void 0:n.numberOfVideos})):n instanceof de.f?this.bookInfoMap[i.objectId]=this.bookService.getBookStats(n,this.rlSystemKey||this.accountsDefaultRlSystem):n instanceof ue.FE&&(this.bookInfoMap[i.objectId]=[{label:"By",value:n.ownerName},{label:"Views",value:n.views}]),i.numQuizzes&&this.bookInfoMap[i.objectId].push({value:"Quiz Available"})})}_emitContentOpened(t,n){this.contentOpened.emit({searchResult:t,index:n})}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(G.Z),e.Y36(W.y),e.Y36(I.DT),e.Y36(S.ProfileService),e.Y36(B.S),e.Y36(h.m9))}
1,o.\u0275cmp=e.Xpm({type:o,selectors:[["epic-search-results-section"]],viewQuery:function(t,n){if(1&t&&(e.Gf(Pe,5),e.Gf(Me,5)),2&t){let i;e.iGM(i=e.CRH())&&(n.resultsGridElement=i.first),e.iGM(i=e.CRH())&&(n.listContentComponents=i)}},hostBindings:function(t,n){1&t&&e.NdJ("resize",function(s){return n.onResize(s)},!1,e.Jf7)},inputs:{resultsGroup:"resultsGroup",showAllResults:"showAllResults",showNumResultsLabel:"showNumResultsLabel",viewType:"viewType",sortBy:"sortBy",rlSystemKey:"rlSystemKey",rowIndex:"rowIndex"},outputs:{showMoreClicked:"showMoreClicked",contentOpened:"contentOpened"},features:[e.TTD],decls:6,vars:8,consts:[[3,"ngClass"],[4,"ngIf"],["class","search-results-section-grid",3,"ngClass",4,"ngIf"],["class","show-more-button",4,"ngIf"],[1,"search-results-section-grid",3,"ngClass"],["searchResultsGrid",""],[3,"collection","searchSection","shouldLogImpression","sourceData",4,"ngFor","ngForOf","ngForTrackBy"],[3,"collection","searchSection","shouldLogImpression","sourceData"],[3,"collection","shouldLogImpression","contentOpenComplete",4,"ngFor","ngForOf","ngForTrackBy"],[3,"collection","shouldLogImpression","contentOpenComplete"],[3,"content","sizeType","showBookShareButtons","shouldLogImpression","contentOpenComplete",4,"ngFor","ngForOf","ngForTrackBy"],[3,"content","sizeType","showBookShareButtons","shouldLogImpression","contentOpenComplete"],[3,"content","showBookShareButtons","shouldLogImpression","enableBookPreview","contentOpenComplete",4,"ngFor","ngForOf","ngForTrackBy"],[3,"content","showBookShareButtons","shouldLogImpression","enableBookPreview","contentOpenComplete"],[3,"content","searchResult","rlSystemKey","shouldLogImpression","contentOpenComplete",4,"ngFor","ngForOf","ngForTrackBy"],[3,"content","searchResult","rlSystemKey","shouldLogImpression","contentOpenComplete"],["class","search-results-list-row",3,"ngClass",4,"ngFor","ngForOf","ngForTrackBy"],[1,"search-results-list-row",3,"ngClass"],[1,"result-item-info",3,"ngClass"],["href","#","role","button","tabindex","0",3,"click","keydown.enter","keydown.space"],[4,"ngFor","ngForOf"],[3,"collection","searchSection","shouldLogImpression","sourceData","viewListType"],["listContentItems",""],[3,"collection","contentOpenComplete"],[3,"content","sizeType","shouldLogImpression","contentOpenComplete"],[3,"content","sizeType","shouldLogImpression","enableBookPreview","contentOpenComplete"],["class","result-item-info-label",4,"ngIf"],[1,"result-item-info-label"],[3,"ngSwitch"],[3,"collection",4,"ngSwitchCase"],[3,"book",4,"ngSwitchDefault"],[3,"collection"],[3,"book"],[1,"show-more-button"],[1,"epic-btn",3,"click"]],template:function(t,n){1&t&&(e.TgZ(0,"h3",0),e._uU(1),e.YNc(2,Ie,2,1,"span",1),e.qZA(),e.YNc(3,Ne,7,10,"div",2),e.YNc(4,tt,2,2,"ng-container",1),e.YNc(5,nt,3,0,"div",3)),2&t&&(e.Q6J("ngClass",e.VKq(6,it,n.resultsGroup.groupType===n.searchGroupTypes.GROUP_TYPE_SERIES)),e.xp6(1),e.hij(" ",n.resultsGroup.sectionName," "),e.xp6(1),e.Q6J("ngIf",n.showNumResultsLabel),e.xp6(1),e.Q6J("ngIf",n.viewType===n.searchViewTypes.GRID),e.xp6(1),e.Q6J("ngIf",n.viewType===n.searchViewTypes.LIST),e.xp6(1),e.Q6J("ngIf",n.isShowingMoreButton))},directives:[p.mk,p.O5,p.sg,z.d,j.d,H.y,K.p,ke,p.RF,p.n9,q.t,p.ED],styles:["h3[_ngcontent-%COMP%]{margin:0 0 8px}h3.series-layout-header[_ngcontent-%COMP%]{margin:0 0 -4px}@media (max-width: 1360px){.search-results-section-grid.series-grid[_ngcontent-%COMP%]{width:100%!important}}.search-results-section-grid[_ngcontent-%COMP%]{display:grid;grid-gap:24px;grid-template-columns:repeat(auto-fill,minmax(170px,1fr))}@media screen and (max-width: 960px){.search-results-section-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(165px,1fr))}}@media screen and (max-width: 600px){.search-results-section-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}}.search-results-section-grid.series-grid[_ngcontent-%COMP%]{width:1255px;grid-gap:5px;grid-template-columns:repeat(auto-fill,minmax(305px,1fr))}@media screen and (max-width: 960px){.search-results-section-grid.series-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}}@media screen and (max-width: 600px){.search-results-section-grid.series-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(155px,1fr))}}.search-results-section-grid.wide-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}@media screen and (max-width: 960px){.search-results-section-grid.wide-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}}@media screen and (max-width: 600px){.search-results-section-grid.wide-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(155px,1fr))}}.search-results-section-grid.collection-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}@media screen and (max-width: 960px){.search-results-section-grid.collection-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}}@media screen and (max-width: 600px){.search-results-section-grid.collection-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}}.search-results-list-row[_ngcontent-%COMP%]{display:flex}.search-results-list-row[_ngcontent-%COMP%]:not(:last-child){margin-bottom:40px}.search-results-list-row[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{color:#0a96e6;margin:0}.search-results-list-row[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]{color:inherit;text-decoration:none;display:inline-block;outline:none}.search-results-list-row[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:focus-visible{outline:2px solid #0a96e6;outline-offset:2px;border-radius:2px}.search-results-list-row[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]   a[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}.search-results-list-row[_ngcontent-%COMP%]   .result-item-info[_ngcontent-%COMP%]{margin-left:24px;flex:1}.search-results-list-row[_ngcontent-%COMP%]   .result-item-info.margin-top[_ngcontent-%COMP%]{margin-top:12px}.search-results-list-row[_ngcontent-%COMP%]   .result-item-info[_ngcontent-%COMP%]   .result-item-info-label[_ngcontent-%COMP%]{color:#afbbca}.search-results-list-row[_ngcontent-%COMP%]   epic-collection-item[_ngcontent-%COMP%]{max-width:218px;display:block}.show-more-button[_ngcontent-%COMP%]{text-align:center;margin-top:24px}"]}),o})();var st=l(56);const ct=["searchTabs"],rt=["searchFilters"];function lt(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"epic-search-content-type-tabs",12,13),e.NdJ("tabSelected",function(i){return e.CHM(t),e.oxw().onSelectTab(i)}),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("tabsList",t.searchTabsList)("selectedTabType",t.selectedTabType)}}function at(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"button",14),e.NdJ("click",function(){return e.CHM(t),e.oxw().kgSearch()}),e._uU(1),e.qZA()}if(2&o){const t=e.oxw();e.xp6(1),e.hij(" KG Search ",t.searchService.lastNodeSearch.term," ")}}function pt(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"epic-search-filters",15,16),e.NdJ("filterChanged",function(){return e.CHM(t),e.oxw().onFilterChange()}),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("appliedFilters",t.appliedSearchFilters)("disableReadingLevelFilter",t.selectedTabType===t.tabTypes.SEARCH_TAB_TYPE_VIDEO)}}const _t=function(o){return[o]};function dt(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(){const s=e.CHM(t).$implicit;
1return e.oxw(2).selectView(s.type)})("keydown.enter",function(){const s=e.CHM(t).$implicit;return e.oxw(2).selectView(s.type)})("keydown.space",function(i){const r=e.CHM(t).$implicit;return e.oxw(2).selectView(r.type),i.preventDefault()}),e.TgZ(1,"span",19),e._uU(2),e.qZA(),e._UZ(3,"epic-icon",20),e.qZA()}if(2&o){const t=c.$implicit,n=e.oxw(2);e.uIk("aria-label",t.type===n.searchViewTypes.GRID?"Grid view":"List view")("title",t.type===n.searchViewTypes.GRID?"Grid view":"List view")("aria-pressed",t.type===n.resultsViewType),e.xp6(2),e.Oqu(t.type===n.searchViewTypes.GRID?"Grid view":"List view"),e.xp6(1),e.Q6J("icon",t.icon)("iconClasses",e.VKq(6,_t,t.type!==n.resultsViewType?"epic-icon--light-blue":""))}}function ut(o,c){if(1&o&&(e.ynx(0),e.YNc(1,dt,4,8,"button",17),e.BQk()),2&o){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.viewsList)}}function ht(o,c){1&o&&(e.TgZ(0,"div",21),e._UZ(1,"epic-dot-loader",22),e.qZA())}function gt(o,c){if(1&o&&e._UZ(0,"epic-search-featured-result",23),2&o){const t=e.oxw();e.Q6J("book",t.featuredResult)("rlSystemKey",t.rlSystemKey)}}function mt(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"epic-search-results-section",25),e.NdJ("showMoreClicked",function(i){return e.CHM(t),e.oxw(2).onShowMoreClick(i)})("contentOpened",function(i){e.CHM(t);const s=e.oxw().$implicit;return e.oxw().onContentOpened(i,s)}),e.qZA()}if(2&o){const t=e.oxw(),n=t.$implicit,i=t.index,s=e.oxw();e.Q6J("resultsGroup",n)("showAllResults",!s.showMoreTabTypes.includes(s.selectedTabType))("rlSystemKey",s.rlSystemKey)("viewType",s.resultsViewType)("sortBy",s.curSortType)("rowIndex",i)}}function ft(o,c){if(1&o&&(e.ynx(0),e.YNc(1,mt,1,6,"epic-search-results-section",24),e.BQk()),2&o){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",!t.isLoading)}}function Ct(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"li")(1,"a",31),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).clearFilters()}),e._uU(2,"Clear your search filters."),e.qZA()()}}function vt(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"li",31),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).goToAllTab()}),e.TgZ(1,"a"),e._uU(2,"Search all content types."),e.qZA()()}}function Tt(o,c){1&o&&(e.TgZ(0,"li"),e._uU(1," Explore any of the Popular Searches below. "),e.qZA())}function bt(o,c){1&o&&(e.TgZ(0,"div"),e._UZ(1,"br"),e.TgZ(2,"h3"),e._uU(3,"OR"),e.qZA(),e.TgZ(4,"ul",28)(5,"li"),e._uU(6," Try one of the books below\u2014readers like you enjoyed these! "),e.qZA()()())}function yt(o,c){if(1&o&&e._UZ(0,"epic-search-suggested-terms",32),2&o){const t=e.oxw(2);e.Q6J("termsList",t.searchSplashData.trendingSearchTerms)("title","Popular Searches")("source",t.searchSourcePopular)}}function xt(o,c){if(1&o){const t=e.EpF();e.TgZ(0,"epic-search-results-section",34),e.NdJ("showMoreClicked",function(i){return e.CHM(t),e.oxw(3).onShowMoreClick(i)})("contentOpened",function(i){e.CHM(t);const s=e.oxw().$implicit;return e.oxw(2).onContentOpened(i,s)}),e.qZA()}if(2&o){const t=e.oxw(),n=t.$implicit,i=t.index,s=e.oxw(2);e.Q6J("resultsGroup",n)("showAllResults",!0)("rlSystemKey",s.rlSystemKey)("viewType",s.resultsViewType)("sortBy",s.curSortType)("rowIndex",i)("showNumResultsLabel",!1)}}function wt(o,c){if(1&o&&(e.ynx(0),e.YNc(1,xt,1,7,"epic-search-results-section",33),e.BQk()),2&o){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!t.isLoading)}}function St(o,c){if(1&o&&(e.TgZ(0,"div")(1,"div",26),e._UZ(2,"img",27),e.TgZ(3,"div")(4,"h3"),e._uU(5,"Oh no! We couldn\u2019t find an exact match."),e.qZA(),e.TgZ(6,"div")(7,"ul",28)(8,"li"),e._uU(9,"Double-check your spelling."),e.qZA(),e.TgZ(10,"li"),e._uU(11,"Search by the author or topic."),e.qZA(),e.YNc(12,Ct,3,0,"li",8),e.YNc(13,vt,3,0,"li",29),e.YNc(14,Tt,2,0,"li",8),e.qZA()(),e.YNc(15,bt,7,0,"div",8),e.qZA()(),e.YNc(16,yt,1,3,"epic-search-suggested-terms",30),e.YNc(17,wt,2,1,"ng-container",11),e.qZA()),2&o){const t=e.oxw();e.xp6(12),e.Q6J("ngIf",t.hasAppliedFilters),e.xp6(1),e.Q6J("ngIf",t.selectedTabType!==t.tabTypes.SEARCH_TAB_TYPE_ALL),e.xp6(1),e.Q6J("ngIf",t.showSuggestedTerms),e.xp6(1),e.Q6J("ngIf",t.showFallbackResults),e.xp6(1),e.Q6J("ngIf",t.showSuggestedTerms),e.xp6(1),e.Q6J("ngForOf",t.searchFallbackResults)}}let Ot=(()=>{class o{constructor(t,n,i,s,r,_,u,O,M,x,w,Z){this.bigQueryService=t,this.collectionsMakerService=n,this.experienceService=i,this.impressionsLoggerService=s,this.localStorageService=r,this.profileService=_,this.searchApiService=u,this.searchSuggestionsService=O,this.searchService=M,this.devTools=x,this.document=w,this.window=Z,this.searchTabsList=[],this.searchResults=[],this.searchFallbackResults=[],this.selectedTabType=f.TG.SEARCH_TAB_TYPE_ALL,this.isLoading=!1,this.showSuggestedTerms=!1,this.show
1FallbackResults=!1,this.tabSelected=new e.vpe,this.filtersChanged=new e.vpe,this.contentOpened=new e.vpe,this.tabTypes=f.TG,this.showMoreTabTypes=[f.TG.SEARCH_TAB_TYPE_QUIZ,f.TG.SEARCH_TAB_TYPE_ALL],this.icons=T.L,this.searchViewTypes=d.ik,this.isParent=!1,this.hasAppliedFilters=!1,this.viewsList=[{type:d.ik.GRID,icon:T.L.GRID_VIEW},{type:d.ik.LIST,icon:T.L.LIST_VIEW}],this.curSortType=d.kV.RELEVANCE,this.sortFilter=new b.e5({label:"Sort by",model:this.curSortType,options:[{label:"Relevance",key:d.kV.RELEVANCE},{label:"Reading Level",key:d.kV.READING_LEVEL},{label:"Reading Age",key:d.kV.READING_AGE},{label:"Length",key:d.kV.LENGTH},{label:"Title",key:d.kV.TITLE}],canClear:!1,useTextDropdown:!0}),this.searchSourcePopular=f.I2.POPULAR,this.showDevFeatures=!1,this.appElement=null,this.subs=[],this.kgSearch=()=>this.searchService.testNodeSearch(),this.searchSplashData=this.searchSuggestionsService.searchSplashData,this.setViewType(d.ik.GRID)}ngOnInit(){var t;this.isParent=this.profileService.currentProfile.isParent,this.subs.push(this.appliedSearchFilters.selectedReadingLevelSystem$.subscribe(n=>{this.rlSystemKey=n})),this.subs.push(this.collectionsMakerService.openedObservable.subscribe(n=>{setTimeout(()=>{this.window.dispatchEvent(new Event("resize"))})})),this.appElement=this.document.getElementById("epic-app-content-container"),this.hasAppliedFilters=(null===(t=this.appliedSearchFilters)||void 0===t?void 0:t.hasAppliedFilters())||!1,this.getViewTypeFromLocalStorage(),this.showDevFeatures=this.devTools.localDevMode()}ngOnChanges(t){var n,i,s,r;(null===(n=null==t?void 0:t.searchResults)||void 0===n?void 0:n.previousValue)!==(null===(i=null==t?void 0:t.searchResults)||void 0===i?void 0:i.currentValue)&&(null===(s=this.appElement)||void 0===s||s.scrollTo({top:0}),null===(r=this.searchFiltersComponentRef)||void 0===r||r.checkShouldCollapseFilters())}ngOnDestroy(){this.subs.forEach(t=>t.unsubscribe())}onShowMoreClick(t){var n;let i=this.searchApiService.searchGroupToTabMap[t];(this.selectedTabType===f.TG.SEARCH_TAB_TYPE_QUIZ||i===f.TG.SEARCH_TAB_TYPE_QUIZ)&&(null===(n=this.searchFiltersComponentRef)||void 0===n||n.applyQuizFilter()),this.goToTab(i)}goToAllTab(){this.goToTab(f.TG.SEARCH_TAB_TYPE_ALL)}onSelectTab(t){var n;this.selectedTabType=t.tabType,this.selectedTabType===f.TG.SEARCH_TAB_TYPE_QUIZ&&(null===(n=this.searchFiltersComponentRef)||void 0===n||n.applyQuizFilter()),this.tabSelected.emit(t),this.bigQueryService.log(a.Ow,{type:t.tabType})}onFilterChange(){var t;this.filtersChanged.emit(),this.hasAppliedFilters=(null===(t=this.appliedSearchFilters)||void 0===t?void 0:t.hasAppliedFilters())||!1}clearFilters(){var t;null===(t=this.searchFiltersComponentRef)||void 0===t||t.clearFilters()}selectView(t){this.setViewType(t),this.bigQueryService.log(t===d.ik.LIST?a.Cc:a.Pc),this.impressionsLoggerService.cancelPendingLogsAndResetWatchedItems();var n=this.localStorageService.get(v.ik)||{};n[this.profileService.currentProfile.id]=t,this.localStorageService.set(v.ik,n)}onSortChange(t){this.curSortType=t.model,console.log(this.curSortType),this.bigQueryService.log(a.gK,{sortType:this.curSortType})}onContentOpened(t,n){this.contentOpened.emit({searchResult:t.searchResult,index:t.index,group:n.groupType})}goToTab(t){var n,i;let s=this.searchTabsList.find(r=>r.tabType===t);s&&(null===(n=this.searchTabsComponentRef)||void 0===n||n.setTabToActive(s.id),t===f.TG.SEARCH_TAB_TYPE_QUIZ&&(null===(i=this.searchFiltersComponentRef)||void 0===i||i.applyQuizFilter()))}getViewTypeFromLocalStorage(){let n=(this.localStorageService.get(v.ik)||{})[this.profileService.currentProfile.id];n&&Object.values(d.ik).includes(n)&&(this.setViewType(n),this.resultsViewType=n)}setViewType(t){this.resultsViewType=t,this.impressionsLoggerService.searchResultsViewtype=this.resultsViewType}}return o.\u0275fac=function(t){return new(t||o)(e.Y36(k.p),e.Y36(g.f),e.Y36(I.DT),e.Y36(P.Z),e.Y36(F.n),e.Y36(S.ProfileService),e.Y36(f.uX),e.Y36(m.N),e.Y36(d.oD),e.Y36(A.I),e.Y36(p.K0),e.Y36(h.m9))},o.\u0275cmp=e.Xpm({type:o,selectors:[["epic-search-results"]],viewQuery:function(t,n){if(1&t&&(e.Gf(ct,5),e.Gf(rt,5)),2&t){let i;e.iGM(i=e.CRH())&&(n.searchTabsComponentRef=i.first),e.iGM(i=e.CRH())&&(n.searchFiltersComponentRef=i.first)}},inputs:{searchTabsList:"searchTabsList",searchResults:"searchResults",searchFallbackResults:"searchFallbackResults",selectedTabType:"selectedTabType",appliedSearchFilters:"appliedSearchFilters",featuredResult:"featuredResult",isLoading:"isLoading",resultsViewType:"resultsViewType",showSuggestedTerms:"showSuggestedTerms",showFallbackResults:"showFallbackResults"},outputs:{tabSelected:"tabSelected",filtersChanged:"filtersChanged",contentOpened:"contentOpened"},features:[e.TTD],decls:13,vars:11,consts:[[3,"tabsList","selectedTabType","tabSelected",4,"ngIf"],[1,"search-results-body"],["class","epic-btn epic-btn--s marginTop-s",3,"click",4,"ngIf"],[1,"search-filters-bar"],[3,"appliedFilters","disableReadingLevelFilter","filterChanged",4,"ngIf"],[1,"filters-bar-right-section"],[1,"search-sort-menu",3,"hidden"],[3,"filter","ariaLabel","filterSelected"],[4,"ngIf"],["class","results-loader",4,"ngIf"],[3,"book","rlSystemKey",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"tabsList","selectedTabType","tabSelected"],["searchTabs",""],[1,"epic-btn","epic-btn--s","marginTop-s",3,"click"],[3,"appliedFilters","disableReadingLevelFilter","filterChanged"],["searchFilters",""],["type","button","class","view-toggle-button",3,"click","keydown.enter","keydown.space",4,"ngFor","ngForOf"],["type","button",1,"view-toggle-button",3,"click","keydown.enter","keydown.space"],[1,"sr-only"],[3,"icon","iconClasses"],[1,"results-loader"],["color","#0a96e6"],[3,"book","rlSystemKey"],[3,"resultsGroup","showAllResults","rlSystemKey","viewType","sortBy","rowIndex","showMoreClicked","contentOpened",4,"ngIf"],[3,"resultsGroup","showAllResults","rlSystemKey","viewType","sortBy","rowIndex","showMoreClicked","contentOpened"],[1,"n
1o-results-main"],["src","/assets/app/search/cat-ninja-stuck.png","srcset","/assets/app/search/[email protected] 2x","alt","No search results",1,"no-results-monster"],[1,""],[3,"click",4,"ngIf"],[3,"termsList","title","source",4,"ngIf"],[3,"click"],[3,"termsList","title","source"],[3,"resultsGroup","showAllResults","rlSystemKey","viewType","sortBy","rowIndex","showNumResultsLabel","showMoreClicked","contentOpened",4,"ngIf"],[3,"resultsGroup","showAllResults","rlSystemKey","viewType","sortBy","rowIndex","showNumResultsLabel","showMoreClicked","contentOpened"]],template:function(t,n){1&t&&(e.YNc(0,lt,2,2,"epic-search-content-type-tabs",0),e.TgZ(1,"div",1),e.YNc(2,at,2,1,"button",2),e.TgZ(3,"div",3),e.YNc(4,pt,2,2,"epic-search-filters",4),e.TgZ(5,"div",5)(6,"div",6)(7,"epic-filter-dropdown",7),e.NdJ("filterSelected",function(s){return n.onSortChange(s.filter)}),e.qZA()(),e.YNc(8,ut,2,1,"ng-container",8),e.qZA()(),e.YNc(9,ht,2,0,"div",9),e.YNc(10,gt,1,2,"epic-search-featured-result",10),e.YNc(11,ft,2,1,"ng-container",11),e.YNc(12,St,18,6,"div",8),e.qZA()),2&t&&(e.Q6J("ngIf",(n.searchResults||n.isLoading)&&n.searchTabsList.length),e.xp6(2),e.Q6J("ngIf",n.showDevFeatures),e.xp6(2),e.Q6J("ngIf",null==n.appliedSearchFilters?null:n.appliedSearchFilters.getIsInitialized()),e.xp6(2),e.Q6J("hidden",n.selectedTabType===n.tabTypes.SEARCH_TAB_TYPE_ALL),e.xp6(1),e.Q6J("filter",n.sortFilter)("ariaLabel","Sort search results by "+(n.sortFilter.displayLabel||"Relevance")),e.xp6(1),e.Q6J("ngIf",!n.isParent),e.xp6(1),e.Q6J("ngIf",n.isLoading),e.xp6(1),e.Q6J("ngIf",n.featuredResult),e.xp6(1),e.Q6J("ngForOf",n.searchResults),e.xp6(1),e.Q6J("ngIf",0===(null==n.searchResults?null:n.searchResults.length)&&!n.isLoading))},directives:[p.O5,L,ce,U.c,p.sg,V.A,re.c,_e,ot,st.m],styles:["[_nghost-%COMP%]{display:block}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.search-results-body[_ngcontent-%COMP%]{max-width:1348px;display:block;margin:0 auto;padding:0 56px 40px}.search-filters-bar[_ngcontent-%COMP%]{margin:24px 0;display:flex;justify-content:space-between}.search-filters-bar[_ngcontent-%COMP%]   .filters-bar-right-section[_ngcontent-%COMP%]{display:flex;padding-top:2px}.search-filters-bar[_ngcontent-%COMP%]   .filters-bar-right-section[_ngcontent-%COMP%]   .search-sort-menu[_ngcontent-%COMP%]{margin-right:10px;white-space:nowrap}.search-filters-bar[_ngcontent-%COMP%]   .filters-bar-right-section[_ngcontent-%COMP%]   .view-toggle-button[_ngcontent-%COMP%]{background:none;border:none;padding:0;margin:0;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.search-filters-bar[_ngcontent-%COMP%]   .filters-bar-right-section[_ngcontent-%COMP%]   .view-toggle-button[_ngcontent-%COMP%]:focus{outline:2px solid #0a96e6;outline-offset:2px}.search-filters-bar[_ngcontent-%COMP%]   .filters-bar-right-section[_ngcontent-%COMP%]   .view-toggle-button[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}epic-search-featured-result[_ngcontent-%COMP%]{margin-bottom:40px}epic-search-results-section[_ngcontent-%COMP%]{display:block}epic-search-results-section[_ngcontent-%COMP%]:not(:last-child){padding-bottom:48px}epic-search-content-type-tabs[_ngcontent-%COMP%]{position:sticky;top:0px;z-index:1}.results-loader[_ngcontent-%COMP%]{height:60vh;display:flex;align-items:center;justify-content:center}.no-results-main[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;justify-content:center;margin:48px 0}.no-results-main[_ngcontent-%COMP%]   img.no-results-monster[_ngcontent-%COMP%]{max-width:411px;margin-right:50px;width:100%}.no-results-main[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin:0 0 20px}.no-results-main[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]{margin:0;padding-inline-start:24px}.no-results-main[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{list-style-image:url(/assets/app/search/search-star.svg)}"]}),o})()},56:(Y,R,l)=>{l.d(R,{m:()=>f});var p=l(3184),e=l(53415),T=l(36362);function h(d,v){if(1&d){const a=p.EpF();p.TgZ(0,"button",3),p.NdJ("click",function(){const P=p.CHM(a).$implicit;return p.oxw(2).onSelectTerm(P)})("keydown.enter",function(){const P=p.CHM(a).$implicit;return p.oxw(2).onSelectTerm(P)})("keydown.space",function(I){const F=p.CHM(a).$implicit;return p.oxw(2).onSelectTerm(F),I.preventDefault()}),p._uU(1),p.qZA()}if(2&d){const a=v.$implicit;p.uIk("aria-label","Search for "+a),p.xp6(1),p.hij(" ",a," ")}}function b(d,v){if(1&d&&(p.TgZ(0,"div",1)(1,"h3"),p._uU(2),p.qZA(),p.TgZ(3,"div"),p.YNc(4,h,2,2,"button",2),p.qZA()()),2&d){const a=p.oxw();p.xp6(2),p.Oqu(a.title),p.xp6(2),p.Q6J("ngForOf",a.termsList)}}let f=(()=>{class d{constructor(a){this.searchService=a,this.title="",this.termsList=[]}ngOnInit(){}onSelectTerm(a){this.searchService.runSearchByUser({term:a},this.source)}}return d.\u0275fac=function(a){return new(a||d)(p.Y36(e.oD))},d.\u0275cmp=p.Xpm({type:d,selectors:[["epic-search-suggested-terms"]],inputs:{title:"title",termsList:"termsList",source:"source"},decls:1,vars:1,consts:[["class","search-suggested-terms-container",4,"ngIf"],[1,"search-suggested-terms-container"],["type","button","class","epic-chip","tabindex","0",3,"click","keydown.enter","keydown.space",4,"ngFor","ngForOf"],["type","button","tabindex","0",1,"epic-chip",3,"click","keydown.enter","keydown.space"]],template:function(a,k){1&a&&p.YNc(0,b,5,2,"div",0),2&a&&p.Q6J("ngIf",k.termsList.length>0)},directives:[T.O5,T.sg],styles:["[_nghost-%COMP%]{display:block}.search-suggested-terms-container[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin-top:0;margin-bottom:20px}.search-suggested-terms-container[_ngcontent-%COMP%]   .epic-chip[_ngcontent-%COMP%]{margin-bottom:8px;border:none;background:#e6f5fe;padding:8px 32px;display:inline-block;border-radius:100px;font-weight:400;color:#3c4b62;letter-spacing:.01em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font:18px/28px Roboto,sans-serif;font-size:16px;line-height:24px;font-weight:700;font-family:inherit;-webkit-appearance:none;appearance:none;color:#0a96e6;cursor:pointer;transition:background .1s ease-in-out,color .1s ease-in-out}.search-suggested-terms-container[_ngcontent-%COMP%]   .epic-chip[_ngcontent-%COMP%]:not(:last-child){margin-right:16px}.search-suggested-terms-container[_ngcontent-%COMP%]   .epic-chip[_ngcontent-%COMP%]:hover{background:#abdffc;color:#0b74bb}.search-suggested-terms-container[_ngcontent-%COMP%]   .epic-chip[_ngcontent-%COMP%]:focus-visible{outline:2px solid #0a96e6;outline-offset:2px;border-radius:100px}.search-suggested-terms-container[_ngcontent-%COMP%]   .epic-chip[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}"]}),d})()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.