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.cjs
CHANGED
|
@@ -115,11 +115,11 @@ function normalizeWindowsPath(path) {
|
|
|
115
115
|
return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
|
|
116
116
|
}
|
|
117
117
|
var init_module_node = __esm({
|
|
118
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
118
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs"() {
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
|
|
122
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
122
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs
|
|
123
123
|
function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
124
124
|
return {
|
|
125
125
|
key,
|
|
@@ -136,7 +136,7 @@ function getFlagDetailFromFlagAndPayload(key, value, payload) {
|
|
|
136
136
|
}
|
|
137
137
|
var normalizeFlagsResponse, getFlagValuesFromFlags, getPayloadsFromFlags, getFeatureFlagValue, parsePayload;
|
|
138
138
|
var init_featureFlagUtils = __esm({
|
|
139
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
139
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/featureFlagUtils.mjs"() {
|
|
140
140
|
normalizeFlagsResponse = (flagsResponse) => {
|
|
141
141
|
if ("flags" in flagsResponse) {
|
|
142
142
|
const featureFlags = getFlagValuesFromFlags(flagsResponse.flags);
|
|
@@ -194,10 +194,10 @@ var init_featureFlagUtils = __esm({
|
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
196
|
|
|
197
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
197
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs
|
|
198
198
|
var DIGITS, UUID, V7Generator, getDefaultRandom, defaultGenerator, uuidv7, uuidv7obj;
|
|
199
199
|
var init_uuidv7 = __esm({
|
|
200
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
200
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/vendor/uuidv7.mjs"() {
|
|
201
201
|
DIGITS = "0123456789abcdef";
|
|
202
202
|
UUID = class _UUID {
|
|
203
203
|
constructor(bytes) {
|
|
@@ -358,10 +358,10 @@ var init_uuidv7 = __esm({
|
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
360
|
|
|
361
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
361
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs
|
|
362
362
|
var DEFAULT_BLOCKED_UA_STRS, isBlockedUA;
|
|
363
363
|
var init_bot_detection = __esm({
|
|
364
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
364
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/bot-detection.mjs"() {
|
|
365
365
|
DEFAULT_BLOCKED_UA_STRS = [
|
|
366
366
|
"amazonbot",
|
|
367
367
|
"amazonproductbot",
|
|
@@ -452,10 +452,10 @@ var init_bot_detection = __esm({
|
|
|
452
452
|
}
|
|
453
453
|
});
|
|
454
454
|
|
|
455
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
456
|
-
var types_PostHogPersistedProperty;
|
|
455
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/types.mjs
|
|
456
|
+
var types_PostHogPersistedProperty, FeatureFlagError;
|
|
457
457
|
var init_types = __esm({
|
|
458
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
458
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/types.mjs"() {
|
|
459
459
|
types_PostHogPersistedProperty = /* @__PURE__ */ (function(PostHogPersistedProperty) {
|
|
460
460
|
PostHogPersistedProperty["AnonymousId"] = "anonymous_id";
|
|
461
461
|
PostHogPersistedProperty["DistinctId"] = "distinct_id";
|
|
@@ -484,23 +484,25 @@ var init_types = __esm({
|
|
|
484
484
|
PostHogPersistedProperty["FlagsEndpointWasHit"] = "flags_endpoint_was_hit";
|
|
485
485
|
return PostHogPersistedProperty;
|
|
486
486
|
})({});
|
|
487
|
+
FeatureFlagError = {
|
|
488
|
+
ERRORS_WHILE_COMPUTING: "errors_while_computing_flags",
|
|
489
|
+
FLAG_MISSING: "flag_missing",
|
|
490
|
+
QUOTA_LIMITED: "quota_limited",
|
|
491
|
+
TIMEOUT: "timeout",
|
|
492
|
+
CONNECTION_ERROR: "connection_error",
|
|
493
|
+
UNKNOWN_ERROR: "unknown_error",
|
|
494
|
+
apiError: (status) => `api_error_${status}`
|
|
495
|
+
};
|
|
487
496
|
}
|
|
488
497
|
});
|
|
489
498
|
|
|
490
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
499
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/string-utils.mjs
|
|
491
500
|
var init_string_utils = __esm({
|
|
492
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
501
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/string-utils.mjs"() {
|
|
493
502
|
}
|
|
494
503
|
});
|
|
495
504
|
|
|
496
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
497
|
-
function isInstanceOf(candidate, base) {
|
|
498
|
-
try {
|
|
499
|
-
return candidate instanceof base;
|
|
500
|
-
} catch {
|
|
501
|
-
return false;
|
|
502
|
-
}
|
|
503
|
-
}
|
|
505
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/type-utils.mjs
|
|
504
506
|
function isPrimitive(value) {
|
|
505
507
|
return null === value || "object" != typeof value;
|
|
506
508
|
}
|
|
@@ -516,9 +518,16 @@ function isEvent(candidate) {
|
|
|
516
518
|
function isPlainObject(candidate) {
|
|
517
519
|
return isBuiltin(candidate, "Object");
|
|
518
520
|
}
|
|
519
|
-
|
|
521
|
+
function isInstanceOf(candidate, base) {
|
|
522
|
+
try {
|
|
523
|
+
return candidate instanceof base;
|
|
524
|
+
} catch {
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
var nativeIsArray, ObjProto, type_utils_toString, isArray, isObject, isUndefined, isString, isEmptyString, isNumber, isPlainError;
|
|
520
529
|
var init_type_utils = __esm({
|
|
521
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
530
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/type-utils.mjs"() {
|
|
522
531
|
init_types();
|
|
523
532
|
init_string_utils();
|
|
524
533
|
nativeIsArray = Array.isArray;
|
|
@@ -528,15 +537,16 @@ var init_type_utils = __esm({
|
|
|
528
537
|
isArray = nativeIsArray || function(obj) {
|
|
529
538
|
return "[object Array]" === type_utils_toString.call(obj);
|
|
530
539
|
};
|
|
540
|
+
isObject = (x) => x === Object(x) && !isArray(x);
|
|
531
541
|
isUndefined = (x) => void 0 === x;
|
|
532
542
|
isString = (x) => "[object String]" == type_utils_toString.call(x);
|
|
533
543
|
isEmptyString = (x) => isString(x) && 0 === x.trim().length;
|
|
534
|
-
isNumber = (x) => "[object Number]" == type_utils_toString.call(x);
|
|
544
|
+
isNumber = (x) => "[object Number]" == type_utils_toString.call(x) && x === x;
|
|
535
545
|
isPlainError = (x) => x instanceof Error;
|
|
536
546
|
}
|
|
537
547
|
});
|
|
538
548
|
|
|
539
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
549
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/number-utils.mjs
|
|
540
550
|
function clampToRange(value, min, max, logger, fallbackValue) {
|
|
541
551
|
if (min > max) {
|
|
542
552
|
logger.warn("min cannot be greater than max.");
|
|
@@ -554,15 +564,15 @@ function clampToRange(value, min, max, logger, fallbackValue) {
|
|
|
554
564
|
return clampToRange(max, min, max, logger);
|
|
555
565
|
}
|
|
556
566
|
var init_number_utils = __esm({
|
|
557
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
567
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/number-utils.mjs"() {
|
|
558
568
|
init_type_utils();
|
|
559
569
|
}
|
|
560
570
|
});
|
|
561
571
|
|
|
562
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
572
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs
|
|
563
573
|
var ONE_DAY_IN_MS, BucketedRateLimiter;
|
|
564
574
|
var init_bucketed_rate_limiter = __esm({
|
|
565
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
575
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs"() {
|
|
566
576
|
init_number_utils();
|
|
567
577
|
ONE_DAY_IN_MS = 864e5;
|
|
568
578
|
BucketedRateLimiter = class {
|
|
@@ -606,10 +616,10 @@ var init_bucketed_rate_limiter = __esm({
|
|
|
606
616
|
}
|
|
607
617
|
});
|
|
608
618
|
|
|
609
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
619
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs
|
|
610
620
|
var PromiseQueue;
|
|
611
621
|
var init_promise_queue = __esm({
|
|
612
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
622
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/promise-queue.mjs"() {
|
|
613
623
|
init_uuidv7();
|
|
614
624
|
PromiseQueue = class {
|
|
615
625
|
add(promise) {
|
|
@@ -640,7 +650,7 @@ var init_promise_queue = __esm({
|
|
|
640
650
|
}
|
|
641
651
|
});
|
|
642
652
|
|
|
643
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
653
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/logger.mjs
|
|
644
654
|
function createConsole(consoleLike = console) {
|
|
645
655
|
const lockedMethods = {
|
|
646
656
|
log: consoleLike.log.bind(consoleLike),
|
|
@@ -655,7 +665,7 @@ function createLogger(prefix, maybeCall = passThrough) {
|
|
|
655
665
|
}
|
|
656
666
|
var _createLogger, passThrough;
|
|
657
667
|
var init_logger = __esm({
|
|
658
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
668
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/logger.mjs"() {
|
|
659
669
|
_createLogger = (prefix, maybeCall, consoleLike) => {
|
|
660
670
|
function _log(level, ...args) {
|
|
661
671
|
maybeCall(() => {
|
|
@@ -684,10 +694,10 @@ var init_logger = __esm({
|
|
|
684
694
|
}
|
|
685
695
|
});
|
|
686
696
|
|
|
687
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
697
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs
|
|
688
698
|
var MOBILE, TABLET, GENERIC;
|
|
689
699
|
var init_user_agent_utils = __esm({
|
|
690
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
700
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs"() {
|
|
691
701
|
init_string_utils();
|
|
692
702
|
init_type_utils();
|
|
693
703
|
MOBILE = "Mobile";
|
|
@@ -698,7 +708,7 @@ var init_user_agent_utils = __esm({
|
|
|
698
708
|
}
|
|
699
709
|
});
|
|
700
710
|
|
|
701
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
711
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/index.mjs
|
|
702
712
|
function assert(truthyValue, message2) {
|
|
703
713
|
if (!truthyValue || "string" != typeof truthyValue || isEmpty(truthyValue)) throw new Error(message2);
|
|
704
714
|
}
|
|
@@ -742,7 +752,7 @@ function allSettled(promises) {
|
|
|
742
752
|
}
|
|
743
753
|
var STRING_FORMAT, isError;
|
|
744
754
|
var init_utils = __esm({
|
|
745
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
755
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/utils/index.mjs"() {
|
|
746
756
|
init_bot_detection();
|
|
747
757
|
init_bucketed_rate_limiter();
|
|
748
758
|
init_number_utils();
|
|
@@ -756,10 +766,10 @@ var init_utils = __esm({
|
|
|
756
766
|
}
|
|
757
767
|
});
|
|
758
768
|
|
|
759
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
769
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/eventemitter.mjs
|
|
760
770
|
var SimpleEventEmitter;
|
|
761
771
|
var init_eventemitter = __esm({
|
|
762
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
772
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/eventemitter.mjs"() {
|
|
763
773
|
SimpleEventEmitter = class {
|
|
764
774
|
constructor() {
|
|
765
775
|
this.events = {};
|
|
@@ -780,7 +790,7 @@ var init_eventemitter = __esm({
|
|
|
780
790
|
}
|
|
781
791
|
});
|
|
782
792
|
|
|
783
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
793
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/gzip.mjs
|
|
784
794
|
function isGzipSupported() {
|
|
785
795
|
return "CompressionStream" in globalThis;
|
|
786
796
|
}
|
|
@@ -799,11 +809,11 @@ async function gzipCompress(input, isDebug = true) {
|
|
|
799
809
|
}
|
|
800
810
|
}
|
|
801
811
|
var init_gzip = __esm({
|
|
802
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
812
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/gzip.mjs"() {
|
|
803
813
|
}
|
|
804
814
|
});
|
|
805
815
|
|
|
806
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
816
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs
|
|
807
817
|
async function logFlushError(err) {
|
|
808
818
|
if (err instanceof PostHogFetchHttpError) {
|
|
809
819
|
let text = "";
|
|
@@ -823,7 +833,7 @@ function isPostHogFetchContentTooLargeError(err) {
|
|
|
823
833
|
}
|
|
824
834
|
var PostHogFetchHttpError, PostHogFetchNetworkError, PostHogCoreStateless;
|
|
825
835
|
var init_posthog_core_stateless = __esm({
|
|
826
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
836
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/posthog-core-stateless.mjs"() {
|
|
827
837
|
init_eventemitter();
|
|
828
838
|
init_featureFlagUtils();
|
|
829
839
|
init_gzip();
|
|
@@ -879,10 +889,11 @@ var init_posthog_core_stateless = __esm({
|
|
|
879
889
|
this.disableGeoip = options.disableGeoip ?? true;
|
|
880
890
|
this.disabled = options.disabled ?? false;
|
|
881
891
|
this.historicalMigration = options?.historicalMigration ?? false;
|
|
882
|
-
this.evaluationEnvironments = options?.evaluationEnvironments;
|
|
883
892
|
this._initPromise = Promise.resolve();
|
|
884
893
|
this._isInitialized = true;
|
|
885
894
|
this._logger = createLogger("[PostHog]", this.logMsgIfDebug.bind(this));
|
|
895
|
+
this.evaluationContexts = options?.evaluationContexts ?? options?.evaluationEnvironments;
|
|
896
|
+
if (options?.evaluationEnvironments && !options?.evaluationContexts) this._logger.warn("evaluationEnvironments is deprecated. Use evaluationContexts instead. This property will be removed in a future version.");
|
|
886
897
|
this.disableCompression = !isGzipSupported() || (options?.disableCompression ?? false);
|
|
887
898
|
}
|
|
888
899
|
logMsgIfDebug(fn) {
|
|
@@ -1057,7 +1068,7 @@ var init_posthog_core_stateless = __esm({
|
|
|
1057
1068
|
group_properties: groupProperties,
|
|
1058
1069
|
...extraPayload
|
|
1059
1070
|
};
|
|
1060
|
-
if (this.
|
|
1071
|
+
if (this.evaluationContexts && this.evaluationContexts.length > 0) requestData.evaluation_contexts = this.evaluationContexts;
|
|
1061
1072
|
const fetchOptions = {
|
|
1062
1073
|
method: "POST",
|
|
1063
1074
|
headers: {
|
|
@@ -1069,10 +1080,35 @@ var init_posthog_core_stateless = __esm({
|
|
|
1069
1080
|
this._logger.info("Flags URL", url);
|
|
1070
1081
|
return this.fetchWithRetry(url, fetchOptions, {
|
|
1071
1082
|
retryCount: 0
|
|
1072
|
-
}, this.featureFlagsRequestTimeoutMs).then((response) => response.json()).then((response) =>
|
|
1083
|
+
}, this.featureFlagsRequestTimeoutMs).then((response) => response.json()).then((response) => ({
|
|
1084
|
+
success: true,
|
|
1085
|
+
response: normalizeFlagsResponse(response)
|
|
1086
|
+
})).catch((error) => {
|
|
1073
1087
|
this._events.emit("error", error);
|
|
1088
|
+
return {
|
|
1089
|
+
success: false,
|
|
1090
|
+
error: this.categorizeRequestError(error)
|
|
1091
|
+
};
|
|
1074
1092
|
});
|
|
1075
1093
|
}
|
|
1094
|
+
categorizeRequestError(error) {
|
|
1095
|
+
if (error instanceof PostHogFetchHttpError) return {
|
|
1096
|
+
type: "api_error",
|
|
1097
|
+
statusCode: error.status
|
|
1098
|
+
};
|
|
1099
|
+
if (error instanceof PostHogFetchNetworkError) {
|
|
1100
|
+
const cause = error.error;
|
|
1101
|
+
if (cause instanceof Error && ("AbortError" === cause.name || "TimeoutError" === cause.name)) return {
|
|
1102
|
+
type: "timeout"
|
|
1103
|
+
};
|
|
1104
|
+
return {
|
|
1105
|
+
type: "connection_error"
|
|
1106
|
+
};
|
|
1107
|
+
}
|
|
1108
|
+
return {
|
|
1109
|
+
type: "unknown_error"
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1076
1112
|
async getFeatureFlagStateless(key, distinctId, groups = {}, personProperties = {}, groupProperties = {}, disableGeoip) {
|
|
1077
1113
|
await this._initPromise;
|
|
1078
1114
|
const flagDetailResponse = await this.getFeatureFlagDetailStateless(key, distinctId, groups, personProperties, groupProperties, disableGeoip);
|
|
@@ -1139,8 +1175,9 @@ var init_posthog_core_stateless = __esm({
|
|
|
1139
1175
|
const extraPayload = {};
|
|
1140
1176
|
if (disableGeoip ?? this.disableGeoip) extraPayload["geoip_disable"] = true;
|
|
1141
1177
|
if (flagKeysToEvaluate) extraPayload["flag_keys_to_evaluate"] = flagKeysToEvaluate;
|
|
1142
|
-
const
|
|
1143
|
-
if (
|
|
1178
|
+
const result = await this.getFlags(distinctId, groups, personProperties, groupProperties, extraPayload);
|
|
1179
|
+
if (!result.success) return;
|
|
1180
|
+
const flagsResponse = result.response;
|
|
1144
1181
|
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");
|
|
1145
1182
|
if (flagsResponse.quotaLimited?.includes("feature_flags")) {
|
|
1146
1183
|
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");
|
|
@@ -1207,10 +1244,15 @@ var init_posthog_core_stateless = __esm({
|
|
|
1207
1244
|
this.setPersistedProperty(types_PostHogPersistedProperty.Props, this.props);
|
|
1208
1245
|
});
|
|
1209
1246
|
}
|
|
1247
|
+
processBeforeEnqueue(message2) {
|
|
1248
|
+
return message2;
|
|
1249
|
+
}
|
|
1210
1250
|
enqueue(type, _message, options) {
|
|
1211
1251
|
this.wrap(() => {
|
|
1212
1252
|
if (this.optedOut) return void this._events.emit(type, "Library is disabled. Not sending event. To re-enable, call posthog.optIn()");
|
|
1213
|
-
|
|
1253
|
+
let message2 = this.prepareMessage(type, _message, options);
|
|
1254
|
+
message2 = this.processBeforeEnqueue(message2);
|
|
1255
|
+
if (null === message2) return;
|
|
1214
1256
|
const queue = this.getPersistedProperty(types_PostHogPersistedProperty.Queue) || [];
|
|
1215
1257
|
if (queue.length >= this.maxQueueSize) {
|
|
1216
1258
|
queue.shift();
|
|
@@ -1229,10 +1271,13 @@ var init_posthog_core_stateless = __esm({
|
|
|
1229
1271
|
if (this.disabled) return void this._logger.warn("The client is disabled");
|
|
1230
1272
|
if (!this._isInitialized) await this._initPromise;
|
|
1231
1273
|
if (this.optedOut) return void this._events.emit(type, "Library is disabled. Not sending event. To re-enable, call posthog.optIn()");
|
|
1274
|
+
let message2 = this.prepareMessage(type, _message, options);
|
|
1275
|
+
message2 = this.processBeforeEnqueue(message2);
|
|
1276
|
+
if (null === message2) return;
|
|
1232
1277
|
const data = {
|
|
1233
1278
|
api_key: this.apiKey,
|
|
1234
1279
|
batch: [
|
|
1235
|
-
|
|
1280
|
+
message2
|
|
1236
1281
|
],
|
|
1237
1282
|
sent_at: currentISOTime()
|
|
1238
1283
|
};
|
|
@@ -1441,9 +1486,9 @@ var init_posthog_core_stateless = __esm({
|
|
|
1441
1486
|
}
|
|
1442
1487
|
});
|
|
1443
1488
|
|
|
1444
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1489
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/posthog-core.mjs
|
|
1445
1490
|
var init_posthog_core = __esm({
|
|
1446
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1491
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/posthog-core.mjs"() {
|
|
1447
1492
|
init_featureFlagUtils();
|
|
1448
1493
|
init_types();
|
|
1449
1494
|
init_posthog_core_stateless();
|
|
@@ -1452,7 +1497,7 @@ var init_posthog_core = __esm({
|
|
|
1452
1497
|
}
|
|
1453
1498
|
});
|
|
1454
1499
|
|
|
1455
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1500
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
|
|
1456
1501
|
function getFilenameToChunkIdMap(stackParser) {
|
|
1457
1502
|
const chunkIdMap = globalThis._posthogChunkIds;
|
|
1458
1503
|
if (!chunkIdMap) return;
|
|
@@ -1485,14 +1530,14 @@ function getFilenameToChunkIdMap(stackParser) {
|
|
|
1485
1530
|
}
|
|
1486
1531
|
var parsedStackResults, lastKeysCount, cachedFilenameChunkIds;
|
|
1487
1532
|
var init_chunk_ids = __esm({
|
|
1488
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1533
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs"() {
|
|
1489
1534
|
}
|
|
1490
1535
|
});
|
|
1491
1536
|
|
|
1492
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1537
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs
|
|
1493
1538
|
var MAX_CAUSE_RECURSION, ErrorPropertiesBuilder;
|
|
1494
1539
|
var init_error_properties_builder = __esm({
|
|
1495
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1540
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs"() {
|
|
1496
1541
|
init_utils();
|
|
1497
1542
|
init_chunk_ids();
|
|
1498
1543
|
MAX_CAUSE_RECURSION = 4;
|
|
@@ -1606,7 +1651,7 @@ var init_error_properties_builder = __esm({
|
|
|
1606
1651
|
}
|
|
1607
1652
|
});
|
|
1608
1653
|
|
|
1609
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1654
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs
|
|
1610
1655
|
function createFrame(platform, filename, func, lineno, colno) {
|
|
1611
1656
|
const frame = {
|
|
1612
1657
|
platform,
|
|
@@ -1620,16 +1665,16 @@ function createFrame(platform, filename, func, lineno, colno) {
|
|
|
1620
1665
|
}
|
|
1621
1666
|
var UNKNOWN_FUNCTION;
|
|
1622
1667
|
var init_base = __esm({
|
|
1623
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1668
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs"() {
|
|
1624
1669
|
init_utils();
|
|
1625
1670
|
UNKNOWN_FUNCTION = "?";
|
|
1626
1671
|
}
|
|
1627
1672
|
});
|
|
1628
1673
|
|
|
1629
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1674
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs
|
|
1630
1675
|
var extractSafariExtensionDetails;
|
|
1631
1676
|
var init_safari = __esm({
|
|
1632
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1677
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs"() {
|
|
1633
1678
|
init_base();
|
|
1634
1679
|
extractSafariExtensionDetails = (func, filename) => {
|
|
1635
1680
|
const isSafariExtension = -1 !== func.indexOf("safari-extension");
|
|
@@ -1645,10 +1690,10 @@ var init_safari = __esm({
|
|
|
1645
1690
|
}
|
|
1646
1691
|
});
|
|
1647
1692
|
|
|
1648
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1693
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs
|
|
1649
1694
|
var chromeRegexNoFnName, chromeRegex, chromeEvalRegex, chromeStackLineParser;
|
|
1650
1695
|
var init_chrome = __esm({
|
|
1651
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1696
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs"() {
|
|
1652
1697
|
init_base();
|
|
1653
1698
|
init_safari();
|
|
1654
1699
|
chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i;
|
|
@@ -1678,23 +1723,10 @@ var init_chrome = __esm({
|
|
|
1678
1723
|
}
|
|
1679
1724
|
});
|
|
1680
1725
|
|
|
1681
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1682
|
-
var winjsRegex, winjsStackLineParser;
|
|
1683
|
-
var init_winjs = __esm({
|
|
1684
|
-
"../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs"() {
|
|
1685
|
-
init_base();
|
|
1686
|
-
winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
1687
|
-
winjsStackLineParser = (line, platform) => {
|
|
1688
|
-
const parts = winjsRegex.exec(line);
|
|
1689
|
-
return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : void 0) : void 0;
|
|
1690
|
-
};
|
|
1691
|
-
}
|
|
1692
|
-
});
|
|
1693
|
-
|
|
1694
|
-
// ../../node_modules/.pnpm/@posthog+core@1.9.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
1726
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
1695
1727
|
var geckoREgex, geckoEvalRegex, geckoStackLineParser;
|
|
1696
1728
|
var init_gecko = __esm({
|
|
1697
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1729
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs"() {
|
|
1698
1730
|
init_base();
|
|
1699
1731
|
init_safari();
|
|
1700
1732
|
geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
@@ -1721,10 +1753,23 @@ var init_gecko = __esm({
|
|
|
1721
1753
|
}
|
|
1722
1754
|
});
|
|
1723
1755
|
|
|
1724
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1756
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
|
|
1757
|
+
var winjsRegex, winjsStackLineParser;
|
|
1758
|
+
var init_winjs = __esm({
|
|
1759
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs"() {
|
|
1760
|
+
init_base();
|
|
1761
|
+
winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
1762
|
+
winjsStackLineParser = (line, platform) => {
|
|
1763
|
+
const parts = winjsRegex.exec(line);
|
|
1764
|
+
return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : void 0) : void 0;
|
|
1765
|
+
};
|
|
1766
|
+
}
|
|
1767
|
+
});
|
|
1768
|
+
|
|
1769
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
|
|
1725
1770
|
var opera10Regex, opera10StackLineParser, opera11Regex, opera11StackLineParser;
|
|
1726
1771
|
var init_opera = __esm({
|
|
1727
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1772
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs"() {
|
|
1728
1773
|
init_base();
|
|
1729
1774
|
opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
|
|
1730
1775
|
opera10StackLineParser = (line, platform) => {
|
|
@@ -1739,7 +1784,7 @@ var init_opera = __esm({
|
|
|
1739
1784
|
}
|
|
1740
1785
|
});
|
|
1741
1786
|
|
|
1742
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1787
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
|
|
1743
1788
|
function filenameIsInApp(filename, isNative = false) {
|
|
1744
1789
|
const isInternal = isNative || filename && !filename.startsWith("/") && !filename.match(/^[A-Z]:/) && !filename.startsWith(".") && !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//);
|
|
1745
1790
|
return !isInternal && void 0 !== filename && !filename.includes("node_modules/");
|
|
@@ -1749,7 +1794,7 @@ function _parseIntOrUndefined(input) {
|
|
|
1749
1794
|
}
|
|
1750
1795
|
var FILENAME_MATCH, FULL_MATCH, nodeStackLineParser;
|
|
1751
1796
|
var init_node = __esm({
|
|
1752
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1797
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs"() {
|
|
1753
1798
|
init_base();
|
|
1754
1799
|
FILENAME_MATCH = /^\s*[-]{4,}$/;
|
|
1755
1800
|
FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
@@ -1810,7 +1855,7 @@ var init_node = __esm({
|
|
|
1810
1855
|
}
|
|
1811
1856
|
});
|
|
1812
1857
|
|
|
1813
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1858
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs
|
|
1814
1859
|
function reverseAndStripFrames(stack) {
|
|
1815
1860
|
if (!stack.length) return [];
|
|
1816
1861
|
const localStack = Array.from(stack);
|
|
@@ -1824,6 +1869,9 @@ function reverseAndStripFrames(stack) {
|
|
|
1824
1869
|
function getLastStackFrame(arr) {
|
|
1825
1870
|
return arr[arr.length - 1] || {};
|
|
1826
1871
|
}
|
|
1872
|
+
function createDefaultStackParser() {
|
|
1873
|
+
return createStackParser("web:javascript", chromeStackLineParser, geckoStackLineParser);
|
|
1874
|
+
}
|
|
1827
1875
|
function createStackParser(platform, ...parsers) {
|
|
1828
1876
|
return (stack, skipFirstLines = 0) => {
|
|
1829
1877
|
const frames = [];
|
|
@@ -1848,11 +1896,11 @@ function createStackParser(platform, ...parsers) {
|
|
|
1848
1896
|
}
|
|
1849
1897
|
var WEBPACK_ERROR_REGEXP, STACKTRACE_FRAME_LIMIT;
|
|
1850
1898
|
var init_parsers = __esm({
|
|
1851
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1899
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs"() {
|
|
1852
1900
|
init_base();
|
|
1853
1901
|
init_chrome();
|
|
1854
|
-
init_winjs();
|
|
1855
1902
|
init_gecko();
|
|
1903
|
+
init_winjs();
|
|
1856
1904
|
init_opera();
|
|
1857
1905
|
init_node();
|
|
1858
1906
|
WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
|
|
@@ -1860,10 +1908,10 @@ var init_parsers = __esm({
|
|
|
1860
1908
|
}
|
|
1861
1909
|
});
|
|
1862
1910
|
|
|
1863
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1911
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
|
|
1864
1912
|
var DOMExceptionCoercer;
|
|
1865
1913
|
var init_dom_exception_coercer = __esm({
|
|
1866
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1914
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs"() {
|
|
1867
1915
|
init_utils();
|
|
1868
1916
|
DOMExceptionCoercer = class {
|
|
1869
1917
|
match(err) {
|
|
@@ -1897,10 +1945,10 @@ var init_dom_exception_coercer = __esm({
|
|
|
1897
1945
|
}
|
|
1898
1946
|
});
|
|
1899
1947
|
|
|
1900
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1948
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
|
|
1901
1949
|
var ErrorCoercer;
|
|
1902
1950
|
var init_error_coercer = __esm({
|
|
1903
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1951
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs"() {
|
|
1904
1952
|
init_utils();
|
|
1905
1953
|
ErrorCoercer = class {
|
|
1906
1954
|
match(err) {
|
|
@@ -1930,10 +1978,10 @@ var init_error_coercer = __esm({
|
|
|
1930
1978
|
}
|
|
1931
1979
|
});
|
|
1932
1980
|
|
|
1933
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
1981
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
|
|
1934
1982
|
var ErrorEventCoercer;
|
|
1935
1983
|
var init_error_event_coercer = __esm({
|
|
1936
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
1984
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs"() {
|
|
1937
1985
|
init_utils();
|
|
1938
1986
|
ErrorEventCoercer = class {
|
|
1939
1987
|
constructor() {
|
|
@@ -1955,10 +2003,10 @@ var init_error_event_coercer = __esm({
|
|
|
1955
2003
|
}
|
|
1956
2004
|
});
|
|
1957
2005
|
|
|
1958
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2006
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
|
|
1959
2007
|
var ERROR_TYPES_PATTERN, StringCoercer;
|
|
1960
2008
|
var init_string_coercer = __esm({
|
|
1961
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2009
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs"() {
|
|
1962
2010
|
ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
|
|
1963
2011
|
StringCoercer = class {
|
|
1964
2012
|
match(input) {
|
|
@@ -1990,10 +2038,10 @@ var init_string_coercer = __esm({
|
|
|
1990
2038
|
}
|
|
1991
2039
|
});
|
|
1992
2040
|
|
|
1993
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2041
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/types.mjs
|
|
1994
2042
|
var severityLevels;
|
|
1995
2043
|
var init_types2 = __esm({
|
|
1996
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2044
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/types.mjs"() {
|
|
1997
2045
|
severityLevels = [
|
|
1998
2046
|
"fatal",
|
|
1999
2047
|
"error",
|
|
@@ -2005,7 +2053,7 @@ var init_types2 = __esm({
|
|
|
2005
2053
|
}
|
|
2006
2054
|
});
|
|
2007
2055
|
|
|
2008
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2056
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs
|
|
2009
2057
|
function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
2010
2058
|
const keys = Object.keys(err);
|
|
2011
2059
|
keys.sort();
|
|
@@ -2020,14 +2068,14 @@ function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
|
2020
2068
|
return "";
|
|
2021
2069
|
}
|
|
2022
2070
|
var init_utils2 = __esm({
|
|
2023
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2071
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs"() {
|
|
2024
2072
|
}
|
|
2025
2073
|
});
|
|
2026
2074
|
|
|
2027
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2075
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs
|
|
2028
2076
|
var ObjectCoercer;
|
|
2029
2077
|
var init_object_coercer = __esm({
|
|
2030
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2078
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs"() {
|
|
2031
2079
|
init_utils();
|
|
2032
2080
|
init_types2();
|
|
2033
2081
|
init_utils2();
|
|
@@ -2081,10 +2129,10 @@ var init_object_coercer = __esm({
|
|
|
2081
2129
|
}
|
|
2082
2130
|
});
|
|
2083
2131
|
|
|
2084
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2132
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs
|
|
2085
2133
|
var EventCoercer;
|
|
2086
2134
|
var init_event_coercer = __esm({
|
|
2087
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2135
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs"() {
|
|
2088
2136
|
init_utils();
|
|
2089
2137
|
init_utils2();
|
|
2090
2138
|
EventCoercer = class {
|
|
@@ -2104,10 +2152,10 @@ var init_event_coercer = __esm({
|
|
|
2104
2152
|
}
|
|
2105
2153
|
});
|
|
2106
2154
|
|
|
2107
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2155
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs
|
|
2108
2156
|
var PrimitiveCoercer;
|
|
2109
2157
|
var init_primitive_coercer = __esm({
|
|
2110
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2158
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs"() {
|
|
2111
2159
|
init_utils();
|
|
2112
2160
|
PrimitiveCoercer = class {
|
|
2113
2161
|
match(candidate) {
|
|
@@ -2125,10 +2173,10 @@ var init_primitive_coercer = __esm({
|
|
|
2125
2173
|
}
|
|
2126
2174
|
});
|
|
2127
2175
|
|
|
2128
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2176
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
|
|
2129
2177
|
var PromiseRejectionEventCoercer;
|
|
2130
2178
|
var init_promise_rejection_event = __esm({
|
|
2131
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2179
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs"() {
|
|
2132
2180
|
init_utils();
|
|
2133
2181
|
PromiseRejectionEventCoercer = class {
|
|
2134
2182
|
match(err) {
|
|
@@ -2157,9 +2205,9 @@ var init_promise_rejection_event = __esm({
|
|
|
2157
2205
|
}
|
|
2158
2206
|
});
|
|
2159
2207
|
|
|
2160
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2208
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs
|
|
2161
2209
|
var init_coercers = __esm({
|
|
2162
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2210
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/coercers/index.mjs"() {
|
|
2163
2211
|
init_dom_exception_coercer();
|
|
2164
2212
|
init_error_coercer();
|
|
2165
2213
|
init_error_event_coercer();
|
|
@@ -2171,10 +2219,10 @@ var init_coercers = __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/utils.mjs
|
|
2175
2223
|
var ReduceableCache;
|
|
2176
2224
|
var init_utils3 = __esm({
|
|
2177
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2225
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/utils.mjs"() {
|
|
2178
2226
|
ReduceableCache = class {
|
|
2179
2227
|
constructor(_maxSize) {
|
|
2180
2228
|
this._maxSize = _maxSize;
|
|
@@ -2200,7 +2248,7 @@ var init_utils3 = __esm({
|
|
|
2200
2248
|
}
|
|
2201
2249
|
});
|
|
2202
2250
|
|
|
2203
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2251
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/index.mjs
|
|
2204
2252
|
var error_tracking_exports = {};
|
|
2205
2253
|
__export(error_tracking_exports, {
|
|
2206
2254
|
DOMExceptionCoercer: () => DOMExceptionCoercer,
|
|
@@ -2214,6 +2262,7 @@ __export(error_tracking_exports, {
|
|
|
2214
2262
|
ReduceableCache: () => ReduceableCache,
|
|
2215
2263
|
StringCoercer: () => StringCoercer,
|
|
2216
2264
|
chromeStackLineParser: () => chromeStackLineParser,
|
|
2265
|
+
createDefaultStackParser: () => createDefaultStackParser,
|
|
2217
2266
|
createStackParser: () => createStackParser,
|
|
2218
2267
|
geckoStackLineParser: () => geckoStackLineParser,
|
|
2219
2268
|
nodeStackLineParser: () => nodeStackLineParser,
|
|
@@ -2223,7 +2272,7 @@ __export(error_tracking_exports, {
|
|
|
2223
2272
|
winjsStackLineParser: () => winjsStackLineParser
|
|
2224
2273
|
});
|
|
2225
2274
|
var init_error_tracking = __esm({
|
|
2226
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2275
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/error-tracking/index.mjs"() {
|
|
2227
2276
|
init_error_properties_builder();
|
|
2228
2277
|
init_parsers();
|
|
2229
2278
|
init_coercers();
|
|
@@ -2231,9 +2280,9 @@ var init_error_tracking = __esm({
|
|
|
2231
2280
|
}
|
|
2232
2281
|
});
|
|
2233
2282
|
|
|
2234
|
-
// ../../node_modules/.pnpm/@posthog+core@1.
|
|
2283
|
+
// ../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/index.mjs
|
|
2235
2284
|
var init_dist = __esm({
|
|
2236
|
-
"../../node_modules/.pnpm/@posthog+core@1.
|
|
2285
|
+
"../../node_modules/.pnpm/@posthog+core@1.13.0/node_modules/@posthog/core/dist/index.mjs"() {
|
|
2237
2286
|
init_featureFlagUtils();
|
|
2238
2287
|
init_uuidv7();
|
|
2239
2288
|
init_utils();
|
|
@@ -2424,7 +2473,7 @@ function snipLine(line, colno) {
|
|
|
2424
2473
|
}
|
|
2425
2474
|
var LRU_FILE_CONTENTS_CACHE, LRU_FILE_CONTENTS_FS_READ_FAILED, DEFAULT_LINES_OF_CONTEXT, MAX_CONTEXTLINES_COLNO, MAX_CONTEXTLINES_LINENO;
|
|
2426
2475
|
var init_context_lines_node = __esm({
|
|
2427
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2476
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs"() {
|
|
2428
2477
|
init_dist();
|
|
2429
2478
|
LRU_FILE_CONTENTS_CACHE = new error_tracking_exports.ReduceableCache(25);
|
|
2430
2479
|
LRU_FILE_CONTENTS_FS_READ_FAILED = new error_tracking_exports.ReduceableCache(20);
|
|
@@ -2434,7 +2483,7 @@ var init_context_lines_node = __esm({
|
|
|
2434
2483
|
}
|
|
2435
2484
|
});
|
|
2436
2485
|
|
|
2437
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2486
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs
|
|
2438
2487
|
function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
|
|
2439
2488
|
let calledFatalError = false;
|
|
2440
2489
|
return Object.assign((error) => {
|
|
@@ -2466,14 +2515,14 @@ function addUnhandledRejectionListener(captureFn) {
|
|
|
2466
2515
|
}));
|
|
2467
2516
|
}
|
|
2468
2517
|
var init_autocapture = __esm({
|
|
2469
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2518
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs"() {
|
|
2470
2519
|
}
|
|
2471
2520
|
});
|
|
2472
2521
|
|
|
2473
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2522
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs
|
|
2474
2523
|
var SHUTDOWN_TIMEOUT, ErrorTracking;
|
|
2475
2524
|
var init_error_tracking2 = __esm({
|
|
2476
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2525
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs"() {
|
|
2477
2526
|
init_autocapture();
|
|
2478
2527
|
init_dist();
|
|
2479
2528
|
SHUTDOWN_TIMEOUT = 2e3;
|
|
@@ -2490,6 +2539,9 @@ var init_error_tracking2 = __esm({
|
|
|
2490
2539
|
});
|
|
2491
2540
|
this.startAutocaptureIfEnabled();
|
|
2492
2541
|
}
|
|
2542
|
+
static isPreviouslyCapturedError(x) {
|
|
2543
|
+
return isObject(x) && "__posthog_previously_captured_error" in x && true === x.__posthog_previously_captured_error;
|
|
2544
|
+
}
|
|
2493
2545
|
static async buildEventMessage(error, hint, distinctId, additionalProperties) {
|
|
2494
2546
|
const properties = {
|
|
2495
2547
|
...additionalProperties
|
|
@@ -2514,14 +2566,16 @@ var init_error_tracking2 = __esm({
|
|
|
2514
2566
|
}
|
|
2515
2567
|
onException(exception, hint) {
|
|
2516
2568
|
this.client.addPendingPromise((async () => {
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
exception
|
|
2523
|
-
|
|
2524
|
-
|
|
2569
|
+
if (!_ErrorTracking.isPreviouslyCapturedError(exception)) {
|
|
2570
|
+
const eventMessage = await _ErrorTracking.buildEventMessage(exception, hint);
|
|
2571
|
+
const exceptionProperties = eventMessage.properties;
|
|
2572
|
+
const exceptionType = exceptionProperties?.$exception_list[0]?.type ?? "Exception";
|
|
2573
|
+
const isRateLimited = this._rateLimiter.consumeRateLimit(exceptionType);
|
|
2574
|
+
if (isRateLimited) return void this._logger.info("Skipping exception capture because of client rate limiting.", {
|
|
2575
|
+
exception: exceptionType
|
|
2576
|
+
});
|
|
2577
|
+
return this.client.capture(eventMessage);
|
|
2578
|
+
}
|
|
2525
2579
|
})());
|
|
2526
2580
|
}
|
|
2527
2581
|
async onFatalError(exception) {
|
|
@@ -2539,19 +2593,19 @@ var init_error_tracking2 = __esm({
|
|
|
2539
2593
|
}
|
|
2540
2594
|
});
|
|
2541
2595
|
|
|
2542
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2596
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/version.mjs
|
|
2543
2597
|
var version;
|
|
2544
2598
|
var init_version = __esm({
|
|
2545
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2546
|
-
version = "5.
|
|
2599
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/version.mjs"() {
|
|
2600
|
+
version = "5.24.1";
|
|
2547
2601
|
}
|
|
2548
2602
|
});
|
|
2549
2603
|
|
|
2550
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2551
|
-
var
|
|
2604
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/types.mjs
|
|
2605
|
+
var FeatureFlagError2;
|
|
2552
2606
|
var init_types3 = __esm({
|
|
2553
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2554
|
-
|
|
2607
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/types.mjs"() {
|
|
2608
|
+
FeatureFlagError2 = {
|
|
2555
2609
|
ERRORS_WHILE_COMPUTING: "errors_while_computing_flags",
|
|
2556
2610
|
FLAG_MISSING: "flag_missing",
|
|
2557
2611
|
QUOTA_LIMITED: "quota_limited",
|
|
@@ -2560,7 +2614,7 @@ var init_types3 = __esm({
|
|
|
2560
2614
|
}
|
|
2561
2615
|
});
|
|
2562
2616
|
|
|
2563
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2617
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs
|
|
2564
2618
|
async function hashSHA1(text) {
|
|
2565
2619
|
const subtle = globalThis.crypto?.subtle;
|
|
2566
2620
|
if (!subtle) throw new Error("SubtleCrypto API not available");
|
|
@@ -2569,11 +2623,11 @@ async function hashSHA1(text) {
|
|
|
2569
2623
|
return hashArray.map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2570
2624
|
}
|
|
2571
2625
|
var init_crypto = __esm({
|
|
2572
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2626
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs"() {
|
|
2573
2627
|
}
|
|
2574
2628
|
});
|
|
2575
2629
|
|
|
2576
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
2630
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs
|
|
2577
2631
|
async function _hash(key, distinctId, salt = "") {
|
|
2578
2632
|
const hashString = await hashSHA1(`${key}.${distinctId}${salt}`);
|
|
2579
2633
|
return parseInt(hashString.slice(0, 15), 16) / LONG_SCALE;
|
|
@@ -2741,7 +2795,7 @@ function relativeDateParseForFeatureFlagMatching(value) {
|
|
|
2741
2795
|
}
|
|
2742
2796
|
var SIXTY_SECONDS, LONG_SCALE, NULL_VALUES_ALLOWED_OPERATORS, ClientError, InconclusiveMatchError, RequiresServerEvaluation, FeatureFlagsPoller;
|
|
2743
2797
|
var init_feature_flags = __esm({
|
|
2744
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
2798
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs"() {
|
|
2745
2799
|
init_dist();
|
|
2746
2800
|
init_crypto();
|
|
2747
2801
|
SIXTY_SECONDS = 6e4;
|
|
@@ -2795,6 +2849,7 @@ var init_feature_flags = __esm({
|
|
|
2795
2849
|
this.customHeaders = customHeaders;
|
|
2796
2850
|
this.onLoad = options.onLoad;
|
|
2797
2851
|
this.cacheProvider = options.cacheProvider;
|
|
2852
|
+
this.strictLocalEvaluation = options.strictLocalEvaluation ?? false;
|
|
2798
2853
|
this.loadFeatureFlags();
|
|
2799
2854
|
}
|
|
2800
2855
|
debug(enabled = true) {
|
|
@@ -2990,6 +3045,11 @@ var init_feature_flags = __esm({
|
|
|
2990
3045
|
this.cohorts = flagData.cohorts;
|
|
2991
3046
|
this.loadedSuccessfullyOnce = true;
|
|
2992
3047
|
}
|
|
3048
|
+
warnAboutExperienceContinuityFlags(flags) {
|
|
3049
|
+
if (this.strictLocalEvaluation) return;
|
|
3050
|
+
const experienceContinuityFlags = flags.filter((f) => f.ensure_experience_continuity);
|
|
3051
|
+
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).`);
|
|
3052
|
+
}
|
|
2993
3053
|
async loadFromCache(debugMessage) {
|
|
2994
3054
|
if (!this.cacheProvider) return false;
|
|
2995
3055
|
try {
|
|
@@ -2998,6 +3058,7 @@ var init_feature_flags = __esm({
|
|
|
2998
3058
|
this.updateFlagState(cached);
|
|
2999
3059
|
this.logMsgIfDebug(() => console.debug(`[FEATURE FLAGS] ${debugMessage} (${cached.flags.length} flags)`));
|
|
3000
3060
|
this.onLoad?.(this.featureFlags.length);
|
|
3061
|
+
this.warnAboutExperienceContinuityFlags(cached.flags);
|
|
3001
3062
|
return true;
|
|
3002
3063
|
}
|
|
3003
3064
|
return false;
|
|
@@ -3091,6 +3152,7 @@ var init_feature_flags = __esm({
|
|
|
3091
3152
|
this.onError?.(new Error(`Failed to store in cache: ${err}`));
|
|
3092
3153
|
}
|
|
3093
3154
|
this.onLoad?.(this.featureFlags.length);
|
|
3155
|
+
this.warnAboutExperienceContinuityFlags(flagData.flags);
|
|
3094
3156
|
break;
|
|
3095
3157
|
}
|
|
3096
3158
|
default:
|
|
@@ -3146,10 +3208,10 @@ var init_feature_flags = __esm({
|
|
|
3146
3208
|
}
|
|
3147
3209
|
});
|
|
3148
3210
|
|
|
3149
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3211
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/storage-memory.mjs
|
|
3150
3212
|
var PostHogMemoryStorage;
|
|
3151
3213
|
var init_storage_memory = __esm({
|
|
3152
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3214
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/storage-memory.mjs"() {
|
|
3153
3215
|
PostHogMemoryStorage = class {
|
|
3154
3216
|
getProperty(key) {
|
|
3155
3217
|
return this._memoryStorage[key];
|
|
@@ -3164,10 +3226,10 @@ var init_storage_memory = __esm({
|
|
|
3164
3226
|
}
|
|
3165
3227
|
});
|
|
3166
3228
|
|
|
3167
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3229
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/client.mjs
|
|
3168
3230
|
var MINIMUM_POLLING_INTERVAL, THIRTY_SECONDS, MAX_CACHE_SIZE, PostHogBackendClient;
|
|
3169
3231
|
var init_client = __esm({
|
|
3170
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3232
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/client.mjs"() {
|
|
3171
3233
|
init_version();
|
|
3172
3234
|
init_dist();
|
|
3173
3235
|
init_types3();
|
|
@@ -3200,7 +3262,8 @@ var init_client = __esm({
|
|
|
3200
3262
|
this._events.emit("localEvaluationFlagsLoaded", count);
|
|
3201
3263
|
},
|
|
3202
3264
|
customHeaders: this.getCustomHeaders(),
|
|
3203
|
-
cacheProvider: options.flagDefinitionCacheProvider
|
|
3265
|
+
cacheProvider: options.flagDefinitionCacheProvider,
|
|
3266
|
+
strictLocalEvaluation: options.strictLocalEvaluation
|
|
3204
3267
|
});
|
|
3205
3268
|
}
|
|
3206
3269
|
this.errorTracking = new ErrorTracking(this, options, this._logger);
|
|
@@ -3306,94 +3369,148 @@ var init_client = __esm({
|
|
|
3306
3369
|
});
|
|
3307
3370
|
});
|
|
3308
3371
|
}
|
|
3309
|
-
async
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3372
|
+
async _getFeatureFlagResult(key, distinctId, options = {}, matchValue) {
|
|
3373
|
+
const sendFeatureFlagEvents = options.sendFeatureFlagEvents ?? true;
|
|
3374
|
+
if (void 0 !== this._flagOverrides && key in this._flagOverrides) {
|
|
3375
|
+
const overrideValue = this._flagOverrides[key];
|
|
3376
|
+
if (void 0 === overrideValue) return;
|
|
3377
|
+
const overridePayload = this._payloadOverrides?.[key];
|
|
3378
|
+
return {
|
|
3379
|
+
key,
|
|
3380
|
+
enabled: false !== overrideValue,
|
|
3381
|
+
variant: "string" == typeof overrideValue ? overrideValue : void 0,
|
|
3382
|
+
payload: overridePayload
|
|
3383
|
+
};
|
|
3384
|
+
}
|
|
3385
|
+
const { groups, disableGeoip } = options;
|
|
3386
|
+
let { onlyEvaluateLocally, personProperties, groupProperties } = options;
|
|
3313
3387
|
const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);
|
|
3314
3388
|
personProperties = adjustedProperties.allPersonProperties;
|
|
3315
3389
|
groupProperties = adjustedProperties.allGroupProperties;
|
|
3316
|
-
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = false;
|
|
3317
|
-
|
|
3318
|
-
let
|
|
3319
|
-
const flagWasLocallyEvaluated = void 0 !== response;
|
|
3390
|
+
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
|
|
3391
|
+
let result;
|
|
3392
|
+
let flagWasLocallyEvaluated = false;
|
|
3320
3393
|
let requestId;
|
|
3321
3394
|
let evaluatedAt;
|
|
3322
|
-
let flagDetail;
|
|
3323
3395
|
let featureFlagError;
|
|
3396
|
+
let flagId;
|
|
3397
|
+
let flagVersion;
|
|
3398
|
+
let flagReason;
|
|
3399
|
+
const localEvaluationEnabled = void 0 !== this.featureFlagsPoller;
|
|
3400
|
+
if (localEvaluationEnabled) {
|
|
3401
|
+
await this.featureFlagsPoller?.loadFeatureFlags();
|
|
3402
|
+
const flag = this.featureFlagsPoller?.featureFlagsByKey[key];
|
|
3403
|
+
if (flag) try {
|
|
3404
|
+
const localResult = await this.featureFlagsPoller?.computeFlagAndPayloadLocally(flag, distinctId, groups, personProperties, groupProperties, matchValue);
|
|
3405
|
+
if (localResult) {
|
|
3406
|
+
flagWasLocallyEvaluated = true;
|
|
3407
|
+
const value = localResult.value;
|
|
3408
|
+
flagId = flag.id;
|
|
3409
|
+
flagReason = "Evaluated locally";
|
|
3410
|
+
result = {
|
|
3411
|
+
key,
|
|
3412
|
+
enabled: false !== value,
|
|
3413
|
+
variant: "string" == typeof value ? value : void 0,
|
|
3414
|
+
payload: localResult.payload ?? void 0
|
|
3415
|
+
};
|
|
3416
|
+
}
|
|
3417
|
+
} catch (e) {
|
|
3418
|
+
if (e instanceof RequiresServerEvaluation || e instanceof InconclusiveMatchError) this._logger?.info(`${e.name} when computing flag locally: ${key}: ${e.message}`);
|
|
3419
|
+
else throw e;
|
|
3420
|
+
}
|
|
3421
|
+
}
|
|
3324
3422
|
if (!flagWasLocallyEvaluated && !onlyEvaluateLocally) {
|
|
3325
3423
|
const flagsResponse = await super.getFeatureFlagDetailsStateless(distinctId, groups, personProperties, groupProperties, disableGeoip, [
|
|
3326
3424
|
key
|
|
3327
3425
|
]);
|
|
3328
|
-
if (void 0 === flagsResponse) featureFlagError =
|
|
3426
|
+
if (void 0 === flagsResponse) featureFlagError = FeatureFlagError2.UNKNOWN_ERROR;
|
|
3329
3427
|
else {
|
|
3330
3428
|
requestId = flagsResponse.requestId;
|
|
3331
3429
|
evaluatedAt = flagsResponse.evaluatedAt;
|
|
3332
3430
|
const errors = [];
|
|
3333
|
-
if (flagsResponse.errorsWhileComputingFlags) errors.push(
|
|
3334
|
-
if (flagsResponse.quotaLimited?.includes("feature_flags")) errors.push(
|
|
3335
|
-
flagDetail = flagsResponse.flags[key];
|
|
3336
|
-
if (void 0 === flagDetail) errors.push(
|
|
3431
|
+
if (flagsResponse.errorsWhileComputingFlags) errors.push(FeatureFlagError2.ERRORS_WHILE_COMPUTING);
|
|
3432
|
+
if (flagsResponse.quotaLimited?.includes("feature_flags")) errors.push(FeatureFlagError2.QUOTA_LIMITED);
|
|
3433
|
+
const flagDetail = flagsResponse.flags[key];
|
|
3434
|
+
if (void 0 === flagDetail) errors.push(FeatureFlagError2.FLAG_MISSING);
|
|
3435
|
+
else {
|
|
3436
|
+
flagId = flagDetail.metadata?.id;
|
|
3437
|
+
flagVersion = flagDetail.metadata?.version;
|
|
3438
|
+
flagReason = flagDetail.reason?.description ?? flagDetail.reason?.code;
|
|
3439
|
+
let parsedPayload;
|
|
3440
|
+
if (flagDetail.metadata?.payload !== void 0) try {
|
|
3441
|
+
parsedPayload = JSON.parse(flagDetail.metadata.payload);
|
|
3442
|
+
} catch {
|
|
3443
|
+
parsedPayload = flagDetail.metadata.payload;
|
|
3444
|
+
}
|
|
3445
|
+
result = {
|
|
3446
|
+
key,
|
|
3447
|
+
enabled: flagDetail.enabled,
|
|
3448
|
+
variant: flagDetail.variant,
|
|
3449
|
+
payload: parsedPayload
|
|
3450
|
+
};
|
|
3451
|
+
}
|
|
3337
3452
|
if (errors.length > 0) featureFlagError = errors.join(",");
|
|
3338
|
-
response = getFeatureFlagValue(flagDetail);
|
|
3339
3453
|
}
|
|
3340
3454
|
}
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
if (
|
|
3345
|
-
|
|
3346
|
-
featureFlagReportedKey
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3455
|
+
if (sendFeatureFlagEvents) {
|
|
3456
|
+
const response = void 0 === result ? void 0 : false === result.enabled ? false : result.variant ?? true;
|
|
3457
|
+
const featureFlagReportedKey = `${key}_${response}`;
|
|
3458
|
+
if (!(distinctId in this.distinctIdHasSentFlagCalls) || !this.distinctIdHasSentFlagCalls[distinctId].includes(featureFlagReportedKey)) {
|
|
3459
|
+
if (Object.keys(this.distinctIdHasSentFlagCalls).length >= this.maxCacheSize) this.distinctIdHasSentFlagCalls = {};
|
|
3460
|
+
if (Array.isArray(this.distinctIdHasSentFlagCalls[distinctId])) this.distinctIdHasSentFlagCalls[distinctId].push(featureFlagReportedKey);
|
|
3461
|
+
else this.distinctIdHasSentFlagCalls[distinctId] = [
|
|
3462
|
+
featureFlagReportedKey
|
|
3463
|
+
];
|
|
3464
|
+
const properties = {
|
|
3465
|
+
$feature_flag: key,
|
|
3466
|
+
$feature_flag_response: response,
|
|
3467
|
+
$feature_flag_id: flagId,
|
|
3468
|
+
$feature_flag_version: flagVersion,
|
|
3469
|
+
$feature_flag_reason: flagReason,
|
|
3470
|
+
locally_evaluated: flagWasLocallyEvaluated,
|
|
3471
|
+
[`$feature/${key}`]: response,
|
|
3472
|
+
$feature_flag_request_id: requestId,
|
|
3473
|
+
$feature_flag_evaluated_at: evaluatedAt
|
|
3474
|
+
};
|
|
3475
|
+
if (featureFlagError) properties.$feature_flag_error = featureFlagError;
|
|
3476
|
+
this.capture({
|
|
3477
|
+
distinctId,
|
|
3478
|
+
event: "$feature_flag_called",
|
|
3479
|
+
properties,
|
|
3480
|
+
groups,
|
|
3481
|
+
disableGeoip
|
|
3482
|
+
});
|
|
3483
|
+
}
|
|
3367
3484
|
}
|
|
3368
|
-
|
|
3485
|
+
if (void 0 !== result && void 0 !== this._payloadOverrides && key in this._payloadOverrides) result = {
|
|
3486
|
+
...result,
|
|
3487
|
+
payload: this._payloadOverrides[key]
|
|
3488
|
+
};
|
|
3489
|
+
return result;
|
|
3490
|
+
}
|
|
3491
|
+
async getFeatureFlag(key, distinctId, options) {
|
|
3492
|
+
const result = await this._getFeatureFlagResult(key, distinctId, {
|
|
3493
|
+
...options,
|
|
3494
|
+
sendFeatureFlagEvents: options?.sendFeatureFlagEvents ?? this.options.sendFeatureFlagEvent ?? true
|
|
3495
|
+
});
|
|
3496
|
+
if (void 0 === result) return;
|
|
3497
|
+
if (false === result.enabled) return false;
|
|
3498
|
+
return result.variant ?? true;
|
|
3369
3499
|
}
|
|
3370
3500
|
async getFeatureFlagPayload(key, distinctId, matchValue, options) {
|
|
3371
3501
|
if (void 0 !== this._payloadOverrides && key in this._payloadOverrides) return this._payloadOverrides[key];
|
|
3372
|
-
const
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
if (result) {
|
|
3385
|
-
matchValue = result.value;
|
|
3386
|
-
response = result.payload;
|
|
3387
|
-
}
|
|
3388
|
-
} catch (e) {
|
|
3389
|
-
if (e instanceof RequiresServerEvaluation || e instanceof InconclusiveMatchError) this._logger?.info(`${e.name} when computing flag locally: ${flag.key}: ${e.message}`);
|
|
3390
|
-
else throw e;
|
|
3391
|
-
}
|
|
3392
|
-
}
|
|
3393
|
-
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = false;
|
|
3394
|
-
const payloadWasLocallyEvaluated = void 0 !== response;
|
|
3395
|
-
if (!payloadWasLocallyEvaluated && !onlyEvaluateLocally) response = await super.getFeatureFlagPayloadStateless(key, distinctId, groups, personProperties, groupProperties, disableGeoip);
|
|
3396
|
-
return response;
|
|
3502
|
+
const result = await this._getFeatureFlagResult(key, distinctId, {
|
|
3503
|
+
...options,
|
|
3504
|
+
sendFeatureFlagEvents: false
|
|
3505
|
+
}, matchValue);
|
|
3506
|
+
if (void 0 === result) return;
|
|
3507
|
+
return result.payload ?? null;
|
|
3508
|
+
}
|
|
3509
|
+
async getFeatureFlagResult(key, distinctId, options) {
|
|
3510
|
+
return this._getFeatureFlagResult(key, distinctId, {
|
|
3511
|
+
...options,
|
|
3512
|
+
sendFeatureFlagEvents: options?.sendFeatureFlagEvents ?? this.options.sendFeatureFlagEvent ?? true
|
|
3513
|
+
});
|
|
3397
3514
|
}
|
|
3398
3515
|
async getRemoteConfigPayload(flagKey) {
|
|
3399
3516
|
if (!this.options.personalApiKey) throw new Error("Personal API key is required for remote config payload decryption");
|
|
@@ -3421,7 +3538,7 @@ var init_client = __esm({
|
|
|
3421
3538
|
const adjustedProperties = this.addLocalPersonAndGroupProperties(distinctId, groups, personProperties, groupProperties);
|
|
3422
3539
|
personProperties = adjustedProperties.allPersonProperties;
|
|
3423
3540
|
groupProperties = adjustedProperties.allGroupProperties;
|
|
3424
|
-
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = false;
|
|
3541
|
+
if (void 0 == onlyEvaluateLocally) onlyEvaluateLocally = this.options.strictLocalEvaluation ?? false;
|
|
3425
3542
|
const localEvaluationResult = await this.featureFlagsPoller?.getAllFlagsAndPayloads(distinctId, groups, personProperties, groupProperties, flagKeys);
|
|
3426
3543
|
let featureFlags = {};
|
|
3427
3544
|
let featureFlagPayloads = {};
|
|
@@ -3571,7 +3688,7 @@ var init_client = __esm({
|
|
|
3571
3688
|
const finalPersonProperties = sendFeatureFlagsOptions?.personProperties || {};
|
|
3572
3689
|
const finalGroupProperties = sendFeatureFlagsOptions?.groupProperties || {};
|
|
3573
3690
|
const flagKeys = sendFeatureFlagsOptions?.flagKeys;
|
|
3574
|
-
const onlyEvaluateLocally = sendFeatureFlagsOptions?.onlyEvaluateLocally ?? false;
|
|
3691
|
+
const onlyEvaluateLocally = sendFeatureFlagsOptions?.onlyEvaluateLocally ?? this.options.strictLocalEvaluation ?? false;
|
|
3575
3692
|
if (onlyEvaluateLocally) if (!((this.featureFlagsPoller?.featureFlags?.length || 0) > 0)) return {};
|
|
3576
3693
|
else {
|
|
3577
3694
|
const groupsWithStringValues = {};
|
|
@@ -3614,17 +3731,24 @@ var init_client = __esm({
|
|
|
3614
3731
|
allGroupProperties
|
|
3615
3732
|
};
|
|
3616
3733
|
}
|
|
3617
|
-
captureException(error, distinctId, additionalProperties) {
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3734
|
+
captureException(error, distinctId, additionalProperties, uuid) {
|
|
3735
|
+
if (!ErrorTracking.isPreviouslyCapturedError(error)) {
|
|
3736
|
+
const syntheticException = new Error("PostHog syntheticException");
|
|
3737
|
+
this.addPendingPromise(ErrorTracking.buildEventMessage(error, {
|
|
3738
|
+
syntheticException
|
|
3739
|
+
}, distinctId, additionalProperties).then((msg) => this.capture({
|
|
3740
|
+
...msg,
|
|
3741
|
+
uuid
|
|
3742
|
+
})));
|
|
3743
|
+
}
|
|
3622
3744
|
}
|
|
3623
3745
|
async captureExceptionImmediate(error, distinctId, additionalProperties) {
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3746
|
+
if (!ErrorTracking.isPreviouslyCapturedError(error)) {
|
|
3747
|
+
const syntheticException = new Error("PostHog syntheticException");
|
|
3748
|
+
this.addPendingPromise(ErrorTracking.buildEventMessage(error, {
|
|
3749
|
+
syntheticException
|
|
3750
|
+
}, distinctId, additionalProperties).then((msg) => this.captureImmediate(msg)));
|
|
3751
|
+
}
|
|
3628
3752
|
}
|
|
3629
3753
|
async prepareEventMessage(props) {
|
|
3630
3754
|
const { distinctId, event, properties, groups, sendFeatureFlags, timestamp, disableGeoip, uuid } = props;
|
|
@@ -3713,7 +3837,7 @@ var init_client = __esm({
|
|
|
3713
3837
|
});
|
|
3714
3838
|
var PostHogContext;
|
|
3715
3839
|
var init_context = __esm({
|
|
3716
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3840
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/context/context.mjs"() {
|
|
3717
3841
|
PostHogContext = class {
|
|
3718
3842
|
constructor() {
|
|
3719
3843
|
this.storage = new async_hooks.AsyncLocalStorage();
|
|
@@ -3741,7 +3865,7 @@ var init_context = __esm({
|
|
|
3741
3865
|
}
|
|
3742
3866
|
});
|
|
3743
3867
|
|
|
3744
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3868
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/sentry-integration.mjs
|
|
3745
3869
|
function createEventProcessor(_posthog, { organization, projectId, prefix, severityAllowList = [
|
|
3746
3870
|
"error"
|
|
3747
3871
|
], sendExceptionsToPostHog = true } = {}) {
|
|
@@ -3797,7 +3921,7 @@ function sentryIntegration(_posthog, options) {
|
|
|
3797
3921
|
}
|
|
3798
3922
|
var NAME, PostHogSentryIntegration;
|
|
3799
3923
|
var init_sentry_integration = __esm({
|
|
3800
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3924
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/sentry-integration.mjs"() {
|
|
3801
3925
|
NAME = "posthog-node";
|
|
3802
3926
|
PostHogSentryIntegration = class {
|
|
3803
3927
|
static #_ = this.POSTHOG_ID_TAG = "posthog_distinct_id";
|
|
@@ -3819,12 +3943,13 @@ var init_sentry_integration = __esm({
|
|
|
3819
3943
|
}
|
|
3820
3944
|
});
|
|
3821
3945
|
|
|
3822
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3946
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/express.mjs
|
|
3823
3947
|
function setupExpressErrorHandler(_posthog, app) {
|
|
3824
3948
|
app.use(posthogErrorHandler(_posthog));
|
|
3825
3949
|
}
|
|
3826
3950
|
function posthogErrorHandler(posthog) {
|
|
3827
3951
|
return (error, req, res, next) => {
|
|
3952
|
+
if (ErrorTracking.isPreviouslyCapturedError(error)) return void next(error);
|
|
3828
3953
|
const sessionId = req.headers["x-posthog-session-id"];
|
|
3829
3954
|
const distinctId = req.headers["x-posthog-distinct-id"];
|
|
3830
3955
|
const syntheticException = new Error("Synthetic exception");
|
|
@@ -3850,21 +3975,22 @@ function posthogErrorHandler(posthog) {
|
|
|
3850
3975
|
};
|
|
3851
3976
|
}
|
|
3852
3977
|
var init_express = __esm({
|
|
3853
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3978
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/extensions/express.mjs"() {
|
|
3854
3979
|
init_error_tracking2();
|
|
3855
3980
|
}
|
|
3856
3981
|
});
|
|
3857
3982
|
|
|
3858
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3983
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/exports.mjs
|
|
3859
3984
|
var init_exports = __esm({
|
|
3860
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
3985
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/exports.mjs"() {
|
|
3986
|
+
init_dist();
|
|
3861
3987
|
init_sentry_integration();
|
|
3862
3988
|
init_express();
|
|
3863
3989
|
init_types3();
|
|
3864
3990
|
}
|
|
3865
3991
|
});
|
|
3866
3992
|
|
|
3867
|
-
// ../../node_modules/.pnpm/posthog-node@5.
|
|
3993
|
+
// ../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/entrypoints/index.node.mjs
|
|
3868
3994
|
var index_node_exports = {};
|
|
3869
3995
|
__export(index_node_exports, {
|
|
3870
3996
|
FeatureFlagError: () => FeatureFlagError,
|
|
@@ -3876,7 +4002,7 @@ __export(index_node_exports, {
|
|
|
3876
4002
|
});
|
|
3877
4003
|
var PostHog;
|
|
3878
4004
|
var init_index_node = __esm({
|
|
3879
|
-
"../../node_modules/.pnpm/posthog-node@5.
|
|
4005
|
+
"../../node_modules/.pnpm/posthog-node@5.24.1/node_modules/posthog-node/dist/entrypoints/index.node.mjs"() {
|
|
3880
4006
|
init_module_node();
|
|
3881
4007
|
init_context_lines_node();
|
|
3882
4008
|
init_error_tracking2();
|
|
@@ -5167,9 +5293,9 @@ var require_dist2 = __commonJS({
|
|
|
5167
5293
|
}
|
|
5168
5294
|
});
|
|
5169
5295
|
|
|
5170
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5296
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/package.json
|
|
5171
5297
|
var require_package = __commonJS({
|
|
5172
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5298
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/package.json"(exports$1, module) {
|
|
5173
5299
|
module.exports = {
|
|
5174
5300
|
name: "mixpanel",
|
|
5175
5301
|
description: "A simple server-side API for mixpanel",
|
|
@@ -5179,7 +5305,7 @@ var require_package = __commonJS({
|
|
|
5179
5305
|
"api",
|
|
5180
5306
|
"stats"
|
|
5181
5307
|
],
|
|
5182
|
-
version: "0.
|
|
5308
|
+
version: "0.20.0",
|
|
5183
5309
|
homepage: "https://github.com/mixpanel/mixpanel-node",
|
|
5184
5310
|
author: "Carl Sverre",
|
|
5185
5311
|
license: "MIT",
|
|
@@ -5195,29 +5321,35 @@ var require_package = __commonJS({
|
|
|
5195
5321
|
node: ">=10.0"
|
|
5196
5322
|
},
|
|
5197
5323
|
scripts: {
|
|
5198
|
-
test: "vitest"
|
|
5324
|
+
test: "vitest",
|
|
5325
|
+
format: "prettier --write .",
|
|
5326
|
+
"check-format": "prettier --check .",
|
|
5327
|
+
lint: "oxlint ."
|
|
5199
5328
|
},
|
|
5200
5329
|
types: "./lib/mixpanel-node.d.ts",
|
|
5201
5330
|
devDependencies: {
|
|
5202
5331
|
"@types/node": "^24.10.1",
|
|
5203
5332
|
"@vitest/coverage-v8": "^4.0.8",
|
|
5204
5333
|
nock: "^14.0.10",
|
|
5334
|
+
oxlint: "^1.16.0",
|
|
5335
|
+
prettier: "^3.6.2",
|
|
5205
5336
|
proxyquire: "^2.1.3",
|
|
5206
5337
|
typescript: "^5.9.3",
|
|
5207
5338
|
vitest: "^4.0.8"
|
|
5208
5339
|
},
|
|
5209
5340
|
dependencies: {
|
|
5210
|
-
"https-proxy-agent": "7.0.6"
|
|
5341
|
+
"https-proxy-agent": "7.0.6",
|
|
5342
|
+
"json-logic-js": "2.0.5"
|
|
5211
5343
|
}
|
|
5212
5344
|
};
|
|
5213
5345
|
}
|
|
5214
5346
|
});
|
|
5215
5347
|
|
|
5216
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5348
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/utils.js
|
|
5217
5349
|
var require_utils = __commonJS({
|
|
5218
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5350
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/utils.js"(exports$1) {
|
|
5219
5351
|
exports$1.async_all = function(requests, handler, callback) {
|
|
5220
|
-
|
|
5352
|
+
let total = requests.length, errors = null, results = [], done = function(err, result) {
|
|
5221
5353
|
if (err) {
|
|
5222
5354
|
errors = errors || [];
|
|
5223
5355
|
errors.push(err);
|
|
@@ -5230,14 +5362,16 @@ var require_utils = __commonJS({
|
|
|
5230
5362
|
if (total === 0) {
|
|
5231
5363
|
callback(errors, results);
|
|
5232
5364
|
} else {
|
|
5233
|
-
for (
|
|
5365
|
+
for (let i = 0, l = requests.length; i < l; i++) {
|
|
5234
5366
|
handler(requests[i], done);
|
|
5235
5367
|
}
|
|
5236
5368
|
}
|
|
5237
5369
|
};
|
|
5238
5370
|
exports$1.ensure_timestamp = function(time) {
|
|
5239
5371
|
if (!(time instanceof Date || typeof time === "number")) {
|
|
5240
|
-
throw new Error(
|
|
5372
|
+
throw new Error(
|
|
5373
|
+
"`time` property must be a Date or Unix timestamp and is only required for `import` endpoint"
|
|
5374
|
+
);
|
|
5241
5375
|
}
|
|
5242
5376
|
return time instanceof Date ? time.getTime() : time;
|
|
5243
5377
|
};
|
|
@@ -5254,9 +5388,9 @@ var require_utils = __commonJS({
|
|
|
5254
5388
|
}
|
|
5255
5389
|
});
|
|
5256
5390
|
|
|
5257
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5391
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/profile_helpers.js
|
|
5258
5392
|
var require_profile_helpers = __commonJS({
|
|
5259
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5393
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/profile_helpers.js"(exports$1) {
|
|
5260
5394
|
var { ensure_timestamp } = require_utils();
|
|
5261
5395
|
function merge_modifiers(data, modifiers) {
|
|
5262
5396
|
if (modifiers) {
|
|
@@ -5304,7 +5438,7 @@ var require_profile_helpers = __commonJS({
|
|
|
5304
5438
|
}
|
|
5305
5439
|
}
|
|
5306
5440
|
let data = {
|
|
5307
|
-
|
|
5441
|
+
$token: this.token,
|
|
5308
5442
|
...identifiers
|
|
5309
5443
|
};
|
|
5310
5444
|
const set_key = set_once ? "$set_once" : "$set";
|
|
@@ -5319,14 +5453,20 @@ var require_profile_helpers = __commonJS({
|
|
|
5319
5453
|
}
|
|
5320
5454
|
data = merge_modifiers(data, modifiers);
|
|
5321
5455
|
if (this.config.debug) {
|
|
5322
|
-
this.mixpanel.config.logger.debug(
|
|
5456
|
+
this.mixpanel.config.logger.debug(
|
|
5457
|
+
`Sending the following data to Mixpanel (${this.endpoint})`,
|
|
5458
|
+
{ data }
|
|
5459
|
+
);
|
|
5323
5460
|
}
|
|
5324
|
-
this.mixpanel.send_request(
|
|
5461
|
+
this.mixpanel.send_request(
|
|
5462
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5463
|
+
callback
|
|
5464
|
+
);
|
|
5325
5465
|
}
|
|
5326
5466
|
_delete_profile({ identifiers, modifiers, callback }) {
|
|
5327
5467
|
let data = {
|
|
5328
|
-
|
|
5329
|
-
|
|
5468
|
+
$delete: "",
|
|
5469
|
+
$token: this.token,
|
|
5330
5470
|
...identifiers
|
|
5331
5471
|
};
|
|
5332
5472
|
if (typeof modifiers === "function") {
|
|
@@ -5336,13 +5476,18 @@ var require_profile_helpers = __commonJS({
|
|
|
5336
5476
|
if (this.config.debug) {
|
|
5337
5477
|
this.mixpanel.config.logger.debug("Deleting profile", { identifiers });
|
|
5338
5478
|
}
|
|
5339
|
-
this.mixpanel.send_request(
|
|
5479
|
+
this.mixpanel.send_request(
|
|
5480
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5481
|
+
callback
|
|
5482
|
+
);
|
|
5340
5483
|
}
|
|
5341
5484
|
_remove({ identifiers, data, modifiers, callback }) {
|
|
5342
5485
|
let $remove = {};
|
|
5343
5486
|
if (typeof data !== "object" || Array.isArray(data)) {
|
|
5344
5487
|
if (this.config.debug) {
|
|
5345
|
-
this.mixpanel.config.logger.error(
|
|
5488
|
+
this.mixpanel.config.logger.error(
|
|
5489
|
+
"Invalid value passed to #remove - data must be an object with scalar values"
|
|
5490
|
+
);
|
|
5346
5491
|
}
|
|
5347
5492
|
return;
|
|
5348
5493
|
}
|
|
@@ -5363,8 +5508,8 @@ var require_profile_helpers = __commonJS({
|
|
|
5363
5508
|
return;
|
|
5364
5509
|
}
|
|
5365
5510
|
data = {
|
|
5366
|
-
|
|
5367
|
-
|
|
5511
|
+
$remove,
|
|
5512
|
+
$token: this.token,
|
|
5368
5513
|
...identifiers
|
|
5369
5514
|
};
|
|
5370
5515
|
if (typeof modifiers === "function") {
|
|
@@ -5377,19 +5522,24 @@ var require_profile_helpers = __commonJS({
|
|
|
5377
5522
|
{ data }
|
|
5378
5523
|
);
|
|
5379
5524
|
}
|
|
5380
|
-
this.mixpanel.send_request(
|
|
5525
|
+
this.mixpanel.send_request(
|
|
5526
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5527
|
+
callback
|
|
5528
|
+
);
|
|
5381
5529
|
}
|
|
5382
5530
|
_union({ identifiers, data, modifiers, callback }) {
|
|
5383
5531
|
let $union = {};
|
|
5384
5532
|
if (typeof data !== "object" || Array.isArray(data)) {
|
|
5385
5533
|
if (this.config.debug) {
|
|
5386
|
-
this.mixpanel.config.logger.error(
|
|
5534
|
+
this.mixpanel.config.logger.error(
|
|
5535
|
+
"Invalid value passed to #union - data must be an object with scalar or array values"
|
|
5536
|
+
);
|
|
5387
5537
|
}
|
|
5388
5538
|
return;
|
|
5389
5539
|
}
|
|
5390
5540
|
for (const [key, val] of Object.entries(data)) {
|
|
5391
5541
|
if (Array.isArray(val)) {
|
|
5392
|
-
|
|
5542
|
+
const merge_values = val.filter(function(v) {
|
|
5393
5543
|
return typeof v === "string" || typeof v === "number";
|
|
5394
5544
|
});
|
|
5395
5545
|
if (merge_values.length > 0) {
|
|
@@ -5410,8 +5560,8 @@ var require_profile_helpers = __commonJS({
|
|
|
5410
5560
|
return;
|
|
5411
5561
|
}
|
|
5412
5562
|
data = {
|
|
5413
|
-
|
|
5414
|
-
|
|
5563
|
+
$union,
|
|
5564
|
+
$token: this.token,
|
|
5415
5565
|
...identifiers
|
|
5416
5566
|
};
|
|
5417
5567
|
if (typeof modifiers === "function") {
|
|
@@ -5424,7 +5574,10 @@ var require_profile_helpers = __commonJS({
|
|
|
5424
5574
|
{ data }
|
|
5425
5575
|
);
|
|
5426
5576
|
}
|
|
5427
|
-
this.mixpanel.send_request(
|
|
5577
|
+
this.mixpanel.send_request(
|
|
5578
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5579
|
+
callback
|
|
5580
|
+
);
|
|
5428
5581
|
}
|
|
5429
5582
|
_unset({ identifiers, prop, modifiers, callback }) {
|
|
5430
5583
|
let $unset = [];
|
|
@@ -5442,8 +5595,8 @@ var require_profile_helpers = __commonJS({
|
|
|
5442
5595
|
return;
|
|
5443
5596
|
}
|
|
5444
5597
|
let data = {
|
|
5445
|
-
|
|
5446
|
-
|
|
5598
|
+
$unset,
|
|
5599
|
+
$token: this.token,
|
|
5447
5600
|
...identifiers
|
|
5448
5601
|
};
|
|
5449
5602
|
if (typeof modifiers === "function") {
|
|
@@ -5456,15 +5609,18 @@ var require_profile_helpers = __commonJS({
|
|
|
5456
5609
|
{ data }
|
|
5457
5610
|
);
|
|
5458
5611
|
}
|
|
5459
|
-
this.mixpanel.send_request(
|
|
5612
|
+
this.mixpanel.send_request(
|
|
5613
|
+
{ method: "GET", endpoint: this.endpoint, data },
|
|
5614
|
+
callback
|
|
5615
|
+
);
|
|
5460
5616
|
}
|
|
5461
5617
|
};
|
|
5462
5618
|
}
|
|
5463
5619
|
});
|
|
5464
5620
|
|
|
5465
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5621
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/groups.js
|
|
5466
5622
|
var require_groups = __commonJS({
|
|
5467
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5623
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/groups.js"(exports$1) {
|
|
5468
5624
|
var { ProfileHelpers } = require_profile_helpers();
|
|
5469
5625
|
var MixpanelGroups = class extends ProfileHelpers() {
|
|
5470
5626
|
constructor(mp_instance) {
|
|
@@ -5473,9 +5629,9 @@ var require_groups = __commonJS({
|
|
|
5473
5629
|
this.endpoint = "/groups";
|
|
5474
5630
|
}
|
|
5475
5631
|
/** groups.set_once(group_key, group_id, prop, to, modifiers, callback)
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5632
|
+
---
|
|
5633
|
+
The same as groups.set, but adds a property value to a group only if it has not been set before.
|
|
5634
|
+
*/
|
|
5479
5635
|
set_once(group_key, group_id, prop, to, modifiers, callback) {
|
|
5480
5636
|
const identifiers = { $group_key: group_key, $group_id: group_id };
|
|
5481
5637
|
this._set(prop, to, modifiers, callback, { identifiers, set_once: true });
|
|
@@ -5564,9 +5720,9 @@ var require_groups = __commonJS({
|
|
|
5564
5720
|
}
|
|
5565
5721
|
});
|
|
5566
5722
|
|
|
5567
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
5723
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/people.js
|
|
5568
5724
|
var require_people = __commonJS({
|
|
5569
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
5725
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/people.js"(exports$1) {
|
|
5570
5726
|
var { merge_modifiers, ProfileHelpers } = require_profile_helpers();
|
|
5571
5727
|
var MixpanelPeople = class extends ProfileHelpers() {
|
|
5572
5728
|
constructor(mp_instance) {
|
|
@@ -5632,7 +5788,7 @@ var require_people = __commonJS({
|
|
|
5632
5788
|
});
|
|
5633
5789
|
*/
|
|
5634
5790
|
increment(distinct_id, prop, by, modifiers, callback) {
|
|
5635
|
-
|
|
5791
|
+
const $add = {};
|
|
5636
5792
|
if (typeof prop === "object") {
|
|
5637
5793
|
if (typeof by === "object") {
|
|
5638
5794
|
callback = modifiers;
|
|
@@ -5668,16 +5824,22 @@ var require_people = __commonJS({
|
|
|
5668
5824
|
$add[prop] = 1;
|
|
5669
5825
|
}
|
|
5670
5826
|
}
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5827
|
+
let data = {
|
|
5828
|
+
$add,
|
|
5829
|
+
$token: this.mixpanel.token,
|
|
5830
|
+
$distinct_id: distinct_id
|
|
5675
5831
|
};
|
|
5676
5832
|
data = merge_modifiers(data, modifiers);
|
|
5677
5833
|
if (this.mixpanel.config.debug) {
|
|
5678
|
-
this.mixpanel.config.logger.debug(
|
|
5834
|
+
this.mixpanel.config.logger.debug(
|
|
5835
|
+
"Sending the following data to Mixpanel (Engage)",
|
|
5836
|
+
{ data }
|
|
5837
|
+
);
|
|
5679
5838
|
}
|
|
5680
|
-
this.mixpanel.send_request(
|
|
5839
|
+
this.mixpanel.send_request(
|
|
5840
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5841
|
+
callback
|
|
5842
|
+
);
|
|
5681
5843
|
}
|
|
5682
5844
|
/**
|
|
5683
5845
|
people.append(distinct_id, prop, value, modifiers, callback)
|
|
@@ -5696,7 +5858,7 @@ var require_people = __commonJS({
|
|
|
5696
5858
|
});
|
|
5697
5859
|
*/
|
|
5698
5860
|
append(distinct_id, prop, value, modifiers, callback) {
|
|
5699
|
-
|
|
5861
|
+
const $append = {};
|
|
5700
5862
|
if (typeof prop === "object") {
|
|
5701
5863
|
if (typeof value === "object") {
|
|
5702
5864
|
callback = modifiers;
|
|
@@ -5713,16 +5875,22 @@ var require_people = __commonJS({
|
|
|
5713
5875
|
callback = modifiers;
|
|
5714
5876
|
}
|
|
5715
5877
|
}
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5878
|
+
let data = {
|
|
5879
|
+
$append,
|
|
5880
|
+
$token: this.mixpanel.token,
|
|
5881
|
+
$distinct_id: distinct_id
|
|
5720
5882
|
};
|
|
5721
5883
|
data = merge_modifiers(data, modifiers);
|
|
5722
5884
|
if (this.mixpanel.config.debug) {
|
|
5723
|
-
this.mixpanel.config.logger.debug(
|
|
5885
|
+
this.mixpanel.config.logger.debug(
|
|
5886
|
+
"Sending the following data to Mixpanel (Engage)",
|
|
5887
|
+
{ data }
|
|
5888
|
+
);
|
|
5724
5889
|
}
|
|
5725
|
-
this.mixpanel.send_request(
|
|
5890
|
+
this.mixpanel.send_request(
|
|
5891
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5892
|
+
callback
|
|
5893
|
+
);
|
|
5726
5894
|
}
|
|
5727
5895
|
/**
|
|
5728
5896
|
people.track_charge(distinct_id, amount, properties, modifiers, callback)
|
|
@@ -5757,27 +5925,35 @@ var require_people = __commonJS({
|
|
|
5757
5925
|
if (typeof amount !== "number") {
|
|
5758
5926
|
amount = parseFloat(amount);
|
|
5759
5927
|
if (isNaN(amount)) {
|
|
5760
|
-
this.mixpanel.config.logger.error(
|
|
5928
|
+
this.mixpanel.config.logger.error(
|
|
5929
|
+
"Invalid value passed to mixpanel.people.track_charge - must be a number"
|
|
5930
|
+
);
|
|
5761
5931
|
return;
|
|
5762
5932
|
}
|
|
5763
5933
|
}
|
|
5764
5934
|
properties.$amount = amount;
|
|
5765
5935
|
if (properties.hasOwnProperty("$time")) {
|
|
5766
|
-
|
|
5936
|
+
const time = properties.$time;
|
|
5767
5937
|
if (Object.prototype.toString.call(time) === "[object Date]") {
|
|
5768
5938
|
properties.$time = time.toISOString();
|
|
5769
5939
|
}
|
|
5770
5940
|
}
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5941
|
+
let data = {
|
|
5942
|
+
$append: { $transactions: properties },
|
|
5943
|
+
$token: this.mixpanel.token,
|
|
5944
|
+
$distinct_id: distinct_id
|
|
5775
5945
|
};
|
|
5776
5946
|
data = merge_modifiers(data, modifiers);
|
|
5777
5947
|
if (this.mixpanel.config.debug) {
|
|
5778
|
-
this.mixpanel.config.logger.debug(
|
|
5948
|
+
this.mixpanel.config.logger.debug(
|
|
5949
|
+
"Sending the following data to Mixpanel (Engage)",
|
|
5950
|
+
{ data }
|
|
5951
|
+
);
|
|
5779
5952
|
}
|
|
5780
|
-
this.mixpanel.send_request(
|
|
5953
|
+
this.mixpanel.send_request(
|
|
5954
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5955
|
+
callback
|
|
5956
|
+
);
|
|
5781
5957
|
}
|
|
5782
5958
|
/**
|
|
5783
5959
|
people.clear_charges(distinct_id, modifiers, callback)
|
|
@@ -5789,19 +5965,24 @@ var require_people = __commonJS({
|
|
|
5789
5965
|
mixpanel.people.clear_charges('bob');
|
|
5790
5966
|
*/
|
|
5791
5967
|
clear_charges(distinct_id, modifiers, callback) {
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5968
|
+
let data = {
|
|
5969
|
+
$set: { $transactions: [] },
|
|
5970
|
+
$token: this.mixpanel.token,
|
|
5971
|
+
$distinct_id: distinct_id
|
|
5796
5972
|
};
|
|
5797
5973
|
if (typeof modifiers === "function") {
|
|
5798
5974
|
callback = modifiers;
|
|
5799
5975
|
}
|
|
5800
5976
|
data = merge_modifiers(data, modifiers);
|
|
5801
5977
|
if (this.mixpanel.config.debug) {
|
|
5802
|
-
this.mixpanel.config.logger.debug("Clearing this user's charges", {
|
|
5978
|
+
this.mixpanel.config.logger.debug("Clearing this user's charges", {
|
|
5979
|
+
$distinct_id: distinct_id
|
|
5980
|
+
});
|
|
5803
5981
|
}
|
|
5804
|
-
this.mixpanel.send_request(
|
|
5982
|
+
this.mixpanel.send_request(
|
|
5983
|
+
{ method: "GET", endpoint: "/engage", data },
|
|
5984
|
+
callback
|
|
5985
|
+
);
|
|
5805
5986
|
}
|
|
5806
5987
|
/**
|
|
5807
5988
|
people.delete_user(distinct_id, modifiers, callback)
|
|
@@ -5828,7 +6009,7 @@ var require_people = __commonJS({
|
|
|
5828
6009
|
mixpanel.people.remove('bob', {'browsers': 'chrome', 'os': 'linux'});
|
|
5829
6010
|
*/
|
|
5830
6011
|
remove(distinct_id, data, modifiers, callback) {
|
|
5831
|
-
const identifiers = {
|
|
6012
|
+
const identifiers = { $distinct_id: distinct_id };
|
|
5832
6013
|
this._remove({ identifiers, data, modifiers, callback });
|
|
5833
6014
|
}
|
|
5834
6015
|
/**
|
|
@@ -5866,9 +6047,9 @@ var require_people = __commonJS({
|
|
|
5866
6047
|
}
|
|
5867
6048
|
});
|
|
5868
6049
|
|
|
5869
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
6050
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/utils.js
|
|
5870
6051
|
var require_utils2 = __commonJS({
|
|
5871
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6052
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/utils.js"(exports$1, module) {
|
|
5872
6053
|
var crypto3 = __require("crypto");
|
|
5873
6054
|
var EXPOSURE_EVENT = "$experiment_started";
|
|
5874
6055
|
var REQUEST_HEADERS = {
|
|
@@ -5903,22 +6084,55 @@ var require_utils2 = __commonJS({
|
|
|
5903
6084
|
const traceFlags = "01";
|
|
5904
6085
|
return `${version3}-${traceId}-${parentId}-${traceFlags}`;
|
|
5905
6086
|
}
|
|
6087
|
+
function lowercaseJson(obj, lowercaseKeys) {
|
|
6088
|
+
if (obj === null || obj === void 0) {
|
|
6089
|
+
return obj;
|
|
6090
|
+
} else if (typeof obj === "string") {
|
|
6091
|
+
return obj.toLowerCase();
|
|
6092
|
+
} else if (typeof obj === "object") {
|
|
6093
|
+
if (Array.isArray(obj)) {
|
|
6094
|
+
return obj.map((item) => lowercaseJson(item, lowercaseKeys));
|
|
6095
|
+
} else {
|
|
6096
|
+
return Object.fromEntries(
|
|
6097
|
+
Object.entries(obj).map(([k, v]) => [
|
|
6098
|
+
lowercaseKeys ? k.toLowerCase() : k,
|
|
6099
|
+
lowercaseJson(v, lowercaseKeys)
|
|
6100
|
+
])
|
|
6101
|
+
);
|
|
6102
|
+
}
|
|
6103
|
+
} else {
|
|
6104
|
+
return obj;
|
|
6105
|
+
}
|
|
6106
|
+
}
|
|
6107
|
+
function lowercaseAllKeysAndValues(obj) {
|
|
6108
|
+
return lowercaseJson(obj, true);
|
|
6109
|
+
}
|
|
6110
|
+
function lowercaseLeafNodes(obj) {
|
|
6111
|
+
return lowercaseJson(obj, false);
|
|
6112
|
+
}
|
|
5906
6113
|
module.exports = {
|
|
5907
6114
|
EXPOSURE_EVENT,
|
|
5908
6115
|
REQUEST_HEADERS,
|
|
5909
6116
|
normalizedHash,
|
|
5910
6117
|
prepareCommonQueryParams,
|
|
5911
|
-
generateTraceparent
|
|
6118
|
+
generateTraceparent,
|
|
6119
|
+
lowercaseAllKeysAndValues,
|
|
6120
|
+
lowercaseLeafNodes
|
|
5912
6121
|
};
|
|
5913
6122
|
}
|
|
5914
6123
|
});
|
|
5915
6124
|
|
|
5916
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
6125
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/flags.js
|
|
5917
6126
|
var require_flags = __commonJS({
|
|
5918
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6127
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/flags.js"(exports$1, module) {
|
|
5919
6128
|
var https3 = __require("https");
|
|
5920
6129
|
var packageInfo = require_package();
|
|
5921
|
-
var {
|
|
6130
|
+
var {
|
|
6131
|
+
prepareCommonQueryParams,
|
|
6132
|
+
generateTraceparent,
|
|
6133
|
+
EXPOSURE_EVENT,
|
|
6134
|
+
REQUEST_HEADERS
|
|
6135
|
+
} = require_utils2();
|
|
5922
6136
|
var FeatureFlagsProvider = class {
|
|
5923
6137
|
/**
|
|
5924
6138
|
* @param {Object} providerConfig - Configuration object with token, api_host, request_timeout_in_seconds
|
|
@@ -5941,7 +6155,10 @@ var require_flags = __commonJS({
|
|
|
5941
6155
|
*/
|
|
5942
6156
|
async callFlagsEndpoint(additionalParams = null) {
|
|
5943
6157
|
return new Promise((resolve, reject) => {
|
|
5944
|
-
const commonParams = prepareCommonQueryParams(
|
|
6158
|
+
const commonParams = prepareCommonQueryParams(
|
|
6159
|
+
this.providerConfig.token,
|
|
6160
|
+
packageInfo.version
|
|
6161
|
+
);
|
|
5945
6162
|
const params = new URLSearchParams(commonParams);
|
|
5946
6163
|
if (additionalParams) {
|
|
5947
6164
|
for (const [key, value] of Object.entries(additionalParams)) {
|
|
@@ -5956,8 +6173,8 @@ var require_flags = __commonJS({
|
|
|
5956
6173
|
method: "GET",
|
|
5957
6174
|
headers: {
|
|
5958
6175
|
...REQUEST_HEADERS,
|
|
5959
|
-
|
|
5960
|
-
|
|
6176
|
+
Authorization: "Basic " + Buffer.from(this.providerConfig.token + ":").toString("base64"),
|
|
6177
|
+
traceparent: generateTraceparent()
|
|
5961
6178
|
},
|
|
5962
6179
|
timeout: this.providerConfig.request_timeout_in_seconds * 1e3
|
|
5963
6180
|
};
|
|
@@ -5968,20 +6185,26 @@ var require_flags = __commonJS({
|
|
|
5968
6185
|
});
|
|
5969
6186
|
res.on("end", () => {
|
|
5970
6187
|
if (res.statusCode !== 200) {
|
|
5971
|
-
this.logger?.error(
|
|
6188
|
+
this.logger?.error(
|
|
6189
|
+
`HTTP ${res.statusCode} error calling flags endpoint: ${data}`
|
|
6190
|
+
);
|
|
5972
6191
|
return reject(new Error(`HTTP ${res.statusCode}: ${data}`));
|
|
5973
6192
|
}
|
|
5974
6193
|
try {
|
|
5975
6194
|
const result = JSON.parse(data);
|
|
5976
6195
|
resolve(result);
|
|
5977
6196
|
} catch (parseErr) {
|
|
5978
|
-
this.logger?.error(
|
|
6197
|
+
this.logger?.error(
|
|
6198
|
+
`Failed to parse JSON response: ${parseErr.message}`
|
|
6199
|
+
);
|
|
5979
6200
|
reject(parseErr);
|
|
5980
6201
|
}
|
|
5981
6202
|
});
|
|
5982
6203
|
});
|
|
5983
6204
|
request.on("error", (err) => {
|
|
5984
|
-
this.logger?.error(
|
|
6205
|
+
this.logger?.error(
|
|
6206
|
+
`Network error calling flags endpoint: ${err.message}`
|
|
6207
|
+
);
|
|
5985
6208
|
reject(err);
|
|
5986
6209
|
});
|
|
5987
6210
|
request.on("timeout", () => {
|
|
@@ -6003,14 +6226,16 @@ var require_flags = __commonJS({
|
|
|
6003
6226
|
*/
|
|
6004
6227
|
trackExposureEvent(flagKey, selectedVariant, context, latencyMs = null) {
|
|
6005
6228
|
if (!context.distinct_id) {
|
|
6006
|
-
this.logger?.error(
|
|
6229
|
+
this.logger?.error(
|
|
6230
|
+
"Cannot track exposure event without a distinct_id in the context"
|
|
6231
|
+
);
|
|
6007
6232
|
return;
|
|
6008
6233
|
}
|
|
6009
6234
|
const properties = {
|
|
6010
|
-
|
|
6235
|
+
distinct_id: context.distinct_id,
|
|
6011
6236
|
"Experiment name": flagKey,
|
|
6012
6237
|
"Variant name": selectedVariant.variant_key,
|
|
6013
|
-
|
|
6238
|
+
$experiment_type: "feature_flag",
|
|
6014
6239
|
"Flag evaluation mode": this.evaluationMode
|
|
6015
6240
|
};
|
|
6016
6241
|
if (latencyMs !== null && latencyMs !== void 0) {
|
|
@@ -6027,7 +6252,9 @@ var require_flags = __commonJS({
|
|
|
6027
6252
|
}
|
|
6028
6253
|
this.tracker(EXPOSURE_EVENT, properties, (err) => {
|
|
6029
6254
|
if (err) {
|
|
6030
|
-
this.logger?.error(
|
|
6255
|
+
this.logger?.error(
|
|
6256
|
+
`[flags]Failed to track exposure event for flag '${flagKey}': ${err.message}`
|
|
6257
|
+
);
|
|
6031
6258
|
}
|
|
6032
6259
|
});
|
|
6033
6260
|
}
|
|
@@ -6036,11 +6263,392 @@ var require_flags = __commonJS({
|
|
|
6036
6263
|
}
|
|
6037
6264
|
});
|
|
6038
6265
|
|
|
6039
|
-
// ../../node_modules/.pnpm/
|
|
6266
|
+
// ../../node_modules/.pnpm/json-logic-js@2.0.5/node_modules/json-logic-js/logic.js
|
|
6267
|
+
var require_logic = __commonJS({
|
|
6268
|
+
"../../node_modules/.pnpm/json-logic-js@2.0.5/node_modules/json-logic-js/logic.js"(exports$1, module) {
|
|
6269
|
+
(function(root, factory) {
|
|
6270
|
+
if (typeof define === "function" && define.amd) {
|
|
6271
|
+
define(factory);
|
|
6272
|
+
} else if (typeof exports$1 === "object") {
|
|
6273
|
+
module.exports = factory();
|
|
6274
|
+
} else {
|
|
6275
|
+
root.jsonLogic = factory();
|
|
6276
|
+
}
|
|
6277
|
+
})(exports$1, function() {
|
|
6278
|
+
if (!Array.isArray) {
|
|
6279
|
+
Array.isArray = function(arg) {
|
|
6280
|
+
return Object.prototype.toString.call(arg) === "[object Array]";
|
|
6281
|
+
};
|
|
6282
|
+
}
|
|
6283
|
+
function arrayUnique(array) {
|
|
6284
|
+
var a = [];
|
|
6285
|
+
for (var i = 0, l = array.length; i < l; i++) {
|
|
6286
|
+
if (a.indexOf(array[i]) === -1) {
|
|
6287
|
+
a.push(array[i]);
|
|
6288
|
+
}
|
|
6289
|
+
}
|
|
6290
|
+
return a;
|
|
6291
|
+
}
|
|
6292
|
+
var jsonLogic = {};
|
|
6293
|
+
var operations = {
|
|
6294
|
+
"==": function(a, b) {
|
|
6295
|
+
return a == b;
|
|
6296
|
+
},
|
|
6297
|
+
"===": function(a, b) {
|
|
6298
|
+
return a === b;
|
|
6299
|
+
},
|
|
6300
|
+
"!=": function(a, b) {
|
|
6301
|
+
return a != b;
|
|
6302
|
+
},
|
|
6303
|
+
"!==": function(a, b) {
|
|
6304
|
+
return a !== b;
|
|
6305
|
+
},
|
|
6306
|
+
">": function(a, b) {
|
|
6307
|
+
return a > b;
|
|
6308
|
+
},
|
|
6309
|
+
">=": function(a, b) {
|
|
6310
|
+
return a >= b;
|
|
6311
|
+
},
|
|
6312
|
+
"<": function(a, b, c) {
|
|
6313
|
+
return c === void 0 ? a < b : a < b && b < c;
|
|
6314
|
+
},
|
|
6315
|
+
"<=": function(a, b, c) {
|
|
6316
|
+
return c === void 0 ? a <= b : a <= b && b <= c;
|
|
6317
|
+
},
|
|
6318
|
+
"!!": function(a) {
|
|
6319
|
+
return jsonLogic.truthy(a);
|
|
6320
|
+
},
|
|
6321
|
+
"!": function(a) {
|
|
6322
|
+
return !jsonLogic.truthy(a);
|
|
6323
|
+
},
|
|
6324
|
+
"%": function(a, b) {
|
|
6325
|
+
return a % b;
|
|
6326
|
+
},
|
|
6327
|
+
"log": function(a) {
|
|
6328
|
+
console.log(a);
|
|
6329
|
+
return a;
|
|
6330
|
+
},
|
|
6331
|
+
"in": function(a, b) {
|
|
6332
|
+
if (!b || typeof b.indexOf === "undefined") return false;
|
|
6333
|
+
return b.indexOf(a) !== -1;
|
|
6334
|
+
},
|
|
6335
|
+
"cat": function() {
|
|
6336
|
+
return Array.prototype.join.call(arguments, "");
|
|
6337
|
+
},
|
|
6338
|
+
"substr": function(source, start, end) {
|
|
6339
|
+
if (end < 0) {
|
|
6340
|
+
var temp = String(source).substr(start);
|
|
6341
|
+
return temp.substr(0, temp.length + end);
|
|
6342
|
+
}
|
|
6343
|
+
return String(source).substr(start, end);
|
|
6344
|
+
},
|
|
6345
|
+
"+": function() {
|
|
6346
|
+
return Array.prototype.reduce.call(arguments, function(a, b) {
|
|
6347
|
+
return parseFloat(a, 10) + parseFloat(b, 10);
|
|
6348
|
+
}, 0);
|
|
6349
|
+
},
|
|
6350
|
+
"*": function() {
|
|
6351
|
+
return Array.prototype.reduce.call(arguments, function(a, b) {
|
|
6352
|
+
return parseFloat(a, 10) * parseFloat(b, 10);
|
|
6353
|
+
});
|
|
6354
|
+
},
|
|
6355
|
+
"-": function(a, b) {
|
|
6356
|
+
if (b === void 0) {
|
|
6357
|
+
return -a;
|
|
6358
|
+
} else {
|
|
6359
|
+
return a - b;
|
|
6360
|
+
}
|
|
6361
|
+
},
|
|
6362
|
+
"/": function(a, b) {
|
|
6363
|
+
return a / b;
|
|
6364
|
+
},
|
|
6365
|
+
"min": function() {
|
|
6366
|
+
return Math.min.apply(this, arguments);
|
|
6367
|
+
},
|
|
6368
|
+
"max": function() {
|
|
6369
|
+
return Math.max.apply(this, arguments);
|
|
6370
|
+
},
|
|
6371
|
+
"merge": function() {
|
|
6372
|
+
return Array.prototype.reduce.call(arguments, function(a, b) {
|
|
6373
|
+
return a.concat(b);
|
|
6374
|
+
}, []);
|
|
6375
|
+
},
|
|
6376
|
+
"var": function(a, b) {
|
|
6377
|
+
var not_found = b === void 0 ? null : b;
|
|
6378
|
+
var data = this;
|
|
6379
|
+
if (typeof a === "undefined" || a === "" || a === null) {
|
|
6380
|
+
return data;
|
|
6381
|
+
}
|
|
6382
|
+
var sub_props = String(a).split(".");
|
|
6383
|
+
for (var i = 0; i < sub_props.length; i++) {
|
|
6384
|
+
if (data === null || data === void 0) {
|
|
6385
|
+
return not_found;
|
|
6386
|
+
}
|
|
6387
|
+
data = data[sub_props[i]];
|
|
6388
|
+
if (data === void 0) {
|
|
6389
|
+
return not_found;
|
|
6390
|
+
}
|
|
6391
|
+
}
|
|
6392
|
+
return data;
|
|
6393
|
+
},
|
|
6394
|
+
"missing": function() {
|
|
6395
|
+
var missing = [];
|
|
6396
|
+
var keys = Array.isArray(arguments[0]) ? arguments[0] : arguments;
|
|
6397
|
+
for (var i = 0; i < keys.length; i++) {
|
|
6398
|
+
var key = keys[i];
|
|
6399
|
+
var value = jsonLogic.apply({ "var": key }, this);
|
|
6400
|
+
if (value === null || value === "") {
|
|
6401
|
+
missing.push(key);
|
|
6402
|
+
}
|
|
6403
|
+
}
|
|
6404
|
+
return missing;
|
|
6405
|
+
},
|
|
6406
|
+
"missing_some": function(need_count, options) {
|
|
6407
|
+
var are_missing = jsonLogic.apply({ "missing": options }, this);
|
|
6408
|
+
if (options.length - are_missing.length >= need_count) {
|
|
6409
|
+
return [];
|
|
6410
|
+
} else {
|
|
6411
|
+
return are_missing;
|
|
6412
|
+
}
|
|
6413
|
+
}
|
|
6414
|
+
};
|
|
6415
|
+
jsonLogic.is_logic = function(logic) {
|
|
6416
|
+
return typeof logic === "object" && // An object
|
|
6417
|
+
logic !== null && // but not null
|
|
6418
|
+
!Array.isArray(logic) && // and not an array
|
|
6419
|
+
Object.keys(logic).length === 1;
|
|
6420
|
+
};
|
|
6421
|
+
jsonLogic.truthy = function(value) {
|
|
6422
|
+
if (Array.isArray(value) && value.length === 0) {
|
|
6423
|
+
return false;
|
|
6424
|
+
}
|
|
6425
|
+
return !!value;
|
|
6426
|
+
};
|
|
6427
|
+
jsonLogic.get_operator = function(logic) {
|
|
6428
|
+
return Object.keys(logic)[0];
|
|
6429
|
+
};
|
|
6430
|
+
jsonLogic.get_values = function(logic) {
|
|
6431
|
+
return logic[jsonLogic.get_operator(logic)];
|
|
6432
|
+
};
|
|
6433
|
+
jsonLogic.apply = function(logic, data) {
|
|
6434
|
+
if (Array.isArray(logic)) {
|
|
6435
|
+
return logic.map(function(l) {
|
|
6436
|
+
return jsonLogic.apply(l, data);
|
|
6437
|
+
});
|
|
6438
|
+
}
|
|
6439
|
+
if (!jsonLogic.is_logic(logic)) {
|
|
6440
|
+
return logic;
|
|
6441
|
+
}
|
|
6442
|
+
var op = jsonLogic.get_operator(logic);
|
|
6443
|
+
var values = logic[op];
|
|
6444
|
+
var i;
|
|
6445
|
+
var current;
|
|
6446
|
+
var scopedLogic;
|
|
6447
|
+
var scopedData;
|
|
6448
|
+
var initial;
|
|
6449
|
+
if (!Array.isArray(values)) {
|
|
6450
|
+
values = [values];
|
|
6451
|
+
}
|
|
6452
|
+
if (op === "if" || op == "?:") {
|
|
6453
|
+
for (i = 0; i < values.length - 1; i += 2) {
|
|
6454
|
+
if (jsonLogic.truthy(jsonLogic.apply(values[i], data))) {
|
|
6455
|
+
return jsonLogic.apply(values[i + 1], data);
|
|
6456
|
+
}
|
|
6457
|
+
}
|
|
6458
|
+
if (values.length === i + 1) {
|
|
6459
|
+
return jsonLogic.apply(values[i], data);
|
|
6460
|
+
}
|
|
6461
|
+
return null;
|
|
6462
|
+
} else if (op === "and") {
|
|
6463
|
+
for (i = 0; i < values.length; i += 1) {
|
|
6464
|
+
current = jsonLogic.apply(values[i], data);
|
|
6465
|
+
if (!jsonLogic.truthy(current)) {
|
|
6466
|
+
return current;
|
|
6467
|
+
}
|
|
6468
|
+
}
|
|
6469
|
+
return current;
|
|
6470
|
+
} else if (op === "or") {
|
|
6471
|
+
for (i = 0; i < values.length; i += 1) {
|
|
6472
|
+
current = jsonLogic.apply(values[i], data);
|
|
6473
|
+
if (jsonLogic.truthy(current)) {
|
|
6474
|
+
return current;
|
|
6475
|
+
}
|
|
6476
|
+
}
|
|
6477
|
+
return current;
|
|
6478
|
+
} else if (op === "filter") {
|
|
6479
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6480
|
+
scopedLogic = values[1];
|
|
6481
|
+
if (!Array.isArray(scopedData)) {
|
|
6482
|
+
return [];
|
|
6483
|
+
}
|
|
6484
|
+
return scopedData.filter(function(datum) {
|
|
6485
|
+
return jsonLogic.truthy(jsonLogic.apply(scopedLogic, datum));
|
|
6486
|
+
});
|
|
6487
|
+
} else if (op === "map") {
|
|
6488
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6489
|
+
scopedLogic = values[1];
|
|
6490
|
+
if (!Array.isArray(scopedData)) {
|
|
6491
|
+
return [];
|
|
6492
|
+
}
|
|
6493
|
+
return scopedData.map(function(datum) {
|
|
6494
|
+
return jsonLogic.apply(scopedLogic, datum);
|
|
6495
|
+
});
|
|
6496
|
+
} else if (op === "reduce") {
|
|
6497
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6498
|
+
scopedLogic = values[1];
|
|
6499
|
+
initial = typeof values[2] !== "undefined" ? jsonLogic.apply(values[2], data) : null;
|
|
6500
|
+
if (!Array.isArray(scopedData)) {
|
|
6501
|
+
return initial;
|
|
6502
|
+
}
|
|
6503
|
+
return scopedData.reduce(
|
|
6504
|
+
function(accumulator, current2) {
|
|
6505
|
+
return jsonLogic.apply(
|
|
6506
|
+
scopedLogic,
|
|
6507
|
+
{ current: current2, accumulator }
|
|
6508
|
+
);
|
|
6509
|
+
},
|
|
6510
|
+
initial
|
|
6511
|
+
);
|
|
6512
|
+
} else if (op === "all") {
|
|
6513
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6514
|
+
scopedLogic = values[1];
|
|
6515
|
+
if (!Array.isArray(scopedData) || !scopedData.length) {
|
|
6516
|
+
return false;
|
|
6517
|
+
}
|
|
6518
|
+
for (i = 0; i < scopedData.length; i += 1) {
|
|
6519
|
+
if (!jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) {
|
|
6520
|
+
return false;
|
|
6521
|
+
}
|
|
6522
|
+
}
|
|
6523
|
+
return true;
|
|
6524
|
+
} else if (op === "none") {
|
|
6525
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6526
|
+
scopedLogic = values[1];
|
|
6527
|
+
if (!Array.isArray(scopedData) || !scopedData.length) {
|
|
6528
|
+
return true;
|
|
6529
|
+
}
|
|
6530
|
+
for (i = 0; i < scopedData.length; i += 1) {
|
|
6531
|
+
if (jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) {
|
|
6532
|
+
return false;
|
|
6533
|
+
}
|
|
6534
|
+
}
|
|
6535
|
+
return true;
|
|
6536
|
+
} else if (op === "some") {
|
|
6537
|
+
scopedData = jsonLogic.apply(values[0], data);
|
|
6538
|
+
scopedLogic = values[1];
|
|
6539
|
+
if (!Array.isArray(scopedData) || !scopedData.length) {
|
|
6540
|
+
return false;
|
|
6541
|
+
}
|
|
6542
|
+
for (i = 0; i < scopedData.length; i += 1) {
|
|
6543
|
+
if (jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) {
|
|
6544
|
+
return true;
|
|
6545
|
+
}
|
|
6546
|
+
}
|
|
6547
|
+
return false;
|
|
6548
|
+
}
|
|
6549
|
+
values = values.map(function(val) {
|
|
6550
|
+
return jsonLogic.apply(val, data);
|
|
6551
|
+
});
|
|
6552
|
+
if (operations.hasOwnProperty(op) && typeof operations[op] === "function") {
|
|
6553
|
+
return operations[op].apply(data, values);
|
|
6554
|
+
} else if (op.indexOf(".") > 0) {
|
|
6555
|
+
var sub_ops = String(op).split(".");
|
|
6556
|
+
var operation = operations;
|
|
6557
|
+
for (i = 0; i < sub_ops.length; i++) {
|
|
6558
|
+
if (!operation.hasOwnProperty(sub_ops[i])) {
|
|
6559
|
+
throw new Error("Unrecognized operation " + op + " (failed at " + sub_ops.slice(0, i + 1).join(".") + ")");
|
|
6560
|
+
}
|
|
6561
|
+
operation = operation[sub_ops[i]];
|
|
6562
|
+
}
|
|
6563
|
+
return operation.apply(data, values);
|
|
6564
|
+
}
|
|
6565
|
+
throw new Error("Unrecognized operation " + op);
|
|
6566
|
+
};
|
|
6567
|
+
jsonLogic.uses_data = function(logic) {
|
|
6568
|
+
var collection = [];
|
|
6569
|
+
if (jsonLogic.is_logic(logic)) {
|
|
6570
|
+
var op = jsonLogic.get_operator(logic);
|
|
6571
|
+
var values = logic[op];
|
|
6572
|
+
if (!Array.isArray(values)) {
|
|
6573
|
+
values = [values];
|
|
6574
|
+
}
|
|
6575
|
+
if (op === "var") {
|
|
6576
|
+
collection.push(values[0]);
|
|
6577
|
+
} else {
|
|
6578
|
+
values.forEach(function(val) {
|
|
6579
|
+
collection.push.apply(collection, jsonLogic.uses_data(val));
|
|
6580
|
+
});
|
|
6581
|
+
}
|
|
6582
|
+
}
|
|
6583
|
+
return arrayUnique(collection);
|
|
6584
|
+
};
|
|
6585
|
+
jsonLogic.add_operation = function(name, code) {
|
|
6586
|
+
operations[name] = code;
|
|
6587
|
+
};
|
|
6588
|
+
jsonLogic.rm_operation = function(name) {
|
|
6589
|
+
delete operations[name];
|
|
6590
|
+
};
|
|
6591
|
+
jsonLogic.rule_like = function(rule, pattern) {
|
|
6592
|
+
if (pattern === rule) {
|
|
6593
|
+
return true;
|
|
6594
|
+
}
|
|
6595
|
+
if (pattern === "@") {
|
|
6596
|
+
return true;
|
|
6597
|
+
}
|
|
6598
|
+
if (pattern === "number") {
|
|
6599
|
+
return typeof rule === "number";
|
|
6600
|
+
}
|
|
6601
|
+
if (pattern === "string") {
|
|
6602
|
+
return typeof rule === "string";
|
|
6603
|
+
}
|
|
6604
|
+
if (pattern === "array") {
|
|
6605
|
+
return Array.isArray(rule) && !jsonLogic.is_logic(rule);
|
|
6606
|
+
}
|
|
6607
|
+
if (jsonLogic.is_logic(pattern)) {
|
|
6608
|
+
if (jsonLogic.is_logic(rule)) {
|
|
6609
|
+
var pattern_op = jsonLogic.get_operator(pattern);
|
|
6610
|
+
var rule_op = jsonLogic.get_operator(rule);
|
|
6611
|
+
if (pattern_op === "@" || pattern_op === rule_op) {
|
|
6612
|
+
return jsonLogic.rule_like(
|
|
6613
|
+
jsonLogic.get_values(rule, false),
|
|
6614
|
+
jsonLogic.get_values(pattern, false)
|
|
6615
|
+
);
|
|
6616
|
+
}
|
|
6617
|
+
}
|
|
6618
|
+
return false;
|
|
6619
|
+
}
|
|
6620
|
+
if (Array.isArray(pattern)) {
|
|
6621
|
+
if (Array.isArray(rule)) {
|
|
6622
|
+
if (pattern.length !== rule.length) {
|
|
6623
|
+
return false;
|
|
6624
|
+
}
|
|
6625
|
+
for (var i = 0; i < pattern.length; i += 1) {
|
|
6626
|
+
if (!jsonLogic.rule_like(rule[i], pattern[i])) {
|
|
6627
|
+
return false;
|
|
6628
|
+
}
|
|
6629
|
+
}
|
|
6630
|
+
return true;
|
|
6631
|
+
} else {
|
|
6632
|
+
return false;
|
|
6633
|
+
}
|
|
6634
|
+
}
|
|
6635
|
+
return false;
|
|
6636
|
+
};
|
|
6637
|
+
return jsonLogic;
|
|
6638
|
+
});
|
|
6639
|
+
}
|
|
6640
|
+
});
|
|
6641
|
+
|
|
6642
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/local_flags.js
|
|
6040
6643
|
var require_local_flags = __commonJS({
|
|
6041
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6644
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/local_flags.js"(exports$1, module) {
|
|
6042
6645
|
var FeatureFlagsProvider = require_flags();
|
|
6043
|
-
var {
|
|
6646
|
+
var {
|
|
6647
|
+
normalizedHash,
|
|
6648
|
+
lowercaseAllKeysAndValues,
|
|
6649
|
+
lowercaseLeafNodes
|
|
6650
|
+
} = require_utils2();
|
|
6651
|
+
var { apply } = require_logic();
|
|
6044
6652
|
var LocalFeatureFlagsProvider = class extends FeatureFlagsProvider {
|
|
6045
6653
|
/**
|
|
6046
6654
|
* @param {string} token - Mixpanel project token
|
|
@@ -6079,12 +6687,16 @@ var require_local_flags = __commonJS({
|
|
|
6079
6687
|
try {
|
|
6080
6688
|
await this._fetchFlagDefinitions();
|
|
6081
6689
|
} catch (err) {
|
|
6082
|
-
this.logger?.error(
|
|
6690
|
+
this.logger?.error(
|
|
6691
|
+
`Error polling for flag definition: ${err.message}`
|
|
6692
|
+
);
|
|
6083
6693
|
}
|
|
6084
6694
|
}, this.config.polling_interval_in_seconds * 1e3);
|
|
6085
6695
|
}
|
|
6086
6696
|
} catch (err) {
|
|
6087
|
-
this.logger?.error(
|
|
6697
|
+
this.logger?.error(
|
|
6698
|
+
`Initial flag definitions fetch failed: ${err.message}`
|
|
6699
|
+
);
|
|
6088
6700
|
}
|
|
6089
6701
|
}
|
|
6090
6702
|
/**
|
|
@@ -6095,7 +6707,9 @@ var require_local_flags = __commonJS({
|
|
|
6095
6707
|
clearInterval(this.pollingInterval);
|
|
6096
6708
|
this.pollingInterval = null;
|
|
6097
6709
|
} else {
|
|
6098
|
-
this.logger?.warn(
|
|
6710
|
+
this.logger?.warn(
|
|
6711
|
+
"stopPollingForDefinitions called but polling was not active"
|
|
6712
|
+
);
|
|
6099
6713
|
}
|
|
6100
6714
|
}
|
|
6101
6715
|
/**
|
|
@@ -6120,7 +6734,12 @@ var require_local_flags = __commonJS({
|
|
|
6120
6734
|
* @returns {*} The variant value
|
|
6121
6735
|
*/
|
|
6122
6736
|
getVariantValue(flagKey, fallbackValue, context, reportExposure = true) {
|
|
6123
|
-
const result = this.getVariant(
|
|
6737
|
+
const result = this.getVariant(
|
|
6738
|
+
flagKey,
|
|
6739
|
+
{ variant_value: fallbackValue },
|
|
6740
|
+
context,
|
|
6741
|
+
reportExposure
|
|
6742
|
+
);
|
|
6124
6743
|
return result.variant_value;
|
|
6125
6744
|
}
|
|
6126
6745
|
/**
|
|
@@ -6151,7 +6770,12 @@ var require_local_flags = __commonJS({
|
|
|
6151
6770
|
} else {
|
|
6152
6771
|
const rollout = this._getAssignedRollout(flag, contextValue, context);
|
|
6153
6772
|
if (rollout) {
|
|
6154
|
-
selectedVariant = this._getAssignedVariant(
|
|
6773
|
+
selectedVariant = this._getAssignedVariant(
|
|
6774
|
+
flag,
|
|
6775
|
+
contextValue,
|
|
6776
|
+
flagKey,
|
|
6777
|
+
rollout
|
|
6778
|
+
);
|
|
6155
6779
|
}
|
|
6156
6780
|
}
|
|
6157
6781
|
if (selectedVariant) {
|
|
@@ -6246,7 +6870,10 @@ var require_local_flags = __commonJS({
|
|
|
6246
6870
|
}
|
|
6247
6871
|
_getAssignedVariant(flag, contextValue, flagKey, rollout) {
|
|
6248
6872
|
if (rollout.variant_override) {
|
|
6249
|
-
const variant = this._getMatchingVariant(
|
|
6873
|
+
const variant = this._getMatchingVariant(
|
|
6874
|
+
rollout.variant_override.key,
|
|
6875
|
+
flag
|
|
6876
|
+
);
|
|
6250
6877
|
if (variant) {
|
|
6251
6878
|
return { ...variant, is_qa_tester: false };
|
|
6252
6879
|
}
|
|
@@ -6279,15 +6906,41 @@ var require_local_flags = __commonJS({
|
|
|
6279
6906
|
is_qa_tester: false
|
|
6280
6907
|
};
|
|
6281
6908
|
}
|
|
6909
|
+
_extractRuntimeParameters(context) {
|
|
6910
|
+
const customProperties = context.custom_properties;
|
|
6911
|
+
if (!customProperties || typeof customProperties !== "object") {
|
|
6912
|
+
return null;
|
|
6913
|
+
}
|
|
6914
|
+
return lowercaseAllKeysAndValues(customProperties);
|
|
6915
|
+
}
|
|
6916
|
+
_isRuntimeRuleSatisfied(rollout, context) {
|
|
6917
|
+
try {
|
|
6918
|
+
return apply(
|
|
6919
|
+
lowercaseLeafNodes(rollout.runtime_evaluation_rule),
|
|
6920
|
+
this._extractRuntimeParameters(context)
|
|
6921
|
+
);
|
|
6922
|
+
} catch (error) {
|
|
6923
|
+
this.logger?.error(`Error evaluating runtime rule: ${error.message}`);
|
|
6924
|
+
return false;
|
|
6925
|
+
}
|
|
6926
|
+
}
|
|
6282
6927
|
_isRuntimeEvaluationSatisfied(rollout, context) {
|
|
6283
|
-
if (
|
|
6928
|
+
if (rollout.runtime_evaluation_rule) {
|
|
6929
|
+
return this._isRuntimeRuleSatisfied(rollout, context);
|
|
6930
|
+
} else if (rollout.runtime_evaluation_definition) {
|
|
6931
|
+
return this._isLegacyRuntimeEvaluationSatisfied(rollout, context);
|
|
6932
|
+
} else {
|
|
6284
6933
|
return true;
|
|
6285
6934
|
}
|
|
6286
|
-
|
|
6287
|
-
|
|
6935
|
+
}
|
|
6936
|
+
_isLegacyRuntimeEvaluationSatisfied(rollout, context) {
|
|
6937
|
+
const customProperties = this._extractRuntimeParameters(context);
|
|
6938
|
+
if (!customProperties) {
|
|
6288
6939
|
return false;
|
|
6289
6940
|
}
|
|
6290
|
-
for (const [key, expectedValue] of Object.entries(
|
|
6941
|
+
for (const [key, expectedValue] of Object.entries(
|
|
6942
|
+
rollout.runtime_evaluation_definition
|
|
6943
|
+
)) {
|
|
6291
6944
|
if (!(key in customProperties)) {
|
|
6292
6945
|
return false;
|
|
6293
6946
|
}
|
|
@@ -6303,9 +6956,9 @@ var require_local_flags = __commonJS({
|
|
|
6303
6956
|
}
|
|
6304
6957
|
});
|
|
6305
6958
|
|
|
6306
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
6959
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/remote_flags.js
|
|
6307
6960
|
var require_remote_flags = __commonJS({
|
|
6308
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
6961
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/remote_flags.js"(exports$1, module) {
|
|
6309
6962
|
var FeatureFlagsProvider = require_flags();
|
|
6310
6963
|
var RemoteFeatureFlagsProvider = class extends FeatureFlagsProvider {
|
|
6311
6964
|
/**
|
|
@@ -6339,10 +6992,17 @@ var require_remote_flags = __commonJS({
|
|
|
6339
6992
|
*/
|
|
6340
6993
|
async getVariantValue(flagKey, fallbackValue, context, reportExposure = true) {
|
|
6341
6994
|
try {
|
|
6342
|
-
const selectedVariant = await this.getVariant(
|
|
6995
|
+
const selectedVariant = await this.getVariant(
|
|
6996
|
+
flagKey,
|
|
6997
|
+
{ variant_value: fallbackValue },
|
|
6998
|
+
context,
|
|
6999
|
+
reportExposure
|
|
7000
|
+
);
|
|
6343
7001
|
return selectedVariant.variant_value;
|
|
6344
7002
|
} catch (err) {
|
|
6345
|
-
this.logger?.error(
|
|
7003
|
+
this.logger?.error(
|
|
7004
|
+
`Failed to get variant value for flag '${flagKey}': ${err.message}`
|
|
7005
|
+
);
|
|
6346
7006
|
return fallbackValue;
|
|
6347
7007
|
}
|
|
6348
7008
|
}
|
|
@@ -6371,7 +7031,9 @@ var require_remote_flags = __commonJS({
|
|
|
6371
7031
|
}
|
|
6372
7032
|
return selectedVariant;
|
|
6373
7033
|
} catch (err) {
|
|
6374
|
-
this.logger?.error(
|
|
7034
|
+
this.logger?.error(
|
|
7035
|
+
`Failed to get variant for flag '${flagKey}': ${err.message}`
|
|
7036
|
+
);
|
|
6375
7037
|
return fallbackVariant;
|
|
6376
7038
|
}
|
|
6377
7039
|
}
|
|
@@ -6388,7 +7050,9 @@ var require_remote_flags = __commonJS({
|
|
|
6388
7050
|
const value = await this.getVariantValue(flagKey, false, context);
|
|
6389
7051
|
return value === true;
|
|
6390
7052
|
} catch (err) {
|
|
6391
|
-
this.logger?.error(
|
|
7053
|
+
this.logger?.error(
|
|
7054
|
+
`Failed to check if flag '${flagKey}' is enabled: ${err.message}`
|
|
7055
|
+
);
|
|
6392
7056
|
return false;
|
|
6393
7057
|
}
|
|
6394
7058
|
}
|
|
@@ -6427,9 +7091,9 @@ var require_remote_flags = __commonJS({
|
|
|
6427
7091
|
}
|
|
6428
7092
|
});
|
|
6429
7093
|
|
|
6430
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
7094
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/index.js
|
|
6431
7095
|
var require_flags2 = __commonJS({
|
|
6432
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
7096
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/flags/index.js"(exports$1, module) {
|
|
6433
7097
|
var LocalFeatureFlagsProvider = require_local_flags();
|
|
6434
7098
|
var RemoteFeatureFlagsProvider = require_remote_flags();
|
|
6435
7099
|
module.exports = {
|
|
@@ -6439,9 +7103,9 @@ var require_flags2 = __commonJS({
|
|
|
6439
7103
|
}
|
|
6440
7104
|
});
|
|
6441
7105
|
|
|
6442
|
-
// ../../node_modules/.pnpm/mixpanel@0.
|
|
7106
|
+
// ../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/mixpanel-node.js
|
|
6443
7107
|
var require_mixpanel_node = __commonJS({
|
|
6444
|
-
"../../node_modules/.pnpm/mixpanel@0.
|
|
7108
|
+
"../../node_modules/.pnpm/mixpanel@0.20.0/node_modules/mixpanel/lib/mixpanel-node.js"(exports$1, module) {
|
|
6445
7109
|
var querystring = __require("querystring");
|
|
6446
7110
|
var Buffer4 = __require("buffer").Buffer;
|
|
6447
7111
|
var http3 = __require("http");
|
|
@@ -6452,7 +7116,10 @@ var require_mixpanel_node = __commonJS({
|
|
|
6452
7116
|
var { async_all, ensure_timestamp, assert_logger } = require_utils();
|
|
6453
7117
|
var { MixpanelGroups } = require_groups();
|
|
6454
7118
|
var { MixpanelPeople } = require_people();
|
|
6455
|
-
var {
|
|
7119
|
+
var {
|
|
7120
|
+
LocalFeatureFlagsProvider,
|
|
7121
|
+
RemoteFeatureFlagsProvider
|
|
7122
|
+
} = require_flags2();
|
|
6456
7123
|
var DEFAULT_CONFIG = {
|
|
6457
7124
|
test: false,
|
|
6458
7125
|
debug: false,
|
|
@@ -6468,7 +7135,9 @@ var require_mixpanel_node = __commonJS({
|
|
|
6468
7135
|
};
|
|
6469
7136
|
var create_client = function(token, config) {
|
|
6470
7137
|
if (!token) {
|
|
6471
|
-
throw new Error(
|
|
7138
|
+
throw new Error(
|
|
7139
|
+
"The Mixpanel Client needs a Mixpanel token: `init(token)`"
|
|
7140
|
+
);
|
|
6472
7141
|
}
|
|
6473
7142
|
const metrics = {
|
|
6474
7143
|
token,
|
|
@@ -6482,9 +7151,11 @@ var require_mixpanel_node = __commonJS({
|
|
|
6482
7151
|
https: new https3.Agent({ keepAlive })
|
|
6483
7152
|
};
|
|
6484
7153
|
const proxyPath = process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
|
|
6485
|
-
const proxyAgent = proxyPath ? new HttpsProxyAgent(
|
|
6486
|
-
|
|
6487
|
-
|
|
7154
|
+
const proxyAgent = proxyPath ? new HttpsProxyAgent(
|
|
7155
|
+
Object.assign(url.parse(proxyPath), {
|
|
7156
|
+
keepAlive
|
|
7157
|
+
})
|
|
7158
|
+
) : null;
|
|
6488
7159
|
metrics.send_request = function(options, callback) {
|
|
6489
7160
|
callback = callback || function() {
|
|
6490
7161
|
};
|
|
@@ -6492,8 +7163,8 @@ var require_mixpanel_node = __commonJS({
|
|
|
6492
7163
|
const endpoint = options.endpoint;
|
|
6493
7164
|
const method = (options.method || "GET").toUpperCase();
|
|
6494
7165
|
let query_params = {
|
|
6495
|
-
|
|
6496
|
-
|
|
7166
|
+
ip: metrics.config.geolocate ? 1 : 0,
|
|
7167
|
+
verbose: metrics.config.verbose ? 1 : 0
|
|
6497
7168
|
};
|
|
6498
7169
|
const key = metrics.config.key;
|
|
6499
7170
|
const secret = metrics.config.secret;
|
|
@@ -6526,7 +7197,9 @@ var require_mixpanel_node = __commonJS({
|
|
|
6526
7197
|
} else if (key) {
|
|
6527
7198
|
query_params.api_key = key;
|
|
6528
7199
|
} else if (endpoint === "/import") {
|
|
6529
|
-
throw new Error(
|
|
7200
|
+
throw new Error(
|
|
7201
|
+
"The Mixpanel Client needs a Mixpanel API Secret when importing old events: `init(token, { secret: ... })`"
|
|
7202
|
+
);
|
|
6530
7203
|
}
|
|
6531
7204
|
request_options.agent = proxyAgent || REQUEST_AGENTS[metrics.config.protocol];
|
|
6532
7205
|
if (metrics.config.test) {
|
|
@@ -6534,20 +7207,22 @@ var require_mixpanel_node = __commonJS({
|
|
|
6534
7207
|
}
|
|
6535
7208
|
request_options.path = metrics.config.path + endpoint + "?" + querystring.stringify(query_params);
|
|
6536
7209
|
request = request_lib.request(request_options, function(res) {
|
|
6537
|
-
|
|
7210
|
+
let data = "";
|
|
6538
7211
|
res.on("data", function(chunk3) {
|
|
6539
7212
|
data += chunk3;
|
|
6540
7213
|
});
|
|
6541
7214
|
res.on("end", function() {
|
|
6542
|
-
|
|
7215
|
+
let e;
|
|
6543
7216
|
if (metrics.config.verbose) {
|
|
6544
7217
|
try {
|
|
6545
|
-
|
|
7218
|
+
const result = JSON.parse(data);
|
|
6546
7219
|
if (result.status != 1) {
|
|
6547
7220
|
e = new Error("Mixpanel Server Error: " + result.error);
|
|
6548
7221
|
}
|
|
6549
7222
|
} catch (ex) {
|
|
6550
|
-
e = new Error(
|
|
7223
|
+
e = new Error(
|
|
7224
|
+
"Could not parse response from Mixpanel " + ex.message
|
|
7225
|
+
);
|
|
6551
7226
|
}
|
|
6552
7227
|
} else {
|
|
6553
7228
|
e = data !== "1" ? new Error("Mixpanel Server Error: " + data) : void 0;
|
|
@@ -6570,39 +7245,46 @@ var require_mixpanel_node = __commonJS({
|
|
|
6570
7245
|
properties.token = metrics.token;
|
|
6571
7246
|
properties.mp_lib = "node";
|
|
6572
7247
|
properties.$lib_version = packageInfo.version;
|
|
6573
|
-
|
|
7248
|
+
const data = {
|
|
6574
7249
|
event,
|
|
6575
7250
|
properties
|
|
6576
7251
|
};
|
|
6577
7252
|
if (metrics.config.debug) {
|
|
6578
|
-
metrics.config.logger.debug("Sending the following event to Mixpanel", {
|
|
7253
|
+
metrics.config.logger.debug("Sending the following event to Mixpanel", {
|
|
7254
|
+
data
|
|
7255
|
+
});
|
|
6579
7256
|
}
|
|
6580
|
-
metrics.send_request(
|
|
7257
|
+
metrics.send_request(
|
|
7258
|
+
{ method: "GET", endpoint, data },
|
|
7259
|
+
callback
|
|
7260
|
+
);
|
|
6581
7261
|
};
|
|
6582
|
-
|
|
6583
|
-
|
|
7262
|
+
const chunk2 = function(arr, size) {
|
|
7263
|
+
let chunks = [], i = 0, total = arr.length;
|
|
6584
7264
|
while (i < total) {
|
|
6585
7265
|
chunks.push(arr.slice(i, i += size));
|
|
6586
7266
|
}
|
|
6587
7267
|
return chunks;
|
|
6588
7268
|
};
|
|
6589
|
-
|
|
6590
|
-
|
|
7269
|
+
const send_batch_requests = function(options, callback) {
|
|
7270
|
+
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;
|
|
6591
7271
|
function send_event_batch(batch, cb) {
|
|
6592
7272
|
if (batch.length > 0) {
|
|
6593
7273
|
batch = batch.map(function(event) {
|
|
6594
|
-
event.properties;
|
|
6595
7274
|
if (endpoint === "/import" || event.properties.time) {
|
|
6596
7275
|
event.properties.time = ensure_timestamp(event.properties.time);
|
|
6597
7276
|
}
|
|
6598
7277
|
event.properties.token = event.properties.token || metrics.token;
|
|
6599
7278
|
return event;
|
|
6600
7279
|
});
|
|
6601
|
-
metrics.send_request(
|
|
7280
|
+
metrics.send_request(
|
|
7281
|
+
{ method: "POST", endpoint, data: batch },
|
|
7282
|
+
cb
|
|
7283
|
+
);
|
|
6602
7284
|
}
|
|
6603
7285
|
}
|
|
6604
7286
|
function send_next_request_batch(index) {
|
|
6605
|
-
|
|
7287
|
+
const request_batch = request_batches[index], cb = function(errors, results) {
|
|
6606
7288
|
index += 1;
|
|
6607
7289
|
if (index === total_request_batches) {
|
|
6608
7290
|
callback && callback(errors, results);
|
|
@@ -6635,7 +7317,7 @@ var require_mixpanel_node = __commonJS({
|
|
|
6635
7317
|
callback = options;
|
|
6636
7318
|
options = {};
|
|
6637
7319
|
}
|
|
6638
|
-
|
|
7320
|
+
const batch_options = {
|
|
6639
7321
|
event_list,
|
|
6640
7322
|
endpoint: "/track",
|
|
6641
7323
|
max_concurrent_requests: options.max_concurrent_requests,
|
|
@@ -6652,7 +7334,7 @@ var require_mixpanel_node = __commonJS({
|
|
|
6652
7334
|
metrics.send_event_request("/import", event, properties, callback);
|
|
6653
7335
|
};
|
|
6654
7336
|
metrics.import_batch = function(event_list, options, callback) {
|
|
6655
|
-
|
|
7337
|
+
let batch_options;
|
|
6656
7338
|
if (typeof options === "function" || !options) {
|
|
6657
7339
|
callback = options;
|
|
6658
7340
|
options = {};
|
|
@@ -6666,7 +7348,7 @@ var require_mixpanel_node = __commonJS({
|
|
|
6666
7348
|
send_batch_requests(batch_options, callback);
|
|
6667
7349
|
};
|
|
6668
7350
|
metrics.alias = function(distinct_id, alias, callback) {
|
|
6669
|
-
|
|
7351
|
+
const properties = {
|
|
6670
7352
|
distinct_id,
|
|
6671
7353
|
alias
|
|
6672
7354
|
};
|
|
@@ -8675,7 +9357,7 @@ var init_is_disjoint = __esm({
|
|
|
8675
9357
|
function isObjectLike(value) {
|
|
8676
9358
|
return typeof value === "object" && value !== null;
|
|
8677
9359
|
}
|
|
8678
|
-
function
|
|
9360
|
+
function isObject2(input) {
|
|
8679
9361
|
if (!isObjectLike(input) || Object.prototype.toString.call(input) !== "[object Object]") {
|
|
8680
9362
|
return false;
|
|
8681
9363
|
}
|
|
@@ -8695,7 +9377,7 @@ var init_is_object = __esm({
|
|
|
8695
9377
|
|
|
8696
9378
|
// ../../node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/esm/lib/is_jwk.js
|
|
8697
9379
|
function isJWK(key) {
|
|
8698
|
-
return
|
|
9380
|
+
return isObject2(key) && typeof key.kty === "string";
|
|
8699
9381
|
}
|
|
8700
9382
|
function isPrivateJWK(key) {
|
|
8701
9383
|
return key.kty !== "oct" && typeof key.d === "string";
|
|
@@ -9339,7 +10021,7 @@ var init_produce = __esm({
|
|
|
9339
10021
|
ProduceJWT = class {
|
|
9340
10022
|
_payload;
|
|
9341
10023
|
constructor(payload = {}) {
|
|
9342
|
-
if (!
|
|
10024
|
+
if (!isObject2(payload)) {
|
|
9343
10025
|
throw new TypeError("JWT Claims Set MUST be an object");
|
|
9344
10026
|
}
|
|
9345
10027
|
this._payload = payload;
|
|
@@ -13394,10 +14076,10 @@ var init_esm4 = __esm({
|
|
|
13394
14076
|
}
|
|
13395
14077
|
});
|
|
13396
14078
|
|
|
13397
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14079
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js
|
|
13398
14080
|
var IdentifyOperation, SpecialEventType;
|
|
13399
14081
|
var init_event = __esm({
|
|
13400
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14082
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js"() {
|
|
13401
14083
|
(function(IdentifyOperation3) {
|
|
13402
14084
|
IdentifyOperation3["SET"] = "$set";
|
|
13403
14085
|
IdentifyOperation3["SET_ONCE"] = "$setOnce";
|
|
@@ -13418,10 +14100,10 @@ var init_event = __esm({
|
|
|
13418
14100
|
}
|
|
13419
14101
|
});
|
|
13420
14102
|
|
|
13421
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14103
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js
|
|
13422
14104
|
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;
|
|
13423
14105
|
var init_constants = __esm({
|
|
13424
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14106
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js"() {
|
|
13425
14107
|
UNSET_VALUE = "-";
|
|
13426
14108
|
AMPLITUDE_PREFIX = "AMP";
|
|
13427
14109
|
STORAGE_PREFIX = "".concat(AMPLITUDE_PREFIX, "_unsent");
|
|
@@ -13433,10 +14115,10 @@ var init_constants = __esm({
|
|
|
13433
14115
|
}
|
|
13434
14116
|
});
|
|
13435
14117
|
|
|
13436
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14118
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js
|
|
13437
14119
|
var MAX_PROPERTY_KEYS, isValidObject, isValidProperties;
|
|
13438
14120
|
var init_valid_properties = __esm({
|
|
13439
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14121
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js"() {
|
|
13440
14122
|
init_tslib_es6();
|
|
13441
14123
|
MAX_PROPERTY_KEYS = 1e3;
|
|
13442
14124
|
isValidObject = function(properties) {
|
|
@@ -13491,10 +14173,10 @@ var init_valid_properties = __esm({
|
|
|
13491
14173
|
}
|
|
13492
14174
|
});
|
|
13493
14175
|
|
|
13494
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14176
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/identify.js
|
|
13495
14177
|
var Identify, IdentifyOperation2, OrderedIdentifyOperations;
|
|
13496
14178
|
var init_identify = __esm({
|
|
13497
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14179
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/identify.js"() {
|
|
13498
14180
|
init_tslib_es6();
|
|
13499
14181
|
init_constants();
|
|
13500
14182
|
init_valid_properties();
|
|
@@ -13605,10 +14287,10 @@ var init_identify = __esm({
|
|
|
13605
14287
|
}
|
|
13606
14288
|
});
|
|
13607
14289
|
|
|
13608
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14290
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js
|
|
13609
14291
|
var SUCCESS_MESSAGE, UNEXPECTED_ERROR_MESSAGE, MAX_RETRIES_EXCEEDED_MESSAGE, OPT_OUT_MESSAGE, MISSING_API_KEY_MESSAGE, INVALID_API_KEY, CLIENT_NOT_INITIALIZED;
|
|
13610
14292
|
var init_messages = __esm({
|
|
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/types/messages.js"() {
|
|
13612
14294
|
SUCCESS_MESSAGE = "Event tracked successfully";
|
|
13613
14295
|
UNEXPECTED_ERROR_MESSAGE = "Unexpected error occurred";
|
|
13614
14296
|
MAX_RETRIES_EXCEEDED_MESSAGE = "Event rejected due to exceeded retry count";
|
|
@@ -13619,10 +14301,10 @@ var init_messages = __esm({
|
|
|
13619
14301
|
}
|
|
13620
14302
|
});
|
|
13621
14303
|
|
|
13622
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14304
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/status.js
|
|
13623
14305
|
var Status;
|
|
13624
14306
|
var init_status = __esm({
|
|
13625
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14307
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/status.js"() {
|
|
13626
14308
|
(function(Status2) {
|
|
13627
14309
|
Status2["Unknown"] = "unknown";
|
|
13628
14310
|
Status2["Skipped"] = "skipped";
|
|
@@ -13637,10 +14319,10 @@ var init_status = __esm({
|
|
|
13637
14319
|
}
|
|
13638
14320
|
});
|
|
13639
14321
|
|
|
13640
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14322
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js
|
|
13641
14323
|
var buildResult;
|
|
13642
14324
|
var init_result_builder = __esm({
|
|
13643
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14325
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js"() {
|
|
13644
14326
|
init_status();
|
|
13645
14327
|
buildResult = function(event, code, message2) {
|
|
13646
14328
|
if (code === void 0) {
|
|
@@ -13654,10 +14336,10 @@ var init_result_builder = __esm({
|
|
|
13654
14336
|
}
|
|
13655
14337
|
});
|
|
13656
14338
|
|
|
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/global-scope.js
|
|
13658
14340
|
var getGlobalScope;
|
|
13659
14341
|
var init_global_scope = __esm({
|
|
13660
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14342
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js"() {
|
|
13661
14343
|
getGlobalScope = function() {
|
|
13662
14344
|
var ampIntegrationContextName = "ampIntegrationContext";
|
|
13663
14345
|
if (typeof globalThis !== "undefined" && typeof globalThis[ampIntegrationContextName] !== "undefined") {
|
|
@@ -13680,10 +14362,10 @@ var init_global_scope = __esm({
|
|
|
13680
14362
|
}
|
|
13681
14363
|
});
|
|
13682
14364
|
|
|
13683
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14365
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js
|
|
13684
14366
|
var legacyUUID, hex, UUID2;
|
|
13685
14367
|
var init_uuid2 = __esm({
|
|
13686
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14368
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js"() {
|
|
13687
14369
|
init_tslib_es6();
|
|
13688
14370
|
init_global_scope();
|
|
13689
14371
|
legacyUUID = function(a) {
|
|
@@ -13727,10 +14409,10 @@ var init_uuid2 = __esm({
|
|
|
13727
14409
|
}
|
|
13728
14410
|
});
|
|
13729
14411
|
|
|
13730
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14412
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/timeline.js
|
|
13731
14413
|
var Timeline;
|
|
13732
14414
|
var init_timeline = __esm({
|
|
13733
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14415
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/timeline.js"() {
|
|
13734
14416
|
init_tslib_es6();
|
|
13735
14417
|
init_result_builder();
|
|
13736
14418
|
init_uuid2();
|
|
@@ -14032,10 +14714,10 @@ var init_timeline = __esm({
|
|
|
14032
14714
|
}
|
|
14033
14715
|
});
|
|
14034
14716
|
|
|
14035
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14717
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js
|
|
14036
14718
|
var createTrackEvent, createIdentifyEvent, createGroupIdentifyEvent, createGroupEvent, createRevenueEvent;
|
|
14037
14719
|
var init_event_builder = __esm({
|
|
14038
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14720
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js"() {
|
|
14039
14721
|
init_tslib_es6();
|
|
14040
14722
|
init_identify();
|
|
14041
14723
|
init_event();
|
|
@@ -14065,10 +14747,10 @@ var init_event_builder = __esm({
|
|
|
14065
14747
|
}
|
|
14066
14748
|
});
|
|
14067
14749
|
|
|
14068
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14750
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js
|
|
14069
14751
|
var returnWrapper;
|
|
14070
14752
|
var init_return_wrapper = __esm({
|
|
14071
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14753
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js"() {
|
|
14072
14754
|
returnWrapper = function(awaitable) {
|
|
14073
14755
|
return {
|
|
14074
14756
|
promise: awaitable || Promise.resolve()
|
|
@@ -14077,10 +14759,10 @@ var init_return_wrapper = __esm({
|
|
|
14077
14759
|
}
|
|
14078
14760
|
});
|
|
14079
14761
|
|
|
14080
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14762
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/core-client.js
|
|
14081
14763
|
var AmplitudeCore;
|
|
14082
14764
|
var init_core_client = __esm({
|
|
14083
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
14765
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/core-client.js"() {
|
|
14084
14766
|
init_tslib_es6();
|
|
14085
14767
|
init_event();
|
|
14086
14768
|
init_identify();
|
|
@@ -14348,10 +15030,10 @@ var init_core_client = __esm({
|
|
|
14348
15030
|
}
|
|
14349
15031
|
});
|
|
14350
15032
|
|
|
14351
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15033
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/revenue.js
|
|
14352
15034
|
var Revenue, RevenueProperty;
|
|
14353
15035
|
var init_revenue = __esm({
|
|
14354
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15036
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/revenue.js"() {
|
|
14355
15037
|
init_tslib_es6();
|
|
14356
15038
|
init_valid_properties();
|
|
14357
15039
|
Revenue = /** @class */
|
|
@@ -14428,10 +15110,10 @@ var init_revenue = __esm({
|
|
|
14428
15110
|
}
|
|
14429
15111
|
});
|
|
14430
15112
|
|
|
14431
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15113
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js
|
|
14432
15114
|
var chunk;
|
|
14433
15115
|
var init_chunk = __esm({
|
|
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/utils/chunk.js"() {
|
|
14435
15117
|
chunk = function(arr, size) {
|
|
14436
15118
|
var chunkSize = Math.max(size, 1);
|
|
14437
15119
|
return arr.reduce(function(chunks, element, index) {
|
|
@@ -14446,10 +15128,10 @@ var init_chunk = __esm({
|
|
|
14446
15128
|
}
|
|
14447
15129
|
});
|
|
14448
15130
|
|
|
14449
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15131
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js
|
|
14450
15132
|
var LogLevel;
|
|
14451
15133
|
var init_loglevel = __esm({
|
|
14452
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15134
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js"() {
|
|
14453
15135
|
(function(LogLevel2) {
|
|
14454
15136
|
LogLevel2[LogLevel2["None"] = 0] = "None";
|
|
14455
15137
|
LogLevel2[LogLevel2["Error"] = 1] = "Error";
|
|
@@ -14460,10 +15142,10 @@ var init_loglevel = __esm({
|
|
|
14460
15142
|
}
|
|
14461
15143
|
});
|
|
14462
15144
|
|
|
14463
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15145
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/logger.js
|
|
14464
15146
|
var PREFIX, Logger;
|
|
14465
15147
|
var init_logger3 = __esm({
|
|
14466
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15148
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/logger.js"() {
|
|
14467
15149
|
init_loglevel();
|
|
14468
15150
|
PREFIX = "Amplitude Logger ";
|
|
14469
15151
|
Logger = /** @class */
|
|
@@ -14525,10 +15207,10 @@ var init_logger3 = __esm({
|
|
|
14525
15207
|
}
|
|
14526
15208
|
});
|
|
14527
15209
|
|
|
14528
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15210
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/config.js
|
|
14529
15211
|
var getDefaultConfig, Config, getServerUrl, createServerConfig, RequestMetadata;
|
|
14530
15212
|
var init_config = __esm({
|
|
14531
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15213
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/config.js"() {
|
|
14532
15214
|
init_constants();
|
|
14533
15215
|
init_logger3();
|
|
14534
15216
|
init_loglevel();
|
|
@@ -14629,19 +15311,19 @@ var init_config = __esm({
|
|
|
14629
15311
|
}
|
|
14630
15312
|
});
|
|
14631
15313
|
|
|
14632
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15314
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js
|
|
14633
15315
|
function isSuccessStatusCode(code) {
|
|
14634
15316
|
return code >= 200 && code < 300;
|
|
14635
15317
|
}
|
|
14636
15318
|
var init_status_code = __esm({
|
|
14637
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15319
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js"() {
|
|
14638
15320
|
}
|
|
14639
15321
|
});
|
|
14640
15322
|
|
|
14641
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15323
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js
|
|
14642
15324
|
var getStacktrace, getClientLogConfig, getValueByStringPath, getClientStates, debugWrapper;
|
|
14643
15325
|
var init_debug = __esm({
|
|
14644
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15326
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js"() {
|
|
14645
15327
|
init_tslib_es6();
|
|
14646
15328
|
init_loglevel();
|
|
14647
15329
|
getStacktrace = function(ignoreDepth) {
|
|
@@ -14759,7 +15441,7 @@ var init_debug = __esm({
|
|
|
14759
15441
|
}
|
|
14760
15442
|
});
|
|
14761
15443
|
|
|
14762
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15444
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js
|
|
14763
15445
|
function getErrorMessage(error) {
|
|
14764
15446
|
if (error instanceof Error)
|
|
14765
15447
|
return error.message;
|
|
@@ -14777,7 +15459,7 @@ function getResponseBodyString(res) {
|
|
|
14777
15459
|
}
|
|
14778
15460
|
var Destination;
|
|
14779
15461
|
var init_destination = __esm({
|
|
14780
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15462
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js"() {
|
|
14781
15463
|
init_tslib_es6();
|
|
14782
15464
|
init_status();
|
|
14783
15465
|
init_messages();
|
|
@@ -15168,10 +15850,10 @@ var init_destination = __esm({
|
|
|
15168
15850
|
}
|
|
15169
15851
|
});
|
|
15170
15852
|
|
|
15171
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15853
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js
|
|
15172
15854
|
var BaseTransport;
|
|
15173
15855
|
var init_base2 = __esm({
|
|
15174
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15856
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js"() {
|
|
15175
15857
|
init_status();
|
|
15176
15858
|
init_status_code();
|
|
15177
15859
|
BaseTransport = /** @class */
|
|
@@ -15273,10 +15955,10 @@ var init_base2 = __esm({
|
|
|
15273
15955
|
}
|
|
15274
15956
|
});
|
|
15275
15957
|
|
|
15276
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15958
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js
|
|
15277
15959
|
var ServerZone;
|
|
15278
15960
|
var init_server_zone = __esm({
|
|
15279
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15961
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js"() {
|
|
15280
15962
|
(function(ServerZone2) {
|
|
15281
15963
|
ServerZone2["US"] = "US";
|
|
15282
15964
|
ServerZone2["EU"] = "EU";
|
|
@@ -15285,17 +15967,17 @@ var init_server_zone = __esm({
|
|
|
15285
15967
|
}
|
|
15286
15968
|
});
|
|
15287
15969
|
|
|
15288
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15970
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js
|
|
15289
15971
|
var OfflineDisabled;
|
|
15290
15972
|
var init_offline = __esm({
|
|
15291
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15973
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js"() {
|
|
15292
15974
|
OfflineDisabled = null;
|
|
15293
15975
|
}
|
|
15294
15976
|
});
|
|
15295
15977
|
|
|
15296
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15978
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/index.js
|
|
15297
15979
|
var init_esm5 = __esm({
|
|
15298
|
-
"../../node_modules/.pnpm/@amplitude+analytics-core@2.
|
|
15980
|
+
"../../node_modules/.pnpm/@amplitude+analytics-core@2.36.0/node_modules/@amplitude/analytics-core/lib/esm/index.js"() {
|
|
15299
15981
|
init_core_client();
|
|
15300
15982
|
init_identify();
|
|
15301
15983
|
init_revenue();
|
|
@@ -15312,18 +15994,18 @@ var init_esm5 = __esm({
|
|
|
15312
15994
|
}
|
|
15313
15995
|
});
|
|
15314
15996
|
|
|
15315
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
15997
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/version.js
|
|
15316
15998
|
var VERSION;
|
|
15317
15999
|
var init_version3 = __esm({
|
|
15318
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
15319
|
-
VERSION = "1.5.
|
|
16000
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/version.js"() {
|
|
16001
|
+
VERSION = "1.5.32";
|
|
15320
16002
|
}
|
|
15321
16003
|
});
|
|
15322
16004
|
|
|
15323
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16005
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js
|
|
15324
16006
|
var Context2;
|
|
15325
16007
|
var init_context4 = __esm({
|
|
15326
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16008
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/plugins/context.js"() {
|
|
15327
16009
|
init_tslib_es6();
|
|
15328
16010
|
init_esm5();
|
|
15329
16011
|
init_version3();
|
|
@@ -15358,7 +16040,7 @@ var init_context4 = __esm({
|
|
|
15358
16040
|
});
|
|
15359
16041
|
var Http;
|
|
15360
16042
|
var init_http = __esm({
|
|
15361
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16043
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/transports/http.js"() {
|
|
15362
16044
|
init_tslib_es6();
|
|
15363
16045
|
init_esm5();
|
|
15364
16046
|
Http = /** @class */
|
|
@@ -15420,10 +16102,10 @@ var init_http = __esm({
|
|
|
15420
16102
|
}
|
|
15421
16103
|
});
|
|
15422
16104
|
|
|
15423
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16105
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/config.js
|
|
15424
16106
|
var NodeConfig, useNodeConfig;
|
|
15425
16107
|
var init_config2 = __esm({
|
|
15426
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16108
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/config.js"() {
|
|
15427
16109
|
init_tslib_es6();
|
|
15428
16110
|
init_esm5();
|
|
15429
16111
|
init_http();
|
|
@@ -15441,10 +16123,10 @@ var init_config2 = __esm({
|
|
|
15441
16123
|
}
|
|
15442
16124
|
});
|
|
15443
16125
|
|
|
15444
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16126
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/node-client.js
|
|
15445
16127
|
var AmplitudeNode, createInstance, node_client_default;
|
|
15446
16128
|
var init_node_client = __esm({
|
|
15447
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16129
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/node-client.js"() {
|
|
15448
16130
|
init_tslib_es6();
|
|
15449
16131
|
init_esm5();
|
|
15450
16132
|
init_context4();
|
|
@@ -15518,7 +16200,7 @@ var init_node_client = __esm({
|
|
|
15518
16200
|
}
|
|
15519
16201
|
});
|
|
15520
16202
|
|
|
15521
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16203
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/types.js
|
|
15522
16204
|
var types_exports = {};
|
|
15523
16205
|
__export(types_exports, {
|
|
15524
16206
|
IdentifyOperation: () => IdentifyOperation,
|
|
@@ -15529,12 +16211,12 @@ __export(types_exports, {
|
|
|
15529
16211
|
SpecialEventType: () => SpecialEventType
|
|
15530
16212
|
});
|
|
15531
16213
|
var init_types4 = __esm({
|
|
15532
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16214
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/types.js"() {
|
|
15533
16215
|
init_esm5();
|
|
15534
16216
|
}
|
|
15535
16217
|
});
|
|
15536
16218
|
|
|
15537
|
-
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16219
|
+
// ../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/index.js
|
|
15538
16220
|
var esm_exports2 = {};
|
|
15539
16221
|
__export(esm_exports2, {
|
|
15540
16222
|
Identify: () => Identify,
|
|
@@ -15555,7 +16237,7 @@ __export(esm_exports2, {
|
|
|
15555
16237
|
});
|
|
15556
16238
|
var add, groupIdentify, identify, init, logEvent, remove, revenue, setGroup, setOptOut, track, flush;
|
|
15557
16239
|
var init_esm6 = __esm({
|
|
15558
|
-
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.
|
|
16240
|
+
"../../node_modules/.pnpm/@amplitude+analytics-node@1.5.32/node_modules/@amplitude/analytics-node/lib/esm/index.js"() {
|
|
15559
16241
|
init_node_client();
|
|
15560
16242
|
init_node_client();
|
|
15561
16243
|
init_esm5();
|