@uniformdev/context-ui 19.79.0 → 19.79.1-alpha.13

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.
package/dist/index.js CHANGED
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  // src/index.ts
32
32
  var src_exports = {};
33
33
  __export(src_exports, {
34
+ AbTestSelector: () => AbTestSelector,
34
35
  ContextData: () => ContextData,
35
36
  CriteriaMatchMenu: () => CriteriaMatchMenu,
36
37
  CriteriaOperatorMenu: () => CriteriaOperatorMenu,
@@ -41,6 +42,7 @@ __export(src_exports, {
41
42
  PersonalizationCriteria: () => PersonalizationCriteria,
42
43
  PersonalizationCriteriaStatic: () => PersonalizationCriteriaStatic,
43
44
  ProjectUIVersion: () => ProjectUIVersion,
45
+ addAbTestLink: () => addAbTestLink,
44
46
  addEnrichmentLink: () => addEnrichmentLink,
45
47
  contextCriteriaMenuOperators: () => contextCriteriaMenuOperators,
46
48
  convertErrorsToObj: () => convertErrorsToObj,
@@ -61,18 +63,179 @@ module.exports = __toCommonJS(src_exports);
61
63
  var import_react = require("@emotion/react");
62
64
  var React = __toESM(require("react"));
63
65
 
64
- // src/components/CriteriaOperatorMenu/CriteriaOperatorMenu.tsx
66
+ // src/components/AbTestSelector/AbTestSelector.tsx
67
+ var import_react3 = require("@emotion/react");
65
68
  var import_design_system = require("@uniformdev/design-system");
69
+ var import_react4 = require("react");
66
70
 
67
- // src/components/CriteriaOperatorMenu/OperatorBubble.tsx
68
- var import_react2 = require("@emotion/react");
71
+ // src/hooks/useABTests.ts
72
+ var import_api = require("@uniformdev/context/api");
73
+ var import_react2 = require("react");
74
+ function useABTests({ apiHost, apiKey, projectId }) {
75
+ const [reload, setReload] = (0, import_react2.useState)(true);
76
+ const [state, setState] = (0, import_react2.useState)({
77
+ loading: false,
78
+ notConfigured: false,
79
+ error: null,
80
+ result: null
81
+ });
82
+ (0, import_react2.useEffect)(() => {
83
+ if (!projectId || !apiKey || !apiHost) {
84
+ setState({ notConfigured: true, loading: false, error: null, result: null });
85
+ return;
86
+ }
87
+ const runEffect = async () => {
88
+ setState({ notConfigured: false, loading: true, error: null, result: null });
89
+ try {
90
+ const client = new import_api.CachedTestClient({
91
+ projectId,
92
+ apiKey,
93
+ apiHost
94
+ });
95
+ const { tests } = await client.get();
96
+ setState({ notConfigured: false, loading: false, error: null, result: tests });
97
+ } catch (e) {
98
+ let message;
99
+ if (e instanceof import_api.ApiClientError) {
100
+ message = e.message;
101
+ } else {
102
+ message = e.toString();
103
+ }
104
+ setState({ notConfigured: false, loading: false, error: message, result: null });
105
+ return;
106
+ }
107
+ };
108
+ if (reload) {
109
+ runEffect().then(() => {
110
+ setReload(false);
111
+ });
112
+ }
113
+ }, [apiHost, apiKey, projectId, reload]);
114
+ return {
115
+ result: state.result,
116
+ error: state.error,
117
+ loading: state.loading,
118
+ notConfigured: state.notConfigured,
119
+ doReload: () => setReload(true)
120
+ };
121
+ }
122
+
123
+ // src/components/AbTestSelector/AbTestSelector.tsx
69
124
  var import_jsx_runtime = require("@emotion/react/jsx-runtime");
125
+ var addAbTestLink = import_react3.css`
126
+ flex: 2;
127
+ display: flex;
128
+ width: 50%;
129
+ align-items: center;
130
+ font-weight: var(--fw-bold);
131
+ color: var(--brand-primary-1);
132
+ &:hover,
133
+ &:focus {
134
+ text-decoration-line: underline;
135
+ }
136
+ `;
137
+ var AbTestList = ({ contextConfig, onSelect, value }) => {
138
+ const { loading, result, doReload = () => {
139
+ } } = useABTests(contextConfig);
140
+ if (loading) {
141
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.LoadingIndicator, {});
142
+ }
143
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
144
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Link, { text: "Refresh A/B Test list", style: { marginRight: "10px" }, onClick: () => doReload() }) }),
145
+ !result || result.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NoAbTestsView, { contextConfig }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { marginTop: "10px" }, children: [
146
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.ScrollableList, { children: result.map((abTest) => {
147
+ const { id, name } = abTest;
148
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
149
+ import_design_system.ScrollableListItem,
150
+ {
151
+ buttonText: name,
152
+ active: id === (value == null ? void 0 : value.id),
153
+ onClick: () => onSelect(abTest)
154
+ },
155
+ id
156
+ );
157
+ }) }),
158
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
159
+ import_design_system.AddListButton,
160
+ {
161
+ className: "add-more",
162
+ onButtonClick: () => {
163
+ window.open(
164
+ `${contextConfig.apiHost}/projects/${encodeURIComponent(contextConfig.projectId)}/testing`,
165
+ "_blank"
166
+ );
167
+ },
168
+ buttonText: "Add new A/B Test"
169
+ }
170
+ )
171
+ ] })
172
+ ] });
173
+ };
174
+ var AbTestSelector = ({ value, setValue, contextConfig, loading }) => {
175
+ var _a;
176
+ const [showAbTests, setShowAbTests] = (0, import_react4.useState)(false);
177
+ if (loading) {
178
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.LoadingIndicator, {});
179
+ }
180
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("fieldset", { className: "ab-test", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
181
+ !showAbTests && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
182
+ value && Object.keys(value).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Heading, { level: 4, style: { marginBottom: "10px" }, children: (_a = value == null ? void 0 : value.name) != null ? _a : "Unknown test" }),
183
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Button, { buttonType: "primary", style: { marginRight: "10px" }, onClick: () => setShowAbTests(true), children: "Select A/B Test" })
184
+ ] }),
185
+ showAbTests && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
186
+ AbTestList,
187
+ {
188
+ contextConfig,
189
+ onSelect: (abTest) => {
190
+ if ((value == null ? void 0 : value.id) === abTest.id) {
191
+ setValue(void 0);
192
+ setShowAbTests(true);
193
+ return;
194
+ }
195
+ setValue(abTest);
196
+ setShowAbTests(false);
197
+ },
198
+ value
199
+ }
200
+ )
201
+ ] }) });
202
+ };
203
+ var NoAbTestsView = ({ contextConfig }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
204
+ import_design_system.Callout,
205
+ {
206
+ title: "No A/B tests found in your Uniform project.",
207
+ type: "caution",
208
+ css: { marginBlock: "var(--spacing-base)" },
209
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
210
+ "Looks like you do not have any A/B tests created in your connected Uniform project. Start by creating your first test",
211
+ " ",
212
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
213
+ "a",
214
+ {
215
+ href: `${contextConfig.apiHost}/projects/${encodeURIComponent(contextConfig.projectId)}/testing`,
216
+ target: "_blank",
217
+ rel: "noopener noreferrer",
218
+ css: { ":hover": { textDecorationLine: "underline" } },
219
+ children: "here"
220
+ }
221
+ ),
222
+ "."
223
+ ] })
224
+ }
225
+ );
226
+
227
+ // src/components/CriteriaOperatorMenu/CriteriaOperatorMenu.tsx
228
+ var import_design_system2 = require("@uniformdev/design-system");
229
+
230
+ // src/components/CriteriaOperatorMenu/OperatorBubble.tsx
231
+ var import_react5 = require("@emotion/react");
232
+ var import_jsx_runtime2 = require("@emotion/react/jsx-runtime");
70
233
  function OperatorBubble({ op }) {
71
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
234
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
72
235
  "div",
73
236
  {
74
237
  className: "operation-bubble",
75
- css: import_react2.css`
238
+ css: import_react5.css`
76
239
  align-items: center;
77
240
  background: var(--gray-700);
78
241
  border-radius: var(--rounded-full);
@@ -89,12 +252,12 @@ function OperatorBubble({ op }) {
89
252
  }
90
253
 
91
254
  // src/components/CriteriaOperatorMenu/CriteriaOperatorOption.tsx
92
- var import_jsx_runtime2 = require("@emotion/react/jsx-runtime");
255
+ var import_jsx_runtime3 = require("@emotion/react/jsx-runtime");
93
256
  var CriteriaOperatorOption = (props) => {
94
257
  var _a, _b;
95
258
  const { data, getStyles, isDisabled, innerRef, innerProps } = props;
96
259
  const [name, description] = (_b = (_a = data.label) == null ? void 0 : _a.split(":")) != null ? _b : [];
97
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
260
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
98
261
  "div",
99
262
  {
100
263
  css: {
@@ -107,7 +270,7 @@ var CriteriaOperatorOption = (props) => {
107
270
  "aria-disabled": isDisabled,
108
271
  ...innerProps,
109
272
  children: [
110
- description ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(OperatorBubble, { op: name }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
273
+ description ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(OperatorBubble, { op: name }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
111
274
  "div",
112
275
  {
113
276
  css: {
@@ -116,30 +279,30 @@ var CriteriaOperatorOption = (props) => {
116
279
  }
117
280
  }
118
281
  ),
119
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { children: description != null ? description : name })
282
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: description != null ? description : name })
120
283
  ]
121
284
  }
122
285
  );
123
286
  };
124
287
 
125
288
  // src/components/CriteriaOperatorMenu/CriteriaOperatorSingleValue.tsx
126
- var import_jsx_runtime3 = require("@emotion/react/jsx-runtime");
289
+ var import_jsx_runtime4 = require("@emotion/react/jsx-runtime");
127
290
  var CriteriaOperatorSingleValue = (props) => {
128
291
  const { data, getStyles } = props;
129
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
292
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
130
293
  "div",
131
294
  {
132
295
  css: {
133
296
  ...getStyles("singleValue", props),
134
297
  width: "max-content"
135
298
  },
136
- children: data.label.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(OperatorBubble, { op: data.label }) : data.label
299
+ children: data.label.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(OperatorBubble, { op: data.label }) : data.label
137
300
  }
138
301
  );
139
302
  };
140
303
 
141
304
  // src/components/CriteriaOperatorMenu/CriteriaOperatorMenu.tsx
142
- var import_jsx_runtime4 = require("@emotion/react/jsx-runtime");
305
+ var import_jsx_runtime5 = require("@emotion/react/jsx-runtime");
143
306
  var contextCriteriaMenuOperators = [
144
307
  {
145
308
  name: "=",
@@ -182,8 +345,8 @@ var contextCriteriaMenuOperators = [
182
345
  ];
183
346
  function CriteriaOperatorMenu({ onChange, value, ...props }) {
184
347
  var _a, _b;
185
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
186
- import_design_system.InputComboBox,
348
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
349
+ import_design_system2.InputComboBox,
187
350
  {
188
351
  ...props,
189
352
  value: {
@@ -244,20 +407,20 @@ function CriteriaOperatorMenu({ onChange, value, ...props }) {
244
407
  }
245
408
 
246
409
  // src/components/DataContext/DataContext.tsx
247
- var import_design_system2 = require("@uniformdev/design-system");
248
- var import_react5 = require("react");
410
+ var import_design_system3 = require("@uniformdev/design-system");
411
+ var import_react8 = require("react");
249
412
 
250
413
  // src/hooks/useContextData.ts
251
- var import_api = require("@uniformdev/context/api");
252
- var import_react3 = require("react");
414
+ var import_api2 = require("@uniformdev/context/api");
415
+ var import_react6 = require("react");
253
416
  function useContextData({ apiHost, apiKey, projectId }) {
254
- const [state, setState] = (0, import_react3.useState)({
417
+ const [state, setState] = (0, import_react6.useState)({
255
418
  loading: false,
256
419
  notConfigured: false,
257
420
  error: null,
258
421
  result: null
259
422
  });
260
- (0, import_react3.useEffect)(() => {
423
+ (0, import_react6.useEffect)(() => {
261
424
  if (!projectId || !apiKey || !apiHost) {
262
425
  setState({ notConfigured: true, loading: false, error: null, result: null });
263
426
  return;
@@ -265,7 +428,7 @@ function useContextData({ apiHost, apiKey, projectId }) {
265
428
  const runEffect = async () => {
266
429
  setState({ notConfigured: false, loading: true, error: null, result: null });
267
430
  try {
268
- const client = new import_api.CachedManifestClient({
431
+ const client = new import_api2.CachedManifestClient({
269
432
  projectId,
270
433
  apiKey,
271
434
  apiHost
@@ -274,7 +437,7 @@ function useContextData({ apiHost, apiKey, projectId }) {
274
437
  setState({ notConfigured: false, loading: false, error: null, result });
275
438
  } catch (e) {
276
439
  let message;
277
- if (e instanceof import_api.ApiClientError) {
440
+ if (e instanceof import_api2.ApiClientError) {
278
441
  if (e.statusCode === 403) {
279
442
  message = `The API key ${apiKey} did not have permissions to fetch the manifest. Ensure Context > Read Drafts permissions are granted.`;
280
443
  }
@@ -297,8 +460,8 @@ function useContextData({ apiHost, apiKey, projectId }) {
297
460
  }
298
461
 
299
462
  // src/hooks/useDimensions.ts
300
- var import_api2 = require("@uniformdev/context/api");
301
- var import_react4 = require("react");
463
+ var import_api3 = require("@uniformdev/context/api");
464
+ var import_react7 = require("react");
302
465
 
303
466
  // src/utils/objectify.ts
304
467
  function objectify(array2, keySelector, valueSelector) {
@@ -314,13 +477,13 @@ function objectify(array2, keySelector, valueSelector) {
314
477
 
315
478
  // src/hooks/useDimensions.ts
316
479
  function useDimensions({ apiHost, apiKey, projectId }) {
317
- const [state, setState] = (0, import_react4.useState)({
480
+ const [state, setState] = (0, import_react7.useState)({
318
481
  loading: false,
319
482
  notConfigured: false,
320
483
  error: null,
321
484
  result: null
322
485
  });
323
- (0, import_react4.useEffect)(() => {
486
+ (0, import_react7.useEffect)(() => {
324
487
  if (!projectId || !apiKey || !apiHost) {
325
488
  setState({ notConfigured: true, loading: false, error: null, result: null });
326
489
  return;
@@ -328,14 +491,14 @@ function useDimensions({ apiHost, apiKey, projectId }) {
328
491
  const runEffect = async () => {
329
492
  setState({ notConfigured: false, loading: true, error: null, result: null });
330
493
  try {
331
- const client = new import_api2.CachedDimensionClient({
494
+ const client = new import_api3.CachedDimensionClient({
332
495
  projectId,
333
496
  apiKey,
334
497
  apiHost
335
498
  });
336
499
  const dimensions = (await client.get()).dimensions.map((dim) => ({
337
500
  ...dim,
338
- displayName: (0, import_api2.computeDimensionDisplayName)(dim)
501
+ displayName: (0, import_api3.computeDimensionDisplayName)(dim)
339
502
  }));
340
503
  const result = {
341
504
  dimensions,
@@ -348,7 +511,7 @@ function useDimensions({ apiHost, apiKey, projectId }) {
348
511
  setState({ notConfigured: false, loading: false, error: null, result });
349
512
  } catch (e) {
350
513
  let message;
351
- if (e instanceof import_api2.ApiClientError) {
514
+ if (e instanceof import_api3.ApiClientError) {
352
515
  message = e.message;
353
516
  } else {
354
517
  message = e.toString();
@@ -368,8 +531,8 @@ function useDimensions({ apiHost, apiKey, projectId }) {
368
531
  }
369
532
 
370
533
  // src/components/DataContext/DataContext.tsx
371
- var import_jsx_runtime5 = require("@emotion/react/jsx-runtime");
372
- var ContextDataContext = (0, import_react5.createContext)(null);
534
+ var import_jsx_runtime6 = require("@emotion/react/jsx-runtime");
535
+ var ContextDataContext = (0, import_react8.createContext)(null);
373
536
  var ContextData = ({
374
537
  loadingComponent: LoadingComponent,
375
538
  errorComponent: ErrorComponent,
@@ -380,23 +543,23 @@ var ContextData = ({
380
543
  const dimensionsData = useDimensions(contextConfig);
381
544
  if (contextData.error || contextData.notConfigured) {
382
545
  if (ErrorComponent)
383
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ErrorComponent, { contextConfig, result: contextData });
546
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ErrorComponent, { contextConfig, result: contextData });
384
547
  else
385
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: "ErrorComponent is not configured" });
548
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: "ErrorComponent is not configured" });
386
549
  }
387
550
  if (dimensionsData.error || dimensionsData.notConfigured) {
388
551
  if (ErrorComponent)
389
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ErrorComponent, { contextConfig, result: dimensionsData });
552
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ErrorComponent, { contextConfig, result: dimensionsData });
390
553
  else
391
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: "ErrorComponent is not configured" });
554
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: "ErrorComponent is not configured" });
392
555
  }
393
556
  if (contextData.loading || dimensionsData.loading) {
394
557
  if (LoadingComponent)
395
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LoadingComponent, {});
558
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LoadingComponent, {});
396
559
  else
397
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_design_system2.LoadingIndicator, {});
560
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system3.LoadingIndicator, {});
398
561
  }
399
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
562
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
400
563
  ContextDataContext.Provider,
401
564
  {
402
565
  value: { manifest: contextData.result, dimensions: dimensionsData.result, contextConfig },
@@ -405,21 +568,21 @@ var ContextData = ({
405
568
  );
406
569
  };
407
570
  function useContextConfig() {
408
- const context = (0, import_react5.useContext)(ContextDataContext);
571
+ const context = (0, import_react8.useContext)(ContextDataContext);
409
572
  if (!(context == null ? void 0 : context.contextConfig)) {
410
573
  throw new Error("Not within DataContext! Configuration data is not exist.");
411
574
  }
412
575
  return context.contextConfig;
413
576
  }
414
577
  function useManifest() {
415
- const context = (0, import_react5.useContext)(ContextDataContext);
578
+ const context = (0, import_react8.useContext)(ContextDataContext);
416
579
  if (!(context == null ? void 0 : context.manifest)) {
417
580
  throw new Error("Not within DataContext! Manifest data is not exist.");
418
581
  }
419
582
  return context.manifest;
420
583
  }
421
584
  function useDimensionsDataContext() {
422
- const context = (0, import_react5.useContext)(ContextDataContext);
585
+ const context = (0, import_react8.useContext)(ContextDataContext);
423
586
  if (!(context == null ? void 0 : context.dimensions)) {
424
587
  throw new Error("Not within DataContext! Dimensions data is not exist.");
425
588
  }
@@ -427,11 +590,11 @@ function useDimensionsDataContext() {
427
590
  }
428
591
 
429
592
  // src/components/DimensionMenu/CriteriaMatchMenu.tsx
430
- var import_design_system5 = require("@uniformdev/design-system");
431
- var import_react7 = require("react");
593
+ var import_design_system6 = require("@uniformdev/design-system");
594
+ var import_react10 = require("react");
432
595
 
433
596
  // src/components/DimensionMenu/DimensionGroupHeading.tsx
434
- var import_design_system3 = require("@uniformdev/design-system");
597
+ var import_design_system4 = require("@uniformdev/design-system");
435
598
 
436
599
  // src/components/DimensionMenu/utils.ts
437
600
  function dimensionToMenuOption(dimension) {
@@ -472,11 +635,11 @@ function groupDimensions(dimensions) {
472
635
  }
473
636
 
474
637
  // src/components/DimensionMenu/DimensionGroupHeading.tsx
475
- var import_jsx_runtime6 = require("@emotion/react/jsx-runtime");
638
+ var import_jsx_runtime7 = require("@emotion/react/jsx-runtime");
476
639
  var DimensionGroupHeading = (props) => {
477
640
  var _a;
478
641
  const { data, getStyles, className } = props;
479
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
642
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
480
643
  "div",
481
644
  {
482
645
  css: {
@@ -485,13 +648,13 @@ var DimensionGroupHeading = (props) => {
485
648
  fontSize: "var(--font-size-sm)"
486
649
  },
487
650
  className,
488
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
651
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
489
652
  "small",
490
653
  {
491
654
  css: { color: "var(--gray-500)", display: "flex", alignItems: "center", gap: "var(--spacing-xs)" },
492
655
  children: [
493
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system3.Icon, { icon: dimensionIcon((_a = data.label) != null ? _a : ""), iconColor: "currentColor", size: 16 }),
494
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: data.label })
656
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_design_system4.Icon, { icon: dimensionIcon((_a = data.label) != null ? _a : ""), iconColor: "currentColor", size: 16 }),
657
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: data.label })
495
658
  ]
496
659
  }
497
660
  )
@@ -500,15 +663,15 @@ var DimensionGroupHeading = (props) => {
500
663
  };
501
664
 
502
665
  // src/components/DimensionMenu/DimensionMenuErrorMessage.tsx
503
- var import_react6 = require("@emotion/react");
504
- var import_jsx_runtime7 = require("@emotion/react/jsx-runtime");
666
+ var import_react9 = require("@emotion/react");
667
+ var import_jsx_runtime8 = require("@emotion/react/jsx-runtime");
505
668
  function DimensionMenuErrorMessage({ message }) {
506
669
  if (!message)
507
670
  return null;
508
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
671
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
509
672
  "div",
510
673
  {
511
- css: import_react6.css`
674
+ css: import_react9.css`
512
675
  color: var(--brand-primary-2);
513
676
  font-size: var(--fs-xs);
514
677
  position: absolute;
@@ -520,12 +683,12 @@ function DimensionMenuErrorMessage({ message }) {
520
683
  }
521
684
 
522
685
  // src/components/DimensionMenu/DimensionOption.tsx
523
- var import_jsx_runtime8 = require("@emotion/react/jsx-runtime");
686
+ var import_jsx_runtime9 = require("@emotion/react/jsx-runtime");
524
687
  var DimensionOption = (props) => {
525
688
  var _a, _b;
526
689
  const { data, getStyles, cx, isDisabled, isFocused, isSelected, className, innerRef, innerProps } = props;
527
690
  const [, value] = (_b = (_a = data.label) == null ? void 0 : _a.split(":")) != null ? _b : [];
528
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
691
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
529
692
  "div",
530
693
  {
531
694
  css: getStyles("option", props),
@@ -541,17 +704,17 @@ var DimensionOption = (props) => {
541
704
  ref: innerRef,
542
705
  "aria-disabled": isDisabled,
543
706
  ...innerProps,
544
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { css: { color: "var(--gray-700)" }, children: value != null ? value : data.label })
707
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { css: { color: "var(--gray-700)" }, children: value != null ? value : data.label })
545
708
  }
546
709
  );
547
710
  };
548
711
 
549
712
  // src/components/DimensionMenu/DimensionValue.tsx
550
- var import_design_system4 = require("@uniformdev/design-system");
551
- var import_jsx_runtime9 = require("@emotion/react/jsx-runtime");
713
+ var import_design_system5 = require("@uniformdev/design-system");
714
+ var import_jsx_runtime10 = require("@emotion/react/jsx-runtime");
552
715
  function DimensionValue({ displayName }) {
553
716
  const [type, name] = displayName.split(":");
554
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
717
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
555
718
  "div",
556
719
  {
557
720
  css: {
@@ -559,31 +722,31 @@ function DimensionValue({ displayName }) {
559
722
  overflow: "hidden"
560
723
  },
561
724
  children: [
562
- name ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
725
+ name ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
563
726
  "small",
564
727
  {
565
728
  css: { color: "var(--gray-500)", display: "flex", alignItems: "center", gap: "var(--spacing-xs)" },
566
729
  children: [
567
- type ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_design_system4.Icon, { icon: dimensionIcon(type), iconColor: "currentColor", size: 16 }) : null,
568
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { "data-testid": "dimension-name", children: type })
730
+ type ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_design_system5.Icon, { icon: dimensionIcon(type), iconColor: "currentColor", size: 16 }) : null,
731
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { "data-testid": "dimension-name", children: type })
569
732
  ]
570
733
  }
571
734
  ) : null,
572
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { css: { color: "var(--gray-700)" }, "data-testid": "dimension-value", children: name != null ? name : type })
735
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { css: { color: "var(--gray-700)" }, "data-testid": "dimension-value", children: name != null ? name : type })
573
736
  ]
574
737
  }
575
738
  );
576
739
  }
577
740
 
578
741
  // src/components/DimensionMenu/DimensionSingleValue.tsx
579
- var import_jsx_runtime10 = require("@emotion/react/jsx-runtime");
742
+ var import_jsx_runtime11 = require("@emotion/react/jsx-runtime");
580
743
  var DimensionSingleValue = (props) => {
581
744
  const { data, getStyles } = props;
582
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { css: getStyles("singleValue", props), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DimensionValue, { displayName: data.label }) });
745
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { css: getStyles("singleValue", props), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DimensionValue, { displayName: data.label }) });
583
746
  };
584
747
 
585
748
  // src/components/DimensionMenu/CriteriaMatchMenu.tsx
586
- var import_jsx_runtime11 = require("@emotion/react/jsx-runtime");
749
+ var import_jsx_runtime12 = require("@emotion/react/jsx-runtime");
587
750
  function CriteriaMatchMenu({
588
751
  onChange,
589
752
  criteriaMatch,
@@ -592,14 +755,14 @@ function CriteriaMatchMenu({
592
755
  ...props
593
756
  }) {
594
757
  var _a, _b;
595
- const [inputValue, setInputValue] = (0, import_react7.useState)(
758
+ const [inputValue, setInputValue] = (0, import_react10.useState)(
596
759
  typeof criteriaMatch.r !== "undefined" && isInt(criteriaMatch.r) !== null ? criteriaMatch.r.toString(10) : ""
597
760
  );
598
761
  const rDim = criteriaMatch.rDim;
599
762
  const targetDim = criteriaMatch.rDim ? dimensions.dimIndex[criteriaMatch.rDim] : void 0;
600
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
601
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
602
- import_design_system5.InputComboBox,
763
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
764
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
765
+ import_design_system6.InputComboBox,
603
766
  {
604
767
  ...props,
605
768
  inputValue,
@@ -665,26 +828,26 @@ function CriteriaMatchMenu({
665
828
  },
666
829
  noOptionsMessage: ({ inputValue: inputValue2 }) => {
667
830
  if (isInt(inputValue2)) {
668
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
669
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
831
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
832
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
670
833
  "Score: ",
671
834
  inputValue2
672
835
  ] }),
673
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: "If you want to match on another dimension\u2019s score instead, clear the score value to search for a dimension." })
836
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "If you want to match on another dimension\u2019s score instead, clear the score value to search for a dimension." })
674
837
  ] });
675
838
  }
676
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
677
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
839
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
840
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
678
841
  "No dimensions match your search \u201C",
679
842
  inputValue2,
680
843
  "\u201D"
681
844
  ] }),
682
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: "If you want to match a literal score, enter a numeric value." })
845
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: "If you want to match a literal score, enter a numeric value." })
683
846
  ] });
684
847
  }
685
848
  }
686
849
  ),
687
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DimensionMenuErrorMessage, { message: errorMessage })
850
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DimensionMenuErrorMessage, { message: errorMessage })
688
851
  ] });
