@bigbinary/neeto-email-delivery-frontend 1.0.25 → 1.0.27

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 (47) hide show
  1. package/app/javascript/src/translations/en.json +16 -0
  2. package/app/javascript/src/translations/hu.json +113 -0
  3. package/dist/EmailDeliveryScreen.js +22 -584
  4. package/dist/EmailDeliveryScreen.js.map +1 -1
  5. package/dist/SparkpostDomainSetup.js +20 -2
  6. package/dist/SparkpostDomainSetup.js.map +1 -1
  7. package/dist/SparkpostDomainVerify.js +13 -3
  8. package/dist/SparkpostDomainVerify.js.map +1 -1
  9. package/dist/cjs/EmailDeliveryScreen.js +23 -600
  10. package/dist/cjs/EmailDeliveryScreen.js.map +1 -1
  11. package/dist/cjs/SparkpostDomainSetup.js +20 -2
  12. package/dist/cjs/SparkpostDomainSetup.js.map +1 -1
  13. package/dist/cjs/SparkpostDomainVerify.js +13 -3
  14. package/dist/cjs/SparkpostDomainVerify.js.map +1 -1
  15. package/dist/cjs/hooks.js +6 -46
  16. package/dist/cjs/hooks.js.map +1 -1
  17. package/dist/cjs/index.js +424 -29
  18. package/dist/cjs/index.js.map +1 -1
  19. package/dist/hooks.js +4 -48
  20. package/dist/hooks.js.map +1 -1
  21. package/dist/index-BKKcEEt1.js +337 -0
  22. package/dist/index-BKKcEEt1.js.map +1 -0
  23. package/dist/index-C7KroEtv.js +342 -0
  24. package/dist/index-C7KroEtv.js.map +1 -0
  25. package/dist/index.js +408 -28
  26. package/dist/index.js.map +1 -1
  27. package/dist/useEmailDeliveryIntegrationApi-BD6h2h5w.js +57 -0
  28. package/dist/useEmailDeliveryIntegrationApi-BD6h2h5w.js.map +1 -0
  29. package/dist/useEmailDeliveryIntegrationApi-NUL8d1xC.js +55 -0
  30. package/dist/useEmailDeliveryIntegrationApi-NUL8d1xC.js.map +1 -0
  31. package/dist/useSparkpostApi-C7cHCa3T.js +253 -0
  32. package/dist/useSparkpostApi-C7cHCa3T.js.map +1 -0
  33. package/dist/{useOutlookIntegrationApi-b_mNVfRE.js → useSparkpostApi-tYImubXZ.js} +150 -53
  34. package/dist/useSparkpostApi-tYImubXZ.js.map +1 -0
  35. package/dist/{useSparkpostDomain-DtEcunpG.js → useSparkpostDomain-BiZb7l8r.js} +2 -2
  36. package/dist/{useSparkpostDomain-DtEcunpG.js.map → useSparkpostDomain-BiZb7l8r.js.map} +1 -1
  37. package/dist/{useSparkpostDomain-De-Fz3ek.js → useSparkpostDomain-CmX8ka38.js} +2 -2
  38. package/dist/{useSparkpostDomain-De-Fz3ek.js.map → useSparkpostDomain-CmX8ka38.js.map} +1 -1
  39. package/package.json +16 -18
  40. package/types.d.ts +23 -2
  41. package/dist/useOutlookIntegrationApi-BC-RPHmJ.js +0 -149
  42. package/dist/useOutlookIntegrationApi-BC-RPHmJ.js.map +0 -1
  43. package/dist/useOutlookIntegrationApi-b_mNVfRE.js.map +0 -1
  44. package/dist/useSparkpostApi-D9NOjTNA.js +0 -120
  45. package/dist/useSparkpostApi-D9NOjTNA.js.map +0 -1
  46. package/dist/useSparkpostApi-qpRhsK7H.js +0 -106
  47. package/dist/useSparkpostApi-qpRhsK7H.js.map +0 -1
