1"use strict"; 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5b56537b-d059-5e0f-b546-4004afc02da8")}catch(e){}}(); 3(self.webpackChunkadthrive_publisher_dashboard=self.webpackChunkadthrive_publisher_dashboard||[]).push([[966],{15778(lt,X,r){r.d(X,{a:()=>Z,h:()=>N});var g=r(61693),x=r(77392),Y=r(17796),H=r(6663),F=r(21252),Q=r(45682);const N=(T,h)=>/^https?:\/\//i.test(h)?{external:!0,url:h}:h.startsWith("/sites/")?{external:!1,url:h}:{external:!1,url:`/sites/${T}${h.startsWith("/")?h:`/${h}`}`};let Z=(()=>{class T{constructor(v){this.http=v,this.baseUrl="/api/v2",this.actionsChangedSubject=new x.B,this.actionsChanged$=this.actionsChangedSubject.asObservable()}getActions(v,C){if(!v)return(0,Y.of)([]);const M=(new g.Nl).set("state",C);return this.http.get(`${this.baseUrl}/sites/${v}/action-center`,{params:M}).pipe((0,H.T)(K=>K.data))}markRead(v,C,M){return this.postInteraction(v,C,"read",{cycleKey:M})}markClicked(v,C,M){return this.postInteraction(v,C,"click",{cycleKey:M})}dismiss(v,C){return this.postInteraction(v,C,"dismiss").pipe((0,F.M)(()=>this.actionsChangedSubject.next()))}restore(v,C){return this.postInteraction(v,C,"restore").pipe((0,F.M)(()=>this.actionsChangedSubject.next()))}postInteraction(v,C,M,K=null){return this.http.post(`${this.baseUrl}/sites/${v}/action-center/${C}/${M}`,K)}static{this.\u0275fac=function(C){return new(C||T)(Q.KVO(g.Qq))}}static{this.\u0275prov=Q.jDH({token:T,factory:T.\u0275fac,providedIn:"root"})}}return T})()},41194(lt,X,r){r.d(X,{z:()=>g});const g={table:{page:"Earnings",title:"Total AD Earnings Table",body:"Earnings for your site via Verified Ad Networks* and any other ad networks your site may use for the current month to date and the previous five months. We added the columns to help you sort and analyze!",footnote:"*Verified sources include Raptive and AdSense for Content."},overview:{pageviews:{page:"Earnings",title:"Earnings Overview chart",body:"Earnings from Verified Ad Networks* and pageviews for the date range selected in the filter at the top of the page.",footnote:"*Verified sources include Raptive and AdSense for Content."},sessions:{page:"Earnings",title:"Earnings Overview chart",body:"Earnings from Verified Ad Networks* and sessions for the date range selected in the filter at the top of the page.",footnote:"*Verified sources include Raptive and AdSense for Content."}},overviewCommunity:{page:"Earnings",title:"Earnings Overview chart",body:"Ad Earnings for the date range selected in the filter at the top of the page."},earningsCommunity:{page:"Earnings",title:"Earnings",body:"Ad Earnings for the date range selected in the filter at the top of the page."},pageviews:{page:"Earnings",title:"Pageviews",body:"Pageviews for your site for the date range selected in the filter at the top of the page."},sessions:{page:"Earnings",title:"Sessions",body:"Sessions for your site for the date range selected in the filter at the top of the page."},earnings:{page:"Earnings",title:"Earnings",body:"Earnings from Verified Ad Networks* for the date range selected above.",footnote:"*Verified sources include Raptive and AdSense for Content."},rpm:{page:"Earnings",title:"Page RPM",body:"Your earnings from Verified Ad Networks* per 1,000 pageviews for the selected date range. This metric helps you understand the value of a single pageview on your site",footnote:"*Verified sources include Raptive and AdSense for Content."},rps:{page:"Earnings",title:"RPM",body:"Your earnings from Verified Ad Networks* per 1,000 sessions for the selected date range. This metric helps you understand the value of a single visitor who may view multiple pages on your site.",footnote:"*Verified sources include Raptive and AdSense for Content."},byDevice:{pageviews:{page:"Earnings",title:"Earnings By Device",body:"Select a date range to view earnings, Page RPM, and pageviews from desktop, mobile, and tablet devices. Advertisers pay more for desktop traffic than mobile or tablet.",footnote:"*Earnings are calculated from verified sources, which includes Raptive and AdSense for Content. Traffic metrics are gathered from Google Analytics."},sessions:{page:"Earnings",title:"Earnings By Device",body:"Select a date range to view earnings, RPM, and sessions from desktop, mobile, and tablet devices. Advertisers pay more for desktop traffic than mobile or tablet.",footnote:"*Earnings are calculated from verified sources, which includes Raptive and AdSense for Content. Traffic metrics are gathered from Google Analytics."}}
3,byAdUnit:{page:"Earnings",title:"Earnings By Ad Unit",body:"Use this widget to analyze individual ad units*. Think of each device type as a different version of your site -- desktop, mobile, and tablet -- all have their own unique ad layout. Ad units listed below may be defined differently based on the device screen size.",footnote:"*Earnings are calculated from verified sources, which includes Raptive and AdSense for Content; traffic metrics are gathered from Google Analytics.",linkText:"Learn more here.",linkTarget:"_blank",externalUrl:"https://help.raptive.com/hc/en-us/articles/115002312571-Know-Your-Ads-Raptive-Ad-Placements"},video:{title:"Video Earnings",body:"Video player earnings and impressions per pageview. Impressions per pageview gives you directional guidance on how much video runs on your site. Changing ad options can help to increase impressions per pageview which will result in higher earnings."},trends:{page:"Earnings",title:"Revenue/Traffic Overview",body:"RPM and Page RPM for your site for the selected date range. ",footnote:"*Earnings are calculated from verified sources, which includes Raptive and AdSense for Content. Traffic metrics are gathered from Google Analytics."},monetizedRpm:{pageviews:{title:"RPM on Monetized Traffic",page:"Earnings",body:"While the standard RPM/Page RPM calculation includes all traffic, RPM on Monetized Sessions/Pageviews only includes traffic where ads ran. % of Overall Sessions/Pageviews Monetized shows how much of your traffic is earning from ads.",linkText:"Learn more here.",linkTarget:"_blank",externalUrl:"https://help.raptive.com/hc/en-us/articles/39258005469467"},sessions:{title:"RPM on Monetized Traffic",page:"Earnings",body:"While the standard RPM/Page RPM calculation includes all traffic, RPM on Monetized Sessions/Pageviews only includes traffic where ads ran. % of Overall Sessions/Pageviews Monetized shows how much of your traffic is earning from ads.",linkText:"Learn more here.",linkTarget:"_blank",externalUrl:"https://help.raptive.com/hc/en-us/articles/39258005469467"}},earningsSources:{brandPartnership:{title:"",body:"Flat fee revenue from brand partnership opportunities coordinated by the Raptive direct sales team."},adSense:{title:"",body:"AdSense earnings are paid directly by AdSense. This amount is included in your overall reported ad revenue but is not included in your total Raptive payment."},adTest:{title:"",body:"Reimbursement for participation in an ad test."},videoFees:{title:"",body:"Video content fees are deducted from your Raptive earnings."},googleClawback:{title:"",body:"Google clawbacks are deducted from your Raptive earnings."},raptiveAffiliate:{title:"",body:"Your total earnings from Raptive\u2019s affiliate offerings."},affiliateFees:{title:"",body:"Affiliate fees associated with the Commerce Content Program are deducted from your Raptive earnings."},swaySocial:{title:"",body:"Earnings from participating in certain brand partnership opportunities brought to you by the Raptive direct sales team. Sway Social earnings are paid directly by Sway. This amount is not included in your total Raptive payment."},raptiveYouTubeNetwork:{title:"",body:"This amount is not included in your overall reported ad revenue but is included in your total Raptive payment."},raptiveReferralProgram:{title:"",body:"Bonus payments from referring eligible new Raptive creators.",linkText:"Learn more.",linkTarget:"_blank",externalUrl:"https://help.raptive.com/hc/en-us/articles/15078361848347"},raptiveAds:{title:"",body:"Earnings from Raptive display and video ads."}}}},27327(lt,X,r){r.d(X,{p:()=>H,u:()=>Y});var g=r(57799),x=r(63022);function Y(F,Q){return!(Q?.isPortfolioSummary||!F||F.siteType===g.Ie.COMMUNITY||F.service===x.Kw.CAM||F.organization?.serviceLevel===x.Uy.ENTERPRISE)}function H(F,Q,N){return F&&Y(Q,N)}},46966(lt,X,r){r.d(X,{MainModule:()=>Xo});var g=r(37737),x=r(29457),Y=r(44442),H=r(7520),F=r(32116),Q=r(91184),N=r(52165),Z=r(40709),T=r(70831),h=r(21837),v=r(77392),C=r(27639),M=r(10132),K=r(85687),q=r(78374),y=r(48808),G=r(85299),j=r(63961),O=r(65696),$=r(62184),Ot=(r(70464),r(80560)),c=r(57799),p=r(45682),Qt=r(61693);let Gt=(()=>{class i{constructor(e){this.http=e,this.BYCOUNTRY_EXPORT_SIZE=5e4}_getBaseUrlForByCountry(e,n,a){return`/api/v2/sites/${e}/reports/byCountry/${n}/${a}`}formatDate(e){const n=e instanceof Date?h.c9.fromJSDate(e):e;return n?.isValid?n.toISODate():null}getUrl(e,n,a,s=null){const l={},d=this.formatDate(n),b=this.formatDate(a);if(!d||!b)return null;l.sort=s?.sort,l["page[size]"]=s?.paginationInfo?.pageSize||20,l["page[number]"]=s?.paginationInfo?.pageIndex||1;const _=s?.pageviews?"pageviews":"sessions",f=s?.[_];if(f&&"object"==typeof f&&"max"in f&&"min"in f){const{max:R,min:V}=f;R&&(l[`filter[${_}][max]`]=R),V&&(l[`filter[${_}][min]`]=V)}let D=this._getBaseUrlForByCountry(e,d,b);return s?.export&&(l["page[size]"]=this.BYCOUNTRY_EXPORT_SIZE,D+="/export"),`${D}?${Object.keys(l).map(R=>`${R}=${l[R]}`).join("&")}`}getByCountryEarnings(e,n,a,s){const l=this.getUrl(e,n,a,s);return l?this.http.get(l):Ot.w}getExportUrl(e,n,a,s){const l={...s,export:!0};return this.getUrl(e,n,a,l)??""}static{this.\u0275fac=function(n){return new(n||i)(p.KVO(Qt.Qq))}}static{this.\u0275prov=p.jDH({token:i,factory:i.\u0275fac})}}return i})();const pe={table:{page:"by-country/page",title:"Performance by Country",body:"Traffic from different c
3ountries monetizes differently due to advertising campaigns for that region and the value of each visitor to advertisers. ",linkText:"Learn More.",linkTarget:"_blank",externalUrl:"https://raptive.zendesk.com/hc/en-us/articles/20016740721563"},pageviewsFilter:{page:"rpm/source",title:"Pageviews",body:"Set a minimum and/or maximum number of pageviews to view only countries within that range."},sessionsFilter:{page:"rpm/source",title:"Sessions",body:"Set a minimum and/or maximum number of sessions to view only countries within that range."},export:{page:"rpm/source",title:"Performance by Country",body:"Export all data for the date range selected. Exact data may vary slightly among dashboard, exported, and Google Analytics reports."}};var We=r(18856),gt=r(56106),E=r(58468),xt=r(84975),t=r(33499),et=r(70396),B=r(4195),it=r(55175),He=r(92623),he=r(13741),Jt=r(40908),at=r(29279),wt=r(29370),Zt=r(2048),ge=r(99204),Ke=r(69469),Qe=r(3319),Je=r(96510),qt=r(6285),Ze=r(31211),jt=function(i,o,e,n){var l,a=arguments.length,s=a<3?o:null===n?n=Object.getOwnPropertyDescriptor(o,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(i,o,e,n);else for(var d=i.length-1;d>=0;d--)(l=i[d])&&(s=(a<3?l(s):a>3?l(o,e,s):l(o,e))||s);return a>3&&s&&Object.defineProperty(o,e,s),s};const qe=i=>({noData:i});function tn(i,o){if(1&i&&t.nrm(0,"at-download-button",8),2&i){const e=t.XpG();t.Y8G("url",e.downloadUrl)}}function en(i,o){if(1&i&&t.nrm(0,"at-date-range-simple-picker",15),2&i){const e=t.XpG(2);t.Y8G("parentForm",e.dateFormGroup)("startDateBounds",e.dateRange)("endDateBounds",e.dateRange)("error",e.widgetsErroredOut)("hideButton",!0)("gaCategoryLabel",e.gaCategoryLabel)}}function nn(i,o){1&i&&(t.j41(0,"div",16),t.nrm(1,"mat-spinner",23),t.k0s())}function an(i,o){if(1&i){const e=t.RV6();t.j41(0,"at-table",27),t.bIt("sortingUpdate",function(a){p.eBV(e);const s=t.XpG(3);return p.Njj(s.sortingChange(a))}),t.k0s()}if(2&i){const e=t.XpG(3);t.Y8G("colDefs",e.colDefs)("data",e.tableData)("useMobileCards",!1)}}function on(i,o){1&i&&t.EFF(0," There is no data to show. ")}function sn(i,o){1&i&&(t.j41(0,"div",16),t.nrm(1,"mat-spinner",23),t.k0s())}function rn(i,o){if(1&i&&(t.j41(0,"div",25),t.nVh(1,on,1,0)(2,sn,2,0,"div",16),t.k0s()),2&i){const e=t.XpG(3);t.R7$(),t.vxM(e.tableDataLoaded?1:2)}}function ln(i,o){if(1&i){const e=t.RV6();t.j41(0,"at-pagination-widget",28),t.bIt("pagingInfoChange",function(a){p.eBV(e);const s=t.XpG(3);return p.Njj(s.handlePageChange(a))}),t.k0s()}if(2&i){const e=t.XpG(3);t.Y8G("pagingInfo",e.paginationInfo)}}function dn(i,o){if(1&i&&(t.j41(0,"div",22,4),t.nVh(2,an,1,3,"at-table",24)(3,rn,3,1,"div",25),t.nVh(4,ln,1,1,"at-pagination-widget",26),t.k0s()),2&i){const e=t.XpG(2);t.Y8G("ngClass",t.eq3(3,qe,0===e.tableData.length)),t.R7$(2),t.vxM(e.tableDataLoaded&&e.tableData.length>0?2:3),t.R7$(2),t.vxM(e.tableData.length>0?4:-1)}}function cn(i,o){1&i&&(t.j41(0,"mat-card",10)(1,"div",29),t.EFF(2,"There was an error loading your data."),t.k0s()())}function pn(i,o){if(1&i){const e=t.RV6();t.j41(0,"mat-card",11)(1,"mat-card-content",12)(2,"mat-card-title"),t.EFF(3," Filter by "),t.j41(4,"mat-icon",13),t.EFF(5," info "),t.k0s()(),t.j41(6,"div",14),t.nVh(7,en,1,6,"at-date-range-simple-picker",15)(8,nn,2,0,"div",16),t.j41(9,"at-traffic-metric",17),t.bIt("metricChange",function(a){p.eBV(e);const s=t.XpG();return p.Njj(s.onTrafficMetricChange(a))}),t.k0s(),t.nrm(10,"at-pageview-filter",18),t.j41(11,"adl-button",19),t.bIt("click",function(){p.eBV(e);const a=t.XpG();return p.Njj(a.onUpdateClicked())}),t.k0s()()()(),t.j41(12,"div",20),t.nrm(13,"at-tooltip",21),t.k0s(),t.nVh(14,dn,5,5,"div",22)(15,cn,3,0,"mat-card",10)}if(2&i){const e=t.XpG();t.R7$(4),t.Y8G("inline",!0),t.R7$(3),t.vxM(e.dateBoundsLoaded?7:8),t.R7$(3),t.Y8G("formGroup",e.pageviewsGroup)("gaCategoryLabel",e.gaCategoryLabel)("title",e.pageFilterTitle)("tooltip",e.filterTooltips),t.R7$(),t.Y8G("disabled",e.formStartDateLuxon>e.formEndDateLuxon||e.dateFormGroup.pristine&&e.filtersFormGroup.pristine||e.filtersFormGroup.invalid),t.R7$(2),t.Y8G("message",null==e.tooltips?null:e.tooltips.table),t.R7$(),t.vxM(e.tableErroredOut?15:14)}}function hn(i,o){1&i&&(t.j41(0,"mat-card",10)(1,"div",29),t.EFF(2,"There was an error loading your data."),t.k0s()())}function gn(i,o){1&i&&(t.j41(0,"div",16),t.nrm(1,"mat-spinner",23),t.k0s())}function mn(i,o){1&i&&t.EFF(0," There is no data to show. ")}function un(i,o){1&i&&(t.j41(0,"div",16),t.nrm(1,"mat-spinner",23),t.k0s())}function fn(i,o){if(1&i&&(t.j41(0,"div",25),t.nVh(1,mn,1,0)(2,un,2,0,"div",16),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.vxM(e.tableDataLoaded?1:2)}}function bn(i,o){1&i&&(t.j41(0,"mat-card",10)(1,"div",29),t.EFF(2,"There was an error loading your data."),t.k0s()())}function _n(i,o){1&i&&(t.j41(0,"span"),t.EFF(1,"--"),t.k0s())}const me={days:29},Ut=h.c9.now().minus({days:2}),vn=Ut.minus(me);class mt extends We.y{constructor(o,e,n,a,s){super(),this.fb=o,this.rpmService=e,this.byCountryService=n,this.gaService=a,this.route=s,this._destroy$=new v.B,this.loadTableData$=new v.B,this.downloadUrl="",this.gaCategoryLabel="Filter",this.tooltips=pe,this.dateFormGroup=this.fb.group({startDate:[vn,gt.k0.required],endDate:[Ut,gt.k0.required]}),this.filtersFormGroup=this.fb.group({pageviews:this.fb.group({min:[50,[gt.k0.required,gt.k0.min(0)]],max:[null,[gt.k0.min(50)]]})}),this.dateRange={min:h.c9.now().minus({years:20}),max:Ut},this.colDefs=[],this.paginationInfo={pageIndex:1,pageSize:20,length:0},this.sortColumn="sessions",this.sort="sessions",this.sortDirection="desc",this.isMobile=!1,this.tableData=[],this.pageFilterTitle="Sessions",this.filterTooltips=this.tooltips.sessionsFilter,this.apiSortDirect="-",this.tableDataLoaded=!1,this.dateBoundsLoaded=!1,this.tableErroredOut=!1,this.dateBoundsErroredOut=!1}ngOnInit(){(0,C.z)([this.rpmService.getDateBounds(this.siteId),this.newToday$,this.todayOverrideLoaded$]).pipe((0,K.p)(([,,o])=>o),(0,q.s)(1)).subscribe(([o,e])=>{if(o.min&&o.max){this.dateRange={min:this.siteInstallDate?h.c9.max(this.siteInstallDate,h.c9.fromISO(o.min)):h.c9.fromISO(o.min),max:h.c9.min(e||Ut,h.c9.fromISO(o.max))};const n=h.c9.max(this.dateRange.max.minus(me),h.c9.fromISO(o.min)),a=this.dateRange.max,{startDate:s,endDate:l}
3=(0,$.Qr)({queryParams:this.route.snapshot.queryParams,min:this.dateRange.min,max:this.dateRange.max,defaultStartDate:n,defaultEndDate:a}),[d,b]=(0,$.ZM)({queryParams:this.route.snapshot.queryParams,minKey:"metricMin",maxKey:"metricMax",defaultMin:50,defaultMax:null,lowerBound:0}),_=(0,$.up)(this.route.snapshot.queryParams,"trafficMetric",["sessions","pageviews"])??"sessions";this.filters={trafficMetric:_},this.pageFilterTitle="sessions"===_?"Sessions":"Pageviews",this.filterTooltips="sessions"===_?this.tooltips.sessionsFilter:this.tooltips.pageviewsFilter,this.dateFormGroup.reset({startDate:s.toJSDate(),endDate:l.toJSDate()}),this.pageviewsGroup.reset({min:d,max:null!==b&&b<50?null:b}),this.dateBoundsErroredOut=!1,this.loadTableData$.next(void 0)}else this._dateBoundsErrorFlow();this.dateBoundsLoaded||(this.dateBoundsLoaded=!0)},()=>{this._dateBoundsErrorFlow()}),this.loadTableData$.pipe((0,E.Q)(this._destroy$),(0,xt.n)(o=>(this.tableDataLoaded=!1,this.tableErroredOut=!1,o&&(this.paginationInfo.pageIndex=1),this.tableDataRequest$))).subscribe({next:({data:o,meta:e})=>{this.paginationInfo.length=e?.recordCount,this.tableData=o.map(n=>({...n})),this.setColDefs(),this.loadDownloadUrl(),this.tableDataLoaded=!0},error:()=>{this.tableErroredOut=!0,this.tableDataLoaded=!0,this.tableData=[]}})}loadDownloadUrl(){this.downloadUrl=this.hasValidDateRange?this.byCountryService.getExportUrl(this.siteId,this.formStartDateLuxon,this.formEndDateLuxon,{sort:`${this.apiSortDirect}${this.sort}`,[this.filters.trafficMetric]:this.pageviewsGroup.value}):""}setColDefs(){return this.colDefs=[{field:"country",headerName:"Country",mobile:"header",minWidth:240,maxWidth:240,sortingOrder:["desc","asc"],sort:"country"===this.sortColumn?this.sortDirection:null},{field:"sessions"===this.filters.trafficMetric?"sessions":"pageviews",headerName:"sessions"===this.filters.trafficMetric?"Sessions":"Pageviews",mobile:"middle",type:"numberColumn",headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell",maxWidth:140,minWidth:140,sortingOrder:["desc","asc"],sort:"sessions"===this.sortColumn||"pageviews"===this.sortColumn?this.sortDirection:null},{field:"pageviews"===this.filters.trafficMetric?"percentTotalPageviews":"percentTotalSessions",headerName:"pageviews"===this.filters.trafficMetric?"% of Total Pageviews":"% of Total Sessions",mobile:"middle",valueFormatter:o=>o.value.toFixed(2)+"%",headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell",maxWidth:240,minWidth:240,sortingOrder:["desc","asc"],sort:"percentTotalPageviews"===this.sortColumn||"percentTotalSessions"===this.sortColumn?this.sortDirection:null},{field:"earnings",headerName:"Earnings",mobile:"middle",type:"usdColumn",headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell",minWidth:140,maxWidth:140,sortingOrder:["desc","asc"],sort:"earnings"===this.sortColumn?this.sortDirection:null},{field:"sessions"===this.filters.trafficMetric?"rps":"rpm",headerName:"sessions"===this.filters.trafficMetric?"RPM":"Page RPM",mobile:"middle",type:"usdColumn",headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell",maxWidth:140,minWidth:140,sortingOrder:["desc","asc"],sort:"rps"===this.sortColumn||"rpm"===this.sortColumn?this.sortDirection:null},{field:"cpm",headerName:"CPM",mobile:"middle",type:"usdColumn",headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell",minWidth:140,maxWidth:140,sortingOrder:["desc","asc"],sort:"cpm"===this.sortColumn?this.sortDirection:null}]}onTrafficMetricChange(o){this.pageFilterTitle="sessions"===o?"Sessions":"Pageviews",this.filterTooltips="sessions"===o?this.tooltips.sessionsFilter:this.tooltips.pageviewsFilter,super.onTrafficMetricChange(o),this.filtersFormGroup.markAsDirty()}load(){this.loadTableData$.next(void 0)}onUpdateClicked(){if(!this.hasValidDateRange)return this.downloadUrl="",void(this.tableDataLoaded=!0);this.filtersFormGroup.markAsPristine(),this.dateFormGroup.markAsPristine();const o=h.c9.fromJSDate(this.dateFormGroup.controls.startDate.value),e=h.c9.fromJSDate(this.dateFormGroup.controls.endDate.value);this.gaService.sendTracking("trackedEvent","Update Button Click",`start: ${o.toFormat("MM/dd/yyyy")}, end: ${e.toFormat("MM/dd/yyyy")}, traffic metric: ${this.filters.trafficMetric}, min: ${this.filtersFormGroup.controls.pageviews.controls.min.value}, max: ${this.filtersFormGroup.controls.pageviews.controls.max.value}`,"filter"),this.loadTableData$.next(void 0)}_dateBoundsErrorFlow(){this.dateBoundsErroredOut=!0,this.tableDataLoaded=!0}handlePageChange(o){this.paginationInfo=o,this.loadTableData$.next(void 0)}sortingChange({active:o,direction:e}){this.apiSortDirect="desc"===e?"-":"",this.sort="percentTotalSessions"===o?"sessions":"percentTotalPageviews"===o?"pageviews":o,this.sortColumn=o,this.sortDirection=e,this.paginationInfo.pageIndex=this.paginationInfo.pageIndex>1?1:this.paginationInfo.pageIndex,this.loadTableData$.next(!0)}ngOnDestroy(){this._destroy$.next(void 0)}get tableDataRequest$(){return this.hasValidDateRange?this.byCountryService.getByCountryEarnings(this.siteId,this.formStartDateLuxon,this.formEndDateLuxon,{sort:`${this.apiSortDirect}${this.sort}`,paginationInfo:this.paginationInfo,[this.filters.trafficMetric]:this.pageviewsGroup.value}):(this.downloadUrl="",this.tableDataLoaded=!0,Ot.w)}get pageviewsGroup(){return this.filtersFormGroup.get("pageviews")}get formStartDateLuxon(){return h.c9.fromJSDate(this.dateFormGroup.value.startDate)}get formEndDateLuxon(){return h.c9.fromJSDate(this.dateFormGroup.value.endDate)}get hasValidDateRange(){return this.formStartDateLuxon.isValid&&this.formEndDateLuxon.isValid}static{this.\u0275fac=function(e){return new(e||mt)(t.rXU(gt.ok),t.rXU(M.N),t.rXU(Gt),t.rXU(et.p),t.rXU(B.nX))}}static{this.\u0275cmp=t.VBU({type:mt,selectors:[["at-by-country-mobile"]],features:[t.Jv_([Gt,M.N]),t.Vt3],decls:16,vars:3,consts:[["loading",""],["noData",""],["error",""],["blankValue",""],["byCountryTable",""],[1,"title-wrapper"],["data-cy","page-title",1,"page-title","brand"],[1,"display-none-lt-tablet","export-and-tooltip"],["defaultFilename","rpm.xlsx","gaClick","Export Data","gaCategory","Performance By Country",1,"download-button",3,"url"],[3,"message"],["appearance","outlined",1,"date-range-section","error-card"],["appearance","outlined",1,"date-range-section"],["data-cy","filters"],["matTooltipPosition","right","matTooltip","Data prior to July 17, 2021 is currently unavailable.",1,"july-2021-msg-icon",3,"inline"],[1,"filter-row"],[1,"date-range-picker",3,"parentForm","startDateBounds","endD
3ateBounds","error","hideButton","gaCategoryLabel"],["fxLayout","row","fxLayoutAlign","center center",1,"spinner"],["data-cy","traffic-metric",1,"traffic-metric",3,"metricChange"],[3,"formGroup","gaCategoryLabel","title","tooltip"],["data-cy","filter-update-btn","type","button","text","update","emphasis","medium",3,"click","disabled"],[1,"table-tooltip"],["data-cy","table-tooltip",3,"message"],[1,"table-wrapper",3,"ngClass"],["color","accent","diameter","25"],[3,"colDefs","data","useMobileCards"],[1,"no-data"],[3,"pagingInfo"],[3,"sortingUpdate","colDefs","data","useMobileCards"],[3,"pagingInfoChange","pagingInfo"],[1,"error-text"]],template:function(e,n){1&e&&(t.j41(0,"div",5)(1,"h1",6),t.EFF(2,"Performance by Country"),t.k0s(),t.j41(3,"div",7),t.nVh(4,tn,1,1,"at-download-button",8),t.nrm(5,"at-tooltip",9),t.k0s()(),t.nVh(6,pn,16,9)(7,hn,3,0,"mat-card",10),t.DNE(8,gn,2,0,"ng-template",null,0,t.C5r)(10,fn,3,1,"ng-template",null,1,t.C5r)(12,bn,3,0,"ng-template",null,2,t.C5r)(14,_n,2,0,"ng-template",null,3,t.C5r)),2&e&&(t.R7$(4),t.vxM(n.dateBoundsErroredOut||n.tableErroredOut?-1:4),t.R7$(),t.Y8G("message",n.tooltips.export),t.R7$(),t.vxM(n.dateBoundsErroredOut?7:6))},dependencies:[Y.G,it.Qp,g.YU,He.n,he.S,gt.cb,Jt.F,at.RN,at.m2,at.dh,wt.An,Zt.oV,ge.LG,Ke.e,Qe.e,gt.j4,Je.O,qt.b6,Ze.V],styles:["at-by-country-mobile .title-wrapper{display:grid;grid-template-columns:repeat(12,1fr);grid-template-rows:auto;width:100%}at-by-country-mobile .title-wrapper .page-title{grid-column:1/8;grid-row:1/2}at-by-country-mobile .title-wrapper .db-buttons{grid-column:8/10;grid-row:1/2;justify-self:flex-end}at-by-country-mobile .title-wrapper .export-and-tooltip{display:flex;grid-column:10/13;grid-row:1/2;justify-self:flex-end}at-by-country-mobile .date-form{width:100%}at-by-country-mobile .warning{color:var(--warn);font-size:14px;margin-left:16px}at-by-country-mobile .export-and-tooltip{display:flex;align-items:center;grid-column:10/13;grid-row:1/2;justify-self:flex-end}at-by-country-mobile .filter-row{display:flex;flex-wrap:wrap;align-items:baseline;gap:2em}at-by-country-mobile .filter-row>at-date-range-simple-picker{margin-top:0;align-self:flex-start}at-by-country-mobile .filter-row>adl-button{margin-left:auto}@media screen and (max-width:1023px){at-by-country-mobile .filter-row>*{width:100%}}at-by-country-mobile .date-title{color:var(--dark-text-high)}at-by-country-mobile .date-range-section{color:var(--dark-text-high);margin-bottom:16px}at-by-country-mobile .date-range-section .mat-mdc-card-title{margin-bottom:18px;font-size:20px;font-weight:400;line-height:20px;display:flex}at-by-country-mobile .date-range-section .mat-mdc-card-title .july-2021-msg-icon{color:#0009;margin-left:8px}at-by-country-mobile .date-range-section .help-text{font-style:italic;padding-top:1em}at-by-country-mobile .mid-section{margin:1em 0}at-by-country-mobile .table-wrapper{overflow-x:scroll;scroll-behavior:smooth;width:100%;top:0;box-sizing:border-box}at-by-country-mobile .table-wrapper.no-data{display:flex;justify-content:center;align-items:center;padding:16px 0}at-by-country-mobile .spinner{margin:1em;width:100%}at-by-country-mobile .no-data{width:100%;height:100%;text-align:center}at-by-country-mobile .table-tooltip{width:100%;display:flex;justify-content:flex-end}at-by-country-mobile .ag-header-cell,at-by-country-mobile .ag-theme-alpine .ag-ltr .ag-cell{border-right:1px solid var(--edges)}\n"],encapsulation:2})}}jt([(0,G.bL)(y.NR.siteID)],mt.prototype,"siteId",void 0),jt([(0,G.bL)(y.NR.installDate)],mt.prototype,"siteInstallDate",void 0),jt([(0,x.l6)(T.l.gamlogToday)],mt.prototype,"newToday$",void 0),jt([(0,x.l6)(T.l.todayOverrideLoaded)],mt.prototype,"todayOverrideLoaded$",void 0);var kt=r(15067),te=r(13621),Bt=function(i,o,e,n){var l,a=arguments.length,s=a<3?o:null===n?n=Object.getOwnPropertyDescriptor(o,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(i,o,e,n);else for(var d=i.length-1;d>=0;d--)(l=i[d])&&(s=(a<3?l(s):a>3?l(o,e,s):l(o,e))||s);return a>3&&s&&Object.defineProperty(o,e,s),s};const Cn=()=>({type:"fitGridWidth"}),yn=i=>({autoSizeStrategy:i}
3);function xn(i,o){if(1&i&&t.nrm(0,"at-download-button",7),2&i){const e=t.XpG(3);t.Y8G("url",e.downloadUrl)}}function wn(i,o){if(1&i&&(t.j41(0,"div",6),t.nVh(1,xn,1,1,"at-download-button",7),t.nrm(2,"at-tooltip",8),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.vxM(e.tableErroredOut?-1:1),t.R7$(),t.Y8G("message",e.tooltips.export)}}function Sn(i,o){if(1&i&&(t.j41(0,"div",3)(1,"h1",5),t.EFF(2,"Performance by Country"),t.k0s(),t.nVh(3,wn,3,2,"div",6),t.k0s()),2&i){const e=t.XpG();t.R7$(3),t.vxM(e.isHidePerformance?-1:3)}}function Mn(i,o){if(1&i&&t.nrm(0,"adl-table",10),2&i){const e=t.XpG(3);t.Y8G("colDefs",e.adlColDefs)("filters",e.adlFilters)("getData",e.paginatedDataFetcher)("gtmPage",e.gtmPage)("dateRange",e.dateRange)("showDateRange",!0)("gtmSendTogether",!0)("gridOptionsOverrides",t.eq3(9,yn,t.lJ4(8,Cn)))}}function In(i,o){if(1&i&&t.nVh(0,Mn,1,11,"adl-table",10),2&i){const e=t.XpG(2);t.vxM(e.isMobile?-1:0)}}function Tn(i,o){1&i&&(t.j41(0,"div",9),t.nrm(1,"mat-spinner",11),t.k0s())}function Pn(i,o){1&i&&t.nrm(0,"at-by-country-mobile")}function Rn(i,o){if(1&i&&(t.nVh(0,In,1,1)(1,Tn,2,0,"div",9),t.nVh(2,Pn,1,0,"at-by-country-mobile")),2&i){const e=t.XpG();t.vxM(e.loaded?0:1),t.R7$(2),t.vxM(e.isMobile?2:-1)}}function On(i,o){1&i&&(t.j41(0,"div",12),t.EFF(1,"There was an error loading your data."),t.k0s())}function kn(i,o){1&i&&(t.j41(0,"div",12),t.EFF(1," Data from our partners is currently delayed for this report. As soon as the issue is resolved, you will see updated data here. "),t.k0s())}function En(i,o){if(1&i&&(t.j41(0,"mat-card",4),t.nVh(1,On,2,0,"div",12),t.nVh(2,kn,2,0,"div",12),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.vxM(e.isHidePerformance?-1:1),t.R7$(),t.vxM(e.isHidePerformance?2:-1)}}function Dn(i,o){1&i&&(t.j41(0,"div",12),t.EFF(1,"There was an error loading your data."),t.k0s())}function Fn(i,o){1&i&&(t.j41(0,"div",12),t.EFF(1," Data from our partners is currently delayed for this report. As soon as the issue is resolved, you will see updated data here. "),t.k0s())}function An(i,o){if(1&i&&(t.j41(0,"mat-card",4),t.nVh(1,Dn,2,0,"div",12),t.nVh(2,Fn,2,0,"div",12),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.vxM(e.isHidePerformance?-1:1),t.R7$(),t.vxM(e.isHidePerformance?2:-1)}}function Nn(i,o){1&i&&(t.j41(0,"div",9),t.nrm(1,"mat-spinner",11),t.k0s())}const fe={days:29},Vt=h.c9.now().minus({days:2}),$n=Vt.minus(fe),be=[{field:"country",headerName:"Country",minWidth:200,flex:1,sortable:!0},{field:"sessions",headerName:"Sessions",type:"number",flex:1,minWidth:120,sortable:!0,sort:"desc"},{field:"percentTotalSessions",headerName:"% of Total Sessions",type:"percentage",cellRendererParams:{pipeValue:"1.2-2",normalize:!0},flex:1,minWidth:100,sortable:!0},{field:"earnings",headerName:"Earnings",type:"usd",minWidth:125,flex:1,sortable:!0},{field:"rps",headerName:"RPM",type:"usd",flex:1,minWidth:100,sortable:!0},{field:"cpm",headerName:"CPM",type:"usd",flex:1,minWidth:100}],_e=[{label:"Sessions",type:"range",name:"sessions",defaultValue:[50,null],rangeMin:0,gtm:{gtmEvent:"dashboardTrackedEvent",gtmCategory:"Sessions updated",gtmLabel:"Sessions Min/Max event"}},{label:"Traffic Metric",name:"trafficMetric",type:"select",defaultValue:"sessions",options:[{label:"Sessions",value:"sessions"},{label:"Pageviews",value:"pageviews"}]}];class ut{constructor(o,e,n,a,s){this.rpmService=o,this.byCountryService=e,this.breakpointObserver=n,this.featureFlagService=a,this.route=s,this._destroy$=new v.B,this._trafficMetricSnapshot="sessions",this.loaded=!1,this.tableErroredOut=!1,this.isMobile=!1,this.downloadUrl="",this.gaCategoryLabel="Filter",this.tooltips=pe,this.dateRange={min:h.c9.now().minus({years:20}),max:Vt,startDate:$n,endDate:Vt},this.filterTooltips=this.tooltips.sessionsFilter,this.adlFilters=_e,this.adlColDefs=be,this.gtmPage="By Country",this.paginatedDataFetcher=(l,d,b)=>{const _=l.request.sortModel[0]?"desc"===l.request.sortModel[0].sort?"-":"":"-";let f=l.request.sortModel[0]?l.request.sortModel[0].colId:"pageviews";f.endsWith(".value")&&(f=f.slice(0,-6)),"percentTotalSessions"===f&&(f="sessions"),"percentTotalPageviews"===f&&(f="pageviews");const D=`${_}${f}`;if(!d.startDate?.isValid||!d.endDate?.isValid)return this.downloadUrl="",Promise.resolve({success:!0,intermediary:!0});const L={[d.trafficMetric]:{min:d["sessions-min"],max:d["sessions-max"]}};return this.downloadUrl=this.byCountryService.getExportUrl(this.siteId,d.startDate,d.endDate,{sort:D,...L}),this._trafficMetricSnapshot!==d.trafficMetric&&(this._trafficMetricSnapshot=d.trafficMetric,this.filterTooltips=this._trafficMetricSnapshot===O.G.SESSIONS?this.tooltips.sessionsFilter:this.tooltips.pageviewsFilter,this.setColDefs(d.trafficMetric),this.setFilters(d.trafficMetric)),this.byCountryService.getByCountryEarnings(this.siteId,d.startDate,d.endDate,{sort:D,paginationInfo:{pageIndex:b.index,pageSize:b.size},...L}).toPromise().then(R=>{if(!R)return{success:!1,rowData:[]};const{data:V,meta:z}=R;return{success:!0,rowData:V,total:z.recordCount,lastRow:V.length===z.page.size?V[V.length-1]:void 0}},()=>({success:!1,rowData:[]}))},this.isHidePerformance=!1}ngOnInit(){this.breakpointObserver.observe("(max-width: 500px)").subscribe(o=>{this.isMobile=!!o.matches}),this.isHidePerformanceEnabled$=this.featureFlagService.featureFlagIsEnabled(j.eO),(0,C.z)([this.rpmService.getDateBounds(this.siteId),this.newToday$,this.todayOverrideLoaded$,this.isHidePerformanceEnabled$]).pipe((0,K.p)(([,,o])=>o),(0,q.s)(1)).subscribe(([o,e,,n])=>{if(o.min&&o.max){const a=h.c9.min(e||Vt,h.c9.fromISO(o.max)),s=h.c9.max(a.minus(fe),h.c9.fromISO(o.min));this.dateRange={min:this.siteInstallDate?h.c9.max(this.siteInstallDate,h.c9.fromISO(o.min)):h.c9.fromISO(o.min),max:a,startDate:s,endDate:a},this.applyUrlHydration(),this.tableErroredOut=!1}else this._dateBoundsErrorFlow();this.isHidePerformance=n,this.loaded=!0},()=>{this._dateBoundsErrorFlow()})}
3applyUrlHydration(){const o=this.route.snapshot.queryParams,e=(0,$.up)(o,"trafficMetric",[O.G.SESSIONS,O.G.PAGEVIEWS])??O.G.SESSIONS,{startDate:n,endDate:a}=(0,$.Qr)({queryParams:o,min:this.dateRange.min,max:this.dateRange.max,defaultStartDate:this.dateRange.startDate,defaultEndDate:this.dateRange.endDate});this.dateRange={...this.dateRange,startDate:n,endDate:a};const[s,l]=(0,$.ZM)({queryParams:o,minKey:"metricMin",maxKey:"metricMax",defaultMin:50,defaultMax:null,lowerBound:0});this._trafficMetricSnapshot=e,this.setFilters(e),this.setColDefs(e),this.filterTooltips=e===O.G.SESSIONS?this.tooltips.sessionsFilter:this.tooltips.pageviewsFilter,this.adlFilters=this.adlFilters.map(d=>"sessions"===d.name?{...d,defaultValue:[s,l]}:"trafficMetric"===d.name?{...d,defaultValue:e}:d)}setColDefs(o){this.adlColDefs=be.map(e=>{switch(e.field){case"sessions":case"pageviews":return{...e,headerName:o===O.G.SESSIONS?"Sessions":"Pageviews",field:o};case"percentTotalSessions":case"percentTotalPageviews":return{...e,headerName:o===O.G.SESSIONS?"% of Total Sessions":"% of Total Pageviews",field:o===O.G.SESSIONS?"percentTotalSessions":"percentTotalPageviews"};case"rps":case"rpm":return{...e,headerName:o===O.G.SESSIONS?"RPM":"Page RPM",field:o===O.G.SESSIONS?"rps":"rpm"};default:return e}})}setFilters(o){this.adlFilters=_e.map(e=>["pageviews","sessions"].includes(e.name)?{...e,label:o===O.G.SESSIONS?"Sessions":"Pageviews",value:o===O.G.SESSIONS?"sessions":"pageviews",gtm:{gtmEvent:"dashboardTrackedEvent",gtmCategory:"Sessions updated",gtmLabel:"Sessions Min/Max event"}}:e)}_dateBoundsErrorFlow(){this.tableErroredOut=!0}ngOnDestroy(){this._destroy$.next(void 0)}static{this.\u0275fac=function(e){return new(e||ut)(t.rXU(M.N),t.rXU(Gt),t.rXU(kt.Q),t.rXU(et.y9),t.rXU(B.nX))}}static{this.\u0275cmp=t.VBU({type:ut,selectors:[["at-by-country"]],features:[t.Jv_([Gt,M.N])],decls:9,vars:3,consts:[["error",""],["loading",""],[3,"gamlog"],[1,"title-wrapper"],["appearance","outlined",1,"date-range-section","error-card"],["data-cy","page-title",1,"page-title","brand"],[1,"display-none-lt-tablet","export-and-tooltip"],["defaultFilename","rpm.xlsx","gaClick","Export Data","gaCategory","Performance By Country",1,"download-button",3,"url"],[3,"message"],["fxLayout","row","fxLayoutAlign","center center",1,"spinner"],["itemName","countries",3,"colDefs","filters","getData","gtmPage","dateRange","showDateRange","gtmSendTogether","gridOptionsOverrides"],["color","accent","diameter","25"],[1,"error-text"]],template:function(e,n){1&e&&(t.nrm(0,"at-alert")(1,"at-alert",2),t.nVh(2,Sn,4,1,"div",3),t.nVh(3,Rn,3,2)(4,En,3,2,"mat-card",4),t.DNE(5,An,3,2,"ng-template",null,0,t.C5r)(7,Nn,2,0,"ng-template",null,1,t.C5r)),2&e&&(t.R7$(),t.Y8G("gamlog",!0),t.R7$(),t.vxM(n.isMobile?-1:2),t.R7$(),t.vxM(n.tableErroredOut||n.isHidePerformance?4:3))},dependencies:[Y.G,it.Or,te.C,he.S,Jt.F,at.RN,ge.LG,qt.b6,mt],styles:['.export-and-tooltip{display:flex}at-by-country adl-table-filter .date-filters{align-items:flex-start}at-by-country adl-table-filter .date-filters .mat-mdc-form-field{position:relative}at-by-country adl-table-filter .date-filters .mat-mdc-form-field.mat-form-field-invalid:after{content:"Please enter a valid date.";position:absolute;left:0;top:calc(100% - 6px);color:var(--warn-text);font-size:12px;line-height:16px;pointer-events:none;white-space:nowrap}\n'],encapsulation:2})}}Bt([(0,G.bL)(y.NR.siteID)],ut.prototype,"siteId",void 0),Bt([(0,G.bL)(y.NR.installDate)],ut.prototype,"siteInstallDate",void 0),Bt([(0,x.l6)(T.l.gamlogToday)],ut.prototype,"newToday$",void 0),Bt([(0,x.l6)(T.l.todayOverrideLoaded)],ut.prototype,"todayOverrideLoaded$",void 0);var u=r(55326),w=r(47154),ve=r(26875),Yt=r(70424),J=r(41194),Gn=r(28139);const ee=i=>({"display-none-phone":i});function jn(i,o){if(1&i&&(t.j41(0,"span"),t.EFF(1),t.nI1(2,"date"),t.k0s()),2&i){const e=t.XpG().$implicit;t.R7$(),t.JRh(t.i5U(2,1,e.date,"MMM y"))}}function Ln(i,o){1&i&&(t.j41(0,"span"),t.EFF(1,"Month to Date"),t.k0s())}function Un(i,o){if(1&i&&(t.j41(0,"th",2),t.nVh(1,jn,3,4,"span"),t.nVh(2,Ln,2,0,"span"),t.k0s()),2&i){const n=o.$index,a=o.$count;t.Y8G("ngClass",t.eq3(3,ee,o.$implicit.hideOnMobile)),t.R7$(),t.vxM(n!==a-1?1:-1),t.R7$(),t.vxM(n===a-1?2:-1)}}function Bn(i,o){if(1&i&&t.nrm(0,"at-tooltip",3),2&i){const e=t.XpG().$implicit,n=t.XpG();t.Y8G("message",n.tooltips[e])}}function Vn(i,o){if(1&i&&(t.j41(0,"td",2)(1,"div",4),t.EFF(2),t.nI1(3,"currency"),t.k0s()()),2&i){const e=o.$implicit,n=t.XpG().$implicit,a=t.XpG();t.Y8G("ngClass",t.eq3(7,ee,e.hideOnMobile)),t.R7$(2),t.SpI(" ",t.ii3(3,2,a.byAdNetwork.adNetworks[n][e.key],"USD","symbol-narrow","1.2-2")," ")}}function Yn(i,o){if(1&i&&(t.j41(0,"tr")(1,"td")(2,"div"),t.EFF(3),t.nVh(4,Bn,1,1,"at-tooltip",3),t.k0s()(),t.Z7z(5,Vn,4,9,"td",2,t.fX1),t.k0s()),2&i){const e=o.$implicit,n=t.XpG();t.R7$(3),t.SpI(" ",e," "),t.R7$(),t.vxM(n.tooltips[e]?4:-1),t.R7$(),t.Dyx(n.months)}}function zn(i,o){if(1&i&&(t.j41(0,"td",2)(1,"div",4),t.EFF(2),t.nI1(3,"currency"),t.k0s()()),2&i){const e=o.$implicit,n=t.XpG();t.Y8G("ngClass",t.eq3(7,ee,e.hideOnMobile)),t.R7$(2),t.SpI(" ",t.ii3(3,2,n.byAdNetwork.total[e.key],"USD","symbol-narrow","1.2-2")," ")}}let Xn=(()=>{class i{constructor(e,n){this.route=e,this.earningsService=n,this.tooltips={"Raptive Ads":J.z.earningsSources.raptiveAds,"Brand Partnership":J.z.earningsSources.brandPartnership,"Google Clawback":J.z.earningsSources.googleClawback},this.months=[],this.adNetworks=[],this.byAdNetwork={},this._destroy$=new v.B}ngOnInit(){this.route.paramMap.subscribe(e=>{const n=e.get("siteId");n&&this._load(n)})}ngOnDestroy(){this._destroy$.next(void 0)}_load(e){this.earningsService.getAdNetworkSources(e).pipe((0,E.Q)(this._destroy$)).subscribe(n=>{if(n?.length&&(this.byAdNetwork=this._getByAdNetwork(n),this.byAdNetwork.firstMonth)){this.months=this._getMonths(this.byAdNetwork.firstMonth);const a=this.months[this.months.length-1].key,s=this.months.filter(l=>!l.hideOnMobile);this.adNetworks=(0,ve.sortBy)(Object.keys(this.byAdNetwork.adNetworks||{}).filter(l=>s.some(d=>this.byAdNetwork.adNetworks?.[l]?.[d.key])),l=>this.byAdNetwork.adNetworks?.[l]?.[a]||-1).reverse()}})}_getByAdNetwork(e){return e.reduce((n,a)=>{const s=h.c9.local(a.year,a.month),l=s.toFormat("LLLyyyy");return(!n.firstMonth||s<n.firstMonth)&&(n.firstMonth=s),n.total&&(n.total[l]=n.total[l]||0,n.total[l]+=a.earnings),n.adNet
3works&&(n.adNetworks[a.adNetwork]=n.adNetworks[a.adNetwork]||{},n.adNetworks[a.adNetwork][l]=a.earnings),n},{total:{},adNetworks:{},firstMonth:void 0})}_getMonths(e){const n=[],a=h.c9.now().diff(e,"months").as("months");for(let s=0;s<=a;s++){const l=e.plus({month:s});n.push({key:l.toFormat("LLLyyyy"),date:l,hideOnMobile:s<=a-3})}return n}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(B.nX),t.rXU(Yt.d))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["at-all-ad-earnings-mobile"]],standalone:!1,features:[t.Jv_([Yt.d])],decls:17,vars:0,consts:[["appearance","outlined","class.gt-xs","gt-xs"],[1,"table"],[3,"ngClass"],[3,"message"],[1,"right-justified-earnings"]],template:function(n,a){1&n&&(t.j41(0,"mat-card",0)(1,"table",1)(2,"thead")(3,"tr")(4,"th"),t.EFF(5,"Source"),t.k0s(),t.Z7z(6,Un,3,5,"th",2,t.fX1),t.k0s()(),t.j41(8,"tbody"),t.Z7z(9,Yn,7,2,"tr",null,t.fX1),t.k0s(),t.j41(11,"tfoot")(12,"tr")(13,"td"),t.EFF(14,"Total"),t.k0s(),t.Z7z(15,zn,4,9,"td",2,t.fX1),t.k0s()()()()),2&n&&(t.R7$(6),t.Dyx(a.months),t.R7$(3),t.Dyx(a.adNetworks),t.R7$(6),t.Dyx(a.months))},dependencies:[g.YU,at.RN,qt.b6,Gn.PW,g.oe,g.vh],styles:["at-tooltip[_ngcontent-%COMP%]{white-space:initial}@media(max-width:599px){at-tooltip[_ngcontent-%COMP%] .tooltip-wrapper .tooltip{bottom:45px!important}}@media(min-width:600px){at-tooltip[_ngcontent-%COMP%] .tooltip-wrapper .tooltip p span{font-weight:400}}.link[_ngcontent-%COMP%]{text-decoration:none}.link[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{font-size:70%}.mat-mdc-card[_ngcontent-%COMP%]{min-height:270px}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child, table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child{padding-left:9px!important;text-align:left!important}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding-bottom:8px;padding-top:8px;vertical-align:middle}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;align-items:center;text-wrap:wrap!important}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] div[_ngcontent-%COMP%] at-tooltip{position:relative;right:0;top:0}@media(max-width:1023px){table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] div[_ngcontent-%COMP%] at-tooltip{display:none}}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{white-space:nowrap}table[_ngcontent-%COMP%] tfoot[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border-top:3px solid var(--edges)}.right-justified-earnings[_ngcontent-%COMP%]{justify-content:flex-end}"]})}}return i})();function Wn(i,o){1&i&&(t.j41(0,"adl-card")(1,"div",2),t.EFF(2," Unable to load earnings sources. Please refresh and try again. "),t.k0s()())}function Hn(i,o){1&i&&(t.j41(0,"adl-card")(1,"div",3),t.EFF(2," No earnings sources are available for this site yet. "),t.k0s()())}function Kn(i,o){if(1&i&&t.nrm(0,"adl-table",4),2&i){const e=t.XpG(2);t.Y8G("colDefs",e.adlColDefs)("data",e.formattedTableData.data)("gridOptionsOverrides",e.formattedTableData.gridOptions)}}function Qn(i,o){if(1&i&&(t.j41(0,"adl-card"),t.nVh(1,Kn,1,3,"adl-table",4),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.vxM(e.formattedTableData.loading?-1:1)}}function Jn(i,o){1&i&&t.nrm(0,"at-all-ad-earnings-mobile")}let Zn=(()=>{class i{constructor(e,n,a){this.route=e,this.earningsService=n,this.breakpointObserver=a,this.MONTH_TO_DATE_HEADER="Month to Date",this.MONTH_TO_DATE_FIELD="monthToDate",this.adlColDefs=[{field:"adNetwork",headerName:"Source",minWidth:250,flex:2,maxWidth:250,sortable:!1,adlCustom:{tooltipField:"tooltipSource"}},{field:"month1",headerName:"Month 1",type:"usd",minWidth:105,flex:1,aggFunc:"sum"},{field:"month2",headerName:"Month 2",type:"usd",minWidth:105,flex:1,aggFunc:"sum"},{field:"month3",headerName:"Month 3",type:"usd",minWidth:105,flex:1,aggFunc:"sum"},{field:"month4",headerName:"Month 4",type:"usd",minWidth:105,flex:1,aggFunc:"sum"},{field:"month5",headerName:"Month 5",type:"usd",minWidth:105,flex:1,aggFunc:"sum"},{field:"monthToDate",headerName:"Month to Date",type:"usd",minWidth:105,flex:1,aggFunc:"sum"}],this.adNetworksMap={"Raptive Ads":"Raptive Ads",Guarantee:"Guarantee","Ad Test":"Ad Test","Video Fees":"Video Content Fees","Google Clawback":"Google Clawback",Adsense:"AdSense",Affiliate:"Raptive Affiliate","Affiliate Fees":"Affiliate Fees","Brand Partnership":"Brand Partnership","Sway Social":"Sway Social","YouTube MCN":"Raptive YouTube Network",Referral:"Raptive Referral Program","Misc Non-taxable":"Misc Payment (Non-taxable)","Misc Taxable":"Misc Payment (Taxable)"},this.adNetworkSortOrder=["Raptive Ads","Guarantee","Ad Test","Video Content Fees","Google Clawback","AdSense","Raptive Affiliate","Affiliate Fees","Brand Partnership","Sway Social","Raptive YouTube Network","Raptive Referral Program","Misc Payment (Non-taxable)","Misc Payment (Taxable)"],this.tooltips={"Raptive Ads":J.z.earningsSources.raptiveAds,"Brand Partnership":J.z.earningsSources.brandPartnership,AdSense:J.z.earningsSources.adSense,"Ad Test":J.z.earningsSources.adTest,"Video Content Fees":J.z.earningsSources.videoFees,"Google Clawback":J.z.earningsSources.googleClawback,"Raptive Affiliate":J.z.earningsSources.raptiveAffiliate,"Affiliate Fees":J.z.earningsSources.affiliateFees,"Sway Social":J.z.earningsSources.swaySocial,"Raptive YouTube Network":J.z.earningsSources.raptiveYouTubeNetwork,"Raptive Referral Program":J.z.earningsSources.raptiveReferralProgram},this.months=[],this.adNetworks=[],this.byAdNetwork={},this.isLoaded=!1,this.loadError=!1,this.hasNoData=!1,this.formattedTableData={data:[],gridOptions:{grandTotalRow:"bottom"},gridOptionsOverrides:{grandTotalRow:"bottom"},colDefs:this.adlColDefs,loading:!0,error:null,autoRowHeight:!0},this._destroy$=new v.B,this.sortOrderMap=this.adNetworkSortOrder.reduce((s,l,d)=>(s[l]=d,s),{})}ngOnInit(){this.route.paramMap.subscribe(e=>{const n=e.get("siteId");n&&this._load(n)}),this.breakpointObserver.observe("(max-width: 500px)").subscribe(e=>{this.isMobile=!!e.matches})}ngOnDestroy(){this._destroy$.next(void 0)}sortStringsBySortOrder(e){return(0,ve.sortBy)(e,a=>{const s=this.sortOrderMap[a];return void 0!==s?s:1/0}).map(a=>a)}_load(e){this.isLoaded=!1,this.loadError=!1,this.hasNoData=!1,this.formattedTableData.loading=!0,this.formattedTableData.data=[],this.earningsService.getAdNetworkSources(e).pipe((0,E.Q)(this._destroy$)).subscribe({next:n=>{this.isLoaded=!0,this.formattedTableData.loading=!1,n?.length?(this.byAdNetwork=this._getByAdNetwork(n),this.byAdNetwork.firstMonth&&(this.months=this._getMonths(this.byAdNetwork.firstMonth),this.setHeaderNames(this.months),this.adNetworks=this.sortStringsBySortOrder(Object.keys(this.byAdNetwork.adNetworks||{}).filter(a=>this.months.some(s=>this.byAdNetwork.adNetworks?.[a]?.[s.key]))).map(a=>({key:a})),this.formattedTableData.data=this.formatTableData(this.months,this.adNetworks))):this.hasNoData=!0},error:()=>{this.loadError=!0,this.formattedTableData.loading=!1}})}_getByAdNetwork(e){return e.reduce((n,a)=>{const s=h.c9.local(a.year,a.month),l=s.toFormat("LLLyyyy");return(!n.firstMonth||s<n.firstMonth)&&(n.firstMonth=s),n.total&&(n.total[l]=n.total[l]||0,n.total[l]+=a.earnings),a.adNetwork=this.adNetworksMap[a.adNetwork]||a.adNetwork,n.adNet
3works&&(n.adNetworks[a.adNetwork]=n.adNetworks[a.adNetwork]||{},n.adNetworks[a.adNetwork][l]=a.earnings),n},{total:{},adNetworks:{},firstMonth:void 0})}_getMonths(e){const n=[],a=h.c9.now().diff(e,"months").as("months");for(let s=0;s<=a;s++){const l=e.plus({month:s});n.push({key:l.toFormat("LLLyyyy"),date:l,hideOnMobile:s<=a-3})}return n}formatTableData(e,n){const a=this.sortDate(e),s=[];return n.forEach(l=>{const d=this.byAdNetwork.adNetworks?.[l.key];let b={};b={...this.getSortedMonthlyEarning(a,d)},s.push({adNetwork:l.key,...b,tooltipSource:this.tooltips[l.key]?.body||""})}),s}sortDate(e){return e.sort((n,a)=>n.date.toMillis()-a.date.toMillis())}setHeaderNames(e){const n=this.sortDate(e);this.adlColDefs.forEach((s,l)=>{s.field?.includes("month")&&(s.field?.includes(this.MONTH_TO_DATE_FIELD)||(s.headerName=n[l-1]?.date?.toFormat("LLL yyyy")||s.headerName),s.field=n[l-1]?.key||s.field)});let a=[];e.length<6&&(a=this.adlColDefs.filter(s=>!s.field?.includes("month")),a[a.length-1].headerName=this.MONTH_TO_DATE_HEADER,this.adlColDefs=a)}getSortedMonthlyEarning(e,n){let a={};return e.forEach(s=>{void 0!==n?.[s.key]&&(a={...a,[s.key]:n[s.key]})}),a}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(B.nX),t.rXU(Yt.d),t.rXU(kt.Q))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["at-all-ad-earnings"]],standalone:!1,features:[t.Jv_([Yt.d])],decls:9,vars:1,consts:[["data-cy","earnings-sources-page-title",1,"brand"],[1,"data-to-finalize"],["data-cy","earnings-sources-error","role","alert",1,"earnings-state","earnings-state--error"],["data-cy","earnings-sources-empty",1,"earnings-state"],[3,"colDefs","data","gridOptionsOverrides"]
3],template:function(n,a){1&n&&(t.nrm(0,"at-alert"),t.j41(1,"h1",0),t.EFF(2,"Earnings Sources"),t.k0s(),t.nVh(3,Wn,3,0,"adl-card")(4,Hn,3,0,"adl-card")(5,Qn,2,1,"adl-card")(6,Jn,1,0,"at-all-ad-earnings-mobile"),t.j41(7,"div",1),t.EFF(8," Displayed earnings are estimates based upon what your ad networks are reporting and everything is subject to change as they finalize their data. These numbers are typically updated nightly and are dependent upon reporting from each ad network. In particular, some numbers may not be updated for the current month, as some ad network earnings are not reported until after the month ends.\n"),t.k0s()),2&n&&(t.R7$(3),t.vxM(a.loadError?3:a.hasNoData?4:a.isMobile?6:5))},dependencies:[it.Or,it.ib,te.C,Xn],styles:["at-tooltip[_ngcontent-%COMP%]{white-space:initial}@media(max-width:599px){at-tooltip[_ngcontent-%COMP%] .tooltip-wrapper .tooltip{bottom:45px!important}}@media(min-width:600px){at-tooltip[_ngcontent-%COMP%] .tooltip-wrapper .tooltip p span{font-weight:400}}.link[_ngcontent-%COMP%]{text-decoration:none}.link[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{font-size:70%}.mat-mdc-card[_ngcontent-%COMP%]{min-height:270px}.earnings-state[_ngcontent-%COMP%]{align-items:center;color:#747378;display:flex;justify-content:center;min-height:270px;text-align:center}.earnings-state--error[_ngcontent-%COMP%]{color:#b00020}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child, table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child{padding-left:9px!important;text-align:left!important}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding-bottom:8px;padding-top:8px;vertical-align:middle}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;align-items:center;text-wrap:wrap!important}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] div[_ngcontent-%COMP%] at-tooltip{position:relative;right:0;top:0}@media(max-width:1023px){table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] div[_ngcontent-%COMP%] at-tooltip{display:none}}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{white-space:nowrap}table[_ngcontent-%COMP%] tfoot[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border-top:3px solid var(--edges)}.right-justified-earnings[_ngcontent-%COMP%]{justify-content:flex-end}"]})}}return i})();var qn=r(74150),ti=r(20288);function ni(i,o){1&i&&t.nrm(0,"mat-progress-bar")}function ii(i,o){if(1&i&&t.nrm(0,"iframe",2),2&i){const e=t.XpG(2);t.Y8G("src",e.src,t.f$h)}}function ai(i,o){if(1&i&&(t.nVh(0,ni,1,0,"mat-progress-bar"),t.nVh(1,ii,1,1,"iframe",2)),2&i){const e=t.XpG();t.vxM(e.src?-1:0),t.R7$(),t.vxM(e.src&&!e.showErrorMessage?1:-1)}}function oi(i,o){1&i&&(t.j41(0,"div",1),t.EFF(1,"This page is temporarily unavailable."),t.k0s())}class Et{constructor(o,e,n){this.siteService=o,this.domSanitizer=e,this.featureFlagService=n,this.SITE_EMBED_MAP={"5ad7479721520f50ab7da88e":c.kb.SITE_SECTION_HEAVY,"667d7fdf94c09f2a4d082517":c.kb.SITE_SECTION_HEAVY,"66d9e941559e4d469923a62e":c.kb.SITE_SECTION_HEAVY,"61575e8e934c48ea554b3caa":c.kb.SITE_SECTION_MERRIAM,"61575e5c934c481d714b3ca9":c.kb.SITE_SECTION_MERRIAM,"66a159459aefa202347fe5b8":c.kb.SITE_SECTION_SOAP_CENTRAL,"681a2abf3e2d7a08faf9bb6a":c.kb.SITE_SECTION_DELTA_DIGITAL,"67994a93c0ed9d61cc5c1c98":c.kb.SITE_SECTION_DELTA_DIGITAL,"55cb7b5d4bc841bd0c4e9b78":c.kb.SITE_SECTION_DELTA_DIGITAL,"681a2af162d1920db80f7435":c.kb.SITE_SECTION_DELTA_DIGITAL,"682f859bdaf00328b9cdea87":c.kb.SITE_SECTION_DELTA_DIGITAL,"546a129dc90ce559719e4aa9":c.kb.SITE_SECTION_DELTA_DIGITAL,"54bd9a30358b65853f5fe59b":c.kb.SITE_SECTION_DELTA_DIGITAL,"6a0496c1e0a4f36851f9873e":c.kb.SITE_SECTION_BIBLE_GATEWAY},this._destroy$=new v.B}ngOnInit(){const o=this.SITE_EMBED_MAP[this.site.id];o?(this.siteService.getSigmaEmbedUrl(this.site.id,o).pipe((0,q.s)(1)).subscribe(e=>{this.src=this.domSanitizer.bypassSecurityTrustResourceUrl(e.url)}),this.featureFlagService.featureFlagIsEnabled("cam-site-error-message").pipe((0,E.Q)(this._destroy$)).subscribe(e=>{this.showErrorMessage=e})):this.showErrorMessage=!0}ngOnDestroy(){this._destroy$.next(void 0)}static{this.\u0275fac=function(e){return new(e||Et)(t.rXU(et.TJ),t.rXU(qn.up),t.rXU(et.y9))}}static{this.\u0275cmp=t.VBU({type:Et,selectors:[["at-site-section-reporting"]],standalone:!1,decls:5,vars:1,consts:[["appearance","outlined","data-cy","cam-overview"],[1,"enterprise-page-unavailable"],["width","100%","height","3300px","title","CAM Site Overview",3,"src"]],template:function(e,n){1&e&&(t.nrm(0,"at-alert"),t.j41(1,"mat-card",0)(2,"mat-card-content"),t.nVh(3,ai,2,2)(4,oi,2,0,"div",1),t.k0s()()),2&e&&(t.R7$(3),t.vxM(n.showErrorMessage?4:3))},dependencies:[at.RN,at.m2,ti.HM,te.C],encapsulation:2})}}!function(i,o,e,n){var l,a=arguments.length,s=a<3?o:null===n?n=Object.getOwnPropertyDescriptor(o,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(i,o,e,n);else for(var d=i.length-1;d>=0;d--)(l=i[d])&&(s=(a<3?l(s):a>3?l(o,e,s):l(o,e))||s);a>3&&s&&Object.defineProperty(o,e,s)}([(0,G.bL)(y.NR)],Et.prototype,"site",void 0);var S=r(3510),P=r(85558),si=r(43482),dt=r(17796),ri=r(22088),Ce=r(60533);let li=(()=>{class i{constructor(e,n,a){this.redirectService=e,this.store=n,this.route=a}ngOnInit(){const e=this.getRequestedSiteId(),n=this.store.selectSnapshot(y.NR.userSite),a=this.store.selectSnapshot(y.bM);(e&&n?.id!==e?this.store.dispatch(new si.u6(e)).pipe((0,q.s)(1),(0,xt.n)(()=>(0,dt.of)(this.store.selectSnapshot(y.NR.userSite)))):(0,dt.of)(n)).pipe((0,q.s)(1)).subscribe(l=>{this.redirectService.redirect(l,a)})}
3getRequestedSiteId(){return this.route.snapshot.pathFromRoot.find(n=>n.paramMap.has("siteId"))?.paramMap.get("siteId")??""}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(ri.Q),t.rXU(x.il),t.rXU(B.nX))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["at-redirect"]],standalone:!1,decls:1,vars:0,consts:[["loading","true"]],template:function(n,a){1&n&&t.nrm(0,"at-widget-card",0)},dependencies:[Ce.I],encapsulation:2})}}return i})();var ye=r(76706),di=r(21252),ci=r(42006),xe=r.n(ci),zt=r(27270),pi=r(35981),hi=r(39638),St=r(63022),ne=r(27327),we=r(2619),Xt=r(11584),ie=r(23656),gi=r(15849);let mi=(()=>{class i{constructor(){this.proceed=new t.bkB}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["at-dropped-site-warning"]],outputs:{proceed:"proceed"},standalone:!1,decls:9,vars:0,consts:[["data-cy","dropped-site-warning",1,"dropped-site-warning-page"],["appearance","outlined",1,"dropped-site-warning-card"],[1,"warning-icon"],["mat-flat-button","","color","warn","type","button",3,"click"]],template:function(n,a){1&n&&(t.j41(0,"section",0)(1,"mat-card",1)(2,"mat-card-content")(3,"mat-icon",2),t.EFF(4,"warning"),t.k0s(),t.j41(5,"p"),t.EFF(6," You are viewing the dashboard for a site that is no longer active with Raptive. Some dashboard features may be unavailable, and analytics may be incomplete or inaccurate. "),t.k0s(),t.j41(7,"button",3),t.bIt("click",function(){return a.proceed.emit()}),t.EFF(8," PROCEED "),t.k0s()()()())},dependencies:[gi.$z,at.RN,at.m2,wt.An],styles:[".dropped-site-warning-page[_ngcontent-%COMP%]{display:flex;justify-content:center;padding:48px 24px}.dropped-site-warning-card[_ngcontent-%COMP%]{max-width:680px;width:100%;border:1px solid var(--warn, #bf3745);border-left:8px solid var(--warn, #bf3745);background:var(--warn-lighter, #f7e7e9)}.mat-mdc-card-content[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:16px;padding:24px}.warning-icon[_ngcontent-%COMP%]{color:var(--warn, #bf3745)}p[_ngcontent-%COMP%]{margin:0;color:var(--primary-text, #2d2d2d);font-size:16px;line-height:1.5}button[_ngcontent-%COMP%]{white-space:nowrap}@media(max-width:720px){.dropped-site-warning-page[_ngcontent-%COMP%]{padding:32px 16px}.mat-mdc-card-content[_ngcontent-%COMP%]{grid-template-columns:1fr;justify-items:start}}"]})}}return i})();var ui=r(92333),fi=r(92986),ae=r(54591),bi=r(16873);function _i(i,o){if(1&i){const e=t.RV6();t.j41(0,"adl-button",1),t.bIt("click",function(){p.eBV(e);const a=t.XpG();return p.Njj(a.openSupportPage())}),t.k0s()}if(2&i){const e=t.XpG();t.Y8G("text",e.buttonText)}}let Se=(()=>{class i{constructor(e){this.breakpointObserver=e,this.visible=!0,this.supportUrl="https://raptive.zendesk.com/hc/en-us/requests/new"}ngOnInit(){this.breakpointObserver.observe("(max-width: 500px)").subscribe(e=>{this.isMobile=e.matches})}get buttonText(){return this.isMobile?"":"Support"}openSupportPage(){window.open(this.supportUrl,"_blank","noopener,noreferrer")}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(kt.Q))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["at-support-button"]],inputs:{visible:"visible"},decls:1,vars:1,consts:[["emphasis","high","icon","help_outline","class","support-button",3,"text","click",4,"ngIf"],["emphasis","high","icon","help_outline",1,"support-button",3,"click","text"]],template:function(n,a){1&n&&t.DNE(0,_i,1,1,"adl-button",0),2&n&&t.Y8G("ngIf",a.visible)},dependencies:[g.MD,g.bT,it.ik,it.Qp],styles:[".support-button[_ngcontent-%COMP%]{position:fixed;bottom:20px;right:20px;z-index:1000}.support-button[_ngcontent-%COMP%] .mat-icon{font-size:24px!important;width:24px!important;height:24px!important}"]})}}return i})();var Me=r(25580),_t=r(61594),Dt=r(94390),vi=r(26484),oe=r(60494),Ft=r(62997),Mt=r(6663),Ie=r(11869),Ci=r(64337),Te=r(75661),Wt=r(85409),Pe=r(92359),Re=r(14061),Oe=r(9256),yi=r(90310);const W=i=>({$implicit:i}),xi=i=>({active:i}),wi=i=>({"content-optimization-title":i});function Si(i,o){if(1&i&&(t.j41(0,"span",5),t.EFF(1),t.k0s()),2&i){const e=t.XpG().$implicit;t.R7$(),t.JRh(e.navTag||"NEW")}}function Mi(i,o){if(1&i&&(t.j41(0,"span",4),t.EFF(1),t.nVh(2,Si,2,1,"span",5),t.k0s()),2&i){const e=o.$implicit;t.R7$(),t.SpI("",e.title," "),t.R7$(),t.vxM(e.navTag||e.isNew?2:-1)}}function Ii(i,o){if(1&i&&t.nrm(0,"mat-icon",6),2&i){const e=t.XpG().$implicit;t.Y8G("svgIcon",e.svgIcon)}}function Ti(i,o){if(1&i&&(t.j41(0,"mat-icon",7),t.EFF(1),t.k0s()),2&i){const e=t.XpG().$implicit;t.R7$(),t.JRh(e.icon)}}function Pi(i,o){if(1&i&&t.nVh(0,Ii,1,1,"mat-icon",6)(1,Ti,2,1,"mat-icon",7),2&i){const e=o.$implicit,n=t.XpG(2);t.vxM(n.showIcon&&e.svgIcon?0:n.showIcon&&e.icon?1:-1)}}function Ri(i,o){1&i&&t.eu8(0)}function Oi(i,o){if(1&i&&(t.j41(0,"a",9),t.DNE(1,Ri,1,0,"ng-container",10),t.j41(2,"span",4),t.EFF(3),t.k0s(),t.j41(4,"mat-icon"),t.EFF(5,"open_in_new"),t.k0s()()),2&i){t.XpG(4);const e=t.sdS(3),n=t.XpG();t.Y8G("href",n.route.route[0],t.B4B),t.R7$(),t.Y8G("ngTemplateOutlet",e)("ngTemplateOutletContext",t.eq3(4,W,n.route)),t.R7$(2),t.JRh(n.route.title)}}function ki(i,o){1&i&&t.eu8(0)}function Ei(i,o){1&i&&t.eu8(0)}function Di(i,o){if(1&i&&(t.j41(0,"a",11),t.DNE(1,ki,1,0,"ng-container",10)(2,Ei,1,0,"ng-container",10),t.k0s()),2&i){t.XpG(5);const e=t.sdS(1),n=t.sdS(3),a=t.XpG();t.Y8G("routerLink",a.route.route)("title",a.route.title),t.R7$(),t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.eq3(6,W,a.route)),t.R7$(),t.Y8G("ngTemplateOutlet",e)("ngTemplateOutletContext",t.eq3(8,W,a.route))}}function Fi(i,o){1&i&&t.eu8(0)}function Ai(i,o){1&i&&t.eu8(0)}function Ni(i,o){if(1&i&&(t.j41(0,"a",12),t.DNE(1,Fi,1,0,"ng-container",10)(2,Ai,1,0,"ng-container",10),t.k0s()),2&i){t.XpG(5);const e=t.sdS(1),n=t.sdS(3),a=t.XpG();t.Y8G("routerLink",a.route.route)("title",a.route.title)("gaCategory",a.route.title),t.R7$(),t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.eq3(7,W,a.route)),t.R7$(),t.Y8G("ngTemplateOutlet",e)("ngTemplateOutletContext",t.eq3(9,W,a.route))}}function $i(i,o){if(1&i&&(t.nVh(0,Di,3,10,"a",11),t.nVh(1,Ni,3,11,"a",12)),2&i){const e=t.XpG(5);t.vxM(e.route.gaTrack?-1:0),t.R7$(),t.vxM(e.route.gaTrack?1:-1)}}function Gi(i,o){if(1&i&&(t.j41(0,"mat-list-item",8),t.nVh(1,Oi,6,6,"a",9)(2,$i,2,2),t.k0s()),2&i){const e=t.XpG(4);t.Y8G("atFeatureFlag",e.route.featureFlag)("matTooltip",e.route.title)("matTooltipDisabled",!e.isCollapsedRail),t.R7$(),t.vxM(e.route.external?1:2)}}function ji(i,o){1&i&&t.eu8(0)}function Li(i,o){if(1&i&&(t.j41(0,"a",9),t.DNE(1,ji,1,0,"ng-container",10),t.j41(2,"span",4),t.EFF(3),t.k0s(),t.j41(4,"mat-icon"),t.EFF(5,"open_in_new"),t.k0s()()),2&i){t.XpG(4);const e=t.sdS(3),n=t.XpG();t.Y8G("href",n.route.route[0],t.B4B),t.R7$(),t.Y8G("ngTemplateOutlet",e)("ngTemplateOutletContext",t.eq3(4,W,n.route)),t.R7$(2),t.JRh(n.route.title)}}function Ui(i,o){1&i&&t.eu8(0)}function Bi(i,o){1&i&&t.eu8(0)}function Vi(i,o){if(1&i&&(t.j41(0,"a",11),t.DNE(1,Ui,1,0,"ng-container",10)(2,Bi,1,0,"ng-container",10),t.k0s()),2&i){t.XpG(5);const e=t.sdS(1),n=t.sdS(3),a=t.XpG();t.Y8G("routerLink",a.route.route)("title",a.route.title),t.R7$(),t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.eq3(6,W,a.route)),t.R7$(),t.Y8G("ngTemplateOutlet",e)("ngTemplateOutletContext",t.eq3(8,W,a.route))}}function Yi(i,o){1&i&&t.eu8(0)}function zi(i,o){1&i&&t.eu8(0)}function Xi(i,o){if(1&i&&(t.j41(0,"a",12),t.DNE(1,Yi,1,0,"ng-container",10)(2,zi,1,0,"ng-container",10),t.k0s()),2&i){t.XpG(5);const e=t.sdS(1),n=t.sdS(3),a=t.XpG();t.Y8G("routerLink",a.route.route)("title",a.route.title)("gaCategory",a.route.title),t.R7$(),t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.eq3(7,W,a.route)),t.R7$(),t.Y8G("ngTemplateOutlet",e)("ngTemplateOutletContext",t.eq3(9,W,a.route))}}function Wi(i,o){if(1&i&&(t.nVh(0,Vi,3,10,"a",11),t.nVh(1,Xi,3,11,"a",12)),2&i){const e=t.XpG(5);t.vxM(e.route.gaTrack?-1:0),t.R7$(),t.vxM(e.route.gaTrack?1:-1)}}function Hi(i,o){if(1&i&&(t.j41(0,"mat-list-item",8),t.nVh(1,Li,6,6,"a",9)(2,Wi,2,2),t.k0s()),2&i){const e=t.XpG(4);t.Y8G("atFeatureFlag",e.route.featureFlag)("matTooltip",e.route.title)("matTooltipDisabled",!e.isCollapsedRail),t.R7$(),t.vxM(e.route.external?1:2)}}function Ki(i,o){if(1&i&&t.nVh(0,Gi,3,4,"mat-list-item",8)(1,Hi,3,4,"mat-list-item",8),2&i){const e=t.XpG(3);t.vxM(e.route.permission?0:1)}}function Qi(i,o){if(1&i&&(t.qex(0),t.nVh(1,Ki,2,1),t.bVm()),2&i){const e=t.XpG(2);t.R7$(),t.vxM(e.route.children?-1:1)}}function Ji(i,o){1&i&&t.eu8(0)}function Zi(i,o){1&i&&(t.j41(0,"mat-icon",15),t.EFF(1,"arrow_drop_down"),t.k0s())}function qi(i,o){1&i&&(t.j41(0,"mat-icon",15),t.EFF(1,"arrow_right"),t.k0s())}function ta(i,o){if(1&i){const e=t.RV6();t.j41(0,"mat-list-item",3)(1,"a",13),t.bIt("click",function(){p.eBV(e);const a=t.XpG(2);return p.Njj(a.toggle())}),t.DNE(2,Ji,1,0,"ng-container",10),t.j41(3,"span",14),t.EFF(4),t.k0s(),t.nVh(5,Zi,2,0,"mat-icon",15),t.nVh(6,qi,2,0,"mat-icon",15),t.k0s()()}if(2&i){t.XpG();const e=t.sdS(3),n=t.XpG();t.Y8G("ngClass",t.eq3(9,xi,n.isCollapsedRail&&n.parentActive))("matTooltip",n.route.title)("matTooltipDisabled",!n.isCollapsedRail),t.R7$(2),t.Y8G("ngTemplateOutlet",e)("ngTemplateOutletContext",t.eq3(11,W,n.route)),t.R7$(),t.Y8G("ngClass",t.eq3(13,wi,"Content Optimization"!==n.route.title)),t.R7$(),t.SpI(" ",n.route.title," "),t.R7$(),t.vxM(n.showItems?5:-1),t.R7$(),t.vxM(n.showItems?-1:6)}}function ea(i,o){1&i&&t.eu8(0)}function na(i,o){if(1&i&&(t.j41(0,"a",11),t.DNE(1,ea,1,0,"ng-container",10),t.k0s()),2&i){const e=t.XpG(4).$implicit;t.XpG(2);const n=t.sdS(1);t.Y8G("routerLink",e.route)("title",e.title),t.R7$(),t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.eq3(4,W,e))}}function ia(i,o){1&i&&t.eu8(0)}function aa(i,o){if(1&i&&(t.j41(0,"a",12),t.DNE(1,ia,1,0,"ng-container",10),t.k0s()),2&i){const e=t.XpG(4).$implicit;t.XpG(2);const n=t.sdS(1);t.Y8G("routerLink",e.route)("title",e.title)("gaCategory",e.title),t.R7$(),t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.eq3(5,W,e))}}function oa(i,o){1&i&&t.eu8(0)}function sa(i,o){if(1&i&&(t.j41(0,"a",17),t.DNE(1,oa,1,0,"ng-container",10),t.j41(2,"mat-icon"),t.EFF(3,"open_in_new"),t.k0s()()),2&i){const e=t.XpG(4).$implicit;t.XpG(2);const n=t.sdS(1);t.Y8G("href",e.route[0],t.B4B)("title",e.title)("gaCategory",e.title),t.R7$(),t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.eq3(5,W,e))}}function ra(i,o){if(1&i&&(t.j41(0,"mat-list-item",16),t.nVh(1,na,2,6,"a",11),t.nVh(2,aa,2,7,"a",12),t.nVh(3,sa,4,7,"a",17),t.k0s()),2&i){const e=t.XpG(3).$implicit,n=t.XpG(3);
3t.Y8G("flagName",e.featureFlag)("ngClass",n.childClasses(e)),t.R7$(),t.vxM(e.external||e.gaTrack?-1:1),t.R7$(),t.vxM(!e.external&&e.gaTrack?2:-1),t.R7$(),t.vxM(e.external?3:-1)}}function la(i,o){1&i&&t.eu8(0)}function da(i,o){if(1&i&&(t.j41(0,"a",11),t.DNE(1,la,1,0,"ng-container",10),t.k0s()),2&i){const e=t.XpG(4).$implicit;t.XpG(2);const n=t.sdS(1);t.Y8G("routerLink",e.route)("title",e.title),t.R7$(),t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.eq3(4,W,e))}}function ca(i,o){1&i&&t.eu8(0)}function pa(i,o){if(1&i&&(t.j41(0,"a",12),t.DNE(1,ca,1,0,"ng-container",10),t.k0s()),2&i){const e=t.XpG(4).$implicit;t.XpG(2);const n=t.sdS(1);t.Y8G("routerLink",e.route)("title",e.title)("gaCategory",e.title),t.R7$(),t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.eq3(5,W,e))}}function ha(i,o){1&i&&t.eu8(0)}function ga(i,o){if(1&i&&(t.j41(0,"a",17),t.DNE(1,ha,1,0,"ng-container",10),t.j41(2,"mat-icon"),t.EFF(3,"open_in_new"),t.k0s()()),2&i){const e=t.XpG(4).$implicit;t.XpG(2);const n=t.sdS(1);t.Y8G("href",e.route[0],t.B4B)("title",e.title)("gaCategory",e.title),t.R7$(),t.Y8G("ngTemplateOutlet",n)("ngTemplateOutletContext",t.eq3(5,W,e))}}function ma(i,o){if(1&i&&(t.j41(0,"mat-list-item",16),t.nVh(1,da,2,6,"a",11),t.nVh(2,pa,2,7,"a",12),t.nVh(3,ga,4,7,"a",17),t.k0s()),2&i){const e=t.XpG(3).$implicit,n=t.XpG(3);t.Y8G("flagName",e.featureFlag)("ngClass",n.childClasses(e)),t.R7$(),t.vxM(e.external||e.gaTrack?-1:1),t.R7$(),t.vxM(!e.external&&e.gaTrack?2:-1),t.R7$(),t.vxM(e.external?3:-1)}}function ua(i,o){if(1&i&&t.nVh(0,ra,4,5,"mat-list-item",16)(1,ma,4,5,"mat-list-item",16),2&i){const e=t.XpG(2).$implicit;t.vxM(e.permission?0:1)}}function fa(i,o){if(1&i&&(t.qex(0),t.nVh(1,ua,2,1),t.bVm()),2&i){const e=t.XpG().$implicit;t.R7$(),t.vxM(e.enabled?1:-1)}}function ba(i,o){1&i&&t.DNE(0,fa,2,1,"ng-container",2),2&i&&t.Y8G("ldFeature",o.$implicit.ldFeatureFlag)}function _a(i,o){if(1&i&&(t.j41(0,"mat-nav-list"),t.Z7z(1,ba,1,1,"ng-container",null,t.BUC().trackChild,!0),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.Dyx(e.route.children)}}function va(i,o){if(1&i&&(t.DNE(0,Mi,3,2,"ng-template",null,0,t.C5r)(2,Pi,2,1,"ng-template",null,1,t.C5r)(4,Qi,2,1,"ng-container",2),t.nVh(5,ta,7,15,"mat-list-item",3),t.nVh(6,_a,3,0,"mat-nav-list")),2&i){const e=t.XpG();t.R7$(4),t.Y8G("ldFeature",e.route.ldFeatureFlag),t.R7$(),t.vxM(e.route.children?5:-1),t.R7$(),t.vxM(e.showItems&&!e.isCollapsedRail?6:-1)}}let Ca=(()=>{class i{constructor(e,n,a,s,l){this.router=e,this.breakpointObserver=n,this.featureFlagService=a,this.cdr=s,this.sideNavService=l,this.showItems=!1,this.parentActive=!1,this.isContentOptimizationBriefs=!1,this.postCentricPageTitle="Briefs"}get showIcon(){return this.sideNavService.collapsibleEnabled}get isCollapsedRail(){return this.sideNavService.collapsibleEnabled&&this.sideNavService.collapsed}ngOnInit(){this.updateShowItems(),this.isAvailableOnThisDevicePlatform$=this.breakpointObserver.observe("(max-width: 500px)").pipe((0,Mt.T)(e=>!this.route.availableOn||("mobile"===this.route.availableOn?e.matches:!e.matches))),this.isContentOptimizationBriefs=this.getIsContentOptimizationBriefs(),this.subscription=this.router.events.pipe((0,K.p)(e=>e instanceof B.wF)).subscribe(()=>{this.updateShowItems(),this.isContentOptimizationBriefs=this.getIsContentOptimizationBriefs(),this.cdr.markForCheck()}),this.featureFlagService.featureFlagIsEnabled(j.lX).pipe((0,q.s)(1)).subscribe(e=>{this.postCentricPageTitle=e?"Posts and Briefs":"Briefs",this.cdr.markForCheck()}),this.collapsedSubscription=this.sideNavService.collapsed$.subscribe(()=>{this.cdr.markForCheck()})}getIsContentOptimizationBriefs(){return this.router.url.includes("content-optimization")&&this.router.url.includes("briefs")}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe(),this.collapsedSubscription?.unsubscribe()}toggle(){if(this.isCollapsedRail)return this.sideNavService.expand(),this.showItems=!0,void this.cdr.markForCheck();this.showItems=!this.showItems}trackChild(e,n){const a=n.route?.join("/")??"";return`${n.title}|${a}`}routeIsContentOptimizationBriefs(e,n){return"Content Optimization"===e.title&&n.title===this.postCentricPageTitle&&this.isContentOptimizationBriefs}
3childClasses(e){return{active:this.routeIsContentOptimizationBriefs(this.route,e)}}updateShowItems(){this.route.children&&(this.parentActive=!!this.route.children.find(e=>e.route?.[2]===this.router.url.split("/")[3]),this.showItems=this.parentActive)}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(B.Ix),t.rXU(kt.Q),t.rXU(et.y9),t.rXU(yi.gRc),t.rXU(Xt.G))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["at-side-nav-item"]],inputs:{route:"route"},standalone:!1,decls:2,vars:3,consts:[["sidebarTitle",""],["navIcon",""],[4,"ldFeature"],["matTooltipPosition","right",3,"ngClass","matTooltip","matTooltipDisabled"],["data-cy","side-nav-title",1,"title"],[1,"nav-tag"],[1,"nav-icon",3,"svgIcon"],["fontSet","material-icons-outlined",1,"nav-icon"],["routerLinkActive","active","matTooltipPosition","right",3,"atFeatureFlag","matTooltip","matTooltipDisabled"],["mat-line","","target","_blank",1,"external",3,"href"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["mat-line","",3,"routerLink","title"],["mat-line","","gaClick","Navigation",3,"routerLink","title","gaCategory"],["data-cy","side-nav-parent","mat-line","",1,"parent-nav",3,"click"],["data-cy","side-nav-title",1,"title",3,"ngClass"],[1,"icon","arrow"],["routerLinkActive","active","atFeatureFlag","","data-cy","side-nav-child",1,"nav-child",3,"flagName","ngClass"],["mat-line","","gaClick","Navigation","target","_blank",1,"external",3,"href","title","gaCategory"]],template:function(n,a){1&n&&(t.nVh(0,va,7,3),t.nI1(1,"async")),2&n&&t.vxM(t.bMT(1,1,a.isAvailableOnThisDevicePlatform$)?0:-1)},dependencies:[g.YU,g.T3,Te.Y,Jt.F,wt.An,Wt._L,Wt.YE,Zt.oV,Pe.vu,Z.Wk,Z.wQ,Oe.v,N.up,g.Jj],styles:[".mat-mdc-list-base at-side-nav-item{display:block}.mat-mdc-list-base at-side-nav-item .mat-mdc-list-item,.mat-mdc-list-base at-side-nav-item .mat-list-item-ripple{border-top-right-radius:30px;border-bottom-right-radius:30px}.mat-mdc-list-base at-side-nav-item .mat-mdc-list-item .external{justify-content:space-between}.mat-mdc-list-base at-side-nav-item .mat-mdc-list-item a{color:var(--dark-text-med)}.mat-mdc-list-base at-side-nav-item .mat-mdc-list-item.nav-child a{margin-left:10px}.mat-mdc-list-base at-side-nav-item .mat-mdc-list-item.active{background-color:var(--primary-warm-gray)}.mat-mdc-list-base at-side-nav-item .mat-mdc-list-item.active .mat-list-text a.mat-line a{color:var(--dark-text-high)}.mat-mdc-list-base at-side-nav-item .mat-mdc-list-item.active .mat-list-text a.mat-line svg{fill:var(--dark-text-high)}.mat-mdc-list-base at-side-nav-item .mat-mdc-list-item .mat-icon{font-size:20px;height:17px;margin:2px;width:20px}.mat-mdc-list-base at-side-nav-item:has(>* .parent-nav):has(>* .active) a.mat-line{color:var(--dark-text-high)}.mat-mdc-list-base at-side-nav-item a{line-height:48px;display:flex!important;flex-direction:row;gap:8px;align-items:center;justify-content:flex-start;text-decoration:none}.mat-mdc-list-base at-side-nav-item a .title{display:flex;align-items:center}.mat-mdc-list-base at-side-nav-item a .nav-tag{font-size:10px;line-height:12px;background-color:var(--info);border-radius:50vh;color:var(--primary-white);padding:2px 5px;vertical-align:middle;margin-left:10px;font-weight:500}.mat-mdc-list-base at-side-nav-item a .arrow{margin-left:auto}\n"],encapsulation:2,changeDetection:0})}}return i})();var It=function(i,o,e,n){var l,a=arguments.length,s=a<3?o:null===n?n=Object.getOwnPropertyDescriptor(o,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(i,o,e,n);else for(var d=i.length-1;d>=0;d--)(l=i[d])&&(s=(a<3?l(s):a>3?l(o,e,s):l(o,e))||s);return a>3&&s&&Object.defineProperty(o,e,s),s};const ya=i=>({backgroundImage:i}),xa=i=>({border:i});function wa(i,o){if(1&i&&(t.j41(0,"h1"),t.EFF(1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.JRh(e.initials)}}function Sa(i,o){if(1&i&&(t.j41(0,"div",4),t.EFF(1),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.SpI(" ",e.error," ")}}function Ma(i,o){1&i&&t.nrm(0,"at-side-nav-item",7),2&i&&t.Y8G("route",o.$implicit)}function Ia(i,o){if(1&i&&t.nrm(0,"at-side-nav-item",10),2&i){const e=o.$implicit;t.Y8G("flagName",e.featureFlag)("route",e)}}function Ta(i,o){1&i&&(t.j41(0,"mat-list-item")(1,"a",15)(2,"span",13),t.EFF(3,"Get Help"),t.k0s()()())}class ot{get isCollapsedRail(){return this.collapsibleNavEnabled&&this.sideNavService.collapsed}constructor(o,e,n,a,s,l,d,b,_,f,D,L){this.router=o,this.sideNavService=e,this.authService=n,this.store=a,this.imageCompress=s,this.snackbarService=l,this.userService=d,this.launchDarklyService=b,this.permissionsService=_,this.recommendationTrackerService=f,this.featureFlagService=D,this.wizardInstanceService=L,this.collapsibleNavEnabled=!0,this._destroy$=new v.B,this.routes=[],this.accountRoutes=[],this.referralCodes=[],this.sitePermissions=[],this.ADTHRIVE=c.Kw.ADTHRIVE,this.advocateConsentLinkFF=j.kc,this.hasUnseenRecommendations=!1,this.router.events.pipe((0,E.Q)(this._destroy$),(0,K.p)(R=>R instanceof B.wF)).subscribe(R=>{this.sideNavService.close()})}ngOnInit(){this.recommendationTrackerService.hasUnseenRecommendations$.pipe((0,E.Q)(this._destroy$)).subscribe(o=>{this.hasUnseenRecommendations=o,this.updateRecommendationsNewTag()}),(0,C.z)([this.store.select(y.bM.user),this.store.select(y.bM.sites),this.store.select(y.NR.userSite),this.launchDarklyService.getFlagObservable(P.Bt.SEO_PLANNER,!1),this.launchDarklyService.getFlagObservable(P.Bt.SEO_POSTS_AND_BRIEFS,!1),this.launchDarklyService.getFlagObservable(P.Bt.COMMUNITY_EARNINGS_PAGE,!1),this.launchDarklyService.getFlagObservable(P.Bt.COMMUNITY_EARNINGS_SOURCES_PAGE,!1),this.launchDarklyService.getFlagObservable(P.Bt.FOODFIGHT,!1),this.launchDarklyService.getFlagObservable(P.Bt.SOCIAL_INSIGHTS_IMPORTER,!1),this.launchDarklyService.getFlagObservable(P.Bt.RAPTIVE_COMPASS_MY_DASHBOARD,!1)]).pipe((0,E.Q)(this._destroy$),(0,xt.n)(([o,e,n,a,s,l,d,b,_,f])=>{const{id:D}=o,L=n??e[0],R=L?.siteType===Dt.Ie.COMMUNITY&&L.id?this.wizardInstanceService.fetchLegacyCommunityCompletion(L.id).pipe((0,xt.n)(()=>this.wizardInstanceService.watchLegacyCommunityCompletion(L.id)),(0,oe.W)(()=>(0,dt.of)(null)),(0,Ft.Z)(null)):(0,dt.of)(null);return(0,C.z)([this.userService.getUserReferralCode(D).pipe((0,Ft.Z)(null)),R]).pipe((0,Mt.T)(([V,z])=>(null!==V&&(this.referralCodes=V.data),[o,e,n,!0,{data:this.referralCodes},a,s,l,d,b,_,f,z])))})).subscribe(([o,e,n,a,s,l,d,b,_,f,D,L,R])=>{const V=[c.uY.INSTALL,c.uY.CHECKUP],z=n||e[0],{hasDroppedAccess:Nt,i
3d:ft,onboarding:nt,service:Kt,status:Ct,video:le,metadata:Wo,sitePermissions:Ho=[]}=z;this.siteId=ft,this.sitePermissions=Ho;const{type:Ko,pictureUrl:Qo,email:Jo,firstName:Fe,lastName:Ae,hasPortfolioSummary:Zo}=o;this.email=Jo??"",this.pictureUrl=Qo??"",this.fullName=`${Fe??""} ${Ae??""}`,this.initials=`${Fe?.[0]??""}${Ae?.[0]??""}`;const U=Ct===c.uY.ACTIVE,qo=Ct===c.uY.SETUP,bt=Ko===c.ut.EMPLOYEE,pt=o.isDemoUser??!1,Ne=Ct===c.uY.DROPPED,rt=Ne&&(bt||(Nt??!1)),$e=V.includes(Ct),Ge=Kt===c.Kw.CAM,je=!!Wo?.existsInWordpress,ts=!!nt?.wizard1CompletedAt,es=!!nt?.wizard2CompletedAt,de=ts&&!!nt?.analysis1CompletedAt,m=ht=>this.hasRoutePermission(ht),Le=(0,_t._c)(this.siteId).some(({permission:ht})=>this.hasPermission(ht)),ns=((le&&Le||a&&m("/sites/:siteId/content-optimization")&&de)&&qo||$e)&&m("/sites/:siteId/onboarding"),Ue=m("/sites/:siteId/account")&&(es||rt||$e||U),Be=(m("/sites/:siteId/publisher-direct"),m("/sites/:siteId/pinterest")&&(de||U||rt)&&!pt&&this.featureFlagService.isFeatureEnabledSync(j.LL)),Ve=(0,_t.EE)(this.siteId,c.Kw.ADTHRIVE).some(({permission:ht})=>this.hasPermission(ht)),is=Ve,as=Ve&&(!Ne||bt),Ye=(0,vi.N)(this.organization,z,bt),os=U&&!!z.slickstream&&!pt,ss=U&&!!z?.sigmaTransparencyMeta?.isActive,rs=s.data.length>0&&m("/account-settings/referral-program")||bt,ls=m("/account-settings/cloudflare"),ze=bt||(Ge||this.isPlatinum)&&m("/sites/:siteId/tests"),ds=this.platinumLevel===c.nh.LUMINARY,A=z.siteType===Dt.Ie.DEFAULT,cs=z.siteType===Dt.Ie.MOBILE_APP_ADS,yt=z.siteType===Dt.Ie.COMMUNITY,ps=m("/account-settings/api-credentials"),ce=yt,hs=yt&&(0,Ie.Gg)(R),Rt=z.siteType===Dt.Ie.CATALYST,Xe=Rt,k=A||Ge&&cs;this.routes=[{title:"Resource Center",route:["https://raptive.com/resources/"],icon:"help_outline",adService:[c.Kw.ADTHRIVE],enabled:(bt||U)&&A,external:!0}],Zo&&""===n.id?this.routes=[{title:"Portfolio Summary",route:["/portfolio-summary"],icon:"home",adService:[c.Kw.ADTHRIVE],enabled:m("/portfolio-summary")&&A},...this.routes]:(this.routes=[{title:"Setup Assistant",route:["/sites",this.siteId,"onboarding"],icon:"rocket_launch",adService:[c.Kw.ADTHRIVE],enabled:ns&&A},{title:L?"Raptive Compass":"My Dashboard",route:["/sites",this.siteId,"dashboard"],icon:L?"explore":"home",adService:[c.Kw.ADTHRIVE],enabled:m("/sites/:siteId/dashboard")&&A&&(U||rt)},{title:"Recommendations",route:["/sites",this.siteId,"recommendations"],icon:"check",adService:[c.Kw.ADTHRIVE],enabled:m("/sites/:siteId/recommendations")&&A&&(U||rt),gaTrack:!0,availableOn:c.Uz.DESKTOP},{title:R?.displayName||"Community Onboarding",route:["/sites",this.siteId,"wizard"],icon:"assignment",adService:[c.Kw.ADTHRIVE,c.Kw.CAM],enabled:hs&&m("/sites/:siteId/wizard")},{title:"Community Growth",route:["/sites",this.siteId,"community-earnings","growth"],icon:"trending_up",adService:[c.Kw.ADTHRIVE,c.Kw.CAM],enabled:b&&yt&&U&&m("/sites/:siteId/community-earnings/growth"),ldFeatureFlag:P.Bt.COMMUNITY_GROWTH_EMBED},{title:"Community Engagement",route:["/sites",this.siteId,"community-earnings","engagement"],icon:"forum",adService:[c.Kw.ADTHRIVE,c.Kw.CAM],enabled:b&&yt&&U&&m("/sites/:siteId/community-earnings/engagement"),ldFeatureFlag:P.Bt.COMMUNITY_ENGAGEMENT_EMBED},{title:"Community Earnings",route:["/sites",this.siteId,"community-earnings","last-30-days"],icon:"paid",adService:[c.Kw.ADTHRIVE,c.Kw.CAM],enabled:yt&&U&&m("/sites/:siteId/community-earnings"),ldFeatureFlag:P.Bt.COMMUNITY_EARNINGS_PAGE},{title:"Earnings Sources",route:["/sites",this.siteId,"earnings-sources"],icon:"account_balance",adService:[c.Kw.ADTHRIVE,c.Kw.CAM],enabled:_&&yt&&U&&m("/sites/:siteId/earnings-sources"),ldFeatureFlag:P.Bt.COMMUNITY_EARNINGS_SOURCES_PAGE,gaTrack:!0},{title:"Community Education",route:["/sites",this.siteId,"community-education"],icon:"school",adService:[c.Kw.ADTHRIVE,c.Kw.CAM],enabled:yt&&m("/sites/:siteId/community-education"),ldFeatureFlag:P.Bt.ONBOARDING_REWORK_2026},{title:"Earnings",route:[],icon:"attach_money",adService:[c.Kw.ADTHRIVE],enabled:A&&(U||rt),children:[{title:"Overview",route:["/sites",this.siteId,"earnings"],enabled:A},{title:"By Page",route:["/sites",this.siteId,"rpm","page"],enabled:A},{title:"By Traffic Source",route:["/sites",this.siteId,"rpm","source"],enabled:A,gaTrack:!0},{title:"By Country",route:["/sites",this.siteId,"country"],enabled:A,gaTrack:!0},{title:"By Category",route:["/sites",this.siteId,"rpm","category"],enabled:je&&A,gaTrack:!0},{title:"Brand Safety",route:["/sites",this.siteId,"brand-safety"],enabled:A,gaTrack:!0},{title:"Site Tests",route:["/sites",this.siteId,"tests"],enabled:ze&&A,featureFlag:j.A9,gaTrack:!0},{title:"Earnings Sources",route:["/sites",this.siteId,"earnings-sources"],enabled:A,gaTrack:!0},{title:"Gross Reporting",enabled:ss&&A&&!pt,route:["/sites",this.siteId,"gross-reporting"],ldFeatureFlag:P.Bt.GROSS_REPORTING_PAGE}]},{title:"Traffic",route:["/sites",this.siteId,"traffic"],icon:"show_chart",adService:[c.Kw.ADTHRIVE],enabled:m("/sites/:siteId/traffic")&&A&&(U||rt)},{title:"Pinterest",route:["/sites",this.siteId,"pinterest"],svgIcon:"pinterest",adService:[c.Kw.ADTHRIVE],featureFlag:j.LL,enabled:Be&&A},{title:"Content Optimization",route:[],icon:"article",adService:[c.Kw.ADTHRIVE],enabled:is&&A&&(de||U||rt),gaTrack:!0,children:[...this.getContentOptimizationChildren(this.siteId,c.Kw.ADTHRIVE,A,pt,l,d),{title:"Search Traffic Accelerator",route:["https://seo.sandbox.adthrive.com/"],enabled:!pt&&A,featureFlag:"SEO-Services-app",external:!0}]},{title:"Analytics",icon:"bar_chart",adService:[c.Kw.CAM],enabled:k||Rt&&U&&(m("/sites/:siteId/catalyst/site-overview")||m("/sites/:siteId/catalyst/site-details")),availableOn:c.Uz.DESKTOP,children:[{title:"Site Overview",route:["/sites",this.siteId,"overview"],enabled:m("/sites/:siteId/overview")&&k},{title:"Site Details",route:["/sites",this.siteId,"details"],enabled:m("/sites/:siteId/details")&&k},{title:"Site Section Reporting",route:["/sites",this.siteId,"site-section-reporting"],enabled:m("/sites/:siteId/site-section-reporting")&&k,featureFlag:j.je},{title:"By Page",route:["/sites",this.siteId,"rpm","page"],enabled:m("/sites/:siteId/rpm/page")&&k},{title:"By Traffic Source",route:["/sites",this.siteId,"rpm","source"],enabled:m("/sites/:siteId/rpm/source")&&k},{title:"By Country",route:["/sites",this.siteId,"country"],enabled:m("/sites/:siteId/country")&&k},{title:"By Category",route:["/sites",this.siteId,"rpm","category"],enabled:m("/sites/:siteId/rpm/category")&&je&&k},{title:"Brand Safety",route:["/sites",this.siteId,"brand-safety"],enabled:m("/sites/:siteId/brand-safety")&&k,gaTrack:!0},{title:"Site Tests",route:["/sites",this.siteId,"tests"],enabled:ze&&k,featureFlag:"opportunities-tests",gaTrack:!0},{title:"Site Overview",route:["/sites",this.siteId,"catalyst","site-overview"],enabled:Rt&&U&&m("/sites/:siteId/catalyst/site-overview"),ldFeatureFlag:P.Bt.CATALYST_SITE_OVERVIEW_EMBED},{title:"Site Details",route:["/sites",this.siteId,"catalyst","site-details"],enabled:Rt&&U&&m("/sites/:siteId/catalyst/site-details"),ldFeatureFlag:P.Bt.CATALYST_SITE_DETAILS_EMBED}]},{title:"Publisher Direct",route:["/sites",this.siteId,"publisher-direct"],icon:"handshake",adService:[c.Kw.CAM],ldFeatureFlag:P.Bt.PUBLISHER_DIRECT_PAGE,enabled:m("/sites/:siteId/publisher-direct")&&(U||rt)&&!pt&&k},{title:"Pinterest",route:["/sites",this.siteId,"pinterest"],svgIcon:"pinterest",adService:[c.Kw.CAM],featureFlag:j.LL,enabled:Be&&k},{title:"Content Optimization",route:[],icon:"article",adService:[c.Kw.CAM],enabled:as&&k,gaTrack:!0,children:[...this.getContentOptimizationChildren(this.siteId,c.Kw.CAM,k,pt,l,d),{title:"Search Traffic Accelerator",route:["https://seo.sandbox.adthrive.com/"],enabled:!pt&&k,featureFlag:"SEO-Services-app",external:!0}]},{title:"Videos",icon:"videocam",adService:[c.Kw.ADTHRIVE,c.Kw.CAM],enabled:(le??!1)&&Le&&k,children:this.getVideoChildren(this.siteId,(le??!1)&&k,D)},{title:"Slickstream",route:["https://accounts.slickstream.com/signin"],icon:"bolt",enabled:os&&m("/sites/:siteId/dashboard")&&k,adService:[c.Kw.ADTHRIVE,c.Kw.CAM],external:!0},{title:"Payments",icon:"credit_card",adService:[c.Kw.ADTHRIVE,c.Kw.CAM],enabled:Ue||ce||Xe||m("/sites/:siteId/payments"),children:[{title:"Payment Info",route:["/sites",this.siteId,"account"],enabled:Ue||ce||Xe&&m("/sites/:siteId/account")},{title:"Payment History",route:["/sites",this.siteId,"payments"],enabled:m("/sites/:siteId/payments")&&(U||rt)||ce}]},{title:"Ad Preferences",route:["/sites",this.siteId,"ad-preferences"],icon:"tune",adService:[c.Kw.ADTHRIVE],enabled:Ye&&m("/sites/:siteId/ad-preferences")&&(A||Rt)},{title:"Foodfight",route:[],icon:"restaurant",adService:[c.Kw.ADTHRIVE,c.Kw.CAM],ldFeatureFlag:P.Bt.FOODFIGHT,enabled:f&&m("/sites/:siteId/foodfight")&&k,children:[{title:"Crawler Management",route:["/sites",this.siteId,"foodfight","crawler-management"],permission:u.X2,enabled:m("/sites/:siteId/foodfight")&&k},{title:"Plugin Controls",route:["/sites",this.siteId,"foodfight","plugin-controls"],permission:u.X2,enabled:m("/sites/:siteId/foodfight")&&k}]},{title:"Ad Preferences",route:["/sites",this.siteId,"ad-preferences"],icon:"tune",adService:[c.Kw.CAM],enabled:Ye&&m("/sites/:siteId/ad-preferences")&&(k||Rt)},{title:"Recommendations",route:["/sites",this.siteId,"recommendations"],icon:"check",adService:[c.Kw.CAM],enabled:m("/sites/:siteId/recommendations")&&k,gaTrack:!0},{title:"Solutions",route:["https://raptive.com/luminary-solutions-overview"],icon:"lightbulb",enabled:m("/sites/:siteId/dashboard")&&ds&&k,adService:[c.Kw.ADTHRIVE,c.Kw.CAM],featureFlag:j._f,external:!0},...this.routes].filter(ht=>void 0!==Kt&&ht.adService?.includes(Kt)).filter(ht=>ht.enabled),this.applyPermissionsToMenuItems(this.routes),this.routes=this.filterVisibleMenuItems(this.routes),this.sideNavService.routes$.next(this.routes),ft&&this.recommendationTrackerService.checkForUnseenRecommendations(ft,bt),this.updateRecommendationsNewTag()),this.accountRoutes=[{title:"Account Settings",route:[],adService:[c.Kw.ADTHRIVE,c.Kw.CAM],enabled:m("/account-settings"),children:[{title:"Personal Info",route:["account-settings","personal-info"],enabled:m("/account-settings/personal-info")},{title:"Ad Targeting Options",route:["account-settings","ad-targeting-options"],enabled:m("/account-settings/ad-targeting-options")&&(bt||this.organization?.ownerUserId===this.userId)},{title:"Product Feedback & Testing",route:["account-settings","product-feedback"],enabled:m("/account-settings/product-feedback")},{title:"Google Analytics",route:["account-settings","google-analytics"],enabled:m("/account-settings/google-analytics")},{title:"Referral Program",route:["account-settings","referral-program"],enabled:rs},{title:"Cloudflare Credentials",route:["account-settings","cloudflare"],enabled:ls},{title:"Raptive Creator API",route:["account-settings","api-credentials"],enabled:ps,ldFeatureFlag:P.Bt.API_CREDENTIALS_MANAGEMENT},{title:"Representation Agreement",route:["https://na3.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=0f78ea32-9347-4b2a-b992-c911274c4840&env=na3&acct=4a3e9bdf-45a2-48c8-9d74-c95c3b2c924e&v=2"],enabled:m("/account-settings/personal-info"),featureFlag:j.UZ,external:!0},{title:"Amended Representation Agreement",route:["https://na3.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=2be7f4d9-936e-4f16-a158-189fdc70f050&env=na3&acct=4a3e9bdf-45a2-48c8-9d74-c95c3b2c924e&v=2"],enabled:m("/account-settings/personal-info"),featureFlag:j.rF,external:!0}]}],this.applyPermissionsToMenuItems(this.accountRoutes),this.accountRoutes=this.filterVisibleMenuItems(this.accountRoutes)})}uploadPicture(){var o=this;return(0,Me.A)(function*(){const{image:n,orientation:a}=yield o.imageCompress.uploadFile(),s=yield o.imageCompress.byteCount(n),l=Math.sqrt(s),d=100*(l>400?400/l:1),b=yield o.imageCompress.compressFile(n,a,Math.max(20,d));o.store.dispatch(new y.P3("current",b)).pipe((0,q.s)(1)).subscribe(()=>{o.snackbarService.open("Profile picture uploaded")},()=>{o.error="There was an issue uploading your profile picture.",setTimeout(()=>{o.error=null},4e3)})})()}updateRecommendationsNewTag(){if(this.routes)for(const o of this.routes)"Recommendations"===o.title&&(o.isNew=this.hasUnseenRecommendations)}applyPermissionsToMenuItems(o){for(const e of o){const n=this.normalizeMenuItemPath(e.route);n&&(e.permission=(0,u.d4)(n)),e.children?.length&&this.applyPermissionsToMenuItems(e.children)}}getContentOptimizationChildren(o,e,n,a,s,l){return(0,_t.EE)(o,e).filter(d=>d.featureKey===_t.CE.POSTS_AND_BRIEFS?l:d.featureKey!==_t.CE.SEO_PLANNER||s).map(d=>this.mapDashboardDestinationToMenuItem(d,n,a))}getVideoChildren(o,e,n){return(0,_t._c)(o).filter(a=>a.featureKey!==_t.CE.SOCIAL_INSIGHTS_IMPORTER||n).map(a=>this.mapDashboardDestinationToMenuItem(a,e,!1))}mapDashboardDestinationToMenuItem(o,e,n){return{title:o.title,route:o.route,permission:o.permission,featureFlag:o.featureFlag,ldFeatureFlag:o.ldFeatureFlag,navTag:o.navTag,enabled:e&&!(o.hideForDemoUser&&n)}}hasRoutePermission(o){const e=(0,u.d4)(o);return!!e&&this.hasPermission(e)}hasPermission(o){return!!o&&(this.sitePermissions.includes(o)||!!this.permissionsService.getPermission(o))}filterVisibleMenuItems(o){return o.map(e=>{if(void 0!==e.children){const n=this.filterVisibleMenuItems(e.children);return{...e,children:n}}return e}).filter(e=>!!e.enabled&&(void 0!==e.children?e.children.length>0:!e.permission||this.hasPermission(e.permission)))}trackMenuItem(o,e){const n=e.route?.join("/")??"";return`${e.title}|${n}|${e.icon??""}|${e.external??!1}`}normalizeMenuItemPath(o){return!o?.length||o[0]?.startsWith("http")?null:`/${o.map(a=>a.replace(/^\/+/,"")).join("/")}`.replace(/\/+/g,"/").replace(/^\/sites\/[^/]+/,"/sites/:siteId")}ngOnDestroy(){this._destroy$.next(void 0),this._destroy$.complete()}
3toggle(){return this.sideNavService.toggle()}static{this.\u0275fac=function(e){return new(e||ot)(t.rXU(B.Ix),t.rXU(Xt.G),t.rXU(et.uR),t.rXU(x.il),t.rXU(Ci.ep),t.rXU(it.zR),t.rXU(et.DL),t.rXU(N.I9),t.rXU(S.$R),t.rXU(et.zb),t.rXU(we.y),t.rXU(et.mG))}}static{this.\u0275cmp=t.VBU({type:ot,selectors:[["at-side-nav"]],hostVars:4,hostBindings:function(e,n){2&e&&t.AVh("collapsible-enabled",n.collapsibleNavEnabled)("collapsed",n.isCollapsedRail)},inputs:{service:"service"},standalone:!1,decls:30,vars:12,consts:[[1,"display-none-gt-tablet","nav-user"],[1,"img-box",3,"click","ngStyle","ngClass"],[1,"add-photo"],[1,"name-box"],[1,"error-text"],[1,"sites","display-none-gt-tablet"],[1,"primary"],["data-cy","side-nav-items",3,"route"],[1,"secondary","display-none-gt-tablet"],[1,"account"],["atFeatureFlag","",3,"flagName","route"],[3,"atFeatureFlag"],["mat-line","","href","https://na3.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=d5f1ed62-0285-4ec7-af92-eef9080f7c54&env=na3&acct=4a3e9bdf-45a2-48c8-9d74-c95c3b2c924e&v=2","target","_blank"],[1,"title"],["mat-line","",3,"click"],["mat-line","","href","https://help.raptive.com/hc/en-us","target","_blank"]],template:function(e,n){1&e&&(t.j41(0,"div",0)(1,"div",1),t.bIt("click",function(){return n.uploadPicture()}),t.nVh(2,wa,2,1,"h1"),t.j41(3,"div",2)(4,"mat-icon"),t.EFF(5,"add_a_photo"),t.k0s()()(),t.j41(6,"div",3)(7,"h2"),t.EFF(8),t.k0s(),t.j41(9,"div"),t.EFF(10),t.k0s()()(),t.nVh(11,Sa,2,1,"div",4),t.nrm(12,"at-sites",5),t.j41(13,"mat-nav-list",6),t.Z7z(14,Ma,1,1,"at-side-nav-item",7,n.trackMenuItem,!0),t.k0s(),t.j41(16,"mat-nav-list",8)(17,"mat-nav-list",9),t.Z7z(18,Ia,1,2,"at-side-nav-item",10,n.trackMenuItem,!0),t.k0s(),t.qex(20),t.j41(21,"mat-list-item",11)(22,"a",12)(23,"span",13),t.EFF(24," AI Advocacy Consent "),t.k0s()()(),t.bVm(),t.nVh(25,Ta,4,0,"mat-list-item"),t.j41(26,"mat-list-item")(27,"a",14),t.bIt("click",function(){return n.authService.logout()}),t.j41(28,"span",13),t.EFF(29,"Logout"),t.k0s()()()()),2&e&&(t.R7$(),t.Y8G("ngStyle",t.eq3(8,ya,"url("+n.pictureUrl+")"))("ngClass",t.eq3(10,xa,!n.pictureUrl)),t.R7$(),t.vxM(n.pictureUrl?-1:2),t.R7$(6),t.JRh(n.fullName),t.R7$(2),t.JRh(n.email),t.R7$(),t.vxM(n.error?11:-1),t.R7$(3),t.Dyx(n.routes),t.R7$(4),t.Dyx(n.accountRoutes),t.R7$(3),t.Y8G("atFeatureFlag",n.advocateConsentLinkFF),t.R7$(4),t.vxM(n.service===n.ADTHRIVE?25:-1))},dependencies:[g.YU,g.B3,Te.Y,wt.An,Wt._L,Wt.YE,Pe.vu,Re.g,Oe.v,Ca],styles:["at-side-nav{overflow-y:scroll}at-side-nav .sites{margin:16px}at-side-nav at-sites .mat-mdc-form-field{max-width:100%}at-side-nav .primary .mdc-list-item{padding-left:12px;padding-right:12px}at-side-nav .mat-nav-list.secondary{border-top:1px solid var(--edges)}at-side-nav .mat-nav-list.secondary,at-side-nav .mat-nav-list.secondary .account{padding-top:0}at-side-nav .mat-nav-list.secondary a{color:var(--dark-text-med);margin-left:24px}at-side-nav .mat-list-text a.mat-line{line-height:48px;display:flex!important;padding:0 12px!important;flex-direction:row;gap:8px;align-items:center;justify-content:flex-start;color:var(--dark-text-med)}at-side-nav .mat-list-text a.mat-line .arrow{margin-left:auto}at-side-nav .mat-list-text a.mat-line .learn-more-banner-badge{position:relative;background-color:#deffc3;border-radius:3px;margin-left:9px;padding:1px 5px;font-size:13px;color:var(--secondary-grounded-green)}at-side-nav a{line-height:48px;vertical-align:middle}at-side-nav a .icon{width:24px;height:24px;font-size:24px;box-sizing:content-box;border-radius:50%;padding:0;vertical-align:middle}at-side-nav a .title{width:100%;padding-left:16px}at-side-nav.collapsible-enabled at-side-nav-item .mat-mdc-list-item .mat-icon{display:inline-block;text-align:center;overflow:visible}at-side-nav.collapsible-enabled at-side-nav-item .mat-mdc-list-item .nav-icon.mat-icon{width:20px;height:20px;font-size:20px;line-height:24px;margin:0;flex:0 0 24px;color:var(--primary-catalyst-purple)}at-side-nav.collapsible-enabled at-side-nav-item .mat-mdc-list-item .nav-icon.mat-icon svg{width:100%;height:100%;fill:currentColor}at-side-nav.collapsible-enabled at-side-nav-item .mat-mdc-list-item .arrow.mat-icon,at-side-nav.collapsible-enabled at-side-nav-item .mat-mdc-list-item a.external>.mat-icon:not(.nav-icon){width:20px;height:20px;font-size:20px;line-height:20px;margin:0}at-side-nav.collapsible-enabled at-side-nav-item .mat-mdc-list-item a.external.mat-line{justify-content:flex-start}at-side-nav.collapsible-enabled at-side-nav-item .mat-mdc-list-item a.external.mat-line>.mat-icon:not(.nav-icon){margin-left:auto}at-side-nav.collapsible-enabled .mat-list-text a.mat-line,at-side-nav.collapsible-enabled at-side-nav-item a{gap:10px}at-side-nav.collapsible-enabled .mat-list-text a.mat-line .title,at-side-nav.collapsible-enabled at-side-nav-item a .title{padding-left:0;font-size:14px}at-side-nav.collapsible-enabled at-side-nav-item .mat-mdc-list-item.nav-child{padding-left:12px;padding-right:12px}at-side-nav.collapsible-enabled at-side-nav-item .mat-mdc-list-item.nav-child a.mat-line{margin-left:0;padding-left:46px!important;padding-right:12px!important;line-height:48px;min-height:48px;box-sizing:border-box}at-side-nav .nav-user{display:flex;margin:10px 0 23px}at-side-nav .nav-user *{font-size:12px}at-side-nav .nav-user .img-box{width:65.33px;height:66.67px;border-radius:100%;background-size:cover;background-position:center;margin-top:13px;margin-left:18px}at-side-nav .nav-user .img-box.border{border:1px solid #fff}at-side-nav .nav-user .img-box h1{font-size:38px;margin:7px 13px}at-side-nav .nav-user .img-box .add-photo{position:absolute;width:16px;height:16px;left:70px;top:71px;background:#a7a8ac;border-radius:100%;display:flex;justify-content:center;align-items:center}at-side-nav .nav-user .img-box .add-photo .mat-icon{width:10px;height:10px;font-size:9px;color:#fff}at-side-nav .nav-user .name-box{min-width:151px;margin-left:20px;color:var(--dark-text-med)}at-side-nav .nav-user .name-box h2{font-size:20px;font-weight:600;margin:29px 0 1px;line-height:24px}@media(min-width:1024px){at-side-nav.collapsed .primary .mdc-list-item{padding-left:0;padding-right:0}at-side-nav.collapsed .mat-list-text a.mat-line,at-side-nav.collapsed at-side-nav-item a.mat-line,at-side-nav.collapsed at-side-nav-item a.parent-nav{box-sizing:border-box;min-height:52px;width:100%;justify-content:center!important;padding:0!important;gap:0}at-side-nav.collapsed .title,at-side-nav.collapsed .nav-tag,at-side-nav.collapsed .arrow{display:none!important}at-side-nav.collapsed a.external mat-icon:not(.nav-icon){display:none!important}at-side-nav.collapsed .nav-icon{margin:0 auto}at-side-nav.collapsed at-side-nav-item .mat-mdc-list-item{width:auto;min-height:52px;display:flex!important}at-side-nav.collapsed at-side-nav-item .mat-mdc-list-item.active{background-color:var(--primary-warm-gray)}}\n"],encapsulation:2})}}It([(0,G.bL)(y.NR.platinumLevel)],ot.prototype,"platinumLevel",void 0),It([(0,G.bL)(y.NR.platinum)],ot.prototype,"isPlatinum",void 0),It([(0,G.bL)(y.NR.organization)],ot.prototype,"organization",void 0),It([(0,x.l6)(y.bM.user)],ot.prototype,"user$",void 0),It([(0,G.bL)(y.bM.type)],ot.prototype,"userType",void 0),It([(0,G.bL)(y.bM.userId)],ot.prototype,"userId",void 0);
3var Pa=r(70786),Ra=r(15778),Oa=r(8982),ka=r(25621),ke=r(62023),Ea=r(48362),Da=r(48293),Fa=r(93417),Tt=function(i,o,e,n){var l,a=arguments.length,s=a<3?o:null===n?n=Object.getOwnPropertyDescriptor(o,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(i,o,e,n);else for(var d=i.length-1;d>=0;d--)(l=i[d])&&(s=(a<3?l(s):a>3?l(o,e,s):l(o,e))||s);return a>3&&s&&Object.defineProperty(o,e,s),s};function Aa(i,o){if(1&i){const e=t.RV6();t.j41(0,"button",12),t.bIt("click",function(){p.eBV(e);const a=t.XpG(3);return p.Njj(a.reviewActions())}),t.j41(1,"mat-icon",13),t.EFF(2,"ads_click"),t.k0s(),t.j41(3,"span"),t.EFF(4,"Actions to review"),t.k0s()()}}function Na(i,o){if(1&i){const e=t.RV6();t.j41(0,"button",14),t.nI1(1,"async"),t.bIt("click",function(){p.eBV(e);const a=t.XpG(3);return p.Njj(a.toggleDrawer())}),t.j41(2,"mat-icon",15),t.EFF(3,"explore"),t.k0s()()}if(2&i){const e=t.XpG(3);t.AVh("drawer-toggle--active",t.bMT(1,2,e.isDrawerOpen$))}}function $a(i,o){if(1&i&&(t.nVh(0,Aa,5,0,"button",9),t.nI1(1,"async"),t.nVh(2,Na,4,4,"button",10),t.nI1(3,"async"),t.nrm(4,"at-notification-bell",11)),2&i){const e=t.XpG(2);t.vxM(t.bMT(1,2,e.showActionsToReview$)?0:-1),t.R7$(2),t.vxM(t.bMT(3,4,e.isCompassChatVisible$)?2:-1)}}function Ga(i,o){if(1&i&&(t.qex(0),t.nVh(1,$a,5,6),t.nI1(2,"async"),t.bVm()),2&i){const e=t.XpG();t.R7$(),t.vxM("Active"!==t.bMT(2,1,e.siteStatus$)||e.isPortfolioSummary?-1:1)}}function ja(i,o){if(1&i){const e=t.RV6();t.j41(0,"mat-toolbar",8),t.EFF(1),t.j41(2,"a",16),t.bIt("click",function(){p.eBV(e);const a=t.XpG();return p.Njj(a.authService.logout(null,!0))}),t.EFF(3,"Log out as user"),t.k0s()()}if(2&i){const e=t.XpG();t.R7$(),t.SpI(" You are now viewing the dashboard as ",e.parsedUserToken.actAsUser.name,". ")}}class st{constructor(o,e,n,a,s,l){this.sideNavService=o,this.authService=e,this.rightDrawerService=n,this.launchDarklyService=a,this.actionCenterService=s,this.router=l,this.destroy$=new v.B,this.siteDashPermission=u.Tz,this.toggleSidenav=new t.bkB,this.isDrawerOpen$=this.rightDrawerService.isOpen$,this.isCompassEnabled$=this.launchDarklyService.getFlagObservable(P.Bt.RAPTIVE_COMPASS_MY_DASHBOARD,!1),this.isActionCenterEnabled$=this.launchDarklyService.getFlagObservable(P.Bt.ACTION_CENTER,!1),this.siteId=""}ngOnInit(){this.isCompassChatVisible$=(0,C.z)([this.isCompassEnabled$,this.userSiteData$]).pipe((0,Mt.T)(([o,e])=>(0,ne.p)(o,e))),this.showActionsToReview$=(0,C.z)([this.isCompassEnabled$,this.isActionCenterEnabled$,this.userSiteData$,this.actionCenterService.actionsChanged$.pipe((0,Ft.Z)(void 0))]).pipe((0,xt.n)(([o,e,n])=>(this.siteId=n?.id??"",o&&e&&this.siteId?this.actionCenterService.getActions(this.siteId,"active").pipe((0,Mt.T)(a=>a.some(s=>s.priority<3)),(0,oe.W)(()=>(0,dt.of)(!1))):(0,dt.of)(!1))))}ngOnDestroy(){this.destroy$.next(void 0)}sidenav(){this.toggleSidenav.emit()}toggleDrawer(){this.rightDrawerService.toggle()}reviewActions(){var o=this;return(0,Me.A)(function*(){if(!o.siteId)return;const e=`/sites/${o.siteId}/dashboard`;o.router.url.split("#")[0]!==e&&!(yield o.router.navigateByUrl(e))||setTimeout(()=>{document.getElementById("action-center")?.scrollIntoView({behavior:"smooth",block:"start"})})})()}get parsedUserToken(){return this.authService.parsedToken}static{this.\u0275fac=function(e){return new(e||st)(t.rXU(Xt.G),t.rXU(et.uR),t.rXU(ie.F),t.rXU(N.I9),t.rXU(Ra.a),t.rXU(B.Ix))}}static{this.\u0275cmp=t.VBU({type:st,selectors:[["at-top-nav"]],inputs:{isPortfolioSummary:"isPortfolioSummary"},outputs:{toggleSidenav:"toggleSidenav"},standalone:!1,decls:15,vars:19,consts:[["color","primary",1,"mat-elevation-z4"],[1,"primary"],["data-cy","side-nav-toggle","mat-icon-button","","matTooltipPosition","below",1,"side-nav-toggle",3,"click","matTooltip"],["data-cy","header-logo",1,"logo",3,"service","serviceLevel","siteType"],[1,"sites","display-none-lt-desktop"],[3,"active"],[4,"ngxPermissionsOnly"],[1,"profile","display-none-phone"],[1,"impersonation-notice","mat-elevation-z4"],["data-cy","actions-review-badge","type","button","aria-label","Actions to review",1,"actions-review-badge"],["type","button","mat-icon-button","","aria-label","Toggle Raptive Compass assistant","matTooltip","Raptive Compass","matTooltipPosition","below",1,"drawer-toggle",3,"drawer-toggle--active"],[1,"notification-bell"],["data-cy","actions-review-badge","type","button","aria-label","Actions to review",1,"actions-review-badge",3,"click"],["aria-hidden","true"],["type","button","mat-icon-button","","aria-label","Toggle Raptive Compass assistant","matTooltip","Raptive Compass","matTooltipPosition","below",1,"drawer-toggle",3,"click"],["fontSet","material-icons-outlined",1,"drawer-toggle__icon"],[3,"click"]],template:function(e,n){if(1&e&&(t.j41(0,"mat-toolbar",0)(1,"div",1)(2,"button",2),t.bIt("click",function(){return n.sidenav()}),t.j41(3,"mat-icon"),t.EFF(4),t.k0s()(),t.nrm(5,"at-logo",3),t.nI1(6,"async"),t.nI1(7,"async"),t.nI1(8,"async"),t.nrm(9,"at-sites",4)(10,"at-bouncing-dot-loader",5),t.nI1(11,"async"),t.k0s(),t.DNE(12,Ga,3,3,"ng-container",6),t.nrm(13,"at-profile",7),t.k0s(),t.nVh(14,ja,4,1,"mat-toolbar",8)),2&e){let a;t.R7$(2),t.AVh("side-nav-toggle--collapsed",n.sideNavService.collapsed),t.Y8G("matTooltip",n.sideNavService.collapsed?"Expand navigation":"Collapse navigation"),t.BMQ("aria-label",n.sideNavService.collapsed?"Expand navigation":"Collapse navigation"),t.R7$(2),t.JRh(n.sideNavService.isOpen?"clear":"menu"),t.R7$(),t.Y8G("service",t.bMT(6,11,n.service$))("serviceLevel",t.bMT(7,13,n.serviceLevel$))("siteType",null==(a=t.bMT(8,15,n.userSiteData$))?null:a.siteType),t.R7$(5),t.Y8G("active",t.bMT(11,17,n.topNavLoading$)),t.R7$(2),t.Y8G("ngxPermissionsOnly",n.siteDashPermission),t.R7$(2),t.vxM(n.parsedUserToken&&n.parsedUserToken.actAsUser?14:-1)}},dependencies:[Oa.p,ka.Z,ke.iY,wt.An,Ea.KQ,Zt.oV,S.f6,Da.w,Fa.n,Re.g,g.Jj],styles:[".mat-toolbar[_ngcontent-%COMP%]{display:flex;height:64px;align-items:center;justify-content:space-between}.mat-toolbar[_ngcontent-%COMP%] .primary[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;width:100%}.mat-toolbar[_ngcontent-%COMP%] .mat-form-field-underline[_ngcontent-%COMP%]{background-color:var(--edges)}.mat-toolbar[_ngcontent-%COMP%] .side-nav-toggle[_ngcontent-%COMP%]{--mat-icon-button-state-layer-size: 48px;--mat-icon-button-container-shape: 12px;--mat-icon-button-state-layer-color: var(--dark-text-high);--mat-icon-button-hover-state-layer-opacity: .1;--mat-icon-button-focus-state-layer-opacity: .14;--mat-icon-button-pressed-state-layer-opacity: .18;--mat-icon-button-ripple-color: color-mix( in srgb, var(--dark-text-high) 24%, transparent );position:absolute;top:50%;left:8px;transform:translateY(-50%);flex:0 0 auto;box-sizing:border-box;width:48px;height:48px;padding:0;margin:0;display:inline-flex;align-items:center;justify-content:center;border-radius:12px;background:transparent;transition:background .15s ease}.mat-toolbar[_ngcontent-%COMP%] .side-nav-toggle[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple[_ngcontent-%COMP%]:before, .mat-toolbar[_ngcontent-%COMP%] .side-nav-toggle[_ngcontent-%COMP%] .mat-mdc-button-ripple[_ngcontent-%COMP%]{border-radius:12px}.mat-toolbar[_ngcontent-%COMP%] .side-nav-toggle[_ngcontent-%COMP%]:hover:not(.side-nav-toggle--collapsed){background:color-mix(in srgb,var(--dark-text-high) 8%,transparent)}.mat-toolbar[_ngcontent-%COMP%] .side-nav-toggle[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{width:28px;height:28px;font-size:28px;line-height:28px;margin:0;overflow:visible;color:var(--dark-text-high)}.mat-toolbar[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{width:159px;min-width:159px}.mat-toolbar[_ngcontent-%COMP%] .sites[_ngcontent-%COMP%]{margin:0 16px;color:var(--dark-text-high)}.mat-toolbar[_ngcontent-%COMP%] at-notification-bell[_ngcontent-%COMP%]{position:relative;right:10px}.mat-toolbar[_ngcontent-%COMP%] .actions-review-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;flex:0 0 auto;gap:6px;min-height:32px;padding:5px 12px;border:1px solid var(--dark-text-high);border-radius:999px;color:var(--dark-text-high);background:var(--primary-spark-yellow);font-family:inherit;font-size:12px;font-weight:800;white-space:nowrap;cursor:pointer}.mat-toolbar[_ngcontent-%COMP%] .actions-review-badge[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{width:18px;height:18px;font-size:18px}.mat-toolbar[_ngcontent-%COMP%] .actions-review-badge[_ngcontent-%COMP%]:hover, .mat-toolbar[_ngcontent-%COMP%] .actions-review-badge[_ngcontent-%COMP%]:focus-visible{box-shadow:0 0 0 2px #ffffff73}.mat-toolbar[_ngcontent-%COMP%] .drawer-toggle[_ngcontent-%COMP%]{order:10;margin-right:0;margin-left:12px;display:inline-flex;align-items:center;justify-content:center;color:#bdb9ff;transition:color .15s ease}.mat-toolbar[_ngcontent-%COMP%] .drawer-toggle[_ngcontent-%COMP%] .drawer-toggle__icon[_ngcontent-%COMP%]{display:block;width:26px;height:26px;font-size:26px;line-height:26px;overflow:visible;color:inherit}.mat-toolbar[_ngcontent-%COMP%] .drawer-toggle[_ngcontent-%COMP%]:hover{color:#e2e0ff}.mat-toolbar[_ngcontent-%COMP%] .drawer-toggle.drawer-toggle--active[_ngcontent-%COMP%]{color:#fff}.impersonation-notice[_ngcontent-%COMP%]{text-align:center;height:18px;min-height:18px;justify-content:center;font-size:16px;padding:18px 0;background-color:var(--primary-energy-orange)}.impersonation-notice[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{margin-left:8px;font-size:15px}@media(min-width:1024px){.mat-toolbar[_ngcontent-%COMP%] .side-nav-toggle[_ngcontent-%COMP%]{position:relative;top:auto;left:auto;transform:none}.mat-toolbar[_ngcontent-%COMP%] .side-nav-toggle.side-nav-toggle--collapsed[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--secondary-catalyst-purple) 46%,transparent);border:1px solid var(--light-text-low)}.mat-toolbar[_ngcontent-%COMP%] .side-nav-toggle.side-nav-toggle--collapsed[_ngcontent-%COMP%]:hover{background:var(--primary-catalyst-purple)}}@media(max-width:1023px){.mat-toolbar[_ngcontent-%COMP%]{justify-content:center}.mat-toolbar[_ngcontent-%COMP%] .primary[_ngcontent-%COMP%]{margin:0 auto;justify-content:center}.mat-toolbar[_ngcontent-%COMP%] at-bouncing-dot-loader[_ngcontent-%COMP%]{position:absolute;
3left:calc(50% + 60px)}}@media(max-width:400px){.mat-toolbar[_ngcontent-%COMP%] .drawer-toggle[_ngcontent-%COMP%]{position:absolute;right:10px;top:12px}.mat-toolbar[_ngcontent-%COMP%] at-notification-bell[_ngcontent-%COMP%]{position:absolute;right:52px;top:14px}.mat-toolbar[_ngcontent-%COMP%] .actions-review-badge[_ngcontent-%COMP%]{position:absolute;top:16px;right:94px;justify-content:center;width:32px;padding:0}.mat-toolbar[_ngcontent-%COMP%] .actions-review-badge[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:none}}"]})}}Tt([(0,x.l6)(y.NR.service)],st.prototype,"service$",void 0),Tt([(0,x.l6)(y.NR.serviceLevel)],st.prototype,"serviceLevel$",void 0),Tt([(0,x.l6)(y.NR.siteStatus)],st.prototype,"siteStatus$",void 0),Tt([(0,x.l6)(y.NR)],st.prototype,"userSiteData$",void 0),Tt([(0,x.l6)(y.bM.user)],st.prototype,"user$",void 0),Tt([(0,x.l6)(Pa.p.topNavLoading)],st.prototype,"topNavLoading$",void 0);var La=r(66185),Ua=r(64785),Ba=r(70421),se=r(98949);const re="compassConversation";let Ya=(()=>{class i{load(e){const n=se.Ay.getItem(re);if(!n)return null;try{const a=JSON.parse(n);return a?.conversationId&&a?.siteId&&a?.topic&&a?.expiresAt?a.siteId!==e?null:Date.now()>a.expiresAt?(this.clear(),null):{conversationId:a.conversationId,siteId:a.siteId,topic:a.topic}:(this.clear(),null)}catch{return this.clear(),null}}save(e){if(!e?.conversationId||!e?.siteId||!e?.topic)return;const n={conversationId:e.conversationId,siteId:e.siteId,topic:e.topic,expiresAt:Date.now()+288e5};se.Ay.setItem(re,JSON.stringify(n))}clear(){se.Ay.removeItem(re)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=p.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Xa=(()=>{class i{constructor(e){this.http=e,this.baseUrl="/api/v2/compass"}getConversations(e){return this.http.get(`${this.baseUrl}/conversations?siteId=${encodeURIComponent(e)}`).pipe((0,Mt.T)(n=>(n.conversations??[]).filter(a=>!!a.title?.trim()||!!a.firstUserMessage?.content).slice(0,6)))}submitMessageFeedback(e,n,a,s){return this.http.post(`${this.baseUrl}/conversation/${encodeURIComponent(e)}/message/${encodeURIComponent(n)}/feedback`,{rating:a,...s?.trim()?{comment:s.trim()}:{}})}static{this.\u0275fac=function(n){return new(n||i)(p.KVO(Qt.Qq))}}static{this.\u0275prov=p.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();const Wa=["timeline"],Ha=["composerInput"];function Ka(i,o){if(1&i){const e=t.RV6();t.j41(0,"div",25)(1,"button",26),t.bIt("click",function(){p.eBV(e);const a=t.XpG();return p.Njj(a.returnToHome())}),t.j41(2,"mat-icon"),t.EFF(3,"arrow_back"),t.k0s(),t.EFF(4," Back "),t.k0s(),t.j41(5,"button",27),t.bIt("click",function(){p.eBV(e);const a=t.XpG();return p.Njj(a.startNewConversation())}),t.j41(6,"mat-icon"),t.EFF(7,"add"),t.k0s(),t.EFF(8," New conversation "),t.k0s()()}}function Qa(i,o){1&i&&(t.j41(0,"div",36),t.EFF(1," Loading conversations... "),t.k0s())}function Ja(i,o){if(1&i){const e=t.RV6();t.j41(0,"button",39),t.bIt("click",function(){const a=p.eBV(e).$implicit,s=t.XpG(4);return p.Njj(s.resumeConversation(a))}),t.j41(1,"span",40),t.EFF(2),t.k0s(),t.j41(3,"span",41),t.EFF(4),t.nI1(5,"date"),t.k0s()()}if(2&i){const e=o.$implicit,n=t.XpG(4);t.R7$(2),t.SpI(" ",n.getConversationTitle(e)," "),t.R7$(2),t.SpI(" ",t.i5U(5,2,e.updatedAt,"medium")," ")}}function Za(i,o){if(1&i&&(t.j41(0,"div",37),t.DNE(1,Ja,6,5,"button",38),t.k0s()),2&i){const e=t.XpG(3);t.R7$(),t.Y8G("ngForOf",e.recentConversations)("ngForTrackBy",e.trackByConversationId)}}function qa(i,o){if(1&i&&(t.j41(0,"div",32)(1,"h4"),t.EFF(2,"Recent conversations"),t.k0s(),t.j41(3,"p",33),t.EFF(4," Conversations expire after 30 days. "),t.k0s(),t.DNE(5,Qa,2,0,"div",34)(6,Za,2,2,"div",35),t.k0s()),2&i){const e=t.XpG(2);t.R7$(5),t.Y8G("ngIf",e.conversationsLoading),t.R7$(),t.Y8G("ngIf",!e.conversationsLoading)}}function to(i,o){if(1&i){const e=t.RV6();t.j41(0,"button",42),t.bIt("click",function(){const a=p.eBV(e).$implicit,s=t.XpG(2);return p.Njj(s.applySuggestion(a))}),t.j41(1,"span",43)(2,"mat-icon"),t.EFF(3),t.k0s()(),t.j41(4,"span",44)(5,"strong"),t.EFF(6),t.k0s(),t.j41(7,"small"),t.EFF(8),t.k0s()()()}if(2&i){const e=o.$implicit;t.R7$(),t.Y8G("ngClass","icon--"+e.iconTone),t.R7$(2),t.JRh(e.icon),t.R7$(3),t.JRh(e.title),t.R7$(2),t.JRh(e.description)}}function eo(i,o){if(1&i&&(t.j41(0,"div",28),t.DNE(1,qa,7,2,"div",29),t.j41(2,"h4"),t.EFF(3,"Suggested actions"),t.k0s(),t.j41(4,"div",30),t.DNE(5,to,9,4,"button",31),t.k0s()()),2&i){const e=t.XpG();
3t.R7$(),t.Y8G("ngIf",e.recentConversations.length||e.conversationsLoading),t.R7$(4),t.Y8G("ngForOf",e.suggestions)}}function no(i,o){1&i&&(t.j41(0,"span",56),t.EFF(1,"..."),t.k0s())}function io(i,o){if(1&i&&(t.j41(0,"div",54),t.DNE(1,no,2,0,"span",55),t.k0s()),2&i){const e=t.XpG().$implicit;t.R7$(),t.Y8G("ngIf",e.isStreaming)}}function ao(i,o){if(1&i){const e=t.RV6();t.j41(0,"a",59),t.bIt("click",function(a){const s=p.eBV(e).$implicit,l=t.XpG(4);return p.Njj(l.openReferenceLink(a,s))}),t.EFF(1),t.k0s()}if(2&i){const e=o.$implicit,n=t.XpG(4);t.Y8G("href",e.url,t.B4B),t.BMQ("target",n.isExternalUrl(e.url)?"_blank":null)("rel",n.isExternalUrl(e.url)?"noopener noreferrer":null),t.R7$(),t.SpI(" ",e.label," ")}}function oo(i,o){if(1&i&&(t.j41(0,"div",57),t.DNE(1,ao,2,4,"a",58),t.k0s()),2&i){const e=t.XpG().$implicit;t.R7$(),t.Y8G("ngForOf",e.links)}}function so(i,o){1&i&&(t.j41(0,"span",65),t.EFF(1," Feedback sent "),t.k0s())}function ro(i,o){1&i&&(t.j41(0,"span",66),t.EFF(1," Feedback failed "),t.k0s())}function lo(i,o){if(1&i){const e=t.RV6();t.j41(0,"div",60)(1,"button",61),t.bIt("click",function(){p.eBV(e);const a=t.XpG().$implicit,s=t.XpG(2);return p.Njj(s.openFeedbackDialog(a,"positive"))}),t.j41(2,"mat-icon"),t.EFF(3,"thumb_up"),t.k0s()(),t.j41(4,"button",62),t.bIt("click",function(){p.eBV(e);const a=t.XpG().$implicit,s=t.XpG(2);return p.Njj(s.openFeedbackDialog(a,"negative"))}),t.j41(5,"mat-icon"),t.EFF(6,"thumb_down"),t.k0s()(),t.DNE(7,so,2,0,"span",63)(8,ro,2,0,"span",64),t.k0s()}if(2&i){const e=t.XpG().$implicit,n=t.XpG(2);t.R7$(),t.AVh("is-selected","positive"===e.feedbackRating),t.Y8G("disabled",n.isFeedbackButtonDisabled(e)),t.BMQ("aria-pressed","positive"===e.feedbackRating),t.R7$(3),t.AVh("is-selected","negative"===e.feedbackRating),t.Y8G("disabled",n.isFeedbackButtonDisabled(e)),t.BMQ("aria-pressed","negative"===e.feedbackRating),t.R7$(3),t.Y8G("ngIf","submitted"===e.feedbackStatus),t.R7$(),t.Y8G("ngIf","error"===e.feedbackStatus)}}function co(i,o){if(1&i){const e=t.RV6();t.j41(0,"button",42),t.bIt("click",function(){p.eBV(e);const a=t.XpG(4);return p.Njj(a.retryFailedPrompt())}),t.EFF(1," Retry "),t.k0s()}}function po(i,o){if(1&i&&(t.j41(0,"div",67)(1,"mat-icon"),t.EFF(2,"error_outline"),t.k0s(),t.j41(3,"div",68)(4,"p"),t.EFF(5),t.k0s(),t.DNE(6,co,2,0,"button",69),t.k0s()()),2&i){const e=t.XpG(3);t.R7$(5),t.JRh(e.streamError),t.R7$(),t.Y8G("ngIf",e.lastFailedPrompt&&!e.isChatDisabled)}}function ho(i,o){if(1&i&&(t.j41(0,"span",70),t.EFF(1),t.nI1(2,"date"),t.k0s()),2&i){const e=t.XpG().$implicit;t.R7$(),t.SpI(" ",t.i5U(2,1,e.createdAt,"shortTime")," ")}}function go(i,o){if(1&i){const e=t.RV6();t.j41(0,"li")(1,"div",47)(2,"div",48),t.bIt("click",function(a){p.eBV(e);const s=t.XpG(2);return p.Njj(s.onMessageContentClick(a))}),t.k0s(),t.DNE(3,io,2,1,"div",49)(4,oo,2,1,"div",50)(5,lo,9,10,"div",51)(6,po,7,2,"div",52)(7,ho,3,4,"span",53),t.k0s()()}if(2&i){const e=o.$implicit,n=t.XpG(2);t.R7$(),t.AVh("message-card--user","user"===e.source)("message-card--agent","agent"===e.source)("message-card--error",e.id===n.errorRowId&&n.streamError),t.R7$(),t.Y8G("innerHTML",e.contentHtml,t.npT),t.R7$(),t.Y8G("ngIf",e.isStreaming),t.R7$(),t.Y8G("ngIf",(null==e.links?null:e.links.length)&&!e.isStreaming&&!e.hasContentLinks),t.R7$(),t.Y8G("ngIf",n.showFeedbackControls(e)),t.R7$(),t.Y8G("ngIf",e.id===n.errorRowId&&n.streamError),t.R7$(),t.Y8G("ngIf","user"===e.source)}}function mo(i,o){if(1&i&&(t.j41(0,"ul",45),t.DNE(1,go,8,12,"li",46),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.Y8G("ngForOf",e.messageRows)("ngForTrackBy",e.trackByRowId)}}function uo(i,o){if(1&i&&(t.j41(0,"div",71)(1,"span",72),t.EFF(2),t.k0s(),t.j41(3,"span",73),t.nrm(4,"span")(5,"span")(6,"span"),t.k0s()()),2&i){const e=t.XpG();t.R7$(2),t.JRh(e.typingLabel)}}function fo(i,o){if(1&i&&(t.j41(0,"div",74)(1,"mat-icon"),t.EFF(2,"error_outline"),t.k0s(),t.j41(3,"span"),t.EFF(4),t.k0s()()),2&i){const e=t.XpG();t.R7$(4),t.JRh(e.chatDisabledMessage)}}function bo(i,o){if(1&i&&(t.j41(0,"p",83),t.EFF(1),t.k0s()),2&i){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.feedbackSubmitError," ")}}function _o(i,o){if(1&i){const e=t.RV6();t.j41(0,"div",75),t.bIt("click",function(){p.eBV(e);const a=t.XpG();return p.Njj(a.closeFeedbackDialog())}),t.j41(1,"section",76),t.bIt("click",function(a){return p.eBV(e),p.Njj(a.stopPropagation())}),t.j41(2,"h3",77),t.EFF(3,"Thank you for your feedback!"),t.k0s(),t.j41(4,"p"),t.EFF(5,"Please share any additional details so we can better meet your needs."),t.k0s(),t.j41(6,"textarea",78),t.bIt("input",function(a){p.eBV(e);const s=t.XpG();return p.Njj(s.onFeedbackCommentInput(a))}),t.k0s(),t.DNE(7,bo,2,1,"p",79),t.j41(8,"div",80)(9,"button",81),t.bIt("click",function(){p.eBV(e);const a=t.XpG();return p.Njj(a.closeFeedbackDialog())}),t.EFF(10," Close "),t.k0s(),t.j41(11,"button",82),t.bIt("click",function(){p.eBV(e);const a=t.XpG();return p.Njj(a.submitFeedback())}),t.EFF(12),t.k0s()()()()}if(2&i){const e=t.XpG();t.R7$(6),t.Y8G("value",e.feedbackComment),t.R7$(),t.Y8G("ngIf",e.feedbackSubmitError),t.R7$(2),t.Y8G("disabled",e.feedbackSubmitting),t.R7$(2),t.Y8G("disabled",e.feedbackSubmitting),t.R7$(),t.SpI(" ",e.feedbackSubmitting?"Submitting...":"Submit"," ")}}
3const Ee="COMPASS_TOKEN_LIMIT_EXCEEDED",At="token_limit_reached",vt="This chat has reached its token limit. Please start a new chat to continue with Compass AI.",Ht="Limit reached",yo=/@@compass-inline-html-(\d+)@@/g,Pt=/^(\s*)(\d+)[.)]\s+([\s\S]*)$/;let So=(()=>{class i{constructor(e,n,a,s,l,d,b){this.rightDrawerService=e,this.http=n,this.messageConnectionService=a,this.router=s,this.conversationStore=l,this.compassChatService=d,this.store=b,this.promptDraft="",this.currentSiteId="",this.conversationId="",this.activeTopic="",this.statusText="Ready",this.streamError="",this.createInFlight=!1,this.sendInFlight=!1,this.awaitingAgentResponse=!1,this.messageRows=[],this.recentConversations=[],this.conversationsLoading=!1,this.lastFailedPrompt="",this.chatDisabledMessage="",this.chatDisabledReason="",this.errorRowId="",this.feedbackDialogOpen=!1,this.feedbackComment="",this.feedbackSubmitError="",this.feedbackSubmitting=!1,this.activeFeedbackMessageId="",this.activeFeedbackRating="positive",this.pendingUserRowId="",this.suggestions=[{title:"Optimize my RPM",description:"Which pages need attention?",prompt:"Which of my pages need the most attention to improve my RPM?",icon:"bolt",iconTone:"amber"},{title:"Traffic Insights",description:"What are my top traffic sources?",prompt:"What are my top traffic sources?",icon:"bar_chart",iconTone:"blue"},{title:"Top Content",description:"Which pages are popular right now?",prompt:"Which pages are popular right now?",icon:"thumb_up",iconTone:"slate"}],this.destroy$=new v.B,this.topicDestroy$=new v.B,this.autoScrollPinned=!0,this.pendingScroll=!1,this.streamWatchdogState="ok",this.lastStreamedPrompt="",this.lastActiveSiteId="",this.activeConversationSiteId="",this.conversationLoadRequestId=0,this.pendingConversationActivation=null}ngOnInit(){this.watchSiteContext(),(0,C.z)([this.rightDrawerService.promptDraft$,this.rightDrawerService.isOpen$,this.rightDrawerService.promptStartsNewConversation$]).pipe((0,E.Q)(this.destroy$)).subscribe(([e,n,a])=>{!e||!n||(a&&(this.resetConversationState(),this.conversationStore.clear()),this.promptDraft=e,this.sendPrompt(e),this.rightDrawerService.setPromptDraft(""))}),this.rightDrawerService.isOpen$.pipe((0,Ft.Z)(!1),(0,La.J)(),(0,K.p)(([e,n])=>!e&&n),(0,E.Q)(this.destroy$)).subscribe(()=>{this.autoScrollPinned=!0,this.pendingScroll=!0,this.loadRecentConversations()})}ngOnDestroy(){this.clearStreamWatchdog(),this.topicDestroy$.next(),this.topicDestroy$.complete(),this.destroy$.next(),this.destroy$.complete()}ngAfterViewChecked(){this.pendingScroll&&this.autoScrollPinned&&(this.scrollTimelineToBottom(),this.pendingScroll=!1)}onTimelineScroll(){const e=this.timelineRef?.nativeElement;e&&(this.autoScrollPinned=e.scrollHeight-e.scrollTop-e.clientHeight<80)}scrollTimelineToBottom(){const e=this.timelineRef?.nativeElement;e&&(e.scrollTop=e.scrollHeight)}watchSiteContext(){this.store.select(y.NR.siteID).pipe((0,Ft.Z)(this.store.selectSnapshot(y.NR.siteID)??""),(0,Ua.F)(),(0,E.Q)(this.destroy$)).subscribe(e=>this.handleSiteContextChange(e??""))}handleSiteContextChange(e){const n=e??"",a=!!n&&!!this.lastActiveSiteId&&this.lastActiveSiteId!==n,s=n!==this.currentSiteId;return this.currentSiteId=n,n&&(this.lastActiveSiteId=n),n?a?(this.resetConversationState(),this.conversationStore.clear(),this.recentConversations=[],void this.loadRecentConversations({ensureActiveConversation:!0})):void this.loadRecentConversations():(s&&(this.resetConversationState(),this.conversationStore.clear()),this.recentConversations=[],void(this.conversationsLoading=!1))}closeDrawer(){this.rightDrawerService.close()}startNewConversation(){this.resetConversationState(),this.conversationStore.clear(),this.loadRecentConversations()}returnToHome(){this.startNewConversation()}resumeConversation(e){if(!e?.conversationId||!e?.topic||this.isAgentResponding||e.conversationId===this.conversationId)return;const n=e.siteId??this.currentSiteId;!n||n!==this.currentSiteId||this.activateConversation(e,{isRestore:!0,siteId:n})}trackByConversationId(e,n){return n.conversationId}getConversationTitle(e){return e.title?.trim()||e.firstUserMessage?.content||"Compass conversation"}openReferenceLink(e,n){e.preventDefault(),n?.url&&this.openLinkUrl(n.url)}onMessageContentClick(e){const s=e.target?.closest("a")?.getAttribute("href");s&&(e.preventDefault(),this.openLinkUrl(s))}isExternalUrl(e){const n=this.parseUrl(e);return!!n&&n.origin!==window.location.origin}submitPrompt(){this.sendPrompt(this.promptDraft)}get isAgentResponding(){return this.awaitingAgentResponse||this.messageRows.some(e=>e.isStreaming)}get isChatDisabled(){return!!this.chatDisabledMessage}get isSubmitDisabled(){return!this.currentSiteId||!this.promptDraft.trim()||this.createInFlight||this.sendInFlight||this.isAgentResponding||this.isChatDisabled}get showTypingIndicator(){return this.awaitingAgentResponse||"reconnecting"===this.streamWatchdogState}get typingLabel(){return"reconnecting"===this.streamWatchdogState?"Reconnecting":"Thinking"}onComposerKeydown(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),this.submitPrompt())}onComposerInput(e){const n=e.target;
3n&&(this.promptDraft=n.value,n.style.height="auto",n.style.height=`${Math.min(n.scrollHeight,150)}px`)}resetComposerHeight(){const e=this.composerInputRef?.nativeElement;e&&(e.style.height="auto")}applySuggestion(e){this.sendPrompt(e.prompt)}trackByRowId(e,n){return n.id}retryFailedPrompt(){!this.lastFailedPrompt||this.isChatDisabled||(this.errorRowId&&(this.messageRows=this.messageRows.filter(e=>e.id!==this.errorRowId),this.errorRowId=""),this.streamError="",this.promptDraft=this.lastFailedPrompt,this.activeTopic&&this.connectToTopic(this.activeTopic),this.sendPrompt(this.lastFailedPrompt))}showFeedbackControls(e){return"agent"===e.source&&!!e.feedbackEnabled&&!e.isStreaming}isFeedbackButtonDisabled(e){return"submitting"===e.feedbackStatus||"submitted"===e.feedbackStatus}openFeedbackDialog(e,n){!this.conversationId||!this.showFeedbackControls(e)||this.isFeedbackButtonDisabled(e)||(this.activeFeedbackMessageId=e.id,this.activeFeedbackRating=n,this.feedbackComment="",this.feedbackSubmitError="",this.feedbackDialogOpen=!0)}closeFeedbackDialog(){this.feedbackSubmitting||(this.feedbackDialogOpen=!1,this.feedbackComment="",this.feedbackSubmitError="",this.activeFeedbackMessageId="")}onFeedbackCommentInput(e){const n=e.target;this.feedbackComment=n?.value??""}submitFeedback(){if(!this.conversationId||!this.activeFeedbackMessageId||this.feedbackSubmitting)return;const e=this.activeFeedbackMessageId,n=this.activeFeedbackRating,a=this.feedbackComment.trim();this.feedbackSubmitting=!0,this.feedbackSubmitError="",this.updateMessageFeedbackState(e,{feedbackRating:n,feedbackStatus:"submitting"}),this.compassChatService.submitMessageFeedback(this.conversationId,e,n,a).pipe((0,E.Q)(this.destroy$)).subscribe(()=>{this.feedbackSubmitting=!1,this.updateMessageFeedbackState(e,{feedbackRating:n,feedbackStatus:"submitted"}),this.closeFeedbackDialog()},()=>{this.feedbackSubmitting=!1,this.feedbackSubmitError="Could not send feedback. Try again.",this.updateMessageFeedbackState(e,{feedbackRating:n,feedbackStatus:"error"})})}sendPrompt(e){const n=e.trim(),a=this.getCurrentSiteId();if(!(!n||this.sendInFlight||this.createInFlight||this.isAgentResponding||this.isChatDisabled)){if(!a)return this.streamError="Select a site to use Raptive Compass.",void(this.statusText="No site selected");if(this.conversationId&&this.activeConversationSiteId!==a&&(this.resetConversationState(),this.conversationStore.clear()),this.autoScrollPinned=!0,this.pendingScroll=!0,this.streamError="",this.errorRowId="",this.pendingUserRowId=`pending-${Date.now()}`,this.upsertMessageRow({id:this.pendingUserRowId,source:"user",content:n,createdAt:(new Date).toISOString(),isOptimistic:!0}),this.promptDraft="",this.resetComposerHeight(),this.awaitingAgentResponse=!0,this.lastStreamedPrompt=n,this.statusText="Thinking...",this.armStreamWatchdog(),!this.conversationId)return void this.createConversationAndSend(n);this.sendMessage(n)}}buildMessageContext(){const e=this.getCurrentSiteId();return e?{siteId:e,siteName:this.store.selectSnapshot(y.NR.siteName)??null,currentPage:window.location.pathname}:null}createConversationAndSend(e){const n=this.getCurrentSiteId();if(!n)return this.awaitingAgentResponse=!1,this.clearStreamWatchdog(),this.streamError="Select a site to start chat.",this.lastFailedPrompt=e,this.errorRowId=this.lastUserRowId(),void(this.statusText="No site selected");this.createConversationForSite(n,{prompt:e})}createConversationForSite(e,n={}){this.createInFlight=!0,this.streamError="",this.statusText="Starting chat...",this.http.post("/api/v2/compass/conversation",{siteId:e}).subscribe(a=>{this.isCurrentSiteRequest(e)&&(this.createInFlight=!1,this.conversationId=a.conversationId,this.activeConversationSiteId=a.siteId??e,this.activeTopic=a.topic,this.applyConversationLimitState(a),this.conversationStore.save({conversationId:a.conversationId,siteId:this.activeConversationSiteId,topic:a.topic}),this.connectToTopic(a.topic),n.prompt&&this.sendMessage(n.prompt),this.loadRecentConversations())},()=>{this.isCurrentSiteRequest(e)&&(this.createInFlight=!1,n.prompt&&(this.awaitingAgentResponse=!1,this.clearStreamWatchdog(),this.lastFailedPrompt=n.prompt,this.errorRowId=this.lastUserRowId(),this.pendingUserRowId="",this.streamError="Could not start chat. Try again."),this.statusText="Chat unavailable")})}sendMessage(e,n={allowSiteRecovery:!0}){if(this.isChatDisabled)return this.awaitingAgentResponse=!1,this.clearStreamWatchdog(),this.streamError=this.chatDisabledMessage,this.lastFailedPrompt="",this.errorRowId=this.lastUserRowId(),this.pendingUserRowId="",void(this.statusText=Ht);const a=this.buildMessageContext();if(!a)return this.awaitingAgentResponse=!1,this.clearStreamWatchdog(),this.streamError="Select a site to send a message.",this.lastFailedPrompt=e,this.errorRowId=this.lastUserRowId(),this.pendingUserRowId="",void(this.statusText="No site selected");this.sendInFlight=!0,this.awaitingAgentResponse=!0,this.streamError="",this.lastFailedPrompt="",this.statusText="Thinking...";const s=this.conversationId;this.http.post("/api/v2/compass/message",{conversationId:s,content:e,siteId:a.siteId,...a.siteName?{siteName:a.siteName}:{},currentPage:a.currentPage}).subscribe(l=>{this.conversationId!==s||!this.isCurrentSiteRequest(a.siteId)||(this.sendInFlight=!1,this.conversationId&&this.activeTopic&&this.conversationStore.save({conversationId:this.conversationId,siteId:a.siteId,topic:this.activeTopic}),this.loadRecentConversations(),this.reconcilePendingUserRowId(l.messageId))},l=>{if(!this.isCurrentSiteRequest(a.siteId))return;this.sendInFlight=!1;const d=this.getTokenLimitErrorMessage(l);if(!1===n.allowSiteRecovery||d||!this.isConversationSiteMismatchError(l))return this.awaitingAgentResponse=!1,this.clearStreamWatchdog(),d?(this.applyConversationLimitState({...this.getTokenLimitErrorMetadata(l),tokenLimitReached:!0,canSendMessages:!1,disabledReason:At,disabledMessage:d}),this.streamError=d,this.lastFailedPrompt="",this.statusText=Ht,this.errorRowId=this.lastUserRowId(),void(this.pendingUserRowId="")):(this.streamError="Message failed to send.",this.lastFailedPrompt=e,this.statusText="Send failed",this.errorRowId=this.lastUserRowId(),void(this.pendingUserRowId=""));this.recoverFromConversationSiteMismatch(e)})}connectToTopic(e,n={}){this.topicDestroy$.next(),this.statusText="Connecting...",this.messageConnectionService.getObservable(e).pi
3pe((0,E.Q)(this.topicDestroy$),(0,E.Q)(this.destroy$)).subscribe(a=>{this.handleTopicEnvelope(a.data)}),this.hydrateSnapshot(e,n)}resetConversationState(){this.clearStreamWatchdog(),this.topicDestroy$.next(),this.conversationId="",this.activeTopic="",this.activeConversationSiteId="",this.pendingConversationActivation=null,this.messageRows=[],this.streamError="",this.errorRowId="",this.pendingUserRowId="",this.lastFailedPrompt="",this.chatDisabledMessage="",this.chatDisabledReason="",this.lastStreamedPrompt="",this.feedbackDialogOpen=!1,this.feedbackComment="",this.feedbackSubmitError="",this.feedbackSubmitting=!1,this.activeFeedbackMessageId="",this.activeFeedbackRating="positive",this.awaitingAgentResponse=!1,this.sendInFlight=!1,this.createInFlight=!1,this.streamWatchdogState="ok",this.statusText="Ready",this.promptDraft="",this.autoScrollPinned=!0}loadRecentConversations(e={}){const n=this.currentSiteId;if(!n)return this.conversationsLoading=!1,void(this.recentConversations=[]);const a=++this.conversationLoadRequestId;e.ensureActiveConversation&&(this.pendingConversationActivation={siteId:n,preferNewConversation:e.preferNewConversation,retryPrompt:e.retryPrompt}),this.conversationsLoading=!0,this.compassChatService.getConversations(n).pipe((0,E.Q)(this.destroy$)).subscribe(s=>{if(!this.isCurrentSiteRequest(n))return;a===this.conversationLoadRequestId&&(this.conversationsLoading=!1,this.recentConversations=s);const l=this.consumePendingConversationActivation(n);l&&this.selectOrCreateConversationForSite(n,s,l)},()=>{if(!this.isCurrentSiteRequest(n)||a!==this.conversationLoadRequestId)return;this.conversationsLoading=!1,this.recentConversations=[];const s=this.consumePendingConversationActivation(n);s&&this.createConversationForSite(n,{prompt:s.retryPrompt})})}selectOrCreateConversationForSite(e,n,a={}){if(!this.isCurrentSiteRequest(e))return;const s=a.preferNewConversation?null:n[0];if(s)return this.activateConversation(s,{isRestore:!0,resetState:!1,siteId:e}),void(a.retryPrompt&&this.sendMessage(a.retryPrompt,{allowSiteRecovery:!1}));this.createConversationForSite(e,{prompt:a.retryPrompt})}activateConversation(e,n){this.isCurrentSiteRequest(n.siteId)&&(!1!==n.resetState&&this.resetConversationState(),this.clearPendingConversationActivation(n.siteId),this.conversationId=e.conversationId,this.activeConversationSiteId=n.siteId,this.activeTopic=e.topic,this.applyConversationLimitState(e),this.conversationStore.save({conversationId:e.conversationId,siteId:n.siteId,topic:e.topic}),this.connectToTopic(e.topic,{isRestore:n.isRestore}))}restoreStoredConversation(e){const n=this.conversationStore.load(e);n&&(this.conversationId=n.conversationId,this.activeConversationSiteId=n.siteId,this.activeTopic=n.topic,this.connectToTopic(n.topic,{isRestore:!0}))}consumePendingConversationActivation(e){const n=this.pendingConversationActivation;return n&&n.siteId===e?(this.pendingConversationActivation=null,{preferNewConversation:n.preferNewConversation,retryPrompt:n.retryPrompt}):null}clearPendingConversationActivation(e){this.pendingConversationActivation?.siteId===e&&(this.pendingConversationActivation=null)}getCurrentSiteId(){return this.currentSiteId||this.store.selectSnapshot(y.NR.siteID)||""}isCurrentSiteRequest(e,n){return e===this.currentSiteId&&(void 0===n||n===this.conversationLoadRequestId)}isConversationSiteMismatchError(e){const n=e?.error,a="string"==typeof n?n:n?.message??n?.error??"";return 409===e?.status&&`${a}`.includes("Conversation site does not match request site")}getTokenLimitErrorMetadata(e){const n=e?.error;return"object"==typeof n&&n?.metadata?n.metadata:{}}getTokenLimitErrorMessage(e){if(429!==e?.status)return"";const n=e?.error;if("string"==typeof n)return n.includes(Ee)||n.includes(vt)?vt:"";if(!n)return"";const a=n.metadata,s=Array.isArray(n.message)?n.message.join(" "):n.message;return n.internalCode===Ee||(n.disabledReason??a?.disabledReason)===At||n.detail===vt||s===vt||(n.disabledMessage??a?.disabledMessage)===vt?vt:""}applyConversationLimitState(e){if(e&&(void 0!==e.tokenLimitReached||void 0!==e.canSendMessages||void 0!==e.disabledReason||void 0!==e.disabledMessage||void 0!==e.totalTokens&&void 0!==e.tokenLimit)){if(!0!==e.tokenLimitReached&&!1!==e.canSendMessages&&e.disabledReason!==At&&!("number"==typeof e.totalTokens&&"number"==typeof e.tokenLimit&&e.totalTokens>=e.tokenLimit)){if(this.chatDisabledReason===At)return;return this.chatDisabledMessage="",void(this.chatDisabledReason="")}this.chatDisabledReason=e.disabledReason??At,this.chatDisabledMessage=vt,this.lastFailedPrompt="",this.awaitingAgentResponse=!1,this.sendInFlight=!1,this.createInFlight=!1,this.statusText=Ht,this.clearStreamWatchdog(),this.messageRows=this.messageRows.map(d=>d.isStreaming?{...d,isStreaming:!1}:d)}}recoverFromConversationSiteMismatch(e){if(!this.getCurrentSiteId())return this.awaitingAgentResponse=!1,this.clearStreamWatchdog(),this.streamError="Message failed to send.",this.lastFailedPrompt=e,this.errorRowId=this.lastUserRowId(),void(this.statusText="Send failed");this.topicDestroy$.next(),this.conversationId="",this.activeTopic="",this.activeConversationSiteId="",this.conversationStore.clear(),this.awaitingAgentResponse=!0,this.streamError="",this.lastFailedPrompt="",this.statusText="Reconnecting...",this.armStreamWatchdog(),this.loadRecentConversations({ensureActiveConversation:!0,preferNewConversation:!0,retryPrompt:e})}hydrateSnapshot(e,n={}){const a=this.conversationId;a&&this.http.get(`/api/v2/compass/conversation/${a}
3`).pipe((0,E.Q)(this.topicDestroy$),(0,E.Q)(this.destroy$)).subscribe(s=>{if(s.topic!==e||this.conversationId!==a||this.activeTopic!==e)return;n.isRestore&&(this.autoScrollPinned=!0,this.pendingScroll=!0);const l=this.isAgentResponding;this.applyConversationLimitState(s),this.applySnapshotMessages(s.messages),this.isChatDisabled||(l&&!this.isAwaitingAgent()&&(this.awaitingAgentResponse=!1,this.syncStreamWatchdog()),this.statusText="Connected",this.streamError="")},()=>{if(this.conversationId===a&&this.activeTopic===e){if(n.isRestore)return void this.discardStoredConversation();this.streamError="Could not load prior messages."}})}discardStoredConversation(){this.conversationStore.clear(),this.topicDestroy$.next(),this.conversationId="",this.activeTopic="",this.statusText="Ready"}handleTopicEnvelope(e){if(!e||e.topic!==this.activeTopic)return;if(this.applyConversationLimitState(e.payload),"snapshot"===e.mode&&e.payload.messages)return this.applySnapshotMessages(e.payload.messages),this.awaitingAgentResponse=this.isAwaitingAgent(),void this.syncStreamWatchdog();if("delta"!==e.mode||"agent"!==e.payload.source)return;const n=(e.payload.fullContent??e.payload.content??"").trim();n&&(this.upsertMessageRow({id:e.payload.messageId??`stream-${e.sequence}`,source:"agent",content:n,createdAt:e.sentAt,isOptimistic:!1,isStreaming:!e.payload.isFinal,isStreamed:!0,...e.payload.feedbackEnabled?{feedbackEnabled:!0}:{},...e.payload.links?{links:e.payload.links}:{}}),this.awaitingAgentResponse=!1,this.statusText=e.payload.isFinal?this.isChatDisabled?Ht:"Connected":"Assistant responding...",this.syncStreamWatchdog())}
3applySnapshotMessages(e){this.reconcilePendingUserRowByContent(e),this.reconcileStreamedAgentRowsByContent(e),e.forEach(n=>this.upsertMessageRow({id:n.id,source:n.source,content:n.content,createdAt:n.createdAt,isOptimistic:!1,isStreaming:!1,isStreamed:!1,...n.feedbackEnabled?{feedbackEnabled:!0}:{},...n.links?{links:n.links}:{}}))}isAwaitingAgent(){return"user"===this.messageRows[this.messageRows.length-1]?.source}reconcilePendingUserRowId(e){this.pendingUserRowId&&(this.renameMessageRow(this.pendingUserRowId,e),this.pendingUserRowId="")}reconcilePendingUserRowByContent(e){if(!this.pendingUserRowId)return;const n=this.messageRows.find(s=>s.id===this.pendingUserRowId);if(!n)return void(this.pendingUserRowId="");const a=e.find(s=>"user"===s.source&&s.content===n.content);a&&(this.renameMessageRow(this.pendingUserRowId,a.id),this.pendingUserRowId="")}reconcileStreamedAgentRowsByContent(e){e.filter(n=>"agent"===n.source).forEach(n=>{if(this.messageRows.some(s=>s.id===n.id))return;const a=this.messageRows.find(s=>s.isStreamed&&"agent"===s.source&&s.id!==n.id&&s.content.trim()===n.content.trim());a&&this.renameMessageRow(a.id,n.id)})}lastUserRowId(){for(let e=this.messageRows.length-1;e>=0;e-=1)if("user"===this.messageRows[e].source)return this.messageRows[e].id;return""}renameMessageRow(e,n){if(e!==n){if(this.messageRows.some(a=>a.id===n))return void(this.messageRows=this.messageRows.filter(a=>a.id!==e));this.messageRows=this.messageRows.map(a=>a.id===e?{...a,id:n}:a)}}updateMessageFeedbackState(e,n){this.messageRows=this.messageRows.map(a=>a.id===e?{...a,...n}:a)}upsertMessageRow(e){const n=this.withRenderedContent(e);this.pendingScroll=!0;const a=this.messageRows.findIndex(s=>s.id===n.id);if(-1===a)return this.messageRows=[...this.messageRows,n],void this.sortMessageRows();this.messageRows=this.messageRows.map((s,l)=>l===a?{...s,...n}:s)}withRenderedContent(e){const n=this.renderMarkdown(e.content);return{...e,contentHtml:n,hasContentLinks:/<a\b/i.test(n)}}renderMarkdown(e,n=0){const a=e.replace(/\r\n?|[\u2028\u2029]/g,"\n").split("\n"),s=[];let l=0;for(;l<a.length;){const d=a[l];if(!d.trim()){l+=1;continue}if(/^```/.test(d.trim())){const f=[];for(l+=1;l<a.length&&!/^```/.test(a[l].trim());)f.push(a[l]),l+=1;l+=l<a.length?1:0,s.push(`<pre><code>${this.escapeHtml(f.join("\n"))}</code></pre>`);continue}const b=/^(#{1,6})\s+(.+)$/.exec(d);if(b){const f=b[1].length;s.push(`<h${f}>${this.renderInlineMarkdown(b[2].trim())}</h${f}>`),l+=1;continue}if(this.isMarkdownTableStart(a,l)){const f=this.splitMarkdownTableRow(d),D=this.splitMarkdownTableRow(a[l+1]).map(R=>this.getMarkdownTableAlignment(R)),L=[];for(l+=2;l<a.length&&a[l].trim()&&this.isMarkdownTableRow(a[l])&&!this.isMarkdownTableDivider(a[l]);)L.push(this.splitMarkdownTableRow(a[l])),l+=1;s.push(this.renderMarkdownTable(f,L,D));continue}if(/^\s*[-*+]\s+/.test(d)){const f=[];for(;l<a.length&&/^\s*[-*+]\s+/.test(a[l]);)f.push(a[l].replace(/^\s*[-*+]\s+/,"")),l+=1;s.push(`<ul>${f.map(D=>`<li>${this.renderInlineMarkdown(D)}</li>`).join("")}</ul>`);continue}if(Pt.test(d)){const f=this.renderMarkdownOrderedList(a,l,n);if(f.nextIndex<=l){s.push(`<p>${this.renderInlineMarkdown(d)}</p>`),l+=1;continue}s.push(f.html),l=f.nextIndex;continue}if(/^>\s?/.test(d)){const f=[];for(;l<a.length&&/^>\s?/.test(a[l]);)f.push(a[l].replace(/^>\s?/,"")),l+=1;s.push(`<blockquote>${f.map(D=>this.renderInlineMarkdown(D)).join("<br>")}</blockquote>`);continue}const _=[d];for(l+=1;l<a.length&&a[l].trim()&&!/^```/.test(a[l].trim())&&!/^(#{1,6})\s+/.test(a[l])&&!this.isMarkdownTableStart(a,l)&&!/^\s*[-*+]\s+/.test(a[l])&&!Pt.test(a[l])&&!/^>\s?/.test(a[l]);)_.push(a[l]),l+=1;s.push(`<p>${_.map(f=>this.renderInlineMarkdown(f)).join("<br>")}</p>`)}return s.join("")}renderMarkdownOrderedList(e,n,a){const s=Pt.exec(e[n]),l=s?.[1].length??0,d=Number(s?.[2]??1),b=[];let _=n,f=!1;for(;_<e.length&&!f;){const R=Pt.exec(e[_]);if(!R||R[1].length!==l)break;const V=[R[3]];let z;for(_+=1;_<e.length&&Pt.exec(e[_])?.[1].length!==l;){if(!e[_].trim()){let nt=_+1;for(;nt<e.length&&!e[nt].trim();)nt+=1;if(Pt.exec(e[nt]??"")?.[1].length===l){_=nt;break}const Ct=/^(\s+)/.exec(e[nt]??"")?.[1].length;if(Ct&&Ct>l){V.push(""),_=nt;continue}f=!0;break}const ft=/^(\s+)/.exec(e[_])?.[1].length;if(!(ft&&ft>l)){f=!0;break}z??=ft,V.push(e[_].slice(Math.min(ft,z))),_+=1}b.push(V)}return{html:`<ol${1===d?"":` start="${d}"`}>${b.map(R=>`<li>${this.renderMarkdownListItem(R,a)}</li>`).join("")}</ol>`,nextIndex:_}}renderMarkdownListItem(e,n){const[a="",...s]=e,l=this.renderInlineMarkdown(a);return s.length?n>=8?`${l}<br>${s.map(b=>this.renderInlineMarkdown(b)).join("<br>")}`:`${l}${this.renderMarkdown(s.join("\n"),n+1).replace(/^<p>([\s\S]*?)<\/p>/,"<br>$1")}`:l}renderMarkdownTable(e,n,a){const s=Math.max(e.length,...n.map(b=>b.length));return`<table><thead><tr>${Array.from({length:s},(b,_)=>this.renderMarkdownTableCell("th",e[_]??"",a[_])).join("")}</tr></thead><tbody>${n.map(b=>`<tr>${Array.from({length:s},(f,D)=>this.renderMarkdownTableCell("td",b[D]??"",a[D])).join("")}</tr>`).join("")}</tbody></table>`}renderMarkdownTableCell(e,n,a){return`<${e}${a&&"left"!==a?` class="message-table__cell--${a}"`:""}>${this.renderInlineMarkdown(n)}</${e}>`}isMarkdownTableStart(e,n){return n+1<e.length&&this.isMarkdownTableRow(e[n])&&this.isMarkdownTableDivider(e[n+1])}isMarkdownTableRow(e){return e.trim().includes("|")}isMarkdownTableDivider(e){const n=this.splitMarkdownTableRow(e);return n.length>0&&n.every(a=>/^:?-{3,}:?$/.test(a))}splitMarkdownTableRow(e){const n=e.trim(),a=n.startsWith("|")?n.slice(1):n;return(a.endsWith("|")?a.slice(0,-1):a).split("|").map(l=>l.trim())}getMarkdownTableAlignment(e){const n=e.trim(),a=n.startsWith(":"),s=n.endsWith(":");return a&&s?"center":s?"right":"left"}renderInlineMarkdown(e){const n=[],a=l=>{const d=`@@compass-inline-html-${n.length}@@`;return n.push(l),d};let s=e.replace(/`([^`\n]+)`/g,(l,d)=>a(`<code>${this.escapeHtml(d)}</code>`));return s=s.replace(/\[([^\]\n]+)\]\s*\(([^)\s]+)\)/g,(l,d,b)=>{const _=this.normalizeLinkUrl(b);return a(_?this.buildMarkdownAnchor(_,this.renderMarkdownLinkLabel(d.trim()||_)):this.renderMarkdownLinkLabel(d.trim()||b))}),s=s.replace(/\bhttps?:\/\/[^\s<>"'`]+/gi,l=>{const d=this.normalizeLinkUrl(l);return d?`${a(this.buildMarkdownAnchor(d,this.escapeHtml(d)))}${l.slice(d.length)}`:l}),s=this.escapeHtml(s),s=this.applyInlineMarkdownFormatting(s),s.replace(yo,(l,d)=>n[Number(d)]??"")}renderMarkdownLinkLabel(e){return this.applyInlineMarkdownFormatting(this.escapeHtml(e))}applyInlineMarkdownFormatting(e){return e.replace(/\*\*([^*\n]+)\*\*/g,"<strong>$1</strong>").replace(/__([^_\n]+)__/g,"<strong>$1</strong>").replace(/~~([^~\n]+)~~/g,"<del>$1</del>").replace(/(^|[^\*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>").replace(/(^|[^_])_([^_\n]+)_(?!_)/g,"$1<em>$2</em>")}normalizeLinkUrl(e){let n=e.trim().replace(/^<(.+)>$/,"$1");for(;/[.,;:!?]$/.test(n);)n=n.slice(0,-1);n=this.trimUnbalancedTrailingCharacter(n,")","("),n=this.trimUnbalancedTrailingCharacter(n,"]","["),n=this.trimUnbalancedTrailingCharacter(n,"}","{");const a=this.parseAbsoluteUrl(n);return a&&["http:","https:"].includes(a.protocol)||this.isDashboardRelativeUrl(n)?n:this.toCurrentSiteUrl(n)}isDashboardRelativeUrl(e){return/^\/(sites|portfolio-summary|account|recommendations|resources|video|traffic|earnings)\b/.test(e)}toCurrentSiteUrl(e){if(!e.startsWith("/")||e.startsWith("//"))return null;const n=this.store.selectSnapshot(y.NR.url),a="string"==typeof n?this.parseAbsoluteUrl(n):null;return a&&["http:","https:"].includes(a.protocol)?new URL(e,a.origin).href:null}buildMarkdownAnchor(e,n){const a=this.isExternalUrl(e)?' target="_blank" rel="noopener noreferrer"':"";return`<a class="message-inline-link" href="${this.escapeHtmlAttribute(e)}"${a}>${n}</a>`}escapeHtml(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}escapeHtmlAttribute(e){return this.escapeHtml(e).replace(/`/g,"`")}trimUnbalancedTrailingCharacter(e,n,a){let s=e;for(;s.endsWith(n)&&this.countCharacter(s,n)>this.countCharacter(s,a);)s=s.slice(0,-1);return s}countCharacter(e,n){return[...e].filter(a=>a===n).length}openLinkUrl(e){const n=this.parseUrl(e);n&&n.origin!==window.location.origin?window.open(e,"_blank","noopener,noreferrer"):this.router.navigateByUrl(n?`${n.pathname}${n.search}${n.hash}`:e)}parseUrl(e){if(!e)return null;try{return new URL(e,window.location.origin)}catch{return null}}parseAbsoluteUrl(e){if(!e)return null;try{return new URL(e)}catch{return null}}sortMessageRows(){this.messageRows=this.messageRows.reduce((e,n)=>{if(n.isOptimistic)return[...e,n];const a=this.messageCreatedAtMs(n);let s=e.length;for(let l=e.length-1;l>=0;l-=1){const d=e[l];
3if(d.isOptimistic||a>=this.messageCreatedAtMs(d))break;s=l}return[...e.slice(0,s),n,...e.slice(s)]},[])}messageCreatedAtMs(e){const n=Date.parse(e.createdAt);return Number.isFinite(n)?n:Number.MAX_SAFE_INTEGER}syncStreamWatchdog(){this.isAgentResponding?this.armStreamWatchdog():this.clearStreamWatchdog()}armStreamWatchdog(){this.clearStreamTimers(),this.streamWatchdogState="ok",this.reconnectTimer=setTimeout(()=>{this.streamWatchdogState="reconnecting",this.statusText="Reconnecting...",this.activeTopic&&this.connectToTopic(this.activeTopic)},8e3),this.failedTimer=setTimeout(()=>{this.handleStreamTimeout()},25e3)}clearStreamWatchdog(){this.clearStreamTimers(),this.streamWatchdogState="ok"}clearStreamTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=void 0),this.failedTimer&&(clearTimeout(this.failedTimer),this.failedTimer=void 0)}handleStreamTimeout(){this.clearStreamTimers(),this.streamWatchdogState="failed",this.awaitingAgentResponse=!1,this.messageRows=this.messageRows.map(e=>e.isStreaming?{...e,isStreaming:!1}:e),this.streamError="Something went wrong. The connection may have dropped.",this.lastFailedPrompt=this.lastStreamedPrompt,this.errorRowId=this.lastUserRowId(),this.statusText="Connection lost"}static{this.\u0275fac=function(n){return new(n||i)(t.rXU(ie.F),t.rXU(Qt.Qq),t.rXU(Ba.lp),t.rXU(B.Ix),t.rXU(Ya),t.rXU(Xa),t.rXU(x.il))}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["at-global-chat-drawer"]],viewQuery:function(n,a){if(1&n&&(t.GBs(Wa,5),t.GBs(Ha,5)),2&n){let s;t.mGM(s=t.lsd())&&(a.timelineRef=s.first),t.mGM(s=t.lsd())&&(a.composerInputRef=s.first)}},standalone:!1,decls:34,vars:9,consts:[["timeline",""],["composerInput",""],[1,"global-chat-drawer"],[1,"global-chat-drawer__column"],[1,"global-chat-drawer__column-header"],[1,"global-chat-drawer__brand"],["fontSet","material-icons-outlined","role","img","aria-label","Raptive Compass icon",1,"global-chat-drawer__brand-icon"],[1,"global-chat-drawer__brand-text"],[1,"global-chat-drawer__status-line"],["aria-hidden","true",1,"global-chat-drawer__status-dot"],["type","button","mat-icon-button","","aria-label","Close assistant drawer",1,"global-chat-drawer__close",3,"click"],["class","global-chat-drawer__new-chat-bar",4,"ngIf"],[1,"global-chat-drawer__shell"],["data-cy","global-chat-timeline",1,"global-chat-drawer__timeline",3,"scroll"],["class","global-chat-drawer__empty",4,"ngIf"],["class","global-chat-drawer__messages",4,"ngIf"],["class","typing-row","data-cy","global-chat-typing",4,"ngIf"],[1,"global-chat-drawer__composer"],[1,"global-chat-drawer__composer-label"],[1,"global-chat-drawer__composer-input-wrap"],["placeholder","What should I focus on today?","data-cy","global-chat-input","rows","1",3,"input","keydown","value","disabled"],["type","button","data-cy","global-chat-send","aria-label","Send prompt",3,"click","disabled"],["class","global-chat-drawer__disabled-message","data-cy","global-chat-disabled-message",4,"ngIf"],[1,"global-chat-drawer__hint"],["class","feedback-dialog-backdrop","data-cy","global-chat-feedback-dialog",3,"click",4,"ngIf"],[1,"global-chat-drawer__new-chat-bar"],["type","button",1,"global-chat-drawer__back-btn",3,"click"],["type","button",1,"global-chat-drawer__new-chat-btn",3,"click"],[1,"global-chat-drawer__empty"],["class","global-chat-drawer__history","data-cy","global-chat-history",4,"ngIf"],[1,"global-chat-drawer__suggestions"],["type","button",3,"click",4,"ngFor","ngForOf"],["data-cy","global-chat-history",1,"global-chat-drawer__history"],[1,"global-chat-drawer__history-note"],["class","global-chat-drawer__history-loading",4,"ngIf"],["class","global-chat-drawer__history-list",4,"ngIf"],[1,"global-chat-drawer__history-loading"],[1,"global-chat-drawer__history-list"],["type","button","class","global-chat-drawer__history-item",3,"click",4,"ngFor","ngForOf","ngForTrackBy"],["type","button",1,"global-chat-drawer__history-item",3,"click"],[1,"global-chat-drawer__history-preview"],[1,"global-chat-drawer__history-time"],["type","button",3,"click"],[1,"icon",3,"ngClass"],[1,"copy"],[1,"global-chat-drawer__messages"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"message-card"],[1,"message-content",3,"click","innerHTML"],["class","message-streaming",4,"ngIf"],["class","message-links","data-cy","global-chat-links",4,"ngIf"],["class","message-feedback","data-cy","global-chat-feedback",4,"ngIf"],["class","message-error","data-cy","global-chat-error",4,"ngIf"],["class","message-time",4,"ngIf"],[1,"message-streaming"],["class","streaming-indicator",4,"ngIf"],[1,"streaming-indicator"],["data-cy","global-chat-links",1,"message-links"],["class","message-link",3,"href","click",4,"ngFor","ngForOf"],[1,"message-link",3,"click","href"],["data-cy","global-chat-feedback",1,"message-feedback"],["type","button","aria-label","Thumbs up",1,"message-feedback__button",3,"click","disabled"],["type","button","aria-label","Thumbs down",1,"message-feedback__button",3,"click","disabled"],["class","message-feedback__status",4,"ngIf"],["class","message-feedback__status message-feedback__status--error",4,"ngIf"],[1,"message-feedback__status"],[1,"message-feedback__status","message-feedback__status--error"],["data-cy","global-chat-error",1,"message-error"],[1,"message-error__body"],["type","button",3,"click",4,"ngIf"],[1,"message-time"],["data-cy","global-chat-typing",1,"typing-row"],[1,"typing-label"],["aria-hidden","true",1,"typing-dots"],["data-cy","global-chat-disabled-message",1,"global-chat-drawer__disabled-message"],["data-cy","global-chat-feedback-dialog",1,"feedback-dialog-backdrop",3,"click"],["role","dialog","aria-modal","true","aria-labelledby","global-chat-feedback-title",1,"feedback-dialog",3,"click"],["id","global-chat-feedback-title"],["placeholder","Add any details here","data-cy","global-chat-feedback-comment","maxlength","2000","rows","5",3,"input","value"],["class","feedback-dialog__error","data-cy","global-chat-feedback-error",4,"ngIf"],[1,"feedback-dialog__actions"],["type","button",1,"feedback-dialog__secondary",3,"click","disabled"],["type","button","data-cy","global-chat-feedback-submit",1,"feedback-dialog__primary",3,"click","disabled"],["data-cy","global-chat-feedback-error",1,"feedback-dialog__error"]],template:function(n,a){if(1&n){const s=t.RV6();t.j41(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"mat-icon",6),t.EFF(5,"explore"),t.k0s(),t.j41(6,"div",7)(7,"strong"),t.EFF(8,"Raptive Compass"),t.k0s(),t.j41(9,"span",8),t.nrm(10,"span",9),t.EFF(11," Beta "),t.k0s()()(),t.j41(12,"button",10),t.bIt("click",function(){return p.eBV(s),p.Njj(a.closeDrawer())}),t.j41(13,"mat-icon"),t.EFF(14,"close"),t.k0s()()(),t.DNE(15,Ka,9,0,"div",11),t.j41(16,"div",12)(17,"div",13,0),t.bIt("scroll",function(){return p.eBV(s),p.Njj(a.onTimelineScroll())}),t.DNE(19,eo,6,2,"div",14)(20,mo,2,2,"ul",15)(21,uo,7,1,"div",16),t.k0s(),t.j41(22,"div",17)(23,"label",18)(24,"div",19)(25,"textarea",20,1),t.bIt("input",function(d){return p.eBV(s),p.Njj(a.onComposerInput(d))})("keydown",function(d){return p.eBV(s),p.Njj(a.onComposerKeydown(d))}),t.k0s(),t.j41(27,"button",21),t.bIt("click",function(){return p.eBV(s),p.Njj(a.submitPrompt())}),t.j41(28,"mat-icon"),t.EFF(29,"send"),t.k0s()()()(),t.DNE(30,fo,5,1,"div",22),t.k0s(),t.j41(31,"p",23),t.EFF(32," Press Enter to send \u2022 Shift + Enter for new line "),t.k0s()()(),t.DNE(33,_o,13,5,"div",24),t.k0s()}2&n&&(t.R7$(15),t.Y8G("ngIf",a.messageRows.length),t.R7$(4),t.Y8G("ngIf",!a.messageRows.length&&!a.awaitingAgentResponse),t.R7$(),t.Y8G("ngIf",a.messageRows.length),t.R7$(),t.Y8G("ngIf",a.showTypingIndicator),t.R7$(4),t.Y8G("value",a.promptDraft)("disabled",a.isChatDisabled),t.R7$(2),t.Y8G("disabled",a.isSubmitDisabled),t.R7$(3),t.Y8G("ngIf",a.isChatDisabled),t.R7$(3),t.Y8G("ngIf",a.feedbackDialogOpen))},dependencies:[g.YU,g.Sq,g.bT,ke.iY,wt.An,g.vh],styles:[".global-chat-drawer[_ngcontent-%COMP%]{height:100%}.global-chat-drawer__column[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:fixed;top:64px;right:0;z-index:99;width:min(360px,42vw);height:calc(100vh - 64px);padding-bottom:64px;background:var(--primary-white);border-left:1px solid var(--primary-light-gray);box-shadow:-20px 0 40px #0000000a;backface-visibility:hidden;font-family:Roobert,sans-serif;letter-spacing:-.01em;animation:_ngcontent-%COMP%_chat-drawer-slide-in .26s cubic-bezier(.16,1,.3,1)}@keyframes _ngcontent-%COMP%_chat-drawer-slide-in{0%{transform:translate(100%)}to{transform:translate(0)}}.impersonation-container[_nghost-%COMP%] .global-chat-drawer__column[_ngcontent-%COMP%], .impersonation-container [_nghost-%COMP%] .global-chat-drawer__column[_ngcontent-%COMP%]{top:94px;height:calc(100vh - 94px)}@media(max-width:719px){.global-chat-drawer__column[_ngcontent-%COMP%]{width:100vw;border-left:0;box-shadow:none}}.global-chat-drawer__column-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 20px;border-bottom:1px solid var(--primary-light-gray)}.global-chat-drawer__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.global-chat-drawer__brand-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:28px;height:28px;font-size:28px;line-height:28px;overflow:visible;color:var(--primary-catalyst-purple)}.global-chat-drawer__brand-text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:3px;line-height:1.1}.global-chat-drawer__brand-text[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:14px;font-weight:700;color:var(--primary-black)}.global-chat-drawer__status-line[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.12em;
3color:var(--secondary-grounded-gray)}.global-chat-drawer__status-dot[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:var(--secondary-grounded-green);animation:_ngcontent-%COMP%_pulse 1.6s ease-in-out infinite}.global-chat-drawer__close[_ngcontent-%COMP%]{margin-left:auto;color:var(--secondary-grounded-gray)}.global-chat-drawer__close[_ngcontent-%COMP%]:hover{color:var(--primary-black)}.global-chat-drawer__shell[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;background:var(--primary-white);overflow:hidden}.global-chat-drawer__new-chat-bar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 20px;border-bottom:1px solid var(--primary-light-gray);background:var(--table-stripe)}.global-chat-drawer__back-btn[_ngcontent-%COMP%], .global-chat-drawer__new-chat-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:3px 10px 3px 6px;border:1px solid var(--primary-light-gray);border-radius:20px;background:var(--primary-white);color:var(--primary-black);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background-color .15s ease,border-color .15s ease}.global-chat-drawer__back-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%], .global-chat-drawer__new-chat-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;line-height:14px}.global-chat-drawer__back-btn[_ngcontent-%COMP%]:hover, .global-chat-drawer__new-chat-btn[_ngcontent-%COMP%]:hover{background:var(--primary-light-gray);border-color:var(--primary-warm-gray)}.global-chat-drawer__back-btn[_ngcontent-%COMP%]{padding:3px 8px 3px 4px;border-color:transparent;background:transparent}.global-chat-drawer__timeline[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;padding:12px 24px 24px;background:var(--primary-white);scrollbar-width:thin;scrollbar-color:var(--primary-light-gray) transparent}.global-chat-drawer__timeline[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.global-chat-drawer__timeline[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.global-chat-drawer__timeline[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:999px;background:var(--primary-light-gray)}.global-chat-drawer__empty[_ngcontent-%COMP%]{font-size:12px;color:var(--secondary-grounded-gray)}.global-chat-drawer__history[_ngcontent-%COMP%]{margin-bottom:20px}.global-chat-drawer__history[_ngcontent-%COMP%] h4[_ngcontent-%COMP%], .global-chat-drawer__empty[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 12px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.12em;color:var(--secondary-grounded-gray)}.global-chat-drawer__history[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin-bottom:4px}.global-chat-drawer__history-note[_ngcontent-%COMP%]{margin:0 0 12px;color:var(--secondary-grounded-gray);font-size:12px;font-style:italic}.global-chat-drawer__history-loading[_ngcontent-%COMP%]{font-size:12px;color:var(--secondary-grounded-gray)}.global-chat-drawer__history-list[_ngcontent-%COMP%]{display:grid;gap:4px;min-width:0}.global-chat-drawer__history-item[_ngcontent-%COMP%]{box-sizing:border-box;width:100%;max-width:100%;min-width:0;display:flex;flex-direction:column;gap:2px;text-align:left;border:1px solid var(--primary-light-gray);border-radius:10px;padding:10px 12px;background:var(--primary-white);cursor:pointer;transition:background-color .15s ease,border-color .15s ease}.global-chat-drawer__history-item[_ngcontent-%COMP%]:hover{background:var(--table-stripe);border-color:var(--primary-warm-gray)}.global-chat-drawer__history-preview[_ngcontent-%COMP%]{display:block;max-width:100%;font-size:13px;font-weight:600;color:var(--primary-black);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.global-chat-drawer__history-time[_ngcontent-%COMP%]{font-size:11px;color:var(--secondary-grounded-gray)}.global-chat-drawer__suggestions[_ngcontent-%COMP%]{display:grid;gap:4px}.global-chat-drawer__suggestions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;gap:12px;text-align:left;border:0;border-radius:10px;padding:10px 12px;background:transparent;cursor:pointer;transition:background-color .15s ease}.global-chat-drawer__suggestions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover{background:var(--table-stripe)}.global-chat-drawer__suggestions[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}.global-chat-drawer__suggestions[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;line-height:18px}.global-chat-drawer__suggestions[_ngcontent-%COMP%] .icon--amber[_ngcontent-%COMP%]{color:var(--primary-energy-orange)}.global-chat-drawer__suggestions[_ngcontent-%COMP%] .icon--blue[_ngcontent-%COMP%]{color:var(--secondary-groun
3ded-blue)}.global-chat-drawer__suggestions[_ngcontent-%COMP%] .icon--slate[_ngcontent-%COMP%]{color:var(--secondary-grounded-gray)}.global-chat-drawer__suggestions[_ngcontent-%COMP%] .copy[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1px;min-width:0}.global-chat-drawer__suggestions[_ngcontent-%COMP%] .copy[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--primary-black)}.global-chat-drawer__suggestions[_ngcontent-%COMP%] .copy[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-size:12px;color:var(--secondary-grounded-gray)}.global-chat-drawer__messages[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:grid;gap:8px}.global-chat-drawer__messages[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_message-pop .18s ease-out}.message-card[_ngcontent-%COMP%]{border:1px solid var(--primary-light-gray);border-radius:12px;padding:10px 12px;background:var(--primary-white);color:var(--primary-black);font-size:13px;line-height:1.45}.message-card--user[_ngcontent-%COMP%]{margin-left:16px;background:var(--primary-white);border-color:var(--primary-light-gray)}.message-card--agent[_ngcontent-%COMP%]{margin-right:16px;background:#f4f2fd;border-color:var(--primary-light-gray)}.message-card--error[_ngcontent-%COMP%]{background:var(--table-stripe);border-color:var(--secondary-grounded-red)}.message-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:6px;margin-top:8px;padding-top:8px;border-top:1px solid var(--secondary-grounded-red);font-size:12px;color:var(--secondary-grounded-red)}.message-error[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{flex:0 0 auto;width:16px;height:16px;font-size:16px;line-height:16px}.message-error__body[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.message-error__body[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-top:4px;padding:0;border:0;background:transparent;color:var(--secondary-grounded-red);font-size:12px;font-weight:700;text-decoration:underline;cursor:pointer}.message-content[_ngcontent-%COMP%]{word-break:break-word}[_nghost-%COMP%] .message-content p, [_nghost-%COMP%] .message-content ul, [_nghost-%COMP%] .message-content ol, [_nghost-%COMP%] .message-content blockquote, [_nghost-%COMP%] .message-content pre, [_nghost-%COMP%] .message-content table{margin:0 0 8px}[_nghost-%COMP%] .message-content p:last-child, [_nghost-%COMP%] .message-content ul:last-child, [_nghost-%COMP%] .message-content ol:last-child, [_nghost-%COMP%] .message-content blockquote:last-child, [_nghost-%COMP%] .message-content pre:last-child, [_nghost-%COMP%] .message-content table:last-child{margin-bottom:0}[_nghost-%COMP%] .message-content ul, [_nghost-%COMP%] .message-content ol{padding-left:18px}[_nghost-%COMP%] .message-content li+li{margin-top:3px}[_nghost-%COMP%] .message-content blockquote{padding-left:10px;border-left:3px solid var(--primary-warm-gray);color:var(--secondary-grounded-gray)}[_nghost-%COMP%] .message-content h1, [_nghost-%COMP%] .message-content h2, [_nghost-%COMP%] .message-content h3, [_nghost-%COMP%] .message-content h4, [_nghost-%COMP%] .message-content h5, [_nghost-%COMP%] .message-content h6{margin:0 0 8px;font-size:14px;line-height:1.35}[_nghost-%COMP%] .message-content code{padding:1px 4px;border-radius:4px;background:#00000012;font-family:monospace;font-size:.92em}[_nghost-%COMP%] .message-content pre{overflow-x:auto;padding:8px;border-radius:6px;background:#00000012}[_nghost-%COMP%] .message-content pre code{padding:0;background:transparent}[_nghost-%COMP%] .message-content table{width:100%;border-collapse:collapse;font-size:.92em;line-height:1.35}[_nghost-%COMP%] .message-content th, [_nghost-%COMP%] .message-content td{padding:4px 6px;border-bottom:1px solid rgba(0,0,0,.1);text-align:left;vertical-align:top}[_nghost-%COMP%] .message-content th{font-weight:700}[_nghost-%COMP%] .message-content .message-table__cell--right{text-align:right}[_nghost-%COMP%] .message-content .message-table__cell--center{text-align:center}.message-streaming[_ngcontent-%COMP%]{display:inline}[_nghost-%COMP%] .message-content a, [_nghost-%COMP%] .message-content .message-inline-link{font-weight:700;color:var(--primary-catalyst-purple, #6b65ff);text-decoration:underline;text-underline-offset:2px}.message-links[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px 16px;margin-top:10px}.message-link[_ngcontent-%COMP%]{display:inline;padding:0;border:0;background:transparent;font:inherit;font-weight:700;font-size:13px;color:var(--primary-catalyst-purple, #6b65ff);text-decoration:underline;text-underline-offset:2px;cursor:pointer}.message-link[_ngcontent-%COMP%]:hover{opacity:.8}.message-feedback[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-top:10px}.message-feedback__button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--primary-light-gray);border-radius:6px;background:var(--primary-white);
3color:var(--secondary-grounded-gray);cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease}.message-feedback__button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{width:15px;height:15px;font-size:15px;line-height:15px}.message-feedback__button[_ngcontent-%COMP%]:hover:not(:disabled), .message-feedback__button.is-selected[_ngcontent-%COMP%]{border-color:var(--primary-catalyst-purple);color:var(--primary-catalyst-purple);background:var(--primary-white)}.message-feedback__button[_ngcontent-%COMP%]:disabled{cursor:default;opacity:.7}.message-feedback__status[_ngcontent-%COMP%]{margin-left:2px;font-size:11px;font-weight:600;color:var(--secondary-grounded-gray)}.message-feedback__status--error[_ngcontent-%COMP%]{color:var(--secondary-grounded-red)}.message-time[_ngcontent-%COMP%]{display:block;margin-top:6px;font-size:10px;text-align:right;color:var(--secondary-grounded-gray)}.streaming-indicator[_ngcontent-%COMP%]{margin-left:4px;color:var(--secondary-grounded-gray);animation:_ngcontent-%COMP%_pulse 1s ease-in-out infinite}.typing-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-top:8px;margin-right:16px;padding:4px 2px}.typing-label[_ngcontent-%COMP%]{font-size:12px;color:var(--secondary-grounded-gray);animation:_ngcontent-%COMP%_typing-label-blink 1.1s ease-in-out infinite}.typing-dots[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px}.typing-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{width:6px;height:6px;border-radius:50%;background:var(--primary-catalyst-purple);animation:_ngcontent-%COMP%_typing-dot-bounce 1.2s ease-in-out infinite}.typing-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){animation-delay:.15s}.typing-dots[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){animation-delay:.3s}.global-chat-drawer__composer[_ngcontent-%COMP%]{padding:12px 20px 8px;border-top:1px solid var(--primary-light-gray)}.global-chat-drawer__composer-label[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;font-size:10px;text-transform:uppercase;font-weight:700;letter-spacing:.04em;color:var(--secondary-grounded-gray)}.global-chat-drawer__composer-input-wrap[_ngcontent-%COMP%]{position:relative;background:var(--primary-white);border:1px solid var(--primary-warm-gray);border-radius:8px;box-shadow:0 1px 2px #00000014}.global-chat-drawer__composer[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;border:0;background:transparent;border-radius:8px;padding:11px 40px 11px 12px;font-family:inherit;font-size:14px;min-height:44px;max-height:150px;resize:none;outline:none;color:var(--primary-black, #2d2d2d)}.global-chat-drawer__composer[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::placeholder{color:var(--secondary-grounded-gray, #978985)}.global-chat-drawer__composer-input-wrap[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{position:absolute;right:12px;top:13px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:0;background:var(--primary-catalyst-purple);color:var(--primary-white);border-radius:6px;cursor:pointer}.global-chat-drawer__composer-input-wrap[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;line-height:16px;width:16px;height:16px}.global-chat-drawer__composer-input-wrap[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:default}.global-chat-drawer__disabled-message[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:6px;margin-top:8px;padding:8px 10px;border:1px solid var(--secondary-grounded-red);border-radius:8px;background:var(--table-stripe);color:var(--secondary-grounded-red);font-size:12px;line-height:1.35}.global-chat-drawer__disabled-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{flex:0 0 auto;width:16px;height:16px;font-size:16px;line-height:16px}.global-chat-drawer__hint[_ngcontent-%COMP%]{margin:0;font-size:10px;color:var(--secondary-grounded-gray);text-align:center}.feedback-dialog-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:120;display:flex;align-items:center;justify-content:center;padding:24px;background:#1e1d2d73}.feedback-dialog[_ngcontent-%COMP%]{width:min(620px,100%);max-width:calc(100vw - 48px);padding:32px;border-radius:8px;background:var(--primary-white);box-shadow:0 20px 48px #0000002e;color:var(--primary-black);font-family:Roobert,sans-serif}.feedback-dialog[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 12px;font-size:28px;line-height:1.2;font-weight:700}.feedback-dialog[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 20px;
3color:var(--secondary-grounded-gray);font-size:18px;line-height:1.45}.feedback-dialog[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{box-sizing:border-box;width:100%;min-height:160px;padding:16px;border:2px solid var(--primary-black);border-radius:8px;color:var(--primary-black);font-family:inherit;font-size:16px;line-height:1.4;resize:vertical;outline:none}.feedback-dialog[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::placeholder{color:var(--secondary-grounded-gray)}.feedback-dialog[_ngcontent-%COMP%] .feedback-dialog__error[_ngcontent-%COMP%]{margin:10px 0 0;color:var(--secondary-grounded-red);font-size:13px;font-weight:600}.feedback-dialog__actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:12px;margin-top:28px}.feedback-dialog__secondary[_ngcontent-%COMP%], .feedback-dialog__primary[_ngcontent-%COMP%]{min-width:94px;padding:12px 20px;border-radius:8px;font-family:inherit;font-size:16px;font-weight:700;cursor:pointer}.feedback-dialog__secondary[_ngcontent-%COMP%]{border:1px solid var(--primary-light-gray);background:var(--primary-white);color:var(--primary-black)}.feedback-dialog__primary[_ngcontent-%COMP%]{border:1px solid var(--primary-catalyst-purple);background:var(--primary-catalyst-purple);color:var(--primary-white)}.feedback-dialog__secondary[_ngcontent-%COMP%]:disabled, .feedback-dialog__primary[_ngcontent-%COMP%]:disabled{cursor:default;opacity:.7}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.4}50%{opacity:1}}@keyframes _ngcontent-%COMP%_typing-dot-bounce{0%,80%,to{transform:translateY(0);opacity:.45}40%{transform:translateY(-3px);opacity:1}}@keyframes _ngcontent-%COMP%_typing-label-blink{0%,to{opacity:.55}50%{opacity:1}}@keyframes _ngcontent-%COMP%_message-pop{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:scale(1)}}"]})}}return i})();var ct=function(i,o,e,n){var l,a=arguments.length,s=a<3?o:null===n?n=Object.getOwnPropertyDescriptor(o,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(i,o,e,n);else for(var d=i.length-1;d>=0;d--)(l=i[d])&&(s=(a<3?l(s):a>3?l(o,e,s):l(o,e))||s);return a>3&&s&&Object.defineProperty(o,e,s),s};const Mo=["sidenav"],Io=i=>({"main-container":!0,"impersonation-container":i}),To=i=>({"side-nav-platinum":i});function Po(i,o){if(1&i){const e=t.RV6();t.j41(0,"mat-drawer",13),t.bIt("openedChange",function(a){p.eBV(e);const s=t.XpG();return p.Njj(s.onRightDrawerOpenedChange(a))}),t.nrm(1,"at-global-chat-drawer"),t.k0s()}if(2&i){const e=t.XpG();t.Y8G("opened",e.isRightDrawerOpen)("@.disabled",!0)}}function Ro(i,o){1&i&&(t.j41(0,"div",9)(1,"adl-card",14),t.nrm(2,"at-widget-card",15),t.k0s()()),2&i&&(t.R7$(2),t.Y8G("loading",!0))}function Oo(i,o){if(1&i&&t.nrm(0,"at-notifications",17),2&i){const e=t.XpG(3);t.Y8G("priority",e.notificationPriority)("siteId",e.currentSite.id)}}function ko(i,o){if(1&i&&(t.qex(0),t.nVh(1,Oo,1,2,"at-notifications",17),t.bVm()),2&i){const e=t.XpG(2);t.R7$(),t.vxM(e.isPortfolioSummary||!e.isAccountSettings&&!e.isVideo&&"Active"===e.siteStatus?1:-1)}}function Eo(i,o){if(1&i){const e=t.RV6();t.j41(0,"at-dropped-site-warning",18),t.bIt("proceed",function(){p.eBV(e);const a=t.XpG(3);return p.Njj(a.proceedDroppedSiteEarningsWarning())}),t.k0s()}}function Do(i,o){1&i&&t.nrm(0,"router-outlet")}function Fo(i,o){if(1&i&&t.nVh(0,Eo,1,0,"at-dropped-site-warning")(1,Do,1,0,"router-outlet"),2&i){const e=t.XpG(2);t.vxM(e.showDroppedSiteEarningsWarning?0:1)}}function Ao(i,o){if(1&i&&(t.j41(0,"div")(1,"h1",19),t.EFF(2),t.nI1(3,"async"),t.k0s(),t.j41(4,"mat-card",20)(5,"div",21),t.EFF(6,"There was an error loading your data."),t.k0s()()()),2&i){const e=t.XpG(2);t.R7$(2),t.JRh(t.bMT(3,1,e.error$))}}function No(i,o){if(1&i&&(t.j41(0,"div",10),t.DNE(1,ko,2,1,"ng-container",16),t.nVh(2,Fo,2,1),t.nI1(3,"async"),t.vZN(4,Ao,7,3,"div"),t.k0s()),2&i){const e=t.XpG();t.R7$(),t.Y8G("ngxPermissionsOnly",e.siteDashPermission),t.R7$(),t.vxM(t.bMT(3,2,e.error$)?4:2)}}function $o(i,o){1&i&&(t.j41(0,"div",10)(1,"div",22),t.EFF(2,"loading..."),t.k0s()())}function Go(i,o){if(1&i&&(t.j41(0,"div")(1,"h1",19),t.EFF(2),t.nI1(3,"async"),t.k0s(),t.j41(4,"mat-card",20)(5,"div",21),t.EFF(6,"There was an error loading your data."),t.k0s()()()),2&i){const e=t.XpG();t.R7$(2),t.JRh(t.bMT(3,1,e.error$))}}function jo(i,o){1&i&&(t.j41(0,"div",10)(1,"div",22),t.EFF(2,"loading..."),t.k0s()())}const Lo=new Set(["all-ad-earnings","brand-safety","community-earnings","compass","country","dashboard","details","earnings","earnings-sources","gross-reporting","overview","site-section-reporting","tests","traffic"]),De="dropped-site-warning-dismissed:";class tt{constructor(o,e,n,a,s,l,d,b,_,f){this.featureFlagService=o,this.sideNavService=e,this.snackbarService=n,this.router=a,this.breakpointObserver=s,this.route=l,this.authService=d,this.rightDrawerService=b,this.store=_,this.launchDarklyService=f,this.notificationPriority=pi.AE.HIGH,this.showSideBar=!1,this.isLoaded=!1,this.isVideo=!1,this.isAccountSettings=!1,this.isImpersonation=!1,this.siteStatus="",this.path="",this.emptyUrl=!0,this.routeUrl="",this.isPlatinum=!1,this.activeStatuses=[c.uY.ACTIVE,c.uY.DROPPED],this.showSupportButton=!1,this.siteType=c.Ie.DEFAULT,this.siteDashPermission=u.Tz,this.isSiteLoading=!1,this.isRightDrawerOpen=!1,this.isDesktop=!1,this._destroy$=new v.B,this.previousShellLoadingState=null,this.droppedSiteWarningSiteId="",this.dismissedDroppedSiteWarningSiteIds=new Set,this.isCompassFeatureFlagResolved=!1,this.isCompassFeatureEnabled=!1,this.isSiteTransitionPending=!1}ngOnInit(){this.isVideo=this.router.url.includes("video"),this.isAccountSettings=this.router.url.includes("/account-settings/"),this.isPortfolioSummary=this.isPortfolioSummaryUrl(this.router.url),this.closeRightDrawerOnPortfolioSummary(this.router.url),this.updateDroppedSiteWarningRouteState(this.router.url),this.isImpersonation=!!this.authService.parsedToken?.actAsUser,this.path=this.route.children[0]?.children[0]?.snapshot?.data?.path||"",this.launchDarklyService.getFlagObservable(P.Bt.RAPTIVE_COMPASS_MY_DASHBOARD,!1).pipe((0,E.Q)(this._destroy$)).subscribe(o=>{this.isCompassFeatureFlagResolved=!0,this.isCompassFeatureEnabled=o,this.latestSiteData&&this.syncCompassChatAvailability(this.latestSiteData)}),(0,C.z)([this.userSiteData$,this.breakpointObserver.observe([ye.Rp.Handset,ye.Rp.Tablet])]).pipe((0,E.Q)(this._destroy$)).subscribe(([o,e])=>{this.latestSiteData=o;const{hasDroppedAccess:n,isLoaded:a,onboarding:s,service:l,siteType:d,status:b,video:_,organization:f}=o,D=f?.serviceLevel||"",L=e.matches,R=[c.uY.INSTALL,c.uY.CHECKUP];this.isLoaded=a??!1,this.isSiteLoading=o.isLoading??!1,this.isSiteLoading&&!this.isLoaded&&(this.isSiteTransitionPending=!0),this.siteStatus=b??"",this.siteType=d??c.Ie.DEFAULT,this.service=l??St.Kw.ADTHRIVE,this.isVideo=this.router.url.includes("video"),this.emptyUrl="/"===this.router.url;
3const V=this.showSiteLoadingState;(null===this.previousShellLoadingState||this.previousShellLoadingState!==V)&&(this.previousShellLoadingState=V);const z=(this.user?.sites??[]).some(Nt=>"Prime"===Nt?.service);this.showSupportButton=(l?l===St.Kw.ADTHRIVE:!z)&&D!==St.Uy.ENTERPRISE,this.syncCompassChatAvailability(o),this.isLoaded&&(this.showSideBar=b===c.uY.ACTIVE||b===c.uY.DROPPED&&n?!this.emptyUrl:L||this.user.type===St.ut.EMPLOYEE||s?.wizard1CompletedAt&&(_||R.includes(b)||s?.analysis2Access&&null===s?.analysis2CompletedAt)||!s?.wizard2CompletedAt)}),this.featureFlagService.getHasURLOverrides().pipe((0,xt.n)(o=>o&&(this.user.type===St.ut.EMPLOYEE&&zt.c.production||!zt.c.production)?this.snackbarService.open("You currently have feature flag overrides set.","clear",1e5).onAction().pipe((0,di.M)(()=>this.featureFlagService.clearOverrides())):(0,dt.of)(null)),(0,E.Q)(this._destroy$)).subscribe(()=>{}),this.router.events.pipe((0,K.p)(o=>o instanceof B.j5||o instanceof B.L6),(0,E.Q)(this._destroy$)).subscribe(o=>{this.isSiteTransitionPending=!1,console.warn("[MainComponent] navigation interrupted",{type:o instanceof B.j5?"NavigationCancel":"NavigationError",url:o.url,reason:o.reason??o.error,currentUrl:this.router.url,currentSiteId:this.currentSite?.id,isSiteTransitionPending:this.isSiteTransitionPending})}),this.router.events.pipe((0,K.p)(o=>o instanceof B.wF),(0,E.Q)(this._destroy$)).subscribe(o=>{const{hasDroppedAccess:e,id:n,status:a}=this.currentSite,{type:s}=this.user,l=o.urlAfterRedirects||o.url,d=a===c.uY.DROPPED&&!e&&s!==St.ut.EMPLOYEE;this.routeUrl=l.split("/")[2],this.isVideo=l.includes("video"),this.isAccountSettings=l.includes("account-settings"),this.isPortfolioSummary=this.isPortfolioSummaryUrl(l),this.closeRightDrawerOnPortfolioSummary(o.url,l),this.syncCompassChatAvailability(this.currentSite),this.isSiteTransitionPending=!1,this.updateDroppedSiteWarningRouteState(l),this.store.dispatch(new hi.hw(Q.B.GlobalPageError)),this.path=l.split("/")[3],this.emptyUrl="/"===l,setTimeout(()=>{this.showSideBar=this.emptyUrl||this.isPortfolioSummary||(n===this.routeUrl||l.includes("resources"))&&!d})}),zt.c.enableRefiner&&this.user&&this.initializeRefiner(),this.rightDrawerService.isOpen$.pipe((0,E.Q)(this._destroy$)).subscribe(o=>{this.isRightDrawerOpen=o}),this.breakpointObserver.observe("(min-width: 1024px)").pipe((0,E.Q)(this._destroy$)).subscribe(o=>{this.isDesktop=o.matches})}initializeRefiner(){Promise.allSettled([xe()("setProject",zt.c.refinerProject),xe()("identifyUser",{id:this.user.id,email:this.user.email,name:this.user.name,type:this.user.type,role:this.user.role})])}ngOnDestroy(){this._destroy$.next(!0)}get open(){return this.sideNavService.isOpen}get navCollapsed(){return this.sideNavService.collapsibleEnabled&&this.sideNavService.collapsed}get showSiteLoadingState(){if(this.isSiteTransitionPending)return!0;const o=this.router.url.startsWith("/sites/")&&this.router.url.split("/")[2]||"";return this.isSiteLoading||!!o&&this.currentSite?.id!==o}get supportButtonVisible(){return this.showSupportButton&&!this.isInactiveCommunitySite}get showDroppedSiteEarningsWarning(){return this.siteStatus===c.uY.DROPPED&&!!this.droppedSiteWarningSiteId&&!this.hasDismissedDroppedSiteWarning(this.droppedSiteWarningSiteId)}proceedDroppedSiteEarningsWarning(){const o=this.droppedSiteWarningSiteId;if(o){this.dismissedDroppedSiteWarningSiteIds.add(o);try{window.sessionStorage.setItem(`${De}${o}`,"true")}catch{}}}get showCompassChatDrawer(){return(0,ne.p)(this.isCompassFeatureEnabled,this.currentSite,{isPortfolioSummary:this.isPortfolioSummary})}syncCompassChatAvailability(o){this.isCompassFeatureFlagResolved&&!(0,ne.p)(this.isCompassFeatureEnabled,o,{isPortfolioSummary:this.isPortfolioSummary})&&this.rightDrawerService.isOpen&&this.rightDrawerService.close()}get isInactiveCommunitySite(){return this.siteType===c.Ie.COMMUNITY&&this.siteStatus!==c.uY.ACTIVE}toggleSidenav(){this.isDesktop&&this.sideNavService.collapsibleEnabled?this.sideNavService.toggleCollapsed():this.sidenav?.toggle()}updateDroppedSiteWarningRouteState(o){this.droppedSiteWarningSiteId=this.getDroppedSiteWarningSiteId(o)}isPortfolioSummaryUrl(o){return o.includes("portfolio-summary")}
3closeRightDrawerOnPortfolioSummary(...o){o.some(e=>this.isPortfolioSummaryUrl(e))&&this.rightDrawerService.close()}hasDismissedDroppedSiteWarning(o){if(this.dismissedDroppedSiteWarningSiteIds.has(o))return!0;try{return"true"===window.sessionStorage.getItem(`${De}${o}`)}catch{return!1}}getDroppedSiteWarningSiteId(o){const n=o.split(/[?#]/)[0].split("/").filter(Boolean),a=n.indexOf("sites");if(-1===a)return"";const s=n[a+1],l=n[a+2];return s&&l&&("rpm"===l||"catalyst"===l||Lo.has(l))?s:""}toggleRightDrawer(){this.rightDrawerService.toggle()}onRightDrawerOpenedChange(o){o?this.rightDrawerService.open():this.rightDrawerService.close()}static{this.\u0275fac=function(e){return new(e||tt)(t.rXU(we.y),t.rXU(Xt.G),t.rXU(it.zR),t.rXU(B.Ix),t.rXU(kt.Q),t.rXU(B.nX),t.rXU(et.uR),t.rXU(ie.F),t.rXU(x.il),t.rXU(N.I9))}}static{this.\u0275cmp=t.VBU({type:tt,selectors:[["at-main"]],viewQuery:function(e,n){if(1&e&&t.GBs(Mo,5),2&e){let a;t.mGM(a=t.lsd())&&(n.sidenav=a.first)}},hostVars:4,hostBindings:function(e,n){2&e&&t.AVh("open",n.open)("nav-collapsed",n.navCollapsed)},standalone:!1,decls:18,vars:14,consts:[["sidenav",""],["error",""],["loading",""],["data-cy","top-nav",1,"top-nav",3,"toggleSidenav","isPortfolioSummary"],[3,"ngClass"],[1,"right-drawer-container"],["class","right-drawer-panel","position","end","mode","side",3,"opened","openedChange",4,"ngIf"],["data-cy","side-nav","cdkScrollable","",1,"side-nav",3,"ngClass","service"],[1,"main"],["data-cy","site-transition-loading",1,"page","page-loading"],[1,"page"],[1,"footer",3,"service"],[3,"visible"],["position","end","mode","side",1,"right-drawer-panel",3,"openedChange","opened"],["emphasis","low","type","standard",1,"site-loading-card"],[3,"loading"],[4,"ngxPermissionsOnly"],[3,"priority","siteId"],[3,"proceed"],[1,"brand"],["appearance","outlined",1,"error-card"],[1,"error-text"],[1,"loader"]],template:function(e,n){if(1&e){const a=t.RV6();t.j41(0,"at-top-nav",3),t.bIt("toggleSidenav",function(){return p.eBV(a),p.Njj(n.toggleSidenav())}),t.k0s(),t.j41(1,"div",4)(2,"mat-drawer-container",5),t.DNE(3,Po,2,2,"mat-drawer",6),t.j41(4,"mat-drawer-content"),t.nrm(5,"at-side-nav",7,0),t.nI1(7,"async"),t.j41(8,"div",8),t.nVh(9,Ro,3,1,"div",9)(10,No,5,4,"div",10)(11,$o,3,0,"div",10),t.nrm(12,"at-footer",11),t.k0s()()()(),t.nrm(13,"at-support-button",12),t.DNE(14,Go,7,3,"ng-template",null,1,t.C5r)(16,jo,3,0,"ng-template",null,2,t.C5r)}2&e&&(t.Y8G("isPortfolioSummary",n.isPortfolioSummary),t.R7$(),t.Y8G("ngClass",t.eq3(10,Io,n.isImpersonation)),t.R7$(2),t.Y8G("ngIf",n.showCompassChatDrawer),t.R7$(2),t.Y8G("ngClass",t.eq3(12,To,t.bMT(7,8,n.isPlatinum$)))("service",n.service),t.R7$(4),t.vxM(n.showSiteLoadingState?9:n.isLoaded?10:11),t.R7$(3),t.Y8G("service",n.service),t.R7$(),t.Y8G("visible",n.supportButtonVisible))},dependencies:[g.YU,g.bT,it.ib,mi,ui.n,fi.uv,at.RN,ae.qe,ae.$C,ae.$l,S.f6,bi.Y,B.n3,Ce.I,Se,ot,st,So,g.Jj],styles:[".side-nav[_ngcontent-%COMP%]{display:block;position:fixed;top:64px;left:0;bottom:0;z-index:99;background-color:var(--primary-light-gray);backface-visibility:hidden}.side-nav.hidden[_ngcontent-%COMP%]{display:none}.impersonation-container[_ngcontent-%COMP%] .side-nav[_ngcontent-%COMP%]{top:94px}.right-drawer-container[_ngcontent-%COMP%]{min-height:calc(100vh - 64px);background:transparent}.impersonation-container[_ngcontent-%COMP%] .right-drawer-container[_ngcontent-%COMP%]{min-height:calc(100vh - 94px)}.right-drawer-panel[_ngcontent-%COMP%]{width:min(360px,42vw)}@media(max-width:719px){.right-drawer-panel[_ngcontent-%COMP%]{width:0}}.right-drawer-container[_ngcontent-%COMP%] mat-drawer-content[_ngcontent-%COMP%]{transition:none!important}.main[_ngcontent-%COMP%] .page.video[_ngcontent-%COMP%]{padding:0}.main[_ngcontent-%COMP%] .footer[_ngcontent-%COMP%]{z-index:8}.page-loading[_ngcontent-%COMP%]{padding:32px 32px 0}.site-loading-card[_ngcontent-%COMP%]{display:block;width:100%;min-height:320px;border-radius:32px;overflow:hidden}.site-loading-card[_ngcontent-%COMP%] at-widget-card[_ngcontent-%COMP%]{display:block;width:100%}@media(min-width:1024px){.side-nav[_ngcontent-%COMP%]{width:256px;transition:width .2s ease}.main[_ngcontent-%COMP%]{margin-left:256px;transition:margin-left .2s ease}.nav-collapsed[_nghost-%COMP%] .side-nav[_ngcontent-%COMP%]{width:72px}.nav-collapsed[_nghost-%COMP%] .main[_ngcontent-%COMP%]{margin-left:72px}.footer[_ngcontent-%COMP%]{text-align:center}}@media(max-width:1023px){.side-nav[_ngcontent-%COMP%]{display:none}.page-loading[_ngcontent-%COMP%]{padding:24px 20px 0}.site-loading-card[_ngcontent-%COMP%]{min-height:240px;border-radius:24px}.open[_nghost-%COMP%] .main[_ngcontent-%COMP%]{height:100%;overflow:auto}.open[_nghost-%COMP%] .side-nav[_ngcontent-%COMP%]{display:block;width:100%;overflow-y:auto}}@media(min-width:720px)and (max-width:1023px){.main[_ngcontent-%COMP%]{margin-left:0}.side-nav[_ngcontent-%COMP%]{width:300px!important;filter:drop-shadow(5px 0 5px rgba(0,0,0,.5))}.footer[_ngcontent-%COMP%]{text-align:center}}.loader[_ngcontent-%COMP%], .loader[_ngcontent-%COMP%]:after{border-radius:50%;width:10em;height:10em}.loader[_ngcontent-%COMP%]{margin:60px auto;font-size:10px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid var(--primary-catalyst-purple);transform:translateZ(0);animation:load8 1.1s infinite linear}"]})}}ct([(0,x.l6)(y.NR)],tt.prototype,"userSiteData$",void 0),ct([(0,x.l6)(y.bM.isLoading)],tt.prototype,"userLoading$",void 0),ct([(0,x.l6)(y.NR.platinum)],tt.prototype,"isPlatinum$",void 0),ct([(0,x.l6)(y.bM.user)],tt.prototype,"user$",void 0),ct([(0,G.bL)(y.bM.user)],tt.prototype,"user",void 0),ct([(0,G.bL)(y.NR)],tt.prototype,"currentSite",void 0),ct([(0,G.bL)(y.bM.userName)],tt.prototype,"userName",void 0),ct([(0,G.bL)(T.l.newToday)],tt.prototype,"newToday",void 0),ct([(0,x.l6)(Q.W.getErrorByType(Q.B.GlobalPageError))],tt.prototype,"error$",void 0);let Uo=(()=>
3{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=t.VBU({type:i,selectors:[["at-nothing-here"]],standalone:!1,decls:6,vars:0,consts:[[1,"empty-state-page"],["emphasis","low","type","standard",1,"empty-state-card"],[1,"brand"]],template:function(n,a){1&n&&(t.j41(0,"div",0)(1,"adl-card",1)(2,"h2",2),t.EFF(3,"There's nothing here"),t.k0s(),t.j41(4,"p"),t.EFF(5," This site does not currently have any available dashboard destinations for your account. "),t.k0s()()())},dependencies:[it.ib],styles:[".empty-state-page[_ngcontent-%COMP%]{padding:0 16px}.empty-state-card[_ngcontent-%COMP%]{width:100%;max-width:1200px;margin:0 auto;padding:32px;border-radius:24px;box-shadow:none!important}.empty-state-card[_ngcontent-%COMP%] .brand[_ngcontent-%COMP%]{margin:0 0 16px}.empty-state-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 12px}"]})}}return i})();var Bo=r(34109);const I=(i,o,e)=>{const n=e.url?.split("/")[2],a=o.pathFromRoot.find(l=>l.paramMap.has("siteId"))?.paramMap.get("siteId"),s=n||a;return s?["/sites",s,"redirect"]:e.url?.startsWith("/sites/")?["/error"]:["/"]},Yo=[{path:"",component:tt,canActivate:[w.q_],canActivateChild:[w.q_,w.hf],children:[{path:"portfolio-summary",canActivate:[w.CH],loadChildren:()=>r.e(969).then(r.bind(r,52969)).then(i=>i.PortfolioSummaryModule)},{path:"sites/:siteId",canActivate:[w.Mp],children:[{path:"redirect",component:li},{path:"nothing-here",component:Uo},{path:"dashboard",canActivate:[S.Pw,w.Yp],data:{permissions:{only:[u.Tz],redirectTo:I}},loadChildren:()=>Promise.all([r.e(552),r.e(380),r.e(526)]).then(r.bind(r,22526)).then(i=>i.DashboardModule)},{path:"earnings",canActivate:[S.Pw,w.Yp],data:{permissions:{only:[u.OD],redirectTo:I}},loadChildren:()=>Promise.all([r.e(469),r.e(933)]).then(r.bind(r,87933)).then(i=>i.EarningsModule)},{path:"community-earnings",canActivate:[S.Pw,w.Yp,N.Cn],data:{ldFeatureFlag:P.Bt.COMMUNITY_EARNINGS_PAGE,permissions:{only:[u.El,u.Mf,u.Cy],redirectTo:I}},loadChildren:()=>Promise.all([r.e(469),r.e(268)]).then(r.bind(r,13268)).then(i=>i.CommunityEarningsModule)},{path:"catalyst",canActivate:[S.Pw,w.Yp],data:{permissions:{only:[u.OC,u.p2],redirectTo:I}},loadChildren:()=>r.e(571).then(r.bind(r,44571)).then(i=>i.CatalystModule)},{path:"community-education",canActivate:[S.Pw,w.Yp,N.Cn],data:{ldFeatureFlag:P.Bt.ONBOARDING_REWORK_2026,permissions:{only:[u.bX],redirectTo:I}},loadChildren:()=>Promise.all([r.e(76),r.e(86)]).then(r.bind(r,29086)).then(i=>i.CommunityEducationModule)},{path:"wizard",canActivate:[S.Pw,w.Yp,(()=>{class i{constructor(e,n){this.router=e,this.wizardInstanceService=n}canActivate(e){const n=e.pathFromRoot.find(a=>a.paramMap.has("siteId"))?.paramMap.get("siteId");return n?this.wizardInstanceService.fetchLegacyCommunityCompletion(n).pipe((0,q.s)(1),(0,Mt.T)(a=>!!(0,Ie.Gg)(a)||this.router.createUrlTree(["/sites",n,"redirect"])),(0,oe.W)(()=>(0,dt.of)(this.router.createUrlTree(["/sites",n,"redirect"])))):(0,dt.of)(this.router.createUrlTree(["/error"]))}static{this.\u0275fac=function(n){return new(n||i)(p.KVO(B.Ix),p.KVO(Bo.m))}}static{this.\u0275prov=p.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()],data:{permissions:{only:[u.S7],redirectTo:I}},loadChildren:()=>Promise.all([r.e(76),r.e(366)]).then(r.bind(r,8366)).then(i=>i.WizardInstanceModule)},{path:"traffic",canActivate:[S.Pw,w.Yp],data:{permissions:{only:[u.os],redirectTo:I}},loadChildren:()=>r.e(492).then(r.bind(r,47492)).then(i=>i.TrafficModule)},{path:"country",canActivate:[S.Pw,w.Yp],data:{permissions:{only:[u.LR],redirectTo:I}},component:ut},{path:"brand-safety",canActivate:[S.Pw,w.Yp],data:{permissions:{only:[u.N1],redirectTo:I}},loadChildren:()=>r.e(751).then(r.bind(r,72751)).then(i=>i.BrandSafetyModule)},{path:"tests",canActivate:[S.Pw,w.Yp,w.Oc],data:{featureFlag:j.A9,permissions:{only:[u.Gs],redirectTo:I}},loadChildren:()=>Promise.resolve().then(r.bind(r,95689)).then(i=>i.TestsModule)},{path:"earnings-sources",canActivate:[S.Pw,w.Yp,w.Od],data:{permissions:{only:[u.XN],redirectTo:I}},component:Zn},{path:"all-ad-earnings",redirectTo:"earnings-sources",pathMatch:"full"},{path:"recommendations",canActivate:[S.Pw,w.Yp],data:{permissions:{only:[u.lO],redirectTo:I}},loadChildren:()=>r.e(656).then(r.bind(r,98656)).then(i=>i.RecommendationsModule)},{path:"content-optimization",canActivate:[S.Pw,w.Yp],data:{permissions:{only:[u.EI,u.FQ,u.z2,u.qz,u.F1,u._O,u.JT,u.t0,u.Xv,u.Ql],redirectTo:I}},loadChildren:()=>Promise.all([r.e(552),r.e(380)]).then(r.bind(r,94380)).then(i=>i.ContentOptimizationModule)},{path:"video",canActivate:[S.Pw,w.Yp],loadChildren:()=>r.e(831).then(r.bind(r,85831)).then(i=>i.VideoModule),data:{path:"video",permissions:{only:[u.Yt,u.LF],redirectTo:I}}},{path:"payments",canActivate:[S.Pw,w.Yp],data:{permissions:{only:[u.S1],redirectTo:I}},loadChildren:()=>r.e(299).then(r.bind(r,7299)).then(i=>i.PaymentsModule)},{path:"account",canActivate:[S.Pw,w.Yp],data:{permissions:{only:[u.c3],redirectTo:I}},loadChildren:()=>r.e(714).then(r.bind(r,2714)).then(i=>i.AccountModule)},{path:"ad-preferences",canActivate:[S.Pw,w.Yp],data:{permissions:{only:[u.B$],redirectTo:I}},loadChildren:()=>Promise.all([r.e(808),r.e(4)]).then(r.bind(r,40004)).then(i=>i.AdPreferencesModule)},{path:"onboarding",canActivate:[S.Pw,w.Yp,w.Kv],data:{permissions:{only:[u.Sc],redirectTo:I}},loadChildren:()=>Promise.all([r.e(57),r.e(76),r.e(980)]).then(r.bind(r,63980)).then(i=>i.OnboardingModule)},{path:"rpm",canActivate:[S.Pw,w.Yp],data:{permissions:{only:[u.q4],redirectTo:I}},loadChildren:()=>Promise.all([r.e(552),r.e(916)]).then(r.bind(r,56916)).then(i=>i.RpmModule)},{path:"gross-reporting",canActivate:[S.Pw,w.Yp,N.Cn],data:{ldFeatureFlag:P.Bt.GROSS_REPORTING_PAGE,permissions:{only:[u.q5],redirectTo:I}},loadChildren:()=>r.e(232).then(r.bind(r,48232)).then(i=>i.TransparencyModule)},{path:"overview",canActivate:[S.Pw,w.Yp,w.Kv],data:{permissions:{only:[u.OC],redirectTo:I}},loadChildren:()=>r.e(453).then(r.bind(r,18453)).then(i=>i.CamOverviewModule)},{path:"details",canActivate:[S.Pw,w.Yp,w.Kv],data:{permissions:{only:[u.p2],redirectTo:I}},loadChildren:()=>r.e(698).then(r.bind(r,57698)).then(i=>i.CamDetailsModule)},{path:"site-section-reporting",canActivate:[S.Pw,w.Yp,w.Oc],component:Et,data:{featureFlag:j.je,permissions:{only:[u.Z6],redirectTo:I}}},{path:"pinterest",canActivate:[S.Pw,w.Yp,w.Oc],data:{featureFlag:j.LL,permissions:{only:[u.Dc],redirectTo:I}},loadChildren:()=>r.e(319).then(r.bind(r,40319)).then(i=>i.PinterestModule)},{path:"publisher-direct",canActivate:[S.Pw,w.Yp,N.Cn],data:{ldFeatureFlag:P.Bt.PUBLISHER_DIRECT_PAGE,permissions:{only:[u.Jb],redirectTo:I}},loadChildren:()=>
3r.e(566).then(r.bind(r,5566)).then(i=>i.PublisherDirectModule)},{path:"foodfight",canActivate:[S.Pw,w.Yp,N.Cn],data:{ldFeatureFlag:P.Bt.FOODFIGHT,permissions:{only:[u.X2],redirectTo:I}},loadChildren:()=>Promise.all([r.e(808),r.e(466)]).then(r.bind(r,38466)).then(i=>i.FoodfightModule)},{path:"gsc_authentication",canActivate:[S.Pw],data:{permissions:{only:[u.fG],redirectTo:I}},loadChildren:()=>Promise.all([r.e(76),r.e(758)]).then(r.bind(r,4758)).then(i=>i.GscAuthModule)},{path:"**",redirectTo:"redirect"}]},{path:"resources",canActivate:[S.Pw],data:{permissions:{only:[u.C$],redirectTo:"/"}},loadChildren:()=>Promise.all([r.e(76),r.e(907)]).then(r.bind(r,72907)).then(i=>i.ResourcesModule)},{path:"account-settings",canActivate:[S.Pw],data:{permissions:{only:[u.AF,u.NU],redirectTo:"/"}},loadChildren:()=>r.e(544).then(r.bind(r,72544)).then(i=>i.AccountSettingsModule)}]}];let zo=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=t.$C({type:i})}static{this.\u0275inj=p.G2t({imports:[Z.iI.forChild(Yo),Z.iI]})}}return i})(),Xo=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=t.$C({type:i})}static{this.\u0275inj=p.G2t({imports:[g.MD,Y.G,zo,N.F,Se,x.rK.forFeature([T.l,H.b,F.N,Q.W])]})}}return i})()},65696(lt,X,r){r.d(X,{G:()=>g});var g=function(x){return x.SESSIONS="sessions",x.PAGEVIEWS="pageviews",x}(g||{})},3319(lt,X,r){r.d(X,{e:()=>H});var g=r(33499),x=r(45682),Y=r(79682);let H=(()=>{class F{constructor(){this.pageSizeOptions=[20,50],this.apiSupport=!0,this.pagingInfoChange=new g.bkB}handlePageChange(N){this.apiSupport&&(N.pageIndex+=1),this.pagingInfo=N,this.pagingInfoChange.emit(this.pagingInfo)}static{this.\u0275fac=function(Z){return new(Z||F)}}static{this.\u0275cmp=g.VBU({type:F,selectors:[["at-pagination-widget"]],inputs:{pageSizeOptions:"pageSizeOptions",pagingInfo:"pagingInfo",apiSupport:"apiSupport"},outputs:{pagingInfoChange:"pagingInfoChange"},standalone:!1,decls:2,vars:4,consts:[["paginator",""],["data-cy","paginator",3,"page","length","pageIndex","pageSize","pageSizeOptions"]],template:function(Z,T){if(1&Z){const h=g.RV6();g.j41(0,"mat-paginator",1,0),g.bIt("page",function(C){return x.eBV(h),x.Njj(T.handlePageChange(C))}),g.k0s()}2&Z&&g.Y8G("length",null==T.pagingInfo?null:T.pagingInfo.length)("pageIndex",(null==T.pagingInfo?null:T.pagingInfo.pageIndex)-(T.apiSupport?1:0))("pageSize",null==T.pagingInfo?null:T.pagingInfo.pageSize)("pageSizeOptions",T.pageSizeOptions)},dependencies:[Y.iy],styles:["at-pagination-widget .mat-mdc-paginator{padding:16px 0 0;justify-content:center;color:var(--dark-text-high);font-size:16px!important;display:flex;background-color:unset}at-pagination-widget .mat-mdc-paginator .mat-form-field-wrapper{padding-bottom:6px}at-pagination-widget .mat-mdc-paginator .mat-form-field-infix{padding:0;margin:0;border:unset}at-pagination-widget .mat-mdc-paginator .mat-form-field-underline{bottom:0}at-pagination-widget .mat-mdc-paginator .mat-button-disabled{color:var(--dark-text-disabled)}at-pagination-widget .mat-mdc-paginator .mat-select-value{font-size:16px}at-pagination-widget .mat-mdc-paginator-container{min-height:48px;justify-content:center}\n"],encapsulation:2})}}return F})()},62184(lt,X,r){r.d(X,{Eg:()=>F,Qr:()=>Z,ZM:()=>T,up:()=>N});var g=r(21837);const H=(h,v)=>{const C=h?.[v];if("string"!=typeof C||""===C.trim())return;const M=Number(C);return Number.isFinite(M)?M:void 0},F=(h,v)=>{const C=h?.[v];if("string"==typeof C)return C.trim()||void 0},Q=(h,v)=>{const C=F(h,v);if(!C)return;const M=g.c9.fromISO(C);return M.isValid?M:void 0},N=(h,v,C)=>{const M=F(h,v);if(M)return C.includes(M)?M:void 0},Z=({queryParams:h,min:v,max:C,defaultStartDate:M,defaultEndDate:K,startDateKey:q="startDate",endDateKey:y="endDate"})=>{const G=Q(h,q),j=Q(h,y);let O=G??M,$=j??K;return O=g.c9.max(O,v),$=g.c9.max($,v),O=g.c9.min(O,C),$=g.c9.min($,C),O>$&&(G&&!j?$=O:O=$),{startDate:O,endDate:$}},T=({queryParams:h,minKey:v,maxKey:C,defaultMin:M,defaultMax:K,lowerBound:q,upperBound:y})=>{const G=H(h,v),j=H(h,C),O=Ot=>{if(void 0===Ot)return;let c=Ot;return"number"==typeof q&&(c=Math.max(q,c)),"number"==typeof y&&(c=Math.min(y,c)),c},$=O(G),$t=O(j);return void 0!==$&&void 0!==$t&&$>$t?[$,null]:[$??M,$t??K]}},70464(lt,X,r){},42006(lt){let X=!1;window._refinerQueue=window._refinerQueue||[],window._refiner=function(){let g=Promise.resolve();return X||(g=function r(){return X=!0,new Promise(function(g,x){const Y=document.createElement("script");Y.src="https://js.refiner.io/v001/client.js",Y.onload=function(){g()},Y.onerror=function(H){x(new Error("Could not load Refiner client. "+(H&&H.target?`URL: ${H.target.src}, Type: ${H.type}`:"Unknown error")))},document.head.appendChild(Y)})}()),_refinerQueue.push(arguments),g},window._refiner("setInstallationMethod","npm"),lt.exports=window._refiner}}]);
4//# debugId=5b56537b-d059-5e0f-b546-4004afc02da8
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.