@ably/ui 5.0.1-dev.baf5b97.0 → 5.3.0-dev.3c981a4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/core/.gitignore +1 -0
  2. package/core/Code/component.css +70 -0
  3. package/core/Code/component.js +1 -0
  4. package/core/Code.jsx +7578 -0
  5. package/core/ConnectStateWrapper/component.js +1 -0
  6. package/core/ConnectStateWrapper.jsx +213 -0
  7. package/core/ContactFooter/component.css +12 -0
  8. package/core/ContactFooter/component.js +1 -0
  9. package/core/ContactFooter.jsx +448 -0
  10. package/core/CookieMessage/component.css +14 -0
  11. package/core/CookieMessage/component.js +1 -0
  12. package/core/CookieMessage.jsx +476 -0
  13. package/core/CustomerLogos/component.js +1 -0
  14. package/core/CustomerLogos.jsx +246 -0
  15. package/core/FeatureFooter/component.css +13 -0
  16. package/core/FeatureFooter/component.js +1 -0
  17. package/core/FeatureFooter.jsx +17 -0
  18. package/core/FeaturedLink/component.css +16 -0
  19. package/core/FeaturedLink/component.js +1 -0
  20. package/core/FeaturedLink.jsx +307 -0
  21. package/core/Flash/component.css +30 -0
  22. package/core/Flash/component.js +1 -0
  23. package/core/Flash.jsx +2002 -0
  24. package/core/Footer/component.css +14 -0
  25. package/core/Footer/component.js +1 -0
  26. package/core/Footer.jsx +593 -0
  27. package/core/Icon/component.css +1 -0
  28. package/core/Icon/component.js +1 -0
  29. package/core/Icon.jsx +257 -0
  30. package/core/Logo/component.js +1 -0
  31. package/core/Logo.jsx +302 -0
  32. package/core/Meganav/component.css +103 -0
  33. package/core/Meganav/component.js +1 -0
  34. package/core/Meganav/component.json +37 -0
  35. package/core/Meganav.jsx +6514 -0
  36. package/core/MeganavBlogPostsList/component.js +1 -0
  37. package/core/MeganavBlogPostsList.jsx +360 -0
  38. package/core/MeganavContentDevelopers/component.js +1 -0
  39. package/core/MeganavContentDevelopers.jsx +418 -0
  40. package/core/MeganavContentPlatform/component.js +1 -0
  41. package/core/MeganavContentPlatform.jsx +440 -0
  42. package/core/MeganavContentUseCases/component.js +1 -0
  43. package/core/MeganavContentUseCases.jsx +309 -0
  44. package/core/MeganavContentWhyAbly/component.js +1 -0
  45. package/core/MeganavContentWhyAbly.jsx +1471 -0
  46. package/core/MeganavControl/component.js +1 -0
  47. package/core/MeganavControl.jsx +301 -0
  48. package/core/MeganavControlMobileDropdown/component.js +1 -0
  49. package/core/MeganavControlMobileDropdown.jsx +303 -0
  50. package/core/MeganavControlMobilePanelClose/component.js +1 -0
  51. package/core/MeganavControlMobilePanelClose.jsx +301 -0
  52. package/core/MeganavControlMobilePanelOpen/component.js +1 -0
  53. package/core/MeganavControlMobilePanelOpen.jsx +299 -0
  54. package/core/MeganavItemsDesktop/component.js +1 -0
  55. package/core/MeganavItemsDesktop.jsx +377 -0
  56. package/core/MeganavItemsMobile/component.js +1 -0
  57. package/core/MeganavItemsMobile.jsx +581 -0
  58. package/core/MeganavItemsSignedIn/component.js +1 -0
  59. package/core/MeganavItemsSignedIn.jsx +461 -0
  60. package/core/Notice/component.css +8 -0
  61. package/core/Notice/component.js +2 -0
  62. package/core/Notice/component.js.LICENSE.txt +9 -0
  63. package/core/Notice.jsx +2915 -0
  64. package/core/Showcase/component.css +31 -0
  65. package/core/Showcase/component.js +1 -0
  66. package/core/Showcase.jsx +17 -0
  67. package/core/SignOutLink/component.js +1 -0
  68. package/core/SignOutLink.jsx +262 -0
  69. package/core/Slider/component.css +9 -0
  70. package/core/Slider/component.js +1 -0
  71. package/core/Slider.jsx +957 -0
  72. package/core/Test/component.js +59 -0
  73. package/core/Test.jsx +4 -0
  74. package/core/Uptime/component.css +129 -0
  75. package/core/Uptime/component.js +1 -0
  76. package/core/Uptime.jsx +1373 -0
  77. package/core/core.base.css +1 -0
  78. package/core/core.components.css +49 -0
  79. package/core/fonts/.DS_Store +0 -0
  80. package/core/fonts/NEXT-Book-Light-Italic.eot +0 -0
  81. package/core/fonts/NEXT-Book-Light-Italic.otf +0 -0
  82. package/core/fonts/NEXT-Book-Light-Italic.woff +0 -0
  83. package/core/fonts/NEXT-Book-Light-Italic.woff2 +0 -0
  84. package/core/fonts/NEXT-Book-Light.eot +0 -0
  85. package/core/fonts/NEXT-Book-Light.otf +0 -0
  86. package/core/fonts/NEXT-Book-Light.woff +0 -0
  87. package/core/fonts/NEXT-Book-Light.woff2 +0 -0
  88. package/core/fonts/NEXT-Book-Medium-Italic.eot +0 -0
  89. package/core/fonts/NEXT-Book-Medium-Italic.otf +0 -0
  90. package/core/fonts/NEXT-Book-Medium-Italic.woff +0 -0
  91. package/core/fonts/NEXT-Book-Medium-Italic.woff2 +0 -0
  92. package/core/fonts/NEXT-Book-Medium.eot +0 -0
  93. package/core/fonts/NEXT-Book-Medium.otf +0 -0
  94. package/core/fonts/NEXT-Book-Medium.woff +0 -0
  95. package/core/fonts/NEXT-Book-Medium.woff2 +0 -0
  96. package/core/fonts/next.css +59 -0
  97. package/core/images/.DS_Store +0 -0
  98. package/core/images/ably-logo.svg +15 -0
  99. package/core/images/ably-stack.svg +14 -0
  100. package/core/images/blog-thumb1.jpg +0 -0
  101. package/core/images/blog-thumb2.jpg +0 -0
  102. package/core/images/blog-thumb3.jpg +0 -0
  103. package/core/images/cust-logo-ao-col-pos.png +0 -0
  104. package/core/images/cust-logo-ao-col-pos@2x.png +0 -0
  105. package/core/images/cust-logo-ausopen-col-pos.png +0 -0
  106. package/core/images/cust-logo-ausopen-col-pos@2x.png +0 -0
  107. package/core/images/cust-logo-ausopen-mono-pos.svg +5 -0
  108. package/core/images/cust-logo-bloomberg-mono-pos.svg +11 -0
  109. package/core/images/cust-logo-hopin-mono-pos.svg +4 -0
  110. package/core/images/cust-logo-hubspot-col-pos.png +0 -0
  111. package/core/images/cust-logo-hubspot-col-pos@2x.png +0 -0
  112. package/core/images/cust-logo-hubspot-mono-pos.svg +4 -0
  113. package/core/images/cust-logo-lightspeed-col-pos.png +0 -0
  114. package/core/images/cust-logo-lightspeed-col-pos@2x.png +0 -0
  115. package/core/images/cust-logo-lightspeed-syst-col-pos.png +0 -0
  116. package/core/images/cust-logo-lightspeed-syst-col-pos@2x.png +0 -0
  117. package/core/images/cust-logo-split-col-pos.png +0 -0
  118. package/core/images/cust-logo-split-col-pos@2x.png +0 -0
  119. package/core/images/cust-logo-split-mono-pos.svg +9 -0
  120. package/core/images/cust-logo-toyota-mono-pos.svg +18 -0
  121. package/core/images/cust-logo-vitac-col-pos.png +0 -0
  122. package/core/images/cust-logo-vitac-col-pos@2x.png +0 -0
  123. package/core/images/cust-photo-hubspot-max-freiert.jpg +0 -0
  124. package/core/images/cust-photo-split-pato-echague.jpg +0 -0
  125. package/core/images/cust-photo-vitac-joe-antonio.jpg +0 -0
  126. package/core/images/flexible-companies.png +0 -0
  127. package/core/images/rocket-list-2021.png +0 -0
  128. package/core/images/scale-motif-open-empathetic.svg +1 -0
  129. package/core/images/technical-support-01-800x533.jpg +0 -0
  130. package/core/scripts.js +1 -0
  131. package/core/sprites.svg +130 -0
  132. package/core/styles.base.css +1 -0
  133. package/core/styles.components.css +49 -0
  134. package/core/styles.css +560 -0
  135. package/package.json +1 -1
  136. package/preview/log/.keep +0 -0
  137. package/preview/tmp/.keep +0 -0
  138. package/preview/tmp/pids/.keep +0 -0
  139. package/reset/.gitignore +1 -0
  140. package/reset/scripts.js +1 -0
  141. package/reset/styles.css +487 -0
  142. package/src/.DS_Store +0 -0
  143. package/src/core/.DS_Store +0 -0
  144. package/src/core/Code/component.html.erb +3 -3
  145. package/src/core/Code/component.jsx +3 -2
  146. package/src/core/Code/component.rb +2 -1
  147. package/src/core/CustomerLogos/component.html.erb +9 -0
  148. package/src/core/CustomerLogos/component.js +0 -0
  149. package/src/core/CustomerLogos/component.jsx +27 -0
  150. package/src/core/CustomerLogos/component.rb +13 -0
  151. package/src/core/FeaturedLink/component.css +1 -2
  152. package/src/core/FeaturedLink/component.html.erb +1 -1
  153. package/src/core/FeaturedLink/component.rb +3 -1
  154. package/src/core/MeganavItemsSignedIn/component.html.erb +1 -1
  155. package/src/core/MeganavItemsSignedIn/component.jsx +1 -1
  156. package/src/core/Slider/component.html.erb +2 -2
  157. package/src/core/Slider/component.js +2 -2
  158. package/src/core/Slider/component.jsx +2 -2
  159. package/src/core/icons/icon-display-api-keys.svg +3 -0
  160. package/src/core/icons/icon-display-cloud-servers.svg +3 -0
  161. package/src/core/icons/icon-display-map-pin.svg +1 -1
  162. package/src/core/icons/icon-display-servers.svg +3 -0
  163. package/src/core/icons/icon-gui-history.svg +3 -0
  164. package/src/core/icons/icon-gui-refresh.svg +10 -0
  165. package/src/core/images/cust-logo-ausopen-mono-pos.svg +5 -0
  166. package/src/core/images/cust-logo-bloomberg-mono-pos.svg +11 -0
  167. package/src/core/images/cust-logo-hopin-mono-pos.svg +4 -0
  168. package/src/core/images/cust-logo-hubspot-mono-pos.svg +4 -0
  169. package/src/core/images/cust-logo-split-mono-pos.svg +9 -0
  170. package/src/core/images/cust-logo-toyota-mono-pos.svg +18 -0
  171. package/src/core/styles/buttons.css +91 -4
  172. package/src/core/styles/forms.css +50 -0
  173. package/src/core/styles/properties.css +34 -6
  174. package/src/core/styles/text.css +62 -1
  175. package/src/core/styles.components.css +1 -0
  176. package/tailwind.config.js +22 -1