@@ -0,0 +1,342 @@
1
+ 'use strict';
2
+
3
+ var neetoCist = require('@bigbinary/neeto-cist');
4
+ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
5
+ var MailSend = require('@bigbinary/neeto-icons/MailSend');
6
+ var GmailIcon = require('@bigbinary/neeto-icons/misc/Gmail');
7
+ var OutlookIcon = require('@bigbinary/neeto-icons/misc/Outlook');
8
+ var Spinner = require('@bigbinary/neetoui/Spinner');
9
+ var Toastr = require('@bigbinary/neetoui/Toastr');
10
+ var reactI18next = require('react-i18next');
11
+ var reactRouterDom = require('react-router-dom');
12
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
13
+ var react = require('react');
14
+ var reactQuery = require('@tanstack/react-query');
15
+ var utils = require('@bigbinary/neeto-commons-frontend/utils');
16
+ var useSparkpostApi = require('./useSparkpostApi-C7cHCa3T.js');
17
+ var useSparkpostDomain = require('./useSparkpostDomain-BiZb7l8r.js');
18
+ var i18next = require('i18next');
19
+ var Check = require('@bigbinary/neeto-icons/Check');
20
+ var Warning = require('@bigbinary/neeto-icons/Warning');
21
+ var Tag = require('@bigbinary/neetoui/Tag');
22
+ var Typography = require('@bigbinary/neetoui/Typography');
23
+ var jsxRuntime = require('react/jsx-runtime');
24
+
25
+ var useGmail = function useGmail(_ref) {
26
+ var ownerId = _ref.ownerId,
27
+ indexRoute = _ref.indexRoute,
28
+ canManageIntegrations = _ref.canManageIntegrations;
29
+ var _useState = react.useState(false),
30
+ _useState2 = _slicedToArray(_useState, 2),
31
+ isDisconnectAlertOpen = _useState2[0],
32
+ setIsDisconnectAlertOpen = _useState2[1];
33
+ var history = reactRouterDom.useHistory();
34
+ var queryClient = reactQuery.useQueryClient();
35
+ var _useFetchGmail = useSparkpostApi.useFetchGmail(ownerId, {
36
+ enabled: canManageIntegrations
37
+ }),
38
+ isLoading = _useFetchGmail.isLoading,
39
+ _useFetchGmail$data = _useFetchGmail.data,
40
+ data = _useFetchGmail$data === void 0 ? {} : _useFetchGmail$data;
41
+ var _useDestroyGmail = useSparkpostApi.useDestroyGmail({
42
+ ownerId: ownerId
43
+ }),
44
+ isDestroying = _useDestroyGmail.isPending,
45
+ destroyIntegration = _useDestroyGmail.mutate;
46
+ var onClose = function onClose() {
47
+ return history.replace(indexRoute);
48
+ };
49
+ var onDisconnect = function onDisconnect() {
50
+ destroyIntegration(false, {
51
+ onSuccess: function onSuccess() {
52
+ utils.showThumbsUpToastr();
53
+ setIsDisconnectAlertOpen(false);
54
+ useSparkpostApi.invalidateAllIntegrationQueries(queryClient, ownerId);
55
+ history.replace(indexRoute);
56
+ }
57
+ });
58
+ };
59
+ return {
60
+ data: data,
61
+ isLoading: isLoading,
62
+ isDestroying: isDestroying,
63
+ exists: data === null || data === void 0 ? void 0 : data.exists,
64
+ isConnected: data === null || data === void 0 ? void 0 : data.connected,
65
+ isDisconnectAlertOpen: isDisconnectAlertOpen,
66
+ setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
67
+ onDisconnect: onDisconnect,
68
+ onClose: onClose,
69
+ errorMessage: data === null || data === void 0 ? void 0 : data.error
70
+ };
71
+ };
72
+
73
+ var useOutlook = function useOutlook(_ref) {
74
+ var ownerId = _ref.ownerId,
75
+ indexRoute = _ref.indexRoute,
76
+ canManageIntegrations = _ref.canManageIntegrations;
77
+ var _useState = react.useState(false),
78
+ _useState2 = _slicedToArray(_useState, 2),
79
+ isDisconnectAlertOpen = _useState2[0],
80
+ setIsDisconnectAlertOpen = _useState2[1];
81
+ var history = reactRouterDom.useHistory();
82
+ var queryClient = reactQuery.useQueryClient();
83
+ var _useFetchOutlook = useSparkpostApi.useFetchOutlook(ownerId, {
84
+ enabled: canManageIntegrations
85
+ }),
86
+ isLoading = _useFetchOutlook.isLoading,
87
+ _useFetchOutlook$data = _useFetchOutlook.data,
88
+ data = _useFetchOutlook$data === void 0 ? {} : _useFetchOutlook$data;
89
+ var _useDestroyOutlook = useSparkpostApi.useDestroyOutlook({
90
+ ownerId: ownerId
91
+ }),
92
+ isDestroying = _useDestroyOutlook.isPending,
93
+ destroyIntegration = _useDestroyOutlook.mutate;
94
+ var onClose = function onClose() {
95
+ return history.replace(indexRoute);
96
+ };
97
+ var onDisconnect = function onDisconnect() {
98
+ destroyIntegration(false, {
99
+ onSuccess: function onSuccess() {
100
+ utils.showThumbsUpToastr();
101
+ setIsDisconnectAlertOpen(false);
102
+ useSparkpostApi.invalidateAllIntegrationQueries(queryClient, ownerId);
103
+ history.replace(indexRoute);
104
+ }
105
+ });
106
+ };
107
+ return {
108
+ data: data,
109
+ isLoading: isLoading,
110
+ exists: data === null || data === void 0 ? void 0 : data.exists,
111
+ status: data === null || data === void 0 ? void 0 : data.status,
112
+ shadowAccount: data === null || data === void 0 ? void 0 : data.shadowAccount,
113
+ isWaitingForTestEmail: (data === null || data === void 0 ? void 0 : data.status) === "inactive" && !(data !== null && data !== void 0 && data.connected),
114
+ isDestroying: isDestroying,
115
+ isConnected: data === null || data === void 0 ? void 0 : data.connected,
116
+ isDisconnectAlertOpen: isDisconnectAlertOpen,
117
+ setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
118
+ onDisconnect: onDisconnect,
119
+ onClose: onClose,
120
+ errorMessage: data === null || data === void 0 ? void 0 : data.error
121
+ };
122
+ };
123
+
124
+ var useSmtp = function useSmtp(_ref) {
125
+ var ownerId = _ref.ownerId,
126
+ canManageIntegrations = _ref.canManageIntegrations;
127
+ var _useFetchSmtp = useSparkpostApi.useFetchSmtp(ownerId, {
128
+ enabled: canManageIntegrations
129
+ }),
130
+ isLoading = _useFetchSmtp.isLoading,
131
+ _useFetchSmtp$data = _useFetchSmtp.data,
132
+ data = _useFetchSmtp$data === void 0 ? {} : _useFetchSmtp$data;
133
+ var _useDestroySmtp = useSparkpostApi.useDestroySmtp({
134
+ ownerId: ownerId
135
+ }),
136
+ isDestroying = _useDestroySmtp.isPending,
137
+ onDisconnect = _useDestroySmtp.mutate;
138
+ return {
139
+ data: data,
140
+ isConnected: data === null || data === void 0 ? void 0 : data.connected,
141
+ isLoading: isLoading,
142
+ isDestroying: isDestroying,
143
+ onDisconnect: onDisconnect,
144
+ exists: data === null || data === void 0 ? void 0 : data.exists
145
+ };
146
+ };
147
+
148
+ var ERROR_MESSAGES = {
149
+ gmail_permission_not_given: i18next.t("neetoEmailDelivery.gmail.permissionNotGiven"),
150
+ outlook_permission_not_given: i18next.t("neetoEmailDelivery.outlook.permissionNotGiven"),
151
+ outlook_invalid_client: i18next.t("neetoEmailDelivery.outlook.invalidClient"),
152
+ outlook_nil_json_web_token: i18next.t("neetoEmailDelivery.outlook.nilJsonWebToken")
153
+ };
154
+ var STATUS_TAG_CONFIG = {
155
+ connected: {
156
+ labelKey: "neetoEmailDelivery.sparkpost.emailDelivery.connected",
157
+ style: "success",
158
+ icon: Check
159
+ },
160
+ pending: {
161
+ labelKey: "neetoEmailDelivery.integrationDetail.pending",
162
+ style: "warning",
163
+ icon: Warning
164
+ },
165
+ error: {
166
+ labelKey: "neetoEmailDelivery.integrationDetail.error",
167
+ style: "danger",
168
+ icon: Warning
169
+ }
170
+ };
171
+
172
+ var IntegrationCard = function IntegrationCard(_ref) {
173
+ var Icon = _ref.icon,
174
+ title = _ref.title,
175
+ description = _ref.description,
176
+ status = _ref.status,
177
+ path = _ref.path;
178
+ var _useTranslation = reactI18next.useTranslation(),
179
+ t = _useTranslation.t;
180
+ var tagConfig = STATUS_TAG_CONFIG[status];
181
+ return /*#__PURE__*/jsxRuntime.jsxs(reactRouterDom.Link, {
182
+ className: "neeto-ui-rounded-lg neeto-ui-border-gray-200 flex cursor-pointer flex-col gap-y-4 border p-6 no-underline outline-none transition-shadow duration-300 ease-in-out",
183
+ to: path,
184
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
185
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
186
+ className: "mb-2.5 flex items-center gap-3",
187
+ children: [Icon && /*#__PURE__*/jsxRuntime.jsx(Icon, {
188
+ className: "neeto-ui-text-gray-500",
189
+ size: 24
190
+ }), /*#__PURE__*/jsxRuntime.jsx(Typography, {
191
+ className: "neeto-ui-text-black text-lg leading-6",
192
+ style: "h3",
193
+ weight: "semibold",
194
+ children: title
195
+ })]
196
+ }), /*#__PURE__*/jsxRuntime.jsx(Typography, {
197
+ className: "neeto-ui-text-gray-600",
198
+ style: "body2",
199
+ children: description
200
+ })]
201
+ }), tagConfig && /*#__PURE__*/jsxRuntime.jsx("div", {
202
+ className: "neeto-ui-border-gray-300 border-t pt-3",
203
+ children: /*#__PURE__*/jsxRuntime.jsx(Tag, {
204
+ className: "flex-row-reverse",
205
+ icon: tagConfig.icon,
206
+ label: t(tagConfig.labelKey),
207
+ style: tagConfig.style
208
+ })
209
+ })]
210
+ });
211
+ };
212
+
213
+ var EmailDeliveryScreen = function EmailDeliveryScreen(_ref) {
214
+ var indexRoute = _ref.indexRoute,
215
+ ownerId = _ref.ownerId,
216
+ canManageIntegrations = _ref.canManageIntegrations,
217
+ gmailRoute = _ref.gmailRoute,
218
+ outlookRoute = _ref.outlookRoute,
219
+ customEmailProviderRoute = _ref.customEmailProviderRoute,
220
+ smtpRoute = _ref.smtpRoute;
221
+ var _useTranslation = reactI18next.useTranslation(),
222
+ t = _useTranslation.t;
223
+ var history = reactRouterDom.useHistory();
224
+ var _useQueryParams = reactUtils.useQueryParams(),
225
+ error = _useQueryParams.error,
226
+ errorDescription = _useQueryParams.errorDescription;
227
+ if (neetoCist.isPresent(error)) {
228
+ var _errorMessage;
229
+ var errorMessage = ERROR_MESSAGES[error];
230
+ if (errorDescription) {
231
+ errorMessage = "".concat(errorMessage, " ").concat(errorDescription);
232
+ }
233
+ Toastr.error((_errorMessage = errorMessage) !== null && _errorMessage !== void 0 ? _errorMessage : neetoCist.humanize(error));
234
+ history.replace(indexRoute);
235
+ }
236
+ var gmailIntegration = useGmail({
237
+ ownerId: ownerId,
238
+ indexRoute: indexRoute,
239
+ canManageIntegrations: canManageIntegrations
240
+ });
241
+ var outlookIntegration = useOutlook({
242
+ ownerId: ownerId,
243
+ indexRoute: indexRoute,
244
+ canManageIntegrations: canManageIntegrations
245
+ });
246
+ var sparkpostIntegration = useSparkpostDomain.useSparkpostDomain({
247
+ ownerId: ownerId,
248
+ canManageIntegrations: canManageIntegrations
249
+ });
250
+ var smtpIntegration = useSmtp({
251
+ ownerId: ownerId,
252
+ canManageIntegrations: canManageIntegrations
253
+ });
254
+ var isGmailConnected = gmailIntegration.isConnected,
255
+ isGmailLoading = gmailIntegration.isLoading,
256
+ gmailError = gmailIntegration.errorMessage;
257
+ var isOutlookConnected = outlookIntegration.isConnected,
258
+ isOutlookLoading = outlookIntegration.isLoading,
259
+ isOutlookPending = outlookIntegration.isWaitingForTestEmail,
260
+ outlookError = outlookIntegration.errorMessage;
261
+ var isSparkpostConnected = sparkpostIntegration.isConnected,
262
+ isSparkpostLoading = sparkpostIntegration.isLoading,
263
+ sparkpostExists = sparkpostIntegration.exists;
264
+ var isSmtpConnected = smtpIntegration.isConnected,
265
+ isSmtpLoading = smtpIntegration.isLoading;
266
+ var getCardStatus = function getCardStatus(_ref2) {
267
+ var isConnected = _ref2.isConnected,
268
+ isPending = _ref2.isPending,
269
+ hasError = _ref2.hasError;
270
+ if (isConnected) return "connected";
271
+ if (hasError) return "error";
272
+ if (isPending) return "pending";
273
+ return null;
274
+ };
275
+ var isLoading = isGmailLoading || isOutlookLoading || isSparkpostLoading || isSmtpLoading;
276
+ var gmailTitle = t("neetoEmailDelivery.gmail.title");
277
+ var gmailDescription = t("neetoEmailDelivery.gmail.description");
278
+ var outlookTitle = t("neetoEmailDelivery.outlook.title");
279
+ var outlookDescription = t("neetoEmailDelivery.outlook.description");
280
+ var ownDomainTitle = t("neetoEmailDelivery.sparkpost.emailDelivery.ownDomainTitle");
281
+ var ownDomainDescription = t("neetoEmailDelivery.sparkpost.emailDelivery.ownDomainDescription");
282
+ var smtpTitle = t("neetoEmailDelivery.smtp.title");
283
+ var smtpDescription = t("neetoEmailDelivery.smtp.description");
284
+ if (isLoading) {
285
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
286
+ className: "flex grow items-center justify-center w-full",
287
+ children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
288
+ });
289
+ }
290
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
291
+ className: "min-h-0 w-full grow",
292
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
293
+ className: "@container mx-auto space-y-6",
294
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
295
+ className: "grid grid-cols-1 gap-3 py-1 @lg:grid-cols-2 @lg:gap-6 @3xl:grid-cols-3 @7xl:grid-cols-4",
296
+ children: [/*#__PURE__*/jsxRuntime.jsx(IntegrationCard, {
297
+ description: gmailDescription,
298
+ icon: GmailIcon,
299
+ path: gmailRoute,
300
+ title: gmailTitle,
301
+ status: getCardStatus({
302
+ isConnected: isGmailConnected,
303
+ hasError: !!gmailError
304
+ })
305
+ }), /*#__PURE__*/jsxRuntime.jsx(IntegrationCard, {
306
+ description: outlookDescription,
307
+ icon: OutlookIcon,
308
+ path: outlookRoute,
309
+ title: outlookTitle,
310
+ status: getCardStatus({
311
+ isConnected: isOutlookConnected,
312
+ isPending: isOutlookPending,
313
+ hasError: !!outlookError
314
+ })
315
+ }), /*#__PURE__*/jsxRuntime.jsx(IntegrationCard, {
316
+ description: ownDomainDescription,
317
+ icon: MailSend,
318
+ path: customEmailProviderRoute,
319
+ title: ownDomainTitle,
320
+ status: getCardStatus({
321
+ isConnected: isSparkpostConnected,
322
+ isPending: sparkpostExists && !isSparkpostConnected
323
+ })
324
+ }), /*#__PURE__*/jsxRuntime.jsx(IntegrationCard, {
325
+ description: smtpDescription,
326
+ icon: MailSend,
327
+ path: smtpRoute,
328
+ status: getCardStatus({
329
+ isConnected: isSmtpConnected
330
+ }),
331
+ title: smtpTitle
332
+ })]
333
+ })
334
+ })
335
+ });
336
+ };
337
+
338
+ exports.EmailDeliveryScreen = EmailDeliveryScreen;
339
+ exports.useGmail = useGmail;
340
+ exports.useOutlook = useOutlook;
341
+ exports.useSmtp = useSmtp;
342
+ //# sourceMappingURL=index-C7KroEtv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-C7KroEtv.js","sources":["../app/javascript/src/hooks/integrations/useGmail.js","../app/javascript/src/hooks/integrations/useOutlook.js","../app/javascript/src/hooks/integrations/useSmtp.js","../app/javascript/src/components/EmailDeliveryScreen/constants.js","../app/javascript/src/components/EmailDeliveryScreen/IntegrationCard.jsx","../app/javascript/src/components/EmailDeliveryScreen/index.jsx"],"sourcesContent":["import { useState } from \"react\";\n\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { showThumbsUpToastr } from \"neetocommons/utils\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n useFetchGmail,\n useDestroyGmail,\n} from \"hooks/reactQuery/integrations/useGmailIntegrationApi\";\nimport { invalidateAllIntegrationQueries } from \"src/utils\";\n\nconst useGmail = ({ ownerId, indexRoute, canManageIntegrations }) => {\n const [isDisconnectAlertOpen, setIsDisconnectAlertOpen] = useState(false);\n\n const history = useHistory();\n\n const queryClient = useQueryClient();\n\n const { isLoading, data = {} } = useFetchGmail(ownerId, {\n enabled: canManageIntegrations,\n });\n\n const { isPending: isDestroying, mutate: destroyIntegration } =\n useDestroyGmail({ ownerId });\n\n const onClose = () => history.replace(indexRoute);\n\n const onDisconnect = () => {\n destroyIntegration(false, {\n onSuccess: () => {\n showThumbsUpToastr();\n setIsDisconnectAlertOpen(false);\n invalidateAllIntegrationQueries(queryClient, ownerId);\n history.replace(indexRoute);\n },\n });\n };\n\n return {\n data,\n isLoading,\n isDestroying,\n exists: data?.exists,\n isConnected: data?.connected,\n isDisconnectAlertOpen,\n setIsDisconnectAlertOpen,\n onDisconnect,\n onClose,\n errorMessage: data?.error,\n };\n};\n\nexport default useGmail;\n","import { useState } from \"react\";\n\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { showThumbsUpToastr } from \"neetocommons/utils\";\nimport { useHistory } from \"react-router-dom\";\n\nimport {\n useFetchOutlook,\n useDestroyOutlook,\n} from \"hooks/reactQuery/integrations/useOutlookIntegrationApi\";\nimport { invalidateAllIntegrationQueries } from \"src/utils\";\n\nconst useOutlook = ({ ownerId, indexRoute, canManageIntegrations }) => {\n const [isDisconnectAlertOpen, setIsDisconnectAlertOpen] = useState(false);\n\n const history = useHistory();\n\n const queryClient = useQueryClient();\n\n const { isLoading, data = {} } = useFetchOutlook(ownerId, {\n enabled: canManageIntegrations,\n });\n\n const { isPending: isDestroying, mutate: destroyIntegration } =\n useDestroyOutlook({ ownerId });\n\n const onClose = () => history.replace(indexRoute);\n\n const onDisconnect = () => {\n destroyIntegration(false, {\n onSuccess: () => {\n showThumbsUpToastr();\n setIsDisconnectAlertOpen(false);\n invalidateAllIntegrationQueries(queryClient, ownerId);\n history.replace(indexRoute);\n },\n });\n };\n\n return {\n data,\n isLoading,\n exists: data?.exists,\n status: data?.status,\n shadowAccount: data?.shadowAccount,\n isWaitingForTestEmail: data?.status === \"inactive\" && !data?.connected,\n isDestroying,\n isConnected: data?.connected,\n isDisconnectAlertOpen,\n setIsDisconnectAlertOpen,\n onDisconnect,\n onClose,\n errorMessage: data?.error,\n };\n};\n\nexport default useOutlook;\n","import {\n useFetchSmtp,\n useDestroySmtp,\n} from \"hooks/reactQuery/integrations/useSmtpIntegrationApi\";\n\nconst useSmtp = ({ ownerId, canManageIntegrations }) => {\n const { isLoading, data = {} } = useFetchSmtp(ownerId, {\n enabled: canManageIntegrations,\n });\n\n const { isPending: isDestroying, mutate: onDisconnect } = useDestroySmtp({\n ownerId,\n });\n\n return {\n data,\n isConnected: data?.connected,\n isLoading,\n isDestroying,\n onDisconnect,\n exists: data?.exists,\n };\n};\n\nexport default useSmtp;\n","import { t } from \"i18next\";\nimport { Check, Warning } from \"neetoicons\";\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 STATUS_TAG_CONFIG = {\n connected: {\n labelKey: \"neetoEmailDelivery.sparkpost.emailDelivery.connected\",\n style: \"success\",\n icon: Check,\n },\n pending: {\n labelKey: \"neetoEmailDelivery.integrationDetail.pending\",\n style: \"warning\",\n icon: Warning,\n },\n error: {\n labelKey: \"neetoEmailDelivery.integrationDetail.error\",\n style: \"danger\",\n icon: Warning,\n },\n};\n","import { Tag, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link } from \"react-router-dom\";\n\nimport { STATUS_TAG_CONFIG } from \"./constants\";\n\nconst IntegrationCard = ({ icon: Icon, title, description, status, path }) => {\n const { t } = useTranslation();\n\n const tagConfig = STATUS_TAG_CONFIG[status];\n\n return (\n <Link\n className=\"neeto-ui-rounded-lg neeto-ui-border-gray-200 flex cursor-pointer flex-col gap-y-4 border p-6 no-underline outline-none transition-shadow duration-300 ease-in-out\"\n to={path}\n >\n <div>\n <div className=\"mb-2.5 flex items-center gap-3\">\n {Icon && <Icon className=\"neeto-ui-text-gray-500\" size={24} />}\n <Typography\n className=\"neeto-ui-text-black text-lg leading-6\"\n style=\"h3\"\n weight=\"semibold\"\n >\n {title}\n </Typography>\n </div>\n <Typography className=\"neeto-ui-text-gray-600\" style=\"body2\">\n {description}\n </Typography>\n </div>\n {tagConfig && (\n <div className=\"neeto-ui-border-gray-300 border-t pt-3\">\n <Tag\n className=\"flex-row-reverse\"\n icon={tagConfig.icon}\n label={t(tagConfig.labelKey)}\n style={tagConfig.style}\n />\n </div>\n )}\n </Link>\n );\n};\n\nexport default IntegrationCard;\n","import { humanize, isPresent } from \"neetocist\";\nimport { useQueryParams } from \"neetocommons/react-utils\";\nimport { MailSend } from \"neetoicons\";\nimport { Gmail as GmailIcon, Outlook as OutlookIcon } from \"neetoicons/misc\";\nimport { Spinner, Toastr } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\nimport { useHistory } from \"react-router-dom\";\n\nimport useGmail from \"hooks/integrations/useGmail\";\nimport useOutlook from \"hooks/integrations/useOutlook\";\nimport useSmtp from \"hooks/integrations/useSmtp\";\nimport useSparkpostDomain from \"hooks/integrations/useSparkpostDomain\";\n\nimport { ERROR_MESSAGES } from \"./constants\";\nimport IntegrationCard from \"./IntegrationCard\";\n\nconst EmailDeliveryScreen = ({\n indexRoute,\n ownerId,\n canManageIntegrations,\n gmailRoute,\n outlookRoute,\n customEmailProviderRoute,\n smtpRoute,\n}) => {\n const { t } = useTranslation();\n const history = useHistory();\n const { error, errorDescription } = useQueryParams();\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(indexRoute);\n }\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 {\n isConnected: isGmailConnected,\n isLoading: isGmailLoading,\n errorMessage: gmailError,\n } = gmailIntegration;\n\n const {\n isConnected: isOutlookConnected,\n isLoading: isOutlookLoading,\n isWaitingForTestEmail: isOutlookPending,\n errorMessage: outlookError,\n } = outlookIntegration;\n\n const {\n isConnected: isSparkpostConnected,\n isLoading: isSparkpostLoading,\n exists: sparkpostExists,\n } = sparkpostIntegration;\n\n const { isConnected: isSmtpConnected, isLoading: isSmtpLoading } =\n smtpIntegration;\n\n const getCardStatus = ({ isConnected, isPending, hasError }) => {\n if (isConnected) return \"connected\";\n\n if (hasError) return \"error\";\n\n if (isPending) return \"pending\";\n\n return null;\n };\n\n const isLoading =\n isGmailLoading || isOutlookLoading || isSparkpostLoading || isSmtpLoading;\n\n const gmailTitle = t(\"neetoEmailDelivery.gmail.title\");\n const gmailDescription = t(\"neetoEmailDelivery.gmail.description\");\n\n const outlookTitle = t(\"neetoEmailDelivery.outlook.title\");\n const outlookDescription = t(\"neetoEmailDelivery.outlook.description\");\n\n const ownDomainTitle = t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.ownDomainTitle\"\n );\n\n const ownDomainDescription = t(\n \"neetoEmailDelivery.sparkpost.emailDelivery.ownDomainDescription\"\n );\n\n const smtpTitle = t(\"neetoEmailDelivery.smtp.title\");\n const smtpDescription = t(\"neetoEmailDelivery.smtp.description\");\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 <div className=\"min-h-0 w-full grow\">\n <div className=\"@container mx-auto space-y-6\">\n <div className=\"grid grid-cols-1 gap-3 py-1 @lg:grid-cols-2 @lg:gap-6 @3xl:grid-cols-3 @7xl:grid-cols-4\">\n <IntegrationCard\n description={gmailDescription}\n icon={GmailIcon}\n path={gmailRoute}\n title={gmailTitle}\n status={getCardStatus({\n isConnected: isGmailConnected,\n hasError: !!gmailError,\n })}\n />\n <IntegrationCard\n description={outlookDescription}\n icon={OutlookIcon}\n path={outlookRoute}\n title={outlookTitle}\n status={getCardStatus({\n isConnected: isOutlookConnected,\n isPending: isOutlookPending,\n hasError: !!outlookError,\n })}\n />\n <IntegrationCard\n description={ownDomainDescription}\n icon={MailSend}\n path={customEmailProviderRoute}\n title={ownDomainTitle}\n status={getCardStatus({\n isConnected: isSparkpostConnected,\n isPending: sparkpostExists && !isSparkpostConnected,\n })}\n />\n <IntegrationCard\n description={smtpDescription}\n icon={MailSend}\n path={smtpRoute}\n status={getCardStatus({ isConnected: isSmtpConnected })}\n title={smtpTitle}\n />\n </div>\n </div>\n </div>\n );\n};\n\nexport default EmailDeliveryScreen;\n"],"names":["useGmail","_ref","ownerId","indexRoute","canManageIntegrations","_useState","useState","_useState2","_slicedToArray","isDisconnectAlertOpen","setIsDisconnectAlertOpen","history","useHistory","queryClient","useQueryClient","_useFetchGmail","useFetchGmail","enabled","isLoading","_useFetchGmail$data","data","_useDestroyGmail","useDestroyGmail","isDestroying","isPending","destroyIntegration","mutate","onClose","replace","onDisconnect","onSuccess","showThumbsUpToastr","invalidateAllIntegrationQueries","exists","isConnected","connected","errorMessage","error","useOutlook","_useFetchOutlook","useFetchOutlook","_useFetchOutlook$data","_useDestroyOutlook","useDestroyOutlook","status","shadowAccount","isWaitingForTestEmail","useSmtp","_useFetchSmtp","useFetchSmtp","_useFetchSmtp$data","_useDestroySmtp","useDestroySmtp","ERROR_MESSAGES","gmail_permission_not_given","t","outlook_permission_not_given","outlook_invalid_client","outlook_nil_json_web_token","STATUS_TAG_CONFIG","labelKey","style","icon","Check","pending","Warning","IntegrationCard","Icon","title","description","path","_useTranslation","useTranslation","tagConfig","_jsxs","Link","className","to","children","_jsx","size","Typography","weight","Tag","label","EmailDeliveryScreen","gmailRoute","outlookRoute","customEmailProviderRoute","smtpRoute","_useQueryParams","useQueryParams","errorDescription","isPresent","_errorMessage","concat","Toastr","humanize","gmailIntegration","outlookIntegration","sparkpostIntegration","useSparkpostDomain","smtpIntegration","isGmailConnected","isGmailLoading","gmailError","isOutlookConnected","isOutlookLoading","isOutlookPending","outlookError","isSparkpostConnected","isSparkpostLoading","sparkpostExists","isSmtpConnected","isSmtpLoading","getCardStatus","_ref2","hasError","gmailTitle","gmailDescription","outlookTitle","outlookDescription","ownDomainTitle","ownDomainDescription","smtpTitle","smtpDescription","Spinner","GmailIcon","OutlookIcon","MailSend"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAAuD;AAAA,EAAA,IAAjDC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IAAEC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IAAEC,qBAAqB,GAAAH,IAAA,CAArBG,qBAAqB;AAC5D,EAAA,IAAAC,SAAA,GAA0DC,cAAQ,CAAC,KAAK,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAlEI,IAAAA,qBAAqB,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,wBAAwB,GAAAH,UAAA,CAAA,CAAA,CAAA;AAEtD,EAAA,IAAMI,OAAO,GAAGC,yBAAU,EAAE;AAE5B,EAAA,IAAMC,WAAW,GAAGC,yBAAc,EAAE;AAEpC,EAAA,IAAAC,cAAA,GAAiCC,6BAAa,CAACd,OAAO,EAAE;AACtDe,MAAAA,OAAO,EAAEb;AACX,KAAC,CAAC;IAFMc,SAAS,GAAAH,cAAA,CAATG,SAAS;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