failproofai 0.0.11-beta.2 → 0.0.11-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +8 -1
- package/.next/standalone/.next/build-manifest.json +10 -10
- package/.next/standalone/.next/prerender-manifest.json +3 -32
- package/.next/standalone/.next/required-server-files.json +2 -1
- package/.next/standalone/.next/routes-manifest.json +45 -3
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js +6 -6
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/_not-found/page/next-font-manifest.json +2 -6
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +12 -13
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +16 -16
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/audit/run/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/audit/run/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/audit/run/route.js +8 -0
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/audit/run/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/audit/status/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/audit/status/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/audit/status/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/audit/status/route.js +6 -0
- package/.next/standalone/.next/server/app/api/audit/status/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/audit/status/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js +6 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/login-request/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js +7 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/login-verify/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route.js +7 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/logout/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js +7 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/reminder/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/auth/status/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/auth/status/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/auth/status/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/auth/status/route.js +7 -0
- package/.next/standalone/.next/server/app/api/auth/status/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/auth/status/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js +3 -3
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/audit/page/build-manifest.json +18 -0
- package/.next/standalone/.next/server/app/audit/page/next-font-manifest.json +6 -0
- package/.next/standalone/.next/server/app/audit/page/react-loadable-manifest.json +1 -0
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +29 -0
- package/.next/standalone/.next/server/app/audit/page.js +17 -0
- package/.next/standalone/.next/server/app/audit/page.js.map +5 -0
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +16 -17
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +16 -17
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -3
- package/.next/standalone/.next/server/app/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/page/next-font-manifest.json +2 -6
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js +14 -15
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/policies/page/next-font-manifest.json +2 -6
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/policies/page.js +16 -16
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/project/[name]/page/next-font-manifest.json +2 -6
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js +16 -17
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/next-font-manifest.json +2 -6
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +19 -20
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/build-manifest.json +7 -7
- package/.next/standalone/.next/server/app/projects/page/next-font-manifest.json +2 -6
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js +15 -16
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +8 -1
- package/.next/standalone/.next/server/chunks/[externals]__14odj07._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[externals]__0z0j--b._.js → [externals]__1nl3dvw._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]__0-p9.k~._.js → [externals]__1s61mel._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[externals]_node_os_06ur78j._.js → [externals]_node_os_0by37l-._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__07tgnzi._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0kjo7d_._.js → [root-of-the-server]__0_0xu5z._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cag8qd._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0z-180.._.js → [root-of-the-server]__0cycwg6._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__08px0ym._.js → [root-of-the-server]__0f7mikp._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0oeun7z._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q-v9z2._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0rv7m0k._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0g48iv.._.js → [root-of-the-server]__0sb_5m8._.js} +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0j8-xkl._.js → [root-of-the-server]__0xuaoik._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12pit4m._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__13h8pzr._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__13ra2jq._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__17g9wh7._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0d_ob4n._.js → [root-of-the-server]__1_mqemn._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1b9z5-i._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0vlhtkc._.js → [root-of-the-server]__1hgv_75._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1ixjiy8._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0wu7fr7._.js → [root-of-the-server]__1jm9fw6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1legmza._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0fwb7ao._.js → [root-of-the-server]__1m2_4t0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0yfq1yr._.js → [root-of-the-server]__1mhmdzs._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0zso~62._.js → [root-of-the-server]__1ou2ehh._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1qxztj-._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1rhmvod._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0.~nmr9._.js → [root-of-the-server]__1w9zl9-._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{_0ebx_lc._.js → _0p53ge1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/_1-1804f._.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_audit_run_route_actions_1qgp9io.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_audit_status_route_actions_1f7pjof.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_login-request_route_actions_1c49co0.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_login-verify_route_actions_1r3slzk.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_logout_route_actions_0regwyr.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_reminder_route_actions_1kjgxf8.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_auth_status_route_actions_1aho9zu.js +3 -0
- package/.next/standalone/.next/server/chunks/{_next-internal_server_app_api_download_[project]_[session]_route_actions_0wb00i-.js → _next-internal_server_app_api_download_[project]_[session]_route_actions_1is7vs7.js} +1 -1
- package/.next/standalone/.next/server/chunks/{lib_logger_ts_047tt9f._.js → lib_logger_ts_07e65t5._.js} +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_17k9e3w.js +23 -0
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p7._.js +3 -0
- package/.next/standalone/.next/server/chunks/{package_json_[json]_cjs_0z7w.hh._.js → package_json_[json]_cjs_1nxcc4v._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[externals]__12dv.x0._.js → [externals]__1_g_b3t._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[externals]_node_async_hooks_0v0ln8c._.js → [externals]_node_async_hooks_1gjz99j._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ts150~._.js → [root-of-the-server]__0-wdurj._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__00jkjmt._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__013du6r._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06f-yix._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0989_dx._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e85wxv._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0gfxvb1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h12me5._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0l13qf2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-scthx._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11rtg6s._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__14dd6h8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1cd25c7._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0t5l7a5._.js → [root-of-the-server]__1d8omgc._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0tcyn68._.js → [root-of-the-server]__1dky4g0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__098zro9._.js → [root-of-the-server]__1fax1sl._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1hlrq6y._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1ihxdo5._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1mt35_w._.js +221 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0-wn51s._.js → [root-of-the-server]__1pcxxwg._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1usf8v2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1vvfde2._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__212nf49._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_03d7qyt._.js → _05whahf._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_11_p9y8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0xb8ngh._.js → _1kje4fm._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0zx~s__._.js → _1p0-leb._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_04qfs8z._.js → app_087bt9w._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_0uosk1e._.js → app_1fvisnp._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_13f0ohr._.js → app_209u41o._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47._.js +43 -0
- package/.next/standalone/.next/server/chunks/ssr/app_audit_loading_tsx_1j1kc6j._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{app_error_tsx_11t4ysq._.js → app_error_tsx_1zds1ns._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_global-error_tsx_0m9qisk._.js → app_global-error_tsx_113y3za._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_global-error_tsx_0xerkr6._.js → app_global-error_tsx_1kp6l3x._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpc._.js +8 -0
- package/.next/standalone/.next/server/chunks/ssr/{app_project_[name]_error_tsx_0.9-fod._.js → app_project_[name]_error_tsx_1v02_5n._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_project_[name]_loading_tsx_03g9xy0._.js → app_project_[name]_loading_tsx_05-l4uf._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_project_[name]_session_[sessionId]_error_tsx_0ler-mr._.js → app_project_[name]_session_[sessionId]_error_tsx_0-lj3nd._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{app_project_[name]_session_[sessionId]_loading_tsx_0c0e3yx._.js → app_project_[name]_session_[sessionId]_loading_tsx_0l4aixs._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_projects_loading_tsx_20-3u8b._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{lib_codex-projects_ts_0eosib~._.js → lib_codex-projects_ts_0pqlw37._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{lib_copilot-projects_ts_0r8xkn8._.js → lib_copilot-projects_ts_19wl7tp._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{lib_cursor-projects_ts_0qt1scg._.js → lib_cursor-projects_ts_18-iwyk._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{lib_gemini-projects_ts_0sl~yqr._.js → lib_gemini-projects_ts_1c7bgx-._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{lib_opencode-projects_ts_0op9gyp._.js → lib_opencode-projects_ts_15bjxkm._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{lib_pi-projects_ts_103tsh1._.js → lib_pi-projects_ts_1wikofb._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{lib_utils_ts_068jk73._.js → lib_utils_ts_0az0sfq._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_1ynf7el._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_html2canvas_dist_html2canvas_esm_0hmsdod.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_html2canvas_dist_html2canvas_esm_1n-0xws.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_0rd0oc-._.js → node_modules_next_1a1kch7._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_0h9llsw._.js → node_modules_next_dist_0uboya6._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_11dij6w._.js → node_modules_next_dist_1d_onnt._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_client_components_0inhx6q._.js → node_modules_next_dist_client_components_0wpq8j3._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js → node_modules_next_dist_client_components_builtin_forbidden_0symwr9.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js → node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0x.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0-uvagv.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_03c7gi5.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_09p-8om.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0v-kfiu.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_next_dist_esm_build_templates_app-page_0j79~gv.js → node_modules_next_dist_esm_build_templates_app-page_0xrgzyz.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1806lsc.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1j6dd-e.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1sa65r-.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuzn._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1ezd2jf._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/src_hooks_1tnuifj._.js +5 -0
- package/.next/standalone/.next/server/functions-config-manifest.json +3 -0
- package/.next/standalone/.next/server/instrumentation.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +10 -10
- package/.next/standalone/.next/server/middleware.js +2 -2
- package/.next/standalone/.next/server/next-font-manifest.js +1 -1
- package/.next/standalone/.next/server/next-font-manifest.json +2 -21
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +27 -9
- package/.next/standalone/.next/static/chunks/{07uz2g0_38qia.js → 03fmihek9n986.js} +1 -1
- package/.next/standalone/.next/static/chunks/09ueq8s1as8xs.css +2 -0
- package/.next/standalone/.next/static/chunks/0fkntmojmibda.js +6 -0
- package/.next/standalone/.next/static/chunks/{11w14gnqzprir.js → 0nbmu4_n1j2-c.js} +1 -1
- package/.next/standalone/.next/static/chunks/0qassxjx1ef04.js +1 -0
- package/.next/standalone/.next/static/chunks/0zbxssxh53n-3.js +1 -0
- package/.next/standalone/.next/static/chunks/13f1kmjea-0md.js +2 -0
- package/.next/standalone/.next/static/chunks/1btx2c49fk9xt.css +1 -0
- package/.next/standalone/.next/static/chunks/1bxdpd036n3l9.js +41 -0
- package/.next/standalone/.next/static/chunks/{0bke.~atnsbeb.js → 1e0o-6kjfnwzh.js} +1 -1
- package/.next/standalone/.next/static/chunks/20b5bz43so-1k.js +1 -0
- package/.next/standalone/.next/static/chunks/2zjavpea8glet.js +1 -0
- package/.next/standalone/.next/static/chunks/{0d3shmwh5_nmn.js → 33u59vf_8xpd-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0dvhi-prcsh3~.js → 36l507r2mbf5h.js} +1 -1
- package/.next/standalone/.next/static/chunks/3gti1qdk5epqn.js +1 -0
- package/.next/standalone/.next/static/chunks/{17mubwtqwijpu.js → 3w8d8k_dca5rp.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0bv1oyxspkpkb.js → 3y3l184vijlfg.js} +1 -1
- package/.next/standalone/.next/static/chunks/41jjdgqqpl7em.js +1 -0
- package/.next/standalone/.next/static/chunks/{turbopack-0nh.aopesgj~5.js → turbopack-00qy7zfa7m--m.js} +1 -1
- package/.next/standalone/SECURITY.md +73 -0
- package/.next/standalone/app/actions/get-audit-result.ts +24 -0
- package/.next/standalone/app/api/audit/_state.ts +72 -0
- package/.next/standalone/app/api/audit/run/route.ts +89 -0
- package/.next/standalone/app/api/audit/status/route.ts +23 -0
- package/.next/standalone/app/api/auth/login-request/route.ts +91 -0
- package/.next/standalone/app/api/auth/login-verify/route.ts +98 -0
- package/.next/standalone/app/api/auth/logout/route.ts +48 -0
- package/.next/standalone/app/api/auth/reminder/route.ts +213 -0
- package/.next/standalone/app/api/auth/status/route.ts +42 -0
- package/.next/standalone/app/audit/_components/audit-dashboard.tsx +364 -0
- package/.next/standalone/app/audit/_components/auth-dialog.tsx +401 -0
- package/.next/standalone/app/audit/_components/empty-state.tsx +146 -0
- package/.next/standalone/app/audit/_components/findings-section.tsx +135 -0
- package/.next/standalone/app/audit/_components/identity-section.tsx +126 -0
- package/.next/standalone/app/audit/_components/policies-section.tsx +194 -0
- package/.next/standalone/app/audit/_components/report-footer.tsx +35 -0
- package/.next/standalone/app/audit/_components/rerun-button.tsx +81 -0
- package/.next/standalone/app/audit/_components/return-section.tsx +428 -0
- package/.next/standalone/app/audit/_components/run-progress.tsx +120 -0
- package/.next/standalone/app/audit/_components/score-section.tsx +179 -0
- package/.next/standalone/app/audit/_components/share-dock.tsx +265 -0
- package/.next/standalone/app/audit/_components/share-templates.ts +67 -0
- package/.next/standalone/app/audit/_components/show-off-cta.tsx +135 -0
- package/.next/standalone/app/audit/_components/sigil.tsx +93 -0
- package/.next/standalone/app/audit/_components/strengths-section.tsx +57 -0
- package/.next/standalone/app/audit/audit-styles.css +2066 -0
- package/.next/standalone/app/audit/loading.tsx +24 -0
- package/.next/standalone/app/audit/page.tsx +53 -0
- package/.next/standalone/app/globals.css +570 -137
- package/.next/standalone/app/layout.tsx +16 -9
- package/.next/standalone/app/policies/hooks-client.tsx +223 -129
- package/.next/standalone/app/project/[name]/page.tsx +89 -39
- package/.next/standalone/app/projects/loading.tsx +30 -8
- package/.next/standalone/app/projects/page.tsx +76 -18
- package/.next/standalone/assets/audit/Audit Report.html +22 -0
- package/.next/standalone/assets/audit/Show Off Your Agent.html +22 -0
- package/.next/standalone/assets/audit/archetypes.jsx +277 -0
- package/.next/standalone/assets/audit/assets/fonts/bitcount-prop-single.woff2 +0 -0
- package/.next/standalone/assets/audit/audit.jsx +825 -0
- package/.next/standalone/assets/audit/poster-styles.css +424 -0
- package/.next/standalone/assets/audit/poster.jsx +247 -0
- package/.next/standalone/assets/audit/screenshots/poster-optimist.png +0 -0
- package/.next/standalone/assets/audit/screenshots/poster-scrolled.png +0 -0
- package/.next/standalone/assets/audit/styles.css +1225 -0
- package/.next/standalone/assets/audit/tweaks-panel.jsx +425 -0
- package/.next/standalone/assets/logos/company/icon.svg +1 -0
- package/.next/standalone/assets/logos/company/logo.svg +1 -0
- package/.next/standalone/components/navbar.tsx +154 -65
- package/.next/standalone/components/reach-developers.tsx +37 -9
- package/.next/standalone/lib/atomic-write.ts +67 -0
- package/.next/standalone/lib/auth/api-server-client.ts +281 -0
- package/.next/standalone/lib/auth/auth-store.ts +250 -0
- package/.next/standalone/lib/client-telemetry.ts +2 -0
- package/.next/standalone/lib/fetch-with-timeout.ts +42 -0
- package/.next/standalone/lib/share-card.ts +144 -0
- package/.next/standalone/lib/telemetry.ts +12 -7
- package/.next/standalone/node_modules/@next/env/package.json +1 -1
- package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
- package/.next/standalone/node_modules/next/dist/client/dev/debug-channel.js +102 -2
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +11 -11
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +13 -13
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +2 -2
- package/.next/standalone/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
- package/.next/standalone/node_modules/next/dist/server/app-render/action-handler.js +18 -8
- package/.next/standalone/node_modules/next/dist/server/config-schema.js +1 -0
- package/.next/standalone/node_modules/next/dist/server/config.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/encode-cache-tag.js +45 -0
- package/.next/standalone/node_modules/next/dist/server/lib/implicit-tags.js +6 -3
- package/.next/standalone/node_modules/next/dist/server/lib/patch-fetch.js +5 -1
- package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/web/spec-extension/revalidate.js +4 -3
- package/.next/standalone/node_modules/next/dist/server/web/spec-extension/unstable-cache.js +6 -2
- package/.next/standalone/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
- package/.next/standalone/node_modules/next/package.json +15 -15
- package/.next/standalone/node_modules/react/cjs/react.development.js +1 -1
- package/.next/standalone/node_modules/react/cjs/react.production.js +1 -1
- package/.next/standalone/node_modules/react/package.json +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.browser.production.js +3 -3
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.edge.production.js +3 -3
- package/.next/standalone/node_modules/react-dom/cjs/react-dom-server.node.production.js +3 -3
- package/.next/standalone/node_modules/react-dom/cjs/react-dom.production.js +1 -1
- package/.next/standalone/node_modules/react-dom/package.json +2 -2
- package/.next/standalone/osv-scanner.toml +17 -0
- package/.next/standalone/package.json +8 -3
- package/.next/standalone/public/audit/fonts/bitcount-prop-single.woff2 +0 -0
- package/.next/standalone/public/icon.svg +1 -0
- package/.next/standalone/public/logo.svg +1 -0
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/templates/bitcount-font/README.md +42 -0
- package/.next/standalone/templates/bitcount-font/bitcount-prop-single.woff2 +0 -0
- package/.next/standalone/templates/bitcount-font/bitcount.css +49 -0
- package/.next/standalone/templates/bitcount-font/fonts.ts.example +23 -0
- package/README.md +2 -1
- package/bin/failproofai.mjs +165 -144
- package/dist/cli.mjs +607 -1858
- package/lib/atomic-write.ts +67 -0
- package/lib/auth/api-server-client.ts +281 -0
- package/lib/auth/auth-store.ts +250 -0
- package/lib/client-telemetry.ts +2 -0
- package/lib/fetch-with-timeout.ts +42 -0
- package/lib/share-card.ts +144 -0
- package/lib/telemetry.ts +12 -7
- package/package.json +8 -3
- package/scripts/install-telemetry.mjs +4 -0
- package/src/audit/archetypes.ts +924 -0
- package/src/audit/cache.ts +21 -2
- package/src/audit/dashboard-cache.ts +111 -0
- package/src/audit/features.ts +268 -0
- package/src/audit/findings.ts +298 -0
- package/src/audit/index.ts +39 -21
- package/src/audit/replay.ts +29 -3
- package/src/audit/scoring.ts +174 -0
- package/src/audit/strengths.ts +138 -0
- package/src/audit/types.ts +24 -1
- package/src/auth/cli.ts +359 -0
- package/src/hooks/builtin-policies.ts +2 -1
- package/src/hooks/hook-telemetry.ts +2 -2
- package/src/hooks/policy-registry.ts +20 -0
- package/src/posthog-key.ts +9 -0
- package/.next/standalone/.next/server/app/icon.png/route/app-paths-manifest.json +0 -3
- package/.next/standalone/.next/server/app/icon.png/route.js +0 -7
- package/.next/standalone/.next/server/app/icon.png/route.js.nft.json +0 -1
- package/.next/standalone/.next/server/app/icon.png.body +0 -0
- package/.next/standalone/.next/server/app/icon.png.meta +0 -1
- package/.next/standalone/.next/server/chunks/[externals]_next_dist_0sqmaqd._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06.arfm._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0__i0h0._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fe7_q_._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fw.e.h._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pxn0e1._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xv0jh2._.js +0 -3
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_icon_png_route_actions_12.gv.r.js +0 -3
- package/.next/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0bdfoky.js +0 -3
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_05pz9._._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01as125._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0370~qj._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09v.ljl._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0agrcb8._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0b7hkr~._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ehh6vp._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g8l0tu._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j4l6hl._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0k5n2kz._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lp08ll._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n0yaqw._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0o21f.o._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0t8juvy._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0uylufv._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ymlddl._.js +0 -223
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~03grs._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/app_0cdqd9w._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +0 -8
- package/.next/standalone/.next/server/chunks/ssr/app_projects_loading_tsx_13veom4._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_0ttbz1~._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_06u0kr8._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0a_7sdg.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0ef3uwk.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0pbja1x.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0r6o0i2.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_11y81~_.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_12or2kf.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_0mebn66._.js +0 -3
- package/.next/standalone/.next/static/chunks/07kpqoo7kuckx.js +0 -6
- package/.next/standalone/.next/static/chunks/0azb~vy9ds_uy.js +0 -1
- package/.next/standalone/.next/static/chunks/0f5p9plm.aqlp.css +0 -2
- package/.next/standalone/.next/static/chunks/0ffvlbgzgnlw7.js +0 -2
- package/.next/standalone/.next/static/chunks/0spktq7xqab9h.js +0 -1
- package/.next/standalone/.next/static/chunks/118q3uljozd5z.js +0 -4
- package/.next/standalone/.next/static/chunks/12pt~2f.c1sha.js +0 -1
- package/.next/standalone/.next/static/media/4fa387ec64143e14-s.0.qu-9752pffj.woff2 +0 -0
- package/.next/standalone/.next/static/media/5ce348bf30bf5439-s.0ee55_hj9qcer.woff2 +0 -0
- package/.next/standalone/.next/static/media/6306c77e7c8268e4-s.0mao5jbfbduzp.woff2 +0 -0
- package/.next/standalone/.next/static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2 +0 -0
- package/.next/standalone/.next/static/media/7d817b4c03b0c5f1-s.0uzt.a6d44yda.woff2 +0 -0
- package/.next/standalone/.next/static/media/bbc41e54d2fcbd21-s.0mvwgmnhv29no.woff2 +0 -0
- package/.next/standalone/.next/static/media/icon.0a.gigb3_x5pd.png +0 -0
- package/.next/standalone/app/icon.png +0 -0
- package/src/audit/telemetry.ts +0 -113
- /package/.next/standalone/.next/server/app/{icon.png → api/audit/run}/route/build-manifest.json +0 -0
- /package/.next/standalone/.next/server/app/{icon.png → api/audit/run}/route.js.map +0 -0
- /package/.next/standalone/.next/static/chunks/{03~yq9q893hmn.js → 0cz1d0mv5g_q7.js} +0 -0
- /package/.next/standalone/.next/static/chunks/{0a40sy4tk8ioe.js → 0wwt5o04i4zwh.js} +0 -0
- /package/.next/standalone/.next/static/chunks/{0n1n67imq.udf.js → 1__i9af9g78vd.js} +0 -0
- /package/.next/standalone/.next/static/chunks/{0w6fzf.07a24u.js → 2so39wg7mjbi7.js} +0 -0
- /package/.next/standalone/.next/static/chunks/{0xbo5nl6w4lka.js → 2wbuxnsvux4di.js} +0 -0
- /package/.next/standalone/.next/static/chunks/{0_s0luks5tay-.js → 35fgpd_feci6x.js} +0 -0
- /package/.next/standalone/.next/static/chunks/{15fklyav5py5m.js → 3xpjn3cdgm-7m.js} +0 -0
- /package/.next/standalone/.next/static/chunks/{17.b3suj8zjjj.js → 4448_qq7bd963.js} +0 -0
- /package/.next/standalone/.next/static/{tGVQM5SE3NvbVu0gbAJm7 → t4nu8RTRp3Z2srol-9pVb}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{tGVQM5SE3NvbVu0gbAJm7 → t4nu8RTRp3Z2srol-9pVb}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{tGVQM5SE3NvbVu0gbAJm7 → t4nu8RTRp3Z2srol-9pVb}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
module.exports=[23037,(e,o,d)=>{}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=_next-internal_server_app_api_download_%5Bproject%5D_%5Bsession%
|
|
3
|
+
//# sourceMappingURL=_next-internal_server_app_api_download_%5Bproject%5D_%5Bsession%5D_route_actions_1is7vs7.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module.exports=[89498,e=>{"use strict";var t=e.i(47909),i=e.i(74017),o=e.i(96250),n=e.i(59756),r=e.i(61916),a=e.i(74677),s=e.i(69741),l=e.i(16795),c=e.i(87718),p=e.i(95169),d=e.i(47587),u=e.i(66012),m=e.i(70101),f=e.i(26937),h=e.i(10372),g=e.i(93695);e.i(20232);var y=e.i(220),b=e.i(89171),w=e.i(71809),k=e.i(50227),v=e.i(12714),N=e.i(74533),S=e.i(60526);function T(e){return e?{decision:"allow",reason:e}:{decision:"allow"}}function E(e){return{decision:"deny",reason:e}}function P(e){return{decision:"instruct",reason:e}}let $="__FAILPROOFAI_POLICY_REGISTRY__",C="__FAILPROOFAI_POLICY_INDEX_CACHE__",A="failproofai";function x(e){return e.includes("/")?e:`${A}/${e}`}function I(e){globalThis[C]=e}function R(){let e=globalThis;return e[$]||(e[$]=[]),e[$]}var O=e.i(2157);let B={info:0,warn:1,error:2},j=(0,k.join)((0,S.homedir)(),".failproofai","logs"),_=!1,D="warn",W=!1,U=j;function M(e){return!function(){if(_)return;_=!0;let e=(process.env.FAILPROOFAI_LOG_LEVEL??"").toLowerCase();("info"===e||"warn"===e||"error"===e)&&(D=e);let t=(process.env.FAILPROOFAI_HOOK_LOG_FILE??"").trim();t&&(W=!0,"1"!==t&&"true"!==t&&(U=t))}(),B[e]>=B[D]}function L(e,t){process.stderr.write(`[failproofai:hook] ${e} ${t}
|
|
2
|
+
`)}function z(e,t){if(W)try{(0,O.existsSync)(U)||(0,O.mkdirSync)(U,{recursive:!0});let i=(0,k.join)(U,"hooks.log");try{if((0,O.statSync)(i).size>=524288){let e=`hooks-${Date.now()}.log`;(0,O.renameSync)(i,(0,k.join)(U,e))}}catch{}let o=new Date().toISOString(),n=`[${o}] ${e} ${t}
|
|
3
|
+
`;(0,O.appendFileSync)(i,n,"utf-8")}catch{}}function q(e){M("info")&&(L("INFO",e),z("INFO",e))}function H(e){M("warn")&&(L("WARN",e),z("WARN",e))}let F=function(e){let t=e.replaceAll("\\","/");for(let e of[".claude",".codex",".copilot",".cursor",".opencode",".pi",".gemini"]){let i=(0,k.join)((0,S.homedir)(),e).replaceAll("\\","/");if(t===i||t.startsWith(i+"/"))return!0}for(let e of[(0,k.join)(".config","opencode"),(0,k.join)(".local","share","opencode")]){let i=(0,k.join)((0,S.homedir)(),e).replaceAll("\\","/");if(t===i||t.startsWith(i+"/"))return!0}return!1},G=function(e){return!!(/[\\/]\.claude[\\/]settings(?:\.[^/\\]+)?\.json$/.test(e)||/[\\/]\.codex[\\/]hooks\.json$/.test(e)||/[\\/]\.copilot[\\/]hooks[\\/][^/\\]+\.json$/.test(e)||/[\\/]\.github[\\/]hooks[\\/][^/\\]+\.json$/.test(e)||/[\\/]\.cursor[\\/]hooks\.json$/.test(e)||/[\\/]\.opencode[\\/]opencode\.jsonc?$/.test(e)||/[\\/]\.opencode[\\/]plugins[\\/][^/\\]+\.(?:mjs|js|ts)$/.test(e)||/[\\/]\.config[\\/]opencode[\\/]opencode\.jsonc?$/.test(e)||/[\\/]\.config[\\/]opencode[\\/]config\.json$/.test(e)||/[\\/]\.config[\\/]opencode[\\/]plugins[\\/][^/\\]+\.(?:mjs|js|ts)$/.test(e)||/[\\/]\.pi[\\/](?:agent[\\/])?settings\.json$/.test(e)||/[\\/]\.pi[\\/](?:agent[\\/])?extensions[\\/]/.test(e)||/[\\/]\.gemini[\\/]settings\.json$/.test(e)||/[\\/]\.gemini[\\/]hooks[\\/]/.test(e))};function J(e){return e.toolInput?.command??""}function Y(e){return e.toolInput?.file_path??""}function Z(e){return e.trim().split(/\s+/).map(e=>e.replace(/^['"]|['"]$/g,""))}let K=new Set(["&&","||","|",";"]),Q=/[;&<>`$()\\]/,V=/eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/,X=[[/sk-ant-[A-Za-z0-9\-_]{20,}/,"Anthropic API key"],[/sk-proj-[A-Za-z0-9\-_]{20,}/,"OpenAI project API key"],[/sk-[A-Za-z0-9]{20,}/,"OpenAI API key"],[/ghp_[A-Za-z0-9]{36}/,"GitHub personal access token"],[/github_pat_[A-Za-z0-9_]{82}/,"GitHub fine-grained token"],[/AKIA[A-Z0-9]{16}/,"AWS access key ID"],[/sk_live_[A-Za-z0-9]{24,}/,"Stripe live secret key"],[/sk_test_[A-Za-z0-9]{24,}/,"Stripe test secret key"],[/AIza[0-9A-Za-z\-_]{35}/,"Google API key"]],ee=/(?:postgresql|postgres|mysql|mongodb(?:\+srv)?|redis|amqps?|smtps?):\/\/[^@\s]+@/,et=/-----BEGIN (?:[A-Z]+ )?PRIVATE KEY-----/,ei=/Authorization:\s*Bearer\s+[A-Za-z0-9\-._~+/]{20,}/i,eo=/\b(?:psql|mysql|sqlite3|pgcli|clickhouse-client)\b/,en=/\b(?:DROP\s+(?:TABLE|DATABASE|SCHEMA)|TRUNCATE\b)/i,er=/\bDELETE\s+FROM\b/i,ea=/\bWHERE\b/i,es=/\bALTER\s+TABLE\b[\s\S]*\b(?:DROP\s+COLUMN|ADD\s+COLUMN|RENAME\s+(?:COLUMN|TO)|MODIFY\s+COLUMN)\b/i,el=/(?:npm\s+publish|bun\s+publish|pnpm\s+publish|yarn\s+npm\s+publish|twine\s+upload|poetry\s+publish|cargo\s+publish|gem\s+push)\b/,ec=/(?:^|\s|;|&&|\|\|)(?:env|printenv)(?:\s|$|;|&&|\|)/,ep=/echo\s+.*\$\{?[A-Za-z_]/,ed=/(?:^|\s|;|&&|\|\|)export\s+\w+/,eu=/\$env:[A-Za-z_]/i,em=/(?:Get-ChildItem|dir|gci|ls)\s+Env:/i,ef=/\[Environment\]::GetEnvironment/i,eh=/echo\s+%[A-Za-z_]/i,eg=/(?:^|[\\/])\.env(?:\.|$)/,ey=/\.env(?:\b|\s|$|\.)/,eb=/(?:^|;|&&|\|\|)\s*sudo\s/,ew=/Start-Process\s+.*-Verb\s+RunAs/i,ek=/(?:^|;|&&|\|\|)\s*runas\s/i,ev=/(?:curl|wget)\s.*\|\s*(?:sh|bash|zsh|dash|ksh|csh|tcsh|fish|ash)\b/,eN=/(?:Invoke-WebRequest|iwr|Invoke-RestMethod|irm)\s+.*\|\s*(?:Invoke-Expression|iex)/i,eS=/(?:--force|-f\b)/,eT=/\.(?:pem|key)$/,eE=/id_rsa/,eP=/credentials/,e$=/git\s+(commit|merge|rebase|cherry-pick)\b/,eC=/(?:^|;|&&|\|\||\|)\s*failproofai(?:\s|$)/,eA=/(?:npm\s+(?:uninstall|remove|un|r)\s.*failproofai|bun\s+remove\s.*failproofai|yarn\s+global\s+remove\s+failproofai|pnpm\s+(?:remove|uninstall|un)\s.*failproofai)/,ex=/\bgit\s+commit\b.*--amend\b/,eI=/\bgit\s+stash\s+(?:drop|clear)\b/,eR=/\bgit\s+add\s+(?:-A\b|--all\b|\.(?:\s|$|;|&&|\|\|))/,eO=/\bnpm\s+(?:install|i)\b(?=.*(?:\s-g\b|--global\b))/,eB=/\byarn\s+global\s+add\b/,ej=/\bpnpm\s+(?:add|install|i)\b(?=.*(?:\s-g\b|--global\b))/,e_=/\bbun\s+(?:install|add)\b(?=.*(?:\s-g\b|--global\b))/,eD=/\bcargo\s+install\b/,eW=/\bpip(?:3)?\s+install\b(?=.*(?:--user\b|--break-system-packages\b))/,eU={pip:[/\bpip\b/,/\bpip3\b/,/\bpython3?\s+-m\s+pip\b/],npm:[/\bnpm\b/,/\bnpx\b/],yarn:[/\byarn\b/],pnpm:[/\bpnpm\b/,/\bpnpx\b/],bun:[/\bbun\b/,/\bbunx\b/],uv:[/\buv\b/],poetry:[/\bpoetry\b/],pipenv:[/\bpipenv\b/],conda:[/\bconda\b/],cargo:[/\bcargo\b/]},eM=/\bnohup\s+\S/,eL=/\bscreen\s+-[A-Za-z]*d[A-Za-z]*\b/,ez=/\btmux\s+(?:new-session|new)\b[^|&;]*-d\b/,eq=/\bdisown\b/,eH=/(?<![&|])\s?&\s*(?:$|#|;)/,eF=/(?:^|[;\n]|&&|\|\|?|&)\s*kubectl(?:\s|$)/,eG=/(?:^|[;\n]|&&|\|\|?|&)\s*(?:terraform|tofu)(?:\s|$)/,eJ=/(?:^|[;\n]|&&|\|\|?|&)\s*aws(?:\s|$)/,eY=/(?:^|[;\n]|&&|\|\|?|&)\s*gcloud(?:\s|$)/,eZ=/(?:^|[;\n]|&&|\|\|?|&)\s*az(?:\s|$)/,eK=/(?:^|[;\n]|&&|\|\|?|&)\s*helm(?:\s|$)/,eQ=/(?:^|[;\n]|&&|\|\|?|&)\s*gh\s+(?:workflow\s+(?:run|enable|disable)|run\s+(?:rerun|cancel)|pr\s+merge|release\s+(?:create|delete)|cache\s+delete|secret\s+(?:set|delete))\b/,eV=new Map;function eX(e){try{let t=eV.get(e);return void 0===t&&(t=(0,N.execSync)("git rev-parse --abbrev-ref HEAD",{cwd:e,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3}).trim(),eV.set(e,t)),t||null}catch{return null}}function e0(e,t){let i=Z(e),o=Z(t);return!(i.length<o.length||i.some(e=>K.has(e))||i.some(e=>Q.test(e)))&&o.every((e,t)=>"*"===e||e===i[t])}function e1(e){return e.split(/&&|\|\||[|;\n]/).map(e=>e.trim()).filter(e=>/^git\s+push\s/.test(e)).map(e=>e.replace(/^git\s+push\s+/,""))}function e2(e,t){if(0===t.length)return!1;let i=e.split(/&&|\|\||[|;\n]/).map(e=>e.trim()).filter(e=>/\brm\b/.test(e));if(0===i.length)return!1;for(let e of i){let i=Z(e),o=i.findIndex(e=>"rm"===e);if(o<0)continue;let n=i.slice(o+1).filter(e=>/^-[^-]/.test(e)),r=i.slice(o+1).filter(e=>/^--/.test(e));if(/r/i.test(n.join(""))||r.some(e=>/^--recursive$/i.test(e)))for(let n of i.slice(o+1).filter(e=>!e.startsWith("-"))){let i=n.replace(/\/\*$/,"").replace(/\/+$/,"")||"/";if(!t.some(e=>{let t=e.replace(/\/+$/,"")||"/";return i===t||i.startsWith(t+"/")})&&!t.some(t=>{let i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return RegExp(`${i}(?:[/"'\\s/*]|$)`).test(e)}))return!1}}return!0}let e8=/(?:^|;|&&|\|\||\|)\s*(?:ls|find|cat|head|tail|less|more|wc|file|stat|tree|du)\s/;function e3(e,t,i){if("Bash"!==e.toolName)return T();let o=J(e);return!t.test(o)||(e.params?.allowPatterns??[]).some(e=>e0(o,e))?T():E(i)}let e5=/\s*(?:&&|\|\||\||;)\s*/,e6=[{name:"sanitize-jwt",description:"Stop Claude from reading JWTs in tool responses",displayTitle:"Redacted JWT tokens from tool output",impact:"Stops the agent from echoing auth tokens it saw in command output.",fn:function(e){let t=JSON.stringify(e.payload);return V.test(t)?{decision:"deny",reason:"JWT token detected in tool output",message:"[REDACTED: JWT token removed by failproofai]"}:T()},match:{events:["PostToolUse"]},defaultEnabled:!0,category:"Sanitize"},{name:"sanitize-api-keys",description:"Stop Claude from reading API keys (OpenAI, Anthropic, GitHub, AWS, Stripe, Google) in tool responses",displayTitle:"Redacted API keys from tool output",impact:"Catches OpenAI / Anthropic / GitHub / AWS / Stripe / Google keys before the model sees them.",fn:function(e){let t=JSON.stringify(e.payload);for(let[e,i]of X)if(e.test(t))return{decision:"deny",reason:`${i} detected in tool output`,message:`[REDACTED: ${i} removed by failproofai]`};for(let{regex:i,label:o}of e.params?.additionalPatterns??[])try{if(new RegExp(i).test(t))return{decision:"deny",reason:`${o} detected in tool output`,message:`[REDACTED: ${o} removed by failproofai]`}}catch{H(`additionalPatterns: invalid regex "${i}", skipping`)}return T()},match:{events:["PostToolUse"]},defaultEnabled:!0,category:"Sanitize",params:{additionalPatterns:{type:"pattern[]",description:"Additional API key patterns to scrub, each with { regex, label }",default:[]}}},{name:"sanitize-connection-strings",description:"Stop Claude from reading database connection strings with embedded credentials in tool responses",displayTitle:"Redacted database connection strings from tool output",impact:"Strips embedded DB credentials before they reach the model context.",fn:function(e){let t=JSON.stringify(e.payload);return ee.test(t)?{decision:"deny",reason:"Database connection string with credentials detected in tool output",message:"[REDACTED: connection string removed by failproofai]"}:T()},match:{events:["PostToolUse"]},defaultEnabled:!0,category:"Sanitize"},{name:"sanitize-private-key-content",description:"Stop Claude from reading PEM private key content in tool responses",displayTitle:"Redacted PEM private keys from tool output",impact:"Prevents private key bodies from being echoed into chat context.",fn:function(e){let t=JSON.stringify(e.payload);return et.test(t)?{decision:"deny",reason:"Private key content detected in tool output",message:"[REDACTED: private key content removed by failproofai]"}:T()},match:{events:["PostToolUse"]},defaultEnabled:!0,category:"Sanitize"},{name:"sanitize-bearer-tokens",displayTitle:"Redacted bearer tokens from tool output",impact:"Strips Authorization: Bearer values before they hit the model.",description:"Stop Claude from reading Authorization Bearer tokens in tool responses",fn:function(e){let t=JSON.stringify(e.payload);return ei.test(t)?{decision:"deny",reason:"Bearer token detected in tool output",message:"[REDACTED: Bearer token removed by failproofai]"}:T()},match:{events:["PostToolUse"]},defaultEnabled:!0,category:"Sanitize"},{name:"protect-env-vars",displayTitle:"Tried to dump environment variables to chat",impact:"Env vars often contain secrets; blocking `env` / `printenv` keeps them out of the model context.",description:"Prevent commands that read environment variables",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e);return ec.test(t)?E("Command reads environment variables"):ep.test(t)?E("Command echoes environment variable"):ed.test(t)?E("Command exports environment variable"):eu.test(t)?E("Command reads environment variable via PowerShell"):em.test(t)?E("Command reads environment variables via PowerShell"):ef.test(t)?E("Command reads environment variable via .NET"):eh.test(t)?E("Command echoes environment variable via cmd"):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!0,category:"Environment"},{name:"block-env-files",displayTitle:"Tried to read or write a .env file",impact:"`.env` files routinely contain API keys and DB credentials.",description:"Block reading/writing .env files",fn:function(e){let t=J(e),i=Y(e);return i&&eg.test(i)?E("Access to .env file blocked"):"Bash"===e.toolName&&ey.test(t)?E("Command references .env file"):T()},match:{events:["PreToolUse"]},defaultEnabled:!0,category:"Environment"},{name:"block-read-outside-cwd",displayTitle:"Tried to read files outside your project directory",impact:"Stops the agent from peeking at neighboring repos or your home directory.",description:"Block file reads outside the session working directory",fn:function(e){let t=process.env.CLAUDE_PROJECT_DIR||e.session?.cwd;if(!t)return T();let i=e.params?.allowPaths??[];if("Bash"===e.toolName){let o=J(e);if(!e8.test(o))return T();let n=function(e){let t,i=[],o=/(?<![a-zA-Z0-9_.\-~\\*?:=])(?:~\/[^\s;|&"'()\[\]{}]*|~(?=\s|$|[;|&"'()\[\]{}])|\/[^\s;|&"'()\[\]{}]*)/g;function n(e){let t;for(o.lastIndex=0;null!==(t=o.exec(e));){let e=t[0];"~"===e?e=(0,S.homedir)():e.startsWith("~/")&&(e=(0,k.join)((0,S.homedir)(),e.slice(2))),i.push(e)}}let r=e.length,a=!1,s=!1;for(let t=0;t<e.length;t++){let i=e[t];if('"'!==i||s)if("'"!==i||a){if("|"===i&&!a&&!s){r=t;break}}else s=!s;else a=!a}let l=e.slice(0,r),c=/"([^"]*)"|'([^']*)'/g;for(;null!==(t=c.exec(l));){let e=t[1]??t[2]??"";/[*?\[\]^$+()\\]/.test(e)||n(e)}return n(e.replace(/"[^"]*"/g,e=>" ".repeat(e.length)).replace(/'[^']*'/g,e=>" ".repeat(e.length))),i}(o),r=t.endsWith("/")?t:t+"/";for(let e of n){let o=(0,k.resolve)(t,e);if(G(o))return E(`Reading agent settings file blocked: ${o}`);if(!F(o)&&"/dev/null"!==o&&o!==t&&!o.startsWith(r)){if(i.some(e=>o===e||o.startsWith(e.endsWith("/")?e:e+"/")))continue;return E(`Bash read outside project directory blocked: ${o}`)}}return T()}let o=Y(e),n=e.toolInput?.path??"",r=o||n;if(!r)return T();let a=(0,k.resolve)(t,r);if(G(a))return E(`Reading agent settings file blocked: ${a}`);if(F(a)||"/dev/null"===a)return T();let s=t.endsWith("/")?t:t+"/";return a===t||a.startsWith(s)?T():i.some(e=>a===e||a.startsWith(e.endsWith("/")?e:e+"/"))?T():E(`Access outside project directory blocked: ${a}`)},match:{events:["PreToolUse"],toolNames:["Read","Glob","Grep","Bash"]},defaultEnabled:!1,category:"Environment",params:{allowPaths:{type:"string[]",description:"Absolute paths outside cwd that are allowed to be read",default:[]}}},{name:"block-sudo",displayTitle:"Tried to run a command with sudo",impact:"Sudo gives the agent root — blocked unless explicitly allow-listed.",description:"Block sudo commands",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e).trimStart();return eb.test(t)||t.startsWith("sudo ")?(e.params?.allowPatterns??[]).some(e=>e0(t,e))?T():E("sudo commands are blocked"):ew.test(t)?E("Elevated process launch is blocked"):ek.test(t)?E("runas elevation is blocked"):T()},match:{events:["PreToolUse","PermissionRequest"],toolNames:["Bash"]},defaultEnabled:!0,category:"Dangerous Commands",params:{allowPatterns:{type:"string[]",description:"Sudo command patterns to allow, matched token-by-token (e.g. 'sudo systemctl status')",default:[]}}},{name:"block-curl-pipe-sh",displayTitle:"Tried to pipe a downloaded script straight to a shell",impact:"`curl ... | sh` runs unverified remote code on your machine.",description:"Block piping downloads to shell",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e);return ev.test(t)?E("Piping downloads to shell is blocked"):eN.test(t)?E("Piping downloads to Invoke-Expression is blocked"):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!0,category:"Dangerous Commands"},{name:"block-rm-rf",displayTitle:"Tried to recursively delete a system path",impact:"Catches catastrophic `rm -rf /` and Windows equivalents.",description:"Prevent catastrophic deletions",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e),i=Z(t).some(e=>{let t=e.replace(/\/\*$/,"").replace(/\/+$/,"")||(e.startsWith("/")?"/":"");return"/"===t||"~"===t||/^\/[A-Za-z_][\w.-]*$/.test(t)});if(i&&(/rm\s+-[^\s]*r[^\s]*f[^\s]*/.test(t)||/rm\s+-[^\s]*f[^\s]*r[^\s]*/.test(t)))return e2(t,e.params?.allowPaths??[])?T():E("Catastrophic deletion blocked");if(i&&/\brm\b/.test(t)){let i=Z(t),o=i.filter(e=>/^-[^-]/.test(e)).join(""),n=i.filter(e=>/^--/.test(e)),r=/r/i.test(o)||n.some(e=>/^--recursive$/i.test(e)),a=/f/.test(o)||n.some(e=>/^--force$/i.test(e));if(r&&a)return e2(t,e.params?.allowPaths??[])?T():E("Catastrophic deletion blocked")}return/Remove-Item\s+.*-Recurse.*-Force.*(?:[A-Z]:\\(?:\s|$)|\\\*)/i.test(t)||/(?:rd|rmdir)\s+\/s\s+\/q\s+[A-Z]:\\/i.test(t)?E("Catastrophic deletion blocked"):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Dangerous Commands",params:{allowPaths:{type:"string[]",description:"Paths that are allowed to be recursively deleted",default:[]}}},{name:"block-failproofai-commands",displayTitle:"Tried to disable or modify failproofai itself",impact:"Prevents the agent from turning off the policies that protect you.",description:"Block failproofai CLI commands and uninstallation",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e);return eC.test(t)?E("Running failproofai CLI commands is blocked"):eA.test(t)?E("Uninstalling failproofai is blocked"):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!0,category:"Dangerous Commands"},{name:"block-kubectl",displayTitle:"Tried to run a Kubernetes command",impact:"kubectl can change live cluster state — gated unless allow-listed.",description:"Block kubectl commands (Kubernetes cluster mutations)",fn:function(e){return e3(e,eF,"kubectl commands are blocked")},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"kubectl command patterns to allow, matched token-by-token (e.g. 'kubectl get *', 'kubectl describe *')",default:[]}}},{name:"block-terraform",displayTitle:"Tried to run a Terraform/OpenTofu command",impact:"Terraform mutates real infrastructure — gated unless allow-listed.",description:"Block terraform and tofu (OpenTofu) commands",fn:function(e){return e3(e,eG,"terraform/tofu commands are blocked")},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"terraform/tofu command patterns to allow (e.g. 'terraform plan', 'terraform validate')",default:[]}}},{name:"block-aws-cli",displayTitle:"Tried to run an AWS CLI command",impact:"AWS CLI can spend money or break prod — gated.",description:"Block aws CLI commands",fn:function(e){return e3(e,eJ,"aws CLI commands are blocked")},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"aws CLI command patterns to allow (e.g. 'aws s3 ls *', 'aws sts get-caller-identity')",default:[]}}},{name:"block-gcloud",displayTitle:"Tried to run a Google Cloud command",impact:"gcloud can spend money or break prod — gated.",description:"Block gcloud (Google Cloud) CLI commands",fn:function(e){return e3(e,eY,"gcloud commands are blocked")},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"gcloud command patterns to allow (e.g. 'gcloud auth list', 'gcloud config list')",default:[]}}},{name:"block-az-cli",displayTitle:"Tried to run an Azure CLI command",impact:"az can spend money or break prod — gated.",description:"Block az (Azure) CLI commands",fn:function(e){return e3(e,eZ,"az (Azure) CLI commands are blocked")},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"az CLI command patterns to allow (e.g. 'az account show', 'az group list')",default:[]}}},{name:"block-helm",displayTitle:"Tried to run a Helm command",impact:"Helm releases mutate cluster state — gated.",description:"Block helm commands",fn:function(e){return e3(e,eK,"helm commands are blocked")},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"helm command patterns to allow (e.g. 'helm list', 'helm status *')",default:[]}}},{name:"block-gh-pipeline",displayTitle:"Tried to run a privileged GitHub CLI pipeline command",impact:"Catches `gh workflow run`, `gh pr merge`, `gh secret set`, etc.",description:"Block gh CLI pipeline-trigger subcommands (workflow run, run rerun/cancel, pr merge, release create/delete, cache delete, secret set/delete)",fn:function(e){return e3(e,eQ,"gh pipeline-trigger commands are blocked")},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Infra Commands",params:{allowPatterns:{type:"string[]",description:"gh pipeline command patterns to allow (e.g. specific scripted invocations); read-only gh subcommands like 'gh pr view' and 'gh run list' are not matched by this policy",default:[]}}},{name:"block-secrets-write",displayTitle:"Tried to write a secret-key file",impact:"Stops the agent from creating `.pem`, `id_rsa`, `credentials.json`, etc.",description:"Block writing secret key files",fn:function(e){if("Write"!==e.toolName)return T();let t=Y(e);if(eT.test(t)||eE.test(t)||eP.test(t))return E("Writing secret key files is blocked");for(let i of e.params?.additionalPatterns??[])if(t.includes(i))return E(`Writing blocked file pattern: ${i}`);return T()},match:{events:["PreToolUse"],toolNames:["Write"]},defaultEnabled:!1,category:"Dangerous Commands",params:{additionalPatterns:{type:"string[]",description:"Additional filename patterns (substrings) to block",default:[]}}},{name:"block-push-master",displayTitle:"Tried to push directly to main/master",impact:"Direct pushes to a protected branch bypass review.",description:"Block pushing to main/master",fn:function(e){if("Bash"!==e.toolName)return T();let t=e.params?.protectedBranches??["main","master"];if(0===t.length)return T();let i=e1(J(e)),o=RegExp(`\\b(?:${t.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`);return i.some(e=>o.test(e))?E(`Pushing to ${t.join("/")} is blocked`):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!0,category:"Git",params:{protectedBranches:{type:"string[]",description:"Branch names to protect from direct pushes",default:["main","master"]}}},{name:"block-force-push",displayTitle:"Tried to force-push",impact:"Force-pushes rewrite history and can clobber teammates' work.",description:"Prevent force-pushing to any branch",fn:function(e){return"Bash"!==e.toolName?T():e1(J(e)).some(e=>eS.test(e))?E("Force-pushing is blocked"):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Git"},{name:"block-work-on-main",displayTitle:"Tried to commit or merge on main/master",impact:"Work should land via PR — direct commits skip review.",description:"Block git commits and merges on main/master branch",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e).match(e$);if(!t)return T();let i=e.session?.cwd;if(!i)return T();let o=eX(i);return o&&(e.params?.protectedBranches??["main","master"]).includes(o)?E(`Git ${t[1]} on ${o} is blocked. Create a feature branch first.`):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Git",params:{protectedBranches:{type:"string[]",description:"Branch names where commits/merges are blocked",default:["main","master"]}}},{name:"warn-git-amend",displayTitle:"Used git commit --amend",impact:"Amending after a push rewrites history that others may have pulled.",description:"Warns before amending git commits, which rewrites history",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e);return ex.test(t)?P("STOP: This command amends the last commit, which rewrites git history. If this commit has already been pushed to a shared branch, this will cause divergence for other contributors. Confirm with the user before executing."):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Git"},{name:"warn-git-stash-drop",displayTitle:"Tried to drop or clear git stash",impact:"Stash deletions are permanent and silent.",description:"Warns before permanently deleting stashed changes",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e);return eI.test(t)?P("STOP: This command permanently deletes stashed changes (git stash drop/clear). Stash entries cannot be recovered after deletion. Confirm with the user before executing."):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Git"},{name:"warn-all-files-staged",displayTitle:"Staged all files with git add -A / .",impact:"Wide stages routinely catch generated files or secrets you didn't intend to commit.",description:"Warns before staging all working tree files with git add -A / . / --all",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e);return eR.test(t)?P("STOP: This command stages all files in the working tree (git add -A / --all / .). This may inadvertently include build artifacts, generated files, or sensitive files not covered by .gitignore. Confirm with the user before executing."):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Git"},{name:"warn-destructive-sql",displayTitle:"Ran destructive SQL (DROP / TRUNCATE / DELETE without WHERE)",impact:"Easy way to wipe a table by accident.",description:"Warn before executing destructive SQL (DROP/TRUNCATE/DELETE without WHERE) via database clients",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e);return eo.test(t)&&(en.test(t)||er.test(t)&&!ea.test(t))?P("STOP: This command contains destructive SQL (DROP/TRUNCATE/DELETE). Confirm with the user before executing."):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Database"},{name:"warn-schema-alteration",displayTitle:"Altered a database schema column",impact:"ALTER TABLE operations can lock tables and break readers.",description:"Warns before SQL schema changes (ALTER TABLE with column or rename operations)",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e);return eo.test(t)&&es.test(t)?P("STOP: This command contains a schema-altering SQL statement (ALTER TABLE with column or rename operation). Schema changes on production databases are irreversible or disruptive. Confirm with the user before executing."):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Database"},{name:"warn-package-publish",displayTitle:"Tried to publish a package",impact:"Publishes are irreversible — `npm publish` / `cargo publish` shouldn't happen without intent.",description:"Warn before publishing packages to public registries (npm, PyPI, crates.io, RubyGems, etc.)",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e);return el.test(t)?P("STOP: This command publishes a package to a public registry. Confirm with the user that this is intentional."):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Packages & System"},{name:"warn-global-package-install",displayTitle:"Installed a package globally",impact:"`npm i -g`, `cargo install`, `pip --user` pollute your machine outside the project.",description:"Warns before installing packages globally (npm -g, cargo install, etc.)",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e);return eO.test(t)||eB.test(t)||ej.test(t)||e_.test(t)||eD.test(t)||eW.test(t)?P("STOP: This command installs a package globally, which modifies the system-wide environment outside the project. This can conflict with other projects or system tools. Confirm with the user before executing."):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Packages & System"},{name:"prefer-package-manager",displayTitle:"Used a non-preferred package manager",impact:"Mixing package managers creates lockfile churn for your team.",description:"Blocks non-preferred package managers and tells Claude to use an allowed one (e.g., uv instead of pip)",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e);if(!t)return T();let i=e.params?.allowed??[];if(0===i.length)return T();let o=new Set(i.map(e=>e.toLowerCase())),n=e.params?.blocked??[],r=i.join(", ");for(let e of t.split(e5)){let t=e.trim();if(!t)continue;let i=!1;for(let e of o){let o=eU[e];if(o){for(let e of o)if(e.test(t)){i=!0;break}if(i)break}}if(!i){for(let[e,i]of Object.entries(eU))if(!o.has(e)){for(let o of i)if(o.test(t))return E(`"${e}" is not an allowed package manager. Allowed package managers for this project: ${r}. Rewrite this command using an allowed package manager.`)}for(let e of n){let i=e.toLowerCase();if(!o.has(i)&&RegExp(`\\b${i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(t))return E(`"${i}" is not an allowed package manager. Allowed package managers for this project: ${r}. Rewrite this command using an allowed package manager.`)}}}return T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Packages & System",params:{allowed:{type:"string[]",description:"Allowed package manager names (e.g. ['uv', 'bun']). Any detected manager not in this list is blocked.",default:[]},blocked:{type:"string[]",description:"Additional manager names to block beyond the built-in list (e.g. ['pdm', 'pipx']).",default:[]}}},{name:"warn-large-file-write",displayTitle:"Wrote a file larger than the configured threshold",impact:"Catches accidentally large file writes (logs, binaries, model dumps).",description:"Warn before writing files larger than 1MB (configurable via thresholdKb param)",fn:function(e){if("Write"!==e.toolName)return T();let t=e.toolInput?.content;if("string"!=typeof t)return T();let i=e.params?.thresholdKb??1024;return t.length>1024*i?P(`STOP: You are writing a file larger than ${i}KB (${Math.round(t.length/1024)}KB). This is unusually large. Confirm this is intentional before proceeding.`):T()},match:{events:["PreToolUse"],toolNames:["Write"]},defaultEnabled:!1,category:"Packages & System",params:{thresholdKb:{type:"number",description:"File size threshold in KB above which a warning is issued",default:1024}}},{name:"warn-background-process",displayTitle:"Started a long-lived background process",impact:"Catches `nohup` / `&` / `screen` / `tmux` / `disown` patterns that the agent often forgets to clean up.",description:"Warns before starting detached or background processes",fn:function(e){if("Bash"!==e.toolName)return T();let t=J(e);return eM.test(t)||eL.test(t)||ez.test(t)||eq.test(t)||eH.test(t)?P("STOP: This command starts a background or detached process (nohup, screen -d, tmux -d, or trailing &). Background processes persist after Claude's session and may be difficult to track or stop. Confirm with the user before executing."):T()},match:{events:["PreToolUse"],toolNames:["Bash"]},defaultEnabled:!1,category:"Packages & System"},{name:"warn-repeated-tool-calls",displayTitle:"Called the same tool 3+ times with identical arguments",impact:"Usually a sign of a stuck loop burning tokens.",description:"Warn when the same tool is called 3+ times with identical parameters",fn:async function e(e){let t=e.session?.transcriptPath;if(!t||!e.toolName||!e.toolInput)return T();let i=`${t}.tool-calls.json`,o=JSON.stringify({tool:e.toolName,input:e.toolInput}),n={};try{let e=await (0,v.readFile)(i,"utf8");n=JSON.parse(e)}catch{}let r=n[o]??0;if(r>=3)return P(`STOP: You have already called ${e.toolName} ${r} times with identical parameters. This is wasteful and unproductive. Do NOT repeat this call — use a different approach or ask the user for clarification.`);n[o]=r+1;try{let e=JSON.stringify(n);e.length<=65536&&await (0,v.writeFile)(i,e,"utf8")}catch{}return T()},match:{events:["PreToolUse"]},defaultEnabled:!1,category:"AI Behavior"},{name:"require-commit-before-stop",displayTitle:"Stopped with uncommitted changes",impact:"Work not in a commit is invisible to teammates and easy to lose.",description:"Require all changes to be committed before Claude stops",fn:function(e){let t=e.session?.cwd;if(!t)return T("No working directory available, skipping commit check.");try{if((0,N.execSync)("git status --porcelain",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim().length>0)return E("You have uncommitted changes in the working directory. Commit all changes now.");return T("All changes are committed.")}catch{return T("Not a git repository, skipping commit check.")}},match:{events:["Stop"]},defaultEnabled:!1,category:"Workflow"},{name:"require-push-before-stop",displayTitle:"Stopped with unpushed commits",impact:"Local-only commits won't trigger CI or be reviewable.",description:"Require all commits to be pushed to remote before Claude stops",fn:function(e){let t=e.session?.cwd;if(!t)return T("No working directory available, skipping push check.");try{if(!(0,N.execSync)("git remote",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3}).trim())return T("No git remote configured, skipping push check.");let i=e.params?.remote??"origin",o=eX(t);if(!o||"HEAD"===o)return T("Detached HEAD, skipping push check.");let n=e.params?.baseBranch??"main";if(o===n)return T(`On base branch "${n}", skipping push check.`);try{if(!(0,N.execFileSync)("git",["log",`${i}/${n}..HEAD`,"--oneline"],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim())return T(`No commits ahead of ${i}/${n}, skipping push check.`);if(!(0,N.execFileSync)("git",["diff","--stat",`${i}/${n}`,"HEAD"],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim())return T(`No file changes compared to ${i}/${n}, skipping push check.`)}catch{}let r=!1;try{(0,N.execFileSync)("git",["rev-parse","--verify",`${i}/${o}`],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3}),r=!0}catch{}if(!r)return E(`Branch "${o}" has not been pushed to remote "${i}". Run now: git push -u ${i} ${o}`);let a=(0,N.execFileSync)("git",["log",`${i}/${o}..HEAD`,"--oneline"],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim();if(a.length>0){let e=a.split("\n").length;return E(`You have ${e} unpushed commit${e>1?"s":""} on branch "${o}". Run now: git push`)}return T(`All commits pushed to "${i}".`)}catch{return T("Could not check push status, skipping.")}},match:{events:["Stop"]},defaultEnabled:!1,category:"Workflow",params:{remote:{type:"string",description:"Remote name to push to (default: origin)",default:"origin"},baseBranch:{type:"string",description:"Base branch to compare against (default: main)",default:"main"}}},{name:"require-pr-before-stop",displayTitle:"Stopped without a PR for the branch",impact:"Branches without PRs don't get reviewed.",description:"Require a pull request to exist for the current branch before Claude stops",fn:function(e){let t=e.session?.cwd;if(!t)return T("No working directory available, skipping PR check.");try{let i;try{(0,N.execSync)("gh --version",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3})}catch{return T("GitHub CLI (gh) not installed, skipping PR check.")}let o=eX(t);if(!o||"HEAD"===o)return T("Detached HEAD, skipping PR check.");let n=e.params?.baseBranch??"main";if(o===n)return T(`On base branch "${n}", skipping PR check.`);try{if(!(0,N.execFileSync)("git",["log",`origin/${n}..HEAD`,"--oneline"],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim())return T(`No commits ahead of origin/${n}, skipping PR check.`);if(!(0,N.execFileSync)("git",["diff","--stat",`origin/${n}`,"HEAD"],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim())return T(`No file changes compared to origin/${n}, skipping PR check.`)}catch{}try{i=(0,N.execSync)("gh pr view --json number,url,state",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:15e3}).trim()}catch{return E(`No pull request found for branch "${o}". Run now: gh pr create`)}let r=JSON.parse(i);if("OPEN"===r.state)return T(`PR #${r.number} exists: ${r.url}`);if("MERGED"===r.state)return T(`PR #${r.number} was merged: ${r.url}. Switch off this branch (e.g. 'git checkout ${n} && git pull') before stopping again.`);return E(`Pull request for branch "${o}" is ${r.state.toLowerCase()}. Run now: gh pr create`)}catch{return T("Could not check PR status, skipping.")}},match:{events:["Stop"]},defaultEnabled:!1,category:"Workflow",params:{baseBranch:{type:"string",description:"Base branch to compare against (default: main)",default:"main"}}},{name:"require-no-conflicts-before-stop",displayTitle:"Stopped with a branch that conflicts with main",impact:"Conflicting branches can't merge — surface them early.",description:"Require the current branch to merge cleanly with the base branch before Claude stops",fn:function(e){let t,i,o=e.session?.cwd;if(!o)return T("No working directory available, skipping conflict check.");let n=eX(o);if(!n||"HEAD"===n)return T("Detached HEAD, skipping conflict check.");let r=e.params?.baseBranch??"main";if(n===r)return T(`On base branch "${r}", skipping conflict check.`);try{(0,N.execSync)("gh --version",{cwd:o,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3})}catch{return T("gh CLI not installed, skipping conflict check.")}try{t=(0,N.execSync)("gh pr view --json mergeable,number,url,state",{cwd:o,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:15e3}).trim()}catch{return T("No pull request found for branch, skipping conflict check.")}try{i=JSON.parse(t)}catch{return T("Could not parse gh pr view output, skipping conflict check.")}if("OPEN"!==i.state)return T(`PR #${i.number} is ${i.state.toLowerCase()}; skipping conflict check.`);try{(0,N.execFileSync)("git",["rev-parse","--verify",`origin/${r}`],{cwd:o,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3}),(0,N.execFileSync)("git",["log",`origin/${r}..HEAD`,"--oneline"],{cwd:o,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:5e3}).trim()&&(0,N.execFileSync)("git",["merge-tree","--write-tree","--name-only",`origin/${r}`,"HEAD"],{cwd:o,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:1e4})}catch(e){if(1===e.status){let t=("string"==typeof e.stdout?e.stdout:e.stdout?.toString("utf8")??"").trim().split("\n"),i=[];for(let e=1;e<t.length;e++){let o=t[e];if(""===o)break;i.push(o)}let o=i.length?i.join(", "):"one or more files";return E(`Branch "${n}" has merge conflicts with ${r} in: ${o}. Rebase or merge origin/${r} now and resolve the conflicts.`)}}return"CONFLICTING"===i.mergeable?E(`PR #${i.number} has merge conflicts per GitHub (${i.url}). Rebase or merge origin/${r} now and resolve the conflicts.`):"UNKNOWN"===i.mergeable?E(`GitHub is still computing mergeability for PR #${i.number} (${i.url}). Wait ~10 seconds, then re-check with \`gh pr view --json mergeable\` before attempting to stop again.`):T(`PR #${i.number} merges cleanly per GitHub.`)},match:{events:["Stop"]},defaultEnabled:!1,category:"Workflow",params:{baseBranch:{type:"string",description:"Base branch to check for conflicts against (default: main)",default:"main"}}},{name:"require-ci-green-before-stop",displayTitle:"Stopped with failing CI",impact:"Failing CI blocks deploy.",description:"Require CI checks to pass on the current HEAD commit before Claude stops (ignores stale runs on prior commits)",fn:function(e){let t=e.session?.cwd;if(!t)return T("No working directory available, skipping CI check.");try{try{(0,N.execSync)("gh --version",{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3})}catch{return T("GitHub CLI (gh) not installed, skipping CI check.")}let e=eX(t);if(!e||"HEAD"===e)return T("Detached HEAD, skipping CI check.");let i=function(e){try{return(0,N.execSync)("git rev-parse HEAD",{cwd:e,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:3e3}).trim()||null}catch{return null}}(t),o=[];try{let n=(0,N.execFileSync)("gh",["run","list","--branch",e,"--limit","20","--json","status,conclusion,name,headSha"],{cwd:t,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:15e3}).trim();if(n&&"[]"!==n){let e=JSON.parse(n),t=i?e.filter(e=>e.headSha===i):e,r=new Set;o=t.filter(e=>!r.has(e.name)&&(r.add(e.name),!0))}}catch{}let n=[],r=[];i&&(n=function(e,t){try{let i=(0,N.execFileSync)("gh",["api",`repos/{owner}/{repo}/commits/${t}/check-runs`,"--jq",'.check_runs | map(select(.app.slug != "github-actions")) | map({name: .name, status: .status, conclusion: (.conclusion // "")})'],{cwd:e,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:15e3}).trim();if(!i||"[]"===i)return[];return JSON.parse(i)}catch{return[]}}(t,i),r=function(e,t){try{let i=(0,N.execFileSync)("gh",["api",`repos/{owner}/{repo}/commits/${t}/statuses`,"--jq","map({name: .context, state: .state}) | unique_by(.name)"],{cwd:e,encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:15e3}).trim();if(!i||"[]"===i)return[];return JSON.parse(i).map(e=>({name:e.name,status:"pending"===e.state?"in_progress":"completed",conclusion:"pending"===e.state?"":"success"===e.state?"success":"failure"}))}catch{return[]}}(t,i));let a=[...o,...n,...r];if(0===a.length)return T(`No CI runs found for branch "${e}".`);let s=a.filter(e=>"completed"===e.status&&"success"!==e.conclusion&&"skipped"!==e.conclusion&&"cancelled"!==e.conclusion&&"neutral"!==e.conclusion);if(s.length>0){let t=s.map(e=>`"${e.name}"`).join(", ");return E(`CI checks are failing on branch "${e}": ${t}. Fix the failing checks now.`)}let l=a.filter(e=>"in_progress"===e.status||"queued"===e.status||"waiting"===e.status);if(l.length>0){let t=l.map(e=>`"${e.name}"`).join(", ");return E(`CI checks are still running on branch "${e}": ${t}. Wait for all checks to complete, then verify they pass.`)}return T(`All CI checks passed on branch "${e}".`)}catch{return T("Could not check CI status, skipping.")}},match:{events:["Stop"]},defaultEnabled:!1,category:"Workflow"}];function e4(e){if(!(0,O.existsSync)(e))return{};try{let t=(0,O.readFileSync)(e,"utf8");return JSON.parse(t)}catch(t){return H(`failed to parse config at ${e}: ${t instanceof Error?t.message:String(t)}`),{}}}let e9=["claude","codex","copilot","cursor","opencode","pi","gemini"],e7={apply_patch:"Edit",write_stdin:"Bash"},te={bash:"Bash",powershell:"Bash",list_bash:"Bash",read_bash:"Bash",stop_bash:"Bash",write_bash:"Bash",list_powershell:"Bash",read_powershell:"Bash",stop_powershell:"Bash",write_powershell:"Bash",read:"Read",view:"Read",show_file:"Read",write:"Write",create:"Write",edit:"Edit",apply_patch:"Edit",str_replace_editor:"Edit",glob:"Glob",grep:"Grep",rg:"Grep",ls:"LS",web_fetch:"WebFetch"},tt={Shell:"Bash"},ti={bash:"Bash",read:"Read",write:"Write",edit:"Edit",apply_patch:"Edit",glob:"Glob",grep:"Grep",list:"LS",webfetch:"WebFetch",websearch:"WebSearch",todowrite:"TodoWrite",todoread:"TodoRead"},to={Read:{filePath:"file_path"},Write:{filePath:"file_path"},Edit:{filePath:"file_path",oldString:"old_string",newString:"new_string",replaceAll:"replace_all"}},tn={bash:"Bash",read:"Read",write:"Write",edit:"Edit",glob:"Glob",grep:"Grep"},tr={Read:{path:"file_path"},Write:{path:"file_path"},Edit:{path:"file_path"}},ta={run_shell_command:"Bash",read_file:"Read",read_many_files:"Read",write_file:"Write",replace:"Edit",glob:"Glob",grep_search:"Grep",list_directory:"LS",web_fetch:"WebFetch",google_web_search:"WebSearch",write_todos:"TodoWrite",save_memory:"Memory",ask_user:"AskUser"};var ts=e.i(81580);let tl=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;var tc=e.i(54214);function tp(e,t){let i=[];for(let n of e)if("assistant"===n.type)for(let e of n.message.content){var o;let r;if("tool_use"!==e.type)continue;let a=e.name,s=(o=t.cli,(a?"copilot"===o?te[a]??a:"cursor"===o?tt[a]??a:"codex"===o?e7[a]??a:"gemini"===o?ta[a]??a:"opencode"===o?ti[a]??a:"pi"===o?tn[a]??a:a:a)??a),l=function(e,t,i){let o;if(!e||!t||"object"!=typeof t||Array.isArray(t)||("opencode"===i?o=to[e]:"pi"===i&&(o=tr[e]),!o))return t;let n={};for(let[e,i]of Object.entries(t))n[o[e]??e]=i;return n}(s,e.input,t.cli);e.result?.content&&(r=function(e){let t=Buffer.from(e,"utf-8");if(t.byteLength<=65536)return e;let i=65536;for(;i>0&&(192&t[i])==128;)i--;return t.subarray(0,i).toString("utf-8")}(e.result.content)),i.push({cli:t.cli,sessionId:t.sessionId,transcriptPath:t.transcriptPath,cwd:t.cwd,timestamp:n.timestamp,toolName:s,rawToolName:a,toolInput:l??{},toolResultText:r})}return i}async function td(e={}){let t=e.projects?new Set(e.projects):null,i=e.sinceMs??0,o=[];for(let e of function(){let e,t=(0,ts.getClaudeProjectsPath)();try{e=(0,O.readdirSync)(t,{withFileTypes:!0})}catch{return[]}return e.filter(e=>e.isDirectory()).map(e=>({name:e.name,cwd:(0,ts.decodeFolderName)(e.name),path:(0,k.join)(t,e.name)}))}()){let n;if(!t||t.has(e.cwd)){try{n=function(e){let t,i=[];try{t=(0,O.readdirSync)(e.path,{withFileTypes:!0})}catch{return i}for(let o of t)if(o.isFile()&&o.name.endsWith(".jsonl")){let t=o.name.slice(0,-6);if(!tl.test(t))continue;let n=(0,k.join)(e.path,o.name);try{let o=(0,O.statSync)(n);i.push({projectName:e.name,cwd:e.cwd,sessionId:t,transcriptPath:n,mtimeMs:o.mtimeMs,sizeBytes:o.size,isSubagent:!1})}catch{}}else if(o.isDirectory()&&tl.test(o.name)){let t,n=(0,k.join)(e.path,o.name,"subagents");if(!(0,O.existsSync)(n))continue;try{t=(0,O.readdirSync)(n,{withFileTypes:!0})}catch{continue}for(let o of t){if(!o.isFile()||!o.name.endsWith(".jsonl"))continue;let t=o.name.slice(0,-6),r=(0,k.join)(n,o.name);try{let o=(0,O.statSync)(r);i.push({projectName:e.name,cwd:e.cwd,sessionId:t,transcriptPath:r,mtimeMs:o.mtimeMs,sizeBytes:o.size,isSubagent:!0})}catch{}}}return i}(e)}catch{continue}for(let t of n)t.mtimeMs<i||o.push({cli:"claude",projectName:e.name,sessionId:t.sessionId,transcriptPath:t.transcriptPath,mtimeMs:t.mtimeMs,sizeBytes:t.sizeBytes})}}return o}async function tu(e){let t,i;try{t=await (0,v.readFile)(e.transcriptPath,"utf-8")}catch{return[]}try{i=await (0,tc.parseLogContent)(t,"session")}catch{return[]}let o="";for(let e of t.split("\n",50))if(e.trim())try{let t=JSON.parse(e);if("string"==typeof t.cwd&&t.cwd.length>0){o=t.cwd;break}}catch{}return tp(i,{cli:"claude",sessionId:e.sessionId,transcriptPath:e.transcriptPath,cwd:o})}var tm=e.i(36203),tf=e.i(57232);async function th(e={}){let t=e.projects?new Set(e.projects):null,i=e.sinceMs??0,o=[];for(let e of(await (0,tm.getCodexProjects)())){let{cwd:n,sessions:r}=await (0,tm.getCodexSessionsByEncodedName)(e.name),a=n??"";if(!t||t.has(a))for(let t of r){let n=t.lastModified.getTime();if(n<i)continue;let r=0;try{r=(0,O.statSync)(t.path).size}catch{}t.sessionId&&o.push({cli:"codex",projectName:e.name,sessionId:t.sessionId,transcriptPath:t.path,mtimeMs:n,sizeBytes:r})}}return o}async function tg(e){let t=await (0,tf.getCodexSessionLog)(e.sessionId);return t?tp(t.entries,{cli:"codex",sessionId:e.sessionId,transcriptPath:e.transcriptPath,cwd:t.cwd??""}):[]}var ty=e.i(55851),tb=e.i(78166);async function tw(e={}){let t=e.projects?new Set(e.projects):null,i=e.sinceMs??0,o=[];for(let e of(await (0,ty.getCopilotProjects)())){let{cwd:n,sessions:r}=await (0,ty.getCopilotSessionsByEncodedName)(e.name),a=n??"";if(!t||t.has(a))for(let t of r){let n=t.lastModified.getTime();if(n<i)continue;let r=0;try{r=(0,O.statSync)(t.path).size}catch{}t.sessionId&&o.push({cli:"copilot",projectName:e.name,sessionId:t.sessionId,transcriptPath:t.path,mtimeMs:n,sizeBytes:r})}}return o}async function tk(e){let t=await (0,tb.getCopilotSessionLog)(e.sessionId);return t?tp(t.entries,{cli:"copilot",sessionId:e.sessionId,transcriptPath:e.transcriptPath,cwd:t.cwd??""}):[]}var tv=e.i(46413),tN=e.i(72094);async function tS(e={}){let t=e.projects?new Set(e.projects):null,i=e.sinceMs??0,o=[];for(let e of(await (0,tv.getCursorProjects)())){let{cwd:n,sessions:r}=await (0,tv.getCursorSessionsByEncodedName)(e.name),a=n??"";if(!t||t.has(a))for(let t of r){let n=t.lastModified.getTime();if(n<i)continue;let r=0;try{r=(0,O.statSync)(t.path).size}catch{}t.sessionId&&o.push({cli:"cursor",projectName:e.name,sessionId:t.sessionId,transcriptPath:t.path,mtimeMs:n,sizeBytes:r})}}return o}async function tT(e){let t=await (0,tN.getCursorSessionLog)(e.sessionId);return t?tp(t.entries,{cli:"cursor",sessionId:e.sessionId,transcriptPath:e.transcriptPath,cwd:t.cwd??""}):[]}var tE=e.i(35435),tP=e.i(99440);async function t$(e={}){let t=e.projects?new Set(e.projects):null,i=e.sinceMs??0,o=[];for(let e of(await (0,tE.getOpenCodeProjects)())){let{cwd:n,sessions:r}=await (0,tE.getOpenCodeSessionsByEncodedName)(e.name),a=n??"";if(!t||t.has(a))for(let t of r){let n=t.lastModified.getTime();!(n<i)&&t.sessionId&&o.push({cli:"opencode",projectName:e.name,sessionId:t.sessionId,transcriptPath:t.path,mtimeMs:n,sizeBytes:0})}}return o}async function tC(e){let t=await (0,tP.getOpenCodeSessionLog)(e.sessionId);return t?tp(t.entries,{cli:"opencode",sessionId:e.sessionId,transcriptPath:e.transcriptPath,cwd:t.cwd??""}):[]}var tA=e.i(19791),tx=e.i(85116);async function tI(e={}){let t=e.projects?new Set(e.projects):null,i=e.sinceMs??0,o=[];for(let e of(await (0,tA.getPiProjects)())){let{cwd:n,sessions:r}=await (0,tA.getPiSessionsByEncodedName)(e.name),a=n??"";if(!t||t.has(a))for(let t of r){let n=t.lastModified.getTime();if(n<i)continue;let r=0;try{r=(0,O.statSync)(t.path).size}catch{}t.sessionId&&o.push({cli:"pi",projectName:e.name,sessionId:t.sessionId,transcriptPath:t.path,mtimeMs:n,sizeBytes:r})}}return o}async function tR(e){let t=await (0,tx.getPiSessionLog)(e.sessionId);return t?tp(t.entries,{cli:"pi",sessionId:e.sessionId,transcriptPath:e.transcriptPath,cwd:t.cwd??""}):[]}var tO=e.i(90172),tB=e.i(88153);let tj={claude:{cli:"claude",listTranscripts:td,streamEvents:tu},codex:{cli:"codex",listTranscripts:th,streamEvents:tg},copilot:{cli:"copilot",listTranscripts:tw,streamEvents:tk},cursor:{cli:"cursor",listTranscripts:tS,streamEvents:tT},opencode:{cli:"opencode",listTranscripts:t$,streamEvents:tC},pi:{cli:"pi",listTranscripts:tI,streamEvents:tR},gemini:{cli:"gemini",listTranscripts:async function(e={}){let t=e.projects?new Set(e.projects):null,i=e.sinceMs??0,o=[];for(let e of(await (0,tO.getGeminiProjects)())){let{cwd:n,sessions:r}=await (0,tO.getGeminiSessionsByEncodedName)(e.name),a=n??"";if(!t||t.has(a))for(let t of r){let n=t.lastModified.getTime();if(n<i)continue;let r=0;try{r=(0,O.statSync)(t.path).size}catch{}t.sessionId&&o.push({cli:"gemini",projectName:e.name,sessionId:t.sessionId,transcriptPath:t.path,mtimeMs:n,sizeBytes:r})}}return o},streamEvents:async function(e){let t=await (0,tB.getGeminiSessionLog)(e.sessionId);return t?tp(t.entries,{cli:"gemini",sessionId:e.sessionId,transcriptPath:e.transcriptPath,cwd:t.cwd??""}):[]}}},t_=/\.(?:ts|tsx|js|jsx|mjs|cjs|py|go|rs|java|kt|swift|rb|php|c|h|cc|cpp|hpp|cs|scala|sh|bash|zsh|json|yaml|yml|toml|md|txt|sql|html|css|scss|sass)$/i,tD=["/","/home","/usr","/etc","/var","/opt","/Users"],tW="rereadAfterEdit",tU=[{name:"redundant-cd-cwd",description:"Bash commands prefixed with `cd <cwd> && …` even though commands already run in cwd.",category:"Wasteful",severity:"info",displayTitle:"Prepended cd <cwd> before commands",impact:"Pure waste — your agent's shell already runs in `cwd`.",detect(e){if("Bash"!==e.toolName)return null;let t=e.toolInput.command;if("string"!=typeof t||!e.cwd)return null;let i=t.trimStart(),o=/^cd\s+(?:"([^"]+)"|'([^']+)'|(\S+))\s*&&\s*([\s\S]+)$/.exec(i);if(!o)return null;let n=(o[1]??o[2]??o[3]??"").replace(/\/+$/,"");if(n!==e.cwd.replace(/\/+$/,""))return null;let r=o[4].trim();return{example:`cd ${n} && ${r}`}}},{name:"prefer-edit-over-read-cat",description:"Bash `cat`/`head`/`tail`/`less`/`more` on a single source file — use Read.",category:"Wasteful",severity:"info",displayTitle:"Used `cat`/`head`/`tail` on a source file",impact:"Burns tokens; the Read tool returns content directly without going through Bash output.",detect(e){if("Bash"!==e.toolName)return null;let t=e.toolInput.command;if("string"!=typeof t)return null;let i=t.trim();if(/[|<>;&`$()]/.test(i))return null;let o=/^(cat|head|tail|less|more)\s+(?:-\S+\s+)*(?:"([^"]+)"|'([^']+)'|(\S+))\s*$/.exec(i);if(!o)return null;let n=o[2]??o[3]??o[4]??"";return!n||/(?:^|\/)\.env(?:\..+)?$/.test(n)||!t_.test(n)?null:{example:i}}},{name:"prefer-edit-over-sed-awk",description:"Bash `sed -i`/`awk` in-place edits — use Edit.",category:"Wasteful",severity:"info",displayTitle:"Used sed -i or awk for an in-place edit",impact:"Edit tool is safer and produces a diff the agent can verify.",detect(e){if("Bash"!==e.toolName)return null;let t=e.toolInput.command;if("string"!=typeof t)return null;let i=t.trim();return/(?:^|\s|;|&&|\|\|)sed\b[^|]*\s-i(?=\b|['"])/.test(i)||/(?:^|\s|;|&&|\|\|)awk\b[^|]*\s>\s*\S+/.test(i)&&!/\|/.test(i)?{example:i}:null}},{name:"prefer-write-over-heredoc",description:"Bash heredoc / `echo > file` writing multi-line content — use Write.",category:"Wasteful",severity:"info",displayTitle:"Used heredoc / `echo > file` to write a multi-line file",impact:"Write tool handles escaping and is verifiable.",detect(e){if("Bash"!==e.toolName)return null;let t=e.toolInput.command;return"string"!=typeof t?null:/<<-?\s*['"]?[A-Za-z_][A-Za-z0-9_]*['"]?\s*>\s*\S/.test(t)||/(?:^|\s|;|&&|\|\|)(?:echo|printf)\s+["'][^"']*\n[^"']*["']\s*>\s*\S/.test(t)?{example:t.replace(/\s+/g," ").trim().slice(0,160)}:null}},{name:"sleep-polling-loop",description:"Bash long `sleep` or while-sleep polling loops.",category:"Wasteful",severity:"info",displayTitle:"Used a long sleep or while-sleep polling loop",impact:"Burns wall-clock; better to wait for an explicit signal.",detect(e){if("Bash"!==e.toolName)return null;let t=e.toolInput.command;if("string"!=typeof t)return null;if(/\bwhile\b[\s\S]*?\bsleep\b[\s\S]*?\bdone\b/.test(t))return{example:t.replace(/\s+/g," ").trim().slice(0,160)};let i=/\bsleep\s+(\d+(?:\.\d+)?)(m|h|d)?\b/.exec(t);if(i){let e=parseFloat(i[1]),o=i[2]??"s";if(("m"===o?60*e:"h"===o?3600*e:"d"===o?86400*e:e)>=30)return{example:t.replace(/\s+/g," ").trim().slice(0,160)}}return null}},{name:"find-from-root",description:"Bash `find` against `/`, `/home`, `/usr`, etc. — scope to cwd instead.",category:"Risky",severity:"warn",displayTitle:"Ran find from /, /home, /usr, etc.",impact:"Filesystem-wide finds exhaust resources and rarely return useful results.",detect(e){if("Bash"!==e.toolName)return null;let t=e.toolInput.command;if("string"!=typeof t)return null;let i=t.trim(),o=/(?:^|[\s;|&])find\s+(?:-\S+\s+)*("[^"]+"|'[^']+'|\S+)/.exec(i);if(!o)return null;let n=o[1].replace(/^["']|["']$/g,"").replace(/\/+$/,"")||"/";return tD.includes(n)?{example:i.slice(0,160)}:null}},{name:"git-commit-no-verify",description:"git commit invoked with --no-verify / -n, skipping hooks.",category:"Risky",severity:"warn",displayTitle:"Committed with --no-verify",impact:"Skips pre-commit hooks that exist to catch broken or unsafe code.",detect(e){if("Bash"!==e.toolName)return null;let t=e.toolInput.command;return"string"!=typeof t?null:/\bgit\s+commit\b/.test(t)&&(/\s--no-verify\b/.test(t)||/\s-n\b/.test(t))?{example:t.replace(/\s+/g," ").trim().slice(0,160)}:null}},{name:"reread-after-edit",description:"Read of a file that was just Edit'd or Write'n in the same session.",category:"Wasteful",severity:"info",displayTitle:"Re-read a file it just edited",impact:"Edit/Write already returned the updated content; the second Read is wasted tokens.",detect(e,t){let i,o=((i=t[tW])||(i={countdown:new Map},t[tW]=i),i),n=e.toolInput.file_path,r="string"==typeof n?n:null;for(let[e,t]of o.countdown)t<=1?o.countdown.delete(e):o.countdown.set(e,t-1);return r?"Edit"===e.toolName||"Write"===e.toolName?(o.countdown.set(r,5),null):"Read"===e.toolName&&o.countdown.has(r)?(o.countdown.delete(r),{example:`Read ${r} immediately after Edit/Write`}):null:null}}],tM=["cowboy","explorer","ghost","optimist","hammer","architect"],tL={"block-rm-rf":{archetype:"cowboy",weight:2},"block-failproofai-commands":{archetype:"cowboy",weight:2},"block-sudo":{archetype:"cowboy",weight:1.5},"block-curl-pipe-sh":{archetype:"cowboy",weight:1.5},"block-force-push":{archetype:"cowboy",weight:1.5},"block-push-master":{archetype:"cowboy",weight:1.5},"block-work-on-main":{archetype:"cowboy",weight:1.2},"warn-destructive-sql":{archetype:"cowboy",weight:1.5},"warn-schema-alteration":{archetype:"cowboy",weight:1},"git-commit-no-verify":{archetype:"cowboy",weight:1.5},"warn-git-amend":{archetype:"cowboy",weight:.8},"warn-git-stash-drop":{archetype:"cowboy",weight:1},"warn-all-files-staged":{archetype:"cowboy",weight:.6},"block-kubectl":{archetype:"cowboy",weight:1.5},"block-terraform":{archetype:"cowboy",weight:1.5},"block-helm":{archetype:"cowboy",weight:1.2},"block-aws-cli":{archetype:"cowboy",weight:1.2},"block-gcloud":{archetype:"cowboy",weight:1.2},"block-az-cli":{archetype:"cowboy",weight:1.2},"block-gh-pipeline":{archetype:"cowboy",weight:1.2},"sanitize-private-key-content":{archetype:"explorer",weight:1.5},"block-env-files":{archetype:"explorer",weight:1.5},"block-secrets-write":{archetype:"explorer",weight:1.5},"sanitize-api-keys":{archetype:"explorer",weight:1.2},"sanitize-jwt":{archetype:"explorer",weight:1.2},"sanitize-connection-strings":{archetype:"explorer",weight:1.2},"block-read-outside-cwd":{archetype:"explorer",weight:1.2},"sanitize-bearer-tokens":{archetype:"explorer",weight:1},"protect-env-vars":{archetype:"explorer",weight:1},"find-from-root":{archetype:"explorer",weight:1},"require-ci-green-before-stop":{archetype:"ghost",weight:1.2},"require-commit-before-stop":{archetype:"ghost",weight:1.2},"require-push-before-stop":{archetype:"ghost",weight:1},"require-pr-before-stop":{archetype:"ghost",weight:1},"require-no-conflicts-before-stop":{archetype:"ghost",weight:1},"warn-large-file-write":{archetype:"ghost",weight:1},"warn-background-process":{archetype:"ghost",weight:.8},"warn-package-publish":{archetype:"optimist",weight:1},"warn-global-package-install":{archetype:"optimist",weight:.8},"prefer-package-manager":{archetype:"optimist",weight:.8},"prefer-edit-over-sed-awk":{archetype:"optimist",weight:.8},"prefer-edit-over-read-cat":{archetype:"optimist",weight:.5},"prefer-write-over-heredoc":{archetype:"optimist",weight:.5},"warn-repeated-tool-calls":{archetype:"hammer",weight:1.5},"sleep-polling-loop":{archetype:"hammer",weight:1.2},"reread-after-edit":{archetype:"architect",weight:1},"redundant-cd-cwd":{archetype:"architect",weight:.8}};function tz(){return{optimist:0,cowboy:0,explorer:0,goldfish:0,architect:0,precision:0,hammer:0,ghost:0}}let tq=tz(),tH=0;for(let{archetype:e,weight:t}of Object.values(tL))tq[e]+=t,tH+=t;let tF=tz();for(let e of tM)tF[e]=tH>0?tq[e]/tH:0;var tG=e.i(66680);let tJ=null,tY=null;function tZ(){if(tJ)return tJ;let e=e6.map(e=>`${e.name}|${e.fn.toString()}`).sort().join("\n");return tJ=(0,tG.createHash)("sha1").update(e).digest("hex").slice(0,16)}function tK(){if(tY)return tY;let e=tU.map(e=>`${e.name}|${e.detect.toString()}`).sort().join("\n");return tY=(0,tG.createHash)("sha1").update(e).digest("hex").slice(0,16)}function tQ(e){let t=(0,k.join)((0,S.homedir)(),".failproofai","cache","audit"),i=(0,tG.createHash)("sha1").update(e).digest("hex");return(0,k.join)(t,`${i}.json`)}var tV=e.i(24214),tX=e.i(28067);let t0=tX.POSTHOG_API_KEY;async function t1(e,t,i){if("1"===process.env.FAILPROOFAI_TELEMETRY_DISABLED)return;let o=JSON.stringify({api_key:process.env.FAILPROOFAI_POSTHOG_KEY??t0,event:t,distinct_id:e,properties:{...i,$lib:"failproofai-hooks",failproofai_version:tV.version,product:tX.POSTHOG_PRODUCT}});try{await fetch(process.env.FAILPROOFAI_POSTHOG_HOST?`${process.env.FAILPROOFAI_POSTHOG_HOST}/capture/`:"https://us.i.posthog.com/capture/",{method:"POST",headers:{"Content-Type":"application/json"},body:o,signal:AbortSignal.timeout(5e3)})}catch{}}var t2=e.i(10659);function t8(e,t){let i=e.trim(),o="string"==typeof t?t.trim():"";return o?i?`${i}. ${o}`:o:i}let t3=new Map(e6.filter(e=>e.params).map(e=>[x(e.name),e.params]));function t5(e,t){if(!e?.policyParams)return;let i=e.policyParams[t];if(i)return i;let o=`${A}/`;if(t.startsWith(o))return e.policyParams[t.slice(o.length)]}async function t6(e,t,i,o){let n=t.tool_name,r=t.tool_input,a=function(e,t){let i=globalThis[C];i||I(i=new Map);let o=`${e}:${t??""}`,n=i.get(o);if(n)return n;let r=R().filter(i=>(!i.match.events||!(i.match.events.length>0)||!!i.match.events.includes(e))&&(!i.match.toolNames||!(i.match.toolNames.length>0)||!!t&&!!i.match.toolNames.includes(t))).sort((e,t)=>t.priority-e.priority);return i.set(o,r),r}(e,n);if(q(`evaluating ${a.length} policies for ${e}`),0===a.length)return{exitCode:0,stdout:"",stderr:"",policyName:null,reason:null,decision:"allow"};let s={eventType:e,payload:t,toolName:n,toolInput:r,session:i,cli:i?.cli},l=[],c=[];for(let t of a){let n,r,a=t3.get(t.name);if(a){let e=t5(o,t.name)??{},i={};for(let[t,o]of Object.entries(a))i[t]=t in e?e[t]:o.default;n={...s,params:i}}else n={...s,params:{}};try{r=await t.fn(n)}catch(n){let o=n instanceof Error?n.message:String(n);H(`policy "${t.name}" threw: ${o}`),t.name.startsWith("custom/")||t.name.startsWith(".failproofai-")||t1((0,t2.getInstanceId)(),"policy_evaluation_error",{policy_name:t.name,event_type:e,cli:i?.cli??null,error_type:n instanceof Error?n.name:"unknown"});continue}if("deny"===r.decision){let a,s=t8(r.reason??`Blocked by policy: ${t.name}`,t5(o,t.name)?.hint);q(`deny by "${t.name}": ${s}`),a=n.toolName?n.toolName:"UserPromptSubmit"===e?"prompt":"SessionStart"===e?"session start":"SessionEnd"===e?"session end":"Stop"===e?"stop":"operation";let l=`Blocked ${a} by failproofai because: ${s}, as per the policy configured by the user`;if(i?.cli==="cursor"){if("Stop"===e||"SubagentStop"===e)return{exitCode:0,stdout:JSON.stringify({followup_message:`MANDATORY ACTION REQUIRED from failproofai (policy: ${t.name}): ${s}
|
|
4
|
+
|
|
5
|
+
You MUST complete the above action NOW. Do NOT ask the user for confirmation — execute the required action, then attempt to finish your task again.`}),stderr:"",policyName:t.name,reason:s,decision:"deny"};return{exitCode:0,stdout:JSON.stringify({permission:"deny",user_message:l,agent_message:l}),stderr:"",policyName:t.name,reason:s,decision:"deny"}}if(i?.cli==="pi"){if("Stop"===e)return{exitCode:0,stdout:JSON.stringify({permission:"deny",reason:`MANDATORY ACTION REQUIRED from failproofai (policy: ${t.name}): ${s}
|
|
6
|
+
|
|
7
|
+
You MUST complete the above action NOW. Do NOT ask the user for confirmation — execute the required action, then attempt to finish your task again.`}),stderr:"",policyName:t.name,reason:s,decision:"deny"};return{exitCode:0,stdout:JSON.stringify({permission:"deny",reason:l}),stderr:"",policyName:t.name,reason:s,decision:"deny"}}if(i?.cli==="gemini"){if("Stop"===e)return{exitCode:0,stdout:JSON.stringify({decision:"block",reason:`MANDATORY ACTION REQUIRED from failproofai (policy: ${t.name}): ${s}
|
|
8
|
+
|
|
9
|
+
You MUST complete the above action NOW. Do NOT ask the user for confirmation — execute the required action, then attempt to finish your task again.`}),stderr:"",policyName:t.name,reason:s,decision:"deny"};return{exitCode:0,stdout:JSON.stringify({decision:"deny",reason:l}),stderr:"",policyName:t.name,reason:s,decision:"deny"}}if(i?.cli==="opencode"&&("Stop"===e||"SubagentStop"===e))return{exitCode:0,stdout:JSON.stringify({hookSpecificOutput:{additionalContext:`MANDATORY ACTION REQUIRED from failproofai (policy: ${t.name}): ${s}
|
|
10
|
+
|
|
11
|
+
You MUST complete the above action NOW. Do NOT ask the user for confirmation — execute the required action, then attempt to finish your task again.`}}),stderr:"",policyName:t.name,reason:s,decision:"deny"};if("PreToolUse"===e)return{exitCode:0,stdout:JSON.stringify({hookSpecificOutput:{hookEventName:e,permissionDecision:"deny",permissionDecisionReason:l}}),stderr:"",policyName:t.name,reason:s,decision:"deny"};if("PermissionRequest"===e)return{exitCode:0,stdout:JSON.stringify({hookSpecificOutput:{hookEventName:e,decision:{behavior:"deny",message:`Blocked ${a} by failproofai because: ${s}, as per the policy configured by the user`}}}),stderr:"",policyName:t.name,reason:s,decision:"deny"};if("PostToolUse"===e)return{exitCode:0,stdout:JSON.stringify({hookSpecificOutput:{hookEventName:e,additionalContext:`Blocked ${a} by failproofai because: ${s}, as per the policy configured by the user`}}),stderr:"",policyName:t.name,reason:s,decision:"deny"};if("Stop"===e||"SubagentStop"===e){let e=`MANDATORY ACTION REQUIRED from failproofai (policy: ${t.name}): ${s}
|
|
12
|
+
|
|
13
|
+
You MUST complete the above action NOW. Do NOT ask the user for confirmation — execute the required action, then attempt to finish your task again.`;if(i?.cli==="copilot")return{exitCode:0,stdout:JSON.stringify({decision:"block",reason:e}),stderr:"",policyName:t.name,reason:s,decision:"deny"};return{exitCode:2,stdout:"",stderr:e,policyName:t.name,reason:s,decision:"deny"}}return{exitCode:2,stdout:"",stderr:s,policyName:t.name,reason:s,decision:"deny"}}if("instruct"===r.decision){let e=t8(r.reason??`Instruction from policy: ${t.name}`,t5(o,t.name)?.hint);l.push({policyName:t.name,reason:e}),q(`instruct by "${t.name}": ${e}`)}"allow"===r.decision&&r.reason&&c.push({policyName:t.name,reason:r.reason})}if(l.length>0){let t=l.map(e=>e.reason).join("\n"),o=l.map(e=>e.policyName);if(i?.cli==="cursor")return"Stop"===e||"SubagentStop"===e?{exitCode:0,stdout:JSON.stringify({followup_message:`Instruction from failproofai: ${t}`}),stderr:"",policyName:o[0],policyNames:o,reason:t,decision:"instruct"}:{exitCode:0,stdout:JSON.stringify({permission:"allow",additional_context:`Instruction from failproofai: ${t}`}),stderr:"",policyName:o[0],policyNames:o,reason:t,decision:"instruct"};if(i?.cli==="pi"){if("Stop"===e){let e=1===o.length?`policy: ${o[0]}`:`policies: ${o.join(", ")}`;return{exitCode:0,stdout:JSON.stringify({permission:"deny",reason:`MANDATORY ACTION REQUIRED from failproofai (${e}): ${t}
|
|
14
|
+
|
|
15
|
+
You MUST complete the above action(s) NOW. Do NOT ask the user for confirmation — execute the required action(s), then attempt to finish your task again.`}),stderr:"",policyName:o[0],policyNames:o,reason:t,decision:"instruct"}}return{exitCode:0,stdout:JSON.stringify({permission:"allow",reason:`Instruction from failproofai: ${t}`}),stderr:"",policyName:o[0],policyNames:o,reason:t,decision:"instruct"}}if(i?.cli==="gemini"){if("Stop"===e){let e=1===o.length?`policy: ${o[0]}`:`policies: ${o.join(", ")}`;return{exitCode:0,stdout:JSON.stringify({decision:"block",reason:`MANDATORY ACTION REQUIRED from failproofai (${e}): ${t}
|
|
16
|
+
|
|
17
|
+
You MUST complete the above action(s) NOW. Do NOT ask the user for confirmation — execute the required action(s), then attempt to finish your task again.`}),stderr:"",policyName:o[0],policyNames:o,reason:t,decision:"instruct"}}return"UserPromptSubmit"===e||"PreToolUse"===e||"PostToolUse"===e||"SessionStart"===e?{exitCode:0,stdout:JSON.stringify({hookSpecificOutput:{hookEventName:i?.hookEventName??i?.rawHookEventName??e,additionalContext:`Instruction from failproofai: ${t}`}}),stderr:"",policyName:o[0],policyNames:o,reason:t,decision:"instruct"}:{exitCode:0,stdout:"",stderr:l.map(e=>`[failproofai] ${e.policyName}: ${e.reason}`).join("\n")+"\n",policyName:o[0],policyNames:o,reason:t,decision:"instruct"}}if(i?.cli==="opencode"&&("Stop"===e||"SubagentStop"===e)){let e=1===o.length?`policy: ${o[0]}`:`policies: ${o.join(", ")}`;return{exitCode:0,stdout:JSON.stringify({hookSpecificOutput:{additionalContext:`MANDATORY ACTION REQUIRED from failproofai (${e}): ${t}
|
|
18
|
+
|
|
19
|
+
You MUST complete the above action(s) NOW. Do NOT ask the user for confirmation — execute the required action(s), then attempt to finish your task again.`}}),stderr:"",policyName:o[0],policyNames:o,reason:t,decision:"instruct"}}if("Stop"===e||"SubagentStop"===e){let e=1===o.length?`policy: ${o[0]}`:`policies: ${o.join(", ")}`,n=`MANDATORY ACTION REQUIRED from failproofai (${e}): ${t}
|
|
20
|
+
|
|
21
|
+
You MUST complete the above action(s) NOW. Do NOT ask the user for confirmation — execute the required action(s), then attempt to finish your task again.`;return i?.cli==="copilot"?{exitCode:0,stdout:JSON.stringify({decision:"block",reason:n}),stderr:"",policyName:o[0],policyNames:o,reason:t,decision:"instruct"}:{exitCode:2,stdout:"",stderr:n,policyName:o[0],policyNames:o,reason:t,decision:"instruct"}}return{exitCode:0,stdout:JSON.stringify({hookSpecificOutput:{hookEventName:e,additionalContext:`Instruction from failproofai: ${t}`}}),stderr:"",policyName:o[0],policyNames:o,reason:t,decision:"instruct"}}if(c.length>0){let t=c.map(e=>e.reason).join("\n"),o=c.map(e=>e.policyName);if(i?.cli==="cursor"){let e={permission:"allow",additional_context:`Note from failproofai: ${t}`},i=c.map(e=>`[failproofai] ${e.policyName}: ${e.reason}`).join("\n");return{exitCode:0,stdout:JSON.stringify(e),stderr:i+"\n",policyName:o[0],policyNames:o,reason:t,decision:"allow"}}if(i?.cli==="pi"){let e={permission:"allow",reason:`Note from failproofai: ${t}`},i=c.map(e=>`[failproofai] ${e.policyName}: ${e.reason}`).join("\n");return{exitCode:0,stdout:JSON.stringify(e),stderr:i+"\n",policyName:o[0],policyNames:o,reason:t,decision:"allow"}}if(i?.cli==="gemini"){let n="UserPromptSubmit"===e||"PreToolUse"===e||"PostToolUse"===e||"SessionStart"===e,r=c.map(e=>`[failproofai] ${e.policyName}: ${e.reason}`).join("\n");return n?{exitCode:0,stdout:JSON.stringify({hookSpecificOutput:{hookEventName:i?.hookEventName??i?.rawHookEventName??e,additionalContext:`Note from failproofai: ${t}`}}),stderr:r+"\n",policyName:o[0],policyNames:o,reason:t,decision:"allow"}:{exitCode:0,stdout:"",stderr:r+"\n",policyName:o[0],policyNames:o,reason:t,decision:"allow"}}let n="PreToolUse"===e||"PostToolUse"===e||"UserPromptSubmit"===e||"PermissionRequest"===e?{hookSpecificOutput:{hookEventName:e,additionalContext:`Note from failproofai: ${t}`}}:{reason:t},r=c.map(e=>`[failproofai] ${e.policyName}: ${e.reason}`).join("\n");return{exitCode:0,stdout:JSON.stringify(n),stderr:r+"\n",policyName:o[0],policyNames:o,reason:t,decision:"allow"}}return{exitCode:0,stdout:"",stderr:"",policyName:null,reason:null,decision:"allow"}}let t4=new Set(["warn-repeated-tool-calls"].map(e=>x(e))),t9=!1,t7=null;function ie(){if(t9)return;t7=[...R()],globalThis[$]=[],I(null);let e=new Set(e6.map(e=>e.name).filter(e=>!t4.has(x(e))).map(x));for(let t of e6)e.has(x(t.name))&&function(e,t,i,o,n=0){let r=x(e),a=R(),s=a.findIndex(e=>e.name===r),l={name:r,description:t,fn:i,match:o,priority:n};s>=0?a[s]=l:a.push(l),I(null)}(t.name,t.description,t.fn,t.match);t9=!0}async function it(e){t9||ie();let t={sessionId:e.sessionId,transcriptPath:e.transcriptPath,cwd:e.cwd,cli:e.cli},i={tool_name:e.toolName,tool_input:e.toolInput,session_id:e.sessionId,cwd:e.cwd,transcript_path:e.transcriptPath},o=[];if(ii(await t6("PreToolUse",i,t),"PreToolUse",o),void 0!==e.toolResultText){let n={...i,tool_response:e.toolResultText};ii(await t6("PostToolUse",n,t),"PostToolUse",o)}return o}function ii(e,t,i){for(let o of e.policyNames&&e.policyNames.length>0?e.policyNames:e.policyName?[e.policyName]:[])i.push({policyName:o,decision:e.decision,reason:e.reason,eventType:t})}function io(e){let t=e.indexOf("/");return t>=0?e.slice(t+1):e}function ir(e){return e.length<=80?e:e.slice(0,79)+"…"}async function ia(e){let t={transcriptPath:e.transcriptPath,cli:e.cli,projectName:e.projectName,sessionId:e.sessionId,mtimeMs:e.mtimeMs,sizeBytes:e.sizeBytes,cwd:"",eventsScanned:0,hitsByName:{},examplesByName:{},rangeByName:{}},i=await tj[e.cli].streamEvents(e);if(0===i.length)return t;t.eventsScanned=i.length,t.cwd=i[0].cwd||"";let o={};for(let e of i){let i;for(let i of tU){let n=i.detect(e,o);n&&is(t,i.name,e.timestamp,e.cwd,ir(n.example))}try{i=await it(e)}catch{continue}for(let o of i){let i=function(e,t){if("Bash"===t.toolName){let e=t.toolInput.command;if("string"==typeof e)return e.replace(/\s+/g," ")}let i=t.toolInput.file_path;return"string"==typeof i?`${t.toolName} ${i}`:`${t.toolName}`}(o.policyName,e);is(t,o.policyName,e.timestamp,e.cwd,ir(i))}}return t}function is(e,t,i,o,n){e.hitsByName[t]=(e.hitsByName[t]??0)+1;let r=e.examplesByName[t]??[];r.length<3&&(r.push({timestamp:i,cwd:o,example:n}),e.examplesByName[t]=r);let a=e.rangeByName[t];a?(i<a.first&&(a.first=i),i>a.last&&(a.last=i)):e.rangeByName[t]={first:i,last:i}}async function il(e={}){let t=Date.now();ie();try{return await ic(e,t)}finally{if(t9){if(null!==t7){var i;i=t7,globalThis[$]=[...i],I(null),t7=null}t9=!1}}}async function ic(e,t){let i=e.clis??Array.from(e9),o=function(e){if(!e)return;let t=/^(\d+)\s*([dhm])$/i.exec(e.trim());if(t){let e=parseInt(t[1],10),i=t[2].toLowerCase();return Date.now()-e*("d"===i?864e5:"h"===i?36e5:6e4)}let i=Date.parse(e);if(!Number.isNaN(i))return i;throw Error(`Invalid --since value: "${e}" (expected e.g. "7d", "30d", or "2026-04-01")`)}(e.since),n=new Set(((function(){let e=function(e){let t=(0,S.homedir)(),i=(0,k.resolve)(e);for(;i!==t;){let e=(0,k.resolve)(i,".failproofai");try{if((0,O.statSync)(e).isDirectory())return i}catch{}let t=(0,k.dirname)(i);if(t===i)break;i=t}return(0,k.resolve)(e)}((void 0)??process.cwd()),t=(0,k.resolve)(e,".failproofai","policies-config.json"),i=(0,k.resolve)(e,".failproofai","policies-config.local.json"),o=(0,k.resolve)((0,S.homedir)(),".failproofai","policies-config.json"),n=e4(t),r=e4(i),a=e4(o),s=new Set([...n.enabledPolicies??[],...r.enabledPolicies??[],...a.enabledPolicies??[]]),l={};for(let e of[n,r,a])if(e.policyParams)for(let[t,i]of Object.entries(e.policyParams))t in l||(l[t]=i);let c=n.customPoliciesPath??r.customPoliciesPath??a.customPoliciesPath,p=n.llm??r.llm??a.llm;return{enabledPolicies:[...s],...Object.keys(l).length>0?{policyParams:l}:{},...void 0!==c?{customPoliciesPath:c}:{},...void 0!==p?{llm:p}:{}}})().enabledPolicies??[]).map(e=>x(e))),r=[];for(let t of i){let i,n=tj[t];try{i=await n.listTranscripts({projects:e.projects,sinceMs:o})}catch{continue}r.push(...i)}let a=0,s=0,l=r.map(t=>async()=>{if(!e.noCache){let e=function(e,t,i){if(0===i)return null;let o=tQ(e);if(!(0,O.existsSync)(o))return null;try{let e=(0,O.readFileSync)(o,"utf-8"),n=JSON.parse(e);if(2!==n.schemaVersion||n.mtimeMs!==t||n.sizeBytes!==i||n.engineVersion!==tZ()||n.detectorVersion!==tK())return null;return n.result??null}catch{return null}}(t.transcriptPath,t.mtimeMs,t.sizeBytes);if(e)return e}try{let i=await ia(t);return e.noCache||function(e,t,i,o){if(0===i)return;let n=tQ(e);try{(0,O.mkdirSync)((0,k.join)((0,S.homedir)(),".failproofai","cache","audit"),{recursive:!0});let e={schemaVersion:2,mtimeMs:t,sizeBytes:i,engineVersion:tZ(),detectorVersion:tK(),result:o};(0,O.writeFileSync)(n,JSON.stringify(e),{encoding:"utf-8",mode:384});try{(0,O.chmodSync)(n,384)}catch{}}catch{}}(t.transcriptPath,t.mtimeMs,t.sizeBytes,i),i}catch{return s++,{transcriptPath:t.transcriptPath,cli:t.cli,projectName:t.projectName,cwd:"",sessionId:t.sessionId,mtimeMs:t.mtimeMs,sizeBytes:t.sizeBytes,eventsScanned:0,hitsByName:{},examplesByName:{},rangeByName:{}}}}),c=await (0,w.batchAll)(l,8),p=[];for(let e of c)"fulfilled"===e.status?p.push(e.value):a++;let d=function(e,t){let i=new Map;for(let t of e)for(let[e,o]of Object.entries(t.hitsByName)){let n=i.get(e)??{hits:0,projects:new Set,examples:[]};for(let i of(n.hits+=o,n.projects.add(t.projectName),t.examplesByName[e]??[]))n.examples.length<3&&n.examples.push({...i,sessionId:t.sessionId});let r=t.rangeByName[e];r&&((!n.first||r.first<n.first)&&(n.first=r.first),(!n.last||r.last>n.last)&&(n.last=r.last)),i.set(e,n)}let o=new Map(tU.map(e=>[e.name,e])),n=[];for(let[e,r]of i){let i=o.get(e),a=!!i,s=a?null:function(e){let t=io(e);for(let i of e6)if(i.name===e||io(i.name)===t)return i;return null}(e),l=a?"audit-detector":"builtin",c=!a&&t.has(x(e)),p=i?.displayTitle??s?.displayTitle??i?.description??s?.description??io(e),d=i?.impact??s?.impact??"";n.push({name:e,source:l,category:i?.category??s?.category??"Custom",severity:a?i?.severity??"info":function(e){let t,i=(t=e.indexOf("/"))>=0?e.slice(t+1):e;return i.startsWith("sanitize-")?"sanitize":i.startsWith("block-")?"deny":i.startsWith("warn-")||i.startsWith("protect-")||i.startsWith("prefer-")||i.startsWith("require-")?"warn":"deny"}(e),hits:r.hits,projects:r.projects.size,firstSeen:r.first,lastSeen:r.last,examples:r.examples,displayTitle:p,impact:d,enabledInConfig:c,installHint:"audit-detector"===l?"Audit-only — `failproofai audit` will keep tracking these.":c?"Already enforced — failproofai is blocking these in real time.":`Enable in one command: failproofai policies --install ${io(e)}`})}return n.sort((e,t)=>t.hits-e.hits),n}(p,n);if(e.policies?.length){let t=new Set(e.policies.map(io));d=d.filter(e=>t.has(io(e.name)))}let u=d.reduce((e,t)=>e+t.hits,0),m=new Set,f=new Set,h=0;for(let e of p)Object.keys(e.hitsByName).length>0&&m.add(e.projectName),e.cwd&&f.add(e.cwd),h+=e.eventsScanned??0;return{version:2,scannedAt:new Date(t).toISOString(),scope:{cli:i,projects:e.projects??"all",since:e.since??null},transcripts:{scanned:r.length,skipped:a,errors:s,durationMs:Date.now()-t},results:d,totals:{hits:u,projectsWithHits:m.size},projectsScanned:[...f].sort(),eventsScanned:h,enabledBuiltinNames:[...n].map(e=>e.includes("/")?e.slice(e.indexOf("/")+1):e)}}var ip=e.i(47756),id=e.i(48480);let iu=new Set(e9);async function im(e){let t={};try{let i=await e.text();if(i.trim().length>0){let e=JSON.parse(i);if(null===e||"object"!=typeof e||Array.isArray(e))return b.NextResponse.json({error:"Request body must be a JSON object"},{status:400});t=e}}catch{return b.NextResponse.json({error:"Invalid JSON body"},{status:400})}let i=function(e){let t={};if("string"==typeof e.since&&e.since.trim()&&(t.since=e.since.trim()),Array.isArray(e.cli)&&e.cli.length>0){let i=e.cli.filter(e=>"string"==typeof e&&iu.has(e));i.length>0&&(t.clis=i)}return Array.isArray(e.project)&&e.project.length>0&&(t.projects=e.project.filter(e=>"string"==typeof e)),Array.isArray(e.policy)&&e.policy.length>0&&(t.policies=e.policy.filter(e=>"string"==typeof e)),!0===e.noCache&&(t.noCache=!0),t}(t);if(!(0,id.tryAcquireRun)())return b.NextResponse.json({error:"Audit already running",status:"already-running"},{status:409});try{let e=await il(i);return(0,ip.writeDashboardCache)(i,e),b.NextResponse.json({status:"ok",result:e})}catch(t){let e=t instanceof Error?t.message:String(t);return b.NextResponse.json({error:e,status:"error"},{status:500})}finally{(0,id.releaseRun)()}}e.s(["POST",0,im,"dynamic",0,"force-dynamic","maxDuration",0,120],97610);var ih=e.i(97610);let ig=new t.AppRouteRouteModule({definition:{kind:i.RouteKind.APP_ROUTE,page:"/api/audit/run/route",pathname:"/api/audit/run",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/audit/run/route.ts",nextConfigOutput:"standalone",userland:ih,...{}}),{workAsyncStorage:iy,workUnitAsyncStorage:ib,serverHooks:iw}=ig;async function ik(e,t,o){o.requestMeta&&(0,n.setRequestMeta)(e,o.requestMeta),ig.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let b="/api/audit/run/route";b=b.replace(/\/index$/,"")||"/";let w=await ig.prepare(e,t,{srcPage:b,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==o.waitUntil||o.waitUntil.call(o,Promise.resolve()),null;let{buildId:k,deploymentId:v,params:N,nextConfig:S,parsedUrl:T,isDraftMode:E,prerenderManifest:P,routerServerContext:$,isOnDemandRevalidate:C,revalidateOnlyGenerated:A,resolvedPathname:x,clientReferenceManifest:I,serverActionsManifest:R}=w,O=(0,s.normalizeAppPath)(b),B=!!(P.dynamicRoutes[O]||P.routes[x]),j=async()=>((null==$?void 0:$.render404)?await $.render404(e,t,T,!1):t.end("This page could not be found"),null);if(B&&!E){let e=!!P.routes[x],t=P.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(S.adapterPath)return await j();throw new g.NoFallbackError}}let _=null;!B||ig.isDev||E||(_="/index"===(_=x)?"/":_);let D=!0===ig.isDev||!B,W=B&&!D;R&&I&&(0,a.setManifestsSingleton)({page:b,clientReferenceManifest:I,serverActionsManifest:R});let U=e.method||"GET",M=(0,r.getTracer)(),L=M.getActiveScopeSpan(),z=!!(null==$?void 0:$.isWrappedByNextServer),q=!!(0,n.getRequestMeta)(e,"minimalMode"),H=(0,n.getRequestMeta)(e,"incrementalCache")||await ig.getIncrementalCache(e,S,P,q);null==H||H.resetRequestCache(),globalThis.__incrementalCache=H;let F={params:N,previewProps:P.preview,renderOpts:{experimental:{authInterrupts:!!S.experimental.authInterrupts},cacheComponents:!!S.cacheComponents,supportsDynamicResponse:D,incrementalCache:H,cacheLifeProfiles:S.cacheLife,waitUntil:o.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,i,o,n)=>ig.onRequestError(e,t,o,n,$)},sharedContext:{buildId:k,deploymentId:v}},G=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),Y=c.NextRequestAdapter.fromNodeNextRequest(G,(0,c.signalFromNodeResponse)(t));try{let n,a=async e=>ig.handle(Y,F).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let i=M.getRootSpanAttributes();if(!i)return;if(i.get("next.span_type")!==p.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${i.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let o=i.get("next.route");if(o){let t=`${U} ${o}`;e.setAttributes({"next.route":o,"http.route":o,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",o),n.updateName(t))}else e.updateName(`${U} ${b}`)}),s=async n=>{var r,s;let l=async({previousCacheEntry:i})=>{try{if(!q&&C&&A&&!i)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let r=await a(n);e.fetchMetrics=F.renderOpts.fetchMetrics;let s=F.renderOpts.pendingWaitUntil;s&&o.waitUntil&&(o.waitUntil(s),s=void 0);let l=F.renderOpts.collectedTags;if(!B)return await (0,u.sendResponse)(G,J,r,F.renderOpts.pendingWaitUntil),null;{let e=await r.blob(),t=(0,m.toNodeOutgoingHttpHeaders)(r.headers);l&&(t[h.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let i=void 0!==F.renderOpts.collectedRevalidate&&!(F.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&F.renderOpts.collectedRevalidate,o=void 0===F.renderOpts.collectedExpire||F.renderOpts.collectedExpire>=h.INFINITE_CACHE?void 0:F.renderOpts.collectedExpire;return{value:{kind:y.CachedRouteKind.APP_ROUTE,status:r.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:i,expire:o}}}}catch(t){throw(null==i?void 0:i.isStale)&&await ig.onRequestError(e,t,{routerKind:"App Router",routePath:b,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:W,isOnDemandRevalidate:C})},!1,$),t}},c=await ig.handleResponse({req:e,nextConfig:S,cacheKey:_,routeKind:i.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:P,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:A,responseGenerator:l,waitUntil:o.waitUntil,isMinimalMode:q});if(!B)return null;if((null==c||null==(r=c.value)?void 0:r.kind)!==y.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==c||null==(s=c.value)?void 0:s.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});q||t.setHeader("x-nextjs-cache",C?"REVALIDATED":c.isMiss?"MISS":c.isStale?"STALE":"HIT"),E&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,m.fromNodeOutgoingHttpHeaders)(c.value.headers);return q&&B||p.delete(h.NEXT_CACHE_TAGS_HEADER),!c.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,f.getCacheControlHeader)(c.cacheControl)),await (0,u.sendResponse)(G,J,new Response(c.value.body,{headers:p,status:c.value.status||200})),null};z&&L?await s(L):(n=M.getActiveScopeSpan(),await M.withPropagatedContext(e.headers,()=>M.trace(p.BaseServerSpan.handleRequest,{spanName:`${U} ${b}`,kind:r.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},s),void 0,!z))}catch(t){if(t instanceof g.NoFallbackError||await ig.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:W,isOnDemandRevalidate:C})},!1,$),B)throw t;return await (0,u.sendResponse)(G,J,new Response(null,{status:500})),null}}e.s(["handler",0,ik,"patchFetch",0,function(){return(0,o.patchFetch)({workAsyncStorage:iy,workUnitAsyncStorage:ib})},"routeModule",0,ig,"serverHooks",0,iw,"workAsyncStorage",0,iy,"workUnitAsyncStorage",0,ib],89498)}];
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=node_modules_next_dist_esm_build_templates_app-route_17k9e3w.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[39702,e=>{"use strict";let t,r,i,s,a;var n,o=e.i(14747);function l(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}let u=e=>void 0===e?void 0:e.variant??e.enabled,c=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return e}};var d=((n={}).AnonymousId="anonymous_id",n.DistinctId="distinct_id",n.Props="props",n.EnablePersonProcessing="enable_person_processing",n.PersonMode="person_mode",n.FeatureFlagDetails="feature_flag_details",n.FeatureFlags="feature_flags",n.FeatureFlagPayloads="feature_flag_payloads",n.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",n.BootstrapFeatureFlags="bootstrap_feature_flags",n.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",n.OverrideFeatureFlags="override_feature_flags",n.Queue="queue",n.LogsQueue="logs_queue",n.OptedOut="opted_out",n.SessionId="session_id",n.SessionStartTimestamp="session_start_timestamp",n.SessionLastTimestamp="session_timestamp",n.PersonProperties="person_properties",n.GroupProperties="group_properties",n.InstalledAppBuild="installed_app_build",n.InstalledAppVersion="installed_app_version",n.SessionReplay="session_replay",n.SurveyLastSeenDate="survey_last_seen_date",n.SurveysSeen="surveys_seen",n.Surveys="surveys",n.RemoteConfig="remote_config",n.FlagsEndpointWasHit="flags_endpoint_was_hit",n.DeviceId="device_id",n);let h={ERRORS_WHILE_COMPUTING:"errors_while_computing_flags",FLAG_MISSING:"flag_missing",QUOTA_LIMITED:"quota_limited",TIMEOUT:"timeout",CONNECTION_ERROR:"connection_error",UNKNOWN_ERROR:"unknown_error",apiError:e=>`api_error_${e}`},g=e=>{let t=Error(`Native gzip produced invalid output: ${e}`);throw t.name="NativeGzipValidationError",t},p=async(e,r)=>{e.size<18&&g("too-short");let i=new Uint8Array(await e.slice(0,10).arrayBuffer());i.length>=2&&31===i[0]&&139===i[1]&&8===i[2]||g("invalid-header");let s=new DataView(await e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(e=>{let r=(()=>{if(t)return t;t=[];for(let e=0;e<256;e++){let r=e;for(let e=0;e<8;e++)r=1&r?0xedb88320^r>>>1:r>>>1;t[e]=r>>>0}return t})(),i=0xffffffff;for(let t=0;t<e.length;t++)i=r[(i^e[t])&255]^i>>>8;return(0xffffffff^i)>>>0})(r)&&g("invalid-crc");let a=r.length>>>0;s.getUint32(4,!0)!==a&&g("invalid-size")};async function f(e,t=!0,r){try{let t=new TextEncoder().encode(e),r=new CompressionStream("gzip"),i=r.writable.getWriter(),s=i.write(t).then(()=>i.close()).catch(async e=>{try{await i.abort(e)}catch{}throw e}),a=new Response(r.readable).blob(),[n]=await Promise.all([a,s]);return await p(n,t),n}catch(e){if(r?.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}}let y=Array.isArray,m=Object.prototype;m.hasOwnProperty;let v=m.toString,_=y||function(e){return"[object Array]"===v.call(e)},b=e=>e===Object(e)&&!_(e),w=e=>"[object String]"==v.call(e),E=e=>"[object Number]"==v.call(e)&&e==e;function F(e){return null===e||"object"!=typeof e}function P(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function x(e){return"u">typeof Event&&function(e,t){try{return e instanceof t}catch{return!1}}(e,Event)}let S="Android",I="BlackBerry",C="Nintendo",k="PlayStation",$="Xbox",A="Windows",O="(\\d+(\\.\\d+)?)";RegExp("Version/"+O),RegExp($,"i"),RegExp(k+" \\w+","i"),RegExp(C+" \\w+","i"),RegExp(I+"|PlayBook|BB10","i");async function T(e,t){let r=null;for(let i=0;i<t.retryCount+1;i++){i>0&&await new Promise(e=>setTimeout(e,t.retryDelay));try{return await e()}catch(e){if(r=e,!t.retryCheck(e))throw e}}throw r}function R(){return new Date().toISOString()}function L(e,t){let r=setTimeout(e,t);return r?.unref&&r?.unref(),r}RegExp("rv:"+O),RegExp("Edge?\\/"+O),RegExp("(Chrome|CrMo)\\/"+O),RegExp("CriOS\\/"+O),RegExp("(UCBrowser|UCWEB)\\/"+O),RegExp("(Opera|OPR)\\/"+O),RegExp("Firefox\\/"+O),RegExp("FxiOS\\/"+O),RegExp("Konqueror[:/]?"+O,"i"),RegExp(I+" "+O),RegExp("android\\s"+O,"i"),RegExp("SamsungBrowser\\/"+O),RegExp("OculusBrowser\\/"+O),RegExp("Vivaldi\\/"+O),RegExp("YaBrowser\\/"+O),RegExp("Whale\\/"+O),RegExp("Brave\\/"+O),RegExp("(DuckDuckGo|Ddg)\\/"+O),RegExp("PaleMoon\\/"+O),RegExp("Waterfox\\/"+O),RegExp("(rv:|MSIE )"+O),RegExp("rv:"+O),RegExp($+"; "+$+" (.*?)[);]","i"),RegExp(C,"i"),RegExp(k,"i"),RegExp(A,"i"),RegExp("("+S+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+S+")","i");let j=e=>e instanceof Error;function M(e){return Promise.all(e.map(e=>(e??Promise.resolve()).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))}let D="0123456789abcdef";class U{constructor(e){this.bytes=e}static ofInner(e){if(16===e.length)return new U(e);throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,i){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||t<0||r<0||i<0||e>0xffffffffffff||t>4095||r>0x3fffffff||i>0xffffffff)throw RangeError("invalid field value");let s=new Uint8Array(16);return s[0]=e/0x10000000000,s[1]=e/0x100000000,s[2]=e/0x1000000,s[3]=e/65536,s[4]=e/256,s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new U(s)}static parse(e){let t;switch(e.length){case 32:t=/^[0-9a-f]{32}$/i.exec(e)?.[0];break;case 36:t=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e)?.slice(1,6).join("");break;case 38:t=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(e)?.slice(1,6).join("");break;case 45:t=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e)?.slice(1,6).join("")}if(t){let e=new Uint8Array(16);for(let r=0;r<16;r+=4){let i=parseInt(t.substring(2*r,2*r+8),16);e[r+0]=i>>>24,e[r+1]=i>>>16,e[r+2]=i>>>8,e[r+3]=i}return new U(e)}throw SyntaxError("could not parse UUID string")}toString(){let e="";for(let t=0;t<this.bytes.length;t++)e+=D.charAt(this.bytes[t]>>>4),e+=D.charAt(15&this.bytes[t]),(3===t||5===t||7===t||9===t)&&(e+="-");return e}toHex(){let e="";for(let t=0;t<this.bytes.length;t++)e+=D.charAt(this.bytes[t]>>>4),e+=D.charAt(15&this.bytes[t]);return e}toJSON(){return this.toString()}getVariant(){let e=this.bytes[8]>>>4;if(e<0)throw Error("unreachable");if(e<=7)return this.bytes.every(e=>0===e)?"NIL":"VAR_0";if(e<=11)return"VAR_10";if(e<=13)return"VAR_110";if(e<=15)return this.bytes.every(e=>255===e)?"MAX":"VAR_RESERVED";throw Error("unreachable")}getVersion(){return"VAR_10"===this.getVariant()?this.bytes[6]>>>4:void 0}clone(){return new U(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(let t=0;t<16;t++){let r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class B{constructor(e){this.timestamp=0,this.counter=0,this.random=e??q()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(e,t){let r=this.generateOrAbortCore(e,t);return void 0===r&&(this.timestamp=0,r=this.generateOrAbortCore(e,t)),r}generateOrAbortCore(e,t){if(!Number.isInteger(e)||e<1||e>0xffffffffffff)throw RangeError("`unixTsMs` must be a 48-bit positive integer");if(t<0||t>0xffffffffffff)throw RangeError("`rollbackAllowance` out of reasonable range");if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+t>=this.timestamp))return;this.counter++,this.counter>0x3ffffffffff&&(this.timestamp++,this.resetCounter())}return U.fromFieldsV7(this.timestamp,Math.trunc(this.counter/0x40000000),this.counter&0x40000000-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}generateV4(){let e=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return e[6]=64|e[6]>>>4,e[8]=128|e[8]>>>2,U.ofInner(e)}}let q=()=>({nextUint32:()=>65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random())}),H=()=>N().toString(),N=()=>(r||(r=new B)).generate();function G(e){let t={};if(e)for(let r of e.split(";")){let[e,...i]=r.trim().split("=");if(e){let r=i.join("=").trim();try{t[e.trim()]=decodeURIComponent(r)}catch{t[e.trim()]=r}}}return{get:e=>e in t?{value:t[e]}:void 0}}function W(e){let t=e.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ");return`ph_${t}_posthog`}function z(e){let t=Date.now();return JSON.stringify({distinct_id:e,$device_id:e,$user_state:"anonymous",$sesid:[t,H(),t]})}function K(e,t){let r=W(t),i=e.get(r);return i?Q(i.value):null}function V(e){if(!e)return;let t={};return e.sessionId&&(t.$session_id=e.sessionId),e.deviceId&&(t.$device_id=e.deviceId),Object.keys(t).length>0?t:void 0}function Q(e){if(!e)return null;try{let t=JSON.parse(e);if(!t||"object"!=typeof t||!t.distinct_id)return null;let r=_(t.$sesid)?t.$sesid[1]:void 0;return{distinctId:String(t.distinct_id),isIdentified:"identified"===t.$user_state,sessionId:"string"==typeof r?r:void 0,deviceId:"string"==typeof t.$device_id?t.$device_id:void 0}}catch{return null}}class J{constructor(){this.events={},this.events={}}on(e,t){return this.events[e]||(this.events[e]=[]),this.events[e].push(t),()=>{this.events[e]=this.events[e].filter(e=>e!==t)}}emit(e,t){for(let r of this.events[e]||[])r(t);for(let r of this.events["*"]||[])r(e,t)}}class Y{add(e){let t=H();return this.promiseByIds[t]=e,e.catch(()=>{}).finally(()=>{delete this.promiseByIds[t]}),e}async join(){let e=Object.values(this.promiseByIds),t=e.length;for(;t>0;)await Promise.all(e),t=(e=Object.values(this.promiseByIds)).length}get length(){return Object.keys(this.promiseByIds).length}constructor(){this.promiseByIds={}}}let X=(e,t,r)=>{function i(s,...a){t(()=>{(0,r[s])(e,...a)})}return{debug:(...e)=>{i("debug",...e)},info:(...e)=>{i("log",...e)},warn:(...e)=>{i("warn",...e)},error:(...e)=>{i("error",...e)},critical:(...t)=>{r.error(e,...t)},createLogger:i=>X(`${e} ${i}`,t,r)}};class Z{constructor(e,t,r=[]){this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t={}){let r=t&&t.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,t,0).apply(e),s=this.buildParsingContext(t),a=this.parseStacktrace(i,s);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}async modifyFrames(e){for(let t of e)t.stacktrace&&t.stacktrace.frames&&_(t.stacktrace.frames)&&(t.stacktrace.frames=await this.applyModifiers(t.stacktrace.frames));return e}coerceFallback(e){return{type:"Error",value:"Unknown error",stack:e.syntheticException?.stack,synthetic:!0}}parseStacktrace(e,t){let r,i;return null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),{...e,cause:r,stack:i}}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(let r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}async applyModifiers(e){let t=e;for(let e of this.modifiers)t=await e(t);return t}convertToExceptionList(e,t){let r={type:e.type,value:e.value,mechanism:{type:t.type??"generic",handled:t.handled??!0,synthetic:e.synthetic??!1}};e.stack&&(r.stacktrace={type:"raw",frames:e.stack});let i=[r];return null!=e.cause&&i.push(...this.convertToExceptionList(e.cause,{...t,handled:!0})),i}buildParsingContext(e){return{chunkIdMap:function(e){let t=globalThis._posthogChunkIds;if(!t)return;let r=Object.keys(t);return a&&r.length===s?a:(s=r.length,a=r.reduce((r,s)=>{i||(i={});let a=i[s];if(a)r[a[0]]=a[1];else{let a=e(s);for(let e=a.length-1;e>=0;e--){let n=a[e],o=n?.filename,l=t[s];if(o&&l){r[o]=l,i[s]=[o,l];break}}}return r},{}))}(this.stackParser),skipFirstLines:e.skipFirstLines??1}}buildCoercingContext(e,t,r=0){let i=(r,i)=>{if(i<=4){let s=this.buildCoercingContext(e,t,i);return this.applyCoercers(r,s)}};return{...t,syntheticException:0==r?t.syntheticException:void 0,mechanism:e,apply:e=>i(e,r),next:e=>i(e,r+1)}}}function ee(e,t,r,i,s){let a={platform:e,filename:t,function:"<anonymous>"===r?"?":r,in_app:!0};return void 0!==i&&(a.lineno=i),void 0!==s&&(a.colno=s),a}e.s(["ErrorPropertiesBuilder",0,Z],69309);let et=(e,t)=>{let r=-1!==e.indexOf("safari-extension"),i=-1!==e.indexOf("safari-web-extension");return r||i?[-1!==e.indexOf("@")?e.split("@")[0]:"?",r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},er=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ei=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,es=/\((\S*)(?::(\d+))(?::(\d+))\)/,ea=(e,t)=>{let r=er.exec(e);if(r){let[,e,i,s]=r;return ee(t,e,"?",+i,+s)}let i=ei.exec(e);if(i){if(i[2]&&0===i[2].indexOf("eval")){let e=es.exec(i[2]);e&&(i[2]=e[1],i[3]=e[2],i[4]=e[3])}let[e,r]=et(i[1]||"?",i[2]);return ee(t,r,e,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},en=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,eo=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,el=(e,t)=>{let r=en.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){let e=eo.exec(r[3]);e&&(r[1]=r[1]||"eval",r[3]=e[1],r[4]=e[2],r[5]="")}let e=r[3],i=r[1]||"?";return[i,e]=et(i,e),ee(t,e,i,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},eu=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,ec=(e,t)=>{let r=eu.exec(e);return r?ee(t,r[2],r[1]||"?",+r[3],r[4]?+r[4]:void 0):void 0},ed=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,eh=(e,t)=>{let r=ed.exec(e);return r?ee(t,r[2],r[3]||"?",+r[1]):void 0},eg=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,ep=(e,t)=>{let r=eg.exec(e);return r?ee(t,r[5],r[3]||r[4]||"?",+r[1],+r[2]):void 0},ef=/^\s*[-]{4,}$/,ey=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,em=(e,t)=>{let r=e.match(ey);if(r){let e,i,s,a,n;if(r[1]){let t=(s=r[1]).lastIndexOf(".");if("."===s[t-1]&&t--,t>0){e=s.slice(0,t),i=s.slice(t+1);let r=e.indexOf(".Module");r>0&&(s=s.slice(r+1),e=e.slice(0,r))}a=void 0}i&&(a=e,n=i),"<anonymous>"===i&&(n=void 0,s=void 0),void 0===s&&(n=n||"?",s=a?`${a}.${n}`:n);let o=r[2]?.startsWith("file://")?r[2].slice(7):r[2],l="native"===r[5];return o?.match(/\/[A-Z]:/)&&(o=o.slice(1)),o||!r[5]||l||(o=r[5]),{filename:o?decodeURI(o):void 0,module:void 0,function:s,lineno:ev(r[3]),colno:ev(r[4]),in_app:function(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&void 0!==e&&!e.includes("node_modules/")}(o||"",l),platform:t}}if(e.match(ef))return{filename:e,platform:t}};function ev(e){return parseInt(e||"",10)||void 0}let e_=/\(error: (.*)\)/;function eb(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>{var r;return{...e,filename:e.filename||((r=t)[r.length-1]||{}).filename,function:e.function||"?"}})}function ew(){return eE("web:javascript",ea,el)}function eE(e,...t){return(r,i=0)=>{let s=[],a=r.split("\n");for(let r=i;r<a.length;r++){let i=a[r];if(i.length>1024)continue;let n=e_.test(i)?i.replace(e_,"$1"):i;if(!n.match(/\S*Error: /)){for(let r of t){let t=r(n,e);if(t){s.push(t);break}}if(s.length>=50)break}}return eb(s)}}e.s(["createDefaultStackParser",0,ew,"createStackParser",0,eE,"reverseAndStripFrames",0,eb],10728);class eF{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){let r=w(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){let t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${t}: ${e.message}`:t}isDOMException(e){return P(e,"DOMException")}isDOMError(e){return P(e,"DOMError")}}e.s(["DOMExceptionCoercer",0,eF],33603);class eP{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){let r=e.message;return r.error&&"string"==typeof r.error.message?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}}e.s(["ErrorCoercer",0,eP],13446);class ex{match(e){return P(e,"ErrorEvent")&&void 0!=e.error}coerce(e,t){let r=t.apply(e.error);return r||{type:"ErrorEvent",value:e.message,stack:t.syntheticException?.stack,synthetic:!0}}}e.s(["ErrorEventCoercer",0,ex],60887);let eS=["fatal","error","warning","log","info","debug"];function eI(e,t=40){let r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(let e=r.length;e>0;e--){let i=r.slice(0,e).join(", ");if(!(i.length>t)){if(e===r.length)return i;return i.length<=t?i:`${i.slice(0,t)}...`}}return""}class eC{match(e){return"object"==typeof e&&null!==e}coerce(e,t){let r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:t.syntheticException?.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return x(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){let t=`'${e.name}' captured as exception`;return"message"in e&&"string"==typeof e.message&&(t+=` with message: '${e.message}'`),t}if("message"in e&&"string"==typeof e.message)return e.message;let t=this.getObjectClassName(e),r=eI(e);return`${t&&"Object"!==t?`'${t}'`:"Object"} captured as exception with keys: ${r}`}isSeverityLevel(e){return w(e)&&!(w(e)&&0===e.trim().length)&&eS.indexOf(e)>=0}getErrorPropertyFromObject(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(j(r))return r}}getObjectClassName(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}e.s(["ObjectCoercer",0,eC],12154);class ek{match(e){return x(e)}coerce(e,t){let r=e.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${eI(e)}`,stack:t.syntheticException?.stack,synthetic:!0}}}e.s(["EventCoercer",0,ek],41324);class e${match(e){return F(e)}coerce(e,t){return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:t.syntheticException?.stack,synthetic:!0}}}e.s(["PrimitiveCoercer",0,e$],79478);class eA{match(e){return P(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!x(e))return!1;try{let t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch{return!1}}coerce(e,t){let r=this.getUnhandledRejectionReason(e);return F(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:t.syntheticException?.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch{}return e}}e.s(["PromiseRejectionEventCoercer",0,eA],1802),e.s([],59567);let eO={MESSAGE:"$message",TIMESTAMP:"$timestamp"},eT=new Set([eO.MESSAGE,eO.TIMESTAMP]),eR={enabled:!0,max_bytes:32768};function eL(e){return e?{enabled:e.enabled??eR.enabled,max_bytes:function(e,t){if(!E(e)||e===1/0||e===-1/0)return t;let r=Math.floor(e);return r<0?t:r}(e.max_bytes,eR.max_bytes)}:{...eR}}function ej(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};let t=[];return{sanitizedProperties:Object.keys(e).reduce((r,i)=>(eT.has(i)?t.push(i):r[i]=e[i],r),{}),droppedKeys:t}}class eM{constructor(e){this._entries=[],this._totalBytes=0,this._config=eL(e)}setConfig(e){this._config=eL(e),this._trimToMaxBytes()}add(e){let t=function(e){let t=function(e){let t=new WeakSet;try{return JSON.stringify(e,(e,r)=>{if("bigint"==typeof r)return r.toString();if("function"!=typeof r&&"symbol"!=typeof r){if(r instanceof Date)return r.toISOString();if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&"object"==typeof r){if(t.has(r))return"[Circular]";t.add(r)}return r}})}catch{return}}(e);if(t)try{let e=JSON.parse(t);if(!b(e))return;let r=e[eO.MESSAGE],i=e[eO.TIMESTAMP];if(!w(r)||0===r.trim().length||!w(i)&&!E(i))return;return{step:e,json:t}}catch{return}}(e);if(!t)return;let r=eD(t.json);r>this._config.max_bytes||(this._entries.push({step:t.step,bytes:r}),this._totalBytes+=r,this._trimToMaxBytes())}getAttachable(){return this._entries.map(e=>e.step)}clear(){this._entries=[],this._totalBytes=0}size(){return this._entries.length}_trimToMaxBytes(){for(;this._totalBytes>this._config.max_bytes&&this._entries.length>0;){let e=this._entries.shift();e&&(this._totalBytes-=e.bytes)}}}function eD(e){if("u">typeof TextEncoder)return new TextEncoder().encode(e).length;let t=encodeURIComponent(e),r=0;for(let e=0;e<t.length;e++)"%"===t[e]?(r+=1,e+=2):r+=1;return r}e.s(["DEFAULT_EXCEPTION_STEPS_CONFIG",0,eR,"EXCEPTION_STEP_INTERNAL_FIELDS",0,eO,"ExceptionStepsBuffer",0,eM,"getUtf8ByteLength",0,eD,"resolveExceptionStepsConfig",0,eL,"stripReservedExceptionStepFields",0,ej],45162),e.s([],21754);let eU=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class eB{match(e){return"string"==typeof e}coerce(e,t){let[r,i]=this.getInfos(e);return{type:r??"Error",value:i??e,stack:t.syntheticException?.stack,synthetic:!0}}getInfos(e){let t="Error",r=e,i=e.match(eU);return i&&(t=i[1],r=i[2]),[t,r]}}e.s(["StringCoercer",0,eB],22175);class eq extends Error{constructor(e,t){super("HTTP error while fetching PostHog: status="+e.status+", reqByteLength="+t),this.response=e,this.reqByteLength=t,this.name="PostHogFetchHttpError"}get status(){return this.response.status}get text(){return this.response.text()}get json(){return this.response.json()}}class eH extends Error{constructor(e){super("Network error while fetching PostHog",e instanceof Error?{cause:e}:{}),this.error=e,this.name="PostHogFetchNetworkError"}}async function eN(e){if(e instanceof eq){let t="";try{t=await e.text}catch{}console.error(`Error while flushing PostHog: message=${e.message}, response body=${t}`,e)}else console.error("Error while flushing PostHog",e);return Promise.resolve()}function eG(e){return"object"==typeof e&&(e instanceof eq||e instanceof eH)}function eW(e){return"object"==typeof e&&e instanceof eq&&413===e.status}class ez{getErrorPropertiesBuilder(){return this._errorPropertiesBuilder||(this._errorPropertiesBuilder=this.createErrorPropertiesBuilder()),this._errorPropertiesBuilder}createErrorPropertiesBuilder(){return new Z([new eP,new eC,new eB,new e$],ew())}constructor(e,t={}){this.flushPromise=null,this.shutdownPromise=null,this.promiseQueue=new Y,this._events=new J,this._isInitialized=!1;const r="string"==typeof e?e.trim():"",i="string"==typeof t.host?t.host.trim():"",s=!r;this._logger=function(e,t=e=>e()){return X(e,t,function(e=console){return{log:e.log.bind(e),warn:e.warn.bind(e),error:e.error.bind(e),debug:e.debug.bind(e)}}())}("[PostHog]",this.logMsgIfDebug.bind(this)),s&&this._logger.error("You must pass your PostHog project's api key. The client will be disabled."),this.apiKey=r,this.host=function(e){return e?.replace(/\/+$/,"")}(i||"https://us.i.posthog.com"),this.flushAt=t.flushAt?Math.max(t.flushAt,1):20,this.maxBatchSize=Math.max(this.flushAt,t.maxBatchSize??100),this.maxQueueSize=Math.max(this.flushAt,t.maxQueueSize??1e3),this.flushInterval=t.flushInterval??1e4,this.preloadFeatureFlags=t.preloadFeatureFlags??!0,this.defaultOptIn=t.defaultOptIn??!0,this.disableSurveys=t.disableSurveys??!1,this._retryOptions={retryCount:t.fetchRetryCount??3,retryDelay:t.fetchRetryDelay??3e3,retryCheck:eG},this.requestTimeout=t.requestTimeout??1e4,this.featureFlagsRequestTimeoutMs=t.featureFlagsRequestTimeoutMs??3e3,this.remoteConfigRequestTimeoutMs=t.remoteConfigRequestTimeoutMs??3e3,this.disableGeoip=t.disableGeoip??!0,this.disabled=(t.disabled??!1)||s,this.historicalMigration=t?.historicalMigration??!1,this._initPromise=Promise.resolve(),this._isInitialized=!0,this.evaluationContexts=t?.evaluationContexts??t?.evaluationEnvironments,t?.evaluationEnvironments&&!t?.evaluationContexts&&this._logger.warn("evaluationEnvironments is deprecated. Use evaluationContexts instead. This property will be removed in a future version."),this.disableCompression=!("CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob)||(t?.disableCompression??!1)}logMsgIfDebug(e){this.isDebug&&e()}wrap(e){return this.disabled?void this._logger.warn("The client is disabled"):this._isInitialized?e():void this._initPromise.then(()=>e())}getCommonEventProperties(){return{$lib:this.getLibraryId(),$lib_version:this.getLibraryVersion()}}get optedOut(){return this.getPersistedProperty(d.OptedOut)??!this.defaultOptIn}async optIn(){this.wrap(()=>{this.setPersistedProperty(d.OptedOut,!1)})}async optOut(){this.wrap(()=>{this.setPersistedProperty(d.OptedOut,!0)})}on(e,t){return this._events.on(e,t)}debug(e=!0){if(this.removeDebugCallback?.(),e){let e=this.on("*",(e,t)=>this._logger.info(e,t));this.removeDebugCallback=()=>{e(),this.removeDebugCallback=void 0}}}get isDebug(){return!!this.removeDebugCallback}get isDisabled(){return this.disabled}buildPayload(e){return{distinct_id:e.distinct_id,event:e.event,properties:{...e.properties||{},...this.getCommonEventProperties()}}}addPendingPromise(e){return this.promiseQueue.add(e)}identifyStateless(e,t,r){this.wrap(()=>{let i={...this.buildPayload({distinct_id:e,event:"$identify",properties:t})};this.enqueue("identify",i,r)})}async identifyStatelessImmediate(e,t,r){let i={...this.buildPayload({distinct_id:e,event:"$identify",properties:t})};await this.sendImmediate("identify",i,r)}captureStateless(e,t,r,i){this.wrap(()=>{let s=this.buildPayload({distinct_id:e,event:t,properties:r});this.enqueue("capture",s,i)})}async captureStatelessImmediate(e,t,r,i){let s=this.buildPayload({distinct_id:e,event:t,properties:r});await this.sendImmediate("capture",s,i)}aliasStateless(e,t,r,i){this.wrap(()=>{let s=this.buildPayload({event:"$create_alias",distinct_id:t,properties:{...r||{},distinct_id:t,alias:e}});this.enqueue("alias",s,i)})}async aliasStatelessImmediate(e,t,r,i){let s=this.buildPayload({event:"$create_alias",distinct_id:t,properties:{...r||{},distinct_id:t,alias:e}});await this.sendImmediate("alias",s,i)}groupIdentifyStateless(e,t,r,i,s,a){this.wrap(()=>{let n=this.buildPayload({distinct_id:s||`$${e}_${t}`,event:"$groupidentify",properties:{$group_type:e,$group_key:t,$group_set:r||{},...a||{}}});this.enqueue("capture",n,i)})}async getRemoteConfig(){await this._initPromise;let e=this.host;"https://us.i.posthog.com"===e?e="https://us-assets.i.posthog.com":"https://eu.i.posthog.com"===e&&(e="https://eu-assets.i.posthog.com");let t=`${e}/array/${this.apiKey}/config`,r={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}};return this.fetchWithRetry(t,r,{retryCount:0},this.remoteConfigRequestTimeoutMs).then(e=>e.json()).catch(e=>{this._logger.error("Remote config could not be loaded",e),this._events.emit("error",e)})}async getFlags(e,t={},r={},i={},s={},a=!1){await this._initPromise;let n=`${this.host}/flags/?v=2${a?"&config=true":""}`,o={token:this.apiKey,distinct_id:e,groups:t,person_properties:r,group_properties:i,...s};r.$device_id&&(o.$device_id=r.$device_id),this.evaluationContexts&&this.evaluationContexts.length>0&&(o.evaluation_contexts=this.evaluationContexts);let l={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"},body:JSON.stringify(o)};return this._logger.info("Flags URL",n),this.fetchWithRetry(n,l,{retryCount:0},this.featureFlagsRequestTimeoutMs).then(e=>e.json()).then(e=>({success:!0,response:(e=>{if("flags"in e){let t,r=Object.fromEntries(Object.entries(e.flags??{}).map(([e,t])=>[e,u(t)]).filter(([,e])=>void 0!==e)),i=Object.fromEntries(Object.keys(t=e.flags??{}).filter(e=>{let r=t[e];return r.enabled&&r.metadata&&void 0!==r.metadata.payload}).map(e=>{let r=t[e].metadata?.payload;return[e,r?c(r):void 0]}));return{...e,featureFlags:r,featureFlagPayloads:i}}{let t=e.featureFlags??{},r=Object.fromEntries(Object.entries(e.featureFlagPayloads||{}).map(([e,t])=>[e,c(t)])),i=Object.fromEntries(Object.entries(t).map(([e,t])=>{var i,s;return[e,{key:e,enabled:"string"==typeof(i=t)||i,variant:"string"==typeof i?i:void 0,reason:void 0,metadata:{id:void 0,version:void 0,payload:(s=r[e])?JSON.stringify(s):void 0,description:void 0}}]}));return{...e,featureFlags:t,featureFlagPayloads:r,flags:i}}})(e)})).catch(e=>(this._events.emit("error",e),{success:!1,error:this.categorizeRequestError(e)}))}categorizeRequestError(e){if(e instanceof eq)return{type:"api_error",statusCode:e.status};if(e instanceof eH){let t=e.error;return t instanceof Error&&("AbortError"===t.name||"TimeoutError"===t.name)?{type:"timeout"}:{type:"connection_error"}}return{type:"unknown_error"}}async getFeatureFlagStateless(e,t,r={},i={},s={},a){await this._initPromise;let n=await this.getFeatureFlagDetailStateless(e,t,r,i,s,a);if(void 0===n)return{response:void 0,requestId:void 0};let o=u(n.response);return void 0===o&&(o=!1),{response:o,requestId:n.requestId}}async getFeatureFlagDetailStateless(e,t,r={},i={},s={},a){await this._initPromise;let n=await this.getFeatureFlagDetailsStateless(t,r,i,s,a,[e]);if(void 0!==n)return{response:n.flags[e],requestId:n.requestId,evaluatedAt:n.evaluatedAt}}async getFeatureFlagPayloadStateless(e,t,r={},i={},s={},a){await this._initPromise;let n=await this.getFeatureFlagPayloadsStateless(t,r,i,s,a,[e]);if(!n)return;let o=n[e];return void 0===o?null:o}async getFeatureFlagPayloadsStateless(e,t={},r={},i={},s,a){return await this._initPromise,(await this.getFeatureFlagsAndPayloadsStateless(e,t,r,i,s,a)).payloads}async getFeatureFlagsStateless(e,t={},r={},i={},s,a){return await this._initPromise,await this.getFeatureFlagsAndPayloadsStateless(e,t,r,i,s,a)}async getFeatureFlagsAndPayloadsStateless(e,t={},r={},i={},s,a){await this._initPromise;let n=await this.getFeatureFlagDetailsStateless(e,t,r,i,s,a);return n?{flags:n.featureFlags,payloads:n.featureFlagPayloads,requestId:n.requestId}:{flags:void 0,payloads:void 0,requestId:void 0}}async getFeatureFlagDetailsStateless(e,t={},r={},i={},s,a){await this._initPromise;let n={};(s??this.disableGeoip)&&(n.geoip_disable=!0),a&&(n.flag_keys_to_evaluate=a);let o=await this.getFlags(e,t,r,i,n);if(!o.success)return;let l=o.response;return(l.errorsWhileComputingFlags&&console.error("[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices"),l.quotaLimited?.includes("feature_flags"))?(console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),{flags:{},featureFlags:{},featureFlagPayloads:{},requestId:l?.requestId,quotaLimited:l.quotaLimited}):l}async getSurveysStateless(){if(await this._initPromise,this.disabled)return[];if(!0===this.disableSurveys)return this._logger.info("Loading surveys is disabled."),[];let e=`${this.host}/api/surveys/?token=${this.apiKey}`,t={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json"}},r=await this.fetchWithRetry(e,t).then(e=>{if(200!==e.status||!e.json){let t=`Surveys API could not be loaded: ${e.status}`,r=Error(t);this._logger.error(r),this._events.emit("error",Error(t));return}return e.json()}).catch(e=>{this._logger.error("Surveys API could not be loaded",e),this._events.emit("error",e)}),i=r?.surveys;return i&&this._logger.info("Surveys fetched from API: ",JSON.stringify(i)),i??[]}get props(){return this._props||(this._props=this.getPersistedProperty(d.Props)),this._props||{}}set props(e){this._props=e}async register(e){this.wrap(()=>{this.props={...this.props,...e},this.setPersistedProperty(d.Props,this.props)})}async unregister(e){this.wrap(()=>{delete this.props[e],this.setPersistedProperty(d.Props,this.props)})}processBeforeEnqueue(e){return e}async flushStorage(){}enqueue(e,t,r){this.wrap(()=>{if(this.optedOut)return void this._events.emit(e,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let i=this.prepareMessage(e,t,r);if(null===(i=this.processBeforeEnqueue(i)))return;let s=this.getPersistedProperty(d.Queue)||[];s.length>=this.maxQueueSize&&(s.shift(),this._logger.info("Queue is full, the oldest event is dropped.")),s.push({message:i}),this.setPersistedProperty(d.Queue,s),this._events.emit(e,i),s.length>=this.flushAt&&this.flushBackground(),this.flushInterval&&!this._flushTimer&&(this._flushTimer=L(()=>this.flushBackground(),this.flushInterval))})}async sendImmediate(e,t,r){if(this.disabled)return void this._logger.warn("The client is disabled");if(this._isInitialized||await this._initPromise,this.optedOut)return void this._events.emit(e,"Library is disabled. Not sending event. To re-enable, call posthog.optIn()");let i=this.prepareMessage(e,t,r);if(null===(i=this.processBeforeEnqueue(i)))return;let s={api_key:this.apiKey,batch:[i],sent_at:R()};this.historicalMigration&&(s.historical_migration=!0);let a=JSON.stringify(s),n=`${this.host}/batch/`,o=this.disableCompression?null:await f(a,this.isDebug),l={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...null!==o&&{"Content-Encoding":"gzip"}},body:o||a};try{let e=await this.fetchWithRetry(n,l);await e.body?.cancel()?.catch(()=>{})}catch(e){this._events.emit("error",e)}}prepareMessage(e,t,r){let i={...t,type:e,library:this.getLibraryId(),library_version:this.getLibraryVersion(),timestamp:r?.timestamp?r?.timestamp:R(),uuid:r?.uuid?r.uuid:H()};return(r?.disableGeoip??this.disableGeoip)&&(i.properties||(i.properties={}),i.properties.$geoip_disable=!0),i.distinctId&&(i.distinct_id=i.distinctId,delete i.distinctId),i}clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}flushBackground(){this.flush().catch(async e=>{await eN(e)})}async flush(){if(this.disabled)return;let e=M([this.flushPromise]).then(()=>this._flush());return this.flushPromise=e,this.addPendingPromise(e),M([e]).then(()=>{this.flushPromise===e&&(this.flushPromise=null)}),e}getCustomHeaders(){let e=this.getCustomUserAgent(),t={};return e&&""!==e&&(t["User-Agent"]=e),t}async _flush(){this.clearFlushTimer(),await this._initPromise;let e=this.getPersistedProperty(d.Queue)||[];if(!e.length)return;let t=[],r=e.length;for(;e.length>0&&t.length<r;){let r=e.slice(0,this.maxBatchSize),i=r.map(e=>e.message),s=async()=>{let t=(this.getPersistedProperty(d.Queue)||[]).slice(r.length);this.setPersistedProperty(d.Queue,t),e=t,await this.flushStorage()},a={api_key:this.apiKey,batch:i,sent_at:R()};this.historicalMigration&&(a.historical_migration=!0);let n=JSON.stringify(a),o=`${this.host}/batch/`,l=this.disableCompression?null:await f(n,this.isDebug),u={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...null!==l&&{"Content-Encoding":"gzip"}},body:l||n},c={retryCheck:e=>!eW(e)&&eG(e)};try{let e=await this.fetchWithRetry(o,u,c);await e.body?.cancel()?.catch(()=>{})}catch(e){if(eW(e)&&i.length>1){this.maxBatchSize=Math.max(1,Math.floor(i.length/2)),this._logger.warn(`Received 413 when sending batch of size ${i.length}, reducing batch size to ${this.maxBatchSize}`);continue}throw e instanceof eH||await s(),this._events.emit("error",e),e}await s(),t.push(...i)}this._events.emit("flush",t)}async _sendLogsBatch(e){if(this.disabled)return{kind:"fatal",error:Error("The client is disabled")};let t=JSON.stringify(e),r=`${this.host}/i/v1/logs?token=${encodeURIComponent(this.apiKey)}`,i=this.disableCompression?null:await f(t,this.isDebug),s={method:"POST",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",...null!==i&&{"Content-Encoding":"gzip"}},body:i||t};try{return await this.fetchWithRetry(r,s,{retryCheck:e=>!eW(e)&&eG(e)}),{kind:"ok"}}catch(e){if(eW(e))return{kind:"too-large"};if(e instanceof eH)return{kind:"retry-later",error:e};return{kind:"fatal",error:e}}}async fetchWithRetry(e,t,r,i){let s=t.body?t.body:"",a=-1;try{a=s instanceof Blob?s.size:Buffer.byteLength(s,"utf8")}catch{a=s instanceof Blob?s.size:new TextEncoder().encode(s).length}return await T(async()=>{let r=new AbortController,s=L(()=>r.abort(),i??this.requestTimeout),n=null;try{n=await this.fetch(e,{signal:r.signal,...t})}catch(e){throw new eH(e)}finally{clearTimeout(s)}if("no-cors"!==t.mode&&(n.status<200||n.status>=400))throw new eq(n,a);return n},{...this._retryOptions,...r})}async _shutdown(e=3e4){let t;await this._initPromise;let r=!1;if(this.clearFlushTimer(),this.disabled)return;let i=async()=>{try{for(await this.promiseQueue.join();;){let e=this.getPersistedProperty(d.Queue)||[];if(0===e.length||(await this.flush(),r))break}}catch(e){if(!eG(e))throw e;await eN(e)}};try{return await Promise.race([new Promise((i,s)=>{t=L(()=>{this._logger.error("Timed out while shutting down PostHog"),r=!0,s("Timeout while shutting down PostHog. Some events may not have been sent.")},e)}),i()])}finally{clearTimeout(t)}}async shutdown(e=3e4){return this.shutdownPromise?this._logger.warn("shutdown() called while already shutting down. shutdown() is meant to be called once before process exit - use flush() for per-request cleanup"):this.shutdownPromise=this._shutdown(e).finally(()=>{this.shutdownPromise=null}),this.shutdownPromise}}e.i(21754),e.i(69309),e.i(10728),e.s(["chromeStackLineParser",0,ea,"createDefaultStackParser",0,ew,"createStackParser",0,eE,"geckoStackLineParser",0,el,"nodeStackLineParser",0,em,"opera10StackLineParser",0,eh,"opera11StackLineParser",0,ep,"reverseAndStripFrames",0,eb,"winjsStackLineParser",0,ec],22546),e.i(22546),e.i(59567),e.i(33603),e.i(13446),e.i(60887),e.i(22175),e.i(12154),e.i(41324),e.i(79478),e.i(1802),e.s(["DOMExceptionCoercer",0,eF,"ErrorCoercer",0,eP,"ErrorEventCoercer",0,ex,"EventCoercer",0,ek,"ObjectCoercer",0,eC,"PrimitiveCoercer",0,e$,"PromiseRejectionEventCoercer",0,eA,"StringCoercer",0,eB],90166),e.i(90166);class eK{constructor(e){this._maxSize=e,this._cache=new Map}get(e){let t=this._cache.get(e);if(void 0!==t)return this._cache.delete(e),this._cache.set(e,t),t}set(e,t){this._cache.set(e,t)}reduce(){for(;this._cache.size>=this._maxSize;){let e=this._cache.keys().next().value;e&&this._cache.delete(e)}}}e.s(["ReduceableCache",0,eK],45294),e.i(45294),e.i(45162),e.s(["DEFAULT_EXCEPTION_STEPS_CONFIG",0,eR,"DOMExceptionCoercer",0,eF,"EXCEPTION_STEP_INTERNAL_FIELDS",0,eO,"ErrorCoercer",0,eP,"ErrorEventCoercer",0,ex,"ErrorPropertiesBuilder",0,Z,"EventCoercer",0,ek,"ExceptionStepsBuffer",0,eM,"ObjectCoercer",0,eC,"PrimitiveCoercer",0,e$,"PromiseRejectionEventCoercer",0,eA,"ReduceableCache",0,eK,"StringCoercer",0,eB,"chromeStackLineParser",0,ea,"createDefaultStackParser",0,ew,"createStackParser",0,eE,"geckoStackLineParser",0,el,"getUtf8ByteLength",0,eD,"nodeStackLineParser",0,em,"opera10StackLineParser",0,eh,"opera11StackLineParser",0,ep,"resolveExceptionStepsConfig",0,eL,"reverseAndStripFrames",0,eb,"stripReservedExceptionStepFields",0,ej,"winjsStackLineParser",0,ec],11168);var eV=e.i(11168),eQ=eV,eJ=e.i(2157),eY=e.i(1457);let eX=new eQ.ReduceableCache(25),eZ=new eQ.ReduceableCache(20);async function e0(e){let t={};for(let s=e.length-1;s>=0;s--){var r,i;let a=e[s],n=a?.filename;!(!a||"string"!=typeof n||"number"!=typeof a.lineno||(r=n).startsWith("node:")||r.endsWith(".min.js")||r.endsWith(".min.cjs")||r.endsWith(".min.mjs")||r.startsWith("data:")||void 0!==(i=a).lineno&&i.lineno>1e4||void 0!==i.colno&&i.colno>1e3)&&(t[n]||(t[n]=[]),t[n].push(a.lineno))}let s=Object.keys(t);if(0==s.length)return e;let a=[];for(let e of s){if(eZ.get(e))continue;let r=t[e];if(!r)continue;r.sort((e,t)=>e-t);let i=function(e){if(!e.length)return[];let t=0,r=e[0];if("number"!=typeof r)return[];let i=e2(r),s=[];for(;;){if(t===e.length-1){s.push(i);break}let r=e[t+1];if("number"!=typeof r)break;r<=i[1]?i[1]=r+7:(s.push(i),i=e2(r)),t++}return s}(r);if(i.every(t=>(function(e,t){let r=eX.get(e);if(void 0===r)return!1;for(let e=t[0];e<=t[1];e++)if(void 0===r[e])return!1;return!0})(e,t)))continue;let s=function(e,t,r){let i=e.get(t);return void 0===i?(e.set(t,r),r):i}(eX,e,{});a.push(function(e,t,r){return new Promise(i=>{let s=(0,eJ.createReadStream)(e),a=(0,eY.createInterface)({input:s});function n(){s.destroy(),i()}let o=0,l=0,u=t[0];if(void 0===u)return void n();let c=u[0],d=u[1];function h(){eZ.set(e,1),a.close(),a.removeAllListeners(),n()}s.on("error",h),a.on("error",h),a.on("close",n),a.on("line",e=>{if(!(++o<c)&&(r[o]=function(e,t){let r=e,i=r.length;if(i<=150)return r;t>i&&(t=i);let s=Math.max(t-60,0);s<5&&(s=0);let a=Math.min(s+140,i);return a>i-5&&(a=i),a===i&&(s=Math.max(a-140,0)),r=r.slice(s,a),s>0&&(r=`...${r}`),a<i&&(r+="..."),r}(e,0),o>=d)){if(l===t.length-1){a.close(),a.removeAllListeners();return}let e=t[++l];if(void 0===e){a.close(),a.removeAllListeners();return}c=e[0],d=e[1]}})})}(e,i,s))}return await Promise.all(a).catch(()=>{}),e&&e.length>0&&function(e,t){for(let r of e)if(r.filename&&void 0===r.context_line&&"number"==typeof r.lineno){let e=t.get(r.filename);if(void 0===e)continue;!function(e,t,r){if(void 0===t.lineno||void 0===r)return;t.pre_context=[];for(let i=e4(e);i<e;i++){let e=r[i];if(void 0===e)return void e1(t);t.pre_context.push(e)}if(void 0===r[e])return e1(t);t.context_line=r[e];let i=function(e){return e+7}(e);t.post_context=[];for(let s=e+1;s<=i;s++){let e=r[s];if(void 0===e)break;t.post_context.push(e)}}(r.lineno,r,e)}}(e,eX),eX.reduce(),e}function e1(e){delete e.pre_context,delete e.context_line,delete e.post_context}function e2(e){return[e4(e),e+7]}function e4(e){return Math.max(1,e-7)}let e3=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],e5=function(e,t=[]){if(!e)return!1;let r=e.toLowerCase();return e3.concat(t).some(e=>{let t=e.toLowerCase();return -1!==r.indexOf(t)})},e6={ERRORS_WHILE_COMPUTING:"errors_while_computing_flags",FLAG_MISSING:"flag_missing",QUOTA_LIMITED:"quota_limited",UNKNOWN_ERROR:"unknown_error"};e.s(["FeatureFlagError",0,e6],88096);class e8{constructor(e){this._host=e.host,this._distinctId=e.distinctId,this._groups=e.groups,this._disableGeoip=e.disableGeoip,this._flags=e.flags,this._requestId=e.requestId,this._evaluatedAt=e.evaluatedAt,this._flagDefinitionsLoadedAt=e.flagDefinitionsLoadedAt,this._errorsWhileComputing=e.errorsWhileComputing??!1,this._quotaLimited=e.quotaLimited??!1,this._accessed=e.accessed??new Set,this._isSlice=e.isSlice??!1}isEnabled(e){let t=this._flags[e];return this._recordAccess(e),t?.enabled??!1}getFlag(e){let t=this._flags[e];if(this._recordAccess(e),t)return!!t.enabled&&(t.variant??!0)}getFlagPayload(e){return this._flags[e]?.payload}onlyAccessed(){let e={};for(let t of this._accessed){let r=this._flags[t];r&&(e[t]=r)}return this._cloneWith(e)}only(e){let t={},r=[];for(let i of e){let e=this._flags[i];e?t[i]=e:r.push(i)}return r.length>0&&this._host.logWarning(`FeatureFlagEvaluations.only() was called with flag keys that are not in the evaluation set and will be dropped: ${r.join(", ")}`),this._cloneWith(t)}get keys(){return Object.keys(this._flags)}_getEventProperties(){let e={},t=[];for(let[r,i]of Object.entries(this._flags)){let s=!1!==i.enabled&&(i.variant??!0);e[`$feature/${r}`]=s,i.enabled&&t.push(r)}return t.length>0&&(t.sort(),e.$active_feature_flags=t),e}_cloneWith(e){return new e8({host:this._host,distinctId:this._distinctId,groups:this._groups,disableGeoip:this._disableGeoip,flags:e,requestId:this._requestId,evaluatedAt:this._evaluatedAt,flagDefinitionsLoadedAt:this._flagDefinitionsLoadedAt,errorsWhileComputing:this._errorsWhileComputing,quotaLimited:this._quotaLimited,accessed:new Set(this._accessed),isSlice:!0})}_recordAccess(e){if(this._accessed.add(e),""===this._distinctId||this._isSlice&&!(e in this._flags))return;let t=this._flags[e],r=void 0===t?void 0:!1!==t.enabled&&(t.variant??!0),i={$feature_flag:e,$feature_flag_response:r,$feature_flag_id:t?.id,$feature_flag_version:t?.version,$feature_flag_reason:t?.reason,locally_evaluated:t?.locallyEvaluated??!1,[`$feature/${e}`]:r,$feature_flag_request_id:this._requestId,$feature_flag_evaluated_at:t?.locallyEvaluated?Date.now():this._evaluatedAt};t?.locallyEvaluated&&void 0!==this._flagDefinitionsLoadedAt&&(i.$feature_flag_definitions_loaded_at=this._flagDefinitionsLoadedAt);let s=[];this._errorsWhileComputing&&s.push(e6.ERRORS_WHILE_COMPUTING),this._quotaLimited&&s.push(e6.QUOTA_LIMITED),void 0===t&&s.push(e6.FLAG_MISSING),s.length>0&&(i.$feature_flag_error=s.join(",")),this._host.captureFlagCalledEventIfNeeded({distinctId:this._distinctId,key:e,response:r,groups:this._groups,disableGeoip:this._disableGeoip,properties:i})}}async function e9(e){let t=globalThis.crypto?.subtle;if(!t)throw Error("SubtleCrypto API not available");return Array.from(new Uint8Array(await t.digest("SHA-1",new TextEncoder().encode(e)))).map(e=>e.toString(16).padStart(2,"0")).join("")}let e7=["is_not","is_set"];class te extends Error{constructor(e){super(),Error.captureStackTrace(this,this.constructor),this.name="ClientError",this.message=e,Object.setPrototypeOf(this,te.prototype)}}class tt extends Error{constructor(e){super(e),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,tt.prototype)}}class tr extends Error{constructor(e){super(e),this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),Object.setPrototypeOf(this,tr.prototype)}}class ti{constructor({pollingInterval:e,personalApiKey:t,projectApiKey:r,timeout:i,host:s,customHeaders:a,...n}){this.debugMode=!1,this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.pollingInterval=e,this.personalApiKey=t,this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={},this.loadedSuccessfullyOnce=!1,this.timeout=i,this.projectApiKey=r,this.host=s,this.poller=void 0,this.fetch=n.fetch||fetch,this.onError=n.onError,this.customHeaders=a,this.onLoad=n.onLoad,this.cacheProvider=n.cacheProvider,this.strictLocalEvaluation=n.strictLocalEvaluation??!1,this.loadFeatureFlags()}debug(e=!0){this.debugMode=e}logMsgIfDebug(e){this.debugMode&&e()}createEvaluationContext(e,t={},r={},i={},s={}){return{distinctId:e,groups:t,personProperties:r,groupProperties:i,evaluationCache:s}}async getFeatureFlag(e,t,r={},i={},s={}){let a,n;if(await this.loadFeatureFlags(),!this.loadedSuccessfullyOnce)return a;if(void 0!==(n=this.featureFlagsByKey[e])){let o=this.createEvaluationContext(t,r,i,s);try{a=(await this.computeFlagAndPayloadLocally(n,o)).value,this.logMsgIfDebug(()=>console.debug(`Successfully computed flag locally: ${e} -> ${a}`))}catch(t){t instanceof tr||t instanceof tt?this.logMsgIfDebug(()=>console.debug(`${t.name} when computing flag locally: ${e}: ${t.message}`)):t instanceof Error&&this.onError?.(Error(`Error computing flag locally: ${e}: ${t}`))}}return a}async getAllFlagsAndPayloads(e,t){await this.loadFeatureFlags();let r={},i={},s=0==this.featureFlags.length,a=t?t.map(e=>this.featureFlagsByKey[e]).filter(Boolean):this.featureFlags,n={...e,evaluationCache:e.evaluationCache??{}};return await Promise.all(a.map(async e=>{try{let{value:t,payload:s}=await this.computeFlagAndPayloadLocally(e,n);r[e.key]=t,s&&(i[e.key]=s)}catch(t){t instanceof tr||t instanceof tt?this.logMsgIfDebug(()=>console.debug(`${t.name} when computing flag locally: ${e.key}: ${t.message}`)):t instanceof Error&&this.onError?.(Error(`Error computing flag locally: ${e.key}: ${t}`)),s=!0}})),{response:r,payloads:i,fallbackToFlags:s}}async computeFlagAndPayloadLocally(e,t,r={}){let i,{matchValue:s,skipLoadCheck:a=!1}=r;if(a||await this.loadFeatureFlags(),!this.loadedSuccessfullyOnce)return{value:!1,payload:null};i=void 0!==s?s:await this.computeFlagValueLocally(e,t);let n=this.getFeatureFlagPayload(e.key,i);return{value:i,payload:n}}async computeFlagValueLocally(e,t){let{distinctId:r,groups:i,personProperties:s,groupProperties:a}=t;if(!e.active)return!1;if(e.ensure_experience_continuity)throw new tt("Flag has experience continuity enabled");let n=(e.filters||{}).aggregation_group_type_index;if(void 0!=n){let r=this.groupTypeMapping[String(n)];if(!r)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Unknown group type index ${n} for feature flag ${e.key}`)),new tt("Flag has unknown group type index");if(!(r in i))return this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute group feature flag: ${e.key} without group names passed in`)),!1;"device_id"===e.bucketing_identifier&&(s?.$device_id===void 0||s?.$device_id===null||s?.$device_id==="")&&this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Ignoring bucketing_identifier for group flag: ${e.key}`));let o=a[r];return await this.matchFeatureFlagProperties(e,i[r],o,t)}{let i=this.getBucketingValueForFlag(e,r,s);if(void 0===i)throw this.logMsgIfDebug(()=>console.warn(`[FEATURE FLAGS] Can't compute feature flag: ${e.key} without $device_id, falling back to server evaluation`)),new tt(`Can't compute feature flag: ${e.key} without $device_id`);return await this.matchFeatureFlagProperties(e,i,s,t)}}getBucketingValueForFlag(e,t,r){if(e.filters?.aggregation_group_type_index!=void 0)return t;if("device_id"===e.bucketing_identifier){let e=r?.$device_id;if(null==e||""===e)return;return e}return t}getFeatureFlagPayload(e,t){let r=null;if(!1!==t&&null!=t&&("boolean"==typeof t?r=this.featureFlagsByKey?.[e]?.filters?.payloads?.[t.toString()]||null:"string"==typeof t&&(r=this.featureFlagsByKey?.[e]?.filters?.payloads?.[t]||null),null!=r)){if("object"==typeof r)return r;if("string"==typeof r)try{return JSON.parse(r)}catch{}return r}return null}async evaluateFlagDependency(e,t,r){let{evaluationCache:i}=r,s=e.key;if(!this.featureFlagsByKey)throw new tt("Feature flags not available for dependency evaluation");if(!("dependency_chain"in e))throw new tt(`Flag dependency property for '${s}' is missing required 'dependency_chain' field`);let a=e.dependency_chain;if(!Array.isArray(a))throw new tt(`Flag dependency property for '${s}' has an invalid 'dependency_chain' (expected array, got ${typeof a})`);if(0===a.length)throw new tt(`Circular dependency detected for flag '${s}' (empty dependency chain)`);for(let e of a){if(!(e in i)){let t=this.featureFlagsByKey[e];if(t)if(t.active)try{let s=await this.computeFlagValueLocally(t,r);i[e]=s}catch(t){throw new tt(`Error evaluating flag dependency '${e}' for flag '${s}': ${t}`)}else i[e]=!1;else throw new tt(`Missing flag dependency '${e}' for flag '${s}'`)}if(null==i[e])throw new tt(`Dependency '${e}' could not be evaluated`)}let n=i[s];return this.flagEvaluatesToExpectedValue(e.value,n)}flagEvaluatesToExpectedValue(e,t){return"boolean"==typeof e?e===t||"string"==typeof t&&""!==t&&!0===e:"string"==typeof e&&t===e}async matchFeatureFlagProperties(e,t,r,i){let s,a=e.filters||{},n=a.groups||[],o=a.aggregation_group_type_index,{groups:l,groupProperties:u}=i,c=!1;for(let d of n)try{let n=void 0!==d.aggregation_group_type_index?d.aggregation_group_type_index:o,h=r,g=t;if(n!==o&&null!=n){let t=this.groupTypeMapping[String(n)];if(!t||!(t in l)){this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Skipping group condition for flag '${e.key}': group type index ${n} not available`));continue}if(!(t in u)){c=!0;continue}h=u[t],g=l[t]}if(await this.isConditionMatch(e,g,d,h,i)){let t=d.variant,r=a.multivariate?.variants||[];s=t&&r.some(e=>e.key===t)?t:await this.getMatchingVariant(e,g)||!0;break}}catch(e){if(e instanceof tr)throw e;if(e instanceof tt)c=!0;else throw e}if(void 0!==s)return s;if(c)throw new tt("Can't determine if feature flag is enabled or not with given properties");return!1}async isConditionMatch(e,t,r,i,s){let a=r.rollout_percentage,n=e=>{this.logMsgIfDebug(()=>console.warn(e))};if((r.properties||[]).length>0){for(let e of r.properties){let t=e.type;if(!("cohort"===t?await tn(e,i,this.cohorts,this.debugMode,e=>this.evaluateFlagDependency(e,i,s)):"flag"===t?await this.evaluateFlagDependency(e,i,s):ta(e,i,n)))return!1}if(void 0==a)return!0}return!(void 0!=a&&await ts(e.key,t)>a/100)}async getMatchingVariant(e,t){let r=await ts(e.key,t,"variant"),i=this.variantLookupTable(e).find(e=>r>=e.valueMin&&r<e.valueMax);if(i)return i.key}variantLookupTable(e){let t=[],r=0,i=0,s=e.filters||{};return(s.multivariate?.variants||[]).forEach(e=>{i=r+e.rollout_percentage/100,t.push({valueMin:r,valueMax:i,key:e.key}),r=i}),t}updateFlagState(e){this.featureFlags=e.flags,this.featureFlagsByKey=e.flags.reduce((e,t)=>(e[t.key]=t,e),{}),this.groupTypeMapping=e.groupTypeMapping,this.cohorts=e.cohorts,this.loadedSuccessfullyOnce=!0}warnAboutExperienceContinuityFlags(e){if(this.strictLocalEvaluation)return;let t=e.filter(e=>e.ensure_experience_continuity);t.length>0&&console.warn(`[PostHog] You are using local evaluation but ${t.length} flag(s) have experience continuity enabled: ${t.map(e=>e.key).join(", ")}. Experience continuity is incompatible with local evaluation and will cause a server request on every flag evaluation, negating local evaluation cost savings. To avoid server requests and unexpected costs, either disable experience continuity on these flags in PostHog, use strictLocalEvaluation: true in client init, or pass onlyEvaluateLocally: true per flag call (flags that cannot be evaluated locally will return undefined).`)}async loadFromCache(e){if(!this.cacheProvider)return!1;try{let t=await this.cacheProvider.getFlagDefinitions();if(t)return this.updateFlagState(t),this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] ${e} (${t.flags.length} flags)`)),this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(t.flags),!0;return!1}catch(e){return this.onError?.(Error(`Failed to load from cache: ${e}`)),!1}}async loadFeatureFlags(e=!1){if(!this.loadedSuccessfullyOnce||e)return!e&&this.nextFetchAllowedAt&&Date.now()<this.nextFetchAllowedAt?void this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Skipping fetch, in backoff period")):(this.loadingPromise||(this.loadingPromise=this._loadFeatureFlags().catch(e=>this.logMsgIfDebug(()=>console.debug(`[FEATURE FLAGS] Failed to load feature flags: ${e}`))).finally(()=>{this.loadingPromise=void 0})),this.loadingPromise)}isLocalEvaluationReady(){return(this.loadedSuccessfullyOnce??!1)&&(this.featureFlags?.length??0)>0}getFlagDefinitionsLoadedAt(){return this.flagDefinitionsLoadedAt}getPollingInterval(){return this.shouldBeginExponentialBackoff?Math.min(6e4,this.pollingInterval*2**this.backOffCount):this.pollingInterval}beginBackoff(){this.shouldBeginExponentialBackoff=!0,this.backOffCount+=1,this.nextFetchAllowedAt=Date.now()+this.getPollingInterval()}clearBackoff(){this.shouldBeginExponentialBackoff=!1,this.backOffCount=0,this.nextFetchAllowedAt=void 0}async _loadFeatureFlags(){this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.poller=setTimeout(()=>this.loadFeatureFlags(!0),this.getPollingInterval());try{let e=!0;if(this.cacheProvider)try{e=await this.cacheProvider.shouldFetchFlagDefinitions()}catch(e){this.onError?.(Error(`Error in shouldFetchFlagDefinitions: ${e}`))}if(!e&&(await this.loadFromCache("Loaded flags from cache (skipped fetch)")||this.loadedSuccessfullyOnce))return;let t=await this._requestFeatureFlagDefinitions();if(!t)return;switch(t.status){case 304:this.logMsgIfDebug(()=>console.debug("[FEATURE FLAGS] Flags not modified (304), using cached data")),this.flagsEtag=t.headers?.get("ETag")??this.flagsEtag,this.loadedSuccessfullyOnce=!0,this.clearBackoff();return;case 401:throw this.beginBackoff(),new te(`Your project key or personal API key is invalid. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 402:console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - unsetting all local flags. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts"),this.featureFlags=[],this.featureFlagsByKey={},this.groupTypeMapping={},this.cohorts={};return;case 403:throw this.beginBackoff(),new te(`Your personal API key does not have permission to fetch feature flag definitions for local evaluation. Setting next polling interval to ${this.getPollingInterval()}ms. Are you sure you're using the correct personal and Project API key pair? More information: https://posthog.com/docs/api/overview`);case 429:throw this.beginBackoff(),new te(`You are being rate limited. Setting next polling interval to ${this.getPollingInterval()}ms. More information: https://posthog.com/docs/api#rate-limiting`);case 200:{let r=await t.json()??{};if(!("flags"in r))return void this.onError?.(Error(`Invalid response when getting feature flags: ${JSON.stringify(r)}`));this.flagsEtag=t.headers?.get("ETag")??void 0;let i={flags:r.flags??[],groupTypeMapping:r.group_type_mapping||{},cohorts:r.cohorts||{}};if(this.updateFlagState(i),this.flagDefinitionsLoadedAt=Date.now(),this.clearBackoff(),this.cacheProvider&&e)try{await this.cacheProvider.onFlagDefinitionsReceived(i)}catch(e){this.onError?.(Error(`Failed to store in cache: ${e}`))}this.onLoad?.(this.featureFlags.length),this.warnAboutExperienceContinuityFlags(i.flags);break}default:return}}catch(e){e instanceof te&&this.onError?.(e)}}getPersonalApiKeyRequestOptions(e="GET",t){let r={...this.customHeaders,"Content-Type":"application/json",Authorization:`Bearer ${this.personalApiKey}`};return t&&(r["If-None-Match"]=t),{method:e,headers:r}}_requestFeatureFlagDefinitions(){let e=`${this.host}/flags/definitions?token=${this.projectApiKey}&send_cohorts`,t=this.getPersonalApiKeyRequestOptions("GET",this.flagsEtag),r=null;if(this.timeout&&"number"==typeof this.timeout){let e=new AbortController;r=L(()=>{e.abort()},this.timeout),t.signal=e.signal}try{return(0,this.fetch)(e,t)}finally{clearTimeout(r)}}async stopPoller(e=3e4){if(clearTimeout(this.poller),this.cacheProvider)try{let t=this.cacheProvider.shutdown();t instanceof Promise&&await Promise.race([t,new Promise((t,r)=>setTimeout(()=>r(Error(`Cache shutdown timeout after ${e}ms`)),e))])}catch(e){this.onError?.(Error(`Error during cache shutdown: ${e}`))}}}async function ts(e,t,r=""){return parseInt((await e9(`${e}.${t}${r}`)).slice(0,15),16)/0x1000000000000000}function ta(e,t,r){let i=e.key,s=e.value,a=e.operator||"exact";if(i in t){if("is_not_set"===a)return!1}else{if("is_not_set"===a)return!0;throw new tt(`Property ${i} not found in propertyValues`)}let n=t[i];if(null==n&&!e7.includes(a))return r&&r(`Property ${i} cannot have a value of null/undefined with the ${a} operator`),!1;function o(e,t){return Array.isArray(e)?e.map(e=>String(e).toLowerCase()).includes(String(t).toLowerCase()):String(e).toLowerCase()===String(t).toLowerCase()}function l(e,t,r){if("gt"===r)return e>t;if("gte"===r)return e>=t;if("lt"===r)return e<t;if("lte"===r)return e<=t;throw Error(`Invalid operator: ${r}`)}switch(a){case"exact":return o(s,n);case"is_not":return!o(s,n);case"is_set":return i in t;case"icontains":return String(n).toLowerCase().includes(String(s).toLowerCase());case"not_icontains":return!String(n).toLowerCase().includes(String(s).toLowerCase());case"regex":return tl(String(s))&&null!==String(n).match(String(s));case"not_regex":return tl(String(s))&&null===String(n).match(String(s));case"gt":case"gte":case"lt":case"lte":{let e,t="number"==typeof s?s:parseFloat(String(s));if(e="number"==typeof n?n:null!=n?parseFloat(String(n)):NaN,Number.isFinite(t)&&Number.isFinite(e))return l(e,t,a);return l(String(n),String(s),a)}case"is_date_after":case"is_date_before":{if("boolean"==typeof s)throw new tt("Date operations cannot be performed on boolean values");let e=function(e){let t=e.match(/^-?(?<number>[0-9]+)(?<interval>[a-z])$/),r=new Date(new Date().toISOString());if(!t)return null;{if(!t.groups)return null;let e=parseInt(t.groups.number);if(e>=1e4)return null;let i=t.groups.interval;if("h"==i)r.setUTCHours(r.getUTCHours()-e);else if("d"==i)r.setUTCDate(r.getUTCDate()-e);else if("w"==i)r.setUTCDate(r.getUTCDate()-7*e);else if("m"==i)r.setUTCMonth(r.getUTCMonth()-e);else{if("y"!=i)return null;r.setUTCFullYear(r.getUTCFullYear()-e)}return r}}(String(s));if(null==e&&(e=th(s)),null==e)throw new tt(`Invalid date: ${s}`);let t=th(n);if(["is_date_before"].includes(a))return t<e;return t>e}case"semver_eq":return 0===td(tc(String(n)),tc(String(s)));case"semver_neq":return 0!==td(tc(String(n)),tc(String(s)));case"semver_gt":return td(tc(String(n)),tc(String(s)))>0;case"semver_gte":return td(tc(String(n)),tc(String(s)))>=0;case"semver_lt":return 0>td(tc(String(n)),tc(String(s)));case"semver_lte":return 0>=td(tc(String(n)),tc(String(s)));case"semver_tilde":{let e,t=tc(String(n)),{lower:r,upper:i}={lower:[(e=tc(String(s)))[0],e[1],e[2]],upper:[e[0],e[1]+1,0]};return td(t,r)>=0&&0>td(t,i)}case"semver_caret":{let e=tc(String(n)),{lower:t,upper:r}=function(e){let[t,r,i]=tc(e);return{lower:[t,r,i],upper:t>0?[t+1,0,0]:r>0?[0,r+1,0]:[0,0,i+1]}}(String(s));return td(e,t)>=0&&0>td(e,r)}case"semver_wildcard":{let e=tc(String(n)),{lower:t,upper:r}=function(e){let t,r,i=String(e).trim().replace(/^[vV]/,"").replace(/\.\*$/,"").replace(/\*$/,"");if(!i)throw new tt(`Invalid wildcard semver: ${e}`);let s=i.split("."),a=t=>{try{return tu(t,e)}catch{throw new tt(`Invalid wildcard semver: ${e}`)}},n=a(s[0]);if(1===s.length)t=[n,0,0],r=[n+1,0,0];else{let e=a(s[1]);t=[n,e,0],r=[n,e+1,0]}return{lower:t,upper:r}}(String(s));return td(e,t)>=0&&0>td(e,r)}default:throw new tt(`Unknown operator: ${a}`)}}async function tn(e,t,r,i=!1,s){let a=String(e.value);if(!(a in r))throw new tr(`cohort ${a} not found in local cohorts - likely a static cohort that requires server evaluation`);return to(r[a],t,r,i,s)}async function to(e,t,r,i=!1,s){if(!e)return!0;let a=e.type,n=e.values;if(!n||0===n.length)return!0;let o=!1;if("values"in n[0]){for(let e of n)try{let n=await to(e,t,r,i,s);if("AND"===a){if(!n)return!1}else if(n)return!0}catch(t){if(t instanceof tr)throw t;if(t instanceof tt)i&&console.debug(`Failed to compute property ${e} locally: ${t}`),o=!0;else throw t}if(o)throw new tt("Can't match cohort without a given cohort property value");return"AND"===a}for(let e of n)try{let n;if("cohort"===e.type)n=await tn(e,t,r,i,s);else if("flag"===e.type){if(!s)throw new tt(`Flag dependency '${e.key||"unknown"}' cannot be evaluated without a flag dependency evaluator`);n=await s(e)}else n=ta(e,t);let o=e.negation||!1;if("AND"===a){if(!n&&!o||n&&o)return!1}else if(n&&!o||!n&&o)return!0}catch(t){if(t instanceof tr)throw t;if(t instanceof tt)i&&console.debug(`Failed to compute property ${e} locally: ${t}`),o=!0;else throw t}if(o)throw new tt("can't match cohort without a given cohort property value");return"AND"===a}function tl(e){try{return new RegExp(e),!0}catch(e){return!1}}function tu(e,t){if(!/^\d+$/.test(e)||e.length>1&&"0"===e[0])throw new tt(`Invalid semver: ${t}`);return parseInt(e,10)}function tc(e){let t=String(e).trim().replace(/^[vV]/,"").split("-")[0].split("+")[0];if(!t||t.startsWith("."))throw new tt(`Invalid semver: ${e}`);let r=t.split("."),i=t=>void 0===t||""===t?0:tu(t,e);return[i(r[0]),i(r[1]),i(r[2])]}function td(e,t){for(let r=0;r<3;r++){if(e[r]<t[r])return -1;if(e[r]>t[r])return 1}return 0}function th(e){if(e instanceof Date)return e;if("string"==typeof e||"number"==typeof e){let t=new Date(e);if(!isNaN(t.valueOf()))return t;throw new tt(`${e} is in an invalid date format`)}throw new tt(`The date provided ${e} must be a string, number, or date object`)}function tg(e,t,r,i,s){if(t>r&&(i.warn("min cannot be greater than max."),t=r),E(e))if(e>r)return i.warn(" cannot be greater than max: "+r+". Using max value instead."),r;else return e<t?(i.warn(" cannot be less than min: "+t+". Using min value instead."),t):e;return i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+s),tg(s||r,t,r,i)}class tp{constructor(e){this._buckets={},this._onBucketRateLimited=e._onBucketRateLimited,this._bucketSize=tg(e.bucketSize,0,100,e._logger),this._refillRate=tg(e.refillRate,0,this._bucketSize,e._logger),this._refillInterval=tg(e.refillInterval,0,864e5,e._logger)}_applyRefill(e,t){let r=Math.floor((t-e.lastAccess)/this._refillInterval);if(r>0){let t=r*this._refillRate;e.tokens=Math.min(e.tokens+t,this._bucketSize),e.lastAccess=e.lastAccess+r*this._refillInterval}}consumeRateLimit(e){let t=Date.now(),r=String(e),i=this._buckets[r];return i?this._applyRefill(i,t):(i={tokens:this._bucketSize,lastAccess:t},this._buckets[r]=i),0===i.tokens||(i.tokens--,0===i.tokens&&this._onBucketRateLimited?.(e),0===i.tokens)}stop(){this._buckets={}}}class tf{constructor(e,t,r){this.client=e,this._exceptionAutocaptureEnabled=t.enableExceptionAutocapture||!1,this._logger=r,this._rateLimiter=new tp({refillRate:1,bucketSize:10,refillInterval:1e4,_logger:this._logger}),this.startAutocaptureIfEnabled()}static isPreviouslyCapturedError(e){return b(e)&&"__posthog_previously_captured_error"in e&&!0===e.__posthog_previously_captured_error}static async buildEventMessage(e,t,r,i,s){let a={...s},n=e.buildFromUnknown(t,r);return n.$exception_list=await e.modifyFrames(n.$exception_list),{event:"$exception",distinctId:i,properties:{...n,...a},_originatedFromCaptureException:!0}}startAutocaptureIfEnabled(){if(this.isEnabled()){var t,r,i;let s;t=this.onException.bind(this),r=this.onFatalError.bind(this),globalThis.process?.on("uncaughtException",(s=!1,Object.assign(i=>{let a=e.g.process.listeners("uncaughtException").filter(e=>"domainUncaughtExceptionClear"!==e.name&&!0!==e._posthogErrorHandler).length;t(i,{mechanism:{type:"onuncaughtexception",handled:!1}}),s||0!==a||(s=!0,r(i))},{_posthogErrorHandler:!0}))),i=this.onException.bind(this),globalThis.process?.on("unhandledRejection",e=>i(e,{mechanism:{type:"onunhandledrejection",handled:!1}}))}}onException(e,t){this.client.addPendingPromise((async()=>{if(!tf.isPreviouslyCapturedError(e)){let r=await tf.buildEventMessage(this.client.getErrorPropertiesBuilder(),e,t),i=r.properties,s=i?.$exception_list[0]?.type??"Exception";return this._rateLimiter.consumeRateLimit(s)?void this._logger.info("Skipping exception capture because of client rate limiting.",{exception:s}):this.client.capture(r)}})())}async onFatalError(e){console.error(e),await this.client.shutdown(2e3),process.exit(1)}isEnabled(){return!this.client.isDisabled&&this._exceptionAutocaptureEnabled}shutdown(){this._rateLimiter.stop()}}class ty{getProperty(e){return this._memoryStorage[e]}setProperty(e,t){this._memoryStorage[e]=null!==t?t:void 0}constructor(){this._memoryStorage={}}}let tm=new Set;function tv(e,t){tm.has(e)||(tm.add(e),console.warn(`[PostHog] ${t}`))}class t_ extends ez{constructor(e,t={}){const r=function(e){return"string"==typeof e?e.trim():""}(e),i={...t,host:function(e){return("string"==typeof e?e.trim():"")||"https://us.i.posthog.com"}(t.host),personalApiKey:function(e){return("string"==typeof e?e.trim():"")||void 0}(t.personalApiKey)};if(super(r,i),this._memoryStorage=new ty,this.options=i,this.context=this.initializeContext(),this.options.featureFlagsPollingInterval="number"==typeof i.featureFlagsPollingInterval?Math.max(i.featureFlagsPollingInterval,100):3e4,"number"==typeof i.waitUntilDebounceMs&&(this.options.waitUntilDebounceMs=Math.max(i.waitUntilDebounceMs,0)),"number"==typeof i.waitUntilMaxWaitMs&&(this.options.waitUntilMaxWaitMs=Math.max(i.waitUntilMaxWaitMs,0)),!this.disabled&&i.personalApiKey){if(i.personalApiKey.includes("phc_"))throw Error('Your Personal API key is invalid. These keys are prefixed with "phx_" and can be created in PostHog project settings.');!1!==i.enableLocalEvaluation&&(this.featureFlagsPoller=new ti({pollingInterval:this.options.featureFlagsPollingInterval,personalApiKey:i.personalApiKey,projectApiKey:r,timeout:i.requestTimeout??1e4,host:this.host,fetch:i.fetch,onError:e=>{this._events.emit("error",e)},onLoad:e=>{this._events.emit("localEvaluationFlagsLoaded",e)},customHeaders:this.getCustomHeaders(),cacheProvider:i.flagDefinitionCacheProvider,strictLocalEvaluation:i.strictLocalEvaluation}))}this.errorTracking=new tf(this,i,this._logger),this.distinctIdHasSentFlagCalls={},this.maxCacheSize=i.maxCacheSize||5e4}enqueue(e,t,r){super.enqueue(e,t,r),this.scheduleDebouncedFlush()}async flush(){let e=super.flush(),t=this.options.waitUntil;if(t&&!this._waitUntilCycle)try{t(e.catch(()=>{}))}catch{}return e}scheduleDebouncedFlush(){let e=this.options.waitUntil;if(!e||this.disabled||this.optedOut)return;if(!this._waitUntilCycle){let t,r=new Promise(e=>{t=e});try{e(r)}catch{return}this._waitUntilCycle={resolve:t,startedAt:Date.now(),timer:void 0}}let t=Date.now()-this._waitUntilCycle.startedAt,r=this.options.waitUntilMaxWaitMs??500;if(void 0!==this._waitUntilCycle.timer&&clearTimeout(this._waitUntilCycle.timer),t>=r)return void this.resolveWaitUntilFlush();let i=this.options.waitUntilDebounceMs??50;this._waitUntilCycle.timer=L(()=>{this.resolveWaitUntilFlush()},i)}_consumeWaitUntilCycle(){let e=this._waitUntilCycle;return e&&(clearTimeout(e.timer),this._waitUntilCycle=void 0),e?.resolve}async resolveWaitUntilFlush(){let e=this._consumeWaitUntilCycle();try{await super.flush()}catch{}finally{e?.()}}getPersistedProperty(e){return this._memoryStorage.getProperty(e)}setPersistedProperty(e,t){return this._memoryStorage.setProperty(e,t)}fetch(e,t){return this.options.fetch?this.options.fetch(e,t):fetch(e,t)}getLibraryVersion(){return"5.36.5"}getCustomUserAgent(){return`${this.getLibraryId()}/${this.getLibraryVersion()}`}getCommonEventProperties(){let e=super.getCommonEventProperties();return(this.options.isServer??!0)&&(e.$is_server=!0),e}enable(){return super.optIn()}disable(){return super.optOut()}debug(e=!0){super.debug(e),this.featureFlagsPoller?.debug(e)}capture(e){"string"==typeof e&&this._logger.warn("Called capture() with a string as the first argument when an object was expected."),"$exception"!==e.event||e._originatedFromCaptureException||this._logger.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.addPendingPromise(this.prepareEventMessage(e).then(({distinctId:e,event:t,properties:r,options:i})=>super.captureStateless(e,t,r,{timestamp:i.timestamp,disableGeoip:i.disableGeoip,uuid:i.uuid})).catch(e=>{e&&console.error(e)}))}async captureImmediate(e){return"string"==typeof e&&this._logger.warn("Called captureImmediate() with a string as the first argument when an object was expected."),"$exception"!==e.event||e._originatedFromCaptureException||this._logger.warn("Capturing a `$exception` event via `posthog.captureImmediate('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureExceptionImmediate(error)` instead, which attaches this metadata by default."),this.addPendingPromise(this.prepareEventMessage(e).then(({distinctId:e,event:t,properties:r,options:i})=>super.captureStatelessImmediate(e,t,r,{timestamp:i.timestamp,disableGeoip:i.disableGeoip,uuid:i.uuid})).catch(e=>{e&&console.error(e)}))}identify({distinctId:e,properties:t={},disableGeoip:r}){let{$set:i,$set_once:s,$anon_distinct_id:a,...n}=t;super.identifyStateless(e,{$set:i||n,$set_once:s||{},$anon_distinct_id:a??void 0},{disableGeoip:r})}async identifyImmediate({distinctId:e,properties:t={},disableGeoip:r}){let{$set:i,$set_once:s,$anon_distinct_id:a,...n}=t;await super.identifyStatelessImmediate(e,{$set:i||n,$set_once:s||{},$anon_distinct_id:a??void 0},{disableGeoip:r})}alias(e){super.aliasStateless(e.alias,e.distinctId,void 0,{disableGeoip:e.disableGeoip})}async aliasImmediate(e){await super.aliasStatelessImmediate(e.alias,e.distinctId,void 0,{disableGeoip:e.disableGeoip})}isLocalEvaluationReady(){return this.featureFlagsPoller?.isLocalEvaluationReady()??!1}async waitForLocalEvaluationReady(e=3e4){return!!this.isLocalEvaluationReady()||void 0!==this.featureFlagsPoller&&new Promise(t=>{let r=setTimeout(()=>{i(),t(!1)},e),i=this._events.on("localEvaluationFlagsLoaded",e=>{clearTimeout(r),i(),t(e>0)})})}_resolveDistinctId(e,t){return"string"==typeof e?{distinctId:e,options:t}:{distinctId:this.context?.get()?.distinctId,options:e}}async _getFeatureFlagResult(e,t,r={},i){let s,a,n,o,l,u,c;if(this.disabled)return void this._logger.warn("The client is disabled");let d=r.sendFeatureFlagEvents??!0;if(void 0!==this._flagOverrides&&e in this._flagOverrides){let t=this._flagOverrides[e];if(void 0===t)return;let r=this._payloadOverrides?.[e];return{key:e,enabled:!1!==t,variant:"string"==typeof t?t:void 0,payload:r}}let{groups:h,disableGeoip:g}=r,{onlyEvaluateLocally:p,personProperties:f,groupProperties:y}=r,m=this.addLocalPersonAndGroupProperties(t,h,f,y);f=m.allPersonProperties,y=m.allGroupProperties;let v=this.createFeatureFlagEvaluationContext(t,h,f,y);void 0==p&&(p=this.options.strictLocalEvaluation??!1);let _=!1;if(void 0!==this.featureFlagsPoller){await this.featureFlagsPoller?.loadFeatureFlags();let t=this.featureFlagsPoller?.featureFlagsByKey[e];if(t)try{let r=await this.featureFlagsPoller?.computeFlagAndPayloadLocally(t,v,{matchValue:i});if(r){_=!0;let i=r.value;l=t.id,c="Evaluated locally",s={key:e,enabled:!1!==i,variant:"string"==typeof i?i:void 0,payload:r.payload??void 0}}}catch(t){if(t instanceof tr||t instanceof tt)this._logger?.info(`${t.name} when computing flag locally: ${e}: ${t.message}`);else throw t}}if(!_&&!p){let t=await super.getFeatureFlagDetailsStateless(v.distinctId,v.groups,v.personProperties,v.groupProperties,g,[e]);if(void 0===t)o=e6.UNKNOWN_ERROR;else{a=t.requestId,n=t.evaluatedAt;let r=[];t.errorsWhileComputingFlags&&r.push(e6.ERRORS_WHILE_COMPUTING),t.quotaLimited?.includes("feature_flags")&&r.push(e6.QUOTA_LIMITED);let i=t.flags[e];if(void 0===i)r.push(e6.FLAG_MISSING);else{let t;if(l=i.metadata?.id,u=i.metadata?.version,c=i.reason?.description??i.reason?.code,i.metadata?.payload!==void 0)try{t=JSON.parse(i.metadata.payload)}catch{t=i.metadata.payload}s={key:e,enabled:i.enabled,variant:i.variant,payload:t}}r.length>0&&(o=r.join(","))}}if(d){let r=void 0===s?void 0:!1!==s.enabled&&(s.variant??!0),i={$feature_flag:e,$feature_flag_response:r,$feature_flag_id:l,$feature_flag_version:u,$feature_flag_reason:c,locally_evaluated:_,[`$feature/${e}`]:r,$feature_flag_request_id:a,$feature_flag_evaluated_at:_?Date.now():n};if(_&&this.featureFlagsPoller){let e=this.featureFlagsPoller.getFlagDefinitionsLoadedAt();void 0!==e&&(i.$feature_flag_definitions_loaded_at=e)}o&&(i.$feature_flag_error=o),this._captureFlagCalledEventIfNeeded({distinctId:t,key:e,response:r,groups:h,disableGeoip:g,properties:i})}return void 0!==s&&void 0!==this._payloadOverrides&&e in this._payloadOverrides&&(s={...s,payload:this._payloadOverrides[e]}),s}async getFeatureFlag(e,t,r){tv("getFeatureFlag","`getFeatureFlag` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.getFlag(key)` instead — this consolidates flag evaluation into a single `/flags` request per incoming request.");let i=await this._getFeatureFlagResult(e,t,{...r,sendFeatureFlagEvents:r?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0});if(void 0!==i)return!1!==i.enabled&&(i.variant??!0)}async getFeatureFlagPayload(e,t,r,i){if(tv("getFeatureFlagPayload","`getFeatureFlagPayload` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.getFlagPayload(key)` instead — this consolidates flag evaluation into a single `/flags` request per incoming request."),void 0!==this._payloadOverrides&&e in this._payloadOverrides)return this._payloadOverrides[e];let s=await this._getFeatureFlagResult(e,t,{...i,sendFeatureFlagEvents:!1},r);if(void 0!==s)return s.payload??null}async getFeatureFlagResult(e,t,r){let{distinctId:i,options:s}=this._resolveDistinctId(t,r);return i?this._getFeatureFlagResult(e,i,{...s,sendFeatureFlagEvents:s?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0}):void this._logger.warn("[PostHog] distinctId is required — pass it explicitly or use withContext()")}async getRemoteConfigPayload(e){if(this.disabled)return void this._logger.warn("The client is disabled");if(!this.options.personalApiKey)throw Error("Personal API key is required for remote config payload decryption");let t=await this._requestRemoteConfigPayload(e);if(!t)return;let r=await t.json();if("string"==typeof r)try{return JSON.parse(r)}catch(e){}return r}async isFeatureEnabled(e,t,r){tv("isFeatureEnabled","`isFeatureEnabled` is deprecated and will be removed in a future major version. Use `posthog.evaluateFlags(distinctId, ...)` and call `flags.isEnabled(key)` instead — this consolidates flag evaluation into a single `/flags` request per incoming request.");let i=await this._getFeatureFlagResult(e,t,{...r,sendFeatureFlagEvents:r?.sendFeatureFlagEvents??this.options.sendFeatureFlagEvent??!0});return void 0===i?void 0:!1!==i.enabled&&!!(i.variant??!0)}async getAllFlags(e,t){let{distinctId:r,options:i}=this._resolveDistinctId(e,t);return r?(await this.getAllFlagsAndPayloads(r,i)).featureFlags||{}:(this._logger.warn("[PostHog] distinctId is required to get feature flags — pass it explicitly or use withContext()"),{})}async getAllFlagsAndPayloads(e,t){let{distinctId:r,options:i}=this._resolveDistinctId(e,t);if(!r)return this._logger.warn("[PostHog] distinctId is required to get feature flags and payloads — pass it explicitly or use withContext()"),{featureFlags:{},featureFlagPayloads:{}};if(this.disabled)return this._logger.warn("The client is disabled"),{featureFlags:{},featureFlagPayloads:{}};let{groups:s,disableGeoip:a,flagKeys:n}=i||{},{onlyEvaluateLocally:o,personProperties:l,groupProperties:u}=i||{},c=this.addLocalPersonAndGroupProperties(r,s,l,u);l=c.allPersonProperties,u=c.allGroupProperties;let d=this.createFeatureFlagEvaluationContext(r,s,l,u);void 0==o&&(o=this.options.strictLocalEvaluation??!1);let h=await this.featureFlagsPoller?.getAllFlagsAndPayloads(d,n),g={},p={},f=!0;if(h&&(g=h.response,p=h.payloads,f=h.fallbackToFlags),f&&!o){let e=await super.getFeatureFlagsAndPayloadsStateless(d.distinctId,d.groups,d.personProperties,d.groupProperties,a,n);g={...g,...e.flags||{}},p={...p,...e.payloads||{}}}return void 0!==this._flagOverrides&&(g={...g,...this._flagOverrides}),void 0!==this._payloadOverrides&&(p={...p,...this._payloadOverrides}),{featureFlags:g,featureFlagPayloads:p}}async evaluateFlags(e,t){let r,i,{distinctId:s,options:a}=this._resolveDistinctId(e,t);if(!s)return this._logger.warn("[PostHog] distinctId is required to evaluate feature flags — pass it explicitly or use withContext()"),new e8({host:this._getFeatureFlagEvaluationsHost(),distinctId:"",flags:{}});if(this.disabled)return this._logger.warn("The client is disabled"),new e8({host:this._getFeatureFlagEvaluationsHost(),distinctId:s,flags:{}});let{groups:n,disableGeoip:o,flagKeys:l}=a||{},{onlyEvaluateLocally:u,personProperties:c,groupProperties:d}=a||{},h=this.addLocalPersonAndGroupProperties(s,n,c,d);c=h.allPersonProperties,d=h.allGroupProperties;let g=this.createFeatureFlagEvaluationContext(s,n,c,d);void 0==u&&(u=this.options.strictLocalEvaluation??!1);let p={},f=!1,y=!1,m=await this.featureFlagsPoller?.getAllFlagsAndPayloads(g,l),v=new Set;if(m)for(let[e,t]of Object.entries(m.response)){let r=this.featureFlagsPoller?.featureFlagsByKey[e];p[e]={key:e,enabled:!1!==t,variant:"string"==typeof t?t:void 0,payload:m.payloads[e],id:r?.id,version:void 0,reason:"Evaluated locally",locallyEvaluated:!0},v.add(e)}if((!m||m.fallbackToFlags)&&!u){let e=await super.getFeatureFlagDetailsStateless(g.distinctId,g.groups,g.personProperties,g.groupProperties,o,l);if(e)for(let[t,s]of(r=e.requestId,i=e.evaluatedAt,f=!!e.errorsWhileComputingFlags,y=Array.isArray(e.quotaLimited)&&e.quotaLimited.includes("feature_flags"),Object.entries(e.flags))){let e;if(!v.has(t)){if(s.metadata?.payload!==void 0)try{e=JSON.parse(s.metadata.payload)}catch{e=s.metadata.payload}p[t]={key:t,enabled:s.enabled,variant:s.variant,payload:e,id:s.metadata?.id,version:s.metadata?.version,reason:s.reason?.description??s.reason?.code,locallyEvaluated:!1}}}}if(void 0!==this._flagOverrides)for(let[e,t]of Object.entries(this._flagOverrides)){if(void 0===t){delete p[e];continue}let r=p[e];p[e]={key:e,enabled:!1!==t,variant:"string"==typeof t?t:void 0,payload:r?.payload,id:r?.id,version:r?.version,reason:r?.reason,locallyEvaluated:r?.locallyEvaluated??!1}}if(void 0!==this._payloadOverrides)for(let[e,t]of Object.entries(this._payloadOverrides)){let r=p[e];r&&(p[e]={...r,payload:t})}return new e8({host:this._getFeatureFlagEvaluationsHost(),distinctId:s,groups:n,disableGeoip:o,flags:p,requestId:r,evaluatedAt:i,flagDefinitionsLoadedAt:this.featureFlagsPoller?.getFlagDefinitionsLoadedAt(),errorsWhileComputing:f,quotaLimited:y})}_captureFlagCalledEventIfNeeded(e){let{distinctId:t,key:r,response:i,groups:s,disableGeoip:a,properties:n}=e,o=s&&Object.keys(s).length>0?`_${JSON.stringify(Object.entries(s).sort(([e],[t])=>e<t?-1:+(e>t)))}`:"",l=`${r}_${i}${o}`;t in this.distinctIdHasSentFlagCalls&&this.distinctIdHasSentFlagCalls[t].has(l)||(Object.keys(this.distinctIdHasSentFlagCalls).length>=this.maxCacheSize&&(this.distinctIdHasSentFlagCalls={}),this.distinctIdHasSentFlagCalls[t]instanceof Set?this.distinctIdHasSentFlagCalls[t].add(l):this.distinctIdHasSentFlagCalls[t]=new Set([l]),this.capture({distinctId:t,event:"$feature_flag_called",properties:n,groups:s,disableGeoip:a}))}_getFeatureFlagEvaluationsHost(){return this._featureFlagEvaluationsHost||(this._featureFlagEvaluationsHost={captureFlagCalledEventIfNeeded:e=>this._captureFlagCalledEventIfNeeded(e),logWarning:e=>{!1!==this.options.featureFlagsLogWarnings&&console.warn(`[PostHog] ${e}`)}}),this._featureFlagEvaluationsHost}groupIdentify({groupType:e,groupKey:t,properties:r,distinctId:i,disableGeoip:s}){super.groupIdentifyStateless(e,t,r,{disableGeoip:s},i)}async reloadFeatureFlags(){await this.featureFlagsPoller?.loadFeatureFlags(!0)}overrideFeatureFlags(e){let t=e=>Object.fromEntries(e.map(e=>[e,!0]));if(!1===e){this._flagOverrides=void 0,this._payloadOverrides=void 0;return}if(Array.isArray(e)){this._flagOverrides=t(e);return}if(this._isFeatureFlagOverrideOptions(e)){"flags"in e&&(!1===e.flags?this._flagOverrides=void 0:Array.isArray(e.flags)?this._flagOverrides=t(e.flags):void 0!==e.flags&&(this._flagOverrides={...e.flags})),"payloads"in e&&(!1===e.payloads?this._payloadOverrides=void 0:void 0!==e.payloads&&(this._payloadOverrides={...e.payloads}));return}this._flagOverrides={...e}}_isFeatureFlagOverrideOptions(e){if("object"!=typeof e||null===e||Array.isArray(e))return!1;if("flags"in e){let t=e.flags;if(!1===t||Array.isArray(t)||"object"==typeof t&&null!==t)return!0}if("payloads"in e){let t=e.payloads;if(!1===t||"object"==typeof t&&null!==t)return!0}return!1}withContext(e,t,r){return this.context?this.context.run(e,t,r):t()}getContext(){return this.context?.get()}enterContext(e,t){this.context?.enter(e,t)}async _shutdown(e){let t=this._consumeWaitUntilCycle();await this.featureFlagsPoller?.stopPoller(e),this.errorTracking.shutdown();try{return await super._shutdown(e)}finally{t?.()}}async _requestRemoteConfigPayload(e){if(this.disabled||!this.apiKey||!this.options.personalApiKey)return;let t=`${this.host}/api/projects/@current/feature_flags/${e}/remote_config?token=${encodeURIComponent(this.apiKey)}`,r={method:"GET",headers:{...this.getCustomHeaders(),"Content-Type":"application/json",Authorization:`Bearer ${this.options.personalApiKey}`}},i=null;if(this.options.requestTimeout&&"number"==typeof this.options.requestTimeout){let e=new AbortController;i=L(()=>{e.abort()},this.options.requestTimeout),r.signal=e.signal}try{return await this.fetch(t,r)}catch(e){this._events.emit("error",e);return}finally{i&&clearTimeout(i)}}extractPropertiesFromEvent(e,t){if(!e)return{personProperties:{},groupProperties:{}};let r={},i={};for(let[s,a]of Object.entries(e))if(P(a,"Object")&&t&&s in t){let e={};for(let[t,r]of Object.entries(a))e[String(t)]=String(r);i[String(s)]=e}else r[String(s)]=String(a);return{personProperties:r,groupProperties:i}}async getFeatureFlagsForEvent(e,t,r,i){if(this.disabled||!this.apiKey)return void this._logger.warn("The client is disabled");let s=i?.personProperties||{},a=i?.groupProperties||{},n=i?.flagKeys;if(i?.onlyEvaluateLocally??this.options.strictLocalEvaluation)if(!((this.featureFlagsPoller?.featureFlags?.length||0)>0))return{};else{let i={};for(let[e,r]of Object.entries(t||{}))i[e]=String(r);return await this.getAllFlags(e,{groups:i,personProperties:s,groupProperties:a,disableGeoip:r,onlyEvaluateLocally:!0,flagKeys:n})}if((this.featureFlagsPoller?.featureFlags?.length||0)>0){let i={};for(let[e,r]of Object.entries(t||{}))i[e]=String(r);return await this.getAllFlags(e,{groups:i,personProperties:s,groupProperties:a,disableGeoip:r,onlyEvaluateLocally:!0,flagKeys:n})}return(await super.getFeatureFlagsStateless(e,t,s,a,r)).flags}addLocalPersonAndGroupProperties(e,t,r,i){let s={distinct_id:e,...r||{}},a={};if(t)for(let e of Object.keys(t))a[e]={$group_key:t[e],...i?.[e]||{}};return{allPersonProperties:s,allGroupProperties:a}}createFeatureFlagEvaluationContext(e,t,r,i){return{distinctId:e,groups:t||{},personProperties:r||{},groupProperties:i||{},evaluationCache:{}}}captureException(e,t,r,i,s){if(!tf.isPreviouslyCapturedError(e)){let a=Error("PostHog syntheticException");this.addPendingPromise(tf.buildEventMessage(this.getErrorPropertiesBuilder(),e,{syntheticException:a},t,r).then(e=>this.capture({...e,uuid:i,flags:s})))}}async captureExceptionImmediate(e,t,r,i){if(!tf.isPreviouslyCapturedError(e)){let s=Error("PostHog syntheticException");return this.addPendingPromise(tf.buildEventMessage(this.getErrorPropertiesBuilder(),e,{syntheticException:s},t,r).then(e=>this.captureImmediate({...e,flags:i})))}}async prepareEventMessage(e){let{distinctId:t,event:r,properties:i,groups:s,flags:a,sendFeatureFlags:n,timestamp:o,disableGeoip:l,uuid:u}=e,c=this.context?.get(),d=t||c?.distinctId,h={...this.props,...c?.properties||{},...i||{}};d||(d=H(),h.$process_person_profile=!1),c?.sessionId&&!h.$session_id&&(h.$session_id=c.sessionId);let g=this._runBeforeSend({distinctId:d,event:r,properties:h,groups:s,flags:a,sendFeatureFlags:n,timestamp:o,disableGeoip:l,uuid:u});if(!g)return Promise.reject(null);let p=await Promise.resolve().then(async()=>{if(a)return n&&console.warn("[PostHog] Both `flags` and `sendFeatureFlags` were passed to capture(); using `flags` and ignoring `sendFeatureFlags`."),a._getEventProperties();if(n){tv("sendFeatureFlags","`sendFeatureFlags` is deprecated and will be removed in a future major version. Pass a `flags` snapshot from `posthog.evaluateFlags(...)` instead — it avoids a second `/flags` request per capture and guarantees the event carries the exact flag values your code branched on.");var e=await this.getFeatureFlagsForEvent(g.distinctId,s,l,"object"==typeof n?n:void 0);if(!e)return{};let t={};for(let[r,i]of Object.entries(e))t[`$feature/${r}`]=i;let r=Object.keys(e).filter(t=>!1!==e[t]).sort();return r.length>0&&(t.$active_feature_flags=r),t}return{}}).catch(()=>({})).then(e=>({...e,...g.properties||{},$groups:g.groups||s}));return"$pageview"===g.event&&this.options.__preview_capture_bot_pageviews&&"string"==typeof p.$raw_user_agent&&e5(p.$raw_user_agent,this.options.custom_blocked_useragents||[])&&(g.event="$bot_pageview",p.$browser_type="bot"),{distinctId:g.distinctId,event:g.event,properties:p,options:{timestamp:g.timestamp,disableGeoip:g.disableGeoip,uuid:g.uuid}}}_runBeforeSend(e){let t=this.options.before_send;if(!t)return e;let r=Array.isArray(t)?t:[t],i=e;for(let t of r){if(!(i=t(i)))return this._logger.info(`Event '${e.event}' was rejected in beforeSend function`),null;if(!i.properties||0===Object.keys(i.properties).length){let e=`Event '${i.event}' has no properties after beforeSend function, this is likely an error.`;this._logger.warn(e)}}return i}}var eQ=eV,tb=e.i(78500);class tw{constructor(){this.storage=new tb.AsyncLocalStorage}get(){return this.storage.getStore()}run(e,t,r){return this.storage.run(this.resolve(e,r),t)}enter(e,t){this.storage.enterWith(this.resolve(e,t))}resolve(e,t){if(t?.fresh===!0)return e;let r=this.get()||{};return{distinctId:e.distinctId??r.distinctId,sessionId:e.sessionId??r.sessionId,properties:{...r.properties||{},...e.properties||{}}}}}let tE=/[\x00-\x1f\x7f-\x9f]/g;function tF(e,t,r){null!=r&&""!==r&&(e[t]=r)}function tP(e){return Array.isArray(e)?e[0]:e}function tx(e){if(Array.isArray(e)){for(let t of e){let e=tx(t);if(void 0!==e)return e}return}if("string"!=typeof e)return;let t=e.replace(tE,"").trim();if(t)return t.length>1e3?t.slice(0,1e3):t}function tS(e){let{sessionId:t,distinctId:r}=function(e){if(!e)return{};let t=tx(e["x-posthog-session-id"]),r=tx(e["x-posthog-distinct-id"]);return{...void 0!==t?{sessionId:t}:{},...void 0!==r?{distinctId:r}:{}}}(e.headers),i={};return tF(i,"$current_url",e.originalUrl||e.url),tF(i,"$request_method",e.method),tF(i,"$request_path",e.path),tF(i,"$user_agent",tP(e.headers["user-agent"])),tF(i,"$ip",function(e){let t=tP(e.headers["x-forwarded-for"]);if(t){let e=t.split(",")[0].trim();if(e)return e}return e.socket?.remoteAddress}(e)),{...void 0!==t?{sessionId:t}:{},...void 0!==r?{distinctId:r}:{},properties:i}}function tI(e,t){var r;t.use((r=e,(e,t,i)=>{r.withContext(tS(e),()=>i())}))}function tC(e,t){var r;t.use((r=e,(e,t,i,s)=>{if(tf.isPreviouslyCapturedError(e))return void s(e);let a=tS(t),n=Error("Synthetic exception"),o={...void 0!==a.sessionId?{$session_id:a.sessionId}:{},...a.properties||{},$response_status_code:i.statusCode};r.addPendingPromise(tf.buildEventMessage(r.getErrorPropertiesBuilder(),e,{mechanism:{type:"middleware",handled:!1},syntheticException:n},a.distinctId,o).then(e=>{r.capture(e)})),s(e)}))}e.s(["setupExpressErrorHandler",0,tC,"setupExpressRequestContext",0,tI],88512),e.s([],52538);class tk extends t_{getLibraryId(){return"posthog-node"}initializeContext(){return new tw}createErrorPropertiesBuilder(){let e;return new eQ.ErrorPropertiesBuilder([new eQ.EventCoercer,new eQ.ErrorCoercer,new eQ.ObjectCoercer,new eQ.StringCoercer,new eQ.PrimitiveCoercer],eQ.createStackParser("node:javascript",eQ.nodeStackLineParser),[(e=function(e=process.argv[1]?(0,o.dirname)(process.argv[1]):process.cwd(),t="\\"===o.sep){let r=t?l(e):e;return e=>{if(!e)return;let i=t?l(e):e,{dir:s,base:a,ext:n}=o.posix.parse(i);(".js"===n||".mjs"===n||".cjs"===n)&&(a=a.slice(0,-1*n.length));let u=decodeURIComponent(a);s||(s=".");let c=s.lastIndexOf("/node_modules");if(c>-1)return`${s.slice(c+14).replace(/\//g,".")}:${u}`;if(s.startsWith(r)){let e=s.slice(r.length+1).replace(/\//g,".");return e?`${e}:${u}`:u}return u}}(),async t=>{for(let r of t)r.module=e(r.filename);return t}),e0,function(e=process.cwd()){let t="\\"===o.sep,r=e=>t?e.replace(/\\/g,"/"):e,i=r(e);return async e=>{for(let t of e)!(!t.filename||t.filename.startsWith("node:")||t.filename.startsWith("data:"))&&(0,o.isAbsolute)(t.filename)&&(t.filename=r((0,o.relative)(i,r(t.filename))));return e}}()])}}e.s(["PostHog",0,tk],89767),e.i(89767),e.i(52538);let t$="posthog-node";function tA(e,{organization:t,projectId:r,prefix:i,severityAllowList:s=["error"],sendExceptionsToPostHog:a=!0}={}){return n=>{if(!("*"===s||s.includes(n.level)))return n;n.tags||(n.tags={});let o=n.tags[tT.POSTHOG_ID_TAG];if(void 0===o)return n;let l=e.options.host??"https://us.i.posthog.com",u=new URL(`/project/${e.apiKey}/person/${o}`,l).toString();n.tags["PostHog Person URL"]=u;let c=n.exception?.values||[],d=c.map(e=>({...e,stacktrace:e.stacktrace?{...e.stacktrace,type:"raw",frames:(e.stacktrace.frames||[]).map(e=>({...e,platform:"node:javascript"}))}:void 0})),h={$exception_message:c[0]?.value||n.message,$exception_type:c[0]?.type,$exception_level:n.level,$exception_list:d,$sentry_event_id:n.event_id,$sentry_exception:n.exception,$sentry_exception_message:c[0]?.value||n.message,$sentry_exception_type:c[0]?.type,$sentry_tags:n.tags};return t&&r&&(h.$sentry_url=(i||"https://sentry.io/organizations/")+t+"/issues/?project="+r+"&query="+n.event_id),a&&e.capture({event:"$exception",distinctId:o,properties:h}),n}}function tO(e,t){let r=tA(e,t);return{name:t$,processEvent:e=>r(e)}}class tT{static #e=this.POSTHOG_ID_TAG="posthog_distinct_id";constructor(e,t,r,i,s){this.name=t$,this.name=t$,this.setupOnce=function(a,n){a(tA(e,{organization:t,projectId:n()?.getClient()?.getDsn()?.projectId,prefix:r,severityAllowList:i,sendExceptionsToPostHog:s??!0}))}}}e.s(["PostHogSentryIntegration",0,tT,"createEventProcessor",0,tA,"sentryIntegration",0,tO],92164),e.i(92164),e.i(88512),e.i(88096),e.s(["FeatureFlagError",0,h,"FeatureFlagEvaluations",0,e8,"PostHogSentryIntegration",0,tT,"cookieStateToProperties",0,V,"cookieStoreFromHeader",0,G,"createEventProcessor",0,tA,"getPostHogCookieName",0,W,"parsePostHogCookie",0,Q,"readPostHogCookie",0,K,"sentryIntegration",0,tO,"serializePostHogCookie",0,z,"setupExpressErrorHandler",0,tC,"setupExpressRequestContext",0,tI,"uuidv7",0,H],92349),e.i(92349),e.s(["FeatureFlagError",0,h,"FeatureFlagEvaluations",0,e8,"PostHog",0,tk,"PostHogSentryIntegration",0,tT,"cookieStateToProperties",0,V,"cookieStoreFromHeader",0,G,"createEventProcessor",0,tA,"getPostHogCookieName",0,W,"parsePostHogCookie",0,Q,"readPostHogCookie",0,K,"sentryIntegration",0,tO,"serializePostHogCookie",0,z,"setupExpressErrorHandler",0,tC,"setupExpressRequestContext",0,tI,"uuidv7",0,H],39702)}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oi._.js.map
|