@picked/client 0.0.1-dev.1772073931707 → 0.0.1-dev.1772085077346

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 (54) hide show
  1. package/dist/api-CbXfbi_s.js +19 -0
  2. package/dist/api-DzSCgBQ2.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 -0
  6. package/dist/cjs/server/index.js +1 -1
  7. package/dist/esm/index.js +552 -630
  8. package/dist/esm/plugins/create-experience/index.js +228 -194
  9. package/dist/esm/plugins/dynamic-experiences/index.js +115 -0
  10. package/dist/esm/server/index.js +1 -1
  11. package/dist/experience-instance-CU_pYPyd.js +820 -0
  12. package/dist/experience-instance-D_Mwuzb4.cjs +1 -0
  13. package/dist/types/client.d.ts +10 -12
  14. package/dist/types/client.d.ts.map +1 -1
  15. package/dist/types/entities/action/action.d.ts +2 -5
  16. package/dist/types/entities/action/action.d.ts.map +1 -1
  17. package/dist/types/entities/component/component.d.ts +2 -1
  18. package/dist/types/entities/component/component.d.ts.map +1 -1
  19. package/dist/types/entities/component/lazyComponent.d.ts +11 -0
  20. package/dist/types/entities/component/lazyComponent.d.ts.map +1 -0
  21. package/dist/types/entities/experience/experience.d.ts +6 -6
  22. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  23. package/dist/types/entities/experience-instance/experience-instance.d.ts +4 -3
  24. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  25. package/dist/types/entities/field/field.d.ts +14 -51
  26. package/dist/types/entities/field/field.d.ts.map +1 -1
  27. package/dist/types/entities/plugin/plugin.d.ts +4 -1
  28. package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
  29. package/dist/types/entities/response/response.d.ts.map +1 -1
  30. package/dist/types/exports.d.ts +2 -0
  31. package/dist/types/exports.d.ts.map +1 -1
  32. package/dist/types/index.d.ts +1 -1
  33. package/dist/types/index.d.ts.map +1 -1
  34. package/dist/types/picked.d.ts +17 -17
  35. package/dist/types/picked.d.ts.map +1 -1
  36. package/dist/types/ping.d.ts.map +1 -1
  37. package/dist/types/plugins/create-experience/create-experience.d.ts +23 -26
  38. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  39. package/dist/types/plugins/dynamic-experiences/hash.d.ts +18 -0
  40. package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +1 -0
  41. package/dist/types/plugins/dynamic-experiences/index.d.ts +3 -0
  42. package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -0
  43. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +23 -0
  44. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -0
  45. package/dist/types/plugins/dynamic-experiences/types.d.ts +15 -0
  46. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -0
  47. package/dist/types/utils/api.d.ts +3 -0
  48. package/dist/types/utils/api.d.ts.map +1 -0
  49. package/dist/types/utils/get-step-fields.d.ts +1 -2
  50. package/dist/types/utils/get-step-fields.d.ts.map +1 -1
  51. package/dist/types/utils/rules-logic.d.ts.map +1 -1
  52. package/package.json +7 -1
  53. package/dist/experience-instance-5rr_D--s.cjs +0 -1
  54. package/dist/experience-instance-CLR80xop.js +0 -819
@@ -1,108 +1,108 @@
1
1
  import { g as f } from "../../../id-BW-g3y32.js";
