@bigbinary/neeto-thank-you-frontend 1.1.3 → 1.1.5

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
@@ -1,10 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useState, useEffect, useRef } from 'react';
3
- import { isPresent, hyphenate, noop } from '@bigbinary/neeto-cist';
3
+ import { hyphenate, noop } from '@bigbinary/neeto-cist';
4
4
  import Scrollable from '@bigbinary/neeto-molecules/Scrollable';
5
5
  import { t as t$1 } from 'i18next';
6
- import { isEditorEmpty, FormikEditor, EditorContent } from '@bigbinary/neeto-editor';
7
- import * as yup from 'yup';
8
6
  import classNames from 'classnames';
9
7
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
10
8
  import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
@@ -12,21 +10,24 @@ import BlockNavigation from '@bigbinary/neetoui/formik/BlockNavigation';
12
10
  import NeetoUIForm from '@bigbinary/neetoui/formik/Form';
13
11
  import Radio from '@bigbinary/neetoui/formik/Radio';
14
12
  import { isEmpty } from 'ramda';
15
- import { useMutationWithInvalidation } from '@bigbinary/neeto-commons-frontend/react-utils';
13
+ import { useMutationWithInvalidation, withT } from '@bigbinary/neeto-commons-frontend/react-utils';
16
14
  import { useQuery } from 'react-query';
17
15
  import axios from 'axios';
18
16
  import { useFormikContext } from 'formik';
17
+ import { FormikEditor, EditorContent, isEditorEmpty } from '@bigbinary/neeto-editor';
19
18
  import Label$1 from '@bigbinary/neetoui/Label';
20
19
  import Input from '@bigbinary/neetoui/formik/Input';
21
20
  import Switch from '@bigbinary/neetoui/formik/Switch';
22
21
  import { useTranslation, Trans } from 'react-i18next';
23
22
  import { ImageUploader } from '@bigbinary/neeto-image-uploader-frontend';
23
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
24
24
  import Button from '@bigbinary/neetoui/Button';
25
25
  import Typography from '@bigbinary/neetoui/Typography';
26
26
  import Modal from '@bigbinary/neetoui/Modal';
27
27
  import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
28
28
  import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
29
29
  import { Link } from '@bigbinary/neeto-icons';
30
+ import * as yup from 'yup';
30
31
  import NeetoUIHeader from '@bigbinary/neeto-molecules/Header';
31
32
 
32
33
  var FORM_OPTIONS = {
@@ -45,25 +46,6 @@ var DEFAULT_IMAGE_PROPERTIES = {
45
46
  imageSignedId: null,
46
47
  imageUrl: ""
47
48
  };
48
- var VALIDATION_SCHEMA = yup.object().shape({
49
- kind: yup.string().required(),
50
- message: yup.string().test("message", t$1("neetoThankYou.thankYou.validations.messageRequired"), function (value) {
51
- return !isEditorEmpty(value);
52
- }),
53
- socialSharingEnabled: yup.bool(),
54
- showResubmitLink: yup.bool(),
55
- resubmitLinkText: yup.string().when("showResubmitLink", {
56
- is: true,
57
- then: yup.string().required(t$1("neetoThankYou.thankYou.validations.resubmitLinkTextIsRequired"))
58
- }),
59
- redirectUrl: yup.string().when("kind", {
60
- is: FORM_OPTIONS.externalLink.kind,
61
- then: yup.string().url(t$1("neetoThankYou.thankYou.validations.invalidLink")).required(t$1("neetoThankYou.thankYou.validations.invalidLink")).when("kind", {
62
- is: FORM_OPTIONS.customize.kind,
63
- then: yup.string()
64
- })
65
- })
66
- });
67
49
  var EXTERNAL_URL_PREFIX = "https://";
68
50
  var THANK_YOU_TEXT_ALIGNMENTS = {
69
51
  left: "left",
@@ -139,8 +121,8 @@ var QUERY_KEYS = {
139
121
  THANK_YOU_PAGE: "thank-you-page"
140
122
  };
141
123
 
142
- function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
143
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
124
+ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
125
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
144
126
  var useShowThankYouConfiguration = function useShowThankYouConfiguration(_ref) {
145
127
  var entityId = _ref.entityId;
146
128
  return useQuery([QUERY_KEYS.THANK_YOU_CONFIGURATION, entityId], function () {
@@ -155,7 +137,7 @@ var useUpdateThankYouConfiguration = function useUpdateThankYouConfiguration(opt
155
137
  entityId: entityId,
156
138
  payload: payload
157
139
  });
158
- }, _objectSpread$2({
140
+ }, _objectSpread$3({
159
141
  keysToInvalidate: [QUERY_KEYS.THANK_YOU_CONFIGURATION]
160
142
  }, options));
161
143
  };
@@ -233,43 +215,50 @@ var Image = function Image() {
233
215
  setFieldValue("imageUrl", image.url);
234
216
  setFieldValue("imageSignedId", image.signedId);
235
217
  };
236
- return /*#__PURE__*/React__default.createElement(ImageUploader, {
218
+ return /*#__PURE__*/jsx(ImageUploader, {
237
219
  className: "h-60",
238
- key: values.imageUrl,
239
220
  src: values.imageUrl,
240
221
  uploadConfig: IMAGE_UPLOADER_CONFIG,
241
222
  onUploadComplete: handleImageChange
242
- });
223
+ }, values.imageUrl);
243
224
  };
244
225
 
245
- var ResubmissionWarningModal = function ResubmissionWarningModal(_ref) {
246
- var isOpen = _ref.isOpen,
226
+ var ResubmissionWarningModal = withT(function (_ref) {
227
+ var t = _ref.t,
228
+ isOpen = _ref.isOpen,
247
229
  setIsOpen = _ref.setIsOpen,
248
230
  uniqueSubmissionLink = _ref.uniqueSubmissionLink;
249
- var _useTranslation = useTranslation(),
250
- t = _useTranslation.t;
251
- return /*#__PURE__*/React__default.createElement(Modal, {
231
+ return /*#__PURE__*/jsxs(Modal, {
252
232
  isOpen: isOpen,
253
233
  onClose: function onClose() {
254
234
  return setIsOpen(false);
255
- }
256
- }, /*#__PURE__*/React__default.createElement(Modal.Header, null, /*#__PURE__*/React__default.createElement(Typography, {
257
- style: "h3",
258
- weight: "semibold"
259
- }, t("neetoThankYou.common.alert"), "!")), /*#__PURE__*/React__default.createElement(Modal.Body, null, t("neetoThankYou.thankYou.resubmissionWarning")), /*#__PURE__*/React__default.createElement(Modal.Footer, {
260
- className: "space-x-2"
261
- }, /*#__PURE__*/React__default.createElement(Button, {
262
- label: t("neetoThankYou.thankYou.uniqueSubmissionLinkText"),
263
- to: uniqueSubmissionLink
264
- }), /*#__PURE__*/React__default.createElement(Button, {
265
- label: t("neetoThankYou.common.ok"),
266
- style: "text",
267
- onClick: function onClick() {
268
- return setIsOpen(false);
269
- }
270
- })));
271
- };
235
+ },
236
+ children: [/*#__PURE__*/jsx(Modal.Header, {
237
+ children: /*#__PURE__*/jsxs(Typography, {
238
+ style: "h3",
239
+ weight: "semibold",
240
+ children: [t("neetoThankYou.common.alert"), "!"]
241
+ })
242
+ }), /*#__PURE__*/jsx(Modal.Body, {
243
+ children: t("neetoThankYou.thankYou.resubmissionWarning")
244
+ }), /*#__PURE__*/jsxs(Modal.Footer, {
245
+ className: "space-x-2",
246
+ children: [/*#__PURE__*/jsx(Button, {
247
+ label: t("neetoThankYou.common.ok"),
248
+ style: "tertiary",
249
+ onClick: function onClick() {
250
+ return setIsOpen(false);
251
+ }
252
+ }), /*#__PURE__*/jsx(Button, {
253
+ label: t("neetoThankYou.thankYou.uniqueSubmissionLinkText"),
254
+ to: uniqueSubmissionLink
255
+ })]
256
+ })]
257
+ });
258
+ });
272
259
 
