@bigbinary/neeto-email-delivery-frontend 1.0.34 → 1.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +4 -4
  2. package/dist/.ready +1 -1
  3. package/dist/EmailDeliveryScreen.js +193 -14
  4. package/dist/EmailDeliveryScreen.js.map +1 -1
  5. package/dist/PageLayout-B_USy8hj.js +75 -0
  6. package/dist/PageLayout-B_USy8hj.js.map +1 -0
  7. package/dist/PageLayout-pMKr_80l.js +103 -0
  8. package/dist/PageLayout-pMKr_80l.js.map +1 -0
  9. package/dist/SparkpostDomainSetup.js +3 -3
  10. package/dist/SparkpostDomainVerify.js +4 -4
  11. package/dist/Verify-80b6NK1q.js +295 -0
  12. package/dist/Verify-80b6NK1q.js.map +1 -0
  13. package/dist/{Verify-Cbn8WE7T.js → Verify-D0bZSCRH.js} +4 -4
  14. package/dist/{Verify-Cbn8WE7T.js.map → Verify-D0bZSCRH.js.map} +1 -1
  15. package/dist/Verify-Dnvx5OTi.js +292 -0
  16. package/dist/Verify-Dnvx5OTi.js.map +1 -0
  17. package/dist/cjs/EmailDeliveryScreen.js +189 -14
  18. package/dist/cjs/EmailDeliveryScreen.js.map +1 -1
  19. package/dist/cjs/index.js +7 -6
  20. package/dist/cjs/index.js.map +1 -1
  21. package/dist/cjs/v2/EmailDeliveryScreen.js +201 -0
  22. package/dist/cjs/v2/EmailDeliveryScreen.js.map +1 -0
  23. package/dist/cjs/v2/SparkpostDomainSetup.js +140 -0
  24. package/dist/cjs/v2/SparkpostDomainSetup.js.map +1 -0
  25. package/dist/cjs/v2/SparkpostDomainVerify.js +35 -0
  26. package/dist/cjs/v2/SparkpostDomainVerify.js.map +1 -0
  27. package/dist/cjs/v2/hooks.js +17 -0
  28. package/dist/cjs/v2/hooks.js.map +1 -0
  29. package/dist/cjs/v2/index.js +522 -0
  30. package/dist/cjs/v2/index.js.map +1 -0
  31. package/dist/hooks.js +2 -2
  32. package/dist/index.js +8 -8
  33. package/dist/{useEmailDeliveryIntegrationApi-Dk9WPotT.js → useEmailDeliveryIntegrationApi-CfgmbuRA.js} +2 -2
  34. package/dist/{useEmailDeliveryIntegrationApi-Dk9WPotT.js.map → useEmailDeliveryIntegrationApi-CfgmbuRA.js.map} +1 -1
  35. package/dist/useSmtp-BCcRaVYr.js +136 -0
  36. package/dist/useSmtp-BCcRaVYr.js.map +1 -0
  37. package/dist/useSmtp-DxZlXdtr.js +132 -0
  38. package/dist/useSmtp-DxZlXdtr.js.map +1 -0
  39. package/dist/{useSparkpostApi-B-D8RNRF.js → useSparkpostApi-CQT4JD8-.js} +2 -2
  40. package/dist/{useSparkpostApi-B-D8RNRF.js.map → useSparkpostApi-CQT4JD8-.js.map} +1 -1
  41. package/dist/useSparkpostDomain-DDjj-dyF.js +99 -0
  42. package/dist/useSparkpostDomain-DDjj-dyF.js.map +1 -0
  43. package/dist/{useSparkpostDomain-DA1nrWS3.js → useSparkpostDomain-Dt4Q3GSP.js} +2 -2
  44. package/dist/{useSparkpostDomain-DA1nrWS3.js.map → useSparkpostDomain-Dt4Q3GSP.js.map} +1 -1
  45. package/dist/useSparkpostDomain-IJPoCQ0f.js +101 -0
  46. package/dist/useSparkpostDomain-IJPoCQ0f.js.map +1 -0
  47. package/dist/{index-BbOAmk2e.js → v2/EmailDeliveryScreen.js} +27 -148
  48. package/dist/v2/EmailDeliveryScreen.js.map +1 -0
  49. package/dist/v2/SparkpostDomainSetup.js +138 -0
  50. package/dist/v2/SparkpostDomainSetup.js.map +1 -0
  51. package/dist/v2/SparkpostDomainVerify.js +29 -0
  52. package/dist/v2/SparkpostDomainVerify.js.map +1 -0
  53. package/dist/v2/hooks.js +11 -0
  54. package/dist/v2/hooks.js.map +1 -0
  55. package/dist/v2/index.js +499 -0
  56. package/dist/v2/index.js.map +1 -0
  57. package/package.json +34 -22
  58. package/dist/index-BbOAmk2e.js.map +0 -1
  59. package/dist/index-YMe54v79.js +0 -325
  60. package/dist/index-YMe54v79.js.map +0 -1
