@picked/client 0.0.70 → 0.0.71-next.2

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 (249) hide show
  1. package/dist/.tsbuildinfo +1 -0
  2. package/dist/api-B0ydpQBE.js +38 -0
  3. package/dist/api-CObostrU.cjs +1 -0
  4. package/dist/cjs/form/index.js +1 -1
  5. package/dist/cjs/index.js +2 -2
  6. package/dist/cjs/plugins/dom-observer/index.js +1 -1
  7. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  8. package/dist/cjs/server/index.js +1 -1
  9. package/dist/docs/explanation/conditions-and-the-logic-engine.md +94 -0
  10. package/dist/docs/explanation/feature-flag-allocation.md +176 -0
  11. package/dist/docs/explanation/how-picked-works.md +102 -0
  12. package/dist/docs/explanation/how-pickedql-works.md +76 -0
  13. package/dist/docs/explanation/pages-and-flows.md +64 -0
  14. package/dist/docs/explanation/the-content-model.md +77 -0
  15. package/dist/docs/explanation/the-two-apis.md +68 -0
  16. package/dist/docs/explanation/why-server-side-rendering.md +76 -0
  17. package/dist/docs/explanation/workspaces-and-versions.md +71 -0
  18. package/dist/docs/how-to/add-a-step-field-or-action.md +43 -0
  19. package/dist/docs/{pickedql/examples.md → how-to/analytics/index.md} +19 -6
  20. package/dist/docs/how-to/archive-or-delete-a-workspace.md +46 -0
  21. package/dist/docs/how-to/authenticate-with-a-magic-link.md +40 -0
  22. package/dist/docs/how-to/authenticate-with-a-password.md +51 -0
  23. package/dist/docs/how-to/authenticate-with-an-api-key.md +51 -0
  24. package/dist/docs/how-to/authenticate-with-oauth.md +40 -0
  25. package/dist/docs/{flow-builder/building-flows.md → how-to/build-a-flow.md} +13 -9
  26. package/dist/docs/how-to/connect-the-mcp-server.md +38 -0
  27. package/dist/docs/how-to/create-a-project.md +29 -0
  28. package/dist/docs/how-to/create-an-experience.md +42 -0
  29. package/dist/docs/how-to/create-and-revoke-an-api-key.md +37 -0
  30. package/dist/docs/how-to/debug-with-the-chrome-extension.md +57 -0
  31. package/dist/docs/how-to/define-a-page-layout.md +39 -0
  32. package/dist/docs/how-to/fill-and-publish-a-page.md +50 -0
  33. package/dist/docs/{gtm-template.md → how-to/install-the-gtm-template.md} +9 -3
  34. package/dist/docs/how-to/install-the-sdk.md +68 -0
  35. package/dist/docs/how-to/install-the-vite-plugin.md +56 -0
  36. package/dist/docs/how-to/invite-and-remove-members.md +34 -0
  37. package/dist/docs/how-to/preview-a-workspace.md +28 -0
  38. package/dist/docs/how-to/publish-a-workspace.md +30 -0
  39. package/dist/docs/how-to/read-a-feature-flag.md +101 -0
  40. package/dist/docs/how-to/register-a-component.md +55 -0
  41. package/dist/docs/how-to/register-an-action-handler.md +67 -0
  42. package/dist/docs/how-to/render-a-step-form.md +132 -0
  43. package/dist/docs/how-to/render-an-unpublished-preview.md +41 -0
  44. package/dist/docs/how-to/reuse-a-section.md +37 -0
  45. package/dist/docs/how-to/reuse-a-step-field-or-action.md +28 -0
  46. package/dist/docs/how-to/roll-back-a-published-version.md +26 -0
  47. package/dist/docs/how-to/run-an-ab-test.md +49 -0
  48. package/dist/docs/how-to/run-code-on-a-form-submission.md +125 -0
  49. package/dist/docs/how-to/server-render-a-page.md +81 -0
  50. package/dist/docs/how-to/set-a-content-security-policy.md +32 -0
  51. package/dist/docs/how-to/set-up-mfa.md +69 -0
  52. package/dist/docs/how-to/upload-and-use-an-asset.mdx +73 -0
  53. package/dist/docs/how-to/validate-a-field.md +52 -0
  54. package/dist/docs/how-to/write-a-condition.md +45 -0
  55. package/dist/docs/how-to/write-a-predicate.md +60 -0
  56. package/dist/docs/index.md +41 -70
  57. package/dist/docs/reference/dashboard/actions.mdx +53 -0
  58. package/dist/docs/{api-keys.mdx → reference/dashboard/api-keys.mdx} +7 -15
  59. package/dist/docs/reference/dashboard/conditions.mdx +42 -0
  60. package/dist/docs/reference/dashboard/content/asset-library.mdx +63 -0
  61. package/dist/docs/{content → reference/dashboard/content}/content-entries.mdx +11 -3
  62. package/dist/docs/{content → reference/dashboard/content}/layouts.mdx +11 -35
  63. package/dist/docs/reference/dashboard/content/pages.mdx +35 -0
  64. package/dist/docs/reference/dashboard/content/sections.mdx +28 -0
  65. package/dist/docs/{experiences.mdx → reference/dashboard/experiences.mdx} +9 -16
  66. package/dist/docs/{features.mdx → reference/dashboard/features.mdx} +26 -41
  67. package/dist/docs/{fields.mdx → reference/dashboard/fields.mdx} +26 -20
  68. package/dist/docs/{flow-builder/overview.mdx → reference/dashboard/flow-builder/canvas.mdx} +8 -13
  69. package/dist/docs/{flow-builder → reference/dashboard/flow-builder}/condition-builder.md +5 -13
  70. package/dist/docs/{flow-builder → reference/dashboard/flow-builder}/keyboard-shortcuts.md +7 -1
  71. package/dist/docs/{flow-builder → reference/dashboard/flow-builder}/nodes.md +10 -3
  72. package/dist/docs/reference/dashboard/projects.mdx +44 -0
  73. package/dist/docs/reference/dashboard/reports.mdx +43 -0
  74. package/dist/docs/reference/dashboard/steps.mdx +37 -0
  75. package/dist/docs/{team-management.md → reference/dashboard/team-management.md} +5 -22
  76. package/dist/docs/{workspace-versioning.mdx → reference/dashboard/workspace-versioning.mdx} +6 -10
  77. package/dist/docs/reference/dashboard/workspaces.mdx +76 -0
  78. package/dist/docs/{delivery-api → reference/delivery-api}/experience-content.md +11 -4
  79. package/dist/docs/reference/delivery-api/index.md +45 -0
  80. package/dist/docs/{delivery-api → reference/delivery-api}/preview-caching-crawling.md +12 -5
  81. package/dist/docs/{delivery-api → reference/delivery-api}/project-config.md +11 -4
  82. package/dist/docs/reference/glossary.md +173 -0
  83. package/dist/docs/reference/management-api/authentication.md +74 -0
  84. package/dist/docs/{api → reference/management-api}/authorization-and-scopes.md +10 -3
  85. package/dist/docs/{api → reference/management-api}/error-handling.md +9 -3
  86. package/dist/docs/{api → reference/management-api}/pagination.md +6 -0
  87. package/dist/docs/{pickedql → reference/pickedql}/data-sources.md +16 -9
  88. package/dist/docs/{pickedql → reference/pickedql}/dimensions.md +7 -0
  89. package/dist/docs/{pickedql → reference/pickedql}/filtering.md +7 -0
  90. package/dist/docs/reference/pickedql/index.md +18 -0
  91. package/dist/docs/{pickedql → reference/pickedql}/schema.md +13 -6
  92. package/dist/docs/{pickedql → reference/pickedql}/virtual-functions.md +7 -0
  93. package/dist/docs/reference/sdk/actions.md +30 -0
  94. package/dist/docs/{sdk → reference/sdk}/conditions.md +8 -1
  95. package/dist/docs/reference/sdk/content-security-policy.md +21 -0
  96. package/dist/docs/reference/sdk/experiences.md +51 -0
  97. package/dist/docs/{sdk → reference/sdk}/features.md +30 -117
  98. package/dist/docs/{sdk → reference/sdk}/fields.md +10 -88
  99. package/dist/docs/reference/sdk/index.md +68 -0
  100. package/dist/docs/{sdk → reference/sdk}/plugins/create-experience.md +10 -22
  101. package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +26 -0
  102. package/dist/docs/reference/sdk/plugins/index.md +29 -0
  103. package/dist/docs/{sdk → reference/sdk}/plugins/window-object.md +6 -0
  104. package/dist/docs/reference/sdk/predicates.md +43 -0
  105. package/dist/docs/reference/sdk/ssr/index.md +33 -0
  106. package/dist/docs/{sdk → reference/sdk}/ssr/rendering-and-hydration.md +4 -63
  107. package/dist/docs/{sdk → reference/sdk}/ssr/serialize.md +6 -33
  108. package/dist/docs/{sdk → reference/sdk}/ssr/slots-and-placements.md +7 -1
  109. package/dist/docs/reference/sdk/steps.md +87 -0
  110. package/dist/docs/reference/tools/chrome-extension.md +16 -0
  111. package/dist/docs/{image-optimisation-service.md → reference/tools/image-optimisation-service.md} +8 -0
  112. package/dist/docs/{mcp.md → reference/tools/mcp.md} +5 -45
  113. package/dist/docs/{vite-plugin.md → reference/tools/vite-plugin.md} +8 -38
  114. package/dist/docs/{api/index.md → tutorials/first-api-call.md} +27 -15
  115. package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +143 -0
  116. package/dist/docs/tutorials/first-experience.mdx +255 -0
  117. package/dist/docs/tutorials/first-server-rendered-page.mdx +186 -0
  118. package/dist/{dom-BwmTHeT7.js → dom-BqcToNL0.js} +1 -3
  119. package/dist/{dom-CDrHc_j9.cjs → dom-DlLH3FxV.cjs} +1 -1
  120. package/dist/esm/form/index.js +2 -4
  121. package/dist/esm/index.js +306 -298
  122. package/dist/esm/plugins/dom-observer/index.js +1 -1
  123. package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
  124. package/dist/esm/preview/index.js +1 -1
  125. package/dist/esm/server/index.js +12 -10
  126. package/dist/{experience-instance-DOJShRk5.js → experience-instance-DGk11d8a.js} +3 -3
  127. package/dist/experience-instance-Dej3P1sE.cjs +1 -0
  128. package/dist/plugin-CNna0UjB.cjs +1 -0
  129. package/dist/{plugin-ChPkTj__.js → plugin-DUOJpHaq.js} +2 -2
  130. package/dist/{preview-channel-DW9J8t4B.js → preview-channel-CSr96XAo.js} +1 -1
  131. package/dist/{protocol-DSqOlW2r.js → protocol-C5KkkiZc.js} +1 -1
  132. package/dist/types/client.d.ts +7 -6
  133. package/dist/types/entities/action/action.d.ts +5 -4
  134. package/dist/types/entities/action/action.d.ts.map +1 -1
  135. package/dist/types/entities/component/component.d.ts +6 -5
  136. package/dist/types/entities/component/component.d.ts.map +1 -1
  137. package/dist/types/entities/condition/condition.d.ts +5 -5
  138. package/dist/types/entities/content/content.d.ts +4 -3
  139. package/dist/types/entities/experience/experience.d.ts +11 -10
  140. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  141. package/dist/types/entities/experience-instance/experience-instance.d.ts +10 -9
  142. package/dist/types/entities/feature/feature.d.ts +19 -2
  143. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  144. package/dist/types/entities/field/field.d.ts +7 -6
  145. package/dist/types/entities/framework/framework.d.ts +7 -6
  146. package/dist/types/entities/framework/framework.d.ts.map +1 -1
  147. package/dist/types/entities/history/history.d.ts +6 -6
  148. package/dist/types/entities/plugin/plugin.d.ts +3 -2
  149. package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
  150. package/dist/types/entities/predicate/predicate.d.ts +4 -3
  151. package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
  152. package/dist/types/entities/response/response-validation.d.ts +3 -2
  153. package/dist/types/entities/response/response.d.ts +12 -11
  154. package/dist/types/entities/session/session.d.ts +2 -1
  155. package/dist/types/entities/step/step.d.ts +6 -5
  156. package/dist/types/exports.d.ts +2 -1
  157. package/dist/types/exports.d.ts.map +1 -1
  158. package/dist/types/form/build-responses.d.ts +2 -1
  159. package/dist/types/form/create-field-evaluator.d.ts +4 -3
  160. package/dist/types/form/create-field-validation.d.ts +5 -4
  161. package/dist/types/form/create-form.d.ts +7 -6
  162. package/dist/types/form/create-submit-pipeline.d.ts +7 -6
  163. package/dist/types/form/get-step-fields.d.ts +3 -2
  164. package/dist/types/lifecycle/condition-selection.d.ts +14 -4
  165. package/dist/types/lifecycle/lifecycle.d.ts +4 -3
  166. package/dist/types/lifecycle/rules-logic.d.ts +4 -3
  167. package/dist/types/lifecycle/state-snapshot.d.ts +4 -3
  168. package/dist/types/picked.d.ts +64 -62
  169. package/dist/types/picked.d.ts.map +1 -1
  170. package/dist/types/ping.d.ts +1 -1
  171. package/dist/types/ping.d.ts.map +1 -1
  172. package/dist/types/plugins/create-experience/create-experience.d.ts +9 -8
  173. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  174. package/dist/types/plugins/create-experience/plugin.d.ts +3 -2
  175. package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
  176. package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
  177. package/dist/types/plugins/dom-observer/plugin.d.ts +1 -1
  178. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +3 -3
  179. package/dist/types/plugins/dynamic-experiences/types.d.ts +8 -5
  180. package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -1
  181. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
  182. package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -1
  183. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
  184. package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -1
  185. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
  186. package/dist/types/plugins/responses-indexeddb/plugin.d.ts +1 -1
  187. package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
  188. package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
  189. package/dist/types/plugins/web-components/plugin.d.ts +2 -1
  190. package/dist/types/plugins/window-object/plugin.d.ts +2 -2
  191. package/dist/types/preview-channel.d.ts +5 -1
  192. package/dist/types/preview-receiver/index.d.ts +18 -1
  193. package/dist/types/preview-receiver/protocol.d.ts +10 -1
  194. package/dist/types/server/index.d.ts +3 -3
  195. package/dist/types/server/serialize.d.ts +2 -2
  196. package/dist/types/utils/dom.d.ts +2 -1
  197. package/dist/types/utils/events.d.ts +6 -6
  198. package/dist/types/utils/events.d.ts.map +1 -1
  199. package/dist/types/utils/global-obj.d.ts +1 -1
  200. package/dist/types/utils/global-obj.d.ts.map +1 -1
  201. package/dist/types/utils/id.d.ts.map +1 -1
  202. package/dist/types/utils/logger.d.ts +2 -1
  203. package/dist/types/utils/logger.d.ts.map +1 -1
  204. package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +2 -1
  205. package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +2 -1
  206. package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
  207. package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
  208. package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
  209. package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
  210. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +1 -1
  211. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
  212. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +1 -1
  213. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
  214. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +1 -1
  215. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
  216. package/dist/types/utils/nodes.d.ts +1 -1
  217. package/dist/types/utils/picked-config.d.ts +2 -1
  218. package/dist/types/utils/rules-logic.d.ts +6 -2
  219. package/dist/types/utils/storage.d.ts +1 -1
  220. package/dist/types/utils/storage.d.ts.map +1 -1
  221. package/package.json +22 -23
  222. package/dist/api-CPy9G49C.js +0 -40
  223. package/dist/api-Ce6xYI--.cjs +0 -1
  224. package/dist/docs/actions.mdx +0 -98
  225. package/dist/docs/api/authentication.md +0 -403
  226. package/dist/docs/chrome-extension.md +0 -68
  227. package/dist/docs/conditions.mdx +0 -72
  228. package/dist/docs/content/asset-library.mdx +0 -124
  229. package/dist/docs/content/pages.mdx +0 -82
  230. package/dist/docs/content/sections.mdx +0 -44
  231. package/dist/docs/delivery-api/index.md +0 -53
  232. package/dist/docs/guides/build-a-personalized-page.mdx +0 -161
  233. package/dist/docs/pickedql/index.md +0 -54
  234. package/dist/docs/projects.mdx +0 -44
  235. package/dist/docs/reports.mdx +0 -20
  236. package/dist/docs/sdk/actions.md +0 -82
  237. package/dist/docs/sdk/content-security-policy.md +0 -33
  238. package/dist/docs/sdk/experiences.md +0 -64
  239. package/dist/docs/sdk/feature-allocation.md +0 -161
  240. package/dist/docs/sdk/index.md +0 -98
  241. package/dist/docs/sdk/plugins/dynamic-experiences.md +0 -84
  242. package/dist/docs/sdk/plugins/index.md +0 -9
  243. package/dist/docs/sdk/predicates.md +0 -128
  244. package/dist/docs/sdk/ssr/index.md +0 -79
  245. package/dist/docs/sdk/steps.md +0 -479
  246. package/dist/docs/steps.mdx +0 -53
  247. package/dist/docs/workspaces.mdx +0 -133
  248. package/dist/experience-instance-DurC3pE-.cjs +0 -1
  249. package/dist/plugin-DHn11gn6.cjs +0 -1
