posthog-js 1.167.1 → 1.168.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.
Files changed (49) hide show
  1. package/dist/all-external-dependencies.js +2 -2
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.js +2 -2
  4. package/dist/array.full.js.map +1 -1
  5. package/dist/array.full.no-external.js +2 -2
  6. package/dist/array.full.no-external.js.map +1 -1
  7. package/dist/array.js +1 -1
  8. package/dist/array.js.map +1 -1
  9. package/dist/array.no-external.js +1 -1
  10. package/dist/array.no-external.js.map +1 -1
  11. package/dist/exception-autocapture.js +1 -1
  12. package/dist/exception-autocapture.js.map +1 -1
  13. package/dist/external-scripts-loader.js.map +1 -1
  14. package/dist/lib/src/extensions/exception-autocapture/error-conversion.d.ts +36 -2
  15. package/dist/lib/src/types.d.ts +8 -17
  16. package/dist/lib/src/utils/globals.d.ts +3 -2
  17. package/dist/main.js +1 -1
  18. package/dist/main.js.map +1 -1
  19. package/dist/module.d.ts +9 -18
  20. package/dist/module.full.d.ts +9 -18
  21. package/dist/module.full.js +2 -2
  22. package/dist/module.full.js.map +1 -1
  23. package/dist/module.full.no-external.d.ts +9 -18
  24. package/dist/module.full.no-external.js +2 -2
  25. package/dist/module.full.no-external.js.map +1 -1
  26. package/dist/module.js +1 -1
  27. package/dist/module.js.map +1 -1
  28. package/dist/module.no-external.d.ts +9 -18
  29. package/dist/module.no-external.js +1 -1
  30. package/dist/module.no-external.js.map +1 -1
  31. package/dist/recorder-v2.js.map +1 -1
  32. package/dist/recorder.js.map +1 -1
  33. package/dist/surveys-preview.js.map +1 -1
  34. package/dist/surveys.js.map +1 -1
  35. package/dist/tracing-headers.js.map +1 -1
  36. package/dist/web-vitals.js.map +1 -1
  37. package/lib/package.json +1 -1
  38. package/lib/src/extensions/exception-autocapture/error-conversion.d.ts +36 -2
  39. package/lib/src/extensions/exception-autocapture/error-conversion.js +104 -65
  40. package/lib/src/extensions/exception-autocapture/error-conversion.js.map +1 -1
  41. package/lib/src/extensions/sentry-integration.js +1 -0
  42. package/lib/src/extensions/sentry-integration.js.map +1 -1
  43. package/lib/src/posthog-core.js +10 -1
  44. package/lib/src/posthog-core.js.map +1 -1
  45. package/lib/src/types.d.ts +8 -17
  46. package/lib/src/types.js.map +1 -1
  47. package/lib/src/utils/globals.d.ts +3 -2
  48. package/lib/src/utils/globals.js.map +1 -1
  49. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tracing-headers.js","sources":["../src/extensions/replay/rrweb-plugins/patch.ts","../src/utils/type-utils.ts","../src/utils/globals.ts","../src/entrypoints/tracing-headers.ts"],"sourcesContent":["// import { patch } from 'rrweb/typings/utils'\n// copied from https://github.com/rrweb-io/rrweb/blob/8aea5b00a4dfe5a6f59bd2ae72bb624f45e51e81/packages/rrweb/src/utils.ts#L129\n// which was copied from https://github.com/getsentry/sentry-javascript/blob/b2109071975af8bf0316d3b5b38f519bdaf5dc15/packages/utils/src/object.ts\nimport { isFunction } from '../../../utils/type-utils'\n\nexport function patch(\n source: { [key: string]: any },\n name: string,\n replacement: (...args: unknown[]) => unknown\n): () => void {\n try {\n if (!(name in source)) {\n return () => {\n //\n }\n }\n\n const original = source[name] as () => unknown\n const wrapped = replacement(original)\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (isFunction(wrapped)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n wrapped.prototype = wrapped.prototype || {}\n Object.defineProperties(wrapped, {\n __posthog_wrapped__: {\n enumerable: false,\n value: true,\n },\n })\n }\n\n source[name] = wrapped\n\n return () => {\n source[name] = original\n }\n } catch {\n return () => {\n //\n }\n // This can throw if multiple fill happens on a global object like XMLHttpRequest\n // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n }\n}\n","// eslint-disable-next-line posthog-js/no-direct-array-check\nconst nativeIsArray = Array.isArray\nconst ObjProto = Object.prototype\nexport const hasOwnProperty = ObjProto.hasOwnProperty\nconst toString = ObjProto.toString\n\nexport const isArray =\n nativeIsArray ||\n function (obj: any): obj is any[] {\n return toString.call(obj) === '[object Array]'\n }\nexport const isUint8Array = function (x: unknown): x is Uint8Array {\n return toString.call(x) === '[object Uint8Array]'\n}\n// from a comment on http://dbj.org/dbj/?p=286\n// fails on only one very rare and deliberate custom object:\n// let bomb = { toString : undefined, valueOf: function(o) { return \"function BOMBA!\"; }};\nexport const isFunction = function (f: any): f is (...args: any[]) => any {\n // eslint-disable-next-line posthog-js/no-direct-function-check\n return typeof f === 'function'\n}\n// Underscore Addons\nexport const isObject = function (x: unknown): x is Record<string, any> {\n // eslint-disable-next-line posthog-js/no-direct-object-check\n return x === Object(x) && !isArray(x)\n}\nexport const isEmptyObject = function (x: unknown): x is Record<string, any> {\n if (isObject(x)) {\n for (const key in x) {\n if (hasOwnProperty.call(x, key)) {\n return false\n }\n }\n return true\n }\n return false\n}\nexport const isUndefined = function (x: unknown): x is undefined {\n return x === void 0\n}\n\nexport const isString = function (x: unknown): x is string {\n // eslint-disable-next-line posthog-js/no-direct-string-check\n return toString.call(x) == '[object String]'\n}\n\nexport const isEmptyString = function (x: unknown): boolean {\n return isString(x) && x.trim().length === 0\n}\n\nexport const isNull = function (x: unknown): x is null {\n // eslint-disable-next-line posthog-js/no-direct-null-check\n return x === null\n}\n\n/*\n sometimes you want to check if something is null or undefined\n that's what this is for\n */\nexport const isNullish = function (x: unknown): x is null | undefined {\n return isUndefined(x) || isNull(x)\n}\n\nexport const isDate = function (x: unknown): x is Date {\n // eslint-disable-next-line posthog-js/no-direct-date-check\n return toString.call(x) == '[object Date]'\n}\nexport const isNumber = function (x: unknown): x is number {\n // eslint-disable-next-line posthog-js/no-direct-number-check\n return toString.call(x) == '[object Number]'\n}\nexport const isBoolean = function (x: unknown): x is boolean {\n // eslint-disable-next-line posthog-js/no-direct-boolean-check\n return toString.call(x) === '[object Boolean]'\n}\n\nexport const isDocument = (x: unknown): x is Document => {\n // eslint-disable-next-line posthog-js/no-direct-document-check\n return x instanceof Document\n}\n\nexport const isFormData = (x: unknown): x is FormData => {\n // eslint-disable-next-line posthog-js/no-direct-form-data-check\n return x instanceof FormData\n}\n\nexport const isFile = (x: unknown): x is File => {\n // eslint-disable-next-line posthog-js/no-direct-file-check\n return x instanceof File\n}\n","import type { PostHog } from '../posthog-core'\nimport { SessionIdManager } from '../sessionid'\nimport { ErrorEventArgs, ErrorProperties, Properties } from '../types'\n\n/*\n * Global helpers to protect access to browser globals in a way that is safer for different targets\n * like DOM, SSR, Web workers etc.\n *\n * NOTE: Typically we want the \"window\" but globalThis works for both the typical browser context as\n * well as other contexts such as the web worker context. Window is still exported for any bits that explicitly require it.\n * If in doubt - export the global you need from this file and use that as an optional value. This way the code path is forced\n * to handle the case where the global is not available.\n */\n\n// eslint-disable-next-line no-restricted-globals\nconst win: (Window & typeof globalThis) | undefined = typeof window !== 'undefined' ? window : undefined\n\n/**\n * This is our contract between (potentially) lazily loaded extensions and the SDK\n * changes to this interface can be breaking changes for users of the SDK\n */\n\nexport type PostHogExtensionKind =\n | 'toolbar'\n | 'exception-autocapture'\n | 'web-vitals'\n | 'recorder'\n | 'tracing-headers'\n | 'surveys'\n\ninterface PostHogExtensions {\n loadExternalDependency?: (\n posthog: PostHog,\n kind: PostHogExtensionKind,\n callback: (error?: string | Event, event?: Event) => void\n ) => void\n\n loadSiteApp?: (posthog: PostHog, appUrl: string, callback: (error?: string | Event, event?: Event) => void) => void\n\n parseErrorAsProperties?: ([event, source, lineno, colno, error]: ErrorEventArgs) => ErrorProperties\n errorWrappingFunctions?: {\n wrapOnError: (captureFn: (props: Properties) => void) => () => void\n wrapUnhandledRejection: (captureFn: (props: Properties) => void) => () => void\n }\n rrweb?: { record: any; version: string; rrwebVersion: string }\n rrwebPlugins?: { getRecordConsolePlugin: any; getRecordNetworkPlugin?: any }\n canActivateRepeatedly?: (survey: any) => boolean\n generateSurveys?: (posthog: PostHog) => any | undefined\n postHogWebVitalsCallbacks?: {\n onLCP: (metric: any) => void\n onCLS: (metric: any) => void\n onFCP: (metric: any) => void\n onINP: (metric: any) => void\n }\n tracingHeadersPatchFns?: {\n _patchFetch: (sessionManager: SessionIdManager) => () => void\n _patchXHR: (sessionManager: any) => () => void\n }\n}\n\nconst global: typeof globalThis | undefined = typeof globalThis !== 'undefined' ? globalThis : win\n\nexport const ArrayProto = Array.prototype\nexport const nativeForEach = ArrayProto.forEach\nexport const nativeIndexOf = ArrayProto.indexOf\n\nexport const navigator = global?.navigator\nexport const document = global?.document\nexport const location = global?.location\nexport const fetch = global?.fetch\nexport const XMLHttpRequest =\n global?.XMLHttpRequest && 'withCredentials' in new global.XMLHttpRequest() ? global.XMLHttpRequest : undefined\nexport const AbortController = global?.AbortController\nexport const userAgent = navigator?.userAgent\nexport const assignableWindow: Window &\n typeof globalThis &\n Record<string, any> & {\n __PosthogExtensions__?: PostHogExtensions\n } = win ?? ({} as any)\n\nexport { win as window }\n","import { SessionIdManager } from '../sessionid'\nimport { patch } from '../extensions/replay/rrweb-plugins/patch'\nimport { assignableWindow, window } from '../utils/globals'\n\nconst addTracingHeaders = (sessionManager: SessionIdManager, req: Request) => {\n const { sessionId, windowId } = sessionManager.checkAndGetSessionAndWindowId(true)\n req.headers.set('X-POSTHOG-SESSION-ID', sessionId)\n req.headers.set('X-POSTHOG-WINDOW-ID', windowId)\n}\n\nconst patchFetch = (sessionManager: SessionIdManager): (() => void) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return patch(window, 'fetch', (originalFetch: typeof fetch) => {\n return async function (url: URL | RequestInfo, init?: RequestInit | undefined) {\n // check IE earlier than this, we only initialize if Request is present\n // eslint-disable-next-line compat/compat\n const req = new Request(url, init)\n\n addTracingHeaders(sessionManager, req)\n\n return originalFetch(req)\n }\n })\n}\n\nconst patchXHR = (sessionManager: SessionIdManager): (() => void) => {\n return patch(\n // we can assert this is present because we've checked previously\n window!.XMLHttpRequest.prototype,\n 'open',\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (originalOpen: typeof XMLHttpRequest.prototype.open) => {\n return function (\n method: string,\n url: string | URL,\n async = true,\n username?: string | null,\n password?: string | null\n ) {\n // because this function is returned in its actual context `this` _is_ an XMLHttpRequest\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const xhr = this as XMLHttpRequest\n\n // check IE earlier than this, we only initialize if Request is present\n // eslint-disable-next-line compat/compat\n const req = new Request(url)\n\n addTracingHeaders(sessionManager, req)\n\n return originalOpen.call(xhr, method, req.url, async, username, password)\n }\n }\n )\n}\n\nassignableWindow.__PosthogExtensions__ = assignableWindow.__PosthogExtensions__ || {}\nconst patchFns = {\n _patchFetch: patchFetch,\n _patchXHR: patchXHR,\n}\nassignableWindow.__PosthogExtensions__.tracingHeadersPatchFns = patchFns\n\n// we used to put tracingHeadersPatchFns on window, and now we put it on __PosthogExtensions__\n// but that means that old clients which lazily load this extension are looking in the wrong place\n// yuck,\n// so we also put it directly on the window\n// when 1.161.1 is the oldest version seen in production we can remove this\nassignableWindow.postHogTracingHeadersPatchFns = patchFns\n\nexport default patchFns\n"],"names":["patch","source","name","replacement","original","wrapped","prototype","Object","defineProperties","__posthog_wrapped__","enumerable","value","_unused","win","window","undefined","global","globalThis","navigator","document","location","fetch","XMLHttpRequest","AbortController","userAgent","assignableWindow","addTracingHeaders","sessionManager","req","_sessionManager$check","checkAndGetSessionAndWindowId","sessionId","windowId","headers","set","__PosthogExtensions__","patchFns","_patchFetch","originalFetch","_ref","_regeneratorRuntime","mark","_callee","url","init","wrap","_context","prev","next","Request","abrupt","stop","_x","_x2","apply","this","arguments","_patchXHR","originalOpen","method","async","length","username","password","call","tracingHeadersPatchFns","postHogTracingHeadersPatchFns"],"mappings":"27MAKO,SAASA,EACZC,EACAC,EACAC,GAEA,IACI,KAAMD,KAAQD,GACV,OAAO,aAKX,IAAMG,EAAWH,EA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EAAAK,OAAA,GAAAT,EAC5B,mLAAA,OAAAU,SAAAA,EAAAC,GAAA,OAAAd,EAAAe,MAAAC,KAAAC,UAAA,CAAA,CARD,EASJ,GACJ,EAqCIC,UAnCa,SAAC9B,GACd,OAAO3B,EAEHc,EAAQQ,eAAehB,UACvB,QAGA,SAACoD,GACG,OAAO,SACHC,EACAhB,GAIF,IAHEiB,IAAKJ,UAAAK,OAAA,QAAA9C,IAAAyC,UAAA,KAAAA,UAAA,GACLM,EAAwBN,UAAAK,OAAAL,EAAAA,kBAAAzC,EACxBgD,EAAwBP,UAAAK,OAAAL,EAAAA,kBAAAzC,EASlBa,EAAM,IAAIqB,QAAQN,GAIxB,OAFAjB,EAAkBC,EAAgBC,GAE3B8B,EAAaM,KARRT,KAQkBI,EAAQ/B,EAAIe,IAAKiB,EAAOE,EAAUC,GAExE,GAER,GAOAtC,EAAiBU,sBAAsB8B,uBAAyB7B,EAOhEX,EAAiByC,8BAAgC9B"}
