UNPKG

@junobuild/analytics

Version:

Tracker for Juno analytics

3 lines (2 loc) 1.34 kB
import{a as i,b as o,c as a,d as s,e as p,f as c,g as u,h as f,i as v}from"./chunk-MBP7WNBW.js";import"./chunk-YVLJX3HV.js";var d=()=>{let e=()=>typeof import.meta<"u"&&typeof import.meta.env<"u"?import.meta.env?.VITE_SATELLITE_ID??import.meta.env?.PUBLIC_SATELLITE_ID:void 0;return typeof process<"u"?process.env?.NEXT_PUBLIC_SATELLITE_ID??e():e()},m=()=>{let e=()=>typeof import.meta<"u"&&typeof import.meta.env<"u"?import.meta.env?.VITE_ORBITER_ID??import.meta.env?.PUBLIC_ORBITER_ID:void 0;return typeof process<"u"?process.env?.NEXT_PUBLIC_ORBITER_ID??e():e()},I=()=>{let e=()=>typeof import.meta<"u"&&typeof import.meta.env<"u"?import.meta.env?.VITE_CONTAINER??import.meta.env?.PUBLIC_CONTAINER:void 0;return typeof process<"u"?process.env?.NEXT_PUBLIC_CONTAINER??e():e()};var E=e=>{let n=e?.satelliteId??d();i(n,"Satellite ID is not configured. Orbiter cannot be initialized without a target Satellite.");let t=e?.orbiterId??m();i(t,"Orbiter ID is not configured. The analytics cannot be initialized without an Orbiter.");let r=e?.container??I();return{orbiterId:t,satelliteId:n,container:r,options:e?.options}},g=e=>{let n=E(e),{cleanup:t}=o(n);s();let{cleanup:r}=a();return p(),()=>{t(),r()}};export{g as initOrbiter,f as trackEvent,v as trackEventAsync,c as trackPageView,u as trackPageViewAsync}; //# sourceMappingURL=index.js.map