2
- const l = {
3
- serialize(i) {
4
- return JSON.stringify(i);
2
+ const r = {
3
+ serialize(e) {
4
+ return JSON.stringify(e);
5
5
  },
6
- deserialize(i) {
7
- return JSON.parse(i);
6
+ deserialize(e) {
7
+ return JSON.parse(e);
8
8
  }
9
- }, V = (i) => ({
9
+ }, x = (e) => ({
10
10
  name: "create-experience",
11
- setup: (n) => {
12
- i.experiences.forEach((s) => {
13
- const t = s.serialize(), d = l.deserialize(t);
14
- d.component = s.component, n.registerExperience(d), d.fields.forEach((N) => {
15
- n.registerField(N);
11
+ setup: (o) => {
12
+ e.experiences.forEach((s) => {
13
+ const n = s.serialize(), d = r.deserialize(n);
14
+ d.component = s.component, o.registerExperience(d), d.fields.forEach((N) => {
15
+ o.registerField(N);
16
16
  });
17
17
  });
18
18
  }
19
- }), z = (i, n) => ({
19
+ }), y = (e, o) => ({
20
20
  id: f("node"),
21
21
  position: [0, 0],
22
- experience: n,
22
+ experience: o,
23
23
  type: "action",
24
- action: i.action,
25
- addNext(t) {
26
- if (!t.node) throw new Error("Cannot connect to node");
24
+ action: e.action,
25
+ addNext(n) {
26
+ if (!n.node) throw new Error("Cannot connect to node");
27
27
  const d = h(
28
- { sourceNode: this, destinationNode: t.node, sourceNodeHandle: null },
29
- n
28
+ { sourceNode: this, destinationNode: n.node, sourceNodeHandle: null },
29
+ o
30
30
  );
31
- n.edges.push(d);
31
+ o.edges.push(d);
32
32
  },
33
- onSuccess(t) {
34
- if (!t.node) throw new Error("Cannot connect to node");
33
+ onSuccess(n) {
34
+ if (!n.node) throw new Error("Cannot connect to node");
35
35
  const d = h(
36
- { sourceNode: this, destinationNode: t.node, sourceNodeHandle: "true" },
37
- n
36
+ { sourceNode: this, destinationNode: n.node, sourceNodeHandle: "true" },
37
+ o
38
38
  );
39
- n.edges.push(d);
39
+ o.edges.push(d);
40
40
  },
41
- onFail(t) {
42
- if (!t.node) throw new Error("Cannot connect to node");
41
+ onFail(n) {
42
+ if (!n.node) throw new Error("Cannot connect to node");
43
43
  const d = h(
44
- { sourceNode: this, destinationNode: t.node, sourceNodeHandle: "false" },
45
- n
44
+ { sourceNode: this, destinationNode: n.node, sourceNodeHandle: "false" },
45
+ o
46
46
  );
47
- n.edges.push(d);
47
+ o.edges.push(d);
48
48
  },
49
49
  serialize() {
50
- return l.serialize({
50
+ return r.serialize({
51
51
  id: this.id,
52
52
  type: this.type,
53
53
  action: this.action,
54
54
  position: this.position
55
55
  });
56
56
  }
57
- }), E = (i) => ({
58
- id: i.id ?? f("step"),
59
- label: i.label,
60
- fields: i.fields ?? [],
61
- addField(n) {
62
- const s = "serialize" in n ? n : y(n);
57
+ }), V = (e) => ({
58
+ id: e.id ?? f("step"),
59
+ label: e.label,
60
+ fields: e.fields ?? [],
61
+ addField(o) {
62
+ const s = "serialize" in o ? o : m(o);
63
63
  return this.fields?.includes(s) || this.fields?.push(s), s;
64
64
  }
65
- }), g = (i, n) => {
65
+ }), z = (e, o) => {
66
66
  const s = {
67
- id: i.id ?? f("step"),
68
- label: i.label,
69
- experience: n,
70
- fields: i.fields ?? [],
67
+ id: e.id ?? f("step"),
68
+ label: e.label,
69
+ experience: o,
70
+ fields: e.fields ?? [],
71
71
  node: null,
72
- nextStep(t) {
73
- return this.experience.addStep(t, this);
72
+ nextStep(n) {
73
+ return this.experience.addStep(n, this);
74
74
  },
75
- nextConditional(t) {
76
- return this.experience.addConditional(t, this);
75
+ nextConditional(n) {
76
+ return this.experience.addConditional(n, this);
77
77
  },
78
- addNextExperience(t) {
79
- return this.experience.addExperience(t, this);
78
+ addNextExperience(n) {
79
+ return this.experience.addExperience(n, this);
80
80
  },
81
- addField(t) {
82
- return this.experience.addField(t, this);
81
+ addField(n) {
82
+ return this.experience.addField(n, this);
83
83
  },
84
84
  serialize() {
85
- return l.serialize({
85
+ return r.serialize({
86
86
  id: this.id,
87
87
  label: this.label,
88
- fieldIds: this.fields.map((t) => t.id)
88
+ fieldIds: this.fields.map((n) => n.id)
89
89
  });
90
90
  }
91
91
  };
92
- return p({ step: s, type: "step" }, n), s;
93
- }, m = () => [0, 0], p = (i, n) => {
92
+ return p({ step: s, type: "step" }, o), s;
93
+ }, g = () => [0, 0], p = (e, o) => {
94
94
  const s = {
95
95
  id: f("node"),
96
- position: m(),
97
- experience: n
96
+ position: g(),
97
+ experience: o
98
98
  };
99
- if (i.type === "step") {
99
+ if (e.type === "step") {
100
100
  const d = {
101
101
  ...s,
102
102
  type: "step",
103
- connectedStep: i.step,
103
+ connectedStep: e.step,
104
104
  serialize() {
105
- return l.serialize({
105
+ return r.serialize({
106
106
  id: this.id,
107
107
  type: this.type,
108
108
  stepId: this.connectedStep.id,
@@ -113,13 +113,13 @@ const l = {
113
113
  };
114
114
  return d.connectedStep.node = d, d;
115
115
  }
116
- if (i.type === "conditional") {
116
+ if (e.type === "conditional") {
117
117
  const d = {
118
118
  ...s,
119
119
  type: "conditional",
120
- connectedConditional: i.conditional,
120
+ connectedConditional: e.conditional,
121
121
  serialize() {
122
- return l.serialize({
122
+ return r.serialize({
123
123
  id: this.id,
124
124
  type: this.type,
125
125
  conditionalId: this.connectedConditional.id,
@@ -129,12 +129,12 @@ const l = {
129
129
  };
130
130
  return d.connectedConditional.node = d, d;
131
131
  }
132
- return i.type === "experience" ? {
132
+ return e.type === "experience" ? {
133
133
  ...s,
134
134
  type: "experience",
135
- connectedExperience: i.experience,
135
+ connectedExperience: e.experience,
136
136
  serialize() {
137
- return l.serialize({
137
+ return r.serialize({
138
138
  id: this.id,
139
139
  type: this.type,
140
140
  experienceId: this.connectedExperience.id,
@@ -145,78 +145,77 @@ const l = {
145
145
  ...s,
146
146
  type: "origin",
147
147
  serialize() {
148
- return l.serialize({
148
+ return r.serialize({
149
149
  id: this.id,
150
150
  type: this.type,
151
151
  position: this.position
152
152
  });
153
153
  }
154
154
  };
155
- }, h = (i, n) => ({
155
+ }, h = (e, o) => ({
156
156
  id: f("edge"),
157
- sourceNode: i.sourceNode,
158
- sourceNodeHandle: i.sourceNodeHandle,
159
- destinationNode: i.destinationNode,
160
- experience: n,
157
+ sourceNode: e.sourceNode,
158
+ sourceNodeHandle: e.sourceNodeHandle,
159
+ destinationNode: e.destinationNode,
160
+ experience: o,
161
161
  serialize() {
162
- return l.serialize({
162
+ return r.serialize({
163
163
  id: this.id,
164
164
  sourceNodeHandle: this.sourceNodeHandle ?? void 0,
165
165
  sourceNodeId: this.sourceNode.id,
166
166
  destinationNodeId: this.destinationNode.id
167
167
  });
168
168
  }
169
- }), b = (i, n) => {
169
+ }), b = (e, o) => {
170
170
  const s = {
171
171
  id: f("conditional"),
172
- condition: i.condition,
172
+ condition: e.condition,
173
173
  node: null,
174
- experience: n,
175
- addTrue(t) {
176
- if (!this.node || !t.node)
174
+ experience: o,
175
+ addTrue(n) {
176
+ if (!this.node || !n.node)
177
177
  throw new Error("todo no node");
178
178
  const d = h(
179
- { sourceNode: this.node, destinationNode: t.node, sourceNodeHandle: "true" },
179
+ { sourceNode: this.node, destinationNode: n.node, sourceNodeHandle: "true" },
180
180
  this.experience
181
181
  );
182
182
  this.experience.edges.push(d);
183
183
  },
184
- addFalse(t) {
185
- if (!this.node || !t.node)
184
+ addFalse(n) {
185
+ if (!this.node || !n.node)
186
186
  throw new Error("todo no node");
187
187
  const d = h(
188
- { sourceNode: this.node, destinationNode: t.node, sourceNodeHandle: "false" },
188
+ { sourceNode: this.node, destinationNode: n.node, sourceNodeHandle: "false" },
189
189
  this.experience
190
190
  );
191
191
  this.experience.edges.push(d);
192
192
  },
193
193
  serialize() {
194
- return l.serialize({
194
+ return r.serialize({
195
195
  id: this.id,
196
196
  condition: this.condition
197
197
  });
198
198
  }
199
199
  };
200
- return p({ conditional: s, type: "conditional" }, n), s;
201
- }, y = (i) => ({
202
- id: i.id,
203
- name: i.name,
204
- type: i.type,
205
- label: i.label,
206
- placeholder: i.placeholder,
207
- description: i.description,
208
- helpText: i.helpText,
209
- defaultValue: i.defaultValue ?? null,
210
- multiple: i.multiple,
211
- validation: i.validation ?? {},
212
- condition: i.condition,
213
- required: i.required,
214
- options: Array.isArray(i.options) ? i.options.map(({ id: s, ...t }) => ({
215
- id: s ?? f("option"),
216
- ...t
217
- })) : i.options ?? null,
218
- dependsOn: i.dependsOn,
219
- policies: i.policies,
200
+ return p({ conditional: s, type: "conditional" }, o), s;
201
+ }, m = (e) => ({
202
+ id: e.id,
203
+ name: e.name,
204
+ type: e.type,
205
+ label: e.label,
206
+ placeholder: e.placeholder,
207
+ description: e.description,
208
+ helpText: e.helpText,
209
+ defaultValue: e.defaultValue ?? null,
210
+ multiple: e.multiple,
211
+ validation: e.validation ?? {},
212
+ condition: e.condition,
213
+ required: e.required,
214
+ options: e.options?.map((s) => ({
215
+ id: "id" in s ? s.id : f("option"),
216
+ ...s
217
+ })) ?? null,
218
+ policies: e.policies,
220
219
  serialize() {
221
220
  const s = {
222
221
  id: this.id,
@@ -228,130 +227,165 @@ const l = {
228
227
  helpText: this.helpText,
229
228
  validation: this.validation,
230
229
  condition: this.condition,
231
- dependsOn: this.dependsOn,
232
230
  policies: this.policies
233
- }, t = typeof this.defaultValue == "string" ? this.defaultValue : void 0, d = typeof this.defaultValue == "number" ? this.defaultValue : void 0, N = typeof this.defaultValue == "boolean" ? this.defaultValue : void 0, u = (e) => this.options ? Array.isArray(this.options) ? this.options.map((o) => ({
234
- id: o.id,
235
- label: o.label,
236
- description: o.description,
237
- value: e(o.value),
238
- condition: o.condition
239
- })) : this.options : null;
231
+ }, n = typeof this.defaultValue == "string" ? this.defaultValue : void 0, d = typeof this.defaultValue == "number" ? this.defaultValue : void 0, N = typeof this.defaultValue == "boolean" ? this.defaultValue : void 0;
240
232
  switch (this.type) {
241
233
  case "text":
242
234
  if (this.multiple) {
243
- let e;
235
+ let t;
244
236
  if (Array.isArray(this.defaultValue)) {
245
- e = [];
246
- for (const o of this.defaultValue)
247
- typeof o == "string" && e.push(o);
248
- e.length === 0 && (e = void 0);
237
+ t = [];
238
+ for (const i of this.defaultValue)
239
+ typeof i == "string" && t.push(i);
240
+ t.length === 0 && (t = void 0);
249
241
  }
250
- return l.serialize({
242
+ return r.serialize({
251
243
  ...s,
252
244
  type: "text",
253
245
  multiple: !0,
254
- defaultValue: e,
255
- options: u((o) => `${o}`)
246
+ defaultValue: t,
247
+ options: this.options ? this.options.map((i) => ({
248
+ id: i.id,
249
+ label: i.label,
250
+ value: `${i.value}`,
251
+ condition: i.condition
252
+ })) : null
256
253
  });
257
254
  }
258
- return l.serialize({
255
+ return r.serialize({
259
256
  ...s,
260
257
  type: "text",
261
258
  multiple: !1,
262
- defaultValue: t,
263
- options: u((e) => `${e}`)
259
+ defaultValue: n,
260
+ options: this.options ? this.options.map((t) => ({
261
+ id: t.id,
262
+ label: t.label,
263
+ value: `${t.value}`,
264
+ condition: t.condition
265
+ })) : null
264
266
  });
265
267
  case "number":
266
268
  if (this.multiple) {
267
- let e;
269
+ let t;
268
270
  if (Array.isArray(this.defaultValue)) {
269
- e = [];
270
- for (const o of this.defaultValue)
271
- typeof o == "number" && e.push(o);
272
- e.length === 0 && (e = void 0);
271
+ t = [];
272
+ for (const i of this.defaultValue)
273
+ typeof i == "number" && t.push(i);
274
+ t.length === 0 && (t = void 0);
273
275
  }
274
- return l.serialize({
276
+ return r.serialize({
275
277
  ...s,
276
278
  type: "number",
277
279
  multiple: !0,
278
- defaultValue: e,
279
- options: u((o) => Number(o))
280
+ defaultValue: t,
281
+ options: this.options ? this.options.map((i) => ({
282
+ id: i.id,
283
+ label: i.label,
284
+ value: Number(i.value),
285
+ condition: i.condition
286
+ })) : null
280
287
  });
281
288
  }
282
- return l.serialize({
289
+ return r.serialize({
283
290
  ...s,
284
291
  type: "number",
285
292
  multiple: !1,
286
293
  defaultValue: d,
287
- options: u((e) => Number(e))
294
+ options: this.options ? this.options.map((t) => ({
295
+ id: t.id,
296
+ label: t.label,
297
+ value: Number(t.value),
298
+ condition: t.condition
299
+ })) : null
288
300
  });
289
301
  case "boolean":
290
302
  if (this.multiple) {
291
- let e;
303
+ let t;
292
304
  if (Array.isArray(this.defaultValue)) {
293
- e = [];
294
- for (const o of this.defaultValue)
295
- typeof o == "boolean" && e.push(o);
296
- e.length === 0 && (e = void 0);
305
+ t = [];
306
+ for (const i of this.defaultValue)
307
+ typeof i == "boolean" && t.push(i);
308
+ t.length === 0 && (t = void 0);
297
309
  }
298
- return l.serialize({
310
+ return r.serialize({
299
311
  ...s,
300
312
  type: "boolean",
301
313
  multiple: !0,
302
- defaultValue: e,
303
- options: u((o) => !!o)
314
+ defaultValue: t,
315
+ options: this.options ? this.options.map((i) => ({
316
+ id: i.id,
317
+ label: i.label,
318
+ value: !!i.value,
319
+ condition: i.condition
320
+ })) : null
304
321
  });
305
322
  }
306
- return l.serialize({
323
+ return r.serialize({
307
324
  ...s,
308
325
  type: "boolean",
309
326
  multiple: !1,
310
327
  defaultValue: N,
311
- options: u((e) => !!e)
328
+ options: this.options ? this.options.map((t) => ({
329
+ id: t.id,
330
+ label: t.label,
331
+ value: !!t.value,
332
+ condition: t.condition
333
+ })) : null
312
334
  });
313
335
  case "object":
314
- return this.multiple ? l.serialize({
336
+ return this.multiple ? r.serialize({
315
337
  ...s,
316
338
  type: "object",
317
339
  multiple: !0,
318
340
  defaultValue: this.defaultValue,
319
- options: u((e) => e)
320
- }) : l.serialize({
341
+ options: this.options ? this.options.map((t) => ({
342
+ id: t.id,
343
+ label: t.label,
344
+ description: t.description,
345
+ value: t.value,
346
+ condition: t.condition
347
+ })) : null
348
+ }) : r.serialize({
321
349
  ...s,
322
350
  type: "object",
323
351
  multiple: !1,
324
352
  defaultValue: this.defaultValue,
325
- options: u((e) => e)
353
+ options: this.options ? this.options.map((t) => ({
354
+ id: t.id,
355
+ label: t.label,
356
+ description: t.description,
357
+ value: t.value,
358
+ condition: t.condition
359
+ })) : null
326
360
  });
327
361
  default:
328
362
  throw new Error("Unsupported field type");
329
363
  }
330
364
  }
331
- }), w = (i) => {
332
- const n = [], s = [], t = [], d = [], N = [], u = i.condition ?? i.decide;
365
+ }), E = (e) => {
366
+ const o = [], s = [], n = [], d = [], N = [], t = e.condition ?? e.decide;
333
367
  return {
334
- id: i.id,
335
- component: i.component,
336
- name: i.name,
337
- initializeOpen: i.initializeOpen,
338
- condition: u,
339
- decide: i.decide,
340
- targets: i.targets,
341
- steps: n,
368
+ id: e.id,
369
+ component: e.component,
370
+ name: e.name,
371
+ initializeOpen: e.initializeOpen,
372
+ condition: t,
373
+ decide: e.decide,
374
+ targets: e.targets,
375
+ steps: o,
342
376
  nodes: s,
343
- edges: t,
377
+ edges: n,
344
378
  fields: N,
345
379
  conditionals: d,
346
- addStep(e, o) {
347
- let r = o?.node;
348
- this.nodes.length === 0 && (r = p({ type: "origin" }, this), this.nodes.push(r));
349
- const a = "serialize" in e ? e : g(e, this);
350
- if (r) {
380
+ addStep(i, u) {
381
+ let l = u?.node;
382
+ this.nodes.length === 0 && (l = p({ type: "origin" }, this), this.nodes.push(l));
383
+ const a = "serialize" in i ? i : z(i, this);
384
+ if (l) {
351
385
  if (!a.node)
352
386
  throw new Error("todo no node");
353
387
  const c = h(
354
- { sourceNode: r, destinationNode: a.node, sourceNodeHandle: null },
388
+ { sourceNode: l, destinationNode: a.node, sourceNodeHandle: null },
355
389
  this
356
390
  );
357
391
  this.edges.push(c);
@@ -360,56 +394,56 @@ const l = {
360
394
  this.fields.includes(c) || this.fields.push(c);
361
395
  }), this.steps.includes(a) || (this.steps.push(a), a.node && this.nodes.push(a.node)), a;
362
396
  },
363
- addAction(e, o) {
364
- let r = o?.node;
365
- this.nodes.length === 0 && (r = p({ type: "origin" }, this), this.nodes.push(r));
366
- const a = "serialize" in e ? e : z(e, this);
367
- if (r) {
397
+ addAction(i, u) {
398
+ let l = u?.node;
399
+ this.nodes.length === 0 && (l = p({ type: "origin" }, this), this.nodes.push(l));
400
+ const a = "serialize" in i ? i : y(i, this);
401
+ if (l) {
368
402
  const c = h(
369
- { sourceNode: r, destinationNode: a, sourceNodeHandle: null },
403
+ { sourceNode: l, destinationNode: a, sourceNodeHandle: null },
370
404
  this
371
405
  );
372
406
  this.edges.push(c);
373
407
  }
374
408
  return this.nodes.push(a), a;
375
409
  },
376
- addConditional(e, o) {
377
- let r = o?.node;
378
- this.nodes.length === 0 && (r = p({ type: "origin" }, this), this.nodes.push(r));
379
- const a = "serialize" in e ? e : b(e, this);
380
- if (r) {
410
+ addConditional(i, u) {
411
+ let l = u?.node;
412
+ this.nodes.length === 0 && (l = p({ type: "origin" }, this), this.nodes.push(l));
413
+ const a = "serialize" in i ? i : b(i, this);
414
+ if (l) {
381
415
  if (!a.node)
382
416
  throw new Error("todo no node");
383
417
  const c = h(
384
- { sourceNode: r, destinationNode: a.node, sourceNodeHandle: null },
418
+ { sourceNode: l, destinationNode: a.node, sourceNodeHandle: null },
385
419
  this
386
420
  );
387
421
  this.edges.push(c);
388
422
  }
389
423
  return this.conditionals.includes(a) || (this.conditionals.push(a), a.node && this.nodes.push(a.node)), a;
390
424
  },
391
- addExperience(e, o) {
392
- let r = o?.node;
393
- this.nodes.length === 0 && (r = p({ type: "origin" }, this), this.nodes.push(r));
425
+ addExperience(i, u) {
426
+ let l = u?.node;
427
+ this.nodes.length === 0 && (l = p({ type: "origin" }, this), this.nodes.push(l));
394
428
  const a = p(
395
- { type: "experience", experience: e },
429
+ { type: "experience", experience: i },
396
430
  this
397
431
  );
398
- if (this.nodes.push(a), r) {
432
+ if (this.nodes.push(a), l) {
399
433
  const c = h(
400
- { sourceNode: r, destinationNode: a, sourceNodeHandle: null },
434
+ { sourceNode: l, destinationNode: a, sourceNodeHandle: null },
401
435
  this
402
436
  );
403
437
  this.edges.push(c);
404
438
  }
405
- return e;
439
+ return i;
406
440
  },
407
- addField(e, o) {
408
- const r = "serialize" in e ? e : y(e);
409
- return o && o.fields.push(r), this.fields.includes(r) || this.fields.push(r), r;
441
+ addField(i, u) {
442
+ const l = "serialize" in i ? i : m(i);
443
+ return u && u.fields.push(l), this.fields.includes(l) || this.fields.push(l), l;
410
444
  },
411
445
  serialize() {
412
- return l.serialize({
446
+ return r.serialize({
413
447
  id: this.id,
414
448
  component: this.component,
415
449
  name: this.name,
@@ -417,13 +451,13 @@ const l = {
417
451
  condition: this.condition ?? this.decide,
418
452
  decide: this.decide,
419
453
  targets: this.targets,
420
- steps: this.steps.map((e) => l.deserialize(e.serialize())),
421
- nodes: this.nodes.map((e) => l.deserialize(e.serialize())),
422
- edges: this.edges.map((e) => l.deserialize(e.serialize())),
454
+ steps: this.steps.map((i) => r.deserialize(i.serialize())),
455
+ nodes: this.nodes.map((i) => r.deserialize(i.serialize())),
456
+ edges: this.edges.map((i) => r.deserialize(i.serialize())),
423
457
  conditionals: this.conditionals.map(
424
- (e) => l.deserialize(e.serialize())
458
+ (i) => r.deserialize(i.serialize())
425
459
  ),
426
- fields: this.fields.map((e) => l.deserialize(e.serialize()))
460
+ fields: this.fields.map((i) => r.deserialize(i.serialize()))
427
461
  });
428
462
  }
429
463
  };
@@ -431,10 +465,10 @@ const l = {
431
465
  export {
432
466
  b as createConditional,
433
467
  h as createEdge,
434
- w as createExperience,
435
- V as createExperiencePlugin,
436
- y as createField,
468
+ E as createExperience,
469
+ x as createExperiencePlugin,
470
+ m as createField,
437
471
  p as createNode,
438
- E as createStep,
439
- l as serialization
472
+ V as createStep,
473
+ r as serialization
440
474
  };