1import{a as d}from"./chunk-ANGDEZK2.js";import{b as h}from"./chunk-OPILLSQF.js";import{a as l}from"./chunk-BEHWET45.js";import{g as c,ua as u,za as a}from"./chunk-AVNRU4K5.js";var r={apiName:l.apiName},A=(()=>{class n{constructor(){this.userService=a(h),this.portalService=a(d),this.navBarHeight=50,this.stateSource=new c({isVisible:!1,url:null}),this.stateSourceEvent=this.stateSource.asObservable(),this.isReminders=new c(!1),this.toolbarActions=[{productPage:[{id:"product-panel",name:"Product panel",sku:"",isActive:!1}]},{projectPage:[{id:"project-panel",name:"Project panel",isActive:!1}]},{performanceDashboardPage:[{id:"project-panel",name:"Project panel",isActive:!1,isButtonActive:!0}]}],this.subscription=this.portalService.accountInfo.subscribe(e=>{e!==null&&e.winningUserId&&(this.winningUser=e)})}ngOnDestroy(){this.subscription.unsubscribe()}getActions(e){return this.getActionsForPage(e)}toggleActiveState(e,t){let i=this.getActionById(e.id);i&&(i.isActive=t,this.callNotifyBasedOnAction(i))}setActiveSku(e){let t=this.getActionById("product-panel");t.sku=e,t.isActive&&this.notify(!0,this.getProductPageUrl(e))}notifyOnPageLoad(e){e&&e.forEach(t=>{let i=this.getActionById(t.id);i&&this.callNotifyBasedOnAction(i)})}notify(e=!1,t=null){this.stateSource.next({isVisible:e,url:t})}callNotifyBasedOnAction(e){e&&(e.id==="product-panel"&&e.isActive?this.notify(!0,this.getProductPageUrl(e.sku)):e.id==="project-panel"&&e.isActive?this.notify(!0,this.getProjectPageUrl()):this.notify(!1))}getActionsForPage(e){let t=[];return this.toolbarActions.forEach(i=>
1{Object.keys(i).forEach(s=>{s===e&&(t=i[e])})}),t}getActionById(e){let t={};return this.toolbarActions.forEach(i=>{Object.keys(i).forEach(s=>{i[s].find(o=>{o.id===e&&(t=o)})})}),t}getProductPageUrl(e){this.isReminders.next(!1);let t=this.userService.returnAccessToken(),i=this.userService.returnIdToken();return this.winningUser&&this.winningUser.winningCmsUrl?`${this.winningUser.winningCmsUrl}/product-page?sku=${encodeURIComponent(e)}&site=${r.apiName}&embed=true&access_token=${t}&id_token=${i}`:null}getProjectPageUrl(){this.isReminders.next(!1);let e=this.userService.returnAccessToken(),t=this.userService.returnIdToken();return this.winningUser&&this.winningUser.winningCmsUrl&&this.winningUser.salespersonCode?`${this.winningUser.winningCmsUrl}/project?salespersoncode=${this.winningUser.salespersonCode}&site=${r.apiName}&embed=true&access_token=${e}&id_token=${t}`:null}openReminderCreate(e){this.isReminders.next(!0),this.notify(!0,this.getRemindersCreateUrl({projectId:e}))}openReminderViewEdit(e){this.isReminders.next(!0),this.notify(!0,this.getRemindersCreateUrl({id:e}))}openRemindersList(){this.isReminders.next(!0),this.notify(!0,this.getRemindersListUrl())}openDashboard(){this.isReminders.next(!0),this.notify(!0,this.getDashboardUrl())}getRemindersCreateUrl(e){let t=this.userService.returnAccessToken(),i=this.userService.returnIdToken(),s;return this.winningUser&&this.winningUser.winningCmsUrl&&this.winningUser.salespersonCode?s=(e?.id||e?.projectId?`${this.winningUser.winningCmsUrl}/reminders/create?${e.id?`id=${e?.id}`:`projectId=${e.projectId}`}&`:`${this.winningUser.winningCmsUrl}/reminders/create?`)+`salespersoncode=${this.winningUser.salespersonCode}&site=${r.apiName}&embed=true&access_token=${t}&id_token=${i}&cacheBuster=`+Date.now():s=null,s}getRemindersListUrl(){let e=this.userService.returnAccessToken(),t=this.userService.returnIdToken();return this.winningUser&&this.winningUser.winningCmsUrl&&this.winningUser.salespersonCode?`${this.winningUser.winningCmsUrl}/reminders/list?salespersoncode=${this.winningUser.salespersonCode}&site=${r.apiName}&embed=true&access_token=${e}&id_token=${t}&cacheBuster=`+Date.now():null}getDashboardUrl(){let e=this.userService.returnAccessToken(),t=this.userService.returnIdToken();return this.winningUser&&this.winningUser.winningCmsUrl&&this.winningUser.salespersonCode?`${this.winningUser.winningCmsUrl}/reminders/stats?salespersoncode=${this.winningUser.salespersonCode}&site=${r.apiName}&embed=true&access_token=${e}&id_token=${t}&cacheBuster=`+Date.now():null}setQuoteId(e){this.quoteId=e}getViewAllCustomerProjectsLink(e){let t=this.userService.returnAccessToken(),i=this.userService.returnIdToken();return`${this.winningUser.winningCmsUrl}/project?embed=true&site=${l.apiName}&salespersoncode=${this.winningUser.salespersonCode}&email=${e.quoteData.customerEmail}&access_token=${t}&id_token=${i}`}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=u({token:n,factory:n.\u0275fac})}}return n})();export{A as a};
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.