@picked/client 0.0.1-dev.1773724362573 → 0.0.1-dev.1773804563218

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 (95) hide show
  1. package/dist/{api-Z3Hn2Kw-.cjs → api-C90ugp6M.cjs} +1 -1
  2. package/dist/{api-B3x8PEp4.js → api-CQ1Lb-dB.js} +1 -1
  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/plugins/responses-indexeddb/index.js +1 -1
  10. package/dist/cjs/plugins/single-page-app/index.js +1 -1
  11. package/dist/cjs/server/index.js +1 -1
  12. package/dist/esm/index.js +738 -742
  13. package/dist/esm/plugins/create-experience/index.js +359 -286
  14. package/dist/esm/plugins/dynamic-experiences/index.js +146 -80
  15. package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
  16. package/dist/esm/plugins/history-browser-storage/index.js +1 -1
  17. package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
  18. package/dist/esm/plugins/responses-indexeddb/index.js +46 -51
  19. package/dist/esm/plugins/single-page-app/index.js +24 -24
  20. package/dist/esm/server/index.js +1 -1
  21. package/dist/{experience-instance-DTyL1fNb.js → experience-instance-8P1fJuPC.js} +306 -312
  22. package/dist/experience-instance-Bi3-1tP5.cjs +1 -0
  23. package/dist/object-BbFTsGh3.cjs +1 -0
  24. package/dist/{object-CJssU1Pm.js → object-JwZ58NOH.js} +1 -1
  25. package/dist/storage-Be5xWNPC.cjs +1 -0
  26. package/dist/{storage-B2d81EOI.js → storage-Co_LbKr_.js} +30 -35
  27. package/dist/types/entities/action/action.d.ts +2 -5
  28. package/dist/types/entities/action/action.d.ts.map +1 -1
  29. package/dist/types/entities/condition/condition.d.ts +17 -0
  30. package/dist/types/entities/condition/condition.d.ts.map +1 -0
  31. package/dist/types/entities/experience/experience.d.ts +46 -31
  32. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  33. package/dist/types/entities/experience-instance/experience-instance.d.ts +2 -2
  34. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  35. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  36. package/dist/types/entities/field/field.d.ts +23 -52
  37. package/dist/types/entities/field/field.d.ts.map +1 -1
  38. package/dist/types/entities/history/history.d.ts.map +1 -1
  39. package/dist/types/entities/project/project.d.ts.map +1 -1
  40. package/dist/types/entities/response/response.d.ts +9 -7
  41. package/dist/types/entities/response/response.d.ts.map +1 -1
  42. package/dist/types/entities/step/step.d.ts +20 -0
  43. package/dist/types/entities/step/step.d.ts.map +1 -0
  44. package/dist/types/index.d.ts +2 -1
  45. package/dist/types/index.d.ts.map +1 -1
  46. package/dist/types/logic-engine.d.ts +8 -2
  47. package/dist/types/logic-engine.d.ts.map +1 -1
  48. package/dist/types/picked.d.ts +41 -32
  49. package/dist/types/picked.d.ts.map +1 -1
  50. package/dist/types/plugins/create-experience/create-experience.d.ts +70 -39
  51. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  52. package/dist/types/plugins/create-experience/index.d.ts +1 -1
  53. package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
  54. package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
  55. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +20 -5
  56. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
  57. package/dist/types/plugins/dynamic-experiences/types.d.ts +46 -0
  58. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
  59. package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -2
  60. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
  61. package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -2
  62. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
  63. package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -2
  64. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
  65. package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -1
  66. package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
  67. package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
  68. package/dist/types/utils/dom.d.ts +3 -0
  69. package/dist/types/utils/dom.d.ts.map +1 -1
  70. package/dist/types/utils/events.d.ts +2 -2
  71. package/dist/types/utils/events.d.ts.map +1 -1
  72. package/dist/types/utils/global-obj.d.ts +1 -0
  73. package/dist/types/utils/global-obj.d.ts.map +1 -1
  74. package/dist/types/utils/indexed-db.d.ts +1 -2
  75. package/dist/types/utils/indexed-db.d.ts.map +1 -1
  76. package/dist/types/utils/key.d.ts +12 -0
  77. package/dist/types/utils/key.d.ts.map +1 -0
  78. package/dist/types/utils/logger.d.ts.map +1 -1
  79. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
  80. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
  81. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +3 -3
  82. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
  83. package/dist/types/utils/nodes.d.ts +2 -2
  84. package/dist/types/utils/nodes.d.ts.map +1 -1
  85. package/dist/types/utils/object.d.ts +8 -0
  86. package/dist/types/utils/object.d.ts.map +1 -1
  87. package/dist/types/utils/picked-config.d.ts +1 -1
  88. package/dist/types/utils/picked-config.d.ts.map +1 -1
  89. package/dist/types/utils/rules-logic.d.ts.map +1 -1
  90. package/dist/types/utils/search-params.d.ts.map +1 -1
  91. package/dist/types/utils/storage.d.ts.map +1 -1
  92. package/package.json +2 -16
  93. package/dist/experience-instance-BX0aqKsC.cjs +0 -1
  94. package/dist/object-mwaxtjLG.cjs +0 -1
  95. package/dist/storage-58NoTSsc.cjs +0 -1
