@cognigy/webchat 3.48.0 → 3.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/OSS_LICENSES.txt +5 -33
- package/dist/webchat.esm.js +1370 -2104
- package/dist/webchat.js +95 -112
- package/package.json +2 -3
package/dist/webchat.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* webchat.esm.js v3.
|
|
3
|
-
* https://github.com/Cognigy/Webchat/tree/v3.
|
|
4
|
-
* https://github.com/Cognigy/Webchat/tree/v3.
|
|
2
|
+
* webchat.esm.js v3.49.0
|
|
3
|
+
* https://github.com/Cognigy/Webchat/tree/v3.49.0
|
|
4
|
+
* https://github.com/Cognigy/Webchat/tree/v3.49.0/OSS_LICENSES.txt
|
|
5
5
|
*/
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
7
7
|
import * as __WEBPACK_EXTERNAL_MODULE_react_dom_7dac9eee__ from "react-dom";
|
|
@@ -117,43 +117,6 @@ var SvgBaselineChat24Px = function SvgBaselineChat24Px(_ref) {
|
|
|
117
117
|
|
|
118
118
|
/***/ },
|
|
119
119
|
|
|
120
|
-
/***/ 93647
|
|
121
|
-
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
122
|
-
|
|
123
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
124
|
-
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
125
|
-
/* harmony export */ });
|
|
126
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
127
|
-
var _path, _path2;
|
|
128
|
-
var _excluded = ["title", "titleId"];
|
|
129
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
130
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
131
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
132
|
-
|
|
133
|
-
var SvgBaselineClose24Px = function SvgBaselineClose24Px(_ref) {
|
|
134
|
-
var title = _ref.title,
|
|
135
|
-
titleId = _ref.titleId,
|
|
136
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
137
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
|
|
138
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
139
|
-
width: 24,
|
|
140
|
-
height: 24,
|
|
141
|
-
"aria-hidden": "true",
|
|
142
|
-
viewBox: "0 0 24 24",
|
|
143
|
-
"aria-labelledby": titleId
|
|
144
|
-
}, props), title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("title", {
|
|
145
|
-
id: titleId
|
|
146
|
-
}, title) : null, _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
|
|
147
|
-
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
148
|
-
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
|
|
149
|
-
fill: "none",
|
|
150
|
-
d: "M0 0h24v24H0z"
|
|
151
|
-
})));
|
|
152
|
-
};
|
|
153
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgBaselineClose24Px);
|
|
154
|
-
|
|
155
|
-
/***/ },
|
|
156
|
-
|
|
157
120
|
/***/ 92326
|
|
158
121
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
159
122
|
|
|
@@ -5879,37 +5842,6 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
|
|
|
5879
5842
|
|
|
5880
5843
|
/***/ },
|
|
5881
5844
|
|
|
5882
|
-
/***/ 61513
|
|
5883
|
-
(module, exports, __webpack_require__) {
|
|
5884
|
-
|
|
5885
|
-
var __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
|
5886
|
-
Copyright (c) 2015 Jed Watson.
|
|
5887
|
-
Based on code that is Copyright 2013-2015, Facebook, Inc.
|
|
5888
|
-
All rights reserved.
|
|
5889
|
-
*/
|
|
5890
|
-
/* global define */
|
|
5891
|
-
|
|
5892
|
-
(function () {
|
|
5893
|
-
'use strict';
|
|
5894
|
-
|
|
5895
|
-
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
5896
|
-
var ExecutionEnvironment = {
|
|
5897
|
-
canUseDOM: canUseDOM,
|
|
5898
|
-
canUseWorkers: typeof Worker !== 'undefined',
|
|
5899
|
-
canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
|
|
5900
|
-
canUseViewport: canUseDOM && !!window.screen
|
|
5901
|
-
};
|
|
5902
|
-
if (true) {
|
|
5903
|
-
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
|
|
5904
|
-
return ExecutionEnvironment;
|
|
5905
|
-
}).call(exports, __webpack_require__, exports, module),
|
|
5906
|
-
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
5907
|
-
} else // removed by dead control flow
|
|
5908
|
-
{}
|
|
5909
|
-
})();
|
|
5910
|
-
|
|
5911
|
-
/***/ },
|
|
5912
|
-
|
|
5913
5845
|
/***/ 67095
|
|
5914
5846
|
(module) {
|
|
5915
5847
|
|
|
@@ -26624,105 +26556,6 @@ function plural(ms, msAbs, n, name) {
|
|
|
26624
26556
|
|
|
26625
26557
|
/***/ },
|
|
26626
26558
|
|
|
26627
|
-
/***/ 28372
|
|
26628
|
-
(module, __unused_webpack_exports, __webpack_require__) {
|
|
26629
|
-
|
|
26630
|
-
/**
|
|
26631
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
26632
|
-
*
|
|
26633
|
-
* This source code is licensed under the MIT license found in the
|
|
26634
|
-
* LICENSE file in the root directory of this source tree.
|
|
26635
|
-
*/
|
|
26636
|
-
|
|
26637
|
-
|
|
26638
|
-
|
|
26639
|
-
var ReactPropTypesSecret = __webpack_require__(44067);
|
|
26640
|
-
function emptyFunction() {}
|
|
26641
|
-
function emptyFunctionWithReset() {}
|
|
26642
|
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
26643
|
-
module.exports = function () {
|
|
26644
|
-
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
26645
|
-
if (secret === ReactPropTypesSecret) {
|
|
26646
|
-
// It is still safe when called from React.
|
|
26647
|
-
return;
|
|
26648
|
-
}
|
|
26649
|
-
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
|
26650
|
-
err.name = 'Invariant Violation';
|
|
26651
|
-
throw err;
|
|
26652
|
-
}
|
|
26653
|
-
;
|
|
26654
|
-
shim.isRequired = shim;
|
|
26655
|
-
function getShim() {
|
|
26656
|
-
return shim;
|
|
26657
|
-
}
|
|
26658
|
-
;
|
|
26659
|
-
// Important!
|
|
26660
|
-
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
26661
|
-
var ReactPropTypes = {
|
|
26662
|
-
array: shim,
|
|
26663
|
-
bigint: shim,
|
|
26664
|
-
bool: shim,
|
|
26665
|
-
func: shim,
|
|
26666
|
-
number: shim,
|
|
26667
|
-
object: shim,
|
|
26668
|
-
string: shim,
|
|
26669
|
-
symbol: shim,
|
|
26670
|
-
any: shim,
|
|
26671
|
-
arrayOf: getShim,
|
|
26672
|
-
element: shim,
|
|
26673
|
-
elementType: shim,
|
|
26674
|
-
instanceOf: getShim,
|
|
26675
|
-
node: shim,
|
|
26676
|
-
objectOf: getShim,
|
|
26677
|
-
oneOf: getShim,
|
|
26678
|
-
oneOfType: getShim,
|
|
26679
|
-
shape: getShim,
|
|
26680
|
-
exact: getShim,
|
|
26681
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
26682
|
-
resetWarningCache: emptyFunction
|
|
26683
|
-
};
|
|
26684
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
26685
|
-
return ReactPropTypes;
|
|
26686
|
-
};
|
|
26687
|
-
|
|
26688
|
-
/***/ },
|
|
26689
|
-
|
|
26690
|
-
/***/ 94370
|
|
26691
|
-
(module, __unused_webpack_exports, __webpack_require__) {
|
|
26692
|
-
|
|
26693
|
-
/**
|
|
26694
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
26695
|
-
*
|
|
26696
|
-
* This source code is licensed under the MIT license found in the
|
|
26697
|
-
* LICENSE file in the root directory of this source tree.
|
|
26698
|
-
*/
|
|
26699
|
-
|
|
26700
|
-
if (false) // removed by dead control flow
|
|
26701
|
-
{ var throwOnDirectAccess, ReactIs; } else {
|
|
26702
|
-
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
26703
|
-
// http://fb.me/prop-types-in-prod
|
|
26704
|
-
module.exports = __webpack_require__(28372)();
|
|
26705
|
-
}
|
|
26706
|
-
|
|
26707
|
-
/***/ },
|
|
26708
|
-
|
|
26709
|
-
/***/ 44067
|
|
26710
|
-
(module) {
|
|
26711
|
-
|
|
26712
|
-
/**
|
|
26713
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
26714
|
-
*
|
|
26715
|
-
* This source code is licensed under the MIT license found in the
|
|
26716
|
-
* LICENSE file in the root directory of this source tree.
|
|
26717
|
-
*/
|
|
26718
|
-
|
|
26719
|
-
|
|
26720
|
-
|
|
26721
|
-
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
26722
|
-
module.exports = ReactPropTypesSecret;
|
|
26723
|
-
|
|
26724
|
-
/***/ },
|
|
26725
|
-
|
|
26726
26559
|
/***/ 39645
|
|
26727
26560
|
(__unused_webpack_module, exports) {
|
|
26728
26561
|
|
|
@@ -26858,1630 +26691,6 @@ if (true) {
|
|
|
26858
26691
|
|
|
26859
26692
|
/***/ },
|
|
26860
26693
|
|
|
26861
|
-
/***/ 16247
|
|
26862
|
-
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
26863
|
-
|
|
26864
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26865
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
26866
|
-
/* harmony export */ polyfill: () => (/* binding */ polyfill)
|
|
26867
|
-
/* harmony export */ });
|
|
26868
|
-
/**
|
|
26869
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
26870
|
-
*
|
|
26871
|
-
* This source code is licensed under the MIT license found in the
|
|
26872
|
-
* LICENSE file in the root directory of this source tree.
|
|
26873
|
-
*/
|
|
26874
|
-
|
|
26875
|
-
function componentWillMount() {
|
|
26876
|
-
// Call this.constructor.gDSFP to support sub-classes.
|
|
26877
|
-
var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
|
|
26878
|
-
if (state !== null && state !== undefined) {
|
|
26879
|
-
this.setState(state);
|
|
26880
|
-
}
|
|
26881
|
-
}
|
|
26882
|
-
function componentWillReceiveProps(nextProps) {
|
|
26883
|
-
// Call this.constructor.gDSFP to support sub-classes.
|
|
26884
|
-
// Use the setState() updater to ensure state isn't stale in certain edge cases.
|
|
26885
|
-
function updater(prevState) {
|
|
26886
|
-
var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
|
|
26887
|
-
return state !== null && state !== undefined ? state : null;
|
|
26888
|
-
}
|
|
26889
|
-
// Binding "this" is important for shallow renderer support.
|
|
26890
|
-
this.setState(updater.bind(this));
|
|
26891
|
-
}
|
|
26892
|
-
function componentWillUpdate(nextProps, nextState) {
|
|
26893
|
-
try {
|
|
26894
|
-
var prevProps = this.props;
|
|
26895
|
-
var prevState = this.state;
|
|
26896
|
-
this.props = nextProps;
|
|
26897
|
-
this.state = nextState;
|
|
26898
|
-
this.__reactInternalSnapshotFlag = true;
|
|
26899
|
-
this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);
|
|
26900
|
-
} finally {
|
|
26901
|
-
this.props = prevProps;
|
|
26902
|
-
this.state = prevState;
|
|
26903
|
-
}
|
|
26904
|
-
}
|
|
26905
|
-
|
|
26906
|
-
// React may warn about cWM/cWRP/cWU methods being deprecated.
|
|
26907
|
-
// Add a flag to suppress these warnings for this special case.
|
|
26908
|
-
componentWillMount.__suppressDeprecationWarning = true;
|
|
26909
|
-
componentWillReceiveProps.__suppressDeprecationWarning = true;
|
|
26910
|
-
componentWillUpdate.__suppressDeprecationWarning = true;
|
|
26911
|
-
function polyfill(Component) {
|
|
26912
|
-
var prototype = Component.prototype;
|
|
26913
|
-
if (!prototype || !prototype.isReactComponent) {
|
|
26914
|
-
throw new Error('Can only polyfill class components');
|
|
26915
|
-
}
|
|
26916
|
-
if (typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function') {
|
|
26917
|
-
return Component;
|
|
26918
|
-
}
|
|
26919
|
-
|
|
26920
|
-
// If new component APIs are defined, "unsafe" lifecycles won't be called.
|
|
26921
|
-
// Error if any of these lifecycles are present,
|
|
26922
|
-
// Because they would work differently between older and newer (16.3+) versions of React.
|
|
26923
|
-
var foundWillMountName = null;
|
|
26924
|
-
var foundWillReceivePropsName = null;
|
|
26925
|
-
var foundWillUpdateName = null;
|
|
26926
|
-
if (typeof prototype.componentWillMount === 'function') {
|
|
26927
|
-
foundWillMountName = 'componentWillMount';
|
|
26928
|
-
} else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
|
|
26929
|
-
foundWillMountName = 'UNSAFE_componentWillMount';
|
|
26930
|
-
}
|
|
26931
|
-
if (typeof prototype.componentWillReceiveProps === 'function') {
|
|
26932
|
-
foundWillReceivePropsName = 'componentWillReceiveProps';
|
|
26933
|
-
} else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
|
|
26934
|
-
foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
|
|
26935
|
-
}
|
|
26936
|
-
if (typeof prototype.componentWillUpdate === 'function') {
|
|
26937
|
-
foundWillUpdateName = 'componentWillUpdate';
|
|
26938
|
-
} else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
|
|
26939
|
-
foundWillUpdateName = 'UNSAFE_componentWillUpdate';
|
|
26940
|
-
}
|
|
26941
|
-
if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
|
|
26942
|
-
var componentName = Component.displayName || Component.name;
|
|
26943
|
-
var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
|
|
26944
|
-
throw Error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') + '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks');
|
|
26945
|
-
}
|
|
26946
|
-
|
|
26947
|
-
// React <= 16.2 does not support static getDerivedStateFromProps.
|
|
26948
|
-
// As a workaround, use cWM and cWRP to invoke the new static lifecycle.
|
|
26949
|
-
// Newer versions of React will ignore these lifecycles if gDSFP exists.
|
|
26950
|
-
if (typeof Component.getDerivedStateFromProps === 'function') {
|
|
26951
|
-
prototype.componentWillMount = componentWillMount;
|
|
26952
|
-
prototype.componentWillReceiveProps = componentWillReceiveProps;
|
|
26953
|
-
}
|
|
26954
|
-
|
|
26955
|
-
// React <= 16.2 does not support getSnapshotBeforeUpdate.
|
|
26956
|
-
// As a workaround, use cWU to invoke the new lifecycle.
|
|
26957
|
-
// Newer versions of React will ignore that lifecycle if gSBU exists.
|
|
26958
|
-
if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
|
|
26959
|
-
if (typeof prototype.componentDidUpdate !== 'function') {
|
|
26960
|
-
throw new Error('Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype');
|
|
26961
|
-
}
|
|
26962
|
-
prototype.componentWillUpdate = componentWillUpdate;
|
|
26963
|
-
var componentDidUpdate = prototype.componentDidUpdate;
|
|
26964
|
-
prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {
|
|
26965
|
-
// 16.3+ will not execute our will-update method;
|
|
26966
|
-
// It will pass a snapshot value to did-update though.
|
|
26967
|
-
// Older versions will require our polyfilled will-update value.
|
|
26968
|
-
// We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
|
|
26969
|
-
// Because for <= 15.x versions this might be a "prevContext" object.
|
|
26970
|
-
// We also can't just check "__reactInternalSnapshot",
|
|
26971
|
-
// Because get-snapshot might return a falsy value.
|
|
26972
|
-
// So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
|
|
26973
|
-
var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;
|
|
26974
|
-
componentDidUpdate.call(this, prevProps, prevState, snapshot);
|
|
26975
|
-
};
|
|
26976
|
-
}
|
|
26977
|
-
return Component;
|
|
26978
|
-
}
|
|
26979
|
-
|
|
26980
|
-
|
|
26981
|
-
/***/ },
|
|
26982
|
-
|
|
26983
|
-
/***/ 19530
|
|
26984
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
26985
|
-
|
|
26986
|
-
|
|
26987
|
-
|
|
26988
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
26989
|
-
value: true
|
|
26990
|
-
}));
|
|
26991
|
-
exports.bodyOpenClassName = exports.portalClassName = undefined;
|
|
26992
|
-
var _extends = Object.assign || function (target) {
|
|
26993
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
26994
|
-
var source = arguments[i];
|
|
26995
|
-
for (var key in source) {
|
|
26996
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
26997
|
-
target[key] = source[key];
|
|
26998
|
-
}
|
|
26999
|
-
}
|
|
27000
|
-
}
|
|
27001
|
-
return target;
|
|
27002
|
-
};
|
|
27003
|
-
var _createClass = function () {
|
|
27004
|
-
function defineProperties(target, props) {
|
|
27005
|
-
for (var i = 0; i < props.length; i++) {
|
|
27006
|
-
var descriptor = props[i];
|
|
27007
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
27008
|
-
descriptor.configurable = true;
|
|
27009
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
27010
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
27011
|
-
}
|
|
27012
|
-
}
|
|
27013
|
-
return function (Constructor, protoProps, staticProps) {
|
|
27014
|
-
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
27015
|
-
if (staticProps) defineProperties(Constructor, staticProps);
|
|
27016
|
-
return Constructor;
|
|
27017
|
-
};
|
|
27018
|
-
}();
|
|
27019
|
-
var _react = __webpack_require__(51649);
|
|
27020
|
-
var _react2 = _interopRequireDefault(_react);
|
|
27021
|
-
var _reactDom = __webpack_require__(7516);
|
|
27022
|
-
var _reactDom2 = _interopRequireDefault(_reactDom);
|
|
27023
|
-
var _propTypes = __webpack_require__(94370);
|
|
27024
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
27025
|
-
var _ModalPortal = __webpack_require__(58596);
|
|
27026
|
-
var _ModalPortal2 = _interopRequireDefault(_ModalPortal);
|
|
27027
|
-
var _ariaAppHider = __webpack_require__(98228);
|
|
27028
|
-
var ariaAppHider = _interopRequireWildcard(_ariaAppHider);
|
|
27029
|
-
var _safeHTMLElement = __webpack_require__(8056);
|
|
27030
|
-
var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);
|
|
27031
|
-
var _reactLifecyclesCompat = __webpack_require__(16247);
|
|
27032
|
-
function _interopRequireWildcard(obj) {
|
|
27033
|
-
if (obj && obj.__esModule) {
|
|
27034
|
-
return obj;
|
|
27035
|
-
} else {
|
|
27036
|
-
var newObj = {};
|
|
27037
|
-
if (obj != null) {
|
|
27038
|
-
for (var key in obj) {
|
|
27039
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
|
|
27040
|
-
}
|
|
27041
|
-
}
|
|
27042
|
-
newObj.default = obj;
|
|
27043
|
-
return newObj;
|
|
27044
|
-
}
|
|
27045
|
-
}
|
|
27046
|
-
function _interopRequireDefault(obj) {
|
|
27047
|
-
return obj && obj.__esModule ? obj : {
|
|
27048
|
-
default: obj
|
|
27049
|
-
};
|
|
27050
|
-
}
|
|
27051
|
-
function _classCallCheck(instance, Constructor) {
|
|
27052
|
-
if (!(instance instanceof Constructor)) {
|
|
27053
|
-
throw new TypeError("Cannot call a class as a function");
|
|
27054
|
-
}
|
|
27055
|
-
}
|
|
27056
|
-
function _possibleConstructorReturn(self, call) {
|
|
27057
|
-
if (!self) {
|
|
27058
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
27059
|
-
}
|
|
27060
|
-
return call && (typeof call === "object" || typeof call === "function") ? call : self;
|
|
27061
|
-
}
|
|
27062
|
-
function _inherits(subClass, superClass) {
|
|
27063
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
27064
|
-
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
|
27065
|
-
}
|
|
27066
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
27067
|
-
constructor: {
|
|
27068
|
-
value: subClass,
|
|
27069
|
-
enumerable: false,
|
|
27070
|
-
writable: true,
|
|
27071
|
-
configurable: true
|
|
27072
|
-
}
|
|
27073
|
-
});
|
|
27074
|
-
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
|
27075
|
-
}
|
|
27076
|
-
var portalClassName = exports.portalClassName = "ReactModalPortal";
|
|
27077
|
-
var bodyOpenClassName = exports.bodyOpenClassName = "ReactModal__Body--open";
|
|
27078
|
-
var isReact16 = _safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;
|
|
27079
|
-
var createHTMLElement = function createHTMLElement(name) {
|
|
27080
|
-
return document.createElement(name);
|
|
27081
|
-
};
|
|
27082
|
-
var getCreatePortal = function getCreatePortal() {
|
|
27083
|
-
return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;
|
|
27084
|
-
};
|
|
27085
|
-
function getParentElement(parentSelector) {
|
|
27086
|
-
return parentSelector();
|
|
27087
|
-
}
|
|
27088
|
-
var Modal = function (_Component) {
|
|
27089
|
-
_inherits(Modal, _Component);
|
|
27090
|
-
function Modal() {
|
|
27091
|
-
var _ref;
|
|
27092
|
-
var _temp, _this, _ret;
|
|
27093
|
-
_classCallCheck(this, Modal);
|
|
27094
|
-
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
27095
|
-
args[_key] = arguments[_key];
|
|
27096
|
-
}
|
|
27097
|
-
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {
|
|
27098
|
-
!isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);
|
|
27099
|
-
var parent = getParentElement(_this.props.parentSelector);
|
|
27100
|
-
if (parent && parent.contains(_this.node)) {
|
|
27101
|
-
parent.removeChild(_this.node);
|
|
27102
|
-
} else {
|
|
27103
|
-
// eslint-disable-next-line no-console
|
|
27104
|
-
console.warn('React-Modal: "parentSelector" prop did not returned any DOM ' + "element. Make sure that the parent element is unmounted to " + "avoid any memory leaks.");
|
|
27105
|
-
}
|
|
27106
|
-
}, _this.portalRef = function (ref) {
|
|
27107
|
-
_this.portal = ref;
|
|
27108
|
-
}, _this.renderPortal = function (props) {
|
|
27109
|
-
var createPortal = getCreatePortal();
|
|
27110
|
-
var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({
|
|
27111
|
-
defaultStyles: Modal.defaultStyles
|
|
27112
|
-
}, props)), _this.node);
|
|
27113
|
-
_this.portalRef(portal);
|
|
27114
|
-
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
27115
|
-
}
|
|
27116
|
-
_createClass(Modal, [{
|
|
27117
|
-
key: "componentDidMount",
|
|
27118
|
-
value: function componentDidMount() {
|
|
27119
|
-
if (!_safeHTMLElement.canUseDOM) return;
|
|
27120
|
-
if (!isReact16) {
|
|
27121
|
-
this.node = createHTMLElement("div");
|
|
27122
|
-
}
|
|
27123
|
-
this.node.className = this.props.portalClassName;
|
|
27124
|
-
var parent = getParentElement(this.props.parentSelector);
|
|
27125
|
-
parent.appendChild(this.node);
|
|
27126
|
-
!isReact16 && this.renderPortal(this.props);
|
|
27127
|
-
}
|
|
27128
|
-
}, {
|
|
27129
|
-
key: "getSnapshotBeforeUpdate",
|
|
27130
|
-
value: function getSnapshotBeforeUpdate(prevProps) {
|
|
27131
|
-
var prevParent = getParentElement(prevProps.parentSelector);
|
|
27132
|
-
var nextParent = getParentElement(this.props.parentSelector);
|
|
27133
|
-
return {
|
|
27134
|
-
prevParent: prevParent,
|
|
27135
|
-
nextParent: nextParent
|
|
27136
|
-
};
|
|
27137
|
-
}
|
|
27138
|
-
}, {
|
|
27139
|
-
key: "componentDidUpdate",
|
|
27140
|
-
value: function componentDidUpdate(prevProps, _, snapshot) {
|
|
27141
|
-
if (!_safeHTMLElement.canUseDOM) return;
|
|
27142
|
-
var _props = this.props,
|
|
27143
|
-
isOpen = _props.isOpen,
|
|
27144
|
-
portalClassName = _props.portalClassName;
|
|
27145
|
-
if (prevProps.portalClassName !== portalClassName) {
|
|
27146
|
-
this.node.className = portalClassName;
|
|
27147
|
-
}
|
|
27148
|
-
var prevParent = snapshot.prevParent,
|
|
27149
|
-
nextParent = snapshot.nextParent;
|
|
27150
|
-
if (nextParent !== prevParent) {
|
|
27151
|
-
prevParent.removeChild(this.node);
|
|
27152
|
-
nextParent.appendChild(this.node);
|
|
27153
|
-
}
|
|
27154
|
-
|
|
27155
|
-
// Stop unnecessary renders if modal is remaining closed
|
|
27156
|
-
if (!prevProps.isOpen && !isOpen) return;
|
|
27157
|
-
!isReact16 && this.renderPortal(this.props);
|
|
27158
|
-
}
|
|
27159
|
-
}, {
|
|
27160
|
-
key: "componentWillUnmount",
|
|
27161
|
-
value: function componentWillUnmount() {
|
|
27162
|
-
if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) return;
|
|
27163
|
-
var state = this.portal.state;
|
|
27164
|
-
var now = Date.now();
|
|
27165
|
-
var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS);
|
|
27166
|
-
if (closesAt) {
|
|
27167
|
-
if (!state.beforeClose) {
|
|
27168
|
-
this.portal.closeWithTimeout();
|
|
27169
|
-
}
|
|
27170
|
-
setTimeout(this.removePortal, closesAt - now);
|
|
27171
|
-
} else {
|
|
27172
|
-
this.removePortal();
|
|
27173
|
-
}
|
|
27174
|
-
}
|
|
27175
|
-
}, {
|
|
27176
|
-
key: "render",
|
|
27177
|
-
value: function render() {
|
|
27178
|
-
if (!_safeHTMLElement.canUseDOM || !isReact16) {
|
|
27179
|
-
return null;
|
|
27180
|
-
}
|
|
27181
|
-
if (!this.node && isReact16) {
|
|
27182
|
-
this.node = createHTMLElement("div");
|
|
27183
|
-
}
|
|
27184
|
-
var createPortal = getCreatePortal();
|
|
27185
|
-
return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({
|
|
27186
|
-
ref: this.portalRef,
|
|
27187
|
-
defaultStyles: Modal.defaultStyles
|
|
27188
|
-
}, this.props)), this.node);
|
|
27189
|
-
}
|
|
27190
|
-
}], [{
|
|
27191
|
-
key: "setAppElement",
|
|
27192
|
-
value: function setAppElement(element) {
|
|
27193
|
-
ariaAppHider.setElement(element);
|
|
27194
|
-
}
|
|
27195
|
-
|
|
27196
|
-
/* eslint-disable react/no-unused-prop-types */
|
|
27197
|
-
|
|
27198
|
-
/* eslint-enable react/no-unused-prop-types */
|
|
27199
|
-
}]);
|
|
27200
|
-
return Modal;
|
|
27201
|
-
}(_react.Component);
|
|
27202
|
-
Modal.propTypes = {
|
|
27203
|
-
isOpen: _propTypes2.default.bool.isRequired,
|
|
27204
|
-
style: _propTypes2.default.shape({
|
|
27205
|
-
content: _propTypes2.default.object,
|
|
27206
|
-
overlay: _propTypes2.default.object
|
|
27207
|
-
}),
|
|
27208
|
-
portalClassName: _propTypes2.default.string,
|
|
27209
|
-
bodyOpenClassName: _propTypes2.default.string,
|
|
27210
|
-
htmlOpenClassName: _propTypes2.default.string,
|
|
27211
|
-
className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
|
|
27212
|
-
base: _propTypes2.default.string.isRequired,
|
|
27213
|
-
afterOpen: _propTypes2.default.string.isRequired,
|
|
27214
|
-
beforeClose: _propTypes2.default.string.isRequired
|
|
27215
|
-
})]),
|
|
27216
|
-
overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
|
|
27217
|
-
base: _propTypes2.default.string.isRequired,
|
|
27218
|
-
afterOpen: _propTypes2.default.string.isRequired,
|
|
27219
|
-
beforeClose: _propTypes2.default.string.isRequired
|
|
27220
|
-
})]),
|
|
27221
|
-
appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
|
|
27222
|
-
onAfterOpen: _propTypes2.default.func,
|
|
27223
|
-
onRequestClose: _propTypes2.default.func,
|
|
27224
|
-
closeTimeoutMS: _propTypes2.default.number,
|
|
27225
|
-
ariaHideApp: _propTypes2.default.bool,
|
|
27226
|
-
shouldFocusAfterRender: _propTypes2.default.bool,
|
|
27227
|
-
shouldCloseOnOverlayClick: _propTypes2.default.bool,
|
|
27228
|
-
shouldReturnFocusAfterClose: _propTypes2.default.bool,
|
|
27229
|
-
preventScroll: _propTypes2.default.bool,
|
|
27230
|
-
parentSelector: _propTypes2.default.func,
|
|
27231
|
-
aria: _propTypes2.default.object,
|
|
27232
|
-
data: _propTypes2.default.object,
|
|
27233
|
-
role: _propTypes2.default.string,
|
|
27234
|
-
contentLabel: _propTypes2.default.string,
|
|
27235
|
-
shouldCloseOnEsc: _propTypes2.default.bool,
|
|
27236
|
-
overlayRef: _propTypes2.default.func,
|
|
27237
|
-
contentRef: _propTypes2.default.func,
|
|
27238
|
-
id: _propTypes2.default.string,
|
|
27239
|
-
overlayElement: _propTypes2.default.func,
|
|
27240
|
-
contentElement: _propTypes2.default.func
|
|
27241
|
-
};
|
|
27242
|
-
Modal.defaultProps = {
|
|
27243
|
-
isOpen: false,
|
|
27244
|
-
portalClassName: portalClassName,
|
|
27245
|
-
bodyOpenClassName: bodyOpenClassName,
|
|
27246
|
-
role: "dialog",
|
|
27247
|
-
ariaHideApp: true,
|
|
27248
|
-
closeTimeoutMS: 0,
|
|
27249
|
-
shouldFocusAfterRender: true,
|
|
27250
|
-
shouldCloseOnEsc: true,
|
|
27251
|
-
shouldCloseOnOverlayClick: true,
|
|
27252
|
-
shouldReturnFocusAfterClose: true,
|
|
27253
|
-
preventScroll: false,
|
|
27254
|
-
parentSelector: function parentSelector() {
|
|
27255
|
-
return document.body;
|
|
27256
|
-
},
|
|
27257
|
-
overlayElement: function overlayElement(props, contentEl) {
|
|
27258
|
-
return _react2.default.createElement("div", props, contentEl);
|
|
27259
|
-
},
|
|
27260
|
-
contentElement: function contentElement(props, children) {
|
|
27261
|
-
return _react2.default.createElement("div", props, children);
|
|
27262
|
-
}
|
|
27263
|
-
};
|
|
27264
|
-
Modal.defaultStyles = {
|
|
27265
|
-
overlay: {
|
|
27266
|
-
position: "fixed",
|
|
27267
|
-
top: 0,
|
|
27268
|
-
left: 0,
|
|
27269
|
-
right: 0,
|
|
27270
|
-
bottom: 0,
|
|
27271
|
-
backgroundColor: "rgba(255, 255, 255, 0.75)"
|
|
27272
|
-
},
|
|
27273
|
-
content: {
|
|
27274
|
-
position: "absolute",
|
|
27275
|
-
top: "40px",
|
|
27276
|
-
left: "40px",
|
|
27277
|
-
right: "40px",
|
|
27278
|
-
bottom: "40px",
|
|
27279
|
-
border: "1px solid #ccc",
|
|
27280
|
-
background: "#fff",
|
|
27281
|
-
overflow: "auto",
|
|
27282
|
-
WebkitOverflowScrolling: "touch",
|
|
27283
|
-
borderRadius: "4px",
|
|
27284
|
-
outline: "none",
|
|
27285
|
-
padding: "20px"
|
|
27286
|
-
}
|
|
27287
|
-
};
|
|
27288
|
-
(0, _reactLifecyclesCompat.polyfill)(Modal);
|
|
27289
|
-
if (false) // removed by dead control flow
|
|
27290
|
-
{}
|
|
27291
|
-
exports["default"] = Modal;
|
|
27292
|
-
|
|
27293
|
-
/***/ },
|
|
27294
|
-
|
|
27295
|
-
/***/ 58596
|
|
27296
|
-
(module, exports, __webpack_require__) {
|
|
27297
|
-
|
|
27298
|
-
|
|
27299
|
-
|
|
27300
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
27301
|
-
value: true
|
|
27302
|
-
}));
|
|
27303
|
-
var _extends = Object.assign || function (target) {
|
|
27304
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
27305
|
-
var source = arguments[i];
|
|
27306
|
-
for (var key in source) {
|
|
27307
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
27308
|
-
target[key] = source[key];
|
|
27309
|
-
}
|
|
27310
|
-
}
|
|
27311
|
-
}
|
|
27312
|
-
return target;
|
|
27313
|
-
};
|
|
27314
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
|
|
27315
|
-
return typeof obj;
|
|
27316
|
-
} : function (obj) {
|
|
27317
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
27318
|
-
};
|
|
27319
|
-
var _createClass = function () {
|
|
27320
|
-
function defineProperties(target, props) {
|
|
27321
|
-
for (var i = 0; i < props.length; i++) {
|
|
27322
|
-
var descriptor = props[i];
|
|
27323
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
27324
|
-
descriptor.configurable = true;
|
|
27325
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
27326
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
27327
|
-
}
|
|
27328
|
-
}
|
|
27329
|
-
return function (Constructor, protoProps, staticProps) {
|
|
27330
|
-
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
27331
|
-
if (staticProps) defineProperties(Constructor, staticProps);
|
|
27332
|
-
return Constructor;
|
|
27333
|
-
};
|
|
27334
|
-
}();
|
|
27335
|
-
var _react = __webpack_require__(51649);
|
|
27336
|
-
var _propTypes = __webpack_require__(94370);
|
|
27337
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
27338
|
-
var _focusManager = __webpack_require__(55905);
|
|
27339
|
-
var focusManager = _interopRequireWildcard(_focusManager);
|
|
27340
|
-
var _scopeTab = __webpack_require__(58385);
|
|
27341
|
-
var _scopeTab2 = _interopRequireDefault(_scopeTab);
|
|
27342
|
-
var _ariaAppHider = __webpack_require__(98228);
|
|
27343
|
-
var ariaAppHider = _interopRequireWildcard(_ariaAppHider);
|
|
27344
|
-
var _classList = __webpack_require__(78208);
|
|
27345
|
-
var classList = _interopRequireWildcard(_classList);
|
|
27346
|
-
var _safeHTMLElement = __webpack_require__(8056);
|
|
27347
|
-
var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);
|
|
27348
|
-
var _portalOpenInstances = __webpack_require__(65362);
|
|
27349
|
-
var _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);
|
|
27350
|
-
__webpack_require__(89009);
|
|
27351
|
-
function _interopRequireWildcard(obj) {
|
|
27352
|
-
if (obj && obj.__esModule) {
|
|
27353
|
-
return obj;
|
|
27354
|
-
} else {
|
|
27355
|
-
var newObj = {};
|
|
27356
|
-
if (obj != null) {
|
|
27357
|
-
for (var key in obj) {
|
|
27358
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
|
|
27359
|
-
}
|
|
27360
|
-
}
|
|
27361
|
-
newObj.default = obj;
|
|
27362
|
-
return newObj;
|
|
27363
|
-
}
|
|
27364
|
-
}
|
|
27365
|
-
function _interopRequireDefault(obj) {
|
|
27366
|
-
return obj && obj.__esModule ? obj : {
|
|
27367
|
-
default: obj
|
|
27368
|
-
};
|
|
27369
|
-
}
|
|
27370
|
-
function _classCallCheck(instance, Constructor) {
|
|
27371
|
-
if (!(instance instanceof Constructor)) {
|
|
27372
|
-
throw new TypeError("Cannot call a class as a function");
|
|
27373
|
-
}
|
|
27374
|
-
}
|
|
27375
|
-
function _possibleConstructorReturn(self, call) {
|
|
27376
|
-
if (!self) {
|
|
27377
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
27378
|
-
}
|
|
27379
|
-
return call && (typeof call === "object" || typeof call === "function") ? call : self;
|
|
27380
|
-
}
|
|
27381
|
-
function _inherits(subClass, superClass) {
|
|
27382
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
27383
|
-
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
|
27384
|
-
}
|
|
27385
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
27386
|
-
constructor: {
|
|
27387
|
-
value: subClass,
|
|
27388
|
-
enumerable: false,
|
|
27389
|
-
writable: true,
|
|
27390
|
-
configurable: true
|
|
27391
|
-
}
|
|
27392
|
-
});
|
|
27393
|
-
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
|
27394
|
-
}
|
|
27395
|
-
|
|
27396
|
-
// so that our CSS is statically analyzable
|
|
27397
|
-
var CLASS_NAMES = {
|
|
27398
|
-
overlay: "ReactModal__Overlay",
|
|
27399
|
-
content: "ReactModal__Content"
|
|
27400
|
-
};
|
|
27401
|
-
|
|
27402
|
-
/**
|
|
27403
|
-
* We need to support the deprecated `KeyboardEvent.keyCode` in addition to
|
|
27404
|
-
* `KeyboardEvent.code` for apps that still support IE11. Can be removed when
|
|
27405
|
-
* `react-modal` only supports React >18 (which dropped IE support).
|
|
27406
|
-
*/
|
|
27407
|
-
var isTabKey = function isTabKey(event) {
|
|
27408
|
-
return event.code === "Tab" || event.keyCode === 9;
|
|
27409
|
-
};
|
|
27410
|
-
var isEscKey = function isEscKey(event) {
|
|
27411
|
-
return event.code === "Escape" || event.keyCode === 27;
|
|
27412
|
-
};
|
|
27413
|
-
var ariaHiddenInstances = 0;
|
|
27414
|
-
var ModalPortal = function (_Component) {
|
|
27415
|
-
_inherits(ModalPortal, _Component);
|
|
27416
|
-
function ModalPortal(props) {
|
|
27417
|
-
_classCallCheck(this, ModalPortal);
|
|
27418
|
-
var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props));
|
|
27419
|
-
_this.setOverlayRef = function (overlay) {
|
|
27420
|
-
_this.overlay = overlay;
|
|
27421
|
-
_this.props.overlayRef && _this.props.overlayRef(overlay);
|
|
27422
|
-
};
|
|
27423
|
-
_this.setContentRef = function (content) {
|
|
27424
|
-
_this.content = content;
|
|
27425
|
-
_this.props.contentRef && _this.props.contentRef(content);
|
|
27426
|
-
};
|
|
27427
|
-
_this.afterClose = function () {
|
|
27428
|
-
var _this$props = _this.props,
|
|
27429
|
-
appElement = _this$props.appElement,
|
|
27430
|
-
ariaHideApp = _this$props.ariaHideApp,
|
|
27431
|
-
htmlOpenClassName = _this$props.htmlOpenClassName,
|
|
27432
|
-
bodyOpenClassName = _this$props.bodyOpenClassName,
|
|
27433
|
-
parentSelector = _this$props.parentSelector;
|
|
27434
|
-
var parentDocument = parentSelector && parentSelector().ownerDocument || document;
|
|
27435
|
-
|
|
27436
|
-
// Remove classes.
|
|
27437
|
-
bodyOpenClassName && classList.remove(parentDocument.body, bodyOpenClassName);
|
|
27438
|
-
htmlOpenClassName && classList.remove(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
|
|
27439
|
-
|
|
27440
|
-
// Reset aria-hidden attribute if all modals have been removed
|
|
27441
|
-
if (ariaHideApp && ariaHiddenInstances > 0) {
|
|
27442
|
-
ariaHiddenInstances -= 1;
|
|
27443
|
-
if (ariaHiddenInstances === 0) {
|
|
27444
|
-
ariaAppHider.show(appElement);
|
|
27445
|
-
}
|
|
27446
|
-
}
|
|
27447
|
-
if (_this.props.shouldFocusAfterRender) {
|
|
27448
|
-
if (_this.props.shouldReturnFocusAfterClose) {
|
|
27449
|
-
focusManager.returnFocus(_this.props.preventScroll);
|
|
27450
|
-
focusManager.teardownScopedFocus();
|
|
27451
|
-
} else {
|
|
27452
|
-
focusManager.popWithoutFocus();
|
|
27453
|
-
}
|
|
27454
|
-
}
|
|
27455
|
-
if (_this.props.onAfterClose) {
|
|
27456
|
-
_this.props.onAfterClose();
|
|
27457
|
-
}
|
|
27458
|
-
_portalOpenInstances2.default.deregister(_this);
|
|
27459
|
-
};
|
|
27460
|
-
_this.open = function () {
|
|
27461
|
-
_this.beforeOpen();
|
|
27462
|
-
if (_this.state.afterOpen && _this.state.beforeClose) {
|
|
27463
|
-
clearTimeout(_this.closeTimer);
|
|
27464
|
-
_this.setState({
|
|
27465
|
-
beforeClose: false
|
|
27466
|
-
});
|
|
27467
|
-
} else {
|
|
27468
|
-
if (_this.props.shouldFocusAfterRender) {
|
|
27469
|
-
focusManager.setupScopedFocus(_this.node);
|
|
27470
|
-
focusManager.markForFocusLater();
|
|
27471
|
-
}
|
|
27472
|
-
_this.setState({
|
|
27473
|
-
isOpen: true
|
|
27474
|
-
}, function () {
|
|
27475
|
-
_this.openAnimationFrame = requestAnimationFrame(function () {
|
|
27476
|
-
_this.setState({
|
|
27477
|
-
afterOpen: true
|
|
27478
|
-
});
|
|
27479
|
-
if (_this.props.isOpen && _this.props.onAfterOpen) {
|
|
27480
|
-
_this.props.onAfterOpen({
|
|
27481
|
-
overlayEl: _this.overlay,
|
|
27482
|
-
contentEl: _this.content
|
|
27483
|
-
});
|
|
27484
|
-
}
|
|
27485
|
-
});
|
|
27486
|
-
});
|
|
27487
|
-
}
|
|
27488
|
-
};
|
|
27489
|
-
_this.close = function () {
|
|
27490
|
-
if (_this.props.closeTimeoutMS > 0) {
|
|
27491
|
-
_this.closeWithTimeout();
|
|
27492
|
-
} else {
|
|
27493
|
-
_this.closeWithoutTimeout();
|
|
27494
|
-
}
|
|
27495
|
-
};
|
|
27496
|
-
_this.focusContent = function () {
|
|
27497
|
-
return _this.content && !_this.contentHasFocus() && _this.content.focus({
|
|
27498
|
-
preventScroll: true
|
|
27499
|
-
});
|
|
27500
|
-
};
|
|
27501
|
-
_this.closeWithTimeout = function () {
|
|
27502
|
-
var closesAt = Date.now() + _this.props.closeTimeoutMS;
|
|
27503
|
-
_this.setState({
|
|
27504
|
-
beforeClose: true,
|
|
27505
|
-
closesAt: closesAt
|
|
27506
|
-
}, function () {
|
|
27507
|
-
_this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now());
|
|
27508
|
-
});
|
|
27509
|
-
};
|
|
27510
|
-
_this.closeWithoutTimeout = function () {
|
|
27511
|
-
_this.setState({
|
|
27512
|
-
beforeClose: false,
|
|
27513
|
-
isOpen: false,
|
|
27514
|
-
afterOpen: false,
|
|
27515
|
-
closesAt: null
|
|
27516
|
-
}, _this.afterClose);
|
|
27517
|
-
};
|
|
27518
|
-
_this.handleKeyDown = function (event) {
|
|
27519
|
-
if (isTabKey(event)) {
|
|
27520
|
-
(0, _scopeTab2.default)(_this.content, event);
|
|
27521
|
-
}
|
|
27522
|
-
if (_this.props.shouldCloseOnEsc && isEscKey(event)) {
|
|
27523
|
-
event.stopPropagation();
|
|
27524
|
-
_this.requestClose(event);
|
|
27525
|
-
}
|
|
27526
|
-
};
|
|
27527
|
-
_this.handleOverlayOnClick = function (event) {
|
|
27528
|
-
if (_this.shouldClose === null) {
|
|
27529
|
-
_this.shouldClose = true;
|
|
27530
|
-
}
|
|
27531
|
-
if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) {
|
|
27532
|
-
if (_this.ownerHandlesClose()) {
|
|
27533
|
-
_this.requestClose(event);
|
|
27534
|
-
} else {
|
|
27535
|
-
_this.focusContent();
|
|
27536
|
-
}
|
|
27537
|
-
}
|
|
27538
|
-
_this.shouldClose = null;
|
|
27539
|
-
};
|
|
27540
|
-
_this.handleContentOnMouseUp = function () {
|
|
27541
|
-
_this.shouldClose = false;
|
|
27542
|
-
};
|
|
27543
|
-
_this.handleOverlayOnMouseDown = function (event) {
|
|
27544
|
-
if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) {
|
|
27545
|
-
event.preventDefault();
|
|
27546
|
-
}
|
|
27547
|
-
};
|
|
27548
|
-
_this.handleContentOnClick = function () {
|
|
27549
|
-
_this.shouldClose = false;
|
|
27550
|
-
};
|
|
27551
|
-
_this.handleContentOnMouseDown = function () {
|
|
27552
|
-
_this.shouldClose = false;
|
|
27553
|
-
};
|
|
27554
|
-
_this.requestClose = function (event) {
|
|
27555
|
-
return _this.ownerHandlesClose() && _this.props.onRequestClose(event);
|
|
27556
|
-
};
|
|
27557
|
-
_this.ownerHandlesClose = function () {
|
|
27558
|
-
return _this.props.onRequestClose;
|
|
27559
|
-
};
|
|
27560
|
-
_this.shouldBeClosed = function () {
|
|
27561
|
-
return !_this.state.isOpen && !_this.state.beforeClose;
|
|
27562
|
-
};
|
|
27563
|
-
_this.contentHasFocus = function () {
|
|
27564
|
-
return document.activeElement === _this.content || _this.content.contains(document.activeElement);
|
|
27565
|
-
};
|
|
27566
|
-
_this.buildClassName = function (which, additional) {
|
|
27567
|
-
var classNames = (typeof additional === "undefined" ? "undefined" : _typeof(additional)) === "object" ? additional : {
|
|
27568
|
-
base: CLASS_NAMES[which],
|
|
27569
|
-
afterOpen: CLASS_NAMES[which] + "--after-open",
|
|
27570
|
-
beforeClose: CLASS_NAMES[which] + "--before-close"
|
|
27571
|
-
};
|
|
27572
|
-
var className = classNames.base;
|
|
27573
|
-
if (_this.state.afterOpen) {
|
|
27574
|
-
className = className + " " + classNames.afterOpen;
|
|
27575
|
-
}
|
|
27576
|
-
if (_this.state.beforeClose) {
|
|
27577
|
-
className = className + " " + classNames.beforeClose;
|
|
27578
|
-
}
|
|
27579
|
-
return typeof additional === "string" && additional ? className + " " + additional : className;
|
|
27580
|
-
};
|
|
27581
|
-
_this.attributesFromObject = function (prefix, items) {
|
|
27582
|
-
return Object.keys(items).reduce(function (acc, name) {
|
|
27583
|
-
acc[prefix + "-" + name] = items[name];
|
|
27584
|
-
return acc;
|
|
27585
|
-
}, {});
|
|
27586
|
-
};
|
|
27587
|
-
_this.state = {
|
|
27588
|
-
afterOpen: false,
|
|
27589
|
-
beforeClose: false
|
|
27590
|
-
};
|
|
27591
|
-
_this.shouldClose = null;
|
|
27592
|
-
_this.moveFromContentToOverlay = null;
|
|
27593
|
-
return _this;
|
|
27594
|
-
}
|
|
27595
|
-
_createClass(ModalPortal, [{
|
|
27596
|
-
key: "componentDidMount",
|
|
27597
|
-
value: function componentDidMount() {
|
|
27598
|
-
if (this.props.isOpen) {
|
|
27599
|
-
this.open();
|
|
27600
|
-
}
|
|
27601
|
-
}
|
|
27602
|
-
}, {
|
|
27603
|
-
key: "componentDidUpdate",
|
|
27604
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
27605
|
-
if (false) // removed by dead control flow
|
|
27606
|
-
{}
|
|
27607
|
-
if (this.props.isOpen && !prevProps.isOpen) {
|
|
27608
|
-
this.open();
|
|
27609
|
-
} else if (!this.props.isOpen && prevProps.isOpen) {
|
|
27610
|
-
this.close();
|
|
27611
|
-
}
|
|
27612
|
-
|
|
27613
|
-
// Focus only needs to be set once when the modal is being opened
|
|
27614
|
-
if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) {
|
|
27615
|
-
this.focusContent();
|
|
27616
|
-
}
|
|
27617
|
-
}
|
|
27618
|
-
}, {
|
|
27619
|
-
key: "componentWillUnmount",
|
|
27620
|
-
value: function componentWillUnmount() {
|
|
27621
|
-
if (this.state.isOpen) {
|
|
27622
|
-
this.afterClose();
|
|
27623
|
-
}
|
|
27624
|
-
clearTimeout(this.closeTimer);
|
|
27625
|
-
cancelAnimationFrame(this.openAnimationFrame);
|
|
27626
|
-
}
|
|
27627
|
-
}, {
|
|
27628
|
-
key: "beforeOpen",
|
|
27629
|
-
value: function beforeOpen() {
|
|
27630
|
-
var _props = this.props,
|
|
27631
|
-
appElement = _props.appElement,
|
|
27632
|
-
ariaHideApp = _props.ariaHideApp,
|
|
27633
|
-
htmlOpenClassName = _props.htmlOpenClassName,
|
|
27634
|
-
bodyOpenClassName = _props.bodyOpenClassName,
|
|
27635
|
-
parentSelector = _props.parentSelector;
|
|
27636
|
-
var parentDocument = parentSelector && parentSelector().ownerDocument || document;
|
|
27637
|
-
|
|
27638
|
-
// Add classes.
|
|
27639
|
-
bodyOpenClassName && classList.add(parentDocument.body, bodyOpenClassName);
|
|
27640
|
-
htmlOpenClassName && classList.add(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
|
|
27641
|
-
if (ariaHideApp) {
|
|
27642
|
-
ariaHiddenInstances += 1;
|
|
27643
|
-
ariaAppHider.hide(appElement);
|
|
27644
|
-
}
|
|
27645
|
-
_portalOpenInstances2.default.register(this);
|
|
27646
|
-
}
|
|
27647
|
-
|
|
27648
|
-
// Don't steal focus from inner elements
|
|
27649
|
-
}, {
|
|
27650
|
-
key: "render",
|
|
27651
|
-
value: function render() {
|
|
27652
|
-
var _props2 = this.props,
|
|
27653
|
-
id = _props2.id,
|
|
27654
|
-
className = _props2.className,
|
|
27655
|
-
overlayClassName = _props2.overlayClassName,
|
|
27656
|
-
defaultStyles = _props2.defaultStyles,
|
|
27657
|
-
children = _props2.children;
|
|
27658
|
-
var contentStyles = className ? {} : defaultStyles.content;
|
|
27659
|
-
var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;
|
|
27660
|
-
if (this.shouldBeClosed()) {
|
|
27661
|
-
return null;
|
|
27662
|
-
}
|
|
27663
|
-
var overlayProps = {
|
|
27664
|
-
ref: this.setOverlayRef,
|
|
27665
|
-
className: this.buildClassName("overlay", overlayClassName),
|
|
27666
|
-
style: _extends({}, overlayStyles, this.props.style.overlay),
|
|
27667
|
-
onClick: this.handleOverlayOnClick,
|
|
27668
|
-
onMouseDown: this.handleOverlayOnMouseDown
|
|
27669
|
-
};
|
|
27670
|
-
var contentProps = _extends({
|
|
27671
|
-
id: id,
|
|
27672
|
-
ref: this.setContentRef,
|
|
27673
|
-
style: _extends({}, contentStyles, this.props.style.content),
|
|
27674
|
-
className: this.buildClassName("content", className),
|
|
27675
|
-
tabIndex: "-1",
|
|
27676
|
-
onKeyDown: this.handleKeyDown,
|
|
27677
|
-
onMouseDown: this.handleContentOnMouseDown,
|
|
27678
|
-
onMouseUp: this.handleContentOnMouseUp,
|
|
27679
|
-
onClick: this.handleContentOnClick,
|
|
27680
|
-
role: this.props.role,
|
|
27681
|
-
"aria-label": this.props.contentLabel
|
|
27682
|
-
}, this.attributesFromObject("aria", _extends({
|
|
27683
|
-
modal: true
|
|
27684
|
-
}, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), {
|
|
27685
|
-
"data-testid": this.props.testId
|
|
27686
|
-
});
|
|
27687
|
-
var contentElement = this.props.contentElement(contentProps, children);
|
|
27688
|
-
return this.props.overlayElement(overlayProps, contentElement);
|
|
27689
|
-
}
|
|
27690
|
-
}]);
|
|
27691
|
-
return ModalPortal;
|
|
27692
|
-
}(_react.Component);
|
|
27693
|
-
ModalPortal.defaultProps = {
|
|
27694
|
-
style: {
|
|
27695
|
-
overlay: {},
|
|
27696
|
-
content: {}
|
|
27697
|
-
},
|
|
27698
|
-
defaultStyles: {}
|
|
27699
|
-
};
|
|
27700
|
-
ModalPortal.propTypes = {
|
|
27701
|
-
isOpen: _propTypes2.default.bool.isRequired,
|
|
27702
|
-
defaultStyles: _propTypes2.default.shape({
|
|
27703
|
-
content: _propTypes2.default.object,
|
|
27704
|
-
overlay: _propTypes2.default.object
|
|
27705
|
-
}),
|
|
27706
|
-
style: _propTypes2.default.shape({
|
|
27707
|
-
content: _propTypes2.default.object,
|
|
27708
|
-
overlay: _propTypes2.default.object
|
|
27709
|
-
}),
|
|
27710
|
-
className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
|
|
27711
|
-
overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
|
|
27712
|
-
parentSelector: _propTypes2.default.func,
|
|
27713
|
-
bodyOpenClassName: _propTypes2.default.string,
|
|
27714
|
-
htmlOpenClassName: _propTypes2.default.string,
|
|
27715
|
-
ariaHideApp: _propTypes2.default.bool,
|
|
27716
|
-
appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
|
|
27717
|
-
onAfterOpen: _propTypes2.default.func,
|
|
27718
|
-
onAfterClose: _propTypes2.default.func,
|
|
27719
|
-
onRequestClose: _propTypes2.default.func,
|
|
27720
|
-
closeTimeoutMS: _propTypes2.default.number,
|
|
27721
|
-
shouldFocusAfterRender: _propTypes2.default.bool,
|
|
27722
|
-
shouldCloseOnOverlayClick: _propTypes2.default.bool,
|
|
27723
|
-
shouldReturnFocusAfterClose: _propTypes2.default.bool,
|
|
27724
|
-
preventScroll: _propTypes2.default.bool,
|
|
27725
|
-
role: _propTypes2.default.string,
|
|
27726
|
-
contentLabel: _propTypes2.default.string,
|
|
27727
|
-
aria: _propTypes2.default.object,
|
|
27728
|
-
data: _propTypes2.default.object,
|
|
27729
|
-
children: _propTypes2.default.node,
|
|
27730
|
-
shouldCloseOnEsc: _propTypes2.default.bool,
|
|
27731
|
-
overlayRef: _propTypes2.default.func,
|
|
27732
|
-
contentRef: _propTypes2.default.func,
|
|
27733
|
-
id: _propTypes2.default.string,
|
|
27734
|
-
overlayElement: _propTypes2.default.func,
|
|
27735
|
-
contentElement: _propTypes2.default.func,
|
|
27736
|
-
testId: _propTypes2.default.string
|
|
27737
|
-
};
|
|
27738
|
-
exports["default"] = ModalPortal;
|
|
27739
|
-
module.exports = exports["default"];
|
|
27740
|
-
|
|
27741
|
-
/***/ },
|
|
27742
|
-
|
|
27743
|
-
/***/ 98228
|
|
27744
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
27745
|
-
|
|
27746
|
-
|
|
27747
|
-
|
|
27748
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
27749
|
-
value: true
|
|
27750
|
-
}));
|
|
27751
|
-
exports.resetState = resetState;
|
|
27752
|
-
exports.log = log;
|
|
27753
|
-
exports.assertNodeList = assertNodeList;
|
|
27754
|
-
exports.setElement = setElement;
|
|
27755
|
-
exports.validateElement = validateElement;
|
|
27756
|
-
exports.hide = hide;
|
|
27757
|
-
exports.show = show;
|
|
27758
|
-
exports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;
|
|
27759
|
-
var _warning = __webpack_require__(20205);
|
|
27760
|
-
var _warning2 = _interopRequireDefault(_warning);
|
|
27761
|
-
var _safeHTMLElement = __webpack_require__(8056);
|
|
27762
|
-
function _interopRequireDefault(obj) {
|
|
27763
|
-
return obj && obj.__esModule ? obj : {
|
|
27764
|
-
default: obj
|
|
27765
|
-
};
|
|
27766
|
-
}
|
|
27767
|
-
var globalElement = null;
|
|
27768
|
-
|
|
27769
|
-
/* eslint-disable no-console */
|
|
27770
|
-
/* istanbul ignore next */
|
|
27771
|
-
function resetState() {
|
|
27772
|
-
if (globalElement) {
|
|
27773
|
-
if (globalElement.removeAttribute) {
|
|
27774
|
-
globalElement.removeAttribute("aria-hidden");
|
|
27775
|
-
} else if (globalElement.length != null) {
|
|
27776
|
-
globalElement.forEach(function (element) {
|
|
27777
|
-
return element.removeAttribute("aria-hidden");
|
|
27778
|
-
});
|
|
27779
|
-
} else {
|
|
27780
|
-
document.querySelectorAll(globalElement).forEach(function (element) {
|
|
27781
|
-
return element.removeAttribute("aria-hidden");
|
|
27782
|
-
});
|
|
27783
|
-
}
|
|
27784
|
-
}
|
|
27785
|
-
globalElement = null;
|
|
27786
|
-
}
|
|
27787
|
-
|
|
27788
|
-
/* istanbul ignore next */
|
|
27789
|
-
function log() {
|
|
27790
|
-
if (false) // removed by dead control flow
|
|
27791
|
-
{ var check; }
|
|
27792
|
-
}
|
|
27793
|
-
/* eslint-enable no-console */
|
|
27794
|
-
|
|
27795
|
-
function assertNodeList(nodeList, selector) {
|
|
27796
|
-
if (!nodeList || !nodeList.length) {
|
|
27797
|
-
throw new Error("react-modal: No elements were found for selector " + selector + ".");
|
|
27798
|
-
}
|
|
27799
|
-
}
|
|
27800
|
-
function setElement(element) {
|
|
27801
|
-
var useElement = element;
|
|
27802
|
-
if (typeof useElement === "string" && _safeHTMLElement.canUseDOM) {
|
|
27803
|
-
var el = document.querySelectorAll(useElement);
|
|
27804
|
-
assertNodeList(el, useElement);
|
|
27805
|
-
useElement = el;
|
|
27806
|
-
}
|
|
27807
|
-
globalElement = useElement || globalElement;
|
|
27808
|
-
return globalElement;
|
|
27809
|
-
}
|
|
27810
|
-
function validateElement(appElement) {
|
|
27811
|
-
var el = appElement || globalElement;
|
|
27812
|
-
if (el) {
|
|
27813
|
-
return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el];
|
|
27814
|
-
} else {
|
|
27815
|
-
(0, _warning2.default)(false, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" "));
|
|
27816
|
-
return [];
|
|
27817
|
-
}
|
|
27818
|
-
}
|
|
27819
|
-
function hide(appElement) {
|
|
27820
|
-
var _iteratorNormalCompletion = true;
|
|
27821
|
-
var _didIteratorError = false;
|
|
27822
|
-
var _iteratorError = undefined;
|
|
27823
|
-
try {
|
|
27824
|
-
for (var _iterator = validateElement(appElement)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
27825
|
-
var el = _step.value;
|
|
27826
|
-
el.setAttribute("aria-hidden", "true");
|
|
27827
|
-
}
|
|
27828
|
-
} catch (err) {
|
|
27829
|
-
_didIteratorError = true;
|
|
27830
|
-
_iteratorError = err;
|
|
27831
|
-
} finally {
|
|
27832
|
-
try {
|
|
27833
|
-
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
27834
|
-
_iterator.return();
|
|
27835
|
-
}
|
|
27836
|
-
} finally {
|
|
27837
|
-
if (_didIteratorError) {
|
|
27838
|
-
throw _iteratorError;
|
|
27839
|
-
}
|
|
27840
|
-
}
|
|
27841
|
-
}
|
|
27842
|
-
}
|
|
27843
|
-
function show(appElement) {
|
|
27844
|
-
var _iteratorNormalCompletion2 = true;
|
|
27845
|
-
var _didIteratorError2 = false;
|
|
27846
|
-
var _iteratorError2 = undefined;
|
|
27847
|
-
try {
|
|
27848
|
-
for (var _iterator2 = validateElement(appElement)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
27849
|
-
var el = _step2.value;
|
|
27850
|
-
el.removeAttribute("aria-hidden");
|
|
27851
|
-
}
|
|
27852
|
-
} catch (err) {
|
|
27853
|
-
_didIteratorError2 = true;
|
|
27854
|
-
_iteratorError2 = err;
|
|
27855
|
-
} finally {
|
|
27856
|
-
try {
|
|
27857
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return) {
|
|
27858
|
-
_iterator2.return();
|
|
27859
|
-
}
|
|
27860
|
-
} finally {
|
|
27861
|
-
if (_didIteratorError2) {
|
|
27862
|
-
throw _iteratorError2;
|
|
27863
|
-
}
|
|
27864
|
-
}
|
|
27865
|
-
}
|
|
27866
|
-
}
|
|
27867
|
-
function documentNotReadyOrSSRTesting() {
|
|
27868
|
-
globalElement = null;
|
|
27869
|
-
}
|
|
27870
|
-
|
|
27871
|
-
/***/ },
|
|
27872
|
-
|
|
27873
|
-
/***/ 89009
|
|
27874
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
27875
|
-
|
|
27876
|
-
|
|
27877
|
-
|
|
27878
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
27879
|
-
value: true
|
|
27880
|
-
}));
|
|
27881
|
-
exports.resetState = resetState;
|
|
27882
|
-
exports.log = log;
|
|
27883
|
-
var _portalOpenInstances = __webpack_require__(65362);
|
|
27884
|
-
var _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);
|
|
27885
|
-
function _interopRequireDefault(obj) {
|
|
27886
|
-
return obj && obj.__esModule ? obj : {
|
|
27887
|
-
default: obj
|
|
27888
|
-
};
|
|
27889
|
-
}
|
|
27890
|
-
|
|
27891
|
-
// Body focus trap see Issue #742
|
|
27892
|
-
|
|
27893
|
-
var before = void 0,
|
|
27894
|
-
after = void 0,
|
|
27895
|
-
instances = [];
|
|
27896
|
-
|
|
27897
|
-
/* eslint-disable no-console */
|
|
27898
|
-
/* istanbul ignore next */
|
|
27899
|
-
function resetState() {
|
|
27900
|
-
var _arr = [before, after];
|
|
27901
|
-
for (var _i = 0; _i < _arr.length; _i++) {
|
|
27902
|
-
var item = _arr[_i];
|
|
27903
|
-
if (!item) continue;
|
|
27904
|
-
item.parentNode && item.parentNode.removeChild(item);
|
|
27905
|
-
}
|
|
27906
|
-
before = after = null;
|
|
27907
|
-
instances = [];
|
|
27908
|
-
}
|
|
27909
|
-
|
|
27910
|
-
/* istanbul ignore next */
|
|
27911
|
-
function log() {
|
|
27912
|
-
console.log("bodyTrap ----------");
|
|
27913
|
-
console.log(instances.length);
|
|
27914
|
-
var _arr2 = [before, after];
|
|
27915
|
-
for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
|
|
27916
|
-
var item = _arr2[_i2];
|
|
27917
|
-
var check = item || {};
|
|
27918
|
-
console.log(check.nodeName, check.className, check.id);
|
|
27919
|
-
}
|
|
27920
|
-
console.log("edn bodyTrap ----------");
|
|
27921
|
-
}
|
|
27922
|
-
/* eslint-enable no-console */
|
|
27923
|
-
|
|
27924
|
-
function focusContent() {
|
|
27925
|
-
if (instances.length === 0) {
|
|
27926
|
-
if (false) // removed by dead control flow
|
|
27927
|
-
{}
|
|
27928
|
-
return;
|
|
27929
|
-
}
|
|
27930
|
-
instances[instances.length - 1].focusContent();
|
|
27931
|
-
}
|
|
27932
|
-
function bodyTrap(eventType, openInstances) {
|
|
27933
|
-
if (!before && !after) {
|
|
27934
|
-
before = document.createElement("div");
|
|
27935
|
-
before.setAttribute("data-react-modal-body-trap", "");
|
|
27936
|
-
before.style.position = "absolute";
|
|
27937
|
-
before.style.opacity = "0";
|
|
27938
|
-
before.setAttribute("tabindex", "0");
|
|
27939
|
-
before.addEventListener("focus", focusContent);
|
|
27940
|
-
after = before.cloneNode();
|
|
27941
|
-
after.addEventListener("focus", focusContent);
|
|
27942
|
-
}
|
|
27943
|
-
instances = openInstances;
|
|
27944
|
-
if (instances.length > 0) {
|
|
27945
|
-
// Add focus trap
|
|
27946
|
-
if (document.body.firstChild !== before) {
|
|
27947
|
-
document.body.insertBefore(before, document.body.firstChild);
|
|
27948
|
-
}
|
|
27949
|
-
if (document.body.lastChild !== after) {
|
|
27950
|
-
document.body.appendChild(after);
|
|
27951
|
-
}
|
|
27952
|
-
} else {
|
|
27953
|
-
// Remove focus trap
|
|
27954
|
-
if (before.parentElement) {
|
|
27955
|
-
before.parentElement.removeChild(before);
|
|
27956
|
-
}
|
|
27957
|
-
if (after.parentElement) {
|
|
27958
|
-
after.parentElement.removeChild(after);
|
|
27959
|
-
}
|
|
27960
|
-
}
|
|
27961
|
-
}
|
|
27962
|
-
_portalOpenInstances2.default.subscribe(bodyTrap);
|
|
27963
|
-
|
|
27964
|
-
/***/ },
|
|
27965
|
-
|
|
27966
|
-
/***/ 78208
|
|
27967
|
-
(__unused_webpack_module, exports) {
|
|
27968
|
-
|
|
27969
|
-
|
|
27970
|
-
|
|
27971
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
27972
|
-
value: true
|
|
27973
|
-
}));
|
|
27974
|
-
exports.resetState = resetState;
|
|
27975
|
-
exports.log = log;
|
|
27976
|
-
var htmlClassList = {};
|
|
27977
|
-
var docBodyClassList = {};
|
|
27978
|
-
|
|
27979
|
-
/* eslint-disable no-console */
|
|
27980
|
-
/* istanbul ignore next */
|
|
27981
|
-
function removeClass(at, cls) {
|
|
27982
|
-
at.classList.remove(cls);
|
|
27983
|
-
}
|
|
27984
|
-
|
|
27985
|
-
/* istanbul ignore next */
|
|
27986
|
-
function resetState() {
|
|
27987
|
-
var htmlElement = document.getElementsByTagName("html")[0];
|
|
27988
|
-
for (var cls in htmlClassList) {
|
|
27989
|
-
removeClass(htmlElement, htmlClassList[cls]);
|
|
27990
|
-
}
|
|
27991
|
-
var body = document.body;
|
|
27992
|
-
for (var _cls in docBodyClassList) {
|
|
27993
|
-
removeClass(body, docBodyClassList[_cls]);
|
|
27994
|
-
}
|
|
27995
|
-
htmlClassList = {};
|
|
27996
|
-
docBodyClassList = {};
|
|
27997
|
-
}
|
|
27998
|
-
|
|
27999
|
-
/* istanbul ignore next */
|
|
28000
|
-
function log() {
|
|
28001
|
-
if (false) // removed by dead control flow
|
|
28002
|
-
{ var _x, x, buffer, classes; }
|
|
28003
|
-
}
|
|
28004
|
-
/* eslint-enable no-console */
|
|
28005
|
-
|
|
28006
|
-
/**
|
|
28007
|
-
* Track the number of reference of a class.
|
|
28008
|
-
* @param {object} poll The poll to receive the reference.
|
|
28009
|
-
* @param {string} className The class name.
|
|
28010
|
-
* @return {string}
|
|
28011
|
-
*/
|
|
28012
|
-
var incrementReference = function incrementReference(poll, className) {
|
|
28013
|
-
if (!poll[className]) {
|
|
28014
|
-
poll[className] = 0;
|
|
28015
|
-
}
|
|
28016
|
-
poll[className] += 1;
|
|
28017
|
-
return className;
|
|
28018
|
-
};
|
|
28019
|
-
|
|
28020
|
-
/**
|
|
28021
|
-
* Drop the reference of a class.
|
|
28022
|
-
* @param {object} poll The poll to receive the reference.
|
|
28023
|
-
* @param {string} className The class name.
|
|
28024
|
-
* @return {string}
|
|
28025
|
-
*/
|
|
28026
|
-
var decrementReference = function decrementReference(poll, className) {
|
|
28027
|
-
if (poll[className]) {
|
|
28028
|
-
poll[className] -= 1;
|
|
28029
|
-
}
|
|
28030
|
-
return className;
|
|
28031
|
-
};
|
|
28032
|
-
|
|
28033
|
-
/**
|
|
28034
|
-
* Track a class and add to the given class list.
|
|
28035
|
-
* @param {Object} classListRef A class list of an element.
|
|
28036
|
-
* @param {Object} poll The poll to be used.
|
|
28037
|
-
* @param {Array} classes The list of classes to be tracked.
|
|
28038
|
-
*/
|
|
28039
|
-
var trackClass = function trackClass(classListRef, poll, classes) {
|
|
28040
|
-
classes.forEach(function (className) {
|
|
28041
|
-
incrementReference(poll, className);
|
|
28042
|
-
classListRef.add(className);
|
|
28043
|
-
});
|
|
28044
|
-
};
|
|
28045
|
-
|
|
28046
|
-
/**
|
|
28047
|
-
* Untrack a class and remove from the given class list if the reference
|
|
28048
|
-
* reaches 0.
|
|
28049
|
-
* @param {Object} classListRef A class list of an element.
|
|
28050
|
-
* @param {Object} poll The poll to be used.
|
|
28051
|
-
* @param {Array} classes The list of classes to be untracked.
|
|
28052
|
-
*/
|
|
28053
|
-
var untrackClass = function untrackClass(classListRef, poll, classes) {
|
|
28054
|
-
classes.forEach(function (className) {
|
|
28055
|
-
decrementReference(poll, className);
|
|
28056
|
-
poll[className] === 0 && classListRef.remove(className);
|
|
28057
|
-
});
|
|
28058
|
-
};
|
|
28059
|
-
|
|
28060
|
-
/**
|
|
28061
|
-
* Public inferface to add classes to the document.body.
|
|
28062
|
-
* @param {string} bodyClass The class string to be added.
|
|
28063
|
-
* It may contain more then one class
|
|
28064
|
-
* with ' ' as separator.
|
|
28065
|
-
*/
|
|
28066
|
-
var add = exports.add = function add(element, classString) {
|
|
28067
|
-
return trackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" "));
|
|
28068
|
-
};
|
|
28069
|
-
|
|
28070
|
-
/**
|
|
28071
|
-
* Public inferface to remove classes from the document.body.
|
|
28072
|
-
* @param {string} bodyClass The class string to be added.
|
|
28073
|
-
* It may contain more then one class
|
|
28074
|
-
* with ' ' as separator.
|
|
28075
|
-
*/
|
|
28076
|
-
var remove = exports.remove = function remove(element, classString) {
|
|
28077
|
-
return untrackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" "));
|
|
28078
|
-
};
|
|
28079
|
-
|
|
28080
|
-
/***/ },
|
|
28081
|
-
|
|
28082
|
-
/***/ 55905
|
|
28083
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
28084
|
-
|
|
28085
|
-
|
|
28086
|
-
|
|
28087
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
28088
|
-
value: true
|
|
28089
|
-
}));
|
|
28090
|
-
exports.resetState = resetState;
|
|
28091
|
-
exports.log = log;
|
|
28092
|
-
exports.handleBlur = handleBlur;
|
|
28093
|
-
exports.handleFocus = handleFocus;
|
|
28094
|
-
exports.markForFocusLater = markForFocusLater;
|
|
28095
|
-
exports.returnFocus = returnFocus;
|
|
28096
|
-
exports.popWithoutFocus = popWithoutFocus;
|
|
28097
|
-
exports.setupScopedFocus = setupScopedFocus;
|
|
28098
|
-
exports.teardownScopedFocus = teardownScopedFocus;
|
|
28099
|
-
var _tabbable = __webpack_require__(39605);
|
|
28100
|
-
var _tabbable2 = _interopRequireDefault(_tabbable);
|
|
28101
|
-
function _interopRequireDefault(obj) {
|
|
28102
|
-
return obj && obj.__esModule ? obj : {
|
|
28103
|
-
default: obj
|
|
28104
|
-
};
|
|
28105
|
-
}
|
|
28106
|
-
var focusLaterElements = [];
|
|
28107
|
-
var modalElement = null;
|
|
28108
|
-
var needToFocus = false;
|
|
28109
|
-
|
|
28110
|
-
/* eslint-disable no-console */
|
|
28111
|
-
/* istanbul ignore next */
|
|
28112
|
-
function resetState() {
|
|
28113
|
-
focusLaterElements = [];
|
|
28114
|
-
}
|
|
28115
|
-
|
|
28116
|
-
/* istanbul ignore next */
|
|
28117
|
-
function log() {
|
|
28118
|
-
if (false) // removed by dead control flow
|
|
28119
|
-
{}
|
|
28120
|
-
}
|
|
28121
|
-
/* eslint-enable no-console */
|
|
28122
|
-
|
|
28123
|
-
function handleBlur() {
|
|
28124
|
-
needToFocus = true;
|
|
28125
|
-
}
|
|
28126
|
-
function handleFocus() {
|
|
28127
|
-
if (needToFocus) {
|
|
28128
|
-
needToFocus = false;
|
|
28129
|
-
if (!modalElement) {
|
|
28130
|
-
return;
|
|
28131
|
-
}
|
|
28132
|
-
// need to see how jQuery shims document.on('focusin') so we don't need the
|
|
28133
|
-
// setTimeout, firefox doesn't support focusin, if it did, we could focus
|
|
28134
|
-
// the element outside of a setTimeout. Side-effect of this implementation
|
|
28135
|
-
// is that the document.body gets focus, and then we focus our element right
|
|
28136
|
-
// after, seems fine.
|
|
28137
|
-
setTimeout(function () {
|
|
28138
|
-
if (modalElement.contains(document.activeElement)) {
|
|
28139
|
-
return;
|
|
28140
|
-
}
|
|
28141
|
-
var el = (0, _tabbable2.default)(modalElement)[0] || modalElement;
|
|
28142
|
-
el.focus();
|
|
28143
|
-
}, 0);
|
|
28144
|
-
}
|
|
28145
|
-
}
|
|
28146
|
-
function markForFocusLater() {
|
|
28147
|
-
focusLaterElements.push(document.activeElement);
|
|
28148
|
-
}
|
|
28149
|
-
|
|
28150
|
-
/* eslint-disable no-console */
|
|
28151
|
-
function returnFocus() {
|
|
28152
|
-
var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
28153
|
-
var toFocus = null;
|
|
28154
|
-
try {
|
|
28155
|
-
if (focusLaterElements.length !== 0) {
|
|
28156
|
-
toFocus = focusLaterElements.pop();
|
|
28157
|
-
toFocus.focus({
|
|
28158
|
-
preventScroll: preventScroll
|
|
28159
|
-
});
|
|
28160
|
-
}
|
|
28161
|
-
return;
|
|
28162
|
-
} catch (e) {
|
|
28163
|
-
console.warn(["You tried to return focus to", toFocus, "but it is not in the DOM anymore"].join(" "));
|
|
28164
|
-
}
|
|
28165
|
-
}
|
|
28166
|
-
/* eslint-enable no-console */
|
|
28167
|
-
|
|
28168
|
-
function popWithoutFocus() {
|
|
28169
|
-
focusLaterElements.length > 0 && focusLaterElements.pop();
|
|
28170
|
-
}
|
|
28171
|
-
function setupScopedFocus(element) {
|
|
28172
|
-
modalElement = element;
|
|
28173
|
-
if (window.addEventListener) {
|
|
28174
|
-
window.addEventListener("blur", handleBlur, false);
|
|
28175
|
-
document.addEventListener("focus", handleFocus, true);
|
|
28176
|
-
} else {
|
|
28177
|
-
window.attachEvent("onBlur", handleBlur);
|
|
28178
|
-
document.attachEvent("onFocus", handleFocus);
|
|
28179
|
-
}
|
|
28180
|
-
}
|
|
28181
|
-
function teardownScopedFocus() {
|
|
28182
|
-
modalElement = null;
|
|
28183
|
-
if (window.addEventListener) {
|
|
28184
|
-
window.removeEventListener("blur", handleBlur);
|
|
28185
|
-
document.removeEventListener("focus", handleFocus);
|
|
28186
|
-
} else {
|
|
28187
|
-
window.detachEvent("onBlur", handleBlur);
|
|
28188
|
-
document.detachEvent("onFocus", handleFocus);
|
|
28189
|
-
}
|
|
28190
|
-
}
|
|
28191
|
-
|
|
28192
|
-
/***/ },
|
|
28193
|
-
|
|
28194
|
-
/***/ 65362
|
|
28195
|
-
(__unused_webpack_module, exports) {
|
|
28196
|
-
|
|
28197
|
-
|
|
28198
|
-
|
|
28199
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
28200
|
-
value: true
|
|
28201
|
-
}));
|
|
28202
|
-
exports.log = log;
|
|
28203
|
-
exports.resetState = resetState;
|
|
28204
|
-
function _classCallCheck(instance, Constructor) {
|
|
28205
|
-
if (!(instance instanceof Constructor)) {
|
|
28206
|
-
throw new TypeError("Cannot call a class as a function");
|
|
28207
|
-
}
|
|
28208
|
-
}
|
|
28209
|
-
|
|
28210
|
-
// Tracks portals that are open and emits events to subscribers
|
|
28211
|
-
|
|
28212
|
-
var PortalOpenInstances = function PortalOpenInstances() {
|
|
28213
|
-
var _this = this;
|
|
28214
|
-
_classCallCheck(this, PortalOpenInstances);
|
|
28215
|
-
this.register = function (openInstance) {
|
|
28216
|
-
if (_this.openInstances.indexOf(openInstance) !== -1) {
|
|
28217
|
-
if (false) // removed by dead control flow
|
|
28218
|
-
{}
|
|
28219
|
-
return;
|
|
28220
|
-
}
|
|
28221
|
-
_this.openInstances.push(openInstance);
|
|
28222
|
-
_this.emit("register");
|
|
28223
|
-
};
|
|
28224
|
-
this.deregister = function (openInstance) {
|
|
28225
|
-
var index = _this.openInstances.indexOf(openInstance);
|
|
28226
|
-
if (index === -1) {
|
|
28227
|
-
if (false) // removed by dead control flow
|
|
28228
|
-
{}
|
|
28229
|
-
return;
|
|
28230
|
-
}
|
|
28231
|
-
_this.openInstances.splice(index, 1);
|
|
28232
|
-
_this.emit("deregister");
|
|
28233
|
-
};
|
|
28234
|
-
this.subscribe = function (callback) {
|
|
28235
|
-
_this.subscribers.push(callback);
|
|
28236
|
-
};
|
|
28237
|
-
this.emit = function (eventType) {
|
|
28238
|
-
_this.subscribers.forEach(function (subscriber) {
|
|
28239
|
-
return subscriber(eventType,
|
|
28240
|
-
// shallow copy to avoid accidental mutation
|
|
28241
|
-
_this.openInstances.slice());
|
|
28242
|
-
});
|
|
28243
|
-
};
|
|
28244
|
-
this.openInstances = [];
|
|
28245
|
-
this.subscribers = [];
|
|
28246
|
-
};
|
|
28247
|
-
var portalOpenInstances = new PortalOpenInstances();
|
|
28248
|
-
|
|
28249
|
-
/* eslint-disable no-console */
|
|
28250
|
-
/* istanbul ignore next */
|
|
28251
|
-
function log() {
|
|
28252
|
-
console.log("portalOpenInstances ----------");
|
|
28253
|
-
console.log(portalOpenInstances.openInstances.length);
|
|
28254
|
-
portalOpenInstances.openInstances.forEach(function (p) {
|
|
28255
|
-
return console.log(p);
|
|
28256
|
-
});
|
|
28257
|
-
console.log("end portalOpenInstances ----------");
|
|
28258
|
-
}
|
|
28259
|
-
|
|
28260
|
-
/* istanbul ignore next */
|
|
28261
|
-
function resetState() {
|
|
28262
|
-
portalOpenInstances = new PortalOpenInstances();
|
|
28263
|
-
}
|
|
28264
|
-
/* eslint-enable no-console */
|
|
28265
|
-
|
|
28266
|
-
exports["default"] = portalOpenInstances;
|
|
28267
|
-
|
|
28268
|
-
/***/ },
|
|
28269
|
-
|
|
28270
|
-
/***/ 8056
|
|
28271
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
28272
|
-
|
|
28273
|
-
|
|
28274
|
-
|
|
28275
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
28276
|
-
value: true
|
|
28277
|
-
}));
|
|
28278
|
-
exports.canUseDOM = exports.SafeNodeList = exports.SafeHTMLCollection = undefined;
|
|
28279
|
-
var _exenv = __webpack_require__(61513);
|
|
28280
|
-
var _exenv2 = _interopRequireDefault(_exenv);
|
|
28281
|
-
function _interopRequireDefault(obj) {
|
|
28282
|
-
return obj && obj.__esModule ? obj : {
|
|
28283
|
-
default: obj
|
|
28284
|
-
};
|
|
28285
|
-
}
|
|
28286
|
-
var EE = _exenv2.default;
|
|
28287
|
-
var SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};
|
|
28288
|
-
var SafeHTMLCollection = exports.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};
|
|
28289
|
-
var SafeNodeList = exports.SafeNodeList = EE.canUseDOM ? window.NodeList : {};
|
|
28290
|
-
var canUseDOM = exports.canUseDOM = EE.canUseDOM;
|
|
28291
|
-
exports["default"] = SafeHTMLElement;
|
|
28292
|
-
|
|
28293
|
-
/***/ },
|
|
28294
|
-
|
|
28295
|
-
/***/ 58385
|
|
28296
|
-
(module, exports, __webpack_require__) {
|
|
28297
|
-
|
|
28298
|
-
|
|
28299
|
-
|
|
28300
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
28301
|
-
value: true
|
|
28302
|
-
}));
|
|
28303
|
-
exports["default"] = scopeTab;
|
|
28304
|
-
var _tabbable = __webpack_require__(39605);
|
|
28305
|
-
var _tabbable2 = _interopRequireDefault(_tabbable);
|
|
28306
|
-
function _interopRequireDefault(obj) {
|
|
28307
|
-
return obj && obj.__esModule ? obj : {
|
|
28308
|
-
default: obj
|
|
28309
|
-
};
|
|
28310
|
-
}
|
|
28311
|
-
function getActiveElement() {
|
|
28312
|
-
var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
28313
|
-
return el.activeElement.shadowRoot ? getActiveElement(el.activeElement.shadowRoot) : el.activeElement;
|
|
28314
|
-
}
|
|
28315
|
-
function scopeTab(node, event) {
|
|
28316
|
-
var tabbable = (0, _tabbable2.default)(node);
|
|
28317
|
-
if (!tabbable.length) {
|
|
28318
|
-
// Do nothing, since there are no elements that can receive focus.
|
|
28319
|
-
event.preventDefault();
|
|
28320
|
-
return;
|
|
28321
|
-
}
|
|
28322
|
-
var target = void 0;
|
|
28323
|
-
var shiftKey = event.shiftKey;
|
|
28324
|
-
var head = tabbable[0];
|
|
28325
|
-
var tail = tabbable[tabbable.length - 1];
|
|
28326
|
-
var activeElement = getActiveElement();
|
|
28327
|
-
|
|
28328
|
-
// proceed with default browser behavior on tab.
|
|
28329
|
-
// Focus on last element on shift + tab.
|
|
28330
|
-
if (node === activeElement) {
|
|
28331
|
-
if (!shiftKey) return;
|
|
28332
|
-
target = tail;
|
|
28333
|
-
}
|
|
28334
|
-
if (tail === activeElement && !shiftKey) {
|
|
28335
|
-
target = head;
|
|
28336
|
-
}
|
|
28337
|
-
if (head === activeElement && shiftKey) {
|
|
28338
|
-
target = tail;
|
|
28339
|
-
}
|
|
28340
|
-
if (target) {
|
|
28341
|
-
event.preventDefault();
|
|
28342
|
-
target.focus();
|
|
28343
|
-
return;
|
|
28344
|
-
}
|
|
28345
|
-
|
|
28346
|
-
// Safari radio issue.
|
|
28347
|
-
//
|
|
28348
|
-
// Safari does not move the focus to the radio button,
|
|
28349
|
-
// so we need to force it to really walk through all elements.
|
|
28350
|
-
//
|
|
28351
|
-
// This is very error prone, since we are trying to guess
|
|
28352
|
-
// if it is a safari browser from the first occurence between
|
|
28353
|
-
// chrome or safari.
|
|
28354
|
-
//
|
|
28355
|
-
// The chrome user agent contains the first ocurrence
|
|
28356
|
-
// as the 'chrome/version' and later the 'safari/version'.
|
|
28357
|
-
var checkSafari = /(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);
|
|
28358
|
-
var isSafariDesktop = checkSafari != null && checkSafari[1] != "Chrome" && /\biPod\b|\biPad\b/g.exec(navigator.userAgent) == null;
|
|
28359
|
-
|
|
28360
|
-
// If we are not in safari desktop, let the browser control
|
|
28361
|
-
// the focus
|
|
28362
|
-
if (!isSafariDesktop) return;
|
|
28363
|
-
var x = tabbable.indexOf(activeElement);
|
|
28364
|
-
if (x > -1) {
|
|
28365
|
-
x += shiftKey ? -1 : 1;
|
|
28366
|
-
}
|
|
28367
|
-
target = tabbable[x];
|
|
28368
|
-
|
|
28369
|
-
// If the tabbable element does not exist,
|
|
28370
|
-
// focus head/tail based on shiftKey
|
|
28371
|
-
if (typeof target === "undefined") {
|
|
28372
|
-
event.preventDefault();
|
|
28373
|
-
target = shiftKey ? tail : head;
|
|
28374
|
-
target.focus();
|
|
28375
|
-
return;
|
|
28376
|
-
}
|
|
28377
|
-
event.preventDefault();
|
|
28378
|
-
target.focus();
|
|
28379
|
-
}
|
|
28380
|
-
module.exports = exports["default"];
|
|
28381
|
-
|
|
28382
|
-
/***/ },
|
|
28383
|
-
|
|
28384
|
-
/***/ 39605
|
|
28385
|
-
(module, exports) {
|
|
28386
|
-
|
|
28387
|
-
|
|
28388
|
-
|
|
28389
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
28390
|
-
value: true
|
|
28391
|
-
}));
|
|
28392
|
-
exports["default"] = findTabbableDescendants;
|
|
28393
|
-
/*!
|
|
28394
|
-
* Adapted from jQuery UI core
|
|
28395
|
-
*
|
|
28396
|
-
* http://jqueryui.com
|
|
28397
|
-
*
|
|
28398
|
-
* Copyright 2014 jQuery Foundation and other contributors
|
|
28399
|
-
* Released under the MIT license.
|
|
28400
|
-
* http://jquery.org/license
|
|
28401
|
-
*
|
|
28402
|
-
* http://api.jqueryui.com/category/ui-core/
|
|
28403
|
-
*/
|
|
28404
|
-
|
|
28405
|
-
var DISPLAY_NONE = "none";
|
|
28406
|
-
var DISPLAY_CONTENTS = "contents";
|
|
28407
|
-
|
|
28408
|
-
// match the whole word to prevent fuzzy searching
|
|
28409
|
-
var tabbableNode = /^(input|select|textarea|button|object|iframe)$/;
|
|
28410
|
-
function isNotOverflowing(element, style) {
|
|
28411
|
-
return style.getPropertyValue("overflow") !== "visible" ||
|
|
28412
|
-
// if 'overflow: visible' set, check if there is actually any overflow
|
|
28413
|
-
element.scrollWidth <= 0 && element.scrollHeight <= 0;
|
|
28414
|
-
}
|
|
28415
|
-
function hidesContents(element) {
|
|
28416
|
-
var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;
|
|
28417
|
-
|
|
28418
|
-
// If the node is empty, this is good enough
|
|
28419
|
-
if (zeroSize && !element.innerHTML) return true;
|
|
28420
|
-
try {
|
|
28421
|
-
// Otherwise we need to check some styles
|
|
28422
|
-
var style = window.getComputedStyle(element);
|
|
28423
|
-
var displayValue = style.getPropertyValue("display");
|
|
28424
|
-
return zeroSize ? displayValue !== DISPLAY_CONTENTS && isNotOverflowing(element, style) : displayValue === DISPLAY_NONE;
|
|
28425
|
-
} catch (exception) {
|
|
28426
|
-
// eslint-disable-next-line no-console
|
|
28427
|
-
console.warn("Failed to inspect element style");
|
|
28428
|
-
return false;
|
|
28429
|
-
}
|
|
28430
|
-
}
|
|
28431
|
-
function visible(element) {
|
|
28432
|
-
var parentElement = element;
|
|
28433
|
-
var rootNode = element.getRootNode && element.getRootNode();
|
|
28434
|
-
while (parentElement) {
|
|
28435
|
-
if (parentElement === document.body) break;
|
|
28436
|
-
|
|
28437
|
-
// if we are not hidden yet, skip to checking outside the Web Component
|
|
28438
|
-
if (rootNode && parentElement === rootNode) parentElement = rootNode.host.parentNode;
|
|
28439
|
-
if (hidesContents(parentElement)) return false;
|
|
28440
|
-
parentElement = parentElement.parentNode;
|
|
28441
|
-
}
|
|
28442
|
-
return true;
|
|
28443
|
-
}
|
|
28444
|
-
function focusable(element, isTabIndexNotNaN) {
|
|
28445
|
-
var nodeName = element.nodeName.toLowerCase();
|
|
28446
|
-
var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === "a" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);
|
|
28447
|
-
return res && visible(element);
|
|
28448
|
-
}
|
|
28449
|
-
function tabbable(element) {
|
|
28450
|
-
var tabIndex = element.getAttribute("tabindex");
|
|
28451
|
-
if (tabIndex === null) tabIndex = undefined;
|
|
28452
|
-
var isTabIndexNaN = isNaN(tabIndex);
|
|
28453
|
-
return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN);
|
|
28454
|
-
}
|
|
28455
|
-
function findTabbableDescendants(element) {
|
|
28456
|
-
var descendants = [].slice.call(element.querySelectorAll("*"), 0).reduce(function (finished, el) {
|
|
28457
|
-
return finished.concat(!el.shadowRoot ? [el] : findTabbableDescendants(el.shadowRoot));
|
|
28458
|
-
}, []);
|
|
28459
|
-
return descendants.filter(tabbable);
|
|
28460
|
-
}
|
|
28461
|
-
module.exports = exports["default"];
|
|
28462
|
-
|
|
28463
|
-
/***/ },
|
|
28464
|
-
|
|
28465
|
-
/***/ 37458
|
|
28466
|
-
(module, exports, __webpack_require__) {
|
|
28467
|
-
|
|
28468
|
-
|
|
28469
|
-
|
|
28470
|
-
Object.defineProperty(exports, "__esModule", ({
|
|
28471
|
-
value: true
|
|
28472
|
-
}));
|
|
28473
|
-
var _Modal = __webpack_require__(19530);
|
|
28474
|
-
var _Modal2 = _interopRequireDefault(_Modal);
|
|
28475
|
-
function _interopRequireDefault(obj) {
|
|
28476
|
-
return obj && obj.__esModule ? obj : {
|
|
28477
|
-
default: obj
|
|
28478
|
-
};
|
|
28479
|
-
}
|
|
28480
|
-
exports["default"] = _Modal2.default;
|
|
28481
|
-
module.exports = exports["default"];
|
|
28482
|
-
|
|
28483
|
-
/***/ },
|
|
28484
|
-
|
|
28485
26694
|
/***/ 55008
|
|
28486
26695
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
28487
26696
|
|
|
@@ -36349,65 +34558,6 @@ function v4(options, buf, offset) {
|
|
|
36349
34558
|
|
|
36350
34559
|
/***/ },
|
|
36351
34560
|
|
|
36352
|
-
/***/ 20205
|
|
36353
|
-
(module) {
|
|
36354
|
-
|
|
36355
|
-
/**
|
|
36356
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
|
36357
|
-
*
|
|
36358
|
-
* This source code is licensed under the MIT license found in the
|
|
36359
|
-
* LICENSE file in the root directory of this source tree.
|
|
36360
|
-
*/
|
|
36361
|
-
|
|
36362
|
-
|
|
36363
|
-
|
|
36364
|
-
/**
|
|
36365
|
-
* Similar to invariant but only logs a warning if the condition is not met.
|
|
36366
|
-
* This can be used to log issues in development environments in critical
|
|
36367
|
-
* paths. Removing the logging code for production environments will keep the
|
|
36368
|
-
* same logic and follow the same code paths.
|
|
36369
|
-
*/
|
|
36370
|
-
var __DEV__ = "production" !== 'production';
|
|
36371
|
-
var warning = function () {};
|
|
36372
|
-
if (__DEV__) {
|
|
36373
|
-
var printWarning = function printWarning(format, args) {
|
|
36374
|
-
var len = arguments.length;
|
|
36375
|
-
args = new Array(len > 1 ? len - 1 : 0);
|
|
36376
|
-
for (var key = 1; key < len; key++) {
|
|
36377
|
-
args[key - 1] = arguments[key];
|
|
36378
|
-
}
|
|
36379
|
-
var argIndex = 0;
|
|
36380
|
-
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
36381
|
-
return args[argIndex++];
|
|
36382
|
-
});
|
|
36383
|
-
if (typeof console !== 'undefined') {
|
|
36384
|
-
console.error(message);
|
|
36385
|
-
}
|
|
36386
|
-
try {
|
|
36387
|
-
// --- Welcome to debugging React ---
|
|
36388
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
36389
|
-
// to find the callsite that caused this warning to fire.
|
|
36390
|
-
throw new Error(message);
|
|
36391
|
-
} catch (x) {}
|
|
36392
|
-
};
|
|
36393
|
-
warning = function (condition, format, args) {
|
|
36394
|
-
var len = arguments.length;
|
|
36395
|
-
args = new Array(len > 2 ? len - 2 : 0);
|
|
36396
|
-
for (var key = 2; key < len; key++) {
|
|
36397
|
-
args[key - 2] = arguments[key];
|
|
36398
|
-
}
|
|
36399
|
-
if (format === undefined) {
|
|
36400
|
-
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
36401
|
-
}
|
|
36402
|
-
if (!condition) {
|
|
36403
|
-
printWarning.apply(null, [format].concat(args));
|
|
36404
|
-
}
|
|
36405
|
-
};
|
|
36406
|
-
}
|
|
36407
|
-
module.exports = warning;
|
|
36408
|
-
|
|
36409
|
-
/***/ },
|
|
36410
|
-
|
|
36411
34561
|
/***/ 58098
|
|
36412
34562
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
36413
34563
|
|
|
@@ -37279,6 +35429,7 @@ const DeleteConfirmModal = props => {
|
|
|
37279
35429
|
/* harmony import */ var _cognigy_chat_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2854);
|
|
37280
35430
|
/* harmony import */ var _utils_find_focusable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(41098);
|
|
37281
35431
|
/* harmony import */ var _webchat_helper_useSelector__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3862);
|
|
35432
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
37282
35433
|
|
|
37283
35434
|
|
|
37284
35435
|
|
|
@@ -37300,15 +35451,37 @@ const Overlay = _emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A
|
|
|
37300
35451
|
zIndex: 9999
|
|
37301
35452
|
});
|
|
37302
35453
|
const StyledDialog = _emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.dialog(({
|
|
37303
|
-
theme
|
|
35454
|
+
theme,
|
|
35455
|
+
variant
|
|
37304
35456
|
}) => ({
|
|
37305
35457
|
padding: 20,
|
|
37306
35458
|
border: "none",
|
|
37307
|
-
borderRadius: 16,
|
|
37308
|
-
width: "90%",
|
|
37309
|
-
backgroundColor: theme.white,
|
|
37310
|
-
margin: "20px auto",
|
|
37311
35459
|
zIndex: 99999,
|
|
35460
|
+
...(variant === "card" ? {
|
|
35461
|
+
borderRadius: 16,
|
|
35462
|
+
width: "90%",
|
|
35463
|
+
backgroundColor: theme.white,
|
|
35464
|
+
margin: "20px auto"
|
|
35465
|
+
} : {
|
|
35466
|
+
// "fullscreen" spans the entire webchat window: the modal represents
|
|
35467
|
+
// a blocking state of the window itself, not a dialog above it.
|
|
35468
|
+
position: "absolute",
|
|
35469
|
+
inset: 0,
|
|
35470
|
+
width: "100%",
|
|
35471
|
+
height: "100%",
|
|
35472
|
+
maxWidth: "none",
|
|
35473
|
+
maxHeight: "none",
|
|
35474
|
+
margin: 0,
|
|
35475
|
+
borderRadius: 0,
|
|
35476
|
+
boxSizing: "border-box",
|
|
35477
|
+
backgroundColor: theme.backgroundWebchat,
|
|
35478
|
+
color: theme.textDark,
|
|
35479
|
+
display: "flex",
|
|
35480
|
+
flexDirection: "column",
|
|
35481
|
+
alignItems: "center",
|
|
35482
|
+
justifyContent: "center",
|
|
35483
|
+
gap: 24
|
|
35484
|
+
}),
|
|
37312
35485
|
"&.fade-enter": {
|
|
37313
35486
|
opacity: 0
|
|
37314
35487
|
},
|
|
@@ -37317,22 +35490,39 @@ const StyledDialog = _emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"]
|
|
|
37317
35490
|
transition: "opacity 150ms"
|
|
37318
35491
|
}
|
|
37319
35492
|
}));
|
|
37320
|
-
const ModalHeader = _emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.div({
|
|
35493
|
+
const ModalHeader = _emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.div(({
|
|
35494
|
+
variant
|
|
35495
|
+
}) => ({
|
|
37321
35496
|
display: "flex",
|
|
37322
35497
|
alignItems: "center",
|
|
37323
|
-
|
|
35498
|
+
// Static (fullscreen), so the close button anchors to the dialog's corner
|
|
35499
|
+
// and the title centers in the window.
|
|
35500
|
+
...(variant === "card" ? {
|
|
35501
|
+
position: "relative"
|
|
35502
|
+
} : {
|
|
35503
|
+
position: "static"
|
|
35504
|
+
}),
|
|
37324
35505
|
"> h3": {
|
|
37325
35506
|
margin: "auto",
|
|
37326
|
-
textAlign: "center"
|
|
35507
|
+
textAlign: "center",
|
|
35508
|
+
...(variant === "fullscreen" ? {
|
|
35509
|
+
fontSize: "1.2rem"
|
|
35510
|
+
} : {})
|
|
37327
35511
|
}
|
|
37328
|
-
});
|
|
35512
|
+
}));
|
|
37329
35513
|
const CloseButton = (0,_emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(_presentational_IconButton__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A)(({
|
|
37330
|
-
theme
|
|
35514
|
+
theme,
|
|
35515
|
+
variant
|
|
37331
35516
|
}) => ({
|
|
37332
35517
|
color: theme.black10,
|
|
37333
35518
|
borderRadius: 4,
|
|
37334
35519
|
position: "absolute",
|
|
37335
|
-
|
|
35520
|
+
...(variant === "card" ? {
|
|
35521
|
+
right: -4
|
|
35522
|
+
} : {
|
|
35523
|
+
right: 15,
|
|
35524
|
+
top: 17
|
|
35525
|
+
}),
|
|
37336
35526
|
"&:focus-visible": {
|
|
37337
35527
|
outline: `2px solid ${theme.primaryColorFocus}`,
|
|
37338
35528
|
outlineOffset: 2
|
|
@@ -37344,9 +35534,19 @@ const CloseButton = (0,_emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"
|
|
|
37344
35534
|
},
|
|
37345
35535
|
padding: 0
|
|
37346
35536
|
}));
|
|
37347
|
-
const ModalBody = _emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.div({
|
|
37348
|
-
|
|
37349
|
-
})
|
|
35537
|
+
const ModalBody = _emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.div(({
|
|
35538
|
+
variant
|
|
35539
|
+
}) => ({
|
|
35540
|
+
...(variant === "card" ? {
|
|
35541
|
+
marginBottom: 20
|
|
35542
|
+
} : {
|
|
35543
|
+
display: "flex",
|
|
35544
|
+
flexDirection: "column",
|
|
35545
|
+
alignItems: "center",
|
|
35546
|
+
gap: 24,
|
|
35547
|
+
textAlign: "center"
|
|
35548
|
+
})
|
|
35549
|
+
}));
|
|
37350
35550
|
const ModalFooter = _emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.div({
|
|
37351
35551
|
display: "flex",
|
|
37352
35552
|
justifyContent: "space-between",
|
|
@@ -37379,15 +35579,52 @@ const Modal = ({
|
|
|
37379
35579
|
onClose,
|
|
37380
35580
|
title,
|
|
37381
35581
|
footer,
|
|
37382
|
-
children
|
|
35582
|
+
children,
|
|
35583
|
+
variant = "card",
|
|
35584
|
+
titleId = "modal-title",
|
|
35585
|
+
closeButtonAriaLabel,
|
|
35586
|
+
closeButtonProps,
|
|
35587
|
+
initialFocusRef,
|
|
35588
|
+
className,
|
|
35589
|
+
...restDialogProps
|
|
37383
35590
|
}) => {
|
|
37384
35591
|
const dialogRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
37385
|
-
const
|
|
35592
|
+
const closeButtonRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
35593
|
+
const previouslyFocusedRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
35594
|
+
const defaultCloseButtonAriaLabel = (0,_webchat_helper_useSelector__WEBPACK_IMPORTED_MODULE_7__/* .useSelector */ .d)(state => state.config.settings.customTranslations?.ariaLabels?.closeDialog) ?? "Close dialog";
|
|
37386
35595
|
const handleOnClose = () => {
|
|
37387
35596
|
onClose(false);
|
|
37388
35597
|
};
|
|
35598
|
+
|
|
35599
|
+
// Move focus once when the dialog opens; it then stays where the user
|
|
35600
|
+
// puts it (SC 3.2.1, 2.4.3). On close, focus returns to the element that
|
|
35601
|
+
// was focused before the dialog opened (if it is still in the document —
|
|
35602
|
+
// e.g. not when closing the dialog closed the whole chat window). Only
|
|
35603
|
+
// active when the consumer opts in via initialFocusRef — see the prop docs.
|
|
35604
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
35605
|
+
if (!initialFocusRef) return;
|
|
35606
|
+
if (isOpen) {
|
|
35607
|
+
previouslyFocusedRef.current = document.activeElement;
|
|
35608
|
+
// Deferred: focusing a control in the same task that inserted it is
|
|
35609
|
+
// not reliably announced by screen readers — the focus event races
|
|
35610
|
+
// the accessibility-tree update for the new dialog subtree.
|
|
35611
|
+
const focusTimer = window.setTimeout(() => {
|
|
35612
|
+
(initialFocusRef.current ?? closeButtonRef.current)?.focus();
|
|
35613
|
+
}, 200);
|
|
35614
|
+
return () => window.clearTimeout(focusTimer);
|
|
35615
|
+
} else {
|
|
35616
|
+
const previouslyFocused = previouslyFocusedRef.current;
|
|
35617
|
+
previouslyFocusedRef.current = null;
|
|
35618
|
+
if (previouslyFocused && document.contains(previouslyFocused)) {
|
|
35619
|
+
previouslyFocused.focus();
|
|
35620
|
+
}
|
|
35621
|
+
}
|
|
35622
|
+
}, [isOpen, initialFocusRef]);
|
|
37389
35623
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
37390
35624
|
const handleKeyDown = event => {
|
|
35625
|
+
// Inert means another modal surface (e.g. the disconnect overlay)
|
|
35626
|
+
// is stacked on top — leave Esc/Tab to that surface.
|
|
35627
|
+
if (dialogRef.current?.closest("[inert]")) return;
|
|
37391
35628
|
if (event.key === "Escape") {
|
|
37392
35629
|
handleOnClose();
|
|
37393
35630
|
}
|
|
@@ -37419,7 +35656,7 @@ const Modal = ({
|
|
|
37419
35656
|
document.removeEventListener("keydown", handleKeyDown);
|
|
37420
35657
|
};
|
|
37421
35658
|
}, [isOpen, onClose]);
|
|
37422
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(react__WEBPACK_IMPORTED_MODULE_0__["default"].Fragment, null, isOpen && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(Overlay, {
|
|
35659
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(react__WEBPACK_IMPORTED_MODULE_0__["default"].Fragment, null, isOpen && variant === "card" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(Overlay, {
|
|
37423
35660
|
onClick: handleOnClose
|
|
37424
35661
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(react_transition_group__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A, {
|
|
37425
35662
|
in: isOpen,
|
|
@@ -37427,32 +35664,58 @@ const Modal = ({
|
|
|
37427
35664
|
mountOnEnter: true,
|
|
37428
35665
|
unmountOnExit: true,
|
|
37429
35666
|
classNames: "fade"
|
|
37430
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(StyledDialog, {
|
|
37431
|
-
className: "webchat-modal-root",
|
|
37432
|
-
|
|
37433
|
-
|
|
37434
|
-
|
|
35667
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(StyledDialog, _extends({
|
|
35668
|
+
className: ["webchat-modal-root", className].filter(Boolean).join(" ")
|
|
35669
|
+
// The fullscreen variant renders as a plain div[role="dialog"]
|
|
35670
|
+
// (the APG pattern): a native <dialog open> without showModal()
|
|
35671
|
+
// has Chromium a11y quirks where subtree changes inside it
|
|
35672
|
+
// (inserted controls, focus on new nodes) are not surfaced to
|
|
35673
|
+
// screen readers. The card variant keeps <dialog> — its
|
|
35674
|
+
// centering relies on the element's UA styles.
|
|
35675
|
+
,
|
|
35676
|
+
as: variant === "fullscreen" ? "div" : undefined
|
|
35677
|
+
// Spread first so the dialog semantics below always win over
|
|
35678
|
+
// anything a consumer passes through.
|
|
35679
|
+
}, restDialogProps, {
|
|
35680
|
+
role: "dialog"
|
|
35681
|
+
}, variant === "card" ? {
|
|
35682
|
+
open: isOpen
|
|
35683
|
+
} : {}, {
|
|
35684
|
+
variant: variant,
|
|
35685
|
+
"aria-modal": "true",
|
|
35686
|
+
"aria-labelledby": titleId
|
|
35687
|
+
// Only the card variant uses the body as the dialog description —
|
|
35688
|
+
// the fullscreen body contains a live region (role="status"),
|
|
35689
|
+
// which would otherwise be announced twice (as description on
|
|
35690
|
+
// dialog entry and again as a live-region update).
|
|
35691
|
+
,
|
|
35692
|
+
"aria-describedby": variant === "card" ? "modal-body" : undefined,
|
|
37435
35693
|
ref: dialogRef
|
|
37436
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(ModalHeader, {
|
|
37437
|
-
className: "webchat-modal-header"
|
|
35694
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(ModalHeader, {
|
|
35695
|
+
className: "webchat-modal-header",
|
|
35696
|
+
variant: variant
|
|
37438
35697
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_cognigy_chat_components__WEBPACK_IMPORTED_MODULE_5__/* .Typography */ .o5, {
|
|
37439
|
-
id:
|
|
35698
|
+
id: titleId,
|
|
37440
35699
|
variant: "title1-semibold",
|
|
37441
35700
|
className: "webchat-modal-title"
|
|
37442
|
-
}, title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(CloseButton, {
|
|
37443
|
-
"aria-label": closeButtonAriaLabel,
|
|
35701
|
+
}, title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(CloseButton, _extends({
|
|
35702
|
+
"aria-label": closeButtonAriaLabel ?? defaultCloseButtonAriaLabel,
|
|
37444
35703
|
onClick: handleOnClose,
|
|
37445
|
-
|
|
37446
|
-
|
|
35704
|
+
variant: variant,
|
|
35705
|
+
ref: closeButtonRef
|
|
35706
|
+
}, closeButtonProps, {
|
|
35707
|
+
className: ["webchat-modal-close-button", closeButtonProps?.className].filter(Boolean).join(" ")
|
|
35708
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_assets_close_16px_svg__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A, {
|
|
37447
35709
|
"aria-hidden": true,
|
|
37448
35710
|
className: "webchat-modal-close-icon"
|
|
37449
|
-
}))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(DividerWrapper, {
|
|
35711
|
+
}))), variant === "card" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(DividerWrapper, {
|
|
37450
35712
|
className: "webchat-modal-divider-wrapper"
|
|
37451
35713
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(Divider, {
|
|
37452
35714
|
className: "webchat-modal-divider"
|
|
37453
35715
|
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(ModalBody, {
|
|
37454
|
-
id: "modal-body",
|
|
37455
|
-
className: "webchat-modal-body"
|
|
35716
|
+
id: variant === "card" ? "modal-body" : undefined,
|
|
35717
|
+
className: "webchat-modal-body",
|
|
35718
|
+
variant: variant
|
|
37456
35719
|
}, children), footer ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(ModalFooter, {
|
|
37457
35720
|
className: "webchat-modal-footer"
|
|
37458
35721
|
}, footer) : null)));
|
|
@@ -37519,8 +35782,13 @@ const Modal = ({
|
|
|
37519
35782
|
/* harmony import */ var _webchat_helper_handleMarkdown__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(71621);
|
|
37520
35783
|
/* harmony import */ var _presentational_previous_conversations_DeleteAllConversations__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(5196);
|
|
37521
35784
|
/* harmony import */ var _presentational_ScreenReaderLiveRegion__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(41426);
|
|
37522
|
-
/* harmony import */ var
|
|
37523
|
-
/* harmony import */ var
|
|
35785
|
+
/* harmony import */ var _presentational_StatusLiveRegion__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(63813);
|
|
35786
|
+
/* harmony import */ var _presentational_FreezeOnExit__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(97475);
|
|
35787
|
+
/* harmony import */ var _presentational_HomeScreenAnnouncer__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(55115);
|
|
35788
|
+
/* harmony import */ var _utils_ai_agent_notice__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(39191);
|
|
35789
|
+
/* harmony import */ var _utils_screen_visibility__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(48245);
|
|
35790
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(14176);
|
|
35791
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_56___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_56__);
|
|
37524
35792
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
37525
35793
|
|
|
37526
35794
|
|
|
@@ -37568,6 +35836,11 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
37568
35836
|
|
|
37569
35837
|
|
|
37570
35838
|
|
|
35839
|
+
|
|
35840
|
+
|
|
35841
|
+
|
|
35842
|
+
|
|
35843
|
+
|
|
37571
35844
|
|
|
37572
35845
|
|
|
37573
35846
|
|
|
@@ -37614,6 +35887,19 @@ const RegularLayoutRoot = _emotion_styled__WEBPACK_IMPORTED_MODULE_3__/* ["defau
|
|
|
37614
35887
|
flexDirection: "column",
|
|
37615
35888
|
overscrollBehavior: "contain"
|
|
37616
35889
|
});
|
|
35890
|
+
|
|
35891
|
+
// Wraps the chat layout so it can be hidden from assistive technologies and
|
|
35892
|
+
// removed from the tab order (aria-hidden + inert) while the disconnect
|
|
35893
|
+
// overlay is open — the overlay must be the only perceivable/operable content.
|
|
35894
|
+
const DisconnectableContentWrapper = _emotion_styled__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.div({
|
|
35895
|
+
height: "100%",
|
|
35896
|
+
display: "flex",
|
|
35897
|
+
flexDirection: "column",
|
|
35898
|
+
minHeight: 0
|
|
35899
|
+
});
|
|
35900
|
+
|
|
35901
|
+
// `inert` is typed here because React 18's prop types don't know it yet;
|
|
35902
|
+
// the string form ("") renders the bare attribute, and emotion forwards it.
|
|
37617
35903
|
const RegularLayoutContentWrapper = _emotion_styled__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.div(({
|
|
37618
35904
|
theme
|
|
37619
35905
|
}) => ({
|
|
@@ -37665,7 +35951,8 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
37665
35951
|
showDeleteAllConversationsModal: false,
|
|
37666
35952
|
deleteConversationsModalState: false,
|
|
37667
35953
|
liveContent: {},
|
|
37668
|
-
isMobile: false
|
|
35954
|
+
isMobile: false,
|
|
35955
|
+
noticeSession: _utils_ai_agent_notice__WEBPACK_IMPORTED_MODULE_54__/* .INITIAL_NOTICE_SESSION */ .j_
|
|
37669
35956
|
};
|
|
37670
35957
|
unreadTitleIndicatorInterval = null;
|
|
37671
35958
|
originalTitle = window.document.title;
|
|
@@ -37674,6 +35961,15 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
37674
35961
|
visibilityCheckInitialized = false;
|
|
37675
35962
|
visibilityCheckCompleted = false;
|
|
37676
35963
|
engagementMessageTimeout = null;
|
|
35964
|
+
ratingFocusTimeout = null;
|
|
35965
|
+
|
|
35966
|
+
/**
|
|
35967
|
+
* Announce keys of conversations whose AI-agent notice was already
|
|
35968
|
+
* announced (CGY-3519). Lives on the instance (not in the live region):
|
|
35969
|
+
* ScreenReaderLiveRegion unmounts on every screen navigation, so it
|
|
35970
|
+
* cannot remember what it announced across visits to the chat screen.
|
|
35971
|
+
*/
|
|
35972
|
+
announcedNoticeKeys = new Set();
|
|
37677
35973
|
constructor(props) {
|
|
37678
35974
|
super(props);
|
|
37679
35975
|
this.chatToggleButtonRef = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createRef();
|
|
@@ -37790,6 +36086,34 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
37790
36086
|
}
|
|
37791
36087
|
this.hideNotifications = (0,_webchat_helper_connectivity__WEBPACK_IMPORTED_MODULE_31__/* .isDisabledDueToConnectivity */ .l9)(this.props.config.settings, timeoutReached) || (0,_webchat_helper_maintenance__WEBPACK_IMPORTED_MODULE_29__/* .isDisabledDueToMaintenance */ .$6)(this.props.config.settings) || (0,_webchat_helper_businessHours__WEBPACK_IMPORTED_MODULE_28__/* .isDisabledOutOfBusinessHours */ .dt)(this.props.config.settings.businessHours) || (0,_webchat_helper_connectivity__WEBPACK_IMPORTED_MODULE_31__/* .isInformingDueToConnectivity */ .u0)(this.props.config.settings, timeoutReached) || (0,_webchat_helper_maintenance__WEBPACK_IMPORTED_MODULE_29__/* .isInformingDueToMaintenance */ .iF)(this.props.config.settings) || (0,_webchat_helper_businessHours__WEBPACK_IMPORTED_MODULE_28__/* .isInformingOutOfBusinessHours */ .Gr)(this.props.config.settings.businessHours) || (0,_webchat_helper_connectivity__WEBPACK_IMPORTED_MODULE_31__/* .isHiddenDueToConnectivity */ .VD)(this.props.config.settings, timeoutReached) || (0,_webchat_helper_maintenance__WEBPACK_IMPORTED_MODULE_29__/* .isHiddenDueToMaintenance */ .Hs)(this.props.config.settings) || (0,_webchat_helper_businessHours__WEBPACK_IMPORTED_MODULE_28__/* .isHiddenOutOfBusinessHours */ .hN)(this.props.config.settings.businessHours) || false;
|
|
37792
36088
|
};
|
|
36089
|
+
|
|
36090
|
+
// `prevConversationsSnapshot` must predate the session change — see
|
|
36091
|
+
// computeNoticeSession for why. `hasRestoredPersistedHistory` is read
|
|
36092
|
+
// from CURRENT props on purpose: the restore lands in the same commit
|
|
36093
|
+
// as the session id it belongs to.
|
|
36094
|
+
evaluateNoticeSession(prevConversationsSnapshot) {
|
|
36095
|
+
const id = this.props.currentSession || "";
|
|
36096
|
+
this.setState(prev => ({
|
|
36097
|
+
noticeSession: (0,_utils_ai_agent_notice__WEBPACK_IMPORTED_MODULE_54__/* .computeNoticeSession */ .Kr)(prev.noticeSession, id, prevConversationsSnapshot, this.props.hasRestoredPersistedHistory)
|
|
36098
|
+
}));
|
|
36099
|
+
}
|
|
36100
|
+
handleNoticeIntroAnnounced = introKey => {
|
|
36101
|
+
this.announcedNoticeKeys.add(introKey);
|
|
36102
|
+
};
|
|
36103
|
+
getNoticeIntro() {
|
|
36104
|
+
const text = (0,_utils_ai_agent_notice__WEBPACK_IMPORTED_MODULE_54__/* .getAIAgentNoticeIntroText */ .bu)({
|
|
36105
|
+
behavior: this.props.config.settings.behavior,
|
|
36106
|
+
showDisconnectOverlay: this.showDisconnectOverlay,
|
|
36107
|
+
noticeSession: this.state.noticeSession,
|
|
36108
|
+
currentSessionId: this.props.currentSession || "",
|
|
36109
|
+
announcedKeys: this.announcedNoticeKeys
|
|
36110
|
+
});
|
|
36111
|
+
if (!text) return undefined;
|
|
36112
|
+
return {
|
|
36113
|
+
key: this.state.noticeSession.announceKey,
|
|
36114
|
+
text
|
|
36115
|
+
};
|
|
36116
|
+
}
|
|
37793
36117
|
componentDidMount() {
|
|
37794
36118
|
const defaultMessagePlugins = [];
|
|
37795
36119
|
if (this.props.ttsActive) {
|
|
@@ -37801,6 +36125,10 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
37801
36125
|
isMobile: (0,_utils_isMobile__WEBPACK_IMPORTED_MODULE_47__/* .isMobileViewport */ .$)()
|
|
37802
36126
|
});
|
|
37803
36127
|
this.setupIconAnimationInterval();
|
|
36128
|
+
|
|
36129
|
+
// No pre-change snapshot exists on mount; the current map predates
|
|
36130
|
+
// any message activity of this page load.
|
|
36131
|
+
this.evaluateNoticeSession(this.props.prevConversations);
|
|
37804
36132
|
window.addEventListener("resize", this.handleResize);
|
|
37805
36133
|
}
|
|
37806
36134
|
async componentDidUpdate(prevProps, prevState) {
|
|
@@ -37817,6 +36145,9 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
37817
36145
|
firstFocusable.focus();
|
|
37818
36146
|
}
|
|
37819
36147
|
}
|
|
36148
|
+
if (prevProps.currentSession !== this.props.currentSession) {
|
|
36149
|
+
this.evaluateNoticeSession(prevProps.prevConversations);
|
|
36150
|
+
}
|
|
37820
36151
|
if (prevProps.ttsActive !== this.props.ttsActive || prevProps.inputPlugins !== this.props.inputPlugins || prevProps.messagePlugins !== this.props.messagePlugins) {
|
|
37821
36152
|
const defaultMessagePlugins = [];
|
|
37822
36153
|
if (this.props.ttsActive) {
|
|
@@ -37923,6 +36254,10 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
37923
36254
|
clearTimeout(this.engagementMessageTimeout);
|
|
37924
36255
|
this.engagementMessageTimeout = null;
|
|
37925
36256
|
}
|
|
36257
|
+
if (this.ratingFocusTimeout) {
|
|
36258
|
+
clearTimeout(this.ratingFocusTimeout);
|
|
36259
|
+
this.ratingFocusTimeout = null;
|
|
36260
|
+
}
|
|
37926
36261
|
|
|
37927
36262
|
// Teardown icon animation interval
|
|
37928
36263
|
if (this.iconAnimationIntervalHandle) {
|
|
@@ -38034,6 +36369,12 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
38034
36369
|
});
|
|
38035
36370
|
};
|
|
38036
36371
|
|
|
36372
|
+
// Whether the blocking connection-lost overlay is shown. Single source for
|
|
36373
|
+
// render and the focus trap in handleKeydown — the two must stay in sync.
|
|
36374
|
+
get showDisconnectOverlay() {
|
|
36375
|
+
return this.props.config.settings.behavior.enableConnectionStatusIndicator && !this.props.connected && this.state.hadConnection;
|
|
36376
|
+
}
|
|
36377
|
+
|
|
38037
36378
|
// Key down handler
|
|
38038
36379
|
handleKeydown = event => {
|
|
38039
36380
|
const {
|
|
@@ -38055,7 +36396,12 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
38055
36396
|
const tabKeyPress = !shiftKey && key === "Tab";
|
|
38056
36397
|
if (enableFocusTrap && open &&
|
|
38057
36398
|
// Do not trap focus when the delete conversations related modal is open
|
|
38058
|
-
!showDeleteAllConversationsModal && !deleteConversationsModalState
|
|
36399
|
+
!showDeleteAllConversationsModal && !deleteConversationsModalState &&
|
|
36400
|
+
// The disconnect overlay (a Modal) runs its own focus trap; the layout
|
|
36401
|
+
// behind it is inert, so this trap would agree with it only by virtue
|
|
36402
|
+
// of getKeyboardFocusableElements skipping inert subtrees. Excluded
|
|
36403
|
+
// explicitly instead of relying on that coupling.
|
|
36404
|
+
!this.showDisconnectOverlay) {
|
|
38059
36405
|
// Get the first and last focusable elements within the webchat window and add focus
|
|
38060
36406
|
const webchatWindowEl = this.webchatWindowRef?.current;
|
|
38061
36407
|
const {
|
|
@@ -38112,6 +36458,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
38112
36458
|
comment,
|
|
38113
36459
|
showRatingStatus
|
|
38114
36460
|
}) => {
|
|
36461
|
+
const wasRatingScreen = this.props.showRatingScreen;
|
|
38115
36462
|
this.props.onShowRatingScreen(false);
|
|
38116
36463
|
this.props.onSendMessage(undefined, {
|
|
38117
36464
|
_cognigy: {
|
|
@@ -38126,6 +36473,22 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
38126
36473
|
}
|
|
38127
36474
|
}, undefined);
|
|
38128
36475
|
this.props.onSetHasGivenRating();
|
|
36476
|
+
|
|
36477
|
+
// Submitting from the chat options screen removes the focused Send
|
|
36478
|
+
// button (rating "once" unmounts the widget; "always" disables it),
|
|
36479
|
+
// which would drop focus to document.body (SC 2.4.3 Focus Order).
|
|
36480
|
+
// Move focus to the screen title instead, mirroring the
|
|
36481
|
+
// autoFocusScreenTitle pattern in Header. The request-rating screen
|
|
36482
|
+
// path is excluded: it closes the screen and the message input
|
|
36483
|
+
// takes focus on mount.
|
|
36484
|
+
// Scoped to the header bar because id "webchatHeaderTitle" is
|
|
36485
|
+
// duplicated across Header, HomeScreen and TeaserMessage.
|
|
36486
|
+
if (!wasRatingScreen) {
|
|
36487
|
+
if (this.ratingFocusTimeout) clearTimeout(this.ratingFocusTimeout);
|
|
36488
|
+
this.ratingFocusTimeout = setTimeout(() => {
|
|
36489
|
+
this.webchatWindowRef?.current?.querySelector(".webchat-header-bar .webchat-header-title")?.focus();
|
|
36490
|
+
}, 200);
|
|
36491
|
+
}
|
|
38129
36492
|
};
|
|
38130
36493
|
handleSendActionButtonMessage = (text, data, options) => {
|
|
38131
36494
|
this.props.onSetShowHomeScreen(false);
|
|
@@ -38303,15 +36666,18 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
38303
36666
|
disableToggleButton,
|
|
38304
36667
|
scrollLockAllowSelectors,
|
|
38305
36668
|
disableMobileScrollLock
|
|
38306
|
-
},
|
|
38307
|
-
behavior: {
|
|
38308
|
-
enableConnectionStatusIndicator
|
|
38309
36669
|
}
|
|
38310
36670
|
} = config.settings;
|
|
38311
36671
|
if (!config.active && !config.settings.embeddingConfiguration.connectivity.enabled || !config.isConfigLoaded && config.settings.embeddingConfiguration.awaitEndpointConfig || config.isConfigLoaded && config.settings.embeddingConfiguration.awaitEndpointConfig && ((0,_webchat_helper_businessHours__WEBPACK_IMPORTED_MODULE_28__/* .isHiddenOutOfBusinessHours */ .hN)(config.settings.businessHours) || (0,_webchat_helper_maintenance__WEBPACK_IMPORTED_MODULE_29__/* .isHiddenDueToMaintenance */ .Hs)(config.settings) || (0,_webchat_helper_connectivity__WEBPACK_IMPORTED_MODULE_31__/* .isHiddenDueToConnectivity */ .VD)(config.settings, state.timedOut))) return null;
|
|
38312
36672
|
const isDisabled = config.isConfigLoaded && config.settings.embeddingConfiguration.awaitEndpointConfig && ((0,_webchat_helper_maintenance__WEBPACK_IMPORTED_MODULE_29__/* .isDisabledDueToMaintenance */ .$6)(config.settings) || (0,_webchat_helper_businessHours__WEBPACK_IMPORTED_MODULE_28__/* .isDisabledOutOfBusinessHours */ .dt)(config.settings.businessHours) || (0,_webchat_helper_connectivity__WEBPACK_IMPORTED_MODULE_31__/* .isDisabledDueToConnectivity */ .l9)(config.settings, state.timedOut));
|
|
38313
36673
|
const isInforming = config.isConfigLoaded && config.settings.embeddingConfiguration.awaitEndpointConfig && ((0,_webchat_helper_maintenance__WEBPACK_IMPORTED_MODULE_29__/* .isInformingDueToMaintenance */ .iF)(config.settings) || (0,_webchat_helper_businessHours__WEBPACK_IMPORTED_MODULE_28__/* .isInformingOutOfBusinessHours */ .Gr)(config.settings.businessHours) || (0,_webchat_helper_connectivity__WEBPACK_IMPORTED_MODULE_31__/* .isInformingDueToConnectivity */ .u0)(config.settings, state.timedOut));
|
|
38314
|
-
const showDisconnectOverlay =
|
|
36674
|
+
const showDisconnectOverlay = this.showDisconnectOverlay;
|
|
36675
|
+
|
|
36676
|
+
// Drives the home-screen announcer below; the announcer mounts only
|
|
36677
|
+
// while the webchat is open, so no `open` check is needed here.
|
|
36678
|
+
const {
|
|
36679
|
+
showHomeScreenView
|
|
36680
|
+
} = (0,_utils_screen_visibility__WEBPACK_IMPORTED_MODULE_55__/* .getScreenVisibility */ .p)(this.props, isInforming);
|
|
38315
36681
|
const openChatAriaLabel = () => {
|
|
38316
36682
|
if (open) return config.settings.customTranslations?.ariaLabels?.closeChat ?? "Close chat";
|
|
38317
36683
|
const openChat = config.settings.customTranslations?.ariaLabels?.openChat ?? "Open chat";
|
|
@@ -38372,10 +36738,28 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
38372
36738
|
ref: this.webchatWindowRef,
|
|
38373
36739
|
onScroll: this.handleWebchatWindowScroll,
|
|
38374
36740
|
chatWindowWidth: this.props.config.settings.layout.chatWindowWidth
|
|
38375
|
-
}),
|
|
36741
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(DisconnectableContentWrapper, {
|
|
36742
|
+
"aria-hidden": showDisconnectOverlay || undefined
|
|
36743
|
+
// React 18 has no `inert` prop; the inline
|
|
36744
|
+
// ref callback runs on every render, keeping
|
|
36745
|
+
// the attribute in sync with the overlay.
|
|
36746
|
+
,
|
|
36747
|
+
ref: el => {
|
|
36748
|
+
if (!el) return;
|
|
36749
|
+
if (showDisconnectOverlay) {
|
|
36750
|
+
el.setAttribute("inert", "");
|
|
36751
|
+
} else {
|
|
36752
|
+
el.removeAttribute("inert");
|
|
36753
|
+
}
|
|
36754
|
+
}
|
|
36755
|
+
}, !fullscreenMessage ? this.renderRegularLayout(isInforming) : this.renderFullscreenMessageLayout()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_StatusLiveRegion__WEBPACK_IMPORTED_MODULE_51__/* .StatusLiveRegion */ .t, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_HomeScreenAnnouncer__WEBPACK_IMPORTED_MODULE_53__/* ["default"] */ .A, {
|
|
36756
|
+
active: showHomeScreenView,
|
|
36757
|
+
label: config.settings.customTranslations?.ariaLabels?.homeScreen ?? "Chat window home screen"
|
|
36758
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_DisconnectOverlay__WEBPACK_IMPORTED_MODULE_20__/* ["default"] */ .A, {
|
|
38376
36759
|
isOpen: showDisconnectOverlay,
|
|
38377
36760
|
onConnect: onConnect,
|
|
38378
36761
|
isPermanent: !!reconnectionLimit,
|
|
36762
|
+
isConnecting: !!this.props.connecting,
|
|
38379
36763
|
onClose: handleClose,
|
|
38380
36764
|
config: config
|
|
38381
36765
|
})), !disableToggleButton && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("div", null,
|
|
@@ -38408,7 +36792,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
38408
36792
|
onClick: this.handleFabClick
|
|
38409
36793
|
}, webchatToggleProps, {
|
|
38410
36794
|
type: "button",
|
|
38411
|
-
className:
|
|
36795
|
+
className: classnames__WEBPACK_IMPORTED_MODULE_56___default()("webchat-toggle-button burst", config.settings?.layout?.iconAnimation),
|
|
38412
36796
|
id: "webchatWindowToggleButton",
|
|
38413
36797
|
"aria-label": openChatAriaLabel(),
|
|
38414
36798
|
ref: this.chatToggleButtonRef,
|
|
@@ -38576,9 +36960,6 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
38576
36960
|
layoutSettings: config.settings.layout,
|
|
38577
36961
|
dropzoneText: config.settings.fileStorageSettings?.dropzoneText
|
|
38578
36962
|
});
|
|
38579
|
-
|
|
38580
|
-
// ReactModal.setAppElement moved to componentDidMount to avoid repeated invocations.
|
|
38581
|
-
|
|
38582
36963
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(react__WEBPACK_IMPORTED_MODULE_0__["default"].Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(HistoryWrapper, {
|
|
38583
36964
|
scrollBehavior: config.settings.behavior.scrollingBehavior,
|
|
38584
36965
|
lastInputId: lastInputId,
|
|
@@ -38589,7 +36970,9 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
38589
36970
|
className: "sr-only",
|
|
38590
36971
|
id: "webchatChatHistoryHeading"
|
|
38591
36972
|
}, config.settings.customTranslations?.ariaLabels?.chatHistory ?? "Chat history"), this.renderHistory()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_ScreenReaderLiveRegion__WEBPACK_IMPORTED_MODULE_50__/* ["default"] */ .A, {
|
|
38592
|
-
liveContent: this.state.liveContent
|
|
36973
|
+
liveContent: this.state.liveContent,
|
|
36974
|
+
intro: this.getNoticeIntro(),
|
|
36975
|
+
onIntroAnnounced: this.handleNoticeIntroAnnounced
|
|
38593
36976
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_history_QueueUpdates__WEBPACK_IMPORTED_MODULE_39__/* ["default"] */ .A, null), this.renderInput());
|
|
38594
36977
|
};
|
|
38595
36978
|
const getTitles = () => {
|
|
@@ -38614,14 +36997,29 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
38614
36997
|
return "Cognigy";
|
|
38615
36998
|
};
|
|
38616
36999
|
const isHomeScreenEnabled = config.settings.homeScreen.enabled;
|
|
38617
|
-
const
|
|
38618
|
-
|
|
37000
|
+
const {
|
|
37001
|
+
showEnabledHomeScreen,
|
|
37002
|
+
showChatScreen
|
|
37003
|
+
} = (0,_utils_screen_visibility__WEBPACK_IMPORTED_MODULE_55__/* .getScreenVisibility */ .p)(this.props, isInforming);
|
|
38619
37004
|
const isChatOptionsButtonVisible = config.settings.chatOptions.enabled && showChatScreen;
|
|
38620
37005
|
const hideBackButton = showChatScreen && !isHomeScreenEnabled;
|
|
38621
37006
|
const showDeleteAllConversationButton = !!((config.settings.privacyNotice.enabled && this.props.hasAcceptedTerms || !config.settings.privacyNotice.enabled) && config.settings.homeScreen.previousConversations.enableDeleteAllConversations && showPrevConversations && Object.keys(this.props.prevConversations).length);
|
|
38622
37007
|
const autoFocusScreenTitle = !showChatScreen && !showHomeScreen;
|
|
37008
|
+
|
|
37009
|
+
// True while the regular layout is the active view. During the back-to-home
|
|
37010
|
+
// slide-out it stays mounted for the 500ms exit animation; the content wrapper
|
|
37011
|
+
// below then gets `inert` (removes it from tab order and pointer events —
|
|
37012
|
+
// aria-hidden alone leaves the off-screen controls tabbable) plus
|
|
37013
|
+
// aria-hidden="true" as a fallback for browsers without inert support
|
|
37014
|
+
// (WCAG 1.3.2), so screen readers don't announce the leaving screen's
|
|
37015
|
+
// messages and input label. While active, neither attribute is rendered:
|
|
37016
|
+
// aria-hidden="false" has inconsistent AT support and would read as hidden
|
|
37017
|
+
// to attribute-presence checks. The header transition is deliberately not
|
|
37018
|
+
// hidden: it is static chrome with no live region, so nothing in it
|
|
37019
|
+
// announces during the exit.
|
|
37020
|
+
const isRegularLayoutActiveView = !!(!showEnabledHomeScreen || showInformationMessage);
|
|
38623
37021
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(RegularLayoutRoot, null, !isXAppOverlayOpen && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(react_transition_group__WEBPACK_IMPORTED_MODULE_41__/* ["default"] */ .A, {
|
|
38624
|
-
in:
|
|
37022
|
+
in: isRegularLayoutActiveView,
|
|
38625
37023
|
timeout: 500,
|
|
38626
37024
|
classNames: "slide-in",
|
|
38627
37025
|
mountOnEnter: true,
|
|
@@ -38665,12 +37063,18 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
38665
37063
|
onEmitAnalytics: onEmitAnalytics,
|
|
38666
37064
|
onSendActionButtonMessage: this.handleSendActionButtonMessage
|
|
38667
37065
|
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(react_transition_group__WEBPACK_IMPORTED_MODULE_41__/* ["default"] */ .A, {
|
|
38668
|
-
in:
|
|
37066
|
+
in: isRegularLayoutActiveView,
|
|
38669
37067
|
timeout: 500,
|
|
38670
37068
|
classNames: "slide-in",
|
|
38671
37069
|
mountOnEnter: true,
|
|
38672
37070
|
unmountOnExit: true
|
|
38673
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(RegularLayoutContentWrapper,
|
|
37071
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(RegularLayoutContentWrapper, {
|
|
37072
|
+
className: "webchat-regular-layout-content",
|
|
37073
|
+
"aria-hidden": isRegularLayoutActiveView ? undefined : true,
|
|
37074
|
+
inert: isRegularLayoutActiveView ? undefined : ""
|
|
37075
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_FreezeOnExit__WEBPACK_IMPORTED_MODULE_52__/* ["default"] */ .A, {
|
|
37076
|
+
active: isRegularLayoutActiveView
|
|
37077
|
+
}, getRegularLayoutContent()), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_presentational_previous_conversations_DeleteAllConversations__WEBPACK_IMPORTED_MODULE_49__/* ["default"] */ .A, {
|
|
38674
37078
|
config: config,
|
|
38675
37079
|
isOpen: this.state.showDeleteAllConversationsModal,
|
|
38676
37080
|
onOpenChange: (open, confirmDelete) => {
|
|
@@ -38754,7 +37158,7 @@ class WebchatUI extends react__WEBPACK_IMPORTED_MODULE_0__["default"].PureCompon
|
|
|
38754
37158
|
variant: "body-regular",
|
|
38755
37159
|
component: "div",
|
|
38756
37160
|
className: "webchat-log-ai-agent-notice-text"
|
|
38757
|
-
}, AIAgentNoticeText ||
|
|
37161
|
+
}, AIAgentNoticeText || _utils_ai_agent_notice__WEBPACK_IMPORTED_MODULE_54__/* .DEFAULT_AI_AGENT_NOTICE_TEXT */ .S5), visibleMessages.map((message, index) => {
|
|
38758
37162
|
// Lookahead if there is a user reply that includes text or attachments
|
|
38759
37163
|
const hasReply = visibleMessages.slice(index + 1).some(message => {
|
|
38760
37164
|
const isUser = message.source === "user";
|
|
@@ -40899,99 +39303,211 @@ const ChatIcon = ({
|
|
|
40899
39303
|
/* harmony export */ });
|
|
40900
39304
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
40901
39305
|
/* harmony import */ var _emotion_styled__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84937);
|
|
40902
|
-
/* harmony import */ var
|
|
40903
|
-
/* harmony import */ var react_modal__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_modal__WEBPACK_IMPORTED_MODULE_2__);
|
|
39306
|
+
/* harmony import */ var _Modal_Modal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53166);
|
|
40904
39307
|
/* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(91221);
|
|
40905
|
-
/* harmony import */ var _IconButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(39966);
|
|
40906
|
-
/* harmony import */ var _assets_baseline_close_24px_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93647);
|
|
40907
|
-
|
|
40908
|
-
|
|
40909
39308
|
|
|
40910
39309
|
|
|
40911
39310
|
|
|
40912
39311
|
|
|
40913
|
-
|
|
40914
|
-
|
|
40915
|
-
|
|
40916
|
-
|
|
40917
|
-
|
|
40918
|
-
fontWeight: 600,
|
|
40919
|
-
boxSizing: "border-box",
|
|
40920
|
-
zIndex: 4
|
|
40921
|
-
}));
|
|
40922
|
-
const HeaderIconButton = (0,_emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(_IconButton__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(({
|
|
40923
|
-
theme
|
|
40924
|
-
}) => ({
|
|
40925
|
-
position: "absolute",
|
|
40926
|
-
right: 15,
|
|
40927
|
-
top: 17,
|
|
40928
|
-
borderRadius: 4,
|
|
40929
|
-
"&:focus": {
|
|
40930
|
-
outline: `2px solid ${theme.primaryColorFocus}`,
|
|
40931
|
-
outlineOffset: 2
|
|
39312
|
+
// aria-disabled (not disabled) so the running state stays focusable and
|
|
39313
|
+
// announceable; the dimming therefore can't come from Button's `&:disabled`.
|
|
39314
|
+
const ReconnectButton = (0,_emotion_styled__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A)(_Button__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)({
|
|
39315
|
+
"&[aria-disabled='true']": {
|
|
39316
|
+
opacity: 0.6
|
|
40932
39317
|
}
|
|
40933
|
-
})
|
|
39318
|
+
});
|
|
39319
|
+
/**
|
|
39320
|
+
* Blocking connection-lost state of the chat window. A fullscreen Modal so
|
|
39321
|
+
* closing it visibly means closing the chat window — matching the close
|
|
39322
|
+
* button's accessible name. The chat layout behind it is aria-hidden + inert
|
|
39323
|
+
* while open (see DisconnectableContentWrapper in WebchatUI).
|
|
39324
|
+
*/
|
|
40934
39325
|
const DisconnectOverlay = props => {
|
|
40935
39326
|
const {
|
|
40936
39327
|
isPermanent,
|
|
39328
|
+
isConnecting,
|
|
40937
39329
|
onClose,
|
|
40938
39330
|
onConnect,
|
|
40939
39331
|
config,
|
|
40940
39332
|
isOpen
|
|
40941
39333
|
} = props;
|
|
40942
|
-
|
|
40943
|
-
|
|
39334
|
+
|
|
39335
|
+
// Focus the primary Reconnect action on open when it is rendered;
|
|
39336
|
+
// the Modal falls back to its close button otherwise.
|
|
39337
|
+
const reconnectRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
39338
|
+
const showReconnect = isPermanent && navigator.onLine;
|
|
39339
|
+
const networkErrorText = config.settings.customTranslations?.network_error ?? "Connection lost";
|
|
39340
|
+
const reconnectingText = config.settings.customTranslations?.reconnecting ?? "Reconnecting...";
|
|
39341
|
+
const noNetworkText = config.settings.customTranslations?.no_network ?? "No network connection";
|
|
39342
|
+
const reconnectText = config.settings.customTranslations?.reconnect ?? "Reconnect";
|
|
39343
|
+
const connectionRestoredText = config.settings.customTranslations?.connection_restored ?? "Connection restored.";
|
|
39344
|
+
|
|
39345
|
+
// Live announcements reusing the already-localized overlay strings, split
|
|
39346
|
+
// across two regions because VoiceOver prunes the accessibility tree
|
|
39347
|
+
// outside an aria-modal dialog:
|
|
39348
|
+
// - `announcement` renders in a region INSIDE the dialog body — the only
|
|
39349
|
+
// place VoiceOver honors live updates while the modal is open.
|
|
39350
|
+
// - `closedAnnouncement` renders in a region OUTSIDE the dialog (it
|
|
39351
|
+
// outlives it), for "connection restored" after the dialog has closed —
|
|
39352
|
+
// at that point the tree is no longer pruned.
|
|
39353
|
+
const [announcement, setAnnouncement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
|
|
39354
|
+
const [closedAnnouncement, setClosedAnnouncement] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
|
|
39355
|
+
// The dialog announcement covers only its accessible name ("Connection
|
|
39356
|
+
// lost") — VoiceOver does not read the status text in the dialog body, so
|
|
39357
|
+
// the reconnecting phase would pass in silence (SC 4.1.3 Status Messages).
|
|
39358
|
+
// Announce the status on open — but never the dialog title, which the
|
|
39359
|
+
// dialog already announces. Deferred past the Modal's ~200ms initial-focus
|
|
39360
|
+
// move so the polite message queues after the dialog/focus announcement
|
|
39361
|
+
// instead of being coalesced into it. Deliberately a separate effect keyed
|
|
39362
|
+
// on `isOpen` alone, reading the rest at fire time from a ref: inside the
|
|
39363
|
+
// transition effect below, any connection-state flip within the deferral
|
|
39364
|
+
// window would re-run the effect and its cleanup would cancel the pending
|
|
39365
|
+
// announcement.
|
|
39366
|
+
const openStatusRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({
|
|
39367
|
+
isConnecting,
|
|
39368
|
+
isPermanent,
|
|
39369
|
+
reconnectingText,
|
|
39370
|
+
noNetworkText
|
|
39371
|
+
});
|
|
39372
|
+
openStatusRef.current = {
|
|
39373
|
+
isConnecting,
|
|
39374
|
+
isPermanent,
|
|
39375
|
+
reconnectingText,
|
|
39376
|
+
noNetworkText
|
|
39377
|
+
};
|
|
40944
39378
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
40945
|
-
|
|
40946
|
-
setTimeout(() =>
|
|
40947
|
-
|
|
40948
|
-
|
|
40949
|
-
|
|
40950
|
-
|
|
40951
|
-
|
|
40952
|
-
|
|
40953
|
-
|
|
40954
|
-
|
|
40955
|
-
|
|
40956
|
-
|
|
40957
|
-
|
|
40958
|
-
|
|
40959
|
-
|
|
40960
|
-
|
|
40961
|
-
|
|
40962
|
-
|
|
40963
|
-
|
|
40964
|
-
|
|
40965
|
-
|
|
39379
|
+
if (!isOpen) return;
|
|
39380
|
+
const openTimer = setTimeout(() => {
|
|
39381
|
+
const current = openStatusRef.current;
|
|
39382
|
+
const statusText = current.isConnecting || !current.isPermanent ? current.reconnectingText : !navigator.onLine ? current.noNetworkText : null; // idle permanent state: the focused Reconnect button announces itself
|
|
39383
|
+
if (statusText) setAnnouncement(statusText);
|
|
39384
|
+
}, 300);
|
|
39385
|
+
return () => clearTimeout(openTimer);
|
|
39386
|
+
}, [isOpen]);
|
|
39387
|
+
const prevStateRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({
|
|
39388
|
+
isOpen,
|
|
39389
|
+
isPermanent,
|
|
39390
|
+
isConnecting
|
|
39391
|
+
});
|
|
39392
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
39393
|
+
const prev = prevStateRef.current;
|
|
39394
|
+
prevStateRef.current = {
|
|
39395
|
+
isOpen,
|
|
39396
|
+
isPermanent,
|
|
39397
|
+
isConnecting
|
|
39398
|
+
};
|
|
39399
|
+
if (!prev.isOpen && isOpen) {
|
|
39400
|
+
// Opening is announced by the effect above. Clear the outside region:
|
|
39401
|
+
// setting it to the same "Connection restored." string on the next
|
|
39402
|
+
// close would otherwise be a React no-op (no DOM mutation), leaving
|
|
39403
|
+
// every restore after the first unannounced.
|
|
39404
|
+
setClosedAnnouncement("");
|
|
39405
|
+
return;
|
|
40966
39406
|
}
|
|
40967
|
-
|
|
40968
|
-
|
|
40969
|
-
|
|
40970
|
-
|
|
40971
|
-
|
|
40972
|
-
|
|
40973
|
-
|
|
40974
|
-
"data-disconnect-overlay-close-button": true,
|
|
40975
|
-
onClick: onClose,
|
|
40976
|
-
ref: closeRef,
|
|
40977
|
-
className: "webchat-header-close-button",
|
|
40978
|
-
"aria-label": config.settings.customTranslations?.ariaLabels?.closeConnectionWarning ?? "Close connection lost overlay"
|
|
40979
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_assets_baseline_close_24px_svg__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A, {
|
|
40980
|
-
style: {
|
|
40981
|
-
fill: "#000"
|
|
39407
|
+
if (prev.isOpen && !isOpen) {
|
|
39408
|
+
setClosedAnnouncement(connectionRestoredText);
|
|
39409
|
+
// Clear the in-dialog region so a later reopen doesn't remount the
|
|
39410
|
+
// dialog with stale text sitting in a live region (content present
|
|
39411
|
+
// at insertion can be spuriously announced).
|
|
39412
|
+
setAnnouncement("");
|
|
39413
|
+
return;
|
|
40982
39414
|
}
|
|
40983
|
-
|
|
40984
|
-
|
|
40985
|
-
|
|
40986
|
-
|
|
40987
|
-
|
|
40988
|
-
|
|
40989
|
-
|
|
39415
|
+
if (!isOpen) return;
|
|
39416
|
+
|
|
39417
|
+
// The permanent transition is checked first: `connecting` can flip in
|
|
39418
|
+
// the same commit (e.g. a CONNECT dispatched on tab re-focus rejecting
|
|
39419
|
+
// just as the retry limit is hit) and must not swallow the focus move
|
|
39420
|
+
// below.
|
|
39421
|
+
if (!prev.isPermanent && isPermanent) {
|
|
39422
|
+
// Automatic reconnection gave up.
|
|
39423
|
+
if (!showReconnect) {
|
|
39424
|
+
setAnnouncement(noNetworkText);
|
|
39425
|
+
return;
|
|
39426
|
+
}
|
|
39427
|
+
// Move focus to the newly appeared Reconnect action. Deferred so
|
|
39428
|
+
// the screen reader ingests the inserted button before the focus
|
|
39429
|
+
// event (focusing in the same task the node was inserted is not
|
|
39430
|
+
// announced), and guarded so it only happens while focus still
|
|
39431
|
+
// sits on the overlay's close button — never yanking focus from a
|
|
39432
|
+
// navigating user (SC 3.2.1). The focus move announces the button;
|
|
39433
|
+
// when the guard skips it, the live region announces the label
|
|
39434
|
+
// instead, so the transition is announced exactly once either way.
|
|
39435
|
+
const focusTimer = setTimeout(() => {
|
|
39436
|
+
const active = document.activeElement;
|
|
39437
|
+
if (active?.hasAttribute("data-disconnect-overlay-close-button")) {
|
|
39438
|
+
reconnectRef.current?.focus();
|
|
39439
|
+
// Clear the region (emptying is not announced) so the focus
|
|
39440
|
+
// announcement stays the only output here, and so a later
|
|
39441
|
+
// manual-reconnect announcement is a fresh text mutation even
|
|
39442
|
+
// when it repeats the last announced string.
|
|
39443
|
+
setAnnouncement("");
|
|
39444
|
+
} else {
|
|
39445
|
+
setAnnouncement(reconnectText);
|
|
39446
|
+
}
|
|
39447
|
+
}, 500);
|
|
39448
|
+
return () => clearTimeout(focusTimer);
|
|
39449
|
+
}
|
|
39450
|
+
// The `connecting` transitions are only announced in the permanent
|
|
39451
|
+
// state, where they reflect a *manual* reconnection attempt. During the
|
|
39452
|
+
// automatic-retry phase the flag flips on every retry cycle — announcing
|
|
39453
|
+
// each flip would alternate "Reconnecting…"/"Connection lost" as pure
|
|
39454
|
+
// noise while the status ("Reconnecting…", announced on open) hasn't
|
|
39455
|
+
// actually changed.
|
|
39456
|
+
else if (!prev.isConnecting && isConnecting && isPermanent) {
|
|
39457
|
+
setAnnouncement(reconnectingText);
|
|
39458
|
+
} else if (prev.isConnecting && !isConnecting && isPermanent) {
|
|
39459
|
+
// A manual reconnection attempt ended while still disconnected
|
|
39460
|
+
setAnnouncement(networkErrorText);
|
|
39461
|
+
}
|
|
39462
|
+
}, [isOpen, isPermanent, isConnecting, showReconnect, networkErrorText, reconnectingText, noNetworkText, reconnectText, connectionRestoredText]);
|
|
39463
|
+
const handleReconnect = () => {
|
|
39464
|
+
if (isConnecting) return;
|
|
39465
|
+
// Announce the attempt directly on activation — deterministic for
|
|
39466
|
+
// assistive tech regardless of when (or whether) the store's
|
|
39467
|
+
// `connecting` flag transition is observed by the effect above.
|
|
39468
|
+
setAnnouncement(reconnectingText);
|
|
39469
|
+
onConnect();
|
|
39470
|
+
};
|
|
39471
|
+
|
|
39472
|
+
// Visible status line. The idle permanent state shows no status text (just
|
|
39473
|
+
// the Reconnect action).
|
|
39474
|
+
const statusText = isConnecting || !isPermanent ? reconnectingText : !navigator.onLine ? noNetworkText : null;
|
|
39475
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(react__WEBPACK_IMPORTED_MODULE_0__["default"].Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("div", {
|
|
39476
|
+
role: "status",
|
|
39477
|
+
className: "sr-only"
|
|
39478
|
+
}, closedAnnouncement), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_Modal_Modal__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A, {
|
|
39479
|
+
variant: "fullscreen",
|
|
39480
|
+
isOpen: isOpen,
|
|
39481
|
+
onClose: () => onClose(),
|
|
39482
|
+
title: networkErrorText,
|
|
39483
|
+
titleId: "webchatDisconnectOverlayTitle",
|
|
39484
|
+
closeButtonAriaLabel: config.settings.customTranslations?.ariaLabels?.closeConnectionWarning ?? "Close chat window",
|
|
39485
|
+
closeButtonProps: {
|
|
39486
|
+
"data-disconnect-overlay-close-button": true,
|
|
39487
|
+
className: "webchat-header-close-button"
|
|
39488
|
+
},
|
|
39489
|
+
initialFocusRef: reconnectRef,
|
|
39490
|
+
className: "webchat-disconnect-overlay",
|
|
39491
|
+
"data-disconnect-overlay": true
|
|
39492
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("div", {
|
|
39493
|
+
role: "status",
|
|
39494
|
+
className: "sr-only",
|
|
39495
|
+
"data-disconnect-overlay-live-region": true
|
|
39496
|
+
}, announcement), statusText &&
|
|
39497
|
+
/*#__PURE__*/
|
|
39498
|
+
// aria-hidden: the live region above is the single programmatic
|
|
39499
|
+
// source of this text. Without this, NVDA reads the visible line
|
|
39500
|
+
// in each of its two dialog-entry passes and then hears the live
|
|
39501
|
+
// region too — "Reconnecting…" three times.
|
|
39502
|
+
react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("div", {
|
|
39503
|
+
className: "webchat-disconnect-overlay-status",
|
|
39504
|
+
"aria-hidden": "true"
|
|
39505
|
+
}, statusText), showReconnect && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(ReconnectButton, {
|
|
39506
|
+
ref: reconnectRef,
|
|
39507
|
+
onClick: handleReconnect,
|
|
40990
39508
|
color: "primary",
|
|
40991
|
-
|
|
40992
|
-
|
|
40993
|
-
}
|
|
40994
|
-
}, config.settings.customTranslations?.reconnect ?? "Reconnect") : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("div", null, config.settings.customTranslations?.no_network ?? "No network connection")) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("div", null, config.settings.customTranslations?.reconnecting ?? "Reconnecting..."));
|
|
39509
|
+
"aria-disabled": isConnecting
|
|
39510
|
+
}, reconnectText)));
|
|
40995
39511
|
};
|
|
40996
39512
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DisconnectOverlay);
|
|
40997
39513
|
|
|
@@ -41149,6 +39665,46 @@ const FABDisabled = (0,_emotion_styled__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
41149
39665
|
|
|
41150
39666
|
/***/ },
|
|
41151
39667
|
|
|
39668
|
+
/***/ 97475
|
|
39669
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
39670
|
+
|
|
39671
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
39672
|
+
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
39673
|
+
/* harmony export */ });
|
|
39674
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
39675
|
+
|
|
39676
|
+
|
|
39677
|
+
/**
|
|
39678
|
+
* Renders children normally while active; while inactive, keeps showing the
|
|
39679
|
+
* children from the last active committed render.
|
|
39680
|
+
*
|
|
39681
|
+
* Used to freeze a leaving screen during its exit animation: the screen stays
|
|
39682
|
+
* mounted for the slide-out, but the navigation state already points at the
|
|
39683
|
+
* next screen — rendering that would mount the input (which autofocuses) and
|
|
39684
|
+
* remount the live region (which re-announces old messages). Freezing the
|
|
39685
|
+
* leaving view prevents both (CGY-3276). The ref is written in an effect
|
|
39686
|
+
* (commit phase) so discarded renders never pollute the frozen content.
|
|
39687
|
+
*
|
|
39688
|
+
* Scope: this freezes the element tree (types + props) from the last active
|
|
39689
|
+
* commit, not the subtree's output — components inside keep their own
|
|
39690
|
+
* Redux/context subscriptions and can still re-render with fresh state
|
|
39691
|
+
* during the exit. Sufficient here, since it's the *structural* swap to the
|
|
39692
|
+
* next screen (new input, remounted live region) that must not happen.
|
|
39693
|
+
*/
|
|
39694
|
+
const FreezeOnExit = ({
|
|
39695
|
+
active,
|
|
39696
|
+
children
|
|
39697
|
+
}) => {
|
|
39698
|
+
const lastActive = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
39699
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
39700
|
+
if (active) lastActive.current = children;
|
|
39701
|
+
});
|
|
39702
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(react__WEBPACK_IMPORTED_MODULE_0__["default"].Fragment, null, active ? children : lastActive.current);
|
|
39703
|
+
};
|
|
39704
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FreezeOnExit);
|
|
39705
|
+
|
|
39706
|
+
/***/ },
|
|
39707
|
+
|
|
41152
39708
|
/***/ 55922
|
|
41153
39709
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
41154
39710
|
|
|
@@ -41575,7 +40131,7 @@ const HomeScreen = props => {
|
|
|
41575
40131
|
const {
|
|
41576
40132
|
firstFocusable
|
|
41577
40133
|
} = (0,_utils_find_focusable__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .A)(homeScreenRef.current);
|
|
41578
|
-
firstFocusable
|
|
40134
|
+
firstFocusable?.focus();
|
|
41579
40135
|
}
|
|
41580
40136
|
}, []);
|
|
41581
40137
|
|
|
@@ -41651,6 +40207,48 @@ const HomeScreen = props => {
|
|
|
41651
40207
|
|
|
41652
40208
|
/***/ },
|
|
41653
40209
|
|
|
40210
|
+
/***/ 55115
|
|
40211
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
40212
|
+
|
|
40213
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
40214
|
+
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
40215
|
+
/* harmony export */ });
|
|
40216
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
40217
|
+
/* harmony import */ var _StatusLiveRegion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(63813);
|
|
40218
|
+
|
|
40219
|
+
|
|
40220
|
+
|
|
40221
|
+
// Delayed until after the slide transition (500ms) and any focus move the
|
|
40222
|
+
// appearing screen performs (home screen close button: 450ms), so the
|
|
40223
|
+
// announcement follows the focus utterance instead of being cancelled by it.
|
|
40224
|
+
const ANNOUNCE_DELAY_MS = 600;
|
|
40225
|
+
|
|
40226
|
+
/**
|
|
40227
|
+
* Announces the home screen's title through the status live region when
|
|
40228
|
+
* the screen visually appears (webchat opened onto it, or navigation
|
|
40229
|
+
* from another screen, CGY-3276). Focus lands on the close button, which
|
|
40230
|
+
* alone would not tell screen-reader users which screen they are on.
|
|
40231
|
+
* (The chat screen's AI-agent notice announces through the chat log's
|
|
40232
|
+
* ScreenReaderLiveRegion instead — see docs/accessibility.md.)
|
|
40233
|
+
*
|
|
40234
|
+
* The effect cleanup cancels the pending announcement if the user closes
|
|
40235
|
+
* the webchat or navigates away within the delay.
|
|
40236
|
+
*/
|
|
40237
|
+
const HomeScreenAnnouncer = ({
|
|
40238
|
+
active,
|
|
40239
|
+
label
|
|
40240
|
+
}) => {
|
|
40241
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
40242
|
+
if (!active) return;
|
|
40243
|
+
const announceTimeout = setTimeout(() => (0,_StatusLiveRegion__WEBPACK_IMPORTED_MODULE_1__/* .announceStatus */ .a)(label), ANNOUNCE_DELAY_MS);
|
|
40244
|
+
return () => clearTimeout(announceTimeout);
|
|
40245
|
+
}, [active, label]);
|
|
40246
|
+
return null;
|
|
40247
|
+
};
|
|
40248
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HomeScreenAnnouncer);
|
|
40249
|
+
|
|
40250
|
+
/***/ },
|
|
40251
|
+
|
|
41654
40252
|
/***/ 39966
|
|
41655
40253
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
41656
40254
|
|
|
@@ -41946,8 +40544,31 @@ const Notifications = () => {
|
|
|
41946
40544
|
}
|
|
41947
40545
|
});
|
|
41948
40546
|
};
|
|
40547
|
+
|
|
40548
|
+
// The toast node is inserted into the DOM at the moment it appears, so its
|
|
40549
|
+
// default role="status" never fires in screen readers (WCAG 4.1.3).
|
|
40550
|
+
// Announcements go through <StatusLiveRegion> (StatusLiveRegion.tsx), which
|
|
40551
|
+
// is mounted for the lifetime of the open chat window; aria-live="off"
|
|
40552
|
+
// prevents double announcements. This must be set per toast() call —
|
|
40553
|
+
// react-hot-toast stamps default ariaProps onto every toast, which override
|
|
40554
|
+
// any Toaster-level toastOptions.ariaProps.
|
|
40555
|
+
const silencedAriaProps = {
|
|
40556
|
+
role: "status",
|
|
40557
|
+
"aria-live": "off"
|
|
40558
|
+
};
|
|
40559
|
+
|
|
40560
|
+
// `message` is intentionally narrowed to string (react-hot-toast also accepts
|
|
40561
|
+
// JSX): <StatusLiveRegion> mirrors the message as text, so a non-string toast
|
|
40562
|
+
// would render visibly but never be announced (WCAG 4.1.3).
|
|
40563
|
+
// className/ariaProps sit after the options spread on purpose — the class is
|
|
40564
|
+
// the selector the a11y specs rely on, and caller-supplied ariaProps would
|
|
40565
|
+
// re-enable the double announcement (CGY-34519).
|
|
41949
40566
|
function createNotification(message, options = {}) {
|
|
41950
|
-
(0,react_hot_toast__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Ay)(message,
|
|
40567
|
+
(0,react_hot_toast__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Ay)(message, {
|
|
40568
|
+
...options,
|
|
40569
|
+
className: "webchat-toast-notification",
|
|
40570
|
+
ariaProps: silencedAriaProps
|
|
40571
|
+
});
|
|
41951
40572
|
}
|
|
41952
40573
|
|
|
41953
40574
|
/**
|
|
@@ -41962,6 +40583,8 @@ function createNotification(message, options = {}) {
|
|
|
41962
40583
|
function createPersistentNotification(message, options = {}) {
|
|
41963
40584
|
const id = toast(message, {
|
|
41964
40585
|
...options,
|
|
40586
|
+
className: "webchat-toast-notification",
|
|
40587
|
+
ariaProps: silencedAriaProps,
|
|
41965
40588
|
duration: Infinity
|
|
41966
40589
|
});
|
|
41967
40590
|
return () => toast.dismiss(id);
|
|
@@ -42258,19 +40881,65 @@ const PrivacyNotice = props => {
|
|
|
42258
40881
|
/* harmony import */ var _webchat_helper_useSelector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3862);
|
|
42259
40882
|
/* harmony import */ var _utils_live_region_announcement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(79071);
|
|
42260
40883
|
/* harmony import */ var _utils_filter_out_control_commands__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(70562);
|
|
40884
|
+
/* harmony import */ var _SrOnlyLiveRegion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65766);
|
|
40885
|
+
|
|
42261
40886
|
|
|
42262
40887
|
|
|
42263
40888
|
|
|
42264
40889
|
|
|
40890
|
+
// Intro announcements are deferred past the chat screen's own utterances
|
|
40891
|
+
// (input autofocus on mount, focus restore after the disconnect overlay
|
|
40892
|
+
// closes) — live text inserted in the same breath as a focus move gets the
|
|
40893
|
+
// polite announcement cancelled. Messages don't need this: network latency
|
|
40894
|
+
// keeps them clear of the mount, and the intro hold below keeps them in
|
|
40895
|
+
// order.
|
|
40896
|
+
const INTRO_ANNOUNCE_DELAY_MS = 600;
|
|
42265
40897
|
const ScreenReaderLiveRegion = ({
|
|
42266
|
-
liveContent
|
|
40898
|
+
liveContent,
|
|
40899
|
+
intro,
|
|
40900
|
+
onIntroAnnounced
|
|
42267
40901
|
}) => {
|
|
42268
40902
|
const [liveMessage, setLiveMessage] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
40903
|
+
const [introMessage, setIntroMessage] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
40904
|
+
const [announcedIntroKey, setAnnouncedIntroKey] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
40905
|
+
const introRegionRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
40906
|
+
// Destructured so the intro effect depends on primitives — the parent
|
|
40907
|
+
// builds a fresh `intro` object every render, and an object dep would
|
|
40908
|
+
// restart the announce timer on each of them.
|
|
40909
|
+
const introKey = intro?.key;
|
|
40910
|
+
const introText = intro?.text;
|
|
42269
40911
|
const messageHistory = (0,_webchat_helper_useSelector__WEBPACK_IMPORTED_MODULE_1__/* .useSelector */ .d)(state => state.messages.messageHistory);
|
|
42270
40912
|
const messages = (0,_utils_filter_out_control_commands__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(messageHistory, ["acceptPrivacyPolicy"]);
|
|
42271
40913
|
const announcedIdsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(new Set());
|
|
42272
40914
|
const isProgressiveRenderingEnabled = (0,_webchat_helper_useSelector__WEBPACK_IMPORTED_MODULE_1__/* .useSelector */ .d)(state => state.config.settings.behavior?.progressiveMessageRendering);
|
|
40915
|
+
|
|
40916
|
+
// The intro claims the first announcement slot: while it is pending, the
|
|
40917
|
+
// message effect below holds (and re-runs when the pending state flips).
|
|
40918
|
+
const introPending = !!introText && introKey !== announcedIntroKey;
|
|
42273
40919
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
40920
|
+
if (!introPending || !introText || introKey === undefined) return;
|
|
40921
|
+
const introTimeout = setTimeout(() => {
|
|
40922
|
+
// Fire-time exposure check: during the back-to-home exit
|
|
40923
|
+
// transition this component stays MOUNTED (FreezeOnExit holds
|
|
40924
|
+
// the chat screen for the 500ms slide) inside a wrapper that is
|
|
40925
|
+
// aria-hidden + inert — text committed there is never voiced.
|
|
40926
|
+
// Skip WITHOUT marking announced (announcedNoticeKeys outlives
|
|
40927
|
+
// the remount by design), so the notice announces on the next
|
|
40928
|
+
// real visit to the chat screen instead of being lost for the
|
|
40929
|
+
// session. Checking `showChatScreen` in the parent can't do
|
|
40930
|
+
// this: FreezeOnExit freezes props during the exit.
|
|
40931
|
+
if (introRegionRef.current?.closest('[inert], [aria-hidden="true"]')) return;
|
|
40932
|
+
setIntroMessage({
|
|
40933
|
+
id: `webchatAIAgentNotice-${introKey}`,
|
|
40934
|
+
text: (0,_utils_live_region_announcement__WEBPACK_IMPORTED_MODULE_2__/* .cleanUpText */ .Yx)(introText)
|
|
40935
|
+
});
|
|
40936
|
+
setAnnouncedIntroKey(introKey);
|
|
40937
|
+
onIntroAnnounced?.(introKey);
|
|
40938
|
+
}, INTRO_ANNOUNCE_DELAY_MS);
|
|
40939
|
+
return () => clearTimeout(introTimeout);
|
|
40940
|
+
}, [introPending, introText, introKey, onIntroAnnounced]);
|
|
40941
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
40942
|
+
if (introPending) return;
|
|
42274
40943
|
if (!messages.length) return;
|
|
42275
40944
|
const unannouncedMessages = messages.filter(msg => {
|
|
42276
40945
|
const id = `webchatMessageId-${msg.timestamp}`;
|
|
@@ -42328,16 +40997,15 @@ const ScreenReaderLiveRegion = ({
|
|
|
42328
40997
|
}
|
|
42329
40998
|
}, 100);
|
|
42330
40999
|
return () => clearTimeout(timeout);
|
|
42331
|
-
}, [messages, liveContent, isProgressiveRenderingEnabled]);
|
|
42332
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("
|
|
42333
|
-
"aria-live": "polite",
|
|
42334
|
-
"aria-relevant": "additions text",
|
|
42335
|
-
"aria-atomic": "true",
|
|
41000
|
+
}, [messages, liveContent, isProgressiveRenderingEnabled, introPending]);
|
|
41001
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(react__WEBPACK_IMPORTED_MODULE_0__["default"].Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_SrOnlyLiveRegion__WEBPACK_IMPORTED_MODULE_4__/* .SrOnlyLiveRegion */ .Y, {
|
|
42336
41002
|
id: "webchatMessageContainerScreenReaderLiveRegion",
|
|
42337
|
-
|
|
42338
|
-
},
|
|
42339
|
-
|
|
42340
|
-
|
|
41003
|
+
message: liveMessage
|
|
41004
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_SrOnlyLiveRegion__WEBPACK_IMPORTED_MODULE_4__/* .SrOnlyLiveRegion */ .Y, {
|
|
41005
|
+
id: "webchatAIAgentNoticeLiveRegion",
|
|
41006
|
+
message: introMessage,
|
|
41007
|
+
ref: introRegionRef
|
|
41008
|
+
}));
|
|
42341
41009
|
};
|
|
42342
41010
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ScreenReaderLiveRegion);
|
|
42343
41011
|
|
|
@@ -42385,6 +41053,155 @@ const ScreenReaderLiveRegion = ({
|
|
|
42385
41053
|
|
|
42386
41054
|
/***/ },
|
|
42387
41055
|
|
|
41056
|
+
/***/ 65766
|
|
41057
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
41058
|
+
|
|
41059
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
41060
|
+
/* harmony export */ Y: () => (/* binding */ SrOnlyLiveRegion)
|
|
41061
|
+
/* harmony export */ });
|
|
41062
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
41063
|
+
|
|
41064
|
+
// How long announced text stays in the DOM. Screen-reader users browsing the
|
|
41065
|
+
// window later would otherwise read long-gone status text; removing the node
|
|
41066
|
+
// is silent (removals are not announced under aria-relevant="additions text").
|
|
41067
|
+
const CLEAR_DELAY_MS = 15000;
|
|
41068
|
+
/**
|
|
41069
|
+
* Shared visually-hidden live region body (WCAG 4.1.3 Status Messages).
|
|
41070
|
+
*
|
|
41071
|
+
* A live region only announces changes to a node that is already in the
|
|
41072
|
+
* accessibility tree, so mount this (empty) before the first announcement —
|
|
41073
|
+
* never together with its content. Each new `message` is announced once and
|
|
41074
|
+
* cleared from the DOM after 15s.
|
|
41075
|
+
*
|
|
41076
|
+
* Used by <ScreenReaderLiveRegion> (chat messages) and <StatusLiveRegion>
|
|
41077
|
+
* (toasts + screen changes); they stay separate DOM regions so simultaneous
|
|
41078
|
+
* announcements queue instead of overwriting each other.
|
|
41079
|
+
*
|
|
41080
|
+
* The text is deliberately committed via state in an effect — one commit
|
|
41081
|
+
* after the `message` prop changes — rather than rendered directly from the
|
|
41082
|
+
* prop. That guarantees the (empty) region exists in the accessibility tree
|
|
41083
|
+
* strictly before its content appears; don't "optimise" this back into a
|
|
41084
|
+
* derived render.
|
|
41085
|
+
*/
|
|
41086
|
+
const SrOnlyLiveRegion = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({
|
|
41087
|
+
id,
|
|
41088
|
+
message,
|
|
41089
|
+
role
|
|
41090
|
+
}, ref) => {
|
|
41091
|
+
const [displayed, setDisplayed] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
41092
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
41093
|
+
setDisplayed(message);
|
|
41094
|
+
if (!message) return;
|
|
41095
|
+
const clearTimer = setTimeout(() => setDisplayed(null), CLEAR_DELAY_MS);
|
|
41096
|
+
return () => clearTimeout(clearTimer);
|
|
41097
|
+
}, [message]);
|
|
41098
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("div", {
|
|
41099
|
+
ref: ref,
|
|
41100
|
+
role: role,
|
|
41101
|
+
"aria-live": "polite",
|
|
41102
|
+
"aria-relevant": "additions text",
|
|
41103
|
+
"aria-atomic": "true",
|
|
41104
|
+
id: id,
|
|
41105
|
+
className: "sr-only"
|
|
41106
|
+
}, displayed && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement("div", {
|
|
41107
|
+
key: displayed.id
|
|
41108
|
+
}, displayed.text));
|
|
41109
|
+
});
|
|
41110
|
+
SrOnlyLiveRegion.displayName = "SrOnlyLiveRegion";
|
|
41111
|
+
|
|
41112
|
+
/***/ },
|
|
41113
|
+
|
|
41114
|
+
/***/ 63813
|
|
41115
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
41116
|
+
|
|
41117
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
41118
|
+
/* harmony export */ a: () => (/* binding */ announceStatus),
|
|
41119
|
+
/* harmony export */ t: () => (/* binding */ StatusLiveRegion)
|
|
41120
|
+
/* harmony export */ });
|
|
41121
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
41122
|
+
/* harmony import */ var react_hot_toast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60799);
|
|
41123
|
+
/* harmony import */ var _SrOnlyLiveRegion__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65766);
|
|
41124
|
+
|
|
41125
|
+
|
|
41126
|
+
|
|
41127
|
+
|
|
41128
|
+
// Module-global on purpose: webchat renders a single widget instance per page,
|
|
41129
|
+
// so one listener set is sufficient. If multi-instance embedding ever becomes
|
|
41130
|
+
// a supported scenario, scope this through context instead — otherwise every
|
|
41131
|
+
// mounted instance would announce every other instance's statuses.
|
|
41132
|
+
|
|
41133
|
+
const statusListeners = new Set();
|
|
41134
|
+
let statusCounter = 0;
|
|
41135
|
+
|
|
41136
|
+
/**
|
|
41137
|
+
* Announces arbitrary status text (e.g. a screen change) through the
|
|
41138
|
+
* <StatusLiveRegion>. No-op while the region is not mounted (webchat closed).
|
|
41139
|
+
*/
|
|
41140
|
+
function announceStatus(text) {
|
|
41141
|
+
statusListeners.forEach(listener => listener(text));
|
|
41142
|
+
}
|
|
41143
|
+
|
|
41144
|
+
/**
|
|
41145
|
+
* Screen-reader status live region (WCAG 4.1.3 Status Messages), mounted for
|
|
41146
|
+
* the lifetime of the open chat window — so it exists in the DOM before
|
|
41147
|
+
* anything it announces (live regions only announce changes to nodes already
|
|
41148
|
+
* in the accessibility tree). Closing the webchat unmounts it: announcements
|
|
41149
|
+
* made while closed are dropped, and a persistent notification still visible
|
|
41150
|
+
* after reopening is announced again.
|
|
41151
|
+
*
|
|
41152
|
+
* Input sources:
|
|
41153
|
+
* - toast notifications: react-hot-toast adds the toast (and its
|
|
41154
|
+
* role="status" wrapper) to the DOM only when the notification fires,
|
|
41155
|
+
* which live-region processing ignores — so toasts are mirrored here and
|
|
41156
|
+
* silenced at the source (see silencedAriaProps in Notifications.tsx);
|
|
41157
|
+
* - direct announcements via announceStatus() (e.g. "home screen appeared").
|
|
41158
|
+
*/
|
|
41159
|
+
const StatusLiveRegion = () => {
|
|
41160
|
+
const {
|
|
41161
|
+
toasts
|
|
41162
|
+
} = (0,react_hot_toast__WEBPACK_IMPORTED_MODULE_1__/* .useToasterStore */ .Nk)();
|
|
41163
|
+
const announcedIdsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(new Set());
|
|
41164
|
+
const [status, setStatus] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
41165
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
41166
|
+
const listener = text => setStatus({
|
|
41167
|
+
id: `status-${++statusCounter}`,
|
|
41168
|
+
text
|
|
41169
|
+
});
|
|
41170
|
+
statusListeners.add(listener);
|
|
41171
|
+
return () => {
|
|
41172
|
+
statusListeners.delete(listener);
|
|
41173
|
+
};
|
|
41174
|
+
}, []);
|
|
41175
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
41176
|
+
// Forget ids that left the toast store so the set cannot grow unbounded
|
|
41177
|
+
const liveToastIds = new Set(toasts.map(t => t.id));
|
|
41178
|
+
announcedIdsRef.current.forEach(id => {
|
|
41179
|
+
if (!liveToastIds.has(id)) announcedIdsRef.current.delete(id);
|
|
41180
|
+
});
|
|
41181
|
+
const unannounced = toasts.filter(t => t.visible && !announcedIdsRef.current.has(t.id) && typeof t.message === "string");
|
|
41182
|
+
if (!unannounced.length) return;
|
|
41183
|
+
unannounced.forEach(t => announcedIdsRef.current.add(t.id));
|
|
41184
|
+
|
|
41185
|
+
// Announce the most recent notification when several land in one
|
|
41186
|
+
// render (CGY-34519). Compared by createdAt; on ties (same-millisecond
|
|
41187
|
+
// toasts — exactly the several-in-one-tick case) the reduce keeps the
|
|
41188
|
+
// earlier array element, which is the newest because react-hot-toast
|
|
41189
|
+
// prepends new toasts.
|
|
41190
|
+
const latest = unannounced.reduce((a, b) => b.createdAt > a.createdAt ? b : a);
|
|
41191
|
+
setStatus({
|
|
41192
|
+
id: latest.id,
|
|
41193
|
+
text: latest.message
|
|
41194
|
+
});
|
|
41195
|
+
}, [toasts]);
|
|
41196
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_SrOnlyLiveRegion__WEBPACK_IMPORTED_MODULE_2__/* .SrOnlyLiveRegion */ .Y, {
|
|
41197
|
+
id: "webchatStatusLiveRegion",
|
|
41198
|
+
role: "status",
|
|
41199
|
+
message: status
|
|
41200
|
+
});
|
|
41201
|
+
};
|
|
41202
|
+
|
|
41203
|
+
/***/ },
|
|
41204
|
+
|
|
42388
41205
|
/***/ 49888
|
|
42389
41206
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
42390
41207
|
|
|
@@ -43570,18 +42387,31 @@ const ConversationsListItem = props => {
|
|
|
43570
42387
|
};
|
|
43571
42388
|
const handleKeyDown = e => {
|
|
43572
42389
|
e.stopPropagation();
|
|
43573
|
-
if (e.key === "Enter") {
|
|
42390
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
42391
|
+
// Space must activate too (APG button pattern); prevent page scroll
|
|
42392
|
+
e.preventDefault();
|
|
43574
42393
|
handleClick();
|
|
43575
42394
|
}
|
|
43576
42395
|
};
|
|
43577
42396
|
const openConversationAriaLabel = config.settings.customTranslations?.ariaLabels?.openConversation ?? "Open conversation";
|
|
42397
|
+
const lastMessagePreview = (0,_helpers__WEBPACK_IMPORTED_MODULE_5__/* .getLastMessagePreview */ .Or)(messages);
|
|
42398
|
+
const relativeTime = (0,_helpers__WEBPACK_IMPORTED_MODULE_5__/* .getRelativeTime */ .gs)(messages);
|
|
42399
|
+
const participants = (0,_helpers__WEBPACK_IMPORTED_MODULE_5__/* .getParticipants */ .Ln)(messages, config);
|
|
42400
|
+
|
|
42401
|
+
// WCAG 2.5.3 Label in Name: the name must start with the visible preview text
|
|
42402
|
+
// (speech-input tools match from the start); timestamp and index keep names
|
|
42403
|
+
// unique when previews are identical. The budget must exceed what fits in the
|
|
42404
|
+
// preview's 290px max-width, so the name always contains the visible portion
|
|
42405
|
+
// while long messages don't flood the announcement.
|
|
42406
|
+
const namePreview = (0,_helpers__WEBPACK_IMPORTED_MODULE_5__/* .truncatePreviewForName */ .Xs)(lastMessagePreview);
|
|
42407
|
+
const itemAriaLabel = [namePreview, participants, relativeTime, `${openConversationAriaLabel} ${index + 1}`].filter(Boolean).join(", ");
|
|
43578
42408
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(ListItem, {
|
|
43579
42409
|
className: "webchat-prev-conversations-item",
|
|
43580
42410
|
onClick: handleClick,
|
|
43581
42411
|
onKeyDown: handleKeyDown,
|
|
43582
42412
|
tabIndex: 0,
|
|
43583
42413
|
role: "button",
|
|
43584
|
-
"aria-label":
|
|
42414
|
+
"aria-label": itemAriaLabel
|
|
43585
42415
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(Left, null, avatars.length > 0 ? avatars.map((avatar, i) => {
|
|
43586
42416
|
if (!avatar) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(FallBackAvatar, {
|
|
43587
42417
|
title: "Cognigy.AI Logo",
|
|
@@ -43599,12 +42429,12 @@ const ConversationsListItem = props => {
|
|
|
43599
42429
|
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(Center, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(CenterTitle, {
|
|
43600
42430
|
variant: "body-regular",
|
|
43601
42431
|
component: "div"
|
|
43602
|
-
},
|
|
42432
|
+
}, lastMessagePreview), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(CenterMeta, {
|
|
43603
42433
|
variant: "title2-regular",
|
|
43604
42434
|
component: "div"
|
|
43605
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(MetaNames, null,
|
|
42435
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(MetaNames, null, participants), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_assets_ellipsis_4px_svg__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(MetaTime, {
|
|
43606
42436
|
className: "webchat-prev-conversations-time"
|
|
43607
|
-
},
|
|
42437
|
+
}, relativeTime))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(Right, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__["default"].createElement(_assets_arrow_back_16px_svg__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A, {
|
|
43608
42438
|
className: "cc-rtl-flip-invert"
|
|
43609
42439
|
})));
|
|
43610
42440
|
};
|
|
@@ -43691,6 +42521,7 @@ const DeleteAllConversationsModal = props => {
|
|
|
43691
42521
|
/* harmony export */ Ln: () => (/* binding */ getParticipants),
|
|
43692
42522
|
/* harmony export */ N_: () => (/* binding */ sortConversationsByFreshness),
|
|
43693
42523
|
/* harmony export */ Or: () => (/* binding */ getLastMessagePreview),
|
|
42524
|
+
/* harmony export */ Xs: () => (/* binding */ truncatePreviewForName),
|
|
43694
42525
|
/* harmony export */ gs: () => (/* binding */ getRelativeTime)
|
|
43695
42526
|
/* harmony export */ });
|
|
43696
42527
|
/* harmony import */ var _webchat_helper_message__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31963);
|
|
@@ -43791,6 +42622,25 @@ const getLastMessagePreview = messages => {
|
|
|
43791
42622
|
return "...";
|
|
43792
42623
|
}
|
|
43793
42624
|
};
|
|
42625
|
+
|
|
42626
|
+
/**
|
|
42627
|
+
* Caps the preview text used in a list item's accessible name (WCAG 2.5.3).
|
|
42628
|
+
* The visible preview is CSS-truncated at 290px (~35-45 chars), so an 80-char
|
|
42629
|
+
* budget keeps the name a superset of the visible text while preventing very
|
|
42630
|
+
* long messages from flooding screen-reader announcements. Cuts at a word
|
|
42631
|
+
* boundary where possible.
|
|
42632
|
+
*/
|
|
42633
|
+
const truncatePreviewForName = (preview, maxLength = 80) => {
|
|
42634
|
+
// React renders an array of strings with no separator, so join with ""
|
|
42635
|
+
// to keep the name identical to the visible text (SC 2.5.3)
|
|
42636
|
+
const text = Array.isArray(preview) ? preview.join("") : preview;
|
|
42637
|
+
if (text.length <= maxLength) return text;
|
|
42638
|
+
const clipped = text.slice(0, maxLength);
|
|
42639
|
+
const lastSpace = clipped.lastIndexOf(" ");
|
|
42640
|
+
// Only respect the word boundary if it doesn't cut away most of the budget
|
|
42641
|
+
const cutAt = lastSpace > maxLength / 2 ? lastSpace : maxLength;
|
|
42642
|
+
return `${clipped.slice(0, cutAt).trimEnd()}…`;
|
|
42643
|
+
};
|
|
43794
42644
|
const getParticipants = (messages, config) => {
|
|
43795
42645
|
const partecipants = [];
|
|
43796
42646
|
const hasBot = messages.some(message => ["bot", "engagement"].includes(message?.source));
|
|
@@ -43987,7 +42837,11 @@ const createWebchatTheme = (theme = {}) => {
|
|
|
43987
42837
|
const white = "#FFFFFF";
|
|
43988
42838
|
const textDark = black10;
|
|
43989
42839
|
const textLight = white;
|
|
43990
|
-
|
|
42840
|
+
|
|
42841
|
+
// Notification/status text color on the green10 background.
|
|
42842
|
+
// #009918 on #E5F5E8 was only 3.33:1 — below the WCAG AA 4.5:1 text floor.
|
|
42843
|
+
// #007313 keeps the same green hue and reaches ~5.4:1 (CGY-4035).
|
|
42844
|
+
const green = "#007313";
|
|
43991
42845
|
const green10 = "#E5F5E8";
|
|
43992
42846
|
const red = "#FF0000";
|
|
43993
42847
|
const red10 = "#FFE5E5";
|
|
@@ -44060,6 +42914,96 @@ const createWebchatTheme = (theme = {}) => {
|
|
|
44060
42914
|
|
|
44061
42915
|
/***/ },
|
|
44062
42916
|
|
|
42917
|
+
/***/ 39191
|
|
42918
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
42919
|
+
|
|
42920
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
42921
|
+
/* harmony export */ Kr: () => (/* binding */ computeNoticeSession),
|
|
42922
|
+
/* harmony export */ S5: () => (/* binding */ DEFAULT_AI_AGENT_NOTICE_TEXT),
|
|
42923
|
+
/* harmony export */ bu: () => (/* binding */ getAIAgentNoticeIntroText),
|
|
42924
|
+
/* harmony export */ j_: () => (/* binding */ INITIAL_NOTICE_SESSION)
|
|
42925
|
+
/* harmony export */ });
|
|
42926
|
+
const DEFAULT_AI_AGENT_NOTICE_TEXT = "You're now chatting with an AI Agent.";
|
|
42927
|
+
|
|
42928
|
+
/**
|
|
42929
|
+
* Whether the current session started as a brand-new conversation rather
|
|
42930
|
+
* than a previous conversation reopened from the conversations list —
|
|
42931
|
+
* gates the AI-agent notice announcement (CGY-3519).
|
|
42932
|
+
* `id` guards against renders where `currentSession` has already changed
|
|
42933
|
+
* but this state hasn't been re-evaluated yet (the session id updates
|
|
42934
|
+
* asynchronously after the socket switch). `announceKey` dedupes the
|
|
42935
|
+
* announcement per conversation; it differs from `id` only for the page
|
|
42936
|
+
* load's first conversation, which starts announceable before the connect
|
|
42937
|
+
* assigns its session id (see computeNoticeSession).
|
|
42938
|
+
*/
|
|
42939
|
+
|
|
42940
|
+
// Inactive until the session is evaluated on mount / session change.
|
|
42941
|
+
const INITIAL_NOTICE_SESSION = {
|
|
42942
|
+
id: "",
|
|
42943
|
+
isNew: false,
|
|
42944
|
+
announceKey: ""
|
|
42945
|
+
};
|
|
42946
|
+
|
|
42947
|
+
/**
|
|
42948
|
+
* (Re-)evaluate whether the current session is a brand-new conversation.
|
|
42949
|
+
* `prevConversationsSnapshot` must predate the session change: sessions
|
|
42950
|
+
* get upserted into prevConversations as soon as a message is sent or
|
|
42951
|
+
* received (e.g. auto-inject, in the same update batch as the session
|
|
42952
|
+
* switch), so the current map may already contain a genuinely new
|
|
42953
|
+
* session. A session found in the snapshot is a reopened previous
|
|
42954
|
+
* conversation (or a restored one after a reload) — not announced.
|
|
42955
|
+
*
|
|
42956
|
+
* The page load's first conversation exists on screen before the socket
|
|
42957
|
+
* connect assigns its session id (`currentSessionId` is "" until then).
|
|
42958
|
+
* That id arriving is not a new conversation, so the announcement key
|
|
42959
|
+
* is kept — a notice already announced (or pending) under the "" key is
|
|
42960
|
+
* not repeated under the id.
|
|
42961
|
+
*
|
|
42962
|
+
* `hasRestoredPersistedHistory` covers the page reload of a persisted
|
|
42963
|
+
* conversation: the restored session IS in the conversations map, but
|
|
42964
|
+
* that map is filled in the same React commit as the session id, so the
|
|
42965
|
+
* pre-change snapshot is still empty and the lookup alone would call the
|
|
42966
|
+
* session brand-new. The flag (set only when RESET_STATE restores a
|
|
42967
|
+
* non-empty history) is consulted for the page load's first connect
|
|
42968
|
+
* only — later restores (reopening a previous conversation) are already
|
|
42969
|
+
* covered by the snapshot lookup, and the flag must not silence a
|
|
42970
|
+
* brand-new conversation started afterwards.
|
|
42971
|
+
*/
|
|
42972
|
+
function computeNoticeSession(prev, currentSessionId, prevConversationsSnapshot, hasRestoredPersistedHistory) {
|
|
42973
|
+
const isRestoredFirstConnect = prev.id === "" && !!hasRestoredPersistedHistory;
|
|
42974
|
+
const isNew = !prevConversationsSnapshot?.[currentSessionId] && !isRestoredFirstConnect;
|
|
42975
|
+
const isFirstConnectOfNewConversation = prev.id === "" && prev.isNew && isNew;
|
|
42976
|
+
return {
|
|
42977
|
+
id: currentSessionId,
|
|
42978
|
+
isNew,
|
|
42979
|
+
announceKey: isFirstConnectOfNewConversation ? prev.announceKey : currentSessionId
|
|
42980
|
+
};
|
|
42981
|
+
}
|
|
42982
|
+
|
|
42983
|
+
/**
|
|
42984
|
+
* The AI-agent notice text to announce through the chat log's live
|
|
42985
|
+
* region, or undefined when nothing should be announced. Announced once
|
|
42986
|
+
* per brand-new session (reopened previous conversations stay silent)
|
|
42987
|
+
* and held while the disconnect overlay is open (session switches
|
|
42988
|
+
* reconnect the socket and open it — its dialog and focus utterances
|
|
42989
|
+
* would cancel the notice; on close, the intro becomes pending again
|
|
42990
|
+
* and is announced after the "Connection restored" utterances).
|
|
42991
|
+
*/
|
|
42992
|
+
function getAIAgentNoticeIntroText(args) {
|
|
42993
|
+
const {
|
|
42994
|
+
behavior,
|
|
42995
|
+
showDisconnectOverlay,
|
|
42996
|
+
noticeSession,
|
|
42997
|
+
currentSessionId,
|
|
42998
|
+
announcedKeys
|
|
42999
|
+
} = args;
|
|
43000
|
+
const shouldAnnounce = behavior.enableAIAgentNotice !== false && !showDisconnectOverlay && noticeSession.isNew && noticeSession.id === currentSessionId && !announcedKeys.has(noticeSession.announceKey);
|
|
43001
|
+
if (!shouldAnnounce) return undefined;
|
|
43002
|
+
return behavior.AIAgentNoticeText || DEFAULT_AI_AGENT_NOTICE_TEXT;
|
|
43003
|
+
}
|
|
43004
|
+
|
|
43005
|
+
/***/ },
|
|
43006
|
+
|
|
44063
43007
|
/***/ 34699
|
|
44064
43008
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
44065
43009
|
|
|
@@ -44175,8 +43119,15 @@ const getKeyboardFocusableElements = element => {
|
|
|
44175
43119
|
const interactiveEls = element?.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])');
|
|
44176
43120
|
const interactiveElsArray = interactiveEls && Array.from(interactiveEls);
|
|
44177
43121
|
|
|
44178
|
-
// Filter
|
|
44179
|
-
|
|
43122
|
+
// Filter out interactive elements that are disabled, aria-hidden, or inside
|
|
43123
|
+
// an inert subtree (e.g. the chat layout behind the disconnect overlay, or
|
|
43124
|
+
// a leaving screen during its exit transition — see
|
|
43125
|
+
// RegularLayoutContentWrapper in WebchatUI.tsx) — those cannot receive
|
|
43126
|
+
// focus. Matching aria-hidden="true" explicitly (not attribute presence)
|
|
43127
|
+
// keeps elements with aria-hidden="false" focusable. Ancestor aria-hidden
|
|
43128
|
+
// is deliberately NOT filtered: the HomeScreen show/hide pattern queries
|
|
43129
|
+
// focusables inside its aria-hidden root to toggle their tabindex.
|
|
43130
|
+
const focusable = interactiveElsArray?.filter(el => !el.hasAttribute("disabled") && el.getAttribute("aria-hidden") !== "true" && !el.closest("[inert]"));
|
|
44180
43131
|
const firstFocusable = focusable && focusable[0];
|
|
44181
43132
|
const lastFocusable = focusable && focusable[focusable.length - 1];
|
|
44182
43133
|
return {
|
|
@@ -44383,6 +43334,40 @@ const notificationSound = new uifx__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
44383
43334
|
|
|
44384
43335
|
/***/ },
|
|
44385
43336
|
|
|
43337
|
+
/***/ 48245
|
|
43338
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
43339
|
+
|
|
43340
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
43341
|
+
/* harmony export */ p: () => (/* binding */ getScreenVisibility)
|
|
43342
|
+
/* harmony export */ });
|
|
43343
|
+
/**
|
|
43344
|
+
* Which primary view the open chat window shows. Single source for the
|
|
43345
|
+
* screen announcers and renderRegularLayout's layout decisions in
|
|
43346
|
+
* WebchatUI — the chat screen is the fallback when no other screen claims
|
|
43347
|
+
* the view. (`showInformationMessage` in renderRegularLayout is truthy
|
|
43348
|
+
* iff `isInforming`: every inform branch has fallback text.)
|
|
43349
|
+
*/
|
|
43350
|
+
function getScreenVisibility(props, isInforming) {
|
|
43351
|
+
const {
|
|
43352
|
+
config,
|
|
43353
|
+
showHomeScreen,
|
|
43354
|
+
showChatOptionsScreen,
|
|
43355
|
+
showRatingScreen,
|
|
43356
|
+
showPrevConversations,
|
|
43357
|
+
hasAcceptedTerms
|
|
43358
|
+
} = props;
|
|
43359
|
+
const showEnabledHomeScreen = !!(config.settings.homeScreen.enabled && showHomeScreen);
|
|
43360
|
+
const showHomeScreenView = showEnabledHomeScreen && !isInforming;
|
|
43361
|
+
const showChatScreen = !isInforming && !showEnabledHomeScreen && !showChatOptionsScreen && !showRatingScreen && !showPrevConversations && (hasAcceptedTerms || !config.settings.privacyNotice.enabled);
|
|
43362
|
+
return {
|
|
43363
|
+
showEnabledHomeScreen,
|
|
43364
|
+
showHomeScreenView,
|
|
43365
|
+
showChatScreen
|
|
43366
|
+
};
|
|
43367
|
+
}
|
|
43368
|
+
|
|
43369
|
+
/***/ },
|
|
43370
|
+
|
|
44386
43371
|
/***/ 81439
|
|
44387
43372
|
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
44388
43373
|
|
|
@@ -44494,12 +43479,14 @@ const ConnectedWebchatUI = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__/* .connec
|
|
|
44494
43479
|
const {
|
|
44495
43480
|
messages: {
|
|
44496
43481
|
messageHistory: messages,
|
|
44497
|
-
visibleOutputMessages
|
|
43482
|
+
visibleOutputMessages,
|
|
43483
|
+
hasRestoredPersistedHistory
|
|
44498
43484
|
},
|
|
44499
43485
|
unseenMessages,
|
|
44500
43486
|
prevConversations,
|
|
44501
43487
|
connection: {
|
|
44502
43488
|
connected,
|
|
43489
|
+
connecting,
|
|
44503
43490
|
reconnectionLimit
|
|
44504
43491
|
},
|
|
44505
43492
|
ui: {
|
|
@@ -44545,12 +43532,14 @@ const ConnectedWebchatUI = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__/* .connec
|
|
|
44545
43532
|
visibleOutputMessages,
|
|
44546
43533
|
unseenMessages,
|
|
44547
43534
|
prevConversations,
|
|
43535
|
+
hasRestoredPersistedHistory,
|
|
44548
43536
|
open,
|
|
44549
43537
|
typingIndicator: typing,
|
|
44550
43538
|
inputMode,
|
|
44551
43539
|
fullscreenMessage,
|
|
44552
43540
|
config,
|
|
44553
43541
|
connected,
|
|
43542
|
+
connecting,
|
|
44554
43543
|
reconnectionLimit,
|
|
44555
43544
|
showRatingScreen,
|
|
44556
43545
|
hasGivenRating,
|
|
@@ -46833,7 +45822,8 @@ const createMessageMiddleware = client => store => next => action => {
|
|
|
46833
45822
|
const initialState = {
|
|
46834
45823
|
messageHistory: [],
|
|
46835
45824
|
visibleOutputMessages: [],
|
|
46836
|
-
currentlyAnimatingId: null
|
|
45825
|
+
currentlyAnimatingId: null,
|
|
45826
|
+
hasRestoredPersistedHistory: false
|
|
46837
45827
|
};
|
|
46838
45828
|
const ADD_MESSAGE = "ADD_MESSAGE";
|
|
46839
45829
|
const addMessage = (message, unseen) => ({
|
|
@@ -47672,7 +46662,8 @@ const reducer = (state = rootReducer(undefined, {
|
|
|
47672
46662
|
...state,
|
|
47673
46663
|
messages: {
|
|
47674
46664
|
messageHistory: [...restoredMessages, ...state.messages.messageHistory],
|
|
47675
|
-
visibleOutputMessages: restoredVisibleOutputMessages
|
|
46665
|
+
visibleOutputMessages: restoredVisibleOutputMessages,
|
|
46666
|
+
hasRestoredPersistedHistory: state.messages.hasRestoredPersistedHistory || restoredMessages.length > 0
|
|
47676
46667
|
},
|
|
47677
46668
|
rating: {
|
|
47678
46669
|
...state.rating,
|
|
@@ -49155,9 +48146,13 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_react__;
|
|
|
49155
48146
|
/***/ },
|
|
49156
48147
|
|
|
49157
48148
|
/***/ 7516
|
|
49158
|
-
(module) {
|
|
48149
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
49159
48150
|
|
|
49160
|
-
|
|
48151
|
+
var x = (y) => {
|
|
48152
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
48153
|
+
}
|
|
48154
|
+
var y = (x) => (() => (x))
|
|
48155
|
+
module.exports = x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_react_dom_7dac9eee__["default"]), ["flushSync"]: () => (__WEBPACK_EXTERNAL_MODULE_react_dom_7dac9eee__.flushSync), ["unstable_batchedUpdates"]: () => (__WEBPACK_EXTERNAL_MODULE_react_dom_7dac9eee__.unstable_batchedUpdates) });
|
|
49161
48156
|
|
|
49162
48157
|
/***/ },
|
|
49163
48158
|
|
|
@@ -140557,16 +139552,29 @@ class Axios {
|
|
|
140557
139552
|
const onFulfilled = requestInterceptorChain[i++];
|
|
140558
139553
|
const onRejected = requestInterceptorChain[i++];
|
|
140559
139554
|
try {
|
|
140560
|
-
newConfig = onFulfilled(newConfig);
|
|
139555
|
+
newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig;
|
|
140561
139556
|
} catch (error) {
|
|
140562
|
-
onRejected
|
|
139557
|
+
if (!onRejected) {
|
|
139558
|
+
promise = Promise.reject(error);
|
|
139559
|
+
break;
|
|
139560
|
+
}
|
|
139561
|
+
try {
|
|
139562
|
+
const rejectedResult = onRejected.call(this, error);
|
|
139563
|
+
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isThenable(rejectedResult)) {
|
|
139564
|
+
promise = Promise.resolve(rejectedResult).then(() => _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.call(this, newConfig));
|
|
139565
|
+
}
|
|
139566
|
+
} catch (rejectedError) {
|
|
139567
|
+
promise = Promise.reject(rejectedError);
|
|
139568
|
+
}
|
|
140563
139569
|
break;
|
|
140564
139570
|
}
|
|
140565
139571
|
}
|
|
140566
|
-
|
|
140567
|
-
|
|
140568
|
-
|
|
140569
|
-
|
|
139572
|
+
if (!promise) {
|
|
139573
|
+
try {
|
|
139574
|
+
promise = _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A.call(this, newConfig);
|
|
139575
|
+
} catch (error) {
|
|
139576
|
+
promise = Promise.reject(error);
|
|
139577
|
+
}
|
|
140570
139578
|
}
|
|
140571
139579
|
i = 0;
|
|
140572
139580
|
len = responseInterceptorChain.length;
|
|
@@ -140622,7 +139630,8 @@ _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach(['post', 'put
|
|
|
140622
139630
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
140623
139631
|
|
|
140624
139632
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
140625
|
-
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
139633
|
+
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
139634
|
+
/* harmony export */ X: () => (/* binding */ REDACTED)
|
|
140626
139635
|
/* harmony export */ });
|
|
140627
139636
|
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21285);
|
|
140628
139637
|
/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88580);
|
|
@@ -140686,9 +139695,33 @@ function redactConfig(config, redactKeys) {
|
|
|
140686
139695
|
};
|
|
140687
139696
|
return visit(config);
|
|
140688
139697
|
}
|
|
139698
|
+
function stringifySafely(value) {
|
|
139699
|
+
try {
|
|
139700
|
+
return String(value);
|
|
139701
|
+
} catch (err) {
|
|
139702
|
+
return '';
|
|
139703
|
+
}
|
|
139704
|
+
}
|
|
139705
|
+
function aggregateErrorMessage(error) {
|
|
139706
|
+
const message = error.errors.map(entry => {
|
|
139707
|
+
try {
|
|
139708
|
+
return entry && entry.message ? stringifySafely(entry.message) : stringifySafely(entry);
|
|
139709
|
+
} catch (err) {
|
|
139710
|
+
return '';
|
|
139711
|
+
}
|
|
139712
|
+
}).filter(Boolean).join('; ');
|
|
139713
|
+
return message || error.name || 'AggregateError';
|
|
139714
|
+
}
|
|
140689
139715
|
class AxiosError extends Error {
|
|
140690
139716
|
static from(error, code, config, request, response, customProps) {
|
|
140691
|
-
|
|
139717
|
+
// `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection
|
|
139718
|
+
// failures) has an empty `message`; its detail lives in `errors[]`. Without
|
|
139719
|
+
// this, the wrapped error surfaces with a blank message (see #6721).
|
|
139720
|
+
let message = error.message;
|
|
139721
|
+
if (!message && _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isArray(error.errors) && error.errors.length) {
|
|
139722
|
+
message = aggregateErrorMessage(error);
|
|
139723
|
+
}
|
|
139724
|
+
const axiosError = new AxiosError(message, code || error.code, config, request, response);
|
|
140692
139725
|
// Match native `Error` `cause` semantics: non-enumerable. The wrapped
|
|
140693
139726
|
// error often carries circular internals (sockets, requests, agents), so
|
|
140694
139727
|
// an enumerable `cause` makes structured loggers (pino/winston) and any
|
|
@@ -140828,6 +139861,90 @@ function parseTokens(str) {
|
|
|
140828
139861
|
}
|
|
140829
139862
|
return tokens;
|
|
140830
139863
|
}
|
|
139864
|
+
const parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
139865
|
+
function trimOWS(value) {
|
|
139866
|
+
let start = 0;
|
|
139867
|
+
let end = value.length;
|
|
139868
|
+
while (start < end) {
|
|
139869
|
+
const code = value.charCodeAt(start);
|
|
139870
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
139871
|
+
break;
|
|
139872
|
+
}
|
|
139873
|
+
start += 1;
|
|
139874
|
+
}
|
|
139875
|
+
while (end > start) {
|
|
139876
|
+
const code = value.charCodeAt(end - 1);
|
|
139877
|
+
if (code !== 0x09 && code !== 0x20) {
|
|
139878
|
+
break;
|
|
139879
|
+
}
|
|
139880
|
+
end -= 1;
|
|
139881
|
+
}
|
|
139882
|
+
return start === 0 && end === value.length ? value : value.slice(start, end);
|
|
139883
|
+
}
|
|
139884
|
+
function decodeQuotedString(value) {
|
|
139885
|
+
const last = value.length - 1;
|
|
139886
|
+
if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) {
|
|
139887
|
+
return value;
|
|
139888
|
+
}
|
|
139889
|
+
let decoded = '';
|
|
139890
|
+
for (let i = 1; i < last; i++) {
|
|
139891
|
+
const code = value.charCodeAt(i);
|
|
139892
|
+
if (code === 0x22) {
|
|
139893
|
+
return value;
|
|
139894
|
+
}
|
|
139895
|
+
if (code === 0x5c) {
|
|
139896
|
+
i += 1;
|
|
139897
|
+
if (i >= last) {
|
|
139898
|
+
return value;
|
|
139899
|
+
}
|
|
139900
|
+
}
|
|
139901
|
+
decoded += value[i];
|
|
139902
|
+
}
|
|
139903
|
+
return decoded;
|
|
139904
|
+
}
|
|
139905
|
+
function parseParameters(value) {
|
|
139906
|
+
const parameters = Object.create(null);
|
|
139907
|
+
const str = String(value);
|
|
139908
|
+
let start = 0;
|
|
139909
|
+
let quoted = false;
|
|
139910
|
+
let escaped = false;
|
|
139911
|
+
function parseParameter(end) {
|
|
139912
|
+
const part = trimOWS(str.slice(start, end));
|
|
139913
|
+
const equals = part.indexOf('=');
|
|
139914
|
+
if (equals < 1) {
|
|
139915
|
+
return;
|
|
139916
|
+
}
|
|
139917
|
+
const name = trimOWS(part.slice(0, equals));
|
|
139918
|
+
if (!parameterNameRE.test(name)) {
|
|
139919
|
+
return;
|
|
139920
|
+
}
|
|
139921
|
+
const normalizedName = name.toLowerCase();
|
|
139922
|
+
if (normalizedName === '__proto__' || normalizedName === 'constructor' || normalizedName === 'prototype') {
|
|
139923
|
+
return;
|
|
139924
|
+
}
|
|
139925
|
+
const parameterValue = trimOWS(part.slice(equals + 1));
|
|
139926
|
+
parameters[normalizedName] = decodeQuotedString(parameterValue);
|
|
139927
|
+
}
|
|
139928
|
+
for (let i = 0; i < str.length; i++) {
|
|
139929
|
+
const code = str.charCodeAt(i);
|
|
139930
|
+
if (quoted) {
|
|
139931
|
+
if (escaped) {
|
|
139932
|
+
escaped = false;
|
|
139933
|
+
} else if (code === 0x5c) {
|
|
139934
|
+
escaped = true;
|
|
139935
|
+
} else if (code === 0x22) {
|
|
139936
|
+
quoted = false;
|
|
139937
|
+
}
|
|
139938
|
+
} else if (code === 0x22) {
|
|
139939
|
+
quoted = true;
|
|
139940
|
+
} else if (code === 0x2c || code === 0x3b) {
|
|
139941
|
+
parseParameter(i);
|
|
139942
|
+
start = i + 1;
|
|
139943
|
+
}
|
|
139944
|
+
}
|
|
139945
|
+
parseParameter(str.length);
|
|
139946
|
+
return parameters;
|
|
139947
|
+
}
|
|
140831
139948
|
const isValidHeaderName = str => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
140832
139949
|
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
140833
139950
|
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isFunction(filter)) {
|
|
@@ -141005,7 +140122,8 @@ class AxiosHeaders {
|
|
|
141005
140122
|
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
|
|
141006
140123
|
}
|
|
141007
140124
|
getSetCookie() {
|
|
141008
|
-
|
|
140125
|
+
const value = this.get('set-cookie');
|
|
140126
|
+
return _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.isArray(value) ? value : value == null || value === false ? [] : [value];
|
|
141009
140127
|
}
|
|
141010
140128
|
get [Symbol.toStringTag]() {
|
|
141011
140129
|
return 'AxiosHeaders';
|
|
@@ -141013,6 +140131,9 @@ class AxiosHeaders {
|
|
|
141013
140131
|
static from(thing) {
|
|
141014
140132
|
return thing instanceof this ? thing : new this(thing);
|
|
141015
140133
|
}
|
|
140134
|
+
static parseParameters(value) {
|
|
140135
|
+
return parseParameters(value);
|
|
140136
|
+
}
|
|
141016
140137
|
static concat(first, ...targets) {
|
|
141017
140138
|
const computed = new this(first);
|
|
141018
140139
|
targets.forEach(target => computed.set(target));
|
|
@@ -141160,9 +140281,39 @@ function stripLeadingC0ControlOrSpace(url) {
|
|
|
141160
140281
|
function normalizeURLForProtocolCheck(url) {
|
|
141161
140282
|
return stripLeadingC0ControlOrSpace(url).replace(httpProtocolControlCharacters, '');
|
|
141162
140283
|
}
|
|
140284
|
+
|
|
140285
|
+
// Redact the parts of a URL that can carry secrets before it is embedded in an
|
|
140286
|
+
// error message. AxiosError.toJSON() serializes `message` verbatim and errors
|
|
140287
|
+
// are commonly logged, while the opt-in `config.redact` model only cleans
|
|
140288
|
+
// config keys — it cannot reach the message. Redact only the genuinely
|
|
140289
|
+
// sensitive substrings — userinfo (credentials), query parameter values and
|
|
140290
|
+
// fragment contents — with the same REDACTED marker the config redaction uses,
|
|
140291
|
+
// while keeping the scheme, host, path and parameter names so the offending
|
|
140292
|
+
// request stays accurately identifiable.
|
|
140293
|
+
function redactFragment(fragment) {
|
|
140294
|
+
if (!fragment) {
|
|
140295
|
+
return fragment;
|
|
140296
|
+
}
|
|
140297
|
+
return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = '') => {
|
|
140298
|
+
return `${separator}${parameterName}${_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__/* .REDACTED */ .X}`;
|
|
140299
|
+
});
|
|
140300
|
+
}
|
|
140301
|
+
function redactSensitiveURLParts(url) {
|
|
140302
|
+
const redactedURL = url.replace(/^(https?:\/{0,2})[^/?#]*@/i, `$1${_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__/* .REDACTED */ .X}@`);
|
|
140303
|
+
const fragmentIndex = redactedURL.indexOf('#');
|
|
140304
|
+
const urlWithoutFragment = fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex);
|
|
140305
|
+
const redactedURLWithoutFragment = urlWithoutFragment.replace(/([?&][^=&#]*=)[^&#]*/g, `$1${_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__/* .REDACTED */ .X}`);
|
|
140306
|
+
if (fragmentIndex === -1) {
|
|
140307
|
+
return redactedURLWithoutFragment;
|
|
140308
|
+
}
|
|
140309
|
+
return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`;
|
|
140310
|
+
}
|
|
141163
140311
|
function assertValidHttpProtocolURL(url, config) {
|
|
141164
|
-
if (typeof url === 'string'
|
|
141165
|
-
|
|
140312
|
+
if (typeof url === 'string') {
|
|
140313
|
+
const normalizedURL = normalizeURLForProtocolCheck(url);
|
|
140314
|
+
if (malformedHttpProtocol.test(normalizedURL)) {
|
|
140315
|
+
throw new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A(`Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.ERR_INVALID_URL, config);
|
|
140316
|
+
}
|
|
141166
140317
|
}
|
|
141167
140318
|
}
|
|
141168
140319
|
|
|
@@ -141292,6 +140443,12 @@ function dispatchRequest(config) {
|
|
|
141292
140443
|
const headersToObject = thing => thing instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A ? {
|
|
141293
140444
|
...thing
|
|
141294
140445
|
} : thing;
|
|
140446
|
+
const ownEnumerableKeys = thing => {
|
|
140447
|
+
if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
|
|
140448
|
+
return Object.keys(thing).concat(Object.getOwnPropertySymbols(thing).filter(symbol => Object.getOwnPropertyDescriptor(thing, symbol).enumerable));
|
|
140449
|
+
}
|
|
140450
|
+
return Object.keys(thing);
|
|
140451
|
+
};
|
|
141295
140452
|
|
|
141296
140453
|
/**
|
|
141297
140454
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -141414,7 +140571,7 @@ function mergeConfig(config1, config2) {
|
|
|
141414
140571
|
validateStatus: mergeDirectKeys,
|
|
141415
140572
|
headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
|
|
141416
140573
|
};
|
|
141417
|
-
_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach(
|
|
140574
|
+
_utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach(ownEnumerableKeys({
|
|
141418
140575
|
...config1,
|
|
141419
140576
|
...config2
|
|
141420
140577
|
}), function computeConfigValue(prop) {
|
|
@@ -141437,6 +140594,41 @@ function mergeConfig(config1, config2) {
|
|
|
141437
140594
|
|
|
141438
140595
|
/***/ },
|
|
141439
140596
|
|
|
140597
|
+
/***/ 19524
|
|
140598
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
140599
|
+
|
|
140600
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
140601
|
+
/* harmony export */ A: () => (/* binding */ setFormDataHeaders)
|
|
140602
|
+
/* harmony export */ });
|
|
140603
|
+
|
|
140604
|
+
|
|
140605
|
+
const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
|
|
140606
|
+
|
|
140607
|
+
/**
|
|
140608
|
+
* Apply the headers generated by a FormData implementation to the request headers,
|
|
140609
|
+
* honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the
|
|
140610
|
+
* content-* headers; otherwise merge all of them.
|
|
140611
|
+
*
|
|
140612
|
+
* @param {AxiosHeaders} headers - the request headers to mutate
|
|
140613
|
+
* @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation
|
|
140614
|
+
* @param {String} [policy] - the resolved `formDataHeaderPolicy` config value
|
|
140615
|
+
*
|
|
140616
|
+
* @returns {void}
|
|
140617
|
+
*/
|
|
140618
|
+
function setFormDataHeaders(headers, formHeaders, policy) {
|
|
140619
|
+
if (policy !== 'content-only') {
|
|
140620
|
+
headers.set(formHeaders);
|
|
140621
|
+
return;
|
|
140622
|
+
}
|
|
140623
|
+
Object.entries(formHeaders || {}).forEach(([key, val]) => {
|
|
140624
|
+
if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
|
|
140625
|
+
headers.set(key, val);
|
|
140626
|
+
}
|
|
140627
|
+
});
|
|
140628
|
+
}
|
|
140629
|
+
|
|
140630
|
+
/***/ },
|
|
140631
|
+
|
|
141440
140632
|
/***/ 19783
|
|
141441
140633
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
141442
140634
|
|
|
@@ -141675,7 +140867,7 @@ _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.forEach(['delete', 'g
|
|
|
141675
140867
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
141676
140868
|
/* harmony export */ x: () => (/* binding */ VERSION)
|
|
141677
140869
|
/* harmony export */ });
|
|
141678
|
-
const VERSION = "1.
|
|
140870
|
+
const VERSION = "1.19.0";
|
|
141679
140871
|
|
|
141680
140872
|
/***/ },
|
|
141681
140873
|
|
|
@@ -141808,6 +141000,7 @@ const HttpStatusCode = {
|
|
|
141808
141000
|
LoopDetected: 508,
|
|
141809
141001
|
NotExtended: 510,
|
|
141810
141002
|
NetworkAuthenticationRequired: 511,
|
|
141003
|
+
WebServerReturnsAnUnknownError: 520,
|
|
141811
141004
|
WebServerIsDown: 521,
|
|
141812
141005
|
ConnectionTimedOut: 522,
|
|
141813
141006
|
OriginIsUnreachable: 523,
|
|
@@ -141929,7 +141122,14 @@ function buildURL(url, params, options) {
|
|
|
141929
141122
|
* @returns {string} The combined URL
|
|
141930
141123
|
*/
|
|
141931
141124
|
function combineURLs(baseURL, relativeURL) {
|
|
141932
|
-
|
|
141125
|
+
if (!relativeURL) {
|
|
141126
|
+
return baseURL;
|
|
141127
|
+
}
|
|
141128
|
+
let end = baseURL.length;
|
|
141129
|
+
while (end > 0 && baseURL.charCodeAt(end - 1) === 47) {
|
|
141130
|
+
end--;
|
|
141131
|
+
}
|
|
141132
|
+
return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\/+/, '');
|
|
141933
141133
|
}
|
|
141934
141134
|
|
|
141935
141135
|
/***/ },
|
|
@@ -141976,9 +141176,18 @@ const composeSignals = (signals, timeout) => {
|
|
|
141976
141176
|
});
|
|
141977
141177
|
signals = null;
|
|
141978
141178
|
};
|
|
141979
|
-
signals.forEach(signal =>
|
|
141980
|
-
|
|
141981
|
-
|
|
141179
|
+
signals.forEach(signal => {
|
|
141180
|
+
if (aborted) {
|
|
141181
|
+
return;
|
|
141182
|
+
}
|
|
141183
|
+
if (signal.aborted) {
|
|
141184
|
+
onabort.call(signal);
|
|
141185
|
+
return;
|
|
141186
|
+
}
|
|
141187
|
+
signal.addEventListener('abort', onabort, {
|
|
141188
|
+
once: true
|
|
141189
|
+
});
|
|
141190
|
+
});
|
|
141982
141191
|
const {
|
|
141983
141192
|
signal
|
|
141984
141193
|
} = controller;
|
|
@@ -142064,18 +141273,84 @@ const composeSignals = (signals, timeout) => {
|
|
|
142064
141273
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
142065
141274
|
/* harmony export */ A: () => (/* binding */ estimateDataURLDecodedBytes)
|
|
142066
141275
|
/* harmony export */ });
|
|
141276
|
+
/* unused harmony export estimateDataURLBufferAllocation */
|
|
142067
141277
|
/**
|
|
142068
|
-
* Estimate
|
|
142069
|
-
* -
|
|
142070
|
-
*
|
|
142071
|
-
*
|
|
142072
|
-
*
|
|
142073
|
-
* @param {string} url
|
|
142074
|
-
* @returns {number}
|
|
141278
|
+
* Estimate data: URL byte lengths *without* allocating large buffers.
|
|
141279
|
+
* - Fetch percent-decodes a base64 body before decoding it.
|
|
141280
|
+
* - Node's Buffer.from(body, 'base64') sizes its backing allocation from the
|
|
141281
|
+
* raw body, including ignored characters and content after padding.
|
|
141282
|
+
* - Non-base64 data is percent-decoded and then encoded as UTF-8.
|
|
142075
141283
|
*/
|
|
142076
141284
|
const isHexDigit = charCode => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102;
|
|
142077
141285
|
const isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));
|
|
142078
|
-
|
|
141286
|
+
const hexValue = charCode => charCode <= 57 ? charCode - 48 : (charCode & 0xdf) - 55;
|
|
141287
|
+
const isBase64Char = charCode => charCode >= 65 && charCode <= 90 ||
|
|
141288
|
+
// A-Z
|
|
141289
|
+
charCode >= 97 && charCode <= 122 ||
|
|
141290
|
+
// a-z
|
|
141291
|
+
charCode >= 48 && charCode <= 57 ||
|
|
141292
|
+
// 0-9
|
|
141293
|
+
charCode === 43 ||
|
|
141294
|
+
// +
|
|
141295
|
+
charCode === 47 ||
|
|
141296
|
+
// /
|
|
141297
|
+
charCode === 45 ||
|
|
141298
|
+
// - (base64url)
|
|
141299
|
+
charCode === 95; // _ (base64url)
|
|
141300
|
+
|
|
141301
|
+
const isBase64Whitespace = charCode => charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32;
|
|
141302
|
+
const base64Bytes = significant => {
|
|
141303
|
+
const groups = Math.floor(significant / 4);
|
|
141304
|
+
const remainder = significant % 4;
|
|
141305
|
+
return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0);
|
|
141306
|
+
};
|
|
141307
|
+
|
|
141308
|
+
// Buffer.byteLength(body, 'base64') uses the raw string length as an allocation
|
|
141309
|
+
// upper bound even when Buffer.from later ignores characters or stops at '='.
|
|
141310
|
+
const estimateBase64BufferAllocation = body => {
|
|
141311
|
+
const len = body.length;
|
|
141312
|
+
let padding = 0;
|
|
141313
|
+
if (len > 0 && body.charCodeAt(len - 1) === 61 /* '=' */) {
|
|
141314
|
+
padding++;
|
|
141315
|
+
if (len > 1 && body.charCodeAt(len - 2) === 61 /* '=' */) {
|
|
141316
|
+
padding++;
|
|
141317
|
+
}
|
|
141318
|
+
}
|
|
141319
|
+
return Math.floor((len - padding) * 3 / 4);
|
|
141320
|
+
};
|
|
141321
|
+
const estimatePercentDecodedBase64Bytes = body => {
|
|
141322
|
+
const len = body.length;
|
|
141323
|
+
let significant = 0;
|
|
141324
|
+
let padding = 0;
|
|
141325
|
+
let invalid = false;
|
|
141326
|
+
for (let i = 0; i < len; i++) {
|
|
141327
|
+
let code = body.charCodeAt(i);
|
|
141328
|
+
if (code === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {
|
|
141329
|
+
code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2));
|
|
141330
|
+
i += 2;
|
|
141331
|
+
}
|
|
141332
|
+
if (isBase64Whitespace(code)) {
|
|
141333
|
+
continue;
|
|
141334
|
+
}
|
|
141335
|
+
if (code === 61 /* '=' */) {
|
|
141336
|
+
padding++;
|
|
141337
|
+
continue;
|
|
141338
|
+
}
|
|
141339
|
+
if (!isBase64Char(code) || padding > 0) {
|
|
141340
|
+
invalid = true;
|
|
141341
|
+
continue;
|
|
141342
|
+
}
|
|
141343
|
+
significant++;
|
|
141344
|
+
}
|
|
141345
|
+
|
|
141346
|
+
// Fetch rejects malformed forgiving-base64 input. Returning the raw-size
|
|
141347
|
+
// allocation bound keeps that invalid input from becoming a pre-check bypass.
|
|
141348
|
+
if (invalid || padding > 2 || padding > 0 && (significant + padding) % 4 !== 0 || significant % 4 === 1) {
|
|
141349
|
+
return estimateBase64BufferAllocation(body);
|
|
141350
|
+
}
|
|
141351
|
+
return base64Bytes(significant);
|
|
141352
|
+
};
|
|
141353
|
+
const estimateDataURLBytes = (url, estimateBase64) => {
|
|
142079
141354
|
if (!url || typeof url !== 'string') return 0;
|
|
142080
141355
|
if (!url.startsWith('data:')) return 0;
|
|
142081
141356
|
const comma = url.indexOf(',');
|
|
@@ -142084,47 +141359,7 @@ function estimateDataURLDecodedBytes(url) {
|
|
|
142084
141359
|
const body = url.slice(comma + 1);
|
|
142085
141360
|
const isBase64 = /;base64/i.test(meta);
|
|
142086
141361
|
if (isBase64) {
|
|
142087
|
-
|
|
142088
|
-
const len = body.length; // cache length
|
|
142089
|
-
|
|
142090
|
-
for (let i = 0; i < len; i++) {
|
|
142091
|
-
if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
|
|
142092
|
-
const a = body.charCodeAt(i + 1);
|
|
142093
|
-
const b = body.charCodeAt(i + 2);
|
|
142094
|
-
const isHex = isHexDigit(a) && isHexDigit(b);
|
|
142095
|
-
if (isHex) {
|
|
142096
|
-
effectiveLen -= 2;
|
|
142097
|
-
i += 2;
|
|
142098
|
-
}
|
|
142099
|
-
}
|
|
142100
|
-
}
|
|
142101
|
-
let pad = 0;
|
|
142102
|
-
let idx = len - 1;
|
|
142103
|
-
const tailIsPct3D = j => j >= 2 && body.charCodeAt(j - 2) === 37 &&
|
|
142104
|
-
// '%'
|
|
142105
|
-
body.charCodeAt(j - 1) === 51 && (
|
|
142106
|
-
// '3'
|
|
142107
|
-
body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
|
|
142108
|
-
|
|
142109
|
-
if (idx >= 0) {
|
|
142110
|
-
if (body.charCodeAt(idx) === 61 /* '=' */) {
|
|
142111
|
-
pad++;
|
|
142112
|
-
idx--;
|
|
142113
|
-
} else if (tailIsPct3D(idx)) {
|
|
142114
|
-
pad++;
|
|
142115
|
-
idx -= 3;
|
|
142116
|
-
}
|
|
142117
|
-
}
|
|
142118
|
-
if (pad === 1 && idx >= 0) {
|
|
142119
|
-
if (body.charCodeAt(idx) === 61 /* '=' */) {
|
|
142120
|
-
pad++;
|
|
142121
|
-
} else if (tailIsPct3D(idx)) {
|
|
142122
|
-
pad++;
|
|
142123
|
-
}
|
|
142124
|
-
}
|
|
142125
|
-
const groups = Math.floor(effectiveLen / 4);
|
|
142126
|
-
const bytes = groups * 3 - (pad || 0);
|
|
142127
|
-
return bytes > 0 ? bytes : 0;
|
|
141362
|
+
return estimateBase64(body);
|
|
142128
141363
|
}
|
|
142129
141364
|
|
|
142130
141365
|
// Compute UTF-8 byte length directly from UTF-16 code units without allocating
|
|
@@ -142154,6 +141389,28 @@ function estimateDataURLDecodedBytes(url) {
|
|
|
142154
141389
|
}
|
|
142155
141390
|
}
|
|
142156
141391
|
return bytes;
|
|
141392
|
+
};
|
|
141393
|
+
|
|
141394
|
+
/**
|
|
141395
|
+
* Estimate the percent-decoded payload size used by Fetch data: URLs.
|
|
141396
|
+
*
|
|
141397
|
+
* @param {string} url
|
|
141398
|
+
* @returns {number}
|
|
141399
|
+
*/
|
|
141400
|
+
function estimateDataURLDecodedBytes(url) {
|
|
141401
|
+
// Fetch removes URL fragments before processing a data: URL.
|
|
141402
|
+
const fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1;
|
|
141403
|
+
return estimateDataURLBytes(fragmentIndex === -1 ? url : url.slice(0, fragmentIndex), estimatePercentDecodedBase64Bytes);
|
|
141404
|
+
}
|
|
141405
|
+
|
|
141406
|
+
/**
|
|
141407
|
+
* Estimate the Buffer backing allocation used by Node's raw base64 decoder.
|
|
141408
|
+
*
|
|
141409
|
+
* @param {string} url
|
|
141410
|
+
* @returns {number}
|
|
141411
|
+
*/
|
|
141412
|
+
function estimateDataURLBufferAllocation(url) {
|
|
141413
|
+
return estimateDataURLBytes(url, estimateBase64BufferAllocation);
|
|
142157
141414
|
}
|
|
142158
141415
|
|
|
142159
141416
|
/***/ },
|
|
@@ -142187,12 +141444,18 @@ function throwIfDepthExceeded(index) {
|
|
|
142187
141444
|
* @returns An array of strings.
|
|
142188
141445
|
*/
|
|
142189
141446
|
function parsePropPath(name) {
|
|
142190
|
-
// foo[x][y][z]
|
|
142191
|
-
// foo.x.y.z
|
|
142192
|
-
//
|
|
142193
|
-
//
|
|
141447
|
+
// foo[x][y][z] -> ['foo', 'x', 'y', 'z']
|
|
141448
|
+
// foo.x.y.z -> ['foo', 'x', 'y', 'z']
|
|
141449
|
+
// A path is split on `.` and on `[...]` groups. A segment — whether written
|
|
141450
|
+
// in dot notation or captured inside brackets — may contain any character
|
|
141451
|
+
// except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept
|
|
141452
|
+
// literal instead of being split (#5402). `.`, `[` and `]` keep their existing
|
|
141453
|
+
// meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push.
|
|
141454
|
+
// Excluding `[` from the bracket group also makes the match fail fast at the
|
|
141455
|
+
// next `[`, so a malformed name cannot rescan to the end of the string from
|
|
141456
|
+
// every unmatched `[` — parsing stays linear in the length of the name.
|
|
142194
141457
|
const path = [];
|
|
142195
|
-
const pattern =
|
|
141458
|
+
const pattern = /[^.[\]]+|\[([^.[\]]*)]/g;
|
|
142196
141459
|
let match;
|
|
142197
141460
|
while ((match = pattern.exec(name)) !== null) {
|
|
142198
141461
|
throwIfDepthExceeded(path.length);
|
|
@@ -142381,17 +141644,18 @@ const ignoreDuplicateOf = _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] *
|
|
|
142381
141644
|
i = line.indexOf(':');
|
|
142382
141645
|
key = line.substring(0, i).trim().toLowerCase();
|
|
142383
141646
|
val = line.substring(i + 1).trim();
|
|
142384
|
-
|
|
141647
|
+
const hasKey = _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.hasOwnProp(parsed, key);
|
|
141648
|
+
if (!key || hasKey && _utils_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A.hasOwnProp(ignoreDuplicateOf, key)) {
|
|
142385
141649
|
return;
|
|
142386
141650
|
}
|
|
142387
141651
|
if (key === 'set-cookie') {
|
|
142388
|
-
if (
|
|
141652
|
+
if (hasKey) {
|
|
142389
141653
|
parsed[key].push(val);
|
|
142390
141654
|
} else {
|
|
142391
141655
|
parsed[key] = [val];
|
|
142392
141656
|
}
|
|
142393
141657
|
} else {
|
|
142394
|
-
parsed[key] =
|
|
141658
|
+
parsed[key] = hasKey ? parsed[key] + ', ' + val : val;
|
|
142395
141659
|
}
|
|
142396
141660
|
});
|
|
142397
141661
|
return parsed;
|
|
@@ -142438,7 +141702,7 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
|
142438
141702
|
}
|
|
142439
141703
|
const rawLoaded = e.loaded;
|
|
142440
141704
|
const total = e.lengthComputable ? e.total : undefined;
|
|
142441
|
-
const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
|
|
141705
|
+
const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded);
|
|
142442
141706
|
const progressBytes = Math.max(0, loaded - bytesNotified);
|
|
142443
141707
|
const rate = _speedometer(progressBytes);
|
|
142444
141708
|
bytesNotified = Math.max(bytesNotified, loaded);
|
|
@@ -142464,7 +141728,7 @@ const progressEventDecorator = (total, throttled) => {
|
|
|
142464
141728
|
loaded
|
|
142465
141729
|
}), throttled[1]];
|
|
142466
141730
|
};
|
|
142467
|
-
const asyncDecorator = fn
|
|
141731
|
+
const asyncDecorator = (fn, scheduler = _utils_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.asap) => (...args) => scheduler(() => fn(...args));
|
|
142468
141732
|
|
|
142469
141733
|
/***/ },
|
|
142470
141734
|
|
|
@@ -142482,7 +141746,9 @@ const asyncDecorator = fn => (...args) => _utils_js__WEBPACK_IMPORTED_MODULE_2__
|
|
|
142482
141746
|
/* harmony import */ var _core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1216);
|
|
142483
141747
|
/* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6068);
|
|
142484
141748
|
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(88580);
|
|
142485
|
-
/* harmony import */ var
|
|
141749
|
+
/* harmony import */ var _core_setFormDataHeaders_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(19524);
|
|
141750
|
+
/* harmony import */ var _buildURL_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(50869);
|
|
141751
|
+
|
|
142486
141752
|
|
|
142487
141753
|
|
|
142488
141754
|
|
|
@@ -142492,18 +141758,6 @@ const asyncDecorator = fn => (...args) => _utils_js__WEBPACK_IMPORTED_MODULE_2__
|
|
|
142492
141758
|
|
|
142493
141759
|
|
|
142494
141760
|
|
|
142495
|
-
const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
|
|
142496
|
-
function setFormDataHeaders(headers, formHeaders, policy) {
|
|
142497
|
-
if (policy !== 'content-only') {
|
|
142498
|
-
headers.set(formHeaders);
|
|
142499
|
-
return;
|
|
142500
|
-
}
|
|
142501
|
-
Object.entries(formHeaders || {}).forEach(([key, val]) => {
|
|
142502
|
-
if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
|
|
142503
|
-
headers.set(key, val);
|
|
142504
|
-
}
|
|
142505
|
-
});
|
|
142506
|
-
}
|
|
142507
141761
|
|
|
142508
141762
|
/**
|
|
142509
141763
|
* Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
|
|
@@ -142530,7 +141784,7 @@ function resolveConfig(config) {
|
|
|
142530
141784
|
const allowAbsoluteUrls = own('allowAbsoluteUrls');
|
|
142531
141785
|
const url = own('url');
|
|
142532
141786
|
newConfig.headers = headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A.from(headers);
|
|
142533
|
-
newConfig.url = (0,
|
|
141787
|
+
newConfig.url = (0,_buildURL_js__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .A)((0,_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(baseURL, url, allowAbsoluteUrls, newConfig), own('params'), own('paramsSerializer'));
|
|
142534
141788
|
|
|
142535
141789
|
// HTTP basic authentication
|
|
142536
141790
|
if (auth) {
|
|
@@ -142547,7 +141801,7 @@ function resolveConfig(config) {
|
|
|
142547
141801
|
headers.setContentType(undefined); // browser/web worker/RN handles it
|
|
142548
141802
|
} else if (_utils_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.isFunction(data.getHeaders)) {
|
|
142549
141803
|
// Node.js FormData (like form-data package)
|
|
142550
|
-
|
|
141804
|
+
(0,_core_setFormDataHeaders_js__WEBPACK_IMPORTED_MODULE_8__/* ["default"] */ .A)(headers, data.getHeaders(), own('formDataHeaderPolicy'));
|
|
142551
141805
|
}
|
|
142552
141806
|
}
|
|
142553
141807
|
|
|
@@ -142785,6 +142039,7 @@ function throttle(fn, freq) {
|
|
|
142785
142039
|
// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored
|
|
142786
142040
|
|
|
142787
142041
|
|
|
142042
|
+
|
|
142788
142043
|
// Default nesting limit shared with the inverse transform (formDataToJSON) so
|
|
142789
142044
|
// the FormData <-> JSON round-trip stays symmetric.
|
|
142790
142045
|
const DEFAULT_FORM_DATA_MAX_DEPTH = 100;
|
|
@@ -142910,8 +142165,8 @@ function toFormData(obj, formData, options) {
|
|
|
142910
142165
|
if (useBlob && typeof _Blob === 'function') {
|
|
142911
142166
|
return new _Blob([value]);
|
|
142912
142167
|
}
|
|
142913
|
-
if (
|
|
142914
|
-
return
|
|
142168
|
+
if (_platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A && _platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.isBufferAvailable()) {
|
|
142169
|
+
return _platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.from(value);
|
|
142915
142170
|
}
|
|
142916
142171
|
throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A('Blob is not supported. Use a Buffer instead.', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.ERR_NOT_SUPPORT);
|
|
142917
142172
|
}
|
|
@@ -143636,6 +142891,7 @@ const isBlob = kindOfTest('Blob');
|
|
|
143636
142891
|
* @returns {boolean} True if value is a FileList, otherwise false
|
|
143637
142892
|
*/
|
|
143638
142893
|
const isFileList = kindOfTest('FileList');
|
|
142894
|
+
const isSet = kindOfTest('Set');
|
|
143639
142895
|
|
|
143640
142896
|
/**
|
|
143641
142897
|
* Determine if a value is a Stream
|
|
@@ -144158,11 +143414,20 @@ const toJSONObject = obj => {
|
|
|
144158
143414
|
if (!('toJSON' in source)) {
|
|
144159
143415
|
// add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).
|
|
144160
143416
|
visited.add(source);
|
|
144161
|
-
|
|
144162
|
-
|
|
144163
|
-
|
|
144164
|
-
|
|
144165
|
-
|
|
143417
|
+
let target;
|
|
143418
|
+
if (isSet(source)) {
|
|
143419
|
+
target = [];
|
|
143420
|
+
for (const value of source) {
|
|
143421
|
+
const reducedValue = visit(value);
|
|
143422
|
+
!isUndefined(reducedValue) && target.push(reducedValue);
|
|
143423
|
+
}
|
|
143424
|
+
} else {
|
|
143425
|
+
target = isArray(source) ? [] : {};
|
|
143426
|
+
forEach(source, (value, key) => {
|
|
143427
|
+
const reducedValue = visit(value);
|
|
143428
|
+
!isUndefined(reducedValue) && (target[key] = reducedValue);
|
|
143429
|
+
});
|
|
143430
|
+
}
|
|
144166
143431
|
visited.delete(source);
|
|
144167
143432
|
return target;
|
|
144168
143433
|
}
|
|
@@ -176222,9 +175487,10 @@ var castImmutable = (value) => value;
|
|
|
176222
175487
|
|
|
176223
175488
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
176224
175489
|
/* harmony export */ Ay: () => (/* binding */ zt),
|
|
175490
|
+
/* harmony export */ Nk: () => (/* binding */ V),
|
|
176225
175491
|
/* harmony export */ l$: () => (/* binding */ Fe)
|
|
176226
175492
|
/* harmony export */ });
|
|
176227
|
-
/* unused harmony exports CheckmarkIcon, ErrorIcon, LoaderIcon, ToastBar, ToastIcon, resolveValue, toast, useToaster
|
|
175493
|
+
/* unused harmony exports CheckmarkIcon, ErrorIcon, LoaderIcon, ToastBar, ToastIcon, resolveValue, toast, useToaster */
|
|
176228
175494
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
176229
175495
|
/* harmony import */ var goober__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50938);
|
|
176230
175496
|
"use client";
|