// @bun
var c=Object.defineProperty;var i=(t)=>t;function s(t,a){this[t]=i.bind(null,a)}var p=(t,a)=>{for(var o in a)c(t,o,{get:a[o],enumerable:!0,configurable:!0,set:s.bind(a,o)})};var d=(t,a)=>()=>(t&&(a=t(t=0)),a);import{CodeBlock as r,InstallCommand as l}from"@contractspec/lib.design-system";import{jsx as e,jsxs as n}from"react/jsx-runtime";function u(){return n("div",{className:"space-y-8",children:[n("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.analytics"}),e("p",{className:"text-lg text-muted-foreground",children:"Work directly with telemetry events to understand conversion, retention, churn, and growth opportunities."})]}),n("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Installation"}),e(l,{package:"@contractspec/lib.analytics"})]}),n("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Funnels in memory"}),e(r,{language:"typescript",code:`import { FunnelAnalyzer } from '@contractspec/lib.analytics/funnel';

const analyzer = new FunnelAnalyzer();
const report = analyzer.analyze(events, {
  name: 'signup',
  steps: [
    { id: 'view', eventName: 'page.view', match: (e) => e.properties?.slug === '/signup' },
    { id: 'submit', eventName: 'signup.submit' },
    { id: 'verified', eventName: 'account.verified' },
  ],
});`})]}),n("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Cohorts & churn"}),e(r,{language:"typescript",code:`import { CohortTracker } from '@contractspec/lib.analytics/cohort';
import { ChurnPredictor } from '@contractspec/lib.analytics/churn';

const cohorts = new CohortTracker().analyze(events, { bucket: 'week', periods: 8 });
const churn = new ChurnPredictor().score(events);`})]}),n("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Growth hypotheses"}),e(r,{language:"typescript",code:`import { GrowthHypothesisGenerator } from '@contractspec/lib.analytics/growth';

const ideas = new GrowthHypothesisGenerator().generate([
  { name: 'Activation rate', current: 0.42, previous: 0.55, target: 0.6 },
  { name: 'Expansion ARPU', current: 1.2, previous: 0.9 },
]);`})]})]})}export{u as LibrariesAnalyticsPage};