@@ -1,137 +1,203 @@
1
- import { a as l } from "../../../api-B3x8PEp4.js";
2
- import { c as S } from "../../../api-B3x8PEp4.js";
1
+ import { a as m } from "../../../api-CQ1Lb-dB.js";
2
+ import { c as _ } from "../../../api-CQ1Lb-dB.js";
3
3
  import { l as a } from "../../../logger-C9a75KZn.js";
4
- function d(e) {
5
- let r = 2166136261;
6
- for (let n = 0; n < e.length; n++)
7
- r ^= e.charCodeAt(n), r = Math.imul(r, 16777619);
8
- return r >>> 0;
4
+ function y(n) {
5
+ let e = 2166136261;
6
+ for (let t = 0; t < n.length; t++)
7
+ e ^= n.charCodeAt(t), e = Math.imul(e, 16777619);
8
+ return e >>> 0;
9
9
  }
10
- function p(e) {
11
- return d(e) % 100;
10
+ function h(n) {
11
+ return y(n) % 100;
12
12
  }
13
- function g(e, r) {
14
- return r <= 0 ? !1 : r >= 100 ? !0 : e < r;
13
+ function w(n, e) {
14
+ return e <= 0 ? !1 : e >= 100 ? !0 : n < e;
15
15
  }
16
- function h(e) {
17
- return typeof e != "object" || e === null || !("id" in e && "name" in e && "enabled" in e && "weight" in e && "version" in e) ? !1 : typeof e.id == "string" && typeof e.name == "string" && typeof e.enabled == "boolean" && typeof e.weight == "number" && typeof e.version == "number";
16
+ function v(n) {
17
+ return typeof n != "object" || n === null || !("id" in n && "name" in n && "enabled" in n && "weight" in n && "version" in n) ? !1 : typeof n.id == "string" && typeof n.name == "string" && typeof n.enabled == "boolean" && typeof n.weight == "number" && typeof n.version == "number";
18
18
  }
19
- function f(e) {
20
- return typeof e != "object" || e === null || !("features" in e) || !Array.isArray(e.features) ? !1 : e.features.every(h);
19
+ function g(n) {
20
+ return typeof n != "object" || n === null || !("features" in n) || !Array.isArray(n.features) ? !1 : n.features.every(v);
21
21
  }
22
- function m(e) {
23
- const r = e.searchParams["preview-token"];
24
- if (r && r.length > 0)
25
- return r[0];
22
+ function j(n) {
23
+ return typeof n != "object" || n === null ? !1 : "id" in n && "name" in n && "nodes" in n && "edges" in n && typeof n.id == "string" && typeof n.name == "string" && Array.isArray(n.nodes) && Array.isArray(n.edges);
26
24
  }
27
- function w(e) {
28
- const r = /* @__PURE__ */ new Set(), n = e.searchParams.feature;
29
- if (!n)
30
- return r;
25
+ function C(n, e) {
26
+ const t = /* @__PURE__ */ new Set(), i = [];
31
27
  for (const o of n) {
32
- const t = o.indexOf(":");
33
- t > 0 && r.add(o.substring(0, t));
28
+ if (o.type !== "conditional")
29
+ continue;
30
+ const r = o.conditionId ?? o.conditionalId;
31
+ if (!r || t.has(r))
32
+ continue;
33
+ t.add(r);
34
+ const s = e.get(r);
35
+ if (!s) {
36
+ a("warn", `Condition with id '${r}' not found in project conditions`);
37
+ continue;
38
+ }
39
+ i.push({ id: s.id, label: s.name, condition: s.condition });
40
+ }
41
+ return i;
42
+ }
43
+ function c(n, e) {
44
+ if (e.conditions)
45
+ for (const t of e.conditions)
46
+ n.registerCondition(t);
47
+ }
48
+ function b(n, e, t) {
49
+ if (!j(e)) {
50
+ a("warn", `Skipping invalid experience payload: ${JSON.stringify(e)}`);
51
+ return;
34
52
  }
35
- return r;
53
+ const i = e.componentName ? n.components.listStore.getState().find((o) => o.name === e.componentName)?.component : void 0;
54
+ n.registerExperience({
55
+ id: e.id,
56
+ key: e.key,
57
+ name: e.name,
58
+ targets: e.targets ?? [],
59
+ steps: e.nodes.filter((o) => o.type === "step").map((o) => o.stepKey),
60
+ nodes: e.nodes,
61
+ edges: e.edges,
62
+ conditions: C(e.nodes, t),
63
+ actions: e.actions,
64
+ condition: e.condition,
65
+ initializeOpen: e.initializeOpen,
66
+ component: i
67
+ });
68
+ }
69
+ function f(n, e) {
70
+ if (e.fields)
71
+ for (const t of e.fields)
72
+ n.registerField(t);
73
+ }
74
+ function u(n, e) {
75
+ if (e.steps)
76
+ for (const t of e.steps)
77
+ n.registerStep(t);
78
+ }
79
+ function d(n, e) {
80
+ const t = /* @__PURE__ */ new Map();
81
+ if (e.conditions)
82
+ for (const i of e.conditions)
83
+ t.set(i.id, i);
84
+ if (e.experiences)
85
+ for (const i of e.experiences)
86
+ b(n, i, t);
87
+ }
88
+ function S(n) {
89
+ const e = n.searchParams["preview-token"];
90
+ if (e && e.length > 0)
91
+ return e[0];
36
92
  }
37
- function c(e, r, n) {
38
- const o = w(e), t = e.session?.id;
93
+ function k(n) {
94
+ const e = /* @__PURE__ */ new Set(), t = n.searchParams.feature;
39
95
  if (!t)
96
+ return e;
97
+ for (const i of t) {
98
+ const o = i.indexOf(":");
99
+ o > 0 && e.add(i.substring(0, o));
100
+ }
101
+ return e;
102
+ }
103
+ function l(n, e, t) {
104
+ const i = k(n), o = n.session?.id;
105
+ if (!o)
40
106
  throw new Error("Session ID is required for feature registration");
41
- const i = p(t);
42
- for (const s of r.features)
43
- o.has(s.id) || y(e, s, n, i);
44
- }
45
- function y(e, r, n, o) {
46
- e.registerFeature(r.id, {
47
- key: `v${r.version}`,
48
- name: r.name,
49
- storage: n ? "session" : "local",
50
- decide: () => r.enabled ? g(o, r.weight) : !1
107
+ const r = h(o);
108
+ for (const s of e.features)
109
+ i.has(s.id) || I(n, s, t, r);
110
+ }
111
+ function I(n, e, t, i) {
112
+ n.registerFeature(e.id, {
113
+ key: `v${e.version}`,
114
+ name: e.name,
115
+ storage: t ? "session" : "local",
116
+ decide: () => e.enabled ? w(i, e.weight) : !1
51
117
  });
52
118
  }
53
- function v() {
54
- let e;
119
+ function P() {
120
+ let n;
55
121
  try {
56
- e = __PICKED_PROJECT_CONFIG__;
122
+ n = __PICKED_PROJECT_CONFIG__;
57
123
  } catch {
58
124
  return;
59
125
  }
60
- if (e === void 0)
126
+ if (n === void 0)
61
127
  return;
62
- let r;
63
- if (typeof e == "string")
128
+ let e;
129
+ if (typeof n == "string")
64
130
  try {
65
- r = JSON.parse(e);
131
+ e = JSON.parse(n);
66
132
  } catch {
67
133
  a("warn", "Build-time project config is not valid JSON");
68
134
  return;
69
135
  }
70
136
  else
71
- r = e;
72
- if (f(r))
73
- return r;
137
+ e = n;
138
+ if (g(e))
139
+ return e;
74
140
  a("warn", "Build-time project config has invalid shape, falling back to runtime fetch");
75
141
  }
76
- function j(e) {
142
+ function F(n) {
77
143
  try {
78
- const r = new URL(e).hostname;
79
- return r === "localhost" || r === "127.0.0.1" || r === "::1";
144
+ const e = new URL(n).hostname;
145
+ return e === "localhost" || e === "127.0.0.1" || e === "::1";
80
146
  } catch {
81
147
  return !1;
82
148
  }
83
149
  }
84
- function b(e) {
85
- if (typeof e != "object" || e === null || !("cause" in e))
150
+ function E(n) {
151
+ if (typeof n != "object" || n === null || !("cause" in n))
86
152
  return !1;
87
- const { cause: r } = e;
88
- return typeof r != "object" || r === null || !("code" in r) ? !1 : r.code === "ECONNREFUSED";
153
+ const { cause: e } = n;
154
+ return typeof e != "object" || e === null || !("code" in e) ? !1 : e.code === "ECONNREFUSED";
89
155
  }
90
- async function u(e, r, n) {
91
- const o = n?.previewToken ? `projects/${r}?preview_token=${encodeURIComponent(n.previewToken)}` : `projects/${r}`;
92
- let t;
156
+ async function p(n, e, t) {
157
+ const i = t?.previewToken ? `projects/${e}?preview_token=${encodeURIComponent(t.previewToken)}` : `projects/${e}`;
158
+ let o;
93
159
  try {
94
- t = await l(e, o, n?.headers);
160
+ o = await m(n, i, t?.headers);
95
161
  } catch (s) {
96
- return j(e) && b(s) || a("warn", "Failed to fetch project config", s), null;
162
+ return F(n) && E(s) || a("warn", "Failed to fetch project config", s), null;
97
163
  }
98
- if (!t.ok)
99
- return a("warn", `Project config request failed with status ${t.status.toString()}`), null;
100
- let i;
164
+ if (!o.ok)
165
+ return a("warn", `Project config request failed with status ${o.status.toString()}`), null;
166
+ let r;
101
167
  try {
102
- i = await t.json();
168
+ r = await o.json();
103
169
  } catch {
104
170
  return a("warn", "Failed to parse project config response"), null;
105
171
  }
106
- return f(i) ? i : (a("warn", "Invalid project config response shape"), null);
172
+ return g(r) ? r : (a("warn", "Invalid project config response shape"), null);
107
173
  }
108
- function k(e) {
174
+ function N(n) {
109
175
  return {
110
176
  name: "dynamic-experiences",
111
- setup: (r) => {
112
- const n = e?.apiUrl ?? r.apiUrl;
177
+ setup: (e) => {
178
+ const t = n?.apiUrl ?? e.apiUrl;
113
179
  return {
114
180
  onStart: async () => {
115
- const o = m(r);
116
- if (o) {
117
- const s = await u(n, r.projectId, { previewToken: o });
118
- s && c(r, s, !0);
181
+ const i = S(e);
182
+ if (i) {
183
+ const s = await p(t, e.projectId, { previewToken: i });
184
+ s && (l(e, s, !0), c(e, s), f(e, s), u(e, s), d(e, s));
119
185
  return;
120
186
  }
121
- const t = e?.projectConfig ?? v();
122
- if (t) {
123
- c(r, t, !1);
187
+ const o = n?.projectConfig ?? P();
188
+ if (o) {
189
+ l(e, o, !1), c(e, o), f(e, o), u(e, o), d(e, o);
124
190
  return;
125
191
  }
126
- const i = await u(n, r.projectId);
127
- i && c(r, i, !1);
192
+ const r = await p(t, e.projectId);
193
+ r && (l(e, r, !1), c(e, r), f(e, r), u(e, r), d(e, r));
128
194
  }
129
195
  };
130
196
  }
131
197
  };
132
198
  }
133
199
  export {
134
- S as createClientHeaders,
135
- k as dynamicExperiencesPlugin,
136
- u as fetchProject
200
+ _ as createClientHeaders,
201
+ N as dynamicExperiencesPlugin,
202
+ p as fetchProject
137
203
  };
@@ -1,5 +1,5 @@
1
1
  import { createEffect as n, sample as i } from "effector";
2
- import { c, l as g, s as S } from "../../../storage-B2d81EOI.js";
2
+ import { c, l as g, s as S } from "../../../storage-Co_LbKr_.js";
3
3
  import { l as f } from "../../../logger-C9a75KZn.js";
4
4
  const y = ({
5
5
  storage: a = "local"
@@ -1,5 +1,5 @@
1
1
  import { createEffect as s, sample as r } from "effector";
2
- import { c as l, l as y, s as g } from "../../../storage-B2d81EOI.js";
2
+ import { c as l, l as y, s as g } from "../../../storage-Co_LbKr_.js";
3
3
  const a = l("history", "global"), f = ({
4
4
  storage: i = "local"
5
5
  } = {}) => ({
@@ -1,5 +1,5 @@
1
1
  import { createEffect as i, attach as f, sample as c } from "effector";
2
- import { c as u, l as g, s as d } from "../../../storage-B2d81EOI.js";
2
+ import { c as u, l as g, s as d } from "../../../storage-Co_LbKr_.js";
3
3
  const p = u("responses", "global"), S = (r, s) => {
4
4
  const o = {};
5
5
  return Object.entries(r).forEach(([t, n]) => {
@@ -1,91 +1,86 @@
1
1
  import { createEffect as u, sample as d } from "effector";
2
2
  const x = "picked";
3
- async function p(s) {
4
- const { storeName: t, version: c = 1, keyPath: n = "id" } = s;
5
- return new Promise((a, r) => {
3
+ async function p(r) {
4
+ const { storeName: o, version: c = 1, keyPath: n = "id" } = r;
5
+ return new Promise((a, t) => {
6
6
  const e = indexedDB.open(x, c);
7
7
  e.onupgradeneeded = () => {
8
- const o = e.result;
9
- o.objectStoreNames.contains(t) || o.createObjectStore(t, n ? { keyPath: n } : void 0);
10
- }, e.onsuccess = () => a(e.result), e.onerror = () => r(new Error(e.error?.message));
8
+ const s = e.result;
9
+ s.objectStoreNames.contains(o) || s.createObjectStore(o, n ? { keyPath: n } : void 0);
10
+ }, e.onsuccess = () => a(e.result), e.onerror = () => t(new Error(e.error?.message));
11
11
  });
12
12
  }
13
- async function g(s, t) {
13
+ async function g(r, o) {
14
14
  return new Promise((c, n) => {
15
- const e = s.transaction(t, "readonly").objectStore(t).getAll();
15
+ const e = r.transaction(o, "readonly").objectStore(o).getAll();
16
16
  e.onsuccess = () => c(e.result), e.onerror = () => n(new Error(e.error?.message));
17
17
  });
18
18
  }
19
- async function y(s, t, c) {
19
+ async function y(r, o, c) {
20
20
  return new Promise((n, a) => {
21
- const o = s.transaction(t, "readwrite").objectStore(t).put(c);
22
- o.onsuccess = () => n(), o.onerror = () => a(new Error(o.error?.message));
21
+ const s = r.transaction(o, "readwrite").objectStore(o).put(c);
22
+ s.onsuccess = () => n(), s.onerror = () => a(new Error(s.error?.message));
23
23
  });
24
24
  }
25
- async function S(s, t, c) {
25
+ async function b(r, o, c) {
26
26
  return new Promise((n, a) => {
27
- const o = s.transaction(t, "readwrite").objectStore(t).delete(c);
28
- o.onsuccess = () => n(), o.onerror = () => a(new Error(o.error?.message));
27
+ const s = r.transaction(o, "readwrite").objectStore(o).delete(c);
28
+ s.onsuccess = () => n(), s.onerror = () => a(new Error(s.error?.message));
29
29
  });
30
30
  }
31
- async function b(s, t) {
31
+ async function S(r, o) {
32
32
  return new Promise((c, n) => {
33
- const e = s.transaction(t, "readwrite").objectStore(t).clear();
33
+ const e = r.transaction(o, "readwrite").objectStore(o).clear();
34
34
  e.onsuccess = () => c(), e.onerror = () => n(new Error(e.error?.message));
35
35
  });
36
36
  }
37
- const l = "responses", w = { storeName: l, keyPath: "fieldId" }, E = () => ({
37
+ const l = "responses", m = { storeName: l, keyPath: "fieldId" }, I = () => ({
38
38
  name: "responses-indexdb-plugin",
39
- setup: (s) => {
40
- const t = u(async () => {
41
- const r = await p(w), o = (await g(r, l)).reduce(
42
- (i, { fieldId: m, value: f }) => (i[m] = f, i),
39
+ setup: (r) => {
40
+ const o = u(async () => {
41
+ const t = await p(m), s = (await g(t, l)).reduce(
42
+ (i, { fieldId: w, value: f }) => (i[w] = f, i),
43
43
  {}
44
44
  );
45
- await s.responses.commit(o);
45
+ await r.responses.commit(s);
46
46
  }), c = u(
47
- async (r) => {
48
- await Promise.allSettled(
49
- r.map(async (e) => {
50
- const o = await p(w);
51
- await y(
52
- o,
53
- l,
54
- e
55
- );
56
- })
57
- );
47
+ async (t) => {
48
+ t.forEach((e) => {
49
+ p(m).then((s) => {
50
+ y(s, l, e);
51
+ }).catch((s) => {
52
+ console.error("Failed to store response in IndexedDB:", s);
53
+ });
54
+ });
58
55
  }
59
56
  ), n = u(async () => {
60
- const r = await p(w);
61
- await b(r, l);
62
- }), a = u(async (r) => {
63
- const e = await p(w);
64
- await S(e, l, r);
57
+ const t = await p(m);
58
+ await S(t, l);
59
+ }), a = u(async (t) => {
60
+ const e = await p(m);
61
+ await b(e, l, t);
65
62
  });
66
63
  d({
67
- source: s.eventBus,
68
- filter: (r) => r.type === "load",
69
- target: t
64
+ source: r.eventBus,
65
+ filter: (t) => t.type === "load",
66
+ target: o
70
67
  }), d({
71
- clock: s.responses.listStore,
72
- source: { responses: s.responses.listStore, fields: s.fields.listStore },
73
- fn: ({ responses: r, fields: e }) => {
74
- const o = new Set(
75
- e.filter((i) => !i.policies?.doNotStoreValue).map((i) => i.id)
76
- );
77
- return r.filter((i) => o.has(i.fieldId));
68
+ clock: r.responses.listStore,
69
+ source: { responses: r.responses.listStore, fields: r.fields.listStore },
70
+ fn: ({ responses: t, fields: e }) => {
71
+ const s = e.filter((i) => !i.policies?.doNotStoreValue);
72
+ return t.filter((i) => s.some((w) => w.id === i.fieldId));
78
73
  },
79
74
  target: c
80
75
  }), d({
81
- clock: s.responses.clearAll,
76
+ clock: r.responses.clearAll,
82
77
  target: n
83
78
  }), d({
84
- clock: s.responses.clear,
79
+ clock: r.responses.clear,
85
80
  target: a
86
81
  });
87
82
  }
88
83
  });
89
84
  export {
90
- E as responsesIndexedDBPlugin
85
+ I as responsesIndexedDBPlugin
91
86
  };
@@ -1,37 +1,37 @@
1
- import { a as c, G as h, f as l } from "../../../supports-8YT4QKI7.js";
2
- import { p as u } from "../../../object-CJssU1Pm.js";
3
- const r = h;
4
- let n;
5
- const H = (s) => ({
1
+ import { a as f, G as c, f as m } from "../../../supports-8YT4QKI7.js";
2
+ import { p as a } from "../../../object-JwZ58NOH.js";
3
+ const o = c;
4
+ let s;
5
+ const d = (r) => ({
6
6
  name: "single-page-app",
7
- setup: (e) => {
8
- c() && m(() => {
7
+ setup: (n) => {
8
+ r.instrumentHistory && f() && h(() => {
9
9
  requestAnimationFrame(() => {
10
- e.start();
10
+ n.start();
11
11
  });
12
12
  });
13
13
  }
14
14
  });
15
- function m(s) {
16
- if (r.addEventListener("popstate", () => {
17
- const t = r.location.href, i = n;
18
- n = t, i !== t && s();
19
- }), !l())
15
+ function h(r) {
16
+ if (o.addEventListener("popstate", () => {
17
+ const e = o.location.href, t = s;
18
+ s = e, t !== e && r();
19
+ }), !m())
20
20
  return;
21
- function e(t) {
22
- return function(...o) {
23
- const p = o.length > 2 ? o[2] : void 0;
24
- if (p) {
25
- const f = n, a = String(p);
26
- if (n = a, f === a)
27
- return t.apply(this, o);
28
- s();
21
+ function n(e) {
22
+ return function(...t) {
23
+ const i = t.length > 2 ? t[2] : void 0;
24
+ if (i) {
25
+ const u = s, p = String(i);
26
+ if (s = p, u === p)
27
+ return e.apply(this, t);
28
+ r();
29
29
  }
30
- return t.apply(this, o);
30
+ return e.apply(this, t);
31
31
  };
32
32
  }
33
- u(r.history, "pushState", e), u(r.history, "replaceState", e);
33
+ a(o.history, "pushState", n), a(o.history, "replaceState", n);
34
34
  }
35
35
  export {
36
- H as singlePageAppPlugin
36
+ d as singlePageAppPlugin
37
37
  };
@@ -1,5 +1,5 @@
1
1
  import { createEvent as i, createStore as v, createEffect as C, sample as n, attach as S } from "effector";
2
- import { h as F } from "../../experience-instance-DTyL1fNb.js";
2
+ import { h as F } from "../../experience-instance-8P1fJuPC.js";
3
3
  function R() {
4
4
  let c, p;
5
5
  return {