@sparrowengg/integrations-templates-frontend 1.9.70 → 1.9.71

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.
@@ -1,4 +1,5 @@
1
1
  import { parseDate as $fae977aafc393c5c$export$6b862160d295c8e } from '../node_modules/@internationalized/date/dist/string.js';
2
+ import EditConfirmation from '../commons/components/edit-confirmation.js';
2
3
  import React__default, { useState, useEffect } from 'react';
3
4
  import Arrow from '../commons/icons/arrow.js';
4
5
  import Mapping from './components/mapping.js';
@@ -67,11 +68,26 @@ const SingleMapping = ({
67
68
  expressions: [],
68
69
  property: []
69
70
  });
71
+ const [isEditConfirmationOpen, setIsEditConfirmationOpen] = useState(false);
72
+ const [originalMappingData, setOriginalMappingData] = useState(null);
73
+ const [originalConfigurationFields, setOriginalConfigurationFields] = useState(null);
74
+ const [originalConfiguredFields, setOriginalConfiguredFields] = useState(null);
70
75
  useEffect(() => {
71
76
  if (!!(editField == null ? void 0 : editField.id)) {
72
77
  navigateMappingPage(true);
78
+ setOriginalMappingData(JSON.parse(JSON.stringify(ssMappingData)));
79
+ setOriginalConfigurationFields(JSON.parse(JSON.stringify(configuration.configurationFields)));
80
+ setOriginalConfiguredFields(JSON.parse(JSON.stringify(configuration.configuredFields)));
73
81
  }
74
82
  }, []);
