1import{a as u}from"./chunk-HVEGL7VS.js";import{e as d,j as l}from"./chunk-JEYBAYD4.js";import{b as r}from"./chunk-Z2MDTFY3.js";import{ka as h,pa as s}from"./chunk-4IVTWYCS.js";var a="v2|",f="personal",g="hubspotConnectNonce",v=(()=>{let n=class n{get scope(){return"crm.objects.contacts.write oauth crm.schemas.contacts.read crm.objects.contacts.read crm.objects.marketing_events.write"}constructor(t,e){this.api=t,this.workspaceStore=e,this.authorizeUrl="https://app.hubspot.com/oauth/authorize",this.clientId=this.getClientId(),this.redirectUri=this.getRedirectUri()}getClientId(){switch(r.environmentName){case"dev":return"48908b17-43b5-4edc-bb93-2985fa3564cd";case"alpha":return"48908b17-43b5-4edc-bb93-2985fa3564cd";default:return"4662d061-b0c5-4d77-9d86-e65c3a9ab825"}}getRedirectUri(){switch(r.environmentName){case"dev":return"http://localhost:4200/hubspot/oauth/callback";case"alpha":return"https://alpha.eventpage.ai/hubspot/oauth/callback";default:return`https://app.${r.platform}/hubspot/oauth/callback`}}redirectToHubspotAuth(t){let e=this.buildConnectState(t);window.location.href=`${this.authorizeUrl}?client_id=${this.clientId}&redirect_uri=${encodeURIComponent(this.redirectUri)}&scope=${encodeURIComponent(this.scope)}&state=${encodeURIComponent(e)}`}buildConnectState(t){let e=this.workspaceStore.getSelectedWorkspaceUuid()??f,o=t.startsWith("/")?t:`/${t}`,c=n.mintNonce();return`${a}${e}|${c}|${window.location.origin}${o}`}static mintNonce(){let t=u.randomUuid();try{sessionStorage.setItem(g,t)}catch{}return t}static parseConnectState(t){if(!t?.startsWith(a))return{kind:"legacy",path:t};let e=t.slice(a.length),o=e.indexOf("|");if(o<=0)return{kind:"legacy",path:null};let c=e.indexOf("|",o+1);if(c<=o+1)return{kind:"legacy",path:null};let m=e.slice(0,o),b=e.slice(o+1,c),p=e.slice(c+1);try{new URL(p)}catch{return{kind:"legacy",path:null}}return{kind:"v2",workspaceUuid:m,nonce:b,returnUrl:p}}connect(t){return this.api.post(`${r.api}/users/integrations/hubspot`,t)}disconnect(){return this.api.get(`${r.api}/users/integrations/hubspot/disconnect`)}};n.\u0275fac=function(e){return new(e||n)(s(l),s(d))},n.\u0275prov=h({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();export{f as a,g as b,v as c}; 2//# sourceMappingURL=chunk-DYQ23SL5.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.