260
+ function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
261
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
273
262
  var Customize = function Customize(_ref) {
274
263
  var editorRef = _ref.editorRef,
275
264
  uniqueSubmissionEnabled = _ref.uniqueSubmissionEnabled,
@@ -277,7 +266,8 @@ var Customize = function Customize(_ref) {
277
266
  uniqueSubmissionLink = _ref.uniqueSubmissionLink,
278
267
  entityId = _ref.entityId,
279
268
  disableSocialShare = _ref.disableSocialShare,
280
- disableSubmitAnotherResponse = _ref.disableSubmitAnotherResponse;
269
+ disableSubmitAnotherResponse = _ref.disableSubmitAnotherResponse,
270
+ editorProps = _ref.editorProps;
281
271
  var _useState = useState(false),
282
272
  _useState2 = _slicedToArray(_useState, 2),
283
273
  isUniqueSubmissionWarningModalOpen = _useState2[0],
@@ -303,37 +293,44 @@ var Customize = function Customize(_ref) {
303
293
  var handleResubmitLinkChange = function handleResubmitLinkChange(event) {
304
294
  uniqueSubmissionEnabled ? setIsUniqueSubmissionWarningModalOpen(true) : setFieldValue("showResubmitLink", event.target.checked);
305
295
  };
306
- return /*#__PURE__*/React__default.createElement("div", {
307
- className: "flex flex-col gap-4"
308
- }, hasImageUploader && /*#__PURE__*/React__default.createElement("div", {
309
- className: "flex flex-col gap-2"
310
- }, /*#__PURE__*/React__default.createElement(Label$1, null, t("neetoThankYou.thankYou.imageLabel")), /*#__PURE__*/React__default.createElement(Image, null)), /*#__PURE__*/React__default.createElement("div", {
311
- className: "flex flex-col gap-2"
312
- }, /*#__PURE__*/React__default.createElement(FormikEditor, {
313
- required: true,
314
- "data-cy": "thank-you-message-editor",
315
- label: t("neetoThankYou.thankYou.messageLabel"),
316
- name: "message",
317
- ref: editorRef
318
- })), !disableSocialShare && /*#__PURE__*/React__default.createElement(Switch, {
319
- label: t("neetoThankYou.thankYou.socialShareIcons"),
320
- name: "socialSharingEnabled"
321
- }), !disableSubmitAnotherResponse && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Switch, {
322
- label: t("neetoThankYou.thankYou.showResubmitLink"),
323
- name: "showResubmitLink",
324
- className: classNames({
325
- "neeto-ui-switch--disabled": uniqueSubmissionEnabled
326
- }),
327
- onChange: handleResubmitLinkChange
328
- }), values.showResubmitLink && /*#__PURE__*/React__default.createElement(Input, {
329
- required: true,
330
- label: t("neetoThankYou.thankYou.resubmitLinkText"),
331
- name: "resubmitLinkText"
332
- })), /*#__PURE__*/React__default.createElement(ResubmissionWarningModal, {
333
- uniqueSubmissionLink: uniqueSubmissionLink,
334
- isOpen: isUniqueSubmissionWarningModalOpen,
335
- setIsOpen: setIsUniqueSubmissionWarningModalOpen
336
- }));
296
+ return /*#__PURE__*/jsxs("div", {
297
+ className: "flex flex-col gap-4",
298
+ children: [hasImageUploader && /*#__PURE__*/jsxs("div", {
299
+ className: "flex flex-col gap-2",
300
+ children: [/*#__PURE__*/jsx(Label$1, {
301
+ children: t("neetoThankYou.thankYou.imageLabel")
302
+ }), /*#__PURE__*/jsx(Image, {})]
303
+ }), /*#__PURE__*/jsx("div", {
304
+ className: "flex flex-col gap-2",
305
+ children: /*#__PURE__*/jsx(FormikEditor, _objectSpread$2({
306
+ required: true,
307
+ "data-cy": "thank-you-message-editor",
308
+ label: t("neetoThankYou.thankYou.messageLabel"),
309
+ name: "message",
310
+ ref: editorRef
311
+ }, editorProps))
312
+ }), !disableSocialShare && /*#__PURE__*/jsx(Switch, {
313
+ label: t("neetoThankYou.thankYou.socialShareIcons"),
314
+ name: "socialSharingEnabled"
315
+ }), !disableSubmitAnotherResponse && /*#__PURE__*/jsxs(Fragment, {
316
+ children: [/*#__PURE__*/jsx(Switch, {
317
+ label: t("neetoThankYou.thankYou.showResubmitLink"),
318
+ name: "showResubmitLink",
319
+ className: classNames({
320
+ "neeto-ui-switch--disabled": uniqueSubmissionEnabled
321
+ }),
322
+ onChange: handleResubmitLinkChange
323
+ }), values.showResubmitLink && /*#__PURE__*/jsx(Input, {
324
+ required: true,
325
+ label: t("neetoThankYou.thankYou.resubmitLinkText"),
326
+ name: "resubmitLinkText"
327
+ })]
328
+ }), /*#__PURE__*/jsx(ResubmissionWarningModal, {
329
+ uniqueSubmissionLink: uniqueSubmissionLink,
330
+ isOpen: isUniqueSubmissionWarningModalOpen,
331
+ setIsOpen: setIsUniqueSubmissionWarningModalOpen
332
+ })]
333
+ });
337
334
  };