83
+ const hasFieldsChanged = () => {
84
+ if (!(editField == null ? void 0 : editField.id) || !originalMappingData)
85
+ return true;
86
+ const mappingDataChanged = JSON.stringify(ssMappingData) !== JSON.stringify(originalMappingData);
87
+ const configFieldsChanged = JSON.stringify(configuration.configurationFields) !== JSON.stringify(originalConfigurationFields);
88
+ const configuredFieldsChanged = JSON.stringify(configuration.configuredFields) !== JSON.stringify(originalConfiguredFields);
89
+ return mappingDataChanged || configFieldsChanged || configuredFieldsChanged;
90
+ };
75
91
  return /* @__PURE__ */ React__default.createElement(
76
92
  ThemeProvider,
77
93
  {
@@ -85,10 +101,13 @@ const SingleMapping = ({
85
101
  /* @__PURE__ */ React__default.createElement(Box, { css: { width: "100%" } }, /* @__PURE__ */ React__default.createElement(
86
102
  MappingHeader,
87
103
  {
104
+ isEditConfirmationOpen,
105
+ setIsEditConfirmationOpen,
88
106
  editField,
89
107
  importResponse,
90
108
  ssMappingData,
91
109
  configuration,
110
+ hasFieldsChanged,
92
111
  saveConfiguration: () => {
93
112
  configuration.onSaveHandler();
94
113
  },
@@ -138,6 +157,7 @@ const SingleMapping = ({
138
157
  );
139
158
  };
140
159
  const MappingHeader = ({
160
+ isEditConfirmationOpen,
141
161
  editField,
142
162
  importResponse,
143
163
  hasExistingMapping,
@@ -147,20 +167,35 @@ const MappingHeader = ({
147
167
  onSaveHandler,
148
168
  previousMappingHandler,
149
169
  saveConfiguration,
150
- configuration
170
+ configuration,
171
+ setIsEditConfirmationOpen,
172
+ hasFieldsChanged
151
173
  }) => {
152
174
  const isButtonDisabled = () => {
153
175
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
154
176
  if (isMappingPage) {
177
+ if ((editField == null ? void 0 : editField.id) && !hasFieldsChanged()) {
178
+ return true;
179
+ }
155
180
  if ((importResponse == null ? void 0 : importResponse.value.ImportMethod) === "SEND_ALL_DATA") {
156
181
  return !(((_a = ssMappingData == null ? void 0 : ssMappingData.questions) == null ? void 0 : _a.length) || ((_b = ssMappingData == null ? void 0 : ssMappingData.variables) == null ? void 0 : _b.length) || ((_c = ssMappingData == null ? void 0 : ssMappingData.contactProperties) == null ? void 0 : _c.length) || ((_d = ssMappingData == null ? void 0 : ssMappingData.expressions) == null ? void 0 : _d.length) || ((_e = ssMappingData == null ? void 0 : ssMappingData.property) == null ? void 0 : _e.length));
157
182
  } else {
158
- const isMappingDisabled = ssMappingData.questions.some((question) => question.isEnabled) || ssMappingData.variables.some((variable) => variable.isEnabled) || ssMappingData.contactProperties.some((property) => property.isEnabled) || ssMappingData.expressions.some((expression) => expression.isEnabled) || ssMappingData.property.some((property) => property.isEnabled);
183
+ const isMappingDisabled = ssMappingData.questions.some((question) => question.isEnabled) || ssMappingData.variables.some((variable) => variable.isEnabled) || ssMappingData.contactProperties.some(
184
+ (property) => property.isEnabled
185
+ ) || ssMappingData.expressions.some(
186
+ (expression) => expression.isEnabled
187
+ ) || ssMappingData.property.some((property) => property.isEnabled);
159
188
  return !isMappingDisabled;
160
189
  }
161
190
  } else {
162
- const isAllFieldsDisabled = (_f = Object.values((configuration == null ? void 0 : configuration.configurationFields) || {})) == null ? void 0 : _f.some((field) => (field == null ? void 0 : field.value) === null || (field == null ? void 0 : field.value) === void 0);
163
- if ((_h = (_g = configuration == null ? void 0 : configuration.configurationFields) == null ? void 0 : _g.find((field) => (field == null ? void 0 : field.id) === "responseImportSettings")) == null ? void 0 : _h.value) {
191
+ const isAllFieldsDisabled = (_f = Object.values(
192
+ (configuration == null ? void 0 : configuration.configurationFields) || {}
193
+ )) == null ? void 0 : _f.some(
194
+ (field) => (field == null ? void 0 : field.value) === null || (field == null ? void 0 : field.value) === void 0
195
+ );
196
+ if ((_h = (_g = configuration == null ? void 0 : configuration.configurationFields) == null ? void 0 : _g.find(
197
+ (field) => (field == null ? void 0 : field.id) === "responseImportSettings"
198
+ )) == null ? void 0 : _h.value) {
164
199
  return isAllFieldsDisabled || !((_i = configuration == null ? void 0 : configuration.configuredFields) == null ? void 0 : _i.responseImportType);
165
200
  } else {
166
201
  return isAllFieldsDisabled;
@@ -169,8 +204,14 @@ const MappingHeader = ({
169
204
  };
170
205
  const isMappingPageDisabled = () => {
171
206
  var _a, _b, _c, _d;
172
- const isAllFieldsDisabled = (_a = Object.values((configuration == null ? void 0 : configuration.configurationFields) || {})) == null ? void 0 : _a.some((field) => (field == null ? void 0 : field.value) === null || (field == null ? void 0 : field.value) === void 0);
173
- if ((_c = (_b = configuration == null ? void 0 : configuration.configurationFields) == null ? void 0 : _b.find((field) => (field == null ? void 0 : field.id) === "responseImportSettings")) == null ? void 0 : _c.value) {
207
+ const isAllFieldsDisabled = (_a = Object.values(
208
+ (configuration == null ? void 0 : configuration.configurationFields) || {}
209
+ )) == null ? void 0 : _a.some(
210
+ (field) => (field == null ? void 0 : field.value) === null || (field == null ? void 0 : field.value) === void 0
211
+ );
212
+ if ((_c = (_b = configuration == null ? void 0 : configuration.configurationFields) == null ? void 0 : _b.find(
213
+ (field) => (field == null ? void 0 : field.id) === "responseImportSettings"
214
+ )) == null ? void 0 : _c.value) {
174
215
  return isAllFieldsDisabled || !((_d = configuration == null ? void 0 : configuration.configuredFields) == null ? void 0 : _d.responseImportType);
175
216
  } else {
176
217
  return isAllFieldsDisabled;
@@ -229,7 +270,10 @@ const MappingHeader = ({
229
270
  Button,
230
271
  {
231
272
  disabled: isMappingPageDisabled(),
232
- css: { color: isMappingPage ? "$neutral900" : "$neutral800", cursor: isMappingPageDisabled() ? "not-allowed" : "pointer" },
273
+ css: {
274
+ color: isMappingPage ? "$neutral900" : "$neutral800",
275
+ cursor: isMappingPageDisabled() ? "not-allowed" : "pointer"
276
+ },
233
277
  color: "default",
234
278
  variant: "ghost",
235
279
  onClick: () => {
@@ -244,23 +288,48 @@ const MappingHeader = ({
244
288
  "Mapping"
245
289
  )
246
290
  ),
247
- /* @__PURE__ */ React__default.createElement(Flex, { justifyContent: "end", css: {
248
- width: "180px"
249
- } }, /* @__PURE__ */ React__default.createElement(
250
- Button,
291
+ /* @__PURE__ */ React__default.createElement(
292
+ Flex,
251
293
  {
252
- size: "lg",
253
- disabled: isButtonDisabled(),
254
- onClick: () => {
255
- if (isMappingPage) {
256
- onSaveHandler();
257
- } else {
258
- saveConfiguration();
259
- }
294
+ justifyContent: "end",
295
+ css: {
296
+ width: "180px"
260
297
  }
261
298
  },
262
- isMappingPage ? (editField == null ? void 0 : editField.id) ? "Update Mapping" : "Save Mapping" : "Continue, Mapping"
263
- ))
299
+ /* @__PURE__ */ React__default.createElement(
300
+ Button,
301
+ {
302
+ size: "lg",
303
+ disabled: isButtonDisabled(),
304
+ onClick: () => {
305
+ if (isMappingPage) {
306
+ if (editField == null ? void 0 : editField.id) {
307
+ setIsEditConfirmationOpen(true);
308
+ } else {
309
+ onSaveHandler();
310
+ }
311
+ } else {
312
+ saveConfiguration();
313
+ }
314
+ }
315
+ },
316
+ isMappingPage ? (editField == null ? void 0 : editField.id) ? "Update Mapping" : "Save Mapping" : "Continue, Mapping"
317
+ )
318
+ ),
319
+ isEditConfirmationOpen && /* @__PURE__ */ React__default.createElement(
320
+ EditConfirmation,
321
+ {
322
+ name: "Are you sure?",
323
+ description: "Saving this updated mapping properties will generate new sheet with the revised mapping.",
324
+ onConfirm: async () => {
325
+ await onSaveHandler();
326
+ setIsEditConfirmationOpen(false);
327
+ },
328
+ onCancel: () => {
329
+ setIsEditConfirmationOpen(false);
330
+ }
331
+ }
332
+ )
264
333
  );
265
334
  };
266
335
  const ConfigurationSetup = ({
@@ -268,19 +337,26 @@ const ConfigurationSetup = ({
268
337
  surveyName
269
338
  }) => {
270
339
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
271
- return /* @__PURE__ */ React__default.createElement(Box, { css: { maxWidth: 488, width: "100%" } }, /* @__PURE__ */ React__default.createElement(Heading, { size: "h5" }, "Event Details"), /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", css: { marginTop: "$4" } }, /* @__PURE__ */ React__default.createElement(Text, { size: "sm", css: { color: "$neutral500" } }, "Survey Name:"), /* @__PURE__ */ React__default.createElement(Tooltip, { content: (surveyName == null ? void 0 : surveyName.length) > 25 ? surveyName : "", css: {
272
- zIndex: "9999999 !important",
273
- fontFamily: "DM Sans !important"
274
- } }, /* @__PURE__ */ React__default.createElement(Box, null, /* @__PURE__ */ React__default.createElement(
275
- Text,
340
+ return /* @__PURE__ */ React__default.createElement(Box, { css: { maxWidth: 488, width: "100%" } }, /* @__PURE__ */ React__default.createElement(Heading, { size: "h5" }, "Event Details"), /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", css: { marginTop: "$4" } }, /* @__PURE__ */ React__default.createElement(Text, { size: "sm", css: { color: "$neutral500" } }, "Survey Name:"), /* @__PURE__ */ React__default.createElement(
341
+ Tooltip,
276
342
  {
277
- size: "sm",
278
- weight: "medium",
279
- truncate: true,
280
- css: { color: "$neutral800", maxWidth: "270px" }
343
+ content: (surveyName == null ? void 0 : surveyName.length) > 25 ? surveyName : "",
344
+ css: {
345
+ zIndex: "9999999 !important",
346
+ fontFamily: "DM Sans !important"
347
+ }
281
348
  },
282
- surveyName
283
- )))), /* @__PURE__ */ React__default.createElement(
349
+ /* @__PURE__ */ React__default.createElement(Box, null, /* @__PURE__ */ React__default.createElement(
350
+ Text,
351
+ {
352
+ size: "sm",
353
+ weight: "medium",
354
+ truncate: true,
355
+ css: { color: "$neutral800", maxWidth: "270px" }
356
+ },
357
+ surveyName
358
+ ))
359
+ )), /* @__PURE__ */ React__default.createElement(
284
360
  Flex,
285
361
  {
286
362
  flexDirection: "column",
@@ -368,7 +444,7 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
368
444
  css: {
369
445
  width: "488px",
370
446
  marginBlockStart: "$2",
371
- "p": {
447
+ p: {
372
448
  margin: "0px !important"
373
449
  },
374
450
  zIndex: "99 !important"
@@ -409,31 +485,23 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
409
485
  width: "100%"
410
486
  }
411
487
  },
412
- /* @__PURE__ */ React__default.createElement(
413
- Flex,
488
+ /* @__PURE__ */ React__default.createElement(Flex, { justifyContent: "center", flexDirection: "column" }, /* @__PURE__ */ React__default.createElement(
489
+ Text,
414
490
  {
415
- justifyContent: "center",
416
- flexDirection: "column"
491
+ size: "sm",
492
+ weight: "regular",
493
+ css: { color: "$neutral900" }
417
494
  },
418
- /* @__PURE__ */ React__default.createElement(
419
- Text,
420
- {
421
- size: "sm",
422
- weight: "regular",
423
- css: { color: "$neutral900" }
424
- },
425
- option.label
426
- ),
427
- /* @__PURE__ */ React__default.createElement(
428
- Text,
429
- {
430
- size: "xs",
431
- weight: "regular",
432
- css: { color: "$neutral700" }
433
- },
434
- option.description
435
- )
436
- )
495
+ option.label
496
+ ), /* @__PURE__ */ React__default.createElement(
497
+ Text,
498
+ {
499
+ size: "xs",
500
+ weight: "regular",
501
+ css: { color: "$neutral700" }
502
+ },
503
+ option.description
504
+ ))
437
505
  )
438
506
  ))
439
507
  );
@@ -447,42 +515,53 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
447
515
  zIndex: "9999999 !important"
448
516
  }
449
517
  },
450
- /* @__PURE__ */ React__default.createElement(Box, null, /* @__PURE__ */ React__default.createElement(DropdownMenuSub, null, /* @__PURE__ */ React__default.createElement(DropdownMenuSubTrigger, { disabled: option == null ? void 0 : option.disabled, css: { cursor: (option == null ? void 0 : option.disabled) ? "not-allowed !important" : "pointer !important", background: (value == null ? void 0 : value.type) === option.type ? "#4A9CA626 !important" : "transparent !important" } }, " ", /* @__PURE__ */ React__default.createElement(
451
- Flex,
518
+ /* @__PURE__ */ React__default.createElement(Box, null, /* @__PURE__ */ React__default.createElement(DropdownMenuSub, null, /* @__PURE__ */ React__default.createElement(
519
+ DropdownMenuSubTrigger,
452
520
  {
453
- justifyContent: "space-between",
454
- alignItems: "center",
521
+ disabled: option == null ? void 0 : option.disabled,
455
522
  css: {
456
- width: "100%"
523
+ cursor: (option == null ? void 0 : option.disabled) ? "not-allowed !important" : "pointer !important",
524
+ background: (value == null ? void 0 : value.type) === option.type ? "#4A9CA626 !important" : "transparent !important"
457
525
  }
458
526
  },
527
+ " ",
459
528
  /* @__PURE__ */ React__default.createElement(
460
529
  Flex,
461
530
  {
462
- css: { cursor: "pointer" },
463
- justifyContent: "center",
464
- flexDirection: "column"
531
+ justifyContent: "space-between",
532
+ alignItems: "center",
533
+ css: {
534
+ width: "100%"
535
+ }
465
536
  },
466
537
  /* @__PURE__ */ React__default.createElement(
467
- Text,
468
- {
469
- size: "sm",
470
- weight: "regular",
471
- css: { color: "$neutral900" }
472
- },
473
- option.label
474
- ),
475
- /* @__PURE__ */ React__default.createElement(
476
- Text,
538
+ Flex,
477
539
  {
478
- size: "xs",
479
- weight: "regular",
480
- css: { color: "$neutral700" }
540
+ css: { cursor: "pointer" },
541
+ justifyContent: "center",
542
+ flexDirection: "column"
481
543
  },
482
- option.description
544
+ /* @__PURE__ */ React__default.createElement(
545
+ Text,
546
+ {
547
+ size: "sm",
548
+ weight: "regular",
549
+ css: { color: "$neutral900" }
550
+ },
551
+ option.label
552
+ ),
553
+ /* @__PURE__ */ React__default.createElement(
554
+ Text,
555
+ {
556
+ size: "xs",
557
+ weight: "regular",
558
+ css: { color: "$neutral700" }
559
+ },
560
+ option.description
561
+ )
483
562
  )
484
563
  )
485
- )), /* @__PURE__ */ React__default.createElement(
564
+ ), /* @__PURE__ */ React__default.createElement(
486
565
  DropdownMenuSubContent,
487
566
  {
488
567
  sideOffset: 10,
@@ -496,7 +575,7 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
496
575
  }, option.type === "date" && {
497
576
  border: "none !important"
498
577
  }), {
499
- "p": {
578
+ p: {
500
579
  margin: "0px !important"
501
580
  },
502
581
  marginBlockEnd: "$10 !important"
@@ -510,63 +589,139 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
510
589
  size: "md",
511
590
  value: date,
512
591
  onChange: setDate
513
- }, (option == null ? void 0 : option.minValue) && { minValue: $fae977aafc393c5c$export$6b862160d295c8e(option == null ? void 0 : option.minValue) }), (option == null ? void 0 : option.maxValue) && { maxValue: $fae977aafc393c5c$export$6b862160d295c8e(option == null ? void 0 : option.maxValue) }), {
592
+ }, (option == null ? void 0 : option.minValue) && {
593
+ minValue: $fae977aafc393c5c$export$6b862160d295c8e(option == null ? void 0 : option.minValue)
594
+ }), (option == null ? void 0 : option.maxValue) && {
595
+ maxValue: $fae977aafc393c5c$export$6b862160d295c8e(option == null ? void 0 : option.maxValue)
596
+ }), {
514
597
  footerAction: () => {
515
598
  onChangeHandler({
516
599
  id: "responseImportType",
517
600
  value: __spreadProps(__spreadValues({}, option), {
518
- value: dayjs(date.toString()).format("MMM D, YYYY")
601
+ value: dayjs(date.toString()).format(
602
+ "MMM D, YYYY"
603
+ )
519
604
  })
520
605
  });
521
606
  setOpen(false);
522
607
  }
523
608
  })
524
609
  ),
525
- option.type === "dateRange" && /* @__PURE__ */ React__default.createElement(Flex, { css: {
526
- paddingInline: "$4 !important",
527
- paddingBlock: "$8 !important"
528
- }, flexDirection: "column", gap: "$4" }, /* @__PURE__ */ React__default.createElement(RadioGroup, { defaultValue: value == null ? void 0 : value.value, onChange: (value2) => {
529
- var _a3;
530
- onChangeHandler({
531
- id: "responseImportType",
532
- value: __spreadProps(__spreadValues({}, option), {
533
- value: {
534
- type: value2,
535
- value: value2,
536
- label: (_a3 = dynamicDateOptions.find((option2) => option2.value === value2)) == null ? void 0 : _a3.label
610
+ option.type === "dateRange" && /* @__PURE__ */ React__default.createElement(
611
+ Flex,
612
+ {
613
+ css: {
614
+ paddingInline: "$4 !important",
615
+ paddingBlock: "$8 !important"
616
+ },
617
+ flexDirection: "column",
618
+ gap: "$4"
619
+ },
620
+ /* @__PURE__ */ React__default.createElement(
621
+ RadioGroup,
622
+ {
623
+ defaultValue: value == null ? void 0 : value.value,
624
+ onChange: (value2) => {
625
+ var _a3;
626
+ onChangeHandler({
627
+ id: "responseImportType",
628
+ value: __spreadProps(__spreadValues({}, option), {
629
+ value: {
630
+ type: value2,
631
+ value: value2,
632
+ label: (_a3 = dynamicDateOptions.find(
633
+ (option2) => option2.value === value2
634
+ )) == null ? void 0 : _a3.label
635
+ }
636
+ })
637
+ });
537
638
  }
538
- })
539
- });
540
- } }, dynamicDateOptions.map((option2) => /* @__PURE__ */ React__default.createElement(Box, { css: {
541
- padding: "$4 !important"
542
- } }, /* @__PURE__ */ React__default.createElement(Radio, { value: option2.value }, " ", option2.label, " ")))), ((_a2 = value == null ? void 0 : value.value) == null ? void 0 : _a2.type) === "custom" && /* @__PURE__ */ React__default.createElement(Box, { css: {
543
- paddingRight: "$4 !important",
544
- position: "relative"
545
- } }, /* @__PURE__ */ React__default.createElement(Input, { size: "md", variant: "filled", value: days, onChange: (e) => setDays(e.target.value) }), /* @__PURE__ */ React__default.createElement(Text, { css: {
546
- position: "absolute",
547
- right: "$8",
548
- top: "$3"
549
- } }, "Days")), /* @__PURE__ */ React__default.createElement(Flex, { justifyContent: "space-between", css: { borderBlockStart: "$borderWidths$xs, solid, $neutral200 !important", padding: "$8" } }, /* @__PURE__ */ React__default.createElement(Button, { size: "sm", variant: "ghost", color: "secondary" }, "Cancel"), /* @__PURE__ */ React__default.createElement(Button, { size: "sm", variant: "ghost", color: "primary", onClick: () => {
550
- var _a3, _b2;
551
- onChangeHandler({
552
- id: "responseImportType",
553
- value: __spreadProps(__spreadValues({}, option), {
554
- value: {
555
- type: (_a3 = value == null ? void 0 : value.value) == null ? void 0 : _a3.type,
639
+ },
640
+ dynamicDateOptions.map((option2) => /* @__PURE__ */ React__default.createElement(
641
+ Box,
642
+ {
643
+ css: {
644
+ padding: "$4 !important"
645
+ }
646
+ },
647
+ /* @__PURE__ */ React__default.createElement(Radio, { value: option2.value }, " ", option2.label, " ")
648
+ ))
649
+ ),
650
+ ((_a2 = value == null ? void 0 : value.value) == null ? void 0 : _a2.type) === "custom" && /* @__PURE__ */ React__default.createElement(
651
+ Box,
652
+ {
653
+ css: {
654
+ paddingRight: "$4 !important",
655
+ position: "relative"
656
+ }
657
+ },
658
+ /* @__PURE__ */ React__default.createElement(
659
+ Input,
660
+ {
661
+ size: "md",
662
+ variant: "filled",
556
663
  value: days,
557
- label: (_b2 = value == null ? void 0 : value.value) == null ? void 0 : _b2.label
664
+ onChange: (e) => setDays(e.target.value)
558
665
  }
559
- })
560
- });
561
- setOpen(false);
562
- } }, "Apply")))
666
+ ),
667
+ /* @__PURE__ */ React__default.createElement(
668
+ Text,
669
+ {
670
+ css: {
671
+ position: "absolute",
672
+ right: "$8",
673
+ top: "$3"
674
+ }
675
+ },
676
+ "Days"
677
+ )
678
+ ),
679
+ /* @__PURE__ */ React__default.createElement(
680
+ Flex,
681
+ {
682
+ justifyContent: "space-between",
683
+ css: {
684
+ borderBlockStart: "$borderWidths$xs, solid, $neutral200 !important",
685
+ padding: "$8"
686
+ }
687
+ },
688
+ /* @__PURE__ */ React__default.createElement(Button, { size: "sm", variant: "ghost", color: "secondary" }, "Cancel"),
689
+ /* @__PURE__ */ React__default.createElement(
690
+ Button,
691
+ {
692
+ size: "sm",
693
+ variant: "ghost",
694
+ color: "primary",
695
+ onClick: () => {
696
+ var _a3, _b2;
697
+ onChangeHandler({
698
+ id: "responseImportType",
699
+ value: __spreadProps(__spreadValues({}, option), {
700
+ value: {
701
+ type: (_a3 = value == null ? void 0 : value.value) == null ? void 0 : _a3.type,
702
+ value: days,
703
+ label: (_b2 = value == null ? void 0 : value.value) == null ? void 0 : _b2.label
704
+ }
705
+ })
706
+ });
707
+ setOpen(false);
708
+ }
709
+ },
710
+ "Apply"
711
+ )
712
+ )
713
+ )
563
714
  )))
564
715
  );
565
716
  }
566
717
  })
567
718
  ));
568
719
  };
569
- const Configuration = ({ field, configuredFields, responseImportType = null }) => {
720
+ const Configuration = ({
721
+ field,
722
+ configuredFields,
723
+ responseImportType = null
724
+ }) => {
570
725
  var _a, _b, _c, _d;
571
726
  let fieldValue = null;
572
727
  fieldValue = (_b = (_a = configuredFields == null ? void 0 : configuredFields[field.id]) == null ? void 0 : _a.value) != null ? _b : null;
@@ -577,27 +732,43 @@ const Configuration = ({ field, configuredFields, responseImportType = null }) =
577
732
  });
578
733
  switch (field.fieldType) {
579
734
  case "switch":
580
- return /* @__PURE__ */ React__default.createElement(Flex, { gap: "$4", alignItems: "center", css: {
581
- marginBlockStart: "$12",
582
- borderTop: "$borderWidths$xs solid $neutral200",
583
- paddingTop: "$16"
584
- } }, /* @__PURE__ */ React__default.createElement(
585
- Switch,
735
+ return /* @__PURE__ */ React__default.createElement(
736
+ Flex,
737
+ {
738
+ gap: "$4",
739
+ alignItems: "center",
740
+ css: {
741
+ marginBlockStart: "$12",
742
+ borderTop: "$borderWidths$xs solid $neutral200",
743
+ paddingTop: "$16"
744
+ }
745
+ },
746
+ /* @__PURE__ */ React__default.createElement(
747
+ Switch,
748
+ {
749
+ disabled: field == null ? void 0 : field.disabled,
750
+ size: "sm",
751
+ checked: field == null ? void 0 : field.value,
752
+ onChange: (value) => field.onChangeHandler({
753
+ id: field.id,
754
+ value
755
+ })
756
+ }
757
+ ),
758
+ /* @__PURE__ */ React__default.createElement(Text, { size: "md", weight: "regular", css: { color: "$neutral900" } }, field.label)
759
+ );
760
+ case "checkbox":
761
+ return /* @__PURE__ */ React__default.createElement(Flex, { flexDirection: "column", alignItems: "start", gap: "$4" }, /* @__PURE__ */ React__default.createElement(Flex, { gap: "$4", alignItems: "center" }, /* @__PURE__ */ React__default.createElement(
762
+ Checkbox,
586
763
  {
587
764
  disabled: field == null ? void 0 : field.disabled,
588
- size: "sm",
589
- checked: field == null ? void 0 : field.value,
765
+ checked: !!fieldValue,
590
766
  onChange: (value) => field.onChangeHandler({
591
767
  id: field.id,
592
768
  value
593
769
  })
594
770
  }
595
- ), /* @__PURE__ */ React__default.createElement(Text, { size: "md", weight: "regular", css: { color: "$neutral900" } }, field.label));
596
- case "checkbox":
597
- return /* @__PURE__ */ React__default.createElement(Flex, { flexDirection: "column", alignItems: "start", gap: "$4" }, /* @__PURE__ */ React__default.createElement(Flex, { gap: "$4", alignItems: "center" }, /* @__PURE__ */ React__default.createElement(Checkbox, { disabled: field == null ? void 0 : field.disabled, checked: !!fieldValue, onChange: (value) => field.onChangeHandler({
598
- id: field.id,
599
- value
600
- }) }), /* @__PURE__ */ React__default.createElement(Text, { size: "sm", weight: "regular", css: { color: "$neutral900" } }, field.label)), /* @__PURE__ */ React__default.createElement(Text, { size: "sm", weight: "regular", css: { color: "$neutral500" } }, field.value ? field.ifChecked() : field.ifUnchecked(responseImportType)));
771
+ ), /* @__PURE__ */ React__default.createElement(Text, { size: "sm", weight: "regular", css: { color: "$neutral900" } }, field.label)), /* @__PURE__ */ React__default.createElement(Text, { size: "sm", weight: "regular", css: { color: "$neutral500" } }, field.value ? field.ifChecked() : field.ifUnchecked(responseImportType)));
601
772
  case "input":
602
773
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, (field == null ? void 0 : field.id) === "spreadsheet" ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, ((_c = configuredFields == null ? void 0 : configuredFields.action) == null ? void 0 : _c.value) ? /* @__PURE__ */ React__default.createElement(
603
774
  Box,
@@ -775,16 +946,48 @@ const CustomAddNewSelect = ({ field }) => {
775
946
  };
776
947
  const CustomShareOption = (props) => {
777
948
  if (props.data.value === "ADD_NEW") {
778
- return /* @__PURE__ */ React__default.createElement(Tooltip, { content: props.data.tooltip || "", css: {
779
- zIndex: 999999999,
780
- fontFamily: "DM Sans !important"
781
- } }, /* @__PURE__ */ React__default.createElement(Box, null, /* @__PURE__ */ React__default.createElement(components.Option, __spreadValues({}, props), /* @__PURE__ */ React__default.createElement(Flex, { justifyContent: "center", alignItems: "center", css: { cursor: "pointer", zIndex: 999999999 } }, /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", alignItems: "center", css: {
782
- color: "$primary500",
783
- fontSize: "$sm",
784
- fontWeight: "$7"
785
- } }, /* @__PURE__ */ React__default.createElement(PlusIcon, { size: 16, color: "#4A9CA6" }), "Add Account")))));
949
+ return /* @__PURE__ */ React__default.createElement(
950
+ Tooltip,
951
+ {
952
+ content: props.data.tooltip || "",
953
+ css: {
954
+ zIndex: 999999999,
955
+ fontFamily: "DM Sans !important"
956
+ }
957
+ },
958
+ /* @__PURE__ */ React__default.createElement(Box, null, /* @__PURE__ */ React__default.createElement(components.Option, __spreadValues({}, props), /* @__PURE__ */ React__default.createElement(
959
+ Flex,
960
+ {
961
+ justifyContent: "center",
962
+ alignItems: "center",
963
+ css: { cursor: "pointer", zIndex: 999999999 }
964
+ },
965
+ /* @__PURE__ */ React__default.createElement(
966
+ Flex,
967
+ {
968
+ gap: "$2",
969
+ alignItems: "center",
970
+ css: {
971
+ color: "$primary500",
972
+ fontSize: "$sm",
973
+ fontWeight: "$7"
974
+ }
975
+ },
976
+ /* @__PURE__ */ React__default.createElement(PlusIcon, { size: 16, color: "#4A9CA6" }),
977
+ "Add Account"
978
+ )
979
+ )))
980
+ );
786
981
  } else {
787
- return /* @__PURE__ */ React__default.createElement(components.Option, __spreadValues({}, props), /* @__PURE__ */ React__default.createElement(Flex, { css: { cursor: "pointer", zIndex: 999999999 }, alignItems: "center", gap: "$2" }, /* @__PURE__ */ React__default.createElement(Text, { size: "sm" }, props.label)));
982
+ return /* @__PURE__ */ React__default.createElement(components.Option, __spreadValues({}, props), /* @__PURE__ */ React__default.createElement(
983
+ Flex,
984
+ {
985
+ css: { cursor: "pointer", zIndex: 999999999 },
986
+ alignItems: "center",
987
+ gap: "$2"
988
+ },
989
+ /* @__PURE__ */ React__default.createElement(Text, { size: "sm" }, props.label)
990
+ ));
788
991
  }
789
992
  };
790
993
  const CustomSingleValue = (props) => {