@picked/client 0.0.62-next.12 → 0.0.62-next.3

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.
Files changed (55) hide show
  1. package/dist/{api-BTbEUnGh.js → api-DnsQgAfY.js} +1 -1
  2. package/dist/api-Dy5cTzV6.cjs +1 -0
  3. package/dist/cjs/index.js +2 -2
  4. package/dist/cjs/plugins/create-experience/index.js +1 -1
  5. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  6. package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
  7. package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
  8. package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
  9. package/dist/cjs/server/index.js +1 -1
  10. package/dist/docs/image-optimisation-service.md +6 -6
  11. package/dist/docs/sdk/content-security-policy.md +7 -8
  12. package/dist/docs/sdk/fields.md +2 -2
  13. package/dist/docs/workspaces.mdx +1 -1
  14. package/dist/esm/index.js +277 -342
  15. package/dist/esm/plugins/create-experience/index.js +1 -1
  16. package/dist/esm/plugins/dynamic-experiences/index.js +38 -109
  17. package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
  18. package/dist/esm/plugins/history-browser-storage/index.js +1 -1
  19. package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
  20. package/dist/esm/server/index.js +1 -1
  21. package/dist/experience-instance-BrLWgVAN.js +501 -0
  22. package/dist/experience-instance-Ct3ogC7n.cjs +1 -0
  23. package/dist/types/entities/experience/experience.d.ts +2 -22
  24. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  25. package/dist/types/entities/step/step.d.ts +2 -17
  26. package/dist/types/entities/step/step.d.ts.map +1 -1
  27. package/dist/types/index.d.ts +0 -2
  28. package/dist/types/index.d.ts.map +1 -1
  29. package/dist/types/lifecycle/state-snapshot.d.ts.map +1 -1
  30. package/dist/types/picked.d.ts +0 -39
  31. package/dist/types/picked.d.ts.map +1 -1
  32. package/dist/types/plugins/dynamic-experiences/index.d.ts +1 -2
  33. package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
  34. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +1 -18
  35. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
  36. package/dist/types/plugins/dynamic-experiences/types.d.ts +1 -63
  37. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
  38. package/package.json +1 -11
  39. package/dist/api-DDd_Zf11.cjs +0 -1
  40. package/dist/cjs/plugins/dom-observer/index.js +0 -1
  41. package/dist/dom-C3C6Fmwz.cjs +0 -1
  42. package/dist/dom-DGePXPpM.js +0 -84
  43. package/dist/esm/plugins/dom-observer/index.js +0 -87
  44. package/dist/experience-instance-DImym3m_.js +0 -419
  45. package/dist/experience-instance-DygAdzbn.cjs +0 -1
  46. package/dist/types/entities/content/content.d.ts +0 -37
  47. package/dist/types/entities/content/content.d.ts.map +0 -1
  48. package/dist/types/plugins/dom-observer/index.d.ts +0 -3
  49. package/dist/types/plugins/dom-observer/index.d.ts.map +0 -1
  50. package/dist/types/plugins/dom-observer/plugin.d.ts +0 -50
  51. package/dist/types/plugins/dom-observer/plugin.d.ts.map +0 -1
  52. /package/dist/{id-Cg7fVl1O.cjs → id-Bv44ilEo.cjs} +0 -0
  53. /package/dist/{id-n2yrHvNo.js → id-CRqy981z.js} +0 -0
  54. /package/dist/{storage-hOHCCXvP.js → storage-6Xk0uAxB.js} +0 -0
  55. /package/dist/{storage-BXSlLTRa.cjs → storage-B6lQtc4-.cjs} +0 -0
