@dr.pogodin/react-utils 1.40.10 → 1.40.11

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 (48) hide show
  1. package/bin/setup.js +38 -10
  2. package/build/development/client/index.js +2 -1
  3. package/build/development/client/index.js.map +1 -1
  4. package/build/development/server/renderer.js +2 -1
  5. package/build/development/server/renderer.js.map +1 -1
  6. package/build/development/server/utils/errors.js.map +1 -1
  7. package/build/development/shared/components/GenericLink/index.js +0 -4
  8. package/build/development/shared/components/GenericLink/index.js.map +1 -1
  9. package/build/development/shared/components/Link.js.map +1 -1
  10. package/build/development/shared/components/NavLink.js.map +1 -1
  11. package/build/development/shared/utils/webpack.js +12 -9
  12. package/build/development/shared/utils/webpack.js.map +1 -1
  13. package/build/development/style.css +0 -78
  14. package/build/development/web.bundle.js +3 -3
  15. package/build/production/client/index.js +1 -1
  16. package/build/production/client/index.js.map +1 -1
  17. package/build/production/server/renderer.js +1 -1
  18. package/build/production/server/renderer.js.map +1 -1
  19. package/build/production/server/utils/errors.js.map +1 -1
  20. package/build/production/shared/components/GenericLink/index.js +1 -1
  21. package/build/production/shared/components/GenericLink/index.js.map +1 -1
  22. package/build/production/shared/components/Link.js.map +1 -1
  23. package/build/production/shared/components/NavLink.js.map +1 -1
  24. package/build/production/shared/utils/webpack.js +1 -1
  25. package/build/production/shared/utils/webpack.js.map +1 -1
  26. package/build/production/style.css.map +1 -1
  27. package/build/production/web.bundle.js +1 -1
  28. package/build/production/web.bundle.js.map +1 -1
  29. package/build/types-code/server/utils/errors.d.ts +1 -1
  30. package/build/types-code/shared/components/GenericLink/index.d.ts +7 -7
  31. package/build/types-code/shared/components/Link.d.ts +2 -1
  32. package/build/types-code/shared/components/NavLink.d.ts +2 -1
  33. package/build/types-code/shared/utils/webpack.d.ts +1 -1
  34. package/config/stylelint/default.js +1 -0
  35. package/package.json +8 -8
  36. package/src/client/index.tsx +6 -1
  37. package/src/server/renderer.tsx +4 -1
  38. package/src/server/utils/errors.ts +1 -1
  39. package/src/shared/components/GenericLink/index.tsx +15 -11
  40. package/src/shared/components/Link.tsx +2 -2
  41. package/src/shared/components/Modal/base-theme.scss +1 -1
  42. package/src/shared/components/NavLink.tsx +2 -2
  43. package/src/shared/components/PageLayout/base-theme.scss +1 -1
  44. package/src/shared/components/TextArea/style.scss +0 -1
  45. package/src/shared/components/selectors/NativeDropdown/theme.scss +0 -2
  46. package/src/shared/utils/webpack.ts +14 -9
  47. package/src/styles/global.scss +1 -1
  48. package/src/styles/mixins.scss +3 -3
@@ -36,7 +36,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
36
36
  \******************************/
37
37
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
38
38
 
39
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ Launch; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom/client */ \"react-dom/client\");\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom_client__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ \"react-router-dom\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _getInj__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getInj */ \"./src/client/getInj.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n// Initialization of client-side code.\n/* global document */\n\n\n\n\n\n\n\n/**\n * Prepares and launches the app at client side.\n * @param Application Root application component\n * @param [options={}] Optional. Additional settings.\n */\nfunction Launch(Application) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const container = document.getElementById('react-view');\n if (!container) throw Error('Failed to find container for React app');\n const scene = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1__.GlobalStateProvider, {\n initialState: (0,_getInj__WEBPACK_IMPORTED_MODULE_4__[\"default\"])().ISTATE || options.initialState,\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.BrowserRouter, {\n future: {\n v7_relativeSplatPath: true\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(Application, {})\n })\n });\n if (options.dontHydrate) {\n const root = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_2__.createRoot)(container);\n root.render(scene);\n } else (0,react_dom_client__WEBPACK_IMPORTED_MODULE_2__.hydrateRoot)(container, scene);\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/client/index.tsx?");
39
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ Launch; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom/client */ \"react-dom/client\");\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom_client__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ \"react-router-dom\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _getInj__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getInj */ \"./src/client/getInj.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n// Initialization of client-side code.\n/* global document */\n\n\n\n\n\n\n\n/**\n * Prepares and launches the app at client side.\n * @param Application Root application component\n * @param [options={}] Optional. Additional settings.\n */\nfunction Launch(Application) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const container = document.getElementById('react-view');\n if (!container) throw Error('Failed to find container for React app');\n const scene = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1__.GlobalStateProvider, {\n initialState: (0,_getInj__WEBPACK_IMPORTED_MODULE_4__[\"default\"])().ISTATE || options.initialState,\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.BrowserRouter, {\n future: {\n v7_relativeSplatPath: true,\n v7_startTransition: true\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(Application, {})\n })\n });\n if (options.dontHydrate) {\n const root = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_2__.createRoot)(container);\n root.render(scene);\n } else (0,react_dom_client__WEBPACK_IMPORTED_MODULE_2__.hydrateRoot)(container, scene);\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/client/index.tsx?");
40
40
 
41
41
  /***/ }),
42
42
 
@@ -76,7 +76,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_
76
76
  \*****************************************************/
77
77
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
78
78
 
79
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-router-dom */ \"react-router-dom\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ \"./src/shared/components/GenericLink/style.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* global window */\n\n\n\n\n\n/**\n * The `<Link>` component, and almost identical `<NavLink>` component, are\n * auxiliary wrappers around\n * [React Router](https://github.com/ReactTraining/react-router)'s\n * `<Link>` and `<NavLink>` components; they help to handle external and\n * internal links in uniform manner.\n *\n * @param [props] Component properties.\n * @param [props.className] CSS classes to apply to the link.\n * @param [props.disabled] Disables the link.\n * @param [props.enforceA] `true` enforces rendering of the link as\n * a simple `<a>` element.\n * @param [props.keepScrollPosition] If `true`, and the link is\n * rendered as a React Router's component, it won't reset the viewport scrolling\n * position to the origin when clicked.\n * @param [props.onClick] Event handler to trigger upon click.\n * @param [props.onMouseDown] Event handler to trigger on MouseDown\n * event.\n * @param [props.openNewTab] If `true` the link opens in a new tab.\n * @param [props.replace] When `true`, the link will replace current\n * entry in the history stack instead of adding a new one.\n * @param [props.to] Link URL.\n * @param [props.activeClassName] **`<NavLink>`** only: CSS class(es)\n * to apply to rendered link when it is active.\n * @param [props.activeStyle] **`<NavLink>`** only: CSS styles\n * to apply to the rendered link when it is active.\n * @param [props.exact] **`<NavLink>`** only: if `true`, the active\n * class/style will only be applied if the location is matched exactly.\n * @param [props.isActive] **`<NavLink>`** only: Add extra\n * logic for determining whether the link is active. This should be used if you\n * want to do more than verify that the link’s pathname matches the current URL\n * pathname.\n * @param [props.location] **`<NavLink>`** only: `isActive` compares\n * current history location (usually the current browser URL). To compare to\n * a different location, a custom `location` can be passed.\n * @param [props.strict] **`<NavLink>`** only: . When `true`, trailing\n * slash on a location’s pathname will be taken into consideration when\n * determining if the location matches the current URL. See the `<Route strict>`\n * documentation for more information.\n */\nconst GenericLink = _ref => {\n let {\n children,\n className,\n disabled,\n enforceA,\n keepScrollPosition,\n onClick,\n onMouseDown,\n openNewTab,\n replace,\n routerLinkType,\n to,\n ...rest\n } = _ref;\n /* Renders Link as <a> element if:\n * - It is opted explicitely by `enforceA` prop;\n * - It should be opened in a new tab;\n * - It is an absolte URL (starts with http:// or https://);\n * - It is anchor link (starts with #). */\n if (disabled || enforceA || openNewTab || to !== null && to !== void 0 && to.match(/^(#|(https?|mailto):)/)) {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"a\", {\n className: (className ? className + \" \" : \"\") + \"-dr-pogodin-react-utils___src-shared-components-GenericLink-style___link___zH52sA\"\n // TODO: This requires a fix: disabled is not really an attribute of <a>\n // tag, thus for disabled option we rather should render a plain text\n // styled as a link.\n // disabled={disabled}\n ,\n href: to,\n onClick: disabled ? e => e.preventDefault() : onClick,\n onMouseDown: disabled ? e => e.preventDefault() : onMouseDown,\n rel: \"noopener noreferrer\",\n target: openNewTab ? '_blank' : '',\n children: children\n });\n }\n const L = routerLinkType;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(L, {\n className: className\n // disabled\n ,\n onMouseDown: onMouseDown,\n replace: replace,\n to: to,\n onClick: e => {\n // Executes the user-provided event handler, if any.\n if (onClick) onClick(e);\n\n // By default, clicking the link scrolls the page to beginning.\n if (!keepScrollPosition) window.scroll(0, 0);\n },\n ...rest,\n children: children\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (GenericLink);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/GenericLink/index.tsx?");
79
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./style.scss */ \"./src/shared/components/GenericLink/style.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n/**\n * The `<Link>` component, and almost identical `<NavLink>` component, are\n * auxiliary wrappers around\n * [React Router](https://github.com/ReactTraining/react-router)'s\n * `<Link>` and `<NavLink>` components; they help to handle external and\n * internal links in uniform manner.\n *\n * @param [props] Component properties.\n * @param [props.className] CSS classes to apply to the link.\n * @param [props.disabled] Disables the link.\n * @param [props.enforceA] `true` enforces rendering of the link as\n * a simple `<a>` element.\n * @param [props.keepScrollPosition] If `true`, and the link is\n * rendered as a React Router's component, it won't reset the viewport scrolling\n * position to the origin when clicked.\n * @param [props.onClick] Event handler to trigger upon click.\n * @param [props.onMouseDown] Event handler to trigger on MouseDown\n * event.\n * @param [props.openNewTab] If `true` the link opens in a new tab.\n * @param [props.replace] When `true`, the link will replace current\n * entry in the history stack instead of adding a new one.\n * @param [props.to] Link URL.\n * @param [props.activeClassName] **`<NavLink>`** only: CSS class(es)\n * to apply to rendered link when it is active.\n * @param [props.activeStyle] **`<NavLink>`** only: CSS styles\n * to apply to the rendered link when it is active.\n * @param [props.exact] **`<NavLink>`** only: if `true`, the active\n * class/style will only be applied if the location is matched exactly.\n * @param [props.isActive] **`<NavLink>`** only: Add extra\n * logic for determining whether the link is active. This should be used if you\n * want to do more than verify that the link’s pathname matches the current URL\n * pathname.\n * @param [props.location] **`<NavLink>`** only: `isActive` compares\n * current history location (usually the current browser URL). To compare to\n * a different location, a custom `location` can be passed.\n * @param [props.strict] **`<NavLink>`** only: . When `true`, trailing\n * slash on a location’s pathname will be taken into consideration when\n * determining if the location matches the current URL. See the `<Route strict>`\n * documentation for more information.\n */\nconst GenericLink = _ref => {\n let {\n children,\n className,\n disabled,\n enforceA,\n keepScrollPosition,\n onClick,\n onMouseDown,\n openNewTab,\n replace,\n routerLinkType,\n to,\n ...rest\n } = _ref;\n /* Renders Link as <a> element if:\n * - It is opted explicitely by `enforceA` prop;\n * - It should be opened in a new tab;\n * - It is an absolte URL (starts with http:// or https://);\n * - It is anchor link (starts with #). */\n if (disabled || enforceA || openNewTab || to !== null && to !== void 0 && to.match(/^(#|(https?|mailto):)/)) {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(\"a\", {\n className: (className ? className + \" \" : \"\") + \"-dr-pogodin-react-utils___src-shared-components-GenericLink-style___link___zH52sA\"\n // TODO: This requires a fix: disabled is not really an attribute of <a>\n // tag, thus for disabled option we rather should render a plain text\n // styled as a link.\n // disabled={disabled}\n ,\n href: to,\n onClick: disabled ? e => e.preventDefault() : onClick,\n onMouseDown: disabled ? e => e.preventDefault() : onMouseDown,\n rel: \"noopener noreferrer\",\n target: openNewTab ? '_blank' : '',\n children: children\n });\n }\n const L = routerLinkType;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(L, {\n className: className\n // disabled\n ,\n onMouseDown: onMouseDown,\n replace: replace,\n to: to,\n onClick: e => {\n // Executes the user-provided event handler, if any.\n if (onClick) onClick(e);\n\n // By default, clicking the link scrolls the page to beginning.\n if (!keepScrollPosition) window.scroll(0, 0);\n },\n ...rest,\n children: children\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (GenericLink);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/GenericLink/index.tsx?");
80
80
 
81
81
  /***/ }),
82
82
 
@@ -346,7 +346,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
346
346
  \*************************************/
347
347
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
348
348
 
349
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ requireWeak: function() { return /* binding */ requireWeak; },\n/* harmony export */ resolveWeak: function() { return /* binding */ resolveWeak; }\n/* harmony export */ });\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.ts\");\n\n\n/**\n * Requires the specified module without including it into the bundle during\n * Webpack build.\n * @param modulePath\n * @param [basePath]\n * @return Required module.\n */\nfunction requireWeak(modulePath, basePath) {\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE) return null;\n try {\n /* eslint-disable no-eval */\n const {\n resolve\n } = eval('require')('path');\n const path = basePath ? resolve(basePath, modulePath) : modulePath;\n const {\n default: def,\n ...named\n } = eval('require')(path);\n /* eslint-enable no-eval */\n\n if (!def) return named;\n Object.entries(named).forEach(_ref => {\n let [key, value] = _ref;\n if (def[key]) {\n if (def[key] !== value) {\n throw Error('Conflict between default and named exports');\n }\n } else def[key] = value;\n });\n return def;\n } catch {\n return null;\n }\n}\n\n/**\n * Resolves specified module path with help of Babel's module resolver.\n * Yes, the function itself just returns its argument to the caller, but Babel\n * is configured to resolve the first argument of resolveWeak(..) function, thus\n * the result will be the resolved path.\n * @param {string} modulePath\n * @return {string} Absolute or relative path to the module.\n */\nfunction resolveWeak(modulePath) {\n return modulePath;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/webpack.ts?");
349
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ requireWeak: function() { return /* binding */ requireWeak; },\n/* harmony export */ resolveWeak: function() { return /* binding */ resolveWeak; }\n/* harmony export */ });\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.ts\");\n\n\n/**\n * Requires the specified module without including it into the bundle during\n * Webpack build.\n * @param modulePath\n * @param [basePath]\n * @return Required module.\n */\nfunction requireWeak(modulePath, basePath) {\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE) return null;\n try {\n /* eslint-disable no-eval */\n const {\n resolve\n } = eval('require')('path');\n const path = basePath ? resolve(basePath, modulePath) : modulePath;\n const module = eval('require')(path);\n /* eslint-enable no-eval */\n\n if (!('default' in module)) return module;\n const {\n default: def,\n ...named\n } = module;\n const res = def;\n Object.entries(named).forEach(_ref => {\n let [name, value] = _ref;\n const assigned = res[name];\n if (assigned !== undefined) {\n if (assigned !== value) {\n throw Error('Conflict between default and named exports');\n }\n } else res[name] = value;\n });\n return res;\n } catch {\n return null;\n }\n}\n\n/**\n * Resolves specified module path with help of Babel's module resolver.\n * Yes, the function itself just returns its argument to the caller, but Babel\n * is configured to resolve the first argument of resolveWeak(..) function, thus\n * the result will be the resolved path.\n * @param {string} modulePath\n * @return {string} Absolute or relative path to the module.\n */\nfunction resolveWeak(modulePath) {\n return modulePath;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/webpack.ts?");
350
350
 
351
351
  /***/ }),
352
352
 
@@ -3,5 +3,5 @@
3
3
  * Prepares and launches the app at client side.
4
4
  * @param Application Root application component
5
5
  * @param [options={}] Optional. Additional settings.