@@ -0,0 +1,2915 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("react"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("react")) : factory(root[undefined]);
8
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
+ }
10
+ })(this, function(__WEBPACK_EXTERNAL_MODULE__9281__) {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ var __webpack_modules__ = ({
13
+
14
+ /***/ 9787:
15
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16
+
17
+ "use strict";
18
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
20
+ /* harmony export */ });
21
+ /* unused harmony export ConnectStateWrapper */
22
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
23
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
24
+ /* harmony import */ var _remote_data_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3511);
25
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
26
+
27
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
28
+
29
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
30
+
31
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
32
+
33
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
34
+
35
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
36
+
37
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
38
+
39
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
40
+
41
+ function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
42
+
43
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
44
+
45
+
46
+
47
+ /*
48
+ Connect a react component to a global store.
49
+ This is similar to what react-redux does but uses our global store so
50
+ can share state with other React mount points or anything that uses the
51
+ store.
52
+ - selectors is an object where keys are your prop names and values are your select
53
+ functions that work on the store to retrieve the state you are interested in
54
+ - initial state is set in useEffect so the wrapped component needs to handle it's props set to undefined initially
55
+ */
56
+
57
+ var ConnectStateWrapper = function ConnectStateWrapper(Component, selectors) {
58
+ var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)({}),
59
+ _useState2 = _slicedToArray(_useState, 2),
60
+ state = _useState2[0],
61
+ setState = _useState2[1];
62
+
63
+ var setStateForKey = function setStateForKey(key) {
64
+ return function (storeState) {
65
+ return setState(function () {
66
+ return _defineProperty({}, key, storeState);
67
+ });
68
+ };
69
+ };
70
+
71
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
72
+ var store = (0,_remote_data_store__WEBPACK_IMPORTED_MODULE_1__/* .getRemoteDataStore */ .cO)();
73
+ var resolvedState = Object.keys(selectors).reduce(function (acc, key) {
74
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, selectors[key](store)));
75
+ }, {}); // Set initial state
76
+
77
+ setState(resolvedState); // Create a store subscription for each selector. Depending on your use case, this can be inefficient.
78
+ // When optimising for renders, look for wins with selectors better for your use and using connectState directly.
79
+
80
+ Object.keys(selectors).forEach(function (key) {
81
+ (0,_remote_data_store__WEBPACK_IMPORTED_MODULE_1__/* .connectState */ .kZ)(selectors[key], setStateForKey(key));
82
+ });
83
+ }, []);
84
+
85
+ var WrappedComponent = function WrappedComponent(props) {
86
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Component, _extends({}, props, state));
87
+ };
88
+
89
+ return WrappedComponent;
90
+ };
91
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ConnectStateWrapper);
92
+
93
+ /***/ }),
94
+
95
+ /***/ 4935:
96
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
97
+
98
+ "use strict";
99
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
100
+ /* harmony export */ "FLASH_DATA_ID": () => (/* binding */ FLASH_DATA_ID)
101
+ /* harmony export */ });
102
+ /* unused harmony export reducerFlashes */
103
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
104
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
105
+ /* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7856);
106
+ /* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dompurify__WEBPACK_IMPORTED_MODULE_1__);
107
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5697);
108
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
109
+ /* harmony import */ var _remote_data_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3511);
110
+ /* harmony import */ var _ConnectStateWrapper_component_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9787);
111
+ /* harmony import */ var _Icon_component_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9008);
112
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
113
+
114
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
115
+
116
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
117
+
118
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
119
+
120
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
121
+
122
+ function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
123
+
124
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
125
+
126
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
127
+
128
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
129
+
130
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
131
+
132
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
133
+
134
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
135
+
136
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
137
+
138
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+ var REDUCER_KEY = "flashes";
147
+ var FLASH_DATA_ID = "ui-flashes";
148
+ var initialState = {
149
+ items: []
150
+ };
151
+
152
+ var reducerFlashes = _defineProperty({}, REDUCER_KEY, function () {
153
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
154
+ var action = arguments.length > 1 ? arguments[1] : undefined;
155
+
156
+ switch (action.type) {
157
+ case "flash/push":
158
+ {
159
+ var flashes = Array.isArray(action.payload) ? action.payload : [action.payload];
160
+ return {
161
+ items: [].concat(_toConsumableArray(state.items), _toConsumableArray(flashes))
162
+ };
163
+ }
164
+
165
+ default:
166
+ return state;
167
+ }
168
+ });
169
+
170
+ var selectFlashes = function selectFlashes(store) {
171
+ return store.getState()[REDUCER_KEY];
172
+ };
173
+
174
+ var FlashT = {
175
+ type: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(["error", "success", "notice", "info", "alert"]),
176
+ content: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)
177
+ };
178
+ var FLASH_BG_COLOR = {
179
+ error: "bg-gui-error",
180
+ success: "bg-zingy-green",
181
+ notice: "bg-electric-cyan",
182
+ info: "bg-electric-cyan",
183
+ alert: "bg-active-orange"
184
+ };
185
+ var FLASH_TEXT_COLOR = {
186
+ error: "text-white",
187
+ success: "text-cool-black",
188
+ notice: "text-cool-black",
189
+ info: "text-cool-black",
190
+ alert: "text-white"
191
+ };
192
+ var AUTO_HIDE = ["success", "info", "notice"];
193
+ var AUTO_HIDE_TIME = 8000;
194
+
195
+ var Flash = function Flash(_ref) {
196
+ var type = _ref.type,
197
+ content = _ref.content;
198
+ var ref = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
199
+
200
+ var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
201
+ _useState2 = _slicedToArray(_useState, 2),
202
+ closed = _useState2[0],
203
+ setClosed = _useState2[1];
204
+
205
+ var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),
206
+ _useState4 = _slicedToArray(_useState3, 2),
207
+ flashHeight = _useState4[0],
208
+ setFlashHeight = _useState4[1];
209
+
210
+ var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
211
+ _useState6 = _slicedToArray(_useState5, 2),
212
+ triggerEntryAnimation = _useState6[0],
213
+ setTriggerEntryAnimation = _useState6[1];
214
+
215
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
216
+ return setTriggerEntryAnimation(true);
217
+ }, []);
218
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
219
+ if (AUTO_HIDE.includes(type)) {
220
+ setTimeout(function () {
221
+ // closeFlash is idempotent, we can call it even if the flash has been already closed
222
+ closeFlash();
223
+ }, AUTO_HIDE_TIME);
224
+ }
225
+ }, [closed]);
226
+
227
+ var closeFlash = function closeFlash() {
228
+ if (ref.current) {
229
+ setFlashHeight(ref.current.getBoundingClientRect().height);
230
+ }
231
+
232
+ setTimeout(function () {
233
+ return setClosed(true);
234
+ }, 0);
235
+ };
236
+
237
+ var animateEntry = triggerEntryAnimation && !closed;
238
+ var style;
239
+
240
+ if (flashHeight && !closed) {
241
+ style = {
242
+ height: "".concat(flashHeight, "px")
243
+ };
244
+ } else if (closed) {
245
+ style = {
246
+ height: 0,
247
+ marginTop: 0,
248
+ zIndex: -1
249
+ };
250
+ } else {
251
+ style = {};
252
+ }
253
+
254
+ var safeContent = dompurify__WEBPACK_IMPORTED_MODULE_1___default().sanitize(content, {
255
+ ALLOWED_TAGS: ["a"],
256
+ ALLOWED_ATTR: ["href", "data-method", "rel"]
257
+ });
258
+ var withIcons = {
259
+ notice: "icon-gui-ably-badge",
260
+ success: "icon-gui-tick",
261
+ error: "icon-gui-warning",
262
+ alert: "icon-gui-warning"
263
+ };
264
+ var iconColor = {
265
+ notice: "text-cool-black",
266
+ success: "text-cool-black",
267
+ error: "text-white",
268
+ alert: "text-white"
269
+ };
270
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
271
+ className: "ui-flash-message ui-grid-px ".concat(animateEntry ? "ui-flash-message-enter" : ""),
272
+ style: style,
273
+ ref: ref,
274
+ "data-id": "ui-flash"
275
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
276
+ className: "".concat(FLASH_BG_COLOR[type], " p-32 flex align-center rounded shadow-container-subtle")
277
+ }, withIcons[type] && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Icon_component_jsx__WEBPACK_IMPORTED_MODULE_4__.default, {
278
+ name: withIcons[type],
279
+ color: iconColor[type],
280
+ size: "1.5rem",
281
+ additionalCSS: "mr-16 self-baseline"
282
+ }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
283
+ className: "ui-flash-text ".concat(FLASH_TEXT_COLOR[type]),
284
+ dangerouslySetInnerHTML: {
285
+ __html: safeContent
286
+ }
287
+ }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
288
+ type: "button",
289
+ className: "p-0 ml-auto self-start",
290
+ onClick: closeFlash
291
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
292
+ className: "h-24 w-24 transition-colors ui-icon-cool-black"
293
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("use", {
294
+ xlinkHref: "#sprite-close"
295
+ })))));
296
+ };
297
+
298
+ Flash.propTypes = _objectSpread({}, FlashT);
299
+
300
+ var Flashes = function Flashes(_ref2) {
301
+ var flashes = _ref2.flashes;
302
+ var items = (flashes === null || flashes === void 0 ? void 0 : flashes.items) || [];
303
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
304
+ className: "ui-flash",
305
+ "data-id": FLASH_DATA_ID
306
+ }, items.map(function (flash) {
307
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Flash, _extends({
308
+ key: flash.type
309
+ }, flash));
310
+ }));
311
+ };
312
+
313
+ Flashes.propTypes = {
314
+ flashes: prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape({
315
+ items: prop_types__WEBPACK_IMPORTED_MODULE_2___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape(FlashT))
316
+ })
317
+ };
318
+
319
+ var BackendFlashes = function BackendFlashes(_ref3) {
320
+ var flashes = _ref3.flashes;
321
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
322
+ var transformedFlashes = flashes.map(function (flash) {
323
+ var _flash = _slicedToArray(flash, 2),
324
+ type = _flash[0],
325
+ content = _flash[1];
326
+
327
+ return {
328
+ type: type,
329
+ content: content
330
+ };
331
+ }) || [];
332
+
333
+ if (transformedFlashes.length > 0) {
334
+ var store = (0,_remote_data_store__WEBPACK_IMPORTED_MODULE_5__/* .getRemoteDataStore */ .cO)();
335
+ store.dispatch({
336
+ type: "flash/push",
337
+ payload: transformedFlashes
338
+ });
339
+ }
340
+ }, []);
341
+ var WrappedFlashes = (0,_ConnectStateWrapper_component_jsx__WEBPACK_IMPORTED_MODULE_3__.default)(Flashes, {
342
+ flashes: selectFlashes
343
+ });
344
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(WrappedFlashes, null);
345
+ };
346
+
347
+ BackendFlashes.propTypes = {
348
+ flashes: prop_types__WEBPACK_IMPORTED_MODULE_2___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_2___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)))
349
+ };
350
+
351
+ /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (BackendFlashes)));
352
+
353
+ /***/ }),
354
+
355
+ /***/ 9008:
356
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
357
+
358
+ "use strict";
359
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
360
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
361
+ /* harmony export */ });
362
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
363
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
364
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5697);
365
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
366
+ var _excluded = ["name", "size", "color", "additionalCSS"];
367
+
368
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
369
+
370
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
371
+
372
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
373
+
374
+
375
+
376
+
377
+ var Icon = function Icon(_ref) {
378
+ var name = _ref.name,
379
+ _ref$size = _ref.size,
380
+ size = _ref$size === void 0 ? "0.75rem" : _ref$size,
381
+ _ref$color = _ref.color,
382
+ color = _ref$color === void 0 ? "" : _ref$color,
383
+ _ref$additionalCSS = _ref.additionalCSS,
384
+ additionalCSS = _ref$additionalCSS === void 0 ? "" : _ref$additionalCSS,
385
+ additionalAttributes = _objectWithoutProperties(_ref, _excluded);
386
+
387
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", _extends({
388
+ className: "".concat(color, " ").concat(additionalCSS),
389
+ style: {
390
+ width: size,
391
+ height: size
392
+ }
393
+ }, additionalAttributes), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("use", {
394
+ xlinkHref: "#sprite-".concat(name)
395
+ }));
396
+ };
397
+
398
+ Icon.propTypes = {
399
+ name: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string.isRequired),
400
+ size: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
401
+ color: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
402
+ additionalCSS: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
403
+ };
404
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Icon);
405
+
406
+ /***/ }),
407
+
408
+ /***/ 9581:
409
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
410
+
411
+ "use strict";
412
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
413
+ /* harmony export */ "A": () => (/* binding */ queryId)
414
+ /* harmony export */ });
415
+ /* unused harmony export queryIdAll */
416
+ var queryId = function queryId(val) {
417
+ var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
418
+ return root.querySelector("[data-id=".concat(val, "]"));
419
+ };
420
+ var queryIdAll = function queryIdAll(val) {
421
+ var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
422
+ return root.querySelectorAll("[data-id=".concat(val, "]"));
423
+ };
424
+
425
+ /***/ }),
426
+
427
+ /***/ 3511:
428
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
429
+
430
+ "use strict";
431
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
432
+ /* harmony export */ "cO": () => (/* binding */ getRemoteDataStore),
433
+ /* harmony export */ "kZ": () => (/* binding */ connectState)
434
+ /* harmony export */ });
435
+ /* unused harmony exports attachStoreToWindow, createRemoteDataStore */
436
+
437
+ var attachStoreToWindow = function attachStoreToWindow(store) {
438
+ window.AblyUi = window.AblyUi || {};
439
+ window.AblyUi.RemoteDataStore = store;
440
+ };
441
+ var getRemoteDataStore = function getRemoteDataStore() {
442
+ if (!window.AblyUi.RemoteDataStore) {
443
+ throw new Error("Remote store was called before one was created");
444
+ }
445
+
446
+ return window.AblyUi.RemoteDataStore;
447
+ };
448
+ var connectState = function connectState(selector, setState) {
449
+ var store = getRemoteDataStore();
450
+ var cachedOldState = selector(store);
451
+ store.subscribe(function () {
452
+ var newState = selector(store); // Do nothing, state is the same
453
+
454
+ if (newState === cachedOldState) {
455
+ return;
456
+ }
457
+
458
+ cachedOldState = newState;
459
+ setState(newState);
460
+ });
461
+ };
462
+ var createRemoteDataStore = function createRemoteDataStore(reducers) {
463
+ return createStore(combineReducers(reducers));
464
+ };
465
+
466
+ /***/ }),
467
+
468
+ /***/ 7856:
469
+ /***/ (function(module) {
470
+
471
+ /*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */
472
+
473
+ (function (global, factory) {
474
+ true ? module.exports = factory() :
475
+ 0;
476
+ }(this, function () { 'use strict';
477
+
478
+ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
479
+
480
+ var hasOwnProperty = Object.hasOwnProperty,
481
+ setPrototypeOf = Object.setPrototypeOf,
482
+ isFrozen = Object.isFrozen,
483
+ getPrototypeOf = Object.getPrototypeOf,
484
+ getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
485
+ var freeze = Object.freeze,
486
+ seal = Object.seal,
487
+ create = Object.create; // eslint-disable-line import/no-mutable-exports
488
+
489
+ var _ref = typeof Reflect !== 'undefined' && Reflect,
490
+ apply = _ref.apply,
491
+ construct = _ref.construct;
492
+
493
+ if (!apply) {
494
+ apply = function apply(fun, thisValue, args) {
495
+ return fun.apply(thisValue, args);
496
+ };
497
+ }
498
+
499
+ if (!freeze) {
500
+ freeze = function freeze(x) {
501
+ return x;
502
+ };
503
+ }
504
+
505
+ if (!seal) {
506
+ seal = function seal(x) {
507
+ return x;
508
+ };
509
+ }
510
+
511
+ if (!construct) {
512
+ construct = function construct(Func, args) {
513
+ return new (Function.prototype.bind.apply(Func, [null].concat(_toConsumableArray(args))))();
514
+ };
515
+ }
516
+
517
+ var arrayForEach = unapply(Array.prototype.forEach);
518
+ var arrayPop = unapply(Array.prototype.pop);
519
+ var arrayPush = unapply(Array.prototype.push);
520
+
521
+ var stringToLowerCase = unapply(String.prototype.toLowerCase);
522
+ var stringMatch = unapply(String.prototype.match);
523
+ var stringReplace = unapply(String.prototype.replace);
524
+ var stringIndexOf = unapply(String.prototype.indexOf);
525
+ var stringTrim = unapply(String.prototype.trim);
526
+
527
+ var regExpTest = unapply(RegExp.prototype.test);
528
+
529
+ var typeErrorCreate = unconstruct(TypeError);
530
+
531
+ function unapply(func) {
532
+ return function (thisArg) {
533
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
534
+ args[_key - 1] = arguments[_key];
535
+ }
536
+
537
+ return apply(func, thisArg, args);
538
+ };
539
+ }
540
+
541
+ function unconstruct(func) {
542
+ return function () {
543
+ for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
544
+ args[_key2] = arguments[_key2];
545
+ }
546
+
547
+ return construct(func, args);
548
+ };
549
+ }
550
+
551
+ /* Add properties to a lookup table */
552
+ function addToSet(set, array) {
553
+ if (setPrototypeOf) {
554
+ // Make 'in' and truthy checks like Boolean(set.constructor)
555
+ // independent of any properties defined on Object.prototype.
556
+ // Prevent prototype setters from intercepting set as a this value.
557
+ setPrototypeOf(set, null);
558
+ }
559
+
560
+ var l = array.length;
561
+ while (l--) {
562
+ var element = array[l];
563
+ if (typeof element === 'string') {
564
+ var lcElement = stringToLowerCase(element);
565
+ if (lcElement !== element) {
566
+ // Config presets (e.g. tags.js, attrs.js) are immutable.
567
+ if (!isFrozen(array)) {
568
+ array[l] = lcElement;
569
+ }
570
+
571
+ element = lcElement;
572
+ }
573
+ }
574
+
575
+ set[element] = true;
576
+ }
577
+
578
+ return set;
579
+ }
580
+
581
+ /* Shallow clone an object */
582
+ function clone(object) {
583
+ var newObject = create(null);
584
+
585
+ var property = void 0;
586
+ for (property in object) {
587
+ if (apply(hasOwnProperty, object, [property])) {
588
+ newObject[property] = object[property];
589
+ }
590
+ }
591
+
592
+ return newObject;
593
+ }
594
+
595
+ /* IE10 doesn't support __lookupGetter__ so lets'
596
+ * simulate it. It also automatically checks
597
+ * if the prop is function or getter and behaves
598
+ * accordingly. */
599
+ function lookupGetter(object, prop) {
600
+ while (object !== null) {
601
+ var desc = getOwnPropertyDescriptor(object, prop);
602
+ if (desc) {
603
+ if (desc.get) {
604
+ return unapply(desc.get);
605
+ }
606
+
607
+ if (typeof desc.value === 'function') {
608
+ return unapply(desc.value);
609
+ }
610
+ }
611
+
612
+ object = getPrototypeOf(object);
613
+ }
614
+
615
+ function fallbackValue(element) {
616
+ console.warn('fallback value for', element);
617
+ return null;
618
+ }
619
+
620
+ return fallbackValue;
621
+ }
622
+
623
+ var html = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
624
+
625
+ // SVG
626
+ var svg = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
627
+
628
+ var svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
629
+
630
+ // List of SVG elements that are disallowed by default.
631
+ // We still need to know them so that we can do namespace
632
+ // checks properly in case one wants to add them to
633
+ // allow-list.
634
+ var svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'fedropshadow', 'feimage', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
635
+
636
+ var mathMl = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover']);
637
+
638
+ // Similarly to SVG, we want to know all MathML elements,
639
+ // even those that we disallow by default.
640
+ var mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
641
+
642
+ var text = freeze(['#text']);
643
+
644
+ var html$1 = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'xmlns', 'slot']);
645
+
646
+ var svg$1 = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
647
+
648
+ var mathMl$1 = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
649
+
650
+ var xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
651
+
652
+ // eslint-disable-next-line unicorn/better-regex
653
+ var MUSTACHE_EXPR = seal(/\{\{[\s\S]*|[\s\S]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
654
+ var ERB_EXPR = seal(/<%[\s\S]*|[\s\S]*%>/gm);
655
+ var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/); // eslint-disable-line no-useless-escape
656
+ var ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
657
+ var IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
658
+ );
659
+ var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
660
+ var ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
661
+ );
662
+
663
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
664
+
665
+ function _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
666
+
667
+ var getGlobal = function getGlobal() {
668
+ return typeof window === 'undefined' ? null : window;
669
+ };
670
+
671
+ /**
672
+ * Creates a no-op policy for internal use only.
673
+ * Don't export this function outside this module!
674
+ * @param {?TrustedTypePolicyFactory} trustedTypes The policy factory.
675
+ * @param {Document} document The document object (to determine policy name suffix)
676
+ * @return {?TrustedTypePolicy} The policy created (or null, if Trusted Types
677
+ * are not supported).
678
+ */
679
+ var _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, document) {
680
+ if ((typeof trustedTypes === 'undefined' ? 'undefined' : _typeof(trustedTypes)) !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
681
+ return null;
682
+ }
683
+
684
+ // Allow the callers to control the unique policy name
685
+ // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
686
+ // Policy creation with duplicate names throws in Trusted Types.
687
+ var suffix = null;
688
+ var ATTR_NAME = 'data-tt-policy-suffix';
689
+ if (document.currentScript && document.currentScript.hasAttribute(ATTR_NAME)) {
690
+ suffix = document.currentScript.getAttribute(ATTR_NAME);
691
+ }
692
+
693
+ var policyName = 'dompurify' + (suffix ? '#' + suffix : '');
694
+
695
+ try {
696
+ return trustedTypes.createPolicy(policyName, {
697
+ createHTML: function createHTML(html$$1) {
698
+ return html$$1;
699
+ }
700
+ });
701
+ } catch (_) {
702
+ // Policy creation failed (most likely another DOMPurify script has
703
+ // already run). Skip creating the policy, as this will only cause errors
704
+ // if TT are enforced.
705
+ console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
706
+ return null;
707
+ }
708
+ };
709
+
710
+ function createDOMPurify() {
711
+ var window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
712
+
713
+ var DOMPurify = function DOMPurify(root) {
714
+ return createDOMPurify(root);
715
+ };
716
+
717
+ /**
718
+ * Version label, exposed for easier checks
719
+ * if DOMPurify is up to date or not
720
+ */
721
+ DOMPurify.version = '2.2.9';
722
+
723
+ /**
724
+ * Array of elements that DOMPurify removed during sanitation.
725
+ * Empty if nothing was removed.
726
+ */
727
+ DOMPurify.removed = [];
728
+
729
+ if (!window || !window.document || window.document.nodeType !== 9) {
730
+ // Not running in a browser, provide a factory function
731
+ // so that you can pass your own Window
732
+ DOMPurify.isSupported = false;
733
+
734
+ return DOMPurify;
735
+ }
736
+
737
+ var originalDocument = window.document;
738
+
739
+ var document = window.document;
740
+ var DocumentFragment = window.DocumentFragment,
741
+ HTMLTemplateElement = window.HTMLTemplateElement,
742
+ Node = window.Node,
743
+ Element = window.Element,
744
+ NodeFilter = window.NodeFilter,
745
+ _window$NamedNodeMap = window.NamedNodeMap,
746
+ NamedNodeMap = _window$NamedNodeMap === undefined ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap,
747
+ Text = window.Text,
748
+ Comment = window.Comment,
749
+ DOMParser = window.DOMParser,
750
+ trustedTypes = window.trustedTypes;
751
+
752
+
753
+ var ElementPrototype = Element.prototype;
754
+
755
+ var cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
756
+ var getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
757
+ var getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
758
+ var getParentNode = lookupGetter(ElementPrototype, 'parentNode');
759
+
760
+ // As per issue #47, the web-components registry is inherited by a
761
+ // new document created via createHTMLDocument. As per the spec
762
+ // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
763
+ // a new empty registry is used when creating a template contents owner
764
+ // document, so we use that as our parent document to ensure nothing
765
+ // is inherited.
766
+ if (typeof HTMLTemplateElement === 'function') {
767
+ var template = document.createElement('template');
768
+ if (template.content && template.content.ownerDocument) {
769
+ document = template.content.ownerDocument;
770
+ }
771
+ }
772
+
773
+ var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);
774
+ var emptyHTML = trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML('') : '';
775
+
776
+ var _document = document,
777
+ implementation = _document.implementation,
778
+ createNodeIterator = _document.createNodeIterator,
779
+ createDocumentFragment = _document.createDocumentFragment;
780
+ var importNode = originalDocument.importNode;
781
+
782
+
783
+ var documentMode = {};
784
+ try {
785
+ documentMode = clone(document).documentMode ? document.documentMode : {};
786
+ } catch (_) {}
787
+
788
+ var hooks = {};
789
+
790
+ /**
791
+ * Expose whether this browser supports running the full DOMPurify.
792
+ */
793
+ DOMPurify.isSupported = typeof getParentNode === 'function' && implementation && typeof implementation.createHTMLDocument !== 'undefined' && documentMode !== 9;
794
+
795
+ var MUSTACHE_EXPR$$1 = MUSTACHE_EXPR,
796
+ ERB_EXPR$$1 = ERB_EXPR,
797
+ DATA_ATTR$$1 = DATA_ATTR,
798
+ ARIA_ATTR$$1 = ARIA_ATTR,
799
+ IS_SCRIPT_OR_DATA$$1 = IS_SCRIPT_OR_DATA,
800
+ ATTR_WHITESPACE$$1 = ATTR_WHITESPACE;
801
+ var IS_ALLOWED_URI$$1 = IS_ALLOWED_URI;
802
+
803
+ /**
804
+ * We consider the elements and attributes below to be safe. Ideally
805
+ * don't add any new ones but feel free to remove unwanted ones.
806
+ */
807
+
808
+ /* allowed element names */
809
+
810
+ var ALLOWED_TAGS = null;
811
+ var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(html), _toConsumableArray$1(svg), _toConsumableArray$1(svgFilters), _toConsumableArray$1(mathMl), _toConsumableArray$1(text)));
812
+
813
+ /* Allowed attribute names */
814
+ var ALLOWED_ATTR = null;
815
+ var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray$1(html$1), _toConsumableArray$1(svg$1), _toConsumableArray$1(mathMl$1), _toConsumableArray$1(xml)));
816
+
817
+ /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
818
+ var FORBID_TAGS = null;
819
+
820
+ /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
821
+ var FORBID_ATTR = null;
822
+
823
+ /* Decide if ARIA attributes are okay */
824
+ var ALLOW_ARIA_ATTR = true;
825
+
826
+ /* Decide if custom data attributes are okay */
827
+ var ALLOW_DATA_ATTR = true;
828
+
829
+ /* Decide if unknown protocols are okay */
830
+ var ALLOW_UNKNOWN_PROTOCOLS = false;
831
+
832
+ /* Output should be safe for common template engines.
833
+ * This means, DOMPurify removes data attributes, mustaches and ERB
834
+ */
835
+ var SAFE_FOR_TEMPLATES = false;
836
+
837
+ /* Decide if document with <html>... should be returned */
838
+ var WHOLE_DOCUMENT = false;
839
+
840
+ /* Track whether config is already set on this instance of DOMPurify. */
841
+ var SET_CONFIG = false;
842
+
843
+ /* Decide if all elements (e.g. style, script) must be children of
844
+ * document.body. By default, browsers might move them to document.head */
845
+ var FORCE_BODY = false;
846
+
847
+ /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
848
+ * string (or a TrustedHTML object if Trusted Types are supported).
849
+ * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
850
+ */
851
+ var RETURN_DOM = false;
852
+
853
+ /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
854
+ * string (or a TrustedHTML object if Trusted Types are supported) */
855
+ var RETURN_DOM_FRAGMENT = false;
856
+
857
+ /* If `RETURN_DOM` or `RETURN_DOM_FRAGMENT` is enabled, decide if the returned DOM
858
+ * `Node` is imported into the current `Document`. If this flag is not enabled the
859
+ * `Node` will belong (its ownerDocument) to a fresh `HTMLDocument`, created by
860
+ * DOMPurify.
861
+ *
862
+ * This defaults to `true` starting DOMPurify 2.2.0. Note that setting it to `false`
863
+ * might cause XSS from attacks hidden in closed shadowroots in case the browser
864
+ * supports Declarative Shadow: DOM https://web.dev/declarative-shadow-dom/
865
+ */
866
+ var RETURN_DOM_IMPORT = true;
867
+
868
+ /* Try to return a Trusted Type object instead of a string, return a string in
869
+ * case Trusted Types are not supported */
870
+ var RETURN_TRUSTED_TYPE = false;
871
+
872
+ /* Output should be free from DOM clobbering attacks? */
873
+ var SANITIZE_DOM = true;
874
+
875
+ /* Keep element content when removing element? */
876
+ var KEEP_CONTENT = true;
877
+
878
+ /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
879
+ * of importing it into a new Document and returning a sanitized copy */
880
+ var IN_PLACE = false;
881
+
882
+ /* Allow usage of profiles like html, svg and mathMl */
883
+ var USE_PROFILES = {};
884
+
885
+ /* Tags to ignore content of when KEEP_CONTENT is true */
886
+ var FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
887
+
888
+ /* Tags that are safe for data: URIs */
889
+ var DATA_URI_TAGS = null;
890
+ var DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
891
+
892
+ /* Attributes safe for values like "javascript:" */
893
+ var URI_SAFE_ATTRIBUTES = null;
894
+ var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'summary', 'title', 'value', 'style', 'xmlns']);
895
+
896
+ var MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
897
+ var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
898
+ var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
899
+ /* Document namespace */
900
+ var NAMESPACE = HTML_NAMESPACE;
901
+ var IS_EMPTY_INPUT = false;
902
+
903
+ /* Keep a reference to config to pass to hooks */
904
+ var CONFIG = null;
905
+
906
+ /* Ideally, do not touch anything below this line */
907
+ /* ______________________________________________ */
908
+
909
+ var formElement = document.createElement('form');
910
+
911
+ /**
912
+ * _parseConfig
913
+ *
914
+ * @param {Object} cfg optional config literal
915
+ */
916
+ // eslint-disable-next-line complexity
917
+ var _parseConfig = function _parseConfig(cfg) {
918
+ if (CONFIG && CONFIG === cfg) {
919
+ return;
920
+ }
921
+
922
+ /* Shield configuration object from tampering */
923
+ if (!cfg || (typeof cfg === 'undefined' ? 'undefined' : _typeof(cfg)) !== 'object') {
924
+ cfg = {};
925
+ }
926
+
927
+ /* Shield configuration object from prototype pollution */
928
+ cfg = clone(cfg);
929
+
930
+ /* Set configuration parameters */
931
+ ALLOWED_TAGS = 'ALLOWED_TAGS' in cfg ? addToSet({}, cfg.ALLOWED_TAGS) : DEFAULT_ALLOWED_TAGS;
932
+ ALLOWED_ATTR = 'ALLOWED_ATTR' in cfg ? addToSet({}, cfg.ALLOWED_ATTR) : DEFAULT_ALLOWED_ATTR;
933
+ URI_SAFE_ATTRIBUTES = 'ADD_URI_SAFE_ATTR' in cfg ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR) : DEFAULT_URI_SAFE_ATTRIBUTES;
934
+ DATA_URI_TAGS = 'ADD_DATA_URI_TAGS' in cfg ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS) : DEFAULT_DATA_URI_TAGS;
935
+ FORBID_TAGS = 'FORBID_TAGS' in cfg ? addToSet({}, cfg.FORBID_TAGS) : {};
936
+ FORBID_ATTR = 'FORBID_ATTR' in cfg ? addToSet({}, cfg.FORBID_ATTR) : {};
937
+ USE_PROFILES = 'USE_PROFILES' in cfg ? cfg.USE_PROFILES : false;
938
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
939
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
940
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
941
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
942
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
943
+ RETURN_DOM = cfg.RETURN_DOM || false; // Default false
944
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
945
+ RETURN_DOM_IMPORT = cfg.RETURN_DOM_IMPORT !== false; // Default true
946
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
947
+ FORCE_BODY = cfg.FORCE_BODY || false; // Default false
948
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
949
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
950
+ IN_PLACE = cfg.IN_PLACE || false; // Default false
951
+ IS_ALLOWED_URI$$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$$1;
952
+ NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
953
+ if (SAFE_FOR_TEMPLATES) {
954
+ ALLOW_DATA_ATTR = false;
955
+ }
956
+
957
+ if (RETURN_DOM_FRAGMENT) {
958
+ RETURN_DOM = true;
959
+ }
960
+
961
+ /* Parse profile info */
962
+ if (USE_PROFILES) {
963
+ ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray$1(text)));
964
+ ALLOWED_ATTR = [];
965
+ if (USE_PROFILES.html === true) {
966
+ addToSet(ALLOWED_TAGS, html);
967
+ addToSet(ALLOWED_ATTR, html$1);
968
+ }
969
+
970
+ if (USE_PROFILES.svg === true) {
971
+ addToSet(ALLOWED_TAGS, svg);
972
+ addToSet(ALLOWED_ATTR, svg$1);
973
+ addToSet(ALLOWED_ATTR, xml);
974
+ }
975
+
976
+ if (USE_PROFILES.svgFilters === true) {
977
+ addToSet(ALLOWED_TAGS, svgFilters);
978
+ addToSet(ALLOWED_ATTR, svg$1);
979
+ addToSet(ALLOWED_ATTR, xml);
980
+ }
981
+
982
+ if (USE_PROFILES.mathMl === true) {
983
+ addToSet(ALLOWED_TAGS, mathMl);
984
+ addToSet(ALLOWED_ATTR, mathMl$1);
985
+ addToSet(ALLOWED_ATTR, xml);
986
+ }
987
+ }
988
+
989
+ /* Merge configuration parameters */
990
+ if (cfg.ADD_TAGS) {
991
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
992
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
993
+ }
994
+
995
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS);
996
+ }
997
+
998
+ if (cfg.ADD_ATTR) {
999
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
1000
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
1001
+ }
1002
+
1003
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR);
1004
+ }
1005
+
1006
+ if (cfg.ADD_URI_SAFE_ATTR) {
1007
+ addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR);
1008
+ }
1009
+
1010
+ /* Add #text in case KEEP_CONTENT is set to true */
1011
+ if (KEEP_CONTENT) {
1012
+ ALLOWED_TAGS['#text'] = true;
1013
+ }
1014
+
1015
+ /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
1016
+ if (WHOLE_DOCUMENT) {
1017
+ addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
1018
+ }
1019
+
1020
+ /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
1021
+ if (ALLOWED_TAGS.table) {
1022
+ addToSet(ALLOWED_TAGS, ['tbody']);
1023
+ delete FORBID_TAGS.tbody;
1024
+ }
1025
+
1026
+ // Prevent further manipulation of configuration.
1027
+ // Not available in IE8, Safari 5, etc.
1028
+ if (freeze) {
1029
+ freeze(cfg);
1030
+ }
1031
+
1032
+ CONFIG = cfg;
1033
+ };
1034
+
1035
+ var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
1036
+
1037
+ var HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'desc', 'title', 'annotation-xml']);
1038
+
1039
+ /* Keep track of all possible SVG and MathML tags
1040
+ * so that we can perform the namespace checks
1041
+ * correctly. */
1042
+ var ALL_SVG_TAGS = addToSet({}, svg);
1043
+ addToSet(ALL_SVG_TAGS, svgFilters);
1044
+ addToSet(ALL_SVG_TAGS, svgDisallowed);
1045
+
1046
+ var ALL_MATHML_TAGS = addToSet({}, mathMl);
1047
+ addToSet(ALL_MATHML_TAGS, mathMlDisallowed);
1048
+
1049
+ /**
1050
+ *
1051
+ *
1052
+ * @param {Element} element a DOM element whose namespace is being checked
1053
+ * @returns {boolean} Return false if the element has a
1054
+ * namespace that a spec-compliant parser would never
1055
+ * return. Return true otherwise.
1056
+ */
1057
+ var _checkValidNamespace = function _checkValidNamespace(element) {
1058
+ var parent = getParentNode(element);
1059
+
1060
+ // In JSDOM, if we're inside shadow DOM, then parentNode
1061
+ // can be null. We just simulate parent in this case.
1062
+ if (!parent || !parent.tagName) {
1063
+ parent = {
1064
+ namespaceURI: HTML_NAMESPACE,
1065
+ tagName: 'template'
1066
+ };
1067
+ }
1068
+
1069
+ var tagName = stringToLowerCase(element.tagName);
1070
+ var parentTagName = stringToLowerCase(parent.tagName);
1071
+
1072
+ if (element.namespaceURI === SVG_NAMESPACE) {
1073
+ // The only way to switch from HTML namespace to SVG
1074
+ // is via <svg>. If it happens via any other tag, then
1075
+ // it should be killed.
1076
+ if (parent.namespaceURI === HTML_NAMESPACE) {
1077
+ return tagName === 'svg';
1078
+ }
1079
+
1080
+ // The only way to switch from MathML to SVG is via
1081
+ // svg if parent is either <annotation-xml> or MathML
1082
+ // text integration points.
1083
+ if (parent.namespaceURI === MATHML_NAMESPACE) {
1084
+ return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
1085
+ }
1086
+
1087
+ // We only allow elements that are defined in SVG
1088
+ // spec. All others are disallowed in SVG namespace.
1089
+ return Boolean(ALL_SVG_TAGS[tagName]);
1090
+ }
1091
+
1092
+ if (element.namespaceURI === MATHML_NAMESPACE) {
1093
+ // The only way to switch from HTML namespace to MathML
1094
+ // is via <math>. If it happens via any other tag, then
1095
+ // it should be killed.
1096
+ if (parent.namespaceURI === HTML_NAMESPACE) {
1097
+ return tagName === 'math';
1098
+ }
1099
+
1100
+ // The only way to switch from SVG to MathML is via
1101
+ // <math> and HTML integration points
1102
+ if (parent.namespaceURI === SVG_NAMESPACE) {
1103
+ return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
1104
+ }
1105
+
1106
+ // We only allow elements that are defined in MathML
1107
+ // spec. All others are disallowed in MathML namespace.
1108
+ return Boolean(ALL_MATHML_TAGS[tagName]);
1109
+ }
1110
+
1111
+ if (element.namespaceURI === HTML_NAMESPACE) {
1112
+ // The only way to switch from SVG to HTML is via
1113
+ // HTML integration points, and from MathML to HTML
1114
+ // is via MathML text integration points
1115
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
1116
+ return false;
1117
+ }
1118
+
1119
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
1120
+ return false;
1121
+ }
1122
+
1123
+ // Certain elements are allowed in both SVG and HTML
1124
+ // namespace. We need to specify them explicitly
1125
+ // so that they don't get erronously deleted from
1126
+ // HTML namespace.
1127
+ var commonSvgAndHTMLElements = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
1128
+
1129
+ // We disallow tags that are specific for MathML
1130
+ // or SVG and should never appear in HTML namespace
1131
+ return !ALL_MATHML_TAGS[tagName] && (commonSvgAndHTMLElements[tagName] || !ALL_SVG_TAGS[tagName]);
1132
+ }
1133
+
1134
+ // The code should never reach this place (this means
1135
+ // that the element somehow got namespace that is not
1136
+ // HTML, SVG or MathML). Return false just in case.
1137
+ return false;
1138
+ };
1139
+
1140
+ /**
1141
+ * _forceRemove
1142
+ *
1143
+ * @param {Node} node a DOM node
1144
+ */
1145
+ var _forceRemove = function _forceRemove(node) {
1146
+ arrayPush(DOMPurify.removed, { element: node });
1147
+ try {
1148
+ // eslint-disable-next-line unicorn/prefer-dom-node-remove
1149
+ node.parentNode.removeChild(node);
1150
+ } catch (_) {
1151
+ try {
1152
+ node.outerHTML = emptyHTML;
1153
+ } catch (_) {
1154
+ node.remove();
1155
+ }
1156
+ }
1157
+ };
1158
+
1159
+ /**
1160
+ * _removeAttribute
1161
+ *
1162
+ * @param {String} name an Attribute name
1163
+ * @param {Node} node a DOM node
1164
+ */
1165
+ var _removeAttribute = function _removeAttribute(name, node) {
1166
+ try {
1167
+ arrayPush(DOMPurify.removed, {
1168
+ attribute: node.getAttributeNode(name),
1169
+ from: node
1170
+ });
1171
+ } catch (_) {
1172
+ arrayPush(DOMPurify.removed, {
1173
+ attribute: null,
1174
+ from: node
1175
+ });
1176
+ }
1177
+
1178
+ node.removeAttribute(name);
1179
+
1180
+ // We void attribute values for unremovable "is"" attributes
1181
+ if (name === 'is' && !ALLOWED_ATTR[name]) {
1182
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
1183
+ try {
1184
+ _forceRemove(node);
1185
+ } catch (_) {}
1186
+ } else {
1187
+ try {
1188
+ node.setAttribute(name, '');
1189
+ } catch (_) {}
1190
+ }
1191
+ }
1192
+ };
1193
+
1194
+ /**
1195
+ * _initDocument
1196
+ *
1197
+ * @param {String} dirty a string of dirty markup
1198
+ * @return {Document} a DOM, filled with the dirty markup
1199
+ */
1200
+ var _initDocument = function _initDocument(dirty) {
1201
+ /* Create a HTML document */
1202
+ var doc = void 0;
1203
+ var leadingWhitespace = void 0;
1204
+
1205
+ if (FORCE_BODY) {
1206
+ dirty = '<remove></remove>' + dirty;
1207
+ } else {
1208
+ /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
1209
+ var matches = stringMatch(dirty, /^[\r\n\t ]+/);
1210
+ leadingWhitespace = matches && matches[0];
1211
+ }
1212
+
1213
+ var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
1214
+ /*
1215
+ * Use the DOMParser API by default, fallback later if needs be
1216
+ * DOMParser not work for svg when has multiple root element.
1217
+ */
1218
+ if (NAMESPACE === HTML_NAMESPACE) {
1219
+ try {
1220
+ doc = new DOMParser().parseFromString(dirtyPayload, 'text/html');
1221
+ } catch (_) {}
1222
+ }
1223
+
1224
+ /* Use createHTMLDocument in case DOMParser is not available */
1225
+ if (!doc || !doc.documentElement) {
1226
+ doc = implementation.createDocument(NAMESPACE, 'template', null);
1227
+ try {
1228
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? '' : dirtyPayload;
1229
+ } catch (_) {
1230
+ // Syntax error if dirtyPayload is invalid xml
1231
+ }
1232
+ }
1233
+
1234
+ var body = doc.body || doc.documentElement;
1235
+
1236
+ if (dirty && leadingWhitespace) {
1237
+ body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
1238
+ }
1239
+
1240
+ /* Work on whole document or just its body */
1241
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
1242
+ };
1243
+
1244
+ /**
1245
+ * _createIterator
1246
+ *
1247
+ * @param {Document} root document/fragment to create iterator for
1248
+ * @return {Iterator} iterator instance
1249
+ */
1250
+ var _createIterator = function _createIterator(root) {
1251
+ return createNodeIterator.call(root.ownerDocument || root, root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, null, false);
1252
+ };
1253
+
1254
+ /**
1255
+ * _isClobbered
1256
+ *
1257
+ * @param {Node} elm element to check for clobbering attacks
1258
+ * @return {Boolean} true if clobbered, false if safe
1259
+ */
1260
+ var _isClobbered = function _isClobbered(elm) {
1261
+ if (elm instanceof Text || elm instanceof Comment) {
1262
+ return false;
1263
+ }
1264
+
1265
+ if (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function') {
1266
+ return true;
1267
+ }
1268
+
1269
+ return false;
1270
+ };
1271
+
1272
+ /**
1273
+ * _isNode
1274
+ *
1275
+ * @param {Node} obj object to check whether it's a DOM node
1276
+ * @return {Boolean} true is object is a DOM node
1277
+ */
1278
+ var _isNode = function _isNode(object) {
1279
+ return (typeof Node === 'undefined' ? 'undefined' : _typeof(Node)) === 'object' ? object instanceof Node : object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string';
1280
+ };
1281
+
1282
+ /**
1283
+ * _executeHook
1284
+ * Execute user configurable hooks
1285
+ *
1286
+ * @param {String} entryPoint Name of the hook's entry point
1287
+ * @param {Node} currentNode node to work on with the hook
1288
+ * @param {Object} data additional hook parameters
1289
+ */
1290
+ var _executeHook = function _executeHook(entryPoint, currentNode, data) {
1291
+ if (!hooks[entryPoint]) {
1292
+ return;
1293
+ }
1294
+
1295
+ arrayForEach(hooks[entryPoint], function (hook) {
1296
+ hook.call(DOMPurify, currentNode, data, CONFIG);
1297
+ });
1298
+ };
1299
+
1300
+ /**
1301
+ * _sanitizeElements
1302
+ *
1303
+ * @protect nodeName
1304
+ * @protect textContent
1305
+ * @protect removeChild
1306
+ *
1307
+ * @param {Node} currentNode to check for permission to exist
1308
+ * @return {Boolean} true if node was killed, false if left alive
1309
+ */
1310
+ var _sanitizeElements = function _sanitizeElements(currentNode) {
1311
+ var content = void 0;
1312
+
1313
+ /* Execute a hook if present */
1314
+ _executeHook('beforeSanitizeElements', currentNode, null);
1315
+
1316
+ /* Check if element is clobbered or can clobber */
1317
+ if (_isClobbered(currentNode)) {
1318
+ _forceRemove(currentNode);
1319
+ return true;
1320
+ }
1321
+
1322
+ /* Check if tagname contains Unicode */
1323
+ if (stringMatch(currentNode.nodeName, /[\u0080-\uFFFF]/)) {
1324
+ _forceRemove(currentNode);
1325
+ return true;
1326
+ }
1327
+
1328
+ /* Now let's check the element's type and name */
1329
+ var tagName = stringToLowerCase(currentNode.nodeName);
1330
+
1331
+ /* Execute a hook if present */
1332
+ _executeHook('uponSanitizeElement', currentNode, {
1333
+ tagName: tagName,
1334
+ allowedTags: ALLOWED_TAGS
1335
+ });
1336
+
1337
+ /* Detect mXSS attempts abusing namespace confusion */
1338
+ if (!_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
1339
+ _forceRemove(currentNode);
1340
+ return true;
1341
+ }
1342
+
1343
+ /* Remove element if anything forbids its presence */
1344
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
1345
+ /* Keep content except for bad-listed elements */
1346
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
1347
+ var parentNode = getParentNode(currentNode) || currentNode.parentNode;
1348
+ var childNodes = getChildNodes(currentNode) || currentNode.childNodes;
1349
+
1350
+ if (childNodes && parentNode) {
1351
+ var childCount = childNodes.length;
1352
+
1353
+ for (var i = childCount - 1; i >= 0; --i) {
1354
+ parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
1355
+ }
1356
+ }
1357
+ }
1358
+
1359
+ _forceRemove(currentNode);
1360
+ return true;
1361
+ }
1362
+
1363
+ /* Check whether element has a valid namespace */
1364
+ if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
1365
+ _forceRemove(currentNode);
1366
+ return true;
1367
+ }
1368
+
1369
+ if ((tagName === 'noscript' || tagName === 'noembed') && regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)) {
1370
+ _forceRemove(currentNode);
1371
+ return true;
1372
+ }
1373
+
1374
+ /* Sanitize element content to be template-safe */
1375
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
1376
+ /* Get the element's text content */
1377
+ content = currentNode.textContent;
1378
+ content = stringReplace(content, MUSTACHE_EXPR$$1, ' ');
1379
+ content = stringReplace(content, ERB_EXPR$$1, ' ');
1380
+ if (currentNode.textContent !== content) {
1381
+ arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });
1382
+ currentNode.textContent = content;
1383
+ }
1384
+ }
1385
+
1386
+ /* Execute a hook if present */
1387
+ _executeHook('afterSanitizeElements', currentNode, null);
1388
+
1389
+ return false;
1390
+ };
1391
+
1392
+ /**
1393
+ * _isValidAttribute
1394
+ *
1395
+ * @param {string} lcTag Lowercase tag name of containing element.
1396
+ * @param {string} lcName Lowercase attribute name.
1397
+ * @param {string} value Attribute value.
1398
+ * @return {Boolean} Returns true if `value` is valid, otherwise false.
1399
+ */
1400
+ // eslint-disable-next-line complexity
1401
+ var _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
1402
+ /* Make sure attribute cannot clobber */
1403
+ if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
1404
+ return false;
1405
+ }
1406
+
1407
+ /* Allow valid data-* attributes: At least one character after "-"
1408
+ (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
1409
+ XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
1410
+ We don't need to check the value; it's always URI safe. */
1411
+ if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$$1, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
1412
+ return false;
1413
+
1414
+ /* Check value is safe. First, is attr inert? If so, is safe */
1415
+ } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$$1, stringReplace(value, ATTR_WHITESPACE$$1, ''))) ; else if (!value) ; else {
1416
+ return false;
1417
+ }
1418
+
1419
+ return true;
1420
+ };
1421
+
1422
+ /**
1423
+ * _sanitizeAttributes
1424
+ *
1425
+ * @protect attributes
1426
+ * @protect nodeName
1427
+ * @protect removeAttribute
1428
+ * @protect setAttribute
1429
+ *
1430
+ * @param {Node} currentNode to sanitize
1431
+ */
1432
+ var _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
1433
+ var attr = void 0;
1434
+ var value = void 0;
1435
+ var lcName = void 0;
1436
+ var l = void 0;
1437
+ /* Execute a hook if present */
1438
+ _executeHook('beforeSanitizeAttributes', currentNode, null);
1439
+
1440
+ var attributes = currentNode.attributes;
1441
+
1442
+ /* Check if we have attributes; if not we might have a text node */
1443
+
1444
+ if (!attributes) {
1445
+ return;
1446
+ }
1447
+
1448
+ var hookEvent = {
1449
+ attrName: '',
1450
+ attrValue: '',
1451
+ keepAttr: true,
1452
+ allowedAttributes: ALLOWED_ATTR
1453
+ };
1454
+ l = attributes.length;
1455
+
1456
+ /* Go backwards over all attributes; safely remove bad ones */
1457
+ while (l--) {
1458
+ attr = attributes[l];
1459
+ var _attr = attr,
1460
+ name = _attr.name,
1461
+ namespaceURI = _attr.namespaceURI;
1462
+
1463
+ value = stringTrim(attr.value);
1464
+ lcName = stringToLowerCase(name);
1465
+
1466
+ /* Execute a hook if present */
1467
+ hookEvent.attrName = lcName;
1468
+ hookEvent.attrValue = value;
1469
+ hookEvent.keepAttr = true;
1470
+ hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
1471
+ _executeHook('uponSanitizeAttribute', currentNode, hookEvent);
1472
+ value = hookEvent.attrValue;
1473
+ /* Did the hooks approve of the attribute? */
1474
+ if (hookEvent.forceKeepAttr) {
1475
+ continue;
1476
+ }
1477
+
1478
+ /* Remove attribute */
1479
+ _removeAttribute(name, currentNode);
1480
+
1481
+ /* Did the hooks approve of the attribute? */
1482
+ if (!hookEvent.keepAttr) {
1483
+ continue;
1484
+ }
1485
+
1486
+ /* Work around a security issue in jQuery 3.0 */
1487
+ if (regExpTest(/\/>/i, value)) {
1488
+ _removeAttribute(name, currentNode);
1489
+ continue;
1490
+ }
1491
+
1492
+ /* Sanitize attribute content to be template-safe */
1493
+ if (SAFE_FOR_TEMPLATES) {
1494
+ value = stringReplace(value, MUSTACHE_EXPR$$1, ' ');
1495
+ value = stringReplace(value, ERB_EXPR$$1, ' ');
1496
+ }
1497
+
1498
+ /* Is `value` valid for this attribute? */
1499
+ var lcTag = currentNode.nodeName.toLowerCase();
1500
+ if (!_isValidAttribute(lcTag, lcName, value)) {
1501
+ continue;
1502
+ }
1503
+
1504
+ /* Handle invalid data-* attribute set by try-catching it */
1505
+ try {
1506
+ if (namespaceURI) {
1507
+ currentNode.setAttributeNS(namespaceURI, name, value);
1508
+ } else {
1509
+ /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
1510
+ currentNode.setAttribute(name, value);
1511
+ }
1512
+
1513
+ arrayPop(DOMPurify.removed);
1514
+ } catch (_) {}
1515
+ }
1516
+
1517
+ /* Execute a hook if present */
1518
+ _executeHook('afterSanitizeAttributes', currentNode, null);
1519
+ };
1520
+
1521
+ /**
1522
+ * _sanitizeShadowDOM
1523
+ *
1524
+ * @param {DocumentFragment} fragment to iterate over recursively
1525
+ */
1526
+ var _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
1527
+ var shadowNode = void 0;
1528
+ var shadowIterator = _createIterator(fragment);
1529
+
1530
+ /* Execute a hook if present */
1531
+ _executeHook('beforeSanitizeShadowDOM', fragment, null);
1532
+
1533
+ while (shadowNode = shadowIterator.nextNode()) {
1534
+ /* Execute a hook if present */
1535
+ _executeHook('uponSanitizeShadowNode', shadowNode, null);
1536
+
1537
+ /* Sanitize tags and elements */
1538
+ if (_sanitizeElements(shadowNode)) {
1539
+ continue;
1540
+ }
1541
+
1542
+ /* Deep shadow DOM detected */
1543
+ if (shadowNode.content instanceof DocumentFragment) {
1544
+ _sanitizeShadowDOM(shadowNode.content);
1545
+ }
1546
+
1547
+ /* Check attributes, sanitize if necessary */
1548
+ _sanitizeAttributes(shadowNode);
1549
+ }
1550
+
1551
+ /* Execute a hook if present */
1552
+ _executeHook('afterSanitizeShadowDOM', fragment, null);
1553
+ };
1554
+
1555
+ /**
1556
+ * Sanitize
1557
+ * Public method providing core sanitation functionality
1558
+ *
1559
+ * @param {String|Node} dirty string or DOM node
1560
+ * @param {Object} configuration object
1561
+ */
1562
+ // eslint-disable-next-line complexity
1563
+ DOMPurify.sanitize = function (dirty, cfg) {
1564
+ var body = void 0;
1565
+ var importedNode = void 0;
1566
+ var currentNode = void 0;
1567
+ var oldNode = void 0;
1568
+ var returnNode = void 0;
1569
+ /* Make sure we have a string to sanitize.
1570
+ DO NOT return early, as this will return the wrong type if
1571
+ the user has requested a DOM object rather than a string */
1572
+ IS_EMPTY_INPUT = !dirty;
1573
+ if (IS_EMPTY_INPUT) {
1574
+ dirty = '<!-->';
1575
+ }
1576
+
1577
+ /* Stringify, in case dirty is an object */
1578
+ if (typeof dirty !== 'string' && !_isNode(dirty)) {
1579
+ // eslint-disable-next-line no-negated-condition
1580
+ if (typeof dirty.toString !== 'function') {
1581
+ throw typeErrorCreate('toString is not a function');
1582
+ } else {
1583
+ dirty = dirty.toString();
1584
+ if (typeof dirty !== 'string') {
1585
+ throw typeErrorCreate('dirty is not a string, aborting');
1586
+ }
1587
+ }
1588
+ }
1589
+
1590
+ /* Check we can run. Otherwise fall back or ignore */
1591
+ if (!DOMPurify.isSupported) {
1592
+ if (_typeof(window.toStaticHTML) === 'object' || typeof window.toStaticHTML === 'function') {
1593
+ if (typeof dirty === 'string') {
1594
+ return window.toStaticHTML(dirty);
1595
+ }
1596
+
1597
+ if (_isNode(dirty)) {
1598
+ return window.toStaticHTML(dirty.outerHTML);
1599
+ }
1600
+ }
1601
+
1602
+ return dirty;
1603
+ }
1604
+
1605
+ /* Assign config vars */
1606
+ if (!SET_CONFIG) {
1607
+ _parseConfig(cfg);
1608
+ }
1609
+
1610
+ /* Clean up removed elements */
1611
+ DOMPurify.removed = [];
1612
+
1613
+ /* Check if dirty is correctly typed for IN_PLACE */
1614
+ if (typeof dirty === 'string') {
1615
+ IN_PLACE = false;
1616
+ }
1617
+
1618
+ if (IN_PLACE) ; else if (dirty instanceof Node) {
1619
+ /* If dirty is a DOM element, append to an empty document to avoid
1620
+ elements being stripped by the parser */
1621
+ body = _initDocument('<!---->');
1622
+ importedNode = body.ownerDocument.importNode(dirty, true);
1623
+ if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {
1624
+ /* Node is already a body, use as is */
1625
+ body = importedNode;
1626
+ } else if (importedNode.nodeName === 'HTML') {
1627
+ body = importedNode;
1628
+ } else {
1629
+ // eslint-disable-next-line unicorn/prefer-dom-node-append
1630
+ body.appendChild(importedNode);
1631
+ }
1632
+ } else {
1633
+ /* Exit directly if we have nothing to do */
1634
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
1635
+ // eslint-disable-next-line unicorn/prefer-includes
1636
+ dirty.indexOf('<') === -1) {
1637
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
1638
+ }
1639
+
1640
+ /* Initialize the document to work on */
1641
+ body = _initDocument(dirty);
1642
+
1643
+ /* Check we have a DOM node from the data */
1644
+ if (!body) {
1645
+ return RETURN_DOM ? null : emptyHTML;
1646
+ }
1647
+ }
1648
+
1649
+ /* Remove first element node (ours) if FORCE_BODY is set */
1650
+ if (body && FORCE_BODY) {
1651
+ _forceRemove(body.firstChild);
1652
+ }
1653
+
1654
+ /* Get node iterator */
1655
+ var nodeIterator = _createIterator(IN_PLACE ? dirty : body);
1656
+
1657
+ /* Now start iterating over the created document */
1658
+ while (currentNode = nodeIterator.nextNode()) {
1659
+ /* Fix IE's strange behavior with manipulated textNodes #89 */
1660
+ if (currentNode.nodeType === 3 && currentNode === oldNode) {
1661
+ continue;
1662
+ }
1663
+
1664
+ /* Sanitize tags and elements */
1665
+ if (_sanitizeElements(currentNode)) {
1666
+ continue;
1667
+ }
1668
+
1669
+ /* Shadow DOM detected, sanitize it */
1670
+ if (currentNode.content instanceof DocumentFragment) {
1671
+ _sanitizeShadowDOM(currentNode.content);
1672
+ }
1673
+
1674
+ /* Check attributes, sanitize if necessary */
1675
+ _sanitizeAttributes(currentNode);
1676
+
1677
+ oldNode = currentNode;
1678
+ }
1679
+
1680
+ oldNode = null;
1681
+
1682
+ /* If we sanitized `dirty` in-place, return it. */
1683
+ if (IN_PLACE) {
1684
+ return dirty;
1685
+ }
1686
+
1687
+ /* Return sanitized string or DOM */
1688
+ if (RETURN_DOM) {
1689
+ if (RETURN_DOM_FRAGMENT) {
1690
+ returnNode = createDocumentFragment.call(body.ownerDocument);
1691
+
1692
+ while (body.firstChild) {
1693
+ // eslint-disable-next-line unicorn/prefer-dom-node-append
1694
+ returnNode.appendChild(body.firstChild);
1695
+ }
1696
+ } else {
1697
+ returnNode = body;
1698
+ }
1699
+
1700
+ if (RETURN_DOM_IMPORT) {
1701
+ /*
1702
+ AdoptNode() is not used because internal state is not reset
1703
+ (e.g. the past names map of a HTMLFormElement), this is safe
1704
+ in theory but we would rather not risk another attack vector.
1705
+ The state that is cloned by importNode() is explicitly defined
1706
+ by the specs.
1707
+ */
1708
+ returnNode = importNode.call(originalDocument, returnNode, true);
1709
+ }
1710
+
1711
+ return returnNode;
1712
+ }
1713
+
1714
+ var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
1715
+
1716
+ /* Sanitize final string template-safe */
1717
+ if (SAFE_FOR_TEMPLATES) {
1718
+ serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$$1, ' ');
1719
+ serializedHTML = stringReplace(serializedHTML, ERB_EXPR$$1, ' ');
1720
+ }
1721
+
1722
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
1723
+ };
1724
+
1725
+ /**
1726
+ * Public method to set the configuration once
1727
+ * setConfig
1728
+ *
1729
+ * @param {Object} cfg configuration object
1730
+ */
1731
+ DOMPurify.setConfig = function (cfg) {
1732
+ _parseConfig(cfg);
1733
+ SET_CONFIG = true;
1734
+ };
1735
+
1736
+ /**
1737
+ * Public method to remove the configuration
1738
+ * clearConfig
1739
+ *
1740
+ */
1741
+ DOMPurify.clearConfig = function () {
1742
+ CONFIG = null;
1743
+ SET_CONFIG = false;
1744
+ };
1745
+
1746
+ /**
1747
+ * Public method to check if an attribute value is valid.
1748
+ * Uses last set config, if any. Otherwise, uses config defaults.
1749
+ * isValidAttribute
1750
+ *
1751
+ * @param {string} tag Tag name of containing element.
1752
+ * @param {string} attr Attribute name.
1753
+ * @param {string} value Attribute value.
1754
+ * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.
1755
+ */
1756
+ DOMPurify.isValidAttribute = function (tag, attr, value) {
1757
+ /* Initialize shared config vars if necessary. */
1758
+ if (!CONFIG) {
1759
+ _parseConfig({});
1760
+ }
1761
+
1762
+ var lcTag = stringToLowerCase(tag);
1763
+ var lcName = stringToLowerCase(attr);
1764
+ return _isValidAttribute(lcTag, lcName, value);
1765
+ };
1766
+
1767
+ /**
1768
+ * AddHook
1769
+ * Public method to add DOMPurify hooks
1770
+ *
1771
+ * @param {String} entryPoint entry point for the hook to add
1772
+ * @param {Function} hookFunction function to execute
1773
+ */
1774
+ DOMPurify.addHook = function (entryPoint, hookFunction) {
1775
+ if (typeof hookFunction !== 'function') {
1776
+ return;
1777
+ }
1778
+
1779
+ hooks[entryPoint] = hooks[entryPoint] || [];
1780
+ arrayPush(hooks[entryPoint], hookFunction);
1781
+ };
1782
+
1783
+ /**
1784
+ * RemoveHook
1785
+ * Public method to remove a DOMPurify hook at a given entryPoint
1786
+ * (pops it from the stack of hooks if more are present)
1787
+ *
1788
+ * @param {String} entryPoint entry point for the hook to remove
1789
+ */
1790
+ DOMPurify.removeHook = function (entryPoint) {
1791
+ if (hooks[entryPoint]) {
1792
+ arrayPop(hooks[entryPoint]);
1793
+ }
1794
+ };
1795
+
1796
+ /**
1797
+ * RemoveHooks
1798
+ * Public method to remove all DOMPurify hooks at a given entryPoint
1799
+ *
1800
+ * @param {String} entryPoint entry point for the hooks to remove
1801
+ */
1802
+ DOMPurify.removeHooks = function (entryPoint) {
1803
+ if (hooks[entryPoint]) {
1804
+ hooks[entryPoint] = [];
1805
+ }
1806
+ };
1807
+
1808
+ /**
1809
+ * RemoveAllHooks
1810
+ * Public method to remove all DOMPurify hooks
1811
+ *
1812
+ */
1813
+ DOMPurify.removeAllHooks = function () {
1814
+ hooks = {};
1815
+ };
1816
+
1817
+ return DOMPurify;
1818
+ }
1819
+
1820
+ var purify = createDOMPurify();
1821
+
1822
+ return purify;
1823
+
1824
+ }));
1825
+ //# sourceMappingURL=purify.js.map
1826
+
1827
+
1828
+ /***/ }),
1829
+
1830
+ /***/ 6808:
1831
+ /***/ ((module, exports, __webpack_require__) => {
1832
+
1833
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
1834
+ * JavaScript Cookie v2.2.1
1835
+ * https://github.com/js-cookie/js-cookie
1836
+ *
1837
+ * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
1838
+ * Released under the MIT license
1839
+ */
1840
+ ;(function (factory) {
1841
+ var registeredInModuleLoader;
1842
+ if (true) {
1843
+ !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
1844
+ __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
1845
+ (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
1846
+ __WEBPACK_AMD_DEFINE_FACTORY__),
1847
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
1848
+ registeredInModuleLoader = true;
1849
+ }
1850
+ if (true) {
1851
+ module.exports = factory();
1852
+ registeredInModuleLoader = true;
1853
+ }
1854
+ if (!registeredInModuleLoader) {
1855
+ var OldCookies = window.Cookies;
1856
+ var api = window.Cookies = factory();
1857
+ api.noConflict = function () {
1858
+ window.Cookies = OldCookies;
1859
+ return api;
1860
+ };
1861
+ }
1862
+ }(function () {
1863
+ function extend () {
1864
+ var i = 0;
1865
+ var result = {};
1866
+ for (; i < arguments.length; i++) {
1867
+ var attributes = arguments[ i ];
1868
+ for (var key in attributes) {
1869
+ result[key] = attributes[key];
1870
+ }
1871
+ }
1872
+ return result;
1873
+ }
1874
+
1875
+ function decode (s) {
1876
+ return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
1877
+ }
1878
+
1879
+ function init (converter) {
1880
+ function api() {}
1881
+
1882
+ function set (key, value, attributes) {
1883
+ if (typeof document === 'undefined') {
1884
+ return;
1885
+ }
1886
+
1887
+ attributes = extend({
1888
+ path: '/'
1889
+ }, api.defaults, attributes);
1890
+
1891
+ if (typeof attributes.expires === 'number') {
1892
+ attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
1893
+ }
1894
+
1895
+ // We're using "expires" because "max-age" is not supported by IE
1896
+ attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
1897
+
1898
+ try {
1899
+ var result = JSON.stringify(value);
1900
+ if (/^[\{\[]/.test(result)) {
1901
+ value = result;
1902
+ }
1903
+ } catch (e) {}
1904
+
1905
+ value = converter.write ?
1906
+ converter.write(value, key) :
1907
+ encodeURIComponent(String(value))
1908
+ .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
1909
+
1910
+ key = encodeURIComponent(String(key))
1911
+ .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
1912
+ .replace(/[\(\)]/g, escape);
1913
+
1914
+ var stringifiedAttributes = '';
1915
+ for (var attributeName in attributes) {
1916
+ if (!attributes[attributeName]) {
1917
+ continue;
1918
+ }
1919
+ stringifiedAttributes += '; ' + attributeName;
1920
+ if (attributes[attributeName] === true) {
1921
+ continue;
1922
+ }
1923
+
1924
+ // Considers RFC 6265 section 5.2:
1925
+ // ...
1926
+ // 3. If the remaining unparsed-attributes contains a %x3B (";")
1927
+ // character:
1928
+ // Consume the characters of the unparsed-attributes up to,
1929
+ // not including, the first %x3B (";") character.
1930
+ // ...
1931
+ stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
1932
+ }
1933
+
1934
+ return (document.cookie = key + '=' + value + stringifiedAttributes);
1935
+ }
1936
+
1937
+ function get (key, json) {
1938
+ if (typeof document === 'undefined') {
1939
+ return;
1940
+ }
1941
+
1942
+ var jar = {};
1943
+ // To prevent the for loop in the first place assign an empty array
1944
+ // in case there are no cookies at all.
1945
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
1946
+ var i = 0;
1947
+
1948
+ for (; i < cookies.length; i++) {
1949
+ var parts = cookies[i].split('=');
1950
+ var cookie = parts.slice(1).join('=');
1951
+
1952
+ if (!json && cookie.charAt(0) === '"') {
1953
+ cookie = cookie.slice(1, -1);
1954
+ }
1955
+
1956
+ try {
1957
+ var name = decode(parts[0]);
1958
+ cookie = (converter.read || converter)(cookie, name) ||
1959
+ decode(cookie);
1960
+
1961
+ if (json) {
1962
+ try {
1963
+ cookie = JSON.parse(cookie);
1964
+ } catch (e) {}
1965
+ }
1966
+
1967
+ jar[name] = cookie;
1968
+
1969
+ if (key === name) {
1970
+ break;
1971
+ }
1972
+ } catch (e) {}
1973
+ }
1974
+
1975
+ return key ? jar[key] : jar;
1976
+ }
1977
+
1978
+ api.set = set;
1979
+ api.get = function (key) {
1980
+ return get(key, false /* read as raw */);
1981
+ };
1982
+ api.getJSON = function (key) {
1983
+ return get(key, true /* read as json */);
1984
+ };
1985
+ api.remove = function (key, attributes) {
1986
+ set(key, '', extend(attributes, {
1987
+ expires: -1
1988
+ }));
1989
+ };
1990
+
1991
+ api.defaults = {};
1992
+
1993
+ api.withConverter = init;
1994
+
1995
+ return api;
1996
+ }
1997
+
1998
+ return init(function () {});
1999
+ }));
2000
+
2001
+
2002
+ /***/ }),
2003
+
2004
+ /***/ 3096:
2005
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2006
+
2007
+ /**
2008
+ * lodash (Custom Build) <https://lodash.com/>
2009
+ * Build: `lodash modularize exports="npm" -o ./`
2010
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
2011
+ * Released under MIT license <https://lodash.com/license>
2012
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
2013
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
2014
+ */
2015
+
2016
+ /** Used as the `TypeError` message for "Functions" methods. */
2017
+ var FUNC_ERROR_TEXT = 'Expected a function';
2018
+
2019
+ /** Used as references for various `Number` constants. */
2020
+ var NAN = 0 / 0;
2021
+
2022
+ /** `Object#toString` result references. */
2023
+ var symbolTag = '[object Symbol]';
2024
+
2025
+ /** Used to match leading and trailing whitespace. */
2026
+ var reTrim = /^\s+|\s+$/g;
2027
+
2028
+ /** Used to detect bad signed hexadecimal string values. */
2029
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
2030
+
2031
+ /** Used to detect binary string values. */
2032
+ var reIsBinary = /^0b[01]+$/i;
2033
+
2034
+ /** Used to detect octal string values. */
2035
+ var reIsOctal = /^0o[0-7]+$/i;
2036
+
2037
+ /** Built-in method references without a dependency on `root`. */
2038
+ var freeParseInt = parseInt;
2039
+
2040
+ /** Detect free variable `global` from Node.js. */
2041
+ var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
2042
+
2043
+ /** Detect free variable `self`. */
2044
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
2045
+
2046
+ /** Used as a reference to the global object. */
2047
+ var root = freeGlobal || freeSelf || Function('return this')();
2048
+
2049
+ /** Used for built-in method references. */
2050
+ var objectProto = Object.prototype;
2051
+
2052
+ /**
2053
+ * Used to resolve the
2054
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
2055
+ * of values.
2056
+ */
2057
+ var objectToString = objectProto.toString;
2058
+
2059
+ /* Built-in method references for those with the same name as other `lodash` methods. */
2060
+ var nativeMax = Math.max,
2061
+ nativeMin = Math.min;
2062
+
2063
+ /**
2064
+ * Gets the timestamp of the number of milliseconds that have elapsed since
2065
+ * the Unix epoch (1 January 1970 00:00:00 UTC).
2066
+ *
2067
+ * @static
2068
+ * @memberOf _
2069
+ * @since 2.4.0
2070
+ * @category Date
2071
+ * @returns {number} Returns the timestamp.
2072
+ * @example
2073
+ *
2074
+ * _.defer(function(stamp) {
2075
+ * console.log(_.now() - stamp);
2076
+ * }, _.now());
2077
+ * // => Logs the number of milliseconds it took for the deferred invocation.
2078
+ */
2079
+ var now = function() {
2080
+ return root.Date.now();
2081
+ };
2082
+
2083
+ /**
2084
+ * Creates a debounced function that delays invoking `func` until after `wait`
2085
+ * milliseconds have elapsed since the last time the debounced function was
2086
+ * invoked. The debounced function comes with a `cancel` method to cancel
2087
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
2088
+ * Provide `options` to indicate whether `func` should be invoked on the
2089
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
2090
+ * with the last arguments provided to the debounced function. Subsequent
2091
+ * calls to the debounced function return the result of the last `func`
2092
+ * invocation.
2093
+ *
2094
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
2095
+ * invoked on the trailing edge of the timeout only if the debounced function
2096
+ * is invoked more than once during the `wait` timeout.
2097
+ *
2098
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
2099
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
2100
+ *
2101
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
2102
+ * for details over the differences between `_.debounce` and `_.throttle`.
2103
+ *
2104
+ * @static
2105
+ * @memberOf _
2106
+ * @since 0.1.0
2107
+ * @category Function
2108
+ * @param {Function} func The function to debounce.
2109
+ * @param {number} [wait=0] The number of milliseconds to delay.
2110
+ * @param {Object} [options={}] The options object.
2111
+ * @param {boolean} [options.leading=false]
2112
+ * Specify invoking on the leading edge of the timeout.
2113
+ * @param {number} [options.maxWait]
2114
+ * The maximum time `func` is allowed to be delayed before it's invoked.
2115
+ * @param {boolean} [options.trailing=true]
2116
+ * Specify invoking on the trailing edge of the timeout.
2117
+ * @returns {Function} Returns the new debounced function.
2118
+ * @example
2119
+ *
2120
+ * // Avoid costly calculations while the window size is in flux.
2121
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
2122
+ *
2123
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
2124
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
2125
+ * 'leading': true,
2126
+ * 'trailing': false
2127
+ * }));
2128
+ *
2129
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
2130
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
2131
+ * var source = new EventSource('/stream');
2132
+ * jQuery(source).on('message', debounced);
2133
+ *
2134
+ * // Cancel the trailing debounced invocation.
2135
+ * jQuery(window).on('popstate', debounced.cancel);
2136
+ */
2137
+ function debounce(func, wait, options) {
2138
+ var lastArgs,
2139
+ lastThis,
2140
+ maxWait,
2141
+ result,
2142
+ timerId,
2143
+ lastCallTime,
2144
+ lastInvokeTime = 0,
2145
+ leading = false,
2146
+ maxing = false,
2147
+ trailing = true;
2148
+
2149
+ if (typeof func != 'function') {
2150
+ throw new TypeError(FUNC_ERROR_TEXT);
2151
+ }
2152
+ wait = toNumber(wait) || 0;
2153
+ if (isObject(options)) {
2154
+ leading = !!options.leading;
2155
+ maxing = 'maxWait' in options;
2156
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
2157
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
2158
+ }
2159
+
2160
+ function invokeFunc(time) {
2161
+ var args = lastArgs,
2162
+ thisArg = lastThis;
2163
+
2164
+ lastArgs = lastThis = undefined;
2165
+ lastInvokeTime = time;
2166
+ result = func.apply(thisArg, args);
2167
+ return result;
2168
+ }
2169
+
2170
+ function leadingEdge(time) {
2171
+ // Reset any `maxWait` timer.
2172
+ lastInvokeTime = time;
2173
+ // Start the timer for the trailing edge.
2174
+ timerId = setTimeout(timerExpired, wait);
2175
+ // Invoke the leading edge.
2176
+ return leading ? invokeFunc(time) : result;
2177
+ }
2178
+
2179
+ function remainingWait(time) {
2180
+ var timeSinceLastCall = time - lastCallTime,
2181
+ timeSinceLastInvoke = time - lastInvokeTime,
2182
+ result = wait - timeSinceLastCall;
2183
+
2184
+ return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
2185
+ }
2186
+
2187
+ function shouldInvoke(time) {
2188
+ var timeSinceLastCall = time - lastCallTime,
2189
+ timeSinceLastInvoke = time - lastInvokeTime;
2190
+
2191
+ // Either this is the first call, activity has stopped and we're at the
2192
+ // trailing edge, the system time has gone backwards and we're treating
2193
+ // it as the trailing edge, or we've hit the `maxWait` limit.
2194
+ return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
2195
+ (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
2196
+ }
2197
+
2198
+ function timerExpired() {
2199
+ var time = now();
2200
+ if (shouldInvoke(time)) {
2201
+ return trailingEdge(time);
2202
+ }
2203
+ // Restart the timer.
2204
+ timerId = setTimeout(timerExpired, remainingWait(time));
2205
+ }
2206
+
2207
+ function trailingEdge(time) {
2208
+ timerId = undefined;
2209
+
2210
+ // Only invoke if we have `lastArgs` which means `func` has been
2211
+ // debounced at least once.
2212
+ if (trailing && lastArgs) {
2213
+ return invokeFunc(time);
2214
+ }
2215
+ lastArgs = lastThis = undefined;
2216
+ return result;
2217
+ }
2218
+
2219
+ function cancel() {
2220
+ if (timerId !== undefined) {
2221
+ clearTimeout(timerId);
2222
+ }
2223
+ lastInvokeTime = 0;
2224
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
2225
+ }
2226
+
2227
+ function flush() {
2228
+ return timerId === undefined ? result : trailingEdge(now());
2229
+ }
2230
+
2231
+ function debounced() {
2232
+ var time = now(),
2233
+ isInvoking = shouldInvoke(time);
2234
+
2235
+ lastArgs = arguments;
2236
+ lastThis = this;
2237
+ lastCallTime = time;
2238
+
2239
+ if (isInvoking) {
2240
+ if (timerId === undefined) {
2241
+ return leadingEdge(lastCallTime);
2242
+ }
2243
+ if (maxing) {
2244
+ // Handle invocations in a tight loop.
2245
+ timerId = setTimeout(timerExpired, wait);
2246
+ return invokeFunc(lastCallTime);
2247
+ }
2248
+ }
2249
+ if (timerId === undefined) {
2250
+ timerId = setTimeout(timerExpired, wait);
2251
+ }
2252
+ return result;
2253
+ }
2254
+ debounced.cancel = cancel;
2255
+ debounced.flush = flush;
2256
+ return debounced;
2257
+ }
2258
+
2259
+ /**
2260
+ * Creates a throttled function that only invokes `func` at most once per
2261
+ * every `wait` milliseconds. The throttled function comes with a `cancel`
2262
+ * method to cancel delayed `func` invocations and a `flush` method to
2263
+ * immediately invoke them. Provide `options` to indicate whether `func`
2264
+ * should be invoked on the leading and/or trailing edge of the `wait`
2265
+ * timeout. The `func` is invoked with the last arguments provided to the
2266
+ * throttled function. Subsequent calls to the throttled function return the
2267
+ * result of the last `func` invocation.
2268
+ *
2269
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
2270
+ * invoked on the trailing edge of the timeout only if the throttled function
2271
+ * is invoked more than once during the `wait` timeout.
2272
+ *
2273
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
2274
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
2275
+ *
2276
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
2277
+ * for details over the differences between `_.throttle` and `_.debounce`.
2278
+ *
2279
+ * @static
2280
+ * @memberOf _
2281
+ * @since 0.1.0
2282
+ * @category Function
2283
+ * @param {Function} func The function to throttle.
2284
+ * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
2285
+ * @param {Object} [options={}] The options object.
2286
+ * @param {boolean} [options.leading=true]
2287
+ * Specify invoking on the leading edge of the timeout.
2288
+ * @param {boolean} [options.trailing=true]
2289
+ * Specify invoking on the trailing edge of the timeout.
2290
+ * @returns {Function} Returns the new throttled function.
2291
+ * @example
2292
+ *
2293
+ * // Avoid excessively updating the position while scrolling.
2294
+ * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
2295
+ *
2296
+ * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
2297
+ * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
2298
+ * jQuery(element).on('click', throttled);
2299
+ *
2300
+ * // Cancel the trailing throttled invocation.
2301
+ * jQuery(window).on('popstate', throttled.cancel);
2302
+ */
2303
+ function throttle(func, wait, options) {
2304
+ var leading = true,
2305
+ trailing = true;
2306
+
2307
+ if (typeof func != 'function') {
2308
+ throw new TypeError(FUNC_ERROR_TEXT);
2309
+ }
2310
+ if (isObject(options)) {
2311
+ leading = 'leading' in options ? !!options.leading : leading;
2312
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
2313
+ }
2314
+ return debounce(func, wait, {
2315
+ 'leading': leading,
2316
+ 'maxWait': wait,
2317
+ 'trailing': trailing
2318
+ });
2319
+ }
2320
+
2321
+ /**
2322
+ * Checks if `value` is the
2323
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
2324
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
2325
+ *
2326
+ * @static
2327
+ * @memberOf _
2328
+ * @since 0.1.0
2329
+ * @category Lang
2330
+ * @param {*} value The value to check.
2331
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
2332
+ * @example
2333
+ *
2334
+ * _.isObject({});
2335
+ * // => true
2336
+ *
2337
+ * _.isObject([1, 2, 3]);
2338
+ * // => true
2339
+ *
2340
+ * _.isObject(_.noop);
2341
+ * // => true
2342
+ *
2343
+ * _.isObject(null);
2344
+ * // => false
2345
+ */
2346
+ function isObject(value) {
2347
+ var type = typeof value;
2348
+ return !!value && (type == 'object' || type == 'function');
2349
+ }
2350
+
2351
+ /**
2352
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
2353
+ * and has a `typeof` result of "object".
2354
+ *
2355
+ * @static
2356
+ * @memberOf _
2357
+ * @since 4.0.0
2358
+ * @category Lang
2359
+ * @param {*} value The value to check.
2360
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
2361
+ * @example
2362
+ *
2363
+ * _.isObjectLike({});
2364
+ * // => true
2365
+ *
2366
+ * _.isObjectLike([1, 2, 3]);
2367
+ * // => true
2368
+ *
2369
+ * _.isObjectLike(_.noop);
2370
+ * // => false
2371
+ *
2372
+ * _.isObjectLike(null);
2373
+ * // => false
2374
+ */
2375
+ function isObjectLike(value) {
2376
+ return !!value && typeof value == 'object';
2377
+ }
2378
+
2379
+ /**
2380
+ * Checks if `value` is classified as a `Symbol` primitive or object.
2381
+ *
2382
+ * @static
2383
+ * @memberOf _
2384
+ * @since 4.0.0
2385
+ * @category Lang
2386
+ * @param {*} value The value to check.
2387
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
2388
+ * @example
2389
+ *
2390
+ * _.isSymbol(Symbol.iterator);
2391
+ * // => true
2392
+ *
2393
+ * _.isSymbol('abc');
2394
+ * // => false
2395
+ */
2396
+ function isSymbol(value) {
2397
+ return typeof value == 'symbol' ||
2398
+ (isObjectLike(value) && objectToString.call(value) == symbolTag);
2399
+ }
2400
+
2401
+ /**
2402
+ * Converts `value` to a number.
2403
+ *
2404
+ * @static
2405
+ * @memberOf _
2406
+ * @since 4.0.0
2407
+ * @category Lang
2408
+ * @param {*} value The value to process.
2409
+ * @returns {number} Returns the number.
2410
+ * @example
2411
+ *
2412
+ * _.toNumber(3.2);
2413
+ * // => 3.2
2414
+ *
2415
+ * _.toNumber(Number.MIN_VALUE);
2416
+ * // => 5e-324
2417
+ *
2418
+ * _.toNumber(Infinity);
2419
+ * // => Infinity
2420
+ *
2421
+ * _.toNumber('3.2');
2422
+ * // => 3.2
2423
+ */
2424
+ function toNumber(value) {
2425
+ if (typeof value == 'number') {
2426
+ return value;
2427
+ }
2428
+ if (isSymbol(value)) {
2429
+ return NAN;
2430
+ }
2431
+ if (isObject(value)) {
2432
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
2433
+ value = isObject(other) ? (other + '') : other;
2434
+ }
2435
+ if (typeof value != 'string') {
2436
+ return value === 0 ? value : +value;
2437
+ }
2438
+ value = value.replace(reTrim, '');
2439
+ var isBinary = reIsBinary.test(value);
2440
+ return (isBinary || reIsOctal.test(value))
2441
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
2442
+ : (reIsBadHex.test(value) ? NAN : +value);
2443
+ }
2444
+
2445
+ module.exports = throttle;
2446
+
2447
+
2448
+ /***/ }),
2449
+
2450
+ /***/ 2703:
2451
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2452
+
2453
+ "use strict";
2454
+ /**
2455
+ * Copyright (c) 2013-present, Facebook, Inc.
2456
+ *
2457
+ * This source code is licensed under the MIT license found in the
2458
+ * LICENSE file in the root directory of this source tree.
2459
+ */
2460
+
2461
+
2462
+
2463
+ var ReactPropTypesSecret = __webpack_require__(414);
2464
+
2465
+ function emptyFunction() {}
2466
+ function emptyFunctionWithReset() {}
2467
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
2468
+
2469
+ module.exports = function() {
2470
+ function shim(props, propName, componentName, location, propFullName, secret) {
2471
+ if (secret === ReactPropTypesSecret) {
2472
+ // It is still safe when called from React.
2473
+ return;
2474
+ }
2475
+ var err = new Error(
2476
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
2477
+ 'Use PropTypes.checkPropTypes() to call them. ' +
2478
+ 'Read more at http://fb.me/use-check-prop-types'
2479
+ );
2480
+ err.name = 'Invariant Violation';
2481
+ throw err;
2482
+ };
2483
+ shim.isRequired = shim;
2484
+ function getShim() {
2485
+ return shim;
2486
+ };
2487
+ // Important!
2488
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
2489
+ var ReactPropTypes = {
2490
+ array: shim,
2491
+ bool: shim,
2492
+ func: shim,
2493
+ number: shim,
2494
+ object: shim,
2495
+ string: shim,
2496
+ symbol: shim,
2497
+
2498
+ any: shim,
2499
+ arrayOf: getShim,
2500
+ element: shim,
2501
+ elementType: shim,
2502
+ instanceOf: getShim,
2503
+ node: shim,
2504
+ objectOf: getShim,
2505
+ oneOf: getShim,
2506
+ oneOfType: getShim,
2507
+ shape: getShim,
2508
+ exact: getShim,
2509
+
2510
+ checkPropTypes: emptyFunctionWithReset,
2511
+ resetWarningCache: emptyFunction
2512
+ };
2513
+
2514
+ ReactPropTypes.PropTypes = ReactPropTypes;
2515
+
2516
+ return ReactPropTypes;
2517
+ };
2518
+
2519
+
2520
+ /***/ }),
2521
+
2522
+ /***/ 5697:
2523
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2524
+
2525
+ /**
2526
+ * Copyright (c) 2013-present, Facebook, Inc.
2527
+ *
2528
+ * This source code is licensed under the MIT license found in the
2529
+ * LICENSE file in the root directory of this source tree.
2530
+ */
2531
+
2532
+ if (false) { var throwOnDirectAccess, ReactIs; } else {
2533
+ // By explicitly using `prop-types` you are opting into new production behavior.
2534
+ // http://fb.me/prop-types-in-prod
2535
+ module.exports = __webpack_require__(2703)();
2536
+ }
2537
+
2538
+
2539
+ /***/ }),
2540
+
2541
+ /***/ 414:
2542
+ /***/ ((module) => {
2543
+
2544
+ "use strict";
2545
+ /**
2546
+ * Copyright (c) 2013-present, Facebook, Inc.
2547
+ *
2548
+ * This source code is licensed under the MIT license found in the
2549
+ * LICENSE file in the root directory of this source tree.
2550
+ */
2551
+
2552
+
2553
+
2554
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
2555
+
2556
+ module.exports = ReactPropTypesSecret;
2557
+
2558
+
2559
+ /***/ }),
2560
+
2561
+ /***/ 9281:
2562
+ /***/ ((module) => {
2563
+
2564
+ "use strict";
2565
+ module.exports = __WEBPACK_EXTERNAL_MODULE__9281__;
2566
+
2567
+ /***/ })
2568
+
2569
+ /******/ });
2570
+ /************************************************************************/
2571
+ /******/ // The module cache
2572
+ /******/ var __webpack_module_cache__ = {};
2573
+ /******/
2574
+ /******/ // The require function
2575
+ /******/ function __webpack_require__(moduleId) {
2576
+ /******/ // Check if module is in cache
2577
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
2578
+ /******/ if (cachedModule !== undefined) {
2579
+ /******/ return cachedModule.exports;
2580
+ /******/ }
2581
+ /******/ // Create a new module (and put it into the cache)
2582
+ /******/ var module = __webpack_module_cache__[moduleId] = {
2583
+ /******/ // no module.id needed
2584
+ /******/ // no module.loaded needed
2585
+ /******/ exports: {}
2586
+ /******/ };
2587
+ /******/
2588
+ /******/ // Execute the module function
2589
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
2590
+ /******/
2591
+ /******/ // Return the exports of the module
2592
+ /******/ return module.exports;
2593
+ /******/ }
2594
+ /******/
2595
+ /************************************************************************/
2596
+ /******/ /* webpack/runtime/compat get default export */
2597
+ /******/ (() => {
2598
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
2599
+ /******/ __webpack_require__.n = (module) => {
2600
+ /******/ var getter = module && module.__esModule ?
2601
+ /******/ () => (module['default']) :
2602
+ /******/ () => (module);
2603
+ /******/ __webpack_require__.d(getter, { a: getter });
2604
+ /******/ return getter;
2605
+ /******/ };
2606
+ /******/ })();
2607
+ /******/
2608
+ /******/ /* webpack/runtime/define property getters */
2609
+ /******/ (() => {
2610
+ /******/ // define getter functions for harmony exports
2611
+ /******/ __webpack_require__.d = (exports, definition) => {
2612
+ /******/ for(var key in definition) {
2613
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
2614
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
2615
+ /******/ }
2616
+ /******/ }
2617
+ /******/ };
2618
+ /******/ })();
2619
+ /******/
2620
+ /******/ /* webpack/runtime/global */
2621
+ /******/ (() => {
2622
+ /******/ __webpack_require__.g = (function() {
2623
+ /******/ if (typeof globalThis === 'object') return globalThis;
2624
+ /******/ try {
2625
+ /******/ return this || new Function('return this')();
2626
+ /******/ } catch (e) {
2627
+ /******/ if (typeof window === 'object') return window;
2628
+ /******/ }
2629
+ /******/ })();
2630
+ /******/ })();
2631
+ /******/
2632
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
2633
+ /******/ (() => {
2634
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
2635
+ /******/ })();
2636
+ /******/
2637
+ /******/ /* webpack/runtime/make namespace object */
2638
+ /******/ (() => {
2639
+ /******/ // define __esModule on exports
2640
+ /******/ __webpack_require__.r = (exports) => {
2641
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2642
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2643
+ /******/ }
2644
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
2645
+ /******/ };
2646
+ /******/ })();
2647
+ /******/
2648
+ /************************************************************************/
2649
+ var __webpack_exports__ = {};
2650
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
2651
+ (() => {
2652
+ "use strict";
2653
+ // ESM COMPAT FLAG
2654
+ __webpack_require__.r(__webpack_exports__);
2655
+
2656
+ // EXPORTS
2657
+ __webpack_require__.d(__webpack_exports__, {
2658
+ "default": () => (/* binding */ core_Notice_component)
2659
+ });
2660
+
2661
+ // EXTERNAL MODULE: external {"commonjs":"react","commonjs2":"react"}
2662
+ var external_commonjs_react_commonjs2_react_ = __webpack_require__(9281);
2663
+ var external_commonjs_react_commonjs2_react_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_react_commonjs2_react_);
2664
+ // EXTERNAL MODULE: ./node_modules/prop-types/index.js
2665
+ var prop_types = __webpack_require__(5697);
2666
+ var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
2667
+ // EXTERNAL MODULE: ./node_modules/js-cookie/src/js.cookie.js
2668
+ var js_cookie = __webpack_require__(6808);
2669
+ var js_cookie_default = /*#__PURE__*/__webpack_require__.n(js_cookie);
2670
+ // EXTERNAL MODULE: ./node_modules/lodash.throttle/index.js
2671
+ var lodash_throttle = __webpack_require__(3096);
2672
+ var lodash_throttle_default = /*#__PURE__*/__webpack_require__.n(lodash_throttle);
2673
+ // EXTERNAL MODULE: ./src/core/dom-query.js
2674
+ var dom_query = __webpack_require__(9581);
2675
+ // EXTERNAL MODULE: ./src/core/Flash/component.jsx
2676
+ var component = __webpack_require__(4935);
2677
+ ;// CONCATENATED MODULE: ./src/core/Notice/component.js
2678
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
2679
+
2680
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
2681
+
2682
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2683
+
2684
+
2685
+
2686
+
2687
+
2688
+
2689
+ var COOKIE_EXPIRY = 90;
2690
+ var COLLAPSE_TRIGGER_DISTANCE = 5;
2691
+ var SCROLL_LISTENER_THROTTLE = 100;
2692
+ var RESIZE_LISTENER_THROTTLE = 100;
2693
+
2694
+ var isMdViewport = function isMdViewport() {
2695
+ return !window.matchMedia("(min-width: 65rem)").matches;
2696
+ };
2697
+
2698
+ var adjustFlashMargin = function adjustFlashMargin(open) {
2699
+ // HACK ALERT
2700
+ // Add margin to flashes when opening the notice.
2701
+ // Flashes are react components and this notice needs to work as a view-component and react component.
2702
+ // We could do this with redux but then we potentially update state on every scroll event, which
2703
+ // even with debounce will deplate our frame budget.
2704
+ var flash = (0,dom_query/* queryId */.A)(component.FLASH_DATA_ID);
2705
+
2706
+ if (flash) {
2707
+ flash.style.marginTop = open ? "4rem" : null;
2708
+ }
2709
+ };
2710
+
2711
+ var hideOnMobile = function hideOnMobile(bannerContainer) {
2712
+ if (isMdViewport()) {
2713
+ bannerContainer.style.display = "none";
2714
+ } else {
2715
+ bannerContainer.style.display = null;
2716
+ }
2717
+ };
2718
+
2719
+ var hideNotice = function hideNotice(bannerContainer) {
2720
+ bannerContainer.style.maxHeight = 0;
2721
+ bannerContainer.style.overflow = "hidden";
2722
+ adjustFlashMargin(false);
2723
+ };
2724
+
2725
+ var showNotice = function showNotice(bannerContainer) {
2726
+ bannerContainer.style.maxHeight = null;
2727
+ bannerContainer.style.overflow = null;
2728
+ adjustFlashMargin(true);
2729
+ };
2730
+
2731
+ var setupRememberClosed = function setupRememberClosed(cookieId, noticeId) {
2732
+ var cookie = js_cookie_default().get(cookieId) || "";
2733
+ js_cookie_default().set(cookieId, "".concat(cookie.replace("".concat(noticeId, ","), "") + noticeId, ","), {
2734
+ expires: COOKIE_EXPIRY
2735
+ });
2736
+ };
2737
+
2738
+ var hasBeenClosedBefore = function hasBeenClosedBefore(cookieId, noticeId) {
2739
+ return (js_cookie_default().get(cookieId) || "").includes(noticeId);
2740
+ };
2741
+
2742
+ var setupNoticeCollapse = function setupNoticeCollapse(bannerContainer) {
2743
+ var scrollTop = window.scrollY;
2744
+
2745
+ if (scrollTop > COLLAPSE_TRIGGER_DISTANCE) {
2746
+ hideNotice(bannerContainer);
2747
+ }
2748
+
2749
+ var listener = lodash_throttle_default()(function () {
2750
+ var scrollTop = window.scrollY;
2751
+
2752
+ if (scrollTop > COLLAPSE_TRIGGER_DISTANCE) {
2753
+ hideNotice(bannerContainer);
2754
+ } else if (bannerContainer.style.overflow) {
2755
+ showNotice(bannerContainer);
2756
+ }
2757
+ }, SCROLL_LISTENER_THROTTLE);
2758
+ document.addEventListener("scroll", listener);
2759
+ return function () {
2760
+ return document.removeEventListener("scroll", listener);
2761
+ };
2762
+ };
2763
+
2764
+ var setupCloseBtn = function setupCloseBtn(bannerContainer, cookieId, noticeId, collapseUnmountListeners) {
2765
+ var closeBtn = bannerContainer.querySelector("button");
2766
+ if (!closeBtn) return function () {};
2767
+
2768
+ var listener = function listener() {
2769
+ if (cookieId && noticeId) setupRememberClosed(cookieId, noticeId);
2770
+ hideNotice(bannerContainer);
2771
+ collapseUnmountListeners();
2772
+ };
2773
+
2774
+ closeBtn.addEventListener("click", listener);
2775
+ return function () {
2776
+ return document.removeEventListener("click", listener);
2777
+ };
2778
+ };
2779
+
2780
+ var resizeHandler = function resizeHandler(bannerContainer) {
2781
+ var handler = lodash_throttle_default()(function () {
2782
+ hideOnMobile(bannerContainer);
2783
+ }, RESIZE_LISTENER_THROTTLE);
2784
+ window.addEventListener("resize", handler);
2785
+ return function () {
2786
+ return window.removeEventListener("resize", handler);
2787
+ };
2788
+ };
2789
+
2790
+ var Notice = function Notice(_ref) {
2791
+ var bannerContainer = _ref.bannerContainer,
2792
+ cookieId = _ref.cookieId,
2793
+ noticeId = _ref.noticeId,
2794
+ options = _ref.options;
2795
+ if (typeof window === "undefined") return function () {};
2796
+
2797
+ if (!bannerContainer) {
2798
+ console.warn("A Notice component was initited but no notice container was found.");
2799
+ return function () {};
2800
+ }
2801
+
2802
+ if (hasBeenClosedBefore(cookieId, noticeId)) return function () {};
2803
+ hideOnMobile(bannerContainer);
2804
+ showNotice(bannerContainer);
2805
+
2806
+ var opts = _objectSpread({
2807
+ collapse: true
2808
+ }, options);
2809
+
2810
+ var collapseUnmountListeners = opts.collapse ? setupNoticeCollapse(bannerContainer) : function () {};
2811
+ var closeBtnUnmountListeners = setupCloseBtn(bannerContainer, cookieId, noticeId, collapseUnmountListeners);
2812
+ var resizeUnmountListener = resizeHandler(bannerContainer);
2813
+ return function () {
2814
+ [closeBtnUnmountListeners, collapseUnmountListeners, resizeUnmountListener].forEach(function (unmount) {
2815
+ return unmount();
2816
+ });
2817
+ };
2818
+ };
2819
+
2820
+ /* harmony default export */ const Notice_component = (Notice);
2821
+ // EXTERNAL MODULE: ./src/core/Icon/component.jsx
2822
+ var Icon_component = __webpack_require__(9008);
2823
+ ;// CONCATENATED MODULE: ./src/core/Notice/component.jsx
2824
+
2825
+
2826
+ var contentWrapperClasses = "font-light w-full pr-8 text-p3 self-center";
2827
+
2828
+
2829
+
2830
+ var ContentWrapper = function ContentWrapper(_ref) {
2831
+ var buttonLink = _ref.buttonLink,
2832
+ children = _ref.children;
2833
+ return buttonLink ? /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("a", {
2834
+ href: buttonLink,
2835
+ className: contentWrapperClasses
2836
+ }, children) : /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("div", {
2837
+ className: contentWrapperClasses
2838
+ }, children);
2839
+ };
2840
+
2841
+ ContentWrapper.propTypes = {
2842
+ buttonLink: (prop_types_default()).string,
2843
+ children: (prop_types_default()).node
2844
+ };
2845
+
2846
+ var component_Notice = function Notice(_ref2) {
2847
+ var buttonLink = _ref2.buttonLink,
2848
+ buttonLabel = _ref2.buttonLabel,
2849
+ bodyText = _ref2.bodyText,
2850
+ title = _ref2.title,
2851
+ config = _ref2.config,
2852
+ closeBtn = _ref2.closeBtn,
2853
+ _ref2$bgColor = _ref2.bgColor,
2854
+ bgColor = _ref2$bgColor === void 0 ? "bg-gradient-active-orange" : _ref2$bgColor,
2855
+ _ref2$textColor = _ref2.textColor,
2856
+ textColor = _ref2$textColor === void 0 ? "text-white" : _ref2$textColor;
2857
+ (0,external_commonjs_react_commonjs2_react_.useEffect)(function () {
2858
+ Notice_component({
2859
+ bannerContainer: document.querySelector('[data-id="ui-notice"]'),
2860
+ cookieId: config.cookieId,
2861
+ noticeId: config.noticeId,
2862
+ options: {
2863
+ collapse: config.collapse
2864
+ }
2865
+ });
2866
+ }, []);
2867
+ var wrapperClasses = ["ui-announcement", bgColor, textColor].join(" ");
2868
+ return /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("div", {
2869
+ className: wrapperClasses,
2870
+ "data-id": "ui-notice",
2871
+ style: {
2872
+ maxHeight: 0,
2873
+ overflow: "hidden"
2874
+ }
2875
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("div", {
2876
+ className: "ui-grid-px py-16 max-w-screen-xl mx-auto flex items-start"
2877
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement(ContentWrapper, {
2878
+ buttonLink: buttonLink
2879
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("strong", {
2880
+ className: "font-medium whitespace-nowrap pr-4"
2881
+ }, title), /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("span", {
2882
+ className: "pr-4"
2883
+ }, bodyText), buttonLabel && /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("span", {
2884
+ className: "underline cursor-pointer whitespace-nowrap"
2885
+ }, buttonLabel)), closeBtn && /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement("button", {
2886
+ type: "button",
2887
+ className: "ml-auto h-20 w-20 border-none bg-none self-baseline"
2888
+ }, /*#__PURE__*/external_commonjs_react_commonjs2_react_default().createElement(Icon_component.default, {
2889
+ name: "icon-gui-close",
2890
+ size: "1.25rem",
2891
+ color: "text-white"
2892
+ }))));
2893
+ };
2894
+
2895
+ component_Notice.propTypes = {
2896
+ buttonLink: (prop_types_default()).string,
2897
+ buttonLabel: (prop_types_default()).string,
2898
+ bodyText: (prop_types_default()).string,
2899
+ title: (prop_types_default()).string,
2900
+ closeBtn: (prop_types_default()).bool,
2901
+ config: prop_types_default().shape({
2902
+ collapse: (prop_types_default()).bool,
2903
+ noticeId: (prop_types_default()).string,
2904
+ cookieId: (prop_types_default()).string
2905
+ }),
2906
+ bgColor: (prop_types_default()).string,
2907
+ textColor: (prop_types_default()).string
2908
+ };
2909
+ /* harmony default export */ const core_Notice_component = (component_Notice);
2910
+ })();
2911
+
2912
+ /******/ return __webpack_exports__;
2913
+ /******/ })()
2914
+ ;
2915
+ });