1"use strict";(self.webpackChunkgw_core_sites_app=self.webpackChunkgw_core_sites_app||[]).push([["src_app_ft-components_marketing_blog-widget_blog-widget_module_ts"],{64100:(D,u,o)=>{o.r(u),o.d(u,{BlogsModule:()=>I});var g=o(54364),h=o(71556),r=o(3138),a=o(79441),S=o(92612),p=o(22663),m=o(68411),t=o(2316),B=o(81134),y=o(70160),T=o.n(y),d=o(98636),b=o(33927),w=o(79902),C=o(97859),M=o(18293),x=o(11355),c=o(53882),v=o(46071),L=o(89122);const f=m.Y.getLogger("BlogWidgetService");let Z=(()=>{class s{constructor(e,i){this.http=e,this.appStateService=i,this.blogState$=new a.xQ,this.populateBlogState$=new a.xQ,this.unsubscribe$=new a.xQ,this.loading$=new a.xQ,this.apiUrl=this.appStateService.latestBlogsApiUrl(),this.environment=this.appStateService.getSearchEnvironment()||this.appStateService.getEnvironment(),this.subscribeToHttpResults(),this.subscribeToBlogState()}subscribeToHttpResults(){this.blogStateOutput$=this.populateBlogState$.pipe((0,d.b)(()=>{this.loading$.next(!0)}),(0,b.U)(e=>{const{options:i}=e;return{...i.config,jsonParams:i.config.jsonParams}}),(0,w.w)(e=>{const i=v.k.startAjaxRequest("brandywine_blogs_homepage");return this.http.post(e.ftSearchUrl,e.jsonParams,e.httpOptions).pipe((0,d.b)(()=>{v.k.endAjaxRequest(i)},n=>{f.error(this.getErrorDetails(n))}),(0,C.X)(1),(0,M.K)(n=>(f.error(this.getErrorDetails(n)),(0,B.of)({error:!0,originalQueryText:e.httpParams.get("query")}))))}),(0,x.B)(),(0,d.b)(()=>{this.loading$.next(!1)}))}subscribeToBlogState(){this.blogStateOutput$.pipe((0,p.R)(this.unsubscribe$),(0,b.U)(e=>e?.results?.response?.hits)).subscribe(e=>{const i={totalLength:e?.hits?.length,showViewMore:e?.hits?.length>3,blogs:e?.hits?.map(n=>n._source)};i?.blogs?.map(n=>{n.publicationDate=T()(n.publicationDate).format("LL"),n.hasImage=""!==n?.image,n.primaryCategoryArray=[n.primaryCategory]}),this.blogState$.next(i)})}getSearchParams(){return{options:{term:"",config:{ftSearchUrl:this.apiUrl,httpParams:new c.LE,jsonParams:{locale:this.getLocaleForBlogs(),env:this.environment,start:"0",number:"10"},httpOptions:{headers:new c.WM({"Content-Type":"application/json"})}},counters:{funds:3},page:0},filters:""}}populate(){this.populateBlogState$.next(this.getSearchParams())}getBlogState$(){return this.blogState$.asObservable()}getErrorDetails(e){return"[brandywine_blog] error while receiving data from backend service after 1 retry: "+JSON.stringify(e.message)+" [error status]: "+e.status+" timestamp: "+new Date}setLocaleForBlogs(e){this.localeForBlogsApi=e}getLocaleForBlogs(){return this.localeForBlogsApi}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}}return s.\u0275fac=function(e){return new(e||s)(t.LFG(c.eN),t.LFG(L.ZQ))},s.\u0275prov=t.Yz7({token:s,factory:s.\u0275fac,providedIn:"root"}),s})();var $=o(55311);function W(s,l){if(1&s&&t.GkF(0,11),2&s){const e=t.oxw();t.Q6J("relative",!1)("brManageContentButton",e.document)}}function F(s,l){if(1&s&&(t.TgZ(0,"div",12),t._UZ(1,"eds-link-item",13),t.qZA()),2&s){const e=t.oxw();
1t.xp6(1),t.Q6J("title",null==e.blogHeaders?null:e.blogHeaders.viewMoreLinkLabel)("hasIcon",!0)("href",null==e.blogHeaders?null:e.blogHeaders.showMoreLinkURL)}}function Q(s,l){if(1&s&&(t.ynx(0),t._UZ(1,"eds-card-article",14),t.BQk()),2&s){const e=l.$implicit;t.xp6(1),t.Q6J("hasImage",null==e?null:e.hasImage)("imgSrc",null==e?null:e.image)("title",null==e?null:e.title)("description",null==e?null:e.summary)("date",null==e?null:e.publicationDate)("isCompact",!1)("target","_blank")("href",null==e?null:e.url)("isBlogWidget",!0)("resizeImagesToEqualLength",!0)}}const j=function(s){return{"has-edit-button":s}},H=function(){return{s:12,m:8,l:8}},O=m.Y.getLogger("BlogWidgetComponent");let A=(()=>{class s extends S.N{constructor(e,i,n){super(),this.blogWidgetService=e,this.cdr=i,this.viewModeService=n,this.unsubscribe$=new a.xQ,this.showViewMore=!1,this.blogHeaders={title:"",preTitle:"",summary:"",showBlogsFrom:"",showMoreLinkURL:"",showViewMoreLink:!1,viewMoreLinkLabel:""},this.isEditMode=this.viewModeService.isEditMode(),this.subscribeToBlogState()}ngOnInit(){const e=this.component?.getParameters();this.blogHeaders=e,this.blogWidgetService.setLocaleForBlogs(this.blogHeaders.showBlogsFrom),this.blogHeaders.preTitle=e?e["pre-title"]:"",this.blogWidgetService.populate(),this.cdr.detectChanges()}subscribeToBlogState(){this.blogWidgetService.getBlogState$().pipe((0,p.R)(this.unsubscribe$)).subscribe(e=>{this.blogsData={...e,blogs:e?.blogs?.slice(0,3)},this.showViewMore=e?.blogs?.length>3&&this.blogHeaders?.showViewMoreLink,this.cdr.detectChanges()},e=>{O.error(`Error in invoking blog widget service: ${e}`)})}ngOnDestroy(){this.unsubscribe$.next()}}return s.\u0275fac=function(e){return new(e||s)(t.Y36(Z),t.Y36(t.sBO),t.Y36($.jO))},s.\u0275cmp=t.Xpm({type:s,selectors:[["ft-blog-widget"]],features:[t.qOj],decls:12,vars:11,consts:[[3,"ngClass"],["parameter","document","root","",3,"relative","brManageContentButton",4,"ngIf"],["edsGrid","",1,"blog-widget"],[1,"container","container--wide"],["edsRow",""],["edsCol","",3,"columnNumbers"],["theme","secondary","edsSpacing","lg",3,"preTitle","subTitle","title"],["edsCol","","class","blog-widget__link",4,"ngIf"],["edsCol",""],["edsSubGrid","layout-2","edsSubGridTabletGap","lg","edsSubGridTablet","layout-1","edsSubGridGap","lg","edsSubGridRowGap","xl"],[4,"ngFor","ngForOf"],["parameter","document","root","",3,"relative","brManageContentButton"],["edsCol","",1,"blog-widget__link"],["edsFlexbox","","justifyContent","flex-end","edsSpacing","lg",3,"title","hasIcon","href"],["edsSpacing","lg",3,"hasImage","imgSrc","altText","title","description","date","isCompact","target","href","isBlogWidget","resizeImagesToEqualLength"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,W,1,2,"ng-container",1),t.TgZ(2,"div",2),t.TgZ(3,"div",3),t.TgZ(4,"div",4),t.TgZ(5,"div",5),t._UZ(6,"eds-section-title",6),t.qZA(),t.YNc(7,F,2,3,"div",7),t.qZA(),t.TgZ(8,"div",4),t.TgZ(9,"div",8),t.TgZ(10,"div",9),t.YNc(11,Q,2,10,"ng-container",10),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.Q6J("ngClass",t.VKq(8,j,i.isEditMode)),t.xp6(1),t.Q6J("ngIf",i.isEditMode),t.xp6(4),t.Q6J("columnNumbers",t.DdM(10,H)),t.xp6(1),t.Q6J("preTitle",null==i.blogHeaders?null:i.blogHeaders.preTitle)("subTitle",null==i.blogHeaders?null:i.blogHeaders.summary)("title",null==i.blogHeaders?null:i.blogHeaders.title),t.xp6(1),t.Q6J("ngIf",i.showViewMore),t.xp6(4),t.Q6J("ngForOf",null==i.blogsData?null:i.blogsData.blogs))},directives:[g.mk,g.O5,r.ljP,r.vZ,r.iKq,r.DgL,r.OPD,r.ESv,g.sg,h.bF,r.zj4,r.Wxy,r.Qu6],styles:[".blog-widget__link[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:flex-end}"]}),s})();var E=o(37668);let I=(()=>{class s{getComponentMapping(){return{"Blog Widget":A}}}return s.\u0275fac=function(e){return new(e||s)},s.\u0275mod=t.oAB({type:s}),s.\u0275inj=t.cJS({imports:[[h.q8,g.ez,r.cv2,r.zE6,r.dTQ,E.m8]]}),s})()}}]); 2//# sourceMappingURL=src_app_ft-components_marketing_blog-widget_blog-widget_module_ts.85e6b9722d7c49bca418.js.map
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.