689
852
  }
690
853
  function isInt(value) {
@@ -692,12 +855,12 @@ function isInt(value) {
692
855
  }
693
856
 
694
857
  // src/components/DimensionMenu/DimensionMenu.tsx
695
- var import_design_system6 = require("@uniformdev/design-system");
696
- var import_jsx_runtime12 = require("@emotion/react/jsx-runtime");
858
+ var import_design_system7 = require("@uniformdev/design-system");
859
+ var import_jsx_runtime13 = require("@emotion/react/jsx-runtime");
697
860
  function DimensionMenu({ onChange, value, dimensions, errorMessage, ...props }) {
698
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
699
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
700
- import_design_system6.InputComboBox,
861
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
862
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
863
+ import_design_system7.InputComboBox,
701
864
  {
702
865
  ...props,
703
866
  value: value ? dimensionToMenuOption(value) : void 0,
@@ -726,17 +889,17 @@ function DimensionMenu({ onChange, value, dimensions, errorMessage, ...props })
726
889
  }
727
890
  }
728
891
  ),
729
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DimensionMenuErrorMessage, { message: errorMessage })
892
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DimensionMenuErrorMessage, { message: errorMessage })
730
893
  ] });
731
894
  }
732
895
 
733
896
  // src/components/EditLink/EditLink.tsx
