configcat-vue 2.1.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/configcat-vue.js +333 -339
- package/dist/configcat-vue.umd.cjs +6 -6
- package/dist/index.d.ts +1 -5
- package/package.json +2 -2
package/dist/configcat-vue.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
var
|
|
3
|
-
return
|
|
1
|
+
import { defineComponent as Ut, ref as Mt, inject as xt, onBeforeMount as Wt, onUnmounted as Vt, renderSlot as pe } from "vue";
|
|
2
|
+
var Oe = function(t, e) {
|
|
3
|
+
return Oe = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
|
|
4
4
|
r.__proto__ = n;
|
|
5
5
|
} || function(r, n) {
|
|
6
6
|
for (var i in n)
|
|
7
7
|
Object.prototype.hasOwnProperty.call(n, i) && (r[i] = n[i]);
|
|
8
|
-
},
|
|
8
|
+
}, Oe(t, e);
|
|
9
9
|
};
|
|
10
10
|
function q(t, e) {
|
|
11
11
|
if (typeof e != "function" && e !== null)
|
|
12
12
|
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
13
|
-
|
|
13
|
+
Oe(t, e);
|
|
14
14
|
function r() {
|
|
15
15
|
this.constructor = t;
|
|
16
16
|
}
|
|
@@ -118,7 +118,7 @@ function O(t, e) {
|
|
|
118
118
|
return { value: l[0] ? l[1] : void 0, done: !0 };
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function vt() {
|
|
122
122
|
for (var t = 0, e = 0, r = arguments.length; e < r; e++)
|
|
123
123
|
t += arguments[e].length;
|
|
124
124
|
for (var n = Array(t), i = 0, e = 0; e < r; e++)
|
|
@@ -147,7 +147,7 @@ var V = (
|
|
|
147
147
|
return new t(j.Errored, e, r ?? "Unknown error.", n);
|
|
148
148
|
}, t;
|
|
149
149
|
}()
|
|
150
|
-
),
|
|
150
|
+
), se = (
|
|
151
151
|
/** @class */
|
|
152
152
|
function(t) {
|
|
153
153
|
q(e, t);
|
|
@@ -192,7 +192,7 @@ var W;
|
|
|
192
192
|
(function(t) {
|
|
193
193
|
t[t.IsIn = 0] = "IsIn", t[t.IsNotIn = 1] = "IsNotIn";
|
|
194
194
|
})(W || (W = {}));
|
|
195
|
-
var
|
|
195
|
+
var D = (
|
|
196
196
|
/** @class */
|
|
197
197
|
function() {
|
|
198
198
|
function t(e, r, n, i) {
|
|
@@ -231,19 +231,19 @@ var k = (
|
|
|
231
231
|
var u = o.length > 0 ? o : void 0;
|
|
232
232
|
n = s + 1, o = e.substring(n);
|
|
233
233
|
var l, f;
|
|
234
|
-
return o.length > 0 && (l =
|
|
234
|
+
return o.length > 0 && (l = oe.deserialize(o), f = o), new t(f, l, a, u);
|
|
235
235
|
}, t.serializationFormatVersion = "v2", t.empty = new t(void 0, void 0, 0, void 0), t;
|
|
236
236
|
}()
|
|
237
|
-
),
|
|
237
|
+
), oe = (
|
|
238
238
|
/** @class */
|
|
239
239
|
function() {
|
|
240
240
|
function t(e) {
|
|
241
241
|
var r = this, n, i;
|
|
242
|
-
this.preferences = e.p != null ? new
|
|
243
|
-
return new
|
|
242
|
+
this.preferences = e.p != null ? new jt(e.p) : void 0, this.segments = (i = (n = e.s) === null || n === void 0 ? void 0 : n.map(function(s) {
|
|
243
|
+
return new Bt(s);
|
|
244
244
|
})) !== null && i !== void 0 ? i : [], this.settings = e.f != null ? Object.fromEntries(Object.entries(e.f).map(function(s) {
|
|
245
245
|
var o = s[0], a = s[1];
|
|
246
|
-
return [o, new
|
|
246
|
+
return [o, new dt(a, r)];
|
|
247
247
|
})) : {};
|
|
248
248
|
}
|
|
249
249
|
return t.deserialize = function(e) {
|
|
@@ -260,7 +260,7 @@ var k = (
|
|
|
260
260
|
configurable: !0
|
|
261
261
|
}), t;
|
|
262
262
|
}()
|
|
263
|
-
),
|
|
263
|
+
), jt = (
|
|
264
264
|
/** @class */
|
|
265
265
|
function() {
|
|
266
266
|
function t(e) {
|
|
@@ -268,26 +268,26 @@ var k = (
|
|
|
268
268
|
}
|
|
269
269
|
return t;
|
|
270
270
|
}()
|
|
271
|
-
),
|
|
271
|
+
), Bt = (
|
|
272
272
|
/** @class */
|
|
273
273
|
function() {
|
|
274
274
|
function t(e) {
|
|
275
275
|
var r, n;
|
|
276
276
|
this.name = e.n, this.conditions = (n = (r = e.r) === null || r === void 0 ? void 0 : r.map(function(i) {
|
|
277
|
-
return new
|
|
277
|
+
return new yt(i);
|
|
278
278
|
})) !== null && n !== void 0 ? n : [];
|
|
279
279
|
}
|
|
280
280
|
return t;
|
|
281
281
|
}()
|
|
282
|
-
),
|
|
282
|
+
), Ie = (
|
|
283
283
|
/** @class */
|
|
284
284
|
function() {
|
|
285
285
|
function t(e, r) {
|
|
286
|
-
r === void 0 && (r = !1), this.value = r ? e.v :
|
|
286
|
+
r === void 0 && (r = !1), this.value = r ? e.v : mt(e.v), this.variationId = e.i;
|
|
287
287
|
}
|
|
288
288
|
return t;
|
|
289
289
|
}()
|
|
290
|
-
),
|
|
290
|
+
), dt = (
|
|
291
291
|
/** @class */
|
|
292
292
|
function(t) {
|
|
293
293
|
q(e, t);
|
|
@@ -296,9 +296,9 @@ var k = (
|
|
|
296
296
|
f.type = r.t;
|
|
297
297
|
var h = "Identifier";
|
|
298
298
|
return f.percentageOptionsAttribute = (i = r.a) !== null && i !== void 0 ? i : h, f.targetingRules = (o = (s = r.r) === null || s === void 0 ? void 0 : s.map(function(g) {
|
|
299
|
-
return new
|
|
299
|
+
return new _t(g, n);
|
|
300
300
|
})) !== null && o !== void 0 ? o : [], f.percentageOptions = (u = (a = r.p) === null || a === void 0 ? void 0 : a.map(function(g) {
|
|
301
|
-
return new
|
|
301
|
+
return new pt(g);
|
|
302
302
|
})) !== null && u !== void 0 ? u : [], f.configJsonSalt = (l = n == null ? void 0 : n.salt) !== null && l !== void 0 ? l : "", f;
|
|
303
303
|
}
|
|
304
304
|
return e.fromValue = function(r) {
|
|
@@ -307,21 +307,21 @@ var k = (
|
|
|
307
307
|
v: r
|
|
308
308
|
});
|
|
309
309
|
}, e;
|
|
310
|
-
}(
|
|
311
|
-
),
|
|
310
|
+
}(Ie)
|
|
311
|
+
), _t = (
|
|
312
312
|
/** @class */
|
|
313
313
|
function() {
|
|
314
314
|
function t(e, r) {
|
|
315
315
|
var n, i;
|
|
316
316
|
this.conditions = (i = (n = e.c) === null || n === void 0 ? void 0 : n.map(function(s) {
|
|
317
|
-
return s.u != null ? new
|
|
317
|
+
return s.u != null ? new yt(s.u) : s.p != null ? new Ht(s.p) : s.s != null ? new Kt(s.s, r) : void 0;
|
|
318
318
|
})) !== null && i !== void 0 ? i : [], this.then = e.p != null ? e.p.map(function(s) {
|
|
319
|
-
return new
|
|
320
|
-
}) : new
|
|
319
|
+
return new pt(s);
|
|
320
|
+
}) : new Ie(e.s);
|
|
321
321
|
}
|
|
322
322
|
return t;
|
|
323
323
|
}()
|
|
324
|
-
),
|
|
324
|
+
), pt = (
|
|
325
325
|
/** @class */
|
|
326
326
|
function(t) {
|
|
327
327
|
q(e, t);
|
|
@@ -330,8 +330,8 @@ var k = (
|
|
|
330
330
|
return n.percentage = r.p, n;
|
|
331
331
|
}
|
|
332
332
|
return e;
|
|
333
|
-
}(
|
|
334
|
-
),
|
|
333
|
+
}(Ie)
|
|
334
|
+
), yt = (
|
|
335
335
|
/** @class */
|
|
336
336
|
function() {
|
|
337
337
|
function t(e) {
|
|
@@ -340,15 +340,15 @@ var k = (
|
|
|
340
340
|
}
|
|
341
341
|
return t;
|
|
342
342
|
}()
|
|
343
|
-
),
|
|
343
|
+
), Ht = (
|
|
344
344
|
/** @class */
|
|
345
345
|
function() {
|
|
346
346
|
function t(e) {
|
|
347
|
-
this.type = "PrerequisiteFlagCondition", this.prerequisiteFlagKey = e.f, this.comparator = e.c, this.comparisonValue =
|
|
347
|
+
this.type = "PrerequisiteFlagCondition", this.prerequisiteFlagKey = e.f, this.comparator = e.c, this.comparisonValue = mt(e.v);
|
|
348
348
|
}
|
|
349
349
|
return t;
|
|
350
350
|
}()
|
|
351
|
-
),
|
|
351
|
+
), Kt = (
|
|
352
352
|
/** @class */
|
|
353
353
|
function() {
|
|
354
354
|
function t(e, r) {
|
|
@@ -357,11 +357,11 @@ var k = (
|
|
|
357
357
|
return t;
|
|
358
358
|
}()
|
|
359
359
|
);
|
|
360
|
-
function
|
|
360
|
+
function mt(t) {
|
|
361
361
|
var e, r, n;
|
|
362
362
|
return (n = (r = (e = t.b) !== null && e !== void 0 ? e : t.s) !== null && r !== void 0 ? r : t.i) !== null && n !== void 0 ? n : t.d;
|
|
363
363
|
}
|
|
364
|
-
var
|
|
364
|
+
var ue = (
|
|
365
365
|
/** @class */
|
|
366
366
|
function() {
|
|
367
367
|
function t(e, r) {
|
|
@@ -390,7 +390,7 @@ var L;
|
|
|
390
390
|
(function(t) {
|
|
391
391
|
t[t.Online = 0] = "Online", t[t.Offline = 1] = "Offline", t[t.Disposed = 2] = "Disposed";
|
|
392
392
|
})(L || (L = {}));
|
|
393
|
-
var
|
|
393
|
+
var we = (
|
|
394
394
|
/** @class */
|
|
395
395
|
function() {
|
|
396
396
|
function t(e, r) {
|
|
@@ -414,9 +414,9 @@ var Ne = (
|
|
|
414
414
|
case 1:
|
|
415
415
|
return e = o.sent(), this.isOffline ? [3, 3] : [4, this.refreshConfigCoreAsync(e)];
|
|
416
416
|
case 2:
|
|
417
|
-
return r = o.sent(), n = r[0], i = r[1], [2, [
|
|
417
|
+
return r = o.sent(), n = r[0], i = r[1], [2, [ue.from(n), i]];
|
|
418
418
|
case 3:
|
|
419
|
-
return s = this.options.logger.configServiceCannotInitiateHttpCalls().toString(), [2, [
|
|
419
|
+
return s = this.options.logger.configServiceCannotInitiateHttpCalls().toString(), [2, [ue.failure(s), e]];
|
|
420
420
|
}
|
|
421
421
|
});
|
|
422
422
|
});
|
|
@@ -430,7 +430,7 @@ var Ne = (
|
|
|
430
430
|
case 1:
|
|
431
431
|
return r = s.sent(), n = !1, i = r.status === j.Fetched, i || r.config.timestamp > e.timestamp && (!r.config.isEmpty || e.isEmpty) ? [4, this.options.cache.set(this.cacheKey, r.config)] : [3, 3];
|
|
432
432
|
case 2:
|
|
433
|
-
s.sent(), n = i && !
|
|
433
|
+
s.sent(), n = i && !D.equals(r.config, e), e = r.config, s.label = 3;
|
|
434
434
|
case 3:
|
|
435
435
|
return this.onConfigFetched(r.config), n && this.onConfigChanged(r.config), [2, [r, e]];
|
|
436
436
|
}
|
|
@@ -439,7 +439,7 @@ var Ne = (
|
|
|
439
439
|
}, t.prototype.onConfigFetched = function(e) {
|
|
440
440
|
}, t.prototype.onConfigChanged = function(e) {
|
|
441
441
|
var r;
|
|
442
|
-
this.options.logger.debug("config changed"), this.options.hooks.emit("configChanged", (r = e.config) !== null && r !== void 0 ? r : new
|
|
442
|
+
this.options.logger.debug("config changed"), this.options.hooks.emit("configChanged", (r = e.config) !== null && r !== void 0 ? r : new oe({}));
|
|
443
443
|
}, t.prototype.fetchAsync = function(e) {
|
|
444
444
|
var r = this, n;
|
|
445
445
|
return (n = this.pendingFetch) !== null && n !== void 0 ? n : this.pendingFetch = function() {
|
|
@@ -477,18 +477,18 @@ var Ne = (
|
|
|
477
477
|
case 2:
|
|
478
478
|
switch (s = l.sent(), o = s[0], a = s[1], o.statusCode) {
|
|
479
479
|
case 200:
|
|
480
|
-
return a instanceof
|
|
480
|
+
return a instanceof oe ? (n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was successful. Returning new config."), [2, V.success(new D(o.body, a, D.generateTimestamp(), o.eTag))]) : (i = n.logger.fetchReceived200WithInvalidBody(a).toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): " + o.statusCode + " " + o.reasonPhrase + " was received but the HTTP response content was invalid. Returning null."), [2, V.error(e, i, a)]);
|
|
481
481
|
case 304:
|
|
482
|
-
return e ? (n.logger.debug("ConfigServiceBase.fetchLogicAsync(): content was not modified. Returning last config with updated timestamp."), [2, V.notModified(e.with(
|
|
482
|
+
return e ? (n.logger.debug("ConfigServiceBase.fetchLogicAsync(): content was not modified. Returning last config with updated timestamp."), [2, V.notModified(e.with(D.generateTimestamp()))]) : (i = n.logger.fetchReceived304WhenLocalCacheIsEmpty(o.statusCode, o.reasonPhrase).toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): " + o.statusCode + " " + o.reasonPhrase + " was received when no config is cached locally. Returning null."), [2, V.error(e, i)]);
|
|
483
483
|
case 403:
|
|
484
484
|
case 404:
|
|
485
|
-
return i = n.logger.fetchFailedDueToInvalidSdkKey().toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was unsuccessful. Returning last config (if any) with updated timestamp."), [2, V.error(e.with(
|
|
485
|
+
return i = n.logger.fetchFailedDueToInvalidSdkKey().toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was unsuccessful. Returning last config (if any) with updated timestamp."), [2, V.error(e.with(D.generateTimestamp()), i)];
|
|
486
486
|
default:
|
|
487
487
|
return i = n.logger.fetchFailedDueToUnexpectedHttpResponse(o.statusCode, o.reasonPhrase).toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was unsuccessful. Returning null."), [2, V.error(e, i)];
|
|
488
488
|
}
|
|
489
489
|
return [3, 4];
|
|
490
490
|
case 3:
|
|
491
|
-
return u = l.sent(), i = (u instanceof
|
|
491
|
+
return u = l.sent(), i = (u instanceof se && u.cause === "timeout" ? n.logger.fetchFailedDueToRequestTimeout(u.args[0], u) : n.logger.fetchFailedDueToUnexpectedError(u)).toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was unsuccessful. Returning null."), [2, V.error(e, i, u)];
|
|
492
492
|
case 4:
|
|
493
493
|
return [
|
|
494
494
|
2
|
|
@@ -513,7 +513,7 @@ var Ne = (
|
|
|
513
513
|
return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): no response body."), [2, [s, new Error("No response body.")]];
|
|
514
514
|
o = void 0;
|
|
515
515
|
try {
|
|
516
|
-
o =
|
|
516
|
+
o = oe.deserialize(s.body);
|
|
517
517
|
} catch (h) {
|
|
518
518
|
return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): invalid response body."), [2, [s, h]];
|
|
519
519
|
}
|
|
@@ -573,7 +573,7 @@ var Ne = (
|
|
|
573
573
|
}, t;
|
|
574
574
|
}()
|
|
575
575
|
);
|
|
576
|
-
function
|
|
576
|
+
function zt(t, e) {
|
|
577
577
|
var r, n = new Promise(function(i) {
|
|
578
578
|
return r = setTimeout(i, t);
|
|
579
579
|
});
|
|
@@ -581,20 +581,20 @@ function Jt(t, e) {
|
|
|
581
581
|
return clearTimeout(r);
|
|
582
582
|
}), n;
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function B(t, e) {
|
|
585
585
|
return e === void 0 && (e = !1), t instanceof Error ? e && t.stack ? t.stack : t.toString() : t + "";
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function Ue(t) {
|
|
588
588
|
throw t;
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function ve(t) {
|
|
591
591
|
return Array.isArray(t);
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function Gt(t) {
|
|
594
594
|
var e;
|
|
595
595
|
return typeof ((e = t) === null || e === void 0 ? void 0 : e.then) == "function";
|
|
596
596
|
}
|
|
597
|
-
function
|
|
597
|
+
function Ce(t, e, r, n) {
|
|
598
598
|
e === void 0 && (e = 0), n === void 0 && (n = ", ");
|
|
599
599
|
var i = t.length;
|
|
600
600
|
if (!i)
|
|
@@ -619,10 +619,10 @@ function X(t) {
|
|
|
619
619
|
}
|
|
620
620
|
return r += t.slice(n, s);
|
|
621
621
|
}
|
|
622
|
-
function
|
|
622
|
+
function Et(t) {
|
|
623
623
|
return typeof t == "number" ? t : typeof t != "string" || !t.length || /^\s*$|^\s*0[^\d.e]/.test(t) ? NaN : +t;
|
|
624
624
|
}
|
|
625
|
-
var
|
|
625
|
+
var Jt = (
|
|
626
626
|
/** @class */
|
|
627
627
|
function(t) {
|
|
628
628
|
q(e, t);
|
|
@@ -668,7 +668,7 @@ var $t = (
|
|
|
668
668
|
r.then(function() {
|
|
669
669
|
return !0;
|
|
670
670
|
}),
|
|
671
|
-
|
|
671
|
+
zt(this.options.maxInitWaitTimeSeconds * 1e3, n).then(function() {
|
|
672
672
|
return !1;
|
|
673
673
|
})
|
|
674
674
|
])];
|
|
@@ -762,12 +762,12 @@ var $t = (
|
|
|
762
762
|
}, e.prototype.getCacheState = function(r) {
|
|
763
763
|
return r.isEmpty ? C.NoFlagData : r.isExpired(this.pollIntervalMs) ? C.HasCachedFlagDataOnly : C.HasUpToDateFlagData;
|
|
764
764
|
}, e;
|
|
765
|
-
}(
|
|
766
|
-
),
|
|
765
|
+
}(we)
|
|
766
|
+
), Yt = (
|
|
767
767
|
/** @class */
|
|
768
768
|
function() {
|
|
769
769
|
function t() {
|
|
770
|
-
this.cachedConfig =
|
|
770
|
+
this.cachedConfig = D.empty;
|
|
771
771
|
}
|
|
772
772
|
return t.prototype.set = function(e, r) {
|
|
773
773
|
this.cachedConfig = r;
|
|
@@ -777,11 +777,11 @@ var $t = (
|
|
|
777
777
|
return this.cachedConfig;
|
|
778
778
|
}, t;
|
|
779
779
|
}()
|
|
780
|
-
),
|
|
780
|
+
), Ot = (
|
|
781
781
|
/** @class */
|
|
782
782
|
function() {
|
|
783
783
|
function t(e, r) {
|
|
784
|
-
this.cache = e, this.logger = r, this.cachedConfig =
|
|
784
|
+
this.cache = e, this.logger = r, this.cachedConfig = D.empty;
|
|
785
785
|
}
|
|
786
786
|
return t.prototype.set = function(e, r) {
|
|
787
787
|
return E(this, void 0, void 0, function() {
|
|
@@ -790,7 +790,7 @@ var $t = (
|
|
|
790
790
|
switch (i.label) {
|
|
791
791
|
case 0:
|
|
792
792
|
if (i.trys.push([0, 2, , 3]), !r.isEmpty)
|
|
793
|
-
this.cachedSerializedConfig =
|
|
793
|
+
this.cachedSerializedConfig = D.serialize(r), this.cachedConfig = r;
|
|
794
794
|
else
|
|
795
795
|
return this.cachedSerializedConfig = void 0, this.cachedConfig = r, [
|
|
796
796
|
2
|
|
@@ -810,12 +810,12 @@ var $t = (
|
|
|
810
810
|
});
|
|
811
811
|
});
|
|
812
812
|
}, t.prototype.updateCachedConfig = function(e) {
|
|
813
|
-
e == null || e === this.cachedSerializedConfig || (this.cachedConfig =
|
|
813
|
+
e == null || e === this.cachedSerializedConfig || (this.cachedConfig = D.deserialize(e), this.cachedSerializedConfig = e);
|
|
814
814
|
}, t.prototype.get = function(e) {
|
|
815
815
|
var r = this;
|
|
816
816
|
try {
|
|
817
817
|
var n = this.cache.get(e);
|
|
818
|
-
if (
|
|
818
|
+
if (Gt(n))
|
|
819
819
|
return function(i) {
|
|
820
820
|
return E(r, void 0, void 0, function() {
|
|
821
821
|
var s, o;
|
|
@@ -877,7 +877,7 @@ var T = (
|
|
|
877
877
|
return this.defaultFormattedMessage;
|
|
878
878
|
}, t;
|
|
879
879
|
}()
|
|
880
|
-
),
|
|
880
|
+
), $t = (
|
|
881
881
|
/** @class */
|
|
882
882
|
function() {
|
|
883
883
|
function t(e, r) {
|
|
@@ -898,23 +898,23 @@ var T = (
|
|
|
898
898
|
}, t.prototype.debug = function(e) {
|
|
899
899
|
this.log(p.Debug, 0, e);
|
|
900
900
|
}, t.prototype.configJsonIsNotPresent = function(e) {
|
|
901
|
-
return this.log(p.Error, 1e3, T.from("DEFAULT_RETURN_VALUE")(
|
|
901
|
+
return this.log(p.Error, 1e3, T.from("DEFAULT_RETURN_VALUE")(Me || (Me = b(["Config JSON is not present. Returning ", "."], ["Config JSON is not present. Returning ", "."])), e));
|
|
902
902
|
}, t.prototype.configJsonIsNotPresentSingle = function(e, r, n) {
|
|
903
|
-
return this.log(p.Error, 1e3, T.from("KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE")(
|
|
903
|
+
return this.log(p.Error, 1e3, T.from("KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE")(xe || (xe = b(["Config JSON is not present when evaluating setting '", "'. Returning the `", "` parameter that you specified in your application: '", "'."], ["Config JSON is not present when evaluating setting '", "'. Returning the \\`", "\\` parameter that you specified in your application: '", "'."])), e, r, n));
|
|
904
904
|
}, t.prototype.settingEvaluationFailedDueToMissingKey = function(e, r, n, i) {
|
|
905
|
-
return this.log(p.Error, 1001, T.from("KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE", "AVAILABLE_KEYS")(
|
|
905
|
+
return this.log(p.Error, 1001, T.from("KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE", "AVAILABLE_KEYS")(We || (We = b(["Failed to evaluate setting '", "' (the key was not found in config JSON). Returning the `", "` parameter that you specified in your application: '", "'. Available keys: [", "]."], ["Failed to evaluate setting '", "' (the key was not found in config JSON). Returning the \\`", "\\` parameter that you specified in your application: '", "'. Available keys: [", "]."])), e, r, n, i));
|
|
906
906
|
}, t.prototype.settingEvaluationError = function(e, r, n) {
|
|
907
|
-
return this.log(p.Error, 1002, T.from("METHOD_NAME", "DEFAULT_RETURN_VALUE")(
|
|
907
|
+
return this.log(p.Error, 1002, T.from("METHOD_NAME", "DEFAULT_RETURN_VALUE")(Ve || (Ve = b(["Error occurred in the `", "` method. Returning ", "."], ["Error occurred in the \\`", "\\` method. Returning ", "."])), e, r), n);
|
|
908
908
|
}, t.prototype.settingEvaluationErrorSingle = function(e, r, n, i, s) {
|
|
909
|
-
return this.log(p.Error, 1002, T.from("METHOD_NAME", "KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE")(
|
|
909
|
+
return this.log(p.Error, 1002, T.from("METHOD_NAME", "KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE")(je || (je = b(["Error occurred in the `", "` method while evaluating setting '", "'. Returning the `", "` parameter that you specified in your application: '", "'."], ["Error occurred in the \\`", "\\` method while evaluating setting '", "'. Returning the \\`", "\\` parameter that you specified in your application: '", "'."])), e, r, n, i), s);
|
|
910
910
|
}, t.prototype.forceRefreshError = function(e, r) {
|
|
911
|
-
return this.log(p.Error, 1003, T.from("METHOD_NAME")(
|
|
911
|
+
return this.log(p.Error, 1003, T.from("METHOD_NAME")(Be || (Be = b(["Error occurred in the `", "` method."], ["Error occurred in the \\`", "\\` method."])), e), r);
|
|
912
912
|
}, t.prototype.fetchFailedDueToInvalidSdkKey = function() {
|
|
913
913
|
return this.log(p.Error, 1100, "Your SDK Key seems to be wrong. You can find the valid SDK Key at https://app.configcat.com/sdkkey");
|
|
914
914
|
}, t.prototype.fetchFailedDueToUnexpectedHttpResponse = function(e, r) {
|
|
915
|
-
return this.log(p.Error, 1101, T.from("STATUS_CODE", "REASON_PHRASE")(
|
|
915
|
+
return this.log(p.Error, 1101, T.from("STATUS_CODE", "REASON_PHRASE")(_e || (_e = b(["Unexpected HTTP response was received while trying to fetch config JSON: ", " ", ""], ["Unexpected HTTP response was received while trying to fetch config JSON: ", " ", ""])), e, r));
|
|
916
916
|
}, t.prototype.fetchFailedDueToRequestTimeout = function(e, r) {
|
|
917
|
-
return this.log(p.Error, 1102, T.from("TIMEOUT")(
|
|
917
|
+
return this.log(p.Error, 1102, T.from("TIMEOUT")(He || (He = b(["Request timed out while trying to fetch config JSON. Timeout value: ", "ms"], ["Request timed out while trying to fetch config JSON. Timeout value: ", "ms"])), e), r);
|
|
918
918
|
}, t.prototype.fetchFailedDueToUnexpectedError = function(e) {
|
|
919
919
|
return this.log(p.Error, 1103, "Unexpected error occurred while trying to fetch config JSON. It is most likely due to a local network issue. Please make sure your application can reach the ConfigCat CDN servers (or your proxy server) over HTTP.", e);
|
|
920
920
|
}, t.prototype.fetchFailedDueToRedirectLoop = function() {
|
|
@@ -922,40 +922,40 @@ var T = (
|
|
|
922
922
|
}, t.prototype.fetchReceived200WithInvalidBody = function(e) {
|
|
923
923
|
return this.log(p.Error, 1105, "Fetching config JSON was successful but the HTTP response content was invalid.", e);
|
|
924
924
|
}, t.prototype.fetchReceived304WhenLocalCacheIsEmpty = function(e, r) {
|
|
925
|
-
return this.log(p.Error, 1106, T.from("STATUS_CODE", "REASON_PHRASE")(
|
|
925
|
+
return this.log(p.Error, 1106, T.from("STATUS_CODE", "REASON_PHRASE")(Ke || (Ke = b(["Unexpected HTTP response was received when no config JSON is cached locally: ", " ", ""], ["Unexpected HTTP response was received when no config JSON is cached locally: ", " ", ""])), e, r));
|
|
926
926
|
}, t.prototype.settingForVariationIdIsNotPresent = function(e) {
|
|
927
|
-
return this.log(p.Error, 2011, T.from("VARIATION_ID")(
|
|
927
|
+
return this.log(p.Error, 2011, T.from("VARIATION_ID")(ze || (ze = b(["Could not find the setting for the specified variation ID: '", "'."], ["Could not find the setting for the specified variation ID: '", "'."])), e));
|
|
928
928
|
}, t.prototype.configServiceCacheReadError = function(e) {
|
|
929
929
|
return this.log(p.Error, 2200, "Error occurred while reading the cache.", e);
|
|
930
930
|
}, t.prototype.configServiceCacheWriteError = function(e) {
|
|
931
931
|
return this.log(p.Error, 2201, "Error occurred while writing the cache.", e);
|
|
932
932
|
}, t.prototype.clientIsAlreadyCreated = function(e) {
|
|
933
|
-
return this.log(p.Warn, 3e3, T.from("SDK_KEY")(
|
|
933
|
+
return this.log(p.Warn, 3e3, T.from("SDK_KEY")(Ge || (Ge = b(["There is an existing client instance for the specified SDK Key. No new client instance will be created and the specified options are ignored. Returning the existing client instance. SDK Key: '", "'."], ["There is an existing client instance for the specified SDK Key. No new client instance will be created and the specified options are ignored. Returning the existing client instance. SDK Key: '", "'."])), e));
|
|
934
934
|
}, t.prototype.userObjectIsMissing = function(e) {
|
|
935
|
-
return this.log(p.Warn, 3001, T.from("KEY")(
|
|
935
|
+
return this.log(p.Warn, 3001, T.from("KEY")(Je || (Je = b(["Cannot evaluate targeting rules and % options for setting '", "' (User Object is missing). You should pass a User Object to the evaluation methods like `getValueAsync()` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/"], ["Cannot evaluate targeting rules and % options for setting '", "' (User Object is missing). You should pass a User Object to the evaluation methods like \\`getValueAsync()\\` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/"])), e));
|
|
936
936
|
}, t.prototype.dataGovernanceIsOutOfSync = function() {
|
|
937
937
|
return this.log(p.Warn, 3002, "The `dataGovernance` parameter specified at the client initialization is not in sync with the preferences on the ConfigCat Dashboard. Read more: https://configcat.com/docs/advanced/data-governance/");
|
|
938
938
|
}, t.prototype.userObjectAttributeIsMissingPercentage = function(e, r) {
|
|
939
|
-
return this.log(p.Warn, 3003, T.from("KEY", "ATTRIBUTE_NAME", "ATTRIBUTE_NAME")(
|
|
939
|
+
return this.log(p.Warn, 3003, T.from("KEY", "ATTRIBUTE_NAME", "ATTRIBUTE_NAME")(Ye || (Ye = b(["Cannot evaluate % options for setting '", "' (the User.", " attribute is missing). You should set the User.", " attribute in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/"], ["Cannot evaluate % options for setting '", "' (the User.", " attribute is missing). You should set the User.", " attribute in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/"])), e, r, r));
|
|
940
940
|
}, t.prototype.userObjectAttributeIsMissingCondition = function(e, r, n) {
|
|
941
|
-
return this.log(p.Warn, 3003, T.from("CONDITION", "KEY", "ATTRIBUTE_NAME", "ATTRIBUTE_NAME")(
|
|
941
|
+
return this.log(p.Warn, 3003, T.from("CONDITION", "KEY", "ATTRIBUTE_NAME", "ATTRIBUTE_NAME")($e || ($e = b(["Cannot evaluate condition (", ") for setting '", "' (the User.", " attribute is missing). You should set the User.", " attribute in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/"], ["Cannot evaluate condition (", ") for setting '", "' (the User.", " attribute is missing). You should set the User.", " attribute in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/"])), e, r, n, n));
|
|
942
942
|
}, t.prototype.userObjectAttributeIsInvalid = function(e, r, n, i) {
|
|
943
|
-
return this.log(p.Warn, 3004, T.from("CONDITION", "KEY", "REASON", "ATTRIBUTE_NAME")(
|
|
943
|
+
return this.log(p.Warn, 3004, T.from("CONDITION", "KEY", "REASON", "ATTRIBUTE_NAME")(Qe || (Qe = b(["Cannot evaluate condition (", ") for setting '", "' (", "). Please check the User.", " attribute and make sure that its value corresponds to the comparison operator."], ["Cannot evaluate condition (", ") for setting '", "' (", "). Please check the User.", " attribute and make sure that its value corresponds to the comparison operator."])), e, r, n, i));
|
|
944
944
|
}, t.prototype.userObjectAttributeIsAutoConverted = function(e, r, n, i) {
|
|
945
|
-
return this.log(p.Warn, 3005, T.from("CONDITION", "KEY", "ATTRIBUTE_NAME", "ATTRIBUTE_VALUE")(
|
|
945
|
+
return this.log(p.Warn, 3005, T.from("CONDITION", "KEY", "ATTRIBUTE_NAME", "ATTRIBUTE_VALUE")(Xe || (Xe = b(["Evaluation of condition (", ") for setting '", "' may not produce the expected result (the User.", " attribute is not a string value, thus it was automatically converted to the string value '", "'). Please make sure that using a non-string value was intended."], ["Evaluation of condition (", ") for setting '", "' may not produce the expected result (the User.", " attribute is not a string value, thus it was automatically converted to the string value '", "'). Please make sure that using a non-string value was intended."])), e, r, n, i));
|
|
946
946
|
}, t.prototype.configServiceCannotInitiateHttpCalls = function() {
|
|
947
947
|
return this.log(p.Warn, 3200, "Client is in offline mode, it cannot initiate HTTP calls.");
|
|
948
948
|
}, t.prototype.configServiceMethodHasNoEffectDueToDisposedClient = function(e) {
|
|
949
|
-
return this.log(p.Warn, 3201, T.from("METHOD_NAME")(
|
|
949
|
+
return this.log(p.Warn, 3201, T.from("METHOD_NAME")(Ze || (Ze = b(["The client object is already disposed, thus `", "()` has no effect."], ["The client object is already disposed, thus \\`", "()\\` has no effect."])), e));
|
|
950
950
|
}, t.prototype.configServiceMethodHasNoEffectDueToOverrideBehavior = function(e, r) {
|
|
951
|
-
return this.log(p.Warn, 3202, T.from("OVERRIDE_BEHAVIOR", "METHOD_NAME")(
|
|
951
|
+
return this.log(p.Warn, 3202, T.from("OVERRIDE_BEHAVIOR", "METHOD_NAME")(et || (et = b(["Client is configured to use the `", "` override behavior, thus `", "()` has no effect."], ["Client is configured to use the \\`", "\\` override behavior, thus \\`", "()\\` has no effect."])), e, r));
|
|
952
952
|
}, t.prototype.settingEvaluated = function(e) {
|
|
953
|
-
return this.log(p.Info, 5e3, T.from("EVALUATE_LOG")(
|
|
953
|
+
return this.log(p.Info, 5e3, T.from("EVALUATE_LOG")(tt || (tt = b(["", ""], ["", ""])), e));
|
|
954
954
|
}, t.prototype.configServiceStatusChanged = function(e) {
|
|
955
|
-
return this.log(p.Info, 5200, T.from("MODE")(
|
|
955
|
+
return this.log(p.Info, 5200, T.from("MODE")(rt || (rt = b(["Switched to ", " mode."], ["Switched to ", " mode."])), e.toUpperCase()));
|
|
956
956
|
}, t;
|
|
957
957
|
}()
|
|
958
|
-
),
|
|
958
|
+
), St = (
|
|
959
959
|
/** @class */
|
|
960
960
|
function() {
|
|
961
961
|
function t(e) {
|
|
@@ -963,15 +963,15 @@ var T = (
|
|
|
963
963
|
}
|
|
964
964
|
return t.prototype.log = function(e, r, n, i) {
|
|
965
965
|
var s = e === p.Debug ? [console.info, "DEBUG"] : e === p.Info ? [console.info, "INFO"] : e === p.Warn ? [console.warn, "WARN"] : e === p.Error ? [console.error, "ERROR"] : [console.log, p[e].toUpperCase()], o = s[0], a = s[1], u = i !== void 0 ? `
|
|
966
|
-
` +
|
|
966
|
+
` + B(i, !0) : "";
|
|
967
967
|
o(this.SOURCE + " - " + a + " - [" + r + "] " + n + u);
|
|
968
968
|
}, t;
|
|
969
969
|
}()
|
|
970
|
-
), We, Ve, je,
|
|
970
|
+
), Me, xe, We, Ve, je, Be, _e, He, Ke, ze, Ge, Je, Ye, $e, Qe, Xe, Ze, et, tt, rt;
|
|
971
971
|
function z(t) {
|
|
972
972
|
return !!t.fn;
|
|
973
973
|
}
|
|
974
|
-
var
|
|
974
|
+
var Qt = (
|
|
975
975
|
/** @class */
|
|
976
976
|
function() {
|
|
977
977
|
function t() {
|
|
@@ -1067,7 +1067,7 @@ var Zt = (
|
|
|
1067
1067
|
return !0;
|
|
1068
1068
|
}, t;
|
|
1069
1069
|
}()
|
|
1070
|
-
),
|
|
1070
|
+
), At = (
|
|
1071
1071
|
/** @class */
|
|
1072
1072
|
function() {
|
|
1073
1073
|
function t() {
|
|
@@ -1092,7 +1092,7 @@ var Zt = (
|
|
|
1092
1092
|
}, t;
|
|
1093
1093
|
}()
|
|
1094
1094
|
);
|
|
1095
|
-
function
|
|
1095
|
+
function bt(t) {
|
|
1096
1096
|
function e(U, M) {
|
|
1097
1097
|
var te = U << M | U >>> 32 - M;
|
|
1098
1098
|
return te;
|
|
@@ -1133,13 +1133,13 @@ function It(t) {
|
|
|
1133
1133
|
A = e(h, 5) + (g ^ v ^ d) + y + s[n] + 3395469782 & 4294967295, y = d, d = v, v = e(g, 30), g = h, h = A;
|
|
1134
1134
|
o = o + h & 4294967295, a = a + g & 4294967295, u = u + v & 4294967295, l = l + d & 4294967295, f = f + y & 4294967295;
|
|
1135
1135
|
}
|
|
1136
|
-
return
|
|
1136
|
+
return It([o, a, u, l, f]);
|
|
1137
1137
|
}
|
|
1138
|
-
function
|
|
1139
|
-
function e(
|
|
1140
|
-
return
|
|
1138
|
+
function Tt(t) {
|
|
1139
|
+
function e(Pe, qe) {
|
|
1140
|
+
return Pe >>> qe | Pe << 32 - qe;
|
|
1141
1141
|
}
|
|
1142
|
-
var r = "length", n = Math.pow, i = n(2, 32), s, o, a =
|
|
1142
|
+
var r = "length", n = Math.pow, i = n(2, 32), s, o, a = Tt, u = a.h, l = a.k;
|
|
1143
1143
|
if (!l) {
|
|
1144
1144
|
u = [], l = [];
|
|
1145
1145
|
for (var f = {}, h = 2, g = 0; g < 64; h++)
|
|
@@ -1159,15 +1159,15 @@ function wt(t) {
|
|
|
1159
1159
|
for (d[d[r]] = v / i | 0, d[d[r]] = v, o = 0; o < d[r]; ) {
|
|
1160
1160
|
var y = d.slice(o, o += 16), A = u;
|
|
1161
1161
|
for (u = u.slice(0, 8), s = 0; s < 64; s++) {
|
|
1162
|
-
var I = y[s - 15], w = y[s - 2], U = u[0], M = u[4], te = u[7] + (e(M, 6) ^ e(M, 11) ^ e(M, 25)) + (M & u[5] ^ ~M & u[6]) + l[s] + (y[s] = s < 16 ? y[s] : y[s - 16] + (e(I, 7) ^ e(I, 18) ^ I >>> 3) + y[s - 7] + (e(w, 17) ^ e(w, 19) ^ w >>> 10) | 0),
|
|
1163
|
-
u = [te +
|
|
1162
|
+
var I = y[s - 15], w = y[s - 2], U = u[0], M = u[4], te = u[7] + (e(M, 6) ^ e(M, 11) ^ e(M, 25)) + (M & u[5] ^ ~M & u[6]) + l[s] + (y[s] = s < 16 ? y[s] : y[s - 16] + (e(I, 7) ^ e(I, 18) ^ I >>> 3) + y[s - 7] + (e(w, 17) ^ e(w, 19) ^ w >>> 10) | 0), qt = (e(U, 2) ^ e(U, 13) ^ e(U, 22)) + (U & u[1] ^ U & u[2] ^ u[1] & u[2]);
|
|
1163
|
+
u = [te + qt | 0].concat(u), u[4] = u[4] + te | 0;
|
|
1164
1164
|
}
|
|
1165
1165
|
for (s = 0; s < 8; s++)
|
|
1166
1166
|
u[s] = u[s] + A[s] | 0;
|
|
1167
1167
|
}
|
|
1168
|
-
return
|
|
1168
|
+
return It(u, 8);
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function It(t, e) {
|
|
1171
1171
|
var r = "0123456789abcdef", n = "";
|
|
1172
1172
|
e ?? (e = t.length);
|
|
1173
1173
|
for (var i = 0; i < e; i++)
|
|
@@ -1177,7 +1177,7 @@ function Ct(t, e) {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
return n;
|
|
1179
1179
|
}
|
|
1180
|
-
var
|
|
1180
|
+
var nt = new At(), it = (
|
|
1181
1181
|
/** @class */
|
|
1182
1182
|
function() {
|
|
1183
1183
|
function t(e) {
|
|
@@ -1185,7 +1185,7 @@ var st = new Tt(), ot = (
|
|
|
1185
1185
|
}
|
|
1186
1186
|
return t.prototype.tryDisconnect = function() {
|
|
1187
1187
|
var e = this.eventEmitter;
|
|
1188
|
-
return this.eventEmitter =
|
|
1188
|
+
return this.eventEmitter = nt, e !== nt;
|
|
1189
1189
|
}, t.prototype.on = function(e, r) {
|
|
1190
1190
|
return this.eventEmitter.on(e, r), this;
|
|
1191
1191
|
}, t.prototype.once = function(e, r) {
|
|
@@ -1203,28 +1203,28 @@ var st = new Tt(), ot = (
|
|
|
1203
1203
|
}, t.prototype.emit = function(e) {
|
|
1204
1204
|
for (var r, n = [], i = 1; i < arguments.length; i++)
|
|
1205
1205
|
n[i - 1] = arguments[i];
|
|
1206
|
-
return (r = this.eventEmitter).emit.apply(r,
|
|
1206
|
+
return (r = this.eventEmitter).emit.apply(r, vt([e], n));
|
|
1207
1207
|
}, t;
|
|
1208
1208
|
}()
|
|
1209
1209
|
);
|
|
1210
|
-
function
|
|
1211
|
-
typeof Object.values > "u" && (Object.values =
|
|
1210
|
+
function Xt() {
|
|
1211
|
+
typeof Object.values > "u" && (Object.values = Zt), typeof Object.entries > "u" && (Object.entries = er), typeof Object.fromEntries > "u" && (Object.fromEntries = tr);
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function Zt(t) {
|
|
1214
1214
|
for (var e = [], r = 0, n = Object.keys(t); r < n.length; r++) {
|
|
1215
1215
|
var i = n[r];
|
|
1216
1216
|
e.push(t[i]);
|
|
1217
1217
|
}
|
|
1218
1218
|
return e;
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function er(t) {
|
|
1221
1221
|
for (var e = [], r = 0, n = Object.keys(t); r < n.length; r++) {
|
|
1222
1222
|
var i = n[r];
|
|
1223
1223
|
e.push([i, t[i]]);
|
|
1224
1224
|
}
|
|
1225
1225
|
return e;
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1227
|
+
function tr(t) {
|
|
1228
1228
|
var e, r = {};
|
|
1229
1229
|
if (Array.isArray(t))
|
|
1230
1230
|
for (var n = 0, i = t; n < i.length; n++) {
|
|
@@ -1240,7 +1240,7 @@ function nr(t) {
|
|
|
1240
1240
|
throw new TypeError("Object.fromEntries() requires a single iterable argument");
|
|
1241
1241
|
return r;
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1243
|
+
function wt() {
|
|
1244
1244
|
var t = function(e) {
|
|
1245
1245
|
this.target = e;
|
|
1246
1246
|
};
|
|
@@ -1248,39 +1248,39 @@ function Nt() {
|
|
|
1248
1248
|
return this.target;
|
|
1249
1249
|
}, t.isFallback = !0, t;
|
|
1250
1250
|
}
|
|
1251
|
-
var
|
|
1251
|
+
var Ct = function() {
|
|
1252
1252
|
return typeof WeakRef == "function";
|
|
1253
1253
|
}, H;
|
|
1254
1254
|
(function(t) {
|
|
1255
1255
|
t[t.AutoPoll = 0] = "AutoPoll", t[t.LazyLoad = 1] = "LazyLoad", t[t.ManualPoll = 2] = "ManualPoll";
|
|
1256
1256
|
})(H || (H = {}));
|
|
1257
|
-
var
|
|
1257
|
+
var le;
|
|
1258
1258
|
(function(t) {
|
|
1259
1259
|
t[t.Global = 0] = "Global", t[t.EuOnly = 1] = "EuOnly";
|
|
1260
|
-
})(
|
|
1261
|
-
var
|
|
1260
|
+
})(le || (le = {}));
|
|
1261
|
+
var Ne = (
|
|
1262
1262
|
/** @class */
|
|
1263
1263
|
function() {
|
|
1264
1264
|
function t(e, r, n, i, s) {
|
|
1265
1265
|
var o, a, u;
|
|
1266
1266
|
if (this.requestTimeoutMs = 3e4, this.baseUrlOverriden = !1, this.proxy = "", this.offline = !1, !e)
|
|
1267
1267
|
throw new Error("Invalid 'sdkKey' value");
|
|
1268
|
-
switch (this.sdkKey = e, this.clientVersion = r, this.dataGovernance = (o = n == null ? void 0 : n.dataGovernance) !== null && o !== void 0 ? o :
|
|
1269
|
-
case
|
|
1268
|
+
switch (this.sdkKey = e, this.clientVersion = r, this.dataGovernance = (o = n == null ? void 0 : n.dataGovernance) !== null && o !== void 0 ? o : le.Global, this.dataGovernance) {
|
|
1269
|
+
case le.EuOnly:
|
|
1270
1270
|
this.baseUrl = "https://cdn-eu.configcat.com";
|
|
1271
1271
|
break;
|
|
1272
1272
|
default:
|
|
1273
1273
|
this.baseUrl = "https://cdn-global.configcat.com";
|
|
1274
1274
|
break;
|
|
1275
1275
|
}
|
|
1276
|
-
var l = (a = s == null ? void 0 : s()) !== null && a !== void 0 ? a : new
|
|
1276
|
+
var l = (a = s == null ? void 0 : s()) !== null && a !== void 0 ? a : new Qt(), f = new it(l), h = new (Ct() ? WeakRef : wt())(f);
|
|
1277
1277
|
this.hooks = {
|
|
1278
1278
|
hooks: f,
|
|
1279
1279
|
hooksWeakRef: h,
|
|
1280
1280
|
emit: function(d) {
|
|
1281
1281
|
for (var y, A, I = [], w = 1; w < arguments.length; w++)
|
|
1282
1282
|
I[w - 1] = arguments[w];
|
|
1283
|
-
return (A = (y = this.hooksWeakRef.deref()) === null || y === void 0 ? void 0 : y.emit.apply(y,
|
|
1283
|
+
return (A = (y = this.hooksWeakRef.deref()) === null || y === void 0 ? void 0 : y.emit.apply(y, vt([d], I))) !== null && A !== void 0 ? A : !1;
|
|
1284
1284
|
}
|
|
1285
1285
|
};
|
|
1286
1286
|
var g, v;
|
|
@@ -1292,18 +1292,18 @@ var Re = (
|
|
|
1292
1292
|
}
|
|
1293
1293
|
n.baseUrl && (this.baseUrl = n.baseUrl, this.baseUrlOverriden = !0), n.proxy && (this.proxy = n.proxy), n.flagOverrides && (this.flagOverrides = n.flagOverrides), n.defaultUser && (this.defaultUser = n.defaultUser), n.offline && (this.offline = n.offline), (u = n.setupHooks) === null || u === void 0 || u.call(n, f);
|
|
1294
1294
|
}
|
|
1295
|
-
this.logger = new
|
|
1295
|
+
this.logger = new $t(g ?? new St(), this.hooks), this.cache = v ? new Ot(v, this.logger) : i ? i(this) : new Yt();
|
|
1296
1296
|
}
|
|
1297
1297
|
return t.prototype.yieldHooks = function() {
|
|
1298
1298
|
var e = this.hooks, r = e.hooks;
|
|
1299
|
-
return delete e.hooks, r ?? new
|
|
1299
|
+
return delete e.hooks, r ?? new it(new At());
|
|
1300
1300
|
}, t.prototype.getUrl = function() {
|
|
1301
1301
|
return this.baseUrl + "/configuration-files/" + this.sdkKey + "/" + t.configFileName + "?sdk=" + this.clientVersion;
|
|
1302
1302
|
}, t.prototype.getCacheKey = function() {
|
|
1303
|
-
return
|
|
1303
|
+
return bt(this.sdkKey + "_" + t.configFileName + "_" + D.serializationFormatVersion);
|
|
1304
1304
|
}, t.configFileName = "config_v6.json", t;
|
|
1305
1305
|
}()
|
|
1306
|
-
),
|
|
1306
|
+
), st = (
|
|
1307
1307
|
/** @class */
|
|
1308
1308
|
function(t) {
|
|
1309
1309
|
q(e, t);
|
|
@@ -1318,8 +1318,8 @@ var Re = (
|
|
|
1318
1318
|
return u;
|
|
1319
1319
|
}
|
|
1320
1320
|
return e;
|
|
1321
|
-
}(
|
|
1322
|
-
),
|
|
1321
|
+
}(Ne)
|
|
1322
|
+
), ot = (
|
|
1323
1323
|
/** @class */
|
|
1324
1324
|
function(t) {
|
|
1325
1325
|
q(e, t);
|
|
@@ -1327,8 +1327,8 @@ var Re = (
|
|
|
1327
1327
|
return t.call(this, r, n + "/m-" + i, s, o, a) || this;
|
|
1328
1328
|
}
|
|
1329
1329
|
return e;
|
|
1330
|
-
}(
|
|
1331
|
-
),
|
|
1330
|
+
}(Ne)
|
|
1331
|
+
), at = (
|
|
1332
1332
|
/** @class */
|
|
1333
1333
|
function(t) {
|
|
1334
1334
|
q(e, t);
|
|
@@ -1339,27 +1339,29 @@ var Re = (
|
|
|
1339
1339
|
return u;
|
|
1340
1340
|
}
|
|
1341
1341
|
return e;
|
|
1342
|
-
}(
|
|
1342
|
+
}(Ne)
|
|
1343
1343
|
), R;
|
|
1344
1344
|
(function(t) {
|
|
1345
1345
|
t[t.LocalOnly = 0] = "LocalOnly", t[t.LocalOverRemote = 1] = "LocalOverRemote", t[t.RemoteOverLocal = 2] = "RemoteOverLocal";
|
|
1346
1346
|
})(R || (R = {}));
|
|
1347
|
-
var
|
|
1347
|
+
var rr = (
|
|
1348
1348
|
/** @class */
|
|
1349
1349
|
function() {
|
|
1350
|
-
function t(e) {
|
|
1351
|
-
this.
|
|
1350
|
+
function t(e, r) {
|
|
1351
|
+
this.initialSettings = this.constructor.getCurrentSettings(e), r && (this.map = e);
|
|
1352
|
+
}
|
|
1353
|
+
return t.getCurrentSettings = function(e) {
|
|
1354
|
+
return Object.fromEntries(Object.entries(e).map(function(r) {
|
|
1352
1355
|
var n = r[0], i = r[1];
|
|
1353
|
-
return [n,
|
|
1356
|
+
return [n, dt.fromValue(i)];
|
|
1354
1357
|
}));
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
return Promise.resolve(this.map);
|
|
1358
|
+
}, t.prototype.getOverrides = function() {
|
|
1359
|
+
return Promise.resolve(this.getOverridesSync());
|
|
1358
1360
|
}, t.prototype.getOverridesSync = function() {
|
|
1359
|
-
return this.map;
|
|
1361
|
+
return this.map ? this.constructor.getCurrentSettings(this.map) : this.initialSettings;
|
|
1360
1362
|
}, t;
|
|
1361
1363
|
}()
|
|
1362
|
-
),
|
|
1364
|
+
), nr = (
|
|
1363
1365
|
/** @class */
|
|
1364
1366
|
function() {
|
|
1365
1367
|
function t(e, r) {
|
|
@@ -1367,7 +1369,7 @@ var ir = (
|
|
|
1367
1369
|
}
|
|
1368
1370
|
return t;
|
|
1369
1371
|
}()
|
|
1370
|
-
),
|
|
1372
|
+
), ir = (
|
|
1371
1373
|
/** @class */
|
|
1372
1374
|
function(t) {
|
|
1373
1375
|
q(e, t);
|
|
@@ -1417,8 +1419,8 @@ var ir = (
|
|
|
1417
1419
|
}, e.prototype.getCacheState = function(r) {
|
|
1418
1420
|
return r.isEmpty ? C.NoFlagData : r.isExpired(this.cacheTimeToLiveMs) ? C.HasCachedFlagDataOnly : C.HasUpToDateFlagData;
|
|
1419
1421
|
}, e;
|
|
1420
|
-
}(
|
|
1421
|
-
),
|
|
1422
|
+
}(we)
|
|
1423
|
+
), sr = (
|
|
1422
1424
|
/** @class */
|
|
1423
1425
|
function(t) {
|
|
1424
1426
|
q(e, t);
|
|
@@ -1454,8 +1456,8 @@ var ir = (
|
|
|
1454
1456
|
}, e.prototype.refreshConfigAsync = function() {
|
|
1455
1457
|
return this.options.logger.debug("ManualPollService.refreshConfigAsync() called."), t.prototype.refreshConfigAsync.call(this);
|
|
1456
1458
|
}, e;
|
|
1457
|
-
}(
|
|
1458
|
-
),
|
|
1459
|
+
}(we)
|
|
1460
|
+
), Nt = "<invalid value>", or = "<invalid name>", Le = "<invalid operator>", ar = "<invalid reference>", ur = 10, Lt = (
|
|
1459
1461
|
/** @class */
|
|
1460
1462
|
function() {
|
|
1461
1463
|
function t() {
|
|
@@ -1477,23 +1479,23 @@ var ir = (
|
|
|
1477
1479
|
}, t.prototype.appendEvaluationResult = function(e) {
|
|
1478
1480
|
return this.append("" + e);
|
|
1479
1481
|
}, t.prototype.appendUserConditionCore = function(e, r, n) {
|
|
1480
|
-
return this.append("User." + e + " " +
|
|
1482
|
+
return this.append("User." + e + " " + ye(r) + " '" + (n ?? Nt) + "'");
|
|
1481
1483
|
}, t.prototype.appendUserConditionString = function(e, r, n, i) {
|
|
1482
1484
|
return this.appendUserConditionCore(e, r, i ? "<hashed value>" : n);
|
|
1483
1485
|
}, t.prototype.appendUserConditionStringList = function(e, r, n, i) {
|
|
1484
1486
|
if (n == null)
|
|
1485
1487
|
return this.appendUserConditionCore(e, r);
|
|
1486
|
-
var s = "value", o = "values", a =
|
|
1488
|
+
var s = "value", o = "values", a = ye(r);
|
|
1487
1489
|
if (i)
|
|
1488
1490
|
return this.append("User." + e + " " + a + " [<" + n.length + " hashed " + (n.length === 1 ? s : o) + ">]");
|
|
1489
|
-
var u =
|
|
1491
|
+
var u = Ce(n, ur, function(l) {
|
|
1490
1492
|
return ", ... <" + l + " more " + (l === 1 ? s : o) + ">";
|
|
1491
1493
|
});
|
|
1492
1494
|
return this.append("User." + e + " " + a + " [" + u + "]");
|
|
1493
1495
|
}, t.prototype.appendUserConditionNumber = function(e, r, n, i) {
|
|
1494
1496
|
if (n == null)
|
|
1495
1497
|
return this.appendUserConditionCore(e, r);
|
|
1496
|
-
var s =
|
|
1498
|
+
var s = ye(r), o;
|
|
1497
1499
|
return i && !isNaN(o = new Date(n * 1e3)) ? this.append("User." + e + " " + s + " '" + n + "' (" + o.toISOString() + " UTC)") : this.append("User." + e + " " + s + " '" + n + "'");
|
|
1498
1500
|
}, t.prototype.appendUserCondition = function(e) {
|
|
1499
1501
|
var r = e.comparisonAttribute, n = e.comparator;
|
|
@@ -1545,22 +1547,22 @@ var ir = (
|
|
|
1545
1547
|
}
|
|
1546
1548
|
}, t.prototype.appendPrerequisiteFlagCondition = function(e) {
|
|
1547
1549
|
var r = e.prerequisiteFlagKey, n = e.comparator, i = e.comparisonValue;
|
|
1548
|
-
return this.append("Flag '" + r + "' " +
|
|
1550
|
+
return this.append("Flag '" + r + "' " + lr(n) + " '" + ce(i) + "'");
|
|
1549
1551
|
}, t.prototype.appendSegmentCondition = function(e) {
|
|
1550
|
-
var r, n = e.segment, i = e.comparator, s = (r = n == null ? void 0 : n.name) !== null && r !== void 0 ? r : n == null ?
|
|
1551
|
-
return this.append("User " +
|
|
1552
|
+
var r, n = e.segment, i = e.comparator, s = (r = n == null ? void 0 : n.name) !== null && r !== void 0 ? r : n == null ? ar : or;
|
|
1553
|
+
return this.append("User " + Rt(i) + " '" + s + "'");
|
|
1552
1554
|
}, t.prototype.appendConditionConsequence = function(e) {
|
|
1553
1555
|
return this.append(" => ").appendEvaluationResult(e), e ? this : this.append(", skipping the remaining AND conditions");
|
|
1554
1556
|
}, t.prototype.appendTargetingRuleThenPart = function(e, r) {
|
|
1555
1557
|
(r ? this.newLine() : this.append(" ")).append("THEN");
|
|
1556
1558
|
var n = e.then;
|
|
1557
|
-
return this.append(
|
|
1559
|
+
return this.append(ve(n) ? " % options" : " '" + ce(n.value) + "'");
|
|
1558
1560
|
}, t.prototype.appendTargetingRuleConsequence = function(e, r, n) {
|
|
1559
1561
|
return this.increaseIndent(), this.appendTargetingRuleThenPart(e, n).append(" => ").append(r === !0 ? "MATCH, applying rule" : r === !1 ? "no match" : r), this.decreaseIndent();
|
|
1560
1562
|
}, t;
|
|
1561
1563
|
}()
|
|
1562
1564
|
);
|
|
1563
|
-
function
|
|
1565
|
+
function ye(t) {
|
|
1564
1566
|
switch (t) {
|
|
1565
1567
|
case c.IsOneOf:
|
|
1566
1568
|
case c.SensitiveIsOneOf:
|
|
@@ -1619,41 +1621,41 @@ function Ee(t) {
|
|
|
1619
1621
|
case c.SensitiveArrayNotContainsAnyOf:
|
|
1620
1622
|
return "ARRAY NOT CONTAINS ANY OF";
|
|
1621
1623
|
default:
|
|
1622
|
-
return
|
|
1624
|
+
return Le;
|
|
1623
1625
|
}
|
|
1624
1626
|
}
|
|
1625
|
-
function
|
|
1626
|
-
return new
|
|
1627
|
+
function Re(t) {
|
|
1628
|
+
return new Lt().appendUserCondition(t).toString();
|
|
1627
1629
|
}
|
|
1628
|
-
function
|
|
1630
|
+
function lr(t) {
|
|
1629
1631
|
switch (t) {
|
|
1630
1632
|
case K.Equals:
|
|
1631
1633
|
return "EQUALS";
|
|
1632
1634
|
case K.NotEquals:
|
|
1633
1635
|
return "NOT EQUALS";
|
|
1634
1636
|
default:
|
|
1635
|
-
return
|
|
1637
|
+
return Le;
|
|
1636
1638
|
}
|
|
1637
1639
|
}
|
|
1638
|
-
function
|
|
1640
|
+
function Rt(t) {
|
|
1639
1641
|
switch (t) {
|
|
1640
1642
|
case W.IsIn:
|
|
1641
1643
|
return "IS IN SEGMENT";
|
|
1642
1644
|
case W.IsNotIn:
|
|
1643
1645
|
return "IS NOT IN SEGMENT";
|
|
1644
1646
|
default:
|
|
1645
|
-
return
|
|
1647
|
+
return Le;
|
|
1646
1648
|
}
|
|
1647
1649
|
}
|
|
1648
|
-
function
|
|
1649
|
-
return ee(t) ? t.toString() :
|
|
1650
|
+
function ce(t) {
|
|
1651
|
+
return ee(t) ? t.toString() : Nt;
|
|
1650
1652
|
}
|
|
1651
|
-
var
|
|
1652
|
-
var r =
|
|
1653
|
+
var ut = /^[0-9]+$/, G = function(t, e) {
|
|
1654
|
+
var r = ut.test(t), n = ut.test(e);
|
|
1653
1655
|
return r && n && (t = +t, e = +e), t === e ? 0 : r && !n ? -1 : n && !r ? 1 : t < e ? -1 : 1;
|
|
1654
|
-
},
|
|
1655
|
-
9007199254740991, Z = [], S = [], m = {},
|
|
1656
|
-
var r =
|
|
1656
|
+
}, Se = 256, re = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
1657
|
+
9007199254740991, Z = [], S = [], m = {}, cr = 0, N = function(t, e) {
|
|
1658
|
+
var r = cr++;
|
|
1657
1659
|
m[t] = r, S[r] = e, Z[r] = new RegExp(e);
|
|
1658
1660
|
};
|
|
1659
1661
|
N("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
@@ -1671,7 +1673,7 @@ N("FULLPLAIN", "v?" + S[m.MAINVERSION] + S[m.PRERELEASE] + "?" + S[m.BUILD] + "?
|
|
|
1671
1673
|
N("FULL", "^" + S[m.FULLPLAIN] + "$");
|
|
1672
1674
|
N("LOOSEPLAIN", "[v=\\s]*" + S[m.MAINVERSIONLOOSE] + S[m.PRERELEASELOOSE] + "?" + S[m.BUILD] + "?");
|
|
1673
1675
|
N("LOOSE", "^" + S[m.LOOSEPLAIN] + "$");
|
|
1674
|
-
var
|
|
1676
|
+
var lt = (
|
|
1675
1677
|
/** @class */
|
|
1676
1678
|
function() {
|
|
1677
1679
|
function t(e, r) {
|
|
@@ -1684,22 +1686,22 @@ var ft = (
|
|
|
1684
1686
|
e = e.version;
|
|
1685
1687
|
} else if (typeof e != "string")
|
|
1686
1688
|
throw new TypeError("Invalid Version: " + e);
|
|
1687
|
-
if (e.length >
|
|
1688
|
-
throw new TypeError("version is longer than " +
|
|
1689
|
+
if (e.length > Se)
|
|
1690
|
+
throw new TypeError("version is longer than " + Se + " characters");
|
|
1689
1691
|
this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease;
|
|
1690
1692
|
var n = e.trim().match(r.loose ? Z[m.LOOSE] : Z[m.FULL]);
|
|
1691
1693
|
if (!n)
|
|
1692
1694
|
throw new TypeError("Invalid Version: " + e);
|
|
1693
|
-
if (this.raw = e, this.major = +n[1], this.minor = +n[2], this.patch = +n[3], this.major >
|
|
1695
|
+
if (this.raw = e, this.major = +n[1], this.minor = +n[2], this.patch = +n[3], this.major > re || this.major < 0)
|
|
1694
1696
|
throw new TypeError("Invalid major version");
|
|
1695
|
-
if (this.minor >
|
|
1697
|
+
if (this.minor > re || this.minor < 0)
|
|
1696
1698
|
throw new TypeError("Invalid minor version");
|
|
1697
|
-
if (this.patch >
|
|
1699
|
+
if (this.patch > re || this.patch < 0)
|
|
1698
1700
|
throw new TypeError("Invalid patch version");
|
|
1699
1701
|
n[4] ? this.prerelease = n[4].split(".").map(function(i) {
|
|
1700
1702
|
if (/^[0-9]+$/.test(i)) {
|
|
1701
1703
|
var s = +i;
|
|
1702
|
-
if (s >= 0 && s <
|
|
1704
|
+
if (s >= 0 && s < re)
|
|
1703
1705
|
return s;
|
|
1704
1706
|
}
|
|
1705
1707
|
return i;
|
|
@@ -1792,23 +1794,23 @@ var ft = (
|
|
|
1792
1794
|
return this.format(), this.raw = this.version, this;
|
|
1793
1795
|
}, t;
|
|
1794
1796
|
}()
|
|
1795
|
-
),
|
|
1797
|
+
), Ae = function(t, e) {
|
|
1796
1798
|
if ((!e || typeof e != "object") && (e = {
|
|
1797
1799
|
loose: !!e,
|
|
1798
1800
|
includePrerelease: !1
|
|
1799
|
-
}), t instanceof
|
|
1801
|
+
}), t instanceof lt)
|
|
1800
1802
|
return t;
|
|
1801
|
-
if (typeof t != "string" || t.length >
|
|
1803
|
+
if (typeof t != "string" || t.length > Se)
|
|
1802
1804
|
return null;
|
|
1803
1805
|
var r = e.loose ? Z[m.LOOSE] : Z[m.FULL];
|
|
1804
1806
|
if (!r.test(t))
|
|
1805
1807
|
return null;
|
|
1806
1808
|
try {
|
|
1807
|
-
return new
|
|
1809
|
+
return new lt(t, e);
|
|
1808
1810
|
} catch {
|
|
1809
1811
|
return null;
|
|
1810
1812
|
}
|
|
1811
|
-
},
|
|
1813
|
+
}, Cr = (
|
|
1812
1814
|
/** @class */
|
|
1813
1815
|
function() {
|
|
1814
1816
|
function t(e, r, n, i) {
|
|
@@ -1817,7 +1819,7 @@ var ft = (
|
|
|
1817
1819
|
return t;
|
|
1818
1820
|
}()
|
|
1819
1821
|
);
|
|
1820
|
-
function
|
|
1822
|
+
function fr(t) {
|
|
1821
1823
|
var e, r = {}, n = "Identifier", i = "Email", s = "Country";
|
|
1822
1824
|
if (r[n] = (e = t.identifier) !== null && e !== void 0 ? e : "", t.email != null && (r[i] = t.email), t.country != null && (r[s] = t.country), t.custom != null)
|
|
1823
1825
|
for (var o = [n, i, s], a = 0, u = Object.entries(t.custom); a < u.length; a++) {
|
|
@@ -1826,7 +1828,7 @@ function gr(t) {
|
|
|
1826
1828
|
}
|
|
1827
1829
|
return r;
|
|
1828
1830
|
}
|
|
1829
|
-
var
|
|
1831
|
+
var Fe = (
|
|
1830
1832
|
/** @class */
|
|
1831
1833
|
function() {
|
|
1832
1834
|
function t(e, r, n, i) {
|
|
@@ -1835,7 +1837,7 @@ var De = (
|
|
|
1835
1837
|
return Object.defineProperty(t.prototype, "userAttributes", {
|
|
1836
1838
|
get: function() {
|
|
1837
1839
|
var e = this.$userAttributes;
|
|
1838
|
-
return e !== void 0 ? e : this.$userAttributes = this.user ?
|
|
1840
|
+
return e !== void 0 ? e : this.$userAttributes = this.user ? fr(this.user) : null;
|
|
1839
1841
|
},
|
|
1840
1842
|
enumerable: !1,
|
|
1841
1843
|
configurable: !0
|
|
@@ -1851,11 +1853,11 @@ var De = (
|
|
|
1851
1853
|
return i.$userAttributes = n.userAttributes, i.$visitedFlags = n.visitedFlags, i.logBuilder = n.logBuilder, i;
|
|
1852
1854
|
}, t;
|
|
1853
1855
|
}()
|
|
1854
|
-
),
|
|
1856
|
+
), ct = "The current targeting rule is ignored and the evaluation continues with the next rule.", me = "cannot evaluate, User Object is missing", hr = function(t) {
|
|
1855
1857
|
return "cannot evaluate, the User." + t + " attribute is missing";
|
|
1856
|
-
},
|
|
1858
|
+
}, gr = function(t, e) {
|
|
1857
1859
|
return "cannot evaluate, the User." + t + " attribute is invalid (" + e + ")";
|
|
1858
|
-
},
|
|
1860
|
+
}, vr = (
|
|
1859
1861
|
/** @class */
|
|
1860
1862
|
function() {
|
|
1861
1863
|
function t(e) {
|
|
@@ -1864,18 +1866,18 @@ var De = (
|
|
|
1864
1866
|
return t.prototype.evaluate = function(e, r) {
|
|
1865
1867
|
this.logger.debug("RolloutEvaluator.evaluate() called.");
|
|
1866
1868
|
var n = r.logBuilder;
|
|
1867
|
-
this.logger.isEnabled(p.Info) && (r.logBuilder = n = new
|
|
1869
|
+
this.logger.isEnabled(p.Info) && (r.logBuilder = n = new Lt(), n.append("Evaluating '" + r.key + "'"), r.userAttributes && n.append(" for User '" + JSON.stringify(r.userAttributes) + "'"), n.increaseIndent());
|
|
1868
1870
|
var i;
|
|
1869
1871
|
try {
|
|
1870
1872
|
var s = void 0, o = void 0;
|
|
1871
1873
|
if (e != null) {
|
|
1872
1874
|
var a = r.setting.type;
|
|
1873
|
-
if (a >= 0 && !
|
|
1875
|
+
if (a >= 0 && !yr(e, a))
|
|
1874
1876
|
throw new TypeError("The type of a setting must match the type of the specified default value. " + ("Setting's type was " + x[a] + " but the default value's type was " + typeof e + ". ") + ("Please use a default value which corresponds to the setting type " + x[a] + ". ") + "Learn more: https://configcat.com/docs/sdk-reference/js/#setting-type-mapping");
|
|
1875
1877
|
s = this.evaluateSetting(r), i = s.selectedValue.value, o = typeof i == typeof e;
|
|
1876
1878
|
} else
|
|
1877
1879
|
s = this.evaluateSetting(r), i = s.selectedValue.value, o = ee(i);
|
|
1878
|
-
return o ||
|
|
1880
|
+
return o || Te(i), s;
|
|
1879
1881
|
} catch (u) {
|
|
1880
1882
|
throw n == null || n.resetIndent().increaseIndent(), i = e, u;
|
|
1881
1883
|
} finally {
|
|
@@ -1893,17 +1895,17 @@ var De = (
|
|
|
1893
1895
|
for (var i = 0; i < e.length; i++) {
|
|
1894
1896
|
var s = e[i], o = s.conditions, a = this.evaluateConditions(o, s, r.key, r);
|
|
1895
1897
|
if (a !== !0) {
|
|
1896
|
-
J(a) && (n == null || n.increaseIndent().newLine(
|
|
1898
|
+
J(a) && (n == null || n.increaseIndent().newLine(ct).decreaseIndent());
|
|
1897
1899
|
continue;
|
|
1898
1900
|
}
|
|
1899
|
-
if (!
|
|
1901
|
+
if (!ve(s.then))
|
|
1900
1902
|
return { selectedValue: s.then, matchedTargetingRule: s };
|
|
1901
1903
|
var u = s.then;
|
|
1902
1904
|
n == null || n.increaseIndent();
|
|
1903
1905
|
var l = this.evaluatePercentageOptions(u, s, r);
|
|
1904
1906
|
if (l)
|
|
1905
1907
|
return n == null || n.decreaseIndent(), l;
|
|
1906
|
-
n == null || n.newLine(
|
|
1908
|
+
n == null || n.newLine(ct).decreaseIndent();
|
|
1907
1909
|
}
|
|
1908
1910
|
}, t.prototype.evaluatePercentageOptions = function(e, r, n) {
|
|
1909
1911
|
var i = n.logBuilder;
|
|
@@ -1917,12 +1919,12 @@ var De = (
|
|
|
1917
1919
|
return;
|
|
1918
1920
|
}
|
|
1919
1921
|
i == null || i.newLine("Evaluating % options based on the User." + s + " attribute:");
|
|
1920
|
-
var a =
|
|
1922
|
+
var a = bt(n.key + kt(o)), u = parseInt(a.substring(0, 7), 16) % 100;
|
|
1921
1923
|
i == null || i.newLine("- Computing hash in the [0..99] range from User." + s + " => " + u + " (this value is sticky and consistent across all SDKs)");
|
|
1922
1924
|
for (var l = 0, f = 0; f < e.length; f++) {
|
|
1923
1925
|
var h = e[f];
|
|
1924
1926
|
if (l += h.percentage, !(u >= l))
|
|
1925
|
-
return i == null || i.newLine("- Hash value " + u + " selects % option " + (f + 1) + " (" + h.percentage + "%), '" +
|
|
1927
|
+
return i == null || i.newLine("- Hash value " + u + " selects % option " + (f + 1) + " (" + h.percentage + "%), '" + ce(h.value) + "'."), { selectedValue: h, matchedTargetingRule: r, matchedPercentageOption: h };
|
|
1926
1928
|
}
|
|
1927
1929
|
throw new Error("Sum of percentage option percentages are less than 100.");
|
|
1928
1930
|
}, t.prototype.evaluateConditions = function(e, r, n, i) {
|
|
@@ -1938,7 +1940,7 @@ var De = (
|
|
|
1938
1940
|
s = this.evaluatePrerequisiteFlagCondition(l, i), a = !0;
|
|
1939
1941
|
break;
|
|
1940
1942
|
case "SegmentCondition":
|
|
1941
|
-
s = this.evaluateSegmentCondition(l, i), a = !J(s) || s !==
|
|
1943
|
+
s = this.evaluateSegmentCondition(l, i), a = !J(s) || s !== me || e.length > 1;
|
|
1942
1944
|
break;
|
|
1943
1945
|
default:
|
|
1944
1946
|
throw new Error();
|
|
@@ -1951,76 +1953,76 @@ var De = (
|
|
|
1951
1953
|
}, t.prototype.evaluateUserCondition = function(e, r, n) {
|
|
1952
1954
|
var i = n.logBuilder;
|
|
1953
1955
|
if (i == null || i.appendUserCondition(e), !n.userAttributes)
|
|
1954
|
-
return n.isMissingUserObjectLogged || (this.logger.userObjectIsMissing(n.key), n.isMissingUserObjectLogged = !0),
|
|
1956
|
+
return n.isMissingUserObjectLogged || (this.logger.userObjectIsMissing(n.key), n.isMissingUserObjectLogged = !0), me;
|
|
1955
1957
|
var s = e.comparisonAttribute, o = n.userAttributes[s];
|
|
1956
1958
|
if (o == null || o === "")
|
|
1957
|
-
return this.logger.userObjectAttributeIsMissingCondition(
|
|
1959
|
+
return this.logger.userObjectAttributeIsMissingCondition(Re(e), n.key, s), hr(s);
|
|
1958
1960
|
var a, u, l, f;
|
|
1959
1961
|
switch (e.comparator) {
|
|
1960
1962
|
case c.TextEquals:
|
|
1961
1963
|
case c.TextNotEquals:
|
|
1962
|
-
return a =
|
|
1964
|
+
return a = k(s, o, e, n.key, this.logger), this.evaluateTextEquals(a, e.comparisonValue, e.comparator === c.TextNotEquals);
|
|
1963
1965
|
case c.SensitiveTextEquals:
|
|
1964
1966
|
case c.SensitiveTextNotEquals:
|
|
1965
|
-
return a =
|
|
1967
|
+
return a = k(s, o, e, n.key, this.logger), this.evaluateSensitiveTextEquals(a, e.comparisonValue, n.setting.configJsonSalt, r, e.comparator === c.SensitiveTextNotEquals);
|
|
1966
1968
|
case c.IsOneOf:
|
|
1967
1969
|
case c.IsNotOneOf:
|
|
1968
|
-
return a =
|
|
1970
|
+
return a = k(s, o, e, n.key, this.logger), this.evaluateIsOneOf(a, e.comparisonValue, e.comparator === c.IsNotOneOf);
|
|
1969
1971
|
case c.SensitiveIsOneOf:
|
|
1970
1972
|
case c.SensitiveIsNotOneOf:
|
|
1971
|
-
return a =
|
|
1973
|
+
return a = k(s, o, e, n.key, this.logger), this.evaluateSensitiveIsOneOf(a, e.comparisonValue, n.setting.configJsonSalt, r, e.comparator === c.SensitiveIsNotOneOf);
|
|
1972
1974
|
case c.TextStartsWithAnyOf:
|
|
1973
1975
|
case c.TextNotStartsWithAnyOf:
|
|
1974
|
-
return a =
|
|
1976
|
+
return a = k(s, o, e, n.key, this.logger), this.evaluateTextSliceEqualsAnyOf(a, e.comparisonValue, !0, e.comparator === c.TextNotStartsWithAnyOf);
|
|
1975
1977
|
case c.SensitiveTextStartsWithAnyOf:
|
|
1976
1978
|
case c.SensitiveTextNotStartsWithAnyOf:
|
|
1977
|
-
return a =
|
|
1979
|
+
return a = k(s, o, e, n.key, this.logger), this.evaluateSensitiveTextSliceEqualsAnyOf(a, e.comparisonValue, n.setting.configJsonSalt, r, !0, e.comparator === c.SensitiveTextNotStartsWithAnyOf);
|
|
1978
1980
|
case c.TextEndsWithAnyOf:
|
|
1979
1981
|
case c.TextNotEndsWithAnyOf:
|
|
1980
|
-
return a =
|
|
1982
|
+
return a = k(s, o, e, n.key, this.logger), this.evaluateTextSliceEqualsAnyOf(a, e.comparisonValue, !1, e.comparator === c.TextNotEndsWithAnyOf);
|
|
1981
1983
|
case c.SensitiveTextEndsWithAnyOf:
|
|
1982
1984
|
case c.SensitiveTextNotEndsWithAnyOf:
|
|
1983
|
-
return a =
|
|
1985
|
+
return a = k(s, o, e, n.key, this.logger), this.evaluateSensitiveTextSliceEqualsAnyOf(a, e.comparisonValue, n.setting.configJsonSalt, r, !1, e.comparator === c.SensitiveTextNotEndsWithAnyOf);
|
|
1984
1986
|
case c.ContainsAnyOf:
|
|
1985
1987
|
case c.NotContainsAnyOf:
|
|
1986
|
-
return a =
|
|
1988
|
+
return a = k(s, o, e, n.key, this.logger), this.evaluateContainsAnyOf(a, e.comparisonValue, e.comparator === c.NotContainsAnyOf);
|
|
1987
1989
|
case c.SemVerIsOneOf:
|
|
1988
1990
|
case c.SemVerIsNotOneOf:
|
|
1989
|
-
return u =
|
|
1991
|
+
return u = ft(s, o, e, n.key, this.logger), typeof u != "string" ? this.evaluateSemVerIsOneOf(u, e.comparisonValue, e.comparator === c.SemVerIsNotOneOf) : u;
|
|
1990
1992
|
case c.SemVerLess:
|
|
1991
1993
|
case c.SemVerLessOrEquals:
|
|
1992
1994
|
case c.SemVerGreater:
|
|
1993
1995
|
case c.SemVerGreaterOrEquals:
|
|
1994
|
-
return u =
|
|
1996
|
+
return u = ft(s, o, e, n.key, this.logger), typeof u != "string" ? this.evaluateSemVerRelation(u, e.comparator, e.comparisonValue) : u;
|
|
1995
1997
|
case c.NumberEquals:
|
|
1996
1998
|
case c.NumberNotEquals:
|
|
1997
1999
|
case c.NumberLess:
|
|
1998
2000
|
case c.NumberLessOrEquals:
|
|
1999
2001
|
case c.NumberGreater:
|
|
2000
2002
|
case c.NumberGreaterOrEquals:
|
|
2001
|
-
return l =
|
|
2003
|
+
return l = dr(s, o, e, n.key, this.logger), typeof l != "string" ? this.evaluateNumberRelation(l, e.comparator, e.comparisonValue) : l;
|
|
2002
2004
|
case c.DateTimeBefore:
|
|
2003
2005
|
case c.DateTimeAfter:
|
|
2004
|
-
return l =
|
|
2006
|
+
return l = pr(s, o, e, n.key, this.logger), typeof l != "string" ? this.evaluateDateTimeRelation(l, e.comparisonValue, e.comparator === c.DateTimeBefore) : l;
|
|
2005
2007
|
case c.ArrayContainsAnyOf:
|
|
2006
2008
|
case c.ArrayNotContainsAnyOf:
|
|
2007
|
-
return f =
|
|
2009
|
+
return f = ht(s, o, e, n.key, this.logger), typeof f != "string" ? this.evaluateArrayContainsAnyOf(f, e.comparisonValue, e.comparator === c.ArrayNotContainsAnyOf) : f;
|
|
2008
2010
|
case c.SensitiveArrayContainsAnyOf:
|
|
2009
2011
|
case c.SensitiveArrayNotContainsAnyOf:
|
|
2010
|
-
return f =
|
|
2012
|
+
return f = ht(s, o, e, n.key, this.logger), typeof f != "string" ? this.evaluateSensitiveArrayContainsAnyOf(f, e.comparisonValue, n.setting.configJsonSalt, r, e.comparator === c.SensitiveArrayNotContainsAnyOf) : f;
|
|
2011
2013
|
default:
|
|
2012
2014
|
throw new Error();
|
|
2013
2015
|
}
|
|
2014
2016
|
}, t.prototype.evaluateTextEquals = function(e, r, n) {
|
|
2015
2017
|
return e === r !== n;
|
|
2016
2018
|
}, t.prototype.evaluateSensitiveTextEquals = function(e, r, n, i, s) {
|
|
2017
|
-
var o =
|
|
2019
|
+
var o = Ee(e, n, i);
|
|
2018
2020
|
return o === r !== s;
|
|
2019
2021
|
}, t.prototype.evaluateIsOneOf = function(e, r, n) {
|
|
2020
2022
|
var i = r.indexOf(e) >= 0;
|
|
2021
2023
|
return i !== n;
|
|
2022
2024
|
}, t.prototype.evaluateSensitiveIsOneOf = function(e, r, n, i, s) {
|
|
2023
|
-
var o =
|
|
2025
|
+
var o = Ee(e, n, i), a = r.indexOf(o) >= 0;
|
|
2024
2026
|
return a !== s;
|
|
2025
2027
|
}, t.prototype.evaluateTextSliceEqualsAnyOf = function(e, r, n, i) {
|
|
2026
2028
|
for (var s = 0; s < r.length; s++) {
|
|
@@ -2036,7 +2038,7 @@ var De = (
|
|
|
2036
2038
|
for (var a = X(e), u = 0; u < r.length; u++) {
|
|
2037
2039
|
var l = r[u], f = l.indexOf("_"), h = parseInt(l.slice(0, f));
|
|
2038
2040
|
if (!(a.length < h)) {
|
|
2039
|
-
var g = s ? a.slice(0, h) : a.slice(a.length - h), v =
|
|
2041
|
+
var g = s ? a.slice(0, h) : a.slice(a.length - h), v = Dt(g, n, i), d = v === l.slice(f + 1);
|
|
2040
2042
|
if (d)
|
|
2041
2043
|
return !o;
|
|
2042
2044
|
}
|
|
@@ -2051,7 +2053,7 @@ var De = (
|
|
|
2051
2053
|
for (var i = !1, s = 0; s < r.length; s++) {
|
|
2052
2054
|
var o = r[s];
|
|
2053
2055
|
if (o.length) {
|
|
2054
|
-
var a =
|
|
2056
|
+
var a = Ae(o.trim());
|
|
2055
2057
|
if (!a)
|
|
2056
2058
|
return !1;
|
|
2057
2059
|
!i && e.compare(a) === 0 && (i = !0);
|
|
@@ -2059,7 +2061,7 @@ var De = (
|
|
|
2059
2061
|
}
|
|
2060
2062
|
return i !== n;
|
|
2061
2063
|
}, t.prototype.evaluateSemVerRelation = function(e, r, n) {
|
|
2062
|
-
var i =
|
|
2064
|
+
var i = Ae(n.trim());
|
|
2063
2065
|
if (!i)
|
|
2064
2066
|
return !1;
|
|
2065
2067
|
var s = e.compare(i);
|
|
@@ -2099,7 +2101,7 @@ var De = (
|
|
|
2099
2101
|
return n;
|
|
2100
2102
|
}, t.prototype.evaluateSensitiveArrayContainsAnyOf = function(e, r, n, i, s) {
|
|
2101
2103
|
for (var o = 0; o < e.length; o++) {
|
|
2102
|
-
var a =
|
|
2104
|
+
var a = Ee(e[o], n, i), u = r.indexOf(a) >= 0;
|
|
2103
2105
|
if (u)
|
|
2104
2106
|
return !s;
|
|
2105
2107
|
}
|
|
@@ -2110,10 +2112,10 @@ var De = (
|
|
|
2110
2112
|
var i = e.prerequisiteFlagKey, s = r.settings[i];
|
|
2111
2113
|
if (r.visitedFlags.push(r.key), r.visitedFlags.indexOf(i) >= 0) {
|
|
2112
2114
|
r.visitedFlags.push(i);
|
|
2113
|
-
var o =
|
|
2115
|
+
var o = Ce(r.visitedFlags, void 0, void 0, " -> ");
|
|
2114
2116
|
throw new Error("Circular dependency detected between the following depending flags: " + o + ".");
|
|
2115
2117
|
}
|
|
2116
|
-
var a =
|
|
2118
|
+
var a = Fe.forPrerequisiteFlag(i, s, r);
|
|
2117
2119
|
n == null || n.newLine("(").increaseIndent().newLine("Evaluating prerequisite flag '" + i + "':");
|
|
2118
2120
|
var u = this.evaluateSetting(a);
|
|
2119
2121
|
r.visitedFlags.pop();
|
|
@@ -2121,7 +2123,7 @@ var De = (
|
|
|
2121
2123
|
if (typeof l != typeof e.comparisonValue) {
|
|
2122
2124
|
if (ee(l))
|
|
2123
2125
|
throw new Error("Type mismatch between comparison value '" + e.comparisonValue + "' and prerequisite flag '" + i + "'.");
|
|
2124
|
-
|
|
2126
|
+
Te(l);
|
|
2125
2127
|
}
|
|
2126
2128
|
var f;
|
|
2127
2129
|
switch (e.comparator) {
|
|
@@ -2134,11 +2136,11 @@ var De = (
|
|
|
2134
2136
|
default:
|
|
2135
2137
|
throw new Error();
|
|
2136
2138
|
}
|
|
2137
|
-
return n == null || n.newLine("Prerequisite flag evaluation result: '" +
|
|
2139
|
+
return n == null || n.newLine("Prerequisite flag evaluation result: '" + ce(l) + "'.").newLine("Condition (").appendPrerequisiteFlagCondition(e).append(") evaluates to ").appendEvaluationResult(f).append(".").decreaseIndent().newLine(")"), f;
|
|
2138
2140
|
}, t.prototype.evaluateSegmentCondition = function(e, r) {
|
|
2139
2141
|
var n = r.logBuilder;
|
|
2140
2142
|
if (n == null || n.appendSegmentCondition(e), !r.userAttributes)
|
|
2141
|
-
return r.isMissingUserObjectLogged || (this.logger.userObjectIsMissing(r.key), r.isMissingUserObjectLogged = !0),
|
|
2143
|
+
return r.isMissingUserObjectLogged || (this.logger.userObjectIsMissing(r.key), r.isMissingUserObjectLogged = !0), me;
|
|
2142
2144
|
var i = e.segment;
|
|
2143
2145
|
n == null || n.newLine("(").increaseIndent().newLine("Evaluating segment '" + i.name + "':");
|
|
2144
2146
|
var s = this.evaluateConditions(i.conditions, void 0, i.name, r), o = s;
|
|
@@ -2152,61 +2154,61 @@ var De = (
|
|
|
2152
2154
|
default:
|
|
2153
2155
|
throw new Error();
|
|
2154
2156
|
}
|
|
2155
|
-
return n && (n.newLine("Segment evaluation result: "), (J(o) ? n.append(o) : n.append("User " +
|
|
2157
|
+
return n && (n.newLine("Segment evaluation result: "), (J(o) ? n.append(o) : n.append("User " + Rt(s ? W.IsIn : W.IsNotIn))).append("."), n.newLine("Condition (").appendSegmentCondition(e).append(")"), (J(o) ? n.append(" failed to evaluate") : n.append(" evaluates to ").appendEvaluationResult(o)).append("."), n.decreaseIndent().newLine(")")), o;
|
|
2156
2158
|
}, t;
|
|
2157
2159
|
}()
|
|
2158
2160
|
);
|
|
2159
2161
|
function J(t) {
|
|
2160
2162
|
return typeof t == "string";
|
|
2161
2163
|
}
|
|
2162
|
-
function
|
|
2163
|
-
return
|
|
2164
|
+
function Ft(t) {
|
|
2165
|
+
return ve(t) && !t.some(function(e) {
|
|
2164
2166
|
return typeof e != "string";
|
|
2165
2167
|
});
|
|
2166
2168
|
}
|
|
2167
|
-
function
|
|
2168
|
-
return
|
|
2169
|
+
function Ee(t, e, r) {
|
|
2170
|
+
return Dt(X(t), e, r);
|
|
2169
2171
|
}
|
|
2170
|
-
function
|
|
2171
|
-
return
|
|
2172
|
+
function Dt(t, e, r) {
|
|
2173
|
+
return Tt(t + X(e) + X(r));
|
|
2172
2174
|
}
|
|
2173
|
-
function
|
|
2174
|
-
return typeof t == "string" ? t : t instanceof Date ? t.getTime() / 1e3 + "" :
|
|
2175
|
+
function kt(t) {
|
|
2176
|
+
return typeof t == "string" ? t : t instanceof Date ? t.getTime() / 1e3 + "" : Ft(t) ? JSON.stringify(t) : t + "";
|
|
2175
2177
|
}
|
|
2176
|
-
function
|
|
2177
|
-
return typeof e == "string" || (e =
|
|
2178
|
+
function k(t, e, r, n, i) {
|
|
2179
|
+
return typeof e == "string" || (e = kt(e), i.userObjectAttributeIsAutoConverted(Re(r), n, t, e)), e;
|
|
2178
2180
|
}
|
|
2179
|
-
function
|
|
2181
|
+
function ft(t, e, r, n, i) {
|
|
2180
2182
|
var s;
|
|
2181
|
-
return typeof e == "string" && (s =
|
|
2183
|
+
return typeof e == "string" && (s = Ae(e.trim())) ? s : de(i, r, n, t, "'" + e + "' is not a valid semantic version");
|
|
2182
2184
|
}
|
|
2183
|
-
function
|
|
2185
|
+
function dr(t, e, r, n, i) {
|
|
2184
2186
|
if (typeof e == "number")
|
|
2185
2187
|
return e;
|
|
2186
2188
|
var s;
|
|
2187
|
-
return typeof e == "string" && (!isNaN(s =
|
|
2189
|
+
return typeof e == "string" && (!isNaN(s = Et(e.replace(",", "."))) || e === "NaN") ? s : de(i, r, n, t, "'" + e + "' is not a valid decimal number");
|
|
2188
2190
|
}
|
|
2189
|
-
function
|
|
2191
|
+
function pr(t, e, r, n, i) {
|
|
2190
2192
|
if (e instanceof Date)
|
|
2191
2193
|
return e.getTime() / 1e3;
|
|
2192
2194
|
if (typeof e == "number")
|
|
2193
2195
|
return e;
|
|
2194
2196
|
var s;
|
|
2195
|
-
return typeof e == "string" && (!isNaN(s =
|
|
2197
|
+
return typeof e == "string" && (!isNaN(s = Et(e.replace(",", "."))) || e === "NaN") ? s : de(i, r, n, t, "'" + e + "' is not a valid Unix timestamp (number of seconds elapsed since Unix epoch)");
|
|
2196
2198
|
}
|
|
2197
|
-
function
|
|
2199
|
+
function ht(t, e, r, n, i) {
|
|
2198
2200
|
var s = e;
|
|
2199
2201
|
if (typeof s == "string")
|
|
2200
2202
|
try {
|
|
2201
2203
|
s = JSON.parse(s);
|
|
2202
2204
|
} catch {
|
|
2203
2205
|
}
|
|
2204
|
-
return
|
|
2206
|
+
return Ft(s) ? s : de(i, r, n, t, "'" + e + "' is not a valid string array");
|
|
2205
2207
|
}
|
|
2206
|
-
function
|
|
2207
|
-
return t.userObjectAttributeIsInvalid(
|
|
2208
|
+
function de(t, e, r, n, i) {
|
|
2209
|
+
return t.userObjectAttributeIsInvalid(Re(e), r, i, n), gr(n, i);
|
|
2208
2210
|
}
|
|
2209
|
-
function
|
|
2211
|
+
function Pt(t, e, r, n) {
|
|
2210
2212
|
return {
|
|
2211
2213
|
key: t,
|
|
2212
2214
|
value: e.selectedValue.value,
|
|
@@ -2218,7 +2220,7 @@ function Ut(t, e, r, n) {
|
|
|
2218
2220
|
matchedPercentageOption: e.matchedPercentageOption
|
|
2219
2221
|
};
|
|
2220
2222
|
}
|
|
2221
|
-
function
|
|
2223
|
+
function _(t, e, r, n, i, s) {
|
|
2222
2224
|
return {
|
|
2223
2225
|
key: t,
|
|
2224
2226
|
value: e,
|
|
@@ -2229,39 +2231,39 @@ function B(t, e, r, n, i, s) {
|
|
|
2229
2231
|
errorException: s
|
|
2230
2232
|
};
|
|
2231
2233
|
}
|
|
2232
|
-
function
|
|
2234
|
+
function fe(t, e, r, n, i, s, o) {
|
|
2233
2235
|
var a;
|
|
2234
2236
|
if (!e)
|
|
2235
|
-
return a = o.configJsonIsNotPresentSingle(r, "defaultValue", n).toString(),
|
|
2237
|
+
return a = o.configJsonIsNotPresentSingle(r, "defaultValue", n).toString(), _(r, n, P(s), i, a);
|
|
2236
2238
|
var u = e[r];
|
|
2237
2239
|
if (!u)
|
|
2238
|
-
return a = o.settingEvaluationFailedDueToMissingKey(r, "defaultValue", n,
|
|
2239
|
-
var l = t.evaluate(n, new
|
|
2240
|
-
return
|
|
2240
|
+
return a = o.settingEvaluationFailedDueToMissingKey(r, "defaultValue", n, Ce(Object.keys(e))).toString(), _(r, n, P(s), i, a);
|
|
2241
|
+
var l = t.evaluate(n, new Fe(r, u, i, e));
|
|
2242
|
+
return Pt(r, l, P(s), i);
|
|
2241
2243
|
}
|
|
2242
|
-
function
|
|
2244
|
+
function gt(t, e, r, n, i, s) {
|
|
2243
2245
|
var o;
|
|
2244
|
-
if (!
|
|
2246
|
+
if (!be(e, i, s))
|
|
2245
2247
|
return [[], o];
|
|
2246
2248
|
for (var a = [], u = 0, l = Object.entries(e); u < l.length; u++) {
|
|
2247
2249
|
var f = l[u], h = f[0], g = f[1], v = void 0;
|
|
2248
2250
|
try {
|
|
2249
|
-
var d = t.evaluate(null, new
|
|
2250
|
-
v =
|
|
2251
|
+
var d = t.evaluate(null, new Fe(h, g, r, e));
|
|
2252
|
+
v = Pt(h, d, P(n), r);
|
|
2251
2253
|
} catch (y) {
|
|
2252
|
-
o ?? (o = []), o.push(y), v =
|
|
2254
|
+
o ?? (o = []), o.push(y), v = _(h, null, P(n), r, B(y), y);
|
|
2253
2255
|
}
|
|
2254
2256
|
a.push(v);
|
|
2255
2257
|
}
|
|
2256
2258
|
return [a, o];
|
|
2257
2259
|
}
|
|
2258
|
-
function
|
|
2260
|
+
function be(t, e, r) {
|
|
2259
2261
|
return t ? !0 : (e.configJsonIsNotPresent(r), !1);
|
|
2260
2262
|
}
|
|
2261
2263
|
function ee(t) {
|
|
2262
2264
|
return typeof t == "boolean" || typeof t == "string" || typeof t == "number";
|
|
2263
2265
|
}
|
|
2264
|
-
function
|
|
2266
|
+
function yr(t, e) {
|
|
2265
2267
|
switch (e) {
|
|
2266
2268
|
case x.Boolean:
|
|
2267
2269
|
return typeof t == "boolean";
|
|
@@ -2274,13 +2276,13 @@ function Er(t, e) {
|
|
|
2274
2276
|
return !1;
|
|
2275
2277
|
}
|
|
2276
2278
|
}
|
|
2277
|
-
function
|
|
2279
|
+
function Te(t) {
|
|
2278
2280
|
throw new TypeError(t === null ? "Setting value is null." : t === void 0 ? "Setting value is undefined." : "Setting value '" + t + "' is of an unsupported type (" + typeof t + ").");
|
|
2279
2281
|
}
|
|
2280
2282
|
function P(t) {
|
|
2281
2283
|
return t ? new Date(t.timestamp) : void 0;
|
|
2282
2284
|
}
|
|
2283
|
-
var
|
|
2285
|
+
var mr = (
|
|
2284
2286
|
/** @class */
|
|
2285
2287
|
function() {
|
|
2286
2288
|
function t() {
|
|
@@ -2294,8 +2296,8 @@ var Or = (
|
|
|
2294
2296
|
return [n, !0];
|
|
2295
2297
|
}
|
|
2296
2298
|
var o = {};
|
|
2297
|
-
n = new
|
|
2298
|
-
var a =
|
|
2299
|
+
n = new De(e, r, o);
|
|
2300
|
+
var a = Ct() ? WeakRef : wt();
|
|
2299
2301
|
return this.instances[e.sdkKey] = [new a(n), o], [n, !1];
|
|
2300
2302
|
}, t.prototype.remove = function(e, r) {
|
|
2301
2303
|
var n = this.instances[e];
|
|
@@ -2313,7 +2315,7 @@ var Or = (
|
|
|
2313
2315
|
return e;
|
|
2314
2316
|
}, t;
|
|
2315
2317
|
}()
|
|
2316
|
-
), Y = new
|
|
2318
|
+
), Y = new mr(), De = (
|
|
2317
2319
|
/** @class */
|
|
2318
2320
|
function() {
|
|
2319
2321
|
function t(e, r, n) {
|
|
@@ -2324,7 +2326,7 @@ var Or = (
|
|
|
2324
2326
|
throw new Error("Invalid 'configCatKernel' value");
|
|
2325
2327
|
if (!r.configFetcher)
|
|
2326
2328
|
throw new Error("Invalid 'configCatKernel.configFetcher' value");
|
|
2327
|
-
this.hooks = e.yieldHooks(), e.defaultUser && this.setDefaultUser(e.defaultUser), this.evaluator = new
|
|
2329
|
+
this.hooks = e.yieldHooks(), e.defaultUser && this.setDefaultUser(e.defaultUser), this.evaluator = new vr(e.logger), ((i = e.flagOverrides) === null || i === void 0 ? void 0 : i.behaviour) !== R.LocalOnly ? this.configService = e instanceof st ? new Jt(r.configFetcher, e) : e instanceof ot ? new sr(r.configFetcher, e) : e instanceof at ? new ir(r.configFetcher, e) : Ue(new Error("Invalid 'options' value")) : this.hooks.emit("clientReady", C.HasLocalOverrideFlagDataOnly), this.suppressFinalize = ae(this, { sdkKey: e.sdkKey, cacheToken: n, configService: this.configService, logger: e.logger });
|
|
2328
2330
|
}
|
|
2329
2331
|
return Object.defineProperty(t, "instanceCache", {
|
|
2330
2332
|
get: function() {
|
|
@@ -2336,8 +2338,8 @@ var Or = (
|
|
|
2336
2338
|
var s, o = "Invalid 'sdkKey' value";
|
|
2337
2339
|
if (!e)
|
|
2338
2340
|
throw new Error(o);
|
|
2339
|
-
var a = r === H.AutoPoll ?
|
|
2340
|
-
if (((s = u.flagOverrides) === null || s === void 0 ? void 0 : s.behaviour) !== R.LocalOnly && !
|
|
2341
|
+
var a = r === H.AutoPoll ? st : r === H.ManualPoll ? ot : r === H.LazyLoad ? at : Ue(new Error("Invalid 'pollingMode' value")), u = new a(e, i.sdkType, i.sdkVersion, n, i.defaultCacheFactory, i.eventEmitterFactory);
|
|
2342
|
+
if (((s = u.flagOverrides) === null || s === void 0 ? void 0 : s.behaviour) !== R.LocalOnly && !Er(e, u.baseUrlOverriden))
|
|
2341
2343
|
throw new Error(o);
|
|
2342
2344
|
var l = Y.getOrCreate(u, i), f = l[0], h = l[1];
|
|
2343
2345
|
return h && n && u.logger.clientIsAlreadyCreated(e), f;
|
|
@@ -2366,13 +2368,13 @@ var Or = (
|
|
|
2366
2368
|
return O(this, function(f) {
|
|
2367
2369
|
switch (f.label) {
|
|
2368
2370
|
case 0:
|
|
2369
|
-
this.options.logger.debug("getValueAsync() called."),
|
|
2371
|
+
this.options.logger.debug("getValueAsync() called."), he(e), ge(r), o = null, n ?? (n = this.defaultUser), f.label = 1;
|
|
2370
2372
|
case 1:
|
|
2371
2373
|
return f.trys.push([1, 3, , 4]), a = void 0, [4, this.getSettingsAsync()];
|
|
2372
2374
|
case 2:
|
|
2373
|
-
return l = f.sent(), a = l[0], o = l[1], s =
|
|
2375
|
+
return l = f.sent(), a = l[0], o = l[1], s = fe(this.evaluator, a, e, r, n, o, this.options.logger), i = s.value, [3, 4];
|
|
2374
2376
|
case 3:
|
|
2375
|
-
return u = f.sent(), this.options.logger.settingEvaluationErrorSingle("getValueAsync", e, "defaultValue", r, u), s =
|
|
2377
|
+
return u = f.sent(), this.options.logger.settingEvaluationErrorSingle("getValueAsync", e, "defaultValue", r, u), s = _(e, r, P(o), n, B(u), u), i = r, [3, 4];
|
|
2376
2378
|
case 4:
|
|
2377
2379
|
return this.hooks.emit("flagEvaluated", s), [2, i];
|
|
2378
2380
|
}
|
|
@@ -2384,13 +2386,13 @@ var Or = (
|
|
|
2384
2386
|
return O(this, function(l) {
|
|
2385
2387
|
switch (l.label) {
|
|
2386
2388
|
case 0:
|
|
2387
|
-
this.options.logger.debug("getValueDetailsAsync() called."),
|
|
2389
|
+
this.options.logger.debug("getValueDetailsAsync() called."), he(e), ge(r), s = null, n ?? (n = this.defaultUser), l.label = 1;
|
|
2388
2390
|
case 1:
|
|
2389
2391
|
return l.trys.push([1, 3, , 4]), o = void 0, [4, this.getSettingsAsync()];
|
|
2390
2392
|
case 2:
|
|
2391
|
-
return u = l.sent(), o = u[0], s = u[1], i =
|
|
2393
|
+
return u = l.sent(), o = u[0], s = u[1], i = fe(this.evaluator, o, e, r, n, s, this.options.logger), [3, 4];
|
|
2392
2394
|
case 3:
|
|
2393
|
-
return a = l.sent(), this.options.logger.settingEvaluationErrorSingle("getValueDetailsAsync", e, "defaultValue", r, a), i =
|
|
2395
|
+
return a = l.sent(), this.options.logger.settingEvaluationErrorSingle("getValueDetailsAsync", e, "defaultValue", r, a), i = _(e, r, P(s), n, B(a), a), [3, 4];
|
|
2394
2396
|
case 4:
|
|
2395
2397
|
return this.hooks.emit("flagEvaluated", i), [2, i];
|
|
2396
2398
|
}
|
|
@@ -2406,7 +2408,7 @@ var Or = (
|
|
|
2406
2408
|
case 1:
|
|
2407
2409
|
return i.trys.push([1, 3, , 4]), [4, this.getSettingsAsync()];
|
|
2408
2410
|
case 2:
|
|
2409
|
-
return r = i.sent()[0],
|
|
2411
|
+
return r = i.sent()[0], be(r, this.options.logger, e) ? [2, Object.keys(r)] : [2, []];
|
|
2410
2412
|
case 3:
|
|
2411
2413
|
return n = i.sent(), this.options.logger.settingEvaluationError("getAllKeysAsync", e, n), [2, []];
|
|
2412
2414
|
case 4:
|
|
@@ -2427,7 +2429,7 @@ var Or = (
|
|
|
2427
2429
|
case 1:
|
|
2428
2430
|
return d.trys.push([1, 3, , 4]), [4, this.getSettingsAsync()];
|
|
2429
2431
|
case 2:
|
|
2430
|
-
return o = d.sent(), a = o[0], u = o[1], v =
|
|
2432
|
+
return o = d.sent(), a = o[0], u = o[1], v = gt(this.evaluator, a, e, u, this.options.logger, r), i = v[0], s = v[1], n = i.map(function(y) {
|
|
2431
2433
|
return new $(y.key, y.value);
|
|
2432
2434
|
}), [3, 4];
|
|
2433
2435
|
case 3:
|
|
@@ -2449,7 +2451,7 @@ var Or = (
|
|
|
2449
2451
|
case 1:
|
|
2450
2452
|
return v.trys.push([1, 3, , 4]), [4, this.getSettingsAsync()];
|
|
2451
2453
|
case 2:
|
|
2452
|
-
return s = v.sent(), o = s[0], a = s[1], g =
|
|
2454
|
+
return s = v.sent(), o = s[0], a = s[1], g = gt(this.evaluator, o, e, a, this.options.logger, r), n = g[0], i = g[1], [3, 4];
|
|
2453
2455
|
case 3:
|
|
2454
2456
|
return u = v.sent(), this.options.logger.settingEvaluationError("getAllValueDetailsAsync", r, u), [2, []];
|
|
2455
2457
|
case 4:
|
|
@@ -2469,24 +2471,24 @@ var Or = (
|
|
|
2469
2471
|
case 1:
|
|
2470
2472
|
return A.trys.push([1, 3, , 4]), [4, this.getSettingsAsync()];
|
|
2471
2473
|
case 2:
|
|
2472
|
-
if (n = A.sent()[0], !
|
|
2474
|
+
if (n = A.sent()[0], !be(n, this.options.logger, r))
|
|
2473
2475
|
return [2, null];
|
|
2474
2476
|
for (i = 0, s = Object.entries(n); i < s.length; i++) {
|
|
2475
2477
|
if (o = s[i], a = o[0], u = o[1], e === u.variationId)
|
|
2476
|
-
return [2, new $(a,
|
|
2478
|
+
return [2, new $(a, ie(u.value))];
|
|
2477
2479
|
if (l = n[a].targetingRules, l && l.length > 0) {
|
|
2478
2480
|
for (v = 0; v < l.length; v++)
|
|
2479
|
-
if (f = l[v].then,
|
|
2481
|
+
if (f = l[v].then, ve(f)) {
|
|
2480
2482
|
for (h = 0; h < f.length; h++)
|
|
2481
2483
|
if (d = f[h], e === d.variationId)
|
|
2482
|
-
return [2, new $(a,
|
|
2484
|
+
return [2, new $(a, ie(d.value))];
|
|
2483
2485
|
} else if (e === f.variationId)
|
|
2484
|
-
return [2, new $(a,
|
|
2486
|
+
return [2, new $(a, ie(f.value))];
|
|
2485
2487
|
}
|
|
2486
2488
|
if (g = n[a].percentageOptions, g && g.length > 0) {
|
|
2487
2489
|
for (v = 0; v < g.length; v++)
|
|
2488
2490
|
if (d = g[v], e === d.variationId)
|
|
2489
|
-
return [2, new $(a,
|
|
2491
|
+
return [2, new $(a, ie(d.value))];
|
|
2490
2492
|
}
|
|
2491
2493
|
}
|
|
2492
2494
|
return this.options.logger.settingForVariationIdIsNotPresent(e), [3, 4];
|
|
@@ -2511,11 +2513,11 @@ var Or = (
|
|
|
2511
2513
|
case 2:
|
|
2512
2514
|
return e = n.sent()[0], [2, e];
|
|
2513
2515
|
case 3:
|
|
2514
|
-
return r = n.sent(), this.options.logger.forceRefreshError("forceRefreshAsync", r), [2,
|
|
2516
|
+
return r = n.sent(), this.options.logger.forceRefreshError("forceRefreshAsync", r), [2, ue.failure(B(r), r)];
|
|
2515
2517
|
case 4:
|
|
2516
2518
|
return [3, 6];
|
|
2517
2519
|
case 5:
|
|
2518
|
-
return [2,
|
|
2520
|
+
return [2, ue.failure("Client is configured to use the LocalOnly override behavior, which prevents making HTTP requests.")];
|
|
2519
2521
|
case 6:
|
|
2520
2522
|
return [
|
|
2521
2523
|
2
|
|
@@ -2552,14 +2554,14 @@ var Or = (
|
|
|
2552
2554
|
var f = l.dataSource.getOverridesSync();
|
|
2553
2555
|
switch (l.behaviour) {
|
|
2554
2556
|
case R.LocalOnly:
|
|
2555
|
-
return new
|
|
2557
|
+
return new ne(f, null, this);
|
|
2556
2558
|
case R.LocalOverRemote:
|
|
2557
|
-
return e = o(), a = e[0], u = e[1], new
|
|
2559
|
+
return e = o(), a = e[0], u = e[1], new ne(F(F({}, a ?? {}), f), u, this);
|
|
2558
2560
|
case R.RemoteOverLocal:
|
|
2559
|
-
return r = o(), a = r[0], u = r[1], new
|
|
2561
|
+
return r = o(), a = r[0], u = r[1], new ne(F(F({}, f), a ?? {}), u, this);
|
|
2560
2562
|
}
|
|
2561
2563
|
}
|
|
2562
|
-
return n = o(), a = n[0], u = n[1], new
|
|
2564
|
+
return n = o(), a = n[0], u = n[1], new ne(a, u, this);
|
|
2563
2565
|
}, t.prototype.getSettingsAsync = function() {
|
|
2564
2566
|
var e;
|
|
2565
2567
|
return E(this, void 0, void 0, function() {
|
|
@@ -2623,7 +2625,7 @@ var Or = (
|
|
|
2623
2625
|
return this.hooks.eventNames();
|
|
2624
2626
|
}, t;
|
|
2625
2627
|
}()
|
|
2626
|
-
),
|
|
2628
|
+
), ne = (
|
|
2627
2629
|
/** @class */
|
|
2628
2630
|
function() {
|
|
2629
2631
|
function t(e, r, n) {
|
|
@@ -2639,23 +2641,23 @@ var Or = (
|
|
|
2639
2641
|
}), t.prototype.getAllKeys = function() {
|
|
2640
2642
|
return this.mergedSettings ? Object.keys(this.mergedSettings) : [];
|
|
2641
2643
|
}, t.prototype.getValue = function(e, r, n) {
|
|
2642
|
-
this.options.logger.debug("Snapshot.getValue() called."),
|
|
2644
|
+
this.options.logger.debug("Snapshot.getValue() called."), he(e), ge(r);
|
|
2643
2645
|
var i, s;
|
|
2644
2646
|
n ?? (n = this.defaultUser);
|
|
2645
2647
|
try {
|
|
2646
|
-
s =
|
|
2648
|
+
s = fe(this.evaluator, this.mergedSettings, e, r, n, this.remoteConfig, this.options.logger), i = s.value;
|
|
2647
2649
|
} catch (o) {
|
|
2648
|
-
this.options.logger.settingEvaluationErrorSingle("Snapshot.getValue", e, "defaultValue", r, o), s =
|
|
2650
|
+
this.options.logger.settingEvaluationErrorSingle("Snapshot.getValue", e, "defaultValue", r, o), s = _(e, r, P(this.remoteConfig), n, B(o), o), i = r;
|
|
2649
2651
|
}
|
|
2650
2652
|
return this.options.hooks.emit("flagEvaluated", s), i;
|
|
2651
2653
|
}, t.prototype.getValueDetails = function(e, r, n) {
|
|
2652
|
-
this.options.logger.debug("Snapshot.getValueDetails() called."),
|
|
2654
|
+
this.options.logger.debug("Snapshot.getValueDetails() called."), he(e), ge(r);
|
|
2653
2655
|
var i;
|
|
2654
2656
|
n ?? (n = this.defaultUser);
|
|
2655
2657
|
try {
|
|
2656
|
-
i =
|
|
2658
|
+
i = fe(this.evaluator, this.mergedSettings, e, r, n, this.remoteConfig, this.options.logger);
|
|
2657
2659
|
} catch (s) {
|
|
2658
|
-
this.options.logger.settingEvaluationErrorSingle("Snapshot.getValueDetails", e, "defaultValue", r, s), i =
|
|
2660
|
+
this.options.logger.settingEvaluationErrorSingle("Snapshot.getValueDetails", e, "defaultValue", r, s), i = _(e, r, P(this.remoteConfig), n, B(s), s);
|
|
2659
2661
|
}
|
|
2660
2662
|
return this.options.hooks.emit("flagEvaluated", i), i;
|
|
2661
2663
|
}, t;
|
|
@@ -2669,7 +2671,7 @@ var Or = (
|
|
|
2669
2671
|
return t;
|
|
2670
2672
|
}()
|
|
2671
2673
|
);
|
|
2672
|
-
function
|
|
2674
|
+
function Er(t, e) {
|
|
2673
2675
|
var r = "configcat-proxy/";
|
|
2674
2676
|
if (e && t.length > r.length && t.lastIndexOf(r, 0) === 0)
|
|
2675
2677
|
return !0;
|
|
@@ -2683,43 +2685,46 @@ function Sr(t, e) {
|
|
|
2683
2685
|
return !1;
|
|
2684
2686
|
}
|
|
2685
2687
|
}
|
|
2686
|
-
function
|
|
2688
|
+
function he(t) {
|
|
2687
2689
|
if (!t)
|
|
2688
2690
|
throw new Error("Invalid 'key' value");
|
|
2689
2691
|
}
|
|
2690
|
-
function
|
|
2692
|
+
function ge(t) {
|
|
2691
2693
|
if (t != null && !ee(t))
|
|
2692
2694
|
throw new TypeError("The default value must be boolean, number, string, null or undefined.");
|
|
2693
2695
|
}
|
|
2694
|
-
function
|
|
2695
|
-
return ee(t) ? t :
|
|
2696
|
+
function ie(t) {
|
|
2697
|
+
return ee(t) ? t : Te(t);
|
|
2696
2698
|
}
|
|
2697
|
-
var
|
|
2699
|
+
var ae = function(t, e) {
|
|
2698
2700
|
if (typeof FinalizationRegistry < "u") {
|
|
2699
2701
|
var r = new FinalizationRegistry(function(n) {
|
|
2700
|
-
return
|
|
2702
|
+
return De.finalize(n);
|
|
2701
2703
|
});
|
|
2702
|
-
|
|
2704
|
+
ae = function(n, i) {
|
|
2703
2705
|
var s = {};
|
|
2704
2706
|
return r.register(n, i, s), function() {
|
|
2705
2707
|
return r.unregister(s);
|
|
2706
2708
|
};
|
|
2707
2709
|
};
|
|
2708
2710
|
} else
|
|
2709
|
-
|
|
2711
|
+
ae = function() {
|
|
2710
2712
|
return function() {
|
|
2711
2713
|
};
|
|
2712
2714
|
};
|
|
2713
|
-
return
|
|
2715
|
+
return ae(t, e);
|
|
2714
2716
|
};
|
|
2715
|
-
|
|
2716
|
-
function
|
|
2717
|
-
return
|
|
2717
|
+
Xt();
|
|
2718
|
+
function Or(t, e, r, n) {
|
|
2719
|
+
return De.get(t, e, r, n);
|
|
2718
2720
|
}
|
|
2719
|
-
function
|
|
2720
|
-
return new
|
|
2721
|
+
function Nr(t) {
|
|
2722
|
+
return new St(t);
|
|
2721
2723
|
}
|
|
2722
|
-
|
|
2724
|
+
function Lr(t, e, r) {
|
|
2725
|
+
return new nr(new rr(t, r), e);
|
|
2726
|
+
}
|
|
2727
|
+
class Sr {
|
|
2723
2728
|
handleStateChange(e, r, n) {
|
|
2724
2729
|
try {
|
|
2725
2730
|
if (e.readyState === 4) {
|
|
@@ -2744,7 +2749,7 @@ class br {
|
|
|
2744
2749
|
try {
|
|
2745
2750
|
e.logger.debug("HttpConfigFetcher.fetchLogic() called.");
|
|
2746
2751
|
const s = new XMLHttpRequest();
|
|
2747
|
-
s.onreadystatechange = () => this.handleStateChange(s, n, i), s.ontimeout = () => i(new
|
|
2752
|
+
s.onreadystatechange = () => this.handleStateChange(s, n, i), s.ontimeout = () => i(new se("timeout", e.requestTimeoutMs)), s.onabort = () => i(new se("abort")), s.onerror = () => i(new se("failure"));
|
|
2748
2753
|
let o = e.getUrl();
|
|
2749
2754
|
r && (o += "&ccetag=" + encodeURIComponent(r)), s.open("GET", o, !0), s.timeout = e.requestTimeoutMs, s.send(null);
|
|
2750
2755
|
} catch (s) {
|
|
@@ -2753,24 +2758,24 @@ class br {
|
|
|
2753
2758
|
});
|
|
2754
2759
|
}
|
|
2755
2760
|
}
|
|
2756
|
-
class
|
|
2761
|
+
class ke {
|
|
2757
2762
|
constructor(e) {
|
|
2758
2763
|
this.storage = e;
|
|
2759
2764
|
}
|
|
2760
2765
|
static setup(e, r) {
|
|
2761
|
-
const n = (r ??
|
|
2762
|
-
return n && (e.defaultCacheFactory = (i) => new
|
|
2766
|
+
const n = (r ?? Ar)();
|
|
2767
|
+
return n && (e.defaultCacheFactory = (i) => new Ot(new ke(n), i.logger)), e;
|
|
2763
2768
|
}
|
|
2764
2769
|
set(e, r) {
|
|
2765
|
-
this.storage.setItem(e,
|
|
2770
|
+
this.storage.setItem(e, br(r));
|
|
2766
2771
|
}
|
|
2767
2772
|
get(e) {
|
|
2768
2773
|
const r = this.storage.getItem(e);
|
|
2769
2774
|
if (r)
|
|
2770
|
-
return
|
|
2775
|
+
return Tr(r);
|
|
2771
2776
|
}
|
|
2772
2777
|
}
|
|
2773
|
-
function
|
|
2778
|
+
function Ar() {
|
|
2774
2779
|
const t = "__configcat_localStorage_test";
|
|
2775
2780
|
try {
|
|
2776
2781
|
const e = window.localStorage;
|
|
@@ -2787,20 +2792,20 @@ function Tr() {
|
|
|
2787
2792
|
}
|
|
2788
2793
|
return null;
|
|
2789
2794
|
}
|
|
2790
|
-
function
|
|
2795
|
+
function br(t) {
|
|
2791
2796
|
return t = encodeURIComponent(t), t = t.replace(/%([0-9A-F]{2})/g, (e, r) => String.fromCharCode(parseInt(r, 16))), btoa(t);
|
|
2792
2797
|
}
|
|
2793
|
-
function
|
|
2798
|
+
function Tr(t) {
|
|
2794
2799
|
return t = atob(t), t = t.replace(/[%\x80-\xFF]/g, (e) => "%" + e.charCodeAt(0).toString(16)), decodeURIComponent(t);
|
|
2795
2800
|
}
|
|
2796
|
-
const
|
|
2801
|
+
const Ir = "2.2.2", Rr = {
|
|
2797
2802
|
// Vue's `App.prototype.use` does not play nicely with generic `install` functions, so we resort to using a discriminated union.
|
|
2798
2803
|
install: (t, e) => {
|
|
2799
|
-
const { sdkKey: r, pollingMode: n, clientOptions: i } = e, s =
|
|
2804
|
+
const { sdkKey: r, pollingMode: n, clientOptions: i } = e, s = ke.setup({
|
|
2800
2805
|
sdkType: "ConfigCat-Vue",
|
|
2801
|
-
sdkVersion:
|
|
2802
|
-
configFetcher: new
|
|
2803
|
-
}), o =
|
|
2806
|
+
sdkVersion: Ir,
|
|
2807
|
+
configFetcher: new Sr()
|
|
2808
|
+
}), o = Or(
|
|
2804
2809
|
r,
|
|
2805
2810
|
n ?? H.AutoPoll,
|
|
2806
2811
|
i,
|
|
@@ -2812,7 +2817,7 @@ const Cr = "2.1.0", Pr = {
|
|
|
2812
2817
|
a.apply(arguments), o.dispose();
|
|
2813
2818
|
};
|
|
2814
2819
|
}
|
|
2815
|
-
},
|
|
2820
|
+
}, Fr = /* @__PURE__ */ Ut({
|
|
2816
2821
|
__name: "FeatureWrapper",
|
|
2817
2822
|
props: {
|
|
2818
2823
|
featureKey: {},
|
|
@@ -2820,13 +2825,13 @@ const Cr = "2.1.0", Pr = {
|
|
|
2820
2825
|
},
|
|
2821
2826
|
emits: ["flagValueChanged"],
|
|
2822
2827
|
setup(t, { emit: e }) {
|
|
2823
|
-
const r = t, n =
|
|
2828
|
+
const r = t, n = Mt(null), i = xt("configCatClient") ?? (() => {
|
|
2824
2829
|
throw new Error("ConfigCatPlugin was not installed.");
|
|
2825
2830
|
})(), s = () => {
|
|
2826
2831
|
const a = i.snapshot().getValue(r.featureKey, !1, r.userObject);
|
|
2827
2832
|
n.value !== a && (n.value = a, e("flagValueChanged", a));
|
|
2828
2833
|
};
|
|
2829
|
-
return
|
|
2834
|
+
return Wt(() => {
|
|
2830
2835
|
const o = i.snapshot(), a = o.cacheState;
|
|
2831
2836
|
a == C.HasUpToDateFlagData || a == C.HasLocalOverrideFlagDataOnly ? (n.value = o.getValue(
|
|
2832
2837
|
r.featureKey,
|
|
@@ -2836,38 +2841,27 @@ const Cr = "2.1.0", Pr = {
|
|
|
2836
2841
|
const l = s;
|
|
2837
2842
|
l && (n.value = u, i.on("configChanged", l));
|
|
2838
2843
|
});
|
|
2839
|
-
}),
|
|
2844
|
+
}), Vt(() => {
|
|
2840
2845
|
i.off("configChanged", s);
|
|
2841
|
-
}), (o, a) => (
|
|
2842
|
-
n.value === !0 ? (re(), ne("div", Nr, [
|
|
2843
|
-
me(o.$slots, "default")
|
|
2844
|
-
])) : n.value === !1 ? (re(), ne("div", Lr, [
|
|
2845
|
-
me(o.$slots, "else")
|
|
2846
|
-
])) : (re(), ne("div", Rr, [
|
|
2847
|
-
me(o.$slots, "loading")
|
|
2848
|
-
]))
|
|
2849
|
-
]));
|
|
2846
|
+
}), (o, a) => n.value === !0 ? pe(o.$slots, "default", { key: 0 }) : n.value === !1 ? pe(o.$slots, "else", { key: 1 }) : pe(o.$slots, "loading", { key: 2 });
|
|
2850
2847
|
}
|
|
2851
2848
|
});
|
|
2852
|
-
function Ur(t, e) {
|
|
2853
|
-
return new sr(new ir(t), e);
|
|
2854
|
-
}
|
|
2855
2849
|
export {
|
|
2856
2850
|
C as ClientCacheState,
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2851
|
+
Rr as ConfigCatPlugin,
|
|
2852
|
+
le as DataGovernance,
|
|
2853
|
+
Fr as FeatureWrapper,
|
|
2860
2854
|
T as FormattableLogMessage,
|
|
2861
2855
|
p as LogLevel,
|
|
2862
2856
|
R as OverrideBehaviour,
|
|
2863
2857
|
H as PollingMode,
|
|
2864
2858
|
K as PrerequisiteFlagComparator,
|
|
2865
|
-
|
|
2859
|
+
ue as RefreshResult,
|
|
2866
2860
|
W as SegmentComparator,
|
|
2867
2861
|
$ as SettingKeyValue,
|
|
2868
2862
|
x as SettingType,
|
|
2869
|
-
|
|
2863
|
+
Cr as User,
|
|
2870
2864
|
c as UserComparator,
|
|
2871
|
-
|
|
2872
|
-
|
|
2865
|
+
Nr as createConsoleLogger,
|
|
2866
|
+
Lr as createFlagOverridesFromMap
|
|
2873
2867
|
};
|