@@ -0,0 +1,501 @@
1
+ import { n as e, t } from "./rules-logic-D_CVBuv7.js";
2
+ import "./logger-6z_gb4rA.js";
3
+ import { d as n, l as r, r as i } from "./supports-0XIfd4-R.js";
4
+ import { attach as a, combine as o, createApi as s, createDomain as c, createEffect as l, createEvent as u, sample as d, split as f } from "effector";
5
+ import { createFactory as p, invoke as m } from "@withease/factories";
6
+ //#region src/utils/dom.ts
7
+ function h(e) {
8
+ return !n() || !i() ? [] : Array.from(window.document.querySelectorAll(e)).filter((e) => e instanceof HTMLElement);
9
+ }
10
+ var g = "open";
11
+ function _(e) {
12
+ if (!r()) throw Error("Shadow DOM is not supported in this environment");
13
+ return e.attachShadow({ mode: g });
14
+ }
15
+ function v() {
16
+ return new Promise((e, t) => {
17
+ if (!i()) {
18
+ t();
19
+ return;
20
+ }
21
+ document.readyState === "loading" ? document.addEventListener("readystatechange", () => e(), { once: !0 }) : e();
22
+ });
23
+ }
24
+ function y(e, t) {
25
+ let n = new MutationObserver((r) => {
26
+ document.contains(e) || (n.disconnect(), t());
27
+ });
28
+ n.observe(document.body, {
29
+ childList: !0,
30
+ subtree: !0
31
+ });
32
+ }
33
+ var b = "picked-root", x = "picked-target", S = "picked-root";
34
+ function C(e, t) {
35
+ return [...e, {
36
+ selector: `${S}[experience-id="${t}"]`,
37
+ placement: "replace"
38
+ }].flatMap((e) => {
39
+ let n = h(e.selector).filter((e) => !E(e, t) && !D(e, t));
40
+ return {
41
+ ...e,
42
+ elements: n
43
+ };
44
+ });
45
+ }
46
+ function w(e, t, n) {
47
+ return e.flatMap((e) => e.elements.map((r) => k(r, e.placement, t, n)));
48
+ }
49
+ function T(e, t) {
50
+ e.classList.add(x), e.classList.add(`${x}-${t}`);
51
+ }
52
+ function E(e, t) {
53
+ return t ? e.classList.contains(`${x}-${t}`) : e.classList.contains(`${x}`);
54
+ }
55
+ function D(e, t) {
56
+ return t ? e.classList.contains(`${b}-${t}`) : e.classList.contains(b);
57
+ }
58
+ function O(e, t) {
59
+ let n = document.createElement("div");
60
+ return n.style.display = "block", n.classList.add(b), n.classList.add(`${b}-${e}`), n.classList.add(`${b}-${t}`), n;
61
+ }
62
+ function k(e, t, n, r) {
63
+ let i, a = O(n, r);
64
+ if (e instanceof Document) i = e.body.appendChild(a);
65
+ else {
66
+ switch (t) {
67
+ case "replace":
68
+ e.replaceWith(a);
69
+ break;
70
+ case "before":
71
+ e.before(a);
72
+ break;
73
+ case "after":
74
+ e.after(a);
75
+ break;
76
+ case "prepend":
77
+ e.prepend(a);
78
+ break;
79
+ case "append":
80
+ e.append(a);
81
+ break;
82
+ }
83
+ i = a;
84
+ }
85
+ return i;
86
+ }
87
+ //#endregion
88
+ //#region src/utils/nodes.ts
89
+ function A(e) {
90
+ return e.type === "condition";
91
+ }
92
+ function j(e) {
93
+ return e.type === "step";
94
+ }
95
+ function M(e) {
96
+ return e.type === "experience";
97
+ }
98
+ function N(e) {
99
+ return e.type === "origin";
100
+ }
101
+ function P(e) {
102
+ return e.type === "action";
103
+ }
104
+ //#endregion
105
+ //#region src/utils/node-tree/next-reachable-step-nodes.ts
106
+ var F = (e, t, n, r, i = /* @__PURE__ */ new Set()) => i.has(n.id) ? [] : (i.add(n.id), j(n) && !r ? [n] : t.filter((e) => e.sourceNodeId === n.id).flatMap((n) => {
107
+ let r = e.find((e) => e.id === n.destinationNodeId);
108
+ return r ? F(e, t, r, !1, i) : [];
109
+ })), ee = (e, t, n) => F(e, t, n, !0, /* @__PURE__ */ new Set()), I = (e, t, n, r, i = /* @__PURE__ */ new Set()) => {
110
+ if (i.has(n.id)) return [-1, -1];
111
+ i.add(n.id);
112
+ let a = t.filter((e) => e.sourceNodeId === n.id);
113
+ if (a.length === 0) return [0, 0];
114
+ let o = Infinity, s = -Infinity;
115
+ for (let n of a) {
116
+ let r = e.find((e) => e.id === n.destinationNodeId);
117
+ if (!r) continue;
118
+ let [a, c] = I(e, t, r, !1, new Set(i));
119
+ a !== -1 && (o = Math.min(o, a + 1), s = Math.max(s, c + 1));
120
+ }
121
+ return o === Infinity ? [-1, -1] : [o, s];
122
+ }, te = (e, t, n) => I(e, t, n, !0, /* @__PURE__ */ new Set()), L = (e, t, n, r = /* @__PURE__ */ new Set()) => {
123
+ if (r.has(n.id)) return [-1, -1];
124
+ if (r.add(n.id), n.type === "origin") return [0, 0];
125
+ let i = t.filter((e) => e.destinationNodeId === n.id);
126
+ if (i.length === 0) return [-1, -1];
127
+ let a = Infinity, o = -Infinity;
128
+ for (let n of i) {
129
+ let i = e.find((e) => e.id === n.sourceNodeId);
130
+ if (!i) continue;
131
+ let [s, c] = L(e, t, i, new Set(r));
132
+ s !== -1 && (a = Math.min(a, s + 1), o = Math.max(o, c + 1));
133
+ }
134
+ return a === Infinity ? [-1, -1] : [a, o];
135
+ }, ne = (e, t, n) => L(e, t, n, /* @__PURE__ */ new Set()), R = (e) => e.find((e) => e.type === "origin") || null, z = (e, t, n) => {
136
+ if (!e) return R(t);
137
+ let r = n.find((t) => t.sourceNodeId === e.id);
138
+ return r && t.find((e) => e.id === r.destinationNodeId) || null;
139
+ };
140
+ //#endregion
141
+ //#region src/utils/node-tree/get-next-node-from-condition.ts
142
+ async function re(e, t, n, r) {
143
+ let i = e ? "true" : "false", a = r.find((e) => e.sourceHandle === i && e.sourceNodeId === t);
144
+ return n.find((e) => e.id === a?.destinationNodeId);
145
+ }
146
+ //#endregion
147
+ //#region src/entities/experience-instance/experience-instance.ts
148
+ var B = c("experience-instance"), V = p(({ client: n, experience: r, target: i, options: c }) => {
149
+ let p = u(), m = u(), h = u(), g = u(), v = u(), y = u(), b = r.componentStore, x = B.store("transitioning"), S = n.history.entriesStore.map((e) => e.filter((e) => e.experienceId === r.id)), C = S.map((e) => e.filter((e) => j(e.node))), w = S.map((e) => e.at(-1)?.node || null), T = o(n.steps.listStore, w, (e, t) => e.find((e) => t && j(t) && e.id === t.stepId) || null), E = o(n.steps.listStore, C, (e, t) => {
150
+ let n = t.at(-2);
151
+ if (!n || !j(n.node)) return null;
152
+ let r = n.node;
153
+ return e.find((e) => e.id === r.stepId) || null;
154
+ }), D = o(r.treeStore, w, ({ nodes: e, edges: t }, n) => n ? ee(e, t, n) : []), O = o(r.treeStore, w, ({ nodes: e, edges: t }, n) => n ? ne(e, t, n) : [-1, -1]), k = o(r.treeStore, w, ({ nodes: e, edges: t }, n) => n ? te(e, t, n) : [-1, -1]), F = B.store(!1), I = s(F, {
155
+ open: () => !0,
156
+ close: () => !1,
157
+ toggle: (e) => !e,
158
+ set: (e, t) => t
159
+ }), L = l(async () => {
160
+ n.history.back({ experienceId: r.id });
161
+ }), V = a({
162
+ source: r.treeStore,
163
+ effect: async (e, t) => {
164
+ let i = e.nodes.find((e) => j(e) && e.stepId === t);
165
+ i && n.history.push({
166
+ experienceId: r.id,
167
+ node: i
168
+ });
169
+ }
170
+ }), H = a({
171
+ source: w,
172
+ effect: (e) => {}
173
+ }), U = a({
174
+ source: r.treeStore,
175
+ effect: async ({ nodes: e }) => R(e)
176
+ }), W = a({
177
+ source: r.treeStore,
178
+ effect: async ({ nodes: e, edges: t }, n) => {
179
+ if (N(n)) return z(n, e, t);
180
+ }
181
+ }), G = a({
182
+ source: r.treeStore,
183
+ effect: async ({ nodes: e, edges: r, conditions: i }, a) => {
184
+ if (!A(a)) return;
185
+ let o = i.find((e) => e.id === a.conditionId)?.logic;
186
+ return o ? re(!!await t(n, o), a.id, e, r) : void 0;
187
+ }
188
+ }), K = a({
189
+ source: {
190
+ tree: r.treeStore,
191
+ actions: n.actions.listStore,
192
+ snapshot: n.stateSnapshotStore
193
+ },
194
+ effect: async ({ tree: e, actions: t, snapshot: n }, r) => {
195
+ let { nodes: i, edges: a } = e;
196
+ if (!P(r)) return;
197
+ let o = r.actionKey;
198
+ if (!o) {
199
+ `${r.id}`;
200
+ return;
201
+ }
202
+ let s = t.find((e) => e.key === o)?.action;
203
+ if (!s) {
204
+ `${o}`;
205
+ let e = a.find((e) => e.sourceNodeId === r.id && e.sourceHandle === "false");
206
+ return e ? i.find((t) => t.id === e.destinationNodeId) : null;
207
+ }
208
+ if (typeof s != "function") {
209
+ `${o}`;
210
+ let e = a.find((e) => e.sourceNodeId === r.id && e.sourceHandle === "false");
211
+ return e ? i.find((t) => t.id === e.destinationNodeId) : null;
212
+ }
213
+ try {
214
+ `${o}`, await s({
215
+ ...n,
216
+ args: []
217
+ }, { experience: Z });
218
+ let e = a.find((e) => e.sourceNodeId === r.id && e.sourceHandle === "true");
219
+ if (!e) return `${r.id}`, null;
220
+ let t = i.find((t) => t.id === e.destinationNodeId);
221
+ return `${o}${t?.id}`, t || null;
222
+ } catch {
223
+ `${o}`;
224
+ let e = a.find((e) => e.sourceNodeId === r.id && e.sourceHandle === "false");
225
+ if (!e) return `${r.id}`, null;
226
+ let t = i.find((t) => t.id === e.destinationNodeId);
227
+ return `${o}${t?.id}`, t || null;
228
+ }
229
+ }
230
+ }), ie = l((e) => {
231
+ M(e) && n.experiences.launch({ key: e.experienceKey });
232
+ }), q = a({
233
+ source: [w, r.treeStore],
234
+ effect: async ([e, { nodes: t, edges: n }]) => z(e, t, n)
235
+ }), J = a({
236
+ source: [w, r.treeStore],
237
+ effect: async ([e, { nodes: t, edges: n }]) => z(e, t, n)
238
+ }), ae = l((e) => {
239
+ n.history.push({
240
+ experienceId: r.id,
241
+ node: e
242
+ });
243
+ }), Y = a({
244
+ source: r.configStore,
245
+ effect: async ({ initializeOpenLogic: r }) => c?.initialiseOpen === void 0 ? e(r) ? !!await t(n, r) : r ?? !1 : c.initialiseOpen
246
+ }), X = o(b, n.frameworks.listStore, (e, t) => {
247
+ if (!e) return null;
248
+ let n = t.find((t) => t.name === e.component.frameworkName);
249
+ return n ? {
250
+ component: e,
251
+ framework: n
252
+ } : null;
253
+ }, { skipVoid: !1 }), Z, oe = a({
254
+ source: X,
255
+ effect: (e) => {
256
+ if (!e) return;
257
+ if (!i) {
258
+ `${r.id}`;
259
+ return;
260
+ }
261
+ let t = _(i);
262
+ try {
263
+ e.framework.render(t, e.component.component, n, Z);
264
+ } catch {}
265
+ }
266
+ });
267
+ Z = Object.freeze({
268
+ id: Math.random().toString(36).substring(7),
269
+ experienceKey: r.key,
270
+ experienceId: r.id,
271
+ experienceName: r.name,
272
+ configStore: r.configStore,
273
+ target: i,
274
+ componentStore: b,
275
+ componentAndFrameworkStore: X,
276
+ stateStore: x,
277
+ isOpenStore: F,
278
+ open: I.open,
279
+ close: I.close,
280
+ toggleOpen: I.toggle,
281
+ setOpen: I.set,
282
+ treeStore: r.treeStore,
283
+ currentNodeStore: w,
284
+ currentStepStore: T,
285
+ previousStepStore: E,
286
+ nextReachableStepNodesStore: D,
287
+ stepsToOriginStore: O,
288
+ stepsToLeafStore: k,
289
+ goToNextStep: m,
290
+ goToPreviousStep: h,
291
+ goToStepById: g,
292
+ stepsHistoryStore: C,
293
+ mountFx: oe
294
+ });
295
+ let Q = u(), $ = u();
296
+ return d({
297
+ clock: w,
298
+ target: Q
299
+ }), d({
300
+ clock: Q,
301
+ filter: (e) => e === null,
302
+ target: U
303
+ }), d({
304
+ clock: Q,
305
+ filter: (e) => e !== null,
306
+ target: $
307
+ }), f({
308
+ source: $,
309
+ match: (e) => A(e) ? "condition" : j(e) ? "step" : M(e) ? "launchExperience" : N(e) ? "origin" : P(e) ? "action" : "other",
310
+ cases: {
311
+ origin: W,
312
+ condition: G,
313
+ step: H,
314
+ launchExperience: ie,
315
+ action: K,
316
+ __: u()
317
+ }
318
+ }), d({
319
+ clock: [
320
+ G.doneData,
321
+ W.doneData,
322
+ U.doneData,
323
+ J.doneData,
324
+ q.doneData,
325
+ K.doneData
326
+ ],
327
+ filter: Boolean,
328
+ target: ae
329
+ }), d({
330
+ clock: m,
331
+ target: J
332
+ }), d({
333
+ clock: m,
334
+ source: T,
335
+ filter: Boolean,
336
+ target: n.eventBus.prepend((e) => ({
337
+ type: "step_submit",
338
+ step: e,
339
+ experience: Z
340
+ }))
341
+ }), d({
342
+ clock: J.done,
343
+ source: T,
344
+ filter: Boolean,
345
+ target: n.eventBus.prepend((e) => ({
346
+ type: "step_submit_success",
347
+ step: e,
348
+ experience: Z
349
+ }))
350
+ }), d({
351
+ clock: J.fail,
352
+ source: T,
353
+ filter: Boolean,
354
+ target: n.eventBus.prepend((e) => ({
355
+ type: "step_submit_error",
356
+ step: e,
357
+ experience: Z
358
+ }))
359
+ }), d({
360
+ clock: h,
361
+ target: L
362
+ }), d({
363
+ clock: g,
364
+ target: V
365
+ }), d({
366
+ source: o([
367
+ G.pending,
368
+ W.pending,
369
+ U.pending,
370
+ J.pending
371
+ ]),
372
+ fn: (e) => e.some(Boolean) ? "transitioning" : "ready",
373
+ target: x
374
+ }), d({
375
+ clock: H.doneData,
376
+ source: T,
377
+ filter: Boolean,
378
+ target: n.eventBus.prepend((e) => ({
379
+ type: "step_enter",
380
+ step: e,
381
+ experience: Z
382
+ }))
383
+ }), d({
384
+ clock: y,
385
+ target: Y
386
+ }), d({
387
+ source: Y.doneData,
388
+ fn: Boolean,
389
+ target: F
390
+ }), d({
391
+ source: w,
392
+ clock: p,
393
+ filter: (e) => e ? N(e) : !0,
394
+ target: q
395
+ }), d({
396
+ source: F,
397
+ filter: Boolean,
398
+ target: p
399
+ }), d({
400
+ source: F,
401
+ filter: Boolean,
402
+ target: n.eventBus.prepend(() => ({
403
+ type: "experience_open",
404
+ experience: Z
405
+ }))
406
+ }), d({
407
+ source: F,
408
+ filter: (e) => !e,
409
+ target: n.eventBus.prepend(() => ({
410
+ type: "experience_close",
411
+ experience: Z
412
+ }))
413
+ }), d({
414
+ clock: v,
415
+ target: [y]
416
+ }), v(), Z;
417
+ });
418
+ function H(e) {
419
+ return m(V, e);
420
+ }
421
+ var U = p(({ client: e }) => {
422
+ let t = B.store({}), n = u(), r = u(), i = u(), a = s(t, {
423
+ register(e, t) {
424
+ let n = [...e[t.experienceId] ?? []];
425
+ return n.push(t), {
426
+ ...e,
427
+ [t.experienceId]: n
428
+ };
429
+ },
430
+ unregister(e, t) {
431
+ let n = t.experienceId, r = e[n]?.filter((e) => e !== t);
432
+ return {
433
+ ...e,
434
+ [n]: r ?? []
435
+ };
436
+ }
437
+ }), o = l(({ experience: t, target: n, options: r }) => H({
438
+ client: e,
439
+ experience: t,
440
+ target: n,
441
+ options: r
442
+ })), c = l((e) => {
443
+ a.register(e);
444
+ }), f = l((e) => {
445
+ e.target && y(e.target, () => {
446
+ i(e);
447
+ });
448
+ }), p = l((e) => {
449
+ a.unregister(e);
450
+ }), m = l(async (e) => {
451
+ await e.mountFx();
452
+ });
453
+ d({
454
+ clock: n,
455
+ target: o
456
+ }), d({
457
+ clock: i,
458
+ target: p
459
+ }), d({
460
+ clock: o.doneData,
461
+ target: [
462
+ c,
463
+ f,
464
+ r
465
+ ]
466
+ }), d({
467
+ clock: o.doneData,
468
+ target: e.eventBus.prepend((e) => ({
469
+ type: "experience_initialize",
470
+ experience: e
471
+ }))
472
+ }), d({
473
+ clock: r,
474
+ target: m
475
+ });
476
+ function h(e, t, r) {
477
+ n({
478
+ experience: e,
479
+ target: t,
480
+ options: r
481
+ });
482
+ }
483
+ let g = t.map((e) => Object.values(e).flat());
484
+ function _(e) {
485
+ return g.map((t) => t.filter((t) => t.experienceKey === e), { skipVoid: !1 });
486
+ }
487
+ function v(e) {
488
+ return t.map((t) => t[e] || [], { skipVoid: !1 });
489
+ }
490
+ return {
491
+ spawn: h,
492
+ getByExperienceKey: _,
493
+ getByExperienceId: v,
494
+ listStore: g
495
+ };
496
+ });
497
+ function W(e) {
498
+ return m(U, e);
499
+ }
500
+ //#endregion
501
+ export { w as a, D as c, j as i, T as l, W as n, v as o, A as r, C as s, H as t };
@@ -0,0 +1 @@
1
+ const e=require(`./rules-logic-H6P8xwHF.cjs`);require(`./logger-fbvQC40v.cjs`);const t=require(`./supports-Dsjg-82e.cjs`);let n=require(`effector`),r=require(`@withease/factories`);function i(e){return!t.d()||!t.r()?[]:Array.from(window.document.querySelectorAll(e)).filter(e=>e instanceof HTMLElement)}var a=`open`;function o(e){if(!t.l())throw Error(`Shadow DOM is not supported in this environment`);return e.attachShadow({mode:a})}function s(){return new Promise((e,n)=>{if(!t.r()){n();return}document.readyState===`loading`?document.addEventListener(`readystatechange`,()=>e(),{once:!0}):e()})}function c(e,t){let n=new MutationObserver(r=>{document.contains(e)||(n.disconnect(),t())});n.observe(document.body,{childList:!0,subtree:!0})}var l=`picked-root`,u=`picked-target`,d=`picked-root`;function f(e,t){return[...e,{selector:`${d}[experience-id="${t}"]`,placement:`replace`}].flatMap(e=>{let n=i(e.selector).filter(e=>!h(e,t)&&!g(e,t));return{...e,elements:n}})}function p(e,t,n){return e.flatMap(e=>e.elements.map(r=>v(r,e.placement,t,n)))}function m(e,t){e.classList.add(u),e.classList.add(`${u}-${t}`)}function h(e,t){return t?e.classList.contains(`${u}-${t}`):e.classList.contains(`${u}`)}function g(e,t){return t?e.classList.contains(`${l}-${t}`):e.classList.contains(l)}function _(e,t){let n=document.createElement(`div`);return n.style.display=`block`,n.classList.add(l),n.classList.add(`${l}-${e}`),n.classList.add(`${l}-${t}`),n}function v(e,t,n,r){let i,a=_(n,r);if(e instanceof Document)i=e.body.appendChild(a);else{switch(t){case`replace`:e.replaceWith(a);break;case`before`:e.before(a);break;case`after`:e.after(a);break;case`prepend`:e.prepend(a);break;case`append`:e.append(a);break}i=a}return i}function y(e){return e.type===`condition`}function b(e){return e.type===`step`}function x(e){return e.type===`experience`}function S(e){return e.type===`origin`}function C(e){return e.type===`action`}var w=(e,t,n,r,i=new Set)=>i.has(n.id)?[]:(i.add(n.id),b(n)&&!r?[n]:t.filter(e=>e.sourceNodeId===n.id).flatMap(n=>{let r=e.find(e=>e.id===n.destinationNodeId);return r?w(e,t,r,!1,i):[]})),T=(e,t,n)=>w(e,t,n,!0,new Set),E=(e,t,n,r,i=new Set)=>{if(i.has(n.id))return[-1,-1];i.add(n.id);let a=t.filter(e=>e.sourceNodeId===n.id);if(a.length===0)return[0,0];let o=1/0,s=-1/0;for(let n of a){let r=e.find(e=>e.id===n.destinationNodeId);if(!r)continue;let[a,c]=E(e,t,r,!1,new Set(i));a!==-1&&(o=Math.min(o,a+1),s=Math.max(s,c+1))}return o===1/0?[-1,-1]:[o,s]},D=(e,t,n)=>E(e,t,n,!0,new Set),O=(e,t,n,r=new Set)=>{if(r.has(n.id))return[-1,-1];if(r.add(n.id),n.type===`origin`)return[0,0];let i=t.filter(e=>e.destinationNodeId===n.id);if(i.length===0)return[-1,-1];let a=1/0,o=-1/0;for(let n of i){let i=e.find(e=>e.id===n.sourceNodeId);if(!i)continue;let[s,c]=O(e,t,i,new Set(r));s!==-1&&(a=Math.min(a,s+1),o=Math.max(o,c+1))}return a===1/0?[-1,-1]:[a,o]},k=(e,t,n)=>O(e,t,n,new Set),A=e=>e.find(e=>e.type===`origin`)||null,j=(e,t,n)=>{if(!e)return A(t);let r=n.find(t=>t.sourceNodeId===e.id);return r&&t.find(e=>e.id===r.destinationNodeId)||null};async function M(e,t,n,r){let i=e?`true`:`false`,a=r.find(e=>e.sourceHandle===i&&e.sourceNodeId===t);return n.find(e=>e.id===a?.destinationNodeId)}var N=(0,n.createDomain)(`experience-instance`),P=(0,r.createFactory)(({client:t,experience:r,target:i,options:a})=>{let s=(0,n.createEvent)(),c=(0,n.createEvent)(),l=(0,n.createEvent)(),u=(0,n.createEvent)(),d=(0,n.createEvent)(),f=(0,n.createEvent)(),p=r.componentStore,m=N.store(`transitioning`),h=t.history.entriesStore.map(e=>e.filter(e=>e.experienceId===r.id)),g=h.map(e=>e.filter(e=>b(e.node))),_=h.map(e=>e.at(-1)?.node||null),v=(0,n.combine)(t.steps.listStore,_,(e,t)=>e.find(e=>t&&b(t)&&e.id===t.stepId)||null),w=(0,n.combine)(t.steps.listStore,g,(e,t)=>{let n=t.at(-2);if(!n||!b(n.node))return null;let r=n.node;return e.find(e=>e.id===r.stepId)||null}),E=(0,n.combine)(r.treeStore,_,({nodes:e,edges:t},n)=>n?T(e,t,n):[]),O=(0,n.combine)(r.treeStore,_,({nodes:e,edges:t},n)=>n?k(e,t,n):[-1,-1]),P=(0,n.combine)(r.treeStore,_,({nodes:e,edges:t},n)=>n?D(e,t,n):[-1,-1]),F=N.store(!1),I=(0,n.createApi)(F,{open:()=>!0,close:()=>!1,toggle:e=>!e,set:(e,t)=>t}),L=(0,n.createEffect)(async()=>{t.history.back({experienceId:r.id})}),R=(0,n.attach)({source:r.treeStore,effect:async(e,n)=>{let i=e.nodes.find(e=>b(e)&&e.stepId===n);i&&t.history.push({experienceId:r.id,node:i})}}),z=(0,n.attach)({source:_,effect:e=>{}}),B=(0,n.attach)({source:r.treeStore,effect:async({nodes:e})=>A(e)}),V=(0,n.attach)({source:r.treeStore,effect:async({nodes:e,edges:t},n)=>{if(S(n))return j(n,e,t)}}),H=(0,n.attach)({source:r.treeStore,effect:async({nodes:n,edges:r,conditions:i},a)=>{if(!y(a))return;let o=i.find(e=>e.id===a.conditionId)?.logic;return o?M(!!await e.t(t,o),a.id,n,r):void 0}}),U=(0,n.attach)({source:{tree:r.treeStore,actions:t.actions.listStore,snapshot:t.stateSnapshotStore},effect:async({tree:e,actions:t,snapshot:n},r)=>{let{nodes:i,edges:a}=e;if(!C(r))return;let o=r.actionKey;if(!o){`${r.id}`;return}let s=t.find(e=>e.key===o)?.action;if(!s){`${o}`;let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);return e?i.find(t=>t.id===e.destinationNodeId):null}if(typeof s!=`function`){`${o}`;let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);return e?i.find(t=>t.id===e.destinationNodeId):null}try{`${o}`,await s({...n,args:[]},{experience:X});let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`true`);if(!e)return`${r.id}`,null;let t=i.find(t=>t.id===e.destinationNodeId);return`${o}${t?.id}`,t||null}catch{`${o}`;let e=a.find(e=>e.sourceNodeId===r.id&&e.sourceHandle===`false`);if(!e)return`${r.id}`,null;let t=i.find(t=>t.id===e.destinationNodeId);return`${o}${t?.id}`,t||null}}}),W=(0,n.createEffect)(e=>{x(e)&&t.experiences.launch({key:e.experienceKey})}),G=(0,n.attach)({source:[_,r.treeStore],effect:async([e,{nodes:t,edges:n}])=>j(e,t,n)}),K=(0,n.attach)({source:[_,r.treeStore],effect:async([e,{nodes:t,edges:n}])=>j(e,t,n)}),q=(0,n.createEffect)(e=>{t.history.push({experienceId:r.id,node:e})}),J=(0,n.attach)({source:r.configStore,effect:async({initializeOpenLogic:n})=>a?.initialiseOpen===void 0?e.n(n)?!!await e.t(t,n):n??!1:a.initialiseOpen}),Y=(0,n.combine)(p,t.frameworks.listStore,(e,t)=>{if(!e)return null;let n=t.find(t=>t.name===e.component.frameworkName);return n?{component:e,framework:n}:null},{skipVoid:!1}),X,Z=(0,n.attach)({source:Y,effect:e=>{if(!e)return;if(!i){`${r.id}`;return}let n=o(i);try{e.framework.render(n,e.component.component,t,X)}catch{}}});X=Object.freeze({id:Math.random().toString(36).substring(7),experienceKey:r.key,experienceId:r.id,experienceName:r.name,configStore:r.configStore,target:i,componentStore:p,componentAndFrameworkStore:Y,stateStore:m,isOpenStore:F,open:I.open,close:I.close,toggleOpen:I.toggle,setOpen:I.set,treeStore:r.treeStore,currentNodeStore:_,currentStepStore:v,previousStepStore:w,nextReachableStepNodesStore:E,stepsToOriginStore:O,stepsToLeafStore:P,goToNextStep:c,goToPreviousStep:l,goToStepById:u,stepsHistoryStore:g,mountFx:Z});let Q=(0,n.createEvent)(),$=(0,n.createEvent)();return(0,n.sample)({clock:_,target:Q}),(0,n.sample)({clock:Q,filter:e=>e===null,target:B}),(0,n.sample)({clock:Q,filter:e=>e!==null,target:$}),(0,n.split)({source:$,match:e=>y(e)?`condition`:b(e)?`step`:x(e)?`launchExperience`:S(e)?`origin`:C(e)?`action`:`other`,cases:{origin:V,condition:H,step:z,launchExperience:W,action:U,__:(0,n.createEvent)()}}),(0,n.sample)({clock:[H.doneData,V.doneData,B.doneData,K.doneData,G.doneData,U.doneData],filter:Boolean,target:q}),(0,n.sample)({clock:c,target:K}),(0,n.sample)({clock:c,source:v,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit`,step:e,experience:X}))}),(0,n.sample)({clock:K.done,source:v,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit_success`,step:e,experience:X}))}),(0,n.sample)({clock:K.fail,source:v,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_submit_error`,step:e,experience:X}))}),(0,n.sample)({clock:l,target:L}),(0,n.sample)({clock:u,target:R}),(0,n.sample)({source:(0,n.combine)([H.pending,V.pending,B.pending,K.pending]),fn:e=>e.some(Boolean)?`transitioning`:`ready`,target:m}),(0,n.sample)({clock:z.doneData,source:v,filter:Boolean,target:t.eventBus.prepend(e=>({type:`step_enter`,step:e,experience:X}))}),(0,n.sample)({clock:f,target:J}),(0,n.sample)({source:J.doneData,fn:Boolean,target:F}),(0,n.sample)({source:_,clock:s,filter:e=>e?S(e):!0,target:G}),(0,n.sample)({source:F,filter:Boolean,target:s}),(0,n.sample)({source:F,filter:Boolean,target:t.eventBus.prepend(()=>({type:`experience_open`,experience:X}))}),(0,n.sample)({source:F,filter:e=>!e,target:t.eventBus.prepend(()=>({type:`experience_close`,experience:X}))}),(0,n.sample)({clock:d,target:[f]}),d(),X});function F(e){return(0,r.invoke)(P,e)}var I=(0,r.createFactory)(({client:e})=>{let t=N.store({}),r=(0,n.createEvent)(),i=(0,n.createEvent)(),a=(0,n.createEvent)(),o=(0,n.createApi)(t,{register(e,t){let n=[...e[t.experienceId]??[]];return n.push(t),{...e,[t.experienceId]:n}},unregister(e,t){let n=t.experienceId,r=e[n]?.filter(e=>e!==t);return{...e,[n]:r??[]}}}),s=(0,n.createEffect)(({experience:t,target:n,options:r})=>F({client:e,experience:t,target:n,options:r})),l=(0,n.createEffect)(e=>{o.register(e)}),u=(0,n.createEffect)(e=>{e.target&&c(e.target,()=>{a(e)})}),d=(0,n.createEffect)(e=>{o.unregister(e)}),f=(0,n.createEffect)(async e=>{await e.mountFx()});(0,n.sample)({clock:r,target:s}),(0,n.sample)({clock:a,target:d}),(0,n.sample)({clock:s.doneData,target:[l,u,i]}),(0,n.sample)({clock:s.doneData,target:e.eventBus.prepend(e=>({type:`experience_initialize`,experience:e}))}),(0,n.sample)({clock:i,target:f});function p(e,t,n){r({experience:e,target:t,options:n})}let m=t.map(e=>Object.values(e).flat());function h(e){return m.map(t=>t.filter(t=>t.experienceKey===e),{skipVoid:!1})}function g(e){return t.map(t=>t[e]||[],{skipVoid:!1})}return{spawn:p,getByExperienceKey:h,getByExperienceId:g,listStore:m}});function L(e){return(0,r.invoke)(I,e)}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return F}});
@@ -45,34 +45,14 @@ export interface ExperienceStore {
45
45
  * should be initialised.
46
46
  */
47
47
  shouldInitialiseFx: Effect<void, boolean, Error>;
48
- /**
49
- * Public event — requests initialisation, gated by `shouldInitialiseFx`. When the
50
- * gate passes, the sample graph fires `prepareExperienceContentFx` and `initialiseFx`
51
- * in parallel so content loading does not delay initialisation.
52
- */
53
- initialiseRequested: EventCallable<LaunchExperienceOptions | undefined>;
54
- /**
55
- * Public event — requests initialisation directly, bypassing the `shouldInitialiseFx`
56
- * gate. Fires `prepareExperienceContentFx` and `initialiseFx` in parallel.
57
- */
58
- initialiseDirectly: EventCallable<LaunchExperienceOptions | undefined>;
59
- /**
60
- * Prepares per-experience CMS content by calling `client.contentLoader` and
61
- * registering returned blobs into `client.contents`. Driven by the sample graph
62
- * on `initialiseRequested`/`initialiseDirectly`; can also be called directly for
63
- * speculative prefetch (e.g. Visibility-driven warm-up). Failure-tolerant:
64
- * always resolves `true` even when the loader rejects, so initialisation is
65
- * never blocked by content failures.
66
- */
67
- prepareExperienceContentFx: Effect<void, boolean, Error>;
68
48
  }
69
49
  /**
70
50
  * Creates an Effector store for a single experience.
71
51
  *
72
52
  * @template T - Factory parameter type.
73
53
  * @param {T} params - The client instance and experience data.
74
- * @param {Picked} params.client - The Picked client instance the experience is bound to.
75
- * @param {Experience} params.experience - The experience definition to wrap in stores and effects.
54
+ * @param params.client
55
+ * @param params.experience
76
56
  * @returns {ReturnType<typeof createExperienceFactory>} An experience store with config, tree, fields, and component sub-stores.
77
57
  * @example
78
58
  * ```typescript
@@ -1 +1 @@
1
- {"version":3,"file":"experience.d.ts","sourceRoot":"","sources":["../../../../src/entities/experience/experience.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,OAAO,EAOL,KAAK,MAAM,EACX,KAAK,aAAa,EAElB,KAAK,KAAK,EACX,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAG1C,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAI/D,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAE3E,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,KAAK,CAAC;QACjB,IAAI,EAAE,MAAM,CAAA;QACZ,aAAa,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;QACtC,eAAe,EAAE,gBAAgB,EAAE,CAAA;QACnC,mBAAmB,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;KAC7C,CAAC,CAAA;IACF,SAAS,EAAE,KAAK,CAAC;QACf,KAAK,EAAE,cAAc,EAAE,CAAA;QACvB,KAAK,EAAE,cAAc,EAAE,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;IACpD,IAAI,EAAE,YAAY,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,UAAW,SAAQ,QAAQ;IAC1C,IAAI,EAAE,QAAQ,CAAA;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;IACpB,iBAAiB,EAAE,MAAM,CAAA;IACzB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;CACjE;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,cAAc,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IACvC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC5B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IAClC,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,OAAO,EAAE,gBAAgB,EAAE,CAAA;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,IAAI,CAExE,CAAA"}
@@ -1,5 +1,4 @@
1
1
  import { Store } from 'effector';
2
- import { Content } from '../content/content';
3
2
  export type StepsStore = ReturnType<typeof createStepIndex>;
4
3
  export interface ExperienceStep {
5
4
  id: string;
@@ -7,19 +6,6 @@ export interface ExperienceStep {
7
6
  name: string;
8
7
  fieldKeys: string[];
9
8
  layoutName?: string | null;
10
- /**
11
- * Optional reference to a CMS Content record that supplies the step's layout data.
12
- * The actual content is registered separately via `client.registerContent` and
13
- * resolved at render time through `layoutContentStore` against the global content registry.
14
- */
15
- layoutContentId?: string | null;
16
- /**
17
- * Reactive store of the content record this step references. Composed at registration
18
- * time against `client.contents.getById(layoutContentId)`. `null` when the step has no
19
- * `layoutContentId`. Reads stay reactive — content registered after the step
20
- * (or updated mid-session) flows through automatically.
21
- */
22
- layoutContentStore?: Store<Content | null> | null;
23
9
  }
24
10
  declare const createStepIndexFactory: () => {
25
11
  register: (step: ExperienceStep) => void;
@@ -33,7 +19,6 @@ declare const createStepIndexFactory: () => {
33
19
  /**
34
20
  * Creates an Effector-based index for registering and retrieving steps.
35
21
  *
36
- * @returns {ReturnType<typeof createStepIndexFactory>} A step index with register, getById, getByKey, listStore, and indexStore.
37
22
  * @example
38
23
  * ```typescript
39
24
  * const steps = createStepIndex()
@@ -43,8 +28,8 @@ export declare function createStepIndex(): ReturnType<typeof createStepIndexFact
43
28
  /**
44
29
  * Registers a step with the given index via the helper function.
45
30
  *
46
- * @param {ExperienceStep} step - The step definition to register.
47
- * @param {ReturnType<typeof createStepIndex>} index - The step index to register the step with.
31
+ * @param step - The step definition to register.
32
+ * @param index - The step index to register the step with.
48
33
  * @example
49
34
  * ```typescript
50
35
  * setupStep(step, index)
@@ -1 +1 @@
1
- {"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/entities/step/step.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,EAA2B,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAE9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAEjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAI3D,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EA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c,GAAG,IAAI,CAAC;oBAcjD,cAAc,CAAC,KAAK,CAAC,KAAG,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC;;;;;CAa3E,CAAA;AAEF;;;;;;;GAOG;AACH,wBAAgB,eAAe,IAAI,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAE3E;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,GAAG,IAAI,CAE/F"}
@@ -1,9 +1,7 @@
1
- /** @file Top-level public entry point — re-exports the client class, public utilities, and entity types. */
2
1
  export * from './exports';
3
2
  export type * from './client';
4
3
  export type * from './entities/action/action';
5
4
  export type * from './entities/condition/condition';
6
- export type * from './entities/content/content';
7
5
  export type * from './entities/component/component';
8
6
  export type * from './entities/component/lazyComponent';
9
7
  export type * from './entities/experience-instance/experience-instance';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAC5G,cAAc,WAAW,CAAA;AACzB,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,oCAAoC,CAAA;AACvD,mBAAmB,oDAAoD,CAAA;AACvE,mBAAmB,kCAAkC,CAAA;AACrD,mBAAmB,sBAAsB,CAAA;AACzC,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,wBAAwB,CAAA;AAC3C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,uBAAuB,CAAA;AAC1C,mBAAmB,8BAA8B,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,mBAAmB,UAAU,CAAA;AAC7B,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,oCAAoC,CAAA;AACvD,mBAAmB,oDAAoD,CAAA;AACvE,mBAAmB,kCAAkC,CAAA;AACrD,mBAAmB,sBAAsB,CAAA;AACzC,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,wBAAwB,CAAA;AAC3C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,0BAA0B,CAAA;AAC7C,mBAAmB,gCAAgC,CAAA;AACnD,mBAAmB,4BAA4B,CAAA;AAC/C,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,uBAAuB,CAAA;AAC1C,mBAAmB,8BAA8B,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"state-snapshot.d.ts","sourceRoot":"","sources":["../../../src/lifecycle/state-snapshot.ts"],"names":[],"mappings":"AAAA,gIAAgI;AAChI,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEhE,sIAAsI;AACtI,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAC7B,cAAc,CAAC,EAAE,M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