734
897
  var import_CgChevronRight = require("@react-icons/all-files/cg/CgChevronRight");
735
- var import_design_system7 = require("@uniformdev/design-system");
898
+ var import_design_system8 = require("@uniformdev/design-system");
736
899
 
737
900
  // src/components/EditLink/EditLink.styles.ts
738
- var import_react8 = require("@emotion/react");
739
- var editLink = import_react8.css`
901
+ var import_react11 = require("@emotion/react");
902
+ var editLink = import_react11.css`
740
903
  display: flex;
741
904
  align-items: center;
742
905
  font-weight: var(--fw-bold);
@@ -750,9 +913,9 @@ var editLink = import_react8.css`
750
913
  `;
751
914
 
752
915
  // src/components/EditLink/EditLink.tsx
753
- var import_jsx_runtime13 = require("@emotion/react/jsx-runtime");
916
+ var import_jsx_runtime14 = require("@emotion/react/jsx-runtime");
754
917
  var EditLink = ({ linkTo, name, linkText = `Edit ${name} Component` }) => {
755
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
918
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
756
919
  "a",
757
920
  {
758
921
  css: editLink,
@@ -762,23 +925,23 @@ var EditLink = ({ linkTo, name, linkText = `Edit ${name} Component` }) => {
762
925
  href: linkTo,
763
926
  children: [
764
927
  linkText,
765
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_design_system7.Icon, { icon: import_CgChevronRight.CgChevronRight, iconColor: "currentColor", size: "1.5rem" })
928
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.Icon, { icon: import_CgChevronRight.CgChevronRight, iconColor: "currentColor", size: "1.5rem" })
766
929
  ]
767
930
  }
