@picked/client 0.0.1-dev.1767832235641 → 0.0.1-dev.1767836126674

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,100 +1,745 @@
1
- var k = Object.defineProperty;
2
- var P = (e, t, i) => t in e ? k(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
- var r = (e, t, i) => P(e, typeof t != "symbol" ? t + "" : t, i);
4
- import { c as E, a as b, b as x, d as z, e as A, f as C, g as F, h as v, i as B, j as R, p as $, s as U, k as y, l as O, m as _, n as L, o as K, q as G, r as N, t as I } from "../user-session-C7d13-Tp.js";
5
- import { l as d } from "../logger-C9a75KZn.js";
6
- import { c as W, e as u, d as q } from "../experience-instance-Du9C8zgX.js";
7
- import { i as St } from "../experience-instance-Du9C8zgX.js";
8
- import { createEvent as D } from "effector";
9
- import { s as f, a as l, b as H } from "../supports-DBMT17KZ.js";
10
- import { g as kt, k as Pt, d as Et, i as bt, e as xt, c as zt, f as At, h as Ct, j as Ft } from "../supports-DBMT17KZ.js";
11
- import { c as T, s as w } from "../storage-BLmAhfhl.js";
12
- import { l as Bt, a as Rt } from "../storage-BLmAhfhl.js";
13
- const V = (e, t, i) => {
14
- const s = t.name, n = t.setup(e);
15
- if (n) {
16
- const o = i[s] ?? {};
17
- i[s] = Object.freeze({ ...o, ...n });
1
+ var J = Object.defineProperty;
2
+ var Q = (t, e, r) => e in t ? J(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var h = (t, e, r) => Q(t, typeof e != "symbol" ? e + "" : e, r);
4
+ import { createDomain as b, createApi as F, createEffect as N, attach as X, sample as x, combine as z, createEvent as D } from "effector";
5
+ import { createFactory as w, invoke as I } from "@withease/factories";
6
+ import { g as H, t as Z, c as ee, i as te, e as j, a as re, b as ne, d as se } from "../experience-instance-Du9HFg3P.js";
7
+ import { f as Pt } from "../experience-instance-Du9HFg3P.js";
8
+ import { l as k } from "../logger-C9a75KZn.js";
9
+ import { c as A, l as O, s as C } from "../storage-BLmAhfhl.js";
10
+ import { a as Rt } from "../storage-BLmAhfhl.js";
11
+ import { g as ie } from "../id-BW-g3y32.js";
12
+ import { i as oe } from "../object-JwZ58NOH.js";
13
+ import { s as U, a as M, b as ae, c as ce, d as ue } from "../supports-BjhuLJ8z.js";
14
+ import { h as Bt, f as Ot, j as Ct, e as zt, g as Dt, i as Ut, k as Mt } from "../supports-BjhuLJ8z.js";
15
+ const q = b("experience"), de = w(
16
+ ({ client: t, experience: e }) => {
17
+ const r = q.store(e), n = F(r, {
18
+ merge(c, g) {
19
+ return {
20
+ ...c,
21
+ ...g.experience
22
+ };
23
+ }
24
+ }), i = r.map((c) => ({
25
+ name: c.name,
26
+ decisionLogic: c.condition ?? c.decide,
27
+ targetSelectors: c.targets,
28
+ initializeOpenLogic: e.initializeOpen
29
+ })), a = t.components.listStore.map(
30
+ (c) => c.find((g) => g.name === `experience:${e.id}`) || c.find((g) => g.name === "experience"),
31
+ { skipVoid: !1 }
32
+ ), s = r.map((c) => ({
33
+ steps: c.steps,
34
+ nodes: c.nodes,
35
+ edges: c.edges,
36
+ conditionals: c.conditionals
37
+ })), o = e.actions ?? [];
38
+ return {
39
+ id: e.id,
40
+ configStore: i,
41
+ treeStore: s,
42
+ componentStore: a,
43
+ actions: o,
44
+ merge: n.merge
45
+ };
46
+ }
47
+ );
48
+ function le(t) {
49
+ return I(de, t);
50
+ }
51
+ const pe = w(({ client: t }) => {
52
+ const e = q.store({}), r = F(e, {
53
+ register(s, o) {
54
+ return {
55
+ ...s,
56
+ [o.id]: o
57
+ };
58
+ }
59
+ });
60
+ function n(s) {
61
+ const o = e.getState()[s.id];
62
+ if (o) {
63
+ o.merge({ experience: s, strategy: "override" });
64
+ return;
65
+ }
66
+ const c = le({ client: t, experience: s });
67
+ r.register(c);
68
+ }
69
+ const i = e.map((s) => Object.values(s));
70
+ function a(s) {
71
+ return e.map((o) => o[s], { skipVoid: !1 });
72
+ }
73
+ return {
74
+ register: n,
75
+ getById: a,
76
+ listStore: i
77
+ };
78
+ });
79
+ function fe(t) {
80
+ return I(pe, t);
81
+ }
82
+ const ge = (t, e) => {
83
+ e.register(t);
84
+ }, K = (t, e) => {
85
+ const { targetSelectors: r } = e.configStore.getState(), n = H(r, e.id);
86
+ n.forEach(
87
+ ({ elements: a }) => a.forEach((s) => Z(s, e.id))
88
+ ), ee(n, e.id).forEach((a) => {
89
+ t.experienceInstances.spawn(e, a);
90
+ });
91
+ }, V = async (t) => {
92
+ await Promise.all(
93
+ t.experiences.listStore.getState().map(async (e) => {
94
+ await me(t, e) && K(t, e);
95
+ })
96
+ );
97
+ }, me = async (t, e) => {
98
+ const { decisionLogic: r, targetSelectors: n } = e.configStore.getState();
99
+ return H(n, e.id).length < 1 || n.length === 0 ? !1 : r && te(r) ? await j(t, r) === !0 : !0;
100
+ }, he = (t, e, r) => {
101
+ const n = e.name, i = e.setup(t);
102
+ if (i) {
103
+ const a = r[n] ?? {};
104
+ r[n] = Object.freeze({ ...a, ...i });
105
+ }
106
+ }, ye = b("component"), Se = w(
107
+ ({ client: t, component: e, name: r }) => {
108
+ const n = t.frameworks.getByName(e.frameworkName);
109
+ return {
110
+ name: r,
111
+ component: e,
112
+ frameworkStore: n
113
+ };
114
+ }
115
+ );
116
+ function ke(t) {
117
+ return I(Se, t);
118
+ }
119
+ const we = w(({ client: t }) => {
120
+ const e = ye.store({}), r = F(e, {
121
+ register(s, o) {
122
+ return {
123
+ ...s,
124
+ [o.name]: o
125
+ };
126
+ }
127
+ });
128
+ function n(s, o) {
129
+ e.getState()[s] && k(
130
+ "warn",
131
+ `Component '${s}' already registered. Registering again will override the previous registration.`
132
+ );
133
+ const g = ke({ client: t, name: s, component: o });
134
+ r.register(g);
135
+ }
136
+ const i = e.map((s) => Object.values(s));
137
+ function a(s) {
138
+ return e.map((o) => o[s], { skipVoid: !1 });
139
+ }
140
+ return {
141
+ register: n,
142
+ getByName: a,
143
+ listStore: i
144
+ };
145
+ });
146
+ function Ie(t) {
147
+ return I(we, t);
148
+ }
149
+ const T = (t, e, r) => {
150
+ r.register(t, e);
151
+ }, ve = b("framework"), be = w(({ client: t }) => {
152
+ const e = ve.store({}), r = F(e, {
153
+ register(s, o) {
154
+ return {
155
+ ...s,
156
+ [o.name]: o.framework
157
+ };
158
+ }
159
+ });
160
+ function n(s, o) {
161
+ e.getState()[s] && k(
162
+ "warn",
163
+ `Framework '${s}' already registered. Registering again will override the previous registration.`
164
+ ), r.register({ name: s, framework: o });
165
+ }
166
+ const i = e.map((s) => Object.values(s));
167
+ function a(s) {
168
+ return e.map((o) => o[s], { skipVoid: !1 });
169
+ }
170
+ return {
171
+ register: n,
172
+ getByName: a,
173
+ listStore: i
174
+ };
175
+ });
176
+ function Fe(t) {
177
+ return I(be, t);
178
+ }
179
+ const xe = (t, e) => {
180
+ e.register(t.name, t);
181
+ }, je = 6e3, Ee = A("last_ping", "global"), Pe = (t) => `${t}/api/v1/ping`, Ae = async (t) => {
182
+ try {
183
+ const e = Date.now(), r = O.get(Ee);
184
+ let n = 0;
185
+ if (r.isSet() && (n = r.json() ?? 0), n && e - n < je)
186
+ return !0;
187
+ const i = Pe(t.apiUrl), a = {
188
+ projectId: t.projectId,
189
+ path: window.location.pathname
190
+ }, s = JSON.stringify(a), o = {
191
+ "Content-Type": "application/json"
192
+ }, c = document.getElementById("picked_script"), g = c == null ? void 0 : c.dataset.verceltoken;
193
+ g && (o["x-vercel-protection-bypass"] = g);
194
+ const l = (await fetch(i, {
195
+ method: "POST",
196
+ headers: o,
197
+ body: s
198
+ })).ok;
199
+ return l && r.set(e), l;
200
+ } catch (e) {
201
+ return k("error", e), !1;
18
202
  }
19
203
  };
20
- function J(e) {
21
- const t = typeof window < "u", i = {
22
- client: e,
23
- responses: e.responses.listStore.getState(),
24
- fields: e.fields.listStore.getState(),
25
- location: t ? window.location : void 0,
26
- document: t ? window.document : void 0,
27
- sessionStorage: t ? window.sessionStorage : void 0,
28
- localStorage: t ? window.localStorage : void 0
204
+ function Re(t) {
205
+ const e = typeof window < "u", r = {
206
+ client: t,
207
+ responses: t.responses.listStore.getState(),
208
+ fields: t.fields.listStore.getState(),
209
+ location: e ? window.location : void 0,
210
+ document: e ? window.document : void 0,
211
+ sessionStorage: e ? window.sessionStorage : void 0,
212
+ localStorage: e ? window.localStorage : void 0
213
+ };
214
+ return Object.freeze(r);
215
+ }
216
+ const $e = b("predicate"), Be = w(({ client: t }) => {
217
+ const e = $e.store({}), r = F(e, {
218
+ register(s, o) {
219
+ return {
220
+ ...s,
221
+ [o.name]: {
222
+ name: o.name,
223
+ predicate: o.predicate
224
+ }
225
+ };
226
+ }
227
+ });
228
+ function n(s, o) {
229
+ e.getState()[s] && k(
230
+ "warn",
231
+ `Predicate '${s}' already registered. Registering again will override the previous registration.`
232
+ ), r.register(Object.freeze({ name: s, predicate: o }));
233
+ }
234
+ const i = e.map((s) => Object.values(s));
235
+ function a(s) {
236
+ return e.map((o) => o[s], { skipVoid: !1 });
237
+ }
238
+ return {
239
+ register: n,
240
+ getByName: a,
241
+ listStore: i
29
242
  };
30
- return Object.freeze(i);
243
+ });
244
+ function Oe(t) {
245
+ return I(Be, t);
31
246
  }
32
- const M = () => D(), Y = () => "0.0.1-dev.1767832235641";
33
- function Q() {
34
- if (f()) {
35
- const e = [
247
+ const Ce = (t, e, r) => {
248
+ r.register(t, e);
249
+ }, _ = b("feature"), ze = w(({ client: t }) => {
250
+ const e = _.store({}), r = _.store([]), n = F(e, {
251
+ register(l, d) {
252
+ return {
253
+ ...l,
254
+ [d.id]: d.feature
255
+ };
256
+ }
257
+ });
258
+ function i(l, d) {
259
+ e.getState()[l] && k(
260
+ "warn",
261
+ `Feature '${l}' already registered. Registering again will override the previous registration.`
262
+ );
263
+ const p = {
264
+ id: l,
265
+ feature: {
266
+ ...d,
267
+ id: l
268
+ }
269
+ };
270
+ n.register(
271
+ Object.freeze({
272
+ id: l,
273
+ feature: p
274
+ })
275
+ );
276
+ }
277
+ const a = N(
278
+ async ({
279
+ id: l,
280
+ key: d,
281
+ storage: u = "local"
282
+ }) => {
283
+ const p = A(`feature:${l}:${d}`, "global"), f = (u === "session" ? C : O).get(p).boolean();
284
+ return f === null ? null : { id: l, key: d, bucket: f, storage: u };
285
+ }
286
+ ), s = N((l) => {
287
+ if (!l)
288
+ return null;
289
+ const d = A(`feature:${l.id}:${l.key}`, "global");
290
+ (l.storage === "session" ? C : O).set(d, l.bucket);
291
+ }), o = /* @__PURE__ */ new Map(), c = X({
292
+ source: { allFeaturesStore: e, resolvedFeaturesStore: r },
293
+ effect: async ({ allFeaturesStore: l, resolvedFeaturesStore: d }, { id: u, decide: p, key: m }) => {
294
+ const f = d.find(
295
+ ($) => $.id === u && $.key === m
296
+ );
297
+ if (f)
298
+ return f;
299
+ const y = l[u];
300
+ if (!y)
301
+ throw new Error(`Feature with id '${u}' not found`);
302
+ const v = o.get(`${u}:${m}`);
303
+ if (v !== void 0) {
304
+ const $ = await v;
305
+ return { id: y.id, bucket: $, key: m, storage: y.feature.storage };
306
+ }
307
+ const R = p();
308
+ o.set(`${u}:${m}`, R);
309
+ const E = await R;
310
+ return { id: y.id, bucket: E, key: m, storage: y.feature.storage };
311
+ }
312
+ });
313
+ x({
314
+ clock: n.register,
315
+ fn: (l) => {
316
+ const { id: d, feature: u } = l;
317
+ return { id: d, key: u.feature.key, storage: u.feature.storage };
318
+ },
319
+ target: a
320
+ }), x({
321
+ source: e,
322
+ clock: c.doneData,
323
+ fn: (l, d) => {
324
+ var y;
325
+ const { id: u, bucket: p, storage: m } = d, f = (y = l[u]) == null ? void 0 : y.feature.key;
326
+ return f ? { key: f, id: u, bucket: p, storage: m } : null;
327
+ },
328
+ target: s
329
+ });
330
+ const g = z({ allFeaturesStore: e, resolvedFeaturesStore: r }).map(
331
+ ({
332
+ allFeaturesStore: l,
333
+ resolvedFeaturesStore: d
334
+ }) => Object.values(l).map((u) => {
335
+ const p = d.find(
336
+ (m) => m.id === u.id && m.key === u.feature.key
337
+ );
338
+ return p ? {
339
+ id: u.id,
340
+ name: u.feature.name,
341
+ key: u.feature.key,
342
+ getBucket: () => ({ id: u.id, bucket: p.bucket }),
343
+ isResolved: !0
344
+ } : {
345
+ id: u.id,
346
+ name: u.feature.name,
347
+ key: u.feature.key,
348
+ getBucket: async () => await c(u.feature),
349
+ isResolved: !1
350
+ };
351
+ })
352
+ );
353
+ x({
354
+ clock: c.doneData,
355
+ source: { resolvedFeatures: r },
356
+ filter: ({ resolvedFeatures: l }, { id: d, key: u }) => !l.some(
357
+ (m) => m.id === d && m.key === u
358
+ ),
359
+ fn: (l, d) => d,
360
+ target: t.eventBus.prepend((l) => ({
361
+ type: "feature_decide",
362
+ feature: l
363
+ }))
364
+ }), x({
365
+ clock: [a.doneData, c.doneData],
366
+ source: r,
367
+ fn: (l, d) => !d || l.some(
368
+ (p) => p.id === d.id && p.key === d.key
369
+ ) ? l : [...l, d],
370
+ target: r
371
+ });
372
+ function S(l) {
373
+ return e.map((d) => d[l], { skipVoid: !1 });
374
+ }
375
+ return {
376
+ register: i,
377
+ getByName: S,
378
+ listStore: g
379
+ };
380
+ });
381
+ function De(t) {
382
+ return I(ze, t);
383
+ }
384
+ const Ue = (t, e, r) => {
385
+ r.register(t, e);
386
+ }, P = b("history");
387
+ function L(t, e) {
388
+ return {
389
+ // eslint-disable-next-line sonarjs/pseudo-random
390
+ id: ie(`history-entry-${Date.now()}-${Math.random()}}`),
391
+ node: e,
392
+ at: Date.now(),
393
+ experienceId: t
394
+ };
395
+ }
396
+ const Me = w(() => {
397
+ const t = P.store({ entries: [] }), e = P.event(), r = P.event(), n = P.event(), i = P.event();
398
+ t.on(e, (s, o) => ({
399
+ entries: [...s.entries, L(o.experienceId, o.node)]
400
+ })), t.on(r, (s, o) => ({
401
+ entries: [
402
+ ...s.entries.slice(0, -1),
403
+ L(o.experienceId, o.node)
404
+ ]
405
+ })), t.on(i, (s, o) => o);
406
+ function a(s, o) {
407
+ const c = { lastStepIndex: -1, secondLastStepIndex: -1 };
408
+ for (let g = s.length - 1; g >= 0; g--) {
409
+ const S = s[g], l = S == null ? void 0 : S.node;
410
+ if (!(!l || !re(l)) && !(o && (S == null ? void 0 : S.experienceId) !== o))
411
+ if (c.lastStepIndex === -1)
412
+ c.lastStepIndex = g;
413
+ else {
414
+ c.secondLastStepIndex = g;
415
+ break;
416
+ }
417
+ }
418
+ return c;
419
+ }
420
+ return t.on(n, (s, o) => {
421
+ const { secondLastStepIndex: c } = a(s.entries, o.experienceId), g = c !== -1 ? s.entries.slice(0, c + 1) : s.entries;
422
+ return {
423
+ ...s,
424
+ entries: g
425
+ };
426
+ }), {
427
+ push: e,
428
+ replace: r,
429
+ back: n,
430
+ restore: i,
431
+ entriesStore: t.map((s) => s.entries)
432
+ };
433
+ });
434
+ function Ne() {
435
+ return I(Me);
436
+ }
437
+ const Ve = () => D(), Te = b("field"), _e = w(() => {
438
+ const t = Te.store({}), e = F(t, {
439
+ register(o, c) {
440
+ return {
441
+ ...o,
442
+ [c.field.id]: c.field
443
+ };
444
+ }
445
+ });
446
+ function r(o) {
447
+ e.register({ field: o });
448
+ }
449
+ function n(o, c) {
450
+ const g = a(o).getState();
451
+ if (!g)
452
+ return;
453
+ const S = Object.assign({}, g, {
454
+ ...c
455
+ });
456
+ e.register({ field: { ...S } });
457
+ }
458
+ const i = t.map((o) => Object.values(o));
459
+ function a(o) {
460
+ return t.map((c) => c[o] || null);
461
+ }
462
+ function s(o) {
463
+ return t.map((c) => Object.values(c).find((g) => g.name === o) || null);
464
+ }
465
+ return {
466
+ register: r,
467
+ update: n,
468
+ getById: a,
469
+ listStore: i,
470
+ getByName: s
471
+ };
472
+ });
473
+ function Le() {
474
+ return I(_e);
475
+ }
476
+ const Ge = (t, e) => {
477
+ e.register(t);
478
+ }, He = b("action"), qe = w(() => {
479
+ const t = He.store({}), e = F(t, {
480
+ register(a, s) {
481
+ return {
482
+ ...a,
483
+ [s.name]: {
484
+ name: s.name,
485
+ action: s.action
486
+ }
487
+ };
488
+ }
489
+ });
490
+ function r(a, s) {
491
+ e.register({ name: a, action: s });
492
+ }
493
+ const n = t.map((a) => Object.values(a));
494
+ function i(a) {
495
+ return t.map((s) => s[a], { skipVoid: !1 });
496
+ }
497
+ return {
498
+ register: r,
499
+ getByName: i,
500
+ listStore: n
501
+ };
502
+ });
503
+ function Ke() {
504
+ return I(qe);
505
+ }
506
+ const We = (t, e, r) => {
507
+ r.register(t, e);
508
+ };
509
+ function G(t) {
510
+ return typeof t > "u" || t === null || t === "" || Array.isArray(t) && !t.length;
511
+ }
512
+ const Ye = b("response"), Je = w(({ client: t }) => {
513
+ const e = Ye.store({}), r = D(), n = D(), i = F(e, {
514
+ register(d, u) {
515
+ return {
516
+ ...d,
517
+ [u.fieldId]: u.response
518
+ };
519
+ },
520
+ registerBatch(d, u) {
521
+ return {
522
+ ...d,
523
+ ...u
524
+ };
525
+ },
526
+ clear(d, u) {
527
+ const { [u]: p, ...m } = d;
528
+ return m;
529
+ },
530
+ clearAll() {
531
+ return {};
532
+ }
533
+ });
534
+ function a(d, u) {
535
+ i.register({ fieldId: d, response: u });
536
+ }
537
+ async function s(d) {
538
+ const u = [];
539
+ return await Promise.allSettled(
540
+ Object.entries(d).map(async ([p, m]) => {
541
+ let f = m;
542
+ const y = t.fields.getById(p).getState();
543
+ if (!y) {
544
+ u.push({
545
+ fieldId: p,
546
+ userMessage: `Field '${p}' not found`,
547
+ systemMessage: `No field with ID '${p}' exists. Available field IDs are: ${Object.keys(t.fields.listStore.getState()).join(",")}.`,
548
+ value: f
549
+ });
550
+ return;
551
+ }
552
+ if (y.multiple && (typeof f == "string" || typeof f == "number" || typeof f == "boolean") && (f = [f]), y.validation && !oe(y.validation) && !G(f)) {
553
+ const v = await j(t, y.validation, {
554
+ $input: f
555
+ });
556
+ if (typeof v == "string") {
557
+ u.push({
558
+ fieldId: p,
559
+ userMessage: v,
560
+ systemMessage: `Field validation resulted in an error: ${v}.`,
561
+ value: f
562
+ });
563
+ return;
564
+ }
565
+ if (v === !1) {
566
+ u.push({
567
+ fieldId: p,
568
+ userMessage: "This field is invalid",
569
+ systemMessage: "Field validation resulted in an unspecified error.",
570
+ value: f
571
+ });
572
+ return;
573
+ }
574
+ }
575
+ if (y.required && G(f)) {
576
+ u.push({
577
+ fieldId: p,
578
+ userMessage: "This field is required",
579
+ systemMessage: "Field is required.",
580
+ value: f
581
+ });
582
+ return;
583
+ }
584
+ if (!y.multiple && Array.isArray(f) && f.length > 1) {
585
+ u.push({
586
+ fieldId: p,
587
+ userMessage: "This field expects a single response",
588
+ systemMessage: "Field expects a single response.",
589
+ value: f
590
+ });
591
+ return;
592
+ }
593
+ if (y.options) {
594
+ const v = y.options.map((E) => E.value), R = Array.isArray(f) ? f : [f];
595
+ Array.isArray(f) && (R.every((E) => v.includes(E)) || u.push({
596
+ fieldId: p,
597
+ userMessage: "This field expects a valid option",
598
+ systemMessage: `Field expects a valid option. Valid options are: ${v.join(", ")}`,
599
+ value: f
600
+ }));
601
+ }
602
+ })
603
+ ), { responsesToCommit: d, validationErrors: u };
604
+ }
605
+ async function o(d) {
606
+ const { responsesToCommit: u, validationErrors: p } = await s(d);
607
+ return p.length ? { errors: p } : (i.registerBatch(u), { errors: [] });
608
+ }
609
+ const c = e.map((d) => d), g = e.map((d) => Object.keys(d).map((p) => ({
610
+ fieldId: p,
611
+ value: d[p]
612
+ })));
613
+ function S(d) {
614
+ const u = t.fields.getById(d), p = e.map((m) => m[d] || null);
615
+ return z({ f: u, r: p }, ({ f: m, r: f }) => f || (m != null && m.defaultValue ? m.defaultValue : null));
616
+ }
617
+ function l(d) {
618
+ const u = t.fields.getByName(d);
619
+ return z({ f: u, s: e }, ({ f: p, s: m }) => {
620
+ const f = p && m[p.id] || null;
621
+ return f || (p != null && p.defaultValue ? p.defaultValue : null);
622
+ });
623
+ }
624
+ return x({
625
+ clock: r,
626
+ target: i.clearAll
627
+ }), x({
628
+ clock: n,
629
+ target: i.clear
630
+ }), {
631
+ register: a,
632
+ clearAll: r,
633
+ clear: n,
634
+ commit: o,
635
+ getResponsesToCommit: s,
636
+ listStore: g,
637
+ getAllStore: c,
638
+ getByFieldId: S,
639
+ getByFieldName: l
640
+ };
641
+ });
642
+ function Qe(t) {
643
+ return I(Je, t);
644
+ }
645
+ const Xe = () => "0.0.1-dev.1767836126674";
646
+ function Ze() {
647
+ if (U()) {
648
+ const t = [
36
649
  document.currentScript,
37
650
  document.getElementById("picked_script"),
38
651
  document.getElementById("picked"),
39
652
  document.getElementById("cvly"),
40
653
  document.getElementById("cvly-x")
41
654
  ];
42
- for (const t of e)
43
- if (t != null && t.dataset.api)
44
- return t.dataset.api;
655
+ for (const e of t)
656
+ if (e != null && e.dataset.api)
657
+ return e.dataset.api;
45
658
  }
46
659
  return "https://api.picked.app";
47
660
  }
48
- function X() {
49
- if (!l())
661
+ function et() {
662
+ if (!M())
50
663
  return {};
51
- const e = new URLSearchParams(window.location.search), t = {}, i = /* @__PURE__ */ new Set();
52
- for (const [n] of e.entries())
53
- n.startsWith("picked-") && i.add(n);
54
- for (const n of i) {
55
- const o = n.replace("picked-", "");
56
- t[o] = e.getAll(n);
57
- }
58
- const s = T("s");
59
- if (i.size > 0)
60
- w.set(s, t);
664
+ const t = new URLSearchParams(window.location.search), e = {}, r = /* @__PURE__ */ new Set();
665
+ for (const [i] of t.entries())
666
+ i.startsWith("picked-") && r.add(i);
667
+ for (const i of r) {
668
+ const a = i.replace("picked-", "");
669
+ e[a] = t.getAll(i);
670
+ }
671
+ const n = A("s");
672
+ if (r.size > 0)
673
+ C.set(n, e);
61
674
  else {
62
- const n = w.get(s);
63
- if (n)
64
- return n.json() || {};
675
+ const i = C.get(n);
676
+ if (i)
677
+ return i.json() || {};
65
678
  }
66
- return t;
679
+ return e;
680
+ }
681
+ function tt() {
682
+ if (ce())
683
+ return crypto.randomUUID();
684
+ const t = Date.now().toString(36), e = Math.random().toString(36).substring(2, 15), r = Math.random().toString(36).substring(2, 15), n = Math.random().toString(36).substring(2, 15);
685
+ return `${t}-${e}-${r}-${n}`;
67
686
  }
68
- function Z() {
69
- if (l())
687
+ const rt = A("session", "global"), nt = () => {
688
+ const t = O.get(rt);
689
+ let e;
690
+ t.isSet() && (e = t.json());
691
+ const r = (i) => t.set({
692
+ id: i.id,
693
+ isUser: i.isUser,
694
+ identifiers: i.identifiers
695
+ }), n = {
696
+ id: (e == null ? void 0 : e.id) ?? tt(),
697
+ isUser: (e == null ? void 0 : e.isUser) ?? void 0,
698
+ identifiers: (e == null ? void 0 : e.identifiers) ?? void 0,
699
+ setIsUser(i) {
700
+ this.isUser = i, r(this);
701
+ },
702
+ setIdentifier(i, a) {
703
+ this.identifiers = { ...this.identifiers, [i]: a }, r(this);
704
+ },
705
+ removeIdentifier(i) {
706
+ this.identifiers && (this.identifiers = Object.fromEntries(
707
+ Object.entries(this.identifiers).filter(([a]) => a !== i)
708
+ ), this.identifiers = Object.keys(this.identifiers).length ? this.identifiers : void 0, r(this));
709
+ }
710
+ };
711
+ return r(n), n;
712
+ }, st = () => ae() ? nt() : null;
713
+ function it() {
714
+ if (M())
70
715
  return globalThis.window.pickedConfig;
71
716
  }
72
- function tt() {
73
- if (!l())
717
+ function ot() {
718
+ if (!M())
74
719
  return;
75
- const e = Z(), t = e == null ? void 0 : e.organizationId, i = e == null ? void 0 : e.projectId;
76
- return t && i ? { organizationId: t, projectId: i } : void 0;
720
+ const t = it(), e = t == null ? void 0 : t.organizationId, r = t == null ? void 0 : t.projectId;
721
+ return e && r ? { organizationId: e, projectId: r } : void 0;
77
722
  }
78
- function et() {
79
- if (!f())
723
+ function at() {
724
+ if (!U())
80
725
  return;
81
- const e = document.getElementById("picked_script") || document.querySelector("script#picked") || // legacy support for 'cvly' script tag
726
+ const t = document.getElementById("picked_script") || document.querySelector("script#picked") || // legacy support for 'cvly' script tag
82
727
  document.getElementById("cvly");
83
- if (!e)
728
+ if (!t)
84
729
  return;
85
- const t = e.dataset.organizationid || e.getAttribute("organization-id"), i = e.dataset.projectid || e.getAttribute("project-id");
86
- return t && i ? { organizationId: t, projectId: i } : void 0;
730
+ const e = t.dataset.organizationid || t.getAttribute("organization-id"), r = t.dataset.projectid || t.getAttribute("project-id");
731
+ return e && r ? { organizationId: e, projectId: r } : void 0;
87
732
  }
88
- function it(e) {
89
- const { organizationId: t, projectId: i } = e;
90
- if (t && i)
91
- return { organizationId: t, projectId: i };
92
- const s = tt();
93
- if (s)
94
- return s;
95
- const n = et();
733
+ function ct(t) {
734
+ const { organizationId: e, projectId: r } = t;
735
+ if (e && r)
736
+ return { organizationId: e, projectId: r };
737
+ const n = ot();
96
738
  if (n)
97
739
  return n;
740
+ const i = at();
741
+ if (i)
742
+ return i;
98
743
  throw new Error(
99
744
  `organizationId and projectId are required. You can provide them via one of:
100
745
  (1) createClient({ organizationId, projectId }) options;
@@ -102,92 +747,92 @@ function it(e) {
102
747
  (3) a <script> tag with id 'picked_script', 'picked', or 'cvly' that includes data-organizationid/data-projectid (or organization-id/project-id) attributes.`
103
748
  );
104
749
  }
105
- function p(e) {
106
- return e == null || e === "" || Number.isNaN(e);
750
+ function B(t) {
751
+ return t == null || t === "" || Number.isNaN(t);
107
752
  }
108
- const st = {
109
- default: (e, t) => p(e) ? String(t ?? "") : String(e),
110
- append: (e, t) => t && !p(e) ? `${e} ${t}` : e,
111
- prepend: (e, t) => t && !p(e) ? `${t} ${e}` : e,
112
- upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
113
- lower: (e) => typeof e == "string" ? e.toLowerCase() : e,
114
- capitalize: (e) => typeof e == "string" ? e.charAt(0).toUpperCase() + e.slice(1) : e,
115
- list: (e) => {
116
- if (!e || typeof e != "object")
117
- return e;
118
- const t = new Intl.ListFormat("en", { style: "long", type: "conjunction" });
119
- if (Array.isArray(e))
120
- return t.format(e.map(String));
121
- if (e instanceof Map) {
122
- const i = Array.from(e.entries()).map(([s, n]) => `${s}: ${n}`);
123
- return t.format(i);
753
+ const ut = {
754
+ default: (t, e) => B(t) ? String(e ?? "") : String(t),
755
+ append: (t, e) => e && !B(t) ? `${t} ${e}` : t,
756
+ prepend: (t, e) => e && !B(t) ? `${e} ${t}` : t,
757
+ upper: (t) => typeof t == "string" ? t.toUpperCase() : t,
758
+ lower: (t) => typeof t == "string" ? t.toLowerCase() : t,
759
+ capitalize: (t) => typeof t == "string" ? t.charAt(0).toUpperCase() + t.slice(1) : t,
760
+ list: (t) => {
761
+ if (!t || typeof t != "object")
762
+ return t;
763
+ const e = new Intl.ListFormat("en", { style: "long", type: "conjunction" });
764
+ if (Array.isArray(t))
765
+ return e.format(t.map(String));
766
+ if (t instanceof Map) {
767
+ const r = Array.from(t.entries()).map(([n, i]) => `${n}: ${i}`);
768
+ return e.format(r);
124
769
  }
125
- return e instanceof Set ? t.format(Array.from(e).map(String)) : e;
770
+ return t instanceof Set ? e.format(Array.from(t).map(String)) : t;
126
771
  }
127
772
  };
128
- function nt(e) {
129
- return typeof e == "object" && e !== null;
773
+ function dt(t) {
774
+ return typeof t == "object" && t !== null;
130
775
  }
131
- function rt(e, t) {
132
- let i = t;
133
- for (const s of e.split("."))
134
- if (nt(i) && s in i)
135
- i = i[s];
776
+ function lt(t, e) {
777
+ let r = e;
778
+ for (const n of t.split("."))
779
+ if (dt(r) && n in r)
780
+ r = r[n];
136
781
  else
137
782
  return;
138
- return typeof i == "function" ? i() : i;
783
+ return typeof r == "function" ? r() : r;
139
784
  }
140
- function ot(e, t) {
141
- const i = e.split("|").map((o) => o.trim()), s = i.shift() ?? "";
142
- let n = rt(s, t);
143
- for (const o of i) {
144
- const [a, ...h] = o.split(":"), c = (a == null ? void 0 : a.trim()) ?? "", g = h.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), m = st[c];
145
- m && (n = m(n, g));
146
- }
147
- return p(n) ? "" : typeof n == "object" ? JSON.stringify(n) : String(n);
785
+ function pt(t, e) {
786
+ const r = t.split("|").map((a) => a.trim()), n = r.shift() ?? "";
787
+ let i = lt(n, e);
788
+ for (const a of r) {
789
+ const [s, ...o] = a.split(":"), c = (s == null ? void 0 : s.trim()) ?? "", g = o.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), S = ut[c];
790
+ S && (i = S(i, g));
791
+ }
792
+ return B(i) ? "" : typeof i == "object" ? JSON.stringify(i) : String(i);
148
793
  }
149
- function ct(e, t) {
150
- let i = "", s = 0;
151
- for (; s < e.length; )
152
- if (e[s] === "{" && e[s + 1] === "{") {
153
- s += 2;
154
- let n = "";
155
- for (; s < e.length; ) {
156
- if (e[s] === "}" && e[s + 1] === "}") {
157
- s += 2;
794
+ function ft(t, e) {
795
+ let r = "", n = 0;
796
+ for (; n < t.length; )
797
+ if (t[n] === "{" && t[n + 1] === "{") {
798
+ n += 2;
799
+ let i = "";
800
+ for (; n < t.length; ) {
801
+ if (t[n] === "}" && t[n + 1] === "}") {
802
+ n += 2;
158
803
  break;
159
804
  }
160
- n += e[s++];
805
+ i += t[n++];
161
806
  }
162
- i += ot(n.trim(), t);
807
+ r += pt(i.trim(), e);
163
808
  } else
164
- i += e[s++];
165
- return i;
809
+ r += t[n++];
810
+ return r;
166
811
  }
167
- class S {
168
- constructor(t) {
169
- r(this, "options");
170
- r(this, "isReady", !1);
171
- r(this, "project");
172
- r(this, "plugins", {});
173
- r(this, "eventBus", M());
174
- r(this, "organizationId");
175
- r(this, "projectId");
176
- r(this, "apiUrl");
177
- r(this, "session");
178
- r(this, "precondition");
179
- r(this, "condition");
180
- r(this, "searchParams", X());
181
- r(this, "history", E());
182
- r(this, "components", b({ client: this }));
183
- r(this, "experienceInstances", W({ client: this }));
184
- r(this, "experiences", x({ client: this }));
185
- r(this, "frameworks", z({ client: this }));
186
- r(this, "predicates", A({ client: this }));
187
- r(this, "features", C({ client: this }));
188
- r(this, "responses", F({ client: this }));
189
- r(this, "fields", v());
190
- r(this, "actions", B());
812
+ class W {
813
+ constructor(e) {
814
+ h(this, "options");
815
+ h(this, "isReady", !1);
816
+ h(this, "project");
817
+ h(this, "plugins", {});
818
+ h(this, "eventBus", Ve());
819
+ h(this, "organizationId");
820
+ h(this, "projectId");
821
+ h(this, "apiUrl");
822
+ h(this, "session");
823
+ h(this, "precondition");
824
+ h(this, "condition");
825
+ h(this, "searchParams", et());
826
+ h(this, "history", Ne());
827
+ h(this, "components", Ie({ client: this }));
828
+ h(this, "experienceInstances", ne({ client: this }));
829
+ h(this, "experiences", fe({ client: this }));
830
+ h(this, "frameworks", Fe({ client: this }));
831
+ h(this, "predicates", Oe({ client: this }));
832
+ h(this, "features", De({ client: this }));
833
+ h(this, "responses", Qe({ client: this }));
834
+ h(this, "fields", Le());
835
+ h(this, "actions", Ke());
191
836
  /**
192
837
  * Interpolates a template string using values from the client's response store and/or a provided context.
193
838
  * Supports dot-notation, modifiers, and executing functions found in the context.
@@ -230,67 +875,67 @@ class S {
230
875
  * renderString("Fruits: {{ fruits | list }}", { fruits: ["apple", "banana", "cherry"] })
231
876
  * // => "Fruits: apple, banana, and cherry"
232
877
  */
233
- r(this, "renderString", (t, i) => {
234
- const s = this.responses.listStore.getState().reduce((n, o) => (n[o.fieldId] = o.value, n), {});
235
- return ct(t, {
236
- ...i,
237
- responses: s
878
+ h(this, "renderString", (e, r) => {
879
+ const n = this.responses.listStore.getState().reduce((i, a) => (i[a.fieldId] = a.value, i), {});
880
+ return ft(e, {
881
+ ...r,
882
+ responses: n
238
883
  });
239
884
  });
240
- d("info", "Picked client initializing.");
241
- const { organizationId: i, projectId: s } = it(t);
242
- this.organizationId = i, this.projectId = s, this.options = Object.freeze(t), this.apiUrl = t.apiUrl || Q(), this.session = R(), this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.precondition = t.precondition, this.condition = t.condition, this.eventBus({ type: "load", version: Y() }), d("info", "Picked client initialized.");
885
+ k("info", "Picked client initializing.");
886
+ const { organizationId: r, projectId: n } = ct(e);
887
+ this.organizationId = r, this.projectId = n, this.options = Object.freeze(e), this.apiUrl = e.apiUrl || Ze(), this.session = st(), this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.precondition = e.precondition, this.condition = e.condition, this.eventBus({ type: "load", version: Xe() }), k("info", "Picked client initialized.");
243
888
  }
244
889
  start() {
245
- $(this), (async () => {
246
- if (!f())
890
+ Ae(this), (async () => {
891
+ if (!U())
247
892
  return;
248
- let i;
249
- typeof this.precondition > "u" ? i = !0 : typeof this.precondition == "boolean" ? i = this.precondition : i = await u(this, this.precondition) === !0;
250
- let s;
251
- i && (this.condition === void 0 ? s = !0 : typeof this.condition == "boolean" ? s = this.condition : s = await u(this, this.condition) === !0);
252
- const n = i && s === !0;
253
- if (typeof s == "boolean" && this.session) {
254
- const o = s;
255
- this.session.setIsUser(o), this.eventBus({ type: "user_decide", is_user: o });
893
+ let r;
894
+ typeof this.precondition > "u" ? r = !0 : typeof this.precondition == "boolean" ? r = this.precondition : r = await j(this, this.precondition) === !0;
895
+ let n;
896
+ r && (this.condition === void 0 ? n = !0 : typeof this.condition == "boolean" ? n = this.condition : n = await j(this, this.condition) === !0);
897
+ const i = r && n === !0;
898
+ if (typeof n == "boolean" && this.session) {
899
+ const a = n;
900
+ this.session.setIsUser(a), this.eventBus({ type: "user_decide", value: a });
256
901
  }
257
- this.eventBus({ type: "initialize" }), document.body && n && I(this), await q(), n && I(this), this.eventBus({ type: "ready" }), this.isReady = !0, this.session && this.eventBus({ type: "session", ...this.session });
902
+ this.eventBus({ type: "initialize" }), document.body && i && V(this), await se(), i && V(this), this.eventBus({ type: "ready" }), this.isReady = !0, this.session && this.eventBus({ type: "session", ...this.session });
258
903
  })();
259
904
  }
260
- registerFramework(t) {
261
- U(t, this.frameworks);
905
+ registerFramework(e) {
906
+ xe(e, this.frameworks);
262
907
  }
263
- registerComponent(t, i) {
264
- y(t, i, this.components);
908
+ registerComponent(e, r) {
909
+ T(e, r, this.components);
265
910
  }
266
- registerPlugin(t) {
267
- V(this, t, this.plugins);
911
+ registerPlugin(e) {
912
+ he(this, e, this.plugins);
268
913
  }
269
- registerFeature(t, i) {
270
- O(t, i, this.features);
914
+ registerFeature(e, r) {
915
+ Ue(e, r, this.features);
271
916
  }
272
- registerPredicate(t, i) {
273
- _(t, i, this.predicates);
917
+ registerPredicate(e, r) {
918
+ Ce(e, r, this.predicates);
274
919
  }
275
- registerField(t) {
276
- L(t, this.fields);
920
+ registerField(e) {
921
+ Ge(e, this.fields);
277
922
  }
278
- registerAction(t, i) {
279
- K(t, i, this.actions);
923
+ registerAction(e, r) {
924
+ We(e, r, this.actions);
280
925
  }
281
- registerExperience(t) {
282
- t.component && y(`experience:${t.id}`, t.component, this.components), G(t, this.experiences);
926
+ registerExperience(e) {
927
+ e.component && T(`experience:${e.id}`, e.component, this.components), ge(e, this.experiences);
283
928
  }
284
929
  getStateSnapshot() {
285
- return J(this);
930
+ return Re(this);
286
931
  }
287
- async launchExperienceById(t) {
288
- const i = this.experiences.getById(t).getState();
289
- if (!i) {
290
- d("warn", `Experience with id '${t}' not found.`);
932
+ async launchExperienceById(e) {
933
+ const r = this.experiences.getById(e).getState();
934
+ if (!r) {
935
+ k("warn", `Experience with id '${e}' not found.`);
291
936
  return;
292
937
  }
293
- N(this, i);
938
+ K(this, r);
294
939
  }
295
940
  // private async fetchProject() {
296
941
  // if (this.project) {
@@ -302,39 +947,39 @@ class S {
302
947
  // this.project.experiences.forEach((experience) => setupExperience(experience, this.experiences))
303
948
  // }
304
949
  setupPlugins() {
305
- var t;
306
- (t = this.options.plugins) == null || t.forEach((i) => {
307
- if (Array.isArray(i)) {
308
- i.forEach((n) => {
309
- this.registerPlugin(n);
950
+ var e;
951
+ (e = this.options.plugins) == null || e.forEach((r) => {
952
+ if (Array.isArray(r)) {
953
+ r.forEach((i) => {
954
+ this.registerPlugin(i);
310
955
  });
311
956
  return;
312
957
  }
313
- const s = typeof i == "function" ? i() : i;
314
- if (Array.isArray(s)) {
315
- s.forEach((n) => this.registerPlugin(n));
958
+ const n = typeof r == "function" ? r() : r;
959
+ if (Array.isArray(n)) {
960
+ n.forEach((i) => this.registerPlugin(i));
316
961
  return;
317
962
  }
318
- this.registerPlugin(s);
963
+ this.registerPlugin(n);
319
964
  });
320
965
  }
321
966
  setupFeatures() {
322
- const t = this.options.features;
323
- t && (Object.entries(t).forEach(([i, s]) => {
324
- const n = typeof s == "function" ? s() : s;
325
- this.registerFeature(i, n);
326
- }), this.searchParams.feature && this.searchParams.feature.forEach((i) => {
967
+ const e = this.options.features;
968
+ e && (Object.entries(e).forEach(([r, n]) => {
969
+ const i = typeof n == "function" ? n() : n;
970
+ this.registerFeature(r, i);
971
+ }), this.searchParams.feature && this.searchParams.feature.forEach((r) => {
327
972
  try {
328
- const [s, n] = i.split(":");
329
- if (!s || !n)
973
+ const [n, i] = r.split(":");
974
+ if (!n || !i)
330
975
  return;
331
- let o = n;
332
- o === "true" && (o = !0), o === "false" && (o = !1), this.registerFeature(s, {
333
- key: `${o}`,
976
+ let a = i;
977
+ a === "true" && (a = !0), a === "false" && (a = !1), this.registerFeature(n, {
978
+ key: `${a}`,
334
979
  // use the assigned bucket value as the key
335
- name: s,
980
+ name: n,
336
981
  // eslint-disable-next-line sonarjs/function-return-type
337
- decide: () => o,
982
+ decide: () => a,
338
983
  storage: "session"
339
984
  });
340
985
  } catch {
@@ -342,75 +987,75 @@ class S {
342
987
  }));
343
988
  }
344
989
  setupPredicates() {
345
- const t = this.options.predicates;
346
- t && Object.entries(t).forEach(([i, s]) => {
347
- if (typeof s != "function") {
348
- d("warn", `Predicate "${i}" is not a function.`);
990
+ const e = this.options.predicates;
991
+ e && Object.entries(e).forEach(([r, n]) => {
992
+ if (typeof n != "function") {
993
+ k("warn", `Predicate "${r}" is not a function.`);
349
994
  return;
350
995
  }
351
- this.registerPredicate(i, s);
996
+ this.registerPredicate(r, n);
352
997
  });
353
998
  }
354
999
  setupActions() {
355
- const t = this.options.actions;
356
- t && Object.entries(t).forEach(([i, s]) => {
357
- if (typeof s != "function") {
358
- d("warn", `Action "${i}" is not a function.`);
1000
+ const e = this.options.actions;
1001
+ e && Object.entries(e).forEach(([r, n]) => {
1002
+ if (typeof n != "function") {
1003
+ k("warn", `Action "${r}" is not a function.`);
359
1004
  return;
360
1005
  }
361
- this.registerAction(i, s);
1006
+ this.registerAction(r, n);
362
1007
  });
363
1008
  }
364
- getPluginConfig(t) {
365
- return this.plugins[t] ?? {};
1009
+ getPluginConfig(e) {
1010
+ return this.plugins[e] ?? {};
366
1011
  }
367
1012
  }
368
- r(S, "logger", d);
369
- function j(e) {
370
- var t;
371
- return ((t = e.options) == null ? void 0 : t.some((i) => "condition" in i)) ?? !1;
1013
+ h(W, "logger", k);
1014
+ function Y(t) {
1015
+ var e;
1016
+ return ((e = t.options) == null ? void 0 : e.some((r) => "condition" in r)) ?? !1;
372
1017
  }
373
- function at(e) {
374
- return e.some((t) => t.condition || j(t));
1018
+ function gt(t) {
1019
+ return t.some((e) => e.condition || Y(e));
375
1020
  }
376
- async function mt(e, t) {
377
- return t.length === 0 || !at(t) ? t : (await Promise.all(
378
- t.map(async (s) => {
379
- if (!(s.condition ? await u(e, s.condition) : !0))
1021
+ async function Ft(t, e) {
1022
+ return e.length === 0 || !gt(e) ? e : (await Promise.all(
1023
+ e.map(async (n) => {
1024
+ if (!(n.condition ? await j(t, n.condition) : !0))
380
1025
  return null;
381
- if (!s.options || !j(s))
382
- return s;
383
- const a = (await Promise.all(
384
- s.options.map(async (c) => c.condition ? await u(e, c.condition) ? c : null : c)
1026
+ if (!n.options || !Y(n))
1027
+ return n;
1028
+ const s = (await Promise.all(
1029
+ n.options.map(async (c) => c.condition ? await j(t, c.condition) ? c : null : c)
385
1030
  )).filter((c) => c !== null);
386
- return a.length === s.options.length ? s : a.length === 0 ? null : { ...s, options: a };
1031
+ return s.length === n.options.length ? n : s.length === 0 ? null : { ...n, options: s };
387
1032
  })
388
- )).filter((s) => s !== null);
1033
+ )).filter((n) => n !== null);
389
1034
  }
390
- const yt = (e) => {
391
- const t = new S(e);
392
- return H(t), t;
1035
+ const xt = (t) => {
1036
+ const e = new W(t);
1037
+ return ue(e), e;
393
1038
  };
394
1039
  export {
395
- S as Picked,
396
- yt as createClient,
397
- T as createStorageKey,
398
- u as evaluateRuleLogic,
399
- Z as getPickedConfig,
400
- mt as getStepFields,
401
- St as isPickedRoot,
402
- Bt as localStore,
403
- w as sessionStore,
1040
+ W as Picked,
1041
+ xt as createClient,
1042
+ A as createStorageKey,
1043
+ j as evaluateRuleLogic,
1044
+ it as getPickedConfig,
1045
+ Ft as getStepFields,
1046
+ Pt as isPickedRoot,
1047
+ O as localStore,
1048
+ C as sessionStore,
404
1049
  Rt as subscribe,
405
- kt as supportsCookies,
406
- Pt as supportsCryptoRandomUUID,
407
- f as supportsDocument,
408
- Et as supportsHistory,
409
- bt as supportsIntersectionObserver,
410
- xt as supportsLocalStorage,
1050
+ Bt as supportsCookies,
1051
+ ce as supportsCryptoRandomUUID,
1052
+ U as supportsDocument,
1053
+ Ot as supportsHistory,
1054
+ Ct as supportsIntersectionObserver,
1055
+ ae as supportsLocalStorage,
411
1056
  zt as supportsLocation,
412
- At as supportsSessionStorage,
413
- Ct as supportsShadowRoot,
414
- Ft as supportsWebComponents,
415
- l as supportsWindow
1057
+ Dt as supportsSessionStorage,
1058
+ Ut as supportsShadowRoot,
1059
+ Mt as supportsWebComponents,
1060
+ M as supportsWindow
416
1061
  };