6
- */function Launch(Application){let options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};const container=document.getElementById("react-view");if(!container)throw Error("Failed to find container for React app");const scene=/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactGlobalState.GlobalStateProvider,{initialState:(0,_getInj.default)().ISTATE||options.initialState,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactRouterDom.BrowserRouter,{future:{v7_relativeSplatPath:true},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(Application,{})})});if(options.dontHydrate){const root=(0,_client.createRoot)(container);root.render(scene)}else(0,_client.hydrateRoot)(container,scene)}
6
+ */function Launch(Application){let options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};const container=document.getElementById("react-view");if(!container)throw Error("Failed to find container for React app");const scene=/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactGlobalState.GlobalStateProvider,{initialState:(0,_getInj.default)().ISTATE||options.initialState,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactRouterDom.BrowserRouter,{future:{v7_relativeSplatPath:true,v7_startTransition:true},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(Application,{})})});if(options.dontHydrate){const root=(0,_client.createRoot)(container);root.render(scene)}else(0,_client.hydrateRoot)(container,scene)}
7
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["require","_reactGlobalState","_client","_reactRouterDom","_getInj","_interopRequireDefault","_jsxRuntime","Launch","Application","options","arguments","length","undefined","container","document","getElementById","Error","scene","jsx","GlobalStateProvider","initialState","getInj","ISTATE","children","BrowserRouter","future","v7_relativeSplatPath","dontHydrate","root","createRoot","render","hydrateRoot"],"sources":["../../../src/client/index.tsx"],"sourcesContent":["// Initialization of client-side code.\n/* global document */\n\nimport { type ComponentType } from 'react';\n\nimport { GlobalStateProvider } from '@dr.pogodin/react-global-state';\n\nimport { createRoot, hydrateRoot } from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\n\nimport getInj from './getInj';\n\ntype OptionsT = {\n dontHydrate?: boolean;\n initialState?: any;\n};\n\n/**\n * Prepares and launches the app at client side.\n * @param Application Root application component\n * @param [options={}] Optional. Additional settings.\n */\nexport default function Launch(\n Application: ComponentType,\n options: OptionsT = {},\n) {\n const container = document.getElementById('react-view');\n if (!container) throw Error('Failed to find container for React app');\n const scene = (\n <GlobalStateProvider initialState={getInj().ISTATE || options.initialState}>\n <BrowserRouter future={{ v7_relativeSplatPath: true }}>\n <Application />\n </BrowserRouter>\n </GlobalStateProvider>\n );\n\n if (options.dontHydrate) {\n const root = createRoot(container);\n root.render(scene);\n } else hydrateRoot(container, scene);\n}\n"],"mappings":"gLAGAA,OAAA,UAEA,IAAAC,iBAAA,CAAAD,OAAA,mCAEA,IAAAE,OAAA,CAAAF,OAAA,qBACA,IAAAG,eAAA,CAAAH,OAAA,qBAEA,IAAAI,OAAA,CAAAC,sBAAA,CAAAL,OAAA,cAA8B,IAAAM,WAAA,CAAAN,OAAA,sBAV9B;AACA,qBAgBA;AACA;AACA;AACA;AACA,GACe,QAAS,CAAAO,MAAMA,CAC5BC,WAA0B,CAE1B,IADA,CAAAC,OAAiB,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAG,CAAC,CAAC,CAEtB,KAAM,CAAAG,SAAS,CAAGC,QAAQ,CAACC,cAAc,CAAC,YAAY,CAAC,CACvD,GAAI,CAACF,SAAS,CAAE,KAAM,CAAAG,KAAK,CAAC,wCAAwC,CAAC,CACrE,KAAM,CAAAC,KAAK,cACT,GAAAX,WAAA,CAAAY,GAAA,EAACjB,iBAAA,CAAAkB,mBAAmB,EAACC,YAAY,CAAE,GAAAC,eAAM,EAAC,CAAC,CAACC,MAAM,EAAIb,OAAO,CAACW,YAAa,CAAAG,QAAA,cACzE,GAAAjB,WAAA,CAAAY,GAAA,EAACf,eAAA,CAAAqB,aAAa,EAACC,MAAM,CAAE,CAAEC,oBAAoB,CAAE,IAAK,CAAE,CAAAH,QAAA,cACpD,GAAAjB,WAAA,CAAAY,GAAA,EAACV,WAAW,GAAE,CAAC,CACF,CAAC,CACG,CACtB,CAED,GAAIC,OAAO,CAACkB,WAAW,CAAE,CACvB,KAAM,CAAAC,IAAI,CAAG,GAAAC,kBAAU,EAAChB,SAAS,CAAC,CAClCe,IAAI,CAACE,MAAM,CAACb,KAAK,CACnB,CAAC,IAAM,GAAAc,mBAAW,EAAClB,SAAS,CAAEI,KAAK,CACrC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["require","_reactGlobalState","_client","_reactRouterDom","_getInj","_interopRequireDefault","_jsxRuntime","Launch","Application","options","arguments","length","undefined","container","document","getElementById","Error","scene","jsx","GlobalStateProvider","initialState","getInj","ISTATE","children","BrowserRouter","future","v7_relativeSplatPath","v7_startTransition","dontHydrate","root","createRoot","render","hydrateRoot"],"sources":["../../../src/client/index.tsx"],"sourcesContent":["// Initialization of client-side code.\n/* global document */\n\nimport { type ComponentType } from 'react';\n\nimport { GlobalStateProvider } from '@dr.pogodin/react-global-state';\n\nimport { createRoot, hydrateRoot } from 'react-dom/client';\nimport { BrowserRouter } from 'react-router-dom';\n\nimport getInj from './getInj';\n\ntype OptionsT = {\n dontHydrate?: boolean;\n initialState?: any;\n};\n\n/**\n * Prepares and launches the app at client side.\n * @param Application Root application component\n * @param [options={}] Optional. Additional settings.\n */\nexport default function Launch(\n Application: ComponentType,\n options: OptionsT = {},\n) {\n const container = document.getElementById('react-view');\n if (!container) throw Error('Failed to find container for React app');\n const scene = (\n <GlobalStateProvider initialState={getInj().ISTATE || options.initialState}>\n <BrowserRouter\n future={{\n v7_relativeSplatPath: true,\n v7_startTransition: true,\n }}\n >\n <Application />\n </BrowserRouter>\n </GlobalStateProvider>\n );\n\n if (options.dontHydrate) {\n const root = createRoot(container);\n root.render(scene);\n } else hydrateRoot(container, scene);\n}\n"],"mappings":"gLAGAA,OAAA,UAEA,IAAAC,iBAAA,CAAAD,OAAA,mCAEA,IAAAE,OAAA,CAAAF,OAAA,qBACA,IAAAG,eAAA,CAAAH,OAAA,qBAEA,IAAAI,OAAA,CAAAC,sBAAA,CAAAL,OAAA,cAA8B,IAAAM,WAAA,CAAAN,OAAA,sBAV9B;AACA,qBAgBA;AACA;AACA;AACA;AACA,GACe,QAAS,CAAAO,MAAMA,CAC5BC,WAA0B,CAE1B,IADA,CAAAC,OAAiB,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAG,CAAC,CAAC,CAEtB,KAAM,CAAAG,SAAS,CAAGC,QAAQ,CAACC,cAAc,CAAC,YAAY,CAAC,CACvD,GAAI,CAACF,SAAS,CAAE,KAAM,CAAAG,KAAK,CAAC,wCAAwC,CAAC,CACrE,KAAM,CAAAC,KAAK,cACT,GAAAX,WAAA,CAAAY,GAAA,EAACjB,iBAAA,CAAAkB,mBAAmB,EAACC,YAAY,CAAE,GAAAC,eAAM,EAAC,CAAC,CAACC,MAAM,EAAIb,OAAO,CAACW,YAAa,CAAAG,QAAA,cACzE,GAAAjB,WAAA,CAAAY,GAAA,EAACf,eAAA,CAAAqB,aAAa,EACZC,MAAM,CAAE,CACNC,oBAAoB,CAAE,IAAI,CAC1BC,kBAAkB,CAAE,IACtB,CAAE,CAAAJ,QAAA,cAEF,GAAAjB,WAAA,CAAAY,GAAA,EAACV,WAAW,GAAE,CAAC,CACF,CAAC,CACG,CACtB,CAED,GAAIC,OAAO,CAACmB,WAAW,CAAE,CACvB,KAAM,CAAAC,IAAI,CAAG,GAAAC,kBAAU,EAACjB,SAAS,CAAC,CAClCgB,IAAI,CAACE,MAAM,CAACd,KAAK,CACnB,CAAC,IAAM,GAAAe,mBAAW,EAACnB,SAAS,CAAEI,KAAK,CACrC","ignoreList":[]}
@@ -94,7 +94,7 @@ const regex=new RegExp(buffer.nonce,"g");h=h.replace(regex,req.nonce)}if(status!
94
94
  // the build (in prod mode).
95
95
  let chunkGroups;const webpackStats=(0,_lodash.get)(res.locals,"webpack.devMiddleware.stats");if(webpackStats){chunkGroups=(0,_lodash.mapValues)(webpackStats.toJson({all:false,chunkGroups:true}).namedChunkGroups,item=>item.assets.map(({name})=>name))}else if(CHUNK_GROUPS)chunkGroups=CHUNK_GROUPS;else chunkGroups={};/* Optional server-side rendering. */const App=ops.Application;let appHtmlMarkup="";const ssrContext=new ServerSsrContext(req,chunkGroups,initialState);let stream;if(App){const ssrStart=Date.now();// TODO: Somehow, without it TS does not realise that
96
96
  // App has been checked to exist.
97
- const App2=App;const renderPass=async()=>{ssrContext.chunks=[];return new Promise((resolve,reject)=>{const pipeableStream=(0,_server.renderToPipeableStream)(/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactGlobalState.GlobalStateProvider,{initialState:ssrContext.state,ssrContext:ssrContext,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_server2.StaticRouter,{future:{v7_relativeSplatPath:true},location:req.url,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(App2,{})})}),{onAllReady:()=>resolve(pipeableStream),onError:reject})})};let ssrRound=0;let bailed=false;for(;ssrRound<ops.maxSsrRounds;++ssrRound){stream=await renderPass();// eslint-disable-line no-await-in-loop
97
+ const App2=App;const renderPass=async()=>{ssrContext.chunks=[];return new Promise((resolve,reject)=>{const pipeableStream=(0,_server.renderToPipeableStream)(/*#__PURE__*/(0,_jsxRuntime.jsx)(_reactGlobalState.GlobalStateProvider,{initialState:ssrContext.state,ssrContext:ssrContext,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_server2.StaticRouter,{future:{v7_relativeSplatPath:true,v7_startTransition:true},location:req.url,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(App2,{})})}),{onAllReady:()=>resolve(pipeableStream),onError:reject})})};let ssrRound=0;let bailed=false;for(;ssrRound<ops.maxSsrRounds;++ssrRound){stream=await renderPass();// eslint-disable-line no-await-in-loop
98
98
  if(!ssrContext.dirty)break;/* eslint-disable no-await-in-loop */const timeout=ops.ssrTimeout+ssrStart-Date.now();bailed=timeout<=0||!(await Promise.race([Promise.allSettled(ssrContext.pending),(0,_jsUtils.timer)(timeout).then(()=>false)]));if(bailed)break;/* eslint-enable no-await-in-loop */}let logMsg;if(ssrContext.dirty){// NOTE: In the case of incomplete SSR one more round is necessary
99
99
  // to ensure the correct hydration when some pending promises have
100
100
  // resolved and placed their data into the initial global state.
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.js","names":["_fs","_interopRequireDefault","require","_path","_stream","_zlib","_winston","_reactGlobalState","_jsUtils","_lodash","_config","_nodeForge","_server","_reactHelmet","_server2","_serializeJavascript","_buildInfo","_Cache","_jsxRuntime","sanitizedConfig","omit","config","SCRIPT_LOCATIONS","exports","ServerSsrContext","SsrContext","chunks","status","constructor","req","chunkGroups","initialState","cloneDeep","getBuildInfo","context","url","path","resolve","JSON","parse","fs","readFileSync","readChunkGroupsJson","buildDir","res","err","prepareCipher","key","Promise","reject","forge","random","getBytes","iv","cipher","createCipher","start","isBrotliAcceptable","acceptable","get","ops","split","i","length","op","type","priority","trim","parseFloat","groupExtraScripts","scripts","BODY_OPEN","DEFAULT","HEAD_OPEN","script","isString","code","location","undefined","Error","newDefaultLogger","defaultLogLevel","format","transports","winston","createLogger","level","combine","splat","timestamp","colorize","printf","message","stack","rest","Object","keys","stringify","Console","factory","webpackConfig","options","defaults","clone","beforeRender","maxSsrRounds","ssrTimeout","staticCacheSize","logger","defaultLoggerLogLevel","buildInfo","setBuildInfo","publicPath","outputPath","output","manifestLink","existsSync","cache","staticCacheController","Cache","CHUNK_GROUPS","next","set","cookie","csrfToken","cacheRef","data","buffer","noCsp","send","done","failed","brotliDecompress","error","html","h","toString","regex","RegExp","nonce","replace","configToInject","extraScripts","all","helmet","webpackStats","locals","mapValues","toJson","namedChunkGroups","item","assets","map","name","App","Application","appHtmlMarkup","ssrContext","stream","ssrStart","Date","now","App2","renderPass","pipeableStream","renderToPipeableStream","jsx","GlobalStateProvider","state","children","StaticRouter","future","v7_relativeSplatPath","onAllReady","onError","ssrRound","bailed","dirty","timeout","race","allSettled","pending","timer","then","logMsg","log","pipe","Writable","write","chunk","_","Helmet","renderStatic","payload","serializeJs","CONFIG","ISTATE","ignoreFunction","unsafe","update","util","createBuffer","finish","INJ","encode64","chunkSet","Set","forEach","asset","add","styleChunkString","scriptChunkString","endsWith","grouppedExtraScripts","faviconLink","favicon","title","meta","brotliCompress","b"],"sources":["../../../src/server/renderer.tsx"],"sourcesContent":["/**\n * ExpressJS middleware for server-side rendering of a ReactJS app.\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { type Request, type RequestHandler } from 'express';\nimport { type ComponentType } from 'react';\nimport { Writable } from 'stream';\nimport { brotliCompress, brotliDecompress } from 'zlib';\nimport winston from 'winston';\n\nimport { GlobalStateProvider, SsrContext } from '@dr.pogodin/react-global-state';\nimport { timer } from '@dr.pogodin/js-utils';\n\nimport {\n clone,\n cloneDeep,\n defaults,\n isString,\n get,\n mapValues,\n omit,\n} from 'lodash';\n\nimport config from 'config';\nimport forge from 'node-forge';\n\nimport { type PipeableStream, renderToPipeableStream } from 'react-dom/server';\nimport { Helmet } from 'react-helmet';\nimport { StaticRouter } from 'react-router-dom/server';\nimport serializeJs from 'serialize-javascript';\nimport { type BuildInfoT, setBuildInfo } from 'utils/isomorphy/buildInfo';\n\nimport { type ChunkGroupsT, type SsrContextT } from 'utils/globalState';\n\nimport { type Configuration } from 'webpack';\n\nimport Cache from './Cache';\n\nconst sanitizedConfig = omit(config, 'SECRET');\n\n// Note: These type definitions for logger are copied from Winston logger,\n// then simplified to make it easier to fit an alternative logger into this\n// interface.\ninterface LogMethodI {\n (level: string, message: string, ...meta: any[]): void;\n}\ninterface LeveledLogMethodI {\n (message: string, ...meta: any[]): void;\n}\n\nexport interface LoggerI {\n debug: LeveledLogMethodI;\n error: LeveledLogMethodI;\n info: LeveledLogMethodI;\n log: LogMethodI;\n warn: LeveledLogMethodI;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport enum SCRIPT_LOCATIONS {\n BODY_OPEN = 'BODY_OPEN',\n DEFAULT = 'DEFAULT',\n HEAD_OPEN = 'HEAD_OPEN',\n}\n\nexport class ServerSsrContext<StateT>\n extends SsrContext<StateT>\n implements SsrContextT<StateT> {\n chunkGroups: ChunkGroupsT;\n\n chunks: string[] = [];\n\n req: Request;\n\n status: number = 200;\n\n constructor(\n req: Request,\n chunkGroups: ChunkGroupsT,\n initialState?: StateT,\n ) {\n super(cloneDeep(initialState) || ({} as StateT));\n this.chunkGroups = chunkGroups;\n this.req = req;\n }\n}\n\ntype ScriptT = {\n code: string;\n location: SCRIPT_LOCATIONS;\n};\n\n/**\n * Reads build-time information about the app. This information is generated\n * by our standard Webpack config for apps, and it is written into\n * \".build-info\" file in the context folder specified in Webpack config.\n * At the moment, that file contains build timestamp and a random 32-bit key,\n * suitable for cryptographical use.\n * @param context Webpack context path used during the build.\n * @return Resolves to the build-time information.\n */\nfunction getBuildInfo(context: string) {\n const url = path.resolve(context, '.build-info');\n return JSON.parse(fs.readFileSync(url, 'utf8'));\n}\n\n/**\n * Attempts to read from disk the named chunk groups mapping generated\n * by Webpack during the compilation.\n * It will not work for development builds, where these stats should be captured\n * via compilator callback.\n * @param buildDir\n * @return\n */\nfunction readChunkGroupsJson(buildDir: string) {\n const url = path.resolve(buildDir, '__chunk_groups__.json');\n let res;\n try {\n res = JSON.parse(fs.readFileSync(url, 'utf8'));\n } catch (err) {\n res = null;\n }\n return res;\n}\n\n/**\n * Prepares a new Cipher for data encryption.\n * @param key Encryption key (32-bit random key is expected, see\n * node-forge documentation, in case of doubts).\n * @return Resolves to the object with two fields:\n * 1. cipher - a new Cipher, ready for encryption;\n * 2. iv - initial vector used by the cipher.\n */\nfunction prepareCipher(key: string) {\n return new Promise((resolve, reject) => {\n forge.random.getBytes(32, (err, iv) => {\n if (err) reject(err);\n else {\n const cipher = forge.cipher.createCipher('AES-CBC', key);\n cipher.start({ iv });\n resolve({ cipher, iv });\n }\n });\n });\n}\n\n/**\n * Given an incoming HTTP requests, it deduces whether Brotli-encoded responses\n * are acceptable to the caller.\n * @param {object} req\n * @return {boolean}\n * @ignore\n */\nexport function isBrotliAcceptable(req: Request) {\n const acceptable = req.get('accept-encoding');\n if (acceptable) {\n const ops = acceptable.split(',');\n for (let i = 0; i < ops.length; ++i) {\n const op = ops[i];\n if (op) {\n const [type, priority] = op.trim().split(';q=');\n if ((type === '*' || type === 'br')\n && (!priority || parseFloat(priority) > 0)) {\n return true;\n }\n }\n }\n }\n return false;\n}\n\n/**\n * Given an array of extra script strings / objects, it returns an object with\n * arrays of scripts to inject in different HTML template locations. During\n * the script groupping it also filters out any empty scripts.\n * @param {({\n * code: string;\n * location: string;\n * }|string)[]} [scripts=[]]\n * @return {{\n * BODY_OPEN: string[];\n * DEFAULT: string[];\n * HEAD_OPEN: string[];\n * }}\n */\nfunction groupExtraScripts(scripts: Array<string | ScriptT> = []) {\n const res = {\n [SCRIPT_LOCATIONS.BODY_OPEN]: '',\n [SCRIPT_LOCATIONS.DEFAULT]: '',\n [SCRIPT_LOCATIONS.HEAD_OPEN]: '',\n };\n for (let i = 0; i < scripts.length; ++i) {\n const script = scripts[i];\n if (isString(script)) {\n if (script) res[SCRIPT_LOCATIONS.DEFAULT] += script;\n } else if (script?.code) {\n if (res[script.location] !== undefined) {\n res[script.location] += script.code;\n } else throw Error(`Invalid location \"${script.location}\"`);\n }\n }\n return res;\n}\n\n/**\n * Creates a new default (Winston) logger.\n * @param {object} [options={}]\n * @param {string} [options.defaultLogLevel='info']\n * @return {object}\n */\nexport function newDefaultLogger({\n defaultLogLevel = 'info',\n} = {}) {\n const { format, transports } = winston;\n return winston.createLogger({\n level: defaultLogLevel,\n format: format.combine(\n format.splat(),\n format.timestamp(),\n format.colorize(),\n format.printf(\n ({\n level,\n message,\n timestamp,\n stack,\n ...rest\n }) => {\n let res = `${level}\\t(at ${timestamp}):\\t${message}`;\n if (Object.keys(rest).length) {\n res += `\\n${JSON.stringify(rest, null, 2)}`;\n }\n if (stack) res += `\\n${stack}`;\n return res;\n },\n ),\n ),\n transports: [new transports.Console()],\n });\n}\n\nexport type ConfigT = {\n [key: string]: ConfigT | string;\n};\n\nexport type BeforeRenderResT = {\n configToInject?: ConfigT;\n extraScripts?: Array<ScriptT | string>;\n initialState?: any;\n};\n\nexport type BeforeRenderT =\n(req: Request, config: ConfigT) => BeforeRenderResT | Promise<BeforeRenderResT>;\n\ntype CacheRefT = {\n key: string;\n maxage?: number;\n};\n\nexport type OptionsT = {\n Application?: ComponentType;\n beforeRender?: BeforeRenderT;\n buildInfo?: BuildInfoT;\n defaultLoggerLogLevel?: string;\n favicon?: string;\n logger?: LoggerI;\n maxSsrRounds?: number;\n noCsp?: boolean;\n staticCacheSize?: number;\n ssrTimeout?: number;\n staticCacheController?: (req: Request) => CacheRefT | null | undefined;\n};\n\n/**\n * Creates the middleware.\n * @param webpackConfig\n * @param options Additional options:\n * @param [options.Application] The root ReactJS component of\n * the app to use for the server-side rendering. When not provided\n * the server-side rendering is disabled.\n * @param [options.buildInfo] \"Build info\" object to use. If provided,\n * it will be used, instead of trying to load from the filesystem the one\n * generated by the Webpack build. It is intended for test environments,\n * where passing this stuff via file system is no bueno.\n * @param [options.favicon] `true` will include favicon\n * link into the rendered HTML templates.\n * @param [options.noCsp] `true` means that no\n * Content-Security-Policy (CSP) is used by server, thus the renderer\n * may cut a few corners.\n * @param [options.maxSsrRounds=10] Maximum number of SSR rounds.\n * @param [options.ssrTimeout=1000] SSR timeout in milliseconds,\n * defaults to 1 second.\n * @param [options.staticCacheSize=1.e7] The maximum\n * static cache size in bytes. Defaults to ~10 MB.\n * @param [options.staticCacheController] When given, it activates,\n * and controls the static caching of generated HTML markup. When this function\n * is provided, on each incoming request it is triggered with the request\n * passed in as the argument. To attempt to serve the response from the cache\n * it should return the object with the following fields:\n * - `key: string` &ndash; the cache key for the response;\n * - `maxage?: number` &ndash; the maximum age of cached result in ms.\n * If undefined - infinite age is assumed.\n * @return Created middleware.\n */\nexport default function factory(\n webpackConfig: Configuration,\n options: OptionsT,\n): RequestHandler {\n const ops: OptionsT = defaults(clone(options), {\n beforeRender: () => Promise.resolve({}),\n maxSsrRounds: 10,\n ssrTimeout: 1000,\n staticCacheSize: 1.e7,\n });\n\n // Note: in normal use the default logger is created and set in the root\n // server function, and this initialization is for testing uses, where\n // renderer is imported directly.\n if (ops.logger === undefined) {\n ops.logger = newDefaultLogger({\n defaultLogLevel: ops.defaultLoggerLogLevel,\n });\n }\n\n const buildInfo = ops.buildInfo || getBuildInfo(webpackConfig.context!);\n setBuildInfo(buildInfo);\n\n // publicPath from webpack.output has a trailing slash at the end.\n const { publicPath, path: outputPath } = webpackConfig.output!;\n\n const manifestLink = fs.existsSync(`${outputPath}/manifest.json`)\n ? `<link rel=\"manifest\" href=\"${publicPath}manifest.json\">` : '';\n\n interface BufferWithNonce extends Buffer {\n nonce: string;\n }\n\n const cache = ops.staticCacheController\n ? new Cache<{\n buffer: BufferWithNonce;\n status: number;\n }>(ops.staticCacheSize!)\n : null;\n\n const CHUNK_GROUPS = readChunkGroupsJson(outputPath!);\n\n return async (req, res, next) => {\n try {\n // Ensures any caches always revalidate HTML markup before reuse.\n res.set('Cache-Control', 'no-cache');\n\n res.cookie('csrfToken', req.csrfToken());\n\n let cacheRef: CacheRefT | null | undefined;\n if (cache) {\n cacheRef = ops.staticCacheController!(req);\n if (cacheRef) {\n const data = cache.get(cacheRef);\n if (data !== null) {\n const { buffer, status } = data;\n if (ops.noCsp && isBrotliAcceptable(req)) {\n res.set('Content-Type', 'text/html');\n res.set('Content-Encoding', 'br');\n if (status !== 200) res.status(status);\n res.send(buffer);\n } else {\n await new Promise<void>((done, failed) => {\n brotliDecompress(buffer, (error, html) => {\n if (error) failed(error);\n else {\n let h = html.toString();\n if (!ops.noCsp) {\n // TODO: Starting from Node v15 we'll be able to use string's\n // .replaceAll() method instead relying on reg. expression for\n // global matching.\n const regex = new RegExp(buffer.nonce, 'g');\n h = h.replace(regex, (req as any).nonce);\n }\n if (status !== 200) res.status(status);\n res.send(h);\n done();\n }\n });\n });\n }\n return;\n }\n }\n }\n\n const [{\n configToInject,\n extraScripts,\n initialState,\n }, {\n cipher,\n iv,\n }] = await Promise.all([\n ops.beforeRender!(req, sanitizedConfig as any),\n prepareCipher(buildInfo.key) as Promise<any>,\n ]);\n\n let helmet;\n\n // Gets the mapping between code chunk names and their asset files.\n // These data come from the Webpack compilation, either from the stats\n // attached to the request (in dev mode), or from a file output during\n // the build (in prod mode).\n let chunkGroups: ChunkGroupsT;\n const webpackStats = get(res.locals, 'webpack.devMiddleware.stats');\n if (webpackStats) {\n chunkGroups = mapValues(\n webpackStats.toJson({\n all: false,\n chunkGroups: true,\n }).namedChunkGroups,\n (item) => item.assets.map(({ name }: { name: string }) => name),\n );\n } else if (CHUNK_GROUPS) chunkGroups = CHUNK_GROUPS;\n else chunkGroups = {};\n\n /* Optional server-side rendering. */\n const App = ops.Application;\n let appHtmlMarkup: string = '';\n const ssrContext = new ServerSsrContext(req, chunkGroups, initialState);\n let stream: PipeableStream;\n if (App) {\n const ssrStart = Date.now();\n\n // TODO: Somehow, without it TS does not realise that\n // App has been checked to exist.\n const App2 = App;\n\n const renderPass = async () => {\n ssrContext.chunks = [];\n return new Promise<PipeableStream>((resolve, reject) => {\n const pipeableStream = renderToPipeableStream(\n <GlobalStateProvider\n initialState={ssrContext.state}\n ssrContext={ssrContext}\n >\n <StaticRouter\n future={{ v7_relativeSplatPath: true }}\n location={req.url}\n >\n <App2 />\n </StaticRouter>\n </GlobalStateProvider>,\n {\n onAllReady: () => resolve(pipeableStream),\n onError: reject,\n },\n );\n });\n };\n\n let ssrRound = 0;\n let bailed = false;\n for (; ssrRound < ops.maxSsrRounds!; ++ssrRound) {\n stream = await renderPass(); // eslint-disable-line no-await-in-loop\n\n if (!ssrContext.dirty) break;\n\n /* eslint-disable no-await-in-loop */\n const timeout = ops.ssrTimeout! + ssrStart - Date.now();\n bailed = timeout <= 0 || !await Promise.race([\n Promise.allSettled(ssrContext.pending),\n timer(timeout).then(() => false),\n ]);\n if (bailed) break;\n /* eslint-enable no-await-in-loop */\n }\n\n let logMsg;\n if (ssrContext.dirty) {\n // NOTE: In the case of incomplete SSR one more round is necessary\n // to ensure the correct hydration when some pending promises have\n // resolved and placed their data into the initial global state.\n stream = await renderPass();\n\n logMsg = bailed ? `SSR timed out after ${ops.ssrTimeout} second(s)`\n : `SSR bailed out after ${ops.maxSsrRounds} round(s)`;\n } else logMsg = `SSR completed in ${ssrRound + 1} round(s)`;\n\n ops.logger!.log(ssrContext.dirty ? 'warn' : 'info', logMsg);\n\n stream!.pipe(new Writable({\n write: (chunk, _, done) => {\n appHtmlMarkup += chunk.toString();\n done();\n },\n }));\n\n /* This takes care about server-side rendering of page title and meta tags\n * (still demands injection into HTML template, which happens below). */\n helmet = Helmet.renderStatic();\n }\n\n /* Encrypts data to be injected into HTML.\n * Keep in mind, that this encryption is no way secure: as the JS bundle\n * contains decryption key and is able to decode it at the client side.\n * Hovewer, for a number of reasons, encryption of injected data is still\n * better than injection of a plain text. */\n const payload = serializeJs({\n CHUNK_GROUPS: chunkGroups,\n CONFIG: configToInject || sanitizedConfig,\n ISTATE: ssrContext.state,\n }, {\n ignoreFunction: true,\n unsafe: true,\n });\n cipher.update(forge.util.createBuffer(payload, 'utf8'));\n cipher.finish();\n const INJ = forge.util.encode64(`${iv}${cipher.output.data}`);\n\n const chunkSet = new Set<string>();\n\n // TODO: \"main\" chunk has to be added explicitly,\n // because unlike all other chunks they are not managed by <CodeSplit>\n // component, thus they are not added to the ssrContext.chunks\n // automatically. Actually, names of these entry chunks should be\n // read from Wepback config, as the end user may customize them,\n // remove or add other entry points, but it requires additional\n // efforts to figure out how to automatically order them right,\n // thus for now this handles the default config.\n [\n 'main',\n ...ssrContext.chunks,\n ].forEach((chunk) => {\n const assets = chunkGroups[chunk];\n if (assets) assets.forEach((asset) => chunkSet.add(asset));\n });\n\n let styleChunkString = '';\n let scriptChunkString = '';\n chunkSet.forEach((chunk) => {\n if (chunk.endsWith('.css')) {\n styleChunkString += `<link href=\"${publicPath}${chunk}\" rel=\"stylesheet\">`;\n } else if (\n chunk.endsWith('.js')\n // In dev mode HMR adds JS updates into asset arrays,\n // and they (updates) should be ignored.\n && !chunk.endsWith('.hot-update.js')\n ) {\n scriptChunkString += `<script src=\"${publicPath}${chunk}\" type=\"application/javascript\"></script>`;\n }\n });\n\n const grouppedExtraScripts = groupExtraScripts(extraScripts);\n\n const faviconLink = ops.favicon ? (\n '<link rel=\"shortcut icon\" href=\"/favicon.ico\">'\n ) : '';\n\n const html = `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n ${grouppedExtraScripts[SCRIPT_LOCATIONS.HEAD_OPEN]}\n ${helmet ? helmet.title.toString() : ''}\n ${helmet ? helmet.meta.toString() : ''}\n <meta name=\"theme-color\" content=\"#FFFFFF\">\n ${manifestLink}\n ${styleChunkString}\n ${faviconLink}\n <meta charset=\"utf-8\">\n <meta\n content=\"width=device-width,initial-scale=1.0\"\n name=\"viewport\"\n >\n <meta itemprop=\"drpruinj\" content=\"${INJ}\">\n </head>\n <body>\n ${grouppedExtraScripts[SCRIPT_LOCATIONS.BODY_OPEN]}\n <div id=\"react-view\">${appHtmlMarkup}</div>\n ${scriptChunkString}\n ${grouppedExtraScripts[SCRIPT_LOCATIONS.DEFAULT]}\n </body>\n </html>`;\n\n const status = ssrContext.status || 200;\n if (status !== 200) res.status(status);\n\n if (cacheRef && status < 500) {\n // Note: waiting for the caching to complete is not strictly necessary,\n // but it greately simplifies testing, and error reporting.\n await new Promise<void>((done, failed) => {\n brotliCompress(html, (error, buffer) => {\n const b = buffer as BufferWithNonce;\n if (error) failed(error);\n else {\n b.nonce = (req as any).nonce; // eslint-disable-line no-param-reassign\n cache!.add({ buffer: b, status }, cacheRef!.key, buffer.length);\n done();\n }\n });\n });\n }\n\n // Note: as caching code above may throw in some cases, sending response\n // before it completes will likely hide the error, making it difficult\n // to debug. Thus, at least for now, lets send response after it.\n res.send(html);\n } catch (error) {\n next(error);\n }\n };\n}\n"],"mappings":"kUAIA,IAAAA,GAAA,CAAAC,sBAAA,CAAAC,OAAA,QACA,IAAAC,KAAA,CAAAF,sBAAA,CAAAC,OAAA,UAEAA,OAAA,YACAA,OAAA,UACA,IAAAE,OAAA,CAAAF,OAAA,WACA,IAAAG,KAAA,CAAAH,OAAA,SACA,IAAAI,QAAA,CAAAL,sBAAA,CAAAC,OAAA,aAEA,IAAAK,iBAAA,CAAAL,OAAA,mCACA,IAAAM,QAAA,CAAAN,OAAA,yBAEA,IAAAO,OAAA,CAAAP,OAAA,WAUA,IAAAQ,OAAA,CAAAT,sBAAA,CAAAC,OAAA,YACA,IAAAS,UAAA,CAAAV,sBAAA,CAAAC,OAAA,gBAEA,IAAAU,OAAA,CAAAV,OAAA,qBACA,IAAAW,YAAA,CAAAX,OAAA,iBACA,IAAAY,QAAA,CAAAZ,OAAA,4BACA,IAAAa,oBAAA,CAAAd,sBAAA,CAAAC,OAAA,0BACA,IAAAc,UAAA,CAAAd,OAAA,wCAEAA,OAAA,gCAEAA,OAAA,YAEA,IAAAe,MAAA,CAAAhB,sBAAA,CAAAC,OAAA,aA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1B,cAAc+F,gBAAgB;AAC9B,cAAcI,WAAW;AACzB;AACA;AACA;AACA;AACA;AACA,iDAAiDX,GAAG;AACpD;AACA;AACA,cAAcU,oBAAoB,CAAC/L,gBAAgB,CAACiD,SAAS,CAAC;AAC9D,mCAAmCqF,aAAa;AAChD,cAAcuD,iBAAiB;AAC/B,cAAcE,oBAAoB,CAAC/L,gBAAgB,CAACkD,OAAO,CAAC;AAC5D;AACA,gBAAgB,CAEV,KAAM,CAAA7C,MAAM,CAAGkI,UAAU,CAAClI,MAAM,EAAI,GAAG,CACvC,GAAIA,MAAM,GAAK,GAAG,CAAEiB,GAAG,CAACjB,MAAM,CAACA,MAAM,CAAC,CAEtC,GAAIkG,QAAQ,EAAIlG,MAAM,CAAG,GAAG,CAAE,CAC5B;AACA;AACA,KAAM,IAAI,CAAAqB,OAAO,CAAO,CAACkF,IAAI,CAAEC,MAAM,GAAK,CACxC,GAAAuF,oBAAc,EAACpF,IAAI,CAAE,CAACD,KAAK,CAAEN,MAAM,GAAK,CACtC,KAAM,CAAA4F,CAAC,CAAG5F,MAAyB,CACnC,GAAIM,KAAK,CAAEF,MAAM,CAACE,KAAK,CAAC,CAAC,IACpB,CACHsF,CAAC,CAAChF,KAAK,CAAI9G,GAAG,CAAS8G,KAAK,CAAE;AAC9BtB,KAAK,CAAE4F,GAAG,CAAC,CAAElF,MAAM,CAAE4F,CAAC,CAAEhM,MAAO,CAAC,CAAEkG,QAAQ,CAAE9E,GAAG,CAAEgF,MAAM,CAAChE,MAAM,CAAC,CAC/DmE,IAAI,CAAC,CACP,CACF,CAAC,CACH,CAAC,CACH,CAEA;AACA;AACA;AACAtF,GAAG,CAACqF,IAAI,CAACK,IAAI,CACf,CAAE,MAAOD,KAAK,CAAE,CACdZ,IAAI,CAACY,KAAK,CACZ,CACF,CACF","ignoreList":[]}
1
+ {"version":3,"file":"renderer.js","names":["_fs","_interopRequireDefault","require","_path","_stream","_zlib","_winston","_reactGlobalState","_jsUtils","_lodash","_config","_nodeForge","_server","_reactHelmet","_server2","_serializeJavascript","_buildInfo","_Cache","_jsxRuntime","sanitizedConfig","omit","config","SCRIPT_LOCATIONS","exports","ServerSsrContext","SsrContext","chunks","status","constructor","req","chunkGroups","initialState","cloneDeep","getBuildInfo","context","url","path","resolve","JSON","parse","fs","readFileSync","readChunkGroupsJson","buildDir","res","err","prepareCipher","key","Promise","reject","forge","random","getBytes","iv","cipher","createCipher","start","isBrotliAcceptable","acceptable","get","ops","split","i","length","op","type","priority","trim","parseFloat","groupExtraScripts","scripts","BODY_OPEN","DEFAULT","HEAD_OPEN","script","isString","code","location","undefined","Error","newDefaultLogger","defaultLogLevel","format","transports","winston","createLogger","level","combine","splat","timestamp","colorize","printf","message","stack","rest","Object","keys","stringify","Console","factory","webpackConfig","options","defaults","clone","beforeRender","maxSsrRounds","ssrTimeout","staticCacheSize","logger","defaultLoggerLogLevel","buildInfo","setBuildInfo","publicPath","outputPath","output","manifestLink","existsSync","cache","staticCacheController","Cache","CHUNK_GROUPS","next","set","cookie","csrfToken","cacheRef","data","buffer","noCsp","send","done","failed","brotliDecompress","error","html","h","toString","regex","RegExp","nonce","replace","configToInject","extraScripts","all","helmet","webpackStats","locals","mapValues","toJson","namedChunkGroups","item","assets","map","name","App","Application","appHtmlMarkup","ssrContext","stream","ssrStart","Date","now","App2","renderPass","pipeableStream","renderToPipeableStream","jsx","GlobalStateProvider","state","children","StaticRouter","future","v7_relativeSplatPath","v7_startTransition","onAllReady","onError","ssrRound","bailed","dirty","timeout","race","allSettled","pending","timer","then","logMsg","log","pipe","Writable","write","chunk","_","Helmet","renderStatic","payload","serializeJs","CONFIG","ISTATE","ignoreFunction","unsafe","update","util","createBuffer","finish","INJ","encode64","chunkSet","Set","forEach","asset","add","styleChunkString","scriptChunkString","endsWith","grouppedExtraScripts","faviconLink","favicon","title","meta","brotliCompress","b"],"sources":["../../../src/server/renderer.tsx"],"sourcesContent":["/**\n * ExpressJS middleware for server-side rendering of a ReactJS app.\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { type Request, type RequestHandler } from 'express';\nimport { type ComponentType } from 'react';\nimport { Writable } from 'stream';\nimport { brotliCompress, brotliDecompress } from 'zlib';\nimport winston from 'winston';\n\nimport { GlobalStateProvider, SsrContext } from '@dr.pogodin/react-global-state';\nimport { timer } from '@dr.pogodin/js-utils';\n\nimport {\n clone,\n cloneDeep,\n defaults,\n isString,\n get,\n mapValues,\n omit,\n} from 'lodash';\n\nimport config from 'config';\nimport forge from 'node-forge';\n\nimport { type PipeableStream, renderToPipeableStream } from 'react-dom/server';\nimport { Helmet } from 'react-helmet';\nimport { StaticRouter } from 'react-router-dom/server';\nimport serializeJs from 'serialize-javascript';\nimport { type BuildInfoT, setBuildInfo } from 'utils/isomorphy/buildInfo';\n\nimport { type ChunkGroupsT, type SsrContextT } from 'utils/globalState';\n\nimport { type Configuration } from 'webpack';\n\nimport Cache from './Cache';\n\nconst sanitizedConfig = omit(config, 'SECRET');\n\n// Note: These type definitions for logger are copied from Winston logger,\n// then simplified to make it easier to fit an alternative logger into this\n// interface.\ninterface LogMethodI {\n (level: string, message: string, ...meta: any[]): void;\n}\ninterface LeveledLogMethodI {\n (message: string, ...meta: any[]): void;\n}\n\nexport interface LoggerI {\n debug: LeveledLogMethodI;\n error: LeveledLogMethodI;\n info: LeveledLogMethodI;\n log: LogMethodI;\n warn: LeveledLogMethodI;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport enum SCRIPT_LOCATIONS {\n BODY_OPEN = 'BODY_OPEN',\n DEFAULT = 'DEFAULT',\n HEAD_OPEN = 'HEAD_OPEN',\n}\n\nexport class ServerSsrContext<StateT>\n extends SsrContext<StateT>\n implements SsrContextT<StateT> {\n chunkGroups: ChunkGroupsT;\n\n chunks: string[] = [];\n\n req: Request;\n\n status: number = 200;\n\n constructor(\n req: Request,\n chunkGroups: ChunkGroupsT,\n initialState?: StateT,\n ) {\n super(cloneDeep(initialState) || ({} as StateT));\n this.chunkGroups = chunkGroups;\n this.req = req;\n }\n}\n\ntype ScriptT = {\n code: string;\n location: SCRIPT_LOCATIONS;\n};\n\n/**\n * Reads build-time information about the app. This information is generated\n * by our standard Webpack config for apps, and it is written into\n * \".build-info\" file in the context folder specified in Webpack config.\n * At the moment, that file contains build timestamp and a random 32-bit key,\n * suitable for cryptographical use.\n * @param context Webpack context path used during the build.\n * @return Resolves to the build-time information.\n */\nfunction getBuildInfo(context: string) {\n const url = path.resolve(context, '.build-info');\n return JSON.parse(fs.readFileSync(url, 'utf8'));\n}\n\n/**\n * Attempts to read from disk the named chunk groups mapping generated\n * by Webpack during the compilation.\n * It will not work for development builds, where these stats should be captured\n * via compilator callback.\n * @param buildDir\n * @return\n */\nfunction readChunkGroupsJson(buildDir: string) {\n const url = path.resolve(buildDir, '__chunk_groups__.json');\n let res;\n try {\n res = JSON.parse(fs.readFileSync(url, 'utf8'));\n } catch (err) {\n res = null;\n }\n return res;\n}\n\n/**\n * Prepares a new Cipher for data encryption.\n * @param key Encryption key (32-bit random key is expected, see\n * node-forge documentation, in case of doubts).\n * @return Resolves to the object with two fields:\n * 1. cipher - a new Cipher, ready for encryption;\n * 2. iv - initial vector used by the cipher.\n */\nfunction prepareCipher(key: string) {\n return new Promise((resolve, reject) => {\n forge.random.getBytes(32, (err, iv) => {\n if (err) reject(err);\n else {\n const cipher = forge.cipher.createCipher('AES-CBC', key);\n cipher.start({ iv });\n resolve({ cipher, iv });\n }\n });\n });\n}\n\n/**\n * Given an incoming HTTP requests, it deduces whether Brotli-encoded responses\n * are acceptable to the caller.\n * @param {object} req\n * @return {boolean}\n * @ignore\n */\nexport function isBrotliAcceptable(req: Request) {\n const acceptable = req.get('accept-encoding');\n if (acceptable) {\n const ops = acceptable.split(',');\n for (let i = 0; i < ops.length; ++i) {\n const op = ops[i];\n if (op) {\n const [type, priority] = op.trim().split(';q=');\n if ((type === '*' || type === 'br')\n && (!priority || parseFloat(priority) > 0)) {\n return true;\n }\n }\n }\n }\n return false;\n}\n\n/**\n * Given an array of extra script strings / objects, it returns an object with\n * arrays of scripts to inject in different HTML template locations. During\n * the script groupping it also filters out any empty scripts.\n * @param {({\n * code: string;\n * location: string;\n * }|string)[]} [scripts=[]]\n * @return {{\n * BODY_OPEN: string[];\n * DEFAULT: string[];\n * HEAD_OPEN: string[];\n * }}\n */\nfunction groupExtraScripts(scripts: Array<string | ScriptT> = []) {\n const res = {\n [SCRIPT_LOCATIONS.BODY_OPEN]: '',\n [SCRIPT_LOCATIONS.DEFAULT]: '',\n [SCRIPT_LOCATIONS.HEAD_OPEN]: '',\n };\n for (let i = 0; i < scripts.length; ++i) {\n const script = scripts[i];\n if (isString(script)) {\n if (script) res[SCRIPT_LOCATIONS.DEFAULT] += script;\n } else if (script?.code) {\n if (res[script.location] !== undefined) {\n res[script.location] += script.code;\n } else throw Error(`Invalid location \"${script.location}\"`);\n }\n }\n return res;\n}\n\n/**\n * Creates a new default (Winston) logger.\n * @param {object} [options={}]\n * @param {string} [options.defaultLogLevel='info']\n * @return {object}\n */\nexport function newDefaultLogger({\n defaultLogLevel = 'info',\n} = {}) {\n const { format, transports } = winston;\n return winston.createLogger({\n level: defaultLogLevel,\n format: format.combine(\n format.splat(),\n format.timestamp(),\n format.colorize(),\n format.printf(\n ({\n level,\n message,\n timestamp,\n stack,\n ...rest\n }) => {\n let res = `${level}\\t(at ${timestamp}):\\t${message}`;\n if (Object.keys(rest).length) {\n res += `\\n${JSON.stringify(rest, null, 2)}`;\n }\n if (stack) res += `\\n${stack}`;\n return res;\n },\n ),\n ),\n transports: [new transports.Console()],\n });\n}\n\nexport type ConfigT = {\n [key: string]: ConfigT | string;\n};\n\nexport type BeforeRenderResT = {\n configToInject?: ConfigT;\n extraScripts?: Array<ScriptT | string>;\n initialState?: any;\n};\n\nexport type BeforeRenderT =\n(req: Request, config: ConfigT) => BeforeRenderResT | Promise<BeforeRenderResT>;\n\ntype CacheRefT = {\n key: string;\n maxage?: number;\n};\n\nexport type OptionsT = {\n Application?: ComponentType;\n beforeRender?: BeforeRenderT;\n buildInfo?: BuildInfoT;\n defaultLoggerLogLevel?: string;\n favicon?: string;\n logger?: LoggerI;\n maxSsrRounds?: number;\n noCsp?: boolean;\n staticCacheSize?: number;\n ssrTimeout?: number;\n staticCacheController?: (req: Request) => CacheRefT | null | undefined;\n};\n\n/**\n * Creates the middleware.\n * @param webpackConfig\n * @param options Additional options:\n * @param [options.Application] The root ReactJS component of\n * the app to use for the server-side rendering. When not provided\n * the server-side rendering is disabled.\n * @param [options.buildInfo] \"Build info\" object to use. If provided,\n * it will be used, instead of trying to load from the filesystem the one\n * generated by the Webpack build. It is intended for test environments,\n * where passing this stuff via file system is no bueno.\n * @param [options.favicon] `true` will include favicon\n * link into the rendered HTML templates.\n * @param [options.noCsp] `true` means that no\n * Content-Security-Policy (CSP) is used by server, thus the renderer\n * may cut a few corners.\n * @param [options.maxSsrRounds=10] Maximum number of SSR rounds.\n * @param [options.ssrTimeout=1000] SSR timeout in milliseconds,\n * defaults to 1 second.\n * @param [options.staticCacheSize=1.e7] The maximum\n * static cache size in bytes. Defaults to ~10 MB.\n * @param [options.staticCacheController] When given, it activates,\n * and controls the static caching of generated HTML markup. When this function\n * is provided, on each incoming request it is triggered with the request\n * passed in as the argument. To attempt to serve the response from the cache\n * it should return the object with the following fields:\n * - `key: string` &ndash; the cache key for the response;\n * - `maxage?: number` &ndash; the maximum age of cached result in ms.\n * If undefined - infinite age is assumed.\n * @return Created middleware.\n */\nexport default function factory(\n webpackConfig: Configuration,\n options: OptionsT,\n): RequestHandler {\n const ops: OptionsT = defaults(clone(options), {\n beforeRender: () => Promise.resolve({}),\n maxSsrRounds: 10,\n ssrTimeout: 1000,\n staticCacheSize: 1.e7,\n });\n\n // Note: in normal use the default logger is created and set in the root\n // server function, and this initialization is for testing uses, where\n // renderer is imported directly.\n if (ops.logger === undefined) {\n ops.logger = newDefaultLogger({\n defaultLogLevel: ops.defaultLoggerLogLevel,\n });\n }\n\n const buildInfo = ops.buildInfo || getBuildInfo(webpackConfig.context!);\n setBuildInfo(buildInfo);\n\n // publicPath from webpack.output has a trailing slash at the end.\n const { publicPath, path: outputPath } = webpackConfig.output!;\n\n const manifestLink = fs.existsSync(`${outputPath}/manifest.json`)\n ? `<link rel=\"manifest\" href=\"${publicPath}manifest.json\">` : '';\n\n interface BufferWithNonce extends Buffer {\n nonce: string;\n }\n\n const cache = ops.staticCacheController\n ? new Cache<{\n buffer: BufferWithNonce;\n status: number;\n }>(ops.staticCacheSize!)\n : null;\n\n const CHUNK_GROUPS = readChunkGroupsJson(outputPath!);\n\n return async (req, res, next) => {\n try {\n // Ensures any caches always revalidate HTML markup before reuse.\n res.set('Cache-Control', 'no-cache');\n\n res.cookie('csrfToken', req.csrfToken());\n\n let cacheRef: CacheRefT | null | undefined;\n if (cache) {\n cacheRef = ops.staticCacheController!(req);\n if (cacheRef) {\n const data = cache.get(cacheRef);\n if (data !== null) {\n const { buffer, status } = data;\n if (ops.noCsp && isBrotliAcceptable(req)) {\n res.set('Content-Type', 'text/html');\n res.set('Content-Encoding', 'br');\n if (status !== 200) res.status(status);\n res.send(buffer);\n } else {\n await new Promise<void>((done, failed) => {\n brotliDecompress(buffer, (error, html) => {\n if (error) failed(error);\n else {\n let h = html.toString();\n if (!ops.noCsp) {\n // TODO: Starting from Node v15 we'll be able to use string's\n // .replaceAll() method instead relying on reg. expression for\n // global matching.\n const regex = new RegExp(buffer.nonce, 'g');\n h = h.replace(regex, (req as any).nonce);\n }\n if (status !== 200) res.status(status);\n res.send(h);\n done();\n }\n });\n });\n }\n return;\n }\n }\n }\n\n const [{\n configToInject,\n extraScripts,\n initialState,\n }, {\n cipher,\n iv,\n }] = await Promise.all([\n ops.beforeRender!(req, sanitizedConfig as any),\n prepareCipher(buildInfo.key) as Promise<any>,\n ]);\n\n let helmet;\n\n // Gets the mapping between code chunk names and their asset files.\n // These data come from the Webpack compilation, either from the stats\n // attached to the request (in dev mode), or from a file output during\n // the build (in prod mode).\n let chunkGroups: ChunkGroupsT;\n const webpackStats = get(res.locals, 'webpack.devMiddleware.stats');\n if (webpackStats) {\n chunkGroups = mapValues(\n webpackStats.toJson({\n all: false,\n chunkGroups: true,\n }).namedChunkGroups,\n (item) => item.assets.map(({ name }: { name: string }) => name),\n );\n } else if (CHUNK_GROUPS) chunkGroups = CHUNK_GROUPS;\n else chunkGroups = {};\n\n /* Optional server-side rendering. */\n const App = ops.Application;\n let appHtmlMarkup: string = '';\n const ssrContext = new ServerSsrContext(req, chunkGroups, initialState);\n let stream: PipeableStream;\n if (App) {\n const ssrStart = Date.now();\n\n // TODO: Somehow, without it TS does not realise that\n // App has been checked to exist.\n const App2 = App;\n\n const renderPass = async () => {\n ssrContext.chunks = [];\n return new Promise<PipeableStream>((resolve, reject) => {\n const pipeableStream = renderToPipeableStream(\n <GlobalStateProvider\n initialState={ssrContext.state}\n ssrContext={ssrContext}\n >\n <StaticRouter\n future={{\n v7_relativeSplatPath: true,\n v7_startTransition: true,\n }}\n location={req.url}\n >\n <App2 />\n </StaticRouter>\n </GlobalStateProvider>,\n {\n onAllReady: () => resolve(pipeableStream),\n onError: reject,\n },\n );\n });\n };\n\n let ssrRound = 0;\n let bailed = false;\n for (; ssrRound < ops.maxSsrRounds!; ++ssrRound) {\n stream = await renderPass(); // eslint-disable-line no-await-in-loop\n\n if (!ssrContext.dirty) break;\n\n /* eslint-disable no-await-in-loop */\n const timeout = ops.ssrTimeout! + ssrStart - Date.now();\n bailed = timeout <= 0 || !await Promise.race([\n Promise.allSettled(ssrContext.pending),\n timer(timeout).then(() => false),\n ]);\n if (bailed) break;\n /* eslint-enable no-await-in-loop */\n }\n\n let logMsg;\n if (ssrContext.dirty) {\n // NOTE: In the case of incomplete SSR one more round is necessary\n // to ensure the correct hydration when some pending promises have\n // resolved and placed their data into the initial global state.\n stream = await renderPass();\n\n logMsg = bailed ? `SSR timed out after ${ops.ssrTimeout} second(s)`\n : `SSR bailed out after ${ops.maxSsrRounds} round(s)`;\n } else logMsg = `SSR completed in ${ssrRound + 1} round(s)`;\n\n ops.logger!.log(ssrContext.dirty ? 'warn' : 'info', logMsg);\n\n stream!.pipe(new Writable({\n write: (chunk, _, done) => {\n appHtmlMarkup += chunk.toString();\n done();\n },\n }));\n\n /* This takes care about server-side rendering of page title and meta tags\n * (still demands injection into HTML template, which happens below). */\n helmet = Helmet.renderStatic();\n }\n\n /* Encrypts data to be injected into HTML.\n * Keep in mind, that this encryption is no way secure: as the JS bundle\n * contains decryption key and is able to decode it at the client side.\n * Hovewer, for a number of reasons, encryption of injected data is still\n * better than injection of a plain text. */\n const payload = serializeJs({\n CHUNK_GROUPS: chunkGroups,\n CONFIG: configToInject || sanitizedConfig,\n ISTATE: ssrContext.state,\n }, {\n ignoreFunction: true,\n unsafe: true,\n });\n cipher.update(forge.util.createBuffer(payload, 'utf8'));\n cipher.finish();\n const INJ = forge.util.encode64(`${iv}${cipher.output.data}`);\n\n const chunkSet = new Set<string>();\n\n // TODO: \"main\" chunk has to be added explicitly,\n // because unlike all other chunks they are not managed by <CodeSplit>\n // component, thus they are not added to the ssrContext.chunks\n // automatically. Actually, names of these entry chunks should be\n // read from Wepback config, as the end user may customize them,\n // remove or add other entry points, but it requires additional\n // efforts to figure out how to automatically order them right,\n // thus for now this handles the default config.\n [\n 'main',\n ...ssrContext.chunks,\n ].forEach((chunk) => {\n const assets = chunkGroups[chunk];\n if (assets) assets.forEach((asset) => chunkSet.add(asset));\n });\n\n let styleChunkString = '';\n let scriptChunkString = '';\n chunkSet.forEach((chunk) => {\n if (chunk.endsWith('.css')) {\n styleChunkString += `<link href=\"${publicPath}${chunk}\" rel=\"stylesheet\">`;\n } else if (\n chunk.endsWith('.js')\n // In dev mode HMR adds JS updates into asset arrays,\n // and they (updates) should be ignored.\n && !chunk.endsWith('.hot-update.js')\n ) {\n scriptChunkString += `<script src=\"${publicPath}${chunk}\" type=\"application/javascript\"></script>`;\n }\n });\n\n const grouppedExtraScripts = groupExtraScripts(extraScripts);\n\n const faviconLink = ops.favicon ? (\n '<link rel=\"shortcut icon\" href=\"/favicon.ico\">'\n ) : '';\n\n const html = `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n ${grouppedExtraScripts[SCRIPT_LOCATIONS.HEAD_OPEN]}\n ${helmet ? helmet.title.toString() : ''}\n ${helmet ? helmet.meta.toString() : ''}\n <meta name=\"theme-color\" content=\"#FFFFFF\">\n ${manifestLink}\n ${styleChunkString}\n ${faviconLink}\n <meta charset=\"utf-8\">\n <meta\n content=\"width=device-width,initial-scale=1.0\"\n name=\"viewport\"\n >\n <meta itemprop=\"drpruinj\" content=\"${INJ}\">\n </head>\n <body>\n ${grouppedExtraScripts[SCRIPT_LOCATIONS.BODY_OPEN]}\n <div id=\"react-view\">${appHtmlMarkup}</div>\n ${scriptChunkString}\n ${grouppedExtraScripts[SCRIPT_LOCATIONS.DEFAULT]}\n </body>\n </html>`;\n\n const status = ssrContext.status || 200;\n if (status !== 200) res.status(status);\n\n if (cacheRef && status < 500) {\n // Note: waiting for the caching to complete is not strictly necessary,\n // but it greately simplifies testing, and error reporting.\n await new Promise<void>((done, failed) => {\n brotliCompress(html, (error, buffer) => {\n const b = buffer as BufferWithNonce;\n if (error) failed(error);\n else {\n b.nonce = (req as any).nonce; // eslint-disable-line no-param-reassign\n cache!.add({ buffer: b, status }, cacheRef!.key, buffer.length);\n done();\n }\n });\n });\n }\n\n // Note: as caching code above may throw in some cases, sending response\n // before it completes will likely hide the error, making it difficult\n // to debug. Thus, at least for now, lets send response after it.\n res.send(html);\n } catch (error) {\n next(error);\n }\n };\n}\n"],"mappings":"kUAIA,IAAAA,GAAA,CAAAC,sBAAA,CAAAC,OAAA,QACA,IAAAC,KAAA,CAAAF,sBAAA,CAAAC,OAAA,UAEAA,OAAA,YACAA,OAAA,UACA,IAAAE,OAAA,CAAAF,OAAA,WACA,IAAAG,KAAA,CAAAH,OAAA,SACA,IAAAI,QAAA,CAAAL,sBAAA,CAAAC,OAAA,aAEA,IAAAK,iBAAA,CAAAL,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G,KAAK,CAAE;AAC9BtB,KAAK,CAAE6F,GAAG,CAAC,CAAEnF,MAAM,CAAE6F,CAAC,CAAEjM,MAAO,CAAC,CAAEkG,QAAQ,CAAE9E,GAAG,CAAEgF,MAAM,CAAChE,MAAM,CAAC,CAC/DmE,IAAI,CAAC,CACP,CACF,CAAC,CACH,CAAC,CACH,CAEA;AACA;AACA;AACAtF,GAAG,CAACqF,IAAI,CAACK,IAAI,CACf,CAAE,MAAOD,KAAK,CAAE,CACdZ,IAAI,CAACY,KAAK,CACZ,CACF,CACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","names":["_httpStatusCodes","require","_joi","_interopRequireDefault","ErrorWithStatus","Error","status","CODES","INTERNAL_SERVER_ERROR","newError","message","statusCode","error","fail","assert","value","schema","BAD_REQUEST","validate","abortEarly","concat"],"sources":["../../../../src/server/utils/errors.ts"],"sourcesContent":["/**\n * @category Utilities\n * @module server/errors\n * @desc\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { errors } = server;\n * ```\n * Server-side helpers for error handling.\n */\n\nimport {\n StatusCodes as CODES,\n ReasonPhrases as ERRORS,\n getReasonPhrase as getErrorForCode,\n} from 'http-status-codes';\n\nimport joi from 'joi';\n\n/**\n * @static\n * @const CODES\n * @desc An alias for\n * [StatusCodes object from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * It is a map between HTTP status code names and corresponding numeric codes.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { CODES } = server.errors;\n * console.log(CODES.BAD_REQUEST); // Prints: 400\n */\nexport { CODES };\n\n/**\n * @static\n * @const ERRORS\n * @desc An alias for\n * [ReasonPhrases object from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * It is a map between HTTP status code names and their pretty-printed forms.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { ERRORS } = server.errors;\n * console.log(ERRORS.BAD_REQUEST); // Prints: Bad Request\n */\nexport { ERRORS };\n\n/**\n * @static\n * @func getErrorForCode\n * @desc An alias for\n * [getReasonPhrase() function from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * Given an HTTP code it returns the corresponding error text.\n * @param {number} code HTTP code.\n * @return {string} HTTP error text.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * console.log(server.errors.getErrorForCode(400)); // Prints: Bad Request\n */\nexport { getErrorForCode };\n\n/**\n * @static\n * @const joi\n * @desc An alias for [Joi library](https://joi.dev/api/?v=17.4.0),\n * which provides tooling for HTTP request validation. You can use it in any\n * way you would use that library import.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { joi } = server.errors;\n * const requestBodySchema = joi.object({\n * sampleKey: joi.string().max(16).required(),\n * });\n */\nexport { joi };\n\n// TODO: It could accept the status code as a constructor argument.\nclass ErrorWithStatus extends Error {\n status: number = CODES.INTERNAL_SERVER_ERROR;\n}\n\n/**\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { newError } = server.errors;\n * ```\n * Creates a new `Error` object with given message, and HTTP status code\n * attached as `status` field.\n * @param {string} message Error message.\n * @param {number} [statusCode=500] HTTP status code. Defaults to 500 (Internal\n * Server Error).\n * @return {Error}\n */\nexport function newError(message: string, statusCode = CODES.INTERNAL_SERVER_ERROR) {\n const error = new ErrorWithStatus(message);\n error.status = statusCode;\n return error;\n}\n\n/**\n * Throws an error with given message and HTTP status code.\n */\nexport function fail(\n message: string,\n statusCode: CODES = CODES.INTERNAL_SERVER_ERROR,\n): never {\n throw newError(message, statusCode);\n}\n\n/**\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { assert } = server.errors;\n * ```\n * Validates a value using given Joi schema, and throws an error with given\n * message and HTTP status code in case of the validation failure.\n * @param value\n * @param schema\n * @param [message] Error message.\n * @param [statusCode=500] HTTP status code. Defaults to 400 (Bad\n * Request).\n */\nexport function assert(\n value: any,\n schema: joi.AnySchema,\n message = '',\n statusCode = CODES.BAD_REQUEST,\n) {\n const { error } = schema.validate(value, { abortEarly: false });\n if (error) {\n fail(message.concat(message ? '\\n' : '', error.message), statusCode);\n }\n}\n"],"mappings":"8oBAWA,IAAAA,gBAAA,CAAAC,OAAA,sBAMA,IAAAC,IAAA,CAAAC,sBAAA,CAAAF,OAAA,SAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA,KAAM,CAAAG,eAAe,QAAS,CAAAC,KAAM,CAClCC,MAAM,CAAWC,4BAAK,CAACC,qBACzB,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAC,QAAQA,CAACC,OAAe,CAAEC,UAAU,CAAGJ,4BAAK,CAACC,qBAAqB,CAAE,CAClF,KAAM,CAAAI,KAAK,CAAG,GAAI,CAAAR,eAAe,CAACM,OAAO,CAAC,CAC1CE,KAAK,CAACN,MAAM,CAAGK,UAAU,CACzB,MAAO,CAAAC,KACT,CAEA;AACA;AACA,GACO,QAAS,CAAAC,IAAIA,CAClBH,OAAe,CACfC,UAAiB,CAAGJ,4BAAK,CAACC,qBAAqB,CACxC,CACP,KAAM,CAAAC,QAAQ,CAACC,OAAO,CAAEC,UAAU,CACpC,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAG,MAAMA,CACpBC,KAAU,CACVC,MAAqB,CACrBN,OAAO,CAAG,EAAE,CACZC,UAAU,CAAGJ,4BAAK,CAACU,WAAW,CAC9B,CACA,KAAM,CAAEL,KAAM,CAAC,CAAGI,MAAM,CAACE,QAAQ,CAACH,KAAK,CAAE,CAAEI,UAAU,CAAE,KAAM,CAAC,CAAC,CAC/D,GAAIP,KAAK,CAAE,CACTC,IAAI,CAACH,OAAO,CAACU,MAAM,CAACV,OAAO,CAAG,IAAI,CAAG,EAAE,CAAEE,KAAK,CAACF,OAAO,CAAC,CAAEC,UAAU,CACrE,CACF","ignoreList":[]}
1
+ {"version":3,"file":"errors.js","names":["_httpStatusCodes","require","_joi","_interopRequireDefault","ErrorWithStatus","Error","status","CODES","INTERNAL_SERVER_ERROR","newError","message","statusCode","error","fail","assert","value","schema","BAD_REQUEST","validate","abortEarly","concat"],"sources":["../../../../src/server/utils/errors.ts"],"sourcesContent":["/**\n * @category Utilities\n * @module server/errors\n * @desc\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { errors } = server;\n * ```\n * Server-side helpers for error handling.\n */\n\nimport {\n StatusCodes as CODES,\n ReasonPhrases as ERRORS,\n getReasonPhrase as getErrorForCode,\n} from 'http-status-codes';\n\nimport joi from 'joi';\n\n/**\n * @static\n * @const CODES\n * @desc An alias for\n * [StatusCodes object from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * It is a map between HTTP status code names and corresponding numeric codes.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { CODES } = server.errors;\n * console.log(CODES.BAD_REQUEST); // Prints: 400\n */\nexport { CODES };\n\n/**\n * @static\n * @const ERRORS\n * @desc An alias for\n * [ReasonPhrases object from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * It is a map between HTTP status code names and their pretty-printed forms.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { ERRORS } = server.errors;\n * console.log(ERRORS.BAD_REQUEST); // Prints: Bad Request\n */\nexport { ERRORS };\n\n/**\n * @static\n * @func getErrorForCode\n * @desc An alias for\n * [getReasonPhrase() function from **http-status-codes** library](https://www.npmjs.com/package/http-status-codes).\n * Given an HTTP code it returns the corresponding error text.\n * @param {number} code HTTP code.\n * @return {string} HTTP error text.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * console.log(server.errors.getErrorForCode(400)); // Prints: Bad Request\n */\nexport { getErrorForCode };\n\n/**\n * @static\n * @const joi\n * @desc An alias for [Joi library](https://joi.dev/api/?v=17.4.0),\n * which provides tooling for HTTP request validation. You can use it in any\n * way you would use that library import.\n * @example\n * import { server } from '@dr.pogodin/react-utils';\n * const { joi } = server.errors;\n * const requestBodySchema = joi.object({\n * sampleKey: joi.string().max(16).required(),\n * });\n */\nexport { joi };\n\n// TODO: It could accept the status code as a constructor argument.\nclass ErrorWithStatus extends Error {\n status: number = CODES.INTERNAL_SERVER_ERROR;\n}\n\n/**\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { newError } = server.errors;\n * ```\n * Creates a new `Error` object with given message, and HTTP status code\n * attached as `status` field.\n * @param {string} message Error message.\n * @param {number} [statusCode=500] HTTP status code. Defaults to 500 (Internal\n * Server Error).\n * @return {Error}\n */\nexport function newError(message: string, statusCode = CODES.INTERNAL_SERVER_ERROR) {\n const error = new ErrorWithStatus(message);\n error.status = statusCode;\n return error;\n}\n\n/**\n * Throws an error with given message and HTTP status code.\n */\nexport function fail(\n message: string,\n statusCode: CODES = CODES.INTERNAL_SERVER_ERROR,\n): Error {\n throw newError(message, statusCode);\n}\n\n/**\n * ```js\n * import { server } from '@dr.pogodin/react-utils';\n * const { assert } = server.errors;\n * ```\n * Validates a value using given Joi schema, and throws an error with given\n * message and HTTP status code in case of the validation failure.\n * @param value\n * @param schema\n * @param [message] Error message.\n * @param [statusCode=500] HTTP status code. Defaults to 400 (Bad\n * Request).\n */\nexport function assert(\n value: any,\n schema: joi.AnySchema,\n message = '',\n statusCode = CODES.BAD_REQUEST,\n) {\n const { error } = schema.validate(value, { abortEarly: false });\n if (error) {\n fail(message.concat(message ? '\\n' : '', error.message), statusCode);\n }\n}\n"],"mappings":"8oBAWA,IAAAA,gBAAA,CAAAC,OAAA,sBAMA,IAAAC,IAAA,CAAAC,sBAAA,CAAAF,OAAA,SAjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAGA;AACA,KAAM,CAAAG,eAAe,QAAS,CAAAC,KAAM,CAClCC,MAAM,CAAWC,4BAAK,CAACC,qBACzB,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAC,QAAQA,CAACC,OAAe,CAAEC,UAAU,CAAGJ,4BAAK,CAACC,qBAAqB,CAAE,CAClF,KAAM,CAAAI,KAAK,CAAG,GAAI,CAAAR,eAAe,CAACM,OAAO,CAAC,CAC1CE,KAAK,CAACN,MAAM,CAAGK,UAAU,CACzB,MAAO,CAAAC,KACT,CAEA;AACA;AACA,GACO,QAAS,CAAAC,IAAIA,CAClBH,OAAe,CACfC,UAAiB,CAAGJ,4BAAK,CAACC,qBAAqB,CACxC,CACP,KAAM,CAAAC,QAAQ,CAACC,OAAO,CAAEC,UAAU,CACpC,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAG,MAAMA,CACpBC,KAAU,CACVC,MAAqB,CACrBN,OAAO,CAAG,EAAE,CACZC,UAAU,CAAGJ,4BAAK,CAACU,WAAW,CAC9B,CACA,KAAM,CAAEL,KAAM,CAAC,CAAGI,MAAM,CAACE,QAAQ,CAACH,KAAK,CAAE,CAAEI,UAAU,CAAE,KAAM,CAAC,CAAC,CAC/D,GAAIP,KAAK,CAAE,CACTC,IAAI,CAACH,OAAO,CAACU,MAAM,CAACV,OAAO,CAAG,IAAI,CAAG,EAAE,CAAEE,KAAK,CAACF,OAAO,CAAC,CAAEC,UAAU,CACrE,CACF","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;require("react");require("react-router-dom");var _jsxRuntime=require("react/jsx-runtime");/* global window *//**
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _jsxRuntime=require("react/jsx-runtime");/**
2
2
  * The `<Link>` component, and almost identical `<NavLink>` component, are
3
3
  * auxiliary wrappers around
4
4
  * [React Router](https://github.com/ReactTraining/react-router)'s
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["require","_jsxRuntime","GenericLink","children","className","disabled","enforceA","keepScrollPosition","onClick","onMouseDown","openNewTab","replace","routerLinkType","to","rest","match","jsx","href","e","preventDefault","rel","target","L","window","scroll","_default","exports","default"],"sources":["../../../../../src/shared/components/GenericLink/index.tsx"],"sourcesContent":["/* global window */\n\nimport { type ReactNode } from 'react';\n\nimport { type Link, type NavLink } from 'react-router-dom';\n\nimport './style.scss';\n\ntype ToT = Parameters<typeof Link>[0]['to'];\n\ninterface LinkI {}\n\nexport type PropsT = {\n children?: ReactNode;\n className?: string;\n disabled?: boolean;\n enforceA?: boolean;\n keepScrollPosition?: boolean;\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n onMouseDown?: React.MouseEventHandler<HTMLAnchorElement>;\n openNewTab?: boolean;\n replace?: boolean;\n routerLinkType: LinkI;\n to?: ToT;\n};\n\n/**\n * The `<Link>` component, and almost identical `<NavLink>` component, are\n * auxiliary wrappers around\n * [React Router](https://github.com/ReactTraining/react-router)'s\n * `<Link>` and `<NavLink>` components; they help to handle external and\n * internal links in uniform manner.\n *\n * @param [props] Component properties.\n * @param [props.className] CSS classes to apply to the link.\n * @param [props.disabled] Disables the link.\n * @param [props.enforceA] `true` enforces rendering of the link as\n * a simple `<a>` element.\n * @param [props.keepScrollPosition] If `true`, and the link is\n * rendered as a React Router's component, it won't reset the viewport scrolling\n * position to the origin when clicked.\n * @param [props.onClick] Event handler to trigger upon click.\n * @param [props.onMouseDown] Event handler to trigger on MouseDown\n * event.\n * @param [props.openNewTab] If `true` the link opens in a new tab.\n * @param [props.replace] When `true`, the link will replace current\n * entry in the history stack instead of adding a new one.\n * @param [props.to] Link URL.\n * @param [props.activeClassName] **`<NavLink>`** only: CSS class(es)\n * to apply to rendered link when it is active.\n * @param [props.activeStyle] **`<NavLink>`** only: CSS styles\n * to apply to the rendered link when it is active.\n * @param [props.exact] **`<NavLink>`** only: if `true`, the active\n * class/style will only be applied if the location is matched exactly.\n * @param [props.isActive] **`<NavLink>`** only: Add extra\n * logic for determining whether the link is active. This should be used if you\n * want to do more than verify that the link’s pathname matches the current URL\n * pathname.\n * @param [props.location] **`<NavLink>`** only: `isActive` compares\n * current history location (usually the current browser URL). To compare to\n * a different location, a custom `location` can be passed.\n * @param [props.strict] **`<NavLink>`** only: . When `true`, trailing\n * slash on a location’s pathname will be taken into consideration when\n * determining if the location matches the current URL. See the `<Route strict>`\n * documentation for more information.\n */\nconst GenericLink: React.FunctionComponent<PropsT> = ({\n children,\n className,\n disabled,\n enforceA,\n keepScrollPosition,\n onClick,\n onMouseDown,\n openNewTab,\n replace,\n routerLinkType,\n to,\n ...rest\n}) => {\n /* Renders Link as <a> element if:\n * - It is opted explicitely by `enforceA` prop;\n * - It should be opened in a new tab;\n * - It is an absolte URL (starts with http:// or https://);\n * - It is anchor link (starts with #). */\n if (disabled || enforceA || openNewTab || (to as string)?.match(/^(#|(https?|mailto):)/)) {\n return (\n <a\n className={className}\n // TODO: This requires a fix: disabled is not really an attribute of <a>\n // tag, thus for disabled option we rather should render a plain text\n // styled as a link.\n // disabled={disabled}\n href={to as string}\n onClick={disabled ? (e) => e.preventDefault() : onClick}\n onMouseDown={disabled ? (e) => e.preventDefault() : onMouseDown}\n rel=\"noopener noreferrer\"\n styleName=\"link\"\n target={openNewTab ? '_blank' : ''}\n >\n {children}\n </a>\n );\n }\n\n const L = routerLinkType as typeof NavLink;\n\n return (\n <L\n className={className}\n // disabled\n onMouseDown={onMouseDown}\n replace={replace}\n to={to!}\n onClick={(e: React.MouseEvent<HTMLAnchorElement>) => {\n // Executes the user-provided event handler, if any.\n if (onClick) onClick(e);\n\n // By default, clicking the link scrolls the page to beginning.\n if (!keepScrollPosition) window.scroll(0, 0);\n }}\n {...rest} // eslint-disable-line react/jsx-props-no-spreading\n >\n {children}\n </L>\n );\n};\n\nexport default GenericLink;\n"],"mappings":"6FAEAA,OAAA,UAEAA,OAAA,qBAA2D,IAAAC,WAAA,CAAAD,OAAA,sBAJ3D,mBA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,KAAM,CAAAE,WAA4C,CAAGA,CAAC,CACpDC,QAAQ,CACRC,SAAS,CACTC,QAAQ,CACRC,QAAQ,CACRC,kBAAkB,CAClBC,OAAO,CACPC,WAAW,CACXC,UAAU,CACVC,OAAO,CACPC,cAAc,CACdC,EAAE,CACF,GAAGC,IACL,CAAC,GAAK,CACJ;AACF;AACA;AACA;AACA,4CACE,GAAIT,QAAQ,EAAIC,QAAQ,EAAII,UAAU,EAAKG,EAAE,EAAaE,KAAK,CAAC,uBAAuB,CAAC,CAAE,CACxF,mBACE,GAAAd,WAAA,CAAAe,GAAA,OACEZ,SAAS,EAAEA,SAAS,CAATA,SAAS,iBACpB;AACA;AACA;AACA;AAAA,CACAa,IAAI,CAAEJ,EAAa,CACnBL,OAAO,CAAEH,QAAQ,CAAIa,CAAC,EAAKA,CAAC,CAACC,cAAc,CAAC,CAAC,CAAGX,OAAQ,CACxDC,WAAW,CAAEJ,QAAQ,CAAIa,CAAC,EAAKA,CAAC,CAACC,cAAc,CAAC,CAAC,CAAGV,WAAY,CAChEW,GAAG,CAAC,qBAAqB,CAEzBC,MAAM,CAAEX,UAAU,CAAG,QAAQ,CAAG,EAAG,CAAAP,QAAA,CAElCA,QAAQ,CACR,CAEP,CAEA,KAAM,CAAAmB,CAAC,CAAGV,cAAgC,CAE1C,mBACE,GAAAX,WAAA,CAAAe,GAAA,EAACM,CAAC,EACAlB,SAAS,CAAEA,SACX;AAAA,CACAK,WAAW,CAAEA,WAAY,CACzBE,OAAO,CAAEA,OAAQ,CACjBE,EAAE,CAAEA,EAAI,CACRL,OAAO,CAAGU,CAAsC,EAAK,CACnD;AACA,GAAIV,OAAO,CAAEA,OAAO,CAACU,CAAC,CAAC,CAEvB;AACA,GAAI,CAACX,kBAAkB,CAAEgB,MAAM,CAACC,MAAM,CAAC,CAAC,CAAE,CAAC,CAC7C,CAAE,IACEV,IAAI,CAAAX,QAAA,CAEPA,QAAQ,CACR,CAEP,CAAC,CAAC,IAAAsB,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAEazB,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["GenericLink","children","className","disabled","enforceA","keepScrollPosition","onClick","onMouseDown","openNewTab","replace","routerLinkType","to","rest","match","_jsxRuntime","jsx","href","e","preventDefault","rel","target","L","window","scroll","_default","exports","default"],"sources":["../../../../../src/shared/components/GenericLink/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport type {\n Link,\n LinkProps,\n NavLink,\n NavLinkProps,\n} from 'react-router-dom';\n\nimport './style.scss';\n\ntype LinkT = typeof Link;\ntype NavLinkT = typeof NavLink;\n\ntype ToT = Parameters<typeof Link>[0]['to'];\n\nexport type PropsT = {\n children?: ReactNode;\n className?: string;\n disabled?: boolean;\n enforceA?: boolean;\n keepScrollPosition?: boolean;\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n onMouseDown?: React.MouseEventHandler<HTMLAnchorElement>;\n openNewTab?: boolean;\n replace?: boolean;\n routerLinkType: LinkT | NavLinkT;\n to: ToT;\n};\n\n/**\n * The `<Link>` component, and almost identical `<NavLink>` component, are\n * auxiliary wrappers around\n * [React Router](https://github.com/ReactTraining/react-router)'s\n * `<Link>` and `<NavLink>` components; they help to handle external and\n * internal links in uniform manner.\n *\n * @param [props] Component properties.\n * @param [props.className] CSS classes to apply to the link.\n * @param [props.disabled] Disables the link.\n * @param [props.enforceA] `true` enforces rendering of the link as\n * a simple `<a>` element.\n * @param [props.keepScrollPosition] If `true`, and the link is\n * rendered as a React Router's component, it won't reset the viewport scrolling\n * position to the origin when clicked.\n * @param [props.onClick] Event handler to trigger upon click.\n * @param [props.onMouseDown] Event handler to trigger on MouseDown\n * event.\n * @param [props.openNewTab] If `true` the link opens in a new tab.\n * @param [props.replace] When `true`, the link will replace current\n * entry in the history stack instead of adding a new one.\n * @param [props.to] Link URL.\n * @param [props.activeClassName] **`<NavLink>`** only: CSS class(es)\n * to apply to rendered link when it is active.\n * @param [props.activeStyle] **`<NavLink>`** only: CSS styles\n * to apply to the rendered link when it is active.\n * @param [props.exact] **`<NavLink>`** only: if `true`, the active\n * class/style will only be applied if the location is matched exactly.\n * @param [props.isActive] **`<NavLink>`** only: Add extra\n * logic for determining whether the link is active. This should be used if you\n * want to do more than verify that the link’s pathname matches the current URL\n * pathname.\n * @param [props.location] **`<NavLink>`** only: `isActive` compares\n * current history location (usually the current browser URL). To compare to\n * a different location, a custom `location` can be passed.\n * @param [props.strict] **`<NavLink>`** only: . When `true`, trailing\n * slash on a location’s pathname will be taken into consideration when\n * determining if the location matches the current URL. See the `<Route strict>`\n * documentation for more information.\n */\nconst GenericLink = ({\n children,\n className,\n disabled,\n enforceA,\n keepScrollPosition,\n onClick,\n onMouseDown,\n openNewTab,\n replace,\n routerLinkType,\n to,\n ...rest\n}: (LinkProps | NavLinkProps) & PropsT): ReactNode => {\n /* Renders Link as <a> element if:\n * - It is opted explicitely by `enforceA` prop;\n * - It should be opened in a new tab;\n * - It is an absolte URL (starts with http:// or https://);\n * - It is anchor link (starts with #). */\n if (disabled || enforceA || openNewTab || (to as string)?.match(/^(#|(https?|mailto):)/)) {\n return (\n <a\n className={className}\n // TODO: This requires a fix: disabled is not really an attribute of <a>\n // tag, thus for disabled option we rather should render a plain text\n // styled as a link.\n // disabled={disabled}\n href={to as string}\n onClick={disabled ? (e) => e.preventDefault() : onClick}\n onMouseDown={disabled ? (e) => e.preventDefault() : onMouseDown}\n rel=\"noopener noreferrer\"\n styleName=\"link\"\n target={openNewTab ? '_blank' : ''}\n >\n {children}\n </a>\n );\n }\n\n const L = routerLinkType;\n\n return (\n <L\n className={className}\n // disabled\n onMouseDown={onMouseDown}\n replace={replace}\n to={to!}\n onClick={(e: React.MouseEvent<HTMLAnchorElement>) => {\n // Executes the user-provided event handler, if any.\n if (onClick) onClick(e);\n\n // By default, clicking the link scrolls the page to beginning.\n if (!keepScrollPosition) window.scroll(0, 0);\n }}\n {...rest} // eslint-disable-line react/jsx-props-no-spreading\n >\n {children}\n </L>\n );\n};\n\nexport default GenericLink;\n"],"mappings":"0IA8BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,KAAM,CAAAA,WAAW,CAAGA,CAAC,CACnBC,QAAQ,CACRC,SAAS,CACTC,QAAQ,CACRC,QAAQ,CACRC,kBAAkB,CAClBC,OAAO,CACPC,WAAW,CACXC,UAAU,CACVC,OAAO,CACPC,cAAc,CACdC,EAAE,CACF,GAAGC,IACgC,CAAC,GAAgB,CACpD;AACF;AACA;AACA;AACA,4CACE,GAAIT,QAAQ,EAAIC,QAAQ,EAAII,UAAU,EAAKG,EAAE,EAAaE,KAAK,CAAC,uBAAuB,CAAC,CAAE,CACxF,mBACE,GAAAC,WAAA,CAAAC,GAAA,OACEb,SAAS,EAAEA,SAAS,CAATA,SAAS,iBACpB;AACA;AACA;AACA;AAAA,CACAc,IAAI,CAAEL,EAAa,CACnBL,OAAO,CAAEH,QAAQ,CAAIc,CAAC,EAAKA,CAAC,CAACC,cAAc,CAAC,CAAC,CAAGZ,OAAQ,CACxDC,WAAW,CAAEJ,QAAQ,CAAIc,CAAC,EAAKA,CAAC,CAACC,cAAc,CAAC,CAAC,CAAGX,WAAY,CAChEY,GAAG,CAAC,qBAAqB,CAEzBC,MAAM,CAAEZ,UAAU,CAAG,QAAQ,CAAG,EAAG,CAAAP,QAAA,CAElCA,QAAQ,CACR,CAEP,CAEA,KAAM,CAAAoB,CAAC,CAAGX,cAAc,CAExB,mBACE,GAAAI,WAAA,CAAAC,GAAA,EAACM,CAAC,EACAnB,SAAS,CAAEA,SACX;AAAA,CACAK,WAAW,CAAEA,WAAY,CACzBE,OAAO,CAAEA,OAAQ,CACjBE,EAAE,CAAEA,EAAI,CACRL,OAAO,CAAGW,CAAsC,EAAK,CACnD;AACA,GAAIX,OAAO,CAAEA,OAAO,CAACW,CAAC,CAAC,CAEvB;AACA,GAAI,CAACZ,kBAAkB,CAAEiB,MAAM,CAACC,MAAM,CAAC,CAAC,CAAE,CAAC,CAC7C,CAAE,IACEX,IAAI,CAAAX,QAAA,CAEPA,QAAQ,CACR,CAEP,CAAC,CAAC,IAAAuB,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAEa1B,WAAW","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","names":["_reactRouterDom","require","_GenericLink","_interopRequireDefault","_jsxRuntime","Link","props","jsx","default","routerLinkType","RrLink","_default","exports"],"sources":["../../../../src/shared/components/Link.tsx"],"sourcesContent":["/**\n * The Link wraps around React Router's Link component, to automatically replace\n * it by the regular <a> element when:\n * - The target reference points to another domain;\n * - User opts to open the reference in a new tab;\n * - User explicitely opts to use <a>.\n */\n\nimport { Link as RrLink } from 'react-router-dom';\n\nimport GenericLink, { type PropsT as GenericLinkPropsT } from './GenericLink';\n\ntype PropsT = Omit<GenericLinkPropsT, 'routerLinkType'>;\n\nconst Link: React.FunctionComponent<PropsT> = (props) => (\n /* eslint-disable react/jsx-props-no-spreading */\n <GenericLink {...props} routerLinkType={RrLink} />\n /* eslint-enable react/jsx-props-no-spreading */\n);\n\nexport default Link;\n"],"mappings":"gLAQA,IAAAA,eAAA,CAAAC,OAAA,qBAEA,IAAAC,YAAA,CAAAC,sBAAA,CAAAF,OAAA,mBAA8E,IAAAG,WAAA,CAAAH,OAAA,sBAV9E;AACA;AACA;AACA;AACA;AACA;AACA,GAQA,KAAM,CAAAI,IAAqC,CAAIC,KAAK,eAClD,iDACA,GAAAF,WAAA,CAAAG,GAAA,EAACL,YAAA,CAAAM,OAAW,KAAKF,KAAK,CAAEG,cAAc,CAAEC,oBAAO,CAAE,CACjD,gDACD,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAAJ,OAAA,CAEaH,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"Link.js","names":["_reactRouterDom","require","_GenericLink","_interopRequireDefault","_jsxRuntime","Link","props","jsx","default","routerLinkType","RrLink","_default","exports"],"sources":["../../../../src/shared/components/Link.tsx"],"sourcesContent":["/**\n * The Link wraps around React Router's Link component, to automatically replace\n * it by the regular <a> element when:\n * - The target reference points to another domain;\n * - User opts to open the reference in a new tab;\n * - User explicitely opts to use <a>.\n */\n\nimport { type LinkProps, Link as RrLink } from 'react-router-dom';\n\nimport GenericLink, { type PropsT as GenericLinkPropsT } from './GenericLink';\n\ntype PropsT = Omit<GenericLinkPropsT, 'routerLinkType'> & LinkProps;\n\nconst Link: React.FunctionComponent<PropsT> = (props) => (\n /* eslint-disable react/jsx-props-no-spreading */\n <GenericLink {...props} routerLinkType={RrLink} />\n /* eslint-enable react/jsx-props-no-spreading */\n);\n\nexport default Link;\n"],"mappings":"gLAQA,IAAAA,eAAA,CAAAC,OAAA,qBAEA,IAAAC,YAAA,CAAAC,sBAAA,CAAAF,OAAA,mBAA8E,IAAAG,WAAA,CAAAH,OAAA,sBAV9E;AACA;AACA;AACA;AACA;AACA;AACA,GAQA,KAAM,CAAAI,IAAqC,CAAIC,KAAK,eAClD,iDACA,GAAAF,WAAA,CAAAG,GAAA,EAACL,YAAA,CAAAM,OAAW,KAAKF,KAAK,CAAEG,cAAc,CAAEC,oBAAO,CAAE,CACjD,gDACD,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAAJ,OAAA,CAEaH,IAAI","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"NavLink.js","names":["_reactRouterDom","require","_GenericLink","_interopRequireDefault","_jsxRuntime","NavLink","props","jsx","default","routerLinkType","RrNavLink","_default","exports"],"sources":["../../../../src/shared/components/NavLink.tsx"],"sourcesContent":["import { NavLink as RrNavLink } from 'react-router-dom';\n\nimport GenericLink, { type PropsT as GenericLinkPropsT } from './GenericLink';\n\ntype PropsT = Omit<GenericLinkPropsT, 'routerLinkType'>;\n\nconst NavLink: React.FunctionComponent<PropsT> = (props) => (\n /* eslint-disable react/jsx-props-no-spreading */\n <GenericLink {...props} routerLinkType={RrNavLink} />\n /* eslint-enable react/jsx-props-no-spreading */\n);\n\nexport default NavLink;\n"],"mappings":"gLAAA,IAAAA,eAAA,CAAAC,OAAA,qBAEA,IAAAC,YAAA,CAAAC,sBAAA,CAAAF,OAAA,mBAA8E,IAAAG,WAAA,CAAAH,OAAA,sBAI9E,KAAM,CAAAI,OAAwC,CAAIC,KAAK,eACrD,iDACA,GAAAF,WAAA,CAAAG,GAAA,EAACL,YAAA,CAAAM,OAAW,KAAKF,KAAK,CAAEG,cAAc,CAAEC,uBAAU,CAAE,CACpD,gDACD,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAAJ,OAAA,CAEaH,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"NavLink.js","names":["_reactRouterDom","require","_GenericLink","_interopRequireDefault","_jsxRuntime","NavLink","props","jsx","default","routerLinkType","RrNavLink","_default","exports"],"sources":["../../../../src/shared/components/NavLink.tsx"],"sourcesContent":["import { type NavLinkProps, NavLink as RrNavLink } from 'react-router-dom';\n\nimport GenericLink, { type PropsT as GenericLinkPropsT } from './GenericLink';\n\ntype PropsT = Omit<GenericLinkPropsT, 'routerLinkType'> & NavLinkProps;\n\nconst NavLink: React.FunctionComponent<PropsT> = (props) => (\n /* eslint-disable react/jsx-props-no-spreading */\n <GenericLink {...props} routerLinkType={RrNavLink} />\n /* eslint-enable react/jsx-props-no-spreading */\n);\n\nexport default NavLink;\n"],"mappings":"gLAAA,IAAAA,eAAA,CAAAC,OAAA,qBAEA,IAAAC,YAAA,CAAAC,sBAAA,CAAAF,OAAA,mBAA8E,IAAAG,WAAA,CAAAH,OAAA,sBAI9E,KAAM,CAAAI,OAAwC,CAAIC,KAAK,eACrD,iDACA,GAAAF,WAAA,CAAAG,GAAA,EAACL,YAAA,CAAAM,OAAW,KAAKF,KAAK,CAAEG,cAAc,CAAEC,uBAAU,CAAE,CACpD,gDACD,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAAJ,OAAA,CAEaH,OAAO","ignoreList":[]}
@@ -4,7 +4,7 @@
4
4
  * @param modulePath
5
5
  * @param [basePath]
6
6
  * @return Required module.
7
- */function requireWeak(modulePath,basePath){if(_isomorphy.IS_CLIENT_SIDE)return null;try{/* eslint-disable no-eval */const{resolve}=eval("require")("path");const path=basePath?resolve(basePath,modulePath):modulePath;const{default:def,...named}=eval("require")(path);/* eslint-enable no-eval */if(!def)return named;Object.entries(named).forEach(([key,value])=>{if(def[key]){if(def[key]!==value){throw Error("Conflict between default and named exports")}}else def[key]=value});return def}catch{return null}}/**
7
+ */function requireWeak(modulePath,basePath){if(_isomorphy.IS_CLIENT_SIDE)return null;try{/* eslint-disable no-eval */const{resolve}=eval("require")("path");const path=basePath?resolve(basePath,modulePath):modulePath;const module=eval("require")(path);/* eslint-enable no-eval */if(!("default"in module))return module;const{default:def,...named}=module;const res=def;Object.entries(named).forEach(([name,value])=>{const assigned=res[name];if(assigned!==undefined){if(assigned!==value){throw Error("Conflict between default and named exports")}}else res[name]=value});return res}catch{return null}}/**
8
8
  * Resolves specified module path with help of Babel's module resolver.
9
9
  * Yes, the function itself just returns its argument to the caller, but Babel
10
10
  * is configured to resolve the first argument of resolveWeak(..) function, thus
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.js","names":["_isomorphy","require","requireWeak","modulePath","basePath","IS_CLIENT_SIDE","resolve","eval","path","default","def","named","Object","entries","forEach","key","value","Error","resolveWeak"],"sources":["../../../../src/shared/utils/webpack.ts"],"sourcesContent":["import { IS_CLIENT_SIDE } from './isomorphy';\n\n/**\n * Requires the specified module without including it into the bundle during\n * Webpack build.\n * @param modulePath\n * @param [basePath]\n * @return Required module.\n */\nexport function requireWeak(\n modulePath: string,\n basePath?: string,\n): NodeJS.Module | null {\n if (IS_CLIENT_SIDE) return null;\n\n try {\n /* eslint-disable no-eval */\n const { resolve } = eval('require')('path');\n const path = basePath ? resolve(basePath, modulePath) : modulePath;\n const { default: def, ...named } = eval('require')(path);\n /* eslint-enable no-eval */\n\n if (!def) return named;\n\n Object.entries(named).forEach(([key, value]) => {\n if (def[key]) {\n if (def[key] !== value) {\n throw Error('Conflict between default and named exports');\n }\n } else def[key] = value;\n });\n return def;\n } catch {\n return null;\n }\n}\n\n/**\n * Resolves specified module path with help of Babel's module resolver.\n * Yes, the function itself just returns its argument to the caller, but Babel\n * is configured to resolve the first argument of resolveWeak(..) function, thus\n * the result will be the resolved path.\n * @param {string} modulePath\n * @return {string} Absolute or relative path to the module.\n */\nexport function resolveWeak(modulePath: string): string {\n return modulePath;\n}\n"],"mappings":"sIAAA,IAAAA,UAAA,CAAAC,OAAA,gBAEA;AACA;AACA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAC,WAAWA,CACzBC,UAAkB,CAClBC,QAAiB,CACK,CACtB,GAAIC,yBAAc,CAAE,MAAO,KAAI,CAE/B,GAAI,CACF,4BACA,KAAM,CAAEC,OAAQ,CAAC,CAAGC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAC3C,KAAM,CAAAC,IAAI,CAAGJ,QAAQ,CAAGE,OAAO,CAACF,QAAQ,CAAED,UAAU,CAAC,CAAGA,UAAU,CAClE,KAAM,CAAEM,OAAO,CAAEC,GAAG,CAAE,GAAGC,KAAM,CAAC,CAAGJ,IAAI,CAAC,SAAS,CAAC,CAACC,IAAI,CAAC,CACxD,2BAEA,GAAI,CAACE,GAAG,CAAE,MAAO,CAAAC,KAAK,CAEtBC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAACG,OAAO,CAAC,CAAC,CAACC,GAAG,CAAEC,KAAK,CAAC,GAAK,CAC9C,GAAIN,GAAG,CAACK,GAAG,CAAC,CAAE,CACZ,GAAIL,GAAG,CAACK,GAAG,CAAC,GAAKC,KAAK,CAAE,CACtB,KAAM,CAAAC,KAAK,CAAC,4CAA4C,CAC1D,CACF,CAAC,IAAM,CAAAP,GAAG,CAACK,GAAG,CAAC,CAAGC,KACpB,CAAC,CAAC,CACF,MAAO,CAAAN,GACT,CAAE,KAAM,CACN,MAAO,KACT,CACF,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAQ,WAAWA,CAACf,UAAkB,CAAU,CACtD,MAAO,CAAAA,UACT","ignoreList":[]}
1
+ {"version":3,"file":"webpack.js","names":["_isomorphy","require","requireWeak","modulePath","basePath","IS_CLIENT_SIDE","resolve","eval","path","module","default","def","named","res","Object","entries","forEach","name","value","assigned","undefined","Error","resolveWeak"],"sources":["../../../../src/shared/utils/webpack.ts"],"sourcesContent":["import { IS_CLIENT_SIDE } from './isomorphy';\n\n/**\n * Requires the specified module without including it into the bundle during\n * Webpack build.\n * @param modulePath\n * @param [basePath]\n * @return Required module.\n */\nexport function requireWeak<Module extends NodeJS.Module>(\n modulePath: string,\n basePath?: string,\n): Module | null {\n if (IS_CLIENT_SIDE) return null;\n\n try {\n /* eslint-disable no-eval */\n const { resolve } = eval('require')('path');\n const path = basePath ? resolve(basePath, modulePath) : modulePath;\n const module = eval('require')(path) as Module;\n /* eslint-enable no-eval */\n\n if (!('default' in module)) return module;\n\n const { default: def, ...named } = module;\n\n const res = def as Module;\n\n Object.entries(named).forEach(([name, value]) => {\n const assigned = res[name as keyof Module];\n if (assigned !== undefined) {\n if (assigned !== value) {\n throw Error('Conflict between default and named exports');\n }\n } else res[name as keyof Module] = value;\n });\n return res;\n } catch {\n return null;\n }\n}\n\n/**\n * Resolves specified module path with help of Babel's module resolver.\n * Yes, the function itself just returns its argument to the caller, but Babel\n * is configured to resolve the first argument of resolveWeak(..) function, thus\n * the result will be the resolved path.\n * @param {string} modulePath\n * @return {string} Absolute or relative path to the module.\n */\nexport function resolveWeak(modulePath: string): string {\n return modulePath;\n}\n"],"mappings":"sIAAA,IAAAA,UAAA,CAAAC,OAAA,gBAEA;AACA;AACA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAC,WAAWA,CACzBC,UAAkB,CAClBC,QAAiB,CACF,CACf,GAAIC,yBAAc,CAAE,MAAO,KAAI,CAE/B,GAAI,CACF,4BACA,KAAM,CAAEC,OAAQ,CAAC,CAAGC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAC3C,KAAM,CAAAC,IAAI,CAAGJ,QAAQ,CAAGE,OAAO,CAACF,QAAQ,CAAED,UAAU,CAAC,CAAGA,UAAU,CAClE,KAAM,CAAAM,MAAM,CAAGF,IAAI,CAAC,SAAS,CAAC,CAACC,IAAI,CAAW,CAC9C,2BAEA,GAAI,EAAE,SAAS,EAAI,CAAAC,MAAM,CAAC,CAAE,MAAO,CAAAA,MAAM,CAEzC,KAAM,CAAEC,OAAO,CAAEC,GAAG,CAAE,GAAGC,KAAM,CAAC,CAAGH,MAAM,CAEzC,KAAM,CAAAI,GAAG,CAAGF,GAAa,CAEzBG,MAAM,CAACC,OAAO,CAACH,KAAK,CAAC,CAACI,OAAO,CAAC,CAAC,CAACC,IAAI,CAAEC,KAAK,CAAC,GAAK,CAC/C,KAAM,CAAAC,QAAQ,CAAGN,GAAG,CAACI,IAAI,CAAiB,CAC1C,GAAIE,QAAQ,GAAKC,SAAS,CAAE,CAC1B,GAAID,QAAQ,GAAKD,KAAK,CAAE,CACtB,KAAM,CAAAG,KAAK,CAAC,4CAA4C,CAC1D,CACF,CAAC,IAAM,CAAAR,GAAG,CAACI,IAAI,CAAiB,CAAGC,KACrC,CAAC,CAAC,CACF,MAAO,CAAAL,GACT,CAAE,KAAM,CACN,MAAO,KACT,CACF,CAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACO,QAAS,CAAAS,WAAWA,CAACnB,UAAkB,CAAU,CACtD,MAAO,CAAAA,UACT","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"style.css","mappings":"AAUA,2ZASE,SACA,aACA,eAJA,SACA,UAIA,wBAIF,8EAEE,cAGF,KACE,cAGF,MACE,gBAGF,aACE,YAGF,oDACE,WACA,aAGF,MACE,yBACA,iBC9CF,KACE,oBAGF,EACE,sBCJA,6CACE,gBACA,YACA,OACA,WACA,eACA,MACA,WACA,WCR0B,CDU1B,4EAGF,6CACE,gBAEA,mBADA,2CASA,SAPA,gBACA,gBEPQ,CFQR,gBACA,mBAEA,eACA,QAEA,+BAJA,YAKA,YEeF,yBF5BA,6CAgBI,gBGlCN,SACE,gBCDF,QACE,QACA,WACA,eACA,aCJF,8CASE,kBACE,oBACA,YACA,kBACA,+CAKF,qBACE,+CAGF,qBAtBO,mBAwBL,eACA,gBACA,aACA,2BACA,kBACA,gEACA,iEAEA,iBACE,+BACA,+CAIJ,cACE,aACA,eACA,CAIE,gIAGF,kBACE,WACA,+CAIJ,eACE,CAEA,qBACA,CA1DK,2BAyDL,gBACA,kCACA,eACA,aACA,+CAGF,4DACE,2BAjEK,4BAmEL,SACA,kBACA,kBACA,QACA,MACA,iEAEA,WACE,uEAKF,wBACE,uEAGF,iBACE,4BACA,4FASA,sBACE,4FAGF,2BACE,oEAKJ,kBACE,CA1GG,2BA4GH,CAFA,yBA1GG,CA4GH,eAMA,CClHN,6CAKE,YACE,OACA,gBACA,gBACA,kBACA,8CAGF,4DACE,sBACA,4BACA,SACA,kBACA,oBACA,kBACA,QACA,MACA,gEAEA,WACE,8CAIJ,kBACE,oBACA,YACA,kBACA,2IAGF,8DAEE,6BACA,mEAIA,gCACA,8CAGF,qBACE,iDAGF,wDACA,0DAEA,uBACE,CADF,oBACE,CADF,eACE,gBACA,sBACA,mBACA,cACA,eACA,qBACA,OACA,aACA,eACA,aACA,0CACA,mEAEA,eACE,4BACA,6BACA,gEAGF,iBACE,+BACA,mEAGF,WC5EF,8CACE,mBACA,aACA,SAGF,8CACE,6BACA,mBACA,eACA,aACA,eAEA,gEACE,kBACA,+BAIJ,8CAEE,gBADA,sBAEA,eAGF,8CACE,mBACA,mBACA,sBACA,mBACA,aACA,SACA,aACA,gECpCJ,kBACE,mBCMA,+CACE,6DACA,sBACA,mBACA,cACA,eACA,qBACA,aACA,YACA,mBACA,kBACA,qBACA,gEAEA,uEACE,cAGF,wIAEE,+DAEA,kBADA,oCACA,CAGF,iEAEE,kBADA,+BAEA,aAKJ,+CACE,mBACA,YAKA,wIAEE,6DACA,gBC/CJ,6CACE,6DACA,gBACA,sBACA,mBACA,eACA,aACA,aAEA,SADA,aAEA,YAGE,uFACE,gBACA,mBACA,WACA,cACA,WACA,YACA,UAIJ,+DACE,kBACA,+BAIA,oFACE,gBACA,mBACA,WACA,cACA,YACA,iBACA,UAKN,6CACE,mBACA,oBACA,YAGF,gDACE,sBAGF,6CACE,YAEA,qEACE,6BCxDJ,8CACE,mBACA,oBACA,YAGF,8CACE,sBACA,mBACA,YACA,aACA,aACA,mCAEA,gEACE,kBACA,+BAIJ,8CACE,sBCZF,6CACE,aACA,iBACA,gBACA,WAGF,6CACE,gBACA,cACA,YVNQ,CUSV,6CACE,OACA,gBC3BJ,kBACE,aACA,aAMA,gDACE,qBAGF,6CACE,gDACA,gBACA,mBACA,qBACA,YACA,cACA,kBACA,WAEA,sGACA,kGCvBJ,kBACE,aACA,cAMA,8CACE,uBAIA,SAHA,oBACA,kBACA,OACA,CAOF,8CASE,qBARA,gBACA,mBACA,WACA,qBAIA,OAHA,eACA,kBACA,KAEA,CAGF,iDACE,qBC9BF,iDACE,kBACA,mBACA,kBAGF,iDACE,YACA,kBACA,WCTF,mDACE,kBACA,kBACA,QACA,0BACA,WCFF,8CACE,YACA,kBAGF,8CACE,gBACA,sBACA,mBACA,sBACA,aACA,SACA,aACA,gBACA,mCACA,YAEA,gEACE,kBACA,+BAGF,oGACE,WADF,qFACE,WAGF,yEACE,gCAEA,yBADA,mBAEA,gEAIJ,8CACE,kBACA","sources":["webpack://@dr.pogodin/react-utils/./src/styles/_global/reset.css","webpack://@dr.pogodin/react-utils/./src/styles/global.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/Modal/base-theme.scss","webpack://@dr.pogodin/react-utils/./src/styles/mixins.scss","webpack://@dr.pogodin/react-utils/./src/styles/_mixins/media.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/Modal/styles.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/Options/style.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/NativeDropdown/theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/Switch/theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/GenericLink/style.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/Button/style.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/Checkbox/theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/Input/theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/PageLayout/base-theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/Throbber/theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/WithTooltip/default-theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/YouTubeVideo/base.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/YouTubeVideo/throbber.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/TextArea/style.scss"],"sourcesContent":[null,"a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote::before,blockquote::after,q::before,q::after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}body{text-rendering:auto}*{box-sizing:border-box}","*.overlay,.context.overlay,.ad.hoc.overlay{background:#eee;height:100%;left:0;opacity:.8;position:fixed;top:0;width:100%;z-index:998}*.overlay:focus,.context.overlay:focus,.ad.hoc.overlay:focus{outline:none}*.container,.context.container,.ad.hoc.container{background:#fff;box-shadow:0 0 14px 1px rgba(38,38,40,.15);border-radius:.3em;max-height:95vh;max-width:1024px;overflow:hidden;padding:.6em 1.2em;width:480px;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);z-index:999}@media(max-width: 1280px){*.container,.context.container,.ad.hoc.container{max-width:95vw}}",null,null,".scrollingDisabledByModal{overflow:hidden}",".overlay{inset:0;opacity:.2;position:fixed;z-index:1000}","*.container,.context.container,.ad.hoc.container{align-items:center;display:inline-flex;margin:.1em;position:relative}*.label,.context.label,.ad.hoc.label{margin:0 .6em 0 1.2em}*.dropdown,.context.dropdown,.ad.hoc.dropdown{border:1px solid gray;border-radius:.3em;cursor:pointer;min-width:200px;outline:none;padding:.3em 3em .3em .6em;position:relative;user-select:none}*.dropdown:focus,.context.dropdown:focus,.ad.hoc.dropdown:focus{border-color:blue;box-shadow:0 0 3px 1px #add8e6}*.option,.context.option,.ad.hoc.option{cursor:pointer;outline:none;padding:0 .6em}*.option:focus,.context.option:focus,.ad.hoc.option:focus{background:#4169e1;color:#fff}*.option:hover,.context.option:hover,.ad.hoc.option:hover{background:#4169e1;color:#fff}*.select,.context.select,.ad.hoc.select{background:#fff;border:1px solid gray;border-radius:0 0 .3em .3em;border-top:none;box-shadow:0 6px 12px 3px #d3d3d3;position:fixed;z-index:1001}*.arrow,.context.arrow,.ad.hoc.arrow{background-image:linear-gradient(to top, lightgray, white 50%, white);border-left:1px solid gray;border-radius:0 .3em .3em 0;bottom:0;padding:.3em .6em;position:absolute;right:0;top:0}*.arrow::after,.context.arrow::after,.ad.hoc.arrow::after{content:\"▼\"}*.active .arrow,.context.active .arrow,.ad.hoc.active .arrow{border-radius:0 .3em 0 0}*.active .dropdown,.context.active .dropdown,.ad.hoc.active .dropdown{border-color:blue;border-radius:.3em .3em 0 0}*.upward.active .arrow,.context.upward.active .arrow,.ad.hoc.upward.active .arrow{border-radius:0 0 .3em}*.upward.active .dropdown,.context.upward.active .dropdown,.ad.hoc.upward.active .dropdown{border-radius:0 0 .3em .3em}*.upward.select,.context.upward.select,.ad.hoc.upward.select{border-bottom:none;border-top:1px solid gray;border-radius:.3em .3em 0 0;box-shadow:none}","*.dropdown,.context.dropdown,.ad.hoc.dropdown{display:flex;flex:1;min-width:5.5em;overflow:hidden;position:relative}*.arrow,.context.arrow,.ad.hoc.arrow{background-image:linear-gradient(to top, lightgray, white 50%, white);border:1px solid gray;border-radius:0 .3em .3em 0;bottom:0;padding:.3em .6em;pointer-events:none;position:absolute;right:0;top:0}*.arrow::after,.context.arrow::after,.ad.hoc.arrow::after{content:\"▼\"}*.container,.context.container,.ad.hoc.container{align-items:center;display:inline-flex;margin:.1em;position:relative}.active+*.arrow,:active+*.arrow,.active+.context.arrow,:active+.context.arrow,.active+.ad.hoc.arrow,:active+.ad.hoc.arrow{background-image:linear-gradient(to bottom, lightgray, white 50%, white);border-bottom-right-radius:0}:focus+*.arrow,:focus+.context.arrow,:focus+.ad.hoc.arrow{border-color:blue;border-left-color:gray}*.label,.context.label,.ad.hoc.label{margin:0 .6em 0 1.5em}*.option,.context.option,.ad.hoc.option{color:#000}*.hiddenOption,.context.hiddenOption,.ad.hoc.hiddenOption{display:none}*.select,.context.select,.ad.hoc.select{appearance:none;background:#fff;border:1px solid gray;border-radius:.3em;color:inherit;cursor:pointer;display:inline-block;flex:1;font:inherit;max-width:100%;outline:none;padding:.3em 3.3em calc(.3em + 1px) 1.2em}*.select:active,.context.select:active,.ad.hoc.select:active{background:#fff;border-bottom-left-radius:0;border-bottom-right-radius:0}*.select:focus,.context.select:focus,.ad.hoc.select:focus{border-color:blue;box-shadow:0 0 3px 1px #add8e6}*.select.invalid,.context.select.invalid,.ad.hoc.select.invalid{color:gray}","*.container,.context.container,.ad.hoc.container{align-items:center;display:flex;gap:.6em}*.option,.context.option,.ad.hoc.option{border:1px solid rgba(0,0,0,0);border-radius:.3em;cursor:pointer;outline:none;padding:0 .9em}*.option:focus,.context.option:focus,.ad.hoc.option:focus{border-color:blue;box-shadow:0 0 3px 1px #add8e6}*.selected,.context.selected,.ad.hoc.selected{border:1px solid gray;background:#fff;cursor:default}*.options,.context.options,.ad.hoc.options{align-items:center;background:#f5f5f5;border:1px solid gray;border-radius:.3em;display:flex;gap:.3em;padding:.3em;user-select:none}",".link[disabled]{cursor:not-allowed}","*.button,.context.button,.ad.hoc.button{background-image:linear-gradient(to top, lightgray, white 50%, white);border:solid 1px gray;border-radius:.3em;color:inherit;cursor:pointer;display:inline-block;font:inherit;margin:.1em;padding:.3em 1.2em;text-align:center;text-decoration:none;user-select:none}*.button:visited,.context.button:visited,.ad.hoc.button:visited{color:inherit}*.button.active,*.button:active,.context.button.active,.context.button:active,.ad.hoc.button.active,.ad.hoc.button:active{background-image:linear-gradient(to bottom, lightgray, white 50%, white);box-shadow:inset 0 1px 3px 0 #d3d3d3;border-color:gray}*.button:focus,.context.button:focus,.ad.hoc.button:focus{box-shadow:0 0 3px 1px #add8e6;border-color:blue;outline:none}*.disabled,.context.disabled,.ad.hoc.disabled{cursor:not-allowed;opacity:.33}*.disabled.active,*.disabled:active,.context.disabled.active,.context.disabled:active,.ad.hoc.disabled.active,.ad.hoc.disabled:active{background-image:linear-gradient(to top, lightgray, white 50%, white);box-shadow:none}","*.checkbox,.context.checkbox,.ad.hoc.checkbox{appearance:none;background:#fff;border:1px solid gray;border-radius:.3em;cursor:pointer;font:inherit;height:1.5em;outline:none;margin:0;width:1.5em}*.checkbox:checked::after,.context.checkbox:checked::after,.ad.hoc.checkbox:checked::after{background:#000;border-radius:.3em;content:\"\";display:block;height:1em;margin:.2em;width:1em}*.checkbox:focus,.context.checkbox:focus,.ad.hoc.checkbox:focus{border-color:blue;box-shadow:0 0 3px 1px #add8e6}*.checkbox.indeterminate::after,.context.checkbox.indeterminate::after,.ad.hoc.checkbox.indeterminate::after{background:#000;border-radius:.2em;content:\"\";display:block;height:.2em;margin:.6em .2em;width:1em}*.container,.context.container,.ad.hoc.container{align-items:center;display:inline-flex;margin:.1em}*.label,.context.label,.ad.hoc.label{margin:0 .6em 0 1.5em}*.disabled,.context.disabled,.ad.hoc.disabled{opacity:.33}*.disabled .checkbox,.context.disabled .checkbox,.ad.hoc.disabled .checkbox{cursor:not-allowed !important}","*.container,.context.container,.ad.hoc.container{align-items:center;display:inline-flex;margin:.1em}*.input,.context.input,.ad.hoc.input{border:1px solid gray;border-radius:.3em;cursor:text;font:inherit;outline:none;padding:.3em .3em calc(.3em + 1px)}*.input:focus,.context.input:focus,.ad.hoc.input:focus{border-color:blue;box-shadow:0 0 3px 1px #add8e6}*.label,.context.label,.ad.hoc.label{margin:0 .6em 0 1.5em}","*.container,.context.container,.ad.hoc.container{display:flex;min-height:100vh;overflow:hidden;width:100%}*.mainPanel,.context.mainPanel,.ad.hoc.mainPanel{overflow:hidden;padding:1.2em;width:1024px}*.sidePanel,.context.sidePanel,.ad.hoc.sidePanel{flex:1;overflow:hidden}","@keyframes bouncing{from{top:-0.3em}to{top:.3em}}*.container,.context.container,.ad.hoc.container{display:inline-block}*.circle,.context.circle,.ad.hoc.circle{animation:bouncing .4s ease-in infinite alternate;background:#000;border-radius:.3em;display:inline-block;height:.6em;margin:0 .1em;position:relative;width:.6em}*.circle:first-child,.context.circle:first-child,.ad.hoc.circle:first-child{animation-delay:-0.2s}*.circle:last-child,.context.circle:last-child,.ad.hoc.circle:last-child{animation-delay:.2s}","@keyframes appearance{from{opacity:0}to{opacity:1}}*.arrow,.ad.hoc.arrow,.context.arrow{border:.6em solid gray;pointer-events:none;position:absolute;width:0;height:0}*.container,.ad.hoc.container,.context.container{background:gray;border-radius:.3em;color:#fff;display:inline-block;padding:0 .3em;position:absolute;top:0;left:0;animation:appearance .6s}*.wrapper,.ad.hoc.wrapper,.context.wrapper{display:inline-block}","* .container,.context .container,.ad.hoc .container{aspect-ratio:16/9;background:#f5f5f5;position:relative}* .video,.context .video,.ad.hoc .video{height:100%;position:absolute;width:100%}","* .container,.context .container,.ad.hoc .container{position:absolute;text-align:center;top:40%;transform:translateY(50%);width:100%}","*.container,.context.container,.ad.hoc.container{margin:.1em;position:relative}*.textarea,.context.textarea,.ad.hoc.textarea{background:#fff;border:1px solid gray;border-radius:.3em;box-sizing:border-box;font:inherit;height:0;outline:none;overflow:hidden;padding:.3em .3em calc(.3em + 1px);resize:none}*.textarea:focus,.context.textarea:focus,.ad.hoc.textarea:focus{border-color:blue;box-shadow:0 0 3px 1px #add8e6}*.textarea::placeholder,.context.textarea::placeholder,.ad.hoc.textarea::placeholder{color:gray}*.textarea:disabled,.context.textarea:disabled,.ad.hoc.textarea:disabled{border-color:rgba(128,128,128,.34);cursor:not-allowed;color:rgba(128,128,128,.34);user-select:none}*.hidden,.context.hidden,.ad.hoc.hidden{position:absolute;z-index:-1}"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"style.css","mappings":"AAUA,2ZASE,SACA,aACA,eAJA,SACA,UAIA,wBAIF,8EAEE,cAGF,KACE,cAGF,MACE,gBAGF,aACE,YAGF,oDACE,WACA,aAGF,MACE,yBACA,iBC9CF,KACE,oBAGF,EACE,sBCJA,6CACE,gBACA,YACA,OACA,WACA,eACA,MACA,WACA,WCR0B,CDU1B,4EAGF,6CACE,gBAEA,mBADA,2CASA,SAPA,gBACA,gBEPQ,CFQR,gBACA,mBAEA,eACA,QAEA,+BAJA,YAKA,YEeF,yBF5BA,6CAgBI,gBGlCN,SACE,gBCDF,QACE,QACA,WACA,eACA,aCJF,8CASE,kBACE,oBACA,YACA,kBACA,+CAKF,qBACE,+CAGF,qBAtBO,mBAwBL,eACA,gBACA,aACA,2BACA,kBACA,gEACA,iEAEA,iBACE,+BACA,+CAIJ,cACE,aACA,eACA,CAIE,gIAGF,kBACE,WACA,+CAIJ,eACE,CAEA,qBACA,CA1DK,2BAyDL,gBACA,kCACA,eACA,aACA,+CAGF,4DACE,2BAjEK,4BAmEL,SACA,kBACA,kBACA,QACA,MACA,iEAEA,WACE,uEAKF,wBACE,uEAGF,iBACE,4BACA,4FASA,sBACE,4FAGF,2BACE,oEAKJ,kBACE,CA1GG,2BA4GH,CAFA,yBA1GG,CA4GH,eAMA,CClHN,6CAGE,YACE,OACA,gBACA,gBACA,kBACA,8CAGF,4DACE,sBACA,4BACA,SACA,kBACA,oBACA,kBACA,QACA,MACA,gEAEA,WACE,8CAIJ,kBACE,oBACA,YACA,kBACA,2IAGF,8DAEE,6BACA,mEAIA,gCACA,8CAGF,qBACE,iDAGF,wDACA,0DAEA,uBACE,CADF,oBACE,CADF,eACE,gBACA,sBACA,mBACA,cACA,eACA,qBACA,OACA,aACA,eACA,aACA,0CACA,mEAEA,eACE,4BACA,6BACA,gEAGF,iBACE,+BACA,mEAGF,WC1EF,8CACE,mBACA,aACA,SAGF,8CACE,6BACA,mBACA,eACA,aACA,eAEA,gEACE,kBACA,+BAIJ,8CAEE,gBADA,sBAEA,eAGF,8CACE,mBACA,mBACA,sBACA,mBACA,aACA,SACA,aACA,gECpCJ,kBACE,mBCMA,+CACE,6DACA,sBACA,mBACA,cACA,eACA,qBACA,aACA,YACA,mBACA,kBACA,qBACA,gEAEA,uEACE,cAGF,wIAEE,+DAEA,kBADA,oCACA,CAGF,iEAEE,kBADA,+BAEA,aAKJ,+CACE,mBACA,YAKA,wIAEE,6DACA,gBC/CJ,6CACE,6DACA,gBACA,sBACA,mBACA,eACA,aACA,aAEA,SADA,aAEA,YAGE,uFACE,gBACA,mBACA,WACA,cACA,WACA,YACA,UAIJ,+DACE,kBACA,+BAIA,oFACE,gBACA,mBACA,WACA,cACA,YACA,iBACA,UAKN,6CACE,mBACA,oBACA,YAGF,gDACE,sBAGF,6CACE,YAEA,qEACE,6BCxDJ,8CACE,mBACA,oBACA,YAGF,8CACE,sBACA,mBACA,YACA,aACA,aACA,mCAEA,gEACE,kBACA,+BAIJ,8CACE,sBCZF,6CACE,aACA,iBACA,gBACA,WAGF,6CACE,gBACA,cACA,YVNQ,CUSV,6CACE,OACA,gBC3BJ,kBACE,aACA,aAMA,gDACE,qBAGF,6CACE,gDACA,gBACA,mBACA,qBACA,YACA,cACA,kBACA,WAEA,sGACA,kGCvBJ,kBACE,aACA,cAMA,8CACE,uBAIA,SAHA,oBACA,kBACA,OACA,CAOF,8CASE,qBARA,gBACA,mBACA,WACA,qBAIA,OAHA,eACA,kBACA,KAEA,CAGF,iDACE,qBC9BF,iDACE,kBACA,mBACA,kBAGF,iDACE,YACA,kBACA,WCTF,mDACE,kBACA,kBACA,QACA,0BACA,WCHF,8CACE,YACA,kBAGF,8CACE,gBACA,sBACA,mBACA,sBACA,aACA,SACA,aACA,gBACA,mCACA,YAEA,gEACE,kBACA,+BAGF,oGACE,WADF,qFACE,WAGF,yEACE,gCAEA,yBADA,mBAEA,gEAIJ,8CACE,kBACA","sources":["webpack://@dr.pogodin/react-utils/./src/styles/_global/reset.css","webpack://@dr.pogodin/react-utils/./src/styles/global.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/Modal/base-theme.scss","webpack://@dr.pogodin/react-utils/./src/styles/mixins.scss","webpack://@dr.pogodin/react-utils/./src/styles/_mixins/media.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/Modal/styles.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/Options/style.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/NativeDropdown/theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/Switch/theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/GenericLink/style.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/Button/style.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/Checkbox/theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/Input/theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/PageLayout/base-theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/Throbber/theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/WithTooltip/default-theme.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/YouTubeVideo/base.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/YouTubeVideo/throbber.scss","webpack://@dr.pogodin/react-utils/./src/shared/components/TextArea/style.scss"],"sourcesContent":[null,"a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote::before,blockquote::after,q::before,q::after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}body{text-rendering:auto}*{box-sizing:border-box}","*.overlay,.context.overlay,.ad.hoc.overlay{background:#eee;height:100%;left:0;opacity:.8;position:fixed;top:0;width:100%;z-index:998}*.overlay:focus,.context.overlay:focus,.ad.hoc.overlay:focus{outline:none}*.container,.context.container,.ad.hoc.container{background:#fff;box-shadow:0 0 14px 1px rgba(38,38,40,.15);border-radius:.3em;max-height:95vh;max-width:1024px;overflow:hidden;padding:.6em 1.2em;width:480px;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);z-index:999}@media(max-width: 1280px){*.container,.context.container,.ad.hoc.container{max-width:95vw}}",null,null,".scrollingDisabledByModal{overflow:hidden}",".overlay{inset:0;opacity:.2;position:fixed;z-index:1000}","*.container,.context.container,.ad.hoc.container{align-items:center;display:inline-flex;margin:.1em;position:relative}*.label,.context.label,.ad.hoc.label{margin:0 .6em 0 1.2em}*.dropdown,.context.dropdown,.ad.hoc.dropdown{border:1px solid gray;border-radius:.3em;cursor:pointer;min-width:200px;outline:none;padding:.3em 3em .3em .6em;position:relative;user-select:none}*.dropdown:focus,.context.dropdown:focus,.ad.hoc.dropdown:focus{border-color:blue;box-shadow:0 0 3px 1px #add8e6}*.option,.context.option,.ad.hoc.option{cursor:pointer;outline:none;padding:0 .6em}*.option:focus,.context.option:focus,.ad.hoc.option:focus{background:#4169e1;color:#fff}*.option:hover,.context.option:hover,.ad.hoc.option:hover{background:#4169e1;color:#fff}*.select,.context.select,.ad.hoc.select{background:#fff;border:1px solid gray;border-radius:0 0 .3em .3em;border-top:none;box-shadow:0 6px 12px 3px #d3d3d3;position:fixed;z-index:1001}*.arrow,.context.arrow,.ad.hoc.arrow{background-image:linear-gradient(to top, lightgray, white 50%, white);border-left:1px solid gray;border-radius:0 .3em .3em 0;bottom:0;padding:.3em .6em;position:absolute;right:0;top:0}*.arrow::after,.context.arrow::after,.ad.hoc.arrow::after{content:\"▼\"}*.active .arrow,.context.active .arrow,.ad.hoc.active .arrow{border-radius:0 .3em 0 0}*.active .dropdown,.context.active .dropdown,.ad.hoc.active .dropdown{border-color:blue;border-radius:.3em .3em 0 0}*.upward.active .arrow,.context.upward.active .arrow,.ad.hoc.upward.active .arrow{border-radius:0 0 .3em}*.upward.active .dropdown,.context.upward.active .dropdown,.ad.hoc.upward.active .dropdown{border-radius:0 0 .3em .3em}*.upward.select,.context.upward.select,.ad.hoc.upward.select{border-bottom:none;border-top:1px solid gray;border-radius:.3em .3em 0 0;box-shadow:none}","*.dropdown,.context.dropdown,.ad.hoc.dropdown{display:flex;flex:1;min-width:5.5em;overflow:hidden;position:relative}*.arrow,.context.arrow,.ad.hoc.arrow{background-image:linear-gradient(to top, lightgray, white 50%, white);border:1px solid gray;border-radius:0 .3em .3em 0;bottom:0;padding:.3em .6em;pointer-events:none;position:absolute;right:0;top:0}*.arrow::after,.context.arrow::after,.ad.hoc.arrow::after{content:\"▼\"}*.container,.context.container,.ad.hoc.container{align-items:center;display:inline-flex;margin:.1em;position:relative}.active+*.arrow,:active+*.arrow,.active+.context.arrow,:active+.context.arrow,.active+.ad.hoc.arrow,:active+.ad.hoc.arrow{background-image:linear-gradient(to bottom, lightgray, white 50%, white);border-bottom-right-radius:0}:focus+*.arrow,:focus+.context.arrow,:focus+.ad.hoc.arrow{border-color:blue;border-left-color:gray}*.label,.context.label,.ad.hoc.label{margin:0 .6em 0 1.5em}*.option,.context.option,.ad.hoc.option{color:#000}*.hiddenOption,.context.hiddenOption,.ad.hoc.hiddenOption{display:none}*.select,.context.select,.ad.hoc.select{appearance:none;background:#fff;border:1px solid gray;border-radius:.3em;color:inherit;cursor:pointer;display:inline-block;flex:1;font:inherit;max-width:100%;outline:none;padding:.3em 3.3em calc(.3em + 1px) 1.2em}*.select:active,.context.select:active,.ad.hoc.select:active{background:#fff;border-bottom-left-radius:0;border-bottom-right-radius:0}*.select:focus,.context.select:focus,.ad.hoc.select:focus{border-color:blue;box-shadow:0 0 3px 1px #add8e6}*.select.invalid,.context.select.invalid,.ad.hoc.select.invalid{color:gray}","*.container,.context.container,.ad.hoc.container{align-items:center;display:flex;gap:.6em}*.option,.context.option,.ad.hoc.option{border:1px solid rgba(0,0,0,0);border-radius:.3em;cursor:pointer;outline:none;padding:0 .9em}*.option:focus,.context.option:focus,.ad.hoc.option:focus{border-color:blue;box-shadow:0 0 3px 1px #add8e6}*.selected,.context.selected,.ad.hoc.selected{border:1px solid gray;background:#fff;cursor:default}*.options,.context.options,.ad.hoc.options{align-items:center;background:#f5f5f5;border:1px solid gray;border-radius:.3em;display:flex;gap:.3em;padding:.3em;user-select:none}",".link[disabled]{cursor:not-allowed}","*.button,.context.button,.ad.hoc.button{background-image:linear-gradient(to top, lightgray, white 50%, white);border:solid 1px gray;border-radius:.3em;color:inherit;cursor:pointer;display:inline-block;font:inherit;margin:.1em;padding:.3em 1.2em;text-align:center;text-decoration:none;user-select:none}*.button:visited,.context.button:visited,.ad.hoc.button:visited{color:inherit}*.button.active,*.button:active,.context.button.active,.context.button:active,.ad.hoc.button.active,.ad.hoc.button:active{background-image:linear-gradient(to bottom, lightgray, white 50%, white);box-shadow:inset 0 1px 3px 0 #d3d3d3;border-color:gray}*.button:focus,.context.button:focus,.ad.hoc.button:focus{box-shadow:0 0 3px 1px #add8e6;border-color:blue;outline:none}*.disabled,.context.disabled,.ad.hoc.disabled{cursor:not-allowed;opacity:.33}*.disabled.active,*.disabled:active,.context.disabled.active,.context.disabled:active,.ad.hoc.disabled.active,.ad.hoc.disabled:active{background-image:linear-gradient(to top, lightgray, white 50%, white);box-shadow:none}","*.checkbox,.context.checkbox,.ad.hoc.checkbox{appearance:none;background:#fff;border:1px solid gray;border-radius:.3em;cursor:pointer;font:inherit;height:1.5em;outline:none;margin:0;width:1.5em}*.checkbox:checked::after,.context.checkbox:checked::after,.ad.hoc.checkbox:checked::after{background:#000;border-radius:.3em;content:\"\";display:block;height:1em;margin:.2em;width:1em}*.checkbox:focus,.context.checkbox:focus,.ad.hoc.checkbox:focus{border-color:blue;box-shadow:0 0 3px 1px #add8e6}*.checkbox.indeterminate::after,.context.checkbox.indeterminate::after,.ad.hoc.checkbox.indeterminate::after{background:#000;border-radius:.2em;content:\"\";display:block;height:.2em;margin:.6em .2em;width:1em}*.container,.context.container,.ad.hoc.container{align-items:center;display:inline-flex;margin:.1em}*.label,.context.label,.ad.hoc.label{margin:0 .6em 0 1.5em}*.disabled,.context.disabled,.ad.hoc.disabled{opacity:.33}*.disabled .checkbox,.context.disabled .checkbox,.ad.hoc.disabled .checkbox{cursor:not-allowed !important}","*.container,.context.container,.ad.hoc.container{align-items:center;display:inline-flex;margin:.1em}*.input,.context.input,.ad.hoc.input{border:1px solid gray;border-radius:.3em;cursor:text;font:inherit;outline:none;padding:.3em .3em calc(.3em + 1px)}*.input:focus,.context.input:focus,.ad.hoc.input:focus{border-color:blue;box-shadow:0 0 3px 1px #add8e6}*.label,.context.label,.ad.hoc.label{margin:0 .6em 0 1.5em}","*.container,.context.container,.ad.hoc.container{display:flex;min-height:100vh;overflow:hidden;width:100%}*.mainPanel,.context.mainPanel,.ad.hoc.mainPanel{overflow:hidden;padding:1.2em;width:1024px}*.sidePanel,.context.sidePanel,.ad.hoc.sidePanel{flex:1;overflow:hidden}","@keyframes bouncing{from{top:-0.3em}to{top:.3em}}*.container,.context.container,.ad.hoc.container{display:inline-block}*.circle,.context.circle,.ad.hoc.circle{animation:bouncing .4s ease-in infinite alternate;background:#000;border-radius:.3em;display:inline-block;height:.6em;margin:0 .1em;position:relative;width:.6em}*.circle:first-child,.context.circle:first-child,.ad.hoc.circle:first-child{animation-delay:-0.2s}*.circle:last-child,.context.circle:last-child,.ad.hoc.circle:last-child{animation-delay:.2s}","@keyframes appearance{from{opacity:0}to{opacity:1}}*.arrow,.ad.hoc.arrow,.context.arrow{border:.6em solid gray;pointer-events:none;position:absolute;width:0;height:0}*.container,.ad.hoc.container,.context.container{background:gray;border-radius:.3em;color:#fff;display:inline-block;padding:0 .3em;position:absolute;top:0;left:0;animation:appearance .6s}*.wrapper,.ad.hoc.wrapper,.context.wrapper{display:inline-block}","* .container,.context .container,.ad.hoc .container{aspect-ratio:16/9;background:#f5f5f5;position:relative}* .video,.context .video,.ad.hoc .video{height:100%;position:absolute;width:100%}","* .container,.context .container,.ad.hoc .container{position:absolute;text-align:center;top:40%;transform:translateY(50%);width:100%}","*.container,.context.container,.ad.hoc.container{margin:.1em;position:relative}*.textarea,.context.textarea,.ad.hoc.textarea{background:#fff;border:1px solid gray;border-radius:.3em;box-sizing:border-box;font:inherit;height:0;outline:none;overflow:hidden;padding:.3em .3em calc(.3em + 1px);resize:none}*.textarea:focus,.context.textarea:focus,.ad.hoc.textarea:focus{border-color:blue;box-shadow:0 0 3px 1px #add8e6}*.textarea::placeholder,.context.textarea::placeholder,.ad.hoc.textarea::placeholder{color:gray}*.textarea:disabled,.context.textarea:disabled,.ad.hoc.textarea:disabled{border-color:rgba(128,128,128,.34);cursor:not-allowed;color:rgba(128,128,128,.34);user-select:none}*.hidden,.context.hidden,.ad.hoc.hidden{position:absolute;z-index:-1}"],"names":[],"sourceRoot":""}