@bigbinary/neeto-integrations-frontend 2.8.0 → 2.9.0

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/Twilio.js CHANGED
@@ -1,76 +1,14 @@
1
- import React, { useState, useEffect, useRef } from 'react';
2
- import { isNotPresent, isPresent, noop, keysToSnakeCase, _findBy } from '@bigbinary/neeto-cist';
3
- import '@bigbinary/neeto-molecules/IntegrationCard';
4
- import DisconnectAlert from '@bigbinary/neeto-molecules/IntegrationDisconnectAlert';
5
- import WalkthroughModal from '@bigbinary/neeto-molecules/IntegrationWalkthroughModal';
6
- import i18next, { t as t$1 } from 'i18next';
7
- import { useMutationWithInvalidation, withTitle, withT, useStateWithDependency } from '@bigbinary/neeto-commons-frontend/react-utils';
8
- import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
1
+ import React, { useEffect, useRef } from 'react';
2
+ import { keysToSnakeCase, noop, _findBy } from '@bigbinary/neeto-cist';
3
+ import { Input, Select, Form, ActionBlock } from '@bigbinary/neetoui/formik';
4
+ import { prop, equals } from 'ramda';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { useMutationWithInvalidation, useStateWithDependency } from '@bigbinary/neeto-commons-frontend/react-utils';
9
7
  import { useQuery } from 'react-query';
10
8
  import axios from 'axios';
11
- import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
12
- import { Button, Typography, Modal as Modal$1 } from '@bigbinary/neetoui';
13
- import { Form as Form$2, Input, Select, ActionBlock } from '@bigbinary/neetoui/formik';
14
- import { useTranslation, Trans } from 'react-i18next';
15
- import classnames from 'classnames';
16
- import { prop, equals } from 'ramda';
9
+ import i18next from 'i18next';
17
10
  import * as yup from 'yup';
18
11
 
