@picked/client 0.0.82-next.2 → 0.0.83-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.
Files changed (32) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/{api-BfnxPlIg.cjs → api-Btd9AyKE.cjs} +1 -1
  3. package/dist/{api-DH7JRd4t.js → api-cZtXPCQX.js} +1 -1
  4. package/dist/cjs/index.js +2 -2
  5. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  6. package/dist/cjs/server/index.js +1 -1
  7. package/dist/esm/index.js +417 -416
  8. package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
  9. package/dist/esm/server/index.js +13 -13
  10. package/dist/{experience-instance-DGk11d8a.js → experience-instance-BibCf-8y.js} +299 -154
  11. package/dist/experience-instance-CMfjyLaI.cjs +1 -0
  12. package/dist/{plugin-CT7ozQHE.js → plugin-BmkOR6kx.js} +2 -2
  13. package/dist/{plugin-wJMNDzOu.cjs → plugin-MA904fJh.cjs} +1 -1
  14. package/dist/{provider-y0wcU546.cjs → provider-CJlNhZwH.cjs} +1 -1
  15. package/dist/{provider-B3jfZ8o9.js → provider-CMo2-Z-x.js} +1 -1
  16. package/dist/types/entities/experience/experience.d.ts +8 -0
  17. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  18. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  19. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +16 -6
  20. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
  21. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +18 -7
  22. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
  23. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +30 -6
  24. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
  25. package/dist/types/utils/node-tree/node-adjacency.d.ts +50 -0
  26. package/dist/types/utils/node-tree/node-adjacency.d.ts.map +1 -0
  27. package/dist/types/utils/node-tree/node-tree-index.d.ts +57 -0
  28. package/dist/types/utils/node-tree/node-tree-index.d.ts.map +1 -0
  29. package/dist/{version-DDZ67216.cjs → version-C886stqn.cjs} +1 -1
  30. package/dist/{version-vO8CkgVc.js → version-CvSwJwMW.js} +1 -1
  31. package/package.json +3 -3
  32. package/dist/experience-instance-Dej3P1sE.cjs +0 -1
@@ -1,5 +1,5 @@
1
- import { t as e } from "../../../plugin-CT7ozQHE.js";
2
- import { n as t, t as n } from "../../../api-DH7JRd4t.js";
1
+ import { t as e } from "../../../plugin-BmkOR6kx.js";
2
+ import { n as t, t as n } from "../../../api-cZtXPCQX.js";
3
3
  import { n as r } from "../../../registry-CXZv0uLg.js";
4
4
  import { createClientHeaders as i, fetchSchema as a } from "@picked/delivery-api-client";
5
5
  export { i as createClientHeaders, e as dynamicExperiencesPlugin, n as fetchExperienceContent, t as fetchProject, a as fetchSchema, r as registerPickedBundle };
@@ -1,5 +1,5 @@
1
- import { a as e, c as t, i as n, o as r, s as i, t as a, u as o } from "../../experience-instance-DGk11d8a.js";
2
- import { n as s } from "../../plugin-CT7ozQHE.js";
1
+ import { a as e, c as t, d as n, i as r, o as i, s as a, t as o } from "../../experience-instance-BibCf-8y.js";
2
+ import { n as s } from "../../plugin-BmkOR6kx.js";
3
3
  import { attach as c, createEffect as l, createEvent as u, createStore as d, sample as f } from "effector";
4
4
  //#region src/server/serialize.ts
5
5
  var p = 1e4;
@@ -7,22 +7,22 @@ function m(e) {
7
7
  if (e?.location !== void 0) return { location: e.location };
8
8
  }
9
9
  function h(e, t) {
10
- return e.nodes.filter(o).some((e) => t.get(e.stepId) === !0);
10
+ return e.nodes.filter(n).some((e) => t.get(e.stepId) === !0);
11
11
  }
12
12
  async function g(e, n = {}) {
13
- let i = n.previewToken === void 0 ? void 0 : { previewToken: n.previewToken }, a = await e.getProjectConfig(i), o = e.session.store.getState().id;
13
+ let r = n.previewToken === void 0 ? void 0 : { previewToken: n.previewToken }, a = await e.getProjectConfig(r), o = e.session.store.getState().id;
14
14
  e.conditionResults.reset(), s(e, a, {
15
15
  isPreview: !1,
16
16
  sessionId: o
17
17
  });
18
18
  let c = m(n.attributes), l = n.timeoutMs ?? p, u = new Map(a.steps.map((e) => [e.id, e.layoutContentId !== void 0 && e.layoutContentId !== null])), d = Object.fromEntries(a.conditions.map((e) => [e.key, e])), f = a.experiences.filter((e) => !t(e.condition, d)), g = (await Promise.all(f.map(async (t) => ({
19
19
  experience: t,
20
- active: await r(e, { condition: t.condition }, { context: c })
20
+ active: await i(e, { condition: t.condition }, { context: c })
21
21
  })))).filter((e) => e.active).map((e) => e.experience), _ = await Promise.all(g.filter((e) => h(e, u)).map((t) => e.getExperienceContent({
22
22
  id: t.id,
23
23
  key: t.key
24
24
  }, {
25
- ...i,
25
+ ...r,
26
26
  signal: AbortSignal.timeout(l)
27
27
  }))), v = /* @__PURE__ */ new Map();
28
28
  for (let e of _) if (e) for (let t of [...e.references ?? [], ...e.content]) v.set(t.id, t);
@@ -46,7 +46,7 @@ function _() {
46
46
  };
47
47
  }
48
48
  function v(e, t) {
49
- let { promise: n, resolve: r } = _(), i = u(), o = u(), s = u(), p = u(), m = u(), h = e.experiences.listStore.map((t) => t.map((t) => a({
49
+ let { promise: n, resolve: r } = _(), i = u(), a = u(), s = u(), p = u(), m = u(), h = e.experiences.listStore.map((t) => t.map((t) => o({
50
50
  client: e,
51
51
  experience: t
52
52
  }))), g = d({
@@ -86,9 +86,9 @@ function v(e, t) {
86
86
  isComplete: !0
87
87
  })).reset(i), f({
88
88
  clock: i,
89
- target: o
89
+ target: a
90
90
  }), f({
91
- clock: o,
91
+ clock: a,
92
92
  source: {
93
93
  experiences: h,
94
94
  state: g
@@ -107,17 +107,17 @@ function v(e, t) {
107
107
  target: s
108
108
  }), f({
109
109
  clock: s,
110
- target: o
110
+ target: a
111
111
  }), f({
112
112
  clock: y.doneData,
113
113
  filter: (e) => e === null,
114
114
  target: m
115
115
  }), f({
116
116
  clock: m,
117
- target: o
117
+ target: a
118
118
  }), f({
119
119
  clock: [
120
- o,
120
+ a,
121
121
  m,
122
122
  s
123
123
  ],
@@ -140,4 +140,4 @@ function v(e, t) {
140
140
  }), i(), n;
141
141
  }
142
142
  //#endregion
143
- export { a as createExperienceInstance, n as evaluateConditionMemo, e as hashRule, r as isExperienceActive, s as registerProjectConfig, v as render, i as ruleReferencesAction, t as ruleReferencesActionDeep, g as serialize };
143
+ export { o as createExperienceInstance, r as evaluateConditionMemo, e as hashRule, i as isExperienceActive, s as registerProjectConfig, v as render, a as ruleReferencesAction, t as ruleReferencesActionDeep, g as serialize };