package/dist/esm/index.js CHANGED
@@ -2,10 +2,10 @@ import { t as e } from "../object-BUDGxEqy.js";
2
2
  import { n as t, t as n } from "../rules-logic-HesIUCu6.js";
3
3
  import { t as r } from "../logger-DMN6TxJJ.js";
4
4
  import { a as i, c as a, d as o, f as s, i as c, l, m as u, n as d, o as f, r as p, s as m, t as h, u as g } from "../supports-CO9bJGNl.js";
5
- import { a as _, i as v, r as ee, s as y, t as b } from "../dom-BwmTHeT7.js";
6
- import { l as x, n as S, r as C, u as w } from "../experience-instance-DOJShRk5.js";
5
+ import { a as _, i as v, r as ee, s as y, t as b } from "../dom-BqcToNL0.js";
6
+ import { l as x, n as S, r as C, u as w } from "../experience-instance-DGk11d8a.js";
7
7
  import { i as T, n as E, r as D, t as O } from "../storage-1MW3-_As.js";
8
- import { n as te, r as ne } from "../api-CPy9G49C.js";
8
+ import { n as te, r as ne } from "../api-B0ydpQBE.js";
9
9
  import { t as re } from "../id-Bo4RBeOs.js";
10
10
  import { n as ie, r as ae, t as oe } from "../inert-script-report-B_bMPRzp.js";
11
11
  import { attach as k, combine as A, createApi as j, createDomain as M, createEffect as N, createEvent as P, createStore as F, sample as I } from "effector";
@@ -38,18 +38,18 @@ var z = M("experience"), se = L(({ client: e, experience: r }) => {
38
38
  n ? e.experienceInstances.spawn(u, t, n) : e.experienceInstances.spawn(u, t);
39
39
  });
40
40
  }