768
931
  );
769
932
  };
770
933
 
771
934
  // src/components/EnrichmentTag/EnrichmentTag.tsx
772
- var import_react9 = require("@emotion/react");
935
+ var import_react12 = require("@emotion/react");
773
936
  var import_CgCloseO = require("@react-icons/all-files/cg/CgCloseO");
774
937
  var import_CgMathMinus = require("@react-icons/all-files/cg/CgMathMinus");
775
938
  var import_CgMathPlus = require("@react-icons/all-files/cg/CgMathPlus");
776
939
  var import_context = require("@uniformdev/context");
777
- var import_design_system8 = require("@uniformdev/design-system");
778
- var import_immer = __toESM(require("immer"));
779
- var import_react10 = require("react");
780
- var import_jsx_runtime14 = require("@emotion/react/jsx-runtime");
781
- var addEnrichmentLink = import_react9.css`
940
+ var import_design_system9 = require("@uniformdev/design-system");
941
+ var import_immer = require("immer");
942
+ var import_react13 = require("react");
943
+ var import_jsx_runtime15 = require("@emotion/react/jsx-runtime");
944
+ var addEnrichmentLink = import_react12.css`
782
945
  flex: 2;
783
946
  display: flex;
784
947
  width: 50%;
@@ -797,11 +960,11 @@ var EnrichmentTag = ({
797
960
  displayTitle = true
798
961
  }) => {
799
962
  const { loading, result: dimensions, error } = useDimensions(contextConfig);
800
- const allEnrichments = (0, import_react10.useMemo)(() => {
963
+ const allEnrichments = (0, import_react13.useMemo)(() => {
801
964
  if (dimensions)
802
965
  return dimensions.dimensions.filter((dimension) => dimension.category === "ENR");
803
966
  }, [dimensions]);
804
- const remainingEnrichments = (0, import_react10.useMemo)(() => {
967
+ const remainingEnrichments = (0, import_react13.useMemo)(() => {
805
968
  if (!value)
806
969
  return allEnrichments;
807
970
  if (allEnrichments)
@@ -809,9 +972,9 @@ var EnrichmentTag = ({
809
972
  (enr) => !value.some((val) => (0, import_context.getEnrichmentVectorKey)(val.cat, val.key) === enr.dim)
810
973
  );
811
974
  }, [allEnrichments, value]);
812
- const [selectValue, setSelectValue] = (0, import_react10.useState)("");
813
- const [score, setScore] = (0, import_react10.useState)(50);
814
- const [showAddNewEnrichmentTagPanel, setShowAddNewEnrichmentTagPanel] = (0, import_react10.useState)(false);
975
+ const [selectValue, setSelectValue] = (0, import_react13.useState)("");
976
+ const [score, setScore] = (0, import_react13.useState)(50);
977
+ const [showAddNewEnrichmentTagPanel, setShowAddNewEnrichmentTagPanel] = (0, import_react13.useState)(false);
815
978
  const selectedEnrichment = allEnrichments == null ? void 0 : allEnrichments.find((dimension) => dimension.dim === selectValue);
816
979
  const addEnrichment = () => {
817
980
  const [cat, key] = selectValue.split("_");
@@ -834,21 +997,21 @@ var EnrichmentTag = ({
834
997
  setValue(finalValue);
835
998
  };
836
999
  if (error)
837
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.Callout, { type: "danger", children: error });
1000
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Callout, { type: "danger", children: error });
838
1001
  if (loading || dimensions === null)
839
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.LoadingIndicator, {});
840
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("fieldset", { className: "enrichment-tag", children: [
841
- displayTitle ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { css: { display: "flex", justifyContent: "space-between", marginBottom: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("legend", { css: { fontSize: "var(--fs-md)", fontWeight: "var(--fw-bold)" }, children: "Enrichment Tags" }) }) : null,
842
- !(allEnrichments == null ? void 0 : allEnrichments.length) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(NoEnrichmentsView, { contextConfig }) : !showAddNewEnrichmentTagPanel && !value ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
843
- import_design_system8.Callout,
1002
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.LoadingIndicator, {});
1003
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("fieldset", { className: "enrichment-tag", children: [
1004
+ displayTitle ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { css: { display: "flex", justifyContent: "space-between", marginBottom: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("legend", { css: { fontSize: "var(--fs-md)", fontWeight: "var(--fw-bold)" }, children: "Enrichment Tags" }) }) : null,
1005
+ !(allEnrichments == null ? void 0 : allEnrichments.length) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(NoEnrichmentsView, { contextConfig }) : !showAddNewEnrichmentTagPanel && !value ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1006
+ import_design_system9.Callout,
844
1007
  {
845
1008
  title: "No enrichment tags assigned.",
846
1009
  type: "info",
847
1010
  css: { marginBlock: "var(--spacing-base)" },
848
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
1011
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { children: [
849
1012
  "Click",
850
1013
  " ",
851
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1014
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
852
1015
  "a",
853
1016
  {
854
1017
  onClick: () => setShowAddNewEnrichmentTagPanel(true),
@@ -862,9 +1025,9 @@ var EnrichmentTag = ({
862
1025
  "to assign your first enrichment tag."
863
1026
  ] })
864
1027
  }
865
- ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
866
- dimensions && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SelectedEnrichments, { list: value != null ? value : [], setList: update, dimIndex: dimensions.dimIndex }),
867
- showAddNewEnrichmentTagPanel && remainingEnrichments && remainingEnrichments.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1028
+ ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
1029
+ dimensions && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectedEnrichments, { list: value != null ? value : [], setList: update, dimIndex: dimensions.dimIndex }),
1030
+ showAddNewEnrichmentTagPanel && remainingEnrichments && remainingEnrichments.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
868
1031
  "div",
869
1032
  {
870
1033
  className: "add-enrichment-tag",
@@ -876,8 +1039,8 @@ var EnrichmentTag = ({
876
1039
  alignItems: "center"
877
1040
  },
878
1041
  children: [
879
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { css: { flexGrow: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
880
- import_design_system8.InputSelect,
1042
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { css: { flexGrow: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1043
+ import_design_system9.InputSelect,
881
1044
  {
882
1045
  name: `enrichment-type`,
883
1046
  label: "Enrichment Tag",
@@ -893,7 +1056,7 @@ var EnrichmentTag = ({
893
1056
  onChange: (e) => setSelectValue(e.currentTarget.value)
894
1057
  }
895
1058
  ) }),
896
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1059
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
897
1060
  ScoreCounter,
898
1061
  {
899
1062
  score,
@@ -902,8 +1065,8 @@ var EnrichmentTag = ({
902
1065
  css: { flexBasis: "9rem" }
903
1066
  }
904
1067
  ),
905
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
906
- import_design_system8.Button,
1068
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1069
+ import_design_system9.Button,
907
1070
  {
908
1071
  buttonType: "tertiary",
909
1072
  size: "xl",
@@ -921,21 +1084,21 @@ var EnrichmentTag = ({
921
1084
  ]
922
1085
  }
923
1086
  ) : null,
924
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1087
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
925
1088
  "div",
926
1089
  {
927
1090
  className: "enrichment-cta",
928
1091
  style: { paddingTop: "10px", display: "flex", justifyContent: "space-between" },
929
1092
  children: [
930
- !showAddNewEnrichmentTagPanel && remainingEnrichments && remainingEnrichments.length > 0 && value ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
931
- import_design_system8.AddListButton,
1093
+ !showAddNewEnrichmentTagPanel && remainingEnrichments && remainingEnrichments.length > 0 && value ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1094
+ import_design_system9.AddListButton,
932
1095
  {
933
1096
  className: "add-more",
934
1097
  buttonText: "Add More",
935
1098
  onButtonClick: () => setShowAddNewEnrichmentTagPanel(true)
936
1099
  }
937
- ) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { css: addEnrichmentLink, title: `none`, href: "#" }),
938
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1100
+ ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("a", { css: addEnrichmentLink, title: `none`, href: "#" }),
1101
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
939
1102
  EditLink,
940
1103
  {
941
1104
  name: "Enrichments",
@@ -951,10 +1114,10 @@ var EnrichmentTag = ({
951
1114
  ] })
952
1115
  ] });
953
1116
  };
954
- var NoEnrichmentsView = ({ contextConfig }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.Callout, { title: "No enrichments found.", type: "caution", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
1117
+ var NoEnrichmentsView = ({ contextConfig }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Callout, { title: "No enrichments found.", type: "caution", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("p", { children: [
955
1118
  "Looks like you do not have any enrichment created in your connected Uniform project. Start by creating your first enrichment",
956
1119
  " ",
957
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1120
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
958
1121
  "a",
959
1122
  {
960
1123
  href: `${contextConfig.apiHost}/projects/${encodeURIComponent(
@@ -971,7 +1134,7 @@ var NoEnrichmentsView = ({ contextConfig }) => /* @__PURE__ */ (0, import_jsx_ru
971
1134
  var getCappedValue = (value, maxCap = 100, minCap = 0) => {
972
1135
  return Math.max(Math.min(value, maxCap), minCap);
973
1136
  };
974
- var scoreCounterMinusButtonStyles = import_react9.css`
1137
+ var scoreCounterMinusButtonStyles = import_react12.css`
975
1138
  position: absolute;
976
1139
  bottom: 0.875rem;
977
1140
  left: var(--spacing-sm);
@@ -984,7 +1147,7 @@ var scoreCounterMinusButtonStyles = import_react9.css`
984
1147
  border: 1px solid var(--gray-300);
985
1148
  border-radius: var(--rounded-full);
986
1149
  `;
987
- var scoreCounterPlusButtonStyles = import_react9.css`
1150
+ var scoreCounterPlusButtonStyles = import_react12.css`
988
1151
  ${scoreCounterMinusButtonStyles}
989
1152
  left: auto;
990
1153
  right: var(--spacing-sm);
@@ -1005,9 +1168,9 @@ var ScoreCounter = ({
1005
1168
  }
1006
1169
  setValue(newScore);
1007
1170
  };
1008
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { css: { position: "relative" }, ...otherProps, children: [
1009
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1010
- import_design_system8.Input,
1171
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { css: { position: "relative" }, ...otherProps, children: [
1172
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1173
+ import_design_system9.Input,
1011
1174
  {
1012
1175
  label: "Strength",
1013
1176
  id: "enrichment-score",
@@ -1019,7 +1182,7 @@ var ScoreCounter = ({
1019
1182
  css: { textAlign: "center", boxSizing: "border-box" }
1020
1183
  }
1021
1184
  ),
1022
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1185
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1023
1186
  "button",
1024
1187
  {
1025
1188
  type: "button",
@@ -1028,10 +1191,10 @@ var ScoreCounter = ({
1028
1191
  disabled: score === 0,
1029
1192
  className: "scoreCounterButton",
1030
1193
  css: scoreCounterMinusButtonStyles,
1031
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.Icon, { icon: import_CgMathMinus.CgMathMinus, iconColor: "gray", size: "1.5rem" })
1194
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Icon, { icon: import_CgMathMinus.CgMathMinus, iconColor: "gray", size: "1.5rem" })
1032
1195
  }
1033
1196
  ),
1034
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1197
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1035
1198
  "button",
1036
1199
  {
1037
1200
  type: "button",
@@ -1039,7 +1202,7 @@ var ScoreCounter = ({
1039
1202
  onClick: () => handleCounter("increment"),
1040
1203
  className: "scoreCounterButton",
1041
1204
  css: scoreCounterPlusButtonStyles,
1042
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.Icon, { icon: import_CgMathPlus.CgMathPlus, iconColor: "gray", size: "1.5rem" })
1205
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Icon, { icon: import_CgMathPlus.CgMathPlus, iconColor: "gray", size: "1.5rem" })
1043
1206
  }
1044
1207
  )
1045
1208
  ] });
@@ -1047,7 +1210,7 @@ var ScoreCounter = ({
1047
1210
  var SelectedEnrichments = ({ list, setList, dimIndex }) => {
1048
1211
  const removeEnrichment = (index) => {
1049
1212
  setList(
1050
- (0, import_immer.default)(list, (draft) => {
1213
+ (0, import_immer.produce)(list, (draft) => {
1051
1214
  draft.splice(index, 1);
1052
1215
  })
1053
1216
  );
@@ -1056,16 +1219,16 @@ var SelectedEnrichments = ({ list, setList, dimIndex }) => {
1056
1219
  var _a;
1057
1220
  const cap = (_a = dimIndex[`${list[index].cat}_${list[index].key}`]) == null ? void 0 : _a.cap;
1058
1221
  setList(
1059
- (0, import_immer.default)(list, (draft) => {
1222
+ (0, import_immer.produce)(list, (draft) => {
1060
1223
  draft[index].str = getCappedValue(Number(value) || 0, cap);
1061
1224
  })
1062
1225
  );
1063
1226
  };
1064
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: list.map((enrichment, index) => {
1227
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: list.map((enrichment, index) => {
1065
1228
  const dimData = dimIndex[(0, import_context.getEnrichmentVectorKey)(enrichment.cat, enrichment.key)];
1066
1229
  if (!dimData)
1067
1230
  return;
1068
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1231
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1069
1232
  "div",
1070
1233
  {
1071
1234
  css: {
@@ -1080,14 +1243,14 @@ var SelectedEnrichments = ({ list, setList, dimIndex }) => {
1080
1243
  },
1081
1244
  className: "selected-enrichments",
1082
1245
  children: [
1083
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1246
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1084
1247
  "span",
1085
1248
  {
1086
1249
  css: { fontWeight: "var(--fw-bold)", color: dimData ? void 0 : "var(--brand-secondary-5)" },
1087
1250
  children: dimData ? dimData.displayName : `Enrichment '${enrichment.cat}_${enrichment.key}' is unknown`
1088
1251
  }
1089
1252
  ),
1090
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1253
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1091
1254
  "div",
1092
1255
  {
1093
1256
  css: {
@@ -1100,8 +1263,8 @@ var SelectedEnrichments = ({ list, setList, dimIndex }) => {
1100
1263
  padding: "var(--spacing-sm) var(--spacing-base)",
1101
1264
  flexBasis: "9rem"
1102
1265
  },
1103
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1104
- import_design_system8.Input,
1266
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1267
+ import_design_system9.Input,
1105
1268
  {
1106
1269
  type: "text",
1107
1270
  min: 0,
@@ -1114,14 +1277,14 @@ var SelectedEnrichments = ({ list, setList, dimIndex }) => {
1114
1277
  )
1115
1278
  }
1116
1279
  ),
1117
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1280
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1118
1281
  "button",
1119
1282
  {
1120
1283
  type: "button",
1121
1284
  title: `Delete enrichment`,
1122
1285
  onClick: () => removeEnrichment(index),
1123
1286
  css: { border: 0 },
1124
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system8.Icon, { icon: import_CgCloseO.CgCloseO, iconColor: "red", size: "1.5rem" })
1287
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Icon, { icon: import_CgCloseO.CgCloseO, iconColor: "red", size: "1.5rem" })
1125
1288
  }
1126
1289
  )
1127
1290
  ]
@@ -1132,8 +1295,8 @@ var SelectedEnrichments = ({ list, setList, dimIndex }) => {
1132
1295
  };
1133
1296
 
1134
1297
  // src/components/PersonalizationCriteria/PersonalizationCriteria.tsx
1135
- var import_design_system10 = require("@uniformdev/design-system");
1136
- var import_react13 = require("react");
1298
+ var import_design_system11 = require("@uniformdev/design-system");
1299
+ var import_react16 = require("react");
1137
1300
  var import_react_use = require("react-use");
1138
1301
  var yup = __toESM(require("yup"));
1139
1302
 
@@ -1149,15 +1312,15 @@ function opHasRhs(op) {
1149
1312
  }
1150
1313
 
1151
1314
  // src/components/PersonalizationCriteria/PersonalizationCriteriaStatic.tsx
1152
- var import_react12 = require("@emotion/react");
1315
+ var import_react15 = require("@emotion/react");
1153
1316
  var import_CgCloseO2 = require("@react-icons/all-files/cg/CgCloseO");
1154
- var import_design_system9 = require("@uniformdev/design-system");
1155
- var import_immer2 = __toESM(require("immer"));
1317
+ var import_design_system10 = require("@uniformdev/design-system");
1318
+ var import_immer2 = require("immer");
1156
1319
 
1157
1320
  // src/components/PersonalizationCriteria/PersonalizationCriteriaStatic.styles.ts
1158
- var import_react11 = require("@emotion/react");
1321
+ var import_react14 = require("@emotion/react");
1159
1322
  var spaceBetweenCriteriaItems = "6rem";
1160
- var criteriaItem = import_react11.css`
1323
+ var criteriaItem = import_react14.css`
1161
1324
  position: relative;
1162
1325
  padding: var(--spacing-md) var(--spacing-base);
1163
1326
  border: 1px solid var(--gray-300);
@@ -1185,35 +1348,35 @@ var criteriaItem = import_react11.css`
1185
1348
  }
1186
1349
  }
1187
1350
  `;
1188
- var criteriaItemInner = import_react11.css`
1351
+ var criteriaItemInner = import_react14.css`
1189
1352
  display: flex;
1190
1353
  gap: var(--spacing-base);
1191
1354
  flex-grow: 1;
1192
1355
  flex-wrap: wrap;
1193
1356
  margin-right: var(--spacing-base);
1194
1357
  `;
1195
- var criteriaWrapper = import_react11.css`
1358
+ var criteriaWrapper = import_react14.css`
1196
1359
  width: 100%;
1197
1360
  display: flex;
1198
1361
  align-items: stretch;
1199
1362
  position: relative;
1200
1363
  `;
1201
- var criteriaOperandWrapper = import_react11.css`
1364
+ var criteriaOperandWrapper = import_react14.css`
1202
1365
  flex: 2;
1203
1366
  height: 52px;
1204
1367
  min-width: 200px;
1205
1368
  `;
1206
- var criteriaOperatorWrapper = import_react11.css`
1369
+ var criteriaOperatorWrapper = import_react14.css`
1207
1370
  flex: 1;
1208
1371
  min-width: 80px;
1209
1372
  `;
1210
- var expand = import_react11.css`
1373
+ var expand = import_react14.css`
1211
1374
  height: 100%;
1212
1375
  width: 100%;
1213
1376
  `;
1214
1377
 
1215
1378
  // src/components/PersonalizationCriteria/PersonalizationCriteriaStatic.tsx
1216
- var import_jsx_runtime15 = require("@emotion/react/jsx-runtime");
1379
+ var import_jsx_runtime16 = require("@emotion/react/jsx-runtime");
1217
1380
  var PersonalizationCriteriaStatic = ({
1218
1381
  value,
1219
1382
  setValue,
@@ -1246,21 +1409,21 @@ var PersonalizationCriteriaStatic = ({
1246
1409
  };
1247
1410
  const update = (crit, index) => {
1248
1411
  setValue(
1249
- (0, import_immer2.default)(currentValue, (draft) => {
1412
+ (0, import_immer2.produce)(currentValue, (draft) => {
1250
1413
  draft.crit[index] = crit;
1251
1414
  })
1252
1415
  );
1253
1416
  };
1254
1417
  const removeFromList = (index) => {
1255
- const newValue = (0, import_immer2.default)(currentValue, (draft) => {
1418
+ const newValue = (0, import_immer2.produce)(currentValue, (draft) => {
1256
1419
  draft.crit.splice(index, 1);
1257
1420
  });
1258
1421
  const finalValue = newValue.crit.length === 0 ? null : newValue;
1259
1422
  setValue(finalValue);
1260
1423
  onRemoveCriteria == null ? void 0 : onRemoveCriteria(finalValue);
1261
1424
  };
1262
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("fieldset", { className: "personalization-criteria", children: [
1263
- displayTitle ? (components == null ? void 0 : components.Title) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(components.Title, {}) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1425
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("fieldset", { className: "personalization-criteria", "data-testid": "personalization-panel", children: [
1426
+ displayTitle ? (components == null ? void 0 : components.Title) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(components.Title, {}) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1264
1427
  "legend",
1265
1428
  {
1266
1429
  css: {
@@ -1270,27 +1433,27 @@ var PersonalizationCriteriaStatic = ({
1270
1433
  children: "Personalize This"
1271
1434
  }
1272
1435
  ) : null,
1273
- (components == null ? void 0 : components.CustomVariantName) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(components.CustomVariantName, {}) : null,
1274
- !currentValue.crit.length ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Callout, { title: "Default variant", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Paragraph, { children: 'This personalized variant has no match criteria and will be shown to any visitor that does not match any preceding variants. Ensure that default variants come last in the variant list. Personalize this variant by clicking "Add Criteria" to get started.' }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: currentValue.crit.map((currentCriteria, index) => {
1436
+ (components == null ? void 0 : components.CustomVariantName) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(components.CustomVariantName, {}) : null,
1437
+ !currentValue.crit.length ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.Callout, { title: "Default variant", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.Paragraph, { children: 'This personalized variant has no match criteria and will be shown to any visitor that does not match any preceding variants. Ensure that default variants come last in the variant list. Personalize this variant by clicking "Add Criteria" to get started.' }) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: currentValue.crit.map((currentCriteria, index) => {
1275
1438
  var _a2, _b, _c, _d;
1276
1439
  const critHasLhs = ((_a2 = currentCriteria.l) == null ? void 0 : _a2.length) > 0;
1277
1440
  const critHasRhs = currentCriteria.op !== "+" && currentCriteria.op !== "-";
1278
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { css: criteriaItem, "data-testid": "criteria-container", children: [
1279
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1441
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { css: criteriaItem, "data-testid": "criteria-container", children: [
1442
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1280
1443
  "div",
1281
1444
  {
1282
- css: import_react12.css`
1445
+ css: import_react15.css`
1283
1446
  ${criteriaItemInner}/* grid-template-columns: minmax(0, 1fr) ${critHasRhs ? "minmax(0, 79px) minmax(0, 1fr)" : "minmax(0, 1fr)"} */
1284
1447
  `,
1285
1448
  className: "criteriaItemInner",
1286
1449
  children: [
1287
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1450
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1288
1451
  "div",
1289
1452
  {
1290
1453
  css: [criteriaWrapper, criteriaOperandWrapper],
1291
1454
  className: "criteria-wrapper",
1292
1455
  "data-testid": "select-criteria",
1293
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1456
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1294
1457
  DimensionMenu,
1295
1458
  {
1296
1459
  errorMessage: (_b = errors.lhs) == null ? void 0 : _b[index],
@@ -1307,13 +1470,13 @@ var PersonalizationCriteriaStatic = ({
1307
1470
  )
1308
1471
  }
1309
1472
  ),
1310
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1473
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1311
1474
  "div",
1312
1475
  {
1313
1476
  css: [criteriaWrapper, criteriaOperatorWrapper],
1314
1477
  className: "criteria-wrapper",
1315
1478
  "data-testid": "select-operator",
1316
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1479
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1317
1480
  CriteriaOperatorMenu,
1318
1481
  {
1319
1482
  name: `op-${index}`,
@@ -1333,13 +1496,13 @@ var PersonalizationCriteriaStatic = ({
1333
1496
  )
1334
1497
  }
1335
1498
  ),
1336
- critHasRhs ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1499
+ critHasRhs ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1337
1500
  "div",
1338
1501
  {
1339
1502
  css: [criteriaWrapper, criteriaOperandWrapper],
1340
1503
  className: "criteria-wrapper",
1341
1504
  "data-testid": "select-match-criteria",
1342
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1505
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1343
1506
  CriteriaMatchMenu,
1344
1507
  {
1345
1508
  errorMessage: (_c = errors.rhs) == null ? void 0 : _c[index],
@@ -1360,7 +1523,7 @@ var PersonalizationCriteriaStatic = ({
1360
1523
  ]
1361
1524
  }
1362
1525
  ),
1363
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1526
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1364
1527
  "button",
1365
1528
  {
1366
1529
  type: "button",
@@ -1368,10 +1531,10 @@ var PersonalizationCriteriaStatic = ({
1368
1531
  title: `Delete Personalization`,
1369
1532
  css: { backgroundColor: "transparent", backgroundImage: "none", borderWidth: 0 },
1370
1533
  "data-testid": "button-delete",
1371
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Icon, { icon: import_CgCloseO2.CgCloseO, iconColor: "red", size: "1.5rem" })
1534
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.Icon, { icon: import_CgCloseO2.CgCloseO, iconColor: "red", size: "1.5rem" })
1372
1535
  }
1373
1536
  ),
1374
- index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1537
+ index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1375
1538
  "div",
1376
1539
  {
1377
1540
  className: "criteria-group-operation",
@@ -1380,8 +1543,8 @@ var PersonalizationCriteriaStatic = ({
1380
1543
  top: "-4rem",
1381
1544
  transform: "translateX(calc(1.5rem - 50%))"
1382
1545
  },
1383
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1384
- import_design_system9.InputInlineSelect,
1546
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1547
+ import_design_system10.InputInlineSelect,
1385
1548
  {
1386
1549
  "data-testid": "dropdown-button-combine",
1387
1550
  disabled: index > 1,
@@ -1399,8 +1562,8 @@ var PersonalizationCriteriaStatic = ({
1399
1562
  ) : null
1400
1563
  ] }, index);
1401
1564
  }) }),
1402
- dimensions.dimensions.length === 0 ? (components == null ? void 0 : components.NoDimensionsDefined) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(components.NoDimensionsDefined, {}) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_design_system9.Callout, { title: "Dimensions", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: "You do not have any dimensions configured." }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1403
- import_design_system9.AddListButton,
1565
+ dimensions.dimensions.length === 0 ? (components == null ? void 0 : components.NoDimensionsDefined) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(components.NoDimensionsDefined, {}) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.Callout, { title: "Dimensions", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { children: "You do not have any dimensions configured." }) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1566
+ import_design_system10.AddListButton,
1404
1567
  {
1405
1568
  "data-testid": "button-add-criteria",
1406
1569
  className: "add-more",
@@ -1412,7 +1575,7 @@ var PersonalizationCriteriaStatic = ({
1412
1575
  };
1413
1576
 
1414
1577
  // src/components/PersonalizationCriteria/PersonalizationCriteria.tsx
1415
- var import_jsx_runtime16 = require("@emotion/react/jsx-runtime");
1578
+ var import_jsx_runtime17 = require("@emotion/react/jsx-runtime");
1416
1579
  function convertErrorsToObj(errors) {
1417
1580
  const result = { crit: [] };
1418
1581
  errors.forEach((err) => {
@@ -1473,7 +1636,7 @@ var PersonalizationCriteria = ({
1473
1636
  ...staticProps
1474
1637
  }) => {
1475
1638
  var _a, _b;
1476
- const [validationError, setValidationError] = (0, import_react13.useState)(void 0);
1639
+ const [validationError, setValidationError] = (0, import_react16.useState)(void 0);
1477
1640
  const { loading, result: dimensions, error } = useDimensions(contextConfig);
1478
1641
  (0, import_react_use.useAsync)(async () => {
1479
1642
  if (value && dimensions) {
@@ -1482,15 +1645,15 @@ var PersonalizationCriteria = ({
1482
1645
  }
1483
1646
  }, [value, dimensions, validate]);
1484
1647
  if (error)
1485
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.Callout, { type: "danger", children: error });
1648
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system11.Callout, { type: "danger", children: error });
1486
1649
  if (loading || dimensions === null)
1487
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.LoadingIndicator, {});
1650
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system11.LoadingIndicator, {});
1488
1651
  const handleSetValue = async (value2) => {
1489
1652
  const err = await validate(value2, dimensions);
1490
1653
  setValidationError(err);
1491
1654
  setValue(value2);
1492
1655
  };
1493
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1656
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1494
1657
  PersonalizationCriteriaStatic,
1495
1658
  {
1496
1659
  ...staticProps,
@@ -1502,10 +1665,10 @@ var PersonalizationCriteria = ({
1502
1665
  },
1503
1666
  dimensions,
1504
1667
  components: {
1505
- NoDimensionsDefined: () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_design_system10.Callout, { title: "Dimensions", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { children: [
1668
+ NoDimensionsDefined: () => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system11.Callout, { title: "Dimensions", type: "info", css: { marginBlock: "var(--spacing-base)" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { children: [
1506
1669
  "You do not have any dimensions configured. Create your first",
1507
1670
  " ",
1508
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1671
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1509
1672
  "a",
1510
1673
  {
1511
1674
  href: `${contextConfig.apiHost}/projects/${encodeURIComponent(
@@ -1524,26 +1687,26 @@ var PersonalizationCriteria = ({
1524
1687
  };
1525
1688
 
1526
1689
  // src/components/ProjectUIVersion/ProjectUIVersion.tsx
1527
- var import_design_system11 = require("@uniformdev/design-system");
1528
- var import_jsx_runtime17 = require("@emotion/react/jsx-runtime");
1690
+ var import_design_system12 = require("@uniformdev/design-system");
1691
+ var import_jsx_runtime18 = require("@emotion/react/jsx-runtime");
1529
1692
  function ProjectUIVersion({ children, versionMap, contextConfig }) {
1530
1693
  const { loading, result: data } = useContextData(contextConfig);
1531
1694
  if (loading)
1532
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_design_system11.LoadingIndicator, {});
1695
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_design_system12.LoadingIndicator, {});
1533
1696
  if (data) {
1534
1697
  const Component = versionMap[data.project.ui_version];
1535
1698
  if (Component) {
1536
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Component, {});
1699
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Component, {});
1537
1700
  }
1538
1701
  }
1539
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx_runtime17.Fragment, { children });
1702
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children });
1540
1703
  }
1541
1704
 
1542
1705
  // src/hooks/useValidateContextConfig.ts
1543
- var import_react14 = require("react");
1706
+ var import_react17 = require("react");
1544
1707
 
1545
1708
  // src/utils/validateContextConfig.ts
1546
- var import_api3 = require("@uniformdev/context/api");
1709
+ var import_api4 = require("@uniformdev/context/api");
1547
1710
  var import_uuid = require("uuid");
1548
1711
  var validateContextConfig = async (contextConfig) => {
1549
1712
  if (!contextConfig) {
@@ -1558,7 +1721,7 @@ var validateContextConfig = async (contextConfig) => {
1558
1721
  if (!(0, import_uuid.validate)(contextConfig.apiKey) && !contextConfig.projectId) {
1559
1722
  return { valid: false, error: new Error("projectId is required when using a modern API key.") };
1560
1723
  }
1561
- const client = new import_api3.UncachedManifestClient({
1724
+ const client = new import_api4.UncachedManifestClient({
1562
1725
  projectId: contextConfig.projectId,
1563
1726
  apiKey: contextConfig.apiKey,
1564
1727
  apiHost: contextConfig.apiHost
@@ -1576,12 +1739,12 @@ var validateContextConfig = async (contextConfig) => {
1576
1739
 
1577
1740
  // src/hooks/useValidateContextConfig.ts
1578
1741
  var useValidateContextConfig = (contextConfig) => {
1579
- const [state, setState] = (0, import_react14.useState)({
1742
+ const [state, setState] = (0, import_react17.useState)({
1580
1743
  validating: false,
1581
1744
  error: void 0
1582
1745
  });
1583
1746
  const { apiKey, apiHost, projectId } = contextConfig || {};
1584
- (0, import_react14.useEffect)(() => {
1747
+ (0, import_react17.useEffect)(() => {
1585
1748
  if (!apiKey || !apiHost) {
1586
1749
  return;
1587
1750
  }
@@ -1607,6 +1770,7 @@ var useValidateContextConfig = (contextConfig) => {
1607
1770
  __reExport(src_exports, require("@uniformdev/design-system"), module.exports);
1608
1771
  // Annotate the CommonJS export names for ESM import in node:
1609
1772
  0 && (module.exports = {
1773
+ AbTestSelector,
1610
1774
  ContextData,
1611
1775
  CriteriaMatchMenu,
1612
1776
  CriteriaOperatorMenu,
@@ -1617,6 +1781,7 @@ __reExport(src_exports, require("@uniformdev/design-system"), module.exports);
1617
1781
  PersonalizationCriteria,
1618
1782
  PersonalizationCriteriaStatic,
1619
1783
  ProjectUIVersion,
1784
+ addAbTestLink,
1620
1785
  addEnrichmentLink,
1621
1786
  contextCriteriaMenuOperators,
1622
1787
  convertErrorsToObj,