const CACHE_NAME = "posthog-handbook-2026-08-17-f787d34bec9c";
const CORE_PATHS = [
  "./",
  "index.html",
  "company.html",
  "print.html",
  "changes.html",
  "changes.md",
  "manifest.json",
  "search-index.json",
  "site.webmanifest?v=f787d34bec9c",
  "offline.html",
  "assets/library.css?v=f787d34bec9c",
  "assets/search.js?v=f787d34bec9c",
  "assets/reader.js?v=f787d34bec9c",
  "assets/icon.svg?v=f787d34bec9c",
  "sections/account-management.html",
  "sections/brand.html",
  "sections/community.html",
  "sections/company.html",
  "sections/content.html",
  "sections/cs-and-onboarding.html",
  "sections/engineering.html",
  "sections/exec.html",
  "sections/forward-deployed-engineering.html",
  "sections/getting-started.html",
  "sections/growth.html",
  "sections/root.html",
  "sections/marketing.html",
  "sections/onboarding.html",
  "sections/people.html",
  "sections/product.html",
  "sections/support.html",
  "sections/wizard-and-docs.html",
  "pages/account-management-getting-people-to-talk-to-you.html",
  "pages/brand-ambassador.html",
  "pages/brand-approvals.html",
  "pages/brand-art-requests.html",
  "pages/brand-assets.html",
  "pages/brand-designing-posthog-website.html",
  "pages/brand-foundations.html",
  "pages/brand-in-practice.html",
  "pages/brand-overview.html",
  "pages/brand-tone.html",
  "pages/brand-visual-identity.html",
  "pages/community-index.html",
  "pages/community-points.html",
  "pages/community-profiles.html",
  "pages/community-questions.html",
  "pages/company-snippets-soc2.html",
  "pages/company-adding-tools.html",
  "pages/company-communication.html",
  "pages/company-culture.html",
  "pages/company-do-more-weird.html",
  "pages/company-fuzzy-ownership.html",
  "pages/company-goal-setting.html",
  "pages/company-grown-ups.html",
  "pages/company-kudos.html",
  "pages/company-lore.html",
  "pages/company-management.html",
  "pages/company-merch-store.html",
  "pages/company-new-to-github.html",
  "pages/company-offsites.html",
  "pages/company-post-mortems-2025-09-29-flags-is-down.html",
  "pages/company-post-mortems-2025-10-03-surveys-sdk-bug.html",
  "pages/company-post-mortems-2025-10-21-feature-flags-recurring-outages.html",
  "pages/company-post-mortems-2025-11-15-persons-db-migration.html",
  "pages/company-post-mortems-2025-11-26-shai-hulud-attack.html",
  "pages/company-post-mortems-2026-01-17-replay-sdk-fetch-wrapper-incident.html",
  "pages/company-post-mortems-2026-02-06-feature-flags-cache-degradation.html",
  "pages/company-post-mortems-2026-02-20-posthog-us-logs-data-loss.html",
  "pages/company-post-mortems-2026-04-27-workflow-wait-until-condition.html",
  "pages/company-post-mortems-index.html",
  "pages/company-security-advisories.html",
  "pages/company-security.html",
  "pages/company-small-teams.html",
  "pages/company-sprints.html",
  "pages/company-team-changes.html",
  "pages/content-snippets-list-no-nextline-md.html",
  "pages/content-snippets-list-no-nextline.html",
  "pages/content-snippets-list-with-nextline-md.html",
  "pages/content-snippets-list-with-nextline.html",
  "pages/content-feature-trailer-process.html",
  "pages/content-index.html",
  "pages/content-linkedin.html",
  "pages/content-metadata.html",
  "pages/content-newsletter-ads.html",
  "pages/content-newsletter-tips.html",
  "pages/content-newsletter.html",
  "pages/content-posthog-style-guide.html",
  "pages/content-screen-recording-guide.html",
  "pages/content-seo-guide.html",
  "pages/content-social-media.html",
  "pages/content-youtube.html",
  "pages/cs-and-onboarding-churn-reasons.html",
  "pages/cs-and-onboarding-customer-churn-retros.html",
  "pages/cs-and-onboarding-customer-success.html",
  "pages/cs-and-onboarding-engaging-unengaged-customers.html",
  "pages/cs-and-onboarding-feature-requests.html",
  "pages/cs-and-onboarding-foundation-check.html",
  "pages/cs-and-onboarding-getting-started-with-customers.html",
  "pages/cs-and-onboarding-handling-customer-issues.html",
  "pages/cs-and-onboarding-health-checks.html",
  "pages/cs-and-onboarding-health-tracking.html",
  "pages/cs-and-onboarding-how-we-use-automation.html",
  "pages/cs-and-onboarding-how-we-work.html",
  "pages/cs-and-onboarding-lifecycle-csm.html",
  "pages/cs-and-onboarding-new-hire-onboarding-exercise.html",
  "pages/cs-and-onboarding-new-hire-onboarding-team-leads.html",
  "pages/cs-and-onboarding-new-hire-onboarding.html",
  "pages/cs-and-onboarding-onboarding-success-plan.html",
  "pages/cs-and-onboarding-renewals.html",
  "pages/cs-and-onboarding-shareable-guides-designing-events-for-per-entity-metrics.html",
  "pages/cs-and-onboarding-shareable-guides-llm-cost-optimization.html",
  "pages/cs-and-onboarding-using-ai-to-analyze-customer-issues.html",
  "pages/engineering-ai-ai-platform.html",
  "pages/engineering-ai-architecture.html",
  "pages/engineering-ai-implementation.html",
  "pages/engineering-ai-products.html",
  "pages/engineering-ai-team-structure.html",
  "pages/engineering-bug-prioritization.html",
  "pages/engineering-clickhouse-clusters.html",
  "pages/engineering-clickhouse-data-ingestion.html",
  "pages/engineering-clickhouse-data-storage.html",
  "pages/engineering-clickhouse-dictionaries.html",
  "pages/engineering-clickhouse-index.html",
  "pages/engineering-clickhouse-operations.html",
  "pages/engineering-clickhouse-performance.html",
  "pages/engineering-clickhouse-query-attribution.html",
  "pages/engineering-clickhouse-schema-app-metrics.html",
  "pages/engineering-clickhouse-schema-index.html",
  "pages/engineering-clickhouse-schema-person-distinct-id.html",
  "pages/engineering-clickhouse-schema-sharded-events.html",
  "pages/engineering-clickhouse-working-with-json.html",
  "pages/engineering-cloud-providers.html",
  "pages/engineering-conventions-scripts.html",
  "pages/engineering-customer-comms.html",
  "pages/engineering-deployments-support.html",
  "pages/engineering-developer-experience.html",
  "pages/engineering-development-process.html",
  "pages/engineering-feature-ownership.html",
  "pages/engineering-feature-pricing.html",
  "pages/engineering-how-to-access-posthog-cloud-infra.html",
  "pages/engineering-how-we-review.html",
  "pages/engineering-operations-incidents.html",
  "pages/engineering-operations-on-call-rotation.html",
  "pages/engineering-operations-post-mortems.html",
  "pages/engineering-operations-support-hero.html",
  "pages/engineering-posthog-com-add-team-member.html",
  "pages/engineering-posthog-com-api-docs.html",
  "pages/engineering-posthog-com-assets.html",
  "pages/engineering-posthog-com-changelog.html",
  "pages/engineering-posthog-com-cool-tech-jobs.html",
  "pages/engineering-posthog-com-developing-the-website.html",
  "pages/engineering-posthog-com-how-posthog-website-works.html",
  "pages/engineering-posthog-com-jobs.html",
  "pages/engineering-posthog-com-markdown.html",
  "pages/engineering-posthog-com-mdx-setup.html",
  "pages/engineering-posthog-com-merch-store.html",
  "pages/engineering-posthog-com-overview.html",
  "pages/engineering-posthog-com-presentations.html",
  "pages/engineering-posthog-com-product-comparisons.html",
  "pages/engineering-posthog-com-roadmap.html",
  "pages/engineering-posthog-com-small-teams.html",
  "pages/engineering-posthog-com-technical-architecture.html",
  "pages/engineering-product-design-process.html",
  "pages/engineering-product-design.html",
  "pages/engineering-product-engineering.html",
  "pages/engineering-revenue-and-forecasting.html",
  "pages/engineering-sdks-guidelines.html",
  "pages/engineering-sdks-index.html",
  "pages/engineering-sdks-releases.html",
  "pages/engineering-sdks-support-rotation.html",
  "pages/engineering-security.html",
  "pages/engineering-session-replay-session-replay-architecture.html",
  "pages/engineering-tech-talks.html",
  "pages/engineering-usage-reports.html",
  "pages/engineering-visiting-customers.html",
  "pages/engineering-working-with-max-ai.html",
  "pages/engineering-writing-blogs.html",
  "pages/engineering-writing-docs.html",
  "pages/exec-all-hands-topics.html",
  "pages/exec-annual-planning.html",
  "pages/exec-responsibilities.html",
  "pages/finance.html",
  "pages/forward-deployed-engineering-how-to-get-fde-involved.html",
  "pages/forward-deployed-engineering-how-we-work.html",
  "pages/forward-deployed-engineering-new-hire-onboarding.html",
  "pages/forward-deployed-engineering-overview.html",
  "pages/forward-deployed-engineering-working-with-customers.html",
  "pages/forward-deployed-engineering-working-with-product-engineering.html",
  "pages/forward-deployed-engineering-working-with-sales-and-cs.html",
  "pages/future.html",
  "pages/getting-started-meetings.html",
  "pages/growth-billing-customer-billing-configurations.html",
  "pages/growth-cross-selling-cross-sell-motions.html",
  "pages/growth-cross-selling-error-tracking-cross-sell.html",
  "pages/growth-cross-selling-how-we-upsell-and-cross-sell.html",
  "pages/growth-cross-selling-tracking-cross-sells.html",
  "pages/growth-growth-engineering-growth-sessions.html",
  "pages/growth-growth-engineering-per-product-activation.html",
  "pages/growth-growth-engineering-product-intents.html",
  "pages/growth-revops-credits.html",
  "pages/growth-revops-enrichment-pipeline.html",
  "pages/growth-revops-lead-assignment-tracker.html",
  "pages/growth-revops-lifecycle-analysis.html",
  "pages/growth-revops-metric-conventions.html",
  "pages/growth-revops-overview.html",
  "pages/growth-revops-retention-metrics.html",
  "pages/growth-revops-revenue-adjustments.html",
  "pages/growth-sales-account-allocation.html",
  "pages/growth-sales-account-planning.html",
  "pages/growth-sales-accounts-overview.html",
  "pages/growth-sales-automations.html",
  "pages/growth-sales-billing.html",
  "pages/growth-sales-communications-templates-feature-adoption.html",
  "pages/growth-sales-communications-templates-fundraising.html",
  "pages/growth-sales-communications-templates-incidents.html",
  "pages/growth-sales-communications-templates.html",
  "pages/growth-sales-contract-rules.html",
  "pages/growth-sales-contracts.html",
  "pages/growth-sales-crm.html",
  "pages/growth-sales-csm-tam-overlay-coverage.html",
  "pages/growth-sales-customer-faqs.html",
  "pages/growth-sales-customer-industry-segments.html",
  "pages/growth-sales-customer-journey.html",
  "pages/growth-sales-customer-onboarding.html",
  "pages/growth-sales-customer-onsites.html",
  "pages/growth-sales-customer-training.html",
  "pages/growth-sales-evaluating-growth-potential.html",
  "pages/growth-sales-expansion-and-retention.html",
  "pages/growth-sales-expansion-strategies.html",
  "pages/growth-sales-getting-people-to-talk-to-you.html",
  "pages/growth-sales-grow-an-account.html",
  "pages/growth-sales-historical-import.html",
  "pages/growth-sales-how-to-do-discovery.html",
  "pages/growth-sales-how-to-pitch-self-driving.html",
  "pages/growth-sales-how-we-work.html",
  "pages/growth-sales-lead-scoring.html",
  "pages/growth-sales-new-business-how-we-work.html",
  "pages/growth-sales-new-hire-onboarding.html",
  "pages/growth-sales-new-sales.html",
  "pages/growth-sales-outbound-sales.html",
  "pages/growth-sales-overview.html",
  "pages/growth-sales-product-enablement.html",
  "pages/growth-sales-product-led-lead-qualification.html",
  "pages/growth-sales-product-led-sales.html",
  "pages/growth-sales-professional-services.html",
  "pages/growth-sales-refunds.html",
  "pages/growth-sales-risk-mitigation-and-churn-prevention.html",
  "pages/growth-sales-running-trials.html",
  "pages/growth-sales-sales-and-cs-tools.html",
  "pages/growth-sales-sales-operations.html",
  "pages/growth-sales-sandboxes.html",
  "pages/growth-sales-selling-via-aws.html",
  "pages/growth-sales-slack-channels.html",
  "pages/growth-sales-tam-excellence.html",
  "pages/growth-sales-team-leads.html",
  "pages/growth-sales-trials.html",
  "pages/growth-sales-turning-knowledge-into-agent-skills.html",
  "pages/growth-sales-user-event-streams.html",
  "pages/growth-sales-utilization-by-business-type.html",
  "pages/growth-sales-who-we-do-business-with.html",
  "pages/growth-sales-why-buy-posthog.html",
  "pages/growth-use-case-selling-ai-llm-observability.html",
  "pages/growth-use-case-selling-customer-experience.html",
  "pages/growth-use-case-selling-data-infrastructure.html",
  "pages/growth-use-case-selling-growth-and-marketing.html",
  "pages/growth-use-case-selling-observability.html",
  "pages/growth-use-case-selling-product-intelligence.html",
  "pages/growth-use-case-selling-release-engineering.html",
  "pages/growth-use-case-selling-use-case-selling.html",
  "pages/help.html",
  "pages/how-we-get-users.html",
  "pages/how-we-make-money.html",
  "pages/low-prices.html",
  "pages/making-users-happy.html",
  "pages/marketing-campaigns-and-coupons.html",
  "pages/marketing-co-marketing.html",
  "pages/marketing-collaborating-with-pms.html",
  "pages/marketing-customer-case-studies.html",
  "pages/marketing-email-comms.html",
  "pages/marketing-events.html",
  "pages/marketing-exporting-blog-post-image.html",
  "pages/marketing-how-we-position-and-sell-error-tracking.html",
  "pages/marketing-how-we-position-and-sell-logs.html",
  "pages/marketing-how-we-position-and-sell-workflows.html",
  "pages/marketing-in-app.html",
  "pages/marketing-incident-comms.html",
  "pages/marketing-index.html",
  "pages/marketing-influencers.html",
  "pages/marketing-onboarding-and-lifecycle-emails.html",
  "pages/marketing-open-source-sponsorship.html",
  "pages/marketing-ownership.html",
  "pages/marketing-paid.html",
  "pages/marketing-partners.html",
  "pages/marketing-positioning-analytics.html",
  "pages/marketing-positioning-data-pipelines.html",
  "pages/marketing-positioning-data-warehouse.html",
  "pages/marketing-positioning-desktop.html",
  "pages/marketing-positioning-endpoints.html",
  "pages/marketing-positioning-experiments.html",
  "pages/marketing-positioning-feature-flags.html",
  "pages/marketing-positioning-index.html",
  "pages/marketing-positioning-llm-analytics.html",
  "pages/marketing-positioning-posthog-ai.html",
  "pages/marketing-positioning-session-replay.html",
  "pages/marketing-press.html",
  "pages/marketing-product-announcements.html",
  "pages/marketing-slack-messaging.html",
  "pages/marketing-social-media.html",
  "pages/marketing-speaker-guide.html",
  "pages/marketing-startups.html",
  "pages/marketing-templates.html",
  "pages/marketing-testimonials.html",
  "pages/marketing-video.html",
  "pages/marketing-working-with-website.html",
  "pages/onboarding-chrome-extension-billing-case-study-wildfire.html",
  "pages/onboarding-metabase-account-analysis.html",
  "pages/onboarding-new-hire-onboarding.html",
  "pages/onboarding-onboarding-conversations-playbook.html",
  "pages/onboarding-onboarding-data.html",
  "pages/onboarding-onboarding-program.html",
  "pages/onboarding-onboarding-team.html",
  "pages/onboarding-onboarding-tracking.html",
  "pages/onboarding-sales-handover.html",
  "pages/people-benefits.html",
  "pages/people-bookhog.html",
  "pages/people-career-progression.html",
  "pages/people-compensation.html",
  "pages/people-feedback.html",
  "pages/people-finance.html",
  "pages/people-grievances.html",
  "pages/people-hiring-process-design-hiring.html",
  "pages/people-hiring-process-devrel-hiring.html",
  "pages/people-hiring-process-engineering-hiring.html",
  "pages/people-hiring-process-engineering-superday.html",
  "pages/people-hiring-process-engineering-tech-screen.html",
  "pages/people-hiring-process-exec-hiring.html",
  "pages/people-hiring-process-how-to-interview.html",
  "pages/people-hiring-process-index.html",
  "pages/people-hiring-process-marketing-hiring.html",
  "pages/people-hiring-process-operations-hiring.html",
  "pages/people-hiring-process-sales-cs-hiring.html",
  "pages/people-hogpatch-operations.html",
  "pages/people-hogpatch.html",
  "pages/people-offboarding.html",
  "pages/people-onboarding.html",
  "pages/people-overview.html",
  "pages/people-philosophy-club.html",
  "pages/people-ramp-up-product-manager.html",
  "pages/people-share-options.html",
  "pages/people-side-gigs.html",
  "pages/people-spending-money.html",
  "pages/people-talent.html",
  "pages/people-time-off.html",
  "pages/people-training.html",
  "pages/product-metrics.html",
  "pages/product-per-product-cost-margin-analysis.html",
  "pages/product-per-product-growth-reviews.html",
  "pages/product-prioritizing-work-for-mature-products.html",
  "pages/product-product-manager-hiring.html",
  "pages/product-product-manager-onboarding.html",
  "pages/product-product-manager-role.html",
  "pages/product-product-team.html",
  "pages/product-releasing-new-products-and-features.html",
  "pages/product-user-feedback.html",
  "pages/product-visiting-customers.html",
  "pages/story.html",
  "pages/strong-team.html",
  "pages/support-snippets-our-long-term-vision.html",
  "pages/support-snippets-support-values.html",
  "pages/support-snippets-what-makes-us-great.html",
  "pages/support-snippets-what-we-do.html",
  "pages/support-customer-support.html",
  "pages/support-posthog-support.html",
  "pages/support-support-incident-response.html",
  "pages/support-support-smes.html",
  "pages/support-support-team.html",
  "pages/support-support-zero.html",
  "pages/support-troubleshooting-tips.html",
  "pages/values.html",
  "pages/which-products.html",
  "pages/who-we-build-for.html",
  "pages/why-does-posthog-exist.html",
  "pages/wide-company.html",
  "pages/wizard-and-docs-snippets-hogref-schema.html",
  "pages/wizard-and-docs-api-specifications.html",
  "pages/wizard-and-docs-content-writer-agent.html",
  "pages/wizard-and-docs-context-mill.html",
  "pages/wizard-and-docs-developing-the-wizard.html",
  "pages/wizard-and-docs-docs-ownership.html",
  "pages/wizard-and-docs-docs-style-guide.html",
  "pages/wizard-and-docs-how-to-publish-changelog.html",
  "pages/wizard-and-docs-index.html",
  "pages/wizard-and-docs-mdx-and-components.html",
  "pages/wizard-and-docs-onboarding-docs.html",
  "pages/wizard-and-docs-pocket-guides.html",
  "pages/wizard-and-docs-sdk-reference-docs.html",
  "pages/wizard-and-docs-vale.html",
  "pages/wizard-and-docs-writing-product-docs.html",
  "pages/world-class-engineering.html"
];

self.addEventListener("install", (event) => {
  event.waitUntil(
    caches.open(CACHE_NAME)
      .then((cache) => cache.addAll(CORE_PATHS.map((item) => new URL(item, self.registration.scope).href)))
      .then(() => self.skipWaiting())
  );
});

self.addEventListener("activate", (event) => {
  event.waitUntil(
    caches.keys()
      .then((names) => Promise.all(names.filter((name) => name.startsWith("posthog-handbook-") && name !== CACHE_NAME).map((name) => caches.delete(name))))
      .then(() => self.clients.claim())
  );
});

self.addEventListener("fetch", (event) => {
  const request = event.request;
  if (request.method !== "GET") return;
  const url = new URL(request.url);
  if (url.origin !== self.location.origin) return;
  event.respondWith(
    fetch(request)
      .then((response) => {
        const copy = response.clone();
        caches.open(CACHE_NAME).then((cache) => cache.put(request, copy));
        return response;
      })
      .catch(() => caches.match(request).then((cached) => cached || caches.match(new URL("offline.html", self.registration.scope).href)))
  );
});
