From 69866e2779bcde0bb2b135cfffd1e8f214aebd25 Mon Sep 17 00:00:00 2001 From: Daniel <95646168+daniel-statsig@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:49:51 -0700 Subject: [PATCH] chore: publish 1.3.0 --- package.json | 2 +- packages/angular-bindings/package.json | 4 +- packages/client-core/package.json | 2 +- packages/client-core/src/StatsigMetadata.ts | 2 +- packages/combo/package.json | 18 ++-- packages/expo-bindings/package.json | 8 +- packages/js-client/package.json | 4 +- packages/js-local-overrides/package.json | 4 +- .../js-on-device-eval-client/package.json | 6 +- .../js-user-persisted-storage/package.json | 4 +- packages/react-bindings/package.json | 4 +- packages/react-native-bindings/package.json | 8 +- packages/react-native-core/package.json | 6 +- packages/session-replay/package.json | 4 +- packages/sha256/package.json | 2 +- packages/test-helpers/package.json | 2 +- packages/web-analytics/package.json | 6 +- pnpm-lock.yaml | 96 ++++++------------- ...client+session-replay+web-analytics.min.js | 2 +- .../src/assets/statsig-js-client.min.js | 2 +- .../statsig-js-on-device-eval-client.min.js | 2 +- 21 files changed, 77 insertions(+), 111 deletions(-) diff --git a/package.json b/package.json index a981f743..57209b6b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "statsig", - "version": "1.2.0", + "version": "1.3.0", "license": "MIT", "scripts": { "lint": "nx run-many --parallel=5 --target=lint", diff --git a/packages/angular-bindings/package.json b/packages/angular-bindings/package.json index 3203a315..b3e48ace 100644 --- a/packages/angular-bindings/package.json +++ b/packages/angular-bindings/package.json @@ -1,11 +1,11 @@ { "private": true, "name": "@statsig/angular-bindings", - "version": "1.2.0", + "version": "1.3.0", "dependencies": {}, "peerDependencies": { "@angular/core": "^17.1.0", - "@statsig/client-core": "1.2.0" + "@statsig/client-core": "1.3.0" }, "sideEffects": false } diff --git a/packages/client-core/package.json b/packages/client-core/package.json index 3dd3518f..a2d73534 100644 --- a/packages/client-core/package.json +++ b/packages/client-core/package.json @@ -1,6 +1,6 @@ { "name": "@statsig/client-core", - "version": "1.2.0", + "version": "1.3.0", "dependencies": {}, "type": "commonjs", "main": "./src/index.js", diff --git a/packages/client-core/src/StatsigMetadata.ts b/packages/client-core/src/StatsigMetadata.ts index d60850a6..fd980335 100644 --- a/packages/client-core/src/StatsigMetadata.ts +++ b/packages/client-core/src/StatsigMetadata.ts @@ -1,4 +1,4 @@ -export const SDK_VERSION = '1.2.0'; +export const SDK_VERSION = '1.3.0'; export type StatsigMetadata = { readonly [key: string]: string | undefined; diff --git a/packages/combo/package.json b/packages/combo/package.json index 740d10cb..b74993b2 100644 --- a/packages/combo/package.json +++ b/packages/combo/package.json @@ -1,16 +1,16 @@ { "private": true, "name": "statsig-combo", - "version": "1.2.0", + "version": "1.3.0", "dependencies": { - "@statsig/client-core": "1.2.0", - "@statsig/js-client": "1.2.0", - "@statsig/js-local-overrides": "1.2.0", - "@statsig/js-on-device-eval-client": "1.2.0", - "@statsig/js-user-persisted-storage": "1.2.0", - "@statsig/session-replay": "1.2.0", - "@statsig/web-analytics": "1.2.0", - "@statsig/react-bindings": "1.2.0" + "@statsig/client-core": "1.3.0", + "@statsig/js-client": "1.3.0", + "@statsig/js-local-overrides": "1.3.0", + "@statsig/js-on-device-eval-client": "1.3.0", + "@statsig/js-user-persisted-storage": "1.3.0", + "@statsig/session-replay": "1.3.0", + "@statsig/web-analytics": "1.3.0", + "@statsig/react-bindings": "1.3.0" }, "type": "commonjs", "main": "./src/index.js", diff --git a/packages/expo-bindings/package.json b/packages/expo-bindings/package.json index cb307690..529c5f04 100644 --- a/packages/expo-bindings/package.json +++ b/packages/expo-bindings/package.json @@ -1,10 +1,10 @@ { "name": "@statsig/expo-bindings", - "version": "1.2.0", + "version": "1.3.0", "dependencies": { - "@statsig/client-core": "1.2.0", - "@statsig/react-bindings": "1.2.0", - "@statsig/react-native-core": "1.2.0" + "@statsig/client-core": "1.3.0", + "@statsig/react-bindings": "1.3.0", + "@statsig/react-native-core": "1.3.0" }, "peerDependencies": { "react": "^16.6.3 || ^17.0.0 || ^18.0.0", diff --git a/packages/js-client/package.json b/packages/js-client/package.json index d434b9cc..c9e00fc1 100644 --- a/packages/js-client/package.json +++ b/packages/js-client/package.json @@ -1,8 +1,8 @@ { "name": "@statsig/js-client", - "version": "1.2.0", + "version": "1.3.0", "dependencies": { - "@statsig/client-core": "1.2.0" + "@statsig/client-core": "1.3.0" }, "jsdelivr": "./build/statsig-js-client.min.js", "type": "commonjs", diff --git a/packages/js-local-overrides/package.json b/packages/js-local-overrides/package.json index 732fa4db..0fecdf63 100644 --- a/packages/js-local-overrides/package.json +++ b/packages/js-local-overrides/package.json @@ -1,8 +1,8 @@ { "name": "@statsig/js-local-overrides", - "version": "1.2.0", + "version": "1.3.0", "dependencies": { - "@statsig/client-core": "1.2.0" + "@statsig/client-core": "1.3.0" }, "type": "commonjs", "main": "./src/index.js", diff --git a/packages/js-on-device-eval-client/package.json b/packages/js-on-device-eval-client/package.json index abb66deb..e8893289 100644 --- a/packages/js-on-device-eval-client/package.json +++ b/packages/js-on-device-eval-client/package.json @@ -1,9 +1,9 @@ { "name": "@statsig/js-on-device-eval-client", - "version": "1.2.0", + "version": "1.3.0", "dependencies": { - "@statsig/client-core": "1.2.0", - "@statsig/sha256": "1.2.0" + "@statsig/client-core": "1.3.0", + "@statsig/sha256": "1.3.0" }, "jsdelivr": "./build/statsig-js-on-device-eval-client.min.js", "type": "commonjs", diff --git a/packages/js-user-persisted-storage/package.json b/packages/js-user-persisted-storage/package.json index d2d71528..d97688a4 100644 --- a/packages/js-user-persisted-storage/package.json +++ b/packages/js-user-persisted-storage/package.json @@ -1,8 +1,8 @@ { "name": "@statsig/js-user-persisted-storage", - "version": "1.2.0", + "version": "1.3.0", "dependencies": { - "@statsig/client-core": "1.2.0" + "@statsig/client-core": "1.3.0" }, "type": "commonjs", "main": "./src/index.js", diff --git a/packages/react-bindings/package.json b/packages/react-bindings/package.json index b8640c4f..41249f86 100644 --- a/packages/react-bindings/package.json +++ b/packages/react-bindings/package.json @@ -1,8 +1,8 @@ { "name": "@statsig/react-bindings", - "version": "1.2.0", + "version": "1.3.0", "dependencies": { - "@statsig/client-core": "1.2.0" + "@statsig/client-core": "1.3.0" }, "peerDependencies": { "react": "^16.6.3 || ^17.0.0 || ^18.0.0" diff --git a/packages/react-native-bindings/package.json b/packages/react-native-bindings/package.json index 8d4be970..3f186522 100644 --- a/packages/react-native-bindings/package.json +++ b/packages/react-native-bindings/package.json @@ -1,10 +1,10 @@ { "name": "@statsig/react-native-bindings", - "version": "1.2.0", + "version": "1.3.0", "dependencies": { - "@statsig/client-core": "1.2.0", - "@statsig/react-bindings": "1.2.0", - "@statsig/react-native-core": "1.2.0" + "@statsig/client-core": "1.3.0", + "@statsig/react-bindings": "1.3.0", + "@statsig/react-native-core": "1.3.0" }, "peerDependencies": { "react": "^16.6.3 || ^17.0.0 || ^18.0.0", diff --git a/packages/react-native-core/package.json b/packages/react-native-core/package.json index 9e7453b6..4b2e3dd5 100644 --- a/packages/react-native-core/package.json +++ b/packages/react-native-core/package.json @@ -1,9 +1,9 @@ { "name": "@statsig/react-native-core", - "version": "1.2.0", + "version": "1.3.0", "dependencies": { - "@statsig/client-core": "1.2.0", - "@statsig/react-bindings": "1.2.0" + "@statsig/client-core": "1.3.0", + "@statsig/react-bindings": "1.3.0" }, "peerDependencies": { "react": "^16.6.3 || ^17.0.0 || ^18.0.0", diff --git a/packages/session-replay/package.json b/packages/session-replay/package.json index 8d419262..792d7f39 100644 --- a/packages/session-replay/package.json +++ b/packages/session-replay/package.json @@ -1,9 +1,9 @@ { "name": "@statsig/session-replay", - "version": "1.2.0", + "version": "1.3.0", "dependencies": { "rrweb": "2.0.0-alpha.12", - "@statsig/client-core": "1.2.0" + "@statsig/client-core": "1.3.0" }, "devDependencies": { "@rrweb/types": "2.0.0-alpha.12" diff --git a/packages/sha256/package.json b/packages/sha256/package.json index 47728294..38b62bb0 100644 --- a/packages/sha256/package.json +++ b/packages/sha256/package.json @@ -1,6 +1,6 @@ { "name": "@statsig/sha256", - "version": "1.2.0", + "version": "1.3.0", "dependencies": {}, "devDependencies": { "js-sha256": "0.10.1" diff --git a/packages/test-helpers/package.json b/packages/test-helpers/package.json index f3d5d41f..c5c9d574 100644 --- a/packages/test-helpers/package.json +++ b/packages/test-helpers/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "statsig-test-helpers", - "version": "1.2.0", + "version": "1.3.0", "dependencies": { "@jest/globals": "29.7.0" }, diff --git a/packages/web-analytics/package.json b/packages/web-analytics/package.json index 0874cd02..e9d89a14 100644 --- a/packages/web-analytics/package.json +++ b/packages/web-analytics/package.json @@ -1,9 +1,9 @@ { "name": "@statsig/web-analytics", - "version": "1.2.0", + "version": "1.3.0", "dependencies": { - "@statsig/client-core": "1.2.0", - "@statsig/js-client": "1.2.0" + "@statsig/client-core": "1.3.0", + "@statsig/js-client": "1.3.0" }, "jsdelivr": "./build/statsig-web-analytics.min.js", "type": "commonjs", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a68546fc..644f1981 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,9 +1,5 @@ lockfileVersion: '6.0' -settings: - autoInstallPeers: false - excludeLinksFromLockfile: false - overrides: braces: '>=3.0.3' express@<4.19.2: '>=4.19.2' @@ -426,100 +422,100 @@ importers: packages/combo: dependencies: '@statsig/client-core': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../client-core '@statsig/js-client': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../js-client '@statsig/js-local-overrides': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../js-local-overrides '@statsig/js-on-device-eval-client': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../js-on-device-eval-client '@statsig/js-user-persisted-storage': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../js-user-persisted-storage '@statsig/react-bindings': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../react-bindings '@statsig/session-replay': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../session-replay '@statsig/web-analytics': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../web-analytics packages/expo-bindings: dependencies: '@statsig/client-core': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../client-core '@statsig/react-bindings': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../react-bindings '@statsig/react-native-core': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../react-native-core packages/js-client: dependencies: '@statsig/client-core': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../client-core packages/js-local-overrides: dependencies: '@statsig/client-core': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../client-core packages/js-on-device-eval-client: dependencies: '@statsig/client-core': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../client-core '@statsig/sha256': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../sha256 packages/js-user-persisted-storage: dependencies: '@statsig/client-core': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../client-core packages/react-bindings: dependencies: '@statsig/client-core': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../client-core packages/react-native-bindings: dependencies: '@statsig/client-core': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../client-core '@statsig/react-bindings': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../react-bindings '@statsig/react-native-core': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../react-native-core packages/react-native-core: dependencies: '@statsig/client-core': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../client-core '@statsig/react-bindings': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../react-bindings packages/session-replay: dependencies: '@statsig/client-core': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../client-core rrweb: specifier: 2.0.0-alpha.12 @@ -544,10 +540,10 @@ importers: packages/web-analytics: dependencies: '@statsig/client-core': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../client-core '@statsig/js-client': - specifier: 1.2.0 + specifier: 1.3.0 version: link:../js-client packages: @@ -6093,7 +6089,6 @@ packages: - '@angular-devkit/build-angular' - '@angular-devkit/core' - '@angular-devkit/schematics' - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@schematics/angular' @@ -6134,7 +6129,6 @@ packages: dependencies: '@nx/cypress': 18.0.4(@swc-node/register@1.8.0)(@swc/core@1.3.107)(@types/node@18.19.18)(cypress@13.7.0)(nx@18.0.4)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6161,7 +6155,6 @@ packages: dependencies: '@nx/eslint-plugin': 18.0.4(@swc-node/register@1.8.0)(@swc/core@1.3.107)(@types/node@18.19.18)(@typescript-eslint/parser@6.21.0)(eslint-config-prettier@9.1.0)(eslint@8.48.0)(nx@18.0.4)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6181,7 +6174,6 @@ packages: dependencies: '@nx/expo': 18.0.4(@swc-node/register@1.8.0)(@swc/core@1.3.107)(@types/node@18.19.18)(encoding@0.1.13)(nx@18.0.4)(ts-node@10.9.2)(typescript@5.3.3)(uglify-js@3.17.4) transitivePeerDependencies: - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -6219,7 +6211,6 @@ packages: dependencies: '@nx/jest': 18.0.4(@swc-node/register@1.8.0)(@swc/core@1.3.107)(@types/node@18.19.18)(nx@18.0.4)(ts-node@10.9.2)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6239,7 +6230,6 @@ packages: dependencies: '@nx/js': 18.0.4(@swc-node/register@1.8.0)(@swc/core@1.3.107)(@types/node@18.19.18)(nx@18.0.4)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6257,7 +6247,6 @@ packages: '@nx/next': 18.0.4(@babel/core@7.23.9)(@swc-node/register@1.8.0)(@swc/core@1.3.107)(@types/node@18.19.18)(next@14.1.1)(nx@18.0.4)(typescript@5.3.3)(uglify-js@3.17.4) transitivePeerDependencies: - '@babel/core' - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -6294,7 +6283,6 @@ packages: dependencies: '@nx/react-native': 18.0.4(@swc-node/register@1.8.0)(@swc/core@1.3.107)(@types/node@18.19.18)(encoding@0.1.13)(nx@18.0.4)(ts-node@10.9.2)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6318,7 +6306,6 @@ packages: dependencies: '@nx/react': 18.0.4(@swc-node/register@1.8.0)(@swc/core@1.3.107)(@types/node@18.19.18)(nx@18.0.4)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6336,7 +6323,6 @@ packages: dependencies: '@nx/storybook': 18.0.4(@swc-node/register@1.8.0)(@swc/core@1.3.107)(@types/node@18.19.18)(cypress@13.7.0)(nx@18.0.4)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6367,7 +6353,6 @@ packages: dependencies: '@nx/web': 18.0.4(@swc-node/register@1.8.0)(@swc/core@1.3.107)(@types/node@18.19.18)(nx@18.0.4)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6384,7 +6369,6 @@ packages: dependencies: '@nx/webpack': 18.0.4(@swc-node/register@1.8.0)(@swc/core@1.3.107)(@types/node@18.19.18)(nx@18.0.4)(typescript@5.3.3)(uglify-js@3.17.4) transitivePeerDependencies: - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -6462,7 +6446,6 @@ packages: webpack: 5.91.0(@swc/core@1.3.107)(uglify-js@3.17.4) webpack-merge: 5.10.0 transitivePeerDependencies: - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -6513,7 +6496,6 @@ packages: semver: 7.6.0 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6564,7 +6546,6 @@ packages: semver: 7.6.0 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6592,7 +6573,6 @@ packages: tslib: 2.6.2 typescript: 5.3.3 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6624,7 +6604,6 @@ packages: tsconfig-paths-webpack-plugin: 4.0.0 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -6675,7 +6654,6 @@ packages: resolve.exports: 1.1.0 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6711,7 +6689,7 @@ packages: '@phenomnomnominal/tsquery': 5.0.1(typescript@5.3.3) babel-plugin-const-enum: 1.2.0(@babel/core@7.23.9) babel-plugin-macros: 2.8.0 - babel-plugin-transform-typescript-metadata: 0.3.2(@babel/core@7.23.9) + babel-plugin-transform-typescript-metadata: 0.3.2 chalk: 4.1.2 columnify: 1.6.0 detect-port: 1.5.1 @@ -6729,7 +6707,6 @@ packages: tsconfig-paths: 4.2.0 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6745,7 +6722,6 @@ packages: dependencies: '@nx/eslint': 18.0.4(@swc-node/register@1.8.0)(@swc/core@1.3.107)(@types/node@18.19.18)(nx@18.0.4) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6783,7 +6759,6 @@ packages: webpack-merge: 5.10.0 transitivePeerDependencies: - '@babel/core' - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -6920,7 +6895,6 @@ packages: minimatch: 9.0.3 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6954,7 +6928,6 @@ packages: tsconfig-paths: 4.2.0 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6987,7 +6960,6 @@ packages: minimatch: 9.0.3 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -7012,7 +6984,6 @@ packages: semver: 7.6.0 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -7037,7 +7008,6 @@ packages: http-server: 14.1.1 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -7090,7 +7060,6 @@ packages: webpack-node-externals: 3.0.0 webpack-subresource-integrity: 5.1.0(webpack@5.90.1) transitivePeerDependencies: - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -10258,16 +10227,9 @@ packages: transitivePeerDependencies: - '@babel/core' - /babel-plugin-transform-typescript-metadata@0.3.2(@babel/core@7.23.9): + /babel-plugin-transform-typescript-metadata@0.3.2: resolution: {integrity: sha512-mWEvCQTgXQf48yDqgN7CH50waTyYBeP2Lpqx4nNWab9sxEpdXVeKgfj1qYI2/TgUPQtNFZ85i3PemRtnXVYYJg==} - peerDependencies: - '@babel/core': ^7 - '@babel/traverse': ^7 - peerDependenciesMeta: - '@babel/traverse': - optional: true dependencies: - '@babel/core': 7.23.9 '@babel/helper-plugin-utils': 7.22.5 dev: true @@ -22359,3 +22321,7 @@ packages: /zone.js@0.14.6: resolution: {integrity: sha512-vyRNFqofdaHVdWAy7v3Bzmn84a1JHWSjpuTZROT/uYn8I3p2cmo7Ro9twFmYRQDPhiYOV7QLk0hhY4JJQVqS6Q==} + +settings: + autoInstallPeers: false + excludeLinksFromLockfile: false diff --git a/samples/web-minified/src/assets/statsig-js-client+session-replay+web-analytics.min.js b/samples/web-minified/src/assets/statsig-js-client+session-replay+web-analytics.min.js index 4066b1db..b55b5cce 100644 --- a/samples/web-minified/src/assets/statsig-js-client+session-replay+web-analytics.min.js +++ b/samples/web-minified/src/assets/statsig-js-client+session-replay+web-analytics.min.js @@ -5,4 +5,4 @@ or you can use record.mirror to access the mirror instance during recording.`;le `;return r&&o.push("//# sourceMappingURL="+r+` `),o}function an(e,t){var r=sn(e,t),n=new Blob(r,{type:"application/javascript"});return URL.createObjectURL(n)}function ln(e,t){var r;return function(o){return r=r||an(e,t),new Worker(r,o)}}var cn=ln(function(){(function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=typeof Uint8Array>"u"?[]:new Uint8Array(256),r=0;r>2],h+=e[(c[d]&3)<<4|c[d+1]>>4],h+=e[(c[d+1]&15)<<2|c[d+2]>>6],h+=e[c[d+2]&63];return p%3===2?h=h.substring(0,h.length-1)+"=":p%3===1&&(h=h.substring(0,h.length-2)+"=="),h};const o=new Map,a=new Map;async function l(s,c,d){const p=`${s}-${c}`;if("OffscreenCanvas"in globalThis){if(a.has(p))return a.get(p);const h=new OffscreenCanvas(s,c);h.getContext("2d");const m=await(await h.convertToBlob(d)).arrayBuffer(),f=n(m);return a.set(p,f),f}else return""}const i=self;i.onmessage=async function(s){if("OffscreenCanvas"in globalThis){const{id:c,bitmap:d,width:p,height:h,dataURLOptions:m}=s.data,f=l(p,h,m),u=new OffscreenCanvas(p,h);u.getContext("2d").drawImage(d,0,0),d.close();const y=await u.convertToBlob(m),S=y.type,b=await y.arrayBuffer(),g=n(b);if(!o.has(c)&&await f===g)return o.set(c,g),i.postMessage({id:c});if(o.get(c)===g)return i.postMessage({id:c});i.postMessage({id:c,type:S,base64:g,width:p,height:h}),o.set(c,g)}else return i.postMessage({id:s.data.id})}})()},null),Ft=Object.getOwnPropertySymbols,dn=Object.prototype.hasOwnProperty,un=Object.prototype.propertyIsEnumerable,pn=(e,t)=>{var r={};for(var n in e)dn.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ft)for(var n of Ft(e))t.indexOf(n)<0&&un.call(e,n)&&(r[n]=e[n]);return r},hn=(e,t,r)=>new Promise((n,o)=>{var a=s=>{try{i(r.next(s))}catch(c){o(c)}},l=s=>{try{i(r.throw(s))}catch(c){o(c)}},i=s=>s.done?n(s.value):Promise.resolve(s.value).then(a,l);i((r=r.apply(e,t)).next())});class mn{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(s,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(s)||this.pendingCanvasMutations.set(s,[]),this.pendingCanvasMutations.get(s).push(c)};const{sampling:r="all",win:n,blockClass:o,blockSelector:a,recordCanvas:l,dataURLOptions:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,l&&r==="all"&&this.initCanvasMutationObserver(n,o,a),l&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o,a,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,o,a){const l=Dt(r,n,o,!0),i=new Map,s=new cn;s.onmessage=f=>{const{id:u}=f.data;if(i.set(u,!1),!("base64"in f.data))return;const{base64:y,type:S,width:b,height:g}=f.data;this.mutationCb({id:u,type:ae["2D"],commands:[{property:"clearRect",args:[0,0,b,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};const c=1e3/t;let d=0,p;const h=()=>{const f=[];return r.document.querySelectorAll("canvas").forEach(u=>{F(u,n,o,!0)||f.push(u)}),f},m=f=>{if(d&&f-dhn(this,null,function*(){var y;const S=this.mirror.getId(u);if(i.get(S))return;if(i.set(S,!0),["webgl","webgl2"].includes(u.__context)){const g=u.getContext(u.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}const b=yield createImageBitmap(u);s.postMessage({id:S,bitmap:b,width:u.width,height:u.height,dataURLOptions:a.dataURLOptions},[b])})),p=requestAnimationFrame(m)};p=requestAnimationFrame(m),this.resetObservers=()=>{l(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=Dt(t,r,n,!1),a=rn(this.processMutation.bind(this),t,r,n),l=on(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{o(),a(),l()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(l=>pn(l,["type"])),{type:a}=n[0];this.mutationCb({id:r,type:a,commands:o}),this.pendingCanvasMutations.delete(t)}}class fn{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new br,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},o=[];for(const a of t){let l;this.styleMirror.has(a)?l=this.styleMirror.getId(a):(l=this.styleMirror.add(a),o.push({styleId:l,rules:Array.from(a.rules||CSSRule,(i,s)=>({rule:Ge(i),index:s}))})),n.styleIds.push(l)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class yn{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(o=>o!==r)}add(t,r){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}var gn=Object.defineProperty,Sn=Object.defineProperties,bn=Object.getOwnPropertyDescriptors,_t=Object.getOwnPropertySymbols,vn=Object.prototype.hasOwnProperty,In=Object.prototype.propertyIsEnumerable,Pt=(e,t,r)=>t in e?gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t)=>{for(var r in t||(t={}))vn.call(t,r)&&Pt(e,r,t[r]);if(_t)for(var r of _t(t))In.call(t,r)&&Pt(e,r,t[r]);return e},Mn=(e,t)=>Sn(e,bn(t));function N(e){return Mn($({},e),{timestamp:Me()})}let E,Ee,Ue,Re=!1;const j=Xt();function ye(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:a=null,ignoreClass:l="rr-ignore",ignoreSelector:i=null,maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:p,maskInputOptions:h,slimDOMOptions:m,maskInputFn:f,maskTextFn:u,hooks:y,packFn:S,sampling:b={},dataURLOptions:g={},mousemoveWait:v,recordDOM:R=!0,recordCanvas:D=!1,recordCrossOriginIframes:V=!1,recordAfter:U=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:z=!1,collectFonts:B=!1,inlineImages:X=!1,plugins:k,keepIframeSrcFn:Z=()=>!1,ignoreCSSAttributes:W=new Set([]),errorHandler:J}=e;kr(J);const G=V?window.parent===window:!0;let xe=!1;if(!G)try{window.parent.document&&(xe=!1)}catch{xe=!0}if(G&&!t)throw new Error("emit function is required");v!==void 0&&b.mousemove===void 0&&(b.mousemove=v),j.reset();const je=p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:h!==void 0?h:{password:!0},ze=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};Sr();let $t,Be=0;const Wt=I=>{for(const H of k||[])H.eventProcessor&&(I=H.eventProcessor(I));return S&&!xe&&(I=S(I)),I};E=(I,H)=>{var x;if(((x=Q[0])==null?void 0:x.isFrozen())&&I.type!==C.FullSnapshot&&!(I.type===C.IncrementalSnapshot&&I.data.source===M.Mutation)&&Q.forEach(_=>_.unfreeze()),G)t?.(Wt(I),H);else if(xe){const _={type:"rrweb",event:Wt(I),origin:window.location.origin,isCheckout:H};window.parent.postMessage(_,"*")}if(I.type===C.FullSnapshot)$t=I,Be=0;else if(I.type===C.IncrementalSnapshot){if(I.data.source===M.Mutation&&I.data.isAttachIframe)return;Be++;const _=n&&Be>=n,ce=r&&I.timestamp-$t.timestamp>r;(_||ce)&&Ee(!0)}};const Le=I=>{E(N({type:C.IncrementalSnapshot,data:$({source:M.Mutation},I)}))},Ut=I=>E(N({type:C.IncrementalSnapshot,data:$({source:M.Scroll},I)})),jt=I=>E(N({type:C.IncrementalSnapshot,data:$({source:M.CanvasMutation},I)})),wn=I=>E(N({type:C.IncrementalSnapshot,data:$({source:M.AdoptedStyleSheet},I)})),ee=new fn({mutationCb:Le,adoptedStyleSheetCb:wn}),te=new Gr({mirror:j,mutationCb:Le,stylesheetManager:ee,recordCrossOriginIframes:V,wrappedEmit:E});for(const I of k||[])I.getMirror&&I.getMirror({nodeMirror:j,crossOriginIframeMirror:te.crossOriginIframeMirror,crossOriginIframeStyleMirror:te.crossOriginIframeStyleMirror});const He=new yn;Ue=new mn({recordCanvas:D,mutationCb:jt,win:window,blockClass:o,blockSelector:a,mirror:j,sampling:b.canvas,dataURLOptions:g});const Ne=new Qr({mutationCb:Le,scrollCb:Ut,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:je,dataURLOptions:g,maskTextFn:u,maskInputFn:f,recordCanvas:D,inlineImages:X,sampling:b,slimDOMOptions:ze,iframeManager:te,stylesheetManager:ee,canvasManager:Ue,keepIframeSrcFn:Z,processedNodeManager:He},mirror:j});Ee=(I=!1)=>{if(!R)return;E(N({type:C.Meta,data:{href:window.location.href,width:ot(),height:nt()}}),I),ee.reset(),Ne.init(),Q.forEach(x=>x.lock());const H=yr(document,{mirror:j,blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:je,maskTextFn:u,slimDOM:ze,dataURLOptions:g,recordCanvas:D,inlineImages:X,onSerialize:x=>{it(x,j)&&te.addIframe(x),lt(x,j)&&ee.trackLinkElement(x),$e(x)&&Ne.addShadowRoot(x.shadowRoot,document)},onIframeLoad:(x,_)=>{te.attachIframe(x,_),Ne.observeAttachShadow(x)},onStylesheetLoad:(x,_)=>{ee.attachLinkElement(x,_)},keepIframeSrcFn:Z});if(!H)return console.warn("Failed to snapshot the document");E(N({type:C.FullSnapshot,data:{node:H,initialOffset:rt(window)}}),I),Q.forEach(x=>x.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ee.adoptStyleSheets(document.adoptedStyleSheets,j.getId(document))};try{const I=[],H=_=>{var ce;return w(Vr)({mutationCb:Le,mousemoveCb:(T,Ve)=>E(N({type:C.IncrementalSnapshot,data:{source:Ve,positions:T}})),mouseInteractionCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.MouseInteraction},T)})),scrollCb:Ut,viewportResizeCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.ViewportResize},T)})),inputCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.Input},T)})),mediaInteractionCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.MediaInteraction},T)})),styleSheetRuleCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.StyleSheetRule},T)})),styleDeclarationCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.StyleDeclaration},T)})),canvasMutationCb:jt,fontCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.Font},T)})),selectionCb:T=>{E(N({type:C.IncrementalSnapshot,data:$({source:M.Selection},T)}))},customElementCb:T=>{E(N({type:C.IncrementalSnapshot,data:$({source:M.CustomElement},T)}))},blockClass:o,ignoreClass:l,ignoreSelector:i,maskTextClass:s,maskTextSelector:c,maskInputOptions:je,inlineStylesheet:d,sampling:b,recordDOM:R,recordCanvas:D,inlineImages:X,userTriggeredOnInput:z,collectFonts:B,doc:_,maskInputFn:f,maskTextFn:u,keepIframeSrcFn:Z,blockSelector:a,slimDOMOptions:ze,dataURLOptions:g,mirror:j,iframeManager:te,stylesheetManager:ee,shadowDomManager:Ne,processedNodeManager:He,canvasManager:Ue,ignoreCSSAttributes:W,plugins:((ce=k?.filter(T=>T.observer))==null?void 0:ce.map(T=>({observer:T.observer,options:T.options,callback:Ve=>E(N({type:C.Plugin,data:{plugin:T.name,payload:Ve}}))})))||[]},y)};te.addLoadListener(_=>{try{I.push(H(_.contentDocument))}catch(ce){console.warn(ce)}});const x=()=>{Ee(),I.push(H(document)),Re=!0};return document.readyState==="interactive"||document.readyState==="complete"?x():(I.push(A("DOMContentLoaded",()=>{E(N({type:C.DomContentLoaded,data:{}})),U==="DOMContentLoaded"&&x()})),I.push(A("load",()=>{E(N({type:C.Load,data:{}})),U==="load"&&x()},window))),()=>{I.forEach(_=>_()),He.destroy(),Re=!1,Or()}}catch(I){console.warn(I)}}return ye.addCustomEvent=(e,t)=>{if(!Re)throw new Error("please add custom event after start recording");E(N({type:C.Custom,data:{tag:e,payload:t}}))},ye.freezePage=()=>{Q.forEach(e=>e.freeze())},ye.takeFullSnapshot=e=>{if(!Re)throw new Error("please take full snapshot after start recording");Ee(e)},ye.mirror=j,ye}(); -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("rrwebRecord")):"function"==typeof define&&define.amd?define(["rrwebRecord"],e):"object"==typeof exports?exports.Statsig=e(require("rrwebRecord")):t.Statsig=e(t.rrwebRecord)}(this,l=>(()=>{"use strict";var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});var i={8352:t=>{t.exports=l},5496:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.t=i.i=i.o=void 0,i.o=()=>__STATSIG__||u,i.i=t=>(0,i.o)()[t];i.t=t=>{var e=(0,i.o)();return t?e.instances&&e.instances[t]:e.lastInstance};var n,s="__STATSIG__",r="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},o="undefined"!=typeof globalThis?globalThis:{};const u=null!=(n=null!=(n=null!=(n=r[s])?n:e[s])?n:o[s])?n:{instance:i.t};r[s]=u,e[s]=u,o[s]=u},1707:(t,e,i)=>{$Q(e),e.u=e.l=void 0;const s=i(7832);function n(t,e,i){if(i)return i(t,e);const n=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(i=null==e?void 0:e.userID)?i:""),"cids:"+Object.keys(n).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+n[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.l=n,e.u=function(t,e,i){return e?n(t,e,i):(0,s.h)("k:"+t)}},5856:(t,e)=>{$Q(e)},2320:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const l=i(6780),a=i(1604),r=i(6296),o=i(3444),c=i(2412);function h(t,e,i,n){return{source:t,data:e,receivedAt:Date.now(),stableID:i,fullUserHash:(0,r.v)(n)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.m=e,this.p=null,this.S=null,this.O="statsig.last_modified_time."+e,this.j=new n}attach(t,e){this.S=t,this.p=e}getDataSync(t){var e=this.T(t),i=this.j.get(e,t);return i||((i=this.I(e))?(this.j.add(e,i),this.j.get(e,t)):null)}setData(t,e){var e=e&&(0,r.A)(e,null==(e=this.p)?void 0:e.environment),i=this.T(e);this.j.add(i,h("Bootstrap",t,null,e))}__primeInMemoryCache(t){this.j.merge(t)}M(e,i,n){return s(this,void 0,void 0,function*(){var t=null!=e?e:this.getDataSync(i),t=[this.k(t,i,n)];return null!=n&&n.timeoutMs&&t.push(new Promise(t=>setTimeout(t,n.timeoutMs)).then(()=>(l.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}D(i,n){return s(this,void 0,void 0,function*(){var t=this.T(i),e=yield this.M(null,i,n);e&&this.j.add(t,$P($P({},e),{source:"Prefetch"}))})}k(r,o,u){return s(this,void 0,void 0,function*(){let t=null;r&&this.R(r,o)&&(t=r.data);var e=yield this.N(t,o,u);if(!e)return l.Log.debug("No response returned for latest value"),null;var i=(0,c.C)(e,"has_updates","Response"),n=this.P(),n=yield a.StableID.get(n);let s=null;if(!0===(null==i?void 0:i.has_updates))s=h("Network",e,n,o);else{if(!t||!1!==(null==i?void 0:i.has_updates))return null;s=h("NetworkNotModified",t,n,o)}e=this.T(o);return this.j.add(e,s),yield this.G(e,s),s})}P(){return null!=this.S?this.S:(l.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=o.Storage.U)?void 0:e.call(o.Storage,t);return null!=e&&(t=(0,c.C)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}G(t,e){return s(this,void 0,void 0,function*(){yield o.Storage.L(t,JSON.stringify(e)),yield this.K(t)})}K(i){var n;return s(this,void 0,void 0,function*(){var t=null!=(n=yield(0,o.F)(this.O))?n:{},e=(t[i]=Date.now(),u(t,10));e&&(delete t[e],yield o.Storage.q(e)),yield(0,o.J)(this.O,t)})}};class n{constructor(){this.V={}}get(t,e){var t=this.V[t],i=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&i&&e!==i?(l.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var i=u(this.V,9);i&&delete this.V[i],this.V[t]=e}merge(t){this.V=$P($P({},this.V),t)}}function u(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var i=s[t],n=s[e];return"object"==typeof i&&"object"==typeof n?n.receivedAt{$Q(e),e.Diagnostics=void 0;e.Diagnostics=class{static mark(){}}},184:(t,e)=>{$Q(e)},8512:function(t,u,e){var i=this&&this.__awaiter||$A();$Q2(u,"__esModule",{value:!0}),u.ErrorBoundary=u.EXCEPTION_ENDPOINT=void 0;const n=e(6780),l=e(7360),a=e(6972),c=(u.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");u.ErrorBoundary=class{constructor(t,e,i){this.S=t,this.p=e,this.B=i,this.$=new Set}wrap(n){try{const t=n;!function(t){const e=new Set;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;)Object.getOwnPropertyNames(i).filter(t=>"function"==typeof(null===i||void 0===i?void 0:i[t])).forEach(t=>e.add(t)),i=Object.getPrototypeOf(i);return Array.from(e)}(t).forEach(e=>{const i=t[e];"$EB"in i||(t[e]=(...t)=>this.H(e,()=>i.apply(n,t)),t[e].$EB=!0)})}catch(t){this.W("eb:wrap",t)}}logError(t,e){this.W(t,e)}H(e,t){try{var i=t();return i&&i instanceof Promise?i.catch(t=>this.W(e,t)):i}catch(t){return this.W(e,t),null}}W(r,o){try{n.Log.warn("Caught error in "+r,{error:o});i(this,void 0,void 0,function*(){var t,e,i=o||Error(c),n=i instanceof Error,s=n?i.name:"No Name";this.$.has(s)||(this.$.add(s),null!=(t=null==(t=this.p)?void 0:t.networkConfig)&&t.preventAllNetworkTraffic?null!=(t=this.B)&&t.call(this,{name:"error",error:o}):(t=l.SDKType.Y(this.S),e=a.StatsigMetadataProvider.get(),n=n?i.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(i),i=JSON.stringify($P({tag:r,exception:s,info:n},$P($P({},e),{sdkType:t}))),yield(null!=(s=null==(n=null==(s=this.p)?void 0:s.networkConfig)?void 0:n.networkOverrideFunc)?s:fetch)(u.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.S,"STATSIG-SDK-TYPE":String(t),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:i}),null!=(n=this.B)&&n.call(this,{name:"error",error:o})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},500:(t,e)=>{$Q(e)},6788:(t,e)=>{$Q(e)},6728:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=i(7832),r=i(6780),o=i(7716),u=i(6048),l=i(1876),a=i(3444),c=i(84),h=i(100),d={},v=t=>{null!=(t=d[t])&&t.flush().catch(()=>{})};e.EventLogger=class{constructor(e,t,i,n){this.S=e,this.B=t,this.X=i,this.p=n,this.Z=[],this.tt={},this.et={},this.it=!1,this.nt=Date.now(),(d[e]=this).st=!0===(null==n?void 0:n.disableLogging),this.rt=null!=(t=null==n?void 0:n.loggingBufferMaxSize)?t:50;i=null==n?void 0:n.networkConfig;this.ot=(0,c.ut)(null==i?void 0:i.logEventUrl,null==i?void 0:i.api,"/rgstr",o.NetworkDefault.eventsApi),(0,h.lt)(t=>{"background"===t&&v(e)}),this.ct(),this.ht()}setLoggingDisabled(t){this.st=t}enqueue(t){this.dt(t)&&(this.vt(t),this._t(),this.Z.length>this.rt)&&v(this.S)}incrementNonExposureCount(t){var e=null!=(e=this.et[t])?e:0;this.et[t]=e+1}reset(){this.tt={}}shutdown(){return n(this,void 0,void 0,function*(){this.ft&&(clearInterval(this.ft),this.ft=null),yield this.flush()})}flush(){return n(this,void 0,void 0,function*(){var t;if(this.gt(),0!==this.Z.length)return t=this.Z,this.Z=[],this.bt(t)})}_t(){this.it||(this.it=!0,200v(this.S),200)}dt(t){if((0,l.yt)(t)){var e=t.user||{},i=t.metadata||{},t=[t.eventName,e.userID,i.gate,i.config,i.ruleID].join("|"),e=this.tt[t],i=Date.now();if(e&&i-e<6e4)return!1;1e3{r.Log.warn("Unable to save failed logs to storage")})}ct(){const e=this.u();n(this,void 0,void 0,function*(){var t=yield(0,a.F)(e);t&&(yield a.Storage.q(e),yield this.bt(t))}).catch(()=>{r.Log.warn("Failed to flush stored logs")})}u(){return"statsig.failed_logs."+(0,s.h)(this.S)}vt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},i=this.It(),i=(i&&(e.statsigMetadata={currentPage:i}),$P($P({},t),e));r.Log.debug("Enqueued Event:",i),this.Z.push(i)}gt(){0!==Object.keys(this.et).length&&(this.vt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.et)}}),this.et={})}It(){var t;if(!1!==(null==(t=this.p)?void 0:t.includeCurrentPageUrlWithEvents))return(0,u.At)()}ht(){if((0,u.Mt)()){var t=null!=(t=null==(t=this.p)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{d[this.S].ft!==e?clearInterval(e):v(this.S)},t);this.ft=e}}}},7832:(t,e)=>{$Q(e),e.xt=e.h=void 0;e.h=e=>{let i=0;for(let t=0;t>>0)};e.xt=t=>(0,e.h)(JSON.stringify(s(t)));const s=i=>{if(null==i)return null;var t=Object.keys(i).sort();const n={};return t.forEach(t=>{let e=i[t];!Array.isArray(e)&&e instanceof Object&&(e=s(e)),n[t]=e}),n}},9664:(t,e)=>{$Q(e)},6780:(t,e)=>{function i(t){return t.unshift("[Statsig]"),t}var n,s;$Q(e),e.Log=e.LogLevel=void 0,(s=n||(e.LogLevel=n={}))[s.None=0]="None",s[s.Error=1]="Error",s[s.Warn=2]="Warn",s[s.Info=3]="Info",s[s.Debug=4]="Debug";class r{static info(...t){this.level>=n.Info&&console.info(...i(t))}static debug(...t){this.level>=n.Debug&&console.debug(...i(t))}static warn(...t){this.level>=n.Warn&&console.warn(...i(t))}static error(...t){this.level>=n.Error&&console.error(...i(t))}}(e.Log=r).level=n.Error},7716:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=void 0,e.NetworkDefault={eventsApi:"https://prodregistryv2.org/v1",initializeApi:"https://featureassets.org/v1",specsApi:"https://assetsconfigcdn.org/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},3188:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,i(5496);const o=i(5496),f=i(4280),g=i(6780),u=i(7716),l=i(7360),a=i(6048),c=i(8612),h=i(1604),d=i(6972),b=i(100);e.NetworkCore=class{constructor(t,e){this.B=e,this.kt=1e4,this.Dt={},this.p={},t&&(this.p=t),this.p.networkConfig&&(this.Dt=this.p.networkConfig),this.Dt.networkTimeoutMs&&(this.kt=this.Dt.networkTimeoutMs)}post(e){return r(this,void 0,void 0,function*(){let t=yield this.Et(e);return e.isStatsigEncodable&&(t=this.Rt(e,t)),this.Nt($P({method:"POST",body:t},e))})}get(t){return this.Nt($P({method:"GET"},t))}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}beacon(n){return r(this,void 0,void 0,function*(){var t,e,i;return!!y(n)&&(t=yield this.Et(n),e=yield this.Ct(n),(i=navigator).sendBeacon.bind(i)(e,t))})}Nt(d){var v,_;return r(this,void 0,void 0,function*(){if(!y(d))return null;if(this.Dt.preventAllNetworkTraffic)return null;var{method:e,body:i,retries:n}=d;const s="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>null===s||void 0===s?void 0:s.abort(`Timeout of ${this.kt}ms expired.`),this.kt),r=yield this.Ct(d),o=null,u=(0,b.Pt)();try{var l,a,c,h={method:e,body:i,headers:$P({},d.headers),signal:null===s||void 0===s?void 0:s.signal,priority:d.priority,keepalive:u},o=yield(null!=(v=this.Dt.networkOverrideFunc)?v:fetch)(r,h);if(clearTimeout(t),o.ok)return c=yield o.text(),f.Diagnostics.mark(),{body:c,code:o.status};throw l=yield o.text().catch(()=>"No Text"),(a=new Error(`NetworkError: ${r} `+l)).name="NetworkError",a}catch(t){i=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(s,t);return f.Diagnostics.mark(),!n||n<=0?(null!=(_=this.B)&&_.call(this,{name:"error",error:t}),g.Log.error(`A networking error occured during ${e} request to ${r}.`,i,t),null):this.Nt($P($P({},d),{retries:n-1}))}})}Ct(i){return r(this,void 0,void 0,function*(){const e=$P({[u.NetworkParam.SdkKey]:i.sdkKey,[u.NetworkParam.SdkType]:l.SDKType.Y(i.sdkKey),[u.NetworkParam.SdkVersion]:d.SDK_VERSION,[u.NetworkParam.Time]:String(Date.now()),[u.NetworkParam.SessionID]:yield c.SessionID.get(i.sdkKey)},i.params);var t=Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return i.url+(t?"?"+t:"")})}Et(s){return r(this,void 0,void 0,function*(){var{data:t,sdkKey:e}=s,i=yield h.StableID.get(e),n=yield c.SessionID.get(e),e=l.SDKType.Y(e);return JSON.stringify($P($P({},t),{statsigMetadata:$P($P({},d.StatsigMetadataProvider.get()),{stableID:i,sessionID:n,sdkType:e})}))})}Rt(t,e){var i,n,s=(0,a.Gt)();if(!t.isStatsigEncodable||this.p.disableStatsigEncoding||null!=(0,o.i)("no-encode")||null==s||!s.btoa)return e;try{var r=null!=(i=s.btoa(e).split("").reverse().join(""))?i:e;return t.params=$P($P({},null!=(n=t.params)?n:{}),{[u.NetworkParam.StatsigEncoded]:"1"}),r}catch(t){return g.Log.warn("/initialize request encoding failed"),e}}};const y=t=>!!t.sdkKey||(g.Log.warn("Unable to make request without an SDK key"),!1)},4264:(t,e)=>{$Q(e)},5648:(t,e)=>{$Q(e)},7360:(t,e)=>{$Q(e),e.SDKType=void 0;const i={};let n;e.SDKType={Y:t=>{return(null!=(t=i[t])?t:"js-mono")+(null!==n&&void 0!==n?n:"")},Ut(t,e){i[t]=e},Lt(t){n&&"-react"!==n||(n="-"+t)}}},6048:(t,n)=>{$Q2(n,"__esModule",{value:!0}),n.At=n.Kt=n.Ft=n.Mt=n.qt=n.Gt=void 0;n.Gt=()=>"undefined"!=typeof window?window:null,n.qt=()=>{var t=(0,n.Gt)();return null!=(t=null==t?void 0:t.document)?t:null},n.Mt=()=>null!=(0,n.qt)(),n.Ft=(t,e)=>{var i=(0,n.Gt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.Kt=(t,e)=>{var i=(0,n.qt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)};n.At=()=>{var t;try{return null==(t=(0,n.Gt)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},8612:function(t,e,i){var o=this&&this.__awaiter||$A();$Q(e),e.StatsigSession=e.SessionID=void 0;const n=i(1707),u=i(6780),l=i(3444),a=i(3556),c=18e5,h=144e5,d={};function v(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function _(t){return"statsig.session_id."+(0,n.u)(t)}e.SessionID={get:t=>o(void 0,void 0,void 0,function*(){return e.StatsigSession.get(t).then(t=>t.data.sessionID)})},e.StatsigSession={get:r=>o(void 0,void 0,void 0,function*(){null==d[r]&&(d[r]=function(i){return o(this,void 0,void 0,function*(){let t=yield function(t){t=_(t);return(0,l.F)(t)}(i);var e=Date.now();return{data:t=t||{sessionID:(0,a.getUUID)(),startTime:e,lastUpdate:e},sdkKey:i}})}(r));var t=yield d[r],e=Date.now(),i=t.data,n=((function({lastUpdate:t}){return Date.now()-t>c}(i)||function({startTime:t}){return Date.now()-t>h}(i))&&(i.sessionID=(0,a.getUUID)(),i.startTime=e),i.lastUpdate=e,i),s=t.sdkKey;return s=_(s),(0,l.J)(s,n).catch(()=>{u.Log.warn("Failed to save SessionID")}),clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=i.startTime,i=t.sdkKey,t.idleTimeoutID=v(i,c),t.ageTimeoutID=v(i,h-e),t})}},1604:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StableID=void 0;const s=i(1707),r=i(6780),o=i(3444),u=i(3556),l={};function a(t){return"statsig.stable_id."+(0,s.u)(t)}function c(t,e){e=a(e);(0,o.J)(e,t).catch(()=>{r.Log.warn("Failed to save StableID")})}e.StableID={get:e=>n(void 0,void 0,void 0,function*(){return null==l[e]&&(l[e]=function(t){t=a(t);return(0,o.F)(t)}(e).then(t=>{return null!=t||c(t=(0,u.getUUID)(),e),t})),l[e]}),setOverride:(t,e)=>{l[e]=Promise.resolve(t),c(t,e)}}},7688:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,i(5496);const o=i(5496),u=i(8512),l=i(6728),a=i(6780),c=i(6048),h=i(3444);e.StatsigClientBase=class{constructor(t,e,i,n){this.loadingStatus="Uninitialized",this.zt={};var s,r=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(a.Log.level=n.logLevel),null!=n&&n.disableStorage&&h.Storage.Jt(!0),this.S=t,this.p=null!=n?n:{},this.Vt=null!=(s=null==n?void 0:n.overrideAdapter)?s:null,this.Bt=new l.EventLogger(t,r,i,n),this.$t=new u.ErrorBoundary(t,n,r),this.$t.wrap(this),this.$t.wrap(i),this.$t.wrap(e),this.$t.wrap(this.Bt),(0,c.Mt)()&&(null!=(i=null!=(r=(s=(0,o.o)()).instances)?r:{})[t]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),i[t]=this,s.lastInstance=this,s.instances=i,__STATSIG__=s),this.dataAdapter=e,this.dataAdapter.attach(t,n),this.Ht()}updateRuntimeOptions(t){null!=t.disableLogging&&(this.p.disableLogging=t.disableLogging,this.Bt.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.p.disableStorage=t.disableStorage,h.Storage.Jt(t.disableStorage))}flush(){return this.Bt.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),yield this.Bt.shutdown()})}on(t,e){this.zt[t]||(this.zt[t]=[]),this.zt[t].push(e)}off(t,e){this.zt[t]&&-1!==(e=this.zt[t].indexOf(e))&&this.zt[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(i){var t;const e=e=>{try{e(i)}catch(t){!0===e.__isInternal?this.$t.logError("__emit:"+i.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",i)}};this.zt[i.name]&&this.zt[i.name].forEach(t=>e(t)),null!=(t=this.zt["*"])&&t.forEach(e)}Wt(t,e){this.loadingStatus=t,this.$emt({name:"values_updated",status:t,values:e})}Yt(t,e,i){!0===(null==i?void 0:i.disableExposureLog)?this.Bt.incrementNonExposureCount(t):this.Bt.enqueue(e)}}},5808:(t,e)=>{$Q(e)},6283:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},1876:(t,e)=>{$Q(e),e.Qt=e.Xt=e.Zt=e.yt=void 0;const i="statsig::config_exposure",n="statsig::gate_exposure",l=(t,e,i,n,s)=>({eventName:t,user:e,value:null,metadata:r(i,n),secondaryExposures:s,time:Date.now()});e.yt=({eventName:t})=>t===n||t===i,e.Zt=(t,e)=>{return l(n,t,e.details,{gate:e.name,gateValue:String(e.value),ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])},e.Xt=(t,e)=>{return l(i,t,e.details,{config:e.name,ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])};e.Qt=(t,e,i)=>{var n,s=e.__evaluation,r=!0===(null==(r=null==s?void 0:s.explicit_parameters)?void 0:r.includes(i));let o="",u=null!=(n=null==s?void 0:s.undelegated_secondary_exposures)?n:[];return r&&(o=null!=(n=s.allocated_experiment_name)?n:"",u=s.secondary_exposures),l("statsig::layer_exposure",t,e.details,{config:e.name,parameterName:i,ruleID:e.ruleID,allocatedExperiment:o,isExplicitParameter:String(r)},u)};const r=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},6972:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="1.2.0";let i={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>i,add:t=>{i=$P($P({},i),t)}}},3384:(t,e)=>{$Q(e)},6396:(t,e)=>{$Q(e),e.te=e.ee=e.ie=e.ne=e.se=e.re=e.oe=e.ue=void 0;const s="default";function r(t,e,i,n){return{name:t,details:e,ruleID:null!=(t=null==i?void 0:i.rule_id)?t:s,__evaluation:i,value:n}}function n(t,e,i){var n=null!=(n=null==i?void 0:i.value)?n:{};return $P($P({},r(t,e,i,n)),{get:u(null==i?void 0:i.value)})}function o(t,e){var i=t=>Array.isArray(t)?"array":typeof t;return i(t)===i(e)}function u(n,s){return(t,e)=>{var i=null!=(i=null==n?void 0:n[t])?i:null;return null!=i&&(null==e||o(i,e))?(null!=s&&s(t),i):null!=e?e:null}}e.ue=function(t,e,i){return r(t,e,i,!0===(null==i?void 0:i.value))},e.oe=n,e.re=function(t,e,i){return t=n(t,e,i),$P($P({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.se=function(t,e,i,n){return $P($P({},r(t,e,i,void 0)),{get:u(null==i?void 0:i.value,n),groupName:null!=(t=null==i?void 0:i.group_name)?t:null,__value:null!=(e=null==i?void 0:i.value)?e:{}})},e.ne=function(t,e,i,n){return $P($P($P({},t),e),{get:u(i,n)})},e.ie=function(t){return Array.isArray(t)?"array":typeof t},e.ee=o,e.te=u},9136:(t,e)=>{$Q(e)},6296:(t,e,i)=>{$Q(e),e.v=e.A=void 0;const n=i(7832),s=i(6780);e.A=function(t,e){try{var i=JSON.parse(JSON.stringify(t));return null!=e&&(i.statsigEnvironment=e),i}catch(t){return s.Log.error("Failed to JSON.stringify user"),{}}},e.v=function(t){return t?(0,n.xt)(t):null}},3444:function(t,i,e){var n=this&&this.__awaiter||$A(),s=($Q2(i,"__esModule",{value:!0}),i.J=i.F=i.Storage=void 0,e(6780)),e=e(6048);const r={},o=t=>Promise.resolve(t),u={le:()=>"InMemory",U:t=>r[t]||null,ae:t=>o(r[t]||null),L:(t,e)=>(r[t]=e,o()),q:t=>(delete r[t],o()),ce:()=>o(Object.keys(r))};let l=null;try{const d=(0,e.Gt)();d&&d.localStorage&&"function"==typeof d.localStorage.getItem&&(l={le:()=>"LocalStorage",U:t=>d.localStorage.getItem(t),ae:t=>o(d.localStorage.getItem(t)),L:(t,e)=>(d.localStorage.setItem(t,e),o()),q:t=>(d.localStorage.removeItem(t),o()),ce:()=>o(Object.keys(d.localStorage))})}catch(t){s.Log.warn("Failed to setup localStorageProvider.")}let a=null!==l&&void 0!==l?l:u,c=a;function h(t){try{return t()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return i.Storage.he(u),null;throw t}}i.Storage={le:()=>c.le(),ae:t=>n(void 0,void 0,void 0,function*(){return h(()=>c.ae(t))}),U:t=>h(()=>c.U?c.U(t):null),L:(t,e)=>c.L(t,e),q:t=>c.q(t),ce:()=>c.ce(),he:t=>{a=t,c=t},Jt:t=>{c=t?u:a}},i.F=function(e){return n(this,void 0,void 0,function*(){var t=yield i.Storage.ae(e);return JSON.parse(null!=t?t:"null")})},i.J=function(t,e){return n(this,void 0,void 0,function*(){yield i.Storage.L(t,JSON.stringify(e))})}},2412:(t,e,i)=>{$Q(e),e.C=void 0;const s=i(6780);e.C=function(t,e,i){try{var n=JSON.parse(t);return"object"==typeof n&&0 in n,n}catch(t){}return s.Log.error("Failed to parse "+i),null}},3556:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let i=(new Date).getTime(),n="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0{$Q(e),e.ut=void 0,e.ut=function(t,e,i,n){return t||(e?""+e+i:""+n+i)}},1539:(t,e)=>{$Q(e)},100:(t,e,i)=>{$Q(e),e.de=e.lt=e.Pt=e.Ot=void 0;i=i(6048);const n="foreground",s="background",r=[];let o=n,u=!1;e.Ot=()=>o===n,e.Pt=()=>u,e.lt=t=>{r.unshift(t)};e.de=e=>{e!==o&&(o=e,r.forEach(t=>t(e)))},(0,i.Ft)("focus",()=>{(u=!1,e.de)(n)}),(0,i.Ft)("blur",()=>(0,e.de)(s)),(0,i.Ft)("beforeunload",()=>{u=!0,(0,e.de)(s)}),(0,i.Kt)("visibilitychange",()=>{(0,e.de)("visible"===document.visibilityState?n:s)})},4464:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};$Q(e),e.Log=e.Storage=e.EventLogger=void 0,i(5496);const r=i(6728),o=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return r.EventLogger}}),i(6780));$Q2(e,"Log",{enumerable:!0,get:function(){return o.Log}});var u=i(6972);const l=i(3444);$Q2(e,"Storage",{enumerable:!0,get:function(){return l.Storage}}),s(i(5496),e),s(i(1707),e),s(i(5856),e),s(i(2320),e),s(i(184),e),s(i(8512),e),s(i(500),e),s(i(6788),e),s(i(7832),e),s(i(9664),e),s(i(6780),e),s(i(3188),e),s(i(7716),e),s(i(4264),e),s(i(5648),e),s(i(6048),e),s(i(7360),e),s(i(8612),e),s(i(1604),e),s(i(7688),e),s(i(5808),e),s(i(6283),e),s(i(1876),e),s(i(6972),e),s(i(3384),e),s(i(6396),e),s(i(9136),e),s(i(6296),e),s(i(3444),e),s(i(2412),e),s(i(84),e),s(i(1539),e),s(i(3556),e),s(i(100),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:o.Log,SDK_VERSION:u.SDK_VERSION})},9920:(t,e,i)=>{$Q(e),e.AutoInit=void 0;const h=i(4464),d=i(5208);function v(t,e){var i;return null!=(i=e.get(t))?i:e.get(t.toLowerCase())}e.AutoInit=class{static attempt(e){var t,i,n;try{var s=(0,h.Gt)(),r=(0,h.qt)();if(s&&r&&r.currentScript){var o=r.currentScript.getAttribute("src"),u=null==(t=s.location)?void 0:t.href;if(o&&u){var l=new URL(o,u).searchParams,a=null!=(i=v("sdkKey",l))?i:v("apiKey",l);if(a){var c=null==(n=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instances)?void 0:n[a];let t=null;(t=c instanceof d.StatsigClient?c:t)||(t=new d.StatsigClient(a,function(){var t=(0,h.Gt)();if(!t)return{};let e=t.statsigUser||{};var i=(e="object"!=typeof e?{}:e).custom||{},n=e.customIDs||{};return $P($P({},e),{customIDs:$P({},n),custom:$P($P({},i),{useragent:t.navigator.userAgent,page_url:(0,h.At)()||"",language:null==(n=t.navigator)?void 0:n.language})})}())).initializeAsync().catch(t=>{h.Log.error(t)}),e({sdkKey:a,client:t})}}}}catch(t){h.Log.error("AutoInit failed",t)}}}},3096:(t,e,i)=>{$Q(e),e.ve=void 0;const n=i(4464);function s(t,e){null!=t&&t.forEach(t=>{delete e[t]})}e.ve=function(t,e){var i;return(e=(0,n.C)(e,"checksum","DeltasEvaluationResponse"))?(t=t,i=e,t=$P($P($P({},t),i),{feature_gates:$P($P({},t.feature_gates),i.feature_gates),layer_configs:$P($P({},t.layer_configs),i.layer_configs),dynamic_configs:$P($P({},t.dynamic_configs),i.dynamic_configs)}),s((t=i=t).deleted_gates,t.feature_gates),delete t.deleted_gates,s(i.deleted_configs,t.dynamic_configs),delete t.deleted_configs,s(i.deleted_layers,t.layer_configs),delete t.deleted_layers,i=t,(t=(0,n.xt)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs}))===e.checksum?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:t,badMergedConfigs:i,badFullResponse:e.deltas_full_response}):{hadBadDeltaChecksum:!0}}},1536:(t,e,i)=>{$Q(e);const n=i(4464);e.default=class{constructor(){this._e=null,this.fe=null,this.ge="Uninitialized",this.be=0,this.ye=0}reset(){this.fe=null,this._e=null,this.ge="Loading",this.be=0,this.ye=0}finalize(){this.fe||(this.ge="NoValues")}getValues(){return this._e?(0,n.C)(this._e,"has_updates","EvaluationStoreValues"):null}setValues(t){var e;t&&!0===(null==(e=(0,n.C)(t.data,"has_updates","EvaluationResponse"))?void 0:e.has_updates)&&(this._e=t.data,this.be=e.time,this.ye=t.receivedAt,this.ge=t.source,this.fe=e)}getGate(t){var e;return this.me(null==(e=this.fe)?void 0:e.feature_gates,t)}getConfig(t){var e;return this.me(null==(e=this.fe)?void 0:e.dynamic_configs,t)}getLayer(t){var e;return this.me(null==(e=this.fe)?void 0:e.layer_configs,t)}getParamStore(t){var e;return this.me(null==(e=this.fe)?void 0:e.param_stores,t)}me(t,e){let i=null;return{result:i=t?t[e]||t[(0,n.h)(e)]:i,details:this.pe(null==i)}}pe(t){return"Uninitialized"===this.ge||"NoValues"===this.ge?{reason:this.ge}:{reason:this.ge+":"+(t?"Unrecognized":"Recognized"),lcut:this.be,receivedAt:this.ye}}}},9400:function(t,e,i){var o=this&&this.__awaiter||$A();$Q(e);const u=i(4464),l=i(3096);class n extends u.NetworkCore{constructor(t,e){super(t,e);e=null==t?void 0:t.networkConfig;this.Se=(0,u.ut)(null==e?void 0:e.initializeUrl,null==e?void 0:e.api,"/initialize",u.NetworkDefault.initializeApi)}fetchEvaluations(i,n,s,r){return o(this,void 0,void 0,function*(){var t=n?(0,u.C)(n,"has_updates","InitializeResponse"):null;let e={user:r,hash:"djb2",deltasResponseRequested:!1};return null!=t&&t.has_updates&&(e=$P($P({},e),{sinceTime:t.time,previousDerivedFields:"derived_fields"in t?t.derived_fields:{},deltasResponseRequested:!0})),this.Oe(i,t,e,s)})}Oe(e,i,n,s){var r;return o(this,void 0,void 0,function*(){var t=yield this.post({sdkKey:e,url:this.Se,data:n,retries:2,isStatsigEncodable:!0,priority:s});return 204===(null==t?void 0:t.code)?'{"has_updates": false}':200!==(null==t?void 0:t.code)?null!=(r=null==t?void 0:t.body)?r:null:!0!==(null==i?void 0:i.has_updates)||!0!==(null==(r=t.body)?void 0:r.includes('"is_delta":true'))?t.body:"string"==typeof(t=(0,l.ve)(i,t.body))?t:this.Oe(e,i,$P($P($P({},n),t),{deltasResponseRequested:!1}),s)})}}e.default=n},9340:(t,e,i)=>{$Q(e),e.je=void 0;const g=i(4464),b={disableExposureLog:!0};function y(t){return null==t||!1===t.disableExposureLog}function m(t,e){return null!=e&&!(0,g.ee)(t,e)}e.je=function(v,_,f){return(t,e)=>{if(null==_)return e;var i,n,s,r,o,u,l,a,c,h,d=_[t];if(null==d||null!=e&&(0,g.ie)(e)!==d.param_type)return e;switch(d.ref_type){case"static":return d.value;case"gate":return h=d,v.getFeatureGate(h.gate_name,y(f)?void 0:b).value?h.pass_value:h.fail_value;case"dynamic_config":return h=d,l=e,a=f,m(c=(u=v).getDynamicConfig(h.config_name,b).get(h.param_name),l)?l:(y(a)&&u.getDynamicConfig(h.config_name),c);case"experiment":return l=d,a=e,u=f,m(o=(c=v).getExperiment(l.experiment_name,b).get(l.param_name),a)?a:(y(u)&&c.getExperiment(l.experiment_name),o);case"layer":return o=d,n=e,s=f,m(r=(i=v).getLayer(o.layer_name,b).get(o.param_name),n)?n:(y(s)&&i.getLayer(o.layer_name).get(o.param_name),r);default:return e}}}},4520:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e);const o=i(4464),r=i(1536),u=i(9400),l=i(9340),a=i(5364);class n extends o.StatsigClientBase{static instance(t){var e=(0,o.o)().instance(t);return e instanceof n?e:(o.Log.warn((0,o.Mt)()?"Unable to find StatsigClient instance":"StatsigClient.instance is not supported in server environments"),new n(null!=t?t:"",{}))}constructor(t,e,i=null){o.SDKType.Ut(t,"javascript-client");var n=new u.default(i,t=>{this.$emt(t)});super(t,null!=(t=null==i?void 0:i.dataAdapter)?t:new a.StatsigEvaluationsDataAdapter,n,i),this.Te=new r.default,this.we=e}initializeSync(){this.updateUserSync(this.we)}initializeAsync(t){return this.updateUserAsync(this.we,t)}updateUserSync(t){this.Ie(t);t=this.dataAdapter.getDataSync(this.we);this.Te.setValues(t),this.Ae(t),this.Me(null!=t?t:null,this.we)}updateUserAsync(i,n){return s(this,void 0,void 0,function*(){this.Ie(i);var t=this.we,e=this.dataAdapter.getDataSync(t);this.Wt("Loading",e),this.Te.setValues(e),e=yield this.dataAdapter.getDataAsync(e,t,n),t===this.we&&(this.Te.setValues(e),this.Ae(e))})}getContext(){return{sdkKey:this.S,options:this.p,values:this.Te.getValues(),user:JSON.parse(JSON.stringify(this.we)),errorBoundary:this.$t}}getAsyncContext(){return s(this,void 0,void 0,function*(){return $P($P({},this.getContext()),{session:yield o.StatsigSession.get(this.S),stableID:yield o.StableID.get(this.S)})})}checkGate(t,e){return this.getFeatureGate(t,e).value}getFeatureGate(t,e){var{result:i,details:n}=this.Te.getGate(t),n=(0,o.ue)(t,n,i),s=null==(s=null==(i=this.Vt)?void 0:i.getGateOverride)?void 0:s.call(i,n,this.we,e),i=null!=s?s:n;return this.Yt(t,(0,o.Zt)(this.we,i),e),this.$emt({name:"gate_evaluation",gate:i}),i}getDynamicConfig(t,e){var{result:i,details:n}=this.Te.getConfig(t),n=(0,o.oe)(t,n,i),s=null==(s=null==(i=this.Vt)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,n,this.we,e),i=null!=s?s:n;return this.Yt(t,(0,o.Xt)(this.we,i),e),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:n}),i}getExperiment(t,e){var{result:i,details:n}=this.Te.getConfig(t),n=(0,o.re)(t,n,i),s=null==(s=null==(i=this.Vt)?void 0:i.getExperimentOverride)?void 0:s.call(i,n,this.we,e),i=null!=s?s:n;return this.Yt(t,(0,o.Xt)(this.we,i),e),this.$emt({name:"experiment_evaluation",experiment:n}),i}getLayer(e,i){var{result:t,details:n}=this.Te.getLayer(e),n=(0,o.se)(e,n,t),s=null==(s=null==(t=this.Vt)?void 0:t.getLayerOverride)?void 0:s.call(t,n,this.we,i);const r=(0,o.ne)(n,s,null!=(t=null==s?void 0:s.__value)?t:n.__value,t=>{this.Yt(e,(0,o.Qt)(this.we,r,t),i)});return this.$emt({name:"layer_evaluation",layer:r}),r}getParameterStore(t,e){var{result:i,details:n}=this.Te.getParamStore(t);return this.Bt.incrementNonExposureCount(t),{name:t,details:n,__configuration:i,get:(0,l.je)(this,i,e)}}logEvent(t,e,i){this.Bt.enqueue($P($P({},"string"==typeof t?{eventName:t,value:e,metadata:i}:t),{user:this.we,time:Date.now()}))}Ht(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Ae(null)})}Ae(t){this.Te.finalize(),this.Wt("Ready",t)}Me(t,e){this.dataAdapter.getDataAsync(t,e,{priority:"low"}).catch(t=>{o.Log.error("An error occurred after update.",t)})}Ie(t){this.Bt.reset(),this.Te.reset(),this.we=(0,o.A)(t,this.p.environment);t=null==(t=this.we.customIDs)?void 0:t.stableID;t&&o.StableID.setOverride(t,this.S)}}e.default=n},5364:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigEvaluationsDataAdapter=void 0;const n=i(4464),s=i(9400);class o extends n.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this.X=null,this.p=null}attach(t,e){super.attach(t,e),this.X=new s.default(null!=e?e:{})}getDataAsync(t,e,i){return this.M(t,e,i)}prefetchData(t,e){return this.D(t,e)}setData(t){var e=(0,n.C)(t,"has_updates","data");e&&"user"in e?super.setData(t,e.user):n.Log.error("StatsigUser not found")}setDataLegacy(t,e){super.setData(t,e)}N(e,i,n){var s;return r(this,void 0,void 0,function*(){var t=yield null==(s=this.X)?void 0:s.fetchEvaluations(this.P(),e,null==n?void 0:n.priority,i);return null!=t?t:null})}T(t){t=(0,n.u)(this.P(),t,null==(t=this.p)?void 0:t.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this.m}.`+t}R(t,e){return null!=t.fullUserHash&&t.fullUserHash===(0,n.v)(e)}}e.StatsigEvaluationsDataAdapter=o},5208:(t,e,i)=>{$Q(e),e.StatsigClient=void 0;i=i(4520);e.StatsigClient=i.default,__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigClient:i.default}),e.default=__STATSIG__},2152:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.SessionReplay=e.runStatsigSessionReplay=void 0;const s=i(4464),r=i(8264);e.runStatsigSessionReplay=function(t,e){new o(t,e)};class o{constructor(t,e){this.xe=t,this.p=e,this.ke=null,this.De=[];var{sdkKey:e,errorBoundary:t}=t.getContext();this.$t=t,this.$t.wrap(this),(0,s.Mt)()&&((t=(0,s.o)()).srInstances=$P($P({},t.srInstances),{[e]:this})),this.Ee=this.Re(),this.Ne=new r.SessionReplayClient,this.xe.$on("pre_shutdown",()=>this.Ce()),this.xe.$on("values_updated",()=>this.Pe()),this.xe.on("session_expired",()=>{this.Ne.stop(),s.StatsigMetadataProvider.add({isRecordingSession:"false"}),this.Ge("session_expired"),this.Ee=this.Re()}),this.Ue(),this.Pe()}Ue(){const i=this.xe.getContext()["sdkKey"];(0,s.lt)(t=>{var e=null==(e=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.srInstances)?void 0:e[i];e instanceof o&&e.Le(t)})}Le(t){"background"===t&&(this.Ge(),this.xe.flush().catch(t=>{this.$t.logError("SR::visibility",t)}))}Ke(t,e){this.ke=e,this.De.push(t),2048this.Ke(t,e),null!=(t=null==(t=this.p)?void 0:t.rrwebConfig)?t:{}))}Ce(){this.Ne.stop(),s.StatsigMetadataProvider.add({isRecordingSession:"false"}),0!==this.De.length&&null!=this.ke&&this.Fe()}Ge(e){0!==this.De.length&&null!=this.ke&&(e=(0,s.Pt)()?"is_leaving_page":e,this.Ee.then(t=>this.qe(t,e)).catch(t=>{this.$t.logError("SR::flush",t)}))}qe(t,e){var i,n=this.ke;null!==n&&0!==this.De.length&&(i=JSON.stringify(this.De),t={eventName:"statsig::session_recording",value:t,metadata:{session_start_ts:String(n.startTime),session_end_ts:String(n.endTime),clicks_captured_cumulative:String(n.clickCount),rrweb_events:i,session_replay_sdk_version:s.SDK_VERSION}},e&&(t.metadata[e]="true"),this.xe.logEvent(t),this.De=[])}Fe(){this.Ee=this.Re(),this.Ge()}Re(){return n(this,void 0,void 0,function*(){return this.xe.getAsyncContext().then(t=>t.session.data.sessionID)})}}e.SessionReplay=o},8264:(t,e,i)=>{$Q(e),e.SessionReplayClient=void 0;const n=i(8352),s=i(4464);e.SessionReplayClient=class{constructor(){this.ze=null,this.Je=null,this.Ve=0}record(i,t,e){null==(0,s.qt)()||(this.ze=null,this.Je=null,this.Ve=0,this.Be=e,this.$e)||(this.$e=(e=t=>{var e;null==this.ze&&(this.ze=t.timestamp),this.Je=t.timestamp,3!==(e=t).type||2!==e.data.source||2!==e.data.type&&4!==e.data.type||this.Ve++,i(t,{startTime:this.ze,endTime:this.Je,clickCount:this.Ve}),144e5{$Q(e),e.runStatsigSessionReplay=e.SessionReplay=e.SessionReplayClient=void 0;const n=i(2152),s=($Q2(e,"SessionReplay",{enumerable:!0,get:function(){return n.SessionReplay}}),$Q2(e,"runStatsigSessionReplay",{enumerable:!0,get:function(){return n.runStatsigSessionReplay}}),i(8264));$Q2(e,"SessionReplayClient",{enumerable:!0,get:function(){return s.SessionReplayClient}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{SessionReplayClient:s.SessionReplayClient,SessionReplay:n.SessionReplay,runStatsigSessionReplay:n.runStatsigSessionReplay})},5536:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.AutoCapture=e.runStatsigAutoCapture=void 0;const o=i(4464),s=i(3076),r=i(7724);e.runStatsigAutoCapture=function(t){return new u(t)};class u{constructor(t){this.xe=t,this.He=Date.now(),this.We=0;var e,{sdkKey:t,errorBoundary:i}=t.getContext(),i=(this.$t=i,this.$t.wrap(this),(0,o.qt)());(0,o.Mt)()&&((e=null!=(e=(__STATSIG__=(0,o.o)()).acInstances)?e:{})[t]=this,__STATSIG__.acInstances=e),"loading"===(null==i?void 0:i.readyState)?i.addEventListener("DOMContentLoaded",()=>this.Ye()):this.Ye()}Qe(){const e=(0,o.Gt)();var t,i=(0,o.qt)();e&&i&&(t=t=>{this.Xe(t||e.event)},(0,s.Ze)(i,"click",t),(0,s.Ze)(i,"submit",t),(0,s.Ze)(e,"error",t),(0,s.Ze)(e,"beforeunload",()=>this.ti()),(0,s.Ze)(e,"scroll",()=>this.ei()))}Xe(t){var e;let i=null==(e=t.type)?void 0:e.toLowerCase();"error"===i&&t instanceof ErrorEvent?this.ii(t):(e=(0,s.ni)(t))&&(0,s.dt)(t,e)&&("submit"===i&&(i="form_submit"),{value:t,metadata:e}=(0,s.si)(e),this.ri(i,t,e))}Ye(){this.Qe(),this.oi(),this.ui(),this.li()}ii(t){var e=(null==t?void 0:t.error)||{};let i=e;if("object"==typeof e)try{i=JSON.stringify(e)}catch(t){i="function"==typeof(null==e?void 0:e.toString)?e.toString():"Unknown Error"}this.ri("error",t.message,{message:t.message,filename:t.filename,lineno:t.lineno,colno:t.colno,error_str:i})}oi(){this.ai().then(t=>{this.ci(t)&&this.ri("session_start",(0,s.hi)(),{sessionID:t.data.sessionID},{flushImmediately:!0})}).catch(t=>{this.$t.logError("AC::logSession",t)})}ui(){setTimeout(()=>{var t=(0,s.di)(),t=(0,r.vi)(t);this.ri("page_view",(0,s.hi)(),t,{flushImmediately:!0,addNewSessionMetadata:!0})},1)}li(){const i=(0,o.Gt)();void 0!==(null===i||void 0===i?void 0:i.performance)&&"function"==typeof i.performance.getEntriesByType&&"function"==typeof i.performance.getEntriesByName&&setTimeout(()=>{var t={},e=i.performance.getEntriesByType("navigation"),e=(e&&0{var e=$P({sessionID:t.data.sessionID,page_url:null!=(e=null==(e=null==(e=(0,o.Gt)())?void 0:e.location)?void 0:e.href)?e:""},s),t=(null!=r&&r.addNewSessionMetadata&&(e.isNewSession=String(this.ci(t))),{eventName:"auto_capture::"+i,value:n,metadata:e});this.xe.logEvent(t),null!=r&&r.flushImmediately&&this.xe.flush().catch(t=>{o.Log.error(t)})}).catch(t=>{this.$t.logError("AC::enqueue",t)})}ei(){var t=null!=(t=null==(t=(0,o.qt)())?void 0:t.body.scrollHeight)?t:1,e=(0,o.Gt)(),i=null!=(i=null==e?void 0:e.scrollY)?i:1,e=null!=(e=null==e?void 0:e.innerHeight)?e:1;this.We=Math.max(this.We,Math.min(100,Math.round((i+e)/t*100)))}ci(t){return Math.abs(t.data.startTime-Date.now())<1e3}ai(){return n(this,void 0,void 0,function*(){return(yield this.xe.getAsyncContext()).session})}}e.AutoCapture=u},3076:(t,e,i)=>{$Q(e),e.Ze=e.hi=e.di=e.dt=e.ni=e.si=void 0;const r=i(4464);function o(e){if(e){let t=e;for(;t;){var i=t.tagName.toLowerCase();if(["body","document"].includes(i))return null;if("a"===t.tagName.toLowerCase())return t;t=t.parentElement}}return null}e.si=function(t){var e=t.tagName.toLowerCase(),i={},n=(0,r.At)()||"",s=("form"===(i.tagName=e)&&(i.action=t.getAttribute("action"),i.method=null!=(s=t.getAttribute("method"))?s:"GET",i.formName=t.getAttribute("name"),i.formId=t.getAttribute("id")),["input","select","textarea"].includes(e)&&"password"!==t.getAttribute("type")&&(i.content=t.value,i.inputName=t.getAttribute("name")),"button"===e&&(i.content=(t.textContent||"").trim()),o(t));return s&&(i.href=s.getAttribute("href")),{value:n,metadata:i}},e.ni=function(t){if(!t)return null;let e=t.target||t.srcElement;return e&&e instanceof Element?e=3===e.nodeType?e.parentNode||null:e:null},e.dt=function(t,e){if(!t||!e||1!==e.nodeType)return!1;var i=e.tagName.toLowerCase(),n=t.type.toLowerCase();switch(i){case"html":return!1;case"form":return"submit"===n;case"input":case"select":case"textarea":return["change"].includes(n);default:if("click"===n){if("button"===i)return!0;if(o(e))return!0}return!1}},e.di=function(){var t=null!=(t=null==(t=null==(t=(0,r.Gt)())?void 0:t.location)?void 0:t.href)?t:"";let e;try{e=new URL(t)}catch(t){e=new URL("error:")}return e},e.hi=function(){return(0,r.At)()||""},e.Ze=function(t,e,i){t&&t.addEventListener&&t.addEventListener(e,i,!0)}},6824:(t,e,i)=>{$Q(e),e.runStatsigAutoCapture=e.AutoCapture=void 0;const n=i(5536);$Q2(e,"AutoCapture",{enumerable:!0,get:function(){return n.AutoCapture}}),$Q2(e,"runStatsigAutoCapture",{enumerable:!0,get:function(){return n.runStatsigAutoCapture}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{AutoCapture:n.AutoCapture,runStatsigAutoCapture:n.runStatsigAutoCapture}),e.default=__STATSIG__},7724:(t,e,i)=>{$Q(e),e.vi=void 0;const a=i(4464);e.vi=function(t){var e=(0,a.qt)(),i=(0,a.Gt)();if(!e||!i)return{};var n=null==i?void 0:i.navigator,s=(null==e?void 0:e.referrer)||"";let r=new URL("empty:");if(s)try{r=new URL(s||"empty:")}catch(t){}u=r,o=function(t){const e=t.hostname,i=["google","bing","yahoo","duckduckgo","baidu"].find(t=>e.includes(t+"."));return i||""}(u),u=u.searchParams.get("yahoo"===o?"p":"q")||"";var o={searchEngine:o,searchQuery:u},u=function(t){const i=t.searchParams,n={};return["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","gclsrc","dclid","fbclid","msclkid","mc_eid","mc_cid","twclid","li_fat_id","igshid","utm_id","ttc","ttclid","ttc_id"].forEach(t=>{var e=i.get(t);e&&(n[t]=e)}),n}(t);const l={};return t.searchParams.forEach((t,e)=>{l[e]=t}),$P($P($P($P({},o),u),l),{title:(null==e?void 0:e.title)||"",locale:(null==n?void 0:n.language)||"unknown",referrer:s,screen_width:(null==(t=null==i?void 0:i.screen)?void 0:t.width)||"unknown",screen_height:(null==(o=null==i?void 0:i.screen)?void 0:o.height)||"unknown",viewport_width:(null==i?void 0:i.innerWidth)||"unknown",viewport_height:(null==i?void 0:i.innerHeight)||"unknown"})}}},n={};function s(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[t].call(e.exports,e,e.exports,s)),e.exports}s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var t={};{var e=t;const o=s(8392),u=s(6824);var r=s(9920);e.default=__STATSIG__,r.AutoInit.attempt(({client:t})=>{new o.SessionReplay(t),new u.AutoCapture(t)})}return t.default})()); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("rrwebRecord")):"function"==typeof define&&define.amd?define(["rrwebRecord"],e):"object"==typeof exports?exports.Statsig=e(require("rrwebRecord")):t.Statsig=e(t.rrwebRecord)}(this,l=>(()=>{"use strict";var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});var i={8352:t=>{t.exports=l},5496:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.t=i.i=i.o=void 0,i.o=()=>__STATSIG__||u,i.i=t=>(0,i.o)()[t];i.t=t=>{var e=(0,i.o)();return t?e.instances&&e.instances[t]:e.lastInstance};var n,s="__STATSIG__",r="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},o="undefined"!=typeof globalThis?globalThis:{};const u=null!=(n=null!=(n=null!=(n=r[s])?n:e[s])?n:o[s])?n:{instance:i.t};r[s]=u,e[s]=u,o[s]=u},1707:(t,e,i)=>{$Q(e),e.u=e.l=void 0;const s=i(7832);function n(t,e,i){if(i)return i(t,e);const n=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(i=null==e?void 0:e.userID)?i:""),"cids:"+Object.keys(n).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+n[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.l=n,e.u=function(t,e,i){return e?n(t,e,i):(0,s.h)("k:"+t)}},5856:(t,e)=>{$Q(e)},2320:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const l=i(6780),a=i(1604),r=i(6296),o=i(3444),c=i(2412);function h(t,e,i,n){return{source:t,data:e,receivedAt:Date.now(),stableID:i,fullUserHash:(0,r.v)(n)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.m=e,this.p=null,this.S=null,this.O="statsig.last_modified_time."+e,this.j=new n}attach(t,e){this.S=t,this.p=e}getDataSync(t){var e=this.T(t),i=this.j.get(e,t);return i||((i=this.I(e))?(this.j.add(e,i),this.j.get(e,t)):null)}setData(t,e){var e=e&&(0,r.A)(e,null==(e=this.p)?void 0:e.environment),i=this.T(e);this.j.add(i,h("Bootstrap",t,null,e))}__primeInMemoryCache(t){this.j.merge(t)}M(e,i,n){return s(this,void 0,void 0,function*(){var t=null!=e?e:this.getDataSync(i),t=[this.k(t,i,n)];return null!=n&&n.timeoutMs&&t.push(new Promise(t=>setTimeout(t,n.timeoutMs)).then(()=>(l.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}D(i,n){return s(this,void 0,void 0,function*(){var t=this.T(i),e=yield this.M(null,i,n);e&&this.j.add(t,$P($P({},e),{source:"Prefetch"}))})}k(r,o,u){return s(this,void 0,void 0,function*(){let t=null;r&&this.R(r,o)&&(t=r.data);var e=yield this.N(t,o,u);if(!e)return l.Log.debug("No response returned for latest value"),null;var i=(0,c.C)(e,"has_updates","Response"),n=this.P(),n=yield a.StableID.get(n);let s=null;if(!0===(null==i?void 0:i.has_updates))s=h("Network",e,n,o);else{if(!t||!1!==(null==i?void 0:i.has_updates))return null;s=h("NetworkNotModified",t,n,o)}e=this.T(o);return this.j.add(e,s),yield this.G(e,s),s})}P(){return null!=this.S?this.S:(l.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=o.Storage.U)?void 0:e.call(o.Storage,t);return null!=e&&(t=(0,c.C)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}G(t,e){return s(this,void 0,void 0,function*(){yield o.Storage.L(t,JSON.stringify(e)),yield this.K(t)})}K(i){var n;return s(this,void 0,void 0,function*(){var t=null!=(n=yield(0,o.F)(this.O))?n:{},e=(t[i]=Date.now(),u(t,10));e&&(delete t[e],yield o.Storage.q(e)),yield(0,o.J)(this.O,t)})}};class n{constructor(){this.V={}}get(t,e){var t=this.V[t],i=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&i&&e!==i?(l.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var i=u(this.V,9);i&&delete this.V[i],this.V[t]=e}merge(t){this.V=$P($P({},this.V),t)}}function u(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var i=s[t],n=s[e];return"object"==typeof i&&"object"==typeof n?n.receivedAt{$Q(e),e.Diagnostics=void 0;e.Diagnostics=class{static mark(){}}},184:(t,e)=>{$Q(e)},8512:function(t,u,e){var i=this&&this.__awaiter||$A();$Q2(u,"__esModule",{value:!0}),u.ErrorBoundary=u.EXCEPTION_ENDPOINT=void 0;const n=e(6780),l=e(7360),a=e(6972),c=(u.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");u.ErrorBoundary=class{constructor(t,e,i){this.S=t,this.p=e,this.B=i,this.$=new Set}wrap(n){try{const t=n;!function(t){const e=new Set;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;)Object.getOwnPropertyNames(i).filter(t=>"function"==typeof(null===i||void 0===i?void 0:i[t])).forEach(t=>e.add(t)),i=Object.getPrototypeOf(i);return Array.from(e)}(t).forEach(e=>{const i=t[e];"$EB"in i||(t[e]=(...t)=>this.H(e,()=>i.apply(n,t)),t[e].$EB=!0)})}catch(t){this.W("eb:wrap",t)}}logError(t,e){this.W(t,e)}H(e,t){try{var i=t();return i&&i instanceof Promise?i.catch(t=>this.W(e,t)):i}catch(t){return this.W(e,t),null}}W(r,o){try{n.Log.warn("Caught error in "+r,{error:o});i(this,void 0,void 0,function*(){var t,e,i=o||Error(c),n=i instanceof Error,s=n?i.name:"No Name";this.$.has(s)||(this.$.add(s),null!=(t=null==(t=this.p)?void 0:t.networkConfig)&&t.preventAllNetworkTraffic?null!=(t=this.B)&&t.call(this,{name:"error",error:o}):(t=l.SDKType.Y(this.S),e=a.StatsigMetadataProvider.get(),n=n?i.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(i),i=JSON.stringify($P({tag:r,exception:s,info:n},$P($P({},e),{sdkType:t}))),yield(null!=(s=null==(n=null==(s=this.p)?void 0:s.networkConfig)?void 0:n.networkOverrideFunc)?s:fetch)(u.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.S,"STATSIG-SDK-TYPE":String(t),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:i}),null!=(n=this.B)&&n.call(this,{name:"error",error:o})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},500:(t,e)=>{$Q(e)},6788:(t,e)=>{$Q(e)},6728:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=i(7832),r=i(6780),o=i(7716),u=i(6048),l=i(1876),a=i(3444),c=i(84),h=i(100),d={},v=t=>{null!=(t=d[t])&&t.flush().catch(()=>{})};e.EventLogger=class{constructor(e,t,i,n){this.S=e,this.B=t,this.X=i,this.p=n,this.Z=[],this.tt={},this.et={},this.it=!1,this.nt=Date.now(),(d[e]=this).st=!0===(null==n?void 0:n.disableLogging),this.rt=null!=(t=null==n?void 0:n.loggingBufferMaxSize)?t:50;i=null==n?void 0:n.networkConfig;this.ot=(0,c.ut)(null==i?void 0:i.logEventUrl,null==i?void 0:i.api,"/rgstr",o.NetworkDefault.eventsApi),(0,h.lt)(t=>{"background"===t&&v(e)}),this.ct(),this.ht()}setLoggingDisabled(t){this.st=t}enqueue(t){this.dt(t)&&(this.vt(t),this._t(),this.Z.length>this.rt)&&v(this.S)}incrementNonExposureCount(t){var e=null!=(e=this.et[t])?e:0;this.et[t]=e+1}reset(){this.tt={}}shutdown(){return n(this,void 0,void 0,function*(){this.ft&&(clearInterval(this.ft),this.ft=null),yield this.flush()})}flush(){return n(this,void 0,void 0,function*(){var t;if(this.gt(),0!==this.Z.length)return t=this.Z,this.Z=[],this.bt(t)})}_t(){this.it||(this.it=!0,200v(this.S),200)}dt(t){if((0,l.yt)(t)){var e=t.user||{},i=t.metadata||{},t=[t.eventName,e.userID,i.gate,i.config,i.ruleID].join("|"),e=this.tt[t],i=Date.now();if(e&&i-e<6e4)return!1;1e3{r.Log.warn("Unable to save failed logs to storage")})}ct(){const e=this.u();n(this,void 0,void 0,function*(){var t=yield(0,a.F)(e);t&&(yield a.Storage.q(e),yield this.bt(t))}).catch(()=>{r.Log.warn("Failed to flush stored logs")})}u(){return"statsig.failed_logs."+(0,s.h)(this.S)}vt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},i=this.It(),i=(i&&(e.statsigMetadata={currentPage:i}),$P($P({},t),e));r.Log.debug("Enqueued Event:",i),this.Z.push(i)}gt(){0!==Object.keys(this.et).length&&(this.vt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.et)}}),this.et={})}It(){var t;if(!1!==(null==(t=this.p)?void 0:t.includeCurrentPageUrlWithEvents))return(0,u.At)()}ht(){if((0,u.Mt)()){var t=null!=(t=null==(t=this.p)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{d[this.S].ft!==e?clearInterval(e):v(this.S)},t);this.ft=e}}}},7832:(t,e)=>{$Q(e),e.xt=e.h=void 0;e.h=e=>{let i=0;for(let t=0;t>>0)};e.xt=t=>(0,e.h)(JSON.stringify(s(t)));const s=i=>{if(null==i)return null;var t=Object.keys(i).sort();const n={};return t.forEach(t=>{let e=i[t];!Array.isArray(e)&&e instanceof Object&&(e=s(e)),n[t]=e}),n}},9664:(t,e)=>{$Q(e)},6780:(t,e)=>{function i(t){return t.unshift("[Statsig]"),t}var n,s;$Q(e),e.Log=e.LogLevel=void 0,(s=n||(e.LogLevel=n={}))[s.None=0]="None",s[s.Error=1]="Error",s[s.Warn=2]="Warn",s[s.Info=3]="Info",s[s.Debug=4]="Debug";class r{static info(...t){this.level>=n.Info&&console.info(...i(t))}static debug(...t){this.level>=n.Debug&&console.debug(...i(t))}static warn(...t){this.level>=n.Warn&&console.warn(...i(t))}static error(...t){this.level>=n.Error&&console.error(...i(t))}}(e.Log=r).level=n.Error},7716:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=void 0,e.NetworkDefault={eventsApi:"https://prodregistryv2.org/v1",initializeApi:"https://featureassets.org/v1",specsApi:"https://assetsconfigcdn.org/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},3188:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,i(5496);const o=i(5496),f=i(4280),g=i(6780),u=i(7716),l=i(7360),a=i(6048),c=i(8612),h=i(1604),d=i(6972),b=i(100);e.NetworkCore=class{constructor(t,e){this.B=e,this.kt=1e4,this.Dt={},this.p={},t&&(this.p=t),this.p.networkConfig&&(this.Dt=this.p.networkConfig),this.Dt.networkTimeoutMs&&(this.kt=this.Dt.networkTimeoutMs)}post(e){return r(this,void 0,void 0,function*(){let t=yield this.Et(e);return e.isStatsigEncodable&&(t=this.Rt(e,t)),this.Nt($P({method:"POST",body:t},e))})}get(t){return this.Nt($P({method:"GET"},t))}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}beacon(n){return r(this,void 0,void 0,function*(){var t,e,i;return!!y(n)&&(t=yield this.Et(n),e=yield this.Ct(n),(i=navigator).sendBeacon.bind(i)(e,t))})}Nt(d){var v,_;return r(this,void 0,void 0,function*(){if(!y(d))return null;if(this.Dt.preventAllNetworkTraffic)return null;var{method:e,body:i,retries:n}=d;const s="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>null===s||void 0===s?void 0:s.abort(`Timeout of ${this.kt}ms expired.`),this.kt),r=yield this.Ct(d),o=null,u=(0,b.Pt)();try{var l,a,c,h={method:e,body:i,headers:$P({},d.headers),signal:null===s||void 0===s?void 0:s.signal,priority:d.priority,keepalive:u},o=yield(null!=(v=this.Dt.networkOverrideFunc)?v:fetch)(r,h);if(clearTimeout(t),o.ok)return c=yield o.text(),f.Diagnostics.mark(),{body:c,code:o.status};throw l=yield o.text().catch(()=>"No Text"),(a=new Error(`NetworkError: ${r} `+l)).name="NetworkError",a}catch(t){i=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(s,t);return f.Diagnostics.mark(),!n||n<=0?(null!=(_=this.B)&&_.call(this,{name:"error",error:t}),g.Log.error(`A networking error occured during ${e} request to ${r}.`,i,t),null):this.Nt($P($P({},d),{retries:n-1}))}})}Ct(i){return r(this,void 0,void 0,function*(){const e=$P({[u.NetworkParam.SdkKey]:i.sdkKey,[u.NetworkParam.SdkType]:l.SDKType.Y(i.sdkKey),[u.NetworkParam.SdkVersion]:d.SDK_VERSION,[u.NetworkParam.Time]:String(Date.now()),[u.NetworkParam.SessionID]:yield c.SessionID.get(i.sdkKey)},i.params);var t=Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return i.url+(t?"?"+t:"")})}Et(s){return r(this,void 0,void 0,function*(){var{data:t,sdkKey:e}=s,i=yield h.StableID.get(e),n=yield c.SessionID.get(e),e=l.SDKType.Y(e);return JSON.stringify($P($P({},t),{statsigMetadata:$P($P({},d.StatsigMetadataProvider.get()),{stableID:i,sessionID:n,sdkType:e})}))})}Rt(t,e){var i,n,s=(0,a.Gt)();if(!t.isStatsigEncodable||this.p.disableStatsigEncoding||null!=(0,o.i)("no-encode")||null==s||!s.btoa)return e;try{var r=null!=(i=s.btoa(e).split("").reverse().join(""))?i:e;return t.params=$P($P({},null!=(n=t.params)?n:{}),{[u.NetworkParam.StatsigEncoded]:"1"}),r}catch(t){return g.Log.warn("/initialize request encoding failed"),e}}};const y=t=>!!t.sdkKey||(g.Log.warn("Unable to make request without an SDK key"),!1)},4264:(t,e)=>{$Q(e)},5648:(t,e)=>{$Q(e)},7360:(t,e)=>{$Q(e),e.SDKType=void 0;const i={};let n;e.SDKType={Y:t=>{return(null!=(t=i[t])?t:"js-mono")+(null!==n&&void 0!==n?n:"")},Ut(t,e){i[t]=e},Lt(t){n&&"-react"!==n||(n="-"+t)}}},6048:(t,n)=>{$Q2(n,"__esModule",{value:!0}),n.At=n.Kt=n.Ft=n.Mt=n.qt=n.Gt=void 0;n.Gt=()=>"undefined"!=typeof window?window:null,n.qt=()=>{var t=(0,n.Gt)();return null!=(t=null==t?void 0:t.document)?t:null},n.Mt=()=>null!=(0,n.qt)(),n.Ft=(t,e)=>{var i=(0,n.Gt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.Kt=(t,e)=>{var i=(0,n.qt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)};n.At=()=>{var t;try{return null==(t=(0,n.Gt)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},8612:function(t,e,i){var o=this&&this.__awaiter||$A();$Q(e),e.StatsigSession=e.SessionID=void 0;const n=i(1707),u=i(6780),l=i(3444),a=i(3556),c=18e5,h=144e5,d={};function v(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function _(t){return"statsig.session_id."+(0,n.u)(t)}e.SessionID={get:t=>o(void 0,void 0,void 0,function*(){return e.StatsigSession.get(t).then(t=>t.data.sessionID)})},e.StatsigSession={get:r=>o(void 0,void 0,void 0,function*(){null==d[r]&&(d[r]=function(i){return o(this,void 0,void 0,function*(){let t=yield function(t){t=_(t);return(0,l.F)(t)}(i);var e=Date.now();return{data:t=t||{sessionID:(0,a.getUUID)(),startTime:e,lastUpdate:e},sdkKey:i}})}(r));var t=yield d[r],e=Date.now(),i=t.data,n=((function({lastUpdate:t}){return Date.now()-t>c}(i)||function({startTime:t}){return Date.now()-t>h}(i))&&(i.sessionID=(0,a.getUUID)(),i.startTime=e),i.lastUpdate=e,i),s=t.sdkKey;return s=_(s),(0,l.J)(s,n).catch(()=>{u.Log.warn("Failed to save SessionID")}),clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=i.startTime,i=t.sdkKey,t.idleTimeoutID=v(i,c),t.ageTimeoutID=v(i,h-e),t}),overrideInitialSessionID:(t,e)=>{var i;d[e]=(t=t,e=e,i=Date.now(),Promise.resolve({data:{sessionID:t,startTime:i,lastUpdate:i},sdkKey:e}))}}},1604:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StableID=void 0;const s=i(1707),r=i(6780),o=i(3444),u=i(3556),l={};function a(t){return"statsig.stable_id."+(0,s.u)(t)}function c(t,e){e=a(e);(0,o.J)(e,t).catch(()=>{r.Log.warn("Failed to save StableID")})}e.StableID={get:e=>n(void 0,void 0,void 0,function*(){return null==l[e]&&(l[e]=function(t){t=a(t);return(0,o.F)(t)}(e).then(t=>{return null!=t||c(t=(0,u.getUUID)(),e),t})),l[e]}),setOverride:(t,e)=>{l[e]=Promise.resolve(t),c(t,e)}}},7688:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,i(5496);const o=i(5496),u=i(8512),l=i(6728),a=i(6780),c=i(6048),h=i(8612),d=i(3444);e.StatsigClientBase=class{constructor(t,e,i,n){this.loadingStatus="Uninitialized",this.zt={};var s,r=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(a.Log.level=n.logLevel),null!=n&&n.disableStorage&&d.Storage.Jt(!0),null!=n&&n.initialSessionID&&h.StatsigSession.overrideInitialSessionID(n.initialSessionID,t),this.S=t,this.p=null!=n?n:{},this.Vt=null!=(s=null==n?void 0:n.overrideAdapter)?s:null,this.Bt=new l.EventLogger(t,r,i,n),this.$t=new u.ErrorBoundary(t,n,r),this.$t.wrap(this),this.$t.wrap(i),this.$t.wrap(e),this.$t.wrap(this.Bt),(0,c.Mt)()&&(null!=(i=null!=(r=(s=(0,o.o)()).instances)?r:{})[t]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),i[t]=this,s.lastInstance=this,s.instances=i,__STATSIG__=s),this.dataAdapter=e,this.dataAdapter.attach(t,n),this.Ht()}updateRuntimeOptions(t){null!=t.disableLogging&&(this.p.disableLogging=t.disableLogging,this.Bt.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.p.disableStorage=t.disableStorage,d.Storage.Jt(t.disableStorage))}flush(){return this.Bt.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),yield this.Bt.shutdown()})}on(t,e){this.zt[t]||(this.zt[t]=[]),this.zt[t].push(e)}off(t,e){this.zt[t]&&-1!==(e=this.zt[t].indexOf(e))&&this.zt[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(i){var t;const e=e=>{try{e(i)}catch(t){!0===e.__isInternal?this.$t.logError("__emit:"+i.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",i)}};this.zt[i.name]&&this.zt[i.name].forEach(t=>e(t)),null!=(t=this.zt["*"])&&t.forEach(e)}Wt(t,e){this.loadingStatus=t,this.$emt({name:"values_updated",status:t,values:e})}Yt(t,e,i){!0===(null==i?void 0:i.disableExposureLog)?this.Bt.incrementNonExposureCount(t):this.Bt.enqueue(e)}}},5808:(t,e)=>{$Q(e)},6283:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},1876:(t,e)=>{$Q(e),e.Qt=e.Xt=e.Zt=e.yt=void 0;const i="statsig::config_exposure",n="statsig::gate_exposure",l=(t,e,i,n,s)=>({eventName:t,user:e,value:null,metadata:r(i,n),secondaryExposures:s,time:Date.now()});e.yt=({eventName:t})=>t===n||t===i,e.Zt=(t,e)=>{return l(n,t,e.details,{gate:e.name,gateValue:String(e.value),ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])},e.Xt=(t,e)=>{return l(i,t,e.details,{config:e.name,ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])};e.Qt=(t,e,i)=>{var n,s=e.__evaluation,r=!0===(null==(r=null==s?void 0:s.explicit_parameters)?void 0:r.includes(i));let o="",u=null!=(n=null==s?void 0:s.undelegated_secondary_exposures)?n:[];return r&&(o=null!=(n=s.allocated_experiment_name)?n:"",u=s.secondary_exposures),l("statsig::layer_exposure",t,e.details,{config:e.name,parameterName:i,ruleID:e.ruleID,allocatedExperiment:o,isExplicitParameter:String(r)},u)};const r=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},6972:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="1.3.0";let i={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>i,add:t=>{i=$P($P({},i),t)}}},3384:(t,e)=>{$Q(e)},6396:(t,e)=>{$Q(e),e.te=e.ee=e.ie=e.ne=e.se=e.re=e.oe=e.ue=void 0;const s="default";function r(t,e,i,n){return{name:t,details:e,ruleID:null!=(t=null==i?void 0:i.rule_id)?t:s,__evaluation:i,value:n}}function n(t,e,i){var n=null!=(n=null==i?void 0:i.value)?n:{};return $P($P({},r(t,e,i,n)),{get:u(null==i?void 0:i.value)})}function o(t,e){var i=t=>Array.isArray(t)?"array":typeof t;return i(t)===i(e)}function u(n,s){return(t,e)=>{var i=null!=(i=null==n?void 0:n[t])?i:null;return null!=i&&(null==e||o(i,e))?(null!=s&&s(t),i):null!=e?e:null}}e.ue=function(t,e,i){return r(t,e,i,!0===(null==i?void 0:i.value))},e.oe=n,e.re=function(t,e,i){return t=n(t,e,i),$P($P({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.se=function(t,e,i,n){return $P($P({},r(t,e,i,void 0)),{get:u(null==i?void 0:i.value,n),groupName:null!=(t=null==i?void 0:i.group_name)?t:null,__value:null!=(e=null==i?void 0:i.value)?e:{}})},e.ne=function(t,e,i,n){return $P($P($P({},t),e),{get:u(i,n)})},e.ie=function(t){return Array.isArray(t)?"array":typeof t},e.ee=o,e.te=u},9136:(t,e)=>{$Q(e)},6296:(t,e,i)=>{$Q(e),e.v=e.A=void 0;const n=i(7832),s=i(6780);e.A=function(t,e){try{var i=JSON.parse(JSON.stringify(t));return null!=e&&(i.statsigEnvironment=e),i}catch(t){return s.Log.error("Failed to JSON.stringify user"),{}}},e.v=function(t){return t?(0,n.xt)(t):null}},3444:function(t,i,e){var n=this&&this.__awaiter||$A(),s=($Q2(i,"__esModule",{value:!0}),i.J=i.F=i.Storage=void 0,e(6780)),e=e(6048);const r={},o=t=>Promise.resolve(t),u={le:()=>"InMemory",U:t=>r[t]||null,ae:t=>o(r[t]||null),L:(t,e)=>(r[t]=e,o()),q:t=>(delete r[t],o()),ce:()=>o(Object.keys(r))};let l=null;try{const d=(0,e.Gt)();d&&d.localStorage&&"function"==typeof d.localStorage.getItem&&(l={le:()=>"LocalStorage",U:t=>d.localStorage.getItem(t),ae:t=>o(d.localStorage.getItem(t)),L:(t,e)=>(d.localStorage.setItem(t,e),o()),q:t=>(d.localStorage.removeItem(t),o()),ce:()=>o(Object.keys(d.localStorage))})}catch(t){s.Log.warn("Failed to setup localStorageProvider.")}let a=null!==l&&void 0!==l?l:u,c=a;function h(t){try{return t()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return i.Storage.he(u),null;throw t}}i.Storage={le:()=>c.le(),ae:t=>n(void 0,void 0,void 0,function*(){return h(()=>c.ae(t))}),U:t=>h(()=>c.U?c.U(t):null),L:(t,e)=>c.L(t,e),q:t=>c.q(t),ce:()=>c.ce(),he:t=>{a=t,c=t},Jt:t=>{c=t?u:a}},i.F=function(e){return n(this,void 0,void 0,function*(){var t=yield i.Storage.ae(e);return JSON.parse(null!=t?t:"null")})},i.J=function(t,e){return n(this,void 0,void 0,function*(){yield i.Storage.L(t,JSON.stringify(e))})}},2412:(t,e,i)=>{$Q(e),e.C=void 0;const s=i(6780);e.C=function(t,e,i){try{var n=JSON.parse(t);return"object"==typeof n&&0 in n,n}catch(t){}return s.Log.error("Failed to parse "+i),null}},3556:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let i=(new Date).getTime(),n="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0{$Q(e),e.ut=void 0,e.ut=function(t,e,i,n){return t||(e?""+e+i:""+n+i)}},1539:(t,e)=>{$Q(e)},100:(t,e,i)=>{$Q(e),e.de=e.lt=e.Pt=e.Ot=void 0;i=i(6048);const n="foreground",s="background",r=[];let o=n,u=!1;e.Ot=()=>o===n,e.Pt=()=>u,e.lt=t=>{r.unshift(t)};e.de=e=>{e!==o&&(o=e,r.forEach(t=>t(e)))},(0,i.Ft)("focus",()=>{(u=!1,e.de)(n)}),(0,i.Ft)("blur",()=>(0,e.de)(s)),(0,i.Ft)("beforeunload",()=>{u=!0,(0,e.de)(s)}),(0,i.Kt)("visibilitychange",()=>{(0,e.de)("visible"===document.visibilityState?n:s)})},4464:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};$Q(e),e.Log=e.Storage=e.EventLogger=void 0,i(5496);const r=i(6728),o=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return r.EventLogger}}),i(6780));$Q2(e,"Log",{enumerable:!0,get:function(){return o.Log}});var u=i(6972);const l=i(3444);$Q2(e,"Storage",{enumerable:!0,get:function(){return l.Storage}}),s(i(5496),e),s(i(1707),e),s(i(5856),e),s(i(2320),e),s(i(184),e),s(i(8512),e),s(i(500),e),s(i(6788),e),s(i(7832),e),s(i(9664),e),s(i(6780),e),s(i(3188),e),s(i(7716),e),s(i(4264),e),s(i(5648),e),s(i(6048),e),s(i(7360),e),s(i(8612),e),s(i(1604),e),s(i(7688),e),s(i(5808),e),s(i(6283),e),s(i(1876),e),s(i(6972),e),s(i(3384),e),s(i(6396),e),s(i(9136),e),s(i(6296),e),s(i(3444),e),s(i(2412),e),s(i(84),e),s(i(1539),e),s(i(3556),e),s(i(100),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:o.Log,SDK_VERSION:u.SDK_VERSION})},9920:(t,e,i)=>{$Q(e),e.AutoInit=void 0;const h=i(4464),d=i(5208);function v(t,e){var i;return null!=(i=e.get(t))?i:e.get(t.toLowerCase())}e.AutoInit=class{static attempt(e){var t,i,n;try{var s=(0,h.Gt)(),r=(0,h.qt)();if(s&&r&&r.currentScript){var o=r.currentScript.getAttribute("src"),u=null==(t=s.location)?void 0:t.href;if(o&&u){var l=new URL(o,u).searchParams,a=null!=(i=v("sdkKey",l))?i:v("apiKey",l);if(a){var c=null==(n=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instances)?void 0:n[a];let t=null;(t=c instanceof d.StatsigClient?c:t)||(t=new d.StatsigClient(a,function(){var t=(0,h.Gt)();if(!t)return{};let e=t.statsigUser||{};var i=(e="object"!=typeof e?{}:e).custom||{},n=e.customIDs||{};return $P($P({},e),{customIDs:$P({},n),custom:$P($P({},i),{useragent:t.navigator.userAgent,page_url:(0,h.At)()||"",language:null==(n=t.navigator)?void 0:n.language})})}())).initializeAsync().catch(t=>{h.Log.error(t)}),e({sdkKey:a,client:t})}}}}catch(t){h.Log.error("AutoInit failed",t)}}}},3096:(t,e,i)=>{$Q(e),e.ve=void 0;const n=i(4464);function s(t,e){null!=t&&t.forEach(t=>{delete e[t]})}e.ve=function(t,e){var i;return(e=(0,n.C)(e,"checksum","DeltasEvaluationResponse"))?(t=t,i=e,t=$P($P($P({},t),i),{feature_gates:$P($P({},t.feature_gates),i.feature_gates),layer_configs:$P($P({},t.layer_configs),i.layer_configs),dynamic_configs:$P($P({},t.dynamic_configs),i.dynamic_configs)}),s((t=i=t).deleted_gates,t.feature_gates),delete t.deleted_gates,s(i.deleted_configs,t.dynamic_configs),delete t.deleted_configs,s(i.deleted_layers,t.layer_configs),delete t.deleted_layers,i=t,(t=(0,n.xt)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs}))===e.checksum?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:t,badMergedConfigs:i,badFullResponse:e.deltas_full_response}):{hadBadDeltaChecksum:!0}}},1536:(t,e,i)=>{$Q(e);const n=i(4464);e.default=class{constructor(){this._e=null,this.fe=null,this.ge="Uninitialized",this.be=0,this.ye=0}reset(){this.fe=null,this._e=null,this.ge="Loading",this.be=0,this.ye=0}finalize(){this.fe||(this.ge="NoValues")}getValues(){return this._e?(0,n.C)(this._e,"has_updates","EvaluationStoreValues"):null}setValues(t){var e;t&&!0===(null==(e=(0,n.C)(t.data,"has_updates","EvaluationResponse"))?void 0:e.has_updates)&&(this._e=t.data,this.be=e.time,this.ye=t.receivedAt,this.ge=t.source,this.fe=e)}getGate(t){var e;return this.me(null==(e=this.fe)?void 0:e.feature_gates,t)}getConfig(t){var e;return this.me(null==(e=this.fe)?void 0:e.dynamic_configs,t)}getLayer(t){var e;return this.me(null==(e=this.fe)?void 0:e.layer_configs,t)}getParamStore(t){var e;return this.me(null==(e=this.fe)?void 0:e.param_stores,t)}me(t,e){let i=null;return{result:i=t?t[e]||t[(0,n.h)(e)]:i,details:this.pe(null==i)}}pe(t){return"Uninitialized"===this.ge||"NoValues"===this.ge?{reason:this.ge}:{reason:this.ge+":"+(t?"Unrecognized":"Recognized"),lcut:this.be,receivedAt:this.ye}}}},9400:function(t,e,i){var o=this&&this.__awaiter||$A();$Q(e);const u=i(4464),l=i(3096);class n extends u.NetworkCore{constructor(t,e){super(t,e);e=null==t?void 0:t.networkConfig;this.Se=(0,u.ut)(null==e?void 0:e.initializeUrl,null==e?void 0:e.api,"/initialize",u.NetworkDefault.initializeApi)}fetchEvaluations(i,n,s,r){return o(this,void 0,void 0,function*(){var t=n?(0,u.C)(n,"has_updates","InitializeResponse"):null;let e={user:r,hash:"djb2",deltasResponseRequested:!1};return null!=t&&t.has_updates&&(e=$P($P({},e),{sinceTime:t.time,previousDerivedFields:"derived_fields"in t?t.derived_fields:{},deltasResponseRequested:!0})),this.Oe(i,t,e,s)})}Oe(e,i,n,s){var r;return o(this,void 0,void 0,function*(){var t=yield this.post({sdkKey:e,url:this.Se,data:n,retries:2,isStatsigEncodable:!0,priority:s});return 204===(null==t?void 0:t.code)?'{"has_updates": false}':200!==(null==t?void 0:t.code)?null!=(r=null==t?void 0:t.body)?r:null:!0!==(null==i?void 0:i.has_updates)||!0!==(null==(r=t.body)?void 0:r.includes('"is_delta":true'))?t.body:"string"==typeof(t=(0,l.ve)(i,t.body))?t:this.Oe(e,i,$P($P($P({},n),t),{deltasResponseRequested:!1}),s)})}}e.default=n},9340:(t,e,i)=>{$Q(e),e.je=void 0;const g=i(4464),b={disableExposureLog:!0};function y(t){return null==t||!1===t.disableExposureLog}function m(t,e){return null!=e&&!(0,g.ee)(t,e)}e.je=function(v,_,f){return(t,e)=>{if(null==_)return e;var i,n,s,r,o,u,l,a,c,h,d=_[t];if(null==d||null!=e&&(0,g.ie)(e)!==d.param_type)return e;switch(d.ref_type){case"static":return d.value;case"gate":return h=d,v.getFeatureGate(h.gate_name,y(f)?void 0:b).value?h.pass_value:h.fail_value;case"dynamic_config":return h=d,l=e,a=f,m(c=(u=v).getDynamicConfig(h.config_name,b).get(h.param_name),l)?l:(y(a)&&u.getDynamicConfig(h.config_name),c);case"experiment":return l=d,a=e,u=f,m(o=(c=v).getExperiment(l.experiment_name,b).get(l.param_name),a)?a:(y(u)&&c.getExperiment(l.experiment_name),o);case"layer":return o=d,n=e,s=f,m(r=(i=v).getLayer(o.layer_name,b).get(o.param_name),n)?n:(y(s)&&i.getLayer(o.layer_name).get(o.param_name),r);default:return e}}}},4520:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e);const o=i(4464),r=i(1536),u=i(9400),l=i(9340),a=i(5364);class n extends o.StatsigClientBase{static instance(t){var e=(0,o.o)().instance(t);return e instanceof n?e:(o.Log.warn((0,o.Mt)()?"Unable to find StatsigClient instance":"StatsigClient.instance is not supported in server environments"),new n(null!=t?t:"",{}))}constructor(t,e,i=null){o.SDKType.Ut(t,"javascript-client");var n=new u.default(i,t=>{this.$emt(t)});super(t,null!=(t=null==i?void 0:i.dataAdapter)?t:new a.StatsigEvaluationsDataAdapter,n,i),this.Te=new r.default,this.we=e}initializeSync(){this.updateUserSync(this.we)}initializeAsync(t){return this.updateUserAsync(this.we,t)}updateUserSync(t){this.Ie(t);t=this.dataAdapter.getDataSync(this.we);this.Te.setValues(t),this.Ae(t),this.Me(null!=t?t:null,this.we)}updateUserAsync(i,n){return s(this,void 0,void 0,function*(){this.Ie(i);var t=this.we,e=this.dataAdapter.getDataSync(t);this.Wt("Loading",e),this.Te.setValues(e),e=yield this.dataAdapter.getDataAsync(e,t,n),t===this.we&&(this.Te.setValues(e),this.Ae(e))})}getContext(){return{sdkKey:this.S,options:this.p,values:this.Te.getValues(),user:JSON.parse(JSON.stringify(this.we)),errorBoundary:this.$t}}getAsyncContext(){return s(this,void 0,void 0,function*(){return $P($P({},this.getContext()),{session:yield o.StatsigSession.get(this.S),stableID:yield o.StableID.get(this.S)})})}checkGate(t,e){return this.getFeatureGate(t,e).value}getFeatureGate(t,e){var{result:i,details:n}=this.Te.getGate(t),n=(0,o.ue)(t,n,i),s=null==(s=null==(i=this.Vt)?void 0:i.getGateOverride)?void 0:s.call(i,n,this.we,e),i=null!=s?s:n;return this.Yt(t,(0,o.Zt)(this.we,i),e),this.$emt({name:"gate_evaluation",gate:i}),i}getDynamicConfig(t,e){var{result:i,details:n}=this.Te.getConfig(t),n=(0,o.oe)(t,n,i),s=null==(s=null==(i=this.Vt)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,n,this.we,e),i=null!=s?s:n;return this.Yt(t,(0,o.Xt)(this.we,i),e),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}getExperiment(t,e){var{result:i,details:n}=this.Te.getConfig(t),n=(0,o.re)(t,n,i),s=null==(s=null==(i=this.Vt)?void 0:i.getExperimentOverride)?void 0:s.call(i,n,this.we,e),i=null!=s?s:n;return this.Yt(t,(0,o.Xt)(this.we,i),e),this.$emt({name:"experiment_evaluation",experiment:i}),i}getLayer(e,i){var{result:t,details:n}=this.Te.getLayer(e),n=(0,o.se)(e,n,t),s=null==(s=null==(t=this.Vt)?void 0:t.getLayerOverride)?void 0:s.call(t,n,this.we,i);const r=(0,o.ne)(n,s,null!=(t=null==s?void 0:s.__value)?t:n.__value,t=>{this.Yt(e,(0,o.Qt)(this.we,r,t),i)});return this.$emt({name:"layer_evaluation",layer:r}),r}getParameterStore(t,e){var{result:i,details:n}=this.Te.getParamStore(t);return this.Bt.incrementNonExposureCount(t),{name:t,details:n,__configuration:i,get:(0,l.je)(this,i,e)}}logEvent(t,e,i){this.Bt.enqueue($P($P({},"string"==typeof t?{eventName:t,value:e,metadata:i}:t),{user:this.we,time:Date.now()}))}Ht(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Ae(null)})}Ae(t){this.Te.finalize(),this.Wt("Ready",t)}Me(t,e){this.dataAdapter.getDataAsync(t,e,{priority:"low"}).catch(t=>{o.Log.error("An error occurred after update.",t)})}Ie(t){this.Bt.reset(),this.Te.reset(),this.we=(0,o.A)(t,this.p.environment);t=null==(t=this.we.customIDs)?void 0:t.stableID;t&&o.StableID.setOverride(t,this.S)}}e.default=n},5364:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigEvaluationsDataAdapter=void 0;const n=i(4464),s=i(9400);class o extends n.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this.X=null,this.p=null}attach(t,e){super.attach(t,e),this.X=new s.default(null!=e?e:{})}getDataAsync(t,e,i){return this.M(t,e,i)}prefetchData(t,e){return this.D(t,e)}setData(t){var e=(0,n.C)(t,"has_updates","data");e&&"user"in e?super.setData(t,e.user):n.Log.error("StatsigUser not found")}setDataLegacy(t,e){super.setData(t,e)}N(e,i,n){var s;return r(this,void 0,void 0,function*(){var t=yield null==(s=this.X)?void 0:s.fetchEvaluations(this.P(),e,null==n?void 0:n.priority,i);return null!=t?t:null})}T(t){t=(0,n.u)(this.P(),t,null==(t=this.p)?void 0:t.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this.m}.`+t}R(t,e){return null!=t.fullUserHash&&t.fullUserHash===(0,n.v)(e)}}e.StatsigEvaluationsDataAdapter=o},5208:(t,e,i)=>{$Q(e),e.StatsigClient=void 0;i=i(4520);e.StatsigClient=i.default,__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigClient:i.default}),e.default=__STATSIG__},2152:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.SessionReplay=e.runStatsigSessionReplay=void 0;const s=i(4464),r=i(8264);e.runStatsigSessionReplay=function(t,e){new o(t,e)};class o{constructor(t,e){this.xe=t,this.p=e,this.ke=null,this.De=[];var{sdkKey:e,errorBoundary:t}=t.getContext();this.$t=t,this.$t.wrap(this),(0,s.Mt)()&&((t=(0,s.o)()).srInstances=$P($P({},t.srInstances),{[e]:this})),this.Ee=this.Re(),this.Ne=new r.SessionReplayClient,this.xe.$on("pre_shutdown",()=>this.Ce()),this.xe.$on("values_updated",()=>this.Pe()),this.xe.on("session_expired",()=>{this.Ne.stop(),s.StatsigMetadataProvider.add({isRecordingSession:"false"}),this.Ge("session_expired"),this.Ee=this.Re()}),this.Ue(),this.Pe()}Ue(){const i=this.xe.getContext()["sdkKey"];(0,s.lt)(t=>{var e=null==(e=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.srInstances)?void 0:e[i];e instanceof o&&e.Le(t)})}Le(t){"background"===t&&(this.Ge(),this.xe.flush().catch(t=>{this.$t.logError("SR::visibility",t)}))}Ke(t,e){this.ke=e,this.De.push(t),2048this.Ke(t,e),null!=(t=null==(t=this.p)?void 0:t.rrwebConfig)?t:{}))}Ce(){this.Ne.stop(),s.StatsigMetadataProvider.add({isRecordingSession:"false"}),0!==this.De.length&&null!=this.ke&&this.Fe()}Ge(e){0!==this.De.length&&null!=this.ke&&(e=(0,s.Pt)()?"is_leaving_page":e,this.Ee.then(t=>this.qe(t,e)).catch(t=>{this.$t.logError("SR::flush",t)}))}qe(t,e){var i,n=this.ke;null!==n&&0!==this.De.length&&(i=JSON.stringify(this.De),t={eventName:"statsig::session_recording",value:t,metadata:{session_start_ts:String(n.startTime),session_end_ts:String(n.endTime),clicks_captured_cumulative:String(n.clickCount),rrweb_events:i,session_replay_sdk_version:s.SDK_VERSION}},e&&(t.metadata[e]="true"),this.xe.logEvent(t),this.De=[])}Fe(){this.Ee=this.Re(),this.Ge()}Re(){return n(this,void 0,void 0,function*(){return this.xe.getAsyncContext().then(t=>t.session.data.sessionID)})}}e.SessionReplay=o},8264:(t,e,i)=>{$Q(e),e.SessionReplayClient=void 0;const n=i(8352),s=i(4464);e.SessionReplayClient=class{constructor(){this.ze=null,this.Je=null,this.Ve=0}record(i,t,e){null==(0,s.qt)()||(this.ze=null,this.Je=null,this.Ve=0,this.Be=e,this.$e)||(this.$e=(e=t=>{var e;null==this.ze&&(this.ze=t.timestamp),this.Je=t.timestamp,3!==(e=t).type||2!==e.data.source||2!==e.data.type&&4!==e.data.type||this.Ve++,i(t,{startTime:this.ze,endTime:this.Je,clickCount:this.Ve}),144e5{$Q(e),e.runStatsigSessionReplay=e.SessionReplay=e.SessionReplayClient=void 0;const n=i(2152),s=($Q2(e,"SessionReplay",{enumerable:!0,get:function(){return n.SessionReplay}}),$Q2(e,"runStatsigSessionReplay",{enumerable:!0,get:function(){return n.runStatsigSessionReplay}}),i(8264));$Q2(e,"SessionReplayClient",{enumerable:!0,get:function(){return s.SessionReplayClient}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{SessionReplayClient:s.SessionReplayClient,SessionReplay:n.SessionReplay,runStatsigSessionReplay:n.runStatsigSessionReplay})},5536:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.AutoCapture=e.runStatsigAutoCapture=void 0;const o=i(4464),s=i(3076),r=i(7724);e.runStatsigAutoCapture=function(t){return new u(t)};class u{constructor(t){this.xe=t,this.He=Date.now(),this.We=0;var e,{sdkKey:t,errorBoundary:i}=t.getContext(),i=(this.$t=i,this.$t.wrap(this),(0,o.qt)());(0,o.Mt)()&&((e=null!=(e=(__STATSIG__=(0,o.o)()).acInstances)?e:{})[t]=this,__STATSIG__.acInstances=e),"loading"===(null==i?void 0:i.readyState)?i.addEventListener("DOMContentLoaded",()=>this.Ye()):this.Ye()}Qe(){const e=(0,o.Gt)();var t,i=(0,o.qt)();e&&i&&(t=t=>{this.Xe(t||e.event)},(0,s.Ze)(i,"click",t),(0,s.Ze)(i,"submit",t),(0,s.Ze)(e,"error",t),(0,s.Ze)(e,"beforeunload",()=>this.ti()),(0,s.Ze)(e,"scroll",()=>this.ei()))}Xe(t){var e;let i=null==(e=t.type)?void 0:e.toLowerCase();"error"===i&&t instanceof ErrorEvent?this.ii(t):(e=(0,s.ni)(t))&&(0,s.dt)(t,e)&&("submit"===i&&(i="form_submit"),{value:t,metadata:e}=(0,s.si)(e),this.ri(i,t,e))}Ye(){this.Qe(),this.oi(),this.ui(),this.li()}ii(t){var e=(null==t?void 0:t.error)||{};let i=e;if("object"==typeof e)try{i=JSON.stringify(e)}catch(t){i="function"==typeof(null==e?void 0:e.toString)?e.toString():"Unknown Error"}this.ri("error",t.message,{message:t.message,filename:t.filename,lineno:t.lineno,colno:t.colno,error_str:i})}oi(){this.ai().then(t=>{this.ci(t)&&this.ri("session_start",(0,s.hi)(),{sessionID:t.data.sessionID},{flushImmediately:!0})}).catch(t=>{this.$t.logError("AC::logSession",t)})}ui(){setTimeout(()=>{var t=(0,s.di)(),t=(0,r.vi)(t);this.ri("page_view",(0,s.hi)(),t,{flushImmediately:!0,addNewSessionMetadata:!0})},1)}li(){const i=(0,o.Gt)();void 0!==(null===i||void 0===i?void 0:i.performance)&&"function"==typeof i.performance.getEntriesByType&&"function"==typeof i.performance.getEntriesByName&&setTimeout(()=>{var t={},e=i.performance.getEntriesByType("navigation"),e=(e&&0{var e=$P({sessionID:t.data.sessionID,page_url:null!=(e=null==(e=null==(e=(0,o.Gt)())?void 0:e.location)?void 0:e.href)?e:""},s),t=(null!=r&&r.addNewSessionMetadata&&(e.isNewSession=String(this.ci(t))),{eventName:"auto_capture::"+i,value:n,metadata:e});this.xe.logEvent(t),null!=r&&r.flushImmediately&&this.xe.flush().catch(t=>{o.Log.error(t)})}).catch(t=>{this.$t.logError("AC::enqueue",t)})}ei(){var t=null!=(t=null==(t=(0,o.qt)())?void 0:t.body.scrollHeight)?t:1,e=(0,o.Gt)(),i=null!=(i=null==e?void 0:e.scrollY)?i:1,e=null!=(e=null==e?void 0:e.innerHeight)?e:1;this.We=Math.max(this.We,Math.min(100,Math.round((i+e)/t*100)))}ci(t){return Math.abs(t.data.startTime-Date.now())<1e3}ai(){return n(this,void 0,void 0,function*(){return(yield this.xe.getAsyncContext()).session})}}e.AutoCapture=u},3076:(t,e,i)=>{$Q(e),e.Ze=e.hi=e.di=e.dt=e.ni=e.si=void 0;const r=i(4464);function o(e){if(e){let t=e;for(;t;){var i=t.tagName.toLowerCase();if(["body","document"].includes(i))return null;if("a"===t.tagName.toLowerCase())return t;t=t.parentElement}}return null}e.si=function(t){var e=t.tagName.toLowerCase(),i={},n=(0,r.At)()||"",s=("form"===(i.tagName=e)&&(i.action=t.getAttribute("action"),i.method=null!=(s=t.getAttribute("method"))?s:"GET",i.formName=t.getAttribute("name"),i.formId=t.getAttribute("id")),["input","select","textarea"].includes(e)&&"password"!==t.getAttribute("type")&&(i.content=t.value,i.inputName=t.getAttribute("name")),o(t));return s&&(i.href=s.getAttribute("href")),"button"!==e&&!s||(i.content=(t.textContent||"").trim()),{value:n,metadata:i}},e.ni=function(t){if(!t)return null;let e=t.target||t.srcElement;return e&&e instanceof Element?e=3===e.nodeType?e.parentNode||null:e:null},e.dt=function(t,e){if(!t||!e||1!==e.nodeType)return!1;var i=e.tagName.toLowerCase(),n=t.type.toLowerCase();switch(i){case"html":return!1;case"form":return"submit"===n;case"input":case"select":case"textarea":return["change"].includes(n);default:if("click"===n){if("button"===i)return!0;if(o(e))return!0}return!1}},e.di=function(){var t=null!=(t=null==(t=null==(t=(0,r.Gt)())?void 0:t.location)?void 0:t.href)?t:"";let e;try{e=new URL(t)}catch(t){e=new URL("error:")}return e},e.hi=function(){return(0,r.At)()||""},e.Ze=function(t,e,i){t&&t.addEventListener&&t.addEventListener(e,i,!0)}},6824:(t,e,i)=>{$Q(e),e.runStatsigAutoCapture=e.AutoCapture=void 0;const n=i(5536);$Q2(e,"AutoCapture",{enumerable:!0,get:function(){return n.AutoCapture}}),$Q2(e,"runStatsigAutoCapture",{enumerable:!0,get:function(){return n.runStatsigAutoCapture}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{AutoCapture:n.AutoCapture,runStatsigAutoCapture:n.runStatsigAutoCapture}),e.default=__STATSIG__},7724:(t,e,i)=>{$Q(e),e.vi=void 0;const a=i(4464);e.vi=function(t){var e=(0,a.qt)(),i=(0,a.Gt)();if(!e||!i)return{};var n=null==i?void 0:i.navigator,s=(null==e?void 0:e.referrer)||"";let r=new URL("empty:");if(s)try{r=new URL(s||"empty:")}catch(t){}u=r,o=function(t){const e=t.hostname,i=["google","bing","yahoo","duckduckgo","baidu"].find(t=>e.includes(t+"."));return i||""}(u),u=u.searchParams.get("yahoo"===o?"p":"q")||"";var o={searchEngine:o,searchQuery:u},u=function(t){const i=t.searchParams,n={};return["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","gclsrc","dclid","fbclid","msclkid","mc_eid","mc_cid","twclid","li_fat_id","igshid","utm_id","ttc","ttclid","ttc_id"].forEach(t=>{var e=i.get(t);e&&(n[t]=e)}),n}(t);const l={};return t.searchParams.forEach((t,e)=>{l[e]=t}),$P($P($P($P({},o),u),l),{title:(null==e?void 0:e.title)||"",locale:(null==n?void 0:n.language)||"unknown",referrer:s,screen_width:(null==(t=null==i?void 0:i.screen)?void 0:t.width)||"unknown",screen_height:(null==(o=null==i?void 0:i.screen)?void 0:o.height)||"unknown",viewport_width:(null==i?void 0:i.innerWidth)||"unknown",viewport_height:(null==i?void 0:i.innerHeight)||"unknown"})}}},n={};function s(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[t].call(e.exports,e,e.exports,s)),e.exports}s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var t={};{var e=t;const o=s(8392),u=s(6824);var r=s(9920);e.default=__STATSIG__,r.AutoInit.attempt(({client:t})=>{new o.SessionReplay(t),new u.AutoCapture(t)})}return t.default})()); \ No newline at end of file diff --git a/samples/web-minified/src/assets/statsig-js-client.min.js b/samples/web-minified/src/assets/statsig-js-client.min.js index 3c99314b..60d100d5 100644 --- a/samples/web-minified/src/assets/statsig-js-client.min.js +++ b/samples/web-minified/src/assets/statsig-js-client.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Statsig=e():t.Statsig=e()}(this,()=>(()=>{"use strict";var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});var n={496:(t,n,e)=>{$Q2(n,"__esModule",{value:!0}),n.t=n.i=n.o=void 0,n.o=()=>__STATSIG__||u,n.i=t=>(0,n.o)()[t];n.t=t=>{var e=(0,n.o)();return t?e.instances&&e.instances[t]:e.lastInstance};var i,s="__STATSIG__",r="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},o="undefined"!=typeof globalThis?globalThis:{};const u=null!=(i=null!=(i=null!=(i=r[s])?i:e[s])?i:o[s])?i:{instance:n.t};r[s]=u,e[s]=u,o[s]=u},707:(t,e,n)=>{$Q(e),e.u=e.l=void 0;const s=n(832);function i(t,e,n){if(n)return n(t,e);const i=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(n=null==e?void 0:e.userID)?n:""),"cids:"+Object.keys(i).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+i[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.l=i,e.u=function(t,e,n){return e?i(t,e,n):(0,s.h)("k:"+t)}},856:(t,e)=>{$Q(e)},320:function(t,e,n){var s=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const l=n(780),a=n(604),r=n(296),o=n(444),c=n(412);function d(t,e,n,i){return{source:t,data:e,receivedAt:Date.now(),stableID:n,fullUserHash:(0,r.v)(i)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.p=e,this.O=null,this.m=null,this.j="statsig.last_modified_time."+e,this.S=new i}attach(t,e){this.m=t,this.O=e}getDataSync(t){var e=this.T(t),n=this.S.get(e,t);return n||((n=this.I(e))?(this.S.add(e,n),this.S.get(e,t)):null)}setData(t,e){var e=e&&(0,r.M)(e,null==(e=this.O)?void 0:e.environment),n=this.T(e);this.S.add(n,d("Bootstrap",t,null,e))}__primeInMemoryCache(t){this.S.merge(t)}D(e,n,i){return s(this,void 0,void 0,function*(){var t=null!=e?e:this.getDataSync(n),t=[this.A(t,n,i)];return null!=i&&i.timeoutMs&&t.push(new Promise(t=>setTimeout(t,i.timeoutMs)).then(()=>(l.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}k(n,i){return s(this,void 0,void 0,function*(){var t=this.T(n),e=yield this.D(null,n,i);e&&this.S.add(t,$P($P({},e),{source:"Prefetch"}))})}A(r,o,u){return s(this,void 0,void 0,function*(){let t=null;r&&this.N(r,o)&&(t=r.data);var e=yield this.P(t,o,u);if(!e)return l.Log.debug("No response returned for latest value"),null;var n=(0,c.C)(e,"has_updates","Response"),i=this.R(),i=yield a.StableID.get(i);let s=null;if(!0===(null==n?void 0:n.has_updates))s=d("Network",e,i,o);else{if(!t||!1!==(null==n?void 0:n.has_updates))return null;s=d("NetworkNotModified",t,i,o)}e=this.T(o);return this.S.add(e,s),yield this.G(e,s),s})}R(){return null!=this.m?this.m:(l.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=o.Storage.U)?void 0:e.call(o.Storage,t);return null!=e&&(t=(0,c.C)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}G(t,e){return s(this,void 0,void 0,function*(){yield o.Storage.F(t,JSON.stringify(e)),yield this.K(t)})}K(n){var i;return s(this,void 0,void 0,function*(){var t=null!=(i=yield(0,o.L)(this.j))?i:{},e=(t[n]=Date.now(),u(t,10));e&&(delete t[e],yield o.Storage.J(e)),yield(0,o.q)(this.j,t)})}};class i{constructor(){this.V={}}get(t,e){var t=this.V[t],n=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&n&&e!==n?(l.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var n=u(this.V,9);n&&delete this.V[n],this.V[t]=e}merge(t){this.V=$P($P({},this.V),t)}}function u(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var n=s[t],i=s[e];return"object"==typeof n&&"object"==typeof i?i.receivedAt{$Q(e),e.Diagnostics=void 0;e.Diagnostics=class{static mark(){}}},184:(t,e)=>{$Q(e)},512:function(t,u,e){var n=this&&this.__awaiter||$A();$Q2(u,"__esModule",{value:!0}),u.ErrorBoundary=u.EXCEPTION_ENDPOINT=void 0;const i=e(780),l=e(360),a=e(972),c=(u.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");u.ErrorBoundary=class{constructor(t,e,n){this.m=t,this.O=e,this.B=n,this.$=new Set}wrap(i){try{const t=i;!function(t){const e=new Set;let n=Object.getPrototypeOf(t);for(;n&&n!==Object.prototype;)Object.getOwnPropertyNames(n).filter(t=>"function"==typeof(null===n||void 0===n?void 0:n[t])).forEach(t=>e.add(t)),n=Object.getPrototypeOf(n);return Array.from(e)}(t).forEach(e=>{const n=t[e];"$EB"in n||(t[e]=(...t)=>this.Y(e,()=>n.apply(i,t)),t[e].$EB=!0)})}catch(t){this.H("eb:wrap",t)}}logError(t,e){this.H(t,e)}Y(e,t){try{var n=t();return n&&n instanceof Promise?n.catch(t=>this.H(e,t)):n}catch(t){return this.H(e,t),null}}H(r,o){try{i.Log.warn("Caught error in "+r,{error:o});n(this,void 0,void 0,function*(){var t,e,n=o||Error(c),i=n instanceof Error,s=i?n.name:"No Name";this.$.has(s)||(this.$.add(s),null!=(t=null==(t=this.O)?void 0:t.networkConfig)&&t.preventAllNetworkTraffic?null!=(t=this.B)&&t.call(this,{name:"error",error:o}):(t=l.SDKType.W(this.m),e=a.StatsigMetadataProvider.get(),i=i?n.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(n),n=JSON.stringify($P({tag:r,exception:s,info:i},$P($P({},e),{sdkType:t}))),yield(null!=(s=null==(i=null==(s=this.O)?void 0:s.networkConfig)?void 0:i.networkOverrideFunc)?s:fetch)(u.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.m,"STATSIG-SDK-TYPE":String(t),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:n}),null!=(i=this.B)&&i.call(this,{name:"error",error:o})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},500:(t,e)=>{$Q(e)},788:(t,e)=>{$Q(e)},728:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=n(832),r=n(780),o=n(716),u=n(48),l=n(876),a=n(444),c=n(84),d=n(100),h={},v=t=>{null!=(t=h[t])&&t.flush().catch(()=>{})};e.EventLogger=class{constructor(e,t,n,i){this.m=e,this.B=t,this.X=n,this.O=i,this.Z=[],this.tt={},this.et={},this.nt=!1,this.it=Date.now(),(h[e]=this).st=!0===(null==i?void 0:i.disableLogging),this.rt=null!=(t=null==i?void 0:i.loggingBufferMaxSize)?t:50;n=null==i?void 0:i.networkConfig;this.ot=(0,c.ut)(null==n?void 0:n.logEventUrl,null==n?void 0:n.api,"/rgstr",o.NetworkDefault.eventsApi),(0,d.lt)(t=>{"background"===t&&v(e)}),this.ct(),this.dt()}setLoggingDisabled(t){this.st=t}enqueue(t){this.ht(t)&&(this.vt(t),this.ft(),this.Z.length>this.rt)&&v(this.m)}incrementNonExposureCount(t){var e=null!=(e=this.et[t])?e:0;this.et[t]=e+1}reset(){this.tt={}}shutdown(){return i(this,void 0,void 0,function*(){this._t&&(clearInterval(this._t),this._t=null),yield this.flush()})}flush(){return i(this,void 0,void 0,function*(){var t;if(this.bt(),0!==this.Z.length)return t=this.Z,this.Z=[],this.gt(t)})}ft(){this.nt||(this.nt=!0,200v(this.m),200)}ht(t){if((0,l.yt)(t)){var e=t.user||{},n=t.metadata||{},t=[t.eventName,e.userID,n.gate,n.config,n.ruleID].join("|"),e=this.tt[t],n=Date.now();if(e&&n-e<6e4)return!1;1e3{r.Log.warn("Unable to save failed logs to storage")})}ct(){const e=this.u();i(this,void 0,void 0,function*(){var t=yield(0,a.L)(e);t&&(yield a.Storage.J(e),yield this.gt(t))}).catch(()=>{r.Log.warn("Failed to flush stored logs")})}u(){return"statsig.failed_logs."+(0,s.h)(this.m)}vt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},n=this.xt(),n=(n&&(e.statsigMetadata={currentPage:n}),$P($P({},t),e));r.Log.debug("Enqueued Event:",n),this.Z.push(n)}bt(){0!==Object.keys(this.et).length&&(this.vt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.et)}}),this.et={})}xt(){var t;if(!1!==(null==(t=this.O)?void 0:t.includeCurrentPageUrlWithEvents))return(0,u.It)()}dt(){if((0,u.Mt)()){var t=null!=(t=null==(t=this.O)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{h[this.m]._t!==e?clearInterval(e):v(this.m)},t);this._t=e}}}},832:(t,e)=>{$Q(e),e.Dt=e.h=void 0;e.h=e=>{let n=0;for(let t=0;t>>0)};e.Dt=t=>(0,e.h)(JSON.stringify(s(t)));const s=n=>{if(null==n)return null;var t=Object.keys(n).sort();const i={};return t.forEach(t=>{let e=n[t];!Array.isArray(e)&&e instanceof Object&&(e=s(e)),i[t]=e}),i}},664:(t,e)=>{$Q(e)},780:(t,e)=>{function n(t){return t.unshift("[Statsig]"),t}var i,s;$Q(e),e.Log=e.LogLevel=void 0,(s=i||(e.LogLevel=i={}))[s.None=0]="None",s[s.Error=1]="Error",s[s.Warn=2]="Warn",s[s.Info=3]="Info",s[s.Debug=4]="Debug";class r{static info(...t){this.level>=i.Info&&console.info(...n(t))}static debug(...t){this.level>=i.Debug&&console.debug(...n(t))}static warn(...t){this.level>=i.Warn&&console.warn(...n(t))}static error(...t){this.level>=i.Error&&console.error(...n(t))}}(e.Log=r).level=i.Error},716:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=void 0,e.NetworkDefault={eventsApi:"https://prodregistryv2.org/v1",initializeApi:"https://featureassets.org/v1",specsApi:"https://assetsconfigcdn.org/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},188:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,n(496);const o=n(496),_=n(280),b=n(780),u=n(716),l=n(360),a=n(48),c=n(612),d=n(604),h=n(972),g=n(100);e.NetworkCore=class{constructor(t,e){this.B=e,this.Et=1e4,this.At={},this.O={},t&&(this.O=t),this.O.networkConfig&&(this.At=this.O.networkConfig),this.At.networkTimeoutMs&&(this.Et=this.At.networkTimeoutMs)}post(e){return r(this,void 0,void 0,function*(){let t=yield this.kt(e);return e.isStatsigEncodable&&(t=this.Nt(e,t)),this.Pt($P({method:"POST",body:t},e))})}get(t){return this.Pt($P({method:"GET"},t))}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}beacon(i){return r(this,void 0,void 0,function*(){var t,e,n;return!!y(i)&&(t=yield this.kt(i),e=yield this.Ct(i),(n=navigator).sendBeacon.bind(n)(e,t))})}Pt(h){var v,f;return r(this,void 0,void 0,function*(){if(!y(h))return null;if(this.At.preventAllNetworkTraffic)return null;var{method:e,body:n,retries:i}=h;const s="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>null===s||void 0===s?void 0:s.abort(`Timeout of ${this.Et}ms expired.`),this.Et),r=yield this.Ct(h),o=null,u=(0,g.Rt)();try{var l,a,c,d={method:e,body:n,headers:$P({},h.headers),signal:null===s||void 0===s?void 0:s.signal,priority:h.priority,keepalive:u},o=yield(null!=(v=this.At.networkOverrideFunc)?v:fetch)(r,d);if(clearTimeout(t),o.ok)return c=yield o.text(),_.Diagnostics.mark(),{body:c,code:o.status};throw l=yield o.text().catch(()=>"No Text"),(a=new Error(`NetworkError: ${r} `+l)).name="NetworkError",a}catch(t){n=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(s,t);return _.Diagnostics.mark(),!i||i<=0?(null!=(f=this.B)&&f.call(this,{name:"error",error:t}),b.Log.error(`A networking error occured during ${e} request to ${r}.`,n,t),null):this.Pt($P($P({},h),{retries:i-1}))}})}Ct(n){return r(this,void 0,void 0,function*(){const e=$P({[u.NetworkParam.SdkKey]:n.sdkKey,[u.NetworkParam.SdkType]:l.SDKType.W(n.sdkKey),[u.NetworkParam.SdkVersion]:h.SDK_VERSION,[u.NetworkParam.Time]:String(Date.now()),[u.NetworkParam.SessionID]:yield c.SessionID.get(n.sdkKey)},n.params);var t=Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return n.url+(t?"?"+t:"")})}kt(s){return r(this,void 0,void 0,function*(){var{data:t,sdkKey:e}=s,n=yield d.StableID.get(e),i=yield c.SessionID.get(e),e=l.SDKType.W(e);return JSON.stringify($P($P({},t),{statsigMetadata:$P($P({},h.StatsigMetadataProvider.get()),{stableID:n,sessionID:i,sdkType:e})}))})}Nt(t,e){var n,i,s=(0,a.Gt)();if(!t.isStatsigEncodable||this.O.disableStatsigEncoding||null!=(0,o.i)("no-encode")||null==s||!s.btoa)return e;try{var r=null!=(n=s.btoa(e).split("").reverse().join(""))?n:e;return t.params=$P($P({},null!=(i=t.params)?i:{}),{[u.NetworkParam.StatsigEncoded]:"1"}),r}catch(t){return b.Log.warn("/initialize request encoding failed"),e}}};const y=t=>!!t.sdkKey||(b.Log.warn("Unable to make request without an SDK key"),!1)},264:(t,e)=>{$Q(e)},648:(t,e)=>{$Q(e)},360:(t,e)=>{$Q(e),e.SDKType=void 0;const n={};let i;e.SDKType={W:t=>{return(null!=(t=n[t])?t:"js-mono")+(null!==i&&void 0!==i?i:"")},Ut(t,e){n[t]=e},Ft(t){i&&"-react"!==i||(i="-"+t)}}},48:(t,i)=>{$Q2(i,"__esModule",{value:!0}),i.It=i.Kt=i.Lt=i.Mt=i.zt=i.Gt=void 0;i.Gt=()=>"undefined"!=typeof window?window:null,i.zt=()=>{var t=(0,i.Gt)();return null!=(t=null==t?void 0:t.document)?t:null},i.Mt=()=>null!=(0,i.zt)(),i.Lt=(t,e)=>{var n=(0,i.Gt)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)},i.Kt=(t,e)=>{var n=(0,i.zt)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)};i.It=()=>{var t;try{return null==(t=(0,i.Gt)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},612:function(t,e,n){var o=this&&this.__awaiter||$A();$Q(e),e.StatsigSession=e.SessionID=void 0;const i=n(707),u=n(780),l=n(444),a=n(556),c=18e5,d=144e5,h={};function v(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function f(t){return"statsig.session_id."+(0,i.u)(t)}e.SessionID={get:t=>o(void 0,void 0,void 0,function*(){return e.StatsigSession.get(t).then(t=>t.data.sessionID)})},e.StatsigSession={get:r=>o(void 0,void 0,void 0,function*(){null==h[r]&&(h[r]=function(n){return o(this,void 0,void 0,function*(){let t=yield function(t){t=f(t);return(0,l.L)(t)}(n);var e=Date.now();return{data:t=t||{sessionID:(0,a.getUUID)(),startTime:e,lastUpdate:e},sdkKey:n}})}(r));var t=yield h[r],e=Date.now(),n=t.data,i=((function({lastUpdate:t}){return Date.now()-t>c}(n)||function({startTime:t}){return Date.now()-t>d}(n))&&(n.sessionID=(0,a.getUUID)(),n.startTime=e),n.lastUpdate=e,n),s=t.sdkKey;return s=f(s),(0,l.q)(s,i).catch(()=>{u.Log.warn("Failed to save SessionID")}),clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=n.startTime,n=t.sdkKey,t.idleTimeoutID=v(n,c),t.ageTimeoutID=v(n,d-e),t})}},604:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.StableID=void 0;const s=n(707),r=n(780),o=n(444),u=n(556),l={};function a(t){return"statsig.stable_id."+(0,s.u)(t)}function c(t,e){e=a(e);(0,o.q)(e,t).catch(()=>{r.Log.warn("Failed to save StableID")})}e.StableID={get:e=>i(void 0,void 0,void 0,function*(){return null==l[e]&&(l[e]=function(t){t=a(t);return(0,o.L)(t)}(e).then(t=>{return null!=t||c(t=(0,u.getUUID)(),e),t})),l[e]}),setOverride:(t,e)=>{l[e]=Promise.resolve(t),c(t,e)}}},688:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,n(496);const o=n(496),u=n(512),l=n(728),a=n(780),c=n(48),d=n(444);e.StatsigClientBase=class{constructor(t,e,n,i){this.loadingStatus="Uninitialized",this.Jt={};var s,r=this.$emt.bind(this);null!=(null==i?void 0:i.logLevel)&&(a.Log.level=i.logLevel),null!=i&&i.disableStorage&&d.Storage.qt(!0),this.m=t,this.O=null!=i?i:{},this.Vt=null!=(s=null==i?void 0:i.overrideAdapter)?s:null,this.Bt=new l.EventLogger(t,r,n,i),this.$t=new u.ErrorBoundary(t,i,r),this.$t.wrap(this),this.$t.wrap(n),this.$t.wrap(e),this.$t.wrap(this.Bt),(0,c.Mt)()&&(null!=(n=null!=(r=(s=(0,o.o)()).instances)?r:{})[t]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),n[t]=this,s.lastInstance=this,s.instances=n,__STATSIG__=s),this.dataAdapter=e,this.dataAdapter.attach(t,i),this.Yt()}updateRuntimeOptions(t){null!=t.disableLogging&&(this.O.disableLogging=t.disableLogging,this.Bt.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.O.disableStorage=t.disableStorage,d.Storage.qt(t.disableStorage))}flush(){return this.Bt.flush()}shutdown(){return i(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),yield this.Bt.shutdown()})}on(t,e){this.Jt[t]||(this.Jt[t]=[]),this.Jt[t].push(e)}off(t,e){this.Jt[t]&&-1!==(e=this.Jt[t].indexOf(e))&&this.Jt[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(n){var t;const e=e=>{try{e(n)}catch(t){!0===e.__isInternal?this.$t.logError("__emit:"+n.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",n)}};this.Jt[n.name]&&this.Jt[n.name].forEach(t=>e(t)),null!=(t=this.Jt["*"])&&t.forEach(e)}Ht(t,e){this.loadingStatus=t,this.$emt({name:"values_updated",status:t,values:e})}Wt(t,e,n){!0===(null==n?void 0:n.disableExposureLog)?this.Bt.incrementNonExposureCount(t):this.Bt.enqueue(e)}}},808:(t,e)=>{$Q(e)},283:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},876:(t,e)=>{$Q(e),e.Qt=e.Xt=e.Zt=e.yt=void 0;const n="statsig::config_exposure",i="statsig::gate_exposure",l=(t,e,n,i,s)=>({eventName:t,user:e,value:null,metadata:r(n,i),secondaryExposures:s,time:Date.now()});e.yt=({eventName:t})=>t===i||t===n,e.Zt=(t,e)=>{return l(i,t,e.details,{gate:e.name,gateValue:String(e.value),ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])},e.Xt=(t,e)=>{return l(n,t,e.details,{config:e.name,ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])};e.Qt=(t,e,n)=>{var i,s=e.__evaluation,r=!0===(null==(r=null==s?void 0:s.explicit_parameters)?void 0:r.includes(n));let o="",u=null!=(i=null==s?void 0:s.undelegated_secondary_exposures)?i:[];return r&&(o=null!=(i=s.allocated_experiment_name)?i:"",u=s.secondary_exposures),l("statsig::layer_exposure",t,e.details,{config:e.name,parameterName:n,ruleID:e.ruleID,allocatedExperiment:o,isExplicitParameter:String(r)},u)};const r=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},972:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="1.2.0";let n={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>n,add:t=>{n=$P($P({},n),t)}}},384:(t,e)=>{$Q(e)},396:(t,e)=>{$Q(e),e.te=e.ee=e.ne=e.ie=e.se=e.re=e.oe=e.ue=void 0;const s="default";function r(t,e,n,i){return{name:t,details:e,ruleID:null!=(t=null==n?void 0:n.rule_id)?t:s,__evaluation:n,value:i}}function i(t,e,n){var i=null!=(i=null==n?void 0:n.value)?i:{};return $P($P({},r(t,e,n,i)),{get:u(null==n?void 0:n.value)})}function o(t,e){var n=t=>Array.isArray(t)?"array":typeof t;return n(t)===n(e)}function u(i,s){return(t,e)=>{var n=null!=(n=null==i?void 0:i[t])?n:null;return null!=n&&(null==e||o(n,e))?(null!=s&&s(t),n):null!=e?e:null}}e.ue=function(t,e,n){return r(t,e,n,!0===(null==n?void 0:n.value))},e.oe=i,e.re=function(t,e,n){return t=i(t,e,n),$P($P({},t),{groupName:null!=(e=null==n?void 0:n.group_name)?e:null})},e.se=function(t,e,n,i){return $P($P({},r(t,e,n,void 0)),{get:u(null==n?void 0:n.value,i),groupName:null!=(t=null==n?void 0:n.group_name)?t:null,__value:null!=(e=null==n?void 0:n.value)?e:{}})},e.ie=function(t,e,n,i){return $P($P($P({},t),e),{get:u(n,i)})},e.ne=function(t){return Array.isArray(t)?"array":typeof t},e.ee=o,e.te=u},136:(t,e)=>{$Q(e)},296:(t,e,n)=>{$Q(e),e.v=e.M=void 0;const i=n(832),s=n(780);e.M=function(t,e){try{var n=JSON.parse(JSON.stringify(t));return null!=e&&(n.statsigEnvironment=e),n}catch(t){return s.Log.error("Failed to JSON.stringify user"),{}}},e.v=function(t){return t?(0,i.Dt)(t):null}},444:function(t,n,e){var i=this&&this.__awaiter||$A(),s=($Q2(n,"__esModule",{value:!0}),n.q=n.L=n.Storage=void 0,e(780)),e=e(48);const r={},o=t=>Promise.resolve(t),u={le:()=>"InMemory",U:t=>r[t]||null,ae:t=>o(r[t]||null),F:(t,e)=>(r[t]=e,o()),J:t=>(delete r[t],o()),ce:()=>o(Object.keys(r))};let l=null;try{const h=(0,e.Gt)();h&&h.localStorage&&"function"==typeof h.localStorage.getItem&&(l={le:()=>"LocalStorage",U:t=>h.localStorage.getItem(t),ae:t=>o(h.localStorage.getItem(t)),F:(t,e)=>(h.localStorage.setItem(t,e),o()),J:t=>(h.localStorage.removeItem(t),o()),ce:()=>o(Object.keys(h.localStorage))})}catch(t){s.Log.warn("Failed to setup localStorageProvider.")}let a=null!==l&&void 0!==l?l:u,c=a;function d(t){try{return t()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return n.Storage.de(u),null;throw t}}n.Storage={le:()=>c.le(),ae:t=>i(void 0,void 0,void 0,function*(){return d(()=>c.ae(t))}),U:t=>d(()=>c.U?c.U(t):null),F:(t,e)=>c.F(t,e),J:t=>c.J(t),ce:()=>c.ce(),de:t=>{a=t,c=t},qt:t=>{c=t?u:a}},n.L=function(e){return i(this,void 0,void 0,function*(){var t=yield n.Storage.ae(e);return JSON.parse(null!=t?t:"null")})},n.q=function(t,e){return i(this,void 0,void 0,function*(){yield n.Storage.F(t,JSON.stringify(e))})}},412:(t,e,n)=>{$Q(e),e.C=void 0;const s=n(780);e.C=function(t,e,n){try{var i=JSON.parse(t);return"object"==typeof i&&0 in i,i}catch(t){}return s.Log.error("Failed to parse "+n),null}},556:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let n=(new Date).getTime(),i="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0{$Q(e),e.ut=void 0,e.ut=function(t,e,n,i){return t||(e?""+e+n:""+i+n)}},539:(t,e)=>{$Q(e)},100:(t,e,n)=>{$Q(e),e.he=e.lt=e.Rt=e.jt=void 0;n=n(48);const i="foreground",s="background",r=[];let o=i,u=!1;e.jt=()=>o===i,e.Rt=()=>u,e.lt=t=>{r.unshift(t)};e.he=e=>{e!==o&&(o=e,r.forEach(t=>t(e)))},(0,n.Lt)("focus",()=>{(u=!1,e.he)(i)}),(0,n.Lt)("blur",()=>(0,e.he)(s)),(0,n.Lt)("beforeunload",()=>{u=!0,(0,e.he)(s)}),(0,n.Kt)("visibilitychange",()=>{(0,e.he)("visible"===document.visibilityState?i:s)})},464:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(e,n);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,s)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),s=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),e.Log=e.Storage=e.EventLogger=void 0,n(496);const r=n(728),o=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return r.EventLogger}}),n(780));$Q2(e,"Log",{enumerable:!0,get:function(){return o.Log}});var u=n(972);const l=n(444);$Q2(e,"Storage",{enumerable:!0,get:function(){return l.Storage}}),s(n(496),e),s(n(707),e),s(n(856),e),s(n(320),e),s(n(184),e),s(n(512),e),s(n(500),e),s(n(788),e),s(n(832),e),s(n(664),e),s(n(780),e),s(n(188),e),s(n(716),e),s(n(264),e),s(n(648),e),s(n(48),e),s(n(360),e),s(n(612),e),s(n(604),e),s(n(688),e),s(n(808),e),s(n(283),e),s(n(876),e),s(n(972),e),s(n(384),e),s(n(396),e),s(n(136),e),s(n(296),e),s(n(444),e),s(n(412),e),s(n(84),e),s(n(539),e),s(n(556),e),s(n(100),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:o.Log,SDK_VERSION:u.SDK_VERSION})},696:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(e,n);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,s)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),s=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),s(n(208),e),e.default=__STATSIG__},96:(t,e,n)=>{$Q(e),e.ve=void 0;const i=n(464);function s(t,e){null!=t&&t.forEach(t=>{delete e[t]})}e.ve=function(t,e){var n;return(e=(0,i.C)(e,"checksum","DeltasEvaluationResponse"))?(t=t,n=e,t=$P($P($P({},t),n),{feature_gates:$P($P({},t.feature_gates),n.feature_gates),layer_configs:$P($P({},t.layer_configs),n.layer_configs),dynamic_configs:$P($P({},t.dynamic_configs),n.dynamic_configs)}),s((t=n=t).deleted_gates,t.feature_gates),delete t.deleted_gates,s(n.deleted_configs,t.dynamic_configs),delete t.deleted_configs,s(n.deleted_layers,t.layer_configs),delete t.deleted_layers,n=t,(t=(0,i.Dt)({feature_gates:n.feature_gates,dynamic_configs:n.dynamic_configs,layer_configs:n.layer_configs}))===e.checksum?JSON.stringify(n):{hadBadDeltaChecksum:!0,badChecksum:t,badMergedConfigs:n,badFullResponse:e.deltas_full_response}):{hadBadDeltaChecksum:!0}}},536:(t,e,n)=>{$Q(e);const i=n(464);e.default=class{constructor(){this.fe=null,this._e=null,this.be="Uninitialized",this.ge=0,this.ye=0}reset(){this._e=null,this.fe=null,this.be="Loading",this.ge=0,this.ye=0}finalize(){this._e||(this.be="NoValues")}getValues(){return this.fe?(0,i.C)(this.fe,"has_updates","EvaluationStoreValues"):null}setValues(t){var e;t&&!0===(null==(e=(0,i.C)(t.data,"has_updates","EvaluationResponse"))?void 0:e.has_updates)&&(this.fe=t.data,this.ge=e.time,this.ye=t.receivedAt,this.be=t.source,this._e=e)}getGate(t){var e;return this.pe(null==(e=this._e)?void 0:e.feature_gates,t)}getConfig(t){var e;return this.pe(null==(e=this._e)?void 0:e.dynamic_configs,t)}getLayer(t){var e;return this.pe(null==(e=this._e)?void 0:e.layer_configs,t)}getParamStore(t){var e;return this.pe(null==(e=this._e)?void 0:e.param_stores,t)}pe(t,e){let n=null;return{result:n=t?t[e]||t[(0,i.h)(e)]:n,details:this.Oe(null==n)}}Oe(t){return"Uninitialized"===this.be||"NoValues"===this.be?{reason:this.be}:{reason:this.be+":"+(t?"Unrecognized":"Recognized"),lcut:this.ge,receivedAt:this.ye}}}},400:function(t,e,n){var o=this&&this.__awaiter||$A();$Q(e);const u=n(464),l=n(96);class i extends u.NetworkCore{constructor(t,e){super(t,e);e=null==t?void 0:t.networkConfig;this.me=(0,u.ut)(null==e?void 0:e.initializeUrl,null==e?void 0:e.api,"/initialize",u.NetworkDefault.initializeApi)}fetchEvaluations(n,i,s,r){return o(this,void 0,void 0,function*(){var t=i?(0,u.C)(i,"has_updates","InitializeResponse"):null;let e={user:r,hash:"djb2",deltasResponseRequested:!1};return null!=t&&t.has_updates&&(e=$P($P({},e),{sinceTime:t.time,previousDerivedFields:"derived_fields"in t?t.derived_fields:{},deltasResponseRequested:!0})),this.je(n,t,e,s)})}je(e,n,i,s){var r;return o(this,void 0,void 0,function*(){var t=yield this.post({sdkKey:e,url:this.me,data:i,retries:2,isStatsigEncodable:!0,priority:s});return 204===(null==t?void 0:t.code)?'{"has_updates": false}':200!==(null==t?void 0:t.code)?null!=(r=null==t?void 0:t.body)?r:null:!0!==(null==n?void 0:n.has_updates)||!0!==(null==(r=t.body)?void 0:r.includes('"is_delta":true'))?t.body:"string"==typeof(t=(0,l.ve)(n,t.body))?t:this.je(e,n,$P($P($P({},i),t),{deltasResponseRequested:!1}),s)})}}e.default=i},340:(t,e,n)=>{$Q(e),e.Se=void 0;const b=n(464),g={disableExposureLog:!0};function y(t){return null==t||!1===t.disableExposureLog}function p(t,e){return null!=e&&!(0,b.ee)(t,e)}e.Se=function(v,f,_){return(t,e)=>{if(null==f)return e;var n,i,s,r,o,u,l,a,c,d,h=f[t];if(null==h||null!=e&&(0,b.ne)(e)!==h.param_type)return e;switch(h.ref_type){case"static":return h.value;case"gate":return d=h,v.getFeatureGate(d.gate_name,y(_)?void 0:g).value?d.pass_value:d.fail_value;case"dynamic_config":return d=h,l=e,a=_,p(c=(u=v).getDynamicConfig(d.config_name,g).get(d.param_name),l)?l:(y(a)&&u.getDynamicConfig(d.config_name),c);case"experiment":return l=h,a=e,u=_,p(o=(c=v).getExperiment(l.experiment_name,g).get(l.param_name),a)?a:(y(u)&&c.getExperiment(l.experiment_name),o);case"layer":return o=h,i=e,s=_,p(r=(n=v).getLayer(o.layer_name,g).get(o.param_name),i)?i:(y(s)&&n.getLayer(o.layer_name).get(o.param_name),r);default:return e}}}},520:function(t,e,n){var s=this&&this.__awaiter||$A();$Q(e);const o=n(464),r=n(536),u=n(400),l=n(340),a=n(364);class i extends o.StatsigClientBase{static instance(t){var e=(0,o.o)().instance(t);return e instanceof i?e:(o.Log.warn((0,o.Mt)()?"Unable to find StatsigClient instance":"StatsigClient.instance is not supported in server environments"),new i(null!=t?t:"",{}))}constructor(t,e,n=null){o.SDKType.Ut(t,"javascript-client");var i=new u.default(n,t=>{this.$emt(t)});super(t,null!=(t=null==n?void 0:n.dataAdapter)?t:new a.StatsigEvaluationsDataAdapter,i,n),this.we=new r.default,this.Te=e}initializeSync(){this.updateUserSync(this.Te)}initializeAsync(t){return this.updateUserAsync(this.Te,t)}updateUserSync(t){this.xe(t);t=this.dataAdapter.getDataSync(this.Te);this.we.setValues(t),this.Ie(t),this.Me(null!=t?t:null,this.Te)}updateUserAsync(n,i){return s(this,void 0,void 0,function*(){this.xe(n);var t=this.Te,e=this.dataAdapter.getDataSync(t);this.Ht("Loading",e),this.we.setValues(e),e=yield this.dataAdapter.getDataAsync(e,t,i),t===this.Te&&(this.we.setValues(e),this.Ie(e))})}getContext(){return{sdkKey:this.m,options:this.O,values:this.we.getValues(),user:JSON.parse(JSON.stringify(this.Te)),errorBoundary:this.$t}}getAsyncContext(){return s(this,void 0,void 0,function*(){return $P($P({},this.getContext()),{session:yield o.StatsigSession.get(this.m),stableID:yield o.StableID.get(this.m)})})}checkGate(t,e){return this.getFeatureGate(t,e).value}getFeatureGate(t,e){var{result:n,details:i}=this.we.getGate(t),i=(0,o.ue)(t,i,n),s=null==(s=null==(n=this.Vt)?void 0:n.getGateOverride)?void 0:s.call(n,i,this.Te,e),n=null!=s?s:i;return this.Wt(t,(0,o.Zt)(this.Te,n),e),this.$emt({name:"gate_evaluation",gate:n}),n}getDynamicConfig(t,e){var{result:n,details:i}=this.we.getConfig(t),i=(0,o.oe)(t,i,n),s=null==(s=null==(n=this.Vt)?void 0:n.getDynamicConfigOverride)?void 0:s.call(n,i,this.Te,e),n=null!=s?s:i;return this.Wt(t,(0,o.Xt)(this.Te,n),e),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),n}getExperiment(t,e){var{result:n,details:i}=this.we.getConfig(t),i=(0,o.re)(t,i,n),s=null==(s=null==(n=this.Vt)?void 0:n.getExperimentOverride)?void 0:s.call(n,i,this.Te,e),n=null!=s?s:i;return this.Wt(t,(0,o.Xt)(this.Te,n),e),this.$emt({name:"experiment_evaluation",experiment:i}),n}getLayer(e,n){var{result:t,details:i}=this.we.getLayer(e),i=(0,o.se)(e,i,t),s=null==(s=null==(t=this.Vt)?void 0:t.getLayerOverride)?void 0:s.call(t,i,this.Te,n);const r=(0,o.ie)(i,s,null!=(t=null==s?void 0:s.__value)?t:i.__value,t=>{this.Wt(e,(0,o.Qt)(this.Te,r,t),n)});return this.$emt({name:"layer_evaluation",layer:r}),r}getParameterStore(t,e){var{result:n,details:i}=this.we.getParamStore(t);return this.Bt.incrementNonExposureCount(t),{name:t,details:i,__configuration:n,get:(0,l.Se)(this,n,e)}}logEvent(t,e,n){this.Bt.enqueue($P($P({},"string"==typeof t?{eventName:t,value:e,metadata:n}:t),{user:this.Te,time:Date.now()}))}Yt(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Ie(null)})}Ie(t){this.we.finalize(),this.Ht("Ready",t)}Me(t,e){this.dataAdapter.getDataAsync(t,e,{priority:"low"}).catch(t=>{o.Log.error("An error occurred after update.",t)})}xe(t){this.Bt.reset(),this.we.reset(),this.Te=(0,o.M)(t,this.O.environment);t=null==(t=this.Te.customIDs)?void 0:t.stableID;t&&o.StableID.setOverride(t,this.m)}}e.default=i},364:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigEvaluationsDataAdapter=void 0;const i=n(464),s=n(400);class o extends i.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this.X=null,this.O=null}attach(t,e){super.attach(t,e),this.X=new s.default(null!=e?e:{})}getDataAsync(t,e,n){return this.D(t,e,n)}prefetchData(t,e){return this.k(t,e)}setData(t){var e=(0,i.C)(t,"has_updates","data");e&&"user"in e?super.setData(t,e.user):i.Log.error("StatsigUser not found")}setDataLegacy(t,e){super.setData(t,e)}P(e,n,i){var s;return r(this,void 0,void 0,function*(){var t=yield null==(s=this.X)?void 0:s.fetchEvaluations(this.R(),e,null==i?void 0:i.priority,n);return null!=t?t:null})}T(t){t=(0,i.u)(this.R(),t,null==(t=this.O)?void 0:t.customUserCacheKeyFunc);return`${i.DataAdapterCachePrefix}.${this.p}.`+t}N(t,e){return null!=t.fullUserHash&&t.fullUserHash===(0,i.v)(e)}}e.StatsigEvaluationsDataAdapter=o},208:(t,e,n)=>{$Q(e),e.StatsigClient=void 0;n=n(520);e.StatsigClient=n.default,__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigClient:n.default}),e.default=__STATSIG__}},i={};function s(t){var e=i[t];return void 0!==e||(e=i[t]={exports:{}},n[t].call(e.exports,e,e.exports,s)),e.exports}return s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s(696).default})()); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Statsig=e():t.Statsig=e()}(this,()=>(()=>{"use strict";var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});var i={496:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.t=i.i=i.o=void 0,i.o=()=>__STATSIG__||u,i.i=t=>(0,i.o)()[t];i.t=t=>{var e=(0,i.o)();return t?e.instances&&e.instances[t]:e.lastInstance};var n,s="__STATSIG__",r="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},o="undefined"!=typeof globalThis?globalThis:{};const u=null!=(n=null!=(n=null!=(n=r[s])?n:e[s])?n:o[s])?n:{instance:i.t};r[s]=u,e[s]=u,o[s]=u},707:(t,e,i)=>{$Q(e),e.u=e.l=void 0;const s=i(832);function n(t,e,i){if(i)return i(t,e);const n=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(i=null==e?void 0:e.userID)?i:""),"cids:"+Object.keys(n).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+n[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.l=n,e.u=function(t,e,i){return e?n(t,e,i):(0,s.h)("k:"+t)}},856:(t,e)=>{$Q(e)},320:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const l=i(780),a=i(604),r=i(296),o=i(444),c=i(412);function d(t,e,i,n){return{source:t,data:e,receivedAt:Date.now(),stableID:i,fullUserHash:(0,r.v)(n)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.m=e,this.p=null,this.S=null,this.O="statsig.last_modified_time."+e,this.j=new n}attach(t,e){this.S=t,this.p=e}getDataSync(t){var e=this.T(t),i=this.j.get(e,t);return i||((i=this.I(e))?(this.j.add(e,i),this.j.get(e,t)):null)}setData(t,e){var e=e&&(0,r.A)(e,null==(e=this.p)?void 0:e.environment),i=this.T(e);this.j.add(i,d("Bootstrap",t,null,e))}__primeInMemoryCache(t){this.j.merge(t)}M(e,i,n){return s(this,void 0,void 0,function*(){var t=null!=e?e:this.getDataSync(i),t=[this.k(t,i,n)];return null!=n&&n.timeoutMs&&t.push(new Promise(t=>setTimeout(t,n.timeoutMs)).then(()=>(l.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}D(i,n){return s(this,void 0,void 0,function*(){var t=this.T(i),e=yield this.M(null,i,n);e&&this.j.add(t,$P($P({},e),{source:"Prefetch"}))})}k(r,o,u){return s(this,void 0,void 0,function*(){let t=null;r&&this.R(r,o)&&(t=r.data);var e=yield this.N(t,o,u);if(!e)return l.Log.debug("No response returned for latest value"),null;var i=(0,c.C)(e,"has_updates","Response"),n=this.P(),n=yield a.StableID.get(n);let s=null;if(!0===(null==i?void 0:i.has_updates))s=d("Network",e,n,o);else{if(!t||!1!==(null==i?void 0:i.has_updates))return null;s=d("NetworkNotModified",t,n,o)}e=this.T(o);return this.j.add(e,s),yield this.G(e,s),s})}P(){return null!=this.S?this.S:(l.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=o.Storage.U)?void 0:e.call(o.Storage,t);return null!=e&&(t=(0,c.C)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}G(t,e){return s(this,void 0,void 0,function*(){yield o.Storage.L(t,JSON.stringify(e)),yield this.K(t)})}K(i){var n;return s(this,void 0,void 0,function*(){var t=null!=(n=yield(0,o.F)(this.O))?n:{},e=(t[i]=Date.now(),u(t,10));e&&(delete t[e],yield o.Storage.q(e)),yield(0,o.J)(this.O,t)})}};class n{constructor(){this.V={}}get(t,e){var t=this.V[t],i=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&i&&e!==i?(l.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var i=u(this.V,9);i&&delete this.V[i],this.V[t]=e}merge(t){this.V=$P($P({},this.V),t)}}function u(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var i=s[t],n=s[e];return"object"==typeof i&&"object"==typeof n?n.receivedAt{$Q(e),e.Diagnostics=void 0;e.Diagnostics=class{static mark(){}}},184:(t,e)=>{$Q(e)},512:function(t,u,e){var i=this&&this.__awaiter||$A();$Q2(u,"__esModule",{value:!0}),u.ErrorBoundary=u.EXCEPTION_ENDPOINT=void 0;const n=e(780),l=e(360),a=e(972),c=(u.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");u.ErrorBoundary=class{constructor(t,e,i){this.S=t,this.p=e,this.B=i,this.$=new Set}wrap(n){try{const t=n;!function(t){const e=new Set;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;)Object.getOwnPropertyNames(i).filter(t=>"function"==typeof(null===i||void 0===i?void 0:i[t])).forEach(t=>e.add(t)),i=Object.getPrototypeOf(i);return Array.from(e)}(t).forEach(e=>{const i=t[e];"$EB"in i||(t[e]=(...t)=>this.H(e,()=>i.apply(n,t)),t[e].$EB=!0)})}catch(t){this.W("eb:wrap",t)}}logError(t,e){this.W(t,e)}H(e,t){try{var i=t();return i&&i instanceof Promise?i.catch(t=>this.W(e,t)):i}catch(t){return this.W(e,t),null}}W(r,o){try{n.Log.warn("Caught error in "+r,{error:o});i(this,void 0,void 0,function*(){var t,e,i=o||Error(c),n=i instanceof Error,s=n?i.name:"No Name";this.$.has(s)||(this.$.add(s),null!=(t=null==(t=this.p)?void 0:t.networkConfig)&&t.preventAllNetworkTraffic?null!=(t=this.B)&&t.call(this,{name:"error",error:o}):(t=l.SDKType.Y(this.S),e=a.StatsigMetadataProvider.get(),n=n?i.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(i),i=JSON.stringify($P({tag:r,exception:s,info:n},$P($P({},e),{sdkType:t}))),yield(null!=(s=null==(n=null==(s=this.p)?void 0:s.networkConfig)?void 0:n.networkOverrideFunc)?s:fetch)(u.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.S,"STATSIG-SDK-TYPE":String(t),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:i}),null!=(n=this.B)&&n.call(this,{name:"error",error:o})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},500:(t,e)=>{$Q(e)},788:(t,e)=>{$Q(e)},728:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=i(832),r=i(780),o=i(716),u=i(48),l=i(876),a=i(444),c=i(84),d=i(100),h={},v=t=>{null!=(t=h[t])&&t.flush().catch(()=>{})};e.EventLogger=class{constructor(e,t,i,n){this.S=e,this.B=t,this.X=i,this.p=n,this.Z=[],this.tt={},this.et={},this.it=!1,this.nt=Date.now(),(h[e]=this).st=!0===(null==n?void 0:n.disableLogging),this.rt=null!=(t=null==n?void 0:n.loggingBufferMaxSize)?t:50;i=null==n?void 0:n.networkConfig;this.ot=(0,c.ut)(null==i?void 0:i.logEventUrl,null==i?void 0:i.api,"/rgstr",o.NetworkDefault.eventsApi),(0,d.lt)(t=>{"background"===t&&v(e)}),this.ct(),this.ht()}setLoggingDisabled(t){this.st=t}enqueue(t){this.dt(t)&&(this.vt(t),this._t(),this.Z.length>this.rt)&&v(this.S)}incrementNonExposureCount(t){var e=null!=(e=this.et[t])?e:0;this.et[t]=e+1}reset(){this.tt={}}shutdown(){return n(this,void 0,void 0,function*(){this.ft&&(clearInterval(this.ft),this.ft=null),yield this.flush()})}flush(){return n(this,void 0,void 0,function*(){var t;if(this.gt(),0!==this.Z.length)return t=this.Z,this.Z=[],this.bt(t)})}_t(){this.it||(this.it=!0,200v(this.S),200)}dt(t){if((0,l.yt)(t)){var e=t.user||{},i=t.metadata||{},t=[t.eventName,e.userID,i.gate,i.config,i.ruleID].join("|"),e=this.tt[t],i=Date.now();if(e&&i-e<6e4)return!1;1e3{r.Log.warn("Unable to save failed logs to storage")})}ct(){const e=this.u();n(this,void 0,void 0,function*(){var t=yield(0,a.F)(e);t&&(yield a.Storage.q(e),yield this.bt(t))}).catch(()=>{r.Log.warn("Failed to flush stored logs")})}u(){return"statsig.failed_logs."+(0,s.h)(this.S)}vt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},i=this.It(),i=(i&&(e.statsigMetadata={currentPage:i}),$P($P({},t),e));r.Log.debug("Enqueued Event:",i),this.Z.push(i)}gt(){0!==Object.keys(this.et).length&&(this.vt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.et)}}),this.et={})}It(){var t;if(!1!==(null==(t=this.p)?void 0:t.includeCurrentPageUrlWithEvents))return(0,u.At)()}ht(){if((0,u.Mt)()){var t=null!=(t=null==(t=this.p)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{h[this.S].ft!==e?clearInterval(e):v(this.S)},t);this.ft=e}}}},832:(t,e)=>{$Q(e),e.xt=e.h=void 0;e.h=e=>{let i=0;for(let t=0;t>>0)};e.xt=t=>(0,e.h)(JSON.stringify(s(t)));const s=i=>{if(null==i)return null;var t=Object.keys(i).sort();const n={};return t.forEach(t=>{let e=i[t];!Array.isArray(e)&&e instanceof Object&&(e=s(e)),n[t]=e}),n}},664:(t,e)=>{$Q(e)},780:(t,e)=>{function i(t){return t.unshift("[Statsig]"),t}var n,s;$Q(e),e.Log=e.LogLevel=void 0,(s=n||(e.LogLevel=n={}))[s.None=0]="None",s[s.Error=1]="Error",s[s.Warn=2]="Warn",s[s.Info=3]="Info",s[s.Debug=4]="Debug";class r{static info(...t){this.level>=n.Info&&console.info(...i(t))}static debug(...t){this.level>=n.Debug&&console.debug(...i(t))}static warn(...t){this.level>=n.Warn&&console.warn(...i(t))}static error(...t){this.level>=n.Error&&console.error(...i(t))}}(e.Log=r).level=n.Error},716:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=void 0,e.NetworkDefault={eventsApi:"https://prodregistryv2.org/v1",initializeApi:"https://featureassets.org/v1",specsApi:"https://assetsconfigcdn.org/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},188:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,i(496);const o=i(496),_=i(280),y=i(780),u=i(716),l=i(360),a=i(48),c=i(612),d=i(604),h=i(972),b=i(100);e.NetworkCore=class{constructor(t,e){this.B=e,this.kt=1e4,this.Dt={},this.p={},t&&(this.p=t),this.p.networkConfig&&(this.Dt=this.p.networkConfig),this.Dt.networkTimeoutMs&&(this.kt=this.Dt.networkTimeoutMs)}post(e){return r(this,void 0,void 0,function*(){let t=yield this.Et(e);return e.isStatsigEncodable&&(t=this.Rt(e,t)),this.Nt($P({method:"POST",body:t},e))})}get(t){return this.Nt($P({method:"GET"},t))}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}beacon(n){return r(this,void 0,void 0,function*(){var t,e,i;return!!g(n)&&(t=yield this.Et(n),e=yield this.Ct(n),(i=navigator).sendBeacon.bind(i)(e,t))})}Nt(h){var v,f;return r(this,void 0,void 0,function*(){if(!g(h))return null;if(this.Dt.preventAllNetworkTraffic)return null;var{method:e,body:i,retries:n}=h;const s="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>null===s||void 0===s?void 0:s.abort(`Timeout of ${this.kt}ms expired.`),this.kt),r=yield this.Ct(h),o=null,u=(0,b.Pt)();try{var l,a,c,d={method:e,body:i,headers:$P({},h.headers),signal:null===s||void 0===s?void 0:s.signal,priority:h.priority,keepalive:u},o=yield(null!=(v=this.Dt.networkOverrideFunc)?v:fetch)(r,d);if(clearTimeout(t),o.ok)return c=yield o.text(),_.Diagnostics.mark(),{body:c,code:o.status};throw l=yield o.text().catch(()=>"No Text"),(a=new Error(`NetworkError: ${r} `+l)).name="NetworkError",a}catch(t){i=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(s,t);return _.Diagnostics.mark(),!n||n<=0?(null!=(f=this.B)&&f.call(this,{name:"error",error:t}),y.Log.error(`A networking error occured during ${e} request to ${r}.`,i,t),null):this.Nt($P($P({},h),{retries:n-1}))}})}Ct(i){return r(this,void 0,void 0,function*(){const e=$P({[u.NetworkParam.SdkKey]:i.sdkKey,[u.NetworkParam.SdkType]:l.SDKType.Y(i.sdkKey),[u.NetworkParam.SdkVersion]:h.SDK_VERSION,[u.NetworkParam.Time]:String(Date.now()),[u.NetworkParam.SessionID]:yield c.SessionID.get(i.sdkKey)},i.params);var t=Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return i.url+(t?"?"+t:"")})}Et(s){return r(this,void 0,void 0,function*(){var{data:t,sdkKey:e}=s,i=yield d.StableID.get(e),n=yield c.SessionID.get(e),e=l.SDKType.Y(e);return JSON.stringify($P($P({},t),{statsigMetadata:$P($P({},h.StatsigMetadataProvider.get()),{stableID:i,sessionID:n,sdkType:e})}))})}Rt(t,e){var i,n,s=(0,a.Gt)();if(!t.isStatsigEncodable||this.p.disableStatsigEncoding||null!=(0,o.i)("no-encode")||null==s||!s.btoa)return e;try{var r=null!=(i=s.btoa(e).split("").reverse().join(""))?i:e;return t.params=$P($P({},null!=(n=t.params)?n:{}),{[u.NetworkParam.StatsigEncoded]:"1"}),r}catch(t){return y.Log.warn("/initialize request encoding failed"),e}}};const g=t=>!!t.sdkKey||(y.Log.warn("Unable to make request without an SDK key"),!1)},264:(t,e)=>{$Q(e)},648:(t,e)=>{$Q(e)},360:(t,e)=>{$Q(e),e.SDKType=void 0;const i={};let n;e.SDKType={Y:t=>{return(null!=(t=i[t])?t:"js-mono")+(null!==n&&void 0!==n?n:"")},Ut(t,e){i[t]=e},Lt(t){n&&"-react"!==n||(n="-"+t)}}},48:(t,n)=>{$Q2(n,"__esModule",{value:!0}),n.At=n.Kt=n.Ft=n.Mt=n.qt=n.Gt=void 0;n.Gt=()=>"undefined"!=typeof window?window:null,n.qt=()=>{var t=(0,n.Gt)();return null!=(t=null==t?void 0:t.document)?t:null},n.Mt=()=>null!=(0,n.qt)(),n.Ft=(t,e)=>{var i=(0,n.Gt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.Kt=(t,e)=>{var i=(0,n.qt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)};n.At=()=>{var t;try{return null==(t=(0,n.Gt)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},612:function(t,e,i){var o=this&&this.__awaiter||$A();$Q(e),e.StatsigSession=e.SessionID=void 0;const n=i(707),u=i(780),l=i(444),a=i(556),c=18e5,d=144e5,h={};function v(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function f(t){return"statsig.session_id."+(0,n.u)(t)}e.SessionID={get:t=>o(void 0,void 0,void 0,function*(){return e.StatsigSession.get(t).then(t=>t.data.sessionID)})},e.StatsigSession={get:r=>o(void 0,void 0,void 0,function*(){null==h[r]&&(h[r]=function(i){return o(this,void 0,void 0,function*(){let t=yield function(t){t=f(t);return(0,l.F)(t)}(i);var e=Date.now();return{data:t=t||{sessionID:(0,a.getUUID)(),startTime:e,lastUpdate:e},sdkKey:i}})}(r));var t=yield h[r],e=Date.now(),i=t.data,n=((function({lastUpdate:t}){return Date.now()-t>c}(i)||function({startTime:t}){return Date.now()-t>d}(i))&&(i.sessionID=(0,a.getUUID)(),i.startTime=e),i.lastUpdate=e,i),s=t.sdkKey;return s=f(s),(0,l.J)(s,n).catch(()=>{u.Log.warn("Failed to save SessionID")}),clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=i.startTime,i=t.sdkKey,t.idleTimeoutID=v(i,c),t.ageTimeoutID=v(i,d-e),t}),overrideInitialSessionID:(t,e)=>{var i;h[e]=(t=t,e=e,i=Date.now(),Promise.resolve({data:{sessionID:t,startTime:i,lastUpdate:i},sdkKey:e}))}}},604:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StableID=void 0;const s=i(707),r=i(780),o=i(444),u=i(556),l={};function a(t){return"statsig.stable_id."+(0,s.u)(t)}function c(t,e){e=a(e);(0,o.J)(e,t).catch(()=>{r.Log.warn("Failed to save StableID")})}e.StableID={get:e=>n(void 0,void 0,void 0,function*(){return null==l[e]&&(l[e]=function(t){t=a(t);return(0,o.F)(t)}(e).then(t=>{return null!=t||c(t=(0,u.getUUID)(),e),t})),l[e]}),setOverride:(t,e)=>{l[e]=Promise.resolve(t),c(t,e)}}},688:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,i(496);const o=i(496),u=i(512),l=i(728),a=i(780),c=i(48),d=i(612),h=i(444);e.StatsigClientBase=class{constructor(t,e,i,n){this.loadingStatus="Uninitialized",this.zt={};var s,r=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(a.Log.level=n.logLevel),null!=n&&n.disableStorage&&h.Storage.Jt(!0),null!=n&&n.initialSessionID&&d.StatsigSession.overrideInitialSessionID(n.initialSessionID,t),this.S=t,this.p=null!=n?n:{},this.Vt=null!=(s=null==n?void 0:n.overrideAdapter)?s:null,this.Bt=new l.EventLogger(t,r,i,n),this.$t=new u.ErrorBoundary(t,n,r),this.$t.wrap(this),this.$t.wrap(i),this.$t.wrap(e),this.$t.wrap(this.Bt),(0,c.Mt)()&&(null!=(i=null!=(r=(s=(0,o.o)()).instances)?r:{})[t]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),i[t]=this,s.lastInstance=this,s.instances=i,__STATSIG__=s),this.dataAdapter=e,this.dataAdapter.attach(t,n),this.Ht()}updateRuntimeOptions(t){null!=t.disableLogging&&(this.p.disableLogging=t.disableLogging,this.Bt.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.p.disableStorage=t.disableStorage,h.Storage.Jt(t.disableStorage))}flush(){return this.Bt.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),yield this.Bt.shutdown()})}on(t,e){this.zt[t]||(this.zt[t]=[]),this.zt[t].push(e)}off(t,e){this.zt[t]&&-1!==(e=this.zt[t].indexOf(e))&&this.zt[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(i){var t;const e=e=>{try{e(i)}catch(t){!0===e.__isInternal?this.$t.logError("__emit:"+i.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",i)}};this.zt[i.name]&&this.zt[i.name].forEach(t=>e(t)),null!=(t=this.zt["*"])&&t.forEach(e)}Wt(t,e){this.loadingStatus=t,this.$emt({name:"values_updated",status:t,values:e})}Yt(t,e,i){!0===(null==i?void 0:i.disableExposureLog)?this.Bt.incrementNonExposureCount(t):this.Bt.enqueue(e)}}},808:(t,e)=>{$Q(e)},283:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},876:(t,e)=>{$Q(e),e.Qt=e.Xt=e.Zt=e.yt=void 0;const i="statsig::config_exposure",n="statsig::gate_exposure",l=(t,e,i,n,s)=>({eventName:t,user:e,value:null,metadata:r(i,n),secondaryExposures:s,time:Date.now()});e.yt=({eventName:t})=>t===n||t===i,e.Zt=(t,e)=>{return l(n,t,e.details,{gate:e.name,gateValue:String(e.value),ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])},e.Xt=(t,e)=>{return l(i,t,e.details,{config:e.name,ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])};e.Qt=(t,e,i)=>{var n,s=e.__evaluation,r=!0===(null==(r=null==s?void 0:s.explicit_parameters)?void 0:r.includes(i));let o="",u=null!=(n=null==s?void 0:s.undelegated_secondary_exposures)?n:[];return r&&(o=null!=(n=s.allocated_experiment_name)?n:"",u=s.secondary_exposures),l("statsig::layer_exposure",t,e.details,{config:e.name,parameterName:i,ruleID:e.ruleID,allocatedExperiment:o,isExplicitParameter:String(r)},u)};const r=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},972:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="1.3.0";let i={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>i,add:t=>{i=$P($P({},i),t)}}},384:(t,e)=>{$Q(e)},396:(t,e)=>{$Q(e),e.te=e.ee=e.ie=e.ne=e.se=e.re=e.oe=e.ue=void 0;const s="default";function r(t,e,i,n){return{name:t,details:e,ruleID:null!=(t=null==i?void 0:i.rule_id)?t:s,__evaluation:i,value:n}}function n(t,e,i){var n=null!=(n=null==i?void 0:i.value)?n:{};return $P($P({},r(t,e,i,n)),{get:u(null==i?void 0:i.value)})}function o(t,e){var i=t=>Array.isArray(t)?"array":typeof t;return i(t)===i(e)}function u(n,s){return(t,e)=>{var i=null!=(i=null==n?void 0:n[t])?i:null;return null!=i&&(null==e||o(i,e))?(null!=s&&s(t),i):null!=e?e:null}}e.ue=function(t,e,i){return r(t,e,i,!0===(null==i?void 0:i.value))},e.oe=n,e.re=function(t,e,i){return t=n(t,e,i),$P($P({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.se=function(t,e,i,n){return $P($P({},r(t,e,i,void 0)),{get:u(null==i?void 0:i.value,n),groupName:null!=(t=null==i?void 0:i.group_name)?t:null,__value:null!=(e=null==i?void 0:i.value)?e:{}})},e.ne=function(t,e,i,n){return $P($P($P({},t),e),{get:u(i,n)})},e.ie=function(t){return Array.isArray(t)?"array":typeof t},e.ee=o,e.te=u},136:(t,e)=>{$Q(e)},296:(t,e,i)=>{$Q(e),e.v=e.A=void 0;const n=i(832),s=i(780);e.A=function(t,e){try{var i=JSON.parse(JSON.stringify(t));return null!=e&&(i.statsigEnvironment=e),i}catch(t){return s.Log.error("Failed to JSON.stringify user"),{}}},e.v=function(t){return t?(0,n.xt)(t):null}},444:function(t,i,e){var n=this&&this.__awaiter||$A(),s=($Q2(i,"__esModule",{value:!0}),i.J=i.F=i.Storage=void 0,e(780)),e=e(48);const r={},o=t=>Promise.resolve(t),u={le:()=>"InMemory",U:t=>r[t]||null,ae:t=>o(r[t]||null),L:(t,e)=>(r[t]=e,o()),q:t=>(delete r[t],o()),ce:()=>o(Object.keys(r))};let l=null;try{const h=(0,e.Gt)();h&&h.localStorage&&"function"==typeof h.localStorage.getItem&&(l={le:()=>"LocalStorage",U:t=>h.localStorage.getItem(t),ae:t=>o(h.localStorage.getItem(t)),L:(t,e)=>(h.localStorage.setItem(t,e),o()),q:t=>(h.localStorage.removeItem(t),o()),ce:()=>o(Object.keys(h.localStorage))})}catch(t){s.Log.warn("Failed to setup localStorageProvider.")}let a=null!==l&&void 0!==l?l:u,c=a;function d(t){try{return t()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return i.Storage.he(u),null;throw t}}i.Storage={le:()=>c.le(),ae:t=>n(void 0,void 0,void 0,function*(){return d(()=>c.ae(t))}),U:t=>d(()=>c.U?c.U(t):null),L:(t,e)=>c.L(t,e),q:t=>c.q(t),ce:()=>c.ce(),he:t=>{a=t,c=t},Jt:t=>{c=t?u:a}},i.F=function(e){return n(this,void 0,void 0,function*(){var t=yield i.Storage.ae(e);return JSON.parse(null!=t?t:"null")})},i.J=function(t,e){return n(this,void 0,void 0,function*(){yield i.Storage.L(t,JSON.stringify(e))})}},412:(t,e,i)=>{$Q(e),e.C=void 0;const s=i(780);e.C=function(t,e,i){try{var n=JSON.parse(t);return"object"==typeof n&&0 in n,n}catch(t){}return s.Log.error("Failed to parse "+i),null}},556:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let i=(new Date).getTime(),n="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0{$Q(e),e.ut=void 0,e.ut=function(t,e,i,n){return t||(e?""+e+i:""+n+i)}},539:(t,e)=>{$Q(e)},100:(t,e,i)=>{$Q(e),e.de=e.lt=e.Pt=e.Ot=void 0;i=i(48);const n="foreground",s="background",r=[];let o=n,u=!1;e.Ot=()=>o===n,e.Pt=()=>u,e.lt=t=>{r.unshift(t)};e.de=e=>{e!==o&&(o=e,r.forEach(t=>t(e)))},(0,i.Ft)("focus",()=>{(u=!1,e.de)(n)}),(0,i.Ft)("blur",()=>(0,e.de)(s)),(0,i.Ft)("beforeunload",()=>{u=!0,(0,e.de)(s)}),(0,i.Kt)("visibilitychange",()=>{(0,e.de)("visible"===document.visibilityState?n:s)})},464:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};$Q(e),e.Log=e.Storage=e.EventLogger=void 0,i(496);const r=i(728),o=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return r.EventLogger}}),i(780));$Q2(e,"Log",{enumerable:!0,get:function(){return o.Log}});var u=i(972);const l=i(444);$Q2(e,"Storage",{enumerable:!0,get:function(){return l.Storage}}),s(i(496),e),s(i(707),e),s(i(856),e),s(i(320),e),s(i(184),e),s(i(512),e),s(i(500),e),s(i(788),e),s(i(832),e),s(i(664),e),s(i(780),e),s(i(188),e),s(i(716),e),s(i(264),e),s(i(648),e),s(i(48),e),s(i(360),e),s(i(612),e),s(i(604),e),s(i(688),e),s(i(808),e),s(i(283),e),s(i(876),e),s(i(972),e),s(i(384),e),s(i(396),e),s(i(136),e),s(i(296),e),s(i(444),e),s(i(412),e),s(i(84),e),s(i(539),e),s(i(556),e),s(i(100),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:o.Log,SDK_VERSION:u.SDK_VERSION})},696:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};$Q(e),s(i(208),e),e.default=__STATSIG__},96:(t,e,i)=>{$Q(e),e.ve=void 0;const n=i(464);function s(t,e){null!=t&&t.forEach(t=>{delete e[t]})}e.ve=function(t,e){var i;return(e=(0,n.C)(e,"checksum","DeltasEvaluationResponse"))?(t=t,i=e,t=$P($P($P({},t),i),{feature_gates:$P($P({},t.feature_gates),i.feature_gates),layer_configs:$P($P({},t.layer_configs),i.layer_configs),dynamic_configs:$P($P({},t.dynamic_configs),i.dynamic_configs)}),s((t=i=t).deleted_gates,t.feature_gates),delete t.deleted_gates,s(i.deleted_configs,t.dynamic_configs),delete t.deleted_configs,s(i.deleted_layers,t.layer_configs),delete t.deleted_layers,i=t,(t=(0,n.xt)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs}))===e.checksum?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:t,badMergedConfigs:i,badFullResponse:e.deltas_full_response}):{hadBadDeltaChecksum:!0}}},536:(t,e,i)=>{$Q(e);const n=i(464);e.default=class{constructor(){this._e=null,this.fe=null,this.ge="Uninitialized",this.be=0,this.ye=0}reset(){this.fe=null,this._e=null,this.ge="Loading",this.be=0,this.ye=0}finalize(){this.fe||(this.ge="NoValues")}getValues(){return this._e?(0,n.C)(this._e,"has_updates","EvaluationStoreValues"):null}setValues(t){var e;t&&!0===(null==(e=(0,n.C)(t.data,"has_updates","EvaluationResponse"))?void 0:e.has_updates)&&(this._e=t.data,this.be=e.time,this.ye=t.receivedAt,this.ge=t.source,this.fe=e)}getGate(t){var e;return this.me(null==(e=this.fe)?void 0:e.feature_gates,t)}getConfig(t){var e;return this.me(null==(e=this.fe)?void 0:e.dynamic_configs,t)}getLayer(t){var e;return this.me(null==(e=this.fe)?void 0:e.layer_configs,t)}getParamStore(t){var e;return this.me(null==(e=this.fe)?void 0:e.param_stores,t)}me(t,e){let i=null;return{result:i=t?t[e]||t[(0,n.h)(e)]:i,details:this.pe(null==i)}}pe(t){return"Uninitialized"===this.ge||"NoValues"===this.ge?{reason:this.ge}:{reason:this.ge+":"+(t?"Unrecognized":"Recognized"),lcut:this.be,receivedAt:this.ye}}}},400:function(t,e,i){var o=this&&this.__awaiter||$A();$Q(e);const u=i(464),l=i(96);class n extends u.NetworkCore{constructor(t,e){super(t,e);e=null==t?void 0:t.networkConfig;this.Se=(0,u.ut)(null==e?void 0:e.initializeUrl,null==e?void 0:e.api,"/initialize",u.NetworkDefault.initializeApi)}fetchEvaluations(i,n,s,r){return o(this,void 0,void 0,function*(){var t=n?(0,u.C)(n,"has_updates","InitializeResponse"):null;let e={user:r,hash:"djb2",deltasResponseRequested:!1};return null!=t&&t.has_updates&&(e=$P($P({},e),{sinceTime:t.time,previousDerivedFields:"derived_fields"in t?t.derived_fields:{},deltasResponseRequested:!0})),this.Oe(i,t,e,s)})}Oe(e,i,n,s){var r;return o(this,void 0,void 0,function*(){var t=yield this.post({sdkKey:e,url:this.Se,data:n,retries:2,isStatsigEncodable:!0,priority:s});return 204===(null==t?void 0:t.code)?'{"has_updates": false}':200!==(null==t?void 0:t.code)?null!=(r=null==t?void 0:t.body)?r:null:!0!==(null==i?void 0:i.has_updates)||!0!==(null==(r=t.body)?void 0:r.includes('"is_delta":true'))?t.body:"string"==typeof(t=(0,l.ve)(i,t.body))?t:this.Oe(e,i,$P($P($P({},n),t),{deltasResponseRequested:!1}),s)})}}e.default=n},340:(t,e,i)=>{$Q(e),e.je=void 0;const y=i(464),b={disableExposureLog:!0};function g(t){return null==t||!1===t.disableExposureLog}function p(t,e){return null!=e&&!(0,y.ee)(t,e)}e.je=function(v,f,_){return(t,e)=>{if(null==f)return e;var i,n,s,r,o,u,l,a,c,d,h=f[t];if(null==h||null!=e&&(0,y.ie)(e)!==h.param_type)return e;switch(h.ref_type){case"static":return h.value;case"gate":return d=h,v.getFeatureGate(d.gate_name,g(_)?void 0:b).value?d.pass_value:d.fail_value;case"dynamic_config":return d=h,l=e,a=_,p(c=(u=v).getDynamicConfig(d.config_name,b).get(d.param_name),l)?l:(g(a)&&u.getDynamicConfig(d.config_name),c);case"experiment":return l=h,a=e,u=_,p(o=(c=v).getExperiment(l.experiment_name,b).get(l.param_name),a)?a:(g(u)&&c.getExperiment(l.experiment_name),o);case"layer":return o=h,n=e,s=_,p(r=(i=v).getLayer(o.layer_name,b).get(o.param_name),n)?n:(g(s)&&i.getLayer(o.layer_name).get(o.param_name),r);default:return e}}}},520:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e);const o=i(464),r=i(536),u=i(400),l=i(340),a=i(364);class n extends o.StatsigClientBase{static instance(t){var e=(0,o.o)().instance(t);return e instanceof n?e:(o.Log.warn((0,o.Mt)()?"Unable to find StatsigClient instance":"StatsigClient.instance is not supported in server environments"),new n(null!=t?t:"",{}))}constructor(t,e,i=null){o.SDKType.Ut(t,"javascript-client");var n=new u.default(i,t=>{this.$emt(t)});super(t,null!=(t=null==i?void 0:i.dataAdapter)?t:new a.StatsigEvaluationsDataAdapter,n,i),this.Te=new r.default,this.we=e}initializeSync(){this.updateUserSync(this.we)}initializeAsync(t){return this.updateUserAsync(this.we,t)}updateUserSync(t){this.Ie(t);t=this.dataAdapter.getDataSync(this.we);this.Te.setValues(t),this.Ae(t),this.Me(null!=t?t:null,this.we)}updateUserAsync(i,n){return s(this,void 0,void 0,function*(){this.Ie(i);var t=this.we,e=this.dataAdapter.getDataSync(t);this.Wt("Loading",e),this.Te.setValues(e),e=yield this.dataAdapter.getDataAsync(e,t,n),t===this.we&&(this.Te.setValues(e),this.Ae(e))})}getContext(){return{sdkKey:this.S,options:this.p,values:this.Te.getValues(),user:JSON.parse(JSON.stringify(this.we)),errorBoundary:this.$t}}getAsyncContext(){return s(this,void 0,void 0,function*(){return $P($P({},this.getContext()),{session:yield o.StatsigSession.get(this.S),stableID:yield o.StableID.get(this.S)})})}checkGate(t,e){return this.getFeatureGate(t,e).value}getFeatureGate(t,e){var{result:i,details:n}=this.Te.getGate(t),n=(0,o.ue)(t,n,i),s=null==(s=null==(i=this.Vt)?void 0:i.getGateOverride)?void 0:s.call(i,n,this.we,e),i=null!=s?s:n;return this.Yt(t,(0,o.Zt)(this.we,i),e),this.$emt({name:"gate_evaluation",gate:i}),i}getDynamicConfig(t,e){var{result:i,details:n}=this.Te.getConfig(t),n=(0,o.oe)(t,n,i),s=null==(s=null==(i=this.Vt)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,n,this.we,e),i=null!=s?s:n;return this.Yt(t,(0,o.Xt)(this.we,i),e),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}getExperiment(t,e){var{result:i,details:n}=this.Te.getConfig(t),n=(0,o.re)(t,n,i),s=null==(s=null==(i=this.Vt)?void 0:i.getExperimentOverride)?void 0:s.call(i,n,this.we,e),i=null!=s?s:n;return this.Yt(t,(0,o.Xt)(this.we,i),e),this.$emt({name:"experiment_evaluation",experiment:i}),i}getLayer(e,i){var{result:t,details:n}=this.Te.getLayer(e),n=(0,o.se)(e,n,t),s=null==(s=null==(t=this.Vt)?void 0:t.getLayerOverride)?void 0:s.call(t,n,this.we,i);const r=(0,o.ne)(n,s,null!=(t=null==s?void 0:s.__value)?t:n.__value,t=>{this.Yt(e,(0,o.Qt)(this.we,r,t),i)});return this.$emt({name:"layer_evaluation",layer:r}),r}getParameterStore(t,e){var{result:i,details:n}=this.Te.getParamStore(t);return this.Bt.incrementNonExposureCount(t),{name:t,details:n,__configuration:i,get:(0,l.je)(this,i,e)}}logEvent(t,e,i){this.Bt.enqueue($P($P({},"string"==typeof t?{eventName:t,value:e,metadata:i}:t),{user:this.we,time:Date.now()}))}Ht(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Ae(null)})}Ae(t){this.Te.finalize(),this.Wt("Ready",t)}Me(t,e){this.dataAdapter.getDataAsync(t,e,{priority:"low"}).catch(t=>{o.Log.error("An error occurred after update.",t)})}Ie(t){this.Bt.reset(),this.Te.reset(),this.we=(0,o.A)(t,this.p.environment);t=null==(t=this.we.customIDs)?void 0:t.stableID;t&&o.StableID.setOverride(t,this.S)}}e.default=n},364:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigEvaluationsDataAdapter=void 0;const n=i(464),s=i(400);class o extends n.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this.X=null,this.p=null}attach(t,e){super.attach(t,e),this.X=new s.default(null!=e?e:{})}getDataAsync(t,e,i){return this.M(t,e,i)}prefetchData(t,e){return this.D(t,e)}setData(t){var e=(0,n.C)(t,"has_updates","data");e&&"user"in e?super.setData(t,e.user):n.Log.error("StatsigUser not found")}setDataLegacy(t,e){super.setData(t,e)}N(e,i,n){var s;return r(this,void 0,void 0,function*(){var t=yield null==(s=this.X)?void 0:s.fetchEvaluations(this.P(),e,null==n?void 0:n.priority,i);return null!=t?t:null})}T(t){t=(0,n.u)(this.P(),t,null==(t=this.p)?void 0:t.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this.m}.`+t}R(t,e){return null!=t.fullUserHash&&t.fullUserHash===(0,n.v)(e)}}e.StatsigEvaluationsDataAdapter=o},208:(t,e,i)=>{$Q(e),e.StatsigClient=void 0;i=i(520);e.StatsigClient=i.default,__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigClient:i.default}),e.default=__STATSIG__}},n={};function s(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[t].call(e.exports,e,e.exports,s)),e.exports}return s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s(696).default})()); \ No newline at end of file diff --git a/samples/web-minified/src/assets/statsig-js-on-device-eval-client.min.js b/samples/web-minified/src/assets/statsig-js-on-device-eval-client.min.js index 151c17c3..cc07a79f 100644 --- a/samples/web-minified/src/assets/statsig-js-on-device-eval-client.min.js +++ b/samples/web-minified/src/assets/statsig-js-on-device-eval-client.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Statsig=e():t.Statsig=e()}(this,()=>(()=>{"use strict";var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});var n={496:(t,n,e)=>{$Q2(n,"__esModule",{value:!0}),n.t=n.i=n.o=void 0,n.o=()=>__STATSIG__||o,n.i=t=>(0,n.o)()[t];n.t=t=>{var e=(0,n.o)();return t?e.instances&&e.instances[t]:e.lastInstance};var i,r="__STATSIG__",s="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},u="undefined"!=typeof globalThis?globalThis:{};const o=null!=(i=null!=(i=null!=(i=s[r])?i:e[r])?i:u[r])?i:{instance:n.t};s[r]=o,e[r]=o,u[r]=o},707:(t,e,n)=>{$Q(e),e.u=e.l=void 0;const r=n(832);function i(t,e,n){if(n)return n(t,e);const i=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(n=null==e?void 0:e.userID)?n:""),"cids:"+Object.keys(i).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+i[t]).join(","),"k:"+t];return(0,r.h)(e.join("|"))}e.l=i,e.u=function(t,e,n){return e?i(t,e,n):(0,r.h)("k:"+t)}},856:(t,e)=>{$Q(e)},320:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const l=n(780),a=n(604),s=n(296),u=n(444),c=n(412);function h(t,e,n,i){return{source:t,data:e,receivedAt:Date.now(),stableID:n,fullUserHash:(0,s.v)(i)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.m=e,this.p=null,this.S=null,this.O="statsig.last_modified_time."+e,this.j=new i}attach(t,e){this.S=t,this.p=e}getDataSync(t){var e=this.T(t),n=this.j.get(e,t);return n||((n=this.I(e))?(this.j.add(e,n),this.j.get(e,t)):null)}setData(t,e){var e=e&&(0,s.A)(e,null==(e=this.p)?void 0:e.environment),n=this.T(e);this.j.add(n,h("Bootstrap",t,null,e))}__primeInMemoryCache(t){this.j.merge(t)}M(e,n,i){return r(this,void 0,void 0,function*(){var t=null!=e?e:this.getDataSync(n),t=[this.k(t,n,i)];return null!=i&&i.timeoutMs&&t.push(new Promise(t=>setTimeout(t,i.timeoutMs)).then(()=>(l.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}D(n,i){return r(this,void 0,void 0,function*(){var t=this.T(n),e=yield this.M(null,n,i);e&&this.j.add(t,$P($P({},e),{source:"Prefetch"}))})}k(s,u,o){return r(this,void 0,void 0,function*(){let t=null;s&&this.R(s,u)&&(t=s.data);var e=yield this.N(t,u,o);if(!e)return l.Log.debug("No response returned for latest value"),null;var n=(0,c.C)(e,"has_updates","Response"),i=this.P(),i=yield a.StableID.get(i);let r=null;if(!0===(null==n?void 0:n.has_updates))r=h("Network",e,i,u);else{if(!t||!1!==(null==n?void 0:n.has_updates))return null;r=h("NetworkNotModified",t,i,u)}e=this.T(u);return this.j.add(e,r),yield this.G(e,r),r})}P(){return null!=this.S?this.S:(l.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=u.Storage.U)?void 0:e.call(u.Storage,t);return null!=e&&(t=(0,c.C)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}G(t,e){return r(this,void 0,void 0,function*(){yield u.Storage.L(t,JSON.stringify(e)),yield this.K(t)})}K(n){var i;return r(this,void 0,void 0,function*(){var t=null!=(i=yield(0,u.F)(this.O))?i:{},e=(t[n]=Date.now(),o(t,10));e&&(delete t[e],yield u.Storage.q(e)),yield(0,u.J)(this.O,t)})}};class i{constructor(){this.V={}}get(t,e){var t=this.V[t],n=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&n&&e!==n?(l.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var n=o(this.V,9);n&&delete this.V[n],this.V[t]=e}merge(t){this.V=$P($P({},this.V),t)}}function o(r,t){var e=Object.keys(r);return e.length<=t?null:e.reduce((t,e)=>{var n=r[t],i=r[e];return"object"==typeof n&&"object"==typeof i?i.receivedAt{$Q(e),e.Diagnostics=void 0;e.Diagnostics=class{static mark(){}}},184:(t,e)=>{$Q(e)},512:function(t,o,e){var n=this&&this.__awaiter||$A();$Q2(o,"__esModule",{value:!0}),o.ErrorBoundary=o.EXCEPTION_ENDPOINT=void 0;const i=e(780),l=e(360),a=e(972),c=(o.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");o.ErrorBoundary=class{constructor(t,e,n){this.S=t,this.p=e,this.B=n,this.$=new Set}wrap(i){try{const t=i;!function(t){const e=new Set;let n=Object.getPrototypeOf(t);for(;n&&n!==Object.prototype;)Object.getOwnPropertyNames(n).filter(t=>"function"==typeof(null===n||void 0===n?void 0:n[t])).forEach(t=>e.add(t)),n=Object.getPrototypeOf(n);return Array.from(e)}(t).forEach(e=>{const n=t[e];"$EB"in n||(t[e]=(...t)=>this.H(e,()=>n.apply(i,t)),t[e].$EB=!0)})}catch(t){this.W("eb:wrap",t)}}logError(t,e){this.W(t,e)}H(e,t){try{var n=t();return n&&n instanceof Promise?n.catch(t=>this.W(e,t)):n}catch(t){return this.W(e,t),null}}W(s,u){try{i.Log.warn("Caught error in "+s,{error:u});n(this,void 0,void 0,function*(){var t,e,n=u||Error(c),i=n instanceof Error,r=i?n.name:"No Name";this.$.has(r)||(this.$.add(r),null!=(t=null==(t=this.p)?void 0:t.networkConfig)&&t.preventAllNetworkTraffic?null!=(t=this.B)&&t.call(this,{name:"error",error:u}):(t=l.SDKType.Y(this.S),e=a.StatsigMetadataProvider.get(),i=i?n.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(n),n=JSON.stringify($P({tag:s,exception:r,info:i},$P($P({},e),{sdkType:t}))),yield(null!=(r=null==(i=null==(r=this.p)?void 0:r.networkConfig)?void 0:i.networkOverrideFunc)?r:fetch)(o.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.S,"STATSIG-SDK-TYPE":String(t),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:n}),null!=(i=this.B)&&i.call(this,{name:"error",error:u})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},500:(t,e)=>{$Q(e)},788:(t,e)=>{$Q(e)},728:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const r=n(832),s=n(780),u=n(716),o=n(48),l=n(876),a=n(444),c=n(84),h=n(100),d={},v=t=>{null!=(t=d[t])&&t.flush().catch(()=>{})};e.EventLogger=class{constructor(e,t,n,i){this.S=e,this.B=t,this.X=n,this.p=i,this.Z=[],this.tt={},this.et={},this.it=!1,this.nt=Date.now(),(d[e]=this).st=!0===(null==i?void 0:i.disableLogging),this.rt=null!=(t=null==i?void 0:i.loggingBufferMaxSize)?t:50;n=null==i?void 0:i.networkConfig;this.ot=(0,c.ut)(null==n?void 0:n.logEventUrl,null==n?void 0:n.api,"/rgstr",u.NetworkDefault.eventsApi),(0,h.lt)(t=>{"background"===t&&v(e)}),this.ct(),this.ht()}setLoggingDisabled(t){this.st=t}enqueue(t){this.dt(t)&&(this.vt(t),this._t(),this.Z.length>this.rt)&&v(this.S)}incrementNonExposureCount(t){var e=null!=(e=this.et[t])?e:0;this.et[t]=e+1}reset(){this.tt={}}shutdown(){return i(this,void 0,void 0,function*(){this.ft&&(clearInterval(this.ft),this.ft=null),yield this.flush()})}flush(){return i(this,void 0,void 0,function*(){var t;if(this.gt(),0!==this.Z.length)return t=this.Z,this.Z=[],this.bt(t)})}_t(){this.it||(this.it=!0,200v(this.S),200)}dt(t){if((0,l.yt)(t)){var e=t.user||{},n=t.metadata||{},t=[t.eventName,e.userID,n.gate,n.config,n.ruleID].join("|"),e=this.tt[t],n=Date.now();if(e&&n-e<6e4)return!1;1e3{s.Log.warn("Unable to save failed logs to storage")})}ct(){const e=this.u();i(this,void 0,void 0,function*(){var t=yield(0,a.F)(e);t&&(yield a.Storage.q(e),yield this.bt(t))}).catch(()=>{s.Log.warn("Failed to flush stored logs")})}u(){return"statsig.failed_logs."+(0,r.h)(this.S)}vt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},n=this.It(),n=(n&&(e.statsigMetadata={currentPage:n}),$P($P({},t),e));s.Log.debug("Enqueued Event:",n),this.Z.push(n)}gt(){0!==Object.keys(this.et).length&&(this.vt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.et)}}),this.et={})}It(){var t;if(!1!==(null==(t=this.p)?void 0:t.includeCurrentPageUrlWithEvents))return(0,o.At)()}ht(){if((0,o.Mt)()){var t=null!=(t=null==(t=this.p)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{d[this.S].ft!==e?clearInterval(e):v(this.S)},t);this.ft=e}}}},832:(t,e)=>{$Q(e),e.xt=e.h=void 0;e.h=e=>{let n=0;for(let t=0;t>>0)};e.xt=t=>(0,e.h)(JSON.stringify(r(t)));const r=n=>{if(null==n)return null;var t=Object.keys(n).sort();const i={};return t.forEach(t=>{let e=n[t];!Array.isArray(e)&&e instanceof Object&&(e=r(e)),i[t]=e}),i}},664:(t,e)=>{$Q(e)},780:(t,e)=>{function n(t){return t.unshift("[Statsig]"),t}var i,r;$Q(e),e.Log=e.LogLevel=void 0,(r=i||(e.LogLevel=i={}))[r.None=0]="None",r[r.Error=1]="Error",r[r.Warn=2]="Warn",r[r.Info=3]="Info",r[r.Debug=4]="Debug";class s{static info(...t){this.level>=i.Info&&console.info(...n(t))}static debug(...t){this.level>=i.Debug&&console.debug(...n(t))}static warn(...t){this.level>=i.Warn&&console.warn(...n(t))}static error(...t){this.level>=i.Error&&console.error(...n(t))}}(e.Log=s).level=i.Error},716:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=void 0,e.NetworkDefault={eventsApi:"https://prodregistryv2.org/v1",initializeApi:"https://featureassets.org/v1",specsApi:"https://assetsconfigcdn.org/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},188:function(t,e,n){var s=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,n(496);const u=n(496),f=n(280),p=n(780),o=n(716),l=n(360),a=n(48),c=n(612),h=n(604),d=n(972),g=n(100);e.NetworkCore=class{constructor(t,e){this.B=e,this.kt=1e4,this.Dt={},this.p={},t&&(this.p=t),this.p.networkConfig&&(this.Dt=this.p.networkConfig),this.Dt.networkTimeoutMs&&(this.kt=this.Dt.networkTimeoutMs)}post(e){return s(this,void 0,void 0,function*(){let t=yield this.Et(e);return e.isStatsigEncodable&&(t=this.Rt(e,t)),this.Nt($P({method:"POST",body:t},e))})}get(t){return this.Nt($P({method:"GET"},t))}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}beacon(i){return s(this,void 0,void 0,function*(){var t,e,n;return!!y(i)&&(t=yield this.Et(i),e=yield this.Ct(i),(n=navigator).sendBeacon.bind(n)(e,t))})}Nt(d){var v,_;return s(this,void 0,void 0,function*(){if(!y(d))return null;if(this.Dt.preventAllNetworkTraffic)return null;var{method:e,body:n,retries:i}=d;const r="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>null===r||void 0===r?void 0:r.abort(`Timeout of ${this.kt}ms expired.`),this.kt),s=yield this.Ct(d),u=null,o=(0,g.Pt)();try{var l,a,c,h={method:e,body:n,headers:$P({},d.headers),signal:null===r||void 0===r?void 0:r.signal,priority:d.priority,keepalive:o},u=yield(null!=(v=this.Dt.networkOverrideFunc)?v:fetch)(s,h);if(clearTimeout(t),u.ok)return c=yield u.text(),f.Diagnostics.mark(),{body:c,code:u.status};throw l=yield u.text().catch(()=>"No Text"),(a=new Error(`NetworkError: ${s} `+l)).name="NetworkError",a}catch(t){n=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(r,t);return f.Diagnostics.mark(),!i||i<=0?(null!=(_=this.B)&&_.call(this,{name:"error",error:t}),p.Log.error(`A networking error occured during ${e} request to ${s}.`,n,t),null):this.Nt($P($P({},d),{retries:i-1}))}})}Ct(n){return s(this,void 0,void 0,function*(){const e=$P({[o.NetworkParam.SdkKey]:n.sdkKey,[o.NetworkParam.SdkType]:l.SDKType.Y(n.sdkKey),[o.NetworkParam.SdkVersion]:d.SDK_VERSION,[o.NetworkParam.Time]:String(Date.now()),[o.NetworkParam.SessionID]:yield c.SessionID.get(n.sdkKey)},n.params);var t=Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return n.url+(t?"?"+t:"")})}Et(r){return s(this,void 0,void 0,function*(){var{data:t,sdkKey:e}=r,n=yield h.StableID.get(e),i=yield c.SessionID.get(e),e=l.SDKType.Y(e);return JSON.stringify($P($P({},t),{statsigMetadata:$P($P({},d.StatsigMetadataProvider.get()),{stableID:n,sessionID:i,sdkType:e})}))})}Rt(t,e){var n,i,r=(0,a.Gt)();if(!t.isStatsigEncodable||this.p.disableStatsigEncoding||null!=(0,u.i)("no-encode")||null==r||!r.btoa)return e;try{var s=null!=(n=r.btoa(e).split("").reverse().join(""))?n:e;return t.params=$P($P({},null!=(i=t.params)?i:{}),{[o.NetworkParam.StatsigEncoded]:"1"}),s}catch(t){return p.Log.warn("/initialize request encoding failed"),e}}};const y=t=>!!t.sdkKey||(p.Log.warn("Unable to make request without an SDK key"),!1)},264:(t,e)=>{$Q(e)},648:(t,e)=>{$Q(e)},360:(t,e)=>{$Q(e),e.SDKType=void 0;const n={};let i;e.SDKType={Y:t=>{return(null!=(t=n[t])?t:"js-mono")+(null!==i&&void 0!==i?i:"")},Ut(t,e){n[t]=e},Lt(t){i&&"-react"!==i||(i="-"+t)}}},48:(t,i)=>{$Q2(i,"__esModule",{value:!0}),i.At=i.Kt=i.Ft=i.Mt=i.qt=i.Gt=void 0;i.Gt=()=>"undefined"!=typeof window?window:null,i.qt=()=>{var t=(0,i.Gt)();return null!=(t=null==t?void 0:t.document)?t:null},i.Mt=()=>null!=(0,i.qt)(),i.Ft=(t,e)=>{var n=(0,i.Gt)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)},i.Kt=(t,e)=>{var n=(0,i.qt)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)};i.At=()=>{var t;try{return null==(t=(0,i.Gt)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},612:function(t,e,n){var u=this&&this.__awaiter||$A();$Q(e),e.StatsigSession=e.SessionID=void 0;const i=n(707),o=n(780),l=n(444),a=n(556),c=18e5,h=144e5,d={};function v(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function _(t){return"statsig.session_id."+(0,i.u)(t)}e.SessionID={get:t=>u(void 0,void 0,void 0,function*(){return e.StatsigSession.get(t).then(t=>t.data.sessionID)})},e.StatsigSession={get:s=>u(void 0,void 0,void 0,function*(){null==d[s]&&(d[s]=function(n){return u(this,void 0,void 0,function*(){let t=yield function(t){t=_(t);return(0,l.F)(t)}(n);var e=Date.now();return{data:t=t||{sessionID:(0,a.getUUID)(),startTime:e,lastUpdate:e},sdkKey:n}})}(s));var t=yield d[s],e=Date.now(),n=t.data,i=((function({lastUpdate:t}){return Date.now()-t>c}(n)||function({startTime:t}){return Date.now()-t>h}(n))&&(n.sessionID=(0,a.getUUID)(),n.startTime=e),n.lastUpdate=e,n),r=t.sdkKey;return r=_(r),(0,l.J)(r,i).catch(()=>{o.Log.warn("Failed to save SessionID")}),clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=n.startTime,n=t.sdkKey,t.idleTimeoutID=v(n,c),t.ageTimeoutID=v(n,h-e),t})}},604:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.StableID=void 0;const r=n(707),s=n(780),u=n(444),o=n(556),l={};function a(t){return"statsig.stable_id."+(0,r.u)(t)}function c(t,e){e=a(e);(0,u.J)(e,t).catch(()=>{s.Log.warn("Failed to save StableID")})}e.StableID={get:e=>i(void 0,void 0,void 0,function*(){return null==l[e]&&(l[e]=function(t){t=a(t);return(0,u.F)(t)}(e).then(t=>{return null!=t||c(t=(0,o.getUUID)(),e),t})),l[e]}),setOverride:(t,e)=>{l[e]=Promise.resolve(t),c(t,e)}}},688:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,n(496);const u=n(496),o=n(512),l=n(728),a=n(780),c=n(48),h=n(444);e.StatsigClientBase=class{constructor(t,e,n,i){this.loadingStatus="Uninitialized",this.zt={};var r,s=this.$emt.bind(this);null!=(null==i?void 0:i.logLevel)&&(a.Log.level=i.logLevel),null!=i&&i.disableStorage&&h.Storage.Jt(!0),this.S=t,this.p=null!=i?i:{},this.Vt=null!=(r=null==i?void 0:i.overrideAdapter)?r:null,this.Bt=new l.EventLogger(t,s,n,i),this.$t=new o.ErrorBoundary(t,i,s),this.$t.wrap(this),this.$t.wrap(n),this.$t.wrap(e),this.$t.wrap(this.Bt),(0,c.Mt)()&&(null!=(n=null!=(s=(r=(0,u.o)()).instances)?s:{})[t]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),n[t]=this,r.lastInstance=this,r.instances=n,__STATSIG__=r),this.dataAdapter=e,this.dataAdapter.attach(t,i),this.Ht()}updateRuntimeOptions(t){null!=t.disableLogging&&(this.p.disableLogging=t.disableLogging,this.Bt.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.p.disableStorage=t.disableStorage,h.Storage.Jt(t.disableStorage))}flush(){return this.Bt.flush()}shutdown(){return i(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),yield this.Bt.shutdown()})}on(t,e){this.zt[t]||(this.zt[t]=[]),this.zt[t].push(e)}off(t,e){this.zt[t]&&-1!==(e=this.zt[t].indexOf(e))&&this.zt[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(n){var t;const e=e=>{try{e(n)}catch(t){!0===e.__isInternal?this.$t.logError("__emit:"+n.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",n)}};this.zt[n.name]&&this.zt[n.name].forEach(t=>e(t)),null!=(t=this.zt["*"])&&t.forEach(e)}Wt(t,e){this.loadingStatus=t,this.$emt({name:"values_updated",status:t,values:e})}Yt(t,e,n){!0===(null==n?void 0:n.disableExposureLog)?this.Bt.incrementNonExposureCount(t):this.Bt.enqueue(e)}}},808:(t,e)=>{$Q(e)},283:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},876:(t,e)=>{$Q(e),e.Qt=e.Xt=e.Zt=e.yt=void 0;const n="statsig::config_exposure",i="statsig::gate_exposure",l=(t,e,n,i,r)=>({eventName:t,user:e,value:null,metadata:s(n,i),secondaryExposures:r,time:Date.now()});e.yt=({eventName:t})=>t===i||t===n,e.Zt=(t,e)=>{return l(i,t,e.details,{gate:e.name,gateValue:String(e.value),ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])},e.Xt=(t,e)=>{return l(n,t,e.details,{config:e.name,ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])};e.Qt=(t,e,n)=>{var i,r=e.__evaluation,s=!0===(null==(s=null==r?void 0:r.explicit_parameters)?void 0:s.includes(n));let u="",o=null!=(i=null==r?void 0:r.undelegated_secondary_exposures)?i:[];return s&&(u=null!=(i=r.allocated_experiment_name)?i:"",o=r.secondary_exposures),l("statsig::layer_exposure",t,e.details,{config:e.name,parameterName:n,ruleID:e.ruleID,allocatedExperiment:u,isExplicitParameter:String(s)},o)};const s=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},972:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="1.2.0";let n={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>n,add:t=>{n=$P($P({},n),t)}}},384:(t,e)=>{$Q(e)},396:(t,e)=>{$Q(e),e.te=e.ee=e.ie=e.ne=e.se=e.re=e.oe=e.ue=void 0;const r="default";function s(t,e,n,i){return{name:t,details:e,ruleID:null!=(t=null==n?void 0:n.rule_id)?t:r,__evaluation:n,value:i}}function i(t,e,n){var i=null!=(i=null==n?void 0:n.value)?i:{};return $P($P({},s(t,e,n,i)),{get:o(null==n?void 0:n.value)})}function u(t,e){var n=t=>Array.isArray(t)?"array":typeof t;return n(t)===n(e)}function o(i,r){return(t,e)=>{var n=null!=(n=null==i?void 0:i[t])?n:null;return null!=n&&(null==e||u(n,e))?(null!=r&&r(t),n):null!=e?e:null}}e.ue=function(t,e,n){return s(t,e,n,!0===(null==n?void 0:n.value))},e.oe=i,e.re=function(t,e,n){return t=i(t,e,n),$P($P({},t),{groupName:null!=(e=null==n?void 0:n.group_name)?e:null})},e.se=function(t,e,n,i){return $P($P({},s(t,e,n,void 0)),{get:o(null==n?void 0:n.value,i),groupName:null!=(t=null==n?void 0:n.group_name)?t:null,__value:null!=(e=null==n?void 0:n.value)?e:{}})},e.ne=function(t,e,n,i){return $P($P($P({},t),e),{get:o(n,i)})},e.ie=function(t){return Array.isArray(t)?"array":typeof t},e.ee=u,e.te=o},136:(t,e)=>{$Q(e)},296:(t,e,n)=>{$Q(e),e.v=e.A=void 0;const i=n(832),r=n(780);e.A=function(t,e){try{var n=JSON.parse(JSON.stringify(t));return null!=e&&(n.statsigEnvironment=e),n}catch(t){return r.Log.error("Failed to JSON.stringify user"),{}}},e.v=function(t){return t?(0,i.xt)(t):null}},444:function(t,n,e){var i=this&&this.__awaiter||$A(),r=($Q2(n,"__esModule",{value:!0}),n.J=n.F=n.Storage=void 0,e(780)),e=e(48);const s={},u=t=>Promise.resolve(t),o={le:()=>"InMemory",U:t=>s[t]||null,ae:t=>u(s[t]||null),L:(t,e)=>(s[t]=e,u()),q:t=>(delete s[t],u()),ce:()=>u(Object.keys(s))};let l=null;try{const d=(0,e.Gt)();d&&d.localStorage&&"function"==typeof d.localStorage.getItem&&(l={le:()=>"LocalStorage",U:t=>d.localStorage.getItem(t),ae:t=>u(d.localStorage.getItem(t)),L:(t,e)=>(d.localStorage.setItem(t,e),u()),q:t=>(d.localStorage.removeItem(t),u()),ce:()=>u(Object.keys(d.localStorage))})}catch(t){r.Log.warn("Failed to setup localStorageProvider.")}let a=null!==l&&void 0!==l?l:o,c=a;function h(t){try{return t()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return n.Storage.he(o),null;throw t}}n.Storage={le:()=>c.le(),ae:t=>i(void 0,void 0,void 0,function*(){return h(()=>c.ae(t))}),U:t=>h(()=>c.U?c.U(t):null),L:(t,e)=>c.L(t,e),q:t=>c.q(t),ce:()=>c.ce(),he:t=>{a=t,c=t},Jt:t=>{c=t?o:a}},n.F=function(e){return i(this,void 0,void 0,function*(){var t=yield n.Storage.ae(e);return JSON.parse(null!=t?t:"null")})},n.J=function(t,e){return i(this,void 0,void 0,function*(){yield n.Storage.L(t,JSON.stringify(e))})}},412:(t,e,n)=>{$Q(e),e.C=void 0;const r=n(780);e.C=function(t,e,n){try{var i=JSON.parse(t);return"object"==typeof i&&0 in i,i}catch(t){}return r.Log.error("Failed to parse "+n),null}},556:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let n=(new Date).getTime(),i="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0{$Q(e),e.ut=void 0,e.ut=function(t,e,n,i){return t||(e?""+e+n:""+i+n)}},539:(t,e)=>{$Q(e)},100:(t,e,n)=>{$Q(e),e.de=e.lt=e.Pt=e.Ot=void 0;n=n(48);const i="foreground",r="background",s=[];let u=i,o=!1;e.Ot=()=>u===i,e.Pt=()=>o,e.lt=t=>{s.unshift(t)};e.de=e=>{e!==u&&(u=e,s.forEach(t=>t(e)))},(0,n.Ft)("focus",()=>{(o=!1,e.de)(i)}),(0,n.Ft)("blur",()=>(0,e.de)(r)),(0,n.Ft)("beforeunload",()=>{o=!0,(0,e.de)(r)}),(0,n.Kt)("visibilitychange",()=>{(0,e.de)("visible"===document.visibilityState?i:r)})},464:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&("get"in r?e.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,r)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),e.Log=e.Storage=e.EventLogger=void 0,n(496);const s=n(728),u=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return s.EventLogger}}),n(780));$Q2(e,"Log",{enumerable:!0,get:function(){return u.Log}});var o=n(972);const l=n(444);$Q2(e,"Storage",{enumerable:!0,get:function(){return l.Storage}}),r(n(496),e),r(n(707),e),r(n(856),e),r(n(320),e),r(n(184),e),r(n(512),e),r(n(500),e),r(n(788),e),r(n(832),e),r(n(664),e),r(n(780),e),r(n(188),e),r(n(716),e),r(n(264),e),r(n(648),e),r(n(48),e),r(n(360),e),r(n(612),e),r(n(604),e),r(n(688),e),r(n(808),e),r(n(283),e),r(n(876),e),r(n(972),e),r(n(384),e),r(n(396),e),r(n(136),e),r(n(296),e),r(n(444),e),r(n(412),e),r(n(84),e),r(n(539),e),r(n(556),e),r(n(100),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:u.Log,SDK_VERSION:o.SDK_VERSION})},448:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&("get"in r?e.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,r)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),r(n(376),e),e.default=__STATSIG__},532:(t,e)=>{function o(t){return t.setUTCHours(0,0,0,0),t.getTime()}$Q(e),e.default={compareNumbers(t,e,n){if(null==t||null==e)return!1;var i=Number(t),r=Number(e);if(isNaN(i)||isNaN(r))return!1;switch(n){case"gt":return e{var e=t.indexOf("-");return-1!==e?t.substring(0,e):t},r=((t,e)=>{var n=t.split(".").map(t=>parseInt(t)),i=e.split(".").map(t=>parseInt(t));let r=0;for(;r{var e=String(r),t=String(t),n=u?e.toLowerCase():e,i=u?t.toLowerCase():t;switch(s){case"any":case"none":case"any_case_sensitive":case"none_case_sensitive":return n===i;case"str_starts_with_any":return n.startsWith(i);case"str_ends_with_any":return n.endsWith(i);case"str_contains_any":case"str_contains_none":return n.includes(i);default:return!1}});switch(s){case"none":case"none_case_sensitive":case"str_contains_none":return!e;default:return e}},compareStringWithRegEx(t,e){try{var n=String(t);if(n.length<1e3)return new RegExp(String(e)).test(n)}catch(t){}return!1},compareTime(n,i,r){if(null==n||null==i)return!1;try{let t=new Date(String(n)),e=(isNaN(t.getTime())&&(t=new Date(Number(n))),new Date(String(i)));isNaN(e.getTime())&&(e=new Date(Number(i)));var s=t.getTime(),u=e.getTime();if(isNaN(s)||isNaN(u))return!1;switch(r){case"before":return s{$Q(e),e.resultToLayerEval=e.resultToConfigEval=e.resultToGateEval=e.makeEvalResult=void 0,e.makeEvalResult=function(t){return $P($P({},{unsupported:!1,bool_value:!1,rule_id:"",secondary_exposures:[],json_value:{},explicit_parameters:null,allocated_experiment_name:null,is_experiment_group:!1,group_name:null,undelegated_secondary_exposures:void 0}),t)},e.resultToGateEval=function(t,e){return{name:t.name,id_type:t.idType,rule_id:e.rule_id,value:e.bool_value,secondary_exposures:e.secondary_exposures}},e.resultToConfigEval=function(t,e){var n;return{name:t.name,id_type:t.idType,rule_id:e.rule_id,value:e.json_value,secondary_exposures:e.secondary_exposures,group:null!=(n=e.group_name)?n:"",group_name:null!=(n=e.group_name)?n:void 0,is_device_based:!1,is_experiment_active:t.isActive,is_user_in_experiment:e.is_experiment_group}},e.resultToLayerEval=function(t,e,n){return{name:t.name,rule_id:n.rule_id,value:n.json_value,secondary_exposures:n.secondary_exposures,undelegated_secondary_exposures:n.undelegated_secondary_exposures,allocated_experiment_name:null!=(t=n.allocated_experiment_name)?t:"",explicit_parameters:null!=(t=n.explicit_parameters)?t:[],group:null!=(t=n.group_name)?t:"",group_name:null!=(t=n.group_name)?t:void 0,is_device_based:!1,is_experiment_active:null==e?void 0:e.isActive,is_user_in_experiment:n.is_experiment_group}}},931:(t,e,n)=>{$Q(e);const i=n(452),c=n(532),h=n(947);function d(t,e){var n;return"string"==typeof e&&"userid"!==e.toLowerCase()?null!=(n=null==(n=t.customIDs)?void 0:n[e])?n:null==(n=null==t?void 0:t.customIDs)?void 0:n[e.toLowerCase()]:t.userID}function v(t){return(0,i.SHA256)(t).dataView().getBigUint64(0,!1)}function o(t){return null!=t&&"object"==typeof t}e.default=class{constructor(t){this.Te=t}evaluateGate(t,e){var{spec:t,details:n}=this.tn("gate",t);return t?{evaluation:(0,h.resultToGateEval)(t,this.en(t,e)),details:n}:{evaluation:null,details:n}}evaluateConfig(t,e){var{spec:t,details:n}=this.tn("config",t);return t?{evaluation:(0,h.resultToConfigEval)(t,this.en(t,e)),details:n}:{evaluation:null,details:n}}evaluateLayer(t,e){var n,{spec:t,details:i}=this.tn("layer",t);return t?(n=null!=(n=null==(e=this.en(t,e))?void 0:e.allocated_experiment_name)?n:"",n=this.Te.getSpecAndSourceInfo("config",n).spec,{evaluation:(0,h.resultToLayerEval)(t,n,e),details:i}):{evaluation:null,details:i}}tn(t,e){t=this.Te.getSpecAndSourceInfo(t,e);return{details:this.nn(t),spec:t.spec}}nn(t){var{source:t,spec:e,lcut:n,receivedAt:i}=t;return"Uninitialized"===t||"NoValues"===t?{reason:t}:{reason:t+":"+(null==e?"Unrecognized":"Recognized"),lcut:n,receivedAt:i}}en(t,e){var n=o(t.defaultValue)?t.defaultValue:void 0;if(!t.enabled)return(0,h.makeEvalResult)({json_value:n,rule_id:"disabled"});var i=[];for(const u of t.rules){var r,s=this.rn(u,e);if(s.unsupported)return s;if(i.push(...s.secondary_exposures),s.bool_value)return this.sn(u.configDelegate,e,i)||(r=function(t,e,n){if(100===t.passPercentage)return!0;if(0===t.passPercentage)return!1;e=v(n.salt+"."+(null!=(n=t.salt)?n:t.id)+"."+(null!=(n=d(e,t.idType))?n:""));return Number(e%BigInt(1e4))<100*t.passPercentage}(u,e,t),(0,h.makeEvalResult)({rule_id:s.rule_id,bool_value:r,json_value:r?s.json_value:n,secondary_exposures:i,undelegated_secondary_exposures:i,is_experiment_group:s.is_experiment_group,group_name:s.group_name}))}return(0,h.makeEvalResult)({json_value:n,secondary_exposures:i,undelegated_secondary_exposures:i,rule_id:"default"})}rn(t,e){var n=[];let i=!0;for(const s of t.conditions){var r=this.un(s,e);if(r.unsupported)return r;n.push(...r.secondary_exposures),r.bool_value||(i=!1)}return(0,h.makeEvalResult)({rule_id:t.id,bool_value:i,json_value:o(t.returnValue)?t.returnValue:void 0,secondary_exposures:n,is_experiment_group:!0===t.isExperimentGroup,group_name:t.groupName})}un(t,e){let n=null,i=!1;var r=t.field,s=t.targetValue,u=t.idType,o=t.type;switch(o){case"public":return(0,h.makeEvalResult)({bool_value:!0});case"pass_gate":case"fail_gate":var l=String(s),l=this.ln(l,e);return(0,h.makeEvalResult)({bool_value:"fail_gate"===o?!l.bool_value:l.bool_value,secondary_exposures:l.secondary_exposures});case"multi_pass_gate":case"multi_fail_gate":return this.an(s,o,e);case"user_field":case"ip_based":case"ua_based":n=function(t,e){var n;if(null==e||"object"!=typeof t||null==t)return null;var i=t;return null!=(n=null!=(n=null!=(n=null!=(n=null!=(n=i[e])?n:i[e.toLowerCase()])?n:null==(i=null==t?void 0:t.custom)?void 0:i[e])?n:null==(i=null==t?void 0:t.custom)?void 0:i[e.toLowerCase()])?n:null==(i=null==t?void 0:t.privateAttributes)?void 0:i[e])?n:null==(i=null==t?void 0:t.privateAttributes)?void 0:i[e.toLowerCase()]}(e,r);break;case"environment_field":n=function(t,e){if(null==e)return null;t=t.statsigEnvironment;if(null!=t){const n=e.toLowerCase(),i=Object.keys(t).find(t=>t.toLowerCase()===n);return void 0!==i?t[i]:void 0}}(e,r);break;case"current_time":n=Date.now();break;case"user_bucket":l=v(null!==(l=String(null!=(l=null==(l=t.additionalValues)?void 0:l.salt)?l:"")+"."+d(e,u))?l:"");n=Number(l%BigInt(1e3));break;case"unit_id":n=d(e,u);break;default:return(0,h.makeEvalResult)({unsupported:!0})}var a=t.operator;switch(a){case"gt":case"gte":case"lt":case"lte":i=c.default.compareNumbers(n,s,a);break;case"version_gt":case"version_gte":case"version_lt":case"version_lte":case"version_eq":case"version_neq":i=c.default.compareVersions(n,s,a);break;case"any":case"none":case"str_starts_with_any":case"str_ends_with_any":case"str_contains_any":case"str_contains_none":case"any_case_sensitive":case"none_case_sensitive":i=c.default.compareStringInArray(n,s,a);break;case"str_matches":i=c.default.compareStringWithRegEx(n,s);break;case"before":case"after":case"on":i=c.default.compareTime(n,s,a);break;case"eq":i=n==s;break;case"neq":i=n!=s;break;case"in_segment_list":case"not_in_segment_list":return(0,h.makeEvalResult)({unsupported:!0})}return(0,h.makeEvalResult)({bool_value:i})}sn(t,e,n){var i;return t&&(i=this.Te.getSpecAndSourceInfo("config",t).spec,i)?(e=this.en(i,e),(0,h.makeEvalResult)($P($P({},e),{allocated_experiment_name:t,explicit_parameters:i.explicitParameters,secondary_exposures:n.concat(e.secondary_exposures),undelegated_secondary_exposures:n}))):null}ln(t,e){var n=[];let i=!1;var r=this.Te.getSpecAndSourceInfo("gate",t)["spec"];if(r){r=this.en(r,e);if(r.unsupported)return r;i=r.bool_value,n.push(...r.secondary_exposures),n.push({gate:t,gateValue:String(i),ruleID:r.rule_id})}return(0,h.makeEvalResult)({bool_value:i,secondary_exposures:n})}an(t,e,n){if(!Array.isArray(t))return(0,h.makeEvalResult)({unsupported:!0});var i="multi_pass_gate"===e,r=[];let s=!1;for(const o of t){if("string"!=typeof o)return(0,h.makeEvalResult)({unsupported:!0});var u=this.ln(o,n);if(u.unsupported)return u;if(r.push(...u.secondary_exposures),i?!0===u.bool_value:!1===u.bool_value){s=!0;break}}return(0,h.makeEvalResult)({bool_value:s,secondary_exposures:r})}}},160:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e);const i=n(464);class s extends i.NetworkCore{constructor(t=null){super(t);t=null==t?void 0:t.networkConfig;this.cn=(0,i.ut)(null==t?void 0:t.downloadConfigSpecsUrl,null==t?void 0:t.api,"/download_config_specs",i.NetworkDefault.specsApi)}fetchConfigSpecs(e,n){var i;return r(this,void 0,void 0,function*(){var t=yield this.get({sdkKey:e,url:this.cn,priority:n});return null!=(i=null==t?void 0:t.body)?i:null})}}e.default=s},480:(t,e,n)=>{$Q(e);const i=n(464);function r(t){return(0,i.C)(t,"has_updates","DownloadConfigSpecsResponse")}e.default=class{constructor(){this._e=null,this.fe=null,this.ge="Uninitialized",this.be=0,this.ye=0}getValues(){return this._e?r(this._e):null}setValuesFromDataAdapter(t){var e;t&&!0===(null==(e=r(t.data))?void 0:e.has_updates)&&(this.be=e.time,this.ye=t.receivedAt,this.ge=t.source,this.fe=e,this._e=t.data)}reset(){this.fe=null,this._e=null,this.ge="Loading"}finalize(){this.fe||(this.ge="NoValues")}getSpecAndSourceInfo(t,e){var t=this.hn(t);return{spec:null!=(t=null==t?void 0:t.find(t=>t.name===e))?t:null,source:this.ge,lcut:this.be,receivedAt:this.ye}}hn(t){var e;switch(t){case"gate":return null==(e=this.fe)?void 0:e.feature_gates;case"config":return null==(e=this.fe)?void 0:e.dynamic_configs;case"layer":return null==(e=this.fe)?void 0:e.layer_configs}}}},368:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e);const u=n(464),r=n(931),s=n(160),o=n(480),l=n(4);class a extends u.StatsigClientBase{static instance(t){var e=(0,u.o)().instance(t);return e instanceof a?e:(u.Log.warn((0,u.Mt)()?"Unable to find StatsigOnDeviceEvalClient instance":"StatsigOnDeviceEvalClient.instance is not supported in server environments"),new a(null!=t?t:""))}constructor(t,e=null){u.SDKType.Ut(t,"js-on-device-eval-client");var n=new s.default(e);super(t,null!=(t=null==e?void 0:e.dataAdapter)?t:new l.StatsigSpecsDataAdapter,n,e),this.Te=new o.default,this.dn=new r.default(this.Te)}initializeSync(){this.updateSync()}initializeAsync(t){return i(this,void 0,void 0,function*(){return this.updateAsync(t)})}updateSync(){this.Te.reset();var t=this.dataAdapter.getDataSync();this.Te.setValuesFromDataAdapter(t),this.Te.finalize(),this.Wt("Ready",t),this.Me(t)}updateAsync(e){return i(this,void 0,void 0,function*(){this.Te.reset(),this.Wt("Loading",null);var t=this.dataAdapter.getDataSync();this.Te.setValuesFromDataAdapter(t),t=yield this.dataAdapter.getDataAsync(t,e),this.Te.setValuesFromDataAdapter(t),this.Te.finalize(),this.Wt("Ready",t)})}getContext(){return{sdkKey:this.S,options:this.p,values:this.Te.getValues(),errorBoundary:this.$t}}getAsyncContext(){return i(this,void 0,void 0,function*(){return $P($P({},this.getContext()),{session:yield u.StatsigSession.get(this.S),stableID:yield u.StableID.get(this.S)})})}checkGate(t,e,n){return this.getFeatureGate(t,e,n).value}getFeatureGate(t,e,n){e=(0,u.A)(e,this.p.environment);var{evaluation:i,details:r}=this.dn.evaluateGate(t,e),r=(0,u.ue)(t,r,i);return this.Yt(t,(0,u.Zt)(e,r),n),this.$emt({name:"gate_evaluation",gate:r}),r}getDynamicConfig(t,e,n){e=(0,u.A)(e,this.p.environment);var{evaluation:i,details:r}=this.dn.evaluateConfig(t,e),r=(0,u.oe)(t,r,i),s=null==(s=null==(i=this.Vt)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,r,e,n),i=null!=s?s:r;return this.Yt(t,(0,u.Xt)(e,i),n),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:r}),r}getExperiment(t,e,n){e=(0,u.A)(e,this.p.environment);var{evaluation:i,details:r}=this.dn.evaluateConfig(t,e),r=(0,u.re)(t,r,i),s=null==(s=null==(i=this.Vt)?void 0:i.getExperimentOverride)?void 0:s.call(i,r,e,n),i=null!=s?s:r;return this.Yt(t,(0,u.Xt)(e,i),n),this.$emt({name:"experiment_evaluation",experiment:r}),r}getLayer(e,n,i){n=(0,u.A)(n,this.p.environment);var{evaluation:t,details:r}=this.dn.evaluateLayer(e,n);const s=(0,u.se)(e,r,t,t=>{this.Yt(e,(0,u.Qt)(n,s,t),i)});return this.$emt({name:"layer_evaluation",layer:s}),s}logEvent(t,e,n,i){this.Bt.enqueue($P($P({},"string"==typeof t?{eventName:t,value:n,metadata:i}:t),{user:e,time:Date.now()}))}Ht(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Ae(null)})}Ae(t){this.Te.finalize(),this.Wt("Ready",t)}Me(t){this.dataAdapter.getDataAsync(t,{priority:"low"}).catch(t=>{u.Log.error("An error occurred after update.",t)})}}e.default=a},4:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigSpecsDataAdapter=void 0;const i=n(464),s=n(160);class u extends i.DataAdapterCore{constructor(){super("SpecsDataAdapter","specs"),this.X=null}attach(t,e){super.attach(t,e),this.X=new s.default(null!=e?e:{})}getDataAsync(t,e){return this.M(t,void 0,e)}prefetchData(t){return this.D(void 0,t)}N(t,e,n){var i;return r(this,void 0,void 0,function*(){return null!=(i=yield null==(i=this.X)?void 0:i.fetchConfigSpecs(this.P(),null==n?void 0:n.priority))?i:null})}T(){var t=(0,i.u)(this.P());return`${i.DataAdapterCachePrefix}.${this.m}.`+t}R(t,e){return 0{$Q(e),e.StatsigSpecsDataAdapter=e.StatsigOnDeviceEvalClient=void 0;var i=n(368);e.StatsigOnDeviceEvalClient=i.default;const r=n(4);$Q2(e,"StatsigSpecsDataAdapter",{enumerable:!0,get:function(){return r.StatsigSpecsDataAdapter}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigSpecsDataAdapter:r.StatsigSpecsDataAdapter,StatsigOnDeviceEvalClient:i.default}),e.default=__STATSIG__},452:(t,e,n)=>{$Q(e),e.SHA256=void 0;const i=n(891);$Q2(e,"SHA256",{enumerable:!0,get:function(){return i.SHA256}})},891:(t,e)=>{$Q(e),e.SHA256=void 0,e.SHA256=function(t){return(new i).update(t)};const n=[-2147483648,8388608,32768,128],u=[24,16,8,0],m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];class i{constructor(){this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.lastByteIndex=-1}update(n){if(!this.finalized){if("string"!=typeof n)throw new Error('Must be of type "string"');var i;let t=0,e;for(var r=n.length,s=this.blocks;t>2]|=i<>2]|=(192|i>>6)<>2]|=(224|i>>12)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=n[3&e],this.block=t[16],56<=e&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash())}hash(){var t=this.blocks;let e=this.h0,n=this.h1,i=this.h2,r=this.h3,s=this.h4,u=this.h5,o=this.h6,l=this.h7,a,c,h,d,v,_,f,p,g,y,b;for(a=16;a<64;++a)v=t[a-15],c=(v>>>7|v<<25)^(v>>>18|v<<14)^v>>>3,v=t[a-2],h=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,t[a]=t[a-16]+c+t[a-7]+h<<0;for(b=n&i,a=0;a<64;a+=4)this.first?(p=704751109,v=t[0]-210244248,l=v-1521486534<<0,r=v+143694565<<0,this.first=!1):(c=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),h=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),p=e&n,d=p^e&i^b,f=s&u^~s&o,v=l+h+f+m[a]+t[a],_=c+d,l=r+v<<0,r=v+_<<0),c=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),h=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),g=r&e,d=g^r&n^p,f=l&s^~l&u,v=o+h+f+m[a+1]+t[a+1],_=c+d,o=i+v<<0,i=v+_<<0,c=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),h=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),y=i&r,d=y^i&e^g,f=o&l^~o&s,v=u+h+f+m[a+2]+t[a+2],_=c+d,u=n+v<<0,n=v+_<<0,c=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),h=(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7),b=n&i,d=b^n&r^y,f=u&o^~u&l,v=s+h+f+m[a+3]+t[a+3],_=c+d,s=e+v<<0,e=v+_<<0;this.h0=this.h0+e<<0,this.h1=this.h1+n<<0,this.h2=this.h2+i<<0,this.h3=this.h3+r<<0,this.h4=this.h4+s<<0,this.h5=this.h5+u<<0,this.h6=this.h6+o<<0,this.h7=this.h7+l<<0}arrayBuffer(){return this.vn().buffer}dataView(){return this.vn().dataView}vn(){this.finalize();var t=new ArrayBuffer(32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),e.setUint32(28,this.h7),{dataView:e,buffer:t}}}}},i={};function r(t){var e=i[t];return void 0!==e||(e=i[t]={exports:{}},n[t].call(e.exports,e,e.exports,r)),e.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r(448).default})()); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Statsig=e():t.Statsig=e()}(this,()=>(()=>{"use strict";var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});var n={496:(t,n,e)=>{$Q2(n,"__esModule",{value:!0}),n.t=n.i=n.o=void 0,n.o=()=>__STATSIG__||o,n.i=t=>(0,n.o)()[t];n.t=t=>{var e=(0,n.o)();return t?e.instances&&e.instances[t]:e.lastInstance};var i,r="__STATSIG__",s="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},u="undefined"!=typeof globalThis?globalThis:{};const o=null!=(i=null!=(i=null!=(i=s[r])?i:e[r])?i:u[r])?i:{instance:n.t};s[r]=o,e[r]=o,u[r]=o},707:(t,e,n)=>{$Q(e),e.u=e.l=void 0;const r=n(832);function i(t,e,n){if(n)return n(t,e);const i=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(n=null==e?void 0:e.userID)?n:""),"cids:"+Object.keys(i).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+i[t]).join(","),"k:"+t];return(0,r.h)(e.join("|"))}e.l=i,e.u=function(t,e,n){return e?i(t,e,n):(0,r.h)("k:"+t)}},856:(t,e)=>{$Q(e)},320:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const l=n(780),a=n(604),s=n(296),u=n(444),c=n(412);function h(t,e,n,i){return{source:t,data:e,receivedAt:Date.now(),stableID:n,fullUserHash:(0,s.v)(i)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.m=e,this.p=null,this.S=null,this.O="statsig.last_modified_time."+e,this.j=new i}attach(t,e){this.S=t,this.p=e}getDataSync(t){var e=this.T(t),n=this.j.get(e,t);return n||((n=this.I(e))?(this.j.add(e,n),this.j.get(e,t)):null)}setData(t,e){var e=e&&(0,s.A)(e,null==(e=this.p)?void 0:e.environment),n=this.T(e);this.j.add(n,h("Bootstrap",t,null,e))}__primeInMemoryCache(t){this.j.merge(t)}M(e,n,i){return r(this,void 0,void 0,function*(){var t=null!=e?e:this.getDataSync(n),t=[this.k(t,n,i)];return null!=i&&i.timeoutMs&&t.push(new Promise(t=>setTimeout(t,i.timeoutMs)).then(()=>(l.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}D(n,i){return r(this,void 0,void 0,function*(){var t=this.T(n),e=yield this.M(null,n,i);e&&this.j.add(t,$P($P({},e),{source:"Prefetch"}))})}k(s,u,o){return r(this,void 0,void 0,function*(){let t=null;s&&this.R(s,u)&&(t=s.data);var e=yield this.N(t,u,o);if(!e)return l.Log.debug("No response returned for latest value"),null;var n=(0,c.C)(e,"has_updates","Response"),i=this.P(),i=yield a.StableID.get(i);let r=null;if(!0===(null==n?void 0:n.has_updates))r=h("Network",e,i,u);else{if(!t||!1!==(null==n?void 0:n.has_updates))return null;r=h("NetworkNotModified",t,i,u)}e=this.T(u);return this.j.add(e,r),yield this.G(e,r),r})}P(){return null!=this.S?this.S:(l.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=u.Storage.U)?void 0:e.call(u.Storage,t);return null!=e&&(t=(0,c.C)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}G(t,e){return r(this,void 0,void 0,function*(){yield u.Storage.L(t,JSON.stringify(e)),yield this.K(t)})}K(n){var i;return r(this,void 0,void 0,function*(){var t=null!=(i=yield(0,u.F)(this.O))?i:{},e=(t[n]=Date.now(),o(t,10));e&&(delete t[e],yield u.Storage.q(e)),yield(0,u.J)(this.O,t)})}};class i{constructor(){this.V={}}get(t,e){var t=this.V[t],n=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&n&&e!==n?(l.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var n=o(this.V,9);n&&delete this.V[n],this.V[t]=e}merge(t){this.V=$P($P({},this.V),t)}}function o(r,t){var e=Object.keys(r);return e.length<=t?null:e.reduce((t,e)=>{var n=r[t],i=r[e];return"object"==typeof n&&"object"==typeof i?i.receivedAt{$Q(e),e.Diagnostics=void 0;e.Diagnostics=class{static mark(){}}},184:(t,e)=>{$Q(e)},512:function(t,o,e){var n=this&&this.__awaiter||$A();$Q2(o,"__esModule",{value:!0}),o.ErrorBoundary=o.EXCEPTION_ENDPOINT=void 0;const i=e(780),l=e(360),a=e(972),c=(o.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");o.ErrorBoundary=class{constructor(t,e,n){this.S=t,this.p=e,this.B=n,this.$=new Set}wrap(i){try{const t=i;!function(t){const e=new Set;let n=Object.getPrototypeOf(t);for(;n&&n!==Object.prototype;)Object.getOwnPropertyNames(n).filter(t=>"function"==typeof(null===n||void 0===n?void 0:n[t])).forEach(t=>e.add(t)),n=Object.getPrototypeOf(n);return Array.from(e)}(t).forEach(e=>{const n=t[e];"$EB"in n||(t[e]=(...t)=>this.H(e,()=>n.apply(i,t)),t[e].$EB=!0)})}catch(t){this.W("eb:wrap",t)}}logError(t,e){this.W(t,e)}H(e,t){try{var n=t();return n&&n instanceof Promise?n.catch(t=>this.W(e,t)):n}catch(t){return this.W(e,t),null}}W(s,u){try{i.Log.warn("Caught error in "+s,{error:u});n(this,void 0,void 0,function*(){var t,e,n=u||Error(c),i=n instanceof Error,r=i?n.name:"No Name";this.$.has(r)||(this.$.add(r),null!=(t=null==(t=this.p)?void 0:t.networkConfig)&&t.preventAllNetworkTraffic?null!=(t=this.B)&&t.call(this,{name:"error",error:u}):(t=l.SDKType.Y(this.S),e=a.StatsigMetadataProvider.get(),i=i?n.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(n),n=JSON.stringify($P({tag:s,exception:r,info:i},$P($P({},e),{sdkType:t}))),yield(null!=(r=null==(i=null==(r=this.p)?void 0:r.networkConfig)?void 0:i.networkOverrideFunc)?r:fetch)(o.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.S,"STATSIG-SDK-TYPE":String(t),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:n}),null!=(i=this.B)&&i.call(this,{name:"error",error:u})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},500:(t,e)=>{$Q(e)},788:(t,e)=>{$Q(e)},728:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const r=n(832),s=n(780),u=n(716),o=n(48),l=n(876),a=n(444),c=n(84),h=n(100),d={},v=t=>{null!=(t=d[t])&&t.flush().catch(()=>{})};e.EventLogger=class{constructor(e,t,n,i){this.S=e,this.B=t,this.X=n,this.p=i,this.Z=[],this.tt={},this.et={},this.it=!1,this.nt=Date.now(),(d[e]=this).st=!0===(null==i?void 0:i.disableLogging),this.rt=null!=(t=null==i?void 0:i.loggingBufferMaxSize)?t:50;n=null==i?void 0:i.networkConfig;this.ot=(0,c.ut)(null==n?void 0:n.logEventUrl,null==n?void 0:n.api,"/rgstr",u.NetworkDefault.eventsApi),(0,h.lt)(t=>{"background"===t&&v(e)}),this.ct(),this.ht()}setLoggingDisabled(t){this.st=t}enqueue(t){this.dt(t)&&(this.vt(t),this._t(),this.Z.length>this.rt)&&v(this.S)}incrementNonExposureCount(t){var e=null!=(e=this.et[t])?e:0;this.et[t]=e+1}reset(){this.tt={}}shutdown(){return i(this,void 0,void 0,function*(){this.ft&&(clearInterval(this.ft),this.ft=null),yield this.flush()})}flush(){return i(this,void 0,void 0,function*(){var t;if(this.gt(),0!==this.Z.length)return t=this.Z,this.Z=[],this.bt(t)})}_t(){this.it||(this.it=!0,200v(this.S),200)}dt(t){if((0,l.yt)(t)){var e=t.user||{},n=t.metadata||{},t=[t.eventName,e.userID,n.gate,n.config,n.ruleID].join("|"),e=this.tt[t],n=Date.now();if(e&&n-e<6e4)return!1;1e3{s.Log.warn("Unable to save failed logs to storage")})}ct(){const e=this.u();i(this,void 0,void 0,function*(){var t=yield(0,a.F)(e);t&&(yield a.Storage.q(e),yield this.bt(t))}).catch(()=>{s.Log.warn("Failed to flush stored logs")})}u(){return"statsig.failed_logs."+(0,r.h)(this.S)}vt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},n=this.It(),n=(n&&(e.statsigMetadata={currentPage:n}),$P($P({},t),e));s.Log.debug("Enqueued Event:",n),this.Z.push(n)}gt(){0!==Object.keys(this.et).length&&(this.vt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.et)}}),this.et={})}It(){var t;if(!1!==(null==(t=this.p)?void 0:t.includeCurrentPageUrlWithEvents))return(0,o.At)()}ht(){if((0,o.Mt)()){var t=null!=(t=null==(t=this.p)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{d[this.S].ft!==e?clearInterval(e):v(this.S)},t);this.ft=e}}}},832:(t,e)=>{$Q(e),e.xt=e.h=void 0;e.h=e=>{let n=0;for(let t=0;t>>0)};e.xt=t=>(0,e.h)(JSON.stringify(r(t)));const r=n=>{if(null==n)return null;var t=Object.keys(n).sort();const i={};return t.forEach(t=>{let e=n[t];!Array.isArray(e)&&e instanceof Object&&(e=r(e)),i[t]=e}),i}},664:(t,e)=>{$Q(e)},780:(t,e)=>{function n(t){return t.unshift("[Statsig]"),t}var i,r;$Q(e),e.Log=e.LogLevel=void 0,(r=i||(e.LogLevel=i={}))[r.None=0]="None",r[r.Error=1]="Error",r[r.Warn=2]="Warn",r[r.Info=3]="Info",r[r.Debug=4]="Debug";class s{static info(...t){this.level>=i.Info&&console.info(...n(t))}static debug(...t){this.level>=i.Debug&&console.debug(...n(t))}static warn(...t){this.level>=i.Warn&&console.warn(...n(t))}static error(...t){this.level>=i.Error&&console.error(...n(t))}}(e.Log=s).level=i.Error},716:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=void 0,e.NetworkDefault={eventsApi:"https://prodregistryv2.org/v1",initializeApi:"https://featureassets.org/v1",specsApi:"https://assetsconfigcdn.org/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},188:function(t,e,n){var s=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,n(496);const u=n(496),f=n(280),p=n(780),o=n(716),l=n(360),a=n(48),c=n(612),h=n(604),d=n(972),g=n(100);e.NetworkCore=class{constructor(t,e){this.B=e,this.kt=1e4,this.Dt={},this.p={},t&&(this.p=t),this.p.networkConfig&&(this.Dt=this.p.networkConfig),this.Dt.networkTimeoutMs&&(this.kt=this.Dt.networkTimeoutMs)}post(e){return s(this,void 0,void 0,function*(){let t=yield this.Et(e);return e.isStatsigEncodable&&(t=this.Rt(e,t)),this.Nt($P({method:"POST",body:t},e))})}get(t){return this.Nt($P({method:"GET"},t))}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}beacon(i){return s(this,void 0,void 0,function*(){var t,e,n;return!!y(i)&&(t=yield this.Et(i),e=yield this.Ct(i),(n=navigator).sendBeacon.bind(n)(e,t))})}Nt(d){var v,_;return s(this,void 0,void 0,function*(){if(!y(d))return null;if(this.Dt.preventAllNetworkTraffic)return null;var{method:e,body:n,retries:i}=d;const r="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>null===r||void 0===r?void 0:r.abort(`Timeout of ${this.kt}ms expired.`),this.kt),s=yield this.Ct(d),u=null,o=(0,g.Pt)();try{var l,a,c,h={method:e,body:n,headers:$P({},d.headers),signal:null===r||void 0===r?void 0:r.signal,priority:d.priority,keepalive:o},u=yield(null!=(v=this.Dt.networkOverrideFunc)?v:fetch)(s,h);if(clearTimeout(t),u.ok)return c=yield u.text(),f.Diagnostics.mark(),{body:c,code:u.status};throw l=yield u.text().catch(()=>"No Text"),(a=new Error(`NetworkError: ${s} `+l)).name="NetworkError",a}catch(t){n=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(r,t);return f.Diagnostics.mark(),!i||i<=0?(null!=(_=this.B)&&_.call(this,{name:"error",error:t}),p.Log.error(`A networking error occured during ${e} request to ${s}.`,n,t),null):this.Nt($P($P({},d),{retries:i-1}))}})}Ct(n){return s(this,void 0,void 0,function*(){const e=$P({[o.NetworkParam.SdkKey]:n.sdkKey,[o.NetworkParam.SdkType]:l.SDKType.Y(n.sdkKey),[o.NetworkParam.SdkVersion]:d.SDK_VERSION,[o.NetworkParam.Time]:String(Date.now()),[o.NetworkParam.SessionID]:yield c.SessionID.get(n.sdkKey)},n.params);var t=Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return n.url+(t?"?"+t:"")})}Et(r){return s(this,void 0,void 0,function*(){var{data:t,sdkKey:e}=r,n=yield h.StableID.get(e),i=yield c.SessionID.get(e),e=l.SDKType.Y(e);return JSON.stringify($P($P({},t),{statsigMetadata:$P($P({},d.StatsigMetadataProvider.get()),{stableID:n,sessionID:i,sdkType:e})}))})}Rt(t,e){var n,i,r=(0,a.Gt)();if(!t.isStatsigEncodable||this.p.disableStatsigEncoding||null!=(0,u.i)("no-encode")||null==r||!r.btoa)return e;try{var s=null!=(n=r.btoa(e).split("").reverse().join(""))?n:e;return t.params=$P($P({},null!=(i=t.params)?i:{}),{[o.NetworkParam.StatsigEncoded]:"1"}),s}catch(t){return p.Log.warn("/initialize request encoding failed"),e}}};const y=t=>!!t.sdkKey||(p.Log.warn("Unable to make request without an SDK key"),!1)},264:(t,e)=>{$Q(e)},648:(t,e)=>{$Q(e)},360:(t,e)=>{$Q(e),e.SDKType=void 0;const n={};let i;e.SDKType={Y:t=>{return(null!=(t=n[t])?t:"js-mono")+(null!==i&&void 0!==i?i:"")},Ut(t,e){n[t]=e},Lt(t){i&&"-react"!==i||(i="-"+t)}}},48:(t,i)=>{$Q2(i,"__esModule",{value:!0}),i.At=i.Kt=i.Ft=i.Mt=i.qt=i.Gt=void 0;i.Gt=()=>"undefined"!=typeof window?window:null,i.qt=()=>{var t=(0,i.Gt)();return null!=(t=null==t?void 0:t.document)?t:null},i.Mt=()=>null!=(0,i.qt)(),i.Ft=(t,e)=>{var n=(0,i.Gt)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)},i.Kt=(t,e)=>{var n=(0,i.qt)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)};i.At=()=>{var t;try{return null==(t=(0,i.Gt)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},612:function(t,e,n){var u=this&&this.__awaiter||$A();$Q(e),e.StatsigSession=e.SessionID=void 0;const i=n(707),o=n(780),l=n(444),a=n(556),c=18e5,h=144e5,d={};function v(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function _(t){return"statsig.session_id."+(0,i.u)(t)}e.SessionID={get:t=>u(void 0,void 0,void 0,function*(){return e.StatsigSession.get(t).then(t=>t.data.sessionID)})},e.StatsigSession={get:s=>u(void 0,void 0,void 0,function*(){null==d[s]&&(d[s]=function(n){return u(this,void 0,void 0,function*(){let t=yield function(t){t=_(t);return(0,l.F)(t)}(n);var e=Date.now();return{data:t=t||{sessionID:(0,a.getUUID)(),startTime:e,lastUpdate:e},sdkKey:n}})}(s));var t=yield d[s],e=Date.now(),n=t.data,i=((function({lastUpdate:t}){return Date.now()-t>c}(n)||function({startTime:t}){return Date.now()-t>h}(n))&&(n.sessionID=(0,a.getUUID)(),n.startTime=e),n.lastUpdate=e,n),r=t.sdkKey;return r=_(r),(0,l.J)(r,i).catch(()=>{o.Log.warn("Failed to save SessionID")}),clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=n.startTime,n=t.sdkKey,t.idleTimeoutID=v(n,c),t.ageTimeoutID=v(n,h-e),t}),overrideInitialSessionID:(t,e)=>{var n;d[e]=(t=t,e=e,n=Date.now(),Promise.resolve({data:{sessionID:t,startTime:n,lastUpdate:n},sdkKey:e}))}}},604:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.StableID=void 0;const r=n(707),s=n(780),u=n(444),o=n(556),l={};function a(t){return"statsig.stable_id."+(0,r.u)(t)}function c(t,e){e=a(e);(0,u.J)(e,t).catch(()=>{s.Log.warn("Failed to save StableID")})}e.StableID={get:e=>i(void 0,void 0,void 0,function*(){return null==l[e]&&(l[e]=function(t){t=a(t);return(0,u.F)(t)}(e).then(t=>{return null!=t||c(t=(0,o.getUUID)(),e),t})),l[e]}),setOverride:(t,e)=>{l[e]=Promise.resolve(t),c(t,e)}}},688:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,n(496);const u=n(496),o=n(512),l=n(728),a=n(780),c=n(48),h=n(612),d=n(444);e.StatsigClientBase=class{constructor(t,e,n,i){this.loadingStatus="Uninitialized",this.zt={};var r,s=this.$emt.bind(this);null!=(null==i?void 0:i.logLevel)&&(a.Log.level=i.logLevel),null!=i&&i.disableStorage&&d.Storage.Jt(!0),null!=i&&i.initialSessionID&&h.StatsigSession.overrideInitialSessionID(i.initialSessionID,t),this.S=t,this.p=null!=i?i:{},this.Vt=null!=(r=null==i?void 0:i.overrideAdapter)?r:null,this.Bt=new l.EventLogger(t,s,n,i),this.$t=new o.ErrorBoundary(t,i,s),this.$t.wrap(this),this.$t.wrap(n),this.$t.wrap(e),this.$t.wrap(this.Bt),(0,c.Mt)()&&(null!=(n=null!=(s=(r=(0,u.o)()).instances)?s:{})[t]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),n[t]=this,r.lastInstance=this,r.instances=n,__STATSIG__=r),this.dataAdapter=e,this.dataAdapter.attach(t,i),this.Ht()}updateRuntimeOptions(t){null!=t.disableLogging&&(this.p.disableLogging=t.disableLogging,this.Bt.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.p.disableStorage=t.disableStorage,d.Storage.Jt(t.disableStorage))}flush(){return this.Bt.flush()}shutdown(){return i(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),yield this.Bt.shutdown()})}on(t,e){this.zt[t]||(this.zt[t]=[]),this.zt[t].push(e)}off(t,e){this.zt[t]&&-1!==(e=this.zt[t].indexOf(e))&&this.zt[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(n){var t;const e=e=>{try{e(n)}catch(t){!0===e.__isInternal?this.$t.logError("__emit:"+n.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",n)}};this.zt[n.name]&&this.zt[n.name].forEach(t=>e(t)),null!=(t=this.zt["*"])&&t.forEach(e)}Wt(t,e){this.loadingStatus=t,this.$emt({name:"values_updated",status:t,values:e})}Yt(t,e,n){!0===(null==n?void 0:n.disableExposureLog)?this.Bt.incrementNonExposureCount(t):this.Bt.enqueue(e)}}},808:(t,e)=>{$Q(e)},283:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},876:(t,e)=>{$Q(e),e.Qt=e.Xt=e.Zt=e.yt=void 0;const n="statsig::config_exposure",i="statsig::gate_exposure",l=(t,e,n,i,r)=>({eventName:t,user:e,value:null,metadata:s(n,i),secondaryExposures:r,time:Date.now()});e.yt=({eventName:t})=>t===i||t===n,e.Zt=(t,e)=>{return l(i,t,e.details,{gate:e.name,gateValue:String(e.value),ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])},e.Xt=(t,e)=>{return l(n,t,e.details,{config:e.name,ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])};e.Qt=(t,e,n)=>{var i,r=e.__evaluation,s=!0===(null==(s=null==r?void 0:r.explicit_parameters)?void 0:s.includes(n));let u="",o=null!=(i=null==r?void 0:r.undelegated_secondary_exposures)?i:[];return s&&(u=null!=(i=r.allocated_experiment_name)?i:"",o=r.secondary_exposures),l("statsig::layer_exposure",t,e.details,{config:e.name,parameterName:n,ruleID:e.ruleID,allocatedExperiment:u,isExplicitParameter:String(s)},o)};const s=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},972:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="1.3.0";let n={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>n,add:t=>{n=$P($P({},n),t)}}},384:(t,e)=>{$Q(e)},396:(t,e)=>{$Q(e),e.te=e.ee=e.ie=e.ne=e.se=e.re=e.oe=e.ue=void 0;const r="default";function s(t,e,n,i){return{name:t,details:e,ruleID:null!=(t=null==n?void 0:n.rule_id)?t:r,__evaluation:n,value:i}}function i(t,e,n){var i=null!=(i=null==n?void 0:n.value)?i:{};return $P($P({},s(t,e,n,i)),{get:o(null==n?void 0:n.value)})}function u(t,e){var n=t=>Array.isArray(t)?"array":typeof t;return n(t)===n(e)}function o(i,r){return(t,e)=>{var n=null!=(n=null==i?void 0:i[t])?n:null;return null!=n&&(null==e||u(n,e))?(null!=r&&r(t),n):null!=e?e:null}}e.ue=function(t,e,n){return s(t,e,n,!0===(null==n?void 0:n.value))},e.oe=i,e.re=function(t,e,n){return t=i(t,e,n),$P($P({},t),{groupName:null!=(e=null==n?void 0:n.group_name)?e:null})},e.se=function(t,e,n,i){return $P($P({},s(t,e,n,void 0)),{get:o(null==n?void 0:n.value,i),groupName:null!=(t=null==n?void 0:n.group_name)?t:null,__value:null!=(e=null==n?void 0:n.value)?e:{}})},e.ne=function(t,e,n,i){return $P($P($P({},t),e),{get:o(n,i)})},e.ie=function(t){return Array.isArray(t)?"array":typeof t},e.ee=u,e.te=o},136:(t,e)=>{$Q(e)},296:(t,e,n)=>{$Q(e),e.v=e.A=void 0;const i=n(832),r=n(780);e.A=function(t,e){try{var n=JSON.parse(JSON.stringify(t));return null!=e&&(n.statsigEnvironment=e),n}catch(t){return r.Log.error("Failed to JSON.stringify user"),{}}},e.v=function(t){return t?(0,i.xt)(t):null}},444:function(t,n,e){var i=this&&this.__awaiter||$A(),r=($Q2(n,"__esModule",{value:!0}),n.J=n.F=n.Storage=void 0,e(780)),e=e(48);const s={},u=t=>Promise.resolve(t),o={le:()=>"InMemory",U:t=>s[t]||null,ae:t=>u(s[t]||null),L:(t,e)=>(s[t]=e,u()),q:t=>(delete s[t],u()),ce:()=>u(Object.keys(s))};let l=null;try{const d=(0,e.Gt)();d&&d.localStorage&&"function"==typeof d.localStorage.getItem&&(l={le:()=>"LocalStorage",U:t=>d.localStorage.getItem(t),ae:t=>u(d.localStorage.getItem(t)),L:(t,e)=>(d.localStorage.setItem(t,e),u()),q:t=>(d.localStorage.removeItem(t),u()),ce:()=>u(Object.keys(d.localStorage))})}catch(t){r.Log.warn("Failed to setup localStorageProvider.")}let a=null!==l&&void 0!==l?l:o,c=a;function h(t){try{return t()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return n.Storage.he(o),null;throw t}}n.Storage={le:()=>c.le(),ae:t=>i(void 0,void 0,void 0,function*(){return h(()=>c.ae(t))}),U:t=>h(()=>c.U?c.U(t):null),L:(t,e)=>c.L(t,e),q:t=>c.q(t),ce:()=>c.ce(),he:t=>{a=t,c=t},Jt:t=>{c=t?o:a}},n.F=function(e){return i(this,void 0,void 0,function*(){var t=yield n.Storage.ae(e);return JSON.parse(null!=t?t:"null")})},n.J=function(t,e){return i(this,void 0,void 0,function*(){yield n.Storage.L(t,JSON.stringify(e))})}},412:(t,e,n)=>{$Q(e),e.C=void 0;const r=n(780);e.C=function(t,e,n){try{var i=JSON.parse(t);return"object"==typeof i&&0 in i,i}catch(t){}return r.Log.error("Failed to parse "+n),null}},556:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let n=(new Date).getTime(),i="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0{$Q(e),e.ut=void 0,e.ut=function(t,e,n,i){return t||(e?""+e+n:""+i+n)}},539:(t,e)=>{$Q(e)},100:(t,e,n)=>{$Q(e),e.de=e.lt=e.Pt=e.Ot=void 0;n=n(48);const i="foreground",r="background",s=[];let u=i,o=!1;e.Ot=()=>u===i,e.Pt=()=>o,e.lt=t=>{s.unshift(t)};e.de=e=>{e!==u&&(u=e,s.forEach(t=>t(e)))},(0,n.Ft)("focus",()=>{(o=!1,e.de)(i)}),(0,n.Ft)("blur",()=>(0,e.de)(r)),(0,n.Ft)("beforeunload",()=>{o=!0,(0,e.de)(r)}),(0,n.Kt)("visibilitychange",()=>{(0,e.de)("visible"===document.visibilityState?i:r)})},464:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&("get"in r?e.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,r)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),e.Log=e.Storage=e.EventLogger=void 0,n(496);const s=n(728),u=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return s.EventLogger}}),n(780));$Q2(e,"Log",{enumerable:!0,get:function(){return u.Log}});var o=n(972);const l=n(444);$Q2(e,"Storage",{enumerable:!0,get:function(){return l.Storage}}),r(n(496),e),r(n(707),e),r(n(856),e),r(n(320),e),r(n(184),e),r(n(512),e),r(n(500),e),r(n(788),e),r(n(832),e),r(n(664),e),r(n(780),e),r(n(188),e),r(n(716),e),r(n(264),e),r(n(648),e),r(n(48),e),r(n(360),e),r(n(612),e),r(n(604),e),r(n(688),e),r(n(808),e),r(n(283),e),r(n(876),e),r(n(972),e),r(n(384),e),r(n(396),e),r(n(136),e),r(n(296),e),r(n(444),e),r(n(412),e),r(n(84),e),r(n(539),e),r(n(556),e),r(n(100),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:u.Log,SDK_VERSION:o.SDK_VERSION})},448:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&("get"in r?e.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,r)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),r(n(376),e),e.default=__STATSIG__},532:(t,e)=>{function o(t){return t.setUTCHours(0,0,0,0),t.getTime()}$Q(e),e.default={compareNumbers(t,e,n){if(null==t||null==e)return!1;var i=Number(t),r=Number(e);if(isNaN(i)||isNaN(r))return!1;switch(n){case"gt":return e{var e=t.indexOf("-");return-1!==e?t.substring(0,e):t},r=((t,e)=>{var n=t.split(".").map(t=>parseInt(t)),i=e.split(".").map(t=>parseInt(t));let r=0;for(;r{var e=String(r),t=String(t),n=u?e.toLowerCase():e,i=u?t.toLowerCase():t;switch(s){case"any":case"none":case"any_case_sensitive":case"none_case_sensitive":return n===i;case"str_starts_with_any":return n.startsWith(i);case"str_ends_with_any":return n.endsWith(i);case"str_contains_any":case"str_contains_none":return n.includes(i);default:return!1}});switch(s){case"none":case"none_case_sensitive":case"str_contains_none":return!e;default:return e}},compareStringWithRegEx(t,e){try{var n=String(t);if(n.length<1e3)return new RegExp(String(e)).test(n)}catch(t){}return!1},compareTime(n,i,r){if(null==n||null==i)return!1;try{let t=new Date(String(n)),e=(isNaN(t.getTime())&&(t=new Date(Number(n))),new Date(String(i)));isNaN(e.getTime())&&(e=new Date(Number(i)));var s=t.getTime(),u=e.getTime();if(isNaN(s)||isNaN(u))return!1;switch(r){case"before":return s{$Q(e),e.resultToLayerEval=e.resultToConfigEval=e.resultToGateEval=e.makeEvalResult=void 0,e.makeEvalResult=function(t){return $P($P({},{unsupported:!1,bool_value:!1,rule_id:"",secondary_exposures:[],json_value:{},explicit_parameters:null,allocated_experiment_name:null,is_experiment_group:!1,group_name:null,undelegated_secondary_exposures:void 0}),t)},e.resultToGateEval=function(t,e){return{name:t.name,id_type:t.idType,rule_id:e.rule_id,value:e.bool_value,secondary_exposures:e.secondary_exposures}},e.resultToConfigEval=function(t,e){var n;return{name:t.name,id_type:t.idType,rule_id:e.rule_id,value:e.json_value,secondary_exposures:e.secondary_exposures,group:null!=(n=e.group_name)?n:"",group_name:null!=(n=e.group_name)?n:void 0,is_device_based:!1,is_experiment_active:t.isActive,is_user_in_experiment:e.is_experiment_group}},e.resultToLayerEval=function(t,e,n){return{name:t.name,rule_id:n.rule_id,value:n.json_value,secondary_exposures:n.secondary_exposures,undelegated_secondary_exposures:n.undelegated_secondary_exposures,allocated_experiment_name:null!=(t=n.allocated_experiment_name)?t:"",explicit_parameters:null!=(t=n.explicit_parameters)?t:[],group:null!=(t=n.group_name)?t:"",group_name:null!=(t=n.group_name)?t:void 0,is_device_based:!1,is_experiment_active:null==e?void 0:e.isActive,is_user_in_experiment:n.is_experiment_group}}},931:(t,e,n)=>{$Q(e);const i=n(452),c=n(532),h=n(947);function d(t,e){var n;return"string"==typeof e&&"userid"!==e.toLowerCase()?null!=(n=null==(n=t.customIDs)?void 0:n[e])?n:null==(n=null==t?void 0:t.customIDs)?void 0:n[e.toLowerCase()]:t.userID}function v(t){return(0,i.SHA256)(t).dataView().getBigUint64(0,!1)}function o(t){return null!=t&&"object"==typeof t}e.default=class{constructor(t){this.Te=t}evaluateGate(t,e){var{spec:t,details:n}=this.tn("gate",t);return t?{evaluation:(0,h.resultToGateEval)(t,this.en(t,e)),details:n}:{evaluation:null,details:n}}evaluateConfig(t,e){var{spec:t,details:n}=this.tn("config",t);return t?{evaluation:(0,h.resultToConfigEval)(t,this.en(t,e)),details:n}:{evaluation:null,details:n}}evaluateLayer(t,e){var n,{spec:t,details:i}=this.tn("layer",t);return t?(n=null!=(n=null==(e=this.en(t,e))?void 0:e.allocated_experiment_name)?n:"",n=this.Te.getSpecAndSourceInfo("config",n).spec,{evaluation:(0,h.resultToLayerEval)(t,n,e),details:i}):{evaluation:null,details:i}}tn(t,e){t=this.Te.getSpecAndSourceInfo(t,e);return{details:this.nn(t),spec:t.spec}}nn(t){var{source:t,spec:e,lcut:n,receivedAt:i}=t;return"Uninitialized"===t||"NoValues"===t?{reason:t}:{reason:t+":"+(null==e?"Unrecognized":"Recognized"),lcut:n,receivedAt:i}}en(t,e){var n=o(t.defaultValue)?t.defaultValue:void 0;if(!t.enabled)return(0,h.makeEvalResult)({json_value:n,rule_id:"disabled"});var i=[];for(const u of t.rules){var r,s=this.rn(u,e);if(s.unsupported)return s;if(i.push(...s.secondary_exposures),s.bool_value)return this.sn(u.configDelegate,e,i)||(r=function(t,e,n){if(100===t.passPercentage)return!0;if(0===t.passPercentage)return!1;e=v(n.salt+"."+(null!=(n=t.salt)?n:t.id)+"."+(null!=(n=d(e,t.idType))?n:""));return Number(e%BigInt(1e4))<100*t.passPercentage}(u,e,t),(0,h.makeEvalResult)({rule_id:s.rule_id,bool_value:r,json_value:r?s.json_value:n,secondary_exposures:i,undelegated_secondary_exposures:i,is_experiment_group:s.is_experiment_group,group_name:s.group_name}))}return(0,h.makeEvalResult)({json_value:n,secondary_exposures:i,undelegated_secondary_exposures:i,rule_id:"default"})}rn(t,e){var n=[];let i=!0;for(const s of t.conditions){var r=this.un(s,e);if(r.unsupported)return r;n.push(...r.secondary_exposures),r.bool_value||(i=!1)}return(0,h.makeEvalResult)({rule_id:t.id,bool_value:i,json_value:o(t.returnValue)?t.returnValue:void 0,secondary_exposures:n,is_experiment_group:!0===t.isExperimentGroup,group_name:t.groupName})}un(t,e){let n=null,i=!1;var r=t.field,s=t.targetValue,u=t.idType,o=t.type;switch(o){case"public":return(0,h.makeEvalResult)({bool_value:!0});case"pass_gate":case"fail_gate":var l=String(s),l=this.ln(l,e);return(0,h.makeEvalResult)({bool_value:"fail_gate"===o?!l.bool_value:l.bool_value,secondary_exposures:l.secondary_exposures});case"multi_pass_gate":case"multi_fail_gate":return this.an(s,o,e);case"user_field":case"ip_based":case"ua_based":n=function(t,e){var n;if(null==e||"object"!=typeof t||null==t)return null;var i=t;return null!=(n=null!=(n=null!=(n=null!=(n=null!=(n=i[e])?n:i[e.toLowerCase()])?n:null==(i=null==t?void 0:t.custom)?void 0:i[e])?n:null==(i=null==t?void 0:t.custom)?void 0:i[e.toLowerCase()])?n:null==(i=null==t?void 0:t.privateAttributes)?void 0:i[e])?n:null==(i=null==t?void 0:t.privateAttributes)?void 0:i[e.toLowerCase()]}(e,r);break;case"environment_field":n=function(t,e){if(null==e)return null;t=t.statsigEnvironment;if(null!=t){const n=e.toLowerCase(),i=Object.keys(t).find(t=>t.toLowerCase()===n);return void 0!==i?t[i]:void 0}}(e,r);break;case"current_time":n=Date.now();break;case"user_bucket":l=v(null!==(l=String(null!=(l=null==(l=t.additionalValues)?void 0:l.salt)?l:"")+"."+d(e,u))?l:"");n=Number(l%BigInt(1e3));break;case"unit_id":n=d(e,u);break;default:return(0,h.makeEvalResult)({unsupported:!0})}var a=t.operator;switch(a){case"gt":case"gte":case"lt":case"lte":i=c.default.compareNumbers(n,s,a);break;case"version_gt":case"version_gte":case"version_lt":case"version_lte":case"version_eq":case"version_neq":i=c.default.compareVersions(n,s,a);break;case"any":case"none":case"str_starts_with_any":case"str_ends_with_any":case"str_contains_any":case"str_contains_none":case"any_case_sensitive":case"none_case_sensitive":i=c.default.compareStringInArray(n,s,a);break;case"str_matches":i=c.default.compareStringWithRegEx(n,s);break;case"before":case"after":case"on":i=c.default.compareTime(n,s,a);break;case"eq":i=n==s;break;case"neq":i=n!=s;break;case"in_segment_list":case"not_in_segment_list":return(0,h.makeEvalResult)({unsupported:!0})}return(0,h.makeEvalResult)({bool_value:i})}sn(t,e,n){var i;return t&&(i=this.Te.getSpecAndSourceInfo("config",t).spec,i)?(e=this.en(i,e),(0,h.makeEvalResult)($P($P({},e),{allocated_experiment_name:t,explicit_parameters:i.explicitParameters,secondary_exposures:n.concat(e.secondary_exposures),undelegated_secondary_exposures:n}))):null}ln(t,e){var n=[];let i=!1;var r=this.Te.getSpecAndSourceInfo("gate",t)["spec"];if(r){r=this.en(r,e);if(r.unsupported)return r;i=r.bool_value,n.push(...r.secondary_exposures),n.push({gate:t,gateValue:String(i),ruleID:r.rule_id})}return(0,h.makeEvalResult)({bool_value:i,secondary_exposures:n})}an(t,e,n){if(!Array.isArray(t))return(0,h.makeEvalResult)({unsupported:!0});var i="multi_pass_gate"===e,r=[];let s=!1;for(const o of t){if("string"!=typeof o)return(0,h.makeEvalResult)({unsupported:!0});var u=this.ln(o,n);if(u.unsupported)return u;if(r.push(...u.secondary_exposures),i?!0===u.bool_value:!1===u.bool_value){s=!0;break}}return(0,h.makeEvalResult)({bool_value:s,secondary_exposures:r})}}},160:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e);const i=n(464);class s extends i.NetworkCore{constructor(t=null){super(t);t=null==t?void 0:t.networkConfig;this.cn=(0,i.ut)(null==t?void 0:t.downloadConfigSpecsUrl,null==t?void 0:t.api,"/download_config_specs",i.NetworkDefault.specsApi)}fetchConfigSpecs(e,n){var i;return r(this,void 0,void 0,function*(){var t=yield this.get({sdkKey:e,url:this.cn,priority:n});return null!=(i=null==t?void 0:t.body)?i:null})}}e.default=s},480:(t,e,n)=>{$Q(e);const i=n(464);function r(t){return(0,i.C)(t,"has_updates","DownloadConfigSpecsResponse")}e.default=class{constructor(){this._e=null,this.fe=null,this.ge="Uninitialized",this.be=0,this.ye=0}getValues(){return this._e?r(this._e):null}setValuesFromDataAdapter(t){var e;t&&!0===(null==(e=r(t.data))?void 0:e.has_updates)&&(this.be=e.time,this.ye=t.receivedAt,this.ge=t.source,this.fe=e,this._e=t.data)}reset(){this.fe=null,this._e=null,this.ge="Loading"}finalize(){this.fe||(this.ge="NoValues")}getSpecAndSourceInfo(t,e){var t=this.hn(t);return{spec:null!=(t=null==t?void 0:t.find(t=>t.name===e))?t:null,source:this.ge,lcut:this.be,receivedAt:this.ye}}hn(t){var e;switch(t){case"gate":return null==(e=this.fe)?void 0:e.feature_gates;case"config":return null==(e=this.fe)?void 0:e.dynamic_configs;case"layer":return null==(e=this.fe)?void 0:e.layer_configs}}}},368:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e);const u=n(464),r=n(931),s=n(160),o=n(480),l=n(4);class a extends u.StatsigClientBase{static instance(t){var e=(0,u.o)().instance(t);return e instanceof a?e:(u.Log.warn((0,u.Mt)()?"Unable to find StatsigOnDeviceEvalClient instance":"StatsigOnDeviceEvalClient.instance is not supported in server environments"),new a(null!=t?t:""))}constructor(t,e=null){u.SDKType.Ut(t,"js-on-device-eval-client");var n=new s.default(e);super(t,null!=(t=null==e?void 0:e.dataAdapter)?t:new l.StatsigSpecsDataAdapter,n,e),this.Te=new o.default,this.dn=new r.default(this.Te)}initializeSync(){this.updateSync()}initializeAsync(t){return i(this,void 0,void 0,function*(){return this.updateAsync(t)})}updateSync(){this.Te.reset();var t=this.dataAdapter.getDataSync();this.Te.setValuesFromDataAdapter(t),this.Te.finalize(),this.Wt("Ready",t),this.Me(t)}updateAsync(e){return i(this,void 0,void 0,function*(){this.Te.reset(),this.Wt("Loading",null);var t=this.dataAdapter.getDataSync();this.Te.setValuesFromDataAdapter(t),t=yield this.dataAdapter.getDataAsync(t,e),this.Te.setValuesFromDataAdapter(t),this.Te.finalize(),this.Wt("Ready",t)})}getContext(){return{sdkKey:this.S,options:this.p,values:this.Te.getValues(),errorBoundary:this.$t}}getAsyncContext(){return i(this,void 0,void 0,function*(){return $P($P({},this.getContext()),{session:yield u.StatsigSession.get(this.S),stableID:yield u.StableID.get(this.S)})})}checkGate(t,e,n){return this.getFeatureGate(t,e,n).value}getFeatureGate(t,e,n){e=(0,u.A)(e,this.p.environment);var{evaluation:i,details:r}=this.dn.evaluateGate(t,e),r=(0,u.ue)(t,r,i);return this.Yt(t,(0,u.Zt)(e,r),n),this.$emt({name:"gate_evaluation",gate:r}),r}getDynamicConfig(t,e,n){e=(0,u.A)(e,this.p.environment);var{evaluation:i,details:r}=this.dn.evaluateConfig(t,e),r=(0,u.oe)(t,r,i),s=null==(s=null==(i=this.Vt)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,r,e,n),i=null!=s?s:r;return this.Yt(t,(0,u.Xt)(e,i),n),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}getExperiment(t,e,n){e=(0,u.A)(e,this.p.environment);var{evaluation:i,details:r}=this.dn.evaluateConfig(t,e),r=(0,u.re)(t,r,i),s=null==(s=null==(i=this.Vt)?void 0:i.getExperimentOverride)?void 0:s.call(i,r,e,n),i=null!=s?s:r;return this.Yt(t,(0,u.Xt)(e,i),n),this.$emt({name:"experiment_evaluation",experiment:i}),i}getLayer(e,n,i){n=(0,u.A)(n,this.p.environment);var{evaluation:t,details:r}=this.dn.evaluateLayer(e,n);const s=(0,u.se)(e,r,t,t=>{this.Yt(e,(0,u.Qt)(n,s,t),i)});return this.$emt({name:"layer_evaluation",layer:s}),s}logEvent(t,e,n,i){this.Bt.enqueue($P($P({},"string"==typeof t?{eventName:t,value:n,metadata:i}:t),{user:e,time:Date.now()}))}Ht(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Ae(null)})}Ae(t){this.Te.finalize(),this.Wt("Ready",t)}Me(t){this.dataAdapter.getDataAsync(t,{priority:"low"}).catch(t=>{u.Log.error("An error occurred after update.",t)})}}e.default=a},4:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigSpecsDataAdapter=void 0;const i=n(464),s=n(160);class u extends i.DataAdapterCore{constructor(){super("SpecsDataAdapter","specs"),this.X=null}attach(t,e){super.attach(t,e),this.X=new s.default(null!=e?e:{})}getDataAsync(t,e){return this.M(t,void 0,e)}prefetchData(t){return this.D(void 0,t)}N(t,e,n){var i;return r(this,void 0,void 0,function*(){return null!=(i=yield null==(i=this.X)?void 0:i.fetchConfigSpecs(this.P(),null==n?void 0:n.priority))?i:null})}T(){var t=(0,i.u)(this.P());return`${i.DataAdapterCachePrefix}.${this.m}.`+t}R(t,e){return 0{$Q(e),e.StatsigSpecsDataAdapter=e.StatsigOnDeviceEvalClient=void 0;var i=n(368);e.StatsigOnDeviceEvalClient=i.default;const r=n(4);$Q2(e,"StatsigSpecsDataAdapter",{enumerable:!0,get:function(){return r.StatsigSpecsDataAdapter}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigSpecsDataAdapter:r.StatsigSpecsDataAdapter,StatsigOnDeviceEvalClient:i.default}),e.default=__STATSIG__},452:(t,e,n)=>{$Q(e),e.SHA256=void 0;const i=n(891);$Q2(e,"SHA256",{enumerable:!0,get:function(){return i.SHA256}})},891:(t,e)=>{$Q(e),e.SHA256=void 0,e.SHA256=function(t){return(new i).update(t)};const n=[-2147483648,8388608,32768,128],u=[24,16,8,0],m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];class i{constructor(){this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.lastByteIndex=-1}update(n){if(!this.finalized){if("string"!=typeof n)throw new Error('Must be of type "string"');var i;let t=0,e;for(var r=n.length,s=this.blocks;t>2]|=i<>2]|=(192|i>>6)<>2]|=(224|i>>12)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=n[3&e],this.block=t[16],56<=e&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash())}hash(){var t=this.blocks;let e=this.h0,n=this.h1,i=this.h2,r=this.h3,s=this.h4,u=this.h5,o=this.h6,l=this.h7,a,c,h,d,v,_,f,p,g,y,b;for(a=16;a<64;++a)v=t[a-15],c=(v>>>7|v<<25)^(v>>>18|v<<14)^v>>>3,v=t[a-2],h=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,t[a]=t[a-16]+c+t[a-7]+h<<0;for(b=n&i,a=0;a<64;a+=4)this.first?(p=704751109,v=t[0]-210244248,l=v-1521486534<<0,r=v+143694565<<0,this.first=!1):(c=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),h=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),p=e&n,d=p^e&i^b,f=s&u^~s&o,v=l+h+f+m[a]+t[a],_=c+d,l=r+v<<0,r=v+_<<0),c=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),h=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),g=r&e,d=g^r&n^p,f=l&s^~l&u,v=o+h+f+m[a+1]+t[a+1],_=c+d,o=i+v<<0,i=v+_<<0,c=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),h=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),y=i&r,d=y^i&e^g,f=o&l^~o&s,v=u+h+f+m[a+2]+t[a+2],_=c+d,u=n+v<<0,n=v+_<<0,c=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),h=(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7),b=n&i,d=b^n&r^y,f=u&o^~u&l,v=s+h+f+m[a+3]+t[a+3],_=c+d,s=e+v<<0,e=v+_<<0;this.h0=this.h0+e<<0,this.h1=this.h1+n<<0,this.h2=this.h2+i<<0,this.h3=this.h3+r<<0,this.h4=this.h4+s<<0,this.h5=this.h5+u<<0,this.h6=this.h6+o<<0,this.h7=this.h7+l<<0}arrayBuffer(){return this.vn().buffer}dataView(){return this.vn().dataView}vn(){this.finalize();var t=new ArrayBuffer(32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),e.setUint32(28,this.h7),{dataView:e,buffer:t}}}}},i={};function r(t){var e=i[t];return void 0!==e||(e=i[t]={exports:{}},n[t].call(e.exports,e,e.exports,r)),e.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r(448).default})()); \ No newline at end of file