// src/components/docs/libraries/LibrariesAnalyticsPage.tsx
import { CodeBlock, InstallCommand } from "@contractspec/lib.design-system";
import { jsx, jsxs } from "react/jsx-runtime";
function LibrariesAnalyticsPage() {
  return /* @__PURE__ */ jsxs("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h1", {
            className: "text-4xl font-bold",
            children: "@contractspec/lib.analytics"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground text-lg",
            children: "Work directly with telemetry events to understand conversion, retention, churn, and growth opportunities."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Installation"
          }),
          /* @__PURE__ */ jsx(InstallCommand, {
            package: "@contractspec/lib.analytics"
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-3",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Funnels in memory"
          }),
          /* @__PURE__ */ jsx(CodeBlock, {
            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' },
  ],
});`
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-3",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Cohorts & churn"
          }),
          /* @__PURE__ */ jsx(CodeBlock, {
            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);`
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-3",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Growth hypotheses"
          }),
          /* @__PURE__ */ jsx(CodeBlock, {
            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 {
  LibrariesAnalyticsPage
};