1
+ {"version":3,"file":"tracing-headers.js","sources":["../src/extensions/replay/rrweb-plugins/patch.ts","../src/utils/type-utils.ts","../src/utils/globals.ts","../src/entrypoints/tracing-headers.ts"],"sourcesContent":["// import { patch } from 'rrweb/typings/utils'\n// copied from https://github.com/rrweb-io/rrweb/blob/8aea5b00a4dfe5a6f59bd2ae72bb624f45e51e81/packages/rrweb/src/utils.ts#L129\n// which was copied from https://github.com/getsentry/sentry-javascript/blob/b2109071975af8bf0316d3b5b38f519bdaf5dc15/packages/utils/src/object.ts\nimport { isFunction } from '../../../utils/type-utils'\n\nexport function patch(\n source: { [key: string]: any },\n name: string,\n replacement: (...args: unknown[]) => unknown\n): () => void {\n try {\n if (!(name in source)) {\n return () => {\n //\n }\n }\n\n const original = source[name] as () => unknown\n const wrapped = replacement(original)\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (isFunction(wrapped)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n wrapped.prototype = wrapped.prototype || {}\n Object.defineProperties(wrapped, {\n __posthog_wrapped__: {\n enumerable: false,\n value: true,\n },\n })\n }\n\n source[name] = wrapped\n\n return () => {\n source[name] = original\n }\n } catch {\n return () => {\n //\n }\n // This can throw if multiple fill happens on a global object like XMLHttpRequest\n // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n }\n}\n","// eslint-disable-next-line posthog-js/no-direct-array-check\nconst nativeIsArray = Array.isArray\nconst ObjProto = Object.prototype\nexport const hasOwnProperty = ObjProto.hasOwnProperty\nconst toString = ObjProto.toString\n\nexport const isArray =\n nativeIsArray ||\n function (obj: any): obj is any[] {\n return toString.call(obj) === '[object Array]'\n }\nexport const isUint8Array = function (x: unknown): x is Uint8Array {\n return toString.call(x) === '[object Uint8Array]'\n}\n// from a comment on http://dbj.org/dbj/?p=286\n// fails on only one very rare and deliberate custom object:\n// let bomb = { toString : undefined, valueOf: function(o) { return \"function BOMBA!\"; }};\nexport const isFunction = function (f: any): f is (...args: any[]) => any {\n // eslint-disable-next-line posthog-js/no-direct-function-check\n return typeof f === 'function'\n}\n// Underscore Addons\nexport const isObject = function (x: unknown): x is Record<string, any> {\n // eslint-disable-next-line posthog-js/no-direct-object-check\n return x === Object(x) && !isArray(x)\n}\nexport const isEmptyObject = function (x: unknown): x is Record<string, any> {\n if (isObject(x)) {\n for (const key in x) {\n if (hasOwnProperty.call(x, key)) {\n return false\n }\n }\n return true\n }\n return false\n}\nexport const isUndefined = function (x: unknown): x is undefined {\n return x === void 0\n}\n\nexport const isString = function (x: unknown): x is string {\n // eslint-disable-next-line posthog-js/no-direct-string-check\n return toString.call(x) == '[object String]'\n}\n\nexport const isEmptyString = function (x: unknown): boolean {\n return isString(x) && x.trim().length === 0\n}\n\nexport const isNull = function (x: unknown): x is null {\n // eslint-disable-next-line posthog-js/no-direct-null-check\n return x === null\n}\n\n/*\n sometimes you want to check if something is null or undefined\n that's what this is for\n */\nexport const isNullish = function (x: unknown): x is null | undefined {\n return isUndefined(x) || isNull(x)\n}\n\nexport const isDate = function (x: unknown): x is Date {\n // eslint-disable-next-line posthog-js/no-direct-date-check\n return toString.call(x) == '[object Date]'\n}\nexport const isNumber = function (x: unknown): x is number {\n // eslint-disable-next-line posthog-js/no-direct-number-check\n return toString.call(x) == '[object Number]'\n}\nexport const isBoolean = function (x: unknown): x is boolean {\n // eslint-disable-next-line posthog-js/no-direct-boolean-check\n return toString.call(x) === '[object Boolean]'\n}\n\nexport const isDocument = (x: unknown): x is Document => {\n // eslint-disable-next-line posthog-js/no-direct-document-check\n return x instanceof Document\n}\n\nexport const isFormData = (x: unknown): x is FormData => {\n // eslint-disable-next-line posthog-js/no-direct-form-data-check\n return x instanceof FormData\n}\n\nexport const isFile = (x: unknown): x is File => {\n // eslint-disable-next-line posthog-js/no-direct-file-check\n return x instanceof File\n}\n","import { ErrorProperties } from '../extensions/exception-autocapture/error-conversion'\nimport type { PostHog } from '../posthog-core'\nimport { SessionIdManager } from '../sessionid'\nimport { ErrorEventArgs, ErrorMetadata, Properties } from '../types'\n\n/*\n * Global helpers to protect access to browser globals in a way that is safer for different targets\n * like DOM, SSR, Web workers etc.\n *\n * NOTE: Typically we want the \"window\" but globalThis works for both the typical browser context as\n * well as other contexts such as the web worker context. Window is still exported for any bits that explicitly require it.\n * If in doubt - export the global you need from this file and use that as an optional value. This way the code path is forced\n * to handle the case where the global is not available.\n */\n\n// eslint-disable-next-line no-restricted-globals\nconst win: (Window & typeof globalThis) | undefined = typeof window !== 'undefined' ? window : undefined\n\n/**\n * This is our contract between (potentially) lazily loaded extensions and the SDK\n * changes to this interface can be breaking changes for users of the SDK\n */\n\nexport type PostHogExtensionKind =\n | 'toolbar'\n | 'exception-autocapture'\n | 'web-vitals'\n | 'recorder'\n | 'tracing-headers'\n | 'surveys'\n\ninterface PostHogExtensions {\n loadExternalDependency?: (\n posthog: PostHog,\n kind: PostHogExtensionKind,\n callback: (error?: string | Event, event?: Event) => void\n ) => void\n\n loadSiteApp?: (posthog: PostHog, appUrl: string, callback: (error?: string | Event, event?: Event) => void) => void\n\n parseErrorAsProperties?: (\n [event, source, lineno, colno, error]: ErrorEventArgs,\n metadata?: ErrorMetadata\n ) => ErrorProperties\n errorWrappingFunctions?: {\n wrapOnError: (captureFn: (props: Properties) => void) => () => void\n wrapUnhandledRejection: (captureFn: (props: Properties) => void) => () => void\n }\n rrweb?: { record: any; version: string; rrwebVersion: string }\n rrwebPlugins?: { getRecordConsolePlugin: any; getRecordNetworkPlugin?: any }\n canActivateRepeatedly?: (survey: any) => boolean\n generateSurveys?: (posthog: PostHog) => any | undefined\n postHogWebVitalsCallbacks?: {\n onLCP: (metric: any) => void\n onCLS: (metric: any) => void\n onFCP: (metric: any) => void\n onINP: (metric: any) => void\n }\n tracingHeadersPatchFns?: {\n _patchFetch: (sessionManager: SessionIdManager) => () => void\n _patchXHR: (sessionManager: any) => () => void\n }\n}\n\nconst global: typeof globalThis | undefined = typeof globalThis !== 'undefined' ? globalThis : win\n\nexport const ArrayProto = Array.prototype\nexport const nativeForEach = ArrayProto.forEach\nexport const nativeIndexOf = ArrayProto.indexOf\n\nexport const navigator = global?.navigator\nexport const document = global?.document\nexport const location = global?.location\nexport const fetch = global?.fetch\nexport const XMLHttpRequest =\n global?.XMLHttpRequest && 'withCredentials' in new global.XMLHttpRequest() ? global.XMLHttpRequest : undefined\nexport const AbortController = global?.AbortController\nexport const userAgent = navigator?.userAgent\nexport const assignableWindow: Window &\n typeof globalThis &\n Record<string, any> & {\n __PosthogExtensions__?: PostHogExtensions\n } = win ?? ({} as any)\n\nexport { win as window }\n","import { SessionIdManager } from '../sessionid'\nimport { patch } from '../extensions/replay/rrweb-plugins/patch'\nimport { assignableWindow, window } from '../utils/globals'\n\nconst addTracingHeaders = (sessionManager: SessionIdManager, req: Request) => {\n const { sessionId, windowId } = sessionManager.checkAndGetSessionAndWindowId(true)\n req.headers.set('X-POSTHOG-SESSION-ID', sessionId)\n req.headers.set('X-POSTHOG-WINDOW-ID', windowId)\n}\n\nconst patchFetch = (sessionManager: SessionIdManager): (() => void) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return patch(window, 'fetch', (originalFetch: typeof fetch) => {\n return async function (url: URL | RequestInfo, init?: RequestInit | undefined) {\n // check IE earlier than this, we only initialize if Request is present\n // eslint-disable-next-line compat/compat\n const req = new Request(url, init)\n\n addTracingHeaders(sessionManager, req)\n\n return originalFetch(req)\n }\n })\n}\n\nconst patchXHR = (sessionManager: SessionIdManager): (() => void) => {\n return patch(\n // we can assert this is present because we've checked previously\n window!.XMLHttpRequest.prototype,\n 'open',\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (originalOpen: typeof XMLHttpRequest.prototype.open) => {\n return function (\n method: string,\n url: string | URL,\n async = true,\n username?: string | null,\n password?: string | null\n ) {\n // because this function is returned in its actual context `this` _is_ an XMLHttpRequest\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const xhr = this as XMLHttpRequest\n\n // check IE earlier than this, we only initialize if Request is present\n // eslint-disable-next-line compat/compat\n const req = new Request(url)\n\n addTracingHeaders(sessionManager, req)\n\n return originalOpen.call(xhr, method, req.url, async, username, password)\n }\n }\n )\n}\n\nassignableWindow.__PosthogExtensions__ = assignableWindow.__PosthogExtensions__ || {}\nconst patchFns = {\n _patchFetch: patchFetch,\n _patchXHR: patchXHR,\n}\nassignableWindow.__PosthogExtensions__.tracingHeadersPatchFns = patchFns\n\n// we used to put tracingHeadersPatchFns on window, and now we put it on __PosthogExtensions__\n// but that means that old clients which lazily load this extension are looking in the wrong place\n// yuck,\n// so we also put it directly on the window\n// when 1.161.1 is the oldest version seen in production we can remove this\nassignableWindow.postHogTracingHeadersPatchFns = patchFns\n\nexport default patchFns\n"],"names":["patch","source","name","replacement","original","wrapped","prototype","Object","defineProperties","__posthog_wrapped__","enumerable","value","_unused","win","window","undefined","global","globalThis","navigator","document","location","fetch","XMLHttpRequest","AbortController","userAgent","assignableWindow","addTracingHeaders","sessionManager","req","_sessionManager$check","checkAndGetSessionAndWindowId","sessionId","windowId","headers","set","__PosthogExtensions__","patchFns","_patchFetch","originalFetch","_ref","_regeneratorRuntime","mark","_callee","url","init","wrap","_context","prev","next","Request","abrupt","stop","_x","_x2","apply","this","arguments","_patchXHR","originalOpen","method","async","length","username","password","call","tracingHeadersPatchFns","postHogTracingHeadersPatchFns"],"mappings":"27MAKO,SAASA,EACZC,EACAC,EACAC,GAEA,IACI,KAAMD,KAAQD,GACV,OAAO,aAKX,IAAMG,EAAWH,EAAOC,GAClBG,EAAUF,EAAYC,GAiB5B,MChBgB,mBDGDC,IAEXA,EAAQC,UAAYD,EAAQC,WAAa,CAAA,EACzCC,OAAOC,iBAAiBH,EAAS,CAC7BI,oBAAqB,CACjBC,YAAY,EACZC,OAAO,MAKnBV,EAAOC,GAAQG,EAER,WACHJ,EAAOC,GAAQE,EAEtB,CAAC,MAAAQ,GACE,OAAO,YAKX,CACJ,CE7BA,IAAMC,EAAkE,oBAAXC,OAAyBA,YAASC,EAgDzFC,EAA8D,oBAAfC,WAA6BA,WAAaJ,EAMlFK,EAAYF,aAAM,EAANA,EAAQE,UACTF,SAAAA,EAAQG,SACRH,SAAAA,EAAQI,SACXJ,SAAAA,EAAQK,MAEzBL,SAAAA,EAAQM,gBAAkB,oBAAqB,IAAIN,EAAOM,gBAAmBN,EAAOM,eACzDN,SAAAA,EAAQO,gBACdL,SAAAA,EAAWM,UAC7B,IAAMC,EAILZ,QAAAA,EAAQ,CAAU,EC9EpBa,EAAoB,SAACC,EAAkCC,GACzD,IAAAC,EAAgCF,EAAeG,+BAA8B,GAArEC,EAASF,EAATE,UAAWC,EAAQH,EAARG,SACnBJ,EAAIK,QAAQC,IAAI,uBAAwBH,GACxCH,EAAIK,QAAQC,IAAI,sBAAuBF,EAC3C,EAkDAP,EAAiBU,sBAAwBV,EAAiBU,uBAAyB,GACnF,IAAMC,EAAW,CACbC,YAlDe,SAACV,GAGhB,OAAO3B,EAAMc,EAAQ,SAAS,SAACwB,GAC3B,OAAA,WAAA,MAAAC,KAAAC,IAAAC,MAAO,SAAAC,EAAgBC,EAAwBC,GAA8B,IAAAhB,EAAA,OAAAY,IAAAK,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAKnC,OAFhCpB,EAAM,IAAIqB,QAAQN,EAAKC,GAE7BlB,EAAkBC,EAAgBC,GAAIkB,EAAAI,gBAE/BZ,EAAcV,IAAI,KAAA,EAAA,IAAA,MAAA,OAAAkB,EAAAK,OAAA,GAAAT,EAC5B,mLAAA,OAAAU,SAAAA,EAAAC,GAAA,OAAAd,EAAAe,MAAAC,KAAAC,UAAA,CAAA,CARD,EASJ,GACJ,EAqCIC,UAnCa,SAAC9B,GACd,OAAO3B,EAEHc,EAAQQ,eAAehB,UACvB,QAGA,SAACoD,GACG,OAAO,SACHC,EACAhB,GAIF,IAHEiB,IAAKJ,UAAAK,OAAA,QAAA9C,IAAAyC,UAAA,KAAAA,UAAA,GACLM,EAAwBN,UAAAK,OAAAL,EAAAA,kBAAAzC,EACxBgD,EAAwBP,UAAAK,OAAAL,EAAAA,kBAAAzC,EASlBa,EAAM,IAAIqB,QAAQN,GAIxB,OAFAjB,EAAkBC,EAAgBC,GAE3B8B,EAAaM,KARRT,KAQkBI,EAAQ/B,EAAIe,IAAKiB,EAAOE,EAAUC,GAExE,GAER,GAOAtC,EAAiBU,sBAAsB8B,uBAAyB7B,EAOhEX,EAAiByC,8BAAgC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"web-vitals.js","sources":["../node_modules/.pnpm/web-vitals@4.2.0/node_modules/web-vitals/dist/web-vitals.js","../node_modules/.pnpm/web-vitals@4.2.0/node_modules/web-vitals/dist/web-vitals.attribution.js","../src/utils/globals.ts","../src/entrypoints/web-vitals.ts"],"sourcesContent":["var e,n,t,r,i,o=-1,a=function(e){addEventListener(\"pageshow\",(function(n){n.persisted&&(o=n.timeStamp,e(n))}),!0)},c=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType(\"navigation\")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},u=function(){var e=c();return e&&e.activationStart||0},f=function(e,n){var t=c(),r=\"navigate\";o>=0?r=\"back-forward-cache\":t&&(document.prerendering||u()>0?r=\"prerender\":document.wasDiscarded?r=\"restore\":t.type&&(r=t.type.replace(/_/g,\"-\")));return{name:e,value:void 0===n?-1:n,rating:\"good\",delta:0,entries:[],id:\"v4-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},s=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},t||{})),r}}catch(e){}},d=function(e,n,t,r){var i,o;return function(a){n.value>=0&&(a||r)&&((o=n.value-(i||0))||void 0===i)&&(i=n.value,n.delta=o,n.rating=function(e,n){return e>n[1]?\"poor\":e>n[0]?\"needs-improvement\":\"good\"}(n.value,t),e(n))}},l=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},p=function(e){document.addEventListener(\"visibilitychange\",(function(){\"hidden\"===document.visibilityState&&e()}))},v=function(e){var n=!1;return function(){n||(e(),n=!0)}},m=-1,h=function(){return\"hidden\"!==document.visibilityState||document.prerendering?1/0:0},g=function(e){\"hidden\"===document.visibilityState&&m>-1&&(m=\"visibilitychange\"===e.type?e.timeStamp:0,T())},y=function(){addEventListener(\"visibilitychange\",g,!0),addEventListener(\"prerenderingchange\",g,!0)},T=function(){removeEventListener(\"visibilitychange\",g,!0),removeEventListener(\"prerenderingchange\",g,!0)},E=function(){return m<0&&(m=h(),y(),a((function(){setTimeout((function(){m=h(),y()}),0)}))),{get firstHiddenTime(){return m}}},C=function(e){document.prerendering?addEventListener(\"prerenderingchange\",(function(){return e()}),!0):e()},b=[1800,3e3],S=function(e,n){n=n||{},C((function(){var t,r=E(),i=f(\"FCP\"),o=s(\"paint\",(function(e){e.forEach((function(e){\"first-contentful-paint\"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-u(),0),i.entries.push(e),t(!0)))}))}));o&&(t=d(e,i,b,n.reportAllChanges),a((function(r){i=f(\"FCP\"),t=d(e,i,b,n.reportAllChanges),l((function(){i.value=performance.now()-r.timeStamp,t(!0)}))})))}))},L=[.1,.25],w=function(e,n){n=n||{},S(v((function(){var t,r=f(\"CLS\",0),i=0,o=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var n=o[0],t=o[o.length-1];i&&e.startTime-t.startTime<1e3&&e.startTime-n.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,t())},u=s(\"layout-shift\",c);u&&(t=d(e,r,L,n.reportAllChanges),p((function(){c(u.takeRecords()),t(!0)})),a((function(){i=0,r=f(\"CLS\",0),t=d(e,r,L,n.reportAllChanges),l((function(){return t()}))})),setTimeout(t,0))})))},A=0,I=1/0,P=0,M=function(e){e.forEach((function(e){e.interactionId&&(I=Math.min(I,e.interactionId),P=Math.max(P,e.interactionId),A=P?(P-I)/7+1:0)}))},k=function(){\"interactionCount\"in performance||e||(e=s(\"event\",M,{type:\"event\",buffered:!0,durationThreshold:0}))},F=[],D=new Map,x=0,R=function(){return(e?A:performance.interactionCount||0)-x},B=[],H=function(e){if(B.forEach((function(n){return n(e)})),e.interactionId||\"first-input\"===e.entryType){var n=F[F.length-1],t=D.get(e.interactionId);if(t||F.length<10||e.duration>n.latency){if(t)e.duration>t.latency?(t.entries=[e],t.latency=e.duration):e.duration===t.latency&&e.startTime===t.entries[0].startTime&&t.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};D.set(r.id,r),F.push(r)}F.sort((function(e,n){return n.latency-e.latency})),F.length>10&&F.splice(10).forEach((function(e){return D.delete(e.id)}))}}},q=function(e){var n=self.requestIdleCallback||self.setTimeout,t=-1;return e=v(e),\"hidden\"===document.visibilityState?e():(t=n(e),p(e)),t},O=[200,500],N=function(e,n){\"PerformanceEventTiming\"in self&&\"interactionId\"in PerformanceEventTiming.prototype&&(n=n||{},C((function(){var t;k();var r,i=f(\"INP\"),o=function(e){q((function(){e.forEach(H);var n,t=(n=Math.min(F.length-1,Math.floor(R()/50)),F[n]);t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,r())}))},c=s(\"event\",o,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});r=d(e,i,O,n.reportAllChanges),c&&(c.observe({type:\"first-input\",buffered:!0}),p((function(){o(c.takeRecords()),r(!0)})),a((function(){x=0,F.length=0,D.clear(),i=f(\"INP\"),r=d(e,i,O,n.reportAllChanges)})))})))},j=[2500,4e3],_={},z=function(e,n){n=n||{},C((function(){var t,r=E(),i=f(\"LCP\"),o=function(e){n.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-u(),0),i.entries=[e],t())}))},c=s(\"largest-contentful-paint\",o);if(c){t=d(e,i,j,n.reportAllChanges);var m=v((function(){_[i.id]||(o(c.takeRecords()),c.disconnect(),_[i.id]=!0,t(!0))}));[\"keydown\",\"click\"].forEach((function(e){addEventListener(e,(function(){return q(m)}),!0)})),p(m),a((function(r){i=f(\"LCP\"),t=d(e,i,j,n.reportAllChanges),l((function(){i.value=performance.now()-r.timeStamp,_[i.id]=!0,t(!0)}))}))}}))},G=[800,1800],J=function e(n){document.prerendering?C((function(){return e(n)})):\"complete\"!==document.readyState?addEventListener(\"load\",(function(){return e(n)}),!0):setTimeout(n,0)},K=function(e,n){n=n||{};var t=f(\"TTFB\"),r=d(e,t,G,n.reportAllChanges);J((function(){var i=c();i&&(t.value=Math.max(i.responseStart-u(),0),t.entries=[i],r(!0),a((function(){t=f(\"TTFB\",0),(r=d(e,t,G,n.reportAllChanges))(!0)})))}))},Q={passive:!0,capture:!0},U=new Date,V=function(e,i){n||(n=i,t=e,r=new Date,Y(removeEventListener),W())},W=function(){if(t>=0&&t<r-U){var e={entryType:\"first-input\",name:n.type,target:n.target,cancelable:n.cancelable,startTime:n.timeStamp,processingStart:n.timeStamp+t};i.forEach((function(n){n(e)})),i=[]}},X=function(e){if(e.cancelable){var n=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,n){var t=function(){V(e,n),i()},r=function(){i()},i=function(){removeEventListener(\"pointerup\",t,Q),removeEventListener(\"pointercancel\",r,Q)};addEventListener(\"pointerup\",t,Q),addEventListener(\"pointercancel\",r,Q)}(n,e):V(n,e)}},Y=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(n){return e(n,X,Q)}))},Z=[100,300],$=function(e,r){r=r||{},C((function(){var o,c=E(),u=f(\"FID\"),l=function(e){e.startTime<c.firstHiddenTime&&(u.value=e.processingStart-e.startTime,u.entries.push(e),o(!0))},m=function(e){e.forEach(l)},h=s(\"first-input\",m);o=d(e,u,Z,r.reportAllChanges),h&&(p(v((function(){m(h.takeRecords()),h.disconnect()}))),a((function(){var a;u=f(\"FID\"),o=d(e,u,Z,r.reportAllChanges),i=[],t=-1,n=null,Y(addEventListener),a=l,i.push(a),W()})))}))};export{L as CLSThresholds,b as FCPThresholds,Z as FIDThresholds,O as INPThresholds,j as LCPThresholds,G as TTFBThresholds,w as onCLS,S as onFCP,$ as onFID,N as onINP,z as onLCP,K as onTTFB};\n","var t,e,n,r=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType(\"navigation\")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},i=function(t){if(\"loading\"===document.readyState)return\"loading\";var e=r();if(e){if(t<e.domInteractive)return\"loading\";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return\"dom-interactive\";if(0===e.domComplete||t<e.domComplete)return\"dom-content-loaded\"}return\"complete\"},a=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,\"\")},o=function(t,e){var n=\"\";try{for(;t&&9!==t.nodeType;){var r=t,i=r.id?\"#\"+r.id:a(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?\".\"+r.classList.value.trim().replace(/\\s+/g,\".\"):\"\");if(n.length+i.length>(e||100)-1)return n||i;if(n=n?i+\">\"+n:i,r.id)break;t=r.parentNode}}catch(t){}return n},c=-1,u=function(){return c},s=function(t){addEventListener(\"pageshow\",(function(e){e.persisted&&(c=e.timeStamp,t(e))}),!0)},f=function(){var t=r();return t&&t.activationStart||0},d=function(t,e){var n=r(),i=\"navigate\";u()>=0?i=\"back-forward-cache\":n&&(document.prerendering||f()>0?i=\"prerender\":document.wasDiscarded?i=\"restore\":n.type&&(i=n.type.replace(/_/g,\"-\")));return{name:t,value:void 0===e?-1:e,rating:\"good\",delta:0,entries:[],id:\"v4-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},l=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},m=function(t,e,n,r){var i,a;return function(o){e.value>=0&&(o||r)&&((a=e.value-(i||0))||void 0===i)&&(i=e.value,e.delta=a,e.rating=function(t,e){return t>e[1]?\"poor\":t>e[0]?\"needs-improvement\":\"good\"}(e.value,n),t(e))}},p=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},v=function(t){document.addEventListener(\"visibilitychange\",(function(){\"hidden\"===document.visibilityState&&t()}))},g=function(t){var e=!1;return function(){e||(t(),e=!0)}},h=-1,T=function(){return\"hidden\"!==document.visibilityState||document.prerendering?1/0:0},y=function(t){\"hidden\"===document.visibilityState&&h>-1&&(h=\"visibilitychange\"===t.type?t.timeStamp:0,S())},E=function(){addEventListener(\"visibilitychange\",y,!0),addEventListener(\"prerenderingchange\",y,!0)},S=function(){removeEventListener(\"visibilitychange\",y,!0),removeEventListener(\"prerenderingchange\",y,!0)},b=function(){return h<0&&(h=T(),E(),s((function(){setTimeout((function(){h=T(),E()}),0)}))),{get firstHiddenTime(){return h}}},L=function(t){document.prerendering?addEventListener(\"prerenderingchange\",(function(){return t()}),!0):t()},C=[1800,3e3],M=function(t,e){e=e||{},L((function(){var n,r=b(),i=d(\"FCP\"),a=l(\"paint\",(function(t){t.forEach((function(t){\"first-contentful-paint\"===t.name&&(a.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-f(),0),i.entries.push(t),n(!0)))}))}));a&&(n=m(t,i,C,e.reportAllChanges),s((function(r){i=d(\"FCP\"),n=m(t,i,C,e.reportAllChanges),p((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},D=[.1,.25],w=function(t,e){!function(t,e){e=e||{},M(g((function(){var n,r=d(\"CLS\",0),i=0,a=[],o=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=a[0],n=a[a.length-1];i&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(i+=t.value,a.push(t)):(i=t.value,a=[t])}})),i>r.value&&(r.value=i,r.entries=a,n())},c=l(\"layout-shift\",o);c&&(n=m(t,r,D,e.reportAllChanges),v((function(){o(c.takeRecords()),n(!0)})),s((function(){i=0,r=d(\"CLS\",0),n=m(t,r,D,e.reportAllChanges),p((function(){return n()}))})),setTimeout(n,0))})))}((function(e){var n=function(t){var e,n={};if(t.entries.length){var r=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(r&&r.sources&&r.sources.length){var a=(e=r.sources).find((function(t){return t.node&&1===t.node.nodeType}))||e[0];a&&(n={largestShiftTarget:o(a.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:a,largestShiftEntry:r,loadState:i(r.startTime)})}}return Object.assign(t,{attribution:n})}(e);t(n)}),e)},x=function(t,e){M((function(e){var n=function(t){var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:i(u())};if(t.entries.length){var n=r(),a=t.entries[t.entries.length-1];if(n){var o=n.activationStart||0,c=Math.max(0,n.responseStart-o);e={timeToFirstByte:c,firstByteToFCP:t.value-c,loadState:i(t.entries[0].startTime),navigationEntry:n,fcpEntry:a}}}return Object.assign(t,{attribution:e})}(e);t(n)}),e)},I=0,k=1/0,A=0,F=function(t){t.forEach((function(t){t.interactionId&&(k=Math.min(k,t.interactionId),A=Math.max(A,t.interactionId),I=A?(A-k)/7+1:0)}))},P=function(){\"interactionCount\"in performance||t||(t=l(\"event\",F,{type:\"event\",buffered:!0,durationThreshold:0}))},B=[],O=new Map,R=0,j=function(){return(t?I:performance.interactionCount||0)-R},q=[],H=function(t){if(q.forEach((function(e){return e(t)})),t.interactionId||\"first-input\"===t.entryType){var e=B[B.length-1],n=O.get(t.interactionId);if(n||B.length<10||t.duration>e.latency){if(n)t.duration>n.latency?(n.entries=[t],n.latency=t.duration):t.duration===n.latency&&t.startTime===n.entries[0].startTime&&n.entries.push(t);else{var r={id:t.interactionId,latency:t.duration,entries:[t]};O.set(r.id,r),B.push(r)}B.sort((function(t,e){return e.latency-t.latency})),B.length>10&&B.splice(10).forEach((function(t){return O.delete(t.id)}))}}},N=function(t){var e=self.requestIdleCallback||self.setTimeout,n=-1;return t=g(t),\"hidden\"===document.visibilityState?t():(n=e(t),v(t)),n},W=[200,500],z=function(t,e){\"PerformanceEventTiming\"in self&&\"interactionId\"in PerformanceEventTiming.prototype&&(e=e||{},L((function(){var n;P();var r,i=d(\"INP\"),a=function(t){N((function(){t.forEach(H);var e,n=(e=Math.min(B.length-1,Math.floor(j()/50)),B[e]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},o=l(\"event\",a,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40});r=m(t,i,W,e.reportAllChanges),o&&(o.observe({type:\"first-input\",buffered:!0}),v((function(){a(o.takeRecords()),r(!0)})),s((function(){R=0,B.length=0,O.clear(),i=d(\"INP\"),r=m(t,i,W,e.reportAllChanges)})))})))},U=[],V=[],_=new WeakMap,G=new Map,J=-1,K=function(t){U=U.concat(t),Q()},Q=function(){J<0&&(J=N(X))},X=function(){G.size>10&&G.forEach((function(t,e){O.has(e)||G.delete(e)}));var t=B.map((function(t){return _.get(t.entries[0])})),e=V.length-50;V=V.filter((function(n,r){return r>=e||t.includes(n)}));for(var r=new Set,i=0;i<V.length;i++){var a=V[i];et(a.startTime,a.processingEnd).forEach((function(t){r.add(t)}))}for(var o=0;o<50;o++){var c=U[U.length-1-o];if(!c||c.startTime<n)break;r.add(c)}U=Array.from(r),J=-1};q.push((function(t){t.interactionId&&t.target&&!G.has(t.interactionId)&&G.set(t.interactionId,t.target)}),(function(t){var e,r=t.startTime+t.duration;n=Math.max(n,t.processingEnd);for(var i=V.length-1;i>=0;i--){var a=V[i];if(Math.abs(r-a.renderTime)<=8){(e=a).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),e.entries.push(t);break}}e||(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:[t]},V.push(e)),(t.interactionId||\"first-input\"===t.entryType)&&_.set(t,e),Q()}));var Y,Z,$,tt,et=function(t,e){for(var n,r=[],i=0;n=U[i];i++)if(!(n.startTime+n.duration<t)){if(n.startTime>e)break;r.push(n)}return r},nt=function(t,n){e||(e=l(\"long-animation-frame\",K)),z((function(e){var n=function(t){var e=t.entries[0],n=_.get(e),r=e.processingStart,a=n.processingEnd,c=n.entries.sort((function(t,e){return t.processingStart-e.processingStart})),u=et(e.startTime,a),s=t.entries.find((function(t){return t.target})),f=s&&s.target||G.get(e.interactionId),d=[e.startTime+e.duration,a].concat(u.map((function(t){return t.startTime+t.duration}))),l=Math.max.apply(Math,d),m={interactionTarget:o(f),interactionTargetElement:f,interactionType:e.name.startsWith(\"key\")?\"keyboard\":\"pointer\",interactionTime:e.startTime,nextPaintTime:l,processedEventEntries:c,longAnimationFrameEntries:u,inputDelay:r-e.startTime,processingDuration:a-r,presentationDelay:Math.max(l-a,0),loadState:i(e.startTime)};return Object.assign(t,{attribution:m})}(e);t(n)}),n)},rt=[2500,4e3],it={},at=function(t,e){!function(t,e){e=e||{},L((function(){var n,r=b(),i=d(\"LCP\"),a=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-f(),0),i.entries=[t],n())}))},o=l(\"largest-contentful-paint\",a);if(o){n=m(t,i,rt,e.reportAllChanges);var c=g((function(){it[i.id]||(a(o.takeRecords()),o.disconnect(),it[i.id]=!0,n(!0))}));[\"keydown\",\"click\"].forEach((function(t){addEventListener(t,(function(){return N(c)}),!0)})),v(c),s((function(r){i=d(\"LCP\"),n=m(t,i,rt,e.reportAllChanges),p((function(){i.value=performance.now()-r.timeStamp,it[i.id]=!0,n(!0)}))}))}}))}((function(e){var n=function(t){var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var n=r();if(n){var i=n.activationStart||0,a=t.entries[t.entries.length-1],c=a.url&&performance.getEntriesByType(\"resource\").filter((function(t){return t.name===a.url}))[0],u=Math.max(0,n.responseStart-i),s=Math.max(u,c?(c.requestStart||c.startTime)-i:0),f=Math.max(s,c?c.responseEnd-i:0),d=Math.max(f,a.startTime-i);e={element:o(a.element),timeToFirstByte:u,resourceLoadDelay:s-u,resourceLoadDuration:f-s,elementRenderDelay:d-f,navigationEntry:n,lcpEntry:a},a.url&&(e.url=a.url),c&&(e.lcpResourceEntry=c)}}return Object.assign(t,{attribution:e})}(e);t(n)}),e)},ot=[800,1800],ct=function t(e){document.prerendering?L((function(){return t(e)})):\"complete\"!==document.readyState?addEventListener(\"load\",(function(){return t(e)}),!0):setTimeout(e,0)},ut=function(t,e){e=e||{};var n=d(\"TTFB\"),i=m(t,n,ot,e.reportAllChanges);ct((function(){var a=r();a&&(n.value=Math.max(a.responseStart-f(),0),n.entries=[a],i(!0),s((function(){n=d(\"TTFB\",0),(i=m(t,n,ot,e.reportAllChanges))(!0)})))}))},st=function(t,e){ut((function(e){var n=function(t){var e={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(t.entries.length){var n=t.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),a=Math.max(n.domainLookupStart-r,0),o=Math.max(n.connectStart-r,0),c=Math.max(n.connectEnd-r,0);e={waitingDuration:i,cacheDuration:a-i,dnsDuration:o-a,connectionDuration:c-o,requestDuration:t.value-c,navigationEntry:n}}return Object.assign(t,{attribution:e})}(e);t(n)}),e)},ft={passive:!0,capture:!0},dt=new Date,lt=function(t,e){Y||(Y=e,Z=t,$=new Date,vt(removeEventListener),mt())},mt=function(){if(Z>=0&&Z<$-dt){var t={entryType:\"first-input\",name:Y.type,target:Y.target,cancelable:Y.cancelable,startTime:Y.timeStamp,processingStart:Y.timeStamp+Z};tt.forEach((function(e){e(t)})),tt=[]}},pt=function(t){if(t.cancelable){var e=(t.timeStamp>1e12?new Date:performance.now())-t.timeStamp;\"pointerdown\"==t.type?function(t,e){var n=function(){lt(t,e),i()},r=function(){i()},i=function(){removeEventListener(\"pointerup\",n,ft),removeEventListener(\"pointercancel\",r,ft)};addEventListener(\"pointerup\",n,ft),addEventListener(\"pointercancel\",r,ft)}(e,t):lt(e,t)}},vt=function(t){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(e){return t(e,pt,ft)}))},gt=[100,300],ht=function(t,e){e=e||{},L((function(){var n,r=b(),i=d(\"FID\"),a=function(t){t.startTime<r.firstHiddenTime&&(i.value=t.processingStart-t.startTime,i.entries.push(t),n(!0))},o=function(t){t.forEach(a)},c=l(\"first-input\",o);n=m(t,i,gt,e.reportAllChanges),c&&(v(g((function(){o(c.takeRecords()),c.disconnect()}))),s((function(){var r;i=d(\"FID\"),n=m(t,i,gt,e.reportAllChanges),tt=[],Z=-1,Y=null,vt(addEventListener),r=a,tt.push(r),mt()})))}))},Tt=function(t,e){ht((function(e){var n=function(t){var e=t.entries[0],n={eventTarget:o(e.target),eventType:e.name,eventTime:e.startTime,eventEntry:e,loadState:i(e.startTime)};return Object.assign(t,{attribution:n})}(e);t(n)}),e)};export{D as CLSThresholds,C as FCPThresholds,gt as FIDThresholds,W as INPThresholds,rt as LCPThresholds,ot as TTFBThresholds,w as onCLS,x as onFCP,Tt as onFID,nt as onINP,at as onLCP,st as onTTFB};\n","import type { PostHog } from '../posthog-core'\nimport { SessionIdManager } from '../sessionid'\nimport { ErrorEventArgs, ErrorProperties, Properties } from '../types'\n\n/*\n * Global helpers to protect access to browser globals in a way that is safer for different targets\n * like DOM, SSR, Web workers etc.\n *\n * NOTE: Typically we want the \"window\" but globalThis works for both the typical browser context as\n * well as other contexts such as the web worker context. Window is still exported for any bits that explicitly require it.\n * If in doubt - export the global you need from this file and use that as an optional value. This way the code path is forced\n * to handle the case where the global is not available.\n */\n\n// eslint-disable-next-line no-restricted-globals\nconst win: (Window & typeof globalThis) | undefined = typeof window !== 'undefined' ? window : undefined\n\n/**\n * This is our contract between (potentially) lazily loaded extensions and the SDK\n * changes to this interface can be breaking changes for users of the SDK\n */\n\nexport type PostHogExtensionKind =\n | 'toolbar'\n | 'exception-autocapture'\n | 'web-vitals'\n | 'recorder'\n | 'tracing-headers'\n | 'surveys'\n\ninterface PostHogExtensions {\n loadExternalDependency?: (\n posthog: PostHog,\n kind: PostHogExtensionKind,\n callback: (error?: string | Event, event?: Event) => void\n ) => void\n\n loadSiteApp?: (posthog: PostHog, appUrl: string, callback: (error?: string | Event, event?: Event) => void) => void\n\n parseErrorAsProperties?: ([event, source, lineno, colno, error]: ErrorEventArgs) => ErrorProperties\n errorWrappingFunctions?: {\n wrapOnError: (captureFn: (props: Properties) => void) => () => void\n wrapUnhandledRejection: (captureFn: (props: Properties) => void) => () => void\n }\n rrweb?: { record: any; version: string; rrwebVersion: string }\n rrwebPlugins?: { getRecordConsolePlugin: any; getRecordNetworkPlugin?: any }\n canActivateRepeatedly?: (survey: any) => boolean\n generateSurveys?: (posthog: PostHog) => any | undefined\n postHogWebVitalsCallbacks?: {\n onLCP: (metric: any) => void\n onCLS: (metric: any) => void\n onFCP: (metric: any) => void\n onINP: (metric: any) => void\n }\n tracingHeadersPatchFns?: {\n _patchFetch: (sessionManager: SessionIdManager) => () => void\n _patchXHR: (sessionManager: any) => () => void\n }\n}\n\nconst global: typeof globalThis | undefined = typeof globalThis !== 'undefined' ? globalThis : win\n\nexport const ArrayProto = Array.prototype\nexport const nativeForEach = ArrayProto.forEach\nexport const nativeIndexOf = ArrayProto.indexOf\n\nexport const navigator = global?.navigator\nexport const document = global?.document\nexport const location = global?.location\nexport const fetch = global?.fetch\nexport const XMLHttpRequest =\n global?.XMLHttpRequest && 'withCredentials' in new global.XMLHttpRequest() ? global.XMLHttpRequest : undefined\nexport const AbortController = global?.AbortController\nexport const userAgent = navigator?.userAgent\nexport const assignableWindow: Window &\n typeof globalThis &\n Record<string, any> & {\n __PosthogExtensions__?: PostHogExtensions\n } = win ?? ({} as any)\n\nexport { win as window }\n","import { onLCP, onCLS, onFCP } from 'web-vitals'\nimport { onINP } from 'web-vitals/attribution'\nimport { assignableWindow } from '../utils/globals'\n\nconst postHogWebVitalsCallbacks = {\n onLCP,\n onCLS,\n onFCP,\n onINP,\n}\n\nassignableWindow.__PosthogExtensions__ = assignableWindow.__PosthogExtensions__ || {}\nassignableWindow.__PosthogExtensions__.postHogWebVitalsCallbacks = postHogWebVitalsCallbacks\n\n// we used to put posthogWebVitalsCallbacks on window, and now we put it on __PosthogExtensions__\n// but that means that old clients which lazily load this extension are looking in the wrong place\n// yuck,\n// so we also put it directly on the window\n// when 1.161.1 is the oldest version seen in production we can remove this\nassignableWindow.postHogWebVitalsCallbacks = postHogWebVitalsCallbacks\n\nexport default postHogWebVitalsCallbacks\n"],"names":["t","e","n","o","a","addEventListener","persisted","timeStamp","c","self","performance","getEntriesByType","responseStart","now","u","activationStart","f","r","document","prerendering","wasDiscarded","type","replace","name","value","rating","delta","entries","id","concat","Date","Math","floor","random","navigationType","s","PerformanceObserver","supportedEntryTypes","includes","Promise","resolve","then","getEntries","observe","Object","assign","buffered","d","i","l","requestAnimationFrame","p","visibilityState","v","m","h","g","T","y","removeEventListener","E","setTimeout","firstHiddenTime","C","b","S","forEach","disconnect","startTime","max","push","reportAllChanges","L","j","_","readyState","domInteractive","domContentLoadedEventStart","domComplete","nodeName","nodeType","toLowerCase","toUpperCase","classList","trim","length","parentNode","I","k","A","F","interactionId","min","P","durationThreshold","B","O","Map","R","interactionCount","q","H","entryType","get","duration","latency","set","sort","splice","delete","N","requestIdleCallback","W","z","PerformanceEventTiming","prototype","takeRecords","clear","U","V","WeakMap","G","J","K","Q","X","size","has","map","filter","Set","et","processingEnd","add","Array","from","target","abs","renderTime","processingStart","win","window","undefined","global","globalThis","navigator","location","fetch","XMLHttpRequest","AbortController","userAgent","assignableWindow","postHogWebVitalsCallbacks","onLCP","slice","onCLS","hadRecentInput","onFCP","onINP","find","apply","interactionTarget","interactionTargetElement","interactionType","startsWith","interactionTime","nextPaintTime","processedEventEntries","longAnimationFrameEntries","inputDelay","processingDuration","presentationDelay","loadState","attribution","__PosthogExtensions__"],"mappings":"yBAAA,ICAIA,EAAEC,EAAEC,EDAMC,GAAG,EAAEC,EAAE,SAASH,GAAGI,iBAAiB,YAAY,SAASH,GAAGA,EAAEI,YAAYH,EAAED,EAAEK,UAAUN,EAAEC,OAAM,IAAKM,EAAE,WAAW,IAAIP,EAAEQ,KAAKC,aAAaA,YAAYC,kBAAkBD,YAAYC,iBAAiB,cAAc,GAAG,GAAGV,GAAGA,EAAEW,cAAc,GAAGX,EAAEW,cAAcF,YAAYG,MAAM,OAAOZ,GAAGa,EAAE,WAAW,IAAIb,EAAEO,IAAI,OAAO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B/J,EAAEgK,0BAA0B1J,EAAE2J,WAAWxJ,EAAEhB,EAAEmE,UAAUsG,mBAAmBtK,EAAEa,EAAE0J,kBAAkB5I,KAAKsC,IAAIpB,EAAE7C,EAAE,GAAGwK,UAAU5H,EAAE/C,EAAEmE,YAAY,OAAOxB,OAAOC,OAAO7C,EAAE,CAAC6K,YAAYvH,GAAI,CAAluB,CAAmuBrD,GAAGD,EAAEE,EAAG,GAAEA,EAAG,GEWlyQqJ,GAAiBuB,sBAAwBvB,GAAiBuB,uBAAyB,GACnFvB,GAAiBuB,sBAAsBtB,0BAA4BA,GAOnED,GAAiBC,0BAA4BA","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"web-vitals.js","sources":["../node_modules/.pnpm/web-vitals@4.2.0/node_modules/web-vitals/dist/web-vitals.js","../node_modules/.pnpm/web-vitals@4.2.0/node_modules/web-vitals/dist/web-vitals.attribution.js","../src/utils/globals.ts","../src/entrypoints/web-vitals.ts"],"sourcesContent":["var e,n,t,r,i,o=-1,a=function(e){addEventListener(\"pageshow\",(function(n){n.persisted&&(o=n.timeStamp,e(n))}),!0)},c=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType(\"navigation\")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},u=function(){var e=c();return e&&e.activationStart||0},f=function(e,n){var t=c(),r=\"navigate\";o>=0?r=\"back-forward-cache\":t&&(document.prerendering||u()>0?r=\"prerender\":document.wasDiscarded?r=\"restore\":t.type&&(r=t.type.replace(/_/g,\"-\")));return{name:e,value:void 0===n?-1:n,rating:\"good\",delta:0,entries:[],id:\"v4-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},s=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},t||{})),r}}catch(e){}},d=function(e,n,t,r){var i,o;return function(a){n.value>=0&&(a||r)&&((o=n.value-(i||0))||void 0===i)&&(i=n.value,n.delta=o,n.rating=function(e,n){return e>n[1]?\"poor\":e>n[0]?\"needs-improvement\":\"good\"}(n.value,t),e(n))}},l=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},p=function(e){document.addEventListener(\"visibilitychange\",(function(){\"hidden\"===document.visibilityState&&e()}))},v=function(e){var n=!1;return function(){n||(e(),n=!0)}},m=-1,h=function(){return\"hidden\"!==document.visibilityState||document.prerendering?1/0:0},g=function(e){\"hidden\"===document.visibilityState&&m>-1&&(m=\"visibilitychange\"===e.type?e.timeStamp:0,T())},y=function(){addEventListener(\"visibilitychange\",g,!0),addEventListener(\"prerenderingchange\",g,!0)},T=function(){removeEventListener(\"visibilitychange\",g,!0),removeEventListener(\"prerenderingchange\",g,!0)},E=function(){return m<0&&(m=h(),y(),a((function(){setTimeout((function(){m=h(),y()}),0)}))),{get firstHiddenTime(){return m}}},C=function(e){document.prerendering?addEventListener(\"prerenderingchange\",(function(){return e()}),!0):e()},b=[1800,3e3],S=function(e,n){n=n||{},C((function(){var t,r=E(),i=f(\"FCP\"),o=s(\"paint\",(function(e){e.forEach((function(e){\"first-contentful-paint\"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-u(),0),i.entries.push(e),t(!0)))}))}));o&&(t=d(e,i,b,n.reportAllChanges),a((function(r){i=f(\"FCP\"),t=d(e,i,b,n.reportAllChanges),l((function(){i.value=performance.now()-r.timeStamp,t(!0)}))})))}))},L=[.1,.25],w=function(e,n){n=n||{},S(v((function(){var t,r=f(\"CLS\",0),i=0,o=[],c=function(e){e.forEach((function(e){if(!e.hadRecentInput){var n=o[0],t=o[o.length-1];i&&e.startTime-t.startTime<1e3&&e.startTime-n.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,t())},u=s(\"layout-shift\",c);u&&(t=d(e,r,L,n.reportAllChanges),p((function(){c(u.takeRecords()),t(!0)})),a((function(){i=0,r=f(\"CLS\",0),t=d(e,r,L,n.reportAllChanges),l((function(){return t()}))})),setTimeout(t,0))})))},A=0,I=1/0,P=0,M=function(e){e.forEach((function(e){e.interactionId&&(I=Math.min(I,e.interactionId),P=Math.max(P,e.interactionId),A=P?(P-I)/7+1:0)}))},k=function(){\"interactionCount\"in performance||e||(e=s(\"event\",M,{type:\"event\",buffered:!0,durationThreshold:0}))},F=[],D=new Map,x=0,R=function(){return(e?A:performance.interactionCount||0)-x},B=[],H=function(e){if(B.forEach((function(n){return n(e)})),e.interactionId||\"first-input\"===e.entryType){var n=F[F.length-1],t=D.get(e.interactionId);if(t||F.length<10||e.duration>n.latency){if(t)e.duration>t.latency?(t.entries=[e],t.latency=e.duration):e.duration===t.latency&&e.startTime===t.entries[0].startTime&&t.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};D.set(r.id,r),F.push(r)}F.sort((function(e,n){return n.latency-e.latency})),F.length>10&&F.splice(10).forEach((function(e){return D.delete(e.id)}))}}},q=function(e){var n=self.requestIdleCallback||self.setTimeout,t=-1;return e=v(e),\"hidden\"===document.visibilityState?e():(t=n(e),p(e)),t},O=[200,500],N=function(e,n){\"PerformanceEventTiming\"in self&&\"interactionId\"in PerformanceEventTiming.prototype&&(n=n||{},C((function(){var t;k();var r,i=f(\"INP\"),o=function(e){q((function(){e.forEach(H);var n,t=(n=Math.min(F.length-1,Math.floor(R()/50)),F[n]);t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,r())}))},c=s(\"event\",o,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});r=d(e,i,O,n.reportAllChanges),c&&(c.observe({type:\"first-input\",buffered:!0}),p((function(){o(c.takeRecords()),r(!0)})),a((function(){x=0,F.length=0,D.clear(),i=f(\"INP\"),r=d(e,i,O,n.reportAllChanges)})))})))},j=[2500,4e3],_={},z=function(e,n){n=n||{},C((function(){var t,r=E(),i=f(\"LCP\"),o=function(e){n.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-u(),0),i.entries=[e],t())}))},c=s(\"largest-contentful-paint\",o);if(c){t=d(e,i,j,n.reportAllChanges);var m=v((function(){_[i.id]||(o(c.takeRecords()),c.disconnect(),_[i.id]=!0,t(!0))}));[\"keydown\",\"click\"].forEach((function(e){addEventListener(e,(function(){return q(m)}),!0)})),p(m),a((function(r){i=f(\"LCP\"),t=d(e,i,j,n.reportAllChanges),l((function(){i.value=performance.now()-r.timeStamp,_[i.id]=!0,t(!0)}))}))}}))},G=[800,1800],J=function e(n){document.prerendering?C((function(){return e(n)})):\"complete\"!==document.readyState?addEventListener(\"load\",(function(){return e(n)}),!0):setTimeout(n,0)},K=function(e,n){n=n||{};var t=f(\"TTFB\"),r=d(e,t,G,n.reportAllChanges);J((function(){var i=c();i&&(t.value=Math.max(i.responseStart-u(),0),t.entries=[i],r(!0),a((function(){t=f(\"TTFB\",0),(r=d(e,t,G,n.reportAllChanges))(!0)})))}))},Q={passive:!0,capture:!0},U=new Date,V=function(e,i){n||(n=i,t=e,r=new Date,Y(removeEventListener),W())},W=function(){if(t>=0&&t<r-U){var e={entryType:\"first-input\",name:n.type,target:n.target,cancelable:n.cancelable,startTime:n.timeStamp,processingStart:n.timeStamp+t};i.forEach((function(n){n(e)})),i=[]}},X=function(e){if(e.cancelable){var n=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,n){var t=function(){V(e,n),i()},r=function(){i()},i=function(){removeEventListener(\"pointerup\",t,Q),removeEventListener(\"pointercancel\",r,Q)};addEventListener(\"pointerup\",t,Q),addEventListener(\"pointercancel\",r,Q)}(n,e):V(n,e)}},Y=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(n){return e(n,X,Q)}))},Z=[100,300],$=function(e,r){r=r||{},C((function(){var o,c=E(),u=f(\"FID\"),l=function(e){e.startTime<c.firstHiddenTime&&(u.value=e.processingStart-e.startTime,u.entries.push(e),o(!0))},m=function(e){e.forEach(l)},h=s(\"first-input\",m);o=d(e,u,Z,r.reportAllChanges),h&&(p(v((function(){m(h.takeRecords()),h.disconnect()}))),a((function(){var a;u=f(\"FID\"),o=d(e,u,Z,r.reportAllChanges),i=[],t=-1,n=null,Y(addEventListener),a=l,i.push(a),W()})))}))};export{L as CLSThresholds,b as FCPThresholds,Z as FIDThresholds,O as INPThresholds,j as LCPThresholds,G as TTFBThresholds,w as onCLS,S as onFCP,$ as onFID,N as onINP,z as onLCP,K as onTTFB};\n","var t,e,n,r=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType(\"navigation\")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},i=function(t){if(\"loading\"===document.readyState)return\"loading\";var e=r();if(e){if(t<e.domInteractive)return\"loading\";if(0===e.domContentLoadedEventStart||t<e.domContentLoadedEventStart)return\"dom-interactive\";if(0===e.domComplete||t<e.domComplete)return\"dom-content-loaded\"}return\"complete\"},a=function(t){var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,\"\")},o=function(t,e){var n=\"\";try{for(;t&&9!==t.nodeType;){var r=t,i=r.id?\"#\"+r.id:a(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?\".\"+r.classList.value.trim().replace(/\\s+/g,\".\"):\"\");if(n.length+i.length>(e||100)-1)return n||i;if(n=n?i+\">\"+n:i,r.id)break;t=r.parentNode}}catch(t){}return n},c=-1,u=function(){return c},s=function(t){addEventListener(\"pageshow\",(function(e){e.persisted&&(c=e.timeStamp,t(e))}),!0)},f=function(){var t=r();return t&&t.activationStart||0},d=function(t,e){var n=r(),i=\"navigate\";u()>=0?i=\"back-forward-cache\":n&&(document.prerendering||f()>0?i=\"prerender\":document.wasDiscarded?i=\"restore\":n.type&&(i=n.type.replace(/_/g,\"-\")));return{name:t,value:void 0===e?-1:e,rating:\"good\",delta:0,entries:[],id:\"v4-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},l=function(t,e,n){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var r=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch(t){}},m=function(t,e,n,r){var i,a;return function(o){e.value>=0&&(o||r)&&((a=e.value-(i||0))||void 0===i)&&(i=e.value,e.delta=a,e.rating=function(t,e){return t>e[1]?\"poor\":t>e[0]?\"needs-improvement\":\"good\"}(e.value,n),t(e))}},p=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},v=function(t){document.addEventListener(\"visibilitychange\",(function(){\"hidden\"===document.visibilityState&&t()}))},g=function(t){var e=!1;return function(){e||(t(),e=!0)}},h=-1,T=function(){return\"hidden\"!==document.visibilityState||document.prerendering?1/0:0},y=function(t){\"hidden\"===document.visibilityState&&h>-1&&(h=\"visibilitychange\"===t.type?t.timeStamp:0,S())},E=function(){addEventListener(\"visibilitychange\",y,!0),addEventListener(\"prerenderingchange\",y,!0)},S=function(){removeEventListener(\"visibilitychange\",y,!0),removeEventListener(\"prerenderingchange\",y,!0)},b=function(){return h<0&&(h=T(),E(),s((function(){setTimeout((function(){h=T(),E()}),0)}))),{get firstHiddenTime(){return h}}},L=function(t){document.prerendering?addEventListener(\"prerenderingchange\",(function(){return t()}),!0):t()},C=[1800,3e3],M=function(t,e){e=e||{},L((function(){var n,r=b(),i=d(\"FCP\"),a=l(\"paint\",(function(t){t.forEach((function(t){\"first-contentful-paint\"===t.name&&(a.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-f(),0),i.entries.push(t),n(!0)))}))}));a&&(n=m(t,i,C,e.reportAllChanges),s((function(r){i=d(\"FCP\"),n=m(t,i,C,e.reportAllChanges),p((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},D=[.1,.25],w=function(t,e){!function(t,e){e=e||{},M(g((function(){var n,r=d(\"CLS\",0),i=0,a=[],o=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=a[0],n=a[a.length-1];i&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(i+=t.value,a.push(t)):(i=t.value,a=[t])}})),i>r.value&&(r.value=i,r.entries=a,n())},c=l(\"layout-shift\",o);c&&(n=m(t,r,D,e.reportAllChanges),v((function(){o(c.takeRecords()),n(!0)})),s((function(){i=0,r=d(\"CLS\",0),n=m(t,r,D,e.reportAllChanges),p((function(){return n()}))})),setTimeout(n,0))})))}((function(e){var n=function(t){var e,n={};if(t.entries.length){var r=t.entries.reduce((function(t,e){return t&&t.value>e.value?t:e}));if(r&&r.sources&&r.sources.length){var a=(e=r.sources).find((function(t){return t.node&&1===t.node.nodeType}))||e[0];a&&(n={largestShiftTarget:o(a.node),largestShiftTime:r.startTime,largestShiftValue:r.value,largestShiftSource:a,largestShiftEntry:r,loadState:i(r.startTime)})}}return Object.assign(t,{attribution:n})}(e);t(n)}),e)},x=function(t,e){M((function(e){var n=function(t){var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:i(u())};if(t.entries.length){var n=r(),a=t.entries[t.entries.length-1];if(n){var o=n.activationStart||0,c=Math.max(0,n.responseStart-o);e={timeToFirstByte:c,firstByteToFCP:t.value-c,loadState:i(t.entries[0].startTime),navigationEntry:n,fcpEntry:a}}}return Object.assign(t,{attribution:e})}(e);t(n)}),e)},I=0,k=1/0,A=0,F=function(t){t.forEach((function(t){t.interactionId&&(k=Math.min(k,t.interactionId),A=Math.max(A,t.interactionId),I=A?(A-k)/7+1:0)}))},P=function(){\"interactionCount\"in performance||t||(t=l(\"event\",F,{type:\"event\",buffered:!0,durationThreshold:0}))},B=[],O=new Map,R=0,j=function(){return(t?I:performance.interactionCount||0)-R},q=[],H=function(t){if(q.forEach((function(e){return e(t)})),t.interactionId||\"first-input\"===t.entryType){var e=B[B.length-1],n=O.get(t.interactionId);if(n||B.length<10||t.duration>e.latency){if(n)t.duration>n.latency?(n.entries=[t],n.latency=t.duration):t.duration===n.latency&&t.startTime===n.entries[0].startTime&&n.entries.push(t);else{var r={id:t.interactionId,latency:t.duration,entries:[t]};O.set(r.id,r),B.push(r)}B.sort((function(t,e){return e.latency-t.latency})),B.length>10&&B.splice(10).forEach((function(t){return O.delete(t.id)}))}}},N=function(t){var e=self.requestIdleCallback||self.setTimeout,n=-1;return t=g(t),\"hidden\"===document.visibilityState?t():(n=e(t),v(t)),n},W=[200,500],z=function(t,e){\"PerformanceEventTiming\"in self&&\"interactionId\"in PerformanceEventTiming.prototype&&(e=e||{},L((function(){var n;P();var r,i=d(\"INP\"),a=function(t){N((function(){t.forEach(H);var e,n=(e=Math.min(B.length-1,Math.floor(j()/50)),B[e]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},o=l(\"event\",a,{durationThreshold:null!==(n=e.durationThreshold)&&void 0!==n?n:40});r=m(t,i,W,e.reportAllChanges),o&&(o.observe({type:\"first-input\",buffered:!0}),v((function(){a(o.takeRecords()),r(!0)})),s((function(){R=0,B.length=0,O.clear(),i=d(\"INP\"),r=m(t,i,W,e.reportAllChanges)})))})))},U=[],V=[],_=new WeakMap,G=new Map,J=-1,K=function(t){U=U.concat(t),Q()},Q=function(){J<0&&(J=N(X))},X=function(){G.size>10&&G.forEach((function(t,e){O.has(e)||G.delete(e)}));var t=B.map((function(t){return _.get(t.entries[0])})),e=V.length-50;V=V.filter((function(n,r){return r>=e||t.includes(n)}));for(var r=new Set,i=0;i<V.length;i++){var a=V[i];et(a.startTime,a.processingEnd).forEach((function(t){r.add(t)}))}for(var o=0;o<50;o++){var c=U[U.length-1-o];if(!c||c.startTime<n)break;r.add(c)}U=Array.from(r),J=-1};q.push((function(t){t.interactionId&&t.target&&!G.has(t.interactionId)&&G.set(t.interactionId,t.target)}),(function(t){var e,r=t.startTime+t.duration;n=Math.max(n,t.processingEnd);for(var i=V.length-1;i>=0;i--){var a=V[i];if(Math.abs(r-a.renderTime)<=8){(e=a).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),e.entries.push(t);break}}e||(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:r,entries:[t]},V.push(e)),(t.interactionId||\"first-input\"===t.entryType)&&_.set(t,e),Q()}));var Y,Z,$,tt,et=function(t,e){for(var n,r=[],i=0;n=U[i];i++)if(!(n.startTime+n.duration<t)){if(n.startTime>e)break;r.push(n)}return r},nt=function(t,n){e||(e=l(\"long-animation-frame\",K)),z((function(e){var n=function(t){var e=t.entries[0],n=_.get(e),r=e.processingStart,a=n.processingEnd,c=n.entries.sort((function(t,e){return t.processingStart-e.processingStart})),u=et(e.startTime,a),s=t.entries.find((function(t){return t.target})),f=s&&s.target||G.get(e.interactionId),d=[e.startTime+e.duration,a].concat(u.map((function(t){return t.startTime+t.duration}))),l=Math.max.apply(Math,d),m={interactionTarget:o(f),interactionTargetElement:f,interactionType:e.name.startsWith(\"key\")?\"keyboard\":\"pointer\",interactionTime:e.startTime,nextPaintTime:l,processedEventEntries:c,longAnimationFrameEntries:u,inputDelay:r-e.startTime,processingDuration:a-r,presentationDelay:Math.max(l-a,0),loadState:i(e.startTime)};return Object.assign(t,{attribution:m})}(e);t(n)}),n)},rt=[2500,4e3],it={},at=function(t,e){!function(t,e){e=e||{},L((function(){var n,r=b(),i=d(\"LCP\"),a=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-f(),0),i.entries=[t],n())}))},o=l(\"largest-contentful-paint\",a);if(o){n=m(t,i,rt,e.reportAllChanges);var c=g((function(){it[i.id]||(a(o.takeRecords()),o.disconnect(),it[i.id]=!0,n(!0))}));[\"keydown\",\"click\"].forEach((function(t){addEventListener(t,(function(){return N(c)}),!0)})),v(c),s((function(r){i=d(\"LCP\"),n=m(t,i,rt,e.reportAllChanges),p((function(){i.value=performance.now()-r.timeStamp,it[i.id]=!0,n(!0)}))}))}}))}((function(e){var n=function(t){var e={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var n=r();if(n){var i=n.activationStart||0,a=t.entries[t.entries.length-1],c=a.url&&performance.getEntriesByType(\"resource\").filter((function(t){return t.name===a.url}))[0],u=Math.max(0,n.responseStart-i),s=Math.max(u,c?(c.requestStart||c.startTime)-i:0),f=Math.max(s,c?c.responseEnd-i:0),d=Math.max(f,a.startTime-i);e={element:o(a.element),timeToFirstByte:u,resourceLoadDelay:s-u,resourceLoadDuration:f-s,elementRenderDelay:d-f,navigationEntry:n,lcpEntry:a},a.url&&(e.url=a.url),c&&(e.lcpResourceEntry=c)}}return Object.assign(t,{attribution:e})}(e);t(n)}),e)},ot=[800,1800],ct=function t(e){document.prerendering?L((function(){return t(e)})):\"complete\"!==document.readyState?addEventListener(\"load\",(function(){return t(e)}),!0):setTimeout(e,0)},ut=function(t,e){e=e||{};var n=d(\"TTFB\"),i=m(t,n,ot,e.reportAllChanges);ct((function(){var a=r();a&&(n.value=Math.max(a.responseStart-f(),0),n.entries=[a],i(!0),s((function(){n=d(\"TTFB\",0),(i=m(t,n,ot,e.reportAllChanges))(!0)})))}))},st=function(t,e){ut((function(e){var n=function(t){var e={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(t.entries.length){var n=t.entries[0],r=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-r,0),a=Math.max(n.domainLookupStart-r,0),o=Math.max(n.connectStart-r,0),c=Math.max(n.connectEnd-r,0);e={waitingDuration:i,cacheDuration:a-i,dnsDuration:o-a,connectionDuration:c-o,requestDuration:t.value-c,navigationEntry:n}}return Object.assign(t,{attribution:e})}(e);t(n)}),e)},ft={passive:!0,capture:!0},dt=new Date,lt=function(t,e){Y||(Y=e,Z=t,$=new Date,vt(removeEventListener),mt())},mt=function(){if(Z>=0&&Z<$-dt){var t={entryType:\"first-input\",name:Y.type,target:Y.target,cancelable:Y.cancelable,startTime:Y.timeStamp,processingStart:Y.timeStamp+Z};tt.forEach((function(e){e(t)})),tt=[]}},pt=function(t){if(t.cancelable){var e=(t.timeStamp>1e12?new Date:performance.now())-t.timeStamp;\"pointerdown\"==t.type?function(t,e){var n=function(){lt(t,e),i()},r=function(){i()},i=function(){removeEventListener(\"pointerup\",n,ft),removeEventListener(\"pointercancel\",r,ft)};addEventListener(\"pointerup\",n,ft),addEventListener(\"pointercancel\",r,ft)}(e,t):lt(e,t)}},vt=function(t){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(e){return t(e,pt,ft)}))},gt=[100,300],ht=function(t,e){e=e||{},L((function(){var n,r=b(),i=d(\"FID\"),a=function(t){t.startTime<r.firstHiddenTime&&(i.value=t.processingStart-t.startTime,i.entries.push(t),n(!0))},o=function(t){t.forEach(a)},c=l(\"first-input\",o);n=m(t,i,gt,e.reportAllChanges),c&&(v(g((function(){o(c.takeRecords()),c.disconnect()}))),s((function(){var r;i=d(\"FID\"),n=m(t,i,gt,e.reportAllChanges),tt=[],Z=-1,Y=null,vt(addEventListener),r=a,tt.push(r),mt()})))}))},Tt=function(t,e){ht((function(e){var n=function(t){var e=t.entries[0],n={eventTarget:o(e.target),eventType:e.name,eventTime:e.startTime,eventEntry:e,loadState:i(e.startTime)};return Object.assign(t,{attribution:n})}(e);t(n)}),e)};export{D as CLSThresholds,C as FCPThresholds,gt as FIDThresholds,W as INPThresholds,rt as LCPThresholds,ot as TTFBThresholds,w as onCLS,x as onFCP,Tt as onFID,nt as onINP,at as onLCP,st as onTTFB};\n","import { ErrorProperties } from '../extensions/exception-autocapture/error-conversion'\nimport type { PostHog } from '../posthog-core'\nimport { SessionIdManager } from '../sessionid'\nimport { ErrorEventArgs, ErrorMetadata, Properties } from '../types'\n\n/*\n * Global helpers to protect access to browser globals in a way that is safer for different targets\n * like DOM, SSR, Web workers etc.\n *\n * NOTE: Typically we want the \"window\" but globalThis works for both the typical browser context as\n * well as other contexts such as the web worker context. Window is still exported for any bits that explicitly require it.\n * If in doubt - export the global you need from this file and use that as an optional value. This way the code path is forced\n * to handle the case where the global is not available.\n */\n\n// eslint-disable-next-line no-restricted-globals\nconst win: (Window & typeof globalThis) | undefined = typeof window !== 'undefined' ? window : undefined\n\n/**\n * This is our contract between (potentially) lazily loaded extensions and the SDK\n * changes to this interface can be breaking changes for users of the SDK\n */\n\nexport type PostHogExtensionKind =\n | 'toolbar'\n | 'exception-autocapture'\n | 'web-vitals'\n | 'recorder'\n | 'tracing-headers'\n | 'surveys'\n\ninterface PostHogExtensions {\n loadExternalDependency?: (\n posthog: PostHog,\n kind: PostHogExtensionKind,\n callback: (error?: string | Event, event?: Event) => void\n ) => void\n\n loadSiteApp?: (posthog: PostHog, appUrl: string, callback: (error?: string | Event, event?: Event) => void) => void\n\n parseErrorAsProperties?: (\n [event, source, lineno, colno, error]: ErrorEventArgs,\n metadata?: ErrorMetadata\n ) => ErrorProperties\n errorWrappingFunctions?: {\n wrapOnError: (captureFn: (props: Properties) => void) => () => void\n wrapUnhandledRejection: (captureFn: (props: Properties) => void) => () => void\n }\n rrweb?: { record: any; version: string; rrwebVersion: string }\n rrwebPlugins?: { getRecordConsolePlugin: any; getRecordNetworkPlugin?: any }\n canActivateRepeatedly?: (survey: any) => boolean\n generateSurveys?: (posthog: PostHog) => any | undefined\n postHogWebVitalsCallbacks?: {\n onLCP: (metric: any) => void\n onCLS: (metric: any) => void\n onFCP: (metric: any) => void\n onINP: (metric: any) => void\n }\n tracingHeadersPatchFns?: {\n _patchFetch: (sessionManager: SessionIdManager) => () => void\n _patchXHR: (sessionManager: any) => () => void\n }\n}\n\nconst global: typeof globalThis | undefined = typeof globalThis !== 'undefined' ? globalThis : win\n\nexport const ArrayProto = Array.prototype\nexport const nativeForEach = ArrayProto.forEach\nexport const nativeIndexOf = ArrayProto.indexOf\n\nexport const navigator = global?.navigator\nexport const document = global?.document\nexport const location = global?.location\nexport const fetch = global?.fetch\nexport const XMLHttpRequest =\n global?.XMLHttpRequest && 'withCredentials' in new global.XMLHttpRequest() ? global.XMLHttpRequest : undefined\nexport const AbortController = global?.AbortController\nexport const userAgent = navigator?.userAgent\nexport const assignableWindow: Window &\n typeof globalThis &\n Record<string, any> & {\n __PosthogExtensions__?: PostHogExtensions\n } = win ?? ({} as any)\n\nexport { win as window }\n","import { onLCP, onCLS, onFCP } from 'web-vitals'\nimport { onINP } from 'web-vitals/attribution'\nimport { assignableWindow } from '../utils/globals'\n\nconst postHogWebVitalsCallbacks = {\n onLCP,\n onCLS,\n onFCP,\n onINP,\n}\n\nassignableWindow.__PosthogExtensions__ = assignableWindow.__PosthogExtensions__ || {}\nassignableWindow.__PosthogExtensions__.postHogWebVitalsCallbacks = postHogWebVitalsCallbacks\n\n// we used to put posthogWebVitalsCallbacks on window, and now we put it on __PosthogExtensions__\n// but that means that old clients which lazily load this extension are looking in the wrong place\n// yuck,\n// so we also put it directly on the window\n// when 1.161.1 is the oldest version seen in production we can remove this\nassignableWindow.postHogWebVitalsCallbacks = postHogWebVitalsCallbacks\n\nexport default postHogWebVitalsCallbacks\n"],"names":["t","e","n","o","a","addEventListener","persisted","timeStamp","c","self","performance","getEntriesByType","responseStart","now","u","activationStart","f","r","document","prerendering","wasDiscarded","type","replace","name","value","rating","delta","entries","id","concat","Date","Math","floor","random","navigationType","s","PerformanceObserver","supportedEntryTypes","includes","Promise","resolve","then","getEntries","observe","Object","assign","buffered","d","i","l","requestAnimationFrame","p","visibilityState","v","m","h","g","T","y","removeEventListener","E","setTimeout","firstHiddenTime","C","b","S","forEach","disconnect","startTime","max","push","reportAllChanges","L","j","_","readyState","domInteractive","domContentLoadedEventStart","domComplete","nodeName","nodeType","toLowerCase","toUpperCase","classList","trim","length","parentNode","I","k","A","F","interactionId","min","P","durationThreshold","B","O","Map","R","interactionCount","q","H","entryType","get","duration","latency","set","sort","splice","delete","N","requestIdleCallback","W","z","PerformanceEventTiming","prototype","takeRecords","clear","U","V","WeakMap","G","J","K","Q","X","size","has","map","filter","Set","et","processingEnd","add","Array","from","target","abs","renderTime","processingStart","win","window","undefined","global","globalThis","navigator","location","fetch","XMLHttpRequest","AbortController","userAgent","assignableWindow","postHogWebVitalsCallbacks","onLCP","slice","onCLS","hadRecentInput","onFCP","onINP","find","apply","interactionTarget","interactionTargetElement","interactionType","startsWith","interactionTime","nextPaintTime","processedEventEntries","longAnimationFrameEntries","inputDelay","processingDuration","presentationDelay","loadState","attribution","__PosthogExtensions__"],"mappings":"yBAAA,ICAIA,EAAEC,EAAEC,EDAMC,GAAG,EAAEC,EAAE,SAASH,GAAGI,iBAAiB,YAAY,SAASH,GAAGA,EAAEI,YAAYH,EAAED,EAAEK,UAAUN,EAAEC,OAAM,IAAKM,EAAE,WAAW,IAAIP,EAAEQ,KAAKC,aAAaA,YAAYC,kBAAkBD,YAAYC,iBAAiB,cAAc,GAAG,GAAGV,GAAGA,EAAEW,cAAc,GAAGX,EAAEW,cAAcF,YAAYG,MAAM,OAAOZ,GAAGa,EAAE,WAAW,IAAIb,EAAEO,IAAI,OAAOP,GAAGA,EAAEc,iBAAiB,GAAGC,EAAE,SAASf,EAAEC,GAAG,IAAIF,EAAEQ,IAAIS,EAAE,WAA8J,OAAnJd,GAAG,EAAEc,EAAE,qBAAqBjB,IAAIkB,SAASC,cAAcL,IAAI,EAAEG,EAAE,YAAYC,SAASE,aAAaH,EAAE,UAAUjB,EAAEqB,OAAOJ,EAAEjB,EAAEqB,KAAKC,QAAQ,KAAK,OAAa,CAACC,KAAKtB,EAAEuB,WAAM,IAAStB,GAAG,EAAEA,EAAEuB,OAAO,OAAOC,MAAM,EAAEC,QAAQ,GAAGC,GAAG,MAAMC,OAAOC,KAAKjB,MAAM,KAAKgB,OAAOE,KAAKC,MAAM,cAAcD,KAAKE,UAAU,MAAMC,eAAejB,IAAIkB,EAAE,SAASlC,EAAEC,EAAEF,G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version": "1.168.0",
4
4
  "description": "Posthog-js allows you to automatically capture usage and send events to PostHog.",
5
5
  "repository": "https://github.com/PostHog/posthog-js",
6
6
  "author": "hey@posthog.com",
@@ -1,8 +1,42 @@
1
1
  import { StackFrame } from './stack-trace';
2
- import { ErrorEventArgs, ErrorProperties } from '../../types';
2
+ import { ErrorEventArgs, ErrorMetadata, SeverityLevel } from '../../types';
3
+ export interface ErrorProperties {
4
+ $exception_list: Exception[];
5
+ $exception_level?: SeverityLevel;
6
+ $exception_DOMException_code?: string;
7
+ $exception_personURL?: string;
8
+ }
9
+ export interface Exception {
10
+ type?: string;
11
+ value?: string;
12
+ mechanism?: {
13
+ /**
14
+ * In theory, whether or not the exception has been handled by the user. In practice, whether or not we see it before
15
+ * it hits the global error/rejection handlers, whether through explicit handling by the user or auto instrumentation.
16
+ */
17
+ handled?: boolean;
18
+ type?: string;
19
+ source?: string;
20
+ /**
21
+ * True when `captureException` is called with anything other than an instance of `Error` (or, in the case of browser,
22
+ * an instance of `ErrorEvent`, `DOMError`, or `DOMException`). causing us to create a synthetic error in an attempt
23
+ * to recreate the stacktrace.
24
+ */
25
+ synthetic?: boolean;
26
+ };
27
+ module?: string;
28
+ thread_id?: number;
29
+ stacktrace?: {
30
+ frames?: StackFrame[];
31
+ };
32
+ }
33
+ export interface ErrorConversions {
34
+ errorToProperties: (args: ErrorEventArgs, metadata?: ErrorMetadata) => ErrorProperties;
35
+ unhandledRejectionToProperties: (args: [ev: PromiseRejectionEvent]) => ErrorProperties;
36
+ }
3
37
  export declare function parseStackFrames(ex: Error & {
4
38
  framesToPop?: number;
5
39
  stacktrace?: string;
6
40
  }): StackFrame[];
7
- export declare function errorToProperties([event, source, lineno, colno, error]: ErrorEventArgs): ErrorProperties;
41
+ export declare function errorToProperties([event, _, __, ___, error]: ErrorEventArgs, metadata?: ErrorMetadata): ErrorProperties;
8
42
  export declare function unhandledRejectionToProperties([ev]: [ev: PromiseRejectionEvent]): ErrorProperties;
@@ -59,19 +59,54 @@ export function parseStackFrames(ex) {
59
59
  }
60
60
  return [];
61
61
  }
62
- function errorPropertiesFromError(error) {
62
+ function errorPropertiesFromError(error, metadata) {
63
+ var _a, _b;
63
64
  var frames = parseStackFrames(error);
65
+ var handled = (_a = metadata === null || metadata === void 0 ? void 0 : metadata.handled) !== null && _a !== void 0 ? _a : true;
66
+ var synthetic = (_b = metadata === null || metadata === void 0 ? void 0 : metadata.synthetic) !== null && _b !== void 0 ? _b : false;
67
+ var exceptionType = (metadata === null || metadata === void 0 ? void 0 : metadata.overrideExceptionType) ? metadata.overrideExceptionType : error.name;
68
+ var exceptionMessage = (metadata === null || metadata === void 0 ? void 0 : metadata.overrideExceptionMessage) ? metadata.overrideExceptionMessage : error.message;
64
69
  return {
65
- $exception_type: error.name,
66
- $exception_message: error.message,
67
- $exception_stack_trace_raw: JSON.stringify(frames),
70
+ $exception_list: [
71
+ {
72
+ type: exceptionType,
73
+ value: exceptionMessage,
74
+ stacktrace: {
75
+ frames: frames,
76
+ },
77
+ mechanism: {
78
+ handled: handled,
79
+ synthetic: synthetic,
80
+ },
81
+ },
82
+ ],
68
83
  $exception_level: 'error',
69
84
  };
70
85
  }
71
- function errorPropertiesFromString(candidate) {
86
+ function errorPropertiesFromString(candidate, metadata) {
87
+ var _a, _b, _c;
88
+ // Defaults for metadata are based on what the error candidate is.
89
+ var handled = (_a = metadata === null || metadata === void 0 ? void 0 : metadata.handled) !== null && _a !== void 0 ? _a : true;
90
+ var synthetic = (_b = metadata === null || metadata === void 0 ? void 0 : metadata.synthetic) !== null && _b !== void 0 ? _b : true;
91
+ var exceptionType = (metadata === null || metadata === void 0 ? void 0 : metadata.overrideExceptionType)
92
+ ? metadata.overrideExceptionType
93
+ : (_c = metadata === null || metadata === void 0 ? void 0 : metadata.defaultExceptionType) !== null && _c !== void 0 ? _c : 'Error';
94
+ var exceptionMessage = (metadata === null || metadata === void 0 ? void 0 : metadata.overrideExceptionMessage)
95
+ ? metadata.overrideExceptionMessage
96
+ : candidate
97
+ ? candidate
98
+ : metadata === null || metadata === void 0 ? void 0 : metadata.defaultExceptionMessage;
72
99
  return {
73
- $exception_type: 'Error',
74
- $exception_message: candidate,
100
+ $exception_list: [
101
+ {
102
+ type: exceptionType,
103
+ value: exceptionMessage,
104
+ mechanism: {
105
+ handled: handled,
106
+ synthetic: synthetic,
107
+ },
108
+ },
109
+ ],
75
110
  $exception_level: 'error',
76
111
  };
77
112
  }
@@ -102,76 +137,83 @@ function extractExceptionKeysForMessage(exception, maxLength) {
102
137
  function isSeverityLevel(x) {
103
138
  return isString(x) && !isEmptyString(x) && severityLevels.indexOf(x) >= 0;
104
139
  }
105
- function errorPropertiesFromObject(candidate) {
140
+ function errorPropertiesFromObject(candidate, metadata) {
141
+ var _a, _b;
142
+ // Defaults for metadata are based on what the error candidate is.
143
+ var handled = (_a = metadata === null || metadata === void 0 ? void 0 : metadata.handled) !== null && _a !== void 0 ? _a : true;
144
+ var synthetic = (_b = metadata === null || metadata === void 0 ? void 0 : metadata.synthetic) !== null && _b !== void 0 ? _b : true;
145
+ var exceptionType = (metadata === null || metadata === void 0 ? void 0 : metadata.overrideExceptionType)
146
+ ? metadata.overrideExceptionType
147
+ : isEvent(candidate)
148
+ ? candidate.constructor.name
149
+ : 'Error';
150
+ var exceptionMessage = (metadata === null || metadata === void 0 ? void 0 : metadata.overrideExceptionMessage)
151
+ ? metadata.overrideExceptionMessage
152
+ : "Non-Error ".concat('exception', " captured with keys: ").concat(extractExceptionKeysForMessage(candidate));
106
153
  return {
107
- $exception_type: isEvent(candidate) ? candidate.constructor.name : 'Error',
108
- $exception_message: "Non-Error ".concat('exception', " captured with keys: ").concat(extractExceptionKeysForMessage(candidate)),
154
+ $exception_list: [
155
+ {
156
+ type: exceptionType,
157
+ value: exceptionMessage,
158
+ mechanism: {
159
+ handled: handled,
160
+ synthetic: synthetic,
161
+ },
162
+ },
163
+ ],
109
164
  $exception_level: isSeverityLevel(candidate.level) ? candidate.level : 'error',
110
165
  };
111
166
  }
112
- export function errorToProperties(_a) {
113
- var _b = __read(_a, 5), event = _b[0], source = _b[1], lineno = _b[2], colno = _b[3], error = _b[4];
114
- // some properties are not optional but, it's useful to start off without them enforced
115
- var errorProperties = {};
116
- if (isUndefined(error) && isString(event)) {
117
- var name_1 = 'Error';
118
- var message = event;
119
- var groups = event.match(ERROR_TYPES_PATTERN);
120
- if (groups) {
121
- name_1 = groups[1];
122
- message = groups[2];
123
- }
124
- errorProperties = {
125
- $exception_type: name_1,
126
- $exception_message: message,
127
- };
128
- }
167
+ export function errorToProperties(
168
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
169
+ _a, metadata) {
170
+ var
171
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
172
+ _b = __read(_a, 5), event = _b[0], _ = _b[1], __ = _b[2], ___ = _b[3], error = _b[4];
173
+ var errorProperties = { $exception_list: [] };
129
174
  var candidate = error || event;
130
175
  if (isDOMError(candidate) || isDOMException(candidate)) {
131
176
  // https://developer.mozilla.org/en-US/docs/Web/API/DOMError
132
177
  // https://developer.mozilla.org/en-US/docs/Web/API/DOMException
133
178
  var domException = candidate;
134
179
  if (isErrorWithStack(candidate)) {
135
- errorProperties = errorPropertiesFromError(candidate);
180
+ errorProperties = errorPropertiesFromError(candidate, metadata);
136
181
  }
137
182
  else {
138
- var name_2 = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');
139
- var message = domException.message ? "".concat(name_2, ": ").concat(domException.message) : name_2;
140
- errorProperties = errorPropertiesFromString(message);
141
- errorProperties.$exception_type = isDOMError(domException) ? 'DOMError' : 'DOMException';
142
- errorProperties.$exception_message = errorProperties.$exception_message || message;
183
+ var name_1 = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');
184
+ var message = domException.message ? "".concat(name_1, ": ").concat(domException.message) : name_1;
185
+ var exceptionType = isDOMError(domException) ? 'DOMError' : 'DOMException';
186
+ errorProperties = errorPropertiesFromString(message, __assign(__assign({}, metadata), { overrideExceptionType: exceptionType, defaultExceptionMessage: message }));
143
187
  }
144
188
  if ('code' in domException) {
145
189
  errorProperties['$exception_DOMException_code'] = "".concat(domException.code);
146
190
  }
191
+ return errorProperties;
147
192
  }
148
193
  else if (isErrorEvent(candidate) && candidate.error) {
149
- errorProperties = errorPropertiesFromError(candidate.error);
194
+ return errorPropertiesFromError(candidate.error, metadata);
150
195
  }
151
196
  else if (isError(candidate)) {
152
- errorProperties = errorPropertiesFromError(candidate);
197
+ return errorPropertiesFromError(candidate, metadata);
153
198
  }
154
199
  else if (isPlainObject(candidate) || isEvent(candidate)) {
155
200
  // group these by using the keys available on the object
156
201
  var objectException = candidate;
157
- errorProperties = errorPropertiesFromObject(objectException);
158
- errorProperties.$exception_is_synthetic = true;
202
+ return errorPropertiesFromObject(objectException);
159
203
  }
160
- else {
161
- // If none of previous checks were valid, then it must be a string
162
- errorProperties.$exception_type = errorProperties.$exception_type || 'Error';
163
- errorProperties.$exception_message = errorProperties.$exception_message || candidate;
164
- errorProperties.$exception_is_synthetic = true;
165
- }
166
- return __assign(__assign(__assign(__assign(__assign({}, errorProperties), {
167
- // now we make sure the mandatory fields that were made optional are present
168
- $exception_type: errorProperties.$exception_type || 'UnknownErrorType', $exception_message: errorProperties.$exception_message || '', $exception_level: isSeverityLevel(errorProperties.$exception_level)
169
- ? errorProperties.$exception_level
170
- : 'error' }), (source
171
- ? {
172
- $exception_source: source, // TODO get this from URL if not present
204
+ else if (isUndefined(error) && isString(event)) {
205
+ var name_2 = 'Error';
206
+ var message = event;
207
+ var groups = event.match(ERROR_TYPES_PATTERN);
208
+ if (groups) {
209
+ name_2 = groups[1];
210
+ message = groups[2];
173
211
  }
174
- : {})), (lineno ? { $exception_lineno: lineno } : {})), (colno ? { $exception_colno: colno } : {}));
212
+ return errorPropertiesFromString(message, __assign(__assign({}, metadata), { overrideExceptionType: name_2, defaultExceptionMessage: message }));
213
+ }
214
+ else {
215
+ return errorPropertiesFromString(candidate, metadata);
216
+ }
175
217
  }
176
218
  export function unhandledRejectionToProperties(_a) {
177
219
  var _b = __read(_a, 1), ev = _b[0];
@@ -195,22 +237,19 @@ export function unhandledRejectionToProperties(_a) {
195
237
  catch (_c) {
196
238
  // no-empty
197
239
  }
198
- // some properties are not optional but, it's useful to start off without them enforced
199
- var errorProperties = {};
200
240
  if (isPrimitive(error)) {
201
- errorProperties = {
202
- $exception_message: "Non-Error promise rejection captured with value: ".concat(String(error)),
203
- };
241
+ return errorPropertiesFromString("Non-Error promise rejection captured with value: ".concat(String(error)), {
242
+ handled: false,
243
+ synthetic: false,
244
+ overrideExceptionType: 'UnhandledRejection',
245
+ });
204
246
  }
205
247
  else {
206
- errorProperties = errorToProperties([error]);
207
- }
208
- errorProperties.$exception_handled = false;
209
- return __assign(__assign({}, errorProperties), {
210
- // now we make sure the mandatory fields that were made optional are present
211
- $exception_type: (errorProperties.$exception_type = 'UnhandledRejection'), $exception_message: (errorProperties.$exception_message =
212
- errorProperties.$exception_message || ev.reason || String(error)), $exception_level: isSeverityLevel(errorProperties.$exception_level)
213
- ? errorProperties.$exception_level
214
- : 'error' });
248
+ return errorToProperties([error], {
249
+ handled: false,
250
+ overrideExceptionType: 'UnhandledRejection',
251
+ defaultExceptionMessage: ev.reason || String(error),
252
+ });
253
+ }
215
254
  }
216
255
  //# sourceMappingURL=error-conversion.js.map