19
- function _arrayWithHoles(arr) {
20
- if (Array.isArray(arr)) return arr;
21
- }
22
-
23
- function _iterableToArrayLimit(arr, i) {
24
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
25
- if (null != _i) {
26
- var _s,
27
- _e,
28
- _x,
29
- _r,
30
- _arr = [],
31
- _n = !0,
32
- _d = !1;
33
- try {
34
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
35
- if (Object(_i) !== _i) return;
36
- _n = !1;
37
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
38
- } catch (err) {
39
- _d = !0, _e = err;
40
- } finally {
41
- try {
42
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
43
- } finally {
44
- if (_d) throw _e;
45
- }
46
- }
47
- return _arr;
48
- }
49
- }
50
-
51
- function _arrayLikeToArray(arr, len) {
52
- if (len == null || len > arr.length) len = arr.length;
53
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
54
- return arr2;
55
- }
56
-
57
- function _unsupportedIterableToArray(o, minLen) {
58
- if (!o) return;
59
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
60
- var n = Object.prototype.toString.call(o).slice(8, -1);
61
- if (n === "Object" && o.constructor) n = o.constructor.name;
62
- if (n === "Map" || n === "Set") return Array.from(o);
63
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
64
- }
65
-
66
- function _nonIterableRest() {
67
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
68
- }
69
-
70
- function _slicedToArray(arr, i) {
71
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
72
- }
73
-
74
12
  function _typeof(obj) {
75
13
  "@babel/helpers - typeof";
76
14
 
@@ -112,557 +50,8 @@ function _defineProperty(obj, key, value) {
112
50
  return obj;
113
51
  }
114
52
 
115
- var INTEGRATIONS_ENGINE_BASE_URL = "/neeto_integrations";
116
- var TWILIO_CONFIGURATION_BASE_URL = "".concat(INTEGRATIONS_ENGINE_BASE_URL, "/twilio/sms_configurations");
117
- var INTEGRATIONS_ENGINE_DAILY_URL = "".concat(INTEGRATIONS_ENGINE_BASE_URL, "/daily");
118
-
119
- var create = function create(payload) {
120
- return axios.post(INTEGRATIONS_ENGINE_DAILY_URL, {
121
- daily: payload
122
- });
123
- };
124
- var show = function show() {
125
- return axios.get(INTEGRATIONS_ENGINE_DAILY_URL);
126
- };
127
- var destroy = function destroy() {
128
- return axios["delete"](INTEGRATIONS_ENGINE_DAILY_URL);
129
- };
130
- var dailiesApi = {
131
- create: create,
132
- show: show,
133
- destroy: destroy
134
- };
135
-
136
- var QUERY_KEYS = {
137
- TWILIO_SMS_CONFIGURATION: "twilio-sms-configuration",
138
- TWILIO_PHONE_NUMBERS: "twilio-phone-numbers",
139
- DAILY_CO_DETAILS: "daily-co-details",
140
- ZOOM_DETAILS: "zoom-details"
141
- };
142
-
143
- function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
144
- function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
145
- var useCreateDaily = function useCreateDaily() {
146
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
147
- return useMutationWithInvalidation(dailiesApi.create, _objectSpread$4({
148
- keysToInvalidate: [QUERY_KEYS.DAILY_CO_DETAILS]
149
- }, options));
150
- };
151
- var useFetchDaily = function useFetchDaily() {
152
- return useQuery(QUERY_KEYS.DAILY_CO_DETAILS, dailiesApi.show, {
153
- staleTime: DEFAULT_STALE_TIME
154
- });
155
- };
156
- var useDestroyDaily = function useDestroyDaily(_ref) {
157
- var onSuccess = _ref.onSuccess;
158
- return useMutationWithInvalidation(dailiesApi.destroy, {
159
- keysToInvalidate: [QUERY_KEYS.DAILY_CO_DETAILS],
160
- onSuccess: onSuccess
161
- });
162
- };
163
-
164
- function _extends() {
165
- _extends = Object.assign ? Object.assign.bind() : function (target) {
166
- for (var i = 1; i < arguments.length; i++) {
167
- var source = arguments[i];
168
- for (var key in source) {
169
- if (Object.prototype.hasOwnProperty.call(source, key)) {
170
- target[key] = source[key];
171
- }
172
- }
173
- }
174
- return target;
175
- };
176
- return _extends.apply(this, arguments);
177
- }
178
-
179
- function _objectWithoutPropertiesLoose(source, excluded) {
180
- if (source == null) return {};
181
- var target = {};
182
- var sourceKeys = Object.keys(source);
183
- var key, i;
184
- for (i = 0; i < sourceKeys.length; i++) {
185
- key = sourceKeys[i];
186
- if (excluded.indexOf(key) >= 0) continue;
187
- target[key] = source[key];
188
- }
189
- return target;
190
- }
191
-
192
- function _objectWithoutProperties(source, excluded) {
193
- if (source == null) return {};
194
- var target = _objectWithoutPropertiesLoose(source, excluded);
195
- var key, i;
196
- if (Object.getOwnPropertySymbols) {
197
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
198
- for (i = 0; i < sourceSymbolKeys.length; i++) {
199
- key = sourceSymbolKeys[i];
200
- if (excluded.indexOf(key) >= 0) continue;
201
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
202
- target[key] = source[key];
203
- }
204
- }
205
- return target;
206
- }
207
-
208
- var _excluded = ["className", "children"];
209
- var ExternalLink = function ExternalLink(_ref) {
210
- var _ref$className = _ref.className,
211
- className = _ref$className === void 0 ? "" : _ref$className,
212
- _ref$children = _ref.children,
213
- children = _ref$children === void 0 ? null : _ref$children,
214
- props = _objectWithoutProperties(_ref, _excluded);
215
- return /*#__PURE__*/React.createElement("a", _extends({
216
- className: classnames(["neeto-ui-text-primary-800 hover:neeto-ui-text-primary-800 visited:neeto-ui-text-primary-600 font-medium", className])
217
- }, props), children);
218
- };
219
- var ExternalLink$1 = /*#__PURE__*/React.memo(ExternalLink);
220
-
221
- var MANAGE_DAILY_CO_FORM_INITIAL_VALUES = {
222
- apiKey: ""
223
- };
224
- var DAILY_CO_VALIDATION_SCHEMA = yup.object().shape({
225
- apiKey: yup.string().trim().required(t$1("neetoIntegrations.errors.required", {
226
- entity: t$1("neetoIntegrations.daily.apiKey")
227
- }))
228
- });
229
-
230
- var Form = function Form(_ref) {
231
- var helpDocUrl = _ref.helpDocUrl,
232
- videoUrl = _ref.videoUrl,
233
- onConnect = _ref.onConnect;
234
- var _useTranslation = useTranslation(),
235
- t = _useTranslation.t;
236
- var _useState = useState(false),
237
- _useState2 = _slicedToArray(_useState, 2),
238
- isDemoModalOpen = _useState2[0],
239
- setIsDemoModalOpen = _useState2[1];
240
- var _useCreateDaily = useCreateDaily({
241
- onSuccess: function onSuccess() {
242
- return onConnect === null || onConnect === void 0 ? void 0 : onConnect();
243
- }
244
- }),
245
- createDaily = _useCreateDaily.mutate,
246
- isConnecting = _useCreateDaily.isLoading;
247
- var handleSubmit = function handleSubmit(payload) {
248
- return createDaily(payload);
249
- };
250
- if (isConnecting) {
251
- return /*#__PURE__*/React.createElement(PageLoader, null);
252
- }
253
- return /*#__PURE__*/React.createElement("div", {
254
- className: "mx-auto w-full max-w-md"
255
- }, /*#__PURE__*/React.createElement(Form$2, {
256
- formikProps: {
257
- initialValues: MANAGE_DAILY_CO_FORM_INITIAL_VALUES,
258
- validationSchema: DAILY_CO_VALIDATION_SCHEMA,
259
- onSubmit: handleSubmit
260
- }
261
- }, function (_ref2) {
262
- var dirty = _ref2.dirty;
263
- return /*#__PURE__*/React.createElement("div", {
264
- className: "mt-10 w-full space-y-5"
265
- }, /*#__PURE__*/React.createElement("div", {
266
- className: "block"
267
- }, /*#__PURE__*/React.createElement(Input, {
268
- autoFocus: true,
269
- required: true,
270
- label: t("neetoIntegrations.daily.apiKey"),
271
- name: "apiKey",
272
- helpText: /*#__PURE__*/React.createElement(Trans, {
273
- i18nKey: "neetoIntegrations.daily.helpDoc",
274
- components: {
275
- externalLink: /*#__PURE__*/React.createElement(ExternalLink$1, {
276
- href: helpDocUrl,
277
- rel: "noreferrer",
278
- target: "_blank"
279
- })
280
- }
281
- })
282
- }), /*#__PURE__*/React.createElement(Button, {
283
- className: "mt-8",
284
- label: t("neetoIntegrations.daily.walkthroughText"),
285
- style: "link",
286
- onClick: function onClick() {
287
- return setIsDemoModalOpen(true);
288
- }
289
- })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
290
- disabled: isConnecting || !dirty,
291
- label: t("neetoIntegrations.common.connect"),
292
- loading: isConnecting,
293
- type: "submit"
294
- })));
295
- }), /*#__PURE__*/React.createElement(WalkthroughModal, {
296
- isOpen: isDemoModalOpen,
297
- videoUrl: videoUrl,
298
- onClose: function onClose() {
299
- return setIsDemoModalOpen(false);
300
- }
301
- }));
302
- };
303
- var Form$1 = withTitle(Form, i18next.t("neetoIntegrations.browserTitles.integrations.dailyco"));
304
-
305
- var Manage$1 = withT(function (_ref) {
306
- var t = _ref.t,
307
- title = _ref.title,
308
- description = _ref.description,
309
- integration = _ref.integration,
310
- isDisconnectAlertOpen = _ref.isDisconnectAlertOpen,
311
- setIsDisconnectAlertOpen = _ref.setIsDisconnectAlertOpen,
312
- isDisconnecting = _ref.isDisconnecting,
313
- onDisconnect = _ref.onDisconnect,
314
- onClose = _ref.onClose;
315
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
316
- className: "mx-auto w-full max-w-md"
317
- }, /*#__PURE__*/React.createElement("div", {
318
- className: "mt-10 w-full space-y-4"
319
- }, /*#__PURE__*/React.createElement(Typography, {
320
- className: "neeto-ui-text-gray-800 mb-0.5",
321
- style: "h3",
322
- weight: "semibold"
323
- }, title), /*#__PURE__*/React.createElement(Typography, {
324
- className: "neeto-ui-text-gray-600 break-all",
325
- style: "body1",
326
- weight: "normal"
327
- }, description), /*#__PURE__*/React.createElement(Button, {
328
- label: t("neetoIntegrations.common.disconnect"),
329
- style: "danger",
330
- onClick: function onClick() {
331
- return setIsDisconnectAlertOpen(true);
332
- }
333
- }))), /*#__PURE__*/React.createElement(DisconnectAlert, {
334
- isDisconnecting: isDisconnecting,
335
- onClose: onClose,
336
- onDisconnect: onDisconnect,
337
- isOpen: isDisconnectAlertOpen,
338
- message: t("neetoIntegrations.".concat(integration, ".disconnect.message")),
339
- title: t("neetoIntegrations.".concat(integration, ".disconnect.title"))
340
- }));
341
- });
342
-
343
- var Manage = function Manage(_ref) {
344
- var onDisconnect = _ref.onDisconnect;
345
- var _useState = useState(false),
346
- _useState2 = _slicedToArray(_useState, 2),
347
- isDisconnectAlertOpen = _useState2[0],
348
- setIsDisconnectAlertOpen = _useState2[1];
349
- var _useFetchDaily = useFetchDaily(),
350
- _useFetchDaily$data = _useFetchDaily.data,
351
- _useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
352
- _useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
353
- metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$,
354
- isLoading = _useFetchDaily.isLoading;
355
- var _ref2 = metadata || {},
356
- _ref2$apiKey = _ref2.apiKey,
357
- apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
358
- var _useTranslation = useTranslation(),
359
- t = _useTranslation.t;
360
- var _useDestroyDaily = useDestroyDaily({
361
- onSuccess: function onSuccess() {
362
- setIsDisconnectAlertOpen(false);
363
- onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
364
- }
365
- }),
366
- destroyIntegration = _useDestroyDaily.mutate,
367
- isDisconnecting = _useDestroyDaily.isLoading;
368
- var handleDisconnect = function handleDisconnect() {
369
- return destroyIntegration("daily");
370
- };
371
- if (isLoading || isDisconnecting) {
372
- return /*#__PURE__*/React.createElement(PageLoader, null);
373
- }
374
- if (isNotPresent(apiKey)) {
375
- onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
376
- }
377
- return /*#__PURE__*/React.createElement(Manage$1, {
378
- isDisconnectAlertOpen: isDisconnectAlertOpen,
379
- isDisconnecting: isDisconnecting,
380
- setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
381
- description: t("neetoIntegrations.daily.yourApiKey", {
382
- apiKey: apiKey
383
- }),
384
- integration: "daily",
385
- title: t("neetoIntegrations.daily.connected"),
386
- onClose: function onClose() {
387
- return setIsDisconnectAlertOpen(false);
388
- },
389
- onDisconnect: handleDisconnect
390
- });
391
- };
392
-
393
- var Daily = function Daily(_ref) {
394
- var _ref$isOnboarding = _ref.isOnboarding,
395
- isOnboarding = _ref$isOnboarding === void 0 ? false : _ref$isOnboarding,
396
- _ref$helpDocUrl = _ref.helpDocUrl,
397
- helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
398
- _ref$videoUrl = _ref.videoUrl,
399
- videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
400
- _ref$onConnect = _ref.onConnect,
401
- onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
402
- _ref$onDisconnect = _ref.onDisconnect,
403
- onDisconnect = _ref$onDisconnect === void 0 ? noop : _ref$onDisconnect;
404
- var _useFetchDaily = useFetchDaily(),
405
- _useFetchDaily$data = _useFetchDaily.data,
406
- _useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
407
- _useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
408
- metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$;
409
- var _ref2 = metadata || {},
410
- _ref2$apiKey = _ref2.apiKey,
411
- apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
412
- if (isPresent(apiKey) && !isOnboarding) {
413
- return /*#__PURE__*/React.createElement(Manage, {
414
- onDisconnect: onDisconnect
415
- });
416
- }
417
- return /*#__PURE__*/React.createElement(Form$1, {
418
- onConnect: onConnect,
419
- helpDocUrl: helpDocUrl,
420
- videoUrl: videoUrl
421
- });
422
- };
423
- withTitle(Daily, i18next.t("neetoIntegrations.browserTitles.integrations.dailyco"));
424
-
425
- var Stepper = function Stepper(_ref) {
426
- var _ref$steps = _ref.steps,
427
- steps = _ref$steps === void 0 ? {} : _ref$steps;
428
- var isActiveOrCompleted = function isActiveOrCompleted(activeStatus, completedStatus) {
429
- return activeStatus || completedStatus;
430
- };
431
- return /*#__PURE__*/React.createElement("ul", {
432
- className: "flex gap-4"
433
- }, steps === null || steps === void 0 ? void 0 : steps.map(function (_ref2) {
434
- var step = _ref2.step,
435
- label = _ref2.label,
436
- isActive = _ref2.isActive,
437
- isCompleted = _ref2.isCompleted;
438
- return /*#__PURE__*/React.createElement("li", {
439
- className: "flex items-center gap-4",
440
- key: step
441
- }, step !== "1" && /*#__PURE__*/React.createElement("div", {
442
- className: classnames("w-10 border-b", {
443
- "neeto-ui-border-gray-800": isActiveOrCompleted(isActive, isCompleted),
444
- "neeto-ui-border-gray-400": !isActiveOrCompleted(isActive, isCompleted)
445
- })
446
- }), /*#__PURE__*/React.createElement("div", {
447
- className: "flex items-center gap-2"
448
- }, /*#__PURE__*/React.createElement("div", {
449
- className: classnames("neeto-ui-rounded-full neeto-ui-gray-600 flex h-6 w-6 items-center justify-center border", {
450
- "neeto-ui-bg-success-600 neeto-ui-border-success-600 neeto-ui-text-white": isActive,
451
- "neeto-ui-bg-primary-600 neeto-ui-border-primary-600 neeto-ui-text-white": isCompleted,
452
- "neeto-ui-border-gray-400": !isActiveOrCompleted(isActive, isCompleted)
453
- })
454
- }, /*#__PURE__*/React.createElement(Typography, {
455
- component: "span",
456
- style: "body2",
457
- weight: "normal"
458
- }, step)), /*#__PURE__*/React.createElement(Typography, {
459
- style: "body2",
460
- weight: "normal",
461
- className: classnames({
462
- "neeto-ui-text-gray-800": isActiveOrCompleted(isActive, isCompleted),
463
- "neeto-ui-text-gray-600": !isActiveOrCompleted(isActive, isCompleted)
464
- })
465
- }, label)));
466
- }));
467
- };
468
-
469
- var Modal = function Modal(_ref) {
470
- var _ref$isOpen = _ref.isOpen,
471
- isOpen = _ref$isOpen === void 0 ? noop : _ref$isOpen,
472
- _ref$onClose = _ref.onClose,
473
- onClose = _ref$onClose === void 0 ? noop : _ref$onClose,
474
- _ref$steps = _ref.steps,
475
- steps = _ref$steps === void 0 ? {} : _ref$steps,
476
- children = _ref.children;
477
- return /*#__PURE__*/React.createElement(Modal$1, {
478
- className: "neeto-ui-flex neeto-ui-flex-col neeto-ui-transform-none w-screen overflow-y-auto",
479
- isOpen: isOpen,
480
- size: "fullScreen",
481
- onClose: onClose
482
- }, /*#__PURE__*/React.createElement(Modal$1.Header, null, /*#__PURE__*/React.createElement(Stepper, {
483
- steps: steps
484
- })), /*#__PURE__*/React.createElement(Modal$1.Body, {
485
- className: "neeto-ui-flex neeto-ui-justify-center neeto-ui-items-center neeto-ui-flex-grow"
486
- }, /*#__PURE__*/React.createElement("div", {
487
- className: "neeto-ui-w-full py-10"
488
- }, children)));
489
- };
490
-
491
- var propTypes = {exports: {}};
492
-
493
- /**
494
- * Copyright (c) 2013-present, Facebook, Inc.
495
- *
496
- * This source code is licensed under the MIT license found in the
497
- * LICENSE file in the root directory of this source tree.
498
- */
499
- var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
500
- var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
501
-
502
- /**
503
- * Copyright (c) 2013-present, Facebook, Inc.
504
- *
505
- * This source code is licensed under the MIT license found in the
506
- * LICENSE file in the root directory of this source tree.
507
- */
508
- var ReactPropTypesSecret = ReactPropTypesSecret_1;
509
- function emptyFunction() {}
510
- function emptyFunctionWithReset() {}
511
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
512
- var factoryWithThrowingShims = function factoryWithThrowingShims() {
513
- function shim(props, propName, componentName, location, propFullName, secret) {
514
- if (secret === ReactPropTypesSecret) {
515
- // It is still safe when called from React.
516
- return;
517
- }
518
- var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
519
- err.name = 'Invariant Violation';
520
- throw err;
521
- }
522
- shim.isRequired = shim;
523
- function getShim() {
524
- return shim;
525
- }
526
- // Important!
527
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
528
- var ReactPropTypes = {
529
- array: shim,
530
- bigint: shim,
531
- bool: shim,
532
- func: shim,
533
- number: shim,
534
- object: shim,
535
- string: shim,
536
- symbol: shim,
537
- any: shim,
538
- arrayOf: getShim,
539
- element: shim,
540
- elementType: shim,
541
- instanceOf: getShim,
542
- node: shim,
543
- objectOf: getShim,
544
- oneOf: getShim,
545
- oneOfType: getShim,
546
- shape: getShim,
547
- exact: getShim,
548
- checkPropTypes: emptyFunctionWithReset,
549
- resetWarningCache: emptyFunction
550
- };
551
- ReactPropTypes.PropTypes = ReactPropTypes;
552
- return ReactPropTypes;
553
- };
554
-
555
- /**
556
- * Copyright (c) 2013-present, Facebook, Inc.
557
- *
558
- * This source code is licensed under the MIT license found in the
559
- * LICENSE file in the root directory of this source tree.
560
- */
561
- {
562
- // By explicitly using `prop-types` you are opting into new production behavior.
563
- // http://fb.me/prop-types-in-prod
564
- propTypes.exports = factoryWithThrowingShims();
565
- }
566
-
567
- ({
568
- /**
569
- * To specify the Icon to be shown
570
- */
571
- Icon: propTypes.exports.PropTypes.node,
572
- /**
573
- * To specify the title of the connect component
574
- */
575
- title: propTypes.exports.PropTypes.string,
576
- /**
577
- * To specify the description for connect component
578
- */
579
- description: propTypes.exports.PropTypes.string,
580
- /**
581
- * To specify the props for the connect button
582
- */
583
- buttonProps: propTypes.exports.PropTypes.object,
584
- /**
585
- * Handler function that is triggered when the connect button is clicked.
586
- */
587
- onConnect: propTypes.exports.PropTypes.func
588
- });
589
-
590
- ({
591
- /**
592
- * To specify whether the integration modal should be opened or closed.
593
- */
594
- onClose: propTypes.exports.func,
595
- /**
596
- * To specify the walkthrough video link
597
- */
598
- videoUrl: propTypes.exports.string,
599
- /**
600
- * To specify the title of the demo component
601
- */
602
- title: propTypes.exports.string,
603
- /**
604
- * To specify the subtitle of the demo component
605
- */
606
- subtitle: propTypes.exports.string,
607
- /**
608
- * To specify the title of the video in the iframe
609
- */
610
- iframeTitle: propTypes.exports.string
611
- });
612
-
613
- ({
614
- /**
615
- * To specify whether the integration modal should be opened or closed.
616
- */
617
- onClick: propTypes.exports.func,
618
- /**
619
- * To show the title of the Finish component
620
- */
621
- title: propTypes.exports.string,
622
- /**
623
- * To specify props for primary button
624
- */
625
- buttonProps: propTypes.exports.object,
626
- /**
627
- * To specify props for secondary button
628
- */
629
- secondaryButtonProps: propTypes.exports.object
630
- });
631
-
632
- var e = [],
633
- t = [];
634
- function n(n, r) {
635
- if (n && "undefined" != typeof document) {
636
- var a,
637
- s = !0 === r.prepend ? "prepend" : "append",
638
- d = !0 === r.singleTag,
639
- i = "string" == typeof r.container ? document.querySelector(r.container) : document.getElementsByTagName("head")[0];
640
- if (d) {
641
- var u = e.indexOf(i);
642
- -1 === u && (u = e.push(i) - 1, t[u] = {}), a = t[u] && t[u][s] ? t[u][s] : t[u][s] = c();
643
- } else a = c();
644
- 65279 === n.charCodeAt(0) && (n = n.substring(1)), a.styleSheet ? a.styleSheet.cssText += n : a.appendChild(document.createTextNode(n));
645
- }
646
- function c() {
647
- var e = document.createElement("style");
648
- 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]]);
649
- var a = "prepend" === s ? "afterbegin" : "beforeend";
650
- return i.insertAdjacentElement(a, e), e;
651
- }
652
- }
653
-
654
- var css = ".intrinsic-container{height:0;overflow:hidden;position:relative}.intrinsic-container-16x9{padding-bottom:56.25%}.intrinsic-container-4x3{padding-bottom:75%}.intrinsic-container iframe{height:100%;left:0;position:absolute;top:0;width:100%}";
655
- n(css,{});
656
-
657
- var TWILIO_INTEGRATION_STEPS = [{
658
- step: "1",
659
- label: i18next.t("neetoIntegrations.steps.configure"),
660
- isActive: true,
661
- isCompleted: false
662
- }];
663
-
664
- function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
665
- function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
53
+ function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
54
+ function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
666
55
  var ConfigurationForm = function ConfigurationForm(_ref) {
667
56
  var _errors$twilioPhoneNu;
668
57
  var phoneNumberOptions = _ref.phoneNumberOptions,
@@ -711,31 +100,73 @@ var ConfigurationForm = function ConfigurationForm(_ref) {
711
100
  options: phoneNumberOptions,
712
101
  size: "large",
713
102
  onChange: function onChange(selected) {
714
- return setValues(_objectSpread$3(_objectSpread$3({}, values), {}, {
103
+ return setValues(_objectSpread$2(_objectSpread$2({}, values), {}, {
715
104
  twilioPhoneNumber: selected
716
105
  }));
717
106
  }
718
107
  })));
719
108
  };