@@ -0,0 +1,499 @@
1
+ export { default as EmailDeliveryScreen } from './EmailDeliveryScreen.js';
2
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
+ import { useState } from 'react';
5
+ import { Sheet, Typography, Callout, Toastr, Spinner, Button } from '@bigbinary/neeto-atoms';
6
+ import { isPresent, humanize, isNotEmpty } from '@bigbinary/neeto-cist';
7
+ import { useQueryParams } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
8
+ import { buildUrl } from '@bigbinary/neeto-commons-frontend/v2/utils';
9
+ import Check from '@bigbinary/neeto-icons/Check';
10
+ import Warning from '@bigbinary/neeto-icons/Warning';
11
+ import CardLayout from '@bigbinary/neeto-molecules/v2/CardLayout';
12
+ import { useTranslation, Trans } from 'react-i18next';
13
+ import { useHistory } from 'react-router-dom';
14
+ import { k as useCreateSmtp, O as OUTLOOK_OAUTH_CONNECT_URL, G as GMAIL_OAUTH_CONNECT_URL } from '../useSparkpostApi-CQT4JD8-.js';
15
+ import { u as useGmail, a as useOutlook, b as useSmtp } from '../useSmtp-DxZlXdtr.js';
16
+ import { u as useFetchConnectedIntegration } from '../useEmailDeliveryIntegrationApi-CfgmbuRA.js';
17
+ import { Form, Input, RadioGroup, ActionBlock } from '@bigbinary/neeto-atoms/formik';
18
+ import { t } from 'i18next';
19
+ import * as yup from 'yup';
20
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
21
+ import { D as DnsRecordsSection } from '../Verify-Dnvx5OTi.js';
22
+ export { S as SparkpostDomainVerify } from '../Verify-Dnvx5OTi.js';
23
+ import { u as useSparkpostDomain } from '../useSparkpostDomain-DDjj-dyF.js';
24
+ import MailSend from '@bigbinary/neeto-icons/MailSend';
25
+ import GmailIcon from '@bigbinary/neeto-icons/misc/Gmail';
26
+ import OutlookIcon from '@bigbinary/neeto-icons/misc/Outlook';
27
+ export { default as SparkpostDomainSetup } from './SparkpostDomainSetup.js';
28
+ import '@tanstack/react-query';
29
+ import '@bigbinary/neeto-commons-frontend/utils';
30
+ import '@bigbinary/neeto-commons-frontend/react-utils';
31
+ import 'axios';
32
+ import 'ramda';
33
+ import '../PageLayout-B_USy8hj.js';
34
+ import '@babel/runtime/helpers/objectWithoutProperties';
35
+ import 'classnames';
36
+ import '@bigbinary/neeto-molecules/v2/Container';
37
+ import '@bigbinary/neeto-molecules/v2/Header';
38
+ import '@babel/runtime/helpers/toConsumableArray';
39
+ import '@bigbinary/neeto-molecules/v2/CopyToClipboardButton';
40
+
41
+ var ENCRYPTION_OPTIONS = [{
42
+ label: "None",
43
+ value: "none"
44
+ }, {
45
+ label: "StartTLS",
46
+ value: "starttls"
47
+ }, {
48
+ label: "SSL",
49
+ value: "ssl"
50
+ }];
51
+ var SMTP_ACCOUNT_INITIAL_VALUES = {
52
+ host: "",
53
+ port: 587,
54
+ username: "",
55
+ password: "",
56
+ email: "",
57
+ encryption: "starttls",
58
+ displayName: ""
59
+ };
60
+ var SMTP_ACCOUNT_VALIDATION_SCHEMA = yup.object().shape({
61
+ host: yup.string().trim().required(t("neetoEmailDelivery.smtp.setup.requiredField", {
62
+ field: t("neetoEmailDelivery.smtp.setup.hostLabel")
63
+ })),
64
+ port: yup.number().required(t("neetoEmailDelivery.smtp.setup.requiredField", {
65
+ field: t("neetoEmailDelivery.smtp.setup.portLabel")
66
+ })),
67
+ username: yup.string().trim().required(t("neetoEmailDelivery.smtp.setup.requiredField", {
68
+ field: t("neetoEmailDelivery.smtp.setup.usernameLabel")
69
+ })),
70
+ password: yup.string().trim().required(t("neetoEmailDelivery.smtp.setup.requiredField", {
71
+ field: t("neetoEmailDelivery.smtp.setup.passwordLabel")
72
+ })),
73
+ email: yup.string().trim().required(t("neetoEmailDelivery.smtp.setup.requiredField", {
74
+ field: t("neetoEmailDelivery.smtp.setup.emailLabel")
75
+ })).email(t("neetoEmailDelivery.smtp.setup.emailInvalid")),
76
+ displayName: yup.string().trim().required(t("neetoEmailDelivery.smtp.setup.requiredField", {
77
+ field: t("neetoEmailDelivery.smtp.setup.displayNameLabel")
78
+ })),
79
+ encryption: yup.string().trim().required(t("neetoEmailDelivery.smtp.setup.requiredField", {
80
+ field: t("neetoEmailDelivery.smtp.setup.encryptionLabel")
81
+ }))
82
+ });
83
+
84
+ var SmtpSetup = function SmtpSetup(_ref) {
85
+ var ownerId = _ref.ownerId,
86
+ onDone = _ref.onDone,
87
+ onCancel = _ref.onCancel,
88
+ isOpen = _ref.isOpen;
89
+ var _useTranslation = useTranslation(),
90
+ t = _useTranslation.t;
91
+ var _useCreateSmtp = useCreateSmtp({
92
+ ownerId: ownerId
93
+ }),
94
+ isCreating = _useCreateSmtp.isPending,
95
+ createSmtp = _useCreateSmtp.mutate;
96
+ var handleSubmit = function handleSubmit(values) {
97
+ createSmtp({
98
+ smtp_account: values
99
+ }, {
100
+ onSuccess: onDone
101
+ });
102
+ };
103
+ return /*#__PURE__*/jsxs(Sheet, {
104
+ isOpen: isOpen,
105
+ size: "large",
106
+ onClose: onCancel,
107
+ children: [/*#__PURE__*/jsx(Sheet.Header, {
108
+ children: /*#__PURE__*/jsx(Sheet.Title, {
109
+ children: /*#__PURE__*/jsx(Typography, {
110
+ variant: "h2",
111
+ weight: "semibold",
112
+ children: t("neetoEmailDelivery.smtp.setup.title")
113
+ })
114
+ })
115
+ }), /*#__PURE__*/jsxs(Form, {
116
+ className: "w-full",
117
+ formikProps: {
118
+ initialValues: SMTP_ACCOUNT_INITIAL_VALUES,
119
+ validationSchema: SMTP_ACCOUNT_VALIDATION_SCHEMA,
120
+ onSubmit: handleSubmit
121
+ },
122
+ children: [/*#__PURE__*/jsx(Sheet.Body, {
123
+ className: "space-y-4",
124
+ children: /*#__PURE__*/jsxs("div", {
125
+ className: "flex flex-col gap-6",
126
+ children: [/*#__PURE__*/jsx(Callout, {
127
+ variant: "warning",
128
+ children: t("neetoEmailDelivery.smtp.setup.note")
129
+ }), /*#__PURE__*/jsx(Input, {
130
+ required: true,
131
+ label: t("neetoEmailDelivery.smtp.setup.hostLabel"),
132
+ name: "host"
133
+ }), /*#__PURE__*/jsx(Input, {
134
+ required: true,
135
+ label: t("neetoEmailDelivery.smtp.setup.portLabel"),
136
+ name: "port",
137
+ type: "number"
138
+ }), /*#__PURE__*/jsx(Input, {
139
+ required: true,
140
+ label: t("neetoEmailDelivery.smtp.setup.usernameLabel"),
141
+ name: "username"
142
+ }), /*#__PURE__*/jsx(Input, {
143
+ required: true,
144
+ label: t("neetoEmailDelivery.smtp.setup.passwordLabel"),
145
+ name: "password",
146
+ type: "password"
147
+ }), /*#__PURE__*/jsx(Input, {
148
+ required: true,
149
+ label: t("neetoEmailDelivery.smtp.setup.emailLabel"),
150
+ name: "email",
151
+ type: "email"
152
+ }), /*#__PURE__*/jsx(Input, {
153
+ required: true,
154
+ label: t("neetoEmailDelivery.smtp.setup.displayNameLabel"),
155
+ name: "displayName"
156
+ }), /*#__PURE__*/jsx(RadioGroup, {
157
+ label: t("neetoEmailDelivery.smtp.setup.encryptionLabel"),
158
+ name: "encryption",
159
+ children: ENCRYPTION_OPTIONS.map(function (option) {
160
+ return /*#__PURE__*/jsx(RadioGroup.Item, {
161
+ label: option.label,
162
+ value: option.value
163
+ }, option.value);
164
+ })
165
+ })]
166
+ })
167
+ }), /*#__PURE__*/jsx(Sheet.Footer, {
168
+ children: /*#__PURE__*/jsx(ActionBlock, {
169
+ cancelButtonProps: {
170
+ onClick: onCancel
171
+ },
172
+ isSubmitting: isCreating,
173
+ submitButtonProps: {
174
+ label: t("neetoEmailDelivery.smtp.setup.saveAndActivate")
175
+ }
176
+ })
177
+ })]
178
+ })]
179
+ });
180
+ };
181
+
182
+ var ERROR_MESSAGES = {
183
+ gmail_permission_not_given: t("neetoEmailDelivery.gmail.permissionNotGiven"),
184
+ outlook_permission_not_given: t("neetoEmailDelivery.outlook.permissionNotGiven"),
185
+ outlook_invalid_client: t("neetoEmailDelivery.outlook.invalidClient"),
186
+ outlook_nil_json_web_token: t("neetoEmailDelivery.outlook.nilJsonWebToken")
187
+ };
188
+ var INTEGRATION_TYPES = {
189
+ GMAIL: "gmail",
190
+ OUTLOOK: "outlook",
191
+ SPARKPOST: "sparkpost",
192
+ SMTP: "smtp"
193
+ };
194
+ var PROVIDER_LABELS = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, INTEGRATION_TYPES.GMAIL, "Gmail"), INTEGRATION_TYPES.OUTLOOK, "Outlook"), INTEGRATION_TYPES.SPARKPOST, "Custom email provider"), INTEGRATION_TYPES.SMTP, "SMTP");
195
+ var PROVIDER_ICONS = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, INTEGRATION_TYPES.GMAIL, GmailIcon), INTEGRATION_TYPES.OUTLOOK, OutlookIcon), INTEGRATION_TYPES.SPARKPOST, MailSend), INTEGRATION_TYPES.SMTP, MailSend);
196
+
197
+ var IntegrationDetailPage = function IntegrationDetailPage(_ref) {
198
+ var type = _ref.type,
199
+ ownerId = _ref.ownerId,
200
+ canManageIntegrations = _ref.canManageIntegrations,
201
+ appName = _ref.appName,
202
+ scopeText = _ref.scopeText,
203
+ connectedScopeText = _ref.connectedScopeText,
204
+ helpArticleUrl = _ref.helpArticleUrl,
205
+ indexRoute = _ref.indexRoute,
206
+ integrationRoutes = _ref.integrationRoutes,
207
+ ownDomainSetupRoute = _ref.ownDomainSetupRoute,
208
+ ownDomainVerifyRoute = _ref.ownDomainVerifyRoute,
209
+ onBeforeAction = _ref.onBeforeAction;
210
+ var _useTranslation = useTranslation(),
211
+ t = _useTranslation.t;
212
+ var history = useHistory();
213
+ var _useQueryParams = useQueryParams(),
214
+ error = _useQueryParams.error,
215
+ errorDescription = _useQueryParams.errorDescription;
216
+ var _useState = useState(false),
217
+ _useState2 = _slicedToArray(_useState, 2),
218
+ isSmtpPaneOpen = _useState2[0],
219
+ setIsSmtpPaneOpen = _useState2[1];
220
+ if (isPresent(error)) {
221
+ var _errorMessage2, _integrationRoutes$ty;
222
+ var _errorMessage = ERROR_MESSAGES[error];
223
+ if (errorDescription) {
224
+ _errorMessage = "".concat(_errorMessage, " ").concat(errorDescription);
225
+ }
226
+ Toastr.error((_errorMessage2 = _errorMessage) !== null && _errorMessage2 !== void 0 ? _errorMessage2 : humanize(error));
227
+ history.replace((_integrationRoutes$ty = integrationRoutes === null || integrationRoutes === void 0 ? void 0 : integrationRoutes[type]) !== null && _integrationRoutes$ty !== void 0 ? _integrationRoutes$ty : indexRoute);
228
+ }
229
+ var providerLabel = PROVIDER_LABELS[type];
230
+ var Icon = PROVIDER_ICONS[type];
231
+ var description = t("neetoEmailDelivery.".concat(type, ".description"));
232
+ var gmailIntegration = useGmail({
233
+ ownerId: ownerId,
234
+ indexRoute: indexRoute,
235
+ canManageIntegrations: canManageIntegrations
236
+ });
237
+ var outlookIntegration = useOutlook({
238
+ ownerId: ownerId,
239
+ indexRoute: indexRoute,
240
+ canManageIntegrations: canManageIntegrations
241
+ });
242
+ var sparkpostIntegration = useSparkpostDomain({
243
+ ownerId: ownerId,
244
+ canManageIntegrations: canManageIntegrations
245
+ });
246
+ var smtpIntegration = useSmtp({
247
+ ownerId: ownerId,
248
+ canManageIntegrations: canManageIntegrations
249
+ });
250
+ var _useFetchConnectedInt = useFetchConnectedIntegration(ownerId),
251
+ connectedIntegration = _useFetchConnectedInt.integration,
252
+ isIntegrationLoading = _useFetchConnectedInt.isLoading;
253
+ var integrationMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, INTEGRATION_TYPES.GMAIL, gmailIntegration), INTEGRATION_TYPES.OUTLOOK, outlookIntegration), INTEGRATION_TYPES.SPARKPOST, sparkpostIntegration), INTEGRATION_TYPES.SMTP, smtpIntegration);
254
+ var currentIntegration = integrationMap[type];
255
+ var isConnected = currentIntegration.isConnected,
256
+ isDestroying = currentIntegration.isDestroying,
257
+ onDisconnect = currentIntegration.onDisconnect,
258
+ _currentIntegration$d = currentIntegration.data,
259
+ data = _currentIntegration$d === void 0 ? {} : _currentIntegration$d,
260
+ errorMessage = currentIntegration.errorMessage;
261
+ var connectedEmail = data === null || data === void 0 ? void 0 : data.email;
262
+ var sparkpostVerificationRecords = (data === null || data === void 0 ? void 0 : data.verificationRecords) || [];
263
+ var showSparkpostConnectedDetails = type === INTEGRATION_TYPES.SPARKPOST && isConnected;
264
+ var isOutlookPending = type === INTEGRATION_TYPES.OUTLOOK && outlookIntegration.isWaitingForTestEmail;
265
+ var isSparkpostPending = type === INTEGRATION_TYPES.SPARKPOST && sparkpostIntegration.exists && !isConnected;
266
+ var isPending = isOutlookPending || isSparkpostPending;
267
+ var isLoading = gmailIntegration.isLoading || outlookIntegration.isLoading || sparkpostIntegration.isLoading || smtpIntegration.isLoading || isIntegrationLoading;
268
+ var isBlocked = connectedIntegration && connectedIntegration.type !== type;
269
+ var activeProviderLabel = isBlocked ? PROVIDER_LABELS[connectedIntegration.type] : null;
270
+ var activeProviderRoute = isBlocked ? integrationRoutes === null || integrationRoutes === void 0 ? void 0 : integrationRoutes[connectedIntegration.type] : null;
271
+ var executeConnect = function executeConnect() {
272
+ switch (type) {
273
+ case INTEGRATION_TYPES.GMAIL:
274
+ window.location.href = buildUrl(GMAIL_OAUTH_CONNECT_URL, {
275
+ ownerId: ownerId
276
+ });
277
+ break;
278
+ case INTEGRATION_TYPES.OUTLOOK:
279
+ window.location.href = buildUrl(OUTLOOK_OAUTH_CONNECT_URL, {
280
+ ownerId: ownerId
281
+ });
282
+ break;
283
+ case INTEGRATION_TYPES.SPARKPOST:
284
+ history.push(ownDomainSetupRoute);
285
+ break;
286
+ case INTEGRATION_TYPES.SMTP:
287
+ setIsSmtpPaneOpen(true);
288
+ break;
289
+ }
290
+ };
291
+ var handleConnect = function handleConnect() {
292
+ if (onBeforeAction) {
293
+ onBeforeAction(executeConnect);
294
+ } else {
295
+ executeConnect();
296
+ }
297
+ };
298
+ var handleDisconnect = function handleDisconnect() {
299
+ if (onBeforeAction) {
300
+ onBeforeAction(onDisconnect);
301
+ } else {
302
+ onDisconnect();
303
+ }
304
+ };
305
+ var getConnectButtonLabel = function getConnectButtonLabel() {
306
+ switch (type) {
307
+ case INTEGRATION_TYPES.GMAIL:
308
+ return t("neetoEmailDelivery.integrationDetail.connectGmail");
309
+ case INTEGRATION_TYPES.OUTLOOK:
310
+ return t("neetoEmailDelivery.integrationDetail.connectOutlook");
311
+ case INTEGRATION_TYPES.SPARKPOST:
312
+ return t("neetoEmailDelivery.integrationDetail.setupDomain");
313
+ case INTEGRATION_TYPES.SMTP:
314
+ return t("neetoEmailDelivery.integrationDetail.connectSmtp");
315
+ default:
316
+ return "";
317
+ }
318
+ };
319
+ var renderTitle = function renderTitle() {
320
+ if (isConnected) {
321
+ return /*#__PURE__*/jsxs("div", {
322
+ className: "flex items-center gap-2",
323
+ children: [/*#__PURE__*/jsx("span", {
324
+ children: t("neetoEmailDelivery.integrationDetail.connectedTitle", {
325
+ provider: providerLabel
326
+ })
327
+ }), /*#__PURE__*/jsx("div", {
328
+ className: "bg-success text-success-foreground flex items-center justify-center rounded-full p-1",
329
+ children: /*#__PURE__*/jsx(Check, {
330
+ size: 24
331
+ })
332
+ })]
333
+ });
334
+ }
335
+ if (isPending) {
336
+ return /*#__PURE__*/jsxs("div", {
337
+ className: "flex items-center gap-2",
338
+ children: [/*#__PURE__*/jsx("span", {
339
+ children: t("neetoEmailDelivery.integrationDetail.pendingTitle", {
340
+ provider: providerLabel
341
+ })
342
+ }), /*#__PURE__*/jsx("div", {
343
+ className: "text-warning-foreground flex items-center justify-center p-1",
344
+ children: /*#__PURE__*/jsx(Warning, {
345
+ size: 24
346
+ })
347
+ })]
348
+ });
349
+ }
350
+ return t("neetoEmailDelivery.integrationDetail.connectTitle", {
351
+ appName: appName,
352
+ provider: providerLabel
353
+ });
354
+ };
355
+ var renderActionBlock = function renderActionBlock() {
356
+ if (isConnected) {
357
+ return /*#__PURE__*/jsx(Button, {
358
+ "data-testid": "disconnect-button",
359
+ label: t("neetoEmailDelivery.integrationDetail.disconnect"),
360
+ loading: isDestroying,
361
+ variant: "destructive",
362
+ onClick: handleDisconnect
363
+ });
364
+ }
365
+ if (isPending) {
366
+ return /*#__PURE__*/jsxs("div", {
367
+ className: "flex items-center gap-2",
368
+ children: [isSparkpostPending && /*#__PURE__*/jsx(Button, {
369
+ "data-testid": "continue-verification-button",
370
+ to: ownDomainVerifyRoute,
371
+ label: t("neetoEmailDelivery.sparkpost.emailDelivery.continueVerification")
372
+ }), /*#__PURE__*/jsx(Button, {
373
+ "data-testid": "disconnect-button",
374
+ label: t("neetoEmailDelivery.integrationDetail.disconnect"),
375
+ loading: isDestroying,
376
+ variant: "destructive",
377
+ onClick: handleDisconnect
378
+ })]
379
+ });
380
+ }
381
+ if (isBlocked) return null;
382
+ return /*#__PURE__*/jsx(Button, {
383
+ "data-testid": "connect-button",
384
+ label: getConnectButtonLabel(),
385
+ variant: "default",
386
+ onClick: handleConnect
387
+ });
388
+ };
389
+ if (isLoading) {
390
+ return /*#__PURE__*/jsx("div", {
391
+ className: "flex grow items-center justify-center w-full",
392
+ children: /*#__PURE__*/jsx(Spinner, {})
393
+ });
394
+ }
395
+ return /*#__PURE__*/jsxs(Fragment, {
396
+ children: [/*#__PURE__*/jsxs(CardLayout, {
397
+ actionBlock: renderActionBlock(),
398
+ icon: /*#__PURE__*/jsx(Icon, {
399
+ size: 48
400
+ }),
401
+ title: renderTitle(),
402
+ description: isConnected ? /*#__PURE__*/jsx(Trans, {
403
+ components: {
404
+ bold: /*#__PURE__*/jsx("strong", {})
405
+ },
406
+ i18nKey: "neetoEmailDelivery.integrationDetail.connectedEmail",
407
+ values: {
408
+ email: connectedEmail
409
+ }
410
+ }) : description,
411
+ children: [(isConnected ? connectedScopeText || scopeText : scopeText) && /*#__PURE__*/jsx(Typography, {
412
+ variant: "body1",
413
+ children: isConnected ? connectedScopeText || scopeText : scopeText
414
+ }), !isConnected && helpArticleUrl && /*#__PURE__*/jsx(Typography, {
415
+ className: "my-2",
416
+ variant: "body2",
417
+ children: /*#__PURE__*/jsx(Trans, {
418
+ i18nKey: "neetoEmailDelivery.integrationDetail.helpArticleText",
419
+ values: {
420
+ provider: providerLabel
421
+ },
422
+ components: {
423
+ helpLink: /*#__PURE__*/jsx(Button, {
424
+ "data-testid": "help-doc-link",
425
+ href: helpArticleUrl,
426
+ target: "_blank",
427
+ variant: "link"
428
+ })
429
+ }
430
+ })
431
+ }), !isConnected && !isPending && isBlocked && /*#__PURE__*/jsx(Callout, {
432
+ variant: connectedIntegration.isPending ? "warning" : "danger",
433
+ children: /*#__PURE__*/jsx("p", {
434
+ children: /*#__PURE__*/jsx(Trans, {
435
+ components: {
436
+ disconnectLink: /*#__PURE__*/jsx(Button, {
437
+ "data-testid": "disconnect-link",
438
+ href: activeProviderRoute,
439
+ variant: "link"
440
+ })
441
+ },
442
+ i18nKey: connectedIntegration.isPending ? "neetoEmailDelivery.integrationDetail.pendingIntegrationBlocked" : "neetoEmailDelivery.integrationDetail.onlyOneIntegration",
443
+ values: {
444
+ activeProvider: activeProviderLabel,
445
+ targetProvider: providerLabel
446
+ }
447
+ })
448
+ })
449
+ }), errorMessage && /*#__PURE__*/jsx(Callout, {
450
+ variant: "danger",
451
+ children: errorMessage
452
+ }), isOutlookPending && /*#__PURE__*/jsx(Callout, {
453
+ variant: "warning",
454
+ children: t("neetoEmailDelivery.outlook.waitingForTestEmail", {
455
+ email: connectedEmail
456
+ })
457
+ }), isSparkpostPending && /*#__PURE__*/jsx(Callout, {
458
+ variant: "warning",
459
+ children: t("neetoEmailDelivery.sparkpost.emailDelivery.verificationPending", {
460
+ domain: data === null || data === void 0 ? void 0 : data.domain
461
+ })
462
+ }), showSparkpostConnectedDetails && /*#__PURE__*/jsxs("div", {
463
+ className: "flex flex-col gap-2 mt-4",
464
+ children: [isNotEmpty(sparkpostVerificationRecords) && /*#__PURE__*/jsx(DnsRecordsSection, {
465
+ dnsRecords: sparkpostVerificationRecords,
466
+ domain: data === null || data === void 0 ? void 0 : data.domain,
467
+ showTitle: false,
468
+ sparkpostData: data
469
+ }), /*#__PURE__*/jsx(Callout, {
470
+ variant: "info",
471
+ children: /*#__PURE__*/jsx(Typography, {
472
+ variant: "body3",
473
+ children: /*#__PURE__*/jsx(Trans, {
474
+ i18nKey: "neetoEmailDelivery.sparkpost.emailDelivery.spfGuidance",
475
+ components: {
476
+ bold: /*#__PURE__*/jsx("strong", {}),
477
+ code: /*#__PURE__*/jsx("code", {
478
+ className: "bg-muted rounded px-1"
479
+ })
480
+ }
481
+ })
482
+ })
483
+ })]
484
+ })]
485
+ }), type === INTEGRATION_TYPES.SMTP && /*#__PURE__*/jsx(SmtpSetup, {
486
+ ownerId: ownerId,
487
+ isOpen: isSmtpPaneOpen,
488
+ onCancel: function onCancel() {
489
+ return setIsSmtpPaneOpen(false);
490
+ },
491
+ onDone: function onDone() {
492
+ return setIsSmtpPaneOpen(false);
493
+ }
494
+ })]
495
+ });
496
+ };
497
+
498
+ export { IntegrationDetailPage };
499
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../app/javascript/src/v2/components/Smtp/constants.js","../../app/javascript/src/v2/components/Smtp/Setup.jsx","../../app/javascript/src/v2/components/IntegrationDetailPage/constants.js","../../app/javascript/src/v2/components/IntegrationDetailPage/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport * as yup from \"yup\";\n\nexport const ENCRYPTION_OPTIONS = [\n { label: \"None\", value: \"none\" },\n { label: \"StartTLS\", value: \"starttls\" },\n { label: \"SSL\", value: \"ssl\" },\n];\n\nexport const SMTP_ACCOUNT_INITIAL_VALUES = {\n host: \"\",\n port: 587,\n username: \"\",\n password: \"\",\n email: \"\",\n encryption: \"starttls\",\n displayName: \"\",\n};\n\nexport const SMTP_ACCOUNT_VALIDATION_SCHEMA = yup.object().shape({\n host: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.hostLabel\"),\n })\n ),\n port: yup.number().required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.portLabel\"),\n })\n ),\n username: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.usernameLabel\"),\n })\n ),\n password: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.passwordLabel\"),\n })\n ),\n email: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.emailLabel\"),\n })\n )\n .email(t(\"neetoEmailDelivery.smtp.setup.emailInvalid\")),\n displayName: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\"),\n })\n ),\n encryption: yup\n .string()\n .trim()\n .required(\n t(\"neetoEmailDelivery.smtp.setup.requiredField\", {\n field: t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\"),\n })\n ),\n});\n","import { Callout, Sheet, Typography } from \"@bigbinary/neeto-atoms\";\nimport {\n ActionBlock,\n Form,\n Input,\n RadioGroup,\n} from \"@bigbinary/neeto-atoms/formik\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useCreateSmtp } from \"hooks/reactQuery/integrations/useSmtpIntegrationApi\";\n\nimport {\n SMTP_ACCOUNT_INITIAL_VALUES,\n SMTP_ACCOUNT_VALIDATION_SCHEMA,\n ENCRYPTION_OPTIONS,\n} from \"./constants\";\n\nconst SmtpSetup = ({ ownerId, onDone, onCancel, isOpen }) => {\n const { t } = useTranslation();\n\n const { isPending: isCreating, mutate: createSmtp } = useCreateSmtp({\n ownerId,\n });\n\n const handleSubmit = values => {\n createSmtp({ smtp_account: values }, { onSuccess: onDone });\n };\n\n return (\n <Sheet {...{ isOpen }} size=\"large\" onClose={onCancel}>\n <Sheet.Header>\n <Sheet.Title>\n <Typography variant=\"h2\" weight=\"semibold\">\n {t(\"neetoEmailDelivery.smtp.setup.title\")}\n </Typography>\n </Sheet.Title>\n </Sheet.Header>\n <Form\n className=\"w-full\"\n formikProps={{\n initialValues: SMTP_ACCOUNT_INITIAL_VALUES,\n validationSchema: SMTP_ACCOUNT_VALIDATION_SCHEMA,\n onSubmit: handleSubmit,\n }}\n >\n <Sheet.Body className=\"space-y-4\">\n <div className=\"flex flex-col gap-6\">\n <Callout variant=\"warning\">\n {t(\"neetoEmailDelivery.smtp.setup.note\")}\n </Callout>\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.hostLabel\")}\n name=\"host\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.portLabel\")}\n name=\"port\"\n type=\"number\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.usernameLabel\")}\n name=\"username\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.passwordLabel\")}\n name=\"password\"\n type=\"password\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.emailLabel\")}\n name=\"email\"\n type=\"email\"\n />\n <Input\n required\n label={t(\"neetoEmailDelivery.smtp.setup.displayNameLabel\")}\n name=\"displayName\"\n />\n <RadioGroup\n label={t(\"neetoEmailDelivery.smtp.setup.encryptionLabel\")}\n name=\"encryption\"\n >\n {ENCRYPTION_OPTIONS.map(option => (\n <RadioGroup.Item\n key={option.value}\n label={option.label}\n value={option.value}\n />\n ))}\n </RadioGroup>\n </div>\n </Sheet.Body>\n <Sheet.Footer>\n <ActionBlock\n cancelButtonProps={{ onClick: onCancel }}\n isSubmitting={isCreating}\n submitButtonProps={{\n label: t(\"neetoEmailDelivery.smtp.setup.saveAndActivate\"),\n }}\n />\n </Sheet.Footer>\n </Form>\n </Sheet>\n );\n};\n\nexport default SmtpSetup;\n","import { t } from \"i18next\";\nimport { MailSend } from \"neetoicons\";\nimport { Gmail as GmailIcon, Outlook as OutlookIcon } from \"neetoicons/misc\";\n\nexport const ERROR_MESSAGES = {\n gmail_permission_not_given: t(\"neetoEmailDelivery.gmail.permissionNotGiven\"),\n outlook_permission_not_given: t(\n \"neetoEmailDelivery.outlook.permissionNotGiven\"\n ),\n outlook_invalid_client: t(\"neetoEmailDelivery.outlook.invalidClient\"),\n outlook_nil_json_web_token: t(\"neetoEmailDelivery.outlook.nilJsonWebToken\"),\n};\n\nexport const INTEGRATION_TYPES = {\n GMAIL: \"gmail\",\n OUTLOOK: \"outlook\",\n SPARKPOST: \"sparkpost\",\n SMTP: \"smtp\",\n};\n\nexport const PROVIDER_LABELS = {\n [INTEGRATION_TYPES.GMAIL]: \"Gmail\",\n [INTEGRATION_TYPES.OUTLOOK]: \"Outlook\",\n [INTEGRATION_TYPES.SPARKPOST]: \"Custom email provider\",\n [INTEGRATION_TYPES.SMTP]: \"SMTP\",\n};\n\nexport const PROVIDER_ICONS = {\n [INTEGRATION_TYPES.GMAIL]: GmailIcon,\n [INTEGRATION_TYPES.OUTLOOK]: OutlookIcon,\n [INTEGRATION_TYPES.SPARKPOST]: MailSend,\n [INTEGRATION_TYPES.SMTP]: MailSend,\n};\n","import { useState } from \"react\";\n\nimport {\n Button,\n Callout,\n Spinner,\n Toastr,\n Typography,\n} from \"@bigbinary/neeto-atoms\";\nimport { humanize, isNotEmpty, isPresent } from \"neetocist\";\nimport { useQueryParams } from \"neetocommons/v2/react-utils\";\nimport { buildUrl } from \"neetocommons/v2/utils\";\nimport { Check, Warning } from \"neetoicons\";\nimport CardLayout from \"neetomolecules/v2/CardLayout\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n GMAIL_OAUTH_CONNECT_URL,\n OUTLOOK_OAUTH_CONNECT_URL,\n} from \"apis/integrations/constants\";\nimport useGmail from \"hooks/integrations/useGmail\";\nimport useOutlook from \"hooks/integrations/useOutlook\";\nimport useSmtp from \"hooks/integrations/useSmtp\";\nimport { useFetchConnectedIntegration } from \"hooks/reactQuery/integrations/useEmailDeliveryIntegrationApi\";\nimport SmtpSetup from \"v2/components/Smtp/Setup\";\nimport DnsRecordsSection from \"v2/components/SparkpostDomain/DnsRecordsSection\";\nimport useSparkpostDomain from \"v2/hooks/integrations/useSparkpostDomain\";\n\nimport {\n ERROR_MESSAGES,\n INTEGRATION_TYPES,\n PROVIDER_LABELS,\n PROVIDER_ICONS,\n} from \"./constants\";\n\nconst IntegrationDetailPage = ({\n type,\n ownerId,\n canManageIntegrations,\n appName,\n scopeText,\n connectedScopeText,\n helpArticleUrl,\n indexRoute,\n integrationRoutes,\n ownDomainSetupRoute,\n ownDomainVerifyRoute,\n onBeforeAction,\n}) => {\n const { t } = useTranslation();\n const history = useHistory();\n const { error, errorDescription } = useQueryParams();\n const [isSmtpPaneOpen, setIsSmtpPaneOpen] = useState(false);\n\n if (isPresent(error)) {\n let errorMessage = ERROR_MESSAGES[error];\n if (errorDescription) {\n errorMessage = `${errorMessage} ${errorDescription}`;\n }\n Toastr.error(errorMessage ?? humanize(error));\n history.replace(integrationRoutes?.[type] ?? indexRoute);\n }\n\n const providerLabel = PROVIDER_LABELS[type];\n const Icon = PROVIDER_ICONS[type];\n const description = t(`neetoEmailDelivery.${type}.description`);\n\n const gmailIntegration = useGmail({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const outlookIntegration = useOutlook({\n ownerId,\n indexRoute,\n canManageIntegrations,\n });\n\n const sparkpostIntegration = useSparkpostDomain({\n ownerId,\n canManageIntegrations,\n });\n\n const smtpIntegration = useSmtp({ ownerId, canManageIntegrations });\n\n const { integration: connectedIntegration, isLoading: isIntegrationLoading } =\n useFetchConnectedIntegration(ownerId);\n\n const integrationMap = {\n [INTEGRATION_TYPES.GMAIL]: gmailIntegration,\n [INTEGRATION_TYPES.OUTLOOK]: outlookIntegration,\n [INTEGRATION_TYPES.SPARKPOST]: sparkpostIntegration,\n [INTEGRATION_TYPES.SMTP]: smtpIntegration,\n };\n\n const currentIntegration = integrationMap[type];\n const {\n isConnected,\n isDestroying,\n onDisconnect,\n data = {},\n errorMessage,\n } = currentIntegration;\n\n const connectedEmail = data?.email;\n const sparkpostVerificationRecords = data?.verificationRecords || [];\n const showSparkpostConnectedDetails =\n type === INTEGRATION_TYPES.SPARKPOST && isConnected;\n\n const isOutlookPending =\n type === INTEGRATION_TYPES.OUTLOOK &&\n outlookIntegration.isWaitingForTestEmail;\n\n const isSparkpostPending =\n type === INTEGRATION_TYPES.SPARKPOST &&\n sparkpostIntegration.exists &&\n !isConnected;\n\n const isPending = isOutlookPending || isSparkpostPending;\n\n const isLoading =\n gmailIntegration.isLoading ||\n outlookIntegration.isLoading ||\n sparkpostIntegration.isLoading ||\n smtpIntegration.isLoading ||\n isIntegrationLoading;\n\n const isBlocked = connectedIntegration && connectedIntegration.type !== type;\n\n const activeProviderLabel = isBlocked\n ? PROVIDER_LABELS[connectedIntegration.type]\n : null;\n\n const activeProviderRoute = isBlocked\n ? integrationRoutes?.[connectedIntegration.type]\n : null;\n\n const executeConnect = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n window.location.href = buildUrl(GMAIL_OAUTH_CONNECT_URL, { ownerId });\n break;\n case INTEGRATION_TYPES.OUTLOOK:\n window.location.href = buildUrl(OUTLOOK_OAUTH_CONNECT_URL, {\n ownerId,\n });\n break;\n case INTEGRATION_TYPES.SPARKPOST:\n history.push(ownDomainSetupRoute);\n break;\n case INTEGRATION_TYPES.SMTP:\n setIsSmtpPaneOpen(true);\n break;\n default:\n break;\n }\n };\n\n const handleConnect = () => {\n if (onBeforeAction) {\n onBeforeAction(executeConnect);\n } else {\n executeConnect();\n }\n };\n\n const handleDisconnect = () => {\n if (onBeforeAction) {\n onBeforeAction(onDisconnect);\n } else {\n onDisconnect();\n }\n };\n\n const getConnectButtonLabel = () => {\n switch (type) {\n case INTEGRATION_TYPES.GMAIL:\n return t(\"neetoEmailDelivery.integrationDetail.connectGmail\");\n case INTEGRATION_TYPES.OUTLOOK:\n return t(\"neetoEmailDelivery.integrationDetail.connectOutlook\");\n case INTEGRATION_TYPES.SPARKPOST:\n return t(\"neetoEmailDelivery.integrationDetail.setupDomain\");\n case INTEGRATION_TYPES.SMTP:\n return t(\"neetoEmailDelivery.integrationDetail.connectSmtp\");\n default:\n return \"\";\n }\n };\n\n const renderTitle = () => {\n if (isConnected) {\n return (\n <div className=\"flex items-center gap-2\">\n <span>\n {t(\"neetoEmailDelivery.integrationDetail.connectedTitle\", {\n provider: providerLabel,\n })}\n </span>\n <div className=\"bg-success text-success-foreground flex items-center justify-center rounded-full p-1\">\n <Check size={24} />\n </div>\n </div>\n );\n }\n\n if (isPending) {\n return (\n <div className=\"flex items-center gap-2\">\n <span>\n {t(\"neetoEmailDelivery.integrationDetail.pendingTitle\", {\n provider: providerLabel,\n })}\n </span>\n <div className=\"text-warning-foreground flex items-center justify-center p-1\">\n <Warning size={24} />\n </div>\n </div>\n );\n }\n\n return t(\"neetoEmailDelivery.integrationDetail.connectTitle\", {\n appName,\n provider: providerLabel,\n });\n };\n\n const renderActionBlock = () => {\n if (isConnected) {\n return (\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n variant=\"destructive\"\n onClick={handleDisconnect}\n />\n );\n }\n\n if (isPending) {\n return (\n <div className=\"flex items-center gap-2\">\n {isSparkpostPending && (\n <Button\n data-testid=\"continue-verification-button\"\n to={ownDomainVerifyRoute}\n label={t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.continueVerification\"\n )}\n />\n )}\n <Button\n data-testid=\"disconnect-button\"\n label={t(\"neetoEmailDelivery.integrationDetail.disconnect\")}\n loading={isDestroying}\n variant=\"destructive\"\n onClick={handleDisconnect}\n />\n </div>\n );\n }\n\n if (isBlocked) return null;\n\n return (\n <Button\n data-testid=\"connect-button\"\n label={getConnectButtonLabel()}\n variant=\"default\"\n onClick={handleConnect}\n />\n );\n };\n\n if (isLoading) {\n return (\n <div className=\"flex grow items-center justify-center w-full\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <>\n <CardLayout\n actionBlock={renderActionBlock()}\n icon={<Icon size={48} />}\n title={renderTitle()}\n description={\n isConnected ? (\n <Trans\n components={{ bold: <strong /> }}\n i18nKey=\"neetoEmailDelivery.integrationDetail.connectedEmail\"\n values={{ email: connectedEmail }}\n />\n ) : (\n description\n )\n }\n >\n {(isConnected ? connectedScopeText || scopeText : scopeText) && (\n <Typography variant=\"body1\">\n {isConnected ? connectedScopeText || scopeText : scopeText}\n </Typography>\n )}\n {!isConnected && helpArticleUrl && (\n <Typography className=\"my-2\" variant=\"body2\">\n <Trans\n i18nKey=\"neetoEmailDelivery.integrationDetail.helpArticleText\"\n values={{ provider: providerLabel }}\n components={{\n helpLink: (\n <Button\n data-testid=\"help-doc-link\"\n href={helpArticleUrl}\n target=\"_blank\"\n variant=\"link\"\n />\n ),\n }}\n />\n </Typography>\n )}\n {!isConnected && !isPending && isBlocked && (\n <Callout\n variant={connectedIntegration.isPending ? \"warning\" : \"danger\"}\n >\n <p>\n <Trans\n components={{\n disconnectLink: (\n <Button\n data-testid=\"disconnect-link\"\n href={activeProviderRoute}\n variant=\"link\"\n />\n ),\n }}\n i18nKey={\n connectedIntegration.isPending\n ? \"neetoEmailDelivery.integrationDetail.pendingIntegrationBlocked\"\n : \"neetoEmailDelivery.integrationDetail.onlyOneIntegration\"\n }\n values={{\n activeProvider: activeProviderLabel,\n targetProvider: providerLabel,\n }}\n />\n </p>\n </Callout>\n )}\n {errorMessage && <Callout variant=\"danger\">{errorMessage}</Callout>}\n {isOutlookPending && (\n <Callout variant=\"warning\">\n {t(\"neetoEmailDelivery.outlook.waitingForTestEmail\", {\n email: connectedEmail,\n })}\n </Callout>\n )}\n {isSparkpostPending && (\n <Callout variant=\"warning\">\n {t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.verificationPending\",\n { domain: data?.domain }\n )}\n </Callout>\n )}\n {showSparkpostConnectedDetails && (\n <div className=\"flex flex-col gap-2 mt-4\">\n {isNotEmpty(sparkpostVerificationRecords) && (\n <DnsRecordsSection\n dnsRecords={sparkpostVerificationRecords}\n domain={data?.domain}\n showTitle={false}\n sparkpostData={data}\n />\n )}\n <Callout variant=\"info\">\n <Typography variant=\"body3\">\n <Trans\n i18nKey=\"neetoEmailDelivery.sparkpost.emailDelivery.spfGuidance\"\n components={{\n bold: <strong />,\n code: <code className=\"bg-muted rounded px-1\" />,\n }}\n />\n </Typography>\n </Callout>\n </div>\n )}\n </CardLayout>\n {type === INTEGRATION_TYPES.SMTP && (\n <SmtpSetup\n {...{ ownerId }}\n isOpen={isSmtpPaneOpen}\n onCancel={() => setIsSmtpPaneOpen(false)}\n onDone={() => setIsSmtpPaneOpen(false)}\n />\n )}\n </>\n );\n};\n\nexport default IntegrationDetailPage;\n"],"names":["ENCRYPTION_OPTIONS","label","value","SMTP_ACCOUNT_INITIAL_VALUES","host","port","username","password","email","encryption","displayName","SMTP_ACCOUNT_VALIDATION_SCHEMA","yup","object","shape","string","trim","required","t","field","number","SmtpSetup","_ref","ownerId","onDone","onCancel","isOpen","_useTranslation","useTranslation","_useCreateSmtp","useCreateSmtp","isCreating","isPending","createSmtp","mutate","handleSubmit","values","smtp_account","onSuccess","_jsxs","Sheet","size","onClose","children","_jsx","Header","Title","Typography","variant","weight","Form","className","formikProps","initialValues","validationSchema","onSubmit","Body","Callout","Input","name","type","RadioGroup","map","option","Item","Footer","ActionBlock","cancelButtonProps","onClick","isSubmitting","submitButtonProps","ERROR_MESSAGES","gmail_permission_not_given","outlook_permission_not_given","outlook_invalid_client","outlook_nil_json_web_token","INTEGRATION_TYPES","GMAIL","OUTLOOK","SPARKPOST","SMTP","PROVIDER_LABELS","_defineProperty","PROVIDER_ICONS","GmailIcon","OutlookIcon","MailSend","IntegrationDetailPage","canManageIntegrations","appName","scopeText","connectedScopeText","helpArticleUrl","indexRoute","integrationRoutes","ownDomainSetupRoute","ownDomainVerifyRoute","onBeforeAction","history","useHistory","_useQueryParams","useQueryParams","error","errorDescription","_useState","useState","_useState2","_slicedToArray","isSmtpPaneOpen","setIsSmtpPaneOpen","isPresent","_errorMessage2","_integrationRoutes$ty","errorMessage","concat","Toastr","humanize","replace","providerLabel","Icon","description","gmailIntegration","useGmail","outlookIntegration","useOutlook","sparkpostIntegration","useSparkpostDomain","smtpIntegration","useSmtp","_useFetchConnectedInt","useFetchConnectedIntegration","connectedIntegration","integration","isIntegrationLoading","isLoading","integrationMap","currentIntegration","isConnected","isDestroying","onDisconnect","_currentIntegration$d","data","connectedEmail","sparkpostVerificationRecords","verificationRecords","showSparkpostConnectedDetails","isOutlookPending","isWaitingForTestEmail","isSparkpostPending","exists","isBlocked","activeProviderLabel","activeProviderRoute","executeConnect","window","location","href","buildUrl","GMAIL_OAUTH_CONNECT_URL","OUTLOOK_OAUTH_CONNECT_URL","push","handleConnect","handleDisconnect","getConnectButtonLabel","renderTitle","provider","Check","Warning","renderActionBlock","Button","loading","to","Spinner","_Fragment","CardLayout","actionBlock","icon","title","Trans","components","bold","i18nKey","helpLink","target","disconnectLink","activeProvider","targetProvider","domain","isNotEmpty","DnsRecordsSection","dnsRecords","showTitle","sparkpostData","code"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,kBAAkB,GAAG,CAChC;AAAEC,EAAAA,KAAK,EAAE,MAAM;AAAEC,EAAAA,KAAK,EAAE;AAAO,CAAC,EAChC;AAAED,EAAAA,KAAK,EAAE,UAAU;AAAEC,EAAAA,KAAK,EAAE;AAAW,CAAC,EACxC;AAAED,EAAAA,KAAK,EAAE,KAAK;AAAEC,EAAAA,KAAK,EAAE;AAAM,CAAC,CAC/B;AAEM,IAAMC,2BAA2B,GAAG;AACzCC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,IAAI,EAAE,GAAG;AACTC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,QAAQ,EA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