autotel-subscribers 16.0.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/amplitude.cjs +64 -64
- package/dist/amplitude.cjs.map +1 -1
- package/dist/amplitude.js +64 -64
- package/dist/amplitude.js.map +1 -1
- package/dist/factories.cjs +1105 -423
- package/dist/factories.cjs.map +1 -1
- package/dist/factories.js +1105 -423
- package/dist/factories.js.map +1 -1
- package/dist/index.cjs +1105 -423
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1105 -423
- package/dist/index.js.map +1 -1
- package/dist/mixpanel.cjs +686 -130
- package/dist/mixpanel.cjs.map +1 -1
- package/dist/mixpanel.js +686 -130
- package/dist/mixpanel.js.map +1 -1
- package/dist/posthog.cjs +352 -226
- package/dist/posthog.cjs.map +1 -1
- package/dist/posthog.js +352 -226
- package/dist/posthog.js.map +1 -1
- package/package.json +14 -14
- package/src/segment.test.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -86,11 +86,11 @@ function normalizeWindowsPath(path) {
|
|
|
86
86
|
return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
|
|
87
87
|
}
|
|
88
88
|
var init_module_node = __esm({
|
|
89
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
89
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs"() {
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
93
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs
|
|
94
94
|
function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
95
95
|
return {
|
|
96
96
|
key,
|
|
@@ -107,7 +107,7 @@ function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
|
107
107
|
}
|
|
108
108
|
var normalizeFlagsResponse, getFlagValuesFromFlags, getPayloadsFromFlags, getFeatureFlagValue, parsePayload;
|
|
109
109
|
var init_featureFlagUtils = __esm({
|
|
110
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
110
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs"() {
|
|
111
111
|
normalizeFlagsResponse = (flagsResponse) => {
|
|
112
112
|
if ("flags" in flagsResponse) {
|
|
113
113
|
const featureFlags = getFlagValuesFromFlags(flagsResponse.flags);
|
|
@@ -165,10 +165,10 @@ var init_featureFlagUtils = __esm({
|
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
|
|
168
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
168
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs
|
|
169
169
|
var DIGITS, UUID, V7Generator, getDefaultRandom, defaultGenerator, uuidv7, uuidv7obj;
|
|
170
170
|
var init_uuidv7 = __esm({
|
|
171
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
171
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs"() {
|
|
172
172
|
DIGITS = "0123456789abcdef";
|
|
173
173
|
UUID = class _UUID {
|
|
174
174
|
constructor(bytes) {
|
|
@@ -329,10 +329,10 @@ var init_uuidv7 = __esm({
|
|
|
329
329
|
}
|
|
330
330
|
});
|
|
331
331
|
|
|
332
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
332
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs
|
|
333
333
|
var DEFAULT_BLOCKED_UA_STRS, isBlockedUA;
|
|
334
334
|
var init_bot_detection = __esm({
|
|
335
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
335
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs"() {
|
|
336
336
|
DEFAULT_BLOCKED_UA_STRS = [
|
|
337
337
|
"amazonbot",
|
|
338
338
|
"amazonproductbot",
|
|
@@ -423,10 +423,10 @@ var init_bot_detection = __esm({
|
|
|
423
423
|
}
|
|
424
424
|
});
|
|
425
425
|
|
|
426
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
427
|
-
var types_PostHogPersistedProperty;
|
|
426
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/types.mjs
|
|
427
|
+
var types_PostHogPersistedProperty, FeatureFlagError;
|
|
428
428
|
var init_types = __esm({
|
|
429
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
429
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/types.mjs"() {
|
|
430
430
|
types_PostHogPersistedProperty = /* @__PURE__ */ (function(PostHogPersistedProperty) {
|
|
431
431
|
PostHogPersistedProperty["AnonymousId"] = "anonymous_id";
|
|
432
432
|
PostHogPersistedProperty["DistinctId"] = "distinct_id";
|
|
@@ -455,23 +455,25 @@ var init_types = __esm({
|
|
|
455
455
|
PostHogPersistedProperty["FlagsEndpointWasHit"] = "flags_endpoint_was_hit";
|
|
456
456
|
return PostHogPersistedProperty;
|
|
457
457
|
})({});
|
|
458
|
+
FeatureFlagError = {
|
|
459
|
+
ERRORS_WHILE_COMPUTING: "errors_while_computing_flags",
|
|
460
|
+
FLAG_MISSING: "flag_missing",
|
|
461
|
+
QUOTA_LIMITED: "quota_limited",
|
|
462
|
+
TIMEOUT: "timeout",
|
|
463
|
+
CONNECTION_ERROR: "connection_error",
|
|
464
|
+
UNKNOWN_ERROR: "unknown_error",
|
|
465
|
+
apiError: (status) => `api_error_${status}`
|
|
466
|
+
};
|
|
458
467
|
}
|
|
459
468
|
});
|
|
460
469
|
|
|
461
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
470
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/string-utils.mjs
|
|
462
471
|
var init_string_utils = __esm({
|
|
463
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
472
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/string-utils.mjs"() {
|
|
464
473
|
}
|
|
465
474
|
});
|
|
466
475
|
|
|
467
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
468
|
-
function isInstanceOf(candidate, base) {
|
|
469
|
-
try {
|
|
470
|
-
return candidate instanceof base;
|
|
471
|
-
} catch {
|
|
472
|
-
return false;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
476
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/type-utils.mjs
|
|
475
477
|
function isPrimitive(value) {
|
|
476
478
|
return null === value || "object" != typeof value;
|
|
477
479
|
}
|
|
@@ -487,9 +489,16 @@ function isEvent(candidate) {
|
|
|
487
489
|
function isPlainObject(candidate) {
|
|
488
490
|
return isBuiltin(candidate, "Object");
|
|
489
491
|
}
|
|
490
|
-
|
|
492
|
+
function isInstanceOf(candidate, base) {
|
|
493
|
+
try {
|
|
494
|
+
return candidate instanceof base;
|
|
495
|
+
} catch {
|
|
496
|
+
return false;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
var nativeIsArray, ObjProto, type_utils_toString, isArray, isObject, isUndefined, isString, isEmptyString, isNumber, isPlainError;
|
|
491
500
|
var init_type_utils = __esm({
|
|
492
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
501
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/type-utils.mjs"() {
|
|
493
502
|
init_types();
|
|
494
503
|
init_string_utils();
|
|
495
504
|
nativeIsArray = Array.isArray;
|
|
@@ -499,15 +508,16 @@ var init_type_utils = __esm({
|
|
|
499
508
|
isArray = nativeIsArray || function(obj) {
|
|
500
509
|
return "[object Array]" === type_utils_toString.call(obj);
|
|
501
510
|
};
|
|
511
|
+
isObject = (x) => x === Object(x) && !isArray(x);
|
|
502
512
|
isUndefined = (x) => void 0 === x;
|
|
503
513
|
isString = (x) => "[object String]" == type_utils_toString.call(x);
|
|
504
514
|
isEmptyString = (x) => isString(x) && 0 === x.trim().length;
|
|
505
|
-
isNumber = (x) => "[object Number]" == type_utils_toString.call(x);
|
|
515
|
+
isNumber = (x) => "[object Number]" == type_utils_toString.call(x) && x === x;
|
|
506
516
|
isPlainError = (x) => x instanceof Error;
|
|
507
517
|
}
|
|
508
518
|
});
|
|
509
519
|
|
|
510
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
520
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/number-utils.mjs
|
|
511
521
|
function clampToRange(value, min, max, logger, fallbackValue) {
|
|
512
522
|
if (min > max) {
|
|
513
523
|
logger.warn("min cannot be greater than max.");
|
|
@@ -525,15 +535,15 @@ function clampToRange(value, min, max, logger, fallbackValue) {
|
|
|
525
535
|
return clampToRange(max, min, max, logger);
|
|
526
536
|
}
|
|
527
537
|
var init_number_utils = __esm({
|
|
528
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
538
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/number-utils.mjs"() {
|
|
529
539
|
init_type_utils();
|
|
530
540
|
}
|
|
531
541
|
});
|
|
532
542
|
|
|
533
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
543
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs
|
|
534
544
|
var ONE_DAY_IN_MS, BucketedRateLimiter;
|
|
535
545
|
var init_bucketed_rate_limiter = __esm({
|
|
536
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
546
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs"() {
|
|
537
547
|
init_number_utils();
|
|
538
548
|
ONE_DAY_IN_MS = 864e5;
|
|
539
549
|
BucketedRateLimiter = class {
|
|
@@ -577,10 +587,10 @@ var init_bucketed_rate_limiter = __esm({
|
|
|
577
587
|
}
|
|
578
588
|
});
|
|
579
589
|
|
|
580
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
590
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs
|
|
581
591
|
var PromiseQueue;
|
|
582
592
|
var init_promise_queue = __esm({
|
|
583
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
593
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs"() {
|
|
584
594
|
init_uuidv7();
|
|
585
595
|
PromiseQueue = class {
|
|
586
596
|
add(promise) {
|
|
@@ -611,7 +621,7 @@ var init_promise_queue = __esm({
|
|
|
611
621
|
}
|
|
612
622
|
});
|
|
613
623
|
|
|
614
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
624
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/logger.mjs
|
|
615
625
|
function createConsole(consoleLike = console) {
|
|
616
626
|
const lockedMethods = {
|
|
617
627
|
log: consoleLike.log.bind(consoleLike),
|
|
@@ -626,7 +636,7 @@ function createLogger(prefix, maybeCall = passThrough) {
|
|
|
626
636
|
}
|
|
627
637
|
var _createLogger, passThrough;
|
|
628
638
|
var init_logger = __esm({
|
|
629
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
639
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/logger.mjs"() {
|
|
630
640
|
_createLogger = (prefix, maybeCall, consoleLike) => {
|
|
631
641
|
function _log(level, ...args) {
|
|
632
642
|
maybeCall(() => {
|
|
@@ -655,10 +665,10 @@ var init_logger = __esm({
|
|
|
655
665
|
}
|
|
656
666
|
});
|
|
657
667
|
|
|
658
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
668
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs
|
|
659
669
|
var MOBILE, TABLET, GENERIC;
|
|
660
670
|
var init_user_agent_utils = __esm({
|
|
661
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
671
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs"() {
|
|
662
672
|
init_string_utils();
|
|
663
673
|
init_type_utils();
|
|
664
674
|
MOBILE = "Mobile";
|
|
@@ -669,7 +679,7 @@ var init_user_agent_utils = __esm({
|
|
|
669
679
|
}
|
|
670
680
|
});
|
|
671
681
|
|
|
672
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
682
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/index.mjs
|
|
673
683
|
function assert(truthyValue, message2) {
|
|
674
684
|
if (!truthyValue || "string" != typeof truthyValue || isEmpty(truthyValue)) throw new Error(message2);
|
|
675
685
|
}
|
|
@@ -713,7 +723,7 @@ function allSettled(promises) {
|
|
|
713
723
|
}
|
|
714
724
|
var STRING_FORMAT, isError;
|
|
715
725
|
var init_utils = __esm({
|
|
716
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
726
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/index.mjs"() {
|
|
717
727
|
init_bot_detection();
|
|
718
728
|
init_bucketed_rate_limiter();
|
|
719
729
|
init_number_utils();
|
|
@@ -727,10 +737,10 @@ var init_utils = __esm({
|
|
|
727
737
|
}
|
|
728
738
|
});
|
|
729
739
|
|
|
730
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
740
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/eventemitter.mjs
|
|
731
741
|
var SimpleEventEmitter;
|
|
732
742
|
var init_eventemitter = __esm({
|
|
733
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
743
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/eventemitter.mjs"() {
|
|
734
744
|
SimpleEventEmitter = class {
|
|
735
745
|
constructor() {
|
|
736
746
|
this.events = {};
|
|
@@ -751,7 +761,7 @@ var init_eventemitter = __esm({
|
|
|
751
761
|
}
|
|
752
762
|
});
|
|
753
763
|
|
|
754
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
764
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/gzip.mjs
|
|
755
765
|
function isGzipSupported() {
|
|
756
766
|
return "CompressionStream" in globalThis;
|
|
757
767
|
}
|
|
@@ -770,11 +780,11 @@ async function gzipCompress(input, isDebug = true) {
|
|
|
770
780
|
}
|
|
771
781
|
}
|
|
772
782
|
var init_gzip = __esm({
|
|
773
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
783
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/gzip.mjs"() {
|
|
774
784
|
}
|
|
775
785
|
});
|
|
776
786
|
|
|
777
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
787
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs
|
|
778
788
|
async function logFlushError(err) {
|
|
779
789
|
if (err instanceof PostHogFetchHttpError) {
|
|
780
790
|
let text = "";
|
|
@@ -794,7 +804,7 @@ function isPostHogFetchContentTooLargeError(err) {
|
|
|
794
804
|
}
|
|
795
805
|
var PostHogFetchHttpError, PostHogFetchNetworkError, PostHogCoreStateless;
|
|
796
806
|
var init_posthog_core_stateless = __esm({
|
|
797
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
807
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs"() {
|
|
798
808
|
init_eventemitter();
|
|
799
809
|
init_featureFlagUtils();
|
|
800
810
|
init_gzip();
|
|
@@ -850,10 +860,11 @@ var init_posthog_core_stateless = __esm({
|
|
|
850
860
|
this.disableGeoip = options.disableGeoip ?? true;
|
|
851
861
|
this.disabled = options.disabled ?? false;
|
|
852
862
|
this.historicalMigration = options?.historicalMigration ?? false;
|
|
853
|
-
this.evaluationEnvironments = options?.evaluationEnvironments;
|
|
854
863
|
this._initPromise = Promise.resolve();
|
|
855
864
|
this._isInitialized = true;
|
|
856
865
|
this._logger = createLogger("[PostHog]", this.logMsgIfDebug.bind(this));
|
|
866
|
+
this.evaluationContexts = options?.evaluationContexts ?? options?.evaluationEnvironments;
|
|
867
|
+
if (options?.evaluationEnvironments && !options?.evaluationContexts) this._logger.warn("evaluationEnvironments is deprecated. Use evaluationContexts instead. This property will be removed in a future version.");
|
|
857
868
|
this.disableCompression = !isGzipSupported() || (options?.disableCompression ?? false);
|
|
858
869
|
}
|
|
859
870
|
logMsgIfDebug(fn) {
|
|
@@ -1028,7 +1039,7 @@ var init_posthog_core_stateless = __esm({
|
|
|
1028
1039
|
group_properties: groupProperties,
|
|
1029
1040
|
...extraPayload
|
|
1030
1041
|
};
|
|
1031
|
-
if (this.
|
|
1042
|
+
if (this.evaluationContexts && this.evaluationContexts.length > 0) requestData.evaluation_contexts = this.evaluationContexts;
|
|
1032
1043
|
const fetchOptions = {
|
|
1033
1044
|
method: "POST",
|
|
1034
1045
|
headers: {
|
|
@@ -1040,10 +1051,35 @@ var init_posthog_core_stateless = __esm({
|
|
|
1040
1051
|
this._logger.info("Flags URL", url);
|
|
1041
1052
|
return this.fetchWithRetry(url, fetchOptions, {
|
|
1042
1053
|
retryCount: 0
|
|
1043
|
-
}, this.featureFlagsRequestTimeoutMs).then((response) => response.json()).then((response) =>
|
|
1054
|
+
}, this.featureFlagsRequestTimeoutMs).then((response) => response.json()).then((response) => ({
|
|
1055
|
+
success: true,
|
|
1056
|
+
response: normalizeFlagsResponse(response)
|
|
1057
|
+
})).catch((error) => {
|
|
1044
1058
|
this._events.emit("error", error);
|
|
1059
|
+
return {
|
|
1060
|
+
success: false,
|
|
1061
|
+
error: this.categorizeRequestError(error)
|
|
1062
|
+
};
|
|
1045
1063
|
});
|
|
1046
1064
|
}
|
|
1065
|
+
categorizeRequestError(error) {
|
|
1066
|
+
if (error instanceof PostHogFetchHttpError) return {
|
|
1067
|
+
type: "api_error",
|
|
1068
|
+
statusCode: error.status
|
|
1069
|
+
};
|
|
1070
|
+
if (error instanceof PostHogFetchNetworkError) {
|
|
1071
|
+
const cause = error.error;
|
|
1072
|
+
if (cause instanceof Error && ("AbortError" === cause.name || "TimeoutError" === cause.name)) return {
|
|
1073
|
+
type: "timeout"
|
|
1074
|
+
};
|
|
1075
|
+
return {
|
|
1076
|
+
type: "connection_error"
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
return {
|
|
1080
|
+
type: "unknown_error"
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1047
1083
|
async getFeatureFlagStateless(key, distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip) {
|
|
1048
1084
|
await this._initPromise;
|
|
1049
1085
|
const flagDetailResponse = await this.getFeatureFlagDetailStateless(key, distinctId, groups, personProperties, groupProperties, disableGeoip);
|
|
@@ -1110,8 +1146,9 @@ var init_posthog_core_stateless = __esm({
|
|
|
1110
1146
|
const extraPayload = {};
|
|
1111
1147
|
if (disableGeoip ?? this.disableGeoip) extraPayload["geoip_disable"] = true;
|
|
1112
1148
|
if (flagKeysToEvaluate) extraPayload["flag_keys_to_evaluate"] = flagKeysToEvaluate;
|
|
1113
|
-
const
|
|
1114
|
-
if (
|
|
1149
|
+
const result = await this.getFlags(distinctId, groups, personProperties, groupProperties, extraPayload);
|
|
1150
|
+
if (!result.success) return;
|
|
1151
|
+
const flagsResponse = result.response;
|
|
1115
1152
|
if (flagsResponse.errorsWhileComputingFlags) console.error("[FEATURE FLAGS] Error while computing feature flags, some flags may be missing or incorrect. Learn more at https://posthog.com/docs/feature-flags/best-practices");
|
|
1116
1153
|
if (flagsResponse.quotaLimited?.includes("feature_flags")) {
|
|
1117
1154
|
console.warn("[FEATURE FLAGS] Feature flags quota limit exceeded - feature flags unavailable. Learn more about billing limits at https://posthog.com/docs/billing/limits-alerts");
|
|
@@ -1178,10 +1215,15 @@ var init_posthog_core_stateless = __esm({
|
|
|
1178
1215
|
this.setPersistedProperty(types_PostHogPersistedProperty.Props, this.props);
|
|
1179
1216
|
});
|
|
1180
1217
|
}
|
|
1218
|
+
processBeforeEnqueue(message2) {
|
|
1219
|
+
return message2;
|
|
1220
|
+
}
|
|
1181
1221
|
enqueue(type, _message, options) {
|
|
1182
1222
|
this.wrap(() => {
|
|
1183
1223
|
if (this.optedOut) return void this._events.emit(type, "Library is disabled. Not sending event. To re-enable, call posthog.optIn()");
|
|
1184
|
-
|
|
1224
|
+
let message2 = this.prepareMessage(type, _message, options);
|
|
1225
|
+
message2 = this.processBeforeEnqueue(message2);
|
|
1226
|
+
if (null === message2) return;
|
|
1185
1227
|
const queue = this.getPersistedProperty(types_PostHogPersistedProperty.Queue) || [];
|
|
1186
1228
|
if (queue.length >= this.maxQueueSize) {
|
|
1187
1229
|
queue.shift();
|
|
@@ -1200,10 +1242,13 @@ var init_posthog_core_stateless = __esm({
|
|
|
1200
1242
|
if (this.disabled) return void this._logger.warn("The client is disabled");
|
|
1201
1243
|
if (!this._isInitialized) await this._initPromise;
|
|
1202
1244
|
if (this.optedOut) return void this._events.emit(type, "Library is disabled. Not sending event. To re-enable, call posthog.optIn()");
|
|
1245
|
+
let message2 = this.prepareMessage(type, _message, options);
|
|
1246
|
+
message2 = this.processBeforeEnqueue(message2);
|
|
1247
|
+
if (null === message2) return;
|
|
1203
1248
|
const data = {
|
|
1204
1249
|
api_key: this.apiKey,
|
|
1205
1250
|
batch: [
|
|
1206
|
-
|
|
1251
|
+
message2
|
|
1207
1252
|
],
|
|
1208
1253
|
sent_at: currentISOTime()
|
|
1209
1254
|
};
|
|
@@ -1412,9 +1457,9 @@ var init_posthog_core_stateless = __esm({
|
|
|
1412
1457
|
}
|
|
1413
1458
|
});
|
|
1414
1459
|
|
|
1415
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1460
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/posthog-core.mjs
|
|
1416
1461
|
var init_posthog_core = __esm({
|
|
1417
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1462
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/posthog-core.mjs"() {
|
|
1418
1463
|
init_featureFlagUtils();
|
|
1419
1464
|
init_types();
|
|
1420
1465
|
init_posthog_core_stateless();
|
|
@@ -1423,7 +1468,7 @@ var init_posthog_core = __esm({
|
|
|
1423
1468
|
}
|
|
1424
1469
|
});
|
|
1425
1470
|
|
|
1426
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1471
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
|
|
1427
1472
|
function getFilenameToChunkIdMap(stackParser) {
|
|
1428
1473
|
const chunkIdMap = globalThis._posthogChunkIds;
|
|
1429
1474
|
if (!chunkIdMap) return;
|
|
@@ -1456,14 +1501,14 @@ function getFilenameToChunkIdMap(stackParser) {
|
|
|
1456
1501
|
}
|
|
1457
1502
|
var parsedStackResults, lastKeysCount, cachedFilenameChunkIds;
|
|
1458
1503
|
var init_chunk_ids = __esm({
|
|
1459
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1504
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs"() {
|
|
1460
1505
|
}
|
|
1461
1506
|
});
|
|
1462
1507
|
|
|
1463
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1508
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs
|
|
1464
1509
|
var MAX_CAUSE_RECURSION, ErrorPropertiesBuilder;
|
|
1465
1510
|
var init_error_properties_builder = __esm({
|
|
1466
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1511
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs"() {
|
|
1467
1512
|
init_utils();
|
|
1468
1513
|
init_chunk_ids();
|
|
1469
1514
|
MAX_CAUSE_RECURSION = 4;
|
|
@@ -1577,7 +1622,7 @@ var init_error_properties_builder = __esm({
|
|
|
1577
1622
|
}
|
|
1578
1623
|
});
|
|
1579
1624
|
|
|
1580
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1625
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs
|
|
1581
1626
|
function createFrame(platform, filename, func, lineno, colno) {
|
|
1582
1627
|
const frame = {
|
|
1583
1628
|
platform,
|
|
@@ -1591,16 +1636,16 @@ function createFrame(platform, filename, func, lineno, colno) {
|
|
|
1591
1636
|
}
|
|
1592
1637
|
var UNKNOWN_FUNCTION;
|
|
1593
1638
|
var init_base = __esm({
|
|
1594
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1639
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs"() {
|
|
1595
1640
|
init_utils();
|
|
1596
1641
|
UNKNOWN_FUNCTION = "?";
|
|
1597
1642
|
}
|
|
1598
1643
|
});
|
|
1599
1644
|
|
|
1600
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1645
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs
|
|
1601
1646
|
var extractSafariExtensionDetails;
|
|
1602
1647
|
var init_safari = __esm({
|
|
1603
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1648
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs"() {
|
|
1604
1649
|
init_base();
|
|
1605
1650
|
extractSafariExtensionDetails = (func, filename) => {
|
|
1606
1651
|
const isSafariExtension = -1 !== func.indexOf("safari-extension");
|
|
@@ -1616,10 +1661,10 @@ var init_safari = __esm({
|
|
|
1616
1661
|
}
|
|
1617
1662
|
});
|
|
1618
1663
|
|
|
1619
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1664
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs
|
|
1620
1665
|
var chromeRegexNoFnName, chromeRegex, chromeEvalRegex, chromeStackLineParser;
|
|
1621
1666
|
var init_chrome = __esm({
|
|
1622
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1667
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs"() {
|
|
1623
1668
|
init_base();
|
|
1624
1669
|
init_safari();
|
|
1625
1670
|
chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i;
|
|
@@ -1649,23 +1694,10 @@ var init_chrome = __esm({
|
|
|
1649
1694
|
}
|
|
1650
1695
|
});
|
|
1651
1696
|
|
|
1652
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1653
|
-
var winjsRegex, winjsStackLineParser;
|
|
1654
|
-
var init_winjs = __esm({
|
|
1655
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs"() {
|
|
1656
|
-
init_base();
|
|
1657
|
-
winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
1658
|
-
winjsStackLineParser = (line, platform) => {
|
|
1659
|
-
const parts = winjsRegex.exec(line);
|
|
1660
|
-
return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : void 0) : void 0;
|
|
1661
|
-
};
|
|
1662
|
-
}
|
|
1663
|
-
});
|
|
1664
|
-
|
|
1665
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
1697
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
1666
1698
|
var geckoREgex, geckoEvalRegex, geckoStackLineParser;
|
|
1667
1699
|
var init_gecko = __esm({
|
|
1668
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1700
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs"() {
|
|
1669
1701
|
init_base();
|
|
1670
1702
|
init_safari();
|
|
1671
1703
|
geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
@@ -1692,10 +1724,23 @@ var init_gecko = __esm({
|
|
|
1692
1724
|
}
|
|
1693
1725
|
});
|
|
1694
1726
|
|
|
1695
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1727
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
|
|
1728
|
+
var winjsRegex, winjsStackLineParser;
|
|
1729
|
+
var init_winjs = __esm({
|
|
1730
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs"() {
|
|
1731
|
+
init_base();
|
|
1732
|
+
winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
1733
|
+
winjsStackLineParser = (line, platform) => {
|
|
1734
|
+
const parts = winjsRegex.exec(line);
|
|
1735
|
+
return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : void 0) : void 0;
|
|
1736
|
+
};
|
|
1737
|
+
}
|
|
1738
|
+
});
|
|
1739
|
+
|
|
1740
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
|
|
1696
1741
|
var opera10Regex, opera10StackLineParser, opera11Regex, opera11StackLineParser;
|
|
1697
1742
|
var init_opera = __esm({
|
|
1698
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1743
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs"() {
|
|
1699
1744
|
init_base();
|
|
1700
1745
|
opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
|
|
1701
1746
|
opera10StackLineParser = (line, platform) => {
|
|
@@ -1710,7 +1755,7 @@ var init_opera = __esm({
|
|
|
1710
1755
|
}
|
|
1711
1756
|
});
|
|
1712
1757
|
|
|
1713
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1758
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
|
|
1714
1759
|
function filenameIsInApp(filename, isNative = false) {
|
|
1715
1760
|
const isInternal = isNative || filename && !filename.startsWith("/") && !filename.match(/^[A-Z]:/) && !filename.startsWith(".") && !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//);
|
|
1716
1761
|
return !isInternal && void 0 !== filename && !filename.includes("node_modules/");
|
|
@@ -1720,7 +1765,7 @@ function _parseIntOrUndefined(input) {
|
|
|
1720
1765
|
}
|
|
1721
1766
|
var FILENAME_MATCH, FULL_MATCH, nodeStackLineParser;
|
|
1722
1767
|
var init_node = __esm({
|
|
1723
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1768
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs"() {
|
|
1724
1769
|
init_base();
|
|
1725
1770
|
FILENAME_MATCH = /^\s*[-]{4,}$/;
|
|
1726
1771
|
FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
@@ -1781,7 +1826,7 @@ var init_node = __esm({
|
|
|
1781
1826
|
}
|
|
1782
1827
|
});
|
|
1783
1828
|
|
|
1784
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1829
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs
|
|
1785
1830
|
function reverseAndStripFrames(stack) {
|
|
1786
1831
|
if (!stack.length) return [];
|
|
1787
1832
|
const localStack = Array.from(stack);
|
|
@@ -1795,6 +1840,9 @@ function reverseAndStripFrames(stack) {
|
|
|
1795
1840
|
function getLastStackFrame(arr) {
|
|
1796
1841
|
return arr[arr.length - 1] || {};
|
|
1797
1842
|
}
|
|
1843
|
+
function createDefaultStackParser() {
|
|
1844
|
+
return createStackParser("web:javascript", chromeStackLineParser, geckoStackLineParser);
|
|
1845
|
+
}
|
|
1798
1846
|
function createStackParser(platform, ...parsers) {
|
|
1799
1847
|
return (stack, skipFirstLines = 0) => {
|
|
1800
1848
|
const frames = [];
|
|
@@ -1819,11 +1867,11 @@ function createStackParser(platform, ...parsers) {
|
|
|
1819
1867
|
}
|
|
1820
1868
|
var WEBPACK_ERROR_REGEXP, STACKTRACE_FRAME_LIMIT;
|
|
1821
1869
|
var init_parsers = __esm({
|
|
1822
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1870
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs"() {
|
|
1823
1871
|
init_base();
|
|
1824
1872
|
init_chrome();
|
|
1825
|
-
init_winjs();
|
|
1826
1873
|
init_gecko();
|
|
1874
|
+
init_winjs();
|
|
1827
1875
|
init_opera();
|
|
1828
1876
|
init_node();
|
|
1829
1877
|
WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
|
|
@@ -1831,10 +1879,10 @@ var init_parsers = __esm({
|
|
|
1831
1879
|
}
|
|
1832
1880
|
});
|
|
1833
1881
|
|
|
1834
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1882
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
|
|
1835
1883
|
var DOMExceptionCoercer;
|
|
1836
1884
|
var init_dom_exception_coercer = __esm({
|
|
1837
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1885
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs"() {
|
|
1838
1886
|
init_utils();
|
|
1839
1887
|
DOMExceptionCoercer = class {
|
|
1840
1888
|
match(err) {
|
|
@@ -1868,10 +1916,10 @@ var init_dom_exception_coercer = __esm({
|
|
|
1868
1916
|
}
|
|
1869
1917
|
});
|
|
1870
1918
|
|
|
1871
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1919
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
|
|
1872
1920
|
var ErrorCoercer;
|
|
1873
1921
|
var init_error_coercer = __esm({
|
|
1874
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1922
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs"() {
|
|
1875
1923
|
init_utils();
|
|
1876
1924
|
ErrorCoercer = class {
|
|
1877
1925
|
match(err) {
|
|
@@ -1901,10 +1949,10 @@ var init_error_coercer = __esm({
|
|
|
1901
1949
|
}
|
|
1902
1950
|
});
|
|
1903
1951
|
|
|
1904
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1952
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
|
|
1905
1953
|
var ErrorEventCoercer;
|
|
1906
1954
|
var init_error_event_coercer = __esm({
|
|
1907
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1955
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs"() {
|
|
1908
1956
|
init_utils();
|
|
1909
1957
|
ErrorEventCoercer = class {
|
|
1910
1958
|
constructor() {
|
|
@@ -1926,10 +1974,10 @@ var init_error_event_coercer = __esm({
|
|
|
1926
1974
|
}
|
|
1927
1975
|
});
|
|
1928
1976
|
|
|
1929
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1977
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
|
|
1930
1978
|
var ERROR_TYPES_PATTERN, StringCoercer;
|
|
1931
1979
|
var init_string_coercer = __esm({
|
|
1932
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1980
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs"() {
|
|
1933
1981
|
ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
|
|
1934
1982
|
StringCoercer = class {
|
|
1935
1983
|
match(input) {
|
|
@@ -1961,10 +2009,10 @@ var init_string_coercer = __esm({
|
|
|
1961
2009
|
}
|
|
1962
2010
|
});
|
|
1963
2011
|
|
|
1964
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2012
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/types.mjs
|
|
1965
2013
|
var severityLevels;
|
|
1966
2014
|
var init_types2 = __esm({
|
|
1967
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2015
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/types.mjs"() {
|
|
1968
2016
|
severityLevels = [
|
|
1969
2017
|
"fatal",
|
|
1970
2018
|
"error",
|
|
@@ -1976,7 +2024,7 @@ var init_types2 = __esm({
|
|
|
1976
2024
|
}
|
|
1977
2025
|
});
|
|
1978
2026
|
|
|
1979
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2027
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs
|
|
1980
2028
|
function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
1981
2029
|
const keys = Object.keys(err);
|
|
1982
2030
|
keys.sort();
|
|
@@ -1991,14 +2039,14 @@ function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
|
1991
2039
|
return "";
|
|
1992
2040
|
}
|
|
1993
2041
|
var init_utils2 = __esm({
|
|
1994
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2042
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs"() {
|
|
1995
2043
|
}
|
|
1996
2044
|
});
|
|
1997
2045
|
|
|
1998
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2046
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs
|
|
1999
2047
|
var ObjectCoercer;
|
|
2000
2048
|
var init_object_coercer = __esm({
|
|
2001
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2049
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs"() {
|
|
2002
2050
|
init_utils();
|
|
2003
2051
|
init_types2();
|
|
2004
2052
|
init_utils2();
|
|
@@ -2052,10 +2100,10 @@ var init_object_coercer = __esm({
|
|
|
2052
2100
|
}
|
|
2053
2101
|
});
|
|
2054
2102
|
|
|
2055
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2103
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs
|
|
2056
2104
|
var EventCoercer;
|
|
2057
2105
|
var init_event_coercer = __esm({
|
|
2058
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2106
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs"() {
|
|
2059
2107
|
init_utils();
|
|
2060
2108
|
init_utils2();
|
|
2061
2109
|
EventCoercer = class {
|
|
@@ -2075,10 +2123,10 @@ var init_event_coercer = __esm({
|
|
|
2075
2123
|
}
|
|
2076
2124
|
});
|
|
2077
2125
|
|
|
2078
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2126
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs
|
|
2079
2127
|
var PrimitiveCoercer;
|
|
2080
2128
|
var init_primitive_coercer = __esm({
|
|
2081
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2129
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs"() {
|
|
2082
2130
|
init_utils();
|
|
2083
2131
|
PrimitiveCoercer = class {
|
|
2084
2132
|
match(candidate) {
|
|
@@ -2096,10 +2144,10 @@ var init_primitive_coercer = __esm({
|
|
|
2096
2144
|
}
|
|
2097
2145
|
});
|
|
2098
2146
|
|
|
2099
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2147
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
|
|
2100
2148
|
var PromiseRejectionEventCoercer;
|
|
2101
2149
|
var init_promise_rejection_event = __esm({
|
|
2102
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2150
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs"() {
|
|
2103
2151
|
init_utils();
|
|
2104
2152
|
PromiseRejectionEventCoercer = class {
|
|
2105
2153
|
match(err) {
|
|
@@ -2128,9 +2176,9 @@ var init_promise_rejection_event = __esm({
|
|
|
2128
2176
|
}
|
|
2129
2177
|
});
|
|
2130
2178
|
|
|
2131
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2179
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs
|
|
2132
2180
|
var init_coercers = __esm({
|
|
2133
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2181
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs"() {
|
|
2134
2182
|
init_dom_exception_coercer();
|
|
2135
2183
|
init_error_coercer();
|
|
2136
2184
|
init_error_event_coercer();
|
|
@@ -2142,10 +2190,10 @@ var init_coercers = __esm({
|
|
|
2142
2190
|
}
|
|
2143
2191
|
});
|
|
2144
2192
|
|
|
2145
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2193
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/utils.mjs
|
|
2146
2194
|
var ReduceableCache;
|
|
2147
2195
|
var init_utils3 = __esm({
|
|
2148
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2196
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/utils.mjs"() {
|
|
2149
2197
|
ReduceableCache = class {
|
|
2150
2198
|
constructor(_maxSize) {
|
|
2151
2199
|
this._maxSize = _maxSize;
|
|
@@ -2171,7 +2219,7 @@ var init_utils3 = __esm({
|
|
|
2171
2219
|
}
|
|
2172
2220
|
});
|
|
2173
2221
|
|
|
2174
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2222
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/index.mjs
|
|
2175
2223
|
var error_tracking_exports = {};
|
|
2176
2224
|
__export(error_tracking_exports, {
|
|
2177
2225
|
DOMExceptionCoercer: () => DOMExceptionCoercer,
|
|
@@ -2185,6 +2233,7 @@ __export(error_tracking_exports, {
|
|
|
2185
2233
|
ReduceableCache: () => ReduceableCache,
|
|
2186
2234
|
StringCoercer: () => StringCoercer,
|
|
2187
2235
|
chromeStackLineParser: () => chromeStackLineParser,
|
|
2236
|
+
createDefaultStackParser: () => createDefaultStackParser,
|
|
2188
2237
|
createStackParser: () => createStackParser,
|
|
2189
2238
|
geckoStackLineParser: () => geckoStackLineParser,
|
|
2190
2239
|
nodeStackLineParser: () => nodeStackLineParser,
|
|
@@ -2194,7 +2243,7 @@ __export(error_tracking_exports, {
|
|
|
2194
2243
|
winjsStackLineParser: () => winjsStackLineParser
|
|
2195
2244
|
});
|
|
2196
2245
|
var init_error_tracking = __esm({
|
|
2197
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2246
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/index.mjs"() {
|
|
2198
2247
|
init_error_properties_builder();
|
|
2199
2248
|
init_parsers();
|
|
2200
2249
|
init_coercers();
|
|
@@ -2202,9 +2251,9 @@ var init_error_tracking = __esm({
|
|
|
2202
2251
|
}
|
|
2203
2252
|
});
|
|
2204
2253
|
|
|
2205
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2254
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/index.mjs
|
|
2206
2255
|
var init_dist = __esm({
|
|
2207
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2256
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/index.mjs"() {
|
|
2208
2257
|
init_featureFlagUtils();
|
|
2209
2258
|
init_uuidv7();
|
|
2210
2259
|
init_utils();
|
|
@@ -2395,7 +2444,7 @@ function snipLine(line, colno) {
|
|
|
2395
2444
|
}
|
|
2396
2445
|
var LRU_FILE_CONTENTS_CACHE, LRU_FILE_CONTENTS_FS_READ_FAILED, DEFAULT_LINES_OF_CONTEXT, MAX_CONTEXTLINES_COLNO, MAX_CONTEXTLINES_LINENO;
|
|
2397
2446
|
var init_context_lines_node = __esm({
|
|
2398
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2447
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs"() {
|
|
2399
2448
|
init_dist();
|
|
2400
2449
|
LRU_FILE_CONTENTS_CACHE = new error_tracking_exports.ReduceableCache(25);
|
|
2401
2450
|
LRU_FILE_CONTENTS_FS_READ_FAILED = new error_tracking_exports.ReduceableCache(20);
|
|
@@ -2405,7 +2454,7 @@ var init_context_lines_node = __esm({
|
|
|
2405
2454
|
}
|
|
2406
2455
|
});
|
|
2407
2456
|
|
|
2408
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2457
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs
|
|
2409
2458
|
function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
|
|
2410
2459
|
let calledFatalError = false;
|
|
2411
2460
|
return Object.assign((error) => {
|
|
@@ -2437,14 +2486,14 @@ function addUnhandledRejectionListener(captureFn) {
|
|
|
2437
2486
|
}));
|
|
2438
2487
|
}
|
|
2439
2488
|
var init_autocapture = __esm({
|
|
2440
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2489
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs"() {
|
|
2441
2490
|
}
|
|
2442
2491
|
});
|
|
2443
2492
|
|
|
2444
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2493
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs
|
|
2445
2494
|
var SHUTDOWN_TIMEOUT, ErrorTracking;
|
|
2446
2495
|
var init_error_tracking2 = __esm({
|
|
2447
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2496
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs"() {
|
|
2448
2497
|
init_autocapture();
|
|
2449
2498
|
init_dist();
|
|
2450
2499
|
SHUTDOWN_TIMEOUT = 2e3;
|
|
@@ -2461,6 +2510,9 @@ var init_error_tracking2 = __esm({
|
|
|
2461
2510
|
});
|
|
2462
2511
|
this.startAutocaptureIfEnabled();
|
|
2463
2512
|
}
|
|
2513
|
+
static isPreviouslyCapturedError(x) {
|
|
2514
|
+
return isObject(x) && "__posthog_previously_captured_error" in x && true === x.__posthog_previously_captured_error;
|
|
2515
|
+
}
|
|
2464
2516
|
static async buildEventMessage(error, hint, distinctId, additionalProperties) {
|
|
2465
2517
|
const properties = {
|
|
2466
2518
|
...additionalProperties
|
|
@@ -2485,14 +2537,16 @@ var init_error_tracking2 = __esm({
|
|
|
2485
2537
|
}
|
|
2486
2538
|
onException(exception, hint) {
|
|
2487
2539
|
this.client.addPendingPromise((async () => {
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
exception
|
|
2494
|
-
|
|
2495
|
-
|
|
2540
|
+
if (!_ErrorTracking.isPreviouslyCapturedError(exception)) {
|
|
2541
|
+
const eventMessage = await _ErrorTracking.buildEventMessage(exception, hint);
|
|
2542
|
+
const exceptionProperties = eventMessage.properties;
|
|
2543
|
+
const exceptionType = exceptionProperties?.$exception_list[0]?.type ?? "Exception";
|
|
2544
|
+
const isRateLimited = this._rateLimiter.consumeRateLimit(exceptionType);
|
|
2545
|
+
if (isRateLimited) return void this._logger.info("Skipping exception capture because of client rate limiting.", {
|
|
2546
|
+
exception: exceptionType
|
|
2547
|
+
});
|
|
2548
|
+
return this.client.capture(eventMessage);
|
|
2549
|
+
}
|
|
2496
2550
|
})());
|
|
2497
2551
|
}
|
|
2498
2552
|
async onFatalError(exception) {
|
|
@@ -2510,19 +2564,19 @@ var init_error_tracking2 = __esm({
|
|
|
2510
2564
|
}
|
|
2511
2565
|
});
|
|
2512
2566
|
|
|
2513
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2567
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/version.mjs
|
|
2514
2568
|
var version;
|
|
2515
2569
|
var init_version = __esm({
|
|
2516
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2517
|
-
version = "5.
|
|
2570
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/version.mjs"() {
|
|
2571
|
+
version = "5.24.1";
|
|
2518
2572
|
}
|
|
2519
2573
|
});
|
|
2520
2574
|
|
|
2521
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2522
|
-
var
|
|
2575
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/types.mjs
|
|
2576
|
+
var FeatureFlagError2;
|
|
2523
2577
|
var init_types3 = __esm({
|
|
2524
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2525
|
-
|
|
2578
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/types.mjs"() {
|
|
2579
|
+
FeatureFlagError2 = {
|
|
2526
2580
|
ERRORS_WHILE_COMPUTING: "errors_while_computing_flags",
|
|
2527
2581
|
FLAG_MISSING: "flag_missing",
|
|
2528
2582
|
QUOTA_LIMITED: "quota_limited",
|
|
@@ -2531,7 +2585,7 @@ var init_types3 = __esm({
|
|
|
2531
2585
|
}
|
|
2532
2586
|
});
|
|
2533
2587
|
|
|
2534
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2588
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs
|
|
2535
2589
|
async function hashSHA1(text) {
|
|
2536
2590
|
const subtle = globalThis.crypto?.subtle;
|
|
2537
2591
|
if (!subtle) throw new Error("SubtleCrypto API not available");
|
|
@@ -2540,11 +2594,11 @@ async function hashSHA1(text) {
|
|
|
2540
2594
|
return hashArray.map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2541
2595
|
}
|
|
2542
2596
|
var init_crypto = __esm({
|
|
2543
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2597
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs"() {
|
|
2544
2598
|
}
|
|
2545
2599
|
});
|
|
2546
2600
|
|
|
2547
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2601
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs
|
|
2548
2602
|
async function _hash(key, distinctId, salt = "") {
|
|
2549
2603
|
const hashString = await hashSHA1(`${key}.${distinctId}${salt}`);
|
|
2550
2604
|
return parseInt(hashString.slice(0, 15), 16) / LONG_SCALE;
|
|
@@ -2712,7 +2766,7 @@ function relativeDateParseForFeatureFlagMatching(value) {
|
|
|
2712
2766
|
}
|
|
2713
2767
|
var SIXTY_SECONDS, LONG_SCALE, NULL_VALUES_ALLOWED_OPERATORS, ClientError, InconclusiveMatchError, RequiresServerEvaluation, FeatureFlagsPoller;
|
|
2714
2768
|
var init_feature_flags = __esm({
|
|
2715
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2769
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs"() {
|
|
2716
2770
|
init_dist();
|
|
2717
2771
|
init_crypto();
|
|
2718
2772
|
SIXTY_SECONDS = 6e4;
|
|
@@ -2766,6 +2820,7 @@ var init_feature_flags = __esm({
|
|
|
2766
2820
|
this.customHeaders = customHeaders;
|
|
2767
2821
|
this.onLoad = options.onLoad;
|
|
2768
2822
|
this.cacheProvider = options.cacheProvider;
|
|
2823
|
+
this.strictLocalEvaluation = options.strictLocalEvaluation ?? false;
|
|
2769
2824
|
this.loadFeatureFlags();
|
|
2770
2825
|
}
|
|
2771
2826
|
debug(enabled = true) {
|
|
@@ -2961,6 +3016,11 @@ var init_feature_flags = __esm({
|
|
|
2961
3016
|
this.cohorts = flagData.cohorts;
|
|
2962
3017
|
this.loadedSuccessfullyOnce = true;
|
|
2963
3018
|
}
|
|
3019
|
+
warnAboutExperienceContinuityFlags(flags) {
|
|
3020
|
+
if (this.strictLocalEvaluation) return;
|
|
3021
|
+
const experienceContinuityFlags = flags.filter((f) => f.ensure_experience_continuity);
|
|
3022
|
+
if (experienceContinuityFlags.length > 0) console.warn(`[PostHog] You are using local evaluation but ${experienceContinuityFlags.length} flag(s) have experience continuity enabled: ${experienceContinuityFlags.map((f) => f.key).join(", ")}. Experience continuity is incompatible with local evaluation and will cause a server request on every flag evaluation, negating local evaluation cost savings. To avoid server requests and unexpected costs, either disable experience continuity on these flags in PostHog, use strictLocalEvaluation: true in client init, or pass onlyEvaluateLocally: true per flag call (flags that cannot be evaluated locally will return undefined).`);
|
|
3023
|
+
}
|
|
2964
3024
|
async loadFromCache(debugMessage) {
|
|
2965
3025
|
if (!this.cacheProvider) return false;
|
|
2966
3026
|
try {
|
|
@@ -2969,6 +3029,7 @@ var init_feature_flags = __esm({
|
|
|
2969
3029
|
this.updateFlagState(cached);
|
|
2970
3030
|
this.logMsgIfDebug(() => console.debug(`[FEATURE FLAGS] ${debugMessage} (${cached.flags.length} flags)`));
|
|
2971
3031
|
this.onLoad?.(this.featureFlags.length);
|
|
3032
|
+
this.warnAboutExperienceContinuityFlags(cached.flags);
|
|
2972
3033
|
return true;
|
|
2973
3034
|
}
|
|
2974
3035
|
return false;
|
|
@@ -3062,6 +3123,7 @@ var init_feature_flags = __esm({
|
|
|
3062
3123
|
this.onError?.(new Error(`Failed to store in cache: ${err}`));
|
|
3063
3124
|
}
|
|
3064
3125
|
this.onLoad?.(this.featureFlags.length);
|
|
3126
|
+
this.warnAboutExperienceContinuityFlags(flagData.flags);
|
|
3065
3127
|
break;
|
|
3066
3128
|
}
|
|
3067
3129
|
default:
|
|
@@ -3117,10 +3179,10 @@ var init_feature_flags = __esm({
|
|
|
3117
3179
|
}
|
|
3118
3180
|
});
|
|
3119
3181
|
|
|
3120
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3182
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/storage-memory.mjs
|
|
3121
3183
|
var PostHogMemoryStorage;
|
|
3122
3184
|
var init_storage_memory = __esm({
|
|
3123
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3185
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/storage-memory.mjs"() {
|
|
3124
3186
|
PostHogMemoryStorage = class {
|
|
3125
3187
|
getProperty(key) {
|
|
3126
3188
|
return this._memoryStorage[key];
|
|
@@ -3135,10 +3197,10 @@ var init_storage_memory = __esm({
|
|
|
3135
3197
|
}
|
|
3136
3198
|
});
|
|
3137
3199
|
|
|
3138
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3200
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/client.mjs
|
|
3139
3201
|
var MINIMUM_POLLING_INTERVAL, THIRTY_SECONDS, MAX_CACHE_SIZE, PostHogBackendClient;
|
|
3140
3202
|
var init_client = __esm({
|
|
3141
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3203
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/client.mjs"() {
|
|
3142
3204
|
init_version();
|
|
3143
3205
|
init_dist();
|
|
3144
3206
|
init_types3();
|
|
@@ -3171,7 +3233,8 @@ var init_client = __esm({
|
|
|
3171
3233
|
this._events.emit("localEvaluationFlagsLoaded", count);
|
|
3172
3234
|
},
|
|
3173
3235
|
customHeaders: this.getCustomHeaders(),
|
|
3174
|
-
cacheProvider: options.flagDefinitionCacheProvider
|
|
3236
|
+
cacheProvider: options.flagDefinitionCacheProvider,
|
|
3237
|
+
strictLocalEvaluation: options.strictLocalEvaluation
|
|
3175
3238
|
});
|
|
3176
3239
|
}
|
|
3177
3240
|
this.errorTracking = new ErrorTracking(this, options, this._logger);
|
|
@@ -3277,94 +3340,148 @@ var init_client = __esm({
|
|
|
3277
3340
|
});
|
|
3278
3341
|
});
|
|
3279
3342
|
}
|
|
3280
|
-
async
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3343
|
+
async _getFeatureFlagResult(key, distinctId, options = {}, matchValue) {
|
|
3344
|
+
const sendFeatureFlagEvents = options.sendFeatureFlagEvents ?? true;
|
|
3345
|
+
if (void 0 !== this._flagOverrides && key in this._flagOverrides) {
|
|
3346
|
+
const overrideValue = this._flagOverrides[key];
|
|
3347
|
+
if (void 0 === overrideValue) return;
|
|
3348
|
+
const overridePayload = this._payloadOverrides?.[key];
|
|
3349
|
+
return {
|
|
3350
|
+
key,
|
|
3351
|
+
enabled: false !== overrideValue,
|
|
3352
|
+
variant: "string" == typeof overrideValue ? overrideValue : void 0,
|
|
3353
|
+
payload: overridePayload
|
|
3354
|
+
};
|
|
3355
|
+
}
|
|
3356
|
+
const { groups, disableGeoip } = options;
|
|
3357
|
+
let { onlyEvaluateLocally, personProperties, groupProperties } = options;
|
|
3284
3358
|
const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);
|
|
3285
3359
|
personProperties = adjustedProperties.allPersonProperties;
|
|
3286
3360
|
groupProperties = adjustedProperties.allGroupProperties;
|
|
3287
|
-
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = false;
|
|
3288
|
-
|
|
3289
|
-
let
|
|
3290
|
-
const flagWasLocallyEvaluated = void 0 !== response;
|
|
3361
|
+
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
|
|
3362
|
+
let result;
|
|
3363
|
+
let flagWasLocallyEvaluated = false;
|
|
3291
3364
|
let requestId;
|
|
3292
3365
|
let evaluatedAt;
|
|
3293
|
-
let flagDetail;
|
|
3294
3366
|
let featureFlagError;
|
|
3367
|
+
let flagId;
|
|
3368
|
+
let flagVersion;
|
|
3369
|
+
let flagReason;
|
|
3370
|
+
const localEvaluationEnabled = void 0 !== this.featureFlagsPoller;
|
|
3371
|
+
if (localEvaluationEnabled) {
|
|
3372
|
+
await this.featureFlagsPoller?.loadFeatureFlags();
|
|
3373
|
+
const flag = this.featureFlagsPoller?.featureFlagsByKey[key];
|
|
3374
|
+
if (flag) try {
|
|
3375
|
+
const localResult = await this.featureFlagsPoller?.computeFlagAndPayloadLocally(flag, distinctId, groups, personProperties, groupProperties, matchValue);
|
|
3376
|
+
if (localResult) {
|
|
3377
|
+
flagWasLocallyEvaluated = true;
|
|
3378
|
+
const value = localResult.value;
|
|
3379
|
+
flagId = flag.id;
|
|
3380
|
+
flagReason = "Evaluated locally";
|
|
3381
|
+
result = {
|
|
3382
|
+
key,
|
|
3383
|
+
enabled: false !== value,
|
|
3384
|
+
variant: "string" == typeof value ? value : void 0,
|
|
3385
|
+
payload: localResult.payload ?? void 0
|
|
3386
|
+
};
|
|
3387
|
+
}
|
|
3388
|
+
} catch (e) {
|
|
3389
|
+
if (e instanceof RequiresServerEvaluation || e instanceof InconclusiveMatchError) this._logger?.info(`${e.name} when computing flag locally: ${key}: ${e.message}`);
|
|
3390
|
+
else throw e;
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3295
3393
|
if (!flagWasLocallyEvaluated && !onlyEvaluateLocally) {
|
|
3296
3394
|
const flagsResponse = await super.getFeatureFlagDetailsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, [
|
|
3297
3395
|
key
|
|
3298
3396
|
]);
|
|
3299
|
-
if (void 0 === flagsResponse) featureFlagError =
|
|
3397
|
+
if (void 0 === flagsResponse) featureFlagError = FeatureFlagError2.UNKNOWN_ERROR;
|
|
3300
3398
|
else {
|
|
3301
3399
|
requestId = flagsResponse.requestId;
|
|
3302
3400
|
evaluatedAt = flagsResponse.evaluatedAt;
|
|
3303
3401
|
const errors = [];
|
|
3304
|
-
if (flagsResponse.errorsWhileComputingFlags) errors.push(
|
|
3305
|
-
if (flagsResponse.quotaLimited?.includes("feature_flags")) errors.push(
|
|
3306
|
-
flagDetail = flagsResponse.flags[key];
|
|
3307
|
-
if (void 0 === flagDetail) errors.push(
|
|
3402
|
+
if (flagsResponse.errorsWhileComputingFlags) errors.push(FeatureFlagError2.ERRORS_WHILE_COMPUTING);
|
|
3403
|
+
if (flagsResponse.quotaLimited?.includes("feature_flags")) errors.push(FeatureFlagError2.QUOTA_LIMITED);
|
|
3404
|
+
const flagDetail = flagsResponse.flags[key];
|
|
3405
|
+
if (void 0 === flagDetail) errors.push(FeatureFlagError2.FLAG_MISSING);
|
|
3406
|
+
else {
|
|
3407
|
+
flagId = flagDetail.metadata?.id;
|
|
3408
|
+
flagVersion = flagDetail.metadata?.version;
|
|
3409
|
+
flagReason = flagDetail.reason?.description ?? flagDetail.reason?.code;
|
|
3410
|
+
let parsedPayload;
|
|
3411
|
+
if (flagDetail.metadata?.payload !== void 0) try {
|
|
3412
|
+
parsedPayload = JSON.parse(flagDetail.metadata.payload);
|
|
3413
|
+
} catch {
|
|
3414
|
+
parsedPayload = flagDetail.metadata.payload;
|
|
3415
|
+
}
|
|
3416
|
+
result = {
|
|
3417
|
+
key,
|
|
3418
|
+
enabled: flagDetail.enabled,
|
|
3419
|
+
variant: flagDetail.variant,
|
|
3420
|
+
payload: parsedPayload
|
|
3421
|
+
};
|
|
3422
|
+
}
|
|
3308
3423
|
if (errors.length > 0) featureFlagError = errors.join(",");
|
|
3309
|
-
response = getFeatureFlagValue(flagDetail);
|
|
3310
3424
|
}
|
|
3311
3425
|
}
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
if (
|
|
3316
|
-
|
|
3317
|
-
featureFlagReportedKey
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3426
|
+
if (sendFeatureFlagEvents) {
|
|
3427
|
+
const response = void 0 === result ? void 0 : false === result.enabled ? false : result.variant ?? true;
|
|
3428
|
+
const featureFlagReportedKey = `${key}_${response}`;
|
|
3429
|
+
if (!(distinctId in this.distinctIdHasSentFlagCalls) || !this.distinctIdHasSentFlagCalls[distinctId].includes(featureFlagReportedKey)) {
|
|
3430
|
+
if (Object.keys(this.distinctIdHasSentFlagCalls).length >= this.maxCacheSize) this.distinctIdHasSentFlagCalls = {};
|
|
3431
|
+
if (Array.isArray(this.distinctIdHasSentFlagCalls[distinctId])) this.distinctIdHasSentFlagCalls[distinctId].push(featureFlagReportedKey);
|
|
3432
|
+
else this.distinctIdHasSentFlagCalls[distinctId] = [
|
|
3433
|
+
featureFlagReportedKey
|
|
3434
|
+
];
|
|
3435
|
+
const properties = {
|
|
3436
|
+
$feature_flag: key,
|
|
3437
|
+
$feature_flag_response: response,
|
|
3438
|
+
$feature_flag_id: flagId,
|
|
3439
|
+
$feature_flag_version: flagVersion,
|
|
3440
|
+
$feature_flag_reason: flagReason,
|
|
3441
|
+
locally_evaluated: flagWasLocallyEvaluated,
|
|
3442
|
+
[`$feature/${key}`]: response,
|
|
3443
|
+
$feature_flag_request_id: requestId,
|
|
3444
|
+
$feature_flag_evaluated_at: evaluatedAt
|
|
3445
|
+
};
|
|
3446
|
+
if (featureFlagError) properties.$feature_flag_error = featureFlagError;
|
|
3447
|
+
this.capture({
|
|
3448
|
+
distinctId,
|
|
3449
|
+
event: "$feature_flag_called",
|
|
3450
|
+
properties,
|
|
3451
|
+
groups,
|
|
3452
|
+
disableGeoip
|
|
3453
|
+
});
|
|
3454
|
+
}
|
|
3338
3455
|
}
|
|
3339
|
-
|
|
3456
|
+
if (void 0 !== result && void 0 !== this._payloadOverrides && key in this._payloadOverrides) result = {
|
|
3457
|
+
...result,
|
|
3458
|
+
payload: this._payloadOverrides[key]
|
|
3459
|
+
};
|
|
3460
|
+
return result;
|
|
3461
|
+
}
|
|
3462
|
+
async getFeatureFlag(key, distinctId, options) {
|
|
3463
|
+
const result = await this._getFeatureFlagResult(key, distinctId, {
|
|
3464
|
+
...options,
|
|
3465
|
+
sendFeatureFlagEvents: options?.sendFeatureFlagEvents ?? this.options.sendFeatureFlagEvent ?? true
|
|
3466
|
+
});
|
|
3467
|
+
if (void 0 === result) return;
|
|
3468
|
+
if (false === result.enabled) return false;
|
|
3469
|
+
return result.variant ?? true;
|
|
3340
3470
|
}
|
|
3341
3471
|
async getFeatureFlagPayload(key, distinctId, matchValue, options) {
|
|
3342
3472
|
if (void 0 !== this._payloadOverrides && key in this._payloadOverrides) return this._payloadOverrides[key];
|
|
3343
|
-
const
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
if (result) {
|
|
3356
|
-
matchValue = result.value;
|
|
3357
|
-
response = result.payload;
|
|
3358
|
-
}
|
|
3359
|
-
} catch (e) {
|
|
3360
|
-
if (e instanceof RequiresServerEvaluation || e instanceof InconclusiveMatchError) this._logger?.info(`${e.name} when computing flag locally: ${flag.key}: ${e.message}`);
|
|
3361
|
-
else throw e;
|
|
3362
|
-
}
|
|
3363
|
-
}
|
|
3364
|
-
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = false;
|
|
3365
|
-
const payloadWasLocallyEvaluated = void 0 !== response;
|
|
3366
|
-
if (!payloadWasLocallyEvaluated && !onlyEvaluateLocally) response = await super.getFeatureFlagPayloadStateless(key, distinctId, groups, personProperties, groupProperties, disableGeoip);
|
|
3367
|
-
return response;
|
|
3473
|
+
const result = await this._getFeatureFlagResult(key, distinctId, {
|
|
3474
|
+
...options,
|
|
3475
|
+
sendFeatureFlagEvents: false
|
|
3476
|
+
}, matchValue);
|
|
3477
|
+
if (void 0 === result) return;
|
|
3478
|
+
return result.payload ?? null;
|
|
3479
|
+
}
|
|
3480
|
+
async getFeatureFlagResult(key, distinctId, options) {
|
|
3481
|
+
return this._getFeatureFlagResult(key, distinctId, {
|
|
3482
|
+
...options,
|
|
3483
|
+
sendFeatureFlagEvents: options?.sendFeatureFlagEvents ?? this.options.sendFeatureFlagEvent ?? true
|
|
3484
|
+
});
|
|
3368
3485
|
}
|
|
3369
3486
|
async getRemoteConfigPayload(flagKey) {
|
|
3370
3487
|
if (!this.options.personalApiKey) throw new Error("Personal API key is required for remote config payload decryption");
|
|
@@ -3392,7 +3509,7 @@ var init_client = __esm({
|
|
|
3392
3509
|
const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);
|
|
3393
3510
|
personProperties = adjustedProperties.allPersonProperties;
|
|
3394
3511
|
groupProperties = adjustedProperties.allGroupProperties;
|
|
3395
|
-
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = false;
|
|
3512
|
+
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
|
|
3396
3513
|
const localEvaluationResult = await this.featureFlagsPoller?.getAllFlagsAndPayloads(distinctId, groups, personProperties, groupProperties, flagKeys);
|
|
3397
3514
|
let featureFlags = {};
|
|
3398
3515
|
let featureFlagPayloads = {};
|
|
@@ -3542,7 +3659,7 @@ var init_client = __esm({
|
|
|
3542
3659
|
const finalPersonProperties = sendFeatureFlagsOptions?.personProperties || {};
|
|
3543
3660
|
const finalGroupProperties = sendFeatureFlagsOptions?.groupProperties || {};
|
|
3544
3661
|
const flagKeys = sendFeatureFlagsOptions?.flagKeys;
|
|
3545
|
-
const onlyEvaluateLocally = sendFeatureFlagsOptions?.onlyEvaluateLocally ?? false;
|
|
3662
|
+
const onlyEvaluateLocally = sendFeatureFlagsOptions?.onlyEvaluateLocally ?? this.options.strictLocalEvaluation ?? false;
|
|
3546
3663
|
if (onlyEvaluateLocally) if (!((this.featureFlagsPoller?.featureFlags?.length || 0) > 0)) return {};
|
|
3547
3664
|
else {
|
|
3548
3665
|
const groupsWithStringValues = {};
|
|
@@ -3585,17 +3702,24 @@ var init_client = __esm({
|
|
|
3585
3702
|
allGroupProperties
|
|
3586
3703
|
};
|
|
3587
3704
|
}
|
|
3588
|
-
captureException(error, distinctId, additionalProperties) {
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3705
|
+
captureException(error, distinctId, additionalProperties, uuid) {
|
|
3706
|
+
if (!ErrorTracking.isPreviouslyCapturedError(error)) {
|
|
3707
|
+
const syntheticException = new Error("PostHog syntheticException");
|
|
3708
|
+
this.addPendingPromise(ErrorTracking.buildEventMessage(error, {
|
|
3709
|
+
syntheticException
|
|
3710
|
+
}, distinctId, additionalProperties).then((msg) => this.capture({
|
|
3711
|
+
...msg,
|
|
3712
|
+
uuid
|
|
3713
|
+
})));
|
|
3714
|
+
}
|
|
3593
3715
|
}
|
|
3594
3716
|
async captureExceptionImmediate(error, distinctId, additionalProperties) {
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3717
|
+
if (!ErrorTracking.isPreviouslyCapturedError(error)) {
|
|
3718
|
+
const syntheticException = new Error("PostHog syntheticException");
|
|
3719
|
+
this.addPendingPromise(ErrorTracking.buildEventMessage(error, {
|
|
3720
|
+
syntheticException
|
|
3721
|
+
}, distinctId, additionalProperties).then((msg) => this.captureImmediate(msg)));
|
|
3722
|
+
}
|
|
3599
3723
|
}
|
|
3600
3724
|
async prepareEventMessage(props) {
|
|
3601
3725
|
const { distinctId, event, properties, groups, sendFeatureFlags, timestamp, disableGeoip, uuid } = props;
|
|
@@ -3684,7 +3808,7 @@ var init_client = __esm({
|
|
|
3684
3808
|
});
|
|
3685
3809
|
var PostHogContext;
|
|
3686
3810
|
var init_context = __esm({
|
|
3687
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3811
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/context/context.mjs"() {
|
|
3688
3812
|
PostHogContext = class {
|
|
3689
3813
|
constructor() {
|
|
3690
3814
|
this.storage = new AsyncLocalStorage();
|
|
@@ -3712,7 +3836,7 @@ var init_context = __esm({
|
|
|
3712
3836
|
}
|
|
3713
3837
|
});
|
|
3714
3838
|
|
|
3715
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3839
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/sentry-integration.mjs
|
|
3716
3840
|
function createEventProcessor(_posthog, { organization, projectId, prefix, severityAllowList = [
|
|
3717
3841
|
"error"
|
|
3718
3842
|
], sendExceptionsToPostHog = true } = {}) {
|
|
@@ -3768,7 +3892,7 @@ function sentryIntegration(_posthog, options) {
|
|
|
3768
3892
|
}
|
|
3769
3893
|
var NAME, PostHogSentryIntegration;
|
|
3770
3894
|
var init_sentry_integration = __esm({
|
|
3771
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3895
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/sentry-integration.mjs"() {
|
|
3772
3896
|
NAME = "posthog-node";
|
|
3773
3897
|
PostHogSentryIntegration = class {
|
|
3774
3898
|
static #_ = this.POSTHOG_ID_TAG = "posthog_distinct_id";
|
|
@@ -3790,12 +3914,13 @@ var init_sentry_integration = __esm({
|
|
|
3790
3914
|
}
|
|
3791
3915
|
});
|
|
3792
3916
|
|
|
3793
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3917
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/express.mjs
|
|
3794
3918
|
function setupExpressErrorHandler(_posthog, app) {
|
|
3795
3919
|
app.use(posthogErrorHandler(_posthog));
|
|
3796
3920
|
}
|
|
3797
3921
|
function posthogErrorHandler(posthog) {
|
|
3798
3922
|
return (error, req, res, next) => {
|
|
3923
|
+
if (ErrorTracking.isPreviouslyCapturedError(error)) return void next(error);
|
|
3799
3924
|
const sessionId = req.headers["x-posthog-session-id"];
|
|
3800
3925
|
const distinctId = req.headers["x-posthog-distinct-id"];
|
|
3801
3926
|
const syntheticException = new Error("Synthetic exception");
|
|
@@ -3821,21 +3946,22 @@ function posthogErrorHandler(posthog) {
|
|
|
3821
3946
|
};
|
|
3822
3947
|
}
|
|
3823
3948
|
var init_express = __esm({
|
|
3824
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3949
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/express.mjs"() {
|
|
3825
3950
|
init_error_tracking2();
|
|
3826
3951
|
}
|
|
3827
3952
|
});
|
|
3828
3953
|
|
|
3829
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3954
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/exports.mjs
|
|
3830
3955
|
var init_exports = __esm({
|
|
3831
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3956
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/exports.mjs"() {
|
|
3957
|
+
init_dist();
|
|
3832
3958
|
init_sentry_integration();
|
|
3833
3959
|
init_express();
|
|
3834
3960
|
init_types3();
|
|
3835
3961
|
}
|
|
3836
3962
|
});
|
|
3837
3963
|
|
|
3838
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3964
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/entrypoints/index.node.mjs
|
|
3839
3965
|
var index_node_exports = {};
|
|
3840
3966
|
__export(index_node_exports, {
|
|
3841
3967
|
FeatureFlagError: () => FeatureFlagError,
|
|
@@ -3847,7 +3973,7 @@ __export(index_node_exports, {
|
|
|
3847
3973
|
});
|
|
3848
3974
|
var PostHog;
|
|
3849
3975
|
var init_index_node = __esm({
|
|
3850
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3976
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/entrypoints/index.node.mjs"() {
|
|
3851
3977
|
init_module_node();
|
|
3852
3978
|
init_context_lines_node();
|
|
3853
3979
|
init_error_tracking2();
|
|
@@ -5138,9 +5264,9 @@ var require_dist2 = __commonJS({
|
|
|
5138
5264
|
}
|
|
5139
5265
|
});
|
|
5140
5266
|
|
|
5141
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5267
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/package.json
|
|
5142
5268
|
var require_package = __commonJS({
|
|
5143
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5269
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/package.json"(exports$1, module) {
|
|
5144
5270
|
module.exports = {
|
|
5145
5271
|
name: "mixpanel",
|
|
5146
5272
|
description: "A simple server-side API for mixpanel",
|
|
@@ -5150,7 +5276,7 @@ var require_package = __commonJS({
|
|
|
5150
5276
|
"api",
|
|
5151
5277
|
"stats"
|
|
5152
5278
|
],
|
|
5153
|
-
version: "0.
|
|
5279
|
+
version: "0.20.0",
|
|
5154
5280
|
homepage: "https://github.com/mixpanel/mixpanel-node",
|
|
5155
5281
|
author: "Carl Sverre",
|
|
5156
5282
|
license: "MIT",
|
|
@@ -5166,29 +5292,35 @@ var require_package = __commonJS({
|
|
|
5166
5292
|
node: ">=10.0"
|
|
5167
5293
|
},
|
|
5168
5294
|
scripts: {
|
|
5169
|
-
test: "vitest"
|
|
5295
|
+
test: "vitest",
|
|
5296
|
+
format: "prettier --write .",
|
|
5297
|
+
"check-format": "prettier --check .",
|
|
5298
|
+
lint: "oxlint ."
|
|
5170
5299
|
},
|
|
5171
5300
|
types: "./lib/mixpanel-node.d.ts",
|
|
5172
5301
|
devDependencies: {
|
|
5173
5302
|
"@types/node": "^24.10.1",
|
|
5174
5303
|
"@vitest/coverage-v8": "^4.0.8",
|
|
5175
5304
|
nock: "^14.0.10",
|
|
5305
|
+
oxlint: "^1.16.0",
|
|
5306
|
+
prettier: "^3.6.2",
|
|
5176
5307
|
proxyquire: "^2.1.3",
|
|
5177
5308
|
typescript: "^5.9.3",
|
|
5178
5309
|
vitest: "^4.0.8"
|
|
5179
5310
|
},
|
|
5180
5311
|
dependencies: {
|
|
5181
|
-
"https-proxy-agent": "7.0.6"
|
|
5312
|
+
"https-proxy-agent": "7.0.6",
|
|
5313
|
+
"json-logic-js": "2.0.5"
|
|
5182
5314
|
}
|
|
5183
5315
|
};
|
|
5184
5316
|
}
|
|
5185
5317
|
});
|
|
5186
5318
|
|
|
5187
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5319
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/utils.js
|
|
5188
5320
|
var require_utils = __commonJS({
|
|
5189
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5321
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/utils.js"(exports$1) {
|
|
5190
5322
|
exports$1.async_all = function(requests, handler, callback) {
|
|
5191
|
-
|
|
5323
|
+
let total = requests.length, errors = null, results = [], done = function(err, result) {
|
|
5192
5324
|
if (err) {
|
|
5193
5325
|
errors = errors || [];
|
|
5194
5326
|
errors.push(err);
|
|
@@ -5201,14 +5333,16 @@ var require_utils = __commonJS({
|
|
|
5201
5333
|
if (total === 0) {
|
|
5202
5334
|
callback(errors, results);
|
|
5203
5335
|
} else {
|
|
5204
|
-
for (
|
|
5336
|
+
for (let i = 0, l = requests.length; i < l; i++) {
|
|
5205
5337
|
handler(requests[i], done);
|
|
5206
5338
|
}
|
|
5207
5339
|
}
|
|
5208
5340
|
};
|
|
5209
5341
|
exports$1.ensure_timestamp = function(time) {
|
|
5210
5342
|
if (!(time instanceof Date || typeof time === "number")) {
|
|
5211
|
-
throw new Error(
|
|
5343
|
+
throw new Error(
|
|
5344
|
+
"`time` property must be a Date or Unix timestamp and is only required for `import` endpoint"
|
|
5345
|
+
);
|
|
5212
5346
|
}
|
|
5213
5347
|
return time instanceof Date ? time.getTime() : time;
|
|
5214
5348
|
};
|
|
@@ -5225,9 +5359,9 @@ var require_utils = __commonJS({
|
|
|
5225
5359
|
}
|
|
5226
5360
|
});
|
|
5227
5361
|
|
|
5228
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5362
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/profile_helpers.js
|
|
5229
5363
|
var require_profile_helpers = __commonJS({
|
|
5230
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5364
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/profile_helpers.js"(exports$1) {
|
|
5231
5365
|
var { ensure_timestamp } = require_utils();
|
|
5232
5366
|
function merge_modifiers(data, modifiers) {
|
|
5233
5367
|
if (modifiers) {
|
|
@@ -5275,7 +5409,7 @@ var require_profile_helpers = __commonJS({
|
|
|
5275
5409
|
}
|
|
5276
5410
|
}
|
|
5277
5411
|
let data = {
|
|
5278
|
-
|
|
5412
|
+
$token: this.token,
|
|
5279
5413
|
...identifiers
|
|
5280
5414
|
};
|
|
5281
5415
|
const set_key = set_once ? "$set_once" : "$set";
|
|
@@ -5290,14 +5424,20 @@ var require_profile_helpers = __commonJS({
|
|
|
5290
5424
|
}
|
|
5291
5425
|
data = merge_modifiers(data, modifiers);
|
|
5292
5426
|
if (this.config.debug) {
|
|
5293
|
-
this.mixpanel.config.logger.debug(
|
|
5427
|
+
this.mixpanel.config.logger.debug(
|
|
5428
|
+
`Sending the following data to Mixpanel (${this.endpoint})`,
|
|
5429
|
+
{ data }
|
|
5430
|
+
);
|
|
5294
5431
|
}
|
|
5295
|
-
this.mixpanel.send_request(
|
|
5432
|
+
this.mixpanel.send_request(
|
|
5433
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5434
|
+
callback
|
|
5435
|
+
);
|
|
5296
5436
|
}
|
|
5297
5437
|
_delete_profile({ identifiers, modifiers, callback }) {
|
|
5298
5438
|
let data = {
|
|
5299
|
-
|
|
5300
|
-
|
|
5439
|
+
$delete: "",
|
|
5440
|
+
$token: this.token,
|
|
5301
5441
|
...identifiers
|
|
5302
5442
|
};
|
|
5303
5443
|
if (typeof modifiers === "function") {
|
|
@@ -5307,13 +5447,18 @@ var require_profile_helpers = __commonJS({
|
|
|
5307
5447
|
if (this.config.debug) {
|
|
5308
5448
|
this.mixpanel.config.logger.debug("Deleting profile", { identifiers });
|
|
5309
5449
|
}
|
|
5310
|
-
this.mixpanel.send_request(
|
|
5450
|
+
this.mixpanel.send_request(
|
|
5451
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5452
|
+
callback
|
|
5453
|
+
);
|
|
5311
5454
|
}
|
|
5312
5455
|
_remove({ identifiers, data, modifiers, callback }) {
|
|
5313
5456
|
let $remove = {};
|
|
5314
5457
|
if (typeof data !== "object" || Array.isArray(data)) {
|
|
5315
5458
|
if (this.config.debug) {
|
|
5316
|
-
this.mixpanel.config.logger.error(
|
|
5459
|
+
this.mixpanel.config.logger.error(
|
|
5460
|
+
"Invalid value passed to #remove - data must be an object with scalar values"
|
|
5461
|
+
);
|
|
5317
5462
|
}
|
|
5318
5463
|
return;
|
|
5319
5464
|
}
|
|
@@ -5334,8 +5479,8 @@ var require_profile_helpers = __commonJS({
|
|
|
5334
5479
|
return;
|
|
5335
5480
|
}
|
|
5336
5481
|
data = {
|
|
5337
|
-
|
|
5338
|
-
|
|
5482
|
+
$remove,
|
|
5483
|
+
$token: this.token,
|
|
5339
5484
|
...identifiers
|
|
5340
5485
|
};
|
|
5341
5486
|
if (typeof modifiers === "function") {
|
|
@@ -5348,19 +5493,24 @@ var require_profile_helpers = __commonJS({
|
|
|
5348
5493
|
{ data }
|
|
5349
5494
|
);
|
|
5350
5495
|
}
|
|
5351
|
-
this.mixpanel.send_request(
|
|
5496
|
+
this.mixpanel.send_request(
|
|
5497
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5498
|
+
callback
|
|
5499
|
+
);
|
|
5352
5500
|
}
|
|
5353
5501
|
_union({ identifiers, data, modifiers, callback }) {
|
|
5354
5502
|
let $union = {};
|
|
5355
5503
|
if (typeof data !== "object" || Array.isArray(data)) {
|
|
5356
5504
|
if (this.config.debug) {
|
|
5357
|
-
this.mixpanel.config.logger.error(
|
|
5505
|
+
this.mixpanel.config.logger.error(
|
|
5506
|
+
"Invalid value passed to #union - data must be an object with scalar or array values"
|
|
5507
|
+
);
|
|
5358
5508
|
}
|
|
5359
5509
|
return;
|
|
5360
5510
|
}
|
|
5361
5511
|
for (const [key, val] of Object.entries(data)) {
|
|
5362
5512
|
if (Array.isArray(val)) {
|
|
5363
|
-
|
|
5513
|
+
const merge_values = val.filter(function(v) {
|
|
5364
5514
|
return typeof v === "string" || typeof v === "number";
|
|
5365
5515
|
});
|
|
5366
5516
|
if (merge_values.length > 0) {
|
|
@@ -5381,8 +5531,8 @@ var require_profile_helpers = __commonJS({
|
|
|
5381
5531
|
return;
|
|
5382
5532
|
}
|
|
5383
5533
|
data = {
|
|
5384
|
-
|
|
5385
|
-
|
|
5534
|
+
$union,
|
|
5535
|
+
$token: this.token,
|
|
5386
5536
|
...identifiers
|
|
5387
5537
|
};
|
|
5388
5538
|
if (typeof modifiers === "function") {
|
|
@@ -5395,7 +5545,10 @@ var require_profile_helpers = __commonJS({
|
|
|
5395
5545
|
{ data }
|
|
5396
5546
|
);
|
|
5397
5547
|
}
|
|
5398
|
-
this.mixpanel.send_request(
|
|
5548
|
+
this.mixpanel.send_request(
|
|
5549
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5550
|
+
callback
|
|
5551
|
+
);
|
|
5399
5552
|
}
|
|
5400
5553
|
_unset({ identifiers, prop, modifiers, callback }) {
|
|
5401
5554
|
let $unset = [];
|
|
@@ -5413,8 +5566,8 @@ var require_profile_helpers = __commonJS({
|
|
|
5413
5566
|
return;
|
|
5414
5567
|
}
|
|
5415
5568
|
let data = {
|
|
5416
|
-
|
|
5417
|
-
|
|
5569
|
+
$unset,
|
|
5570
|
+
$token: this.token,
|
|
5418
5571
|
...identifiers
|
|
5419
5572
|
};
|
|
5420
5573
|
if (typeof modifiers === "function") {
|
|
@@ -5427,15 +5580,18 @@ var require_profile_helpers = __commonJS({
|
|
|
5427
5580
|
{ data }
|
|
5428
5581
|
);
|
|
5429
5582
|
}
|
|
5430
|
-
this.mixpanel.send_request(
|
|
5583
|
+
this.mixpanel.send_request(
|
|
5584
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5585
|
+
callback
|
|
5586
|
+
);
|
|
5431
5587
|
}
|
|
5432
5588
|
};
|
|
5433
5589
|
}
|
|
5434
5590
|
});
|
|
5435
5591
|
|
|
5436
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5592
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/groups.js
|
|
5437
5593
|
var require_groups = __commonJS({
|
|
5438
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5594
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/groups.js"(exports$1) {
|
|
5439
5595
|
var { ProfileHelpers } = require_profile_helpers();
|
|
5440
5596
|
var MixpanelGroups = class extends ProfileHelpers() {
|
|
5441
5597
|
constructor(mp_instance) {
|
|
@@ -5444,9 +5600,9 @@ var require_groups = __commonJS({
|
|
|
5444
5600
|
this.endpoint = "/groups";
|
|
5445
5601
|
}
|
|
5446
5602
|
/** groups.set_once(group_key, group_id, prop, to, modifiers, callback)
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5603
|
+
---
|
|
5604
|
+
The same as groups.set, but adds a property value to a group only if it has not been set before.
|
|
5605
|
+
*/
|
|
5450
5606
|
set_once(group_key, group_id, prop, to, modifiers, callback) {
|
|
5451
5607
|
const identifiers = { $group_key: group_key, $group_id: group_id };
|
|
5452
5608
|
this._set(prop, to, modifiers, callback, { identifiers, set_once: true });
|
|
@@ -5535,9 +5691,9 @@ var require_groups = __commonJS({
|
|
|
5535
5691
|
}
|
|
5536
5692
|
});
|
|
5537
5693
|
|
|
5538
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5694
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/people.js
|
|
5539
5695
|
var require_people = __commonJS({
|
|
5540
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5696
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/people.js"(exports$1) {
|
|
5541
5697
|
var { merge_modifiers, ProfileHelpers } = require_profile_helpers();
|
|
5542
5698
|
var MixpanelPeople = class extends ProfileHelpers() {
|
|
5543
5699
|
constructor(mp_instance) {
|
|
@@ -5603,7 +5759,7 @@ var require_people = __commonJS({
|
|
|
5603
5759
|
});
|
|
5604
5760
|
*/
|
|
5605
5761
|
increment(distinct_id, prop, by, modifiers, callback) {
|
|
5606
|
-
|
|
5762
|
+
const $add = {};
|
|
5607
5763
|
if (typeof prop === "object") {
|
|
5608
5764
|
if (typeof by === "object") {
|
|
5609
5765
|
callback = modifiers;
|
|
@@ -5639,16 +5795,22 @@ var require_people = __commonJS({
|
|
|
5639
5795
|
$add[prop] = 1;
|
|
5640
5796
|
}
|
|
5641
5797
|
}
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5798
|
+
let data = {
|
|
5799
|
+
$add,
|
|
5800
|
+
$token: this.mixpanel.token,
|
|
5801
|
+
$distinct_id: distinct_id
|
|
5646
5802
|
};
|
|
5647
5803
|
data = merge_modifiers(data, modifiers);
|
|
5648
5804
|
if (this.mixpanel.config.debug) {
|
|
5649
|
-
this.mixpanel.config.logger.debug(
|
|
5805
|
+
this.mixpanel.config.logger.debug(
|
|
5806
|
+
"Sending the following data to Mixpanel (Engage)",
|
|
5807
|
+
{ data }
|
|
5808
|
+
);
|
|
5650
5809
|
}
|
|
5651
|
-
this.mixpanel.send_request(
|
|
5810
|
+
this.mixpanel.send_request(
|
|
5811
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5812
|
+
callback
|
|
5813
|
+
);
|
|
5652
5814
|
}
|
|
5653
5815
|
/**
|
|
5654
5816
|
people.append(distinct_id, prop, value, modifiers, callback)
|
|
@@ -5667,7 +5829,7 @@ var require_people = __commonJS({
|
|
|
5667
5829
|
});
|
|
5668
5830
|
*/
|
|
5669
5831
|
append(distinct_id, prop, value, modifiers, callback) {
|
|
5670
|
-
|
|
5832
|
+
const $append = {};
|
|
5671
5833
|
if (typeof prop === "object") {
|
|
5672
5834
|
if (typeof value === "object") {
|
|
5673
5835
|
callback = modifiers;
|
|
@@ -5684,16 +5846,22 @@ var require_people = __commonJS({
|
|
|
5684
5846
|
callback = modifiers;
|
|
5685
5847
|
}
|
|
5686
5848
|
}
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5849
|
+
let data = {
|
|
5850
|
+
$append,
|
|
5851
|
+
$token: this.mixpanel.token,
|
|
5852
|
+
$distinct_id: distinct_id
|
|
5691
5853
|
};
|
|
5692
5854
|
data = merge_modifiers(data, modifiers);
|
|
5693
5855
|
if (this.mixpanel.config.debug) {
|
|
5694
|
-
this.mixpanel.config.logger.debug(
|
|
5856
|
+
this.mixpanel.config.logger.debug(
|
|
5857
|
+
"Sending the following data to Mixpanel (Engage)",
|
|
5858
|
+
{ data }
|
|
5859
|
+
);
|
|
5695
5860
|
}
|
|
5696
|
-
this.mixpanel.send_request(
|
|
5861
|
+
this.mixpanel.send_request(
|
|
5862
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5863
|
+
callback
|
|
5864
|
+
);
|
|
5697
5865
|
}
|
|
5698
5866
|
/**
|
|
5699
5867
|
people.track_charge(distinct_id, amount, properties, modifiers, callback)
|
|
@@ -5728,27 +5896,35 @@ var require_people = __commonJS({
|
|
|
5728
5896
|
if (typeof amount !== "number") {
|
|
5729
5897
|
amount = parseFloat(amount);
|
|
5730
5898
|
if (isNaN(amount)) {
|
|
5731
|
-
this.mixpanel.config.logger.error(
|
|
5899
|
+
this.mixpanel.config.logger.error(
|
|
5900
|
+
"Invalid value passed to mixpanel.people.track_charge - must be a number"
|
|
5901
|
+
);
|
|
5732
5902
|
return;
|
|
5733
5903
|
}
|
|
5734
5904
|
}
|
|
5735
5905
|
properties.$amount = amount;
|
|
5736
5906
|
if (properties.hasOwnProperty("$time")) {
|
|
5737
|
-
|
|
5907
|
+
const time = properties.$time;
|
|
5738
5908
|
if (Object.prototype.toString.call(time) === "[object Date]") {
|
|
5739
5909
|
properties.$time = time.toISOString();
|
|
5740
5910
|
}
|
|
5741
5911
|
}
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5912
|
+
let data = {
|
|
5913
|
+
$append: { $transactions: properties },
|
|
5914
|
+
$token: this.mixpanel.token,
|
|
5915
|
+
$distinct_id: distinct_id
|
|
5746
5916
|
};
|
|
5747
5917
|
data = merge_modifiers(data, modifiers);
|
|
5748
5918
|
if (this.mixpanel.config.debug) {
|
|
5749
|
-
this.mixpanel.config.logger.debug(
|
|
5919
|
+
this.mixpanel.config.logger.debug(
|
|
5920
|
+
"Sending the following data to Mixpanel (Engage)",
|
|
5921
|
+
{ data }
|
|
5922
|
+
);
|
|
5750
5923
|
}
|
|
5751
|
-
this.mixpanel.send_request(
|
|
5924
|
+
this.mixpanel.send_request(
|
|
5925
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5926
|
+
callback
|
|
5927
|
+
);
|
|
5752
5928
|
}
|
|
5753
5929
|
/**
|
|
5754
5930
|
people.clear_charges(distinct_id, modifiers, callback)
|
|
@@ -5760,19 +5936,24 @@ var require_people = __commonJS({
|
|
|
5760
5936
|
mixpanel.people.clear_charges('bob');
|
|
5761
5937
|
*/
|
|
5762
5938
|
clear_charges(distinct_id, modifiers, callback) {
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5939
|
+
let data = {
|
|
5940
|
+
$set: { $transactions: [] },
|
|
5941
|
+
$token: this.mixpanel.token,
|
|
5942
|
+
$distinct_id: distinct_id
|
|
5767
5943
|
};
|
|
5768
5944
|
if (typeof modifiers === "function") {
|
|
5769
5945
|
callback = modifiers;
|
|
5770
5946
|
}
|
|
5771
5947
|
data = merge_modifiers(data, modifiers);
|
|
5772
5948
|
if (this.mixpanel.config.debug) {
|
|
5773
|
-
this.mixpanel.config.logger.debug("Clearing this user's charges", {
|
|
5949
|
+
this.mixpanel.config.logger.debug("Clearing this user's charges", {
|
|
5950
|
+
$distinct_id: distinct_id
|
|
5951
|
+
});
|
|
5774
5952
|
}
|
|
5775
|
-
this.mixpanel.send_request(
|
|
5953
|
+
this.mixpanel.send_request(
|
|
5954
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5955
|
+
callback
|
|
5956
|
+
);
|
|
5776
5957
|
}
|
|
5777
5958
|
/**
|
|
5778
5959
|
people.delete_user(distinct_id, modifiers, callback)
|
|
@@ -5799,7 +5980,7 @@ var require_people = __commonJS({
|
|
|
5799
5980
|
mixpanel.people.remove('bob', {'browsers': 'chrome', 'os': 'linux'});
|
|
5800
5981
|
*/
|
|
5801
5982
|
remove(distinct_id, data, modifiers, callback) {
|
|
5802
|
-
const identifiers = {
|
|
5983
|
+
const identifiers = { $distinct_id: distinct_id };
|
|
5803
5984
|
this._remove({ identifiers, data, modifiers, callback });
|
|
5804
5985
|
}
|
|
5805
5986
|
/**
|
|
@@ -5837,9 +6018,9 @@ var require_people = __commonJS({
|
|
|
5837
6018
|
}
|
|
5838
6019
|
});
|
|
5839
6020
|
|
|
5840
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
6021
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/utils.js
|
|
5841
6022
|
var require_utils2 = __commonJS({
|
|
5842
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6023
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/utils.js"(exports$1, module) {
|
|
5843
6024
|
var crypto3 = __require("crypto");
|
|
5844
6025
|
var EXPOSURE_EVENT = "$experiment_started";
|
|
5845
6026
|
var REQUEST_HEADERS = {
|
|
@@ -5874,22 +6055,55 @@ var require_utils2 = __commonJS({
|
|
|
5874
6055
|
const traceFlags = "01";
|
|
5875
6056
|
return `${version3}-${traceId}-${parentId}-${traceFlags}`;
|
|
5876
6057
|
}
|
|
6058
|
+
function lowercaseJson(obj, lowercaseKeys) {
|
|
6059
|
+
if (obj === null || obj === void 0) {
|
|
6060
|
+
return obj;
|
|
6061
|
+
} else if (typeof obj === "string") {
|
|
6062
|
+
return obj.toLowerCase();
|
|
6063
|
+
} else if (typeof obj === "object") {
|
|
6064
|
+
if (Array.isArray(obj)) {
|
|
6065
|
+
return obj.map((item) => lowercaseJson(item, lowercaseKeys));
|
|
6066
|
+
} else {
|
|
6067
|
+
return Object.fromEntries(
|
|
6068
|
+
Object.entries(obj).map(([k, v]) => [
|
|
6069
|
+
lowercaseKeys ? k.toLowerCase() : k,
|
|
6070
|
+
lowercaseJson(v, lowercaseKeys)
|
|
6071
|
+
])
|
|
6072
|
+
);
|
|
6073
|
+
}
|
|
6074
|
+
} else {
|
|
6075
|
+
return obj;
|
|
6076
|
+
}
|
|
6077
|
+
}
|
|
6078
|
+
function lowercaseAllKeysAndValues(obj) {
|
|
6079
|
+
return lowercaseJson(obj, true);
|
|
6080
|
+
}
|
|
6081
|
+
function lowercaseLeafNodes(obj) {
|
|
6082
|
+
return lowercaseJson(obj, false);
|
|
6083
|
+
}
|
|
5877
6084
|
module.exports = {
|
|
5878
6085
|
EXPOSURE_EVENT,
|
|
5879
6086
|
REQUEST_HEADERS,
|
|
5880
6087
|
normalizedHash,
|
|
5881
6088
|
prepareCommonQueryParams,
|
|
5882
|
-
generateTraceparent
|
|
6089
|
+
generateTraceparent,
|
|
6090
|
+
lowercaseAllKeysAndValues,
|
|
6091
|
+
lowercaseLeafNodes
|
|
5883
6092
|
};
|
|
5884
6093
|
}
|
|
5885
6094
|
});
|
|
5886
6095
|
|
|
5887
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
6096
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/flags.js
|
|
5888
6097
|
var require_flags = __commonJS({
|
|
5889
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6098
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/flags.js"(exports$1, module) {
|
|
5890
6099
|
var https3 = __require("https");
|
|
5891
6100
|
var packageInfo = require_package();
|
|
5892
|
-
var {
|
|
6101
|
+
var {
|
|
6102
|
+
prepareCommonQueryParams,
|
|
6103
|
+
generateTraceparent,
|
|
6104
|
+
EXPOSURE_EVENT,
|
|
6105
|
+
REQUEST_HEADERS
|
|
6106
|
+
} = require_utils2();
|
|
5893
6107
|
var FeatureFlagsProvider = class {
|
|
5894
6108
|
/**
|
|
5895
6109
|
* @param {Object} providerConfig - Configuration object with token, api_host, request_timeout_in_seconds
|
|
@@ -5912,7 +6126,10 @@ var require_flags = __commonJS({
|
|
|
5912
6126
|
*/
|
|
5913
6127
|
async callFlagsEndpoint(additionalParams = null) {
|
|
5914
6128
|
return new Promise((resolve, reject) => {
|
|
5915
|
-
const commonParams = prepareCommonQueryParams(
|
|
6129
|
+
const commonParams = prepareCommonQueryParams(
|
|
6130
|
+
this.providerConfig.token,
|
|
6131
|
+
packageInfo.version
|
|
6132
|
+
);
|
|
5916
6133
|
const params = new URLSearchParams(commonParams);
|
|
5917
6134
|
if (additionalParams) {
|
|
5918
6135
|
for (const [key, value] of Object.entries(additionalParams)) {
|
|
@@ -5927,8 +6144,8 @@ var require_flags = __commonJS({
|
|
|
5927
6144
|
method: "GET",
|
|
5928
6145
|
headers: {
|
|
5929
6146
|
...REQUEST_HEADERS,
|
|
5930
|
-
|
|
5931
|
-
|
|
6147
|
+
Authorization: "Basic " + Buffer.from(this.providerConfig.token + ":").toString("base64"),
|
|
6148
|
+
traceparent: generateTraceparent()
|
|
5932
6149
|
},
|
|
5933
6150
|
timeout: this.providerConfig.request_timeout_in_seconds * 1e3
|
|
5934
6151
|
};
|
|
@@ -5939,20 +6156,26 @@ var require_flags = __commonJS({
|
|
|
5939
6156
|
});
|
|
5940
6157
|
res.on("end", () => {
|
|
5941
6158
|
if (res.statusCode !== 200) {
|
|
5942
|
-
this.logger?.error(
|
|
6159
|
+
this.logger?.error(
|
|
6160
|
+
`HTTP ${res.statusCode} error calling flags endpoint: ${data}`
|
|
6161
|
+
);
|
|
5943
6162
|
return reject(new Error(`HTTP ${res.statusCode}: ${data}`));
|
|
5944
6163
|
}
|
|
5945
6164
|
try {
|
|
5946
6165
|
const result = JSON.parse(data);
|
|
5947
6166
|
resolve(result);
|
|
5948
6167
|
} catch (parseErr) {
|
|
5949
|
-
this.logger?.error(
|
|
6168
|
+
this.logger?.error(
|
|
6169
|
+
`Failed to parse JSON response: ${parseErr.message}`
|
|
6170
|
+
);
|
|
5950
6171
|
reject(parseErr);
|
|
5951
6172
|
}
|
|
5952
6173
|
});
|
|
5953
6174
|
});
|
|
5954
6175
|
request.on("error", (err) => {
|
|
5955
|
-
this.logger?.error(
|
|
6176
|
+
this.logger?.error(
|
|
6177
|
+
`Network error calling flags endpoint: ${err.message}`
|
|
6178
|
+
);
|
|
5956
6179
|
reject(err);
|
|
5957
6180
|
});
|
|
5958
6181
|
request.on("timeout", () => {
|
|
@@ -5974,14 +6197,16 @@ var require_flags = __commonJS({
|
|
|
5974
6197
|
*/
|
|
5975
6198
|
trackExposureEvent(flagKey, selectedVariant, context, latencyMs = null) {
|
|
5976
6199
|
if (!context.distinct_id) {
|
|
5977
|
-
this.logger?.error(
|
|
6200
|
+
this.logger?.error(
|
|
6201
|
+
"Cannot track exposure event without a distinct_id in the context"
|
|
6202
|
+
);
|
|
5978
6203
|
return;
|
|
5979
6204
|
}
|
|
5980
6205
|
const properties = {
|
|
5981
|
-
|
|
6206
|
+
distinct_id: context.distinct_id,
|
|
5982
6207
|
"Experiment name": flagKey,
|
|
5983
6208
|
"Variant name": selectedVariant.variant_key,
|
|
5984
|
-
|
|
6209
|
+
$experiment_type: "feature_flag",
|
|
5985
6210
|
"Flag evaluation mode": this.evaluationMode
|
|
5986
6211
|
};
|
|
5987
6212
|
if (latencyMs !== null && latencyMs !== void 0) {
|
|
@@ -5998,7 +6223,9 @@ var require_flags = __commonJS({
|
|
|
5998
6223
|
}
|
|
5999
6224
|
this.tracker(EXPOSURE_EVENT, properties, (err) => {
|
|
6000
6225
|
if (err) {
|
|
6001
|
-
this.logger?.error(
|
|
6226
|
+
this.logger?.error(
|
|
6227
|
+
`[flags]Failed to track exposure event for flag '${flagKey}': ${err.message}`
|
|
6228
|
+
);
|
|
6002
6229
|
}
|
|
6003
6230
|
});
|
|
6004
6231
|
}
|
|
@@ -6007,11 +6234,392 @@ var require_flags = __commonJS({
|
|
|
6007
6234
|
}
|
|
6008
6235
|
});
|
|
6009
6236
|
|
|
6010
|
-
// ../../node_modules/.pnpm/
|
|
6237
|
+
// ../../node_modules/.pnpm/json-logic-js@2.0.5/node_modules/json-logic-js/logic.js
|
|
6238
|
+
var require_logic = __commonJS({
|
|
6239
|
+
"../../node_modules/.pnpm/json-logic-js@2.0.5/node_modules/json-logic-js/logic.js"(exports$1, module) {
|
|
6240
|
+
(function(root, factory) {
|
|
6241
|
+
if (typeof define === "function" && define.amd) {
|
|
6242
|
+
define(factory);
|
|
6243
|
+
} else if (typeof exports$1 === "object") {
|
|
6244
|
+
module.exports = factory();
|
|
6245
|
+
} else {
|
|
6246
|
+
root.jsonLogic = factory();
|
|
6247
|
+
}
|
|
6248
|
+
})(exports$1, function() {
|
|
6249
|
+
if (!Array.isArray) {
|
|
6250
|
+
Array.isArray = function(arg) {
|
|
6251
|
+
return Object.prototype.toString.call(arg) === "[object Array]";
|
|
6252
|
+
};
|
|
6253
|
+
}
|
|
6254
|
+
function arrayUnique(array) {
|
|
6255
|
+
var a = [];
|
|
6256
|
+
for (var i = 0, l = array.length; i < l; i++) {
|
|
6257
|
+
if (a.indexOf(array[i]) === -1) {
|
|
6258
|
+
a.push(array[i]);
|
|
6259
|
+
}
|
|
6260
|
+
}
|
|
6261
|
+
return a;
|
|
6262
|
+
}
|
|
6263
|
+
var jsonLogic = {};
|
|
6264
|
+
var operations = {
|
|
6265
|
+
"==": function(a, b) {
|
|
6266
|
+
return a == b;
|
|
6267
|
+
},
|
|
6268
|
+
"===": function(a, b) {
|
|
6269
|
+
return a === b;
|
|
6270
|
+
},
|
|
6271
|
+
"!=": function(a, b) {
|
|
6272
|
+
return a != b;
|
|
6273
|
+
},
|
|
6274
|
+
"!==": function(a, b) {
|
|
6275
|
+
return a !== b;
|
|
6276
|
+
},
|
|
6277
|
+
">": function(a, b) {
|
|
6278
|
+
return a > b;
|
|
6279
|
+
},
|
|
6280
|
+
">=": function(a, b) {
|
|
6281
|
+
return a >= b;
|
|
6282
|
+
},
|
|
6283
|
+
"<": function(a, b, c) {
|
|
6284
|
+
return c === void 0 ? a < b : a < b && b < c;
|
|
6285
|
+
},
|
|
6286
|
+
"<=": function(a, b, c) {
|
|
6287
|
+
return c === void 0 ? a <= b : a <= b && b <= c;
|
|
6288
|
+
},
|
|
6289
|
+
"!!": function(a) {
|
|
6290
|
+
return jsonLogic.truthy(a);
|
|
6291
|
+
},
|
|
6292
|
+
"!": function(a) {
|
|
6293
|
+
return !jsonLogic.truthy(a);
|
|
6294
|
+
},
|
|
6295
|
+
"%": function(a, b) {
|
|
6296
|
+
return a % b;
|
|
6297
|
+
},
|
|
6298
|
+
"log": function(a) {
|
|
6299
|
+
console.log(a);
|
|
6300
|
+
return a;
|
|
6301
|
+
},
|
|
6302
|
+
"in": function(a, b) {
|
|
6303
|
+
if (!b || typeof b.indexOf === "undefined") return false;
|
|
6304
|
+
return b.indexOf(a) !== -1;
|
|
6305
|
+
},
|
|
6306
|
+
"cat": function() {
|
|
6307
|
+
return Array.prototype.join.call(arguments, "");
|
|
6308
|
+
},
|
|
6309
|
+
"substr": function(source, start, end) {
|
|
6310
|
+
if (end < 0) {
|
|
6311
|
+
var temp = String(source).substr(start);
|
|
6312
|
+
return temp.substr(0, temp.length + end);
|
|
6313
|
+
}
|
|
6314
|
+
return String(source).substr(start, end);
|
|
6315
|
+
},
|
|
6316
|
+
"+": function() {
|
|
6317
|
+
return Array.prototype.reduce.call(arguments, function(a, b) {
|
|
6318
|
+
return parseFloat(a, 10) + parseFloat(b, 10);
|
|
6319
|
+
}, 0);
|
|
6320
|
+
},
|
|
6321
|
+
"*": function() {
|
|
6322
|
+
return Array.prototype.reduce.call(arguments, function(a, b) {
|
|
6323
|
+
return parseFloat(a, 10) * parseFloat(b, 10);
|
|
6324
|
+
});
|
|
6325
|
+
},
|
|
6326
|
+
"-": function(a, b) {
|
|
6327
|
+
if (b === void 0) {
|
|
6328
|
+
return -a;
|
|
6329
|
+
} else {
|
|
6330
|
+
return a - b;
|
|
6331
|
+
}
|
|
6332
|
+
},
|
|
6333
|
+
"/": function(a, b) {
|
|
6334
|
+
return a / b;
|
|
6335
|
+
},
|
|
6336
|
+
"min": function() {
|
|
6337
|
+
return Math.min.apply(this, arguments);
|
|
6338
|
+
},
|
|
6339
|
+
"max": function() {
|
|
6340
|
+
return Math.max.apply(this, arguments);
|
|
6341
|
+
},
|
|
6342
|
+
"merge": function() {
|
|
6343
|
+
return Array.prototype.reduce.call(arguments, function(a, b) {
|
|
6344
|
+
return a.concat(b);
|
|
6345
|
+
}, []);
|
|
6346
|
+
},
|
|
6347
|
+
"var": function(a, b) {
|
|
6348
|
+
var not_found = b === void 0 ? null : b;
|
|
6349
|
+
var data = this;
|
|
6350
|
+
if (typeof a === "undefined" || a === "" || a === null) {
|
|
6351
|
+
return data;
|
|
6352
|
+
}
|
|
6353
|
+
var sub_props = String(a).split(".");
|
|
6354
|
+
for (var i = 0; i < sub_props.length; i++) {
|
|
6355
|
+
if (data === null || data === void 0) {
|
|
6356
|
+
return not_found;
|
|
6357
|
+
}
|
|
6358
|
+
data = data[sub_props[i]];
|
|
6359
|
+
if (data === void 0) {
|
|
6360
|
+
return not_found;
|
|
6361
|
+
}
|
|
6362
|
+
}
|
|
6363
|
+
return data;
|
|
6364
|
+
},
|
|
6365
|
+
"missing": function() {
|
|
6366
|
+
var missing = [];
|
|
6367
|
+
var keys = Array.isArray(arguments[0]) ? arguments[0] : arguments;
|
|
6368
|
+
for (var i = 0; i < keys.length; i++) {
|
|
6369
|
+
var key = keys[i];
|
|
6370
|
+
var value = jsonLogic.apply({ "var": key }, this);
|
|
6371
|
+
if (value === null || value === "") {
|
|
6372
|
+
missing.push(key);
|
|
6373
|
+
}
|
|
6374
|
+
}
|
|
6375
|
+
return missing;
|
|
6376
|
+
},
|
|
6377
|
+
"missing_some": function(need_count, options) {
|
|
6378
|
+
var are_missing = jsonLogic.apply({ "missing": options }, this);
|
|
6379
|
+
if (options.length - are_missing.length >= need_count) {
|
|
6380
|
+
return [];
|
|
6381
|
+
} else {
|
|
6382
|
+
return are_missing;
|
|
6383
|
+
}
|
|
6384
|
+
}
|
|
6385
|
+
};
|
|
6386
|
+
jsonLogic.is_logic = function(logic) {
|
|
6387
|
+
return typeof logic === "object" && // An object
|
|
6388
|
+
logic !== null && // but not null
|
|
6389
|
+
!Array.isArray(logic) && // and not an array
|
|
6390
|
+
Object.keys(logic).length === 1;
|
|
6391
|
+
};
|
|
6392
|
+
jsonLogic.truthy = function(value) {
|
|
6393
|
+
if (Array.isArray(value) && value.length === 0) {
|
|
6394
|
+
return false;
|
|
6395
|
+
}
|
|
6396
|
+
return !!value;
|
|
6397
|
+
};
|
|
6398
|
+
jsonLogic.get_operator = function(logic) {
|
|
6399
|
+
return Object.keys(logic)[0];
|
|
6400
|
+
};
|
|
6401
|
+
jsonLogic.get_values = function(logic) {
|
|
6402
|
+
return logic[jsonLogic.get_operator(logic)];
|
|
6403
|
+
};
|
|
6404
|
+
jsonLogic.apply = function(logic, data) {
|
|
6405
|
+
if (Array.isArray(logic)) {
|
|
6406
|
+
return logic.map(function(l) {
|
|
6407
|
+
return jsonLogic.apply(l, data);
|
|
6408
|
+
});
|
|
6409
|
+
}
|
|
6410
|
+
if (!jsonLogic.is_logic(logic)) {
|
|
6411
|
+
return logic;
|
|
6412
|
+
}
|
|
6413
|
+
var op = jsonLogic.get_operator(logic);
|
|
6414
|
+
var values = logic[op];
|
|
6415
|
+
var i;
|
|
6416
|
+
var current;
|
|
6417
|
+
var scopedLogic;
|
|
6418
|
+
var scopedData;
|
|
6419
|
+
var initial;
|
|
6420
|
+
if (!Array.isArray(values)) {
|
|
6421
|
+
values = [values];
|
|
6422
|
+
}
|
|
6423
|
+
if (op === "if" || op == "?:") {
|
|
6424
|
+
for (i = 0; i < values.length - 1; i += 2) {
|
|
6425
|
+
if (jsonLogic.truthy(jsonLogic.apply(values[i], data))) {
|
|
6426
|
+
return jsonLogic.apply(values[i + 1], data);
|
|
6427
|
+
}
|
|
6428
|
+
}
|
|
6429
|
+
if (values.length === i + 1) {
|
|
6430
|
+
return jsonLogic.apply(values[i], data);
|
|
6431
|
+
}
|
|
6432
|
+
return null;
|
|
6433
|
+
} else if (op === "and") {
|
|
6434
|
+
for (i = 0; i < values.length; i += 1) {
|
|
6435
|
+
current = jsonLogic.apply(values[i], data);
|
|
6436
|
+
if (!jsonLogic.truthy(current)) {
|
|
6437
|
+
return current;
|
|
6438
|
+
}
|
|
6439
|
+
}
|
|
6440
|
+
return current;
|
|
6441
|
+
} else if (op === "or") {
|
|
6442
|
+
for (i = 0; i < values.length; i += 1) {
|
|
6443
|
+
current = jsonLogic.apply(values[i], data);
|
|
6444
|
+
if (jsonLogic.truthy(current)) {
|
|
6445
|
+
return current;
|
|
6446
|
+
}
|
|
6447
|
+
}
|
|
6448
|
+
return current;
|
|
6449
|
+
} else if (op === "filter") {
|
|
6450
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6451
|
+
scopedLogic = values[1];
|
|
6452
|
+
if (!Array.isArray(scopedData)) {
|
|
6453
|
+
return [];
|
|
6454
|
+
}
|
|
6455
|
+
return scopedData.filter(function(datum) {
|
|
6456
|
+
return jsonLogic.truthy(jsonLogic.apply(scopedLogic, datum));
|
|
6457
|
+
});
|
|
6458
|
+
} else if (op === "map") {
|
|
6459
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6460
|
+
scopedLogic = values[1];
|
|
6461
|
+
if (!Array.isArray(scopedData)) {
|
|
6462
|
+
return [];
|
|
6463
|
+
}
|
|
6464
|
+
return scopedData.map(function(datum) {
|
|
6465
|
+
return jsonLogic.apply(scopedLogic, datum);
|
|
6466
|
+
});
|
|
6467
|
+
} else if (op === "reduce") {
|
|
6468
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6469
|
+
scopedLogic = values[1];
|
|
6470
|
+
initial = typeof values[2] !== "undefined" ? jsonLogic.apply(values[2], data) : null;
|
|
6471
|
+
if (!Array.isArray(scopedData)) {
|
|
6472
|
+
return initial;
|
|
6473
|
+
}
|
|
6474
|
+
return scopedData.reduce(
|
|
6475
|
+
function(accumulator, current2) {
|
|
6476
|
+
return jsonLogic.apply(
|
|
6477
|
+
scopedLogic,
|
|
6478
|
+
{ current: current2, accumulator }
|
|
6479
|
+
);
|
|
6480
|
+
},
|
|
6481
|
+
initial
|
|
6482
|
+
);
|
|
6483
|
+
} else if (op === "all") {
|
|
6484
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6485
|
+
scopedLogic = values[1];
|
|
6486
|
+
if (!Array.isArray(scopedData) || !scopedData.length) {
|
|
6487
|
+
return false;
|
|
6488
|
+
}
|
|
6489
|
+
for (i = 0; i < scopedData.length; i += 1) {
|
|
6490
|
+
if (!jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) {
|
|
6491
|
+
return false;
|
|
6492
|
+
}
|
|
6493
|
+
}
|
|
6494
|
+
return true;
|
|
6495
|
+
} else if (op === "none") {
|
|
6496
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6497
|
+
scopedLogic = values[1];
|
|
6498
|
+
if (!Array.isArray(scopedData) || !scopedData.length) {
|
|
6499
|
+
return true;
|
|
6500
|
+
}
|
|
6501
|
+
for (i = 0; i < scopedData.length; i += 1) {
|
|
6502
|
+
if (jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) {
|
|
6503
|
+
return false;
|
|
6504
|
+
}
|
|
6505
|
+
}
|
|
6506
|
+
return true;
|
|
6507
|
+
} else if (op === "some") {
|
|
6508
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6509
|
+
scopedLogic = values[1];
|
|
6510
|
+
if (!Array.isArray(scopedData) || !scopedData.length) {
|
|
6511
|
+
return false;
|
|
6512
|
+
}
|
|
6513
|
+
for (i = 0; i < scopedData.length; i += 1) {
|
|
6514
|
+
if (jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) {
|
|
6515
|
+
return true;
|
|
6516
|
+
}
|
|
6517
|
+
}
|
|
6518
|
+
return false;
|
|
6519
|
+
}
|
|
6520
|
+
values = values.map(function(val) {
|
|
6521
|
+
return jsonLogic.apply(val, data);
|
|
6522
|
+
});
|
|
6523
|
+
if (operations.hasOwnProperty(op) && typeof operations[op] === "function") {
|
|
6524
|
+
return operations[op].apply(data, values);
|
|
6525
|
+
} else if (op.indexOf(".") > 0) {
|
|
6526
|
+
var sub_ops = String(op).split(".");
|
|
6527
|
+
var operation = operations;
|
|
6528
|
+
for (i = 0; i < sub_ops.length; i++) {
|
|
6529
|
+
if (!operation.hasOwnProperty(sub_ops[i])) {
|
|
6530
|
+
throw new Error("Unrecognized operation " + op + " (failed at " + sub_ops.slice(0, i + 1).join(".") + ")");
|
|
6531
|
+
}
|
|
6532
|
+
operation = operation[sub_ops[i]];
|
|
6533
|
+
}
|
|
6534
|
+
return operation.apply(data, values);
|
|
6535
|
+
}
|
|
6536
|
+
throw new Error("Unrecognized operation " + op);
|
|
6537
|
+
};
|
|
6538
|
+
jsonLogic.uses_data = function(logic) {
|
|
6539
|
+
var collection = [];
|
|
6540
|
+
if (jsonLogic.is_logic(logic)) {
|
|
6541
|
+
var op = jsonLogic.get_operator(logic);
|
|
6542
|
+
var values = logic[op];
|
|
6543
|
+
if (!Array.isArray(values)) {
|
|
6544
|
+
values = [values];
|
|
6545
|
+
}
|
|
6546
|
+
if (op === "var") {
|
|
6547
|
+
collection.push(values[0]);
|
|
6548
|
+
} else {
|
|
6549
|
+
values.forEach(function(val) {
|
|
6550
|
+
collection.push.apply(collection, jsonLogic.uses_data(val));
|
|
6551
|
+
});
|
|
6552
|
+
}
|
|
6553
|
+
}
|
|
6554
|
+
return arrayUnique(collection);
|
|
6555
|
+
};
|
|
6556
|
+
jsonLogic.add_operation = function(name, code) {
|
|
6557
|
+
operations[name] = code;
|
|
6558
|
+
};
|
|
6559
|
+
jsonLogic.rm_operation = function(name) {
|
|
6560
|
+
delete operations[name];
|
|
6561
|
+
};
|
|
6562
|
+
jsonLogic.rule_like = function(rule, pattern) {
|
|
6563
|
+
if (pattern === rule) {
|
|
6564
|
+
return true;
|
|
6565
|
+
}
|
|
6566
|
+
if (pattern === "@") {
|
|
6567
|
+
return true;
|
|
6568
|
+
}
|
|
6569
|
+
if (pattern === "number") {
|
|
6570
|
+
return typeof rule === "number";
|
|
6571
|
+
}
|
|
6572
|
+
if (pattern === "string") {
|
|
6573
|
+
return typeof rule === "string";
|
|
6574
|
+
}
|
|
6575
|
+
if (pattern === "array") {
|
|
6576
|
+
return Array.isArray(rule) && !jsonLogic.is_logic(rule);
|
|
6577
|
+
}
|
|
6578
|
+
if (jsonLogic.is_logic(pattern)) {
|
|
6579
|
+
if (jsonLogic.is_logic(rule)) {
|
|
6580
|
+
var pattern_op = jsonLogic.get_operator(pattern);
|
|
6581
|
+
var rule_op = jsonLogic.get_operator(rule);
|
|
6582
|
+
if (pattern_op === "@" || pattern_op === rule_op) {
|
|
6583
|
+
return jsonLogic.rule_like(
|
|
6584
|
+
jsonLogic.get_values(rule, false),
|
|
6585
|
+
jsonLogic.get_values(pattern, false)
|
|
6586
|
+
);
|
|
6587
|
+
}
|
|
6588
|
+
}
|
|
6589
|
+
return false;
|
|
6590
|
+
}
|
|
6591
|
+
if (Array.isArray(pattern)) {
|
|
6592
|
+
if (Array.isArray(rule)) {
|
|
6593
|
+
if (pattern.length !== rule.length) {
|
|
6594
|
+
return false;
|
|
6595
|
+
}
|
|
6596
|
+
for (var i = 0; i < pattern.length; i += 1) {
|
|
6597
|
+
if (!jsonLogic.rule_like(rule[i], pattern[i])) {
|
|
6598
|
+
return false;
|
|
6599
|
+
}
|
|
6600
|
+
}
|
|
6601
|
+
return true;
|
|
6602
|
+
} else {
|
|
6603
|
+
return false;
|
|
6604
|
+
}
|
|
6605
|
+
}
|
|
6606
|
+
return false;
|
|
6607
|
+
};
|
|
6608
|
+
return jsonLogic;
|
|
6609
|
+
});
|
|
6610
|
+
}
|
|
6611
|
+
});
|
|
6612
|
+
|
|
6613
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/local_flags.js
|
|
6011
6614
|
var require_local_flags = __commonJS({
|
|
6012
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6615
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/local_flags.js"(exports$1, module) {
|
|
6013
6616
|
var FeatureFlagsProvider = require_flags();
|
|
6014
|
-
var {
|
|
6617
|
+
var {
|
|
6618
|
+
normalizedHash,
|
|
6619
|
+
lowercaseAllKeysAndValues,
|
|
6620
|
+
lowercaseLeafNodes
|
|
6621
|
+
} = require_utils2();
|
|
6622
|
+
var { apply } = require_logic();
|
|
6015
6623
|
var LocalFeatureFlagsProvider = class extends FeatureFlagsProvider {
|
|
6016
6624
|
/**
|
|
6017
6625
|
* @param {string} token - Mixpanel project token
|
|
@@ -6050,12 +6658,16 @@ var require_local_flags = __commonJS({
|
|
|
6050
6658
|
try {
|
|
6051
6659
|
await this._fetchFlagDefinitions();
|
|
6052
6660
|
} catch (err) {
|
|
6053
|
-
this.logger?.error(
|
|
6661
|
+
this.logger?.error(
|
|
6662
|
+
`Error polling for flag definition: ${err.message}`
|
|
6663
|
+
);
|
|
6054
6664
|
}
|
|
6055
6665
|
}, this.config.polling_interval_in_seconds * 1e3);
|
|
6056
6666
|
}
|
|
6057
6667
|
} catch (err) {
|
|
6058
|
-
this.logger?.error(
|
|
6668
|
+
this.logger?.error(
|
|
6669
|
+
`Initial flag definitions fetch failed: ${err.message}`
|
|
6670
|
+
);
|
|
6059
6671
|
}
|
|
6060
6672
|
}
|
|
6061
6673
|
/**
|
|
@@ -6066,7 +6678,9 @@ var require_local_flags = __commonJS({
|
|
|
6066
6678
|
clearInterval(this.pollingInterval);
|
|
6067
6679
|
this.pollingInterval = null;
|
|
6068
6680
|
} else {
|
|
6069
|
-
this.logger?.warn(
|
|
6681
|
+
this.logger?.warn(
|
|
6682
|
+
"stopPollingForDefinitions called but polling was not active"
|
|
6683
|
+
);
|
|
6070
6684
|
}
|
|
6071
6685
|
}
|
|
6072
6686
|
/**
|
|
@@ -6091,7 +6705,12 @@ var require_local_flags = __commonJS({
|
|
|
6091
6705
|
* @returns {*} The variant value
|
|
6092
6706
|
*/
|
|
6093
6707
|
getVariantValue(flagKey, fallbackValue, context, reportExposure = true) {
|
|
6094
|
-
const result = this.getVariant(
|
|
6708
|
+
const result = this.getVariant(
|
|
6709
|
+
flagKey,
|
|
6710
|
+
{ variant_value: fallbackValue },
|
|
6711
|
+
context,
|
|
6712
|
+
reportExposure
|
|
6713
|
+
);
|
|
6095
6714
|
return result.variant_value;
|
|
6096
6715
|
}
|
|
6097
6716
|
/**
|
|
@@ -6122,7 +6741,12 @@ var require_local_flags = __commonJS({
|
|
|
6122
6741
|
} else {
|
|
6123
6742
|
const rollout = this._getAssignedRollout(flag, contextValue, context);
|
|
6124
6743
|
if (rollout) {
|
|
6125
|
-
selectedVariant = this._getAssignedVariant(
|
|
6744
|
+
selectedVariant = this._getAssignedVariant(
|
|
6745
|
+
flag,
|
|
6746
|
+
contextValue,
|
|
6747
|
+
flagKey,
|
|
6748
|
+
rollout
|
|
6749
|
+
);
|
|
6126
6750
|
}
|
|
6127
6751
|
}
|
|
6128
6752
|
if (selectedVariant) {
|
|
@@ -6217,7 +6841,10 @@ var require_local_flags = __commonJS({
|
|
|
6217
6841
|
}
|
|
6218
6842
|
_getAssignedVariant(flag, contextValue, flagKey, rollout) {
|
|
6219
6843
|
if (rollout.variant_override) {
|
|
6220
|
-
const variant = this._getMatchingVariant(
|
|
6844
|
+
const variant = this._getMatchingVariant(
|
|
6845
|
+
rollout.variant_override.key,
|
|
6846
|
+
flag
|
|
6847
|
+
);
|
|
6221
6848
|
if (variant) {
|
|
6222
6849
|
return { ...variant, is_qa_tester: false };
|
|
6223
6850
|
}
|
|
@@ -6250,15 +6877,41 @@ var require_local_flags = __commonJS({
|
|
|
6250
6877
|
is_qa_tester: false
|
|
6251
6878
|
};
|
|
6252
6879
|
}
|
|
6880
|
+
_extractRuntimeParameters(context) {
|
|
6881
|
+
const customProperties = context.custom_properties;
|
|
6882
|
+
if (!customProperties || typeof customProperties !== "object") {
|
|
6883
|
+
return null;
|
|
6884
|
+
}
|
|
6885
|
+
return lowercaseAllKeysAndValues(customProperties);
|
|
6886
|
+
}
|
|
6887
|
+
_isRuntimeRuleSatisfied(rollout, context) {
|
|
6888
|
+
try {
|
|
6889
|
+
return apply(
|
|
6890
|
+
lowercaseLeafNodes(rollout.runtime_evaluation_rule),
|
|
6891
|
+
this._extractRuntimeParameters(context)
|
|
6892
|
+
);
|
|
6893
|
+
} catch (error) {
|
|
6894
|
+
this.logger?.error(`Error evaluating runtime rule: ${error.message}`);
|
|
6895
|
+
return false;
|
|
6896
|
+
}
|
|
6897
|
+
}
|
|
6253
6898
|
_isRuntimeEvaluationSatisfied(rollout, context) {
|
|
6254
|
-
if (
|
|
6899
|
+
if (rollout.runtime_evaluation_rule) {
|
|
6900
|
+
return this._isRuntimeRuleSatisfied(rollout, context);
|
|
6901
|
+
} else if (rollout.runtime_evaluation_definition) {
|
|
6902
|
+
return this._isLegacyRuntimeEvaluationSatisfied(rollout, context);
|
|
6903
|
+
} else {
|
|
6255
6904
|
return true;
|
|
6256
6905
|
}
|
|
6257
|
-
|
|
6258
|
-
|
|
6906
|
+
}
|
|
6907
|
+
_isLegacyRuntimeEvaluationSatisfied(rollout, context) {
|
|
6908
|
+
const customProperties = this._extractRuntimeParameters(context);
|
|
6909
|
+
if (!customProperties) {
|
|
6259
6910
|
return false;
|
|
6260
6911
|
}
|
|
6261
|
-
for (const [key, expectedValue] of Object.entries(
|
|
6912
|
+
for (const [key, expectedValue] of Object.entries(
|
|
6913
|
+
rollout.runtime_evaluation_definition
|
|
6914
|
+
)) {
|
|
6262
6915
|
if (!(key in customProperties)) {
|
|
6263
6916
|
return false;
|
|
6264
6917
|
}
|
|
@@ -6274,9 +6927,9 @@ var require_local_flags = __commonJS({
|
|
|
6274
6927
|
}
|
|
6275
6928
|
});
|
|
6276
6929
|
|
|
6277
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
6930
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/remote_flags.js
|
|
6278
6931
|
var require_remote_flags = __commonJS({
|
|
6279
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6932
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/remote_flags.js"(exports$1, module) {
|
|
6280
6933
|
var FeatureFlagsProvider = require_flags();
|
|
6281
6934
|
var RemoteFeatureFlagsProvider = class extends FeatureFlagsProvider {
|
|
6282
6935
|
/**
|
|
@@ -6310,10 +6963,17 @@ var require_remote_flags = __commonJS({
|
|
|
6310
6963
|
*/
|
|
6311
6964
|
async getVariantValue(flagKey, fallbackValue, context, reportExposure = true) {
|
|
6312
6965
|
try {
|
|
6313
|
-
const selectedVariant = await this.getVariant(
|
|
6966
|
+
const selectedVariant = await this.getVariant(
|
|
6967
|
+
flagKey,
|
|
6968
|
+
{ variant_value: fallbackValue },
|
|
6969
|
+
context,
|
|
6970
|
+
reportExposure
|
|
6971
|
+
);
|
|
6314
6972
|
return selectedVariant.variant_value;
|
|
6315
6973
|
} catch (err) {
|
|
6316
|
-
this.logger?.error(
|
|
6974
|
+
this.logger?.error(
|
|
6975
|
+
`Failed to get variant value for flag '${flagKey}': ${err.message}`
|
|
6976
|
+
);
|
|
6317
6977
|
return fallbackValue;
|
|
6318
6978
|
}
|
|
6319
6979
|
}
|
|
@@ -6342,7 +7002,9 @@ var require_remote_flags = __commonJS({
|
|
|
6342
7002
|
}
|
|
6343
7003
|
return selectedVariant;
|
|
6344
7004
|
} catch (err) {
|
|
6345
|
-
this.logger?.error(
|
|
7005
|
+
this.logger?.error(
|
|
7006
|
+
`Failed to get variant for flag '${flagKey}': ${err.message}`
|
|
7007
|
+
);
|
|
6346
7008
|
return fallbackVariant;
|
|
6347
7009
|
}
|
|
6348
7010
|
}
|
|
@@ -6359,7 +7021,9 @@ var require_remote_flags = __commonJS({
|
|
|
6359
7021
|
const value = await this.getVariantValue(flagKey, false, context);
|
|
6360
7022
|
return value === true;
|
|
6361
7023
|
} catch (err) {
|
|
6362
|
-
this.logger?.error(
|
|
7024
|
+
this.logger?.error(
|
|
7025
|
+
`Failed to check if flag '${flagKey}' is enabled: ${err.message}`
|
|
7026
|
+
);
|
|
6363
7027
|
return false;
|
|
6364
7028
|
}
|
|
6365
7029
|
}
|
|
@@ -6398,9 +7062,9 @@ var require_remote_flags = __commonJS({
|
|
|
6398
7062
|
}
|
|
6399
7063
|
});
|
|
6400
7064
|
|
|
6401
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
7065
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/index.js
|
|
6402
7066
|
var require_flags2 = __commonJS({
|
|
6403
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
7067
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/index.js"(exports$1, module) {
|
|
6404
7068
|
var LocalFeatureFlagsProvider = require_local_flags();
|
|
6405
7069
|
var RemoteFeatureFlagsProvider = require_remote_flags();
|
|
6406
7070
|
module.exports = {
|
|
@@ -6410,9 +7074,9 @@ var require_flags2 = __commonJS({
|
|
|
6410
7074
|
}
|
|
6411
7075
|
});
|
|
6412
7076
|
|
|
6413
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
7077
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/mixpanel-node.js
|
|
6414
7078
|
var require_mixpanel_node = __commonJS({
|
|
6415
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
7079
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/mixpanel-node.js"(exports$1, module) {
|
|
6416
7080
|
var querystring = __require("querystring");
|
|
6417
7081
|
var Buffer4 = __require("buffer").Buffer;
|
|
6418
7082
|
var http3 = __require("http");
|
|
@@ -6423,7 +7087,10 @@ var require_mixpanel_node = __commonJS({
|
|
|
6423
7087
|
var { async_all, ensure_timestamp, assert_logger } = require_utils();
|
|
6424
7088
|
var { MixpanelGroups } = require_groups();
|
|
6425
7089
|
var { MixpanelPeople } = require_people();
|
|
6426
|
-
var {
|
|
7090
|
+
var {
|
|
7091
|
+
LocalFeatureFlagsProvider,
|
|
7092
|
+
RemoteFeatureFlagsProvider
|
|
7093
|
+
} = require_flags2();
|
|
6427
7094
|
var DEFAULT_CONFIG = {
|
|
6428
7095
|
test: false,
|
|
6429
7096
|
debug: false,
|
|
@@ -6439,7 +7106,9 @@ var require_mixpanel_node = __commonJS({
|
|
|
6439
7106
|
};
|
|
6440
7107
|
var create_client = function(token, config) {
|
|
6441
7108
|
if (!token) {
|
|
6442
|
-
throw new Error(
|
|
7109
|
+
throw new Error(
|
|
7110
|
+
"The Mixpanel Client needs a Mixpanel token: `init(token)`"
|
|
7111
|
+
);
|
|
6443
7112
|
}
|
|
6444
7113
|
const metrics = {
|
|
6445
7114
|
token,
|
|
@@ -6453,9 +7122,11 @@ var require_mixpanel_node = __commonJS({
|
|
|
6453
7122
|
https: new https3.Agent({ keepAlive })
|
|
6454
7123
|
};
|
|
6455
7124
|
const proxyPath = process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
|
|
6456
|
-
const proxyAgent = proxyPath ? new HttpsProxyAgent(
|
|
6457
|
-
|
|
6458
|
-
|
|
7125
|
+
const proxyAgent = proxyPath ? new HttpsProxyAgent(
|
|
7126
|
+
Object.assign(url.parse(proxyPath), {
|
|
7127
|
+
keepAlive
|
|
7128
|
+
})
|
|
7129
|
+
) : null;
|
|
6459
7130
|
metrics.send_request = function(options, callback) {
|
|
6460
7131
|
callback = callback || function() {
|
|
6461
7132
|
};
|
|
@@ -6463,8 +7134,8 @@ var require_mixpanel_node = __commonJS({
|
|
|
6463
7134
|
const endpoint = options.endpoint;
|
|
6464
7135
|
const method = (options.method || "GET").toUpperCase();
|
|
6465
7136
|
let query_params = {
|
|
6466
|
-
|
|
6467
|
-
|
|
7137
|
+
ip: metrics.config.geolocate ? 1 : 0,
|
|
7138
|
+
verbose: metrics.config.verbose ? 1 : 0
|
|
6468
7139
|
};
|
|
6469
7140
|
const key = metrics.config.key;
|
|
6470
7141
|
const secret = metrics.config.secret;
|
|
@@ -6497,7 +7168,9 @@ var require_mixpanel_node = __commonJS({
|
|
|
6497
7168
|
} else if (key) {
|
|
6498
7169
|
query_params.api_key = key;
|
|
6499
7170
|
} else if (endpoint === "/import") {
|
|
6500
|
-
throw new Error(
|
|
7171
|
+
throw new Error(
|
|
7172
|
+
"The Mixpanel Client needs a Mixpanel API Secret when importing old events: `init(token, { secret: ... })`"
|
|
7173
|
+
);
|
|
6501
7174
|
}
|
|
6502
7175
|
request_options.agent = proxyAgent || REQUEST_AGENTS[metrics.config.protocol];
|
|
6503
7176
|
if (metrics.config.test) {
|
|
@@ -6505,20 +7178,22 @@ var require_mixpanel_node = __commonJS({
|
|
|
6505
7178
|
}
|
|
6506
7179
|
request_options.path = metrics.config.path + endpoint + "?" + querystring.stringify(query_params);
|
|
6507
7180
|
request = request_lib.request(request_options, function(res) {
|
|
6508
|
-
|
|
7181
|
+
let data = "";
|
|
6509
7182
|
res.on("data", function(chunk3) {
|
|
6510
7183
|
data += chunk3;
|
|
6511
7184
|
});
|
|
6512
7185
|
res.on("end", function() {
|
|
6513
|
-
|
|
7186
|
+
let e;
|
|
6514
7187
|
if (metrics.config.verbose) {
|
|
6515
7188
|
try {
|
|
6516
|
-
|
|
7189
|
+
const result = JSON.parse(data);
|
|
6517
7190
|
if (result.status != 1) {
|
|
6518
7191
|
e = new Error("Mixpanel Server Error: " + result.error);
|
|
6519
7192
|
}
|
|
6520
7193
|
} catch (ex) {
|
|
6521
|
-
e = new Error(
|
|
7194
|
+
e = new Error(
|
|
7195
|
+
"Could not parse response from Mixpanel " + ex.message
|
|
7196
|
+
);
|
|
6522
7197
|
}
|
|
6523
7198
|
} else {
|
|
6524
7199
|
e = data !== "1" ? new Error("Mixpanel Server Error: " + data) : void 0;
|
|
@@ -6541,39 +7216,46 @@ var require_mixpanel_node = __commonJS({
|
|
|
6541
7216
|
properties.token = metrics.token;
|
|
6542
7217
|
properties.mp_lib = "node";
|
|
6543
7218
|
properties.$lib_version = packageInfo.version;
|
|
6544
|
-
|
|
7219
|
+
const data = {
|
|
6545
7220
|
event,
|
|
6546
7221
|
properties
|
|
6547
7222
|
};
|
|
6548
7223
|
if (metrics.config.debug) {
|
|
6549
|
-
metrics.config.logger.debug("Sending the following event to Mixpanel", {
|
|
7224
|
+
metrics.config.logger.debug("Sending the following event to Mixpanel", {
|
|
7225
|
+
data
|
|
7226
|
+
});
|
|
6550
7227
|
}
|
|
6551
|
-
metrics.send_request(
|
|
7228
|
+
metrics.send_request(
|
|
7229
|
+
{ method: "GET", endpoint, data },
|
|
7230
|
+
callback
|
|
7231
|
+
);
|
|
6552
7232
|
};
|
|
6553
|
-
|
|
6554
|
-
|
|
7233
|
+
const chunk2 = function(arr, size) {
|
|
7234
|
+
let chunks = [], i = 0, total = arr.length;
|
|
6555
7235
|
while (i < total) {
|
|
6556
7236
|
chunks.push(arr.slice(i, i += size));
|
|
6557
7237
|
}
|
|
6558
7238
|
return chunks;
|
|
6559
7239
|
};
|
|
6560
|
-
|
|
6561
|
-
|
|
7240
|
+
const send_batch_requests = function(options, callback) {
|
|
7241
|
+
const event_list = options.event_list, endpoint = options.endpoint, max_batch_size = options.max_batch_size ? Math.min(MAX_BATCH_SIZE, options.max_batch_size) : MAX_BATCH_SIZE, max_concurrent_requests = options.max_concurrent_requests || options.max_batch_size > MAX_BATCH_SIZE && Math.ceil(options.max_batch_size / MAX_BATCH_SIZE), event_batches = chunk2(event_list, max_batch_size), request_batches = max_concurrent_requests ? chunk2(event_batches, max_concurrent_requests) : [event_batches], total_event_batches = event_batches.length, total_request_batches = request_batches.length;
|
|
6562
7242
|
function send_event_batch(batch, cb) {
|
|
6563
7243
|
if (batch.length > 0) {
|
|
6564
7244
|
batch = batch.map(function(event) {
|
|
6565
|
-
event.properties;
|
|
6566
7245
|
if (endpoint === "/import" || event.properties.time) {
|
|
6567
7246
|
event.properties.time = ensure_timestamp(event.properties.time);
|
|
6568
7247
|
}
|
|
6569
7248
|
event.properties.token = event.properties.token || metrics.token;
|
|
6570
7249
|
return event;
|
|
6571
7250
|
});
|
|
6572
|
-
metrics.send_request(
|
|
7251
|
+
metrics.send_request(
|
|
7252
|
+
{ method: "POST", endpoint, data: batch },
|
|
7253
|
+
cb
|
|
7254
|
+
);
|
|
6573
7255
|
}
|
|
6574
7256
|
}
|
|
6575
7257
|
function send_next_request_batch(index) {
|
|
6576
|
-
|
|
7258
|
+
const request_batch = request_batches[index], cb = function(errors, results) {
|
|
6577
7259
|
index += 1;
|
|
6578
7260
|
if (index === total_request_batches) {
|
|
6579
7261
|
callback && callback(errors, results);
|
|
@@ -6606,7 +7288,7 @@ var require_mixpanel_node = __commonJS({
|
|
|
6606
7288
|
callback = options;
|
|
6607
7289
|
options = {};
|
|
6608
7290
|
}
|
|
6609
|
-
|
|
7291
|
+
const batch_options = {
|
|
6610
7292
|
event_list,
|
|
6611
7293
|
endpoint: "/track",
|
|
6612
7294
|
max_concurrent_requests: options.max_concurrent_requests,
|
|
@@ -6623,7 +7305,7 @@ var require_mixpanel_node = __commonJS({
|
|
|
6623
7305
|
metrics.send_event_request("/import", event, properties, callback);
|
|
6624
7306
|
};
|
|
6625
7307
|
metrics.import_batch = function(event_list, options, callback) {
|
|
6626
|
-
|
|
7308
|
+
let batch_options;
|
|
6627
7309
|
if (typeof options === "function" || !options) {
|
|
6628
7310
|
callback = options;
|
|
6629
7311
|
options = {};
|
|
@@ -6637,7 +7319,7 @@ var require_mixpanel_node = __commonJS({
|
|
|
6637
7319
|
send_batch_requests(batch_options, callback);
|
|
6638
7320
|
};
|
|
6639
7321
|
metrics.alias = function(distinct_id, alias, callback) {
|
|
6640
|
-
|
|
7322
|
+
const properties = {
|
|
6641
7323
|
distinct_id,
|
|
6642
7324
|
alias
|
|
6643
7325
|
};
|
|
@@ -8646,7 +9328,7 @@ var init_is_disjoint = __esm({
|
|
|
8646
9328
|
function isObjectLike(value) {
|
|
8647
9329
|
return typeof value === "object" && value !== null;
|
|
8648
9330
|
}
|
|
8649
|
-
function
|
|
9331
|
+
function isObject2(input) {
|
|
8650
9332
|
if (!isObjectLike(input) || Object.prototype.toString.call(input) !== "[object Object]") {
|
|
8651
9333
|
return false;
|
|
8652
9334
|
}
|
|
@@ -8666,7 +9348,7 @@ var init_is_object = __esm({
|
|
|
8666
9348
|
|
|
8667
9349
|
// ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_jwk.js
|
|
8668
9350
|
function isJWK(key) {
|
|
8669
|
-
return
|
|
9351
|
+
return isObject2(key) && typeof key.kty === "string";
|
|
8670
9352
|
}
|
|
8671
9353
|
function isPrivateJWK(key) {
|
|
8672
9354
|
return key.kty !== "oct" && typeof key.d === "string";
|
|
@@ -9310,7 +9992,7 @@ var init_produce = __esm({
|
|
|
9310
9992
|
ProduceJWT = class {
|
|
9311
9993
|
_payload;
|
|
9312
9994
|
constructor(payload = {}) {
|
|
9313
|
-
if (!
|
|
9995
|
+
if (!isObject2(payload)) {
|
|
9314
9996
|
throw new TypeError("JWT Claims Set MUST be an object");
|
|
9315
9997
|
}
|
|
9316
9998
|
this._payload = payload;
|
|
@@ -13365,10 +14047,10 @@ var init_esm4 = __esm({
|
|
|
13365
14047
|
}
|
|
13366
14048
|
});
|
|
13367
14049
|
|
|
13368
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14050
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js
|
|
13369
14051
|
var IdentifyOperation, SpecialEventType;
|
|
13370
14052
|
var init_event = __esm({
|
|
13371
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14053
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js"() {
|
|
13372
14054
|
(function(IdentifyOperation3) {
|
|
13373
14055
|
IdentifyOperation3["SET"] = "$set";
|
|
13374
14056
|
IdentifyOperation3["SET_ONCE"] = "$setOnce";
|
|
@@ -13389,10 +14071,10 @@ var init_event = __esm({
|
|
|
13389
14071
|
}
|
|
13390
14072
|
});
|
|
13391
14073
|
|
|
13392
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14074
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js
|
|
13393
14075
|
var UNSET_VALUE, AMPLITUDE_PREFIX, STORAGE_PREFIX, DEFAULT_INSTANCE_NAME, AMPLITUDE_SERVER_URL, EU_AMPLITUDE_SERVER_URL, AMPLITUDE_BATCH_SERVER_URL, EU_AMPLITUDE_BATCH_SERVER_URL;
|
|
13394
14076
|
var init_constants = __esm({
|
|
13395
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14077
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js"() {
|
|
13396
14078
|
UNSET_VALUE = "-";
|
|
13397
14079
|
AMPLITUDE_PREFIX = "AMP";
|
|
13398
14080
|
STORAGE_PREFIX = "".concat(AMPLITUDE_PREFIX, "_unsent");
|
|
@@ -13404,10 +14086,10 @@ var init_constants = __esm({
|
|
|
13404
14086
|
}
|
|
13405
14087
|
});
|
|
13406
14088
|
|
|
13407
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14089
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js
|
|
13408
14090
|
var MAX_PROPERTY_KEYS, isValidObject, isValidProperties;
|
|
13409
14091
|
var init_valid_properties = __esm({
|
|
13410
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14092
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js"() {
|
|
13411
14093
|
init_tslib_es6();
|
|
13412
14094
|
MAX_PROPERTY_KEYS = 1e3;
|
|
13413
14095
|
isValidObject = function(properties) {
|
|
@@ -13462,10 +14144,10 @@ var init_valid_properties = __esm({
|
|
|
13462
14144
|
}
|
|
13463
14145
|
});
|
|
13464
14146
|
|
|
13465
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14147
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/identify.js
|
|
13466
14148
|
var Identify, IdentifyOperation2, OrderedIdentifyOperations;
|
|
13467
14149
|
var init_identify = __esm({
|
|
13468
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14150
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/identify.js"() {
|
|
13469
14151
|
init_tslib_es6();
|
|
13470
14152
|
init_constants();
|
|
13471
14153
|
init_valid_properties();
|
|
@@ -13576,10 +14258,10 @@ var init_identify = __esm({
|
|
|
13576
14258
|
}
|
|
13577
14259
|
});
|
|
13578
14260
|
|
|
13579
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14261
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js
|
|
13580
14262
|
var SUCCESS_MESSAGE, UNEXPECTED_ERROR_MESSAGE, MAX_RETRIES_EXCEEDED_MESSAGE, OPT_OUT_MESSAGE, MISSING_API_KEY_MESSAGE, INVALID_API_KEY, CLIENT_NOT_INITIALIZED;
|
|
13581
14263
|
var init_messages = __esm({
|
|
13582
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14264
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js"() {
|
|
13583
14265
|
SUCCESS_MESSAGE = "Event tracked successfully";
|
|
13584
14266
|
UNEXPECTED_ERROR_MESSAGE = "Unexpected error occurred";
|
|
13585
14267
|
MAX_RETRIES_EXCEEDED_MESSAGE = "Event rejected due to exceeded retry count";
|
|
@@ -13590,10 +14272,10 @@ var init_messages = __esm({
|
|
|
13590
14272
|
}
|
|
13591
14273
|
});
|
|
13592
14274
|
|
|
13593
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14275
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/status.js
|
|
13594
14276
|
var Status;
|
|
13595
14277
|
var init_status = __esm({
|
|
13596
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14278
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/status.js"() {
|
|
13597
14279
|
(function(Status2) {
|
|
13598
14280
|
Status2["Unknown"] = "unknown";
|
|
13599
14281
|
Status2["Skipped"] = "skipped";
|
|
@@ -13608,10 +14290,10 @@ var init_status = __esm({
|
|
|
13608
14290
|
}
|
|
13609
14291
|
});
|
|
13610
14292
|
|
|
13611
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14293
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js
|
|
13612
14294
|
var buildResult;
|
|
13613
14295
|
var init_result_builder = __esm({
|
|
13614
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14296
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js"() {
|
|
13615
14297
|
init_status();
|
|
13616
14298
|
buildResult = function(event, code, message2) {
|
|
13617
14299
|
if (code === void 0) {
|
|
@@ -13625,10 +14307,10 @@ var init_result_builder = __esm({
|
|
|
13625
14307
|
}
|
|
13626
14308
|
});
|
|
13627
14309
|
|
|
13628
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14310
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js
|
|
13629
14311
|
var getGlobalScope;
|
|
13630
14312
|
var init_global_scope = __esm({
|
|
13631
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14313
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js"() {
|
|
13632
14314
|
getGlobalScope = function() {
|
|
13633
14315
|
var ampIntegrationContextName = "ampIntegrationContext";
|
|
13634
14316
|
if (typeof globalThis !== "undefined" && typeof globalThis[ampIntegrationContextName] !== "undefined") {
|
|
@@ -13651,10 +14333,10 @@ var init_global_scope = __esm({
|
|
|
13651
14333
|
}
|
|
13652
14334
|
});
|
|
13653
14335
|
|
|
13654
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14336
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js
|
|
13655
14337
|
var legacyUUID, hex, UUID2;
|
|
13656
14338
|
var init_uuid2 = __esm({
|
|
13657
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14339
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js"() {
|
|
13658
14340
|
init_tslib_es6();
|
|
13659
14341
|
init_global_scope();
|
|
13660
14342
|
legacyUUID = function(a) {
|
|
@@ -13698,10 +14380,10 @@ var init_uuid2 = __esm({
|
|
|
13698
14380
|
}
|
|
13699
14381
|
});
|
|
13700
14382
|
|
|
13701
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14383
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/timeline.js
|
|
13702
14384
|
var Timeline;
|
|
13703
14385
|
var init_timeline = __esm({
|
|
13704
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14386
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/timeline.js"() {
|
|
13705
14387
|
init_tslib_es6();
|
|
13706
14388
|
init_result_builder();
|
|
13707
14389
|
init_uuid2();
|
|
@@ -14003,10 +14685,10 @@ var init_timeline = __esm({
|
|
|
14003
14685
|
}
|
|
14004
14686
|
});
|
|
14005
14687
|
|
|
14006
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14688
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js
|
|
14007
14689
|
var createTrackEvent, createIdentifyEvent, createGroupIdentifyEvent, createGroupEvent, createRevenueEvent;
|
|
14008
14690
|
var init_event_builder = __esm({
|
|
14009
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14691
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js"() {
|
|
14010
14692
|
init_tslib_es6();
|
|
14011
14693
|
init_identify();
|
|
14012
14694
|
init_event();
|
|
@@ -14036,10 +14718,10 @@ var init_event_builder = __esm({
|
|
|
14036
14718
|
}
|
|
14037
14719
|
});
|
|
14038
14720
|
|
|
14039
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14721
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js
|
|
14040
14722
|
var returnWrapper;
|
|
14041
14723
|
var init_return_wrapper = __esm({
|
|
14042
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14724
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js"() {
|
|
14043
14725
|
returnWrapper = function(awaitable) {
|
|
14044
14726
|
return {
|
|
14045
14727
|
promise: awaitable || Promise.resolve()
|
|
@@ -14048,10 +14730,10 @@ var init_return_wrapper = __esm({
|
|
|
14048
14730
|
}
|
|
14049
14731
|
});
|
|
14050
14732
|
|
|
14051
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14733
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/core-client.js
|
|
14052
14734
|
var AmplitudeCore;
|
|
14053
14735
|
var init_core_client = __esm({
|
|
14054
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14736
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/core-client.js"() {
|
|
14055
14737
|
init_tslib_es6();
|
|
14056
14738
|
init_event();
|
|
14057
14739
|
init_identify();
|
|
@@ -14319,10 +15001,10 @@ var init_core_client = __esm({
|
|
|
14319
15001
|
}
|
|
14320
15002
|
});
|
|
14321
15003
|
|
|
14322
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15004
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/revenue.js
|
|
14323
15005
|
var Revenue, RevenueProperty;
|
|
14324
15006
|
var init_revenue = __esm({
|
|
14325
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15007
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/revenue.js"() {
|
|
14326
15008
|
init_tslib_es6();
|
|
14327
15009
|
init_valid_properties();
|
|
14328
15010
|
Revenue = /** @class */
|
|
@@ -14399,10 +15081,10 @@ var init_revenue = __esm({
|
|
|
14399
15081
|
}
|
|
14400
15082
|
});
|
|
14401
15083
|
|
|
14402
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15084
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js
|
|
14403
15085
|
var chunk;
|
|
14404
15086
|
var init_chunk = __esm({
|
|
14405
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15087
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js"() {
|
|
14406
15088
|
chunk = function(arr, size) {
|
|
14407
15089
|
var chunkSize = Math.max(size, 1);
|
|
14408
15090
|
return arr.reduce(function(chunks, element, index) {
|
|
@@ -14417,10 +15099,10 @@ var init_chunk = __esm({
|
|
|
14417
15099
|
}
|
|
14418
15100
|
});
|
|
14419
15101
|
|
|
14420
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15102
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js
|
|
14421
15103
|
var LogLevel;
|
|
14422
15104
|
var init_loglevel = __esm({
|
|
14423
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15105
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js"() {
|
|
14424
15106
|
(function(LogLevel2) {
|
|
14425
15107
|
LogLevel2[LogLevel2["None"] = 0] = "None";
|
|
14426
15108
|
LogLevel2[LogLevel2["Error"] = 1] = "Error";
|
|
@@ -14431,10 +15113,10 @@ var init_loglevel = __esm({
|
|
|
14431
15113
|
}
|
|
14432
15114
|
});
|
|
14433
15115
|
|
|
14434
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15116
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/logger.js
|
|
14435
15117
|
var PREFIX, Logger;
|
|
14436
15118
|
var init_logger3 = __esm({
|
|
14437
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15119
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/logger.js"() {
|
|
14438
15120
|
init_loglevel();
|
|
14439
15121
|
PREFIX = "Amplitude Logger ";
|
|
14440
15122
|
Logger = /** @class */
|
|
@@ -14496,10 +15178,10 @@ var init_logger3 = __esm({
|
|
|
14496
15178
|
}
|
|
14497
15179
|
});
|
|
14498
15180
|
|
|
14499
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15181
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/config.js
|
|
14500
15182
|
var getDefaultConfig, Config, getServerUrl, createServerConfig, RequestMetadata;
|
|
14501
15183
|
var init_config = __esm({
|
|
14502
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15184
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/config.js"() {
|
|
14503
15185
|
init_constants();
|
|
14504
15186
|
init_logger3();
|
|
14505
15187
|
init_loglevel();
|
|
@@ -14600,19 +15282,19 @@ var init_config = __esm({
|
|
|
14600
15282
|
}
|
|
14601
15283
|
});
|
|
14602
15284
|
|
|
14603
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15285
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js
|
|
14604
15286
|
function isSuccessStatusCode(code) {
|
|
14605
15287
|
return code >= 200 && code < 300;
|
|
14606
15288
|
}
|
|
14607
15289
|
var init_status_code = __esm({
|
|
14608
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15290
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js"() {
|
|
14609
15291
|
}
|
|
14610
15292
|
});
|
|
14611
15293
|
|
|
14612
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15294
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js
|
|
14613
15295
|
var getStacktrace, getClientLogConfig, getValueByStringPath, getClientStates, debugWrapper;
|
|
14614
15296
|
var init_debug = __esm({
|
|
14615
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15297
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js"() {
|
|
14616
15298
|
init_tslib_es6();
|
|
14617
15299
|
init_loglevel();
|
|
14618
15300
|
getStacktrace = function(ignoreDepth) {
|
|
@@ -14730,7 +15412,7 @@ var init_debug = __esm({
|
|
|
14730
15412
|
}
|
|
14731
15413
|
});
|
|
14732
15414
|
|
|
14733
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15415
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js
|
|
14734
15416
|
function getErrorMessage(error) {
|
|
14735
15417
|
if (error instanceof Error)
|
|
14736
15418
|
return error.message;
|
|
@@ -14748,7 +15430,7 @@ function getResponseBodyString(res) {
|
|
|
14748
15430
|
}
|
|
14749
15431
|
var Destination;
|
|
14750
15432
|
var init_destination = __esm({
|
|
14751
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15433
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js"() {
|
|
14752
15434
|
init_tslib_es6();
|
|
14753
15435
|
init_status();
|
|
14754
15436
|
init_messages();
|
|
@@ -15139,10 +15821,10 @@ var init_destination = __esm({
|
|
|
15139
15821
|
}
|
|
15140
15822
|
});
|
|
15141
15823
|
|
|
15142
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15824
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js
|
|
15143
15825
|
var BaseTransport;
|
|
15144
15826
|
var init_base2 = __esm({
|
|
15145
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15827
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js"() {
|
|
15146
15828
|
init_status();
|
|
15147
15829
|
init_status_code();
|
|
15148
15830
|
BaseTransport = /** @class */
|
|
@@ -15244,10 +15926,10 @@ var init_base2 = __esm({
|
|
|
15244
15926
|
}
|
|
15245
15927
|
});
|
|
15246
15928
|
|
|
15247
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15929
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js
|
|
15248
15930
|
var ServerZone;
|
|
15249
15931
|
var init_server_zone = __esm({
|
|
15250
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15932
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js"() {
|
|
15251
15933
|
(function(ServerZone2) {
|
|
15252
15934
|
ServerZone2["US"] = "US";
|
|
15253
15935
|
ServerZone2["EU"] = "EU";
|
|
@@ -15256,17 +15938,17 @@ var init_server_zone = __esm({
|
|
|
15256
15938
|
}
|
|
15257
15939
|
});
|
|
15258
15940
|
|
|
15259
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15941
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js
|
|
15260
15942
|
var OfflineDisabled;
|
|
15261
15943
|
var init_offline = __esm({
|
|
15262
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15944
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js"() {
|
|
15263
15945
|
OfflineDisabled = null;
|
|
15264
15946
|
}
|
|
15265
15947
|
});
|
|
15266
15948
|
|
|
15267
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15949
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/index.js
|
|
15268
15950
|
var init_esm5 = __esm({
|
|
15269
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15951
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/index.js"() {
|
|
15270
15952
|
init_core_client();
|
|
15271
15953
|
init_identify();
|
|
15272
15954
|
init_revenue();
|
|
@@ -15283,18 +15965,18 @@ var init_esm5 = __esm({
|
|
|
15283
15965
|
}
|
|
15284
15966
|
});
|
|
15285
15967
|
|
|
15286
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
15968
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/version.js
|
|
15287
15969
|
var VERSION;
|
|
15288
15970
|
var init_version3 = __esm({
|
|
15289
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
15290
|
-
VERSION = "1.5.
|
|
15971
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/version.js"() {
|
|
15972
|
+
VERSION = "1.5.32";
|
|
15291
15973
|
}
|
|
15292
15974
|
});
|
|
15293
15975
|
|
|
15294
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
15976
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js
|
|
15295
15977
|
var Context2;
|
|
15296
15978
|
var init_context4 = __esm({
|
|
15297
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
15979
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js"() {
|
|
15298
15980
|
init_tslib_es6();
|
|
15299
15981
|
init_esm5();
|
|
15300
15982
|
init_version3();
|
|
@@ -15329,7 +16011,7 @@ var init_context4 = __esm({
|
|
|
15329
16011
|
});
|
|
15330
16012
|
var Http;
|
|
15331
16013
|
var init_http = __esm({
|
|
15332
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16014
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/transports/http.js"() {
|
|
15333
16015
|
init_tslib_es6();
|
|
15334
16016
|
init_esm5();
|
|
15335
16017
|
Http = /** @class */
|
|
@@ -15391,10 +16073,10 @@ var init_http = __esm({
|
|
|
15391
16073
|
}
|
|
15392
16074
|
});
|
|
15393
16075
|
|
|
15394
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16076
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/config.js
|
|
15395
16077
|
var NodeConfig, useNodeConfig;
|
|
15396
16078
|
var init_config2 = __esm({
|
|
15397
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16079
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/config.js"() {
|
|
15398
16080
|
init_tslib_es6();
|
|
15399
16081
|
init_esm5();
|
|
15400
16082
|
init_http();
|
|
@@ -15412,10 +16094,10 @@ var init_config2 = __esm({
|
|
|
15412
16094
|
}
|
|
15413
16095
|
});
|
|
15414
16096
|
|
|
15415
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16097
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/node-client.js
|
|
15416
16098
|
var AmplitudeNode, createInstance, node_client_default;
|
|
15417
16099
|
var init_node_client = __esm({
|
|
15418
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16100
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/node-client.js"() {
|
|
15419
16101
|
init_tslib_es6();
|
|
15420
16102
|
init_esm5();
|
|
15421
16103
|
init_context4();
|
|
@@ -15489,7 +16171,7 @@ var init_node_client = __esm({
|
|
|
15489
16171
|
}
|
|
15490
16172
|
});
|
|
15491
16173
|
|
|
15492
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16174
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/types.js
|
|
15493
16175
|
var types_exports = {};
|
|
15494
16176
|
__export(types_exports, {
|
|
15495
16177
|
IdentifyOperation: () => IdentifyOperation,
|
|
@@ -15500,12 +16182,12 @@ __export(types_exports, {
|
|
|
15500
16182
|
SpecialEventType: () => SpecialEventType
|
|
15501
16183
|
});
|
|
15502
16184
|
var init_types4 = __esm({
|
|
15503
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16185
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/types.js"() {
|
|
15504
16186
|
init_esm5();
|
|
15505
16187
|
}
|
|
15506
16188
|
});
|
|
15507
16189
|
|
|
15508
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16190
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/index.js
|
|
15509
16191
|
var esm_exports2 = {};
|
|
15510
16192
|
__export(esm_exports2, {
|
|
15511
16193
|
Identify: () => Identify,
|
|
@@ -15526,7 +16208,7 @@ __export(esm_exports2, {
|
|
|
15526
16208
|
});
|
|
15527
16209
|
var add, groupIdentify, identify, init, logEvent, remove, revenue, setGroup, setOptOut, track, flush;
|
|
15528
16210
|
var init_esm6 = __esm({
|
|
15529
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16211
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/index.js"() {
|
|
15530
16212
|
init_node_client();
|
|
15531
16213
|
init_node_client();
|
|
15532
16214
|
init_esm5();
|