@picked/client 0.0.22 → 0.0.23-next.1
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/cjs/index.js +1 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
- package/dist/esm/index.js +257 -256
- package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
- package/dist/esm/plugins/history-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
- package/dist/{storage-Cb_71y48.js → storage-BLmAhfhl.js} +29 -29
- package/dist/storage-YlR83AWP.cjs +1 -0
- package/dist/types/ping.d.ts.map +1 -1
- package/dist/types/utils/storage.d.ts +14 -10
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/storage-DuRlyFaY.cjs +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var m = (t, e,
|
|
4
|
-
import { createDomain as
|
|
1
|
+
var W = Object.defineProperty;
|
|
2
|
+
var Y = (t, e, s) => e in t ? W(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
+
var m = (t, e, s) => Y(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
+
import { createDomain as b, createApi as I, createEffect as U, attach as J, sample as x, combine as C, createEvent as D } from "effector";
|
|
5
5
|
import { createFactory as k, invoke as w } from "@withease/factories";
|
|
6
|
-
import { g as
|
|
6
|
+
import { g as _, t as Q, c as X, i as Z, e as E, a as ee, b as te, d as se } from "../experience-instance-C4INDX6a.js";
|
|
7
7
|
import { f as St } from "../experience-instance-C4INDX6a.js";
|
|
8
8
|
import { l as v } from "../logger-C9a75KZn.js";
|
|
9
|
-
import { c as B,
|
|
10
|
-
import { a as kt } from "../storage-
|
|
11
|
-
import { g as
|
|
12
|
-
import { i as
|
|
13
|
-
import { s as
|
|
14
|
-
import { h as
|
|
15
|
-
const
|
|
9
|
+
import { c as B, l as j, s as O } from "../storage-BLmAhfhl.js";
|
|
10
|
+
import { a as kt } from "../storage-BLmAhfhl.js";
|
|
11
|
+
import { g as re } from "../id-BW-g3y32.js";
|
|
12
|
+
import { i as ne } from "../object-JwZ58NOH.js";
|
|
13
|
+
import { s as L, a as ie, b as oe, c as ae, d as ce } from "../supports-BjhuLJ8z.js";
|
|
14
|
+
import { h as Ft, f as bt, j as It, e as xt, g as Et, i as Pt, k as Rt } from "../supports-BjhuLJ8z.js";
|
|
15
|
+
const H = b("experience"), ue = k(
|
|
16
16
|
({ client: t, experience: e }) => {
|
|
17
|
-
const
|
|
17
|
+
const s = H.store(e), n = I(s, {
|
|
18
18
|
merge(u, h) {
|
|
19
19
|
return {
|
|
20
20
|
...u,
|
|
21
21
|
...h.experience
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
}), o =
|
|
24
|
+
}), o = s.map((u) => ({
|
|
25
25
|
name: u.name,
|
|
26
26
|
decisionLogic: u.condition ?? u.decide,
|
|
27
27
|
targetSelectors: u.targets,
|
|
@@ -29,7 +29,7 @@ const K = F("experience"), le = k(
|
|
|
29
29
|
})), l = t.components.listStore.map(
|
|
30
30
|
(u) => u.find((h) => h.name === `experience:${e.id}`) || u.find((h) => h.name === "experience"),
|
|
31
31
|
{ skipVoid: !1 }
|
|
32
|
-
),
|
|
32
|
+
), r = s.map((u) => ({
|
|
33
33
|
steps: u.steps,
|
|
34
34
|
nodes: u.nodes,
|
|
35
35
|
edges: u.edges,
|
|
@@ -38,37 +38,37 @@ const K = F("experience"), le = k(
|
|
|
38
38
|
return {
|
|
39
39
|
id: e.id,
|
|
40
40
|
configStore: o,
|
|
41
|
-
treeStore:
|
|
41
|
+
treeStore: r,
|
|
42
42
|
componentStore: l,
|
|
43
43
|
actions: i,
|
|
44
44
|
merge: n.merge
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
|
-
function
|
|
49
|
-
return w(
|
|
48
|
+
function le(t) {
|
|
49
|
+
return w(ue, t);
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
const e =
|
|
53
|
-
register(
|
|
51
|
+
const de = k(({ client: t }) => {
|
|
52
|
+
const e = H.store({}), s = I(e, {
|
|
53
|
+
register(r, i) {
|
|
54
54
|
return {
|
|
55
|
-
...
|
|
55
|
+
...r,
|
|
56
56
|
[i.id]: i
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
function n(
|
|
61
|
-
const i = e.getState()[
|
|
60
|
+
function n(r) {
|
|
61
|
+
const i = e.getState()[r.id];
|
|
62
62
|
if (i) {
|
|
63
|
-
i.merge({ experience:
|
|
63
|
+
i.merge({ experience: r, strategy: "override" });
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
const u =
|
|
67
|
-
|
|
66
|
+
const u = le({ client: t, experience: r });
|
|
67
|
+
s.register(u);
|
|
68
68
|
}
|
|
69
|
-
const o = e.map((
|
|
70
|
-
function l(
|
|
71
|
-
return e.map((i) => i[
|
|
69
|
+
const o = e.map((r) => Object.values(r));
|
|
70
|
+
function l(r) {
|
|
71
|
+
return e.map((i) => i[r], { skipVoid: !1 });
|
|
72
72
|
}
|
|
73
73
|
return {
|
|
74
74
|
register: n,
|
|
@@ -76,66 +76,66 @@ const pe = k(({ client: t }) => {
|
|
|
76
76
|
listStore: o
|
|
77
77
|
};
|
|
78
78
|
});
|
|
79
|
-
function
|
|
80
|
-
return w(
|
|
79
|
+
function pe(t) {
|
|
80
|
+
return w(de, t);
|
|
81
81
|
}
|
|
82
|
-
const
|
|
82
|
+
const ge = (t, e) => {
|
|
83
83
|
e.register(t);
|
|
84
|
-
},
|
|
85
|
-
const { targetSelectors:
|
|
84
|
+
}, K = (t, e) => {
|
|
85
|
+
const { targetSelectors: s } = e.configStore.getState(), n = _(s, e.id);
|
|
86
86
|
n.forEach(
|
|
87
|
-
({ elements: l }) => l.forEach((
|
|
88
|
-
),
|
|
87
|
+
({ elements: l }) => l.forEach((r) => Q(r, e.id))
|
|
88
|
+
), X(n, e.id).forEach((l) => {
|
|
89
89
|
t.experienceInstances.spawn(e, l);
|
|
90
90
|
});
|
|
91
91
|
}, M = async (t) => {
|
|
92
92
|
await Promise.all(
|
|
93
93
|
t.experiences.listStore.getState().map(async (e) => {
|
|
94
|
-
await
|
|
94
|
+
await fe(t, e) && K(t, e);
|
|
95
95
|
})
|
|
96
96
|
);
|
|
97
|
-
},
|
|
98
|
-
const { decisionLogic:
|
|
99
|
-
return
|
|
100
|
-
},
|
|
97
|
+
}, fe = async (t, e) => {
|
|
98
|
+
const { decisionLogic: s, targetSelectors: n } = e.configStore.getState();
|
|
99
|
+
return _(n, e.id).length < 1 || n.length === 0 ? !1 : s && Z(s) ? await E(t, s) === !0 : !0;
|
|
100
|
+
}, me = (t, e, s) => {
|
|
101
101
|
const n = e.name, o = e.setup(t);
|
|
102
102
|
if (o) {
|
|
103
|
-
const l =
|
|
104
|
-
|
|
103
|
+
const l = s[n] ?? {};
|
|
104
|
+
s[n] = Object.freeze({ ...l, ...o });
|
|
105
105
|
}
|
|
106
|
-
},
|
|
107
|
-
({ client: t, component: e, name:
|
|
106
|
+
}, he = b("component"), ye = k(
|
|
107
|
+
({ client: t, component: e, name: s }) => {
|
|
108
108
|
const n = t.frameworks.getByName(e.frameworkName);
|
|
109
109
|
return {
|
|
110
|
-
name:
|
|
110
|
+
name: s,
|
|
111
111
|
component: e,
|
|
112
112
|
frameworkStore: n
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
);
|
|
116
|
-
function
|
|
117
|
-
return w(
|
|
116
|
+
function Se(t) {
|
|
117
|
+
return w(ye, t);
|
|
118
118
|
}
|
|
119
|
-
const
|
|
120
|
-
const e =
|
|
121
|
-
register(
|
|
119
|
+
const ve = k(({ client: t }) => {
|
|
120
|
+
const e = he.store({}), s = I(e, {
|
|
121
|
+
register(r, i) {
|
|
122
122
|
return {
|
|
123
|
-
...
|
|
123
|
+
...r,
|
|
124
124
|
[i.name]: i
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
|
-
function n(
|
|
129
|
-
e.getState()[
|
|
128
|
+
function n(r, i) {
|
|
129
|
+
e.getState()[r] && v(
|
|
130
130
|
"warn",
|
|
131
|
-
`Component '${
|
|
131
|
+
`Component '${r}' already registered. Registering again will override the previous registration.`
|
|
132
132
|
);
|
|
133
|
-
const h =
|
|
134
|
-
|
|
133
|
+
const h = Se({ client: t, name: r, component: i });
|
|
134
|
+
s.register(h);
|
|
135
135
|
}
|
|
136
|
-
const o = e.map((
|
|
137
|
-
function l(
|
|
138
|
-
return e.map((i) => i[
|
|
136
|
+
const o = e.map((r) => Object.values(r));
|
|
137
|
+
function l(r) {
|
|
138
|
+
return e.map((i) => i[r], { skipVoid: !1 });
|
|
139
139
|
}
|
|
140
140
|
return {
|
|
141
141
|
register: n,
|
|
@@ -143,29 +143,29 @@ const ke = k(({ client: t }) => {
|
|
|
143
143
|
listStore: o
|
|
144
144
|
};
|
|
145
145
|
});
|
|
146
|
-
function
|
|
147
|
-
return w(
|
|
146
|
+
function ke(t) {
|
|
147
|
+
return w(ve, t);
|
|
148
148
|
}
|
|
149
|
-
const V = (t, e,
|
|
150
|
-
|
|
151
|
-
},
|
|
152
|
-
const e =
|
|
153
|
-
register(
|
|
149
|
+
const V = (t, e, s) => {
|
|
150
|
+
s.register(t, e);
|
|
151
|
+
}, we = b("framework"), Fe = k(({ client: t }) => {
|
|
152
|
+
const e = we.store({}), s = I(e, {
|
|
153
|
+
register(r, i) {
|
|
154
154
|
return {
|
|
155
|
-
...
|
|
155
|
+
...r,
|
|
156
156
|
[i.name]: i.framework
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
|
-
function n(
|
|
161
|
-
e.getState()[
|
|
160
|
+
function n(r, i) {
|
|
161
|
+
e.getState()[r] && v(
|
|
162
162
|
"warn",
|
|
163
|
-
`Framework '${
|
|
164
|
-
),
|
|
163
|
+
`Framework '${r}' already registered. Registering again will override the previous registration.`
|
|
164
|
+
), s.register({ name: r, framework: i });
|
|
165
165
|
}
|
|
166
|
-
const o = e.map((
|
|
167
|
-
function l(
|
|
168
|
-
return e.map((i) => i[
|
|
166
|
+
const o = e.map((r) => Object.values(r));
|
|
167
|
+
function l(r) {
|
|
168
|
+
return e.map((i) => i[r], { skipVoid: !1 });
|
|
169
169
|
}
|
|
170
170
|
return {
|
|
171
171
|
register: n,
|
|
@@ -176,32 +176,33 @@ const V = (t, e, r) => {
|
|
|
176
176
|
function be(t) {
|
|
177
177
|
return w(Fe, t);
|
|
178
178
|
}
|
|
179
|
-
const
|
|
179
|
+
const Ie = (t, e) => {
|
|
180
180
|
e.register(t.name, t);
|
|
181
|
-
},
|
|
181
|
+
}, xe = 6e3, Ee = B("last_ping", "global"), Pe = (t) => `${t}/api/v1/ping`, Re = async (t) => {
|
|
182
182
|
try {
|
|
183
|
-
const e = Date.now(),
|
|
184
|
-
|
|
183
|
+
const e = Date.now(), s = j.get(Ee);
|
|
184
|
+
let n = 0;
|
|
185
|
+
if (s.isSet() && (n = s.json() ?? 0), n && e - n < xe)
|
|
185
186
|
return !0;
|
|
186
|
-
const
|
|
187
|
+
const o = Pe(t.apiUrl), l = {
|
|
187
188
|
projectId: t.projectId,
|
|
188
189
|
path: window.location.pathname
|
|
189
|
-
},
|
|
190
|
+
}, r = JSON.stringify(l), i = {
|
|
190
191
|
"Content-Type": "application/json"
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
const
|
|
192
|
+
}, u = document.getElementById("picked_script"), h = u == null ? void 0 : u.dataset.verceltoken;
|
|
193
|
+
h && (i["x-vercel-protection-bypass"] = h);
|
|
194
|
+
const d = (await fetch(o, {
|
|
194
195
|
method: "POST",
|
|
195
|
-
headers:
|
|
196
|
-
body:
|
|
196
|
+
headers: i,
|
|
197
|
+
body: r
|
|
197
198
|
})).ok;
|
|
198
|
-
return
|
|
199
|
+
return d && s.set(e), d;
|
|
199
200
|
} catch (e) {
|
|
200
201
|
return v("error", e), !1;
|
|
201
202
|
}
|
|
202
203
|
};
|
|
203
204
|
function Be(t) {
|
|
204
|
-
const e = typeof window < "u",
|
|
205
|
+
const e = typeof window < "u", s = {
|
|
205
206
|
client: t,
|
|
206
207
|
responses: t.responses.listStore.getState(),
|
|
207
208
|
fields: t.fields.listStore.getState(),
|
|
@@ -210,13 +211,13 @@ function Be(t) {
|
|
|
210
211
|
sessionStorage: e ? window.sessionStorage : void 0,
|
|
211
212
|
localStorage: e ? window.localStorage : void 0
|
|
212
213
|
};
|
|
213
|
-
return Object.freeze(
|
|
214
|
+
return Object.freeze(s);
|
|
214
215
|
}
|
|
215
|
-
const Ae =
|
|
216
|
-
const e = Ae.store({}),
|
|
217
|
-
register(
|
|
216
|
+
const Ae = b("predicate"), $e = k(({ client: t }) => {
|
|
217
|
+
const e = Ae.store({}), s = I(e, {
|
|
218
|
+
register(r, i) {
|
|
218
219
|
return {
|
|
219
|
-
...
|
|
220
|
+
...r,
|
|
220
221
|
[i.name]: {
|
|
221
222
|
name: i.name,
|
|
222
223
|
predicate: i.predicate
|
|
@@ -224,15 +225,15 @@ const Ae = F("predicate"), $e = k(({ client: t }) => {
|
|
|
224
225
|
};
|
|
225
226
|
}
|
|
226
227
|
});
|
|
227
|
-
function n(
|
|
228
|
-
e.getState()[
|
|
228
|
+
function n(r, i) {
|
|
229
|
+
e.getState()[r] && v(
|
|
229
230
|
"warn",
|
|
230
|
-
`Predicate '${
|
|
231
|
-
),
|
|
231
|
+
`Predicate '${r}' already registered. Registering again will override the previous registration.`
|
|
232
|
+
), s.register(Object.freeze({ name: r, predicate: i }));
|
|
232
233
|
}
|
|
233
|
-
const o = e.map((
|
|
234
|
-
function l(
|
|
235
|
-
return e.map((i) => i[
|
|
234
|
+
const o = e.map((r) => Object.values(r));
|
|
235
|
+
function l(r) {
|
|
236
|
+
return e.map((i) => i[r], { skipVoid: !1 });
|
|
236
237
|
}
|
|
237
238
|
return {
|
|
238
239
|
register: n,
|
|
@@ -243,10 +244,10 @@ const Ae = F("predicate"), $e = k(({ client: t }) => {
|
|
|
243
244
|
function je(t) {
|
|
244
245
|
return w($e, t);
|
|
245
246
|
}
|
|
246
|
-
const Oe = (t, e,
|
|
247
|
-
|
|
248
|
-
},
|
|
249
|
-
const e =
|
|
247
|
+
const Oe = (t, e, s) => {
|
|
248
|
+
s.register(t, e);
|
|
249
|
+
}, T = b("feature"), Ce = k(({ client: t }) => {
|
|
250
|
+
const e = T.store({}), s = T.store([]), n = I(e, {
|
|
250
251
|
register(d, c) {
|
|
251
252
|
return {
|
|
252
253
|
...d,
|
|
@@ -279,16 +280,16 @@ const Oe = (t, e, r) => {
|
|
|
279
280
|
key: c,
|
|
280
281
|
storage: a = "local"
|
|
281
282
|
}) => {
|
|
282
|
-
const p = B(`feature:${d}:${c}`, "global"), g = (a === "session" ?
|
|
283
|
+
const p = B(`feature:${d}:${c}`, "global"), g = (a === "session" ? O : j).get(p).boolean();
|
|
283
284
|
return g === null ? null : { id: d, key: c, bucket: g, storage: a };
|
|
284
285
|
}
|
|
285
|
-
),
|
|
286
|
+
), r = U((d) => {
|
|
286
287
|
if (!d)
|
|
287
288
|
return null;
|
|
288
289
|
const c = B(`feature:${d.id}:${d.key}`, "global");
|
|
289
|
-
(d.storage === "session" ?
|
|
290
|
-
}), i = /* @__PURE__ */ new Map(), u =
|
|
291
|
-
source: { allFeaturesStore: e, resolvedFeaturesStore:
|
|
290
|
+
(d.storage === "session" ? O : j).set(c, d.bucket);
|
|
291
|
+
}), i = /* @__PURE__ */ new Map(), u = J({
|
|
292
|
+
source: { allFeaturesStore: e, resolvedFeaturesStore: s },
|
|
292
293
|
effect: async ({ allFeaturesStore: d, resolvedFeaturesStore: c }, { id: a, decide: p, key: f }) => {
|
|
293
294
|
const g = c.find(
|
|
294
295
|
($) => $.id === a && $.key === f
|
|
@@ -298,9 +299,9 @@ const Oe = (t, e, r) => {
|
|
|
298
299
|
const y = d[a];
|
|
299
300
|
if (!y)
|
|
300
301
|
throw new Error(`Feature with id '${a}' not found`);
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
303
|
-
const $ = await
|
|
302
|
+
const F = i.get(`${a}:${f}`);
|
|
303
|
+
if (F !== void 0) {
|
|
304
|
+
const $ = await F;
|
|
304
305
|
return { id: y.id, bucket: $, key: f, storage: y.feature.storage };
|
|
305
306
|
}
|
|
306
307
|
const A = p();
|
|
@@ -324,9 +325,9 @@ const Oe = (t, e, r) => {
|
|
|
324
325
|
const { id: a, bucket: p, storage: f } = c, g = (y = d[a]) == null ? void 0 : y.feature.key;
|
|
325
326
|
return g ? { key: g, id: a, bucket: p, storage: f } : null;
|
|
326
327
|
},
|
|
327
|
-
target:
|
|
328
|
+
target: r
|
|
328
329
|
});
|
|
329
|
-
const h =
|
|
330
|
+
const h = C({ allFeaturesStore: e, resolvedFeaturesStore: s }).map(
|
|
330
331
|
({
|
|
331
332
|
allFeaturesStore: d,
|
|
332
333
|
resolvedFeaturesStore: c
|
|
@@ -351,7 +352,7 @@ const Oe = (t, e, r) => {
|
|
|
351
352
|
);
|
|
352
353
|
x({
|
|
353
354
|
clock: u.doneData,
|
|
354
|
-
source: { resolvedFeatures:
|
|
355
|
+
source: { resolvedFeatures: s },
|
|
355
356
|
filter: ({ resolvedFeatures: d }, { id: c, key: a }) => !d.some(
|
|
356
357
|
(f) => f.id === c && f.key === a
|
|
357
358
|
),
|
|
@@ -362,11 +363,11 @@ const Oe = (t, e, r) => {
|
|
|
362
363
|
}))
|
|
363
364
|
}), x({
|
|
364
365
|
clock: [l.doneData, u.doneData],
|
|
365
|
-
source:
|
|
366
|
+
source: s,
|
|
366
367
|
fn: (d, c) => !c || d.some(
|
|
367
368
|
(p) => p.id === c.id && p.key === c.key
|
|
368
369
|
) ? d : [...d, c],
|
|
369
|
-
target:
|
|
370
|
+
target: s
|
|
370
371
|
});
|
|
371
372
|
function S(d) {
|
|
372
373
|
return e.map((c) => c[d], { skipVoid: !1 });
|
|
@@ -380,33 +381,33 @@ const Oe = (t, e, r) => {
|
|
|
380
381
|
function De(t) {
|
|
381
382
|
return w(Ce, t);
|
|
382
383
|
}
|
|
383
|
-
const Ue = (t, e,
|
|
384
|
-
|
|
385
|
-
}, R =
|
|
386
|
-
function
|
|
384
|
+
const Ue = (t, e, s) => {
|
|
385
|
+
s.register(t, e);
|
|
386
|
+
}, R = b("history");
|
|
387
|
+
function N(t, e) {
|
|
387
388
|
return {
|
|
388
389
|
// eslint-disable-next-line sonarjs/pseudo-random
|
|
389
|
-
id:
|
|
390
|
+
id: re(`history-entry-${Date.now()}-${Math.random()}}`),
|
|
390
391
|
node: e,
|
|
391
392
|
at: Date.now(),
|
|
392
393
|
experienceId: t
|
|
393
394
|
};
|
|
394
395
|
}
|
|
395
396
|
const Me = k(() => {
|
|
396
|
-
const t = R.store({ entries: [] }), e = R.event(),
|
|
397
|
-
t.on(e, (
|
|
398
|
-
entries: [...
|
|
399
|
-
})), t.on(
|
|
397
|
+
const t = R.store({ entries: [] }), e = R.event(), s = R.event(), n = R.event(), o = R.event();
|
|
398
|
+
t.on(e, (r, i) => ({
|
|
399
|
+
entries: [...r.entries, N(i.experienceId, i.node)]
|
|
400
|
+
})), t.on(s, (r, i) => ({
|
|
400
401
|
entries: [
|
|
401
|
-
...
|
|
402
|
-
|
|
402
|
+
...r.entries.slice(0, -1),
|
|
403
|
+
N(i.experienceId, i.node)
|
|
403
404
|
]
|
|
404
|
-
})), t.on(o, (
|
|
405
|
-
function l(
|
|
405
|
+
})), t.on(o, (r, i) => i);
|
|
406
|
+
function l(r, i) {
|
|
406
407
|
const u = { lastStepIndex: -1, secondLastStepIndex: -1 };
|
|
407
|
-
for (let h =
|
|
408
|
-
const S =
|
|
409
|
-
if (!(!d || !
|
|
408
|
+
for (let h = r.length - 1; h >= 0; h--) {
|
|
409
|
+
const S = r[h], d = S == null ? void 0 : S.node;
|
|
410
|
+
if (!(!d || !ee(d)) && !(i && (S == null ? void 0 : S.experienceId) !== i))
|
|
410
411
|
if (u.lastStepIndex === -1)
|
|
411
412
|
u.lastStepIndex = h;
|
|
412
413
|
else {
|
|
@@ -416,44 +417,44 @@ const Me = k(() => {
|
|
|
416
417
|
}
|
|
417
418
|
return u;
|
|
418
419
|
}
|
|
419
|
-
return t.on(n, (
|
|
420
|
-
const { secondLastStepIndex: u } = l(
|
|
420
|
+
return t.on(n, (r, i) => {
|
|
421
|
+
const { secondLastStepIndex: u } = l(r.entries, i.experienceId), h = u !== -1 ? r.entries.slice(0, u + 1) : r.entries;
|
|
421
422
|
return {
|
|
422
|
-
...
|
|
423
|
+
...r,
|
|
423
424
|
entries: h
|
|
424
425
|
};
|
|
425
426
|
}), {
|
|
426
427
|
push: e,
|
|
427
|
-
replace:
|
|
428
|
+
replace: s,
|
|
428
429
|
back: n,
|
|
429
430
|
restore: o,
|
|
430
|
-
entriesStore: t.map((
|
|
431
|
+
entriesStore: t.map((r) => r.entries)
|
|
431
432
|
};
|
|
432
433
|
});
|
|
433
434
|
function Ve() {
|
|
434
435
|
return w(Me);
|
|
435
436
|
}
|
|
436
|
-
const Te = () =>
|
|
437
|
-
const t = Ne.store({}), e =
|
|
438
|
-
register(
|
|
437
|
+
const Te = () => D(), Ne = b("field"), ze = k(() => {
|
|
438
|
+
const t = Ne.store({}), e = I(t, {
|
|
439
|
+
register(r, i) {
|
|
439
440
|
return {
|
|
440
|
-
...
|
|
441
|
+
...r,
|
|
441
442
|
[i.field.id]: i.field
|
|
442
443
|
};
|
|
443
444
|
}
|
|
444
445
|
});
|
|
445
|
-
function r
|
|
446
|
-
e.register({ field:
|
|
446
|
+
function s(r) {
|
|
447
|
+
e.register({ field: r });
|
|
447
448
|
}
|
|
448
|
-
const n = t.map((
|
|
449
|
-
function o(
|
|
450
|
-
return t.map((i) => i[
|
|
449
|
+
const n = t.map((r) => Object.values(r));
|
|
450
|
+
function o(r) {
|
|
451
|
+
return t.map((i) => i[r] || null);
|
|
451
452
|
}
|
|
452
|
-
function l(
|
|
453
|
-
return t.map((i) => Object.values(i).find((u) => u.name ===
|
|
453
|
+
function l(r) {
|
|
454
|
+
return t.map((i) => Object.values(i).find((u) => u.name === r) || null);
|
|
454
455
|
}
|
|
455
456
|
return {
|
|
456
|
-
register:
|
|
457
|
+
register: s,
|
|
457
458
|
getById: o,
|
|
458
459
|
listStore: n,
|
|
459
460
|
getByName: l
|
|
@@ -464,27 +465,27 @@ function _e() {
|
|
|
464
465
|
}
|
|
465
466
|
const Le = (t, e) => {
|
|
466
467
|
e.register(t);
|
|
467
|
-
}, He =
|
|
468
|
-
const t = He.store({}), e =
|
|
469
|
-
register(l,
|
|
468
|
+
}, He = b("action"), Ke = k(() => {
|
|
469
|
+
const t = He.store({}), e = I(t, {
|
|
470
|
+
register(l, r) {
|
|
470
471
|
return {
|
|
471
472
|
...l,
|
|
472
|
-
[
|
|
473
|
-
name:
|
|
474
|
-
action:
|
|
473
|
+
[r.name]: {
|
|
474
|
+
name: r.name,
|
|
475
|
+
action: r.action
|
|
475
476
|
}
|
|
476
477
|
};
|
|
477
478
|
}
|
|
478
479
|
});
|
|
479
|
-
function
|
|
480
|
-
e.register({ name: l, action:
|
|
480
|
+
function s(l, r) {
|
|
481
|
+
e.register({ name: l, action: r });
|
|
481
482
|
}
|
|
482
483
|
const n = t.map((l) => Object.values(l));
|
|
483
484
|
function o(l) {
|
|
484
|
-
return t.map((
|
|
485
|
+
return t.map((r) => r[l], { skipVoid: !1 });
|
|
485
486
|
}
|
|
486
487
|
return {
|
|
487
|
-
register:
|
|
488
|
+
register: s,
|
|
488
489
|
getByName: o,
|
|
489
490
|
listStore: n
|
|
490
491
|
};
|
|
@@ -492,14 +493,14 @@ const Le = (t, e) => {
|
|
|
492
493
|
function qe() {
|
|
493
494
|
return w(Ke);
|
|
494
495
|
}
|
|
495
|
-
const Ge = (t, e,
|
|
496
|
-
|
|
496
|
+
const Ge = (t, e, s) => {
|
|
497
|
+
s.register(t, e);
|
|
497
498
|
};
|
|
498
|
-
function
|
|
499
|
+
function z(t) {
|
|
499
500
|
return typeof t > "u" || t === null || t === "" || Array.isArray(t) && !t.length;
|
|
500
501
|
}
|
|
501
|
-
const We =
|
|
502
|
-
const e = We.store({}),
|
|
502
|
+
const We = b("response"), Ye = k(({ client: t }) => {
|
|
503
|
+
const e = We.store({}), s = D(), n = D(), o = I(e, {
|
|
503
504
|
register(c, a) {
|
|
504
505
|
return {
|
|
505
506
|
...c,
|
|
@@ -523,7 +524,7 @@ const We = F("response"), Ye = k(({ client: t }) => {
|
|
|
523
524
|
function l(c, a) {
|
|
524
525
|
o.register({ fieldId: c, response: a });
|
|
525
526
|
}
|
|
526
|
-
async function
|
|
527
|
+
async function r(c) {
|
|
527
528
|
const a = [];
|
|
528
529
|
return await Promise.allSettled(
|
|
529
530
|
Object.entries(c).map(async ([p, f]) => {
|
|
@@ -538,20 +539,20 @@ const We = F("response"), Ye = k(({ client: t }) => {
|
|
|
538
539
|
});
|
|
539
540
|
return;
|
|
540
541
|
}
|
|
541
|
-
if (y.multiple && (typeof g == "string" || typeof g == "number" || typeof g == "boolean") && (g = [g]), y.validation && !
|
|
542
|
-
const
|
|
542
|
+
if (y.multiple && (typeof g == "string" || typeof g == "number" || typeof g == "boolean") && (g = [g]), y.validation && !ne(y.validation) && !z(g)) {
|
|
543
|
+
const F = await E(t, y.validation, {
|
|
543
544
|
$input: g
|
|
544
545
|
});
|
|
545
|
-
if (typeof
|
|
546
|
+
if (typeof F == "string") {
|
|
546
547
|
a.push({
|
|
547
548
|
fieldId: p,
|
|
548
|
-
userMessage:
|
|
549
|
-
systemMessage: `Field validation resulted in an error: ${
|
|
549
|
+
userMessage: F,
|
|
550
|
+
systemMessage: `Field validation resulted in an error: ${F}.`,
|
|
550
551
|
value: g
|
|
551
552
|
});
|
|
552
553
|
return;
|
|
553
554
|
}
|
|
554
|
-
if (
|
|
555
|
+
if (F === !1) {
|
|
555
556
|
a.push({
|
|
556
557
|
fieldId: p,
|
|
557
558
|
userMessage: "This field is invalid",
|
|
@@ -561,7 +562,7 @@ const We = F("response"), Ye = k(({ client: t }) => {
|
|
|
561
562
|
return;
|
|
562
563
|
}
|
|
563
564
|
}
|
|
564
|
-
if (y.required &&
|
|
565
|
+
if (y.required && z(g)) {
|
|
565
566
|
a.push({
|
|
566
567
|
fieldId: p,
|
|
567
568
|
userMessage: "This field is required",
|
|
@@ -580,11 +581,11 @@ const We = F("response"), Ye = k(({ client: t }) => {
|
|
|
580
581
|
return;
|
|
581
582
|
}
|
|
582
583
|
if (y.options) {
|
|
583
|
-
const
|
|
584
|
-
Array.isArray(g) && (A.every((P) =>
|
|
584
|
+
const F = y.options.map((P) => P.value), A = Array.isArray(g) ? g : [g];
|
|
585
|
+
Array.isArray(g) && (A.every((P) => F.includes(P)) || a.push({
|
|
585
586
|
fieldId: p,
|
|
586
587
|
userMessage: "This field expects a valid option",
|
|
587
|
-
systemMessage: `Field expects a valid option. Valid options are: ${
|
|
588
|
+
systemMessage: `Field expects a valid option. Valid options are: ${F.join(", ")}`,
|
|
588
589
|
value: g
|
|
589
590
|
}));
|
|
590
591
|
}
|
|
@@ -592,7 +593,7 @@ const We = F("response"), Ye = k(({ client: t }) => {
|
|
|
592
593
|
), { responsesToCommit: c, validationErrors: a };
|
|
593
594
|
}
|
|
594
595
|
async function i(c) {
|
|
595
|
-
const { responsesToCommit: a, validationErrors: p } = await
|
|
596
|
+
const { responsesToCommit: a, validationErrors: p } = await r(c);
|
|
596
597
|
return p.length ? { errors: p } : (o.registerBatch(a), { errors: [] });
|
|
597
598
|
}
|
|
598
599
|
const u = e.map((c) => c), h = e.map((c) => Object.keys(c).map((p) => ({
|
|
@@ -601,27 +602,27 @@ const We = F("response"), Ye = k(({ client: t }) => {
|
|
|
601
602
|
})));
|
|
602
603
|
function S(c) {
|
|
603
604
|
const a = t.fields.getById(c), p = e.map((f) => f[c] || null);
|
|
604
|
-
return
|
|
605
|
+
return C({ f: a, r: p }, ({ f, r: g }) => g || (f != null && f.defaultValue ? f.defaultValue : null));
|
|
605
606
|
}
|
|
606
607
|
function d(c) {
|
|
607
608
|
const a = t.fields.getByName(c);
|
|
608
|
-
return
|
|
609
|
+
return C({ f: a, s: e }, ({ f: p, s: f }) => {
|
|
609
610
|
const g = p && f[p.id] || null;
|
|
610
611
|
return g || (p != null && p.defaultValue ? p.defaultValue : null);
|
|
611
612
|
});
|
|
612
613
|
}
|
|
613
614
|
return x({
|
|
614
|
-
clock:
|
|
615
|
+
clock: s,
|
|
615
616
|
target: o.clearAll
|
|
616
617
|
}), x({
|
|
617
618
|
clock: n,
|
|
618
619
|
target: o.clear
|
|
619
620
|
}), {
|
|
620
621
|
register: l,
|
|
621
|
-
clearAll:
|
|
622
|
+
clearAll: s,
|
|
622
623
|
clear: n,
|
|
623
624
|
commit: i,
|
|
624
|
-
getResponsesToCommit:
|
|
625
|
+
getResponsesToCommit: r,
|
|
625
626
|
listStore: h,
|
|
626
627
|
getAllStore: u,
|
|
627
628
|
getByFieldId: S,
|
|
@@ -631,9 +632,9 @@ const We = F("response"), Ye = k(({ client: t }) => {
|
|
|
631
632
|
function Je(t) {
|
|
632
633
|
return w(Ye, t);
|
|
633
634
|
}
|
|
634
|
-
const Qe = () => "0.0.
|
|
635
|
+
const Qe = () => "0.0.23-next.1";
|
|
635
636
|
function Xe() {
|
|
636
|
-
if (
|
|
637
|
+
if (L()) {
|
|
637
638
|
const t = [
|
|
638
639
|
document.currentScript,
|
|
639
640
|
document.getElementById("picked_script"),
|
|
@@ -648,45 +649,45 @@ function Xe() {
|
|
|
648
649
|
return "https://api.picked.app";
|
|
649
650
|
}
|
|
650
651
|
function Ze() {
|
|
651
|
-
if (!
|
|
652
|
+
if (!ie())
|
|
652
653
|
return {};
|
|
653
|
-
const t = new URLSearchParams(window.location.search), e = {},
|
|
654
|
+
const t = new URLSearchParams(window.location.search), e = {}, s = /* @__PURE__ */ new Set();
|
|
654
655
|
for (const [o] of t.entries())
|
|
655
|
-
o.startsWith("picked-") &&
|
|
656
|
-
for (const o of
|
|
656
|
+
o.startsWith("picked-") && s.add(o);
|
|
657
|
+
for (const o of s) {
|
|
657
658
|
const l = o.replace("picked-", "");
|
|
658
659
|
e[l] = t.getAll(o);
|
|
659
660
|
}
|
|
660
661
|
const n = B("s");
|
|
661
|
-
if (
|
|
662
|
-
|
|
662
|
+
if (s.size > 0)
|
|
663
|
+
O.set(n, e);
|
|
663
664
|
else {
|
|
664
|
-
const o =
|
|
665
|
+
const o = O.get(n);
|
|
665
666
|
if (o)
|
|
666
667
|
return o.json() || {};
|
|
667
668
|
}
|
|
668
669
|
return e;
|
|
669
670
|
}
|
|
670
671
|
function et() {
|
|
671
|
-
if (
|
|
672
|
+
if (ae())
|
|
672
673
|
return crypto.randomUUID();
|
|
673
|
-
const t = Date.now().toString(36), e = Math.random().toString(36).substring(2, 15),
|
|
674
|
-
return `${t}-${e}-${
|
|
674
|
+
const t = Date.now().toString(36), e = Math.random().toString(36).substring(2, 15), s = Math.random().toString(36).substring(2, 15), n = Math.random().toString(36).substring(2, 15);
|
|
675
|
+
return `${t}-${e}-${s}-${n}`;
|
|
675
676
|
}
|
|
676
|
-
const tt = B("session", "global"),
|
|
677
|
-
const t =
|
|
677
|
+
const tt = B("session", "global"), st = () => {
|
|
678
|
+
const t = j.get(tt);
|
|
678
679
|
let e;
|
|
679
680
|
t.isSet() && (e = t.json());
|
|
680
|
-
const
|
|
681
|
+
const s = (o) => t.set({ id: o.id, isUser: o.isUser }), n = {
|
|
681
682
|
id: (e == null ? void 0 : e.id) ?? et(),
|
|
682
683
|
isUser: (e == null ? void 0 : e.isUser) ?? void 0,
|
|
683
684
|
setIsUser(o) {
|
|
684
|
-
this.isUser = o,
|
|
685
|
+
this.isUser = o, s(this);
|
|
685
686
|
}
|
|
686
687
|
};
|
|
687
|
-
return
|
|
688
|
-
},
|
|
689
|
-
class
|
|
688
|
+
return s(n), n;
|
|
689
|
+
}, rt = () => oe() ? st() : null;
|
|
690
|
+
class q {
|
|
690
691
|
constructor(e) {
|
|
691
692
|
m(this, "options");
|
|
692
693
|
m(this, "isReady", !1);
|
|
@@ -701,59 +702,59 @@ class G {
|
|
|
701
702
|
m(this, "condition");
|
|
702
703
|
m(this, "searchParams", Ze());
|
|
703
704
|
m(this, "history", Ve());
|
|
704
|
-
m(this, "components",
|
|
705
|
-
m(this, "experienceInstances",
|
|
706
|
-
m(this, "experiences",
|
|
705
|
+
m(this, "components", ke({ client: this }));
|
|
706
|
+
m(this, "experienceInstances", te({ client: this }));
|
|
707
|
+
m(this, "experiences", pe({ client: this }));
|
|
707
708
|
m(this, "frameworks", be({ client: this }));
|
|
708
709
|
m(this, "predicates", je({ client: this }));
|
|
709
710
|
m(this, "features", De({ client: this }));
|
|
710
711
|
m(this, "responses", Je({ client: this }));
|
|
711
712
|
m(this, "fields", _e());
|
|
712
713
|
m(this, "actions", qe());
|
|
713
|
-
v("info", "Picked client initializing."), this.organizationId = e.organizationId, this.projectId = e.projectId, this.options = Object.freeze(e), this.apiUrl = e.apiUrl || Xe(), this.session =
|
|
714
|
+
v("info", "Picked client initializing."), this.organizationId = e.organizationId, this.projectId = e.projectId, this.options = Object.freeze(e), this.apiUrl = e.apiUrl || Xe(), this.session = rt(), this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.precondition = e.precondition, this.condition = e.condition, this.eventBus({ type: "load", version: Qe() }), v("info", "Picked client initialized.");
|
|
714
715
|
}
|
|
715
716
|
start() {
|
|
716
717
|
Re(this), (async () => {
|
|
717
|
-
if (!
|
|
718
|
+
if (!L())
|
|
718
719
|
return;
|
|
719
|
-
let
|
|
720
|
-
this.precondition !== void 0 && await E(this, this.precondition) !== !0 && (n = !1,
|
|
720
|
+
let s = !0, n;
|
|
721
|
+
this.precondition !== void 0 && await E(this, this.precondition) !== !0 && (n = !1, s = !1), this.condition !== void 0 && n !== !1 && await E(this, this.condition) !== !0 && (s = !1), this.session && this.session.setIsUser(s), this.eventBus({ type: "initialize" }), this.eventBus({ type: "user_decide", value: s }), document.body && s && M(this), await se(), s && M(this), this.eventBus({ type: "ready" }), this.isReady = !0, this.session && this.eventBus({ type: "session", ...this.session });
|
|
721
722
|
})();
|
|
722
723
|
}
|
|
723
724
|
registerFramework(e) {
|
|
724
|
-
|
|
725
|
+
Ie(e, this.frameworks);
|
|
725
726
|
}
|
|
726
|
-
registerComponent(e,
|
|
727
|
-
V(e,
|
|
727
|
+
registerComponent(e, s) {
|
|
728
|
+
V(e, s, this.components);
|
|
728
729
|
}
|
|
729
730
|
registerPlugin(e) {
|
|
730
|
-
|
|
731
|
+
me(this, e, this.plugins);
|
|
731
732
|
}
|
|
732
|
-
registerFeature(e,
|
|
733
|
-
Ue(e,
|
|
733
|
+
registerFeature(e, s) {
|
|
734
|
+
Ue(e, s, this.features);
|
|
734
735
|
}
|
|
735
|
-
registerPredicate(e,
|
|
736
|
-
Oe(e,
|
|
736
|
+
registerPredicate(e, s) {
|
|
737
|
+
Oe(e, s, this.predicates);
|
|
737
738
|
}
|
|
738
739
|
registerField(e) {
|
|
739
740
|
Le(e, this.fields);
|
|
740
741
|
}
|
|
741
|
-
registerAction(e,
|
|
742
|
-
Ge(e,
|
|
742
|
+
registerAction(e, s) {
|
|
743
|
+
Ge(e, s, this.actions);
|
|
743
744
|
}
|
|
744
745
|
registerExperience(e) {
|
|
745
|
-
e.component && V(`experience:${e.id}`, e.component, this.components),
|
|
746
|
+
e.component && V(`experience:${e.id}`, e.component, this.components), ge(e, this.experiences);
|
|
746
747
|
}
|
|
747
748
|
getStateSnapshot() {
|
|
748
749
|
return Be(this);
|
|
749
750
|
}
|
|
750
751
|
async launchExperienceById(e) {
|
|
751
|
-
const
|
|
752
|
-
if (!
|
|
752
|
+
const s = this.experiences.getById(e).getState();
|
|
753
|
+
if (!s) {
|
|
753
754
|
v("warn", `Experience with id '${e}' not found.`);
|
|
754
755
|
return;
|
|
755
756
|
}
|
|
756
|
-
|
|
757
|
+
K(this, s);
|
|
757
758
|
}
|
|
758
759
|
// private async fetchProject() {
|
|
759
760
|
// if (this.project) {
|
|
@@ -766,14 +767,14 @@ class G {
|
|
|
766
767
|
// }
|
|
767
768
|
setupPlugins() {
|
|
768
769
|
var e;
|
|
769
|
-
(e = this.options.plugins) == null || e.forEach((
|
|
770
|
-
if (Array.isArray(
|
|
771
|
-
|
|
770
|
+
(e = this.options.plugins) == null || e.forEach((s) => {
|
|
771
|
+
if (Array.isArray(s)) {
|
|
772
|
+
s.forEach((o) => {
|
|
772
773
|
this.registerPlugin(o);
|
|
773
774
|
});
|
|
774
775
|
return;
|
|
775
776
|
}
|
|
776
|
-
const n = typeof
|
|
777
|
+
const n = typeof s == "function" ? s() : s;
|
|
777
778
|
if (Array.isArray(n)) {
|
|
778
779
|
n.forEach((o) => this.registerPlugin(o));
|
|
779
780
|
return;
|
|
@@ -783,12 +784,12 @@ class G {
|
|
|
783
784
|
}
|
|
784
785
|
setupFeatures() {
|
|
785
786
|
const e = this.options.features;
|
|
786
|
-
e && (Object.entries(e).forEach(([
|
|
787
|
+
e && (Object.entries(e).forEach(([s, n]) => {
|
|
787
788
|
const o = typeof n == "function" ? n() : n;
|
|
788
|
-
this.registerFeature(
|
|
789
|
-
}), this.searchParams.feature && this.searchParams.feature.forEach((
|
|
789
|
+
this.registerFeature(s, o);
|
|
790
|
+
}), this.searchParams.feature && this.searchParams.feature.forEach((s) => {
|
|
790
791
|
try {
|
|
791
|
-
const [n, o] =
|
|
792
|
+
const [n, o] = s.split(":");
|
|
792
793
|
if (!n || !o)
|
|
793
794
|
return;
|
|
794
795
|
let l = o;
|
|
@@ -806,73 +807,73 @@ class G {
|
|
|
806
807
|
}
|
|
807
808
|
setupPredicates() {
|
|
808
809
|
const e = this.options.predicates;
|
|
809
|
-
e && Object.entries(e).forEach(([
|
|
810
|
+
e && Object.entries(e).forEach(([s, n]) => {
|
|
810
811
|
if (typeof n != "function") {
|
|
811
|
-
v("warn", `Predicate "${
|
|
812
|
+
v("warn", `Predicate "${s}" is not a function.`);
|
|
812
813
|
return;
|
|
813
814
|
}
|
|
814
|
-
this.registerPredicate(
|
|
815
|
+
this.registerPredicate(s, n);
|
|
815
816
|
});
|
|
816
817
|
}
|
|
817
818
|
setupActions() {
|
|
818
819
|
const e = this.options.actions;
|
|
819
|
-
e && Object.entries(e).forEach(([
|
|
820
|
+
e && Object.entries(e).forEach(([s, n]) => {
|
|
820
821
|
if (typeof n != "function") {
|
|
821
|
-
v("warn", `Action "${
|
|
822
|
+
v("warn", `Action "${s}" is not a function.`);
|
|
822
823
|
return;
|
|
823
824
|
}
|
|
824
|
-
this.registerAction(
|
|
825
|
+
this.registerAction(s, n);
|
|
825
826
|
});
|
|
826
827
|
}
|
|
827
828
|
getPluginConfig(e) {
|
|
828
829
|
return this.plugins[e] ?? {};
|
|
829
830
|
}
|
|
830
831
|
}
|
|
831
|
-
m(
|
|
832
|
-
function
|
|
832
|
+
m(q, "logger", v);
|
|
833
|
+
function G(t) {
|
|
833
834
|
var e;
|
|
834
|
-
return ((e = t.options) == null ? void 0 : e.some((
|
|
835
|
+
return ((e = t.options) == null ? void 0 : e.some((s) => "condition" in s)) ?? !1;
|
|
835
836
|
}
|
|
836
837
|
function nt(t) {
|
|
837
|
-
return t.some((e) => e.condition ||
|
|
838
|
+
return t.some((e) => e.condition || G(e));
|
|
838
839
|
}
|
|
839
840
|
async function ft(t, e) {
|
|
840
841
|
return e.length === 0 || !nt(e) ? e : (await Promise.all(
|
|
841
842
|
e.map(async (n) => {
|
|
842
843
|
if (!(n.condition ? await E(t, n.condition) : !0))
|
|
843
844
|
return null;
|
|
844
|
-
if (!n.options || !
|
|
845
|
+
if (!n.options || !G(n))
|
|
845
846
|
return n;
|
|
846
|
-
const
|
|
847
|
+
const r = (await Promise.all(
|
|
847
848
|
n.options.map(async (u) => u.condition ? await E(t, u.condition) ? u : null : u)
|
|
848
849
|
)).filter((u) => u !== null);
|
|
849
|
-
return
|
|
850
|
+
return r.length === n.options.length ? n : r.length === 0 ? null : { ...n, options: r };
|
|
850
851
|
})
|
|
851
852
|
)).filter((n) => n !== null);
|
|
852
853
|
}
|
|
853
854
|
const mt = (t) => {
|
|
854
|
-
const e = new
|
|
855
|
-
return
|
|
855
|
+
const e = new q(t);
|
|
856
|
+
return ce(e), e;
|
|
856
857
|
};
|
|
857
858
|
export {
|
|
858
|
-
|
|
859
|
+
q as Picked,
|
|
859
860
|
mt as createClient,
|
|
860
861
|
B as createStorageKey,
|
|
861
862
|
E as evaluateRuleLogic,
|
|
862
863
|
ft as getStepFields,
|
|
863
864
|
St as isPickedRoot,
|
|
864
|
-
|
|
865
|
-
|
|
865
|
+
j as localStore,
|
|
866
|
+
O as sessionStore,
|
|
866
867
|
kt as subscribe,
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
868
|
+
Ft as supportsCookies,
|
|
869
|
+
ae as supportsCryptoRandomUUID,
|
|
870
|
+
L as supportsDocument,
|
|
871
|
+
bt as supportsHistory,
|
|
872
|
+
It as supportsIntersectionObserver,
|
|
873
|
+
oe as supportsLocalStorage,
|
|
873
874
|
xt as supportsLocation,
|
|
874
875
|
Et as supportsSessionStorage,
|
|
875
876
|
Pt as supportsShadowRoot,
|
|
876
877
|
Rt as supportsWebComponents,
|
|
877
|
-
|
|
878
|
+
ie as supportsWindow
|
|
878
879
|
};
|