1import{b as l}from"./chunk-DN2UKVAE.js";import{Q as d,U as u}from"./chunk-KKN25QZQ.js";import{a,b as c}from"./chunk-HZ6M6AS2.js";var m=class r{environmentService=u(l);static STORAGE_KEY="nm_acquisition";static MAX_FIELD_LENGTH=500;captureOnce(){try{if(this.readStored())return;let e=this.buildPayload();localStorage.setItem(r.STORAGE_KEY,JSON.stringify(e))}catch{}}getPayload(){return this.readStored()}clear(){try{localStorage.removeItem(r.STORAGE_KEY)}catch{}}readStored(){try{let e=localStorage.getItem(r.STORAGE_KEY);return e?JSON.parse(e):null}catch{return null}}buildPayload(){let e=new URLSearchParams(window.location.search),t=this.clean(e.get("utm_source")),n=this.clean(e.get("utm_medium")),i=this.clean(e.get("utm_campaign")),o=this.clean(e.get("rid")),s=this.parseHost(document.referrer),f=Array.from(e.keys()).length>0,g=this.deriveSource(t,o,f,s);return c(a(c(a(a(a({source:g},n?{medium:n}:{}),i?{campaign:i}:{}),o?{externalRef:o}:{}),{landingPath:this.clean(window.location.pathname)??"/"}),s?{referrerHost:s}:{}),{firstSeenAt:new Date().toISOString()})}deriveSource(e,t,n,i){return e||(t?"migration_email":this.isLegacyReferrer(i)?"legacy_editor":!n&&!i?"direct":"referral")}isLegacyReferrer(e){if(!e)return!1;let t=this.parseHost(this.environmentService.getLegacyBaseUrl());return!!t&&t===e}parseHost(e){if(e)try{return new URL(e).hostname||void 0}catch{return}}clean(e,t=r.MAX_FIELD_LENGTH){let n=e?.trim();if(n)return n.slice(0,t)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=d({token:r,factory:r.\u0275fac,providedIn:"root"})};export{m 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.