720
109
 
721
- function _arrayWithoutHoles(arr) {
722
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
110
+ function _arrayWithHoles(arr) {
111
+ if (Array.isArray(arr)) return arr;
112
+ }
113
+
114
+ function _iterableToArrayLimit(arr, i) {
115
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
116
+ if (null != _i) {
117
+ var _s,
118
+ _e,
119
+ _x,
120
+ _r,
121
+ _arr = [],
122
+ _n = !0,
123
+ _d = !1;
124
+ try {
125
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
126
+ if (Object(_i) !== _i) return;
127
+ _n = !1;
128
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
129
+ } catch (err) {
130
+ _d = !0, _e = err;
131
+ } finally {
132
+ try {
133
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
134
+ } finally {
135
+ if (_d) throw _e;
136
+ }
137
+ }
138
+ return _arr;
139
+ }
723
140
  }
724
141
 
725
- function _iterableToArray(iter) {
726
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
142
+ function _arrayLikeToArray(arr, len) {
143
+ if (len == null || len > arr.length) len = arr.length;
144
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
145
+ return arr2;
727
146
  }
728
147
 
729
- function _nonIterableSpread() {
730
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
148
+ function _unsupportedIterableToArray(o, minLen) {
149
+ if (!o) return;
150
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
151
+ var n = Object.prototype.toString.call(o).slice(8, -1);
152
+ if (n === "Object" && o.constructor) n = o.constructor.name;
153
+ if (n === "Map" || n === "Set") return Array.from(o);
154
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
731
155
  }
732
156
 
733
- function _toConsumableArray(arr) {
734
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
157
+ function _nonIterableRest() {
158
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
735
159
  }
736
160
 
737
- function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
738
- function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
161
+ function _slicedToArray(arr, i) {
162
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
163
+ }
164
+
165
+ var INTEGRATIONS_ENGINE_BASE_URL = "/neeto_integrations";
166
+ var TWILIO_CONFIGURATION_BASE_URL = "".concat(INTEGRATIONS_ENGINE_BASE_URL, "/twilio/sms_configurations");
167
+
168
+ function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
169
+ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
739
170
  var fetchTwilioSmsConfiguration = function fetchTwilioSmsConfiguration(integrable) {
740
171
  return axios.get(TWILIO_CONFIGURATION_BASE_URL, {
741
172
  params: integrable
@@ -750,7 +181,7 @@ var getTwilioPhoneNumbers = function getTwilioPhoneNumbers(data) {
750
181
  });
751
182
  };
752
183
  var createTwilioConfiguration = function createTwilioConfiguration(payload, integrable) {
753
- return axios.post(TWILIO_CONFIGURATION_BASE_URL, _objectSpread$2(_objectSpread$2({}, payload), integrable));
184
+ return axios.post(TWILIO_CONFIGURATION_BASE_URL, _objectSpread$1(_objectSpread$1({}, payload), integrable));
754
185
  };
755
186
  var twilioApi = {
756
187
  fetchTwilioSmsConfiguration: fetchTwilioSmsConfiguration,
@@ -759,6 +190,13 @@ var twilioApi = {
759
190
  createTwilioConfiguration: createTwilioConfiguration
760
191
  };
761
192
 
193
+ var QUERY_KEYS = {
194
+ TWILIO_SMS_CONFIGURATION: "twilio-sms-configuration",
195
+ TWILIO_PHONE_NUMBERS: "twilio-phone-numbers",
196
+ DAILY_CO_DETAILS: "daily-co-details",
197
+ ZOOM_DETAILS: "zoom-details"
198
+ };
199
+
762
200
  var useFetchTwilioSmsConfiguration = function useFetchTwilioSmsConfiguration(_ref) {
763
201
  var integrable = _ref.integrable;
764
202
  return useQuery([QUERY_KEYS.TWILIO_SMS_CONFIGURATION, integrable === null || integrable === void 0 ? void 0 : integrable.integrableId], function () {
@@ -798,12 +236,8 @@ var useCreateTwilioConfiguration = function useCreateTwilioConfiguration(_ref3)
798
236
  });
799
237
  };
800
238
 
801
- function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
802
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
803
239
  var useTwilio = function useTwilio(_ref) {
804
- var _ref$setSteps = _ref.setSteps,
805
- setSteps = _ref$setSteps === void 0 ? noop : _ref$setSteps,
806
- _ref$onConnect = _ref.onConnect,
240
+ var _ref$onConnect = _ref.onConnect,
807
241
  onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
808
242
  _ref$formRef = _ref.formRef,
809
243
  formRef = _ref$formRef === void 0 ? null : _ref$formRef,
@@ -812,7 +246,8 @@ var useTwilio = function useTwilio(_ref) {
812
246
  var _useFetchTwilioSmsCon = useFetchTwilioSmsConfiguration({
813
247
  integrable: integrable
814
248
  }),
815
- configuration = _useFetchTwilioSmsCon.data,
249
+ _useFetchTwilioSmsCon2 = _useFetchTwilioSmsCon.data,
250
+ configuration = _useFetchTwilioSmsCon2 === void 0 ? {} : _useFetchTwilioSmsCon2,
816
251
  isConfigurationLoading = _useFetchTwilioSmsCon.isLoading;
817
252
  var _useStateWithDependen = useStateWithDependency(configuration),
818
253
  _useStateWithDependen2 = _slicedToArray(_useStateWithDependen, 2),
@@ -829,16 +264,6 @@ var useTwilio = function useTwilio(_ref) {
829
264
  }),
830
265
  saveConfiguration = _useCreateTwilioConfi.mutate,
831
266
  isSubmitting = _useCreateTwilioConfi.isLoading;
832
- useEffect(function () {
833
- if (!(configuration !== null && configuration !== void 0 && configuration.twilioPhoneNumber)) return;
834
- setSteps(function (steps) {
835
- var stepsClone = _toConsumableArray(steps);
836
- stepsClone[0] = _objectSpread$1(_objectSpread$1({}, steps[0]), {}, {
837
- isCompleted: true
838
- });
839
- return stepsClone;
840
- });
841
- }, [configuration]);
842
267
  var handleSubmit = function handleSubmit(values) {
843
268
  var _values$twilioPhoneNu;
844
269
  var payload = {
@@ -877,23 +302,18 @@ var buildTwilioConfigurationValidationSchema = function buildTwilioConfiguration
877
302
 
878
303
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
879
304
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
880
- var TwilioConfiguration = function TwilioConfiguration(_ref) {
881
- var _ref$onCancel = _ref.onCancel,
882
- onCancel = _ref$onCancel === void 0 ? noop : _ref$onCancel,
883
- _ref$setSteps = _ref.setSteps,
884
- setSteps = _ref$setSteps === void 0 ? noop : _ref$setSteps,
305
+ var Twilio = function Twilio(_ref) {
306
+ var _ref$integrable = _ref.integrable,
307
+ integrable = _ref$integrable === void 0 ? null : _ref$integrable,
308
+ _ref$onClose = _ref.onClose,
309
+ onClose = _ref$onClose === void 0 ? noop : _ref$onClose,
885
310
  _ref$onConnect = _ref.onConnect,
886
- onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
887
- _ref$isModal = _ref.isModal,
888
- isModal = _ref$isModal === void 0 ? false : _ref$isModal,
889
- _ref$integrable = _ref.integrable,
890
- integrable = _ref$integrable === void 0 ? null : _ref$integrable;
311
+ onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect;
891
312
  var _useTranslation = useTranslation(),
892
313
  t = _useTranslation.t;
893
314
  var initialFocusRef = useRef();
894
315
  var formRef = useRef();
895
316
  var _useTwilio = useTwilio({
896
- setSteps: setSteps,
897
317
  onConnect: onConnect,
898
318
  formRef: formRef,
899
319
  integrable: integrable
@@ -915,43 +335,14 @@ var TwilioConfiguration = function TwilioConfiguration(_ref) {
915
335
  var selectedPhoneNumber = _findBy({
916
336
  label: configuration === null || configuration === void 0 ? void 0 : configuration.twilioPhoneNumber
917
337
  }, phoneNumberOptions);
918
- var wrapInModalBody = function wrapInModalBody(children) {
919
- return /*#__PURE__*/React.createElement(Modal$1.Body, null, children);
920
- };
921
- var wrapInModalFooter = function wrapInModalFooter(children) {
922
- return /*#__PURE__*/React.createElement(Modal$1.Footer, null, children);
923
- };
924
338
  var isLoading = isPhoneNumbersLoading || isConfigurationLoading;
925
339
  var isSubmitDisabled = function isSubmitDisabled(values) {
926
340
  return equals(_objectSpread(_objectSpread({}, configuration), {}, {
927
341
  twilioPhoneNumber: selectedPhoneNumber
928
342
  }), values) || isLoading;
929
343
  };
930
- var renderActionBlock = function renderActionBlock(values) {
931
- return /*#__PURE__*/React.createElement(ActionBlock, {
932
- cancelButtonProps: {
933
- onClick: onCancel,
934
- disabled: false
935
- },
936
- className: "space-x-3",
937
- submitButtonProps: {
938
- label: phoneNumberOptions ? t("neetoIntegrations.common.saveChanges") : t("neetoIntegrations.common.verify"),
939
- disabled: isSubmitDisabled(values),
940
- loading: isSubmitting || isPhoneNumbersLoading && !(configuration !== null && configuration !== void 0 && configuration.twilioAuthToken)
941
- }
942
- });
943
- };
944
- var renderForm = function renderForm(formikProps) {
945
- return /*#__PURE__*/React.createElement(ConfigurationForm, {
946
- formikProps: formikProps,
947
- initialFocusRef: initialFocusRef,
948
- isUsingOverlay: isModal,
949
- phoneNumberOptions: phoneNumberOptions,
950
- selectedPhoneNumber: selectedPhoneNumber
951
- });
952
- };
953
- return /*#__PURE__*/React.createElement(Form$2, {
954
- className: "mx-auto flex w-full max-w-md flex-col",
344
+ return /*#__PURE__*/React.createElement(Form, {
345
+ className: "mx-auto flex w-full max-w-md flex-col p-5",
955
346
  formikProps: {
956
347
  enableReinitialize: true,
957
348
  validationSchema: buildTwilioConfigurationValidationSchema(!!phoneNumbers),
@@ -960,39 +351,27 @@ var TwilioConfiguration = function TwilioConfiguration(_ref) {
960
351
  onSubmit: handleSubmit
961
352
  }
962
353
  }, function (formikProps) {
963
- return isModal ? /*#__PURE__*/React.createElement(React.Fragment, null, wrapInModalBody(renderForm(formikProps)), wrapInModalFooter(renderActionBlock(formikProps.values))) : /*#__PURE__*/React.createElement(React.Fragment, null, "renderForm(formikProps)", /*#__PURE__*/React.createElement("div", {
354
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ConfigurationForm, {
355
+ formikProps: formikProps,
356
+ initialFocusRef: initialFocusRef,
357
+ phoneNumberOptions: phoneNumberOptions,
358
+ selectedPhoneNumber: selectedPhoneNumber
359
+ }), /*#__PURE__*/React.createElement("div", {
964
360
  className: "mt-4 flex items-center gap-x-2"
965
- }, renderActionBlock(formikProps.values)));
361
+ }, /*#__PURE__*/React.createElement(ActionBlock, {
362
+ cancelButtonProps: {
363
+ onClick: onClose,
364
+ disabled: false
365
+ },
366
+ className: "space-x-3",
367
+ submitButtonProps: {
368
+ label: phoneNumberOptions ? t("neetoIntegrations.common.saveChanges") : t("neetoIntegrations.common.verify"),
369
+ disabled: isSubmitDisabled(formikProps.values),
370
+ loading: isSubmitting || isPhoneNumbersLoading && !(configuration !== null && configuration !== void 0 && configuration.twilioAuthToken)
371
+ }
372
+ })));
966
373
  });
967
374
  };
968
375
 
969
- var Twilio = function Twilio(_ref) {
970
- var _ref$integrable = _ref.integrable,
971
- integrable = _ref$integrable === void 0 ? null : _ref$integrable,
972
- _ref$isModal = _ref.isModal,
973
- isModal = _ref$isModal === void 0 ? true : _ref$isModal,
974
- _ref$isModalOpen = _ref.isModalOpen,
975
- isModalOpen = _ref$isModalOpen === void 0 ? true : _ref$isModalOpen,
976
- _ref$onClose = _ref.onClose,
977
- onClose = _ref$onClose === void 0 ? noop : _ref$onClose,
978
- _ref$onConnect = _ref.onConnect,
979
- onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect;
980
- var _useState = useState(TWILIO_INTEGRATION_STEPS),
981
- _useState2 = _slicedToArray(_useState, 2),
982
- steps = _useState2[0],
983
- setSteps = _useState2[1];
984
- return /*#__PURE__*/React.createElement(Modal, {
985
- isOpen: isModalOpen,
986
- steps: steps,
987
- onClose: onClose
988
- }, /*#__PURE__*/React.createElement(TwilioConfiguration, {
989
- integrable: integrable,
990
- isModal: isModal,
991
- setSteps: setSteps,
992
- onCancel: onClose,
993
- onConnect: onConnect
994
- }));
995
- };
996
-
997
376
  export { Twilio as default };
998
377
  //# sourceMappingURL=Twilio.js.map