@openhands/agent-canvas 1.9.0 → 1.11.0
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/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/{acp-providers-C921BlYB.js → acp-providers-BkL3HWa3.js} +1 -1
- package/build/assets/active-backend-context-BBvP-bI2.js +2 -0
- package/build/assets/agent-context-settings-Bno1nwPL.js +1 -0
- package/build/assets/{agent-profiles-settings-BymJf3EP.js → agent-profiles-settings-DqoS7RL3.js} +1 -1
- package/build/assets/agent-server-conversation-service.api-0RztSdJJ.js +86 -0
- package/build/assets/agent-settings-BJHryp65.js +1 -0
- package/build/assets/{agent-settings-WzqXk6B4.js → agent-settings-h8hQz-IU.js} +2 -2
- package/build/assets/alert-banner-lrK-2_0Y.js +1 -0
- package/build/assets/{api-key-entry-screen-DI0I04O3.js → api-key-entry-screen-Qsb83VX1.js} +1 -1
- package/build/assets/{app-settings-DGistSFV.js → app-settings-r1RUbgGi.js} +1 -1
- package/build/assets/automation-detail-7LkL91j9.js +3 -0
- package/build/assets/automation-export-U2QNyNy6.js +2 -0
- package/build/assets/automation-setup-route-Bel9_Lue.js +1 -0
- package/build/assets/automation-templates-CRLDssaI.js +1 -0
- package/build/assets/automations-list-B2iV3ZKW.js +1 -0
- package/build/assets/{back-nav-button-D4ngzpSh.js → back-nav-button-B3pYwmUJ.js} +1 -1
- package/build/assets/backend-form-modal-OroTqnAv.js +1 -0
- package/build/assets/{backend-synced-settings-badge-BnzI8Ysj.js → backend-synced-settings-badge-DB4717Iu.js} +1 -1
- package/build/assets/{badge-1Mf1iPcX.js → badge-yR53enbU.js} +1 -1
- package/build/assets/{base-modal-BBuy0WQQ.js → base-modal-3NmIOKDm.js} +1 -1
- package/build/assets/bot-DuN83i3p.js +1 -0
- package/build/assets/{brand-button-DGN6Y9o6.js → brand-button-CJcwjnfb.js} +1 -1
- package/build/assets/{browser-D_ekTlTS.js → browser--eoQOo4M.js} +2 -2
- package/build/assets/{browser-tab-D4a4Ou_w.js → browser-tab-A94o33Vn.js} +1 -1
- package/build/assets/{chat-send-button-CgbcjD97.js → chat-send-button-B8n6-DQA.js} +1 -1
- package/build/assets/check-DLOKoFU9.js +1 -0
- package/build/assets/{checkmark-CxdXtM3b.js → checkmark-XZyokq_Y.js} +1 -1
- package/build/assets/chevron-down-CnIbtM6i.js +1 -0
- package/build/assets/circle-check-CxCYJrpZ.js +1 -0
- package/build/assets/{circle-plus-check-toggle-yTAS-nX3.js → circle-plus-check-toggle-BVzv5EkZ.js} +1 -1
- package/build/assets/{close-CDAVqnTn.js → close-ScPlnwyq.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-CEOl5Gxr.js → cloud-funnel-analytics-CBQdPZl_.js} +1 -1
- package/build/assets/{combobox-caret-Bd2yySnF.js → combobox-caret-BlmRwiM8.js} +1 -1
- package/build/assets/command-menu-PsRXVBz2.js +1 -0
- package/build/assets/condenser-settings-w7L3EFvm.js +1 -0
- package/build/assets/{confirmation-modal-NCUPr2-O.js → confirmation-modal-DAH0XtOp.js} +1 -1
- package/build/assets/context-menu-list-item-BQhmFVEK.js +1 -0
- package/build/assets/{conversation-CUJ0Vo8g.js → conversation-BUzBZAc-.js} +7 -7
- package/build/assets/conversation-panel-pzAKsSDb.js +1 -0
- package/build/assets/conversation-pzAKsSDb.js +1 -0
- package/build/assets/{conversation-state-store-F62HvuI1.js → conversation-state-store-Bs8gA263.js} +1 -1
- package/build/assets/{conversation-store-C6hSXHw0.js → conversation-store-B8Eahyeg.js} +1 -1
- package/build/assets/{conversation-tab-empty-state-BCZ7rUMH.js → conversation-tab-empty-state-C9sfDOlt.js} +1 -1
- package/build/assets/{copy-z7idLzWO.js → copy-Drmhc2jD.js} +1 -1
- package/build/assets/{copy-to-clipboard-button-D_Lp6-Fl.js → copy-to-clipboard-button-DatoElj8.js} +1 -1
- package/build/assets/{device-verify-DLmolX8Q.js → device-verify-BIjXeW9N.js} +1 -1
- package/build/assets/{dist-hOnv1nn2.js → dist-Bl64nBZL.js} +1 -1
- package/build/assets/{dropdown-classes-BB8rzqXL.js → dropdown-classes-zFW7qPSK.js} +1 -1
- package/build/assets/entry.client-DzbDyLkV.js +2 -0
- package/build/assets/enum-filter-dropdown-CctILg5t.js +1 -0
- package/build/assets/{environment-switch-overlay-BepBBX66.js → environment-switch-overlay-Cvmo6clk.js} +1 -1
- package/build/assets/{extensions-hub-R3KNv-5V.js → extensions-hub-DOmHPGTA.js} +1 -1
- package/build/assets/{extensions-navigation-CfWFmI1I.js → extensions-navigation-6zU5M1pa.js} +1 -1
- package/build/assets/{external-link-BdBSg8rk.js → external-link-zWbg5KXS.js} +1 -1
- package/build/assets/file-text-RecuaId_.js +1 -0
- package/build/assets/files-tab-BzofBmF4.js +1 -0
- package/build/assets/{folder-C86qXV7M.js → folder-C1ou4_DT.js} +1 -1
- package/build/assets/{form-control-classes-DAfsCJTe.js → form-control-classes-DLN3Qgub.js} +1 -1
- package/build/assets/format-relative-time-DGPQlPx0.js +1 -0
- package/build/assets/format-time-delta-BIR5Os7T.js +1 -0
- package/build/assets/{git-provider-icon-BZqqUPlm.js → git-provider-icon-BLMlwy02.js} +1 -1
- package/build/assets/{git-repo-dropdown-DEpOwUez.js → git-repo-dropdown-B7RvO70z.js} +1 -1
- package/build/assets/git-repo-dropdown-B_PTq4ol.js +1 -0
- package/build/assets/{highlighted-source-view-CX9oIoVT.js → highlighted-source-view-CgJfD5VT.js} +1 -1
- package/build/assets/home-DEZaZqYv.js +1 -0
- package/build/assets/home-r89Vj2td.js +1 -0
- package/build/assets/{home-store-Ch1ErdBc.js → home-store-D7CjMN_-.js} +1 -1
- package/build/assets/{iconBase-B2rQun3J.js → iconBase-C2sR-uAp.js} +1 -1
- package/build/assets/index-home-r89Vj2td.js +1 -0
- package/build/assets/install-server-modal-BTwK5lbi.js +1 -0
- package/build/assets/kebab-menu-item-content-C4CkeiJO.js +1 -0
- package/build/assets/{launch-B1POpHuP.js → launch-DVlx4v9o.js} +1 -1
- package/build/assets/{link-external-BDBCz-_z.js → link-external-BNZzCM1I.js} +1 -1
- package/build/assets/{list-todo-DtiL3lTp.js → list-todo-CheUtB7F.js} +1 -1
- package/build/assets/llm-not-configured-banner-CwKu8C6g.js +27 -0
- package/build/assets/llm-settings-BJotLQND.js +1 -0
- package/build/assets/llm-settings-CDM-5H2A.js +1 -0
- package/build/assets/{llm-subscription-service-DBJbfd8Z.js → llm-subscription-service-7eVfDIE1.js} +1 -1
- package/build/assets/loader-circle-C5AnEN8r.js +1 -0
- package/build/assets/{loading-spinner-DfZ_bhV7.js → loading-spinner-CN3riY7k.js} +1 -1
- package/build/assets/{manage-backends-modal-CwyWsiag.js → manage-backends-modal-HNWKLYhq.js} +1 -1
- package/build/assets/manifest-2a36a8f8.js +1 -0
- package/build/assets/manifest-subpage-layout-D-m-h8_t.js +1 -0
- package/build/assets/map-provider-7Bp2aih5.js +1 -0
- package/build/assets/markdown-renderer-BiiiIznl.js +8 -0
- package/build/assets/mcp-gLgPP7AS.js +9 -0
- package/build/assets/mcp-marketplace-utils-Dr_HG_ol.js +1 -0
- package/build/assets/messages-D1cbVhRK.js +40 -0
- package/build/assets/{modal-backdrop-X-vKo61e.js → modal-backdrop-BSzNhM4r.js} +1 -1
- package/build/assets/{modal-body-CMsDpalT.js → modal-body-duRaxj_K.js} +1 -1
- package/build/assets/{modal-classes-B6PDrxXo.js → modal-classes-CLEXO6dj.js} +1 -1
- package/build/assets/{modal-close-button-DyxBZaAb.js → modal-close-button-D0aT02hs.js} +1 -1
- package/build/assets/mouse-pointer-click-Px-dXWcS.js +1 -0
- package/build/assets/{navigation-context-BOGzIng3.js → navigation-context-CQZwH_tC.js} +1 -1
- package/build/assets/navigation-link-Bxo3-4vo.js +1 -0
- package/build/assets/npm-DRzJF5Zn.js +1 -0
- package/build/assets/onboarding-DSr8hOpk.js +1 -0
- package/build/assets/onboarding-modal-C6Euf7N4.js +1 -0
- package/build/assets/{openhands-logo-CmYvJXBa.js → openhands-logo-BS-Epajy.js} +1 -1
- package/build/assets/{organization-service.api-UDy63-oC.js → organization-service.api-C4GYWwj9.js} +1 -1
- package/build/assets/{pencil-BjgtZmWp.js → pencil-Bl3GWhgq.js} +1 -1
- package/build/assets/{planner-tab-BWk8885v.js → planner-tab-CZcguxTK.js} +1 -1
- package/build/assets/{plugins-management-service-CjkgF2dd.js → plugins-management-service-BmDzOQsd.js} +1 -1
- package/build/assets/plus-CtzlyAoF.js +1 -0
- package/build/assets/{profiles-service.api-CukSFLzz.js → profiles-service.api-CoLTwjc1.js} +1 -1
- package/build/assets/{providers-CqUWC85T.js → providers-tBzTpz1w.js} +1 -1
- package/build/assets/{proxy-BBUG3sd2.js → proxy-DCI9S-LA.js} +1 -1
- package/build/assets/{puzzle-BoNc6zZ8.js → puzzle-B3v361yY.js} +1 -1
- package/build/assets/recommended-automations-launcher-BbJAJVED.js +1 -0
- package/build/assets/{refresh-cw-BrM5ZAZD.js → refresh-cw-B9GhC3QC.js} +1 -1
- package/build/assets/root-BfM_kC_d.css +1 -0
- package/build/assets/root-gstBEjty.js +2 -0
- package/build/assets/root-layout-BIAFLP9p.js +2 -0
- package/build/assets/{schema-field-nImDoY6-.js → schema-field-zhsVDllR.js} +1 -1
- package/build/assets/{sdk-section-page-BxMrtUNV.js → sdk-section-page-CS4GWn0y.js} +1 -1
- package/build/assets/{search-7DRiGm4Z.js → search-BatSpWed.js} +1 -1
- package/build/assets/search-CYaiKHRp.js +1 -0
- package/build/assets/{secrets-service-Dhjh3HhH.js → secrets-service-DjgGduXk.js} +1 -1
- package/build/assets/{secrets-settings-CPdxceT_.js → secrets-settings-f-qahfbi.js} +1 -1
- package/build/assets/{segmented-toggle-Do6oyepX.js → segmented-toggle-SmvsR3jW.js} +1 -1
- package/build/assets/settings-CWFxymAf.js +1 -0
- package/build/assets/settings-DQd0xLEw.js +1 -0
- package/build/assets/{settings-dropdown-input-DYCULKpp.js → settings-dropdown-input-TWIeiG02.js} +1 -1
- package/build/assets/{settings-gear-TYXnELES.js → settings-gear-DaJj6Pde.js} +1 -1
- package/build/assets/{settings-index-C9o2NBO0.js → settings-index-BVwy9JEp.js} +1 -1
- package/build/assets/{settings-input-B-q2gkVy.js → settings-input-D61Vzp9e.js} +1 -1
- package/build/assets/settings-like-page-layout-classes-Cw4Yzv_P.js +1 -0
- package/build/assets/{settings-list-classes-WpQi0q1L.js → settings-list-classes-sE0ASr1s.js} +1 -1
- package/build/assets/{settings-modal-CEK0AIx6.js → settings-modal-D6D5ngET.js} +1 -1
- package/build/assets/{settings-section-header-context-CnIIQAUn.js → settings-section-header-context-BOJ_Fbak.js} +1 -1
- package/build/assets/settings-service.api-DZp7E7A9.js +1 -0
- package/build/assets/{settings-switch-LqKdGxHL.js → settings-switch-Drt-rF5s.js} +1 -1
- package/build/assets/{settings-utils-BL_Z9uIe.js → settings-utils-gw2ppAvw.js} +1 -1
- package/build/assets/{shared-conversation-Bu-dQlgp.js → shared-conversation-DIxZjElr.js} +1 -1
- package/build/assets/shield-check-D2cpEpv3.js +1 -0
- package/build/assets/{sidebar-layout-oHBGQmLh.js → sidebar-layout-Dxg6zc2K.js} +1 -1
- package/build/assets/sidebar-mobile-menu-toggle-OoZBHxaT.js +1 -0
- package/build/assets/{sidebar-nav-link-CrujNA09.js → sidebar-nav-link-CxLoG-dG.js} +1 -1
- package/build/assets/sidebar-store-BJeYY-E9.js +1 -0
- package/build/assets/{skill-card-pill-row-CZBI7OqH.js → skill-card-pill-row-B_BYBONu.js} +1 -1
- package/build/assets/{skill-icon-badge-BOov_phZ.js → skill-icon-badge-CN41Hy9l.js} +1 -1
- package/build/assets/skill-scope-B1Per5XI.js +1 -0
- package/build/assets/{skills-CYFLsN5U.js → skills-B0IliMxw.js} +1 -1
- package/build/assets/{skills-plugins-D0PiHWAD.js → skills-plugins-B3AO6sMz.js} +1 -1
- package/build/assets/skills-settings-DmmgJ6CT.js +2 -0
- package/build/assets/sparkles-g7y3r-Ut.js +1 -0
- package/build/assets/{styled-tooltip-C7grwnOX.js → styled-tooltip-C5C07RQC.js} +1 -1
- package/build/assets/{switch-skeleton-BQoOhQTB.js → switch-skeleton-DwOoCqaL.js} +1 -1
- package/build/assets/{syntax-highlighter-B92AFGMy.js → syntax-highlighter-BGDg_7w9.js} +1 -1
- package/build/assets/{task-list-tab-R3ac6m7O.js → task-list-tab-C19Q_JNf.js} +1 -1
- package/build/assets/{terminal-cMS3RgVE.js → terminal-BUpID2wS.js} +1 -1
- package/build/assets/{terminal-yqkNdEAx.js → terminal-CbuMRYal.js} +1 -1
- package/build/assets/{toggle-switch-BeSrbgCg.js → toggle-switch-CIioisto.js} +1 -1
- package/build/assets/{trash-2-wW5TWcdN.js → trash-2-CzDVN-Iw.js} +1 -1
- package/build/assets/{typography-iYhzLlHO.js → typography-D9tiHct7.js} +1 -1
- package/build/assets/{u-check-circle-DBEvndTS.js → u-check-circle-BKn1spCL.js} +1 -1
- package/build/assets/{u-edit-809W9D9T.js → u-edit-DAkcF52u.js} +1 -1
- package/build/assets/{u-robot-CJtSzy5X.js → u-robot-BvAOA2ZD.js} +1 -1
- package/build/assets/{use-acp-credential-form-DUxbxmbq.js → use-acp-credential-form-DJmmJKMo.js} +1 -1
- package/build/assets/{use-activate-agent-profile-CDHA52tC.js → use-activate-agent-profile-CeFfYwu_.js} +1 -1
- package/build/assets/{use-agent-profiles-TsOdIyw5.js → use-agent-profiles-BHLkLbRR.js} +1 -1
- package/build/assets/{use-breakpoint-DA7JqsRN.js → use-breakpoint-DWtihr9g.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-Bt1M71u5.js → use-can-manage-org-profiles-Bu4y8gSx.js} +1 -1
- package/build/assets/{use-click-outside-element-DKqpqEEm.js → use-click-outside-element-W6Os4Nlb.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-DWt7HCgf.js → use-cloud-current-user-id-QD9x3ySO.js} +1 -1
- package/build/assets/{use-config-CxlEdf_v.js → use-config-CPwqciXN.js} +1 -1
- package/build/assets/{use-create-conversation-nOJ6Um5h.js → use-create-conversation-DWaSVUOB.js} +1 -1
- package/build/assets/{use-create-secret-Dj5ang9x.js → use-create-secret-BsOfOLvg.js} +1 -1
- package/build/assets/use-is-authed-Bka89Xmm.js +1 -0
- package/build/assets/{use-is-creating-conversation-CAggrM75.js → use-is-creating-conversation-CVefC9Ns.js} +1 -1
- package/build/assets/{use-launch-skill-in-chat-DKzCTMt0.js → use-launch-skill-in-chat-BcKNjxxd.js} +1 -1
- package/build/assets/use-llm-profiles-CU8ah1pz.js +1 -0
- package/build/assets/use-manifest-capabilities-DBYPjyV6.js +1 -0
- package/build/assets/{use-onboarding-completion-gxQlcEy2.js → use-onboarding-completion-CtNJxkXG.js} +1 -1
- package/build/assets/{use-plugins-marketplace-CVO7sXYR.js → use-plugins-marketplace-ZEA-gyM9.js} +1 -1
- package/build/assets/use-save-agent-profile-DgI_Uz9a.js +1 -0
- package/build/assets/{use-save-settings-L3aMaDeS.js → use-save-settings-pSjRhD_m.js} +1 -1
- package/build/assets/{use-settings-8nt3DGxW.js → use-settings-BHWsOcIG.js} +1 -1
- package/build/assets/use-settings-nav-items-CQgkxUbV.js +16 -0
- package/build/assets/use-tracking-CGCsBWhg.js +3 -0
- package/build/assets/{use-user-conversation-BIIpGUgM.js → use-user-conversation-DRfEU8x0.js} +1 -1
- package/build/assets/{useInfiniteQuery-BLRVmVPU.js → useInfiniteQuery-DbCv0Jzd.js} +1 -1
- package/build/assets/{useMutation-CaSHLnX0.js → useMutation-ChpkYxI5.js} +1 -1
- package/build/assets/{useQueries--d_WWAzc.js → useQueries-Cjv3E8_1.js} +1 -1
- package/build/assets/useQuery-BCnzy4LX.js +1 -0
- package/build/assets/utils-DPQfkd-7.js +1 -0
- package/build/assets/{vendor-markdown-BML7QbqS.js → vendor-markdown-j0kYzV48.js} +1 -1
- package/build/assets/{vendor-styling-Bcgpimp9.js → vendor-styling-Ck5D_A2Q.js} +6 -6
- package/build/assets/{vendor~browser-jaN4ilxM.js → vendor~browser-C6uXH-dw.js} +2 -2
- package/build/assets/vendor~browser-DJ1pl_wn.js +47 -0
- package/build/assets/{vendor~browser-tab-_-VCXq8n.js → vendor~browser-tab-C5uuAxZX.js} +1 -1
- package/build/assets/vendor~entry.client-CgNUwtQL.js +1 -0
- package/build/assets/{vendor~entry.client-BcYIVQvB.js → vendor~entry.client-zSIea5EO.js} +2 -2
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~cy4jtuc2-rfV8mQ9m.js +1 -0
- package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~kv3pap4j-oGvLV0dO.js} +4 -4
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~lq5hicxx-cHFhpUBq.js +26 -0
- package/build/assets/{vendor~files-tab-C7RmQJwN.js → vendor~files-tab-C87pjSpi.js} +1 -1
- package/build/assets/{vendor~index-home~home~conversation-panel~conversation-Bqp1ZqJM.js → vendor~index-home~home~conversation-panel~conversation-DiXf0dkj.js} +1 -1
- package/build/assets/{vendor~conversation-panel~conversation~alert-banner-BNzz5FuZ.js → vendor~index-home~home~conversation-panel~conversation~alert-banner-B3qC_oj8.js} +1 -1
- package/build/assets/{vendor~launch-ChXCOGw8.js → vendor~launch-CHwEQG6e.js} +1 -1
- package/build/assets/vendor~module-DyG7x7JT.js +2 -0
- package/build/assets/{vendor~root-layout~conversation-panel~conversation-BCn8lzeG.js → vendor~root-layout~conversation-panel~conversation-DEzjR4K7.js} +1 -1
- package/build/assets/{vendor~root-layout~conversation-panel~conversation~shared-conversation-DRblkyXD.js → vendor~root-layout~conversation-panel~conversation~shared-conversation-DOuig0C0.js} +1 -1
- package/build/assets/vendor~root-layout~conversation-panel~conversation~skills-settings~automations-list~shared-~bovqqk8e-U-xdsAEx.js +1 -0
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-B_L-gcOG.js → vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-CjECvSl5.js} +1 -1
- package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-sjx0x5ac.js → vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CQR5Sa0H.js} +1 -1
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gxu4j2ea-Cwhh3zLe.js} +1 -1
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~dfc8ddxy-tTyxnjXT.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hjcjabwg-CuQhkiS7.js} +1 -1
- package/build/assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~9pstowjp-BOVIFA_g.js +73 -0
- package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~dufan6ng-Dtdw8H0q.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~ht43enc2-C0JXQb_q.js} +162 -54
- package/build/assets/{verification-settings-DBsnSXC3.js → verification-settings-BItwt998.js} +1 -1
- package/build/assets/wrench-B1_H-tL1.js +1 -0
- package/build/assets/x-RYDBg-e2.js +1 -0
- package/build/assets/{x-mark-jcTkPiOB.js → x-mark-BopmFoBq.js} +1 -1
- package/build/assets/zap-tbKDzCe3.js +1 -0
- package/build/index.html +4 -4
- package/build/locales/ar/openhands.json +108 -5
- package/build/locales/ca/openhands.json +108 -5
- package/build/locales/de/openhands.json +108 -5
- package/build/locales/en/openhands.json +108 -5
- package/build/locales/es/openhands.json +108 -5
- package/build/locales/fr/openhands.json +108 -5
- package/build/locales/it/openhands.json +108 -5
- package/build/locales/ja/openhands.json +108 -5
- package/build/locales/ko-KR/openhands.json +108 -5
- package/build/locales/no/openhands.json +108 -5
- package/build/locales/pt/openhands.json +108 -5
- package/build/locales/tr/openhands.json +108 -5
- package/build/locales/uk/openhands.json +108 -5
- package/build/locales/zh-CN/openhands.json +108 -5
- package/build/locales/zh-TW/openhands.json +108 -5
- package/build/mockServiceWorker.js +21 -9
- package/config/defaults.json +3 -3
- package/dist/api/agent-server-adapter.cjs +3 -3
- package/dist/api/agent-server-adapter.cjs.map +1 -1
- package/dist/api/agent-server-adapter.d.ts +32 -5
- package/dist/api/agent-server-adapter.js +120 -91
- package/dist/api/agent-server-adapter.js.map +1 -1
- package/dist/api/automation-service/automation-service.api.cjs +1 -1
- package/dist/api/automation-service/automation-service.api.cjs.map +1 -1
- package/dist/api/automation-service/automation-service.api.d.ts +5 -0
- package/dist/api/automation-service/automation-service.api.js +11 -0
- package/dist/api/automation-service/automation-service.api.js.map +1 -1
- package/dist/api/backend-registry/active-store.cjs +1 -1
- package/dist/api/backend-registry/active-store.cjs.map +1 -1
- package/dist/api/backend-registry/active-store.js +36 -31
- package/dist/api/backend-registry/active-store.js.map +1 -1
- package/dist/api/backend-registry/url-selection.cjs +2 -0
- package/dist/api/backend-registry/url-selection.cjs.map +1 -0
- package/dist/api/backend-registry/url-selection.d.ts +31 -0
- package/dist/api/backend-registry/url-selection.js +29 -0
- package/dist/api/backend-registry/url-selection.js.map +1 -0
- package/dist/api/cloud/conversation-service.api.cjs +1 -1
- package/dist/api/cloud/conversation-service.api.cjs.map +1 -1
- package/dist/api/cloud/conversation-service.api.d.ts +19 -2
- package/dist/api/cloud/conversation-service.api.js +51 -47
- package/dist/api/cloud/conversation-service.api.js.map +1 -1
- package/dist/api/conversation-file-upload.api.cjs +1 -1
- package/dist/api/conversation-file-upload.api.js +10 -10
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.cjs.map +1 -1
- package/dist/api/conversation-service/agent-server-conversation-service.api.js +55 -61
- package/dist/api/conversation-service/agent-server-conversation-service.api.js.map +1 -1
- package/dist/api/event-service/event-service.api.cjs +1 -1
- package/dist/api/event-service/event-service.api.js +12 -12
- package/dist/api/launch-child-conversation-client-tool.cjs +47 -0
- package/dist/api/launch-child-conversation-client-tool.cjs.map +1 -0
- package/dist/api/launch-child-conversation-client-tool.d.ts +3 -0
- package/dist/api/launch-child-conversation-client-tool.js +93 -0
- package/dist/api/launch-child-conversation-client-tool.js.map +1 -0
- package/dist/api/mcp-service/mcp-redacted-credentials.cjs +1 -1
- package/dist/api/mcp-service/mcp-redacted-credentials.cjs.map +1 -1
- package/dist/api/mcp-service/mcp-redacted-credentials.d.ts +3 -2
- package/dist/api/mcp-service/mcp-redacted-credentials.js +32 -27
- package/dist/api/mcp-service/mcp-redacted-credentials.js.map +1 -1
- package/dist/api/mcp-service/mcp-service.api.cjs +1 -1
- package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -1
- package/dist/api/mcp-service/mcp-service.api.js +19 -19
- package/dist/api/mcp-service/mcp-service.api.js.map +1 -1
- package/dist/api/open-hands.types.d.ts +1 -1
- package/dist/api/settings-service/settings-service.api.cjs +1 -1
- package/dist/api/settings-service/settings-service.api.cjs.map +1 -1
- package/dist/api/settings-service/settings-service.api.d.ts +10 -0
- package/dist/api/settings-service/settings-service.api.js +90 -100
- package/dist/api/settings-service/settings-service.api.js.map +1 -1
- package/dist/api/skills-service.cjs +1 -1
- package/dist/api/skills-service.cjs.map +1 -1
- package/dist/api/skills-service.js +1 -0
- package/dist/api/skills-service.js.map +1 -1
- package/dist/api/workspace-upload-path.cjs +1 -1
- package/dist/api/workspace-upload-path.js +8 -8
- package/dist/assets/chevron-left.d.ts +1 -1
- package/dist/assets/chevron-right.d.ts +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js +24 -18
- package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +5 -0
- package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs +2 -2
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.cjs.map +1 -1
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js +11 -7
- package/dist/components/conversation-events/chat/event-content-helpers/should-render-event.js.map +1 -1
- package/dist/components/conversation-events/chat/event-message-components/collapsible-thinking.d.ts +2 -1
- package/dist/components/conversation-events/chat/event-message-components/critic-result-display.d.ts +2 -1
- package/dist/components/conversation-events/chat/event-message-components/error-event-message.d.ts +2 -1
- package/dist/components/conversation-events/chat/event-message-components/event-group.d.ts +1 -1
- package/dist/components/conversation-events/chat/event-message-components/finish-event-message.d.ts +1 -1
- package/dist/components/conversation-events/chat/event-message-components/generic-event-message-wrapper.d.ts +1 -1
- package/dist/components/conversation-events/chat/event-message-components/observation-pair-event-message.d.ts +2 -1
- package/dist/components/conversation-events/chat/event-message-components/skill-item-expanded.d.ts +1 -1
- package/dist/components/conversation-events/chat/event-message-components/skill-ready-content-list.d.ts +2 -1
- package/dist/components/conversation-events/chat/event-message-components/thought-event-message.d.ts +1 -1
- package/dist/components/conversation-events/chat/event-message-components/user-assistant-event-message.d.ts +2 -1
- package/dist/components/conversation-events/chat/event-message.d.ts +2 -1
- package/dist/components/conversation-events/chat/task-tracking/task-item.d.ts +1 -1
- package/dist/components/conversation-events/chat/task-tracking/task-list-section.d.ts +1 -1
- package/dist/components/features/alerts/alert-banner.d.ts +1 -1
- package/dist/components/features/analytics/telemetry-consent-banner.d.ts +2 -1
- package/dist/components/features/automations/add-automation-modal.d.ts +1 -1
- package/dist/components/features/automations/automation-card-skeleton.d.ts +1 -1
- package/dist/components/features/automations/automation-card.d.ts +9 -1
- package/dist/components/features/automations/automation-group.d.ts +9 -1
- package/dist/components/features/automations/automation-health-badge.d.ts +8 -0
- package/dist/components/features/automations/automation-list-row.d.ts +3 -1
- package/dist/components/features/automations/automation-run-insights.d.ts +17 -0
- package/dist/components/features/automations/automation-view-toggle.d.ts +1 -1
- package/dist/components/features/automations/backend-not-configured.d.ts +1 -1
- package/dist/components/features/automations/create-instructions.d.ts +2 -2
- package/dist/components/features/automations/dashboard/automations-dashboard-controls.d.ts +18 -0
- package/dist/components/features/automations/dashboard/automations-filtered-empty-state.d.ts +9 -0
- package/dist/components/features/automations/dashboard/use-automation-sub-page-nav.d.ts +12 -0
- package/dist/components/features/automations/delete-confirmation-modal.d.ts +1 -1
- package/dist/components/features/automations/detail/active-status-badge.d.ts +1 -1
- package/dist/components/features/automations/detail/activity-log-item.d.ts +1 -1
- package/dist/components/features/automations/detail/activity-log-section.d.ts +3 -1
- package/dist/components/features/automations/detail/activity-section.d.ts +1 -1
- package/dist/components/features/automations/detail/back-link.d.ts +1 -1
- package/dist/components/features/automations/detail/branch-badge.d.ts +1 -1
- package/dist/components/features/automations/detail/config-field.d.ts +1 -1
- package/dist/components/features/automations/detail/configuration-section.d.ts +1 -1
- package/dist/components/features/automations/detail/debug-automation-button.d.ts +1 -1
- package/dist/components/features/automations/detail/detail-header.d.ts +1 -1
- package/dist/components/features/automations/detail/detail-skeleton.d.ts +1 -1
- package/dist/components/features/automations/detail/edit-automation-modal.d.ts +1 -1
- package/dist/components/features/automations/detail/not-found-state.d.ts +1 -1
- package/dist/components/features/automations/detail/plugin-chip.d.ts +1 -1
- package/dist/components/features/automations/detail/plugins-section.d.ts +1 -1
- package/dist/components/features/automations/detail/prompt-section.d.ts +2 -1
- package/dist/components/features/automations/detail/run-logs-modal.d.ts +1 -1
- package/dist/components/features/automations/detail/run-status-badge.d.ts +10 -1
- package/dist/components/features/automations/detail/section-card.d.ts +1 -1
- package/dist/components/features/automations/empty-state.d.ts +1 -1
- package/dist/components/features/automations/error-state.d.ts +1 -1
- package/dist/components/features/automations/import-automation-modal.d.ts +1 -1
- package/dist/components/features/automations/kebab-menu-item-content.d.ts +1 -1
- package/dist/components/features/automations/kebab-menu.d.ts +1 -1
- package/dist/components/features/automations/metadata-chip.d.ts +1 -1
- package/dist/components/features/automations/recommended-automations-launcher.d.ts +1 -1
- package/dist/components/features/automations/recommended-automations-section.d.ts +1 -1
- package/dist/components/features/automations/responder-deployment-modal.d.ts +1 -1
- package/dist/components/features/automations/search-input.d.ts +1 -1
- package/dist/components/features/automations/status-badge.d.ts +1 -1
- package/dist/components/features/automations/turn-off-confirmation-modal.d.ts +8 -0
- package/dist/components/features/automations/view-menu-item-content.d.ts +1 -1
- package/dist/components/features/backends/add-backend-modal.d.ts +1 -1
- package/dist/components/features/backends/api-key-entry-screen.d.ts +2 -1
- package/dist/components/features/backends/backend-form-modal.d.ts +3 -3
- package/dist/components/features/backends/backend-row.d.ts +1 -1
- package/dist/components/features/backends/backend-selector.d.ts +2 -1
- package/dist/components/features/backends/backend-status-dot.d.ts +2 -1
- package/dist/components/features/backends/backend-version.d.ts +1 -1
- package/dist/components/features/backends/device-flow-auth.d.ts +1 -1
- package/dist/components/features/backends/manage-backends-modal.d.ts +2 -1
- package/dist/components/features/browser/browser-chrome-bar.d.ts +1 -1
- package/dist/components/features/browser/browser-snapshot.d.ts +1 -1
- package/dist/components/features/browser/browser.d.ts +1 -1
- package/dist/components/features/browser/empty-browser-message.d.ts +1 -1
- package/dist/components/features/chat/btw-messages.d.ts +1 -1
- package/dist/components/features/chat/change-agent-button.d.ts +2 -1
- package/dist/components/features/chat/change-agent-context-menu.d.ts +1 -1
- package/dist/components/features/chat/chat-action-tooltip.d.ts +1 -1
- package/dist/components/features/chat/chat-add-file-button.d.ts +2 -1
- package/dist/components/features/chat/chat-interface.d.ts +2 -1
- package/dist/components/features/chat/chat-message.d.ts +1 -1
- package/dist/components/features/chat/chat-messages-skeleton.d.ts +2 -1
- package/dist/components/features/chat/chat-play-button.d.ts +1 -1
- package/dist/components/features/chat/chat-send-button.d.ts +1 -1
- package/dist/components/features/chat/chat-status-indicator.d.ts +1 -1
- package/dist/components/features/chat/chat-stop-button.d.ts +1 -1
- package/dist/components/features/chat/chat-suggestions.d.ts +1 -1
- package/dist/components/features/chat/components/chat-input-actions.d.ts +2 -1
- package/dist/components/features/chat/components/chat-input-container.d.ts +1 -1
- package/dist/components/features/chat/components/chat-input-field.d.ts +1 -1
- package/dist/components/features/chat/components/chat-input-grip.d.ts +1 -1
- package/dist/components/features/chat/components/chat-input-llm-profile-picker.d.ts +3 -2
- package/dist/components/features/chat/components/chat-input-model.d.ts +3 -2
- package/dist/components/features/chat/components/chat-input-profile-picker.d.ts +1 -1
- package/dist/components/features/chat/components/chat-input-row.d.ts +1 -1
- package/dist/components/features/chat/components/hidden-file-input.d.ts +1 -1
- package/dist/components/features/chat/components/slash-command-menu.d.ts +2 -1
- package/dist/components/features/chat/confirmation-mode-enabled.d.ts +1 -1
- package/dist/components/features/chat/custom-chat-input.d.ts +1 -1
- package/dist/components/features/chat/drag-over.d.ts +1 -1
- package/dist/components/features/chat/error-message-banner.d.ts +2 -1
- package/dist/components/features/chat/error-message.d.ts +2 -1
- package/dist/components/features/chat/generic-event-message.d.ts +1 -1
- package/dist/components/features/chat/git-control-bar-branch-button.d.ts +1 -1
- package/dist/components/features/chat/git-control-bar-pr-button.d.ts +1 -1
- package/dist/components/features/chat/git-control-bar-pull-button.d.ts +1 -1
- package/dist/components/features/chat/git-control-bar-push-button.d.ts +1 -1
- package/dist/components/features/chat/git-control-bar-repo-button.d.ts +1 -1
- package/dist/components/features/chat/git-control-bar-tooltip-wrapper.d.ts +1 -1
- package/dist/components/features/chat/git-control-bar.d.ts +1 -1
- package/dist/components/features/chat/git-external-link-icon.d.ts +1 -1
- package/dist/components/features/chat/goal-status-banner.d.ts +1 -1
- package/dist/components/features/chat/goal-status-content.d.ts +1 -1
- package/dist/components/features/chat/got-it-button.d.ts +1 -1
- package/dist/components/features/chat/interactive-chat-box.d.ts +1 -1
- package/dist/components/features/chat/model-messages.d.ts +2 -1
- package/dist/components/features/chat/mono-component.d.ts +1 -1
- package/dist/components/features/chat/open-repository-modal.d.ts +2 -1
- package/dist/components/features/chat/pasted-image-upload-as-file-button.d.ts +1 -1
- package/dist/components/features/chat/path-component.d.ts +1 -1
- package/dist/components/features/chat/pending-stop-icon.d.ts +1 -1
- package/dist/components/features/chat/pending-user-messages.d.ts +2 -1
- package/dist/components/features/chat/plan-preview.d.ts +1 -1
- package/dist/components/features/chat/remove-file-button.d.ts +1 -1
- package/dist/components/features/chat/skill-install-restart-banner.d.ts +1 -1
- package/dist/components/features/chat/success-indicator.d.ts +1 -1
- package/dist/components/features/chat/task-tracking/status-badge.d.ts +1 -1
- package/dist/components/features/chat/task-tracking/status-icon.d.ts +1 -1
- package/dist/components/features/chat/task-tracking/task-item.d.ts +1 -1
- package/dist/components/features/chat/task-tracking/task-list-section.d.ts +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/code-block.d.ts +2 -1
- package/dist/components/features/chat/tool-visualizers/primitives/diff-view.d.ts +2 -1
- package/dist/components/features/chat/tool-visualizers/primitives/file-path-chip.d.ts +2 -1
- package/dist/components/features/chat/tool-visualizers/primitives/key-value-grid.d.ts +1 -1
- package/dist/components/features/chat/tool-visualizers/primitives/output-pane.d.ts +2 -1
- package/dist/components/features/chat/typing-indicator.d.ts +1 -1
- package/dist/components/features/chat/uploaded-file.d.ts +1 -1
- package/dist/components/features/chat/uploaded-files.d.ts +1 -1
- package/dist/components/features/chat/uploaded-image.d.ts +2 -1
- package/dist/components/features/chat/user-message-body.d.ts +2 -2
- package/dist/components/features/chat/waiting-for-runtime-message.d.ts +1 -1
- package/dist/components/features/chat/workspace-mode-icon.d.ts +1 -1
- package/dist/components/features/chat/workspace-mode-selector.d.ts +1 -1
- package/dist/components/features/command-menu/command-menu-trigger.d.ts +2 -1
- package/dist/components/features/context-menu/archived-disabled-tooltip.d.ts +1 -1
- package/dist/components/features/context-menu/context-menu-icon-text-with-description.d.ts +1 -1
- package/dist/components/features/context-menu/context-menu-icon-text.d.ts +1 -1
- package/dist/components/features/context-menu/context-menu-list-item.cjs +1 -1
- package/dist/components/features/context-menu/context-menu-list-item.cjs.map +1 -1
- package/dist/components/features/context-menu/context-menu-list-item.d.ts +2 -1
- package/dist/components/features/context-menu/context-menu-list-item.js +2 -1
- package/dist/components/features/context-menu/context-menu-list-item.js.map +1 -1
- package/dist/components/features/controls/agent-loading.d.ts +1 -1
- package/dist/components/features/controls/agent-status.d.ts +1 -1
- package/dist/components/features/controls/git-tools-submenu.d.ts +1 -1
- package/dist/components/features/controls/macros-submenu.d.ts +1 -1
- package/dist/components/features/controls/server-status-context-menu-icon-text.d.ts +1 -1
- package/dist/components/features/controls/server-status-context-menu.d.ts +1 -1
- package/dist/components/features/controls/server-status.d.ts +1 -1
- package/dist/components/features/controls/tools-context-menu-icon-text.d.ts +1 -1
- package/dist/components/features/controls/tools-context-menu.d.ts +1 -1
- package/dist/components/features/controls/tools.d.ts +2 -1
- package/dist/components/features/conversation/conversation-loading.d.ts +1 -1
- package/dist/components/features/conversation/conversation-main/chat-interface-wrapper.d.ts +1 -1
- package/dist/components/features/conversation/conversation-main/conversation-main.d.ts +1 -1
- package/dist/components/features/conversation/conversation-main/conversation-mobile-panel-page.d.ts +2 -1
- package/dist/components/features/conversation/conversation-name-context-menu-icon-text.d.ts +1 -1
- package/dist/components/features/conversation/conversation-name-context-menu.d.ts +1 -1
- package/dist/components/features/conversation/conversation-name-with-status.d.ts +2 -1
- package/dist/components/features/conversation/conversation-name.d.ts +2 -1
- package/dist/components/features/conversation/conversation-tab-empty-state.d.ts +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content-crossfade.d.ts +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.d.ts +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/suspense-pending-fallback.d.ts +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/tab-container.d.ts +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/tab-content-area.d.ts +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-content/tab-wrapper.d.ts +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tab-nav.d.ts +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.d.ts +1 -1
- package/dist/components/features/conversation/conversation-tabs/conversation-tabs.d.ts +1 -1
- package/dist/components/features/conversation/conversation-tabs/drawer-vscode-link.d.ts +1 -1
- package/dist/components/features/conversation/metrics-modal/context-window-section.d.ts +1 -1
- package/dist/components/features/conversation/metrics-modal/cost-section.d.ts +1 -1
- package/dist/components/features/conversation/metrics-modal/empty-state.d.ts +1 -1
- package/dist/components/features/conversation/metrics-modal/metric-row.d.ts +1 -1
- package/dist/components/features/conversation/metrics-modal/metrics-modal-header.d.ts +1 -1
- package/dist/components/features/conversation/metrics-modal/metrics-modal.d.ts +1 -1
- package/dist/components/features/conversation/metrics-modal/usage-section.d.ts +1 -1
- package/dist/components/features/conversation/right-panel-toggle.d.ts +1 -1
- package/dist/components/features/conversation/transcript-export-modal.d.ts +2 -1
- package/dist/components/features/conversation-panel/budget-display.d.ts +2 -1
- package/dist/components/features/conversation-panel/budget-progress-bar.d.ts +1 -1
- package/dist/components/features/conversation-panel/budget-usage-text.d.ts +2 -1
- package/dist/components/features/conversation-panel/cloud-new-conversation-menu.d.ts +1 -1
- package/dist/components/features/conversation-panel/compact-conversation-row.cjs +1 -1
- package/dist/components/features/conversation-panel/compact-conversation-row.cjs.map +1 -1
- package/dist/components/features/conversation-panel/compact-conversation-row.d.ts +2 -1
- package/dist/components/features/conversation-panel/compact-conversation-row.js +38 -37
- package/dist/components/features/conversation-panel/compact-conversation-row.js.map +1 -1
- package/dist/components/features/conversation-panel/confirm-delete-modal.d.ts +1 -1
- package/dist/components/features/conversation-panel/confirm-stop-modal.d.ts +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-actions.d.ts +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-context-menu.d.ts +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs +1 -2
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.d.ts +3 -9
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js +48 -51
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-footer.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-header.d.ts +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.cjs +2 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.cjs.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.d.ts +12 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.js +6 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-meta-chip.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.d.ts +16 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.js +95 -78
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-preview.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-skeleton.d.ts +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card-title.d.ts +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-card.d.ts +2 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.d.ts +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.js +40 -38
- package/dist/components/features/conversation-panel/conversation-card/conversation-repo-link.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-status-badges.d.ts +1 -1
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.cjs +2 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.cjs.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.d.ts +14 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.js +167 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-chips.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.cjs +2 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.cjs.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.d.ts +63 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.js +66 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-display.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.cjs +2 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.cjs.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.d.ts +15 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.js +117 -0
- package/dist/components/features/conversation-panel/conversation-card/conversation-tag-icons.js.map +1 -0
- package/dist/components/features/conversation-panel/conversation-card/no-repository.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-card/no-repository.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-card/no-repository.d.ts +1 -1
- package/dist/components/features/conversation-panel/conversation-card/no-repository.js +30 -19
- package/dist/components/features/conversation-panel/conversation-card/no-repository.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-list.d.ts +1 -1
- package/dist/components/features/conversation-panel/conversation-group-folder-row.d.ts +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.d.ts +7 -2
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js +146 -104
- package/dist/components/features/conversation-panel/conversation-panel-filter-menu.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.d.ts +20 -0
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js +53 -27
- package/dist/components/features/conversation-panel/conversation-panel-list-helpers.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-new-thread-picker.d.ts +1 -1
- package/dist/components/features/conversation-panel/conversation-panel-pinned-section.d.ts +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.cjs +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.cjs.map +1 -1
- package/dist/components/features/conversation-panel/conversation-panel.d.ts +2 -1
- package/dist/components/features/conversation-panel/conversation-panel.js +169 -155
- package/dist/components/features/conversation-panel/conversation-panel.js.map +1 -1
- package/dist/components/features/conversation-panel/conversation-status-dot.d.ts +1 -1
- package/dist/components/features/conversation-panel/exit-conversation-modal.d.ts +1 -1
- package/dist/components/features/conversation-panel/hook-event-item.d.ts +1 -1
- package/dist/components/features/conversation-panel/hook-matcher-content.d.ts +1 -1
- package/dist/components/features/conversation-panel/hooks-empty-state.d.ts +1 -1
- package/dist/components/features/conversation-panel/hooks-loading-state.d.ts +1 -1
- package/dist/components/features/conversation-panel/hooks-modal-header.d.ts +1 -1
- package/dist/components/features/conversation-panel/hooks-modal.d.ts +1 -1
- package/dist/components/features/conversation-panel/local-new-conversation-menu.d.ts +1 -1
- package/dist/components/features/conversation-panel/menu-heading.d.ts +1 -1
- package/dist/components/features/conversation-panel/menu-row.d.ts +1 -1
- package/dist/components/features/conversation-panel/menu-separator.d.ts +1 -1
- package/dist/components/features/conversation-panel/new-conversation-button.d.ts +2 -1
- package/dist/components/features/conversation-panel/plugins-modal.d.ts +1 -1
- package/dist/components/features/conversation-panel/runtime-waiting-state.d.ts +1 -1
- package/dist/components/features/conversation-panel/skill-content.d.ts +1 -1
- package/dist/components/features/conversation-panel/skill-item.d.ts +1 -1
- package/dist/components/features/conversation-panel/skill-triggers.d.ts +1 -1
- package/dist/components/features/conversation-panel/skills-empty-state.d.ts +1 -1
- package/dist/components/features/conversation-panel/skills-loading-state.d.ts +1 -1
- package/dist/components/features/conversation-panel/skills-modal-header.d.ts +1 -1
- package/dist/components/features/conversation-panel/skills-modal-section.d.ts +1 -1
- package/dist/components/features/conversation-panel/skills-modal.d.ts +1 -1
- package/dist/components/features/conversation-panel/start-task-card/start-task-card-footer.d.ts +1 -1
- package/dist/components/features/conversation-panel/start-task-card/start-task-card-header.d.ts +1 -1
- package/dist/components/features/conversation-panel/start-task-card/start-task-card.d.ts +1 -1
- package/dist/components/features/conversation-panel/start-task-card/start-task-status-badge.d.ts +1 -1
- package/dist/components/features/conversation-panel/start-task-card/start-task-status-indicator.d.ts +1 -1
- package/dist/components/features/conversation-panel/system-message-modal/empty-tools-state.d.ts +1 -1
- package/dist/components/features/conversation-panel/system-message-modal/system-message-content.d.ts +1 -1
- package/dist/components/features/conversation-panel/system-message-modal/system-message-header.d.ts +1 -1
- package/dist/components/features/conversation-panel/system-message-modal/tab-button.d.ts +1 -1
- package/dist/components/features/conversation-panel/system-message-modal/tab-content.d.ts +1 -1
- package/dist/components/features/conversation-panel/system-message-modal/tab-navigation.d.ts +1 -1
- package/dist/components/features/conversation-panel/system-message-modal/toggle-button.d.ts +1 -1
- package/dist/components/features/conversation-panel/system-message-modal/tool-item.d.ts +1 -1
- package/dist/components/features/conversation-panel/system-message-modal/tool-parameters.d.ts +1 -1
- package/dist/components/features/conversation-panel/system-message-modal/tools-list.d.ts +1 -1
- package/dist/components/features/conversation-panel/system-message-modal.d.ts +1 -1
- package/dist/components/features/diff-viewer/commit-list.d.ts +2 -1
- package/dist/components/features/diff-viewer/commit-row.d.ts +2 -1
- package/dist/components/features/diff-viewer/diff-drawer-icon.d.ts +1 -1
- package/dist/components/features/diff-viewer/editor-container.d.ts +1 -1
- package/dist/components/features/diff-viewer/empty-changes-message.d.ts +1 -1
- package/dist/components/features/diff-viewer/file-diff-viewer.d.ts +2 -1
- package/dist/components/features/diff-viewer/loading-spinner.d.ts +1 -1
- package/dist/components/features/files/file-item.d.ts +1 -1
- package/dist/components/features/files/file-list.d.ts +2 -1
- package/dist/components/features/files-tab/file-content-viewer.d.ts +1 -1
- package/dist/components/features/files-tab/file-quick-row.d.ts +1 -1
- package/dist/components/features/files-tab/file-tree-view.d.ts +1 -1
- package/dist/components/features/files-tab/highlighted-source-view.d.ts +1 -1
- package/dist/components/features/files-tab/no-file-selected-message.d.ts +1 -1
- package/dist/components/features/files-tab/segmented-toggle.d.ts +1 -1
- package/dist/components/features/files-tab/tree-node.d.ts +1 -1
- package/dist/components/features/home/featured-automations/automation-health-indicator.d.ts +11 -0
- package/dist/components/features/home/featured-automations/automation-run-activity-metrics.d.ts +18 -0
- package/dist/components/features/home/featured-automations/automation-run-activity-sparkline.d.ts +14 -0
- package/dist/components/features/home/featured-automations/automation-run-health.d.ts +25 -0
- package/dist/components/features/home/featured-automations/build-home-automation-menu-items.d.ts +39 -0
- package/dist/components/features/home/featured-automations/build-pinned-automation-menu-items.d.ts +22 -0
- package/dist/components/features/home/featured-automations/home-automation-activity.d.ts +23 -0
- package/dist/components/features/home/featured-automations/home-automation-menu.d.ts +13 -0
- package/dist/components/features/home/featured-automations/home-automation-run-tooltip.d.ts +12 -0
- package/dist/components/features/home/featured-automations/pinned-automation-card.d.ts +21 -0
- package/dist/components/features/home/featured-automations/pinned-automations-dashboard.d.ts +6 -0
- package/dist/components/features/home/featured-automations/running-automations-list.d.ts +6 -0
- package/dist/components/features/home/git-branch-dropdown/branch-dropdown-menu.d.ts +1 -1
- package/dist/components/features/home/git-branch-dropdown/git-branch-dropdown.d.ts +2 -1
- package/dist/components/features/home/git-provider-dropdown/git-provider-dropdown.d.ts +2 -1
- package/dist/components/features/home/git-repo-dropdown/git-repo-dropdown.d.ts +2 -1
- package/dist/components/features/home/home-chat-launcher.d.ts +1 -1
- package/dist/components/features/home/home-git-control-bar-preview.d.ts +1 -1
- package/dist/components/features/home/home-header/guide-message.d.ts +1 -1
- package/dist/components/features/home/home-header/home-header-title.d.ts +1 -1
- package/dist/components/features/home/home-header/home-header.d.ts +1 -1
- package/dist/components/features/home/llm-not-configured-banner.d.ts +1 -1
- package/dist/components/features/home/new-conversation/create-conversation-button.d.ts +1 -1
- package/dist/components/features/home/new-conversation/new-conversation.d.ts +1 -1
- package/dist/components/features/home/new-conversation.d.ts +1 -1
- package/dist/components/features/home/open-launcher-button.d.ts +1 -1
- package/dist/components/features/home/open-repository-dialog.d.ts +1 -1
- package/dist/components/features/home/open-workspace-dialog.d.ts +1 -1
- package/dist/components/features/home/repo-selection-form.d.ts +2 -1
- package/dist/components/features/home/shared/clear-button.d.ts +2 -1
- package/dist/components/features/home/shared/dropdown-item.d.ts +1 -1
- package/dist/components/features/home/shared/empty-state.d.ts +2 -1
- package/dist/components/features/home/shared/error-message.d.ts +2 -1
- package/dist/components/features/home/shared/generic-dropdown-menu.d.ts +1 -1
- package/dist/components/features/home/shared/loading-spinner.d.ts +2 -1
- package/dist/components/features/home/shared/toggle-button.d.ts +1 -1
- package/dist/components/features/home/tasks/task-card.d.ts +1 -1
- package/dist/components/features/home/tasks/task-group.d.ts +1 -1
- package/dist/components/features/home/tasks/task-issue-number.d.ts +1 -1
- package/dist/components/features/home/tasks/task-item-title.d.ts +1 -1
- package/dist/components/features/home/tasks/task-suggestions-skeleton.d.ts +1 -1
- package/dist/components/features/home/tasks/task-suggestions.d.ts +1 -1
- package/dist/components/features/home/workspace-dropdown/folder-browser-modal.d.ts +2 -1
- package/dist/components/features/home/workspace-dropdown/manage-workspaces-modal.d.ts +2 -1
- package/dist/components/features/home/workspace-dropdown/workspace-dropdown.d.ts +2 -1
- package/dist/components/features/home/workspace-selection-form.d.ts +2 -1
- package/dist/components/features/images/image-carousel.d.ts +2 -1
- package/dist/components/features/images/image-preview.d.ts +1 -1
- package/dist/components/features/images/thumbnail.d.ts +1 -1
- package/dist/components/features/launch/plugin-launch-modal.d.ts +2 -1
- package/dist/components/features/launch/plugin-launch-parameter-input.d.ts +1 -1
- package/dist/components/features/launch/plugin-launch-plugin-section.d.ts +1 -1
- package/dist/components/features/manifest/manifest-form-field.d.ts +1 -1
- package/dist/components/features/manifest/manifest-icons.d.ts +13 -0
- package/dist/components/features/manifest/manifest-overview-tiles.d.ts +19 -0
- package/dist/components/features/manifest/manifest-prerequisites-step.d.ts +1 -1
- package/dist/components/features/manifest/manifest-review-step.d.ts +1 -1
- package/dist/components/features/manifest/manifest-setup-dialog.d.ts +1 -1
- package/dist/components/features/manifest/manifest-subpage-layout.d.ts +23 -0
- package/dist/components/features/markdown/anchor.d.ts +1 -1
- package/dist/components/features/markdown/blockquote.d.ts +1 -1
- package/dist/components/features/markdown/code.d.ts +1 -1
- package/dist/components/features/markdown/headings.d.ts +6 -6
- package/dist/components/features/markdown/horizontal-rule.d.ts +1 -1
- package/dist/components/features/markdown/list.d.ts +3 -3
- package/dist/components/features/markdown/markdown-renderer.d.ts +1 -1
- package/dist/components/features/markdown/markdown-table-scroll.d.ts +1 -1
- package/dist/components/features/markdown/paragraph.d.ts +1 -1
- package/dist/components/features/markdown/plan-components.d.ts +36 -36
- package/dist/components/features/markdown/table.d.ts +3 -3
- package/dist/components/features/mcp-logo-badge.d.ts +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.d.ts +2 -1
- package/dist/components/features/mcp-page/custom-server-editor.js +5 -0
- package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
- package/dist/components/features/mcp-page/install-server-modal.cjs +1 -1
- package/dist/components/features/mcp-page/install-server-modal.cjs.map +1 -1
- package/dist/components/features/mcp-page/install-server-modal.d.ts +2 -1
- package/dist/components/features/mcp-page/install-server-modal.js +117 -118
- package/dist/components/features/mcp-page/install-server-modal.js.map +1 -1
- package/dist/components/features/mcp-page/installed-server-card.d.ts +2 -1
- package/dist/components/features/mcp-page/installed-servers-section.d.ts +1 -1
- package/dist/components/features/mcp-page/marketplace-card.d.ts +1 -1
- package/dist/components/features/mcp-page/marketplace-section.d.ts +1 -1
- package/dist/components/features/mcp-page/mcp-logo-stack-badge.d.ts +1 -1
- package/dist/components/features/mcp-page/mcp-section-filter-dropdown.d.ts +1 -1
- package/dist/components/features/mcp-page/mcp-server-health.d.ts +2 -1
- package/dist/components/features/mcp-page/mcp-toolbar.d.ts +1 -1
- package/dist/components/features/mcp-page/save-as-secret-toggle.d.ts +1 -1
- package/dist/components/features/onboarding/onboarding-host.d.ts +1 -1
- package/dist/components/features/onboarding/onboarding-modal.d.ts +2 -1
- package/dist/components/features/onboarding/onboarding-progress-bar.d.ts +1 -1
- package/dist/components/features/onboarding/steps/check-backend-step.d.ts +2 -1
- package/dist/components/features/onboarding/steps/choose-agent-step.d.ts +3 -2
- package/dist/components/features/onboarding/steps/say-hello-step.d.ts +2 -1
- package/dist/components/features/onboarding/steps/setup-acp-secrets-step.d.ts +2 -1
- package/dist/components/features/onboarding/steps/setup-llm-step.d.ts +2 -1
- package/dist/components/features/plugins/add-plugin-modal.d.ts +2 -1
- package/dist/components/features/plugins/plugin-card.d.ts +2 -1
- package/dist/components/features/plugins/plugin-detail-modal.d.ts +1 -1
- package/dist/components/features/plugins/plugin-files-section.d.ts +2 -1
- package/dist/components/features/plugins/plugin-picker-card.d.ts +1 -1
- package/dist/components/features/plugins/plugin-picker-modal.d.ts +1 -1
- package/dist/components/features/plugins/plugin-picker-trigger.d.ts +1 -1
- package/dist/components/features/plugins/plugin-picker.d.ts +1 -1
- package/dist/components/features/plugins/plugins-toolbar.d.ts +1 -1
- package/dist/components/features/settings/acp-auth-status-banner.d.ts +1 -1
- package/dist/components/features/settings/acp-conflict-warnings.d.ts +2 -1
- package/dist/components/features/settings/acp-credentials-section.d.ts +1 -1
- package/dist/components/features/settings/acp-secret-field.d.ts +2 -1
- package/dist/components/features/settings/agent-canvas-update-card.cjs +1 -1
- package/dist/components/features/settings/agent-canvas-update-card.cjs.map +1 -1
- package/dist/components/features/settings/agent-canvas-update-card.d.ts +10 -5
- package/dist/components/features/settings/agent-canvas-update-card.js +223 -149
- package/dist/components/features/settings/agent-canvas-update-card.js.map +1 -1
- package/dist/components/features/settings/agent-canvas-version-modal.cjs +2 -0
- package/dist/components/features/settings/agent-canvas-version-modal.cjs.map +1 -0
- package/dist/components/features/settings/agent-canvas-version-modal.d.ts +11 -0
- package/dist/components/features/settings/agent-canvas-version-modal.js +166 -0
- package/dist/components/features/settings/agent-canvas-version-modal.js.map +1 -0
- package/dist/components/features/settings/agent-canvas-version-tile.cjs +2 -0
- package/dist/components/features/settings/agent-canvas-version-tile.cjs.map +1 -0
- package/dist/components/features/settings/agent-canvas-version-tile.d.ts +13 -0
- package/dist/components/features/settings/agent-canvas-version-tile.js +60 -0
- package/dist/components/features/settings/agent-canvas-version-tile.js.map +1 -0
- package/dist/components/features/settings/agent-profiles/agent-profile-actions-menu.d.ts +1 -1
- package/dist/components/features/settings/agent-profiles/agent-profile-row.d.ts +1 -1
- package/dist/components/features/settings/agent-profiles/agent-profiles-body.d.ts +1 -1
- package/dist/components/features/settings/agent-profiles/agent-profiles-local-view.d.ts +1 -1
- package/dist/components/features/settings/agent-profiles/agent-profiles-manager.d.ts +1 -1
- package/dist/components/features/settings/agent-profiles/delete-agent-profile-modal.d.ts +1 -1
- package/dist/components/features/settings/agent-server-onboarding.d.ts +2 -1
- package/dist/components/features/settings/api-key-modal-base.d.ts +1 -1
- package/dist/components/features/settings/app-settings/app-settings-inputs-skeleton.d.ts +1 -1
- package/dist/components/features/settings/app-settings/language-input.d.ts +1 -1
- package/dist/components/features/settings/app-settings/theme-input.d.ts +2 -1
- package/dist/components/features/settings/backend-synced-settings-badge.d.ts +1 -1
- package/dist/components/features/settings/banner-message.d.ts +1 -1
- package/dist/components/features/settings/cloud-settings-link.d.ts +1 -1
- package/dist/components/features/settings/input-skeleton.d.ts +1 -1
- package/dist/components/features/settings/integrations-settings-link.d.ts +1 -1
- package/dist/components/features/settings/key-status-icon.d.ts +1 -1
- package/dist/components/features/settings/llm-profiles/delete-profile-modal.d.ts +1 -1
- package/dist/components/features/settings/llm-profiles/llm-profiles-manager.d.ts +1 -1
- package/dist/components/features/settings/llm-profiles/llm-settings-local-view.d.ts +2 -1
- package/dist/components/features/settings/llm-profiles/profile-actions-menu-item.d.ts +1 -1
- package/dist/components/features/settings/llm-profiles/profile-actions-menu.d.ts +1 -1
- package/dist/components/features/settings/llm-profiles/profile-row.d.ts +1 -1
- package/dist/components/features/settings/llm-profiles/profiles-body.d.ts +1 -1
- package/dist/components/features/settings/llm-profiles/rename-profile-modal.d.ts +1 -1
- package/dist/components/features/settings/llm-settings/llm-settings-inputs-skeleton.d.ts +1 -1
- package/dist/components/features/settings/llm-settings/openai-subscription-auth-card.d.ts +2 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs +1 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.cjs.map +1 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.d.ts +2 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.js +2 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-form.js.map +1 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-list-item.d.ts +1 -1
- package/dist/components/features/settings/mcp-settings/mcp-server-list.d.ts +1 -1
- package/dist/components/features/settings/mobile-header.d.ts +1 -1
- package/dist/components/features/settings/optional-tag.d.ts +1 -1
- package/dist/components/features/settings/sdk-settings/field-help.d.ts +1 -1
- package/dist/components/features/settings/sdk-settings/schema-field.d.ts +2 -1
- package/dist/components/features/settings/sdk-settings/sdk-section-page.d.ts +1 -1
- package/dist/components/features/settings/sdk-settings/view-toggle.d.ts +1 -1
- package/dist/components/features/settings/secrets-settings/secret-form.d.ts +2 -1
- package/dist/components/features/settings/secrets-settings/secret-list-item.d.ts +2 -2
- package/dist/components/features/settings/settings-desktop-sidebar.cjs +1 -1
- package/dist/components/features/settings/settings-desktop-sidebar.cjs.map +1 -1
- package/dist/components/features/settings/settings-desktop-sidebar.d.ts +1 -1
- package/dist/components/features/settings/settings-desktop-sidebar.js +1 -1
- package/dist/components/features/settings/settings-desktop-sidebar.js.map +1 -1
- package/dist/components/features/settings/settings-dropdown-input.d.ts +1 -1
- package/dist/components/features/settings/settings-layout.d.ts +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.cjs +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.cjs.map +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.d.ts +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.js +1 -1
- package/dist/components/features/settings/settings-mobile-drawer.js.map +1 -1
- package/dist/components/features/settings/settings-mobile-hub.d.ts +1 -1
- package/dist/components/features/settings/settings-nav-divider.d.ts +1 -1
- package/dist/components/features/settings/settings-nav-header.d.ts +1 -1
- package/dist/components/features/settings/settings-nav-link.d.ts +1 -1
- package/dist/components/features/settings/settings-navigation.d.ts +1 -1
- package/dist/components/features/settings/settings-switch.d.ts +1 -1
- package/dist/components/features/settings/subtext-skeleton.d.ts +1 -1
- package/dist/components/features/settings/switch-skeleton.d.ts +1 -1
- package/dist/components/features/settings/upgrade-banner.d.ts +1 -1
- package/dist/components/features/settings/upgrade-button.d.ts +1 -1
- package/dist/components/features/sidebar/avatar.d.ts +1 -1
- package/dist/components/features/sidebar/sidebar-collapsed-icon-slot.d.ts +1 -1
- package/dist/components/features/sidebar/sidebar-conversation-list.d.ts +1 -1
- package/dist/components/features/sidebar/sidebar-mobile-menu-bar.d.ts +1 -1
- package/dist/components/features/sidebar/sidebar-mobile-menu-toggle.d.ts +1 -1
- package/dist/components/features/sidebar/sidebar-mobile-nav-context.d.ts +1 -1
- package/dist/components/features/sidebar/sidebar-nav-link.d.ts +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.d.ts +1 -1
- package/dist/components/features/sidebar/sidebar-rail-body.js +109 -108
- package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
- package/dist/components/features/sidebar/sidebar.d.ts +2 -1
- package/dist/components/features/sidebar/user-avatar.d.ts +1 -1
- package/dist/components/features/skills/add-skill-modal.d.ts +2 -1
- package/dist/components/features/skills/extensions-mobile-hub.d.ts +1 -1
- package/dist/components/features/skills/extensions-navigation.cjs +1 -1
- package/dist/components/features/skills/extensions-navigation.cjs.map +1 -1
- package/dist/components/features/skills/extensions-navigation.d.ts +1 -1
- package/dist/components/features/skills/extensions-navigation.js +9 -9
- package/dist/components/features/skills/extensions-navigation.js.map +1 -1
- package/dist/components/features/skills/skill-card-pill-row.d.ts +1 -1
- package/dist/components/features/skills/skill-card.d.ts +2 -1
- package/dist/components/features/skills/skill-detail-modal.d.ts +2 -1
- package/dist/components/features/skills/skill-facet-rail.d.ts +8 -0
- package/dist/components/features/skills/skill-facet-row.d.ts +13 -0
- package/dist/components/features/skills/skill-filter.d.ts +34 -0
- package/dist/components/features/skills/skill-filters-modal.d.ts +10 -0
- package/dist/components/features/skills/skill-icon-badge.d.ts +1 -1
- package/dist/components/features/skills/skill-type-badge.d.ts +1 -1
- package/dist/components/features/skills/skills-toolbar.d.ts +3 -4
- package/dist/components/features/suggestions/suggestion-item.d.ts +1 -1
- package/dist/components/features/suggestions/suggestions.d.ts +1 -1
- package/dist/components/features/terminal/empty-terminal-message.d.ts +1 -1
- package/dist/components/features/terminal/terminal.d.ts +1 -1
- package/dist/components/features/tips/random-tip.d.ts +2 -1
- package/dist/components/providers/agent-server-ui-providers.d.ts +1 -1
- package/dist/components/providers/agent-server-ui-root.d.ts +1 -1
- package/dist/components/providers/telemetry-provider.d.ts +1 -1
- package/dist/components/shared/action-tooltip.d.ts +1 -1
- package/dist/components/shared/agent-brand-icon.d.ts +1 -1
- package/dist/components/shared/badge.d.ts +1 -1
- package/dist/components/shared/buttons/back-nav-button-content.d.ts +1 -1
- package/dist/components/shared/buttons/circle-plus-check-toggle.d.ts +3 -2
- package/dist/components/shared/buttons/conversation-confirmation-buttons.d.ts +1 -1
- package/dist/components/shared/buttons/copy-to-clipboard-button.d.ts +1 -1
- package/dist/components/shared/buttons/copyable-content-wrapper.d.ts +1 -1
- package/dist/components/shared/buttons/modal-button.d.ts +1 -1
- package/dist/components/shared/buttons/openhands-logo-button.d.ts +1 -1
- package/dist/components/shared/buttons/remove-button.d.ts +1 -1
- package/dist/components/shared/buttons/scroll-to-bottom-button.d.ts +1 -1
- package/dist/components/shared/buttons/styled-tooltip.d.ts +1 -1
- package/dist/components/shared/filters/enum-filter-dropdown.cjs +1 -1
- package/dist/components/shared/filters/enum-filter-dropdown.cjs.map +1 -1
- package/dist/components/shared/filters/enum-filter-dropdown.d.ts +6 -2
- package/dist/components/shared/filters/enum-filter-dropdown.js +13 -13
- package/dist/components/shared/filters/enum-filter-dropdown.js.map +1 -1
- package/dist/components/shared/git-provider-icon.d.ts +1 -1
- package/dist/components/shared/hook-execution-event-message.d.ts +2 -1
- package/dist/components/shared/loading-spinner.d.ts +1 -1
- package/dist/components/shared/modals/confirmation-modal.d.ts +1 -1
- package/dist/components/shared/modals/confirmation-modals/base-modal.d.ts +3 -3
- package/dist/components/shared/modals/confirmation-modals/danger-modal.d.ts +1 -1
- package/dist/components/shared/modals/modal-body.d.ts +1 -1
- package/dist/components/shared/modals/modal-close-button.d.ts +1 -1
- package/dist/components/shared/modals/settings/model-selector.d.ts +2 -1
- package/dist/components/shared/modals/settings/settings-form.d.ts +2 -1
- package/dist/components/shared/modals/settings/settings-modal.d.ts +1 -1
- package/dist/components/shared/navigation-link.cjs +1 -1
- package/dist/components/shared/navigation-link.cjs.map +1 -1
- package/dist/components/shared/navigation-link.js +11 -7
- package/dist/components/shared/navigation-link.js.map +1 -1
- package/dist/components/shared/risk-alert.d.ts +1 -1
- package/dist/components/shared/text-shimmer.d.ts +1 -1
- package/dist/components/ui/resize-handle.d.ts +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +3 -3
- package/dist/config/defaults.js.map +1 -1
- package/dist/constants/child-conversation.cjs +2 -0
- package/dist/constants/child-conversation.cjs.map +1 -0
- package/dist/constants/child-conversation.d.ts +29 -0
- package/dist/constants/child-conversation.js +6 -0
- package/dist/constants/child-conversation.js.map +1 -0
- package/dist/context/navigation-context.d.ts +1 -1
- package/dist/context/scroll-context.d.ts +1 -1
- package/dist/contexts/active-backend-context.d.ts +1 -1
- package/dist/contexts/conversation-websocket-context.cjs +3 -3
- package/dist/contexts/conversation-websocket-context.cjs.map +1 -1
- package/dist/contexts/conversation-websocket-context.d.ts +1 -1
- package/dist/contexts/conversation-websocket-context.js +189 -188
- package/dist/contexts/conversation-websocket-context.js.map +1 -1
- package/dist/contexts/settings-section-header-context.d.ts +1 -1
- package/dist/contexts/websocket-provider-wrapper.d.ts +1 -1
- package/dist/fixtures/home-automations-demo.d.ts +19 -0
- package/dist/hooks/chat/use-model-interceptor.cjs +1 -1
- package/dist/hooks/chat/use-model-interceptor.js +6 -6
- package/dist/hooks/mutation/use-add-mcp-server.cjs +1 -1
- package/dist/hooks/mutation/use-add-mcp-server.cjs.map +1 -1
- package/dist/hooks/mutation/use-add-mcp-server.js +10 -14
- package/dist/hooks/mutation/use-add-mcp-server.js.map +1 -1
- package/dist/hooks/mutation/use-create-conversation.cjs +1 -1
- package/dist/hooks/mutation/use-create-conversation.js +6 -6
- package/dist/hooks/mutation/use-delete-mcp-server.cjs +1 -1
- package/dist/hooks/mutation/use-delete-mcp-server.cjs.map +1 -1
- package/dist/hooks/mutation/use-delete-mcp-server.d.ts +2 -7
- package/dist/hooks/mutation/use-delete-mcp-server.js +8 -34
- package/dist/hooks/mutation/use-delete-mcp-server.js.map +1 -1
- package/dist/hooks/mutation/use-save-settings.cjs +1 -1
- package/dist/hooks/mutation/use-save-settings.cjs.map +1 -1
- package/dist/hooks/mutation/use-save-settings.js +8 -4
- package/dist/hooks/mutation/use-save-settings.js.map +1 -1
- package/dist/hooks/mutation/use-update-mcp-server.cjs +1 -1
- package/dist/hooks/mutation/use-update-mcp-server.cjs.map +1 -1
- package/dist/hooks/mutation/use-update-mcp-server.d.ts +1 -1
- package/dist/hooks/mutation/use-update-mcp-server.js +31 -16
- package/dist/hooks/mutation/use-update-mcp-server.js.map +1 -1
- package/dist/hooks/query/use-active-conversation.d.ts +1 -1
- package/dist/hooks/query/use-agent-profiles.d.ts +1 -1
- package/dist/hooks/query/use-app-installations.d.ts +1 -1
- package/dist/hooks/query/use-automation-detail.d.ts +2 -2
- package/dist/hooks/query/use-automation-health.d.ts +2 -0
- package/dist/hooks/query/use-automations.d.ts +5 -1
- package/dist/hooks/query/use-bash-command-logs.d.ts +1 -1
- package/dist/hooks/query/use-cloud-sandbox.d.ts +1 -1
- package/dist/hooks/query/use-commit-changes.d.ts +1 -1
- package/dist/hooks/query/use-config.d.ts +1 -1
- package/dist/hooks/query/use-conversation-history.d.ts +1 -1
- package/dist/hooks/query/use-conversation-hooks.d.ts +1 -1
- package/dist/hooks/query/use-conversation-skills.d.ts +1 -1
- package/dist/hooks/query/use-get-secrets.d.ts +1 -1
- package/dist/hooks/query/use-home-automations.d.ts +20 -0
- package/dist/hooks/query/use-latest-automation-runs.d.ts +19 -0
- package/dist/hooks/query/use-llm-profiles.d.ts +1 -1
- package/dist/hooks/query/use-llm-subscription-models.d.ts +1 -1
- package/dist/hooks/query/use-llm-subscription-status.d.ts +1 -1
- package/dist/hooks/query/use-local-git-info.d.ts +1 -1
- package/dist/hooks/query/use-local-workspaces.d.ts +1 -1
- package/dist/hooks/query/use-manifest-capabilities.d.ts +2 -0
- package/dist/hooks/query/use-plugin-file-content.d.ts +1 -1
- package/dist/hooks/query/use-plugins-marketplace.d.ts +1 -1
- package/dist/hooks/query/use-provider-models.d.ts +1 -1
- package/dist/hooks/query/use-search-branches.d.ts +1 -1
- package/dist/hooks/query/use-search-providers.d.ts +1 -1
- package/dist/hooks/query/use-search-repositories.d.ts +1 -1
- package/dist/hooks/query/use-search-subdirs.d.ts +2 -2
- package/dist/hooks/query/use-settings.d.ts +2 -2
- package/dist/hooks/query/use-skills.d.ts +1 -1
- package/dist/hooks/query/use-start-tasks.d.ts +1 -1
- package/dist/hooks/query/use-sub-conversation-task-polling.d.ts +1 -1
- package/dist/hooks/query/use-sub-conversations.d.ts +1 -1
- package/dist/hooks/query/use-suggested-tasks.d.ts +1 -1
- package/dist/hooks/query/use-task-polling.d.ts +2 -2
- package/dist/hooks/query/use-unified-get-git-changes.d.ts +1 -1
- package/dist/hooks/query/use-unified-git-diff.d.ts +1 -1
- package/dist/hooks/query/use-user-conversation.d.ts +1 -1
- package/dist/hooks/query/use-workspace-file-content.d.ts +1 -1
- package/dist/hooks/use-backend-scoped-path.cjs +2 -0
- package/dist/hooks/use-backend-scoped-path.cjs.map +1 -0
- package/dist/hooks/use-backend-scoped-path.d.ts +10 -0
- package/dist/hooks/use-backend-scoped-path.js +13 -0
- package/dist/hooks/use-backend-scoped-path.js.map +1 -0
- package/dist/hooks/use-home-automation-actions.d.ts +23 -0
- package/dist/hooks/use-home-pinned-automations.d.ts +26 -0
- package/dist/hooks/use-tracking.cjs +1 -1
- package/dist/hooks/use-tracking.cjs.map +1 -1
- package/dist/hooks/use-tracking.d.ts +4 -0
- package/dist/hooks/use-tracking.js +6 -0
- package/dist/hooks/use-tracking.js.map +1 -1
- package/dist/i18n/declaration.cjs +1 -1
- package/dist/i18n/declaration.cjs.map +1 -1
- package/dist/i18n/declaration.d.ts +105 -2
- package/dist/i18n/declaration.js +1 -1
- package/dist/i18n/declaration.js.map +1 -1
- package/dist/i18n/translation.cjs +2 -2
- package/dist/i18n/translation.cjs.map +1 -1
- package/dist/i18n/translation.js +1813 -62
- package/dist/i18n/translation.js.map +1 -1
- package/dist/icons/code-pill.d.ts +1 -1
- package/dist/icons/docker.cjs +2 -0
- package/dist/icons/docker.cjs.map +1 -0
- package/dist/icons/docker.js +19 -0
- package/dist/icons/docker.js.map +1 -0
- package/dist/icons/npm.cjs +2 -0
- package/dist/icons/npm.cjs.map +1 -0
- package/dist/icons/npm.js +19 -0
- package/dist/icons/npm.js.map +1 -0
- package/dist/locales/ar/openhands.json +108 -5
- package/dist/locales/ca/openhands.json +108 -5
- package/dist/locales/de/openhands.json +108 -5
- package/dist/locales/en/openhands.json +108 -5
- package/dist/locales/es/openhands.json +108 -5
- package/dist/locales/fr/openhands.json +108 -5
- package/dist/locales/it/openhands.json +108 -5
- package/dist/locales/ja/openhands.json +108 -5
- package/dist/locales/ko-KR/openhands.json +108 -5
- package/dist/locales/no/openhands.json +108 -5
- package/dist/locales/pt/openhands.json +108 -5
- package/dist/locales/tr/openhands.json +108 -5
- package/dist/locales/uk/openhands.json +108 -5
- package/dist/locales/zh-CN/openhands.json +108 -5
- package/dist/locales/zh-TW/openhands.json +108 -5
- package/dist/manifests/automation-insights.d.ts +64 -0
- package/dist/manifests/automation-interface.cjs +1 -1
- package/dist/manifests/automation-interface.cjs.map +1 -1
- package/dist/manifests/automation-interface.d.ts +33 -1
- package/dist/manifests/automation-interface.js +2 -1
- package/dist/manifests/automation-interface.js.map +1 -1
- package/dist/manifests/interface-validation.cjs +1 -1
- package/dist/manifests/interface-validation.cjs.map +1 -1
- package/dist/manifests/interface-validation.js +228 -50
- package/dist/manifests/interface-validation.js.map +1 -1
- package/dist/manifests/manifest-template.d.ts +2 -0
- package/dist/manifests/manifest-validation.cjs.map +1 -1
- package/dist/manifests/manifest-validation.js.map +1 -1
- package/dist/manifests/types.cjs +1 -1
- package/dist/manifests/types.cjs.map +1 -1
- package/dist/manifests/types.d.ts +128 -0
- package/dist/manifests/types.js +35 -2
- package/dist/manifests/types.js.map +1 -1
- package/dist/mockServiceWorker.js +21 -9
- package/dist/node_modules/@openhands/extensions/automations/catalog/upstream-fork-sync/manifest.cjs +9 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/upstream-fork-sync/manifest.cjs.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/upstream-fork-sync/manifest.js +74 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog/upstream-fork-sync/manifest.js.map +1 -0
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +6 -4
- package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/interface.cjs +1 -1
- package/dist/node_modules/@openhands/extensions/automations/interface.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/automations/interface.js +126 -5
- package/dist/node_modules/@openhands/extensions/automations/interface.js.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.cjs +161 -53
- package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
- package/dist/node_modules/@openhands/extensions/skills/index.js +112 -50
- package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/index.cjs +1 -1
- package/dist/node_modules/@openhands/typescript-client/dist/index.js +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/utils.cjs +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/utils.cjs.map +1 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/utils.js +12 -1
- package/dist/node_modules/@tanstack/query-core/build/modern/utils.js.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.cjs.map +1 -1
- package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js +14 -12
- package/dist/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map +1 -1
- package/dist/node_modules/html-parse-stringify/dist/esm/html-parse-stringify.cjs +2 -0
- package/dist/node_modules/html-parse-stringify/dist/esm/html-parse-stringify.cjs.map +1 -0
- package/dist/node_modules/html-parse-stringify/dist/esm/html-parse-stringify.js +177 -0
- package/dist/node_modules/html-parse-stringify/dist/esm/html-parse-stringify.js.map +1 -0
- package/dist/node_modules/i18next/dist/esm/i18next.cjs +1 -1
- package/dist/node_modules/i18next/dist/esm/i18next.cjs.map +1 -1
- package/dist/node_modules/i18next/dist/esm/i18next.js +31 -24
- package/dist/node_modules/i18next/dist/esm/i18next.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/briefcase.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/building-2.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/building-2.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/building-2.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/building-2.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.js +21 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-arrow-up.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-user-round.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.js +43 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/cloud-cog.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/earth.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/earth.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/earth.js +25 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/earth.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-git-2.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.js +25 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/folder-key.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.js +30 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-pull-request.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/hash.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/hash.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/hash.js +35 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/hash.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/house.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/house.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/house.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/house.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/id-card.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/id-card.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/id-card.js +33 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/id-card.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.js +19 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/link-2.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/link-2.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/link-2.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/link-2.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/mails.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/mails.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/mails.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/mails.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/messages-square.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/square-kanban.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ticket.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ticket.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ticket.js +23 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ticket.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/users-round.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/users-round.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/users-round.js +21 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/users-round.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.js +43 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/waypoints.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.js +19 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/webhook.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/workflow.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/workflow.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/workflow.js +27 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/workflow.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/wrench.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.js.map +1 -0
- package/dist/node_modules/posthog-js/dist/module.cjs +2 -2
- package/dist/node_modules/posthog-js/dist/module.cjs.map +1 -1
- package/dist/node_modules/posthog-js/dist/module.js +2055 -1929
- package/dist/node_modules/posthog-js/dist/module.js.map +1 -1
- package/dist/node_modules/react-i18next/dist/es/TransWithoutContext.cjs +1 -1
- package/dist/node_modules/react-i18next/dist/es/TransWithoutContext.cjs.map +1 -1
- package/dist/node_modules/react-i18next/dist/es/TransWithoutContext.js +43 -62
- package/dist/node_modules/react-i18next/dist/es/TransWithoutContext.js.map +1 -1
- package/dist/node_modules/react-i18next/dist/es/useTranslation.cjs +1 -1
- package/dist/node_modules/react-i18next/dist/es/useTranslation.cjs.map +1 -1
- package/dist/node_modules/react-i18next/dist/es/useTranslation.js +12 -6
- package/dist/node_modules/react-i18next/dist/es/useTranslation.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +352 -310
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +39 -35
- package/dist/package.js.map +1 -1
- package/dist/routes/agent-settings.d.ts +3 -2
- package/dist/routes/app-settings.d.ts +2 -1
- package/dist/routes/browser-tab.d.ts +1 -1
- package/dist/routes/changes-tab.d.ts +2 -1
- package/dist/routes/commits-tab.d.ts +1 -1
- package/dist/routes/conversation.d.ts +2 -1
- package/dist/routes/files-tab.d.ts +1 -1
- package/dist/routes/llm-settings.d.ts +3 -2
- package/dist/routes/mcp.cjs +1 -1
- package/dist/routes/mcp.cjs.map +1 -1
- package/dist/routes/mcp.d.ts +2 -1
- package/dist/routes/mcp.js +1 -1
- package/dist/routes/mcp.js.map +1 -1
- package/dist/routes/planner-tab.d.ts +2 -1
- package/dist/routes/secrets-settings.d.ts +2 -1
- package/dist/routes/task-list-tab.d.ts +1 -1
- package/dist/services/child-conversation-launch.cjs +2 -0
- package/dist/services/child-conversation-launch.cjs.map +1 -0
- package/dist/services/child-conversation-launch.d.ts +41 -0
- package/dist/services/child-conversation-launch.js +182 -0
- package/dist/services/child-conversation-launch.js.map +1 -0
- package/dist/services/settings.cjs +1 -1
- package/dist/services/settings.cjs.map +1 -1
- package/dist/services/settings.js +3 -7
- package/dist/services/settings.js.map +1 -1
- package/dist/stores/conversation-panel-preferences-store.cjs +1 -1
- package/dist/stores/conversation-panel-preferences-store.cjs.map +1 -1
- package/dist/stores/conversation-panel-preferences-store.d.ts +5 -1
- package/dist/stores/conversation-panel-preferences-store.js +8 -2
- package/dist/stores/conversation-panel-preferences-store.js.map +1 -1
- package/dist/types/agent-server/core/base/action.d.ts +17 -1
- package/dist/types/agent-server/core/base/base.d.ts +2 -1
- package/dist/types/agent-server/type-guards.cjs +1 -1
- package/dist/types/agent-server/type-guards.cjs.map +1 -1
- package/dist/types/agent-server/type-guards.d.ts +8 -1
- package/dist/types/agent-server/type-guards.js +4 -3
- package/dist/types/agent-server/type-guards.js.map +1 -1
- package/dist/types/automation.d.ts +30 -1
- package/dist/types/mcp-auth.cjs.map +1 -1
- package/dist/types/mcp-auth.d.ts +5 -41
- package/dist/types/mcp-auth.js.map +1 -1
- package/dist/types/mcp-server.d.ts +17 -32
- package/dist/types/settings.d.ts +8 -28
- package/dist/ui/card-title.d.ts +1 -1
- package/dist/ui/card.d.ts +1 -1
- package/dist/ui/combobox-caret.d.ts +3 -3
- package/dist/ui/context-menu.cjs +1 -1
- package/dist/ui/context-menu.cjs.map +1 -1
- package/dist/ui/context-menu.d.ts +3 -2
- package/dist/ui/context-menu.js +10 -9
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/divider.d.ts +1 -1
- package/dist/ui/dropdown/clear-button.d.ts +1 -1
- package/dist/ui/dropdown/dropdown-input.d.ts +1 -1
- package/dist/ui/dropdown/dropdown-menu.d.ts +1 -1
- package/dist/ui/dropdown/dropdown.d.ts +1 -1
- package/dist/ui/dropdown/loading-spinner.d.ts +1 -1
- package/dist/ui/dropdown/toggle-button.d.ts +1 -1
- package/dist/ui/help-link.d.ts +1 -1
- package/dist/ui/pre.d.ts +1 -1
- package/dist/ui/toggle-switch.d.ts +2 -2
- package/dist/ui/typography.d.ts +7 -7
- package/dist/utils/automation-activity-log-export.d.ts +17 -0
- package/dist/utils/automation-timeout.d.ts +4 -6
- package/dist/utils/custom-toast-handlers.cjs +1 -1
- package/dist/utils/custom-toast-handlers.cjs.map +1 -1
- package/dist/utils/custom-toast-handlers.d.ts +2 -2
- package/dist/utils/custom-toast-handlers.js +18 -1
- package/dist/utils/custom-toast-handlers.js.map +1 -1
- package/dist/utils/format-relative-time.d.ts +3 -0
- package/dist/utils/mcp-config.cjs +1 -1
- package/dist/utils/mcp-config.cjs.map +1 -1
- package/dist/utils/mcp-config.d.ts +12 -29
- package/dist/utils/mcp-config.js +161 -143
- package/dist/utils/mcp-config.js.map +1 -1
- package/dist/utils/mcp-installed-servers.cjs +1 -1
- package/dist/utils/mcp-installed-servers.cjs.map +1 -1
- package/dist/utils/mcp-installed-servers.d.ts +2 -2
- package/dist/utils/mcp-installed-servers.js +21 -32
- package/dist/utils/mcp-installed-servers.js.map +1 -1
- package/dist/utils/mcp-server-health-key.cjs.map +1 -1
- package/dist/utils/mcp-server-health-key.d.ts +2 -4
- package/dist/utils/mcp-server-health-key.js.map +1 -1
- package/dist/utils/settings-like-page-layout-classes.cjs +1 -1
- package/dist/utils/settings-like-page-layout-classes.cjs.map +1 -1
- package/dist/utils/settings-like-page-layout-classes.d.ts +6 -2
- package/dist/utils/settings-like-page-layout-classes.js +1 -1
- package/dist/utils/settings-like-page-layout-classes.js.map +1 -1
- package/dist/utils/skill-category.d.ts +12 -0
- package/package.json +41 -35
- package/scripts/brand-dev-electron.mjs +244 -0
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/check-translation-completeness.cjs +4 -0
- package/scripts/dev-safe.mjs +2 -2
- package/scripts/dev-with-automation.mjs +3 -2
- package/scripts/generate-icons.mjs +109 -0
- package/build/assets/Trans-Bwpzk1wT.js +0 -1
- package/build/assets/active-backend-context-BiwzkzDy.js +0 -2
- package/build/assets/agent-context-settings-DXNT_dcw.js +0 -1
- package/build/assets/agent-server-conversation-service.api-CYSWw-2g.js +0 -41
- package/build/assets/agent-settings-BjgQQe-_.js +0 -1
- package/build/assets/alert-banner-DR8EVyZM.js +0 -1
- package/build/assets/api-error-message-e16L1kwH.js +0 -1
- package/build/assets/automation-detail-DY6x2FW1.js +0 -2
- package/build/assets/automation-export-C09f-Lua.js +0 -2
- package/build/assets/automation-setup-route-CqKp0717.js +0 -1
- package/build/assets/automations-list-CqWJ7qXW.js +0 -1
- package/build/assets/backend-form-modal-B8D5hBzK.js +0 -1
- package/build/assets/check-CPLXgluF.js +0 -1
- package/build/assets/chevron-down-CP4QHvyc.js +0 -1
- package/build/assets/circle-check-Dpy2_xSI.js +0 -1
- package/build/assets/command-menu-Bj6X4ckE.js +0 -1
- package/build/assets/condenser-settings-EAXQNR2E.js +0 -1
- package/build/assets/context-menu-list-item-CrCrYuPF.js +0 -1
- package/build/assets/conversation-BzyIcSwr.js +0 -1
- package/build/assets/conversation-panel-BzyIcSwr.js +0 -1
- package/build/assets/copy-DCmZtz6n.js +0 -1
- package/build/assets/entry.client-BbIYOsIg.js +0 -2
- package/build/assets/enum-filter-dropdown-C08-srev.js +0 -1
- package/build/assets/files-tab-DEq8MbHu.js +0 -1
- package/build/assets/format-time-delta-CxfPJpzC.js +0 -1
- package/build/assets/git-repo-dropdown-9WKINV6J.js +0 -1
- package/build/assets/home-CY0JaxiY.js +0 -1
- package/build/assets/home-CaNWlVvB.js +0 -1
- package/build/assets/index-home-CaNWlVvB.js +0 -1
- package/build/assets/info-CmWQXtRQ.js +0 -1
- package/build/assets/install-server-modal-BWrudmZU.js +0 -1
- package/build/assets/llm-not-configured-banner-3tMsM4K6.js +0 -27
- package/build/assets/llm-settings-CXo8iPNW.js +0 -1
- package/build/assets/llm-settings-D0W8mJDk.js +0 -1
- package/build/assets/loader-circle-B4QDBARx.js +0 -1
- package/build/assets/manifest-39f4789d.js +0 -1
- package/build/assets/map-provider-CXU6issd.js +0 -1
- package/build/assets/markdown-renderer-DgiLLhW6.js +0 -8
- package/build/assets/mcp-DXG9LWrI.js +0 -9
- package/build/assets/mcp-marketplace-utils-DFmhKc5s.js +0 -1
- package/build/assets/messages-kBjKaAeA.js +0 -40
- package/build/assets/navigation-link-Bxmn-pCs.js +0 -1
- package/build/assets/onboarding-47hh2IHA.js +0 -1
- package/build/assets/onboarding-modal-9BuvvROo.js +0 -1
- package/build/assets/plus-DrKuuvMe.js +0 -1
- package/build/assets/recommended-automations-launcher-ejxy1P27.js +0 -1
- package/build/assets/root-5S-M8SYa.js +0 -2
- package/build/assets/root-DZ39lS5f.css +0 -1
- package/build/assets/root-layout-BPqoa0gv.js +0 -3
- package/build/assets/search-Dc2qR4O2.js +0 -1
- package/build/assets/settings-BRbnfKEm.js +0 -1
- package/build/assets/settings-Chfn5xTD.js +0 -1
- package/build/assets/settings-like-page-layout-classes-DyxyJ0k4.js +0 -1
- package/build/assets/settings-service.api-CZiPD8__.js +0 -1
- package/build/assets/sidebar-mobile-menu-toggle-ND-hgygu.js +0 -1
- package/build/assets/sidebar-store-Bui-WNEr.js +0 -1
- package/build/assets/skills-settings-B43KArIz.js +0 -2
- package/build/assets/use-is-authed-BT7Iud4U.js +0 -1
- package/build/assets/use-llm-profiles-2Wc2db8u.js +0 -1
- package/build/assets/use-save-agent-profile-D0wC5ExW.js +0 -1
- package/build/assets/use-settings-nav-items-DHAAD-zk.js +0 -16
- package/build/assets/use-skills-CE6miQ3r.js +0 -1
- package/build/assets/use-tracking-BGboadaZ.js +0 -68
- package/build/assets/useQuery-DiPh8LRJ.js +0 -1
- package/build/assets/utils-BgGG1znF.js +0 -1
- package/build/assets/v4-DDdyfk2q.js +0 -1
- package/build/assets/vendor~browser-IVYgIgG1.js +0 -47
- package/build/assets/vendor~entry.client-CXM9oiAk.js +0 -1
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~d4by102p-C2f0ZhS-.js +0 -26
- package/build/assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~emdr2jt4-BrmgjeOw.js +0 -1
- package/build/assets/vendor~module-BZXjBMvd.js +0 -2
- package/build/assets/x-omAzpXkl.js +0 -1
- package/dist/components/features/skills/skill-type-filter.d.ts +0 -3
- package/dist/components/features/skills/skills-type-filter-dropdown.d.ts +0 -7
- package/dist/node_modules/html-parse-stringify/dist/html-parse-stringify.module.cjs +0 -2
- package/dist/node_modules/html-parse-stringify/dist/html-parse-stringify.module.cjs.map +0 -1
- package/dist/node_modules/html-parse-stringify/dist/html-parse-stringify.module.js +0 -81
- package/dist/node_modules/html-parse-stringify/dist/html-parse-stringify.module.js.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs +0 -2
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -9
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js.map +0 -1
- package/dist/node_modules/void-elements/index.cjs +0 -2
- package/dist/node_modules/void-elements/index.cjs.map +0 -1
- package/dist/node_modules/void-elements/index.js +0 -25
- package/dist/node_modules/void-elements/index.js.map +0 -1
- /package/build/assets/{vendor~root-layout~index-home~home~mcp~automations-list~automation-setup-route~onboarding-modal-D7IDevqN.js → vendor~root-layout~index-home~home~mcp~automations-list~automation-templates~automation-set~bxsimjx0-D7IDevqN.js} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
require("../../../_virtual/_rolldown/runtime.cjs");var e=typeof window<`u`?window:void 0,t=typeof globalThis<`u`?globalThis:e;typeof self>`u`&&(t.self=t),typeof File>`u`&&(t.File=function(){});var n=t?.navigator,r=t?.document,i=t?.location,a=t?.fetch,o=t!=null&&t.XMLHttpRequest&&`withCredentials`in new t.XMLHttpRequest?t.XMLHttpRequest:void 0,s=t?.AbortController,c=t?.CompressionStream,l=n?.userAgent,u=e??{},d=`1.372.6`,f={DEBUG:!1,LIB_VERSION:d,LIB_NAME:`web`,JS_SDK_VERSION:d};function p(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function m(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){p(a,r,i,o,s,`next`,e)}function s(e){p(a,r,i,o,s,`throw`,e)}o(void 0)}))}}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(null,arguments)}function g(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function _(){return _=m((function*(e,t,n){t===void 0&&(t=!0);try{var r=new CompressionStream(`gzip`),i=r.writable.getWriter(),a=i.write(new TextEncoder().encode(e)).then((()=>i.close())).catch(function(){var e=m((function*(e){try{yield i.abort(e)}catch{}throw e}));return function(t){return e.apply(this,arguments)}}()),o=new Response(r.readable).blob(),[s]=yield Promise.all([o,a]);return s}catch(e){if(n!=null&&n.rethrow)throw e;return t&&console.error(`Failed to gzip compress data`,e),null}})),_.apply(this,arguments)}var v=`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`.split(`,`),y=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return v.concat(t).some((e=>{var t=e.toLowerCase();return n.indexOf(t)!==-1}))},b=[`$snapshot`,`$pageview`,`$pageleave`,`$set`,`survey dismissed`,`survey sent`,`survey shown`,`$identify`,`$groupidentify`,`$create_alias`,`$$client_ingestion_warning`,`$web_experiment_applied`,`$feature_enrollment_update`,`$feature_flag_called`];function x(e,t){return e.indexOf(t)!==-1}var S=function(e){return e.trim()},C=function(e){return e.replace(/^\$/,``)},w=Object.prototype,ee=w.hasOwnProperty,T=w.toString,E=Array.isArray||function(e){return T.call(e)===`[object Array]`},D=e=>typeof e==`function`,O=e=>e===Object(e)&&!E(e),k=e=>{if(O(e)){for(var t in e)if(ee.call(e,t))return!1;return!0}return!1},A=e=>e===void 0,j=e=>T.call(e)==`[object String]`,M=e=>j(e)&&e.trim().length===0,N=e=>e===null,P=e=>A(e)||N(e),F=e=>T.call(e)==`[object Number]`&&e==e,I=e=>F(e)&&e>0,L=e=>T.call(e)===`[object Boolean]`,te=e=>e instanceof FormData,ne=e=>x(b,e);function R(e){return typeof e!=`object`||!e}function re(e,t){return{}.toString.call(e)===`[object `+t+`]`}function ie(e){return typeof Event<`u`&&function(e,t){try{return e instanceof t}catch{return!1}}(e,Event)}var ae=[!0,`true`,1,`1`,`yes`],oe=e=>x(ae,e),se=[!1,`false`,0,`0`,`no`];function z(e,t,n,r,i){return t>n&&(r.warn(`min cannot be greater than max.`),t=n),F(e)?e>n?(r.warn(` cannot be greater than max: `+n+`. Using max value instead.`),n):t>e?(r.warn(` cannot be less than min: `+t+`. Using min value instead.`),t):e:(r.warn(` must be a number. using max or fallback. max: `+n+`, fallback: `+i),z(i||n,t,n,r))}var ce=class{constructor(e){this.$t={},this.zt=e.zt,this.Ut=z(e.bucketSize,0,100,e.Gt),this.Wt=z(e.refillRate,0,this.Ut,e.Gt),this.Xt=z(e.refillInterval,0,864e5,e.Gt)}Jt(e,t){var n=Math.floor((t-e.lastAccess)/this.Xt);n>0&&(e.tokens=Math.min(e.tokens+n*this.Wt,this.Ut),e.lastAccess+=n*this.Xt)}consumeRateLimit(e){var t,n=Date.now(),r=String(e),i=this.$t[r];return i?this.Jt(i,n):this.$t[r]=i={tokens:this.Ut,lastAccess:n},i.tokens===0||(i.tokens--,i.tokens===0&&((t=this.zt)==null||t.call(this,e)),i.tokens===0)}stop(){this.$t={}}},le,ue,de,fe=(e,t,n)=>{function r(r){for(var i=arguments.length,a=Array(i>1?i-1:0),o=1;i>o;o++)a[o-1]=arguments[o];t((()=>{(0,n[r])(e,...a)}))}return{debug(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r(`debug`,...t)},info(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r(`log`,...t)},warn(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r(`warn`,...t)},error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];r(`error`,...t)},critical(){for(var t=arguments.length,r=Array(t),i=0;t>i;i++)r[i]=arguments[i];n.error(e,...r)},createLogger:r=>fe(e+` `+r,t,n)}},B=`Mobile`,pe=`iOS`,me=`Android`,he=`Tablet`,ge=me+` `+he,_e=`iPad`,ve=`Apple`,ye=ve+` Watch`,be=`Safari`,xe=`BlackBerry`,Se=`Samsung`,Ce=Se+`Browser`,we=Se+` Internet`,Te=`Chrome`,Ee=Te+` OS`,De=Te+` `+pe,Oe=`Internet Explorer`,ke=Oe+` `+B,Ae=`Opera`,je=Ae+` Mini`,Me=`Edge`,Ne=`Microsoft `+Me,Pe=`Firefox`,Fe=Pe+` `+pe,Ie=`Nintendo`,Le=`PlayStation`,Re=`Xbox`,ze=me+` `+B,Be=B+` `+be,Ve=`Windows`,He=Ve+` Phone`,Ue=`Nokia`,We=`Ouya`,Ge=`Generic`,Ke=Ge+` `+B.toLowerCase(),qe=Ge+` `+he.toLowerCase(),Je=`Konqueror`,V=`(\\d+(\\.\\d+)?)`,Ye=RegExp(`Version/`+V),Xe=new RegExp(Re,`i`),Ze=RegExp(Le+` \\w+`,`i`),Qe=RegExp(Ie+` \\w+`,`i`),$e=RegExp(xe+`|PlayBook|BB10`,`i`),et={"NT3.51":`NT 3.11`,"NT4.0":`NT 4.0`,"5.0":`2000`,5.1:`XP`,5.2:`XP`,"6.0":`Vista`,6.1:`7`,6.2:`8`,6.3:`8.1`,6.4:`10`,"10.0":`10`},tt=function(e,t){return t||=``,x(e,` OPR/`)&&x(e,`Mini`)?je:x(e,` OPR/`)?Ae:$e.test(e)?xe:x(e,`IE`+B)||x(e,`WPDesktop`)?ke:x(e,Ce)?we:x(e,Me)||x(e,`Edg/`)?Ne:x(e,`FBIOS`)?`Facebook `+B:x(e,`UCWEB`)||x(e,`UCBrowser`)?`UC Browser`:x(e,`CriOS`)?De:x(e,`CrMo`)||x(e,Te)?Te:x(e,me)&&x(e,be)?ze:x(e,`FxiOS`)?Fe:x(e.toLowerCase(),Je.toLowerCase())?Je:((e,t)=>t&&x(t,ve)||function(e){return x(e,be)&&!x(e,Te)&&!x(e,me)}(e))(e,t)?x(e,B)?Be:be:x(e,Pe)?Pe:x(e,`MSIE`)||x(e,`Trident/`)?Oe:x(e,`Gecko`)?Pe:``},nt={[ke]:[RegExp(`rv:`+V)],[Ne]:[RegExp(Me+`?\\/`+V)],[Te]:[RegExp(`(`+Te+`|CrMo)\\/`+V)],[De]:[RegExp(`CriOS\\/`+V)],"UC Browser":[RegExp(`(UCBrowser|UCWEB)\\/`+V)],[be]:[Ye],[Be]:[Ye],[Ae]:[RegExp(`(Opera|OPR)\\/`+V)],[Pe]:[RegExp(Pe+`\\/`+V)],[Fe]:[RegExp(`FxiOS\\/`+V)],[Je]:[RegExp(`Konqueror[:/]?`+V,`i`)],[xe]:[RegExp(xe+` `+V),Ye],[ze]:[RegExp(`android\\s`+V,`i`)],[we]:[RegExp(Ce+`\\/`+V)],[Oe]:[RegExp(`(rv:|MSIE )`+V)],Mozilla:[RegExp(`rv:`+V)]},rt=function(e,t){var n=nt[tt(e,t)];if(A(n))return null;for(var r=0;n.length>r;r++){var i=e.match(n[r]);if(i)return parseFloat(i[i.length-2])}return null},it=[[RegExp(Re+`; `+Re+` (.*?)[);]`,`i`),e=>[Re,e&&e[1]||``]],[new RegExp(Ie,`i`),[Ie,``]],[new RegExp(Le,`i`),[Le,``]],[$e,[xe,``]],[new RegExp(Ve,`i`),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[He,``];if(new RegExp(B).test(t)&&!/IEMobile\b/.test(t))return[Ve+` `+B,``];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=et[n[1]]||``;return/arm/i.test(t)&&(r=`RT`),[Ve,r]}return[Ve,``]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[pe,[e[3],e[4],e[5]||`0`].join(`.`)]:[pe,``]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t=``;return e&&e.length>=3&&(t=A(e[2])?e[3]:e[2]),[`watchOS`,t]}],[RegExp(`(`+me+` (\\d+)\\.(\\d+)\\.?(\\d+)?|`+me+`)`,`i`),e=>e&&e[2]?[me,[e[2],e[3],e[4]||`0`].join(`.`)]:[me,``]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=[`Mac OS X`,``];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||`0`].join(`.`)),t}],[/Mac/i,[`Mac OS X`,``]],[/CrOS/,[Ee,``]],[/Linux|debian/i,[`Linux`,``]]],at=function(e){return Qe.test(e)?Ie:Ze.test(e)?Le:Xe.test(e)?Re:new RegExp(We,`i`).test(e)?We:RegExp(`(`+He+`|WPDesktop)`,`i`).test(e)?He:/iPad/.test(e)?_e:/iPod/.test(e)?`iPod Touch`:/iPhone/.test(e)?`iPhone`:/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ye:$e.test(e)?xe:/(kobo)\s(ereader|touch)/i.test(e)?`Kobo`:new RegExp(Ue,`i`).test(e)?Ue:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?`Kindle Fire`:/(Android|ZTE)/i.test(e)?new RegExp(B).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?me:ge:RegExp(`(pda|`+B+`)`,`i`).test(e)?Ke:new RegExp(he,`i`).test(e)&&!RegExp(he+` pc`,`i`).test(e)?qe:``},ot=e=>e instanceof Error,st={trace:{text:`TRACE`,number:1},debug:{text:`DEBUG`,number:5},info:{text:`INFO`,number:9},warn:{text:`WARN`,number:13},error:{text:`ERROR`,number:17},fatal:{text:`FATAL`,number:21}},ct=st.info;function lt(e){if(L(e))return{boolValue:e};if(typeof e==`number`)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e==`string`)return{stringValue:e};if(E(e))return{arrayValue:{values:e.map((e=>lt(e)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function ut(e){var t=[];for(var n in e){var r=e[n];N(r)||A(r)||t.push({key:n,value:lt(r)})}return t}function dt(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return de&&n.length===ue||(ue=n.length,de=n.reduce(((n,r)=>{le||={};var i=le[r];if(i)n[i[0]]=i[1];else for(var a=e(r),o=a.length-1;o>=0;o--){var s=a[o]?.filename,c=t[r];if(s&&c){n[s]=c,le[r]=[s,c];break}}return n}),{})),de}}var ft=class{constructor(e,t,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}buildFromUnknown(e,t){t===void 0&&(t={});var n=t&&t.mechanism||{handled:!0,type:`generic`},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),a=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(a,n),$exception_level:`error`}}modifyFrames(e){var t=this;return m((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&E(n.stacktrace.frames)&&(n.stacktrace.frames=yield t.applyModifiers(n.stacktrace.frames));return e}))()}coerceFallback(e){return{type:`Error`,value:`Unknown error`,stack:e.syntheticException?.stack,synthetic:!0}}parseStacktrace(e,t){var n,r;return e.cause!=null&&(n=this.parseStacktrace(e.cause,t)),e.stack!=``&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),h({},e,{cause:n,stack:r})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var n of this.coercers)if(n.match(e))return n.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return m((function*(){var n=e;for(var r of t.modifiers)n=yield r(n);return n}))()}convertToExceptionList(e,t){var n,r,i={type:e.type,value:e.value,mechanism:{type:t.type??`generic`,handled:(n=t.handled)==null||n,synthetic:(r=e.synthetic)!=null&&r}};e.stack&&(i.stacktrace={type:`raw`,frames:e.stack});var a=[i];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,h({},t,{handled:!0}))),a}buildParsingContext(e){return{chunkIdMap:dt(this.stackParser),skipFirstLines:e.skipFirstLines??1}}buildCoercingContext(e,t,n){n===void 0&&(n=0);var r=(n,r)=>{if(4>=r){var i=this.buildCoercingContext(e,t,r);return this.applyCoercers(n,i)}};return h({},t,{syntheticException:n==0?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,n),next:e=>r(e,n+1)})}},pt=`?`;function mt(e,t,n,r,i){var a={platform:e,filename:t,function:n===`<anonymous>`?pt:n,in_app:!0};return A(r)||(a.lineno=r),A(i)||(a.colno=i),a}var ht=(e,t)=>{var n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?pt:e.split(`@`)[0],n?`safari-extension:`+t:`safari-web-extension:`+t]:[e,t]},gt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,_t=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,vt=/\((\S*)(?::(\d+))(?::(\d+))\)/,yt=(e,t)=>{var n=gt.exec(e);if(n){var[,r,i,a]=n;return mt(t,r,pt,+i,+a)}var o=_t.exec(e);if(o){if(o[2]&&o[2].indexOf(`eval`)===0){var s=vt.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[c,l]=ht(o[1]||pt,o[2]);return mt(t,l,c,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},bt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,xt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,St=(e,t)=>{var n=bt.exec(e);if(n){if(n[3]&&n[3].indexOf(` > eval`)>-1){var r=xt.exec(n[3]);r&&(n[1]=n[1]||`eval`,n[3]=r[1],n[4]=r[2],n[5]=``)}var i=n[3],a=n[1]||pt;return[a,i]=ht(a,i),mt(t,i,a,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Ct=/\(error: (.*)\)/,wt=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var n=j(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?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){var t=e.name||(this.isDOMError(e)?`DOMError`:`DOMException`);return e.message?t+`: `+e.message:t}isDOMException(e){return re(e,`DOMException`)}isDOMError(e){return re(e,`DOMError`)}},Tt=class{match(e){return(e=>e instanceof Error)(e)}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){var n=e.message;return String(n.error&&typeof n.error.message==`string`?n.error.message:n)}getStack(e){return e.stacktrace||e.stack||void 0}},Et=class{constructor(){}match(e){return re(e,`ErrorEvent`)&&e.error!=null}coerce(e,t){return t.apply(e.error)||{type:`ErrorEvent`,value:e.message,stack:t.syntheticException?.stack,synthetic:!0}}},Dt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Ot=class{match(e){return typeof e==`string`}coerce(e,t){var[n,r]=this.getInfos(e);return{type:n??`Error`,value:r??e,stack:t.syntheticException?.stack,synthetic:!0}}getInfos(e){var t=`Error`,n=e,r=e.match(Dt);return r&&(t=r[1],n=r[2]),[t,n]}},kt=[`fatal`,`error`,`warning`,`log`,`info`,`debug`];function At(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return`[object has no keys]`;for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(`, `);if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+`...`:i}return``}var jt=class{match(e){return typeof e==`object`&&!!e}coerce(e,t){var n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{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 ie(e)?e.constructor.name:`Error`}getValue(e){if(`name`in e&&typeof e.name==`string`){var t=`'`+e.name+`' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message: '`+e.message+`'`),t}if(`message`in e&&typeof e.message==`string`)return e.message;var n=this.getObjectClassName(e);return(n&&n!==`Object`?`'`+n+`'`:`Object`)+` captured as exception with keys: `+At(e)}isSeverityLevel(e){return j(e)&&!M(e)&&kt.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(ot(n))return n}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},Mt=class{match(e){return ie(e)}coerce(e,t){var n=e.constructor.name;return{type:n,value:n+` captured as exception with keys: `+At(e),stack:t.syntheticException?.stack,synthetic:!0}}},Nt=class{match(e){return R(e)}coerce(e,t){return{type:`Error`,value:`Primitive value captured as exception: `+String(e),stack:t.syntheticException?.stack,synthetic:!0}}},Pt=class{match(e){return re(e,`PromiseRejectionEvent`)||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ie(e))return!1;try{var t=e.detail;return typeof t==`object`&&!!t&&`reason`in t}catch{return!1}}coerce(e,t){var n=this.getUnhandledRejectionReason(e);return R(n)?{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: `+String(n),stack:t.syntheticException?.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if(`reason`in e)return e.reason;if(`detail`in e&&e.detail!=null&&typeof e.detail==`object`&&`reason`in e.detail)return e.detail.reason}catch{}return e}},Ft=`$message`,It=`$timestamp`,Lt=new Set([Ft,It]),Rt={enabled:!0,max_bytes:32768};function zt(e){return e?{enabled:e.enabled??Rt.enabled,max_bytes:Vt(e.max_bytes,Rt.max_bytes)}:h({},Rt)}var Bt=class{constructor(e){this.Kt=[],this.Qt=0,this.Bt=zt(e)}setConfig(e){this.Bt=zt(e),this.er()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,((e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n!=`function`&&typeof n!=`symbol`){if(n instanceof Date)return n.toISOString();if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(n&&typeof n==`object`){if(t.has(n))return`[Circular]`;t.add(n)}return n}}))}catch{return}}(e);if(t)try{var n=JSON.parse(t);if(!O(n))return;var r=n,i=r[Ft],a=r[It];return!j(i)||i.trim().length===0||!j(a)&&!F(a)?void 0:{step:r,json:t}}catch{return}}(e);if(t){var n=function(e){if(typeof TextEncoder<`u`)return new TextEncoder().encode(e).length;for(var t=encodeURIComponent(e),n=0,r=0;t.length>r;r++)t[r]===`%`?(n+=1,r+=2):n+=1;return n}(t.json);n>this.Bt.max_bytes||(this.Kt.push({step:t.step,bytes:n}),this.Qt+=n,this.er())}}getAttachable(){return this.Kt.map((e=>e.step))}clear(){this.Kt=[],this.Qt=0}size(){return this.Kt.length}er(){for(;this.Qt>this.Bt.max_bytes&&this.Kt.length>0;){var e=this.Kt.shift();e&&(this.Qt-=e.bytes)}}};function Vt(e,t){if(!F(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var Ht=function(t,n){var{debugEnabled:r}=n===void 0?{}:n,i={C(n){if(e&&(f.DEBUG||u.POSTHOG_DEBUG||r)&&!A(e.console)&&e.console){for(var i=(`__rrweb_original__`in e.console[n])?e.console[n].__rrweb_original__:e.console[n],a=arguments.length,o=Array(a>1?a-1:0),s=1;a>s;s++)o[s-1]=arguments[s];i(t,...o)}},debug(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.C(`debug`,...t)},info(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.C(`log`,...t)},warn(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.C(`warn`,...t)},error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.C(`error`,...t)},critical(){for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];console.error(t,...n)},uninitializedWarning(e){i.error(`You must initialize PostHog before calling `+e)},createLogger:(e,n)=>Ht(t+` `+e,n)};return i},H=Ht(`[PostHog.js]`),U=H.createLogger,Ut=U(`[ExternalScriptsLoader]`),Wt=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Ut.warn(t+` was requested but loading of external scripts is disabled.`),n(`Loading of external scripts is disabled`);var i=r?.querySelectorAll(`script`);if(i){for(var a,o=function(){if(i[s].src===t){var e=i[s];return e.__posthog_loading_callback_fired?{v:n()}:(e.addEventListener(`load`,(t=>{e.__posthog_loading_callback_fired=!0,n(void 0,t)})),e.onerror=e=>n(e),{v:void 0})}},s=0;i.length>s;s++)if(a=o())return a.v}var c=()=>{if(!r)return n(`document not found`);var i=r.createElement(`script`);if(i.type=`text/javascript`,i.crossOrigin=`anonymous`,i.src=t,i.onload=e=>{i.__posthog_loading_callback_fired=!0,n(void 0,e)},i.onerror=e=>n(e),e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return n(`prepare_external_dependency_script returned null`);if(e.config.external_scripts_inject_target===`head`)r.head.appendChild(i);else{var a,o=r.querySelectorAll(`body > script`);o.length>0?(a=o[0].parentNode)==null||a.insertBefore(i,o[0]):r.body.appendChild(i)}};r!=null&&r.body?c():r?.addEventListener(`DOMContentLoaded`,c)};u.__PosthogExtensions__=u.__PosthogExtensions__||{},u.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!==`remote-config`){var r;if(e.config.__preview_external_dependency_versioned_paths)r=e.requestRouter.endpointFor(`assets`,`/static/`+e.version+`/`+t+`.js`);else{var i=`/static/`+t+`.js?v=`+e.version;if(t===`toolbar`){var a=3e5;i=i+`&t=`+Math.floor(Date.now()/a)*a}r=e.requestRouter.endpointFor(`assets`,i)}Wt(e,r,n)}else Wt(e,e.requestRouter.endpointFor(`assets`,`/array/`+e.config.token+`/config.js`),n)},u.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{Wt(e,e.requestRouter.endpointFor(`api`,t),n)};var Gt=`$people_distinct_id`,Kt=`$device_id`,qt=`__alias`,Jt=`__timers`,Yt=`$autocapture_disabled_server_side`,Xt=`$heatmaps_enabled_server_side`,Zt=`$exception_capture_enabled_server_side`,Qt=`$error_tracking_suppression_rules`,$t=`$error_tracking_capture_extension_exceptions`,en=`$web_vitals_enabled_server_side`,tn=`$dead_clicks_enabled_server_side`,nn=`$product_tours_enabled_server_side`,rn=`$web_vitals_allowed_metrics`,an=`$session_recording_remote_config`,on=`$replay_override_sampling`,sn=`$replay_override_linked_flag`,cn=`$replay_override_url_trigger`,ln=`$replay_override_event_trigger`,un=`$sesid`,dn=`$session_is_sampled`,fn=`$enabled_feature_flags`,pn=`$active_feature_flags`,mn=`$early_access_features`,hn=`$feature_flag_details`,gn=`$feature_flag_payloads`,_n=`$feature_flag_request_id`,vn=`$override_feature_flags`,yn=`$override_feature_flag_payloads`,bn=`$stored_person_properties`,xn=`$stored_group_properties`,Sn=`$surveys`,Cn=`$surveys_activated`,wn=`ph_product_tours`,Tn=`$flag_call_reported`,En=`$flag_call_reported_session_id`,Dn=`$feature_flag_errors`,On=`$feature_flag_evaluated_at`,kn=`$user_state`,An=`$client_session_props`,jn=`$capture_rate_limit`,Mn=`$initial_campaign_params`,Nn=`$initial_referrer_info`,Pn=`$initial_person_info`,Fn=`$epp`,In=`__POSTHOG_TOOLBAR__`,Ln=`$posthog_cookieless`,Rn=`$sdk_debug_extensions_init_method`,zn=`$sdk_debug_extensions_init_time_ms`,Bn=`$sdk_debug_recording_script_not_loaded`,Vn=`PostHog loadExternalDependency extension not found.`,Hn=`on_reject`,Un=`always`,Wn=`anonymous`,Gn=`identified`,Kn=`identified_only`,qn=`visibilitychange`,Jn=`beforeunload`,Yn=`$pageview`,Xn=`$pageleave`,Zn=`$identify`,Qn=`$groupidentify`;function $n(e,t){E(e)&&e.forEach(t)}function W(e,t){if(!P(e))if(E(e))e.forEach(t);else if(te(e))e.forEach(((e,n)=>t(e,n)));else for(var n in e)ee.call(e,n)&&t(e[n],n)}var G=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i of n)for(var a in i)i[a]!==void 0&&(e[a]=i[a]);return e};function er(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var tr=function(e){try{return e()}catch{return}},nr=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){H.critical(`Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A.`),H.critical(e)}}},rr=function(e){var t={};return W(e,(function(e,n){(j(e)&&e.length>0||F(e))&&(t[n]=e)})),t},ir=[`herokuapp.com`,`vercel.app`,`netlify.app`];function ar(e){var t=e?.hostname;if(!j(t))return!1;var n=t.split(`.`).slice(-2).join(`.`);for(var r of ir)if(n===r)return!1;return!0}function K(e,t,n,r){var{capture:i=!1,passive:a=!0}=r??{};e?.addEventListener(t,n,{capture:i,passive:a})}function or(e){return e.name===`ph_toolbar_internal`}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return F(e)&&isFinite(e)&&Math.floor(e)===e});var sr=class e{constructor(e){if(this.bytes=e,e.length!==16)throw TypeError(`not 128-bit length`)}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw RangeError(`invalid field value`);var a=new Uint8Array(16);return a[0]=t/2**40,a[1]=t/2**32,a[2]=t/2**24,a[3]=t/2**16,a[4]=t/2**8,a[5]=t,a[6]=112|n>>>8,a[7]=n,a[8]=128|r>>>24,a[9]=r>>>16,a[10]=r>>>8,a[11]=r,a[12]=i>>>24,a[13]=i>>>16,a[14]=i>>>8,a[15]=i,new e(a)}toString(){for(var e=``,t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),t!==3&&t!==5&&t!==7&&t!==9||(e+=`-`);if(e.length!==36)throw Error(`Invalid UUIDv7 was generated`);return e}clone(){return new e(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}},cr=class{constructor(){this.I=0,this.S=0,this.k=new dr}generate(){var e=this.generateOrAbort();if(A(e)){this.I=0;var t=this.generateOrAbort();if(A(t))throw Error(`Could not generate UUID after timestamp reset`);return t}return e}generateOrAbort(){var e=Date.now();if(e>this.I)this.I=e,this.A();else{if(this.I>=e+1e4)return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return sr.fromFieldsV7(this.I,Math.trunc(this.S/2**30),this.S&2**30-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}},lr,ur=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<`u`&&UUIDV7_DENY_WEAK_RNG)throw Error(`no cryptographically strong RNG available`);for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};e&&!A(e.crypto)&&crypto.getRandomValues&&(ur=e=>crypto.getRandomValues(e));var dr=class{constructor(){this.T=new Uint32Array(8),this.N=1/0}nextUint32(){return this.T.length>this.N||(ur(this.T),this.N=0),this.T[this.N++]}},fr=()=>pr().toString(),pr=()=>(lr||=new cr).generate(),mr=``,hr=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,gr={R:()=>!!r,B(e){H.error(`cookieStore error: `+e)},O(e){if(r){try{for(var t=e+`=`,n=r.cookie.split(`;`).filter((e=>e.length)),i=0;n.length>i;i++){for(var a=n[i];a.charAt(0)==` `;)a=a.substring(1,a.length);if(a.indexOf(t)===0)return decodeURIComponent(a.substring(t.length,a.length))}}catch{}return null}},Z(e){var t;try{t=JSON.parse(gr.O(e))||{}}catch{}return t},M(e,t,n,i,a){if(r)try{var o=``,s=``,c=function(e,t){if(t){var n=function(e,t){if(t===void 0&&(t=r),mr)return mr;if(!t||[`localhost`,`127.0.0.1`].includes(e))return``;for(var n=e.split(`.`),i=Math.min(n.length,8),a=`dmn_chk_`+fr();!mr&&i--;){var o=n.slice(i).join(`.`),s=a+`=1;domain=.`+o+`;path=/`;t.cookie=s+`;max-age=3`,t.cookie.includes(a)&&(t.cookie=s+`;max-age=0`,mr=o)}return mr}(e);if(!n){var i=(e=>{var t=e.match(hr);return t?t[0]:``})(e);i!==n&&H.info(`Warning: cookie subdomain discovery mismatch`,i,n),n=i}return n?`; domain=.`+n:``}return``}(r.location.hostname,i);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),o=`; expires=`+l.toUTCString()}a&&(s=`; secure`);var u=e+`=`+encodeURIComponent(JSON.stringify(t))+o+`; SameSite=Lax; path=/`+c+s;return u.length>3686.4&&H.warn(`cookieStore warning: large cookie, len=`+u.length),r.cookie=u,u}catch{return}},F(e,t){if(r!=null&&r.cookie)try{gr.M(e,``,-1,t)}catch{return}}},_r=null,q={R(){if(!N(_r))return _r;var t=!0;if(A(e))t=!1;else try{var n=`__mplssupport__`;q.M(n,`xyz`),q.O(n)!==`"xyz"`&&(t=!1),q.F(n)}catch{t=!1}return t||H.error(`localStorage unsupported; falling back to cookie store`),_r=t,t},B(e){H.error(`localStorage error: `+e)},O(t){try{return e?.localStorage.getItem(t)}catch(e){q.B(e)}return null},Z(e){try{return JSON.parse(q.O(e))||{}}catch{}return null},M(t,n){try{e?.localStorage.setItem(t,JSON.stringify(n))}catch(e){q.B(e)}},F(t){try{e?.localStorage.removeItem(t)}catch(e){q.B(e)}}},vr=[Kt,`distinct_id`,un,dn,Fn,Pn,kn],yr={},br={R:()=>!0,B(e){H.error(`memoryStorage error: `+e)},O:e=>yr[e]||null,Z:e=>yr[e]||null,M(e,t){yr[e]=t},F(e){delete yr[e]}},xr=null,J={R(){if(!N(xr))return xr;if(xr=!0,A(e))xr=!1;else try{var t=`__support__`;J.M(t,`xyz`),J.O(t)!==`"xyz"`&&(xr=!1),J.F(t)}catch{xr=!1}return xr},B(e){H.error(`sessionStorage error: `,e)},O(t){try{return e?.sessionStorage.getItem(t)}catch(e){J.B(e)}return null},Z(e){try{return JSON.parse(J.O(e))||null}catch{}return null},M(t,n){try{e?.sessionStorage.setItem(t,JSON.stringify(n))}catch(e){J.B(e)}},F(t){try{e?.sessionStorage.removeItem(t)}catch(e){J.B(e)}}},Sr=class{constructor(e){this._instance=e}get Bt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.Bt.cookieless_mode===Un||this.isRejected()||this.consent===-1&&this.Bt.cookieless_mode===Hn}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Bt.opt_out_capturing_by_default}optInOut(e){this.nr.M(this.sr,+!!e,this.Bt.cookie_expiration,this.Bt.cross_subdomain_cookie,this.Bt.secure_cookie)}reset(){this.nr.F(this.sr,this.Bt.cross_subdomain_cookie)}get sr(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:n}=this._instance.config;return n||(t?t+e:`__ph_opt_in_out_`+e)}get ir(){var e=this.nr.O(this.sr);return oe(e)?1:x(se,e)?0:-1}get nr(){var e=this.Bt.opt_out_capturing_persistence_type,t=e===`localStorage`?q:gr;if(!this.ar||this.ar!==t){this.ar=t;var n=e===`localStorage`?gr:q;n.O(this.sr)&&(this.ar.O(this.sr)||this.optInOut(oe(n.O(this.sr))),n.F(this.sr,this.Bt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.Bt.respect_dnt&&[n?.doNotTrack,n?.msDoNotTrack,u.doNotTrack].some((e=>oe(e)))}},Cr=U(`[Dead Clicks]`),wr=()=>!0,Tr=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(tn)),r=e.instance.config.capture_dead_clicks;return L(r)?r:!!O(r)||n},Er=class{get lazyLoadedDeadClicksAutocapture(){return this.lr}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(e){`captureDeadClicks`in e&&(this.instance.persistence&&this.instance.persistence.register({[tn]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ur((()=>{this.hr()})):this.stop()}ur(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,`dead-clicks-autocapture`,(t=>{t?Cr.error(`failed to load script`,t):e()}))}hr(){var e;if(r){if(!this.lr&&(e=u.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=O(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.lr=u.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.lr.start(r),Cr.info(`starting...`)}}else Cr.error("`document` not found. Cannot start.")}stop(){this.lr&&(this.lr.stop(),this.lr=void 0,Cr.info(`stopping...`))}},Dr=U(`[SegmentIntegration]`),Or=`posthog-js`;function kr(e,t){var{organization:n,projectId:r,prefix:i,severityAllowList:a=[`error`],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return t=>{if(a!==`*`&&!a.includes(t.level)||!e.__loaded)return t;t.tags||={};var s=e.requestRouter.endpointFor(`ui`,`/project/`+e.config.token+`/person/`+e.get_distinct_id());t.tags[`PostHog Person URL`]=s,e.sessionRecordingStarted()&&(t.tags[`PostHog Recording URL`]=e.get_session_replay_url({withTimestamp:!0}));var c,l=t.exception?.values||[],u=l.map((e=>h({},e,{stacktrace:e.stacktrace?h({},e.stacktrace,{type:`raw`,frames:(e.stacktrace.frames||[]).map((e=>h({},e,{platform:`web:javascript`})))}):void 0}))),d={$exception_message:l[0]?.value||t.message,$exception_type:l[0]?.type,$exception_level:t.level,$exception_list:u,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:l[0]?.value||t.message,$sentry_exception_type:l[0]?.type,$sentry_tags:t.tags};return n&&r&&(d.$sentry_url=(i||`https://sentry.io/organizations/`)+n+`/issues/?project=`+r+`&query=`+t.event_id),o&&((c=e.exceptions)==null||c.sendExceptionEvent(d)),t}}var Ar=class{constructor(e,t,n,r,i,a){this.name=Or,this.setupOnce=function(o){o(kr(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}},jr=class{constructor(e){this.cr=(e,t,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength)&&(H.info(`[PageViewManager] Session rotated, clearing pageview state`,{sessionId:e,changeReason:n}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.vr()}vr(){this.pr=this._instance.sessionManager?.onSessionId(this.cr)}destroy(){var e;(e=this.pr)==null||e.call(this),this.pr=void 0}doPageView(t,n){var r=this.gr(t,n);return this.dr={pathname:e?.location.pathname??``,pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(e){return this.gr(e,this.dr?.pageViewId)}doEvent(){return{$pageview_id:this.dr?.pageViewId}}gr(e,t){var n=this.dr;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:s,maxContentHeight:c,lastContentY:l,maxContentY:u}=i;if(!(A(a)||A(o)||A(s)||A(c)||A(l)||A(u))){a=Math.ceil(a),o=Math.ceil(o),s=Math.ceil(s),c=Math.ceil(c),l=Math.ceil(l),u=Math.ceil(u);var d=a>1?z(o/a,0,1,H):1,f=a>1?z(s/a,0,1,H):1,p=c>1?z(l/c,0,1,H):1,m=c>1?z(u/c,0,1,H):1;r=G(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:m})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}},Mr={[Gt]:{exposure:`hidden`},[qt]:{exposure:`hidden`},__cmpns:{exposure:`hidden`},[Jt]:{exposure:`hidden`},[Yt]:{exposure:`event`},[Xt]:{exposure:`hidden`},[Zt]:{exposure:`event`},[Qt]:{exposure:`hidden`},[$t]:{exposure:`event`},[en]:{exposure:`event`},[tn]:{exposure:`event`},[nn]:{exposure:`hidden`},[rn]:{exposure:`event`},[an]:{exposure:`hidden`},$session_recording_enabled_server_side:{exposure:`hidden`},[un]:{exposure:`hidden`},[dn]:{exposure:`event`},$session_past_minimum_duration:{exposure:`event`},$session_recording_url_trigger_activated_session:{exposure:`event`},$session_recording_event_trigger_activated_session:{exposure:`event`},$debug_first_full_snapshot_timestamp:{exposure:`event`},[fn]:{exposure:`derived`,shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!O(e))return{};for(var t={},n=Object.keys(e),r=0;n.length>r;r++)t[`$feature/`+n[r]]=e[n[r]];return t}},[pn]:{exposure:`event`},[mn]:{exposure:`hidden`},[hn]:{exposure:`hidden`},[gn]:{exposure:`event`},[_n]:{exposure:`event`},[vn]:{exposure:`event`},[yn]:{exposure:`hidden`},[bn]:{exposure:`hidden`},[xn]:{exposure:`hidden`},[Sn]:{exposure:`hidden`},[Cn]:{exposure:`event`},[wn]:{exposure:`hidden`},$product_tours_activated:{exposure:`hidden`},$conversations_widget_session_id:{exposure:`event`},$conversations_ticket_id:{exposure:`event`},$conversations_widget_state:{exposure:`event`},$conversations_user_traits:{exposure:`event`},[Tn]:{exposure:`hidden`},[En]:{exposure:`hidden`},[Dn]:{exposure:`hidden`},[On]:{exposure:`hidden`},[kn]:{exposure:`hidden`},[An]:{exposure:`hidden`},[jn]:{exposure:`hidden`},[Mn]:{exposure:`hidden`},[Nn]:{exposure:`hidden`},[Pn]:{exposure:`hidden`},[Fn]:{exposure:`hidden`},[on]:{exposure:`event`},[sn]:{exposure:`event`},[cn]:{exposure:`event`},[ln]:{exposure:`event`},[Rn]:{exposure:`event`},[zn]:{exposure:`event`},[Bn]:{exposure:`event`},$sdk_debug_replay_event_trigger_status:{exposure:`event`},$sdk_debug_replay_linked_flag_trigger_status:{exposure:`event`},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:`event`},$sdk_debug_replay_remote_trigger_matching_config:{exposure:`event`},$sdk_debug_replay_trigger_groups_count:{exposure:`event`},$sdk_debug_replay_url_trigger_status:{exposure:`event`},$session_recording_start_reason:{exposure:`event`}},Nr=[[`$posthog_sr_group_event_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_url_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_sampling_`,{exposure:`hidden`}]],Pr=e=>{var t=r?.createElement(`a`);return A(t)?null:(t.href=e,t)},Fr=function(e,t){for(var n,r=((e.split(`#`)[0]||``).split(/\?(.*)/)[1]||``).replace(/^\?+/g,``).split(`&`),i=0;r.length>i;i++){var a=r[i].split(`=`);if(a[0]===t){n=a;break}}if(!E(n)||2>n.length)return``;var o=n[1];try{o=decodeURIComponent(o)}catch{H.error(`Skipping decoding for malformed query param: `+o)}return o.replace(/\+/g,` `)},Ir=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split(`#`),i=r[1],a=(r[0]||``).split(`?`),o=a[1],s=a[0],c=(o||``).split(`&`),l=[],u=0;c.length>u;u++){var d=c[u].split(`=`);E(d)&&(t.includes(d[0])?l.push(d[0]+`=`+n):l.push(c[u]))}var f=s;return o!=null&&(f+=`?`+l.join(`&`)),i!=null&&(f+=`#`+i),f},Lr=function(e,t){var n=e.match(RegExp(t+`=([^&]*)`));return n?n[1]:null},Rr=`https?://(.*)`,zr=[`gclid`,`gclsrc`,`dclid`,`gbraid`,`wbraid`,`fbclid`,`msclkid`,`twclid`,`li_fat_id`,`igshid`,`ttclid`,`rdt_cid`,`epik`,`qclid`,`sccid`,`irclid`,`_kx`],Br=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gad_source`,`mc_cid`,...zr],Vr=`<masked>`,Hr=[`li_fat_id`];function Ur(e,t,n){if(!r)return{};var i,a=t?[...zr,...n||[]]:[],o=Wr(Ir(r.URL,a,Vr),e);return G((i={},W(Hr,(function(e){var t=gr.O(e);i[e]=t||null})),i),o)}function Wr(e,t){var n=Br.concat(t||[]),r={};return W(n,(function(t){r[t]=Fr(e,t)||null})),r}function Gr(e){var t=function(e){return e?e.search(Rr+`google.([^/?]*)`)===0?`google`:e.search(Rr+`bing.com`)===0?`bing`:e.search(Rr+`yahoo.com`)===0?`yahoo`:e.search(Rr+`duckduckgo.com`)===0?`duckduckgo`:null:null}(e),n=t==`yahoo`?`p`:`q`,i={};if(!N(t)){i.$search_engine=t;var a=r?Fr(r.referrer,n):``;a.length&&(i.ph_keyword=a)}return i}function Kr(){return navigator.language||navigator.userLanguage}var qr=`$direct`;function Jr(){return r?.referrer||qr}function Yr(e,t){var n=e?[...zr,...t||[]]:[],r=i?.href.substring(0,1e3);return{r:Jr().substring(0,1e3),u:r?Ir(r,n,Vr):void 0}}function Xr(e){var{r:t,u:n}=e,r={$referrer:t,$referring_domain:t==null?void 0:t==qr?qr:Pr(t)?.host};if(n){r.$current_url=n;var i=Pr(n);r.$host=i?.host,r.$pathname=i?.pathname,G(r,Wr(n))}return t&&G(r,Gr(t)),r}function Zr(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Qr(){try{return new Date().getTimezoneOffset()}catch{return}}var $r=[`cookie`,`localstorage`,`localstorage+cookie`,`sessionstorage`,`memory`],ei=class{constructor(e,t){this.Bt=e,this.props={},this.mr=!1,this.yr=(e=>{var t=``;return e.token&&(t=e.token.replace(/\+/g,`PL`).replace(/\//g,`SL`).replace(/=/g,`EQ`)),e.persistence_name?`ph_`+e.persistence_name:`ph_`+t+`_posthog`})(e),this.nr=this.br(e),this.load(),e.debug&&H.info(`Persistence loaded`,e.persistence,h({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.wr}br(t){$r.indexOf(t.persistence.toLowerCase())===-1&&(H.critical(`Unknown persistence type `+t.persistence+`; falling back to localStorage+cookie`),t.persistence=`localStorage+cookie`);var n=function(t){t===void 0&&(t=[]);var n=[...vr,...t];return h({},q,{Z(e){try{var t={};try{t=gr.Z(e)||{}}catch{}var n=G(t,JSON.parse(q.O(e)||`{}`));return q.M(e,n),n}catch{}return null},M(e,t,r,i,a,o){try{q.M(e,t,void 0,void 0,o);var s={};n.forEach((e=>{t[e]&&(s[e]=t[e])})),Object.keys(s).length&&gr.M(e,s,r,i,a,o)}catch(e){q.B(e)}},F(t,n){try{e?.localStorage.removeItem(t),gr.F(t,n)}catch(e){q.B(e)}}})}(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r===`localstorage`&&q.R()?q:r===`localstorage+cookie`&&n.R()?n:r===`sessionstorage`&&J.R()?J:r===`memory`?br:r===`cookie`?gr:n.R()?n:gr}_r(e){var t=e??this.Bt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var n=this.props[On];return!n||typeof n!=`number`||Date.now()-n>t}properties(){var e={};return W(this.props,((t,n)=>{var r=(e=>{var t=Mr[e];if(t)return t;for(var[n,r]of Nr)if(e.indexOf(n)===0)return r})(n);if(r?.exposure===`derived`){if(r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,n===fn?()=>this._r():()=>!1))return;r.transformToEventProperties&&G(e,r.transformToEventProperties(t))}else r&&r.exposure!==`event`||(e[n]=t)})),e}load(){if(!this.wr){var e=this.nr.Z(this.yr);e&&(this.props=G({},e))}}save(){this.wr||this.nr.M(this.yr,this.props,this.Ir,this.Cr,this.Sr,this.Bt.debug)}remove(){this.nr.F(this.yr,!1),this.nr.F(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(e,t,n){if(O(e)){A(t)&&(t=`None`),this.Ir=A(n)?this.kr:n;var r=!1;if(W(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.Tr(n,e),r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(O(e)){this.Ir=A(t)?this.kr:t;var n=!1;if(W(e,((t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.Tr(r,t),n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Ar(e),this.save())}update_campaign_params(){if(!this.mr){var e=Ur(this.Bt.custom_campaign_params,this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties);k(rr(e))||this.register(e),this.mr=!0}}update_search_keyword(){var e;this.register((e=r?.referrer)?Gr(e):{})}update_referrer_info(){this.register_once({$referrer:Jr(),$referring_domain:r!=null&&r.referrer&&Pr(r.referrer)?.host||qr},void 0)}set_initial_person_info(){this.props[Mn]||this.props[Nn]||this.register_once({[Pn]:Yr(this.Bt.mask_personal_data_properties,this.Bt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};W([Nn,Mn],(t=>{var n=this.props[t];n&&W(n,(function(t,n){e[`$initial_`+C(n)]=t}))}));var t,n,r=this.props[Pn];return r&&G(e,(t=Xr(r),n={},W(t,(function(e,t){n[`$initial_`+C(t)]=e})),n)),e}safe_merge(e){return W(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t,n){if(this.kr=this.Ir=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var n=[...e].sort(),r=[...t].sort();return n.every(((e,t)=>e===r[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var r=this.br(e),i=this.props;this.clear(),this.nr=r,this.props=i,this.save()}}set_disabled(e){this.wr=e,this.wr?this.remove():this.save()}set_cross_subdomain(e){e!==this.Cr&&(this.Cr=e,this.remove(),this.save())}set_secure(e){e!==this.Sr&&(this.Sr=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[Jt]||{};n[e]=t,this.Tr(Jt,n),this.save()}remove_event_timer(e){var t=this.props[Jt]||{},n=t[e];return A(n)||(delete t[e],this.Tr(Jt,t),this.save()),n}get_property(e){return this.props[e]}set_property(e,t){this.Tr(e,t),this.save()}Tr(e,t){this.props[e]=t}Ar(e){delete this.props[e]}},ti={Activation:`events`,Cancellation:`cancelEvents`},ni={Popover:`popover`,API:`api`,Widget:`widget`,ExternalSurvey:`external_survey`},ri={SHOWN:`survey shown`,DISMISSED:`survey dismissed`,SENT:`survey sent`,ABANDONED:`survey abandoned`},ii={SURVEY_ID:`$survey_id`,SURVEY_NAME:`$survey_name`,SURVEY_RESPONSE:`$survey_response`,SURVEY_ITERATION:`$survey_iteration`,SURVEY_ITERATION_START_DATE:`$survey_iteration_start_date`,SURVEY_PARTIALLY_COMPLETED:`$survey_partially_completed`,SURVEY_SUBMISSION_ID:`$survey_submission_id`,SURVEY_QUESTIONS:`$survey_questions`,SURVEY_COMPLETED:`$survey_completed`,PRODUCT_TOUR_ID:`$product_tour_id`,SURVEY_LAST_SEEN_DATE:`$survey_last_seen_date`,SURVEY_LANGUAGE:`$survey_language`},ai={Popover:`popover`,Inline:`inline`},oi={SHOWN:`product tour shown`,DISMISSED:`product tour dismissed`,COMPLETED:`product tour completed`,STEP_SHOWN:`product tour step shown`,STEP_COMPLETED:`product tour step completed`,BUTTON_CLICKED:`product tour button clicked`,STEP_SELECTOR_FAILED:`product tour step selector failed`,BANNER_CONTAINER_SELECTOR_FAILED:`product tour banner container selector failed`,BANNER_ACTION_CLICKED:`product tour banner action clicked`},si={TOUR_ID:`$product_tour_id`,TOUR_NAME:`$product_tour_name`,TOUR_ITERATION:`$product_tour_iteration`,TOUR_RENDER_REASON:`$product_tour_render_reason`,TOUR_STEP_ID:`$product_tour_step_id`,TOUR_STEP_ORDER:`$product_tour_step_order`,TOUR_STEP_TYPE:`$product_tour_step_type`,TOUR_DISMISS_REASON:`$product_tour_dismiss_reason`,TOUR_BUTTON_TEXT:`$product_tour_button_text`,TOUR_BUTTON_ACTION:`$product_tour_button_action`,TOUR_BUTTON_LINK:`$product_tour_button_link`,TOUR_BUTTON_TOUR_ID:`$product_tour_button_tour_id`,TOUR_STEPS_COUNT:`$product_tour_steps_count`,TOUR_STEP_SELECTOR:`$product_tour_step_selector`,TOUR_STEP_SELECTOR_FOUND:`$product_tour_step_selector_found`,TOUR_STEP_ELEMENT_TAG:`$product_tour_step_element_tag`,TOUR_STEP_ELEMENT_ID:`$product_tour_step_element_id`,TOUR_STEP_ELEMENT_CLASSES:`$product_tour_step_element_classes`,TOUR_STEP_ELEMENT_TEXT:`$product_tour_step_element_text`,TOUR_ERROR:`$product_tour_error`,TOUR_MATCHES_COUNT:`$product_tour_matches_count`,TOUR_FAILURE_PHASE:`$product_tour_failure_phase`,TOUR_WAITED_FOR_ELEMENT:`$product_tour_waited_for_element`,TOUR_WAIT_DURATION_MS:`$product_tour_wait_duration_ms`,TOUR_BANNER_SELECTOR:`$product_tour_banner_selector`,TOUR_LINKED_SURVEY_ID:`$product_tour_linked_survey_id`,USE_MANUAL_SELECTOR:`$use_manual_selector`,INFERENCE_DATA_PRESENT:`$inference_data_present`,TOUR_LAST_SEEN_DATE:`$product_tour_last_seen_date`,TOUR_TYPE:`$product_tour_type`},ci=U(`[RateLimiter]`),li=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{ci.info((e||`events`)+` is quota limited.`),this.serverLimits[e]=new Date().getTime()+6e4}))}catch(e){ci.warn(`could not rate limit - continuing. Error: "`+e?.message+`"`,{text:t});return}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){return this.instance.config.rate_limiting?.events_per_second||10}get captureEventsBurstLimit(){return Math.max(this.instance.config.rate_limiting?.events_burst_limit||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t;e===void 0&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:r}=this,i=new Date().getTime(),a=this.instance.persistence?.get_property(jn)??{tokens:n,last:i};a.tokens+=(i-a.last)/1e3*r,a.last=i,a.tokens>n&&(a.tokens=n);var o=1>a.tokens;return o||e||(a.tokens=Math.max(0,a.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture(`$$client_ingestion_warning`,{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to `+r+` events per second and `+n+` events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(t=this.instance.persistence)==null||t.set_property(jn,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||`events`]||!1;return!1!==t&&new Date().getTime()<t}},ui=U(`[RemoteConfig]`),di=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=u._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Er(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`remote-config`,(()=>e(this.remoteConfig))):e()}Rr(e){this._instance._send_request({method:`GET`,url:this._instance.requestRouter.endpointFor(`assets`,`/array/`+this._instance.config.token+`/config`),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return ui.info(`Using preloaded remote config`,this.remoteConfig),this.Nr(this.remoteConfig),void this.Mr();if(this._instance.Fr())return void ui.warn(`Remote config is disabled. Falling back to local config.`);this.Er((e=>{if(!e)return ui.info(`No config found after loading remote JS config. Falling back to JSON.`),void this.Rr((e=>{this.Nr(e),this.Mr()}));this.Nr(e),this.Mr()}))}catch(e){ui.error(`Error loading remote config`,e)}}stop(){this.Or&&=(clearInterval(this.Or),void 0)}refresh(){this._instance.Fr()||r?.visibilityState===`hidden`||this._instance.reloadFeatureFlags()}Mr(){if(!this.Or){var e=this._instance.config.remote_config_refresh_interval_ms??3e5;e!==0&&(this.Or=setInterval((()=>{this.refresh()}),e))}}Nr(e){var t;e||ui.error(`Failed to fetch remote config from PostHog.`),this._instance.Nr(e??{}),!1!==e?.hasFeatureFlags&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(t=this._instance.featureFlags)==null||t.ensureFlagsLoaded())}},fi={GZipJS:`gzip-js`,Base64:`base64`},Y=Uint8Array,X=Uint16Array,pi=Uint32Array,mi=new Y([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),hi=new Y([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),gi=new Y([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_i=function(e,t){for(var n=new X(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new pi(n[30]);for(r=1;30>r;++r)for(var a=n[r];n[r+1]>a;++a)i[a]=a-n[r]<<5|r;return[n,i]},vi=_i(mi,2),yi=vi[1];vi[0][28]=258,yi[258]=28;for(var bi=_i(hi,0)[1],xi=new X(32768),Z=0;32768>Z;++Z){var Si=(43690&Z)>>>1|(21845&Z)<<1;xi[Z]=((65280&(Si=(61680&(Si=(52428&Si)>>>2|(13107&Si)<<2))>>>4|(3855&Si)<<4))>>>8|(255&Si)<<8)>>>1}var Ci=function(e,t,n){for(var r=e.length,i=0,a=new X(t);r>i;++i)++a[e[i]-1];var o,s=new X(t);for(i=0;t>i;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new X(1<<t);var c=15-t;for(i=0;r>i;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,f=d|(1<<u)-1;f>=d;++d)o[xi[d]>>>c]=l}else for(o=new X(r),i=0;r>i;++i)o[i]=xi[s[e[i]-1]++]>>>15-e[i];return o},wi=new Y(288);for(Z=0;144>Z;++Z)wi[Z]=8;for(Z=144;256>Z;++Z)wi[Z]=9;for(Z=256;280>Z;++Z)wi[Z]=7;for(Z=280;288>Z;++Z)wi[Z]=8;var Ti=new Y(32);for(Z=0;32>Z;++Z)Ti[Z]=5;var Ei=Ci(wi,9,0),Di=Ci(Ti,5,0),Oi=function(e){return(e/8>>0)+(7&e&&1)},ki=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof X?X:e instanceof pi?pi:Y)(n-t);return r.set(e.subarray(t,n)),r},Ai=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},ji=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Mi=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[new Y(0),0];if(i==1){var o=new Y(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[d].f>n[l].f?l++:d++],c=n[l!=u&&n[d].f>n[l].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var f=a[0].s;for(r=1;i>r;++r)a[r].s>f&&(f=a[r].s);var p=new X(f+1),m=Ni(n[u-1],p,0);if(m>t){r=0;var h=0,g=m-t,_=1<<g;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i>r;++r){var v=a[r].s;if(t>=p[v])break;h+=_-(1<<m-p[v]),p[v]=t}for(h>>>=g;h>0;){var y=a[r].s;t>p[y]?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return[new Y(p),m]},Ni=function(e,t,n){return e.s==-1?Math.max(Ni(e.l,t,n+1),Ni(e.r,t,n+1)):t[e.s]=n},Pi=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new X(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;t>=s;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},Fi=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},Ii=function(e,t,n){var r=n.length,i=Oi(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;r>a;++a)e[i+a+4]=n[a];return 8*(i+4+r)},Li=function(e,t,n,r,i,a,o,s,c,l,u){Ai(t,u++,n),++i[256];for(var d=Mi(i,15),f=d[0],p=d[1],m=Mi(a,15),h=m[0],g=m[1],_=Pi(f),v=_[0],y=_[1],b=Pi(h),x=b[0],S=b[1],C=new X(19),w=0;v.length>w;++w)C[31&v[w]]++;for(w=0;x.length>w;++w)C[31&x[w]]++;for(var ee=Mi(C,7),T=ee[0],E=ee[1],D=19;D>4&&!T[gi[D-1]];--D);var O,k,A,j,M=l+5<<3,N=Fi(i,wi)+Fi(a,Ti)+o,P=Fi(i,f)+Fi(a,h)+o+14+3*D+Fi(C,T)+(2*C[16]+3*C[17]+7*C[18]);if(N>=M&&P>=M)return Ii(t,u,e.subarray(c,c+l));if(Ai(t,u,1+(N>P)),u+=2,N>P){O=Ci(f,p,0),k=f,A=Ci(h,g,0),j=h;var F=Ci(T,E,0);for(Ai(t,u,y-257),Ai(t,u+5,S-1),Ai(t,u+10,D-4),u+=14,w=0;D>w;++w)Ai(t,u+3*w,T[gi[w]]);u+=3*D;for(var I=[v,x],L=0;2>L;++L){var te=I[L];for(w=0;te.length>w;++w)Ai(t,u,F[ne=31&te[w]]),u+=T[ne],ne>15&&(Ai(t,u,te[w]>>>5&127),u+=te[w]>>>12)}}else O=Ei,k=wi,A=Di,j=Ti;for(w=0;s>w;++w)if(r[w]>255){var ne;ji(t,u,O[257+(ne=r[w]>>>18&31)]),u+=k[ne+257],ne>7&&(Ai(t,u,r[w]>>>23&31),u+=mi[ne]);var R=31&r[w];ji(t,u,A[R]),u+=j[R],R>3&&(ji(t,u,r[w]>>>5&8191),u+=hi[R])}else ji(t,u,O[r[w]]),u+=k[r[w]];return ji(t,u,O[256]),u+k[256]},Ri=new pi([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),zi=function(){for(var e=new pi(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Bi=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Vi(e,t){t===void 0&&(t={});var n=function(){var e=4294967295;return{p(t){for(var n=e,r=0;t.length>r;++r)n=zi[255&n^t[r]]^n>>>8;e=n},d(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,a,o,s,c,l=(s=10+((i=t).filename&&i.filename.length+1||0),c=8,function(e,t,n,r,i,a){var o=e.length,s=new Y(r+o+5*(1+Math.floor(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?l=Ii(c,l,e.subarray(u,d)):(c[u]=!0,l=Ii(c,l,e.subarray(u,o)))}else{for(var f=Ri[t-1],p=f>>>13,m=8191&f,h=(1<<n)-1,g=new X(32768),_=new X(h+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&h},x=new pi(25e3),S=new X(288),C=new X(32),w=0,ee=0,T=(u=0,0),E=0,D=0;o>u;++u){var O=b(u),k=32767&u,A=_[O];if(g[k]=A,_[O]=k,u>=E){var j=o-u;if((w>7e3||T>24576)&&j>423){l=Li(e,c,0,x,S,C,ee,T,D,u-D,l),T=w=ee=0,D=u;for(var M=0;286>M;++M)S[M]=0;for(M=0;30>M;++M)C[M]=0}var N=2,P=0,F=m,I=k-A&32767;if(j>2&&O==b(u-I))for(var L=Math.min(p,j)-1,te=Math.min(32767,u),ne=Math.min(258,j);te>=I&&--F&&k!=A;){if(e[u+N]==e[u+N-I]){for(var R=0;ne>R&&e[u+R]==e[u+R-I];++R);if(R>N){if(N=R,P=I,R>L)break;var re=Math.min(I,R-2),ie=0;for(M=0;re>M;++M){var ae=u-I+M+32768&32767,oe=ae-g[ae]+32768&32767;oe>ie&&(ie=oe,A=ae)}}}I+=(k=A)-(A=g[k])+32768&32767}if(P){x[T++]=268435456|yi[N]<<18|bi[P];var se=31&yi[N],z=31&bi[P];ee+=mi[se]+hi[z],++S[257+se],++C[z],E=u+N,++w}else x[T++]=e[u],++S[e[u]]}}l=Li(e,c,!0,x,S,C,ee,T,D,u-D,l)}return ki(s,0,r+Oi(l)+i)}(a=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+o.mem,s,c)),u=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Bi(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),Bi(l,u-8,n.d()),Bi(l,u-4,r),l}var Hi=!!o||!!a,Ui=`text/plain`,Wi=!1,Gi=function(e,t,n){n===void 0&&(n=!0);var[r,i]=e.split(`?`),a=h({},t),o=i?.split(`&`).map((e=>{var t,[r,i]=e.split(`=`),o=n&&(t=a[r])!=null?t:i;return delete a[r],r+`=`+o}))??[],s=function(e,t){var n,r;t===void 0&&(t=`&`);var i=[];return W(e,(function(e,t){A(e)||A(t)||t===`undefined`||(n=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(t),i[i.length]=r+`=`+n)})),i.join(t)}(a);return s&&o.push(s),r+`?`+o.join(`&`)},Ki=(e,t)=>JSON.stringify(e,((e,t)=>typeof t==`bigint`?t.toString():t),t),qi=e=>{if(e.tr)return e.tr;var{data:t,compression:n}=e;if(t){if(n===fi.GZipJS){var r=Vi(function(e,t){var n=e.length;if(typeof TextEncoder<`u`)return new TextEncoder().encode(e);for(var r=new Y(e.length+(e.length>>>1)),i=0,a=function(e){r[i++]=e},o=0;n>o;++o){if(i+5>r.length){var s=new Y(i+8+(n-o<<1));s.set(r),r=s}var c=e.charCodeAt(o);128>c?a(c):2048>c?(a(192|c>>>6),a(128|63&c)):c>55295&&57344>c?(a(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++o))>>>18),a(128|c>>>12&63),a(128|c>>>6&63),a(128|63&c)):(a(224|c>>>12),a(128|c>>>6&63),a(128|63&c))}return ki(r,0,i)}(Ki(t)),{mtime:0});return{contentType:Ui,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===fi.Base64){var i=(e=>`data=`+encodeURIComponent(typeof e==`string`?e:Ki(e)))(function(e){return e&&btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16)))))}(Ki(t)));return{contentType:`application/x-www-form-urlencoded`,body:i,estimatedSize:new Blob([i]).size}}var a=Ki(t);return{contentType:`application/json`,body:a,estimatedSize:new Blob([a]).size}}},Ji=function(){var e=m((function*(e){var t=yield function(e,t,n){return _.apply(this,arguments)}(Ki(e.data),f.DEBUG,{rethrow:!0});if(!t)return e;var n=yield t.arrayBuffer();return h({},e,{tr:{contentType:Ui,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),Yi=(e,t)=>Gi(e,{_:new Date().getTime().toString(),ver:f.JS_SDK_VERSION,compression:t}),Xi=[];a&&Xi.push({transport:`fetch`,method(e){var{contentType:t,body:n,estimatedSize:r}=qi(e)??{},i=new Headers;W(e.headers,(function(e,t){i.append(t,e)})),t&&i.append(`Content-Type`,t);var o=e.url,c=null;if(s){var l=new s;c={signal:l.signal,timeout:setTimeout((()=>l.abort()),e.timeout)}}a(o,h({method:e?.method||`GET`,headers:i,keepalive:e.method===`POST`&&52428.8>(r||0),body:n,signal:c?.signal},e.fetchOptions)).then((t=>t.text().then((n=>{var r={statusCode:t.status,text:n};if(t.status===200)try{r.json=JSON.parse(n)}catch(e){H.error(e)}e.callback==null||e.callback(r)})))).catch((t=>{H.error(t),e.callback==null||e.callback({statusCode:0,error:t})})).finally((()=>c?clearTimeout(c.timeout):null))}}),o&&Xi.push({transport:`XHR`,method(e){var t=new o;t.open(e.method||`GET`,e.url,!0);var{contentType:n,body:r}=qi(e)??{};W(e.headers,(function(e,n){t.setRequestHeader(n,e)})),n&&t.setRequestHeader(`Content-Type`,n),e.timeout&&(t.timeout=e.timeout),e.disableXHRCredentials||(t.withCredentials=!0),t.onreadystatechange=()=>{if(t.readyState===4){var n={statusCode:t.status,text:t.responseText};if(t.status===200)try{n.json=JSON.parse(t.responseText)}catch{}e.callback==null||e.callback(n)}},t.send(r)}}),n!=null&&n.sendBeacon&&Xi.push({transport:`sendBeacon`,method(e){var t=Gi(e.url,{beacon:`1`});try{var{contentType:r,body:i}=qi(e)??{};if(!i)return;var a=i instanceof Blob?i:new Blob([i],{type:r});n.sendBeacon(t,a)}catch{}}});var Zi=3e3,Qi=class{constructor(e,t){this.Pr=!0,this.Lr=[],this.Dr=z(t?.flush_interval_ms||Zi,250,5e3,H.createLogger(`flush interval`),Zi),this.Br=e}enqueue(e){this.Lr.push(e),this.jr||this.$r()}unload(){this.qr();var e=this.Lr.length>0?this.Zr():{},t=Object.values(e);[...t.filter((e=>e.url.indexOf(`/e`)===0)),...t.filter((e=>e.url.indexOf(`/e`)!==0))].map((e=>{this.Br(h({},e,{transport:`sendBeacon`}))}))}enable(){this.Pr=!1,this.$r()}$r(){var e=this;this.Pr||(this.jr=setTimeout((()=>{if(this.qr(),this.Lr.length>0){var t=this.Zr(),n=function(){var n=t[r],i=new Date().getTime();n.data&&E(n.data)&&W(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.Br(n)};for(var r in t)n()}}),this.Dr))}qr(){clearTimeout(this.jr),this.jr=void 0}Zr(){var e={};return W(this.Lr,(t=>{var n,r=t,i=(r?r.batchKey:null)||r.url;A(e[i])&&(e[i]=h({},r,{data:[]})),(n=e[i].data)==null||n.push(r.data)})),this.Lr=[],e}},$i=[`retriesPerformedSoFar`],ea=class{constructor(t){this.Hr=!1,this.Vr=3e3,this.Lr=[],this._instance=t,this.Lr=[],this.zr=!0,!A(e)&&`onLine`in e.navigator&&(this.zr=e.navigator.onLine,this.Ur=()=>{this.zr=!0,this.Yr()},this.Gr=()=>{this.zr=!1},K(e,`online`,this.Ur),K(e,`offline`,this.Gr))}get length(){return this.Lr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=g(e,$i);I(t)&&(n.url=Gi(n.url,{retry_count:t})),this._instance._send_request(h({},n,{callback:e=>{e.statusCode===200||e.statusCode>=400&&500>e.statusCode||(t??0)>=10?n.callback==null||n.callback(e):this.Wr(h({retriesPerformedSoFar:t},n))}}))}Wr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*2**e,n=t/2,r=Math.min(18e5,t),i=Math.random()-.5;return Math.ceil(r+i*(r-n))}(t),r=Date.now()+n;this.Lr.push({retryAt:r,requestOptions:e});var i=`Enqueued failed request for retry in `+n;navigator.onLine||(i+=` (Browser is offline)`),H.warn(i),this.Hr||(this.Hr=!0,this.Xr())}Xr(){if(this.Jr&&clearTimeout(this.Jr),this.Lr.length===0)return this.Hr=!1,void(this.Jr=void 0);this.Jr=setTimeout((()=>{this.zr&&this.Lr.length>0&&this.Yr(),this.Xr()}),this.Vr)}Yr(){var e=Date.now(),t=[],n=this.Lr.filter((n=>e>n.retryAt||(t.push(n),!1)));if(this.Lr=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:t}of(this.Jr&&=(clearTimeout(this.Jr),void 0),this.Hr=!1,A(e)||(this.Ur&&=(e.removeEventListener(`online`,this.Ur),void 0),this.Gr&&=(e.removeEventListener(`offline`,this.Gr),void 0)),this.Lr))try{this._instance._send_request(h({},t,{transport:`sendBeacon`}))}catch(e){H.error(e)}this.Lr=[]}},ta=class{constructor(e){this.Kr=()=>{this.Qr||={};var e=this.scrollElement(),t=this.scrollY(),n=e?Math.max(0,e.scrollHeight-e.clientHeight):0,r=t+(e?.clientHeight||0),i=e?.scrollHeight||0;this.Qr.lastScrollY=Math.ceil(t),this.Qr.maxScrollY=Math.max(t,this.Qr.maxScrollY??0),this.Qr.maxScrollHeight=Math.max(n,this.Qr.maxScrollHeight??0),this.Qr.lastContentY=r,this.Qr.maxContentY=Math.max(r,this.Qr.maxContentY??0),this.Qr.maxContentHeight=Math.max(i,this.Qr.maxContentHeight??0)},this._instance=e}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Qr}resetContext(){var e=this.Qr;return setTimeout(this.Kr,0),e}startMeasuringScrollPosition(){K(e,`scroll`,this.Kr,{capture:!0}),K(e,`scrollend`,this.Kr,{capture:!0}),K(e,`resize`,this.Kr)}scrollElement(){if(!this.ei)return e?.document.documentElement;for(var t of E(this.ei)?this.ei:[this.ei]){var n=e?.document.querySelector(t);if(n)return n}}scrollY(){if(this.ei){var t=this.scrollElement();return t&&t.scrollTop||0}return e&&(e.scrollY||e.pageYOffset||e.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var t=this.scrollElement();return t&&t.scrollLeft||0}return e&&(e.scrollX||e.pageXOffset||e.document.documentElement.scrollLeft)||0}},na=e=>Yr(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties),ra=class{constructor(e,t,n,r){this.ti=e=>{var t=this.ri();if(!t||t.sessionId!==e){var n={sessionId:e,props:this.ii(this._instance)};this.ni.register({[An]:n})}},this._instance=e,this.si=t,this.ni=n,this.ii=r||na,this.si.onSessionId(this.ti)}ri(){return this.ni.props[An]}getSetOnceProps(){var e=this.ri()?.props;return e?`r`in e?Xr(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var e={};return W(rr(this.getSetOnceProps()),((t,n)=>{n===`$current_url`&&(n=`url`),e[`$session_entry_`+C(n)]=t})),e}},ia=class{constructor(){this.oi={}}on(e,t){return this.oi[e]||(this.oi[e]=[]),this.oi[e].push(t),()=>{this.oi[e]=this.oi[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.oi[e]||[])n(t);for(var r of this.oi[`*`]||[])r(e,t)}},aa=U(`[SessionId]`),oa=class{on(e,t){return this.ai.on(e,t)}constructor(e,t,n){var r;if(this.li=[],this.ui=void 0,this.ai=new ia,this.hi=(e,t)=>!(!I(e)||!I(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error(`SessionIdManager requires a PostHogPersistence instance`);if(e.config.cookieless_mode===Un)throw Error(`SessionIdManager cannot be used with cookieless_mode="always"`);this.Bt=e.config,this.ni=e.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=t||fr,this.fi=n||fr;var i=this.Bt.persistence_name||this.Bt.token;if(this._sessionTimeoutMs=1e3*z(this.Bt.session_idle_timeout_seconds||1800,60,36e3,aa.createLogger(`session_idle_timeout_seconds`),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi=`ph_`+i+`_window_id`,this.mi=`ph_`+i+`_primary_window_exists`,this.yi()){var a=J.Z(this.gi),o=J.Z(this.mi);a&&!o?this.ci=a:J.F(this.gi),J.M(this.mi,!0)}if((r=this.Bt.bootstrap)!=null&&r.sessionID)try{var s=(e=>{var t=this.Bt.bootstrap.sessionID.replace(/-/g,``);if(t.length!==32)throw Error(`Not a valid UUID`);if(t[12]!==`7`)throw Error(`Not a UUIDv7`);return parseInt(t.substring(0,12),16)})();this.bi(this.Bt.bootstrap.sessionID,new Date().getTime(),s)}catch(e){aa.error(`Invalid sessionID in bootstrap`,e)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return A(this.li)&&(this.li=[]),this.li.push(e),this.di&&e(this.di,this.ci),()=>{this.li=this.li.filter((t=>t!==e))}}yi(){return this.Bt.persistence!==`memory`&&!this.ni.wr&&J.R()}Ii(e){e!==this.ci&&(this.ci=e,this.yi()&&J.M(this.gi,e))}Ci(){return this.ci?this.ci:this.yi()?J.Z(this.gi):null}bi(e,t,n){e===this.di&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.di=e,this.ni.register({[un]:[t,e,n]}))}Si(){var e=this.ni.props[un];return E(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.xi),this.xi=void 0,this.ui&&e&&(e.removeEventListener(Jn,this.ui,{capture:!1}),this.ui=void 0),this.li=[]}wi(){this.ui=()=>{this.yi()&&J.F(this.mi)},K(e,Jn,this.ui,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.Bt.cookieless_mode===Un)throw Error(`checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"`);var n=t||new Date().getTime(),[r,i,a]=this.Si(),o=this.Ci(),s=I(a)&&Math.abs(n-a)>864e5,c=!1,l=!i,u=!l&&!e&&this.hi(n,r);l||u||s?(i=this.vi(),o=this.fi(),aa.info(`new session ID generated`,{sessionId:i,windowId:o,changeReason:{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}}),a=n,c=!0):o||(o=this.fi(),c=!0);var d=I(r)&&e&&!s?r:n,f=I(a)?a:new Date().getTime();return this.Ii(o),this.bi(i,d,f),e||this.pi(),c&&this.li.forEach((e=>e(i,o,c?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}:void 0))),{sessionId:i,windowId:o,sessionStartTimestamp:f,changeReason:c?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}:void 0,lastActivityTimestamp:r}}pi(){clearTimeout(this.xi),this.xi=setTimeout((()=>{var[e]=this.Si();if(this.hi(new Date().getTime(),e)){var t=this.di;this.resetSessionId(),this.ai.emit(`forcedIdleReset`,{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}},sa=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&y(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((e=>y(e?.brand,t))))return!0}catch{}return!!e.webdriver},ca=function(e,t){if(!function(e){try{new RegExp(e)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function la(e,t,n){return Ki({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var ua={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>ca(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!ca(t,e))))),icontains:(e,t)=>t.map(da).some((t=>e.map(da).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(da).every((t=>e.map(da).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n<parseFloat(e)))}))},da=e=>e.toLowerCase();function fa(e,t){return!e||Object.entries(e).every((e=>{var[n,r]=e,i=t?.[n];if(A(i)||N(i))return!1;var a=[String(i)],o=ua[r.operator];return!!o&&o(r.values,a)}))}var pa,ma,ha=`custom`,ga=`i.posthog.com`,_a=/^\/static\//,va=class{constructor(e){this.ki={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,``);return e===`https://app.posthog.com`?`https://us.i.posthog.com`:e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,``):this.apiHost}get uiHost(){var e=this.instance.config.ui_host?.replace(/\/$/,``);return e||=this.apiHost.replace(`.`+ga,`.posthog.com`),e===`https://app.posthog.com`?`https://us.posthog.com`:e}get region(){return this.ki[this.apiHost]||(this.ki[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`us`:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`eu`:ha),this.ki[this.apiHost]}Ti(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if(typeof t==`string`&&_a.test(e))return t.trim().replace(/\/$/,``)||void 0}endpointFor(e,t){if(t===void 0&&(t=``),t&&=t[0]===`/`?t:`/`+t,e===`ui`)return this.uiHost+t;if(e===`flags`)return this.flagsApiHost+t;if(e===`assets`){var n=this.Ti(t);if(n)return``+n+t}if(this.region===ha)return this.apiHost+t;var r=ga+t;switch(e){case`assets`:return`https://`+this.region+`-assets.`+r;case`api`:return`https://`+this.region+`.`+r}}};pa===void 0&&(pa=e=>e()),ma===void 0&&(ma=console),ma.log.bind(ma),ma.warn.bind(ma),ma.error.bind(ma),ma.debug.bind(ma);var Q=U(`[Surveys]`),ya=`seenSurvey_`,ba=[ni.Popover,ni.Widget,ni.API],xa={ignoreConditions:!1,ignoreDelay:!1,displayType:ai.Popover},Sa=U(`[PostHog ExternalIntegrations]`),Ca={intercom:`intercom-integration`,crispChat:`crisp-chat-integration`},wa=class{constructor(e){this._instance=e}ur(e,t){var n;(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(e=>{if(e)return Sa.error(`failed to load script`,e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var n,i,a;!r||(n=u.__PosthogExtensions__)!=null&&(n=n.integrations)!=null&&n[t]||e.ur(Ca[t],(()=>{var n;(n=u.__PosthogExtensions__)==null||(n=n.integrations)==null||(n=n[t])==null||n.start(e._instance)})),!r&&(i=u.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[t]&&((a=u.__PosthogExtensions__)==null||(a=a.integrations)==null||(a=a[t])==null||a.stop())};for(var[n,r]of Object.entries((i=this._instance.config.integrations)??{})){var i;t(n)}}},Ta,Ea={},Da=0,Oa=()=>{},ka=`Consent opt in/out is not valid with cookieless_mode="always" and will be ignored`,Aa=`Surveys module not available`,ja=`sanitize_properties is deprecated. Use before_send instead`,Ma=`Invalid value for property_denylist config: `,Na=`posthog`,Pa=!Hi&&l?.indexOf(`MSIE`)===-1&&l?.indexOf(`Mozilla`)===-1,Fa=t=>{var n;return h({api_host:`https://us.i.posthog.com`,flags_api_host:null,ui_host:null,token:``,autocapture:!0,cross_subdomain_cookie:ar(r?.location),persistence:`localStorage+cookie`,persistence_name:``,cookie_persisted_properties:[],loaded:Oa,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:`if_capture_pageview`,defaults:t??`unset`,__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:i&&j(i?.search)&&i.search.indexOf(`__posthog_debug=true`)!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(e==null||(n=e.location)==null?void 0:n.protocol)===`https:`,ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:`localStorage`,consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){H.error(`Bad HTTP status: `+e.statusCode+` `+e.text)},get_device_id:e=>e,capture_performance:void 0,name:`posthog`,bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Kn,before_send:void 0,request_queue_config:{flush_interval_ms:Zi},error_tracking:{},_onCapture:Oa,__preview_eager_load_replay:!1},(e=>({rageclick:!e||`2025-11-30`>e||{content_ignorelist:!0},capture_pageview:!e||`2025-05-24`>e||`history_change`,session_recording:e&&e>=`2025-11-30`?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>=`2026-01-30`?`head`:`body`,internal_or_test_user_hostname:e&&e>=`2026-01-30`?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},Ia=[[`process_person`,`person_profiles`],[`xhr_headers`,`request_headers`],[`cookie_name`,`persistence_name`],[`disable_cookie`,`disable_persistence`],[`store_google`,`save_campaign_params`],[`verbose`,`debug`]],La=e=>{var t={};for(var[n,r]of Ia)A(e[n])||(t[r]=e[n]);var i=G({},t,e);return E(e.property_blacklist)&&(A(e.property_denylist)?i.property_denylist=e.property_blacklist:E(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:H.error(Ma+e.property_denylist)),i},Ra=class{constructor(){this.__forceAllowLocalhost=!1}get Ai(){return this.__forceAllowLocalhost}set Ai(e){H.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},za=class t{Ei(e,t){if(e){var n=this.Ri.indexOf(e);n!==-1&&this.Ri.splice(n,1)}return this.Ri.push(t),t.initialize==null||t.initialize(),t}Ni(){return this.config.cookieless_mode===Un||this.config.cookieless_mode===Hn&&this.consent.isRejected()}get decideEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}get flagsEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}constructor(){this.webPerformance=new Ra,this.Mi=!1,this.version=f.LIB_VERSION,this.Fi=new ia,this.Ri=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Fa(),this.SentryIntegration=Ar,this.sentryIntegration=e=>function(e,t){var n=kr(e,t);return{name:Or,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint=`/e/`,this.Oi=!1,this.Pi=null,this.Li=null,this.Di=null,this.scrollManager=new ta(this),this.pageViewManager=new jr(this),this.rateLimiter=new li(this),this.requestRouter=new va(this),this.consent=new Sr(this),this.externalIntegrations=new wa(this);var e=t.__defaultExtensionClasses??{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(e,t,n)=>{var r=j(e)?{[e]:t}:e;this.setPersonProperties(r),n?.({})},set_once:(e,t,n)=>{var r=j(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n?.({})}},this.on(`eventCaptured`,(e=>H.info(`send "`+e?.event+`"`,e)))}init(e,n,r){if(r&&r!==Na){var i=Ea[r]??new t;return i._init(e,n,r),Ea[r]=i,Ea[Na][r]=i,i}return this._init(e,n,r)}_init(t,n,r){var i;if(n===void 0&&(n={}),A(t)||M(t))return H.critical(`PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()`),this;if(this.__loaded)return console.warn(`[PostHog.js]`,`You have already initialized PostHog! Re-initializing is a no-op`),this;this.__loaded=!0,this.config={},n.debug=this.Bi(n.debug),this.ji=n,this.$i=[],n.person_profiles?this.Li=n.person_profiles:n.process_person&&(this.Li=n.process_person),this.set_config(G({},Fa(n.defaults),La(n),{name:r,token:t})),this.config.on_xhr_error&&H.error(`on_xhr_error is deprecated. Use on_request_error instead`),this.compression=n.disable_compression?void 0:fi.GZipJS;var a=this.qi();this.persistence=new ei(this.config,a),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new ei(h({},this.config,{persistence:`sessionStorage`}),a);var o=h({},this.persistence.props),s=h({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Zi=new Qi((e=>this.Hi(e)),this.config.request_queue_config),this.Vi=new ea(this),this.__request_queue=[];var c=this.Ni();if(c||(this.sessionManager=new oa(this),this.sessionPropsManager=new ra(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(H.info(`Deferring extension initialization to improve startup performance`),setTimeout((()=>{this.zi(c)}),0)):(H.info(`Initializing extensions synchronously`),this.zi(c)),f.DEBUG=f.DEBUG||this.config.debug,f.DEBUG&&H.info(`Starting in debug mode`,{this:this,config:n,thisC:h({},this.config),p:o,s}),!this.config.identity_distinct_id||(i=n.bootstrap)!=null&&i.distinctID||(n.bootstrap=h({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),n.bootstrap?.distinctID!==void 0){var l=n.bootstrap.distinctID,u=this.get_distinct_id(),d=this.persistence.get_property(kn);if(n.bootstrap.isIdentifiedID&&u!=null&&u!==l&&d===Wn)this.identify(l);else if(n.bootstrap.isIdentifiedID&&u!=null&&u!==l&&d===Gn)H.warn(`Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.`);else{var p=this.config.get_device_id(fr()),m=n.bootstrap.isIdentifiedID?p:l;this.persistence.set_property(kn,n.bootstrap.isIdentifiedID?Gn:Wn),this.register({distinct_id:l,$device_id:m})}}if(c)this.register_once({distinct_id:Ln,$device_id:null},``);else if(!this.get_distinct_id()){var g=this.config.get_device_id(fr());this.register_once({distinct_id:g,$device_id:g},``),this.persistence.set_property(kn,Wn)}return K(e,`onpagehide`in self?`pagehide`:`unload`,this._handle_unload.bind(this),{passive:!1}),n.segment?function(e,t){var n=e.config.segment;if(!n)return t();(function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||fr();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(kn,Gn)),t()},i=n.user();`then`in i&&D(i.then)?i.then(r):r(i)})(e,(()=>{n.register((e=>{Promise&&Promise.resolve||Dr.warn(`This browser does not have Promise support, and can not use the segment integration`);var t=(t,n)=>{if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Dr.info(`No userId set, resetting PostHog`),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Dr.info(`UserId set, identifying with PostHog`),e.identify(t.event.userId));var r=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:`PostHog JS`,type:`enrichment`,version:`1.0.0`,isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,Yn),identify:e=>t(e,Zn),screen:e=>t(e,`$screen`)}})(e)).then((()=>{t()}))}))}(this,(()=>this.Ui())):this.Ui(),D(this.config._onCapture)&&this.config._onCapture!==Oa&&(H.warn("onCapture is deprecated. Please use `before_send` instead"),this.on(`eventCaptured`,(e=>this.config._onCapture(e.event,e)))),this.config.ip&&H.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}zi(e){var n=performance.now(),r=h({},t.__defaultExtensionClasses,this.config.__extensionClasses),i=[];r.featureFlags&&this.Ri.push(this.featureFlags=this.featureFlags??new r.featureFlags(this)),r.exceptions&&this.Ri.push(this.exceptions=this.exceptions??new r.exceptions(this)),r.historyAutocapture&&this.Ri.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.Ri.push(new r.tracingHeaders(this)),r.siteApps&&this.Ri.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!e&&this.Ri.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.autocapture&&this.Ri.push(this.autocapture=new r.autocapture(this)),r.surveys&&this.Ri.push(this.surveys=this.surveys??new r.surveys(this)),r.logs&&this.Ri.push(this.logs=this.logs??new r.logs(this)),r.conversations&&this.Ri.push(this.conversations=this.conversations??new r.conversations(this)),r.productTours&&this.Ri.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.Ri.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.Ri.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.Ri.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.Ri.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,Tr)),r.toolbar&&this.Ri.push(this.toolbar=this.toolbar??new r.toolbar(this)),r.experiments&&this.Ri.push(this.experiments=this.experiments??new r.experiments(this)),this.Ri.forEach((e=>{e.initialize&&i.push((()=>{e.initialize==null||e.initialize()}))})),i.push((()=>{if(this.Yi){var e=this.Yi;this.Yi=void 0,this.Nr(e)}})),this.Gi(i,n)}Gi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Gi(e,t)}),0);var n=e.shift();if(n)try{n()}catch(e){H.error(`Error initializing extension:`,e)}}var r=Math.round(performance.now()-t);this.register_for_session({[Rn]:this.config.__preview_deferred_init_extensions?`deferred`:`synchronous`,[zn]:r}),this.config.__preview_deferred_init_extensions&&H.info(`PostHog extensions initialized (`+r+`ms)`)}Nr(e){var t;if(!r||!r.body)return H.info(`document not ready yet, trying again in 500 milliseconds...`),void setTimeout((()=>{this.Nr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Yi=e),this.Wi=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=x(e.supportedCompression,fi.GZipJS)?fi.GZipJS:x(e.supportedCompression,fi.Base64)?fi.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Li?this.Li:Kn}),this.Ri.forEach((t=>t.onRemoteConfig==null?void 0:t.onRemoteConfig(e)))}Ui(){try{this.config.loaded(this)}catch(e){H.critical("`loaded` function failed",e)}if(this.Xi(),this.config.internal_or_test_user_hostname&&i!=null&&i.hostname){var e=i.hostname,t=this.config.internal_or_test_user_hostname;(typeof t==`string`?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ni())&&this.Ji()}),1),this.Ki=new di(this),this.Ki.load()}Xi(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Zi)==null||e.enable())}_dom_loaded(){this.is_capturing()&&$n(this.__request_queue,(e=>this.Hi(e))),this.__request_queue=[],this.Xi()}_handle_unload(){var e,t,n,r;(e=this.surveys)==null||e.handlePageUnload(),this.config.request_batching?(this.Qi()&&this.capture(Xn),(t=this.logs)==null||t.flushLogs(`sendBeacon`),(n=this.Zi)==null||n.unload(),(r=this.Vi)==null||r.unload()):this.Qi()&&this.capture(Xn,null,{transport:`sendBeacon`})}_send_request(e){this.__loaded&&(Pa?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Gi(e.url,{ip:+!!this.config.ip}),e.headers=h({},this.config.request_headers,e.headers),e.compression=e.compression===`best-available`?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=[`sendBeacon`]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t=h({},e);t.timeout=t.timeout||6e4,t.url=Yi(t.url,t.compression);var n=t.transport??`fetch`,r=Xi.filter((e=>!t.disableTransport||!e.transport||!t.disableTransport.includes(e.transport))),i=function(e,t){for(var r=0;e.length>r;r++)if(e[r].transport===n)return e[r]}(r)?.method??r[0].method;if(!i)throw Error(`No available transport method`);n!==`sendBeacon`&&t.data&&t.compression===fi.GZipJS&&c&&!Wi?Ji(t).then((e=>{i(e)})).catch((n=>{if((e=>!(!e||typeof e!=`object`)&&(`name`in e?String(e.name):``)===`NotReadableError`)(n))return Wi=!0,void i(h({},t,{compression:void 0,url:Yi(e.url,void 0)}));i(t)})):i(t)})(h({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||(n=(r=this.config).on_request_error)==null||n.call(r,t),e.callback==null||e.callback(t)}}))))}Hi(e){this.Vi?this.Vi.retriableRequest(e):this._send_request(e)}_execute_array(e){Da++;try{var t,n=[],r=[],i=[];$n(e,(e=>{e&&(E(t=e[0])?i.push(e):D(e)?e.call(this):E(e)&&t===`alias`?n.push(e):E(e)&&t.indexOf(`capture`)!==-1&&D(this[t])?i.push(e):r.push(e))}));var a=function(e,t){$n(e,(function(e){if(E(e[0])){var n=t;W(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}))};a(n,this),a(r,this),a(i,this)}finally{Da--}}push(e){if(Da>0&&E(e)&&j(e[0])){var n=t.prototype[e[0]];D(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,n){var r,i,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zi){if(this.is_capturing())if(!A(e)&&j(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!s||this.config.__preview_capture_bot_pageviews){var c=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){t!=null&&t.$current_url&&!j(t?.$current_url)&&(H.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),e!==`$exception`||n!=null&&n.en||H.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.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var l=new Date,u=n?.timestamp||l,d=fr(),f={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},u,d)};e===Yn&&this.config.__preview_capture_bot_pageviews&&s&&(f.event=`$bot_pageview`,f.properties.$browser_type=`bot`),c&&(f.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens),n!=null&&n.$set&&(f.$set=n?.$set);var p,m,g,_=this.tn(n?.$set_once,e!==Qn,e===Zn);if(_&&(f.$set_once=_),n!=null&&n._noTruncate||(r=this.config.properties_string_max_length,i=f,a=e=>j(e)?e.slice(0,r):e,o=new Set,f=function e(t,n){return t===Object(t)?o.has(t)?void 0:(o.add(t),E(t)?(r=[],$n(t,(t=>{r.push(e(t))}))):(r={},W(t,((t,n)=>{o.has(t)||(r[n]=e(t,n))}))),r):a?a(t):t;var r}(i)),f.timestamp=u,A(n?.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=l),e===ri.DISMISSED||e===ri.SENT){var v=t?.[ii.SURVEY_ID],y=t?.[ii.SURVEY_ITERATION];(e=>{try{var t=(e=>((e,t)=>{var n=``+ya+t.id;return t.current_iteration&&t.current_iteration>0&&(n=``+ya+t.id+`_`+t.current_iteration),n})(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,`true`)}catch(e){Q.error(`Failed to persist survey seen state`,e)}})({id:v,current_iteration:y}),f.$set=h({},f.$set,{[(p={id:v,current_iteration:y},m=e===ri.SENT?`responded`:`dismissed`,g=`$survey_`+m+`/`+p.id,p.current_iteration&&p.current_iteration>0&&(g=`$survey_`+m+`/`+p.id+`/`+p.current_iteration),g)]:!0})}else e===ri.SHOWN&&(f.$set=h({},f.$set,{[ii.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===oi.SHOWN){var b=t?.[si.TOUR_TYPE];b&&(f.$set=h({},f.$set,{[si.TOUR_LAST_SEEN_DATE+`/`+b]:new Date().toISOString()}))}var x=h({},f.properties.$set,f.$set);if(k(x)||this.setPersonPropertiesForFlags(x),!P(this.config.before_send)){var S=this.rn(f);if(!S)return;f=S}this.Fi.emit(`eventCaptured`,f);var C={method:`POST`,url:n?._url??this.requestRouter.endpointFor(`api`,this.analyticsDefaultEndpoint),data:f,compression:`best-available`,batchKey:n?._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Hi(C):this.Zi.enqueue(C),f}H.critical(`This capture call is ignored due to client rate limiting.`)}}else H.error(`No event name provided to posthog.capture`)}else H.uninitializedWarning(`posthog.capture`)}_addCaptureHook(e){return this.on(`eventCaptured`,(t=>e(t.event,t)))}calculateEventProperties(t,n,a,o,s){if(a||=new Date,!this.persistence||!this.sessionPersistence)return n;var c=s?void 0:this.persistence.remove_event_timer(t),u=h({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.Ni()&&(u.$cookieless_mode=!0),t===`$snapshot`){var d=h({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=d.distinct_id,(!j(u.distinct_id)&&!F(u.distinct_id)||M(u.distinct_id))&&H.error(`Invalid distinct_id for replay event. This indicates a bug in your implementation`),u}var p,m=function(t,n){var r,a,o;if(!l)return{};var s,c,u,d,p=t?[...zr,...n||[]]:[],[m,h]=function(e){for(var t=0;it.length>t;t++){var[n,r]=it[t],i=n.exec(e),a=i&&(D(r)?r(i,e):r);if(a)return a}return[``,``]}(l);return G(rr({$os:m,$os_version:h,$browser:tt(l,navigator.vendor),$device:at(l),$device_type:(c=l,u={userAgentDataPlatform:(r=navigator)==null||(r=r.userAgentData)==null?void 0:r.platform,maxTouchPoints:navigator?.maxTouchPoints,screenWidth:e==null||(a=e.screen)==null?void 0:a.width,screenHeight:e==null||(o=e.screen)==null?void 0:o.height,devicePixelRatio:e?.devicePixelRatio},d=at(c),d===_e||d===ge||d===`Kobo`||d===`Kindle Fire`||d===qe?he:d===Ie||d===Re||d===Le||d===We?`Console`:d===ye?`Wearable`:d?B:u?.userAgentDataPlatform===`Android`&&(u?.maxTouchPoints??0)>0?600>Math.min(u?.screenWidth??0,u?.screenHeight??0)/(u?.devicePixelRatio??1)?B:he:`Desktop`),$timezone:Zr(),$timezone_offset:Qr()}),{$current_url:Ir(i?.href,p,Vr),$host:i?.host,$pathname:i?.pathname,$raw_user_agent:l.length>1e3?l.substring(0,997)+`...`:l,$browser_version:rt(l,navigator.vendor),$browser_language:Kr(),$browser_language_prefix:(s=Kr(),typeof s==`string`?s.split(`-`)[0]:void 0),$screen_height:e?.screen.height,$screen_width:e?.screen.width,$viewport_height:e?.innerHeight,$viewport_width:e?.innerWidth,$lib:f.LIB_NAME,$lib_version:f.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:g,windowId:_}=this.sessionManager.checkAndGetSessionAndWindowId(s,a.getTime());u.$session_id=g,u.$window_id=_}this.sessionPropsManager&&G(u,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&G(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=this.Vi?.length}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===ha&&(u.$lib_custom_api_host=this.config.api_host),p=t!==Yn||s?t!==Xn||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(a):this.pageViewManager.doPageView(a,o),u=G(u,p),t===Yn&&r&&(u.title=r.title),!A(c)){var v=a.getTime()-c;u.$duration=parseFloat((v/1e3).toFixed(3))}l&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?`bot`:`browser`),(u=G({},m,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this._isIdentified(),E(this.config.property_denylist)?W(this.config.property_denylist,(function(e){delete u[e]})):H.error(Ma+this.config.property_denylist+` or property_blacklist config: `+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(H.error(ja),u=y(u,t));var b=this.nn();return u.$process_person_profile=b,b&&!s&&this.sn(`_calculate_event_properties`),u}tn(e,t,n){if(t===void 0&&(t=!0),n===void 0&&(n=!1),!this.persistence||!this.nn()||this.Mi&&!n)return e;var r=G({},this.persistence.get_initial_props(),this.sessionPropsManager?.getSetOnceProps()||{},e||{}),i=this.config.sanitize_properties;return i&&(H.error(ja),r=i(r,`$set_once`)),t&&(this.Mi=!0),k(r)?void 0:r}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}an(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags?.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags?.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags?.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){return this.featureFlags?.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,t,n){var r;(r=this.featureFlags)==null||r.updateFlags(e,t,n)}updateEarlyAccessFeatureEnrollment(e,t,n){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,t,n)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags?.getEarlyAccessFeatures(e,t,n)}on(e,t){return this.Fi.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Aa}),()=>{})}onSessionId(e){return this.sessionManager?.onSessionId(e)??(()=>{})}getSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:Aa})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Aa})}renderSurvey(e,t){var n;(n=this.surveys)==null||n.renderSurvey(e,t)}displaySurvey(e,t){var n;t===void 0&&(t=xa),(n=this.surveys)==null||n.displaySurvey(e,t)}cancelPendingSurvey(e){var t;(t=this.surveys)==null||t.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys?.canRenderSurvey(e)??{visible:!1,disabledReason:Aa}}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys?.canRenderSurveyAsync(e,t)??Promise.resolve({visible:!1,disabledReason:Aa})}ln(e){return!e||M(e)?(H.critical(`Unique user id has not been set in posthog.identify`),!1):e===Ln?(H.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):![`distinct_id`,`distinctid`].includes(e.toLowerCase())&&![`undefined`,`null`].includes(e.toLowerCase())||(H.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,t,n){if(!this.__loaded||!this.persistence)return H.uninitializedWarning(`posthog.identify`);if(F(e)&&(e=e.toString(),H.warn(`The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.`)),this.ln(e)&&this.sn(`posthog.identify`)){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Kt)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},``),e!==r&&e!==this.get_property(qt)&&(this.unregister(qt),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(kn)||Wn)===Wn;e!==r&&a?(this.persistence.set_property(kn,Gn),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.capture(Zn,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Di=la(e,t,n),(i=this.featureFlags)==null||i.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(Tn))}}setPersonProperties(e,t){if((e||t)&&this.sn(`posthog.setPersonProperties`)){var n=la(this.get_distinct_id(),e,t);this.Di===n?H.info(`A duplicate setPersonProperties call was made with the same properties. It has been ignored.`):(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture(`$set`,{$set:e||{},$set_once:t||{}}),this.Di=n)}}group(e,t,n){if(e&&t){var r=this.getGroups(),i=r[e]!==t;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:h({},r,{[e]:t})}),i||n){var a={$group_type:e,$group_key:t};n&&(a.$group_set=n),this.capture(Qn,a)}n&&this.setGroupPropertiesForFlags({[e]:n}),i&&!n&&this.reloadFeatureFlags()}else H.error(`posthog.group requires a group type and group key`)}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),(n=this.featureFlags)==null||n.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){var e;(e=this.featureFlags)==null||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),this.sn(`posthog.setGroupPropertiesForFlags`)&&((n=this.featureFlags)==null||n.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.featureFlags)==null||t.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,i,a,o,s,c;if(H.info(`reset`),!this.__loaded)return H.uninitializedWarning(`posthog.reset`);var l=this.get_property(Kt);if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),(r=this.surveys)==null||r.reset(),(i=this.Ki)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.conversations)==null||o.reset(),(s=this.persistence)==null||s.set_property(kn,Wn),(c=this.sessionManager)==null||c.resetSessionId(),this.Di=null,this.config.cookieless_mode===Un)this.register_once({distinct_id:Ln,$device_id:null},``);else{var u=this.config.get_device_id(fr());this.register_once({distinct_id:u,$device_id:e?u:l},``)}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var n;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),(n=this.conversations)==null||n.un()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.hn()}get_distinct_id(){return this.get_property(`distinct_id`)}getGroups(){return this.get_property(`$groups`)||{}}get_session_id(){return this.sessionManager?.checkAndGetSessionAndWindowId(!0).sessionId??``}get_session_replay_url(e){if(!this.sessionManager)return``;var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor(`ui`,`/project/`+this.config.token+`/replay/`+t);if(e!=null&&e.withTimestamp&&n){var i=e.timestampLookBack??10;if(!n)return r;r+=`?t=`+Math.max(Math.floor((new Date().getTime()-n)/1e3)-i,0)}return r}alias(e,t){return e===this.get_property(Gt)?(H.critical(`Attempting to create alias for existing People user - aborting.`),-2):this.sn(`posthog.alias`)?(A(t)&&(t=this.get_distinct_id()),e===t?(H.warn(`alias matches current distinct_id - skipping api call.`),this.identify(e),-1):(this.an(qt,e),this.capture(`$create_alias`,{alias:e,distinct_id:t}))):void 0}set_config(e){var t=h({},this.config);if(O(e)){var n,r,i,a,o,s,c,l,u,d;G(this.config,La(e));var p=this.qi();(n=this.persistence)==null||n.update_config(this.config,t,p),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new ei(h({},this.config,{persistence:`sessionStorage`}),p);var m=this.Bi(this.config.debug);L(m)&&(this.config.debug=m),L(this.config.debug)&&(this.config.debug?(f.DEBUG=!0,q.R()&&q.M(`ph_debug`,!0),H.info(`set_config`,{config:e,oldConfig:t,newConfig:h({},this.config)})):(f.DEBUG=!1,q.R()&&q.F(`ph_debug`))),(r=this.exceptionObserver)==null||r.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(s=this.heatmaps)==null||s.startIfEnabled(),(c=this.exceptionObserver)==null||c.startIfEnabledOrStop(),(l=this.deadClicksAutocapture)==null||l.startIfEnabledOrStop(),(u=this.surveys)==null||u.loadIfEnabled(),this.cn(),(d=this.externalIntegrations)==null||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){f.LIB_NAME=e,f.LIB_VERSION=t}startSessionRecording(e){var t,n,r,i,a,o=!0===e,s={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(s).some(Boolean)&&((t=this.sessionManager)==null||t.checkAndGetSessionAndWindowId(),s.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),s.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),s.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger(`url`)),s.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger(`event`))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){if(this.exceptions){var n=Error(`PostHog syntheticException`),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(h({},r,t))}}addExceptionStep(e,t){var n;(n=this.exceptions)==null||n.addExceptionStep(e,t)}captureLog(e){var t;(t=this.logs)==null||t.captureLog(e)}get logger(){return this.logs?.logger??t.dn}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t;return(t=this.toolbar?.loadToolbar(e))!=null&&t}get_property(e){return this.persistence?.props[e]}getSessionProperty(e){return this.sessionPersistence?.props[e]}toString(){var e=this.config.name??Na;return e!==Na&&(e=Na+`.`+e),e}_isIdentified(){return this.persistence?.get_property(kn)===Gn||this.sessionPersistence?.get_property(kn)===Gn}nn(){var e,t;return!(this.config.person_profiles===`never`||this.config.person_profiles===Kn&&!this._isIdentified()&&k(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[qt])&&((t=this.persistence)==null||(t=t.props)==null||!t[Fn]))}Qi(){return!0===this.config.capture_pageleave||this.config.capture_pageleave===`if_capture_pageview`&&(!0===this.config.capture_pageview||this.config.capture_pageview===`history_change`)}createPersonProfile(){this.nn()||this.sn(`posthog.createPersonProfile`)&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn(`posthog.setInternalOrTestUser`)&&this.setPersonProperties({$internal_or_test_user:!0})}sn(e){return this.config.person_profiles===`never`?(H.error(e+` was called, but process_person is set to "never". This call will be ignored.`),!1):(this.an(Fn,!0),!0)}qi(){if(this.config.cookieless_mode===`always`)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Hn)}cn(){var e,t,n=this.qi();return this.persistence?.wr!==n&&((e=this.persistence)==null||e.set_disabled(n)),this.sessionPersistence?.wr!==n&&((t=this.sessionPersistence)==null||t.set_disabled(n)),n}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==Un){if(this.Ni()){var r,i;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new oa(this),this.pageViewManager=new jr(this),this.persistence&&(this.sessionPropsManager=new ra(this,this.sessionManager,this.persistence));var a,o=this.config.__extensionClasses?.sessionRecording??t.__defaultExtensionClasses?.sessionRecording;o&&(this.sessionRecording=this.Ei(this.sessionRecording,new o(this)),this.Wi&&((a=this.sessionRecording)==null||a.onRemoteConfig==null||a.onRemoteConfig(this.Wi)))}var s;this.consent.optInOut(!0),this.cn(),this.Xi(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Hn&&((s=this.surveys)==null||s.loadIfEnabled()),(A(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture(e?.captureEventName??`$opt_in`,e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ji()}else H.warn(ka)}opt_out_capturing(){var e,t,n;this.config.cookieless_mode===Un?H.warn(ka):(this.config.cookieless_mode===Hn&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===Hn&&(this.register({distinct_id:Ln,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(t=this.pageViewManager)==null||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Ji()))}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?`granted`:e===0?`denied`:`pending`}is_capturing(){return this.config.cookieless_mode===Un||(this.config.cookieless_mode===Hn?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return n?sa(n,this.config.custom_blocked_useragents):void 0}Ji(){r&&(r.visibilityState===`visible`?this.Oi||(this.Oi=!0,this.capture(Yn,{title:r.title},{send_instantly:!0}),this.Pi&&=(r.removeEventListener(qn,this.Pi),null)):this.Pi||(this.Pi=this.Ji.bind(this),K(r,qn,this.Pi)))}debug(t){!1===t?(e?.console.log(`You've disabled debug mode.`),this.set_config({debug:!1})):(e?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Fr(){var e,t,n,r,i,a,o=this.ji||{};return`advanced_disable_flags`in o?!!o.advanced_disable_flags:!1===this.config.advanced_disable_flags?!0===this.config.advanced_disable_decide?(H.warn(`Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version.`),!0):(n=`advanced_disable_decide`,r=H,i=(t=`advanced_disable_flags`)in(e=o)&&!P(e[t]),a=n in e&&!P(e[n]),i?e[t]:!!a&&(r&&r.warn(`Config field '`+n+`' is deprecated. Please use '`+t+`' instead. The old field will be removed in a future major version.`),e[n])):!!this.config.advanced_disable_flags}rn(e){if(P(this.config.before_send))return e;var t=E(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),P(n)){var i=`Event '`+e.event+`' was rejected in beforeSend function`;return ne(e.event)?H.warn(i+`. This can cause unexpected behavior.`):H.info(i),null}n.properties&&!k(n.properties)||H.warn(`Event '`+e.event+`' has no properties after beforeSend function, this is likely an error.`)}return n}getPageViewId(){return this.pageViewManager.dr?.pageViewId}captureTraceFeedback(e,t){this.capture(`$ai_feedback`,{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture(`$ai_metric`,{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}Bi(e){var t=L(e)&&!e,n=q.R()&&q.O(`ph_debug`)===`true`;return!t&&(!!n||e)}};za.__defaultExtensionClasses={},za.dn={trace:Ta=()=>{},debug:Ta,info:Ta,warn:Ta,error:Ta,fatal:Ta},function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=nr(e.prototype[t[n]])}(za,[`identify`]);var Ba=1,Va=3,Ha=11;function Ua(e){return e instanceof Element&&(e.id===In||!(e.closest==null||!e.closest(`.toolbar-global-fade-container`)))}function Wa(e){return!!e&&e.nodeType===Ba}function Ga(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Ka(e){return!!e&&e.nodeType===Va}function qa(e){return!!e&&e.nodeType===Ha&&Wa(e.host)}function Ja(e){return e?S(e).split(/\s+/):[]}function Ya(t){var n=e?.location.href;return!!(n&&t&&t.some((e=>n.match(e))))}function Xa(e){var t=``;switch(typeof e.className){case`string`:t=e.className;break;case`object`:t=(e.className&&`baseVal`in e.className?e.className.baseVal:null)||e.getAttribute(`class`)||``;break;default:t=``}return Ja(t)}function Za(e){return P(e)?null:S(e).split(/(\s+)/).filter((e=>go(e))).join(``).replace(/[\r\n]/g,` `).replace(/[ ]+/g,` `).substring(0,255)}function Qa(e){var t=``;return so(e)&&!co(e)&&e.childNodes&&e.childNodes.length&&W(e.childNodes,(function(e){Ka(e)&&e.textContent&&(t+=Za(e.textContent)??``)})),S(t)}function $a(e){return A(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var eo=[`a`,`button`,`form`,`input`,`select`,`textarea`,`label`];function to(e,t){if(A(t))return!0;var n,r=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function no(e){var t=e.parentNode;return!(!t||!Wa(t))&&t}var ro=[`next`,`previous`,`prev`,`>`,`<`],io=[`.ph-no-rageclick`,`.ph-no-capture`],ao=e=>!e||Ga(e,`html`)||!Wa(e),oo=(t,n)=>{if(!e||ao(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],a=t;a.parentNode&&!Ga(a,`body`);)if(qa(a.parentNode))i.push(a.parentNode.host),a=a.parentNode.host;else{var o=no(a);if(!o)break;if(n||eo.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var s=e.getComputedStyle(o);s&&s.getPropertyValue(`cursor`)===`pointer`&&(r=!0)}i.push(o),a=o}return{parentIsUsefulElement:r,targetElementList:i}};function so(e){for(var t=e;t.parentNode&&!Ga(t,`body`);t=t.parentNode){var n=Xa(t);if(x(n,`ph-sensitive`)||x(n,`ph-no-capture`))return!1}if(x(Xa(e),`ph-include`))return!0;var r=e.type||``;if(j(r))switch(r.toLowerCase()){case`hidden`:case`password`:return!1}var i=e.name||e.id||``;return!j(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,``))}function co(e){return!!(Ga(e,`input`)&&![`button`,`checkbox`,`submit`,`reset`].includes(e.type)||Ga(e,`select`)||Ga(e,`textarea`)||e.getAttribute(`contenteditable`)===`true`)}var lo=`(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})`,uo=RegExp(`^(?:`+lo+`)$`),fo=new RegExp(lo),po=`\\d{3}-?\\d{2}-?\\d{4}`,mo=RegExp(`^(`+po+`)$`),ho=RegExp(`(`+po+`)`);function go(e,t){return t===void 0&&(t=!0),!(P(e)||j(e)&&(e=S(e),(t?uo:fo).test((e||``).replace(/[- ]/g,``))||(t?mo:ho).test(e)))}function _o(e){var t=Qa(e);return go(t=(t+` `+vo(e)).trim())?t:``}function vo(e){var t=``;return e&&e.childNodes&&e.childNodes.length&&W(e.childNodes,(function(e){if(e&&e.tagName?.toLowerCase()===`span`)try{var n=Qa(e);t=(t+` `+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+` `+vo(e)).trim())}catch(e){H.error(`[AutoCapture]`,e)}})),t}function yo(e){return e.replace(/"|\\"/g,`\\"`)}function bo(e){var t=e.attr__class;return t?E(t)?t:Ja(t):void 0}var xo=class{constructor(e){this.disabled=!1===e;var t=O(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,n){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}},So=`$copy_autocapture`,Co=U(`[AutoCapture]`);function wo(e,t){return t.length>e?t.slice(0,e)+`...`:t}function To(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Wa(t));return t}function Eo(t,n){var r,{e:i,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:s,elementsChainAsString:c}=n;if(!Wa(t))return{props:{}};for(var l=[t],u=t;u.parentNode&&!Ga(u,`body`);)if(qa(u.parentNode))l.push(u.parentNode.host),u=u.parentNode.host;else{if(!Wa(u.parentNode))break;l.push(u.parentNode),u=u.parentNode}var d,f,p=[],m={},g=!1,_=!1;if(W(l,(e=>{var t=so(e);if(Ga(e,`a`)){var n=e.getAttribute(`href`);g=t&&!!n&&go(n)&&n}x(Xa(e),`ph-no-capture`)&&(_=!0),p.push(function(e,t,n,r){var i=e.tagName.toLowerCase(),a={tag_name:i};eo.indexOf(i)>-1&&!n&&(a.$el_text=i.toLowerCase()===`a`||i.toLowerCase()===`button`?wo(1024,_o(e)):wo(1024,Qa(e)));var o=Xa(e);o.length>0&&(a.classes=o.filter((function(e){return e!==``}))),W(e.attributes,(function(n){var i;if((!co(e)||[`name`,`id`,`class`,`aria-label`].indexOf(n.name)!==-1)&&(r==null||!r.includes(n.name))&&!t&&go(n.value)&&(!j(i=n.name)||i.substring(0,10)!==`_ngcontent`&&i.substring(0,7)!==`_nghost`)){var o=n.value;n.name===`class`&&(o=Ja(o).join(` `)),a[`attr__`+n.name]=wo(1024,o)}}));for(var s=1,c=1,l=e;l=To(l);)s++,l.tagName===e.tagName&&c++;return a.nth_child=s,a.nth_of_type=c,a}(e,a,o,s)),G(m,function(e){if(!so(e))return{};var t={};return W(e.attributes,(function(e){if(e.name&&e.name.indexOf(`data-ph-capture-attribute`)===0){var n=e.name.replace(`data-ph-capture-attribute-`,``),r=e.value;n&&r&&go(r)&&(t[n]=r)}})),t}(e))})),_)return{props:{},explicitNoCapture:_};if(o||(p[0].$el_text=Ga(t,`a`)||Ga(t,`button`)?_o(t):Qa(t)),g){var v;p[0].attr__href=g;var y=Pr(g)?.host,b=e==null||(v=e.location)==null?void 0:v.host;y&&b&&y!==b&&(d=g)}return{props:G({$event_type:i.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:(f=p,function(e){return e.map((e=>{var t=``;if(e.tag_name&&(t+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))t+=`.`+n.replace(/"/g,``);var r=h({},e.text?{text:e.text}:{},{"nth-child":e.nth_child??0,"nth-of-type":e.nth_of_type??0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),i={};return er(r).sort(((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{var[t,n]=e;return i[yo(t.toString())]=yo(n.toString())})),(t+=`:`)+er(i).map((e=>{var[t,n]=e;return t+`="`+n+`"`})).join(``)})).join(`;`)}(function(e){return e.map((e=>{var t={text:e.$el_text?.slice(0,400),tag_name:e.tag_name,href:e.attr__href?.slice(0,2048),attr_class:bo(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return er(e).filter((e=>{var[t]=e;return t.indexOf(`attr__`)===0})).forEach((e=>{var[n,r]=e;return t.attributes[n]=r})),t}))}(f)))},(r=p[0])!=null&&r.$el_text?{$el_text:p[0]?.$el_text}:{},d&&i.type===`click`?{$external_click_url:d}:{},m)}}var Do=U(`[ExceptionAutocapture]`);function Oo(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return D(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var ko=U(`[TracingHeaders]`),Ao=U(`[Web Vitals]`),jo=9e5,Mo=`disabled`,No=`lazy_loading`,Po=`awaiting_config`,Fo=`missing_config`;U(`[SessionRecording]`),U(`[SessionRecording]`);var Io=`[SessionRecording]`,Lo=U(Io),Ro=U(`[Heatmaps]`);function zo(e){return O(e)&&`clientX`in e&&`clientY`in e&&F(e.clientX)&&F(e.clientY)}var Bo=U(`[Product Tours]`),Vo=[`$set_once`,`$set`],Ho=U(`[SiteApps]`),Uo=`Error while initializing PostHog app with config id `;function Wo(e,t,n){if(P(e))return!1;switch(n){case`exact`:return e===t;case`contains`:var r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/_/g,`.`).replace(/%/g,`.*`);return new RegExp(r,`i`).test(e);case`regex`:try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var Go=class{constructor(e){this.vn=new ia,this.fn=(e,t)=>this.pn(e,t)&&this.gn(e,t)&&this.mn(e,t)&&this.yn(e,t),this.pn=(e,t)=>t==null||!t.event||e?.event===t?.event,this._instance=e,this.bn=new Set,this.wn=new Set}init(){var e;A(this._instance?._addCaptureHook)||(e=this._instance)==null||e._addCaptureHook(((e,t)=>{this.on(e,t)}))}register(e){var t;if(!A(this._instance?._addCaptureHook)&&(e.forEach((e=>{var t,n;(t=this.wn)==null||t.add(e),(n=e.steps)==null||n.forEach((e=>{var t;(t=this.bn)==null||t.add(e?.event||``)}))})),(t=this._instance)!=null&&t.autocapture)){var n,r=new Set;e.forEach((e=>{var t;(t=e.steps)==null||t.forEach((e=>{e!=null&&e.selector&&r.add(e?.selector)}))})),(n=this._instance)==null||n.autocapture.setElementSelectors(r)}}on(e,t){t!=null&&e.length!=0&&(this.bn.has(e)||this.bn.has(t?.event))&&this.wn&&this.wn?.size>0&&this.wn.forEach((e=>{this._n(t,e)&&this.vn.emit(`actionCaptured`,e.name)}))}In(e){this.onAction(`actionCaptured`,(t=>e(t)))}_n(e,t){if(t?.steps==null)return!1;for(var n of t.steps)if(this.fn(e,n))return!0;return!1}onAction(e,t){return this.vn.on(e,t)}gn(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!=`string`||!Wo(r,t.url,t.url_matching||`contains`))return!1}return!0}mn(e,t){return!!this.Cn(e,t)&&!!this.Sn(e,t)&&!!this.xn(e,t)}Cn(e,t){var n;if(t==null||!t.href)return!0;var r=this.kn(e);if(r.length>0)return r.some((e=>Wo(e.href,t.href,t.href_matching||`exact`)));var i,a=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!a&&Wo((i=a.match(/(?::|")href="(.*?)"/))?i[1]:``,t.href,t.href_matching||`exact`)}Sn(e,t){var n;if(t==null||!t.text)return!0;var r=this.kn(e);if(r.length>0)return r.some((e=>Wo(e.text,t.text,t.text_matching||`exact`)||Wo(e.$el_text,t.text,t.text_matching||`exact`)));var i,a,o,s=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!s&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!P(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(s),a=t.text,o=t.text_matching||`exact`,i.some((e=>Wo(e,a,o))))}xn(e,t){var n,r;if(t==null||!t.selector)return!0;var i=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(i!=null&&i.includes(t.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||``;if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}kn(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}yn(e,t){return t==null||!t.properties||t.properties.length===0||fa(t.properties.reduce(((e,t)=>{var n=E(t.value)?t.value.map(String):t.value==null?[]:[String(t.value)];return e[t.key]={values:n,operator:t.operator||`exact`},e}),{}),e?.properties)}},Ko=class{constructor(e){this._instance=e,this.Tn=new Map,this.An=new Map,this.En=new Map}Rn(e,t){return!!e&&fa(e.propertyFilters,t?.properties)}Nn(e,t){var n=new Map;return e.forEach((e=>{var r;(r=e.conditions)==null||(r=r[t])==null||(r=r.values)==null||r.forEach((t=>{if(t!=null&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}}))})),n}Mn(e,t,n){var r=(n===ti.Activation?this.Tn:this.An).get(e),i=[];return this.Fn((e=>{i=e.filter((e=>r?.includes(e.id)))})),i.filter((r=>{var i,a=(i=r.conditions)==null||(i=i[n])==null||(i=i.values)==null?void 0:i.find((t=>t.name===e));return this.Rn(a,t)}))}register(e){A(this._instance?._addCaptureHook)||(this.On(e),this.Pn(e))}Pn(e){var t=e.filter((e=>{var t;return e.conditions?.actions&&((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null?void 0:t.length)>0}));t.length!==0&&(this.Ln??(this.Ln=new Go(this._instance),this.Ln.init(),this.Ln.In((e=>{this.onAction(e)}))),t.forEach((e=>{var t,n,r,i,a;e.conditions&&(t=e.conditions)!=null&&t.actions&&(n=e.conditions)!=null&&(n=n.actions)!=null&&n.values&&((r=e.conditions)==null||(r=r.actions)==null||(r=r.values)==null?void 0:r.length)>0&&((i=this.Ln)==null||i.register(e.conditions.actions.values),(a=e.conditions)==null||(a=a.actions)==null||(a=a.values)==null||a.forEach((t=>{if(t&&t.name){var n=this.En.get(t.name);n&&n.push(e.id),this.En.set(t.name,n||[e.id])}})))})))}On(e){var t,n=e.filter((e=>{var t;return e.conditions?.events&&((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null?void 0:t.length)>0})),r=e.filter((e=>{var t;return e.conditions?.cancelEvents&&((t=e.conditions)==null||(t=t.cancelEvents)==null||(t=t.values)==null?void 0:t.length)>0}));n.length===0&&r.length===0||((t=this._instance)==null||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.Tn=this.Nn(e,ti.Activation),this.An=this.Nn(e,ti.Cancellation))}onEvent(e,t){var n,r=this.le(),i=this.Dn(),a=this.Bn(),o=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[i])||[];if(a===e&&t&&o.length>0){var s,c;r.info(`event matched, removing item from activated items`,{event:e,eventPayload:t,existingActivatedItems:o});var l=(t==null||(s=t.properties)==null?void 0:s.$survey_id)||(t==null||(c=t.properties)==null?void 0:c.$product_tour_id);if(l){var u=o.indexOf(l);0>u||(o.splice(u,1),this.jn(o))}}else{if(this.An.has(e)){var d=this.Mn(e,t,ti.Cancellation);d.length>0&&(r.info(`cancel event matched, cancelling items`,{event:e,itemsToCancel:d.map((e=>e.id))}),d.forEach((e=>{var t=o.indexOf(e.id);0>t||o.splice(t,1),this.$n(e.id)})),this.jn(o))}if(this.Tn.has(e)){r.info(`event name matched`,{event:e,eventPayload:t,items:this.Tn.get(e)});var f=this.Mn(e,t,ti.Activation);this.jn(o.concat(f.map((e=>e.id))||[]))}}}onAction(e){var t,n=this.Dn(),r=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[];this.En.has(e)&&this.jn(r.concat(this.En.get(e)||[]))}jn(e){var t=this.le(),n=[...new Set(e)].filter((e=>!this.qn(e)));t.info(`updating activated items`,{activatedItems:n}),this.Zn(n)}getActivatedIds(){var e,t=this.Dn();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Tn}Hn(){return this.Ln}},qo=class extends Ko{constructor(e){super(e)}Dn(){return Cn}Bn(){return ri.SHOWN}Fn(e){var t;(t=this._instance)==null||t.getSurveys(e)}$n(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}le(){return Q}Zn(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[Cn]:e})}qn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Jo=`SDK is not enabled or survey functionality is not yet loaded`,Yo=`Disabled. Not loading surveys.`,Xo=e!=null&&e.location?Lr(e.location.hash,`__posthog`)||Lr(location.hash,`state`):null,Zo=`_postHogToolbarParams`,Qo=U(`[Toolbar]`),$=U(`[FeatureFlags]`),$o=U(`[FeatureFlags]`,{debugEnabled:!0}),es=`" failed. Feature flags didn't load in time.`,ts=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},ns=e=>{var t={};for(var[n,r]of er(e||{}))r&&(t[n]=r);return t},rs=U(`[Error tracking]`),is=`Refusing to render web experiment since the viewer is a likely bot`,as={icontains:(t,n)=>!!e&&n.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,n)=>!!e&&n.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,n)=>!!e&&ca(n.href,t),not_regex:(t,n)=>!!e&&!ca(n.href,t),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e},os=class t{get Bt(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){e===void 0&&(e=!1),n.getWebExperiments((e=>{t.Vn(`retrieved web experiments from the server`),n.zn=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;n.zn&&(t.Vn(`setting flag key `,e.feature_flag_key,` to web experiment `,e),(r=n.zn)==null||r.set(e.feature_flag_key,e));var i=n._instance.getFeatureFlag(e.feature_flag_key);j(i)&&e.variants[i]&&n.Un(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var a in e.variants){var o=e.variants[a];t.Yn(o)&&n.Un(e.name,a,o.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())t.Vn(is);else if(!this.Bt.disable_web_experiments){if(P(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.Vn(`applying feature flags`,e),e.forEach((e=>{var t;if(this.zn&&(t=this.zn)!=null&&t.has(e)){var n=this._instance.getFeatureFlag(e),r=this.zn?.get(e);n&&r!=null&&r.variants[n]&&this.Un(r.name,n,r.variants[n].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=Fr(e?.search,`__experiment_id`),r=Fr(e?.search,`__experiment_variant`);n&&r&&(t.Vn(`previewing web experiments `+n+` && `+r),this.getWebExperiments((e=>{this.Gn(parseInt(n),r,e)}),!1,!0))}}loadIfEnabled(){this.Bt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this.Bt.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property(`$web_experiments`);if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/web_experiments/?token=`+this.Bt.token),method:`GET`,callback:t=>e(t.statusCode===200&&t.json&&t.json.experiments||[])})}Gn(e,n,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(t.Vn(`Previewing web experiment [`+i[0].name+`] with variant [`+n+`]`),this.Un(i[0].name,n,i[0].variants[n].transforms))}static Yn(e){return!P(e.conditions)&&t.Wn(e)&&t.Xn(e)}static Wn(e){if(P(e.conditions)||P(e.conditions?.url))return!0;var n,r=t.getWindowLocation();return!!r&&((n=e.conditions)==null||!n.url||as[e.conditions?.urlMatchType??`icontains`](e.conditions.url,r))}static getWindowLocation(){return e?.location}static Xn(e){if(P(e.conditions)||P(e.conditions?.utm))return!0;var t=Ur();if(t.utm_source){var n,r,i,a,o,s,c,l,u=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((r=e.conditions)==null||(r=r.utm)==null?void 0:r.utm_campaign)==t.utm_campaign,d=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==t.utm_source,f=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_medium||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_medium)==t.utm_medium,p=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_term)==t.utm_term;return u&&f&&p&&d}return!1}static Vn(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];H.info(`[WebExperiments] `+e,n)}Un(e,n,r){this._is_bot()?t.Vn(is):n===`control`?t.Vn(`Control variants leave the page unmodified.`):r.forEach((r=>{r.selector&&(t.Vn(`applying transform of variant `+n+` for experiment `+e+` `,r),(document?.querySelectorAll(r.selector))?.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute(`style`,r.css)})))}))}_is_bot(){return n&&this._instance?sa(n,this.Bt.custom_blocked_useragents):void 0}},ss=U(`[Conversations]`),cs=`Conversations not available yet.`,ls={featureFlags:class{constructor(e){this.Jn=!1,this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Bt(){return this._instance.config}get ni(){return this._instance.persistence}os(e){return this._instance.get_property(e)}ls(){var e;return(e=this.ni?._r(this.Bt.feature_flag_cache_ttl_ms))!=null&&e}us(){return!!this.ls()&&(this.ss||this.Qn||(this.ss=!0,$.warn(`Feature flag cache is stale, triggering refresh...`),this.reloadFeatureFlags()),!0)}hs(){var e=this.Bt.evaluation_contexts??this.Bt.evaluation_environments;return!this.Bt.evaluation_environments||this.Bt.evaluation_contexts||this.ns||($.warn(`evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version.`),this.ns=!0),e!=null&&e.length?e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||$.error(`Invalid evaluation context found:`,e,`Expected non-empty string`),t})):[]}cs(){return this.hs().length>0}initialize(){var{config:e}=this._instance,t=e.bootstrap?.featureFlags??{};if(Object.keys(t).length){var n=e.bootstrap?.featureFlagPayloads??{},r=Object.keys(t).filter((e=>!!t[e])).reduce(((e,n)=>(e[n]=t[n]||!1,e)),{}),i=Object.keys(n).filter((e=>r[e])).reduce(((e,t)=>(n[t]&&(e[t]=n[t]),e)),{});this.receivedFeatureFlags({featureFlags:r,featureFlagPayloads:i})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},i=n!=null&&n.merge?this.getFlagPayloads():{},a=h({},r,e),o=h({},i,t),s={};for(var[c,l]of Object.entries(a)){var u=typeof l==`string`;s[c]={key:c,enabled:!!u||!!l,variant:u?l:void 0,reason:void 0,metadata:A(o?.[c])?void 0:{id:0,version:void 0,description:void 0,payload:o[c]}}}this.receivedFeatureFlags({flags:s})}get hasLoadedFlags(){return this.Kn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.os(hn),t=this.os(vn),n=this.os(yn);if(!n&&!t)return e||{};var r=G({},e||{});for(var i of[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])]){var a,o,s=r[i],c=t?.[i],l=A(c)?(a=s?.enabled)!=null&&a:!!c,u=A(c)?s.variant:typeof c==`string`?c:void 0,d=n?.[i],f=h({},s,{enabled:l,variant:l?u??s?.variant:void 0});l!==s?.enabled&&(f.original_enabled=s?.enabled),u!==s?.variant&&(f.original_variant=s?.variant),d&&(f.metadata=h({},s?.metadata,{payload:d,original_payload:s==null||(o=s.metadata)==null?void 0:o.payload})),r[i]=f}return this.Jn||=($.warn(` Overriding feature flag details!`,{flagDetails:e,overriddenPayloads:n,finalDetails:r}),!0),r}getFlagVariants(){var e=this.os(fn),t=this.os(vn);if(!t)return e||{};for(var n=G({},e),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Jn||=($.warn(` Overriding feature flags!`,{enabledFlags:e,overriddenFlags:t,finalFlags:n}),!0),n}getFlagPayloads(){var e=this.os(gn),t=this.os(yn);if(!t)return e||{};for(var n=G({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Jn||=($.warn(` Overriding feature flag payloads!`,{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),!0),n}reloadFeatureFlags(){this.es||this.Bt.advanced_disable_feature_flags||this.ds||(this._instance.Fi.emit(`featureFlagsReloading`,!0),this.ds=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Kn||this.Qn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.es=e}vs(e){if(this.fs(),!this._instance.Fr())if(this.Qn)this.ts=!0;else{var t=this.Bt.token,n=this.os(Kt),r={token:t,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:h({},this.ni?.get_initial_props()||{},this.os(bn)||{}),group_properties:this.os(xn),timezone:Zr()};N(n)||A(n)||(r.$device_id=n),(e!=null&&e.disableFlags||this.Bt.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.cs()&&(r.evaluation_contexts=this.hs());var i=this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`+(this.Bt.advanced_only_evaluate_survey_feature_flags?`&only_evaluate_survey_feature_flags=true`:``));this.Qn=!0,this._instance._send_request({method:`POST`,url:i,data:r,compression:this.Bt.disable_compression?void 0:fi.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback:e=>{var t,n,i,a=!0;if(e.statusCode===200&&(this.ts||(this.$anon_distinct_id=void 0),a=!1),this.Qn=!1,!r.disable_flags||this.ts){this.rs=!a;var o=[];e.error?e.error instanceof Error?o.push(e.error.name===`AbortError`?`timeout`:`connection_error`):o.push(`unknown_error`):e.statusCode!==200&&o.push(`api_error_`+e.statusCode),(t=e.json)!=null&&t.errorsWhileComputingFlags&&o.push(`errors_while_computing_flags`);var s=!((n=e.json)==null||(n=n.quotaLimited)==null||!n.includes(`feature_flags`));s&&o.push(`quota_limited`),(i=this.ni)==null||i.register({[Dn]:o}),s?$.warn(`You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.`):(r.disable_flags||this.receivedFeatureFlags(e.json??{},a,{partialResponse:!!this.Bt.advanced_only_evaluate_survey_feature_flags}),this.ts&&(this.ts=!1,this.vs()))}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var n=this.getFeatureFlagResult(e,t);return n?.variant??n?.enabled}}else $.warn(`getFeatureFlag for key "`+e+es)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFeatureFlagResult(e,{send_event:!1})?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Kn||this.getFlags()&&this.getFlags().length>0){if(!this.us()){var n=this.getFlagVariants(),r=e in n,i=n[e],a=this.getFlagPayloads()[e],o=String(i),s=this.os(_n)||void 0,c=this.os(On)||void 0,l=this.os(Tn)||{};if(this.Bt.advanced_feature_flags_dedup_per_session){var u,d=this._instance.get_session_id(),f=this.os(En);d&&d!==f&&(l={},(u=this.ni)==null||u.register({[Tn]:l,[En]:d}))}if((t.send_event||!(`send_event`in t))&&(!(e in l)||!l[e].includes(o))){var p,m,h,g,_,v,y,b;E(l[e])?l[e].push(o):l[e]=[o],(p=this.ni)==null||p.register({[Tn]:l});var x=this.getFeatureFlagDetails(e),S=[...this.os(Dn)??[]];A(i)&&S.push(`flag_missing`);var C={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:a||null,$feature_flag_request_id:s,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((m=this.Bt.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[e])||null,$feature_flag_bootstrapped_payload:((h=this.Bt.bootstrap)==null||(h=h.featureFlagPayloads)==null?void 0:h[e])||null,$used_bootstrap_value:!this.rs};A(x==null||(g=x.metadata)==null?void 0:g.version)||(C.$feature_flag_version=x.metadata.version);var w,ee=(x==null||(_=x.reason)==null?void 0:_.description)??(x==null||(v=x.reason)==null?void 0:v.code);ee&&(C.$feature_flag_reason=ee),x!=null&&(y=x.metadata)!=null&&y.id&&(C.$feature_flag_id=x.metadata.id),A(x?.original_variant)&&A(x?.original_enabled)||(C.$feature_flag_original_response=A(x.original_variant)?x.original_enabled:x.original_variant),x!=null&&(b=x.metadata)!=null&&b.original_payload&&(C.$feature_flag_original_payload=x==null||(w=x.metadata)==null?void 0:w.original_payload),S.length&&(C.$feature_flag_error=S.join(`,`)),this._instance.capture(`$feature_flag_called`,C)}if(r){var T=a;if(!A(a))try{T=JSON.parse(a)}catch{}return{key:e,enabled:!!i,variant:typeof i==`string`?i:void 0,payload:T}}}}else $.warn(`getFeatureFlagResult for key "`+e+es)}getRemoteConfigPayload(e,t){var n=this.Bt.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.cs()&&(r.evaluation_contexts=this.hs()),this._instance._send_request({method:`POST`,url:this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`),data:r,compression:this.Bt.disable_compression?void 0:fi.Base64,timeout:this.Bt.feature_flag_request_timeout_ms,callback(n){var r=n.json?.featureFlagPayloads;t(r?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs){if(this.Kn||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return A(n)?void 0:!!n}$.warn(`isFeatureEnabled for key "`+e+es)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.ni){this.Kn=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(e,t,n,r,i,a){n===void 0&&(n={}),r===void 0&&(r={}),i===void 0&&(i={});var o=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>[e,t[e].variant??t[e].enabled]))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>t[e].metadata?.payload)).map((e=>[e,t[e].metadata?.payload])))):$.warn(`Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version`),e})(e),s=o.flags,c=o.featureFlags,l=o.featureFlagPayloads;if(c){var u=e.requestId,d=e.evaluatedAt;if(E(c)){$.warn(`v1 of the feature flags endpoint is deprecated. Please use the latest version.`);var f={};if(c)for(var p=0;c.length>p;p++)f[c[p]]=!0;t&&t.register({[pn]:c,[fn]:f})}else{var m=c,g=l,_=s;if(a!=null&&a.partialResponse)m=h({},n,m),g=h({},r,g),_=h({},i,_);else if(e.errorsWhileComputingFlags)if(s){var v=new Set(Object.keys(s).filter((e=>{var t;return!((t=s[e])!=null&&t.failed)})));m=h({},n,Object.fromEntries(Object.entries(m).filter((e=>{var[t]=e;return v.has(t)})))),g=h({},r,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return v.has(t)})))),_=h({},i,Object.fromEntries(Object.entries(_||{}).filter((e=>{var[t]=e;return v.has(t)}))))}else m=h({},n,m),g=h({},r,g),_=h({},i,_);t&&t.register(h({[pn]:Object.keys(ns(m)),[fn]:m||{},[gn]:g||{},[hn]:_||{}},u?{[_n]:u}:{},d?{[On]:d}:{}))}}})(e,this.ni,r,i,a,n),t||(this.ss=!1),this.ps(t)}}override(e,t){t===void 0&&(t=!1),$.warn(`override is deprecated. Please use overrideFeatureFlags instead.`),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ni)return $.uninitializedWarning(`posthog.featureFlags.overrideFeatureFlags`);if(!1===e)return this.ni.unregister(vn),this.ni.unregister(yn),this.ps(),$o.info(`All overrides cleared`);if(E(e)){var t=ts(e);return this.ni.register({[vn]:t}),this.ps(),$o.info(`Flag overrides set`,{flags:e})}if(e&&typeof e==`object`&&(`flags`in e||`payloads`in e)){var n,r=e;if(this.Jn=!!((n=r.suppressWarning)!=null&&n),`flags`in r){if(!1===r.flags)this.ni.unregister(vn),$o.info(`Flag overrides cleared`);else if(r.flags){if(E(r.flags)){var i=ts(r.flags);this.ni.register({[vn]:i})}else this.ni.register({[vn]:r.flags});$o.info(`Flag overrides set`,{flags:r.flags})}}`payloads`in r&&(!1===r.payloads?(this.ni.unregister(yn),$o.info(`Payload overrides cleared`)):r.payloads&&(this.ni.register({[yn]:r.payloads}),$o.info(`Payload overrides set`,{payloads:r.payloads}))),this.ps();return}if(e&&typeof e==`object`)return this.ni.register({[vn]:e}),this.ps(),$o.info(`Flag overrides set`,{flags:e});$.warn(`Invalid overrideOptions provided to overrideFeatureFlags`,{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Kn){var{flags:t,flagVariants:n}=this.gs();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,i=(this.os(mn)||[]).find((t=>t.flagKey===e)),a={[`$feature_enrollment/`+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};i&&(o.$early_access_feature_name=i.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture(`$feature_enrollment_update`,o),this.setPersonPropertiesForFlags(a,!1);var s=h({},this.getFlagVariants(),{[e]:t});(r=this.ni)==null||r.register({[pn]:Object.keys(ns(s)),[fn]:s}),this.ps()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.os(mn),i=n?`&`+n.map((e=>`stage=`+e)).join(`&`):``;if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/early_access_features/?token=`+this.Bt.token+i),method:`GET`,callback:t=>{var n,r;if(t.json){var i=t.json.earlyAccessFeatures;return(n=this.ni)==null||n.unregister(mn),(r=this.ni)==null||r.register({[mn]:i}),e(i)}}})}gs(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}ps(e){var{flags:t,flagVariants:n}=this.gs();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(bn)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),i=e?.$set_once,a={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(a[o]=i[o]));this._instance.register({[bn]:h({},n,a,r)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(bn)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.os(xn)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((t=>{n[t]=h({},n[t],e[t]),delete e[t]})),this._instance.register({[xn]:h({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.os(xn)||{};this._instance.register({[xn]:h({},t,{[e]:{}})})}else this._instance.unregister(xn)}reset(){this.Kn=!1,this.Qn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Jn=!1}}},us={sessionRecording:class{get Bt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var e;return!((e=this.ys)==null||!e.isStarted)}get status(){return this.bs===Po||this.bs===Fo?this.bs:this.ys?.status??this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=Mo,this.ws=void 0,this._instance=e,!this._instance.sessionManager)throw Lo.error(`started without valid sessionManager`),Error(Io+` started without valid sessionManager. This is a bug.`);if(this.Bt.cookieless_mode===Un)throw Error(Io+` cannot be used with cookieless_mode="always"`)}initialize(){this.startIfEnabledOrStop()}get _s(){var t,n=!((t=this._instance.get_property(an))==null||!t.enabled),r=!this.Bt.disable_session_recording,i=this.Bt.disable_session_recording||this._instance.consent.isOptedOut();return e&&n&&r&&!i}startIfEnabledOrStop(e){var t;if(!this._s||(t=this.ys)==null||!t.isStarted){var n=!A(Object.assign)&&!A(Array.from);this._s&&n?(this.Is(e),Lo.info(`starting`)):(this.bs=Mo,this.stopRecording())}}Is(e){var t,n,r;this._s&&(this.bs!==Po&&this.bs!==Fo&&(this.bs=No),u!=null&&(t=u.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=u.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Cs(e):(r=u.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Ss,(t=>{if(t)return Lo.error(`could not load recorder`,t);this.Cs(e)})))}stopRecording(){var e,t;(e=this.ws)==null||e.call(this),this.ws=void 0,(t=this.ys)==null||t.stop()}xs(){var e,t;(e=this.ws)==null||e.call(this),this.ws=void 0,(t=this.ys)==null||t.discard()}ks(){var e;(e=this.ni)==null||e.unregister(dn)}Ts(e,t){if(P(e))return null;var n,r=F(e)?e:parseFloat(e);return typeof(n=r)!=`number`||!Number.isFinite(n)||0>n||n>1?(Lo.warn(t+` must be between 0 and 1. Ignoring invalid value:`,e),null):r}As(e){if(this.ni){var t,n=this.ni,r=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Ts(this.Bt.session_recording?.sampleRate,`session_recording.sampleRate`),i=this.Ts(t?.sampleRate,`remote config sampleRate`),a=r??i;P(a)&&this.ks();var o=t?.minimumDurationMilliseconds;n.register({[an]:h({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:h({capturePerformance:e.capturePerformance},t?.networkPayloadCapture),canvasRecording:{enabled:t?.recordCanvas,fps:t?.canvasFps,quality:t?.canvasQuality},sampleRate:a,minimumDurationMilliseconds:A(o)?null:o,endpoint:t?.endpoint,triggerMatchType:t?.triggerMatchType,masking:t?.masking,urlTriggers:t?.urlTriggers,version:t?.version,triggerGroups:t?.triggerGroups})})};r(),(t=this.ws)==null||t.call(this),this.ws=this._instance.sessionManager?.onSessionId(r)}}onRemoteConfig(e){`sessionRecording`in e?!1===e.sessionRecording?(this.As(e),this.xs()):(this.As(e),this.startIfEnabledOrStop()):(this.bs===Po&&(this.bs=Fo,Lo.warn(`config refresh failed, recording will not start until page reload`)),this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t=`log`),(n=this.ys)!=null&&n.log?this.ys.log(e,t):Lo.warn(`log called before recorder was ready`)}get Ss(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(an);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||`lazy-recorder`}Es(){var e=this._instance.get_property(an);if(!e)return!1;var t=(typeof e==`object`?e:JSON.parse(e)).cache_timestamp??Date.now();return 36e5>=Date.now()-t}Cs(e){var t;if((t=u.__PosthogExtensions__)==null||!t.initSessionRecording)return Lo.warn(`Called on script loaded before session recording is available. This can be caused by adblockers.`),void this._instance.register_for_session({[Bn]:!0});if(this.ys||(this.ys=u.__PosthogExtensions__?.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Es()){if(this.bs===Fo||this.bs===Po)return;this.bs=Po,Lo.info(`persisted remote config is stale, requesting fresh config before starting`),new di(this._instance).load();return}this.bs=No,this.ys.start(e)}onRRwebEmit(e){var t;(t=this.ys)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||(t=this.ni)==null||t.register({[sn]:!0}),(e=this.ys)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||(t=this.ni)==null||t.register({[on]:!0}),(e=this.ys)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.ys||(n=this.ni)==null||n.register({[e===`url`?cn:ln]:!0}),(t=this.ys)==null||t.overrideTrigger(e)}get sdkDebugProperties(){return this.ys?.sdkDebugProperties||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.ys)==null||!n.tryAddCustomEvent(e,t))}}},ds={autocapture:class{constructor(e){this.Rs=!1,this.Ns=null,this.Ms=!1,this.instance=e,this.rageclicks=new xo(e.config.rageclick),this.Fs=null}initialize(){this.startIfEnabled()}get Bt(){var e=O(this.instance.config.autocapture)?this.instance.config.autocapture:{};return e.url_allowlist=e.url_allowlist?.map((e=>new RegExp(e))),e.url_ignorelist=e.url_ignorelist?.map((e=>new RegExp(e))),e}Os(){if(this.isBrowserSupported()){if(e&&r){var t=t=>{t||=e?.event;try{this.Ps(t)}catch(e){Co.error(`Failed to capture event`,e)}};if(K(r,`submit`,t,{capture:!0}),K(r,`change`,t,{capture:!0}),K(r,`click`,t,{capture:!0}),this.Bt.capture_copied_text){var n=t=>{t||=e?.event;try{this.Ps(t,So)}catch(e){Co.error(`Failed to capture copy/cut event`,e)}};K(r,`copy`,n,{capture:!0}),K(r,`cut`,n,{capture:!0})}}}else Co.info(`Disabling Automatic Event Collection because this browser is not supported`)}startIfEnabled(){this.isEnabled&&!this.Rs&&(this.Os(),this.Rs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Ms=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Yt]:!!e.autocapture_opt_out}),this.Ns=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Fs=e}getElementSelectors(e){var t,n=[];return(t=this.Fs)==null||t.forEach((t=>{(r?.querySelectorAll(t))?.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e=this.instance.persistence?.props[Yt];if(N(this.Ns)&&!L(e)&&!this.instance.Fr())return!1;var t=this.Ns??!!e;return!!this.instance.config.autocapture&&!t}Ps(t,n){if(n===void 0&&(n=`$autocapture`),this.isEnabled){var r,i=$a(t);Ka(i)&&(i=i.parentNode||null),n===`$autocapture`&&t.type===`click`&&t instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&function(t,n){if(!e||ao(t))return!1;var r,i;if(L(n)?(r=!!n&&io,i=void 0):(r=n?.css_selector_ignorelist??io,i=n?.content_ignorelist),!1===r)return!1;var{targetElementList:a}=oo(t,!1);return!function(e,t){if(!1===e||A(e))return!1;var n;if(!0===e)n=ro;else{if(!E(e))return!1;if(e.length>10)return H.error(`[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching.`),!1;n=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:r}=e;return n.some((e=>t.includes(e)||r.includes(e)))}))}(i,a.map((e=>({safeText:Qa(e).toLowerCase(),ariaLabel:e.getAttribute(`aria-label`)?.toLowerCase().trim()||``}))))&&!to(a,r)}(i,this.instance.config.rageclick)&&this.Ps(t,`$rageclick`);var a=n===So;if(i&&function(t,n,r,i,a){var o,s,c;if(r===void 0&&(r=void 0),!e||ao(t)||(o=r)!=null&&o.url_allowlist&&!Ya(r.url_allowlist)||(s=r)!=null&&s.url_ignorelist&&Ya(r.url_ignorelist))return!1;if((c=r)!=null&&c.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((e=>n.type===e)))return!1}var{parentIsUsefulElement:u,targetElementList:d}=oo(t,i);if(!function(e,t){var n=t?.element_allowlist;if(A(n))return!0;var r,i=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var a of e)if(r=i(a))return r.v;return!1}(d,r)||!to(d,r?.css_selector_allowlist))return!1;var f=e.getComputedStyle(t);if(f&&f.getPropertyValue(`cursor`)===`pointer`&&n.type===`click`)return!0;var p=t.tagName.toLowerCase();switch(p){case`html`:return!1;case`form`:return(a||[`submit`]).indexOf(n.type)>=0;case`input`:case`select`:case`textarea`:return(a||[`change`,`click`]).indexOf(n.type)>=0;default:return u?(a||[`click`]).indexOf(n.type)>=0:(a||[`click`]).indexOf(n.type)>=0&&(eo.indexOf(p)>-1||t.getAttribute(`contenteditable`)===`true`)}}(i,t,this.Bt,a,a?[`copy`,`cut`]:void 0)){var{props:o,explicitNoCapture:s}=Eo(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Bt.element_attribute_ignorelist,elementsChainAsString:this.Ms});if(s)return!1;var c=this.getElementSelectors(i);if(c&&c.length>0&&(o.$element_selectors=c),n===So){var l,u=Za(e==null||(l=e.getSelection())==null?void 0:l.toString()),d=t.type||`clipboard`;if(!u)return!1;o.$selected_content=u,o.$copy_type=d}return this.instance.capture(n,o),!0}}}isBrowserSupported(){return D(r?.querySelectorAll)}},historyAutocapture:class{constructor(t){var n;this._instance=t,this.Ls=(e==null||(n=e.location)==null?void 0:n.pathname)||``}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview===`history_change`}startIfEnabled(){this.isEnabled&&(H.info(`History API monitoring enabled, starting...`),this.monitorHistoryChanges())}stop(){this.Ds&&this.Ds(),this.Ds=void 0,H.info(`History API monitoring stopped`)}monitorHistoryChanges(){var t,n;if(e&&e.history){var r=this;(t=e.history.pushState)!=null&&t.__posthog_wrapped__||Oo(e.history,`pushState`,(e=>function(t,n,i){e.call(this,t,n,i),r.Bs(`pushState`)})),(n=e.history.replaceState)!=null&&n.__posthog_wrapped__||Oo(e.history,`replaceState`,(e=>function(t,n,i){e.call(this,t,n,i),r.Bs(`replaceState`)})),this.js()}}Bs(t){try{var n,r=e==null||(n=e.location)==null?void 0:n.pathname;if(!r)return;r!==this.Ls&&this.isEnabled&&this._instance.capture(Yn,{navigation_type:t}),this.Ls=r}catch(e){H.error(`Error capturing `+t+` pageview`,e)}}js(){if(!this.Ds){var t=()=>{this.Bs(`popstate`)};K(e,`popstate`,t),this.Ds=()=>{e&&e.removeEventListener(`popstate`,t)}}}},heatmaps:class{get Bt(){return this.instance.config}constructor(e){var t;this.$s=!1,this.Rs=!1,this.qs=null,this.instance=e,this.$s=!((t=this.instance.persistence)==null||!t.props[Xt]),this.rageclicks=new xo(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return O(this.Bt.capture_heatmaps)&&this.Bt.capture_heatmaps.flush_interval_milliseconds&&(e=this.Bt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return P(this.Bt.capture_heatmaps)?P(this.Bt.enable_heatmaps)?this.$s:this.Bt.enable_heatmaps:!1!==this.Bt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.Rs)return;Ro.info(`starting...`),this.Zs(),this.Lt()}else clearInterval(this.qs??void 0),this.Hs(),this.getAndClearBuffer()}onRemoteConfig(e){if(`heatmaps`in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Xt]:t}),this.$s=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.T;return this.T=void 0,e}Vs(e){this.Tt(e.originalEvent,`deadclick`)}Lt(){this.qs&&clearInterval(this.qs),this.qs=r?.visibilityState===`visible`?setInterval(this.Yr.bind(this),this.flushIntervalMilliseconds):null}Zs(){e&&r&&(this.zs=this.Yr.bind(this),K(e,Jn,this.zs),this.Us=t=>this.Tt(t||e?.event),K(r,`click`,this.Us,{capture:!0}),this.Ys=t=>this.Gs(t||e?.event),K(r,`mousemove`,this.Ys,{capture:!0}),this.Ws=new Er(this.instance,wr,this.Vs.bind(this)),this.Ws.startIfEnabledOrStop(),this.Xs=this.Lt.bind(this),K(r,qn,this.Xs),this.Rs=!0)}Hs(){var t;e&&r&&(this.zs&&e.removeEventListener(Jn,this.zs),this.Us&&r.removeEventListener(`click`,this.Us,{capture:!0}),this.Ys&&r.removeEventListener(`mousemove`,this.Ys,{capture:!0}),this.Xs&&r.removeEventListener(qn,this.Xs),clearTimeout(this.Js),(t=this.Ws)==null||t.stop(),this.Rs=!1)}Ks(t,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),o=function(t,n,r){for(var i=t;i&&Wa(i)&&!Ga(i,`body`);){if(i===r)return!1;if(x(n,e?.getComputedStyle(i).position))return!0;i=no(i)}return!1}($a(t),[`fixed`,`sticky`],a);return{x:t.clientX+(o?0:i),y:t.clientY+(o?0:r),target_fixed:o,type:n}}Tt(e,t){var n;if(t===void 0&&(t=`click`),!Ua(e.target)&&zo(e)){var r=this.Ks(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Qs(h({},r,{type:`rageclick`})),this.Qs(r)}}Gs(e){!Ua(e.target)&&zo(e)&&(clearTimeout(this.Js),this.Js=setTimeout((()=>{this.Qs(this.Ks(e,`mousemove`))}),500))}Qs(t){if(e){var n=e.location.href,r=this.Bt.custom_personal_data_properties,i=Ir(n,this.Bt.mask_personal_data_properties?[...zr,...r||[]]:[],Vr);this.T=this.T||{},this.T[i]||(this.T[i]=[]),this.T[i].push(t)}}Yr(){this.T&&!k(this.T)&&this.instance.capture(`$$heatmap`,{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Er,webVitalsAutocapture:class{constructor(e){var t;this.$s=!1,this.Rs=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),this.T.metrics.length!==0&&(this._instance.capture(`$web_vitals`,this.T.metrics.reduce(((e,t)=>h({},e,{[`$web_vitals_`+t.name+`_event`]:h({},t),[`$web_vitals_`+t.name+`_value`]:t.value})),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=e=>{var t=this._instance.sessionManager?.checkAndGetSessionAndWindowId(!0);if(A(t))Ao.error(`Could not read session ID. Dropping metrics!`);else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.io();A(n)||(P(e?.name)||P(e?.value)?Ao.error(`Invalid metric received`,e):!this.no||this.no>e.value?(this.T.url!==n&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),A(this.T.url)&&(this.T.url=n),this.T.firstMetricTimestamp=A(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.T.metrics.push(h({},e,{$current_url:n,$session_id:t.sessionId,$window_id:t.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.eo()):Ao.error(`Ignoring metric with value >= `+this.no,e))}},this.so=()=>{if(!this.Rs){var e,t,n,r,i=u.__PosthogExtensions__;A(i)||A(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf(`LCP`)>-1&&e(this.ht.bind(this)),this.allowedMetrics.indexOf(`CLS`)>-1&&t(this.ht.bind(this)),this.allowedMetrics.indexOf(`FCP`)>-1&&n(this.ht.bind(this)),this.allowedMetrics.indexOf(`INP`)>-1&&r(this.ht.bind(this)),this.Rs=!0):Ao.error(`web vitals callbacks not loaded - not starting`)}},this._instance=e,this.$s=!((t=this._instance.persistence)==null||!t.props[en]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var e=O(this.oo)?this.oo?.web_vitals_allowed_metrics:void 0;return P(e)?this._instance.persistence?.props[rn]||[`CLS`,`FCP`,`INP`,`LCP`]:e}get flushToCaptureTimeoutMs(){return(O(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=O(this.oo)?this.oo.web_vitals_attribution:void 0;return e!=null&&e}get no(){var e=O(this.oo)&&F(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:jo;return e>0&&6e4>=e?jo:e}get isEnabled(){var e=i?.protocol;if(e!==`http:`&&e!==`https:`)return Ao.info(`Web Vitals are disabled on non-http/https protocols`),!1;var t=O(this.oo)?this.oo.web_vitals:L(this.oo)?this.oo:void 0;return L(t)?t:this.$s}startIfEnabled(){this.isEnabled&&!this.Rs&&(Ao.info(`enabled, starting...`),this.ur(this.so))}onRemoteConfig(e){if(`capturePerformance`in e){var t=O(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=O(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[en]:t}),this._instance.persistence.register({[rn]:n})),this.$s=t,this.startIfEnabled()}}ur(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?`web-vitals-with-attribution`:`web-vitals`,(t=>{t?Ao.error(`failed to load script`,t):e()}))}io(){var t=e?e.location.href:void 0;if(t){var n=this._instance.config.custom_personal_data_properties;return Ir(t,this._instance.config.mask_personal_data_properties?[...zr,...n||[]]:[],Vr)}Ao.error(`Could not determine current URL`)}}},fs={exceptionObserver:class{constructor(t){var n;this.so=()=>{var t;if(e&&this.isEnabled&&(t=u.__PosthogExtensions__)!=null&&t.errorWrappingFunctions){var n=u.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=u.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=u.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.Bt.capture_unhandled_errors&&(this.ao=n(this.captureException.bind(this))),!this.lo&&this.Bt.capture_unhandled_rejections&&(this.lo=r(this.captureException.bind(this))),!this.uo&&this.Bt.capture_console_errors&&(this.uo=i(this.captureException.bind(this)))}catch(e){Do.error(`failed to start`,e),this.ho()}}},this._instance=t,this.co=!((n=this._instance.persistence)==null||!n.props[Zt]),this.do=new ce({refillRate:this._instance.config.error_tracking.__exceptionRateLimiterRefillRate??1,bucketSize:this._instance.config.error_tracking.__exceptionRateLimiterBucketSize??10,refillInterval:1e4,Gt:Do}),this.Bt=this.vo(),this.startIfEnabledOrStop()}vo(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return O(e)?t=h({},t,e):(A(e)?this.co:e)&&(t=h({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Bt.capture_console_errors||this.Bt.capture_unhandled_errors||this.Bt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Do.info(`enabled`),this.ho(),this.ur(this.so)):this.ho()}ur(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`exception-autocapture`,(t=>{if(t)return Do.error(`failed to load script`,t);e()}))}ho(){var e,t,n;(e=this.ao)==null||e.call(this),this.ao=void 0,(t=this.lo)==null||t.call(this),this.lo=void 0,(n=this.uo)==null||n.call(this),this.uo=void 0}onRemoteConfig(e){`autocaptureExceptions`in e&&(this.co=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Zt]:this.co}),this.Bt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.Bt=this.vo()}captureException(e){var t,n,r=(e==null||(t=e.$exception_list)==null||(t=t[0])==null?void 0:t.type)??`Exception`;this.do.consumeRateLimit(r)?Do.info(`Skipping exception capture because of client rate limiting.`,{exception:r}):(n=this._instance.exceptions)==null||n.sendExceptionEvent(e)}},exceptions:class{constructor(e){this.fo=[],this.po=new ft([new wt,new Pt,new Et,new Tt,new Mt,new jt,new Ot,new Nt],function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){r===void 0&&(r=0);for(var i=[],a=t.split(`
|
|
2
|
-
`),o=r;a.length>o;o++){var s=a[o];if(1024>=s.length){var c=Ct.test(s)?s.replace(Ct,`$1`):s;if(!c.match(/\S*Error: /)){for(var l of n){var u=l(c,e);if(u){i.push(u);break}}if(i.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return h({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||pt});var n}))}(i)}}(`web:javascript`,yt,St)),this._instance=e,this.fo=this._instance.persistence?.get_property(Qt)??[],this.mo=zt(this.yo()),this.bo=new Bt(this.mo)}onConfigChange(){this.mo=zt(this.yo()),this.bo.setConfig(this.mo)}onRemoteConfig(e){if(`errorTracking`in e){var t=e.errorTracking?.suppressionRules??[],n=e.errorTracking?.captureExtensionExceptions;this.fo=t,this._instance.persistence&&this._instance.persistence.register({[Qt]:this.fo,[$t]:n})}}get wo(){var e,t=!!this._instance.get_property($t);return(e=this._instance.config.error_tracking.captureExtensionExceptions??t)!=null&&e}buildProperties(e,t){return this.po.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.mo.enabled)try{if(!j(e)||e.trim().length===0)return void rs.warn(`Ignoring exception step because message must be a non-empty string`);var{sanitizedProperties:n,droppedKeys:r}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((n,r)=>Lt.has(r)?(t.push(r),n):(n[r]=e[r],n)),{}),droppedKeys:t}}(this._o(t));r.length>0&&rs.warn(`Ignoring reserved exception step fields`,{droppedKeys:r}),this.bo.add(h({[Ft]:e,[It]:new Date().toISOString()},n))}catch(e){rs.error(`Failed to add exception step. Ignoring breadcrumb.`,e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Io(t)){if(this.Co(t))return this.So(`Exception dropped: matched a suppression rule`),void rs.info(`Skipping exception capture because a suppression rule matched`);if(!this.wo&&this.xo(t))return this.So(`Exception dropped: thrown by a browser extension`),void rs.info(`Skipping exception capture because it was thrown by an extension`);if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ko(t))return this.So(`Exception dropped: thrown by the PostHog SDK`),void rs.info(`Skipping exception capture because it was thrown by the PostHog SDK`)}var n=this.mo.enabled&&P(e.$exception_steps)?this.To(e):e;try{var r=this._instance.capture(`$exception`,n,{_noTruncate:!0,_batchKey:`exceptionEvent`,en:!0});return r&&this.bo.clear(),r}catch(e){rs.error(`Failed to capture exception event. Dropping this exception.`,e),this.bo.clear();return}}catch(e){rs.error(`Failed to process exception event. Ignoring this exception.`,e);return}}To(e){try{var t=this.bo.getAttachable();return t.length===0?e:h({},e,{$exception_steps:t})}catch(t){return rs.error(`Failed to read buffered exception steps. Capturing exception without steps.`,t),e}}So(e){this.mo.enabled&&this.bo.add({[Ft]:e,[It]:new Date().toISOString()})}_o(e){return O(e)?h({},e):{}}yo(){return this._instance.config.error_tracking?.exception_steps??{}}Co(e){if(e.length===0)return!1;var t=e.reduce(((e,t)=>{var{type:n,value:r}=t;return j(n)&&n.length>0&&e.$exception_types.push(n),j(r)&&r.length>0&&e.$exception_values.push(r),e}),{$exception_types:[],$exception_values:[]});return this.fo.some((e=>{var n=e.values.map((e=>{var n=ua[e.operator],r=E(e.value)?e.value:[e.value],i=t[e.key]??[];return r.length>0&&n(r,i)}));return e.type===`OR`?n.some(Boolean):n.every(Boolean)}))}xo(e){return e.flatMap((e=>e.stacktrace?.frames??[])).some((e=>e.filename&&e.filename.startsWith(`chrome-extension://`)))}ko(e){if(e.length>0){var t,n,r=e[0].stacktrace?.frames??[],i=r[r.length-1];return(t=i==null||(n=i.filename)==null?void 0:n.includes(`posthog.com/static`))!=null&&t}return!1}Io(e){return!P(e)&&E(e)}}},ps=h({productTours:class{get ni(){return this._instance.persistence}constructor(e){this.Ao=null,this.Eo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){`productTours`in e&&(this.ni&&this.ni.register({[nn]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Ao||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(nn)||this.ur((()=>this.Ro()))}ur(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`product-tours`,(t=>{t?Bo.error(`Could not load product tours script`,t):e()}))}Ro(){var e;!this.Ao&&(e=u.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Ao=u.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!E(this.Eo)||t){var n=this.ni;if(n){var r=n.props[wn];if(E(r)&&!t)return this.Eo=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/product_tours/?token=`+this._instance.config.token),method:`GET`,callback:t=>{var r=t.statusCode;if(r!==200||!t.json){var i=`Product Tours API could not be loaded, status: `+r;Bo.error(i),e([],{isLoaded:!1,error:i});return}var a=E(t.json.product_tours)?t.json.product_tours:[];this.Eo=a,n&&n.register({[wn]:a}),e(a,{isLoaded:!0})}})}else e(this.Eo,{isLoaded:!0})}getActiveProductTours(e){P(this.Ao)?e([],{isLoaded:!1,error:`Product tours not loaded`}):this.Ao.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Ao)==null||t.showTourById(e)}previewTour(e){this.Ao?this.Ao.previewTour(e):this.ur((()=>{var t;this.Ro(),(t=this.Ao)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Ao)==null||e.dismissTour(`user_clicked_skip`)}nextStep(){var e;(e=this.Ao)==null||e.nextStep()}previousStep(){var e;(e=this.Ao)==null||e.previousStep()}clearCache(){var e;this.Eo=null,(e=this.ni)==null||e.unregister(wn)}resetTour(e){var t;(t=this.Ao)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Ao)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Ao)==null||t.cancelPendingTour(e)}}},ls),ms={siteApps:class{constructor(e){this._instance=e,this.No=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Mo(e,t){if(t){var n=this.globalsForEvent(t);this.No.push(n),this.No.length>1e3&&(this.No=this.No.slice(10))}}get siteAppLoaders(){var e;return(e=u._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Mo.bind(this));this.Fo=()=>{e(),this.No=[],this.Fo=void 0}}}globalsForEvent(e){if(!e)throw Error(`Event payload is required`);var t={},n=this._instance.get_property(`$groups`)||[],r=this._instance.get_property(`$stored_group_properties`)||{};for(var[i,a]of Object.entries(r))t[i]={id:n[i],type:i,properties:a};var{$set_once:o,$set:s}=e;return{event:h({},g(e,Vo),{properties:h({},e.properties,s?{$set:h({},e.properties?.$set??{},s)}:{},o?{$set_once:h({},e.properties?.$set_once??{},o)}:{}),elements_chain:e.properties?.$elements_chain??``,distinct_id:e.properties?.distinct_id}),person:{properties:this._instance.get_property(`$stored_person_properties`)},groups:t}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var n;!t.errored&&this.No.length&&(Ho.info(`Processing `+this.No.length+` events for site app with id `+e.id),this.No.forEach((e=>t.processEvent==null?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&((n=this.Fo)==null||n.call(this))},r=!1,i=i=>{t.errored=!i,t.loaded=!0,Ho.info(`Site app with id `+e.id+` `+(i?`loaded`:`errored`)),r&&n()};try{var{processEvent:a}=e.init({posthog:this._instance,callback(e){i(e)}});a&&(t.processEvent=a),r=!0}catch(t){Ho.error(Uo+e.id,t),i(!1)}if(r&&t.loaded)try{n()}catch(n){Ho.error(`Error while processing buffered events PostHog app with config id `+e.id,n),t.errored=!0}}Oo(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Po(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(t){Ho.error(`Error while processing event `+e.event+` for site app `+n.id,t)}}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Oo(),void this._instance.on(`eventCaptured`,(e=>this.Po(e)))):void Ho.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`);if((n=this.Fo)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(e){var t;u[`__$$ph_site_app_`+e]=i._instance,(t=u.__PosthogExtensions__)==null||t.loadSiteApp==null||t.loadSiteApp(i._instance,s,(t=>{if(t)return Ho.error(Uo+e,t)}))};for(var{id:o,url:s}of e.siteApps)a(o)}else Ho.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`)}}},hs={tracingHeaders:class{constructor(e){this.Lo=void 0,this.Do=void 0,this.so=()=>{var e,t,n=this.Bo()||[];A(this.Lo)&&((e=u.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null||e._patchXHR(n,this._instance.get_distinct_id(),this._instance.sessionManager)),A(this.Do)&&((t=u.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchFetch(n,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}ur(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`tracing-headers`,(t=>{if(t)return ko.error(`failed to load script`,t);e()}))}Bo(){return this._instance.config.addTracingHeaders??this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var e,t;this.Bo()?this.ur(this.so):((e=this.Lo)==null||e.call(this),(t=this.Do)==null||t.call(this),this.Lo=void 0,this.Do=void 0)}}},gs=h({surveys:class{get Bt(){return this._instance.config}constructor(e){this.jo=void 0,this._surveyManager=null,this.$o=!1,this.qo=[],this.Zo=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Bt.disable_surveys){var t=e.surveys;if(P(t))return Q.warn(`Flags not loaded yet. Not loading surveys.`);var n=E(t);this.jo=n?t.length>0:t,Q.info(`flags response received, isSurveysEnabled: `+this.jo),this.loadIfEnabled()}}reset(){localStorage.removeItem(`lastSeenSurveyDate`);for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(ya)||n!=null&&n.startsWith(`inProgressSurvey_`))&&e.push(n)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.$o)Q.info(`Already initializing surveys, skipping...`);else if(this.Bt.disable_surveys)Q.info(Yo);else if(this.Bt.cookieless_mode&&this._instance.consent.isOptedOut())Q.info(`Not loading surveys in cookieless mode without consent.`);else{var e=u?.__PosthogExtensions__;if(e){if(!A(this.jo)||this.Bt.advanced_enable_surveys){var t=this.jo||this.Bt.advanced_enable_surveys;this.$o=!0;try{var n=e.generateSurveys;if(n)return void this.Ho(n,t);var r=e.loadExternalDependency;if(!r)return void this.Vo(Vn);r(this._instance,`surveys`,(n=>{n||!e.generateSurveys?this.Vo(`Could not load surveys script`,n):this.Ho(e.generateSurveys,t)}))}catch(e){throw this.Vo(`Error initializing surveys`,e),e}finally{this.$o=!1}}}else Q.error(`PostHog Extensions not found.`)}}Ho(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new qo(this._instance),Q.info(`Surveys loaded successfully`),this.zo({isLoaded:!0})}Vo(e,t){Q.error(e,t),this.zo({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.qo.push(e),this._surveyManager&&this.zo({isLoaded:!0}),()=>{this.qo=this.qo.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.Bt.disable_surveys)return Q.info(Yo),e([]);var n,r=this._instance.get_property(Sn);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<`u`&&this.Zo?this.Zo.then((t=>{var{surveys:n,context:r}=t;return e(n,r)})):(typeof Promise<`u`&&(this.Zo=new Promise((e=>{n=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/surveys/?token=`+this.Bt.token),method:`GET`,timeout:this.Bt.surveys_request_timeout_ms,callback:t=>{var r;this.Zo=null;var i=t.statusCode;if(i!==200||!t.json){var a=`Surveys API could not be loaded, status: `+i;Q.error(a);var o={isLoaded:!1,error:a};e([],o),n?.({surveys:[],context:o});return}var s,c=t.json.surveys||[],l=c.filter((e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(function(e){var t;return!((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null||!t.length)}(e)||function(e){var t;return!((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null||!t.length)}(e))));l.length>0&&((s=this._surveyEventReceiver)==null||s.register(l)),(r=this._instance.persistence)==null||r.register({[Sn]:c});var u={isLoaded:!0};e(c,u),n?.({surveys:c,context:u})}}))}zo(e){for(var t of this.qo)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Q.error(`Error in survey callback`,e)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!P(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Q.warn(`init was not called`)}Uo(e){var t=null;return this.getSurveys((n=>{t=n.find((t=>t.id===e))??null})),t}Yo(e){if(P(this._surveyManager))return{eligible:!1,reason:Jo};var t=typeof e==`string`?this.Uo(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:`Survey not found`}}canRenderSurvey(e){if(P(this._surveyManager))return Q.warn(`init was not called`),{visible:!1,disabledReason:Jo};var t=this.Yo(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return P(this._surveyManager)?(Q.warn(`init was not called`),Promise.resolve({visible:!1,disabledReason:Jo})):new Promise((n=>{this.getSurveys((t=>{var r=t.find((t=>t.id===e))??null;if(r){var i=this.Yo(r);n({visible:i.eligible,disabledReason:i.reason})}else n({visible:!1,disabledReason:`Survey not found`})}),t)}))}renderSurvey(e,t,n){var i;if(P(this._surveyManager))Q.warn(`init was not called`);else{var a=typeof e==`string`?this.Uo(e):e;if(a!=null&&a.id)if(ba.includes(a.type)){var o=r?.querySelector(t);if(o)return(i=a.appearance)!=null&&i.surveyPopupDelaySeconds?(Q.info(`Rendering survey `+a.id+` with delay of `+a.appearance.surveyPopupDelaySeconds+` seconds`),void setTimeout((()=>{var e;Q.info(`Rendering survey `+a.id+` with delay of `+a.appearance?.surveyPopupDelaySeconds+` seconds`),(e=this._surveyManager)==null||e.renderSurvey(a,o,n),Q.info(`Survey `+a.id+` rendered`)}),1e3*a.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(a,o,n);Q.warn(`Survey element not found`)}else Q.warn(`Surveys of type `+a.type+` cannot be rendered in the app`);else Q.warn(`Survey not found`)}}displaySurvey(e,t){var n;if(P(this._surveyManager))Q.warn(`init was not called`);else{var r=this.Uo(e);if(r){var i=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=h({},r,{appearance:h({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==ai.Popover&&t.initialResponses&&Q.warn(`initialResponses is only supported for popover surveys. prefill will not be applied.`),!1===t.ignoreConditions){var a=this.canRenderSurvey(r);if(!a.visible)return void Q.warn(`Survey is not eligible to be displayed: `,a.disabledReason)}t.displayType===ai.Inline?this.renderSurvey(i,t.selector,t.properties):this._surveyManager.handlePopoverSurvey(i,t)}else Q.warn(`Survey not found`)}}cancelPendingSurvey(e){P(this._surveyManager)?Q.warn(`init was not called`):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},ls),_s={toolbar:class{constructor(e){this.instance=e}Go(e){u.ph_toolbar_state=e}Wo(){return u.ph_toolbar_state??0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,n,i){if(t===void 0&&(t=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),or(this.instance.config)||!e||!r)return!1;t??=e.location,i??=e.history;try{if(!n){try{e.localStorage.setItem(`test`,`test`),e.localStorage.removeItem(`test`)}catch{return!1}n=e?.localStorage}var a,o=Xo||Lr(t.hash,`__posthog`)||Lr(t.hash,`state`),s=o?tr((()=>JSON.parse(atob(decodeURIComponent(o)))))||tr((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action===`ph_authorize`?((a=s).source=`url`,a&&Object.keys(a).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,``,t.pathname+t.search):t.hash=``)):((a=JSON.parse(n.getItem(Zo)||`{}`)).source=`localstorage`,delete a.userIntent),!(!a.token||this.instance.config.token!==a.token||(this.loadToolbar(a),0))}catch{return!1}}Xo(e){var t=u.ph_load_toolbar||u.ph_load_editor;!P(t)&&D(t)?t(e,this.instance):Qo.warn(`No toolbar load function found`)}loadToolbar(t){var n=!(r==null||!r.getElementById(In));if(!e||n)return!1;var i=this.instance.requestRouter.region===`custom`&&this.instance.config.advanced_disable_toolbar_metrics,a=h({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor(`ui`)},i?{instrument:!1}:{});if(e.localStorage.setItem(Zo,JSON.stringify(h({},a,{source:void 0}))),this.Wo()===2)this.Xo(a);else if(this.Wo()===0){var o;this.Go(1),(o=u.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,`toolbar`,(e=>{if(e)return Qo.error(`[Toolbar] Failed to load`,e),void this.Go(0);this.Go(2),this.Xo(a)})),K(e,`turbolinks:load`,(()=>{this.Go(0),this.loadToolbar(a)}))}return!0}Jo(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},vs=h({experiments:os},ls),ys=h({},ls,us,ds,fs,ps,ms,gs,hs,_s,vs,{conversations:class{constructor(e){this.Ko=void 0,this._conversationsManager=null,this.Qo=!1,this.ea=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;P(t)||(L(t)?this.Ko=t:(this.Ko=t.enabled,this.ea=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Ko=void 0,this.ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Qo||this._instance.config.disable_conversations||or(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=u?.__PosthogExtensions__;if(e&&!A(this.Ko)&&this.Ko)if(this.ea&&this.ea.token){this.Qo=!0;try{var t=e.initConversations;if(t)return this.ta(t),void(this.Qo=!1);var n=e.loadExternalDependency;if(!n)return void this.ra(Vn);n(this._instance,`conversations`,(t=>{t||!e.initConversations?this.ra(`Could not load conversations script`,t):this.ta(e.initConversations),this.Qo=!1}))}catch(e){this.ra(`Error initializing conversations`,e),this.Qo=!1}}else ss.error(`Conversations enabled but missing token in remote config.`)}}ta(e){if(this.ea)try{this._conversationsManager=e(this.ea,this._instance),ss.info(`Conversations loaded successfully`)}catch(e){this.ra(`Error completing conversations initialization`,e)}else ss.error(`Cannot complete initialization: remote config is null`)}ra(e,t){ss.error(e,t),this._conversationsManager=null,this.Qo=!1}show(){this._conversationsManager?this._conversationsManager.show():ss.warn(`Conversations not loaded yet.`)}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ko&&!N(this._conversationsManager)}isVisible(){var e;return(e=this._conversationsManager?.isVisible())!=null&&e}sendMessage(e,t,n){var r=this;return m((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(ss.warn(cs),null)}))()}getMessages(e,t){var n=this;return m((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(ss.warn(cs),null)}))()}markAsRead(e){var t=this;return m((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(ss.warn(cs),null)}))()}getTickets(e){var t=this;return m((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(ss.warn(cs),null)}))()}requestRestoreLink(e){var t=this;return m((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(ss.warn(cs),null)}))()}restoreFromToken(e){var t=this;return m((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(ss.warn(cs),null)}))()}restoreFromUrlToken(){var e=this;return m((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ss.warn(cs),null)}))()}getCurrentTicketId(){return this._conversationsManager?.getCurrentTicketId()??null}getWidgetSessionId(){return this._conversationsManager?.getWidgetSessionId()??null}un(){var e;(e=this._conversationsManager)==null||e.setIdentity()}hn(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.ia=!1,this.na=!1,this.Gt=U(`[logs]`),this.sa=[],this.oa=0,this.aa=0,this.la=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.ia=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t=e.logs?.captureConsoleLogs;!P(t)&&t&&(this.ia=!0,this.loadIfEnabled())}reset(){this.sa=[],this.jr&&=(clearTimeout(this.jr),void 0),this.oa=0,this.aa=0,this.la=!1}loadIfEnabled(){if(this.ia&&!this.na){var e=u?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,`logs`,(t=>{var n;t||(n=e.logs)==null||!n.initializeLogs?this.Gt.error(`Could not load logs script`,t):(e.logs.initializeLogs(this._instance),this.na=!0)})):this.Gt.error(Vn)}else this.Gt.error(`PostHog Extensions not found.`)}}captureLog(e){if(this._instance.is_capturing())if(e&&e.body){var t=this._instance.config.logs?.flushIntervalMs??3e3,n=this._instance.config.logs?.maxLogsPerInterval??1e3,r=Date.now();if(t>r-this.aa||(this.aa=r,this.oa=0,this.la=!1),n>this.oa){this.oa++;var i=function(e,t){var{text:n,number:r}=st[e.level||`info`]||ct,i=String(Date.now())+`000000`,a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.currentUrl&&(a[`url.full`]=t.currentUrl),t.screenName&&(a[`screen.name`]=t.screenName),t.appState&&(a[`app.state`]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var o=h({},a,e.attributes||{}),s={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:r,severityText:n,body:{stringValue:e.body},attributes:ut(o)};return e.trace_id&&(s.traceId=e.trace_id),e.span_id&&(s.spanId=e.span_id),A(e.trace_flags)||(s.flags=e.trace_flags),s}(e,this.ua());this.sa.push({record:i}),(this._instance.config.logs?.maxBufferSize??100)>this.sa.length?this.ha():this.flushLogs()}else this.la||=(this.Gt.warn(`captureLog dropping logs: exceeded `+n+` logs per `+t+`ms`),!0)}else this.Gt.warn(`captureLog requires a body`)}get logger(){return this.ca||={trace:(e,t)=>this.captureLog({body:e,level:`trace`,attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:`debug`,attributes:t}),info:(e,t)=>this.captureLog({body:e,level:`info`,attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:`warn`,attributes:t}),error:(e,t)=>this.captureLog({body:e,level:`error`,attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:`fatal`,attributes:t})},this.ca}flushLogs(e){if(this.jr&&=(clearTimeout(this.jr),void 0),this.sa.length!==0){var t=this.sa;this.sa=[];var n=this._instance.config.logs,r=h({"service.name":n?.serviceName||`unknown_service`},n?.environment&&{"deployment.environment":n.environment},n?.serviceVersion&&{"service.version":n.serviceVersion},n?.resourceAttributes),i=function(e,t,n,r){return{resourceLogs:[{resource:{attributes:ut(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}(t.map((e=>e.record)),r,f.LIB_NAME,f.LIB_VERSION),a=this._instance.requestRouter.endpointFor(`api`,`/i/v1/logs`)+`?token=`+encodeURIComponent(this._instance.config.token);this._instance.Hi({method:`POST`,url:a,data:i,compression:`best-available`,batchKey:`logs`,transport:e})}}ha(){this.jr||=setTimeout((()=>{this.jr=void 0,this.flushLogs()}),this._instance.config.logs?.flushIntervalMs??3e3)}ua(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n}if(u!=null&&(e=u.location)!=null&&e.href&&(t.currentUrl=u.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}});za.__defaultExtensionClasses=h({},ys);var bs,xs=(bs=Ea[Na]=new za,function(){function t(){t.done||(t.done=!0,Pa=!1,W(Ea,(function(e){e._dom_loaded()})))}r!=null&&r.addEventListener?r.readyState===`complete`?t():K(r,`DOMContentLoaded`,t,{capture:!1}):e&&H.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),bs);exports.default=xs;
|
|
1
|
+
require("../../../_virtual/_rolldown/runtime.cjs");var e=typeof window<`u`?window:void 0,t=typeof globalThis<`u`?globalThis:e;typeof self>`u`&&(t.self=t),typeof File>`u`&&(t.File=function(){});var n=t?.navigator,r=t?.document,i=t?.location,a=t?.fetch,o=t!=null&&t.XMLHttpRequest&&`withCredentials`in new t.XMLHttpRequest?t.XMLHttpRequest:void 0,s=t?.AbortController,c=t?.CompressionStream,l=n?.userAgent,u=e??{},d=`1.380.0`,f={DEBUG:!1,LIB_VERSION:d,LIB_NAME:`web`,JS_SDK_VERSION:d};function p(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function m(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){p(a,r,i,o,s,`next`,e)}function s(e){p(a,r,i,o,s,`throw`,e)}o(void 0)}))}}function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},h.apply(null,arguments)}function g(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var _,v=function(e){return e.GZipJS=`gzip-js`,e.Base64=`base64`,e}({}),y=[`$snapshot`,`$pageview`,`$pageleave`,`$set`,`survey dismissed`,`survey sent`,`survey shown`,`$identify`,`$groupidentify`,`$create_alias`,`$$client_ingestion_warning`,`$web_experiment_applied`,`$feature_enrollment_update`,`$feature_flag_called`],b=`NativeGzipValidationError`,x=e=>e.length>=2&&e[0]===31&&e[1]===139,S=e=>!(!e||typeof e!=`object`)&&(`name`in e?String(e.name):``)===`NotReadableError`,C=e=>{var t=Error(`Native gzip produced invalid output: `+e);throw t.name=b,t},w=function(){var e=m((function*(e,t){18>e.size&&C(`too-short`);var n=new Uint8Array(yield e.slice(0,10).arrayBuffer());x(n)&&n[2]===8||C(`invalid-header`);var r=new DataView(yield e.slice(e.size-8).arrayBuffer());r.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(_)return _;_=[];for(var e=0;256>e;e++){for(var t=e,n=0;8>n;n++)t=1&t?3988292384^t>>>1:t>>>1;_[e]=t>>>0}return _})(),n=4294967295,r=0;e.length>r;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0})(t)&&C(`invalid-crc`);var i=t.length>>>0;r.getUint32(4,!0)!==i&&C(`invalid-size`)}));return function(t,n){return e.apply(this,arguments)}}();function ee(){return ee=m((function*(e,t,n){t===void 0&&(t=!0);try{var r=new TextEncoder().encode(e),i=new CompressionStream(`gzip`),a=i.writable.getWriter(),o=a.write(r).then((()=>a.close())).catch(function(){var e=m((function*(e){try{yield a.abort(e)}catch{}throw e}));return function(t){return e.apply(this,arguments)}}()),s=new Response(i.readable).blob(),[c]=yield Promise.all([s,o]);return yield w(c,r),c}catch(e){if(n!=null&&n.rethrow)throw e;return t&&console.error(`Failed to gzip compress data`,e),null}})),ee.apply(this,arguments)}var T=`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`.split(`,`),te=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return T.concat(t).some((e=>{var t=e.toLowerCase();return n.indexOf(t)!==-1}))};function E(e,t){return e.indexOf(t)!==-1}var D=function(e){return e.trim()},O=function(e){return e.replace(/^\$/,``)},ne=Object.prototype,re=ne.hasOwnProperty,k=ne.toString,A=Array.isArray||function(e){return k.call(e)===`[object Array]`},j=e=>typeof e==`function`,M=e=>e===Object(e)&&!A(e),N=e=>{if(M(e)){for(var t in e)if(re.call(e,t))return!1;return!0}return!1},P=e=>e===void 0,F=e=>k.call(e)==`[object String]`,ie=e=>F(e)&&e.trim().length===0,I=e=>e===null,L=e=>P(e)||I(e),R=e=>k.call(e)==`[object Number]`&&e==e,z=e=>R(e)&&e>0,B=e=>k.call(e)===`[object Boolean]`,ae=e=>e instanceof FormData,oe=e=>E(y,e);function se(e){return typeof e!=`object`||!e}function ce(e,t){return{}.toString.call(e)===`[object `+t+`]`}function le(e){return typeof Event<`u`&&function(e,t){try{return e instanceof t}catch{return!1}}(e,Event)}var ue=[!0,`true`,1,`1`,`yes`],de=e=>E(ue,e),fe=[!1,`false`,0,`0`,`no`];function pe(e,t,n,r,i){return t>n&&(r.warn(`min cannot be greater than max.`),t=n),R(e)?e>n?(r.warn(` cannot be greater than max: `+n+`. Using max value instead.`),n):t>e?(r.warn(` cannot be less than min: `+t+`. Using min value instead.`),t):e:(r.warn(` must be a number. using max or fallback. max: `+n+`, fallback: `+i),pe(i||n,t,n,r))}var me=class{constructor(e){this.$t={},this.zt=e.zt,this.Zt=pe(e.bucketSize,0,100,e.Gt),this.Qt=pe(e.refillRate,0,this.Zt,e.Gt),this.Jt=pe(e.refillInterval,0,864e5,e.Gt)}Kt(e,t){var n=Math.floor((t-e.lastAccess)/this.Jt);n>0&&(e.tokens=Math.min(e.tokens+n*this.Qt,this.Zt),e.lastAccess+=n*this.Jt)}consumeRateLimit(e){var t,n=Date.now(),r=String(e),i=this.$t[r];return i?this.Kt(i,n):this.$t[r]=i={tokens:this.Zt,lastAccess:n},i.tokens===0||(i.tokens--,i.tokens===0&&((t=this.zt)==null||t.call(this,e)),i.tokens===0)}stop(){this.$t={}}},he,ge,_e,V=`Mobile`,ve=`iOS`,ye=`Android`,be=`Tablet`,xe=ye+` `+be,Se=`iPad`,Ce=`Apple`,we=Ce+` Watch`,Te=`Safari`,Ee=`BlackBerry`,De=`Samsung`,Oe=De+`Browser`,ke=De+` Internet`,Ae=`Chrome`,je=Ae+` OS`,Me=Ae+` `+ve,Ne=`Internet Explorer`,Pe=Ne+` `+V,Fe=`Opera`,Ie=Fe+` Mini`,Le=`Edge`,Re=`Microsoft `+Le,ze=`Firefox`,Be=ze+` `+ve,Ve=`Nintendo`,He=`PlayStation`,Ue=`Xbox`,We=ye+` `+V,Ge=V+` `+Te,Ke=`Windows`,qe=Ke+` Phone`,Je=`Nokia`,Ye=`Ouya`,Xe=`Generic`,Ze=Xe+` `+V.toLowerCase(),Qe=Xe+` `+be.toLowerCase(),$e=`Konqueror`,et=`Oculus Browser`,tt=`Vivaldi`,nt=`Yandex`,rt=`Whale`,it=`DuckDuckGo`,at=`Pale Moon`,ot=`Waterfox`,st=`Brave`,H=`(\\d+(\\.\\d+)?)`,ct=RegExp(`Version/`+H),lt=new RegExp(Ue,`i`),ut=RegExp(He+` \\w+`,`i`),dt=RegExp(Ve+` \\w+`,`i`),ft=RegExp(Ee+`|PlayBook|BB10`,`i`),pt={"NT3.51":`NT 3.11`,"NT4.0":`NT 4.0`,"5.0":`2000`,5.1:`XP`,5.2:`XP`,"6.0":`Vista`,6.1:`7`,6.2:`8`,6.3:`8.1`,6.4:`10`,"10.0":`10`},mt=function(e,t,n){return t||=``,function(e){return e!=null&&e.brave?st:null}(n)||(E(e,` OPR/`)&&E(e,`Mini`)?Ie:E(e,` OPR/`)?Fe:ft.test(e)?Ee:E(e,`IE`+V)||E(e,`WPDesktop`)?Pe:E(e,`OculusBrowser`)?et:E(e,Oe)?ke:E(e,Le)||E(e,`Edg/`)?Re:E(e,tt+`/`)?tt:E(e,`YaBrowser/`)?nt:E(e,rt+`/`)?rt:E(e,it+`/`)||E(e,`Ddg/`)?it:E(e,`FBIOS`)?`Facebook `+V:E(e,`UCWEB`)||E(e,`UCBrowser`)?`UC Browser`:E(e,`CriOS`)?Me:E(e,`CrMo`)||E(e,Ae)?Ae:E(e,ye)&&E(e,Te)?We:E(e,`FxiOS`)?Be:E(e.toLowerCase(),$e.toLowerCase())?$e:E(e,st+`/`)?st:((e,t)=>t&&E(t,Ce)||function(e){return E(e,Te)&&!E(e,Ae)&&!E(e,ye)}(e))(e,t)?E(e,V)?Ge:Te:E(e,`PaleMoon/`)?at:E(e,ot+`/`)?ot:E(e,ze)?ze:E(e,`MSIE`)||E(e,`Trident/`)?Ne:E(e,`Gecko`)?ze:``)},ht={[Pe]:[RegExp(`rv:`+H)],[Re]:[RegExp(Le+`?\\/`+H)],[Ae]:[RegExp(`(`+Ae+`|CrMo)\\/`+H)],[Me]:[RegExp(`CriOS\\/`+H)],"UC Browser":[RegExp(`(UCBrowser|UCWEB)\\/`+H)],[Te]:[ct],[Ge]:[ct],[Fe]:[RegExp(`(Opera|OPR)\\/`+H)],[ze]:[RegExp(ze+`\\/`+H)],[Be]:[RegExp(`FxiOS\\/`+H)],[$e]:[RegExp(`Konqueror[:/]?`+H,`i`)],[Ee]:[RegExp(Ee+` `+H),ct],[We]:[RegExp(`android\\s`+H,`i`)],[ke]:[RegExp(Oe+`\\/`+H)],[et]:[RegExp(`OculusBrowser\\/`+H)],[tt]:[RegExp(tt+`\\/`+H)],[nt]:[RegExp(`YaBrowser\\/`+H)],[rt]:[RegExp(rt+`\\/`+H)],[st]:[RegExp(st+`\\/`+H)],[it]:[RegExp(`(DuckDuckGo|Ddg)\\/`+H)],[at]:[RegExp(`PaleMoon\\/`+H)],[ot]:[RegExp(ot+`\\/`+H)],[Ne]:[RegExp(`(rv:|MSIE )`+H)],Mozilla:[RegExp(`rv:`+H)]},gt=function(e,t,n){var r=ht[mt(e,t,n)];if(P(r))return null;for(var i=0;r.length>i;i++){var a=e.match(r[i]);if(a)return parseFloat(a[a.length-2])}return null},_t=[[RegExp(Ue+`; `+Ue+` (.*?)[);]`,`i`),e=>[Ue,e&&e[1]||``]],[new RegExp(Ve,`i`),[Ve,``]],[new RegExp(He,`i`),[He,``]],[ft,[Ee,``]],[new RegExp(Ke,`i`),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[qe,``];if(new RegExp(V).test(t)&&!/IEMobile\b/.test(t))return[Ke+` `+V,``];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=pt[n[1]]||``;return/arm/i.test(t)&&(r=`RT`),[Ke,r]}return[Ke,``]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[ve,[e[3],e[4],e[5]||`0`].join(`.`)]:[ve,``]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t=``;return e&&e.length>=3&&(t=P(e[2])?e[3]:e[2]),[`watchOS`,t]}],[RegExp(`(`+ye+` (\\d+)\\.(\\d+)\\.?(\\d+)?|`+ye+`)`,`i`),e=>e&&e[2]?[ye,[e[2],e[3],e[4]||`0`].join(`.`)]:[ye,``]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=[`Mac OS X`,``];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||`0`].join(`.`)),t}],[/Mac/i,[`Mac OS X`,``]],[/CrOS/,[je,``]],[/Linux|debian/i,[`Linux`,``]]],vt=function(e){return dt.test(e)?Ve:ut.test(e)?He:lt.test(e)?Ue:new RegExp(Ye,`i`).test(e)?Ye:RegExp(`(`+qe+`|WPDesktop)`,`i`).test(e)?qe:/iPad/.test(e)?Se:/iPod/.test(e)?`iPod Touch`:/iPhone/.test(e)?`iPhone`:/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?we:ft.test(e)?Ee:/(kobo)\s(ereader|touch)/i.test(e)?`Kobo`:new RegExp(Je,`i`).test(e)?Je:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?`Kindle Fire`:/(Android|ZTE)/i.test(e)?new RegExp(V).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?ye:xe:RegExp(`(pda|`+V+`)`,`i`).test(e)?Ze:new RegExp(be,`i`).test(e)&&!RegExp(be+` pc`,`i`).test(e)?Qe:``},yt=e=>e instanceof Error,bt={trace:{text:`TRACE`,number:1},debug:{text:`DEBUG`,number:5},info:{text:`INFO`,number:9},warn:{text:`WARN`,number:13},error:{text:`ERROR`,number:17},fatal:{text:`FATAL`,number:21}},xt=bt.info;function St(e){if(B(e))return{boolValue:e};if(typeof e==`number`)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e==`string`)return{stringValue:e};if(A(e))return{arrayValue:{values:e.map((e=>St(e)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function Ct(e){var t=[];for(var n in e){var r=e[n];I(r)||P(r)||t.push({key:n,value:St(r)})}return t}function wt(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return _e&&n.length===ge||(ge=n.length,_e=n.reduce(((n,r)=>{he||={};var i=he[r];if(i)n[i[0]]=i[1];else for(var a=e(r),o=a.length-1;o>=0;o--){var s=a[o]?.filename,c=t[r];if(s&&c){n[s]=c,he[r]=[s,c];break}}return n}),{})),_e}}var Tt=class{constructor(e,t,n){n===void 0&&(n=[]),this.coercers=e,this.stackParser=t,this.modifiers=n}buildFromUnknown(e,t){t===void 0&&(t={});var n=t&&t.mechanism||{handled:!0,type:`generic`},r=this.buildCoercingContext(n,t,0).apply(e),i=this.buildParsingContext(t),a=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(a,n),$exception_level:`error`}}modifyFrames(e){var t=this;return m((function*(){for(var n of e)n.stacktrace&&n.stacktrace.frames&&A(n.stacktrace.frames)&&(n.stacktrace.frames=yield t.applyModifiers(n.stacktrace.frames));return e}))()}coerceFallback(e){return{type:`Error`,value:`Unknown error`,stack:e.syntheticException?.stack,synthetic:!0}}parseStacktrace(e,t){var n,r;return e.cause!=null&&(n=this.parseStacktrace(e.cause,t)),e.stack!=``&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),h({},e,{cause:n,stack:r})}applyChunkIds(e,t){return e.map((e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e)))}applyCoercers(e,t){for(var n of this.coercers)if(n.match(e))return n.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return m((function*(){var n=e;for(var r of t.modifiers)n=yield r(n);return n}))()}convertToExceptionList(e,t){var n,r,i={type:e.type,value:e.value,mechanism:{type:t.type??`generic`,handled:(n=t.handled)==null||n,synthetic:(r=e.synthetic)!=null&&r}};e.stack&&(i.stacktrace={type:`raw`,frames:e.stack});var a=[i];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,h({},t,{handled:!0}))),a}buildParsingContext(e){return{chunkIdMap:wt(this.stackParser),skipFirstLines:e.skipFirstLines??1}}buildCoercingContext(e,t,n){n===void 0&&(n=0);var r=(n,r)=>{if(4>=r){var i=this.buildCoercingContext(e,t,r);return this.applyCoercers(n,i)}};return h({},t,{syntheticException:n==0?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,n),next:e=>r(e,n+1)})}},Et=`?`;function Dt(e,t,n,r,i){var a={platform:e,filename:t,function:n===`<anonymous>`?Et:n,in_app:!0};return P(r)||(a.lineno=r),P(i)||(a.colno=i),a}var Ot=(e,t)=>{var n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?Et:e.split(`@`)[0],n?`safari-extension:`+t:`safari-web-extension:`+t]:[e,t]},kt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,At=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,jt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Mt=(e,t)=>{var n=kt.exec(e);if(n){var[,r,i,a]=n;return Dt(t,r,Et,+i,+a)}var o=At.exec(e);if(o){if(o[2]&&o[2].indexOf(`eval`)===0){var s=jt.exec(o[2]);s&&(o[2]=s[1],o[3]=s[2],o[4]=s[3])}var[c,l]=Ot(o[1]||Et,o[2]);return Dt(t,l,c,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Nt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Pt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ft=(e,t)=>{var n=Nt.exec(e);if(n){if(n[3]&&n[3].indexOf(` > eval`)>-1){var r=Pt.exec(n[3]);r&&(n[1]=n[1]||`eval`,n[3]=r[1],n[4]=r[2],n[5]=``)}var i=n[3],a=n[1]||Et;return[a,i]=Ot(a,i),Dt(t,i,a,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},It=/\(error: (.*)\)/,Lt=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var n=F(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:n?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){var t=e.name||(this.isDOMError(e)?`DOMError`:`DOMException`);return e.message?t+`: `+e.message:t}isDOMException(e){return ce(e,`DOMException`)}isDOMError(e){return ce(e,`DOMError`)}},Rt=class{match(e){return(e=>e instanceof Error)(e)}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){var n=e.message;return String(n.error&&typeof n.error.message==`string`?n.error.message:n)}getStack(e){return e.stacktrace||e.stack||void 0}},zt=class{constructor(){}match(e){return ce(e,`ErrorEvent`)&&e.error!=null}coerce(e,t){return t.apply(e.error)||{type:`ErrorEvent`,value:e.message,stack:t.syntheticException?.stack,synthetic:!0}}},Bt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Vt=class{match(e){return typeof e==`string`}coerce(e,t){var[n,r]=this.getInfos(e);return{type:n??`Error`,value:r??e,stack:t.syntheticException?.stack,synthetic:!0}}getInfos(e){var t=`Error`,n=e,r=e.match(Bt);return r&&(t=r[1],n=r[2]),[t,n]}},Ht=[`fatal`,`error`,`warning`,`log`,`info`,`debug`];function Ut(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return`[object has no keys]`;for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(`, `);if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+`...`:i}return``}var Wt=class{match(e){return typeof e==`object`&&!!e}coerce(e,t){var n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{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 le(e)?e.constructor.name:`Error`}getValue(e){if(`name`in e&&typeof e.name==`string`){var t=`'`+e.name+`' captured as exception`;return`message`in e&&typeof e.message==`string`&&(t+=` with message: '`+e.message+`'`),t}if(`message`in e&&typeof e.message==`string`)return e.message;var n=this.getObjectClassName(e);return(n&&n!==`Object`?`'`+n+`'`:`Object`)+` captured as exception with keys: `+Ut(e)}isSeverityLevel(e){return F(e)&&!ie(e)&&Ht.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var n=e[t];if(yt(n))return n}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},Gt=class{match(e){return le(e)}coerce(e,t){var n=e.constructor.name;return{type:n,value:n+` captured as exception with keys: `+Ut(e),stack:t.syntheticException?.stack,synthetic:!0}}},Kt=class{match(e){return se(e)}coerce(e,t){return{type:`Error`,value:`Primitive value captured as exception: `+String(e),stack:t.syntheticException?.stack,synthetic:!0}}},qt=class{match(e){return ce(e,`PromiseRejectionEvent`)||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!le(e))return!1;try{var t=e.detail;return typeof t==`object`&&!!t&&`reason`in t}catch{return!1}}coerce(e,t){var n=this.getUnhandledRejectionReason(e);return se(n)?{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: `+String(n),stack:t.syntheticException?.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if(`reason`in e)return e.reason;if(`detail`in e&&e.detail!=null&&typeof e.detail==`object`&&`reason`in e.detail)return e.detail.reason}catch{}return e}},Jt=`$message`,Yt=`$timestamp`,Xt=new Set([Jt,Yt]),Zt={enabled:!0,max_bytes:32768};function Qt(e){return e?{enabled:e.enabled??Zt.enabled,max_bytes:en(e.max_bytes,Zt.max_bytes)}:h({},Zt)}var $t=class{constructor(e){this.Yt=[],this.Xt=0,this.qt=Qt(e)}setConfig(e){this.qt=Qt(e),this.er()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,((e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n!=`function`&&typeof n!=`symbol`){if(n instanceof Date)return n.toISOString();if(n instanceof Error)return{name:n.name,message:n.message,stack:n.stack};if(n&&typeof n==`object`){if(t.has(n))return`[Circular]`;t.add(n)}return n}}))}catch{return}}(e);if(t)try{var n=JSON.parse(t);if(!M(n))return;var r=n,i=r[Jt],a=r[Yt];return!F(i)||i.trim().length===0||!F(a)&&!R(a)?void 0:{step:r,json:t}}catch{return}}(e);if(t){var n=function(e){if(typeof TextEncoder<`u`)return new TextEncoder().encode(e).length;for(var t=encodeURIComponent(e),n=0,r=0;t.length>r;r++)t[r]===`%`?(n+=1,r+=2):n+=1;return n}(t.json);n>this.qt.max_bytes||(this.Yt.push({step:t.step,bytes:n}),this.Xt+=n,this.er())}}getAttachable(){return this.Yt.map((e=>e.step))}clear(){this.Yt=[],this.Xt=0}size(){return this.Yt.length}er(){for(;this.Xt>this.qt.max_bytes&&this.Yt.length>0;){var e=this.Yt.shift();e&&(this.Xt-=e.bytes)}}};function en(e,t){if(!R(e)||e===1/0||e===-1/0)return t;var n=Math.floor(e);return 0>n?t:n}var tn=function(t,n){var{debugEnabled:r}=n===void 0?{}:n,i={k(n){if(e&&(f.DEBUG||u.POSTHOG_DEBUG||r)&&!P(e.console)&&e.console){for(var i=(`__rrweb_original__`in e.console[n])?e.console[n].__rrweb_original__:e.console[n],a=arguments.length,o=Array(a>1?a-1:0),s=1;a>s;s++)o[s-1]=arguments[s];i(t,...o)}},debug(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k(`debug`,...t)},info(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k(`log`,...t)},warn(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k(`warn`,...t)},error(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];i.k(`error`,...t)},critical(){for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];console.error(t,...n)},uninitializedWarning(e){i.error(`You must initialize PostHog before calling `+e)},createLogger:(e,n)=>tn(t+` `+e,n)};return i},U=tn(`[PostHog.js]`),W=U.createLogger,nn=W(`[ExternalScriptsLoader]`),rn=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return nn.warn(t+` was requested but loading of external scripts is disabled.`),n(`Loading of external scripts is disabled`);var i=r?.querySelectorAll(`script`);if(i){for(var a,o=function(){if(i[s].src===t){var e=i[s];return e.__posthog_loading_callback_fired?{v:n()}:(e.addEventListener(`load`,(t=>{e.__posthog_loading_callback_fired=!0,n(void 0,t)})),e.onerror=e=>n(e),{v:void 0})}},s=0;i.length>s;s++)if(a=o())return a.v}var c=()=>{if(!r)return n(`document not found`);var i=r.createElement(`script`);if(i.type=`text/javascript`,i.crossOrigin=`anonymous`,i.src=t,i.onload=e=>{i.__posthog_loading_callback_fired=!0,n(void 0,e)},i.onerror=e=>n(e),e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return n(`prepare_external_dependency_script returned null`);if(e.config.external_scripts_inject_target===`head`)r.head.appendChild(i);else{var a,o=r.querySelectorAll(`body > script`);o.length>0?(a=o[0].parentNode)==null||a.insertBefore(i,o[0]):r.body.appendChild(i)}};r!=null&&r.body?c():r?.addEventListener(`DOMContentLoaded`,c)};u.__PosthogExtensions__=u.__PosthogExtensions__||{},u.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!==`remote-config`){var r;if(e.config.__preview_external_dependency_versioned_paths)r=e.requestRouter.endpointFor(`assets`,`/static/`+e.version+`/`+t+`.js`);else{var i=`/static/`+t+`.js?v=`+e.version;if(t===`toolbar`){var a=3e5;i=i+`&t=`+Math.floor(Date.now()/a)*a}r=e.requestRouter.endpointFor(`assets`,i)}rn(e,r,n)}else rn(e,e.requestRouter.endpointFor(`assets`,`/array/`+e.config.token+`/config.js`),n)},u.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{rn(e,e.requestRouter.endpointFor(`api`,t),n)};var an=`$people_distinct_id`,on=`$device_id`,sn=`__alias`,cn=`__timers`,ln=`$autocapture_disabled_server_side`,un=`$heatmaps_enabled_server_side`,dn=`$exception_capture_enabled_server_side`,fn=`$error_tracking_suppression_rules`,pn=`$error_tracking_capture_extension_exceptions`,mn=`$web_vitals_enabled_server_side`,hn=`$dead_clicks_enabled_server_side`,gn=`$product_tours_enabled_server_side`,_n=`$web_vitals_allowed_metrics`,vn=`$session_recording_remote_config`,yn=`$replay_override_sampling`,bn=`$replay_override_linked_flag`,xn=`$replay_override_url_trigger`,Sn=`$replay_override_event_trigger`,Cn=`$sesid`,wn=`$session_is_sampled`,Tn=`$enabled_feature_flags`,En=`$active_feature_flags`,Dn=`$early_access_features`,On=`$feature_flag_details`,kn=`$feature_flag_payloads`,An=`$feature_flag_request_id`,jn=`$override_feature_flags`,Mn=`$override_feature_flag_payloads`,Nn=`$stored_person_properties`,Pn=`$stored_group_properties`,Fn=`$surveys`,In=`$surveys_activated`,Ln=`ph_product_tours`,Rn=`$flag_call_reported`,zn=`$flag_call_reported_session_id`,Bn=`$feature_flag_errors`,Vn=`$feature_flag_evaluated_at`,Hn=`$user_state`,Un=`$client_session_props`,Wn=`$capture_rate_limit`,Gn=`$initial_campaign_params`,Kn=`$initial_referrer_info`,qn=`$initial_person_info`,Jn=`$epp`,Yn=`__POSTHOG_TOOLBAR__`,Xn=`$posthog_cookieless`,Zn=`$sdk_debug_extensions_init_method`,Qn=`$sdk_debug_extensions_init_time_ms`,$n=`$sdk_debug_recording_script_not_loaded`,er=`PostHog loadExternalDependency extension not found.`,tr=`on_reject`,nr=`always`,rr=`anonymous`,ir=`identified`,ar=`identified_only`,or=`visibilitychange`,sr=`beforeunload`,cr=`$pageview`,lr=`$pageleave`,ur=`$identify`,dr=`$groupidentify`;function fr(e,t){A(e)&&e.forEach(t)}function G(e,t){if(!L(e))if(A(e))e.forEach(t);else if(ae(e))e.forEach(((e,n)=>t(e,n)));else for(var n in e)re.call(e,n)&&t(e[n],n)}var K=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i of n)for(var a in i)i[a]!==void 0&&(e[a]=i[a]);return e};function pr(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var mr=function(e){try{return e()}catch{return}},hr=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){U.critical(`Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A.`),U.critical(e)}}},gr=function(e){var t={};return G(e,(function(e,n){(F(e)&&e.length>0||R(e))&&(t[n]=e)})),t},_r=[`herokuapp.com`,`vercel.app`,`netlify.app`];function vr(e){var t=e?.hostname;if(!F(t))return!1;var n=t.split(`.`).slice(-2).join(`.`);for(var r of _r)if(n===r)return!1;return!0}function q(e,t,n,r){var{capture:i=!1,passive:a=!0}=r??{};e?.addEventListener(t,n,{capture:i,passive:a})}function yr(e){return e.name===`ph_toolbar_internal`}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return R(e)&&isFinite(e)&&Math.floor(e)===e});var br=class e{constructor(e){if(this.bytes=e,e.length!==16)throw TypeError(`not 128-bit length`)}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw RangeError(`invalid field value`);var a=new Uint8Array(16);return a[0]=t/2**40,a[1]=t/2**32,a[2]=t/2**24,a[3]=t/2**16,a[4]=t/2**8,a[5]=t,a[6]=112|n>>>8,a[7]=n,a[8]=128|r>>>24,a[9]=r>>>16,a[10]=r>>>8,a[11]=r,a[12]=i>>>24,a[13]=i>>>16,a[14]=i>>>8,a[15]=i,new e(a)}toString(){for(var e=``,t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),t!==3&&t!==5&&t!==7&&t!==9||(e+=`-`);if(e.length!==36)throw Error(`Invalid UUIDv7 was generated`);return e}clone(){return new e(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;16>t;t++){var n=this.bytes[t]-e.bytes[t];if(n!==0)return Math.sign(n)}return 0}},xr=class{constructor(){this.S=0,this.C=0,this.I=new wr}generate(){var e=this.generateOrAbort();if(P(e)){this.S=0;var t=this.generateOrAbort();if(P(t))throw Error(`Could not generate UUID after timestamp reset`);return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.T();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.T())}return br.fromFieldsV7(this.S,Math.trunc(this.C/2**30),this.C&2**30-1,this.I.nextUint32())}T(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}},Sr,Cr=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<`u`&&UUIDV7_DENY_WEAK_RNG)throw Error(`no cryptographically strong RNG available`);for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};e&&!P(e.crypto)&&crypto.getRandomValues&&(Cr=e=>crypto.getRandomValues(e));var wr=class{constructor(){this.M=new Uint32Array(8),this.R=1/0}nextUint32(){return this.M.length>this.R||(Cr(this.M),this.R=0),this.M[this.R++]}},Tr=()=>Er().toString(),Er=()=>(Sr||=new xr).generate(),Dr=``,Or=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,kr={O:()=>!!r,D(e){U.error(`cookieStore error: `+e)},A(e){if(r){try{for(var t=e+`=`,n=r.cookie.split(`;`).filter((e=>e.length)),i=0;n.length>i;i++){for(var a=n[i];a.charAt(0)==` `;)a=a.substring(1,a.length);if(a.indexOf(t)===0)return decodeURIComponent(a.substring(t.length,a.length))}}catch{}return null}},F(e){var t;try{t=JSON.parse(kr.A(e))||{}}catch{}return t},N(e,t,n,i,a){if(r)try{var o=``,s=``,c=function(e,t){if(t){var n=function(e,t){if(t===void 0&&(t=r),Dr)return Dr;if(!t||[`localhost`,`127.0.0.1`].includes(e))return``;for(var n=e.split(`.`),i=Math.min(n.length,8),a=`dmn_chk_`+Tr();!Dr&&i--;){var o=n.slice(i).join(`.`),s=a+`=1;domain=.`+o+`;path=/`;t.cookie=s+`;max-age=3`,t.cookie.includes(a)&&(t.cookie=s+`;max-age=0`,Dr=o)}return Dr}(e);if(!n){var i=(e=>{var t=e.match(Or);return t?t[0]:``})(e);i!==n&&U.info(`Warning: cookie subdomain discovery mismatch`,i,n),n=i}return n?`; domain=.`+n:``}return``}(r.location.hostname,i);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),o=`; expires=`+l.toUTCString()}a&&(s=`; secure`);var u=e+`=`+encodeURIComponent(JSON.stringify(t))+o+`; SameSite=Lax; path=/`+c+s;return u.length>3686.4&&U.warn(`cookieStore warning: large cookie, len=`+u.length),r.cookie=u,u}catch{return}},q(e,t){if(r!=null&&r.cookie)try{kr.N(e,``,-1,t)}catch{return}}},Ar=null,J={O(){if(!I(Ar))return Ar;var t=!0;if(P(e))t=!1;else try{var n=`__mplssupport__`;J.N(n,`xyz`),J.A(n)!==`"xyz"`&&(t=!1),J.q(n)}catch{t=!1}return t||U.error(`localStorage unsupported; falling back to cookie store`),Ar=t,t},D(e){U.error(`localStorage error: `+e)},A(t){try{return e?.localStorage.getItem(t)}catch(e){J.D(e)}return null},F(e){try{return JSON.parse(J.A(e))||{}}catch{}return null},N(t,n){try{e?.localStorage.setItem(t,JSON.stringify(n))}catch(e){J.D(e)}},q(t){try{e?.localStorage.removeItem(t)}catch(e){J.D(e)}}},jr=[on,`distinct_id`,Cn,wn,Jn,qn,Hn],Mr={},Nr={O:()=>!0,D(e){U.error(`memoryStorage error: `+e)},A:e=>Mr[e]||null,F:e=>Mr[e]||null,N(e,t){Mr[e]=t},q(e){delete Mr[e]}},Pr=null,Y={O(){if(!I(Pr))return Pr;if(Pr=!0,P(e))Pr=!1;else try{var t=`__support__`;Y.N(t,`xyz`),Y.A(t)!==`"xyz"`&&(Pr=!1),Y.q(t)}catch{Pr=!1}return Pr},D(e){U.error(`sessionStorage error: `,e)},A(t){try{return e?.sessionStorage.getItem(t)}catch(e){Y.D(e)}return null},F(e){try{return JSON.parse(Y.A(e))||null}catch{}return null},N(t,n){try{e?.sessionStorage.setItem(t,JSON.stringify(n))}catch(e){Y.D(e)}},q(t){try{e?.sessionStorage.removeItem(t)}catch(e){Y.D(e)}}},Fr=class{constructor(e){this._instance=e}get qt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.qt.cookieless_mode===nr||this.isRejected()||this.consent===-1&&this.qt.cookieless_mode===tr}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.qt.opt_out_capturing_by_default}optInOut(e){this.nr.N(this.sr,+!!e,this.qt.cookie_expiration,this.qt.cross_subdomain_cookie,this.qt.secure_cookie)}reset(){this.nr.q(this.sr,this.qt.cross_subdomain_cookie)}get sr(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:n}=this._instance.config;return n||(t?t+e:`__ph_opt_in_out_`+e)}get ir(){var e=this.nr.A(this.sr);return de(e)?1:E(fe,e)?0:-1}get nr(){var e=this.qt.opt_out_capturing_persistence_type,t=e===`localStorage`?J:kr;if(!this.ar||this.ar!==t){this.ar=t;var n=e===`localStorage`?kr:J;n.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(de(n.A(this.sr))),n.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[n?.doNotTrack,n?.msDoNotTrack,u.doNotTrack].some((e=>de(e)))}},Ir=W(`[Dead Clicks]`),Lr=()=>!0,Rr=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(hn)),r=e.instance.config.capture_dead_clicks;return B(r)?r:!!M(r)||n},zr=class{get lazyLoadedDeadClicksAutocapture(){return this.ur}constructor(e,t,n){this.instance=e,this.isEnabled=t,this.onCapture=n,this.startIfEnabledOrStop()}onRemoteConfig(e){`captureDeadClicks`in e&&(this.instance.persistence&&this.instance.persistence.register({[hn]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.lr((()=>{this.hr()})):this.stop()}lr(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,`dead-clicks-autocapture`,(t=>{t?Ir.error(`failed to load script`,t):e()}))}hr(){var e;if(r){if(!this.ur&&(e=u.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=M(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.ur=u.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.ur.start(r),Ir.info(`starting...`)}}else Ir.error("`document` not found. Cannot start.")}stop(){this.ur&&(this.ur.stop(),this.ur=void 0,Ir.info(`stopping...`))}},Br=W(`[SegmentIntegration]`),Vr=`posthog-js`;function Hr(e,t){var{organization:n,projectId:r,prefix:i,severityAllowList:a=[`error`],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return t=>{if(a!==`*`&&!a.includes(t.level)||!e.__loaded)return t;t.tags||={};var s=e.requestRouter.endpointFor(`ui`,`/project/`+e.config.token+`/person/`+e.get_distinct_id());t.tags[`PostHog Person URL`]=s,e.sessionRecordingStarted()&&(t.tags[`PostHog Recording URL`]=e.get_session_replay_url({withTimestamp:!0}));var c,l=t.exception?.values||[],u=l.map((e=>h({},e,{stacktrace:e.stacktrace?h({},e.stacktrace,{type:`raw`,frames:(e.stacktrace.frames||[]).map((e=>h({},e,{platform:`web:javascript`})))}):void 0}))),d={$exception_message:l[0]?.value||t.message,$exception_type:l[0]?.type,$exception_level:t.level,$exception_list:u,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:l[0]?.value||t.message,$sentry_exception_type:l[0]?.type,$sentry_tags:t.tags};return n&&r&&(d.$sentry_url=(i||`https://sentry.io/organizations/`)+n+`/issues/?project=`+r+`&query=`+t.event_id),o&&((c=e.exceptions)==null||c.sendExceptionEvent(d)),t}}var Ur=class{constructor(e,t,n,r,i,a){this.name=Vr,this.setupOnce=function(o){o(Hr(e,{organization:t,projectId:n,prefix:r,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}},Wr=class{constructor(e){this.cr=(e,t,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength)&&(U.info(`[PageViewManager] Session rotated, clearing pageview state`,{sessionId:e,changeReason:n}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.vr()}vr(){this.pr=this._instance.sessionManager?.onSessionId(this.cr)}destroy(){var e;(e=this.pr)==null||e.call(this),this.pr=void 0}doPageView(t,n){var r=this.gr(t,n);return this.dr={pathname:e?.location.pathname??``,pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(e){return this.gr(e,this.dr?.pageViewId)}doEvent(){return{$pageview_id:this.dr?.pageViewId}}gr(e,t){var n=this.dr;if(!n)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:n.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:s,maxContentHeight:c,lastContentY:l,maxContentY:u}=i;if(!(P(a)||P(o)||P(s)||P(c)||P(l)||P(u))){a=Math.ceil(a),o=Math.ceil(o),s=Math.ceil(s),c=Math.ceil(c),l=Math.ceil(l),u=Math.ceil(u);var d=a>1?pe(o/a,0,1,U):1,f=a>1?pe(s/a,0,1,U):1,p=c>1?pe(l/c,0,1,U):1,m=c>1?pe(u/c,0,1,U):1;r=K(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:m})}}return n.pathname&&(r.$prev_pageview_pathname=n.pathname),n.timestamp&&(r.$prev_pageview_duration=(e.getTime()-n.timestamp.getTime())/1e3),r}},Gr={[an]:{exposure:`hidden`},[sn]:{exposure:`hidden`},__cmpns:{exposure:`hidden`},[cn]:{exposure:`hidden`},[ln]:{exposure:`event`},[un]:{exposure:`hidden`},[dn]:{exposure:`event`},[fn]:{exposure:`hidden`},[pn]:{exposure:`event`},[mn]:{exposure:`event`},[hn]:{exposure:`event`},[gn]:{exposure:`hidden`},[_n]:{exposure:`event`},[vn]:{exposure:`hidden`},$session_recording_enabled_server_side:{exposure:`hidden`},[Cn]:{exposure:`hidden`},[wn]:{exposure:`event`},$session_past_minimum_duration:{exposure:`event`},$session_recording_url_trigger_activated_session:{exposure:`event`},$session_recording_event_trigger_activated_session:{exposure:`event`},$debug_first_full_snapshot_timestamp:{exposure:`event`},[Tn]:{exposure:`derived`,shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!M(e))return{};for(var t={},n=Object.keys(e),r=0;n.length>r;r++)t[`$feature/`+n[r]]=e[n[r]];return t}},[En]:{exposure:`event`},[Dn]:{exposure:`hidden`},[On]:{exposure:`hidden`},[kn]:{exposure:`event`},[An]:{exposure:`event`},[jn]:{exposure:`event`},[Mn]:{exposure:`hidden`},[Nn]:{exposure:`hidden`},[Pn]:{exposure:`hidden`},[Fn]:{exposure:`hidden`},[In]:{exposure:`event`},[Ln]:{exposure:`hidden`},$product_tours_activated:{exposure:`hidden`},$conversations_widget_session_id:{exposure:`event`},$conversations_ticket_id:{exposure:`event`},$conversations_widget_state:{exposure:`event`},$conversations_user_traits:{exposure:`event`},[Rn]:{exposure:`hidden`},[zn]:{exposure:`hidden`},[Bn]:{exposure:`hidden`},[Vn]:{exposure:`hidden`},[Hn]:{exposure:`hidden`},[Un]:{exposure:`hidden`},[Wn]:{exposure:`hidden`},[Gn]:{exposure:`hidden`},[Kn]:{exposure:`hidden`},[qn]:{exposure:`hidden`},[Jn]:{exposure:`hidden`},[yn]:{exposure:`event`},[bn]:{exposure:`event`},[xn]:{exposure:`event`},[Sn]:{exposure:`event`},[Zn]:{exposure:`event`},[Qn]:{exposure:`event`},[$n]:{exposure:`event`},$sdk_debug_replay_event_trigger_status:{exposure:`event`},$sdk_debug_replay_linked_flag_trigger_status:{exposure:`event`},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:`event`},$sdk_debug_replay_remote_trigger_matching_config:{exposure:`event`},$sdk_debug_replay_trigger_groups_count:{exposure:`event`},$sdk_debug_replay_url_trigger_status:{exposure:`event`},$session_recording_start_reason:{exposure:`event`}},Kr=[[`$posthog_sr_group_event_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_url_trigger_`,{exposure:`hidden`}],[`$posthog_sr_group_sampling_`,{exposure:`hidden`}]],qr=e=>{var t=r?.createElement(`a`);return P(t)?null:(t.href=e,t)},Jr=function(e,t){for(var n,r=((e.split(`#`)[0]||``).split(/\?(.*)/)[1]||``).replace(/^\?+/g,``).split(`&`),i=0;r.length>i;i++){var a=r[i].split(`=`);if(a[0]===t){n=a;break}}if(!A(n)||2>n.length)return``;var o=n[1];try{o=decodeURIComponent(o)}catch{U.error(`Skipping decoding for malformed query param: `+o)}return o.replace(/\+/g,` `)},Yr=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split(`#`),i=r[1],a=(r[0]||``).split(`?`),o=a[1],s=a[0],c=(o||``).split(`&`),l=[],u=0;c.length>u;u++){var d=c[u].split(`=`);A(d)&&(t.includes(d[0])?l.push(d[0]+`=`+n):l.push(c[u]))}var f=s;return o!=null&&(f+=`?`+l.join(`&`)),i!=null&&(f+=`#`+i),f},Xr=function(e,t){var n=e.match(RegExp(t+`=([^&]*)`));return n?n[1]:null},Zr=`https?://(.*)`,Qr=[`gclid`,`gclsrc`,`dclid`,`gbraid`,`wbraid`,`fbclid`,`msclkid`,`twclid`,`li_fat_id`,`igshid`,`ttclid`,`rdt_cid`,`epik`,`qclid`,`sccid`,`irclid`,`_kx`],$r=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_content`,`utm_term`,`gad_source`,`mc_cid`,...Qr],ei=`<masked>`,ti=[`li_fat_id`];function ni(e,t,n){if(!r)return{};var i,a=t?[...Qr,...n||[]]:[],o=ri(Yr(r.URL,a,ei),e);return K((i={},G(ti,(function(e){var t=kr.A(e);i[e]=t||null})),i),o)}function ri(e,t){var n=$r.concat(t||[]),r={};return G(n,(function(t){r[t]=Jr(e,t)||null})),r}function ii(e){var t=function(e){return e?e.search(Zr+`google.([^/?]*)`)===0?`google`:e.search(Zr+`bing.com`)===0?`bing`:e.search(Zr+`yahoo.com`)===0?`yahoo`:e.search(Zr+`duckduckgo.com`)===0?`duckduckgo`:null:null}(e),n=t==`yahoo`?`p`:`q`,i={};if(!I(t)){i.$search_engine=t;var a=r?Jr(r.referrer,n):``;a.length&&(i.ph_keyword=a)}return i}function ai(){return navigator.language||navigator.userLanguage}var oi=`$direct`;function si(){return r?.referrer||oi}function ci(e,t){var n=e?[...Qr,...t||[]]:[],r=i?.href.substring(0,1e3);return{r:si().substring(0,1e3),u:r?Yr(r,n,ei):void 0}}function li(e){var{r:t,u:n}=e,r={$referrer:t,$referring_domain:t==null?void 0:t==oi?oi:qr(t)?.host};if(n){r.$current_url=n;var i=qr(n);r.$host=i?.host,r.$pathname=i?.pathname,K(r,ri(n))}return t&&K(r,ii(t)),r}function ui(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function di(){try{return new Date().getTimezoneOffset()}catch{return}}var fi=[`cookie`,`localstorage`,`localstorage+cookie`,`sessionstorage`,`memory`],pi=class{constructor(t,n){if(this.qt=t,this.props={},this.mr=!1,this.yr=(e=>{var t=``;return e.token&&(t=e.token.replace(/\+/g,`PL`).replace(/\//g,`SL`).replace(/=/g,`EQ`)),e.persistence_name?`ph_`+e.persistence_name:`ph_`+t+`_posthog`})(t),this.nr=this.br(t),this.load(),t.debug&&U.info(`Persistence loaded`,t.persistence,h({},this.props)),this.update_config(t,t,n),this.save(),e){var r=()=>this.flush();q(e,`beforeunload`,r,{capture:!1}),q(e,`pagehide`,r,{capture:!1})}}_r(){var e=this.qt?.persistence_save_debounce_ms;return R(e)&&e>0?e:0}isDisabled(){return!!this.wr}br(t){fi.indexOf(t.persistence.toLowerCase())===-1&&(U.critical(`Unknown persistence type `+t.persistence+`; falling back to localStorage+cookie`),t.persistence=`localStorage+cookie`);var n=function(t){t===void 0&&(t=[]);var n=[...jr,...t];return h({},J,{F(e){try{var t={};try{t=kr.F(e)||{}}catch{}var n=K(t,JSON.parse(J.A(e)||`{}`));return J.N(e,n),n}catch{}return null},N(e,t,r,i,a,o){try{J.N(e,t,void 0,void 0,o);var s={};n.forEach((e=>{t[e]&&(s[e]=t[e])})),Object.keys(s).length&&kr.N(e,s,r,i,a,o)}catch(e){J.D(e)}},q(t,n){try{e?.localStorage.removeItem(t),kr.q(t,n)}catch(e){J.D(e)}}})}(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r===`localstorage`&&J.O()?J:r===`localstorage+cookie`&&n.O()?n:r===`sessionstorage`&&Y.O()?Y:r===`memory`?Nr:r===`cookie`?kr:n.O()?n:kr}Sr(e){var t=e??this.qt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var n=this.props[Vn];return!n||typeof n!=`number`||Date.now()-n>t}properties(){var e={};return G(this.props,((t,n)=>{var r=(e=>{var t=Gr[e];if(t)return t;for(var[n,r]of Kr)if(e.indexOf(n)===0)return r})(n);if(r?.exposure===`derived`){if(r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,n===Tn?()=>this.Sr():()=>!1))return;r.transformToEventProperties&&K(e,r.transformToEventProperties(t))}else r&&r.exposure!==`event`||(e[n]=t)})),e}load(){if(!this.wr){var e=this.nr.F(this.yr);e&&(this.props=K({},e))}}refreshKey(e){if(!this.wr){var t=this.nr.F(this.yr);t&&e in t?this.kr(e,t[e]):this.Cr(e)}}save(){if(!this.wr){var e=this._r();e>0?P(this.Ir)&&(this.Ir=setTimeout((()=>{this.Ir=void 0,this.Tr()}),e)):this.Tr()}}flush(){P(this.Ir)||(clearTimeout(this.Ir),this.Ir=void 0,this.Tr())}Tr(){if(!this.wr){try{var e=JSON.stringify(this.props)+`|`+this.Er+`|`+this.Mr+`|`+this.Rr;if(e===this.Pr)return;this.Pr=e}catch{}this.nr.N(this.yr,this.props,this.Er,this.Mr,this.Rr,this.qt.debug)}}remove(){P(this.Ir)||(clearTimeout(this.Ir),this.Ir=void 0),this.nr.q(this.yr,!1),this.nr.q(this.yr,!0),this.Pr=void 0}clear(){this.remove(),this.props={}}register_once(e,t,n){if(M(e)){P(t)&&(t=`None`),this.Er=P(n)?this.Or:n;var r=!1;if(G(e,((e,n)=>{this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.kr(n,e),r=!0)})),r)return this.save(),!0}return!1}register(e,t){if(M(e)){this.Er=P(t)?this.Or:t;var n=!1;if(G(e,((t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.kr(r,t),n=!0)})),n)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Cr(e),this.save())}update_campaign_params(){if(!this.mr){var e=ni(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);N(gr(e))||this.register(e),this.mr=!0}}update_search_keyword(){var e;this.register((e=r?.referrer)?ii(e):{})}update_referrer_info(){this.register_once({$referrer:si(),$referring_domain:r!=null&&r.referrer&&qr(r.referrer)?.host||oi},void 0)}set_initial_person_info(){this.props[Gn]||this.props[Kn]||this.register_once({[qn]:ci(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};G([Kn,Gn],(t=>{var n=this.props[t];n&&G(n,(function(t,n){e[`$initial_`+O(n)]=t}))}));var t,n,r=this.props[qn];return r&&K(e,(t=li(r),n={},G(t,(function(e,t){n[`$initial_`+O(t)]=e})),n)),e}safe_merge(e){return G(this.props,(function(t,n){n in e||(e[n]=t)})),e}update_config(e,t,n){if(this.Or=this.Er=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!n),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var n=[...e].sort(),r=[...t].sort();return n.every(((e,t)=>e===r[t]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var r=this.br(e),i=this.props;this.clear(),this.nr=r,this.props=i,this.save()}}set_disabled(e){this.wr=e,this.wr?this.remove():this.save()}set_cross_subdomain(e){e!==this.Mr&&(this.Mr=e,this.remove(),this.save())}set_secure(e){e!==this.Rr&&(this.Rr=e,this.remove(),this.save())}set_event_timer(e,t){var n=this.props[cn]||{};n[e]=t,this.kr(cn,n),this.save()}remove_event_timer(e){var t=this.props[cn]||{},n=t[e];return P(n)||(delete t[e],this.kr(cn,t),this.save()),n}get_property(e){return this.props[e]}set_property(e,t){this.kr(e,t),this.save()}kr(e,t){this.props[e]=t}Cr(e){delete this.props[e]}},mi={Activation:`events`,Cancellation:`cancelEvents`},hi={Popover:`popover`,API:`api`,Widget:`widget`,ExternalSurvey:`external_survey`},gi={SHOWN:`survey shown`,DISMISSED:`survey dismissed`,SENT:`survey sent`,ABANDONED:`survey abandoned`},_i={SURVEY_ID:`$survey_id`,SURVEY_NAME:`$survey_name`,SURVEY_RESPONSE:`$survey_response`,SURVEY_ITERATION:`$survey_iteration`,SURVEY_ITERATION_START_DATE:`$survey_iteration_start_date`,SURVEY_PARTIALLY_COMPLETED:`$survey_partially_completed`,SURVEY_SUBMISSION_ID:`$survey_submission_id`,SURVEY_QUESTIONS:`$survey_questions`,SURVEY_COMPLETED:`$survey_completed`,PRODUCT_TOUR_ID:`$product_tour_id`,SURVEY_LAST_SEEN_DATE:`$survey_last_seen_date`,SURVEY_LANGUAGE:`$survey_language`},vi={Popover:`popover`,Inline:`inline`},yi={SHOWN:`product tour shown`,DISMISSED:`product tour dismissed`,COMPLETED:`product tour completed`,STEP_SHOWN:`product tour step shown`,STEP_COMPLETED:`product tour step completed`,BUTTON_CLICKED:`product tour button clicked`,STEP_SELECTOR_FAILED:`product tour step selector failed`,BANNER_CONTAINER_SELECTOR_FAILED:`product tour banner container selector failed`,BANNER_ACTION_CLICKED:`product tour banner action clicked`},bi={TOUR_ID:`$product_tour_id`,TOUR_NAME:`$product_tour_name`,TOUR_ITERATION:`$product_tour_iteration`,TOUR_RENDER_REASON:`$product_tour_render_reason`,TOUR_STEP_ID:`$product_tour_step_id`,TOUR_STEP_ORDER:`$product_tour_step_order`,TOUR_STEP_TYPE:`$product_tour_step_type`,TOUR_DISMISS_REASON:`$product_tour_dismiss_reason`,TOUR_BUTTON_TEXT:`$product_tour_button_text`,TOUR_BUTTON_ACTION:`$product_tour_button_action`,TOUR_BUTTON_LINK:`$product_tour_button_link`,TOUR_BUTTON_TOUR_ID:`$product_tour_button_tour_id`,TOUR_STEPS_COUNT:`$product_tour_steps_count`,TOUR_STEP_SELECTOR:`$product_tour_step_selector`,TOUR_STEP_SELECTOR_FOUND:`$product_tour_step_selector_found`,TOUR_STEP_ELEMENT_TAG:`$product_tour_step_element_tag`,TOUR_STEP_ELEMENT_ID:`$product_tour_step_element_id`,TOUR_STEP_ELEMENT_CLASSES:`$product_tour_step_element_classes`,TOUR_STEP_ELEMENT_TEXT:`$product_tour_step_element_text`,TOUR_ERROR:`$product_tour_error`,TOUR_MATCHES_COUNT:`$product_tour_matches_count`,TOUR_FAILURE_PHASE:`$product_tour_failure_phase`,TOUR_WAITED_FOR_ELEMENT:`$product_tour_waited_for_element`,TOUR_WAIT_DURATION_MS:`$product_tour_wait_duration_ms`,TOUR_BANNER_SELECTOR:`$product_tour_banner_selector`,TOUR_LINKED_SURVEY_ID:`$product_tour_linked_survey_id`,USE_MANUAL_SELECTOR:`$use_manual_selector`,INFERENCE_DATA_PRESENT:`$inference_data_present`,TOUR_LAST_SEEN_DATE:`$product_tour_last_seen_date`,TOUR_TYPE:`$product_tour_type`},xi=W(`[RateLimiter]`),Si=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((e=>{xi.info((e||`events`)+` is quota limited.`),this.serverLimits[e]=new Date().getTime()+6e4}))}catch(e){xi.warn(`could not rate limit - continuing. Error: "`+e?.message+`"`,{text:t});return}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){return this.instance.config.rate_limiting?.events_per_second||10}get captureEventsBurstLimit(){return Math.max(this.instance.config.rate_limiting?.events_burst_limit||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t;e===void 0&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:r}=this,i=new Date().getTime(),a=this.instance.persistence?.get_property(Wn)??{tokens:n,last:i};a.tokens+=(i-a.last)/1e3*r,a.last=i,a.tokens>n&&(a.tokens=n);var o=1>a.tokens;return o||e||(a.tokens=Math.max(0,a.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture(`$$client_ingestion_warning`,{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to `+r+` events per second and `+n+` events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(t=this.instance.persistence)==null||t.set_property(Wn,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||`events`]||!1;return!1!==t&&new Date().getTime()<t}},Ci=W(`[RemoteConfig]`),wi=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=u._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Lr(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.loadExternalDependency?(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`remote-config`,(()=>e(this.remoteConfig))):e()}Fr(e){this._instance._send_request({method:`GET`,url:this._instance.requestRouter.endpointFor(`assets`,`/array/`+this._instance.config.token+`/config`),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return Ci.info(`Using preloaded remote config`,this.remoteConfig),this.Ar(this.remoteConfig),void this.Nr();if(this._instance.Dr())return void Ci.warn(`Remote config is disabled. Falling back to local config.`);this.Lr((e=>{if(!e)return Ci.info(`No config found after loading remote JS config. Falling back to JSON.`),void this.Fr((e=>{this.Ar(e),this.Nr()}));this.Ar(e),this.Nr()}))}catch(e){Ci.error(`Error loading remote config`,e)}}stop(){this.$r&&=(clearInterval(this.$r),void 0)}refresh(){!this._instance.Dr()&&r&&r.visibilityState!==`hidden`&&this._instance.reloadFeatureFlags()}Nr(){if(!this.$r){var e=this._instance.config.remote_config_refresh_interval_ms??3e5;e!==0&&(this.$r=setInterval((()=>{this.refresh()}),e))}}Ar(e){var t;e||Ci.error(`Failed to fetch remote config from PostHog.`),this._instance.Ar(e??{}),!1!==e?.hasFeatureFlags&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(t=this._instance.featureFlags)==null||t.ensureFlagsLoaded())}},Ti={GZipJS:`gzip-js`,Base64:`base64`},Ei=Uint8Array,X=Uint16Array,Di=Uint32Array,Oi=new Ei([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ki=new Ei([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ai=new Ei([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ji=function(e,t){for(var n=new X(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new Di(n[30]);for(r=1;30>r;++r)for(var a=n[r];n[r+1]>a;++a)i[a]=a-n[r]<<5|r;return[n,i]},Mi=ji(Oi,2),Ni=Mi[1];Mi[0][28]=258,Ni[258]=28;for(var Pi=ji(ki,0)[1],Fi=new X(32768),Z=0;32768>Z;++Z){var Ii=(43690&Z)>>>1|(21845&Z)<<1;Fi[Z]=((65280&(Ii=(61680&(Ii=(52428&Ii)>>>2|(13107&Ii)<<2))>>>4|(3855&Ii)<<4))>>>8|(255&Ii)<<8)>>>1}var Li=function(e,t,n){for(var r=e.length,i=0,a=new X(t);r>i;++i)++a[e[i]-1];var o,s=new X(t);for(i=0;t>i;++i)s[i]=s[i-1]+a[i-1]<<1;if(n){o=new X(1<<t);var c=15-t;for(i=0;r>i;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],d=s[e[i]-1]++<<u,f=d|(1<<u)-1;f>=d;++d)o[Fi[d]>>>c]=l}else for(o=new X(r),i=0;r>i;++i)o[i]=Fi[s[e[i]-1]++]>>>15-e[i];return o},Ri=new Ei(288);for(Z=0;144>Z;++Z)Ri[Z]=8;for(Z=144;256>Z;++Z)Ri[Z]=9;for(Z=256;280>Z;++Z)Ri[Z]=7;for(Z=280;288>Z;++Z)Ri[Z]=8;var zi=new Ei(32);for(Z=0;32>Z;++Z)zi[Z]=5;var Bi=Li(Ri,9,0),Vi=Li(zi,5,0),Hi=function(e){return(e/8>>0)+(7&e&&1)},Ui=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof X?X:e instanceof Di?Di:Ei)(n-t);return r.set(e.subarray(t,n)),r},Wi=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},Gi=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Ki=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,a=n.slice();if(!i)return[new Ei(0),0];if(i==1){var o=new Ei(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:s.f+c.f,l:s,r:c};u!=i-1;)s=n[n[d].f>n[l].f?l++:d++],c=n[l!=u&&n[d].f>n[l].f?l++:d++],n[u++]={s:-1,f:s.f+c.f,l:s,r:c};var f=a[0].s;for(r=1;i>r;++r)a[r].s>f&&(f=a[r].s);var p=new X(f+1),m=qi(n[u-1],p,0);if(m>t){r=0;var h=0,g=m-t,_=1<<g;for(a.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i>r;++r){var v=a[r].s;if(t>=p[v])break;h+=_-(1<<m-p[v]),p[v]=t}for(h>>>=g;h>0;){var y=a[r].s;t>p[y]?h-=1<<t-p[y]++-1:++r}for(;r>=0&&h;--r){var b=a[r].s;p[b]==t&&(--p[b],++h)}m=t}return[new Ei(p),m]},qi=function(e,t,n){return e.s==-1?Math.max(qi(e.l,t,n+1),qi(e.r,t,n+1)):t[e.s]=n},Ji=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new X(++t),r=0,i=e[0],a=1,o=function(e){n[r++]=e},s=1;t>=s;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},Yi=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},Xi=function(e,t,n){var r=n.length,i=Hi(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;r>a;++a)e[i+a+4]=n[a];return 8*(i+4+r)},Zi=function(e,t,n,r,i,a,o,s,c,l,u){Wi(t,u++,n),++i[256];for(var d=Ki(i,15),f=d[0],p=d[1],m=Ki(a,15),h=m[0],g=m[1],_=Ji(f),v=_[0],y=_[1],b=Ji(h),x=b[0],S=b[1],C=new X(19),w=0;v.length>w;++w)C[31&v[w]]++;for(w=0;x.length>w;++w)C[31&x[w]]++;for(var ee=Ki(C,7),T=ee[0],te=ee[1],E=19;E>4&&!T[Ai[E-1]];--E);var D,O,ne,re,k=l+5<<3,A=Yi(i,Ri)+Yi(a,zi)+o,j=Yi(i,f)+Yi(a,h)+o+14+3*E+Yi(C,T)+(2*C[16]+3*C[17]+7*C[18]);if(A>=k&&j>=k)return Xi(t,u,e.subarray(c,c+l));if(Wi(t,u,1+(A>j)),u+=2,A>j){D=Li(f,p,0),O=f,ne=Li(h,g,0),re=h;var M=Li(T,te,0);for(Wi(t,u,y-257),Wi(t,u+5,S-1),Wi(t,u+10,E-4),u+=14,w=0;E>w;++w)Wi(t,u+3*w,T[Ai[w]]);u+=3*E;for(var N=[v,x],P=0;2>P;++P){var F=N[P];for(w=0;F.length>w;++w)Wi(t,u,M[ie=31&F[w]]),u+=T[ie],ie>15&&(Wi(t,u,F[w]>>>5&127),u+=F[w]>>>12)}}else D=Bi,O=Ri,ne=Vi,re=zi;for(w=0;s>w;++w)if(r[w]>255){var ie;Gi(t,u,D[257+(ie=r[w]>>>18&31)]),u+=O[ie+257],ie>7&&(Wi(t,u,r[w]>>>23&31),u+=Oi[ie]);var I=31&r[w];Gi(t,u,ne[I]),u+=re[I],I>3&&(Gi(t,u,r[w]>>>5&8191),u+=ki[I])}else Gi(t,u,D[r[w]]),u+=O[r[w]];return Gi(t,u,D[256]),u+O[256]},Qi=new Di([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$i=function(){for(var e=new Di(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),ea=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function ta(e,t){t===void 0&&(t={});var n=function(){var e=4294967295;return{p(t){for(var n=e,r=0;t.length>r;++r)n=$i[255&n^t[r]]^n>>>8;e=n},d(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,a,o,s,c,l=(s=10+((i=t).filename&&i.filename.length+1||0),c=8,function(e,t,n,r,i,a){var o=e.length,s=new Ei(r+o+5*(1+Math.floor(o/7e3))+i),c=s.subarray(r,s.length-i),l=0;if(!t||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?l=Xi(c,l,e.subarray(u,d)):(c[u]=!0,l=Xi(c,l,e.subarray(u,o)))}else{for(var f=Qi[t-1],p=f>>>13,m=8191&f,h=(1<<n)-1,g=new X(32768),_=new X(h+1),v=Math.ceil(n/3),y=2*v,b=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<y)&h},x=new Di(25e3),S=new X(288),C=new X(32),w=0,ee=0,T=(u=0,0),te=0,E=0;o>u;++u){var D=b(u),O=32767&u,ne=_[D];if(g[O]=ne,_[D]=O,u>=te){var re=o-u;if((w>7e3||T>24576)&&re>423){l=Zi(e,c,0,x,S,C,ee,T,E,u-E,l),T=w=ee=0,E=u;for(var k=0;286>k;++k)S[k]=0;for(k=0;30>k;++k)C[k]=0}var A=2,j=0,M=m,N=O-ne&32767;if(re>2&&D==b(u-N))for(var P=Math.min(p,re)-1,F=Math.min(32767,u),ie=Math.min(258,re);F>=N&&--M&&O!=ne;){if(e[u+A]==e[u+A-N]){for(var I=0;ie>I&&e[u+I]==e[u+I-N];++I);if(I>A){if(A=I,j=N,I>P)break;var L=Math.min(N,I-2),R=0;for(k=0;L>k;++k){var z=u-N+k+32768&32767,B=z-g[z]+32768&32767;B>R&&(R=B,ne=z)}}}N+=(O=ne)-(ne=g[O])+32768&32767}if(j){x[T++]=268435456|Ni[A]<<18|Pi[j];var ae=31&Ni[A],oe=31&Pi[j];ee+=Oi[ae]+ki[oe],++S[257+ae],++C[oe],te=u+A,++w}else x[T++]=e[u],++S[e[u]]}}l=Zi(e,c,!0,x,S,C,ee,T,E,u-E,l)}return Ui(s,0,r+Hi(l)+i)}(a=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+o.mem,s,c)),u=l.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&ea(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;n.length>=r;++r)e[r+10]=n.charCodeAt(r)}}(l,t),ea(l,u-8,n.d()),ea(l,u-4,r),l}var na=!!o||!!a,ra=`text/plain`,ia=!1,aa=(e,t)=>{var[n,r]=e.split(`#`),[i,a]=n.split(`?`);if(!a)return e;var o=a.split(`&`).filter((e=>e.split(`=`)[0]!==t)).join(`&`);return i+(o?`?`+o:``)+(r?`#`+r:``)},oa=function(e,t,n){n===void 0&&(n=!0);var[r,i]=e.split(`?`),a=h({},t),o=i?.split(`&`).map((e=>{var t,[r,i]=e.split(`=`),o=n&&(t=a[r])!=null?t:i;return delete a[r],r+`=`+o}))??[],s=function(e,t){var n,r;t===void 0&&(t=`&`);var i=[];return G(e,(function(e,t){P(e)||P(t)||t===`undefined`||(n=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(t),i[i.length]=r+`=`+n)})),i.join(t)}(a);return s&&o.push(s),r+`?`+o.join(`&`)},sa=(e,t)=>JSON.stringify(e,((e,t)=>typeof t==`bigint`?t.toString():t),t),ca=e=>{if(e.tr)return e.tr;var{data:t,compression:n}=e;if(t){if(n===Ti.GZipJS){var r=ta(function(e,t){var n=e.length;if(typeof TextEncoder<`u`)return new TextEncoder().encode(e);for(var r=new Ei(e.length+(e.length>>>1)),i=0,a=function(e){r[i++]=e},o=0;n>o;++o){if(i+5>r.length){var s=new Ei(i+8+(n-o<<1));s.set(r),r=s}var c=e.charCodeAt(o);128>c?a(c):2048>c?(a(192|c>>>6),a(128|63&c)):c>55295&&57344>c?(a(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++o))>>>18),a(128|c>>>12&63),a(128|c>>>6&63),a(128|63&c)):(a(224|c>>>12),a(128|c>>>6&63),a(128|63&c))}return Ui(r,0,i)}(sa(t)),{mtime:0});return{contentType:ra,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===Ti.Base64){var i=(e=>`data=`+encodeURIComponent(typeof e==`string`?e:sa(e)))(function(e){return e&&btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16)))))}(sa(t)));return{contentType:`application/x-www-form-urlencoded`,body:i,estimatedSize:new Blob([i]).size}}var a=sa(t);return{contentType:`application/json`,body:a,estimatedSize:new Blob([a]).size}}},la=e=>{var t,n,r,i=ca(e);return!i||(n=e.compression,r=Jr(e.url,`compression`),n!==v.GZipJS&&r!==v.GZipJS&&r!==`gzip`)||((t=i.body)instanceof ArrayBuffer?x(new Uint8Array(t)):ArrayBuffer.isView(t)&&x(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)))?{url:e.url,encodedBody:i}:(ia=!0,{url:aa(e.url,`compression`),encodedBody:ca(h({},e,{compression:void 0,tr:void 0}))})},ua=function(){var e=m((function*(e){var t=yield function(e,t,n){return ee.apply(this,arguments)}(sa(e.data),f.DEBUG,{rethrow:!0});if(!t)return e;var n=yield t.arrayBuffer();return h({},e,{tr:{contentType:ra,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}}(),da=(e,t)=>oa(e,{_:new Date().getTime().toString(),ver:f.JS_SDK_VERSION,compression:t}),fa=[];a&&fa.push({transport:`fetch`,method(e){var{url:t,encodedBody:n}=la(e),{contentType:r,body:i,estimatedSize:o}=n??{},c=new Headers;G(e.headers,(function(e,t){c.append(t,e)})),r&&c.append(`Content-Type`,r);var l=null;if(s){var u=new s;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),e.timeout)}}a(t,h({method:e?.method||`GET`,headers:c,keepalive:e.method===`POST`&&52428.8>(o||0),body:i,signal:l?.signal},e.fetchOptions)).then((t=>t.text().then((n=>{var r={statusCode:t.status,text:n};if(t.status===200)try{r.json=JSON.parse(n)}catch(e){U.error(e)}e.callback==null||e.callback(r)})))).catch((t=>{U.error(t),e.callback==null||e.callback({statusCode:0,error:t})})).finally((()=>l?clearTimeout(l.timeout):null))}}),o&&fa.push({transport:`XHR`,method(e){var t=new o,{url:n,encodedBody:r}=la(e);t.open(e.method||`GET`,n,!0);var{contentType:i,body:a}=r??{};G(e.headers,(function(e,n){t.setRequestHeader(n,e)})),i&&t.setRequestHeader(`Content-Type`,i),e.timeout&&(t.timeout=e.timeout),e.disableXHRCredentials||(t.withCredentials=!0),t.onreadystatechange=()=>{if(t.readyState===4){var n={statusCode:t.status,text:t.responseText};if(t.status===200)try{n.json=JSON.parse(t.responseText)}catch{}e.callback==null||e.callback(n)}},t.send(a)}}),n!=null&&n.sendBeacon&&fa.push({transport:`sendBeacon`,method(e){try{var{url:t,encodedBody:r}=la(e),i=oa(t,{beacon:`1`}),{contentType:a,body:o}=r??{};if(!o)return;var s=o instanceof Blob?o:new Blob([o],{type:a});n.sendBeacon(i,s)}catch{}}});var pa=3e3,ma=class{constructor(e,t){this.qr=!0,this.jr=[],this.Hr=pe(t?.flush_interval_ms||pa,250,5e3,U.createLogger(`flush interval`),pa),this.Ur=e}enqueue(e){this.jr.push(e),this.Br||this.zr()}unload(){this.Vr();var e=this.jr.length>0?this.Wr():{},t=Object.values(e);[...t.filter((e=>e.url.indexOf(`/e`)===0)),...t.filter((e=>e.url.indexOf(`/e`)!==0))].map((e=>{this.Ur(h({},e,{transport:`sendBeacon`}))}))}enable(){this.qr=!1,this.zr()}zr(){var e=this;this.qr||(this.Br=setTimeout((()=>{if(this.Vr(),this.jr.length>0){var t=this.Wr(),n=function(){var n=t[r],i=new Date().getTime();n.data&&A(n.data)&&G(n.data,(e=>{e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.Ur(n)};for(var r in t)n()}}),this.Hr))}Vr(){clearTimeout(this.Br),this.Br=void 0}Wr(){var e={};return G(this.jr,(t=>{var n,r=t,i=(r?r.batchKey:null)||r.url;P(e[i])&&(e[i]=h({},r,{data:[]})),(n=e[i].data)==null||n.push(r.data)})),this.jr=[],e}},ha=[`retriesPerformedSoFar`],ga=class{constructor(t){this.Zr=!1,this.Gr=3e3,this.jr=[],this._instance=t,this.jr=[],this.Qr=!0,!P(e)&&`onLine`in e.navigator&&(this.Qr=e.navigator.onLine,this.Jr=()=>{this.Qr=!0,this.Kr()},this.Yr=()=>{this.Qr=!1},q(e,`online`,this.Jr),q(e,`offline`,this.Yr))}get length(){return this.jr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,n=g(e,ha);z(t)&&(n.url=oa(n.url,{retry_count:t})),this._instance._send_request(h({},n,{callback:e=>{e.statusCode===200||e.statusCode>=400&&500>e.statusCode||(t??0)>=10?n.callback==null||n.callback(e):this.Xr(h({retriesPerformedSoFar:t},n))}}))}Xr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*2**e,n=t/2,r=Math.min(18e5,t),i=Math.random()-.5;return Math.ceil(r+i*(r-n))}(t),r=Date.now()+n;this.jr.push({retryAt:r,requestOptions:e});var i=`Enqueued failed request for retry in `+n;navigator.onLine||(i+=` (Browser is offline)`),U.warn(i),this.Zr||(this.Zr=!0,this.ei())}ei(){if(this.ti&&clearTimeout(this.ti),this.jr.length===0)return this.Zr=!1,void(this.ti=void 0);this.ti=setTimeout((()=>{this.Qr&&this.jr.length>0&&this.Kr(),this.ei()}),this.Gr)}Kr(){var e=Date.now(),t=[],n=this.jr.filter((n=>e>n.retryAt||(t.push(n),!1)));if(this.jr=t,n.length>0)for(var{requestOptions:r}of n)this.retriableRequest(r)}unload(){for(var{requestOptions:t}of(this.ti&&=(clearTimeout(this.ti),void 0),this.Zr=!1,P(e)||(this.Jr&&=(e.removeEventListener(`online`,this.Jr),void 0),this.Yr&&=(e.removeEventListener(`offline`,this.Yr),void 0)),this.jr))try{this._instance._send_request(h({},t,{transport:`sendBeacon`}))}catch(e){U.error(e)}this.jr=[]}},_a=class{constructor(e){this.ri=()=>{this.ii||={};var e=this.scrollElement(),t=this.scrollY(),n=e?Math.max(0,e.scrollHeight-e.clientHeight):0,r=t+(e?.clientHeight||0),i=e?.scrollHeight||0;this.ii.lastScrollY=Math.ceil(t),this.ii.maxScrollY=Math.max(t,this.ii.maxScrollY??0),this.ii.maxScrollHeight=Math.max(n,this.ii.maxScrollHeight??0),this.ii.lastContentY=r,this.ii.maxContentY=Math.max(r,this.ii.maxContentY??0),this.ii.maxContentHeight=Math.max(i,this.ii.maxContentHeight??0)},this._instance=e}get ni(){return this._instance.config.scroll_root_selector}getContext(){return this.ii}resetContext(){var e=this.ii;return setTimeout(this.ri,0),e}startMeasuringScrollPosition(){q(e,`scroll`,this.ri,{capture:!0}),q(e,`scrollend`,this.ri,{capture:!0}),q(e,`resize`,this.ri)}scrollElement(){if(!this.ni)return e?.document.documentElement;for(var t of A(this.ni)?this.ni:[this.ni]){var n=e?.document.querySelector(t);if(n)return n}}scrollY(){if(this.ni){var t=this.scrollElement();return t&&t.scrollTop||0}return e&&(e.scrollY||e.pageYOffset||e.document.documentElement.scrollTop)||0}scrollX(){if(this.ni){var t=this.scrollElement();return t&&t.scrollLeft||0}return e&&(e.scrollX||e.pageXOffset||e.document.documentElement.scrollLeft)||0}},va=e=>ci(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties),ya=class{constructor(e,t,n,r){this.si=e=>{var t=this.oi();if(!t||t.sessionId!==e){var n={sessionId:e,props:this.ai(this._instance)};this.ui.register({[Un]:n})}},this._instance=e,this.li=t,this.ui=n,this.ai=r||va,this.li.onSessionId(this.si)}oi(){return this.ui.props[Un]}getSetOnceProps(){var e=this.oi()?.props;return e?`r`in e?li(e):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var e={};return G(gr(this.getSetOnceProps()),((t,n)=>{n===`$current_url`&&(n=`url`),e[`$session_entry_`+O(n)]=t})),e}},ba=class{constructor(){this.hi={}}on(e,t){return this.hi[e]||(this.hi[e]=[]),this.hi[e].push(t),()=>{this.hi[e]=this.hi[e].filter((e=>e!==t))}}emit(e,t){for(var n of this.hi[e]||[])n(t);for(var r of this.hi[`*`]||[])r(e,t)}},xa=W(`[SessionId]`),Sa=class{on(e,t){return this.ci.on(e,t)}constructor(e,t,n){var r;if(this.di=null,this.vi=[],this.fi=void 0,this.ci=new ba,this.pi=(e,t)=>!(!z(e)||!z(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error(`SessionIdManager requires a PostHogPersistence instance`);if(e.config.cookieless_mode===nr)throw Error(`SessionIdManager cannot be used with cookieless_mode="always"`);this.qt=e.config,this.ui=e.persistence,this.gi=void 0,this.mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.yi=t||Tr,this.bi=n||Tr;var i=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*pe(this.qt.session_idle_timeout_seconds||1800,60,36e3,xa.createLogger(`session_idle_timeout_seconds`),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.wi(),this.xi=`ph_`+i+`_window_id`,this.Si=`ph_`+i+`_primary_window_exists`,this.ki()){var a=Y.F(this.xi),o=Y.F(this.Si);a&&!o?this.gi=a:Y.q(this.xi),Y.N(this.Si,!0)}if((r=this.qt.bootstrap)!=null&&r.sessionID)try{var s=(e=>{var t=this.qt.bootstrap.sessionID.replace(/-/g,``);if(t.length!==32)throw Error(`Not a valid UUID`);if(t[12]!==`7`)throw Error(`Not a UUIDv7`);return parseInt(t.substring(0,12),16)})();this.Ci(this.qt.bootstrap.sessionID,new Date().getTime(),s)}catch(e){xa.error(`Invalid sessionID in bootstrap`,e)}this.Ii()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return P(this.vi)&&(this.vi=[]),this.vi.push(e),this.mi&&e(this.mi,this.gi),()=>{this.vi=this.vi.filter((t=>t!==e))}}ki(){return this.qt.persistence!==`memory`&&!this.ui.wr&&Y.O()}Ti(e){e!==this.gi&&(this.gi=e,this.ki()&&Y.N(this.xi,e))}Ei(){return this.gi?this.gi:this.ki()?Y.F(this.xi):null}Mi(e){var t=this.di;return!I(t)&&!I(e)&&5e3>Math.abs(e-t)}Ci(e,t,n){var r=t!==this._sessionActivityTimestamp,i=!(e!==this.mi||n!==this._sessionStartTimestamp);this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this.mi=e,i&&!r||i&&this.Mi(t)||(this.di=t,this.ui.register({[Cn]:[t,e,n]}))}Ri(){var e=this.qt?.persistence_save_debounce_ms;return z(e)&&e>0}Pi(){if(!I(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.di){this.Ri()?this.ui.refreshKey(Cn):(this.ui.flush(),this.ui.load());var[,e,t]=this.Oi();e===this.mi&&t===this._sessionStartTimestamp&&(this.di=this._sessionActivityTimestamp,this.ui.register({[Cn]:[this._sessionActivityTimestamp,this.mi??null,this._sessionStartTimestamp]}),this.ui.flush())}}Li(){var[e]=this.Oi(),t=z(e)?e:0,n=z(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,n)}Oi(){var e=this.ui.props[Cn];return A(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.di=null,clearTimeout(this.Fi),this.Fi=void 0,this.Ci(null,null,null)}destroy(){this.Pi(),clearTimeout(this.Fi),this.Fi=void 0,this.fi&&e&&(e.removeEventListener(sr,this.fi,{capture:!1}),this.fi=void 0),this.vi=[]}Ii(){this.fi=()=>{this.Pi(),this.ki()&&Y.q(this.Si)},q(e,sr,this.fi,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.qt.cookieless_mode===nr)throw Error(`checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"`);var n=t||new Date().getTime(),[,r,i]=this.Oi(),a=this.Li(),o=this.Ei(),s=z(i)&&Math.abs(n-i)>864e5,c=!1,l=!r,u=!l&&!e&&this.pi(n,a);l||u||s?(r=this.yi(),o=this.bi(),xa.info(`new session ID generated`,{sessionId:r,windowId:o,changeReason:{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}}),i=n,c=!0):o||(o=this.bi(),c=!0);var d=z(a)&&e&&!s?a:n,f=z(i)?i:new Date().getTime();return this.Ti(o),this.Ci(r,d,f),e||this.wi(),c&&this.vi.forEach((e=>e(r,o,c?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}:void 0))),{sessionId:r,windowId:o,sessionStartTimestamp:f,changeReason:c?{noSessionId:l,activityTimeout:u,sessionPastMaximumLength:s}:void 0,lastActivityTimestamp:a}}wi(){clearTimeout(this.Fi),this.Fi=setTimeout((()=>{var e=this.Li();if(this.pi(new Date().getTime(),e)){var t=this.mi;this.resetSessionId(),this.ci.emit(`forcedIdleReset`,{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}},Ca=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&te(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((e=>te(e?.brand,t))))return!0}catch{}return!!e.webdriver},wa=function(e,t){if(!function(e){try{new RegExp(e)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function Ta(e,t,n){return sa({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var Ea={exact:(e,t)=>t.some((t=>e.some((e=>t===e)))),is_not:(e,t)=>t.every((t=>e.every((e=>t!==e)))),regex:(e,t)=>t.some((t=>e.some((e=>wa(t,e))))),not_regex:(e,t)=>t.every((t=>e.every((e=>!wa(t,e))))),icontains:(e,t)=>t.map(Da).some((t=>e.map(Da).some((e=>t.includes(e))))),not_icontains:(e,t)=>t.map(Da).every((t=>e.map(Da).every((e=>!t.includes(e))))),gt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n>parseFloat(e)))})),lt:(e,t)=>t.some((t=>{var n=parseFloat(t);return!isNaN(n)&&e.some((e=>n<parseFloat(e)))}))},Da=e=>e.toLowerCase();function Oa(e,t){return!e||Object.entries(e).every((e=>{var[n,r]=e,i=t?.[n];if(P(i)||I(i))return!1;var a=[String(i)],o=Ea[r.operator];return!!o&&o(r.values,a)}))}var ka=`custom`,Aa=`i.posthog.com`,ja=/^\/static\//,Ma=class{constructor(e){this.Ai={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,``);return e===`https://app.posthog.com`?`https://us.i.posthog.com`:e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,``):this.apiHost}get uiHost(){var e=this.instance.config.ui_host?.replace(/\/$/,``);return e||=this.apiHost.replace(`.`+Aa,`.posthog.com`),e===`https://app.posthog.com`?`https://us.posthog.com`:e}get region(){return this.Ai[this.apiHost]||(this.Ai[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`us`:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?`eu`:ka),this.Ai[this.apiHost]}Ni(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if(typeof t==`string`&&ja.test(e))return t.trim().replace(/\/$/,``)||void 0}endpointFor(e,t){if(t===void 0&&(t=``),t&&=t[0]===`/`?t:`/`+t,e===`ui`)return this.uiHost+t;if(e===`flags`)return this.flagsApiHost+t;if(e===`assets`){var n=this.Ni(t);if(n)return``+n+t}if(this.region===ka)return this.apiHost+t;var r=Aa+t;switch(e){case`assets`:return`https://`+this.region+`-assets.`+r;case`api`:return`https://`+this.region+`.`+r}}},Q=W(`[Surveys]`),Na=`seenSurvey_`,Pa=[hi.Popover,hi.Widget,hi.API],Fa={ignoreConditions:!1,ignoreDelay:!1,displayType:vi.Popover},Ia=W(`[PostHog ExternalIntegrations]`),La={intercom:`intercom-integration`,crispChat:`crisp-chat-integration`},Ra=class{constructor(e){this._instance=e}lr(e,t){var n;(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,e,(e=>{if(e)return Ia.error(`failed to load script`,e);t()}))}startIfEnabledOrStop(){var e=this,t=function(t){var n,i,a;!r||(n=u.__PosthogExtensions__)!=null&&(n=n.integrations)!=null&&n[t]||e.lr(La[t],(()=>{var n;(n=u.__PosthogExtensions__)==null||(n=n.integrations)==null||(n=n[t])==null||n.start(e._instance)})),!r&&(i=u.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[t]&&((a=u.__PosthogExtensions__)==null||(a=a.integrations)==null||(a=a[t])==null||a.stop())};for(var[n,r]of Object.entries((i=this._instance.config.integrations)??{})){var i;t(n)}}},za,Ba={},Va=0,Ha=()=>{},Ua=`Consent opt in/out is not valid with cookieless_mode="always" and will be ignored`,Wa=`Surveys module not available`,Ga=`sanitize_properties is deprecated. Use before_send instead`,Ka=`Invalid value for property_denylist config: `,qa=`posthog`,Ja=!na&&l?.indexOf(`MSIE`)===-1&&l?.indexOf(`Mozilla`)===-1,Ya=t=>{var n;return h({api_host:`https://us.i.posthog.com`,flags_api_host:null,ui_host:null,token:``,autocapture:!0,cross_subdomain_cookie:vr(r?.location),persistence:`localStorage+cookie`,persistence_name:``,cookie_persisted_properties:[],loaded:Ha,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:`if_capture_pageview`,defaults:t??`unset`,__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:i&&F(i?.search)&&i.search.indexOf(`__posthog_debug=true`)!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(e==null||(n=e.location)==null?void 0:n.protocol)===`https:`,ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:`localStorage`,consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){U.error(`Bad HTTP status: `+e.statusCode+` `+e.text)},get_device_id:e=>e,capture_performance:void 0,name:`posthog`,bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:ar,before_send:void 0,request_queue_config:{flush_interval_ms:pa},error_tracking:{},_onCapture:Ha,__preview_eager_load_replay:!1},(e=>({rageclick:!e||`2025-11-30`>e||{content_ignorelist:!0},capture_pageview:!e||`2025-05-24`>e||`history_change`,session_recording:e&&e>=`2025-11-30`?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>=`2026-01-30`?`head`:`body`,internal_or_test_user_hostname:e&&e>=`2026-01-30`?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>=`2026-05-30`?250:0}))(t))},Xa=[[`process_person`,`person_profiles`],[`xhr_headers`,`request_headers`],[`cookie_name`,`persistence_name`],[`disable_cookie`,`disable_persistence`],[`store_google`,`save_campaign_params`],[`verbose`,`debug`]],Za=e=>{var t={};for(var[n,r]of Xa)P(e[n])||(t[r]=e[n]);var i=K({},t,e);return A(e.property_blacklist)&&(P(e.property_denylist)?i.property_denylist=e.property_blacklist:A(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:U.error(Ka+e.property_denylist)),i},Qa=class{constructor(){this.__forceAllowLocalhost=!1}get Di(){return this.__forceAllowLocalhost}set Di(e){U.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},$a=class t{$i(e,t){if(e){var n=this.qi.indexOf(e);n!==-1&&this.qi.splice(n,1)}return this.qi.push(t),t.initialize==null||t.initialize(),t}ji(){return this.config.cookieless_mode===nr||this.config.cookieless_mode===tr&&this.consent.isRejected()}get decideEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}get flagsEndpointWasHit(){var e;return(e=this.featureFlags?.hasLoadedFlags)!=null&&e}constructor(){this.webPerformance=new Qa,this.Hi=!1,this.version=f.LIB_VERSION,this.Ui=new ba,this.qi=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Ya(),this.SentryIntegration=Ur,this.sentryIntegration=e=>function(e,t){var n=Hr(e,t);return{name:Vr,processEvent:e=>n(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint=`/e/`,this.Bi=!1,this.zi=null,this.Vi=null,this.Wi=null,this.scrollManager=new _a(this),this.pageViewManager=new Wr(this),this.rateLimiter=new Si(this),this.requestRouter=new Ma(this),this.consent=new Fr(this),this.externalIntegrations=new Ra(this);var e=t.__defaultExtensionClasses??{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(e,t,n)=>{var r=F(e)?{[e]:t}:e;this.setPersonProperties(r),n?.({})},set_once:(e,t,n)=>{var r=F(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),n?.({})}},this.on(`eventCaptured`,(e=>U.info(`send "`+e?.event+`"`,e)))}init(e,n,r){if(r&&r!==qa){var i=Ba[r]??new t;return i._init(e,n,r),Ba[r]=i,Ba[qa][r]=i,i}return this._init(e,n,r)}_init(t,n,r){var i;n===void 0&&(n={});var a=F(t)?t.trim():``;if(!a)return U.critical(`PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()`),this;if(this.__loaded)return console.warn(`[PostHog.js]`,`You have already initialized PostHog! Re-initializing is a no-op`),this;this.__loaded=!0,this.config={},n.debug=this.Zi(n.debug),this.Gi=n,this.Qi=[],n.person_profiles?this.Vi=n.person_profiles:n.process_person&&(this.Vi=n.process_person),this.set_config(K({},Ya(n.defaults),Za(n),{name:r,token:a})),this.config.on_xhr_error&&U.error(`on_xhr_error is deprecated. Use on_request_error instead`),this.compression=n.disable_compression?void 0:Ti.GZipJS;var o=this.Ji();this.persistence=new pi(this.config,o),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new pi(h({},this.config,{persistence:`sessionStorage`}),o);var s=h({},this.persistence.props),c=h({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Ki=new ma((e=>this.Yi(e)),this.config.request_queue_config),this.Xi=new ga(this),this.__request_queue=[];var l=this.ji();if(l||(this.sessionManager=new Sa(this),this.sessionPropsManager=new ya(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(U.info(`Deferring extension initialization to improve startup performance`),setTimeout((()=>{this.en(l)}),0)):(U.info(`Initializing extensions synchronously`),this.en(l)),f.DEBUG=f.DEBUG||this.config.debug,f.DEBUG&&U.info(`Starting in debug mode`,{this:this,config:n,thisC:h({},this.config),p:s,s:c}),!this.config.identity_distinct_id||(i=n.bootstrap)!=null&&i.distinctID||(n.bootstrap=h({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),n.bootstrap?.distinctID!==void 0){var u=n.bootstrap.distinctID,d=this.get_distinct_id(),p=this.persistence.get_property(Hn);if(n.bootstrap.isIdentifiedID&&d!=null&&d!==u&&p===rr)this.identify(u);else if(n.bootstrap.isIdentifiedID&&d!=null&&d!==u&&p===ir)U.warn(`Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.`);else{var m=this.config.get_device_id(Tr()),g=n.bootstrap.isIdentifiedID?m:u;this.persistence.set_property(Hn,n.bootstrap.isIdentifiedID?ir:rr),this.register({distinct_id:u,$device_id:g})}}if(l)this.register_once({distinct_id:Xn,$device_id:null},``);else if(!this.get_distinct_id()){var _=this.config.get_device_id(Tr());this.register_once({distinct_id:_,$device_id:_},``),this.persistence.set_property(Hn,rr)}return q(e,`onpagehide`in self?`pagehide`:`unload`,this._handle_unload.bind(this),{passive:!1}),n.segment?function(e,t){var n=e.config.segment;if(!n)return t();(function(e,t){var n=e.config.segment;if(!n)return t();var r=n=>{var r=()=>n.anonymousId()||Tr();e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(Hn,ir)),t()},i=n.user();`then`in i&&j(i.then)?i.then(r):r(i)})(e,(()=>{n.register((e=>{Promise&&Promise.resolve||Br.warn(`This browser does not have Promise support, and can not use the segment integration`);var t=(t,n)=>{if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Br.info(`No userId set, resetting PostHog`),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Br.info(`UserId set, identifying with PostHog`),e.identify(t.event.userId));var r=e.calculateEventProperties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:`PostHog JS`,type:`enrichment`,version:`1.0.0`,isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,cr),identify:e=>t(e,ur),screen:e=>t(e,`$screen`)}})(e)).then((()=>{t()}))}))}(this,(()=>this.tn())):this.tn(),j(this.config._onCapture)&&this.config._onCapture!==Ha&&(U.warn("onCapture is deprecated. Please use `before_send` instead"),this.on(`eventCaptured`,(e=>this.config._onCapture(e.event,e)))),this.config.ip&&U.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}en(e){var n=performance.now(),r=h({},t.__defaultExtensionClasses,this.config.__extensionClasses),i=[];r.featureFlags&&this.qi.push(this.featureFlags=this.featureFlags??new r.featureFlags(this)),r.exceptions&&this.qi.push(this.exceptions=this.exceptions??new r.exceptions(this)),r.historyAutocapture&&this.qi.push(this.historyAutocapture=new r.historyAutocapture(this)),r.tracingHeaders&&this.qi.push(this.tracingHeaders=new r.tracingHeaders(this)),r.siteApps&&this.qi.push(this.siteApps=new r.siteApps(this)),r.sessionRecording&&!e&&this.qi.push(this.sessionRecording=new r.sessionRecording(this)),this.config.disable_scroll_properties||i.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.autocapture&&this.qi.push(this.autocapture=new r.autocapture(this)),r.surveys&&this.qi.push(this.surveys=this.surveys??new r.surveys(this)),r.logs&&this.qi.push(this.logs=this.logs??new r.logs(this)),r.conversations&&this.qi.push(this.conversations=this.conversations??new r.conversations(this)),r.productTours&&this.qi.push(this.productTours=new r.productTours(this)),r.heatmaps&&this.qi.push(this.heatmaps=new r.heatmaps(this)),r.webVitalsAutocapture&&this.qi.push(this.webVitalsAutocapture=new r.webVitalsAutocapture(this)),r.exceptionObserver&&this.qi.push(this.exceptionObserver=new r.exceptionObserver(this)),r.deadClicksAutocapture&&this.qi.push(this.deadClicksAutocapture=new r.deadClicksAutocapture(this,Rr)),r.toolbar&&this.qi.push(this.toolbar=this.toolbar??new r.toolbar(this)),r.experiments&&this.qi.push(this.experiments=this.experiments??new r.experiments(this)),this.qi.forEach((e=>{e.initialize&&i.push((()=>{e.initialize==null||e.initialize()}))})),i.push((()=>{if(this.rn){var e=this.rn;this.rn=void 0,this.Ar(e)}})),this.nn(i,n)}nn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.nn(e,t)}),0);var n=e.shift();if(n)try{n()}catch(e){U.error(`Error initializing extension:`,e)}}var r=Math.round(performance.now()-t);this.register_for_session({[Zn]:this.config.__preview_deferred_init_extensions?`deferred`:`synchronous`,[Qn]:r}),this.config.__preview_deferred_init_extensions&&U.info(`PostHog extensions initialized (`+r+`ms)`)}Ar(e){var t;if(!r||!r.body)return U.info(`document not ready yet, trying again in 500 milliseconds...`),void setTimeout((()=>{this.Ar(e)}),500);this.config.__preview_deferred_init_extensions&&(this.rn=e),this.sn=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=E(e.supportedCompression,Ti.GZipJS)?Ti.GZipJS:E(e.supportedCompression,Ti.Base64)?Ti.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Vi?this.Vi:ar}),this.qi.forEach((t=>t.onRemoteConfig==null?void 0:t.onRemoteConfig(e)))}tn(){try{this.config.loaded(this)}catch(e){U.critical("`loaded` function failed",e)}if(this.an(),this.config.internal_or_test_user_hostname&&i!=null&&i.hostname){var e=i.hostname,t=this.config.internal_or_test_user_hostname;(typeof t==`string`?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.ji())&&this.un()}),1),this.ln=new wi(this),this.ln.load()}an(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Ki)==null||e.enable())}_dom_loaded(){this.is_capturing()&&fr(this.__request_queue,(e=>this.Yi(e))),this.__request_queue=[],this.an()}_handle_unload(){var e,t,n,r;(e=this.surveys)==null||e.handlePageUnload(),this.config.request_batching?(this.hn()&&this.capture(lr),(t=this.logs)==null||t.flushLogs(`sendBeacon`),(n=this.Ki)==null||n.unload(),(r=this.Xi)==null||r.unload()):this.hn()&&this.capture(lr,null,{transport:`sendBeacon`})}_send_request(e){this.__loaded&&(Ja?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=oa(e.url,{ip:+!!this.config.ip}),e.headers=h({},this.config.request_headers,e.headers),e.compression=e.compression===`best-available`?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=[`sendBeacon`]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t=h({},e);t.timeout=t.timeout||6e4,t.url=da(t.url,t.compression);var n=t.transport??`fetch`,r=fa.filter((e=>!t.disableTransport||!e.transport||!t.disableTransport.includes(e.transport))),i=function(e,t){for(var r=0;e.length>r;r++)if(e[r].transport===n)return e[r]}(r)?.method??r[0].method;if(!i)throw Error(`No available transport method`);n!==`sendBeacon`&&t.data&&t.compression===Ti.GZipJS&&c&&!ia?ua(t).then((e=>{i(e)})).catch((n=>{if(S(n))return ia=!0,void i(h({},t,{compression:void 0,url:da(e.url,void 0)}));(e=>{if(!e||typeof e!=`object`)return!1;var t=`name`in e?String(e.name):``;return S(e)||t===b})(n)&&(ia=!0),i(t)})):i(t)})(h({},e,{callback:t=>{var n,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||(n=(r=this.config).on_request_error)==null||n.call(r,t),e.callback==null||e.callback(t)}}))))}Yi(e){this.Xi?this.Xi.retriableRequest(e):this._send_request(e)}_execute_array(e){Va++;try{var t,n=[],r=[],i=[];fr(e,(e=>{if(e)if(A(t=e[0]))i.push(e);else if(j(e))try{e.call(this)}catch(t){U.error(`Error executing queued PostHog call`,e,t)}else A(e)&&t===`alias`?n.push(e):A(e)&&t.indexOf(`capture`)!==-1&&j(this[t])?i.push(e):r.push(e)}));var a=function(e,t){fr(e,(function(e){try{if(A(e[0])){var n=t;G(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else t[e[0]].apply(t,e.slice(1))}catch(t){U.error(`Error executing queued PostHog call`,e,t)}}))};a(n,this),a(r,this),a(i,this)}finally{Va--}}push(e){if(Va>0&&A(e)&&F(e[0])){var n=t.prototype[e[0]];j(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,n){var r,i,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ki){if(this.is_capturing())if(!P(e)&&F(e)){var s=!this.config.opt_out_useragent_filter&&this._is_bot();if(!s||this.config.__preview_capture_bot_pageviews){var c=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){t!=null&&t.$current_url&&!F(t?.$current_url)&&(U.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),e!==`$exception`||n!=null&&n.cn||U.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.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var l=new Date,u=n?.timestamp||l,d=n?.uuid||Tr(),f={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},u,d)};e===cr&&this.config.__preview_capture_bot_pageviews&&s&&(f.event=`$bot_pageview`,f.properties.$browser_type=`bot`),c&&(f.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens),n!=null&&n.$set&&(f.$set=n?.$set);var p,m,g,_=this.dn(n?.$set_once,e!==dr,e===ur);if(_&&(f.$set_once=_),n!=null&&n._noTruncate||(r=this.config.properties_string_max_length,i=f,a=e=>F(e)?e.slice(0,r):e,o=new Set,f=function e(t,n){return t===Object(t)?o.has(t)?void 0:(o.add(t),A(t)?(r=[],fr(t,(t=>{r.push(e(t))}))):(r={},G(t,((t,n)=>{o.has(t)||(r[n]=e(t,n))}))),r):a?a(t):t;var r}(i)),f.timestamp=u,P(n?.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=l),e===gi.DISMISSED||e===gi.SENT){var v=t?.[_i.SURVEY_ID],y=t?.[_i.SURVEY_ITERATION];(e=>{try{var t=(e=>((e,t)=>{var n=``+Na+t.id;return t.current_iteration&&t.current_iteration>0&&(n=``+Na+t.id+`_`+t.current_iteration),n})(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,`true`)}catch(e){Q.error(`Failed to persist survey seen state`,e)}})({id:v,current_iteration:y}),f.$set=h({},f.$set,{[(p={id:v,current_iteration:y},m=e===gi.SENT?`responded`:`dismissed`,g=`$survey_`+m+`/`+p.id,p.current_iteration&&p.current_iteration>0&&(g=`$survey_`+m+`/`+p.id+`/`+p.current_iteration),g)]:!0})}else e===gi.SHOWN&&(f.$set=h({},f.$set,{[_i.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===yi.SHOWN){var b=t?.[bi.TOUR_TYPE];b&&(f.$set=h({},f.$set,{[bi.TOUR_LAST_SEEN_DATE+`/`+b]:new Date().toISOString()}))}var x=h({},f.properties.$set,f.$set);if(N(x)||this.setPersonPropertiesForFlags(x),!L(this.config.before_send)){var S=this.vn(f);if(!S)return;f=S}this.Ui.emit(`eventCaptured`,f);var C={method:`POST`,url:n?._url??this.requestRouter.endpointFor(`api`,this.analyticsDefaultEndpoint),data:f,compression:`best-available`,batchKey:n?._batchKey,transport:n?.transport};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Yi(C):this.Ki.enqueue(C),f}U.critical(`This capture call is ignored due to client rate limiting.`)}}else U.error(`No event name provided to posthog.capture`)}else U.uninitializedWarning(`posthog.capture`)}_addCaptureHook(e){return this.on(`eventCaptured`,(t=>e(t.event,t)))}calculateEventProperties(t,n,a,o,s){if(a||=new Date,!this.persistence||!this.sessionPersistence)return n;var c=s?void 0:this.persistence.remove_event_timer(t),u=h({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.ji()&&(u.$cookieless_mode=!0),t===`$snapshot`){var d=h({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=d.distinct_id,(!F(u.distinct_id)&&!R(u.distinct_id)||ie(u.distinct_id))&&U.error(`Invalid distinct_id for replay event. This indicates a bug in your implementation`),u}var p,m=function(t,n){var r,a,o;if(!l)return{};var s,c,u,d,p,m=t?[...Qr,...n||[]]:[],[h,g]=function(e){for(var t=0;_t.length>t;t++){var[n,r]=_t[t],i=n.exec(e),a=i&&(j(r)?r(i,e):r);if(a)return a}return[``,``]}(l),_=(s=typeof navigator<`u`?navigator:void 0)!=null&&s.brave?{brave:!0}:{},v=K(gr({$os:h,$os_version:g,$browser:mt(l,navigator.vendor,_),$device:vt(l),$device_type:(u=l,d={userAgentDataPlatform:(r=navigator)==null||(r=r.userAgentData)==null?void 0:r.platform,maxTouchPoints:navigator?.maxTouchPoints,screenWidth:e==null||(a=e.screen)==null?void 0:a.width,screenHeight:e==null||(o=e.screen)==null?void 0:o.height,devicePixelRatio:e?.devicePixelRatio},p=vt(u),p===Se||p===xe||p===`Kobo`||p===`Kindle Fire`||p===Qe?be:p===Ve||p===Ue||p===He||p===Ye?`Console`:p===we?`Wearable`:p?V:d?.userAgentDataPlatform===`Android`&&(d?.maxTouchPoints??0)>0?600>Math.min(d?.screenWidth??0,d?.screenHeight??0)/(d?.devicePixelRatio??1)?V:be:`Desktop`),$timezone:ui(),$timezone_offset:di()}),{$current_url:Yr(i?.href,m,ei),$host:i?.host,$pathname:i?.pathname,$raw_user_agent:l.length>1e3?l.substring(0,997)+`...`:l,$browser_version:gt(l,navigator.vendor,_),$browser_language:ai(),$browser_language_prefix:(c=ai(),typeof c==`string`?c.split(`-`)[0]:void 0),$screen_height:e?.screen.height,$screen_width:e?.screen.width,$viewport_height:e?.innerHeight,$viewport_width:e?.innerWidth,$lib:f.LIB_NAME,$lib_version:f.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return f.SDK_DIST_CHANNEL&&(v.$sdk_dist_channel=f.SDK_DIST_CHANNEL),v}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:g,windowId:_}=this.sessionManager.checkAndGetSessionAndWindowId(s,a.getTime());u.$session_id=g,u.$window_id=_}this.sessionPropsManager&&K(u,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&K(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=this.Xi?.length}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===ka&&(u.$lib_custom_api_host=this.config.api_host),p=t!==cr||s?t!==lr||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(a):this.pageViewManager.doPageView(a,o),u=K(u,p),t===cr&&r&&(u.title=r.title),!P(c)){var v=a.getTime()-c;u.$duration=parseFloat((v/1e3).toFixed(3))}l&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?`bot`:`browser`),(u=K({},m,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this._isIdentified(),A(this.config.property_denylist)?G(this.config.property_denylist,(function(e){delete u[e]})):U.error(Ka+this.config.property_denylist+` or property_blacklist config: `+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(U.error(Ga),u=y(u,t));var b=this.fn();return u.$process_person_profile=b,b&&!s&&this.pn(`_calculate_event_properties`),u}dn(e,t,n){if(t===void 0&&(t=!0),n===void 0&&(n=!1),!this.persistence||!this.fn()||this.Hi&&!n)return e;var r=K({},this.persistence.get_initial_props(),this.sessionPropsManager?.getSetOnceProps()||{},e||{}),i=this.config.sanitize_properties;return i&&(U.error(Ga),r=i(r,`$set_once`)),t&&(this.Hi=!0),N(r)?void 0:r}register(e,t){var n;(n=this.persistence)==null||n.register(e,t)}register_once(e,t,n){var r;(r=this.persistence)==null||r.register_once(e,t,n)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}gn(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags?.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags?.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags?.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){return this.featureFlags?.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,t,n){var r;(r=this.featureFlags)==null||r.updateFlags(e,t,n)}updateEarlyAccessFeatureEnrollment(e,t,n){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,t,n)}getEarlyAccessFeatures(e,t,n){return t===void 0&&(t=!1),this.featureFlags?.getEarlyAccessFeatures(e,t,n)}on(e,t){return this.Ui.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Wa}),()=>{})}onSessionId(e){return this.sessionManager?.onSessionId(e)??(()=>{})}getSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:Wa})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Wa})}renderSurvey(e,t){var n;(n=this.surveys)==null||n.renderSurvey(e,t)}displaySurvey(e,t){var n;t===void 0&&(t=Fa),(n=this.surveys)==null||n.displaySurvey(e,t)}cancelPendingSurvey(e){var t;(t=this.surveys)==null||t.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys?.canRenderSurvey(e)??{visible:!1,disabledReason:Wa}}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys?.canRenderSurveyAsync(e,t)??Promise.resolve({visible:!1,disabledReason:Wa})}mn(e){return!e||ie(e)?(U.critical(`Unique user id has not been set in posthog.identify`),!1):e===Xn?(U.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):![`distinct_id`,`distinctid`].includes(e.toLowerCase())&&![`undefined`,`null`].includes(e.toLowerCase())||(U.critical(`The string "`+e+`" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,t,n){if(!this.__loaded||!this.persistence)return U.uninitializedWarning(`posthog.identify`);if(R(e)&&(e=e.toString(),U.warn(`The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.`)),this.mn(e)&&this.pn(`posthog.identify`)){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(on)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},``),e!==r&&e!==this.get_property(sn)&&(this.unregister(sn),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(Hn)||rr)===rr;e!==r&&a?(this.persistence.set_property(Hn,ir),this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!1),this.capture(ur,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.Wi=Ta(e,t,n),(i=this.featureFlags)==null||i.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(Rn))}}setPersonProperties(e,t){if((e||t)&&this.pn(`posthog.setPersonProperties`)){var n=Ta(this.get_distinct_id(),e,t);this.Wi===n?U.info(`A duplicate setPersonProperties call was made with the same properties. It has been ignored.`):(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture(`$set`,{$set:e||{},$set_once:t||{}}),this.Wi=n)}}group(e,t,n){if(e&&t){var r=this.getGroups(),i=r[e]!==t;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:h({},r,{[e]:t})}),i||n){var a={$group_type:e,$group_key:t};n&&(a.$group_set=n),this.capture(dr,a)}n&&this.setGroupPropertiesForFlags({[e]:n}),i&&!n&&this.reloadFeatureFlags()}else U.error(`posthog.group requires a group type and group key`)}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),(n=this.featureFlags)==null||n.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){var e;(e=this.featureFlags)==null||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var n;t===void 0&&(t=!0),this.pn(`posthog.setGroupPropertiesForFlags`)&&((n=this.featureFlags)==null||n.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.featureFlags)==null||t.resetGroupPropertiesForFlags(e)}reset(e){var t,n,r,i,a,o,s,c;if(U.info(`reset`),!this.__loaded)return U.uninitializedWarning(`posthog.reset`);var l,u=this.get_property(on),d=this.get_property(vn);if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(n=this.sessionPersistence)==null||n.clear(),P(d)||(l=this.persistence)==null||l.register({[vn]:d}),(r=this.surveys)==null||r.reset(),(i=this.ln)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.conversations)==null||o.reset(),(s=this.persistence)==null||s.set_property(Hn,rr),(c=this.sessionManager)==null||c.resetSessionId(),this.Wi=null,this.config.cookieless_mode===nr)this.register_once({distinct_id:Xn,$device_id:null},``);else{var f=this.config.get_device_id(Tr());this.register_once({distinct_id:f,$device_id:e?f:u},``)}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var n;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),(n=this.conversations)==null||n.yn()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.bn()}get_distinct_id(){return this.get_property(`distinct_id`)}getGroups(){return this.get_property(`$groups`)||{}}get_session_id(){return this.sessionManager?.checkAndGetSessionAndWindowId(!0).sessionId??``}get_session_replay_url(e){if(!this.sessionManager)return``;var{sessionId:t,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor(`ui`,`/project/`+this.config.token+`/replay/`+t);if(e!=null&&e.withTimestamp&&n){var i=e.timestampLookBack??10;if(!n)return r;r+=`?t=`+Math.max(Math.floor((new Date().getTime()-n)/1e3)-i,0)}return r}alias(e,t){return e===this.get_property(an)?(U.critical(`Attempting to create alias for existing People user - aborting.`),-2):this.pn(`posthog.alias`)?(P(t)&&(t=this.get_distinct_id()),e===t?(U.warn(`alias matches current distinct_id - skipping api call.`),this.identify(e),-1):(this.gn(sn,e),this.capture(`$create_alias`,{alias:e,distinct_id:t}))):void 0}set_config(e){var t=h({},this.config);if(M(e)){var n,r,i,a,o,s,c,l,u,d,p;K(this.config,Za(e));var m=this.Ji();(n=this.persistence)==null||n.update_config(this.config,t,m),this.sessionPersistence=this.config.persistence===`sessionStorage`||this.config.persistence===`memory`?this.persistence:new pi(h({},this.config,{persistence:`sessionStorage`}),m);var g=this.Zi(this.config.debug);B(g)&&(this.config.debug=g),B(this.config.debug)&&(this.config.debug?(f.DEBUG=!0,J.O()&&J.N(`ph_debug`,!0),U.info(`set_config`,{config:e,oldConfig:t,newConfig:h({},this.config)})):(f.DEBUG=!1,J.O()&&J.q(`ph_debug`))),(r=this.exceptionObserver)==null||r.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(o=this.tracingHeaders)==null||o.startIfEnabledOrStop(),(s=this.autocapture)==null||s.startIfEnabled(),(c=this.heatmaps)==null||c.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),(d=this.surveys)==null||d.loadIfEnabled(),this._n(),(p=this.externalIntegrations)==null||p.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){f.LIB_NAME=e,f.LIB_VERSION=t}startSessionRecording(e){var t,n,r,i,a,o=!0===e,s={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(s).some(Boolean)&&((t=this.sessionManager)==null||t.checkAndGetSessionAndWindowId(),s.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),s.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),s.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger(`url`)),s.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger(`event`))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){if(this.exceptions){var n=Error(`PostHog syntheticException`),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(h({},r,t))}}addExceptionStep(e,t){var n;(n=this.exceptions)==null||n.addExceptionStep(e,t)}captureLog(e){var t;(t=this.logs)==null||t.captureLog(e)}get logger(){return this.logs?.logger??t.wn}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t;return(t=this.toolbar?.loadToolbar(e))!=null&&t}get_property(e){return this.persistence?.props[e]}getSessionProperty(e){return this.sessionPersistence?.props[e]}toString(){var e=this.config.name??qa;return e!==qa&&(e=qa+`.`+e),e}_isIdentified(){return this.persistence?.get_property(Hn)===ir||this.sessionPersistence?.get_property(Hn)===ir}fn(){var e,t;return!(this.config.person_profiles===`never`||this.config.person_profiles===ar&&!this._isIdentified()&&N(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[sn])&&((t=this.persistence)==null||(t=t.props)==null||!t[Jn]))}hn(){return!0===this.config.capture_pageleave||this.config.capture_pageleave===`if_capture_pageview`&&(!0===this.config.capture_pageview||this.config.capture_pageview===`history_change`)}createPersonProfile(){this.fn()||this.pn(`posthog.createPersonProfile`)&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.pn(`posthog.setInternalOrTestUser`)&&this.setPersonProperties({$internal_or_test_user:!0})}pn(e){return this.config.person_profiles===`never`?(U.error(e+` was called, but process_person is set to "never". This call will be ignored.`),!1):(this.gn(Jn,!0),!0)}Ji(){if(this.config.cookieless_mode===`always`)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==tr)}_n(){var e,t,n=this.Ji();return this.persistence?.wr!==n&&((e=this.persistence)==null||e.set_disabled(n)),this.sessionPersistence?.wr!==n&&((t=this.sessionPersistence)==null||t.set_disabled(n)),n}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==nr){if(this.ji()){var r,i;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new Sa(this),this.pageViewManager=new Wr(this),this.persistence&&(this.sessionPropsManager=new ya(this,this.sessionManager,this.persistence));var a,o=this.config.__extensionClasses?.sessionRecording??t.__defaultExtensionClasses?.sessionRecording;o&&(this.sessionRecording=this.$i(this.sessionRecording,new o(this)),this.sn&&((a=this.sessionRecording)==null||a.onRemoteConfig==null||a.onRemoteConfig(this.sn)))}var s;this.consent.optInOut(!0),this._n(),this.an(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==tr&&((s=this.surveys)==null||s.loadIfEnabled()),(P(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture(e?.captureEventName??`$opt_in`,e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.un()}else U.warn(Ua)}opt_out_capturing(){var e,t,n;this.config.cookieless_mode===nr?U.warn(Ua):(this.config.cookieless_mode===tr&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._n(),this.config.cookieless_mode===tr&&(this.register({distinct_id:Xn,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.un(),this.an()))}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?`granted`:e===0?`denied`:`pending`}is_capturing(){return this.config.cookieless_mode===nr||(this.config.cookieless_mode===tr?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._n()}_is_bot(){return n?Ca(n,this.config.custom_blocked_useragents):void 0}un(){r&&(r.visibilityState===`visible`?this.Bi||(this.Bi=!0,this.capture(cr,{title:r.title},{send_instantly:!0}),this.zi&&=(r.removeEventListener(or,this.zi),null)):this.zi||(this.zi=this.un.bind(this),q(r,or,this.zi)))}debug(t){!1===t?(e?.console.log(`You've disabled debug mode.`),this.set_config({debug:!1})):(e?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Dr(){var e,t,n,r,i,a,o=this.Gi||{};return`advanced_disable_flags`in o?!!o.advanced_disable_flags:!1===this.config.advanced_disable_flags?!0===this.config.advanced_disable_decide?(U.warn(`Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version.`),!0):(n=`advanced_disable_decide`,r=U,i=(t=`advanced_disable_flags`)in(e=o)&&!L(e[t]),a=n in e&&!L(e[n]),i?e[t]:!!a&&(r&&r.warn(`Config field '`+n+`' is deprecated. Please use '`+t+`' instead. The old field will be removed in a future major version.`),e[n])):!!this.config.advanced_disable_flags}vn(e){if(L(this.config.before_send))return e;var t=A(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var r of t){if(n=r(n),L(n)){var i=`Event '`+e.event+`' was rejected in beforeSend function`;return oe(e.event)?U.warn(i+`. This can cause unexpected behavior.`):U.info(i),null}n.properties&&!N(n.properties)||U.warn(`Event '`+e.event+`' has no properties after beforeSend function, this is likely an error.`)}return n}getPageViewId(){return this.pageViewManager.dr?.pageViewId}captureTraceFeedback(e,t){this.capture(`$ai_feedback`,{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,n){this.capture(`$ai_metric`,{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(n)})}Zi(e){var t=B(e)&&!e,n=J.O()&&J.A(`ph_debug`)===`true`;return!t&&(!!n||e)}};$a.__defaultExtensionClasses={},$a.wn={trace:za=()=>{},debug:za,info:za,warn:za,error:za,fatal:za},function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=hr(e.prototype[t[n]])}($a,[`identify`]);var eo=1,to=3,no=11;function ro(e){return e instanceof Element&&(e.id===Yn||!(e.closest==null||!e.closest(`.toolbar-global-fade-container`)))}function io(e){return!!e&&e.nodeType===eo}function ao(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function oo(e){return!!e&&e.nodeType===to}function so(e){return!!e&&e.nodeType===no&&io(e.host)}function co(e){return e?D(e).split(/\s+/):[]}function lo(t){var n=e?.location.href;return!!(n&&t&&t.some((e=>n.match(e))))}function uo(e){var t=``;switch(typeof e.className){case`string`:t=e.className;break;case`object`:t=(e.className&&`baseVal`in e.className?e.className.baseVal:null)||e.getAttribute(`class`)||``;break;default:t=``}return co(t)}function fo(e){return L(e)?null:D(e).split(/(\s+)/).filter((e=>Ao(e))).join(``).replace(/[\r\n]/g,` `).replace(/[ ]+/g,` `).substring(0,255)}function po(e){var t=``;return So(e)&&!Co(e)&&e.childNodes&&e.childNodes.length&&G(e.childNodes,(function(e){oo(e)&&e.textContent&&(t+=fo(e.textContent)??``)})),D(t)}function mo(e){return P(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var ho=[`a`,`button`,`form`,`input`,`select`,`textarea`,`label`];function go(e,t){if(P(t))return!0;var n,r=function(e){if(t.some((t=>e.matches(t))))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function _o(e){var t=e.parentNode;return!(!t||!io(t))&&t}var vo=[`next`,`previous`,`prev`,`>`,`<`],yo=[`.ph-no-rageclick`,`.ph-no-capture`],bo=e=>!e||ao(e,`html`)||!io(e),xo=(t,n)=>{if(!e||bo(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,i=[t],a=t;a.parentNode&&!ao(a,`body`);)if(so(a.parentNode))i.push(a.parentNode.host),a=a.parentNode.host;else{var o=_o(a);if(!o)break;if(n||ho.indexOf(o.tagName.toLowerCase())>-1)r=!0;else{var s=e.getComputedStyle(o);s&&s.getPropertyValue(`cursor`)===`pointer`&&(r=!0)}i.push(o),a=o}return{parentIsUsefulElement:r,targetElementList:i}};function So(e){for(var t=e;t.parentNode&&!ao(t,`body`);t=t.parentNode){var n=uo(t);if(E(n,`ph-sensitive`)||E(n,`ph-no-capture`))return!1}if(E(uo(e),`ph-include`))return!0;var r=e.type||``;if(F(r))switch(r.toLowerCase()){case`hidden`:case`password`:return!1}var i=e.name||e.id||``;return!F(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,``))}function Co(e){return!!(ao(e,`input`)&&![`button`,`checkbox`,`submit`,`reset`].includes(e.type)||ao(e,`select`)||ao(e,`textarea`)||e.getAttribute(`contenteditable`)===`true`)}var wo=`(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})`,To=RegExp(`^(?:`+wo+`)$`),Eo=new RegExp(wo),Do=`\\d{3}-?\\d{2}-?\\d{4}`,Oo=RegExp(`^(`+Do+`)$`),ko=RegExp(`(`+Do+`)`);function Ao(e,t){return t===void 0&&(t=!0),!(L(e)||F(e)&&(e=D(e),(t?To:Eo).test((e||``).replace(/[- ]/g,``))||(t?Oo:ko).test(e)))}function jo(e){var t=po(e);return Ao(t=(t+` `+Mo(e)).trim())?t:``}function Mo(e){var t=``;return e&&e.childNodes&&e.childNodes.length&&G(e.childNodes,(function(e){if(e&&e.tagName?.toLowerCase()===`span`)try{var n=po(e);t=(t+` `+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+` `+Mo(e)).trim())}catch(e){U.error(`[AutoCapture]`,e)}})),t}function No(e){return e.replace(/"|\\"/g,`\\"`)}function Po(e){var t=e.attr__class;return t?A(t)?t:co(t):void 0}var Fo=class{constructor(e){this.disabled=!1===e;var t=M(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,n){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>n-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:n}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}},Io=`$copy_autocapture`,Lo=W(`[AutoCapture]`);function Ro(e,t){return t.length>e?t.slice(0,e)+`...`:t}function zo(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!io(t));return t}function Bo(t,n){var r,{e:i,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:s,elementsChainAsString:c}=n;if(!io(t))return{props:{}};for(var l=[t],u=t;u.parentNode&&!ao(u,`body`);)if(so(u.parentNode))l.push(u.parentNode.host),u=u.parentNode.host;else{if(!io(u.parentNode))break;l.push(u.parentNode),u=u.parentNode}var d,f,p=[],m={},g=!1,_=!1;if(G(l,(e=>{var t=So(e);if(ao(e,`a`)){var n=e.getAttribute(`href`);g=t&&!!n&&Ao(n)&&n}E(uo(e),`ph-no-capture`)&&(_=!0),p.push(function(e,t,n,r){var i=e.tagName.toLowerCase(),a={tag_name:i};ho.indexOf(i)>-1&&!n&&(a.$el_text=i.toLowerCase()===`a`||i.toLowerCase()===`button`?Ro(1024,jo(e)):Ro(1024,po(e)));var o=uo(e);o.length>0&&(a.classes=o.filter((function(e){return e!==``}))),G(e.attributes,(function(n){var i;if((!Co(e)||[`name`,`id`,`class`,`aria-label`].indexOf(n.name)!==-1)&&(r==null||!r.includes(n.name))&&!t&&Ao(n.value)&&(!F(i=n.name)||i.substring(0,10)!==`_ngcontent`&&i.substring(0,7)!==`_nghost`)){var o=n.value;n.name===`class`&&(o=co(o).join(` `)),a[`attr__`+n.name]=Ro(1024,o)}}));for(var s=1,c=1,l=e;l=zo(l);)s++,l.tagName===e.tagName&&c++;return a.nth_child=s,a.nth_of_type=c,a}(e,a,o,s)),K(m,function(e){if(!So(e))return{};var t={};return G(e.attributes,(function(e){if(e.name&&e.name.indexOf(`data-ph-capture-attribute`)===0){var n=e.name.replace(`data-ph-capture-attribute-`,``),r=e.value;n&&r&&Ao(r)&&(t[n]=r)}})),t}(e))})),_)return{props:{},explicitNoCapture:_};if(o||(p[0].$el_text=ao(t,`a`)||ao(t,`button`)?jo(t):po(t)),g){var v;p[0].attr__href=g;var y=qr(g)?.host,b=e==null||(v=e.location)==null?void 0:v.host;y&&b&&y!==b&&(d=g)}return{props:K({$event_type:i.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:(f=p,function(e){return e.map((e=>{var t=``;if(e.tag_name&&(t+=e.tag_name),e.attr_class)for(var n of(e.attr_class.sort(),e.attr_class))t+=`.`+n.replace(/"/g,``);var r=h({},e.text?{text:e.text}:{},{"nth-child":e.nth_child??0,"nth-of-type":e.nth_of_type??0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),i={};return pr(r).sort(((e,t)=>{var[n]=e,[r]=t;return n.localeCompare(r)})).forEach((e=>{var[t,n]=e;return i[No(t.toString())]=No(n.toString())})),(t+=`:`)+pr(i).map((e=>{var[t,n]=e;return t+`="`+n+`"`})).join(``)})).join(`;`)}(function(e){return e.map((e=>{var t={text:e.$el_text?.slice(0,400),tag_name:e.tag_name,href:e.attr__href?.slice(0,2048),attr_class:Po(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return pr(e).filter((e=>{var[t]=e;return t.indexOf(`attr__`)===0})).forEach((e=>{var[n,r]=e;return t.attributes[n]=r})),t}))}(f)))},(r=p[0])!=null&&r.$el_text?{$el_text:p[0]?.$el_text}:{},d&&i.type===`click`?{$external_click_url:d}:{},m)}}var Vo=W(`[ExceptionAutocapture]`);function Ho(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return j(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]===i&&(e[t]=r)}}catch{return()=>{}}}var Uo=W(`[TracingHeaders]`),Wo=W(`[Web Vitals]`),Go=9e5,Ko=`disabled`,qo=`lazy_loading`,Jo=`awaiting_config`,Yo=`missing_config`;W(`[SessionRecording]`),W(`[SessionRecording]`);var Xo=`[SessionRecording]`,Zo=W(Xo),Qo=W(`[Heatmaps]`);function $o(e){return M(e)&&`clientX`in e&&`clientY`in e&&R(e.clientX)&&R(e.clientY)}var es=W(`[Product Tours]`),ts=[`$set_once`,`$set`],ns=W(`[SiteApps]`),rs=`Error while initializing PostHog app with config id `;function is(e,t,n){if(L(e))return!1;switch(n){case`exact`:return e===t;case`contains`:var r=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/_/g,`.`).replace(/%/g,`.*`);return new RegExp(r,`i`).test(e);case`regex`:try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var as=class{constructor(e){this.xn=new ba,this.Sn=(e,t)=>this.kn(e,t)&&this.Cn(e,t)&&this.In(e,t)&&this.Tn(e,t),this.kn=(e,t)=>t==null||!t.event||e?.event===t?.event,this._instance=e,this.En=new Set,this.Mn=new Set}init(){var e;P(this._instance?._addCaptureHook)||(e=this._instance)==null||e._addCaptureHook(((e,t)=>{this.on(e,t)}))}register(e){var t;if(!P(this._instance?._addCaptureHook)&&(e.forEach((e=>{var t,n;(t=this.Mn)==null||t.add(e),(n=e.steps)==null||n.forEach((e=>{var t;(t=this.En)==null||t.add(e?.event||``)}))})),(t=this._instance)!=null&&t.autocapture)){var n,r=new Set;e.forEach((e=>{var t;(t=e.steps)==null||t.forEach((e=>{e!=null&&e.selector&&r.add(e?.selector)}))})),(n=this._instance)==null||n.autocapture.setElementSelectors(r)}}on(e,t){t!=null&&e.length!=0&&(this.En.has(e)||this.En.has(t?.event))&&this.Mn&&this.Mn?.size>0&&this.Mn.forEach((e=>{this.Rn(t,e)&&this.xn.emit(`actionCaptured`,e.name)}))}Pn(e){this.onAction(`actionCaptured`,(t=>e(t)))}Rn(e,t){if(t?.steps==null)return!1;for(var n of t.steps)if(this.Sn(e,n))return!0;return!1}onAction(e,t){return this.xn.on(e,t)}Cn(e,t){if(t!=null&&t.url){var n,r=e==null||(n=e.properties)==null?void 0:n.$current_url;if(!r||typeof r!=`string`||!is(r,t.url,t.url_matching||`contains`))return!1}return!0}In(e,t){return!!this.On(e,t)&&!!this.Ln(e,t)&&!!this.Fn(e,t)}On(e,t){var n;if(t==null||!t.href)return!0;var r=this.An(e);if(r.length>0)return r.some((e=>is(e.href,t.href,t.href_matching||`exact`)));var i,a=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!a&&is((i=a.match(/(?::|")href="(.*?)"/))?i[1]:``,t.href,t.href_matching||`exact`)}Ln(e,t){var n;if(t==null||!t.text)return!0;var r=this.An(e);if(r.length>0)return r.some((e=>is(e.text,t.text,t.text_matching||`exact`)||is(e.$el_text,t.text,t.text_matching||`exact`)));var i,a,o,s=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||``;return!!s&&(i=function(e){for(var t,n=[],r=/(?::|")text="(.*?)"/g;!L(t=r.exec(e));)n.includes(t[1])||n.push(t[1]);return n}(s),a=t.text,o=t.text_matching||`exact`,i.some((e=>is(e,a,o))))}Fn(e,t){var n,r;if(t==null||!t.selector)return!0;var i=e==null||(n=e.properties)==null?void 0:n.$element_selectors;if(i!=null&&i.includes(t.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||``;if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}An(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}Tn(e,t){return t==null||!t.properties||t.properties.length===0||Oa(t.properties.reduce(((e,t)=>{var n=A(t.value)?t.value.map(String):t.value==null?[]:[String(t.value)];return e[t.key]={values:n,operator:t.operator||`exact`},e}),{}),e?.properties)}},os=class{constructor(e){this._instance=e,this.Nn=new Map,this.Dn=new Map,this.$n=new Map}qn(e,t){return!!e&&Oa(e.propertyFilters,t?.properties)}jn(e,t){var n=new Map;return e.forEach((e=>{var r;(r=e.conditions)==null||(r=r[t])==null||(r=r.values)==null||r.forEach((t=>{if(t!=null&&t.name){var r=n.get(t.name)||[];r.push(e.id),n.set(t.name,r)}}))})),n}Hn(e,t,n){var r=(n===mi.Activation?this.Nn:this.Dn).get(e),i=[];return this.Un((e=>{i=e.filter((e=>r?.includes(e.id)))})),i.filter((r=>{var i,a=(i=r.conditions)==null||(i=i[n])==null||(i=i.values)==null?void 0:i.find((t=>t.name===e));return this.qn(a,t)}))}register(e){P(this._instance?._addCaptureHook)||(this.Bn(e),this.zn(e))}zn(e){var t=e.filter((e=>{var t;return e.conditions?.actions&&((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null?void 0:t.length)>0}));t.length!==0&&(this.Vn??(this.Vn=new as(this._instance),this.Vn.init(),this.Vn.Pn((e=>{this.onAction(e)}))),t.forEach((e=>{var t,n,r,i,a;e.conditions&&(t=e.conditions)!=null&&t.actions&&(n=e.conditions)!=null&&(n=n.actions)!=null&&n.values&&((r=e.conditions)==null||(r=r.actions)==null||(r=r.values)==null?void 0:r.length)>0&&((i=this.Vn)==null||i.register(e.conditions.actions.values),(a=e.conditions)==null||(a=a.actions)==null||(a=a.values)==null||a.forEach((t=>{if(t&&t.name){var n=this.$n.get(t.name);n&&n.push(e.id),this.$n.set(t.name,n||[e.id])}})))})))}Bn(e){var t,n=e.filter((e=>{var t;return e.conditions?.events&&((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null?void 0:t.length)>0})),r=e.filter((e=>{var t;return e.conditions?.cancelEvents&&((t=e.conditions)==null||(t=t.cancelEvents)==null||(t=t.values)==null?void 0:t.length)>0}));n.length===0&&r.length===0||((t=this._instance)==null||t._addCaptureHook(((e,t)=>{this.onEvent(e,t)})),this.Nn=this.jn(e,mi.Activation),this.Dn=this.jn(e,mi.Cancellation))}onEvent(e,t){var n,r=this.le(),i=this.Wn(),a=this.Zn(),o=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[i])||[];if(a===e&&t&&o.length>0){var s,c;r.info(`event matched, removing item from activated items`,{event:e,eventPayload:t,existingActivatedItems:o});var l=(t==null||(s=t.properties)==null?void 0:s.$survey_id)||(t==null||(c=t.properties)==null?void 0:c.$product_tour_id);if(l){var u=o.indexOf(l);0>u||(o.splice(u,1),this.Gn(o))}}else{if(this.Dn.has(e)){var d=this.Hn(e,t,mi.Cancellation);d.length>0&&(r.info(`cancel event matched, cancelling items`,{event:e,itemsToCancel:d.map((e=>e.id))}),d.forEach((e=>{var t=o.indexOf(e.id);0>t||o.splice(t,1),this.Qn(e.id)})),this.Gn(o))}if(this.Nn.has(e)){r.info(`event name matched`,{event:e,eventPayload:t,items:this.Nn.get(e)});var f=this.Hn(e,t,mi.Activation);this.Gn(o.concat(f.map((e=>e.id))||[]))}}}onAction(e){var t,n=this.Wn(),r=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[];this.$n.has(e)&&this.Gn(r.concat(this.$n.get(e)||[]))}Gn(e){var t=this.le(),n=[...new Set(e)].filter((e=>!this.Jn(e)));t.info(`updating activated items`,{activatedItems:n}),this.Kn(n)}getActivatedIds(){var e,t=this.Wn();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Nn}Yn(){return this.Vn}},ss=class extends os{constructor(e){super(e)}Wn(){return In}Zn(){return gi.SHOWN}Un(e){var t;(t=this._instance)==null||t.getSurveys(e)}Qn(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}le(){return Q}Kn(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[In]:e})}Jn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},cs=`SDK is not enabled or survey functionality is not yet loaded`,ls=`Disabled. Not loading surveys.`,us=e!=null&&e.location?Xr(e.location.hash,`__posthog`)||Xr(location.hash,`state`):null,ds=`_postHogToolbarParams`,fs=W(`[Toolbar]`),$=W(`[FeatureFlags]`),ps=W(`[FeatureFlags]`,{debugEnabled:!0}),ms=`" failed. Feature flags didn't load in time.`,hs=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},gs=e=>{var t={};for(var[n,r]of pr(e||{}))r&&(t[n]=r);return t},_s=W(`[Error tracking]`),vs=`Refusing to render web experiment since the viewer is a likely bot`,ys={icontains:(t,n)=>!!e&&n.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,n)=>!!e&&n.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,n)=>!!e&&wa(n.href,t),not_regex:(t,n)=>!!e&&!wa(n.href,t),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e},bs=class t{get qt(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){e===void 0&&(e=!1),n.getWebExperiments((e=>{t.Xn(`retrieved web experiments from the server`),n.es=new Map,e.forEach((e=>{if(e.feature_flag_key){var r;n.es&&(t.Xn(`setting flag key `,e.feature_flag_key,` to web experiment `,e),(r=n.es)==null||r.set(e.feature_flag_key,e));var i=n._instance.getFeatureFlag(e.feature_flag_key);F(i)&&e.variants[i]&&n.ts(e.name,i,e.variants[i].transforms)}else if(e.variants)for(var a in e.variants){var o=e.variants[a];t.rs(o)&&n.ts(e.name,a,o.transforms)}}))}),e)},this._instance=e,this._instance.onFeatureFlags((e=>{this.onFeatureFlags(e)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())t.Xn(vs);else if(!this.qt.disable_web_experiments){if(L(this.es))return this.es=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.Xn(`applying feature flags`,e),e.forEach((e=>{var t;if(this.es&&(t=this.es)!=null&&t.has(e)){var n=this._instance.getFeatureFlag(e),r=this.es?.get(e);n&&r!=null&&r.variants[n]&&this.ts(r.name,n,r.variants[n].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=Jr(e?.search,`__experiment_id`),r=Jr(e?.search,`__experiment_variant`);n&&r&&(t.Xn(`previewing web experiments `+n+` && `+r),this.getWebExperiments((e=>{this.ns(parseInt(n),r,e)}),!1,!0))}}loadIfEnabled(){this.qt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,n){if(this.qt.disable_web_experiments&&!n)return e([]);var r=this._instance.get_property(`$web_experiments`);if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/web_experiments/?token=`+this.qt.token),method:`GET`,callback:t=>e(t.statusCode===200&&t.json&&t.json.experiments||[])})}ns(e,n,r){var i=r.filter((t=>t.id===e));i&&i.length>0&&(t.Xn(`Previewing web experiment [`+i[0].name+`] with variant [`+n+`]`),this.ts(i[0].name,n,i[0].variants[n].transforms))}static rs(e){return!L(e.conditions)&&t.ss(e)&&t.os(e)}static ss(e){if(L(e.conditions)||L(e.conditions?.url))return!0;var n,r=t.getWindowLocation();return!!r&&((n=e.conditions)==null||!n.url||ys[e.conditions?.urlMatchType??`icontains`](e.conditions.url,r))}static getWindowLocation(){return e?.location}static os(e){if(L(e.conditions)||L(e.conditions?.utm))return!0;var t=ni();if(t.utm_source){var n,r,i,a,o,s,c,l,u=(n=e.conditions)==null||(n=n.utm)==null||!n.utm_campaign||((r=e.conditions)==null||(r=r.utm)==null?void 0:r.utm_campaign)==t.utm_campaign,d=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==t.utm_source,f=(o=e.conditions)==null||(o=o.utm)==null||!o.utm_medium||((s=e.conditions)==null||(s=s.utm)==null?void 0:s.utm_medium)==t.utm_medium,p=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_term)==t.utm_term;return u&&f&&p&&d}return!1}static Xn(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];U.info(`[WebExperiments] `+e,n)}ts(e,n,r){this._is_bot()?t.Xn(vs):n===`control`?t.Xn(`Control variants leave the page unmodified.`):r.forEach((r=>{r.selector&&(t.Xn(`applying transform of variant `+n+` for experiment `+e+` `,r),(document?.querySelectorAll(r.selector))?.forEach((e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute(`style`,r.css)})))}))}_is_bot(){return n&&this._instance?Ca(n,this.qt.custom_blocked_useragents):void 0}},xs=W(`[Conversations]`),Ss=`Conversations not available yet.`,Cs={featureFlags:class{constructor(e){this.us=!1,this.ls=!1,this.hs=!1,this.cs=!1,this.ds=!1,this.vs=!1,this.fs=!1,this.ps=!1,this._instance=e,this.featureFlagEventHandlers=[]}get qt(){return this._instance.config}get ui(){return this._instance.persistence}gs(e){return this._instance.get_property(e)}ys(){var e;return(e=this.ui?.Sr(this.qt.feature_flag_cache_ttl_ms))!=null&&e}bs(){return!!this.ys()&&(this.ps||this.hs||(this.ps=!0,$.warn(`Feature flag cache is stale, triggering refresh...`),this.reloadFeatureFlags()),!0)}_s(){var e=this.qt.evaluation_contexts??this.qt.evaluation_environments;return!this.qt.evaluation_environments||this.qt.evaluation_contexts||this.fs||($.warn(`evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version.`),this.fs=!0),e!=null&&e.length?e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||$.error(`Invalid evaluation context found:`,e,`Expected non-empty string`),t})):[]}ws(){return this._s().length>0}xs(){var e=this.qt.flag_keys;if(!P(e)){if(A(e))return e.filter((e=>{var t=e&&typeof e==`string`&&e.trim().length>0;return t||$.error(`Invalid flag key found:`,e,`Expected non-empty string`),t}));$.error(`Invalid flag_keys found:`,e,`Expected array of non-empty strings`)}}initialize(){var{config:e}=this._instance,t=e.bootstrap?.featureFlags??{};if(Object.keys(t).length){var n=e.bootstrap?.featureFlagPayloads??{},r=Object.keys(t).filter((e=>!!t[e])).reduce(((e,n)=>(e[n]=t[n]||!1,e)),{}),i=Object.keys(n).filter((e=>r[e])).reduce(((e,t)=>(n[t]&&(e[t]=n[t]),e)),{});this.receivedFeatureFlags({featureFlags:r,featureFlagPayloads:i})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},i=n!=null&&n.merge?this.getFlagPayloads():{},a=h({},r,e),o=h({},i,t),s={};for(var[c,l]of Object.entries(a)){var u=typeof l==`string`;s[c]={key:c,enabled:!!u||!!l,variant:u?l:void 0,reason:void 0,metadata:P(o?.[c])?void 0:{id:0,version:void 0,description:void 0,payload:o[c]}}}this.receivedFeatureFlags({flags:s})}get hasLoadedFlags(){return this.ls}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.gs(On),t=this.gs(jn),n=this.gs(Mn);if(!n&&!t)return e||{};var r=K({},e||{});for(var i of[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])]){var a,o,s=r[i],c=t?.[i],l=P(c)?(a=s?.enabled)!=null&&a:!!c,u=P(c)?s.variant:typeof c==`string`?c:void 0,d=n?.[i],f=h({},s,{enabled:l,variant:l?u??s?.variant:void 0});l!==s?.enabled&&(f.original_enabled=s?.enabled),u!==s?.variant&&(f.original_variant=s?.variant),d&&(f.metadata=h({},s?.metadata,{payload:d,original_payload:s==null||(o=s.metadata)==null?void 0:o.payload})),r[i]=f}return this.us||=($.warn(` Overriding feature flag details!`,{flagDetails:e,overriddenPayloads:n,finalDetails:r}),!0),r}getFlagVariants(){var e=this.gs(Tn),t=this.gs(jn);if(!t)return e||{};for(var n=K({},e),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.us||=($.warn(` Overriding feature flags!`,{enabledFlags:e,overriddenFlags:t,finalFlags:n}),!0),n}getFlagPayloads(){var e=this.gs(kn),t=this.gs(Mn);if(!t)return e||{};for(var n=K({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.us||=($.warn(` Overriding feature flag payloads!`,{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),!0),n}reloadFeatureFlags(){this.cs||this.qt.advanced_disable_feature_flags||this.Ss||(this._instance.Ui.emit(`featureFlagsReloading`,!0),this.Ss=setTimeout((()=>{this.ks()}),5))}Cs(){clearTimeout(this.Ss),this.Ss=void 0}ensureFlagsLoaded(){this.ls||this.hs||this.Ss||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.cs=e}ks(e){if(this.Cs(),!this._instance.Dr())if(this.hs)this.ds=!0;else{var t=this.qt.token,n=this.gs(on),r={token:t,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:h({},this.ui?.get_initial_props()||{},this.gs(Nn)||{}),group_properties:this.gs(Pn),timezone:ui()};I(n)||P(n)||(r.$device_id=n),(e!=null&&e.disableFlags||this.qt.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.ws()&&(r.evaluation_contexts=this._s());var i=this.xs();P(i)||(r.flag_keys=i);var a=!!this.qt.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`+(this.qt.advanced_only_evaluate_survey_feature_flags?`&only_evaluate_survey_feature_flags=true`:``));this.hs=!0,this._instance._send_request({method:`POST`,url:o,data:r,compression:this.qt.disable_compression?void 0:Ti.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback:e=>{var t,n,i,o=!0;if(e.statusCode===200&&(this.ds||(this.$anon_distinct_id=void 0),o=!1),this.hs=!1,!r.disable_flags||this.ds){this.vs=!o;var s=[];e.error?e.error instanceof Error?s.push(e.error.name===`AbortError`?`timeout`:`connection_error`):s.push(`unknown_error`):e.statusCode!==200&&s.push(`api_error_`+e.statusCode),(t=e.json)!=null&&t.errorsWhileComputingFlags&&s.push(`errors_while_computing_flags`);var c=!((n=e.json)==null||(n=n.quotaLimited)==null||!n.includes(`feature_flags`));c&&s.push(`quota_limited`),(i=this.ui)==null||i.register({[Bn]:s}),c?$.warn(`You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.`):(r.disable_flags||this.receivedFeatureFlags(e.json??{},o,{partialResponse:a}),this.ds&&(this.ds=!1,this.ks()))}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),!t.fresh||this.vs)if(this.ls||this.getFlags()&&this.getFlags().length>0){if(!this.bs()){var n=this.getFeatureFlagResult(e,t);return n?.variant??n?.enabled}}else $.warn(`getFeatureFlag for key "`+e+ms)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFeatureFlagResult(e,{send_event:!1})?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.vs)if(this.ls||this.getFlags()&&this.getFlags().length>0){if(!this.bs()){var n=this.getFlagVariants(),r=e in n,i=n[e],a=this.getFlagPayloads()[e],o=String(i),s=this.gs(An)||void 0,c=this.gs(Vn)||void 0,l=this.gs(Rn)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var u,d=this._instance.get_session_id(),f=this.gs(zn);d&&d!==f&&(l={},(u=this.ui)==null||u.register({[Rn]:l,[zn]:d}))}if((t.send_event||!(`send_event`in t))&&(!(e in l)||!l[e].includes(o))){var p,m,h,g,_,v,y,b;A(l[e])?l[e].push(o):l[e]=[o],(p=this.ui)==null||p.register({[Rn]:l});var x=this.getFeatureFlagDetails(e),S=[...this.gs(Bn)??[]];P(i)&&S.push(`flag_missing`);var C={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:a||null,$feature_flag_request_id:s,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((m=this.qt.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[e])||null,$feature_flag_bootstrapped_payload:((h=this.qt.bootstrap)==null||(h=h.featureFlagPayloads)==null?void 0:h[e])||null,$used_bootstrap_value:!this.vs};P(x==null||(g=x.metadata)==null?void 0:g.version)||(C.$feature_flag_version=x.metadata.version);var w,ee=(x==null||(_=x.reason)==null?void 0:_.description)??(x==null||(v=x.reason)==null?void 0:v.code);ee&&(C.$feature_flag_reason=ee),x!=null&&(y=x.metadata)!=null&&y.id&&(C.$feature_flag_id=x.metadata.id),P(x?.original_variant)&&P(x?.original_enabled)||(C.$feature_flag_original_response=P(x.original_variant)?x.original_enabled:x.original_variant),x!=null&&(b=x.metadata)!=null&&b.original_payload&&(C.$feature_flag_original_payload=x==null||(w=x.metadata)==null?void 0:w.original_payload),S.length&&(C.$feature_flag_error=S.join(`,`)),this._instance.capture(`$feature_flag_called`,C)}if(r){var T=a;if(!P(a))try{T=JSON.parse(a)}catch{}return{key:e,enabled:!!i,variant:typeof i==`string`?i:void 0,payload:T}}}}else $.warn(`getFeatureFlagResult for key "`+e+ms)}getRemoteConfigPayload(e,t){var n=this.qt.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.ws()&&(r.evaluation_contexts=this._s());var i=this.xs();P(i)||(r.flag_keys=i),this._instance._send_request({method:`POST`,url:this._instance.requestRouter.endpointFor(`flags`,`/flags/?v=2`),data:r,compression:this.qt.disable_compression?void 0:Ti.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback(n){var r=n.json?.featureFlagPayloads;t(r?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.vs){if(this.ls||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return P(n)?void 0:!!n}$.warn(`isFeatureEnabled for key "`+e+ms)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.ui){this.ls=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),a=this.getFlagsWithDetails();(function(e,t,n,r,i,a){n===void 0&&(n={}),r===void 0&&(r={}),i===void 0&&(i={});var o=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((e=>[e,t[e].variant??t[e].enabled]))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((e=>t[e].enabled)).filter((e=>t[e].metadata?.payload)).map((e=>[e,t[e].metadata?.payload])))):$.warn(`Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version`),e})(e),s=o.flags,c=o.featureFlags,l=o.featureFlagPayloads;if(c){var u=e.requestId,d=e.evaluatedAt;if(A(c)){$.warn(`v1 of the feature flags endpoint is deprecated. Please use the latest version.`);var f={};if(c)for(var p=0;c.length>p;p++)f[c[p]]=!0;t&&t.register({[En]:c,[Tn]:f})}else{var m=c,g=l,_=s;if(a!=null&&a.partialResponse)m=h({},n,m),g=h({},r,g),_=h({},i,_);else if(e.errorsWhileComputingFlags)if(s){var v=new Set(Object.keys(s).filter((e=>{var t;return!((t=s[e])!=null&&t.failed)})));m=h({},n,Object.fromEntries(Object.entries(m).filter((e=>{var[t]=e;return v.has(t)})))),g=h({},r,Object.fromEntries(Object.entries(g||{}).filter((e=>{var[t]=e;return v.has(t)})))),_=h({},i,Object.fromEntries(Object.entries(_||{}).filter((e=>{var[t]=e;return v.has(t)}))))}else m=h({},n,m),g=h({},r,g),_=h({},i,_);t&&t.register(h({[En]:Object.keys(gs(m)),[Tn]:m||{},[kn]:g||{},[On]:_||{}},u?{[An]:u}:{},d?{[Vn]:d}:{}))}}})(e,this.ui,r,i,a,n),t||(this.ps=!1),this.Is(t)}}override(e,t){t===void 0&&(t=!1),$.warn(`override is deprecated. Please use overrideFeatureFlags instead.`),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ui)return $.uninitializedWarning(`posthog.featureFlags.overrideFeatureFlags`);if(!1===e)return this.ui.unregister(jn),this.ui.unregister(Mn),this.Is(),ps.info(`All overrides cleared`);if(A(e)){var t=hs(e);return this.ui.register({[jn]:t}),this.Is(),ps.info(`Flag overrides set`,{flags:e})}if(e&&typeof e==`object`&&(`flags`in e||`payloads`in e)){var n,r=e;if(this.us=!!((n=r.suppressWarning)!=null&&n),`flags`in r){if(!1===r.flags)this.ui.unregister(jn),ps.info(`Flag overrides cleared`);else if(r.flags){if(A(r.flags)){var i=hs(r.flags);this.ui.register({[jn]:i})}else this.ui.register({[jn]:r.flags});ps.info(`Flag overrides set`,{flags:r.flags})}}`payloads`in r&&(!1===r.payloads?(this.ui.unregister(Mn),ps.info(`Payload overrides cleared`)):r.payloads&&(this.ui.register({[Mn]:r.payloads}),ps.info(`Payload overrides set`,{payloads:r.payloads}))),this.Is();return}if(e&&typeof e==`object`)return this.ui.register({[jn]:e}),this.Is(),ps.info(`Flag overrides set`,{flags:e});$.warn(`Invalid overrideOptions provided to overrideFeatureFlags`,{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ls){var{flags:t,flagVariants:n}=this.Ts();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,i=(this.gs(Dn)||[]).find((t=>t.flagKey===e)),a={[`$feature_enrollment/`+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};i&&(o.$early_access_feature_name=i.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture(`$feature_enrollment_update`,o),this.setPersonPropertiesForFlags(a,!1);var s=h({},this.getFlagVariants(),{[e]:t});(r=this.ui)==null||r.register({[En]:Object.keys(gs(s)),[Tn]:s}),this.Is()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.gs(Dn),i=n?`&`+n.map((e=>`stage=`+e)).join(`&`):``;if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/early_access_features/?token=`+this.qt.token+i),method:`GET`,callback:t=>{var n,r;if(t.json){var i=t.json.earlyAccessFeatures;return(n=this.ui)==null||n.unregister(Dn),(r=this.ui)==null||r.register({[Dn]:i}),e(i)}}})}Ts(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((e=>t[e])),flagVariants:Object.keys(t).filter((e=>t[e])).reduce(((e,n)=>(e[n]=t[n],e)),{})}}Is(e){var{flags:t,flagVariants:n}=this.Ts();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.gs(Nn)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),i=e?.$set_once,a={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(a[o]=i[o]));this._instance.register({[Nn]:h({},n,a,r)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Nn)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.gs(Pn)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((t=>{n[t]=h({},n[t],e[t]),delete e[t]})),this._instance.register({[Pn]:h({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.gs(Pn)||{};this._instance.register({[Pn]:h({},t,{[e]:{}})})}else this._instance.unregister(Pn)}reset(){this.ls=!1,this.hs=!1,this.cs=!1,this.ds=!1,this.vs=!1,this.$anon_distinct_id=void 0,this.Cs(),this.us=!1}}},ws={sessionRecording:class{get qt(){return this._instance.config}get ui(){return this._instance.persistence}get started(){var e;return!((e=this.Es)==null||!e.isStarted)}get status(){return this.Ms===Jo||this.Ms===Yo?this.Ms:this.Es?.status??this.Ms}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Ms=Ko,this.Rs=void 0,this._instance=e,!this._instance.sessionManager)throw Zo.error(`started without valid sessionManager`),Error(Xo+` started without valid sessionManager. This is a bug.`);if(this.qt.cookieless_mode===nr)throw Error(Xo+` cannot be used with cookieless_mode="always"`)}initialize(){this.startIfEnabledOrStop()}get Ps(){var t,n=!((t=this._instance.get_property(vn))==null||!t.enabled),r=!this.qt.disable_session_recording,i=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return e&&n&&r&&!i}startIfEnabledOrStop(e){var t;if(!this.Ps||(t=this.Es)==null||!t.isStarted){var n=!P(Object.assign)&&!P(Array.from);this.Ps&&n?(this.Os(e),Zo.info(`starting`)):(this.Ms=Ko,this.stopRecording())}}Os(e){var t,n,r;this.Ps&&(this.Ms!==Jo&&this.Ms!==Yo&&(this.Ms=qo),u!=null&&(t=u.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=u.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Ls(e):(r=u.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.Fs,(t=>{if(t)return Zo.error(`could not load recorder`,t);this.Ls(e)})))}stopRecording(){var e,t;(e=this.Rs)==null||e.call(this),this.Rs=void 0,(t=this.Es)==null||t.stop()}As(){var e,t;(e=this.Rs)==null||e.call(this),this.Rs=void 0,(t=this.Es)==null||t.discard()}Ns(){var e;(e=this.ui)==null||e.unregister(wn)}Ds(e,t){if(L(e))return null;var n,r=R(e)?e:parseFloat(e);return typeof(n=r)!=`number`||!Number.isFinite(n)||0>n||n>1?(Zo.warn(t+` must be between 0 and 1. Ignoring invalid value:`,e),null):r}$s(e){if(this.ui){var t,n=this.ui,r=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Ds(this.qt.session_recording?.sampleRate,`session_recording.sampleRate`),i=this.Ds(t?.sampleRate,`remote config sampleRate`),a=r??i;L(a)&&this.Ns();var o=t?.minimumDurationMilliseconds;n.register({[vn]:h({cache_timestamp:Date.now(),enabled:!!t},t,{networkPayloadCapture:h({capturePerformance:e.capturePerformance},t?.networkPayloadCapture),canvasRecording:{enabled:t?.recordCanvas,fps:t?.canvasFps,quality:t?.canvasQuality},sampleRate:a,minimumDurationMilliseconds:P(o)?null:o,endpoint:t?.endpoint,triggerMatchType:t?.triggerMatchType,masking:t?.masking,urlTriggers:t?.urlTriggers,version:t?.version,triggerGroups:t?.triggerGroups})})};r(),(t=this.Rs)==null||t.call(this),this.Rs=this._instance.sessionManager?.onSessionId(r)}}onRemoteConfig(e){`sessionRecording`in e?!1===e.sessionRecording?(this.$s(e),this.As()):(this.$s(e),this.startIfEnabledOrStop()):(this.Ms===Jo&&(this.Ms=Yo,Zo.warn(`config refresh failed, recording will not start until page reload`)),this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t=`log`),(n=this.Es)!=null&&n.log?this.Es.log(e,t):Zo.warn(`log called before recorder was ready`)}get Fs(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(vn);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||`lazy-recorder`}qs(){var e,t=this._instance.get_property(vn);if(!t)return!1;try{e=typeof t==`object`?t:JSON.parse(t)}catch(e){return Zo.warn(`persisted remote config for session recording is invalid and will be ignored`,e),!1}var n=e.cache_timestamp??Date.now();return 36e5>=Date.now()-n}Ls(e){var t;if((t=u.__PosthogExtensions__)==null||!t.initSessionRecording)return Zo.warn(`Called on script loaded before session recording is available. This can be caused by adblockers.`),void this._instance.register_for_session({[$n]:!0});if(this.Es||(this.Es=u.__PosthogExtensions__?.initSessionRecording(this._instance),this.Es._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.qs()){if(this.Ms===Yo||this.Ms===Jo)return;this.Ms=Jo,Zo.info(`persisted remote config is stale, requesting fresh config before starting`),new wi(this._instance).load();return}this.Ms=qo,this.Es.start(e)}onRRwebEmit(e){var t;(t=this.Es)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Es||(t=this.ui)==null||t.register({[bn]:!0}),(e=this.Es)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Es||(t=this.ui)==null||t.register({[yn]:!0}),(e=this.Es)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.Es||(n=this.ui)==null||n.register({[e===`url`?xn:Sn]:!0}),(t=this.Es)==null||t.overrideTrigger(e)}get sdkDebugProperties(){return this.Es?.sdkDebugProperties||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.Es)==null||!n.tryAddCustomEvent(e,t))}}},Ts={autocapture:class{constructor(e){this.js=!1,this.Hs=null,this.Us=!1,this.instance=e,this.rageclicks=new Fo(e.config.rageclick),this.Bs=null}initialize(){this.startIfEnabled()}get qt(){var e=M(this.instance.config.autocapture)?this.instance.config.autocapture:{};return e.url_allowlist=e.url_allowlist?.map((e=>new RegExp(e))),e.url_ignorelist=e.url_ignorelist?.map((e=>new RegExp(e))),e}zs(){if(this.isBrowserSupported()){if(e&&r){var t=t=>{t||=e?.event;try{this.Vs(t)}catch(e){Lo.error(`Failed to capture event`,e)}};if(q(r,`submit`,t,{capture:!0}),q(r,`change`,t,{capture:!0}),q(r,`click`,t,{capture:!0}),this.qt.capture_copied_text){var n=t=>{t||=e?.event;try{this.Vs(t,Io)}catch(e){Lo.error(`Failed to capture copy/cut event`,e)}};q(r,`copy`,n,{capture:!0}),q(r,`cut`,n,{capture:!0})}}}else Lo.info(`Disabling Automatic Event Collection because this browser is not supported`)}startIfEnabled(){this.isEnabled&&!this.js&&(this.zs(),this.js=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Us=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ln]:!!e.autocapture_opt_out}),this.Hs=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Bs=e}getElementSelectors(e){var t,n=[];return(t=this.Bs)==null||t.forEach((t=>{(r?.querySelectorAll(t))?.forEach((r=>{e===r&&n.push(t)}))})),n}get isEnabled(){var e=this.instance.persistence?.props[ln];if(I(this.Hs)&&!B(e)&&!this.instance.Dr())return!1;var t=this.Hs??!!e;return!!this.instance.config.autocapture&&!t}Vs(t,n){if(n===void 0&&(n=`$autocapture`),this.isEnabled){var r,i=mo(t);oo(i)&&(i=i.parentNode||null),n===`$autocapture`&&t.type===`click`&&t instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&function(t,n){if(!e||bo(t))return!1;var r,i;if(B(n)?(r=!!n&&yo,i=void 0):(r=n?.css_selector_ignorelist??yo,i=n?.content_ignorelist),!1===r)return!1;var{targetElementList:a}=xo(t,!1);return!function(e,t){if(!1===e||P(e))return!1;var n;if(!0===e)n=vo;else{if(!A(e))return!1;if(e.length>10)return U.error(`[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching.`),!1;n=e.map((e=>e.toLowerCase()))}return t.some((e=>{var{safeText:t,ariaLabel:r}=e;return n.some((e=>t.includes(e)||r.includes(e)))}))}(i,a.map((e=>({safeText:po(e).toLowerCase(),ariaLabel:e.getAttribute(`aria-label`)?.toLowerCase().trim()||``}))))&&!go(a,r)}(i,this.instance.config.rageclick)&&this.Vs(t,`$rageclick`);var a=n===Io;if(i&&function(t,n,r,i,a){var o,s,c;if(r===void 0&&(r=void 0),!e||bo(t)||(o=r)!=null&&o.url_allowlist&&!lo(r.url_allowlist)||(s=r)!=null&&s.url_ignorelist&&lo(r.url_ignorelist))return!1;if((c=r)!=null&&c.dom_event_allowlist){var l=r.dom_event_allowlist;if(l&&!l.some((e=>n.type===e)))return!1}var{parentIsUsefulElement:u,targetElementList:d}=xo(t,i);if(!function(e,t){var n=t?.element_allowlist;if(P(n))return!0;var r,i=function(e){if(n.some((t=>e.tagName.toLowerCase()===t)))return{v:!0}};for(var a of e)if(r=i(a))return r.v;return!1}(d,r)||!go(d,r?.css_selector_allowlist))return!1;var f=e.getComputedStyle(t);if(f&&f.getPropertyValue(`cursor`)===`pointer`&&n.type===`click`)return!0;var p=t.tagName.toLowerCase();switch(p){case`html`:return!1;case`form`:return(a||[`submit`]).indexOf(n.type)>=0;case`input`:case`select`:case`textarea`:return(a||[`change`,`click`]).indexOf(n.type)>=0;default:return u?(a||[`click`]).indexOf(n.type)>=0:(a||[`click`]).indexOf(n.type)>=0&&(ho.indexOf(p)>-1||t.getAttribute(`contenteditable`)===`true`)}}(i,t,this.qt,a,a?[`copy`,`cut`]:void 0)){var{props:o,explicitNoCapture:s}=Bo(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.element_attribute_ignorelist,elementsChainAsString:this.Us});if(s)return!1;var c=this.getElementSelectors(i);if(c&&c.length>0&&(o.$element_selectors=c),n===Io){var l,u=fo(e==null||(l=e.getSelection())==null?void 0:l.toString()),d=t.type||`clipboard`;if(!u)return!1;o.$selected_content=u,o.$copy_type=d}return this.instance.capture(n,o),!0}}}isBrowserSupported(){return j(r?.querySelectorAll)}},historyAutocapture:class{constructor(t){var n;this._instance=t,this.Ws=(e==null||(n=e.location)==null?void 0:n.pathname)||``}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview===`history_change`}startIfEnabled(){this.isEnabled&&(U.info(`History API monitoring enabled, starting...`),this.monitorHistoryChanges())}stop(){this.Zs&&this.Zs(),this.Zs=void 0,U.info(`History API monitoring stopped`)}monitorHistoryChanges(){var t,n;if(e&&e.history){var r=this;(t=e.history.pushState)!=null&&t.__posthog_wrapped__||Ho(e.history,`pushState`,(e=>function(t,n,i){e.call(this,t,n,i),r.Gs(`pushState`)})),(n=e.history.replaceState)!=null&&n.__posthog_wrapped__||Ho(e.history,`replaceState`,(e=>function(t,n,i){e.call(this,t,n,i),r.Gs(`replaceState`)})),this.Qs()}}Gs(t){try{var n,r=e==null||(n=e.location)==null?void 0:n.pathname;if(!r)return;r!==this.Ws&&this.isEnabled&&this._instance.capture(cr,{navigation_type:t}),this.Ws=r}catch(e){U.error(`Error capturing `+t+` pageview`,e)}}Qs(){if(!this.Zs){var t=()=>{this.Gs(`popstate`)};q(e,`popstate`,t),this.Zs=()=>{e&&e.removeEventListener(`popstate`,t)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(e){var t;this.Js=!1,this.js=!1,this.Ks=null,this.instance=e,this.Js=!((t=this.instance.persistence)==null||!t.props[un]),this.rageclicks=new Fo(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return M(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(e=this.qt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return L(this.qt.capture_heatmaps)?L(this.qt.enable_heatmaps)?this.Js:this.qt.enable_heatmaps:!1!==this.qt.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.js)return;Qo.info(`starting...`),this.Ys(),this.At()}else clearInterval(this.Ks??void 0),this.Xs(),this.getAndClearBuffer()}onRemoteConfig(e){if(`heatmaps`in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[un]:t}),this.Js=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.M;return this.M=void 0,e}eo(e){this.Mt(e.originalEvent,`deadclick`)}At(){this.Ks&&clearInterval(this.Ks),this.Ks=r?.visibilityState===`visible`?setInterval(this.Kr.bind(this),this.flushIntervalMilliseconds):null}Ys(){e&&r&&(this.ro=this.Kr.bind(this),q(e,sr,this.ro),this.io=t=>this.Mt(t||e?.event),q(r,`click`,this.io,{capture:!0}),this.no=t=>this.so(t||e?.event),q(r,`mousemove`,this.no,{capture:!0}),this.oo=new zr(this.instance,Lr,this.eo.bind(this)),this.oo.startIfEnabledOrStop(),this.ao=this.At.bind(this),q(r,or,this.ao),this.js=!0)}Xs(){var t;e&&r&&(this.ro&&e.removeEventListener(sr,this.ro),this.io&&r.removeEventListener(`click`,this.io,{capture:!0}),this.no&&r.removeEventListener(`mousemove`,this.no,{capture:!0}),this.ao&&r.removeEventListener(or,this.ao),clearTimeout(this.uo),(t=this.oo)==null||t.stop(),this.js=!1)}lo(t,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),o=function(t,n,r){for(var i=t;i&&io(i)&&!ao(i,`body`);){if(i===r)return!1;if(E(n,e?.getComputedStyle(i).position))return!0;i=_o(i)}return!1}(mo(t),[`fixed`,`sticky`],a);return{x:t.clientX+(o?0:i),y:t.clientY+(o?0:r),target_fixed:o,type:n}}Mt(e,t){var n;if(t===void 0&&(t=`click`),!ro(e.target)&&$o(e)){var r=this.lo(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.ho(h({},r,{type:`rageclick`})),this.ho(r)}}so(e){!ro(e.target)&&$o(e)&&(clearTimeout(this.uo),this.uo=setTimeout((()=>{this.ho(this.lo(e,`mousemove`))}),500))}ho(t){if(e){var n=e.location.href,r=this.qt.custom_personal_data_properties,i=Yr(n,this.qt.mask_personal_data_properties?[...Qr,...r||[]]:[],ei);this.M=this.M||{},this.M[i]||(this.M[i]=[]),this.M[i].push(t)}}Kr(){this.M&&!N(this.M)&&this.instance.capture(`$$heatmap`,{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:zr,webVitalsAutocapture:class{constructor(e){var t;this.Js=!1,this.js=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.co=()=>{clearTimeout(this.do),this.M.metrics.length!==0&&(this._instance.capture(`$web_vitals`,this.M.metrics.reduce(((e,t)=>h({},e,{[`$web_vitals_`+t.name+`_event`]:h({},t),[`$web_vitals_`+t.name+`_value`]:t.value})),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.dt=e=>{this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t=this.vo();if(!P(t))if(L(e?.name)||L(e?.value))Wo.error(`Invalid metric received`,e);else if(!this.fo||this.fo>e.value){this.M.url!==t&&(this.co(),this.do=setTimeout(this.co,this.flushToCaptureTimeoutMs)),P(this.M.url)&&(this.M.url=t),this.M.firstMetricTimestamp=P(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=this._instance.sessionManager?.checkAndGetSessionAndWindowId(!0),r=h({},e,{$current_url:t,timestamp:Date.now()});P(n)||(r.$session_id=n.sessionId,r.$window_id=n.windowId),this.M.metrics.push(r),this.M.metrics.length===this.allowedMetrics.length&&this.co()}else Wo.error(`Ignoring metric with value >= `+this.fo,e)},this.po=()=>{if(!this.js){var e,t,n,r,i=u.__PosthogExtensions__;P(i)||P(i.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:n,onINP:r}=i.postHogWebVitalsCallbacks),e&&t&&n&&r?(this.allowedMetrics.indexOf(`LCP`)>-1&&e(this.dt.bind(this)),this.allowedMetrics.indexOf(`CLS`)>-1&&t(this.dt.bind(this)),this.allowedMetrics.indexOf(`FCP`)>-1&&n(this.dt.bind(this)),this.allowedMetrics.indexOf(`INP`)>-1&&r(this.dt.bind(this)),this.js=!0):Wo.error(`web vitals callbacks not loaded - not starting`)}},this._instance=e,this.Js=!((t=this._instance.persistence)==null||!t.props[mn]),this.startIfEnabled()}get mo(){return this._instance.config.capture_performance}get allowedMetrics(){var e=M(this.mo)?this.mo?.web_vitals_allowed_metrics:void 0;return L(e)?this._instance.persistence?.props[_n]||[`CLS`,`FCP`,`INP`,`LCP`]:e}get flushToCaptureTimeoutMs(){return(M(this.mo)?this.mo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=M(this.mo)?this.mo.web_vitals_attribution:void 0;return e!=null&&e}get fo(){var e=M(this.mo)&&R(this.mo.__web_vitals_max_value)?this.mo.__web_vitals_max_value:Go;return e>0&&6e4>=e?Go:e}get isEnabled(){var e=i?.protocol;if(e!==`http:`&&e!==`https:`)return Wo.info(`Web Vitals are disabled on non-http/https protocols`),!1;var t=M(this.mo)?this.mo.web_vitals:B(this.mo)?this.mo:void 0;return B(t)?t:this.Js}startIfEnabled(){this.isEnabled&&!this.js&&(Wo.info(`enabled, starting...`),this.lr(this.po))}onRemoteConfig(e){if(`capturePerformance`in e){var t=M(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=M(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[mn]:t}),this._instance.persistence.register({[_n]:n})),this.Js=t,this.startIfEnabled()}}lr(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?`web-vitals-with-attribution`:`web-vitals`,(t=>{t?Wo.error(`failed to load script`,t):e()}))}vo(){var t=e?e.location.href:void 0;if(t){var n=this._instance.config.custom_personal_data_properties;return Yr(t,this._instance.config.mask_personal_data_properties?[...Qr,...n||[]]:[],ei)}Wo.error(`Could not determine current URL`)}}},Es={exceptionObserver:class{constructor(t){var n;this.po=()=>{var t;if(e&&this.isEnabled&&(t=u.__PosthogExtensions__)!=null&&t.errorWrappingFunctions){var n=u.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=u.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=u.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.yo&&this.qt.capture_unhandled_errors&&(this.yo=n(this.captureException.bind(this))),!this.bo&&this.qt.capture_unhandled_rejections&&(this.bo=r(this.captureException.bind(this))),!this._o&&this.qt.capture_console_errors&&(this._o=i(this.captureException.bind(this)))}catch(e){Vo.error(`failed to start`,e),this.wo()}}},this._instance=t,this.xo=!((n=this._instance.persistence)==null||!n.props[dn]),this.So=new me({refillRate:this._instance.config.error_tracking.__exceptionRateLimiterRefillRate??1,bucketSize:this._instance.config.error_tracking.__exceptionRateLimiterBucketSize??10,refillInterval:1e4,Gt:Vo}),this.qt=this.ko(),this.startIfEnabledOrStop()}ko(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return M(e)?t=h({},t,e):(P(e)?this.xo:e)&&(t=h({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.qt.capture_console_errors||this.qt.capture_unhandled_errors||this.qt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Vo.info(`enabled`),this.wo(),this.lr(this.po)):this.wo()}lr(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`exception-autocapture`,(t=>{if(t)return Vo.error(`failed to load script`,t);e()}))}wo(){var e,t,n;(e=this.yo)==null||e.call(this),this.yo=void 0,(t=this.bo)==null||t.call(this),this.bo=void 0,(n=this._o)==null||n.call(this),this._o=void 0}onRemoteConfig(e){`autocaptureExceptions`in e&&(this.xo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[dn]:this.xo}),this.qt=this.ko(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=this.ko()}captureException(e){var t,n,r=(e==null||(t=e.$exception_list)==null||(t=t[0])==null?void 0:t.type)??`Exception`;this.So.consumeRateLimit(r)?Vo.info(`Skipping exception capture because of client rate limiting.`,{exception:r}):(n=this._instance.exceptions)==null||n.sendExceptionEvent(e)}},exceptions:class{constructor(e){this.Co=[],this.Io=new Tt([new Lt,new qt,new zt,new Rt,new Gt,new Wt,new Vt,new Kt],function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(t,r){r===void 0&&(r=0);for(var i=[],a=t.split(`
|
|
2
|
+
`),o=r;a.length>o;o++){var s=a[o];if(1024>=s.length){var c=It.test(s)?s.replace(It,`$1`):s;if(!c.match(/\S*Error: /)){for(var l of n){var u=l(c,e);if(u){i.push(u);break}}if(i.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map((e=>{return h({},e,{filename:e.filename||(n=t,n[n.length-1]||{}).filename,function:e.function||Et});var n}))}(i)}}(`web:javascript`,Mt,Ft)),this._instance=e,this.Co=this._instance.persistence?.get_property(fn)??[],this.To=Qt(this.Eo()),this.Mo=new $t(this.To)}onConfigChange(){this.To=Qt(this.Eo()),this.Mo.setConfig(this.To)}onRemoteConfig(e){if(`errorTracking`in e){var t=e.errorTracking?.suppressionRules??[],n=e.errorTracking?.captureExtensionExceptions;this.Co=t,this._instance.persistence&&this._instance.persistence.register({[fn]:this.Co,[pn]:n})}}get Ro(){var e,t=!!this._instance.get_property(pn);return(e=this._instance.config.error_tracking.captureExtensionExceptions??t)!=null&&e}buildProperties(e,t){return this.Io.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.To.enabled)try{if(!F(e)||e.trim().length===0)return void _s.warn(`Ignoring exception step because message must be a non-empty string`);var{sanitizedProperties:n,droppedKeys:r}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce(((n,r)=>Xt.has(r)?(t.push(r),n):(n[r]=e[r],n)),{}),droppedKeys:t}}(this.Po(t));r.length>0&&_s.warn(`Ignoring reserved exception step fields`,{droppedKeys:r}),this.Mo.add(h({[Jt]:e,[Yt]:new Date().toISOString()},n))}catch(e){_s.error(`Failed to add exception step. Ignoring breadcrumb.`,e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Oo(t)){if(this.Lo(t))return this.Fo(`Exception dropped: matched a suppression rule`),void _s.info(`Skipping exception capture because a suppression rule matched`);if(!this.Ro&&this.Ao(t))return this.Fo(`Exception dropped: thrown by a browser extension`),void _s.info(`Skipping exception capture because it was thrown by an extension`);if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.No(t))return this.Fo(`Exception dropped: thrown by the PostHog SDK`),void _s.info(`Skipping exception capture because it was thrown by the PostHog SDK`)}var n=this.To.enabled&&L(e.$exception_steps)?this.Do(e):e;try{var r=this._instance.capture(`$exception`,n,{_noTruncate:!0,_batchKey:`exceptionEvent`,cn:!0});return r&&this.Mo.clear(),r}catch(e){_s.error(`Failed to capture exception event. Dropping this exception.`,e),this.Mo.clear();return}}catch(e){_s.error(`Failed to process exception event. Ignoring this exception.`,e);return}}Do(e){try{var t=this.Mo.getAttachable();return t.length===0?e:h({},e,{$exception_steps:t})}catch(t){return _s.error(`Failed to read buffered exception steps. Capturing exception without steps.`,t),e}}Fo(e){this.To.enabled&&this.Mo.add({[Jt]:e,[Yt]:new Date().toISOString()})}Po(e){return M(e)?h({},e):{}}Eo(){return this._instance.config.error_tracking?.exception_steps??{}}Lo(e){if(e.length===0)return!1;var t=e.reduce(((e,t)=>{var{type:n,value:r}=t;return F(n)&&n.length>0&&e.$exception_types.push(n),F(r)&&r.length>0&&e.$exception_values.push(r),e}),{$exception_types:[],$exception_values:[]});return this.Co.some((e=>{var n=e.values.map((e=>{var n=Ea[e.operator],r=A(e.value)?e.value:[e.value],i=t[e.key]??[];return r.length>0&&n(r,i)}));return e.type===`OR`?n.some(Boolean):n.every(Boolean)}))}Ao(e){return e.flatMap((e=>e.stacktrace?.frames??[])).some((e=>e.filename&&e.filename.startsWith(`chrome-extension://`)))}No(e){if(e.length>0){var t,n,r=e[0].stacktrace?.frames??[],i=r[r.length-1];return(t=i==null||(n=i.filename)==null?void 0:n.includes(`posthog.com/static`))!=null&&t}return!1}Oo(e){return!L(e)&&A(e)}}},Ds=h({productTours:class{get ui(){return this._instance.persistence}constructor(e){this.$o=null,this.qo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){`productTours`in e&&(this.ui&&this.ui.register({[gn]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.$o||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(gn)||this.lr((()=>this.jo()))}lr(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`product-tours`,(t=>{t?es.error(`Could not load product tours script`,t):e()}))}jo(){var e;!this.$o&&(e=u.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.$o=u.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!A(this.qo)||t){var n=this.ui;if(n){var r=n.props[Ln];if(A(r)&&!t)return this.qo=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/product_tours/?token=`+this._instance.config.token),method:`GET`,callback:t=>{var r=t.statusCode;if(r!==200||!t.json){var i=`Product Tours API could not be loaded, status: `+r;es.error(i),e([],{isLoaded:!1,error:i});return}var a=A(t.json.product_tours)?t.json.product_tours:[];this.qo=a,n&&n.register({[Ln]:a}),e(a,{isLoaded:!0})}})}else e(this.qo,{isLoaded:!0})}getActiveProductTours(e){L(this.$o)?e([],{isLoaded:!1,error:`Product tours not loaded`}):this.$o.getActiveProductTours(e)}showProductTour(e){var t;(t=this.$o)==null||t.showTourById(e)}previewTour(e){this.$o?this.$o.previewTour(e):this.lr((()=>{var t;this.jo(),(t=this.$o)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.$o)==null||e.dismissTour(`user_clicked_skip`)}nextStep(){var e;(e=this.$o)==null||e.nextStep()}previousStep(){var e;(e=this.$o)==null||e.previousStep()}clearCache(){var e;this.qo=null,(e=this.ui)==null||e.unregister(Ln)}resetTour(e){var t;(t=this.$o)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.$o)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.$o)==null||t.cancelPendingTour(e)}}},Cs),Os={siteApps:class{constructor(e){this._instance=e,this.Ho=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Uo(e,t){if(t){var n=this.globalsForEvent(t);this.Ho.push(n),this.Ho.length>1e3&&(this.Ho=this.Ho.slice(10))}}get siteAppLoaders(){var e;return(e=u._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Uo.bind(this));this.Bo=()=>{e(),this.Ho=[],this.Bo=void 0}}}globalsForEvent(e){if(!e)throw Error(`Event payload is required`);var t={},n=this._instance.get_property(`$groups`)||[],r=this._instance.get_property(`$stored_group_properties`)||{};for(var[i,a]of Object.entries(r))t[i]={id:n[i],type:i,properties:a};var{$set_once:o,$set:s}=e;return{event:h({},g(e,ts),{properties:h({},e.properties,s?{$set:h({},e.properties?.$set??{},s)}:{},o?{$set_once:h({},e.properties?.$set_once??{},o)}:{}),elements_chain:e.properties?.$elements_chain??``,distinct_id:e.properties?.distinct_id}),person:{properties:this._instance.get_property(`$stored_person_properties`)},groups:t}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var n;!t.errored&&this.Ho.length&&(ns.info(`Processing `+this.Ho.length+` events for site app with id `+e.id),this.Ho.forEach((e=>t.processEvent==null?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every((e=>e.processedBuffer||e.errored))&&((n=this.Bo)==null||n.call(this))},r=!1,i=i=>{t.errored=!i,t.loaded=!0,ns.info(`Site app with id `+e.id+` `+(i?`loaded`:`errored`)),r&&n()};try{var{processEvent:a}=e.init({posthog:this._instance,callback(e){i(e)}});a&&(t.processEvent=a),r=!0}catch(t){ns.error(rs+e.id,t),i(!1)}if(r&&t.loaded)try{n()}catch(n){ns.error(`Error while processing buffered events PostHog app with config id `+e.id,n),t.errored=!0}}zo(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Vo(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(t){ns.error(`Error while processing event `+e.event+` for site app `+n.id,t)}}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.zo(),void this._instance.on(`eventCaptured`,(e=>this.Vo(e)))):void ns.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`);if((n=this.Bo)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(e){var t;u[`__$$ph_site_app_`+e]=i._instance,(t=u.__PosthogExtensions__)==null||t.loadSiteApp==null||t.loadSiteApp(i._instance,s,(t=>{if(t)return ns.error(rs+e,t)}))};for(var{id:o,url:s}of e.siteApps)a(o)}else ns.error(`PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.`)}}},ks={tracingHeaders:class{constructor(e){this.Wo=void 0,this.Zo=void 0,this.Go=void 0,this.po=()=>{var e,t,n=this.Qo();n?(P(this.Wo)&&(this.Wo=(e=u.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),P(this.Zo)&&(this.Zo=(t=u.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null?void 0:t._patchFetch(n,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.wo()},this._instance=e}initialize(){this.startIfEnabledOrStop()}lr(e){var t,n;(t=u.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns?e():(n=u.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,`tracing-headers`,(t=>{if(t)return Uo.error(`failed to load script`,t);e()}))}Jo(){return this._instance.config.tracing_headers??this._instance.config.addTracingHeaders??this._instance.config.__add_tracing_headers}Qo(){var e=this.Jo();return A(e)?(A(this.Go)?this.Go.splice(0,this.Go.length,...e):this.Go=[...e],e.length>0?this.Go:void 0):(A(this.Go)&&this.Go.splice(0),this.Go=e||void 0,this.Go)}wo(){var e,t;(e=this.Wo)==null||e.call(this),(t=this.Zo)==null||t.call(this),this.Wo=void 0,this.Zo=void 0}startIfEnabledOrStop(){this.Qo()?this.lr(this.po):this.wo()}}},As=h({surveys:class{get qt(){return this._instance.config}constructor(e){this.Ko=void 0,this._surveyManager=null,this.Yo=!1,this.Xo=[],this.ea=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.qt.disable_surveys){var t=e.surveys;if(L(t))return Q.warn(`Flags not loaded yet. Not loading surveys.`);var n=A(t);this.Ko=n?t.length>0:t,Q.info(`flags response received, isSurveysEnabled: `+this.Ko),this.loadIfEnabled()}}reset(){localStorage.removeItem(`lastSeenSurveyDate`);for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(Na)||n!=null&&n.startsWith(`inProgressSurvey_`))&&e.push(n)}e.forEach((e=>localStorage.removeItem(e)))}loadIfEnabled(){if(!this._surveyManager)if(this.Yo)Q.info(`Already initializing surveys, skipping...`);else if(this.qt.disable_surveys)Q.info(ls);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())Q.info(`Not loading surveys in cookieless mode without consent.`);else{var e=u?.__PosthogExtensions__;if(e){if(!P(this.Ko)||this.qt.advanced_enable_surveys){var t=this.Ko||this.qt.advanced_enable_surveys;this.Yo=!0;try{var n=e.generateSurveys;if(n)return void this.ta(n,t);var r=e.loadExternalDependency;if(!r)return void this.ra(er);r(this._instance,`surveys`,(n=>{n||!e.generateSurveys?this.ra(`Could not load surveys script`,n):this.ta(e.generateSurveys,t)}))}catch(e){throw this.ra(`Error initializing surveys`,e),e}finally{this.Yo=!1}}}else Q.error(`PostHog Extensions not found.`)}}ta(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new ss(this._instance),Q.info(`Surveys loaded successfully`),this.ia({isLoaded:!0})}ra(e,t){Q.error(e,t),this.ia({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Xo.push(e),this._surveyManager&&this.ia({isLoaded:!0}),()=>{this.Xo=this.Xo.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.qt.disable_surveys)return Q.info(ls),e([]);var n,r=this._instance.get_property(Fn);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<`u`&&this.ea?this.ea.then((t=>{var{surveys:n,context:r}=t;return e(n,r)})):(typeof Promise<`u`&&(this.ea=new Promise((e=>{n=e}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor(`api`,`/api/surveys/?token=`+this.qt.token),method:`GET`,timeout:this.qt.surveys_request_timeout_ms,callback:t=>{var r;this.ea=null;var i=t.statusCode;if(i!==200||!t.json){var a=`Surveys API could not be loaded, status: `+i;Q.error(a);var o={isLoaded:!1,error:a};e([],o),n?.({surveys:[],context:o});return}var s,c=t.json.surveys||[],l=c.filter((e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(function(e){var t;return!((t=e.conditions)==null||(t=t.events)==null||(t=t.values)==null||!t.length)}(e)||function(e){var t;return!((t=e.conditions)==null||(t=t.actions)==null||(t=t.values)==null||!t.length)}(e))));l.length>0&&((s=this._surveyEventReceiver)==null||s.register(l)),(r=this._instance.persistence)==null||r.register({[Fn]:c});var u={isLoaded:!0};e(c,u),n?.({surveys:c,context:u})}}))}ia(e){for(var t of this.Xo)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Q.error(`Error in survey callback`,e)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!L(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Q.warn(`init was not called`)}na(e){var t=null;return this.getSurveys((n=>{t=n.find((t=>t.id===e))??null})),t}sa(e){if(L(this._surveyManager))return{eligible:!1,reason:cs};var t=typeof e==`string`?this.na(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:`Survey not found`}}canRenderSurvey(e){if(L(this._surveyManager))return Q.warn(`init was not called`),{visible:!1,disabledReason:cs};var t=this.sa(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return L(this._surveyManager)?(Q.warn(`init was not called`),Promise.resolve({visible:!1,disabledReason:cs})):new Promise((n=>{this.getSurveys((t=>{var r=t.find((t=>t.id===e))??null;if(r){var i=this.sa(r);n({visible:i.eligible,disabledReason:i.reason})}else n({visible:!1,disabledReason:`Survey not found`})}),t)}))}renderSurvey(e,t,n){var i;if(L(this._surveyManager))Q.warn(`init was not called`);else{var a=typeof e==`string`?this.na(e):e;if(a!=null&&a.id)if(Pa.includes(a.type)){var o=r?.querySelector(t);if(o)return(i=a.appearance)!=null&&i.surveyPopupDelaySeconds?(Q.info(`Rendering survey `+a.id+` with delay of `+a.appearance.surveyPopupDelaySeconds+` seconds`),void setTimeout((()=>{var e;Q.info(`Rendering survey `+a.id+` with delay of `+a.appearance?.surveyPopupDelaySeconds+` seconds`),(e=this._surveyManager)==null||e.renderSurvey(a,o,n),Q.info(`Survey `+a.id+` rendered`)}),1e3*a.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(a,o,n);Q.warn(`Survey element not found`)}else Q.warn(`Surveys of type `+a.type+` cannot be rendered in the app`);else Q.warn(`Survey not found`)}}displaySurvey(e,t){var n;if(L(this._surveyManager))Q.warn(`init was not called`);else{var r=this.na(e);if(r){var i=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=h({},r,{appearance:h({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==vi.Popover&&t.initialResponses&&Q.warn(`initialResponses is only supported for popover surveys. prefill will not be applied.`),!1===t.ignoreConditions){var a=this.canRenderSurvey(r);if(!a.visible)return void Q.warn(`Survey is not eligible to be displayed: `,a.disabledReason)}t.displayType===vi.Inline?this.renderSurvey(i,t.selector,t.properties):this._surveyManager.handlePopoverSurvey(i,t)}else Q.warn(`Survey not found`)}}cancelPendingSurvey(e){L(this._surveyManager)?Q.warn(`init was not called`):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},Cs),js={toolbar:class{constructor(e){this.instance=e}oa(e){u.ph_toolbar_state=e}aa(){return u.ph_toolbar_state??0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,n,i){if(t===void 0&&(t=void 0),n===void 0&&(n=void 0),i===void 0&&(i=void 0),yr(this.instance.config)||!e||!r)return!1;t??=e.location,i??=e.history;try{if(!n){try{e.localStorage.setItem(`test`,`test`),e.localStorage.removeItem(`test`)}catch{return!1}n=e?.localStorage}var a,o=us||Xr(t.hash,`__posthog`)||Xr(t.hash,`state`),s=o?mr((()=>JSON.parse(atob(decodeURIComponent(o)))))||mr((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action===`ph_authorize`?((a=s).source=`url`,a&&Object.keys(a).length>0&&(s.desiredHash?t.hash=s.desiredHash:i?i.replaceState(i.state,``,t.pathname+t.search):t.hash=``)):((a=JSON.parse(n.getItem(ds)||`{}`)).source=`localstorage`,delete a.userIntent),!(!a.token||this.instance.config.token!==a.token||(this.loadToolbar(a),0))}catch{return!1}}ua(e){var t=u.ph_load_toolbar||u.ph_load_editor;!L(t)&&j(t)?t(e,this.instance):fs.warn(`No toolbar load function found`)}loadToolbar(t){var n=!(r==null||!r.getElementById(Yn));if(!e||n)return!1;var i=this.instance.requestRouter.region===`custom`&&this.instance.config.advanced_disable_toolbar_metrics,a=h({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor(`ui`)},i?{instrument:!1}:{});if(e.localStorage.setItem(ds,JSON.stringify(h({},a,{source:void 0}))),this.aa()===2)this.ua(a);else if(this.aa()===0){var o;this.oa(1),(o=u.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,`toolbar`,(e=>{if(e)return fs.error(`[Toolbar] Failed to load`,e),void this.oa(0);this.oa(2),this.ua(a)})),q(e,`turbolinks:load`,(()=>{this.oa(0),this.loadToolbar(a)}))}return!0}la(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},Ms=h({experiments:bs},Cs),Ns=h({},Cs,ws,Ts,Es,Ds,Os,As,ks,js,Ms,{conversations:class{constructor(e){this.ha=void 0,this._conversationsManager=null,this.ca=!1,this.da=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;L(t)||(B(t)?this.ha=t:(this.ha=t.enabled,this.da=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.ha=void 0,this.da=null}loadIfEnabled(){if(!(this._conversationsManager||this.ca||this._instance.config.disable_conversations||yr(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=u?.__PosthogExtensions__;if(e&&!P(this.ha)&&this.ha)if(this.da&&this.da.token){this.ca=!0;try{var t=e.initConversations;if(t)return this.va(t),void(this.ca=!1);var n=e.loadExternalDependency;if(!n)return void this.fa(er);n(this._instance,`conversations`,(t=>{t||!e.initConversations?this.fa(`Could not load conversations script`,t):this.va(e.initConversations),this.ca=!1}))}catch(e){this.fa(`Error initializing conversations`,e),this.ca=!1}}else xs.error(`Conversations enabled but missing token in remote config.`)}}va(e){if(this.da)try{this._conversationsManager=e(this.da,this._instance),xs.info(`Conversations loaded successfully`)}catch(e){this.fa(`Error completing conversations initialization`,e)}else xs.error(`Cannot complete initialization: remote config is null`)}fa(e,t){xs.error(e,t),this._conversationsManager=null,this.ca=!1}show(){this._conversationsManager?this._conversationsManager.show():xs.warn(`Conversations not loaded yet.`)}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.ha&&!I(this._conversationsManager)}isVisible(){var e;return(e=this._conversationsManager?.isVisible())!=null&&e}sendMessage(e,t,n){var r=this;return m((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(xs.warn(Ss),null)}))()}getMessages(e,t){var n=this;return m((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(xs.warn(Ss),null)}))()}markAsRead(e){var t=this;return m((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(xs.warn(Ss),null)}))()}getTickets(e){var t=this;return m((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(xs.warn(Ss),null)}))()}requestRestoreLink(e){var t=this;return m((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(xs.warn(Ss),null)}))()}restoreFromToken(e){var t=this;return m((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(xs.warn(Ss),null)}))()}restoreFromUrlToken(){var e=this;return m((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(xs.warn(Ss),null)}))()}getCurrentTicketId(){return this._conversationsManager?.getCurrentTicketId()??null}getWidgetSessionId(){return this._conversationsManager?.getWidgetSessionId()??null}yn(){var e;(e=this._conversationsManager)==null||e.setIdentity()}bn(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.pa=!1,this.ga=!1,this.Gt=W(`[logs]`),this.ma=[],this.ya=0,this.ba=0,this._a=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.pa=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t=e.logs?.captureConsoleLogs;!L(t)&&t&&(this.pa=!0,this.loadIfEnabled())}reset(){this.ma=[],this.Br&&=(clearTimeout(this.Br),void 0),this.ya=0,this.ba=0,this._a=!1}loadIfEnabled(){if(this.pa&&!this.ga){var e=u?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,`logs`,(t=>{var n;t||(n=e.logs)==null||!n.initializeLogs?this.Gt.error(`Could not load logs script`,t):(e.logs.initializeLogs(this._instance),this.ga=!0)})):this.Gt.error(er)}else this.Gt.error(`PostHog Extensions not found.`)}}captureLog(e){if(this._instance.is_capturing())if(e&&e.body){var t=this._instance.config.logs?.flushIntervalMs??3e3,n=this._instance.config.logs?.maxLogsPerInterval??1e3,r=Date.now();if(t>r-this.ba||(this.ba=r,this.ya=0,this._a=!1),n>this.ya){this.ya++;var i=function(e,t){var{text:n,number:r}=bt[e.level||`info`]||xt,i=String(Date.now())+`000000`,a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.currentUrl&&(a[`url.full`]=t.currentUrl),t.screenName&&(a[`screen.name`]=t.screenName),t.appState&&(a[`app.state`]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var o=h({},a,e.attributes||{}),s={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:r,severityText:n,body:{stringValue:e.body},attributes:Ct(o)};return e.trace_id&&(s.traceId=e.trace_id),e.span_id&&(s.spanId=e.span_id),P(e.trace_flags)||(s.flags=e.trace_flags),s}(e,this.wa());this.ma.push({record:i}),(this._instance.config.logs?.maxBufferSize??100)>this.ma.length?this.xa():this.flushLogs()}else this._a||=(this.Gt.warn(`captureLog dropping logs: exceeded `+n+` logs per `+t+`ms`),!0)}else this.Gt.warn(`captureLog requires a body`)}get logger(){return this.Sa||={trace:(e,t)=>this.captureLog({body:e,level:`trace`,attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:`debug`,attributes:t}),info:(e,t)=>this.captureLog({body:e,level:`info`,attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:`warn`,attributes:t}),error:(e,t)=>this.captureLog({body:e,level:`error`,attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:`fatal`,attributes:t})},this.Sa}flushLogs(e){if(this.Br&&=(clearTimeout(this.Br),void 0),this.ma.length!==0){var t=this.ma;this.ma=[];var n=this._instance.config.logs,r=h({"service.name":n?.serviceName||`unknown_service`},n?.environment&&{"deployment.environment":n.environment},n?.serviceVersion&&{"service.version":n.serviceVersion},n?.resourceAttributes),i=function(e,t,n,r){return{resourceLogs:[{resource:{attributes:Ct(t)},scopeLogs:[{scope:{name:n,version:r},logRecords:e}]}]}}(t.map((e=>e.record)),r,f.LIB_NAME,f.LIB_VERSION),a=this._instance.requestRouter.endpointFor(`api`,`/i/v1/logs`)+`?token=`+encodeURIComponent(this._instance.config.token);this._instance.Yi({method:`POST`,url:a,data:i,compression:`best-available`,batchKey:`logs`,transport:e})}}xa(){this.Br||=setTimeout((()=>{this.Br=void 0,this.flushLogs()}),this._instance.config.logs?.flushIntervalMs??3e3)}wa(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n}if(u!=null&&(e=u.location)!=null&&e.href&&(t.currentUrl=u.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}});$a.__defaultExtensionClasses=h({},Ns);var Ps=function(){f.SDK_DIST_CHANNEL=`npm`;var t=Ba[qa]=new $a;return function(){function t(){t.done||(t.done=!0,Ja=!1,G(Ba,(function(e){e._dom_loaded()})))}r!=null&&r.addEventListener?r.readyState===`complete`?t():q(r,`DOMContentLoaded`,t,{capture:!1}):e&&U.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}();exports.default=Ps;
|
|
3
3
|
//# sourceMappingURL=module.cjs.map
|