338
335
 
339
336
  var ENVIRONMENTS = {
@@ -363,24 +360,27 @@ var BrandingInfo = function BrandingInfo(_ref) {
363
360
  var _brandingInfo$additio;
364
361
  var brandingInfo = _ref.brandingInfo,
365
362
  appName = _ref.appName;
366
- return /*#__PURE__*/React__default.createElement("div", {
367
- className: "neeto-thank-you-configuration__branding-wrap"
368
- }, /*#__PURE__*/React__default.createElement("div", {
369
- className: "neeto-thank-you-configuration__nav"
370
- }, /*#__PURE__*/React__default.createElement("div", {
371
- className: "neeto-thank-you-configuration__nav-footer"
372
- }, /*#__PURE__*/React__default.createElement(Trans, {
373
- i18nKey: brandingInfo.displayText,
374
- components: _objectSpread$1({
375
- signUpLink: /*#__PURE__*/React__default.createElement("a", {
376
- className: "neeto-thank-you-configuration__link",
377
- href: buildSignUpUrl(appName),
378
- rel: "noreferrer",
379
- target: "_blank"
380
- }),
381
- span: /*#__PURE__*/React__default.createElement("span", null)
382
- }, (_brandingInfo$additio = brandingInfo.additionalComponents) !== null && _brandingInfo$additio !== void 0 ? _brandingInfo$additio : {})
383
- }))));
363
+ return /*#__PURE__*/jsx("div", {
364
+ className: "neeto-thank-you-configuration__branding-wrap",
365
+ children: /*#__PURE__*/jsx("div", {
366
+ className: "neeto-thank-you-configuration__nav",
367
+ children: /*#__PURE__*/jsx("div", {
368
+ className: "neeto-thank-you-configuration__nav-footer",
369
+ children: /*#__PURE__*/jsx(Trans, {
370
+ i18nKey: brandingInfo.displayText,
371
+ components: _objectSpread$1({
372
+ signUpLink: /*#__PURE__*/jsx("a", {
373
+ className: "neeto-thank-you-configuration__link",
374
+ href: buildSignUpUrl(appName),
375
+ rel: "noreferrer",
376
+ target: "_blank"
377
+ }),
378
+ span: /*#__PURE__*/jsx("span", {})
379
+ }, (_brandingInfo$additio = brandingInfo.additionalComponents) !== null && _brandingInfo$additio !== void 0 ? _brandingInfo$additio : {})
380
+ })
381
+ })
382
+ })
383
+ });
384
384
  };
385
385
 
386
386
  var _ellipse, _ellipse2, _ellipse3;
@@ -415,24 +415,28 @@ var SocialShare = function SocialShare(_ref) {
415
415
  publicLinkId = _ref.publicLinkId;
416
416
  var _useTranslation = useTranslation(),
417
417
  t = _useTranslation.t;
418
- return /*#__PURE__*/React__default.createElement("div", {
419
- className: "neeto-thank-you-configuration__social-share"
420
- }, /*#__PURE__*/React__default.createElement("h3", {
421
- className: "neeto-thank-you-configuration__social-share-title"
422
- }, t("neetoThankYou.thankYou.socialShareHeading")), /*#__PURE__*/React__default.createElement("div", {
423
- className: "neeto-thank-you-configuration-social-follow"
424
- }, socialHandles === null || socialHandles === void 0 ? void 0 : socialHandles.map(function (data, idx) {
425
- var Icon = data.icon,
426
- generateShareUrl = data.generateShareUrl;
427
- return /*#__PURE__*/React__default.createElement("div", {
428
- className: "neeto-thank-you-configuration-social-follow__item",
429
- key: idx
430
- }, /*#__PURE__*/React__default.createElement("a", {
431
- href: generateShareUrl(publicLinkId),
432
- rel: "noreferrer",
433
- target: "_blank"
434
- }, /*#__PURE__*/React__default.createElement(Icon, null)));
435
- })));
418
+ return /*#__PURE__*/jsxs("div", {
419
+ className: "neeto-thank-you-configuration__social-share",
420
+ children: [/*#__PURE__*/jsx("h3", {
421
+ className: "neeto-thank-you-configuration__social-share-title",
422
+ children: t("neetoThankYou.thankYou.socialShareHeading")
423
+ }), /*#__PURE__*/jsx("div", {
424
+ className: "neeto-thank-you-configuration-social-follow",
425
+ children: socialHandles === null || socialHandles === void 0 ? void 0 : socialHandles.map(function (data, idx) {
426
+ var Icon = data.icon,
427
+ generateShareUrl = data.generateShareUrl;
428
+ return /*#__PURE__*/jsx("div", {
429
+ className: "neeto-thank-you-configuration-social-follow__item",
430
+ children: /*#__PURE__*/jsx("a", {
431
+ href: generateShareUrl(publicLinkId),
432
+ rel: "noreferrer",
433
+ target: "_blank",
434
+ children: /*#__PURE__*/jsx(Icon, {})
435
+ })
436
+ }, idx);
437
+ })
438
+ })]
439
+ });
436
440
  };
437
441
 
438
442
  var MemoizedEditorContent = /*#__PURE__*/React__default.memo(EditorContent);
@@ -449,59 +453,69 @@ var Preview = function Preview(_ref) {
449
453
  values = _useFormikContext.values;
450
454
  var _useTranslation = useTranslation(),
451
455
  t = _useTranslation.t;
452
- return /*#__PURE__*/React__default.createElement("div", {
453
- className: "flex flex-col"
454
- }, /*#__PURE__*/React__default.createElement(Typography, {
455
- className: "mb-3 block md:hidden",
456
- lineHeight: "normal",
457
- style: "h3",
458
- weight: "semibold"
459
- }, t("neetoThankYou.thankYou.preview")), /*#__PURE__*/React__default.createElement("div", {
460
- className: classNames("neeto-thank-you-configuration-preview", {
461
- "neeto-thank-you-configuration-alignment--left": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.left,
462
- "neeto-thank-you-configuration-alignment--center": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.center,
463
- "pointer-events-none": !isPublished
464
- })
465
- }, /*#__PURE__*/React__default.createElement("div", {
466
- className: "neeto-thank-you-configuration-preview__browser-header"
467
- }, /*#__PURE__*/React__default.createElement(SvgBrowserControls, null)), /*#__PURE__*/React__default.createElement("div", {
468
- className: "neeto-thank-you-configuration"
469
- }, /*#__PURE__*/React__default.createElement("main", {
470
- className: "neeto-thank-you-configuration__main"
471
- }, /*#__PURE__*/React__default.createElement("div", {
472
- className: "neeto-thank-you-configuration__box"
473
- }, !isEmpty(values === null || values === void 0 ? void 0 : values.imageUrl) && /*#__PURE__*/React__default.createElement("div", {
474
- className: "neeto-thank-you-configuration__img"
475
- }, /*#__PURE__*/React__default.createElement("img", {
476
- alt: "",
477
- src: values.imageUrl
478
- })), (values === null || values === void 0 ? void 0 : values.message) && /*#__PURE__*/React__default.createElement("div", {
479
- className: "neeto-thank-you-configuration__description"
480
- }, /*#__PURE__*/React__default.createElement(MemoizedEditorContent, {
481
- content: values.message,
482
- "data-cy": "preview-editor-content"
483
- })), (values === null || values === void 0 ? void 0 : values.showResubmitLink) && /*#__PURE__*/React__default.createElement("a", {
484
- className: "neeto-thank-you-configuration__resubmit",
485
- href: resubmitLink
486
- }, (_values$resubmitLinkT = values === null || values === void 0 ? void 0 : values.resubmitLinkText) !== null && _values$resubmitLinkT !== void 0 ? _values$resubmitLinkT : t("neetoThankYou.thankYou.resubmit")), (values === null || values === void 0 ? void 0 : values.socialSharingEnabled) && /*#__PURE__*/React__default.createElement(SocialShare, {
487
- publicLinkId: publicLinkId,
488
- socialHandles: socialHandles
489
- })))), (values === null || values === void 0 ? void 0 : values.brandingEnabled) && isPresent(brandingInfo) && /*#__PURE__*/React__default.createElement(BrandingInfo, {
490
- appName: appName,
491
- brandingInfo: brandingInfo
492
- })));
456
+ return /*#__PURE__*/jsxs("div", {
457
+ className: "flex flex-col",
458
+ children: [/*#__PURE__*/jsx(Typography, {
459
+ className: "mb-3 block md:hidden",
460
+ lineHeight: "normal",
461
+ style: "h3",
462
+ weight: "semibold",
463
+ children: t("neetoThankYou.thankYou.preview")
464
+ }), /*#__PURE__*/jsxs("div", {
465
+ className: classNames("neeto-thank-you-configuration-preview", {
466
+ "neeto-thank-you-configuration-alignment--left": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.left,
467
+ "neeto-thank-you-configuration-alignment--center": thankYouTextAlignment === THANK_YOU_TEXT_ALIGNMENTS.center,
468
+ "pointer-events-none": !isPublished
469
+ }),
470
+ children: [/*#__PURE__*/jsx("div", {
471
+ className: "neeto-thank-you-configuration-preview__browser-header",
472
+ children: /*#__PURE__*/jsx(SvgBrowserControls, {})
473
+ }), /*#__PURE__*/jsx("div", {
474
+ className: "neeto-thank-you-configuration",
475
+ children: /*#__PURE__*/jsx("main", {
476
+ className: "neeto-thank-you-configuration__main",
477
+ children: /*#__PURE__*/jsxs("div", {
478
+ className: "neeto-thank-you-configuration__box",
479
+ children: [!isEmpty(values === null || values === void 0 ? void 0 : values.imageUrl) && /*#__PURE__*/jsx("div", {
480
+ className: "neeto-thank-you-configuration__img",
481
+ children: /*#__PURE__*/jsx("img", {
482
+ alt: "",
483
+ src: values.imageUrl
484
+ })
485
+ }), (values === null || values === void 0 ? void 0 : values.message) && /*#__PURE__*/jsx("div", {
486
+ className: "neeto-thank-you-configuration__description",
487
+ children: /*#__PURE__*/jsx(MemoizedEditorContent, {
488
+ content: values.message,
489
+ "data-cy": "preview-editor-content"
490
+ })
491
+ }), (values === null || values === void 0 ? void 0 : values.showResubmitLink) && /*#__PURE__*/jsx("a", {
492
+ className: "neeto-thank-you-configuration__resubmit",
493
+ href: resubmitLink,
494
+ children: (_values$resubmitLinkT = values === null || values === void 0 ? void 0 : values.resubmitLinkText) !== null && _values$resubmitLinkT !== void 0 ? _values$resubmitLinkT : t("neetoThankYou.thankYou.resubmit")
495
+ }), (values === null || values === void 0 ? void 0 : values.socialSharingEnabled) && /*#__PURE__*/jsx(SocialShare, {
496
+ publicLinkId: publicLinkId,
497
+ socialHandles: socialHandles
498
+ })]
499
+ })
500
+ })
501
+ }), (values === null || values === void 0 ? void 0 : values.brandingEnabled) && /*#__PURE__*/jsx(BrandingInfo, {
502
+ appName: appName,
503
+ brandingInfo: brandingInfo
504
+ })]
505
+ })]
506
+ });
493
507
  };
494
508
 
495
509
  var ExternalLink = function ExternalLink() {
496
510
  var _useTranslation = useTranslation(),
497
511
  t = _useTranslation.t;
498
- return /*#__PURE__*/React__default.createElement(Input, {
512
+ return /*#__PURE__*/jsx(Input, {
499
513
  autoFocus: true,
500
514
  required: true,
501
515
  label: t("neetoThankYou.thankYou.link"),
502
516
  name: "redirectUrl",
503
517
  placeholder: EXTERNAL_URL_PREFIX,
504
- prefix: /*#__PURE__*/React__default.createElement(Link, null)
518
+ prefix: /*#__PURE__*/jsx(Link, {})
505
519
  });
506
520
  };
507
521
 
@@ -509,15 +523,40 @@ var Label = function Label(_ref) {
509
523
  var label = _ref.label,
510
524
  description = _ref.description,
511
525
  kind = _ref.kind;
512
- return /*#__PURE__*/React__default.createElement(Typography, {
526
+ return /*#__PURE__*/jsxs(Typography, {
513
527
  className: "neeto-ui-text-gray-700",
514
528
  "data-cy": "neeto-thank-you-configuration-".concat(hyphenate(kind), "-label"),
515
529
  style: "body2",
516
- weight: "semibold"
517
- }, label, /*#__PURE__*/React__default.createElement("span", {
518
- className: "block text-xs font-normal leading-snug",
519
- "data-cy": "neeto-thank-you-configuration-".concat(hyphenate(kind), "-description")
520
- }, description));
530
+ weight: "semibold",
531
+ children: [label, /*#__PURE__*/jsx("span", {
532
+ className: "block text-xs font-normal leading-snug",
533
+ "data-cy": "neeto-thank-you-configuration-".concat(hyphenate(kind), "-description"),
534
+ children: description
535
+ })]
536
+ });
537
+ };
538
+
539
+ var buildValidationSchema = function buildValidationSchema() {
540
+ var allowEmptyCustomMessage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
541
+ return yup.object().shape({
542
+ kind: yup.string().required(),
543
+ message: yup.string().test("message", t$1("neetoThankYou.thankYou.validations.messageRequired"), function (value) {
544
+ return allowEmptyCustomMessage || !isEditorEmpty(value);
545
+ }),
546
+ socialSharingEnabled: yup.bool(),
547
+ showResubmitLink: yup.bool(),
548
+ resubmitLinkText: yup.string().when("showResubmitLink", {
549
+ is: true,
550
+ then: yup.string().required(t$1("neetoThankYou.thankYou.validations.resubmitLinkTextIsRequired"))
551
+ }),
552
+ redirectUrl: yup.string().when("kind", {
553
+ is: FORM_OPTIONS.externalLink.kind,
554
+ then: yup.string().url(t$1("neetoThankYou.thankYou.validations.invalidLink")).required(t$1("neetoThankYou.thankYou.validations.invalidLink")).when("kind", {
555
+ is: FORM_OPTIONS.customize.kind,
556
+ then: yup.string()
557
+ })
558
+ })
559
+ });
521
560
  };
522
561
 
523
562
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -538,7 +577,10 @@ var Form = function Form(_ref) {
538
577
  appName = _ref.appName,
539
578
  blockNavigation = _ref.blockNavigation,
540
579
  onConfigUpdateSuccess = _ref.onConfigUpdateSuccess,
541
- brandingInfo = _ref.brandingInfo;
580
+ brandingInfo = _ref.brandingInfo,
581
+ editorProps = _ref.editorProps,
582
+ CustomPreview = _ref.preview,
583
+ allowEmptyCustomMessage = _ref.allowEmptyCustomMessage;
542
584
  var _useShowThankYouConfi = useShowThankYouConfiguration({
543
585
  entityId: entityId
544
586
  }),
@@ -553,19 +595,20 @@ var Form = function Form(_ref) {
553
595
  editor: {}
554
596
  });
555
597
  if (isLoading) {
556
- return /*#__PURE__*/React__default.createElement("div", {
557
- className: "flex h-full w-full items-center justify-center"
558
- }, /*#__PURE__*/React__default.createElement(PageLoader, null));
598
+ return /*#__PURE__*/jsx("div", {
599
+ className: "flex h-full w-full items-center justify-center",
600
+ children: /*#__PURE__*/jsx(PageLoader, {})
601
+ });
559
602
  }
560
603
  var resetEditor = function resetEditor() {
561
604
  var _editorRef$current$ed;
562
605
  return (_editorRef$current$ed = editorRef.current.editor) === null || _editorRef$current$ed === void 0 ? void 0 : _editorRef$current$ed.commands.setContent(thankYouConfiguration.message);
563
606
  };
564
- return /*#__PURE__*/React__default.createElement(NeetoUIForm, {
607
+ return /*#__PURE__*/jsx(NeetoUIForm, {
565
608
  formikProps: {
566
609
  enableReinitialize: true,
567
610
  initialValues: _objectSpread(_objectSpread({}, DEFAULT_IMAGE_PROPERTIES), thankYouConfiguration),
568
- validationSchema: VALIDATION_SCHEMA,
611
+ validationSchema: buildValidationSchema(allowEmptyCustomMessage),
569
612
  onSubmit: function onSubmit(values) {
570
613
  return updateThankYouConfiguration({
571
614
  entityId: entityId,
@@ -581,60 +624,67 @@ var Form = function Form(_ref) {
581
624
  }
582
625
  });
583
626
  }
584
- }
585
- }, function (_ref2) {
586
- var values = _ref2.values;
587
- return /*#__PURE__*/React__default.createElement("div", {
588
- className: "grid grid-cols-1 gap-10 pb-6 md:grid-cols-2 md:gap-6"
589
- }, /*#__PURE__*/React__default.createElement("div", {
590
- className: "flex flex-col"
591
- }, blockNavigation && /*#__PURE__*/React__default.createElement(BlockNavigation, null), !disableRadioSelection && /*#__PURE__*/React__default.createElement("div", {
592
- className: "mb-6 w-full"
593
- }, /*#__PURE__*/React__default.createElement(Radio, {
594
- containerClassName: "grid grid-cols-1 sm:grid-cols-2 gap-6 items-stretch w-full",
595
- name: "kind"
596
- }, Object.values(FORM_OPTIONS).map(function (option) {
597
- return /*#__PURE__*/React__default.createElement(Radio.Item, {
598
- key: option.kind,
599
- label: /*#__PURE__*/React__default.createElement(Label, option),
600
- name: "kind",
601
- value: option.kind,
602
- className: classNames("neeto-thank-you-configuration-radio__item", {
603
- active: values.kind === option.kind
604
- })
627
+ },
628
+ children: function children(_ref2) {
629
+ var values = _ref2.values;
630
+ return /*#__PURE__*/jsxs("div", {
631
+ className: "grid grid-cols-1 gap-10 pb-6 md:grid-cols-2 md:gap-6",
632
+ children: [/*#__PURE__*/jsxs("div", {
633
+ className: "flex flex-col",
634
+ children: [blockNavigation && /*#__PURE__*/jsx(BlockNavigation, {}), !disableRadioSelection && /*#__PURE__*/jsx("div", {
635
+ className: "mb-6 w-full",
636
+ children: /*#__PURE__*/jsx(Radio, {
637
+ containerClassName: "grid grid-cols-1 sm:grid-cols-2 gap-6 items-stretch w-full",
638
+ name: "kind",
639
+ children: Object.values(FORM_OPTIONS).map(function (option) {
640
+ return /*#__PURE__*/jsx(Radio.Item, {
641
+ label: /*#__PURE__*/jsx(Label, _objectSpread({}, option)),
642
+ name: "kind",
643
+ value: option.kind,
644
+ className: classNames("neeto-thank-you-configuration-radio__item", {
645
+ active: values.kind === option.kind
646
+ })
647
+ }, option.kind);
648
+ })
649
+ })
650
+ }), values.kind === FORM_OPTIONS.customize.kind ? /*#__PURE__*/jsx(Customize, {
651
+ disableSubmitAnotherResponse: disableSubmitAnotherResponse,
652
+ editorProps: editorProps,
653
+ editorRef: editorRef,
654
+ entityId: entityId,
655
+ hasImageUploader: hasImageUploader,
656
+ uniqueSubmissionEnabled: uniqueSubmissionEnabled,
657
+ uniqueSubmissionLink: uniqueSubmissionLink,
658
+ disableSocialShare: isEmpty(socialHandles)
659
+ }) : /*#__PURE__*/jsx(ExternalLink, {}), /*#__PURE__*/jsx(ActionBlock, {
660
+ className: "mt-6",
661
+ isSubmitting: isUpdatingForm,
662
+ cancelButtonProps: _objectSpread({
663
+ "data-cy": "neeto-thank-you-configuration-cancel-button"
664
+ }, redirectToOnCancel ? {
665
+ to: redirectToOnCancel,
666
+ onClick: noop
667
+ } : {
668
+ type: "reset",
669
+ onClick: resetEditor
670
+ }),
671
+ submitButtonProps: {
672
+ "data-cy": "neeto-thank-you-configuration-save-button"
673
+ }
674
+ })]
675
+ }), values.kind === FORM_OPTIONS.customize.kind && (CustomPreview ? /*#__PURE__*/jsx(CustomPreview, {
676
+ values: values
677
+ }) : /*#__PURE__*/jsx(Preview, {
678
+ appName: appName,
679
+ brandingInfo: brandingInfo,
680
+ isPublished: isPublished,
681
+ publicLinkId: publicLinkId,
682
+ resubmitLink: resubmitLink,
683
+ socialHandles: socialHandles,
684
+ thankYouTextAlignment: thankYouTextAlignment
685
+ }))]
605
686
  });
606
- }))), values.kind === FORM_OPTIONS.customize.kind ? /*#__PURE__*/React__default.createElement(Customize, {
607
- disableSubmitAnotherResponse: disableSubmitAnotherResponse,
608
- editorRef: editorRef,
609
- entityId: entityId,
610
- hasImageUploader: hasImageUploader,
611
- uniqueSubmissionEnabled: uniqueSubmissionEnabled,
612
- uniqueSubmissionLink: uniqueSubmissionLink,
613
- disableSocialShare: isEmpty(socialHandles)
614
- }) : /*#__PURE__*/React__default.createElement(ExternalLink, null), /*#__PURE__*/React__default.createElement(ActionBlock, {
615
- className: "mt-6",
616
- isSubmitting: isUpdatingForm,
617
- cancelButtonProps: _objectSpread({
618
- "data-cy": "neeto-thank-you-configuration-cancel-button"
619
- }, redirectToOnCancel ? {
620
- to: redirectToOnCancel,
621
- onClick: noop
622
- } : {
623
- type: "reset",
624
- onClick: resetEditor
625
- }),
626
- submitButtonProps: {
627
- "data-cy": "neeto-thank-you-configuration-save-button"
628
- }
629
- })), values.kind === FORM_OPTIONS.customize.kind && /*#__PURE__*/React__default.createElement(Preview, {
630
- appName: appName,
631
- brandingInfo: brandingInfo,
632
- isPublished: isPublished,
633
- publicLinkId: publicLinkId,
634
- resubmitLink: resubmitLink,
635
- socialHandles: socialHandles,
636
- thankYouTextAlignment: thankYouTextAlignment
637
- }));
687
+ }
638
688
  });
639
689
  };
640
690
 
@@ -642,13 +692,14 @@ var Header = function Header(_ref) {
642
692
  var breadcrumbs = _ref.breadcrumbs;
643
693
  var _useTranslation = useTranslation(),
644
694
  t = _useTranslation.t;
645
- return /*#__PURE__*/React__default.createElement("div", {
646
- className: "w-full px-6"
647
- }, /*#__PURE__*/React__default.createElement(NeetoUIHeader, {
648
- breadcrumbs: breadcrumbs,
649
- size: "small",
650
- title: t("neetoThankYou.common.thankYou")
651
- }));
695
+ return /*#__PURE__*/jsx("div", {
696
+ className: "w-full px-6",
697
+ children: /*#__PURE__*/jsx(NeetoUIHeader, {
698
+ breadcrumbs: breadcrumbs,
699
+ size: "small",
700
+ title: t("neetoThankYou.common.thankYou")
701
+ })
702
+ });
652
703
  };
653
704
 
654
705
  var ConfigureThankYou = function ConfigureThankYou(_ref) {
@@ -678,32 +729,43 @@ var ConfigureThankYou = function ConfigureThankYou(_ref) {
678
729
  blockNavigation = _ref$blockNavigation === void 0 ? false : _ref$blockNavigation,
679
730
  _ref$onConfigUpdateSu = _ref.onConfigUpdateSuccess,
680
731
  onConfigUpdateSuccess = _ref$onConfigUpdateSu === void 0 ? noop : _ref$onConfigUpdateSu,
681
- _ref$brandingInfo = _ref.brandingInfo,
682
- brandingInfo = _ref$brandingInfo === void 0 ? {} : _ref$brandingInfo;
683
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, customHeader || /*#__PURE__*/React__default.createElement(Header, {
684
- breadcrumbs: breadcrumbs
685
- }), /*#__PURE__*/React__default.createElement(Scrollable, {
686
- className: "w-full p-6 pt-0"
687
- }, /*#__PURE__*/React__default.createElement("div", {
688
- className: "mx-auto h-full max-w-7xl"
689
- }, /*#__PURE__*/React__default.createElement(Form, {
690
- appName: appName,
691
- blockNavigation: blockNavigation,
692
- brandingInfo: brandingInfo,
693
- disableRadioSelection: disableRadioSelection,
694
- disableSubmitAnotherResponse: disableSubmitAnotherResponse,
695
- entityId: entityId,
696
- hasImageUploader: hasImageUploader,
697
- isPublished: isPublished,
698
- onConfigUpdateSuccess: onConfigUpdateSuccess,
699
- publicLinkId: publicLinkId,
700
- redirectToOnCancel: redirectToOnCancel,
701
- resubmitLink: resubmitLink,
702
- socialHandles: socialHandles,
703
- thankYouTextAlignment: thankYouTextAlignment,
704
- uniqueSubmissionEnabled: uniqueSubmissionEnabled,
705
- uniqueSubmissionLink: uniqueSubmissionLink
706
- }))));
732
+ brandingInfo = _ref.brandingInfo,
733
+ _ref$editorProps = _ref.editorProps,
734
+ editorProps = _ref$editorProps === void 0 ? {} : _ref$editorProps,
735
+ preview = _ref.preview,
736
+ _ref$allowEmptyCustom = _ref.allowEmptyCustomMessage,
737
+ allowEmptyCustomMessage = _ref$allowEmptyCustom === void 0 ? false : _ref$allowEmptyCustom;
738
+ return /*#__PURE__*/jsxs(Fragment, {
739
+ children: [customHeader || /*#__PURE__*/jsx(Header, {
740
+ breadcrumbs: breadcrumbs
741
+ }), /*#__PURE__*/jsx(Scrollable, {
742
+ className: "w-full p-6 pt-0",
743
+ children: /*#__PURE__*/jsx("div", {
744
+ className: "mx-auto h-full max-w-7xl",
745
+ children: /*#__PURE__*/jsx(Form, {
746
+ allowEmptyCustomMessage: allowEmptyCustomMessage,
747
+ appName: appName,
748
+ blockNavigation: blockNavigation,
749
+ brandingInfo: brandingInfo,
750
+ disableRadioSelection: disableRadioSelection,
751
+ disableSubmitAnotherResponse: disableSubmitAnotherResponse,
752
+ editorProps: editorProps,
753
+ entityId: entityId,
754
+ hasImageUploader: hasImageUploader,
755
+ isPublished: isPublished,
756
+ onConfigUpdateSuccess: onConfigUpdateSuccess,
757
+ preview: preview,
758
+ publicLinkId: publicLinkId,
759
+ redirectToOnCancel: redirectToOnCancel,
760
+ resubmitLink: resubmitLink,
761
+ socialHandles: socialHandles,
762
+ thankYouTextAlignment: thankYouTextAlignment,
763
+ uniqueSubmissionEnabled: uniqueSubmissionEnabled,
764
+ uniqueSubmissionLink: uniqueSubmissionLink
765
+ })
766
+ })
767
+ })]
768
+ });
707
769
  };
708
770
 
709
771
  var baseUrl = "".concat(THANK_YOU_ENGINE_BASE_URL, "/thank_you_page");
@@ -737,9 +799,10 @@ var buildDraftUrl = function buildDraftUrl(url) {
737
799
  };
738
800
 
739
801
  var DefaultPageLoader = function DefaultPageLoader() {
740
- return /*#__PURE__*/React__default.createElement("div", {
741
- className: "neeto-thank-you-configuration"
742
- }, /*#__PURE__*/React__default.createElement(PageLoader, null));
802
+ return /*#__PURE__*/jsx("div", {
803
+ className: "neeto-thank-you-configuration",
804
+ children: /*#__PURE__*/jsx(PageLoader, {})
805
+ });
743
806
  };
744
807
  var ShowThankYou = function ShowThankYou(_ref) {
745
808
  var _thankYouConfiguratio;
@@ -751,8 +814,7 @@ var ShowThankYou = function ShowThankYou(_ref) {
751
814
  publicLinkId = _ref.publicLinkId,
752
815
  appName = _ref.appName,
753
816
  CustomPageLoader = _ref.customPageLoader,
754
- _ref$brandingInfo = _ref.brandingInfo,
755
- brandingInfo = _ref$brandingInfo === void 0 ? {} : _ref$brandingInfo;
817
+ brandingInfo = _ref.brandingInfo;
756
818
  var _useTranslation = useTranslation(),
757
819
  t = _useTranslation.t;
758
820
  var _useShowThankYouPage = useShowThankYouPage({
@@ -764,35 +826,42 @@ var ShowThankYou = function ShowThankYou(_ref) {
764
826
  isLoading = _useShowThankYouPage.isLoading;
765
827
  var PageLoader = CustomPageLoader || DefaultPageLoader;
766
828
  if (isLoading && isThankYouPageLoading) {
767
- return /*#__PURE__*/React__default.createElement(PageLoader, null);
829
+ return /*#__PURE__*/jsx(PageLoader, {});
768
830
  }
769
- return /*#__PURE__*/React__default.createElement("div", {
770
- className: "neeto-thank-you-configuration"
771
- }, /*#__PURE__*/React__default.createElement("main", {
772
- className: "neeto-thank-you-configuration__main"
773
- }, /*#__PURE__*/React__default.createElement("div", {
774
- className: "neeto-thank-you-configuration__box"
775
- }, !isEmpty(thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl) && /*#__PURE__*/React__default.createElement("div", {
776
- className: "neeto-thank-you-configuration__img"
777
- }, /*#__PURE__*/React__default.createElement("img", {
778
- alt: "",
779
- src: thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl
780
- })), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.message) && /*#__PURE__*/React__default.createElement("div", {
781
- className: "neeto-thank-you-configuration__description"
782
- }, /*#__PURE__*/React__default.createElement(EditorContent, {
783
- content: thankYouConfiguration.message
784
- })), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.showResubmitLink) && /*#__PURE__*/React__default.createElement("a", {
785
- className: "neeto-thank-you-configuration__resubmit",
786
- href: isDraftPreview ? buildDraftUrl(resubmitLink) : resubmitLink
787
- }, (_thankYouConfiguratio = thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.resubmitLinkText) !== null && _thankYouConfiguratio !== void 0 ? _thankYouConfiguratio : t("neetoThankYou.common.resubmit")), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.socialSharingEnabled) && /*#__PURE__*/React__default.createElement(SocialShare, {
788
- publicLinkId: publicLinkId,
789
- socialHandles: socialHandles
790
- }), isDraftPreview && /*#__PURE__*/React__default.createElement(Typography, {
791
- style: "body3"
792
- }, t("neetoThankYou.thankYou.draftVersionForm")))), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.brandingEnabled) && isPresent(brandingInfo) && /*#__PURE__*/React__default.createElement(BrandingInfo, {
793
- appName: appName,
794
- brandingInfo: brandingInfo
795
- }));
831
+ return /*#__PURE__*/jsxs("div", {
832
+ className: "neeto-thank-you-configuration",
833
+ children: [/*#__PURE__*/jsx("main", {
834
+ className: "neeto-thank-you-configuration__main",
835
+ children: /*#__PURE__*/jsxs("div", {
836
+ className: "neeto-thank-you-configuration__box",
837
+ children: [!isEmpty(thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl) && /*#__PURE__*/jsx("div", {
838
+ className: "neeto-thank-you-configuration__img",
839
+ children: /*#__PURE__*/jsx("img", {
840
+ alt: "",
841
+ src: thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.imageUrl
842
+ })
843
+ }), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.message) && /*#__PURE__*/jsx("div", {
844
+ className: "neeto-thank-you-configuration__description",
845
+ children: /*#__PURE__*/jsx(EditorContent, {
846
+ content: thankYouConfiguration.message
847
+ })
848
+ }), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.showResubmitLink) && /*#__PURE__*/jsx("a", {
849
+ className: "neeto-thank-you-configuration__resubmit",
850
+ href: isDraftPreview ? buildDraftUrl(resubmitLink) : resubmitLink,
851
+ children: (_thankYouConfiguratio = thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.resubmitLinkText) !== null && _thankYouConfiguratio !== void 0 ? _thankYouConfiguratio : t("neetoThankYou.common.resubmit")
852
+ }), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.socialSharingEnabled) && /*#__PURE__*/jsx(SocialShare, {
853
+ publicLinkId: publicLinkId,
854
+ socialHandles: socialHandles
855
+ }), isDraftPreview && /*#__PURE__*/jsx(Typography, {
856
+ style: "body3",
857
+ children: t("neetoThankYou.thankYou.draftVersionForm")
858
+ })]
859
+ })
860
+ }), (thankYouConfiguration === null || thankYouConfiguration === void 0 ? void 0 : thankYouConfiguration.brandingEnabled) && /*#__PURE__*/jsx(BrandingInfo, {
861
+ appName: appName,
862
+ brandingInfo: brandingInfo
863
+ })]
864
+ });
796
865
  };
797
866
 
798
867
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}