@crystaldesign/diva-core 24.9.1 → 24.10.0-beta.10
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/build/esm/{ModalsWrapper-4ad44cc8.js → ModalsWrapper-ca9b239c.js} +4 -2
- package/build/esm/{index-b1441014.js → index-6e70e7f8.js} +4 -2
- package/build/esm/{index-1bac8457.js → index-e556fb95.js} +1252 -475
- package/build/esm/index.js +3 -1
- package/build/types/core/src/Content.d.ts +3 -3
- package/build/types/core/src/Content.d.ts.map +1 -1
- package/build/types/core/src/DivaCore.d.ts +1 -1
- package/build/types/core/src/DivaCore.d.ts.map +1 -1
- package/build/types/core/src/externalTypes.d.ts +4 -4
- package/build/types/core/src/externalTypes.d.ts.map +1 -1
- package/build/types/core/src/handler/AdminHandler/index.d.ts +2 -2
- package/build/types/core/src/handler/AdminHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/AnalyticsHandler/index.d.ts +2 -2
- package/build/types/core/src/handler/AnalyticsHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/AuthorizationHandler/index.d.ts +4 -3
- package/build/types/core/src/handler/AuthorizationHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/ClientArticleHandler/index.d.ts +2 -2
- package/build/types/core/src/handler/ClientArticleHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/ContentItemHandler/index.d.ts +3 -3
- package/build/types/core/src/handler/ContentItemHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/InternalApiHandler.d.ts +3 -3
- package/build/types/core/src/handler/InternalApiHandler.d.ts.map +1 -1
- package/build/types/core/src/handler/MediaHandler/index.d.ts +2 -2
- package/build/types/core/src/handler/MediaHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/OrganizationHandler/index.d.ts +2 -2
- package/build/types/core/src/handler/OrganizationHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/ProductHandler/index.d.ts +5 -4
- package/build/types/core/src/handler/ProductHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/ReportHandler/index.d.ts +3 -2
- package/build/types/core/src/handler/ReportHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/SupportHandler/index.d.ts +2 -2
- package/build/types/core/src/handler/SupportHandler/index.d.ts.map +1 -1
- package/build/types/core/src/index.d.ts +2 -1
- package/build/types/core/src/index.d.ts.map +1 -1
- package/build/types/core/src/store/ConfigurationStore.d.ts.map +1 -1
- package/build/types/core/src/store/ContentStore.d.ts +1 -3
- package/build/types/core/src/store/ContentStore.d.ts.map +1 -1
- package/build/types/core/src/store/DataStore.d.ts +1 -1
- package/build/types/core/src/store/RootStore.d.ts +54 -15
- package/build/types/core/src/store/RootStore.d.ts.map +1 -1
- package/build/types/core/src/store/index.d.ts +5 -1
- package/build/types/core/src/store/index.d.ts.map +1 -1
- package/build/types/core/src/store/mock/divaCoreMockProvider.d.ts +15 -0
- package/build/types/core/src/store/mock/divaCoreMockProvider.d.ts.map +1 -0
- package/build/types/core/src/store/mock/index.d.ts +19 -0
- package/build/types/core/src/store/mock/index.d.ts.map +1 -0
- package/build/types/core/src/utils/ApplicationLogger/index.d.ts.map +1 -1
- package/build/types/core/src/utils/defaultTheme.d.ts +25 -0
- package/build/types/core/src/utils/defaultTheme.d.ts.map +1 -0
- package/build/types/core/src/utils/dimensionsFunctions.d.ts +10 -0
- package/build/types/core/src/utils/dimensionsFunctions.d.ts.map +1 -0
- package/build/types/core/src/utils/parseApiConfig.d.ts +4 -0
- package/build/types/core/src/utils/parseApiConfig.d.ts.map +1 -0
- package/build/types/core/src/utils/updateCssThemeVariables.d.ts +3 -0
- package/build/types/core/src/utils/updateCssThemeVariables.d.ts.map +1 -0
- package/build/umd/15.diva-core.umd.min.js +1 -1
- package/build/umd/311.diva-core.umd.min.js +1 -1
- package/build/umd/319.diva-core.umd.min.js +1 -1
- package/build/umd/397.diva-core.umd.min.js +1 -1
- package/build/umd/40.diva-core.umd.min.js +1 -1
- package/build/umd/455.diva-core.umd.min.js +1 -1
- package/build/umd/82.diva-core.umd.min.js +1 -1
- package/build/umd/84.diva-core.umd.min.js +1 -1
- package/build/umd/89.diva-core.umd.min.js +1 -1
- package/build/umd/diva-core.umd.min.js +1 -1
- package/build/umd/diva-core.umd.min.js.LICENSE.txt +9 -0
- package/build/umd/report.html +1 -1
- package/package.json +10 -10
|
@@ -10,7 +10,7 @@ import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
|
|
|
10
10
|
import _inherits from '@babel/runtime/helpers/inherits';
|
|
11
11
|
import _wrapNativeSuper from '@babel/runtime/helpers/wrapNativeSuper';
|
|
12
12
|
import ReactDOM from 'react-dom';
|
|
13
|
-
import React, { forwardRef, useState, useEffect, createContext, useMemo, useImperativeHandle, useRef
|
|
13
|
+
import React, { forwardRef, useState, useEffect, useCallback, Suspense, createContext, useMemo, useImperativeHandle, useRef } from 'react';
|
|
14
14
|
import { observer } from 'mobx-react-lite';
|
|
15
15
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
16
16
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
@@ -20,13 +20,15 @@ import MobileDetect from 'mobile-detect';
|
|
|
20
20
|
import i18n from 'i18next';
|
|
21
21
|
import HttpApi from 'i18next-http-backend';
|
|
22
22
|
import * as CoreStyles from '@material-ui/core/styles';
|
|
23
|
-
import {
|
|
23
|
+
import { StylesProvider, MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles';
|
|
24
24
|
import { enUS, itIT, frFR, deDE } from '@material-ui/core/locale';
|
|
25
25
|
import { withTransaction } from '@elastic/apm-rum-react';
|
|
26
26
|
import Typography from '@material-ui/core/Typography';
|
|
27
27
|
import { useTranslation, Trans, I18nextProvider } from 'react-i18next';
|
|
28
28
|
import classnames from 'classnames';
|
|
29
29
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
30
|
+
import '@crystaldesign/basket-model';
|
|
31
|
+
import { debounce } from 'lodash';
|
|
30
32
|
import axios from 'axios';
|
|
31
33
|
import { ProductHandlerAbstract } from '@crystaldesign/product-handler';
|
|
32
34
|
import { useSwipeable } from 'react-swipeable';
|
|
@@ -35,13 +37,13 @@ import { Button as Button$1, Snackbar, SnackbarContent, IconButton, Card, CardHe
|
|
|
35
37
|
import { useTranslation as useTranslation$1, useDivaCore as useDivaCore$1 } from '@crystaldesign/diva-core';
|
|
36
38
|
import QRCode from 'react-qr-code';
|
|
37
39
|
import CloseIcon from '@material-ui/icons/Close';
|
|
38
|
-
import '@crystaldesign/basket-model';
|
|
39
40
|
import IconButton$1 from '@material-ui/core/IconButton';
|
|
40
41
|
import HelpOutline from '@material-ui/icons/HelpOutline';
|
|
42
|
+
import { actions } from '@storybook/addon-actions';
|
|
41
43
|
import * as Styles from '@material-ui/styles';
|
|
42
44
|
|
|
43
45
|
(function() {
|
|
44
|
-
const env = {"STAGE":"production","VERSION":"24.
|
|
46
|
+
const env = {"STAGE":"production","VERSION":"24.10.0-beta.10"};
|
|
45
47
|
try {
|
|
46
48
|
if (process) {
|
|
47
49
|
process.env = Object.assign({}, process.env);
|
|
@@ -118,8 +120,8 @@ function baseUrl() {
|
|
|
118
120
|
return urlParts[urlParts.length - 2] + '.' + urlParts[urlParts.length - 1];
|
|
119
121
|
}
|
|
120
122
|
|
|
121
|
-
function ownKeys$
|
|
122
|
-
function _objectSpread$
|
|
123
|
+
function ownKeys$h(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
124
|
+
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$h(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$h(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
123
125
|
var _existingLogger = new Map();
|
|
124
126
|
var _apmInitialized = false;
|
|
125
127
|
var _onErrorEvent = function _onErrorEvent() {};
|
|
@@ -200,9 +202,9 @@ var ApplicationLogger = /*#__PURE__*/function () {
|
|
|
200
202
|
this.transactions["delete"](eventId);
|
|
201
203
|
event.end = end;
|
|
202
204
|
var cleanLabels = this.cleanLabels(labels);
|
|
203
|
-
event.event.labels = _objectSpread$
|
|
205
|
+
event.event.labels = _objectSpread$h(_objectSpread$h({}, event.event.labels), cleanLabels);
|
|
204
206
|
if (event.event.span) {
|
|
205
|
-
event.event.span.addLabels(_objectSpread$
|
|
207
|
+
event.event.span.addLabels(_objectSpread$h(_objectSpread$h(_objectSpread$h({}, event.event.labels), cleanLabels), {}, {
|
|
206
208
|
eventId: eventId
|
|
207
209
|
}));
|
|
208
210
|
event.event.span.end();
|
|
@@ -210,7 +212,7 @@ var ApplicationLogger = /*#__PURE__*/function () {
|
|
|
210
212
|
clearTimeout(event.event.warningTimeout);
|
|
211
213
|
clearTimeout(event.event.errorTimeout);
|
|
212
214
|
this.debug("Transaction ".concat(event.event.type, " (").concat(event.event.message, ") took ").concat(Math.floor(end - event.start), "ms"));
|
|
213
|
-
DivaUtils.businessMetrics.logEvent(event.event.type, this.module, event.event.message, _objectSpread$
|
|
215
|
+
DivaUtils.businessMetrics.logEvent(event.event.type, this.module, event.event.message, _objectSpread$h(_objectSpread$h(_objectSpread$h({}, event.event.labels), cleanLabels), {}, {
|
|
214
216
|
eventId: eventId,
|
|
215
217
|
status: event.event.timeout ? 'TIMEOUT' : 'SUCCESS',
|
|
216
218
|
eventDuration: Math.floor(end - event.start),
|
|
@@ -245,9 +247,9 @@ var ApplicationLogger = /*#__PURE__*/function () {
|
|
|
245
247
|
}
|
|
246
248
|
event.end = end;
|
|
247
249
|
var cleanLabels = this.cleanLabels(labels);
|
|
248
|
-
event.event.labels = _objectSpread$
|
|
250
|
+
event.event.labels = _objectSpread$h(_objectSpread$h({}, event.event.labels), cleanLabels);
|
|
249
251
|
if (event.event.span) {
|
|
250
|
-
event.event.span.addLabels(_objectSpread$
|
|
252
|
+
event.event.span.addLabels(_objectSpread$h(_objectSpread$h(_objectSpread$h({}, event.event.labels), cleanLabels), {}, {
|
|
251
253
|
eventId: eventId
|
|
252
254
|
}));
|
|
253
255
|
event.event.span.end();
|
|
@@ -255,7 +257,7 @@ var ApplicationLogger = /*#__PURE__*/function () {
|
|
|
255
257
|
clearTimeout(event.event.warningTimeout);
|
|
256
258
|
clearTimeout(event.event.errorTimeout);
|
|
257
259
|
this.debug("Transaction ".concat(event.event.type, " (").concat(event.event.message, ") failed after ").concat(Math.floor(end - event.start), "ms"));
|
|
258
|
-
DivaUtils.businessMetrics.logEvent(event.event.type, this.module, event.event.message, _objectSpread$
|
|
260
|
+
DivaUtils.businessMetrics.logEvent(event.event.type, this.module, event.event.message, _objectSpread$h(_objectSpread$h(_objectSpread$h({}, event.event.labels), cleanLabels), {}, {
|
|
259
261
|
error: code,
|
|
260
262
|
errorMessage: message,
|
|
261
263
|
eventId: eventId,
|
|
@@ -348,13 +350,13 @@ var ApplicationLogger = /*#__PURE__*/function () {
|
|
|
348
350
|
}, {
|
|
349
351
|
key: "error",
|
|
350
352
|
value: function error(_error) {
|
|
351
|
-
var _error$
|
|
353
|
+
var _error$custom, _getApmInstance;
|
|
352
354
|
if (!this.isValidLogLevel(3)) return;
|
|
353
|
-
console.error("".concat(this.getPrefix('ERROR', _error.name)).concat(this.getApmTransationIdFormatted())
|
|
355
|
+
console.error("".concat(this.getPrefix('ERROR', _error.name)).concat(this.getApmTransationIdFormatted()), _error, (_error$custom = _error.custom) !== null && _error$custom !== void 0 ? _error$custom : ' ');
|
|
354
356
|
_onErrorEvent(_error.message, _error.name);
|
|
355
357
|
|
|
356
358
|
//for apm we spread the custom object directly on the error object, so that the are added to APM as custom attributes
|
|
357
|
-
var forApm = _objectSpread$
|
|
359
|
+
var forApm = _objectSpread$h(_objectSpread$h({}, _error), _error.custom);
|
|
358
360
|
(_getApmInstance = getApmInstance()) === null || _getApmInstance === void 0 || _getApmInstance.captureError(forApm);
|
|
359
361
|
}
|
|
360
362
|
}, {
|
|
@@ -429,8 +431,8 @@ if (typeof __webpack_public_path__ !== 'undefined') {
|
|
|
429
431
|
}
|
|
430
432
|
|
|
431
433
|
var _excluded$7 = ["children"];
|
|
432
|
-
function ownKeys$
|
|
433
|
-
function _objectSpread$
|
|
434
|
+
function ownKeys$g(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
435
|
+
function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
434
436
|
function _callSuper$2(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
435
437
|
function _isNativeReflectConstruct$2() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
436
438
|
var LOG$e = getLogger('Framework', 'webcomponent');
|
|
@@ -656,14 +658,14 @@ var CoreWrapper = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
656
658
|
if (!components) {
|
|
657
659
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
658
660
|
}
|
|
659
|
-
return /*#__PURE__*/jsx(DivaCore, _objectSpread$
|
|
661
|
+
return /*#__PURE__*/jsx(DivaCore, _objectSpread$g(_objectSpread$g({}, props), {}, {
|
|
660
662
|
components: components,
|
|
661
663
|
ref: ref
|
|
662
664
|
}));
|
|
663
665
|
});
|
|
664
666
|
|
|
665
667
|
//we have to externalize the materialUI styling here, so that also in UMD the same instance is used
|
|
666
|
-
window.MaterialUIStyles = _objectSpread$
|
|
668
|
+
window.MaterialUIStyles = _objectSpread$g(_objectSpread$g({}, Styles), CoreStyles);
|
|
667
669
|
if (!window.customElements.get('diva-framework')) {
|
|
668
670
|
window.customElements.define('diva-framework', DivaFramework);
|
|
669
671
|
}
|
|
@@ -693,8 +695,69 @@ function parseUrl(service, baseUrl) {
|
|
|
693
695
|
}
|
|
694
696
|
}
|
|
695
697
|
|
|
696
|
-
function
|
|
697
|
-
|
|
698
|
+
function parseApiConfig (config, defaultApiConfig, organization) {
|
|
699
|
+
var _ref, _config$baseUrl, _DIVA_GLOBAL_ENV, _window, _GLOBAL_ENV$analytics, _GLOBAL_ENV$authServi, _GLOBAL_ENV$adminServ, _GLOBAL_ENV$messageSe, _GLOBAL_ENV$catalogSe, _GLOBAL_ENV$supportSe, _GLOBAL_ENV$basketSer, _GLOBAL_ENV$mediaServ, _GLOBAL_ENV$construct, _GLOBAL_ENV$reportSer, _GLOBAL_ENV$clientArt, _GLOBAL_ENV$idmServic, _GLOBAL_ENV$enricherS, _config$useDebugUrl, _ref2, _organization$api2Loc, _organization$api2Loc2, _ref3, _ref4, _organization$api2Loc3, _organization$api2Loc4, _organization$api2Loc5, _ref5, _ref6, _organization$api2Loc6, _organization$api2Loc7, _organization$api2Loc8;
|
|
700
|
+
var baseUrl = (_ref = (_config$baseUrl = config === null || config === void 0 ? void 0 : config.baseUrl) !== null && _config$baseUrl !== void 0 ? _config$baseUrl : defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.baseUrl) !== null && _ref !== void 0 ? _ref : 'https://api.diva-portal.com';
|
|
701
|
+
var GLOBAL_ENV = (_DIVA_GLOBAL_ENV = (_window = window) === null || _window === void 0 ? void 0 : _window.DIVA_GLOBAL_ENV) !== null && _DIVA_GLOBAL_ENV !== void 0 ? _DIVA_GLOBAL_ENV : {};
|
|
702
|
+
var c = {
|
|
703
|
+
analyticsService: (_GLOBAL_ENV$analytics = GLOBAL_ENV.analyticsService) !== null && _GLOBAL_ENV$analytics !== void 0 ? _GLOBAL_ENV$analytics : getUrl('analytics', config === null || config === void 0 ? void 0 : config.analyticsService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.analyticsService, baseUrl),
|
|
704
|
+
authService: (_GLOBAL_ENV$authServi = GLOBAL_ENV.authService) !== null && _GLOBAL_ENV$authServi !== void 0 ? _GLOBAL_ENV$authServi : getUrl('auth', config === null || config === void 0 ? void 0 : config.authService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.authService, baseUrl),
|
|
705
|
+
adminService: (_GLOBAL_ENV$adminServ = GLOBAL_ENV.adminService) !== null && _GLOBAL_ENV$adminServ !== void 0 ? _GLOBAL_ENV$adminServ : getUrl('admin', config === null || config === void 0 ? void 0 : config.adminService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.adminService, baseUrl),
|
|
706
|
+
messageService: (_GLOBAL_ENV$messageSe = GLOBAL_ENV.messageService) !== null && _GLOBAL_ENV$messageSe !== void 0 ? _GLOBAL_ENV$messageSe : getUrl('messages', config === null || config === void 0 ? void 0 : config.messageService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.messageService, baseUrl),
|
|
707
|
+
catalogService: (_GLOBAL_ENV$catalogSe = GLOBAL_ENV.catalogService) !== null && _GLOBAL_ENV$catalogSe !== void 0 ? _GLOBAL_ENV$catalogSe : getUrl('catalog', config === null || config === void 0 ? void 0 : config.catalogService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.catalogService, baseUrl),
|
|
708
|
+
supportService: (_GLOBAL_ENV$supportSe = GLOBAL_ENV.supportService) !== null && _GLOBAL_ENV$supportSe !== void 0 ? _GLOBAL_ENV$supportSe : getUrl('support', config === null || config === void 0 ? void 0 : config.supportService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.supportService, baseUrl),
|
|
709
|
+
basketService: (_GLOBAL_ENV$basketSer = GLOBAL_ENV.basketService) !== null && _GLOBAL_ENV$basketSer !== void 0 ? _GLOBAL_ENV$basketSer : getUrl('basket', config === null || config === void 0 ? void 0 : config.basketService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.basketService, baseUrl),
|
|
710
|
+
mediaService: (_GLOBAL_ENV$mediaServ = GLOBAL_ENV.mediaService) !== null && _GLOBAL_ENV$mediaServ !== void 0 ? _GLOBAL_ENV$mediaServ : getUrl('media', config === null || config === void 0 ? void 0 : config.mediaService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.mediaService, baseUrl),
|
|
711
|
+
constructorService: (_GLOBAL_ENV$construct = GLOBAL_ENV.constructorService) !== null && _GLOBAL_ENV$construct !== void 0 ? _GLOBAL_ENV$construct : getUrl('constructor', config === null || config === void 0 ? void 0 : config.constructorService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.constructorService, baseUrl),
|
|
712
|
+
reportService: (_GLOBAL_ENV$reportSer = GLOBAL_ENV.reportService) !== null && _GLOBAL_ENV$reportSer !== void 0 ? _GLOBAL_ENV$reportSer : getUrl('report', config === null || config === void 0 ? void 0 : config.reportService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.reportService, baseUrl),
|
|
713
|
+
clientArticleService: (_GLOBAL_ENV$clientArt = GLOBAL_ENV.clientArticleService) !== null && _GLOBAL_ENV$clientArt !== void 0 ? _GLOBAL_ENV$clientArt : getUrl('pfister-article', config === null || config === void 0 ? void 0 : config.clientArticleService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.clientArticleService, baseUrl),
|
|
714
|
+
idmService: (_GLOBAL_ENV$idmServic = GLOBAL_ENV.idmService) !== null && _GLOBAL_ENV$idmServic !== void 0 ? _GLOBAL_ENV$idmServic : getUrl('idm', config === null || config === void 0 ? void 0 : config.idmService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.idmService, baseUrl),
|
|
715
|
+
enricherService: (_GLOBAL_ENV$enricherS = GLOBAL_ENV.enricherService) !== null && _GLOBAL_ENV$enricherS !== void 0 ? _GLOBAL_ENV$enricherS : getUrl('enricher', config === null || config === void 0 ? void 0 : config.enricherService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.enricherService, baseUrl),
|
|
716
|
+
baseUrl: baseUrl,
|
|
717
|
+
baseSirvUrls: config === null || config === void 0 ? void 0 : config.baseSirvUrls,
|
|
718
|
+
baseCdnUrl: getUrl('https://cdn.diva-portal.com', config === null || config === void 0 ? void 0 : config.baseCdnUrl, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.baseCdnUrl),
|
|
719
|
+
host3d: getUrl('https://diva3dhost.diva-portal.com/diva3d/diva3dhost2', config === null || config === void 0 ? void 0 : config.host3d, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.host3d),
|
|
720
|
+
diva3darchive: getUrl('https://diva3dhost.diva-portal.com/diva3d/diva3darchive', config === null || config === void 0 ? void 0 : config.diva3darchive, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.diva3darchive),
|
|
721
|
+
useDebugUrl: (_config$useDebugUrl = config === null || config === void 0 ? void 0 : config.useDebugUrl) !== null && _config$useDebugUrl !== void 0 ? _config$useDebugUrl : false,
|
|
722
|
+
arViewerBaseUrl: config === null || config === void 0 ? void 0 : config.arViewerBaseUrl,
|
|
723
|
+
api2: {
|
|
724
|
+
"default": getUrl('https://retail.diva-portal.de/api2_retail/api.aspx', (_ref2 = (_organization$api2Loc = organization === null || organization === void 0 || (_organization$api2Loc2 = organization.api2Location) === null || _organization$api2Loc2 === void 0 || (_organization$api2Loc2 = _organization$api2Loc2.vk) === null || _organization$api2Loc2 === void 0 ? void 0 : _organization$api2Loc2.url) !== null && _organization$api2Loc !== void 0 ? _organization$api2Loc : config === null || config === void 0 ? void 0 : config.api2) !== null && _ref2 !== void 0 ? _ref2 : organization === null || organization === void 0 ? void 0 : organization.originEnvironmentUrl, //deprecated
|
|
725
|
+
defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.api2),
|
|
726
|
+
ek: getUrl('https://retail.diva-portal.de/api2_retail/api.aspx', (_ref3 = (_ref4 = (_organization$api2Loc3 = organization === null || organization === void 0 || (_organization$api2Loc4 = organization.api2Location) === null || _organization$api2Loc4 === void 0 || (_organization$api2Loc4 = _organization$api2Loc4.ek) === null || _organization$api2Loc4 === void 0 ? void 0 : _organization$api2Loc4.url) !== null && _organization$api2Loc3 !== void 0 ? _organization$api2Loc3 : organization === null || organization === void 0 || (_organization$api2Loc5 = organization.api2Location) === null || _organization$api2Loc5 === void 0 || (_organization$api2Loc5 = _organization$api2Loc5.vk) === null || _organization$api2Loc5 === void 0 ? void 0 : _organization$api2Loc5.url) !== null && _ref4 !== void 0 ? _ref4 : config === null || config === void 0 ? void 0 : config.api2) !== null && _ref3 !== void 0 ? _ref3 : organization === null || organization === void 0 ? void 0 : organization.originEnvironmentUrl, //deprecated
|
|
727
|
+
defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.api2),
|
|
728
|
+
web: getUrl('https://retail.diva-portal.de/api2_retail/api.aspx', (_ref5 = (_ref6 = (_organization$api2Loc6 = organization === null || organization === void 0 || (_organization$api2Loc7 = organization.api2Location) === null || _organization$api2Loc7 === void 0 || (_organization$api2Loc7 = _organization$api2Loc7.web) === null || _organization$api2Loc7 === void 0 ? void 0 : _organization$api2Loc7.url) !== null && _organization$api2Loc6 !== void 0 ? _organization$api2Loc6 : organization === null || organization === void 0 || (_organization$api2Loc8 = organization.api2Location) === null || _organization$api2Loc8 === void 0 || (_organization$api2Loc8 = _organization$api2Loc8.vk) === null || _organization$api2Loc8 === void 0 ? void 0 : _organization$api2Loc8.url) !== null && _ref6 !== void 0 ? _ref6 : config === null || config === void 0 ? void 0 : config.api2) !== null && _ref5 !== void 0 ? _ref5 : organization === null || organization === void 0 ? void 0 : organization.originEnvironmentUrl, //deprecated
|
|
729
|
+
defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.api2)
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
return c;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
var defaultTheme = {
|
|
736
|
+
palette: {
|
|
737
|
+
primary: {
|
|
738
|
+
main: '#713434',
|
|
739
|
+
light: '#e4b9b8',
|
|
740
|
+
dark: '#42090e',
|
|
741
|
+
contrastText: '#fff'
|
|
742
|
+
},
|
|
743
|
+
secondary: {
|
|
744
|
+
main: '#474747',
|
|
745
|
+
light: '##c3c3c3',
|
|
746
|
+
dark: '#252525',
|
|
747
|
+
contrastText: '#fff'
|
|
748
|
+
},
|
|
749
|
+
text: {
|
|
750
|
+
primary: 'rgba(0, 0, 0, 0.87)',
|
|
751
|
+
secondary: 'rgba(0, 0, 0, 0.54)'
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
typography: {
|
|
755
|
+
fontFamily: 'Roboto'
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
function ownKeys$f(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
760
|
+
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
698
761
|
var LOG$d = getLogger('Framework', 'ConfigurationStore');
|
|
699
762
|
var ConfigurationStore = /*#__PURE__*/function () {
|
|
700
763
|
function ConfigurationStore(root, identifier, defaultApiConfig, domain) {
|
|
@@ -773,29 +836,29 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
773
836
|
}, {
|
|
774
837
|
key: "theme",
|
|
775
838
|
get: function get() {
|
|
776
|
-
var _this$_configuration8, _theme$palette, _theme$palette2, _theme$palette3, _theme$palette4, _theme$palette5, _theme$palette6, _theme$palette7, _theme$palette8, _theme$palette9, _theme$palette10, _theme$palette11, _theme$palette12, _theme$palette13, _theme$palette14, _theme$typography;
|
|
839
|
+
var _this$_configuration8, _theme$palette$primar, _theme$palette, _theme$palette$primar2, _theme$palette2, _theme$palette$primar3, _theme$palette3, _theme$palette$primar4, _theme$palette4, _ref, _theme$palette$second, _theme$palette5, _theme$palette6, _ref2, _theme$palette$second2, _theme$palette7, _theme$palette8, _ref3, _theme$palette$second3, _theme$palette9, _theme$palette10, _ref4, _theme$palette$second4, _theme$palette11, _theme$palette12, _theme$palette$text$p, _theme$palette13, _theme$palette$text$s, _theme$palette14, _theme$typography$fon, _theme$typography;
|
|
777
840
|
var theme = (_this$_configuration8 = this._configuration) === null || _this$_configuration8 === void 0 ? void 0 : _this$_configuration8.theme;
|
|
778
841
|
return {
|
|
779
842
|
palette: {
|
|
780
843
|
primary: {
|
|
781
|
-
main: (theme === null || theme === void 0 || (_theme$palette = theme.palette) === null || _theme$palette === void 0 || (_theme$palette = _theme$palette.primary) === null || _theme$palette === void 0 ? void 0 : _theme$palette.main)
|
|
782
|
-
light: (theme === null || theme === void 0 || (_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 || (_theme$palette2 = _theme$palette2.primary) === null || _theme$palette2 === void 0 ? void 0 : _theme$palette2.light)
|
|
783
|
-
dark: (theme === null || theme === void 0 || (_theme$palette3 = theme.palette) === null || _theme$palette3 === void 0 || (_theme$palette3 = _theme$palette3.primary) === null || _theme$palette3 === void 0 ? void 0 : _theme$palette3.dark)
|
|
784
|
-
contrastText: (theme === null || theme === void 0 || (_theme$palette4 = theme.palette) === null || _theme$palette4 === void 0 || (_theme$palette4 = _theme$palette4.primary) === null || _theme$palette4 === void 0 ? void 0 : _theme$palette4.contrastText)
|
|
844
|
+
main: (_theme$palette$primar = theme === null || theme === void 0 || (_theme$palette = theme.palette) === null || _theme$palette === void 0 || (_theme$palette = _theme$palette.primary) === null || _theme$palette === void 0 ? void 0 : _theme$palette.main) !== null && _theme$palette$primar !== void 0 ? _theme$palette$primar : defaultTheme.palette.primary.main,
|
|
845
|
+
light: (_theme$palette$primar2 = theme === null || theme === void 0 || (_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 || (_theme$palette2 = _theme$palette2.primary) === null || _theme$palette2 === void 0 ? void 0 : _theme$palette2.light) !== null && _theme$palette$primar2 !== void 0 ? _theme$palette$primar2 : defaultTheme.palette.primary.light,
|
|
846
|
+
dark: (_theme$palette$primar3 = theme === null || theme === void 0 || (_theme$palette3 = theme.palette) === null || _theme$palette3 === void 0 || (_theme$palette3 = _theme$palette3.primary) === null || _theme$palette3 === void 0 ? void 0 : _theme$palette3.dark) !== null && _theme$palette$primar3 !== void 0 ? _theme$palette$primar3 : defaultTheme.palette.primary.dark,
|
|
847
|
+
contrastText: (_theme$palette$primar4 = theme === null || theme === void 0 || (_theme$palette4 = theme.palette) === null || _theme$palette4 === void 0 || (_theme$palette4 = _theme$palette4.primary) === null || _theme$palette4 === void 0 ? void 0 : _theme$palette4.contrastText) !== null && _theme$palette$primar4 !== void 0 ? _theme$palette$primar4 : defaultTheme.palette.primary.contrastText
|
|
785
848
|
},
|
|
786
849
|
secondary: {
|
|
787
|
-
main: (theme === null || theme === void 0 || (_theme$palette5 = theme.palette) === null || _theme$palette5 === void 0 || (_theme$palette5 = _theme$palette5.secondary) === null || _theme$palette5 === void 0 ? void 0 : _theme$palette5.main)
|
|
788
|
-
light: (theme === null || theme === void 0 || (_theme$palette7 = theme.palette) === null || _theme$palette7 === void 0 || (_theme$palette7 = _theme$palette7.secondary) === null || _theme$palette7 === void 0 ? void 0 : _theme$palette7.light)
|
|
789
|
-
dark: (theme === null || theme === void 0 || (_theme$palette9 = theme.palette) === null || _theme$palette9 === void 0 || (_theme$palette9 = _theme$palette9.secondary) === null || _theme$palette9 === void 0 ? void 0 : _theme$palette9.dark)
|
|
790
|
-
contrastText: (theme === null || theme === void 0 || (_theme$palette11 = theme.palette) === null || _theme$palette11 === void 0 || (_theme$palette11 = _theme$palette11.secondary) === null || _theme$palette11 === void 0 ? void 0 : _theme$palette11.contrastText)
|
|
850
|
+
main: (_ref = (_theme$palette$second = theme === null || theme === void 0 || (_theme$palette5 = theme.palette) === null || _theme$palette5 === void 0 || (_theme$palette5 = _theme$palette5.secondary) === null || _theme$palette5 === void 0 ? void 0 : _theme$palette5.main) !== null && _theme$palette$second !== void 0 ? _theme$palette$second : theme === null || theme === void 0 || (_theme$palette6 = theme.palette) === null || _theme$palette6 === void 0 || (_theme$palette6 = _theme$palette6.primary) === null || _theme$palette6 === void 0 ? void 0 : _theme$palette6.main) !== null && _ref !== void 0 ? _ref : defaultTheme.palette.secondary.main,
|
|
851
|
+
light: (_ref2 = (_theme$palette$second2 = theme === null || theme === void 0 || (_theme$palette7 = theme.palette) === null || _theme$palette7 === void 0 || (_theme$palette7 = _theme$palette7.secondary) === null || _theme$palette7 === void 0 ? void 0 : _theme$palette7.light) !== null && _theme$palette$second2 !== void 0 ? _theme$palette$second2 : theme === null || theme === void 0 || (_theme$palette8 = theme.palette) === null || _theme$palette8 === void 0 || (_theme$palette8 = _theme$palette8.primary) === null || _theme$palette8 === void 0 ? void 0 : _theme$palette8.light) !== null && _ref2 !== void 0 ? _ref2 : defaultTheme.palette.secondary.light,
|
|
852
|
+
dark: (_ref3 = (_theme$palette$second3 = theme === null || theme === void 0 || (_theme$palette9 = theme.palette) === null || _theme$palette9 === void 0 || (_theme$palette9 = _theme$palette9.secondary) === null || _theme$palette9 === void 0 ? void 0 : _theme$palette9.dark) !== null && _theme$palette$second3 !== void 0 ? _theme$palette$second3 : theme === null || theme === void 0 || (_theme$palette10 = theme.palette) === null || _theme$palette10 === void 0 || (_theme$palette10 = _theme$palette10.primary) === null || _theme$palette10 === void 0 ? void 0 : _theme$palette10.dark) !== null && _ref3 !== void 0 ? _ref3 : defaultTheme.palette.secondary.dark,
|
|
853
|
+
contrastText: (_ref4 = (_theme$palette$second4 = theme === null || theme === void 0 || (_theme$palette11 = theme.palette) === null || _theme$palette11 === void 0 || (_theme$palette11 = _theme$palette11.secondary) === null || _theme$palette11 === void 0 ? void 0 : _theme$palette11.contrastText) !== null && _theme$palette$second4 !== void 0 ? _theme$palette$second4 : theme === null || theme === void 0 || (_theme$palette12 = theme.palette) === null || _theme$palette12 === void 0 || (_theme$palette12 = _theme$palette12.primary) === null || _theme$palette12 === void 0 ? void 0 : _theme$palette12.contrastText) !== null && _ref4 !== void 0 ? _ref4 : defaultTheme.palette.secondary.contrastText
|
|
791
854
|
},
|
|
792
855
|
text: {
|
|
793
|
-
primary: (theme === null || theme === void 0 || (_theme$palette13 = theme.palette) === null || _theme$palette13 === void 0 || (_theme$palette13 = _theme$palette13.text) === null || _theme$palette13 === void 0 ? void 0 : _theme$palette13.primary)
|
|
794
|
-
secondary: (theme === null || theme === void 0 || (_theme$palette14 = theme.palette) === null || _theme$palette14 === void 0 || (_theme$palette14 = _theme$palette14.text) === null || _theme$palette14 === void 0 ? void 0 : _theme$palette14.secondary)
|
|
856
|
+
primary: (_theme$palette$text$p = theme === null || theme === void 0 || (_theme$palette13 = theme.palette) === null || _theme$palette13 === void 0 || (_theme$palette13 = _theme$palette13.text) === null || _theme$palette13 === void 0 ? void 0 : _theme$palette13.primary) !== null && _theme$palette$text$p !== void 0 ? _theme$palette$text$p : defaultTheme.palette.text.primary,
|
|
857
|
+
secondary: (_theme$palette$text$s = theme === null || theme === void 0 || (_theme$palette14 = theme.palette) === null || _theme$palette14 === void 0 || (_theme$palette14 = _theme$palette14.text) === null || _theme$palette14 === void 0 ? void 0 : _theme$palette14.secondary) !== null && _theme$palette$text$s !== void 0 ? _theme$palette$text$s : defaultTheme.palette.text.secondary
|
|
795
858
|
}
|
|
796
859
|
},
|
|
797
860
|
typography: {
|
|
798
|
-
fontFamily: (theme === null || theme === void 0 || (_theme$typography = theme.typography) === null || _theme$typography === void 0 ? void 0 : _theme$typography.fontFamily)
|
|
861
|
+
fontFamily: (_theme$typography$fon = theme === null || theme === void 0 || (_theme$typography = theme.typography) === null || _theme$typography === void 0 ? void 0 : _theme$typography.fontFamily) !== null && _theme$typography$fon !== void 0 ? _theme$typography$fon : defaultTheme.typography.fontFamily
|
|
799
862
|
}
|
|
800
863
|
};
|
|
801
864
|
}
|
|
@@ -852,7 +915,7 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
852
915
|
key: "authentication",
|
|
853
916
|
get: function get() {
|
|
854
917
|
var _this$_configuration$, _this$_configuration32, _this$_configuration33, _this$_configuration34, _this$_configuration35, _this$_configuration36, _this$_configuration37, _this$_configuration38, _this$_configuration39, _this$_configuration40, _this$_configuration$2, _this$_configuration41;
|
|
855
|
-
return _objectSpread$
|
|
918
|
+
return _objectSpread$f(_objectSpread$f({}, (_this$_configuration$ = (_this$_configuration32 = this._configuration) === null || _this$_configuration32 === void 0 ? void 0 : _this$_configuration32.authentication) !== null && _this$_configuration$ !== void 0 ? _this$_configuration$ : {}), {}, {
|
|
856
919
|
loginMethods: {
|
|
857
920
|
google: (_this$_configuration33 = this._configuration) !== null && _this$_configuration33 !== void 0 && (_this$_configuration33 = _this$_configuration33.authentication) !== null && _this$_configuration33 !== void 0 && _this$_configuration33.loginMethods ? (_this$_configuration34 = this._configuration) === null || _this$_configuration34 === void 0 || (_this$_configuration34 = _this$_configuration34.authentication) === null || _this$_configuration34 === void 0 ? void 0 : _this$_configuration34.loginMethods.google : true,
|
|
858
921
|
microsoft: (_this$_configuration35 = this._configuration) !== null && _this$_configuration35 !== void 0 && (_this$_configuration35 = _this$_configuration35.authentication) !== null && _this$_configuration35 !== void 0 && _this$_configuration35.loginMethods ? (_this$_configuration36 = this._configuration) === null || _this$_configuration36 === void 0 || (_this$_configuration36 = _this$_configuration36.authentication) === null || _this$_configuration36 === void 0 ? void 0 : _this$_configuration36.loginMethods.microsoft : true,
|
|
@@ -913,77 +976,45 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
913
976
|
}, {
|
|
914
977
|
key: "apiConfig",
|
|
915
978
|
get: function get() {
|
|
916
|
-
var
|
|
917
|
-
|
|
918
|
-
var GLOBAL_ENV = (_DIVA_GLOBAL_ENV = window.DIVA_GLOBAL_ENV) !== null && _DIVA_GLOBAL_ENV !== void 0 ? _DIVA_GLOBAL_ENV : {};
|
|
919
|
-
var c = {
|
|
920
|
-
analyticsService: (_GLOBAL_ENV$analytics = GLOBAL_ENV.analyticsService) !== null && _GLOBAL_ENV$analytics !== void 0 ? _GLOBAL_ENV$analytics : getUrl('analytics', (_this$_configuration50 = this._configuration) === null || _this$_configuration50 === void 0 || (_this$_configuration50 = _this$_configuration50.api) === null || _this$_configuration50 === void 0 ? void 0 : _this$_configuration50.analyticsService, (_this$defaultApiConfi5 = this.defaultApiConfig) === null || _this$defaultApiConfi5 === void 0 ? void 0 : _this$defaultApiConfi5.analyticsService, baseUrl),
|
|
921
|
-
authService: (_GLOBAL_ENV$authServi = GLOBAL_ENV.authService) !== null && _GLOBAL_ENV$authServi !== void 0 ? _GLOBAL_ENV$authServi : getUrl('auth', (_this$_configuration51 = this._configuration) === null || _this$_configuration51 === void 0 || (_this$_configuration51 = _this$_configuration51.api) === null || _this$_configuration51 === void 0 ? void 0 : _this$_configuration51.authService, (_this$defaultApiConfi6 = this.defaultApiConfig) === null || _this$defaultApiConfi6 === void 0 ? void 0 : _this$defaultApiConfi6.authService, baseUrl),
|
|
922
|
-
adminService: (_GLOBAL_ENV$adminServ = GLOBAL_ENV.adminService) !== null && _GLOBAL_ENV$adminServ !== void 0 ? _GLOBAL_ENV$adminServ : getUrl('admin', (_this$_configuration52 = this._configuration) === null || _this$_configuration52 === void 0 || (_this$_configuration52 = _this$_configuration52.api) === null || _this$_configuration52 === void 0 ? void 0 : _this$_configuration52.adminService, (_this$defaultApiConfi7 = this.defaultApiConfig) === null || _this$defaultApiConfi7 === void 0 ? void 0 : _this$defaultApiConfi7.adminService, baseUrl),
|
|
923
|
-
messageService: (_GLOBAL_ENV$messageSe = GLOBAL_ENV.messageService) !== null && _GLOBAL_ENV$messageSe !== void 0 ? _GLOBAL_ENV$messageSe : getUrl('messages', (_this$_configuration53 = this._configuration) === null || _this$_configuration53 === void 0 || (_this$_configuration53 = _this$_configuration53.api) === null || _this$_configuration53 === void 0 ? void 0 : _this$_configuration53.messageService, (_this$defaultApiConfi8 = this.defaultApiConfig) === null || _this$defaultApiConfi8 === void 0 ? void 0 : _this$defaultApiConfi8.messageService, baseUrl),
|
|
924
|
-
catalogService: (_GLOBAL_ENV$catalogSe = GLOBAL_ENV.catalogService) !== null && _GLOBAL_ENV$catalogSe !== void 0 ? _GLOBAL_ENV$catalogSe : getUrl('catalog', (_this$_configuration54 = this._configuration) === null || _this$_configuration54 === void 0 || (_this$_configuration54 = _this$_configuration54.api) === null || _this$_configuration54 === void 0 ? void 0 : _this$_configuration54.catalogService, (_this$defaultApiConfi9 = this.defaultApiConfig) === null || _this$defaultApiConfi9 === void 0 ? void 0 : _this$defaultApiConfi9.catalogService, baseUrl),
|
|
925
|
-
supportService: (_GLOBAL_ENV$supportSe = GLOBAL_ENV.supportService) !== null && _GLOBAL_ENV$supportSe !== void 0 ? _GLOBAL_ENV$supportSe : getUrl('support', (_this$_configuration55 = this._configuration) === null || _this$_configuration55 === void 0 || (_this$_configuration55 = _this$_configuration55.api) === null || _this$_configuration55 === void 0 ? void 0 : _this$_configuration55.supportService, (_this$defaultApiConfi10 = this.defaultApiConfig) === null || _this$defaultApiConfi10 === void 0 ? void 0 : _this$defaultApiConfi10.supportService, baseUrl),
|
|
926
|
-
basketService: (_GLOBAL_ENV$basketSer = GLOBAL_ENV.basketService) !== null && _GLOBAL_ENV$basketSer !== void 0 ? _GLOBAL_ENV$basketSer : getUrl('basket', (_this$_configuration56 = this._configuration) === null || _this$_configuration56 === void 0 || (_this$_configuration56 = _this$_configuration56.api) === null || _this$_configuration56 === void 0 ? void 0 : _this$_configuration56.basketService, (_this$defaultApiConfi11 = this.defaultApiConfig) === null || _this$defaultApiConfi11 === void 0 ? void 0 : _this$defaultApiConfi11.basketService, baseUrl),
|
|
927
|
-
mediaService: (_GLOBAL_ENV$mediaServ = GLOBAL_ENV.mediaService) !== null && _GLOBAL_ENV$mediaServ !== void 0 ? _GLOBAL_ENV$mediaServ : getUrl('media', (_this$_configuration57 = this._configuration) === null || _this$_configuration57 === void 0 || (_this$_configuration57 = _this$_configuration57.api) === null || _this$_configuration57 === void 0 ? void 0 : _this$_configuration57.mediaService, (_this$defaultApiConfi12 = this.defaultApiConfig) === null || _this$defaultApiConfi12 === void 0 ? void 0 : _this$defaultApiConfi12.mediaService, baseUrl),
|
|
928
|
-
constructorService: (_GLOBAL_ENV$construct = GLOBAL_ENV.constructorService) !== null && _GLOBAL_ENV$construct !== void 0 ? _GLOBAL_ENV$construct : getUrl('constructor', (_this$_configuration58 = this._configuration) === null || _this$_configuration58 === void 0 || (_this$_configuration58 = _this$_configuration58.api) === null || _this$_configuration58 === void 0 ? void 0 : _this$_configuration58.constructorService, (_this$defaultApiConfi13 = this.defaultApiConfig) === null || _this$defaultApiConfi13 === void 0 ? void 0 : _this$defaultApiConfi13.constructorService, baseUrl),
|
|
929
|
-
reportService: (_GLOBAL_ENV$reportSer = GLOBAL_ENV.reportService) !== null && _GLOBAL_ENV$reportSer !== void 0 ? _GLOBAL_ENV$reportSer : getUrl('report', (_this$_configuration59 = this._configuration) === null || _this$_configuration59 === void 0 || (_this$_configuration59 = _this$_configuration59.api) === null || _this$_configuration59 === void 0 ? void 0 : _this$_configuration59.reportService, (_this$defaultApiConfi14 = this.defaultApiConfig) === null || _this$defaultApiConfi14 === void 0 ? void 0 : _this$defaultApiConfi14.reportService, baseUrl),
|
|
930
|
-
clientArticleService: (_GLOBAL_ENV$clientArt = GLOBAL_ENV.clientArticleService) !== null && _GLOBAL_ENV$clientArt !== void 0 ? _GLOBAL_ENV$clientArt : getUrl('pfister-article', (_this$_configuration60 = this._configuration) === null || _this$_configuration60 === void 0 || (_this$_configuration60 = _this$_configuration60.api) === null || _this$_configuration60 === void 0 ? void 0 : _this$_configuration60.clientArticleService, (_this$defaultApiConfi15 = this.defaultApiConfig) === null || _this$defaultApiConfi15 === void 0 ? void 0 : _this$defaultApiConfi15.clientArticleService, baseUrl),
|
|
931
|
-
idmService: (_GLOBAL_ENV$idmServic = GLOBAL_ENV.idmService) !== null && _GLOBAL_ENV$idmServic !== void 0 ? _GLOBAL_ENV$idmServic : getUrl('idm', (_this$_configuration61 = this._configuration) === null || _this$_configuration61 === void 0 || (_this$_configuration61 = _this$_configuration61.api) === null || _this$_configuration61 === void 0 ? void 0 : _this$_configuration61.idmService, (_this$defaultApiConfi16 = this.defaultApiConfig) === null || _this$defaultApiConfi16 === void 0 ? void 0 : _this$defaultApiConfi16.idmService, baseUrl),
|
|
932
|
-
enricherService: (_GLOBAL_ENV$enricherS = GLOBAL_ENV.enricherService) !== null && _GLOBAL_ENV$enricherS !== void 0 ? _GLOBAL_ENV$enricherS : getUrl('enricher', (_this$_configuration62 = this._configuration) === null || _this$_configuration62 === void 0 || (_this$_configuration62 = _this$_configuration62.api) === null || _this$_configuration62 === void 0 ? void 0 : _this$_configuration62.enricherService, (_this$defaultApiConfi17 = this.defaultApiConfig) === null || _this$defaultApiConfi17 === void 0 ? void 0 : _this$defaultApiConfi17.enricherService, baseUrl),
|
|
933
|
-
baseUrl: baseUrl,
|
|
934
|
-
baseCdnUrl: getUrl('https://cdn.diva-portal.com', (_this$_configuration63 = this._configuration) === null || _this$_configuration63 === void 0 || (_this$_configuration63 = _this$_configuration63.api) === null || _this$_configuration63 === void 0 ? void 0 : _this$_configuration63.baseCdnUrl, (_this$defaultApiConfi18 = this.defaultApiConfig) === null || _this$defaultApiConfi18 === void 0 ? void 0 : _this$defaultApiConfi18.baseCdnUrl),
|
|
935
|
-
baseSirvUrls: (_this$_configuration64 = this._configuration) === null || _this$_configuration64 === void 0 || (_this$_configuration64 = _this$_configuration64.api) === null || _this$_configuration64 === void 0 ? void 0 : _this$_configuration64.baseSirvUrls,
|
|
936
|
-
host3d: getUrl('https://diva3dhost.diva-portal.com/diva3d/diva3dhost2', (_this$_configuration65 = this._configuration) === null || _this$_configuration65 === void 0 || (_this$_configuration65 = _this$_configuration65.api) === null || _this$_configuration65 === void 0 ? void 0 : _this$_configuration65.host3d, (_this$defaultApiConfi19 = this.defaultApiConfig) === null || _this$defaultApiConfi19 === void 0 ? void 0 : _this$defaultApiConfi19.host3d),
|
|
937
|
-
diva3darchive: getUrl('https://diva3dhost.diva-portal.com/diva3d/diva3darchive', (_this$_configuration66 = this._configuration) === null || _this$_configuration66 === void 0 || (_this$_configuration66 = _this$_configuration66.api) === null || _this$_configuration66 === void 0 ? void 0 : _this$_configuration66.diva3darchive, (_this$defaultApiConfi20 = this.defaultApiConfig) === null || _this$defaultApiConfi20 === void 0 ? void 0 : _this$defaultApiConfi20.diva3darchive),
|
|
938
|
-
useDebugUrl: (_this$_configuration$4 = (_this$_configuration67 = this._configuration) === null || _this$_configuration67 === void 0 || (_this$_configuration67 = _this$_configuration67.api) === null || _this$_configuration67 === void 0 ? void 0 : _this$_configuration67.useDebugUrl) !== null && _this$_configuration$4 !== void 0 ? _this$_configuration$4 : false,
|
|
939
|
-
arViewerBaseUrl: (_this$_configuration68 = this._configuration) === null || _this$_configuration68 === void 0 || (_this$_configuration68 = _this$_configuration68.api) === null || _this$_configuration68 === void 0 ? void 0 : _this$_configuration68.arViewerBaseUrl,
|
|
940
|
-
api2: {
|
|
941
|
-
"default": getUrl('https://retail.diva-portal.de/api2_retail/api.aspx', (_ref2 = (_this$root$dataStore$ = (_this$root$dataStore$2 = this.root.dataStore.organization) === null || _this$root$dataStore$2 === void 0 || (_this$root$dataStore$2 = _this$root$dataStore$2.api2Location) === null || _this$root$dataStore$2 === void 0 || (_this$root$dataStore$2 = _this$root$dataStore$2.vk) === null || _this$root$dataStore$2 === void 0 ? void 0 : _this$root$dataStore$2.url) !== null && _this$root$dataStore$ !== void 0 ? _this$root$dataStore$ : (_this$_configuration69 = this._configuration) === null || _this$_configuration69 === void 0 || (_this$_configuration69 = _this$_configuration69.api) === null || _this$_configuration69 === void 0 ? void 0 : _this$_configuration69.api2) !== null && _ref2 !== void 0 ? _ref2 : (_this$root$dataStore$3 = this.root.dataStore.organization) === null || _this$root$dataStore$3 === void 0 ? void 0 : _this$root$dataStore$3.originEnvironmentUrl, //deprecated
|
|
942
|
-
(_this$defaultApiConfi21 = this.defaultApiConfig) === null || _this$defaultApiConfi21 === void 0 ? void 0 : _this$defaultApiConfi21.api2),
|
|
943
|
-
ek: getUrl('https://retail.diva-portal.de/api2_retail/api.aspx', (_ref3 = (_ref4 = (_this$root$dataStore$4 = (_this$root$dataStore$5 = this.root.dataStore.organization) === null || _this$root$dataStore$5 === void 0 || (_this$root$dataStore$5 = _this$root$dataStore$5.api2Location) === null || _this$root$dataStore$5 === void 0 || (_this$root$dataStore$5 = _this$root$dataStore$5.ek) === null || _this$root$dataStore$5 === void 0 ? void 0 : _this$root$dataStore$5.url) !== null && _this$root$dataStore$4 !== void 0 ? _this$root$dataStore$4 : (_this$root$dataStore$6 = this.root.dataStore.organization) === null || _this$root$dataStore$6 === void 0 || (_this$root$dataStore$6 = _this$root$dataStore$6.api2Location) === null || _this$root$dataStore$6 === void 0 || (_this$root$dataStore$6 = _this$root$dataStore$6.vk) === null || _this$root$dataStore$6 === void 0 ? void 0 : _this$root$dataStore$6.url) !== null && _ref4 !== void 0 ? _ref4 : (_this$_configuration70 = this._configuration) === null || _this$_configuration70 === void 0 || (_this$_configuration70 = _this$_configuration70.api) === null || _this$_configuration70 === void 0 ? void 0 : _this$_configuration70.api2) !== null && _ref3 !== void 0 ? _ref3 : (_this$root$dataStore$7 = this.root.dataStore.organization) === null || _this$root$dataStore$7 === void 0 ? void 0 : _this$root$dataStore$7.originEnvironmentUrl, //deprecated
|
|
944
|
-
(_this$defaultApiConfi22 = this.defaultApiConfig) === null || _this$defaultApiConfi22 === void 0 ? void 0 : _this$defaultApiConfi22.api2),
|
|
945
|
-
web: getUrl('https://retail.diva-portal.de/api2_retail/api.aspx', (_ref5 = (_ref6 = (_this$root$dataStore$8 = (_this$root$dataStore$9 = this.root.dataStore.organization) === null || _this$root$dataStore$9 === void 0 || (_this$root$dataStore$9 = _this$root$dataStore$9.api2Location) === null || _this$root$dataStore$9 === void 0 || (_this$root$dataStore$9 = _this$root$dataStore$9.web) === null || _this$root$dataStore$9 === void 0 ? void 0 : _this$root$dataStore$9.url) !== null && _this$root$dataStore$8 !== void 0 ? _this$root$dataStore$8 : (_this$root$dataStore$10 = this.root.dataStore.organization) === null || _this$root$dataStore$10 === void 0 || (_this$root$dataStore$10 = _this$root$dataStore$10.api2Location) === null || _this$root$dataStore$10 === void 0 || (_this$root$dataStore$10 = _this$root$dataStore$10.vk) === null || _this$root$dataStore$10 === void 0 ? void 0 : _this$root$dataStore$10.url) !== null && _ref6 !== void 0 ? _ref6 : (_this$_configuration71 = this._configuration) === null || _this$_configuration71 === void 0 || (_this$_configuration71 = _this$_configuration71.api) === null || _this$_configuration71 === void 0 ? void 0 : _this$_configuration71.api2) !== null && _ref5 !== void 0 ? _ref5 : (_this$root$dataStore$11 = this.root.dataStore.organization) === null || _this$root$dataStore$11 === void 0 ? void 0 : _this$root$dataStore$11.originEnvironmentUrl, //deprecated
|
|
946
|
-
(_this$defaultApiConfi23 = this.defaultApiConfig) === null || _this$defaultApiConfi23 === void 0 ? void 0 : _this$defaultApiConfi23.api2)
|
|
947
|
-
}
|
|
948
|
-
};
|
|
949
|
-
return c;
|
|
979
|
+
var _this$_configuration49;
|
|
980
|
+
return parseApiConfig((_this$_configuration49 = this._configuration) === null || _this$_configuration49 === void 0 ? void 0 : _this$_configuration49.api, this.defaultApiConfig, this.root.dataStore.organization);
|
|
950
981
|
}
|
|
951
982
|
}, {
|
|
952
983
|
key: "applicationEnvironment",
|
|
953
984
|
get: function get() {
|
|
954
|
-
var _this$_configuration$
|
|
955
|
-
return (_this$_configuration$
|
|
985
|
+
var _this$_configuration$3, _this$_configuration50;
|
|
986
|
+
return (_this$_configuration$3 = (_this$_configuration50 = this._configuration) === null || _this$_configuration50 === void 0 ? void 0 : _this$_configuration50.applicationEnvironment) !== null && _this$_configuration$3 !== void 0 ? _this$_configuration$3 : 'SELLER';
|
|
956
987
|
}
|
|
957
988
|
}, {
|
|
958
989
|
key: "priceFormat",
|
|
959
990
|
get: function get() {
|
|
960
|
-
var _this$
|
|
961
|
-
if ((_this$
|
|
962
|
-
var _this$
|
|
963
|
-
return _objectSpread$
|
|
964
|
-
currency: (_this$root$dataStore$
|
|
991
|
+
var _this$_configuration51;
|
|
992
|
+
if ((_this$_configuration51 = this._configuration) !== null && _this$_configuration51 !== void 0 && _this$_configuration51.priceFormat) {
|
|
993
|
+
var _this$_configuration52, _this$root$dataStore$, _this$root$dataStore$2, _this$_configuration53;
|
|
994
|
+
return _objectSpread$f(_objectSpread$f({}, (_this$_configuration52 = this._configuration) === null || _this$_configuration52 === void 0 ? void 0 : _this$_configuration52.priceFormat), {}, {
|
|
995
|
+
currency: (_this$root$dataStore$ = (_this$root$dataStore$2 = this.root.dataStore.organization) === null || _this$root$dataStore$2 === void 0 ? void 0 : _this$root$dataStore$2.settings.defaultCurrency) !== null && _this$root$dataStore$ !== void 0 ? _this$root$dataStore$ : (_this$_configuration53 = this._configuration) === null || _this$_configuration53 === void 0 ? void 0 : _this$_configuration53.priceFormat.currency
|
|
965
996
|
});
|
|
966
997
|
} else {
|
|
967
|
-
var _this$root$dataStore$
|
|
968
|
-
return _objectSpread$
|
|
969
|
-
currency: (_this$root$dataStore$
|
|
998
|
+
var _this$root$dataStore$3, _this$root$dataStore$4;
|
|
999
|
+
return _objectSpread$f(_objectSpread$f({}, DivaUtils.defaultPriceFormat), {}, {
|
|
1000
|
+
currency: (_this$root$dataStore$3 = (_this$root$dataStore$4 = this.root.dataStore.organization) === null || _this$root$dataStore$4 === void 0 ? void 0 : _this$root$dataStore$4.settings.defaultCurrency) !== null && _this$root$dataStore$3 !== void 0 ? _this$root$dataStore$3 : DivaUtils.defaultPriceFormat.currency
|
|
970
1001
|
});
|
|
971
1002
|
}
|
|
972
1003
|
}
|
|
973
1004
|
}, {
|
|
974
1005
|
key: "countryCodesFile",
|
|
975
1006
|
get: function get() {
|
|
976
|
-
var _this$
|
|
977
|
-
return (_this$
|
|
1007
|
+
var _this$_configuration54;
|
|
1008
|
+
return (_this$_configuration54 = this._configuration) === null || _this$_configuration54 === void 0 ? void 0 : _this$_configuration54.countryCodesFile;
|
|
978
1009
|
}
|
|
979
1010
|
}, {
|
|
980
1011
|
key: "allowedOrganizationTypes",
|
|
981
1012
|
get: function get() {
|
|
982
|
-
var _this$
|
|
983
|
-
if (!((_this$
|
|
1013
|
+
var _this$_configuration55, _this$_configuration56, _this$_configuration57, _this$_configuration58;
|
|
1014
|
+
if (!((_this$_configuration55 = this._configuration) !== null && _this$_configuration55 !== void 0 && _this$_configuration55.allowedOrganizationTypes)) {
|
|
984
1015
|
return ['RETAILER'];
|
|
985
1016
|
}
|
|
986
|
-
return Array.isArray((_this$
|
|
1017
|
+
return Array.isArray((_this$_configuration56 = this._configuration) === null || _this$_configuration56 === void 0 ? void 0 : _this$_configuration56.allowedOrganizationTypes) ? (_this$_configuration57 = this._configuration) === null || _this$_configuration57 === void 0 ? void 0 : _this$_configuration57.allowedOrganizationTypes : [(_this$_configuration58 = this._configuration) === null || _this$_configuration58 === void 0 ? void 0 : _this$_configuration58.allowedOrganizationTypes];
|
|
987
1018
|
}
|
|
988
1019
|
}, {
|
|
989
1020
|
key: "resetConfigurationCache",
|
|
@@ -993,12 +1024,12 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
993
1024
|
}, {
|
|
994
1025
|
key: "fetchConfiguration",
|
|
995
1026
|
value: function () {
|
|
996
|
-
var _fetchConfiguration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(
|
|
997
|
-
var identifier, type, domain,
|
|
1027
|
+
var _fetchConfiguration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref5) {
|
|
1028
|
+
var identifier, type, domain, _ref5$organizationId, organizationId, configuration, types, settingsKeys, _i, _types, subType;
|
|
998
1029
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
999
1030
|
while (1) switch (_context.prev = _context.next) {
|
|
1000
1031
|
case 0:
|
|
1001
|
-
identifier =
|
|
1032
|
+
identifier = _ref5.identifier, type = _ref5.type, domain = _ref5.domain, _ref5$organizationId = _ref5.organizationId, organizationId = _ref5$organizationId === void 0 ? this.root.dataStore.organizationId : _ref5$organizationId;
|
|
1002
1033
|
LOG$d.debug("Fetching configuration for ".concat(type, " ").concat(identifier !== null && identifier !== void 0 ? identifier : '', " ").concat(domain !== null && domain !== void 0 ? domain : '', " ").concat(organizationId));
|
|
1003
1034
|
configuration = this.configurationCache.get(type + identifier + organizationId);
|
|
1004
1035
|
if (!configuration) {
|
|
@@ -1193,8 +1224,8 @@ function userAgentIsMobile() {
|
|
|
1193
1224
|
return !!md.mobile();
|
|
1194
1225
|
}
|
|
1195
1226
|
|
|
1196
|
-
function ownKeys$
|
|
1197
|
-
function _objectSpread$
|
|
1227
|
+
function ownKeys$e(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1228
|
+
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1198
1229
|
var LOG$c = getLogger('Framework', 'DataStore');
|
|
1199
1230
|
var DataStore = /*#__PURE__*/function () {
|
|
1200
1231
|
function DataStore(root) {
|
|
@@ -1223,8 +1254,8 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
1223
1254
|
key: "organization",
|
|
1224
1255
|
get: function get() {
|
|
1225
1256
|
var _settings$defaultCurr, _settings;
|
|
1226
|
-
return this._organization ? _objectSpread$
|
|
1227
|
-
settings: _objectSpread$
|
|
1257
|
+
return this._organization ? _objectSpread$e(_objectSpread$e({}, this._organization), {}, {
|
|
1258
|
+
settings: _objectSpread$e(_objectSpread$e({}, this._organization.settings), {}, {
|
|
1228
1259
|
defaultCurrency: (_settings$defaultCurr = (_settings = this._organization.settings) === null || _settings === void 0 ? void 0 : _settings.defaultCurrency) !== null && _settings$defaultCurr !== void 0 ? _settings$defaultCurr : '€'
|
|
1229
1260
|
})
|
|
1230
1261
|
}) : this._organization;
|
|
@@ -1265,7 +1296,7 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
1265
1296
|
return [].concat(_toConsumableArray(((_this$_organization$p = (_this$_organization$p2 = this._organization.parentOrganizations) === null || _this$_organization$p2 === void 0 ? void 0 : _this$_organization$p2.filter(function (org) {
|
|
1266
1297
|
return _this._parentOrganizations.includes(org._id);
|
|
1267
1298
|
})) !== null && _this$_organization$p !== void 0 ? _this$_organization$p : []).map(function (org) {
|
|
1268
|
-
return _objectSpread$
|
|
1299
|
+
return _objectSpread$e(_objectSpread$e({}, org), {}, {
|
|
1269
1300
|
type: org.type != 'SUPPLIER' ? org.parentType : undefined //supplier should not be accessed directly, only its children, so the simpliest solution is to remove here the type
|
|
1270
1301
|
});
|
|
1271
1302
|
}).reverse()), [{
|
|
@@ -1707,14 +1738,14 @@ var css_248z$6 = ".auth-y9j9- {\n height: 100%;\n width: 100%;\n display: fle
|
|
|
1707
1738
|
styleInject(css_248z$6);
|
|
1708
1739
|
|
|
1709
1740
|
var _excluded$6 = ["className", "disabled", "children"];
|
|
1710
|
-
function ownKeys$
|
|
1711
|
-
function _objectSpread$
|
|
1741
|
+
function ownKeys$d(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1742
|
+
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1712
1743
|
function Button (_ref) {
|
|
1713
1744
|
var className = _ref.className,
|
|
1714
1745
|
disabled = _ref.disabled,
|
|
1715
1746
|
children = _ref.children,
|
|
1716
1747
|
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
1717
|
-
return /*#__PURE__*/jsx("div", _objectSpread$
|
|
1748
|
+
return /*#__PURE__*/jsx("div", _objectSpread$d(_objectSpread$d({
|
|
1718
1749
|
className: classnames(authButton, className, disabled ? buttonDisabled : undefined)
|
|
1719
1750
|
}, props), {}, {
|
|
1720
1751
|
children: children
|
|
@@ -1722,13 +1753,13 @@ function Button (_ref) {
|
|
|
1722
1753
|
}
|
|
1723
1754
|
|
|
1724
1755
|
var _excluded$5 = ["className", "readOnly"];
|
|
1725
|
-
function ownKeys$
|
|
1726
|
-
function _objectSpread$
|
|
1756
|
+
function ownKeys$c(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1757
|
+
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1727
1758
|
var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1728
1759
|
var className = _ref.className,
|
|
1729
1760
|
readOnly = _ref.readOnly,
|
|
1730
1761
|
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
1731
|
-
return /*#__PURE__*/jsx("input", _objectSpread$
|
|
1762
|
+
return /*#__PURE__*/jsx("input", _objectSpread$c({
|
|
1732
1763
|
ref: ref,
|
|
1733
1764
|
className: classnames(input, readOnly ? readonly : undefined, className),
|
|
1734
1765
|
readOnly: readOnly
|
|
@@ -1845,15 +1876,198 @@ function Barrier (_ref) {
|
|
|
1845
1876
|
});
|
|
1846
1877
|
}
|
|
1847
1878
|
|
|
1848
|
-
|
|
1879
|
+
function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
1880
|
+
function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
1881
|
+
var LOG$b = getLogger('Framework', 'root');
|
|
1882
|
+
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
1883
|
+
function ErrorBoundary(props) {
|
|
1884
|
+
var _this;
|
|
1885
|
+
_classCallCheck(this, ErrorBoundary);
|
|
1886
|
+
_this = _callSuper$1(this, ErrorBoundary, [props]);
|
|
1887
|
+
_defineProperty(_this, "root", void 0);
|
|
1888
|
+
_this.root = props.root;
|
|
1889
|
+
return _this;
|
|
1890
|
+
}
|
|
1891
|
+
_inherits(ErrorBoundary, _React$Component);
|
|
1892
|
+
return _createClass(ErrorBoundary, [{
|
|
1893
|
+
key: "componentDidCatch",
|
|
1894
|
+
value: function componentDidCatch(error) {
|
|
1895
|
+
LOG$b.error(new DivaError('Error while rendring in Core', {
|
|
1896
|
+
cause: error,
|
|
1897
|
+
custom: {
|
|
1898
|
+
code: 'CORE_0000'
|
|
1899
|
+
}
|
|
1900
|
+
}));
|
|
1901
|
+
this.root.loadingAndErrorStore.setError(error.message);
|
|
1902
|
+
}
|
|
1903
|
+
}, {
|
|
1904
|
+
key: "render",
|
|
1905
|
+
value: function render() {
|
|
1906
|
+
return this.props.children;
|
|
1907
|
+
}
|
|
1908
|
+
}], [{
|
|
1909
|
+
key: "getDerivedStateFromError",
|
|
1910
|
+
value: function getDerivedStateFromError() {
|
|
1911
|
+
// just to prevent warning
|
|
1912
|
+
return {};
|
|
1913
|
+
}
|
|
1914
|
+
}]);
|
|
1915
|
+
}(React.Component);
|
|
1916
|
+
|
|
1917
|
+
function Fallback () {
|
|
1918
|
+
var _useDivaCoreContext = useDivaCoreContext(),
|
|
1919
|
+
loadingAndErrorStore = _useDivaCoreContext.loadingAndErrorStore;
|
|
1920
|
+
useEffect(function () {
|
|
1921
|
+
loadingAndErrorStore.toggleLoading('Fallback');
|
|
1922
|
+
return function () {
|
|
1923
|
+
return loadingAndErrorStore.toggleLoading('Fallback');
|
|
1924
|
+
};
|
|
1925
|
+
}, []);
|
|
1926
|
+
return /*#__PURE__*/jsx(Fragment, {});
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
var _excluded$4 = ["children"];
|
|
1930
|
+
function ownKeys$b(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1931
|
+
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1932
|
+
var LOG$a = getLogger('Framework', 'root');
|
|
1933
|
+
var DivaCore = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1934
|
+
var children = _ref.children,
|
|
1935
|
+
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
1936
|
+
useEffect(function () {
|
|
1937
|
+
LOG$a.successTransaction('UNTIL_RENDER');
|
|
1938
|
+
}, []);
|
|
1939
|
+
return /*#__PURE__*/jsx(DivaCoreProvider, _objectSpread$b(_objectSpread$b({}, props), {}, {
|
|
1940
|
+
ref: ref,
|
|
1941
|
+
children: /*#__PURE__*/jsx(ContentWrapper, {
|
|
1942
|
+
children: /*#__PURE__*/jsx(Fragment, {
|
|
1943
|
+
children: children !== null && children !== void 0 ? children : /*#__PURE__*/jsx(Content, {})
|
|
1944
|
+
})
|
|
1945
|
+
})
|
|
1946
|
+
}));
|
|
1947
|
+
});
|
|
1948
|
+
var ContentWrapper = observer(function (_ref2) {
|
|
1949
|
+
var children = _ref2.children;
|
|
1950
|
+
var context = useDivaCoreContext();
|
|
1951
|
+
var _context$contentStore = context.contentStore.containerDimensions,
|
|
1952
|
+
isMobile = _context$contentStore.isMobile,
|
|
1953
|
+
isPortrait = _context$contentStore.isPortrait;
|
|
1954
|
+
var ref = useCallback(function (node) {
|
|
1955
|
+
if (node !== null) {
|
|
1956
|
+
context.contentStore.setContainer(node);
|
|
1957
|
+
}
|
|
1958
|
+
}, []);
|
|
1959
|
+
return /*#__PURE__*/jsx(StylesProvider, {
|
|
1960
|
+
injectFirst: true,
|
|
1961
|
+
children: /*#__PURE__*/jsx("div", {
|
|
1962
|
+
ref: ref,
|
|
1963
|
+
id: "DivaCore",
|
|
1964
|
+
style: {
|
|
1965
|
+
position: 'relative',
|
|
1966
|
+
height: '100%',
|
|
1967
|
+
overflow: 'hidden'
|
|
1968
|
+
},
|
|
1969
|
+
className: (isPortrait ? ' portrait' : '') + (isMobile ? ' mobile' : '') + (isMobile && !isPortrait ? ' landscape' : ''),
|
|
1970
|
+
children: /*#__PURE__*/jsx(I18nextProvider, {
|
|
1971
|
+
i18n: instance,
|
|
1972
|
+
children: /*#__PURE__*/jsx(ErrorBoundary, {
|
|
1973
|
+
root: context,
|
|
1974
|
+
children: /*#__PURE__*/jsx(MuiThemeProvider, {
|
|
1975
|
+
theme: context.contentStore.materialUiTheme,
|
|
1976
|
+
children: /*#__PURE__*/jsx(Suspense, {
|
|
1977
|
+
fallback: /*#__PURE__*/jsx(Fallback, {}),
|
|
1978
|
+
children: children
|
|
1979
|
+
})
|
|
1980
|
+
})
|
|
1981
|
+
})
|
|
1982
|
+
})
|
|
1983
|
+
})
|
|
1984
|
+
});
|
|
1985
|
+
});
|
|
1986
|
+
|
|
1987
|
+
function calculateDimensions(width, height) {
|
|
1988
|
+
var isPortrait = false;
|
|
1989
|
+
var isMobile = false;
|
|
1990
|
+
var isTablet = false;
|
|
1991
|
+
if (width < height) {
|
|
1992
|
+
isPortrait = true;
|
|
1993
|
+
}
|
|
1994
|
+
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || width < 900) {
|
|
1995
|
+
isMobile = true;
|
|
1996
|
+
}
|
|
1997
|
+
if (/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(navigator.userAgent) || navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints && navigator.maxTouchPoints > 2) {
|
|
1998
|
+
isTablet = true;
|
|
1999
|
+
}
|
|
2000
|
+
return {
|
|
2001
|
+
isPortrait: isPortrait,
|
|
2002
|
+
isMobile: isMobile,
|
|
2003
|
+
isTablet: isTablet,
|
|
2004
|
+
width: Math.round(width),
|
|
2005
|
+
height: Math.round(height)
|
|
2006
|
+
};
|
|
2007
|
+
}
|
|
2008
|
+
function registerResizeObserver(_x, _x2) {
|
|
2009
|
+
return _registerResizeObserver.apply(this, arguments);
|
|
2010
|
+
}
|
|
2011
|
+
function _registerResizeObserver() {
|
|
2012
|
+
_registerResizeObserver = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(ref, onResize) {
|
|
2013
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2014
|
+
while (1) switch (_context.prev = _context.next) {
|
|
2015
|
+
case 0:
|
|
2016
|
+
return _context.abrupt("return", new Promise(function (resolve) {
|
|
2017
|
+
if ('ResizeObserver' in self) {
|
|
2018
|
+
resolve(buildResizeObserver(ref, onResize));
|
|
2019
|
+
} else {
|
|
2020
|
+
DivaUtils.loadScript('https://cdn.jsdelivr.net/npm/resize-observer-polyfill@1.5.1/dist/ResizeObserver.min.js', function () {
|
|
2021
|
+
return resolve(buildResizeObserver(ref, onResize));
|
|
2022
|
+
});
|
|
2023
|
+
}
|
|
2024
|
+
}));
|
|
2025
|
+
case 1:
|
|
2026
|
+
case "end":
|
|
2027
|
+
return _context.stop();
|
|
2028
|
+
}
|
|
2029
|
+
}, _callee);
|
|
2030
|
+
}));
|
|
2031
|
+
return _registerResizeObserver.apply(this, arguments);
|
|
2032
|
+
}
|
|
2033
|
+
function unregisterResizeObserver(observer) {
|
|
2034
|
+
observer.disconnect();
|
|
2035
|
+
}
|
|
2036
|
+
function buildResizeObserver(ref, onResize) {
|
|
2037
|
+
var resizeObserver = new ResizeObserver(debounce(function (entries) {
|
|
2038
|
+
if (entries.length === 0) return;
|
|
2039
|
+
var _entries$0$contentRec = entries[0].contentRect,
|
|
2040
|
+
width = _entries$0$contentRec.width,
|
|
2041
|
+
height = _entries$0$contentRec.height;
|
|
2042
|
+
onResize(width, height);
|
|
2043
|
+
}, 150));
|
|
2044
|
+
resizeObserver.observe(ref);
|
|
2045
|
+
return resizeObserver;
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
function updateCssThemeVariables (ref, theme) {
|
|
2049
|
+
ref.style.setProperty('--diva-theme-palette-primary-main', theme.palette.primary.main);
|
|
2050
|
+
ref.style.setProperty('--diva-theme-palette-primary-dark', theme.palette.primary.dark);
|
|
2051
|
+
ref.style.setProperty('--diva-theme-palette-primary-light', theme.palette.primary.light);
|
|
2052
|
+
ref.style.setProperty('--diva-theme-palette-primary-contrast-text', theme.palette.primary.contrastText);
|
|
2053
|
+
ref.style.setProperty('--diva-theme-palette-secondary-main', theme.palette.secondary.main);
|
|
2054
|
+
ref.style.setProperty('--diva-theme-palette-secondary-dark', theme.palette.secondary.dark);
|
|
2055
|
+
ref.style.setProperty('--diva-theme-palette-secondary-light', theme.palette.secondary.light);
|
|
2056
|
+
ref.style.setProperty('--diva-theme-palette-secondary-contrast-text', theme.palette.secondary.contrastText);
|
|
2057
|
+
ref.style.setProperty('--diva-theme-palette-text-primary', theme.palette.text.primary);
|
|
2058
|
+
ref.style.setProperty('--diva-theme-palette-text-secondary', theme.palette.text.secondary);
|
|
2059
|
+
ref.style.setProperty('--diva-typography-font-family', theme.typography.fontFamily);
|
|
2060
|
+
ref.style.setProperty('font-family', theme.typography.fontFamily);
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
var _excluded$3 = ["openFrom"],
|
|
1849
2064
|
_excluded2$1 = ["onClose"];
|
|
1850
2065
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
1851
2066
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
1852
2067
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1853
|
-
function ownKeys$
|
|
1854
|
-
function _objectSpread$
|
|
1855
|
-
var LOG$
|
|
1856
|
-
var debounce = require('lodash.debounce');
|
|
2068
|
+
function ownKeys$a(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2069
|
+
function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2070
|
+
var LOG$9 = getLogger('Framework', 'ContentStore');
|
|
1857
2071
|
var ContentStore = /*#__PURE__*/function () {
|
|
1858
2072
|
function ContentStore(components, root) {
|
|
1859
2073
|
var _this = this;
|
|
@@ -1924,7 +2138,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
1924
2138
|
});
|
|
1925
2139
|
this.root = root;
|
|
1926
2140
|
this.configuration = components;
|
|
1927
|
-
LOG$
|
|
2141
|
+
LOG$9.debug("Available Components: ".concat(components.map(function (c) {
|
|
1928
2142
|
return c.name;
|
|
1929
2143
|
})));
|
|
1930
2144
|
makeAutoObservable(this, {
|
|
@@ -2025,12 +2239,12 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2025
2239
|
return _context.abrupt("return");
|
|
2026
2240
|
case 3:
|
|
2027
2241
|
this.root.loadingAndErrorStore.toggleLoading('openComponent');
|
|
2028
|
-
LOG$
|
|
2242
|
+
LOG$9.debug('openComponent', toJS(action));
|
|
2029
2243
|
if (!action.url) {
|
|
2030
2244
|
_context.next = 10;
|
|
2031
2245
|
break;
|
|
2032
2246
|
}
|
|
2033
|
-
LOG$
|
|
2247
|
+
LOG$9.businessEvent('onOpenModule', action.openInNewTab ? 'OpenUrlNewTab' : 'OpenUrl', "Open link ".concat(action.url), {
|
|
2034
2248
|
url: action.url
|
|
2035
2249
|
});
|
|
2036
2250
|
if (action.openInNewTab) {
|
|
@@ -2074,7 +2288,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2074
2288
|
_context.next = 28;
|
|
2075
2289
|
break;
|
|
2076
2290
|
}
|
|
2077
|
-
LOG$
|
|
2291
|
+
LOG$9.debug("Component is restricted, open login form");
|
|
2078
2292
|
this._restrictedComponent = action;
|
|
2079
2293
|
this.root.authorizationStore.showLogin();
|
|
2080
2294
|
this.root.loadingAndErrorStore.toggleLoading('openComponent');
|
|
@@ -2113,19 +2327,19 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2113
2327
|
case 41:
|
|
2114
2328
|
openModuleLables = undefined;
|
|
2115
2329
|
if (parameters) {
|
|
2116
|
-
_parameters = parameters, _parameters.openFrom, otherPrams = _objectWithoutProperties(_parameters, _excluded$
|
|
2330
|
+
_parameters = parameters, _parameters.openFrom, otherPrams = _objectWithoutProperties(_parameters, _excluded$3);
|
|
2117
2331
|
openModuleLables = parameters;
|
|
2118
2332
|
parameters = otherPrams;
|
|
2119
2333
|
}
|
|
2120
2334
|
module = this.mapTypeToModule((_config4 = config) === null || _config4 === void 0 ? void 0 : _config4.type);
|
|
2121
|
-
LOG$
|
|
2335
|
+
LOG$9.businessEvent('onOpenModule', module, "Open module ".concat((_config5 = config) === null || _config5 === void 0 ? void 0 : _config5.type), openModuleLables);
|
|
2122
2336
|
prevType = this.visible;
|
|
2123
2337
|
prevState = this.state.get(this.visible || '');
|
|
2124
2338
|
currentState = this.state.get(config.type);
|
|
2125
2339
|
componentState = {};
|
|
2126
2340
|
componentState.settings = toJS(settings);
|
|
2127
|
-
componentState.parameters = _objectSpread$
|
|
2128
|
-
componentState.internal = _objectSpread$
|
|
2341
|
+
componentState.parameters = _objectSpread$a(_objectSpread$a({}, keepOldState && currentState ? currentState.parameters : {}), parameters);
|
|
2342
|
+
componentState.internal = _objectSpread$a(_objectSpread$a({}, keepOldState && currentState ? currentState.internal : {}), internal);
|
|
2129
2343
|
componentState.path = route;
|
|
2130
2344
|
this.state.set(config.type, componentState);
|
|
2131
2345
|
this.visible = config.type;
|
|
@@ -2176,7 +2390,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2176
2390
|
return _regeneratorRuntime.wrap(function openComponentInFullscreen$(_context2) {
|
|
2177
2391
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2178
2392
|
case 0:
|
|
2179
|
-
LOG$
|
|
2393
|
+
LOG$9.debug('openComponentInFullscreen', toJS(component));
|
|
2180
2394
|
this.root.loadingAndErrorStore.setError(undefined);
|
|
2181
2395
|
type = component.type, parameters = component.parameters, internal = component.internal, route = component.route;
|
|
2182
2396
|
config = undefined;
|
|
@@ -2222,7 +2436,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2222
2436
|
settings = _context2.sent;
|
|
2223
2437
|
case 18:
|
|
2224
2438
|
module = this.mapTypeToModule((_config6 = config) === null || _config6 === void 0 ? void 0 : _config6.type);
|
|
2225
|
-
LOG$
|
|
2439
|
+
LOG$9.businessEvent('onOpenModule', module, "Open module ".concat((_config7 = config) === null || _config7 === void 0 ? void 0 : _config7.type));
|
|
2226
2440
|
componentState = {
|
|
2227
2441
|
key: config.type,
|
|
2228
2442
|
parameters: parameters,
|
|
@@ -2278,7 +2492,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2278
2492
|
if (settings !== null && settings !== void 0 && settings.skipVerify) {
|
|
2279
2493
|
return;
|
|
2280
2494
|
}
|
|
2281
|
-
LOG$
|
|
2495
|
+
LOG$9.debug("Request email verification for ".concat(email));
|
|
2282
2496
|
_this2.root.apiHandler.sendVerificationEmail({
|
|
2283
2497
|
email: email,
|
|
2284
2498
|
emailVariant: (_settings$emailVarian = settings === null || settings === void 0 ? void 0 : settings.emailVariant) !== null && _settings$emailVarian !== void 0 ? _settings$emailVarian : 'DEMO'
|
|
@@ -2677,7 +2891,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2677
2891
|
onClose = _ref3$onClose === void 0 ? this.closeSideMenu.bind(this) : _ref3$onClose,
|
|
2678
2892
|
sideMenu = _objectWithoutProperties(_ref3, _excluded2$1);
|
|
2679
2893
|
if (sideMenu.open === undefined) sideMenu.open = (_this$_sideMenu$open = (_this$_sideMenu = this._sideMenu) === null || _this$_sideMenu === void 0 ? void 0 : _this$_sideMenu.open) !== null && _this$_sideMenu$open !== void 0 ? _this$_sideMenu$open : false;
|
|
2680
|
-
this._sideMenu = _objectSpread$
|
|
2894
|
+
this._sideMenu = _objectSpread$a(_objectSpread$a({}, sideMenu), {}, {
|
|
2681
2895
|
onClose: onClose
|
|
2682
2896
|
});
|
|
2683
2897
|
}
|
|
@@ -2688,7 +2902,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2688
2902
|
}, {
|
|
2689
2903
|
key: "closeSideMenu",
|
|
2690
2904
|
value: function closeSideMenu() {
|
|
2691
|
-
if (this._sideMenu) this._sideMenu = _objectSpread$
|
|
2905
|
+
if (this._sideMenu) this._sideMenu = _objectSpread$a(_objectSpread$a({}, this._sideMenu), {}, {
|
|
2692
2906
|
open: false
|
|
2693
2907
|
});
|
|
2694
2908
|
}
|
|
@@ -2729,7 +2943,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2729
2943
|
_barrier$actions,
|
|
2730
2944
|
_this7 = this;
|
|
2731
2945
|
if (barrier.anonOnly && (_this$root$dataStore$4 = this.root.dataStore.user) !== null && _this$root$dataStore$4 !== void 0 && _this$root$dataStore$4.mainEmail) {
|
|
2732
|
-
LOG$
|
|
2946
|
+
LOG$9.debug('Skip barrier because user is logged in');
|
|
2733
2947
|
return;
|
|
2734
2948
|
}
|
|
2735
2949
|
this._modal = {
|
|
@@ -2745,7 +2959,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2745
2959
|
type: barrier.type,
|
|
2746
2960
|
currentEmail: (_this$root$dataStore$5 = this.root.dataStore.user) === null || _this$root$dataStore$5 === void 0 ? void 0 : _this$root$dataStore$5.mainEmail,
|
|
2747
2961
|
actions: (_barrier$actions = barrier.actions) === null || _barrier$actions === void 0 ? void 0 : _barrier$actions.map(function (a) {
|
|
2748
|
-
return _objectSpread$
|
|
2962
|
+
return _objectSpread$a(_objectSpread$a({}, a), {}, {
|
|
2749
2963
|
onClick: function () {
|
|
2750
2964
|
var _onClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(email) {
|
|
2751
2965
|
var _this7$root$dataStore;
|
|
@@ -2768,7 +2982,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2768
2982
|
case 8:
|
|
2769
2983
|
_context3.prev = 8;
|
|
2770
2984
|
_context3.t0 = _context3["catch"](3);
|
|
2771
|
-
LOG$
|
|
2985
|
+
LOG$9.error(new DivaError('Error while logging in', {
|
|
2772
2986
|
cause: _context3.t0
|
|
2773
2987
|
}));
|
|
2774
2988
|
case 11:
|
|
@@ -2895,7 +3109,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2895
3109
|
key: "getState",
|
|
2896
3110
|
value: function getState(type) {
|
|
2897
3111
|
var state = this.state.get(type);
|
|
2898
|
-
return state ? _objectSpread$
|
|
3112
|
+
return state ? _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
2899
3113
|
isVisible: this.isVisible(type)
|
|
2900
3114
|
}) : {
|
|
2901
3115
|
settings: {}
|
|
@@ -2918,36 +3132,36 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2918
3132
|
*/
|
|
2919
3133
|
}, {
|
|
2920
3134
|
key: "setContainer",
|
|
2921
|
-
value: function
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
_this9.onResize([{
|
|
2936
|
-
contentRect: {
|
|
2937
|
-
height: window.innerHeight,
|
|
2938
|
-
width: window.innerWidth
|
|
3135
|
+
value: (function () {
|
|
3136
|
+
var _setContainer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(ref) {
|
|
3137
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context5) {
|
|
3138
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
3139
|
+
case 0:
|
|
3140
|
+
if (!(ref === this.ref)) {
|
|
3141
|
+
_context5.next = 2;
|
|
3142
|
+
break;
|
|
3143
|
+
}
|
|
3144
|
+
return _context5.abrupt("return");
|
|
3145
|
+
case 2:
|
|
3146
|
+
this.ref = ref;
|
|
3147
|
+
if (this.resizeObserver) {
|
|
3148
|
+
unregisterResizeObserver(this.resizeObserver);
|
|
2939
3149
|
}
|
|
2940
|
-
|
|
3150
|
+
_context5.next = 6;
|
|
3151
|
+
return registerResizeObserver(ref, this.onResize.bind(this));
|
|
3152
|
+
case 6:
|
|
3153
|
+
this.resizeObserver = _context5.sent;
|
|
3154
|
+
case 7:
|
|
3155
|
+
case "end":
|
|
3156
|
+
return _context5.stop();
|
|
2941
3157
|
}
|
|
2942
|
-
});
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
this.resizeObserver.unobserve(this.ref);
|
|
3158
|
+
}, _callee3, this);
|
|
3159
|
+
}));
|
|
3160
|
+
function setContainer(_x2) {
|
|
3161
|
+
return _setContainer.apply(this, arguments);
|
|
2947
3162
|
}
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
}
|
|
3163
|
+
return setContainer;
|
|
3164
|
+
}())
|
|
2951
3165
|
}, {
|
|
2952
3166
|
key: "isPublic",
|
|
2953
3167
|
value: function isPublic(component) {
|
|
@@ -2973,10 +3187,10 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2973
3187
|
key: "availableComponents",
|
|
2974
3188
|
get: function get() {
|
|
2975
3189
|
var _this$root,
|
|
2976
|
-
|
|
3190
|
+
_this9 = this;
|
|
2977
3191
|
return (_this$root = this.root) === null || _this$root === void 0 ? void 0 : _this$root.configurationStore.components.filter(function (component) {
|
|
2978
3192
|
//the component must be passed to diva core
|
|
2979
|
-
if (!
|
|
3193
|
+
if (!_this9.configuration.find(function (config) {
|
|
2980
3194
|
return config.name == component.type;
|
|
2981
3195
|
})) {
|
|
2982
3196
|
return false;
|
|
@@ -2987,11 +3201,11 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2987
3201
|
return true;
|
|
2988
3202
|
}
|
|
2989
3203
|
//if the user is not logged in the component must be public
|
|
2990
|
-
if (!
|
|
3204
|
+
if (!_this9.root.dataStore.user) {
|
|
2991
3205
|
return false;
|
|
2992
3206
|
}
|
|
2993
3207
|
//if there is a permission specified, the user must have it
|
|
2994
|
-
return component.permission ?
|
|
3208
|
+
return component.permission ? _this9.root.dataStore.userHasPermission(component.permission) : true;
|
|
2995
3209
|
});
|
|
2996
3210
|
}
|
|
2997
3211
|
|
|
@@ -3001,14 +3215,14 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3001
3215
|
}, {
|
|
3002
3216
|
key: "components",
|
|
3003
3217
|
get: function get() {
|
|
3004
|
-
var
|
|
3218
|
+
var _this10 = this;
|
|
3005
3219
|
var componentDefinitionToRender = this.configuration.filter(function (config) {
|
|
3006
3220
|
//there must be a state present in order for the component to be rendered
|
|
3007
|
-
if (!
|
|
3221
|
+
if (!_this10.state.has(config.name)) {
|
|
3008
3222
|
return false;
|
|
3009
3223
|
}
|
|
3010
3224
|
//the component must be contained in the available components list in order to be rendered
|
|
3011
|
-
return
|
|
3225
|
+
return _this10.availableComponents.find(function (component) {
|
|
3012
3226
|
return component.type == config.name;
|
|
3013
3227
|
});
|
|
3014
3228
|
});
|
|
@@ -3016,7 +3230,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3016
3230
|
//when a new component is added we have to make sure that for the currently open components the existing instance is reused
|
|
3017
3231
|
//withTransaction creates a new instance if APM is active, so we would loose the state of currently open components
|
|
3018
3232
|
componentDefinitionToRender.forEach(function (cmp) {
|
|
3019
|
-
var toRender =
|
|
3233
|
+
var toRender = _this10._currentlyRendered.find(function (c) {
|
|
3020
3234
|
return c.name == cmp.name;
|
|
3021
3235
|
});
|
|
3022
3236
|
if (!toRender) {
|
|
@@ -3037,10 +3251,10 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3037
3251
|
}, {
|
|
3038
3252
|
key: "fullscreenComponent",
|
|
3039
3253
|
get: function get() {
|
|
3040
|
-
var
|
|
3254
|
+
var _this11 = this;
|
|
3041
3255
|
var component = this.availableComponents.find(function (component) {
|
|
3042
|
-
var
|
|
3043
|
-
return component.type == ((
|
|
3256
|
+
var _this11$_fullscreenCo;
|
|
3257
|
+
return component.type == ((_this11$_fullscreenCo = _this11._fullscreenComponent) === null || _this11$_fullscreenCo === void 0 ? void 0 : _this11$_fullscreenCo.key);
|
|
3044
3258
|
});
|
|
3045
3259
|
var cmp = this.configuration.find(function (config) {
|
|
3046
3260
|
return (component === null || component === void 0 ? void 0 : component.type) == config.name;
|
|
@@ -3087,24 +3301,24 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3087
3301
|
key: "availableButtons",
|
|
3088
3302
|
get: function get() {
|
|
3089
3303
|
var _this$root$configurat,
|
|
3090
|
-
|
|
3304
|
+
_this12 = this;
|
|
3091
3305
|
return (_this$root$configurat = this.root.configurationStore.navigation) === null || _this$root$configurat === void 0 ? void 0 : _this$root$configurat.buttons.filter(function (button) {
|
|
3092
3306
|
//if component is public it can be displayed
|
|
3093
3307
|
if (button.isPublic) {
|
|
3094
3308
|
return true;
|
|
3095
3309
|
}
|
|
3096
3310
|
//if the user is not logged in the component must be public
|
|
3097
|
-
if (!
|
|
3311
|
+
if (!_this12.root.dataStore.user) {
|
|
3098
3312
|
return false;
|
|
3099
3313
|
}
|
|
3100
3314
|
|
|
3101
3315
|
//if the button is opening a component, the component must be availalbe
|
|
3102
|
-
if (button.action.type && !
|
|
3316
|
+
if (button.action.type && !_this12.availableComponentList.includes(button.action.type)) {
|
|
3103
3317
|
return false;
|
|
3104
3318
|
}
|
|
3105
3319
|
|
|
3106
3320
|
//if there is a permission specified, the user must have it
|
|
3107
|
-
return button.permission ?
|
|
3321
|
+
return button.permission ? _this12.root.dataStore.userHasPermission(button.permission) : true;
|
|
3108
3322
|
});
|
|
3109
3323
|
}
|
|
3110
3324
|
|
|
@@ -3132,9 +3346,9 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3132
3346
|
height: 0
|
|
3133
3347
|
};
|
|
3134
3348
|
if (this.isAbsoluteFullscreenComponent) {
|
|
3135
|
-
dimensions =
|
|
3349
|
+
dimensions = calculateDimensions(window.innerWidth, window.innerHeight);
|
|
3136
3350
|
}
|
|
3137
|
-
LOG$
|
|
3351
|
+
LOG$9.debug("Detected dimensions: ".concat(JSON.stringify(dimensions, null, 2), " "));
|
|
3138
3352
|
return dimensions;
|
|
3139
3353
|
}
|
|
3140
3354
|
|
|
@@ -3145,7 +3359,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3145
3359
|
}, {
|
|
3146
3360
|
key: "resetState",
|
|
3147
3361
|
value: function resetState() {
|
|
3148
|
-
LOG$
|
|
3362
|
+
LOG$9.debug('Reset page state');
|
|
3149
3363
|
var prevType = this.visible;
|
|
3150
3364
|
var prevState = this.state.get(this.visible || '');
|
|
3151
3365
|
this.root.dataStore.clearSessionGuids();
|
|
@@ -3174,23 +3388,12 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3174
3388
|
*/
|
|
3175
3389
|
}, {
|
|
3176
3390
|
key: "updateCssThemeVariables",
|
|
3177
|
-
value: function updateCssThemeVariables() {
|
|
3391
|
+
value: function updateCssThemeVariables$1() {
|
|
3178
3392
|
if (!this.ref) {
|
|
3179
3393
|
return;
|
|
3180
3394
|
}
|
|
3181
3395
|
var theme = this.root.configurationStore.theme;
|
|
3182
|
-
this.ref
|
|
3183
|
-
this.ref.style.setProperty('--diva-theme-palette-primary-dark', theme.palette.primary.dark);
|
|
3184
|
-
this.ref.style.setProperty('--diva-theme-palette-primary-light', theme.palette.primary.light);
|
|
3185
|
-
this.ref.style.setProperty('--diva-theme-palette-primary-contrast-text', theme.palette.primary.contrastText);
|
|
3186
|
-
this.ref.style.setProperty('--diva-theme-palette-secondary-main', theme.palette.secondary.main);
|
|
3187
|
-
this.ref.style.setProperty('--diva-theme-palette-secondary-dark', theme.palette.secondary.dark);
|
|
3188
|
-
this.ref.style.setProperty('--diva-theme-palette-secondary-light', theme.palette.secondary.light);
|
|
3189
|
-
this.ref.style.setProperty('--diva-theme-palette-secondary-contrast-text', theme.palette.secondary.contrastText);
|
|
3190
|
-
this.ref.style.setProperty('--diva-theme-palette-text-primary', theme.palette.text.primary);
|
|
3191
|
-
this.ref.style.setProperty('--diva-theme-palette-text-secondary', theme.palette.text.secondary);
|
|
3192
|
-
this.ref.style.setProperty('--diva-typography-font-family', theme.typography.fontFamily);
|
|
3193
|
-
this.ref.style.setProperty('font-family', theme.typography.fontFamily);
|
|
3396
|
+
updateCssThemeVariables(this.ref, theme);
|
|
3194
3397
|
}
|
|
3195
3398
|
|
|
3196
3399
|
/**
|
|
@@ -3200,7 +3403,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3200
3403
|
}, {
|
|
3201
3404
|
key: "updateStateAfterLogout",
|
|
3202
3405
|
value: function updateStateAfterLogout() {
|
|
3203
|
-
var
|
|
3406
|
+
var _this13 = this;
|
|
3204
3407
|
var _iterator2 = _createForOfIteratorHelper(this.state.entries()),
|
|
3205
3408
|
_step2;
|
|
3206
3409
|
try {
|
|
@@ -3208,19 +3411,19 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3208
3411
|
var _step2$value = _slicedToArray(_step2.value, 2),
|
|
3209
3412
|
type = _step2$value[0],
|
|
3210
3413
|
component = _step2$value[1];
|
|
3211
|
-
var config =
|
|
3414
|
+
var config = _this13.root.configurationStore.components.find(function (c) {
|
|
3212
3415
|
return c.type == type;
|
|
3213
3416
|
});
|
|
3214
3417
|
if (!(config !== null && config !== void 0 && config.isPublic)) {
|
|
3215
|
-
|
|
3216
|
-
if (
|
|
3217
|
-
|
|
3218
|
-
|
|
3418
|
+
_this13.state["delete"](type);
|
|
3419
|
+
if (_this13.visible == type) {
|
|
3420
|
+
_this13.visible = undefined;
|
|
3421
|
+
_this13._restrictedComponent = {
|
|
3219
3422
|
type: type,
|
|
3220
3423
|
parameters: component.parameters,
|
|
3221
3424
|
internal: component.internal
|
|
3222
3425
|
};
|
|
3223
|
-
|
|
3426
|
+
_this13.root.authorizationStore.showLogin();
|
|
3224
3427
|
}
|
|
3225
3428
|
}
|
|
3226
3429
|
};
|
|
@@ -3316,38 +3519,11 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3316
3519
|
*/
|
|
3317
3520
|
}, {
|
|
3318
3521
|
key: "onResize",
|
|
3319
|
-
value: function onResize(
|
|
3320
|
-
if (!(entries !== null && entries !== void 0 && entries.length)) {
|
|
3321
|
-
return;
|
|
3322
|
-
}
|
|
3323
|
-
var rect = entries[0].contentRect;
|
|
3522
|
+
value: function onResize(width, height) {
|
|
3324
3523
|
if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
|
|
3325
|
-
this.ref.style.height = "".concat(
|
|
3326
|
-
}
|
|
3327
|
-
this._dimensions = this.calculateDimensions(rect.width, rect.height);
|
|
3328
|
-
}
|
|
3329
|
-
}, {
|
|
3330
|
-
key: "calculateDimensions",
|
|
3331
|
-
value: function calculateDimensions(width, height) {
|
|
3332
|
-
var isPortrait = false;
|
|
3333
|
-
var isMobile = false;
|
|
3334
|
-
var isTablet = false;
|
|
3335
|
-
if (width < height) {
|
|
3336
|
-
isPortrait = true;
|
|
3337
|
-
}
|
|
3338
|
-
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || width < 900) {
|
|
3339
|
-
isMobile = true;
|
|
3524
|
+
this.ref.style.height = "".concat(width, " px");
|
|
3340
3525
|
}
|
|
3341
|
-
|
|
3342
|
-
isTablet = true;
|
|
3343
|
-
}
|
|
3344
|
-
return {
|
|
3345
|
-
isPortrait: isPortrait,
|
|
3346
|
-
isMobile: isMobile,
|
|
3347
|
-
isTablet: isTablet,
|
|
3348
|
-
width: Math.round(width),
|
|
3349
|
-
height: Math.round(height)
|
|
3350
|
-
};
|
|
3526
|
+
this._dimensions = calculateDimensions(width, height);
|
|
3351
3527
|
}
|
|
3352
3528
|
}, {
|
|
3353
3529
|
key: "setGlobalClass",
|
|
@@ -3374,8 +3550,8 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3374
3550
|
}]);
|
|
3375
3551
|
}();
|
|
3376
3552
|
|
|
3377
|
-
var LOG$
|
|
3378
|
-
var _default
|
|
3553
|
+
var LOG$8 = getLogger('Framework', 'LoadingAndErrorStore');
|
|
3554
|
+
var _default = /*#__PURE__*/function () {
|
|
3379
3555
|
function _default(root, spinnerClass) {
|
|
3380
3556
|
var _this = this;
|
|
3381
3557
|
_classCallCheck(this, _default);
|
|
@@ -3480,21 +3656,21 @@ var _default$1 = /*#__PURE__*/function () {
|
|
|
3480
3656
|
this._errorMsg = undefined;
|
|
3481
3657
|
} else if (typeof error == 'string') {
|
|
3482
3658
|
this._errorMsg = error;
|
|
3483
|
-
LOG$
|
|
3659
|
+
LOG$8.error(new DivaError(error));
|
|
3484
3660
|
} else if (error.name == 'CORE_0005') {
|
|
3485
|
-
LOG$
|
|
3661
|
+
LOG$8.error(error);
|
|
3486
3662
|
this._errorMsg = this.root.t('core.error.page_not_found', {
|
|
3487
3663
|
defaultValue: 'Die Seite existiert nicht oder Sie haben nicht die benötigten Berechtigungen. Bei Fragen wenden Sie sich bitte an den Support.'
|
|
3488
3664
|
});
|
|
3489
3665
|
var conf = this.root.configurationStore.components;
|
|
3490
3666
|
console.log(conf);
|
|
3491
3667
|
} else if (error.name == 'CORE_0002') {
|
|
3492
|
-
LOG$
|
|
3668
|
+
LOG$8.error(error);
|
|
3493
3669
|
this._errorMsg = this.root.t('core.error.resource_not_found', {
|
|
3494
3670
|
defaultValue: 'Eine oder mehrere der benötigten Resource existiert nicht oder konnte nicht gefunden werden. Bei Fragen wenden Sie sich bitte an den Support.'
|
|
3495
3671
|
});
|
|
3496
3672
|
} else {
|
|
3497
|
-
LOG$
|
|
3673
|
+
LOG$8.error(error);
|
|
3498
3674
|
this._errorMsg = error.message;
|
|
3499
3675
|
}
|
|
3500
3676
|
if (this._errorMsg) {
|
|
@@ -3556,16 +3732,16 @@ var _default$1 = /*#__PURE__*/function () {
|
|
|
3556
3732
|
value: function toggleLoading(id, hidden, toggle) {
|
|
3557
3733
|
if (this.loading.has(id) && toggle !== true) {
|
|
3558
3734
|
this.loading["delete"](id);
|
|
3559
|
-
LOG$
|
|
3735
|
+
LOG$8.debug("End loading: ".concat(id, " [").concat(Array.from(this.loading.keys()), "]"));
|
|
3560
3736
|
} else if (!this.loading.has(id) && toggle !== false) {
|
|
3561
|
-
LOG$
|
|
3737
|
+
LOG$8.debug("Start loading: ".concat(id));
|
|
3562
3738
|
this.loading.set(id, hidden == undefined ? false : hidden);
|
|
3563
3739
|
}
|
|
3564
3740
|
}
|
|
3565
3741
|
}]);
|
|
3566
3742
|
}();
|
|
3567
3743
|
|
|
3568
|
-
var LOG$
|
|
3744
|
+
var LOG$7 = getLogger('Framework', 'BrowserStateStore');
|
|
3569
3745
|
var BANNER_STATE_LOCALSTORAGE_KEY = 'diva-banner-state';
|
|
3570
3746
|
var NTOKEN_LOCALSTORAGE_KEY = 'diva-ntoken';
|
|
3571
3747
|
var LANGUAGE_LOCALSTORAGE_KEY = 'diva-language';
|
|
@@ -3891,7 +4067,7 @@ var BrowserStateStore = /*#__PURE__*/function () {
|
|
|
3891
4067
|
var _componentState$path;
|
|
3892
4068
|
var componentConfig = _this2.root.contentStore.currentComponent;
|
|
3893
4069
|
if (!componentConfig) {
|
|
3894
|
-
LOG$
|
|
4070
|
+
LOG$7.debug('No current component found, while updating url, do nothing');
|
|
3895
4071
|
return;
|
|
3896
4072
|
}
|
|
3897
4073
|
var componentState = _this2.root.contentStore.getState(componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.type);
|
|
@@ -3963,9 +4139,9 @@ var BrowserStateStore = /*#__PURE__*/function () {
|
|
|
3963
4139
|
}]);
|
|
3964
4140
|
}();
|
|
3965
4141
|
|
|
3966
|
-
function ownKeys$
|
|
3967
|
-
function _objectSpread$
|
|
3968
|
-
var LOG$
|
|
4142
|
+
function ownKeys$9(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4143
|
+
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4144
|
+
var LOG$6 = getLogger('Framework', 'AuthorizationStore');
|
|
3969
4145
|
var AuthorizationStore = /*#__PURE__*/function () {
|
|
3970
4146
|
function AuthorizationStore(root) {
|
|
3971
4147
|
_classCallCheck(this, AuthorizationStore);
|
|
@@ -4022,7 +4198,7 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4022
4198
|
if (debug) {
|
|
4023
4199
|
this._state = {
|
|
4024
4200
|
type: 'LOGIN',
|
|
4025
|
-
loginMethods: _objectSpread$
|
|
4201
|
+
loginMethods: _objectSpread$9(_objectSpread$9({}, loginMethods), {}, {
|
|
4026
4202
|
standard: true
|
|
4027
4203
|
}),
|
|
4028
4204
|
organizationId: organizationId
|
|
@@ -4155,14 +4331,14 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4155
4331
|
_context2.next = 6;
|
|
4156
4332
|
break;
|
|
4157
4333
|
}
|
|
4158
|
-
LOG$
|
|
4334
|
+
LOG$6.debug('NToken removed');
|
|
4159
4335
|
_context2.next = 4;
|
|
4160
4336
|
return this.root.authorizationStore.logout();
|
|
4161
4337
|
case 4:
|
|
4162
4338
|
_context2.next = 15;
|
|
4163
4339
|
break;
|
|
4164
4340
|
case 6:
|
|
4165
|
-
LOG$
|
|
4341
|
+
LOG$6.debug('NToken change detected, login');
|
|
4166
4342
|
_context2.next = 9;
|
|
4167
4343
|
return this.root.authorizationStore.autorize(this.root.dataStore.organizationId, this.root.browserStateStore.getStoredNToken());
|
|
4168
4344
|
case 9:
|
|
@@ -4210,7 +4386,7 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4210
4386
|
_context3.next = 20;
|
|
4211
4387
|
break;
|
|
4212
4388
|
}
|
|
4213
|
-
LOG$
|
|
4389
|
+
LOG$6.log('The stored organization is no longer valid, fallback to default organization');
|
|
4214
4390
|
//for anonymous users, we fallback to the 'default' organization for ohter users we let the backend determine the right organization
|
|
4215
4391
|
_context3.next = 17;
|
|
4216
4392
|
return this.autorize(nToken ? undefined : this.root.configurationStore.organizations[0], nToken);
|
|
@@ -4221,7 +4397,7 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4221
4397
|
_context3.next = 25;
|
|
4222
4398
|
break;
|
|
4223
4399
|
}
|
|
4224
|
-
LOG$
|
|
4400
|
+
LOG$6.log('Authentication expired or invalid, logging out.');
|
|
4225
4401
|
_context3.next = 24;
|
|
4226
4402
|
return this.logout(true, true, organizationId);
|
|
4227
4403
|
case 24:
|
|
@@ -4319,7 +4495,7 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4319
4495
|
_context5.next = 19;
|
|
4320
4496
|
break;
|
|
4321
4497
|
}
|
|
4322
|
-
LOG$
|
|
4498
|
+
LOG$6.log('The stored organization is no longer valid, fallback to default organization');
|
|
4323
4499
|
_context5.next = 18;
|
|
4324
4500
|
return this.login(email, password, loginSimple, undefined);
|
|
4325
4501
|
case 18:
|
|
@@ -4371,7 +4547,7 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4371
4547
|
this._timeout = undefined;
|
|
4372
4548
|
}
|
|
4373
4549
|
refreshTokenIn = zExpireBy - 1000 * 60 * 5 - Date.now(); //refresh 5 minutes before expire
|
|
4374
|
-
LOG$
|
|
4550
|
+
LOG$6.debug("Set token refresh interval to ".concat(refreshTokenIn, " ms. Refresh at ").concat(new Date(Date.now() + refreshTokenIn)));
|
|
4375
4551
|
|
|
4376
4552
|
//set the timout to refresh token
|
|
4377
4553
|
this._timeout = setTimeout(function () {
|
|
@@ -4449,7 +4625,7 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4449
4625
|
}]);
|
|
4450
4626
|
}();
|
|
4451
4627
|
|
|
4452
|
-
var _excluded$
|
|
4628
|
+
var _excluded$2 = ["kind", "type"],
|
|
4453
4629
|
_excluded2 = ["type"];
|
|
4454
4630
|
var ApiHandler = /*#__PURE__*/function () {
|
|
4455
4631
|
function ApiHandler(root) {
|
|
@@ -4459,32 +4635,32 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
4459
4635
|
return _createClass(ApiHandler, [{
|
|
4460
4636
|
key: "adminService",
|
|
4461
4637
|
get: function get() {
|
|
4462
|
-
return this.root.
|
|
4638
|
+
return this.root.apiConfig.adminService;
|
|
4463
4639
|
}
|
|
4464
4640
|
}, {
|
|
4465
4641
|
key: "messageService",
|
|
4466
4642
|
get: function get() {
|
|
4467
|
-
return this.root.
|
|
4643
|
+
return this.root.apiConfig.messageService;
|
|
4468
4644
|
}
|
|
4469
4645
|
}, {
|
|
4470
4646
|
key: "authService",
|
|
4471
4647
|
get: function get() {
|
|
4472
|
-
return this.root.
|
|
4648
|
+
return this.root.apiConfig.authService;
|
|
4473
4649
|
}
|
|
4474
4650
|
}, {
|
|
4475
4651
|
key: "catalogService",
|
|
4476
4652
|
get: function get() {
|
|
4477
|
-
return this.root.
|
|
4653
|
+
return this.root.apiConfig.catalogService;
|
|
4478
4654
|
}
|
|
4479
4655
|
}, {
|
|
4480
|
-
key: "
|
|
4656
|
+
key: "jwt",
|
|
4481
4657
|
get: function get() {
|
|
4482
|
-
return this.root.
|
|
4658
|
+
return this.root.jwt;
|
|
4483
4659
|
}
|
|
4484
4660
|
}, {
|
|
4485
|
-
key: "
|
|
4661
|
+
key: "organizationId",
|
|
4486
4662
|
get: function get() {
|
|
4487
|
-
return this.root.
|
|
4663
|
+
return this.root.organization._id;
|
|
4488
4664
|
}
|
|
4489
4665
|
}, {
|
|
4490
4666
|
key: "fetchConfiguration",
|
|
@@ -4582,7 +4758,7 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
4582
4758
|
content = _ref2.content, organizationIds = _ref2.organizationIds;
|
|
4583
4759
|
url = "".concat(this.messageService, "/mail/");
|
|
4584
4760
|
if (content.type == 'other') {
|
|
4585
|
-
kind = content.kind, content.type, rest = _objectWithoutProperties(content, _excluded$
|
|
4761
|
+
kind = content.kind, content.type, rest = _objectWithoutProperties(content, _excluded$2);
|
|
4586
4762
|
url += kind;
|
|
4587
4763
|
body = rest;
|
|
4588
4764
|
} else {
|
|
@@ -4971,7 +5147,7 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
4971
5147
|
key: "fetchProduct",
|
|
4972
5148
|
value: function () {
|
|
4973
5149
|
var _fetchProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref5) {
|
|
4974
|
-
var divaNr, variantId, variantStart, filter, response, result;
|
|
5150
|
+
var divaNr, _this$root$organizati, variantId, variantStart, filter, response, result;
|
|
4975
5151
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
4976
5152
|
while (1) switch (_context8.prev = _context8.next) {
|
|
4977
5153
|
case 0:
|
|
@@ -4983,13 +5159,13 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
4983
5159
|
variantId = divaNr.substring(variantStart + 1);
|
|
4984
5160
|
divaNr = divaNr.substring(0, variantStart);
|
|
4985
5161
|
}
|
|
4986
|
-
filter =
|
|
5162
|
+
filter = "{availableForOrganizations,eq,".concat((_this$root$organizati = this.root.organization) === null || _this$root$organizati === void 0 ? void 0 : _this$root$organizati._id, "},{divaNr,eq,") + divaNr.substring(1) + '}';
|
|
4987
5163
|
if (variantId) {
|
|
4988
5164
|
filter += ',{variantId,eq,' + variantId + '}';
|
|
4989
5165
|
}
|
|
4990
5166
|
_context8.next = 9;
|
|
4991
5167
|
return this.fetch({
|
|
4992
|
-
url: this.catalogService + '/v1/products' + '?organizationIds=' + this.
|
|
5168
|
+
url: this.catalogService + '/v1/products' + '?organizationIds=' + this.organizationId + '&limit=1' + '&sort=' + encodeURIComponent('{-created}') + '&fields=' + encodeURIComponent('{_id,organizationId,modelName}') + '&search=' + encodeURIComponent('[' + filter + ']')
|
|
4993
5169
|
});
|
|
4994
5170
|
case 9:
|
|
4995
5171
|
response = _context8.sent;
|
|
@@ -5574,22 +5750,22 @@ var OrganizationHandler = /*#__PURE__*/function () {
|
|
|
5574
5750
|
}, {
|
|
5575
5751
|
key: "organization",
|
|
5576
5752
|
get: function get() {
|
|
5577
|
-
return this.root.
|
|
5753
|
+
return this.root.organization;
|
|
5578
5754
|
}
|
|
5579
5755
|
}, {
|
|
5580
5756
|
key: "user",
|
|
5581
5757
|
get: function get() {
|
|
5582
|
-
return this.root.
|
|
5758
|
+
return this.root.user;
|
|
5583
5759
|
}
|
|
5584
5760
|
}, {
|
|
5585
5761
|
key: "allowedOrganizationTypes",
|
|
5586
5762
|
get: function get() {
|
|
5587
|
-
return this.root.
|
|
5763
|
+
return this.root.allowedOrganizationTypes;
|
|
5588
5764
|
}
|
|
5589
5765
|
}, {
|
|
5590
5766
|
key: "validOrganizations",
|
|
5591
5767
|
get: function get() {
|
|
5592
|
-
return this.root.
|
|
5768
|
+
return this.root.validOrganizations;
|
|
5593
5769
|
}
|
|
5594
5770
|
}, {
|
|
5595
5771
|
key: "getOrganizationHirachy",
|
|
@@ -5804,12 +5980,12 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
5804
5980
|
return _createClass(MediaHandler, [{
|
|
5805
5981
|
key: "mediaService",
|
|
5806
5982
|
get: function get() {
|
|
5807
|
-
return this.root.
|
|
5983
|
+
return this.root.apiConfig.mediaService;
|
|
5808
5984
|
}
|
|
5809
5985
|
}, {
|
|
5810
5986
|
key: "jwt",
|
|
5811
5987
|
get: function get() {
|
|
5812
|
-
return this.root.
|
|
5988
|
+
return this.root.jwt;
|
|
5813
5989
|
}
|
|
5814
5990
|
}, {
|
|
5815
5991
|
key: "getMediaByIds",
|
|
@@ -6305,12 +6481,12 @@ var AdminHandler = /*#__PURE__*/function () {
|
|
|
6305
6481
|
return _createClass(AdminHandler, [{
|
|
6306
6482
|
key: "adminService",
|
|
6307
6483
|
get: function get() {
|
|
6308
|
-
return this.root.
|
|
6484
|
+
return this.root.apiConfig.adminService;
|
|
6309
6485
|
}
|
|
6310
6486
|
}, {
|
|
6311
6487
|
key: "jwt",
|
|
6312
6488
|
get: function get() {
|
|
6313
|
-
return this.root.
|
|
6489
|
+
return this.root.jwt;
|
|
6314
6490
|
}
|
|
6315
6491
|
}, {
|
|
6316
6492
|
key: "getViewConfigsLoad",
|
|
@@ -6364,7 +6540,7 @@ var AdminHandler = /*#__PURE__*/function () {
|
|
|
6364
6540
|
}]);
|
|
6365
6541
|
}();
|
|
6366
6542
|
|
|
6367
|
-
var _excluded$
|
|
6543
|
+
var _excluded$1 = ["path"];
|
|
6368
6544
|
var ONE_DAY_UNIX = 86400000;
|
|
6369
6545
|
var AnalyticsHandler = /*#__PURE__*/function () {
|
|
6370
6546
|
function AnalyticsHandler(root) {
|
|
@@ -6374,12 +6550,12 @@ var AnalyticsHandler = /*#__PURE__*/function () {
|
|
|
6374
6550
|
return _createClass(AnalyticsHandler, [{
|
|
6375
6551
|
key: "analyticsService",
|
|
6376
6552
|
get: function get() {
|
|
6377
|
-
return this.root.
|
|
6553
|
+
return this.root.apiConfig.analyticsService;
|
|
6378
6554
|
}
|
|
6379
6555
|
}, {
|
|
6380
6556
|
key: "jwt",
|
|
6381
6557
|
get: function get() {
|
|
6382
|
-
return this.root.
|
|
6558
|
+
return this.root.jwt;
|
|
6383
6559
|
}
|
|
6384
6560
|
}, {
|
|
6385
6561
|
key: "getAnalyticsData",
|
|
@@ -6389,7 +6565,7 @@ var AnalyticsHandler = /*#__PURE__*/function () {
|
|
|
6389
6565
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
6390
6566
|
while (1) switch (_context.prev = _context.next) {
|
|
6391
6567
|
case 0:
|
|
6392
|
-
path = _ref.path, props = _objectWithoutProperties(_ref, _excluded$
|
|
6568
|
+
path = _ref.path, props = _objectWithoutProperties(_ref, _excluded$1);
|
|
6393
6569
|
url = new URL(this.analyticsService + path);
|
|
6394
6570
|
this.addBaseParamsToUrl(url, props);
|
|
6395
6571
|
_context.prev = 3;
|
|
@@ -6569,12 +6745,17 @@ var ReportHandler = /*#__PURE__*/function () {
|
|
|
6569
6745
|
return _createClass(ReportHandler, [{
|
|
6570
6746
|
key: "reportService",
|
|
6571
6747
|
get: function get() {
|
|
6572
|
-
return this.root.
|
|
6748
|
+
return this.root.apiConfig.reportService;
|
|
6749
|
+
}
|
|
6750
|
+
}, {
|
|
6751
|
+
key: "basketService",
|
|
6752
|
+
get: function get() {
|
|
6753
|
+
return this.root.apiConfig.basketService;
|
|
6573
6754
|
}
|
|
6574
6755
|
}, {
|
|
6575
6756
|
key: "jwt",
|
|
6576
6757
|
get: function get() {
|
|
6577
|
-
return this.root.
|
|
6758
|
+
return this.root.jwt;
|
|
6578
6759
|
}
|
|
6579
6760
|
}, {
|
|
6580
6761
|
key: "createReport",
|
|
@@ -6623,7 +6804,7 @@ var ReportHandler = /*#__PURE__*/function () {
|
|
|
6623
6804
|
op: 'replace'
|
|
6624
6805
|
}];
|
|
6625
6806
|
}
|
|
6626
|
-
fetch("".concat(this.
|
|
6807
|
+
fetch("".concat(this.basketService, "/baskets/").concat(basketId), {
|
|
6627
6808
|
method: 'PATCH',
|
|
6628
6809
|
body: JSON.stringify({
|
|
6629
6810
|
patch: patch
|
|
@@ -6712,8 +6893,8 @@ var RequestStatus = /*#__PURE__*/function (RequestStatus) {
|
|
|
6712
6893
|
return RequestStatus;
|
|
6713
6894
|
}({});
|
|
6714
6895
|
|
|
6715
|
-
function ownKeys$
|
|
6716
|
-
function _objectSpread$
|
|
6896
|
+
function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6897
|
+
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6717
6898
|
var SupportHandler = /*#__PURE__*/function () {
|
|
6718
6899
|
function SupportHandler(root) {
|
|
6719
6900
|
_classCallCheck(this, SupportHandler);
|
|
@@ -6722,12 +6903,12 @@ var SupportHandler = /*#__PURE__*/function () {
|
|
|
6722
6903
|
return _createClass(SupportHandler, [{
|
|
6723
6904
|
key: "supportService",
|
|
6724
6905
|
get: function get() {
|
|
6725
|
-
return this.root.
|
|
6906
|
+
return this.root.apiConfig.supportService;
|
|
6726
6907
|
}
|
|
6727
6908
|
}, {
|
|
6728
6909
|
key: "jwt",
|
|
6729
6910
|
get: function get() {
|
|
6730
|
-
return this.root.
|
|
6911
|
+
return this.root.jwt;
|
|
6731
6912
|
}
|
|
6732
6913
|
}, {
|
|
6733
6914
|
key: "getCometChatApiToken",
|
|
@@ -6796,7 +6977,7 @@ var SupportHandler = /*#__PURE__*/function () {
|
|
|
6796
6977
|
Authorization: 'Bearer ' + this.jwt,
|
|
6797
6978
|
'Content-Type': 'application/json'
|
|
6798
6979
|
},
|
|
6799
|
-
body: JSON.stringify(_objectSpread$
|
|
6980
|
+
body: JSON.stringify(_objectSpread$8({
|
|
6800
6981
|
divaNr: divaNr
|
|
6801
6982
|
}, participantEmail && {
|
|
6802
6983
|
participantEmail: participantEmail
|
|
@@ -7238,23 +7419,27 @@ var SupportHandler = /*#__PURE__*/function () {
|
|
|
7238
7419
|
}]);
|
|
7239
7420
|
}();
|
|
7240
7421
|
|
|
7241
|
-
var LOG$
|
|
7422
|
+
var LOG$5 = getLogger('Framework', 'AuthorizationHandler');
|
|
7242
7423
|
var AuthorizationHandler = /*#__PURE__*/function () {
|
|
7243
7424
|
function AuthorizationHandler(root) {
|
|
7244
7425
|
_classCallCheck(this, AuthorizationHandler);
|
|
7245
|
-
|
|
7246
|
-
this._root = root;
|
|
7426
|
+
this.root = root;
|
|
7247
7427
|
}
|
|
7248
7428
|
return _createClass(AuthorizationHandler, [{
|
|
7249
7429
|
key: "jwt",
|
|
7250
7430
|
get: function get() {
|
|
7251
|
-
return this.
|
|
7431
|
+
return this.root.jwt;
|
|
7252
7432
|
}
|
|
7253
7433
|
}, {
|
|
7254
7434
|
key: "userID",
|
|
7255
7435
|
get: function get() {
|
|
7256
|
-
var _this$
|
|
7257
|
-
return (_this$
|
|
7436
|
+
var _this$root$user;
|
|
7437
|
+
return (_this$root$user = this.root.user) === null || _this$root$user === void 0 ? void 0 : _this$root$user._id;
|
|
7438
|
+
}
|
|
7439
|
+
}, {
|
|
7440
|
+
key: "authService",
|
|
7441
|
+
get: function get() {
|
|
7442
|
+
return this.root.apiConfig.authService;
|
|
7258
7443
|
}
|
|
7259
7444
|
}, {
|
|
7260
7445
|
key: "setOnlineState",
|
|
@@ -7268,7 +7453,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7268
7453
|
_context.next = 12;
|
|
7269
7454
|
break;
|
|
7270
7455
|
}
|
|
7271
|
-
url = this.
|
|
7456
|
+
url = this.authService + '/users/online/' + this.userID;
|
|
7272
7457
|
requestBody = {
|
|
7273
7458
|
interval: interval
|
|
7274
7459
|
};
|
|
@@ -7285,7 +7470,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7285
7470
|
if (res.status !== 200) {
|
|
7286
7471
|
throw new Error('Error updating online state');
|
|
7287
7472
|
}
|
|
7288
|
-
LOG$
|
|
7473
|
+
LOG$5.debug('Updating online state.');
|
|
7289
7474
|
});
|
|
7290
7475
|
case 6:
|
|
7291
7476
|
_context.sent;
|
|
@@ -7294,7 +7479,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7294
7479
|
case 9:
|
|
7295
7480
|
_context.prev = 9;
|
|
7296
7481
|
_context.t0 = _context["catch"](3);
|
|
7297
|
-
LOG$
|
|
7482
|
+
LOG$5.error(new DivaError('Error updating online state', {
|
|
7298
7483
|
cause: _context.t0
|
|
7299
7484
|
}));
|
|
7300
7485
|
case 12:
|
|
@@ -7318,7 +7503,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7318
7503
|
case 0:
|
|
7319
7504
|
_context2.prev = 0;
|
|
7320
7505
|
userIdString = userIds.join(',');
|
|
7321
|
-
url = "".concat(this.
|
|
7506
|
+
url = "".concat(this.authService, "/users/online/").concat(userIdString);
|
|
7322
7507
|
_context2.next = 5;
|
|
7323
7508
|
return fetch(url, {
|
|
7324
7509
|
method: 'GET',
|
|
@@ -7368,7 +7553,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7368
7553
|
while (1) switch (_context3.prev = _context3.next) {
|
|
7369
7554
|
case 0:
|
|
7370
7555
|
organizationId = _ref.organizationId, nToken = _ref.nToken, validParents = _ref.validParents, validOrganizationTypes = _ref.validOrganizationTypes, force = _ref.force;
|
|
7371
|
-
url = new URL("".concat(this.
|
|
7556
|
+
url = new URL("".concat(this.authService, "/v2/authorization/users"));
|
|
7372
7557
|
if (organizationId) {
|
|
7373
7558
|
url.searchParams.append('organizationId', organizationId);
|
|
7374
7559
|
}
|
|
@@ -7459,7 +7644,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7459
7644
|
while (1) switch (_context4.prev = _context4.next) {
|
|
7460
7645
|
case 0:
|
|
7461
7646
|
email = _ref2.email, password = _ref2.password, name = _ref2.name, familyName = _ref2.familyName, invitationId = _ref2.invitationId, validParents = _ref2.validParents, validOrganizationTypes = _ref2.validOrganizationTypes, otp = _ref2.otp;
|
|
7462
|
-
url = "".concat(this.
|
|
7647
|
+
url = "".concat(this.authService, "/v2/authorization/users/register?invitationId=").concat(encodeURIComponent(invitationId));
|
|
7463
7648
|
_context4.next = 4;
|
|
7464
7649
|
return this.fetch({
|
|
7465
7650
|
url: url,
|
|
@@ -7538,7 +7723,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7538
7723
|
while (1) switch (_context5.prev = _context5.next) {
|
|
7539
7724
|
case 0:
|
|
7540
7725
|
organizationId = _ref3.organizationId, email = _ref3.email, password = _ref3.password, simple = _ref3.simple, validParents = _ref3.validParents, validOrganizationTypes = _ref3.validOrganizationTypes, invitationId = _ref3.invitationId, otp = _ref3.otp;
|
|
7541
|
-
url = "".concat(this.
|
|
7726
|
+
url = "".concat(this.authService, "/v2/authorization/users/login");
|
|
7542
7727
|
queryParams = [];
|
|
7543
7728
|
if (organizationId && !otp) {
|
|
7544
7729
|
queryParams.push("organizationId=".concat(organizationId));
|
|
@@ -7646,9 +7831,9 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7646
7831
|
_context6.prev = 1;
|
|
7647
7832
|
_context6.next = 4;
|
|
7648
7833
|
return this.fetch({
|
|
7649
|
-
url: "".concat(this.
|
|
7834
|
+
url: "".concat(this.authService, "/v2/authorization/users/logout?callbackUri=").concat(encodeURIComponent(callbackUri)),
|
|
7650
7835
|
method: 'POST',
|
|
7651
|
-
jwt: this.
|
|
7836
|
+
jwt: this.root.storedNToken
|
|
7652
7837
|
});
|
|
7653
7838
|
case 4:
|
|
7654
7839
|
response = _context6.sent;
|
|
@@ -7700,7 +7885,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7700
7885
|
_context7.prev = 1;
|
|
7701
7886
|
_context7.next = 4;
|
|
7702
7887
|
return this.fetch({
|
|
7703
|
-
url: "".concat(this.
|
|
7888
|
+
url: "".concat(this.authService, "/v2/provider?email=").concat(encodeURIComponent(email)),
|
|
7704
7889
|
method: 'GET',
|
|
7705
7890
|
jwt: this.jwt
|
|
7706
7891
|
});
|
|
@@ -7793,7 +7978,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7793
7978
|
while (1) switch (_context9.prev = _context9.next) {
|
|
7794
7979
|
case 0:
|
|
7795
7980
|
_context9.prev = 0;
|
|
7796
|
-
url = "".concat(this.
|
|
7981
|
+
url = "".concat(this.authService, "/invitations/").concat(value, "/").concat(what);
|
|
7797
7982
|
_context9.next = 4;
|
|
7798
7983
|
return fetch(url, {
|
|
7799
7984
|
method: 'GET',
|
|
@@ -7850,12 +8035,12 @@ var ClientArticleHandler = /*#__PURE__*/function () {
|
|
|
7850
8035
|
return _createClass(ClientArticleHandler, [{
|
|
7851
8036
|
key: "clientArticleService",
|
|
7852
8037
|
get: function get() {
|
|
7853
|
-
return this.root.
|
|
8038
|
+
return this.root.apiConfig.clientArticleService;
|
|
7854
8039
|
}
|
|
7855
8040
|
}, {
|
|
7856
8041
|
key: "jwt",
|
|
7857
8042
|
get: function get() {
|
|
7858
|
-
return this.root.
|
|
8043
|
+
return this.root.jwt;
|
|
7859
8044
|
}
|
|
7860
8045
|
}, {
|
|
7861
8046
|
key: "saveBasketProductsSMArticles",
|
|
@@ -7908,45 +8093,43 @@ var ClientArticleHandler = /*#__PURE__*/function () {
|
|
|
7908
8093
|
}]);
|
|
7909
8094
|
}();
|
|
7910
8095
|
|
|
7911
|
-
function ownKeys$
|
|
7912
|
-
function _objectSpread$
|
|
8096
|
+
function ownKeys$7(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8097
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7913
8098
|
getLogger('Framework', 'ConetentItemHandler');
|
|
7914
8099
|
var ContentItemHandler = /*#__PURE__*/function () {
|
|
7915
8100
|
function ContentItemHandler(root) {
|
|
7916
8101
|
_classCallCheck(this, ContentItemHandler);
|
|
7917
|
-
_defineProperty(this, "root", void 0);
|
|
7918
8102
|
this.root = root;
|
|
7919
8103
|
}
|
|
7920
8104
|
return _createClass(ContentItemHandler, [{
|
|
7921
8105
|
key: "catalogService",
|
|
7922
8106
|
get: function get() {
|
|
7923
|
-
return this.root.
|
|
8107
|
+
return this.root.apiConfig.catalogService;
|
|
7924
8108
|
}
|
|
7925
8109
|
}, {
|
|
7926
8110
|
key: "mediaService",
|
|
7927
8111
|
get: function get() {
|
|
7928
|
-
return this.root.
|
|
8112
|
+
return this.root.apiConfig.mediaService;
|
|
7929
8113
|
}
|
|
7930
8114
|
}, {
|
|
7931
8115
|
key: "organization",
|
|
7932
8116
|
get: function get() {
|
|
7933
|
-
return this.root.
|
|
8117
|
+
return this.root.organization;
|
|
7934
8118
|
}
|
|
7935
8119
|
}, {
|
|
7936
8120
|
key: "user",
|
|
7937
8121
|
get: function get() {
|
|
7938
|
-
return this.root.
|
|
8122
|
+
return this.root.user;
|
|
7939
8123
|
}
|
|
7940
8124
|
}, {
|
|
7941
8125
|
key: "langs",
|
|
7942
8126
|
get: function get() {
|
|
7943
|
-
|
|
7944
|
-
return (_this$root$configurat = (_this$root$configurat2 = this.root.configurationStore.locales) === null || _this$root$configurat2 === void 0 ? void 0 : _this$root$configurat2.available) !== null && _this$root$configurat !== void 0 ? _this$root$configurat : ['de'];
|
|
8127
|
+
return this.root.languages;
|
|
7945
8128
|
}
|
|
7946
8129
|
}, {
|
|
7947
8130
|
key: "jwt",
|
|
7948
8131
|
get: function get() {
|
|
7949
|
-
return this.root.
|
|
8132
|
+
return this.root.jwt;
|
|
7950
8133
|
}
|
|
7951
8134
|
}, {
|
|
7952
8135
|
key: "getContentItem",
|
|
@@ -7957,11 +8140,11 @@ var ContentItemHandler = /*#__PURE__*/function () {
|
|
|
7957
8140
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
7958
8141
|
while (1) switch (_context.prev = _context.next) {
|
|
7959
8142
|
case 0:
|
|
7960
|
-
fullUrl = this.
|
|
8143
|
+
fullUrl = this.catalogService + '/contentItems/' + id + '?language=' + lang;
|
|
7961
8144
|
_context.prev = 1;
|
|
7962
8145
|
_context.next = 4;
|
|
7963
8146
|
return axios.get(fullUrl, {
|
|
7964
|
-
headers: _objectSpread$
|
|
8147
|
+
headers: _objectSpread$7({}, this.getHeaders())
|
|
7965
8148
|
});
|
|
7966
8149
|
case 4:
|
|
7967
8150
|
res = _context.sent;
|
|
@@ -8010,12 +8193,12 @@ var ContentItemHandler = /*#__PURE__*/function () {
|
|
|
8010
8193
|
}]);
|
|
8011
8194
|
}();
|
|
8012
8195
|
|
|
8013
|
-
function ownKeys$
|
|
8014
|
-
function _objectSpread$
|
|
8196
|
+
function ownKeys$6(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8197
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8015
8198
|
var LOGINMODE_LOCALSTORAGE_KEY = 'diva-login-mode';
|
|
8016
|
-
var LOG$
|
|
8017
|
-
var
|
|
8018
|
-
function
|
|
8199
|
+
var LOG$4 = getLogger('Framework', 'root');
|
|
8200
|
+
var RootStore = /*#__PURE__*/function () {
|
|
8201
|
+
function RootStore(_ref) {
|
|
8019
8202
|
var _ref2,
|
|
8020
8203
|
_this = this;
|
|
8021
8204
|
var components = _ref.components,
|
|
@@ -8031,7 +8214,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8031
8214
|
_ref$telemetry = _ref.telemetry,
|
|
8032
8215
|
telemetry = _ref$telemetry === void 0 ? true : _ref$telemetry,
|
|
8033
8216
|
onEvent = _ref.onEvent;
|
|
8034
|
-
_classCallCheck(this,
|
|
8217
|
+
_classCallCheck(this, RootStore);
|
|
8035
8218
|
_defineProperty(this, "contentStore", void 0);
|
|
8036
8219
|
_defineProperty(this, "configurationStore", void 0);
|
|
8037
8220
|
_defineProperty(this, "dataStore", void 0);
|
|
@@ -8043,7 +8226,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8043
8226
|
_defineProperty(this, "_initializing", true);
|
|
8044
8227
|
_defineProperty(this, "_language", 'de');
|
|
8045
8228
|
_defineProperty(this, "_loginMode", (_ref2 = localStorage.getItem(LOGINMODE_LOCALSTORAGE_KEY)) !== null && _ref2 !== void 0 ? _ref2 : 'offline');
|
|
8046
|
-
_defineProperty(this, "_apiHandler",
|
|
8229
|
+
_defineProperty(this, "_apiHandler", void 0);
|
|
8047
8230
|
_defineProperty(this, "_productHandler", void 0);
|
|
8048
8231
|
_defineProperty(this, "_reportHandler", void 0);
|
|
8049
8232
|
_defineProperty(this, "_organizationHandler", void 0);
|
|
@@ -8066,16 +8249,16 @@ var _default = /*#__PURE__*/function () {
|
|
|
8066
8249
|
});
|
|
8067
8250
|
this._onEvent = onEvent;
|
|
8068
8251
|
//be compatible with the deprecated configProvider setting
|
|
8069
|
-
var apiConfig = defaultApiConfig ? _objectSpread$
|
|
8252
|
+
var apiConfig = defaultApiConfig ? _objectSpread$6({}, defaultApiConfig) : {};
|
|
8070
8253
|
!apiConfig.adminService && configProvider ? apiConfig.adminService = configProvider : false;
|
|
8071
8254
|
this.dataStore = new DataStore(this);
|
|
8072
8255
|
this.authorizationStore = new AuthorizationStore(this);
|
|
8073
8256
|
this.configurationStore = new ConfigurationStore(this, identifier, apiConfig, domain);
|
|
8074
8257
|
this.browserStateStore = new BrowserStateStore(this);
|
|
8075
|
-
this.loadingAndErrorStore = new _default
|
|
8258
|
+
this.loadingAndErrorStore = new _default(this, spinnerClass);
|
|
8076
8259
|
this.contentStore = new ContentStore(components, this);
|
|
8077
8260
|
this._apiHandler = new ApiHandler(this);
|
|
8078
|
-
this._productHandler = new ProductHandler(this);
|
|
8261
|
+
this._productHandler = new ProductHandler(this, this.contentStore.openModal.bind(this.contentStore), this.contentStore.closeModal.bind(this.contentStore));
|
|
8079
8262
|
this._reportHandler = new ReportHandler(this);
|
|
8080
8263
|
this._organizationHandler = new OrganizationHandler(this);
|
|
8081
8264
|
this._contentItemHandler = new ContentItemHandler(this);
|
|
@@ -8101,7 +8284,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8101
8284
|
if (_this.configurationStore.cacheSettings && type) {
|
|
8102
8285
|
var _this$configurationSt, _state$parameters, _state$parameters2, _state$parameters3;
|
|
8103
8286
|
var state = _this.contentStore.getState(type);
|
|
8104
|
-
LOG$
|
|
8287
|
+
LOG$4.debug('InitCache', toJS(_this.configurationStore.cacheSettings), organizationId, state);
|
|
8105
8288
|
DivaUtils.initCache({
|
|
8106
8289
|
cacheCDNUrl: (_this$configurationSt = _this.configurationStore.cacheSettings) === null || _this$configurationSt === void 0 ? void 0 : _this$configurationSt.cacheUrl,
|
|
8107
8290
|
organisationId: organizationId,
|
|
@@ -8138,14 +8321,14 @@ var _default = /*#__PURE__*/function () {
|
|
|
8138
8321
|
* Changes the current language of the application
|
|
8139
8322
|
* @param lang the new language
|
|
8140
8323
|
*/
|
|
8141
|
-
return _createClass(
|
|
8324
|
+
return _createClass(RootStore, [{
|
|
8142
8325
|
key: "changeLanguage",
|
|
8143
8326
|
value: function changeLanguage(lang) {
|
|
8144
8327
|
var _this2 = this;
|
|
8145
8328
|
this.loadingAndErrorStore.toggleLoading('language');
|
|
8146
8329
|
instance.changeLanguage(lang, function (err) {
|
|
8147
8330
|
if (err) {
|
|
8148
|
-
LOG$
|
|
8331
|
+
LOG$4.error(new DivaError('Could not change language', {
|
|
8149
8332
|
cause: err,
|
|
8150
8333
|
code: 'CORE_0007'
|
|
8151
8334
|
}));
|
|
@@ -8348,8 +8531,44 @@ var _default = /*#__PURE__*/function () {
|
|
|
8348
8531
|
}, {
|
|
8349
8532
|
key: "doShowInitWarnBanner",
|
|
8350
8533
|
get: function get() {
|
|
8351
|
-
return this.configurationStore.showInitWarnBanner;
|
|
8534
|
+
return !!this.configurationStore.showInitWarnBanner;
|
|
8535
|
+
}
|
|
8536
|
+
}, {
|
|
8537
|
+
key: "apiConfig",
|
|
8538
|
+
get: function get() {
|
|
8539
|
+
return this.configurationStore.apiConfig;
|
|
8352
8540
|
}
|
|
8541
|
+
}, {
|
|
8542
|
+
key: "jwt",
|
|
8543
|
+
get: function get() {
|
|
8544
|
+
return this.authorizationStore.zToken;
|
|
8545
|
+
}
|
|
8546
|
+
}, {
|
|
8547
|
+
key: "storedNToken",
|
|
8548
|
+
get: function get() {
|
|
8549
|
+
return this.browserStateStore.getStoredNToken();
|
|
8550
|
+
}
|
|
8551
|
+
}, {
|
|
8552
|
+
key: "user",
|
|
8553
|
+
get: function get() {
|
|
8554
|
+
return this.dataStore.user;
|
|
8555
|
+
}
|
|
8556
|
+
}, {
|
|
8557
|
+
key: "organization",
|
|
8558
|
+
get: function get() {
|
|
8559
|
+
return this.dataStore.organization;
|
|
8560
|
+
}
|
|
8561
|
+
}, {
|
|
8562
|
+
key: "allowedOrganizationTypes",
|
|
8563
|
+
get: function get() {
|
|
8564
|
+
return this.configurationStore.allowedOrganizationTypes;
|
|
8565
|
+
}
|
|
8566
|
+
}, {
|
|
8567
|
+
key: "validOrganizations",
|
|
8568
|
+
get: function get() {
|
|
8569
|
+
return this.configurationStore.validOrganizations;
|
|
8570
|
+
}
|
|
8571
|
+
|
|
8353
8572
|
/**
|
|
8354
8573
|
* Initalizes the application
|
|
8355
8574
|
*
|
|
@@ -8369,7 +8588,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8369
8588
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
8370
8589
|
while (1) switch (_context.prev = _context.next) {
|
|
8371
8590
|
case 0:
|
|
8372
|
-
LOG$
|
|
8591
|
+
LOG$4.startTransaction({
|
|
8373
8592
|
event: 'initCore',
|
|
8374
8593
|
message: 'Initalizing Core',
|
|
8375
8594
|
labels: {
|
|
@@ -8388,7 +8607,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8388
8607
|
_this4._initializing = true;
|
|
8389
8608
|
});
|
|
8390
8609
|
this.loadingAndErrorStore.toggleLoading('initalize', true);
|
|
8391
|
-
LOG$
|
|
8610
|
+
LOG$4.successTransaction('UNTIL_INIT');
|
|
8392
8611
|
_context.next = 7;
|
|
8393
8612
|
return this.browserStateStore.loadUrlState();
|
|
8394
8613
|
case 7:
|
|
@@ -8397,7 +8616,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8397
8616
|
storedOrganization = this.browserStateStore.getStoredOrganization(); //the inital state is derived in the fallowing order: component params > url > browserstore > configuration
|
|
8398
8617
|
initialOrganization = organizationId || urlState.organization || storedOrganization;
|
|
8399
8618
|
initalLanguage = language || urlState.language || storedLanguage;
|
|
8400
|
-
LOG$
|
|
8619
|
+
LOG$4.startTransaction({
|
|
8401
8620
|
event: 'onLoadConfig',
|
|
8402
8621
|
message: 'loading Config',
|
|
8403
8622
|
eventId: 'LOAD_CONFIG'
|
|
@@ -8419,15 +8638,15 @@ var _default = /*#__PURE__*/function () {
|
|
|
8419
8638
|
//open default route
|
|
8420
8639
|
this._initalComponent = this.configurationStore.defaultComponent;
|
|
8421
8640
|
}
|
|
8422
|
-
LOG$
|
|
8423
|
-
LOG$
|
|
8641
|
+
LOG$4.successTransaction('LOAD_CONFIG');
|
|
8642
|
+
LOG$4.startTransaction({
|
|
8424
8643
|
event: 'onLoadServerData',
|
|
8425
8644
|
message: 'load server data',
|
|
8426
8645
|
eventId: 'LOAD_SERVER_DATA'
|
|
8427
8646
|
});
|
|
8428
8647
|
|
|
8429
8648
|
//async load locales data
|
|
8430
|
-
initLocalesResult = init(_objectSpread$
|
|
8649
|
+
initLocalesResult = init(_objectSpread$6(_objectSpread$6({}, this.configurationStore.locales), {}, {
|
|
8431
8650
|
defaultLng: initalLanguage,
|
|
8432
8651
|
apiConfig: this.configurationStore.apiConfig
|
|
8433
8652
|
}));
|
|
@@ -8497,8 +8716,8 @@ var _default = /*#__PURE__*/function () {
|
|
|
8497
8716
|
useLocalStorage: true
|
|
8498
8717
|
});
|
|
8499
8718
|
}
|
|
8500
|
-
LOG$
|
|
8501
|
-
LOG$
|
|
8719
|
+
LOG$4.successTransaction('LOAD_SERVER_DATA');
|
|
8720
|
+
LOG$4.startTransaction({
|
|
8502
8721
|
event: 'onLoadUserData',
|
|
8503
8722
|
message: 'load user data',
|
|
8504
8723
|
eventId: 'LOAD_USER_DATA'
|
|
@@ -8516,7 +8735,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8516
8735
|
break;
|
|
8517
8736
|
case 46:
|
|
8518
8737
|
if (authObject.error) {
|
|
8519
|
-
LOG$
|
|
8738
|
+
LOG$4.errorTransaction('LOAD_USER_DATA', 'CORE_0006', authObject.error);
|
|
8520
8739
|
this.authorizationStore.showLogin(false, true);
|
|
8521
8740
|
} else {
|
|
8522
8741
|
initialOrganization = authObject.organizationId;
|
|
@@ -8528,7 +8747,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8528
8747
|
return _context.abrupt("break", 63);
|
|
8529
8748
|
case 48:
|
|
8530
8749
|
if (authObject.error) {
|
|
8531
|
-
LOG$
|
|
8750
|
+
LOG$4.errorTransaction('LOAD_USER_DATA', authObject.code, authObject.error);
|
|
8532
8751
|
this.loadingAndErrorStore.setError(authObject.error);
|
|
8533
8752
|
} else {
|
|
8534
8753
|
this.authorizationStore.showChangePassword(authObject.token);
|
|
@@ -8536,7 +8755,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8536
8755
|
return _context.abrupt("break", 63);
|
|
8537
8756
|
case 50:
|
|
8538
8757
|
if (authObject.error) {
|
|
8539
|
-
LOG$
|
|
8758
|
+
LOG$4.errorTransaction('LOAD_USER_DATA', authObject.code, authObject.error);
|
|
8540
8759
|
this.loadingAndErrorStore.setError(authObject.error);
|
|
8541
8760
|
} else {
|
|
8542
8761
|
verifyEmailToken = authObject.token;
|
|
@@ -8547,7 +8766,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8547
8766
|
_context.next = 57;
|
|
8548
8767
|
break;
|
|
8549
8768
|
}
|
|
8550
|
-
LOG$
|
|
8769
|
+
LOG$4.errorTransaction('LOAD_INVITATION', authObject.code, authObject.error);
|
|
8551
8770
|
this.loadingAndErrorStore.setError(authObject.error);
|
|
8552
8771
|
_context.next = 61;
|
|
8553
8772
|
break;
|
|
@@ -8568,7 +8787,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8568
8787
|
_context.next = 65;
|
|
8569
8788
|
break;
|
|
8570
8789
|
case 65:
|
|
8571
|
-
LOG$
|
|
8790
|
+
LOG$4.successTransaction('LOAD_USER_DATA');
|
|
8572
8791
|
if (!(!this.browserStateStore.getStoredNToken() && this.configurationStore.hasAuthentication)) {
|
|
8573
8792
|
_context.next = 80;
|
|
8574
8793
|
break;
|
|
@@ -8583,7 +8802,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8583
8802
|
_context.prev = 72;
|
|
8584
8803
|
_context.t1 = _context["catch"](67);
|
|
8585
8804
|
this.loadingAndErrorStore.setError(_context.t1);
|
|
8586
|
-
LOG$
|
|
8805
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', _context.t1.code, 'Organization Error');
|
|
8587
8806
|
return _context.abrupt("return");
|
|
8588
8807
|
case 77:
|
|
8589
8808
|
//now Login Page opens. The overwritten initComponent params get saved in restrictedComponent. this will later be evaluated in getRedirectUrl
|
|
@@ -8606,7 +8825,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8606
8825
|
case 87:
|
|
8607
8826
|
_context.prev = 87;
|
|
8608
8827
|
_context.t2 = _context["catch"](81);
|
|
8609
|
-
LOG$
|
|
8828
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0002', 'Error initializing Organization');
|
|
8610
8829
|
this.loadingAndErrorStore.setError(_context.t2, 'CORE_0002', true);
|
|
8611
8830
|
return _context.abrupt("return");
|
|
8612
8831
|
case 92:
|
|
@@ -8619,7 +8838,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8619
8838
|
case 97:
|
|
8620
8839
|
_context.prev = 97;
|
|
8621
8840
|
_context.t3 = _context["catch"](92);
|
|
8622
|
-
LOG$
|
|
8841
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0002', 'Error updating Organization');
|
|
8623
8842
|
this.loadingAndErrorStore.setError(_context.t3);
|
|
8624
8843
|
return _context.abrupt("return");
|
|
8625
8844
|
case 102:
|
|
@@ -8642,13 +8861,13 @@ var _default = /*#__PURE__*/function () {
|
|
|
8642
8861
|
_context.prev = 110;
|
|
8643
8862
|
_context.t4 = _context["catch"](40);
|
|
8644
8863
|
if (_context.t4 instanceof DivaError && _context.t4.name == 'AUTH_0006') {
|
|
8645
|
-
LOG$
|
|
8864
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', 'AUTH_0006', 'Existing verification token not valid.');
|
|
8646
8865
|
} else {
|
|
8647
|
-
LOG$
|
|
8866
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0006', 'An error occured during initialization.');
|
|
8648
8867
|
}
|
|
8649
8868
|
case 113:
|
|
8650
8869
|
this.initalizeView();
|
|
8651
|
-
LOG$
|
|
8870
|
+
LOG$4.successTransaction('INITIALIZE_CORE', {
|
|
8652
8871
|
identifier: identifier,
|
|
8653
8872
|
organizationId: this.dataStore.organizationId,
|
|
8654
8873
|
domain: domain,
|
|
@@ -8662,7 +8881,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8662
8881
|
_context.t5 = _context["catch"](1);
|
|
8663
8882
|
this.loadingAndErrorStore.toggleLoading('initalize', false);
|
|
8664
8883
|
this.loadingAndErrorStore.setError(_context.t5);
|
|
8665
|
-
LOG$
|
|
8884
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0000', _context.t5.message, {
|
|
8666
8885
|
identifier: identifier,
|
|
8667
8886
|
organizationId: this.dataStore.organizationId,
|
|
8668
8887
|
domain: domain,
|
|
@@ -8691,11 +8910,11 @@ var _default = /*#__PURE__*/function () {
|
|
|
8691
8910
|
key: "initalizeView",
|
|
8692
8911
|
value: function initalizeView() {
|
|
8693
8912
|
if (this.contentStore.currentComponent) {
|
|
8694
|
-
LOG$
|
|
8913
|
+
LOG$4.debug('View is already initialized');
|
|
8695
8914
|
return;
|
|
8696
8915
|
}
|
|
8697
8916
|
if (this._initalComponent) {
|
|
8698
|
-
LOG$
|
|
8917
|
+
LOG$4.debug("Inital component", JSON.stringify(this._initalComponent, null, 2));
|
|
8699
8918
|
this.contentStore.openComponent(this._initalComponent);
|
|
8700
8919
|
} else {
|
|
8701
8920
|
this.loadingAndErrorStore.setError(new DivaError('No inital component available', {
|
|
@@ -8714,16 +8933,16 @@ var _default = /*#__PURE__*/function () {
|
|
|
8714
8933
|
}]);
|
|
8715
8934
|
}();
|
|
8716
8935
|
|
|
8717
|
-
var _excluded
|
|
8718
|
-
function ownKeys$
|
|
8719
|
-
function _objectSpread$
|
|
8936
|
+
var _excluded = ["children"];
|
|
8937
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8938
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8720
8939
|
var coreContext = /*#__PURE__*/createContext(null);
|
|
8721
8940
|
var DivaCoreProvider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
8722
8941
|
var _store$configurationS;
|
|
8723
8942
|
var children = _ref.children,
|
|
8724
|
-
props = _objectWithoutProperties(_ref, _excluded
|
|
8943
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
8725
8944
|
var store = useMemo(function () {
|
|
8726
|
-
return new
|
|
8945
|
+
return new RootStore(props);
|
|
8727
8946
|
}, []);
|
|
8728
8947
|
useImperativeHandle(ref, function () {
|
|
8729
8948
|
return {
|
|
@@ -8779,7 +8998,7 @@ var DivaCoreProvider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
8779
8998
|
user: store.dataStore.user,
|
|
8780
8999
|
jwt: store.authorizationStore.zToken,
|
|
8781
9000
|
nToken: store.authorizationStore.nToken,
|
|
8782
|
-
navigationConfiguration: _objectSpread$
|
|
9001
|
+
navigationConfiguration: _objectSpread$5(_objectSpread$5({}, store.configurationStore.navigation), {}, {
|
|
8783
9002
|
buttons: store.contentStore.availableButtons || [],
|
|
8784
9003
|
customHeaderElement: store.contentStore.customHeaderComponent,
|
|
8785
9004
|
customLogo: store.contentStore.customLogo,
|
|
@@ -8873,7 +9092,7 @@ var DivaCoreProvider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
8873
9092
|
isMobile: store.dataStore.isMobile,
|
|
8874
9093
|
googleMapsConfig: store.configurationStore.googleMapsconfig,
|
|
8875
9094
|
cometChatConfig: store.configurationStore.cometchatConfig,
|
|
8876
|
-
navigationConfiguration: _objectSpread$
|
|
9095
|
+
navigationConfiguration: _objectSpread$5(_objectSpread$5({}, store.configurationStore.navigation), {}, {
|
|
8877
9096
|
buttons: store.contentStore.availableButtons || [],
|
|
8878
9097
|
customLogo: store.contentStore.customLogo,
|
|
8879
9098
|
customHeaderElement: store.contentStore.customHeaderComponent,
|
|
@@ -9015,7 +9234,7 @@ var DivaCoreProvider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
9015
9234
|
});
|
|
9016
9235
|
var useDivaCoreContext = function useDivaCoreContext() {
|
|
9017
9236
|
var context = React.useContext(coreContext);
|
|
9018
|
-
if (!context) {
|
|
9237
|
+
if (!(context !== null && context !== void 0 && context.store)) {
|
|
9019
9238
|
throw new Error('useDivaCoreContext must be used within a DivaCoreProvider.');
|
|
9020
9239
|
}
|
|
9021
9240
|
return context.store;
|
|
@@ -9033,7 +9252,7 @@ var loading = "loading-kAuhm";
|
|
|
9033
9252
|
var css_248z$5 = ".overlay-X3zhH {\n height: 100%;\n width: 100%;\n display: flex;\n background-color: rgba(255, 255, 255, 0.6);\n z-index: 1000;\n justify-content: center;\n align-items: center;\n position: absolute;\n}\n\n.loading-kAuhm {\n margin: 0 auto;\n display: inline-block;\n position: relative;\n width: 80px;\n height: 80px;\n}\n.loading-kAuhm div {\n box-sizing: border-box;\n display: block;\n position: absolute;\n width: 64px;\n height: 64px;\n margin: 8px;\n border: 8px solid #b6b6b6;\n border-radius: 50%;\n animation: loading-kAuhm 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: #b6b6b6 transparent transparent transparent;\n}\n.loading-kAuhm div:nth-child(1) {\n animation-delay: -0.45s;\n}\n.loading-kAuhm div:nth-child(2) {\n animation-delay: -0.3s;\n}\n.loading-kAuhm div:nth-child(3) {\n animation-delay: -0.15s;\n}\n@keyframes loading-kAuhm {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n";
|
|
9034
9253
|
styleInject(css_248z$5);
|
|
9035
9254
|
|
|
9036
|
-
var LOG$
|
|
9255
|
+
var LOG$3 = getLogger('Framework', 'loadDependency');
|
|
9037
9256
|
function loadDependency(_x) {
|
|
9038
9257
|
return _loadDependency.apply(this, arguments);
|
|
9039
9258
|
}
|
|
@@ -9074,7 +9293,7 @@ function _loadDependency() {
|
|
|
9074
9293
|
resolve(id);
|
|
9075
9294
|
};
|
|
9076
9295
|
elem.onerror = function (e) {
|
|
9077
|
-
LOG$
|
|
9296
|
+
LOG$3.error(new DivaError('Failed to load dependency: ' + type, {
|
|
9078
9297
|
cause: e
|
|
9079
9298
|
}));
|
|
9080
9299
|
resolve(id);
|
|
@@ -9148,22 +9367,10 @@ function Spinner() {
|
|
|
9148
9367
|
}
|
|
9149
9368
|
var Spinner$1 = observer(Spinner);
|
|
9150
9369
|
|
|
9151
|
-
function Fallback () {
|
|
9152
|
-
var _useDivaCoreContext = useDivaCoreContext(),
|
|
9153
|
-
loadingAndErrorStore = _useDivaCoreContext.loadingAndErrorStore;
|
|
9154
|
-
useEffect(function () {
|
|
9155
|
-
loadingAndErrorStore.toggleLoading('Fallback');
|
|
9156
|
-
return function () {
|
|
9157
|
-
return loadingAndErrorStore.toggleLoading('Fallback');
|
|
9158
|
-
};
|
|
9159
|
-
}, []);
|
|
9160
|
-
return /*#__PURE__*/jsx(Fragment, {});
|
|
9161
|
-
}
|
|
9162
|
-
|
|
9163
9370
|
var overlay = "overlay-34l68";
|
|
9164
9371
|
var absoluteOverlay = "absolute-overlay-cG7uO";
|
|
9165
9372
|
var closeIcon$1 = "close-icon-1kDyU";
|
|
9166
|
-
var css_248z$4 = ".overlay-34l68 {\n height: 100%;\n width: 100%;\n display: flex;\n background-color: #fff;\n z-index: 999;\n justify-content: center;\n align-items: center;\n position: absolute;\n}\n\n.absolute-overlay-cG7uO {\n background-color: #fff;\n position: fixed;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n overflow: hidden;\n z-index: 1000000;\n display: block;\n width: 100vw;\n
|
|
9373
|
+
var css_248z$4 = ".overlay-34l68 {\n height: 100%;\n width: 100%;\n display: flex;\n background-color: #fff;\n z-index: 999;\n justify-content: center;\n align-items: center;\n position: absolute;\n}\n\n#DivaCore.absolute-overlay-cG7uO {\n height: 100% !important;\n}\n\n#DivaCore.absolute-overlay-cG7uO {\n background-color: #fff;\n position: fixed;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n overflow: hidden;\n z-index: 1000000;\n display: block;\n width: 100vw;\n}\n\n.diva-pseudo-fullscreen body {\n height: auto !important;\n}\n.diva-pseudo-fullscreen, .diva-pseudo-fullscreen body {\n overflow: hidden !important;\n}\n\n.close-icon-1kDyU {\n position: absolute;\n right: 32px;\n top: 32px;\n width: 50px;\n height: 40px;\n opacity: 0.3;\n z-index: 700;\n cursor: pointer;\n}\n\n.close-icon-1kDyU:before {\n transform: rotate(45deg);\n}\n\n.close-icon-1kDyU:after {\n transform: rotate(-45deg);\n}\n\n.close-icon-1kDyU:before,\n.close-icon-1kDyU:after {\n position: absolute;\n left: 23px;\n top: 5px;\n content: ' ';\n height: 33px;\n width: 3px;\n background-color: #4b4b4b;\n}\n\n.close-icon-1kDyU:hover {\n opacity: 0.8;\n transition: opacity 0.2s ease-in-out;\n}\n";
|
|
9167
9374
|
styleInject(css_248z$4);
|
|
9168
9375
|
|
|
9169
9376
|
var sideMenu = "side-menu-2Fgdm";
|
|
@@ -9180,8 +9387,8 @@ var mobileBcGroup = "mobile-bc-group-6v8wI";
|
|
|
9180
9387
|
var css_248z$3 = ".side-menu-2Fgdm {\n width: 100%;\n max-width: 400px;\n height: 100%;\n background-color: #f2f2f2;\n position: absolute;\n bottom: 0;\n transition: transform 0.3s cubic-bezier(0, 0.52, 0, 1);\n box-sizing: border-box;\n}\n\n.left-side-menu-L42L3 {\n left: 0px;\n}\n\n.right-side-menu-Akk-Y {\n right: 0px;\n}\n\n.wrapper-jJaXo {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n\n.scroller-ZnoJy {\n height: 100%;\n}\n\n.title-WOjYJ {\n font-size: 22px;\n margin: 20px;\n}\n\n.hide-left-4bzTL {\n transform: translate(-960px, 0);\n}\n.hide-right-IOmlC {\n transform: translate(960px, 0);\n}\n\n.show-Z8M2h {\n transform: translate(0, 0);\n overflow: hidden;\n}\n\n.close-icon-NJkeP {\n position: absolute;\n top: 16px;\n right: 16px;\n opacity: 0.3;\n width: 32px;\n height: 32px;\n z-index: 300;\n width: 50px;\n height: 40px;\n cursor: pointer;\n}\n\n.close-icon-NJkeP:before {\n transform: rotate(45deg);\n}\n\n.close-icon-NJkeP:after {\n transform: rotate(-45deg);\n}\n\n.close-icon-NJkeP:before,\n.close-icon-NJkeP:after {\n position: absolute;\n right: 15px;\n content: ' ';\n height: 33px;\n width: 3px;\n background-color: #4b4b4b;\n}\n\n.close-icon-NJkeP:hover {\n opacity: 0.8;\n transition: opacity 0.2s ease-in-out;\n}\n\n.mobile-bc-group-6v8wI {\n display: flex;\n border-top: 0.8px solid #b6b6b7;\n padding: 12px 16px;\n border-bottom: 0.8px solid #b6b6b7;\n margin-top: 40px;\n overflow: auto;\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n}\n\n.mobile-bc-group-6v8wI::-webkit-scrollbar {\n display: none;\n}\n";
|
|
9181
9388
|
styleInject(css_248z$3);
|
|
9182
9389
|
|
|
9183
|
-
function ownKeys$
|
|
9184
|
-
function _objectSpread$
|
|
9390
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9391
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9185
9392
|
var SideMenu = function SideMenu() {
|
|
9186
9393
|
var _contentStore$sideMen, _contentStore$sideMen5, _contentStore$sideMen6, _contentStore$headerI, _contentStore$headerI2, _contentStore$sideMen7, _contentStore$sideMen8, _contentStore$sideMen9, _contentStore$sideMen10;
|
|
9187
9394
|
var _useDivaCoreContext = useDivaCoreContext(),
|
|
@@ -9215,8 +9422,8 @@ var SideMenu = function SideMenu() {
|
|
|
9215
9422
|
var hide = ((_contentStore$sideMen6 = contentStore.sideMenu) === null || _contentStore$sideMen6 === void 0 ? void 0 : _contentStore$sideMen6.side) == 'right' ? hideRight : hideLeft;
|
|
9216
9423
|
if (!contentStore.sideMenu) return /*#__PURE__*/jsx(Fragment, {});
|
|
9217
9424
|
var height = (_contentStore$headerI = (_contentStore$headerI2 = contentStore.headerInfos.HeaderElement) === null || _contentStore$headerI2 === void 0 ? void 0 : _contentStore$headerI2.getBoundingClientRect().height) !== null && _contentStore$headerI !== void 0 ? _contentStore$headerI : 0;
|
|
9218
|
-
return /*#__PURE__*/jsxs("div", _objectSpread$
|
|
9219
|
-
style: _objectSpread$
|
|
9425
|
+
return /*#__PURE__*/jsxs("div", _objectSpread$4(_objectSpread$4({}, swipeHandler), {}, {
|
|
9426
|
+
style: _objectSpread$4(_objectSpread$4({}, contentStore.sideMenu.style), {}, {
|
|
9220
9427
|
width: hiddenDelayed ? '0px' : undefined,
|
|
9221
9428
|
backgroundColor: contentStore.sideMenu.backgroundColor,
|
|
9222
9429
|
height: (_contentStore$sideMen7 = contentStore.sideMenu) !== null && _contentStore$sideMen7 !== void 0 && _contentStore$sideMen7.showCoreHeader ? 'calc(100% - ' + height + 'px)' : undefined,
|
|
@@ -9241,10 +9448,10 @@ var SideMenu = function SideMenu() {
|
|
|
9241
9448
|
};
|
|
9242
9449
|
var SideMenu$1 = observer(SideMenu);
|
|
9243
9450
|
|
|
9244
|
-
function ownKeys$
|
|
9245
|
-
function _objectSpread$
|
|
9451
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9452
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9246
9453
|
var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
|
|
9247
|
-
return import('./ModalsWrapper-
|
|
9454
|
+
return import('./ModalsWrapper-ca9b239c.js');
|
|
9248
9455
|
});
|
|
9249
9456
|
function Fullscreen() {
|
|
9250
9457
|
var _useDivaCoreContext = useDivaCoreContext(),
|
|
@@ -9339,7 +9546,7 @@ function Fullscreen() {
|
|
|
9339
9546
|
style: isMobile ? (_c$state$absoluteFull = c.state.absoluteFullscreenStyle) === null || _c$state$absoluteFull === void 0 ? void 0 : _c$state$absoluteFull.mobile : (_c$state$absoluteFull2 = c.state.absoluteFullscreenStyle) === null || _c$state$absoluteFull2 === void 0 ? void 0 : _c$state$absoluteFull2.desktop,
|
|
9340
9547
|
children: [/*#__PURE__*/jsx(Spinner$1, {}), /*#__PURE__*/jsx(SideMenu$1, {}), configurationStore.enableModals && /*#__PURE__*/jsx(LazyModals$1, {}), /*#__PURE__*/jsx(Suspense, {
|
|
9341
9548
|
fallback: /*#__PURE__*/jsx(Fallback, {}),
|
|
9342
|
-
children: /*#__PURE__*/jsx(C, _objectSpread$
|
|
9549
|
+
children: /*#__PURE__*/jsx(C, _objectSpread$3({}, c.state))
|
|
9343
9550
|
})]
|
|
9344
9551
|
});
|
|
9345
9552
|
}
|
|
@@ -9687,19 +9894,19 @@ function BigSnackBarComponent(_ref2) {
|
|
|
9687
9894
|
}
|
|
9688
9895
|
var SnackBar = observer(DivaSnackBar);
|
|
9689
9896
|
|
|
9690
|
-
function ownKeys$
|
|
9691
|
-
function _objectSpread$
|
|
9692
|
-
var LOG$
|
|
9897
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9898
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9899
|
+
var LOG$2 = getLogger('Framework', 'Root');
|
|
9693
9900
|
var LazyAuth = /*#__PURE__*/React.lazy(function () {
|
|
9694
|
-
return import('./index-
|
|
9901
|
+
return import('./index-6e70e7f8.js');
|
|
9695
9902
|
});
|
|
9696
9903
|
var LazyModals = /*#__PURE__*/React.lazy(function () {
|
|
9697
|
-
return import('./ModalsWrapper-
|
|
9904
|
+
return import('./ModalsWrapper-ca9b239c.js');
|
|
9698
9905
|
});
|
|
9699
|
-
function
|
|
9906
|
+
function ContentComponent() {
|
|
9700
9907
|
var context = useDivaCoreContext();
|
|
9701
9908
|
useEffect(function () {
|
|
9702
|
-
LOG$
|
|
9909
|
+
LOG$2.debug('Initial render of content wrapper');
|
|
9703
9910
|
}, []);
|
|
9704
9911
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
9705
9912
|
children: [/*#__PURE__*/jsxs(Suspense, {
|
|
@@ -9726,114 +9933,23 @@ function Content() {
|
|
|
9726
9933
|
},
|
|
9727
9934
|
children: /*#__PURE__*/jsx(Suspense, {
|
|
9728
9935
|
fallback: /*#__PURE__*/jsx(Fallback, {}),
|
|
9729
|
-
children: /*#__PURE__*/jsx(C, _objectSpread$
|
|
9936
|
+
children: /*#__PURE__*/jsx(C, _objectSpread$2({}, context.contentStore.getState(c.name)))
|
|
9730
9937
|
})
|
|
9731
9938
|
}, c.name);
|
|
9732
9939
|
})]
|
|
9733
9940
|
})]
|
|
9734
9941
|
});
|
|
9735
9942
|
}
|
|
9736
|
-
var Content
|
|
9737
|
-
|
|
9738
|
-
function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9739
|
-
function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9740
|
-
var LOG$3 = getLogger('Framework', 'root');
|
|
9741
|
-
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
9742
|
-
function ErrorBoundary(props) {
|
|
9743
|
-
var _this;
|
|
9744
|
-
_classCallCheck(this, ErrorBoundary);
|
|
9745
|
-
_this = _callSuper$1(this, ErrorBoundary, [props]);
|
|
9746
|
-
_defineProperty(_this, "root", void 0);
|
|
9747
|
-
_this.root = props.root;
|
|
9748
|
-
return _this;
|
|
9749
|
-
}
|
|
9750
|
-
_inherits(ErrorBoundary, _React$Component);
|
|
9751
|
-
return _createClass(ErrorBoundary, [{
|
|
9752
|
-
key: "componentDidCatch",
|
|
9753
|
-
value: function componentDidCatch(error) {
|
|
9754
|
-
LOG$3.error(new DivaError('Error while rendring in Core', {
|
|
9755
|
-
cause: error,
|
|
9756
|
-
custom: {
|
|
9757
|
-
code: 'CORE_0000'
|
|
9758
|
-
}
|
|
9759
|
-
}));
|
|
9760
|
-
this.root.loadingAndErrorStore.setError(error.message);
|
|
9761
|
-
}
|
|
9762
|
-
}, {
|
|
9763
|
-
key: "render",
|
|
9764
|
-
value: function render() {
|
|
9765
|
-
return this.props.children;
|
|
9766
|
-
}
|
|
9767
|
-
}], [{
|
|
9768
|
-
key: "getDerivedStateFromError",
|
|
9769
|
-
value: function getDerivedStateFromError() {
|
|
9770
|
-
// just to prevent warning
|
|
9771
|
-
return {};
|
|
9772
|
-
}
|
|
9773
|
-
}]);
|
|
9774
|
-
}(React.Component);
|
|
9775
|
-
|
|
9776
|
-
var _excluded = ["children"];
|
|
9777
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9778
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9779
|
-
var LOG$2 = getLogger('Framework', 'root');
|
|
9780
|
-
var DivaCore = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
9781
|
-
var children = _ref.children,
|
|
9782
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
9783
|
-
useEffect(function () {
|
|
9784
|
-
LOG$2.successTransaction('UNTIL_RENDER');
|
|
9785
|
-
}, []);
|
|
9786
|
-
return /*#__PURE__*/jsx(DivaCoreProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
9787
|
-
ref: ref,
|
|
9788
|
-
children: /*#__PURE__*/jsx(ContentWrapper, {
|
|
9789
|
-
children: /*#__PURE__*/jsx(Fragment, {
|
|
9790
|
-
children: children !== null && children !== void 0 ? children : /*#__PURE__*/jsx(Content$1, {})
|
|
9791
|
-
})
|
|
9792
|
-
})
|
|
9793
|
-
}));
|
|
9794
|
-
});
|
|
9795
|
-
var ContentWrapper = observer(function (_ref2) {
|
|
9796
|
-
var children = _ref2.children;
|
|
9797
|
-
var ref = useRef(null);
|
|
9798
|
-
var context = useDivaCoreContext();
|
|
9799
|
-
useEffect(function () {
|
|
9800
|
-
if (ref.current) context.contentStore.setContainer(ref.current);
|
|
9801
|
-
}, [ref.current]);
|
|
9802
|
-
return /*#__PURE__*/jsx(StylesProvider, {
|
|
9803
|
-
injectFirst: true,
|
|
9804
|
-
children: /*#__PURE__*/jsx("div", {
|
|
9805
|
-
ref: ref,
|
|
9806
|
-
id: "DivaCore",
|
|
9807
|
-
style: {
|
|
9808
|
-
position: 'relative',
|
|
9809
|
-
height: '100%',
|
|
9810
|
-
overflow: 'hidden'
|
|
9811
|
-
},
|
|
9812
|
-
children: /*#__PURE__*/jsx(I18nextProvider, {
|
|
9813
|
-
i18n: instance,
|
|
9814
|
-
children: /*#__PURE__*/jsx(ErrorBoundary, {
|
|
9815
|
-
root: context,
|
|
9816
|
-
children: /*#__PURE__*/jsx(MuiThemeProvider, {
|
|
9817
|
-
theme: context.contentStore.materialUiTheme,
|
|
9818
|
-
children: /*#__PURE__*/jsx(Suspense, {
|
|
9819
|
-
fallback: /*#__PURE__*/jsx(Fallback, {}),
|
|
9820
|
-
children: children
|
|
9821
|
-
})
|
|
9822
|
-
})
|
|
9823
|
-
})
|
|
9824
|
-
})
|
|
9825
|
-
})
|
|
9826
|
-
});
|
|
9827
|
-
});
|
|
9943
|
+
var Content = observer(ContentComponent);
|
|
9828
9944
|
|
|
9829
9945
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9830
9946
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9831
9947
|
var LOG$1 = getLogger('Framework', 'ProductHandler');
|
|
9832
9948
|
var ProductHandler = /*#__PURE__*/function (_ProductHandlerAbstra) {
|
|
9833
|
-
function ProductHandler(root) {
|
|
9949
|
+
function ProductHandler(root, openModal, closeModal) {
|
|
9834
9950
|
var _this;
|
|
9835
9951
|
_classCallCheck(this, ProductHandler);
|
|
9836
|
-
_this = _callSuper(this, ProductHandler, [LOG$1, root.t,
|
|
9952
|
+
_this = _callSuper(this, ProductHandler, [LOG$1, root.t, openModal, closeModal]);
|
|
9837
9953
|
_this.root = root;
|
|
9838
9954
|
return _this;
|
|
9839
9955
|
}
|
|
@@ -9841,33 +9957,32 @@ var ProductHandler = /*#__PURE__*/function (_ProductHandlerAbstra) {
|
|
|
9841
9957
|
return _createClass(ProductHandler, [{
|
|
9842
9958
|
key: "catalogService",
|
|
9843
9959
|
get: function get() {
|
|
9844
|
-
return this.root.
|
|
9960
|
+
return this.root.apiConfig.catalogService;
|
|
9845
9961
|
}
|
|
9846
9962
|
}, {
|
|
9847
9963
|
key: "mediaService",
|
|
9848
9964
|
get: function get() {
|
|
9849
|
-
return this.root.
|
|
9965
|
+
return this.root.apiConfig.mediaService;
|
|
9850
9966
|
}
|
|
9851
9967
|
}, {
|
|
9852
9968
|
key: "organization",
|
|
9853
9969
|
get: function get() {
|
|
9854
|
-
return this.root.
|
|
9970
|
+
return this.root.organization;
|
|
9855
9971
|
}
|
|
9856
9972
|
}, {
|
|
9857
9973
|
key: "user",
|
|
9858
9974
|
get: function get() {
|
|
9859
|
-
return this.root.
|
|
9975
|
+
return this.root.user;
|
|
9860
9976
|
}
|
|
9861
9977
|
}, {
|
|
9862
9978
|
key: "langs",
|
|
9863
9979
|
get: function get() {
|
|
9864
|
-
|
|
9865
|
-
return (_this$root$configurat = (_this$root$configurat2 = this.root.configurationStore.locales) === null || _this$root$configurat2 === void 0 ? void 0 : _this$root$configurat2.available) !== null && _this$root$configurat !== void 0 ? _this$root$configurat : ['de'];
|
|
9980
|
+
return this.root.languages;
|
|
9866
9981
|
}
|
|
9867
9982
|
}, {
|
|
9868
9983
|
key: "jwt",
|
|
9869
9984
|
get: function get() {
|
|
9870
|
-
return this.root.
|
|
9985
|
+
return this.root.jwt;
|
|
9871
9986
|
}
|
|
9872
9987
|
}, {
|
|
9873
9988
|
key: "saveProductMedia",
|
|
@@ -9939,6 +10054,668 @@ function HelpButton(_ref) {
|
|
|
9939
10054
|
});
|
|
9940
10055
|
}
|
|
9941
10056
|
|
|
10057
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10058
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10059
|
+
var actionFunctions = ['openComponent', 'closeComponentInFullscreen', 'setAbsoluteFullScreen', 'updateBreadcrumbs', 'openModal', 'closeModal', 'sendEmail', 'updateCustomLogo', 'updateCustomHeaderElement', 'toggleHidePrices', 'toggleLoading', 'changeLanguage', 'changeLoginMode', 'onEvent', 'subscribeEvents', 'unSubscribeEvents', 'setOrganization', 'getSessionGuid', 'getApi2AuthLoginData', 'logout', 'showLoginWindow', 'userHasPermission', 'openFullscreen', 'closeFullscreen', 'openSideMenu', 'closeSideMenu', 'openBarrier', 'updateHeaderInfos', 'openBanner', 'closeBanner', 'resolveComponent', 'openSnackBar', 'setComponentChange'];
|
|
10060
|
+
function getRender(C) {
|
|
10061
|
+
return function (args) {
|
|
10062
|
+
return /*#__PURE__*/jsx(DivaMockProvider, {
|
|
10063
|
+
state: args.state,
|
|
10064
|
+
actions: actions.apply(void 0, actionFunctions),
|
|
10065
|
+
children: /*#__PURE__*/jsx(C, _objectSpread$1({}, args))
|
|
10066
|
+
});
|
|
10067
|
+
};
|
|
10068
|
+
}
|
|
10069
|
+
var argTypes = {
|
|
10070
|
+
divaParams: {
|
|
10071
|
+
control: {
|
|
10072
|
+
name: 'Overwrite Diva State',
|
|
10073
|
+
control: 'object'
|
|
10074
|
+
}
|
|
10075
|
+
}
|
|
10076
|
+
};
|
|
10077
|
+
var storyBookCoreMock = {
|
|
10078
|
+
getRender: getRender,
|
|
10079
|
+
argTypes: argTypes
|
|
10080
|
+
};
|
|
10081
|
+
|
|
10082
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10083
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10084
|
+
var DivaMockProvider = observer(function (_ref) {
|
|
10085
|
+
var children = _ref.children,
|
|
10086
|
+
state = _ref.state,
|
|
10087
|
+
actions = _ref.actions;
|
|
10088
|
+
var _React$useState = React.useState(false),
|
|
10089
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10090
|
+
initalized = _React$useState2[0],
|
|
10091
|
+
setInitalized = _React$useState2[1];
|
|
10092
|
+
var _useState = useState(null),
|
|
10093
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10094
|
+
store = _useState2[0],
|
|
10095
|
+
setStore = _useState2[1];
|
|
10096
|
+
var _useState3 = useState(null),
|
|
10097
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
10098
|
+
resizeObserver = _useState4[0],
|
|
10099
|
+
setResizeObserver = _useState4[1];
|
|
10100
|
+
var ref = useCallback(function (node) {
|
|
10101
|
+
if (node !== null) {
|
|
10102
|
+
var newStore = new MockedRootStore(state, actions, node, function () {
|
|
10103
|
+
return setInitalized(true);
|
|
10104
|
+
});
|
|
10105
|
+
setStore(newStore);
|
|
10106
|
+
if (resizeObserver) {
|
|
10107
|
+
resizeObserver.disconnect();
|
|
10108
|
+
}
|
|
10109
|
+
registerResizeObserver(node, newStore.onResize.bind(newStore)).then(function (observer) {
|
|
10110
|
+
setResizeObserver(observer);
|
|
10111
|
+
});
|
|
10112
|
+
}
|
|
10113
|
+
}, [state, actions]);
|
|
10114
|
+
var isMobile = !!(store !== null && store !== void 0 && store.dimensions.isMobile);
|
|
10115
|
+
var isPortrait = !!(store !== null && store !== void 0 && store.dimensions.isPortrait);
|
|
10116
|
+
return /*#__PURE__*/jsxs("div", {
|
|
10117
|
+
ref: ref,
|
|
10118
|
+
id: "DivaCore",
|
|
10119
|
+
style: {
|
|
10120
|
+
position: 'relative',
|
|
10121
|
+
height: '100%',
|
|
10122
|
+
overflow: 'hidden'
|
|
10123
|
+
},
|
|
10124
|
+
className: (isPortrait ? ' portrait' : '') + (isMobile ? ' mobile' : '') + (isMobile && !isPortrait ? ' landscape' : ''),
|
|
10125
|
+
children: [initalized && !!store && /*#__PURE__*/jsx(coreContext.Provider, {
|
|
10126
|
+
value: {
|
|
10127
|
+
context: store.state
|
|
10128
|
+
},
|
|
10129
|
+
children: /*#__PURE__*/jsx(I18nextProvider, {
|
|
10130
|
+
i18n: instance,
|
|
10131
|
+
children: /*#__PURE__*/jsx(Suspense, {
|
|
10132
|
+
fallback: /*#__PURE__*/jsx("div", {
|
|
10133
|
+
children: "Loading..."
|
|
10134
|
+
}),
|
|
10135
|
+
children: children
|
|
10136
|
+
})
|
|
10137
|
+
})
|
|
10138
|
+
}), (!initalized || !store) && /*#__PURE__*/jsx("div", {
|
|
10139
|
+
children: "Loading..."
|
|
10140
|
+
})]
|
|
10141
|
+
});
|
|
10142
|
+
});
|
|
10143
|
+
var MockedRootStore = /*#__PURE__*/function () {
|
|
10144
|
+
function MockedRootStore() {
|
|
10145
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10146
|
+
var actions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10147
|
+
var container = arguments.length > 2 ? arguments[2] : undefined;
|
|
10148
|
+
var initalized = arguments.length > 3 ? arguments[3] : undefined;
|
|
10149
|
+
_classCallCheck(this, MockedRootStore);
|
|
10150
|
+
this.data = data;
|
|
10151
|
+
this.actions = actions;
|
|
10152
|
+
this.container = container;
|
|
10153
|
+
this.initalized = initalized;
|
|
10154
|
+
_defineProperty(this, "handlers", void 0);
|
|
10155
|
+
_defineProperty(this, "_apiHandler", void 0);
|
|
10156
|
+
_defineProperty(this, "_dimensions", {
|
|
10157
|
+
isMobile: false,
|
|
10158
|
+
isPortrait: false,
|
|
10159
|
+
isTablet: false,
|
|
10160
|
+
width: 0,
|
|
10161
|
+
height: 0
|
|
10162
|
+
});
|
|
10163
|
+
_defineProperty(this, "_language", 'de');
|
|
10164
|
+
_defineProperty(this, "t", instance.t.bind(instance));
|
|
10165
|
+
this._apiHandler = new ApiHandler(this);
|
|
10166
|
+
this.handlers = mockCoreHandlers(this);
|
|
10167
|
+
this.initialize();
|
|
10168
|
+
makeObservable(this, {
|
|
10169
|
+
dimensions: computed,
|
|
10170
|
+
_dimensions: observable.shallow,
|
|
10171
|
+
onResize: action
|
|
10172
|
+
});
|
|
10173
|
+
}
|
|
10174
|
+
return _createClass(MockedRootStore, [{
|
|
10175
|
+
key: "onResize",
|
|
10176
|
+
value: function onResize(width, height) {
|
|
10177
|
+
this._dimensions = calculateDimensions(width, height);
|
|
10178
|
+
console.log('new dimensions', this._dimensions);
|
|
10179
|
+
}
|
|
10180
|
+
}, {
|
|
10181
|
+
key: "initialize",
|
|
10182
|
+
value: function () {
|
|
10183
|
+
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
10184
|
+
var _this$data$language;
|
|
10185
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
10186
|
+
while (1) switch (_context.prev = _context.next) {
|
|
10187
|
+
case 0:
|
|
10188
|
+
if (this.data.priceFormat) DivaUtils.initPriceFormat(this.data.priceFormat);
|
|
10189
|
+
updateCssThemeVariables(this.container, this.theme);
|
|
10190
|
+
_context.next = 4;
|
|
10191
|
+
return init(_objectSpread(_objectSpread({}, this.data.locales), {}, {
|
|
10192
|
+
apiConfig: this.apiConfig,
|
|
10193
|
+
defaultLng: (_this$data$language = this.data.language) !== null && _this$data$language !== void 0 ? _this$data$language : this.language
|
|
10194
|
+
}));
|
|
10195
|
+
case 4:
|
|
10196
|
+
this._language = _context.sent;
|
|
10197
|
+
this.initalized();
|
|
10198
|
+
case 6:
|
|
10199
|
+
case "end":
|
|
10200
|
+
return _context.stop();
|
|
10201
|
+
}
|
|
10202
|
+
}, _callee, this);
|
|
10203
|
+
}));
|
|
10204
|
+
function initialize() {
|
|
10205
|
+
return _initialize.apply(this, arguments);
|
|
10206
|
+
}
|
|
10207
|
+
return initialize;
|
|
10208
|
+
}()
|
|
10209
|
+
}, {
|
|
10210
|
+
key: "changeLanguage",
|
|
10211
|
+
value: function changeLanguage(lang) {
|
|
10212
|
+
var _this = this;
|
|
10213
|
+
instance.changeLanguage(lang, function (err) {
|
|
10214
|
+
if (err) {
|
|
10215
|
+
throw new Error('Could not change language', {
|
|
10216
|
+
cause: err
|
|
10217
|
+
});
|
|
10218
|
+
} else {
|
|
10219
|
+
_this._language = lang;
|
|
10220
|
+
}
|
|
10221
|
+
});
|
|
10222
|
+
}
|
|
10223
|
+
}, {
|
|
10224
|
+
key: "changeLoginMode",
|
|
10225
|
+
value: function changeLoginMode(loginMode) {
|
|
10226
|
+
if (this.actions.changeLoginMode) {
|
|
10227
|
+
this.actions.changeLoginMode(loginMode);
|
|
10228
|
+
} else {
|
|
10229
|
+
throw new Error('Method not implemented.');
|
|
10230
|
+
}
|
|
10231
|
+
}
|
|
10232
|
+
}, {
|
|
10233
|
+
key: "onExternalEvent",
|
|
10234
|
+
value: function onExternalEvent(event) {
|
|
10235
|
+
if (this.actions.onEvent) {
|
|
10236
|
+
this.actions.onEvent(event);
|
|
10237
|
+
} else {
|
|
10238
|
+
throw new Error('Method not implemented.');
|
|
10239
|
+
}
|
|
10240
|
+
}
|
|
10241
|
+
}, {
|
|
10242
|
+
key: "subscribeEvents",
|
|
10243
|
+
value: function subscribeEvents(fn) {
|
|
10244
|
+
if (this.actions.subscribeEvents) {
|
|
10245
|
+
this.actions.subscribeEvents(fn);
|
|
10246
|
+
} else {
|
|
10247
|
+
throw new Error('Method not implemented.');
|
|
10248
|
+
}
|
|
10249
|
+
}
|
|
10250
|
+
}, {
|
|
10251
|
+
key: "unSubscribeEvents",
|
|
10252
|
+
value: function unSubscribeEvents(fn) {
|
|
10253
|
+
if (this.actions.unSubscribeEvents) {
|
|
10254
|
+
this.actions.unSubscribeEvents(fn);
|
|
10255
|
+
} else {
|
|
10256
|
+
throw new Error('Method not implemented.');
|
|
10257
|
+
}
|
|
10258
|
+
}
|
|
10259
|
+
}, {
|
|
10260
|
+
key: "onEvent",
|
|
10261
|
+
value: function onEvent(event) {
|
|
10262
|
+
if (this.actions.onEvent) {
|
|
10263
|
+
this.actions.onEvent(event);
|
|
10264
|
+
} else {
|
|
10265
|
+
throw new Error('Method not implemented.');
|
|
10266
|
+
}
|
|
10267
|
+
}
|
|
10268
|
+
}, {
|
|
10269
|
+
key: "language",
|
|
10270
|
+
get: function get() {
|
|
10271
|
+
return this._language;
|
|
10272
|
+
}
|
|
10273
|
+
}, {
|
|
10274
|
+
key: "loginMode",
|
|
10275
|
+
get: function get() {
|
|
10276
|
+
var _this$data$loginMode;
|
|
10277
|
+
return (_this$data$loginMode = this.data.loginMode) !== null && _this$data$loginMode !== void 0 ? _this$data$loginMode : 'offline';
|
|
10278
|
+
}
|
|
10279
|
+
}, {
|
|
10280
|
+
key: "languages",
|
|
10281
|
+
get: function get() {
|
|
10282
|
+
var _this$data$availableL;
|
|
10283
|
+
return (_this$data$availableL = this.data.availableLanguages) !== null && _this$data$availableL !== void 0 ? _this$data$availableL : ['de', 'en', 'fr', 'it'];
|
|
10284
|
+
}
|
|
10285
|
+
}, {
|
|
10286
|
+
key: "initializing",
|
|
10287
|
+
get: function get() {
|
|
10288
|
+
var _this$data$initializi;
|
|
10289
|
+
return (_this$data$initializi = this.data.initializing) !== null && _this$data$initializi !== void 0 ? _this$data$initializi : false;
|
|
10290
|
+
}
|
|
10291
|
+
}, {
|
|
10292
|
+
key: "aviailableComponents",
|
|
10293
|
+
get: function get() {
|
|
10294
|
+
var _this$data$availableC;
|
|
10295
|
+
return (_this$data$availableC = this.data.availableComponents) !== null && _this$data$availableC !== void 0 ? _this$data$availableC : [];
|
|
10296
|
+
}
|
|
10297
|
+
}, {
|
|
10298
|
+
key: "apiConfig",
|
|
10299
|
+
get: function get() {
|
|
10300
|
+
return parseApiConfig(this.data.apiConfig, {
|
|
10301
|
+
baseUrl: 'https://api-dev.diva-portal.com'
|
|
10302
|
+
}, this.organization);
|
|
10303
|
+
}
|
|
10304
|
+
}, {
|
|
10305
|
+
key: "navigationConfiguration",
|
|
10306
|
+
get: function get() {
|
|
10307
|
+
var _this$data$navigation;
|
|
10308
|
+
return (_this$data$navigation = this.data.navigationConfiguration) !== null && _this$data$navigation !== void 0 ? _this$data$navigation : {
|
|
10309
|
+
showFooter: true,
|
|
10310
|
+
allowHidePrices: true,
|
|
10311
|
+
showLogin: true,
|
|
10312
|
+
buttons: []
|
|
10313
|
+
};
|
|
10314
|
+
}
|
|
10315
|
+
}, {
|
|
10316
|
+
key: "apiHandler",
|
|
10317
|
+
get: function get() {
|
|
10318
|
+
return this._apiHandler;
|
|
10319
|
+
}
|
|
10320
|
+
}, {
|
|
10321
|
+
key: "productHandler",
|
|
10322
|
+
get: function get() {
|
|
10323
|
+
return this.handlers.productHandler;
|
|
10324
|
+
}
|
|
10325
|
+
}, {
|
|
10326
|
+
key: "contentItemHandler",
|
|
10327
|
+
get: function get() {
|
|
10328
|
+
return this.handlers.contentItemHandler;
|
|
10329
|
+
}
|
|
10330
|
+
}, {
|
|
10331
|
+
key: "organizationHandler",
|
|
10332
|
+
get: function get() {
|
|
10333
|
+
return this.handlers.organizationHandler;
|
|
10334
|
+
}
|
|
10335
|
+
}, {
|
|
10336
|
+
key: "mediaHandler",
|
|
10337
|
+
get: function get() {
|
|
10338
|
+
return this.handlers.mediaHandler;
|
|
10339
|
+
}
|
|
10340
|
+
}, {
|
|
10341
|
+
key: "adminHandler",
|
|
10342
|
+
get: function get() {
|
|
10343
|
+
return this.handlers.adminHandler;
|
|
10344
|
+
}
|
|
10345
|
+
}, {
|
|
10346
|
+
key: "authorizationHandler",
|
|
10347
|
+
get: function get() {
|
|
10348
|
+
return this.handlers.authorizationHandler;
|
|
10349
|
+
}
|
|
10350
|
+
}, {
|
|
10351
|
+
key: "analyticsHandler",
|
|
10352
|
+
get: function get() {
|
|
10353
|
+
return this.handlers.analyticsHandler;
|
|
10354
|
+
}
|
|
10355
|
+
}, {
|
|
10356
|
+
key: "reportHandler",
|
|
10357
|
+
get: function get() {
|
|
10358
|
+
return this.handlers.reportHandler;
|
|
10359
|
+
}
|
|
10360
|
+
}, {
|
|
10361
|
+
key: "supportHandler",
|
|
10362
|
+
get: function get() {
|
|
10363
|
+
return this.handlers.supportHandler;
|
|
10364
|
+
}
|
|
10365
|
+
}, {
|
|
10366
|
+
key: "clientArticleHandler",
|
|
10367
|
+
get: function get() {
|
|
10368
|
+
return this.handlers.clientArticleHandler;
|
|
10369
|
+
}
|
|
10370
|
+
}, {
|
|
10371
|
+
key: "doShowInitWarnBanner",
|
|
10372
|
+
get: function get() {
|
|
10373
|
+
return false;
|
|
10374
|
+
}
|
|
10375
|
+
}, {
|
|
10376
|
+
key: "jwt",
|
|
10377
|
+
get: function get() {
|
|
10378
|
+
return this.data.jwt;
|
|
10379
|
+
}
|
|
10380
|
+
}, {
|
|
10381
|
+
key: "storedNToken",
|
|
10382
|
+
get: function get() {
|
|
10383
|
+
return this.data.nToken;
|
|
10384
|
+
}
|
|
10385
|
+
}, {
|
|
10386
|
+
key: "user",
|
|
10387
|
+
get: function get() {
|
|
10388
|
+
return this.data.user;
|
|
10389
|
+
}
|
|
10390
|
+
}, {
|
|
10391
|
+
key: "organization",
|
|
10392
|
+
get: function get() {
|
|
10393
|
+
var _this$data$organizati;
|
|
10394
|
+
return (_this$data$organizati = this.data.organization) !== null && _this$data$organizati !== void 0 ? _this$data$organizati : {
|
|
10395
|
+
_id: 'test',
|
|
10396
|
+
street: 'Teststreet',
|
|
10397
|
+
city: 'Testcity',
|
|
10398
|
+
region: 'Testregion',
|
|
10399
|
+
zipCode: '1234',
|
|
10400
|
+
countryCode: 'IT',
|
|
10401
|
+
phone: '000',
|
|
10402
|
+
email: 'test@example.com',
|
|
10403
|
+
settings: {
|
|
10404
|
+
defaultCurrency: 'EUR',
|
|
10405
|
+
useCatalogTranslations: 'DEFAULT'
|
|
10406
|
+
}
|
|
10407
|
+
};
|
|
10408
|
+
}
|
|
10409
|
+
}, {
|
|
10410
|
+
key: "organizationHierarchy",
|
|
10411
|
+
get: function get() {
|
|
10412
|
+
var _this$data$organizati2;
|
|
10413
|
+
return (_this$data$organizati2 = this.data.organizationHierarchy) !== null && _this$data$organizati2 !== void 0 ? _this$data$organizati2 : [];
|
|
10414
|
+
}
|
|
10415
|
+
}, {
|
|
10416
|
+
key: "allowedOrganizationTypes",
|
|
10417
|
+
get: function get() {
|
|
10418
|
+
return ['RETAILER'];
|
|
10419
|
+
}
|
|
10420
|
+
}, {
|
|
10421
|
+
key: "validOrganizations",
|
|
10422
|
+
get: function get() {
|
|
10423
|
+
return undefined;
|
|
10424
|
+
}
|
|
10425
|
+
}, {
|
|
10426
|
+
key: "dimensions",
|
|
10427
|
+
get: function get() {
|
|
10428
|
+
var _this$data$dimensions;
|
|
10429
|
+
return (_this$data$dimensions = this.data.dimensions) !== null && _this$data$dimensions !== void 0 ? _this$data$dimensions : this._dimensions;
|
|
10430
|
+
}
|
|
10431
|
+
}, {
|
|
10432
|
+
key: "headerInfos",
|
|
10433
|
+
get: function get() {
|
|
10434
|
+
var _this$data$headerInfo;
|
|
10435
|
+
return (_this$data$headerInfo = this.data.headerInfos) !== null && _this$data$headerInfo !== void 0 ? _this$data$headerInfo : {
|
|
10436
|
+
visible: false
|
|
10437
|
+
};
|
|
10438
|
+
}
|
|
10439
|
+
}, {
|
|
10440
|
+
key: "theme",
|
|
10441
|
+
get: function get() {
|
|
10442
|
+
var _this$data$theme$pale, _this$data$theme, _this$data$theme$pale2, _this$data$theme2, _this$data$theme$pale3, _this$data$theme3, _this$data$theme$pale4, _this$data$theme4, _ref2, _this$data$theme$pale5, _this$data$theme5, _this$data$theme6, _ref3, _this$data$theme$pale6, _this$data$theme7, _this$data$theme8, _ref4, _this$data$theme$pale7, _this$data$theme9, _this$data$theme10, _ref5, _this$data$theme$pale8, _this$data$theme11, _this$data$theme12, _this$data$theme$pale9, _this$data$theme13, _this$data$theme$pale10, _this$data$theme14, _this$data$theme$typo, _this$data$theme15;
|
|
10443
|
+
return {
|
|
10444
|
+
palette: {
|
|
10445
|
+
primary: {
|
|
10446
|
+
main: (_this$data$theme$pale = (_this$data$theme = this.data.theme) === null || _this$data$theme === void 0 || (_this$data$theme = _this$data$theme.palette) === null || _this$data$theme === void 0 || (_this$data$theme = _this$data$theme.primary) === null || _this$data$theme === void 0 ? void 0 : _this$data$theme.main) !== null && _this$data$theme$pale !== void 0 ? _this$data$theme$pale : defaultTheme.palette.primary.main,
|
|
10447
|
+
light: (_this$data$theme$pale2 = (_this$data$theme2 = this.data.theme) === null || _this$data$theme2 === void 0 || (_this$data$theme2 = _this$data$theme2.palette) === null || _this$data$theme2 === void 0 || (_this$data$theme2 = _this$data$theme2.primary) === null || _this$data$theme2 === void 0 ? void 0 : _this$data$theme2.light) !== null && _this$data$theme$pale2 !== void 0 ? _this$data$theme$pale2 : defaultTheme.palette.primary.light,
|
|
10448
|
+
dark: (_this$data$theme$pale3 = (_this$data$theme3 = this.data.theme) === null || _this$data$theme3 === void 0 || (_this$data$theme3 = _this$data$theme3.palette) === null || _this$data$theme3 === void 0 || (_this$data$theme3 = _this$data$theme3.primary) === null || _this$data$theme3 === void 0 ? void 0 : _this$data$theme3.dark) !== null && _this$data$theme$pale3 !== void 0 ? _this$data$theme$pale3 : defaultTheme.palette.primary.dark,
|
|
10449
|
+
contrastText: (_this$data$theme$pale4 = (_this$data$theme4 = this.data.theme) === null || _this$data$theme4 === void 0 || (_this$data$theme4 = _this$data$theme4.palette) === null || _this$data$theme4 === void 0 || (_this$data$theme4 = _this$data$theme4.primary) === null || _this$data$theme4 === void 0 ? void 0 : _this$data$theme4.contrastText) !== null && _this$data$theme$pale4 !== void 0 ? _this$data$theme$pale4 : defaultTheme.palette.primary.contrastText
|
|
10450
|
+
},
|
|
10451
|
+
secondary: {
|
|
10452
|
+
main: (_ref2 = (_this$data$theme$pale5 = (_this$data$theme5 = this.data.theme) === null || _this$data$theme5 === void 0 || (_this$data$theme5 = _this$data$theme5.palette) === null || _this$data$theme5 === void 0 || (_this$data$theme5 = _this$data$theme5.secondary) === null || _this$data$theme5 === void 0 ? void 0 : _this$data$theme5.main) !== null && _this$data$theme$pale5 !== void 0 ? _this$data$theme$pale5 : (_this$data$theme6 = this.data.theme) === null || _this$data$theme6 === void 0 || (_this$data$theme6 = _this$data$theme6.palette) === null || _this$data$theme6 === void 0 || (_this$data$theme6 = _this$data$theme6.primary) === null || _this$data$theme6 === void 0 ? void 0 : _this$data$theme6.main) !== null && _ref2 !== void 0 ? _ref2 : defaultTheme.palette.secondary.main,
|
|
10453
|
+
light: (_ref3 = (_this$data$theme$pale6 = (_this$data$theme7 = this.data.theme) === null || _this$data$theme7 === void 0 || (_this$data$theme7 = _this$data$theme7.palette) === null || _this$data$theme7 === void 0 || (_this$data$theme7 = _this$data$theme7.secondary) === null || _this$data$theme7 === void 0 ? void 0 : _this$data$theme7.light) !== null && _this$data$theme$pale6 !== void 0 ? _this$data$theme$pale6 : (_this$data$theme8 = this.data.theme) === null || _this$data$theme8 === void 0 || (_this$data$theme8 = _this$data$theme8.palette) === null || _this$data$theme8 === void 0 || (_this$data$theme8 = _this$data$theme8.primary) === null || _this$data$theme8 === void 0 ? void 0 : _this$data$theme8.light) !== null && _ref3 !== void 0 ? _ref3 : defaultTheme.palette.secondary.light,
|
|
10454
|
+
dark: (_ref4 = (_this$data$theme$pale7 = (_this$data$theme9 = this.data.theme) === null || _this$data$theme9 === void 0 || (_this$data$theme9 = _this$data$theme9.palette) === null || _this$data$theme9 === void 0 || (_this$data$theme9 = _this$data$theme9.secondary) === null || _this$data$theme9 === void 0 ? void 0 : _this$data$theme9.dark) !== null && _this$data$theme$pale7 !== void 0 ? _this$data$theme$pale7 : (_this$data$theme10 = this.data.theme) === null || _this$data$theme10 === void 0 || (_this$data$theme10 = _this$data$theme10.palette) === null || _this$data$theme10 === void 0 || (_this$data$theme10 = _this$data$theme10.primary) === null || _this$data$theme10 === void 0 ? void 0 : _this$data$theme10.dark) !== null && _ref4 !== void 0 ? _ref4 : defaultTheme.palette.secondary.dark,
|
|
10455
|
+
contrastText: (_ref5 = (_this$data$theme$pale8 = (_this$data$theme11 = this.data.theme) === null || _this$data$theme11 === void 0 || (_this$data$theme11 = _this$data$theme11.palette) === null || _this$data$theme11 === void 0 || (_this$data$theme11 = _this$data$theme11.secondary) === null || _this$data$theme11 === void 0 ? void 0 : _this$data$theme11.contrastText) !== null && _this$data$theme$pale8 !== void 0 ? _this$data$theme$pale8 : (_this$data$theme12 = this.data.theme) === null || _this$data$theme12 === void 0 || (_this$data$theme12 = _this$data$theme12.palette) === null || _this$data$theme12 === void 0 || (_this$data$theme12 = _this$data$theme12.primary) === null || _this$data$theme12 === void 0 ? void 0 : _this$data$theme12.contrastText) !== null && _ref5 !== void 0 ? _ref5 : defaultTheme.palette.secondary.contrastText
|
|
10456
|
+
},
|
|
10457
|
+
text: {
|
|
10458
|
+
primary: (_this$data$theme$pale9 = (_this$data$theme13 = this.data.theme) === null || _this$data$theme13 === void 0 || (_this$data$theme13 = _this$data$theme13.palette) === null || _this$data$theme13 === void 0 || (_this$data$theme13 = _this$data$theme13.text) === null || _this$data$theme13 === void 0 ? void 0 : _this$data$theme13.primary) !== null && _this$data$theme$pale9 !== void 0 ? _this$data$theme$pale9 : defaultTheme.palette.text.primary,
|
|
10459
|
+
secondary: (_this$data$theme$pale10 = (_this$data$theme14 = this.data.theme) === null || _this$data$theme14 === void 0 || (_this$data$theme14 = _this$data$theme14.palette) === null || _this$data$theme14 === void 0 || (_this$data$theme14 = _this$data$theme14.text) === null || _this$data$theme14 === void 0 ? void 0 : _this$data$theme14.secondary) !== null && _this$data$theme$pale10 !== void 0 ? _this$data$theme$pale10 : defaultTheme.palette.text.secondary
|
|
10460
|
+
}
|
|
10461
|
+
},
|
|
10462
|
+
typography: {
|
|
10463
|
+
fontFamily: (_this$data$theme$typo = (_this$data$theme15 = this.data.theme) === null || _this$data$theme15 === void 0 || (_this$data$theme15 = _this$data$theme15.typography) === null || _this$data$theme15 === void 0 ? void 0 : _this$data$theme15.fontFamily) !== null && _this$data$theme$typo !== void 0 ? _this$data$theme$typo : defaultTheme.typography.fontFamily
|
|
10464
|
+
}
|
|
10465
|
+
};
|
|
10466
|
+
}
|
|
10467
|
+
}, {
|
|
10468
|
+
key: "state",
|
|
10469
|
+
get: function get() {
|
|
10470
|
+
var _this2 = this,
|
|
10471
|
+
_this$data$loading,
|
|
10472
|
+
_this$data$hidePrices,
|
|
10473
|
+
_this$data$applicatio,
|
|
10474
|
+
_this$data$isFullscre,
|
|
10475
|
+
_this$data$enableSupp;
|
|
10476
|
+
return {
|
|
10477
|
+
actions: {
|
|
10478
|
+
changeLanguage: this.changeLanguage.bind(this),
|
|
10479
|
+
changeLoginMode: this.changeLoginMode.bind(this),
|
|
10480
|
+
subscribeEvents: this.subscribeEvents.bind(this),
|
|
10481
|
+
unSubscribeEvents: this.unSubscribeEvents.bind(this),
|
|
10482
|
+
onEvent: this.onEvent.bind(this),
|
|
10483
|
+
openComponent: function openComponent(data) {
|
|
10484
|
+
if (_this2.actions.openComponent) {
|
|
10485
|
+
return _this2.actions.openComponent(data);
|
|
10486
|
+
} else {
|
|
10487
|
+
throw new Error('Method not implemented.');
|
|
10488
|
+
}
|
|
10489
|
+
},
|
|
10490
|
+
closeComponentInFullscreen: function closeComponentInFullscreen() {
|
|
10491
|
+
if (_this2.actions.closeComponentInFullscreen) {
|
|
10492
|
+
_this2.actions.closeComponentInFullscreen();
|
|
10493
|
+
} else {
|
|
10494
|
+
throw new Error('Method not implemented.');
|
|
10495
|
+
}
|
|
10496
|
+
},
|
|
10497
|
+
setAbsoluteFullScreen: function setAbsoluteFullScreen(val) {
|
|
10498
|
+
if (_this2.actions.setAbsoluteFullScreen) {
|
|
10499
|
+
_this2.actions.setAbsoluteFullScreen(val);
|
|
10500
|
+
} else {
|
|
10501
|
+
throw new Error('Method not implemented.');
|
|
10502
|
+
}
|
|
10503
|
+
},
|
|
10504
|
+
updateBreadcrumbs: function updateBreadcrumbs(params) {
|
|
10505
|
+
if (_this2.actions.updateBreadcrumbs) {
|
|
10506
|
+
_this2.actions.updateBreadcrumbs(params);
|
|
10507
|
+
} else {
|
|
10508
|
+
throw new Error('Method not implemented.');
|
|
10509
|
+
}
|
|
10510
|
+
},
|
|
10511
|
+
openModal: function openModal(data) {
|
|
10512
|
+
if (_this2.actions.openModal) {
|
|
10513
|
+
_this2.actions.openModal(data);
|
|
10514
|
+
} else {
|
|
10515
|
+
throw new Error('Method not implemented.');
|
|
10516
|
+
}
|
|
10517
|
+
},
|
|
10518
|
+
closeModal: function closeModal() {
|
|
10519
|
+
if (_this2.actions.closeModal) {
|
|
10520
|
+
_this2.actions.closeModal();
|
|
10521
|
+
} else {
|
|
10522
|
+
throw new Error('Method not implemented.');
|
|
10523
|
+
}
|
|
10524
|
+
},
|
|
10525
|
+
sendEmail: function sendEmail(data) {
|
|
10526
|
+
if (_this2.actions.sendEmail) {
|
|
10527
|
+
_this2.actions.sendEmail(data);
|
|
10528
|
+
} else {
|
|
10529
|
+
throw new Error('Method not implemented.');
|
|
10530
|
+
}
|
|
10531
|
+
},
|
|
10532
|
+
updateCustomLogo: function updateCustomLogo(components, logo) {
|
|
10533
|
+
if (_this2.actions.updateCustomLogo) {
|
|
10534
|
+
_this2.actions.updateCustomLogo(components, logo);
|
|
10535
|
+
} else {
|
|
10536
|
+
throw new Error('Method not implemented.');
|
|
10537
|
+
}
|
|
10538
|
+
},
|
|
10539
|
+
updateCustomHeaderElement: function updateCustomHeaderElement(components, element) {
|
|
10540
|
+
if (_this2.actions.updateCustomHeaderElement) {
|
|
10541
|
+
_this2.actions.updateCustomHeaderElement(components, element);
|
|
10542
|
+
} else {
|
|
10543
|
+
throw new Error('Method not implemented.');
|
|
10544
|
+
}
|
|
10545
|
+
},
|
|
10546
|
+
toggleHidePrices: function toggleHidePrices() {
|
|
10547
|
+
if (_this2.actions.toggleHidePrices) {
|
|
10548
|
+
_this2.actions.toggleHidePrices();
|
|
10549
|
+
} else {
|
|
10550
|
+
throw new Error('Method not implemented.');
|
|
10551
|
+
}
|
|
10552
|
+
},
|
|
10553
|
+
toggleLoading: function toggleLoading(id, hidden, toggle) {
|
|
10554
|
+
if (_this2.actions.toggleLoading) {
|
|
10555
|
+
_this2.actions.toggleLoading(id, hidden, toggle);
|
|
10556
|
+
} else {
|
|
10557
|
+
throw new Error('Method not implemented.');
|
|
10558
|
+
}
|
|
10559
|
+
},
|
|
10560
|
+
setOrganization: function setOrganization(organizationId) {
|
|
10561
|
+
if (_this2.actions.setOrganization) {
|
|
10562
|
+
_this2.actions.setOrganization(organizationId);
|
|
10563
|
+
} else {
|
|
10564
|
+
throw new Error('Method not implemented.');
|
|
10565
|
+
}
|
|
10566
|
+
},
|
|
10567
|
+
getSessionGuid: function getSessionGuid(userRole, loginMode, organizationId, api2Location) {
|
|
10568
|
+
if (_this2.actions.getSessionGuid) {
|
|
10569
|
+
return _this2.actions.getSessionGuid(userRole, loginMode, organizationId, api2Location);
|
|
10570
|
+
} else {
|
|
10571
|
+
throw new Error('Method not implemented.');
|
|
10572
|
+
}
|
|
10573
|
+
},
|
|
10574
|
+
getApi2AuthLoginData: function getApi2AuthLoginData(userRole, loginMode, organizationId, api2Location) {
|
|
10575
|
+
if (_this2.actions.getApi2AuthLoginData) {
|
|
10576
|
+
return _this2.actions.getApi2AuthLoginData(userRole, loginMode, organizationId, api2Location);
|
|
10577
|
+
} else {
|
|
10578
|
+
throw new Error('Method not implemented.');
|
|
10579
|
+
}
|
|
10580
|
+
},
|
|
10581
|
+
logout: function logout() {
|
|
10582
|
+
if (_this2.actions.logout) {
|
|
10583
|
+
_this2.actions.logout();
|
|
10584
|
+
} else {
|
|
10585
|
+
throw new Error('Method not implemented.');
|
|
10586
|
+
}
|
|
10587
|
+
},
|
|
10588
|
+
showLoginWindow: function showLoginWindow() {
|
|
10589
|
+
if (_this2.actions.showLoginWindow) {
|
|
10590
|
+
_this2.actions.showLoginWindow();
|
|
10591
|
+
} else {
|
|
10592
|
+
throw new Error('Method not implemented.');
|
|
10593
|
+
}
|
|
10594
|
+
},
|
|
10595
|
+
userHasPermission: function userHasPermission(permission) {
|
|
10596
|
+
if (_this2.actions.userHasPermission) {
|
|
10597
|
+
return _this2.actions.userHasPermission(permission);
|
|
10598
|
+
} else {
|
|
10599
|
+
throw new Error('Method not implemented.');
|
|
10600
|
+
}
|
|
10601
|
+
},
|
|
10602
|
+
openFullscreen: function openFullscreen(fullscreen) {
|
|
10603
|
+
if (_this2.actions.openFullscreen) {
|
|
10604
|
+
_this2.actions.openFullscreen(fullscreen);
|
|
10605
|
+
} else {
|
|
10606
|
+
throw new Error('Method not implemented.');
|
|
10607
|
+
}
|
|
10608
|
+
},
|
|
10609
|
+
closeFullscreen: function closeFullscreen() {
|
|
10610
|
+
if (_this2.actions.closeFullscreen) {
|
|
10611
|
+
_this2.actions.closeFullscreen();
|
|
10612
|
+
} else {
|
|
10613
|
+
throw new Error('Method not implemented.');
|
|
10614
|
+
}
|
|
10615
|
+
},
|
|
10616
|
+
openSideMenu: function openSideMenu(sideMenu) {
|
|
10617
|
+
if (_this2.actions.openSideMenu) {
|
|
10618
|
+
_this2.actions.openSideMenu(sideMenu);
|
|
10619
|
+
} else {
|
|
10620
|
+
throw new Error('Method not implemented.');
|
|
10621
|
+
}
|
|
10622
|
+
},
|
|
10623
|
+
closeSideMenu: function closeSideMenu() {
|
|
10624
|
+
if (_this2.actions.closeSideMenu) {
|
|
10625
|
+
_this2.actions.closeSideMenu();
|
|
10626
|
+
} else {
|
|
10627
|
+
throw new Error('Method not implemented.');
|
|
10628
|
+
}
|
|
10629
|
+
},
|
|
10630
|
+
openBarrier: function openBarrier(barrier) {
|
|
10631
|
+
if (_this2.actions.openBarrier) {
|
|
10632
|
+
_this2.actions.openBarrier(barrier);
|
|
10633
|
+
} else {
|
|
10634
|
+
throw new Error('Method not implemented.');
|
|
10635
|
+
}
|
|
10636
|
+
},
|
|
10637
|
+
updateHeaderInfos: function updateHeaderInfos(headerInfos) {
|
|
10638
|
+
if (_this2.actions.updateHeaderInfos) {
|
|
10639
|
+
_this2.actions.updateHeaderInfos(headerInfos);
|
|
10640
|
+
} else {
|
|
10641
|
+
throw new Error('Method not implemented.');
|
|
10642
|
+
}
|
|
10643
|
+
},
|
|
10644
|
+
openBanner: function openBanner(banner) {
|
|
10645
|
+
if (_this2.actions.openBanner) {
|
|
10646
|
+
_this2.actions.openBanner(banner);
|
|
10647
|
+
} else {
|
|
10648
|
+
throw new Error('Method not implemented.');
|
|
10649
|
+
}
|
|
10650
|
+
},
|
|
10651
|
+
closeBanner: function closeBanner() {
|
|
10652
|
+
if (_this2.actions.closeBanner) {
|
|
10653
|
+
_this2.actions.closeBanner();
|
|
10654
|
+
} else {
|
|
10655
|
+
throw new Error('Method not implemented.');
|
|
10656
|
+
}
|
|
10657
|
+
},
|
|
10658
|
+
resolveComponent: function resolveComponent(action) {
|
|
10659
|
+
if (_this2.actions.resolveComponent) {
|
|
10660
|
+
return _this2.actions.resolveComponent(action);
|
|
10661
|
+
} else {
|
|
10662
|
+
throw new Error('Method not implemented.');
|
|
10663
|
+
}
|
|
10664
|
+
},
|
|
10665
|
+
openSnackBar: function openSnackBar(data) {
|
|
10666
|
+
if (_this2.actions.openSnackBar) {
|
|
10667
|
+
_this2.actions.openSnackBar(data);
|
|
10668
|
+
} else {
|
|
10669
|
+
throw new Error('Method not implemented.');
|
|
10670
|
+
}
|
|
10671
|
+
},
|
|
10672
|
+
setComponentChange: function setComponentChange(value) {
|
|
10673
|
+
if (_this2.actions.setComponentChange) {
|
|
10674
|
+
_this2.actions.setComponentChange(value);
|
|
10675
|
+
} else {
|
|
10676
|
+
throw new Error('Method not implemented.');
|
|
10677
|
+
}
|
|
10678
|
+
}
|
|
10679
|
+
},
|
|
10680
|
+
state: _objectSpread(_objectSpread({}, this.data), {}, {
|
|
10681
|
+
apiConfig: this.apiConfig,
|
|
10682
|
+
availableLanguages: this.languages,
|
|
10683
|
+
loginMode: this.loginMode,
|
|
10684
|
+
availableComponents: this.aviailableComponents,
|
|
10685
|
+
initializing: this.initializing,
|
|
10686
|
+
organization: this.organization,
|
|
10687
|
+
organizationHierarchy: this.organizationHierarchy,
|
|
10688
|
+
navigationConfiguration: this.navigationConfiguration,
|
|
10689
|
+
loading: (_this$data$loading = this.data.loading) !== null && _this$data$loading !== void 0 ? _this$data$loading : false,
|
|
10690
|
+
hidePrices: (_this$data$hidePrices = this.data.hidePrices) !== null && _this$data$hidePrices !== void 0 ? _this$data$hidePrices : false,
|
|
10691
|
+
dimensions: this.dimensions,
|
|
10692
|
+
isMobile: this.dimensions.isMobile,
|
|
10693
|
+
headerInfos: this.headerInfos,
|
|
10694
|
+
theme: this.theme,
|
|
10695
|
+
applicationEnvironment: (_this$data$applicatio = this.data.applicationEnvironment) !== null && _this$data$applicatio !== void 0 ? _this$data$applicatio : 'WEB',
|
|
10696
|
+
isFullscreenComponent: (_this$data$isFullscre = this.data.isFullscreenComponent) !== null && _this$data$isFullscre !== void 0 ? _this$data$isFullscre : false,
|
|
10697
|
+
enableSupport: (_this$data$enableSupp = this.data.enableSupport) !== null && _this$data$enableSupp !== void 0 ? _this$data$enableSupp : false
|
|
10698
|
+
}),
|
|
10699
|
+
handler: this.handlers
|
|
10700
|
+
};
|
|
10701
|
+
}
|
|
10702
|
+
}]);
|
|
10703
|
+
}();
|
|
10704
|
+
function mockCoreHandlers(root) {
|
|
10705
|
+
return {
|
|
10706
|
+
productHandler: new ProductHandler(root),
|
|
10707
|
+
contentItemHandler: new ContentItemHandler(root),
|
|
10708
|
+
organizationHandler: new OrganizationHandler(root),
|
|
10709
|
+
mediaHandler: new MediaHandler(root),
|
|
10710
|
+
adminHandler: new AdminHandler(root),
|
|
10711
|
+
authorizationHandler: new AuthorizationHandler(root),
|
|
10712
|
+
analyticsHandler: new AnalyticsHandler(root),
|
|
10713
|
+
reportHandler: new ReportHandler(root),
|
|
10714
|
+
supportHandler: new SupportHandler(root),
|
|
10715
|
+
clientArticleHandler: new ClientArticleHandler(root)
|
|
10716
|
+
};
|
|
10717
|
+
}
|
|
10718
|
+
|
|
9942
10719
|
var LOG = getLogger('Framework', 'root');
|
|
9943
10720
|
LOG.startTransaction({
|
|
9944
10721
|
event: 'unitInit',
|
|
@@ -9956,4 +10733,4 @@ LOG.startTransaction({
|
|
|
9956
10733
|
});
|
|
9957
10734
|
window.DIVA_VERSION = "v".concat(process.env.VERSION);
|
|
9958
10735
|
|
|
9959
|
-
export { AuthorizationHandler as A, Button as B, Content
|
|
10736
|
+
export { AuthorizationHandler as A, Button as B, Content as C, DivaCore as D, HelpButton as H, Input as I, ONE_DAY_UNIX as O, ProductHandler as P, RequestStatus as R, SupportHandler as S, getLogger as a, separator as b, success as c, auth as d, error as e, loginBox as f, google as g, logoContainer as h, styleInject as i, useDivaCore as j, AnalyticsHandler as k, link as l, microsoft as m, OrganizationHandler as n, ClientArticleHandler as o, DivaMockProvider as p, storyBookCoreMock as q, resetInput as r, socialButton as s, useDivaCoreContext as u };
|