41
- }), f = k({
42
- source: A({
43
- preconditionPassed: e.preconditionPassedStore,
44
- isUser: e.session.store.map((e) => e.isUser, { skipVoid: !1 }),
45
- config: o
46
- }),
41
+ }), f = A({
42
+ preconditionPassed: e.preconditionPassedStore,
43
+ isUser: e.session.store.map((e) => e.isUser, { skipVoid: !1 }),
44
+ config: o
45
+ }), p = k({
46
+ source: f,
47
47
  effect: async ({ preconditionPassed: i, isUser: a, config: o }) => {
48
48
  if (!i || !a) return !1;
49
49
  let { decisionLogic: s, targetSelectors: c } = o;
50
- return c.length === 0 || v(c, r.id).length < 1 ? !1 : s === void 0 ? !0 : t(s) ? await n(e, s) === !0 : !0;
50
+ return c.length === 0 || v(c, r.id).length < 1 ? !1 : s === void 0 || !t(s) || await n(e, s) === !0;
51
51
  }
52
- }), p = N(async () => {
52
+ }), m = N(async () => {
53
53
  if (!e.contentLoader) return !0;
54
54
  try {
55
55
  await e.contentLoader({
@@ -60,28 +60,28 @@ var z = M("experience"), se = L(({ client: e, experience: r }) => {
60
60
  `${r.id}`;
61
61
  }
62
62
  return !0;
63
- }), m = P(), h = P(), g = z.createStore(void 0, { skipVoid: !1 }).on(m, (e, t) => t).on(h, (e, t) => t);
63
+ }), h = P(), g = P(), _ = z.createStore(void 0, { skipVoid: !1 }).on(h, (e, t) => t).on(g, (e, t) => t);
64
64
  return I({
65
- clock: m,
66
- target: f
65
+ clock: h,
66
+ target: p
67
67
  }), I({
68
- clock: f.doneData,
69
- source: g,
68
+ clock: p.doneData,
69
+ source: _,
70
70
  filter: (e, t) => t,
71
71
  fn: (e) => e,
72
72
  target: d
73
73
  }), I({
74
- clock: f.doneData,
74
+ clock: p.doneData,
75
75
  filter: Boolean,
76
- target: p
76
+ target: m
77
77
  }), I({
78
- clock: h,
79
- source: g,
78
+ clock: g,
79
+ source: _,
80
80
  fn: (e) => e,
81
81
  target: d
82
82
  }), I({
83
- clock: h,
84
- target: p
83
+ clock: g,
84
+ target: m
85
85
  }), u = {
86
86
  id: r.id,
87
87
  key: r.key,
@@ -92,10 +92,10 @@ var z = M("experience"), se = L(({ client: e, experience: r }) => {
92
92
  actions: l,
93
93
  merge: a.merge,
94
94
  initialiseFx: d,
95
- shouldInitialiseFx: f,
96
- initialiseRequested: m,
97
- initialiseDirectly: h,
98
- prepareExperienceContentFx: p
95
+ shouldInitialiseFx: p,
96
+ initialiseRequested: h,
97
+ initialiseDirectly: g,
98
+ prepareExperienceContentFx: m
99
99
  }, u;
100
100
  });
101
101
  function ce(e) {
@@ -169,7 +169,7 @@ var le = L(({ client: e }) => {
169
169
  for (let e of i) e.open();
170
170
  return;
171
171
  }
172
- await c("key" in n ? {
172
+ let a = "key" in n ? {
173
173
  key: n.key,
174
174
  options: {
175
175
  ...n.options,
@@ -181,7 +181,8 @@ var le = L(({ client: e }) => {
181
181
  ...n.options,
182
182
  initialiseOpen: !0
183
183
  }
184
- });
184
+ };
185
+ await c(a);
185
186
  }
186
187
  }),
187
188
  listStore: a,
@@ -257,13 +258,13 @@ var _e = L(({ client: e }) => {
257
258
  function ve(e) {
258
259
  return R(_e, e);
259
260
  }
260
- var ye = (e, t, n) => {
261
+ var B = (e, t, n) => {
261
262
  n.register({
262
263
  name: e,
263
264
  component: t
264
265
  });
265
- }, be = M("framework"), xe = L((e) => {
266
- let t = be.store({}), n = j(t, { register(e, t) {
266
+ }, ye = M("framework"), be = L((e) => {
267
+ let t = ye.store({}), n = j(t, { register(e, t) {
267
268
  return {
268
269
  ...e,
269
270
  [t.name]: t.framework
@@ -288,15 +289,15 @@ var ye = (e, t, n) => {
288
289
  listStore: a
289
290
  };
290
291
  });
291
- function Se(e) {
292
- return R(xe, e);
292
+ function xe(e) {
293
+ return R(be, e);
293
294
  }
294
- var Ce = (e, t) => {
295
+ var Se = (e, t) => {
295
296
  t.register({
296
297
  name: e.name,
297
298
  framework: e
298
299
  });
299
- }, we = L(({ client: e }) => {
300
+ }, Ce = L(({ client: e }) => {
300
301
  let t = "window" in globalThis, n = {
301
302
  location: t ? globalThis.location : void 0,
302
303
  document: t ? globalThis.document : void 0,
@@ -310,84 +311,84 @@ var Ce = (e, t) => {
310
311
  ...n
311
312
  }));
312
313
  });
313
- function Te(e) {
314
- return R(we, e);
314
+ function we(e) {
315
+ return R(Ce, e);
315
316
  }
316
317
  //#endregion
317
318
  //#region src/logic-engine.ts
318
- function Ee(e) {
319
+ function Te(e) {
319
320
  return typeof e == "number" && !isNaN(e);
320
321
  }
321
- function B(e) {
322
+ function V(e) {
322
323
  return typeof e == "string";
323
324
  }
324
- function V(e) {
325
+ function H(e) {
325
326
  return Array.isArray(e);
326
327
  }
327
- function De(e) {
328
+ function U(e) {
328
329
  return e instanceof Promise;
329
330
  }
330
- function Oe(e) {
331
+ function Ee(e) {
331
332
  return typeof e == "object" && !!e && !Array.isArray(e) && Object.keys(e).length === 1;
332
333
  }
333
- function H(e) {
334
- if (Ee(e)) return e;
334
+ function W(e) {
335
+ if (Te(e)) return e;
335
336
  let t = parseFloat(`${e}`);
336
337
  return isNaN(t) ? 0 : t;
337
338
  }
338
- function U(e) {
339
+ function G(e) {
339
340
  return `${e}`;
340
341
  }
341
- var ke = {
342
+ var De = {
342
343
  "==": (e, t) => e == t,
343
344
  "===": (e, t) => e === t,
344
345
  "!=": (e, t) => e != t,
345
346
  "!==": (e, t) => e !== t,
346
- ">": (e, t) => H(e) > H(t),
347
- ">=": (e, t) => H(e) >= H(t),
347
+ ">": (e, t) => W(e) > W(t),
348
+ ">=": (e, t) => W(e) >= W(t),
348
349
  "<": (e, t, n) => {
349
- let r = H(e), i = H(t);
350
+ let r = W(e), i = W(t);
350
351
  if (n === void 0) return r < i;
351
- let a = H(n);
352
+ let a = W(n);
352
353
  return r < i && i < a;
353
354
  },
354
355
  "<=": (e, t, n) => {
355
- let r = H(e), i = H(t);
356
+ let r = W(e), i = W(t);
356
357
  if (n === void 0) return r <= i;
357
- let a = H(n);
358
+ let a = W(n);
358
359
  return r <= i && i <= a;
359
360
  },
360
- "!!": async (e) => await G(e),
361
- "!": async (e) => !await G(e),
362
- "%": (e, t) => H(e) % H(t),
361
+ "!!": async (e) => await q(e),
362
+ "!": async (e) => !await q(e),
363
+ "%": (e, t) => W(e) % W(t),
363
364
  log: (e) => (console.log(e), e),
364
- in: (e, t) => t ? B(t) ? t.indexOf(U(e)) !== -1 : V(t) ? t.includes(e) : !1 : !1,
365
- cat: (...e) => e.map(U).join(""),
365
+ in: (e, t) => t ? V(t) ? t.indexOf(G(e)) !== -1 : H(t) ? t.includes(e) : !1 : !1,
366
+ cat: (...e) => e.map(G).join(""),
366
367
  substr: (e, t, n) => {
367
- let r = U(e), i = H(t);
368
+ let r = G(e), i = W(t);
368
369
  if (n === void 0) return r.substr(i);
369
- let a = H(n);
370
+ let a = W(n);
370
371
  if (a < 0) {
371
372
  let e = r.substr(i);
372
373
  return e.substr(0, e.length + a);
373
374
  }
374
375
  return r.substr(i, a);
375
376
  },
376
- "+": (...e) => e.reduce((e, t) => H(e) + H(t), 0),
377
- "*": (...e) => e.reduce((e, t) => H(e) * H(t), 1),
377
+ "+": (...e) => e.reduce((e, t) => W(e) + W(t), 0),
378
+ "*": (...e) => e.reduce((e, t) => W(e) * W(t), 1),
378
379
  "-": (e, t) => {
379
- let n = H(e);
380
- return t === void 0 ? -n : n - H(t);
380
+ let n = W(e);
381
+ return t === void 0 ? -n : n - W(t);
381
382
  },
382
- "/": (e, t) => H(e) / H(t),
383
- min: (...e) => Math.min(...e.map(H)),
384
- max: (...e) => Math.max(...e.map(H)),
385
- merge: (...e) => e.reduce((e, t) => V(t) ? e.concat(t) : e.concat([t]), []),
383
+ "/": (e, t) => W(e) / W(t),
384
+ min: (...e) => Math.min(...e.map(W)),
385
+ max: (...e) => Math.max(...e.map(W)),
386
+ merge: (...e) => e.reduce((e, t) => H(t) ? e.concat(t) : e.concat([t]), []),
386
387
  var(e, t) {
387
388
  let n = arguments.length > 1 ? t : null;
388
389
  if (e === "" || e === "." || e == null) return this;
389
390
  if (typeof e == "number" && Array.isArray(this)) return e >= 0 && e < this.length ? this[e] : n;
390
- let r = U(e);
391
+ let r = G(e);
391
392
  if (r === "" || r === ".") return this;
392
393
  let i = r.split("."), a = this;
393
394
  for (let e of i) {
@@ -400,126 +401,126 @@ var ke = {
400
401
  return a === void 0 ? n : a;
401
402
  },
402
403
  async missing(...e) {
403
- let t = V(e[0]) ? e[0] : e, n = [];
404
+ let t = H(e[0]) ? e[0] : e, n = [];
404
405
  for (let e of t) {
405
- let t = await W({ var: e }, this);
406
+ let t = await K({ var: e }, this);
406
407
  (t === null || t === "") && n.push(`${e}`);
407
408
  }
408
409
  return n;
409
410
  },
410
411
  async missing_some(e, t) {
411
- let n = await W({ missing: t }, this);
412
- if (!V(n) || !V(t)) return [];
413
- let r = n.filter(B);
414
- return t.filter(B).length - r.length >= H(e) ? [] : r;
412
+ let n = await K({ missing: t }, this);
413
+ if (!H(n) || !H(t)) return [];
414
+ let r = n.filter(V);
415
+ return t.filter(V).length - r.length >= W(e) ? [] : r;
415
416
  },
416
417
  invoke(...e) {
417
418
  let [t, ...n] = e;
418
419
  return typeof t == "function" ? Reflect.apply(t, null, n) : null;
419
420
  },
420
- startsWith: (e, t) => B(e) && B(t) && e.startsWith(t),
421
- endsWith: (e, t) => B(e) && B(t) && e.endsWith(t),
421
+ startsWith: (e, t) => V(e) && V(t) && e.startsWith(t),
422
+ endsWith: (e, t) => V(e) && V(t) && e.endsWith(t),
422
423
  regexp_matches(e, t) {
423
424
  let n = e, r = "";
424
- if (V(e)) {
425
+ if (H(e)) {
425
426
  let [t, i] = e;
426
427
  n = t, r = i;
427
428
  }
428
- return !B(n) || !B(r) ? !1 : new RegExp(n, r).test(U(t));
429
+ return !V(n) || !V(r) ? !1 : new RegExp(n, r).test(G(t));
429
430
  },
430
431
  throw(e) {
431
- throw Error(U(e));
432
+ throw Error(G(e));
432
433
  }
433
434
  };
434
- async function W(e, t) {
435
+ async function K(e, t) {
435
436
  if (!e) return e;
436
- if (De(e)) return W(await e, t);
437
- if (V(e)) return Promise.all(e.map((e) => W(e, t)));
438
- if (!Oe(e)) return e;
439
- let n = Ae(e), r = n ? e[n] ?? [] : [];
440
- switch (V(r) || (r = [r]), n) {
437
+ if (U(e)) return K(await e, t);
438
+ if (H(e)) return Promise.all(e.map((e) => K(e, t)));
439
+ if (!Ee(e)) return e;
440
+ let n = Oe(e), r = n ? e[n] ?? [] : [];
441
+ switch (H(r) || (r = [r]), n) {
441
442
  case "if":
442
443
  case "?:":
443
- for (let e = 0; e < r.length - 1; e += 2) if (await G(await W(r[e], t))) return W(r[e + 1], t);
444
- return r.length % 2 == 1 ? W(r[r.length - 1], t) : null;
444
+ for (let e = 0; e < r.length - 1; e += 2) if (await q(await K(r[e], t))) return K(r[e + 1], t);
445
+ return r.length % 2 == 1 ? K(r[r.length - 1], t) : null;
445
446
  case "and": {
446
447
  let e = null;
447
- for (let n of r) if (e = await W(n, t), !await G(e)) return e;
448
+ for (let n of r) if (e = await K(n, t), !await q(e)) return e;
448
449
  return e;
449
450
  }
450
451
  case "or": {
451
452
  let e = null;
452
- for (let n of r) if (e = await W(n, t), await G(e)) return e;
453
+ for (let n of r) if (e = await K(n, t), await q(e)) return e;
453
454
  return e;
454
455
  }
455
456
  case "map": {
456
- let e = await W(r[0], t);
457
- return V(e) ? await Promise.all(e.map((e) => W(r[1], e))) : [];
457
+ let e = await K(r[0], t);
458
+ return H(e) ? await Promise.all(e.map((e) => K(r[1], e))) : [];
458
459
  }
459
460
  case "filter": {
460
- let e = await W(r[0], t);
461
- return V(e) ? (await Promise.all(e.map(async (e) => ({
461
+ let e = await K(r[0], t);
462
+ return H(e) ? (await Promise.all(e.map(async (e) => ({
462
463
  item: e,
463
- shouldInclude: await G(await W(r[1], e))
464
+ shouldInclude: await q(await K(r[1], e))
464
465
  })))).filter(({ shouldInclude: e }) => e).map(({ item: e }) => e) : [];
465
466
  }
466
467
  case "reduce": {
467
- let e = await W(r[0], t);
468
- if (!V(e)) return r.length > 2 ? await W(r[2], t) : null;
469
- let n = r[1], i = r.length > 2 ? await W(r[2], t) : null;
470
- for (let t of e) i = await W(n, {
468
+ let e = await K(r[0], t);
469
+ if (!H(e)) return r.length > 2 ? await K(r[2], t) : null;
470
+ let n = r[1], i = r.length > 2 ? await K(r[2], t) : null;
471
+ for (let t of e) i = await K(n, {
471
472
  current: t,
472
473
  accumulator: i
473
474
  });
474
475
  return i;
475
476
  }
476
477
  case "all": {
477
- let e = await W(r[0], t);
478
- if (!V(e) || e.length === 0) return !1;
479
- for (let t of e) if (!await G(await W(r[1], t))) return !1;
478
+ let e = await K(r[0], t);
479
+ if (!H(e) || e.length === 0) return !1;
480
+ for (let t of e) if (!await q(await K(r[1], t))) return !1;
480
481
  return !0;
481
482
  }
482
483
  case "some": {
483
- let e = await W(r[0], t);
484
- if (!V(e)) return !1;
485
- for (let t of e) if (await G(await W(r[1], t))) return !0;
484
+ let e = await K(r[0], t);
485
+ if (!H(e)) return !1;
486
+ for (let t of e) if (await q(await K(r[1], t))) return !0;
486
487
  return !1;
487
488
  }
488
489
  case "none": {
489
- let e = await W(r[0], t);
490
- if (!V(e)) return !0;
491
- for (let t of e) if (await G(await W(r[1], t))) return !1;
490
+ let e = await K(r[0], t);
491
+ if (!H(e)) return !0;
492
+ for (let t of e) if (await q(await K(r[1], t))) return !1;
492
493
  return !0;
493
494
  }
494
495
  case "catch": try {
495
- return await W(r[0], t);
496
+ return await K(r[0], t);
496
497
  } catch (e) {
497
- return Oe(e) ? await W(e, t) : r[1] ? await W(r[1], e) : e instanceof Error ? e.message : e;
498
+ return Ee(e) ? await K(e, t) : r[1] ? await K(r[1], e) : e instanceof Error ? e.message : e;
498
499
  }
499
500
  }
500
- let i = await Promise.all(r.map((e) => W(e, t))), a = n ? ke[n] : void 0;
501
+ let i = await Promise.all(r.map((e) => K(e, t))), a = n ? De[n] : void 0;
501
502
  if (!a) throw Error(`Unrecognized operation ${n}`);
502
503
  return a.apply(t, i);
503
504
  }
504
- async function G(e) {
505
- return De(e) ? G(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
505
+ async function q(e) {
506
+ return U(e) ? q(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
506
507
  }
507
- function Ae(e) {
508
+ function Oe(e) {
508
509
  return Object.keys(e)[0];
509
510
  }
510
511
  //#endregion
511
512
  //#region src/lifecycle/rules-logic.ts
512
- function je(e, t, n) {
513
+ function ke(e, t, n) {
513
514
  return new Proxy(Object.create(null), { get(r, i) {
514
515
  if (typeof i != "string") return;
515
516
  let a = e.find((e) => e.key === i);
516
- if (a !== void 0) return async () => n.has(i) ? !1 : await W(a.logic, {
517
+ if (a !== void 0) return async () => !n.has(i) && await K(a.logic, {
517
518
  ...t,
518
- conditions: je(e, t, new Set(n).add(i))
519
+ conditions: ke(e, t, new Set(n).add(i))
519
520
  }) === !0;
520
521
  } });
521
522
  }
522
- var Me = L(({ client: e }) => k({
523
+ var Ae = L(({ client: e }) => k({
523
524
  source: {
524
525
  stateSnapshot: e.stateSnapshotStore,
525
526
  predicates: e.predicates.listStore,
@@ -556,21 +557,21 @@ var Me = L(({ client: e }) => k({
556
557
  features: u,
557
558
  ...s
558
559
  };
559
- return await W(o, {
560
+ return await K(o, {
560
561
  ...d,
561
- conditions: je(a, d, /* @__PURE__ */ new Set())
562
+ conditions: ke(a, d, /* @__PURE__ */ new Set())
562
563
  });
563
564
  }
564
565
  }));
565
- function Ne(e) {
566
- return R(Me, e);
566
+ function je(e) {
567
+ return R(Ae, e);
567
568
  }
568
569
  //#endregion
569
570
  //#region src/ping.ts
570
- var Pe = 6e3, Fe = O("last_ping", "global"), Ie = async (e) => {
571
+ var Me = 6e3, Ne = O("last_ping", "global"), Pe = async (e) => {
571
572
  try {
572
- let t = Date.now(), n = E.get(Fe), r = 0;
573
- if (n.isSet() && (r = n.json() ?? 0), r && t - r < Pe) return !0;
573
+ let t = Date.now(), n = E.get(Ne), r = 0;
574
+ if (n.isSet() && (r = n.json() ?? 0), r && t - r < Me) return !0;
574
575
  let i = {
575
576
  projectId: e.projectId,
576
577
  path: window.location.pathname
@@ -581,23 +582,23 @@ var Pe = 6e3, Fe = O("last_ping", "global"), Ie = async (e) => {
581
582
  } catch {
582
583
  return !1;
583
584
  }
584
- }, K = M("lifecycle"), Le = L(({ client: e }) => {
585
- let t = K.store(!1), r = F(void 0, {
585
+ }, J = M("lifecycle"), Fe = L(({ client: e }) => {
586
+ let t = J.store(!1), r = F(void 0, {
586
587
  skipVoid: !1,
587
- domain: K
588
+ domain: J
588
589
  }), i = F(void 0, {
589
590
  skipVoid: !1,
590
- domain: K
591
- }), a = K.store("idle"), o = K.store([]), s = F(void 0, {
591
+ domain: J
592
+ }), a = J.store("idle"), o = J.store([]), s = F(void 0, {
592
593
  skipVoid: !1,
593
- domain: K
594
+ domain: J
594
595
  }), l = F(void 0, {
595
596
  skipVoid: !1,
596
- domain: K
597
+ domain: J
597
598
  }), u = P(), d = P(), f = P(), p = P(), m = P(), h = P();
598
599
  o.on(p, (e, t) => [...e, t]), s.on(m, (e, t) => t), l.on(h, (e, t) => t), t.on(d, () => !0);
599
600
  let g = N(() => {
600
- Ie(e);
601
+ Pe(e);
601
602
  }), _ = N(async () => {
602
603
  await ee();
603
604
  }), v = N(async () => {
@@ -670,19 +671,23 @@ var Pe = 6e3, Fe = O("last_ping", "global"), Ie = async (e) => {
670
671
  target: e.eventBus
671
672
  });
672
673
  let w = F(!1).on(_.done, () => !0), T = F(!1).on(f, () => !0), E = F(!1).on(y.done, () => !0), D = A(r, i, (e, t) => e === !0 && t === !0);
673
- return I({
674
+ I({
674
675
  clock: f,
675
676
  source: D,
676
677
  filter: (e) => e,
677
678
  fn: () => void 0,
678
679
  target: v
679
- }), I({
680
- clock: A(w, T, D, (e, t, n) => e && t && n),
680
+ });
681
+ let O = A(w, T, D, (e, t, n) => e && t && n);
682
+ I({
683
+ clock: O,
681
684
  filter: (e) => e,
682
685
  fn: () => void 0,
683
686
  target: y
684
- }), I({
685
- clock: A(w, T, D, E, (e, t, n, r) => e && t && (!n || r)),
687
+ });
688
+ let te = A(w, T, D, E, (e, t, n, r) => e && t && (!n || r));
689
+ return I({
690
+ clock: te,
686
691
  filter: (e) => e,
687
692
  fn: () => void 0,
688
693
  target: d
@@ -726,13 +731,13 @@ var Pe = 6e3, Fe = O("last_ping", "global"), Ie = async (e) => {
726
731
  setCondition: h
727
732
  };
728
733
  });
729
- function Re(e) {
730
- return R(Le, e);
734
+ function Ie(e) {
735
+ return R(Fe, e);
731
736
  }
732
737
  //#endregion
733
738
  //#region src/entities/predicate/predicate.ts
734
- var ze = M("predicate"), Be = L(({ client: e }) => {
735
- let t = ze.store({}), n = j(t, { register(e, t) {
739
+ var Le = M("predicate"), Re = L(({ client: e }) => {
740
+ let t = Le.store({}), n = j(t, { register(e, t) {
736
741
  return {
737
742
  ...e,
738
743
  [t.name]: {
@@ -790,20 +795,23 @@ var ze = M("predicate"), Be = L(({ client: e }) => {
790
795
  getEvokablePredicate: s
791
796
  };
792
797
  });
793
- function Ve(e) {
794
- return R(Be, e);
798
+ function ze(e) {
799
+ return R(Re, e);
795
800
  }
796
- var He = (e, t, n) => {
801
+ var Be = (e, t, n) => {
797
802
  n.register({
798
803
  name: e,
799
804
  predicate: t
800
805
  });
801
- }, Ue = M("feature");
802
- function q(e) {
806
+ }, Ve = M("feature");
807
+ function Y(e) {
803
808
  return e?.enabled === !1;
804
809
  }
805
- var We = L(({ client: e }) => {
806
- let t = Ue.store({}), n = Ue.store([]), i = j(t, { register(e, t) {
810
+ function He(e) {
811
+ return e === "true" || e !== "false" && e;
812
+ }
813
+ var Ue = L(({ client: e }) => {
814
+ let t = Ve.store({}), n = Ve.store([]), i = j(t, { register(e, t) {
807
815
  return {
808
816
  ...e,
809
817
  [t.id]: t.feature
@@ -830,13 +838,13 @@ var We = L(({ client: e }) => {
830
838
  });
831
839
  let o = N(async ({ id: e, key: t, storage: n = "local", enabled: r }) => {
832
840
  if (r === !1) return null;
833
- let i = O(`feature:${e}:${t}`, "global"), a = (n === "session" ? D : E).get(i).boolean();
834
- return a === null ? null : {
841
+ let i = O(`feature:${e}:${t}`, "global"), a = (n === "session" ? D : E).get(i).text();
842
+ return a ? {
835
843
  id: e,
836
844
  key: t,
837
- bucket: a,
845
+ bucket: He(a),
838
846
  storage: n
839
- };
847
+ } : null;
840
848
  }), s = N((e) => {
841
849
  if (!e) return null;
842
850
  let t = O(`feature:${e.id}:${e.key}`, "global");
@@ -851,7 +859,7 @@ var We = L(({ client: e }) => {
851
859
  if (a) return a;
852
860
  let o = e[n];
853
861
  if (!o) throw Error(`Feature with id '${n}' not found`);
854
- if (q(o.feature)) return {
862
+ if (Y(o.feature)) return {
855
863
  id: o.id,
856
864
  bucket: !1,
857
865
  key: i,
@@ -893,7 +901,7 @@ var We = L(({ client: e }) => {
893
901
  }), I({
894
902
  source: t,
895
903
  clock: l.doneData,
896
- filter: (e, t) => !q(e[t.id]?.feature),
904
+ filter: (e, t) => !Y(e[t.id]?.feature),
897
905
  fn: (e, t) => {
898
906
  let { id: n, bucket: r, storage: i } = t, a = e[n]?.feature.key;
899
907
  return a ? {
@@ -937,7 +945,7 @@ var We = L(({ client: e }) => {
937
945
  resolvedFeatures: n,
938
946
  allFeatures: t
939
947
  },
940
- filter: ({ resolvedFeatures: e, allFeatures: t }, { id: n, key: r }) => q(t[n]?.feature) ? !1 : !e.some((e) => e.id === n && e.key === r),
948
+ filter: ({ resolvedFeatures: e, allFeatures: t }, { id: n, key: r }) => !Y(t[n]?.feature) && !e.some((e) => e.id === n && e.key === r),
941
949
  fn: (e, t) => t,
942
950
  target: e.eventBus.prepend((e) => ({
943
951
  type: "feature_decide",
@@ -949,7 +957,7 @@ var We = L(({ client: e }) => {
949
957
  resolvedFeatures: n,
950
958
  allFeatures: t
951
959
  },
952
- fn: ({ resolvedFeatures: e, allFeatures: t }, n) => !n || q(t[n.id]?.feature) || e.some((e) => e.id === n.id && e.key === n.key) ? e : [...e, n],
960
+ fn: ({ resolvedFeatures: e, allFeatures: t }, n) => !n || Y(t[n.id]?.feature) || e.some((e) => e.id === n.id && e.key === n.key) ? e : [...e, n],
953
961
  target: n
954
962
  });
955
963
  function d(e) {
@@ -983,16 +991,16 @@ var We = L(({ client: e }) => {
983
991
  getEvokableFeature: p
984
992
  };
985
993
  });
986
- function Ge(e) {
987
- return R(We, e);
994
+ function We(e) {
995
+ return R(Ue, e);
988
996
  }
989
- var Ke = (e, t, n) => {
997
+ var Ge = (e, t, n) => {
990
998
  n.register({
991
999
  id: e,
992
1000
  feature: t
993
1001
  });
994
- }, J = M("history");
995
- function qe(e, t) {
1002
+ }, X = M("history");
1003
+ function Ke(e, t) {
996
1004
  return {
997
1005
  id: re(`history-entry-${Date.now()}-${Math.random()}}`),
998
1006
  node: t,
@@ -1000,9 +1008,9 @@ function qe(e, t) {
1000
1008
  experienceId: e
1001
1009
  };
1002
1010
  }
1003
- var Je = L(() => {
1004
- let e = J.store({ entries: [] }), t = J.event(), n = J.event(), r = J.event(), i = J.event();
1005
- e.on(t, (e, t) => ({ entries: [...e.entries, qe(t.experienceId, t.node)] })), e.on(n, (e, t) => ({ entries: [...e.entries.slice(0, -1), qe(t.experienceId, t.node)] })), e.on(i, (e, t) => t);
1011
+ var qe = L(() => {
1012
+ let e = X.store({ entries: [] }), t = X.event(), n = X.event(), r = X.event(), i = X.event();
1013
+ e.on(t, (e, t) => ({ entries: [...e.entries, Ke(t.experienceId, t.node)] })), e.on(n, (e, t) => ({ entries: [...e.entries.slice(0, -1), Ke(t.experienceId, t.node)] })), e.on(i, (e, t) => t);
1006
1014
  function a(e, t) {
1007
1015
  let n = {
1008
1016
  lastStepIndex: -1,
@@ -1032,20 +1040,20 @@ var Je = L(() => {
1032
1040
  entriesStore: e.map((e) => e.entries)
1033
1041
  };
1034
1042
  });
1035
- function Ye() {
1036
- return R(Je);
1043
+ function Je() {
1044
+ return R(qe);
1037
1045
  }
1038
1046
  //#endregion
1039
1047
  //#region src/utils/events.ts
1040
- var Xe = 0, Ze = (e) => {
1048
+ var Ye = 0, Xe = (e) => {
1041
1049
  let t = F([]);
1042
1050
  return t.on(e, (e, t) => [...e, {
1043
- id: Xe++,
1051
+ id: Ye++,
1044
1052
  at: /* @__PURE__ */ new Date(),
1045
1053
  payload: t
1046
1054
  }]), t;
1047
- }, Qe = M("field"), $e = L(() => {
1048
- let e = Qe.store({}), t = j(e, {
1055
+ }, Ze = M("field"), Qe = L(() => {
1056
+ let e = Ze.store({}), t = j(e, {
1049
1057
  register(e, t) {
1050
1058
  return {
1051
1059
  ...e,
@@ -1093,13 +1101,13 @@ var Xe = 0, Ze = (e) => {
1093
1101
  getByName: c
1094
1102
  };
1095
1103
  });
1096
- function et() {
1097
- return R($e);
1104
+ function $e() {
1105
+ return R(Qe);
1098
1106
  }
1099
1107
  //#endregion
1100
1108
  //#region src/entities/step/step.ts
1101
- var tt = M("step"), nt = L(() => {
1102
- let e = tt.store({}), t = j(e, { register(e, t) {
1109
+ var et = M("step"), tt = L(() => {
1110
+ let e = et.store({}), t = j(e, { register(e, t) {
1103
1111
  return {
1104
1112
  ...e,
1105
1113
  [t.step.id]: t.step
@@ -1123,16 +1131,16 @@ var tt = M("step"), nt = L(() => {
1123
1131
  indexStore: e
1124
1132
  };
1125
1133
  });
1126
- function rt() {
1127
- return R(nt);
1134
+ function nt() {
1135
+ return R(tt);
1128
1136
  }
1129
- function it(e, t) {
1137
+ function rt(e, t) {
1130
1138
  t.register(e);
1131
1139
  }
1132
1140
  //#endregion
1133
1141
  //#region src/entities/content/content.ts
1134
- var at = M("content"), ot = L(() => {
1135
- let e = at.store({}), t = j(e, {
1142
+ var it = M("content"), at = L(() => {
1143
+ let e = it.store({}), t = j(e, {
1136
1144
  register(e, t) {
1137
1145
  return {
1138
1146
  ...e,
@@ -1173,16 +1181,16 @@ var at = M("content"), ot = L(() => {
1173
1181
  indexStore: e
1174
1182
  };
1175
1183
  });
1176
- function st() {
1177
- return R(ot);
1184
+ function ot() {
1185
+ return R(at);
1178
1186
  }
1179
- function ct(e, t) {
1187
+ function st(e, t) {
1180
1188
  t.register(e);
1181
1189
  }
1182
1190
  //#endregion
1183
1191
  //#region src/entities/action/action.ts
1184
- var lt = M("action"), ut = L(({ client: e }) => {
1185
- let t = lt.store({}), n = j(t, { register(e, t) {
1192
+ var ct = M("action"), lt = L(({ client: e }) => {
1193
+ let t = ct.store({}), n = j(t, { register(e, t) {
1186
1194
  return {
1187
1195
  ...e,
1188
1196
  [t.key]: {
@@ -1240,10 +1248,10 @@ var lt = M("action"), ut = L(({ client: e }) => {
1240
1248
  getEvokableAction: s
1241
1249
  };
1242
1250
  });
1243
- function dt(e) {
1244
- return R(ut, e);
1251
+ function ut(e) {
1252
+ return R(lt, e);
1245
1253
  }
1246
- var ft = (e, t, n) => {
1254
+ var dt = (e, t, n) => {
1247
1255
  n.register({
1248
1256
  key: e,
1249
1257
  action: t
@@ -1251,7 +1259,7 @@ var ft = (e, t, n) => {
1251
1259
  };
1252
1260
  //#endregion
1253
1261
  //#region src/entities/response/response-validation.ts
1254
- function Y(e, t, n, r) {
1262
+ function Z(e, t, n, r) {
1255
1263
  return {
1256
1264
  fieldKey: e.key,
1257
1265
  userMessage: n,
@@ -1259,62 +1267,62 @@ function Y(e, t, n, r) {
1259
1267
  value: t
1260
1268
  };
1261
1269
  }
1262
- function X(e) {
1270
+ function Q(e) {
1263
1271
  return e === null || e === "" || Array.isArray(e) && !e.length;
1264
1272
  }
1265
- function pt(e) {
1273
+ function ft(e) {
1266
1274
  return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
1267
1275
  }
1268
- function mt(e) {
1276
+ function pt(e) {
1269
1277
  try {
1270
1278
  return JSON.stringify(e), !0;
1271
1279
  } catch {
1272
1280
  return !1;
1273
1281
  }
1274
1282
  }
1275
- function ht(e, t) {
1283
+ function mt(e, t) {
1276
1284
  return t.find((t) => t.key === e) ?? null;
1277
1285
  }
1278
- function gt(e, t) {
1286
+ function ht(e, t) {
1279
1287
  return e.multiple && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") ? [t] : t;
1280
1288
  }
1281
- function _t(e, t) {
1282
- if (e.type !== "object" || X(t)) return null;
1289
+ function gt(e, t) {
1290
+ if (e.type !== "object" || Q(t)) return null;
1283
1291
  if (e.multiple) {
1284
- if (!Array.isArray(t)) return Y(e, t, "This field expects multiple values", "Field expects an array of objects.");
1292
+ if (!Array.isArray(t)) return Z(e, t, "This field expects multiple values", "Field expects an array of objects.");
1285
1293
  for (let n of t) {
1286
- if (typeof n != "object" || !n) return Y(e, t, "This field expects object values", "Field expects an array of objects, but received non-object value.");
1287
- if (!mt(n)) return Y(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1294
+ if (typeof n != "object" || !n) return Z(e, t, "This field expects object values", "Field expects an array of objects, but received non-object value.");
1295
+ if (!pt(n)) return Z(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1288
1296
  }
1289
1297
  return null;
1290
1298
  }
1291
- return Array.isArray(t) ? Y(e, t, "This field expects a single value", "Field expects a single object, not an array.") : typeof t != "object" || !t ? Y(e, t, "This field expects an object value", "Field expects an object value.") : mt(t) ? null : Y(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1299
+ return Array.isArray(t) ? Z(e, t, "This field expects a single value", "Field expects a single object, not an array.") : typeof t != "object" || !t ? Z(e, t, "This field expects an object value", "Field expects an object value.") : pt(t) ? null : Z(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1292
1300
  }
1293
- function vt(e, t) {
1294
- if (X(t) || !Array.isArray(e.options) || e.options.length === 0) return null;
1301
+ function _t(e, t) {
1302
+ if (Q(t) || !Array.isArray(e.options) || e.options.length === 0) return null;
1295
1303
  let n = Array.isArray(t) ? t : [t];
1296
1304
  if (e.type === "object") {
1297
1305
  let r = new Set(e.options.map((e) => JSON.stringify(e.value)));
1298
- return n.every((e) => r.has(JSON.stringify(e))) ? null : Y(e, t, "This field expects a valid option", "Field expects a valid option from the defined choices.");
1306
+ return n.every((e) => r.has(JSON.stringify(e))) ? null : Z(e, t, "This field expects a valid option", "Field expects a valid option from the defined choices.");
1299
1307
  }
1300
1308
  let r = e.options.map((e) => e.value);
1301
- return n.every((e) => !pt(e) || e === null ? !1 : r.includes(e)) ? null : Y(e, t, "This field expects a valid option", `Field expects a valid option. Valid options are: ${r.join(", ")}`);
1309
+ return n.every((e) => !ft(e) || e === null ? !1 : r.includes(e)) ? null : Z(e, t, "This field expects a valid option", `Field expects a valid option. Valid options are: ${r.join(", ")}`);
1302
1310
  }
1303
- async function yt(t, n, r, i) {
1304
- if (n.validation && !e(n.validation) && !X(r)) {
1311
+ async function vt(t, n, r, i) {
1312
+ if (n.validation && !e(n.validation) && !Q(r)) {
1305
1313
  let e = i ? {
1306
1314
  $input: r,
1307
1315
  responses: i
1308
1316
  } : { $input: r }, a = await t(n.validation, e);
1309
- if (typeof a == "string") return Y(n, r, a, `Field validation resulted in an error: ${a}.`);
1310
- if (a === !1) return Y(n, r, "This field is invalid", "Field validation resulted in an unspecified error.");
1317
+ if (typeof a == "string") return Z(n, r, a, `Field validation resulted in an error: ${a}.`);
1318
+ if (a === !1) return Z(n, r, "This field is invalid", "Field validation resulted in an unspecified error.");
1311
1319
  }
1312
- return n.required && X(r) ? Y(n, r, "This field is required", "Field is required.") : !n.multiple && Array.isArray(r) && r.length > 1 ? Y(n, r, "This field expects a single response", "Field expects a single response.") : null;
1320
+ return n.required && Q(r) ? Z(n, r, "This field is required", "Field is required.") : !n.multiple && Array.isArray(r) && r.length > 1 ? Z(n, r, "This field expects a single response", "Field expects a single response.") : null;
1313
1321
  }
1314
1322
  //#endregion
1315
1323
  //#region src/entities/response/response.ts
1316
- var bt = M("response"), xt = L(({ client: e }) => {
1317
- let t = bt.store({}), r = P(), i = P(), a = j(t, {
1324
+ var yt = M("response"), bt = L(({ client: e }) => {
1325
+ let t = yt.store({}), r = P(), i = P(), a = j(t, {
1318
1326
  register(e, t) {
1319
1327
  return {
1320
1328
  ...e,
@@ -1353,7 +1361,7 @@ var bt = M("response"), xt = L(({ client: e }) => {
1353
1361
  ...t,
1354
1362
  ...n
1355
1363
  }, o = Object.entries(n), c = await Promise.allSettled(o.map(async ([t, n]) => {
1356
- let o = ht(t, e);
1364
+ let o = mt(t, e);
1357
1365
  if (!o) {
1358
1366
  r.push({
1359
1367
  fieldKey: t,
@@ -1363,17 +1371,17 @@ var bt = M("response"), xt = L(({ client: e }) => {
1363
1371
  });
1364
1372
  return;
1365
1373
  }
1366
- let c = gt(o, n), l = await yt(s, o, c, a);
1374
+ let c = ht(o, n), l = await vt(s, o, c, a);
1367
1375
  if (l) {
1368
1376
  r.push(l);
1369
1377
  return;
1370
1378
  }
1371
- let u = _t(o, c);
1379
+ let u = gt(o, c);
1372
1380
  if (u) {
1373
1381
  r.push(u);
1374
1382
  return;
1375
1383
  }
1376
- let d = vt(o, c);
1384
+ let d = _t(o, c);
1377
1385
  if (d) {
1378
1386
  r.push(d);
1379
1387
  return;
@@ -1452,13 +1460,13 @@ var bt = M("response"), xt = L(({ client: e }) => {
1452
1460
  getByFieldName: _
1453
1461
  };
1454
1462
  });
1455
- function St(e) {
1456
- return R(xt, e);
1463
+ function xt(e) {
1464
+ return R(bt, e);
1457
1465
  }
1458
1466
  //#endregion
1459
1467
  //#region src/entities/condition/condition.ts
1460
- var Ct = M("condition"), wt = L(() => {
1461
- let e = Ct.store({}), t = j(e, { register(e, t) {
1468
+ var St = M("condition"), Ct = L(() => {
1469
+ let e = St.store({}), t = j(e, { register(e, t) {
1462
1470
  return {
1463
1471
  ...e,
1464
1472
  [t.condition.id]: t.condition
@@ -1482,12 +1490,12 @@ var Ct = M("condition"), wt = L(() => {
1482
1490
  indexStore: e
1483
1491
  };
1484
1492
  });
1485
- function Tt() {
1486
- return R(wt);
1493
+ function wt() {
1494
+ return R(Ct);
1487
1495
  }
1488
1496
  //#endregion
1489
1497
  //#region src/utils/api-url.ts
1490
- function Et() {
1498
+ function Tt() {
1491
1499
  if (c()) {
1492
1500
  let e = [
1493
1501
  document.currentScript,
@@ -1502,7 +1510,7 @@ function Et() {
1502
1510
  }
1503
1511
  //#endregion
1504
1512
  //#region src/utils/search-params.ts
1505
- function Dt() {
1513
+ function Et() {
1506
1514
  if (!s()) return {};
1507
1515
  let e = new URLSearchParams(window.location.search), t = {}, n = /* @__PURE__ */ new Set();
1508
1516
  for (let [t] of e.entries()) t.startsWith("picked-") && n.add(t);
@@ -1520,13 +1528,13 @@ function Dt() {
1520
1528
  }
1521
1529
  //#endregion
1522
1530
  //#region src/entities/session/session.ts
1523
- var Ot = O("session", "global");
1524
- function kt() {
1531
+ var Dt = O("session", "global");
1532
+ function Ot() {
1525
1533
  return p() ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).substring(2, 15)}-${Math.random().toString(36).substring(2, 15)}-${Math.random().toString(36).substring(2, 15)}`;
1526
1534
  }
1527
- function At() {
1535
+ function kt() {
1528
1536
  if (!m()) return null;
1529
- let e = E.get(Ot);
1537
+ let e = E.get(Dt);
1530
1538
  if (!e.isSet()) return null;
1531
1539
  try {
1532
1540
  return e.json();
@@ -1534,8 +1542,8 @@ function At() {
1534
1542
  return null;
1535
1543
  }
1536
1544
  }
1537
- var jt = L(() => {
1538
- let e = At(), t = { id: e?.id ?? kt() };
1545
+ var At = L(() => {
1546
+ let e = kt(), t = { id: e?.id ?? Ot() };
1539
1547
  e?.isUser !== void 0 && (t.isUser = e.isUser), e?.identifiers && Object.keys(e.identifiers).length > 0 && (t.identifiers = e.identifiers);
1540
1548
  let n = F(t), r = j(n, {
1541
1549
  setIsUser: (e, t) => ({
@@ -1557,17 +1565,17 @@ var jt = L(() => {
1557
1565
  let i = { id: e.id };
1558
1566
  return e.isUser !== void 0 && (i.isUser = e.isUser), Object.keys(r).length > 0 && (i.identifiers = r), i;
1559
1567
  }
1568
+ }), i = k({
1569
+ source: n,
1570
+ effect: (e) => {
1571
+ if (m()) try {
1572
+ E.get(Dt).set(e);
1573
+ } catch {}
1574
+ }
1560
1575
  });
1561
1576
  return I({
1562
1577
  source: n,
1563
- target: k({
1564
- source: n,
1565
- effect: (e) => {
1566
- if (m()) try {
1567
- E.get(Ot).set(e);
1568
- } catch {}
1569
- }
1570
- })
1578
+ target: i
1571
1579
  }), {
1572
1580
  store: n,
1573
1581
  setIsUser: r.setIsUser,
@@ -1575,39 +1583,39 @@ var jt = L(() => {
1575
1583
  removeIdentifier: r.removeIdentifier
1576
1584
  };
1577
1585
  });
1578
- function Mt() {
1579
- return R(jt, void 0);
1586
+ function jt() {
1587
+ return R(At, void 0);
1580
1588
  }
1581
1589
  //#endregion
1582
1590
  //#region src/utils/picked-config.ts
1583
- function Nt() {
1591
+ function Mt() {
1584
1592
  if (s()) return globalThis.window.pickedConfig;
1585
1593
  }
1586
- function Pt() {
1587
- if (s()) return Nt()?.projectId;
1594
+ function Nt() {
1595
+ if (s()) return Mt()?.projectId;
1588
1596
  }
1589
- function Ft() {
1597
+ function Pt() {
1590
1598
  if (!c()) return;
1591
1599
  let e = document.getElementById("picked_script") || document.querySelector("script#picked") || document.getElementById("cvly");
1592
1600
  if (e) return e.dataset.projectid || e.getAttribute("project-id") || void 0;
1593
1601
  }
1594
- function It(e) {
1602
+ function Ft(e) {
1595
1603
  if (e.projectId) return e.projectId;
1596
- let t = Pt();
1604
+ let t = Nt();
1597
1605
  if (t) return t;
1598
- let n = Ft();
1606
+ let n = Pt();
1599
1607
  if (n) return n;
1600
1608
  throw Error("projectId is required. You can provide it via one of:\n (1) createClient({ projectId }) options;\n (2) window.pickedConfig = { projectId };\n (3) a <script> tag with id 'picked_script', 'picked', or 'cvly' that includes a data-projectid (or project-id) attribute.");
1601
1609
  }
1602
1610
  //#endregion
1603
1611
  //#region src/utils/render-string.ts
1604
- function Z(e) {
1612
+ function $(e) {
1605
1613
  return e == null || e === "" || Number.isNaN(e);
1606
1614
  }
1607
- var Lt = {
1608
- default: (e, t) => Z(e) ? String(t ?? "") : String(e),
1609
- append: (e, t) => t && !Z(e) ? `${e} ${t}` : e,
1610
- prepend: (e, t) => t && !Z(e) ? `${t} ${e}` : e,
1615
+ var It = {
1616
+ default: (e, t) => $(e) ? String(t ?? "") : String(e),
1617
+ append: (e, t) => t && !$(e) ? `${e} ${t}` : e,
1618
+ prepend: (e, t) => t && !$(e) ? `${t} ${e}` : e,
1611
1619
  upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
1612
1620
  lower: (e) => typeof e == "string" ? e.toLowerCase() : e,
1613
1621
  capitalize: (e) => typeof e == "string" ? e.charAt(0).toUpperCase() + e.slice(1) : e,
@@ -1625,24 +1633,24 @@ var Lt = {
1625
1633
  return e instanceof Set ? t.format(Array.from(e).map(String)) : e;
1626
1634
  }
1627
1635
  };
1628
- function Rt(e) {
1636
+ function Lt(e) {
1629
1637
  return typeof e == "object" && !!e;
1630
1638
  }
1631
- function zt(e, t) {
1639
+ function Rt(e, t) {
1632
1640
  let n = t;
1633
- for (let t of e.split(".")) if (Rt(n) && t in n) n = n[t];
1641
+ for (let t of e.split(".")) if (Lt(n) && t in n) n = n[t];
1634
1642
  else return;
1635
1643
  return typeof n == "function" ? n() : n;
1636
1644
  }
1637
- function Bt(e, t) {
1638
- let n = e.split("|").map((e) => e.trim()), r = zt(n.shift() ?? "", t);
1645
+ function zt(e, t) {
1646
+ let n = e.split("|").map((e) => e.trim()), r = Rt(n.shift() ?? "", t);
1639
1647
  for (let e of n) {
1640
- let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o = Lt[i];
1648
+ let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o = It[i];
1641
1649
  o && (r = o(r, a));
1642
1650
  }
1643
- return Z(r) ? "" : typeof r == "object" ? JSON.stringify(r) : String(r);
1651
+ return $(r) ? "" : typeof r == "object" ? JSON.stringify(r) : String(r);
1644
1652
  }
1645
- function Vt(e, t) {
1653
+ function Bt(e, t) {
1646
1654
  let n = "", r = 0;
1647
1655
  for (; r < e.length;) if (e[r] === "{" && e[r + 1] === "{") {
1648
1656
  r += 2;
@@ -1654,15 +1662,15 @@ function Vt(e, t) {
1654
1662
  }
1655
1663
  i += e[r++];
1656
1664
  }
1657
- n += Bt(i.trim(), t);
1665
+ n += zt(i.trim(), t);
1658
1666
  } else n += e[r++];
1659
1667
  return n;
1660
1668
  }
1661
1669
  //#endregion
1662
1670
  //#region src/utils/preview-session.ts
1663
- var Q = "preview-token";
1671
+ var Vt = "preview-token";
1664
1672
  function Ht() {
1665
- return !s() || !h() ? !1 : !!Dt()[Q]?.[0];
1673
+ return !s() || !h() ? !1 : !!Et()[Vt]?.[0];
1666
1674
  }
1667
1675
  //#endregion
1668
1676
  //#region src/picked.ts
@@ -1679,55 +1687,55 @@ var Ut = class {
1679
1687
  apiUrl;
1680
1688
  dashboardUrl;
1681
1689
  documentationSiteUrl;
1682
- session = Mt();
1683
- searchParams = Dt();
1684
- history = Ye();
1690
+ session = jt();
1691
+ searchParams = Et();
1692
+ history = Je();
1685
1693
  components = ve({ client: this });
1686
1694
  experienceInstances = S({ client: this });
1687
1695
  experiences = ue({ client: this });
1688
- frameworks = Se({ client: this });
1689
- predicates = Ve({ client: this });
1690
- features = Ge({ client: this });
1691
- conditions = Tt();
1692
- fields = et();
1693
- responses = St({ client: this });
1694
- steps = rt();
1695
- contents = st();
1696
- actions = dt({ client: this });
1696
+ frameworks = xe({ client: this });
1697
+ predicates = ze({ client: this });
1698
+ features = We({ client: this });
1699
+ conditions = wt();
1700
+ fields = $e();
1701
+ responses = xt({ client: this });
1702
+ steps = nt();
1703
+ contents = ot();
1704
+ actions = ut({ client: this });
1697
1705
  conditionResults = C();
1698
- stateSnapshotStore = Te({ client: this });
1699
- evaluateRuleLogicFx = Ne({ client: this });
1706
+ stateSnapshotStore = we({ client: this });
1707
+ evaluateRuleLogicFx = je({ client: this });
1700
1708
  start;
1701
1709
  readyStore;
1702
1710
  preconditionPassedStore;
1703
1711
  conditionPassedStore;
1704
1712
  lifecycleStageStore;
1705
- lifecycle = Re({ client: this });
1713
+ lifecycle = Ie({ client: this });
1706
1714
  renderStringFx = k({
1707
1715
  source: this.responses.listStore,
1708
1716
  effect: (e, { template: t, context: n }) => {
1709
1717
  let r = {};
1710
1718
  for (let t of e) r[t.fieldKey] = t.value;
1711
- return Vt(t, {
1719
+ return Bt(t, {
1712
1720
  ...n,
1713
1721
  responses: r
1714
1722
  });
1715
1723
  }
1716
1724
  });
1717
1725
  constructor(e) {
1718
- this.events = Ze(this.eventBus), this.projectId = It(e), this.options = Object.freeze(e), this.apiUrl = e.apiUrl || Et(), this.dashboardUrl = e.dashboardUrl ?? "https://dashboard.picked.app", this.documentationSiteUrl = e.documentationSiteUrl ?? "https://docs.picked.app", this.start = this.lifecycle.start, this.readyStore = this.lifecycle.readyStore, this.preconditionPassedStore = this.lifecycle.preconditionPassedStore, this.conditionPassedStore = this.lifecycle.conditionPassedStore, this.lifecycleStageStore = this.lifecycle.lifecycleStageStore, this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.setupComponents(), this.lifecycle.setPrecondition(e.precondition), this.lifecycle.setCondition(e.condition), this.eventBus({
1726
+ this.events = Xe(this.eventBus), this.projectId = Ft(e), this.options = Object.freeze(e), this.apiUrl = e.apiUrl || Tt(), this.dashboardUrl = e.dashboardUrl ?? "https://dashboard.picked.app", this.documentationSiteUrl = e.documentationSiteUrl ?? "https://docs.picked.app", this.start = this.lifecycle.start, this.readyStore = this.lifecycle.readyStore, this.preconditionPassedStore = this.lifecycle.preconditionPassedStore, this.conditionPassedStore = this.lifecycle.conditionPassedStore, this.lifecycleStageStore = this.lifecycle.lifecycleStageStore, this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.setupComponents(), this.lifecycle.setPrecondition(e.precondition), this.lifecycle.setCondition(e.condition), this.eventBus({
1719
1727
  type: "load",
1720
1728
  version: ne()
1721
1729
  }), this.maybeStartPreviewChannel();
1722
1730
  }
1723
1731
  maybeStartPreviewChannel() {
1724
- Ht() && import("../preview-channel-DW9J8t4B.js").then((e) => e.initPreviewChannel(this)).catch(() => void 0);
1732
+ Ht() && import("../preview-channel-CSr96XAo.js").then((e) => e.initPreviewChannel(this)).catch(() => void 0);
1725
1733
  }
1726
1734
  registerFramework = (e) => {
1727
- Ce(e, this.frameworks);
1735
+ Se(e, this.frameworks);
1728
1736
  };
1729
1737
  registerComponent = (e, t) => {
1730
- ye(e, t, this.components);
1738
+ B(e, t, this.components);
1731
1739
  };
1732
1740
  registerPlugin = (e) => {
1733
1741
  pe(this, e, this.plugins);
@@ -1735,10 +1743,10 @@ var Ut = class {
1735
1743
  t?.onStart && this.lifecycle.registerPluginStartHook(t.onStart);
1736
1744
  };
1737
1745
  registerFeature = (e, t) => {
1738
- Ke(e, t, this.features);
1746
+ Ge(e, t, this.features);
1739
1747
  };
1740
1748
  registerPredicate = (e, t) => {
1741
- He(e, t, this.predicates);
1749
+ Be(e, t, this.predicates);
1742
1750
  };
1743
1751
  registerCondition = (e) => {
1744
1752
  this.conditions.register(e);
@@ -1747,19 +1755,19 @@ var Ut = class {
1747
1755
  this.fields.register(e);
1748
1756
  };
1749
1757
  registerStep = (e) => {
1750
- it(e, this.steps);
1758
+ rt(e, this.steps);
1751
1759
  };
1752
1760
  registerContent = (e) => {
1753
- ct(e, this.contents);
1761
+ st(e, this.contents);
1754
1762
  };
1755
1763
  patchContent = (e, t) => {
1756
1764
  this.contents.patch(e, t);
1757
1765
  };
1758
1766
  registerAction = (e, t) => {
1759
- ft(e, t, this.actions);
1767
+ dt(e, t, this.actions);
1760
1768
  };
1761
1769
  registerExperience = (e) => {
1762
- e.component && ye(`experience:${e.id}`, e.component, this.components), this.experiences.register(e);
1770
+ e.component && B(`experience:${e.id}`, e.component, this.components), this.experiences.register(e);
1763
1771
  };
1764
1772
  launchExperienceById = async (e, t) => {
1765
1773
  this.experiences.launch({
@@ -1804,8 +1812,8 @@ var Ut = class {
1804
1812
  try {
1805
1813
  let [t, n] = e.split(":");
1806
1814
  if (!t || !n) return;
1807
- let r = n;
1808
- r === "true" && (r = !0), r === "false" && (r = !1), this.registerFeature(t, {
1815
+ let r = He(n);
1816
+ this.registerFeature(t, {
1809
1817
  key: `${r}`,
1810
1818
  name: t,
1811
1819
  decide: () => r,
@@ -1842,14 +1850,14 @@ var Ut = class {
1842
1850
  }
1843
1851
  getPluginConfig = (e) => this.plugins[e] ?? {};
1844
1852
  }, Wt = "application/picked-javascript", Gt = "application/picked-module", Kt = "data-picked-hydrated";
1845
- async function $(e) {
1853
+ async function qt(e) {
1846
1854
  if (!("document" in globalThis)) return;
1847
1855
  let t = "application/picked-module", n = "data-picked-hydrated";
1848
1856
  function r(e) {
1849
1857
  try {
1850
1858
  Function(e.textContent);
1851
1859
  } catch (t) {
1852
- return t instanceof SyntaxError ? (console.error("[picked] Skipped a rehydrated inline script that failed to parse.", t), e.setAttribute(n, ""), !0) : !1;
1860
+ return t instanceof SyntaxError && (console.error("[picked] Skipped a rehydrated inline script that failed to parse.", t), e.setAttribute(n, ""), !0);
1853
1861
  }
1854
1862
  return !1;
1855
1863
  }
@@ -1871,30 +1879,30 @@ async function $(e) {
1871
1879
  a && await a;
1872
1880
  }
1873
1881
  }
1874
- function qt() {
1875
- return `<script>(${$.toString()})(document)<\/script>`;
1882
+ function Jt() {
1883
+ return `<script>(${qt.toString()})(document)<\/script>`;
1876
1884
  }
1877
1885
  //#endregion
1878
1886
  //#region src/utils/html-asset-value.ts
1879
- function Jt(e) {
1887
+ function Yt(e) {
1880
1888
  return typeof e == "object" && !!e && "id" in e && typeof e.id == "string" && "content" in e && (typeof e.content == "string" || e.content === null);
1881
1889
  }
1882
1890
  //#endregion
1883
1891
  //#region src/entities/component/lazyComponent.ts
1884
- function Yt(e) {
1892
+ function Xt(e) {
1885
1893
  return {
1886
1894
  $$type: "lazy-component",
1887
1895
  load: e
1888
1896
  };
1889
1897
  }
1890
- function Xt(e) {
1898
+ function Zt(e) {
1891
1899
  return typeof e == "object" && !!e && "$$type" in e && e.$$type === "lazy-component";
1892
1900
  }
1893
1901
  //#endregion
1894
1902
  //#region src/exports.ts
1895
- var Zt = (e) => {
1903
+ var Qt = (e) => {
1896
1904
  let t = new Ut(e);
1897
1905
  return u(t), t;
1898
1906
  };
1899
1907
  //#endregion
1900
- export { Kt as PICKED_HYDRATED_ATTR, Gt as PICKED_MODULE_SCRIPT_TYPE, Wt as PICKED_SCRIPT_TYPE, Q as PREVIEW_TOKEN_PARAM, Ut as Picked, qt as buildRehydrateBootstrap, Zt as createClient, fe as createPluginEffect, O as createStorageKey, n as evaluateRuleLogic, Nt as getPickedConfig, Jt as isHtmlAssetValue, h as isInsideIframe, Xt as isLazyLoader, _ as isPickedRoot, Ht as isPreviewSession, Yt as lazyComponent, E as localStore, oe as onInertScriptSubtrees, $ as rehydrateScripts, ie as reportInertScriptSubtrees, ae as resetInertScriptReport, D as sessionStore, T as subscribe, d as supportsCookies, p as supportsCryptoRandomUUID, c as supportsDocument, i as supportsHistory, f as supportsIntersectionObserver, m as supportsLocalStorage, a as supportsLocation, l as supportsSessionStorage, g as supportsShadowRoot, o as supportsWebComponents, s as supportsWindow };
1908
+ export { Kt as PICKED_HYDRATED_ATTR, Gt as PICKED_MODULE_SCRIPT_TYPE, Wt as PICKED_SCRIPT_TYPE, Vt as PREVIEW_TOKEN_PARAM, Ut as Picked, Jt as buildRehydrateBootstrap, Qt as createClient, fe as createPluginEffect, O as createStorageKey, n as evaluateRuleLogic, Mt as getPickedConfig, Yt as isHtmlAssetValue, h as isInsideIframe, Zt as isLazyLoader, _ as isPickedRoot, Ht as isPreviewSession, Xt as lazyComponent, E as localStore, oe as onInertScriptSubtrees, qt as rehydrateScripts, ie as reportInertScriptSubtrees, ae as resetInertScriptReport, D as sessionStore, T as subscribe, d as supportsCookies, p as supportsCryptoRandomUUID, c as supportsDocument, i as supportsHistory, f as supportsIntersectionObserver, m as supportsLocalStorage, a as supportsLocation, l as supportsSessionStorage, g as supportsShadowRoot, o as supportsWebComponents, s as supportsWindow };