1import {t as te}from'./chunk-Vll5m3t-.js';import {n as ne}from'./chunk-DK1THeCa.js';import {a}from'./chunk-CSK4BC_A.js';import'./chunk-CFhfWJYO.js';import'./chunk-B02AT_YD.js';import {v as v$1,aT as H,m as mb,ck as lD,b as Rt,w as wt,aD as ci,S as S_,aE as YM,u as N_,aF as JM,j as jM,D as Dt,gy as nt,_ as Qy,dg as it,b7 as i$1,aX as sf,aH as nf,dh as ut,K as Se,di as p,bV as N,X as Z,h1 as X,o as WU,F as Fn,p as aa,h2 as Fe$1,g as Ts,a0 as R_,i as Vu,A as Aw,a1 as O_,h3 as Ge,ej as jn,bx as Ln,J as lS,cs as di,dx as a$1,ba as Mt,e as H_,k as jy,n as zf,Z as Z_,Q as Qf,c as Ny,dZ as x_,bU as BM,d as dy,x as xy,aO as PT,f as $u,h as bM,q as qu,r as rv,U as UM,l as $M,P as Pg,W as Wu,aV as hx,aW as G}from'./main-FGWGGG6G.js';import'./chunk-Dh5r_Bg_.js';import'./chunk-Bta6x7F3.js';import'./chunk-DNPD0STm.js';import {c}from'./chunk-Dp1kZFqk.js';import'./chunk-CQH1DeBi.js';import {k}from'./chunk-DSD_OVQ1.js';import'./chunk-CbqulXGf.js';import'./chunk-BMkUcfyT.js';import'./chunk-Cnbwco__.js';import'./chunk-CgqMv0gi.js';import'./chunk-DqtWNb2V.js';function De(i,n){if(i&1&&(xy(0,"img",3),YM(1,"lowercase"),YM(2,"staticAssetUrl"),bM(3),YM(4,"transloco")),i&2){let t=n;Ny("src",JM(2,5,JM(1,3,"assets/images/external-reviews/v2/"+t+".svg")),Pg)("alt",t),Aw(3),Wu(" ",JM(4,7,"externalReviews.source."+t)," ");}}function Te(i,n){if(i&1&&(xy(0,"rma-star-rating",0)(1,"p",1),Ts(2,"span",2),S_(3,De,5,9),Vu()),i&2){let t,e=n,o=Z_();Ny("overallStars",e.ratings),Aw(),Qy("line-clamp-5",o.lineClamp),Ny("innerHTML",e.review,PT),Aw(2),N_((t=o.source())?3:-1,t);}}var B=(()=>{class i{constructor(){this.dialogData=v$1(Ge,{optional:true}),this.sourceBlocklist=jn(Ln.ExternalReviewSourceAttributionBlacklist,[]),this.reviewInput=WU(),this.review=lS(()=>{let t=this.dialogData?.review,e=this.reviewInput();return t??e}),this.source=lS(()=>{let t=this.review()?.externalReviewSource??"";return (this.sourceBlocklist()??[]).includes(t)?void 0:t}),this.lineClamp=!this.dialogData?.review;}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=mb({type:i,selectors:[["rma-external-review"]],inputs:{reviewInput:[1,"reviewInput"]},features:[jM([Dt("externalReviews")])],decls:1,vars:1,consts:[[3,"overallStars"],[1,"my-3","grow","text-sm","text-steel-80",3,"innerHTML"],[1,"flex","items-center","text-sm","text-steel-70"],["loading","lazy",1,"mr-2","w-6",3,"src","alt"]],template:function(e,o){if(e&1&&S_(0,Te,4,5),e&2){let r;N_((r=o.review())?0:-1,r);}},dependencies:[k,Fe$1,Rt,di,a$1,Mt],encapsulation:2,changeDetection:1});}}return i})();var $e=()=>[],Me=(i,n)=>n.externalReviewId;function be(i,n){if(i&1){let t=H_();Ts(0,"div",1)(1,"rma-external-review",2),jy("click",function(){let o=zf(t).$implicit,r=Z_();return Qf(r.onShowDialog(o))}),Vu()();}if(i&2){let t=n.$implicit;Aw(),Ny("reviewInput",t);}}function Ie(i,n){i&1&&xy(0,"rma-skeleton-block",3);}function Fe(i,n){i&1&&R_(0,Ie,1,0,"rma-skeleton-block",3,x_),i&2&&O_(BM(0,$e).constructor(3));}var Ee=(()=>{class i{constructor(){this.dialog=v$1(X),this.reviews=WU([]),this.profileCode=WU(null),this.name=WU(null),this.loading=WU(false);}onShowDialog(t){this.dialog.open(B,{panelClass:["bg-white","p-6"],maxWidth:"70rem",autoFocus:"first-heading",data:{review:t}});}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275cmp=mb({type:i,selectors:[["rma-profile-external-reviews-list"]],inputs:{reviews:[1,"reviews"],profileCode:[1,"profileCode"],name:[1,"name"],loading:[1,"loading"]},decls:4,vars:1,consts:[[1,"grid","snap-x","snap-mandatory","grid-flow-col","grid-cols-[repeat(auto-fit,_minmax(224px,_224px))]","gap-3.5","overflow-x-scroll","md:grid-flow-row","md:overflow-x-auto"],[1,"flex","w-[224px]","snap-center","flex-col","rounded-lg","border","border-solid","border-steel-20","p-6"],[1,"cursor-pointer",3,"click","reviewInput"],[1,"h-60"]],template:function(e,o){e&1&&(Ts(0,"div",0),R_(1,be,2,1,"div",1,Me),S_(3,Fe,2,1),Vu()),e&2&&(Aw(),O_(o.reviews()),Aw(2),N_(o.loading()?3:-1));},dependencies:[Fn,aa,c,B,Fe$1],encapsulation:2});}}return i})();var Pe=3,L=(()=>{class i extends it{constructor(){super({loading:true,profileType:i$1,profileCode:"",skip:0,take:Pe,total:0,reviews:[]}),this.profileService=v$1(ne),this.profileType$=this.select(e=>e.profileType),this.profileCode$=this.select(e=>e.profileCode),this.loading$=this.select(e=>e.loading),this.error$=this.select(e=>e.error),this.reviews$=this.select(e=>e.reviews),this.skip$=this.select(e=>e.skip),this.take$=this.select(e=>e.take),this.total$=this.select(e=>e.total),this.noResults$=this.select(this.total$,this.loading$,(e,o)=>e===0&&!o),this.request$=this.select({profileCode:this.profileCode$,profileType:this.profileType$,skip:this.skip$,take:this.take$},{debounce:true}),this.vm$=this.select({loading:this.loading$,reviews:this.reviews$,noResults:this.noResults$,skip:this.skip$,take:this.take$,total:this.total$,error:this.error$},{debounce:true}),this.getExternalReviewsEffect=this.effect(e=>e.pipe(sf(()=>this.patchState({loading:true})),nf(o=>this.profileService.getExternalReviews(o).pipe(ut({next:r=>this.setResults(r,o.skip),error:r=>{console.error(r),this.patchState(()=>({error:r?.error?.message??r.message??"internal error",loading:false}));}})))));let t=this.request$.pipe(Se(({profileType:e,profileCode:o,skip:r,take:T})=>({agencyCode:N(e)?o:void 0,agentCodes:p(e)?[o]:void 0,skip:r,take:T})));this.getExternalReviewsEffect(t);}setProfile(t,e){this.patchState({profileType:t,profileCode:e});}setResults(t,e){let{total:o,results:r}=t;if(e>0){this.patchState(T=>({reviews:[...T.reviews,...r],loading:false,error:void 0}));return}this.patchState({reviews:r,skip:e,total:o,loading:false,error:void 0});}showMore(t){this.patchState({skip:t,take:Pe});}static{this.\u0275fac=function(e){return new(e||i)};}static{this.\u0275prov=Z({token:i,factory:i.\u0275fac});}}return i})();var Be=i=>({name:i}),Le=(i,n)=>({name:i,count:n});
1function Ae(i,n){if(i&1){let t=H_();$u(0),Ts(1,"h1",2),bM(2),YM(3,"possessive"),Vu(),Ts(4,"p",3),bM(5),Vu(),Ts(6,"rma-profile-external-reviews-list",4),jy("showMore",function(o){zf(t);let r=Z_(3);return Qf(r.store.showMore(o))}),Vu(),qu();}if(i&2){let t=n.$implicit,e=Z_(2),o=Z_();Aw(2),rv(t("title",UM(10,Be,o.usePronoun?"Our":JM(3,8,o.name)))),Aw(3),rv(t("subtext",$M(12,Le,o.name,e.total))),Aw(),Ny("reviews",e.reviews)("skip",e.skip)("take",e.take)("total",e.total)("queryParamPaging",false)("loading",e.loading);}}function Ne(i,n){i&1&&(Ts(0,"div",0),dy(1,Ae,7,15,"ng-container",1),Vu()),i&2&&(Aw(),Ny("translocoPrefix","profileExtReviews"));}function Ve(i,n){i&1&&S_(0,Ne,2,1,"div",0),i&2&&N_(n.noResults?-1:0);}var ke=class A{constructor(){this.store=v$1(L),this.usePronoun=false,this.isHidden=false,this.store.vm$.pipe(H(this)).subscribe(({noResults:n})=>this.isHidden=n);}ngOnChanges(n){let{profileType:t,profileCode:e}=n;(t||e)&&this.store.setProfile(this.profileType,this.profileCode);}static{this.\u0275fac=function(t){return new(t||A)};}static{this.\u0275cmp=mb({type:A,selectors:[["rma-profile-external-reviews"]],hostVars:2,hostBindings:function(t,e){t&2&&Qy("hidden",e.isHidden);},inputs:{profileType:"profileType",profileCode:"profileCode",name:"name",usePronoun:"usePronoun"},features:[jM([Dt("profileExtReviews"),nt(L)]),lD],decls:2,vars:3,consts:[[1,"mx-6","divider-b","xl:mx-0"],[4,"transloco","translocoPrefix"],[1,"text-2xl","font-bold"],[1,"mb-6!","text-steel-70"],["rmaShowMore","","hostClasses","block mt-3",3,"showMore","reviews","skip","take","total","queryParamPaging","loading"]],template:function(t,e){if(t&1&&(S_(0,Ve,1,1),YM(1,"async")),t&2){let o;N_((o=JM(1,1,e.store.vm$))?0:-1,o);}},dependencies:[Ee,te,Rt,wt,ci,a],encapsulation:2,changeDetection:1});}};ke=hx([G()],ke);export{ke as ProfileExternalReviewsComponent};//# sourceMappingURL=chunk-CzlUwGOs.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.